aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-04-14 10:44:42 -0400
committerIngo Molnar <mingo@kernel.org>2014-04-14 10:44:42 -0400
commit740c699a8d316c8bf8593f19e2ca47795e690622 (patch)
treea78886955770a477945c5d84e06b2e7678733b54 /arch
parente69af4657e7764d03ad555f0b583d9c4217bcefa (diff)
parentc9eaa447e77efe77b7fa4c953bd62de8297fd6c5 (diff)
Merge tag 'v3.15-rc1' into perf/urgent
Pick up the latest fixes. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/Kconfig6
-rw-r--r--arch/alpha/Kconfig1
-rw-r--r--arch/alpha/kernel/pci.c6
-rw-r--r--arch/arc/Kconfig3
-rw-r--r--arch/arc/boot/.gitignore1
-rw-r--r--arch/arc/boot/dts/nsimosci.dts12
-rw-r--r--arch/arc/boot/dts/skeleton.dts10
-rw-r--r--arch/arc/configs/nsimosci_defconfig1
-rw-r--r--arch/arc/include/asm/linkage.h14
-rw-r--r--arch/arc/kernel/ctx_sw_asm.S2
-rw-r--r--arch/arc/kernel/entry.S52
-rw-r--r--arch/arc/kernel/head.S7
-rw-r--r--arch/arc/kernel/time.c37
-rw-r--r--arch/arc/lib/memcmp.S6
-rw-r--r--arch/arc/lib/memcpy-700.S6
-rw-r--r--arch/arc/lib/memset.S10
-rw-r--r--arch/arc/lib/strchr-700.S6
-rw-r--r--arch/arc/lib/strcmp.S6
-rw-r--r--arch/arc/lib/strcpy-700.S6
-rw-r--r--arch/arc/lib/strlen.S6
-rw-r--r--arch/arc/mm/cache_arc700.c3
-rw-r--r--arch/arc/mm/init.c27
-rw-r--r--arch/arc/mm/tlbex.S10
-rw-r--r--arch/arc/plat-arcfpga/Kconfig1
-rw-r--r--arch/arc/plat-arcfpga/platform.c6
-rw-r--r--arch/arm/Kconfig73
-rw-r--r--arch/arm/Kconfig.debug29
-rw-r--r--arch/arm/Makefile10
-rw-r--r--arch/arm/boot/dts/Makefile144
-rw-r--r--arch/arm/boot/dts/am335x-evm.dts60
-rw-r--r--arch/arm/boot/dts/am335x-evmsk.dts56
-rw-r--r--arch/arm/boot/dts/am33xx.dtsi17
-rw-r--r--arch/arm/boot/dts/am3517-craneboard.dts174
-rw-r--r--arch/arm/boot/dts/am4372.dtsi46
-rw-r--r--arch/arm/boot/dts/am437x-gp-evm.dts127
-rw-r--r--arch/arm/boot/dts/am43x-epos-evm.dts183
-rw-r--r--arch/arm/boot/dts/armada-370-db.dts56
-rw-r--r--arch/arm/boot/dts/armada-370-mirabox.dts7
-rw-r--r--arch/arm/boot/dts/armada-370-rd.dts6
-rw-r--r--arch/arm/boot/dts/armada-370-xp.dtsi8
-rw-r--r--arch/arm/boot/dts/armada-370.dtsi33
-rw-r--r--arch/arm/boot/dts/armada-375-db.dts130
-rw-r--r--arch/arm/boot/dts/armada-375.dtsi464
-rw-r--r--arch/arm/boot/dts/armada-380.dtsi117
-rw-r--r--arch/arm/boot/dts/armada-385-db.dts122
-rw-r--r--arch/arm/boot/dts/armada-385-rd.dts94
-rw-r--r--arch/arm/boot/dts/armada-385.dtsi149
-rw-r--r--arch/arm/boot/dts/armada-38x.dtsi376
-rw-r--r--arch/arm/boot/dts/armada-xp-axpwifiap.dts6
-rw-r--r--arch/arm/boot/dts/armada-xp-db.dts13
-rw-r--r--arch/arm/boot/dts/armada-xp-gp.dts22
-rw-r--r--arch/arm/boot/dts/armada-xp-matrix.dts7
-rw-r--r--arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts12
-rw-r--r--arch/arm/boot/dts/armada-xp.dtsi6
-rw-r--r--arch/arm/boot/dts/at91-ariag25.dts1
-rw-r--r--arch/arm/boot/dts/at91-cosino.dtsi1
-rw-r--r--arch/arm/boot/dts/at91-cosino_mega2560.dts1
-rw-r--r--arch/arm/boot/dts/at91sam9260.dtsi11
-rw-r--r--arch/arm/boot/dts/at91sam9261.dtsi735
-rw-r--r--arch/arm/boot/dts/at91sam9261ek.dts211
-rw-r--r--arch/arm/boot/dts/at91sam9g45.dtsi12
-rw-r--r--arch/arm/boot/dts/at91sam9n12.dtsi1
-rw-r--r--arch/arm/boot/dts/at91sam9rl.dtsi802
-rw-r--r--arch/arm/boot/dts/at91sam9rlek.dts157
-rw-r--r--arch/arm/boot/dts/at91sam9x5.dtsi14
-rw-r--r--arch/arm/boot/dts/atlas6.dtsi22
-rw-r--r--arch/arm/boot/dts/bcm11351.dtsi192
-rw-r--r--arch/arm/boot/dts/bcm21664-garnet.dts (renamed from arch/arm/boot/dts/bcm11351-brt.dts)12
-rw-r--r--arch/arm/boot/dts/bcm21664.dtsi292
-rw-r--r--arch/arm/boot/dts/bcm28155-ap.dts51
-rw-r--r--arch/arm/boot/dts/bcm2835.dtsi92
-rw-r--r--arch/arm/boot/dts/bcm4708-netgear-r6250.dts35
-rw-r--r--arch/arm/boot/dts/bcm4708.dtsi34
-rw-r--r--arch/arm/boot/dts/bcm5301x.dtsi95
-rw-r--r--arch/arm/boot/dts/bcm59056.dtsi74
-rw-r--r--arch/arm/boot/dts/dove.dtsi22
-rw-r--r--arch/arm/boot/dts/dra7.dtsi168
-rw-r--r--arch/arm/boot/dts/efm32gg-dk3750.dts2
-rw-r--r--arch/arm/boot/dts/efm32gg.dtsi4
-rw-r--r--arch/arm/boot/dts/exynos4.dtsi92
-rw-r--r--arch/arm/boot/dts/exynos4210-origen.dts2
-rw-r--r--arch/arm/boot/dts/exynos4210-smdkv310.dts2
-rw-r--r--arch/arm/boot/dts/exynos4210-trats.dts63
-rw-r--r--arch/arm/boot/dts/exynos4210-universal_c210.dts66
-rw-r--r--arch/arm/boot/dts/exynos4210.dtsi11
-rw-r--r--arch/arm/boot/dts/exynos4212.dtsi15
-rw-r--r--arch/arm/boot/dts/exynos4412-odroidx.dts4
-rw-r--r--arch/arm/boot/dts/exynos4412-origen.dts6
-rw-r--r--arch/arm/boot/dts/exynos4412-smdk4412.dts2
-rw-r--r--arch/arm/boot/dts/exynos4412-tiny4412.dts2
-rw-r--r--arch/arm/boot/dts/exynos4412-trats2.dts93
-rw-r--r--arch/arm/boot/dts/exynos4412.dtsi16
-rw-r--r--arch/arm/boot/dts/exynos4x12.dtsi60
-rw-r--r--arch/arm/boot/dts/exynos5.dtsi7
-rw-r--r--arch/arm/boot/dts/exynos5250-arndale.dts28
-rw-r--r--arch/arm/boot/dts/exynos5250-smdk5250.dts169
-rw-r--r--arch/arm/boot/dts/exynos5250-snow.dts6
-rw-r--r--arch/arm/boot/dts/exynos5250.dtsi148
-rw-r--r--arch/arm/boot/dts/exynos5420-arndale-octa.dts315
-rw-r--r--arch/arm/boot/dts/exynos5420-smdk5420.dts255
-rw-r--r--arch/arm/boot/dts/exynos5420.dtsi172
-rw-r--r--arch/arm/boot/dts/exynos5440-sd5v1.dts2
-rw-r--r--arch/arm/boot/dts/exynos5440-ssdk5440.dts2
-rw-r--r--arch/arm/boot/dts/exynos5440.dtsi35
-rw-r--r--arch/arm/boot/dts/imx23-evk.dts8
-rw-r--r--arch/arm/boot/dts/imx23-olinuxino.dts5
-rw-r--r--arch/arm/boot/dts/imx23-stmp378x_devb.dts5
-rw-r--r--arch/arm/boot/dts/imx23.dtsi8
-rw-r--r--arch/arm/boot/dts/imx25-eukrea-cpuimx25.dtsi73
-rw-r--r--arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard.dts174
-rw-r--r--arch/arm/boot/dts/imx25-pinfunc.h494
-rw-r--r--arch/arm/boot/dts/imx25.dtsi18
-rw-r--r--arch/arm/boot/dts/imx27-apf27.dts38
-rw-r--r--arch/arm/boot/dts/imx27-apf27dev.dts149
-rw-r--r--arch/arm/boot/dts/imx27-phytec-phycard-s-rdk.dts77
-rw-r--r--arch/arm/boot/dts/imx27-phytec-phycard-s-som.dts44
-rw-r--r--arch/arm/boot/dts/imx27-phytec-phycard-s-som.dtsi103
-rw-r--r--arch/arm/boot/dts/imx27-phytec-phycore-rdk.dts178
-rw-r--r--arch/arm/boot/dts/imx27-phytec-phycore-som.dtsi (renamed from arch/arm/boot/dts/imx27-phytec-phycore-som.dts)133
-rw-r--r--arch/arm/boot/dts/imx27-pinfunc.h526
-rw-r--r--arch/arm/boot/dts/imx27.dtsi207
-rw-r--r--arch/arm/boot/dts/imx28-apf28dev.dts29
-rw-r--r--arch/arm/boot/dts/imx28-apx4devkit.dts5
-rw-r--r--arch/arm/boot/dts/imx28-cfa10036.dts2
-rw-r--r--arch/arm/boot/dts/imx28-cfa10037.dts7
-rw-r--r--arch/arm/boot/dts/imx28-cfa10049.dts31
-rw-r--r--arch/arm/boot/dts/imx28-cfa10057.dts7
-rw-r--r--arch/arm/boot/dts/imx28-cfa10058.dts7
-rw-r--r--arch/arm/boot/dts/imx28-duckbill.dts121
-rw-r--r--arch/arm/boot/dts/imx28-eukrea-mbmx283lc.dts71
-rw-r--r--arch/arm/boot/dts/imx28-eukrea-mbmx287lc.dts50
-rw-r--r--arch/arm/boot/dts/imx28-eukrea-mbmx28lc.dtsi326
-rw-r--r--arch/arm/boot/dts/imx28-evk.dts24
-rw-r--r--arch/arm/boot/dts/imx28-m28cu3.dts17
-rw-r--r--arch/arm/boot/dts/imx28-m28evk.dts20
-rw-r--r--arch/arm/boot/dts/imx28-sps1.dts7
-rw-r--r--arch/arm/boot/dts/imx28-tx28.dts24
-rw-r--r--arch/arm/boot/dts/imx28.dtsi65
-rw-r--r--arch/arm/boot/dts/imx35-eukrea-cpuimx35.dtsi81
-rw-r--r--arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard.dts143
-rw-r--r--arch/arm/boot/dts/imx35.dtsi359
-rw-r--r--arch/arm/boot/dts/imx50-evk.dts119
-rw-r--r--arch/arm/boot/dts/imx50-pinfunc.h923
-rw-r--r--arch/arm/boot/dts/imx50.dtsi478
-rw-r--r--arch/arm/boot/dts/imx51-apf51.dts40
-rw-r--r--arch/arm/boot/dts/imx51-apf51dev.dts113
-rw-r--r--arch/arm/boot/dts/imx51-babbage.dts281
-rw-r--r--arch/arm/boot/dts/imx51-eukrea-cpuimx51.dtsi93
-rw-r--r--arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts175
-rw-r--r--arch/arm/boot/dts/imx51.dtsi481
-rw-r--r--arch/arm/boot/dts/imx53-ard.dts33
-rw-r--r--arch/arm/boot/dts/imx53-evk.dts126
-rw-r--r--arch/arm/boot/dts/imx53-m53evk.dts245
-rw-r--r--arch/arm/boot/dts/imx53-mba53.dts52
-rw-r--r--arch/arm/boot/dts/imx53-qsb-common.dtsi345
-rw-r--r--arch/arm/boot/dts/imx53-qsb.dts210
-rw-r--r--arch/arm/boot/dts/imx53-qsrb.dts158
-rw-r--r--arch/arm/boot/dts/imx53-smd.dts119
-rw-r--r--arch/arm/boot/dts/imx53-tqma53.dtsi175
-rw-r--r--arch/arm/boot/dts/imx53-tx53-x03x.dts315
-rw-r--r--arch/arm/boot/dts/imx53-tx53-x13x.dts243
-rw-r--r--arch/arm/boot/dts/imx53-tx53.dtsi510
-rw-r--r--arch/arm/boot/dts/imx53-voipac-bsb.dts159
-rw-r--r--arch/arm/boot/dts/imx53-voipac-dmm-668.dtsi277
-rw-r--r--arch/arm/boot/dts/imx53.dtsi727
-rw-r--r--arch/arm/boot/dts/imx6dl-dfi-fs700-m60.dts23
-rw-r--r--arch/arm/boot/dts/imx6dl-gw51xx.dts19
-rw-r--r--arch/arm/boot/dts/imx6dl-gw52xx.dts19
-rw-r--r--arch/arm/boot/dts/imx6dl-gw53xx.dts19
-rw-r--r--arch/arm/boot/dts/imx6dl-gw54xx.dts19
-rw-r--r--arch/arm/boot/dts/imx6dl-nitrogen6x.dts21
-rw-r--r--arch/arm/boot/dts/imx6dl-pinfunc.h2
-rw-r--r--arch/arm/boot/dts/imx6dl-sabrelite.dts20
-rw-r--r--arch/arm/boot/dts/imx6dl.dtsi46
-rw-r--r--arch/arm/boot/dts/imx6q-arm2.dts140
-rw-r--r--arch/arm/boot/dts/imx6q-cm-fx6.dts107
-rw-r--r--arch/arm/boot/dts/imx6q-dfi-fs700-m60.dts23
-rw-r--r--arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts372
-rw-r--r--arch/arm/boot/dts/imx6q-gk802.dts171
-rw-r--r--arch/arm/boot/dts/imx6q-gw51xx.dts19
-rw-r--r--arch/arm/boot/dts/imx6q-gw52xx.dts23
-rw-r--r--arch/arm/boot/dts/imx6q-gw53xx.dts23
-rw-r--r--arch/arm/boot/dts/imx6q-gw5400-a.dts546
-rw-r--r--arch/arm/boot/dts/imx6q-gw54xx.dts23
-rw-r--r--arch/arm/boot/dts/imx6q-nitrogen6x.dts25
-rw-r--r--arch/arm/boot/dts/imx6q-phytec-pbab01.dts16
-rw-r--r--arch/arm/boot/dts/imx6q-phytec-pfla02.dtsi167
-rw-r--r--arch/arm/boot/dts/imx6q-pinfunc.h2
-rw-r--r--arch/arm/boot/dts/imx6q-sabrelite.dts178
-rw-r--r--arch/arm/boot/dts/imx6q-sbc6x.dts58
-rw-r--r--arch/arm/boot/dts/imx6q-udoo.dts54
-rw-r--r--arch/arm/boot/dts/imx6q.dtsi146
-rw-r--r--arch/arm/boot/dts/imx6qdl-dfi-fs700-m60.dtsi199
-rw-r--r--arch/arm/boot/dts/imx6qdl-gw51xx.dtsi374
-rw-r--r--arch/arm/boot/dts/imx6qdl-gw52xx.dtsi490
-rw-r--r--arch/arm/boot/dts/imx6qdl-gw53xx.dtsi553
-rw-r--r--arch/arm/boot/dts/imx6qdl-gw54xx.dtsi580
-rw-r--r--arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi422
-rw-r--r--arch/arm/boot/dts/imx6qdl-sabreauto.dtsi378
-rw-r--r--arch/arm/boot/dts/imx6qdl-sabrelite.dtsi423
-rw-r--r--arch/arm/boot/dts/imx6qdl-sabresd.dtsi277
-rw-r--r--arch/arm/boot/dts/imx6qdl-wandboard.dtsi131
-rw-r--r--arch/arm/boot/dts/imx6qdl.dtsi1053
-rw-r--r--arch/arm/boot/dts/imx6sl-evk.dts427
-rw-r--r--arch/arm/boot/dts/imx6sl.dtsi385
-rw-r--r--arch/arm/boot/dts/integratorap.dts35
-rw-r--r--arch/arm/boot/dts/integratorcp.dts102
-rw-r--r--arch/arm/boot/dts/k2e-clocks.dtsi78
-rw-r--r--arch/arm/boot/dts/k2e-evm.dts60
-rw-r--r--arch/arm/boot/dts/k2e.dtsi80
-rw-r--r--arch/arm/boot/dts/k2hk-clocks.dtsi426
-rw-r--r--arch/arm/boot/dts/k2hk-evm.dts83
-rw-r--r--arch/arm/boot/dts/k2hk.dtsi46
-rw-r--r--arch/arm/boot/dts/k2l-clocks.dtsi267
-rw-r--r--arch/arm/boot/dts/k2l-evm.dts37
-rw-r--r--arch/arm/boot/dts/k2l.dtsi55
-rw-r--r--arch/arm/boot/dts/keystone-clocks.dtsi427
-rw-r--r--arch/arm/boot/dts/keystone.dtsi102
-rw-r--r--arch/arm/boot/dts/kirkwood-b3.dts204
-rw-r--r--arch/arm/boot/dts/kirkwood-ds109.dts41
-rw-r--r--arch/arm/boot/dts/kirkwood-ds110jv10.dts41
-rw-r--r--arch/arm/boot/dts/kirkwood-ds111.dts44
-rw-r--r--arch/arm/boot/dts/kirkwood-ds112.dts48
-rw-r--r--arch/arm/boot/dts/kirkwood-ds209.dts44
-rw-r--r--arch/arm/boot/dts/kirkwood-ds210.dts46
-rw-r--r--arch/arm/boot/dts/kirkwood-ds212.dts47
-rw-r--r--arch/arm/boot/dts/kirkwood-ds212j.dts41
-rw-r--r--arch/arm/boot/dts/kirkwood-ds409.dts48
-rw-r--r--arch/arm/boot/dts/kirkwood-ds409slim.dts40
-rw-r--r--arch/arm/boot/dts/kirkwood-ds411.dts52
-rw-r--r--arch/arm/boot/dts/kirkwood-ds411j.dts48
-rw-r--r--arch/arm/boot/dts/kirkwood-ds411slim.dts48
-rw-r--r--arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts62
-rw-r--r--arch/arm/boot/dts/kirkwood-rd88f6192.dts112
-rw-r--r--arch/arm/boot/dts/kirkwood-rd88f6281-a0.dts26
-rw-r--r--arch/arm/boot/dts/kirkwood-rd88f6281-a1.dts31
-rw-r--r--arch/arm/boot/dts/kirkwood-rd88f6281.dtsi152
-rw-r--r--arch/arm/boot/dts/kirkwood-rs212.dts48
-rw-r--r--arch/arm/boot/dts/kirkwood-rs409.dts44
-rw-r--r--arch/arm/boot/dts/kirkwood-rs411.dts44
-rw-r--r--arch/arm/boot/dts/kirkwood-synology.dtsi871
-rw-r--r--arch/arm/boot/dts/kirkwood-t5325.dts208
-rw-r--r--arch/arm/boot/dts/kirkwood-ts419-6281.dts20
-rw-r--r--arch/arm/boot/dts/kirkwood-ts419-6282.dts32
-rw-r--r--arch/arm/boot/dts/kirkwood-ts419.dtsi75
-rw-r--r--arch/arm/boot/dts/kirkwood.dtsi24
-rw-r--r--arch/arm/boot/dts/marco.dtsi3
-rw-r--r--arch/arm/boot/dts/omap-gpmc-smsc9221.dtsi58
-rw-r--r--arch/arm/boot/dts/omap2.dtsi31
-rw-r--r--arch/arm/boot/dts/omap2420.dtsi2
-rw-r--r--arch/arm/boot/dts/omap2430.dtsi22
-rw-r--r--arch/arm/boot/dts/omap3-beagle-xm.dts142
-rw-r--r--arch/arm/boot/dts/omap3-beagle.dts139
-rw-r--r--arch/arm/boot/dts/omap3-cm-t3517.dts136
-rw-r--r--arch/arm/boot/dts/omap3-cm-t3530.dts48
-rw-r--r--arch/arm/boot/dts/omap3-cm-t3730.dts57
-rw-r--r--arch/arm/boot/dts/omap3-cm-t3x.dtsi110
-rw-r--r--arch/arm/boot/dts/omap3-cm-t3x30.dtsi74
-rw-r--r--arch/arm/boot/dts/omap3-devkit8000.dts16
-rw-r--r--arch/arm/boot/dts/omap3-gta04.dts51
-rw-r--r--arch/arm/boot/dts/omap3-igep.dtsi1
-rw-r--r--arch/arm/boot/dts/omap3-igep0020.dts58
-rw-r--r--arch/arm/boot/dts/omap3-ldp.dts23
-rw-r--r--arch/arm/boot/dts/omap3-lilly-a83x.dtsi459
-rw-r--r--arch/arm/boot/dts/omap3-lilly-dbb056.dts170
-rw-r--r--arch/arm/boot/dts/omap3-n900.dts167
-rw-r--r--arch/arm/boot/dts/omap3-overo-alto35-common.dtsi77
-rw-r--r--arch/arm/boot/dts/omap3-overo-alto35.dts22
-rw-r--r--arch/arm/boot/dts/omap3-overo-base.dtsi221
-rw-r--r--arch/arm/boot/dts/omap3-overo-chestnut43-common.dtsi69
-rw-r--r--arch/arm/boot/dts/omap3-overo-chestnut43.dts38
-rw-r--r--arch/arm/boot/dts/omap3-overo-common-peripherals.dtsi94
-rw-r--r--arch/arm/boot/dts/omap3-overo-gallop43-common.dtsi57
-rw-r--r--arch/arm/boot/dts/omap3-overo-gallop43.dts38
-rw-r--r--arch/arm/boot/dts/omap3-overo-palo43-common.dtsi53
-rw-r--r--arch/arm/boot/dts/omap3-overo-palo43.dts38
-rw-r--r--arch/arm/boot/dts/omap3-overo-storm-alto35.dts21
-rw-r--r--arch/arm/boot/dts/omap3-overo-storm-chestnut43.dts38
-rw-r--r--arch/arm/boot/dts/omap3-overo-storm-gallop43.dts38
-rw-r--r--arch/arm/boot/dts/omap3-overo-storm-palo43.dts38
-rw-r--r--arch/arm/boot/dts/omap3-overo-storm-summit.dts30
-rw-r--r--arch/arm/boot/dts/omap3-overo-storm-tobi.dts2
-rw-r--r--arch/arm/boot/dts/omap3-overo-storm.dtsi35
-rw-r--r--arch/arm/boot/dts/omap3-overo-summit-common.dtsi31
-rw-r--r--arch/arm/boot/dts/omap3-overo-summit.dts30
-rw-r--r--arch/arm/boot/dts/omap3-overo-tobi-common.dtsi51
-rw-r--r--arch/arm/boot/dts/omap3-overo-tobi.dts2
-rw-r--r--arch/arm/boot/dts/omap3-overo.dtsi98
-rw-r--r--arch/arm/boot/dts/omap3-sb-t35.dtsi29
-rw-r--r--arch/arm/boot/dts/omap3-sbc-t3517.dts43
-rw-r--r--arch/arm/boot/dts/omap3-sbc-t3530.dts36
-rw-r--r--arch/arm/boot/dts/omap3-sbc-t3730.dts23
-rw-r--r--arch/arm/boot/dts/omap3.dtsi98
-rw-r--r--arch/arm/boot/dts/omap3430-sdp.dts7
-rw-r--r--arch/arm/boot/dts/omap3430es1-clocks.dtsi16
-rw-r--r--arch/arm/boot/dts/omap36xx-am35xx-omap3430es2plus-clocks.dtsi6
-rw-r--r--arch/arm/boot/dts/omap36xx-clocks.dtsi20
-rw-r--r--arch/arm/boot/dts/omap36xx-omap3430es2plus-clocks.dtsi10
-rw-r--r--arch/arm/boot/dts/omap36xx.dtsi28
-rw-r--r--arch/arm/boot/dts/omap3xxx-clocks.dtsi8
-rw-r--r--arch/arm/boot/dts/omap4-duovero-parlor.dts146
-rw-r--r--arch/arm/boot/dts/omap4-duovero.dtsi252
-rw-r--r--arch/arm/boot/dts/omap4-panda-common.dtsi146
-rw-r--r--arch/arm/boot/dts/omap4-sdp.dts146
-rw-r--r--arch/arm/boot/dts/omap4.dtsi168
-rw-r--r--arch/arm/boot/dts/omap443x.dtsi26
-rw-r--r--arch/arm/boot/dts/omap4460.dtsi37
-rw-r--r--arch/arm/boot/dts/omap5-uevm.dts8
-rw-r--r--arch/arm/boot/dts/omap5.dtsi68
-rw-r--r--arch/arm/boot/dts/prima2.dtsi25
-rw-r--r--arch/arm/boot/dts/qcom-msm8660-surf.dts59
-rw-r--r--arch/arm/boot/dts/qcom-msm8660.dtsi87
-rw-r--r--arch/arm/boot/dts/qcom-msm8960-cdp.dts66
-rw-r--r--arch/arm/boot/dts/qcom-msm8960.dtsi135
-rw-r--r--arch/arm/boot/dts/qcom-msm8974.dtsi81
-rw-r--r--arch/arm/boot/dts/r7s72100-genmai-reference.dts13
-rw-r--r--arch/arm/boot/dts/r7s72100.dtsi147
-rw-r--r--arch/arm/boot/dts/r8a7778-bockw-reference.dts4
-rw-r--r--arch/arm/boot/dts/r8a7778.dtsi40
-rw-r--r--arch/arm/boot/dts/r8a7790-lager.dts153
-rw-r--r--arch/arm/boot/dts/r8a7790.dtsi192
-rw-r--r--arch/arm/boot/dts/r8a7791-koelsch-reference.dts115
-rw-r--r--arch/arm/boot/dts/r8a7791-koelsch.dts274
-rw-r--r--arch/arm/boot/dts/r8a7791.dtsi325
-rw-r--r--arch/arm/boot/dts/rk3066a.dtsi13
-rw-r--r--arch/arm/boot/dts/rk3188.dtsi13
-rw-r--r--arch/arm/boot/dts/rk3xxx.dtsi10
-rw-r--r--arch/arm/boot/dts/sama5d3.dtsi28
-rw-r--r--arch/arm/boot/dts/sama5d3xdm.dtsi6
-rw-r--r--arch/arm/boot/dts/socfpga.dtsi41
-rw-r--r--arch/arm/boot/dts/socfpga_arria5.dtsi11
-rw-r--r--arch/arm/boot/dts/socfpga_arria5_socdk.dts21
-rw-r--r--arch/arm/boot/dts/socfpga_cyclone5.dtsi11
-rw-r--r--arch/arm/boot/dts/socfpga_cyclone5_socdk.dts14
-rw-r--r--arch/arm/boot/dts/socfpga_cyclone5_sockit.dts17
-rw-r--r--arch/arm/boot/dts/socfpga_vt.dts16
-rw-r--r--arch/arm/boot/dts/ste-dbx5x0.dtsi12
-rw-r--r--arch/arm/boot/dts/ste-href-ab8500.dtsi428
-rw-r--r--arch/arm/boot/dts/ste-href-ab8505.dtsi240
-rw-r--r--arch/arm/boot/dts/ste-hrefprev60.dtsi1
-rw-r--r--arch/arm/boot/dts/ste-hrefv60plus.dtsi1
-rw-r--r--arch/arm/boot/dts/ste-snowball.dts1
-rw-r--r--arch/arm/boot/dts/ste-u300.dts2
-rw-r--r--arch/arm/boot/dts/stih415-clock.dtsi14
-rw-r--r--arch/arm/boot/dts/stih415-pinctrl.dtsi204
-rw-r--r--arch/arm/boot/dts/stih415.dtsi70
-rw-r--r--arch/arm/boot/dts/stih416-clock.dtsi14
-rw-r--r--arch/arm/boot/dts/stih416-pinctrl.dtsi210
-rw-r--r--arch/arm/boot/dts/stih416.dtsi79
-rw-r--r--arch/arm/boot/dts/stih41x-b2000.dtsi22
-rw-r--r--arch/arm/boot/dts/stih41x-b2020.dtsi14
-rw-r--r--arch/arm/boot/dts/stih41x-b2020x.dtsi28
-rw-r--r--arch/arm/boot/dts/sun4i-a10-a1000.dts55
-rw-r--r--arch/arm/boot/dts/sun4i-a10-cubieboard.dts40
-rw-r--r--arch/arm/boot/dts/sun4i-a10-hackberry.dts56
-rw-r--r--arch/arm/boot/dts/sun4i-a10-inet97fv2.dts69
-rw-r--r--arch/arm/boot/dts/sun4i-a10-mini-xplus.dts31
-rw-r--r--arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts111
-rw-r--r--arch/arm/boot/dts/sun4i-a10-pcduino.dts79
-rw-r--r--arch/arm/boot/dts/sun4i-a10.dtsi215
-rw-r--r--arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts27
-rw-r--r--arch/arm/boot/dts/sun5i-a10s.dtsi160
-rw-r--r--arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts27
-rw-r--r--arch/arm/boot/dts/sun5i-a13-olinuxino.dts27
-rw-r--r--arch/arm/boot/dts/sun5i-a13.dtsi161
-rw-r--r--arch/arm/boot/dts/sun6i-a31-colombus.dts18
-rw-r--r--arch/arm/boot/dts/sun6i-a31.dtsi188
-rw-r--r--arch/arm/boot/dts/sun7i-a20-cubieboard2.dts53
-rw-r--r--arch/arm/boot/dts/sun7i-a20-cubietruck.dts61
-rw-r--r--arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts68
-rw-r--r--arch/arm/boot/dts/sun7i-a20.dtsi302
-rw-r--r--arch/arm/boot/dts/sunxi-common-regulators.dtsi75
-rw-r--r--arch/arm/boot/dts/tegra114-dalmore.dts9
-rw-r--r--arch/arm/boot/dts/tegra114.dtsi8
-rw-r--r--arch/arm/boot/dts/tegra124-venice2.dts312
-rw-r--r--arch/arm/boot/dts/tegra124.dtsi339
-rw-r--r--arch/arm/boot/dts/tegra20-paz00.dts46
-rw-r--r--arch/arm/boot/dts/tegra20-seaboard.dts55
-rw-r--r--arch/arm/boot/dts/tegra20-ventana.dts39
-rw-r--r--arch/arm/boot/dts/tegra20.dtsi4
-rw-r--r--arch/arm/boot/dts/tegra30-cardhu.dtsi7
-rw-r--r--arch/arm/boot/dts/tegra30.dtsi6
-rw-r--r--arch/arm/boot/dts/tps65910.dtsi5
-rw-r--r--arch/arm/boot/dts/twl4030.dtsi7
-rw-r--r--arch/arm/boot/dts/vf610-cosmic.dts29
-rw-r--r--arch/arm/boot/dts/vf610-twr.dts158
-rw-r--r--arch/arm/boot/dts/vf610.dtsi273
-rw-r--r--arch/arm/boot/dts/zynq-7000.dtsi43
-rw-r--r--arch/arm/common/Makefile1
-rw-r--r--arch/arm/common/scoop.c2
-rw-r--r--arch/arm/common/timer-sp.c8
-rw-r--r--arch/arm/configs/ape6evm_defconfig2
-rw-r--r--arch/arm/configs/armadillo800eva_defconfig2
-rw-r--r--arch/arm/configs/at91_dt_defconfig3
-rw-r--r--arch/arm/configs/at91sam9260_9g20_defconfig9
-rw-r--r--arch/arm/configs/at91sam9rl_defconfig10
-rw-r--r--arch/arm/configs/bcm2835_defconfig1
-rw-r--r--arch/arm/configs/bcm_defconfig7
-rw-r--r--arch/arm/configs/bockw_defconfig2
-rw-r--r--arch/arm/configs/clps711x_defconfig3
-rw-r--r--arch/arm/configs/da8xx_omapl_defconfig139
-rw-r--r--arch/arm/configs/davinci_all_defconfig25
-rw-r--r--arch/arm/configs/dove_defconfig3
-rw-r--r--arch/arm/configs/exynos_defconfig2
-rw-r--r--arch/arm/configs/genmai_defconfig8
-rw-r--r--arch/arm/configs/imx_v4_v5_defconfig1
-rw-r--r--arch/arm/configs/imx_v6_v7_defconfig7
-rw-r--r--arch/arm/configs/keystone_defconfig15
-rw-r--r--arch/arm/configs/koelsch_defconfig21
-rw-r--r--arch/arm/configs/kzm9d_defconfig89
-rw-r--r--arch/arm/configs/kzm9g_defconfig2
-rw-r--r--arch/arm/configs/lager_defconfig21
-rw-r--r--arch/arm/configs/mackerel_defconfig2
-rw-r--r--arch/arm/configs/marzen_defconfig2
-rw-r--r--arch/arm/configs/multi_v5_defconfig190
-rw-r--r--arch/arm/configs/multi_v7_defconfig25
-rw-r--r--arch/arm/configs/mvebu_v5_defconfig181
-rw-r--r--arch/arm/configs/mvebu_v7_defconfig (renamed from arch/arm/configs/mvebu_defconfig)10
-rw-r--r--arch/arm/configs/omap2plus_defconfig3
-rw-r--r--arch/arm/configs/shmobile_defconfig129
-rw-r--r--arch/arm/configs/socfpga_defconfig6
-rw-r--r--arch/arm/configs/sunxi_defconfig3
-rw-r--r--arch/arm/configs/tegra_defconfig7
-rw-r--r--arch/arm/firmware/Kconfig3
-rw-r--r--arch/arm/firmware/trusted_foundations.c20
-rw-r--r--arch/arm/include/asm/assembler.h50
-rw-r--r--arch/arm/include/asm/atomic.h44
-rw-r--r--arch/arm/include/asm/cmpxchg.h6
-rw-r--r--arch/arm/include/asm/cputype.h20
-rw-r--r--arch/arm/include/asm/dma-iommu.h12
-rw-r--r--arch/arm/include/asm/firmware.h4
-rw-r--r--arch/arm/include/asm/floppy.h2
-rw-r--r--arch/arm/include/asm/futex.h9
-rw-r--r--arch/arm/include/asm/hardware/cache-feroceon-l2.h (renamed from arch/arm/plat-orion/include/plat/cache-feroceon-l2.h)4
-rw-r--r--arch/arm/include/asm/hw_breakpoint.h1
-rw-r--r--arch/arm/include/asm/hwcap.h3
-rw-r--r--arch/arm/include/asm/jump_label.h1
-rw-r--r--arch/arm/include/asm/kprobes.h17
-rw-r--r--arch/arm/include/asm/kvm_arm.h4
-rw-r--r--arch/arm/include/asm/kvm_asm.h4
-rw-r--r--arch/arm/include/asm/kvm_host.h9
-rw-r--r--arch/arm/include/asm/kvm_mmu.h30
-rw-r--r--arch/arm/include/asm/memory.h41
-rw-r--r--arch/arm/include/asm/pgtable-2level.h1
-rw-r--r--arch/arm/include/asm/pgtable.h7
-rw-r--r--arch/arm/include/asm/pmu.h2
-rw-r--r--arch/arm/include/asm/probes.h43
-rw-r--r--arch/arm/include/asm/ptrace.h14
-rw-r--r--arch/arm/include/asm/smp.h10
-rw-r--r--arch/arm/include/asm/sync_bitops.h1
-rw-r--r--arch/arm/include/asm/syscall.h5
-rw-r--r--arch/arm/include/asm/system.h7
-rw-r--r--arch/arm/include/asm/thread_info.h5
-rw-r--r--arch/arm/include/asm/timex.h6
-rw-r--r--arch/arm/include/asm/trusted_foundations.h13
-rw-r--r--arch/arm/include/asm/uaccess.h2
-rw-r--r--arch/arm/include/asm/unistd.h1
-rw-r--r--arch/arm/include/asm/uprobes.h45
-rw-r--r--arch/arm/include/asm/xen/page.h15
-rw-r--r--arch/arm/include/debug/samsung.S2
-rw-r--r--arch/arm/include/debug/tegra.S18
-rw-r--r--arch/arm/include/debug/zynq.S3
-rw-r--r--arch/arm/include/uapi/asm/hwcap.h9
-rw-r--r--arch/arm/kernel/Makefile7
-rw-r--r--arch/arm/kernel/armksyms.c2
-rw-r--r--arch/arm/kernel/asm-offsets.c1
-rw-r--r--arch/arm/kernel/bios32.c46
-rw-r--r--arch/arm/kernel/crash_dump.c2
-rw-r--r--arch/arm/kernel/devtree.c40
-rw-r--r--arch/arm/kernel/entry-header.S11
-rw-r--r--arch/arm/kernel/ftrace.c4
-rw-r--r--arch/arm/kernel/head.S17
-rw-r--r--arch/arm/kernel/hw_breakpoint.c11
-rw-r--r--arch/arm/kernel/kprobes-arm.c806
-rw-r--r--arch/arm/kernel/kprobes-common.c473
-rw-r--r--arch/arm/kernel/kprobes-test-arm.c604
-rw-r--r--arch/arm/kernel/kprobes-test-thumb.c447
-rw-r--r--arch/arm/kernel/kprobes-test.c25
-rw-r--r--arch/arm/kernel/kprobes-test.h2
-rw-r--r--arch/arm/kernel/kprobes-thumb.c1165
-rw-r--r--arch/arm/kernel/kprobes.c34
-rw-r--r--arch/arm/kernel/kprobes.h400
-rw-r--r--arch/arm/kernel/perf_event.c27
-rw-r--r--arch/arm/kernel/perf_event_cpu.c113
-rw-r--r--arch/arm/kernel/perf_event_v7.c717
-rw-r--r--arch/arm/kernel/pj4-cp0.c4
-rw-r--r--arch/arm/kernel/probes-arm.c734
-rw-r--r--arch/arm/kernel/probes-arm.h73
-rw-r--r--arch/arm/kernel/probes-thumb.c882
-rw-r--r--arch/arm/kernel/probes-thumb.h97
-rw-r--r--arch/arm/kernel/probes.c456
-rw-r--r--arch/arm/kernel/probes.h407
-rw-r--r--arch/arm/kernel/process.c12
-rw-r--r--arch/arm/kernel/setup.c16
-rw-r--r--arch/arm/kernel/signal.c4
-rw-r--r--arch/arm/kernel/smp.c3
-rw-r--r--arch/arm/kernel/smp_twd.c2
-rw-r--r--arch/arm/kernel/sys_oabi-compat.c3
-rw-r--r--arch/arm/kernel/traps.c1
-rw-r--r--arch/arm/kernel/unwind.c137
-rw-r--r--arch/arm/kernel/uprobes-arm.c234
-rw-r--r--arch/arm/kernel/uprobes.c210
-rw-r--r--arch/arm/kernel/uprobes.h35
-rw-r--r--arch/arm/kvm/arm.c7
-rw-r--r--arch/arm/kvm/coproc.c84
-rw-r--r--arch/arm/kvm/coproc.h14
-rw-r--r--arch/arm/kvm/coproc_a15.c2
-rw-r--r--arch/arm/kvm/coproc_a7.c2
-rw-r--r--arch/arm/kvm/guest.c1
-rw-r--r--arch/arm/kvm/interrupts_head.S21
-rw-r--r--arch/arm/kvm/mmu.c110
-rw-r--r--arch/arm/lib/bitops.h5
-rw-r--r--arch/arm/lib/copy_template.S36
-rw-r--r--arch/arm/lib/csumpartialcopygeneric.S96
-rw-r--r--arch/arm/lib/io-readsl.S12
-rw-r--r--arch/arm/lib/io-writesl.S12
-rw-r--r--arch/arm/lib/memmove.S36
-rw-r--r--arch/arm/lib/uaccess.S192
-rw-r--r--arch/arm/mach-at91/Kconfig25
-rw-r--r--arch/arm/mach-at91/Kconfig.non_dt8
-rw-r--r--arch/arm/mach-at91/at91rm9200.c1
-rw-r--r--arch/arm/mach-at91/at91rm9200_devices.c11
-rw-r--r--arch/arm/mach-at91/at91rm9200_time.c1
-rw-r--r--arch/arm/mach-at91/at91sam9260.c1
-rw-r--r--arch/arm/mach-at91/at91sam9260_devices.c14
-rw-r--r--arch/arm/mach-at91/at91sam9261.c26
-rw-r--r--arch/arm/mach-at91/at91sam9261_devices.c5
-rw-r--r--arch/arm/mach-at91/at91sam9263.c2
-rw-r--r--arch/arm/mach-at91/at91sam9263_devices.c5
-rw-r--r--arch/arm/mach-at91/at91sam926x_time.c1
-rw-r--r--arch/arm/mach-at91/at91sam9g45.c2
-rw-r--r--arch/arm/mach-at91/at91sam9g45_devices.c6
-rw-r--r--arch/arm/mach-at91/at91sam9n12.c1
-rw-r--r--arch/arm/mach-at91/at91sam9rl.c25
-rw-r--r--arch/arm/mach-at91/at91sam9rl_devices.c6
-rw-r--r--arch/arm/mach-at91/at91sam9x5.c1
-rw-r--r--arch/arm/mach-at91/at91x40.c2
-rw-r--r--arch/arm/mach-at91/at91x40_time.c1
-rw-r--r--arch/arm/mach-at91/board-dt-sam9.c11
-rw-r--r--arch/arm/mach-at91/board-gsia18s.c1
-rw-r--r--arch/arm/mach-at91/board-pcontrol-g20.c1
-rw-r--r--arch/arm/mach-at91/board-stamp9g20.c1
-rw-r--r--arch/arm/mach-at91/include/mach/at91x40.h2
-rw-r--r--arch/arm/mach-at91/include/mach/timex.h37
-rw-r--r--arch/arm/mach-at91/pm.c1
-rw-r--r--arch/arm/mach-at91/sam9_smc.c3
-rw-r--r--arch/arm/mach-at91/setup.c2
-rw-r--r--arch/arm/mach-bcm/Kconfig47
-rw-r--r--arch/arm/mach-bcm/Makefile8
-rw-r--r--arch/arm/mach-bcm/bcm_5301x.c61
-rw-r--r--arch/arm/mach-bcm/board_bcm21664.c78
-rw-r--r--arch/arm/mach-bcm/board_bcm281xx.c83
-rw-r--r--arch/arm/mach-bcm/board_bcm2835.c (renamed from arch/arm/mach-bcm2835/bcm2835.c)0
-rw-r--r--arch/arm/mach-bcm/kona.c64
-rw-r--r--arch/arm/mach-bcm/kona.h7
-rw-r--r--arch/arm/mach-bcm2835/Kconfig15
-rw-r--r--arch/arm/mach-bcm2835/Makefile1
-rw-r--r--arch/arm/mach-berlin/Kconfig4
-rw-r--r--arch/arm/mach-clps711x/Kconfig14
-rw-r--r--arch/arm/mach-clps711x/board-autcpu12.c4
-rw-r--r--arch/arm/mach-clps711x/board-cdb89712.c2
-rw-r--r--arch/arm/mach-clps711x/board-clep7312.c2
-rw-r--r--arch/arm/mach-clps711x/board-edb7211.c2
-rw-r--r--arch/arm/mach-clps711x/board-p720t.c2
-rw-r--r--arch/arm/mach-clps711x/common.c201
-rw-r--r--arch/arm/mach-clps711x/common.h5
-rw-r--r--arch/arm/mach-clps711x/include/mach/clps711x.h16
-rw-r--r--arch/arm/mach-clps711x/include/mach/hardware.h17
-rw-r--r--arch/arm/mach-clps711x/include/mach/timex.h2
-rw-r--r--arch/arm/mach-cns3xxx/Kconfig3
-rw-r--r--arch/arm/mach-cns3xxx/cns3420vb.c1
-rw-r--r--arch/arm/mach-cns3xxx/core.c35
-rw-r--r--arch/arm/mach-cns3xxx/pcie.c105
-rw-r--r--arch/arm/mach-davinci/Kconfig17
-rw-r--r--arch/arm/mach-davinci/Makefile2
-rw-r--r--arch/arm/mach-davinci/Makefile.boot20
-rw-r--r--arch/arm/mach-davinci/aemif.c107
-rw-r--r--arch/arm/mach-davinci/board-da830-evm.c3
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c3
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c16
-rw-r--r--arch/arm/mach-davinci/board-dm646x-evm.c3
-rw-r--r--arch/arm/mach-davinci/board-mityomapl138.c4
-rw-r--r--arch/arm/mach-davinci/board-tnetv107x-evm.c287
-rw-r--r--arch/arm/mach-davinci/davinci.h2
-rw-r--r--arch/arm/mach-davinci/devices-tnetv107x.c434
-rw-r--r--arch/arm/mach-davinci/devices.c17
-rw-r--r--arch/arm/mach-davinci/dm355.c8
-rw-r--r--arch/arm/mach-davinci/dm365.c8
-rw-r--r--arch/arm/mach-davinci/dm644x.c8
-rw-r--r--arch/arm/mach-davinci/dm646x.c8
-rw-r--r--arch/arm/mach-davinci/include/mach/cputype.h8
-rw-r--r--arch/arm/mach-davinci/include/mach/irqs.h97
-rw-r--r--arch/arm/mach-davinci/include/mach/mux.h269
-rw-r--r--arch/arm/mach-davinci/include/mach/psc.h47
-rw-r--r--arch/arm/mach-davinci/include/mach/serial.h8
-rw-r--r--arch/arm/mach-davinci/include/mach/timex.h22
-rw-r--r--arch/arm/mach-davinci/include/mach/tnetv107x.h61
-rw-r--r--arch/arm/mach-davinci/include/mach/uncompress.h6
-rw-r--r--arch/arm/mach-davinci/tnetv107x.c766
-rw-r--r--arch/arm/mach-dove/Kconfig12
-rw-r--r--arch/arm/mach-dove/Makefile1
-rw-r--r--arch/arm/mach-dove/include/mach/bridge-regs.h1
-rw-r--r--arch/arm/mach-dove/include/mach/timex.h9
-rw-r--r--arch/arm/mach-ebsa110/core.c2
-rw-r--r--arch/arm/mach-ebsa110/include/mach/timex.h19
-rw-r--r--arch/arm/mach-efm32/include/mach/entry-macro.S4
-rw-r--r--arch/arm/mach-efm32/include/mach/timex.h3
-rw-r--r--arch/arm/mach-ep93xx/core.c3
-rw-r--r--arch/arm/mach-ep93xx/include/mach/timex.h5
-rw-r--r--arch/arm/mach-exynos/Kconfig17
-rw-r--r--arch/arm/mach-exynos/Makefile9
-rw-r--r--arch/arm/mach-exynos/common.h17
-rw-r--r--arch/arm/mach-exynos/cpuidle.c4
-rw-r--r--arch/arm/mach-exynos/exynos.c (renamed from arch/arm/mach-exynos/common.c)237
-rw-r--r--arch/arm/mach-exynos/include/mach/hardware.h18
-rw-r--r--arch/arm/mach-exynos/include/mach/pm-core.h75
-rw-r--r--arch/arm/mach-exynos/include/mach/timex.h29
-rw-r--r--arch/arm/mach-exynos/include/mach/uncompress.h48
-rw-r--r--arch/arm/mach-exynos/mach-exynos4-dt.c59
-rw-r--r--arch/arm/mach-exynos/mach-exynos5-dt.c81
-rw-r--r--arch/arm/mach-exynos/mfc.h16
-rw-r--r--arch/arm/mach-exynos/platsmp.c2
-rw-r--r--arch/arm/mach-exynos/pm.c316
-rw-r--r--arch/arm/mach-exynos/pm_domains.c2
-rw-r--r--arch/arm/mach-exynos/regs-pmu.h3
-rw-r--r--arch/arm/mach-exynos/sleep.S85
-rw-r--r--arch/arm/mach-footbridge/Kconfig2
-rw-r--r--arch/arm/mach-footbridge/Makefile3
-rw-r--r--arch/arm/mach-footbridge/cats-hw.c2
-rw-r--r--arch/arm/mach-footbridge/dc21285-timer.c6
-rw-r--r--arch/arm/mach-footbridge/dc21285.c10
-rw-r--r--arch/arm/mach-footbridge/include/mach/timex.h18
-rw-r--r--arch/arm/mach-footbridge/isa-timer.c2
-rw-r--r--arch/arm/mach-gemini/idle.c2
-rw-r--r--arch/arm/mach-gemini/include/mach/timex.h13
-rw-r--r--arch/arm/mach-highbank/Kconfig7
-rw-r--r--arch/arm/mach-hisi/Kconfig6
-rw-r--r--arch/arm/mach-hisi/Makefile3
-rw-r--r--arch/arm/mach-hisi/hotplug.c2
-rw-r--r--arch/arm/mach-imx/Kconfig57
-rw-r--r--arch/arm/mach-imx/Makefile9
-rw-r--r--arch/arm/mach-imx/clk-imx21.c1
-rw-r--r--arch/arm/mach-imx/clk-imx25.c8
-rw-r--r--arch/arm/mach-imx/clk-imx27.c1
-rw-r--r--arch/arm/mach-imx/clk-imx51-imx53.c2
-rw-r--r--arch/arm/mach-imx/clk-imx6q.c7
-rw-r--r--arch/arm/mach-imx/clk-imx6sl.c159
-rw-r--r--arch/arm/mach-imx/clk-vf610.c36
-rw-r--r--arch/arm/mach-imx/common.h17
-rw-r--r--arch/arm/mach-imx/cpuidle-imx6q.c4
-rw-r--r--arch/arm/mach-imx/cpuidle-imx6sl.c57
-rw-r--r--arch/arm/mach-imx/cpuidle.h5
-rw-r--r--arch/arm/mach-imx/devices-imx25.h4
-rw-r--r--arch/arm/mach-imx/devices-imx51.h4
-rw-r--r--arch/arm/mach-imx/devices/Kconfig3
-rw-r--r--arch/arm/mach-imx/devices/Makefile1
-rw-r--r--arch/arm/mach-imx/devices/devices-common.h9
-rw-r--r--arch/arm/mach-imx/devices/platform-mxc_pwm.c69
-rw-r--r--arch/arm/mach-imx/hardware.h4
-rw-r--r--arch/arm/mach-imx/headsmp.S40
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c98
-rw-r--r--arch/arm/mach-imx/mach-imx6sl.c6
-rw-r--r--arch/arm/mach-imx/mach-mx27ads.c55
-rw-r--r--arch/arm/mach-imx/mach-mx31moboard.c21
-rw-r--r--arch/arm/mach-imx/pm-imx6.c551
-rw-r--r--arch/arm/mach-imx/pm-imx6q.c240
-rw-r--r--arch/arm/mach-imx/suspend-imx6.S361
-rw-r--r--arch/arm/mach-imx/time.c12
-rw-r--r--arch/arm/mach-integrator/Kconfig11
-rw-r--r--arch/arm/mach-integrator/core.c4
-rw-r--r--arch/arm/mach-integrator/hardware.h (renamed from arch/arm/mach-integrator/include/mach/platform.h)110
-rw-r--r--arch/arm/mach-integrator/impd1.c85
-rw-r--r--arch/arm/mach-integrator/impd1.h (renamed from arch/arm/mach-integrator/include/mach/impd1.h)4
-rw-r--r--arch/arm/mach-integrator/include/mach/hardware.h45
-rw-r--r--arch/arm/mach-integrator/include/mach/timex.h26
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c27
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c23
-rw-r--r--arch/arm/mach-integrator/leds.c4
-rw-r--r--arch/arm/mach-integrator/lm.c2
-rw-r--r--arch/arm/mach-integrator/lm.h (renamed from arch/arm/mach-integrator/include/mach/lm.h)0
-rw-r--r--arch/arm/mach-integrator/pci_v3.c4
-rw-r--r--arch/arm/mach-iop13xx/include/mach/timex.h1
-rw-r--r--arch/arm/mach-iop32x/include/mach/timex.h6
-rw-r--r--arch/arm/mach-iop33x/include/mach/timex.h6
-rw-r--r--arch/arm/mach-ixp4xx/common-pci.c39
-rw-r--r--arch/arm/mach-ixp4xx/common.c77
-rw-r--r--arch/arm/mach-ixp4xx/dsmg600-setup.c3
-rw-r--r--arch/arm/mach-ixp4xx/fsg-setup.c6
-rw-r--r--arch/arm/mach-ixp4xx/goramo_mlr.c43
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/io.h3
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/timex.h16
-rw-r--r--arch/arm/mach-ixp4xx/nas100d-setup.c3
-rw-r--r--arch/arm/mach-ixp4xx/nslu2-setup.c6
-rw-r--r--arch/arm/mach-ixp4xx/omixp-setup.c2
-rw-r--r--arch/arm/mach-keystone/Kconfig4
-rw-r--r--arch/arm/mach-keystone/keystone.c2
-rw-r--r--arch/arm/mach-kirkwood/Kconfig7
-rw-r--r--arch/arm/mach-kirkwood/Makefile4
-rw-r--r--arch/arm/mach-kirkwood/board-dt.c113
-rw-r--r--arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c50
-rw-r--r--arch/arm/mach-kirkwood/common.c3
-rw-r--r--arch/arm/mach-kirkwood/common.h13
-rw-r--r--arch/arm/mach-kirkwood/include/mach/bridge-regs.h3
-rw-r--r--arch/arm/mach-kirkwood/include/mach/timex.h10
-rw-r--r--arch/arm/mach-kirkwood/pm.c9
-rw-r--r--arch/arm/mach-kirkwood/pm.h26
-rw-r--r--arch/arm/mach-ks8695/board-og.c3
-rw-r--r--arch/arm/mach-ks8695/include/mach/timex.h21
-rw-r--r--arch/arm/mach-ks8695/time.c2
-rw-r--r--arch/arm/mach-lpc32xx/common.c1
-rw-r--r--arch/arm/mach-lpc32xx/timer.c2
-rw-r--r--arch/arm/mach-mmp/aspenite.c4
-rw-r--r--arch/arm/mach-mmp/devices.c14
-rw-r--r--arch/arm/mach-mmp/include/mach/timex.h13
-rw-r--r--arch/arm/mach-mmp/time.c14
-rw-r--r--arch/arm/mach-mmp/ttc_dkb.c18
-rw-r--r--arch/arm/mach-moxart/Kconfig7
-rw-r--r--arch/arm/mach-msm/Kconfig54
-rw-r--r--arch/arm/mach-msm/Makefile8
-rw-r--r--arch/arm/mach-msm/common.h3
-rw-r--r--arch/arm/mach-msm/dma.c3
-rw-r--r--arch/arm/mach-msm/headsmp.S39
-rw-r--r--arch/arm/mach-msm/hotplug.c74
-rw-r--r--arch/arm/mach-msm/include/mach/timex.h21
-rw-r--r--arch/arm/mach-msm/io.c2
-rw-r--r--arch/arm/mach-msm/platsmp.c161
-rw-r--r--arch/arm/mach-msm/timer.c333
-rw-r--r--arch/arm/mach-mv78xx0/common.c2
-rw-r--r--arch/arm/mach-mv78xx0/include/mach/bridge-regs.h1
-rw-r--r--arch/arm/mach-mv78xx0/include/mach/timex.h9
-rw-r--r--arch/arm/mach-mvebu/Kconfig86
-rw-r--r--arch/arm/mach-mvebu/Makefile5
-rw-r--r--arch/arm/mach-mvebu/board-t5325.c41
-rw-r--r--arch/arm/mach-mvebu/board-v7.c (renamed from arch/arm/mach-mvebu/armada-370-xp.c)59
-rw-r--r--arch/arm/mach-mvebu/board.h22
-rw-r--r--arch/arm/mach-mvebu/dove.c (renamed from arch/arm/mach-dove/board-dt.c)20
-rw-r--r--arch/arm/mach-mvebu/kirkwood-pm.c76
-rw-r--r--arch/arm/mach-mvebu/kirkwood-pm.h26
-rw-r--r--arch/arm/mach-mvebu/kirkwood.c199
-rw-r--r--arch/arm/mach-mvebu/kirkwood.h22
-rw-r--r--arch/arm/mach-mvebu/mvebu-soc-id.c1
-rw-r--r--arch/arm/mach-mvebu/system-controller.c23
-rw-r--r--arch/arm/mach-mxs/Kconfig4
-rw-r--r--arch/arm/mach-mxs/mach-mxs.c33
-rw-r--r--arch/arm/mach-netx/include/mach/timex.h20
-rw-r--r--arch/arm/mach-netx/time.c13
-rw-r--r--arch/arm/mach-nomadik/Kconfig5
-rw-r--r--arch/arm/mach-nspire/Kconfig5
-rw-r--r--arch/arm/mach-nspire/nspire.c2
-rw-r--r--arch/arm/mach-omap1/board-h2.c3
-rw-r--r--arch/arm/mach-omap1/board-osk.c3
-rw-r--r--arch/arm/mach-omap1/dma.c191
-rw-r--r--arch/arm/mach-omap1/include/mach/timex.h5
-rw-r--r--arch/arm/mach-omap1/pm.c6
-rw-r--r--arch/arm/mach-omap2/Kconfig28
-rw-r--r--arch/arm/mach-omap2/Makefile1
-rw-r--r--arch/arm/mach-omap2/am35xx-emac.c1
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c16
-rw-r--r--arch/arm/mach-omap2/board-generic.c7
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c6
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c13
-rw-r--r--arch/arm/mach-omap2/cclock3xxx_data.c4
-rw-r--r--arch/arm/mach-omap2/clkt_dpll.c6
-rw-r--r--arch/arm/mach-omap2/clockdomains3xxx_data.c2
-rw-r--r--arch/arm/mach-omap2/cminst44xx.c18
-rw-r--r--arch/arm/mach-omap2/common.h3
-rw-r--r--arch/arm/mach-omap2/devices.c3
-rw-r--r--arch/arm/mach-omap2/display.c167
-rw-r--r--arch/arm/mach-omap2/display.h3
-rw-r--r--arch/arm/mach-omap2/dma.c183
-rw-r--r--arch/arm/mach-omap2/dpll3xxx.c2
-rw-r--r--arch/arm/mach-omap2/dss-common.c224
-rw-r--r--arch/arm/mach-omap2/gpmc-nand.c31
-rw-r--r--arch/arm/mach-omap2/id.c16
-rw-r--r--arch/arm/mach-omap2/include/mach/timex.h5
-rw-r--r--arch/arm/mach-omap2/io.c1
-rw-r--r--arch/arm/mach-omap2/irq.c8
-rw-r--r--arch/arm/mach-omap2/mux.h3
-rw-r--r--arch/arm/mach-omap2/omap-iommu.c5
-rw-r--r--arch/arm/mach-omap2/omap-wakeupgen.c4
-rw-r--r--arch/arm/mach-omap2/omap4-common.c4
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c18
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_43xx_data.c1
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_44xx_data.c3
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_54xx_data.c83
-rw-r--r--arch/arm/mach-omap2/pdata-quirks.c120
-rw-r--r--arch/arm/mach-omap2/pm.h2
-rw-r--r--arch/arm/mach-omap2/prminst44xx.c3
-rw-r--r--arch/arm/mach-omap2/soc.h3
-rw-r--r--arch/arm/mach-omap2/timer.c3
-rw-r--r--arch/arm/mach-orion5x/Kconfig1
-rw-r--r--arch/arm/mach-orion5x/dns323-setup.c2
-rw-r--r--arch/arm/mach-orion5x/include/mach/bridge-regs.h1
-rw-r--r--arch/arm/mach-orion5x/include/mach/timex.h11
-rw-r--r--arch/arm/mach-picoxcell/Kconfig7
-rw-r--r--arch/arm/mach-prima2/Kconfig9
-rw-r--r--arch/arm/mach-prima2/common.c11
-rw-r--r--arch/arm/mach-prima2/common.h1
-rw-r--r--arch/arm/mach-prima2/l2x0.c9
-rw-r--r--arch/arm/mach-prima2/platsmp.c6
-rw-r--r--arch/arm/mach-prima2/rstc.c99
-rw-r--r--arch/arm/mach-prima2/rtciobrg.c2
-rw-r--r--arch/arm/mach-pxa/Kconfig23
-rw-r--r--arch/arm/mach-pxa/balloon3.c1
-rw-r--r--arch/arm/mach-pxa/colibri-evalboard.c1
-rw-r--r--arch/arm/mach-pxa/corgi.c40
-rw-r--r--arch/arm/mach-pxa/include/mach/timex.h34
-rw-r--r--arch/arm/mach-pxa/viper.c3
-rw-r--r--arch/arm/mach-qcom/Kconfig33
-rw-r--r--arch/arm/mach-qcom/Makefile5
-rw-r--r--arch/arm/mach-qcom/board.c (renamed from arch/arm/mach-msm/board-dt.c)23
-rw-r--r--arch/arm/mach-qcom/platsmp.c378
-rw-r--r--arch/arm/mach-qcom/scm-boot.c (renamed from arch/arm/mach-msm/scm-boot.c)0
-rw-r--r--arch/arm/mach-qcom/scm-boot.h (renamed from arch/arm/mach-msm/scm-boot.h)8
-rw-r--r--arch/arm/mach-qcom/scm.c (renamed from arch/arm/mach-msm/scm.c)0
-rw-r--r--arch/arm/mach-qcom/scm.h (renamed from arch/arm/mach-msm/scm.h)0
-rw-r--r--arch/arm/mach-realview/include/mach/memory.h2
-rw-r--r--arch/arm/mach-realview/include/mach/timex.h23
-rw-r--r--arch/arm/mach-rockchip/Kconfig4
-rw-r--r--arch/arm/mach-rockchip/Makefile1
-rw-r--r--arch/arm/mach-rockchip/core.h (renamed from arch/arm/mach-lpc32xx/include/mach/timex.h)20
-rw-r--r--arch/arm/mach-rockchip/headsmp.S (renamed from arch/arm/mach-versatile/include/mach/timex.h)27
-rw-r--r--arch/arm/mach-rockchip/platsmp.c184
-rw-r--r--arch/arm/mach-rockchip/rockchip.c2
-rw-r--r--arch/arm/mach-rpc/dma.c2
-rw-r--r--arch/arm/mach-rpc/include/mach/timex.h17
-rw-r--r--arch/arm/mach-rpc/time.c16
-rw-r--r--arch/arm/mach-s3c24xx/Kconfig8
-rw-r--r--arch/arm/mach-s3c24xx/clock-s3c2410.c3
-rw-r--r--arch/arm/mach-s3c24xx/clock-s3c2412.c3
-rw-r--r--arch/arm/mach-s3c24xx/clock-s3c2440.c2
-rw-r--r--arch/arm/mach-s3c24xx/common.c5
-rw-r--r--arch/arm/mach-s3c24xx/dma-s3c2410.c2
-rw-r--r--arch/arm/mach-s3c24xx/dma-s3c2412.c2
-rw-r--r--arch/arm/mach-s3c24xx/dma-s3c2440.c2
-rw-r--r--arch/arm/mach-s3c24xx/dma-s3c2443.c2
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/debug-macro.S2
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/hardware.h14
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/rtc-core.h (renamed from arch/arm/plat-samsung/include/plat/rtc-core.h)13
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/tick.h15
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/timex.h24
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/uncompress.h57
-rw-r--r--arch/arm/mach-s3c24xx/mach-amlm5900.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-anubis.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-at2440evb.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-bast.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-gta02.c4
-rw-r--r--arch/arm/mach-s3c24xx/mach-h1940.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-jive.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-mini2440.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-n30.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-nexcoder.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-osiris.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-otom.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-qt2410.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-rx1950.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-rx3715.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-s3c2416-dt.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2410.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2413.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2416.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2440.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2443.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-tct_hammer.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-vr1000.c2
-rw-r--r--arch/arm/mach-s3c24xx/mach-vstms.c2
-rw-r--r--arch/arm/mach-s3c24xx/pm.c2
-rw-r--r--arch/arm/mach-s3c24xx/s3c2410.c2
-rw-r--r--arch/arm/mach-s3c24xx/s3c2412.c2
-rw-r--r--arch/arm/mach-s3c24xx/s3c2416.c2
-rw-r--r--arch/arm/mach-s3c24xx/s3c2443.c2
-rw-r--r--arch/arm/mach-s3c24xx/s3c244x.c2
-rw-r--r--arch/arm/mach-s3c24xx/sleep-s3c2410.S2
-rw-r--r--arch/arm/mach-s3c24xx/sleep.S2
-rw-r--r--arch/arm/mach-s3c64xx/Kconfig3
-rw-r--r--arch/arm/mach-s3c64xx/common.c2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/debug-macro.S2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/pm-core.h2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/tick.h31
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/timex.h24
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/uncompress.h31
-rw-r--r--arch/arm/mach-s3c64xx/irq-pm.c14
-rw-r--r--arch/arm/mach-s3c64xx/mach-anw6410.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410-module.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-hmt.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-mini6410.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-ncp.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-real6410.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-smartq.c2
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6400.c3
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6410.c2
-rw-r--r--arch/arm/mach-s3c64xx/pm.c1
-rw-r--r--arch/arm/mach-s3c64xx/s3c6400.c2
-rw-r--r--arch/arm/mach-s3c64xx/s3c6410.c2
-rw-r--r--arch/arm/mach-s5p64x0/common.c20
-rw-r--r--arch/arm/mach-s5p64x0/common.h5
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/debug-macro.S3
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/pm-core.h2
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/timex.h27
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/uncompress.h34
-rw-r--r--arch/arm/mach-s5p64x0/irq-pm.c8
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6440.c2
-rw-r--r--arch/arm/mach-s5p64x0/mach-smdk6450.c2
-rw-r--r--arch/arm/mach-s5p64x0/pm.c1
-rw-r--r--arch/arm/mach-s5pc100/common.c2
-rw-r--r--arch/arm/mach-s5pc100/include/mach/debug-macro.S2
-rw-r--r--arch/arm/mach-s5pc100/include/mach/tick.h31
-rw-r--r--arch/arm/mach-s5pc100/include/mach/timex.h24
-rw-r--r--arch/arm/mach-s5pc100/include/mach/uncompress.h30
-rw-r--r--arch/arm/mach-s5pc100/mach-smdkc100.c2
-rw-r--r--arch/arm/mach-s5pv210/Kconfig1
-rw-r--r--arch/arm/mach-s5pv210/common.c2
-rw-r--r--arch/arm/mach-s5pv210/include/mach/debug-macro.S2
-rw-r--r--arch/arm/mach-s5pv210/include/mach/timex.h29
-rw-r--r--arch/arm/mach-s5pv210/include/mach/uncompress.h28
-rw-r--r--arch/arm/mach-s5pv210/mach-aquila.c2
-rw-r--r--arch/arm/mach-s5pv210/mach-goni.c2
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkc110.c2
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkv210.c2
-rw-r--r--arch/arm/mach-s5pv210/mach-torbreck.c2
-rw-r--r--arch/arm/mach-sa1100/collie.c33
-rw-r--r--arch/arm/mach-sa1100/h3100.c7
-rw-r--r--arch/arm/mach-sa1100/h3600.c7
-rw-r--r--arch/arm/mach-sa1100/h3xxx.c58
-rw-r--r--arch/arm/mach-sa1100/include/mach/collie.h2
-rw-r--r--arch/arm/mach-sa1100/include/mach/h3xxx.h11
-rw-r--r--arch/arm/mach-sa1100/include/mach/timex.h12
-rw-r--r--arch/arm/mach-sa1100/time.c10
-rw-r--r--arch/arm/mach-shmobile/Kconfig32
-rw-r--r--arch/arm/mach-shmobile/Makefile4
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c6
-rw-r--r--arch/arm/mach-shmobile/board-bockw.c61
-rw-r--r--arch/arm/mach-shmobile/board-genmai.c75
-rw-r--r--arch/arm/mach-shmobile/board-koelsch-reference.c106
-rw-r--r--arch/arm/mach-shmobile/board-koelsch.c305
-rw-r--r--arch/arm/mach-shmobile/board-kzm9d-reference.c48
-rw-r--r--arch/arm/mach-shmobile/board-kzm9g.c4
-rw-r--r--arch/arm/mach-shmobile/board-lager-reference.c109
-rw-r--r--arch/arm/mach-shmobile/board-lager.c492
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c6
-rw-r--r--arch/arm/mach-shmobile/clock-r7s72100.c36
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7778.c4
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7779.c27
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7790.c196
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7791.c153
-rw-r--r--arch/arm/mach-shmobile/include/mach/common.h1
-rw-r--r--arch/arm/mach-shmobile/include/mach/head-kzm9g.txt410
-rw-r--r--arch/arm/mach-shmobile/include/mach/pm-rcar.h15
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7779.h13
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7790.h26
-rw-r--r--arch/arm/mach-shmobile/include/mach/timex.h6
-rw-r--r--arch/arm/mach-shmobile/include/mach/zboot.h3
-rw-r--r--arch/arm/mach-shmobile/include/mach/zboot_macros.h43
-rw-r--r--arch/arm/mach-shmobile/platsmp-apmu.c3
-rw-r--r--arch/arm/mach-shmobile/pm-r8a7779.c131
-rw-r--r--arch/arm/mach-shmobile/pm-r8a7790.c45
-rw-r--r--arch/arm/mach-shmobile/pm-rcar.c141
-rw-r--r--arch/arm/mach-shmobile/setup-emev2.c2
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7790.c90
-rw-r--r--arch/arm/mach-shmobile/setup-rcar-gen2.c2
-rw-r--r--arch/arm/mach-shmobile/smp-r8a7779.c17
-rw-r--r--arch/arm/mach-shmobile/smp-r8a7790.c17
-rw-r--r--arch/arm/mach-socfpga/Kconfig7
-rw-r--r--arch/arm/mach-socfpga/socfpga.c5
-rw-r--r--arch/arm/mach-spear/Kconfig12
-rw-r--r--arch/arm/mach-spear/include/mach/timex.h19
-rw-r--r--arch/arm/mach-spear/spear1310.c1
-rw-r--r--arch/arm/mach-spear/spear1340.c1
-rw-r--r--arch/arm/mach-spear/time.c2
-rw-r--r--arch/arm/mach-sti/Kconfig7
-rw-r--r--arch/arm/mach-sunxi/Kconfig6
-rw-r--r--arch/arm/mach-sunxi/Makefile2
-rw-r--r--arch/arm/mach-sunxi/headsmp.S9
-rw-r--r--arch/arm/mach-sunxi/platsmp.c2
-rw-r--r--arch/arm/mach-sunxi/sunxi.c4
-rw-r--r--arch/arm/mach-tegra/Kconfig9
-rw-r--r--arch/arm/mach-tegra/Makefile1
-rw-r--r--arch/arm/mach-tegra/cpuidle-tegra114.c7
-rw-r--r--arch/arm/mach-tegra/platsmp.c2
-rw-r--r--arch/arm/mach-tegra/powergate.c2
-rw-r--r--arch/arm/mach-tegra/tegra2_emc.c347
-rw-r--r--arch/arm/mach-tegra/tegra2_emc.h24
-rw-r--r--arch/arm/mach-u300/Kconfig6
-rw-r--r--arch/arm/mach-ux500/Kconfig10
-rw-r--r--arch/arm/mach-ux500/Makefile1
-rw-r--r--arch/arm/mach-ux500/board-mop500-audio.c1
-rw-r--r--arch/arm/mach-ux500/board-mop500-pins.c291
-rw-r--r--arch/arm/mach-ux500/board-mop500.h73
-rw-r--r--arch/arm/mach-ux500/cpu-db8500.c17
-rw-r--r--arch/arm/mach-ux500/cpu.c10
-rw-r--r--arch/arm/mach-ux500/irqs-board-mop500.h55
-rw-r--r--arch/arm/mach-ux500/irqs-db8500.h125
-rw-r--r--arch/arm/mach-ux500/irqs.h49
-rw-r--r--arch/arm/mach-versatile/core.c2
-rw-r--r--arch/arm/mach-vexpress/Kconfig7
-rw-r--r--arch/arm/mach-vexpress/Makefile3
-rw-r--r--arch/arm/mach-vexpress/dcscb.c13
-rw-r--r--arch/arm/mach-virt/Kconfig10
-rw-r--r--arch/arm/mach-virt/Makefile5
-rw-r--r--arch/arm/mach-virt/virt.c41
-rw-r--r--arch/arm/mach-vt8500/Kconfig4
-rw-r--r--arch/arm/mach-w90x900/include/mach/timex.h25
-rw-r--r--arch/arm/mach-w90x900/time.c2
-rw-r--r--arch/arm/mach-zynq/Kconfig8
-rw-r--r--arch/arm/mach-zynq/common.c8
-rw-r--r--arch/arm/mach-zynq/common.h2
-rw-r--r--arch/arm/mach-zynq/slcr.c104
-rw-r--r--arch/arm/mm/Kconfig7
-rw-r--r--arch/arm/mm/cache-feroceon-l2.c49
-rw-r--r--arch/arm/mm/cache-tauros2.c29
-rw-r--r--arch/arm/mm/dma-mapping.c147
-rw-r--r--arch/arm/mm/dump.c47
-rw-r--r--arch/arm/mm/init.c2
-rw-r--r--arch/arm/mm/mmu.c10
-rw-r--r--arch/arm/mm/proc-macros.S19
-rw-r--r--arch/arm/mm/proc-v7-2level.S7
-rw-r--r--arch/arm/mm/proc-v7.S11
-rw-r--r--arch/arm/net/bpf_jit_32.c7
-rw-r--r--arch/arm/plat-iop/time.c2
-rw-r--r--arch/arm/plat-omap/Kconfig3
-rw-r--r--arch/arm/plat-omap/dma.c17
-rw-r--r--arch/arm/plat-omap/include/plat/timex.h33
-rw-r--r--arch/arm/plat-orion/common.c10
-rw-r--r--arch/arm/plat-samsung/Kconfig10
-rw-r--r--arch/arm/plat-samsung/Makefile2
-rw-r--r--arch/arm/plat-samsung/clock.c3
-rw-r--r--arch/arm/plat-samsung/cpu.c7
-rw-r--r--arch/arm/plat-samsung/devs.c14
-rw-r--r--arch/arm/plat-samsung/include/plat/cpu.h11
-rw-r--r--arch/arm/plat-samsung/include/plat/mfc.h3
-rw-r--r--arch/arm/plat-samsung/include/plat/pm-common.h110
-rw-r--r--arch/arm/plat-samsung/include/plat/pm.h80
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-serial.h1
-rw-r--r--arch/arm/plat-samsung/include/plat/uncompress.h175
-rw-r--r--arch/arm/plat-samsung/init.c9
-rw-r--r--arch/arm/plat-samsung/pm-check.c2
-rw-r--r--arch/arm/plat-samsung/pm-common.c75
-rw-r--r--arch/arm/plat-samsung/pm-debug.c97
-rw-r--r--arch/arm/plat-samsung/pm-gpio.c5
-rw-r--r--arch/arm/plat-samsung/pm.c148
-rw-r--r--arch/arm/plat-samsung/s5p-dev-mfc.c17
-rw-r--r--arch/arm/plat-samsung/s5p-dev-uart.c1
-rw-r--r--arch/arm/plat-samsung/s5p-irq-pm.c13
-rw-r--r--arch/arm/plat-samsung/s5p-sleep.S43
-rw-r--r--arch/arm/vfp/entry.S25
-rw-r--r--arch/arm/vfp/vfphw.S19
-rw-r--r--arch/arm/xen/p2m.c32
-rw-r--r--arch/arm64/Kconfig6
-rw-r--r--arch/arm64/Kconfig.debug14
-rw-r--r--arch/arm64/include/asm/Kbuild1
-rw-r--r--arch/arm64/include/asm/fixmap.h67
-rw-r--r--arch/arm64/include/asm/io.h1
-rw-r--r--arch/arm64/include/asm/kvm_arm.h3
-rw-r--r--arch/arm64/include/asm/kvm_asm.h3
-rw-r--r--arch/arm64/include/asm/kvm_mmu.h22
-rw-r--r--arch/arm64/include/asm/memory.h2
-rw-r--r--arch/arm64/include/asm/mmu.h1
-rw-r--r--arch/arm64/include/asm/pgtable-hwdef.h6
-rw-r--r--arch/arm64/include/asm/virt.h13
-rw-r--r--arch/arm64/kernel/debug-monitors.c6
-rw-r--r--arch/arm64/kernel/early_printk.c8
-rw-r--r--arch/arm64/kernel/head.S39
-rw-r--r--arch/arm64/kernel/hw_breakpoint.c7
-rw-r--r--arch/arm64/kernel/perf_event.c4
-rw-r--r--arch/arm64/kernel/perf_regs.c2
-rw-r--r--arch/arm64/kernel/setup.c4
-rw-r--r--arch/arm64/kvm/sys_regs.c99
-rw-r--r--arch/arm64/kvm/sys_regs.h2
-rw-r--r--arch/arm64/mm/cache.S24
-rw-r--r--arch/arm64/mm/init.c1
-rw-r--r--arch/arm64/mm/ioremap.c85
-rw-r--r--arch/arm64/mm/mmu.c44
-rw-r--r--arch/arm64/mm/proc.S25
-rw-r--r--arch/avr32/boards/mimc200/Makefile2
-rw-r--r--arch/avr32/boards/mimc200/fram.c82
-rw-r--r--arch/blackfin/Kconfig12
-rw-r--r--arch/blackfin/include/asm/bfin_crc.h125
-rw-r--r--arch/blackfin/include/asm/bfin_twi.h143
-rw-r--r--arch/blackfin/include/asm/dma.h2
-rw-r--r--arch/blackfin/include/asm/irq.h9
-rw-r--r--arch/blackfin/include/asm/portmux.h10
-rw-r--r--arch/blackfin/kernel/debug-mmrs.c1
-rw-r--r--arch/blackfin/kernel/ftrace.c5
-rw-r--r--arch/blackfin/kernel/irqchip.c39
-rw-r--r--arch/blackfin/mach-bf518/boards/ezbrd.c87
-rw-r--r--arch/blackfin/mach-bf518/boards/tcm-bf518.c64
-rw-r--r--arch/blackfin/mach-bf527/boards/ad7160eval.c71
-rw-r--r--arch/blackfin/mach-bf527/boards/cm_bf527.c91
-rw-r--r--arch/blackfin/mach-bf527/boards/ezbrd.c76
-rw-r--r--arch/blackfin/mach-bf527/boards/ezkit.c139
-rw-r--r--arch/blackfin/mach-bf527/boards/tll6527m.c91
-rw-r--r--arch/blackfin/mach-bf533/boards/H8606.c46
-rw-r--r--arch/blackfin/mach-bf533/boards/blackstamp.c44
-rw-r--r--arch/blackfin/mach-bf533/boards/cm_bf533.c54
-rw-r--r--arch/blackfin/mach-bf533/boards/ezkit.c56
-rw-r--r--arch/blackfin/mach-bf533/boards/ip0x.c26
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c118
-rw-r--r--arch/blackfin/mach-bf537/boards/cm_bf537e.c82
-rw-r--r--arch/blackfin/mach-bf537/boards/cm_bf537u.c70
-rw-r--r--arch/blackfin/mach-bf537/boards/dnp5370.c32
-rw-r--r--arch/blackfin/mach-bf537/boards/minotaur.c50
-rw-r--r--arch/blackfin/mach-bf537/boards/pnav10.c55
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c425
-rw-r--r--arch/blackfin/mach-bf537/boards/tcm_bf537.c70
-rw-r--r--arch/blackfin/mach-bf538/boards/ezkit.c62
-rw-r--r--arch/blackfin/mach-bf548/boards/cm_bf548.c78
-rw-r--r--arch/blackfin/mach-bf548/boards/ezkit.c136
-rw-r--r--arch/blackfin/mach-bf548/include/mach/defBF544.h30
-rw-r--r--arch/blackfin/mach-bf548/include/mach/defBF547.h30
-rw-r--r--arch/blackfin/mach-bf561/boards/acvilon.c28
-rw-r--r--arch/blackfin/mach-bf561/boards/cm_bf561.c56
-rw-r--r--arch/blackfin/mach-bf561/boards/ezkit.c74
-rw-r--r--arch/blackfin/mach-bf561/boards/tepla.c8
-rw-r--r--arch/blackfin/mach-bf609/boards/ezkit.c131
-rw-r--r--arch/blackfin/mach-bf609/clock.c18
-rw-r--r--arch/blackfin/mach-bf609/pm.c2
-rw-r--r--arch/cris/Kconfig3
-rw-r--r--arch/cris/arch-v32/drivers/Kconfig2
-rw-r--r--arch/cris/kernel/setup.c2
-rw-r--r--arch/frv/mb93090-mb00/pci-frv.c2
-rw-r--r--arch/hexagon/Kconfig3
-rw-r--r--arch/hexagon/include/asm/Kbuild2
-rw-r--r--arch/hexagon/include/asm/atomic.h15
-rw-r--r--arch/hexagon/include/asm/delay.h1
-rw-r--r--arch/hexagon/include/asm/dma-mapping.h1
-rw-r--r--arch/hexagon/include/asm/elf.h4
-rw-r--r--arch/hexagon/include/asm/hexagon_vm.h72
-rw-r--r--arch/hexagon/include/asm/io.h2
-rw-r--r--arch/hexagon/include/asm/kgdb.h5
-rw-r--r--arch/hexagon/include/asm/pgalloc.h2
-rw-r--r--arch/hexagon/include/asm/smp.h1
-rw-r--r--arch/hexagon/include/uapi/asm/registers.h4
-rw-r--r--arch/hexagon/include/uapi/asm/setup.h5
-rw-r--r--arch/hexagon/kernel/Makefile2
-rw-r--r--arch/hexagon/kernel/hexagon_ksyms.c24
-rw-r--r--arch/hexagon/kernel/kgdb.c2
-rw-r--r--arch/hexagon/kernel/ptrace.c1
-rw-r--r--arch/hexagon/kernel/reset.c5
-rw-r--r--arch/hexagon/kernel/screen_info.c3
-rw-r--r--arch/hexagon/kernel/smp.c6
-rw-r--r--arch/hexagon/kernel/time.c12
-rw-r--r--arch/ia64/Kconfig2
-rw-r--r--arch/ia64/configs/generic_defconfig1
-rw-r--r--arch/ia64/configs/tiger_defconfig1
-rw-r--r--arch/ia64/configs/zx1_defconfig1
-rw-r--r--arch/ia64/hp/common/sba_iommu.c32
-rw-r--r--arch/ia64/include/asm/pci.h2
-rw-r--r--arch/ia64/kernel/acpi.c32
-rw-r--r--arch/ia64/kernel/err_inject.c15
-rw-r--r--arch/ia64/kernel/ftrace.c4
-rw-r--r--arch/ia64/kernel/palinfo.c6
-rw-r--r--arch/ia64/kernel/salinfo.c6
-rw-r--r--arch/ia64/kernel/topology.c6
-rw-r--r--arch/ia64/kvm/kvm-ia64.c1
-rw-r--r--arch/ia64/pci/fixup.c25
-rw-r--r--arch/ia64/pci/pci.c10
-rw-r--r--arch/m32r/Kconfig2
-rw-r--r--arch/m68k/Kconfig2
-rw-r--r--arch/m68k/configs/m5208evb_defconfig1
-rw-r--r--arch/m68k/configs/m5249evb_defconfig1
-rw-r--r--arch/m68k/configs/m5272c3_defconfig1
-rw-r--r--arch/m68k/configs/m5275evb_defconfig1
-rw-r--r--arch/m68k/configs/m5307c3_defconfig1
-rw-r--r--arch/m68k/configs/m5407c3_defconfig1
-rw-r--r--arch/m68k/include/asm/io_no.h6
-rw-r--r--arch/metag/Kconfig4
-rw-r--r--arch/metag/include/asm/topology.h27
-rw-r--r--arch/metag/kernel/ftrace.c5
-rw-r--r--arch/metag/kernel/irq.c22
-rw-r--r--arch/metag/kernel/signal.c48
-rw-r--r--arch/microblaze/Kconfig54
-rw-r--r--arch/microblaze/Kconfig.platform (renamed from arch/microblaze/platform/Kconfig.platform)55
-rw-r--r--arch/microblaze/Makefile1
-rw-r--r--[l---------]arch/microblaze/boot/dts/system.dts367
-rw-r--r--arch/microblaze/include/asm/io.h302
-rw-r--r--arch/microblaze/include/asm/processor.h2
-rw-r--r--arch/microblaze/include/asm/setup.h6
-rw-r--r--arch/microblaze/include/uapi/asm/unistd.h6
-rw-r--r--arch/microblaze/kernel/Makefile2
-rw-r--r--arch/microblaze/kernel/ftrace.c5
-rw-r--r--arch/microblaze/kernel/heartbeat.c4
-rw-r--r--arch/microblaze/kernel/intc.c51
-rw-r--r--arch/microblaze/kernel/platform.c (renamed from arch/microblaze/platform/platform.c)0
-rw-r--r--arch/microblaze/kernel/process.c1
-rw-r--r--arch/microblaze/kernel/signal.c2
-rw-r--r--arch/microblaze/kernel/syscall_table.S8
-rw-r--r--arch/microblaze/kernel/timer.c66
-rw-r--r--arch/microblaze/mm/consistent.c2
-rw-r--r--arch/microblaze/mm/init.c2
-rw-r--r--arch/microblaze/mm/pgtable.c5
-rw-r--r--arch/microblaze/pci/pci-common.c5
-rw-r--r--arch/microblaze/platform/Makefile6
-rw-r--r--arch/microblaze/platform/generic/Kconfig.auto61
-rw-r--r--arch/microblaze/platform/generic/Makefile3
-rw-r--r--arch/microblaze/platform/generic/system.dts366
-rw-r--r--arch/mips/Kconfig146
-rw-r--r--arch/mips/Kconfig.debug10
-rw-r--r--arch/mips/Makefile5
-rw-r--r--arch/mips/alchemy/Kconfig24
-rw-r--r--arch/mips/alchemy/Platform16
-rw-r--r--arch/mips/alchemy/common/setup.c10
-rw-r--r--arch/mips/alchemy/common/sleeper.S6
-rw-r--r--arch/mips/alchemy/devboards/Makefile4
-rw-r--r--arch/mips/alchemy/devboards/db1000.c47
-rw-r--r--arch/mips/alchemy/devboards/db1200.c78
-rw-r--r--arch/mips/alchemy/devboards/db1300.c40
-rw-r--r--arch/mips/alchemy/devboards/db1550.c10
-rw-r--r--arch/mips/alchemy/devboards/db1xxx.c (renamed from arch/mips/alchemy/devboards/db1235.c)41
-rw-r--r--arch/mips/ar7/time.c1
-rw-r--r--arch/mips/ath79/Kconfig8
-rw-r--r--arch/mips/bcm47xx/Makefile2
-rw-r--r--arch/mips/bcm47xx/bcm47xx_private.h3
-rw-r--r--arch/mips/bcm47xx/board.c25
-rw-r--r--arch/mips/bcm47xx/buttons.c31
-rw-r--r--arch/mips/bcm47xx/leds.c49
-rw-r--r--arch/mips/bcm47xx/setup.c3
-rw-r--r--arch/mips/bcm47xx/workarounds.c31
-rw-r--r--arch/mips/bcm63xx/cpu.c3
-rw-r--r--arch/mips/configs/db1000_defconfig359
-rw-r--r--arch/mips/configs/db1235_defconfig434
-rw-r--r--arch/mips/configs/db1xxx_defconfig245
-rw-r--r--arch/mips/configs/loongson3_defconfig362
-rw-r--r--arch/mips/configs/malta_defconfig9
-rw-r--r--arch/mips/configs/malta_kvm_defconfig10
-rw-r--r--arch/mips/configs/malta_kvm_guest_defconfig7
-rw-r--r--arch/mips/configs/maltaaprp_defconfig3
-rw-r--r--arch/mips/configs/maltasmtc_defconfig4
-rw-r--r--arch/mips/configs/maltasmvp_defconfig5
-rw-r--r--arch/mips/configs/maltasmvp_eva_defconfig200
-rw-r--r--arch/mips/configs/maltaup_defconfig3
-rw-r--r--arch/mips/include/asm/asm-eva.h135
-rw-r--r--arch/mips/include/asm/asm.h13
-rw-r--r--arch/mips/include/asm/asmmacro-32.h128
-rw-r--r--arch/mips/include/asm/asmmacro.h330
-rw-r--r--arch/mips/include/asm/atomic.h40
-rw-r--r--arch/mips/include/asm/bitops.h28
-rw-r--r--arch/mips/include/asm/bootinfo.h26
-rw-r--r--arch/mips/include/asm/checksum.h44
-rw-r--r--arch/mips/include/asm/cmpxchg.h20
-rw-r--r--arch/mips/include/asm/cpu-features.h10
-rw-r--r--arch/mips/include/asm/cpu-info.h28
-rw-r--r--arch/mips/include/asm/cpu-type.h6
-rw-r--r--arch/mips/include/asm/cpu.h15
-rw-r--r--arch/mips/include/asm/dma-mapping.h5
-rw-r--r--arch/mips/include/asm/fpu.h2
-rw-r--r--arch/mips/include/asm/futex.h25
-rw-r--r--arch/mips/include/asm/fw/fw.h2
-rw-r--r--arch/mips/include/asm/gcmpregs.h125
-rw-r--r--arch/mips/include/asm/gic.h3
-rw-r--r--arch/mips/include/asm/io.h8
-rw-r--r--arch/mips/include/asm/kvm_host.h417
-rw-r--r--arch/mips/include/asm/local.h8
-rw-r--r--arch/mips/include/asm/mach-au1x00/au1000.h12
-rw-r--r--arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h8
-rw-r--r--arch/mips/include/asm/mach-db1x00/db1200.h91
-rw-r--r--arch/mips/include/asm/mach-db1x00/db1300.h40
-rw-r--r--arch/mips/include/asm/mach-loongson/boot_param.h163
-rw-r--r--arch/mips/include/asm/mach-loongson/dma-coherence.h22
-rw-r--r--arch/mips/include/asm/mach-loongson/irq.h44
-rw-r--r--arch/mips/include/asm/mach-loongson/loongson.h28
-rw-r--r--arch/mips/include/asm/mach-loongson/machine.h6
-rw-r--r--arch/mips/include/asm/mach-loongson/pci.h5
-rw-r--r--arch/mips/include/asm/mach-loongson/spaces.h9
-rw-r--r--arch/mips/include/asm/mach-malta/kernel-entry-init.h115
-rw-r--r--arch/mips/include/asm/mach-malta/spaces.h46
-rw-r--r--arch/mips/include/asm/mach-pmcs-msp71xx/msp_regops.h12
-rw-r--r--arch/mips/include/asm/mips-boards/malta.h5
-rw-r--r--arch/mips/include/asm/mips-boards/piix4.h5
-rw-r--r--arch/mips/include/asm/mips-cm.h322
-rw-r--r--arch/mips/include/asm/mips-cpc.h150
-rw-r--r--arch/mips/include/asm/mips_mt.h5
-rw-r--r--arch/mips/include/asm/mipsmtregs.h11
-rw-r--r--arch/mips/include/asm/mipsregs.h22
-rw-r--r--arch/mips/include/asm/module.h2
-rw-r--r--arch/mips/include/asm/msa.h203
-rw-r--r--arch/mips/include/asm/page.h2
-rw-r--r--arch/mips/include/asm/pgtable-bits.h9
-rw-r--r--arch/mips/include/asm/processor.h45
-rw-r--r--arch/mips/include/asm/ptrace.h2
-rw-r--r--arch/mips/include/asm/r4kcache.h175
-rw-r--r--arch/mips/include/asm/sigcontext.h2
-rw-r--r--arch/mips/include/asm/smp-cps.h33
-rw-r--r--arch/mips/include/asm/smp-ops.h17
-rw-r--r--arch/mips/include/asm/smp.h1
-rw-r--r--arch/mips/include/asm/stackframe.h2
-rw-r--r--arch/mips/include/asm/switch_to.h22
-rw-r--r--arch/mips/include/asm/syscall.h33
-rw-r--r--arch/mips/include/asm/thread_info.h7
-rw-r--r--arch/mips/include/asm/uaccess.h559
-rw-r--r--arch/mips/include/uapi/asm/inst.h25
-rw-r--r--arch/mips/include/uapi/asm/sigcontext.h8
-rw-r--r--arch/mips/kernel/Makefile5
-rw-r--r--arch/mips/kernel/asm-offsets.c82
-rw-r--r--arch/mips/kernel/bmips_vec.S2
-rw-r--r--arch/mips/kernel/cps-vec.S191
-rw-r--r--arch/mips/kernel/cpu-probe.c74
-rw-r--r--arch/mips/kernel/ftrace.c9
-rw-r--r--arch/mips/kernel/genex.S8
-rw-r--r--arch/mips/kernel/head.S2
-rw-r--r--arch/mips/kernel/idle.c9
-rw-r--r--arch/mips/kernel/irq-gic.c1
-rw-r--r--arch/mips/kernel/kgdb.c18
-rw-r--r--arch/mips/kernel/mips-cm.c121
-rw-r--r--arch/mips/kernel/mips-cpc.c52
-rw-r--r--arch/mips/kernel/mips_ksyms.c24
-rw-r--r--arch/mips/kernel/perf_event_mipsxx.c80
-rw-r--r--arch/mips/kernel/proc.c25
-rw-r--r--arch/mips/kernel/process.c23
-rw-r--r--arch/mips/kernel/ptrace.c161
-rw-r--r--arch/mips/kernel/ptrace32.c67
-rw-r--r--arch/mips/kernel/r4k_fpu.S215
-rw-r--r--arch/mips/kernel/r4k_switch.S60
-rw-r--r--arch/mips/kernel/scall32-o32.S24
-rw-r--r--arch/mips/kernel/scall64-64.S5
-rw-r--r--arch/mips/kernel/scall64-n32.S5
-rw-r--r--arch/mips/kernel/scall64-o32.S17
-rw-r--r--arch/mips/kernel/signal.c170
-rw-r--r--arch/mips/kernel/signal32.c137
-rw-r--r--arch/mips/kernel/smp-cmp.c55
-rw-r--r--arch/mips/kernel/smp-cps.c335
-rw-r--r--arch/mips/kernel/smp-gic.c53
-rw-r--r--arch/mips/kernel/smp-mt.c45
-rw-r--r--arch/mips/kernel/smtc-proc.c23
-rw-r--r--arch/mips/kernel/spram.c5
-rw-r--r--arch/mips/kernel/syscall.c4
-rw-r--r--arch/mips/kernel/traps.c144
-rw-r--r--arch/mips/kernel/unaligned.c135
-rw-r--r--arch/mips/kvm/kvm_mips_emul.c40
-rw-r--r--arch/mips/lasat/picvue_proc.c2
-rw-r--r--arch/mips/lib/csum_partial.S282
-rw-r--r--arch/mips/lib/memcpy.S416
-rw-r--r--arch/mips/lib/memset.S146
-rw-r--r--arch/mips/lib/strlen_user.S36
-rw-r--r--arch/mips/lib/strncpy_user.S40
-rw-r--r--arch/mips/lib/strnlen_user.S36
-rw-r--r--arch/mips/loongson/Kconfig47
-rw-r--r--arch/mips/loongson/Makefile6
-rw-r--r--arch/mips/loongson/Platform1
-rw-r--r--arch/mips/loongson/common/Makefile5
-rw-r--r--arch/mips/loongson/common/dma-swiotlb.c136
-rw-r--r--arch/mips/loongson/common/env.c67
-rw-r--r--arch/mips/loongson/common/init.c11
-rw-r--r--arch/mips/loongson/common/machtype.c4
-rw-r--r--arch/mips/loongson/common/mem.c42
-rw-r--r--arch/mips/loongson/common/pci.c6
-rw-r--r--arch/mips/loongson/common/reset.c21
-rw-r--r--arch/mips/loongson/common/serial.c26
-rw-r--r--arch/mips/loongson/common/setup.c8
-rw-r--r--arch/mips/loongson/common/uart_base.c9
-rw-r--r--arch/mips/loongson/lemote-2f/clock.c20
-rw-r--r--arch/mips/loongson/loongson-3/Makefile6
-rw-r--r--arch/mips/loongson/loongson-3/irq.c126
-rw-r--r--arch/mips/loongson/loongson-3/smp.c443
-rw-r--r--arch/mips/loongson/loongson-3/smp.h29
-rw-r--r--arch/mips/math-emu/cp1emu.c58
-rw-r--r--arch/mips/math-emu/kernel_linkage.c76
-rw-r--r--arch/mips/mm/c-r4k.c147
-rw-r--r--arch/mips/mm/cache.c4
-rw-r--r--arch/mips/mm/init.c12
-rw-r--r--arch/mips/mm/sc-mips.c2
-rw-r--r--arch/mips/mm/tlb-r4k.c5
-rw-r--r--arch/mips/mm/tlbex.c6
-rw-r--r--arch/mips/mti-malta/malta-init.c30
-rw-r--r--arch/mips/mti-malta/malta-int.c89
-rw-r--r--arch/mips/mti-malta/malta-memory.c58
-rw-r--r--arch/mips/mti-malta/malta-setup.c30
-rw-r--r--arch/mips/mti-sead3/sead3-mtd.c3
-rw-r--r--arch/mips/oprofile/common.c3
-rw-r--r--arch/mips/oprofile/op_model_mipsxx.c9
-rw-r--r--arch/mips/pci/Makefile1
-rw-r--r--arch/mips/pci/fixup-loongson3.c66
-rw-r--r--arch/mips/pci/fixup-malta.c13
-rw-r--r--arch/mips/pci/ops-loongson3.c101
-rw-r--r--arch/mips/pci/pci-alchemy.c5
-rw-r--r--arch/mips/pci/pci-malta.c22
-rw-r--r--arch/mips/pmcs-msp71xx/msp_setup.c2
-rw-r--r--arch/mips/power/hibernate.S1
-rw-r--r--arch/mips/ralink/Kconfig6
-rw-r--r--arch/mn10300/include/asm/highmem.h4
-rw-r--r--arch/openrisc/Kconfig2
-rw-r--r--arch/parisc/Kconfig1
-rw-r--r--arch/powerpc/Kconfig17
-rw-r--r--arch/powerpc/Makefile1
-rw-r--r--arch/powerpc/boot/Makefile5
-rw-r--r--arch/powerpc/boot/dts/fsl/b4420si-post.dtsi36
-rw-r--r--arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi2
-rw-r--r--arch/powerpc/boot/dts/fsl/b4860si-post.dtsi36
-rw-r--r--arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi4
-rw-r--r--arch/powerpc/boot/dts/fsl/p2041si-post.dtsi60
-rw-r--r--arch/powerpc/boot/dts/fsl/p2041si-pre.dtsi4
-rw-r--r--arch/powerpc/boot/dts/fsl/p3041si-post.dtsi61
-rw-r--r--arch/powerpc/boot/dts/fsl/p3041si-pre.dtsi4
-rw-r--r--arch/powerpc/boot/dts/fsl/p4080si-post.dtsi113
-rw-r--r--arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi8
-rw-r--r--arch/powerpc/boot/dts/fsl/p5020si-post.dtsi43
-rw-r--r--arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi2
-rw-r--r--arch/powerpc/boot/dts/fsl/p5040si-post.dtsi61
-rw-r--r--arch/powerpc/boot/dts/fsl/p5040si-pre.dtsi4
-rw-r--r--arch/powerpc/boot/dts/fsl/t4240si-post.dtsi86
-rw-r--r--arch/powerpc/boot/dts/fsl/t4240si-pre.dtsi12
-rw-r--r--arch/powerpc/boot/dts/t4240qds.dts42
-rw-r--r--arch/powerpc/configs/40x/acadia_defconfig1
-rw-r--r--arch/powerpc/configs/40x/ep405_defconfig1
-rw-r--r--arch/powerpc/configs/40x/kilauea_defconfig1
-rw-r--r--arch/powerpc/configs/40x/makalu_defconfig1
-rw-r--r--arch/powerpc/configs/40x/walnut_defconfig1
-rw-r--r--arch/powerpc/configs/44x/arches_defconfig1
-rw-r--r--arch/powerpc/configs/44x/bluestone_defconfig1
-rw-r--r--arch/powerpc/configs/44x/canyonlands_defconfig1
-rw-r--r--arch/powerpc/configs/44x/ebony_defconfig1
-rw-r--r--arch/powerpc/configs/44x/eiger_defconfig1
-rw-r--r--arch/powerpc/configs/44x/icon_defconfig1
-rw-r--r--arch/powerpc/configs/44x/iss476-smp_defconfig1
-rw-r--r--arch/powerpc/configs/44x/katmai_defconfig1
-rw-r--r--arch/powerpc/configs/44x/rainier_defconfig1
-rw-r--r--arch/powerpc/configs/44x/redwood_defconfig1
-rw-r--r--arch/powerpc/configs/44x/sequoia_defconfig1
-rw-r--r--arch/powerpc/configs/44x/taishan_defconfig1
-rw-r--r--arch/powerpc/configs/44x/warp_defconfig1
-rw-r--r--arch/powerpc/configs/52xx/cm5200_defconfig1
-rw-r--r--arch/powerpc/configs/52xx/motionpro_defconfig1
-rw-r--r--arch/powerpc/configs/52xx/pcm030_defconfig1
-rw-r--r--arch/powerpc/configs/52xx/tqm5200_defconfig1
-rw-r--r--arch/powerpc/configs/83xx/asp8347_defconfig1
-rw-r--r--arch/powerpc/configs/83xx/mpc8313_rdb_defconfig1
-rw-r--r--arch/powerpc/configs/83xx/mpc8315_rdb_defconfig1
-rw-r--r--arch/powerpc/configs/83xx/mpc836x_mds_defconfig1
-rw-r--r--arch/powerpc/configs/83xx/mpc836x_rdk_defconfig1
-rw-r--r--arch/powerpc/configs/83xx/sbc834x_defconfig1
-rw-r--r--arch/powerpc/configs/85xx/ksi8560_defconfig1
-rw-r--r--arch/powerpc/configs/85xx/ppa8548_defconfig1
-rw-r--r--arch/powerpc/configs/85xx/socrates_defconfig1
-rw-r--r--arch/powerpc/configs/85xx/tqm8540_defconfig1
-rw-r--r--arch/powerpc/configs/85xx/tqm8541_defconfig1
-rw-r--r--arch/powerpc/configs/85xx/tqm8548_defconfig1
-rw-r--r--arch/powerpc/configs/85xx/tqm8555_defconfig1
-rw-r--r--arch/powerpc/configs/85xx/tqm8560_defconfig1
-rw-r--r--arch/powerpc/configs/85xx/xes_mpc85xx_defconfig1
-rw-r--r--arch/powerpc/configs/86xx/gef_ppc9a_defconfig1
-rw-r--r--arch/powerpc/configs/86xx/gef_sbc310_defconfig1
-rw-r--r--arch/powerpc/configs/86xx/gef_sbc610_defconfig1
-rw-r--r--arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig1
-rw-r--r--arch/powerpc/configs/86xx/sbc8641d_defconfig1
-rw-r--r--arch/powerpc/configs/c2k_defconfig1
-rw-r--r--arch/powerpc/configs/corenet64_smp_defconfig2
-rw-r--r--arch/powerpc/configs/linkstation_defconfig1
-rw-r--r--arch/powerpc/configs/mpc85xx_defconfig2
-rw-r--r--arch/powerpc/configs/mpc85xx_smp_defconfig2
-rw-r--r--arch/powerpc/configs/ppc40x_defconfig1
-rw-r--r--arch/powerpc/configs/ppc44x_defconfig1
-rw-r--r--arch/powerpc/configs/ppc64_defconfig70
-rw-r--r--arch/powerpc/configs/ppc64e_defconfig70
-rw-r--r--arch/powerpc/configs/ppc6xx_defconfig1
-rw-r--r--arch/powerpc/configs/prpmc2800_defconfig108
-rw-r--r--arch/powerpc/configs/ps3_defconfig1
-rw-r--r--arch/powerpc/configs/pseries_defconfig56
-rw-r--r--arch/powerpc/configs/pseries_le_defconfig54
-rw-r--r--arch/powerpc/configs/storcenter_defconfig1
-rw-r--r--arch/powerpc/configs/tqm8xx_defconfig1
-rw-r--r--arch/powerpc/include/asm/archrandom.h18
-rw-r--r--arch/powerpc/include/asm/compat.h4
-rw-r--r--arch/powerpc/include/asm/cputable.h6
-rw-r--r--arch/powerpc/include/asm/emulated_ops.h1
-rw-r--r--arch/powerpc/include/asm/exception-64e.h15
-rw-r--r--arch/powerpc/include/asm/exception-64s.h8
-rw-r--r--arch/powerpc/include/asm/fadump.h1
-rw-r--r--arch/powerpc/include/asm/fsl_ifc.h838
-rw-r--r--arch/powerpc/include/asm/hvcall.h5
-rw-r--r--arch/powerpc/include/asm/kvm_book3s.h5
-rw-r--r--arch/powerpc/include/asm/kvm_book3s_64.h12
-rw-r--r--arch/powerpc/include/asm/kvm_book3s_asm.h2
-rw-r--r--arch/powerpc/include/asm/kvm_booke_hv_asm.h17
-rw-r--r--arch/powerpc/include/asm/kvm_ppc.h2
-rw-r--r--arch/powerpc/include/asm/machdep.h7
-rw-r--r--arch/powerpc/include/asm/mce.h3
-rw-r--r--arch/powerpc/include/asm/mmu-book3e.h9
-rw-r--r--arch/powerpc/include/asm/opal.h77
-rw-r--r--arch/powerpc/include/asm/paca.h9
-rw-r--r--arch/powerpc/include/asm/perf_event_server.h1
-rw-r--r--arch/powerpc/include/asm/processor.h1
-rw-r--r--arch/powerpc/include/asm/reg.h23
-rw-r--r--arch/powerpc/include/asm/rtas.h128
-rw-r--r--arch/powerpc/include/asm/smp.h2
-rw-r--r--arch/powerpc/include/asm/time.h1
-rw-r--r--arch/powerpc/include/asm/tm.h4
-rw-r--r--arch/powerpc/kernel/align.c52
-rw-r--r--arch/powerpc/kernel/asm-offsets.c2
-rw-r--r--arch/powerpc/kernel/cacheinfo.c7
-rw-r--r--arch/powerpc/kernel/cpu_setup_power.S2
-rw-r--r--arch/powerpc/kernel/cputable.c2
-rw-r--r--arch/powerpc/kernel/exceptions-64e.S435
-rw-r--r--arch/powerpc/kernel/exceptions-64s.S23
-rw-r--r--arch/powerpc/kernel/ftrace.c7
-rw-r--r--arch/powerpc/kernel/idle_power7.S90
-rw-r--r--arch/powerpc/kernel/mce.c4
-rw-r--r--arch/powerpc/kernel/mce_power.c37
-rw-r--r--arch/powerpc/kernel/paca.c3
-rw-r--r--arch/powerpc/kernel/pci_64.c4
-rw-r--r--arch/powerpc/kernel/process.c34
-rw-r--r--arch/powerpc/kernel/prom.c66
-rw-r--r--arch/powerpc/kernel/rtas.c37
-rw-r--r--arch/powerpc/kernel/rtasd.c24
-rw-r--r--arch/powerpc/kernel/setup-common.c3
-rw-r--r--arch/powerpc/kernel/setup_32.c2
-rw-r--r--arch/powerpc/kernel/setup_64.c49
-rw-r--r--arch/powerpc/kernel/signal_32.c2
-rw-r--r--arch/powerpc/kernel/signal_64.c2
-rw-r--r--arch/powerpc/kernel/smp.c25
-rw-r--r--arch/powerpc/kernel/sysfs.c8
-rw-r--r--arch/powerpc/kernel/time.c90
-rw-r--r--arch/powerpc/kernel/tm.S2
-rw-r--r--arch/powerpc/kernel/traps.c6
-rw-r--r--arch/powerpc/kernel/vdso.c8
-rw-r--r--arch/powerpc/kernel/vdso32/getcpu.S2
-rw-r--r--arch/powerpc/kernel/vdso64/getcpu.S2
-rw-r--r--arch/powerpc/kernel/vio.c3
-rw-r--r--arch/powerpc/kvm/book3s_64_mmu_hv.c9
-rw-r--r--arch/powerpc/kvm/book3s_64_vio_hv.c28
-rw-r--r--arch/powerpc/kvm/book3s_hv.c159
-rw-r--r--arch/powerpc/kvm/book3s_hv_interrupts.S22
-rw-r--r--arch/powerpc/kvm/book3s_hv_rm_mmu.c6
-rw-r--r--arch/powerpc/kvm/book3s_hv_rmhandlers.S191
-rw-r--r--arch/powerpc/kvm/book3s_interrupts.S4
-rw-r--r--arch/powerpc/kvm/book3s_rtas.c7
-rw-r--r--arch/powerpc/kvm/bookehv_interrupts.S21
-rw-r--r--arch/powerpc/lib/memcpy_64.S2
-rw-r--r--arch/powerpc/math-emu/mtfsf.c58
-rw-r--r--arch/powerpc/mm/gup.c13
-rw-r--r--arch/powerpc/mm/mem.c7
-rw-r--r--arch/powerpc/mm/numa.c15
-rw-r--r--arch/powerpc/mm/pgtable_64.c5
-rw-r--r--arch/powerpc/mm/tlb_low_64e.S66
-rw-r--r--arch/powerpc/mm/tlb_nohash.c11
-rw-r--r--arch/powerpc/net/bpf_jit_comp.c7
-rw-r--r--arch/powerpc/oprofile/op_model_cell.c3
-rw-r--r--arch/powerpc/perf/Makefile2
-rw-r--r--arch/powerpc/perf/core-book3s.c172
-rw-r--r--arch/powerpc/perf/hv-24x7-catalog.h33
-rw-r--r--arch/powerpc/perf/hv-24x7.c510
-rw-r--r--arch/powerpc/perf/hv-24x7.h109
-rw-r--r--arch/powerpc/perf/hv-common.c39
-rw-r--r--arch/powerpc/perf/hv-common.h36
-rw-r--r--arch/powerpc/perf/hv-gpci.c294
-rw-r--r--arch/powerpc/perf/hv-gpci.h73
-rw-r--r--arch/powerpc/perf/power7-events-list.h10
-rw-r--r--arch/powerpc/perf/power8-pmu.c78
-rw-r--r--arch/powerpc/platforms/44x/Kconfig1
-rw-r--r--arch/powerpc/platforms/85xx/c293pcie.c1
-rw-r--r--arch/powerpc/platforms/85xx/common.c6
-rw-r--r--arch/powerpc/platforms/85xx/corenet_generic.c17
-rw-r--r--arch/powerpc/platforms/85xx/ge_imp3a.c1
-rw-r--r--arch/powerpc/platforms/85xx/mpc8536_ds.c1
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx.h2
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_cds.c1
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ds.c3
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c4
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_rdb.c16
-rw-r--r--arch/powerpc/platforms/85xx/p1010rdb.c1
-rw-r--r--arch/powerpc/platforms/85xx/p1022_ds.c1
-rw-r--r--arch/powerpc/platforms/85xx/p1022_rdk.c1
-rw-r--r--arch/powerpc/platforms/85xx/p1023_rds.c2
-rw-r--r--arch/powerpc/platforms/85xx/qemu_e500.c1
-rw-r--r--arch/powerpc/platforms/85xx/sbc8548.c1
-rw-r--r--arch/powerpc/platforms/85xx/twr_p102x.c1
-rw-r--r--arch/powerpc/platforms/85xx/xes_mpc85xx.c3
-rw-r--r--arch/powerpc/platforms/Kconfig.cputype1
-rw-r--r--arch/powerpc/platforms/cell/interrupt.c2
-rw-r--r--arch/powerpc/platforms/cell/spu_syscalls.c2
-rw-r--r--arch/powerpc/platforms/embedded6xx/Kconfig10
-rw-r--r--arch/powerpc/platforms/embedded6xx/Makefile1
-rw-r--r--arch/powerpc/platforms/embedded6xx/prpmc2800.c156
-rw-r--r--arch/powerpc/platforms/powernv/Kconfig6
-rw-r--r--arch/powerpc/platforms/powernv/Makefile5
-rw-r--r--arch/powerpc/platforms/powernv/opal-async.c204
-rw-r--r--arch/powerpc/platforms/powernv/opal-dump.c520
-rw-r--r--arch/powerpc/platforms/powernv/opal-elog.c308
-rw-r--r--arch/powerpc/platforms/powernv/opal-msglog.c120
-rw-r--r--arch/powerpc/platforms/powernv/opal-sensor.c66
-rw-r--r--arch/powerpc/platforms/powernv/opal-sysparam.c290
-rw-r--r--arch/powerpc/platforms/powernv/opal-wrappers.S16
-rw-r--r--arch/powerpc/platforms/powernv/opal.c149
-rw-r--r--arch/powerpc/platforms/powernv/setup.c1
-rw-r--r--arch/powerpc/platforms/ps3/Kconfig2
-rw-r--r--arch/powerpc/platforms/ps3/smp.c2
-rw-r--r--arch/powerpc/platforms/pseries/Kconfig12
-rw-r--r--arch/powerpc/platforms/pseries/dlpar.c2
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-cpu.c2
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-memory.c83
-rw-r--r--arch/powerpc/platforms/pseries/io_event_irq.c6
-rw-r--r--arch/powerpc/platforms/pseries/mobility.c26
-rw-r--r--arch/powerpc/platforms/pseries/nvram.c11
-rw-r--r--arch/powerpc/platforms/pseries/pci_dlpar.c6
-rw-r--r--arch/powerpc/platforms/pseries/ras.c17
-rw-r--r--arch/powerpc/platforms/pseries/reconfig.c2
-rw-r--r--arch/powerpc/platforms/pseries/suspend.c44
-rw-r--r--arch/powerpc/sysdev/Makefile1
-rw-r--r--arch/powerpc/sysdev/fsl_ifc.c305
-rw-r--r--arch/powerpc/sysdev/fsl_pci.c178
-rw-r--r--arch/powerpc/sysdev/fsl_pci.h8
-rw-r--r--arch/powerpc/sysdev/fsl_rio.c1
-rw-r--r--arch/powerpc/sysdev/msi_bitmap.c2
-rw-r--r--arch/powerpc/xmon/xmon.c4
-rw-r--r--arch/s390/Kconfig3
-rw-r--r--arch/s390/configs/default_defconfig1
-rw-r--r--arch/s390/include/asm/atomic.h70
-rw-r--r--arch/s390/include/asm/bitops.h41
-rw-r--r--arch/s390/include/asm/ccwgroup.h1
-rw-r--r--arch/s390/include/asm/cio.h2
-rw-r--r--arch/s390/include/asm/futex.h66
-rw-r--r--arch/s390/include/asm/irq.h19
-rw-r--r--arch/s390/include/asm/kvm_host.h98
-rw-r--r--arch/s390/include/asm/mmu.h2
-rw-r--r--arch/s390/include/asm/mmu_context.h45
-rw-r--r--arch/s390/include/asm/pgtable.h130
-rw-r--r--arch/s390/include/asm/processor.h1
-rw-r--r--arch/s390/include/asm/setup.h3
-rw-r--r--arch/s390/include/asm/switch_to.h1
-rw-r--r--arch/s390/include/asm/syscall.h7
-rw-r--r--arch/s390/include/asm/thread_info.h2
-rw-r--r--arch/s390/include/asm/tlb.h14
-rw-r--r--arch/s390/include/asm/tlbflush.h115
-rw-r--r--arch/s390/include/asm/uaccess.h2
-rw-r--r--arch/s390/include/uapi/asm/kvm.h43
-rw-r--r--arch/s390/kernel/asm-offsets.c1
-rw-r--r--arch/s390/kernel/cache.c5
-rw-r--r--arch/s390/kernel/early.c2
-rw-r--r--arch/s390/kernel/entry.S24
-rw-r--r--arch/s390/kernel/entry64.S24
-rw-r--r--arch/s390/kernel/ftrace.c3
-rw-r--r--arch/s390/kernel/irq.c11
-rw-r--r--arch/s390/kernel/perf_cpum_cf.c6
-rw-r--r--arch/s390/kernel/perf_cpum_sf.c6
-rw-r--r--arch/s390/kernel/runtime_instr.c3
-rw-r--r--arch/s390/kernel/sclp.S5
-rw-r--r--arch/s390/kernel/smp.c23
-rw-r--r--arch/s390/kernel/time.c6
-rw-r--r--arch/s390/kvm/Kconfig4
-rw-r--r--arch/s390/kvm/Makefile2
-rw-r--r--arch/s390/kvm/diag.c88
-rw-r--r--arch/s390/kvm/interrupt.c704
-rw-r--r--arch/s390/kvm/irq.h22
-rw-r--r--arch/s390/kvm/kvm-s390.c212
-rw-r--r--arch/s390/kvm/kvm-s390.h7
-rw-r--r--arch/s390/kvm/priv.c7
-rw-r--r--arch/s390/kvm/sigp.c157
-rw-r--r--arch/s390/kvm/trace.h46
-rw-r--r--arch/s390/lib/Makefile2
-rw-r--r--arch/s390/lib/uaccess.c407
-rw-r--r--arch/s390/lib/uaccess.h16
-rw-r--r--arch/s390/lib/uaccess_mvcos.c263
-rw-r--r--arch/s390/lib/uaccess_pt.c471
-rw-r--r--arch/s390/mm/fault.c79
-rw-r--r--arch/s390/mm/hugetlbpage.c5
-rw-r--r--arch/s390/mm/init.c7
-rw-r--r--arch/s390/mm/pgtable.c15
-rw-r--r--arch/s390/mm/vmem.c2
-rw-r--r--arch/s390/net/bpf_jit_comp.c13
-rw-r--r--arch/s390/oprofile/hwsampler.c4
-rw-r--r--arch/s390/pci/pci.c16
-rw-r--r--arch/s390/pci/pci_sysfs.c18
-rw-r--r--arch/score/Kconfig6
-rw-r--r--arch/sh/Kconfig14
-rw-r--r--arch/sh/boards/Kconfig8
-rw-r--r--arch/sh/boards/board-sh7757lcr.c2
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c4
-rw-r--r--arch/sh/boards/mach-se/7724/setup.c4
-rw-r--r--arch/sh/configs/rsk7203_defconfig1
-rw-r--r--arch/sh/drivers/pci/pci.c5
-rw-r--r--arch/sh/drivers/pci/pcie-sh7786.h3
-rw-r--r--arch/sh/include/asm/io.h4
-rw-r--r--arch/sh/include/asm/io_trapped.h2
-rw-r--r--arch/sh/include/asm/machvec.h2
-rw-r--r--arch/sh/include/asm/syscalls_32.h12
-rw-r--r--arch/sh/include/asm/traps_32.h16
-rw-r--r--arch/sh/kernel/Makefile2
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7757.c2
-rw-r--r--arch/sh/kernel/dumpstack.c2
-rw-r--r--arch/sh/kernel/entry-common.S15
-rw-r--r--arch/sh/kernel/ftrace.c5
-rw-r--r--arch/sh/kernel/io_trapped.c4
-rw-r--r--arch/sh/kernel/signal_32.c12
-rw-r--r--arch/sh/kernel/sys_sh32.c7
-rw-r--r--arch/sh/kernel/traps_32.c23
-rw-r--r--arch/sh/math-emu/math.c18
-rw-r--r--arch/sparc/Kconfig1
-rw-r--r--arch/sparc/kernel/ftrace.c6
-rw-r--r--arch/sparc/kernel/leon_pci.c5
-rw-r--r--arch/sparc/kernel/leon_pci_grpci2.c1
-rw-r--r--arch/sparc/kernel/sun4m_irq.c2
-rw-r--r--arch/sparc/kernel/sysfs.c6
-rw-r--r--arch/sparc/kernel/time_64.c3
-rw-r--r--arch/sparc/net/bpf_jit_comp.c5
-rw-r--r--arch/tile/Kconfig8
-rw-r--r--arch/tile/include/asm/perf_event.h22
-rw-r--r--arch/tile/include/asm/pmc.h64
-rw-r--r--arch/tile/kernel/Makefile2
-rw-r--r--arch/tile/kernel/ftrace.c4
-rw-r--r--arch/tile/kernel/intvec_32.S24
-rw-r--r--arch/tile/kernel/intvec_64.S24
-rw-r--r--arch/tile/kernel/irq.c18
-rw-r--r--arch/tile/kernel/messaging.c4
-rw-r--r--arch/tile/kernel/pci.c2
-rw-r--r--arch/tile/kernel/pci_gx.c12
-rw-r--r--arch/tile/kernel/perf_event.c1005
-rw-r--r--arch/tile/kernel/pmc.c121
-rw-r--r--arch/tile/kernel/time.c10
-rw-r--r--arch/tile/kernel/vdso/Makefile2
-rw-r--r--arch/um/Kconfig.common1
-rw-r--r--arch/um/drivers/net_kern.c2
-rw-r--r--arch/um/kernel/process.c2
-rw-r--r--arch/unicore32/Kconfig2
-rw-r--r--arch/unicore32/include/asm/mmu_context.h4
-rw-r--r--arch/x86/Kconfig118
-rw-r--r--arch/x86/Kconfig.cpu2
-rw-r--r--arch/x86/Makefile2
-rw-r--r--arch/x86/boot/boot.h13
-rw-r--r--arch/x86/boot/compressed/eboot.c19
-rw-r--r--arch/x86/boot/compressed/head_32.S8
-rw-r--r--arch/x86/boot/compressed/head_64.S9
-rw-r--r--arch/x86/boot/compressed/misc.c51
-rw-r--r--arch/x86/boot/compressed/string.c46
-rw-r--r--arch/x86/boot/cpucheck.c1
-rw-r--r--arch/x86/boot/edd.c1
-rw-r--r--arch/x86/boot/main.c1
-rw-r--r--arch/x86/boot/regs.c1
-rw-r--r--arch/x86/boot/string.c14
-rw-r--r--arch/x86/boot/string.h21
-rw-r--r--arch/x86/boot/video-vesa.c1
-rw-r--r--arch/x86/configs/i386_defconfig1
-rw-r--r--arch/x86/configs/x86_64_defconfig1
-rw-r--r--arch/x86/crypto/Makefile3
-rw-r--r--arch/x86/crypto/blowfish_glue.c3
-rw-r--r--arch/x86/crypto/cast5_avx_glue.c3
-rw-r--r--arch/x86/crypto/ghash-clmulni-intel_asm.S29
-rw-r--r--arch/x86/crypto/ghash-clmulni-intel_glue.c14
-rw-r--r--arch/x86/crypto/sha1_avx2_x86_64_asm.S708
-rw-r--r--arch/x86/crypto/sha1_ssse3_glue.c53
-rw-r--r--arch/x86/include/asm/Kbuild1
-rw-r--r--arch/x86/include/asm/archrandom.h42
-rw-r--r--arch/x86/include/asm/bug.h3
-rw-r--r--arch/x86/include/asm/clocksource.h4
-rw-r--r--arch/x86/include/asm/cpufeature.h7
-rw-r--r--arch/x86/include/asm/elf.h4
-rw-r--r--arch/x86/include/asm/fixmap.h20
-rw-r--r--arch/x86/include/asm/hw_irq.h1
-rw-r--r--arch/x86/include/asm/io.h14
-rw-r--r--arch/x86/include/asm/kvm_host.h18
-rw-r--r--arch/x86/include/asm/mmzone_32.h3
-rw-r--r--arch/x86/include/asm/mpspec.h6
-rw-r--r--arch/x86/include/asm/numaq.h171
-rw-r--r--arch/x86/include/asm/pci.h7
-rw-r--r--arch/x86/include/asm/percpu.h98
-rw-r--r--arch/x86/include/asm/pgtable_types.h7
-rw-r--r--arch/x86/include/asm/preempt.h16
-rw-r--r--arch/x86/include/asm/setup.h6
-rw-r--r--arch/x86/include/asm/syscall.h10
-rw-r--r--arch/x86/include/asm/topology.h14
-rw-r--r--arch/x86/include/asm/vdso.h52
-rw-r--r--arch/x86/include/asm/vdso32.h11
-rw-r--r--arch/x86/include/asm/vgtod.h71
-rw-r--r--arch/x86/include/asm/visws/cobalt.h127
-rw-r--r--arch/x86/include/asm/visws/lithium.h53
-rw-r--r--arch/x86/include/asm/visws/piix4.h107
-rw-r--r--arch/x86/include/asm/visws/sgivw.h5
-rw-r--r--arch/x86/include/asm/vmx.h4
-rw-r--r--arch/x86/include/asm/vvar.h29
-rw-r--r--arch/x86/include/asm/xen/page.h11
-rw-r--r--arch/x86/include/asm/xsave.h2
-rw-r--r--arch/x86/include/uapi/asm/msr-index.h1
-rw-r--r--arch/x86/kernel/Makefile2
-rw-r--r--arch/x86/kernel/acpi/boot.c16
-rw-r--r--arch/x86/kernel/acpi/cstate.c4
-rw-r--r--arch/x86/kernel/amd_nb.c2
-rw-r--r--arch/x86/kernel/apic/Makefile3
-rw-r--r--arch/x86/kernel/apic/apic.c4
-rw-r--r--arch/x86/kernel/apic/es7000_32.c738
-rw-r--r--arch/x86/kernel/apic/numaq_32.c524
-rw-r--r--arch/x86/kernel/apic/summit_32.c550
-rw-r--r--arch/x86/kernel/cpu/intel.c4
-rw-r--r--arch/x86/kernel/cpu/intel_cacheinfo.c13
-rw-r--r--arch/x86/kernel/cpu/match.c42
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c26
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_intel.c19
-rw-r--r--arch/x86/kernel/cpu/mcheck/therm_throt.c18
-rw-r--r--arch/x86/kernel/cpu/perf_event_amd_ibs.c6
-rw-r--r--arch/x86/kernel/cpu/perf_event_amd_uncore.c7
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel_rapl.c9
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel_uncore.c6
-rw-r--r--arch/x86/kernel/cpuid.c15
-rw-r--r--arch/x86/kernel/dumpstack_64.c25
-rw-r--r--arch/x86/kernel/early-quirks.c211
-rw-r--r--arch/x86/kernel/ftrace.c55
-rw-r--r--arch/x86/kernel/hpet.c6
-rw-r--r--arch/x86/kernel/irq.c2
-rw-r--r--arch/x86/kernel/kvm.c1
-rw-r--r--arch/x86/kernel/kvmclock.c2
-rw-r--r--arch/x86/kernel/ldt.c11
-rw-r--r--arch/x86/kernel/msr.c16
-rw-r--r--arch/x86/kernel/pci-calgary_64.c31
-rw-r--r--arch/x86/kernel/setup.c1
-rw-r--r--arch/x86/kernel/tsc.c5
-rw-r--r--arch/x86/kernel/vmlinux.lds.S8
-rw-r--r--arch/x86/kernel/vsyscall_64.c51
-rw-r--r--arch/x86/kernel/vsyscall_gtod.c69
-rw-r--r--arch/x86/kvm/cpuid.c37
-rw-r--r--arch/x86/kvm/emulate.c8
-rw-r--r--arch/x86/kvm/mmu.c2
-rw-r--r--arch/x86/kvm/paging_tmpl.h7
-rw-r--r--arch/x86/kvm/svm.c84
-rw-r--r--arch/x86/kvm/vmx.c334
-rw-r--r--arch/x86/kvm/x86.c152
-rw-r--r--arch/x86/kvm/x86.h5
-rw-r--r--arch/x86/mm/ioremap.c224
-rw-r--r--arch/x86/mm/kmemcheck/kmemcheck.c8
-rw-r--r--arch/x86/mm/numa.c4
-rw-r--r--arch/x86/mm/pgtable_32.c2
-rw-r--r--arch/x86/net/bpf_jit_comp.c11
-rw-r--r--arch/x86/oprofile/nmi_int.c15
-rw-r--r--arch/x86/pci/Makefile3
-rw-r--r--arch/x86/pci/acpi.c59
-rw-r--r--arch/x86/pci/amd_bus.c15
-rw-r--r--arch/x86/pci/bus_numa.c13
-rw-r--r--arch/x86/pci/common.c133
-rw-r--r--arch/x86/pci/fixup.c24
-rw-r--r--arch/x86/pci/irq.c6
-rw-r--r--arch/x86/pci/legacy.c4
-rw-r--r--arch/x86/pci/numaq_32.c165
-rw-r--r--arch/x86/pci/visws.c87
-rw-r--r--arch/x86/pci/xen.c29
-rw-r--r--arch/x86/platform/Makefile1
-rw-r--r--arch/x86/platform/visws/Makefile1
-rw-r--r--arch/x86/platform/visws/visws_quirks.c608
-rw-r--r--arch/x86/syscalls/syscall_64.tbl1
-rw-r--r--arch/x86/tools/relocs.c2
-rw-r--r--arch/x86/vdso/Makefile16
-rw-r--r--arch/x86/vdso/vclock_gettime.c256
-rw-r--r--arch/x86/vdso/vdso-layout.lds.S29
-rw-r--r--arch/x86/vdso/vdso.S22
-rw-r--r--arch/x86/vdso/vdso32-setup.c301
-rw-r--r--arch/x86/vdso/vdso32.S21
-rw-r--r--arch/x86/vdso/vdso32/vclock_gettime.c30
-rw-r--r--arch/x86/vdso/vdso32/vdso32.lds.S15
-rw-r--r--arch/x86/vdso/vdsox32.S22
-rw-r--r--arch/x86/vdso/vma.c20
-rw-r--r--arch/x86/xen/Kconfig7
-rw-r--r--arch/x86/xen/mmu.c1
-rw-r--r--arch/x86/xen/p2m.c121
-rw-r--r--arch/xtensa/Kconfig4
-rw-r--r--arch/xtensa/configs/iss_defconfig3
-rw-r--r--arch/xtensa/configs/s6105_defconfig3
1851 files changed, 71627 insertions, 32252 deletions
diff --git a/arch/Kconfig b/arch/Kconfig
index 80bbb8ccd0d1..97ff872c7acc 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -86,9 +86,7 @@ config KPROBES_ON_FTRACE
86 optimize on top of function tracing. 86 optimize on top of function tracing.
87 87
88config UPROBES 88config UPROBES
89 bool "Transparent user-space probes (EXPERIMENTAL)" 89 def_bool n
90 depends on UPROBE_EVENT && PERF_EVENTS
91 default n
92 select PERCPU_RWSEM 90 select PERCPU_RWSEM
93 help 91 help
94 Uprobes is the user-space counterpart to kprobes: they 92 Uprobes is the user-space counterpart to kprobes: they
@@ -101,8 +99,6 @@ config UPROBES
101 managed by the kernel and kept transparent to the probed 99 managed by the kernel and kept transparent to the probed
102 application. ) 100 application. )
103 101
104 If in doubt, say "N".
105
106config HAVE_64BIT_ALIGNED_ACCESS 102config HAVE_64BIT_ALIGNED_ACCESS
107 def_bool 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS 103 def_bool 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS
108 help 104 help
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index f6c6b345388c..b7ff9a318c31 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -22,6 +22,7 @@ config ALPHA
22 select GENERIC_SMP_IDLE_THREAD 22 select GENERIC_SMP_IDLE_THREAD
23 select GENERIC_STRNCPY_FROM_USER 23 select GENERIC_STRNCPY_FROM_USER
24 select GENERIC_STRNLEN_USER 24 select GENERIC_STRNLEN_USER
25 select HAVE_ARCH_AUDITSYSCALL
25 select HAVE_MOD_ARCH_SPECIFIC 26 select HAVE_MOD_ARCH_SPECIFIC
26 select MODULES_USE_ELF_RELA 27 select MODULES_USE_ELF_RELA
27 select ODD_RT_SIGACTION 28 select ODD_RT_SIGACTION
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
index edb4e0097b75..076c35cd6cde 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -254,12 +254,6 @@ void pcibios_fixup_bus(struct pci_bus *bus)
254 } 254 }
255} 255}
256 256
257int
258pcibios_enable_device(struct pci_dev *dev, int mask)
259{
260 return pci_enable_resources(dev, mask);
261}
262
263/* 257/*
264 * If we set up a device for bus mastering, we need to check the latency 258 * If we set up a device for bus mastering, we need to check the latency
265 * timer as certain firmware forgets to set it properly, as seen 259 * timer as certain firmware forgets to set it properly, as seen
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 9be30c8cb0c2..9596b0ab108d 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -57,7 +57,7 @@ config ARCH_FLATMEM_ENABLE
57config MMU 57config MMU
58 def_bool y 58 def_bool y
59 59
60config NO_IOPORT 60config NO_IOPORT_MAP
61 def_bool y 61 def_bool y
62 62
63config GENERIC_CALIBRATE_DELAY 63config GENERIC_CALIBRATE_DELAY
@@ -356,7 +356,6 @@ config ARC_CURR_IN_REG
356 356
357config ARC_MISALIGN_ACCESS 357config ARC_MISALIGN_ACCESS
358 bool "Emulate unaligned memory access (userspace only)" 358 bool "Emulate unaligned memory access (userspace only)"
359 default N
360 select SYSCTL_ARCH_UNALIGN_NO_WARN 359 select SYSCTL_ARCH_UNALIGN_NO_WARN
361 select SYSCTL_ARCH_UNALIGN_ALLOW 360 select SYSCTL_ARCH_UNALIGN_ALLOW
362 help 361 help
diff --git a/arch/arc/boot/.gitignore b/arch/arc/boot/.gitignore
index 5d65b54bf17a..5246969a20c5 100644
--- a/arch/arc/boot/.gitignore
+++ b/arch/arc/boot/.gitignore
@@ -1 +1,2 @@
1*.dtb* 1*.dtb*
2uImage
diff --git a/arch/arc/boot/dts/nsimosci.dts b/arch/arc/boot/dts/nsimosci.dts
index ea16d782af58..4f31b2eb5cdf 100644
--- a/arch/arc/boot/dts/nsimosci.dts
+++ b/arch/arc/boot/dts/nsimosci.dts
@@ -11,13 +11,16 @@
11 11
12/ { 12/ {
13 compatible = "snps,nsimosci"; 13 compatible = "snps,nsimosci";
14 clock-frequency = <80000000>; /* 80 MHZ */ 14 clock-frequency = <20000000>; /* 20 MHZ */
15 #address-cells = <1>; 15 #address-cells = <1>;
16 #size-cells = <1>; 16 #size-cells = <1>;
17 interrupt-parent = <&intc>; 17 interrupt-parent = <&intc>;
18 18
19 chosen { 19 chosen {
20 bootargs = "console=tty0 consoleblank=0"; 20 /* this is for console on PGU */
21 /* bootargs = "console=tty0 consoleblank=0"; */
22 /* this is for console on serial */
23 bootargs = "earlycon=uart8250,mmio32,0xc0000000,115200n8 console=ttyS0,115200n8 consoleblank=0 debug";
21 }; 24 };
22 25
23 aliases { 26 aliases {
@@ -44,15 +47,14 @@
44 }; 47 };
45 48
46 uart0: serial@c0000000 { 49 uart0: serial@c0000000 {
47 compatible = "snps,dw-apb-uart"; 50 compatible = "ns8250";
48 reg = <0xc0000000 0x2000>; 51 reg = <0xc0000000 0x2000>;
49 interrupts = <11>; 52 interrupts = <11>;
50 #clock-frequency = <80000000>;
51 clock-frequency = <3686400>; 53 clock-frequency = <3686400>;
52 baud = <115200>; 54 baud = <115200>;
53 reg-shift = <2>; 55 reg-shift = <2>;
54 reg-io-width = <4>; 56 reg-io-width = <4>;
55 status = "okay"; 57 no-loopback-test = <1>;
56 }; 58 };
57 59
58 pgu0: pgu@c9000000 { 60 pgu0: pgu@c9000000 {
diff --git a/arch/arc/boot/dts/skeleton.dts b/arch/arc/boot/dts/skeleton.dts
deleted file mode 100644
index 25a84fb5b3dc..000000000000
--- a/arch/arc/boot/dts/skeleton.dts
+++ /dev/null
@@ -1,10 +0,0 @@
1/*
2 * Copyright (C) 2012 Synopsys, Inc. (www.synopsys.com)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8/dts-v1/;
9
10/include/ "skeleton.dtsi"
diff --git a/arch/arc/configs/nsimosci_defconfig b/arch/arc/configs/nsimosci_defconfig
index 451af30914f6..c01ba35a4eff 100644
--- a/arch/arc/configs/nsimosci_defconfig
+++ b/arch/arc/configs/nsimosci_defconfig
@@ -54,6 +54,7 @@ CONFIG_SERIO_ARC_PS2=y
54CONFIG_SERIAL_8250=y 54CONFIG_SERIAL_8250=y
55CONFIG_SERIAL_8250_CONSOLE=y 55CONFIG_SERIAL_8250_CONSOLE=y
56CONFIG_SERIAL_8250_DW=y 56CONFIG_SERIAL_8250_DW=y
57CONFIG_SERIAL_OF_PLATFORM=y
57CONFIG_SERIAL_ARC=y 58CONFIG_SERIAL_ARC=y
58CONFIG_SERIAL_ARC_CONSOLE=y 59CONFIG_SERIAL_ARC_CONSOLE=y
59# CONFIG_HW_RANDOM is not set 60# CONFIG_HW_RANDOM is not set
diff --git a/arch/arc/include/asm/linkage.h b/arch/arc/include/asm/linkage.h
index 66ee5527aefc..5faad17118b4 100644
--- a/arch/arc/include/asm/linkage.h
+++ b/arch/arc/include/asm/linkage.h
@@ -13,20 +13,6 @@
13 13
14#define ASM_NL ` /* use '`' to mark new line in macro */ 14#define ASM_NL ` /* use '`' to mark new line in macro */
15 15
16/* Can't use the ENTRY macro in linux/linkage.h
17 * gas considers ';' as comment vs. newline
18 */
19.macro ARC_ENTRY name
20 .global \name
21 .align 4
22 \name:
23.endm
24
25.macro ARC_EXIT name
26#define ASM_PREV_SYM_ADDR(name) .-##name
27 .size \ name, ASM_PREV_SYM_ADDR(\name)
28.endm
29
30/* annotation for data we want in DCCM - if enabled in .config */ 16/* annotation for data we want in DCCM - if enabled in .config */
31.macro ARCFP_DATA nm 17.macro ARCFP_DATA nm
32#ifdef CONFIG_ARC_HAS_DCCM 18#ifdef CONFIG_ARC_HAS_DCCM
diff --git a/arch/arc/kernel/ctx_sw_asm.S b/arch/arc/kernel/ctx_sw_asm.S
index 65690e7fcc8c..2ff0347a2fd7 100644
--- a/arch/arc/kernel/ctx_sw_asm.S
+++ b/arch/arc/kernel/ctx_sw_asm.S
@@ -62,4 +62,4 @@ __switch_to:
62 ld.ab blink, [sp, 4] 62 ld.ab blink, [sp, 4]
63 j [blink] 63 j [blink]
64 64
65ARC_EXIT __switch_to 65END(__switch_to)
diff --git a/arch/arc/kernel/entry.S b/arch/arc/kernel/entry.S
index 47d09d07f093..819dd5f7eb05 100644
--- a/arch/arc/kernel/entry.S
+++ b/arch/arc/kernel/entry.S
@@ -141,7 +141,7 @@ VECTOR EV_Extension ; 0x130, Extn Intruction Excp (0x26)
141VECTOR reserved ; Reserved Exceptions 141VECTOR reserved ; Reserved Exceptions
142.endr 142.endr
143 143
144#include <linux/linkage.h> /* ARC_{EXTRY,EXIT} */ 144#include <linux/linkage.h> /* {EXTRY,EXIT} */
145#include <asm/entry.h> /* SAVE_ALL_{INT1,INT2,SYS...} */ 145#include <asm/entry.h> /* SAVE_ALL_{INT1,INT2,SYS...} */
146#include <asm/errno.h> 146#include <asm/errno.h>
147#include <asm/arcregs.h> 147#include <asm/arcregs.h>
@@ -184,7 +184,7 @@ reserved: ; processor restart
184; --------------------------------------------- 184; ---------------------------------------------
185; Level 2 ISR: Can interrupt a Level 1 ISR 185; Level 2 ISR: Can interrupt a Level 1 ISR
186; --------------------------------------------- 186; ---------------------------------------------
187ARC_ENTRY handle_interrupt_level2 187ENTRY(handle_interrupt_level2)
188 188
189 ; TODO-vineetg for SMP this wont work 189 ; TODO-vineetg for SMP this wont work
190 ; free up r9 as scratchpad 190 ; free up r9 as scratchpad
@@ -225,14 +225,14 @@ ARC_ENTRY handle_interrupt_level2
225 225
226 b ret_from_exception 226 b ret_from_exception
227 227
228ARC_EXIT handle_interrupt_level2 228END(handle_interrupt_level2)
229 229
230#endif 230#endif
231 231
232; --------------------------------------------- 232; ---------------------------------------------
233; Level 1 ISR 233; Level 1 ISR
234; --------------------------------------------- 234; ---------------------------------------------
235ARC_ENTRY handle_interrupt_level1 235ENTRY(handle_interrupt_level1)
236 236
237 /* free up r9 as scratchpad */ 237 /* free up r9 as scratchpad */
238#ifdef CONFIG_SMP 238#ifdef CONFIG_SMP
@@ -265,7 +265,7 @@ ARC_ENTRY handle_interrupt_level1
265 sr r8, [AUX_IRQ_LV12] ; clear bit in Sticky Status Reg 265 sr r8, [AUX_IRQ_LV12] ; clear bit in Sticky Status Reg
266 266
267 b ret_from_exception 267 b ret_from_exception
268ARC_EXIT handle_interrupt_level1 268END(handle_interrupt_level1)
269 269
270;################### Non TLB Exception Handling ############################# 270;################### Non TLB Exception Handling #############################
271 271
@@ -273,7 +273,7 @@ ARC_EXIT handle_interrupt_level1
273; Instruction Error Exception Handler 273; Instruction Error Exception Handler
274; --------------------------------------------- 274; ---------------------------------------------
275 275
276ARC_ENTRY instr_service 276ENTRY(instr_service)
277 277
278 EXCEPTION_PROLOGUE 278 EXCEPTION_PROLOGUE
279 279
@@ -284,13 +284,13 @@ ARC_ENTRY instr_service
284 284
285 bl do_insterror_or_kprobe 285 bl do_insterror_or_kprobe
286 b ret_from_exception 286 b ret_from_exception
287ARC_EXIT instr_service 287END(instr_service)
288 288
289; --------------------------------------------- 289; ---------------------------------------------
290; Memory Error Exception Handler 290; Memory Error Exception Handler
291; --------------------------------------------- 291; ---------------------------------------------
292 292
293ARC_ENTRY mem_service 293ENTRY(mem_service)
294 294
295 EXCEPTION_PROLOGUE 295 EXCEPTION_PROLOGUE
296 296
@@ -301,13 +301,13 @@ ARC_ENTRY mem_service
301 301
302 bl do_memory_error 302 bl do_memory_error
303 b ret_from_exception 303 b ret_from_exception
304ARC_EXIT mem_service 304END(mem_service)
305 305
306; --------------------------------------------- 306; ---------------------------------------------
307; Machine Check Exception Handler 307; Machine Check Exception Handler
308; --------------------------------------------- 308; ---------------------------------------------
309 309
310ARC_ENTRY EV_MachineCheck 310ENTRY(EV_MachineCheck)
311 311
312 EXCEPTION_PROLOGUE 312 EXCEPTION_PROLOGUE
313 313
@@ -331,13 +331,13 @@ ARC_ENTRY EV_MachineCheck
331 331
332 j do_machine_check_fault 332 j do_machine_check_fault
333 333
334ARC_EXIT EV_MachineCheck 334END(EV_MachineCheck)
335 335
336; --------------------------------------------- 336; ---------------------------------------------
337; Protection Violation Exception Handler 337; Protection Violation Exception Handler
338; --------------------------------------------- 338; ---------------------------------------------
339 339
340ARC_ENTRY EV_TLBProtV 340ENTRY(EV_TLBProtV)
341 341
342 EXCEPTION_PROLOGUE 342 EXCEPTION_PROLOGUE
343 343
@@ -385,12 +385,12 @@ ARC_ENTRY EV_TLBProtV
385 385
386 b ret_from_exception 386 b ret_from_exception
387 387
388ARC_EXIT EV_TLBProtV 388END(EV_TLBProtV)
389 389
390; --------------------------------------------- 390; ---------------------------------------------
391; Privilege Violation Exception Handler 391; Privilege Violation Exception Handler
392; --------------------------------------------- 392; ---------------------------------------------
393ARC_ENTRY EV_PrivilegeV 393ENTRY(EV_PrivilegeV)
394 394
395 EXCEPTION_PROLOGUE 395 EXCEPTION_PROLOGUE
396 396
@@ -401,12 +401,12 @@ ARC_ENTRY EV_PrivilegeV
401 401
402 bl do_privilege_fault 402 bl do_privilege_fault
403 b ret_from_exception 403 b ret_from_exception
404ARC_EXIT EV_PrivilegeV 404END(EV_PrivilegeV)
405 405
406; --------------------------------------------- 406; ---------------------------------------------
407; Extension Instruction Exception Handler 407; Extension Instruction Exception Handler
408; --------------------------------------------- 408; ---------------------------------------------
409ARC_ENTRY EV_Extension 409ENTRY(EV_Extension)
410 410
411 EXCEPTION_PROLOGUE 411 EXCEPTION_PROLOGUE
412 412
@@ -417,7 +417,7 @@ ARC_ENTRY EV_Extension
417 417
418 bl do_extension_fault 418 bl do_extension_fault
419 b ret_from_exception 419 b ret_from_exception
420ARC_EXIT EV_Extension 420END(EV_Extension)
421 421
422;######################### System Call Tracing ######################### 422;######################### System Call Tracing #########################
423 423
@@ -504,7 +504,7 @@ trap_with_param:
504; (2) Break Points 504; (2) Break Points
505;------------------------------------------------------------------ 505;------------------------------------------------------------------
506 506
507ARC_ENTRY EV_Trap 507ENTRY(EV_Trap)
508 508
509 EXCEPTION_PROLOGUE 509 EXCEPTION_PROLOGUE
510 510
@@ -534,9 +534,9 @@ ARC_ENTRY EV_Trap
534 jl [r9] ; Entry into Sys Call Handler 534 jl [r9] ; Entry into Sys Call Handler
535 535
536 ; fall through to ret_from_system_call 536 ; fall through to ret_from_system_call
537ARC_EXIT EV_Trap 537END(EV_Trap)
538 538
539ARC_ENTRY ret_from_system_call 539ENTRY(ret_from_system_call)
540 540
541 st r0, [sp, PT_r0] ; sys call return value in pt_regs 541 st r0, [sp, PT_r0] ; sys call return value in pt_regs
542 542
@@ -546,7 +546,7 @@ ARC_ENTRY ret_from_system_call
546; 546;
547; If ret to user mode do we need to handle signals, schedule() et al. 547; If ret to user mode do we need to handle signals, schedule() et al.
548 548
549ARC_ENTRY ret_from_exception 549ENTRY(ret_from_exception)
550 550
551 ; Pre-{IRQ,Trap,Exception} K/U mode from pt_regs->status32 551 ; Pre-{IRQ,Trap,Exception} K/U mode from pt_regs->status32
552 ld r8, [sp, PT_status32] ; returning to User/Kernel Mode 552 ld r8, [sp, PT_status32] ; returning to User/Kernel Mode
@@ -726,9 +726,9 @@ not_level1_interrupt:
726debug_marker_syscall: 726debug_marker_syscall:
727 rtie 727 rtie
728 728
729ARC_EXIT ret_from_exception 729END(ret_from_exception)
730 730
731ARC_ENTRY ret_from_fork 731ENTRY(ret_from_fork)
732 ; when the forked child comes here from the __switch_to function 732 ; when the forked child comes here from the __switch_to function
733 ; r0 has the last task pointer. 733 ; r0 has the last task pointer.
734 ; put last task in scheduler queue 734 ; put last task in scheduler queue
@@ -745,11 +745,11 @@ ARC_ENTRY ret_from_fork
745 ; special case of kernel_thread entry point returning back due to 745 ; special case of kernel_thread entry point returning back due to
746 ; kernel_execve() - pretend return from syscall to ret to userland 746 ; kernel_execve() - pretend return from syscall to ret to userland
747 b ret_from_exception 747 b ret_from_exception
748ARC_EXIT ret_from_fork 748END(ret_from_fork)
749 749
750;################### Special Sys Call Wrappers ########################## 750;################### Special Sys Call Wrappers ##########################
751 751
752ARC_ENTRY sys_clone_wrapper 752ENTRY(sys_clone_wrapper)
753 SAVE_CALLEE_SAVED_USER 753 SAVE_CALLEE_SAVED_USER
754 bl @sys_clone 754 bl @sys_clone
755 DISCARD_CALLEE_SAVED_USER 755 DISCARD_CALLEE_SAVED_USER
@@ -759,7 +759,7 @@ ARC_ENTRY sys_clone_wrapper
759 bnz tracesys_exit 759 bnz tracesys_exit
760 760
761 b ret_from_system_call 761 b ret_from_system_call
762ARC_EXIT sys_clone_wrapper 762END(sys_clone_wrapper)
763 763
764#ifdef CONFIG_ARC_DW2_UNWIND 764#ifdef CONFIG_ARC_DW2_UNWIND
765; Workaround for bug 94179 (STAR ): 765; Workaround for bug 94179 (STAR ):
diff --git a/arch/arc/kernel/head.S b/arch/arc/kernel/head.S
index 991997269d02..4ad04915dc6b 100644
--- a/arch/arc/kernel/head.S
+++ b/arch/arc/kernel/head.S
@@ -24,13 +24,13 @@
24 .globl stext 24 .globl stext
25stext: 25stext:
26 ;------------------------------------------------------------------- 26 ;-------------------------------------------------------------------
27 ; Don't clobber r0-r4 yet. It might have bootloader provided info 27 ; Don't clobber r0-r2 yet. It might have bootloader provided info
28 ;------------------------------------------------------------------- 28 ;-------------------------------------------------------------------
29 29
30 sr @_int_vec_base_lds, [AUX_INTR_VEC_BASE] 30 sr @_int_vec_base_lds, [AUX_INTR_VEC_BASE]
31 31
32#ifdef CONFIG_SMP 32#ifdef CONFIG_SMP
33 ; Only Boot (Master) proceeds. Others wait in platform dependent way 33 ; Ensure Boot (Master) proceeds. Others wait in platform dependent way
34 ; IDENTITY Reg [ 3 2 1 0 ] 34 ; IDENTITY Reg [ 3 2 1 0 ]
35 ; (cpu-id) ^^^ => Zero for UP ARC700 35 ; (cpu-id) ^^^ => Zero for UP ARC700
36 ; => #Core-ID if SMP (Master 0) 36 ; => #Core-ID if SMP (Master 0)
@@ -39,7 +39,8 @@ stext:
39 ; need to make sure only boot cpu takes this path. 39 ; need to make sure only boot cpu takes this path.
40 GET_CPU_ID r5 40 GET_CPU_ID r5
41 cmp r5, 0 41 cmp r5, 0
42 jnz arc_platform_smp_wait_to_boot 42 mov.ne r0, r5
43 jne arc_platform_smp_wait_to_boot
43#endif 44#endif
44 ; Clear BSS before updating any globals 45 ; Clear BSS before updating any globals
45 ; XXX: use ZOL here 46 ; XXX: use ZOL here
diff --git a/arch/arc/kernel/time.c b/arch/arc/kernel/time.c
index e5f3a837fb35..71c42521c77f 100644
--- a/arch/arc/kernel/time.c
+++ b/arch/arc/kernel/time.c
@@ -155,22 +155,6 @@ static void arc_timer_event_setup(unsigned int limit)
155 write_aux_reg(ARC_REG_TIMER0_CTRL, TIMER_CTRL_IE | TIMER_CTRL_NH); 155 write_aux_reg(ARC_REG_TIMER0_CTRL, TIMER_CTRL_IE | TIMER_CTRL_NH);
156} 156}
157 157
158/*
159 * Acknowledge the interrupt (oneshot) and optionally re-arm it (periodic)
160 * -Any write to CTRL Reg will ack the intr (NH bit: Count when not halted)
161 * -Rearming is done by setting the IE bit
162 *
163 * Small optimisation: Normal code would have been
164 * if (irq_reenable)
165 * CTRL_REG = (IE | NH);
166 * else
167 * CTRL_REG = NH;
168 * However since IE is BIT0 we can fold the branch
169 */
170static void arc_timer_event_ack(unsigned int irq_reenable)
171{
172 write_aux_reg(ARC_REG_TIMER0_CTRL, irq_reenable | TIMER_CTRL_NH);
173}
174 158
175static int arc_clkevent_set_next_event(unsigned long delta, 159static int arc_clkevent_set_next_event(unsigned long delta,
176 struct clock_event_device *dev) 160 struct clock_event_device *dev)
@@ -207,10 +191,22 @@ static DEFINE_PER_CPU(struct clock_event_device, arc_clockevent_device) = {
207 191
208static irqreturn_t timer_irq_handler(int irq, void *dev_id) 192static irqreturn_t timer_irq_handler(int irq, void *dev_id)
209{ 193{
210 struct clock_event_device *clk = this_cpu_ptr(&arc_clockevent_device); 194 /*
195 * Note that generic IRQ core could have passed @evt for @dev_id if
196 * irq_set_chip_and_handler() asked for handle_percpu_devid_irq()
197 */
198 struct clock_event_device *evt = this_cpu_ptr(&arc_clockevent_device);
199 int irq_reenable = evt->mode == CLOCK_EVT_MODE_PERIODIC;
200
201 /*
202 * Any write to CTRL reg ACks the interrupt, we rewrite the
203 * Count when [N]ot [H]alted bit.
204 * And re-arm it if perioid by [I]nterrupt [E]nable bit
205 */
206 write_aux_reg(ARC_REG_TIMER0_CTRL, irq_reenable | TIMER_CTRL_NH);
207
208 evt->event_handler(evt);
211 209
212 arc_timer_event_ack(clk->mode == CLOCK_EVT_MODE_PERIODIC);
213 clk->event_handler(clk);
214 return IRQ_HANDLED; 210 return IRQ_HANDLED;
215} 211}
216 212
@@ -222,9 +218,8 @@ static struct irqaction arc_timer_irq = {
222 218
223/* 219/*
224 * Setup the local event timer for @cpu 220 * Setup the local event timer for @cpu
225 * N.B. weak so that some exotic ARC SoCs can completely override it
226 */ 221 */
227void __weak arc_local_timer_setup(unsigned int cpu) 222void arc_local_timer_setup(unsigned int cpu)
228{ 223{
229 struct clock_event_device *clk = &per_cpu(arc_clockevent_device, cpu); 224 struct clock_event_device *clk = &per_cpu(arc_clockevent_device, cpu);
230 225
diff --git a/arch/arc/lib/memcmp.S b/arch/arc/lib/memcmp.S
index bc813d55b6c3..978bf8314dfb 100644
--- a/arch/arc/lib/memcmp.S
+++ b/arch/arc/lib/memcmp.S
@@ -6,7 +6,7 @@
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8 8
9#include <asm/linkage.h> 9#include <linux/linkage.h>
10 10
11#ifdef __LITTLE_ENDIAN__ 11#ifdef __LITTLE_ENDIAN__
12#define WORD2 r2 12#define WORD2 r2
@@ -16,7 +16,7 @@
16#define SHIFT r2 16#define SHIFT r2
17#endif 17#endif
18 18
19ARC_ENTRY memcmp 19ENTRY(memcmp)
20 or r12,r0,r1 20 or r12,r0,r1
21 asl_s r12,r12,30 21 asl_s r12,r12,30
22 sub r3,r2,1 22 sub r3,r2,1
@@ -121,4 +121,4 @@ ARC_ENTRY memcmp
121.Lnil: 121.Lnil:
122 j_s.d [blink] 122 j_s.d [blink]
123 mov r0,0 123 mov r0,0
124ARC_EXIT memcmp 124END(memcmp)
diff --git a/arch/arc/lib/memcpy-700.S b/arch/arc/lib/memcpy-700.S
index b64cc10ac918..3222573e50de 100644
--- a/arch/arc/lib/memcpy-700.S
+++ b/arch/arc/lib/memcpy-700.S
@@ -6,9 +6,9 @@
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8 8
9#include <asm/linkage.h> 9#include <linux/linkage.h>
10 10
11ARC_ENTRY memcpy 11ENTRY(memcpy)
12 or r3,r0,r1 12 or r3,r0,r1
13 asl_s r3,r3,30 13 asl_s r3,r3,30
14 mov_s r5,r0 14 mov_s r5,r0
@@ -63,4 +63,4 @@ ARC_ENTRY memcpy
63.Lendbloop: 63.Lendbloop:
64 j_s.d [blink] 64 j_s.d [blink]
65 stb r12,[r5,0] 65 stb r12,[r5,0]
66ARC_EXIT memcpy 66END(memcpy)
diff --git a/arch/arc/lib/memset.S b/arch/arc/lib/memset.S
index 9b2d88d2e141..d36bd43fc98d 100644
--- a/arch/arc/lib/memset.S
+++ b/arch/arc/lib/memset.S
@@ -6,11 +6,11 @@
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8 8
9#include <asm/linkage.h> 9#include <linux/linkage.h>
10 10
11#define SMALL 7 /* Must be at least 6 to deal with alignment/loop issues. */ 11#define SMALL 7 /* Must be at least 6 to deal with alignment/loop issues. */
12 12
13ARC_ENTRY memset 13ENTRY(memset)
14 mov_s r4,r0 14 mov_s r4,r0
15 or r12,r0,r2 15 or r12,r0,r2
16 bmsk.f r12,r12,1 16 bmsk.f r12,r12,1
@@ -46,14 +46,14 @@ ARC_ENTRY memset
46 stb.ab r1,[r4,1] 46 stb.ab r1,[r4,1]
47.Ltiny_end: 47.Ltiny_end:
48 j_s [blink] 48 j_s [blink]
49ARC_EXIT memset 49END(memset)
50 50
51; memzero: @r0 = mem, @r1 = size_t 51; memzero: @r0 = mem, @r1 = size_t
52; memset: @r0 = mem, @r1 = char, @r2 = size_t 52; memset: @r0 = mem, @r1 = char, @r2 = size_t
53 53
54ARC_ENTRY memzero 54ENTRY(memzero)
55 ; adjust bzero args to memset args 55 ; adjust bzero args to memset args
56 mov r2, r1 56 mov r2, r1
57 mov r1, 0 57 mov r1, 0
58 b memset ;tail call so need to tinker with blink 58 b memset ;tail call so need to tinker with blink
59ARC_EXIT memzero 59END(memzero)
diff --git a/arch/arc/lib/strchr-700.S b/arch/arc/lib/strchr-700.S
index 9c548c7cf001..b725d5862107 100644
--- a/arch/arc/lib/strchr-700.S
+++ b/arch/arc/lib/strchr-700.S
@@ -11,9 +11,9 @@
11 presence of the norm instruction makes it easier to operate on whole 11 presence of the norm instruction makes it easier to operate on whole
12 words branch-free. */ 12 words branch-free. */
13 13
14#include <asm/linkage.h> 14#include <linux/linkage.h>
15 15
16ARC_ENTRY strchr 16ENTRY(strchr)
17 extb_s r1,r1 17 extb_s r1,r1
18 asl r5,r1,8 18 asl r5,r1,8
19 bmsk r2,r0,1 19 bmsk r2,r0,1
@@ -130,4 +130,4 @@ ARC_ENTRY strchr
130 j_s.d [blink] 130 j_s.d [blink]
131 mov.mi r0,0 131 mov.mi r0,0
132#endif /* ENDIAN */ 132#endif /* ENDIAN */
133ARC_EXIT strchr 133END(strchr)
diff --git a/arch/arc/lib/strcmp.S b/arch/arc/lib/strcmp.S
index 5dc802b45cf3..3544600fefe6 100644
--- a/arch/arc/lib/strcmp.S
+++ b/arch/arc/lib/strcmp.S
@@ -13,9 +13,9 @@
13 source 1; however, that would increase the overhead for loop setup / finish, 13 source 1; however, that would increase the overhead for loop setup / finish,
14 and strcmp might often terminate early. */ 14 and strcmp might often terminate early. */
15 15
16#include <asm/linkage.h> 16#include <linux/linkage.h>
17 17
18ARC_ENTRY strcmp 18ENTRY(strcmp)
19 or r2,r0,r1 19 or r2,r0,r1
20 bmsk_s r2,r2,1 20 bmsk_s r2,r2,1
21 brne r2,0,.Lcharloop 21 brne r2,0,.Lcharloop
@@ -93,4 +93,4 @@ ARC_ENTRY strcmp
93.Lcmpend: 93.Lcmpend:
94 j_s.d [blink] 94 j_s.d [blink]
95 sub r0,r2,r3 95 sub r0,r2,r3
96ARC_EXIT strcmp 96END(strcmp)
diff --git a/arch/arc/lib/strcpy-700.S b/arch/arc/lib/strcpy-700.S
index b7ca4ae81d88..8422f38e1218 100644
--- a/arch/arc/lib/strcpy-700.S
+++ b/arch/arc/lib/strcpy-700.S
@@ -16,9 +16,9 @@
16 there, but the it is not likely to be taken often, and it 16 there, but the it is not likely to be taken often, and it
17 would also be likey to cost an unaligned mispredict at the next call. */ 17 would also be likey to cost an unaligned mispredict at the next call. */
18 18
19#include <asm/linkage.h> 19#include <linux/linkage.h>
20 20
21ARC_ENTRY strcpy 21ENTRY(strcpy)
22 or r2,r0,r1 22 or r2,r0,r1
23 bmsk_s r2,r2,1 23 bmsk_s r2,r2,1
24 brne.d r2,0,charloop 24 brne.d r2,0,charloop
@@ -67,4 +67,4 @@ charloop:
67 brne.d r3,0,charloop 67 brne.d r3,0,charloop
68 stb.ab r3,[r10,1] 68 stb.ab r3,[r10,1]
69 j [blink] 69 j [blink]
70ARC_EXIT strcpy 70END(strcpy)
diff --git a/arch/arc/lib/strlen.S b/arch/arc/lib/strlen.S
index 39759e099696..53cfd5685a5f 100644
--- a/arch/arc/lib/strlen.S
+++ b/arch/arc/lib/strlen.S
@@ -6,9 +6,9 @@
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8 8
9#include <asm/linkage.h> 9#include <linux/linkage.h>
10 10
11ARC_ENTRY strlen 11ENTRY(strlen)
12 or r3,r0,7 12 or r3,r0,7
13 ld r2,[r3,-7] 13 ld r2,[r3,-7]
14 ld.a r6,[r3,-3] 14 ld.a r6,[r3,-3]
@@ -80,4 +80,4 @@ ARC_ENTRY strlen
80.Learly_end: 80.Learly_end:
81 b.d .Lend 81 b.d .Lend
82 sub_s.ne r1,r1,r1 82 sub_s.ne r1,r1,r1
83ARC_EXIT strlen 83END(strlen)
diff --git a/arch/arc/mm/cache_arc700.c b/arch/arc/mm/cache_arc700.c
index 400c663b21c2..89edf7961a2f 100644
--- a/arch/arc/mm/cache_arc700.c
+++ b/arch/arc/mm/cache_arc700.c
@@ -100,10 +100,9 @@
100#define DC_CTRL_INV_MODE_FLUSH 0x40 100#define DC_CTRL_INV_MODE_FLUSH 0x40
101#define DC_CTRL_FLUSH_STATUS 0x100 101#define DC_CTRL_FLUSH_STATUS 0x100
102 102
103char *arc_cache_mumbojumbo(int cpu_id, char *buf, int len) 103char *arc_cache_mumbojumbo(int c, char *buf, int len)
104{ 104{
105 int n = 0; 105 int n = 0;
106 unsigned int c = smp_processor_id();
107 106
108#define PR_CACHE(p, enb, str) \ 107#define PR_CACHE(p, enb, str) \
109{ \ 108{ \
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
index 55e0a85bea78..523412369f70 100644
--- a/arch/arc/mm/init.c
+++ b/arch/arc/mm/init.c
@@ -10,6 +10,9 @@
10#include <linux/mm.h> 10#include <linux/mm.h>
11#include <linux/bootmem.h> 11#include <linux/bootmem.h>
12#include <linux/memblock.h> 12#include <linux/memblock.h>
13#ifdef CONFIG_BLK_DEV_INITRD
14#include <linux/initrd.h>
15#endif
13#include <linux/swap.h> 16#include <linux/swap.h>
14#include <linux/module.h> 17#include <linux/module.h>
15#include <asm/page.h> 18#include <asm/page.h>
@@ -42,6 +45,24 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)
42 pr_info("Memory size set via devicetree %ldM\n", TO_MB(arc_mem_sz)); 45 pr_info("Memory size set via devicetree %ldM\n", TO_MB(arc_mem_sz));
43} 46}
44 47
48#ifdef CONFIG_BLK_DEV_INITRD
49static int __init early_initrd(char *p)
50{
51 unsigned long start, size;
52 char *endp;
53
54 start = memparse(p, &endp);
55 if (*endp == ',') {
56 size = memparse(endp + 1, NULL);
57
58 initrd_start = (unsigned long)__va(start);
59 initrd_end = (unsigned long)__va(start + size);
60 }
61 return 0;
62}
63early_param("initrd", early_initrd);
64#endif
65
45/* 66/*
46 * First memory setup routine called from setup_arch() 67 * First memory setup routine called from setup_arch()
47 * 1. setup swapper's mm @init_mm 68 * 1. setup swapper's mm @init_mm
@@ -80,6 +101,12 @@ void __init setup_arch_memory(void)
80 memblock_reserve(CONFIG_LINUX_LINK_BASE, 101 memblock_reserve(CONFIG_LINUX_LINK_BASE,
81 __pa(_end) - CONFIG_LINUX_LINK_BASE); 102 __pa(_end) - CONFIG_LINUX_LINK_BASE);
82 103
104#ifdef CONFIG_BLK_DEV_INITRD
105 /*------------- reserve initrd image -----------------------*/
106 if (initrd_start)
107 memblock_reserve(__pa(initrd_start), initrd_end - initrd_start);
108#endif
109
83 memblock_dump_all(); 110 memblock_dump_all();
84 111
85 /*-------------- node setup --------------------------------*/ 112 /*-------------- node setup --------------------------------*/
diff --git a/arch/arc/mm/tlbex.S b/arch/arc/mm/tlbex.S
index 3fcfdb38d242..79bfc81358c9 100644
--- a/arch/arc/mm/tlbex.S
+++ b/arch/arc/mm/tlbex.S
@@ -260,7 +260,7 @@ ARCFP_CODE ;Fast Path Code, candidate for ICCM
260; I-TLB Miss Exception Handler 260; I-TLB Miss Exception Handler
261;----------------------------------------------------------------------------- 261;-----------------------------------------------------------------------------
262 262
263ARC_ENTRY EV_TLBMissI 263ENTRY(EV_TLBMissI)
264 264
265 TLBMISS_FREEUP_REGS 265 TLBMISS_FREEUP_REGS
266 266
@@ -293,13 +293,13 @@ ARC_ENTRY EV_TLBMissI
293 TLBMISS_RESTORE_REGS 293 TLBMISS_RESTORE_REGS
294 rtie 294 rtie
295 295
296ARC_EXIT EV_TLBMissI 296END(EV_TLBMissI)
297 297
298;----------------------------------------------------------------------------- 298;-----------------------------------------------------------------------------
299; D-TLB Miss Exception Handler 299; D-TLB Miss Exception Handler
300;----------------------------------------------------------------------------- 300;-----------------------------------------------------------------------------
301 301
302ARC_ENTRY EV_TLBMissD 302ENTRY(EV_TLBMissD)
303 303
304 TLBMISS_FREEUP_REGS 304 TLBMISS_FREEUP_REGS
305 305
@@ -381,6 +381,4 @@ do_slow_path_pf:
381 bl do_page_fault 381 bl do_page_fault
382 b ret_from_exception 382 b ret_from_exception
383 383
384ARC_EXIT EV_TLBMissD 384END(EV_TLBMissD)
385
386ARC_ENTRY EV_TLBMissB ; Bogus entry to measure sz of DTLBMiss hdlr
diff --git a/arch/arc/plat-arcfpga/Kconfig b/arch/arc/plat-arcfpga/Kconfig
index 295cefeb25d3..33058aa40e77 100644
--- a/arch/arc/plat-arcfpga/Kconfig
+++ b/arch/arc/plat-arcfpga/Kconfig
@@ -33,7 +33,6 @@ config ISS_SMP_EXTN
33 bool "ARC SMP Extensions (ISS Models only)" 33 bool "ARC SMP Extensions (ISS Models only)"
34 default n 34 default n
35 depends on SMP 35 depends on SMP
36 select ARC_HAS_COH_RTSC
37 help 36 help
38 SMP Extensions to ARC700, in a "simulation only" Model, supported in 37 SMP Extensions to ARC700, in a "simulation only" Model, supported in
39 ARC ISS (Instruction Set Simulator). 38 ARC ISS (Instruction Set Simulator).
diff --git a/arch/arc/plat-arcfpga/platform.c b/arch/arc/plat-arcfpga/platform.c
index d71f3c3bcf24..19b76b61f44b 100644
--- a/arch/arc/plat-arcfpga/platform.c
+++ b/arch/arc/plat-arcfpga/platform.c
@@ -201,7 +201,7 @@ static void __init plat_fpga_populate_dev(void)
201 * callback set, by matching the DT compatible name. 201 * callback set, by matching the DT compatible name.
202 */ 202 */
203 203
204static const char *aa4_compat[] __initdata = { 204static const char *aa4_compat[] __initconst = {
205 "snps,arc-angel4", 205 "snps,arc-angel4",
206 NULL, 206 NULL,
207}; 207};
@@ -216,7 +216,7 @@ MACHINE_START(ANGEL4, "angel4")
216#endif 216#endif
217MACHINE_END 217MACHINE_END
218 218
219static const char *ml509_compat[] __initdata = { 219static const char *ml509_compat[] __initconst = {
220 "snps,arc-ml509", 220 "snps,arc-ml509",
221 NULL, 221 NULL,
222}; 222};
@@ -231,7 +231,7 @@ MACHINE_START(ML509, "ml509")
231#endif 231#endif
232MACHINE_END 232MACHINE_END
233 233
234static const char *nsimosci_compat[] __initdata = { 234static const char *nsimosci_compat[] __initconst = {
235 "snps,nsimosci", 235 "snps,nsimosci",
236 NULL, 236 NULL,
237}; 237};
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 15949459611f..ab438cb5af55 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -24,6 +24,7 @@ config ARM
24 select GENERIC_STRNCPY_FROM_USER 24 select GENERIC_STRNCPY_FROM_USER
25 select GENERIC_STRNLEN_USER 25 select GENERIC_STRNLEN_USER
26 select HARDIRQS_SW_RESEND 26 select HARDIRQS_SW_RESEND
27 select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)
27 select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL 28 select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
28 select HAVE_ARCH_KGDB 29 select HAVE_ARCH_KGDB
29 select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT) 30 select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT)
@@ -113,9 +114,6 @@ config ARM_DMA_IOMMU_ALIGNMENT
113 114
114endif 115endif
115 116
116config HAVE_PWM
117 bool
118
119config MIGHT_HAVE_PCI 117config MIGHT_HAVE_PCI
120 bool 118 bool
121 119
@@ -129,7 +127,7 @@ config HAVE_TCM
129config HAVE_PROC_CPU 127config HAVE_PROC_CPU
130 bool 128 bool
131 129
132config NO_IOPORT 130config NO_IOPORT_MAP
133 bool 131 bool
134 132
135config EISA 133config EISA
@@ -207,6 +205,9 @@ config ZONE_DMA
207config NEED_DMA_MAP_STATE 205config NEED_DMA_MAP_STATE
208 def_bool y 206 def_bool y
209 207
208config ARCH_SUPPORTS_UPROBES
209 def_bool y
210
210config ARCH_HAS_DMA_SET_COHERENT_MASK 211config ARCH_HAS_DMA_SET_COHERENT_MASK
211 bool 212 bool
212 213
@@ -306,9 +307,12 @@ choice
306config ARCH_MULTIPLATFORM 307config ARCH_MULTIPLATFORM
307 bool "Allow multiple platforms to be selected" 308 bool "Allow multiple platforms to be selected"
308 depends on MMU 309 depends on MMU
310 select ARCH_WANT_OPTIONAL_GPIOLIB
311 select ARM_HAS_SG_CHAIN
309 select ARM_PATCH_PHYS_VIRT 312 select ARM_PATCH_PHYS_VIRT
310 select AUTO_ZRELADDR 313 select AUTO_ZRELADDR
311 select COMMON_CLK 314 select COMMON_CLK
315 select GENERIC_CLOCKEVENTS
312 select MULTI_IRQ_HANDLER 316 select MULTI_IRQ_HANDLER
313 select SPARSE_IRQ 317 select SPARSE_IRQ
314 select USE_OF 318 select USE_OF
@@ -388,8 +392,6 @@ config ARCH_CLPS711X
388 select CPU_ARM720T 392 select CPU_ARM720T
389 select GENERIC_CLOCKEVENTS 393 select GENERIC_CLOCKEVENTS
390 select MFD_SYSCON 394 select MFD_SYSCON
391 select MULTI_IRQ_HANDLER
392 select SPARSE_IRQ
393 help 395 help
394 Support for Cirrus Logic 711x/721x/731x based boards. 396 Support for Cirrus Logic 711x/721x/731x based boards.
395 397
@@ -409,7 +411,7 @@ config ARCH_EBSA110
409 select ISA 411 select ISA
410 select NEED_MACH_IO_H 412 select NEED_MACH_IO_H
411 select NEED_MACH_MEMORY_H 413 select NEED_MACH_MEMORY_H
412 select NO_IOPORT 414 select NO_IOPORT_MAP
413 help 415 help
414 This is an evaluation board for the StrongARM processor available 416 This is an evaluation board for the StrongARM processor available
415 from Digital. It has limited hardware on-board, including an 417 from Digital. It has limited hardware on-board, including an
@@ -420,16 +422,14 @@ config ARCH_EFM32
420 bool "Energy Micro efm32" 422 bool "Energy Micro efm32"
421 depends on !MMU 423 depends on !MMU
422 select ARCH_REQUIRE_GPIOLIB 424 select ARCH_REQUIRE_GPIOLIB
425 select AUTO_ZRELADDR
423 select ARM_NVIC 426 select ARM_NVIC
424 # CLKSRC_MMIO is wrong here, but needed until a proper fix is merged,
425 # i.e. CLKSRC_EFM32 selecting CLKSRC_MMIO
426 select CLKSRC_MMIO
427 select CLKSRC_OF 427 select CLKSRC_OF
428 select COMMON_CLK 428 select COMMON_CLK
429 select CPU_V7M 429 select CPU_V7M
430 select GENERIC_CLOCKEVENTS 430 select GENERIC_CLOCKEVENTS
431 select NO_DMA 431 select NO_DMA
432 select NO_IOPORT 432 select NO_IOPORT_MAP
433 select SPARSE_IRQ 433 select SPARSE_IRQ
434 select USE_OF 434 select USE_OF
435 help 435 help
@@ -534,7 +534,6 @@ config ARCH_DOVE
534 select PINCTRL 534 select PINCTRL
535 select PINCTRL_DOVE 535 select PINCTRL_DOVE
536 select PLAT_ORION_LEGACY 536 select PLAT_ORION_LEGACY
537 select USB_ARCH_HAS_EHCI
538 help 537 help
539 Support for the Marvell Dove SoC 88AP510 538 Support for the Marvell Dove SoC 88AP510
540 539
@@ -632,8 +631,6 @@ config ARCH_LPC32XX
632 select CPU_ARM926T 631 select CPU_ARM926T
633 select GENERIC_CLOCKEVENTS 632 select GENERIC_CLOCKEVENTS
634 select HAVE_IDE 633 select HAVE_IDE
635 select HAVE_PWM
636 select USB_ARCH_HAS_OHCI
637 select USE_OF 634 select USE_OF
638 help 635 help
639 Support for the NXP LPC32XX family of processors 636 Support for the NXP LPC32XX family of processors
@@ -657,9 +654,8 @@ config ARCH_PXA
657 help 654 help
658 Support for Intel/Marvell's PXA2xx/PXA3xx processor line. 655 Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
659 656
660config ARCH_MSM_NODT 657config ARCH_MSM
661 bool "Qualcomm MSM" 658 bool "Qualcomm MSM (non-multiplatform)"
662 select ARCH_MSM
663 select ARCH_REQUIRE_GPIOLIB 659 select ARCH_REQUIRE_GPIOLIB
664 select COMMON_CLK 660 select COMMON_CLK
665 select GENERIC_CLOCKEVENTS 661 select GENERIC_CLOCKEVENTS
@@ -682,7 +678,7 @@ config ARCH_SHMOBILE_LEGACY
682 select HAVE_SMP 678 select HAVE_SMP
683 select MIGHT_HAVE_CACHE_L2X0 679 select MIGHT_HAVE_CACHE_L2X0
684 select MULTI_IRQ_HANDLER 680 select MULTI_IRQ_HANDLER
685 select NO_IOPORT 681 select NO_IOPORT_MAP
686 select PINCTRL 682 select PINCTRL
687 select PM_GENERIC_DOMAINS if PM 683 select PM_GENERIC_DOMAINS if PM
688 select SPARSE_IRQ 684 select SPARSE_IRQ
@@ -697,13 +693,14 @@ config ARCH_RPC
697 select ARCH_MAY_HAVE_PC_FDC 693 select ARCH_MAY_HAVE_PC_FDC
698 select ARCH_SPARSEMEM_ENABLE 694 select ARCH_SPARSEMEM_ENABLE
699 select ARCH_USES_GETTIMEOFFSET 695 select ARCH_USES_GETTIMEOFFSET
696 select CPU_SA110
700 select FIQ 697 select FIQ
701 select HAVE_IDE 698 select HAVE_IDE
702 select HAVE_PATA_PLATFORM 699 select HAVE_PATA_PLATFORM
703 select ISA_DMA_API 700 select ISA_DMA_API
704 select NEED_MACH_IO_H 701 select NEED_MACH_IO_H
705 select NEED_MACH_MEMORY_H 702 select NEED_MACH_MEMORY_H
706 select NO_IOPORT 703 select NO_IOPORT_MAP
707 select VIRT_TO_BUS 704 select VIRT_TO_BUS
708 help 705 help
709 On the Acorn Risc-PC, Linux can support the internal IDE disk and 706 On the Acorn Risc-PC, Linux can support the internal IDE disk and
@@ -731,6 +728,7 @@ config ARCH_S3C24XX
731 bool "Samsung S3C24XX SoCs" 728 bool "Samsung S3C24XX SoCs"
732 select ARCH_HAS_CPUFREQ 729 select ARCH_HAS_CPUFREQ
733 select ARCH_REQUIRE_GPIOLIB 730 select ARCH_REQUIRE_GPIOLIB
731 select ATAGS
734 select CLKDEV_LOOKUP 732 select CLKDEV_LOOKUP
735 select CLKSRC_SAMSUNG_PWM 733 select CLKSRC_SAMSUNG_PWM
736 select GENERIC_CLOCKEVENTS 734 select GENERIC_CLOCKEVENTS
@@ -753,6 +751,7 @@ config ARCH_S3C64XX
753 select ARCH_REQUIRE_GPIOLIB 751 select ARCH_REQUIRE_GPIOLIB
754 select ARM_AMBA 752 select ARM_AMBA
755 select ARM_VIC 753 select ARM_VIC
754 select ATAGS
756 select CLKDEV_LOOKUP 755 select CLKDEV_LOOKUP
757 select CLKSRC_SAMSUNG_PWM 756 select CLKSRC_SAMSUNG_PWM
758 select COMMON_CLK 757 select COMMON_CLK
@@ -762,20 +761,20 @@ config ARCH_S3C64XX
762 select HAVE_S3C2410_I2C if I2C 761 select HAVE_S3C2410_I2C if I2C
763 select HAVE_S3C2410_WATCHDOG if WATCHDOG 762 select HAVE_S3C2410_WATCHDOG if WATCHDOG
764 select HAVE_TCM 763 select HAVE_TCM
765 select NO_IOPORT 764 select NO_IOPORT_MAP
766 select PLAT_SAMSUNG 765 select PLAT_SAMSUNG
767 select PM_GENERIC_DOMAINS 766 select PM_GENERIC_DOMAINS if PM
768 select S3C_DEV_NAND 767 select S3C_DEV_NAND
769 select S3C_GPIO_TRACK 768 select S3C_GPIO_TRACK
770 select SAMSUNG_ATAGS 769 select SAMSUNG_ATAGS
771 select SAMSUNG_WAKEMASK 770 select SAMSUNG_WAKEMASK
772 select SAMSUNG_WDT_RESET 771 select SAMSUNG_WDT_RESET
773 select USB_ARCH_HAS_OHCI
774 help 772 help
775 Samsung S3C64XX series based systems 773 Samsung S3C64XX series based systems
776 774
777config ARCH_S5P64X0 775config ARCH_S5P64X0
778 bool "Samsung S5P6440 S5P6450" 776 bool "Samsung S5P6440 S5P6450"
777 select ATAGS
779 select CLKDEV_LOOKUP 778 select CLKDEV_LOOKUP
780 select CLKSRC_SAMSUNG_PWM 779 select CLKSRC_SAMSUNG_PWM
781 select CPU_V6 780 select CPU_V6
@@ -794,6 +793,7 @@ config ARCH_S5P64X0
794config ARCH_S5PC100 793config ARCH_S5PC100
795 bool "Samsung S5PC100" 794 bool "Samsung S5PC100"
796 select ARCH_REQUIRE_GPIOLIB 795 select ARCH_REQUIRE_GPIOLIB
796 select ATAGS
797 select CLKDEV_LOOKUP 797 select CLKDEV_LOOKUP
798 select CLKSRC_SAMSUNG_PWM 798 select CLKSRC_SAMSUNG_PWM
799 select CPU_V7 799 select CPU_V7
@@ -813,6 +813,7 @@ config ARCH_S5PV210
813 select ARCH_HAS_CPUFREQ 813 select ARCH_HAS_CPUFREQ
814 select ARCH_HAS_HOLES_MEMORYMODEL 814 select ARCH_HAS_HOLES_MEMORYMODEL
815 select ARCH_SPARSEMEM_ENABLE 815 select ARCH_SPARSEMEM_ENABLE
816 select ATAGS
816 select CLKDEV_LOOKUP 817 select CLKDEV_LOOKUP
817 select CLKSRC_SAMSUNG_PWM 818 select CLKSRC_SAMSUNG_PWM
818 select CPU_V7 819 select CPU_V7
@@ -886,6 +887,12 @@ menu "Multiple platform selection"
886 887
887comment "CPU Core family selection" 888comment "CPU Core family selection"
888 889
890config ARCH_MULTI_V4
891 bool "ARMv4 based platforms (FA526)"
892 depends on !ARCH_MULTI_V6_V7
893 select ARCH_MULTI_V4_V5
894 select CPU_FA526
895
889config ARCH_MULTI_V4T 896config ARCH_MULTI_V4T
890 bool "ARMv4T based platforms (ARM720T, ARM920T, ...)" 897 bool "ARMv4T based platforms (ARM720T, ARM920T, ...)"
891 depends on !ARCH_MULTI_V6_V7 898 depends on !ARCH_MULTI_V6_V7
@@ -898,7 +905,7 @@ config ARCH_MULTI_V5
898 bool "ARMv5 based platforms (ARM926T, XSCALE, PJ1, ...)" 905 bool "ARMv5 based platforms (ARM926T, XSCALE, PJ1, ...)"
899 depends on !ARCH_MULTI_V6_V7 906 depends on !ARCH_MULTI_V6_V7
900 select ARCH_MULTI_V4_V5 907 select ARCH_MULTI_V4_V5
901 select CPU_ARM926T if (!CPU_ARM946E || CPU_ARM1020 || \ 908 select CPU_ARM926T if !(CPU_ARM946E || CPU_ARM1020 || \
902 CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || \ 909 CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || \
903 CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_FEROCEON) 910 CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_FEROCEON)
904 911
@@ -908,16 +915,18 @@ config ARCH_MULTI_V4_V5
908config ARCH_MULTI_V6 915config ARCH_MULTI_V6
909 bool "ARMv6 based platforms (ARM11)" 916 bool "ARMv6 based platforms (ARM11)"
910 select ARCH_MULTI_V6_V7 917 select ARCH_MULTI_V6_V7
911 select CPU_V6 918 select CPU_V6K
912 919
913config ARCH_MULTI_V7 920config ARCH_MULTI_V7
914 bool "ARMv7 based platforms (Cortex-A, PJ4, Scorpion, Krait)" 921 bool "ARMv7 based platforms (Cortex-A, PJ4, Scorpion, Krait)"
915 default y 922 default y
916 select ARCH_MULTI_V6_V7 923 select ARCH_MULTI_V6_V7
917 select CPU_V7 924 select CPU_V7
925 select HAVE_SMP
918 926
919config ARCH_MULTI_V6_V7 927config ARCH_MULTI_V6_V7
920 bool 928 bool
929 select MIGHT_HAVE_CACHE_L2X0
921 930
922config ARCH_MULTI_CPU_AUTO 931config ARCH_MULTI_CPU_AUTO
923 def_bool !(ARCH_MULTI_V4 || ARCH_MULTI_V4T || ARCH_MULTI_V6_V7) 932 def_bool !(ARCH_MULTI_V4 || ARCH_MULTI_V4T || ARCH_MULTI_V6_V7)
@@ -925,6 +934,13 @@ config ARCH_MULTI_CPU_AUTO
925 934
926endmenu 935endmenu
927 936
937config ARCH_VIRT
938 bool "Dummy Virtual Machine" if ARCH_MULTI_V7
939 select ARM_AMBA
940 select ARM_GIC
941 select ARM_PSCI
942 select HAVE_ARM_ARCH_TIMER
943
928# 944#
929# This is sorted alphabetically by mach-* pathname. However, plat-* 945# This is sorted alphabetically by mach-* pathname. However, plat-*
930# Kconfigs may be included either alphabetically (according to the 946# Kconfigs may be included either alphabetically (according to the
@@ -936,8 +952,6 @@ source "arch/arm/mach-at91/Kconfig"
936 952
937source "arch/arm/mach-bcm/Kconfig" 953source "arch/arm/mach-bcm/Kconfig"
938 954
939source "arch/arm/mach-bcm2835/Kconfig"
940
941source "arch/arm/mach-berlin/Kconfig" 955source "arch/arm/mach-berlin/Kconfig"
942 956
943source "arch/arm/mach-clps711x/Kconfig" 957source "arch/arm/mach-clps711x/Kconfig"
@@ -1005,6 +1019,8 @@ source "arch/arm/plat-pxa/Kconfig"
1005 1019
1006source "arch/arm/mach-mmp/Kconfig" 1020source "arch/arm/mach-mmp/Kconfig"
1007 1021
1022source "arch/arm/mach-qcom/Kconfig"
1023
1008source "arch/arm/mach-realview/Kconfig" 1024source "arch/arm/mach-realview/Kconfig"
1009 1025
1010source "arch/arm/mach-rockchip/Kconfig" 1026source "arch/arm/mach-rockchip/Kconfig"
@@ -1048,8 +1064,6 @@ source "arch/arm/mach-versatile/Kconfig"
1048source "arch/arm/mach-vexpress/Kconfig" 1064source "arch/arm/mach-vexpress/Kconfig"
1049source "arch/arm/plat-versatile/Kconfig" 1065source "arch/arm/plat-versatile/Kconfig"
1050 1066
1051source "arch/arm/mach-virt/Kconfig"
1052
1053source "arch/arm/mach-vt8500/Kconfig" 1067source "arch/arm/mach-vt8500/Kconfig"
1054 1068
1055source "arch/arm/mach-w90x900/Kconfig" 1069source "arch/arm/mach-w90x900/Kconfig"
@@ -1921,6 +1935,7 @@ config USE_OF
1921 select IRQ_DOMAIN 1935 select IRQ_DOMAIN
1922 select OF 1936 select OF
1923 select OF_EARLY_FLATTREE 1937 select OF_EARLY_FLATTREE
1938 select OF_RESERVED_MEM
1924 help 1939 help
1925 Include support for flattened device tree machine descriptions. 1940 Include support for flattened device tree machine descriptions.
1926 1941
@@ -2273,7 +2288,7 @@ source "kernel/power/Kconfig"
2273config ARCH_SUSPEND_POSSIBLE 2288config ARCH_SUSPEND_POSSIBLE
2274 depends on !ARCH_S5PC100 2289 depends on !ARCH_S5PC100
2275 depends on CPU_ARM920T || CPU_ARM926T || CPU_FEROCEON || CPU_SA1100 || \ 2290 depends on CPU_ARM920T || CPU_ARM926T || CPU_FEROCEON || CPU_SA1100 || \
2276 CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE || CPU_MOHAWK 2291 CPU_V6 || CPU_V6K || CPU_V7 || CPU_V7M || CPU_XSC3 || CPU_XSCALE || CPU_MOHAWK
2277 def_bool y 2292 def_bool y
2278 2293
2279config ARM_CPU_SUSPEND 2294config ARM_CPU_SUSPEND
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 0531da8e5216..4a2fc0bf6fc9 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -106,9 +106,14 @@ choice
106 depends on ARCH_BCM2835 106 depends on ARCH_BCM2835
107 select DEBUG_UART_PL01X 107 select DEBUG_UART_PL01X
108 108
109 config DEBUG_BCM_5301X
110 bool "Kernel low-level debugging on BCM5301X UART1"
111 depends on ARCH_BCM_5301X
112 select DEBUG_UART_PL01X
113
109 config DEBUG_BCM_KONA_UART 114 config DEBUG_BCM_KONA_UART
110 bool "Kernel low-level debugging messages via BCM KONA UART" 115 bool "Kernel low-level debugging messages via BCM KONA UART"
111 depends on ARCH_BCM 116 depends on ARCH_BCM_MOBILE
112 select DEBUG_UART_8250 117 select DEBUG_UART_8250
113 help 118 help
114 Say Y here if you want kernel low-level debugging support 119 Say Y here if you want kernel low-level debugging support
@@ -171,15 +176,6 @@ choice
171 Say Y here if you want the debug print routines to direct 176 Say Y here if you want the debug print routines to direct
172 their output to UART0 serial port on DaVinci DMx devices. 177 their output to UART0 serial port on DaVinci DMx devices.
173 178
174 config DEBUG_DAVINCI_TNETV107X_UART1
175 bool "Kernel low-level debugging on DaVinci TNETV107x using UART1"
176 depends on ARCH_DAVINCI_TNETV107X
177 select DEBUG_UART_8250
178 help
179 Say Y here if you want the debug print routines to direct
180 their output to UART1 serial port on DaVinci TNETV107X
181 devices.
182
183 config DEBUG_ZYNQ_UART0 179 config DEBUG_ZYNQ_UART0
184 bool "Kernel low-level debugging on Xilinx Zynq using UART0" 180 bool "Kernel low-level debugging on Xilinx Zynq using UART0"
185 depends on ARCH_ZYNQ 181 depends on ARCH_ZYNQ
@@ -956,7 +952,7 @@ config DEBUG_STI_UART
956 952
957config DEBUG_MSM_UART 953config DEBUG_MSM_UART
958 bool 954 bool
959 depends on ARCH_MSM 955 depends on ARCH_MSM || ARCH_QCOM
960 956
961config DEBUG_LL_INCLUDE 957config DEBUG_LL_INCLUDE
962 string 958 string
@@ -1014,7 +1010,6 @@ config DEBUG_UART_PHYS
1014 default 0x02530c00 if DEBUG_KEYSTONE_UART0 1010 default 0x02530c00 if DEBUG_KEYSTONE_UART0
1015 default 0x02531000 if DEBUG_KEYSTONE_UART1 1011 default 0x02531000 if DEBUG_KEYSTONE_UART1
1016 default 0x03010fe0 if ARCH_RPC 1012 default 0x03010fe0 if ARCH_RPC
1017 default 0x08108300 if DEBUG_DAVINCI_TNETV107X_UART1
1018 default 0x10009000 if DEBUG_REALVIEW_STD_PORT || DEBUG_CNS3XXX || \ 1013 default 0x10009000 if DEBUG_REALVIEW_STD_PORT || DEBUG_CNS3XXX || \
1019 DEBUG_VEXPRESS_UART0_CA9 1014 DEBUG_VEXPRESS_UART0_CA9
1020 default 0x1010c000 if DEBUG_REALVIEW_PB1176_PORT 1015 default 0x1010c000 if DEBUG_REALVIEW_PB1176_PORT
@@ -1023,6 +1018,7 @@ config DEBUG_UART_PHYS
1023 default 0x101f1000 if ARCH_VERSATILE 1018 default 0x101f1000 if ARCH_VERSATILE
1024 default 0x101fb000 if DEBUG_NOMADIK_UART 1019 default 0x101fb000 if DEBUG_NOMADIK_UART
1025 default 0x16000000 if ARCH_INTEGRATOR 1020 default 0x16000000 if ARCH_INTEGRATOR
1021 default 0x18000300 if DEBUG_BCM_5301X
1026 default 0x1c090000 if DEBUG_VEXPRESS_UART0_RS1 1022 default 0x1c090000 if DEBUG_VEXPRESS_UART0_RS1
1027 default 0x20060000 if DEBUG_RK29_UART0 1023 default 0x20060000 if DEBUG_RK29_UART0
1028 default 0x20064000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2 1024 default 0x20064000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2
@@ -1071,6 +1067,7 @@ config DEBUG_UART_VIRT
1071 default 0xf0009000 if DEBUG_CNS3XXX 1067 default 0xf0009000 if DEBUG_CNS3XXX
1072 default 0xf01fb000 if DEBUG_NOMADIK_UART 1068 default 0xf01fb000 if DEBUG_NOMADIK_UART
1073 default 0xf0201000 if DEBUG_BCM2835 1069 default 0xf0201000 if DEBUG_BCM2835
1070 default 0xf1000300 if DEBUG_BCM_5301X
1074 default 0xf11f1000 if ARCH_VERSATILE 1071 default 0xf11f1000 if ARCH_VERSATILE
1075 default 0xf1600000 if ARCH_INTEGRATOR 1072 default 0xf1600000 if ARCH_INTEGRATOR
1076 default 0xf1c28000 if DEBUG_SUNXI_UART0 1073 default 0xf1c28000 if DEBUG_SUNXI_UART0
@@ -1110,7 +1107,6 @@ config DEBUG_UART_VIRT
1110 default 0xfed12000 if ARCH_KIRKWOOD 1107 default 0xfed12000 if ARCH_KIRKWOOD
1111 default 0xfedc0000 if ARCH_EP93XX 1108 default 0xfedc0000 if ARCH_EP93XX
1112 default 0xfee003f8 if FOOTBRIDGE 1109 default 0xfee003f8 if FOOTBRIDGE
1113 default 0xfee08300 if DEBUG_DAVINCI_TNETV107X_UART1
1114 default 0xfee20000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART 1110 default 0xfee20000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART
1115 default 0xfef36000 if DEBUG_HIGHBANK_UART 1111 default 0xfef36000 if DEBUG_HIGHBANK_UART
1116 default 0xfee82340 if ARCH_IOP13XX 1112 default 0xfee82340 if ARCH_IOP13XX
@@ -1135,7 +1131,7 @@ config DEBUG_UART_8250_WORD
1135 default y if DEBUG_PICOXCELL_UART || DEBUG_SOCFPGA_UART || \ 1131 default y if DEBUG_PICOXCELL_UART || DEBUG_SOCFPGA_UART || \
1136 ARCH_KEYSTONE || \ 1132 ARCH_KEYSTONE || \
1137 DEBUG_DAVINCI_DMx_UART0 || DEBUG_DAVINCI_DA8XX_UART1 || \ 1133 DEBUG_DAVINCI_DMx_UART0 || DEBUG_DAVINCI_DA8XX_UART1 || \
1138 DEBUG_DAVINCI_DA8XX_UART2 || DEBUG_DAVINCI_TNETV107X_UART1 || \ 1134 DEBUG_DAVINCI_DA8XX_UART2 || \
1139 DEBUG_BCM_KONA_UART 1135 DEBUG_BCM_KONA_UART
1140 1136
1141config DEBUG_UART_8250_FLOW_CONTROL 1137config DEBUG_UART_8250_FLOW_CONTROL
@@ -1145,7 +1141,7 @@ config DEBUG_UART_8250_FLOW_CONTROL
1145 1141
1146config DEBUG_UNCOMPRESS 1142config DEBUG_UNCOMPRESS
1147 bool 1143 bool
1148 depends on ARCH_MULTIPLATFORM || ARCH_MSM 1144 depends on ARCH_MULTIPLATFORM || ARCH_MSM || PLAT_SAMSUNG
1149 default y if DEBUG_LL && !DEBUG_OMAP2PLUS_UART && \ 1145 default y if DEBUG_LL && !DEBUG_OMAP2PLUS_UART && \
1150 (!DEBUG_TEGRA_UART || !ZBOOT_ROM) 1146 (!DEBUG_TEGRA_UART || !ZBOOT_ROM)
1151 help 1147 help
@@ -1161,7 +1157,8 @@ config DEBUG_UNCOMPRESS
1161 1157
1162config UNCOMPRESS_INCLUDE 1158config UNCOMPRESS_INCLUDE
1163 string 1159 string
1164 default "debug/uncompress.h" if ARCH_MULTIPLATFORM || ARCH_MSM 1160 default "debug/uncompress.h" if ARCH_MULTIPLATFORM || ARCH_MSM || \
1161 PLAT_SAMSUNG || ARCH_EFM32
1165 default "mach/uncompress.h" 1162 default "mach/uncompress.h"
1166 1163
1167config EARLY_PRINTK 1164config EARLY_PRINTK
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 08a9ef58d9c3..41c1931f0155 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -143,7 +143,6 @@ textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000
143# by CONFIG_* macro name. 143# by CONFIG_* macro name.
144machine-$(CONFIG_ARCH_AT91) += at91 144machine-$(CONFIG_ARCH_AT91) += at91
145machine-$(CONFIG_ARCH_BCM) += bcm 145machine-$(CONFIG_ARCH_BCM) += bcm
146machine-$(CONFIG_ARCH_BCM2835) += bcm2835
147machine-$(CONFIG_ARCH_BERLIN) += berlin 146machine-$(CONFIG_ARCH_BERLIN) += berlin
148machine-$(CONFIG_ARCH_CLPS711X) += clps711x 147machine-$(CONFIG_ARCH_CLPS711X) += clps711x
149machine-$(CONFIG_ARCH_CNS3XXX) += cns3xxx 148machine-$(CONFIG_ARCH_CNS3XXX) += cns3xxx
@@ -180,6 +179,7 @@ machine-$(CONFIG_ARCH_OMAP2PLUS) += omap2
180machine-$(CONFIG_ARCH_ORION5X) += orion5x 179machine-$(CONFIG_ARCH_ORION5X) += orion5x
181machine-$(CONFIG_ARCH_PICOXCELL) += picoxcell 180machine-$(CONFIG_ARCH_PICOXCELL) += picoxcell
182machine-$(CONFIG_ARCH_PXA) += pxa 181machine-$(CONFIG_ARCH_PXA) += pxa
182machine-$(CONFIG_ARCH_QCOM) += qcom
183machine-$(CONFIG_ARCH_REALVIEW) += realview 183machine-$(CONFIG_ARCH_REALVIEW) += realview
184machine-$(CONFIG_ARCH_ROCKCHIP) += rockchip 184machine-$(CONFIG_ARCH_ROCKCHIP) += rockchip
185machine-$(CONFIG_ARCH_RPC) += rpc 185machine-$(CONFIG_ARCH_RPC) += rpc
@@ -199,7 +199,6 @@ machine-$(CONFIG_ARCH_U300) += u300
199machine-$(CONFIG_ARCH_U8500) += ux500 199machine-$(CONFIG_ARCH_U8500) += ux500
200machine-$(CONFIG_ARCH_VERSATILE) += versatile 200machine-$(CONFIG_ARCH_VERSATILE) += versatile
201machine-$(CONFIG_ARCH_VEXPRESS) += vexpress 201machine-$(CONFIG_ARCH_VEXPRESS) += vexpress
202machine-$(CONFIG_ARCH_VIRT) += virt
203machine-$(CONFIG_ARCH_VT8500) += vt8500 202machine-$(CONFIG_ARCH_VT8500) += vt8500
204machine-$(CONFIG_ARCH_W90X900) += w90x900 203machine-$(CONFIG_ARCH_W90X900) += w90x900
205machine-$(CONFIG_ARCH_ZYNQ) += zynq 204machine-$(CONFIG_ARCH_ZYNQ) += zynq
@@ -310,9 +309,9 @@ $(INSTALL_TARGETS):
310%.dtb: | scripts 309%.dtb: | scripts
311 $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@ 310 $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
312 311
313PHONY += dtbs 312PHONY += dtbs dtbs_install
314dtbs: scripts 313dtbs dtbs_install: prepare scripts
315 $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) dtbs 314 $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $@
316 315
317# We use MRPROPER_FILES and CLEAN_FILES now 316# We use MRPROPER_FILES and CLEAN_FILES now
318archclean: 317archclean:
@@ -331,6 +330,7 @@ define archhelp
331 echo ' bootpImage - Combined zImage and initial RAM disk' 330 echo ' bootpImage - Combined zImage and initial RAM disk'
332 echo ' (supply initrd image via make variable INITRD=<path>)' 331 echo ' (supply initrd image via make variable INITRD=<path>)'
333 echo '* dtbs - Build device tree blobs for enabled boards' 332 echo '* dtbs - Build device tree blobs for enabled boards'
333 echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'
334 echo ' install - Install uncompressed kernel' 334 echo ' install - Install uncompressed kernel'
335 echo ' zinstall - Install compressed kernel' 335 echo ' zinstall - Install compressed kernel'
336 echo ' uinstall - Install U-Boot wrapped compressed kernel' 336 echo ' uinstall - Install U-Boot wrapped compressed kernel'
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 032030361bef..35c146f31e46 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -12,6 +12,8 @@ dtb-$(CONFIG_ARCH_AT91) += ethernut5.dtb
12dtb-$(CONFIG_ARCH_AT91) += evk-pro3.dtb 12dtb-$(CONFIG_ARCH_AT91) += evk-pro3.dtb
13dtb-$(CONFIG_ARCH_AT91) += tny_a9260.dtb 13dtb-$(CONFIG_ARCH_AT91) += tny_a9260.dtb
14dtb-$(CONFIG_ARCH_AT91) += usb_a9260.dtb 14dtb-$(CONFIG_ARCH_AT91) += usb_a9260.dtb
15# sam9261
16dtb-$(CONFIG_ARCH_AT91) += at91sam9261ek.dtb
15# sam9263 17# sam9263
16dtb-$(CONFIG_ARCH_AT91) += at91sam9263ek.dtb 18dtb-$(CONFIG_ARCH_AT91) += at91sam9263ek.dtb
17dtb-$(CONFIG_ARCH_AT91) += tny_a9263.dtb 19dtb-$(CONFIG_ARCH_AT91) += tny_a9263.dtb
@@ -29,6 +31,8 @@ dtb-$(CONFIG_ARCH_AT91) += at91sam9m10g45ek.dtb
29dtb-$(CONFIG_ARCH_AT91) += pm9g45.dtb 31dtb-$(CONFIG_ARCH_AT91) += pm9g45.dtb
30# sam9n12 32# sam9n12
31dtb-$(CONFIG_ARCH_AT91) += at91sam9n12ek.dtb 33dtb-$(CONFIG_ARCH_AT91) += at91sam9n12ek.dtb
34# sam9rl
35dtb-$(CONFIG_ARCH_AT91) += at91sam9rlek.dtb
32# sam9x5 36# sam9x5
33dtb-$(CONFIG_ARCH_AT91) += at91-ariag25.dtb 37dtb-$(CONFIG_ARCH_AT91) += at91-ariag25.dtb
34dtb-$(CONFIG_ARCH_AT91) += at91-cosino_mega2560.dtb 38dtb-$(CONFIG_ARCH_AT91) += at91-cosino_mega2560.dtb
@@ -47,19 +51,15 @@ dtb-$(CONFIG_ARCH_AT91) += sama5d36ek.dtb
47 51
48dtb-$(CONFIG_ARCH_ATLAS6) += atlas6-evb.dtb 52dtb-$(CONFIG_ARCH_ATLAS6) += atlas6-evb.dtb
49dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb 53dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb
50dtb-$(CONFIG_ARCH_BCM_MOBILE) += bcm11351-brt.dtb \ 54dtb-$(CONFIG_ARCH_BCM_MOBILE) += bcm28155-ap.dtb \
51 bcm28155-ap.dtb 55 bcm21664-garnet.dtb
52dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb 56dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb
57dtb-$(CONFIG_ARCH_BCM_5301X) += bcm4708-netgear-r6250.dtb
53dtb-$(CONFIG_ARCH_BERLIN) += \ 58dtb-$(CONFIG_ARCH_BERLIN) += \
54 berlin2-sony-nsz-gs7.dtb \ 59 berlin2-sony-nsz-gs7.dtb \
55 berlin2cd-google-chromecast.dtb 60 berlin2cd-google-chromecast.dtb
56dtb-$(CONFIG_ARCH_DAVINCI) += da850-enbw-cmc.dtb \ 61dtb-$(CONFIG_ARCH_DAVINCI) += da850-enbw-cmc.dtb \
57 da850-evm.dtb 62 da850-evm.dtb
58dtb-$(CONFIG_ARCH_DOVE) += dove-cm-a510.dtb \
59 dove-cubox.dtb \
60 dove-d2plug.dtb \
61 dove-d3plug.dtb \
62 dove-dove-db.dtb
63dtb-$(CONFIG_ARCH_EFM32) += efm32gg-dk3750.dtb 63dtb-$(CONFIG_ARCH_EFM32) += efm32gg-dk3750.dtb
64dtb-$(CONFIG_ARCH_EXYNOS) += exynos4210-origen.dtb \ 64dtb-$(CONFIG_ARCH_EXYNOS) += exynos4210-origen.dtb \
65 exynos4210-smdkv310.dtb \ 65 exynos4210-smdkv310.dtb \
@@ -82,14 +82,30 @@ dtb-$(CONFIG_ARCH_HIGHBANK) += highbank.dtb \
82 ecx-2000.dtb 82 ecx-2000.dtb
83dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \ 83dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \
84 integratorcp.dtb 84 integratorcp.dtb
85dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb 85dtb-$(CONFIG_ARCH_KEYSTONE) += k2hk-evm.dtb \
86dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \ 86 k2l-evm.dtb \
87 k2e-evm.dtb
88kirkwood := \
89 kirkwood-b3.dtb \
90 kirkwood-cloudbox.dtb \
87 kirkwood-db-88f6281.dtb \ 91 kirkwood-db-88f6281.dtb \
88 kirkwood-db-88f6282.dtb \ 92 kirkwood-db-88f6282.dtb \
89 kirkwood-dns320.dtb \ 93 kirkwood-dns320.dtb \
90 kirkwood-dns325.dtb \ 94 kirkwood-dns325.dtb \
91 kirkwood-dockstar.dtb \ 95 kirkwood-dockstar.dtb \
92 kirkwood-dreamplug.dtb \ 96 kirkwood-dreamplug.dtb \
97 kirkwood-ds109.dtb \
98 kirkwood-ds110jv10.dtb \
99 kirkwood-ds111.dtb \
100 kirkwood-ds209.dtb \
101 kirkwood-ds210.dtb \
102 kirkwood-ds212.dtb \
103 kirkwood-ds212j.dtb \
104 kirkwood-ds409.dtb \
105 kirkwood-ds409slim.dtb \
106 kirkwood-ds411.dtb \
107 kirkwood-ds411j.dtb \
108 kirkwood-ds411slim.dtb \
93 kirkwood-goflexnet.dtb \ 109 kirkwood-goflexnet.dtb \
94 kirkwood-guruplug-server-plus.dtb \ 110 kirkwood-guruplug-server-plus.dtb \
95 kirkwood-ib62x0.dtb \ 111 kirkwood-ib62x0.dtb \
@@ -112,54 +128,74 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \
112 kirkwood-nsa310a.dtb \ 128 kirkwood-nsa310a.dtb \
113 kirkwood-openblocks_a6.dtb \ 129 kirkwood-openblocks_a6.dtb \
114 kirkwood-openblocks_a7.dtb \ 130 kirkwood-openblocks_a7.dtb \
131 kirkwood-rd88f6192.dtb \
132 kirkwood-rd88f6281-a0.dtb \
133 kirkwood-rd88f6281-a1.dtb \
134 kirkwood-rs212.dtb \
135 kirkwood-rs409.dtb \
136 kirkwood-rs411.dtb \
115 kirkwood-sheevaplug.dtb \ 137 kirkwood-sheevaplug.dtb \
116 kirkwood-sheevaplug-esata.dtb \ 138 kirkwood-sheevaplug-esata.dtb \
139 kirkwood-t5325.dtb \
117 kirkwood-topkick.dtb \ 140 kirkwood-topkick.dtb \
118 kirkwood-ts219-6281.dtb \ 141 kirkwood-ts219-6281.dtb \
119 kirkwood-ts219-6282.dtb 142 kirkwood-ts219-6282.dtb \
143 kirkwood-ts419-6281.dtb \
144 kirkwood-ts419-6282.dtb
145dtb-$(CONFIG_ARCH_KIRKWOOD) += $(kirkwood)
146dtb-$(CONFIG_MACH_KIRKWOOD) += $(kirkwood)
147dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb
120dtb-$(CONFIG_ARCH_MARCO) += marco-evb.dtb 148dtb-$(CONFIG_ARCH_MARCO) += marco-evb.dtb
121dtb-$(CONFIG_ARCH_MOXART) += moxart-uc7112lx.dtb 149dtb-$(CONFIG_ARCH_MOXART) += moxart-uc7112lx.dtb
122dtb-$(CONFIG_ARCH_MSM) += qcom-msm8660-surf.dtb \
123 qcom-msm8960-cdp.dtb \
124 qcom-apq8074-dragonboard.dtb
125dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \
126 armada-370-mirabox.dtb \
127 armada-370-netgear-rn102.dtb \
128 armada-370-netgear-rn104.dtb \
129 armada-370-rd.dtb \
130 armada-xp-axpwifiap.dtb \
131 armada-xp-db.dtb \
132 armada-xp-gp.dtb \
133 armada-xp-netgear-rn2120.dtb \
134 armada-xp-matrix.dtb \
135 armada-xp-openblocks-ax3-4.dtb
136dtb-$(CONFIG_ARCH_MXC) += \ 150dtb-$(CONFIG_ARCH_MXC) += \
151 imx25-eukrea-mbimxsd25-baseboard.dtb \
137 imx25-karo-tx25.dtb \ 152 imx25-karo-tx25.dtb \
138 imx25-pdk.dtb \ 153 imx25-pdk.dtb \
139 imx27-apf27.dtb \ 154 imx27-apf27.dtb \
140 imx27-apf27dev.dtb \ 155 imx27-apf27dev.dtb \
141 imx27-pdk.dtb \ 156 imx27-pdk.dtb \
142 imx27-phytec-phycore-som.dtb \
143 imx27-phytec-phycore-rdk.dtb \ 157 imx27-phytec-phycore-rdk.dtb \
144 imx27-phytec-phycard-s-som.dtb \
145 imx27-phytec-phycard-s-rdk.dtb \ 158 imx27-phytec-phycard-s-rdk.dtb \
146 imx31-bug.dtb \ 159 imx31-bug.dtb \
160 imx35-eukrea-mbimxsd35-baseboard.dtb \
161 imx50-evk.dtb \
147 imx51-apf51.dtb \ 162 imx51-apf51.dtb \
148 imx51-apf51dev.dtb \ 163 imx51-apf51dev.dtb \
149 imx51-babbage.dtb \ 164 imx51-babbage.dtb \
165 imx51-eukrea-mbimxsd51-baseboard.dtb \
150 imx53-ard.dtb \ 166 imx53-ard.dtb \
151 imx53-evk.dtb \
152 imx53-m53evk.dtb \ 167 imx53-m53evk.dtb \
153 imx53-mba53.dtb \ 168 imx53-mba53.dtb \
154 imx53-qsb.dtb \ 169 imx53-qsb.dtb \
170 imx53-qsrb.dtb \
155 imx53-smd.dtb \ 171 imx53-smd.dtb \
172 imx53-tx53-x03x.dtb \
173 imx53-tx53-x13x.dtb \
174 imx53-voipac-bsb.dtb \
156 imx6dl-cubox-i.dtb \ 175 imx6dl-cubox-i.dtb \
176 imx6dl-dfi-fs700-m60.dtb \
177 imx6dl-gw51xx.dtb \
178 imx6dl-gw52xx.dtb \
179 imx6dl-gw53xx.dtb \
180 imx6dl-gw54xx.dtb \
157 imx6dl-hummingboard.dtb \ 181 imx6dl-hummingboard.dtb \
182 imx6dl-nitrogen6x.dtb \
158 imx6dl-sabreauto.dtb \ 183 imx6dl-sabreauto.dtb \
184 imx6dl-sabrelite.dtb \
159 imx6dl-sabresd.dtb \ 185 imx6dl-sabresd.dtb \
160 imx6dl-wandboard.dtb \ 186 imx6dl-wandboard.dtb \
161 imx6q-arm2.dtb \ 187 imx6q-arm2.dtb \
188 imx6q-cm-fx6.dtb \
162 imx6q-cubox-i.dtb \ 189 imx6q-cubox-i.dtb \
190 imx6q-dfi-fs700-m60.dtb \
191 imx6q-dmo-edmqmx6.dtb \
192 imx6q-gk802.dtb \
193 imx6q-gw51xx.dtb \
194 imx6q-gw52xx.dtb \
195 imx6q-gw53xx.dtb \
196 imx6q-gw5400-a.dtb \
197 imx6q-gw54xx.dtb \
198 imx6q-nitrogen6x.dtb \
163 imx6q-phytec-pbab01.dtb \ 199 imx6q-phytec-pbab01.dtb \
164 imx6q-sabreauto.dtb \ 200 imx6q-sabreauto.dtb \
165 imx6q-sabrelite.dtb \ 201 imx6q-sabrelite.dtb \
@@ -183,6 +219,9 @@ dtb-$(CONFIG_ARCH_MXS) += imx23-evk.dtb \
183 imx28-cfa10056.dtb \ 219 imx28-cfa10056.dtb \
184 imx28-cfa10057.dtb \ 220 imx28-cfa10057.dtb \
185 imx28-cfa10058.dtb \ 221 imx28-cfa10058.dtb \
222 imx28-duckbill.dtb \
223 imx28-eukrea-mbmx283lc.dtb \
224 imx28-eukrea-mbmx287lc.dtb \
186 imx28-evk.dtb \ 225 imx28-evk.dtb \
187 imx28-m28cu3.dtb \ 226 imx28-m28cu3.dtb \
188 imx28-m28evk.dtb \ 227 imx28-m28evk.dtb \
@@ -199,6 +238,10 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
199 omap2420-n810-wimax.dtb \ 238 omap2420-n810-wimax.dtb \
200 omap3430-sdp.dtb \ 239 omap3430-sdp.dtb \
201 omap3-beagle.dtb \ 240 omap3-beagle.dtb \
241 omap3-cm-t3517.dtb \
242 omap3-sbc-t3517.dtb \
243 omap3-cm-t3530.dtb \
244 omap3-sbc-t3530.dtb \
202 omap3-cm-t3730.dtb \ 245 omap3-cm-t3730.dtb \
203 omap3-sbc-t3730.dtb \ 246 omap3-sbc-t3730.dtb \
204 omap3-devkit8000.dtb \ 247 omap3-devkit8000.dtb \
@@ -209,12 +252,24 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
209 omap3-n900.dtb \ 252 omap3-n900.dtb \
210 omap3-n9.dtb \ 253 omap3-n9.dtb \
211 omap3-n950.dtb \ 254 omap3-n950.dtb \
255 omap3-overo-alto35.dtb \
256 omap3-overo-storm-alto35.dtb \
257 omap3-overo-chestnut43.dtb \
258 omap3-overo-storm-chestnut43.dtb \
259 omap3-overo-gallop43.dtb \
260 omap3-overo-storm-gallop43.dtb \
261 omap3-overo-palo43.dtb \
262 omap3-overo-storm-palo43.dtb \
263 omap3-overo-summit.dtb \
264 omap3-overo-storm-summit.dtb \
212 omap3-overo-tobi.dtb \ 265 omap3-overo-tobi.dtb \
213 omap3-overo-storm-tobi.dtb \ 266 omap3-overo-storm-tobi.dtb \
214 omap3-gta04.dtb \ 267 omap3-gta04.dtb \
215 omap3-igep0020.dtb \ 268 omap3-igep0020.dtb \
216 omap3-igep0030.dtb \ 269 omap3-igep0030.dtb \
270 omap3-lilly-dbb056.dtb \
217 omap3-zoom3.dtb \ 271 omap3-zoom3.dtb \
272 omap4-duovero-parlor.dtb \
218 omap4-panda.dtb \ 273 omap4-panda.dtb \
219 omap4-panda-a4.dtb \ 274 omap4-panda-a4.dtb \
220 omap4-panda-es.dtb \ 275 omap4-panda-es.dtb \
@@ -228,12 +283,17 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \
228 am335x-boneblack.dtb \ 283 am335x-boneblack.dtb \
229 am335x-nano.dtb \ 284 am335x-nano.dtb \
230 am335x-base0033.dtb \ 285 am335x-base0033.dtb \
286 am3517-craneboard.dtb \
231 am3517-evm.dtb \ 287 am3517-evm.dtb \
232 am3517_mt_ventoux.dtb \ 288 am3517_mt_ventoux.dtb \
233 am43x-epos-evm.dtb \ 289 am43x-epos-evm.dtb \
290 am437x-gp-evm.dtb \
234 dra7-evm.dtb 291 dra7-evm.dtb
235dtb-$(CONFIG_ARCH_ORION5X) += orion5x-lacie-ethernet-disk-mini-v2.dtb 292dtb-$(CONFIG_ARCH_ORION5X) += orion5x-lacie-ethernet-disk-mini-v2.dtb
236dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb 293dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb
294dtb-$(CONFIG_ARCH_QCOM) += qcom-msm8660-surf.dtb \
295 qcom-msm8960-cdp.dtb \
296 qcom-apq8074-dragonboard.dtb
237dtb-$(CONFIG_ARCH_U8500) += ste-snowball.dtb \ 297dtb-$(CONFIG_ARCH_U8500) += ste-snowball.dtb \
238 ste-hrefprev60-stuib.dtb \ 298 ste-hrefprev60-stuib.dtb \
239 ste-hrefprev60-tvk.dtb \ 299 ste-hrefprev60-tvk.dtb \
@@ -284,6 +344,9 @@ dtb-$(CONFIG_ARCH_SUNXI) += \
284 sun4i-a10-cubieboard.dtb \ 344 sun4i-a10-cubieboard.dtb \
285 sun4i-a10-mini-xplus.dtb \ 345 sun4i-a10-mini-xplus.dtb \
286 sun4i-a10-hackberry.dtb \ 346 sun4i-a10-hackberry.dtb \
347 sun4i-a10-inet97fv2.dtb \
348 sun4i-a10-olinuxino-lime.dtb \
349 sun4i-a10-pcduino.dtb \
287 sun5i-a10s-olinuxino-micro.dtb \ 350 sun5i-a10s-olinuxino-micro.dtb \
288 sun5i-a13-olinuxino.dtb \ 351 sun5i-a13-olinuxino.dtb \
289 sun5i-a13-olinuxino-micro.dtb \ 352 sun5i-a13-olinuxino-micro.dtb \
@@ -322,8 +385,31 @@ dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \
322dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb \ 385dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb \
323 zynq-zc706.dtb \ 386 zynq-zc706.dtb \
324 zynq-zed.dtb 387 zynq-zed.dtb
388dtb-$(CONFIG_MACH_ARMADA_370) += \
389 armada-370-db.dtb \
390 armada-370-mirabox.dtb \
391 armada-370-netgear-rn102.dtb \
392 armada-370-netgear-rn104.dtb \
393 armada-370-rd.dtb
394dtb-$(CONFIG_MACH_ARMADA_375) += \
395 armada-375-db.dtb
396dtb-$(CONFIG_MACH_ARMADA_38X) += \
397 armada-385-db.dtb \
398 armada-385-rd.dtb
399dtb-$(CONFIG_MACH_ARMADA_XP) += \
400 armada-xp-axpwifiap.dtb \
401 armada-xp-db.dtb \
402 armada-xp-gp.dtb \
403 armada-xp-netgear-rn2120.dtb \
404 armada-xp-matrix.dtb \
405 armada-xp-openblocks-ax3-4.dtb
406dtb-$(CONFIG_MACH_DOVE) += dove-cm-a510.dtb \
407 dove-cubox.dtb \
408 dove-d2plug.dtb \
409 dove-d3plug.dtb \
410 dove-dove-db.dtb
325 411
326targets += dtbs 412targets += dtbs dtbs_install
327targets += $(dtb-y) 413targets += $(dtb-y)
328endif 414endif
329 415
@@ -333,3 +419,5 @@ dtbs: $(addprefix $(obj)/, $(dtb-y))
333 $(Q)rm -f $(obj)/../*.dtb 419 $(Q)rm -f $(obj)/../*.dtb
334 420
335clean-files := *.dtb 421clean-files := *.dtb
422
423dtbs_install: $(addsuffix _dtbinst_, $(dtb-y))
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 7e6c64ed966d..28ae040e7c3d 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -260,6 +260,12 @@
260 >; 260 >;
261 }; 261 };
262 262
263 mmc1_pins: pinmux_mmc1_pins {
264 pinctrl-single,pins = <
265 0x160 (PIN_INPUT | MUX_MODE7) /* spi0_cs1.gpio0_6 */
266 >;
267 };
268
263 lcd_pins_s0: lcd_pins_s0 { 269 lcd_pins_s0: lcd_pins_s0 {
264 pinctrl-single,pins = < 270 pinctrl-single,pins = <
265 0x20 0x01 /* gpmc_ad8.lcd_data16, OUTPUT | MODE1 */ 271 0x20 0x01 /* gpmc_ad8.lcd_data16, OUTPUT | MODE1 */
@@ -434,9 +440,9 @@
434 ranges = <0 0 0x08000000 0x10000000>; /* CS0: NAND */ 440 ranges = <0 0 0x08000000 0x10000000>; /* CS0: NAND */
435 nand@0,0 { 441 nand@0,0 {
436 reg = <0 0 0>; /* CS0, offset 0 */ 442 reg = <0 0 0>; /* CS0, offset 0 */
437 nand-bus-width = <8>;
438 ti,nand-ecc-opt = "bch8"; 443 ti,nand-ecc-opt = "bch8";
439 gpmc,device-nand = "true"; 444 ti,elm-id = <&elm>;
445 nand-bus-width = <8>;
440 gpmc,device-width = <1>; 446 gpmc,device-width = <1>;
441 gpmc,sync-clk-ps = <0>; 447 gpmc,sync-clk-ps = <0>;
442 gpmc,cs-on-ns = <0>; 448 gpmc,cs-on-ns = <0>;
@@ -460,50 +466,51 @@
460 gpmc,wait-monitoring-ns = <0>; 466 gpmc,wait-monitoring-ns = <0>;
461 gpmc,wr-access-ns = <40>; 467 gpmc,wr-access-ns = <40>;
462 gpmc,wr-data-mux-bus-ns = <0>; 468 gpmc,wr-data-mux-bus-ns = <0>;
463 469 /* MTD partition table */
470 /* All SPL-* partitions are sized to minimal length
471 * which can be independently programmable. For
472 * NAND flash this is equal to size of erase-block */
464 #address-cells = <1>; 473 #address-cells = <1>;
465 #size-cells = <1>; 474 #size-cells = <1>;
466 elm_id = <&elm>;
467
468 /* MTD partition table */
469 partition@0 { 475 partition@0 {
470 label = "SPL1"; 476 label = "NAND.SPL";
471 reg = <0x00000000 0x000020000>; 477 reg = <0x00000000 0x000020000>;
472 }; 478 };
473
474 partition@1 { 479 partition@1 {
475 label = "SPL2"; 480 label = "NAND.SPL.backup1";
476 reg = <0x00020000 0x00020000>; 481 reg = <0x00020000 0x00020000>;
477 }; 482 };
478
479 partition@2 { 483 partition@2 {
480 label = "SPL3"; 484 label = "NAND.SPL.backup2";
481 reg = <0x00040000 0x00020000>; 485 reg = <0x00040000 0x00020000>;
482 }; 486 };
483
484 partition@3 { 487 partition@3 {
485 label = "SPL4"; 488 label = "NAND.SPL.backup3";
486 reg = <0x00060000 0x00020000>; 489 reg = <0x00060000 0x00020000>;
487 }; 490 };
488
489 partition@4 { 491 partition@4 {
490 label = "U-boot"; 492 label = "NAND.u-boot-spl";
491 reg = <0x00080000 0x001e0000>; 493 reg = <0x00080000 0x00040000>;
492 }; 494 };
493
494 partition@5 { 495 partition@5 {
495 label = "environment"; 496 label = "NAND.u-boot";
496 reg = <0x00260000 0x00020000>; 497 reg = <0x000C0000 0x00100000>;
497 }; 498 };
498
499 partition@6 { 499 partition@6 {
500 label = "Kernel"; 500 label = "NAND.u-boot-env";
501 reg = <0x00280000 0x00500000>; 501 reg = <0x001C0000 0x00020000>;
502 }; 502 };
503
504 partition@7 { 503 partition@7 {
505 label = "File-System"; 504 label = "NAND.u-boot-env.backup1";
506 reg = <0x00780000 0x0F880000>; 505 reg = <0x001E0000 0x00020000>;
506 };
507 partition@8 {
508 label = "NAND.kernel";
509 reg = <0x00200000 0x00800000>;
510 };
511 partition@9 {
512 label = "NAND.file-system";
513 reg = <0x00A00000 0x0F600000>;
507 }; 514 };
508 }; 515 };
509}; 516};
@@ -643,6 +650,9 @@
643 status = "okay"; 650 status = "okay";
644 vmmc-supply = <&vmmc_reg>; 651 vmmc-supply = <&vmmc_reg>;
645 bus-width = <4>; 652 bus-width = <4>;
653 pinctrl-names = "default";
654 pinctrl-0 = <&mmc1_pins>;
655 cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
646}; 656};
647 657
648&sham { 658&sham {
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index 486880b74831..ec08f6f677c3 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -45,6 +45,18 @@
45 regulator-boot-on; 45 regulator-boot-on;
46 }; 46 };
47 47
48 wl12xx_vmmc: fixedregulator@2 {
49 pinctrl-names = "default";
50 pinctrl-0 = <&wl12xx_gpio>;
51 compatible = "regulator-fixed";
52 regulator-name = "vwl1271";
53 regulator-min-microvolt = <1800000>;
54 regulator-max-microvolt = <1800000>;
55 gpio = <&gpio1 29 0>;
56 startup-delay-us = <70000>;
57 enable-active-high;
58 };
59
48 leds { 60 leds {
49 pinctrl-names = "default"; 61 pinctrl-names = "default";
50 pinctrl-0 = <&user_leds_s0>; 62 pinctrl-0 = <&user_leds_s0>;
@@ -270,6 +282,24 @@
270 0x144 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* rmii1_ref_clk.mcasp1_axr3 */ 282 0x144 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* rmii1_ref_clk.mcasp1_axr3 */
271 >; 283 >;
272 }; 284 };
285
286 mmc2_pins: pinmux_mmc2_pins {
287 pinctrl-single,pins = <
288 0x74 (PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_wpn.gpio0_31 */
289 0x80 (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */
290 0x84 (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */
291 0x00 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad0.mmc1_dat0 */
292 0x04 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad1.mmc1_dat1 */
293 0x08 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad2.mmc1_dat2 */
294 0x0c (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad3.mmc1_dat3 */
295 >;
296 };
297
298 wl12xx_gpio: pinmux_wl12xx_gpio {
299 pinctrl-single,pins = <
300 0x7c (PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_csn0.gpio1_29 */
301 >;
302 };
273}; 303};
274 304
275&uart0 { 305&uart0 {
@@ -342,9 +372,22 @@
342 status = "okay"; 372 status = "okay";
343 }; 373 };
344 374
375 usb-phy@47401b00 {
376 status = "okay";
377 };
378
345 usb@47401000 { 379 usb@47401000 {
346 status = "okay"; 380 status = "okay";
347 }; 381 };
382
383 usb@47401800 {
384 status = "okay";
385 dr_mode = "host";
386 };
387
388 dma-controller@07402000 {
389 status = "okay";
390 };
348}; 391};
349 392
350&epwmss2 { 393&epwmss2 {
@@ -440,6 +483,7 @@
440 pinctrl-names = "default", "sleep"; 483 pinctrl-names = "default", "sleep";
441 pinctrl-0 = <&cpsw_default>; 484 pinctrl-0 = <&cpsw_default>;
442 pinctrl-1 = <&cpsw_sleep>; 485 pinctrl-1 = <&cpsw_sleep>;
486 dual_emac = <1>;
443}; 487};
444 488
445&davinci_mdio { 489&davinci_mdio {
@@ -451,11 +495,13 @@
451&cpsw_emac0 { 495&cpsw_emac0 {
452 phy_id = <&davinci_mdio>, <0>; 496 phy_id = <&davinci_mdio>, <0>;
453 phy-mode = "rgmii-txid"; 497 phy-mode = "rgmii-txid";
498 dual_emac_res_vlan = <1>;
454}; 499};
455 500
456&cpsw_emac1 { 501&cpsw_emac1 {
457 phy_id = <&davinci_mdio>, <1>; 502 phy_id = <&davinci_mdio>, <1>;
458 phy-mode = "rgmii-txid"; 503 phy-mode = "rgmii-txid";
504 dual_emac_res_vlan = <2>;
459}; 505};
460 506
461&mmc1 { 507&mmc1 {
@@ -479,6 +525,16 @@
479 ti,no-reset-on-init; 525 ti,no-reset-on-init;
480}; 526};
481 527
528&mmc2 {
529 status = "okay";
530 vmmc-supply = <&wl12xx_vmmc>;
531 ti,non-removable;
532 bus-width = <4>;
533 cap-power-off-card;
534 pinctrl-names = "default";
535 pinctrl-0 = <&mmc2_pins>;
536};
537
482&mcasp1 { 538&mcasp1 {
483 pinctrl-names = "default"; 539 pinctrl-names = "default";
484 pinctrl-0 = <&mcasp1_pins>; 540 pinctrl-0 = <&mcasp1_pins>;
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 6d95d3df33c7..9770e35f2536 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -58,6 +58,10 @@
58 275000 1125000 58 275000 1125000
59 >; 59 >;
60 voltage-tolerance = <2>; /* 2 percentage */ 60 voltage-tolerance = <2>; /* 2 percentage */
61
62 clocks = <&dpll_mpu_ck>;
63 clock-names = "cpu";
64
61 clock-latency = <300000>; /* From omap-cpufreq driver */ 65 clock-latency = <300000>; /* From omap-cpufreq driver */
62 }; 66 };
63 }; 67 };
@@ -318,6 +322,7 @@
318 compatible = "ti,omap4-hwspinlock"; 322 compatible = "ti,omap4-hwspinlock";
319 reg = <0x480ca000 0x1000>; 323 reg = <0x480ca000 0x1000>;
320 ti,hwmods = "spinlock"; 324 ti,hwmods = "spinlock";
325 #hwlock-cells = <1>;
321 }; 326 };
322 327
323 wdt2: wdt@44e35000 { 328 wdt2: wdt@44e35000 {
@@ -399,7 +404,7 @@
399 ti,timer-pwm; 404 ti,timer-pwm;
400 }; 405 };
401 406
402 rtc@44e3e000 { 407 rtc: rtc@44e3e000 {
403 compatible = "ti,da830-rtc"; 408 compatible = "ti,da830-rtc";
404 reg = <0x44e3e000 0x1000>; 409 reg = <0x44e3e000 0x1000>;
405 interrupts = <75 410 interrupts = <75
@@ -448,7 +453,7 @@
448 ti,hwmods = "usb_otg_hs"; 453 ti,hwmods = "usb_otg_hs";
449 status = "disabled"; 454 status = "disabled";
450 455
451 usb_ctrl_mod: control@44e10000 { 456 usb_ctrl_mod: control@44e10620 {
452 compatible = "ti,am335x-usb-ctrl-module"; 457 compatible = "ti,am335x-usb-ctrl-module";
453 reg = <0x44e10620 0x10 458 reg = <0x44e10620 0x10
454 0x44e10648 0x4>; 459 0x44e10648 0x4>;
@@ -551,7 +556,7 @@
551 "tx14", "tx15"; 556 "tx14", "tx15";
552 }; 557 };
553 558
554 cppi41dma: dma-controller@07402000 { 559 cppi41dma: dma-controller@47402000 {
555 compatible = "ti,am3359-cppi41"; 560 compatible = "ti,am3359-cppi41";
556 reg = <0x47400000 0x1000 561 reg = <0x47400000 0x1000
557 0x47402000 0x1000 562 0x47402000 0x1000
@@ -582,6 +587,8 @@
582 compatible = "ti,am33xx-ecap"; 587 compatible = "ti,am33xx-ecap";
583 #pwm-cells = <3>; 588 #pwm-cells = <3>;
584 reg = <0x48300100 0x80>; 589 reg = <0x48300100 0x80>;
590 interrupts = <31>;
591 interrupt-names = "ecap0";
585 ti,hwmods = "ecap0"; 592 ti,hwmods = "ecap0";
586 status = "disabled"; 593 status = "disabled";
587 }; 594 };
@@ -610,6 +617,8 @@
610 compatible = "ti,am33xx-ecap"; 617 compatible = "ti,am33xx-ecap";
611 #pwm-cells = <3>; 618 #pwm-cells = <3>;
612 reg = <0x48302100 0x80>; 619 reg = <0x48302100 0x80>;
620 interrupts = <47>;
621 interrupt-names = "ecap1";
613 ti,hwmods = "ecap1"; 622 ti,hwmods = "ecap1";
614 status = "disabled"; 623 status = "disabled";
615 }; 624 };
@@ -638,6 +647,8 @@
638 compatible = "ti,am33xx-ecap"; 647 compatible = "ti,am33xx-ecap";
639 #pwm-cells = <3>; 648 #pwm-cells = <3>;
640 reg = <0x48304100 0x80>; 649 reg = <0x48304100 0x80>;
650 interrupts = <61>;
651 interrupt-names = "ecap2";
641 ti,hwmods = "ecap2"; 652 ti,hwmods = "ecap2";
642 status = "disabled"; 653 status = "disabled";
643 }; 654 };
diff --git a/arch/arm/boot/dts/am3517-craneboard.dts b/arch/arm/boot/dts/am3517-craneboard.dts
new file mode 100644
index 000000000000..2d40b3f241cd
--- /dev/null
+++ b/arch/arm/boot/dts/am3517-craneboard.dts
@@ -0,0 +1,174 @@
1/*
2 * See craneboard.org for more details
3 *
4 * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.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/dts-v1/;
11
12#include "am3517.dtsi"
13
14/ {
15 model = "TI AM3517 CraneBoard (TMDSEVM3517)";
16 compatible = "ti,am3517-craneboard", "ti,am3517", "ti,omap3";
17
18 memory {
19 device_type = "memory";
20 reg = <0x80000000 0x10000000>; /* 256 MB */
21 };
22
23 vbat: fixedregulator@0 {
24 compatible = "regulator-fixed";
25 regulator-name = "vbat";
26 regulator-min-microvolt = <5000000>;
27 regulator-max-microvolt = <5000000>;
28 regulator-boot-on;
29 };
30};
31
32&davinci_emac {
33 status = "okay";
34};
35
36&davinci_mdio {
37 status = "okay";
38};
39
40&i2c1 {
41 clock-frequency = <2600000>;
42
43 tps: tps@2d {
44 reg = <0x2d>;
45 };
46};
47
48&i2c2 {
49 clock-frequency = <400000>;
50 /* goes to expansion connector */
51 status = "disabled";
52};
53
54&i2c3 {
55 clock-frequency = <400000>;
56 /* goes to expansion connector */
57 status = "disabled";
58};
59
60&mmc1 {
61 vmmc-supply = <&vdd2_reg>;
62 bus-width = <8>;
63};
64
65&mmc2 {
66 /* goes to expansion connector */
67 status = "disabled";
68};
69
70&mmc3 {
71 /* goes to expansion connector */
72 status = "disabled";
73};
74
75#include "tps65910.dtsi"
76
77&omap3_pmx_core {
78 tps_pins: pinmux_tps_pins {
79 pinctrl-single,pins = <
80 0x1b0 (PIN_INPUT_PULLUP | MUX_MODE0) /* sys_nirq.sys_nirq */
81 >;
82 };
83};
84
85&tps {
86 pinctrl-names = "default";
87 pinctrl-0 = <&tps_pins>;
88
89 interrupts = <7>; /* SYS_NIRQ cascaded to intc */
90 interrupt-parent = <&intc>;
91
92 ti,en-ck32k-xtal;
93
94 vcc1-supply = <&vbat>;
95 vcc2-supply = <&vbat>;
96 vcc3-supply = <&vbat>;
97 vcc4-supply = <&vbat>;
98 vcc5-supply = <&vbat>;
99 vcc6-supply = <&vbat>;
100 vcc7-supply = <&vbat>;
101 vccio-supply = <&vbat>;
102
103 regulators {
104 vrtc_reg: regulator@0 {
105 regulator-always-on;
106 };
107
108 vio_reg: regulator@1 {
109 regulator-always-on;
110 };
111
112 /*
113 * Unused:
114 * VDIG1=2.7V,300mA max
115 * VDIG2=1.8V,300mA max
116 */
117
118 vpll_reg: regulator@7 {
119 /* VDDS_DPLL_1V8 */
120 regulator-min-microvolt = <1800000>;
121 regulator-max-microvolt = <1800000>;
122 regulator-always-on;
123 };
124
125 vaux1_reg: regulator@9 {
126 /* VDDS_SRAM_1V8 */
127 regulator-min-microvolt = <1800000>;
128 regulator-max-microvolt = <1800000>;
129 regulator-always-on;
130 };
131
132 vaux2_reg: regulator@10 {
133 /* VDDA1P8V_USBPHY */
134 regulator-min-microvolt = <1800000>;
135 regulator-max-microvolt = <1800000>;
136 regulator-always-on;
137 };
138
139 /* VAUX33 unused */
140
141 vdac_reg: regulator@8 {
142 /* VDDA_DAC_1V8 */
143 regulator-min-microvolt = <1800000>;
144 regulator-max-microvolt = <1800000>;
145 regulator-always-on;
146 };
147
148 vmmc_reg: regulator@12 {
149 /* VDDA3P3V_USBPHY */
150 regulator-min-microvolt = <3300000>;
151 regulator-max-microvolt = <3300000>;
152 regulator-always-on;
153 };
154
155 vdd1_reg: regulator@2 {
156 /* VDD_CORE */
157 regulator-name = "vdd_core";
158 regulator-min-microvolt = <1200000>;
159 regulator-max-microvolt = <1200000>;
160 regulator-boot-on;
161 regulator-always-on;
162 };
163
164 vdd2_reg: regulator@3 {
165 /* VDDSHV_3V3 */
166 regulator-name = "vdd_shv";
167 regulator-min-microvolt = <3300000>;
168 regulator-max-microvolt = <3300000>;
169 regulator-always-on;
170 };
171
172 /* VDD3 unused */
173 };
174};
diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
index c6bd4d986c29..36d523a26831 100644
--- a/arch/arm/boot/dts/am4372.dtsi
+++ b/arch/arm/boot/dts/am4372.dtsi
@@ -8,6 +8,7 @@
8 * kind, whether express or implied. 8 * kind, whether express or implied.
9 */ 9 */
10 10
11#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/interrupt-controller/arm-gic.h> 12#include <dt-bindings/interrupt-controller/arm-gic.h>
12 13
13#include "skeleton.dtsi" 14#include "skeleton.dtsi"
@@ -33,6 +34,11 @@
33 compatible = "arm,cortex-a9"; 34 compatible = "arm,cortex-a9";
34 device_type = "cpu"; 35 device_type = "cpu";
35 reg = <0>; 36 reg = <0>;
37
38 clocks = <&dpll_mpu_ck>;
39 clock-names = "cpu";
40
41 clock-latency = <300000>; /* From omap-cpufreq driver */
36 }; 42 };
37 }; 43 };
38 44
@@ -351,6 +357,13 @@
351 status = "disabled"; 357 status = "disabled";
352 }; 358 };
353 359
360 hwspinlock: spinlock@480ca000 {
361 compatible = "ti,omap4-hwspinlock";
362 reg = <0x480ca000 0x1000>;
363 ti,hwmods = "spinlock";
364 #hwlock-cells = <1>;
365 };
366
354 i2c0: i2c@44e0b000 { 367 i2c0: i2c@44e0b000 {
355 compatible = "ti,am4372-i2c","ti,omap4-i2c"; 368 compatible = "ti,am4372-i2c","ti,omap4-i2c";
356 reg = <0x44e0b000 0x1000>; 369 reg = <0x44e0b000 0x1000>;
@@ -521,6 +534,7 @@
521 534
522 ecap0: ecap@48300100 { 535 ecap0: ecap@48300100 {
523 compatible = "ti,am4372-ecap","ti,am33xx-ecap"; 536 compatible = "ti,am4372-ecap","ti,am33xx-ecap";
537 #pwm-cells = <3>;
524 reg = <0x48300100 0x80>; 538 reg = <0x48300100 0x80>;
525 ti,hwmods = "ecap0"; 539 ti,hwmods = "ecap0";
526 status = "disabled"; 540 status = "disabled";
@@ -528,6 +542,7 @@
528 542
529 ehrpwm0: ehrpwm@48300200 { 543 ehrpwm0: ehrpwm@48300200 {
530 compatible = "ti,am4372-ehrpwm","ti,am33xx-ehrpwm"; 544 compatible = "ti,am4372-ehrpwm","ti,am33xx-ehrpwm";
545 #pwm-cells = <3>;
531 reg = <0x48300200 0x80>; 546 reg = <0x48300200 0x80>;
532 ti,hwmods = "ehrpwm0"; 547 ti,hwmods = "ehrpwm0";
533 status = "disabled"; 548 status = "disabled";
@@ -545,6 +560,7 @@
545 560
546 ecap1: ecap@48302100 { 561 ecap1: ecap@48302100 {
547 compatible = "ti,am4372-ecap","ti,am33xx-ecap"; 562 compatible = "ti,am4372-ecap","ti,am33xx-ecap";
563 #pwm-cells = <3>;
548 reg = <0x48302100 0x80>; 564 reg = <0x48302100 0x80>;
549 ti,hwmods = "ecap1"; 565 ti,hwmods = "ecap1";
550 status = "disabled"; 566 status = "disabled";
@@ -552,6 +568,7 @@
552 568
553 ehrpwm1: ehrpwm@48302200 { 569 ehrpwm1: ehrpwm@48302200 {
554 compatible = "ti,am4372-ehrpwm","ti,am33xx-ehrpwm"; 570 compatible = "ti,am4372-ehrpwm","ti,am33xx-ehrpwm";
571 #pwm-cells = <3>;
555 reg = <0x48302200 0x80>; 572 reg = <0x48302200 0x80>;
556 ti,hwmods = "ehrpwm1"; 573 ti,hwmods = "ehrpwm1";
557 status = "disabled"; 574 status = "disabled";
@@ -569,6 +586,7 @@
569 586
570 ecap2: ecap@48304100 { 587 ecap2: ecap@48304100 {
571 compatible = "ti,am4372-ecap","ti,am33xx-ecap"; 588 compatible = "ti,am4372-ecap","ti,am33xx-ecap";
589 #pwm-cells = <3>;
572 reg = <0x48304100 0x80>; 590 reg = <0x48304100 0x80>;
573 ti,hwmods = "ecap2"; 591 ti,hwmods = "ecap2";
574 status = "disabled"; 592 status = "disabled";
@@ -576,6 +594,7 @@
576 594
577 ehrpwm2: ehrpwm@48304200 { 595 ehrpwm2: ehrpwm@48304200 {
578 compatible = "ti,am4372-ehrpwm","ti,am33xx-ehrpwm"; 596 compatible = "ti,am4372-ehrpwm","ti,am33xx-ehrpwm";
597 #pwm-cells = <3>;
579 reg = <0x48304200 0x80>; 598 reg = <0x48304200 0x80>;
580 ti,hwmods = "ehrpwm2"; 599 ti,hwmods = "ehrpwm2";
581 status = "disabled"; 600 status = "disabled";
@@ -593,6 +612,7 @@
593 612
594 ehrpwm3: ehrpwm@48306200 { 613 ehrpwm3: ehrpwm@48306200 {
595 compatible = "ti,am4372-ehrpwm","ti,am33xx-ehrpwm"; 614 compatible = "ti,am4372-ehrpwm","ti,am33xx-ehrpwm";
615 #pwm-cells = <3>;
596 reg = <0x48306200 0x80>; 616 reg = <0x48306200 0x80>;
597 ti,hwmods = "ehrpwm3"; 617 ti,hwmods = "ehrpwm3";
598 status = "disabled"; 618 status = "disabled";
@@ -610,6 +630,7 @@
610 630
611 ehrpwm4: ehrpwm@48308200 { 631 ehrpwm4: ehrpwm@48308200 {
612 compatible = "ti,am4372-ehrpwm","ti,am33xx-ehrpwm"; 632 compatible = "ti,am4372-ehrpwm","ti,am33xx-ehrpwm";
633 #pwm-cells = <3>;
613 reg = <0x48308200 0x80>; 634 reg = <0x48308200 0x80>;
614 ti,hwmods = "ehrpwm4"; 635 ti,hwmods = "ehrpwm4";
615 status = "disabled"; 636 status = "disabled";
@@ -627,6 +648,7 @@
627 648
628 ehrpwm5: ehrpwm@4830a200 { 649 ehrpwm5: ehrpwm@4830a200 {
629 compatible = "ti,am4372-ehrpwm","ti,am33xx-ehrpwm"; 650 compatible = "ti,am4372-ehrpwm","ti,am33xx-ehrpwm";
651 #pwm-cells = <3>;
630 reg = <0x4830a200 0x80>; 652 reg = <0x4830a200 0x80>;
631 ti,hwmods = "ehrpwm5"; 653 ti,hwmods = "ehrpwm5";
632 status = "disabled"; 654 status = "disabled";
@@ -689,6 +711,30 @@
689 <&edma 11>; 711 <&edma 11>;
690 dma-names = "tx", "rx"; 712 dma-names = "tx", "rx";
691 }; 713 };
714
715 elm: elm@48080000 {
716 compatible = "ti,am3352-elm";
717 reg = <0x48080000 0x2000>;
718 interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
719 ti,hwmods = "elm";
720 clocks = <&l4ls_gclk>;
721 clock-names = "fck";
722 status = "disabled";
723 };
724
725 gpmc: gpmc@50000000 {
726 compatible = "ti,am3352-gpmc";
727 ti,hwmods = "gpmc";
728 clocks = <&l3s_gclk>;
729 clock-names = "fck";
730 reg = <0x50000000 0x2000>;
731 interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
732 gpmc,num-cs = <7>;
733 gpmc,num-waitpins = <2>;
734 #address-cells = <2>;
735 #size-cells = <1>;
736 status = "disabled";
737 };
692 }; 738 };
693}; 739};
694 740
diff --git a/arch/arm/boot/dts/am437x-gp-evm.dts b/arch/arm/boot/dts/am437x-gp-evm.dts
new file mode 100644
index 000000000000..df8798e8bd25
--- /dev/null
+++ b/arch/arm/boot/dts/am437x-gp-evm.dts
@@ -0,0 +1,127 @@
1/*
2 * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/* AM437x GP EVM */
10
11/dts-v1/;
12
13#include "am4372.dtsi"
14#include <dt-bindings/pinctrl/am43xx.h>
15#include <dt-bindings/pwm/pwm.h>
16#include <dt-bindings/gpio/gpio.h>
17
18/ {
19 model = "TI AM437x GP EVM";
20 compatible = "ti,am437x-gp-evm","ti,am4372","ti,am43";
21
22 vmmcsd_fixed: fixedregulator-sd {
23 compatible = "regulator-fixed";
24 regulator-name = "vmmcsd_fixed";
25 regulator-min-microvolt = <3300000>;
26 regulator-max-microvolt = <3300000>;
27 enable-active-high;
28 };
29
30 backlight {
31 compatible = "pwm-backlight";
32 pwms = <&ecap0 0 50000 PWM_POLARITY_INVERTED>;
33 brightness-levels = <0 51 53 56 62 75 101 152 255>;
34 default-brightness-level = <8>;
35 };
36
37 matrix_keypad: matrix_keypad@0 {
38 compatible = "gpio-matrix-keypad";
39 debounce-delay-ms = <5>;
40 col-scan-delay-us = <2>;
41
42 row-gpios = <&gpio3 21 GPIO_ACTIVE_HIGH /* Bank3, pin21 */
43 &gpio4 3 GPIO_ACTIVE_HIGH /* Bank4, pin3 */
44 &gpio4 2 GPIO_ACTIVE_HIGH>; /* Bank4, pin2 */
45
46 col-gpios = <&gpio3 19 GPIO_ACTIVE_HIGH /* Bank3, pin19 */
47 &gpio3 20 GPIO_ACTIVE_HIGH>; /* Bank3, pin20 */
48
49 linux,keymap = <0x00000201 /* P1 */
50 0x00010202 /* P2 */
51 0x01000067 /* UP */
52 0x0101006a /* RIGHT */
53 0x02000069 /* LEFT */
54 0x0201006c>; /* DOWN */
55 };
56};
57
58&am43xx_pinmux {
59 i2c0_pins: i2c0_pins {
60 pinctrl-single,pins = <
61 0x188 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* i2c0_sda.i2c0_sda */
62 0x18c (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* i2c0_scl.i2c0_scl */
63 >;
64 };
65
66 i2c1_pins: i2c1_pins {
67 pinctrl-single,pins = <
68 0x15c (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE2) /* spi0_cs0.i2c1_scl */
69 0x158 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE2) /* spi0_d1.i2c1_sda */
70 >;
71 };
72
73 mmc1_pins: pinmux_mmc1_pins {
74 pinctrl-single,pins = <
75 0x160 (PIN_INPUT | MUX_MODE7) /* spi0_cs1.gpio0_6 */
76 >;
77 };
78
79 ecap0_pins: backlight_pins {
80 pinctrl-single,pins = <
81 0x164 MUX_MODE0 /* eCAP0_in_PWM0_out.eCAP0_in_PWM0_out MODE0 */
82 >;
83 };
84};
85
86&i2c0 {
87 status = "okay";
88 pinctrl-names = "default";
89 pinctrl-0 = <&i2c0_pins>;
90};
91
92&i2c1 {
93 status = "okay";
94 pinctrl-names = "default";
95 pinctrl-0 = <&i2c1_pins>;
96};
97
98&epwmss0 {
99 status = "okay";
100};
101
102&ecap0 {
103 status = "okay";
104 pinctrl-names = "default";
105 pinctrl-0 = <&ecap0_pins>;
106};
107
108&gpio0 {
109 status = "okay";
110};
111
112&gpio3 {
113 status = "okay";
114};
115
116&gpio4 {
117 status = "okay";
118};
119
120&mmc1 {
121 status = "okay";
122 vmmc-supply = <&vmmcsd_fixed>;
123 bus-width = <4>;
124 pinctrl-names = "default";
125 pinctrl-0 = <&mmc1_pins>;
126 cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
127};
diff --git a/arch/arm/boot/dts/am43x-epos-evm.dts b/arch/arm/boot/dts/am43x-epos-evm.dts
index fbf9c4c7a94f..167dbc8494de 100644
--- a/arch/arm/boot/dts/am43x-epos-evm.dts
+++ b/arch/arm/boot/dts/am43x-epos-evm.dts
@@ -13,6 +13,7 @@
13#include "am4372.dtsi" 13#include "am4372.dtsi"
14#include <dt-bindings/pinctrl/am43xx.h> 14#include <dt-bindings/pinctrl/am43xx.h>
15#include <dt-bindings/gpio/gpio.h> 15#include <dt-bindings/gpio/gpio.h>
16#include <dt-bindings/pwm/pwm.h>
16 17
17/ { 18/ {
18 model = "TI AM43x EPOS EVM"; 19 model = "TI AM43x EPOS EVM";
@@ -79,6 +80,64 @@
79 0x18c (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* i2c0_scl.i2c0_scl */ 80 0x18c (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* i2c0_scl.i2c0_scl */
80 >; 81 >;
81 }; 82 };
83
84 nand_flash_x8: nand_flash_x8 {
85 pinctrl-single,pins = <
86 0x40 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a0.SELQSPIorNAND/GPIO */
87 0x0 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* gpmc_ad0.gpmc_ad0 */
88 0x4 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* gpmc_ad1.gpmc_ad1 */
89 0x8 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* gpmc_ad2.gpmc_ad2 */
90 0xc (PIN_INPUT_PULLDOWN | MUX_MODE0) /* gpmc_ad3.gpmc_ad3 */
91 0x10 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* gpmc_ad4.gpmc_ad4 */
92 0x14 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* gpmc_ad5.gpmc_ad5 */
93 0x18 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* gpmc_ad6.gpmc_ad6 */
94 0x1c (PIN_INPUT_PULLDOWN | MUX_MODE0) /* gpmc_ad7.gpmc_ad7 */
95 0x70 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_wait0.gpmc_wait0 */
96 0x74 (PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_wpn.gpmc_wpn */
97 0x7c (PIN_OUTPUT | MUX_MODE0) /* gpmc_csn0.gpmc_csn0 */
98 0x90 (PIN_OUTPUT | MUX_MODE0) /* gpmc_advn_ale.gpmc_advn_ale */
99 0x94 (PIN_OUTPUT | MUX_MODE0) /* gpmc_oen_ren.gpmc_oen_ren */
100 0x98 (PIN_OUTPUT | MUX_MODE0) /* gpmc_wen.gpmc_wen */
101 0x9c (PIN_OUTPUT | MUX_MODE0) /* gpmc_be0n_cle.gpmc_be0n_cle */
102 >;
103 };
104
105 ecap0_pins: backlight_pins {
106 pinctrl-single,pins = <
107 0x164 MUX_MODE0 /* eCAP0_in_PWM0_out.eCAP0_in_PWM0_out MODE0 */
108 >;
109 };
110
111 i2c2_pins: pinmux_i2c2_pins {
112 pinctrl-single,pins = <
113 0x1c0 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE8) /* i2c2_sda.i2c2_sda */
114 0x1c4 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE8) /* i2c2_scl.i2c2_scl */
115 >;
116 };
117
118 spi0_pins: pinmux_spi0_pins {
119 pinctrl-single,pins = <
120 0x150 (PIN_INPUT | MUX_MODE0) /* spi0_clk.spi0_clk */
121 0x154 (PIN_OUTPUT | MUX_MODE0) /* spi0_d0.spi0_d0 */
122 0x158 (PIN_INPUT | MUX_MODE0) /* spi0_d1.spi0_d1 */
123 0x15c (PIN_OUTPUT | MUX_MODE0) /* spi0_cs0.spi0_cs0 */
124 >;
125 };
126
127 spi1_pins: pinmux_spi1_pins {
128 pinctrl-single,pins = <
129 0x190 (PIN_INPUT | MUX_MODE3) /* mcasp0_aclkx.spi1_clk */
130 0x194 (PIN_OUTPUT | MUX_MODE3) /* mcasp0_fsx.spi1_d0 */
131 0x198 (PIN_INPUT | MUX_MODE3) /* mcasp0_axr0.spi1_d1 */
132 0x19c (PIN_OUTPUT | MUX_MODE3) /* mcasp0_ahclkr.spi1_cs0 */
133 >;
134 };
135
136 mmc1_pins: pinmux_mmc1_pins {
137 pinctrl-single,pins = <
138 0x160 (PIN_INPUT | MUX_MODE7) /* spi0_cs1.gpio0_6 */
139 >;
140 };
82 }; 141 };
83 142
84 matrix_keypad: matrix_keypad@0 { 143 matrix_keypad: matrix_keypad@0 {
@@ -113,12 +172,22 @@
113 0x0203006c /* DOWN */ 172 0x0203006c /* DOWN */
114 0x03030069>; /* LEFT */ 173 0x03030069>; /* LEFT */
115 }; 174 };
175
176 backlight {
177 compatible = "pwm-backlight";
178 pwms = <&ecap0 0 50000 PWM_POLARITY_INVERTED>;
179 brightness-levels = <0 51 53 56 62 75 101 152 255>;
180 default-brightness-level = <8>;
181 };
116}; 182};
117 183
118&mmc1 { 184&mmc1 {
119 status = "okay"; 185 status = "okay";
120 vmmc-supply = <&vmmcsd_fixed>; 186 vmmc-supply = <&vmmcsd_fixed>;
121 bus-width = <4>; 187 bus-width = <4>;
188 pinctrl-names = "default";
189 pinctrl-0 = <&mmc1_pins>;
190 cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
122}; 191};
123 192
124&mac { 193&mac {
@@ -169,6 +238,12 @@
169 }; 238 };
170}; 239};
171 240
241&i2c2 {
242 pinctrl-names = "default";
243 pinctrl-0 = <&i2c2_pins>;
244 status = "okay";
245};
246
172&gpio0 { 247&gpio0 {
173 status = "okay"; 248 status = "okay";
174}; 249};
@@ -184,3 +259,111 @@
184&gpio3 { 259&gpio3 {
185 status = "okay"; 260 status = "okay";
186}; 261};
262
263&elm {
264 status = "okay";
265};
266
267&gpmc {
268 status = "okay";
269 pinctrl-names = "default";
270 pinctrl-0 = <&nand_flash_x8>;
271 ranges = <0 0 0x08000000 0x10000000>; /* CS0: NAND */
272 nand@0,0 {
273 reg = <0 0 0>; /* CS0, offset 0 */
274 ti,nand-ecc-opt = "bch8";
275 ti,elm-id = <&elm>;
276 nand-bus-width = <8>;
277 gpmc,device-width = <1>;
278 gpmc,sync-clk-ps = <0>;
279 gpmc,cs-on-ns = <0>;
280 gpmc,cs-rd-off-ns = <40>; /* tCEA + tCHZ + 1 */
281 gpmc,cs-wr-off-ns = <40>;
282 gpmc,adv-on-ns = <0>; /* cs-on-ns */
283 gpmc,adv-rd-off-ns = <25>; /* min( tALH + tALS + 1) */
284 gpmc,adv-wr-off-ns = <25>; /* min( tALH + tALS + 1) */
285 gpmc,we-on-ns = <0>; /* cs-on-ns */
286 gpmc,we-off-ns = <20>; /* we-on-time + tWP + 2 */
287 gpmc,oe-on-ns = <3>; /* cs-on-ns + tRR + 2 */
288 gpmc,oe-off-ns = <30>; /* oe-on-ns + tRP + 2 */
289 gpmc,access-ns = <30>; /* tCEA + 4*/
290 gpmc,rd-cycle-ns = <40>;
291 gpmc,wr-cycle-ns = <40>;
292 gpmc,wait-on-read = "true";
293 gpmc,wait-on-write = "true";
294 gpmc,bus-turnaround-ns = <0>;
295 gpmc,cycle2cycle-delay-ns = <0>;
296 gpmc,clk-activation-ns = <0>;
297 gpmc,wait-monitoring-ns = <0>;
298 gpmc,wr-access-ns = <40>;
299 gpmc,wr-data-mux-bus-ns = <0>;
300 /* MTD partition table */
301 /* All SPL-* partitions are sized to minimal length
302 * which can be independently programmable. For
303 * NAND flash this is equal to size of erase-block */
304 #address-cells = <1>;
305 #size-cells = <1>;
306 partition@0 {
307 label = "NAND.SPL";
308 reg = <0x00000000 0x00040000>;
309 };
310 partition@1 {
311 label = "NAND.SPL.backup1";
312 reg = <0x00040000 0x00040000>;
313 };
314 partition@2 {
315 label = "NAND.SPL.backup2";
316 reg = <0x00080000 0x00040000>;
317 };
318 partition@3 {
319 label = "NAND.SPL.backup3";
320 reg = <0x000C0000 0x00040000>;
321 };
322 partition@4 {
323 label = "NAND.u-boot-spl-os";
324 reg = <0x00100000 0x00080000>;
325 };
326 partition@5 {
327 label = "NAND.u-boot";
328 reg = <0x00180000 0x00100000>;
329 };
330 partition@6 {
331 label = "NAND.u-boot-env";
332 reg = <0x00280000 0x00040000>;
333 };
334 partition@7 {
335 label = "NAND.u-boot-env.backup1";
336 reg = <0x002C0000 0x00040000>;
337 };
338 partition@8 {
339 label = "NAND.kernel";
340 reg = <0x00300000 0x00700000>;
341 };
342 partition@9 {
343 label = "NAND.file-system";
344 reg = <0x00800000 0x1F600000>;
345 };
346 };
347};
348
349&epwmss0 {
350 status = "okay";
351};
352
353&ecap0 {
354 status = "okay";
355 pinctrl-names = "default";
356 pinctrl-0 = <&ecap0_pins>;
357};
358
359&spi0 {
360 pinctrl-names = "default";
361 pinctrl-0 = <&spi0_pins>;
362 status = "okay";
363};
364
365&spi1 {
366 pinctrl-names = "default";
367 pinctrl-0 = <&spi1_pins>;
368 status = "okay";
369};
diff --git a/arch/arm/boot/dts/armada-370-db.dts b/arch/arm/boot/dts/armada-370-db.dts
index 08a56bcfc724..82f238a9063f 100644
--- a/arch/arm/boot/dts/armada-370-db.dts
+++ b/arch/arm/boot/dts/armada-370-db.dts
@@ -64,6 +64,22 @@
64 phy-mode = "rgmii-id"; 64 phy-mode = "rgmii-id";
65 }; 65 };
66 66
67 i2c@11000 {
68 pinctrl-0 = <&i2c0_pins>;
69 pinctrl-names = "default";
70 status = "okay";
71 audio_codec: audio-codec@4a {
72 compatible = "cirrus,cs42l51";
73 reg = <0x4a>;
74 };
75 };
76
77 audio-controller@30000 {
78 pinctrl-0 = <&i2s_pins2>;
79 pinctrl-names = "default";
80 status = "okay";
81 };
82
67 mvsdio@d4000 { 83 mvsdio@d4000 {
68 pinctrl-0 = <&sdio_pins1>; 84 pinctrl-0 = <&sdio_pins1>;
69 pinctrl-names = "default"; 85 pinctrl-names = "default";
@@ -80,6 +96,30 @@
80 broken-cd; 96 broken-cd;
81 }; 97 };
82 98
99 pinctrl {
100 /*
101 * These pins might be muxed as I2S by
102 * the bootloader, but it conflicts
103 * with the real I2S pins that are
104 * muxed using i2s_pins. We must mux
105 * those pins to a function other than
106 * I2S.
107 */
108 pinctrl-0 = <&hog_pins1 &hog_pins2>;
109 pinctrl-names = "default";
110
111 hog_pins1: hog-pins1 {
112 marvell,pins = "mpp6", "mpp8", "mpp10",
113 "mpp12", "mpp13";
114 marvell,function = "gpio";
115 };
116
117 hog_pins2: hog-pins2 {
118 marvell,pins = "mpp5", "mpp7", "mpp9";
119 marvell,function = "gpo";
120 };
121 };
122
83 usb@50000 { 123 usb@50000 {
84 status = "okay"; 124 status = "okay";
85 }; 125 };
@@ -112,10 +152,26 @@
112 /* Port 0, Lane 0 */ 152 /* Port 0, Lane 0 */
113 status = "okay"; 153 status = "okay";
114 }; 154 };
155
115 pcie@2,0 { 156 pcie@2,0 {
116 /* Port 1, Lane 0 */ 157 /* Port 1, Lane 0 */
117 status = "okay"; 158 status = "okay";
118 }; 159 };
119 }; 160 };
120 }; 161 };
162
163 sound {
164 compatible = "marvell,a370db-audio";
165 marvell,audio-controller = <&audio_controller>;
166 marvell,audio-codec = <&audio_codec &spdif_out &spdif_in>;
167 status = "okay";
168 };
169
170 spdif_out: spdif-out {
171 compatible = "linux,spdif-dit";
172 };
173
174 spdif_in: spdif-in {
175 compatible = "linux,spdif-dir";
176 };
121}; 177};
diff --git a/arch/arm/boot/dts/armada-370-mirabox.dts b/arch/arm/boot/dts/armada-370-mirabox.dts
index 944e8785b308..2354fe023ee0 100644
--- a/arch/arm/boot/dts/armada-370-mirabox.dts
+++ b/arch/arm/boot/dts/armada-370-mirabox.dts
@@ -9,6 +9,7 @@
9 */ 9 */
10 10
11/dts-v1/; 11/dts-v1/;
12#include <dt-bindings/gpio/gpio.h>
12#include "armada-370.dtsi" 13#include "armada-370.dtsi"
13 14
14/ { 15/ {
@@ -73,19 +74,19 @@
73 74
74 green_pwr_led { 75 green_pwr_led {
75 label = "mirabox:green:pwr"; 76 label = "mirabox:green:pwr";
76 gpios = <&gpio1 31 1>; 77 gpios = <&gpio1 31 GPIO_ACTIVE_LOW>;
77 default-state = "keep"; 78 default-state = "keep";
78 }; 79 };
79 80
80 blue_stat_led { 81 blue_stat_led {
81 label = "mirabox:blue:stat"; 82 label = "mirabox:blue:stat";
82 gpios = <&gpio2 0 1>; 83 gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
83 default-state = "off"; 84 default-state = "off";
84 }; 85 };
85 86
86 green_stat_led { 87 green_stat_led {
87 label = "mirabox:green:stat"; 88 label = "mirabox:green:stat";
88 gpios = <&gpio2 1 1>; 89 gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
89 default-state = "off"; 90 default-state = "off";
90 }; 91 };
91 }; 92 };
diff --git a/arch/arm/boot/dts/armada-370-rd.dts b/arch/arm/boot/dts/armada-370-rd.dts
index abbb807459d2..3e2c857d6000 100644
--- a/arch/arm/boot/dts/armada-370-rd.dts
+++ b/arch/arm/boot/dts/armada-370-rd.dts
@@ -12,6 +12,8 @@
12 */ 12 */
13 13
14/dts-v1/; 14/dts-v1/;
15#include <dt-bindings/input/input.h>
16#include <dt-bindings/gpio/gpio.h>
15#include "armada-370.dtsi" 17#include "armada-370.dtsi"
16 18
17/ { 19/ {
@@ -100,8 +102,8 @@
100 #size-cells = <0>; 102 #size-cells = <0>;
101 button@1 { 103 button@1 {
102 label = "Software Button"; 104 label = "Software Button";
103 linux,code = <116>; 105 linux,code = <KEY_POWER>;
104 gpios = <&gpio0 6 1>; 106 gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
105 }; 107 };
106 }; 108 };
107 109
diff --git a/arch/arm/boot/dts/armada-370-xp.dtsi b/arch/arm/boot/dts/armada-370-xp.dtsi
index 74b5964430ac..bbb40f62037d 100644
--- a/arch/arm/boot/dts/armada-370-xp.dtsi
+++ b/arch/arm/boot/dts/armada-370-xp.dtsi
@@ -44,8 +44,8 @@
44 #size-cells = <1>; 44 #size-cells = <1>;
45 controller = <&mbusc>; 45 controller = <&mbusc>;
46 interrupt-parent = <&mpic>; 46 interrupt-parent = <&mpic>;
47 pcie-mem-aperture = <0xe0000000 0x8000000>; 47 pcie-mem-aperture = <0xf8000000 0x7e00000>;
48 pcie-io-aperture = <0xe8000000 0x100000>; 48 pcie-io-aperture = <0xffe00000 0x100000>;
49 49
50 devbus-bootcs { 50 devbus-bootcs {
51 compatible = "marvell,mvebu-devbus"; 51 compatible = "marvell,mvebu-devbus";
@@ -199,6 +199,10 @@
199 interrupts = <37>, <38>, <39>, <40>, <5>, <6>; 199 interrupts = <37>, <38>, <39>, <40>, <5>, <6>;
200 }; 200 };
201 201
202 watchdog@20300 {
203 reg = <0x20300 0x34>, <0x20704 0x4>;
204 };
205
202 usb@50000 { 206 usb@50000 {
203 compatible = "marvell,orion-ehci"; 207 compatible = "marvell,orion-ehci";
204 reg = <0x50000 0x500>; 208 reg = <0x50000 0x500>;
diff --git a/arch/arm/boot/dts/armada-370.dtsi b/arch/arm/boot/dts/armada-370.dtsi
index 0d8530c98cf5..af1f11e9e5a0 100644
--- a/arch/arm/boot/dts/armada-370.dtsi
+++ b/arch/arm/boot/dts/armada-370.dtsi
@@ -132,6 +132,25 @@
132 "mpp51", "mpp52", "mpp53"; 132 "mpp51", "mpp52", "mpp53";
133 marvell,function = "sd0"; 133 marvell,function = "sd0";
134 }; 134 };
135
136 i2c0_pins: i2c0-pins {
137 marvell,pins = "mpp2", "mpp3";
138 marvell,function = "i2c0";
139 };
140
141 i2s_pins1: i2s-pins1 {
142 marvell,pins = "mpp5", "mpp6", "mpp7",
143 "mpp8", "mpp9", "mpp10",
144 "mpp12", "mpp13";
145 marvell,function = "audio";
146 };
147
148 i2s_pins2: i2s-pins2 {
149 marvell,pins = "mpp49", "mpp47", "mpp50",
150 "mpp59", "mpp57", "mpp61",
151 "mpp62", "mpp60", "mpp58";
152 marvell,function = "audio";
153 };
135 }; 154 };
136 155
137 gpio0: gpio@18100 { 156 gpio0: gpio@18100 {
@@ -196,6 +215,20 @@
196 clocks = <&coreclk 2>; 215 clocks = <&coreclk 2>;
197 }; 216 };
198 217
218 watchdog@20300 {
219 compatible = "marvell,armada-370-wdt";
220 clocks = <&coreclk 2>;
221 };
222
223 audio_controller: audio-controller@30000 {
224 compatible = "marvell,armada370-audio";
225 reg = <0x30000 0x4000>;
226 interrupts = <93>;
227 clocks = <&gateclk 0>;
228 clock-names = "internal";
229 status = "disabled";
230 };
231
199 usb@50000 { 232 usb@50000 {
200 clocks = <&coreclk 0>; 233 clocks = <&coreclk 0>;
201 }; 234 };
diff --git a/arch/arm/boot/dts/armada-375-db.dts b/arch/arm/boot/dts/armada-375-db.dts
new file mode 100644
index 000000000000..9378d3136b41
--- /dev/null
+++ b/arch/arm/boot/dts/armada-375-db.dts
@@ -0,0 +1,130 @@
1/*
2 * Device Tree file for Marvell Armada 375 evaluation board
3 * (DB-88F6720)
4 *
5 * Copyright (C) 2014 Marvell
6 *
7 * Gregory CLEMENT <gregory.clement@free-electrons.com>
8 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
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/dts-v1/;
16#include <dt-bindings/gpio/gpio.h>
17#include "armada-375.dtsi"
18
19/ {
20 model = "Marvell Armada 375 Development Board";
21 compatible = "marvell,a375-db", "marvell,armada375";
22
23 chosen {
24 bootargs = "console=ttyS0,115200 earlyprintk";
25 };
26
27 memory {
28 device_type = "memory";
29 reg = <0x00000000 0x40000000>; /* 1 GB */
30 };
31
32 soc {
33 ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
34 MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000>;
35
36 internal-regs {
37 spi@10600 {
38 pinctrl-0 = <&spi0_pins>;
39 pinctrl-names = "default";
40 /*
41 * SPI conflicts with NAND, so we disable it
42 * here, and select NAND as the enabled device
43 * by default.
44 */
45 status = "disabled";
46
47 spi-flash@0 {
48 #address-cells = <1>;
49 #size-cells = <1>;
50 compatible = "n25q128a13";
51 reg = <0>; /* Chip select 0 */
52 spi-max-frequency = <108000000>;
53 };
54 };
55
56 i2c@11000 {
57 status = "okay";
58 clock-frequency = <100000>;
59 pinctrl-0 = <&i2c0_pins>;
60 pinctrl-names = "default";
61 };
62
63 i2c@11100 {
64 status = "okay";
65 clock-frequency = <100000>;
66 pinctrl-0 = <&i2c1_pins>;
67 pinctrl-names = "default";
68 };
69
70 serial@12000 {
71 clock-frequency = <200000000>;
72 status = "okay";
73 };
74
75 pinctrl {
76 sdio_st_pins: sdio-st-pins {
77 marvell,pins = "mpp44", "mpp45";
78 marvell,function = "gpio";
79 };
80 };
81
82 nand: nand@d0000 {
83 pinctrl-0 = <&nand_pins>;
84 pinctrl-names = "default";
85 status = "okay";
86 num-cs = <1>;
87 marvell,nand-keep-config;
88 marvell,nand-enable-arbiter;
89 nand-on-flash-bbt;
90
91 partition@0 {
92 label = "U-Boot";
93 reg = <0 0x800000>;
94 };
95 partition@800000 {
96 label = "Linux";
97 reg = <0x800000 0x800000>;
98 };
99 partition@1000000 {
100 label = "Filesystem";
101 reg = <0x1000000 0x3f000000>;
102 };
103 };
104
105 mvsdio@d4000 {
106 pinctrl-0 = <&sdio_pins &sdio_st_pins>;
107 pinctrl-names = "default";
108 status = "okay";
109 cd-gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
110 wp-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
111 };
112 };
113
114 pcie-controller {
115 status = "okay";
116 /*
117 * The two PCIe units are accessible through
118 * standard PCIe slots on the board.
119 */
120 pcie@1,0 {
121 /* Port 0, Lane 0 */
122 status = "okay";
123 };
124 pcie@2,0 {
125 /* Port 1, Lane 0 */
126 status = "okay";
127 };
128 };
129 };
130};
diff --git a/arch/arm/boot/dts/armada-375.dtsi b/arch/arm/boot/dts/armada-375.dtsi
new file mode 100644
index 000000000000..3877693fb2d8
--- /dev/null
+++ b/arch/arm/boot/dts/armada-375.dtsi
@@ -0,0 +1,464 @@
1/*
2 * Device Tree Include file for Marvell Armada 375 family SoC
3 *
4 * Copyright (C) 2014 Marvell
5 *
6 * Gregory CLEMENT <gregory.clement@free-electrons.com>
7 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include "skeleton.dtsi"
15#include <dt-bindings/interrupt-controller/arm-gic.h>
16#include <dt-bindings/interrupt-controller/irq.h>
17
18#define MBUS_ID(target,attributes) (((target) << 24) | ((attributes) << 16))
19
20/ {
21 model = "Marvell Armada 375 family SoC";
22 compatible = "marvell,armada375";
23
24 aliases {
25 gpio0 = &gpio0;
26 gpio1 = &gpio1;
27 gpio2 = &gpio2;
28 };
29
30 clocks {
31 /* 2 GHz fixed main PLL */
32 mainpll: mainpll {
33 compatible = "fixed-clock";
34 #clock-cells = <0>;
35 clock-frequency = <2000000000>;
36 };
37 };
38
39 cpus {
40 #address-cells = <1>;
41 #size-cells = <0>;
42 cpu@0 {
43 device_type = "cpu";
44 compatible = "arm,cortex-a9";
45 reg = <0>;
46 };
47 cpu@1 {
48 device_type = "cpu";
49 compatible = "arm,cortex-a9";
50 reg = <1>;
51 };
52 };
53
54 soc {
55 compatible = "marvell,armada375-mbus", "marvell,armada370-mbus", "simple-bus";
56 #address-cells = <2>;
57 #size-cells = <1>;
58 controller = <&mbusc>;
59 interrupt-parent = <&gic>;
60 pcie-mem-aperture = <0xe0000000 0x8000000>;
61 pcie-io-aperture = <0xe8000000 0x100000>;
62
63 bootrom {
64 compatible = "marvell,bootrom";
65 reg = <MBUS_ID(0x01, 0x1d) 0 0x100000>;
66 };
67
68 devbus-bootcs {
69 compatible = "marvell,mvebu-devbus";
70 reg = <MBUS_ID(0xf0, 0x01) 0x10400 0x8>;
71 ranges = <0 MBUS_ID(0x01, 0x2f) 0 0xffffffff>;
72 #address-cells = <1>;
73 #size-cells = <1>;
74 clocks = <&coreclk 0>;
75 status = "disabled";
76 };
77
78 devbus-cs0 {
79 compatible = "marvell,mvebu-devbus";
80 reg = <MBUS_ID(0xf0, 0x01) 0x10408 0x8>;
81 ranges = <0 MBUS_ID(0x01, 0x3e) 0 0xffffffff>;
82 #address-cells = <1>;
83 #size-cells = <1>;
84 clocks = <&coreclk 0>;
85 status = "disabled";
86 };
87
88 devbus-cs1 {
89 compatible = "marvell,mvebu-devbus";
90 reg = <MBUS_ID(0xf0, 0x01) 0x10410 0x8>;
91 ranges = <0 MBUS_ID(0x01, 0x3d) 0 0xffffffff>;
92 #address-cells = <1>;
93 #size-cells = <1>;
94 clocks = <&coreclk 0>;
95 status = "disabled";
96 };
97
98 devbus-cs2 {
99 compatible = "marvell,mvebu-devbus";
100 reg = <MBUS_ID(0xf0, 0x01) 0x10418 0x8>;
101 ranges = <0 MBUS_ID(0x01, 0x3b) 0 0xffffffff>;
102 #address-cells = <1>;
103 #size-cells = <1>;
104 clocks = <&coreclk 0>;
105 status = "disabled";
106 };
107
108 devbus-cs3 {
109 compatible = "marvell,mvebu-devbus";
110 reg = <MBUS_ID(0xf0, 0x01) 0x10420 0x8>;
111 ranges = <0 MBUS_ID(0x01, 0x37) 0 0xffffffff>;
112 #address-cells = <1>;
113 #size-cells = <1>;
114 clocks = <&coreclk 0>;
115 status = "disabled";
116 };
117
118 internal-regs {
119 compatible = "simple-bus";
120 #address-cells = <1>;
121 #size-cells = <1>;
122 ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>;
123
124 L2: cache-controller@8000 {
125 compatible = "arm,pl310-cache";
126 reg = <0x8000 0x1000>;
127 cache-unified;
128 cache-level = <2>;
129 };
130
131 timer@c600 {
132 compatible = "arm,cortex-a9-twd-timer";
133 reg = <0xc600 0x20>;
134 interrupts = <GIC_PPI 13 (IRQ_TYPE_EDGE_RISING | GIC_CPU_MASK_SIMPLE(2))>;
135 clocks = <&coreclk 2>;
136 };
137
138 gic: interrupt-controller@d000 {
139 compatible = "arm,cortex-a9-gic";
140 #interrupt-cells = <3>;
141 #size-cells = <0>;
142 interrupt-controller;
143 reg = <0xd000 0x1000>,
144 <0xc100 0x100>;
145 };
146
147 spi0: spi@10600 {
148 compatible = "marvell,orion-spi";
149 reg = <0x10600 0x50>;
150 #address-cells = <1>;
151 #size-cells = <0>;
152 cell-index = <0>;
153 interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
154 clocks = <&coreclk 0>;
155 status = "disabled";
156 };
157
158 spi1: spi@10680 {
159 compatible = "marvell,orion-spi";
160 reg = <0x10680 0x50>;
161 #address-cells = <1>;
162 #size-cells = <0>;
163 cell-index = <1>;
164 interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>;
165 clocks = <&coreclk 0>;
166 status = "disabled";
167 };
168
169 i2c0: i2c@11000 {
170 compatible = "marvell,mv64xxx-i2c";
171 reg = <0x11000 0x20>;
172 #address-cells = <1>;
173 #size-cells = <0>;
174 interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
175 timeout-ms = <1000>;
176 clocks = <&coreclk 0>;
177 status = "disabled";
178 };
179
180 i2c1: i2c@11100 {
181 compatible = "marvell,mv64xxx-i2c";
182 reg = <0x11100 0x20>;
183 #address-cells = <1>;
184 #size-cells = <0>;
185 interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
186 timeout-ms = <1000>;
187 clocks = <&coreclk 0>;
188 status = "disabled";
189 };
190
191 serial@12000 {
192 compatible = "snps,dw-apb-uart";
193 reg = <0x12000 0x100>;
194 reg-shift = <2>;
195 interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
196 reg-io-width = <1>;
197 status = "disabled";
198 };
199
200 serial@12100 {
201 compatible = "snps,dw-apb-uart";
202 reg = <0x12100 0x100>;
203 reg-shift = <2>;
204 interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
205 reg-io-width = <1>;
206 status = "disabled";
207 };
208
209 pinctrl {
210 compatible = "marvell,mv88f6720-pinctrl";
211 reg = <0x18000 0x24>;
212
213 i2c0_pins: i2c0-pins {
214 marvell,pins = "mpp14", "mpp15";
215 marvell,function = "i2c0";
216 };
217
218 i2c1_pins: i2c1-pins {
219 marvell,pins = "mpp61", "mpp62";
220 marvell,function = "i2c1";
221 };
222
223 nand_pins: nand-pins {
224 marvell,pins = "mpp0", "mpp1", "mpp2",
225 "mpp3", "mpp4", "mpp5",
226 "mpp6", "mpp7", "mpp8",
227 "mpp9", "mpp10", "mpp11",
228 "mpp12", "mpp13";
229 marvell,function = "nand";
230 };
231
232 sdio_pins: sdio-pins {
233 marvell,pins = "mpp24", "mpp25", "mpp26",
234 "mpp27", "mpp28", "mpp29";
235 marvell,function = "sd";
236 };
237
238 spi0_pins: spi0-pins {
239 marvell,pins = "mpp0", "mpp1", "mpp4",
240 "mpp5", "mpp8", "mpp9";
241 marvell,function = "spi0";
242 };
243 };
244
245 gpio0: gpio@18100 {
246 compatible = "marvell,orion-gpio";
247 reg = <0x18100 0x40>;
248 ngpios = <32>;
249 gpio-controller;
250 #gpio-cells = <2>;
251 interrupt-controller;
252 #interrupt-cells = <2>;
253 interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>,
254 <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>,
255 <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>,
256 <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>;
257 };
258
259 gpio1: gpio@18140 {
260 compatible = "marvell,orion-gpio";
261 reg = <0x18140 0x40>;
262 ngpios = <32>;
263 gpio-controller;
264 #gpio-cells = <2>;
265 interrupt-controller;
266 #interrupt-cells = <2>;
267 interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>,
268 <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>,
269 <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>,
270 <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
271 };
272
273 gpio2: gpio@18180 {
274 compatible = "marvell,orion-gpio";
275 reg = <0x18180 0x40>;
276 ngpios = <3>;
277 gpio-controller;
278 #gpio-cells = <2>;
279 interrupt-controller;
280 #interrupt-cells = <2>;
281 interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
282 };
283
284 system-controller@18200 {
285 compatible = "marvell,armada-375-system-controller";
286 reg = <0x18200 0x100>;
287 };
288
289 gateclk: clock-gating-control@18220 {
290 compatible = "marvell,armada-375-gating-clock";
291 reg = <0x18220 0x4>;
292 clocks = <&coreclk 0>;
293 #clock-cells = <1>;
294 };
295
296 mbusc: mbus-controller@20000 {
297 compatible = "marvell,mbus-controller";
298 reg = <0x20000 0x100>, <0x20180 0x20>;
299 };
300
301 mpic: interrupt-controller@20000 {
302 compatible = "marvell,mpic";
303 reg = <0x20a00 0x2d0>, <0x21070 0x58>;
304 #interrupt-cells = <1>;
305 #size-cells = <1>;
306 interrupt-controller;
307 msi-controller;
308 interrupts = <GIC_PPI 15 IRQ_TYPE_LEVEL_HIGH>;
309 };
310
311 timer@20300 {
312 compatible = "marvell,armada-375-timer", "marvell,armada-370-timer";
313 reg = <0x20300 0x30>, <0x21040 0x30>;
314 interrupts-extended = <&gic GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
315 <&gic GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
316 <&gic GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
317 <&gic GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
318 <&mpic 5>,
319 <&mpic 6>;
320 clocks = <&coreclk 0>;
321 };
322
323 xor@60800 {
324 compatible = "marvell,orion-xor";
325 reg = <0x60800 0x100
326 0x60A00 0x100>;
327 clocks = <&gateclk 22>;
328 status = "okay";
329
330 xor00 {
331 interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
332 dmacap,memcpy;
333 dmacap,xor;
334 };
335 xor01 {
336 interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
337 dmacap,memcpy;
338 dmacap,xor;
339 dmacap,memset;
340 };
341 };
342
343 xor@60900 {
344 compatible = "marvell,orion-xor";
345 reg = <0x60900 0x100
346 0x60b00 0x100>;
347 clocks = <&gateclk 23>;
348 status = "okay";
349
350 xor10 {
351 interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
352 dmacap,memcpy;
353 dmacap,xor;
354 };
355 xor11 {
356 interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>;
357 dmacap,memcpy;
358 dmacap,xor;
359 dmacap,memset;
360 };
361 };
362
363 sata@a0000 {
364 compatible = "marvell,orion-sata";
365 reg = <0xa0000 0x5000>;
366 interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
367 clocks = <&gateclk 14>, <&gateclk 20>;
368 clock-names = "0", "1";
369 status = "disabled";
370 };
371
372 nand@d0000 {
373 compatible = "marvell,armada370-nand";
374 reg = <0xd0000 0x54>;
375 #address-cells = <1>;
376 #size-cells = <1>;
377 interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
378 clocks = <&gateclk 11>;
379 status = "disabled";
380 };
381
382 mvsdio@d4000 {
383 compatible = "marvell,orion-sdio";
384 reg = <0xd4000 0x200>;
385 interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
386 clocks = <&gateclk 17>;
387 bus-width = <4>;
388 cap-sdio-irq;
389 cap-sd-highspeed;
390 cap-mmc-highspeed;
391 status = "disabled";
392 };
393
394 coreclk: mvebu-sar@e8204 {
395 compatible = "marvell,armada-375-core-clock";
396 reg = <0xe8204 0x04>;
397 #clock-cells = <1>;
398 };
399
400 coredivclk: corediv-clock@e8250 {
401 compatible = "marvell,armada-375-corediv-clock";
402 reg = <0xe8250 0xc>;
403 #clock-cells = <1>;
404 clocks = <&mainpll>;
405 clock-output-names = "nand";
406 };
407 };
408
409 pcie-controller {
410 compatible = "marvell,armada-370-pcie";
411 status = "disabled";
412 device_type = "pci";
413
414 #address-cells = <3>;
415 #size-cells = <2>;
416
417 msi-parent = <&mpic>;
418 bus-range = <0x00 0xff>;
419
420 ranges =
421 <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000
422 0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000
423 0x82000000 0x1 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0 MEM */
424 0x81000000 0x1 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0 IO */
425 0x82000000 0x2 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 1 MEM */
426 0x81000000 0x2 0 MBUS_ID(0x04, 0xd0) 0 1 0 /* Port 1 IO */>;
427
428 pcie@1,0 {
429 device_type = "pci";
430 assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
431 reg = <0x0800 0 0 0 0>;
432 #address-cells = <3>;
433 #size-cells = <2>;
434 #interrupt-cells = <1>;
435 ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0
436 0x81000000 0 0 0x81000000 0x1 0 1 0>;
437 interrupt-map-mask = <0 0 0 0>;
438 interrupt-map = <0 0 0 0 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
439 marvell,pcie-port = <0>;
440 marvell,pcie-lane = <0>;
441 clocks = <&gateclk 5>;
442 status = "disabled";
443 };
444
445 pcie@2,0 {
446 device_type = "pci";
447 assigned-addresses = <0x82000800 0 0x44000 0 0x2000>;
448 reg = <0x1000 0 0 0 0>;
449 #address-cells = <3>;
450 #size-cells = <2>;
451 #interrupt-cells = <1>;
452 ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0
453 0x81000000 0 0 0x81000000 0x2 0 1 0>;
454 interrupt-map-mask = <0 0 0 0>;
455 interrupt-map = <0 0 0 0 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
456 marvell,pcie-port = <0>;
457 marvell,pcie-lane = <1>;
458 clocks = <&gateclk 6>;
459 status = "disabled";
460 };
461
462 };
463 };
464};
diff --git a/arch/arm/boot/dts/armada-380.dtsi b/arch/arm/boot/dts/armada-380.dtsi
new file mode 100644
index 000000000000..068031f0f263
--- /dev/null
+++ b/arch/arm/boot/dts/armada-380.dtsi
@@ -0,0 +1,117 @@
1/*
2 * Device Tree Include file for Marvell Armada 380 SoC.
3 *
4 * Copyright (C) 2014 Marvell
5 *
6 * Lior Amsalem <alior@marvell.com>
7 * Gregory CLEMENT <gregory.clement@free-electrons.com>
8 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
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 "armada-38x.dtsi"
16
17/ {
18 model = "Marvell Armada 380 family SoC";
19 compatible = "marvell,armada380", "marvell,armada38x";
20
21 cpus {
22 #address-cells = <1>;
23 #size-cells = <0>;
24 cpu@0 {
25 device_type = "cpu";
26 compatible = "arm,cortex-a9";
27 reg = <0>;
28 };
29 };
30
31 soc {
32 internal-regs {
33 pinctrl {
34 compatible = "marvell,mv88f6810-pinctrl";
35 reg = <0x18000 0x20>;
36 };
37 };
38
39 pcie-controller {
40 compatible = "marvell,armada-370-pcie";
41 status = "disabled";
42 device_type = "pci";
43
44 #address-cells = <3>;
45 #size-cells = <2>;
46
47 msi-parent = <&mpic>;
48 bus-range = <0x00 0xff>;
49
50 ranges =
51 <0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000
52 0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000
53 0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000
54 0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000
55 0x82000000 0x1 0 MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 0 MEM */
56 0x81000000 0x1 0 MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 0 IO */
57 0x82000000 0x2 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 1 MEM */
58 0x81000000 0x2 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 1 IO */
59 0x82000000 0x3 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 2 MEM */
60 0x81000000 0x3 0 MBUS_ID(0x04, 0xd0) 0 1 0 /* Port 2 IO */>;
61
62 /* x1 port */
63 pcie@1,0 {
64 device_type = "pci";
65 assigned-addresses = <0x82000800 0 0x80000 0 0x2000>;
66 reg = <0x0800 0 0 0 0>;
67 #address-cells = <3>;
68 #size-cells = <2>;
69 #interrupt-cells = <1>;
70 ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0
71 0x81000000 0 0 0x81000000 0x1 0 1 0>;
72 interrupt-map-mask = <0 0 0 0>;
73 interrupt-map = <0 0 0 0 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
74 marvell,pcie-port = <0>;
75 marvell,pcie-lane = <0>;
76 clocks = <&gateclk 8>;
77 status = "disabled";
78 };
79
80 /* x1 port */
81 pcie@2,0 {
82 device_type = "pci";
83 assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
84 reg = <0x1000 0 0 0 0>;
85 #address-cells = <3>;
86 #size-cells = <2>;
87 #interrupt-cells = <1>;
88 ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0
89 0x81000000 0 0 0x81000000 0x2 0 1 0>;
90 interrupt-map-mask = <0 0 0 0>;
91 interrupt-map = <0 0 0 0 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
92 marvell,pcie-port = <1>;
93 marvell,pcie-lane = <0>;
94 clocks = <&gateclk 5>;
95 status = "disabled";
96 };
97
98 /* x1 port */
99 pcie@3,0 {
100 device_type = "pci";
101 assigned-addresses = <0x82000800 0 0x44000 0 0x2000>;
102 reg = <0x1000 0 0 0 0>;
103 #address-cells = <3>;
104 #size-cells = <2>;
105 #interrupt-cells = <1>;
106 ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0
107 0x81000000 0 0 0x81000000 0x3 0 1 0>;
108 interrupt-map-mask = <0 0 0 0>;
109 interrupt-map = <0 0 0 0 &gic GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>;
110 marvell,pcie-port = <2>;
111 marvell,pcie-lane = <0>;
112 clocks = <&gateclk 6>;
113 status = "disabled";
114 };
115 };
116 };
117};
diff --git a/arch/arm/boot/dts/armada-385-db.dts b/arch/arm/boot/dts/armada-385-db.dts
new file mode 100644
index 000000000000..6828d77696a6
--- /dev/null
+++ b/arch/arm/boot/dts/armada-385-db.dts
@@ -0,0 +1,122 @@
1/*
2 * Device Tree file for Marvell Armada 385 evaluation board
3 * (DB-88F6820)
4 *
5 * Copyright (C) 2014 Marvell
6 *
7 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14/dts-v1/;
15#include "armada-385.dtsi"
16
17/ {
18 model = "Marvell Armada 385 Development Board";
19 compatible = "marvell,a385-db", "marvell,armada385", "marvell,armada38x";
20
21 chosen {
22 bootargs = "console=ttyS0,115200 earlyprintk";
23 };
24
25 memory {
26 device_type = "memory";
27 reg = <0x00000000 0x10000000>; /* 256 MB */
28 };
29
30 soc {
31 ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
32 MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000>;
33
34 internal-regs {
35 spi@10600 {
36 status = "okay";
37
38 spi-flash@0 {
39 #address-cells = <1>;
40 #size-cells = <1>;
41 compatible = "w25q32";
42 reg = <0>; /* Chip select 0 */
43 spi-max-frequency = <108000000>;
44 };
45 };
46
47 i2c@11000 {
48 status = "okay";
49 clock-frequency = <100000>;
50 };
51
52 i2c@11100 {
53 status = "okay";
54 clock-frequency = <100000>;
55 };
56
57 serial@12000 {
58 clock-frequency = <200000000>;
59 status = "okay";
60 };
61
62 ethernet@30000 {
63 status = "okay";
64 phy = <&phy1>;
65 phy-mode = "rgmii-id";
66 };
67
68 ethernet@70000 {
69 status = "okay";
70 phy = <&phy0>;
71 phy-mode = "rgmii-id";
72 };
73
74 mdio {
75 phy0: ethernet-phy@0 {
76 reg = <0>;
77 };
78
79 phy1: ethernet-phy@1 {
80 reg = <1>;
81 };
82 };
83
84 flash@d0000 {
85 status = "okay";
86 num-cs = <1>;
87 marvell,nand-keep-config;
88 marvell,nand-enable-arbiter;
89 nand-on-flash-bbt;
90
91 partition@0 {
92 label = "U-Boot";
93 reg = <0 0x800000>;
94 };
95 partition@800000 {
96 label = "Linux";
97 reg = <0x800000 0x800000>;
98 };
99 partition@1000000 {
100 label = "Filesystem";
101 reg = <0x1000000 0x3f000000>;
102 };
103 };
104 };
105
106 pcie-controller {
107 status = "okay";
108 /*
109 * The two PCIe units are accessible through
110 * standard PCIe slots on the board.
111 */
112 pcie@1,0 {
113 /* Port 0, Lane 0 */
114 status = "okay";
115 };
116 pcie@2,0 {
117 /* Port 1, Lane 0 */
118 status = "okay";
119 };
120 };
121 };
122};
diff --git a/arch/arm/boot/dts/armada-385-rd.dts b/arch/arm/boot/dts/armada-385-rd.dts
new file mode 100644
index 000000000000..45250c88814b
--- /dev/null
+++ b/arch/arm/boot/dts/armada-385-rd.dts
@@ -0,0 +1,94 @@
1/*
2 * Device Tree file for Marvell Armada 385 Reference Design board
3 * (RD-88F6820-AP)
4 *
5 * Copyright (C) 2014 Marvell
6 *
7 * Gregory CLEMENT <gregory.clement@free-electrons.com>
8 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
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/dts-v1/;
16#include "armada-385.dtsi"
17
18/ {
19 model = "Marvell Armada 385 Reference Design";
20 compatible = "marvell,a385-rd", "marvell,armada385", "marvell,armada38x";
21
22 chosen {
23 bootargs = "console=ttyS0,115200 earlyprintk";
24 };
25
26 memory {
27 device_type = "memory";
28 reg = <0x00000000 0x10000000>; /* 256 MB */
29 };
30
31 soc {
32 ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
33 MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000>;
34
35 internal-regs {
36 spi@10600 {
37 status = "okay";
38
39 spi-flash@0 {
40 #address-cells = <1>;
41 #size-cells = <1>;
42 compatible = "st,m25p128";
43 reg = <0>; /* Chip select 0 */
44 spi-max-frequency = <108000000>;
45 };
46 };
47
48 i2c@11000 {
49 status = "okay";
50 clock-frequency = <100000>;
51 };
52
53 serial@12000 {
54 clock-frequency = <200000000>;
55 status = "okay";
56 };
57
58 ethernet@30000 {
59 status = "okay";
60 phy = <&phy0>;
61 phy-mode = "rgmii-id";
62 };
63
64 ethernet@70000 {
65 status = "okay";
66 phy = <&phy1>;
67 phy-mode = "rgmii-id";
68 };
69
70
71 mdio {
72 phy0: ethernet-phy@0 {
73 reg = <0>;
74 };
75
76 phy1: ethernet-phy@1 {
77 reg = <1>;
78 };
79 };
80 };
81
82 pcie-controller {
83 status = "okay";
84 /*
85 * One PCIe units is accessible through
86 * standard PCIe slot on the board.
87 */
88 pcie@1,0 {
89 /* Port 0, Lane 0 */
90 status = "okay";
91 };
92 };
93 };
94};
diff --git a/arch/arm/boot/dts/armada-385.dtsi b/arch/arm/boot/dts/armada-385.dtsi
new file mode 100644
index 000000000000..e2919f02e1d4
--- /dev/null
+++ b/arch/arm/boot/dts/armada-385.dtsi
@@ -0,0 +1,149 @@
1/*
2 * Device Tree Include file for Marvell Armada 385 SoC.
3 *
4 * Copyright (C) 2014 Marvell
5 *
6 * Lior Amsalem <alior@marvell.com>
7 * Gregory CLEMENT <gregory.clement@free-electrons.com>
8 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
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 "armada-38x.dtsi"
16
17/ {
18 model = "Marvell Armada 385 family SoC";
19 compatible = "marvell,armada385", "marvell,armada38x";
20
21 cpus {
22 #address-cells = <1>;
23 #size-cells = <0>;
24 cpu@0 {
25 device_type = "cpu";
26 compatible = "arm,cortex-a9";
27 reg = <0>;
28 };
29 cpu@1 {
30 device_type = "cpu";
31 compatible = "arm,cortex-a9";
32 reg = <1>;
33 };
34 };
35
36 soc {
37 internal-regs {
38 pinctrl {
39 compatible = "marvell,mv88f6820-pinctrl";
40 reg = <0x18000 0x20>;
41 };
42 };
43
44 pcie-controller {
45 compatible = "marvell,armada-370-pcie";
46 status = "disabled";
47 device_type = "pci";
48
49 #address-cells = <3>;
50 #size-cells = <2>;
51
52 msi-parent = <&mpic>;
53 bus-range = <0x00 0xff>;
54
55 ranges =
56 <0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000
57 0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000
58 0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000
59 0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000
60 0x82000000 0x1 0 MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 0 MEM */
61 0x81000000 0x1 0 MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 0 IO */
62 0x82000000 0x2 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 1 MEM */
63 0x81000000 0x2 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 1 IO */
64 0x82000000 0x3 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 2 MEM */
65 0x81000000 0x3 0 MBUS_ID(0x04, 0xd0) 0 1 0 /* Port 2 IO */
66 0x82000000 0x4 0 MBUS_ID(0x04, 0xb8) 0 1 0 /* Port 3 MEM */
67 0x81000000 0x4 0 MBUS_ID(0x04, 0xb0) 0 1 0 /* Port 3 IO */>;
68
69 /*
70 * This port can be either x4 or x1. When
71 * configured in x4 by the bootloader, then
72 * pcie@4,0 is not available.
73 */
74 pcie@1,0 {
75 device_type = "pci";
76 assigned-addresses = <0x82000800 0 0x80000 0 0x2000>;
77 reg = <0x0800 0 0 0 0>;
78 #address-cells = <3>;
79 #size-cells = <2>;
80 #interrupt-cells = <1>;
81 ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0
82 0x81000000 0 0 0x81000000 0x1 0 1 0>;
83 interrupt-map-mask = <0 0 0 0>;
84 interrupt-map = <0 0 0 0 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
85 marvell,pcie-port = <0>;
86 marvell,pcie-lane = <0>;
87 clocks = <&gateclk 8>;
88 status = "disabled";
89 };
90
91 /* x1 port */
92 pcie@2,0 {
93 device_type = "pci";
94 assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
95 reg = <0x1000 0 0 0 0>;
96 #address-cells = <3>;
97 #size-cells = <2>;
98 #interrupt-cells = <1>;
99 ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0
100 0x81000000 0 0 0x81000000 0x2 0 1 0>;
101 interrupt-map-mask = <0 0 0 0>;
102 interrupt-map = <0 0 0 0 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
103 marvell,pcie-port = <1>;
104 marvell,pcie-lane = <0>;
105 clocks = <&gateclk 5>;
106 status = "disabled";
107 };
108
109 /* x1 port */
110 pcie@3,0 {
111 device_type = "pci";
112 assigned-addresses = <0x82000800 0 0x44000 0 0x2000>;
113 reg = <0x1000 0 0 0 0>;
114 #address-cells = <3>;
115 #size-cells = <2>;
116 #interrupt-cells = <1>;
117 ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0
118 0x81000000 0 0 0x81000000 0x3 0 1 0>;
119 interrupt-map-mask = <0 0 0 0>;
120 interrupt-map = <0 0 0 0 &gic GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>;
121 marvell,pcie-port = <2>;
122 marvell,pcie-lane = <0>;
123 clocks = <&gateclk 6>;
124 status = "disabled";
125 };
126
127 /*
128 * x1 port only available when pcie@1,0 is
129 * configured as a x1 port
130 */
131 pcie@4,0 {
132 device_type = "pci";
133 assigned-addresses = <0x82000800 0 0x48000 0 0x2000>;
134 reg = <0x1000 0 0 0 0>;
135 #address-cells = <3>;
136 #size-cells = <2>;
137 #interrupt-cells = <1>;
138 ranges = <0x82000000 0 0 0x82000000 0x4 0 1 0
139 0x81000000 0 0 0x81000000 0x4 0 1 0>;
140 interrupt-map-mask = <0 0 0 0>;
141 interrupt-map = <0 0 0 0 &gic GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
142 marvell,pcie-port = <3>;
143 marvell,pcie-lane = <0>;
144 clocks = <&gateclk 7>;
145 status = "disabled";
146 };
147 };
148 };
149};
diff --git a/arch/arm/boot/dts/armada-38x.dtsi b/arch/arm/boot/dts/armada-38x.dtsi
new file mode 100644
index 000000000000..a064f59da02d
--- /dev/null
+++ b/arch/arm/boot/dts/armada-38x.dtsi
@@ -0,0 +1,376 @@
1/*
2 * Device Tree Include file for Marvell Armada 38x family of SoCs.
3 *
4 * Copyright (C) 2014 Marvell
5 *
6 * Lior Amsalem <alior@marvell.com>
7 * Gregory CLEMENT <gregory.clement@free-electrons.com>
8 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
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 "skeleton.dtsi"
16#include <dt-bindings/interrupt-controller/arm-gic.h>
17#include <dt-bindings/interrupt-controller/irq.h>
18
19#define MBUS_ID(target,attributes) (((target) << 24) | ((attributes) << 16))
20
21/ {
22 model = "Marvell Armada 38x family SoC";
23 compatible = "marvell,armada38x";
24
25 aliases {
26 gpio0 = &gpio0;
27 gpio1 = &gpio1;
28 eth0 = &eth0;
29 eth1 = &eth1;
30 eth2 = &eth2;
31 };
32
33 soc {
34 compatible = "marvell,armada380-mbus", "marvell,armada370-mbus",
35 "simple-bus";
36 #address-cells = <2>;
37 #size-cells = <1>;
38 controller = <&mbusc>;
39 interrupt-parent = <&gic>;
40 pcie-mem-aperture = <0xe0000000 0x8000000>;
41 pcie-io-aperture = <0xe8000000 0x100000>;
42
43 bootrom {
44 compatible = "marvell,bootrom";
45 reg = <MBUS_ID(0x01, 0x1d) 0 0x200000>;
46 };
47
48 devbus-bootcs {
49 compatible = "marvell,mvebu-devbus";
50 reg = <MBUS_ID(0xf0, 0x01) 0x10400 0x8>;
51 ranges = <0 MBUS_ID(0x01, 0x2f) 0 0xffffffff>;
52 #address-cells = <1>;
53 #size-cells = <1>;
54 clocks = <&coreclk 0>;
55 status = "disabled";
56 };
57
58 devbus-cs0 {
59 compatible = "marvell,mvebu-devbus";
60 reg = <MBUS_ID(0xf0, 0x01) 0x10408 0x8>;
61 ranges = <0 MBUS_ID(0x01, 0x3e) 0 0xffffffff>;
62 #address-cells = <1>;
63 #size-cells = <1>;
64 clocks = <&coreclk 0>;
65 status = "disabled";
66 };
67
68 devbus-cs1 {
69 compatible = "marvell,mvebu-devbus";
70 reg = <MBUS_ID(0xf0, 0x01) 0x10410 0x8>;
71 ranges = <0 MBUS_ID(0x01, 0x3d) 0 0xffffffff>;
72 #address-cells = <1>;
73 #size-cells = <1>;
74 clocks = <&coreclk 0>;
75 status = "disabled";
76 };
77
78 devbus-cs2 {
79 compatible = "marvell,mvebu-devbus";
80 reg = <MBUS_ID(0xf0, 0x01) 0x10418 0x8>;
81 ranges = <0 MBUS_ID(0x01, 0x3b) 0 0xffffffff>;
82 #address-cells = <1>;
83 #size-cells = <1>;
84 clocks = <&coreclk 0>;
85 status = "disabled";
86 };
87
88 devbus-cs3 {
89 compatible = "marvell,mvebu-devbus";
90 reg = <MBUS_ID(0xf0, 0x01) 0x10420 0x8>;
91 ranges = <0 MBUS_ID(0x01, 0x37) 0 0xffffffff>;
92 #address-cells = <1>;
93 #size-cells = <1>;
94 clocks = <&coreclk 0>;
95 status = "disabled";
96 };
97
98 internal-regs {
99 compatible = "simple-bus";
100 #address-cells = <1>;
101 #size-cells = <1>;
102 ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>;
103
104 L2: cache-controller@8000 {
105 compatible = "arm,pl310-cache";
106 reg = <0x8000 0x1000>;
107 cache-unified;
108 cache-level = <2>;
109 };
110
111 timer@c600 {
112 compatible = "arm,cortex-a9-twd-timer";
113 reg = <0xc600 0x20>;
114 interrupts = <GIC_PPI 13 (IRQ_TYPE_EDGE_RISING | GIC_CPU_MASK_SIMPLE(2))>;
115 clocks = <&coreclk 2>;
116 };
117
118 gic: interrupt-controller@d000 {
119 compatible = "arm,cortex-a9-gic";
120 #interrupt-cells = <3>;
121 #size-cells = <0>;
122 interrupt-controller;
123 reg = <0xd000 0x1000>,
124 <0xc100 0x100>;
125 };
126
127 spi0: spi@10600 {
128 compatible = "marvell,orion-spi";
129 reg = <0x10600 0x50>;
130 #address-cells = <1>;
131 #size-cells = <0>;
132 cell-index = <0>;
133 interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
134 clocks = <&coreclk 0>;
135 status = "disabled";
136 };
137
138 spi1: spi@10680 {
139 compatible = "marvell,orion-spi";
140 reg = <0x10680 0x50>;
141 #address-cells = <1>;
142 #size-cells = <0>;
143 cell-index = <1>;
144 interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>;
145 clocks = <&coreclk 0>;
146 status = "disabled";
147 };
148
149 i2c0: i2c@11000 {
150 compatible = "marvell,mv64xxx-i2c";
151 reg = <0x11000 0x20>;
152 #address-cells = <1>;
153 #size-cells = <0>;
154 interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
155 timeout-ms = <1000>;
156 clocks = <&coreclk 0>;
157 status = "disabled";
158 };
159
160 i2c1: i2c@11100 {
161 compatible = "marvell,mv64xxx-i2c";
162 reg = <0x11100 0x20>;
163 #address-cells = <1>;
164 #size-cells = <0>;
165 interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
166 timeout-ms = <1000>;
167 clocks = <&coreclk 0>;
168 status = "disabled";
169 };
170
171 serial@12000 {
172 compatible = "snps,dw-apb-uart";
173 reg = <0x12000 0x100>;
174 reg-shift = <2>;
175 interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
176 reg-io-width = <1>;
177 status = "disabled";
178 };
179
180 serial@12100 {
181 compatible = "snps,dw-apb-uart";
182 reg = <0x12100 0x100>;
183 reg-shift = <2>;
184 interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
185 reg-io-width = <1>;
186 status = "disabled";
187 };
188
189 pinctrl {
190 compatible = "marvell,mv88f6820-pinctrl";
191 reg = <0x18000 0x20>;
192 };
193
194 gpio0: gpio@18100 {
195 compatible = "marvell,orion-gpio";
196 reg = <0x18100 0x40>;
197 ngpios = <32>;
198 gpio-controller;
199 #gpio-cells = <2>;
200 interrupt-controller;
201 #interrupt-cells = <2>;
202 interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>,
203 <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>,
204 <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>,
205 <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>;
206 };
207
208 gpio1: gpio@18140 {
209 compatible = "marvell,orion-gpio";
210 reg = <0x18140 0x40>;
211 ngpios = <28>;
212 gpio-controller;
213 #gpio-cells = <2>;
214 interrupt-controller;
215 #interrupt-cells = <2>;
216 interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>,
217 <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>,
218 <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>,
219 <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
220 };
221
222 system-controller@18200 {
223 compatible = "marvell,armada-380-system-controller",
224 "marvell,armada-370-xp-system-controller";
225 reg = <0x18200 0x100>;
226 };
227
228 gateclk: clock-gating-control@18220 {
229 compatible = "marvell,armada-380-gating-clock";
230 reg = <0x18220 0x4>;
231 clocks = <&coreclk 0>;
232 #clock-cells = <1>;
233 };
234
235 coreclk: mvebu-sar@18600 {
236 compatible = "marvell,armada-380-core-clock";
237 reg = <0x18600 0x04>;
238 #clock-cells = <1>;
239 };
240
241 mbusc: mbus-controller@20000 {
242 compatible = "marvell,mbus-controller";
243 reg = <0x20000 0x100>, <0x20180 0x20>;
244 };
245
246 mpic: interrupt-controller@20000 {
247 compatible = "marvell,mpic";
248 reg = <0x20a00 0x2d0>, <0x21070 0x58>;
249 #interrupt-cells = <1>;
250 #size-cells = <1>;
251 interrupt-controller;
252 msi-controller;
253 interrupts = <GIC_PPI 15 IRQ_TYPE_LEVEL_HIGH>;
254 };
255
256 timer@20300 {
257 compatible = "marvell,armada-380-timer",
258 "marvell,armada-xp-timer";
259 reg = <0x20300 0x30>, <0x21040 0x30>;
260 interrupts-extended = <&gic GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
261 <&gic GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
262 <&gic GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
263 <&gic GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
264 <&mpic 5>,
265 <&mpic 6>;
266 clocks = <&coreclk 2>, <&refclk>;
267 clock-names = "nbclk", "fixed";
268 };
269
270 eth1: ethernet@30000 {
271 compatible = "marvell,armada-370-neta";
272 reg = <0x30000 0x4000>;
273 interrupts-extended = <&mpic 10>;
274 clocks = <&gateclk 3>;
275 status = "disabled";
276 };
277
278 eth2: ethernet@34000 {
279 compatible = "marvell,armada-370-neta";
280 reg = <0x34000 0x4000>;
281 interrupts-extended = <&mpic 12>;
282 clocks = <&gateclk 2>;
283 status = "disabled";
284 };
285
286 xor@60800 {
287 compatible = "marvell,orion-xor";
288 reg = <0x60800 0x100
289 0x60a00 0x100>;
290 clocks = <&gateclk 22>;
291 status = "okay";
292
293 xor00 {
294 interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
295 dmacap,memcpy;
296 dmacap,xor;
297 };
298 xor01 {
299 interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
300 dmacap,memcpy;
301 dmacap,xor;
302 dmacap,memset;
303 };
304 };
305
306 xor@60900 {
307 compatible = "marvell,orion-xor";
308 reg = <0x60900 0x100
309 0x60b00 0x100>;
310 clocks = <&gateclk 28>;
311 status = "okay";
312
313 xor10 {
314 interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
315 dmacap,memcpy;
316 dmacap,xor;
317 };
318 xor11 {
319 interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>;
320 dmacap,memcpy;
321 dmacap,xor;
322 dmacap,memset;
323 };
324 };
325
326 eth0: ethernet@70000 {
327 compatible = "marvell,armada-370-neta";
328 reg = <0x70000 0x4000>;
329 interrupts-extended = <&mpic 8>;
330 clocks = <&gateclk 4>;
331 status = "disabled";
332 };
333
334 mdio {
335 #address-cells = <1>;
336 #size-cells = <0>;
337 compatible = "marvell,orion-mdio";
338 reg = <0x72004 0x4>;
339 };
340
341 coredivclk: clock@e4250 {
342 compatible = "marvell,armada-380-corediv-clock";
343 reg = <0xe4250 0xc>;
344 #clock-cells = <1>;
345 clocks = <&mainpll>;
346 clock-output-names = "nand";
347 };
348
349 flash@d0000 {
350 compatible = "marvell,armada370-nand";
351 reg = <0xd0000 0x54>;
352 #address-cells = <1>;
353 #size-cells = <1>;
354 interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
355 clocks = <&coredivclk 0>;
356 status = "disabled";
357 };
358 };
359 };
360
361 clocks {
362 /* 2 GHz fixed main PLL */
363 mainpll: mainpll {
364 compatible = "fixed-clock";
365 #clock-cells = <0>;
366 clock-frequency = <2000000000>;
367 };
368
369 /* 25 MHz reference crystal */
370 refclk: oscillator {
371 compatible = "fixed-clock";
372 #clock-cells = <0>;
373 clock-frequency = <25000000>;
374 };
375 };
376};
diff --git a/arch/arm/boot/dts/armada-xp-axpwifiap.dts b/arch/arm/boot/dts/armada-xp-axpwifiap.dts
index c5fe57269f5a..d83d7d69ac01 100644
--- a/arch/arm/boot/dts/armada-xp-axpwifiap.dts
+++ b/arch/arm/boot/dts/armada-xp-axpwifiap.dts
@@ -16,6 +16,8 @@
16 */ 16 */
17 17
18/dts-v1/; 18/dts-v1/;
19#include <dt-bindings/gpio/gpio.h>
20#include <dt-bindings/input/input.h>
19#include "armada-xp-mv78230.dtsi" 21#include "armada-xp-mv78230.dtsi"
20 22
21/ { 23/ {
@@ -157,8 +159,8 @@
157 159
158 button@1 { 160 button@1 {
159 label = "Factory Reset Button"; 161 label = "Factory Reset Button";
160 linux,code = <141>; /* KEY_SETUP */ 162 linux,code = <KEY_SETUP>;
161 gpios = <&gpio1 1 1>; 163 gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
162 }; 164 };
163 }; 165 };
164}; 166};
diff --git a/arch/arm/boot/dts/armada-xp-db.dts b/arch/arm/boot/dts/armada-xp-db.dts
index bcf6d79a57ec..448373c4b0e5 100644
--- a/arch/arm/boot/dts/armada-xp-db.dts
+++ b/arch/arm/boot/dts/armada-xp-db.dts
@@ -2,7 +2,7 @@
2 * Device Tree file for Marvell Armada XP evaluation board 2 * Device Tree file for Marvell Armada XP evaluation board
3 * (DB-78460-BP) 3 * (DB-78460-BP)
4 * 4 *
5 * Copyright (C) 2012 Marvell 5 * Copyright (C) 2012-2014 Marvell
6 * 6 *
7 * Lior Amsalem <alior@marvell.com> 7 * Lior Amsalem <alior@marvell.com>
8 * Gregory CLEMENT <gregory.clement@free-electrons.com> 8 * Gregory CLEMENT <gregory.clement@free-electrons.com>
@@ -11,6 +11,15 @@
11 * This file is licensed under the terms of the GNU General Public 11 * This file is licensed under the terms of the GNU General Public
12 * License version 2. This program is licensed "as is" without any 12 * License version 2. This program is licensed "as is" without any
13 * warranty of any kind, whether express or implied. 13 * warranty of any kind, whether express or implied.
14 *
15 * Note: this Device Tree assumes that the bootloader has remapped the
16 * internal registers to 0xf1000000 (instead of the default
17 * 0xd0000000). The 0xf1000000 is the default used by the recent,
18 * DT-capable, U-Boot bootloaders provided by Marvell. Some earlier
19 * boards were delivered with an older version of the bootloader that
20 * left internal registers mapped at 0xd0000000. If you are in this
21 * situation, you should either update your bootloader (preferred
22 * solution) or the below Device Tree should be adjusted.
14 */ 23 */
15 24
16/dts-v1/; 25/dts-v1/;
@@ -30,7 +39,7 @@
30 }; 39 };
31 40
32 soc { 41 soc {
33 ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000 42 ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000
34 MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000 43 MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
35 MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x1000000>; 44 MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x1000000>;
36 45
diff --git a/arch/arm/boot/dts/armada-xp-gp.dts b/arch/arm/boot/dts/armada-xp-gp.dts
index 274e2ad5f51c..61bda687f782 100644
--- a/arch/arm/boot/dts/armada-xp-gp.dts
+++ b/arch/arm/boot/dts/armada-xp-gp.dts
@@ -2,7 +2,7 @@
2 * Device Tree file for Marvell Armada XP development board 2 * Device Tree file for Marvell Armada XP development board
3 * (DB-MV784MP-GP) 3 * (DB-MV784MP-GP)
4 * 4 *
5 * Copyright (C) 2013 Marvell 5 * Copyright (C) 2013-2014 Marvell
6 * 6 *
7 * Lior Amsalem <alior@marvell.com> 7 * Lior Amsalem <alior@marvell.com>
8 * Gregory CLEMENT <gregory.clement@free-electrons.com> 8 * Gregory CLEMENT <gregory.clement@free-electrons.com>
@@ -11,6 +11,15 @@
11 * This file is licensed under the terms of the GNU General Public 11 * This file is licensed under the terms of the GNU General Public
12 * License version 2. This program is licensed "as is" without any 12 * License version 2. This program is licensed "as is" without any
13 * warranty of any kind, whether express or implied. 13 * warranty of any kind, whether express or implied.
14 *
15 * Note: this Device Tree assumes that the bootloader has remapped the
16 * internal registers to 0xf1000000 (instead of the default
17 * 0xd0000000). The 0xf1000000 is the default used by the recent,
18 * DT-capable, U-Boot bootloaders provided by Marvell. Some earlier
19 * boards were delivered with an older version of the bootloader that
20 * left internal registers mapped at 0xd0000000. If you are in this
21 * situation, you should either update your bootloader (preferred
22 * solution) or the below Device Tree should be adjusted.
14 */ 23 */
15 24
16/dts-v1/; 25/dts-v1/;
@@ -30,16 +39,17 @@
30 * 8 GB of plug-in RAM modules by default.The amount 39 * 8 GB of plug-in RAM modules by default.The amount
31 * of memory available can be changed by the 40 * of memory available can be changed by the
32 * bootloader according the size of the module 41 * bootloader according the size of the module
33 * actually plugged. Only 7GB are usable because 42 * actually plugged. However, memory between
34 * addresses from 0xC0000000 to 0xffffffff are used by 43 * 0xF0000000 to 0xFFFFFFFF cannot be used, as it is
35 * the internal registers of the SoC. 44 * the address range used for I/O (internal registers,
45 * MBus windows).
36 */ 46 */
37 reg = <0x00000000 0x00000000 0x00000000 0xC0000000>, 47 reg = <0x00000000 0x00000000 0x00000000 0xf0000000>,
38 <0x00000001 0x00000000 0x00000001 0x00000000>; 48 <0x00000001 0x00000000 0x00000001 0x00000000>;
39 }; 49 };
40 50
41 soc { 51 soc {
42 ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000 52 ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000
43 MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000 53 MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
44 MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x1000000>; 54 MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x1000000>;
45 55
diff --git a/arch/arm/boot/dts/armada-xp-matrix.dts b/arch/arm/boot/dts/armada-xp-matrix.dts
index e47c49ecd55c..c2242745b9b8 100644
--- a/arch/arm/boot/dts/armada-xp-matrix.dts
+++ b/arch/arm/boot/dts/armada-xp-matrix.dts
@@ -23,7 +23,12 @@
23 23
24 memory { 24 memory {
25 device_type = "memory"; 25 device_type = "memory";
26 reg = <0 0x00000000 0 0x80000000>; /* 2 GB */ 26 /*
27 * This board has 4 GB of RAM, but the last 256 MB of
28 * RAM are not usable due to the overlap with the MBus
29 * Window address range
30 */
31 reg = <0 0x00000000 0 0xf0000000>;
27 }; 32 };
28 33
29 soc { 34 soc {
diff --git a/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts b/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
index 99bcf76e6953..985948ce67b3 100644
--- a/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
+++ b/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
@@ -11,6 +11,8 @@
11 */ 11 */
12 12
13/dts-v1/; 13/dts-v1/;
14#include <dt-bindings/gpio/gpio.h>
15#include <dt-bindings/input/input.h>
14#include "armada-xp-mv78260.dtsi" 16#include "armada-xp-mv78260.dtsi"
15 17
16/ { 18/ {
@@ -90,19 +92,19 @@
90 92
91 red_led { 93 red_led {
92 label = "red_led"; 94 label = "red_led";
93 gpios = <&gpio1 17 1>; 95 gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
94 default-state = "off"; 96 default-state = "off";
95 }; 97 };
96 98
97 yellow_led { 99 yellow_led {
98 label = "yellow_led"; 100 label = "yellow_led";
99 gpios = <&gpio1 19 1>; 101 gpios = <&gpio1 19 GPIO_ACTIVE_LOW>;
100 default-state = "off"; 102 default-state = "off";
101 }; 103 };
102 104
103 green_led { 105 green_led {
104 label = "green_led"; 106 label = "green_led";
105 gpios = <&gpio1 21 1>; 107 gpios = <&gpio1 21 GPIO_ACTIVE_LOW>;
106 default-state = "keep"; 108 default-state = "keep";
107 }; 109 };
108 }; 110 };
@@ -114,8 +116,8 @@
114 116
115 button@1 { 117 button@1 {
116 label = "Init Button"; 118 label = "Init Button";
117 linux,code = <116>; 119 linux,code = <KEY_POWER>;
118 gpios = <&gpio1 28 0>; 120 gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
119 }; 121 };
120 }; 122 };
121 123
diff --git a/arch/arm/boot/dts/armada-xp.dtsi b/arch/arm/boot/dts/armada-xp.dtsi
index b8b84a22f0f3..abb9f9dcc525 100644
--- a/arch/arm/boot/dts/armada-xp.dtsi
+++ b/arch/arm/boot/dts/armada-xp.dtsi
@@ -111,6 +111,12 @@
111 clock-names = "nbclk", "fixed"; 111 clock-names = "nbclk", "fixed";
112 }; 112 };
113 113
114 watchdog@20300 {
115 compatible = "marvell,armada-xp-wdt";
116 clocks = <&coreclk 2>, <&refclk>;
117 clock-names = "nbclk", "fixed";
118 };
119
114 armada-370-xp-pmsu@22000 { 120 armada-370-xp-pmsu@22000 {
115 compatible = "marvell,armada-370-xp-pmsu"; 121 compatible = "marvell,armada-370-xp-pmsu";
116 reg = <0x22100 0x400>, <0x20800 0x20>; 122 reg = <0x22100 0x400>, <0x20800 0x20>;
diff --git a/arch/arm/boot/dts/at91-ariag25.dts b/arch/arm/boot/dts/at91-ariag25.dts
index cce45f5177f9..55ab6180e350 100644
--- a/arch/arm/boot/dts/at91-ariag25.dts
+++ b/arch/arm/boot/dts/at91-ariag25.dts
@@ -129,7 +129,6 @@
129 adc0: adc@f804c000 { 129 adc0: adc@f804c000 {
130 status = "okay"; 130 status = "okay";
131 atmel,adc-channels-used = <0xf>; 131 atmel,adc-channels-used = <0xf>;
132 atmel,adc-num-channels = <4>;
133 }; 132 };
134 133
135 dbgu: serial@fffff200 { 134 dbgu: serial@fffff200 {
diff --git a/arch/arm/boot/dts/at91-cosino.dtsi b/arch/arm/boot/dts/at91-cosino.dtsi
index 2093c4d7cd6a..df4b78695695 100644
--- a/arch/arm/boot/dts/at91-cosino.dtsi
+++ b/arch/arm/boot/dts/at91-cosino.dtsi
@@ -64,7 +64,6 @@
64 }; 64 };
65 65
66 adc0: adc@f804c000 { 66 adc0: adc@f804c000 {
67 atmel,adc-clock-rate = <1000000>;
68 atmel,adc-ts-wires = <4>; 67 atmel,adc-ts-wires = <4>;
69 atmel,adc-ts-pressure-threshold = <10000>; 68 atmel,adc-ts-pressure-threshold = <10000>;
70 status = "okay"; 69 status = "okay";
diff --git a/arch/arm/boot/dts/at91-cosino_mega2560.dts b/arch/arm/boot/dts/at91-cosino_mega2560.dts
index f9415dd11f17..a542d5837a17 100644
--- a/arch/arm/boot/dts/at91-cosino_mega2560.dts
+++ b/arch/arm/boot/dts/at91-cosino_mega2560.dts
@@ -27,7 +27,6 @@
27 }; 27 };
28 28
29 adc0: adc@f804c000 { 29 adc0: adc@f804c000 {
30 atmel,adc-clock-rate = <1000000>;
31 atmel,adc-ts-wires = <4>; 30 atmel,adc-ts-wires = <4>;
32 atmel,adc-ts-pressure-threshold = <10000>; 31 atmel,adc-ts-pressure-threshold = <10000>;
33 status = "okay"; 32 status = "okay";
diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi
index 997901f7ed73..366fc2cbcd64 100644
--- a/arch/arm/boot/dts/at91sam9260.dtsi
+++ b/arch/arm/boot/dts/at91sam9260.dtsi
@@ -608,37 +608,38 @@
608 }; 608 };
609 609
610 adc0: adc@fffe0000 { 610 adc0: adc@fffe0000 {
611 #address-cells = <1>;
612 #size-cells = <0>;
611 compatible = "atmel,at91sam9260-adc"; 613 compatible = "atmel,at91sam9260-adc";
612 reg = <0xfffe0000 0x100>; 614 reg = <0xfffe0000 0x100>;
613 interrupts = <5 IRQ_TYPE_LEVEL_HIGH 0>; 615 interrupts = <5 IRQ_TYPE_LEVEL_HIGH 0>;
614 atmel,adc-use-external-triggers; 616 atmel,adc-use-external-triggers;
615 atmel,adc-channels-used = <0xf>; 617 atmel,adc-channels-used = <0xf>;
616 atmel,adc-vref = <3300>; 618 atmel,adc-vref = <3300>;
617 atmel,adc-num-channels = <4>;
618 atmel,adc-startup-time = <15>; 619 atmel,adc-startup-time = <15>;
619 atmel,adc-channel-base = <0x30>;
620 atmel,adc-drdy-mask = <0x10000>;
621 atmel,adc-status-register = <0x1c>;
622 atmel,adc-trigger-register = <0x04>;
623 atmel,adc-res = <8 10>; 620 atmel,adc-res = <8 10>;
624 atmel,adc-res-names = "lowres", "highres"; 621 atmel,adc-res-names = "lowres", "highres";
625 atmel,adc-use-res = "highres"; 622 atmel,adc-use-res = "highres";
626 623
627 trigger@0 { 624 trigger@0 {
625 reg = <0>;
628 trigger-name = "timer-counter-0"; 626 trigger-name = "timer-counter-0";
629 trigger-value = <0x1>; 627 trigger-value = <0x1>;
630 }; 628 };
631 trigger@1 { 629 trigger@1 {
630 reg = <1>;
632 trigger-name = "timer-counter-1"; 631 trigger-name = "timer-counter-1";
633 trigger-value = <0x3>; 632 trigger-value = <0x3>;
634 }; 633 };
635 634
636 trigger@2 { 635 trigger@2 {
636 reg = <2>;
637 trigger-name = "timer-counter-2"; 637 trigger-name = "timer-counter-2";
638 trigger-value = <0x5>; 638 trigger-value = <0x5>;
639 }; 639 };
640 640
641 trigger@3 { 641 trigger@3 {
642 reg = <3>;
642 trigger-name = "external"; 643 trigger-name = "external";
643 trigger-value = <0x13>; 644 trigger-value = <0x13>;
644 trigger-external; 645 trigger-external;
diff --git a/arch/arm/boot/dts/at91sam9261.dtsi b/arch/arm/boot/dts/at91sam9261.dtsi
new file mode 100644
index 000000000000..e21dda0e8986
--- /dev/null
+++ b/arch/arm/boot/dts/at91sam9261.dtsi
@@ -0,0 +1,735 @@
1/*
2 * at91sam9261.dtsi - Device Tree Include file for AT91SAM9261 SoC
3 *
4 * Copyright (C) 2013 Jean-Jacques Hiblot <jjhiblot@traphandler.com>
5 *
6 * Licensed under GPLv2 only.
7 */
8
9#include "skeleton.dtsi"
10#include <dt-bindings/pinctrl/at91.h>
11#include <dt-bindings/interrupt-controller/irq.h>
12#include <dt-bindings/gpio/gpio.h>
13#include <dt-bindings/clk/at91.h>
14
15/ {
16 model = "Atmel AT91SAM9261 family SoC";
17 compatible = "atmel,at91sam9261";
18 interrupt-parent = <&aic>;
19
20 aliases {
21 serial0 = &dbgu;
22 serial1 = &usart0;
23 serial2 = &usart1;
24 serial3 = &usart2;
25 gpio0 = &pioA;
26 gpio1 = &pioB;
27 gpio2 = &pioC;
28 tcb0 = &tcb0;
29 i2c0 = &i2c0;
30 ssc0 = &ssc0;
31 ssc1 = &ssc1;
32 };
33
34 cpus {
35 #address-cells = <0>;
36 #size-cells = <0>;
37
38 cpu {
39 compatible = "arm,arm926ej-s";
40 device_type = "cpu";
41 };
42 };
43
44 memory {
45 reg = <0x20000000 0x08000000>;
46 };
47
48 ahb {
49 compatible = "simple-bus";
50 #address-cells = <1>;
51 #size-cells = <1>;
52 ranges;
53
54 usb0: ohci@00500000 {
55 compatible = "atmel,at91rm9200-ohci", "usb-ohci";
56 reg = <0x00500000 0x100000>;
57 interrupts = <20 IRQ_TYPE_LEVEL_HIGH 2>;
58 clocks = <&usb>, <&ohci_clk>, <&hclk0>, <&uhpck>;
59 clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck";
60 status = "disabled";
61 };
62
63 fb0: fb@0x00600000 {
64 compatible = "atmel,at91sam9261-lcdc";
65 reg = <0x00600000 0x1000>;
66 interrupts = <21 IRQ_TYPE_LEVEL_HIGH 3>;
67 pinctrl-names = "default";
68 pinctrl-0 = <&pinctrl_fb>;
69 clocks = <&lcd_clk>, <&hclk1>;
70 clock-names = "lcdc_clk", "hclk";
71 status = "disabled";
72 };
73
74 nand0: nand@40000000 {
75 compatible = "atmel,at91rm9200-nand";
76 #address-cells = <1>;
77 #size-cells = <1>;
78 reg = <0x40000000 0x10000000>;
79 atmel,nand-addr-offset = <22>;
80 atmel,nand-cmd-offset = <21>;
81 pinctrl-names = "default";
82 pinctrl-0 = <&pinctrl_nand>;
83
84 gpios = <&pioC 15 GPIO_ACTIVE_HIGH>,
85 <&pioC 14 GPIO_ACTIVE_HIGH>,
86 <0>;
87 status = "disabled";
88 };
89
90 apb {
91 compatible = "simple-bus";
92 #address-cells = <1>;
93 #size-cells = <1>;
94 ranges;
95
96 tcb0: timer@fffa0000 {
97 compatible = "atmel,at91rm9200-tcb";
98 reg = <0xfffa0000 0x100>;
99 interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0>,
100 <18 IRQ_TYPE_LEVEL_HIGH 0>,
101 <19 IRQ_TYPE_LEVEL_HIGH 0>;
102 clocks = <&tc0_clk>, <&tc1_clk>, <&tc2_clk>;
103 clock-names = "t0_clk", "t1_clk", "t2_clk";
104 };
105
106 usb1: gadget@fffa4000 {
107 compatible = "atmel,at91rm9200-udc";
108 reg = <0xfffa4000 0x4000>;
109 interrupts = <10 IRQ_TYPE_LEVEL_HIGH 2>;
110 clocks = <&usb>, <&udc_clk>, <&udpck>;
111 clock-names = "usb_clk", "udc_clk", "udpck";
112 status = "disabled";
113 };
114
115 mmc0: mmc@fffa8000 {
116 compatible = "atmel,hsmci";
117 reg = <0xfffa8000 0x600>;
118 interrupts = <9 IRQ_TYPE_LEVEL_HIGH 0>;
119 pinctrl-names = "default";
120 pinctrl-0 = <&pinctrl_mmc0_clk>, <&pinctrl_mmc0_slot0_cmd_dat0>, <&pinctrl_mmc0_slot0_dat1_3>;
121 #address-cells = <1>;
122 #size-cells = <0>;
123 clocks = <&mci0_clk>;
124 clock-names = "mci_clk";
125 status = "disabled";
126 };
127
128 i2c0: i2c@fffac000 {
129 compatible = "atmel,at91sam9261-i2c";
130 pinctrl-names = "default";
131 pinctrl-0 = <&pinctrl_i2c_twi>;
132 reg = <0xfffac000 0x100>;
133 interrupts = <11 IRQ_TYPE_LEVEL_HIGH 6>;
134 #address-cells = <1>;
135 #size-cells = <0>;
136 clocks = <&twi0_clk>;
137 status = "disabled";
138 };
139
140 usart0: serial@fffb0000 {
141 compatible = "atmel,at91sam9260-usart";
142 reg = <0xfffb0000 0x200>;
143 interrupts = <6 IRQ_TYPE_LEVEL_HIGH 5>;
144 atmel,use-dma-rx;
145 atmel,use-dma-tx;
146 pinctrl-names = "default";
147 pinctrl-0 = <&pinctrl_usart0>;
148 clocks = <&usart0_clk>;
149 clock-names = "usart";
150 status = "disabled";
151 };
152
153 usart1: serial@fffb4000 {
154 compatible = "atmel,at91sam9260-usart";
155 reg = <0xfffb4000 0x200>;
156 interrupts = <7 IRQ_TYPE_LEVEL_HIGH 5>;
157 atmel,use-dma-rx;
158 atmel,use-dma-tx;
159 pinctrl-names = "default";
160 pinctrl-0 = <&pinctrl_usart1>;
161 clocks = <&usart1_clk>;
162 clock-names = "usart";
163 status = "disabled";
164 };
165
166 usart2: serial@fffb8000{
167 compatible = "atmel,at91sam9260-usart";
168 reg = <0xfffb8000 0x200>;
169 interrupts = <8 IRQ_TYPE_LEVEL_HIGH 5>;
170 atmel,use-dma-rx;
171 atmel,use-dma-tx;
172 pinctrl-names = "default";
173 pinctrl-0 = <&pinctrl_usart2>;
174 clocks = <&usart2_clk>;
175 clock-names = "usart";
176 status = "disabled";
177 };
178
179 ssc0: ssc@fffbc000 {
180 compatible = "atmel,at91rm9200-ssc";
181 reg = <0xfffbc000 0x4000>;
182 interrupts = <14 IRQ_TYPE_LEVEL_HIGH 5>;
183 pinctrl-names = "default";
184 pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
185 status = "disabled";
186 };
187
188 ssc1: ssc@fffc0000 {
189 compatible = "atmel,at91rm9200-ssc";
190 reg = <0xfffc0000 0x4000>;
191 interrupts = <15 IRQ_TYPE_LEVEL_HIGH 5>;
192 pinctrl-names = "default";
193 pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>;
194 status = "disabled";
195 };
196
197 spi0: spi@fffc8000 {
198 #address-cells = <1>;
199 #size-cells = <0>;
200 compatible = "atmel,at91rm9200-spi";
201 reg = <0xfffc8000 0x200>;
202 cs-gpios = <0>, <0>, <0>, <0>;
203 interrupts = <12 IRQ_TYPE_LEVEL_HIGH 3>;
204 pinctrl-names = "default";
205 pinctrl-0 = <&pinctrl_spi0>;
206 clocks = <&spi0_clk>;
207 clock-names = "spi_clk";
208 status = "disabled";
209 };
210
211 spi1: spi@fffcc000 {
212 #address-cells = <1>;
213 #size-cells = <0>;
214 compatible = "atmel,at91rm9200-spi";
215 reg = <0xfffcc000 0x200>;
216 interrupts = <13 IRQ_TYPE_LEVEL_HIGH 3>;
217 pinctrl-names = "default";
218 pinctrl-0 = <&pinctrl_spi1>;
219 clocks = <&spi1_clk>;
220 clock-names = "spi_clk";
221 status = "disabled";
222 };
223
224 ramc: ramc@ffffea00 {
225 compatible = "atmel,at91sam9260-sdramc";
226 reg = <0xffffea00 0x200>;
227 };
228
229 matrix: matrix@ffffee00 {
230 compatible = "atmel,at91sam9260-bus-matrix";
231 reg = <0xffffee00 0x200>;
232 };
233
234 aic: interrupt-controller@fffff000 {
235 #interrupt-cells = <3>;
236 compatible = "atmel,at91rm9200-aic";
237 interrupt-controller;
238 reg = <0xfffff000 0x200>;
239 atmel,external-irqs = <29 30 31>;
240 };
241
242 dbgu: serial@fffff200 {
243 compatible = "atmel,at91sam9260-usart";
244 reg = <0xfffff200 0x200>;
245 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
246 pinctrl-names = "default";
247 pinctrl-0 = <&pinctrl_dbgu>;
248 clocks = <&mck>;
249 clock-names = "usart";
250 status = "disabled";
251 };
252
253 pinctrl@fffff400 {
254 #address-cells = <1>;
255 #size-cells = <1>;
256 compatible = "atmel,at91rm9200-pinctrl", "simple-bus";
257 ranges = <0xfffff400 0xfffff400 0x600>;
258
259 atmel,mux-mask =
260 /* A B */
261 <0xffffffff 0xfffffff7>, /* pioA */
262 <0xffffffff 0xfffffff4>, /* pioB */
263 <0xffffffff 0xffffff07>; /* pioC */
264
265 /* shared pinctrl settings */
266 dbgu {
267 pinctrl_dbgu: dbgu-0 {
268 atmel,pins =
269 <AT91_PIOA 9 AT91_PERIPH_A AT91_PINCTRL_NONE>,
270 <AT91_PIOA 10 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
271 };
272 };
273
274 usart0 {
275 pinctrl_usart0: usart0-0 {
276 atmel,pins =
277 <AT91_PIOC 8 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>,
278 <AT91_PIOC 9 AT91_PERIPH_A AT91_PINCTRL_NONE>;
279 };
280
281 pinctrl_usart0_rts: usart0_rts-0 {
282 atmel,pins =
283 <AT91_PIOC 10 AT91_PERIPH_A AT91_PINCTRL_NONE>;
284 };
285
286 pinctrl_usart0_cts: usart0_cts-0 {
287 atmel,pins =
288 <AT91_PIOC 11 AT91_PERIPH_A AT91_PINCTRL_NONE>;
289 };
290 };
291
292 usart1 {
293 pinctrl_usart1: usart1-0 {
294 atmel,pins =
295 <AT91_PIOC 12 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>,
296 <AT91_PIOC 13 AT91_PERIPH_A AT91_PINCTRL_NONE>;
297 };
298
299 pinctrl_usart1_rts: usart1_rts-0 {
300 atmel,pins =
301 <AT91_PIOA 12 AT91_PERIPH_B AT91_PINCTRL_NONE>;
302 };
303
304 pinctrl_usart1_cts: usart1_cts-0 {
305 atmel,pins =
306 <AT91_PIOA 13 AT91_PERIPH_B AT91_PINCTRL_NONE>;
307 };
308 };
309
310 usart2 {
311 pinctrl_usart2: usart2-0 {
312 atmel,pins =
313 <AT91_PIOC 14 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>,
314 <AT91_PIOC 15 AT91_PERIPH_A AT91_PINCTRL_NONE>;
315 };
316
317 pinctrl_usart2_rts: usart2_rts-0 {
318 atmel,pins =
319 <AT91_PIOA 15 AT91_PERIPH_B AT91_PINCTRL_NONE>;
320 };
321
322 pinctrl_usart2_cts: usart2_cts-0 {
323 atmel,pins =
324 <AT91_PIOA 16 AT91_PERIPH_B AT91_PINCTRL_NONE>;
325 };
326 };
327
328 nand {
329 pinctrl_nand: nand-0 {
330 atmel,pins =
331 <AT91_PIOC 15 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>,
332 <AT91_PIOC 14 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>;
333 };
334 };
335
336 mmc0 {
337 pinctrl_mmc0_clk: mmc0_clk-0 {
338 atmel,pins =
339 <AT91_PIOA 2 AT91_PERIPH_B AT91_PINCTRL_NONE>;
340 };
341
342 pinctrl_mmc0_slot0_cmd_dat0: mmc0_slot0_cmd_dat0-0 {
343 atmel,pins =
344 <AT91_PIOA 1 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>,
345 <AT91_PIOA 0 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>;
346 };
347
348 pinctrl_mmc0_slot0_dat1_3: mmc0_slot0_dat1_3-0 {
349 atmel,pins =
350 <AT91_PIOA 4 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>,
351 <AT91_PIOA 5 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>,
352 <AT91_PIOA 6 AT91_PERIPH_B AT91_PINCTRL_PULL_UP>;
353 };
354 };
355
356 ssc0 {
357 pinctrl_ssc0_tx: ssc0_tx-0 {
358 atmel,pins =
359 <AT91_PIOB 21 AT91_PERIPH_A AT91_PINCTRL_NONE>,
360 <AT91_PIOB 22 AT91_PERIPH_A AT91_PINCTRL_NONE>,
361 <AT91_PIOB 23 AT91_PERIPH_A AT91_PINCTRL_NONE>;
362 };
363
364 pinctrl_ssc0_rx: ssc0_rx-0 {
365 atmel,pins =
366 <AT91_PIOB 24 AT91_PERIPH_A AT91_PINCTRL_NONE>,
367 <AT91_PIOB 25 AT91_PERIPH_A AT91_PINCTRL_NONE>,
368 <AT91_PIOB 26 AT91_PERIPH_A AT91_PINCTRL_NONE>;
369 };
370 };
371
372 ssc1 {
373 pinctrl_ssc1_tx: ssc1_tx-0 {
374 atmel,pins =
375 <AT91_PIOA 17 AT91_PERIPH_B AT91_PINCTRL_NONE>,
376 <AT91_PIOA 18 AT91_PERIPH_B AT91_PINCTRL_NONE>,
377 <AT91_PIOA 19 AT91_PERIPH_B AT91_PINCTRL_NONE>;
378 };
379
380 pinctrl_ssc1_rx: ssc1_rx-0 {
381 atmel,pins =
382 <AT91_PIOA 20 AT91_PERIPH_B AT91_PINCTRL_NONE>,
383 <AT91_PIOA 21 AT91_PERIPH_B AT91_PINCTRL_NONE>,
384 <AT91_PIOA 22 AT91_PERIPH_B AT91_PINCTRL_NONE>;
385 };
386 };
387
388 spi0 {
389 pinctrl_spi0: spi0-0 {
390 atmel,pins =
391 <AT91_PIOA 0 AT91_PERIPH_A AT91_PINCTRL_NONE>,
392 <AT91_PIOA 1 AT91_PERIPH_A AT91_PINCTRL_NONE>,
393 <AT91_PIOA 2 AT91_PERIPH_A AT91_PINCTRL_NONE>;
394 };
395 };
396
397 spi1 {
398 pinctrl_spi1: spi1-0 {
399 atmel,pins =
400 <AT91_PIOB 30 AT91_PERIPH_A AT91_PINCTRL_NONE>,
401 <AT91_PIOB 31 AT91_PERIPH_A AT91_PINCTRL_NONE>,
402 <AT91_PIOB 29 AT91_PERIPH_A AT91_PINCTRL_NONE>;
403 };
404 };
405
406 tcb0 {
407 pinctrl_tcb0_tclk0: tcb0_tclk0-0 {
408 atmel,pins = <AT91_PIOC 16 AT91_PERIPH_B AT91_PINCTRL_NONE>;
409 };
410
411 pinctrl_tcb0_tclk1: tcb0_tclk1-0 {
412 atmel,pins = <AT91_PIOC 17 AT91_PERIPH_B AT91_PINCTRL_NONE>;
413 };
414
415 pinctrl_tcb0_tclk2: tcb0_tclk2-0 {
416 atmel,pins = <AT91_PIOC 18 AT91_PERIPH_B AT91_PINCTRL_NONE>;
417 };
418
419 pinctrl_tcb0_tioa0: tcb0_tioa0-0 {
420 atmel,pins = <AT91_PIOC 19 AT91_PERIPH_B AT91_PINCTRL_NONE>;
421 };
422
423 pinctrl_tcb0_tioa1: tcb0_tioa1-0 {
424 atmel,pins = <AT91_PIOC 21 AT91_PERIPH_B AT91_PINCTRL_NONE>;
425 };
426
427 pinctrl_tcb0_tioa2: tcb0_tioa2-0 {
428 atmel,pins = <AT91_PIOC 23 AT91_PERIPH_B AT91_PINCTRL_NONE>;
429 };
430
431 pinctrl_tcb0_tiob0: tcb0_tiob0-0 {
432 atmel,pins = <AT91_PIOC 20 AT91_PERIPH_B AT91_PINCTRL_NONE>;
433 };
434
435 pinctrl_tcb0_tiob1: tcb0_tiob1-0 {
436 atmel,pins = <AT91_PIOC 22 AT91_PERIPH_B AT91_PINCTRL_NONE>;
437 };
438
439 pinctrl_tcb0_tiob2: tcb0_tiob2-0 {
440 atmel,pins = <AT91_PIOC 24 AT91_PERIPH_B AT91_PINCTRL_NONE>;
441 };
442 };
443
444 i2c0 {
445 pinctrl_i2c_bitbang: i2c-0-bitbang {
446 atmel,pins =
447 <AT91_PIOA 7 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>,
448 <AT91_PIOA 8 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
449 };
450 pinctrl_i2c_twi: i2c-0-twi {
451 atmel,pins =
452 <AT91_PIOA 7 AT91_PERIPH_A AT91_PINCTRL_NONE>,
453 <AT91_PIOA 8 AT91_PERIPH_A AT91_PINCTRL_NONE>;
454 };
455 };
456
457 fb {
458 pinctrl_fb: fb-0 {
459 atmel,pins =
460 <AT91_PIOB 1 AT91_PERIPH_A AT91_PINCTRL_NONE>,
461 <AT91_PIOB 2 AT91_PERIPH_A AT91_PINCTRL_NONE>,
462 <AT91_PIOB 3 AT91_PERIPH_A AT91_PINCTRL_NONE>,
463 <AT91_PIOB 7 AT91_PERIPH_A AT91_PINCTRL_NONE>,
464 <AT91_PIOB 8 AT91_PERIPH_A AT91_PINCTRL_NONE>,
465 <AT91_PIOB 9 AT91_PERIPH_A AT91_PINCTRL_NONE>,
466 <AT91_PIOB 10 AT91_PERIPH_A AT91_PINCTRL_NONE>,
467 <AT91_PIOB 11 AT91_PERIPH_A AT91_PINCTRL_NONE>,
468 <AT91_PIOB 12 AT91_PERIPH_A AT91_PINCTRL_NONE>,
469 <AT91_PIOB 15 AT91_PERIPH_A AT91_PINCTRL_NONE>,
470 <AT91_PIOB 16 AT91_PERIPH_A AT91_PINCTRL_NONE>,
471 <AT91_PIOB 17 AT91_PERIPH_A AT91_PINCTRL_NONE>,
472 <AT91_PIOB 18 AT91_PERIPH_A AT91_PINCTRL_NONE>,
473 <AT91_PIOB 19 AT91_PERIPH_A AT91_PINCTRL_NONE>,
474 <AT91_PIOB 20 AT91_PERIPH_A AT91_PINCTRL_NONE>,
475 <AT91_PIOB 23 AT91_PERIPH_B AT91_PINCTRL_NONE>,
476 <AT91_PIOB 24 AT91_PERIPH_B AT91_PINCTRL_NONE>,
477 <AT91_PIOB 25 AT91_PERIPH_B AT91_PINCTRL_NONE>,
478 <AT91_PIOB 26 AT91_PERIPH_B AT91_PINCTRL_NONE>,
479 <AT91_PIOB 27 AT91_PERIPH_B AT91_PINCTRL_NONE>,
480 <AT91_PIOB 28 AT91_PERIPH_B AT91_PINCTRL_NONE>;
481 };
482 };
483
484 pioA: gpio@fffff400 {
485 compatible = "atmel,at91rm9200-gpio";
486 reg = <0xfffff400 0x200>;
487 interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
488 #gpio-cells = <2>;
489 gpio-controller;
490 interrupt-controller;
491 #interrupt-cells = <2>;
492 clocks = <&pioA_clk>;
493 };
494
495 pioB: gpio@fffff600 {
496 compatible = "atmel,at91rm9200-gpio";
497 reg = <0xfffff600 0x200>;
498 interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
499 #gpio-cells = <2>;
500 gpio-controller;
501 interrupt-controller;
502 #interrupt-cells = <2>;
503 clocks = <&pioB_clk>;
504 };
505
506 pioC: gpio@fffff800 {
507 compatible = "atmel,at91rm9200-gpio";
508 reg = <0xfffff800 0x200>;
509 interrupts = <4 IRQ_TYPE_LEVEL_HIGH 1>;
510 #gpio-cells = <2>;
511 gpio-controller;
512 interrupt-controller;
513 #interrupt-cells = <2>;
514 clocks = <&pioC_clk>;
515 };
516 };
517
518 pmc: pmc@fffffc00 {
519 compatible = "atmel,at91rm9200-pmc";
520 reg = <0xfffffc00 0x100>;
521 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
522 interrupt-controller;
523 #address-cells = <1>;
524 #size-cells = <0>;
525 #interrupt-cells = <1>;
526
527 clk32k: slck {
528 compatible = "fixed-clock";
529 #clock-cells = <0>;
530 clock-frequency = <32768>;
531 };
532
533 main: mainck {
534 compatible = "atmel,at91rm9200-clk-main";
535 #clock-cells = <0>;
536 interrupts-extended = <&pmc AT91_PMC_MOSCS>;
537 clocks = <&clk32k>;
538 };
539
540 plla: pllack {
541 compatible = "atmel,at91rm9200-clk-pll";
542 #clock-cells = <0>;
543 interrupts-extended = <&pmc AT91_PMC_LOCKA>;
544 clocks = <&main>;
545 reg = <0>;
546 atmel,clk-input-range = <1000000 32000000>;
547 #atmel,pll-clk-output-range-cells = <4>;
548 atmel,pll-clk-output-ranges = <80000000 200000000 190000000 240000000>;
549 };
550
551 pllb: pllbck {
552 compatible = "atmel,at91rm9200-clk-pll";
553 #clock-cells = <0>;
554 interrupts-extended = <&pmc AT91_PMC_LOCKB>;
555 clocks = <&main>;
556 reg = <1>;
557 atmel,clk-input-range = <1000000 32000000>;
558 #atmel,pll-clk-output-range-cells = <4>;
559 atmel,pll-clk-output-ranges = <80000000 200000000 190000000 240000000>;
560 };
561
562 mck: masterck {
563 compatible = "atmel,at91rm9200-clk-master";
564 #clock-cells = <0>;
565 interrupts-extended = <&pmc AT91_PMC_MCKRDY>;
566 clocks = <&clk32k>, <&main>, <&plla>, <&pllb>;
567 atmel,clk-output-range = <0 94000000>;
568 atmel,clk-divisors = <1 2 4 3>;
569 };
570
571 usb: usbck {
572 compatible = "atmel,at91rm9200-clk-usb";
573 #clock-cells = <0>;
574 atmel,clk-divisors = <1 2 4 3>;
575 clocks = <&pllb>;
576 };
577
578 systemck {
579 compatible = "atmel,at91rm9200-clk-system";
580 #address-cells = <1>;
581 #size-cells = <0>;
582
583 uhpck: uhpck {
584 #clock-cells = <0>;
585 reg = <6>;
586 clocks = <&usb>;
587 };
588
589 udpck: udpck {
590 #clock-cells = <0>;
591 reg = <7>;
592 clocks = <&usb>;
593 };
594
595 hclk0: hclk0 {
596 #clock-cells = <0>;
597 reg = <16>;
598 clocks = <&mck>;
599 };
600
601 hclk1: hclk1 {
602 #clock-cells = <0>;
603 reg = <17>;
604 clocks = <&mck>;
605 };
606 };
607
608 periphck {
609 compatible = "atmel,at91rm9200-clk-peripheral";
610 #address-cells = <1>;
611 #size-cells = <0>;
612 clocks = <&mck>;
613
614 pioA_clk: pioA_clk {
615 #clock-cells = <0>;
616 reg = <2>;
617 };
618
619 pioB_clk: pioB_clk {
620 #clock-cells = <0>;
621 reg = <3>;
622 };
623
624 pioC_clk: pioC_clk {
625 #clock-cells = <0>;
626 reg = <4>;
627 };
628
629 usart0_clk: usart0_clk {
630 #clock-cells = <0>;
631 reg = <6>;
632 };
633
634 usart1_clk: usart1_clk {
635 #clock-cells = <0>;
636 reg = <7>;
637 };
638
639 usart2_clk: usart2_clk {
640 #clock-cells = <0>;
641 reg = <8>;
642 };
643
644 mci0_clk: mci0_clk {
645 #clock-cells = <0>;
646 reg = <9>;
647 };
648
649 udc_clk: udc_clk {
650 #clock-cells = <0>;
651 reg = <10>;
652 };
653
654 twi0_clk: twi0_clk {
655 reg = <11>;
656 #clock-cells = <0>;
657 };
658
659 spi0_clk: spi0_clk {
660 #clock-cells = <0>;
661 reg = <12>;
662 };
663
664 spi1_clk: spi1_clk {
665 #clock-cells = <0>;
666 reg = <13>;
667 };
668
669 tc0_clk: tc0_clk {
670 #clock-cells = <0>;
671 reg = <17>;
672 };
673
674 tc1_clk: tc1_clk {
675 #clock-cells = <0>;
676 reg = <18>;
677 };
678
679 tc2_clk: tc2_clk {
680 #clock-cells = <0>;
681 reg = <19>;
682 };
683
684 ohci_clk: ohci_clk {
685 #clock-cells = <0>;
686 reg = <20>;
687 };
688
689 lcd_clk: lcd_clk {
690 #clock-cells = <0>;
691 reg = <21>;
692 };
693 };
694 };
695
696 rstc@fffffd00 {
697 compatible = "atmel,at91sam9260-rstc";
698 reg = <0xfffffd00 0x10>;
699 };
700
701 shdwc@fffffd10 {
702 compatible = "atmel,at91sam9260-shdwc";
703 reg = <0xfffffd10 0x10>;
704 };
705
706 pit: timer@fffffd30 {
707 compatible = "atmel,at91sam9260-pit";
708 reg = <0xfffffd30 0xf>;
709 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
710 clocks = <&mck>;
711 };
712
713 watchdog@fffffd40 {
714 compatible = "atmel,at91sam9260-wdt";
715 reg = <0xfffffd40 0x10>;
716 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
717 status = "disabled";
718 };
719 };
720 };
721
722 i2c@0 {
723 compatible = "i2c-gpio";
724 pinctrl-names = "default";
725 pinctrl-0 = <&pinctrl_i2c_bitbang>;
726 gpios = <&pioA 7 GPIO_ACTIVE_HIGH>, /* sda */
727 <&pioA 8 GPIO_ACTIVE_HIGH>; /* scl */
728 i2c-gpio,sda-open-drain;
729 i2c-gpio,scl-open-drain;
730 i2c-gpio,delay-us = <2>; /* ~100 kHz */
731 #address-cells = <1>;
732 #size-cells = <0>;
733 status = "disabled";
734 };
735};
diff --git a/arch/arm/boot/dts/at91sam9261ek.dts b/arch/arm/boot/dts/at91sam9261ek.dts
new file mode 100644
index 000000000000..2ce527e70c7a
--- /dev/null
+++ b/arch/arm/boot/dts/at91sam9261ek.dts
@@ -0,0 +1,211 @@
1/*
2 * at91sam9261ek.dts - Device Tree file for Atmel at91sam9261 reference board
3 *
4 * Copyright (C) 2013 Jean-Jacques Hiblot <jjhiblot@traphandler.com>
5 *
6 * Licensed under GPLv2 only.
7 */
8/dts-v1/;
9#include "at91sam9261.dtsi"
10
11/ {
12 model = "Atmel at91sam9261ek";
13 compatible = "atmel,at91sam9261ek", "atmel,at91sam9261", "atmel,at91sam9";
14
15 chosen {
16 bootargs = "console=ttyS0,115200 rootfstype=ubifs ubi.mtd=5 root=ubi0:rootfs rw";
17 };
18
19 memory {
20 reg = <0x20000000 0x4000000>;
21 };
22
23 clocks {
24 #address-cells = <1>;
25 #size-cells = <1>;
26 ranges;
27
28 main_clock: clock@0 {
29 compatible = "atmel,osc", "fixed-clock";
30 clock-frequency = <18432000>;
31 };
32 };
33
34 ahb {
35 usb0: ohci@00500000 {
36 status = "okay";
37 };
38
39 fb0: fb@0x00600000 {
40 display = <&display0>;
41 atmel,power-control-gpio = <&pioA 12 GPIO_ACTIVE_LOW>;
42 status = "okay";
43
44 display0: display {
45 bits-per-pixel = <16>;
46 atmel,lcdcon-backlight;
47 atmel,dmacon = <0x1>;
48 atmel,lcdcon2 = <0x80008002>;
49 atmel,guard-time = <1>;
50 atmel,lcd-wiring-mode = "BRG";
51
52 display-timings {
53 native-mode = <&timing0>;
54 timing0: timing0 {
55 clock-frequency = <4965000>;
56 hactive = <240>;
57 vactive = <320>;
58 hback-porch = <1>;
59 hfront-porch = <33>;
60 vback-porch = <1>;
61 vfront-porch = <0>;
62 hsync-len = <5>;
63 vsync-len = <1>;
64 hsync-active = <1>;
65 vsync-active = <1>;
66 };
67 };
68 };
69 };
70
71 nand0: nand@40000000 {
72 nand-bus-width = <8>;
73 nand-ecc-mode = "soft";
74 nand-on-flash-bbt;
75 status = "okay";
76
77 at91bootstrap@0 {
78 label = "at91bootstrap";
79 reg = <0x0 0x40000>;
80 };
81
82 bootloader@40000 {
83 label = "bootloader";
84 reg = <0x40000 0x80000>;
85 };
86
87 bootloaderenv@c0000 {
88 label = "bootloader env";
89 reg = <0xc0000 0xc0000>;
90 };
91
92 dtb@180000 {
93 label = "device tree";
94 reg = <0x180000 0x80000>;
95 };
96
97 kernel@200000 {
98 label = "kernel";
99 reg = <0x200000 0x600000>;
100 };
101
102 rootfs@800000 {
103 label = "rootfs";
104 reg = <0x800000 0x0f800000>;
105 };
106 };
107
108 apb {
109 usb1: gadget@fffa4000 {
110 atmel,vbus-gpio = <&pioB 29 GPIO_ACTIVE_HIGH>;
111 status = "okay";
112 };
113
114 spi0: spi@fffc8000 {
115 cs-gpios = <&pioA 3 0>, <0>, <&pioA 28 0>, <0>;
116 status = "okay";
117
118 mtd_dataflash@0 {
119 compatible = "atmel,at45", "atmel,dataflash";
120 reg = <0>;
121 spi-max-frequency = <15000000>;
122 };
123
124 tsc2046@0 {
125 reg = <2>;
126 compatible = "ti,ads7843";
127 interrupts-extended = <&pioC 2 IRQ_TYPE_EDGE_BOTH>;
128 spi-max-frequency = <3000000>;
129 pendown-gpio = <&pioC 2 GPIO_ACTIVE_HIGH>;
130
131 ti,x-min = /bits/ 16 <150>;
132 ti,x-max = /bits/ 16 <3830>;
133 ti,y-min = /bits/ 16 <190>;
134 ti,y-max = /bits/ 16 <3830>;
135 ti,vref-delay-usecs = /bits/ 16 <450>;
136 ti,x-plate-ohms = /bits/ 16 <450>;
137 ti,y-plate-ohms = /bits/ 16 <250>;
138 ti,pressure-max = /bits/ 16 <15000>;
139 ti,debounce-rep = /bits/ 16 <0>;
140 ti,debounce-tol = /bits/ 16 <65535>;
141 ti,debounce-max = /bits/ 16 <1>;
142
143 linux,wakeup;
144 };
145 };
146
147 dbgu: serial@fffff200 {
148 status = "okay";
149 };
150
151 watchdog@fffffd40 {
152 status = "okay";
153 };
154
155 };
156 };
157
158 leds {
159 compatible = "gpio-leds";
160
161 ds8 {
162 label = "ds8";
163 gpios = <&pioA 13 GPIO_ACTIVE_LOW>;
164 linux,default-trigger = "none";
165 };
166
167 ds7 {
168 label = "ds7";
169 gpios = <&pioA 14 GPIO_ACTIVE_LOW>;
170 linux,default-trigger = "nand-disk";
171 };
172
173 ds1 {
174 label = "ds1";
175 gpios = <&pioA 23 GPIO_ACTIVE_LOW>;
176 linux,default-trigger = "heartbeat";
177 };
178 };
179
180 gpio_keys {
181 compatible = "gpio-keys";
182
183 button_0 {
184 label = "button_0";
185 gpios = <&pioA 27 GPIO_ACTIVE_LOW>;
186 linux,code = <256>;
187 gpio-key,wakeup;
188 };
189
190 button_1 {
191 label = "button_1";
192 gpios = <&pioA 26 GPIO_ACTIVE_LOW>;
193 linux,code = <257>;
194 gpio-key,wakeup;
195 };
196
197 button_2 {
198 label = "button_2";
199 gpios = <&pioA 25 GPIO_ACTIVE_LOW>;
200 linux,code = <258>;
201 gpio-key,wakeup;
202 };
203
204 button_3 {
205 label = "button_3";
206 gpios = <&pioA 24 GPIO_ACTIVE_LOW>;
207 linux,code = <259>;
208 gpio-key,wakeup;
209 };
210 };
211};
diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi
index cbcc058b26b4..9cdaecff13b3 100644
--- a/arch/arm/boot/dts/at91sam9g45.dtsi
+++ b/arch/arm/boot/dts/at91sam9g45.dtsi
@@ -632,40 +632,41 @@
632 }; 632 };
633 633
634 adc0: adc@fffb0000 { 634 adc0: adc@fffb0000 {
635 #address-cells = <1>;
636 #size-cells = <0>;
635 compatible = "atmel,at91sam9260-adc"; 637 compatible = "atmel,at91sam9260-adc";
636 reg = <0xfffb0000 0x100>; 638 reg = <0xfffb0000 0x100>;
637 interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>; 639 interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>;
638 atmel,adc-use-external-triggers; 640 atmel,adc-use-external-triggers;
639 atmel,adc-channels-used = <0xff>; 641 atmel,adc-channels-used = <0xff>;
640 atmel,adc-vref = <3300>; 642 atmel,adc-vref = <3300>;
641 atmel,adc-num-channels = <8>;
642 atmel,adc-startup-time = <40>; 643 atmel,adc-startup-time = <40>;
643 atmel,adc-channel-base = <0x30>;
644 atmel,adc-drdy-mask = <0x10000>;
645 atmel,adc-status-register = <0x1c>;
646 atmel,adc-trigger-register = <0x08>;
647 atmel,adc-res = <8 10>; 644 atmel,adc-res = <8 10>;
648 atmel,adc-res-names = "lowres", "highres"; 645 atmel,adc-res-names = "lowres", "highres";
649 atmel,adc-use-res = "highres"; 646 atmel,adc-use-res = "highres";
650 647
651 trigger@0 { 648 trigger@0 {
649 reg = <0>;
652 trigger-name = "external-rising"; 650 trigger-name = "external-rising";
653 trigger-value = <0x1>; 651 trigger-value = <0x1>;
654 trigger-external; 652 trigger-external;
655 }; 653 };
656 trigger@1 { 654 trigger@1 {
655 reg = <1>;
657 trigger-name = "external-falling"; 656 trigger-name = "external-falling";
658 trigger-value = <0x2>; 657 trigger-value = <0x2>;
659 trigger-external; 658 trigger-external;
660 }; 659 };
661 660
662 trigger@2 { 661 trigger@2 {
662 reg = <2>;
663 trigger-name = "external-any"; 663 trigger-name = "external-any";
664 trigger-value = <0x3>; 664 trigger-value = <0x3>;
665 trigger-external; 665 trigger-external;
666 }; 666 };
667 667
668 trigger@3 { 668 trigger@3 {
669 reg = <3>;
669 trigger-name = "continuous"; 670 trigger-name = "continuous";
670 trigger-value = <0x6>; 671 trigger-value = <0x6>;
671 }; 672 };
@@ -817,6 +818,7 @@
817 >; 818 >;
818 atmel,nand-addr-offset = <21>; 819 atmel,nand-addr-offset = <21>;
819 atmel,nand-cmd-offset = <22>; 820 atmel,nand-cmd-offset = <22>;
821 atmel,nand-has-dma;
820 pinctrl-names = "default"; 822 pinctrl-names = "default";
821 pinctrl-0 = <&pinctrl_nand>; 823 pinctrl-0 = <&pinctrl_nand>;
822 gpios = <&pioC 8 GPIO_ACTIVE_HIGH 824 gpios = <&pioC 8 GPIO_ACTIVE_HIGH
diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
index 394e6ce2afb7..9f04808fc697 100644
--- a/arch/arm/boot/dts/at91sam9n12.dtsi
+++ b/arch/arm/boot/dts/at91sam9n12.dtsi
@@ -570,6 +570,7 @@
570 atmel,pmecc-lookup-table-offset = <0x0 0x8000>; 570 atmel,pmecc-lookup-table-offset = <0x0 0x8000>;
571 atmel,nand-addr-offset = <21>; 571 atmel,nand-addr-offset = <21>;
572 atmel,nand-cmd-offset = <22>; 572 atmel,nand-cmd-offset = <22>;
573 atmel,nand-has-dma;
573 pinctrl-names = "default"; 574 pinctrl-names = "default";
574 pinctrl-0 = <&pinctrl_nand>; 575 pinctrl-0 = <&pinctrl_nand>;
575 gpios = <&pioD 5 GPIO_ACTIVE_HIGH 576 gpios = <&pioD 5 GPIO_ACTIVE_HIGH
diff --git a/arch/arm/boot/dts/at91sam9rl.dtsi b/arch/arm/boot/dts/at91sam9rl.dtsi
new file mode 100644
index 000000000000..63e1784d272c
--- /dev/null
+++ b/arch/arm/boot/dts/at91sam9rl.dtsi
@@ -0,0 +1,802 @@
1/*
2 * at91sam9rl.dtsi - Device Tree Include file for AT91SAM9RL family SoC
3 *
4 * Copyright (C) 2014 Alexandre Belloni <alexandre.belloni@free-electrons.com>
5 *
6 * Licensed under GPLv2 or later.
7 */
8
9#include "skeleton.dtsi"
10#include <dt-bindings/pinctrl/at91.h>
11#include <dt-bindings/clk/at91.h>
12#include <dt-bindings/interrupt-controller/irq.h>
13#include <dt-bindings/gpio/gpio.h>
14
15/ {
16 model = "Atmel AT91SAM9RL family SoC";
17 compatible = "atmel,at91sam9rl", "atmel,at91sam9";
18 interrupt-parent = <&aic>;
19
20 aliases {
21 serial0 = &dbgu;
22 serial1 = &usart0;
23 serial2 = &usart1;
24 serial3 = &usart2;
25 serial4 = &usart3;
26 gpio0 = &pioA;
27 gpio1 = &pioB;
28 gpio2 = &pioC;
29 gpio3 = &pioD;
30 tcb0 = &tcb0;
31 i2c0 = &i2c0;
32 i2c1 = &i2c1;
33 ssc0 = &ssc0;
34 ssc1 = &ssc1;
35 };
36
37 cpus {
38 #address-cells = <0>;
39 #size-cells = <0>;
40
41 cpu {
42 compatible = "arm,arm926ej-s";
43 device_type = "cpu";
44 };
45 };
46
47 memory {
48 reg = <0x20000000 0x04000000>;
49 };
50
51 ahb {
52 compatible = "simple-bus";
53 #address-cells = <1>;
54 #size-cells = <1>;
55 ranges;
56
57 nand0: nand@40000000 {
58 compatible = "atmel,at91rm9200-nand";
59 #address-cells = <1>;
60 #size-cells = <1>;
61 reg = <0x40000000 0x10000000>,
62 <0xffffe800 0x200>;
63 atmel,nand-addr-offset = <21>;
64 atmel,nand-cmd-offset = <22>;
65 pinctrl-names = "default";
66 pinctrl-0 = <&pinctrl_nand>;
67 gpios = <&pioD 17 GPIO_ACTIVE_HIGH>,
68 <&pioB 6 GPIO_ACTIVE_HIGH>,
69 <0>;
70 status = "disabled";
71 };
72
73 apb {
74 compatible = "simple-bus";
75 #address-cells = <1>;
76 #size-cells = <1>;
77 ranges;
78
79 tcb0: timer@fffa0000 {
80 compatible = "atmel,at91rm9200-tcb";
81 reg = <0xfffa0000 0x100>;
82 interrupts = <16 IRQ_TYPE_LEVEL_HIGH 0>,
83 <17 IRQ_TYPE_LEVEL_HIGH 0>,
84 <18 IRQ_TYPE_LEVEL_HIGH 0>;
85 clocks = <&tc0_clk>, <&tc1_clk>, <&tc2_clk>;
86 clock-names = "t0_clk", "t1_clk", "t2_clk";
87 };
88
89 mmc0: mmc@fffa4000 {
90 compatible = "atmel,hsmci";
91 reg = <0xfffa4000 0x600>;
92 interrupts = <10 IRQ_TYPE_LEVEL_HIGH 0>;
93 #address-cells = <1>;
94 #size-cells = <0>;
95 pinctrl-names = "default";
96 clocks = <&mci0_clk>;
97 clock-names = "mci_clk";
98 status = "disabled";
99 };
100
101 i2c0: i2c@fffa8000 {
102 compatible = "atmel,at91sam9260-i2c";
103 reg = <0xfffa8000 0x100>;
104 interrupts = <11 IRQ_TYPE_LEVEL_HIGH 6>;
105 #address-cells = <1>;
106 #size-cells = <0>;
107 clocks = <&twi0_clk>;
108 status = "disabled";
109 };
110
111 i2c1: i2c@fffac000 {
112 compatible = "atmel,at91sam9260-i2c";
113 reg = <0xfffac000 0x100>;
114 interrupts = <12 IRQ_TYPE_LEVEL_HIGH 6>;
115 #address-cells = <1>;
116 #size-cells = <0>;
117 status = "disabled";
118 };
119
120 usart0: serial@fffb0000 {
121 compatible = "atmel,at91sam9260-usart";
122 reg = <0xfffb0000 0x200>;
123 interrupts = <6 IRQ_TYPE_LEVEL_HIGH 5>;
124 atmel,use-dma-rx;
125 atmel,use-dma-tx;
126 pinctrl-names = "default";
127 pinctrl-0 = <&pinctrl_usart0>;
128 clocks = <&usart0_clk>;
129 clock-names = "usart";
130 status = "disabled";
131 };
132
133 usart1: serial@fffb4000 {
134 compatible = "atmel,at91sam9260-usart";
135 reg = <0xfffb4000 0x200>;
136 interrupts = <7 IRQ_TYPE_LEVEL_HIGH 5>;
137 atmel,use-dma-rx;
138 atmel,use-dma-tx;
139 pinctrl-names = "default";
140 pinctrl-0 = <&pinctrl_usart1>;
141 clocks = <&usart1_clk>;
142 clock-names = "usart";
143 status = "disabled";
144 };
145
146 usart2: serial@fffb8000 {
147 compatible = "atmel,at91sam9260-usart";
148 reg = <0xfffb8000 0x200>;
149 interrupts = <8 IRQ_TYPE_LEVEL_HIGH 5>;
150 atmel,use-dma-rx;
151 atmel,use-dma-tx;
152 pinctrl-names = "default";
153 pinctrl-0 = <&pinctrl_usart2>;
154 clocks = <&usart2_clk>;
155 clock-names = "usart";
156 status = "disabled";
157 };
158
159 usart3: serial@fffbc000 {
160 compatible = "atmel,at91sam9260-usart";
161 reg = <0xfffbc000 0x200>;
162 interrupts = <9 IRQ_TYPE_LEVEL_HIGH 5>;
163 atmel,use-dma-rx;
164 atmel,use-dma-tx;
165 pinctrl-names = "default";
166 pinctrl-0 = <&pinctrl_usart3>;
167 clocks = <&usart3_clk>;
168 clock-names = "usart";
169 status = "disabled";
170 };
171
172 ssc0: ssc@fffc0000 {
173 compatible = "atmel,at91rm9200-ssc";
174 reg = <0xfffc0000 0x4000>;
175 interrupts = <14 IRQ_TYPE_LEVEL_HIGH 5>;
176 pinctrl-names = "default";
177 pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
178 status = "disabled";
179 };
180
181 ssc1: ssc@fffc4000 {
182 compatible = "atmel,at91rm9200-ssc";
183 reg = <0xfffc4000 0x4000>;
184 interrupts = <15 IRQ_TYPE_LEVEL_HIGH 5>;
185 pinctrl-names = "default";
186 pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>;
187 status = "disabled";
188 };
189
190 spi0: spi@fffcc000 {
191 #address-cells = <1>;
192 #size-cells = <0>;
193 compatible = "atmel,at91rm9200-spi";
194 reg = <0xfffcc000 0x200>;
195 interrupts = <13 IRQ_TYPE_LEVEL_HIGH 3>;
196 pinctrl-names = "default";
197 pinctrl-0 = <&pinctrl_spi0>;
198 clocks = <&spi0_clk>;
199 clock-names = "spi_clk";
200 status = "disabled";
201 };
202
203 ramc0: ramc@ffffea00 {
204 compatible = "atmel,at91sam9260-sdramc";
205 reg = <0xffffea00 0x200>;
206 };
207
208 aic: interrupt-controller@fffff000 {
209 #interrupt-cells = <3>;
210 compatible = "atmel,at91rm9200-aic";
211 interrupt-controller;
212 reg = <0xfffff000 0x200>;
213 atmel,external-irqs = <31>;
214 };
215
216 dbgu: serial@fffff200 {
217 compatible = "atmel,at91sam9260-usart";
218 reg = <0xfffff200 0x200>;
219 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
220 pinctrl-names = "default";
221 pinctrl-0 = <&pinctrl_dbgu>;
222 clocks = <&mck>;
223 clock-names = "usart";
224 status = "disabled";
225 };
226
227 pinctrl@fffff400 {
228 #address-cells = <1>;
229 #size-cells = <1>;
230 compatible = "atmel,at91rm9200-pinctrl", "simple-bus";
231 ranges = <0xfffff400 0xfffff400 0x800>;
232
233 atmel,mux-mask =
234 /* A B */
235 <0xffffffff 0xe05c6738>, /* pioA */
236 <0xffffffff 0x0000c780>, /* pioB */
237 <0xffffffff 0xe3ffff0e>, /* pioC */
238 <0x003fffff 0x0001ff3c>; /* pioD */
239
240 /* shared pinctrl settings */
241 dbgu {
242 pinctrl_dbgu: dbgu-0 {
243 atmel,pins =
244 <AT91_PIOA 21 AT91_PERIPH_A AT91_PINCTRL_NONE>,
245 <AT91_PIOA 22 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
246 };
247 };
248
249 i2c_gpio0 {
250 pinctrl_i2c_gpio0: i2c_gpio0-0 {
251 atmel,pins =
252 <AT91_PIOA 23 AT91_PERIPH_GPIO AT91_PINCTRL_MULTI_DRIVE>,
253 <AT91_PIOA 24 AT91_PERIPH_GPIO AT91_PINCTRL_MULTI_DRIVE>;
254 };
255 };
256
257 i2c_gpio1 {
258 pinctrl_i2c_gpio1: i2c_gpio1-0 {
259 atmel,pins =
260 <AT91_PIOD 10 AT91_PERIPH_GPIO AT91_PINCTRL_MULTI_DRIVE>,
261 <AT91_PIOD 11 AT91_PERIPH_GPIO AT91_PINCTRL_MULTI_DRIVE>;
262 };
263 };
264
265 mmc0 {
266 pinctrl_mmc0_clk: mmc0_clk-0 {
267 atmel,pins =
268 <AT91_PIOA 2 AT91_PERIPH_A AT91_PINCTRL_NONE>;
269 };
270
271 pinctrl_mmc0_slot0_cmd_dat0: mmc0_slot0_cmd_dat0-0 {
272 atmel,pins =
273 <AT91_PIOA 0 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>,
274 <AT91_PIOA 1 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
275 };
276
277 pinctrl_mmc0_slot0_dat1_3: mmc0_slot0_dat1_3-0 {
278 atmel,pins =
279 <AT91_PIOA 3 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>,
280 <AT91_PIOA 4 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>,
281 <AT91_PIOA 5 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
282 };
283 };
284
285 nand {
286 pinctrl_nand: nand-0 {
287 atmel,pins =
288 <AT91_PIOD 17 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>,
289 <AT91_PIOB 6 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>;
290 };
291
292 pinctrl_nand0_ale_cle: nand_ale_cle-0 {
293 atmel,pins =
294 <AT91_PIOB 2 AT91_PERIPH_A AT91_PINCTRL_NONE>,
295 <AT91_PIOB 3 AT91_PERIPH_A AT91_PINCTRL_NONE>;
296 };
297
298 pinctrl_nand0_oe_we: nand_oe_we-0 {
299 atmel,pins =
300 <AT91_PIOB 4 AT91_PERIPH_A AT91_PINCTRL_NONE>,
301 <AT91_PIOB 5 AT91_PERIPH_A AT91_PINCTRL_NONE>;
302 };
303
304 pinctrl_nand0_cs: nand_cs-0 {
305 atmel,pins =
306 <AT91_PIOB 6 AT91_PERIPH_A AT91_PINCTRL_NONE>;
307 };
308 };
309
310 ssc0 {
311 pinctrl_ssc0_tx: ssc0_tx-0 {
312 atmel,pins =
313 <AT91_PIOA 15 AT91_PERIPH_A AT91_PINCTRL_NONE>,
314 <AT91_PIOC 0 AT91_PERIPH_A AT91_PINCTRL_NONE>,
315 <AT91_PIOC 1 AT91_PERIPH_A AT91_PINCTRL_NONE>;
316 };
317
318 pinctrl_ssc0_rx: ssc0_rx-0 {
319 atmel,pins =
320 <AT91_PIOA 10 AT91_PERIPH_B AT91_PINCTRL_NONE>,
321 <AT91_PIOA 16 AT91_PERIPH_A AT91_PINCTRL_NONE>,
322 <AT91_PIOA 22 AT91_PERIPH_B AT91_PINCTRL_NONE>;
323 };
324 };
325
326 ssc1 {
327 pinctrl_ssc1_tx: ssc1_tx-0 {
328 atmel,pins =
329 <AT91_PIOA 13 AT91_PERIPH_B AT91_PINCTRL_NONE>,
330 <AT91_PIOA 29 AT91_PERIPH_B AT91_PINCTRL_NONE>,
331 <AT91_PIOA 30 AT91_PERIPH_B AT91_PINCTRL_NONE>;
332 };
333
334 pinctrl_ssc1_rx: ssc1_rx-0 {
335 atmel,pins =
336 <AT91_PIOA 8 AT91_PERIPH_B AT91_PINCTRL_NONE>,
337 <AT91_PIOA 9 AT91_PERIPH_B AT91_PINCTRL_NONE>,
338 <AT91_PIOA 14 AT91_PERIPH_B AT91_PINCTRL_NONE>;
339 };
340 };
341
342 spi0 {
343 pinctrl_spi0: spi0-0 {
344 atmel,pins =
345 <AT91_PIOA 25 AT91_PERIPH_A AT91_PINCTRL_NONE>,
346 <AT91_PIOA 26 AT91_PERIPH_A AT91_PINCTRL_NONE>,
347 <AT91_PIOA 27 AT91_PERIPH_A AT91_PINCTRL_NONE>;
348 };
349 };
350
351 tcb0 {
352 pinctrl_tcb0_tclk0: tcb0_tclk0-0 {
353 atmel,pins = <AT91_PIOA 3 AT91_PERIPH_B AT91_PINCTRL_NONE>;
354 };
355
356 pinctrl_tcb0_tclk1: tcb0_tclk1-0 {
357 atmel,pins = <AT91_PIOC 31 AT91_PERIPH_B AT91_PINCTRL_NONE>;
358 };
359
360 pinctrl_tcb0_tclk2: tcb0_tclk2-0 {
361 atmel,pins = <AT91_PIOD 21 AT91_PERIPH_A AT91_PINCTRL_NONE>;
362 };
363
364 pinctrl_tcb0_tioa0: tcb0_tioa0-0 {
365 atmel,pins = <AT91_PIOA 4 AT91_PERIPH_B AT91_PINCTRL_NONE>;
366 };
367
368 pinctrl_tcb0_tioa1: tcb0_tioa1-0 {
369 atmel,pins = <AT91_PIOC 29 AT91_PERIPH_B AT91_PINCTRL_NONE>;
370 };
371
372 pinctrl_tcb0_tioa2: tcb0_tioa2-0 {
373 atmel,pins = <AT91_PIOD 10 AT91_PERIPH_B AT91_PINCTRL_NONE>;
374 };
375
376 pinctrl_tcb0_tiob0: tcb0_tiob0-0 {
377 atmel,pins = <AT91_PIOA 5 AT91_PERIPH_B AT91_PINCTRL_NONE>;
378 };
379
380 pinctrl_tcb0_tiob1: tcb0_tiob1-0 {
381 atmel,pins = <AT91_PIOC 30 AT91_PERIPH_B AT91_PINCTRL_NONE>;
382 };
383
384 pinctrl_tcb0_tiob2: tcb0_tiob2-0 {
385 atmel,pins = <AT91_PIOD 11 AT91_PERIPH_B AT91_PINCTRL_NONE>;
386 };
387 };
388
389 usart0 {
390 pinctrl_usart0: usart0-0 {
391 atmel,pins =
392 <AT91_PIOA 6 AT91_PERIPH_A AT91_PINCTRL_NONE>,
393 <AT91_PIOA 7 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>;
394 };
395
396 pinctrl_usart0_rts: usart0_rts-0 {
397 atmel,pins =
398 <AT91_PIOA 9 AT91_PERIPH_A AT91_PINCTRL_NONE>;
399 };
400
401 pinctrl_usart0_cts: usart0_cts-0 {
402 atmel,pins =
403 <AT91_PIOA 10 AT91_PERIPH_A AT91_PINCTRL_NONE>;
404 };
405
406 pinctrl_usart0_dtr_dsr: usart0_dtr_dsr-0 {
407 atmel,pins =
408 <AT91_PIOD 14 AT91_PERIPH_A AT91_PINCTRL_NONE>,
409 <AT91_PIOD 15 AT91_PERIPH_A AT91_PINCTRL_NONE>;
410 };
411
412 pinctrl_usart0_dcd: usart0_dcd-0 {
413 atmel,pins =
414 <AT91_PIOD 16 AT91_PERIPH_A AT91_PINCTRL_NONE>;
415 };
416
417 pinctrl_usart0_ri: usart0_ri-0 {
418 atmel,pins =
419 <AT91_PIOD 17 AT91_PERIPH_A AT91_PINCTRL_NONE>;
420 };
421
422 pinctrl_usart0_sck: usart0_sck-0 {
423 atmel,pins =
424 <AT91_PIOA 8 AT91_PERIPH_A AT91_PINCTRL_NONE>;
425 };
426 };
427
428 usart1 {
429 pinctrl_usart1: usart1-0 {
430 atmel,pins =
431 <AT91_PIOA 11 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>,
432 <AT91_PIOA 12 AT91_PERIPH_A AT91_PINCTRL_NONE>;
433 };
434
435 pinctrl_usart1_rts: usart1_rts-0 {
436 atmel,pins =
437 <AT91_PIOA 18 AT91_PERIPH_B AT91_PINCTRL_NONE>;
438 };
439
440 pinctrl_usart1_cts: usart1_cts-0 {
441 atmel,pins =
442 <AT91_PIOA 19 AT91_PERIPH_B AT91_PINCTRL_NONE>;
443 };
444
445 pinctrl_usart1_sck: usart1_sck-0 {
446 atmel,pins =
447 <AT91_PIOD 2 AT91_PERIPH_B AT91_PINCTRL_NONE>;
448 };
449 };
450
451 usart2 {
452 pinctrl_usart2: usart2-0 {
453 atmel,pins =
454 <AT91_PIOA 13 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>,
455 <AT91_PIOA 14 AT91_PERIPH_A AT91_PINCTRL_NONE>;
456 };
457
458 pinctrl_usart2_rts: usart2_rts-0 {
459 atmel,pins =
460 <AT91_PIOA 29 AT91_PERIPH_A AT91_PINCTRL_NONE>;
461 };
462
463 pinctrl_usart2_cts: usart2_cts-0 {
464 atmel,pins =
465 <AT91_PIOA 30 AT91_PERIPH_A AT91_PINCTRL_NONE>;
466 };
467
468 pinctrl_usart2_sck: usart2_sck-0 {
469 atmel,pins =
470 <AT91_PIOD 9 AT91_PERIPH_A AT91_PINCTRL_NONE>;
471 };
472 };
473
474 usart3 {
475 pinctrl_usart3: usart3-0 {
476 atmel,pins =
477 <AT91_PIOB 0 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>,
478 <AT91_PIOB 1 AT91_PERIPH_A AT91_PINCTRL_NONE>;
479 };
480
481 pinctrl_usart3_rts: usart3_rts-0 {
482 atmel,pins =
483 <AT91_PIOD 4 AT91_PERIPH_B AT91_PINCTRL_NONE>;
484 };
485
486 pinctrl_usart3_cts: usart3_cts-0 {
487 atmel,pins =
488 <AT91_PIOD 3 AT91_PERIPH_B AT91_PINCTRL_NONE>;
489 };
490
491 pinctrl_usart3_sck: usart3_sck-0 {
492 atmel,pins =
493 <AT91_PIOA 20 AT91_PERIPH_B AT91_PINCTRL_NONE>;
494 };
495 };
496
497 pioA: gpio@fffff400 {
498 compatible = "atmel,at91rm9200-gpio";
499 reg = <0xfffff400 0x200>;
500 interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
501 #gpio-cells = <2>;
502 gpio-controller;
503 interrupt-controller;
504 #interrupt-cells = <2>;
505 clocks = <&pioA_clk>;
506 };
507
508 pioB: gpio@fffff600 {
509 compatible = "atmel,at91rm9200-gpio";
510 reg = <0xfffff600 0x200>;
511 interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
512 #gpio-cells = <2>;
513 gpio-controller;
514 interrupt-controller;
515 #interrupt-cells = <2>;
516 clocks = <&pioB_clk>;
517 };
518
519 pioC: gpio@fffff800 {
520 compatible = "atmel,at91rm9200-gpio";
521 reg = <0xfffff800 0x200>;
522 interrupts = <4 IRQ_TYPE_LEVEL_HIGH 1>;
523 #gpio-cells = <2>;
524 gpio-controller;
525 interrupt-controller;
526 #interrupt-cells = <2>;
527 clocks = <&pioC_clk>;
528 };
529
530 pioD: gpio@fffffa00 {
531 compatible = "atmel,at91rm9200-gpio";
532 reg = <0xfffffa00 0x200>;
533 interrupts = <5 IRQ_TYPE_LEVEL_HIGH 1>;
534 #gpio-cells = <2>;
535 gpio-controller;
536 interrupt-controller;
537 #interrupt-cells = <2>;
538 clocks = <&pioD_clk>;
539 };
540 };
541
542 pmc: pmc@fffffc00 {
543 compatible = "atmel,at91sam9g45-pmc";
544 reg = <0xfffffc00 0x100>;
545 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
546 interrupt-controller;
547 #address-cells = <1>;
548 #size-cells = <0>;
549 #interrupt-cells = <1>;
550
551 clk32k: slck {
552 compatible = "fixed-clock";
553 #clock-cells = <0>;
554 clock-frequency = <32768>;
555 };
556
557 main: mainck {
558 compatible = "atmel,at91rm9200-clk-main";
559 #clock-cells = <0>;
560 interrupts-extended = <&pmc AT91_PMC_MOSCS>;
561 clocks = <&clk32k>;
562 };
563
564 plla: pllack {
565 compatible = "atmel,at91rm9200-clk-pll";
566 #clock-cells = <0>;
567 interrupts-extended = <&pmc AT91_PMC_LOCKA>;
568 clocks = <&main>;
569 reg = <0>;
570 atmel,clk-input-range = <1000000 32000000>;
571 #atmel,pll-clk-output-range-cells = <4>;
572 atmel,pll-clk-output-ranges = <80000000 200000000 190000000 240000000>;
573 };
574
575 utmi: utmick {
576 compatible = "atmel,at91sam9x5-clk-utmi";
577 #clock-cells = <0>;
578 interrupt-parent = <&pmc>;
579 interrupts = <AT91_PMC_LOCKU>;
580 clocks = <&main>;
581 };
582
583 mck: masterck {
584 compatible = "atmel,at91rm9200-clk-master";
585 #clock-cells = <0>;
586 interrupts-extended = <&pmc AT91_PMC_MCKRDY>;
587 clocks = <&clk32k>, <&main>, <&plla>, <&utmi>;
588 atmel,clk-output-range = <0 94000000>;
589 atmel,clk-divisors = <1 2 4 3>;
590 };
591
592 prog: progck {
593 compatible = "atmel,at91rm9200-clk-programmable";
594 #address-cells = <1>;
595 #size-cells = <0>;
596 interrupt-parent = <&pmc>;
597 clocks = <&clk32k>, <&main>, <&plla>, <&utmi>, <&mck>;
598
599 prog0: prog0 {
600 #clock-cells = <0>;
601 reg = <0>;
602 interrupts = <AT91_PMC_PCKRDY(0)>;
603 };
604
605 prog1: prog1 {
606 #clock-cells = <0>;
607 reg = <1>;
608 interrupts = <AT91_PMC_PCKRDY(1)>;
609 };
610 };
611
612 systemck {
613 compatible = "atmel,at91rm9200-clk-system";
614 #address-cells = <1>;
615 #size-cells = <0>;
616
617 pck0: pck0 {
618 #clock-cells = <0>;
619 reg = <8>;
620 clocks = <&prog0>;
621 };
622
623 pck1: pck1 {
624 #clock-cells = <0>;
625 reg = <9>;
626 clocks = <&prog1>;
627 };
628
629 };
630
631 periphck {
632 compatible = "atmel,at91rm9200-clk-peripheral";
633 #address-cells = <1>;
634 #size-cells = <0>;
635 clocks = <&mck>;
636
637 pioA_clk: pioA_clk {
638 #clock-cells = <0>;
639 reg = <2>;
640 };
641
642 pioB_clk: pioB_clk {
643 #clock-cells = <0>;
644 reg = <3>;
645 };
646
647 pioC_clk: pioC_clk {
648 #clock-cells = <0>;
649 reg = <4>;
650 };
651
652 pioD_clk: pioD_clk {
653 #clock-cells = <0>;
654 reg = <5>;
655 };
656
657 usart0_clk: usart0_clk {
658 #clock-cells = <0>;
659 reg = <6>;
660 };
661
662 usart1_clk: usart1_clk {
663 #clock-cells = <0>;
664 reg = <7>;
665 };
666
667 usart2_clk: usart2_clk {
668 #clock-cells = <0>;
669 reg = <8>;
670 };
671
672 usart3_clk: usart3_clk {
673 #clock-cells = <0>;
674 reg = <9>;
675 };
676
677 mci0_clk: mci0_clk {
678 #clock-cells = <0>;
679 reg = <10>;
680 };
681
682 twi0_clk: twi0_clk {
683 #clock-cells = <0>;
684 reg = <11>;
685 };
686
687 twi1_clk: twi1_clk {
688 #clock-cells = <0>;
689 reg = <12>;
690 };
691
692 spi0_clk: spi0_clk {
693 #clock-cells = <0>;
694 reg = <13>;
695 };
696
697 ssc0_clk: ssc0_clk {
698 #clock-cells = <0>;
699 reg = <14>;
700 };
701
702 ssc1_clk: ssc1_clk {
703 #clock-cells = <0>;
704 reg = <15>;
705 };
706
707 tc0_clk: tc0_clk {
708 #clock-cells = <0>;
709 reg = <16>;
710 };
711
712 tc1_clk: tc1_clk {
713 #clock-cells = <0>;
714 reg = <17>;
715 };
716
717 tc2_clk: tc2_clk {
718 #clock-cells = <0>;
719 reg = <18>;
720 };
721
722 pwm_clk: pwm_clk {
723 #clock-cells = <0>;
724 reg = <19>;
725 };
726
727 adc_clk: adc_clk {
728 #clock-cells = <0>;
729 reg = <20>;
730 };
731
732 dma0_clk: dma0_clk {
733 #clock-cells = <0>;
734 reg = <21>;
735 };
736
737 udphs_clk: udphs_clk {
738 #clock-cells = <0>;
739 reg = <22>;
740 };
741
742 lcd_clk: lcd_clk {
743 #clock-cells = <0>;
744 reg = <23>;
745 };
746 };
747 };
748
749 rstc@fffffd00 {
750 compatible = "atmel,at91sam9260-rstc";
751 reg = <0xfffffd00 0x10>;
752 };
753
754 shdwc@fffffd10 {
755 compatible = "atmel,at91sam9260-shdwc";
756 reg = <0xfffffd10 0x10>;
757 };
758
759 pit: timer@fffffd30 {
760 compatible = "atmel,at91sam9260-pit";
761 reg = <0xfffffd30 0xf>;
762 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
763 clocks = <&mck>;
764 };
765
766 watchdog@fffffd40 {
767 compatible = "atmel,at91sam9260-wdt";
768 reg = <0xfffffd40 0x10>;
769 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
770 status = "disabled";
771 };
772 };
773 };
774
775 i2c@0 {
776 compatible = "i2c-gpio";
777 gpios = <&pioA 23 GPIO_ACTIVE_HIGH>, /* sda */
778 <&pioA 24 GPIO_ACTIVE_HIGH>; /* scl */
779 i2c-gpio,sda-open-drain;
780 i2c-gpio,scl-open-drain;
781 i2c-gpio,delay-us = <2>; /* ~100 kHz */
782 #address-cells = <1>;
783 #size-cells = <0>;
784 pinctrl-names = "default";
785 pinctrl-0 = <&pinctrl_i2c_gpio0>;
786 status = "disabled";
787 };
788
789 i2c@1 {
790 compatible = "i2c-gpio";
791 gpios = <&pioD 10 GPIO_ACTIVE_HIGH>, /* sda */
792 <&pioD 11 GPIO_ACTIVE_HIGH>; /* scl */
793 i2c-gpio,sda-open-drain;
794 i2c-gpio,scl-open-drain;
795 i2c-gpio,delay-us = <2>; /* ~100 kHz */
796 #address-cells = <1>;
797 #size-cells = <0>;
798 pinctrl-names = "default";
799 pinctrl-0 = <&pinctrl_i2c_gpio1>;
800 status = "disabled";
801 };
802};
diff --git a/arch/arm/boot/dts/at91sam9rlek.dts b/arch/arm/boot/dts/at91sam9rlek.dts
new file mode 100644
index 000000000000..cddb37825fad
--- /dev/null
+++ b/arch/arm/boot/dts/at91sam9rlek.dts
@@ -0,0 +1,157 @@
1/*
2 * at91sam9rlek.dts - Device Tree file for Atmel at91sam9rl reference board
3 *
4 * Copyright (C) 2014 Alexandre Belloni <alexandre.belloni@free-electrons.com>
5 *
6 * Licensed under GPLv2 only
7 */
8/dts-v1/;
9#include "at91sam9rl.dtsi"
10
11/ {
12 model = "Atmel at91sam9rlek";
13 compatible = "atmel,at91sam9rlek", "atmel,at91sam9rl", "atmel,at91sam9";
14
15 chosen {
16 bootargs = "console=ttyS0,115200 rootfstype=ubifs root=ubi0:rootfs ubi.mtd=5 rw";
17 };
18
19 memory {
20 reg = <0x20000000 0x4000000>;
21 };
22
23 clocks {
24 #address-cells = <1>;
25 #size-cells = <1>;
26 ranges;
27
28 main_clock: clock {
29 compatible = "atmel,osc", "fixed-clock";
30 clock-frequency = <12000000>;
31 };
32 };
33
34 ahb {
35 nand0: nand@40000000 {
36 nand-bus-width = <8>;
37 nand-ecc-mode = "soft";
38 nand-on-flash-bbt = <1>;
39 status = "okay";
40
41 at91bootstrap@0 {
42 label = "at91bootstrap";
43 reg = <0x0 0x40000>;
44 };
45
46 bootloader@40000 {
47 label = "bootloader";
48 reg = <0x40000 0x80000>;
49 };
50
51 bootloaderenv@c0000 {
52 label = "bootloader env";
53 reg = <0xc0000 0xc0000>;
54 };
55
56 dtb@180000 {
57 label = "device tree";
58 reg = <0x180000 0x80000>;
59 };
60
61 kernel@200000 {
62 label = "kernel";
63 reg = <0x200000 0x600000>;
64 };
65
66 rootfs@800000 {
67 label = "rootfs";
68 reg = <0x800000 0x0f800000>;
69 };
70 };
71
72 apb {
73 mmc0: mmc@fffa4000 {
74 pinctrl-0 = <
75 &pinctrl_board_mmc0
76 &pinctrl_mmc0_clk
77 &pinctrl_mmc0_slot0_cmd_dat0
78 &pinctrl_mmc0_slot0_dat1_3>;
79 status = "okay";
80 slot@0 {
81 reg = <0>;
82 bus-width = <4>;
83 cd-gpios = <&pioA 15 GPIO_ACTIVE_HIGH>;
84 };
85 };
86
87 usart0: serial@fffb0000 {
88 pinctrl-0 = <
89 &pinctrl_usart0
90 &pinctrl_usart0_rts
91 &pinctrl_usart0_cts>;
92 status = "okay";
93 };
94
95 dbgu: serial@fffff200 {
96 status = "okay";
97 };
98
99 pinctrl@fffff400 {
100 mmc0 {
101 pinctrl_board_mmc0: mmc0-board {
102 atmel,pins =
103 <AT91_PIOA 15 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
104 };
105 };
106 };
107
108 pmc: pmc@fffffc00 {
109 main: mainck {
110 clock-frequency = <12000000>;
111 };
112 };
113
114 watchdog@fffffd40 {
115 status = "okay";
116 };
117 };
118 };
119
120 leds {
121 compatible = "gpio-leds";
122
123 ds1 {
124 label = "ds1";
125 gpios = <&pioD 15 GPIO_ACTIVE_LOW>;
126 };
127
128 ds2 {
129 label = "ds2";
130 gpios = <&pioD 16 GPIO_ACTIVE_LOW>;
131 };
132
133 ds3 {
134 label = "ds3";
135 gpios = <&pioD 14 GPIO_ACTIVE_HIGH>;
136 linux,default-trigger = "heartbeat";
137 };
138 };
139
140 gpio_keys {
141 compatible = "gpio-keys";
142
143 right_click {
144 label = "right_click";
145 gpios = <&pioB 0 GPIO_ACTIVE_LOW>;
146 linux,code = <273>;
147 gpio-key,wakeup;
148 };
149
150 left_click {
151 label = "left_click";
152 gpios = <&pioB 1 GPIO_ACTIVE_LOW>;
153 linux,code = <272>;
154 gpio-key,wakeup;
155 };
156 };
157};
diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
index 174219de92fa..fc13c9240da8 100644
--- a/arch/arm/boot/dts/at91sam9x5.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5.dtsi
@@ -621,41 +621,42 @@
621 }; 621 };
622 622
623 adc0: adc@f804c000 { 623 adc0: adc@f804c000 {
624 #address-cells = <1>;
625 #size-cells = <0>;
624 compatible = "atmel,at91sam9260-adc"; 626 compatible = "atmel,at91sam9260-adc";
625 reg = <0xf804c000 0x100>; 627 reg = <0xf804c000 0x100>;
626 interrupts = <19 IRQ_TYPE_LEVEL_HIGH 0>; 628 interrupts = <19 IRQ_TYPE_LEVEL_HIGH 0>;
627 atmel,adc-use-external; 629 atmel,adc-use-external-triggers;
628 atmel,adc-channels-used = <0xffff>; 630 atmel,adc-channels-used = <0xffff>;
629 atmel,adc-vref = <3300>; 631 atmel,adc-vref = <3300>;
630 atmel,adc-num-channels = <12>;
631 atmel,adc-startup-time = <40>; 632 atmel,adc-startup-time = <40>;
632 atmel,adc-channel-base = <0x50>;
633 atmel,adc-drdy-mask = <0x1000000>;
634 atmel,adc-status-register = <0x30>;
635 atmel,adc-trigger-register = <0xc0>;
636 atmel,adc-res = <8 10>; 633 atmel,adc-res = <8 10>;
637 atmel,adc-res-names = "lowres", "highres"; 634 atmel,adc-res-names = "lowres", "highres";
638 atmel,adc-use-res = "highres"; 635 atmel,adc-use-res = "highres";
639 636
640 trigger@0 { 637 trigger@0 {
638 reg = <0>;
641 trigger-name = "external-rising"; 639 trigger-name = "external-rising";
642 trigger-value = <0x1>; 640 trigger-value = <0x1>;
643 trigger-external; 641 trigger-external;
644 }; 642 };
645 643
646 trigger@1 { 644 trigger@1 {
645 reg = <1>;
647 trigger-name = "external-falling"; 646 trigger-name = "external-falling";
648 trigger-value = <0x2>; 647 trigger-value = <0x2>;
649 trigger-external; 648 trigger-external;
650 }; 649 };
651 650
652 trigger@2 { 651 trigger@2 {
652 reg = <2>;
653 trigger-name = "external-any"; 653 trigger-name = "external-any";
654 trigger-value = <0x3>; 654 trigger-value = <0x3>;
655 trigger-external; 655 trigger-external;
656 }; 656 };
657 657
658 trigger@3 { 658 trigger@3 {
659 reg = <3>;
659 trigger-name = "continuous"; 660 trigger-name = "continuous";
660 trigger-value = <0x6>; 661 trigger-value = <0x6>;
661 }; 662 };
@@ -790,6 +791,7 @@
790 atmel,pmecc-lookup-table-offset = <0x0 0x8000>; 791 atmel,pmecc-lookup-table-offset = <0x0 0x8000>;
791 atmel,nand-addr-offset = <21>; 792 atmel,nand-addr-offset = <21>;
792 atmel,nand-cmd-offset = <22>; 793 atmel,nand-cmd-offset = <22>;
794 atmel,nand-has-dma;
793 pinctrl-names = "default"; 795 pinctrl-names = "default";
794 pinctrl-0 = <&pinctrl_nand>; 796 pinctrl-0 = <&pinctrl_nand>;
795 gpios = <&pioD 5 GPIO_ACTIVE_HIGH 797 gpios = <&pioD 5 GPIO_ACTIVE_HIGH
diff --git a/arch/arm/boot/dts/atlas6.dtsi b/arch/arm/boot/dts/atlas6.dtsi
index f8674bcc4489..9d72674049d6 100644
--- a/arch/arm/boot/dts/atlas6.dtsi
+++ b/arch/arm/boot/dts/atlas6.dtsi
@@ -65,9 +65,10 @@
65 #clock-cells = <1>; 65 #clock-cells = <1>;
66 }; 66 };
67 67
68 reset-controller@88010000 { 68 rstc: reset-controller@88010000 {
69 compatible = "sirf,prima2-rstc"; 69 compatible = "sirf,prima2-rstc";
70 reg = <0x88010000 0x1000>; 70 reg = <0x88010000 0x1000>;
71 #reset-cells = <1>;
71 }; 72 };
72 73
73 rsc-controller@88020000 { 74 rsc-controller@88020000 {
@@ -217,8 +218,8 @@
217 interrupts = <17>; 218 interrupts = <17>;
218 fifosize = <128>; 219 fifosize = <128>;
219 clocks = <&clks 13>; 220 clocks = <&clks 13>;
220 sirf,uart-dma-rx-channel = <21>; 221 dmas = <&dmac1 5>, <&dmac0 2>;
221 sirf,uart-dma-tx-channel = <2>; 222 dma-names = "rx", "tx";
222 }; 223 };
223 224
224 uart1: uart@b0060000 { 225 uart1: uart@b0060000 {
@@ -228,6 +229,7 @@
228 interrupts = <18>; 229 interrupts = <18>;
229 fifosize = <32>; 230 fifosize = <32>;
230 clocks = <&clks 14>; 231 clocks = <&clks 14>;
232 dma-names = "no-rx", "no-tx";
231 }; 233 };
232 234
233 uart2: uart@b0070000 { 235 uart2: uart@b0070000 {
@@ -237,8 +239,8 @@
237 interrupts = <19>; 239 interrupts = <19>;
238 fifosize = <128>; 240 fifosize = <128>;
239 clocks = <&clks 15>; 241 clocks = <&clks 15>;
240 sirf,uart-dma-rx-channel = <6>; 242 dmas = <&dmac0 6>, <&dmac0 7>;
241 sirf,uart-dma-tx-channel = <7>; 243 dma-names = "rx", "tx";
242 }; 244 };
243 245
244 usp0: usp@b0080000 { 246 usp0: usp@b0080000 {
@@ -248,8 +250,8 @@
248 interrupts = <20>; 250 interrupts = <20>;
249 fifosize = <128>; 251 fifosize = <128>;
250 clocks = <&clks 28>; 252 clocks = <&clks 28>;
251 sirf,usp-dma-rx-channel = <17>; 253 dmas = <&dmac1 1>, <&dmac1 2>;
252 sirf,usp-dma-tx-channel = <18>; 254 dma-names = "rx", "tx";
253 }; 255 };
254 256
255 usp1: usp@b0090000 { 257 usp1: usp@b0090000 {
@@ -259,8 +261,8 @@
259 interrupts = <21>; 261 interrupts = <21>;
260 fifosize = <128>; 262 fifosize = <128>;
261 clocks = <&clks 29>; 263 clocks = <&clks 29>;
262 sirf,usp-dma-rx-channel = <14>; 264 dmas = <&dmac0 14>, <&dmac0 15>;
263 sirf,usp-dma-tx-channel = <15>; 265 dma-names = "rx", "tx";
264 }; 266 };
265 267
266 dmac0: dma-controller@b00b0000 { 268 dmac0: dma-controller@b00b0000 {
@@ -269,6 +271,7 @@
269 reg = <0xb00b0000 0x10000>; 271 reg = <0xb00b0000 0x10000>;
270 interrupts = <12>; 272 interrupts = <12>;
271 clocks = <&clks 24>; 273 clocks = <&clks 24>;
274 #dma-cells = <1>;
272 }; 275 };
273 276
274 dmac1: dma-controller@b0160000 { 277 dmac1: dma-controller@b0160000 {
@@ -277,6 +280,7 @@
277 reg = <0xb0160000 0x10000>; 280 reg = <0xb0160000 0x10000>;
278 interrupts = <13>; 281 interrupts = <13>;
279 clocks = <&clks 25>; 282 clocks = <&clks 25>;
283 #dma-cells = <1>;
280 }; 284 };
281 285
282 vip@b00C0000 { 286 vip@b00C0000 {
diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi
index 792fde1b7f75..64d069bcc409 100644
--- a/arch/arm/boot/dts/bcm11351.dtsi
+++ b/arch/arm/boot/dts/bcm11351.dtsi
@@ -14,6 +14,8 @@
14#include <dt-bindings/interrupt-controller/arm-gic.h> 14#include <dt-bindings/interrupt-controller/arm-gic.h>
15#include <dt-bindings/interrupt-controller/irq.h> 15#include <dt-bindings/interrupt-controller/irq.h>
16 16
17#include "dt-bindings/clock/bcm281xx.h"
18
17#include "skeleton.dtsi" 19#include "skeleton.dtsi"
18 20
19/ { 21/ {
@@ -43,7 +45,7 @@
43 compatible = "brcm,bcm11351-dw-apb-uart", "snps,dw-apb-uart"; 45 compatible = "brcm,bcm11351-dw-apb-uart", "snps,dw-apb-uart";
44 status = "disabled"; 46 status = "disabled";
45 reg = <0x3e000000 0x1000>; 47 reg = <0x3e000000 0x1000>;
46 clocks = <&uartb_clk>; 48 clocks = <&slave_ccu BCM281XX_SLAVE_CCU_UARTB>;
47 interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>; 49 interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>;
48 reg-shift = <2>; 50 reg-shift = <2>;
49 reg-io-width = <4>; 51 reg-io-width = <4>;
@@ -53,7 +55,7 @@
53 compatible = "brcm,bcm11351-dw-apb-uart", "snps,dw-apb-uart"; 55 compatible = "brcm,bcm11351-dw-apb-uart", "snps,dw-apb-uart";
54 status = "disabled"; 56 status = "disabled";
55 reg = <0x3e001000 0x1000>; 57 reg = <0x3e001000 0x1000>;
56 clocks = <&uartb2_clk>; 58 clocks = <&slave_ccu BCM281XX_SLAVE_CCU_UARTB2>;
57 interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>; 59 interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>;
58 reg-shift = <2>; 60 reg-shift = <2>;
59 reg-io-width = <4>; 61 reg-io-width = <4>;
@@ -63,7 +65,7 @@
63 compatible = "brcm,bcm11351-dw-apb-uart", "snps,dw-apb-uart"; 65 compatible = "brcm,bcm11351-dw-apb-uart", "snps,dw-apb-uart";
64 status = "disabled"; 66 status = "disabled";
65 reg = <0x3e002000 0x1000>; 67 reg = <0x3e002000 0x1000>;
66 clocks = <&uartb3_clk>; 68 clocks = <&slave_ccu BCM281XX_SLAVE_CCU_UARTB3>;
67 interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>; 69 interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
68 reg-shift = <2>; 70 reg-shift = <2>;
69 reg-io-width = <4>; 71 reg-io-width = <4>;
@@ -73,7 +75,7 @@
73 compatible = "brcm,bcm11351-dw-apb-uart", "snps,dw-apb-uart"; 75 compatible = "brcm,bcm11351-dw-apb-uart", "snps,dw-apb-uart";
74 status = "disabled"; 76 status = "disabled";
75 reg = <0x3e003000 0x1000>; 77 reg = <0x3e003000 0x1000>;
76 clocks = <&uartb4_clk>; 78 clocks = <&slave_ccu BCM281XX_SLAVE_CCU_UARTB4>;
77 interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>; 79 interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
78 reg-shift = <2>; 80 reg-shift = <2>;
79 reg-io-width = <4>; 81 reg-io-width = <4>;
@@ -95,7 +97,7 @@
95 compatible = "brcm,kona-timer"; 97 compatible = "brcm,kona-timer";
96 reg = <0x35006000 0x1000>; 98 reg = <0x35006000 0x1000>;
97 interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; 99 interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
98 clocks = <&hub_timer_clk>; 100 clocks = <&aon_ccu BCM281XX_AON_CCU_HUB_TIMER>;
99 }; 101 };
100 102
101 gpio: gpio@35003000 { 103 gpio: gpio@35003000 {
@@ -118,7 +120,7 @@
118 compatible = "brcm,kona-sdhci"; 120 compatible = "brcm,kona-sdhci";
119 reg = <0x3f180000 0x10000>; 121 reg = <0x3f180000 0x10000>;
120 interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>; 122 interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
121 clocks = <&sdio1_clk>; 123 clocks = <&master_ccu BCM281XX_MASTER_CCU_SDIO1>;
122 status = "disabled"; 124 status = "disabled";
123 }; 125 };
124 126
@@ -126,7 +128,7 @@
126 compatible = "brcm,kona-sdhci"; 128 compatible = "brcm,kona-sdhci";
127 reg = <0x3f190000 0x10000>; 129 reg = <0x3f190000 0x10000>;
128 interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>; 130 interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
129 clocks = <&sdio2_clk>; 131 clocks = <&master_ccu BCM281XX_MASTER_CCU_SDIO2>;
130 status = "disabled"; 132 status = "disabled";
131 }; 133 };
132 134
@@ -134,7 +136,7 @@
134 compatible = "brcm,kona-sdhci"; 136 compatible = "brcm,kona-sdhci";
135 reg = <0x3f1a0000 0x10000>; 137 reg = <0x3f1a0000 0x10000>;
136 interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>; 138 interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
137 clocks = <&sdio3_clk>; 139 clocks = <&master_ccu BCM281XX_MASTER_CCU_SDIO3>;
138 status = "disabled"; 140 status = "disabled";
139 }; 141 };
140 142
@@ -142,7 +144,7 @@
142 compatible = "brcm,kona-sdhci"; 144 compatible = "brcm,kona-sdhci";
143 reg = <0x3f1b0000 0x10000>; 145 reg = <0x3f1b0000 0x10000>;
144 interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>; 146 interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
145 clocks = <&sdio4_clk>; 147 clocks = <&master_ccu BCM281XX_MASTER_CCU_SDIO4>;
146 status = "disabled"; 148 status = "disabled";
147 }; 149 };
148 150
@@ -157,7 +159,7 @@
157 interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>; 159 interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
158 #address-cells = <1>; 160 #address-cells = <1>;
159 #size-cells = <0>; 161 #size-cells = <0>;
160 clocks = <&bsc1_clk>; 162 clocks = <&slave_ccu BCM281XX_SLAVE_CCU_BSC1>;
161 status = "disabled"; 163 status = "disabled";
162 }; 164 };
163 165
@@ -167,7 +169,7 @@
167 interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>; 169 interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
168 #address-cells = <1>; 170 #address-cells = <1>;
169 #size-cells = <0>; 171 #size-cells = <0>;
170 clocks = <&bsc2_clk>; 172 clocks = <&slave_ccu BCM281XX_SLAVE_CCU_BSC2>;
171 status = "disabled"; 173 status = "disabled";
172 }; 174 };
173 175
@@ -177,7 +179,7 @@
177 interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>; 179 interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
178 #address-cells = <1>; 180 #address-cells = <1>;
179 #size-cells = <0>; 181 #size-cells = <0>;
180 clocks = <&bsc3_clk>; 182 clocks = <&slave_ccu BCM281XX_SLAVE_CCU_BSC3>;
181 status = "disabled"; 183 status = "disabled";
182 }; 184 };
183 185
@@ -187,105 +189,191 @@
187 interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; 189 interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
188 #address-cells = <1>; 190 #address-cells = <1>;
189 #size-cells = <0>; 191 #size-cells = <0>;
190 clocks = <&pmu_bsc_clk>; 192 clocks = <&aon_ccu BCM281XX_AON_CCU_PMU_BSC>;
191 status = "disabled"; 193 status = "disabled";
192 }; 194 };
193 195
194 clocks { 196 clocks {
195 bsc1_clk: bsc1 { 197 #address-cells = <1>;
196 compatible = "fixed-clock"; 198 #size-cells = <1>;
197 clock-frequency = <13000000>; 199 ranges;
200
201 root_ccu: root_ccu {
202 compatible = "brcm,bcm11351-root-ccu";
203 reg = <0x35001000 0x0f00>;
204 #clock-cells = <1>;
205 clock-output-names = "frac_1m";
206 };
207
208 hub_ccu: hub_ccu {
209 compatible = "brcm,bcm11351-hub-ccu";
210 reg = <0x34000000 0x0f00>;
211 #clock-cells = <1>;
212 clock-output-names = "tmon_1m";
213 };
214
215 aon_ccu: aon_ccu {
216 compatible = "brcm,bcm11351-aon-ccu";
217 reg = <0x35002000 0x0f00>;
218 #clock-cells = <1>;
219 clock-output-names = "hub_timer",
220 "pmu_bsc",
221 "pmu_bsc_var";
222 };
223
224 master_ccu: master_ccu {
225 compatible = "brcm,bcm11351-master-ccu";
226 reg = <0x3f001000 0x0f00>;
227 #clock-cells = <1>;
228 clock-output-names = "sdio1",
229 "sdio2",
230 "sdio3",
231 "sdio4",
232 "usb_ic",
233 "hsic2_48m",
234 "hsic2_12m";
235 };
236
237 slave_ccu: slave_ccu {
238 compatible = "brcm,bcm11351-slave-ccu";
239 reg = <0x3e011000 0x0f00>;
240 #clock-cells = <1>;
241 clock-output-names = "uartb",
242 "uartb2",
243 "uartb3",
244 "uartb4",
245 "ssp0",
246 "ssp2",
247 "bsc1",
248 "bsc2",
249 "bsc3",
250 "pwm";
251 };
252
253 ref_1m_clk: ref_1m {
198 #clock-cells = <0>; 254 #clock-cells = <0>;
255 compatible = "fixed-clock";
256 clock-frequency = <1000000>;
199 }; 257 };
200 258
201 bsc2_clk: bsc2 { 259 ref_32k_clk: ref_32k {
260 #clock-cells = <0>;
202 compatible = "fixed-clock"; 261 compatible = "fixed-clock";
203 clock-frequency = <13000000>; 262 clock-frequency = <32768>;
263 };
264
265 bbl_32k_clk: bbl_32k {
204 #clock-cells = <0>; 266 #clock-cells = <0>;
267 compatible = "fixed-clock";
268 clock-frequency = <32768>;
205 }; 269 };
206 270
207 bsc3_clk: bsc3 { 271 ref_13m_clk: ref_13m {
272 #clock-cells = <0>;
208 compatible = "fixed-clock"; 273 compatible = "fixed-clock";
209 clock-frequency = <13000000>; 274 clock-frequency = <13000000>;
210 #clock-cells = <0>;
211 }; 275 };
212 276
213 pmu_bsc_clk: pmu_bsc { 277 var_13m_clk: var_13m {
278 #clock-cells = <0>;
214 compatible = "fixed-clock"; 279 compatible = "fixed-clock";
215 clock-frequency = <13000000>; 280 clock-frequency = <13000000>;
216 #clock-cells = <0>;
217 }; 281 };
218 282
219 hub_timer_clk: hub_timer { 283 dft_19_5m_clk: dft_19_5m {
220 compatible = "fixed-clock";
221 clock-frequency = <32768>;
222 #clock-cells = <0>; 284 #clock-cells = <0>;
285 compatible = "fixed-clock";
286 clock-frequency = <19500000>;
223 }; 287 };
224 288
225 pwm_clk: pwm { 289 ref_crystal_clk: ref_crystal {
290 #clock-cells = <0>;
226 compatible = "fixed-clock"; 291 compatible = "fixed-clock";
227 clock-frequency = <26000000>; 292 clock-frequency = <26000000>;
228 #clock-cells = <0>;
229 }; 293 };
230 294
231 sdio1_clk: sdio1 { 295 ref_cx40_clk: ref_cx40 {
232 compatible = "fixed-clock";
233 clock-frequency = <48000000>;
234 #clock-cells = <0>; 296 #clock-cells = <0>;
297 compatible = "fixed-clock";
298 clock-frequency = <40000000>;
235 }; 299 };
236 300
237 sdio2_clk: sdio2 { 301 ref_52m_clk: ref_52m {
238 compatible = "fixed-clock";
239 clock-frequency = <48000000>;
240 #clock-cells = <0>; 302 #clock-cells = <0>;
303 compatible = "fixed-clock";
304 clock-frequency = <52000000>;
241 }; 305 };
242 306
243 sdio3_clk: sdio3 { 307 var_52m_clk: var_52m {
244 compatible = "fixed-clock";
245 clock-frequency = <48000000>;
246 #clock-cells = <0>; 308 #clock-cells = <0>;
309 compatible = "fixed-clock";
310 clock-frequency = <52000000>;
247 }; 311 };
248 312
249 sdio4_clk: sdio4 { 313 usb_otg_ahb_clk: usb_otg_ahb {
250 compatible = "fixed-clock"; 314 compatible = "fixed-clock";
251 clock-frequency = <48000000>; 315 clock-frequency = <52000000>;
252 #clock-cells = <0>; 316 #clock-cells = <0>;
253 }; 317 };
254 318
255 tmon_1m_clk: tmon_1m { 319 ref_96m_clk: ref_96m {
256 compatible = "fixed-clock";
257 clock-frequency = <1000000>;
258 #clock-cells = <0>; 320 #clock-cells = <0>;
321 compatible = "fixed-clock";
322 clock-frequency = <96000000>;
259 }; 323 };
260 324
261 uartb_clk: uartb { 325 var_96m_clk: var_96m {
262 compatible = "fixed-clock";
263 clock-frequency = <13000000>;
264 #clock-cells = <0>; 326 #clock-cells = <0>;
327 compatible = "fixed-clock";
328 clock-frequency = <96000000>;
265 }; 329 };
266 330
267 uartb2_clk: uartb2 { 331 ref_104m_clk: ref_104m {
332 #clock-cells = <0>;
268 compatible = "fixed-clock"; 333 compatible = "fixed-clock";
269 clock-frequency = <13000000>; 334 clock-frequency = <104000000>;
335 };
336
337 var_104m_clk: var_104m {
270 #clock-cells = <0>; 338 #clock-cells = <0>;
339 compatible = "fixed-clock";
340 clock-frequency = <104000000>;
271 }; 341 };
272 342
273 uartb3_clk: uartb3 { 343 ref_156m_clk: ref_156m {
344 #clock-cells = <0>;
274 compatible = "fixed-clock"; 345 compatible = "fixed-clock";
275 clock-frequency = <13000000>; 346 clock-frequency = <156000000>;
347 };
348
349 var_156m_clk: var_156m {
276 #clock-cells = <0>; 350 #clock-cells = <0>;
351 compatible = "fixed-clock";
352 clock-frequency = <156000000>;
277 }; 353 };
278 354
279 uartb4_clk: uartb4 { 355 ref_208m_clk: ref_208m {
356 #clock-cells = <0>;
280 compatible = "fixed-clock"; 357 compatible = "fixed-clock";
281 clock-frequency = <13000000>; 358 clock-frequency = <208000000>;
359 };
360
361 var_208m_clk: var_208m {
282 #clock-cells = <0>; 362 #clock-cells = <0>;
363 compatible = "fixed-clock";
364 clock-frequency = <208000000>;
283 }; 365 };
284 366
285 usb_otg_ahb_clk: usb_otg_ahb { 367 ref_312m_clk: ref_312m {
368 #clock-cells = <0>;
286 compatible = "fixed-clock"; 369 compatible = "fixed-clock";
287 clock-frequency = <52000000>; 370 clock-frequency = <312000000>;
371 };
372
373 var_312m_clk: var_312m {
288 #clock-cells = <0>; 374 #clock-cells = <0>;
375 compatible = "fixed-clock";
376 clock-frequency = <312000000>;
289 }; 377 };
290 }; 378 };
291 379
diff --git a/arch/arm/boot/dts/bcm11351-brt.dts b/arch/arm/boot/dts/bcm21664-garnet.dts
index 396b70459cdc..e87cb26ddf84 100644
--- a/arch/arm/boot/dts/bcm11351-brt.dts
+++ b/arch/arm/boot/dts/bcm21664-garnet.dts
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2012 Broadcom Corporation 2 * Copyright (C) 2014 Broadcom Corporation
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 as 5 * modify it under the terms of the GNU General Public License as
@@ -13,11 +13,13 @@
13 13
14/dts-v1/; 14/dts-v1/;
15 15
16#include "bcm11351.dtsi" 16#include <dt-bindings/gpio/gpio.h>
17
18#include "bcm21664.dtsi"
17 19
18/ { 20/ {
19 model = "BCM11351 BRT board"; 21 model = "BCM21664 Garnet board";
20 compatible = "brcm,bcm11351-brt", "brcm,bcm11351"; 22 compatible = "brcm,bcm21664-garnet", "brcm,bcm21664";
21 23
22 memory { 24 memory {
23 reg = <0x80000000 0x40000000>; /* 1 GB */ 25 reg = <0x80000000 0x40000000>; /* 1 GB */
@@ -40,7 +42,7 @@
40 42
41 sdio4: sdio@3f1b0000 { 43 sdio4: sdio@3f1b0000 {
42 max-frequency = <48000000>; 44 max-frequency = <48000000>;
43 cd-gpios = <&gpio 14 0>; 45 cd-gpios = <&gpio 91 GPIO_ACTIVE_LOW>;
44 status = "okay"; 46 status = "okay";
45 }; 47 };
46 48
diff --git a/arch/arm/boot/dts/bcm21664.dtsi b/arch/arm/boot/dts/bcm21664.dtsi
new file mode 100644
index 000000000000..08a44d41b672
--- /dev/null
+++ b/arch/arm/boot/dts/bcm21664.dtsi
@@ -0,0 +1,292 @@
1/*
2 * Copyright (C) 2014 Broadcom Corporation
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation version 2.
7 *
8 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
9 * kind, whether express or implied; without even the implied warranty
10 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#include <dt-bindings/interrupt-controller/arm-gic.h>
15#include <dt-bindings/interrupt-controller/irq.h>
16
17#include "skeleton.dtsi"
18
19/ {
20 model = "BCM21664 SoC";
21 compatible = "brcm,bcm21664";
22 interrupt-parent = <&gic>;
23
24 chosen {
25 bootargs = "console=ttyS0,115200n8";
26 };
27
28 gic: interrupt-controller@3ff00100 {
29 compatible = "arm,cortex-a9-gic";
30 #interrupt-cells = <3>;
31 #address-cells = <0>;
32 interrupt-controller;
33 reg = <0x3ff01000 0x1000>,
34 <0x3ff00100 0x100>;
35 };
36
37 smc@0x3404e000 {
38 compatible = "brcm,bcm21664-smc", "brcm,kona-smc";
39 reg = <0x3404e000 0x400>; /* 1 KiB in SRAM */
40 };
41
42 uart@3e000000 {
43 compatible = "brcm,bcm21664-dw-apb-uart", "snps,dw-apb-uart";
44 status = "disabled";
45 reg = <0x3e000000 0x118>;
46 clocks = <&uartb_clk>;
47 interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>;
48 reg-shift = <2>;
49 reg-io-width = <4>;
50 };
51
52 uart@3e001000 {
53 compatible = "brcm,bcm21664-dw-apb-uart", "snps,dw-apb-uart";
54 status = "disabled";
55 reg = <0x3e001000 0x118>;
56 clocks = <&uartb2_clk>;
57 interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>;
58 reg-shift = <2>;
59 reg-io-width = <4>;
60 };
61
62 uart@3e002000 {
63 compatible = "brcm,bcm21664-dw-apb-uart", "snps,dw-apb-uart";
64 status = "disabled";
65 reg = <0x3e002000 0x118>;
66 clocks = <&uartb3_clk>;
67 interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
68 reg-shift = <2>;
69 reg-io-width = <4>;
70 };
71
72 L2: l2-cache {
73 compatible = "arm,pl310-cache";
74 reg = <0x3ff20000 0x1000>;
75 cache-unified;
76 cache-level = <2>;
77 };
78
79 brcm,resetmgr@35001f00 {
80 compatible = "brcm,bcm21664-resetmgr";
81 reg = <0x35001f00 0x24>;
82 };
83
84 timer@35006000 {
85 compatible = "brcm,kona-timer";
86 reg = <0x35006000 0x1c>;
87 interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
88 clocks = <&hub_timer_clk>;
89 };
90
91 gpio: gpio@35003000 {
92 compatible = "brcm,bcm21664-gpio", "brcm,kona-gpio";
93 reg = <0x35003000 0x524>;
94 interrupts =
95 <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH
96 GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH
97 GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH
98 GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
99 #gpio-cells = <2>;
100 #interrupt-cells = <2>;
101 gpio-controller;
102 interrupt-controller;
103 };
104
105 sdio1: sdio@3f180000 {
106 compatible = "brcm,kona-sdhci";
107 reg = <0x3f180000 0x801c>;
108 interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
109 clocks = <&sdio1_clk>;
110 status = "disabled";
111 };
112
113 sdio2: sdio@3f190000 {
114 compatible = "brcm,kona-sdhci";
115 reg = <0x3f190000 0x801c>;
116 interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
117 clocks = <&sdio2_clk>;
118 status = "disabled";
119 };
120
121 sdio3: sdio@3f1a0000 {
122 compatible = "brcm,kona-sdhci";
123 reg = <0x3f1a0000 0x801c>;
124 interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
125 clocks = <&sdio3_clk>;
126 status = "disabled";
127 };
128
129 sdio4: sdio@3f1b0000 {
130 compatible = "brcm,kona-sdhci";
131 reg = <0x3f1b0000 0x801c>;
132 interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
133 clocks = <&sdio4_clk>;
134 status = "disabled";
135 };
136
137 i2c@3e016000 {
138 compatible = "brcm,bcm21664-i2c", "brcm,kona-i2c";
139 reg = <0x3e016000 0x70>;
140 interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
141 #address-cells = <1>;
142 #size-cells = <0>;
143 clocks = <&bsc1_clk>;
144 status = "disabled";
145 };
146
147 i2c@3e017000 {
148 compatible = "brcm,bcm21664-i2c", "brcm,kona-i2c";
149 reg = <0x3e017000 0x70>;
150 interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
151 #address-cells = <1>;
152 #size-cells = <0>;
153 clocks = <&bsc2_clk>;
154 status = "disabled";
155 };
156
157 i2c@3e018000 {
158 compatible = "brcm,bcm21664-i2c", "brcm,kona-i2c";
159 reg = <0x3e018000 0x70>;
160 interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
161 #address-cells = <1>;
162 #size-cells = <0>;
163 clocks = <&bsc3_clk>;
164 status = "disabled";
165 };
166
167 i2c@3e01c000 {
168 compatible = "brcm,bcm21664-i2c", "brcm,kona-i2c";
169 reg = <0x3e01c000 0x70>;
170 interrupts = <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>;
171 #address-cells = <1>;
172 #size-cells = <0>;
173 clocks = <&bsc4_clk>;
174 status = "disabled";
175 };
176
177 clocks {
178 bsc1_clk: bsc1 {
179 compatible = "fixed-clock";
180 clock-frequency = <13000000>;
181 #clock-cells = <0>;
182 };
183
184 bsc2_clk: bsc2 {
185 compatible = "fixed-clock";
186 clock-frequency = <13000000>;
187 #clock-cells = <0>;
188 };
189
190 bsc3_clk: bsc3 {
191 compatible = "fixed-clock";
192 clock-frequency = <13000000>;
193 #clock-cells = <0>;
194 };
195
196 bsc4_clk: bsc4 {
197 compatible = "fixed-clock";
198 clock-frequency = <13000000>;
199 #clock-cells = <0>;
200 };
201
202 pmu_bsc_clk: pmu_bsc {
203 compatible = "fixed-clock";
204 clock-frequency = <13000000>;
205 #clock-cells = <0>;
206 };
207
208 hub_timer_clk: hub_timer {
209 compatible = "fixed-clock";
210 clock-frequency = <32768>;
211 #clock-cells = <0>;
212 };
213
214 pwm_clk: pwm {
215 compatible = "fixed-clock";
216 clock-frequency = <26000000>;
217 #clock-cells = <0>;
218 };
219
220 sdio1_clk: sdio1 {
221 compatible = "fixed-clock";
222 clock-frequency = <48000000>;
223 #clock-cells = <0>;
224 };
225
226 sdio2_clk: sdio2 {
227 compatible = "fixed-clock";
228 clock-frequency = <48000000>;
229 #clock-cells = <0>;
230 };
231
232 sdio3_clk: sdio3 {
233 compatible = "fixed-clock";
234 clock-frequency = <48000000>;
235 #clock-cells = <0>;
236 };
237
238 sdio4_clk: sdio4 {
239 compatible = "fixed-clock";
240 clock-frequency = <48000000>;
241 #clock-cells = <0>;
242 };
243
244 tmon_1m_clk: tmon_1m {
245 compatible = "fixed-clock";
246 clock-frequency = <1000000>;
247 #clock-cells = <0>;
248 };
249
250 uartb_clk: uartb {
251 compatible = "fixed-clock";
252 clock-frequency = <13000000>;
253 #clock-cells = <0>;
254 };
255
256 uartb2_clk: uartb2 {
257 compatible = "fixed-clock";
258 clock-frequency = <13000000>;
259 #clock-cells = <0>;
260 };
261
262 uartb3_clk: uartb3 {
263 compatible = "fixed-clock";
264 clock-frequency = <13000000>;
265 #clock-cells = <0>;
266 };
267
268 usb_otg_ahb_clk: usb_otg_ahb {
269 compatible = "fixed-clock";
270 clock-frequency = <52000000>;
271 #clock-cells = <0>;
272 };
273 };
274
275 usbotg: usb@3f120000 {
276 compatible = "snps,dwc2";
277 reg = <0x3f120000 0x10000>;
278 interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;
279 clocks = <&usb_otg_ahb_clk>;
280 clock-names = "otg";
281 phys = <&usbphy>;
282 phy-names = "usb2-phy";
283 status = "disabled";
284 };
285
286 usbphy: usb-phy@3f130000 {
287 compatible = "brcm,kona-usb2-phy";
288 reg = <0x3f130000 0x28>;
289 #phy-cells = <0>;
290 status = "disabled";
291 };
292};
diff --git a/arch/arm/boot/dts/bcm28155-ap.dts b/arch/arm/boot/dts/bcm28155-ap.dts
index 5ff2382a49e4..af3da55eef49 100644
--- a/arch/arm/boot/dts/bcm28155-ap.dts
+++ b/arch/arm/boot/dts/bcm28155-ap.dts
@@ -46,27 +46,32 @@
46 46
47 i2c@3500d000 { 47 i2c@3500d000 {
48 status="okay"; 48 status="okay";
49 clock-frequency = <400000>; 49 clock-frequency = <100000>;
50 };
51 50
52 sdio1: sdio@3f180000 { 51 pmu: pmu@8 {
53 max-frequency = <48000000>; 52 reg = <0x08>;
54 status = "okay"; 53 };
55 }; 54 };
56 55
57 sdio2: sdio@3f190000 { 56 sdio2: sdio@3f190000 {
58 non-removable; 57 non-removable;
59 max-frequency = <48000000>; 58 max-frequency = <48000000>;
59 vmmc-supply = <&camldo1_reg>;
60 vqmmc-supply = <&iosr1_reg>;
60 status = "okay"; 61 status = "okay";
61 }; 62 };
62 63
63 sdio4: sdio@3f1b0000 { 64 sdio4: sdio@3f1b0000 {
64 max-frequency = <48000000>; 65 max-frequency = <48000000>;
65 cd-gpios = <&gpio 14 GPIO_ACTIVE_LOW>; 66 cd-gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
67 vmmc-supply = <&sdldo_reg>;
68 vqmmc-supply = <&sdxldo_reg>;
66 status = "okay"; 69 status = "okay";
67 }; 70 };
68 71
69 usbotg: usb@3f120000 { 72 usbotg: usb@3f120000 {
73 vusb_d-supply = <&usbldo_reg>;
74 vusb_a-supply = <&iosr1_reg>;
70 status = "okay"; 75 status = "okay";
71 }; 76 };
72 77
@@ -74,3 +79,39 @@
74 status = "okay"; 79 status = "okay";
75 }; 80 };
76}; 81};
82
83#include "bcm59056.dtsi"
84
85&pmu {
86 compatible = "brcm,bcm59056";
87 interrupts = <GIC_SPI 215 IRQ_TYPE_LEVEL_HIGH>;
88 regulators {
89 camldo1_reg: camldo1 {
90 regulator-min-microvolt = <3300000>;
91 regulator-max-microvolt = <3300000>;
92 regulator-always-on;
93 };
94
95 sdldo_reg: sdldo {
96 regulator-min-microvolt = <3000000>;
97 regulator-max-microvolt = <3000000>;
98 };
99
100 sdxldo_reg: sdxldo {
101 regulator-min-microvolt = <2700000>;
102 regulator-max-microvolt = <3300000>;
103 };
104
105 usbldo_reg: usbldo {
106 regulator-min-microvolt = <3300000>;
107 regulator-max-microvolt = <3300000>;
108 regulator-always-on;
109 };
110
111 iosr1_reg: iosr1 {
112 regulator-min-microvolt = <1800000>;
113 regulator-max-microvolt = <1800000>;
114 regulator-always-on;
115 };
116 };
117};
diff --git a/arch/arm/boot/dts/bcm2835.dtsi b/arch/arm/boot/dts/bcm2835.dtsi
index b021c96d3ba1..b8473c43e888 100644
--- a/arch/arm/boot/dts/bcm2835.dtsi
+++ b/arch/arm/boot/dts/bcm2835.dtsi
@@ -15,39 +15,52 @@
15 #size-cells = <1>; 15 #size-cells = <1>;
16 ranges = <0x7e000000 0x20000000 0x02000000>; 16 ranges = <0x7e000000 0x20000000 0x02000000>;
17 17
18 timer { 18 timer@7e003000 {
19 compatible = "brcm,bcm2835-system-timer"; 19 compatible = "brcm,bcm2835-system-timer";
20 reg = <0x7e003000 0x1000>; 20 reg = <0x7e003000 0x1000>;
21 interrupts = <1 0>, <1 1>, <1 2>, <1 3>; 21 interrupts = <1 0>, <1 1>, <1 2>, <1 3>;
22 clock-frequency = <1000000>; 22 clock-frequency = <1000000>;
23 }; 23 };
24 24
25 intc: interrupt-controller { 25 dma: dma@7e007000 {
26 compatible = "brcm,bcm2835-dma";
27 reg = <0x7e007000 0xf00>;
28 interrupts = <1 16>,
29 <1 17>,
30 <1 18>,
31 <1 19>,
32 <1 20>,
33 <1 21>,
34 <1 22>,
35 <1 23>,
36 <1 24>,
37 <1 25>,
38 <1 26>,
39 <1 27>,
40 <1 28>;
41
42 #dma-cells = <1>;
43 brcm,dma-channel-mask = <0x7f35>;
44 };
45
46 intc: interrupt-controller@7e00b200 {
26 compatible = "brcm,bcm2835-armctrl-ic"; 47 compatible = "brcm,bcm2835-armctrl-ic";
27 reg = <0x7e00b200 0x200>; 48 reg = <0x7e00b200 0x200>;
28 interrupt-controller; 49 interrupt-controller;
29 #interrupt-cells = <2>; 50 #interrupt-cells = <2>;
30 }; 51 };
31 52
32 watchdog { 53 watchdog@7e100000 {
33 compatible = "brcm,bcm2835-pm-wdt"; 54 compatible = "brcm,bcm2835-pm-wdt";
34 reg = <0x7e100000 0x28>; 55 reg = <0x7e100000 0x28>;
35 }; 56 };
36 57
37 rng { 58 rng@7e104000 {
38 compatible = "brcm,bcm2835-rng"; 59 compatible = "brcm,bcm2835-rng";
39 reg = <0x7e104000 0x10>; 60 reg = <0x7e104000 0x10>;
40 }; 61 };
41 62
42 uart@20201000 { 63 gpio: gpio@7e200000 {
43 compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell";
44 reg = <0x7e201000 0x1000>;
45 interrupts = <2 25>;
46 clock-frequency = <3000000>;
47 arm,primecell-periphid = <0x00241011>;
48 };
49
50 gpio: gpio {
51 compatible = "brcm,bcm2835-gpio"; 64 compatible = "brcm,bcm2835-gpio";
52 reg = <0x7e200000 0xb4>; 65 reg = <0x7e200000 0xb4>;
53 /* 66 /*
@@ -70,7 +83,25 @@
70 #interrupt-cells = <2>; 83 #interrupt-cells = <2>;
71 }; 84 };
72 85
73 spi: spi@20204000 { 86 uart@7e201000 {
87 compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell";
88 reg = <0x7e201000 0x1000>;
89 interrupts = <2 25>;
90 clock-frequency = <3000000>;
91 arm,primecell-periphid = <0x00241011>;
92 };
93
94 i2s: i2s@7e203000 {
95 compatible = "brcm,bcm2835-i2s";
96 reg = <0x7e203000 0x20>,
97 <0x7e101098 0x02>;
98
99 dmas = <&dma 2>,
100 <&dma 3>;
101 dma-names = "tx", "rx";
102 };
103
104 spi: spi@7e204000 {
74 compatible = "brcm,bcm2835-spi"; 105 compatible = "brcm,bcm2835-spi";
75 reg = <0x7e204000 0x1000>; 106 reg = <0x7e204000 0x1000>;
76 interrupts = <2 22>; 107 interrupts = <2 22>;
@@ -90,7 +121,15 @@
90 status = "disabled"; 121 status = "disabled";
91 }; 122 };
92 123
93 i2c1: i2c@20804000 { 124 sdhci: sdhci@7e300000 {
125 compatible = "brcm,bcm2835-sdhci";
126 reg = <0x7e300000 0x100>;
127 interrupts = <2 30>;
128 clocks = <&clk_mmc>;
129 status = "disabled";
130 };
131
132 i2c1: i2c@7e804000 {
94 compatible = "brcm,bcm2835-i2c"; 133 compatible = "brcm,bcm2835-i2c";
95 reg = <0x7e804000 0x1000>; 134 reg = <0x7e804000 0x1000>;
96 interrupts = <2 21>; 135 interrupts = <2 21>;
@@ -100,19 +139,15 @@
100 status = "disabled"; 139 status = "disabled";
101 }; 140 };
102 141
103 sdhci: sdhci { 142 usb@7e980000 {
104 compatible = "brcm,bcm2835-sdhci";
105 reg = <0x7e300000 0x100>;
106 interrupts = <2 30>;
107 clocks = <&clk_mmc>;
108 status = "disabled";
109 };
110
111 usb {
112 compatible = "brcm,bcm2835-usb"; 143 compatible = "brcm,bcm2835-usb";
113 reg = <0x7e980000 0x10000>; 144 reg = <0x7e980000 0x10000>;
114 interrupts = <1 9>; 145 interrupts = <1 9>;
115 }; 146 };
147
148 arm-pmu {
149 compatible = "arm,arm1176-pmu";
150 };
116 }; 151 };
117 152
118 clocks { 153 clocks {
@@ -120,24 +155,27 @@
120 #address-cells = <1>; 155 #address-cells = <1>;
121 #size-cells = <0>; 156 #size-cells = <0>;
122 157
123 clk_mmc: mmc { 158 clk_mmc: clock@0 {
124 compatible = "fixed-clock"; 159 compatible = "fixed-clock";
125 reg = <0>; 160 reg = <0>;
126 #clock-cells = <0>; 161 #clock-cells = <0>;
162 clock-output-names = "mmc";
127 clock-frequency = <100000000>; 163 clock-frequency = <100000000>;
128 }; 164 };
129 165
130 clk_i2c: i2c { 166 clk_i2c: clock@1 {
131 compatible = "fixed-clock"; 167 compatible = "fixed-clock";
132 reg = <1>; 168 reg = <1>;
133 #clock-cells = <0>; 169 #clock-cells = <0>;
170 clock-output-names = "i2c";
134 clock-frequency = <250000000>; 171 clock-frequency = <250000000>;
135 }; 172 };
136 173
137 clk_spi: spi { 174 clk_spi: clock@2 {
138 compatible = "fixed-clock"; 175 compatible = "fixed-clock";
139 reg = <2>; 176 reg = <2>;
140 #clock-cells = <0>; 177 #clock-cells = <0>;
178 clock-output-names = "spi";
141 clock-frequency = <250000000>; 179 clock-frequency = <250000000>;
142 }; 180 };
143 }; 181 };
diff --git a/arch/arm/boot/dts/bcm4708-netgear-r6250.dts b/arch/arm/boot/dts/bcm4708-netgear-r6250.dts
new file mode 100644
index 000000000000..3b5259de5a38
--- /dev/null
+++ b/arch/arm/boot/dts/bcm4708-netgear-r6250.dts
@@ -0,0 +1,35 @@
1/*
2 * Broadcom BCM470X / BCM5301X arm platform code.
3 * DTS for Netgear R6250 V1
4 *
5 * Copyright 2013 Hauke Mehrtens <hauke@hauke-m.de>
6 *
7 * Licensed under the GNU/GPL. See COPYING for details.
8 */
9
10/dts-v1/;
11
12#include "bcm4708.dtsi"
13
14/ {
15 compatible = "netgear,r6250v1", "brcm,bcm4708";
16 model = "Netgear R6250 V1 (BCM4708)";
17
18 chosen {
19 bootargs = "console=ttyS0,115200";
20 };
21
22 memory {
23 reg = <0x00000000 0x08000000>;
24 };
25
26 chipcommonA {
27 uart0: serial@0300 {
28 status = "okay";
29 };
30
31 uart1: serial@0400 {
32 status = "okay";
33 };
34 };
35};
diff --git a/arch/arm/boot/dts/bcm4708.dtsi b/arch/arm/boot/dts/bcm4708.dtsi
new file mode 100644
index 000000000000..31141e83fedd
--- /dev/null
+++ b/arch/arm/boot/dts/bcm4708.dtsi
@@ -0,0 +1,34 @@
1/*
2 * Broadcom BCM470X / BCM5301X ARM platform code.
3 * DTS for BCM4708 SoC.
4 *
5 * Copyright 2013-2014 Hauke Mehrtens <hauke@hauke-m.de>
6 *
7 * Licensed under the GNU/GPL. See COPYING for details.
8 */
9
10#include "bcm5301x.dtsi"
11
12/ {
13 compatible = "brcm,bcm4708";
14
15 cpus {
16 #address-cells = <1>;
17 #size-cells = <0>;
18
19 cpu@0 {
20 device_type = "cpu";
21 compatible = "arm,cortex-a9";
22 next-level-cache = <&L2>;
23 reg = <0x0>;
24 };
25
26 cpu@1 {
27 device_type = "cpu";
28 compatible = "arm,cortex-a9";
29 next-level-cache = <&L2>;
30 reg = <0x1>;
31 };
32 };
33
34};
diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi
new file mode 100644
index 000000000000..53c624f766b4
--- /dev/null
+++ b/arch/arm/boot/dts/bcm5301x.dtsi
@@ -0,0 +1,95 @@
1/*
2 * Broadcom BCM470X / BCM5301X ARM platform code.
3 * Generic DTS part for all BCM53010, BCM53011, BCM53012, BCM53014, BCM53015,
4 * BCM53016, BCM53017, BCM53018, BCM4707, BCM4708 and BCM4709 SoCs
5 *
6 * Copyright 2013-2014 Hauke Mehrtens <hauke@hauke-m.de>
7 *
8 * Licensed under the GNU/GPL. See COPYING for details.
9 */
10
11#include <dt-bindings/interrupt-controller/irq.h>
12#include <dt-bindings/interrupt-controller/arm-gic.h>
13#include "skeleton.dtsi"
14
15/ {
16 interrupt-parent = <&gic>;
17
18 chipcommonA {
19 compatible = "simple-bus";
20 ranges = <0x00000000 0x18000000 0x00001000>;
21 #address-cells = <1>;
22 #size-cells = <1>;
23
24 uart0: serial@0300 {
25 compatible = "ns16550";
26 reg = <0x0300 0x100>;
27 interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
28 clock-frequency = <100000000>;
29 status = "disabled";
30 };
31
32 uart1: serial@0400 {
33 compatible = "ns16550";
34 reg = <0x0400 0x100>;
35 interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
36 clock-frequency = <100000000>;
37 status = "disabled";
38 };
39 };
40
41 mpcore {
42 compatible = "simple-bus";
43 ranges = <0x00000000 0x19020000 0x00003000>;
44 #address-cells = <1>;
45 #size-cells = <1>;
46
47 scu@0000 {
48 compatible = "arm,cortex-a9-scu";
49 reg = <0x0000 0x100>;
50 };
51
52 timer@0200 {
53 compatible = "arm,cortex-a9-global-timer";
54 reg = <0x0200 0x100>;
55 interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
56 clocks = <&clk_periph>;
57 };
58
59 local-timer@0600 {
60 compatible = "arm,cortex-a9-twd-timer";
61 reg = <0x0600 0x100>;
62 interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
63 clocks = <&clk_periph>;
64 };
65
66 gic: interrupt-controller@1000 {
67 compatible = "arm,cortex-a9-gic";
68 #interrupt-cells = <3>;
69 #address-cells = <0>;
70 interrupt-controller;
71 reg = <0x1000 0x1000>,
72 <0x0100 0x100>;
73 };
74
75 L2: cache-controller@2000 {
76 compatible = "arm,pl310-cache";
77 reg = <0x2000 0x1000>;
78 cache-unified;
79 cache-level = <2>;
80 };
81 };
82
83 clocks {
84 #address-cells = <1>;
85 #size-cells = <0>;
86
87 /* As long as we do not have a real clock driver us this
88 * fixed clock */
89 clk_periph: periph {
90 compatible = "fixed-clock";
91 #clock-cells = <0>;
92 clock-frequency = <400000000>;
93 };
94 };
95};
diff --git a/arch/arm/boot/dts/bcm59056.dtsi b/arch/arm/boot/dts/bcm59056.dtsi
new file mode 100644
index 000000000000..dfadaaa89b05
--- /dev/null
+++ b/arch/arm/boot/dts/bcm59056.dtsi
@@ -0,0 +1,74 @@
1/*
2* Copyright 2014 Linaro Limited
3* Author: Matt Porter <mporter@linaro.org>
4*
5* This program is free software; you can redistribute it and/or modify it
6* under the terms of the GNU General Public License as published by the
7* Free Software Foundation; either version 2 of the License, or (at your
8* option) any later version.
9*/
10
11&pmu {
12 compatible = "brcm,bcm59056";
13 regulators {
14 rfldo_reg: rfldo {
15 };
16
17 camldo1_reg: camldo1 {
18 };
19
20 camldo2_reg: camldo2 {
21 };
22
23 simldo1_reg: simldo1 {
24 };
25
26 simldo2_reg: simldo2 {
27 };
28
29 sdldo_reg: sdldo {
30 };
31
32 sdxldo_reg: sdxldo {
33 };
34
35 mmcldo1_reg: mmcldo1 {
36 };
37
38 mmcldo2_reg: mmcldo2 {
39 };
40
41 audldo_reg: audldo {
42 };
43
44 micldo_reg: micldo {
45 };
46
47 usbldo_reg: usbldo {
48 };
49
50 vibldo_reg: vibldo {
51 };
52
53 csr_reg: csr {
54 };
55
56 iosr1_reg: iosr1 {
57 };
58
59 iosr2_reg: iosr2 {
60 };
61
62 msr_reg: msr {
63 };
64
65 sdsr1_reg: sdsr1 {
66 };
67
68 sdsr2_reg: sdsr2 {
69 };
70
71 vsr_reg: vsr {
72 };
73 };
74};
diff --git a/arch/arm/boot/dts/dove.dtsi b/arch/arm/boot/dts/dove.dtsi
index 187fd46b7b5e..3b891dd20993 100644
--- a/arch/arm/boot/dts/dove.dtsi
+++ b/arch/arm/boot/dts/dove.dtsi
@@ -186,6 +186,11 @@
186 reg = <0x20000 0x80>, <0x800100 0x8>; 186 reg = <0x20000 0x80>, <0x800100 0x8>;
187 }; 187 };
188 188
189 sysc: system-ctrl@20000 {
190 compatible = "marvell,orion-system-controller";
191 reg = <0x20000 0x110>;
192 };
193
189 bridge_intc: bridge-interrupt-ctrl@20110 { 194 bridge_intc: bridge-interrupt-ctrl@20110 {
190 compatible = "marvell,orion-bridge-intc"; 195 compatible = "marvell,orion-bridge-intc";
191 interrupt-controller; 196 interrupt-controller;
@@ -210,6 +215,14 @@
210 clocks = <&core_clk 0>; 215 clocks = <&core_clk 0>;
211 }; 216 };
212 217
218 watchdog@20300 {
219 compatible = "marvell,orion-wdt";
220 reg = <0x20300 0x28>, <0x20108 0x4>;
221 interrupt-parent = <&bridge_intc>;
222 interrupts = <3>;
223 clocks = <&core_clk 0>;
224 };
225
213 crypto: crypto-engine@30000 { 226 crypto: crypto-engine@30000 {
214 compatible = "marvell,orion-crypto"; 227 compatible = "marvell,orion-crypto";
215 reg = <0x30000 0x10000>, 228 reg = <0x30000 0x10000>,
@@ -381,7 +394,8 @@
381 394
382 pinctrl: pin-ctrl@d0200 { 395 pinctrl: pin-ctrl@d0200 {
383 compatible = "marvell,dove-pinctrl"; 396 compatible = "marvell,dove-pinctrl";
384 reg = <0xd0200 0x10>; 397 reg = <0xd0200 0x14>,
398 <0xd0440 0x04>;
385 clocks = <&gate_clk 22>; 399 clocks = <&gate_clk 22>;
386 400
387 pmx_gpio_0: pmx-gpio-0 { 401 pmx_gpio_0: pmx-gpio-0 {
@@ -603,6 +617,12 @@
603 reg = <0xd8500 0x20>; 617 reg = <0xd8500 0x20>;
604 }; 618 };
605 619
620 gconf: global-config@e802c {
621 compatible = "marvell,dove-global-config",
622 "syscon";
623 reg = <0xe802c 0x14>;
624 };
625
606 gpio2: gpio-ctrl@e8400 { 626 gpio2: gpio-ctrl@e8400 {
607 compatible = "marvell,orion-gpio"; 627 compatible = "marvell,orion-gpio";
608 #gpio-cells = <2>; 628 #gpio-cells = <2>;
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 1fd75aa4639d..1c0f8e1893ae 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -47,6 +47,11 @@
47 1000000 1060000 47 1000000 1060000
48 1176000 1160000 48 1176000 1160000
49 >; 49 >;
50
51 clocks = <&dpll_mpu_ck>;
52 clock-names = "cpu";
53
54 clock-latency = <300000>; /* From omap-cpufreq driver */
50 }; 55 };
51 cpu@1 { 56 cpu@1 {
52 device_type = "cpu"; 57 device_type = "cpu";
@@ -149,6 +154,22 @@
149 ti,hwmods = "counter_32k"; 154 ti,hwmods = "counter_32k";
150 }; 155 };
151 156
157 dra7_ctrl_general: tisyscon@4a002e00 {
158 compatible = "syscon";
159 reg = <0x4a002e00 0x7c>;
160 };
161
162 pbias_regulator: pbias_regulator {
163 compatible = "ti,pbias-omap";
164 reg = <0 0x4>;
165 syscon = <&dra7_ctrl_general>;
166 pbias_mmc_reg: pbias_mmc_omap5 {
167 regulator-name = "pbias_mmc_omap5";
168 regulator-min-microvolt = <1800000>;
169 regulator-max-microvolt = <3000000>;
170 };
171 };
172
152 dra7_pmx_core: pinmux@4a003400 { 173 dra7_pmx_core: pinmux@4a003400 {
153 compatible = "pinctrl-single"; 174 compatible = "pinctrl-single";
154 reg = <0x4a003400 0x0464>; 175 reg = <0x4a003400 0x0464>;
@@ -464,6 +485,20 @@
464 ti,hwmods = "wd_timer2"; 485 ti,hwmods = "wd_timer2";
465 }; 486 };
466 487
488 hwspinlock: spinlock@4a0f6000 {
489 compatible = "ti,omap4-hwspinlock";
490 reg = <0x4a0f6000 0x1000>;
491 ti,hwmods = "spinlock";
492 #hwlock-cells = <1>;
493 };
494
495 dmm@4e000000 {
496 compatible = "ti,omap5-dmm";
497 reg = <0x4e000000 0x800>;
498 interrupts = <0 113 0x4>;
499 ti,hwmods = "dmm";
500 };
501
467 i2c1: i2c@48070000 { 502 i2c1: i2c@48070000 {
468 compatible = "ti,omap4-i2c"; 503 compatible = "ti,omap4-i2c";
469 reg = <0x48070000 0x100>; 504 reg = <0x48070000 0x100>;
@@ -524,6 +559,7 @@
524 dmas = <&sdma 61>, <&sdma 62>; 559 dmas = <&sdma 61>, <&sdma 62>;
525 dma-names = "tx", "rx"; 560 dma-names = "tx", "rx";
526 status = "disabled"; 561 status = "disabled";
562 pbias-supply = <&pbias_mmc_reg>;
527 }; 563 };
528 564
529 mmc2: mmc@480b4000 { 565 mmc2: mmc@480b4000 {
@@ -559,6 +595,138 @@
559 status = "disabled"; 595 status = "disabled";
560 }; 596 };
561 597
598 abb_mpu: regulator-abb-mpu {
599 compatible = "ti,abb-v3";
600 regulator-name = "abb_mpu";
601 #address-cells = <0>;
602 #size-cells = <0>;
603 clocks = <&sys_clkin1>;
604 ti,settling-time = <50>;
605 ti,clock-cycles = <16>;
606
607 reg = <0x4ae07ddc 0x4>, <0x4ae07de0 0x4>,
608 <0x4ae06014 0x4>, <0x4a003b20 0x8>,
609 <0x4ae0c158 0x4>;
610 reg-names = "setup-address", "control-address",
611 "int-address", "efuse-address",
612 "ldo-address";
613 ti,tranxdone-status-mask = <0x80>;
614 /* LDOVBBMPU_FBB_MUX_CTRL */
615 ti,ldovbb-override-mask = <0x400>;
616 /* LDOVBBMPU_FBB_VSET_OUT */
617 ti,ldovbb-vset-mask = <0x1F>;
618
619 /*
620 * NOTE: only FBB mode used but actual vset will
621 * determine final biasing
622 */
623 ti,abb_info = <
624 /*uV ABB efuse rbb_m fbb_m vset_m*/
625 1060000 0 0x0 0 0x02000000 0x01F00000
626 1160000 0 0x4 0 0x02000000 0x01F00000
627 1210000 0 0x8 0 0x02000000 0x01F00000
628 >;
629 };
630
631 abb_ivahd: regulator-abb-ivahd {
632 compatible = "ti,abb-v3";
633 regulator-name = "abb_ivahd";
634 #address-cells = <0>;
635 #size-cells = <0>;
636 clocks = <&sys_clkin1>;
637 ti,settling-time = <50>;
638 ti,clock-cycles = <16>;
639
640 reg = <0x4ae07e34 0x4>, <0x4ae07e24 0x4>,
641 <0x4ae06010 0x4>, <0x4a0025cc 0x8>,
642 <0x4a002470 0x4>;
643 reg-names = "setup-address", "control-address",
644 "int-address", "efuse-address",
645 "ldo-address";
646 ti,tranxdone-status-mask = <0x40000000>;
647 /* LDOVBBIVA_FBB_MUX_CTRL */
648 ti,ldovbb-override-mask = <0x400>;
649 /* LDOVBBIVA_FBB_VSET_OUT */
650 ti,ldovbb-vset-mask = <0x1F>;
651
652 /*
653 * NOTE: only FBB mode used but actual vset will
654 * determine final biasing
655 */
656 ti,abb_info = <
657 /*uV ABB efuse rbb_m fbb_m vset_m*/
658 1055000 0 0x0 0 0x02000000 0x01F00000
659 1150000 0 0x4 0 0x02000000 0x01F00000
660 1250000 0 0x8 0 0x02000000 0x01F00000
661 >;
662 };
663
664 abb_dspeve: regulator-abb-dspeve {
665 compatible = "ti,abb-v3";
666 regulator-name = "abb_dspeve";
667 #address-cells = <0>;
668 #size-cells = <0>;
669 clocks = <&sys_clkin1>;
670 ti,settling-time = <50>;
671 ti,clock-cycles = <16>;
672
673 reg = <0x4ae07e30 0x4>, <0x4ae07e20 0x4>,
674 <0x4ae06010 0x4>, <0x4a0025e0 0x8>,
675 <0x4a00246c 0x4>;
676 reg-names = "setup-address", "control-address",
677 "int-address", "efuse-address",
678 "ldo-address";
679 ti,tranxdone-status-mask = <0x20000000>;
680 /* LDOVBBDSPEVE_FBB_MUX_CTRL */
681 ti,ldovbb-override-mask = <0x400>;
682 /* LDOVBBDSPEVE_FBB_VSET_OUT */
683 ti,ldovbb-vset-mask = <0x1F>;
684
685 /*
686 * NOTE: only FBB mode used but actual vset will
687 * determine final biasing
688 */
689 ti,abb_info = <
690 /*uV ABB efuse rbb_m fbb_m vset_m*/
691 1055000 0 0x0 0 0x02000000 0x01F00000
692 1150000 0 0x4 0 0x02000000 0x01F00000
693 1250000 0 0x8 0 0x02000000 0x01F00000
694 >;
695 };
696
697 abb_gpu: regulator-abb-gpu {
698 compatible = "ti,abb-v3";
699 regulator-name = "abb_gpu";
700 #address-cells = <0>;
701 #size-cells = <0>;
702 clocks = <&sys_clkin1>;
703 ti,settling-time = <50>;
704 ti,clock-cycles = <16>;
705
706 reg = <0x4ae07de4 0x4>, <0x4ae07de8 0x4>,
707 <0x4ae06010 0x4>, <0x4a003b08 0x8>,
708 <0x4ae0c154 0x4>;
709 reg-names = "setup-address", "control-address",
710 "int-address", "efuse-address",
711 "ldo-address";
712 ti,tranxdone-status-mask = <0x10000000>;
713 /* LDOVBBGPU_FBB_MUX_CTRL */
714 ti,ldovbb-override-mask = <0x400>;
715 /* LDOVBBGPU_FBB_VSET_OUT */
716 ti,ldovbb-vset-mask = <0x1F>;
717
718 /*
719 * NOTE: only FBB mode used but actual vset will
720 * determine final biasing
721 */
722 ti,abb_info = <
723 /*uV ABB efuse rbb_m fbb_m vset_m*/
724 1090000 0 0x0 0 0x02000000 0x01F00000
725 1210000 0 0x4 0 0x02000000 0x01F00000
726 1280000 0 0x8 0 0x02000000 0x01F00000
727 >;
728 };
729
562 mcspi1: spi@48098000 { 730 mcspi1: spi@48098000 {
563 compatible = "ti,omap4-mcspi"; 731 compatible = "ti,omap4-mcspi";
564 reg = <0x48098000 0x200>; 732 reg = <0x48098000 0x200>;
diff --git a/arch/arm/boot/dts/efm32gg-dk3750.dts b/arch/arm/boot/dts/efm32gg-dk3750.dts
index aa5c0f6363d6..b4031fa4a567 100644
--- a/arch/arm/boot/dts/efm32gg-dk3750.dts
+++ b/arch/arm/boot/dts/efm32gg-dk3750.dts
@@ -26,7 +26,7 @@
26 }; 26 };
27 27
28 i2c@4000a000 { 28 i2c@4000a000 {
29 location = <3>; 29 efm32,location = <3>;
30 status = "ok"; 30 status = "ok";
31 31
32 temp@48 { 32 temp@48 {
diff --git a/arch/arm/boot/dts/efm32gg.dtsi b/arch/arm/boot/dts/efm32gg.dtsi
index a342ab0e6e4f..106d505c5d3d 100644
--- a/arch/arm/boot/dts/efm32gg.dtsi
+++ b/arch/arm/boot/dts/efm32gg.dtsi
@@ -84,7 +84,7 @@
84 status = "disabled"; 84 status = "disabled";
85 }; 85 };
86 86
87 spi2: spi@40x4000c800 { /* USART2 */ 87 spi2: spi@4000c800 { /* USART2 */
88 #address-cells = <1>; 88 #address-cells = <1>;
89 #size-cells = <0>; 89 #size-cells = <0>;
90 compatible = "efm32,spi"; 90 compatible = "efm32,spi";
@@ -110,7 +110,7 @@
110 status = "disabled"; 110 status = "disabled";
111 }; 111 };
112 112
113 uart2: uart@40x4000c800 { /* USART2 */ 113 uart2: uart@4000c800 { /* USART2 */
114 compatible = "efm32,uart"; 114 compatible = "efm32,uart";
115 reg = <0x4000c800 0x400>; 115 reg = <0x4000c800 0x400>;
116 interrupts = <18 19>; 116 interrupts = <18 19>;
diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index 08452e183b57..2f8bcd068d17 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -19,6 +19,7 @@
19 * published by the Free Software Foundation. 19 * published by the Free Software Foundation.
20 */ 20 */
21 21
22#include <dt-bindings/clock/exynos4.h>
22#include "skeleton.dtsi" 23#include "skeleton.dtsi"
23 24
24/ { 25/ {
@@ -85,6 +86,11 @@
85 reg = <0x10023CE0 0x20>; 86 reg = <0x10023CE0 0x20>;
86 }; 87 };
87 88
89 pd_gps_alive: gps-alive-power-domain@10023D00 {
90 compatible = "samsung,exynos4210-pd";
91 reg = <0x10023D00 0x20>;
92 };
93
88 gic: interrupt-controller@10490000 { 94 gic: interrupt-controller@10490000 {
89 compatible = "arm,cortex-a9-gic"; 95 compatible = "arm,cortex-a9-gic";
90 #interrupt-cells = <3>; 96 #interrupt-cells = <3>;
@@ -104,6 +110,20 @@
104 reg = <0x10010000 0x400>; 110 reg = <0x10010000 0x400>;
105 }; 111 };
106 112
113 dsi_0: dsi@11C80000 {
114 compatible = "samsung,exynos4210-mipi-dsi";
115 reg = <0x11C80000 0x10000>;
116 interrupts = <0 79 0>;
117 samsung,power-domain = <&pd_lcd0>;
118 phys = <&mipi_phy 1>;
119 phy-names = "dsim";
120 clocks = <&clock 286>, <&clock 143>;
121 clock-names = "bus_clk", "pll_clk";
122 status = "disabled";
123 #address-cells = <1>;
124 #size-cells = <0>;
125 };
126
107 camera { 127 camera {
108 compatible = "samsung,fimc", "simple-bus"; 128 compatible = "samsung,fimc", "simple-bus";
109 status = "disabled"; 129 status = "disabled";
@@ -119,7 +139,7 @@
119 compatible = "samsung,exynos4210-fimc"; 139 compatible = "samsung,exynos4210-fimc";
120 reg = <0x11800000 0x1000>; 140 reg = <0x11800000 0x1000>;
121 interrupts = <0 84 0>; 141 interrupts = <0 84 0>;
122 clocks = <&clock 256>, <&clock 128>; 142 clocks = <&clock CLK_FIMC0>, <&clock CLK_SCLK_FIMC0>;
123 clock-names = "fimc", "sclk_fimc"; 143 clock-names = "fimc", "sclk_fimc";
124 samsung,power-domain = <&pd_cam>; 144 samsung,power-domain = <&pd_cam>;
125 samsung,sysreg = <&sys_reg>; 145 samsung,sysreg = <&sys_reg>;
@@ -130,7 +150,7 @@
130 compatible = "samsung,exynos4210-fimc"; 150 compatible = "samsung,exynos4210-fimc";
131 reg = <0x11810000 0x1000>; 151 reg = <0x11810000 0x1000>;
132 interrupts = <0 85 0>; 152 interrupts = <0 85 0>;
133 clocks = <&clock 257>, <&clock 129>; 153 clocks = <&clock CLK_FIMC1>, <&clock CLK_SCLK_FIMC1>;
134 clock-names = "fimc", "sclk_fimc"; 154 clock-names = "fimc", "sclk_fimc";
135 samsung,power-domain = <&pd_cam>; 155 samsung,power-domain = <&pd_cam>;
136 samsung,sysreg = <&sys_reg>; 156 samsung,sysreg = <&sys_reg>;
@@ -141,7 +161,7 @@
141 compatible = "samsung,exynos4210-fimc"; 161 compatible = "samsung,exynos4210-fimc";
142 reg = <0x11820000 0x1000>; 162 reg = <0x11820000 0x1000>;
143 interrupts = <0 86 0>; 163 interrupts = <0 86 0>;
144 clocks = <&clock 258>, <&clock 130>; 164 clocks = <&clock CLK_FIMC2>, <&clock CLK_SCLK_FIMC2>;
145 clock-names = "fimc", "sclk_fimc"; 165 clock-names = "fimc", "sclk_fimc";
146 samsung,power-domain = <&pd_cam>; 166 samsung,power-domain = <&pd_cam>;
147 samsung,sysreg = <&sys_reg>; 167 samsung,sysreg = <&sys_reg>;
@@ -152,7 +172,7 @@
152 compatible = "samsung,exynos4210-fimc"; 172 compatible = "samsung,exynos4210-fimc";
153 reg = <0x11830000 0x1000>; 173 reg = <0x11830000 0x1000>;
154 interrupts = <0 87 0>; 174 interrupts = <0 87 0>;
155 clocks = <&clock 259>, <&clock 131>; 175 clocks = <&clock CLK_FIMC3>, <&clock CLK_SCLK_FIMC3>;
156 clock-names = "fimc", "sclk_fimc"; 176 clock-names = "fimc", "sclk_fimc";
157 samsung,power-domain = <&pd_cam>; 177 samsung,power-domain = <&pd_cam>;
158 samsung,sysreg = <&sys_reg>; 178 samsung,sysreg = <&sys_reg>;
@@ -163,7 +183,7 @@
163 compatible = "samsung,exynos4210-csis"; 183 compatible = "samsung,exynos4210-csis";
164 reg = <0x11880000 0x4000>; 184 reg = <0x11880000 0x4000>;
165 interrupts = <0 78 0>; 185 interrupts = <0 78 0>;
166 clocks = <&clock 260>, <&clock 134>; 186 clocks = <&clock CLK_CSIS0>, <&clock CLK_SCLK_CSIS0>;
167 clock-names = "csis", "sclk_csis"; 187 clock-names = "csis", "sclk_csis";
168 bus-width = <4>; 188 bus-width = <4>;
169 samsung,power-domain = <&pd_cam>; 189 samsung,power-domain = <&pd_cam>;
@@ -178,7 +198,7 @@
178 compatible = "samsung,exynos4210-csis"; 198 compatible = "samsung,exynos4210-csis";
179 reg = <0x11890000 0x4000>; 199 reg = <0x11890000 0x4000>;
180 interrupts = <0 80 0>; 200 interrupts = <0 80 0>;
181 clocks = <&clock 261>, <&clock 135>; 201 clocks = <&clock CLK_CSIS1>, <&clock CLK_SCLK_CSIS1>;
182 clock-names = "csis", "sclk_csis"; 202 clock-names = "csis", "sclk_csis";
183 bus-width = <2>; 203 bus-width = <2>;
184 samsung,power-domain = <&pd_cam>; 204 samsung,power-domain = <&pd_cam>;
@@ -194,7 +214,7 @@
194 compatible = "samsung,s3c2410-wdt"; 214 compatible = "samsung,s3c2410-wdt";
195 reg = <0x10060000 0x100>; 215 reg = <0x10060000 0x100>;
196 interrupts = <0 43 0>; 216 interrupts = <0 43 0>;
197 clocks = <&clock 345>; 217 clocks = <&clock CLK_WDT>;
198 clock-names = "watchdog"; 218 clock-names = "watchdog";
199 status = "disabled"; 219 status = "disabled";
200 }; 220 };
@@ -203,7 +223,7 @@
203 compatible = "samsung,s3c6410-rtc"; 223 compatible = "samsung,s3c6410-rtc";
204 reg = <0x10070000 0x100>; 224 reg = <0x10070000 0x100>;
205 interrupts = <0 44 0>, <0 45 0>; 225 interrupts = <0 44 0>, <0 45 0>;
206 clocks = <&clock 346>; 226 clocks = <&clock CLK_RTC>;
207 clock-names = "rtc"; 227 clock-names = "rtc";
208 status = "disabled"; 228 status = "disabled";
209 }; 229 };
@@ -212,7 +232,7 @@
212 compatible = "samsung,s5pv210-keypad"; 232 compatible = "samsung,s5pv210-keypad";
213 reg = <0x100A0000 0x100>; 233 reg = <0x100A0000 0x100>;
214 interrupts = <0 109 0>; 234 interrupts = <0 109 0>;
215 clocks = <&clock 347>; 235 clocks = <&clock CLK_KEYIF>;
216 clock-names = "keypad"; 236 clock-names = "keypad";
217 status = "disabled"; 237 status = "disabled";
218 }; 238 };
@@ -221,7 +241,7 @@
221 compatible = "samsung,exynos4210-sdhci"; 241 compatible = "samsung,exynos4210-sdhci";
222 reg = <0x12510000 0x100>; 242 reg = <0x12510000 0x100>;
223 interrupts = <0 73 0>; 243 interrupts = <0 73 0>;
224 clocks = <&clock 297>, <&clock 145>; 244 clocks = <&clock CLK_SDMMC0>, <&clock CLK_SCLK_MMC0>;
225 clock-names = "hsmmc", "mmc_busclk.2"; 245 clock-names = "hsmmc", "mmc_busclk.2";
226 status = "disabled"; 246 status = "disabled";
227 }; 247 };
@@ -230,7 +250,7 @@
230 compatible = "samsung,exynos4210-sdhci"; 250 compatible = "samsung,exynos4210-sdhci";
231 reg = <0x12520000 0x100>; 251 reg = <0x12520000 0x100>;
232 interrupts = <0 74 0>; 252 interrupts = <0 74 0>;
233 clocks = <&clock 298>, <&clock 146>; 253 clocks = <&clock CLK_SDMMC1>, <&clock CLK_SCLK_MMC1>;
234 clock-names = "hsmmc", "mmc_busclk.2"; 254 clock-names = "hsmmc", "mmc_busclk.2";
235 status = "disabled"; 255 status = "disabled";
236 }; 256 };
@@ -239,7 +259,7 @@
239 compatible = "samsung,exynos4210-sdhci"; 259 compatible = "samsung,exynos4210-sdhci";
240 reg = <0x12530000 0x100>; 260 reg = <0x12530000 0x100>;
241 interrupts = <0 75 0>; 261 interrupts = <0 75 0>;
242 clocks = <&clock 299>, <&clock 147>; 262 clocks = <&clock CLK_SDMMC2>, <&clock CLK_SCLK_MMC2>;
243 clock-names = "hsmmc", "mmc_busclk.2"; 263 clock-names = "hsmmc", "mmc_busclk.2";
244 status = "disabled"; 264 status = "disabled";
245 }; 265 };
@@ -248,7 +268,7 @@
248 compatible = "samsung,exynos4210-sdhci"; 268 compatible = "samsung,exynos4210-sdhci";
249 reg = <0x12540000 0x100>; 269 reg = <0x12540000 0x100>;
250 interrupts = <0 76 0>; 270 interrupts = <0 76 0>;
251 clocks = <&clock 300>, <&clock 148>; 271 clocks = <&clock CLK_SDMMC3>, <&clock CLK_SCLK_MMC3>;
252 clock-names = "hsmmc", "mmc_busclk.2"; 272 clock-names = "hsmmc", "mmc_busclk.2";
253 status = "disabled"; 273 status = "disabled";
254 }; 274 };
@@ -257,7 +277,7 @@
257 compatible = "samsung,exynos4210-ehci"; 277 compatible = "samsung,exynos4210-ehci";
258 reg = <0x12580000 0x100>; 278 reg = <0x12580000 0x100>;
259 interrupts = <0 70 0>; 279 interrupts = <0 70 0>;
260 clocks = <&clock 304>; 280 clocks = <&clock CLK_USB_HOST>;
261 clock-names = "usbhost"; 281 clock-names = "usbhost";
262 status = "disabled"; 282 status = "disabled";
263 }; 283 };
@@ -266,7 +286,7 @@
266 compatible = "samsung,exynos4210-ohci"; 286 compatible = "samsung,exynos4210-ohci";
267 reg = <0x12590000 0x100>; 287 reg = <0x12590000 0x100>;
268 interrupts = <0 70 0>; 288 interrupts = <0 70 0>;
269 clocks = <&clock 304>; 289 clocks = <&clock CLK_USB_HOST>;
270 clock-names = "usbhost"; 290 clock-names = "usbhost";
271 status = "disabled"; 291 status = "disabled";
272 }; 292 };
@@ -276,7 +296,7 @@
276 reg = <0x13400000 0x10000>; 296 reg = <0x13400000 0x10000>;
277 interrupts = <0 94 0>; 297 interrupts = <0 94 0>;
278 samsung,power-domain = <&pd_mfc>; 298 samsung,power-domain = <&pd_mfc>;
279 clocks = <&clock 273>; 299 clocks = <&clock CLK_MFC>;
280 clock-names = "mfc"; 300 clock-names = "mfc";
281 status = "disabled"; 301 status = "disabled";
282 }; 302 };
@@ -285,7 +305,7 @@
285 compatible = "samsung,exynos4210-uart"; 305 compatible = "samsung,exynos4210-uart";
286 reg = <0x13800000 0x100>; 306 reg = <0x13800000 0x100>;
287 interrupts = <0 52 0>; 307 interrupts = <0 52 0>;
288 clocks = <&clock 312>, <&clock 151>; 308 clocks = <&clock CLK_UART0>, <&clock CLK_SCLK_UART0>;
289 clock-names = "uart", "clk_uart_baud0"; 309 clock-names = "uart", "clk_uart_baud0";
290 status = "disabled"; 310 status = "disabled";
291 }; 311 };
@@ -294,7 +314,7 @@
294 compatible = "samsung,exynos4210-uart"; 314 compatible = "samsung,exynos4210-uart";
295 reg = <0x13810000 0x100>; 315 reg = <0x13810000 0x100>;
296 interrupts = <0 53 0>; 316 interrupts = <0 53 0>;
297 clocks = <&clock 313>, <&clock 152>; 317 clocks = <&clock CLK_UART1>, <&clock CLK_SCLK_UART1>;
298 clock-names = "uart", "clk_uart_baud0"; 318 clock-names = "uart", "clk_uart_baud0";
299 status = "disabled"; 319 status = "disabled";
300 }; 320 };
@@ -303,7 +323,7 @@
303 compatible = "samsung,exynos4210-uart"; 323 compatible = "samsung,exynos4210-uart";
304 reg = <0x13820000 0x100>; 324 reg = <0x13820000 0x100>;
305 interrupts = <0 54 0>; 325 interrupts = <0 54 0>;
306 clocks = <&clock 314>, <&clock 153>; 326 clocks = <&clock CLK_UART2>, <&clock CLK_SCLK_UART2>;
307 clock-names = "uart", "clk_uart_baud0"; 327 clock-names = "uart", "clk_uart_baud0";
308 status = "disabled"; 328 status = "disabled";
309 }; 329 };
@@ -312,7 +332,7 @@
312 compatible = "samsung,exynos4210-uart"; 332 compatible = "samsung,exynos4210-uart";
313 reg = <0x13830000 0x100>; 333 reg = <0x13830000 0x100>;
314 interrupts = <0 55 0>; 334 interrupts = <0 55 0>;
315 clocks = <&clock 315>, <&clock 154>; 335 clocks = <&clock CLK_UART3>, <&clock CLK_SCLK_UART3>;
316 clock-names = "uart", "clk_uart_baud0"; 336 clock-names = "uart", "clk_uart_baud0";
317 status = "disabled"; 337 status = "disabled";
318 }; 338 };
@@ -323,7 +343,7 @@
323 compatible = "samsung,s3c2440-i2c"; 343 compatible = "samsung,s3c2440-i2c";
324 reg = <0x13860000 0x100>; 344 reg = <0x13860000 0x100>;
325 interrupts = <0 58 0>; 345 interrupts = <0 58 0>;
326 clocks = <&clock 317>; 346 clocks = <&clock CLK_I2C0>;
327 clock-names = "i2c"; 347 clock-names = "i2c";
328 pinctrl-names = "default"; 348 pinctrl-names = "default";
329 pinctrl-0 = <&i2c0_bus>; 349 pinctrl-0 = <&i2c0_bus>;
@@ -336,7 +356,7 @@
336 compatible = "samsung,s3c2440-i2c"; 356 compatible = "samsung,s3c2440-i2c";
337 reg = <0x13870000 0x100>; 357 reg = <0x13870000 0x100>;
338 interrupts = <0 59 0>; 358 interrupts = <0 59 0>;
339 clocks = <&clock 318>; 359 clocks = <&clock CLK_I2C1>;
340 clock-names = "i2c"; 360 clock-names = "i2c";
341 pinctrl-names = "default"; 361 pinctrl-names = "default";
342 pinctrl-0 = <&i2c1_bus>; 362 pinctrl-0 = <&i2c1_bus>;
@@ -349,7 +369,7 @@
349 compatible = "samsung,s3c2440-i2c"; 369 compatible = "samsung,s3c2440-i2c";
350 reg = <0x13880000 0x100>; 370 reg = <0x13880000 0x100>;
351 interrupts = <0 60 0>; 371 interrupts = <0 60 0>;
352 clocks = <&clock 319>; 372 clocks = <&clock CLK_I2C2>;
353 clock-names = "i2c"; 373 clock-names = "i2c";
354 status = "disabled"; 374 status = "disabled";
355 }; 375 };
@@ -360,7 +380,7 @@
360 compatible = "samsung,s3c2440-i2c"; 380 compatible = "samsung,s3c2440-i2c";
361 reg = <0x13890000 0x100>; 381 reg = <0x13890000 0x100>;
362 interrupts = <0 61 0>; 382 interrupts = <0 61 0>;
363 clocks = <&clock 320>; 383 clocks = <&clock CLK_I2C3>;
364 clock-names = "i2c"; 384 clock-names = "i2c";
365 status = "disabled"; 385 status = "disabled";
366 }; 386 };
@@ -371,7 +391,7 @@
371 compatible = "samsung,s3c2440-i2c"; 391 compatible = "samsung,s3c2440-i2c";
372 reg = <0x138A0000 0x100>; 392 reg = <0x138A0000 0x100>;
373 interrupts = <0 62 0>; 393 interrupts = <0 62 0>;
374 clocks = <&clock 321>; 394 clocks = <&clock CLK_I2C4>;
375 clock-names = "i2c"; 395 clock-names = "i2c";
376 status = "disabled"; 396 status = "disabled";
377 }; 397 };
@@ -382,7 +402,7 @@
382 compatible = "samsung,s3c2440-i2c"; 402 compatible = "samsung,s3c2440-i2c";
383 reg = <0x138B0000 0x100>; 403 reg = <0x138B0000 0x100>;
384 interrupts = <0 63 0>; 404 interrupts = <0 63 0>;
385 clocks = <&clock 322>; 405 clocks = <&clock CLK_I2C5>;
386 clock-names = "i2c"; 406 clock-names = "i2c";
387 status = "disabled"; 407 status = "disabled";
388 }; 408 };
@@ -393,7 +413,7 @@
393 compatible = "samsung,s3c2440-i2c"; 413 compatible = "samsung,s3c2440-i2c";
394 reg = <0x138C0000 0x100>; 414 reg = <0x138C0000 0x100>;
395 interrupts = <0 64 0>; 415 interrupts = <0 64 0>;
396 clocks = <&clock 323>; 416 clocks = <&clock CLK_I2C6>;
397 clock-names = "i2c"; 417 clock-names = "i2c";
398 status = "disabled"; 418 status = "disabled";
399 }; 419 };
@@ -404,7 +424,7 @@
404 compatible = "samsung,s3c2440-i2c"; 424 compatible = "samsung,s3c2440-i2c";
405 reg = <0x138D0000 0x100>; 425 reg = <0x138D0000 0x100>;
406 interrupts = <0 65 0>; 426 interrupts = <0 65 0>;
407 clocks = <&clock 324>; 427 clocks = <&clock CLK_I2C7>;
408 clock-names = "i2c"; 428 clock-names = "i2c";
409 status = "disabled"; 429 status = "disabled";
410 }; 430 };
@@ -417,7 +437,7 @@
417 dma-names = "tx", "rx"; 437 dma-names = "tx", "rx";
418 #address-cells = <1>; 438 #address-cells = <1>;
419 #size-cells = <0>; 439 #size-cells = <0>;
420 clocks = <&clock 327>, <&clock 159>; 440 clocks = <&clock CLK_SPI0>, <&clock CLK_SCLK_SPI0>;
421 clock-names = "spi", "spi_busclk0"; 441 clock-names = "spi", "spi_busclk0";
422 pinctrl-names = "default"; 442 pinctrl-names = "default";
423 pinctrl-0 = <&spi0_bus>; 443 pinctrl-0 = <&spi0_bus>;
@@ -432,7 +452,7 @@
432 dma-names = "tx", "rx"; 452 dma-names = "tx", "rx";
433 #address-cells = <1>; 453 #address-cells = <1>;
434 #size-cells = <0>; 454 #size-cells = <0>;
435 clocks = <&clock 328>, <&clock 160>; 455 clocks = <&clock CLK_SPI1>, <&clock CLK_SCLK_SPI1>;
436 clock-names = "spi", "spi_busclk0"; 456 clock-names = "spi", "spi_busclk0";
437 pinctrl-names = "default"; 457 pinctrl-names = "default";
438 pinctrl-0 = <&spi1_bus>; 458 pinctrl-0 = <&spi1_bus>;
@@ -447,7 +467,7 @@
447 dma-names = "tx", "rx"; 467 dma-names = "tx", "rx";
448 #address-cells = <1>; 468 #address-cells = <1>;
449 #size-cells = <0>; 469 #size-cells = <0>;
450 clocks = <&clock 329>, <&clock 161>; 470 clocks = <&clock CLK_SPI2>, <&clock CLK_SCLK_SPI2>;
451 clock-names = "spi", "spi_busclk0"; 471 clock-names = "spi", "spi_busclk0";
452 pinctrl-names = "default"; 472 pinctrl-names = "default";
453 pinctrl-0 = <&spi2_bus>; 473 pinctrl-0 = <&spi2_bus>;
@@ -458,7 +478,7 @@
458 compatible = "samsung,exynos4210-pwm"; 478 compatible = "samsung,exynos4210-pwm";
459 reg = <0x139D0000 0x1000>; 479 reg = <0x139D0000 0x1000>;
460 interrupts = <0 37 0>, <0 38 0>, <0 39 0>, <0 40 0>, <0 41 0>; 480 interrupts = <0 37 0>, <0 38 0>, <0 39 0>, <0 40 0>, <0 41 0>;
461 clocks = <&clock 336>; 481 clocks = <&clock CLK_PWM>;
462 clock-names = "timers"; 482 clock-names = "timers";
463 #pwm-cells = <2>; 483 #pwm-cells = <2>;
464 status = "disabled"; 484 status = "disabled";
@@ -475,7 +495,7 @@
475 compatible = "arm,pl330", "arm,primecell"; 495 compatible = "arm,pl330", "arm,primecell";
476 reg = <0x12680000 0x1000>; 496 reg = <0x12680000 0x1000>;
477 interrupts = <0 35 0>; 497 interrupts = <0 35 0>;
478 clocks = <&clock 292>; 498 clocks = <&clock CLK_PDMA0>;
479 clock-names = "apb_pclk"; 499 clock-names = "apb_pclk";
480 #dma-cells = <1>; 500 #dma-cells = <1>;
481 #dma-channels = <8>; 501 #dma-channels = <8>;
@@ -486,7 +506,7 @@
486 compatible = "arm,pl330", "arm,primecell"; 506 compatible = "arm,pl330", "arm,primecell";
487 reg = <0x12690000 0x1000>; 507 reg = <0x12690000 0x1000>;
488 interrupts = <0 36 0>; 508 interrupts = <0 36 0>;
489 clocks = <&clock 293>; 509 clocks = <&clock CLK_PDMA1>;
490 clock-names = "apb_pclk"; 510 clock-names = "apb_pclk";
491 #dma-cells = <1>; 511 #dma-cells = <1>;
492 #dma-channels = <8>; 512 #dma-channels = <8>;
@@ -497,7 +517,7 @@
497 compatible = "arm,pl330", "arm,primecell"; 517 compatible = "arm,pl330", "arm,primecell";
498 reg = <0x12850000 0x1000>; 518 reg = <0x12850000 0x1000>;
499 interrupts = <0 34 0>; 519 interrupts = <0 34 0>;
500 clocks = <&clock 279>; 520 clocks = <&clock CLK_MDMA>;
501 clock-names = "apb_pclk"; 521 clock-names = "apb_pclk";
502 #dma-cells = <1>; 522 #dma-cells = <1>;
503 #dma-channels = <8>; 523 #dma-channels = <8>;
@@ -511,7 +531,7 @@
511 reg = <0x11c00000 0x20000>; 531 reg = <0x11c00000 0x20000>;
512 interrupt-names = "fifo", "vsync", "lcd_sys"; 532 interrupt-names = "fifo", "vsync", "lcd_sys";
513 interrupts = <11 0>, <11 1>, <11 2>; 533 interrupts = <11 0>, <11 1>, <11 2>;
514 clocks = <&clock 140>, <&clock 283>; 534 clocks = <&clock CLK_SCLK_FIMD0>, <&clock CLK_FIMD0>;
515 clock-names = "sclk_fimd", "fimd"; 535 clock-names = "sclk_fimd", "fimd";
516 samsung,power-domain = <&pd_lcd0>; 536 samsung,power-domain = <&pd_lcd0>;
517 status = "disabled"; 537 status = "disabled";
diff --git a/arch/arm/boot/dts/exynos4210-origen.dts b/arch/arm/boot/dts/exynos4210-origen.dts
index 2aa13cb3bbed..72fb11f7ea21 100644
--- a/arch/arm/boot/dts/exynos4210-origen.dts
+++ b/arch/arm/boot/dts/exynos4210-origen.dts
@@ -19,7 +19,7 @@
19 19
20/ { 20/ {
21 model = "Insignal Origen evaluation board based on Exynos4210"; 21 model = "Insignal Origen evaluation board based on Exynos4210";
22 compatible = "insignal,origen", "samsung,exynos4210"; 22 compatible = "insignal,origen", "samsung,exynos4210", "samsung,exynos4";
23 23
24 memory { 24 memory {
25 reg = <0x40000000 0x10000000 25 reg = <0x40000000 0x10000000
diff --git a/arch/arm/boot/dts/exynos4210-smdkv310.dts b/arch/arm/boot/dts/exynos4210-smdkv310.dts
index 9c01b718d29d..636d16684750 100644
--- a/arch/arm/boot/dts/exynos4210-smdkv310.dts
+++ b/arch/arm/boot/dts/exynos4210-smdkv310.dts
@@ -19,7 +19,7 @@
19 19
20/ { 20/ {
21 model = "Samsung smdkv310 evaluation board based on Exynos4210"; 21 model = "Samsung smdkv310 evaluation board based on Exynos4210";
22 compatible = "samsung,smdkv310", "samsung,exynos4210"; 22 compatible = "samsung,smdkv310", "samsung,exynos4210", "samsung,exynos4";
23 23
24 memory { 24 memory {
25 reg = <0x40000000 0x80000000>; 25 reg = <0x40000000 0x80000000>;
diff --git a/arch/arm/boot/dts/exynos4210-trats.dts b/arch/arm/boot/dts/exynos4210-trats.dts
index 63cc571ca307..63aa2bb24a4b 100644
--- a/arch/arm/boot/dts/exynos4210-trats.dts
+++ b/arch/arm/boot/dts/exynos4210-trats.dts
@@ -17,7 +17,7 @@
17 17
18/ { 18/ {
19 model = "Samsung Trats based on Exynos4210"; 19 model = "Samsung Trats based on Exynos4210";
20 compatible = "samsung,trats", "samsung,exynos4210"; 20 compatible = "samsung,trats", "samsung,exynos4210", "samsung,exynos4";
21 21
22 memory { 22 memory {
23 reg = <0x40000000 0x10000000 23 reg = <0x40000000 0x10000000
@@ -353,6 +353,67 @@
353 }; 353 };
354 }; 354 };
355 355
356 dsi_0: dsi@11C80000 {
357 vddcore-supply = <&vusb_reg>;
358 vddio-supply = <&vmipi_reg>;
359 samsung,pll-clock-frequency = <24000000>;
360 status = "okay";
361
362 ports {
363 #address-cells = <1>;
364 #size-cells = <0>;
365
366 port@1 {
367 reg = <1>;
368
369 dsi_out: endpoint {
370 remote-endpoint = <&dsi_in>;
371 samsung,burst-clock-frequency = <500000000>;
372 samsung,esc-clock-frequency = <20000000>;
373 };
374 };
375 };
376
377 panel@0 {
378 reg = <0>;
379 compatible = "samsung,s6e8aa0";
380 vdd3-supply = <&vcclcd_reg>;
381 vci-supply = <&vlcd_reg>;
382 reset-gpios = <&gpy4 5 0>;
383 power-on-delay= <50>;
384 reset-delay = <100>;
385 init-delay = <100>;
386 flip-horizontal;
387 flip-vertical;
388 panel-width-mm = <58>;
389 panel-height-mm = <103>;
390
391 display-timings {
392 timing-0 {
393 clock-frequency = <57153600>;
394 hactive = <720>;
395 vactive = <1280>;
396 hfront-porch = <5>;
397 hback-porch = <5>;
398 hsync-len = <5>;
399 vfront-porch = <13>;
400 vback-porch = <1>;
401 vsync-len = <2>;
402 };
403 };
404
405 port {
406 dsi_in: endpoint {
407 remote-endpoint = <&dsi_out>;
408 };
409 };
410 };
411 };
412
413 fimd@11c00000 {
414 status = "okay";
415 };
416
356 camera { 417 camera {
357 pinctrl-names = "default"; 418 pinctrl-names = "default";
358 pinctrl-0 = <>; 419 pinctrl-0 = <>;
diff --git a/arch/arm/boot/dts/exynos4210-universal_c210.dts b/arch/arm/boot/dts/exynos4210-universal_c210.dts
index d2e3f5f5916d..63e34b24b04f 100644
--- a/arch/arm/boot/dts/exynos4210-universal_c210.dts
+++ b/arch/arm/boot/dts/exynos4210-universal_c210.dts
@@ -17,7 +17,7 @@
17 17
18/ { 18/ {
19 model = "Samsung Universal C210 based on Exynos4210 rev0"; 19 model = "Samsung Universal C210 based on Exynos4210 rev0";
20 compatible = "samsung,universal_c210", "samsung,exynos4210"; 20 compatible = "samsung,universal_c210", "samsung,exynos4210", "samsung,exynos4";
21 21
22 memory { 22 memory {
23 reg = <0x40000000 0x10000000 23 reg = <0x40000000 0x10000000
@@ -345,6 +345,70 @@
345 }; 345 };
346 }; 346 };
347 347
348 spi-lcd {
349 compatible = "spi-gpio";
350 #address-cells = <1>;
351 #size-cells = <0>;
352
353 gpio-sck = <&gpy3 1 0>;
354 gpio-mosi = <&gpy3 3 0>;
355 num-chipselects = <1>;
356 cs-gpios = <&gpy4 3 0>;
357
358 lcd@0 {
359 compatible = "samsung,ld9040";
360 reg = <0>;
361 vdd3-supply = <&ldo7_reg>;
362 vci-supply = <&ldo17_reg>;
363 reset-gpios = <&gpy4 5 0>;
364 spi-max-frequency = <1200000>;
365 spi-cpol;
366 spi-cpha;
367 power-on-delay = <10>;
368 reset-delay = <10>;
369 panel-width-mm = <90>;
370 panel-height-mm = <154>;
371 display-timings {
372 timing {
373 clock-frequency = <23492370>;
374 hactive = <480>;
375 vactive = <800>;
376 hback-porch = <16>;
377 hfront-porch = <16>;
378 vback-porch = <2>;
379 vfront-porch = <28>;
380 hsync-len = <2>;
381 vsync-len = <1>;
382 hsync-active = <0>;
383 vsync-active = <0>;
384 de-active = <0>;
385 pixelclk-active = <0>;
386 };
387 };
388 port {
389 lcd_ep: endpoint {
390 remote-endpoint = <&fimd_dpi_ep>;
391 };
392 };
393 };
394 };
395
396 fimd: fimd@11c00000 {
397 pinctrl-0 = <&lcd_clk>, <&lcd_data24>;
398 pinctrl-names = "default";
399 status = "okay";
400 samsung,invert-vden;
401 samsung,invert-vclk;
402 #address-cells = <1>;
403 #size-cells = <0>;
404 port@3 {
405 reg = <3>;
406 fimd_dpi_ep: endpoint {
407 remote-endpoint = <&lcd_ep>;
408 };
409 };
410 };
411
348 pwm@139D0000 { 412 pwm@139D0000 {
349 compatible = "samsung,s5p6440-pwm"; 413 compatible = "samsung,s5p6440-pwm";
350 status = "okay"; 414 status = "okay";
diff --git a/arch/arm/boot/dts/exynos4210.dtsi b/arch/arm/boot/dts/exynos4210.dtsi
index 48ecd7a755ab..cacf6140dd2f 100644
--- a/arch/arm/boot/dts/exynos4210.dtsi
+++ b/arch/arm/boot/dts/exynos4210.dtsi
@@ -23,7 +23,7 @@
23#include "exynos4210-pinctrl.dtsi" 23#include "exynos4210-pinctrl.dtsi"
24 24
25/ { 25/ {
26 compatible = "samsung,exynos4210"; 26 compatible = "samsung,exynos4210", "samsung,exynos4";
27 27
28 aliases { 28 aliases {
29 pinctrl0 = &pinctrl_0; 29 pinctrl0 = &pinctrl_0;
@@ -53,7 +53,7 @@
53 reg = <0x10050000 0x800>; 53 reg = <0x10050000 0x800>;
54 interrupt-parent = <&mct_map>; 54 interrupt-parent = <&mct_map>;
55 interrupts = <0>, <1>, <2>, <3>, <4>, <5>; 55 interrupts = <0>, <1>, <2>, <3>, <4>, <5>;
56 clocks = <&clock 3>, <&clock 344>; 56 clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MCT>;
57 clock-names = "fin_pll", "mct"; 57 clock-names = "fin_pll", "mct";
58 58
59 mct_map: mct-map { 59 mct_map: mct-map {
@@ -109,7 +109,7 @@
109 interrupt-parent = <&combiner>; 109 interrupt-parent = <&combiner>;
110 reg = <0x100C0000 0x100>; 110 reg = <0x100C0000 0x100>;
111 interrupts = <2 4>; 111 interrupts = <2 4>;
112 clocks = <&clock 383>; 112 clocks = <&clock CLK_TMU_APBIF>;
113 clock-names = "tmu_apbif"; 113 clock-names = "tmu_apbif";
114 status = "disabled"; 114 status = "disabled";
115 }; 115 };
@@ -118,13 +118,14 @@
118 compatible = "samsung,s5pv210-g2d"; 118 compatible = "samsung,s5pv210-g2d";
119 reg = <0x12800000 0x1000>; 119 reg = <0x12800000 0x1000>;
120 interrupts = <0 89 0>; 120 interrupts = <0 89 0>;
121 clocks = <&clock 177>, <&clock 277>; 121 clocks = <&clock CLK_SCLK_FIMG2D>, <&clock CLK_G2D>;
122 clock-names = "sclk_fimg2d", "fimg2d"; 122 clock-names = "sclk_fimg2d", "fimg2d";
123 status = "disabled"; 123 status = "disabled";
124 }; 124 };
125 125
126 camera { 126 camera {
127 clocks = <&clock 132>, <&clock 133>, <&clock 351>, <&clock 352>; 127 clocks = <&clock CLK_SCLK_CAM0>, <&clock CLK_SCLK_CAM1>,
128 <&clock CLK_PIXELASYNCM0>, <&clock CLK_PIXELASYNCM1>;
128 clock-names = "sclk_cam0", "sclk_cam1", "pxl_async0", "pxl_async1"; 129 clock-names = "sclk_cam0", "sclk_cam1", "pxl_async0", "pxl_async1";
129 130
130 fimc_0: fimc@11800000 { 131 fimc_0: fimc@11800000 {
diff --git a/arch/arm/boot/dts/exynos4212.dtsi b/arch/arm/boot/dts/exynos4212.dtsi
index 94a43f9a05e2..3c00e6ec9302 100644
--- a/arch/arm/boot/dts/exynos4212.dtsi
+++ b/arch/arm/boot/dts/exynos4212.dtsi
@@ -20,18 +20,13 @@
20#include "exynos4x12.dtsi" 20#include "exynos4x12.dtsi"
21 21
22/ { 22/ {
23 compatible = "samsung,exynos4212"; 23 compatible = "samsung,exynos4212", "samsung,exynos4";
24 24
25 gic: interrupt-controller@10490000 { 25 combiner: interrupt-controller@10440000 {
26 cpu-offset = <0x8000>; 26 samsung,combiner-nr = <18>;
27 }; 27 };
28 28
29 interrupt-controller@10440000 { 29 gic: interrupt-controller@10490000 {
30 samsung,combiner-nr = <18>; 30 cpu-offset = <0x8000>;
31 interrupts = <0 0 0>, <0 1 0>, <0 2 0>, <0 3 0>,
32 <0 4 0>, <0 5 0>, <0 6 0>, <0 7 0>,
33 <0 8 0>, <0 9 0>, <0 10 0>, <0 11 0>,
34 <0 12 0>, <0 13 0>, <0 14 0>, <0 15 0>,
35 <0 107 0>, <0 108 0>;
36 }; 31 };
37}; 32};
diff --git a/arch/arm/boot/dts/exynos4412-odroidx.dts b/arch/arm/boot/dts/exynos4412-odroidx.dts
index 9804fcb71f8c..31db28a4bb33 100644
--- a/arch/arm/boot/dts/exynos4412-odroidx.dts
+++ b/arch/arm/boot/dts/exynos4412-odroidx.dts
@@ -16,7 +16,7 @@
16 16
17/ { 17/ {
18 model = "Hardkernel ODROID-X board based on Exynos4412"; 18 model = "Hardkernel ODROID-X board based on Exynos4412";
19 compatible = "hardkernel,odroid-x", "samsung,exynos4412"; 19 compatible = "hardkernel,odroid-x", "samsung,exynos4412", "samsung,exynos4";
20 20
21 memory { 21 memory {
22 reg = <0x40000000 0x40000000>; 22 reg = <0x40000000 0x40000000>;
@@ -251,7 +251,7 @@
251 buck2_reg: BUCK2 { 251 buck2_reg: BUCK2 {
252 regulator-name = "vdd_arm"; 252 regulator-name = "vdd_arm";
253 regulator-min-microvolt = <900000>; 253 regulator-min-microvolt = <900000>;
254 regulator-max-microvolt = <1300000>; 254 regulator-max-microvolt = <1350000>;
255 regulator-always-on; 255 regulator-always-on;
256 regulator-boot-on; 256 regulator-boot-on;
257 }; 257 };
diff --git a/arch/arm/boot/dts/exynos4412-origen.dts b/arch/arm/boot/dts/exynos4412-origen.dts
index 6bc053924e9e..e2c0dcab4d81 100644
--- a/arch/arm/boot/dts/exynos4412-origen.dts
+++ b/arch/arm/boot/dts/exynos4412-origen.dts
@@ -17,7 +17,7 @@
17 17
18/ { 18/ {
19 model = "Insignal Origen evaluation board based on Exynos4412"; 19 model = "Insignal Origen evaluation board based on Exynos4412";
20 compatible = "insignal,origen4412", "samsung,exynos4412"; 20 compatible = "insignal,origen4412", "samsung,exynos4412", "samsung,exynos4";
21 21
22 memory { 22 memory {
23 reg = <0x40000000 0x40000000>; 23 reg = <0x40000000 0x40000000>;
@@ -459,8 +459,8 @@
459 459
460 buck2_reg: BUCK2 { 460 buck2_reg: BUCK2 {
461 regulator-name = "vdd_arm"; 461 regulator-name = "vdd_arm";
462 regulator-min-microvolt = <925000>; 462 regulator-min-microvolt = <900000>;
463 regulator-max-microvolt = <1300000>; 463 regulator-max-microvolt = <1350000>;
464 regulator-always-on; 464 regulator-always-on;
465 regulator-boot-on; 465 regulator-boot-on;
466 op_mode = <1>; /* Normal Mode */ 466 op_mode = <1>; /* Normal Mode */
diff --git a/arch/arm/boot/dts/exynos4412-smdk4412.dts b/arch/arm/boot/dts/exynos4412-smdk4412.dts
index ad316a1ee9e0..ded0b70f7644 100644
--- a/arch/arm/boot/dts/exynos4412-smdk4412.dts
+++ b/arch/arm/boot/dts/exynos4412-smdk4412.dts
@@ -17,7 +17,7 @@
17 17
18/ { 18/ {
19 model = "Samsung SMDK evaluation board based on Exynos4412"; 19 model = "Samsung SMDK evaluation board based on Exynos4412";
20 compatible = "samsung,smdk4412", "samsung,exynos4412"; 20 compatible = "samsung,smdk4412", "samsung,exynos4412", "samsung,exynos4";
21 21
22 memory { 22 memory {
23 reg = <0x40000000 0x40000000>; 23 reg = <0x40000000 0x40000000>;
diff --git a/arch/arm/boot/dts/exynos4412-tiny4412.dts b/arch/arm/boot/dts/exynos4412-tiny4412.dts
index 0a9831256b33..ea6929d9c621 100644
--- a/arch/arm/boot/dts/exynos4412-tiny4412.dts
+++ b/arch/arm/boot/dts/exynos4412-tiny4412.dts
@@ -16,7 +16,7 @@
16 16
17/ { 17/ {
18 model = "FriendlyARM TINY4412 board based on Exynos4412"; 18 model = "FriendlyARM TINY4412 board based on Exynos4412";
19 compatible = "friendlyarm,tiny4412", "samsung,exynos4412"; 19 compatible = "friendlyarm,tiny4412", "samsung,exynos4412", "samsung,exynos4";
20 20
21 memory { 21 memory {
22 reg = <0x40000000 0x40000000>; 22 reg = <0x40000000 0x40000000>;
diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
index 4f851ccf40eb..9583563dd0ef 100644
--- a/arch/arm/boot/dts/exynos4412-trats2.dts
+++ b/arch/arm/boot/dts/exynos4412-trats2.dts
@@ -17,7 +17,7 @@
17 17
18/ { 18/ {
19 model = "Samsung Trats 2 based on Exynos4412"; 19 model = "Samsung Trats 2 based on Exynos4412";
20 compatible = "samsung,trats2", "samsung,exynos4412"; 20 compatible = "samsung,trats2", "samsung,exynos4412", "samsung,exynos4";
21 21
22 aliases { 22 aliases {
23 i2c8 = &i2c_ak8975; 23 i2c8 = &i2c_ak8975;
@@ -71,6 +71,15 @@
71 enable-active-high; 71 enable-active-high;
72 }; 72 };
73 73
74 lcd_vdd3_reg: voltage-regulator-2 {
75 compatible = "regulator-fixed";
76 regulator-name = "LCD_VDD_2.2V";
77 regulator-min-microvolt = <2200000>;
78 regulator-max-microvolt = <2200000>;
79 gpio = <&gpc0 1 0>;
80 enable-active-high;
81 };
82
74 /* More to come */ 83 /* More to come */
75 }; 84 };
76 85
@@ -106,6 +115,11 @@
106 }; 115 };
107 }; 116 };
108 117
118 adc: adc@126C0000 {
119 vdd-supply = <&ldo3_reg>;
120 status = "okay";
121 };
122
109 i2c@13890000 { 123 i2c@13890000 {
110 samsung,i2c-sda-delay = <100>; 124 samsung,i2c-sda-delay = <100>;
111 samsung,i2c-slave-addr = <0x10>; 125 samsung,i2c-slave-addr = <0x10>;
@@ -511,6 +525,67 @@
511 }; 525 };
512 }; 526 };
513 527
528 dsi_0: dsi@11C80000 {
529 vddcore-supply = <&ldo8_reg>;
530 vddio-supply = <&ldo10_reg>;
531 samsung,pll-clock-frequency = <24000000>;
532 status = "okay";
533
534 ports {
535 #address-cells = <1>;
536 #size-cells = <0>;
537
538 port@1 {
539 reg = <1>;
540
541 dsi_out: endpoint {
542 remote-endpoint = <&dsi_in>;
543 samsung,burst-clock-frequency = <500000000>;
544 samsung,esc-clock-frequency = <20000000>;
545 };
546 };
547 };
548
549 panel@0 {
550 compatible = "samsung,s6e8aa0";
551 reg = <0>;
552 vdd3-supply = <&lcd_vdd3_reg>;
553 vci-supply = <&ldo25_reg>;
554 reset-gpios = <&gpy4 5 0>;
555 power-on-delay= <50>;
556 reset-delay = <100>;
557 init-delay = <100>;
558 flip-horizontal;
559 flip-vertical;
560 panel-width-mm = <58>;
561 panel-height-mm = <103>;
562
563 display-timings {
564 timing-0 {
565 clock-frequency = <0>;
566 hactive = <720>;
567 vactive = <1280>;
568 hfront-porch = <5>;
569 hback-porch = <5>;
570 hsync-len = <5>;
571 vfront-porch = <13>;
572 vback-porch = <1>;
573 vsync-len = <2>;
574 };
575 };
576
577 port {
578 dsi_in: endpoint {
579 remote-endpoint = <&dsi_out>;
580 };
581 };
582 };
583 };
584
585 fimd@11c00000 {
586 status = "okay";
587 };
588
514 camera { 589 camera {
515 pinctrl-0 = <&cam_port_b_clk_active>; 590 pinctrl-0 = <&cam_port_b_clk_active>;
516 pinctrl-names = "default"; 591 pinctrl-names = "default";
@@ -589,4 +664,20 @@
589 }; 664 };
590 }; 665 };
591 }; 666 };
667
668 thermistor-ap@0 {
669 compatible = "ntc,ncp15wb473";
670 pullup-uv = <1800000>; /* VCC_1.8V_AP */
671 pullup-ohm = <100000>; /* 100K */
672 pulldown-ohm = <100000>; /* 100K */
673 io-channels = <&adc 1>; /* AP temperature */
674 };
675
676 thermistor-battery@1 {
677 compatible = "ntc,ncp15wb473";
678 pullup-uv = <1800000>; /* VCC_1.8V_AP */
679 pullup-ohm = <100000>; /* 100K */
680 pulldown-ohm = <100000>; /* 100K */
681 io-channels = <&adc 2>; /* Battery temperature */
682 };
592}; 683};
diff --git a/arch/arm/boot/dts/exynos4412.dtsi b/arch/arm/boot/dts/exynos4412.dtsi
index 87b339c739de..15d3c0ac2f5f 100644
--- a/arch/arm/boot/dts/exynos4412.dtsi
+++ b/arch/arm/boot/dts/exynos4412.dtsi
@@ -20,19 +20,13 @@
20#include "exynos4x12.dtsi" 20#include "exynos4x12.dtsi"
21 21
22/ { 22/ {
23 compatible = "samsung,exynos4412"; 23 compatible = "samsung,exynos4412", "samsung,exynos4";
24 24
25 gic: interrupt-controller@10490000 { 25 combiner: interrupt-controller@10440000 {
26 cpu-offset = <0x4000>;
27 };
28
29 interrupt-controller@10440000 {
30 samsung,combiner-nr = <20>; 26 samsung,combiner-nr = <20>;
31 interrupts = <0 0 0>, <0 1 0>, <0 2 0>, <0 3 0>,
32 <0 4 0>, <0 5 0>, <0 6 0>, <0 7 0>,
33 <0 8 0>, <0 9 0>, <0 10 0>, <0 11 0>,
34 <0 12 0>, <0 13 0>, <0 14 0>, <0 15 0>,
35 <0 107 0>, <0 108 0>, <0 48 0>, <0 42 0>;
36 }; 27 };
37 28
29 gic: interrupt-controller@10490000 {
30 cpu-offset = <0x4000>;
31 };
38}; 32};
diff --git a/arch/arm/boot/dts/exynos4x12.dtsi b/arch/arm/boot/dts/exynos4x12.dtsi
index 5c412aa14738..c4a9306f8529 100644
--- a/arch/arm/boot/dts/exynos4x12.dtsi
+++ b/arch/arm/boot/dts/exynos4x12.dtsi
@@ -31,6 +31,12 @@
31 mshc0 = &mshc_0; 31 mshc0 = &mshc_0;
32 }; 32 };
33 33
34 pmu {
35 compatible = "arm,cortex-a9-pmu";
36 interrupt-parent = <&combiner>;
37 interrupts = <2 2>, <3 2>, <18 2>, <19 2>;
38 };
39
34 pd_isp: isp-power-domain@10023CA0 { 40 pd_isp: isp-power-domain@10023CA0 {
35 compatible = "samsung,exynos4210-pd"; 41 compatible = "samsung,exynos4210-pd";
36 reg = <0x10023CA0 0x20>; 42 reg = <0x10023CA0 0x20>;
@@ -47,7 +53,7 @@
47 reg = <0x10050000 0x800>; 53 reg = <0x10050000 0x800>;
48 interrupt-parent = <&mct_map>; 54 interrupt-parent = <&mct_map>;
49 interrupts = <0>, <1>, <2>, <3>, <4>; 55 interrupts = <0>, <1>, <2>, <3>, <4>;
50 clocks = <&clock 3>, <&clock 344>; 56 clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MCT>;
51 clock-names = "fin_pll", "mct"; 57 clock-names = "fin_pll", "mct";
52 58
53 mct_map: mct-map { 59 mct_map: mct-map {
@@ -62,6 +68,14 @@
62 }; 68 };
63 }; 69 };
64 70
71 combiner: interrupt-controller@10440000 {
72 interrupts = <0 0 0>, <0 1 0>, <0 2 0>, <0 3 0>,
73 <0 4 0>, <0 5 0>, <0 6 0>, <0 7 0>,
74 <0 8 0>, <0 9 0>, <0 10 0>, <0 11 0>,
75 <0 12 0>, <0 13 0>, <0 14 0>, <0 15 0>,
76 <0 107 0>, <0 108 0>, <0 48 0>, <0 42 0>;
77 };
78
65 pinctrl_0: pinctrl@11400000 { 79 pinctrl_0: pinctrl@11400000 {
66 compatible = "samsung,exynos4x12-pinctrl"; 80 compatible = "samsung,exynos4x12-pinctrl";
67 reg = <0x11400000 0x1000>; 81 reg = <0x11400000 0x1000>;
@@ -80,6 +94,18 @@
80 }; 94 };
81 }; 95 };
82 96
97 adc: adc@126C0000 {
98 compatible = "samsung,exynos-adc-v1";
99 reg = <0x126C0000 0x100>, <0x10020718 0x4>;
100 interrupt-parent = <&combiner>;
101 interrupts = <10 3>;
102 clocks = <&clock CLK_TSADC>;
103 clock-names = "adc";
104 #io-channel-cells = <1>;
105 io-channel-ranges;
106 status = "disabled";
107 };
108
83 pinctrl_2: pinctrl@03860000 { 109 pinctrl_2: pinctrl@03860000 {
84 compatible = "samsung,exynos4x12-pinctrl"; 110 compatible = "samsung,exynos4x12-pinctrl";
85 reg = <0x03860000 0x1000>; 111 reg = <0x03860000 0x1000>;
@@ -97,13 +123,14 @@
97 compatible = "samsung,exynos4212-g2d"; 123 compatible = "samsung,exynos4212-g2d";
98 reg = <0x10800000 0x1000>; 124 reg = <0x10800000 0x1000>;
99 interrupts = <0 89 0>; 125 interrupts = <0 89 0>;
100 clocks = <&clock 177>, <&clock 277>; 126 clocks = <&clock CLK_SCLK_FIMG2D>, <&clock CLK_G2D>;
101 clock-names = "sclk_fimg2d", "fimg2d"; 127 clock-names = "sclk_fimg2d", "fimg2d";
102 status = "disabled"; 128 status = "disabled";
103 }; 129 };
104 130
105 camera { 131 camera {
106 clocks = <&clock 132>, <&clock 133>, <&clock 351>, <&clock 352>; 132 clocks = <&clock CLK_SCLK_CAM0>, <&clock CLK_SCLK_CAM1>,
133 <&clock CLK_PIXELASYNCM0>, <&clock CLK_PIXELASYNCM1>;
107 clock-names = "sclk_cam0", "sclk_cam1", "pxl_async0", "pxl_async1"; 134 clock-names = "sclk_cam0", "sclk_cam1", "pxl_async0", "pxl_async1";
108 135
109 fimc_0: fimc@11800000 { 136 fimc_0: fimc@11800000 {
@@ -145,7 +172,7 @@
145 reg = <0x12390000 0x1000>; 172 reg = <0x12390000 0x1000>;
146 interrupts = <0 105 0>; 173 interrupts = <0 105 0>;
147 samsung,power-domain = <&pd_isp>; 174 samsung,power-domain = <&pd_isp>;
148 clocks = <&clock 353>; 175 clocks = <&clock CLK_FIMC_LITE0>;
149 clock-names = "flite"; 176 clock-names = "flite";
150 status = "disabled"; 177 status = "disabled";
151 }; 178 };
@@ -155,7 +182,7 @@
155 reg = <0x123A0000 0x1000>; 182 reg = <0x123A0000 0x1000>;
156 interrupts = <0 106 0>; 183 interrupts = <0 106 0>;
157 samsung,power-domain = <&pd_isp>; 184 samsung,power-domain = <&pd_isp>;
158 clocks = <&clock 354>; 185 clocks = <&clock CLK_FIMC_LITE1>;
159 clock-names = "flite"; 186 clock-names = "flite";
160 status = "disabled"; 187 status = "disabled";
161 }; 188 };
@@ -165,12 +192,19 @@
165 reg = <0x12000000 0x260000>; 192 reg = <0x12000000 0x260000>;
166 interrupts = <0 90 0>, <0 95 0>; 193 interrupts = <0 90 0>, <0 95 0>;
167 samsung,power-domain = <&pd_isp>; 194 samsung,power-domain = <&pd_isp>;
168 clocks = <&clock 353>, <&clock 354>, <&clock 355>, 195 clocks = <&clock CLK_FIMC_LITE0>,
169 <&clock 356>, <&clock 17>, <&clock 357>, 196 <&clock CLK_FIMC_LITE1>, <&clock CLK_PPMUISPX>,
170 <&clock 358>, <&clock 359>, <&clock 360>, 197 <&clock CLK_PPMUISPMX>,
171 <&clock 450>,<&clock 451>, <&clock 452>, 198 <&clock CLK_MOUT_MPLL_USER_T>,
172 <&clock 453>, <&clock 176>, <&clock 13>, 199 <&clock CLK_FIMC_ISP>, <&clock CLK_FIMC_DRC>,
173 <&clock 454>, <&clock 395>, <&clock 455>; 200 <&clock CLK_FIMC_FD>, <&clock CLK_MCUISP>,
201 <&clock CLK_DIV_ISP0>,<&clock CLK_DIV_ISP1>,
202 <&clock CLK_DIV_MCUISP0>,
203 <&clock CLK_DIV_MCUISP1>,
204 <&clock CLK_SCLK_UART_ISP>,
205 <&clock CLK_ACLK200>, <&clock CLK_DIV_ACLK200>,
206 <&clock CLK_ACLK400_MCUISP>,
207 <&clock CLK_DIV_ACLK400_MCUISP>;
174 clock-names = "lite0", "lite1", "ppmuispx", 208 clock-names = "lite0", "lite1", "ppmuispx",
175 "ppmuispmx", "mpll", "isp", 209 "ppmuispmx", "mpll", "isp",
176 "drc", "fd", "mcuisp", 210 "drc", "fd", "mcuisp",
@@ -190,7 +224,7 @@
190 i2c1_isp: i2c-isp@12140000 { 224 i2c1_isp: i2c-isp@12140000 {
191 compatible = "samsung,exynos4212-i2c-isp"; 225 compatible = "samsung,exynos4212-i2c-isp";
192 reg = <0x12140000 0x100>; 226 reg = <0x12140000 0x100>;
193 clocks = <&clock 370>; 227 clocks = <&clock CLK_I2C1_ISP>;
194 clock-names = "i2c_isp"; 228 clock-names = "i2c_isp";
195 #address-cells = <1>; 229 #address-cells = <1>;
196 #size-cells = <0>; 230 #size-cells = <0>;
@@ -205,7 +239,7 @@
205 #address-cells = <1>; 239 #address-cells = <1>;
206 #size-cells = <0>; 240 #size-cells = <0>;
207 fifo-depth = <0x80>; 241 fifo-depth = <0x80>;
208 clocks = <&clock 301>, <&clock 149>; 242 clocks = <&clock CLK_SDMMC4>, <&clock CLK_SCLK_MMC4>;
209 clock-names = "biu", "ciu"; 243 clock-names = "biu", "ciu";
210 status = "disabled"; 244 status = "disabled";
211 }; 245 };
diff --git a/arch/arm/boot/dts/exynos5.dtsi b/arch/arm/boot/dts/exynos5.dtsi
index 258dca441f36..79d0608d6dcc 100644
--- a/arch/arm/boot/dts/exynos5.dtsi
+++ b/arch/arm/boot/dts/exynos5.dtsi
@@ -81,13 +81,6 @@
81 status = "disabled"; 81 status = "disabled";
82 }; 82 };
83 83
84 watchdog {
85 compatible = "samsung,s3c2410-wdt";
86 reg = <0x101D0000 0x100>;
87 interrupts = <0 42 0>;
88 status = "disabled";
89 };
90
91 fimd@14400000 { 84 fimd@14400000 {
92 compatible = "samsung,exynos5250-fimd"; 85 compatible = "samsung,exynos5250-fimd";
93 interrupt-parent = <&combiner>; 86 interrupt-parent = <&combiner>;
diff --git a/arch/arm/boot/dts/exynos5250-arndale.dts b/arch/arm/boot/dts/exynos5250-arndale.dts
index b42e658876e5..090f9830b129 100644
--- a/arch/arm/boot/dts/exynos5250-arndale.dts
+++ b/arch/arm/boot/dts/exynos5250-arndale.dts
@@ -15,7 +15,7 @@
15 15
16/ { 16/ {
17 model = "Insignal Arndale evaluation board based on EXYNOS5250"; 17 model = "Insignal Arndale evaluation board based on EXYNOS5250";
18 compatible = "insignal,arndale", "samsung,exynos5250"; 18 compatible = "insignal,arndale", "samsung,exynos5250", "samsung,exynos5";
19 19
20 memory { 20 memory {
21 reg = <0x40000000 0x80000000>; 21 reg = <0x40000000 0x80000000>;
@@ -25,6 +25,10 @@
25 bootargs = "console=ttySAC2,115200"; 25 bootargs = "console=ttySAC2,115200";
26 }; 26 };
27 27
28 rtc@101E0000 {
29 status = "okay";
30 };
31
28 codec@11000000 { 32 codec@11000000 {
29 samsung,mfc-r = <0x43000000 0x800000>; 33 samsung,mfc-r = <0x43000000 0x800000>;
30 samsung,mfc-l = <0x51000000 0x800000>; 34 samsung,mfc-l = <0x51000000 0x800000>;
@@ -287,6 +291,7 @@
287 regulator-name = "vdd_g3d"; 291 regulator-name = "vdd_g3d";
288 regulator-min-microvolt = <1000000>; 292 regulator-min-microvolt = <1000000>;
289 regulator-max-microvolt = <1000000>; 293 regulator-max-microvolt = <1000000>;
294 regulator-always-on;
290 regulator-boot-on; 295 regulator-boot-on;
291 op_mode = <1>; 296 op_mode = <1>;
292 }; 297 };
@@ -370,6 +375,27 @@
370 }; 375 };
371 }; 376 };
372 377
378 i2c@121D0000 {
379 status = "okay";
380 samsung,i2c-sda-delay = <100>;
381 samsung,i2c-max-bus-freq = <40000>;
382 samsung,i2c-slave-addr = <0x38>;
383
384 sata_phy_i2c:sata-phy@38 {
385 compatible = "samsung,exynos-sataphy-i2c";
386 reg = <0x38>;
387 };
388 };
389
390 sata@122F0000 {
391 status = "okay";
392 };
393
394 sata-phy@12170000 {
395 status = "okay";
396 samsung,exynos-sataphy-i2c-phandle = <&sata_phy_i2c>;
397 };
398
373 mmc_0: mmc@12200000 { 399 mmc_0: mmc@12200000 {
374 status = "okay"; 400 status = "okay";
375 num-slots = <1>; 401 num-slots = <1>;
diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts
index 3e69837c435c..a794a705d404 100644
--- a/arch/arm/boot/dts/exynos5250-smdk5250.dts
+++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts
@@ -14,7 +14,7 @@
14 14
15/ { 15/ {
16 model = "SAMSUNG SMDK5250 board based on EXYNOS5250"; 16 model = "SAMSUNG SMDK5250 board based on EXYNOS5250";
17 compatible = "samsung,smdk5250", "samsung,exynos5250"; 17 compatible = "samsung,smdk5250", "samsung,exynos5250", "samsung,exynos5";
18 18
19 aliases { 19 aliases {
20 }; 20 };
@@ -27,6 +27,10 @@
27 bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC2,115200 init=/linuxrc"; 27 bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC2,115200 init=/linuxrc";
28 }; 28 };
29 29
30 rtc@101E0000 {
31 status = "okay";
32 };
33
30 i2c@12C60000 { 34 i2c@12C60000 {
31 samsung,i2c-sda-delay = <100>; 35 samsung,i2c-sda-delay = <100>;
32 samsung,i2c-max-bus-freq = <20000>; 36 samsung,i2c-max-bus-freq = <20000>;
@@ -36,6 +40,148 @@
36 compatible = "samsung,s524ad0xd1"; 40 compatible = "samsung,s524ad0xd1";
37 reg = <0x50>; 41 reg = <0x50>;
38 }; 42 };
43
44 max77686@09 {
45 compatible = "maxim,max77686";
46 reg = <0x09>;
47
48 voltage-regulators {
49 ldo1_reg: LDO1 {
50 regulator-name = "P1.0V_LDO_OUT1";
51 regulator-min-microvolt = <1000000>;
52 regulator-max-microvolt = <1000000>;
53 regulator-always-on;
54 };
55
56 ldo2_reg: LDO2 {
57 regulator-name = "P1.2V_LDO_OUT2";
58 regulator-min-microvolt = <1200000>;
59 regulator-max-microvolt = <1200000>;
60 regulator-always-on;
61 };
62
63 ldo3_reg: LDO3 {
64 regulator-name = "P1.8V_LDO_OUT3";
65 regulator-min-microvolt = <1800000>;
66 regulator-max-microvolt = <1800000>;
67 regulator-always-on;
68 };
69
70 ldo4_reg: LDO4 {
71 regulator-name = "P2.8V_LDO_OUT4";
72 regulator-min-microvolt = <2800000>;
73 regulator-max-microvolt = <2800000>;
74 };
75
76 ldo5_reg: LDO5 {
77 regulator-name = "P1.8V_LDO_OUT5";
78 regulator-min-microvolt = <1800000>;
79 regulator-max-microvolt = <1800000>;
80 };
81
82 ldo6_reg: LDO6 {
83 regulator-name = "P1.1V_LDO_OUT6";
84 regulator-min-microvolt = <1100000>;
85 regulator-max-microvolt = <1100000>;
86 regulator-always-on;
87 };
88
89 ldo7_reg: LDO7 {
90 regulator-name = "P1.1V_LDO_OUT7";
91 regulator-min-microvolt = <1100000>;
92 regulator-max-microvolt = <1100000>;
93 regulator-always-on;
94 };
95
96 ldo8_reg: LDO8 {
97 regulator-name = "P1.0V_LDO_OUT8";
98 regulator-min-microvolt = <1000000>;
99 regulator-max-microvolt = <1000000>;
100 };
101
102 ldo10_reg: LDO10 {
103 regulator-name = "P1.8V_LDO_OUT10";
104 regulator-min-microvolt = <1800000>;
105 regulator-max-microvolt = <1800000>;
106 };
107
108 ldo11_reg: LDO11 {
109 regulator-name = "P1.8V_LDO_OUT11";
110 regulator-min-microvolt = <1800000>;
111 regulator-max-microvolt = <1800000>;
112 };
113
114 ldo12_reg: LDO12 {
115 regulator-name = "P3.0V_LDO_OUT12";
116 regulator-min-microvolt = <3000000>;
117 regulator-max-microvolt = <3000000>;
118 };
119
120 ldo13_reg: LDO13 {
121 regulator-name = "P1.8V_LDO_OUT13";
122 regulator-min-microvolt = <1800000>;
123 regulator-max-microvolt = <1800000>;
124 };
125
126 ldo14_reg: LDO14 {
127 regulator-name = "P1.8V_LDO_OUT14";
128 regulator-min-microvolt = <1800000>;
129 regulator-max-microvolt = <1800000>;
130 };
131
132 ldo15_reg: LDO15 {
133 regulator-name = "P1.0V_LDO_OUT15";
134 regulator-min-microvolt = <1000000>;
135 regulator-max-microvolt = <1000000>;
136 };
137
138 ldo16_reg: LDO16 {
139 regulator-name = "P1.8V_LDO_OUT16";
140 regulator-min-microvolt = <1800000>;
141 regulator-max-microvolt = <1800000>;
142 };
143
144 buck1_reg: BUCK1 {
145 regulator-name = "vdd_mif";
146 regulator-min-microvolt = <950000>;
147 regulator-max-microvolt = <1300000>;
148 regulator-always-on;
149 regulator-boot-on;
150 };
151
152 buck2_reg: BUCK2 {
153 regulator-name = "vdd_arm";
154 regulator-min-microvolt = <850000>;
155 regulator-max-microvolt = <1350000>;
156 regulator-always-on;
157 regulator-boot-on;
158 };
159
160 buck3_reg: BUCK3 {
161 regulator-name = "vdd_int";
162 regulator-min-microvolt = <900000>;
163 regulator-max-microvolt = <1200000>;
164 regulator-always-on;
165 regulator-boot-on;
166 };
167
168 buck4_reg: BUCK4 {
169 regulator-name = "vdd_g3d";
170 regulator-min-microvolt = <850000>;
171 regulator-max-microvolt = <1300000>;
172 regulator-always-on;
173 regulator-boot-on;
174 };
175
176 buck5_reg: BUCK5 {
177 regulator-name = "P1.8V_BUCK_OUT5";
178 regulator-min-microvolt = <1800000>;
179 regulator-max-microvolt = <1800000>;
180 regulator-always-on;
181 regulator-boot-on;
182 };
183 };
184 };
39 }; 185 };
40 186
41 vdd: fixed-regulator@0 { 187 vdd: fixed-regulator@0 {
@@ -96,16 +242,12 @@
96 samsung,i2c-slave-addr = <0x38>; 242 samsung,i2c-slave-addr = <0x38>;
97 status = "okay"; 243 status = "okay";
98 244
99 sata-phy { 245 sata_phy_i2c:sata-phy@38 {
100 compatible = "samsung,sata-phy"; 246 compatible = "samsung,exynos-sataphy-i2c";
101 reg = <0x38>; 247 reg = <0x38>;
102 }; 248 };
103 }; 249 };
104 250
105 sata@122F0000 {
106 samsung,sata-freq = <66>;
107 };
108
109 i2c@12C80000 { 251 i2c@12C80000 {
110 samsung,i2c-sda-delay = <100>; 252 samsung,i2c-sda-delay = <100>;
111 samsung,i2c-max-bus-freq = <66000>; 253 samsung,i2c-max-bus-freq = <66000>;
@@ -128,6 +270,15 @@
128 }; 270 };
129 }; 271 };
130 272
273 sata@122F0000 {
274 status = "okay";
275 };
276
277 sata-phy@12170000 {
278 status = "okay";
279 samsung,exynos-sataphy-i2c-phandle = <&sata_phy_i2c>;
280 };
281
131 mmc@12200000 { 282 mmc@12200000 {
132 status = "okay"; 283 status = "okay";
133 num-slots = <1>; 284 num-slots = <1>;
@@ -164,10 +315,6 @@
164 }; 315 };
165 }; 316 };
166 317
167 spi_0: spi@12d20000 {
168 status = "disabled";
169 };
170
171 spi_1: spi@12d30000 { 318 spi_1: spi@12d30000 {
172 status = "okay"; 319 status = "okay";
173 320
diff --git a/arch/arm/boot/dts/exynos5250-snow.dts b/arch/arm/boot/dts/exynos5250-snow.dts
index 7e45eea2d78f..1ce1088a00fb 100644
--- a/arch/arm/boot/dts/exynos5250-snow.dts
+++ b/arch/arm/boot/dts/exynos5250-snow.dts
@@ -14,12 +14,16 @@
14 14
15/ { 15/ {
16 model = "Google Snow"; 16 model = "Google Snow";
17 compatible = "google,snow", "samsung,exynos5250"; 17 compatible = "google,snow", "samsung,exynos5250", "samsung,exynos5";
18 18
19 aliases { 19 aliases {
20 i2c104 = &i2c_104; 20 i2c104 = &i2c_104;
21 }; 21 };
22 22
23 rtc@101E0000 {
24 status = "okay";
25 };
26
23 pinctrl@11400000 { 27 pinctrl@11400000 {
24 sd3_clk: sd3-clk { 28 sd3_clk: sd3-clk {
25 samsung,pin-drv = <0>; 29 samsung,pin-drv = <0>;
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index b7dec41e32af..37423314a028 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -17,13 +17,14 @@
17 * published by the Free Software Foundation. 17 * published by the Free Software Foundation.
18*/ 18*/
19 19
20#include <dt-bindings/clock/exynos5250.h>
20#include "exynos5.dtsi" 21#include "exynos5.dtsi"
21#include "exynos5250-pinctrl.dtsi" 22#include "exynos5250-pinctrl.dtsi"
22 23
23#include <dt-bindings/clk/exynos-audss-clk.h> 24#include <dt-bindings/clock/exynos-audss-clk.h>
24 25
25/ { 26/ {
26 compatible = "samsung,exynos5250"; 27 compatible = "samsung,exynos5250", "samsung,exynos5";
27 28
28 aliases { 29 aliases {
29 spi0 = &spi_0; 30 spi0 = &spi_0;
@@ -46,6 +47,7 @@
46 i2c6 = &i2c_6; 47 i2c6 = &i2c_6;
47 i2c7 = &i2c_7; 48 i2c7 = &i2c_7;
48 i2c8 = &i2c_8; 49 i2c8 = &i2c_8;
50 i2c9 = &i2c_9;
49 pinctrl0 = &pinctrl_0; 51 pinctrl0 = &pinctrl_0;
50 pinctrl1 = &pinctrl_1; 52 pinctrl1 = &pinctrl_1;
51 pinctrl2 = &pinctrl_2; 53 pinctrl2 = &pinctrl_2;
@@ -90,7 +92,8 @@
90 compatible = "samsung,exynos5250-audss-clock"; 92 compatible = "samsung,exynos5250-audss-clock";
91 reg = <0x03810000 0x0C>; 93 reg = <0x03810000 0x0C>;
92 #clock-cells = <1>; 94 #clock-cells = <1>;
93 clocks = <&clock 1>, <&clock 7>, <&clock 138>, <&clock 160>; 95 clocks = <&clock CLK_FIN_PLL>, <&clock CLK_FOUT_EPLL>,
96 <&clock CLK_SCLK_AUDIO0>, <&clock CLK_DIV_PCM0>;
94 clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in"; 97 clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in";
95 }; 98 };
96 99
@@ -115,7 +118,7 @@
115 interrupt-parent = <&mct_map>; 118 interrupt-parent = <&mct_map>;
116 interrupts = <0 0>, <1 0>, <2 0>, <3 0>, 119 interrupts = <0 0>, <1 0>, <2 0>, <3 0>,
117 <4 0>, <5 0>; 120 <4 0>, <5 0>;
118 clocks = <&clock 1>, <&clock 335>; 121 clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MCT>;
119 clock-names = "fin_pll", "mct"; 122 clock-names = "fin_pll", "mct";
120 123
121 mct_map: mct-map { 124 mct_map: mct-map {
@@ -167,16 +170,25 @@
167 interrupts = <0 47 0>; 170 interrupts = <0 47 0>;
168 }; 171 };
169 172
170 watchdog { 173 pmu_system_controller: system-controller@10040000 {
171 clocks = <&clock 336>; 174 compatible = "samsung,exynos5250-pmu", "syscon";
175 reg = <0x10040000 0x5000>;
176 };
177
178 watchdog@101D0000 {
179 compatible = "samsung,exynos5250-wdt";
180 reg = <0x101D0000 0x100>;
181 interrupts = <0 42 0>;
182 clocks = <&clock CLK_WDT>;
172 clock-names = "watchdog"; 183 clock-names = "watchdog";
184 samsung,syscon-phandle = <&pmu_system_controller>;
173 }; 185 };
174 186
175 g2d@10850000 { 187 g2d@10850000 {
176 compatible = "samsung,exynos5250-g2d"; 188 compatible = "samsung,exynos5250-g2d";
177 reg = <0x10850000 0x1000>; 189 reg = <0x10850000 0x1000>;
178 interrupts = <0 91 0>; 190 interrupts = <0 91 0>;
179 clocks = <&clock 345>; 191 clocks = <&clock CLK_G2D>;
180 clock-names = "fimg2d"; 192 clock-names = "fimg2d";
181 }; 193 };
182 194
@@ -185,55 +197,64 @@
185 reg = <0x11000000 0x10000>; 197 reg = <0x11000000 0x10000>;
186 interrupts = <0 96 0>; 198 interrupts = <0 96 0>;
187 samsung,power-domain = <&pd_mfc>; 199 samsung,power-domain = <&pd_mfc>;
188 clocks = <&clock 266>; 200 clocks = <&clock CLK_MFC>;
189 clock-names = "mfc"; 201 clock-names = "mfc";
190 }; 202 };
191 203
192 rtc@101E0000 { 204 rtc@101E0000 {
193 clocks = <&clock 337>; 205 clocks = <&clock CLK_RTC>;
194 clock-names = "rtc"; 206 clock-names = "rtc";
195 status = "okay"; 207 status = "disabled";
196 }; 208 };
197 209
198 tmu@10060000 { 210 tmu@10060000 {
199 compatible = "samsung,exynos5250-tmu"; 211 compatible = "samsung,exynos5250-tmu";
200 reg = <0x10060000 0x100>; 212 reg = <0x10060000 0x100>;
201 interrupts = <0 65 0>; 213 interrupts = <0 65 0>;
202 clocks = <&clock 338>; 214 clocks = <&clock CLK_TMU>;
203 clock-names = "tmu_apbif"; 215 clock-names = "tmu_apbif";
204 }; 216 };
205 217
206 serial@12C00000 { 218 serial@12C00000 {
207 clocks = <&clock 289>, <&clock 146>; 219 clocks = <&clock CLK_UART0>, <&clock CLK_SCLK_UART0>;
208 clock-names = "uart", "clk_uart_baud0"; 220 clock-names = "uart", "clk_uart_baud0";
209 }; 221 };
210 222
211 serial@12C10000 { 223 serial@12C10000 {
212 clocks = <&clock 290>, <&clock 147>; 224 clocks = <&clock CLK_UART1>, <&clock CLK_SCLK_UART1>;
213 clock-names = "uart", "clk_uart_baud0"; 225 clock-names = "uart", "clk_uart_baud0";
214 }; 226 };
215 227
216 serial@12C20000 { 228 serial@12C20000 {
217 clocks = <&clock 291>, <&clock 148>; 229 clocks = <&clock CLK_UART2>, <&clock CLK_SCLK_UART2>;
218 clock-names = "uart", "clk_uart_baud0"; 230 clock-names = "uart", "clk_uart_baud0";
219 }; 231 };
220 232
221 serial@12C30000 { 233 serial@12C30000 {
222 clocks = <&clock 292>, <&clock 149>; 234 clocks = <&clock CLK_UART3>, <&clock CLK_SCLK_UART3>;
223 clock-names = "uart", "clk_uart_baud0"; 235 clock-names = "uart", "clk_uart_baud0";
224 }; 236 };
225 237
226 sata@122F0000 { 238 sata@122F0000 {
227 compatible = "samsung,exynos5-sata-ahci"; 239 compatible = "snps,dwc-ahci";
240 samsung,sata-freq = <66>;
228 reg = <0x122F0000 0x1ff>; 241 reg = <0x122F0000 0x1ff>;
229 interrupts = <0 115 0>; 242 interrupts = <0 115 0>;
230 clocks = <&clock 277>, <&clock 143>; 243 clocks = <&clock CLK_SATA>, <&clock CLK_SCLK_SATA>;
231 clock-names = "sata", "sclk_sata"; 244 clock-names = "sata", "sclk_sata";
245 phys = <&sata_phy>;
246 phy-names = "sata-phy";
247 status = "disabled";
232 }; 248 };
233 249
234 sata-phy@12170000 { 250 sata_phy: sata-phy@12170000 {
235 compatible = "samsung,exynos5-sata-phy"; 251 compatible = "samsung,exynos5250-sata-phy";
236 reg = <0x12170000 0x1ff>; 252 reg = <0x12170000 0x1ff>;
253 clocks = <&clock 287>;
254 clock-names = "sata_phyctrl";
255 #phy-cells = <0>;
256 samsung,syscon-phandle = <&pmu_system_controller>;
257 status = "disabled";
237 }; 258 };
238 259
239 i2c_0: i2c@12C60000 { 260 i2c_0: i2c@12C60000 {
@@ -242,7 +263,7 @@
242 interrupts = <0 56 0>; 263 interrupts = <0 56 0>;
243 #address-cells = <1>; 264 #address-cells = <1>;
244 #size-cells = <0>; 265 #size-cells = <0>;
245 clocks = <&clock 294>; 266 clocks = <&clock CLK_I2C0>;
246 clock-names = "i2c"; 267 clock-names = "i2c";
247 pinctrl-names = "default"; 268 pinctrl-names = "default";
248 pinctrl-0 = <&i2c0_bus>; 269 pinctrl-0 = <&i2c0_bus>;
@@ -255,7 +276,7 @@
255 interrupts = <0 57 0>; 276 interrupts = <0 57 0>;
256 #address-cells = <1>; 277 #address-cells = <1>;
257 #size-cells = <0>; 278 #size-cells = <0>;
258 clocks = <&clock 295>; 279 clocks = <&clock CLK_I2C1>;
259 clock-names = "i2c"; 280 clock-names = "i2c";
260 pinctrl-names = "default"; 281 pinctrl-names = "default";
261 pinctrl-0 = <&i2c1_bus>; 282 pinctrl-0 = <&i2c1_bus>;
@@ -268,7 +289,7 @@
268 interrupts = <0 58 0>; 289 interrupts = <0 58 0>;
269 #address-cells = <1>; 290 #address-cells = <1>;
270 #size-cells = <0>; 291 #size-cells = <0>;
271 clocks = <&clock 296>; 292 clocks = <&clock CLK_I2C2>;
272 clock-names = "i2c"; 293 clock-names = "i2c";
273 pinctrl-names = "default"; 294 pinctrl-names = "default";
274 pinctrl-0 = <&i2c2_bus>; 295 pinctrl-0 = <&i2c2_bus>;
@@ -281,7 +302,7 @@
281 interrupts = <0 59 0>; 302 interrupts = <0 59 0>;
282 #address-cells = <1>; 303 #address-cells = <1>;
283 #size-cells = <0>; 304 #size-cells = <0>;
284 clocks = <&clock 297>; 305 clocks = <&clock CLK_I2C3>;
285 clock-names = "i2c"; 306 clock-names = "i2c";
286 pinctrl-names = "default"; 307 pinctrl-names = "default";
287 pinctrl-0 = <&i2c3_bus>; 308 pinctrl-0 = <&i2c3_bus>;
@@ -294,7 +315,7 @@
294 interrupts = <0 60 0>; 315 interrupts = <0 60 0>;
295 #address-cells = <1>; 316 #address-cells = <1>;
296 #size-cells = <0>; 317 #size-cells = <0>;
297 clocks = <&clock 298>; 318 clocks = <&clock CLK_I2C4>;
298 clock-names = "i2c"; 319 clock-names = "i2c";
299 pinctrl-names = "default"; 320 pinctrl-names = "default";
300 pinctrl-0 = <&i2c4_bus>; 321 pinctrl-0 = <&i2c4_bus>;
@@ -307,7 +328,7 @@
307 interrupts = <0 61 0>; 328 interrupts = <0 61 0>;
308 #address-cells = <1>; 329 #address-cells = <1>;
309 #size-cells = <0>; 330 #size-cells = <0>;
310 clocks = <&clock 299>; 331 clocks = <&clock CLK_I2C5>;
311 clock-names = "i2c"; 332 clock-names = "i2c";
312 pinctrl-names = "default"; 333 pinctrl-names = "default";
313 pinctrl-0 = <&i2c5_bus>; 334 pinctrl-0 = <&i2c5_bus>;
@@ -320,7 +341,7 @@
320 interrupts = <0 62 0>; 341 interrupts = <0 62 0>;
321 #address-cells = <1>; 342 #address-cells = <1>;
322 #size-cells = <0>; 343 #size-cells = <0>;
323 clocks = <&clock 300>; 344 clocks = <&clock CLK_I2C6>;
324 clock-names = "i2c"; 345 clock-names = "i2c";
325 pinctrl-names = "default"; 346 pinctrl-names = "default";
326 pinctrl-0 = <&i2c6_bus>; 347 pinctrl-0 = <&i2c6_bus>;
@@ -333,7 +354,7 @@
333 interrupts = <0 63 0>; 354 interrupts = <0 63 0>;
334 #address-cells = <1>; 355 #address-cells = <1>;
335 #size-cells = <0>; 356 #size-cells = <0>;
336 clocks = <&clock 301>; 357 clocks = <&clock CLK_I2C7>;
337 clock-names = "i2c"; 358 clock-names = "i2c";
338 pinctrl-names = "default"; 359 pinctrl-names = "default";
339 pinctrl-0 = <&i2c7_bus>; 360 pinctrl-0 = <&i2c7_bus>;
@@ -346,17 +367,17 @@
346 interrupts = <0 64 0>; 367 interrupts = <0 64 0>;
347 #address-cells = <1>; 368 #address-cells = <1>;
348 #size-cells = <0>; 369 #size-cells = <0>;
349 clocks = <&clock 302>; 370 clocks = <&clock CLK_I2C_HDMI>;
350 clock-names = "i2c"; 371 clock-names = "i2c";
351 status = "disabled"; 372 status = "disabled";
352 }; 373 };
353 374
354 i2c@121D0000 { 375 i2c_9: i2c@121D0000 {
355 compatible = "samsung,exynos5-sata-phy-i2c"; 376 compatible = "samsung,exynos5-sata-phy-i2c";
356 reg = <0x121D0000 0x100>; 377 reg = <0x121D0000 0x100>;
357 #address-cells = <1>; 378 #address-cells = <1>;
358 #size-cells = <0>; 379 #size-cells = <0>;
359 clocks = <&clock 288>; 380 clocks = <&clock CLK_SATA_PHYI2C>;
360 clock-names = "i2c"; 381 clock-names = "i2c";
361 status = "disabled"; 382 status = "disabled";
362 }; 383 };
@@ -371,7 +392,7 @@
371 dma-names = "tx", "rx"; 392 dma-names = "tx", "rx";
372 #address-cells = <1>; 393 #address-cells = <1>;
373 #size-cells = <0>; 394 #size-cells = <0>;
374 clocks = <&clock 304>, <&clock 154>; 395 clocks = <&clock CLK_SPI0>, <&clock CLK_SCLK_SPI0>;
375 clock-names = "spi", "spi_busclk0"; 396 clock-names = "spi", "spi_busclk0";
376 pinctrl-names = "default"; 397 pinctrl-names = "default";
377 pinctrl-0 = <&spi0_bus>; 398 pinctrl-0 = <&spi0_bus>;
@@ -387,7 +408,7 @@
387 dma-names = "tx", "rx"; 408 dma-names = "tx", "rx";
388 #address-cells = <1>; 409 #address-cells = <1>;
389 #size-cells = <0>; 410 #size-cells = <0>;
390 clocks = <&clock 305>, <&clock 155>; 411 clocks = <&clock CLK_SPI1>, <&clock CLK_SCLK_SPI1>;
391 clock-names = "spi", "spi_busclk0"; 412 clock-names = "spi", "spi_busclk0";
392 pinctrl-names = "default"; 413 pinctrl-names = "default";
393 pinctrl-0 = <&spi1_bus>; 414 pinctrl-0 = <&spi1_bus>;
@@ -403,7 +424,7 @@
403 dma-names = "tx", "rx"; 424 dma-names = "tx", "rx";
404 #address-cells = <1>; 425 #address-cells = <1>;
405 #size-cells = <0>; 426 #size-cells = <0>;
406 clocks = <&clock 306>, <&clock 156>; 427 clocks = <&clock CLK_SPI2>, <&clock CLK_SCLK_SPI2>;
407 clock-names = "spi", "spi_busclk0"; 428 clock-names = "spi", "spi_busclk0";
408 pinctrl-names = "default"; 429 pinctrl-names = "default";
409 pinctrl-0 = <&spi2_bus>; 430 pinctrl-0 = <&spi2_bus>;
@@ -415,7 +436,7 @@
415 #address-cells = <1>; 436 #address-cells = <1>;
416 #size-cells = <0>; 437 #size-cells = <0>;
417 reg = <0x12200000 0x1000>; 438 reg = <0x12200000 0x1000>;
418 clocks = <&clock 280>, <&clock 139>; 439 clocks = <&clock CLK_SDMMC0>, <&clock CLK_SCLK_MMC0>;
419 clock-names = "biu", "ciu"; 440 clock-names = "biu", "ciu";
420 fifo-depth = <0x80>; 441 fifo-depth = <0x80>;
421 status = "disabled"; 442 status = "disabled";
@@ -427,7 +448,7 @@
427 #address-cells = <1>; 448 #address-cells = <1>;
428 #size-cells = <0>; 449 #size-cells = <0>;
429 reg = <0x12210000 0x1000>; 450 reg = <0x12210000 0x1000>;
430 clocks = <&clock 281>, <&clock 140>; 451 clocks = <&clock CLK_SDMMC1>, <&clock CLK_SCLK_MMC1>;
431 clock-names = "biu", "ciu"; 452 clock-names = "biu", "ciu";
432 fifo-depth = <0x80>; 453 fifo-depth = <0x80>;
433 status = "disabled"; 454 status = "disabled";
@@ -439,7 +460,7 @@
439 #address-cells = <1>; 460 #address-cells = <1>;
440 #size-cells = <0>; 461 #size-cells = <0>;
441 reg = <0x12220000 0x1000>; 462 reg = <0x12220000 0x1000>;
442 clocks = <&clock 282>, <&clock 141>; 463 clocks = <&clock CLK_SDMMC2>, <&clock CLK_SCLK_MMC2>;
443 clock-names = "biu", "ciu"; 464 clock-names = "biu", "ciu";
444 fifo-depth = <0x80>; 465 fifo-depth = <0x80>;
445 status = "disabled"; 466 status = "disabled";
@@ -451,7 +472,7 @@
451 interrupts = <0 78 0>; 472 interrupts = <0 78 0>;
452 #address-cells = <1>; 473 #address-cells = <1>;
453 #size-cells = <0>; 474 #size-cells = <0>;
454 clocks = <&clock 283>, <&clock 142>; 475 clocks = <&clock CLK_SDMMC3>, <&clock CLK_SCLK_MMC3>;
455 clock-names = "biu", "ciu"; 476 clock-names = "biu", "ciu";
456 fifo-depth = <0x80>; 477 fifo-depth = <0x80>;
457 status = "disabled"; 478 status = "disabled";
@@ -481,7 +502,7 @@
481 dmas = <&pdma1 12 502 dmas = <&pdma1 12
482 &pdma1 11>; 503 &pdma1 11>;
483 dma-names = "tx", "rx"; 504 dma-names = "tx", "rx";
484 clocks = <&clock 307>, <&clock 157>; 505 clocks = <&clock CLK_I2S1>, <&clock CLK_DIV_I2S1>;
485 clock-names = "iis", "i2s_opclk0"; 506 clock-names = "iis", "i2s_opclk0";
486 pinctrl-names = "default"; 507 pinctrl-names = "default";
487 pinctrl-0 = <&i2s1_bus>; 508 pinctrl-0 = <&i2s1_bus>;
@@ -494,7 +515,7 @@
494 dmas = <&pdma0 12 515 dmas = <&pdma0 12
495 &pdma0 11>; 516 &pdma0 11>;
496 dma-names = "tx", "rx"; 517 dma-names = "tx", "rx";
497 clocks = <&clock 308>, <&clock 158>; 518 clocks = <&clock CLK_I2S2>, <&clock CLK_DIV_I2S2>;
498 clock-names = "iis", "i2s_opclk0"; 519 clock-names = "iis", "i2s_opclk0";
499 pinctrl-names = "default"; 520 pinctrl-names = "default";
500 pinctrl-0 = <&i2s2_bus>; 521 pinctrl-0 = <&i2s2_bus>;
@@ -502,7 +523,7 @@
502 523
503 usb@12000000 { 524 usb@12000000 {
504 compatible = "samsung,exynos5250-dwusb3"; 525 compatible = "samsung,exynos5250-dwusb3";
505 clocks = <&clock 286>; 526 clocks = <&clock CLK_USB3>;
506 clock-names = "usbdrd30"; 527 clock-names = "usbdrd30";
507 #address-cells = <1>; 528 #address-cells = <1>;
508 #size-cells = <1>; 529 #size-cells = <1>;
@@ -519,7 +540,7 @@
519 usb3_phy: usbphy@12100000 { 540 usb3_phy: usbphy@12100000 {
520 compatible = "samsung,exynos5250-usb3phy"; 541 compatible = "samsung,exynos5250-usb3phy";
521 reg = <0x12100000 0x100>; 542 reg = <0x12100000 0x100>;
522 clocks = <&clock 1>, <&clock 286>; 543 clocks = <&clock CLK_FIN_PLL>, <&clock CLK_USB3>;
523 clock-names = "ext_xtal", "usbdrd30"; 544 clock-names = "ext_xtal", "usbdrd30";
524 #address-cells = <1>; 545 #address-cells = <1>;
525 #size-cells = <1>; 546 #size-cells = <1>;
@@ -535,7 +556,7 @@
535 reg = <0x12110000 0x100>; 556 reg = <0x12110000 0x100>;
536 interrupts = <0 71 0>; 557 interrupts = <0 71 0>;
537 558
538 clocks = <&clock 285>; 559 clocks = <&clock CLK_USB2>;
539 clock-names = "usbhost"; 560 clock-names = "usbhost";
540 }; 561 };
541 562
@@ -544,14 +565,14 @@
544 reg = <0x12120000 0x100>; 565 reg = <0x12120000 0x100>;
545 interrupts = <0 71 0>; 566 interrupts = <0 71 0>;
546 567
547 clocks = <&clock 285>; 568 clocks = <&clock CLK_USB2>;
548 clock-names = "usbhost"; 569 clock-names = "usbhost";
549 }; 570 };
550 571
551 usb2_phy: usbphy@12130000 { 572 usb2_phy: usbphy@12130000 {
552 compatible = "samsung,exynos5250-usb2phy"; 573 compatible = "samsung,exynos5250-usb2phy";
553 reg = <0x12130000 0x100>; 574 reg = <0x12130000 0x100>;
554 clocks = <&clock 1>, <&clock 285>; 575 clocks = <&clock CLK_FIN_PLL>, <&clock CLK_USB2>;
555 clock-names = "ext_xtal", "usbhost"; 576 clock-names = "ext_xtal", "usbhost";
556 #address-cells = <1>; 577 #address-cells = <1>;
557 #size-cells = <1>; 578 #size-cells = <1>;
@@ -568,7 +589,7 @@
568 reg = <0x12dd0000 0x100>; 589 reg = <0x12dd0000 0x100>;
569 samsung,pwm-outputs = <0>, <1>, <2>, <3>; 590 samsung,pwm-outputs = <0>, <1>, <2>, <3>;
570 #pwm-cells = <3>; 591 #pwm-cells = <3>;
571 clocks = <&clock 311>; 592 clocks = <&clock CLK_PWM>;
572 clock-names = "timers"; 593 clock-names = "timers";
573 }; 594 };
574 595
@@ -583,7 +604,7 @@
583 compatible = "arm,pl330", "arm,primecell"; 604 compatible = "arm,pl330", "arm,primecell";
584 reg = <0x121A0000 0x1000>; 605 reg = <0x121A0000 0x1000>;
585 interrupts = <0 34 0>; 606 interrupts = <0 34 0>;
586 clocks = <&clock 275>; 607 clocks = <&clock CLK_PDMA0>;
587 clock-names = "apb_pclk"; 608 clock-names = "apb_pclk";
588 #dma-cells = <1>; 609 #dma-cells = <1>;
589 #dma-channels = <8>; 610 #dma-channels = <8>;
@@ -594,7 +615,7 @@
594 compatible = "arm,pl330", "arm,primecell"; 615 compatible = "arm,pl330", "arm,primecell";
595 reg = <0x121B0000 0x1000>; 616 reg = <0x121B0000 0x1000>;
596 interrupts = <0 35 0>; 617 interrupts = <0 35 0>;
597 clocks = <&clock 276>; 618 clocks = <&clock CLK_PDMA1>;
598 clock-names = "apb_pclk"; 619 clock-names = "apb_pclk";
599 #dma-cells = <1>; 620 #dma-cells = <1>;
600 #dma-channels = <8>; 621 #dma-channels = <8>;
@@ -605,7 +626,7 @@
605 compatible = "arm,pl330", "arm,primecell"; 626 compatible = "arm,pl330", "arm,primecell";
606 reg = <0x10800000 0x1000>; 627 reg = <0x10800000 0x1000>;
607 interrupts = <0 33 0>; 628 interrupts = <0 33 0>;
608 clocks = <&clock 346>; 629 clocks = <&clock CLK_MDMA0>;
609 clock-names = "apb_pclk"; 630 clock-names = "apb_pclk";
610 #dma-cells = <1>; 631 #dma-cells = <1>;
611 #dma-channels = <8>; 632 #dma-channels = <8>;
@@ -616,7 +637,7 @@
616 compatible = "arm,pl330", "arm,primecell"; 637 compatible = "arm,pl330", "arm,primecell";
617 reg = <0x11C10000 0x1000>; 638 reg = <0x11C10000 0x1000>;
618 interrupts = <0 124 0>; 639 interrupts = <0 124 0>;
619 clocks = <&clock 271>; 640 clocks = <&clock CLK_MDMA1>;
620 clock-names = "apb_pclk"; 641 clock-names = "apb_pclk";
621 #dma-cells = <1>; 642 #dma-cells = <1>;
622 #dma-channels = <8>; 643 #dma-channels = <8>;
@@ -629,7 +650,7 @@
629 reg = <0x13e00000 0x1000>; 650 reg = <0x13e00000 0x1000>;
630 interrupts = <0 85 0>; 651 interrupts = <0 85 0>;
631 samsung,power-domain = <&pd_gsc>; 652 samsung,power-domain = <&pd_gsc>;
632 clocks = <&clock 256>; 653 clocks = <&clock CLK_GSCL0>;
633 clock-names = "gscl"; 654 clock-names = "gscl";
634 }; 655 };
635 656
@@ -638,7 +659,7 @@
638 reg = <0x13e10000 0x1000>; 659 reg = <0x13e10000 0x1000>;
639 interrupts = <0 86 0>; 660 interrupts = <0 86 0>;
640 samsung,power-domain = <&pd_gsc>; 661 samsung,power-domain = <&pd_gsc>;
641 clocks = <&clock 257>; 662 clocks = <&clock CLK_GSCL1>;
642 clock-names = "gscl"; 663 clock-names = "gscl";
643 }; 664 };
644 665
@@ -647,7 +668,7 @@
647 reg = <0x13e20000 0x1000>; 668 reg = <0x13e20000 0x1000>;
648 interrupts = <0 87 0>; 669 interrupts = <0 87 0>;
649 samsung,power-domain = <&pd_gsc>; 670 samsung,power-domain = <&pd_gsc>;
650 clocks = <&clock 258>; 671 clocks = <&clock CLK_GSCL2>;
651 clock-names = "gscl"; 672 clock-names = "gscl";
652 }; 673 };
653 674
@@ -656,7 +677,7 @@
656 reg = <0x13e30000 0x1000>; 677 reg = <0x13e30000 0x1000>;
657 interrupts = <0 88 0>; 678 interrupts = <0 88 0>;
658 samsung,power-domain = <&pd_gsc>; 679 samsung,power-domain = <&pd_gsc>;
659 clocks = <&clock 259>; 680 clocks = <&clock CLK_GSCL3>;
660 clock-names = "gscl"; 681 clock-names = "gscl";
661 }; 682 };
662 683
@@ -664,8 +685,9 @@
664 compatible = "samsung,exynos4212-hdmi"; 685 compatible = "samsung,exynos4212-hdmi";
665 reg = <0x14530000 0x70000>; 686 reg = <0x14530000 0x70000>;
666 interrupts = <0 95 0>; 687 interrupts = <0 95 0>;
667 clocks = <&clock 344>, <&clock 136>, <&clock 137>, 688 clocks = <&clock CLK_HDMI>, <&clock CLK_SCLK_HDMI>,
668 <&clock 159>, <&clock 1024>; 689 <&clock CLK_SCLK_PIXEL>, <&clock CLK_SCLK_HDMIPHY>,
690 <&clock CLK_MOUT_HDMI>;
669 clock-names = "hdmi", "sclk_hdmi", "sclk_pixel", 691 clock-names = "hdmi", "sclk_hdmi", "sclk_pixel",
670 "sclk_hdmiphy", "mout_hdmi"; 692 "sclk_hdmiphy", "mout_hdmi";
671 }; 693 };
@@ -674,7 +696,7 @@
674 compatible = "samsung,exynos5250-mixer"; 696 compatible = "samsung,exynos5250-mixer";
675 reg = <0x14450000 0x10000>; 697 reg = <0x14450000 0x10000>;
676 interrupts = <0 94 0>; 698 interrupts = <0 94 0>;
677 clocks = <&clock 343>, <&clock 136>; 699 clocks = <&clock CLK_MIXER>, <&clock CLK_SCLK_HDMI>;
678 clock-names = "mixer", "sclk_hdmi"; 700 clock-names = "mixer", "sclk_hdmi";
679 }; 701 };
680 702
@@ -685,14 +707,14 @@
685 }; 707 };
686 708
687 dp-controller@145B0000 { 709 dp-controller@145B0000 {
688 clocks = <&clock 342>; 710 clocks = <&clock CLK_DP>;
689 clock-names = "dp"; 711 clock-names = "dp";
690 phys = <&dp_phy>; 712 phys = <&dp_phy>;
691 phy-names = "dp"; 713 phy-names = "dp";
692 }; 714 };
693 715
694 fimd@14400000 { 716 fimd@14400000 {
695 clocks = <&clock 133>, <&clock 339>; 717 clocks = <&clock CLK_SCLK_FIMD1>, <&clock CLK_FIMD1>;
696 clock-names = "sclk_fimd", "fimd"; 718 clock-names = "sclk_fimd", "fimd";
697 }; 719 };
698 720
@@ -700,10 +722,18 @@
700 compatible = "samsung,exynos-adc-v1"; 722 compatible = "samsung,exynos-adc-v1";
701 reg = <0x12D10000 0x100>, <0x10040718 0x4>; 723 reg = <0x12D10000 0x100>, <0x10040718 0x4>;
702 interrupts = <0 106 0>; 724 interrupts = <0 106 0>;
703 clocks = <&clock 303>; 725 clocks = <&clock CLK_ADC>;
704 clock-names = "adc"; 726 clock-names = "adc";
705 #io-channel-cells = <1>; 727 #io-channel-cells = <1>;
706 io-channel-ranges; 728 io-channel-ranges;
707 status = "disabled"; 729 status = "disabled";
708 }; 730 };
731
732 sss@10830000 {
733 compatible = "samsung,exynos4210-secss";
734 reg = <0x10830000 0x10000>;
735 interrupts = <0 112 0>;
736 clocks = <&clock 348>;
737 clock-names = "secss";
738 };
709}; 739};
diff --git a/arch/arm/boot/dts/exynos5420-arndale-octa.dts b/arch/arm/boot/dts/exynos5420-arndale-octa.dts
index 7340745ff979..80a3bf4c5986 100644
--- a/arch/arm/boot/dts/exynos5420-arndale-octa.dts
+++ b/arch/arm/boot/dts/exynos5420-arndale-octa.dts
@@ -11,10 +11,12 @@
11 11
12/dts-v1/; 12/dts-v1/;
13#include "exynos5420.dtsi" 13#include "exynos5420.dtsi"
14#include <dt-bindings/interrupt-controller/irq.h>
15#include <dt-bindings/input/input.h>
14 16
15/ { 17/ {
16 model = "Insignal Arndale Octa evaluation board based on EXYNOS5420"; 18 model = "Insignal Arndale Octa evaluation board based on EXYNOS5420";
17 compatible = "insignal,arndale-octa", "samsung,exynos5420"; 19 compatible = "insignal,arndale-octa", "samsung,exynos5420", "samsung,exynos5";
18 20
19 memory { 21 memory {
20 reg = <0x20000000 0x80000000>; 22 reg = <0x20000000 0x80000000>;
@@ -31,6 +33,10 @@
31 }; 33 };
32 }; 34 };
33 35
36 rtc@101E0000 {
37 status = "okay";
38 };
39
34 mmc@12200000 { 40 mmc@12200000 {
35 status = "okay"; 41 status = "okay";
36 broken-cd; 42 broken-cd;
@@ -41,6 +47,7 @@
41 samsung,dw-mshc-ddr-timing = <0 2>; 47 samsung,dw-mshc-ddr-timing = <0 2>;
42 pinctrl-names = "default"; 48 pinctrl-names = "default";
43 pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus4 &sd0_bus8>; 49 pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_bus4 &sd0_bus8>;
50 vmmc-supply = <&ldo10_reg>;
44 51
45 slot@0 { 52 slot@0 {
46 reg = <0>; 53 reg = <0>;
@@ -57,10 +64,316 @@
57 samsung,dw-mshc-ddr-timing = <1 2>; 64 samsung,dw-mshc-ddr-timing = <1 2>;
58 pinctrl-names = "default"; 65 pinctrl-names = "default";
59 pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_cd &sd2_bus4>; 66 pinctrl-0 = <&sd2_clk &sd2_cmd &sd2_cd &sd2_bus4>;
67 vmmc-supply = <&ldo10_reg>;
60 68
61 slot@0 { 69 slot@0 {
62 reg = <0>; 70 reg = <0>;
63 bus-width = <4>; 71 bus-width = <4>;
64 }; 72 };
65 }; 73 };
74
75 hsi2c_4: i2c@12CA0000 {
76 status = "okay";
77
78 s2mps11_pmic@66 {
79 compatible = "samsung,s2mps11-pmic";
80 reg = <0x66>;
81 s2mps11,buck2-ramp-delay = <12>;
82 s2mps11,buck34-ramp-delay = <12>;
83 s2mps11,buck16-ramp-delay = <12>;
84 s2mps11,buck6-ramp-enable = <1>;
85 s2mps11,buck2-ramp-enable = <1>;
86 s2mps11,buck3-ramp-enable = <1>;
87 s2mps11,buck4-ramp-enable = <1>;
88
89 interrupt-parent = <&gpx3>;
90 interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
91
92 s2mps11_osc: clocks {
93 #clock-cells = <1>;
94 clock-output-names = "s2mps11_ap",
95 "s2mps11_cp", "s2mps11_bt";
96 };
97
98 regulators {
99 ldo1_reg: LDO1 {
100 regulator-name = "PVDD_ALIVE_1V0";
101 regulator-min-microvolt = <1000000>;
102 regulator-max-microvolt = <1000000>;
103 regulator-always-on;
104 };
105
106 ldo2_reg: LDO2 {
107 regulator-name = "PVDD_APIO_1V8";
108 regulator-min-microvolt = <1800000>;
109 regulator-max-microvolt = <1800000>;
110 };
111
112 ldo3_reg: LDO3 {
113 regulator-name = "PVDD_APIO_MMCON_1V8";
114 regulator-min-microvolt = <1800000>;
115 regulator-max-microvolt = <1800000>;
116 regulator-always-on;
117 };
118
119 ldo4_reg: LDO4 {
120 regulator-name = "PVDD_ADC_1V8";
121 regulator-min-microvolt = <1800000>;
122 regulator-max-microvolt = <1800000>;
123 };
124
125 ldo5_reg: LDO5 {
126 regulator-name = "PVDD_PLL_1V8";
127 regulator-min-microvolt = <1800000>;
128 regulator-max-microvolt = <1800000>;
129 regulator-always-on;
130 };
131
132 ldo6_reg: LDO6 {
133 regulator-name = "PVDD_ANAIP_1V0";
134 regulator-min-microvolt = <1000000>;
135 regulator-max-microvolt = <1000000>;
136 };
137
138 ldo7_reg: LDO7 {
139 regulator-name = "PVDD_ANAIP_1V8";
140 regulator-min-microvolt = <1800000>;
141 regulator-max-microvolt = <1800000>;
142 };
143
144 ldo8_reg: LDO8 {
145 regulator-name = "PVDD_ABB_1V8";
146 regulator-min-microvolt = <1800000>;
147 regulator-max-microvolt = <1800000>;
148 };
149
150 ldo9_reg: LDO9 {
151 regulator-name = "PVDD_USB_3V3";
152 regulator-min-microvolt = <3000000>;
153 regulator-max-microvolt = <3000000>;
154 regulator-always-on;
155 };
156
157 ldo10_reg: LDO10 {
158 regulator-name = "PVDD_PRE_1V8";
159 regulator-min-microvolt = <1800000>;
160 regulator-max-microvolt = <1800000>;
161 regulator-always-on;
162 };
163
164 ldo11_reg: LDO11 {
165 regulator-name = "PVDD_USB_1V0";
166 regulator-min-microvolt = <1000000>;
167 regulator-max-microvolt = <1000000>;
168 regulator-always-on;
169 };
170
171 ldo12_reg: LDO12 {
172 regulator-name = "PVDD_HSIC_1V8";
173 regulator-min-microvolt = <1800000>;
174 regulator-max-microvolt = <1800000>;
175 };
176
177 ldo13_reg: LDO13 {
178 regulator-name = "PVDD_APIO_MMCOFF_2V8";
179 regulator-min-microvolt = <2800000>;
180 regulator-max-microvolt = <2800000>;
181 };
182
183 ldo15_reg: LDO15 {
184 regulator-name = "PVDD_PERI_2V8";
185 regulator-min-microvolt = <3300000>;
186 regulator-max-microvolt = <3300000>;
187 };
188
189 ldo16_reg: LDO16 {
190 regulator-name = "PVDD_PERI_3V3";
191 regulator-min-microvolt = <2200000>;
192 regulator-max-microvolt = <2200000>;
193 };
194
195 ldo18_reg: LDO18 {
196 regulator-name = "PVDD_EMMC_1V8";
197 regulator-min-microvolt = <1800000>;
198 regulator-max-microvolt = <1800000>;
199 };
200
201 ldo19_reg: LDO19 {
202 regulator-name = "PVDD_TFLASH_2V8";
203 regulator-min-microvolt = <2800000>;
204 regulator-max-microvolt = <2800000>;
205 };
206
207 ldo20_reg: LDO20 {
208 regulator-name = "PVDD_BTWIFI_1V8";
209 regulator-min-microvolt = <1800000>;
210 regulator-max-microvolt = <1800000>;
211 };
212
213 ldo21_reg: LDO21 {
214 regulator-name = "PVDD_CAM1IO_1V8";
215 regulator-min-microvolt = <1800000>;
216 regulator-max-microvolt = <1800000>;
217 };
218
219 ldo23_reg: LDO23 {
220 regulator-name = "PVDD_MIFS_1V1";
221 regulator-min-microvolt = <1200000>;
222 regulator-max-microvolt = <1200000>;
223 regulator-always-on;
224 };
225
226 ldo24_reg: LDO24 {
227 regulator-name = "PVDD_CAM1_AVDD_2V8";
228 regulator-min-microvolt = <2800000>;
229 regulator-max-microvolt = <2800000>;
230 };
231
232 ldo26_reg: LDO26 {
233 regulator-name = "PVDD_CAM0_AF_2V8";
234 regulator-min-microvolt = <3000000>;
235 regulator-max-microvolt = <3000000>;
236 };
237
238 ldo27_reg: LDO27 {
239 regulator-name = "PVDD_G3DS_1V0";
240 regulator-min-microvolt = <1200000>;
241 regulator-max-microvolt = <1200000>;
242 };
243
244 ldo28_reg: LDO28 {
245 regulator-name = "PVDD_TSP_3V3";
246 regulator-min-microvolt = <3300000>;
247 regulator-max-microvolt = <3300000>;
248 };
249
250 ldo29_reg: LDO29 {
251 regulator-name = "PVDD_AUDIO_1V8";
252 regulator-min-microvolt = <1800000>;
253 regulator-max-microvolt = <1800000>;
254 };
255
256 ldo31_reg: LDO31 {
257 regulator-name = "PVDD_PERI_1V8";
258 regulator-min-microvolt = <1800000>;
259 regulator-max-microvolt = <1800000>;
260 };
261
262 ldo32_reg: LDO32 {
263 regulator-name = "PVDD_LCD_1V8";
264 regulator-min-microvolt = <1800000>;
265 regulator-max-microvolt = <1800000>;
266 };
267
268 ldo33_reg: LDO33 {
269 regulator-name = "PVDD_CAM0IO_1V8";
270 regulator-min-microvolt = <1800000>;
271 regulator-max-microvolt = <1800000>;
272 };
273
274 ldo35_reg: LDO35 {
275 regulator-name = "PVDD_CAM0_DVDD_1V2";
276 regulator-min-microvolt = <1200000>;
277 regulator-max-microvolt = <1200000>;
278 };
279
280 ldo38_reg: LDO38 {
281 regulator-name = "PVDD_CAM0_AVDD_2V8";
282 regulator-min-microvolt = <2800000>;
283 regulator-max-microvolt = <2800000>;
284 };
285
286 buck1_reg: BUCK1 {
287 regulator-name = "PVDD_MIF_1V1";
288 regulator-min-microvolt = <800000>;
289 regulator-max-microvolt = <1100000>;
290 regulator-always-on;
291 };
292
293 buck2_reg: BUCK2 {
294 regulator-name = "vdd_arm";
295 regulator-min-microvolt = <800000>;
296 regulator-max-microvolt = <1000000>;
297 regulator-always-on;
298 };
299
300 buck3_reg: BUCK3 {
301 regulator-name = "PVDD_INT_1V0";
302 regulator-min-microvolt = <800000>;
303 regulator-max-microvolt = <1000000>;
304 regulator-always-on;
305 };
306
307 buck4_reg: BUCK4 {
308 regulator-name = "PVDD_G3D_1V0";
309 regulator-min-microvolt = <800000>;
310 regulator-max-microvolt = <1000000>;
311 };
312
313 buck5_reg: BUCK5 {
314 regulator-name = "PVDD_LPDDR3_1V2";
315 regulator-min-microvolt = <800000>;
316 regulator-max-microvolt = <1200000>;
317 regulator-always-on;
318 };
319
320 buck6_reg: BUCK6 {
321 regulator-name = "PVDD_KFC_1V0";
322 regulator-min-microvolt = <800000>;
323 regulator-max-microvolt = <1000000>;
324 regulator-always-on;
325 };
326
327 buck7_reg: BUCK7 {
328 regulator-name = "VIN_LLDO_1V4";
329 regulator-min-microvolt = <800000>;
330 regulator-max-microvolt = <1400000>;
331 regulator-always-on;
332 };
333
334 buck8_reg: BUCK8 {
335 regulator-name = "VIN_MLDO_2V0";
336 regulator-min-microvolt = <800000>;
337 regulator-max-microvolt = <2000000>;
338 regulator-always-on;
339 };
340
341 buck9_reg: BUCK9 {
342 regulator-name = "VIN_HLDO_3V5";
343 regulator-min-microvolt = <3000000>;
344 regulator-max-microvolt = <3500000>;
345 regulator-always-on;
346 };
347
348 buck10_reg: BUCK10 {
349 regulator-name = "PVDD_EMMCF_2V8";
350 regulator-min-microvolt = <2800000>;
351 regulator-max-microvolt = <2800000>;
352 };
353 };
354 };
355 };
356
357 gpio_keys {
358 compatible = "gpio-keys";
359
360 wakeup {
361 label = "SW-TACT1";
362 gpios = <&gpx2 7 1>;
363 linux,code = <KEY_WAKEUP>;
364 gpio-key,wakeup;
365 };
366 };
367
368 amba {
369 mdma1: mdma@11C10000 {
370 /*
371 * MDMA1 can support both secure and non-secure
372 * AXI transactions. When this is enabled in the kernel
373 * for boards that run in secure mode, we are getting
374 * imprecise external aborts causing the kernel to oops.
375 */
376 status = "disabled";
377 };
378 };
66}; 379};
diff --git a/arch/arm/boot/dts/exynos5420-smdk5420.dts b/arch/arm/boot/dts/exynos5420-smdk5420.dts
index fb5a1e25c632..69104850eb5e 100644
--- a/arch/arm/boot/dts/exynos5420-smdk5420.dts
+++ b/arch/arm/boot/dts/exynos5420-smdk5420.dts
@@ -14,7 +14,7 @@
14 14
15/ { 15/ {
16 model = "Samsung SMDK5420 board based on EXYNOS5420"; 16 model = "Samsung SMDK5420 board based on EXYNOS5420";
17 compatible = "samsung,smdk5420", "samsung,exynos5420"; 17 compatible = "samsung,smdk5420", "samsung,exynos5420", "samsung,exynos5";
18 18
19 memory { 19 memory {
20 reg = <0x20000000 0x80000000>; 20 reg = <0x20000000 0x80000000>;
@@ -31,6 +31,43 @@
31 }; 31 };
32 }; 32 };
33 33
34 regulators {
35 compatible = "simple-bus";
36 #address-cells = <1>;
37 #size-cells = <0>;
38
39 vdd: fixed-regulator@0 {
40 compatible = "regulator-fixed";
41 reg = <0>;
42 regulator-name = "vdd-supply";
43 regulator-min-microvolt = <1800000>;
44 regulator-max-microvolt = <1800000>;
45 regulator-always-on;
46 };
47
48 dbvdd: fixed-regulator@1 {
49 compatible = "regulator-fixed";
50 reg = <1>;
51 regulator-name = "dbvdd-supply";
52 regulator-min-microvolt = <3300000>;
53 regulator-max-microvolt = <3300000>;
54 regulator-always-on;
55 };
56
57 spkvdd: fixed-regulator@2 {
58 compatible = "regulator-fixed";
59 reg = <2>;
60 regulator-name = "spkvdd-supply";
61 regulator-min-microvolt = <5000000>;
62 regulator-max-microvolt = <5000000>;
63 regulator-always-on;
64 };
65 };
66
67 rtc@101E0000 {
68 status = "okay";
69 };
70
34 mmc@12200000 { 71 mmc@12200000 {
35 status = "okay"; 72 status = "okay";
36 broken-cd; 73 broken-cd;
@@ -120,4 +157,220 @@
120 reg = <0x50>; 157 reg = <0x50>;
121 }; 158 };
122 }; 159 };
160
161 hsi2c_4: i2c@12CA0000 {
162 status = "okay";
163
164 s2mps11_pmic@66 {
165 compatible = "samsung,s2mps11-pmic";
166 reg = <0x66>;
167 s2mps11,buck2-ramp-delay = <12>;
168 s2mps11,buck34-ramp-delay = <12>;
169 s2mps11,buck16-ramp-delay = <12>;
170 s2mps11,buck6-ramp-enable = <1>;
171 s2mps11,buck2-ramp-enable = <1>;
172 s2mps11,buck3-ramp-enable = <1>;
173 s2mps11,buck4-ramp-enable = <1>;
174
175 s2mps11_osc: clocks {
176 #clock-cells = <1>;
177 clock-output-names = "s2mps11_ap",
178 "s2mps11_cp", "s2mps11_bt";
179 };
180
181 regulators {
182 ldo1_reg: LDO1 {
183 regulator-name = "vdd_ldo1";
184 regulator-min-microvolt = <1000000>;
185 regulator-max-microvolt = <1000000>;
186 regulator-always-on;
187 };
188
189 ldo3_reg: LDO3 {
190 regulator-name = "vdd_ldo3";
191 regulator-min-microvolt = <1800000>;
192 regulator-max-microvolt = <1800000>;
193 regulator-always-on;
194 };
195
196 ldo5_reg: LDO5 {
197 regulator-name = "vdd_ldo5";
198 regulator-min-microvolt = <1800000>;
199 regulator-max-microvolt = <1800000>;
200 regulator-always-on;
201 };
202
203 ldo6_reg: LDO6 {
204 regulator-name = "vdd_ldo6";
205 regulator-min-microvolt = <1000000>;
206 regulator-max-microvolt = <1000000>;
207 regulator-always-on;
208 };
209
210 ldo7_reg: LDO7 {
211 regulator-name = "vdd_ldo7";
212 regulator-min-microvolt = <1800000>;
213 regulator-max-microvolt = <1800000>;
214 regulator-always-on;
215 };
216
217 ldo8_reg: LDO8 {
218 regulator-name = "vdd_ldo8";
219 regulator-min-microvolt = <1800000>;
220 regulator-max-microvolt = <1800000>;
221 regulator-always-on;
222 };
223
224 ldo9_reg: LDO9 {
225 regulator-name = "vdd_ldo9";
226 regulator-min-microvolt = <3000000>;
227 regulator-max-microvolt = <3000000>;
228 regulator-always-on;
229 };
230
231 ldo10_reg: LDO10 {
232 regulator-name = "vdd_ldo10";
233 regulator-min-microvolt = <1800000>;
234 regulator-max-microvolt = <1800000>;
235 regulator-always-on;
236 };
237
238 ldo11_reg: LDO11 {
239 regulator-name = "vdd_ldo11";
240 regulator-min-microvolt = <1000000>;
241 regulator-max-microvolt = <1000000>;
242 regulator-always-on;
243 };
244
245 ldo12_reg: LDO12 {
246 regulator-name = "vdd_ldo12";
247 regulator-min-microvolt = <1800000>;
248 regulator-max-microvolt = <1800000>;
249 regulator-always-on;
250 };
251
252 ldo13_reg: LDO13 {
253 regulator-name = "vdd_ldo13";
254 regulator-min-microvolt = <2800000>;
255 regulator-max-microvolt = <2800000>;
256 regulator-always-on;
257 };
258
259 ldo15_reg: LDO15 {
260 regulator-name = "vdd_ldo15";
261 regulator-min-microvolt = <3100000>;
262 regulator-max-microvolt = <3100000>;
263 regulator-always-on;
264 };
265
266 ldo16_reg: LDO16 {
267 regulator-name = "vdd_ldo16";
268 regulator-min-microvolt = <2200000>;
269 regulator-max-microvolt = <2200000>;
270 regulator-always-on;
271 };
272
273 ldo17_reg: LDO17 {
274 regulator-name = "tsp_avdd";
275 regulator-min-microvolt = <3300000>;
276 regulator-max-microvolt = <3300000>;
277 regulator-always-on;
278 };
279
280 ldo19_reg: LDO19 {
281 regulator-name = "vdd_sd";
282 regulator-min-microvolt = <2800000>;
283 regulator-max-microvolt = <2800000>;
284 regulator-always-on;
285 };
286
287 ldo24_reg: LDO24 {
288 regulator-name = "tsp_io";
289 regulator-min-microvolt = <2800000>;
290 regulator-max-microvolt = <2800000>;
291 regulator-always-on;
292 };
293
294 buck1_reg: BUCK1 {
295 regulator-name = "vdd_mif";
296 regulator-min-microvolt = <800000>;
297 regulator-max-microvolt = <1300000>;
298 regulator-always-on;
299 regulator-boot-on;
300 };
301
302 buck2_reg: BUCK2 {
303 regulator-name = "vdd_arm";
304 regulator-min-microvolt = <800000>;
305 regulator-max-microvolt = <1500000>;
306 regulator-always-on;
307 regulator-boot-on;
308 };
309
310 buck3_reg: BUCK3 {
311 regulator-name = "vdd_int";
312 regulator-min-microvolt = <800000>;
313 regulator-max-microvolt = <1400000>;
314 regulator-always-on;
315 regulator-boot-on;
316 };
317
318 buck4_reg: BUCK4 {
319 regulator-name = "vdd_g3d";
320 regulator-min-microvolt = <800000>;
321 regulator-max-microvolt = <1400000>;
322 regulator-always-on;
323 regulator-boot-on;
324 };
325
326 buck5_reg: BUCK5 {
327 regulator-name = "vdd_mem";
328 regulator-min-microvolt = <800000>;
329 regulator-max-microvolt = <1400000>;
330 regulator-always-on;
331 regulator-boot-on;
332 };
333
334 buck6_reg: BUCK6 {
335 regulator-name = "vdd_kfc";
336 regulator-min-microvolt = <800000>;
337 regulator-max-microvolt = <1500000>;
338 regulator-always-on;
339 regulator-boot-on;
340 };
341
342 buck7_reg: BUCK7 {
343 regulator-name = "vdd_1.0v_ldo";
344 regulator-min-microvolt = <800000>;
345 regulator-max-microvolt = <1500000>;
346 regulator-always-on;
347 regulator-boot-on;
348 };
349
350 buck8_reg: BUCK8 {
351 regulator-name = "vdd_1.8v_ldo";
352 regulator-min-microvolt = <800000>;
353 regulator-max-microvolt = <1500000>;
354 regulator-always-on;
355 regulator-boot-on;
356 };
357
358 buck9_reg: BUCK9 {
359 regulator-name = "vdd_2.8v_ldo";
360 regulator-min-microvolt = <3000000>;
361 regulator-max-microvolt = <3750000>;
362 regulator-always-on;
363 regulator-boot-on;
364 };
365
366 buck10_reg: BUCK10 {
367 regulator-name = "vdd_vmem";
368 regulator-min-microvolt = <2850000>;
369 regulator-max-microvolt = <2850000>;
370 regulator-always-on;
371 regulator-boot-on;
372 };
373 };
374 };
375 };
123}; 376};
diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi
index 8db792b26f79..c3a9a66c5767 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -13,13 +13,14 @@
13 * published by the Free Software Foundation. 13 * published by the Free Software Foundation.
14 */ 14 */
15 15
16#include <dt-bindings/clock/exynos5420.h>
16#include "exynos5.dtsi" 17#include "exynos5.dtsi"
17#include "exynos5420-pinctrl.dtsi" 18#include "exynos5420-pinctrl.dtsi"
18 19
19#include <dt-bindings/clk/exynos-audss-clk.h> 20#include <dt-bindings/clock/exynos-audss-clk.h>
20 21
21/ { 22/ {
22 compatible = "samsung,exynos5420"; 23 compatible = "samsung,exynos5420", "samsung,exynos5";
23 24
24 aliases { 25 aliases {
25 mshc0 = &mmc_0; 26 mshc0 = &mmc_0;
@@ -119,7 +120,8 @@
119 compatible = "samsung,exynos5420-audss-clock"; 120 compatible = "samsung,exynos5420-audss-clock";
120 reg = <0x03810000 0x0C>; 121 reg = <0x03810000 0x0C>;
121 #clock-cells = <1>; 122 #clock-cells = <1>;
122 clocks = <&clock 1>, <&clock 5>, <&clock 148>, <&clock 149>; 123 clocks = <&clock CLK_FIN_PLL>, <&clock CLK_FOUT_EPLL>,
124 <&clock CLK_SCLK_MAUDIO0>, <&clock CLK_SCLK_MAUPCM0>;
123 clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in"; 125 clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in";
124 }; 126 };
125 127
@@ -127,7 +129,7 @@
127 compatible = "samsung,mfc-v7"; 129 compatible = "samsung,mfc-v7";
128 reg = <0x11000000 0x10000>; 130 reg = <0x11000000 0x10000>;
129 interrupts = <0 96 0>; 131 interrupts = <0 96 0>;
130 clocks = <&clock 401>; 132 clocks = <&clock CLK_MFC>;
131 clock-names = "mfc"; 133 clock-names = "mfc";
132 }; 134 };
133 135
@@ -137,7 +139,7 @@
137 #address-cells = <1>; 139 #address-cells = <1>;
138 #size-cells = <0>; 140 #size-cells = <0>;
139 reg = <0x12200000 0x2000>; 141 reg = <0x12200000 0x2000>;
140 clocks = <&clock 351>, <&clock 132>; 142 clocks = <&clock CLK_MMC0>, <&clock CLK_SCLK_MMC0>;
141 clock-names = "biu", "ciu"; 143 clock-names = "biu", "ciu";
142 fifo-depth = <0x40>; 144 fifo-depth = <0x40>;
143 status = "disabled"; 145 status = "disabled";
@@ -149,7 +151,7 @@
149 #address-cells = <1>; 151 #address-cells = <1>;
150 #size-cells = <0>; 152 #size-cells = <0>;
151 reg = <0x12210000 0x2000>; 153 reg = <0x12210000 0x2000>;
152 clocks = <&clock 352>, <&clock 133>; 154 clocks = <&clock CLK_MMC1>, <&clock CLK_SCLK_MMC1>;
153 clock-names = "biu", "ciu"; 155 clock-names = "biu", "ciu";
154 fifo-depth = <0x40>; 156 fifo-depth = <0x40>;
155 status = "disabled"; 157 status = "disabled";
@@ -161,7 +163,7 @@
161 #address-cells = <1>; 163 #address-cells = <1>;
162 #size-cells = <0>; 164 #size-cells = <0>;
163 reg = <0x12220000 0x1000>; 165 reg = <0x12220000 0x1000>;
164 clocks = <&clock 353>, <&clock 134>; 166 clocks = <&clock CLK_MMC2>, <&clock CLK_SCLK_MMC2>;
165 clock-names = "biu", "ciu"; 167 clock-names = "biu", "ciu";
166 fifo-depth = <0x40>; 168 fifo-depth = <0x40>;
167 status = "disabled"; 169 status = "disabled";
@@ -175,7 +177,7 @@
175 interrupt-parent = <&mct_map>; 177 interrupt-parent = <&mct_map>;
176 interrupts = <0>, <1>, <2>, <3>, <4>, <5>, <6>, <7>, 178 interrupts = <0>, <1>, <2>, <3>, <4>, <5>, <6>, <7>,
177 <8>, <9>, <10>, <11>; 179 <8>, <9>, <10>, <11>;
178 clocks = <&clock 1>, <&clock 315>; 180 clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MCT>;
179 clock-names = "fin_pll", "mct"; 181 clock-names = "fin_pll", "mct";
180 182
181 mct_map: mct-map { 183 mct_map: mct-map {
@@ -269,9 +271,9 @@
269 }; 271 };
270 272
271 rtc@101E0000 { 273 rtc@101E0000 {
272 clocks = <&clock 317>; 274 clocks = <&clock CLK_RTC>;
273 clock-names = "rtc"; 275 clock-names = "rtc";
274 status = "okay"; 276 status = "disabled";
275 }; 277 };
276 278
277 amba { 279 amba {
@@ -281,11 +283,22 @@
281 interrupt-parent = <&gic>; 283 interrupt-parent = <&gic>;
282 ranges; 284 ranges;
283 285
286 adma: adma@03880000 {
287 compatible = "arm,pl330", "arm,primecell";
288 reg = <0x03880000 0x1000>;
289 interrupts = <0 110 0>;
290 clocks = <&clock_audss EXYNOS_ADMA>;
291 clock-names = "apb_pclk";
292 #dma-cells = <1>;
293 #dma-channels = <6>;
294 #dma-requests = <16>;
295 };
296
284 pdma0: pdma@121A0000 { 297 pdma0: pdma@121A0000 {
285 compatible = "arm,pl330", "arm,primecell"; 298 compatible = "arm,pl330", "arm,primecell";
286 reg = <0x121A0000 0x1000>; 299 reg = <0x121A0000 0x1000>;
287 interrupts = <0 34 0>; 300 interrupts = <0 34 0>;
288 clocks = <&clock 362>; 301 clocks = <&clock CLK_PDMA0>;
289 clock-names = "apb_pclk"; 302 clock-names = "apb_pclk";
290 #dma-cells = <1>; 303 #dma-cells = <1>;
291 #dma-channels = <8>; 304 #dma-channels = <8>;
@@ -296,7 +309,7 @@
296 compatible = "arm,pl330", "arm,primecell"; 309 compatible = "arm,pl330", "arm,primecell";
297 reg = <0x121B0000 0x1000>; 310 reg = <0x121B0000 0x1000>;
298 interrupts = <0 35 0>; 311 interrupts = <0 35 0>;
299 clocks = <&clock 363>; 312 clocks = <&clock CLK_PDMA1>;
300 clock-names = "apb_pclk"; 313 clock-names = "apb_pclk";
301 #dma-cells = <1>; 314 #dma-cells = <1>;
302 #dma-channels = <8>; 315 #dma-channels = <8>;
@@ -307,7 +320,7 @@
307 compatible = "arm,pl330", "arm,primecell"; 320 compatible = "arm,pl330", "arm,primecell";
308 reg = <0x10800000 0x1000>; 321 reg = <0x10800000 0x1000>;
309 interrupts = <0 33 0>; 322 interrupts = <0 33 0>;
310 clocks = <&clock 473>; 323 clocks = <&clock CLK_MDMA0>;
311 clock-names = "apb_pclk"; 324 clock-names = "apb_pclk";
312 #dma-cells = <1>; 325 #dma-cells = <1>;
313 #dma-channels = <8>; 326 #dma-channels = <8>;
@@ -318,7 +331,7 @@
318 compatible = "arm,pl330", "arm,primecell"; 331 compatible = "arm,pl330", "arm,primecell";
319 reg = <0x11C10000 0x1000>; 332 reg = <0x11C10000 0x1000>;
320 interrupts = <0 124 0>; 333 interrupts = <0 124 0>;
321 clocks = <&clock 442>; 334 clocks = <&clock CLK_MDMA1>;
322 clock-names = "apb_pclk"; 335 clock-names = "apb_pclk";
323 #dma-cells = <1>; 336 #dma-cells = <1>;
324 #dma-channels = <8>; 337 #dma-channels = <8>;
@@ -326,6 +339,49 @@
326 }; 339 };
327 }; 340 };
328 341
342 i2s0: i2s@03830000 {
343 compatible = "samsung,exynos5420-i2s";
344 reg = <0x03830000 0x100>;
345 dmas = <&adma 0
346 &adma 2
347 &adma 1>;
348 dma-names = "tx", "rx", "tx-sec";
349 clocks = <&clock_audss EXYNOS_I2S_BUS>,
350 <&clock_audss EXYNOS_I2S_BUS>,
351 <&clock_audss EXYNOS_SCLK_I2S>;
352 clock-names = "iis", "i2s_opclk0", "i2s_opclk1";
353 samsung,idma-addr = <0x03000000>;
354 pinctrl-names = "default";
355 pinctrl-0 = <&i2s0_bus>;
356 status = "disabled";
357 };
358
359 i2s1: i2s@12D60000 {
360 compatible = "samsung,exynos5420-i2s";
361 reg = <0x12D60000 0x100>;
362 dmas = <&pdma1 12
363 &pdma1 11>;
364 dma-names = "tx", "rx";
365 clocks = <&clock CLK_I2S1>, <&clock CLK_SCLK_I2S1>;
366 clock-names = "iis", "i2s_opclk0";
367 pinctrl-names = "default";
368 pinctrl-0 = <&i2s1_bus>;
369 status = "disabled";
370 };
371
372 i2s2: i2s@12D70000 {
373 compatible = "samsung,exynos5420-i2s";
374 reg = <0x12D70000 0x100>;
375 dmas = <&pdma0 12
376 &pdma0 11>;
377 dma-names = "tx", "rx";
378 clocks = <&clock CLK_I2S2>, <&clock CLK_SCLK_I2S2>;
379 clock-names = "iis", "i2s_opclk0";
380 pinctrl-names = "default";
381 pinctrl-0 = <&i2s2_bus>;
382 status = "disabled";
383 };
384
329 spi_0: spi@12d20000 { 385 spi_0: spi@12d20000 {
330 compatible = "samsung,exynos4210-spi"; 386 compatible = "samsung,exynos4210-spi";
331 reg = <0x12d20000 0x100>; 387 reg = <0x12d20000 0x100>;
@@ -337,7 +393,7 @@
337 #size-cells = <0>; 393 #size-cells = <0>;
338 pinctrl-names = "default"; 394 pinctrl-names = "default";
339 pinctrl-0 = <&spi0_bus>; 395 pinctrl-0 = <&spi0_bus>;
340 clocks = <&clock 271>, <&clock 135>; 396 clocks = <&clock CLK_SPI0>, <&clock CLK_SCLK_SPI0>;
341 clock-names = "spi", "spi_busclk0"; 397 clock-names = "spi", "spi_busclk0";
342 status = "disabled"; 398 status = "disabled";
343 }; 399 };
@@ -353,7 +409,7 @@
353 #size-cells = <0>; 409 #size-cells = <0>;
354 pinctrl-names = "default"; 410 pinctrl-names = "default";
355 pinctrl-0 = <&spi1_bus>; 411 pinctrl-0 = <&spi1_bus>;
356 clocks = <&clock 272>, <&clock 136>; 412 clocks = <&clock CLK_SPI1>, <&clock CLK_SCLK_SPI1>;
357 clock-names = "spi", "spi_busclk0"; 413 clock-names = "spi", "spi_busclk0";
358 status = "disabled"; 414 status = "disabled";
359 }; 415 };
@@ -369,28 +425,28 @@
369 #size-cells = <0>; 425 #size-cells = <0>;
370 pinctrl-names = "default"; 426 pinctrl-names = "default";
371 pinctrl-0 = <&spi2_bus>; 427 pinctrl-0 = <&spi2_bus>;
372 clocks = <&clock 273>, <&clock 137>; 428 clocks = <&clock CLK_SPI2>, <&clock CLK_SCLK_SPI2>;
373 clock-names = "spi", "spi_busclk0"; 429 clock-names = "spi", "spi_busclk0";
374 status = "disabled"; 430 status = "disabled";
375 }; 431 };
376 432
377 serial@12C00000 { 433 serial@12C00000 {
378 clocks = <&clock 257>, <&clock 128>; 434 clocks = <&clock CLK_UART0>, <&clock CLK_SCLK_UART0>;
379 clock-names = "uart", "clk_uart_baud0"; 435 clock-names = "uart", "clk_uart_baud0";
380 }; 436 };
381 437
382 serial@12C10000 { 438 serial@12C10000 {
383 clocks = <&clock 258>, <&clock 129>; 439 clocks = <&clock CLK_UART1>, <&clock CLK_SCLK_UART1>;
384 clock-names = "uart", "clk_uart_baud0"; 440 clock-names = "uart", "clk_uart_baud0";
385 }; 441 };
386 442
387 serial@12C20000 { 443 serial@12C20000 {
388 clocks = <&clock 259>, <&clock 130>; 444 clocks = <&clock CLK_UART2>, <&clock CLK_SCLK_UART2>;
389 clock-names = "uart", "clk_uart_baud0"; 445 clock-names = "uart", "clk_uart_baud0";
390 }; 446 };
391 447
392 serial@12C30000 { 448 serial@12C30000 {
393 clocks = <&clock 260>, <&clock 131>; 449 clocks = <&clock CLK_UART3>, <&clock CLK_SCLK_UART3>;
394 clock-names = "uart", "clk_uart_baud0"; 450 clock-names = "uart", "clk_uart_baud0";
395 }; 451 };
396 452
@@ -399,7 +455,7 @@
399 reg = <0x12dd0000 0x100>; 455 reg = <0x12dd0000 0x100>;
400 samsung,pwm-outputs = <0>, <1>, <2>, <3>; 456 samsung,pwm-outputs = <0>, <1>, <2>, <3>;
401 #pwm-cells = <3>; 457 #pwm-cells = <3>;
402 clocks = <&clock 279>; 458 clocks = <&clock CLK_PWM>;
403 clock-names = "timers"; 459 clock-names = "timers";
404 }; 460 };
405 461
@@ -410,7 +466,7 @@
410 }; 466 };
411 467
412 dp-controller@145B0000 { 468 dp-controller@145B0000 {
413 clocks = <&clock 412>; 469 clocks = <&clock CLK_DP1>;
414 clock-names = "dp"; 470 clock-names = "dp";
415 phys = <&dp_phy>; 471 phys = <&dp_phy>;
416 phy-names = "dp"; 472 phy-names = "dp";
@@ -418,7 +474,7 @@
418 474
419 fimd@14400000 { 475 fimd@14400000 {
420 samsung,power-domain = <&disp_pd>; 476 samsung,power-domain = <&disp_pd>;
421 clocks = <&clock 147>, <&clock 421>; 477 clocks = <&clock CLK_SCLK_FIMD1>, <&clock CLK_FIMD1>;
422 clock-names = "sclk_fimd", "fimd"; 478 clock-names = "sclk_fimd", "fimd";
423 }; 479 };
424 480
@@ -426,7 +482,7 @@
426 compatible = "samsung,exynos-adc-v2"; 482 compatible = "samsung,exynos-adc-v2";
427 reg = <0x12D10000 0x100>, <0x10040720 0x4>; 483 reg = <0x12D10000 0x100>, <0x10040720 0x4>;
428 interrupts = <0 106 0>; 484 interrupts = <0 106 0>;
429 clocks = <&clock 270>; 485 clocks = <&clock CLK_TSADC>;
430 clock-names = "adc"; 486 clock-names = "adc";
431 #io-channel-cells = <1>; 487 #io-channel-cells = <1>;
432 io-channel-ranges; 488 io-channel-ranges;
@@ -439,7 +495,7 @@
439 interrupts = <0 56 0>; 495 interrupts = <0 56 0>;
440 #address-cells = <1>; 496 #address-cells = <1>;
441 #size-cells = <0>; 497 #size-cells = <0>;
442 clocks = <&clock 261>; 498 clocks = <&clock CLK_I2C0>;
443 clock-names = "i2c"; 499 clock-names = "i2c";
444 pinctrl-names = "default"; 500 pinctrl-names = "default";
445 pinctrl-0 = <&i2c0_bus>; 501 pinctrl-0 = <&i2c0_bus>;
@@ -452,7 +508,7 @@
452 interrupts = <0 57 0>; 508 interrupts = <0 57 0>;
453 #address-cells = <1>; 509 #address-cells = <1>;
454 #size-cells = <0>; 510 #size-cells = <0>;
455 clocks = <&clock 262>; 511 clocks = <&clock CLK_I2C1>;
456 clock-names = "i2c"; 512 clock-names = "i2c";
457 pinctrl-names = "default"; 513 pinctrl-names = "default";
458 pinctrl-0 = <&i2c1_bus>; 514 pinctrl-0 = <&i2c1_bus>;
@@ -465,7 +521,7 @@
465 interrupts = <0 58 0>; 521 interrupts = <0 58 0>;
466 #address-cells = <1>; 522 #address-cells = <1>;
467 #size-cells = <0>; 523 #size-cells = <0>;
468 clocks = <&clock 263>; 524 clocks = <&clock CLK_I2C2>;
469 clock-names = "i2c"; 525 clock-names = "i2c";
470 pinctrl-names = "default"; 526 pinctrl-names = "default";
471 pinctrl-0 = <&i2c2_bus>; 527 pinctrl-0 = <&i2c2_bus>;
@@ -478,7 +534,7 @@
478 interrupts = <0 59 0>; 534 interrupts = <0 59 0>;
479 #address-cells = <1>; 535 #address-cells = <1>;
480 #size-cells = <0>; 536 #size-cells = <0>;
481 clocks = <&clock 264>; 537 clocks = <&clock CLK_I2C3>;
482 clock-names = "i2c"; 538 clock-names = "i2c";
483 pinctrl-names = "default"; 539 pinctrl-names = "default";
484 pinctrl-0 = <&i2c3_bus>; 540 pinctrl-0 = <&i2c3_bus>;
@@ -493,7 +549,7 @@
493 #size-cells = <0>; 549 #size-cells = <0>;
494 pinctrl-names = "default"; 550 pinctrl-names = "default";
495 pinctrl-0 = <&i2c4_hs_bus>; 551 pinctrl-0 = <&i2c4_hs_bus>;
496 clocks = <&clock 265>; 552 clocks = <&clock CLK_I2C4>;
497 clock-names = "hsi2c"; 553 clock-names = "hsi2c";
498 status = "disabled"; 554 status = "disabled";
499 }; 555 };
@@ -506,7 +562,7 @@
506 #size-cells = <0>; 562 #size-cells = <0>;
507 pinctrl-names = "default"; 563 pinctrl-names = "default";
508 pinctrl-0 = <&i2c5_hs_bus>; 564 pinctrl-0 = <&i2c5_hs_bus>;
509 clocks = <&clock 266>; 565 clocks = <&clock CLK_I2C5>;
510 clock-names = "hsi2c"; 566 clock-names = "hsi2c";
511 status = "disabled"; 567 status = "disabled";
512 }; 568 };
@@ -519,7 +575,7 @@
519 #size-cells = <0>; 575 #size-cells = <0>;
520 pinctrl-names = "default"; 576 pinctrl-names = "default";
521 pinctrl-0 = <&i2c6_hs_bus>; 577 pinctrl-0 = <&i2c6_hs_bus>;
522 clocks = <&clock 267>; 578 clocks = <&clock CLK_I2C6>;
523 clock-names = "hsi2c"; 579 clock-names = "hsi2c";
524 status = "disabled"; 580 status = "disabled";
525 }; 581 };
@@ -532,7 +588,7 @@
532 #size-cells = <0>; 588 #size-cells = <0>;
533 pinctrl-names = "default"; 589 pinctrl-names = "default";
534 pinctrl-0 = <&i2c7_hs_bus>; 590 pinctrl-0 = <&i2c7_hs_bus>;
535 clocks = <&clock 268>; 591 clocks = <&clock CLK_I2C7>;
536 clock-names = "hsi2c"; 592 clock-names = "hsi2c";
537 status = "disabled"; 593 status = "disabled";
538 }; 594 };
@@ -545,7 +601,7 @@
545 #size-cells = <0>; 601 #size-cells = <0>;
546 pinctrl-names = "default"; 602 pinctrl-names = "default";
547 pinctrl-0 = <&i2c8_hs_bus>; 603 pinctrl-0 = <&i2c8_hs_bus>;
548 clocks = <&clock 281>; 604 clocks = <&clock CLK_I2C8>;
549 clock-names = "hsi2c"; 605 clock-names = "hsi2c";
550 status = "disabled"; 606 status = "disabled";
551 }; 607 };
@@ -558,7 +614,7 @@
558 #size-cells = <0>; 614 #size-cells = <0>;
559 pinctrl-names = "default"; 615 pinctrl-names = "default";
560 pinctrl-0 = <&i2c9_hs_bus>; 616 pinctrl-0 = <&i2c9_hs_bus>;
561 clocks = <&clock 282>; 617 clocks = <&clock CLK_I2C9>;
562 clock-names = "hsi2c"; 618 clock-names = "hsi2c";
563 status = "disabled"; 619 status = "disabled";
564 }; 620 };
@@ -571,7 +627,7 @@
571 #size-cells = <0>; 627 #size-cells = <0>;
572 pinctrl-names = "default"; 628 pinctrl-names = "default";
573 pinctrl-0 = <&i2c10_hs_bus>; 629 pinctrl-0 = <&i2c10_hs_bus>;
574 clocks = <&clock 283>; 630 clocks = <&clock CLK_I2C10>;
575 clock-names = "hsi2c"; 631 clock-names = "hsi2c";
576 status = "disabled"; 632 status = "disabled";
577 }; 633 };
@@ -580,8 +636,9 @@
580 compatible = "samsung,exynos4212-hdmi"; 636 compatible = "samsung,exynos4212-hdmi";
581 reg = <0x14530000 0x70000>; 637 reg = <0x14530000 0x70000>;
582 interrupts = <0 95 0>; 638 interrupts = <0 95 0>;
583 clocks = <&clock 413>, <&clock 143>, <&clock 768>, 639 clocks = <&clock CLK_HDMI>, <&clock CLK_SCLK_HDMI>,
584 <&clock 158>, <&clock 640>; 640 <&clock CLK_DOUT_PIXEL>, <&clock CLK_SCLK_HDMIPHY>,
641 <&clock CLK_MOUT_HDMI>;
585 clock-names = "hdmi", "sclk_hdmi", "sclk_pixel", 642 clock-names = "hdmi", "sclk_hdmi", "sclk_pixel",
586 "sclk_hdmiphy", "mout_hdmi"; 643 "sclk_hdmiphy", "mout_hdmi";
587 status = "disabled"; 644 status = "disabled";
@@ -591,7 +648,7 @@
591 compatible = "samsung,exynos5420-mixer"; 648 compatible = "samsung,exynos5420-mixer";
592 reg = <0x14450000 0x10000>; 649 reg = <0x14450000 0x10000>;
593 interrupts = <0 94 0>; 650 interrupts = <0 94 0>;
594 clocks = <&clock 431>, <&clock 143>; 651 clocks = <&clock CLK_MIXER>, <&clock CLK_SCLK_HDMI>;
595 clock-names = "mixer", "sclk_hdmi"; 652 clock-names = "mixer", "sclk_hdmi";
596 }; 653 };
597 654
@@ -599,7 +656,7 @@
599 compatible = "samsung,exynos5-gsc"; 656 compatible = "samsung,exynos5-gsc";
600 reg = <0x13e00000 0x1000>; 657 reg = <0x13e00000 0x1000>;
601 interrupts = <0 85 0>; 658 interrupts = <0 85 0>;
602 clocks = <&clock 465>; 659 clocks = <&clock CLK_GSCL0>;
603 clock-names = "gscl"; 660 clock-names = "gscl";
604 samsung,power-domain = <&gsc_pd>; 661 samsung,power-domain = <&gsc_pd>;
605 }; 662 };
@@ -608,16 +665,21 @@
608 compatible = "samsung,exynos5-gsc"; 665 compatible = "samsung,exynos5-gsc";
609 reg = <0x13e10000 0x1000>; 666 reg = <0x13e10000 0x1000>;
610 interrupts = <0 86 0>; 667 interrupts = <0 86 0>;
611 clocks = <&clock 466>; 668 clocks = <&clock CLK_GSCL1>;
612 clock-names = "gscl"; 669 clock-names = "gscl";
613 samsung,power-domain = <&gsc_pd>; 670 samsung,power-domain = <&gsc_pd>;
614 }; 671 };
615 672
673 pmu_system_controller: system-controller@10040000 {
674 compatible = "samsung,exynos5420-pmu", "syscon";
675 reg = <0x10040000 0x5000>;
676 };
677
616 tmu_cpu0: tmu@10060000 { 678 tmu_cpu0: tmu@10060000 {
617 compatible = "samsung,exynos5420-tmu"; 679 compatible = "samsung,exynos5420-tmu";
618 reg = <0x10060000 0x100>; 680 reg = <0x10060000 0x100>;
619 interrupts = <0 65 0>; 681 interrupts = <0 65 0>;
620 clocks = <&clock 318>; 682 clocks = <&clock CLK_TMU>;
621 clock-names = "tmu_apbif"; 683 clock-names = "tmu_apbif";
622 }; 684 };
623 685
@@ -625,7 +687,7 @@
625 compatible = "samsung,exynos5420-tmu"; 687 compatible = "samsung,exynos5420-tmu";
626 reg = <0x10064000 0x100>; 688 reg = <0x10064000 0x100>;
627 interrupts = <0 183 0>; 689 interrupts = <0 183 0>;
628 clocks = <&clock 318>; 690 clocks = <&clock CLK_TMU>;
629 clock-names = "tmu_apbif"; 691 clock-names = "tmu_apbif";
630 }; 692 };
631 693
@@ -633,7 +695,7 @@
633 compatible = "samsung,exynos5420-tmu-ext-triminfo"; 695 compatible = "samsung,exynos5420-tmu-ext-triminfo";
634 reg = <0x10068000 0x100>, <0x1006c000 0x4>; 696 reg = <0x10068000 0x100>, <0x1006c000 0x4>;
635 interrupts = <0 184 0>; 697 interrupts = <0 184 0>;
636 clocks = <&clock 318>, <&clock 318>; 698 clocks = <&clock CLK_TMU>, <&clock CLK_TMU>;
637 clock-names = "tmu_apbif", "tmu_triminfo_apbif"; 699 clock-names = "tmu_apbif", "tmu_triminfo_apbif";
638 }; 700 };
639 701
@@ -641,7 +703,7 @@
641 compatible = "samsung,exynos5420-tmu-ext-triminfo"; 703 compatible = "samsung,exynos5420-tmu-ext-triminfo";
642 reg = <0x1006c000 0x100>, <0x100a0000 0x4>; 704 reg = <0x1006c000 0x100>, <0x100a0000 0x4>;
643 interrupts = <0 185 0>; 705 interrupts = <0 185 0>;
644 clocks = <&clock 318>, <&clock 319>; 706 clocks = <&clock CLK_TMU>, <&clock CLK_TMU_GPU>;
645 clock-names = "tmu_apbif", "tmu_triminfo_apbif"; 707 clock-names = "tmu_apbif", "tmu_triminfo_apbif";
646 }; 708 };
647 709
@@ -649,7 +711,25 @@
649 compatible = "samsung,exynos5420-tmu-ext-triminfo"; 711 compatible = "samsung,exynos5420-tmu-ext-triminfo";
650 reg = <0x100a0000 0x100>, <0x10068000 0x4>; 712 reg = <0x100a0000 0x100>, <0x10068000 0x4>;
651 interrupts = <0 215 0>; 713 interrupts = <0 215 0>;
652 clocks = <&clock 319>, <&clock 318>; 714 clocks = <&clock CLK_TMU_GPU>, <&clock CLK_TMU>;
653 clock-names = "tmu_apbif", "tmu_triminfo_apbif"; 715 clock-names = "tmu_apbif", "tmu_triminfo_apbif";
654 }; 716 };
717
718 watchdog@101D0000 {
719 compatible = "samsung,exynos5420-wdt";
720 reg = <0x101D0000 0x100>;
721 interrupts = <0 42 0>;
722 clocks = <&clock CLK_WDT>;
723 clock-names = "watchdog";
724 samsung,syscon-phandle = <&pmu_system_controller>;
725 };
726
727 sss@10830000 {
728 compatible = "samsung,exynos4210-secss";
729 reg = <0x10830000 0x10000>;
730 interrupts = <0 112 0>;
731 clocks = <&clock 471>;
732 clock-names = "secss";
733 samsung,power-domain = <&g2d_pd>;
734 };
655}; 735};
diff --git a/arch/arm/boot/dts/exynos5440-sd5v1.dts b/arch/arm/boot/dts/exynos5440-sd5v1.dts
index 777fb1c2c70f..268609a42b2c 100644
--- a/arch/arm/boot/dts/exynos5440-sd5v1.dts
+++ b/arch/arm/boot/dts/exynos5440-sd5v1.dts
@@ -14,7 +14,7 @@
14 14
15/ { 15/ {
16 model = "SAMSUNG SD5v1 board based on EXYNOS5440"; 16 model = "SAMSUNG SD5v1 board based on EXYNOS5440";
17 compatible = "samsung,sd5v1", "samsung,exynos5440"; 17 compatible = "samsung,sd5v1", "samsung,exynos5440", "samsung,exynos5";
18 18
19 chosen { 19 chosen {
20 bootargs = "root=/dev/sda2 rw rootwait ignore_loglevel earlyprintk no_console_suspend mem=2048M@0x80000000 mem=6144M@0x100000000 console=ttySAC0,115200"; 20 bootargs = "root=/dev/sda2 rw rootwait ignore_loglevel earlyprintk no_console_suspend mem=2048M@0x80000000 mem=6144M@0x100000000 console=ttySAC0,115200";
diff --git a/arch/arm/boot/dts/exynos5440-ssdk5440.dts b/arch/arm/boot/dts/exynos5440-ssdk5440.dts
index d58cb787061a..ff55dac6e219 100644
--- a/arch/arm/boot/dts/exynos5440-ssdk5440.dts
+++ b/arch/arm/boot/dts/exynos5440-ssdk5440.dts
@@ -14,7 +14,7 @@
14 14
15/ { 15/ {
16 model = "SAMSUNG SSDK5440 board based on EXYNOS5440"; 16 model = "SAMSUNG SSDK5440 board based on EXYNOS5440";
17 compatible = "samsung,ssdk5440", "samsung,exynos5440"; 17 compatible = "samsung,ssdk5440", "samsung,exynos5440", "samsung,exynos5";
18 18
19 chosen { 19 chosen {
20 bootargs = "root=/dev/sda2 rw rootwait ignore_loglevel earlyprintk no_console_suspend mem=2048M@0x80000000 mem=6144M@0x100000000 console=ttySAC0,115200"; 20 bootargs = "root=/dev/sda2 rw rootwait ignore_loglevel earlyprintk no_console_suspend mem=2048M@0x80000000 mem=6144M@0x100000000 console=ttySAC0,115200";
diff --git a/arch/arm/boot/dts/exynos5440.dtsi b/arch/arm/boot/dts/exynos5440.dtsi
index 02a0a1226cef..84f77c2fe4d4 100644
--- a/arch/arm/boot/dts/exynos5440.dtsi
+++ b/arch/arm/boot/dts/exynos5440.dtsi
@@ -9,10 +9,11 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10*/ 10*/
11 11
12#include <dt-bindings/clock/exynos5440.h>
12#include "skeleton.dtsi" 13#include "skeleton.dtsi"
13 14
14/ { 15/ {
15 compatible = "samsung,exynos5440"; 16 compatible = "samsung,exynos5440", "samsung,exynos5";
16 17
17 interrupt-parent = <&gic>; 18 interrupt-parent = <&gic>;
18 19
@@ -105,7 +106,7 @@
105 compatible = "samsung,exynos4210-uart"; 106 compatible = "samsung,exynos4210-uart";
106 reg = <0xB0000 0x1000>; 107 reg = <0xB0000 0x1000>;
107 interrupts = <0 2 0>; 108 interrupts = <0 2 0>;
108 clocks = <&clock 21>, <&clock 21>; 109 clocks = <&clock CLK_B_125>, <&clock CLK_B_125>;
109 clock-names = "uart", "clk_uart_baud0"; 110 clock-names = "uart", "clk_uart_baud0";
110 }; 111 };
111 112
@@ -113,7 +114,7 @@
113 compatible = "samsung,exynos4210-uart"; 114 compatible = "samsung,exynos4210-uart";
114 reg = <0xC0000 0x1000>; 115 reg = <0xC0000 0x1000>;
115 interrupts = <0 3 0>; 116 interrupts = <0 3 0>;
116 clocks = <&clock 21>, <&clock 21>; 117 clocks = <&clock CLK_B_125>, <&clock CLK_B_125>;
117 clock-names = "uart", "clk_uart_baud0"; 118 clock-names = "uart", "clk_uart_baud0";
118 }; 119 };
119 120
@@ -125,7 +126,7 @@
125 #size-cells = <0>; 126 #size-cells = <0>;
126 samsung,spi-src-clk = <0>; 127 samsung,spi-src-clk = <0>;
127 num-cs = <1>; 128 num-cs = <1>;
128 clocks = <&clock 21>, <&clock 16>; 129 clocks = <&clock CLK_B_125>, <&clock CLK_SPI_BAUD>;
129 clock-names = "spi", "spi_busclk0"; 130 clock-names = "spi", "spi_busclk0";
130 }; 131 };
131 132
@@ -161,7 +162,7 @@
161 interrupts = <0 5 0>; 162 interrupts = <0 5 0>;
162 #address-cells = <1>; 163 #address-cells = <1>;
163 #size-cells = <0>; 164 #size-cells = <0>;
164 clocks = <&clock 21>; 165 clocks = <&clock CLK_B_125>;
165 clock-names = "i2c"; 166 clock-names = "i2c";
166 }; 167 };
167 168
@@ -171,7 +172,7 @@
171 interrupts = <0 6 0>; 172 interrupts = <0 6 0>;
172 #address-cells = <1>; 173 #address-cells = <1>;
173 #size-cells = <0>; 174 #size-cells = <0>;
174 clocks = <&clock 21>; 175 clocks = <&clock CLK_B_125>;
175 clock-names = "i2c"; 176 clock-names = "i2c";
176 }; 177 };
177 178
@@ -179,7 +180,7 @@
179 compatible = "samsung,s3c2410-wdt"; 180 compatible = "samsung,s3c2410-wdt";
180 reg = <0x110000 0x1000>; 181 reg = <0x110000 0x1000>;
181 interrupts = <0 1 0>; 182 interrupts = <0 1 0>;
182 clocks = <&clock 21>; 183 clocks = <&clock CLK_B_125>;
183 clock-names = "watchdog"; 184 clock-names = "watchdog";
184 }; 185 };
185 186
@@ -190,7 +191,7 @@
190 interrupts = <0 31 4>; 191 interrupts = <0 31 4>;
191 interrupt-names = "macirq"; 192 interrupt-names = "macirq";
192 phy-mode = "sgmii"; 193 phy-mode = "sgmii";
193 clocks = <&clock 25>; 194 clocks = <&clock CLK_GMAC0>;
194 clock-names = "stmmaceth"; 195 clock-names = "stmmaceth";
195 }; 196 };
196 197
@@ -206,7 +207,7 @@
206 compatible = "samsung,s3c6410-rtc"; 207 compatible = "samsung,s3c6410-rtc";
207 reg = <0x130000 0x1000>; 208 reg = <0x130000 0x1000>;
208 interrupts = <0 17 0>, <0 16 0>; 209 interrupts = <0 17 0>, <0 16 0>;
209 clocks = <&clock 21>; 210 clocks = <&clock CLK_B_125>;
210 clock-names = "rtc"; 211 clock-names = "rtc";
211 }; 212 };
212 213
@@ -214,7 +215,7 @@
214 compatible = "samsung,exynos5440-tmu"; 215 compatible = "samsung,exynos5440-tmu";
215 reg = <0x160118 0x230>, <0x160368 0x10>; 216 reg = <0x160118 0x230>, <0x160368 0x10>;
216 interrupts = <0 58 0>; 217 interrupts = <0 58 0>;
217 clocks = <&clock 21>; 218 clocks = <&clock CLK_B_125>;
218 clock-names = "tmu_apbif"; 219 clock-names = "tmu_apbif";
219 }; 220 };
220 221
@@ -222,7 +223,7 @@
222 compatible = "samsung,exynos5440-tmu"; 223 compatible = "samsung,exynos5440-tmu";
223 reg = <0x16011C 0x230>, <0x160368 0x10>; 224 reg = <0x16011C 0x230>, <0x160368 0x10>;
224 interrupts = <0 58 0>; 225 interrupts = <0 58 0>;
225 clocks = <&clock 21>; 226 clocks = <&clock CLK_B_125>;
226 clock-names = "tmu_apbif"; 227 clock-names = "tmu_apbif";
227 }; 228 };
228 229
@@ -230,7 +231,7 @@
230 compatible = "samsung,exynos5440-tmu"; 231 compatible = "samsung,exynos5440-tmu";
231 reg = <0x160120 0x230>, <0x160368 0x10>; 232 reg = <0x160120 0x230>, <0x160368 0x10>;
232 interrupts = <0 58 0>; 233 interrupts = <0 58 0>;
233 clocks = <&clock 21>; 234 clocks = <&clock CLK_B_125>;
234 clock-names = "tmu_apbif"; 235 clock-names = "tmu_apbif";
235 }; 236 };
236 237
@@ -238,7 +239,7 @@
238 compatible = "snps,exynos5440-ahci"; 239 compatible = "snps,exynos5440-ahci";
239 reg = <0x210000 0x10000>; 240 reg = <0x210000 0x10000>;
240 interrupts = <0 30 0>; 241 interrupts = <0 30 0>;
241 clocks = <&clock 23>; 242 clocks = <&clock CLK_SATA>;
242 clock-names = "sata"; 243 clock-names = "sata";
243 }; 244 };
244 245
@@ -246,7 +247,7 @@
246 compatible = "samsung,exynos5440-ohci"; 247 compatible = "samsung,exynos5440-ohci";
247 reg = <0x220000 0x1000>; 248 reg = <0x220000 0x1000>;
248 interrupts = <0 29 0>; 249 interrupts = <0 29 0>;
249 clocks = <&clock 24>; 250 clocks = <&clock CLK_USB>;
250 clock-names = "usbhost"; 251 clock-names = "usbhost";
251 }; 252 };
252 253
@@ -254,7 +255,7 @@
254 compatible = "samsung,exynos5440-ehci"; 255 compatible = "samsung,exynos5440-ehci";
255 reg = <0x221000 0x1000>; 256 reg = <0x221000 0x1000>;
256 interrupts = <0 29 0>; 257 interrupts = <0 29 0>;
257 clocks = <&clock 24>; 258 clocks = <&clock CLK_USB>;
258 clock-names = "usbhost"; 259 clock-names = "usbhost";
259 }; 260 };
260 261
@@ -264,7 +265,7 @@
264 0x270000 0x1000 265 0x270000 0x1000
265 0x271000 0x40>; 266 0x271000 0x40>;
266 interrupts = <0 20 0>, <0 21 0>, <0 22 0>; 267 interrupts = <0 20 0>, <0 21 0>, <0 22 0>;
267 clocks = <&clock 28>, <&clock 27>; 268 clocks = <&clock CLK_PR0_250_O>, <&clock CLK_PB0_250_O>;
268 clock-names = "pcie", "pcie_bus"; 269 clock-names = "pcie", "pcie_bus";
269 #address-cells = <3>; 270 #address-cells = <3>;
270 #size-cells = <2>; 271 #size-cells = <2>;
@@ -285,7 +286,7 @@
285 0x272000 0x1000 286 0x272000 0x1000
286 0x271040 0x40>; 287 0x271040 0x40>;
287 interrupts = <0 23 0>, <0 24 0>, <0 25 0>; 288 interrupts = <0 23 0>, <0 24 0>, <0 25 0>;
288 clocks = <&clock 29>, <&clock 27>; 289 clocks = <&clock CLK_PR1_250_O>, <&clock CLK_PB0_250_O>;
289 clock-names = "pcie", "pcie_bus"; 290 clock-names = "pcie", "pcie_bus";
290 #address-cells = <3>; 291 #address-cells = <3>;
291 #size-cells = <2>; 292 #size-cells = <2>;
diff --git a/arch/arm/boot/dts/imx23-evk.dts b/arch/arm/boot/dts/imx23-evk.dts
index 1f026adefd45..a33f66c11b73 100644
--- a/arch/arm/boot/dts/imx23-evk.dts
+++ b/arch/arm/boot/dts/imx23-evk.dts
@@ -127,17 +127,21 @@
127 127
128 regulators { 128 regulators {
129 compatible = "simple-bus"; 129 compatible = "simple-bus";
130 #address-cells = <1>;
131 #size-cells = <0>;
130 132
131 reg_vddio_sd0: vddio-sd0 { 133 reg_vddio_sd0: regulator@0 {
132 compatible = "regulator-fixed"; 134 compatible = "regulator-fixed";
135 reg = <0>;
133 regulator-name = "vddio-sd0"; 136 regulator-name = "vddio-sd0";
134 regulator-min-microvolt = <3300000>; 137 regulator-min-microvolt = <3300000>;
135 regulator-max-microvolt = <3300000>; 138 regulator-max-microvolt = <3300000>;
136 gpio = <&gpio1 29 0>; 139 gpio = <&gpio1 29 0>;
137 }; 140 };
138 141
139 reg_lcd_3v3: lcd-3v3 { 142 reg_lcd_3v3: regulator@1 {
140 compatible = "regulator-fixed"; 143 compatible = "regulator-fixed";
144 reg = <1>;
141 regulator-name = "lcd-3v3"; 145 regulator-name = "lcd-3v3";
142 regulator-min-microvolt = <3300000>; 146 regulator-min-microvolt = <3300000>;
143 regulator-max-microvolt = <3300000>; 147 regulator-max-microvolt = <3300000>;
diff --git a/arch/arm/boot/dts/imx23-olinuxino.dts b/arch/arm/boot/dts/imx23-olinuxino.dts
index 526bfdbd87f9..7e6eef2488e8 100644
--- a/arch/arm/boot/dts/imx23-olinuxino.dts
+++ b/arch/arm/boot/dts/imx23-olinuxino.dts
@@ -100,9 +100,12 @@
100 100
101 regulators { 101 regulators {
102 compatible = "simple-bus"; 102 compatible = "simple-bus";
103 #address-cells = <1>;
104 #size-cells = <0>;
103 105
104 reg_usb0_vbus: usb0_vbus { 106 reg_usb0_vbus: regulator@0 {
105 compatible = "regulator-fixed"; 107 compatible = "regulator-fixed";
108 reg = <0>;
106 regulator-name = "usb0_vbus"; 109 regulator-name = "usb0_vbus";
107 regulator-min-microvolt = <5000000>; 110 regulator-min-microvolt = <5000000>;
108 regulator-max-microvolt = <5000000>; 111 regulator-max-microvolt = <5000000>;
diff --git a/arch/arm/boot/dts/imx23-stmp378x_devb.dts b/arch/arm/boot/dts/imx23-stmp378x_devb.dts
index cb64e2b191ea..455169e99d49 100644
--- a/arch/arm/boot/dts/imx23-stmp378x_devb.dts
+++ b/arch/arm/boot/dts/imx23-stmp378x_devb.dts
@@ -66,9 +66,12 @@
66 66
67 regulators { 67 regulators {
68 compatible = "simple-bus"; 68 compatible = "simple-bus";
69 #address-cells = <1>;
70 #size-cells = <0>;
69 71
70 reg_vddio_sd0: vddio-sd0 { 72 reg_vddio_sd0: regulator@0 {
71 compatible = "regulator-fixed"; 73 compatible = "regulator-fixed";
74 reg = <0>;
72 regulator-name = "vddio-sd0"; 75 regulator-name = "vddio-sd0";
73 regulator-min-microvolt = <3300000>; 76 regulator-min-microvolt = <3300000>;
74 regulator-max-microvolt = <3300000>; 77 regulator-max-microvolt = <3300000>;
diff --git a/arch/arm/boot/dts/imx23.dtsi b/arch/arm/boot/dts/imx23.dtsi
index 581b75433be6..bbcfb5a19c77 100644
--- a/arch/arm/boot/dts/imx23.dtsi
+++ b/arch/arm/boot/dts/imx23.dtsi
@@ -23,6 +23,7 @@
23 serial1 = &auart1; 23 serial1 = &auart1;
24 spi0 = &ssp0; 24 spi0 = &ssp0;
25 spi1 = &ssp1; 25 spi1 = &ssp1;
26 usbphy0 = &usbphy0;
26 }; 27 };
27 28
28 cpus { 29 cpus {
@@ -428,7 +429,7 @@
428 status = "disabled"; 429 status = "disabled";
429 }; 430 };
430 431
431 lradc@80050000 { 432 lradc: lradc@80050000 {
432 compatible = "fsl,imx23-lradc"; 433 compatible = "fsl,imx23-lradc";
433 reg = <0x80050000 0x2000>; 434 reg = <0x80050000 0x2000>;
434 interrupts = <36 37 38 39 40 41 42 43 44>; 435 interrupts = <36 37 38 39 40 41 42 43 44>;
@@ -526,4 +527,9 @@
526 status = "disabled"; 527 status = "disabled";
527 }; 528 };
528 }; 529 };
530
531 iio_hwmon {
532 compatible = "iio-hwmon";
533 io-channels = <&lradc 8>;
534 };
529}; 535};
diff --git a/arch/arm/boot/dts/imx25-eukrea-cpuimx25.dtsi b/arch/arm/boot/dts/imx25-eukrea-cpuimx25.dtsi
new file mode 100644
index 000000000000..d6f27641c0ef
--- /dev/null
+++ b/arch/arm/boot/dts/imx25-eukrea-cpuimx25.dtsi
@@ -0,0 +1,73 @@
1/*
2 * Copyright 2013 Eukréa Electromatique <denis@eukrea.com>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
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
14#include "imx25.dtsi"
15
16/ {
17 model = "Eukrea CPUIMX25";
18 compatible = "eukrea,cpuimx25", "fsl,imx25";
19
20 memory {
21 reg = <0x80000000 0x4000000>; /* 64M */
22 };
23};
24
25&fec {
26 phy-mode = "rmii";
27 pinctrl-names = "default";
28 pinctrl-0 = <&pinctrl_fec>;
29 status = "okay";
30};
31
32&i2c1 {
33 pinctrl-names = "default";
34 pinctrl-0 = <&pinctrl_i2c1>;
35 status = "okay";
36
37 pcf8563@51 {
38 compatible = "nxp,pcf8563";
39 reg = <0x51>;
40 };
41};
42
43&iomuxc {
44 imx25-eukrea-cpuimx25 {
45 pinctrl_fec: fecgrp {
46 fsl,pins = <
47 MX25_PAD_FEC_MDC__FEC_MDC 0x80000000
48 MX25_PAD_FEC_MDIO__FEC_MDIO 0x400001e0
49 MX25_PAD_FEC_TDATA0__FEC_TDATA0 0x80000000
50 MX25_PAD_FEC_TDATA1__FEC_TDATA1 0x80000000
51 MX25_PAD_FEC_TX_EN__FEC_TX_EN 0x80000000
52 MX25_PAD_FEC_RDATA0__FEC_RDATA0 0x80000000
53 MX25_PAD_FEC_RDATA1__FEC_RDATA1 0x80000000
54 MX25_PAD_FEC_RX_DV__FEC_RX_DV 0x80000000
55 MX25_PAD_FEC_TX_CLK__FEC_TX_CLK 0x1c0
56 >;
57 };
58
59 pinctrl_i2c1: i2c1grp {
60 fsl,pins = <
61 MX25_PAD_I2C1_CLK__I2C1_CLK 0x80000000
62 MX25_PAD_I2C1_DAT__I2C1_DAT 0x80000000
63 >;
64 };
65 };
66};
67
68&nfc {
69 nand-bus-width = <8>;
70 nand-ecc-mode = "hw";
71 nand-on-flash-bbt;
72 status = "okay";
73};
diff --git a/arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard.dts b/arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard.dts
new file mode 100644
index 000000000000..62fb3da50bdb
--- /dev/null
+++ b/arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard.dts
@@ -0,0 +1,174 @@
1/*
2 * Copyright 2013 Eukréa Electromatique <denis@eukrea.com>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
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
14/dts-v1/;
15
16#include <dt-bindings/gpio/gpio.h>
17#include <dt-bindings/input/input.h>
18#include "imx25-eukrea-cpuimx25.dtsi"
19
20/ {
21 model = "Eukrea MBIMXSD25";
22 compatible = "eukrea,mbimxsd25-baseboard", "eukrea,cpuimx25", "fsl,imx25";
23
24 gpio_keys {
25 compatible = "gpio-keys";
26 pinctrl-names = "default";
27 pinctrl-0 = <&pinctrl_gpiokeys>;
28
29 bp1 {
30 label = "BP1";
31 gpios = <&gpio3 18 GPIO_ACTIVE_LOW>;
32 linux,code = <BTN_MISC>;
33 gpio-key,wakeup;
34 };
35 };
36
37 leds {
38 compatible = "gpio-leds";
39 pinctrl-names = "default";
40 pinctrl-0 = <&pinctrl_gpioled>;
41
42 led1 {
43 label = "led1";
44 gpios = <&gpio3 19 GPIO_ACTIVE_LOW>;
45 linux,default-trigger = "heartbeat";
46 };
47 };
48
49 sound {
50 compatible = "eukrea,asoc-tlv320";
51 eukrea,model = "imx25-eukrea-tlv320aic23";
52 ssi-controller = <&ssi1>;
53 fsl,mux-int-port = <1>;
54 fsl,mux-ext-port = <5>;
55 };
56};
57
58&audmux {
59 pinctrl-names = "default";
60 pinctrl-0 = <&pinctrl_audmux>;
61 status = "okay";
62};
63
64&esdhc1 {
65 pinctrl-names = "default";
66 pinctrl-0 = <&pinctrl_esdhc1>;
67 cd-gpios = <&gpio1 20>;
68 status = "okay";
69};
70
71&i2c1 {
72 tlv320aic23: codec@1a {
73 compatible = "ti,tlv320aic23";
74 reg = <0x1a>;
75 };
76};
77
78&iomuxc {
79 imx25-eukrea-mbimxsd25-baseboard {
80 pinctrl_audmux: audmuxgrp {
81 fsl,pins = <
82 MX25_PAD_KPP_COL3__AUD5_TXFS 0xe0
83 MX25_PAD_KPP_COL2__AUD5_TXC 0xe0
84 MX25_PAD_KPP_COL1__AUD5_RXD 0xe0
85 MX25_PAD_KPP_COL0__AUD5_TXD 0xe0
86 >;
87 };
88
89 pinctrl_esdhc1: esdhc1grp {
90 fsl,pins = <
91 MX25_PAD_SD1_CMD__SD1_CMD 0x400000c0
92 MX25_PAD_SD1_CLK__SD1_CLK 0x400000c0
93 MX25_PAD_SD1_DATA0__SD1_DATA0 0x400000c0
94 MX25_PAD_SD1_DATA1__SD1_DATA1 0x400000c0
95 MX25_PAD_SD1_DATA2__SD1_DATA2 0x400000c0
96 MX25_PAD_SD1_DATA3__SD1_DATA3 0x400000c0
97 >;
98 };
99
100 pinctrl_gpiokeys: gpiokeysgrp {
101 fsl,pins = <MX25_PAD_VSTBY_ACK__GPIO_3_18 0x80000000>;
102 };
103
104 pinctrl_gpioled: gpioledgrp {
105 fsl,pins = <MX25_PAD_POWER_FAIL__GPIO_3_19 0x80000000>;
106 };
107
108 pinctrl_lcdc: lcdcgrp {
109 fsl,pins = <
110 MX25_PAD_LD0__LD0 0x1
111 MX25_PAD_LD1__LD1 0x1
112 MX25_PAD_LD2__LD2 0x1
113 MX25_PAD_LD3__LD3 0x1
114 MX25_PAD_LD4__LD4 0x1
115 MX25_PAD_LD5__LD5 0x1
116 MX25_PAD_LD6__LD6 0x1
117 MX25_PAD_LD7__LD7 0x1
118 MX25_PAD_LD8__LD8 0x1
119 MX25_PAD_LD9__LD9 0x1
120 MX25_PAD_LD10__LD10 0x1
121 MX25_PAD_LD11__LD11 0x1
122 MX25_PAD_LD12__LD12 0x1
123 MX25_PAD_LD13__LD13 0x1
124 MX25_PAD_LD14__LD14 0x1
125 MX25_PAD_LD15__LD15 0x1
126 MX25_PAD_GPIO_E__LD16 0x1
127 MX25_PAD_GPIO_F__LD17 0x1
128 MX25_PAD_HSYNC__HSYNC 0x80000000
129 MX25_PAD_VSYNC__VSYNC 0x80000000
130 MX25_PAD_LSCLK__LSCLK 0x80000000
131 MX25_PAD_OE_ACD__OE_ACD 0x80000000
132 MX25_PAD_CONTRAST__CONTRAST 0x80000000
133 >;
134 };
135
136 pinctrl_uart1: uart1grp {
137 fsl,pins = <
138 MX25_PAD_UART1_RTS__UART1_RTS 0xe0
139 MX25_PAD_UART1_CTS__UART1_CTS 0xe0
140 MX25_PAD_UART1_TXD__UART1_TXD 0x80000000
141 MX25_PAD_UART1_RXD__UART1_RXD 0xc0
142 >;
143 };
144
145 pinctrl_uart2: uart2grp {
146 fsl,pins = <
147 MX25_PAD_UART2_RXD__UART2_RXD 0x80000000
148 MX25_PAD_UART2_TXD__UART2_TXD 0x80000000
149 MX25_PAD_UART2_RTS__UART2_RTS 0x80000000
150 MX25_PAD_UART2_CTS__UART2_CTS 0x80000000
151 >;
152 };
153 };
154};
155
156&ssi1 {
157 codec-handle = <&tlv320aic23>;
158 fsl,mode = "i2s-slave";
159 status = "okay";
160};
161
162&uart1 {
163 pinctrl-names = "default";
164 pinctrl-0 = <&pinctrl_uart1>;
165 fsl,uart-has-rtscts;
166 status = "okay";
167};
168
169&uart2 {
170 pinctrl-names = "default";
171 pinctrl-0 = <&pinctrl_uart2>;
172 fsl,uart-has-rtscts;
173 status = "okay";
174};
diff --git a/arch/arm/boot/dts/imx25-pinfunc.h b/arch/arm/boot/dts/imx25-pinfunc.h
new file mode 100644
index 000000000000..9238a95d8e62
--- /dev/null
+++ b/arch/arm/boot/dts/imx25-pinfunc.h
@@ -0,0 +1,494 @@
1/*
2 * Copyright 2013 Eukréa Electromatique <denis@eukrea.com>
3 * Based on imx35-pinfunc.h in the same directory Which is:
4 * Copyright 2013 Freescale Semiconductor, Inc.
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
12#ifndef __DTS_IMX25_PINFUNC_H
13#define __DTS_IMX25_PINFUNC_H
14
15/*
16 * The pin function ID is a tuple of
17 * <mux_reg conf_reg input_reg mux_mode input_val>
18 */
19
20#define MX25_PAD_A10__A10 0x008 0x000 0x000 0x00 0x000
21#define MX25_PAD_A10__GPIO_4_0 0x008 0x000 0x000 0x05 0x000
22
23#define MX25_PAD_A13__A13 0x00c 0x22C 0x000 0x00 0x000
24#define MX25_PAD_A13__GPIO_4_1 0x00c 0x22C 0x000 0x05 0x000
25
26#define MX25_PAD_A14__A14 0x010 0x230 0x000 0x10 0x000
27#define MX25_PAD_A14__GPIO_2_0 0x010 0x230 0x000 0x15 0x000
28
29#define MX25_PAD_A15__A15 0x014 0x234 0x000 0x10 0x000
30#define MX25_PAD_A15__GPIO_2_1 0x014 0x234 0x000 0x15 0x000
31
32#define MX25_PAD_A16__A16 0x018 0x000 0x000 0x10 0x000
33#define MX25_PAD_A16__GPIO_2_2 0x018 0x000 0x000 0x15 0x000
34
35#define MX25_PAD_A17__A17 0x01c 0x238 0x000 0x10 0x000
36#define MX25_PAD_A17__GPIO_2_3 0x01c 0x238 0x000 0x15 0x000
37
38#define MX25_PAD_A18__A18 0x020 0x23c 0x000 0x10 0x000
39#define MX25_PAD_A18__GPIO_2_4 0x020 0x23c 0x000 0x15 0x000
40#define MX25_PAD_A18__FEC_COL 0x020 0x23c 0x504 0x17 0x000
41
42#define MX25_PAD_A19__A19 0x024 0x240 0x000 0x10 0x000
43#define MX25_PAD_A19__FEC_RX_ER 0x024 0x240 0x518 0x17 0x000
44#define MX25_PAD_A19__GPIO_2_5 0x024 0x240 0x000 0x15 0x000
45
46#define MX25_PAD_A20__A20 0x028 0x244 0x000 0x10 0x000
47#define MX25_PAD_A20__GPIO_2_6 0x028 0x244 0x000 0x15 0x000
48#define MX25_PAD_A20__FEC_RDATA2 0x028 0x244 0x50c 0x17 0x000
49
50#define MX25_PAD_A21__A21 0x02c 0x248 0x000 0x10 0x000
51#define MX25_PAD_A21__GPIO_2_7 0x02c 0x248 0x000 0x15 0x000
52#define MX25_PAD_A21__FEC_RDATA3 0x02c 0x248 0x510 0x17 0x000
53
54#define MX25_PAD_A22__A22 0x030 0x000 0x000 0x10 0x000
55#define MX25_PAD_A22__GPIO_2_8 0x030 0x000 0x000 0x15 0x000
56
57#define MX25_PAD_A23__A23 0x034 0x24c 0x000 0x10 0x000
58#define MX25_PAD_A23__GPIO_2_9 0x034 0x24c 0x000 0x15 0x000
59
60#define MX25_PAD_A24__A24 0x038 0x250 0x000 0x10 0x000
61#define MX25_PAD_A24__GPIO_2_10 0x038 0x250 0x000 0x15 0x000
62#define MX25_PAD_A24__FEC_RX_CLK 0x038 0x250 0x514 0x17 0x000
63
64#define MX25_PAD_A25__A25 0x03c 0x254 0x000 0x10 0x000
65#define MX25_PAD_A25__GPIO_2_11 0x03c 0x254 0x000 0x15 0x000
66#define MX25_PAD_A25__FEC_CRS 0x03c 0x254 0x508 0x17 0x000
67
68#define MX25_PAD_EB0__EB0 0x040 0x258 0x000 0x10 0x000
69#define MX25_PAD_EB0__AUD4_TXD 0x040 0x258 0x464 0x14 0x000
70#define MX25_PAD_EB0__GPIO_2_12 0x040 0x258 0x000 0x15 0x000
71
72#define MX25_PAD_EB1__EB1 0x044 0x25c 0x000 0x10 0x000
73#define MX25_PAD_EB1__AUD4_RXD 0x044 0x25c 0x460 0x14 0x000
74#define MX25_PAD_EB1__GPIO_2_13 0x044 0x25c 0x000 0x15 0x000
75
76#define MX25_PAD_OE__OE 0x048 0x260 0x000 0x10 0x000
77#define MX25_PAD_OE__AUD4_TXC 0x048 0x260 0x000 0x14 0x000
78#define MX25_PAD_OE__GPIO_2_14 0x048 0x260 0x000 0x15 0x000
79
80#define MX25_PAD_CS0__CS0 0x04c 0x000 0x000 0x00 0x000
81#define MX25_PAD_CS0__GPIO_4_2 0x04c 0x000 0x000 0x05 0x000
82
83#define MX25_PAD_CS1__CS1 0x050 0x000 0x000 0x00 0x000
84#define MX25_PAD_CS1__NF_CE3 0x050 0x000 0x000 0x01 0x000
85#define MX25_PAD_CS1__GPIO_4_3 0x050 0x000 0x000 0x05 0x000
86
87#define MX25_PAD_CS4__CS4 0x054 0x264 0x000 0x10 0x000
88#define MX25_PAD_CS4__NF_CE1 0x054 0x264 0x000 0x01 0x000
89#define MX25_PAD_CS4__UART5_CTS 0x054 0x264 0x000 0x13 0x000
90#define MX25_PAD_CS4__GPIO_3_20 0x054 0x264 0x000 0x15 0x000
91
92#define MX25_PAD_CS5__CS5 0x058 0x268 0x000 0x10 0x000
93#define MX25_PAD_CS5__NF_CE2 0x058 0x268 0x000 0x01 0x000
94#define MX25_PAD_CS5__UART5_RTS 0x058 0x268 0x574 0x13 0x000
95#define MX25_PAD_CS5__GPIO_3_21 0x058 0x268 0x000 0x15 0x000
96
97#define MX25_PAD_NF_CE0__NF_CE0 0x05c 0x26c 0x000 0x10 0x000
98#define MX25_PAD_NF_CE0__GPIO_3_22 0x05c 0x26c 0x000 0x15 0x000
99
100#define MX25_PAD_ECB__ECB 0x060 0x270 0x000 0x10 0x000
101#define MX25_PAD_ECB__UART5_TXD_MUX 0x060 0x270 0x000 0x13 0x000
102#define MX25_PAD_ECB__GPIO_3_23 0x060 0x270 0x000 0x15 0x000
103
104#define MX25_PAD_LBA__LBA 0x064 0x274 0x000 0x10 0x000
105#define MX25_PAD_LBA__UART5_RXD_MUX 0x064 0x274 0x578 0x13 0x000
106#define MX25_PAD_LBA__GPIO_3_24 0x064 0x274 0x000 0x15 0x000
107
108#define MX25_PAD_BCLK__BCLK 0x068 0x000 0x000 0x00 0x000
109#define MX25_PAD_BCLK__GPIO_4_4 0x068 0x000 0x000 0x05 0x000
110
111#define MX25_PAD_RW__RW 0x06c 0x278 0x000 0x10 0x000
112#define MX25_PAD_RW__AUD4_TXFS 0x06c 0x278 0x474 0x14 0x000
113#define MX25_PAD_RW__GPIO_3_25 0x06c 0x278 0x000 0x15 0x000
114
115#define MX25_PAD_NFWE_B__NFWE_B 0x070 0x000 0x000 0x10 0x000
116#define MX25_PAD_NFWE_B__GPIO_3_26 0x070 0x000 0x000 0x15 0x000
117
118#define MX25_PAD_NFRE_B__NFRE_B 0x074 0x000 0x000 0x10 0x000
119#define MX25_PAD_NFRE_B__GPIO_3_27 0x074 0x000 0x000 0x15 0x000
120
121#define MX25_PAD_NFALE__NFALE 0x078 0x000 0x000 0x10 0x000
122#define MX25_PAD_NFALE__GPIO_3_28 0x078 0x000 0x000 0x15 0x000
123
124#define MX25_PAD_NFCLE__NFCLE 0x07c 0x000 0x000 0x10 0x000
125#define MX25_PAD_NFCLE__GPIO_3_29 0x07c 0x000 0x000 0x15 0x000
126
127#define MX25_PAD_NFWP_B__NFWP_B 0x080 0x000 0x000 0x10 0x000
128#define MX25_PAD_NFWP_B__GPIO_3_30 0x080 0x000 0x000 0x15 0x000
129
130#define MX25_PAD_NFRB__NFRB 0x084 0x27c 0x000 0x10 0x000
131#define MX25_PAD_NFRB__GPIO_3_31 0x084 0x27c 0x000 0x15 0x000
132
133#define MX25_PAD_D15__D15 0x088 0x280 0x000 0x00 0x000
134#define MX25_PAD_D15__LD16 0x088 0x280 0x000 0x01 0x000
135#define MX25_PAD_D15__GPIO_4_5 0x088 0x280 0x000 0x05 0x000
136
137#define MX25_PAD_D14__D14 0x08c 0x284 0x000 0x00 0x000
138#define MX25_PAD_D14__LD17 0x08c 0x284 0x000 0x01 0x000
139#define MX25_PAD_D14__GPIO_4_6 0x08c 0x284 0x000 0x05 0x000
140
141#define MX25_PAD_D13__D13 0x090 0x288 0x000 0x00 0x000
142#define MX25_PAD_D13__LD18 0x090 0x288 0x000 0x01 0x000
143#define MX25_PAD_D13__GPIO_4_7 0x090 0x288 0x000 0x05 0x000
144
145#define MX25_PAD_D12__D12 0x094 0x28c 0x000 0x00 0x000
146#define MX25_PAD_D12__GPIO_4_8 0x094 0x28c 0x000 0x05 0x000
147
148#define MX25_PAD_D11__D11 0x098 0x290 0x000 0x00 0x000
149#define MX25_PAD_D11__GPIO_4_9 0x098 0x290 0x000 0x05 0x000
150
151#define MX25_PAD_D10__D10 0x09c 0x294 0x000 0x00 0x000
152#define MX25_PAD_D10__GPIO_4_10 0x09c 0x294 0x000 0x05 0x000
153#define MX25_PAD_D10__USBOTG_OC 0x09c 0x294 0x57c 0x06 0x000
154
155#define MX25_PAD_D9__D9 0x0a0 0x298 0x000 0x00 0x000
156#define MX25_PAD_D9__GPIO_4_11 0x0a0 0x298 0x000 0x05 0x000
157#define MX25_PAD_D9__USBH2_PWR 0x0a0 0x298 0x000 0x06 0x000
158
159#define MX25_PAD_D8__D8 0x0a4 0x29c 0x000 0x00 0x000
160#define MX25_PAD_D8__GPIO_4_12 0x0a4 0x29c 0x000 0x05 0x000
161#define MX25_PAD_D8__USBH2_OC 0x0a4 0x29c 0x580 0x06 0x000
162
163#define MX25_PAD_D7__D7 0x0a8 0x2a0 0x000 0x00 0x000
164#define MX25_PAD_D7__GPIO_4_13 0x0a8 0x2a0 0x000 0x05 0x000
165
166#define MX25_PAD_D6__D6 0x0ac 0x2a4 0x000 0x00 0x000
167#define MX25_PAD_D6__GPIO_4_14 0x0ac 0x2a4 0x000 0x05 0x000
168
169#define MX25_PAD_D5__D5 0x0b0 0x2a8 0x000 0x00 0x000
170#define MX25_PAD_D5__GPIO_4_15 0x0b0 0x2a8 0x000 0x05 0x000
171
172#define MX25_PAD_D4__D4 0x0b4 0x2ac 0x000 0x00 0x000
173#define MX25_PAD_D4__GPIO_4_16 0x0b4 0x2ac 0x000 0x05 0x000
174
175#define MX25_PAD_D3__D3 0x0b8 0x2b0 0x000 0x00 0x000
176#define MX25_PAD_D3__GPIO_4_17 0x0b8 0x2b0 0x000 0x05 0x000
177
178#define MX25_PAD_D2__D2 0x0bc 0x2b4 0x000 0x00 0x000
179#define MX25_PAD_D2__GPIO_4_18 0x0bc 0x2b4 0x000 0x05 0x000
180
181#define MX25_PAD_D1__D1 0x0c0 0x2b8 0x000 0x00 0x000
182#define MX25_PAD_D1__GPIO_4_19 0x0c0 0x2b8 0x000 0x05 0x000
183
184#define MX25_PAD_D0__D0 0x0c4 0x2bc 0x000 0x00 0x000
185#define MX25_PAD_D0__GPIO_4_20 0x0c4 0x2bc 0x000 0x05 0x000
186
187#define MX25_PAD_LD0__LD0 0x0c8 0x2c0 0x000 0x10 0x000
188#define MX25_PAD_LD0__CSI_D0 0x0c8 0x2c0 0x488 0x12 0x000
189#define MX25_PAD_LD0__GPIO_2_15 0x0c8 0x2c0 0x000 0x15 0x000
190
191#define MX25_PAD_LD1__LD1 0x0cc 0x2c4 0x000 0x10 0x000
192#define MX25_PAD_LD1__CSI_D1 0x0cc 0x2c4 0x48c 0x12 0x000
193#define MX25_PAD_LD1__GPIO_2_16 0x0cc 0x2c4 0x000 0x15 0x000
194
195#define MX25_PAD_LD2__LD2 0x0d0 0x2c8 0x000 0x10 0x000
196#define MX25_PAD_LD2__GPIO_2_17 0x0d0 0x2c8 0x000 0x15 0x000
197
198#define MX25_PAD_LD3__LD3 0x0d4 0x2cc 0x000 0x10 0x000
199#define MX25_PAD_LD3__GPIO_2_18 0x0d4 0x2cc 0x000 0x15 0x000
200
201#define MX25_PAD_LD4__LD4 0x0d8 0x2d0 0x000 0x10 0x000
202#define MX25_PAD_LD4__GPIO_2_19 0x0d8 0x2d0 0x000 0x15 0x000
203
204#define MX25_PAD_LD5__LD5 0x0dc 0x2d4 0x000 0x10 0x000
205#define MX25_PAD_LD5__GPIO_1_19 0x0dc 0x2d4 0x000 0x15 0x000
206
207#define MX25_PAD_LD6__LD6 0x0e0 0x2d8 0x000 0x10 0x000
208#define MX25_PAD_LD6__GPIO_1_20 0x0e0 0x2d8 0x000 0x15 0x000
209
210#define MX25_PAD_LD7__LD7 0x0e4 0x2dc 0x000 0x10 0x000
211#define MX25_PAD_LD7__GPIO_1_21 0x0e4 0x2dc 0x000 0x15 0x000
212
213#define MX25_PAD_LD8__LD8 0x0e8 0x2e0 0x000 0x10 0x000
214#define MX25_PAD_LD8__FEC_TX_ERR 0x0e8 0x2e0 0x000 0x15 0x000
215
216#define MX25_PAD_LD9__LD9 0x0ec 0x2e4 0x000 0x10 0x000
217#define MX25_PAD_LD9__FEC_COL 0x0ec 0x2e4 0x504 0x15 0x001
218
219#define MX25_PAD_LD10__LD10 0x0f0 0x2e8 0x000 0x10 0x000
220#define MX25_PAD_LD10__FEC_RX_ER 0x0f0 0x2e8 0x518 0x15 0x001
221
222#define MX25_PAD_LD11__LD11 0x0f4 0x2ec 0x000 0x10 0x000
223#define MX25_PAD_LD11__FEC_RDATA2 0x0f4 0x2ec 0x50c 0x15 0x001
224
225#define MX25_PAD_LD12__LD12 0x0f8 0x2f0 0x000 0x10 0x000
226#define MX25_PAD_LD12__FEC_RDATA3 0x0f8 0x2f0 0x510 0x15 0x001
227
228#define MX25_PAD_LD13__LD13 0x0fc 0x2f4 0x000 0x10 0x000
229#define MX25_PAD_LD13__FEC_TDATA2 0x0fc 0x2f4 0x000 0x15 0x000
230
231#define MX25_PAD_LD14__LD14 0x100 0x2f8 0x000 0x10 0x000
232#define MX25_PAD_LD14__FEC_TDATA3 0x100 0x2f8 0x000 0x15 0x000
233
234#define MX25_PAD_LD15__LD15 0x104 0x2fc 0x000 0x10 0x000
235#define MX25_PAD_LD15__FEC_RX_CLK 0x104 0x2fc 0x514 0x15 0x001
236
237#define MX25_PAD_HSYNC__HSYNC 0x108 0x300 0x000 0x10 0x000
238#define MX25_PAD_HSYNC__GPIO_1_22 0x108 0x300 0x000 0x15 0x000
239
240#define MX25_PAD_VSYNC__VSYNC 0x10c 0x304 0x000 0x10 0x000
241#define MX25_PAD_VSYNC__GPIO_1_23 0x10c 0x304 0x000 0x15 0x000
242
243#define MX25_PAD_LSCLK__LSCLK 0x110 0x308 0x000 0x10 0x000
244#define MX25_PAD_LSCLK__GPIO_1_24 0x110 0x308 0x000 0x15 0x000
245
246#define MX25_PAD_OE_ACD__OE_ACD 0x114 0x30c 0x000 0x10 0x000
247#define MX25_PAD_OE_ACD__GPIO_1_25 0x114 0x30c 0x000 0x15 0x000
248
249#define MX25_PAD_CONTRAST__CONTRAST 0x118 0x310 0x000 0x10 0x000
250#define MX25_PAD_CONTRAST__PWM4_PWMO 0x118 0x310 0x000 0x14 0x000
251#define MX25_PAD_CONTRAST__FEC_CRS 0x118 0x310 0x508 0x15 0x001
252
253#define MX25_PAD_PWM__PWM 0x11c 0x314 0x000 0x10 0x000
254#define MX25_PAD_PWM__GPIO_1_26 0x11c 0x314 0x000 0x15 0x000
255#define MX25_PAD_PWM__USBH2_OC 0x11c 0x314 0x580 0x16 0x001
256
257#define MX25_PAD_CSI_D2__CSI_D2 0x120 0x318 0x000 0x10 0x000
258#define MX25_PAD_CSI_D2__UART5_RXD_MUX 0x120 0x318 0x578 0x11 0x001
259#define MX25_PAD_CSI_D2__GPIO_1_27 0x120 0x318 0x000 0x15 0x000
260#define MX25_PAD_CSI_D2__CSPI3_MOSI 0x120 0x318 0x000 0x17 0x000
261
262#define MX25_PAD_CSI_D3__CSI_D3 0x124 0x31c 0x000 0x10 0x000
263#define MX25_PAD_CSI_D3__GPIO_1_28 0x124 0x31c 0x000 0x15 0x000
264#define MX25_PAD_CSI_D3__CSPI3_MISO 0x124 0x31c 0x4b4 0x17 0x001
265
266#define MX25_PAD_CSI_D4__CSI_D4 0x128 0x320 0x000 0x10 0x000
267#define MX25_PAD_CSI_D4__UART5_RTS 0x128 0x320 0x574 0x11 0x001
268#define MX25_PAD_CSI_D4__GPIO_1_29 0x128 0x320 0x000 0x15 0x000
269#define MX25_PAD_CSI_D4__CSPI3_SCLK 0x128 0x320 0x000 0x17 0x000
270
271#define MX25_PAD_CSI_D5__CSI_D5 0x12c 0x324 0x000 0x10 0x000
272#define MX25_PAD_CSI_D5__GPIO_1_30 0x12c 0x324 0x000 0x15 0x000
273#define MX25_PAD_CSI_D5__CSPI3_RDY 0x12c 0x324 0x000 0x17 0x000
274
275#define MX25_PAD_CSI_D6__CSI_D6 0x130 0x328 0x000 0x10 0x000
276#define MX25_PAD_CSI_D6__GPIO_1_31 0x130 0x328 0x000 0x15 0x000
277
278#define MX25_PAD_CSI_D7__CSI_D7 0x134 0x32c 0x000 0x10 0x000
279#define MX25_PAD_CSI_D7__GPIO_1_6 0x134 0x32c 0x000 0x15 0x000
280
281#define MX25_PAD_CSI_D8__CSI_D8 0x138 0x330 0x000 0x10 0x000
282#define MX25_PAD_CSI_D8__GPIO_1_7 0x138 0x330 0x000 0x15 0x000
283
284#define MX25_PAD_CSI_D9__CSI_D9 0x13c 0x334 0x000 0x10 0x000
285#define MX25_PAD_CSI_D9__GPIO_4_21 0x13c 0x334 0x000 0x15 0x000
286
287#define MX25_PAD_CSI_MCLK__CSI_MCLK 0x140 0x338 0x000 0x10 0x000
288#define MX25_PAD_CSI_MCLK__GPIO_1_8 0x140 0x338 0x000 0x15 0x000
289
290#define MX25_PAD_CSI_VSYNC__CSI_VSYNC 0x144 0x33c 0x000 0x10 0x000
291#define MX25_PAD_CSI_VSYNC__GPIO_1_9 0x144 0x33c 0x000 0x15 0x000
292
293#define MX25_PAD_CSI_HSYNC__CSI_HSYNC 0x148 0x340 0x000 0x10 0x000
294#define MX25_PAD_CSI_HSYNC__GPIO_1_10 0x148 0x340 0x000 0x15 0x000
295
296#define MX25_PAD_CSI_PIXCLK__CSI_PIXCLK 0x14c 0x344 0x000 0x10 0x000
297#define MX25_PAD_CSI_PIXCLK__GPIO_1_11 0x14c 0x344 0x000 0x15 0x000
298
299#define MX25_PAD_I2C1_CLK__I2C1_CLK 0x150 0x348 0x000 0x10 0x000
300#define MX25_PAD_I2C1_CLK__GPIO_1_12 0x150 0x348 0x000 0x15 0x000
301
302#define MX25_PAD_I2C1_DAT__I2C1_DAT 0x154 0x34c 0x000 0x10 0x000
303#define MX25_PAD_I2C1_DAT__GPIO_1_13 0x154 0x34c 0x000 0x15 0x000
304
305#define MX25_PAD_CSPI1_MOSI__CSPI1_MOSI 0x158 0x350 0x000 0x10 0x000
306#define MX25_PAD_CSPI1_MOSI__GPIO_1_14 0x158 0x350 0x000 0x15 0x000
307
308#define MX25_PAD_CSPI1_MISO__CSPI1_MISO 0x15c 0x354 0x000 0x10 0x000
309#define MX25_PAD_CSPI1_MISO__GPIO_1_15 0x15c 0x354 0x000 0x15 0x000
310
311#define MX25_PAD_CSPI1_SS0__CSPI1_SS0 0x160 0x358 0x000 0x10 0x000
312#define MX25_PAD_CSPI1_SS0__GPIO_1_16 0x160 0x358 0x000 0x15 0x000
313
314#define MX25_PAD_CSPI1_SS1__CSPI1_SS1 0x164 0x35c 0x000 0x10 0x000
315#define MX25_PAD_CSPI1_SS1__GPIO_1_17 0x164 0x35c 0x000 0x15 0x000
316
317#define MX25_PAD_CSPI1_SCLK__CSPI1_SCLK 0x168 0x360 0x000 0x10 0x000
318#define MX25_PAD_CSPI1_SCLK__GPIO_1_18 0x168 0x360 0x000 0x15 0x000
319
320#define MX25_PAD_CSPI1_RDY__CSPI1_RDY 0x16c 0x364 0x000 0x10 0x000
321#define MX25_PAD_CSPI1_RDY__GPIO_2_22 0x16c 0x364 0x000 0x15 0x000
322
323#define MX25_PAD_UART1_RXD__UART1_RXD 0x170 0x368 0x000 0x10 0x000
324#define MX25_PAD_UART1_RXD__GPIO_4_22 0x170 0x368 0x000 0x15 0x000
325
326#define MX25_PAD_UART1_TXD__UART1_TXD 0x174 0x36c 0x000 0x10 0x000
327#define MX25_PAD_UART1_TXD__GPIO_4_23 0x174 0x36c 0x000 0x15 0x000
328
329#define MX25_PAD_UART1_RTS__UART1_RTS 0x178 0x370 0x000 0x10 0x000
330#define MX25_PAD_UART1_RTS__CSI_D0 0x178 0x370 0x488 0x11 0x001
331#define MX25_PAD_UART1_RTS__GPIO_4_24 0x178 0x370 0x000 0x15 0x000
332
333#define MX25_PAD_UART1_CTS__UART1_CTS 0x17c 0x374 0x000 0x10 0x000
334#define MX25_PAD_UART1_CTS__CSI_D1 0x17c 0x374 0x48c 0x11 0x001
335#define MX25_PAD_UART1_CTS__GPIO_4_25 0x17c 0x374 0x000 0x15 0x000
336
337#define MX25_PAD_UART2_RXD__UART2_RXD 0x180 0x378 0x000 0x10 0x000
338#define MX25_PAD_UART2_RXD__GPIO_4_26 0x180 0x378 0x000 0x15 0x000
339
340#define MX25_PAD_UART2_TXD__UART2_TXD 0x184 0x37c 0x000 0x10 0x000
341#define MX25_PAD_UART2_TXD__GPIO_4_27 0x184 0x37c 0x000 0x15 0x000
342
343#define MX25_PAD_UART2_RTS__UART2_RTS 0x188 0x380 0x000 0x10 0x000
344#define MX25_PAD_UART2_RTS__FEC_COL 0x188 0x380 0x504 0x12 0x002
345#define MX25_PAD_UART2_RTS__GPIO_4_28 0x188 0x380 0x000 0x15 0x000
346
347#define MX25_PAD_UART2_CTS__FEC_RX_ER 0x18c 0x384 0x518 0x12 0x002
348#define MX25_PAD_UART2_CTS__UART2_CTS 0x18c 0x384 0x000 0x10 0x000
349#define MX25_PAD_UART2_CTS__GPIO_4_29 0x18c 0x384 0x000 0x15 0x000
350
351#define MX25_PAD_SD1_CMD__SD1_CMD 0x190 0x388 0x000 0x10 0x000
352#define MX25_PAD_SD1_CMD__FEC_RDATA2 0x190 0x388 0x50c 0x12 0x002
353#define MX25_PAD_SD1_CMD__GPIO_2_23 0x190 0x388 0x000 0x15 0x000
354
355#define MX25_PAD_SD1_CLK__SD1_CLK 0x194 0x38c 0x000 0x10 0x000
356#define MX25_PAD_SD1_CLK__FEC_RDATA3 0x194 0x38c 0x510 0x12 0x002
357#define MX25_PAD_SD1_CLK__GPIO_2_24 0x194 0x38c 0x000 0x15 0x000
358
359#define MX25_PAD_SD1_DATA0__SD1_DATA0 0x198 0x390 0x000 0x10 0x000
360#define MX25_PAD_SD1_DATA0__GPIO_2_25 0x198 0x390 0x000 0x15 0x000
361
362#define MX25_PAD_SD1_DATA1__SD1_DATA1 0x19c 0x394 0x000 0x10 0x000
363#define MX25_PAD_SD1_DATA1__AUD7_RXD 0x19c 0x394 0x478 0x13 0x000
364#define MX25_PAD_SD1_DATA1__GPIO_2_26 0x19c 0x394 0x000 0x15 0x000
365
366#define MX25_PAD_SD1_DATA2__SD1_DATA2 0x1a0 0x398 0x000 0x10 0x000
367#define MX25_PAD_SD1_DATA2__FEC_RX_CLK 0x1a0 0x398 0x514 0x15 0x002
368#define MX25_PAD_SD1_DATA2__GPIO_2_27 0x1a0 0x398 0x000 0x15 0x000
369
370#define MX25_PAD_SD1_DATA3__SD1_DATA3 0x1a4 0x39c 0x000 0x10 0x000
371#define MX25_PAD_SD1_DATA3__FEC_CRS 0x1a4 0x39c 0x508 0x10 0x002
372#define MX25_PAD_SD1_DATA3__GPIO_2_28 0x1a4 0x39c 0x000 0x15 0x000
373
374#define MX25_PAD_KPP_ROW0__KPP_ROW0 0x1a8 0x3a0 0x000 0x10 0x000
375#define MX25_PAD_KPP_ROW0__GPIO_2_29 0x1a8 0x3a0 0x000 0x15 0x000
376
377#define MX25_PAD_KPP_ROW1__KPP_ROW1 0x1ac 0x3a4 0x000 0x10 0x000
378#define MX25_PAD_KPP_ROW1__GPIO_2_30 0x1ac 0x3a4 0x000 0x15 0x000
379
380#define MX25_PAD_KPP_ROW2__KPP_ROW2 0x1b0 0x3a8 0x000 0x10 0x000
381#define MX25_PAD_KPP_ROW2__CSI_D0 0x1b0 0x3a8 0x488 0x13 0x002
382#define MX25_PAD_KPP_ROW2__GPIO_2_31 0x1b0 0x3a8 0x000 0x15 0x000
383
384#define MX25_PAD_KPP_ROW3__KPP_ROW3 0x1b4 0x3ac 0x000 0x10 0x000
385#define MX25_PAD_KPP_ROW3__CSI_LD1 0x1b4 0x3ac 0x48c 0x13 0x002
386#define MX25_PAD_KPP_ROW3__GPIO_3_0 0x1b4 0x3ac 0x000 0x15 0x000
387
388#define MX25_PAD_KPP_COL0__KPP_COL0 0x1b8 0x3b0 0x000 0x10 0x000
389#define MX25_PAD_KPP_COL0__UART4_RXD_MUX 0x1b8 0x3b0 0x570 0x11 0x001
390#define MX25_PAD_KPP_COL0__AUD5_TXD 0x1b8 0x3b0 0x000 0x12 0x000
391#define MX25_PAD_KPP_COL0__GPIO_3_1 0x1b8 0x3b0 0x000 0x15 0x000
392
393#define MX25_PAD_KPP_COL1__KPP_COL1 0x1bc 0x3b4 0x000 0x10 0x000
394#define MX25_PAD_KPP_COL1__UART4_TXD_MUX 0x1bc 0x3b4 0x000 0x11 0x000
395#define MX25_PAD_KPP_COL1__AUD5_RXD 0x1bc 0x3b4 0x000 0x12 0x000
396#define MX25_PAD_KPP_COL1__GPIO_3_2 0x1bc 0x3b4 0x000 0x15 0x000
397
398#define MX25_PAD_KPP_COL2__KPP_COL2 0x1c0 0x3b8 0x000 0x10 0x000
399#define MX25_PAD_KPP_COL2__UART4_RTS 0x1c0 0x3b8 0x000 0x11 0x000
400#define MX25_PAD_KPP_COL2__AUD5_TXC 0x1c0 0x3b8 0x000 0x12 0x000
401#define MX25_PAD_KPP_COL2__GPIO_3_3 0x1c0 0x3b8 0x000 0x15 0x000
402
403#define MX25_PAD_KPP_COL3__KPP_COL3 0x1c4 0x3bc 0x000 0x10 0x000
404#define MX25_PAD_KPP_COL3__UART4_CTS 0x1c4 0x3bc 0x000 0x11 0x000
405#define MX25_PAD_KPP_COL3__AUD5_TXFS 0x1c4 0x3bc 0x000 0x12 0x000
406#define MX25_PAD_KPP_COL3__GPIO_3_4 0x1c4 0x3bc 0x000 0x15 0x000
407
408#define MX25_PAD_FEC_MDC__FEC_MDC 0x1c8 0x3c0 0x000 0x10 0x000
409#define MX25_PAD_FEC_MDC__AUD4_TXD 0x1c8 0x3c0 0x464 0x12 0x001
410#define MX25_PAD_FEC_MDC__GPIO_3_5 0x1c8 0x3c0 0x000 0x15 0x000
411
412#define MX25_PAD_FEC_MDIO__FEC_MDIO 0x1cc 0x3c4 0x000 0x10 0x000
413#define MX25_PAD_FEC_MDIO__AUD4_RXD 0x1cc 0x3c4 0x460 0x12 0x001
414#define MX25_PAD_FEC_MDIO__GPIO_3_6 0x1cc 0x3c4 0x000 0x15 0x000
415
416#define MX25_PAD_FEC_TDATA0__FEC_TDATA0 0x1d0 0x3c8 0x000 0x10 0x000
417#define MX25_PAD_FEC_TDATA0__GPIO_3_7 0x1d0 0x3c8 0x000 0x15 0x000
418
419#define MX25_PAD_FEC_TDATA1__FEC_TDATA1 0x1d4 0x3cc 0x000 0x10 0x000
420#define MX25_PAD_FEC_TDATA1__AUD4_TXFS 0x1d4 0x3cc 0x474 0x12 0x001
421#define MX25_PAD_FEC_TDATA1__GPIO_3_8 0x1d4 0x3cc 0x000 0x15 0x000
422
423#define MX25_PAD_FEC_TX_EN__FEC_TX_EN 0x1d8 0x3d0 0x000 0x10 0x000
424#define MX25_PAD_FEC_TX_EN__GPIO_3_9 0x1d8 0x3d0 0x000 0x15 0x000
425
426#define MX25_PAD_FEC_RDATA0__FEC_RDATA0 0x1dc 0x3d4 0x000 0x10 0x000
427#define MX25_PAD_FEC_RDATA0__GPIO_3_10 0x1dc 0x3d4 0x000 0x15 0x000
428
429#define MX25_PAD_FEC_RDATA1__FEC_RDATA1 0x1e0 0x3d8 0x000 0x10 0x000
430#define MX25_PAD_FEC_RDATA1__GPIO_3_11 0x1e0 0x3d8 0x000 0x15 0x000
431
432#define MX25_PAD_FEC_RX_DV__FEC_RX_DV 0x1e4 0x3dc 0x000 0x10 0x000
433#define MX25_PAD_FEC_RX_DV__CAN2_RX 0x1e4 0x3dc 0x484 0x14 0x000
434#define MX25_PAD_FEC_RX_DV__GPIO_3_12 0x1e4 0x3dc 0x000 0x15 0x000
435
436#define MX25_PAD_FEC_TX_CLK__FEC_TX_CLK 0x1e8 0x3e0 0x000 0x10 0x000
437#define MX25_PAD_FEC_TX_CLK__GPIO_3_13 0x1e8 0x3e0 0x000 0x15 0x000
438
439#define MX25_PAD_RTCK__RTCK 0x1ec 0x3e4 0x000 0x10 0x000
440#define MX25_PAD_RTCK__OWIRE 0x1ec 0x3e4 0x000 0x11 0x000
441#define MX25_PAD_RTCK__GPIO_3_14 0x1ec 0x3e4 0x000 0x15 0x000
442
443#define MX25_PAD_DE_B__DE_B 0x1f0 0x3ec 0x000 0x10 0x000
444#define MX25_PAD_DE_B__GPIO_2_20 0x1f0 0x3ec 0x000 0x15 0x000
445
446#define MX25_PAD_TDO__TDO 0x000 0x3e8 0x000 0x00 0x000
447
448#define MX25_PAD_GPIO_A__GPIO_A 0x1f4 0x3f0 0x000 0x10 0x000
449#define MX25_PAD_GPIO_A__CAN1_TX 0x1f4 0x3f0 0x000 0x16 0x000
450#define MX25_PAD_GPIO_A__USBOTG_PWR 0x1f4 0x3f0 0x000 0x12 0x000
451
452#define MX25_PAD_GPIO_B__GPIO_B 0x1f8 0x3f4 0x000 0x10 0x000
453#define MX25_PAD_GPIO_B__CAN1_RX 0x1f8 0x3f4 0x480 0x16 0x001
454#define MX25_PAD_GPIO_B__USBOTG_OC 0x1f8 0x3f4 0x57c 0x12 0x001
455
456#define MX25_PAD_GPIO_C__GPIO_C 0x1fc 0x3f8 0x000 0x10 0x000
457#define MX25_PAD_GPIO_C__CAN2_TX 0x1fc 0x3f8 0x000 0x16 0x000
458
459#define MX25_PAD_GPIO_D__GPIO_D 0x200 0x3fc 0x000 0x10 0x000
460#define MX25_PAD_GPIO_E__LD16 0x204 0x400 0x000 0x02 0x000
461#define MX25_PAD_GPIO_D__CAN2_RX 0x200 0x3fc 0x484 0x16 0x001
462
463#define MX25_PAD_GPIO_E__GPIO_E 0x204 0x400 0x000 0x10 0x000
464#define MX25_PAD_GPIO_F__LD17 0x208 0x404 0x000 0x02 0x000
465#define MX25_PAD_GPIO_E__AUD7_TXD 0x204 0x400 0x000 0x14 0x000
466
467#define MX25_PAD_GPIO_F__GPIO_F 0x208 0x404 0x000 0x10 0x000
468#define MX25_PAD_GPIO_F__AUD7_TXC 0x208 0x404 0x000 0x14 0x000
469
470#define MX25_PAD_EXT_ARMCLK__EXT_ARMCLK 0x20c 0x000 0x000 0x10 0x000
471#define MX25_PAD_EXT_ARMCLK__GPIO_3_15 0x20c 0x000 0x000 0x15 0x000
472
473#define MX25_PAD_UPLL_BYPCLK__UPLL_BYPCLK 0x210 0x000 0x000 0x10 0x000
474#define MX25_PAD_UPLL_BYPCLK__GPIO_3_16 0x210 0x000 0x000 0x15 0x000
475
476#define MX25_PAD_VSTBY_REQ__VSTBY_REQ 0x214 0x408 0x000 0x10 0x000
477#define MX25_PAD_VSTBY_REQ__AUD7_TXFS 0x214 0x408 0x000 0x14 0x000
478#define MX25_PAD_VSTBY_REQ__GPIO_3_17 0x214 0x408 0x000 0x15 0x000
479#define MX25_PAD_VSTBY_ACK__VSTBY_ACK 0x218 0x40c 0x000 0x10 0x000
480#define MX25_PAD_VSTBY_ACK__GPIO_3_18 0x218 0x40c 0x000 0x15 0x000
481
482#define MX25_PAD_POWER_FAIL__POWER_FAIL 0x21c 0x410 0x000 0x10 0x000
483#define MX25_PAD_POWER_FAIL__AUD7_RXD 0x21c 0x410 0x478 0x14 0x001
484#define MX25_PAD_POWER_FAIL__GPIO_3_19 0x21c 0x410 0x000 0x15 0x000
485
486#define MX25_PAD_CLKO__CLKO 0x220 0x414 0x000 0x10 0x000
487#define MX25_PAD_CLKO__GPIO_2_21 0x220 0x414 0x000 0x15 0x000
488
489#define MX25_PAD_BOOT_MODE0__BOOT_MODE0 0x224 0x000 0x000 0x00 0x000
490#define MX25_PAD_BOOT_MODE0__GPIO_4_30 0x224 0x000 0x000 0x05 0x000
491#define MX25_PAD_BOOT_MODE1__BOOT_MODE1 0x228 0x000 0x000 0x00 0x000
492#define MX25_PAD_BOOT_MODE1__GPIO_4_31 0x228 0x000 0x000 0x05 0x000
493
494#endif /* __DTS_IMX25_PINFUNC_H */
diff --git a/arch/arm/boot/dts/imx25.dtsi b/arch/arm/boot/dts/imx25.dtsi
index 737ed5da8f71..32f760e24898 100644
--- a/arch/arm/boot/dts/imx25.dtsi
+++ b/arch/arm/boot/dts/imx25.dtsi
@@ -10,6 +10,7 @@
10 */ 10 */
11 11
12#include "skeleton.dtsi" 12#include "skeleton.dtsi"
13#include "imx25-pinfunc.h"
13 14
14/ { 15/ {
15 aliases { 16 aliases {
@@ -173,12 +174,12 @@
173 status = "disabled"; 174 status = "disabled";
174 }; 175 };
175 176
176 iomuxc@43fac000{ 177 iomuxc: iomuxc@43fac000 {
177 compatible = "fsl,imx25-iomuxc"; 178 compatible = "fsl,imx25-iomuxc";
178 reg = <0x43fac000 0x4000>; 179 reg = <0x43fac000 0x4000>;
179 }; 180 };
180 181
181 audmux@43fb0000 { 182 audmux: audmux@43fb0000 {
182 compatible = "fsl,imx25-audmux", "fsl,imx31-audmux"; 183 compatible = "fsl,imx25-audmux", "fsl,imx31-audmux";
183 reg = <0x43fb0000 0x4000>; 184 reg = <0x43fb0000 0x4000>;
184 status = "disabled"; 185 status = "disabled";
@@ -236,6 +237,11 @@
236 compatible = "fsl,imx25-ssi", "fsl,imx21-ssi"; 237 compatible = "fsl,imx25-ssi", "fsl,imx21-ssi";
237 reg = <0x50014000 0x4000>; 238 reg = <0x50014000 0x4000>;
238 interrupts = <11>; 239 interrupts = <11>;
240 clocks = <&clks 118>;
241 clock-names = "ipg";
242 dmas = <&sdma 24 1 0>,
243 <&sdma 25 1 0>;
244 dma-names = "rx", "tx";
239 status = "disabled"; 245 status = "disabled";
240 }; 246 };
241 247
@@ -266,6 +272,11 @@
266 compatible = "fsl,imx25-ssi", "fsl,imx21-ssi"; 272 compatible = "fsl,imx25-ssi", "fsl,imx21-ssi";
267 reg = <0x50034000 0x4000>; 273 reg = <0x50034000 0x4000>;
268 interrupts = <12>; 274 interrupts = <12>;
275 clocks = <&clks 117>;
276 clock-names = "ipg";
277 dmas = <&sdma 28 1 0>,
278 <&sdma 29 1 0>;
279 dma-names = "rx", "tx";
269 status = "disabled"; 280 status = "disabled";
270 }; 281 };
271 282
@@ -436,13 +447,14 @@
436 #interrupt-cells = <2>; 447 #interrupt-cells = <2>;
437 }; 448 };
438 449
439 sdma@53fd4000 { 450 sdma: sdma@53fd4000 {
440 compatible = "fsl,imx25-sdma", "fsl,imx35-sdma"; 451 compatible = "fsl,imx25-sdma", "fsl,imx35-sdma";
441 reg = <0x53fd4000 0x4000>; 452 reg = <0x53fd4000 0x4000>;
442 clocks = <&clks 112>, <&clks 68>; 453 clocks = <&clks 112>, <&clks 68>;
443 clock-names = "ipg", "ahb"; 454 clock-names = "ipg", "ahb";
444 #dma-cells = <3>; 455 #dma-cells = <3>;
445 interrupts = <34>; 456 interrupts = <34>;
457 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx25.bin";
446 }; 458 };
447 459
448 wdog@53fdc000 { 460 wdog@53fdc000 {
diff --git a/arch/arm/boot/dts/imx27-apf27.dts b/arch/arm/boot/dts/imx27-apf27.dts
index ba4c6df08ece..09f57b39e3ef 100644
--- a/arch/arm/boot/dts/imx27-apf27.dts
+++ b/arch/arm/boot/dts/imx27-apf27.dts
@@ -34,11 +34,49 @@
34 }; 34 };
35}; 35};
36 36
37&iomuxc {
38 imx27-apf27 {
39 pinctrl_fec1: fec1grp {
40 fsl,pins = <
41 MX27_PAD_SD3_CMD__FEC_TXD0 0x0
42 MX27_PAD_SD3_CLK__FEC_TXD1 0x0
43 MX27_PAD_ATA_DATA0__FEC_TXD2 0x0
44 MX27_PAD_ATA_DATA1__FEC_TXD3 0x0
45 MX27_PAD_ATA_DATA2__FEC_RX_ER 0x0
46 MX27_PAD_ATA_DATA3__FEC_RXD1 0x0
47 MX27_PAD_ATA_DATA4__FEC_RXD2 0x0
48 MX27_PAD_ATA_DATA5__FEC_RXD3 0x0
49 MX27_PAD_ATA_DATA6__FEC_MDIO 0x0
50 MX27_PAD_ATA_DATA7__FEC_MDC 0x0
51 MX27_PAD_ATA_DATA8__FEC_CRS 0x0
52 MX27_PAD_ATA_DATA9__FEC_TX_CLK 0x0
53 MX27_PAD_ATA_DATA10__FEC_RXD0 0x0
54 MX27_PAD_ATA_DATA11__FEC_RX_DV 0x0
55 MX27_PAD_ATA_DATA12__FEC_RX_CLK 0x0
56 MX27_PAD_ATA_DATA13__FEC_COL 0x0
57 MX27_PAD_ATA_DATA14__FEC_TX_ER 0x0
58 MX27_PAD_ATA_DATA15__FEC_TX_EN 0x0
59 >;
60 };
61
62 pinctrl_uart1: uart1grp {
63 fsl,pins = <
64 MX27_PAD_UART1_TXD__UART1_TXD 0x0
65 MX27_PAD_UART1_RXD__UART1_RXD 0x0
66 >;
67 };
68 };
69};
70
37&uart1 { 71&uart1 {
72 pinctrl-names = "default";
73 pinctrl-0 = <&pinctrl_uart1>;
38 status = "okay"; 74 status = "okay";
39}; 75};
40 76
41&fec { 77&fec {
78 pinctrl-names = "default";
79 pinctrl-0 = <&pinctrl_fec1>;
42 status = "okay"; 80 status = "okay";
43}; 81};
44 82
diff --git a/arch/arm/boot/dts/imx27-apf27dev.dts b/arch/arm/boot/dts/imx27-apf27dev.dts
index 47c8c26012e4..2b6d489dae69 100644
--- a/arch/arm/boot/dts/imx27-apf27dev.dts
+++ b/arch/arm/boot/dts/imx27-apf27dev.dts
@@ -22,10 +22,10 @@
22 bits-per-pixel = <16>; /* non-standard but required */ 22 bits-per-pixel = <16>; /* non-standard but required */
23 fsl,pcr = <0xfae80083>; /* non-standard but required */ 23 fsl,pcr = <0xfae80083>; /* non-standard but required */
24 display-timings { 24 display-timings {
25 timing0: 640x480 { 25 timing0: 800x480 {
26 clock-frequency = <33000033>; 26 clock-frequency = <33000033>;
27 hactive = <800>; 27 hactive = <800>;
28 vactive = <640>; 28 vactive = <480>;
29 hback-porch = <96>; 29 hback-porch = <96>;
30 hfront-porch = <96>; 30 hfront-porch = <96>;
31 vback-porch = <20>; 31 vback-porch = <20>;
@@ -38,20 +38,24 @@
38 38
39 gpio-keys { 39 gpio-keys {
40 compatible = "gpio-keys"; 40 compatible = "gpio-keys";
41 pinctrl-names = "default";
42 pinctrl-0 = <&pinctrl_gpio_keys>;
41 43
42 user-key { 44 user-key {
43 label = "user"; 45 label = "user";
44 gpios = <&gpio6 13 0>; 46 gpios = <&gpio6 13 GPIO_ACTIVE_HIGH>;
45 linux,code = <276>; /* BTN_EXTRA */ 47 linux,code = <276>; /* BTN_EXTRA */
46 }; 48 };
47 }; 49 };
48 50
49 leds { 51 leds {
50 compatible = "gpio-leds"; 52 compatible = "gpio-leds";
53 pinctrl-names = "default";
54 pinctrl-0 = <&pinctrl_gpio_leds>;
51 55
52 user { 56 user {
53 label = "Heartbeat"; 57 label = "Heartbeat";
54 gpios = <&gpio6 14 0>; 58 gpios = <&gpio6 14 GPIO_ACTIVE_HIGH>;
55 linux,default-trigger = "heartbeat"; 59 linux,default-trigger = "heartbeat";
56 }; 60 };
57 }; 61 };
@@ -59,25 +63,34 @@
59 63
60&cspi1 { 64&cspi1 {
61 fsl,spi-num-chipselects = <1>; 65 fsl,spi-num-chipselects = <1>;
62 cs-gpios = <&gpio4 28 1>; 66 cs-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>;
67 pinctrl-names = "default";
68 pinctrl-0 = <&pinctrl_cspi1 &pinctrl_cspi1_cs>;
63 status = "okay"; 69 status = "okay";
64}; 70};
65 71
66&cspi2 { 72&cspi2 {
67 fsl,spi-num-chipselects = <3>; 73 fsl,spi-num-chipselects = <3>;
68 cs-gpios = <&gpio4 21 1>, <&gpio4 27 1>, 74 cs-gpios = <&gpio4 21 GPIO_ACTIVE_LOW>,
69 <&gpio2 17 1>; 75 <&gpio4 27 GPIO_ACTIVE_LOW>,
76 <&gpio2 17 GPIO_ACTIVE_LOW>;
77 pinctrl-names = "default";
78 pinctrl-0 = <&pinctrl_cspi2 &pinctrl_cspi2_cs>;
70 status = "okay"; 79 status = "okay";
71}; 80};
72 81
73&fb { 82&fb {
74 display = <&display>; 83 display = <&display>;
75 fsl,dmacr = <0x00020010>; 84 fsl,dmacr = <0x00020010>;
85 pinctrl-names = "default";
86 pinctrl-0 = <&pinctrl_imxfb1>;
76 status = "okay"; 87 status = "okay";
77}; 88};
78 89
79&i2c1 { 90&i2c1 {
80 clock-frequency = <400000>; 91 clock-frequency = <400000>;
92 pinctrl-names = "default";
93 pinctrl-0 = <&pinctrl_i2c1>;
81 status = "okay"; 94 status = "okay";
82 95
83 rtc@68 { 96 rtc@68 {
@@ -87,5 +100,127 @@
87}; 100};
88 101
89&i2c2 { 102&i2c2 {
103 pinctrl-names = "default";
104 pinctrl-0 = <&pinctrl_i2c2>;
90 status = "okay"; 105 status = "okay";
91}; 106};
107
108&iomuxc {
109 imx27-apf27dev {
110 pinctrl_cspi1: cspi1grp {
111 fsl,pins = <
112 MX27_PAD_CSPI1_MISO__CSPI1_MISO 0x0
113 MX27_PAD_CSPI1_MOSI__CSPI1_MOSI 0x0
114 MX27_PAD_CSPI1_SCLK__CSPI1_SCLK 0x0
115 >;
116 };
117
118 pinctrl_cspi1_cs: cspi1csgrp {
119 fsl,pins = <MX27_PAD_CSPI1_SS0__GPIO4_28 0x0>;
120 };
121
122 pinctrl_cspi2: cspi2grp {
123 fsl,pins = <
124 MX27_PAD_CSPI2_MISO__CSPI2_MISO 0x0
125 MX27_PAD_CSPI2_MOSI__CSPI2_MOSI 0x0
126 MX27_PAD_CSPI2_SCLK__CSPI2_SCLK 0x0
127 >;
128 };
129
130 pinctrl_cspi2_cs: cspi2csgrp {
131 fsl,pins = <
132 MX27_PAD_CSI_D5__GPIO2_17 0x0
133 MX27_PAD_CSPI2_SS0__GPIO4_21 0x0
134 MX27_PAD_CSPI1_SS1__GPIO4_27 0x0
135 >;
136 };
137
138 pinctrl_gpio_leds: gpioledsgrp {
139 fsl,pins = <MX27_PAD_PC_VS1__GPIO6_14 0x0>;
140 };
141
142 pinctrl_gpio_keys: gpiokeysgrp {
143 fsl,pins = <MX27_PAD_PC_VS2__GPIO6_13 0x0>;
144 };
145
146 pinctrl_imxfb1: imxfbgrp {
147 fsl,pins = <
148 MX27_PAD_CLS__CLS 0x0
149 MX27_PAD_CONTRAST__CONTRAST 0x0
150 MX27_PAD_LD0__LD0 0x0
151 MX27_PAD_LD1__LD1 0x0
152 MX27_PAD_LD2__LD2 0x0
153 MX27_PAD_LD3__LD3 0x0
154 MX27_PAD_LD4__LD4 0x0
155 MX27_PAD_LD5__LD5 0x0
156 MX27_PAD_LD6__LD6 0x0
157 MX27_PAD_LD7__LD7 0x0
158 MX27_PAD_LD8__LD8 0x0
159 MX27_PAD_LD9__LD9 0x0
160 MX27_PAD_LD10__LD10 0x0
161 MX27_PAD_LD11__LD11 0x0
162 MX27_PAD_LD12__LD12 0x0
163 MX27_PAD_LD13__LD13 0x0
164 MX27_PAD_LD14__LD14 0x0
165 MX27_PAD_LD15__LD15 0x0
166 MX27_PAD_LD16__LD16 0x0
167 MX27_PAD_LD17__LD17 0x0
168 MX27_PAD_LSCLK__LSCLK 0x0
169 MX27_PAD_OE_ACD__OE_ACD 0x0
170 MX27_PAD_PS__PS 0x0
171 MX27_PAD_REV__REV 0x0
172 MX27_PAD_SPL_SPR__SPL_SPR 0x0
173 MX27_PAD_HSYNC__HSYNC 0x0
174 MX27_PAD_VSYNC__VSYNC 0x0
175 >;
176 };
177
178 pinctrl_i2c1: i2c1grp {
179 fsl,pins = <
180 MX27_PAD_I2C_DATA__I2C_DATA 0x0
181 MX27_PAD_I2C_CLK__I2C_CLK 0x0
182 >;
183 };
184
185 pinctrl_i2c2: i2c2grp {
186 fsl,pins = <
187 MX27_PAD_I2C2_SDA__I2C2_SDA 0x0
188 MX27_PAD_I2C2_SCL__I2C2_SCL 0x0
189 >;
190 };
191
192 pinctrl_pwm: pwmgrp {
193 fsl,pins = <
194 MX27_PAD_PWMO__PWMO 0x0
195 >;
196 };
197
198 pinctrl_sdhc2: sdhc2grp {
199 fsl,pins = <
200 MX27_PAD_SD2_CLK__SD2_CLK 0x0
201 MX27_PAD_SD2_CMD__SD2_CMD 0x0
202 MX27_PAD_SD2_D0__SD2_D0 0x0
203 MX27_PAD_SD2_D1__SD2_D1 0x0
204 MX27_PAD_SD2_D2__SD2_D2 0x0
205 MX27_PAD_SD2_D3__SD2_D3 0x0
206 >;
207 };
208
209 pinctrl_sdhc2_cd: sdhc2cdgrp {
210 fsl,pins = <MX27_PAD_TOUT__GPIO3_14 0x0>;
211 };
212 };
213};
214
215&sdhci2 {
216 bus-width = <4>;
217 cd-gpios = <&gpio3 14 GPIO_ACTIVE_HIGH>;
218 pinctrl-names = "default";
219 pinctrl-0 = <&pinctrl_sdhc2 &pinctrl_sdhc2_cd>;
220 status = "okay";
221};
222
223&pwm {
224 pinctrl-names = "default";
225 pinctrl-0 = <&pinctrl_pwm>;
226};
diff --git a/arch/arm/boot/dts/imx27-phytec-phycard-s-rdk.dts b/arch/arm/boot/dts/imx27-phytec-phycard-s-rdk.dts
index 5a31c776513f..3c3964a99637 100644
--- a/arch/arm/boot/dts/imx27-phytec-phycard-s-rdk.dts
+++ b/arch/arm/boot/dts/imx27-phytec-phycard-s-rdk.dts
@@ -9,7 +9,7 @@
9 * http://www.gnu.org/copyleft/gpl.html 9 * http://www.gnu.org/copyleft/gpl.html
10 */ 10 */
11 11
12#include "imx27-phytec-phycard-s-som.dts" 12#include "imx27-phytec-phycard-s-som.dtsi"
13 13
14/ { 14/ {
15 model = "Phytec pca100 rapid development kit"; 15 model = "Phytec pca100 rapid development kit";
@@ -37,9 +37,12 @@
37 37
38 regulators { 38 regulators {
39 compatible = "simple-bus"; 39 compatible = "simple-bus";
40 #address-cells = <1>;
41 #size-cells = <0>;
40 42
41 reg_3v3: 3v3 { 43 reg_3v3: regulator@0 {
42 compatible = "regulator-fixed"; 44 compatible = "regulator-fixed";
45 reg = <0>;
43 regulator-name = "3V3"; 46 regulator-name = "3V3";
44 regulator-min-microvolt = <3300000>; 47 regulator-min-microvolt = <3300000>;
45 regulator-max-microvolt = <3300000>; 48 regulator-max-microvolt = <3300000>;
@@ -54,6 +57,8 @@
54}; 57};
55 58
56&i2c1 { 59&i2c1 {
60 pinctrl-names = "default";
61 pinctrl-0 = <&pinctrl_i2c1>;
57 status = "okay"; 62 status = "okay";
58 63
59 rtc@51 { 64 rtc@51 {
@@ -68,26 +73,92 @@
68 }; 73 };
69}; 74};
70 75
76&iomuxc {
77 imx27-phycard-s-rdk {
78 pinctrl_i2c1: i2c1grp {
79 fsl,pins = <
80 MX27_PAD_I2C2_SDA__I2C2_SDA 0x0
81 MX27_PAD_I2C2_SCL__I2C2_SCL 0x0
82 >;
83 };
84
85 pinctrl_owire1: owire1grp {
86 fsl,pins = <
87 MX27_PAD_RTCK__OWIRE 0x0
88 >;
89 };
90
91 pinctrl_sdhc2: sdhc2grp {
92 fsl,pins = <
93 MX27_PAD_SD2_CLK__SD2_CLK 0x0
94 MX27_PAD_SD2_CMD__SD2_CMD 0x0
95 MX27_PAD_SD2_D0__SD2_D0 0x0
96 MX27_PAD_SD2_D1__SD2_D1 0x0
97 MX27_PAD_SD2_D2__SD2_D2 0x0
98 MX27_PAD_SD2_D3__SD2_D3 0x0
99 MX27_PAD_SSI3_RXDAT__GPIO3_29 0x0 /* CD */
100 >;
101 };
102
103 pinctrl_uart1: uart1grp {
104 fsl,pins = <
105 MX27_PAD_UART1_TXD__UART1_TXD 0x0
106 MX27_PAD_UART1_RXD__UART1_RXD 0x0
107 MX27_PAD_UART1_CTS__UART1_CTS 0x0
108 MX27_PAD_UART1_RTS__UART1_RTS 0x0
109 >;
110 };
111
112 pinctrl_uart2: uart2grp {
113 fsl,pins = <
114 MX27_PAD_UART2_TXD__UART2_TXD 0x0
115 MX27_PAD_UART2_RXD__UART2_RXD 0x0
116 MX27_PAD_UART2_CTS__UART2_CTS 0x0
117 MX27_PAD_UART2_RTS__UART2_RTS 0x0
118 >;
119 };
120
121 pinctrl_uart3: uart3grp {
122 fsl,pins = <
123 MX27_PAD_UART3_TXD__UART3_TXD 0x0
124 MX27_PAD_UART3_RXD__UART3_RXD 0x0
125 MX27_PAD_UART3_CTS__UART3_CTS 0x0
126 MX27_PAD_UART3_RTS__UART3_RTS 0x0
127 >;
128 };
129 };
130};
131
71&owire { 132&owire {
133 pinctrl-names = "default";
134 pinctrl-0 = <&pinctrl_owire1>;
72 status = "okay"; 135 status = "okay";
73}; 136};
74 137
75&sdhci2 { 138&sdhci2 {
76 cd-gpios = <&gpio3 29 0>; 139 pinctrl-names = "default";
140 pinctrl-0 = <&pinctrl_sdhc2>;
141 cd-gpios = <&gpio3 29 GPIO_ACTIVE_HIGH>;
77 status = "okay"; 142 status = "okay";
78}; 143};
79 144
80&uart1 { 145&uart1 {
81 fsl,uart-has-rtscts; 146 fsl,uart-has-rtscts;
147 pinctrl-names = "default";
148 pinctrl-0 = <&pinctrl_uart1>;
82 status = "okay"; 149 status = "okay";
83}; 150};
84 151
85&uart2 { 152&uart2 {
86 fsl,uart-has-rtscts; 153 fsl,uart-has-rtscts;
154 pinctrl-names = "default";
155 pinctrl-0 = <&pinctrl_uart2>;
87 status = "okay"; 156 status = "okay";
88}; 157};
89 158
90&uart3 { 159&uart3 {
91 fsl,uart-has-rtscts; 160 fsl,uart-has-rtscts;
161 pinctrl-names = "default";
162 pinctrl-0 = <&pinctrl_uart3>;
92 status = "okay"; 163 status = "okay";
93}; 164};
diff --git a/arch/arm/boot/dts/imx27-phytec-phycard-s-som.dts b/arch/arm/boot/dts/imx27-phytec-phycard-s-som.dts
deleted file mode 100644
index c8d57d1d0743..000000000000
--- a/arch/arm/boot/dts/imx27-phytec-phycard-s-som.dts
+++ /dev/null
@@ -1,44 +0,0 @@
1/*
2 * Copyright 2012 Sascha Hauer, Uwe Kleine-König, Steffen Trumtrar
3 * and Markus Pargmann, Pengutronix
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/dts-v1/;
14#include "imx27.dtsi"
15
16/ {
17 model = "Phytec pca100";
18 compatible = "phytec,imx27-pca100", "fsl,imx27";
19
20 memory {
21 reg = <0xa0000000 0x08000000>; /* 128MB */
22 };
23};
24
25&cspi1 {
26 fsl,spi-num-chipselects = <2>;
27 cs-gpios = <&gpio4 28 0>,
28 <&gpio4 27 0>;
29 status = "okay";
30};
31
32&fec {
33 status = "okay";
34};
35
36&i2c2 {
37 status = "okay";
38
39 at24@52 {
40 compatible = "at,24c32";
41 pagesize = <32>;
42 reg = <0x52>;
43 };
44};
diff --git a/arch/arm/boot/dts/imx27-phytec-phycard-s-som.dtsi b/arch/arm/boot/dts/imx27-phytec-phycard-s-som.dtsi
new file mode 100644
index 000000000000..1b6248079682
--- /dev/null
+++ b/arch/arm/boot/dts/imx27-phytec-phycard-s-som.dtsi
@@ -0,0 +1,103 @@
1/*
2 * Copyright 2012 Sascha Hauer, Uwe Kleine-König, Steffen Trumtrar
3 * and Markus Pargmann, Pengutronix
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/dts-v1/;
14#include "imx27.dtsi"
15
16/ {
17 model = "Phytec pca100";
18 compatible = "phytec,imx27-pca100", "fsl,imx27";
19
20 memory {
21 reg = <0xa0000000 0x08000000>; /* 128MB */
22 };
23};
24
25&cspi1 {
26 fsl,spi-num-chipselects = <2>;
27 cs-gpios = <&gpio4 28 GPIO_ACTIVE_HIGH>,
28 <&gpio4 27 GPIO_ACTIVE_HIGH>;
29 status = "okay";
30};
31
32&fec {
33 pinctrl-names = "default";
34 pinctrl-0 = <&pinctrl_fec1>;
35 status = "okay";
36};
37
38&i2c2 {
39 pinctrl-names = "default";
40 pinctrl-0 = <&pinctrl_i2c2>;
41 status = "okay";
42
43 at24@52 {
44 compatible = "at,24c32";
45 pagesize = <32>;
46 reg = <0x52>;
47 };
48};
49
50&iomuxc {
51 imx27-phycard-s-som {
52 pinctrl_fec1: fec1grp {
53 fsl,pins = <
54 MX27_PAD_SD3_CMD__FEC_TXD0 0x0
55 MX27_PAD_SD3_CLK__FEC_TXD1 0x0
56 MX27_PAD_ATA_DATA0__FEC_TXD2 0x0
57 MX27_PAD_ATA_DATA1__FEC_TXD3 0x0
58 MX27_PAD_ATA_DATA2__FEC_RX_ER 0x0
59 MX27_PAD_ATA_DATA3__FEC_RXD1 0x0
60 MX27_PAD_ATA_DATA4__FEC_RXD2 0x0
61 MX27_PAD_ATA_DATA5__FEC_RXD3 0x0
62 MX27_PAD_ATA_DATA6__FEC_MDIO 0x0
63 MX27_PAD_ATA_DATA7__FEC_MDC 0x0
64 MX27_PAD_ATA_DATA8__FEC_CRS 0x0
65 MX27_PAD_ATA_DATA9__FEC_TX_CLK 0x0
66 MX27_PAD_ATA_DATA10__FEC_RXD0 0x0
67 MX27_PAD_ATA_DATA11__FEC_RX_DV 0x0
68 MX27_PAD_ATA_DATA12__FEC_RX_CLK 0x0
69 MX27_PAD_ATA_DATA13__FEC_COL 0x0
70 MX27_PAD_ATA_DATA14__FEC_TX_ER 0x0
71 MX27_PAD_ATA_DATA15__FEC_TX_EN 0x0
72 >;
73 };
74
75 pinctrl_i2c2: i2c2grp {
76 fsl,pins = <
77 MX27_PAD_I2C2_SDA__I2C2_SDA 0x0
78 MX27_PAD_I2C2_SCL__I2C2_SCL 0x0
79 >;
80 };
81
82 pinctrl_nfc: nfcgrp {
83 fsl,pins = <
84 MX27_PAD_NFRB__NFRB 0x0
85 MX27_PAD_NFCLE__NFCLE 0x0
86 MX27_PAD_NFWP_B__NFWP_B 0x0
87 MX27_PAD_NFCE_B__NFCE_B 0x0
88 MX27_PAD_NFALE__NFALE 0x0
89 MX27_PAD_NFRE_B__NFRE_B 0x0
90 MX27_PAD_NFWE_B__NFWE_B 0x0
91 >;
92 };
93 };
94};
95
96&nfc {
97 pinctrl-names = "default";
98 pinctrl-0 = <&pinctrl_nfc>;
99 nand-bus-width = <8>;
100 nand-ecc-mode = "hw";
101 nand-on-flash-bbt;
102 status = "okay";
103};
diff --git a/arch/arm/boot/dts/imx27-phytec-phycore-rdk.dts b/arch/arm/boot/dts/imx27-phytec-phycore-rdk.dts
index 0fc6551786c6..df3b2e731835 100644
--- a/arch/arm/boot/dts/imx27-phytec-phycore-rdk.dts
+++ b/arch/arm/boot/dts/imx27-phytec-phycore-rdk.dts
@@ -7,7 +7,7 @@
7 * http://www.gnu.org/copyleft/gpl.html 7 * http://www.gnu.org/copyleft/gpl.html
8 */ 8 */
9 9
10#include "imx27-phytec-phycore-som.dts" 10#include "imx27-phytec-phycore-som.dtsi"
11 11
12/ { 12/ {
13 model = "Phytec pcm970"; 13 model = "Phytec pcm970";
@@ -16,32 +16,200 @@
16 16
17&cspi1 { 17&cspi1 {
18 fsl,spi-num-chipselects = <2>; 18 fsl,spi-num-chipselects = <2>;
19 cs-gpios = <&gpio4 28 0>, <&gpio4 27 0>; 19 cs-gpios = <&gpio4 28 GPIO_ACTIVE_HIGH>,
20 <&gpio4 27 GPIO_ACTIVE_LOW>;
21};
22
23&i2c1 {
24 clock-frequency = <400000>;
25 pinctrl-names = "default";
26 pinctrl-0 = <&pinctrl_i2c1>;
27 status = "okay";
28
29 camgpio: pca9536@41 {
30 compatible = "nxp,pca9536";
31 reg = <0x41>;
32 gpio-controller;
33 #gpio-cells = <2>;
34 };
35};
36
37&iomuxc {
38 imx27_phycore_rdk {
39 pinctrl_i2c1: i2c1grp {
40 /* Add pullup to DATA line */
41 fsl,pins = <
42 MX27_PAD_I2C_DATA__I2C_DATA 0x1
43 MX27_PAD_I2C_CLK__I2C_CLK 0x0
44 >;
45 };
46
47 pinctrl_owire1: owire1grp {
48 fsl,pins = <
49 MX27_PAD_RTCK__OWIRE 0x0
50 >;
51 };
52
53 pinctrl_sdhc2: sdhc2grp {
54 fsl,pins = <
55 MX27_PAD_SD2_CLK__SD2_CLK 0x0
56 MX27_PAD_SD2_CMD__SD2_CMD 0x0
57 MX27_PAD_SD2_D0__SD2_D0 0x0
58 MX27_PAD_SD2_D1__SD2_D1 0x0
59 MX27_PAD_SD2_D2__SD2_D2 0x0
60 MX27_PAD_SD2_D3__SD2_D3 0x0
61 MX27_PAD_SSI3_FS__GPIO3_28 0x0 /* WP */
62 MX27_PAD_SSI3_RXDAT__GPIO3_29 0x0 /* CD */
63 >;
64 };
65
66 pinctrl_uart1: uart1grp {
67 fsl,pins = <
68 MX27_PAD_UART1_TXD__UART1_TXD 0x0
69 MX27_PAD_UART1_RXD__UART1_RXD 0x0
70 MX27_PAD_UART1_CTS__UART1_CTS 0x0
71 MX27_PAD_UART1_RTS__UART1_RTS 0x0
72 >;
73 };
74
75 pinctrl_uart2: uart2grp {
76 fsl,pins = <
77 MX27_PAD_UART2_TXD__UART2_TXD 0x0
78 MX27_PAD_UART2_RXD__UART2_RXD 0x0
79 MX27_PAD_UART2_CTS__UART2_CTS 0x0
80 MX27_PAD_UART2_RTS__UART2_RTS 0x0
81 >;
82 };
83
84 pinctrl_usbh2: usbh2grp {
85 fsl,pins = <
86 MX27_PAD_USBH2_CLK__USBH2_CLK 0x0
87 MX27_PAD_USBH2_DIR__USBH2_DIR 0x0
88 MX27_PAD_USBH2_NXT__USBH2_NXT 0x0
89 MX27_PAD_USBH2_STP__USBH2_STP 0x0
90 MX27_PAD_CSPI2_SCLK__USBH2_DATA0 0x0
91 MX27_PAD_CSPI2_MOSI__USBH2_DATA1 0x0
92 MX27_PAD_CSPI2_MISO__USBH2_DATA2 0x0
93 MX27_PAD_CSPI2_SS1__USBH2_DATA3 0x0
94 MX27_PAD_CSPI2_SS2__USBH2_DATA4 0x0
95 MX27_PAD_CSPI1_SS2__USBH2_DATA5 0x0
96 MX27_PAD_CSPI2_SS0__USBH2_DATA6 0x0
97 MX27_PAD_USBH2_DATA7__USBH2_DATA7 0x0
98 >;
99 };
100
101 pinctrl_weim: weimgrp {
102 fsl,pins = <
103 MX27_PAD_CS4_B__CS4_B 0x0 /* CS4 */
104 MX27_PAD_SD1_D1__GPIO5_19 0x0 /* CAN IRQ */
105 >;
106 };
107 };
108};
109
110&owire {
111 pinctrl-names = "default";
112 pinctrl-0 = <&pinctrl_owire1>;
113 status = "okay";
114};
115
116&pmicleds {
117 ledr1: led@3 {
118 reg = <3>;
119 label = "system:red1:user";
120 };
121
122 ledg1: led@4 {
123 reg = <4>;
124 label = "system:green1:user";
125 };
126
127 ledb1: led@5 {
128 reg = <5>;
129 label = "system:blue1:user";
130 };
131
132 ledr2: led@6 {
133 reg = <6>;
134 label = "system:red2:user";
135 };
136
137 ledg2: led@7 {
138 reg = <7>;
139 label = "system:green2:user";
140 };
141
142 ledb2: led@8 {
143 reg = <8>;
144 label = "system:blue2:user";
145 };
146
147 ledr3: led@9 {
148 reg = <9>;
149 label = "system:red3:nand";
150 linux,default-trigger = "nand-disk";
151 };
152
153 ledg3: led@10 {
154 reg = <10>;
155 label = "system:green3:live";
156 linux,default-trigger = "heartbeat";
157 };
158
159 ledb3: led@11 {
160 reg = <11>;
161 label = "system:blue3:cpu";
162 linux,default-trigger = "cpu0";
163 };
20}; 164};
21 165
22&sdhci2 { 166&sdhci2 {
167 pinctrl-names = "default";
168 pinctrl-0 = <&pinctrl_sdhc2>;
23 bus-width = <4>; 169 bus-width = <4>;
24 cd-gpios = <&gpio3 29 0>; 170 cd-gpios = <&gpio3 29 GPIO_ACTIVE_HIGH>;
25 wp-gpios = <&gpio3 28 0>; 171 wp-gpios = <&gpio3 28 GPIO_ACTIVE_HIGH>;
26 vmmc-supply = <&vmmc1_reg>; 172 vmmc-supply = <&vmmc1_reg>;
27 status = "okay"; 173 status = "okay";
28}; 174};
29 175
30&uart1 { 176&uart1 {
31 fsl,uart-has-rtscts; 177 fsl,uart-has-rtscts;
178 pinctrl-names = "default";
179 pinctrl-0 = <&pinctrl_uart1>;
180 status = "okay";
32}; 181};
33 182
34&uart2 { 183&uart2 {
35 fsl,uart-has-rtscts; 184 fsl,uart-has-rtscts;
185 pinctrl-names = "default";
186 pinctrl-0 = <&pinctrl_uart2>;
187 status = "okay";
188};
189
190&usbh2 {
191 pinctrl-names = "default";
192 pinctrl-0 = <&pinctrl_usbh2>;
193 dr_mode = "host";
194 phy_type = "ulpi";
195 vbus-supply = <&reg_5v0>;
196 disable-over-current;
36 status = "okay"; 197 status = "okay";
37}; 198};
38 199
200&usbphy2 {
201 vcc-supply = <&reg_5v0>;
202};
203
39&weim { 204&weim {
205 pinctrl-names = "default";
206 pinctrl-0 = <&pinctrl_weim>;
207
40 can@d4000000 { 208 can@d4000000 {
41 compatible = "nxp,sja1000"; 209 compatible = "nxp,sja1000";
42 reg = <4 0x00000000 0x00000100>; 210 reg = <4 0x00000000 0x00000100>;
43 interrupt-parent = <&gpio5>; 211 interrupt-parent = <&gpio5>;
44 interrupts = <19 0x2>; 212 interrupts = <19 IRQ_TYPE_EDGE_FALLING>;
45 nxp,external-clock-frequency = <16000000>; 213 nxp,external-clock-frequency = <16000000>;
46 nxp,tx-output-config = <0x16>; 214 nxp,tx-output-config = <0x16>;
47 nxp,no-comparator-bypass; 215 nxp,no-comparator-bypass;
diff --git a/arch/arm/boot/dts/imx27-phytec-phycore-som.dts b/arch/arm/boot/dts/imx27-phytec-phycore-som.dtsi
index 4ec402c38945..cefaa6994623 100644
--- a/arch/arm/boot/dts/imx27-phytec-phycore-som.dts
+++ b/arch/arm/boot/dts/imx27-phytec-phycore-som.dtsi
@@ -19,6 +19,28 @@
19 memory { 19 memory {
20 reg = <0xa0000000 0x08000000>; 20 reg = <0xa0000000 0x08000000>;
21 }; 21 };
22
23 regulators {
24 compatible = "simple-bus";
25 #address-cells = <1>;
26 #size-cells = <0>;
27
28 reg_3v3: regulator@0 {
29 compatible = "regulator-fixed";
30 reg = <0>;
31 regulator-name = "3V3";
32 regulator-min-microvolt = <3300000>;
33 regulator-max-microvolt = <3300000>;
34 };
35
36 reg_5v0: regulator@1 {
37 compatible = "regulator-fixed";
38 reg = <1>;
39 regulator-name = "5V0";
40 regulator-min-microvolt = <5000000>;
41 regulator-max-microvolt = <5000000>;
42 };
43 };
22}; 44};
23 45
24&audmux { 46&audmux {
@@ -37,21 +59,30 @@
37}; 59};
38 60
39&cspi1 { 61&cspi1 {
62 pinctrl-names = "default";
63 pinctrl-0 = <&pinctrl_cspi1>;
40 fsl,spi-num-chipselects = <1>; 64 fsl,spi-num-chipselects = <1>;
41 cs-gpios = <&gpio4 28 0>; 65 cs-gpios = <&gpio4 28 GPIO_ACTIVE_HIGH>;
42 status = "okay"; 66 status = "okay";
43 67
44 pmic: mc13783@0 { 68 pmic: mc13783@0 {
45 #address-cells = <1>; 69 #address-cells = <1>;
46 #size-cells = <0>; 70 #size-cells = <0>;
47 compatible = "fsl,mc13783"; 71 compatible = "fsl,mc13783";
48 spi-max-frequency = <20000000>;
49 reg = <0>; 72 reg = <0>;
73 spi-cs-high;
74 spi-max-frequency = <20000000>;
50 interrupt-parent = <&gpio2>; 75 interrupt-parent = <&gpio2>;
51 interrupts = <23 0x4>; 76 interrupts = <23 IRQ_TYPE_LEVEL_HIGH>;
52 fsl,mc13xxx-uses-adc; 77 fsl,mc13xxx-uses-adc;
53 fsl,mc13xxx-uses-rtc; 78 fsl,mc13xxx-uses-rtc;
54 79
80 pmicleds: leds {
81 #address-cells = <1>;
82 #size-cells = <0>;
83 led-control = <0x001 0x000 0x000 0x000 0x000 0x000>;
84 };
85
55 regulators { 86 regulators {
56 /* SW1A and SW1B joined operation */ 87 /* SW1A and SW1B joined operation */
57 sw1_reg: sw1a { 88 sw1_reg: sw1a {
@@ -134,12 +165,18 @@
134}; 165};
135 166
136&fec { 167&fec {
137 phy-reset-gpios = <&gpio3 30 0>; 168 phy-mode = "mii";
169 phy-reset-gpios = <&gpio3 30 GPIO_ACTIVE_HIGH>;
170 phy-supply = <&reg_3v3>;
171 pinctrl-names = "default";
172 pinctrl-0 = <&pinctrl_fec1>;
138 status = "okay"; 173 status = "okay";
139}; 174};
140 175
141&i2c2 { 176&i2c2 {
142 clock-frequency = <400000>; 177 clock-frequency = <400000>;
178 pinctrl-names = "default";
179 pinctrl-0 = <&pinctrl_i2c2>;
143 status = "okay"; 180 status = "okay";
144 181
145 at24@52 { 182 at24@52 {
@@ -159,16 +196,102 @@
159 }; 196 };
160}; 197};
161 198
199&iomuxc {
200 imx27_phycore_som {
201 pinctrl_cspi1: cspi1grp {
202 fsl,pins = <
203 MX27_PAD_CSPI1_MISO__CSPI1_MISO 0x0
204 MX27_PAD_CSPI1_MOSI__CSPI1_MOSI 0x0
205 MX27_PAD_CSPI1_SCLK__CSPI1_SCLK 0x0
206 MX27_PAD_CSPI1_SS0__GPIO4_28 0x0 /* SPI1 CS0 */
207 MX27_PAD_USB_PWR__GPIO2_23 0x0 /* PMIC IRQ */
208 >;
209 };
210
211 pinctrl_fec1: fec1grp {
212 fsl,pins = <
213 MX27_PAD_SD3_CMD__FEC_TXD0 0x0
214 MX27_PAD_SD3_CLK__FEC_TXD1 0x0
215 MX27_PAD_ATA_DATA0__FEC_TXD2 0x0
216 MX27_PAD_ATA_DATA1__FEC_TXD3 0x0
217 MX27_PAD_ATA_DATA2__FEC_RX_ER 0x0
218 MX27_PAD_ATA_DATA3__FEC_RXD1 0x0
219 MX27_PAD_ATA_DATA4__FEC_RXD2 0x0
220 MX27_PAD_ATA_DATA5__FEC_RXD3 0x0
221 MX27_PAD_ATA_DATA6__FEC_MDIO 0x0
222 MX27_PAD_ATA_DATA7__FEC_MDC 0x0
223 MX27_PAD_ATA_DATA8__FEC_CRS 0x0
224 MX27_PAD_ATA_DATA9__FEC_TX_CLK 0x0
225 MX27_PAD_ATA_DATA10__FEC_RXD0 0x0
226 MX27_PAD_ATA_DATA11__FEC_RX_DV 0x0
227 MX27_PAD_ATA_DATA12__FEC_RX_CLK 0x0
228 MX27_PAD_ATA_DATA13__FEC_COL 0x0
229 MX27_PAD_ATA_DATA14__FEC_TX_ER 0x0
230 MX27_PAD_ATA_DATA15__FEC_TX_EN 0x0
231 MX27_PAD_SSI3_TXDAT__GPIO3_30 0x0 /* FEC RST */
232 >;
233 };
234
235 pinctrl_i2c2: i2c2grp {
236 fsl,pins = <
237 MX27_PAD_I2C2_SDA__I2C2_SDA 0x0
238 MX27_PAD_I2C2_SCL__I2C2_SCL 0x0
239 >;
240 };
241
242 pinctrl_nfc: nfcgrp {
243 fsl,pins = <
244 MX27_PAD_NFRB__NFRB 0x0
245 MX27_PAD_NFCLE__NFCLE 0x0
246 MX27_PAD_NFWP_B__NFWP_B 0x0
247 MX27_PAD_NFCE_B__NFCE_B 0x0
248 MX27_PAD_NFALE__NFALE 0x0
249 MX27_PAD_NFRE_B__NFRE_B 0x0
250 MX27_PAD_NFWE_B__NFWE_B 0x0
251 >;
252 };
253
254 pinctrl_usbotg: usbotggrp {
255 fsl,pins = <
256 MX27_PAD_USBOTG_CLK__USBOTG_CLK 0x0
257 MX27_PAD_USBOTG_DIR__USBOTG_DIR 0x0
258 MX27_PAD_USBOTG_NXT__USBOTG_NXT 0x0
259 MX27_PAD_USBOTG_STP__USBOTG_STP 0x0
260 MX27_PAD_USBOTG_DATA0__USBOTG_DATA0 0x0
261 MX27_PAD_USBOTG_DATA1__USBOTG_DATA1 0x0
262 MX27_PAD_USBOTG_DATA2__USBOTG_DATA2 0x0
263 MX27_PAD_USBOTG_DATA3__USBOTG_DATA3 0x0
264 MX27_PAD_USBOTG_DATA4__USBOTG_DATA4 0x0
265 MX27_PAD_USBOTG_DATA5__USBOTG_DATA5 0x0
266 MX27_PAD_USBOTG_DATA6__USBOTG_DATA6 0x0
267 MX27_PAD_USBOTG_DATA7__USBOTG_DATA7 0x0
268 >;
269 };
270 };
271};
272
162&nfc { 273&nfc {
274 pinctrl-names = "default";
275 pinctrl-0 = <&pinctrl_nfc>;
163 nand-bus-width = <8>; 276 nand-bus-width = <8>;
164 nand-ecc-mode = "hw"; 277 nand-ecc-mode = "hw";
278 nand-on-flash-bbt;
165 status = "okay"; 279 status = "okay";
166}; 280};
167 281
168&uart1 { 282&usbotg {
283 pinctrl-names = "default";
284 pinctrl-0 = <&pinctrl_usbotg>;
285 dr_mode = "otg";
286 phy_type = "ulpi";
287 vbus-supply = <&sw3_reg>;
169 status = "okay"; 288 status = "okay";
170}; 289};
171 290
291&usbphy0 {
292 vcc-supply = <&sw3_reg>;
293};
294
172&weim { 295&weim {
173 status = "okay"; 296 status = "okay";
174 297
diff --git a/arch/arm/boot/dts/imx27-pinfunc.h b/arch/arm/boot/dts/imx27-pinfunc.h
new file mode 100644
index 000000000000..f5387b4de577
--- /dev/null
+++ b/arch/arm/boot/dts/imx27-pinfunc.h
@@ -0,0 +1,526 @@
1/*
2 * Copyright 2013 Markus Pargmann <mpa@pengutronix.de>, Pengutronix
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 __DTS_IMX27_PINFUNC_H
13#define __DTS_IMX27_PINFUNC_H
14
15/*
16 * The pin function ID is a tuple of
17 * <pin mux_id>
18 * mux_id consists of
19 * function + (direction << 2) + (gpio_oconf << 4) + (gpio_iconfa << 8) + (gpio_iconfb << 10)
20 *
21 * function: 0 - Primary function
22 * 1 - Alternate function
23 * 2 - GPIO
24 * direction: 0 - Input
25 * 1 - Output
26 * gpio_oconf: 0 - A_IN
27 * 1 - B_IN
28 * 2 - C_IN
29 * 3 - Data Register
30 * gpio_iconfa/b: 0 - GPIO_IN
31 * 1 - Interrupt Status Register
32 * 2 - 0
33 * 3 - 1
34 *
35 * 'pin' is an integer between 0 and 0xbf. imx27 has 6 ports with 32 configurable
36 * configurable pins each. 'pin' is PORT * 32 + PORT_PIN, PORT_PIN is the pin
37 * number on the specific port (between 0 and 31).
38 */
39
40#define MX27_PAD_USBH2_CLK__USBH2_CLK 0x00 0x000
41#define MX27_PAD_USBH2_CLK__GPIO1_0 0x00 0x032
42#define MX27_PAD_USBH2_DIR__USBH2_DIR 0x01 0x000
43#define MX27_PAD_USBH2_DIR__GPIO1_1 0x01 0x032
44#define MX27_PAD_USBH2_DATA7__USBH2_DATA7 0x02 0x004
45#define MX27_PAD_USBH2_DATA7__GPIO1_2 0x02 0x032
46#define MX27_PAD_USBH2_NXT__USBH2_NXT 0x03 0x000
47#define MX27_PAD_USBH2_NXT__GPIO1_3 0x03 0x032
48#define MX27_PAD_USBH2_STP__USBH2_STP 0x04 0x004
49#define MX27_PAD_USBH2_STP__GPIO1_4 0x04 0x032
50#define MX27_PAD_LSCLK__LSCLK 0x05 0x004
51#define MX27_PAD_LSCLK__GPIO1_5 0x05 0x032
52#define MX27_PAD_LD0__LD0 0x06 0x004
53#define MX27_PAD_LD0__GPIO1_6 0x06 0x032
54#define MX27_PAD_LD1__LD1 0x07 0x004
55#define MX27_PAD_LD1__GPIO1_7 0x07 0x032
56#define MX27_PAD_LD2__LD2 0x08 0x004
57#define MX27_PAD_LD2__GPIO1_8 0x08 0x032
58#define MX27_PAD_LD3__LD3 0x09 0x004
59#define MX27_PAD_LD3__GPIO1_9 0x09 0x032
60#define MX27_PAD_LD4__LD4 0x0a 0x004
61#define MX27_PAD_LD4__GPIO1_10 0x0a 0x032
62#define MX27_PAD_LD5__LD5 0x0b 0x004
63#define MX27_PAD_LD5__GPIO1_11 0x0b 0x032
64#define MX27_PAD_LD6__LD6 0x0c 0x004
65#define MX27_PAD_LD6__GPIO1_12 0x0c 0x032
66#define MX27_PAD_LD7__LD7 0x0d 0x004
67#define MX27_PAD_LD7__GPIO1_13 0x0d 0x032
68#define MX27_PAD_LD8__LD8 0x0e 0x004
69#define MX27_PAD_LD8__GPIO1_14 0x0e 0x032
70#define MX27_PAD_LD9__LD9 0x0f 0x004
71#define MX27_PAD_LD9__GPIO1_15 0x0f 0x032
72#define MX27_PAD_LD10__LD10 0x10 0x004
73#define MX27_PAD_LD10__GPIO1_16 0x10 0x032
74#define MX27_PAD_LD11__LD11 0x11 0x004
75#define MX27_PAD_LD11__GPIO1_17 0x11 0x032
76#define MX27_PAD_LD12__LD12 0x12 0x004
77#define MX27_PAD_LD12__GPIO1_18 0x12 0x032
78#define MX27_PAD_LD13__LD13 0x13 0x004
79#define MX27_PAD_LD13__GPIO1_19 0x13 0x032
80#define MX27_PAD_LD14__LD14 0x14 0x004
81#define MX27_PAD_LD14__GPIO1_20 0x14 0x032
82#define MX27_PAD_LD15__LD15 0x15 0x004
83#define MX27_PAD_LD15__GPIO1_21 0x15 0x032
84#define MX27_PAD_LD16__LD16 0x16 0x004
85#define MX27_PAD_LD16__GPIO1_22 0x16 0x032
86#define MX27_PAD_LD17__LD17 0x17 0x004
87#define MX27_PAD_LD17__GPIO1_23 0x17 0x032
88#define MX27_PAD_REV__REV 0x18 0x004
89#define MX27_PAD_REV__GPIO1_24 0x18 0x032
90#define MX27_PAD_CLS__CLS 0x19 0x004
91#define MX27_PAD_CLS__GPIO1_25 0x19 0x032
92#define MX27_PAD_PS__PS 0x1a 0x004
93#define MX27_PAD_PS__GPIO1_26 0x1a 0x032
94#define MX27_PAD_SPL_SPR__SPL_SPR 0x1b 0x004
95#define MX27_PAD_SPL_SPR__GPIO1_27 0x1b 0x032
96#define MX27_PAD_HSYNC__HSYNC 0x1c 0x004
97#define MX27_PAD_HSYNC__GPIO1_28 0x1c 0x032
98#define MX27_PAD_VSYNC__VSYNC 0x1d 0x004
99#define MX27_PAD_VSYNC__GPIO1_29 0x1d 0x032
100#define MX27_PAD_CONTRAST__CONTRAST 0x1e 0x004
101#define MX27_PAD_CONTRAST__GPIO1_30 0x1e 0x032
102#define MX27_PAD_OE_ACD__OE_ACD 0x1f 0x004
103#define MX27_PAD_OE_ACD__GPIO1_31 0x1f 0x032
104#define MX27_PAD_UNUSED0__UNUSED0 0x20 0x004
105#define MX27_PAD_UNUSED0__GPIO2_0 0x20 0x032
106#define MX27_PAD_UNUSED1__UNUSED1 0x21 0x004
107#define MX27_PAD_UNUSED1__GPIO2_1 0x21 0x032
108#define MX27_PAD_UNUSED2__UNUSED2 0x22 0x004
109#define MX27_PAD_UNUSED2__GPIO2_2 0x22 0x032
110#define MX27_PAD_UNUSED3__UNUSED3 0x23 0x004
111#define MX27_PAD_UNUSED3__GPIO2_3 0x23 0x032
112#define MX27_PAD_SD2_D0__SD2_D0 0x24 0x004
113#define MX27_PAD_SD2_D0__MSHC_DATA0 0x24 0x005
114#define MX27_PAD_SD2_D0__GPIO2_4 0x24 0x032
115#define MX27_PAD_SD2_D1__SD2_D1 0x25 0x004
116#define MX27_PAD_SD2_D1__MSHC_DATA1 0x25 0x005
117#define MX27_PAD_SD2_D1__GPIO2_5 0x25 0x032
118#define MX27_PAD_SD2_D2__SD2_D2 0x26 0x004
119#define MX27_PAD_SD2_D2__MSHC_DATA2 0x26 0x005
120#define MX27_PAD_SD2_D2__GPIO2_6 0x26 0x032
121#define MX27_PAD_SD2_D3__SD2_D3 0x27 0x004
122#define MX27_PAD_SD2_D3__MSHC_DATA3 0x27 0x005
123#define MX27_PAD_SD2_D3__GPIO2_7 0x27 0x032
124#define MX27_PAD_SD2_CMD__SD2_CMD 0x28 0x004
125#define MX27_PAD_SD2_CMD__MSHC_BS 0x28 0x005
126#define MX27_PAD_SD2_CMD__GPIO2_8 0x28 0x032
127#define MX27_PAD_SD2_CLK__SD2_CLK 0x29 0x004
128#define MX27_PAD_SD2_CLK__MSHC_SCLK 0x29 0x005
129#define MX27_PAD_SD2_CLK__GPIO2_9 0x29 0x032
130#define MX27_PAD_CSI_D0__CSI_D0 0x2a 0x000
131#define MX27_PAD_CSI_D0__UART6_TXD 0x2a 0x005
132#define MX27_PAD_CSI_D0__GPIO2_10 0x2a 0x032
133#define MX27_PAD_CSI_D1__CSI_D1 0x2b 0x000
134#define MX27_PAD_CSI_D1__UART6_RXD 0x2b 0x001
135#define MX27_PAD_CSI_D1__GPIO2_11 0x2b 0x032
136#define MX27_PAD_CSI_D2__CSI_D2 0x2c 0x000
137#define MX27_PAD_CSI_D2__UART6_CTS 0x2c 0x005
138#define MX27_PAD_CSI_D2__GPIO2_12 0x2c 0x032
139#define MX27_PAD_CSI_D3__CSI_D3 0x2d 0x000
140#define MX27_PAD_CSI_D3__UART6_RTS 0x2d 0x001
141#define MX27_PAD_CSI_D3__GPIO2_13 0x2d 0x032
142#define MX27_PAD_CSI_D4__CSI_D4 0x2e 0x000
143#define MX27_PAD_CSI_D4__GPIO2_14 0x2e 0x032
144#define MX27_PAD_CSI_MCLK__CSI_MCLK 0x2f 0x004
145#define MX27_PAD_CSI_MCLK__GPIO2_15 0x2f 0x032
146#define MX27_PAD_CSI_PIXCLK__CSI_PIXCLK 0x30 0x000
147#define MX27_PAD_CSI_PIXCLK__GPIO2_16 0x30 0x032
148#define MX27_PAD_CSI_D5__CSI_D5 0x31 0x000
149#define MX27_PAD_CSI_D5__GPIO2_17 0x31 0x032
150#define MX27_PAD_CSI_D6__CSI_D6 0x32 0x000
151#define MX27_PAD_CSI_D6__UART5_TXD 0x32 0x005
152#define MX27_PAD_CSI_D6__GPIO2_18 0x32 0x032
153#define MX27_PAD_CSI_D7__CSI_D7 0x33 0x000
154#define MX27_PAD_CSI_D7__UART5_RXD 0x33 0x001
155#define MX27_PAD_CSI_D7__GPIO2_19 0x33 0x032
156#define MX27_PAD_CSI_VSYNC__CSI_VSYNC 0x34 0x000
157#define MX27_PAD_CSI_VSYNC__UART5_CTS 0x34 0x005
158#define MX27_PAD_CSI_VSYNC__GPIO2_20 0x34 0x032
159#define MX27_PAD_CSI_HSYNC__CSI_HSYNC 0x35 0x000
160#define MX27_PAD_CSI_HSYNC__UART5_RTS 0x35 0x001
161#define MX27_PAD_CSI_HSYNC__GPIO2_21 0x35 0x032
162#define MX27_PAD_USBH1_SUSP__USBH1_SUSP 0x36 0x004
163#define MX27_PAD_USBH1_SUSP__GPIO2_22 0x36 0x032
164#define MX27_PAD_USB_PWR__USB_PWR 0x37 0x004
165#define MX27_PAD_USB_PWR__GPIO2_23 0x37 0x032
166#define MX27_PAD_USB_OC_B__USB_OC_B 0x38 0x000
167#define MX27_PAD_USB_OC_B__GPIO2_24 0x38 0x032
168#define MX27_PAD_USBH1_RCV__USBH1_RCV 0x39 0x004
169#define MX27_PAD_USBH1_RCV__GPIO2_25 0x39 0x032
170#define MX27_PAD_USBH1_FS__USBH1_FS 0x3a 0x004
171#define MX27_PAD_USBH1_FS__UART4_RTS 0x3a 0x001
172#define MX27_PAD_USBH1_FS__GPIO2_26 0x3a 0x032
173#define MX27_PAD_USBH1_OE_B__USBH1_OE_B 0x3b 0x004
174#define MX27_PAD_USBH1_OE_B__GPIO2_27 0x3b 0x032
175#define MX27_PAD_USBH1_TXDM__USBH1_TXDM 0x3c 0x004
176#define MX27_PAD_USBH1_TXDM__UART4_TXD 0x3c 0x005
177#define MX27_PAD_USBH1_TXDM__GPIO2_28 0x3c 0x032
178#define MX27_PAD_USBH1_TXDP__USBH1_TXDP 0x3d 0x004
179#define MX27_PAD_USBH1_TXDP__UART4_CTS 0x3d 0x005
180#define MX27_PAD_USBH1_TXDP__GPIO2_29 0x3d 0x032
181#define MX27_PAD_USBH1_RXDM__USBH1_RXDM 0x3e 0x004
182#define MX27_PAD_USBH1_RXDM__GPIO2_30 0x3e 0x032
183#define MX27_PAD_USBH1_RXDP__USBH1_RXDP 0x3f 0x004
184#define MX27_PAD_USBH1_RXDP__UART4_RXD 0x3f 0x001
185#define MX27_PAD_USBH1_RXDP__GPIO2_31 0x3f 0x032
186#define MX27_PAD_UNUSED4__UNUSED4 0x40 0x004
187#define MX27_PAD_UNUSED4__GPIO3_0 0x40 0x032
188#define MX27_PAD_UNUSED5__UNUSED5 0x41 0x004
189#define MX27_PAD_UNUSED5__GPIO3_1 0x41 0x032
190#define MX27_PAD_UNUSED6__UNUSED6 0x42 0x004
191#define MX27_PAD_UNUSED6__GPIO3_2 0x42 0x032
192#define MX27_PAD_UNUSED7__UNUSED7 0x43 0x004
193#define MX27_PAD_UNUSED7__GPIO3_3 0x43 0x032
194#define MX27_PAD_UNUSED8__UNUSED8 0x44 0x004
195#define MX27_PAD_UNUSED8__GPIO3_4 0x44 0x032
196#define MX27_PAD_I2C2_SDA__I2C2_SDA 0x45 0x004
197#define MX27_PAD_I2C2_SDA__GPIO3_5 0x45 0x032
198#define MX27_PAD_I2C2_SCL__I2C2_SCL 0x46 0x004
199#define MX27_PAD_I2C2_SCL__GPIO3_6 0x46 0x032
200#define MX27_PAD_USBOTG_DATA5__USBOTG_DATA5 0x47 0x004
201#define MX27_PAD_USBOTG_DATA5__GPIO3_7 0x47 0x032
202#define MX27_PAD_USBOTG_DATA6__USBOTG_DATA6 0x48 0x004
203#define MX27_PAD_USBOTG_DATA6__GPIO3_8 0x48 0x032
204#define MX27_PAD_USBOTG_DATA0__USBOTG_DATA0 0x49 0x004
205#define MX27_PAD_USBOTG_DATA0__GPIO3_9 0x49 0x032
206#define MX27_PAD_USBOTG_DATA2__USBOTG_DATA2 0x4a 0x004
207#define MX27_PAD_USBOTG_DATA2__GPIO3_10 0x4a 0x032
208#define MX27_PAD_USBOTG_DATA1__USBOTG_DATA1 0x4b 0x004
209#define MX27_PAD_USBOTG_DATA1__GPIO3_11 0x4b 0x032
210#define MX27_PAD_USBOTG_DATA4__USBOTG_DATA4 0x4c 0x004
211#define MX27_PAD_USBOTG_DATA4__GPIO3_12 0x4c 0x032
212#define MX27_PAD_USBOTG_DATA3__USBOTG_DATA3 0x4d 0x004
213#define MX27_PAD_USBOTG_DATA3__GPIO3_13 0x4d 0x032
214#define MX27_PAD_TOUT__TOUT 0x4e 0x004
215#define MX27_PAD_TOUT__GPIO3_14 0x4e 0x032
216#define MX27_PAD_TIN__TIN 0x4f 0x000
217#define MX27_PAD_TIN__GPIO3_15 0x4f 0x032
218#define MX27_PAD_SSI4_FS__SSI4_FS 0x50 0x004
219#define MX27_PAD_SSI4_FS__GPIO3_16 0x50 0x032
220#define MX27_PAD_SSI4_RXDAT__SSI4_RXDAT 0x51 0x004
221#define MX27_PAD_SSI4_RXDAT__GPIO3_17 0x51 0x032
222#define MX27_PAD_SSI4_TXDAT__SSI4_TXDAT 0x52 0x004
223#define MX27_PAD_SSI4_TXDAT__GPIO3_18 0x52 0x032
224#define MX27_PAD_SSI4_CLK__SSI4_CLK 0x53 0x004
225#define MX27_PAD_SSI4_CLK__GPIO3_19 0x53 0x032
226#define MX27_PAD_SSI1_FS__SSI1_FS 0x54 0x004
227#define MX27_PAD_SSI1_FS__GPIO3_20 0x54 0x032
228#define MX27_PAD_SSI1_RXDAT__SSI1_RXDAT 0x55 0x004
229#define MX27_PAD_SSI1_RXDAT__GPIO3_21 0x55 0x032
230#define MX27_PAD_SSI1_TXDAT__SSI1_TXDAT 0x56 0x004
231#define MX27_PAD_SSI1_TXDAT__GPIO3_22 0x56 0x032
232#define MX27_PAD_SSI1_CLK__SSI1_CLK 0x57 0x004
233#define MX27_PAD_SSI1_CLK__GPIO3_23 0x57 0x032
234#define MX27_PAD_SSI2_FS__SSI2_FS 0x58 0x004
235#define MX27_PAD_SSI2_FS__GPT5_TOUT 0x58 0x005
236#define MX27_PAD_SSI2_FS__GPIO3_24 0x58 0x032
237#define MX27_PAD_SSI2_RXDAT__SSI2_RXDAT 0x59 0x004
238#define MX27_PAD_SSI2_RXDAT__GPTS_TIN 0x59 0x001
239#define MX27_PAD_SSI2_RXDAT__GPIO3_25 0x59 0x032
240#define MX27_PAD_SSI2_TXDAT__SSI2_TXDAT 0x5a 0x004
241#define MX27_PAD_SSI2_TXDAT__GPT4_TOUT 0x5a 0x005
242#define MX27_PAD_SSI2_TXDAT__GPIO3_26 0x5a 0x032
243#define MX27_PAD_SSI2_CLK__SSI2_CLK 0x5b 0x004
244#define MX27_PAD_SSI2_CLK__GPT4_TIN 0x5b 0x001
245#define MX27_PAD_SSI2_CLK__GPIO3_27 0x5b 0x032
246#define MX27_PAD_SSI3_FS__SSI3_FS 0x5c 0x004
247#define MX27_PAD_SSI3_FS__SLCDC2_D0 0x5c 0x001
248#define MX27_PAD_SSI3_FS__GPIO3_28 0x5c 0x032
249#define MX27_PAD_SSI3_RXDAT__SSI3_RXDAT 0x5d 0x004
250#define MX27_PAD_SSI3_RXDAT__SLCDC2_RS 0x5d 0x001
251#define MX27_PAD_SSI3_RXDAT__GPIO3_29 0x5d 0x032
252#define MX27_PAD_SSI3_TXDAT__SSI3_TXDAT 0x5e 0x004
253#define MX27_PAD_SSI3_TXDAT__SLCDC2_CS 0x5e 0x001
254#define MX27_PAD_SSI3_TXDAT__GPIO3_30 0x5e 0x032
255#define MX27_PAD_SSI3_CLK__SSI3_CLK 0x5f 0x004
256#define MX27_PAD_SSI3_CLK__SLCDC2_CLK 0x5f 0x001
257#define MX27_PAD_SSI3_CLK__GPIO3_31 0x5f 0x032
258#define MX27_PAD_SD3_CMD__SD3_CMD 0x60 0x004
259#define MX27_PAD_SD3_CMD__FEC_TXD0 0x60 0x006
260#define MX27_PAD_SD3_CMD__GPIO4_0 0x60 0x032
261#define MX27_PAD_SD3_CLK__SD3_CLK 0x61 0x004
262#define MX27_PAD_SD3_CLK__ETMTRACEPKT15 0x61 0x005
263#define MX27_PAD_SD3_CLK__FEC_TXD1 0x61 0x006
264#define MX27_PAD_SD3_CLK__GPIO4_1 0x61 0x032
265#define MX27_PAD_ATA_DATA0__ATA_DATA0 0x62 0x004
266#define MX27_PAD_ATA_DATA0__SD3_D0 0x62 0x005
267#define MX27_PAD_ATA_DATA0__FEC_TXD2 0x62 0x006
268#define MX27_PAD_ATA_DATA0__GPIO4_2 0x62 0x032
269#define MX27_PAD_ATA_DATA1__ATA_DATA1 0x63 0x004
270#define MX27_PAD_ATA_DATA1__SD3_D1 0x63 0x005
271#define MX27_PAD_ATA_DATA1__FEC_TXD3 0x63 0x006
272#define MX27_PAD_ATA_DATA1__GPIO4_3 0x63 0x032
273#define MX27_PAD_ATA_DATA2__ATA_DATA2 0x64 0x004
274#define MX27_PAD_ATA_DATA2__SD3_D2 0x64 0x005
275#define MX27_PAD_ATA_DATA2__FEC_RX_ER 0x64 0x002
276#define MX27_PAD_ATA_DATA2__GPIO4_4 0x64 0x032
277#define MX27_PAD_ATA_DATA3__ATA_DATA3 0x65 0x004
278#define MX27_PAD_ATA_DATA3__SD3_D3 0x65 0x005
279#define MX27_PAD_ATA_DATA3__FEC_RXD1 0x65 0x002
280#define MX27_PAD_ATA_DATA3__GPIO4_5 0x65 0x032
281#define MX27_PAD_ATA_DATA4__ATA_DATA4 0x66 0x004
282#define MX27_PAD_ATA_DATA4__ETMTRACEPKT14 0x66 0x005
283#define MX27_PAD_ATA_DATA4__FEC_RXD2 0x66 0x002
284#define MX27_PAD_ATA_DATA4__GPIO4_6 0x66 0x032
285#define MX27_PAD_ATA_DATA5__ATA_DATA5 0x67 0x004
286#define MX27_PAD_ATA_DATA5__ETMTRACEPKT13 0x67 0x005
287#define MX27_PAD_ATA_DATA5__FEC_RXD3 0x67 0x002
288#define MX27_PAD_ATA_DATA5__GPIO4_7 0x67 0x032
289#define MX27_PAD_ATA_DATA6__ATA_DATA6 0x68 0x004
290#define MX27_PAD_ATA_DATA6__FEC_MDIO 0x68 0x005
291#define MX27_PAD_ATA_DATA6__GPIO4_8 0x68 0x032
292#define MX27_PAD_ATA_DATA7__ATA_DATA7 0x69 0x004
293#define MX27_PAD_ATA_DATA7__ETMTRACEPKT12 0x69 0x005
294#define MX27_PAD_ATA_DATA7__FEC_MDC 0x69 0x006
295#define MX27_PAD_ATA_DATA7__GPIO4_9 0x69 0x032
296#define MX27_PAD_ATA_DATA8__ATA_DATA8 0x6a 0x004
297#define MX27_PAD_ATA_DATA8__ETMTRACEPKT11 0x6a 0x005
298#define MX27_PAD_ATA_DATA8__FEC_CRS 0x6a 0x002
299#define MX27_PAD_ATA_DATA8__GPIO4_10 0x6a 0x032
300#define MX27_PAD_ATA_DATA9__ATA_DATA9 0x6b 0x004
301#define MX27_PAD_ATA_DATA9__ETMTRACEPKT10 0x6b 0x005
302#define MX27_PAD_ATA_DATA9__FEC_TX_CLK 0x6b 0x002
303#define MX27_PAD_ATA_DATA9__GPIO4_11 0x6b 0x032
304#define MX27_PAD_ATA_DATA10__ATA_DATA10 0x6c 0x004
305#define MX27_PAD_ATA_DATA10__ETMTRACEPKT9 0x6c 0x005
306#define MX27_PAD_ATA_DATA10__FEC_RXD0 0x6c 0x002
307#define MX27_PAD_ATA_DATA10__GPIO4_12 0x6c 0x032
308#define MX27_PAD_ATA_DATA11__ATA_DATA11 0x6d 0x004
309#define MX27_PAD_ATA_DATA11__ETMTRACEPKT8 0x6d 0x005
310#define MX27_PAD_ATA_DATA11__FEC_RX_DV 0x6d 0x002
311#define MX27_PAD_ATA_DATA11__GPIO4_13 0x6d 0x032
312#define MX27_PAD_ATA_DATA12__ATA_DATA12 0x6e 0x004
313#define MX27_PAD_ATA_DATA12__ETMTRACEPKT7 0x6e 0x005
314#define MX27_PAD_ATA_DATA12__FEC_RX_CLK 0x6e 0x002
315#define MX27_PAD_ATA_DATA12__GPIO4_14 0x6e 0x032
316#define MX27_PAD_ATA_DATA13__ATA_DATA13 0x6f 0x004
317#define MX27_PAD_ATA_DATA13__ETMTRACEPKT6 0x6f 0x005
318#define MX27_PAD_ATA_DATA13__FEC_COL 0x6f 0x002
319#define MX27_PAD_ATA_DATA13__GPIO4_15 0x6f 0x032
320#define MX27_PAD_ATA_DATA14__ATA_DATA14 0x70 0x004
321#define MX27_PAD_ATA_DATA14__ETMTRACEPKT5 0x70 0x005
322#define MX27_PAD_ATA_DATA14__FEC_TX_ER 0x70 0x006
323#define MX27_PAD_ATA_DATA14__GPIO4_16 0x70 0x032
324#define MX27_PAD_I2C_DATA__I2C_DATA 0x71 0x004
325#define MX27_PAD_I2C_DATA__GPIO4_17 0x71 0x032
326#define MX27_PAD_I2C_CLK__I2C_CLK 0x72 0x004
327#define MX27_PAD_I2C_CLK__GPIO4_18 0x72 0x032
328#define MX27_PAD_CSPI2_SS2__CSPI2_SS2 0x73 0x004
329#define MX27_PAD_CSPI2_SS2__USBH2_DATA4 0x73 0x005
330#define MX27_PAD_CSPI2_SS2__GPIO4_19 0x73 0x032
331#define MX27_PAD_CSPI2_SS1__CSPI2_SS1 0x74 0x004
332#define MX27_PAD_CSPI2_SS1__USBH2_DATA3 0x74 0x005
333#define MX27_PAD_CSPI2_SS1__GPIO4_20 0x74 0x032
334#define MX27_PAD_CSPI2_SS0__CSPI2_SS0 0x75 0x004
335#define MX27_PAD_CSPI2_SS0__USBH2_DATA6 0x75 0x005
336#define MX27_PAD_CSPI2_SS0__GPIO4_21 0x75 0x032
337#define MX27_PAD_CSPI2_SCLK__CSPI2_SCLK 0x76 0x004
338#define MX27_PAD_CSPI2_SCLK__USBH2_DATA0 0x76 0x005
339#define MX27_PAD_CSPI2_SCLK__GPIO4_22 0x76 0x032
340#define MX27_PAD_CSPI2_MISO__CSPI2_MISO 0x77 0x004
341#define MX27_PAD_CSPI2_MISO__USBH2_DATA2 0x77 0x005
342#define MX27_PAD_CSPI2_MISO__GPIO4_23 0x77 0x032
343#define MX27_PAD_CSPI2_MOSI__CSPI2_MOSI 0x78 0x004
344#define MX27_PAD_CSPI2_MOSI__USBH2_DATA1 0x78 0x005
345#define MX27_PAD_CSPI2_MOSI__GPIO4_24 0x78 0x032
346#define MX27_PAD_CSPI1_RDY__CSPI1_RDY 0x79 0x000
347#define MX27_PAD_CSPI1_RDY__GPIO4_25 0x79 0x032
348#define MX27_PAD_CSPI1_SS2__CSPI1_SS2 0x7a 0x004
349#define MX27_PAD_CSPI1_SS2__USBH2_DATA5 0x7a 0x005
350#define MX27_PAD_CSPI1_SS2__GPIO4_26 0x7a 0x032
351#define MX27_PAD_CSPI1_SS1__CSPI1_SS1 0x7b 0x004
352#define MX27_PAD_CSPI1_SS1__GPIO4_27 0x7b 0x032
353#define MX27_PAD_CSPI1_SS0__CSPI1_SS0 0x7c 0x004
354#define MX27_PAD_CSPI1_SS0__GPIO4_28 0x7c 0x032
355#define MX27_PAD_CSPI1_SCLK__CSPI1_SCLK 0x7d 0x004
356#define MX27_PAD_CSPI1_SCLK__GPIO4_29 0x7d 0x032
357#define MX27_PAD_CSPI1_MISO__CSPI1_MISO 0x7e 0x004
358#define MX27_PAD_CSPI1_MISO__GPIO4_30 0x7e 0x032
359#define MX27_PAD_CSPI1_MOSI__CSPI1_MOSI 0x7f 0x004
360#define MX27_PAD_CSPI1_MOSI__GPIO4_31 0x7f 0x032
361#define MX27_PAD_USBOTG_NXT__USBOTG_NXT 0x80 0x000
362#define MX27_PAD_USBOTG_NXT__KP_COL6A 0x80 0x005
363#define MX27_PAD_USBOTG_NXT__GPIO5_0 0x80 0x032
364#define MX27_PAD_USBOTG_STP__USBOTG_STP 0x81 0x004
365#define MX27_PAD_USBOTG_STP__KP_ROW6A 0x81 0x005
366#define MX27_PAD_USBOTG_STP__GPIO5_1 0x81 0x032
367#define MX27_PAD_USBOTG_DIR__USBOTG_DIR 0x82 0x000
368#define MX27_PAD_USBOTG_DIR__KP_ROW7A 0x82 0x005
369#define MX27_PAD_USBOTG_DIR__GPIO5_2 0x82 0x032
370#define MX27_PAD_UART2_CTS__UART2_CTS 0x83 0x004
371#define MX27_PAD_UART2_CTS__KP_COL7 0x83 0x005
372#define MX27_PAD_UART2_CTS__GPIO5_3 0x83 0x032
373#define MX27_PAD_UART2_RTS__UART2_RTS 0x84 0x000
374#define MX27_PAD_UART2_RTS__KP_ROW7 0x84 0x005
375#define MX27_PAD_UART2_RTS__GPIO5_4 0x84 0x032
376#define MX27_PAD_PWMO__PWMO 0x85 0x004
377#define MX27_PAD_PWMO__GPIO5_5 0x85 0x032
378#define MX27_PAD_UART2_TXD__UART2_TXD 0x86 0x004
379#define MX27_PAD_UART2_TXD__KP_COL6 0x86 0x005
380#define MX27_PAD_UART2_TXD__GPIO5_6 0x86 0x032
381#define MX27_PAD_UART2_RXD__UART2_RXD 0x87 0x000
382#define MX27_PAD_UART2_RXD__KP_ROW6 0x87 0x005
383#define MX27_PAD_UART2_RXD__GPIO5_7 0x87 0x032
384#define MX27_PAD_UART3_TXD__UART3_TXD 0x88 0x004
385#define MX27_PAD_UART3_TXD__GPIO5_8 0x88 0x032
386#define MX27_PAD_UART3_RXD__UART3_RXD 0x89 0x000
387#define MX27_PAD_UART3_RXD__GPIO5_9 0x89 0x032
388#define MX27_PAD_UART3_CTS__UART3_CTS 0x8a 0x004
389#define MX27_PAD_UART3_CTS__GPIO5_10 0x8a 0x032
390#define MX27_PAD_UART3_RTS__UART3_RTS 0x8b 0x000
391#define MX27_PAD_UART3_RTS__GPIO5_11 0x8b 0x032
392#define MX27_PAD_UART1_TXD__UART1_TXD 0x8c 0x004
393#define MX27_PAD_UART1_TXD__GPIO5_12 0x8c 0x032
394#define MX27_PAD_UART1_RXD__UART1_RXD 0x8d 0x000
395#define MX27_PAD_UART1_RXD__GPIO5_13 0x8d 0x032
396#define MX27_PAD_UART1_CTS__UART1_CTS 0x8e 0x004
397#define MX27_PAD_UART1_CTS__GPIO5_14 0x8e 0x032
398#define MX27_PAD_UART1_RTS__UART1_RTS 0x8f 0x000
399#define MX27_PAD_UART1_RTS__GPIO5_15 0x8f 0x032
400#define MX27_PAD_RTCK__RTCK 0x90 0x004
401#define MX27_PAD_RTCK__OWIRE 0x90 0x005
402#define MX27_PAD_RTCK__GPIO5_16 0x90 0x032
403#define MX27_PAD_RESET_OUT_B__RESET_OUT_B 0x91 0x004
404#define MX27_PAD_RESET_OUT_B__GPIO5_17 0x91 0x032
405#define MX27_PAD_SD1_D0__SD1_D0 0x92 0x004
406#define MX27_PAD_SD1_D0__CSPI3_MISO 0x92 0x001
407#define MX27_PAD_SD1_D0__GPIO5_18 0x92 0x032
408#define MX27_PAD_SD1_D1__SD1_D1 0x93 0x004
409#define MX27_PAD_SD1_D1__GPIO5_19 0x93 0x032
410#define MX27_PAD_SD1_D2__SD1_D2 0x94 0x004
411#define MX27_PAD_SD1_D2__GPIO5_20 0x94 0x032
412#define MX27_PAD_SD1_D3__SD1_D3 0x95 0x004
413#define MX27_PAD_SD1_D3__CSPI3_SS 0x95 0x005
414#define MX27_PAD_SD1_D3__GPIO5_21 0x95 0x032
415#define MX27_PAD_SD1_CMD__SD1_CMD 0x96 0x004
416#define MX27_PAD_SD1_CMD__CSPI3_MOSI 0x96 0x005
417#define MX27_PAD_SD1_CMD__GPIO5_22 0x96 0x032
418#define MX27_PAD_SD1_CLK__SD1_CLK 0x97 0x004
419#define MX27_PAD_SD1_CLK__CSPI3_SCLK 0x97 0x005
420#define MX27_PAD_SD1_CLK__GPIO5_23 0x97 0x032
421#define MX27_PAD_USBOTG_CLK__USBOTG_CLK 0x98 0x000
422#define MX27_PAD_USBOTG_CLK__GPIO5_24 0x98 0x032
423#define MX27_PAD_USBOTG_DATA7__USBOTG_DATA7 0x99 0x004
424#define MX27_PAD_USBOTG_DATA7__GPIO5_25 0x99 0x032
425#define MX27_PAD_UNUSED9__UNUSED9 0x9a 0x004
426#define MX27_PAD_UNUSED9__GPIO5_26 0x9a 0x032
427#define MX27_PAD_UNUSED10__UNUSED10 0x9b 0x004
428#define MX27_PAD_UNUSED10__GPIO5_27 0x9b 0x032
429#define MX27_PAD_UNUSED11__UNUSED11 0x9c 0x004
430#define MX27_PAD_UNUSED11__GPIO5_28 0x9c 0x032
431#define MX27_PAD_UNUSED12__UNUSED12 0x9d 0x004
432#define MX27_PAD_UNUSED12__GPIO5_29 0x9d 0x032
433#define MX27_PAD_UNUSED13__UNUSED13 0x9e 0x004
434#define MX27_PAD_UNUSED13__GPIO5_30 0x9e 0x032
435#define MX27_PAD_UNUSED14__UNUSED14 0x9f 0x004
436#define MX27_PAD_UNUSED14__GPIO5_31 0x9f 0x032
437#define MX27_PAD_NFRB__NFRB 0xa0 0x000
438#define MX27_PAD_NFRB__ETMTRACEPKT3 0xa0 0x005
439#define MX27_PAD_NFRB__GPIO6_0 0xa0 0x032
440#define MX27_PAD_NFCLE__NFCLE 0xa1 0x004
441#define MX27_PAD_NFCLE__ETMTRACEPKT0 0xa1 0x005
442#define MX27_PAD_NFCLE__GPIO6_1 0xa1 0x032
443#define MX27_PAD_NFWP_B__NFWP_B 0xa2 0x004
444#define MX27_PAD_NFWP_B__ETMTRACEPKT1 0xa2 0x005
445#define MX27_PAD_NFWP_B__GPIO6_2 0xa2 0x032
446#define MX27_PAD_NFCE_B__NFCE_B 0xa3 0x004
447#define MX27_PAD_NFCE_B__ETMTRACEPKT2 0xa3 0x005
448#define MX27_PAD_NFCE_B__GPIO6_3 0xa3 0x032
449#define MX27_PAD_NFALE__NFALE 0xa4 0x004
450#define MX27_PAD_NFALE__ETMPIPESTAT0 0xa4 0x005
451#define MX27_PAD_NFALE__GPIO6_4 0xa4 0x032
452#define MX27_PAD_NFRE_B__NFRE_B 0xa5 0x004
453#define MX27_PAD_NFRE_B__ETMPIPESTAT1 0xa5 0x005
454#define MX27_PAD_NFRE_B__GPIO6_5 0xa5 0x032
455#define MX27_PAD_NFWE_B__NFWE_B 0xa6 0x004
456#define MX27_PAD_NFWE_B__ETMPIPESTAT2 0xa6 0x005
457#define MX27_PAD_NFWE_B__GPIO6_6 0xa6 0x032
458#define MX27_PAD_PC_POE__PC_POE 0xa7 0x004
459#define MX27_PAD_PC_POE__ATA_BUFFER_EN 0xa7 0x005
460#define MX27_PAD_PC_POE__GPIO6_7 0xa7 0x032
461#define MX27_PAD_PC_RW_B__PC_RW_B 0xa8 0x004
462#define MX27_PAD_PC_RW_B__ATA_IORDY 0xa8 0x001
463#define MX27_PAD_PC_RW_B__GPIO6_8 0xa8 0x032
464#define MX27_PAD_IOIS16__IOIS16 0xa9 0x000
465#define MX27_PAD_IOIS16__ATA_INTRQ 0xa9 0x001
466#define MX27_PAD_IOIS16__GPIO6_9 0xa9 0x032
467#define MX27_PAD_PC_RST__PC_RST 0xaa 0x004
468#define MX27_PAD_PC_RST__ATA_RESET_B 0xaa 0x005
469#define MX27_PAD_PC_RST__GPIO6_10 0xaa 0x032
470#define MX27_PAD_PC_BVD2__PC_BVD2 0xab 0x000
471#define MX27_PAD_PC_BVD2__ATA_DMACK 0xab 0x005
472#define MX27_PAD_PC_BVD2__GPIO6_11 0xab 0x032
473#define MX27_PAD_PC_BVD1__PC_BVD1 0xac 0x000
474#define MX27_PAD_PC_BVD1__ATA_DMARQ 0xac 0x001
475#define MX27_PAD_PC_BVD1__GPIO6_12 0xac 0x032
476#define MX27_PAD_PC_VS2__PC_VS2 0xad 0x000
477#define MX27_PAD_PC_VS2__ATA_DA0 0xad 0x005
478#define MX27_PAD_PC_VS2__GPIO6_13 0xad 0x032
479#define MX27_PAD_PC_VS1__PC_VS1 0xae 0x000
480#define MX27_PAD_PC_VS1__ATA_DA1 0xae 0x005
481#define MX27_PAD_PC_VS1__GPIO6_14 0xae 0x032
482#define MX27_PAD_CLKO__CLKO 0xaf 0x004
483#define MX27_PAD_CLKO__GPIO6_15 0xaf 0x032
484#define MX27_PAD_PC_PWRON__PC_PWRON 0xb0 0x000
485#define MX27_PAD_PC_PWRON__ATA_DA2 0xb0 0x005
486#define MX27_PAD_PC_PWRON__GPIO6_16 0xb0 0x032
487#define MX27_PAD_PC_READY__PC_READY 0xb1 0x000
488#define MX27_PAD_PC_READY__ATA_CS0 0xb1 0x005
489#define MX27_PAD_PC_READY__GPIO6_17 0xb1 0x032
490#define MX27_PAD_PC_WAIT_B__PC_WAIT_B 0xb2 0x000
491#define MX27_PAD_PC_WAIT_B__ATA_CS1 0xb2 0x005
492#define MX27_PAD_PC_WAIT_B__GPIO6_18 0xb2 0x032
493#define MX27_PAD_PC_CD2_B__PC_CD2_B 0xb3 0x000
494#define MX27_PAD_PC_CD2_B__ATA_DIOW 0xb3 0x005
495#define MX27_PAD_PC_CD2_B__GPIO6_19 0xb3 0x032
496#define MX27_PAD_PC_CD1_B__PC_CD1_B 0xb4 0x000
497#define MX27_PAD_PC_CD1_B__ATA_DIOR 0xb4 0x005
498#define MX27_PAD_PC_CD1_B__GPIO6_20 0xb4 0x032
499#define MX27_PAD_CS4_B__CS4_B 0xb5 0x004
500#define MX27_PAD_CS4_B__ETMTRACESYNC 0xb5 0x005
501#define MX27_PAD_CS4_B__GPIO6_21 0xb5 0x032
502#define MX27_PAD_CS5_B__CS5_B 0xb6 0x004
503#define MX27_PAD_CS5_B__ETMTRACECLK 0xb6 0x005
504#define MX27_PAD_CS5_B__GPIO6_22 0xb6 0x032
505#define MX27_PAD_ATA_DATA15__ATA_DATA15 0xb7 0x004
506#define MX27_PAD_ATA_DATA15__ETMTRACEPKT4 0xb7 0x005
507#define MX27_PAD_ATA_DATA15__FEC_TX_EN 0xb7 0x006
508#define MX27_PAD_ATA_DATA15__GPIO6_23 0xb7 0x032
509#define MX27_PAD_UNUSED15__UNUSED15 0xb8 0x004
510#define MX27_PAD_UNUSED15__GPIO6_24 0xb8 0x032
511#define MX27_PAD_UNUSED16__UNUSED16 0xb9 0x004
512#define MX27_PAD_UNUSED16__GPIO6_25 0xb9 0x032
513#define MX27_PAD_UNUSED17__UNUSED17 0xba 0x004
514#define MX27_PAD_UNUSED17__GPIO6_26 0xba 0x032
515#define MX27_PAD_UNUSED18__UNUSED18 0xbb 0x004
516#define MX27_PAD_UNUSED18__GPIO6_27 0xbb 0x032
517#define MX27_PAD_UNUSED19__UNUSED19 0xbc 0x004
518#define MX27_PAD_UNUSED19__GPIO6_28 0xbc 0x032
519#define MX27_PAD_UNUSED20__UNUSED20 0xbd 0x004
520#define MX27_PAD_UNUSED20__GPIO6_29 0xbd 0x032
521#define MX27_PAD_UNUSED21__UNUSED21 0xbe 0x004
522#define MX27_PAD_UNUSED21__GPIO6_30 0xbe 0x032
523#define MX27_PAD_UNUSED22__UNUSED22 0xbf 0x004
524#define MX27_PAD_UNUSED22__GPIO6_31 0xbf 0x032
525
526#endif /* __DTS_IMX27_PINFUNC_H */
diff --git a/arch/arm/boot/dts/imx27.dtsi b/arch/arm/boot/dts/imx27.dtsi
index 826231eb4446..6279e0b4f768 100644
--- a/arch/arm/boot/dts/imx27.dtsi
+++ b/arch/arm/boot/dts/imx27.dtsi
@@ -10,6 +10,9 @@
10 */ 10 */
11 11
12#include "skeleton.dtsi" 12#include "skeleton.dtsi"
13#include "imx27-pinfunc.h"
14#include <dt-bindings/interrupt-controller/irq.h>
15#include <dt-bindings/gpio/gpio.h>
13 16
14/ { 17/ {
15 aliases { 18 aliases {
@@ -67,6 +70,26 @@
67 }; 70 };
68 }; 71 };
69 72
73 usbphy {
74 compatible = "simple-bus";
75 #address-cells = <1>;
76 #size-cells = <0>;
77
78 usbphy0: usbphy@0 {
79 compatible = "usb-nop-xceiv";
80 reg = <0>;
81 clocks = <&clks 75>;
82 clock-names = "main_clk";
83 };
84
85 usbphy2: usbphy@2 {
86 compatible = "usb-nop-xceiv";
87 reg = <2>;
88 clocks = <&clks 75>;
89 clock-names = "main_clk";
90 };
91 };
92
70 soc { 93 soc {
71 #address-cells = <1>; 94 #address-cells = <1>;
72 #size-cells = <1>; 95 #size-cells = <1>;
@@ -204,6 +227,30 @@
204 status = "disabled"; 227 status = "disabled";
205 }; 228 };
206 229
230 ssi1: ssi@10010000 {
231 #sound-dai-cells = <0>;
232 compatible = "fsl,imx27-ssi", "fsl,imx21-ssi";
233 reg = <0x10010000 0x1000>;
234 interrupts = <14>;
235 clocks = <&clks 26>;
236 dmas = <&dma 12>, <&dma 13>, <&dma 14>, <&dma 15>;
237 dma-names = "rx0", "tx0", "rx1", "tx1";
238 fsl,fifo-depth = <8>;
239 status = "disabled";
240 };
241
242 ssi2: ssi@10011000 {
243 #sound-dai-cells = <0>;
244 compatible = "fsl,imx27-ssi", "fsl,imx21-ssi";
245 reg = <0x10011000 0x1000>;
246 interrupts = <13>;
247 clocks = <&clks 25>;
248 dmas = <&dma 8>, <&dma 9>, <&dma 10>, <&dma 11>;
249 dma-names = "rx0", "tx0", "rx1", "tx1";
250 fsl,fifo-depth = <8>;
251 status = "disabled";
252 };
253
207 i2c1: i2c@10012000 { 254 i2c1: i2c@10012000 {
208 #address-cells = <1>; 255 #address-cells = <1>;
209 #size-cells = <0>; 256 #size-cells = <0>;
@@ -236,64 +283,72 @@
236 status = "disabled"; 283 status = "disabled";
237 }; 284 };
238 285
239 gpio1: gpio@10015000 { 286 iomuxc: iomuxc@10015000 {
240 compatible = "fsl,imx27-gpio", "fsl,imx21-gpio"; 287 compatible = "fsl,imx27-iomuxc";
241 reg = <0x10015000 0x100>; 288 reg = <0x10015000 0x600>;
242 interrupts = <8>; 289 #address-cells = <1>;
243 gpio-controller; 290 #size-cells = <1>;
244 #gpio-cells = <2>; 291 ranges;
245 interrupt-controller; 292
246 #interrupt-cells = <2>; 293 gpio1: gpio@10015000 {
247 }; 294 compatible = "fsl,imx27-gpio", "fsl,imx21-gpio";
248 295 reg = <0x10015000 0x100>;
249 gpio2: gpio@10015100 { 296 interrupts = <8>;
250 compatible = "fsl,imx27-gpio", "fsl,imx21-gpio"; 297 gpio-controller;
251 reg = <0x10015100 0x100>; 298 #gpio-cells = <2>;
252 interrupts = <8>; 299 interrupt-controller;
253 gpio-controller; 300 #interrupt-cells = <2>;
254 #gpio-cells = <2>; 301 };
255 interrupt-controller; 302
256 #interrupt-cells = <2>; 303 gpio2: gpio@10015100 {
257 }; 304 compatible = "fsl,imx27-gpio", "fsl,imx21-gpio";
258 305 reg = <0x10015100 0x100>;
259 gpio3: gpio@10015200 { 306 interrupts = <8>;
260 compatible = "fsl,imx27-gpio", "fsl,imx21-gpio"; 307 gpio-controller;
261 reg = <0x10015200 0x100>; 308 #gpio-cells = <2>;
262 interrupts = <8>; 309 interrupt-controller;
263 gpio-controller; 310 #interrupt-cells = <2>;
264 #gpio-cells = <2>; 311 };
265 interrupt-controller; 312
266 #interrupt-cells = <2>; 313 gpio3: gpio@10015200 {
267 }; 314 compatible = "fsl,imx27-gpio", "fsl,imx21-gpio";
268 315 reg = <0x10015200 0x100>;
269 gpio4: gpio@10015300 { 316 interrupts = <8>;
270 compatible = "fsl,imx27-gpio", "fsl,imx21-gpio"; 317 gpio-controller;
271 reg = <0x10015300 0x100>; 318 #gpio-cells = <2>;
272 interrupts = <8>; 319 interrupt-controller;
273 gpio-controller; 320 #interrupt-cells = <2>;
274 #gpio-cells = <2>; 321 };
275 interrupt-controller; 322
276 #interrupt-cells = <2>; 323 gpio4: gpio@10015300 {
277 }; 324 compatible = "fsl,imx27-gpio", "fsl,imx21-gpio";
278 325 reg = <0x10015300 0x100>;
279 gpio5: gpio@10015400 { 326 interrupts = <8>;
280 compatible = "fsl,imx27-gpio", "fsl,imx21-gpio"; 327 gpio-controller;
281 reg = <0x10015400 0x100>; 328 #gpio-cells = <2>;
282 interrupts = <8>; 329 interrupt-controller;
283 gpio-controller; 330 #interrupt-cells = <2>;
284 #gpio-cells = <2>; 331 };
285 interrupt-controller; 332
286 #interrupt-cells = <2>; 333 gpio5: gpio@10015400 {
287 }; 334 compatible = "fsl,imx27-gpio", "fsl,imx21-gpio";
288 335 reg = <0x10015400 0x100>;
289 gpio6: gpio@10015500 { 336 interrupts = <8>;
290 compatible = "fsl,imx27-gpio", "fsl,imx21-gpio"; 337 gpio-controller;
291 reg = <0x10015500 0x100>; 338 #gpio-cells = <2>;
292 interrupts = <8>; 339 interrupt-controller;
293 gpio-controller; 340 #interrupt-cells = <2>;
294 #gpio-cells = <2>; 341 };
295 interrupt-controller; 342
296 #interrupt-cells = <2>; 343 gpio6: gpio@10015500 {
344 compatible = "fsl,imx27-gpio", "fsl,imx21-gpio";
345 reg = <0x10015500 0x100>;
346 interrupts = <8>;
347 gpio-controller;
348 #gpio-cells = <2>;
349 interrupt-controller;
350 #interrupt-cells = <2>;
351 };
297 }; 352 };
298 353
299 audmux: audmux@10016000 { 354 audmux: audmux@10016000 {
@@ -404,6 +459,42 @@
404 iram = <&iram>; 459 iram = <&iram>;
405 }; 460 };
406 461
462 usbotg: usb@10024000 {
463 compatible = "fsl,imx27-usb";
464 reg = <0x10024000 0x200>;
465 interrupts = <56>;
466 clocks = <&clks 15>;
467 fsl,usbmisc = <&usbmisc 0>;
468 fsl,usbphy = <&usbphy0>;
469 status = "disabled";
470 };
471
472 usbh1: usb@10024200 {
473 compatible = "fsl,imx27-usb";
474 reg = <0x10024200 0x200>;
475 interrupts = <54>;
476 clocks = <&clks 15>;
477 fsl,usbmisc = <&usbmisc 1>;
478 status = "disabled";
479 };
480
481 usbh2: usb@10024400 {
482 compatible = "fsl,imx27-usb";
483 reg = <0x10024400 0x200>;
484 interrupts = <55>;
485 clocks = <&clks 15>;
486 fsl,usbmisc = <&usbmisc 2>;
487 fsl,usbphy = <&usbphy2>;
488 status = "disabled";
489 };
490
491 usbmisc: usbmisc@10024600 {
492 #index-cells = <1>;
493 compatible = "fsl,imx27-usbmisc";
494 reg = <0x10024600 0x200>;
495 clocks = <&clks 62>;
496 };
497
407 sahara2: sahara@10025000 { 498 sahara2: sahara@10025000 {
408 compatible = "fsl,imx27-sahara"; 499 compatible = "fsl,imx27-sahara";
409 reg = <0x10025000 0x1000>; 500 reg = <0x10025000 0x1000>;
diff --git a/arch/arm/boot/dts/imx28-apf28dev.dts b/arch/arm/boot/dts/imx28-apf28dev.dts
index e2efd8d89c4f..221cac4fb2cd 100644
--- a/arch/arm/boot/dts/imx28-apf28dev.dts
+++ b/arch/arm/boot/dts/imx28-apf28dev.dts
@@ -48,6 +48,7 @@
48 MX28_PAD_LCD_D20__GPIO_1_20 48 MX28_PAD_LCD_D20__GPIO_1_20
49 MX28_PAD_LCD_D21__GPIO_1_21 49 MX28_PAD_LCD_D21__GPIO_1_21
50 MX28_PAD_LCD_D22__GPIO_1_22 50 MX28_PAD_LCD_D22__GPIO_1_22
51 MX28_PAD_GPMI_CE1N__GPIO_0_17
51 >; 52 >;
52 fsl,drive-strength = <MXS_DRIVE_4mA>; 53 fsl,drive-strength = <MXS_DRIVE_4mA>;
53 fsl,voltage = <MXS_VOLTAGE_HIGH>; 54 fsl,voltage = <MXS_VOLTAGE_HIGH>;
@@ -66,6 +67,16 @@
66 fsl,voltage = <MXS_VOLTAGE_HIGH>; 67 fsl,voltage = <MXS_VOLTAGE_HIGH>;
67 fsl,pull-up = <MXS_PULL_DISABLE>; 68 fsl,pull-up = <MXS_PULL_DISABLE>;
68 }; 69 };
70
71 usb0_otg_apf28dev: otg-apf28dev@0 {
72 reg = <0>;
73 fsl,pinmux-ids = <
74 MX28_PAD_LCD_D23__GPIO_1_23
75 >;
76 fsl,drive-strength = <MXS_DRIVE_4mA>;
77 fsl,voltage = <MXS_VOLTAGE_HIGH>;
78 fsl,pull-up = <MXS_PULL_DISABLE>;
79 };
69 }; 80 };
70 81
71 lcdif@80030000 { 82 lcdif@80030000 {
@@ -131,6 +142,8 @@
131 142
132 ahb@80080000 { 143 ahb@80080000 {
133 usb0: usb@80080000 { 144 usb0: usb@80080000 {
145 pinctrl-names = "default";
146 pinctrl-0 = <&usb0_otg_apf28dev>;
134 vbus-supply = <&reg_usb0_vbus>; 147 vbus-supply = <&reg_usb0_vbus>;
135 status = "okay"; 148 status = "okay";
136 }; 149 };
@@ -150,13 +163,17 @@
150 163
151 regulators { 164 regulators {
152 compatible = "simple-bus"; 165 compatible = "simple-bus";
166 #address-cells = <1>;
167 #size-cells = <0>;
153 168
154 reg_usb0_vbus: usb0_vbus { 169 reg_usb0_vbus: regulator@0 {
155 compatible = "regulator-fixed"; 170 compatible = "regulator-fixed";
171 reg = <0>;
156 regulator-name = "usb0_vbus"; 172 regulator-name = "usb0_vbus";
157 regulator-min-microvolt = <5000000>; 173 regulator-min-microvolt = <5000000>;
158 regulator-max-microvolt = <5000000>; 174 regulator-max-microvolt = <5000000>;
159 gpio = <&gpio1 23 1>; 175 gpio = <&gpio1 23 1>;
176 enable-active-high;
160 }; 177 };
161 }; 178 };
162 179
@@ -177,4 +194,14 @@
177 brightness-levels = <0 4 8 16 32 64 128 255>; 194 brightness-levels = <0 4 8 16 32 64 128 255>;
178 default-brightness-level = <6>; 195 default-brightness-level = <6>;
179 }; 196 };
197
198 gpio-keys {
199 compatible = "gpio-keys";
200
201 user-button {
202 label = "User button";
203 gpios = <&gpio0 17 0>;
204 linux,code = <0x100>;
205 };
206 };
180}; 207};
diff --git a/arch/arm/boot/dts/imx28-apx4devkit.dts b/arch/arm/boot/dts/imx28-apx4devkit.dts
index 6f254ca816cb..e1ce9179db63 100644
--- a/arch/arm/boot/dts/imx28-apx4devkit.dts
+++ b/arch/arm/boot/dts/imx28-apx4devkit.dts
@@ -193,9 +193,12 @@
193 193
194 regulators { 194 regulators {
195 compatible = "simple-bus"; 195 compatible = "simple-bus";
196 #address-cells = <1>;
197 #size-cells = <0>;
196 198
197 reg_3p3v: 3p3v { 199 reg_3p3v: regulator@0 {
198 compatible = "regulator-fixed"; 200 compatible = "regulator-fixed";
201 reg = <0>;
199 regulator-name = "3P3V"; 202 regulator-name = "3P3V";
200 regulator-min-microvolt = <3300000>; 203 regulator-min-microvolt = <3300000>;
201 regulator-max-microvolt = <3300000>; 204 regulator-max-microvolt = <3300000>;
diff --git a/arch/arm/boot/dts/imx28-cfa10036.dts b/arch/arm/boot/dts/imx28-cfa10036.dts
index cabb6171a19d..ae7c3390e65a 100644
--- a/arch/arm/boot/dts/imx28-cfa10036.dts
+++ b/arch/arm/boot/dts/imx28-cfa10036.dts
@@ -100,6 +100,8 @@
100 usb0: usb@80080000 { 100 usb0: usb@80080000 {
101 pinctrl-names = "default"; 101 pinctrl-names = "default";
102 pinctrl-0 = <&usb0_otg_cfa10036>; 102 pinctrl-0 = <&usb0_otg_cfa10036>;
103 dr_mode = "peripheral";
104 phy_type = "utmi";
103 status = "okay"; 105 status = "okay";
104 }; 106 };
105 }; 107 };
diff --git a/arch/arm/boot/dts/imx28-cfa10037.dts b/arch/arm/boot/dts/imx28-cfa10037.dts
index f93e9a700e52..e5beaa58bb40 100644
--- a/arch/arm/boot/dts/imx28-cfa10037.dts
+++ b/arch/arm/boot/dts/imx28-cfa10037.dts
@@ -54,7 +54,7 @@
54 ahb@80080000 { 54 ahb@80080000 {
55 usb1: usb@80090000 { 55 usb1: usb@80090000 {
56 vbus-supply = <&reg_usb1_vbus>; 56 vbus-supply = <&reg_usb1_vbus>;
57 pinctrl-0 = <&usbphy1_pins_a>; 57 pinctrl-0 = <&usb1_pins_a>;
58 pinctrl-names = "default"; 58 pinctrl-names = "default";
59 status = "okay"; 59 status = "okay";
60 }; 60 };
@@ -72,9 +72,12 @@
72 72
73 regulators { 73 regulators {
74 compatible = "simple-bus"; 74 compatible = "simple-bus";
75 #address-cells = <1>;
76 #size-cells = <0>;
75 77
76 reg_usb1_vbus: usb1_vbus { 78 reg_usb1_vbus: regulator@0 {
77 compatible = "regulator-fixed"; 79 compatible = "regulator-fixed";
80 reg = <0>;
78 pinctrl-names = "default"; 81 pinctrl-names = "default";
79 pinctrl-0 = <&usb_pins_cfa10037>; 82 pinctrl-0 = <&usb_pins_cfa10037>;
80 regulator-name = "usb1_vbus"; 83 regulator-name = "usb1_vbus";
diff --git a/arch/arm/boot/dts/imx28-cfa10049.dts b/arch/arm/boot/dts/imx28-cfa10049.dts
index 7087b4bf6a8f..7d51459de5e8 100644
--- a/arch/arm/boot/dts/imx28-cfa10049.dts
+++ b/arch/arm/boot/dts/imx28-cfa10049.dts
@@ -229,15 +229,39 @@
229 i2c-parent = <&i2c1>; 229 i2c-parent = <&i2c1>;
230 230
231 i2c@0 { 231 i2c@0 {
232 #address-cells = <1>;
233 #size-cells = <0>;
232 reg = <0>; 234 reg = <0>;
235
236 adc0: nau7802@2a {
237 compatible = "nuvoton,nau7802";
238 reg = <0x2a>;
239 nuvoton,vldo = <3000>;
240 };
233 }; 241 };
234 242
235 i2c@1 { 243 i2c@1 {
244 #address-cells = <1>;
245 #size-cells = <0>;
236 reg = <1>; 246 reg = <1>;
247
248 adc1: nau7802@2a {
249 compatible = "nuvoton,nau7802";
250 reg = <0x2a>;
251 nuvoton,vldo = <3000>;
252 };
237 }; 253 };
238 254
239 i2c@2 { 255 i2c@2 {
256 #address-cells = <1>;
257 #size-cells = <0>;
240 reg = <2>; 258 reg = <2>;
259
260 adc2: nau7802@2a {
261 compatible = "nuvoton,nau7802";
262 reg = <0x2a>;
263 nuvoton,vldo = <3000>;
264 };
241 }; 265 };
242 266
243 i2c@3 { 267 i2c@3 {
@@ -274,7 +298,7 @@
274 ahb@80080000 { 298 ahb@80080000 {
275 usb1: usb@80090000 { 299 usb1: usb@80090000 {
276 vbus-supply = <&reg_usb1_vbus>; 300 vbus-supply = <&reg_usb1_vbus>;
277 pinctrl-0 = <&usbphy1_pins_a>; 301 pinctrl-0 = <&usb1_pins_a>;
278 pinctrl-names = "default"; 302 pinctrl-names = "default";
279 status = "okay"; 303 status = "okay";
280 }; 304 };
@@ -282,9 +306,12 @@
282 306
283 regulators { 307 regulators {
284 compatible = "simple-bus"; 308 compatible = "simple-bus";
309 #address-cells = <1>;
310 #size-cells = <0>;
285 311
286 reg_usb1_vbus: usb1_vbus { 312 reg_usb1_vbus: regulator@0 {
287 compatible = "regulator-fixed"; 313 compatible = "regulator-fixed";
314 reg = <0>;
288 pinctrl-names = "default"; 315 pinctrl-names = "default";
289 pinctrl-0 = <&usb_pins_cfa10049>; 316 pinctrl-0 = <&usb_pins_cfa10049>;
290 regulator-name = "usb1_vbus"; 317 regulator-name = "usb1_vbus";
diff --git a/arch/arm/boot/dts/imx28-cfa10057.dts b/arch/arm/boot/dts/imx28-cfa10057.dts
index 3c1312885ae0..c4e00ce4b6da 100644
--- a/arch/arm/boot/dts/imx28-cfa10057.dts
+++ b/arch/arm/boot/dts/imx28-cfa10057.dts
@@ -134,7 +134,7 @@
134 ahb@80080000 { 134 ahb@80080000 {
135 usb1: usb@80090000 { 135 usb1: usb@80090000 {
136 vbus-supply = <&reg_usb1_vbus>; 136 vbus-supply = <&reg_usb1_vbus>;
137 pinctrl-0 = <&usbphy1_pins_a>; 137 pinctrl-0 = <&usb1_pins_a>;
138 pinctrl-names = "default"; 138 pinctrl-names = "default";
139 status = "okay"; 139 status = "okay";
140 }; 140 };
@@ -142,9 +142,12 @@
142 142
143 regulators { 143 regulators {
144 compatible = "simple-bus"; 144 compatible = "simple-bus";
145 #address-cells = <1>;
146 #size-cells = <0>;
145 147
146 reg_usb1_vbus: usb1_vbus { 148 reg_usb1_vbus: regulator@0 {
147 compatible = "regulator-fixed"; 149 compatible = "regulator-fixed";
150 reg = <0>;
148 pinctrl-names = "default"; 151 pinctrl-names = "default";
149 pinctrl-0 = <&usb_pins_cfa10057>; 152 pinctrl-0 = <&usb_pins_cfa10057>;
150 regulator-name = "usb1_vbus"; 153 regulator-name = "usb1_vbus";
diff --git a/arch/arm/boot/dts/imx28-cfa10058.dts b/arch/arm/boot/dts/imx28-cfa10058.dts
index 2469d34df0ae..7c9cc783f0d1 100644
--- a/arch/arm/boot/dts/imx28-cfa10058.dts
+++ b/arch/arm/boot/dts/imx28-cfa10058.dts
@@ -101,7 +101,7 @@
101 ahb@80080000 { 101 ahb@80080000 {
102 usb1: usb@80090000 { 102 usb1: usb@80090000 {
103 vbus-supply = <&reg_usb1_vbus>; 103 vbus-supply = <&reg_usb1_vbus>;
104 pinctrl-0 = <&usbphy1_pins_a>; 104 pinctrl-0 = <&usb1_pins_a>;
105 pinctrl-names = "default"; 105 pinctrl-names = "default";
106 status = "okay"; 106 status = "okay";
107 }; 107 };
@@ -109,11 +109,14 @@
109 109
110 regulators { 110 regulators {
111 compatible = "simple-bus"; 111 compatible = "simple-bus";
112 #address-cells = <1>;
113 #size-cells = <0>;
112 114
113 reg_usb1_vbus: usb1_vbus { 115 reg_usb1_vbus: regulator@0 {
114 pinctrl-names = "default"; 116 pinctrl-names = "default";
115 pinctrl-0 = <&usb_pins_cfa10058>; 117 pinctrl-0 = <&usb_pins_cfa10058>;
116 compatible = "regulator-fixed"; 118 compatible = "regulator-fixed";
119 reg = <0>;
117 regulator-name = "usb1_vbus"; 120 regulator-name = "usb1_vbus";
118 regulator-min-microvolt = <5000000>; 121 regulator-min-microvolt = <5000000>;
119 regulator-max-microvolt = <5000000>; 122 regulator-max-microvolt = <5000000>;
diff --git a/arch/arm/boot/dts/imx28-duckbill.dts b/arch/arm/boot/dts/imx28-duckbill.dts
new file mode 100644
index 000000000000..5f326c1c1850
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-duckbill.dts
@@ -0,0 +1,121 @@
1/*
2 * Copyright (C) 2013 Michael Heimpold <mhei@heimpold.de>
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/dts-v1/;
13#include "imx28.dtsi"
14
15/ {
16 model = "I2SE Duckbill";
17 compatible = "i2se,duckbill", "fsl,imx28";
18
19 memory {
20 reg = <0x40000000 0x08000000>;
21 };
22
23 apb@80000000 {
24 apbh@80000000 {
25 ssp0: ssp@80010000 {
26 compatible = "fsl,imx28-mmc";
27 pinctrl-names = "default";
28 pinctrl-0 = <&mmc0_8bit_pins_a
29 &mmc0_cd_cfg &mmc0_sck_cfg>;
30 bus-width = <8>;
31 vmmc-supply = <&reg_3p3v>;
32 status = "okay";
33 };
34
35 pinctrl@80018000 {
36 pinctrl-names = "default";
37 pinctrl-0 = <&hog_pins_a>;
38
39 hog_pins_a: hog@0 {
40 reg = <0>;
41 fsl,pinmux-ids = <
42 MX28_PAD_ENET0_RX_CLK__GPIO_4_13 /* PHY Reset */
43 >;
44 fsl,drive-strength = <MXS_DRIVE_4mA>;
45 fsl,voltage = <MXS_VOLTAGE_HIGH>;
46 fsl,pull-up = <MXS_PULL_DISABLE>;
47 };
48
49 led_pins_a: led_gpio@0 {
50 reg = <0>;
51 fsl,pinmux-ids = <
52 MX28_PAD_AUART1_RX__GPIO_3_4
53 MX28_PAD_AUART1_TX__GPIO_3_5
54 >;
55 fsl,drive-strength = <MXS_DRIVE_4mA>;
56 fsl,voltage = <MXS_VOLTAGE_HIGH>;
57 fsl,pull-up = <MXS_PULL_DISABLE>;
58 };
59 };
60 };
61
62 apbx@80040000 {
63 duart: serial@80074000 {
64 pinctrl-names = "default";
65 pinctrl-0 = <&duart_pins_a>;
66 status = "okay";
67 };
68
69 usbphy0: usbphy@8007c000 {
70 status = "okay";
71 };
72 };
73 };
74
75 ahb@80080000 {
76 usb0: usb@80080000 {
77 status = "okay";
78 };
79
80 mac0: ethernet@800f0000 {
81 phy-mode = "rmii";
82 pinctrl-names = "default";
83 pinctrl-0 = <&mac0_pins_a>;
84 phy-supply = <&reg_3p3v>;
85 phy-reset-gpios = <&gpio4 13 0>;
86 phy-reset-duration = <100>;
87 status = "okay";
88 };
89 };
90
91 regulators {
92 compatible = "simple-bus";
93 #address-cells = <1>;
94 #size-cells = <0>;
95
96 reg_3p3v: regulator@0 {
97 compatible = "regulator-fixed";
98 reg = <0>;
99 regulator-name = "3P3V";
100 regulator-min-microvolt = <3300000>;
101 regulator-max-microvolt = <3300000>;
102 regulator-always-on;
103 };
104 };
105
106 leds {
107 compatible = "gpio-leds";
108 pinctrl-names = "default";
109 pinctrl-0 = <&led_pins_a>;
110
111 status {
112 label = "duckbill:green:status";
113 gpios = <&gpio3 5 0>;
114 };
115
116 failure {
117 label = "duckbill:red:status";
118 gpios = <&gpio3 4 0>;
119 };
120 };
121};
diff --git a/arch/arm/boot/dts/imx28-eukrea-mbmx283lc.dts b/arch/arm/boot/dts/imx28-eukrea-mbmx283lc.dts
new file mode 100644
index 000000000000..7c1572c5a4fb
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-eukrea-mbmx283lc.dts
@@ -0,0 +1,71 @@
1/*
2 * Copyright 2013 Eukréa Electromatique <eric@eukrea.com>
3 * Copyright 2013 Eukréa Electromatique <denis@eukrea.com>
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
15/*
16 * Module contains : i.MX282 + 64MB DDR2 + NAND + Ethernet PHY + RTC
17 */
18
19/dts-v1/;
20#include "imx28-eukrea-mbmx28lc.dtsi"
21
22/ {
23 model = "Eukrea Electromatique MBMX283LC";
24 compatible = "eukrea,mbmx283lc", "eukrea,mbmx28lc", "fsl,imx28";
25
26 memory {
27 reg = <0x40000000 0x04000000>;
28 };
29};
30
31&gpmi {
32 pinctrl-names = "default";
33 pinctrl-0 = <&gpmi_pins_a>;
34 status = "okay";
35};
36
37&i2c0 {
38 pinctrl-names = "default";
39 pinctrl-0 = <&i2c0_pins_a>;
40 status = "okay";
41
42 pcf8563: rtc@51 {
43 compatible = "nxp,pcf8563";
44 reg = <0x51>;
45 };
46};
47
48
49&mac0 {
50 phy-mode = "rmii";
51 pinctrl-names = "default";
52 pinctrl-0 = <&mac0_pins_a>;
53 phy-reset-gpios = <&gpio4 13 GPIO_ACTIVE_LOW>;
54 status = "okay";
55};
56
57&pinctrl{
58 pinctrl-names = "default";
59 pinctrl-0 = <&hog_pins_cpuimx283>;
60
61 hog_pins_cpuimx283: hog-cpuimx283@0 {
62 reg = <0>;
63 fsl,pinmux-ids = <
64 MX28_PAD_ENET0_RX_CLK__GPIO_4_13
65 MX28_PAD_ENET0_TX_CLK__GPIO_4_5
66 >;
67 fsl,drive-strength = <MXS_DRIVE_4mA>;
68 fsl,voltage = <MXS_VOLTAGE_HIGH>;
69 fsl,pull-up = <MXS_PULL_ENABLE>;
70 };
71};
diff --git a/arch/arm/boot/dts/imx28-eukrea-mbmx287lc.dts b/arch/arm/boot/dts/imx28-eukrea-mbmx287lc.dts
new file mode 100644
index 000000000000..e773144e1e03
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-eukrea-mbmx287lc.dts
@@ -0,0 +1,50 @@
1/*
2 * Copyright 2013 Eukréa Electromatique <eric@eukrea.com>
3 * Copyright 2013 Eukréa Electromatique <denis@eukrea.com>
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
15/*
16 * Module contains : i.MX287 + 128MB DDR2 + NAND + 2 x Ethernet PHY + RTC
17 */
18
19#include "imx28-eukrea-mbmx283lc.dts"
20
21/ {
22 model = "Eukrea Electromatique MBMX287LC";
23 compatible = "eukrea,mbmx287lc", "eukrea,mbmx283lc", "eukrea,mbmx28lc", "fsl,imx28";
24
25 memory {
26 reg = <0x40000000 0x08000000>;
27 };
28};
29
30&mac1 {
31 phy-mode = "rmii";
32 pinctrl-names = "default";
33 pinctrl-0 = <&mac1_pins_a>;
34 phy-reset-gpios = <&gpio3 27 GPIO_ACTIVE_HIGH>;
35 status = "okay";
36};
37
38&pinctrl {
39 pinctrl-names = "default";
40 pinctrl-0 = <&hog_pins_cpuimx283 &hog_pins_cpuimx287>;
41 hog_pins_cpuimx287: hog-cpuimx287@0 {
42 reg = <0>;
43 fsl,pinmux-ids = <
44 MX28_PAD_SPDIF__GPIO_3_27
45 >;
46 fsl,drive-strength = <MXS_DRIVE_4mA>;
47 fsl,voltage = <MXS_VOLTAGE_HIGH>;
48 fsl,pull-up = <MXS_PULL_ENABLE>;
49 };
50};
diff --git a/arch/arm/boot/dts/imx28-eukrea-mbmx28lc.dtsi b/arch/arm/boot/dts/imx28-eukrea-mbmx28lc.dtsi
new file mode 100644
index 000000000000..927b391d2058
--- /dev/null
+++ b/arch/arm/boot/dts/imx28-eukrea-mbmx28lc.dtsi
@@ -0,0 +1,326 @@
1/*
2 * Copyright 2013 Eukréa Electromatique <eric@eukrea.com>
3 * Copyright 2013 Eukréa Electromatique <denis@eukrea.com>
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
15#include <dt-bindings/input/input.h>
16#include <dt-bindings/gpio/gpio.h>
17#include "imx28.dtsi"
18
19/ {
20 model = "Eukrea Electromatique MBMX28LC";
21 compatible = "eukrea,mbmx28lc", "fsl,imx28";
22
23 backlight {
24 compatible = "pwm-backlight";
25 pwms = <&pwm 4 1000000>;
26 brightness-levels = <0 25 50 75 100 125 150 175 200 225 255>;
27 default-brightness-level = <10>;
28 };
29
30 button-sw3 {
31 compatible = "gpio-keys";
32 pinctrl-names = "default";
33 pinctrl-0 = <&gpio_button_sw3_pins_mbmx28lc>;
34
35 sw3 {
36 label = "SW3";
37 gpios = <&gpio1 21 GPIO_ACTIVE_LOW>;
38 linux,code = <BTN_MISC>;
39 gpio-key,wakeup;
40 };
41 };
42
43 button-sw4 {
44 compatible = "gpio-keys";
45 pinctrl-names = "default";
46 pinctrl-0 = <&gpio_button_sw4_pins_mbmx28lc>;
47
48 sw4 {
49 label = "SW4";
50 gpios = <&gpio1 20 GPIO_ACTIVE_LOW>;
51 linux,code = <BTN_MISC>;
52 gpio-key,wakeup;
53 };
54 };
55
56 led-d6 {
57 compatible = "gpio-leds";
58 pinctrl-names = "default";
59 pinctrl-0 = <&led_d6_pins_mbmx28lc>;
60
61 led1 {
62 label = "d6";
63 gpios = <&gpio1 23 GPIO_ACTIVE_LOW>;
64 linux,default-trigger = "heartbeat";
65 };
66 };
67
68 led-d7 {
69 compatible = "gpio-leds";
70 pinctrl-names = "default";
71 pinctrl-0 = <&led_d7_pins_mbmx28lc>;
72
73 led1 {
74 label = "d7";
75 gpios = <&gpio1 22 GPIO_ACTIVE_LOW>;
76 linux,default-trigger = "default-on";
77 };
78 };
79
80 regulators {
81 compatible = "simple-bus";
82 #address-cells = <1>;
83 #size-cells = <0>;
84
85 reg_3p3v: regulator@0 {
86 compatible = "regulator-fixed";
87 regulator-name = "3P3V";
88 regulator-min-microvolt = <3300000>;
89 regulator-max-microvolt = <3300000>;
90 regulator-always-on;
91 };
92
93 reg_lcd_3v3: regulator@1 {
94 compatible = "regulator-fixed";
95 pinctrl-names = "default";
96 pinctrl-0 = <&reg_lcd_3v3_pins_mbmx28lc>;
97 regulator-name = "lcd-3v3";
98 regulator-min-microvolt = <3300000>;
99 regulator-max-microvolt = <3300000>;
100 gpio = <&gpio3 30 GPIO_ACTIVE_HIGH>;
101 enable-active-high;
102 };
103
104 reg_usb0_vbus: regulator@2 {
105 compatible = "regulator-fixed";
106 pinctrl-names = "default";
107 pinctrl-0 = <&reg_usb0_vbus_pins_mbmx28lc>;
108 regulator-name = "usb0_vbus";
109 regulator-min-microvolt = <5000000>;
110 regulator-max-microvolt = <5000000>;
111 gpio = <&gpio1 18 GPIO_ACTIVE_HIGH>;
112 enable-active-high;
113 };
114
115 reg_usb1_vbus: regulator@3 {
116 compatible = "regulator-fixed";
117 pinctrl-names = "default";
118 pinctrl-0 = <&reg_usb1_vbus_pins_mbmx28lc>;
119 regulator-name = "usb1_vbus";
120 regulator-min-microvolt = <5000000>;
121 regulator-max-microvolt = <5000000>;
122 gpio = <&gpio1 19 GPIO_ACTIVE_HIGH>;
123 enable-active-high;
124 };
125 };
126
127 sound {
128 compatible = "fsl,imx28-mbmx28lc-sgtl5000",
129 "fsl,mxs-audio-sgtl5000";
130 model = "imx28-mbmx28lc-sgtl5000";
131 saif-controllers = <&saif0 &saif1>;
132 audio-codec = <&sgtl5000>;
133 };
134};
135
136&duart {
137 pinctrl-names = "default";
138 pinctrl-0 = <&duart_4pins_a>;
139 status = "okay";
140};
141
142&i2c0 {
143 pinctrl-names = "default";
144 pinctrl-0 = <&i2c0_pins_a>;
145 status = "okay";
146
147 sgtl5000: codec@0a {
148 compatible = "fsl,sgtl5000";
149 reg = <0x0a>;
150 VDDA-supply = <&reg_3p3v>;
151 VDDIO-supply = <&reg_3p3v>;
152 clocks = <&saif0>;
153 };
154};
155
156&lcdif {
157 pinctrl-names = "default";
158 pinctrl-0 = <&lcdif_18bit_pins_a &lcdif_pins_mbmx28lc>;
159 lcd-supply = <&reg_lcd_3v3>;
160 display = <&display0>;
161 status = "okay";
162
163 display0: display0 {
164 model = "43WVF1G-0";
165 bits-per-pixel = <16>;
166 bus-width = <18>;
167
168 display-timings {
169 native-mode = <&timing0>;
170 timing0: timing0 {
171 clock-frequency = <9072000>;
172 hactive = <480>;
173 vactive = <272>;
174 hback-porch = <10>;
175 hfront-porch = <5>;
176 vback-porch = <8>;
177 vfront-porch = <8>;
178 hsync-len = <40>;
179 vsync-len = <10>;
180 hsync-active = <0>;
181 vsync-active = <0>;
182 de-active = <1>;
183 pixelclk-active = <1>;
184 };
185 };
186 };
187};
188
189&lradc {
190 fsl,lradc-touchscreen-wires = <4>;
191 status = "okay";
192};
193
194&pinctrl {
195 gpio_button_sw3_pins_mbmx28lc: gpio-button-sw3-mbmx28lc@0 {
196 reg = <0>;
197 fsl,pinmux-ids = <
198 MX28_PAD_LCD_D21__GPIO_1_21
199 >;
200 fsl,drive-strength = <MXS_DRIVE_4mA>;
201 fsl,voltage = <MXS_VOLTAGE_HIGH>;
202 fsl,pull-up = <MXS_PULL_DISABLE>;
203 };
204
205 gpio_button_sw4_pins_mbmx28lc: gpio-button-sw4-mbmx28lc@0 {
206 reg = <0>;
207 fsl,pinmux-ids = <
208 MX28_PAD_LCD_D20__GPIO_1_20
209 >;
210 fsl,drive-strength = <MXS_DRIVE_4mA>;
211 fsl,voltage = <MXS_VOLTAGE_HIGH>;
212 fsl,pull-up = <MXS_PULL_DISABLE>;
213 };
214
215 lcdif_pins_mbmx28lc: lcdif-mbmx28lc@0 {
216 reg = <0>;
217 fsl,pinmux-ids = <
218 MX28_PAD_LCD_VSYNC__LCD_VSYNC
219 MX28_PAD_LCD_HSYNC__LCD_HSYNC
220 MX28_PAD_LCD_DOTCLK__LCD_DOTCLK
221 MX28_PAD_LCD_ENABLE__LCD_ENABLE
222 >;
223 fsl,drive-strength = <MXS_DRIVE_4mA>;
224 fsl,voltage = <MXS_VOLTAGE_HIGH>;
225 fsl,pull-up = <MXS_PULL_DISABLE>;
226 };
227
228 led_d6_pins_mbmx28lc: led-d6-mbmx28lc@0 {
229 reg = <0>;
230 fsl,pinmux-ids = <
231 MX28_PAD_LCD_D23__GPIO_1_23
232 >;
233 fsl,drive-strength = <MXS_DRIVE_4mA>;
234 fsl,voltage = <MXS_VOLTAGE_HIGH>;
235 fsl,pull-up = <MXS_PULL_DISABLE>;
236 };
237
238 led_d7_pins_mbmx28lc: led-d7-mbmx28lc@0 {
239 reg = <0>;
240 fsl,pinmux-ids = <
241 MX28_PAD_LCD_D22__GPIO_1_22
242 >;
243 fsl,drive-strength = <MXS_DRIVE_4mA>;
244 fsl,voltage = <MXS_VOLTAGE_HIGH>;
245 fsl,pull-up = <MXS_PULL_DISABLE>;
246 };
247
248 reg_lcd_3v3_pins_mbmx28lc: lcd-3v3-mbmx28lc@0 {
249 reg = <0>;
250 fsl,pinmux-ids = <
251 MX28_PAD_LCD_RESET__GPIO_3_30
252 >;
253 fsl,drive-strength = <MXS_DRIVE_4mA>;
254 fsl,voltage = <MXS_VOLTAGE_HIGH>;
255 fsl,pull-up = <MXS_PULL_DISABLE>;
256 };
257
258 reg_usb0_vbus_pins_mbmx28lc: reg-usb0-vbus-mbmx28lc@0 {
259 reg = <0>;
260 fsl,pinmux-ids = <
261 MX28_PAD_LCD_D18__GPIO_1_18
262 >;
263 fsl,drive-strength = <MXS_DRIVE_4mA>;
264 fsl,voltage = <MXS_VOLTAGE_HIGH>;
265 fsl,pull-up = <MXS_PULL_DISABLE>;
266 };
267
268 reg_usb1_vbus_pins_mbmx28lc: reg-usb1-vbus-mbmx28lc@0 {
269 reg = <0>;
270 fsl,pinmux-ids = <
271 MX28_PAD_LCD_D19__GPIO_1_19
272 >;
273 fsl,drive-strength = <MXS_DRIVE_4mA>;
274 fsl,voltage = <MXS_VOLTAGE_HIGH>;
275 fsl,pull-up = <MXS_PULL_DISABLE>;
276 };
277};
278
279&pwm {
280 pinctrl-names = "default";
281 pinctrl-0 = <&pwm4_pins_a>;
282 status = "okay";
283};
284
285&saif0 {
286 pinctrl-names = "default";
287 pinctrl-0 = <&saif0_pins_a>;
288 status = "okay";
289};
290
291&saif1 {
292 pinctrl-names = "default";
293 pinctrl-0 = <&saif1_pins_a>;
294 fsl,saif-master = <&saif0>;
295 status = "okay";
296};
297
298&ssp0 {
299 compatible = "fsl,imx28-mmc";
300 pinctrl-names = "default";
301 pinctrl-0 = <&mmc0_4bit_pins_a &mmc0_cd_cfg &mmc0_sck_cfg>;
302 bus-width = <4>;
303 cd-inverted;
304 status = "okay";
305};
306
307&usb0 {
308 disable-over-current;
309 vbus-supply = <&reg_usb0_vbus>;
310 status = "okay";
311 pinctrl-names = "default";
312 pinctrl-0 = <&usb0_id_pins_b>;
313};
314
315&usb1 {
316 vbus-supply = <&reg_usb1_vbus>;
317 status = "okay";
318};
319
320&usbphy0 {
321 status = "okay";
322};
323
324&usbphy1 {
325 status = "okay";
326};
diff --git a/arch/arm/boot/dts/imx28-evk.dts b/arch/arm/boot/dts/imx28-evk.dts
index 4267c2b05d60..e4cc44c98585 100644
--- a/arch/arm/boot/dts/imx28-evk.dts
+++ b/arch/arm/boot/dts/imx28-evk.dts
@@ -193,6 +193,7 @@
193 i2c0: i2c@80058000 { 193 i2c0: i2c@80058000 {
194 pinctrl-names = "default"; 194 pinctrl-names = "default";
195 pinctrl-0 = <&i2c0_pins_a>; 195 pinctrl-0 = <&i2c0_pins_a>;
196 clock-frequency = <400000>;
196 status = "okay"; 197 status = "okay";
197 198
198 sgtl5000: codec@0a { 199 sgtl5000: codec@0a {
@@ -278,33 +279,39 @@
278 279
279 regulators { 280 regulators {
280 compatible = "simple-bus"; 281 compatible = "simple-bus";
282 #address-cells = <1>;
283 #size-cells = <0>;
281 284
282 reg_3p3v: 3p3v { 285 reg_3p3v: regulator@0 {
283 compatible = "regulator-fixed"; 286 compatible = "regulator-fixed";
287 reg = <0>;
284 regulator-name = "3P3V"; 288 regulator-name = "3P3V";
285 regulator-min-microvolt = <3300000>; 289 regulator-min-microvolt = <3300000>;
286 regulator-max-microvolt = <3300000>; 290 regulator-max-microvolt = <3300000>;
287 regulator-always-on; 291 regulator-always-on;
288 }; 292 };
289 293
290 reg_vddio_sd0: vddio-sd0 { 294 reg_vddio_sd0: regulator@1 {
291 compatible = "regulator-fixed"; 295 compatible = "regulator-fixed";
296 reg = <1>;
292 regulator-name = "vddio-sd0"; 297 regulator-name = "vddio-sd0";
293 regulator-min-microvolt = <3300000>; 298 regulator-min-microvolt = <3300000>;
294 regulator-max-microvolt = <3300000>; 299 regulator-max-microvolt = <3300000>;
295 gpio = <&gpio3 28 0>; 300 gpio = <&gpio3 28 0>;
296 }; 301 };
297 302
298 reg_fec_3v3: fec-3v3 { 303 reg_fec_3v3: regulator@2 {
299 compatible = "regulator-fixed"; 304 compatible = "regulator-fixed";
305 reg = <2>;
300 regulator-name = "fec-3v3"; 306 regulator-name = "fec-3v3";
301 regulator-min-microvolt = <3300000>; 307 regulator-min-microvolt = <3300000>;
302 regulator-max-microvolt = <3300000>; 308 regulator-max-microvolt = <3300000>;
303 gpio = <&gpio2 15 0>; 309 gpio = <&gpio2 15 0>;
304 }; 310 };
305 311
306 reg_usb0_vbus: usb0_vbus { 312 reg_usb0_vbus: regulator@3 {
307 compatible = "regulator-fixed"; 313 compatible = "regulator-fixed";
314 reg = <3>;
308 regulator-name = "usb0_vbus"; 315 regulator-name = "usb0_vbus";
309 regulator-min-microvolt = <5000000>; 316 regulator-min-microvolt = <5000000>;
310 regulator-max-microvolt = <5000000>; 317 regulator-max-microvolt = <5000000>;
@@ -312,8 +319,9 @@
312 enable-active-high; 319 enable-active-high;
313 }; 320 };
314 321
315 reg_usb1_vbus: usb1_vbus { 322 reg_usb1_vbus: regulator@4 {
316 compatible = "regulator-fixed"; 323 compatible = "regulator-fixed";
324 reg = <4>;
317 regulator-name = "usb1_vbus"; 325 regulator-name = "usb1_vbus";
318 regulator-min-microvolt = <5000000>; 326 regulator-min-microvolt = <5000000>;
319 regulator-max-microvolt = <5000000>; 327 regulator-max-microvolt = <5000000>;
@@ -321,8 +329,9 @@
321 enable-active-high; 329 enable-active-high;
322 }; 330 };
323 331
324 reg_lcd_3v3: lcd-3v3 { 332 reg_lcd_3v3: regulator@5 {
325 compatible = "regulator-fixed"; 333 compatible = "regulator-fixed";
334 reg = <5>;
326 regulator-name = "lcd-3v3"; 335 regulator-name = "lcd-3v3";
327 regulator-min-microvolt = <3300000>; 336 regulator-min-microvolt = <3300000>;
328 regulator-max-microvolt = <3300000>; 337 regulator-max-microvolt = <3300000>;
@@ -330,8 +339,9 @@
330 enable-active-high; 339 enable-active-high;
331 }; 340 };
332 341
333 reg_can_3v3: can-3v3 { 342 reg_can_3v3: regulator@6 {
334 compatible = "regulator-fixed"; 343 compatible = "regulator-fixed";
344 reg = <6>;
335 regulator-name = "can-3v3"; 345 regulator-name = "can-3v3";
336 regulator-min-microvolt = <3300000>; 346 regulator-min-microvolt = <3300000>;
337 regulator-max-microvolt = <3300000>; 347 regulator-max-microvolt = <3300000>;
diff --git a/arch/arm/boot/dts/imx28-m28cu3.dts b/arch/arm/boot/dts/imx28-m28cu3.dts
index d3958da60bd7..9348ce59dda4 100644
--- a/arch/arm/boot/dts/imx28-m28cu3.dts
+++ b/arch/arm/boot/dts/imx28-m28cu3.dts
@@ -116,7 +116,6 @@
116 pinctrl-0 = <&lcdif_24bit_pins_a 116 pinctrl-0 = <&lcdif_24bit_pins_a
117 &lcdif_pins_m28>; 117 &lcdif_pins_m28>;
118 display = <&display>; 118 display = <&display>;
119 reset-active-high;
120 status = "okay"; 119 status = "okay";
121 120
122 display: display0 { 121 display: display0 {
@@ -180,7 +179,7 @@
180 usb1: usb@80090000 { 179 usb1: usb@80090000 {
181 vbus-supply = <&reg_usb1_vbus>; 180 vbus-supply = <&reg_usb1_vbus>;
182 pinctrl-names = "default"; 181 pinctrl-names = "default";
183 pinctrl-0 = <&usbphy1_pins_a>; 182 pinctrl-0 = <&usb1_pins_a>;
184 disable-over-current; 183 disable-over-current;
185 status = "okay"; 184 status = "okay";
186 }; 185 };
@@ -229,33 +228,39 @@
229 228
230 regulators { 229 regulators {
231 compatible = "simple-bus"; 230 compatible = "simple-bus";
231 #address-cells = <1>;
232 #size-cells = <0>;
232 233
233 reg_3p3v: 3p3v { 234 reg_3p3v: regulator@0 {
234 compatible = "regulator-fixed"; 235 compatible = "regulator-fixed";
236 reg = <0>;
235 regulator-name = "3P3V"; 237 regulator-name = "3P3V";
236 regulator-min-microvolt = <3300000>; 238 regulator-min-microvolt = <3300000>;
237 regulator-max-microvolt = <3300000>; 239 regulator-max-microvolt = <3300000>;
238 regulator-always-on; 240 regulator-always-on;
239 }; 241 };
240 242
241 reg_vddio_sd0: vddio-sd0 { 243 reg_vddio_sd0: regulator@1 {
242 compatible = "regulator-fixed"; 244 compatible = "regulator-fixed";
245 reg = <1>;
243 regulator-name = "vddio-sd0"; 246 regulator-name = "vddio-sd0";
244 regulator-min-microvolt = <3300000>; 247 regulator-min-microvolt = <3300000>;
245 regulator-max-microvolt = <3300000>; 248 regulator-max-microvolt = <3300000>;
246 gpio = <&gpio3 29 0>; 249 gpio = <&gpio3 29 0>;
247 }; 250 };
248 251
249 reg_vddio_sd1: vddio-sd1 { 252 reg_vddio_sd1: regulator@2 {
250 compatible = "regulator-fixed"; 253 compatible = "regulator-fixed";
254 reg = <2>;
251 regulator-name = "vddio-sd1"; 255 regulator-name = "vddio-sd1";
252 regulator-min-microvolt = <3300000>; 256 regulator-min-microvolt = <3300000>;
253 regulator-max-microvolt = <3300000>; 257 regulator-max-microvolt = <3300000>;
254 gpio = <&gpio2 19 0>; 258 gpio = <&gpio2 19 0>;
255 }; 259 };
256 260
257 reg_usb1_vbus: usb1_vbus { 261 reg_usb1_vbus: regulator@3 {
258 compatible = "regulator-fixed"; 262 compatible = "regulator-fixed";
263 reg = <3>;
259 regulator-name = "usb1_vbus"; 264 regulator-name = "usb1_vbus";
260 regulator-min-microvolt = <5000000>; 265 regulator-min-microvolt = <5000000>;
261 regulator-max-microvolt = <5000000>; 266 regulator-max-microvolt = <5000000>;
diff --git a/arch/arm/boot/dts/imx28-m28evk.dts b/arch/arm/boot/dts/imx28-m28evk.dts
index 8e2477fbe1d7..f0ad7b9b9d9a 100644
--- a/arch/arm/boot/dts/imx28-m28evk.dts
+++ b/arch/arm/boot/dts/imx28-m28evk.dts
@@ -194,7 +194,7 @@
194 }; 194 };
195 195
196 rtc: rtc@68 { 196 rtc: rtc@68 {
197 compatible = "stm,mt41t62"; 197 compatible = "stm,m41t62";
198 reg = <0x68>; 198 reg = <0x68>;
199 }; 199 };
200 }; 200 };
@@ -248,14 +248,14 @@
248 usb0: usb@80080000 { 248 usb0: usb@80080000 {
249 vbus-supply = <&reg_usb0_vbus>; 249 vbus-supply = <&reg_usb0_vbus>;
250 pinctrl-names = "default"; 250 pinctrl-names = "default";
251 pinctrl-0 = <&usbphy0_pins_a>; 251 pinctrl-0 = <&usb0_pins_a>;
252 status = "okay"; 252 status = "okay";
253 }; 253 };
254 254
255 usb1: usb@80090000 { 255 usb1: usb@80090000 {
256 vbus-supply = <&reg_usb1_vbus>; 256 vbus-supply = <&reg_usb1_vbus>;
257 pinctrl-names = "default"; 257 pinctrl-names = "default";
258 pinctrl-0 = <&usbphy1_pins_a>; 258 pinctrl-0 = <&usb1_pins_a>;
259 status = "okay"; 259 status = "okay";
260 }; 260 };
261 261
@@ -285,33 +285,39 @@
285 285
286 regulators { 286 regulators {
287 compatible = "simple-bus"; 287 compatible = "simple-bus";
288 #address-cells = <1>;
289 #size-cells = <0>;
288 290
289 reg_3p3v: 3p3v { 291 reg_3p3v: regulator@0 {
290 compatible = "regulator-fixed"; 292 compatible = "regulator-fixed";
293 reg = <0>;
291 regulator-name = "3P3V"; 294 regulator-name = "3P3V";
292 regulator-min-microvolt = <3300000>; 295 regulator-min-microvolt = <3300000>;
293 regulator-max-microvolt = <3300000>; 296 regulator-max-microvolt = <3300000>;
294 regulator-always-on; 297 regulator-always-on;
295 }; 298 };
296 299
297 reg_vddio_sd0: vddio-sd0 { 300 reg_vddio_sd0: regulator@1 {
298 compatible = "regulator-fixed"; 301 compatible = "regulator-fixed";
302 reg = <1>;
299 regulator-name = "vddio-sd0"; 303 regulator-name = "vddio-sd0";
300 regulator-min-microvolt = <3300000>; 304 regulator-min-microvolt = <3300000>;
301 regulator-max-microvolt = <3300000>; 305 regulator-max-microvolt = <3300000>;
302 gpio = <&gpio3 28 0>; 306 gpio = <&gpio3 28 0>;
303 }; 307 };
304 308
305 reg_usb0_vbus: usb0_vbus { 309 reg_usb0_vbus: regulator@2 {
306 compatible = "regulator-fixed"; 310 compatible = "regulator-fixed";
311 reg = <2>;
307 regulator-name = "usb0_vbus"; 312 regulator-name = "usb0_vbus";
308 regulator-min-microvolt = <5000000>; 313 regulator-min-microvolt = <5000000>;
309 regulator-max-microvolt = <5000000>; 314 regulator-max-microvolt = <5000000>;
310 gpio = <&gpio3 12 0>; 315 gpio = <&gpio3 12 0>;
311 }; 316 };
312 317
313 reg_usb1_vbus: usb1_vbus { 318 reg_usb1_vbus: regulator@3 {
314 compatible = "regulator-fixed"; 319 compatible = "regulator-fixed";
320 reg = <3>;
315 regulator-name = "usb1_vbus"; 321 regulator-name = "usb1_vbus";
316 regulator-min-microvolt = <5000000>; 322 regulator-min-microvolt = <5000000>;
317 regulator-max-microvolt = <5000000>; 323 regulator-max-microvolt = <5000000>;
diff --git a/arch/arm/boot/dts/imx28-sps1.dts b/arch/arm/boot/dts/imx28-sps1.dts
index 4870f07bf56a..0ce3cb8e7914 100644
--- a/arch/arm/boot/dts/imx28-sps1.dts
+++ b/arch/arm/boot/dts/imx28-sps1.dts
@@ -106,7 +106,7 @@
106 usb0: usb@80080000 { 106 usb0: usb@80080000 {
107 vbus-supply = <&reg_usb0_vbus>; 107 vbus-supply = <&reg_usb0_vbus>;
108 pinctrl-names = "default"; 108 pinctrl-names = "default";
109 pinctrl-0 = <&usbphy0_pins_b>; 109 pinctrl-0 = <&usb0_pins_b>;
110 status = "okay"; 110 status = "okay";
111 }; 111 };
112 112
@@ -127,9 +127,12 @@
127 127
128 regulators { 128 regulators {
129 compatible = "simple-bus"; 129 compatible = "simple-bus";
130 #address-cells = <1>;
131 #size-cells = <0>;
130 132
131 reg_usb0_vbus: usb0_vbus { 133 reg_usb0_vbus: regulator@0 {
132 compatible = "regulator-fixed"; 134 compatible = "regulator-fixed";
135 reg = <0>;
133 regulator-name = "usb0_vbus"; 136 regulator-name = "usb0_vbus";
134 regulator-min-microvolt = <5000000>; 137 regulator-min-microvolt = <5000000>;
135 regulator-max-microvolt = <5000000>; 138 regulator-max-microvolt = <5000000>;
diff --git a/arch/arm/boot/dts/imx28-tx28.dts b/arch/arm/boot/dts/imx28-tx28.dts
index be5a0550d58c..e14bd86f3e99 100644
--- a/arch/arm/boot/dts/imx28-tx28.dts
+++ b/arch/arm/boot/dts/imx28-tx28.dts
@@ -43,9 +43,12 @@
43 43
44 regulators { 44 regulators {
45 compatible = "simple-bus"; 45 compatible = "simple-bus";
46 #address-cells = <1>;
47 #size-cells = <0>;
46 48
47 reg_usb0_vbus: usb0_vbus { 49 reg_usb0_vbus: regulator@0 {
48 compatible = "regulator-fixed"; 50 compatible = "regulator-fixed";
51 reg = <0>;
49 regulator-name = "usb0_vbus"; 52 regulator-name = "usb0_vbus";
50 regulator-min-microvolt = <5000000>; 53 regulator-min-microvolt = <5000000>;
51 regulator-max-microvolt = <5000000>; 54 regulator-max-microvolt = <5000000>;
@@ -53,8 +56,9 @@
53 enable-active-high; 56 enable-active-high;
54 }; 57 };
55 58
56 reg_usb1_vbus: usb1_vbus { 59 reg_usb1_vbus: regulator@1 {
57 compatible = "regulator-fixed"; 60 compatible = "regulator-fixed";
61 reg = <1>;
58 regulator-name = "usb1_vbus"; 62 regulator-name = "usb1_vbus";
59 regulator-min-microvolt = <5000000>; 63 regulator-min-microvolt = <5000000>;
60 regulator-max-microvolt = <5000000>; 64 regulator-max-microvolt = <5000000>;
@@ -62,35 +66,38 @@
62 enable-active-high; 66 enable-active-high;
63 }; 67 };
64 68
65 reg_2p5v: 2p5v { 69 reg_2p5v: regulator@2 {
66 compatible = "regulator-fixed"; 70 compatible = "regulator-fixed";
71 reg = <2>;
67 regulator-name = "2P5V"; 72 regulator-name = "2P5V";
68 regulator-min-microvolt = <2500000>; 73 regulator-min-microvolt = <2500000>;
69 regulator-max-microvolt = <2500000>; 74 regulator-max-microvolt = <2500000>;
70 regulator-always-on; 75 regulator-always-on;
71 }; 76 };
72 77
73 reg_3p3v: 3p3v { 78 reg_3p3v: regulator@3 {
74 compatible = "regulator-fixed"; 79 compatible = "regulator-fixed";
80 reg = <3>;
75 regulator-name = "3P3V"; 81 regulator-name = "3P3V";
76 regulator-min-microvolt = <3300000>; 82 regulator-min-microvolt = <3300000>;
77 regulator-max-microvolt = <3300000>; 83 regulator-max-microvolt = <3300000>;
78 regulator-always-on; 84 regulator-always-on;
79 }; 85 };
80 86
81 reg_can_xcvr: can-xcvr { 87 reg_can_xcvr: regulator@4 {
82 compatible = "regulator-fixed"; 88 compatible = "regulator-fixed";
89 reg = <4>;
83 regulator-name = "CAN XCVR"; 90 regulator-name = "CAN XCVR";
84 regulator-min-microvolt = <3300000>; 91 regulator-min-microvolt = <3300000>;
85 regulator-max-microvolt = <3300000>; 92 regulator-max-microvolt = <3300000>;
86 gpio = <&gpio1 0 0>; 93 gpio = <&gpio1 0 0>;
87 enable-active-low;
88 pinctrl-names = "default"; 94 pinctrl-names = "default";
89 pinctrl-0 = <&tx28_flexcan_xcvr_pins>; 95 pinctrl-0 = <&tx28_flexcan_xcvr_pins>;
90 }; 96 };
91 97
92 reg_lcd: lcd-power { 98 reg_lcd: regulator@5 {
93 compatible = "regulator-fixed"; 99 compatible = "regulator-fixed";
100 reg = <5>;
94 regulator-name = "LCD POWER"; 101 regulator-name = "LCD POWER";
95 regulator-min-microvolt = <3300000>; 102 regulator-min-microvolt = <3300000>;
96 regulator-max-microvolt = <3300000>; 103 regulator-max-microvolt = <3300000>;
@@ -98,8 +105,9 @@
98 enable-active-high; 105 enable-active-high;
99 }; 106 };
100 107
101 reg_lcd_reset: lcd-reset { 108 reg_lcd_reset: regulator@6 {
102 compatible = "regulator-fixed"; 109 compatible = "regulator-fixed";
110 reg = <6>;
103 regulator-name = "LCD RESET"; 111 regulator-name = "LCD RESET";
104 regulator-min-microvolt = <3300000>; 112 regulator-min-microvolt = <3300000>;
105 regulator-max-microvolt = <3300000>; 113 regulator-max-microvolt = <3300000>;
diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
index f8e9b20f6982..90a579532b8b 100644
--- a/arch/arm/boot/dts/imx28.dtsi
+++ b/arch/arm/boot/dts/imx28.dtsi
@@ -32,6 +32,8 @@
32 serial4 = &auart4; 32 serial4 = &auart4;
33 spi0 = &ssp1; 33 spi0 = &ssp1;
34 spi1 = &ssp2; 34 spi1 = &ssp2;
35 usbphy0 = &usbphy0;
36 usbphy1 = &usbphy1;
35 }; 37 };
36 38
37 cpus { 39 cpus {
@@ -343,6 +345,19 @@
343 fsl,pull-up = <MXS_PULL_DISABLE>; 345 fsl,pull-up = <MXS_PULL_DISABLE>;
344 }; 346 };
345 347
348 auart2_pins_a: auart2-pins@0 {
349 reg = <0>;
350 fsl,pinmux-ids = <
351 MX28_PAD_AUART2_RX__AUART2_RX
352 MX28_PAD_AUART2_TX__AUART2_TX
353 MX28_PAD_AUART2_CTS__AUART2_CTS
354 MX28_PAD_AUART2_RTS__AUART2_RTS
355 >;
356 fsl,drive-strength = <MXS_DRIVE_4mA>;
357 fsl,voltage = <MXS_VOLTAGE_HIGH>;
358 fsl,pull-up = <MXS_PULL_DISABLE>;
359 };
360
346 auart3_pins_a: auart3@0 { 361 auart3_pins_a: auart3@0 {
347 reg = <0>; 362 reg = <0>;
348 fsl,pinmux-ids = < 363 fsl,pinmux-ids = <
@@ -655,6 +670,33 @@
655 fsl,pull-up = <MXS_PULL_DISABLE>; 670 fsl,pull-up = <MXS_PULL_DISABLE>;
656 }; 671 };
657 672
673 lcdif_18bit_pins_a: lcdif-18bit@0 {
674 reg = <0>;
675 fsl,pinmux-ids = <
676 MX28_PAD_LCD_D00__LCD_D0
677 MX28_PAD_LCD_D01__LCD_D1
678 MX28_PAD_LCD_D02__LCD_D2
679 MX28_PAD_LCD_D03__LCD_D3
680 MX28_PAD_LCD_D04__LCD_D4
681 MX28_PAD_LCD_D05__LCD_D5
682 MX28_PAD_LCD_D06__LCD_D6
683 MX28_PAD_LCD_D07__LCD_D7
684 MX28_PAD_LCD_D08__LCD_D8
685 MX28_PAD_LCD_D09__LCD_D9
686 MX28_PAD_LCD_D10__LCD_D10
687 MX28_PAD_LCD_D11__LCD_D11
688 MX28_PAD_LCD_D12__LCD_D12
689 MX28_PAD_LCD_D13__LCD_D13
690 MX28_PAD_LCD_D14__LCD_D14
691 MX28_PAD_LCD_D15__LCD_D15
692 MX28_PAD_LCD_D16__LCD_D16
693 MX28_PAD_LCD_D17__LCD_D17
694 >;
695 fsl,drive-strength = <MXS_DRIVE_4mA>;
696 fsl,voltage = <MXS_VOLTAGE_HIGH>;
697 fsl,pull-up = <MXS_PULL_DISABLE>;
698 };
699
658 lcdif_16bit_pins_a: lcdif-16bit@0 { 700 lcdif_16bit_pins_a: lcdif-16bit@0 {
659 reg = <0>; 701 reg = <0>;
660 fsl,pinmux-ids = < 702 fsl,pinmux-ids = <
@@ -743,7 +785,7 @@
743 fsl,pull-up = <MXS_PULL_DISABLE>; 785 fsl,pull-up = <MXS_PULL_DISABLE>;
744 }; 786 };
745 787
746 usbphy0_pins_a: usbphy0@0 { 788 usb0_pins_a: usb0@0 {
747 reg = <0>; 789 reg = <0>;
748 fsl,pinmux-ids = < 790 fsl,pinmux-ids = <
749 MX28_PAD_SSP2_SS2__USB0_OVERCURRENT 791 MX28_PAD_SSP2_SS2__USB0_OVERCURRENT
@@ -753,7 +795,7 @@
753 fsl,pull-up = <MXS_PULL_DISABLE>; 795 fsl,pull-up = <MXS_PULL_DISABLE>;
754 }; 796 };
755 797
756 usbphy0_pins_b: usbphy0@1 { 798 usb0_pins_b: usb0@1 {
757 reg = <1>; 799 reg = <1>;
758 fsl,pinmux-ids = < 800 fsl,pinmux-ids = <
759 MX28_PAD_AUART1_CTS__USB0_OVERCURRENT 801 MX28_PAD_AUART1_CTS__USB0_OVERCURRENT
@@ -763,7 +805,7 @@
763 fsl,pull-up = <MXS_PULL_DISABLE>; 805 fsl,pull-up = <MXS_PULL_DISABLE>;
764 }; 806 };
765 807
766 usbphy1_pins_a: usbphy1@0 { 808 usb1_pins_a: usb1@0 {
767 reg = <0>; 809 reg = <0>;
768 fsl,pinmux-ids = < 810 fsl,pinmux-ids = <
769 MX28_PAD_SSP2_SS1__USB1_OVERCURRENT 811 MX28_PAD_SSP2_SS1__USB1_OVERCURRENT
@@ -782,6 +824,17 @@
782 fsl,voltage = <MXS_VOLTAGE_HIGH>; 824 fsl,voltage = <MXS_VOLTAGE_HIGH>;
783 fsl,pull-up = <MXS_PULL_ENABLE>; 825 fsl,pull-up = <MXS_PULL_ENABLE>;
784 }; 826 };
827
828 usb0_id_pins_b: usb0id1@0 {
829 reg = <0>;
830 fsl,pinmux-ids = <
831 MX28_PAD_PWM2__USB0_ID
832 >;
833 fsl,drive-strength = <MXS_DRIVE_12mA>;
834 fsl,voltage = <MXS_VOLTAGE_HIGH>;
835 fsl,pull-up = <MXS_PULL_ENABLE>;
836 };
837
785 }; 838 };
786 839
787 digctl: digctl@8001c000 { 840 digctl: digctl@8001c000 {
@@ -946,6 +999,7 @@
946 20 21 22 23 24 25>; 999 20 21 22 23 24 25>;
947 status = "disabled"; 1000 status = "disabled";
948 clocks = <&clks 41>; 1001 clocks = <&clks 41>;
1002 #io-channel-cells = <1>;
949 }; 1003 };
950 1004
951 spdif: spdif@80054000 { 1005 spdif: spdif@80054000 {
@@ -1130,4 +1184,9 @@
1130 status = "disabled"; 1184 status = "disabled";
1131 }; 1185 };
1132 }; 1186 };
1187
1188 iio_hwmon {
1189 compatible = "iio-hwmon";
1190 io-channels = <&lradc 8>;
1191 };
1133}; 1192};
diff --git a/arch/arm/boot/dts/imx35-eukrea-cpuimx35.dtsi b/arch/arm/boot/dts/imx35-eukrea-cpuimx35.dtsi
new file mode 100644
index 000000000000..906ae937b013
--- /dev/null
+++ b/arch/arm/boot/dts/imx35-eukrea-cpuimx35.dtsi
@@ -0,0 +1,81 @@
1/*
2 * Copyright 2013 Eukréa Electromatique <denis@eukrea.com>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
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
14#include "imx35.dtsi"
15
16/ {
17 model = "Eukrea CPUIMX35";
18 compatible = "eukrea,cpuimx35", "fsl,imx35";
19
20 memory {
21 reg = <0x80000000 0x8000000>; /* 128M */
22 };
23};
24
25&fec {
26 pinctrl-names = "default";
27 pinctrl-0 = <&pinctrl_fec>;
28 status = "okay";
29};
30
31&i2c1 {
32 pinctrl-names = "default";
33 pinctrl-0 = <&pinctrl_i2c1>;
34 status = "okay";
35
36 pcf8563@51 {
37 compatible = "nxp,pcf8563";
38 reg = <0x51>;
39 };
40};
41
42&iomuxc {
43 imx35-eukrea {
44 pinctrl_fec: fecgrp {
45 fsl,pins = <
46 MX35_PAD_FEC_TX_CLK__FEC_TX_CLK 0x80000000
47 MX35_PAD_FEC_RX_CLK__FEC_RX_CLK 0x80000000
48 MX35_PAD_FEC_RX_DV__FEC_RX_DV 0x80000000
49 MX35_PAD_FEC_COL__FEC_COL 0x80000000
50 MX35_PAD_FEC_RDATA0__FEC_RDATA_0 0x80000000
51 MX35_PAD_FEC_TDATA0__FEC_TDATA_0 0x80000000
52 MX35_PAD_FEC_TX_EN__FEC_TX_EN 0x80000000
53 MX35_PAD_FEC_MDC__FEC_MDC 0x80000000
54 MX35_PAD_FEC_MDIO__FEC_MDIO 0x80000000
55 MX35_PAD_FEC_TX_ERR__FEC_TX_ERR 0x80000000
56 MX35_PAD_FEC_RX_ERR__FEC_RX_ERR 0x80000000
57 MX35_PAD_FEC_CRS__FEC_CRS 0x80000000
58 MX35_PAD_FEC_RDATA1__FEC_RDATA_1 0x80000000
59 MX35_PAD_FEC_TDATA1__FEC_TDATA_1 0x80000000
60 MX35_PAD_FEC_RDATA2__FEC_RDATA_2 0x80000000
61 MX35_PAD_FEC_TDATA2__FEC_TDATA_2 0x80000000
62 MX35_PAD_FEC_RDATA3__FEC_RDATA_3 0x80000000
63 MX35_PAD_FEC_TDATA3__FEC_TDATA_3 0x80000000
64 >;
65 };
66
67 pinctrl_i2c1: i2c1grp {
68 fsl,pins = <
69 MX35_PAD_I2C1_CLK__I2C1_SCL 0x80000000
70 MX35_PAD_I2C1_DAT__I2C1_SDA 0x80000000
71 >;
72 };
73 };
74};
75
76&nfc {
77 nand-bus-width = <8>;
78 nand-ecc-mode = "hw";
79 nand-on-flash-bbt;
80 status = "okay";
81};
diff --git a/arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard.dts b/arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard.dts
new file mode 100644
index 000000000000..1bdec21f4533
--- /dev/null
+++ b/arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard.dts
@@ -0,0 +1,143 @@
1/*
2 * Copyright 2013 Eukréa Electromatique <denis@eukrea.com>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
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
14/dts-v1/;
15
16#include <dt-bindings/gpio/gpio.h>
17#include <dt-bindings/input/input.h>
18#include "imx35-eukrea-cpuimx35.dtsi"
19
20/ {
21 model = "Eukrea CPUIMX35";
22 compatible = "eukrea,mbimxsd35-baseboard", "eukrea,cpuimx35", "fsl,imx35";
23
24 gpio_keys {
25 compatible = "gpio-keys";
26 pinctrl-names = "default";
27 pinctrl-0 = <&pinctrl_bp1>;
28
29 bp1 {
30 label = "BP1";
31 gpios = <&gpio3 25 GPIO_ACTIVE_LOW>;
32 linux,code = <BTN_MISC>;
33 gpio-key,wakeup;
34 linux,input-type = <1>;
35 };
36 };
37
38 leds {
39 compatible = "gpio-leds";
40 pinctrl-names = "default";
41 pinctrl-0 = <&pinctrl_led1>;
42
43 led1 {
44 label = "led1";
45 gpios = <&gpio3 29 GPIO_ACTIVE_LOW>;
46 linux,default-trigger = "heartbeat";
47 };
48 };
49};
50
51&audmux {
52 pinctrl-names = "default";
53 pinctrl-0 = <&pinctrl_audmux>;
54 status = "okay";
55};
56
57&esdhc1 {
58 pinctrl-names = "default";
59 pinctrl-0 = <&pinctrl_esdhc1>;
60 cd-gpios = <&gpio3 24>;
61 status = "okay";
62};
63
64&i2c1 {
65 tlv320aic23: codec@1a {
66 compatible = "ti,tlv320aic23";
67 reg = <0x1a>;
68 };
69};
70
71&iomuxc {
72 imx35-eukrea {
73 pinctrl_audmux: audmuxgrp {
74 fsl,pins = <
75 MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS 0x80000000
76 MX35_PAD_STXD4__AUDMUX_AUD4_TXD 0x80000000
77 MX35_PAD_SRXD4__AUDMUX_AUD4_RXD 0x80000000
78 MX35_PAD_SCK4__AUDMUX_AUD4_TXC 0x80000000
79 >;
80 };
81
82 pinctrl_bp1: bp1grp {
83 fsl,pins = <MX35_PAD_LD19__GPIO3_25 0x80000000>;
84 };
85
86 pinctrl_esdhc1: esdhc1grp {
87 fsl,pins = <
88 MX35_PAD_SD1_CMD__ESDHC1_CMD 0x80000000
89 MX35_PAD_SD1_CLK__ESDHC1_CLK 0x80000000
90 MX35_PAD_SD1_DATA0__ESDHC1_DAT0 0x80000000
91 MX35_PAD_SD1_DATA1__ESDHC1_DAT1 0x80000000
92 MX35_PAD_SD1_DATA2__ESDHC1_DAT2 0x80000000
93 MX35_PAD_SD1_DATA3__ESDHC1_DAT3 0x80000000
94 MX35_PAD_LD18__GPIO3_24 0x80000000 /* CD */
95 >;
96 };
97
98 pinctrl_led1: led1grp {
99 fsl,pins = <MX35_PAD_LD23__GPIO3_29 0x80000000>;
100 };
101
102 pinctrl_reg_lcd_3v3: reg-lcd-3v3 {
103 fsl,pins = <MX35_PAD_D3_CLS__GPIO1_4 0x80000000>;
104 };
105
106 pinctrl_uart1: uart1grp {
107 fsl,pins = <
108 MX35_PAD_TXD1__UART1_TXD_MUX 0x1c5
109 MX35_PAD_RXD1__UART1_RXD_MUX 0x1c5
110 MX35_PAD_CTS1__UART1_CTS 0x1c5
111 MX35_PAD_RTS1__UART1_RTS 0x1c5
112 >;
113 };
114
115 pinctrl_uart2: uart2grp {
116 fsl,pins = <
117 MX35_PAD_RXD2__UART2_RXD_MUX 0x1c5
118 MX35_PAD_TXD2__UART2_TXD_MUX 0x1c5
119 MX35_PAD_RTS2__UART2_RTS 0x1c5
120 MX35_PAD_CTS2__UART2_CTS 0x1c5
121 >;
122 };
123 };
124};
125
126&ssi1 {
127 fsl,mode = "i2s-slave";
128 status = "okay";
129};
130
131&uart1 {
132 pinctrl-names = "default";
133 pinctrl-0 = <&pinctrl_uart1>;
134 fsl,uart-has-rtscts;
135 status = "okay";
136};
137
138&uart2 {
139 pinctrl-names = "default";
140 pinctrl-0 = <&pinctrl_uart2>;
141 fsl,uart-has-rtscts;
142 status = "okay";
143};
diff --git a/arch/arm/boot/dts/imx35.dtsi b/arch/arm/boot/dts/imx35.dtsi
new file mode 100644
index 000000000000..88b218f8f810
--- /dev/null
+++ b/arch/arm/boot/dts/imx35.dtsi
@@ -0,0 +1,359 @@
1/*
2 * Copyright 2012 Steffen Trumtrar, Pengutronix
3 *
4 * based on imx27.dtsi
5 *
6 * This program is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU General Public License version 2 as published by the
8 * Free Software Foundation.
9 */
10
11#include "skeleton.dtsi"
12#include "imx35-pinfunc.h"
13
14/ {
15 aliases {
16 gpio0 = &gpio1;
17 gpio1 = &gpio2;
18 gpio2 = &gpio3;
19 serial0 = &uart1;
20 serial1 = &uart2;
21 serial2 = &uart3;
22 spi0 = &spi1;
23 spi1 = &spi2;
24 };
25
26 cpus {
27 #address-cells = <0>;
28 #size-cells = <0>;
29
30 cpu {
31 compatible = "arm,arm1136";
32 device_type = "cpu";
33 };
34 };
35
36 avic: avic-interrupt-controller@68000000 {
37 compatible = "fsl,imx35-avic", "fsl,avic";
38 interrupt-controller;
39 #interrupt-cells = <1>;
40 reg = <0x68000000 0x10000000>;
41 };
42
43 soc {
44 #address-cells = <1>;
45 #size-cells = <1>;
46 compatible = "simple-bus";
47 interrupt-parent = <&avic>;
48 ranges;
49
50 L2: l2-cache@30000000 {
51 compatible = "arm,l210-cache";
52 reg = <0x30000000 0x1000>;
53 cache-unified;
54 cache-level = <2>;
55 };
56
57 aips1: aips@43f00000 {
58 compatible = "fsl,aips", "simple-bus";
59 #address-cells = <1>;
60 #size-cells = <1>;
61 reg = <0x43f00000 0x100000>;
62 ranges;
63
64 i2c1: i2c@43f80000 {
65 #address-cells = <1>;
66 #size-cells = <0>;
67 compatible = "fsl,imx35-i2c", "fsl,imx1-i2c";
68 reg = <0x43f80000 0x4000>;
69 clocks = <&clks 51>;
70 clock-names = "ipg_per";
71 interrupts = <10>;
72 status = "disabled";
73 };
74
75 i2c3: i2c@43f84000 {
76 #address-cells = <1>;
77 #size-cells = <0>;
78 compatible = "fsl,imx35-i2c", "fsl,imx1-i2c";
79 reg = <0x43f84000 0x4000>;
80 clocks = <&clks 53>;
81 clock-names = "ipg_per";
82 interrupts = <3>;
83 status = "disabled";
84 };
85
86 uart1: serial@43f90000 {
87 compatible = "fsl,imx35-uart", "fsl,imx21-uart";
88 reg = <0x43f90000 0x4000>;
89 clocks = <&clks 9>, <&clks 70>;
90 clock-names = "ipg", "per";
91 interrupts = <45>;
92 status = "disabled";
93 };
94
95 uart2: serial@43f94000 {
96 compatible = "fsl,imx35-uart", "fsl,imx21-uart";
97 reg = <0x43f94000 0x4000>;
98 clocks = <&clks 9>, <&clks 71>;
99 clock-names = "ipg", "per";
100 interrupts = <32>;
101 status = "disabled";
102 };
103
104 i2c2: i2c@43f98000 {
105 #address-cells = <1>;
106 #size-cells = <0>;
107 compatible = "fsl,imx35-i2c", "fsl,imx1-i2c";
108 reg = <0x43f98000 0x4000>;
109 clocks = <&clks 52>;
110 clock-names = "ipg_per";
111 interrupts = <4>;
112 status = "disabled";
113 };
114
115 ssi1: ssi@43fa0000 {
116 compatible = "fsl,imx35-ssi", "fsl,imx21-ssi";
117 reg = <0x43fa0000 0x4000>;
118 interrupts = <11>;
119 clocks = <&clks 68>;
120 dmas = <&sdma 28 0 0>,
121 <&sdma 29 0 0>;
122 dma-names = "rx", "tx";
123 fsl,fifo-depth = <15>;
124 status = "disabled";
125 };
126
127 spi1: cspi@43fa4000 {
128 #address-cells = <1>;
129 #size-cells = <0>;
130 compatible = "fsl,imx35-cspi";
131 reg = <0x43fa4000 0x4000>;
132 clocks = <&clks 35 &clks 35>;
133 clock-names = "ipg", "per";
134 interrupts = <14>;
135 status = "disabled";
136 };
137
138 iomuxc: iomuxc@43fac000 {
139 compatible = "fsl,imx35-iomuxc";
140 reg = <0x43fac000 0x4000>;
141 };
142 };
143
144 spba: spba-bus@50000000 {
145 compatible = "fsl,spba-bus", "simple-bus";
146 #address-cells = <1>;
147 #size-cells = <1>;
148 reg = <0x50000000 0x100000>;
149 ranges;
150
151 uart3: serial@5000c000 {
152 compatible = "fsl,imx35-uart", "fsl,imx21-uart";
153 reg = <0x5000c000 0x4000>;
154 clocks = <&clks 9>, <&clks 72>;
155 clock-names = "ipg", "per";
156 interrupts = <18>;
157 status = "disabled";
158 };
159
160 spi2: cspi@50010000 {
161 #address-cells = <1>;
162 #size-cells = <0>;
163 compatible = "fsl,imx35-cspi";
164 reg = <0x50010000 0x4000>;
165 interrupts = <13>;
166 clocks = <&clks 36 &clks 36>;
167 clock-names = "ipg", "per";
168 status = "disabled";
169 };
170
171 fec: fec@50038000 {
172 compatible = "fsl,imx35-fec", "fsl,imx27-fec";
173 reg = <0x50038000 0x4000>;
174 clocks = <&clks 46>, <&clks 8>;
175 clock-names = "ipg", "ahb";
176 interrupts = <57>;
177 status = "disabled";
178 };
179 };
180
181 aips2: aips@53f00000 {
182 compatible = "fsl,aips", "simple-bus";
183 #address-cells = <1>;
184 #size-cells = <1>;
185 reg = <0x53f00000 0x100000>;
186 ranges;
187
188 clks: ccm@53f80000 {
189 compatible = "fsl,imx35-ccm";
190 reg = <0x53f80000 0x4000>;
191 interrupts = <31>;
192 #clock-cells = <1>;
193 };
194
195 gpio3: gpio@53fa4000 {
196 compatible = "fsl,imx35-gpio", "fsl,imx31-gpio";
197 reg = <0x53fa4000 0x4000>;
198 interrupts = <56>;
199 gpio-controller;
200 #gpio-cells = <2>;
201 interrupt-controller;
202 #interrupt-cells = <2>;
203 };
204
205 esdhc1: esdhc@53fb4000 {
206 compatible = "fsl,imx35-esdhc";
207 reg = <0x53fb4000 0x4000>;
208 interrupts = <7>;
209 clocks = <&clks 9>, <&clks 8>, <&clks 43>;
210 clock-names = "ipg", "ahb", "per";
211 status = "disabled";
212 };
213
214 esdhc2: esdhc@53fb8000 {
215 compatible = "fsl,imx35-esdhc";
216 reg = <0x53fb8000 0x4000>;
217 interrupts = <8>;
218 clocks = <&clks 9>, <&clks 8>, <&clks 44>;
219 clock-names = "ipg", "ahb", "per";
220 status = "disabled";
221 };
222
223 esdhc3: esdhc@53fbc000 {
224 compatible = "fsl,imx35-esdhc";
225 reg = <0x53fbc000 0x4000>;
226 interrupts = <9>;
227 clocks = <&clks 9>, <&clks 8>, <&clks 45>;
228 clock-names = "ipg", "ahb", "per";
229 status = "disabled";
230 };
231
232 audmux: audmux@53fc4000 {
233 compatible = "fsl,imx35-audmux", "fsl,imx31-audmux";
234 reg = <0x53fc4000 0x4000>;
235 status = "disabled";
236 };
237
238 gpio1: gpio@53fcc000 {
239 compatible = "fsl,imx35-gpio", "fsl,imx31-gpio";
240 reg = <0x53fcc000 0x4000>;
241 interrupts = <52>;
242 gpio-controller;
243 #gpio-cells = <2>;
244 interrupt-controller;
245 #interrupt-cells = <2>;
246 };
247
248 gpio2: gpio@53fd0000 {
249 compatible = "fsl,imx35-gpio", "fsl,imx31-gpio";
250 reg = <0x53fd0000 0x4000>;
251 interrupts = <51>;
252 gpio-controller;
253 #gpio-cells = <2>;
254 interrupt-controller;
255 #interrupt-cells = <2>;
256 };
257
258 sdma: sdma@53fd4000 {
259 compatible = "fsl,imx35-sdma";
260 reg = <0x53fd4000 0x4000>;
261 clocks = <&clks 9>, <&clks 65>;
262 clock-names = "ipg", "ahb";
263 #dma-cells = <3>;
264 interrupts = <34>;
265 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx35.bin";
266 };
267
268 wdog: wdog@53fdc000 {
269 compatible = "fsl,imx35-wdt", "fsl,imx21-wdt";
270 reg = <0x53fdc000 0x4000>;
271 clocks = <&clks 74>;
272 clock-names = "";
273 interrupts = <55>;
274 };
275
276 can1: can@53fe4000 {
277 compatible = "fsl,imx35-flexcan", "fsl,p1010-flexcan";
278 reg = <0x53fe4000 0x1000>;
279 clocks = <&clks 33>;
280 clock-names = "ipg";
281 interrupts = <43>;
282 status = "disabled";
283 };
284
285 can2: can@53fe8000 {
286 compatible = "fsl,imx35-flexcan", "fsl,p1010-flexcan";
287 reg = <0x53fe8000 0x1000>;
288 clocks = <&clks 34>;
289 clock-names = "ipg";
290 interrupts = <44>;
291 status = "disabled";
292 };
293
294 usbotg: usb@53ff4000 {
295 compatible = "fsl,imx35-usb", "fsl,imx27-usb";
296 reg = <0x53ff4000 0x0200>;
297 interrupts = <37>;
298 clocks = <&clks 9>, <&clks 73>, <&clks 28>;
299 clock-names = "ipg", "ahb", "per";
300 fsl,usbmisc = <&usbmisc 0>;
301 status = "disabled";
302 };
303
304 usbhost1: usb@53ff4400 {
305 compatible = "fsl,imx35-usb", "fsl,imx27-usb";
306 reg = <0x53ff4400 0x0200>;
307 interrupts = <35>;
308 clocks = <&clks 9>, <&clks 73>, <&clks 28>;
309 clock-names = "ipg", "ahb", "per";
310 fsl,usbmisc = <&usbmisc 1>;
311 status = "disabled";
312 };
313
314 usbmisc: usbmisc@53ff4600 {
315 #index-cells = <1>;
316 compatible = "fsl,imx35-usbmisc";
317 clocks = <&clks 9>, <&clks 73>, <&clks 28>;
318 clock-names = "ipg", "ahb", "per";
319 reg = <0x53ff4600 0x00f>;
320 };
321 };
322
323 emi@80000000 { /* External Memory Interface */
324 compatible = "fsl,emi", "simple-bus";
325 #address-cells = <1>;
326 #size-cells = <1>;
327 reg = <0x80000000 0x40000000>;
328 ranges;
329
330 nfc: nand@bb000000 {
331 #address-cells = <1>;
332 #size-cells = <1>;
333 compatible = "fsl,imx35-nand", "fsl,imx25-nand";
334 reg = <0xbb000000 0x2000>;
335 clocks = <&clks 29>;
336 clock-names = "";
337 interrupts = <33>;
338 status = "disabled";
339 };
340
341 weim: weim@b8002000 {
342 #address-cells = <2>;
343 #size-cells = <1>;
344 clocks = <&clks 0>;
345 compatible = "fsl,imx35-weim", "fsl,imx27-weim";
346 reg = <0xb8002000 0x1000>;
347 ranges = <
348 0 0 0xa0000000 0x8000000
349 1 0 0xa8000000 0x8000000
350 2 0 0xb0000000 0x2000000
351 3 0 0xb2000000 0x2000000
352 4 0 0xb4000000 0x2000000
353 5 0 0xb6000000 0x2000000
354 >;
355 status = "disabled";
356 };
357 };
358 };
359};
diff --git a/arch/arm/boot/dts/imx50-evk.dts b/arch/arm/boot/dts/imx50-evk.dts
new file mode 100644
index 000000000000..1b22512c91bd
--- /dev/null
+++ b/arch/arm/boot/dts/imx50-evk.dts
@@ -0,0 +1,119 @@
1/*
2 * Copyright 2013 Greg Ungerer <gerg@uclinux.org>
3 * Copyright 2011 Freescale Semiconductor, Inc.
4 * Copyright 2011 Linaro Ltd.
5 *
6 * The code contained herein is licensed under the GNU General Public
7 * License. You may obtain a copy of the GNU General Public License
8 * Version 2 or later at the following locations:
9 *
10 * http://www.opensource.org/licenses/gpl-license.html
11 * http://www.gnu.org/copyleft/gpl.html
12 */
13
14/dts-v1/;
15#include "imx50.dtsi"
16
17/ {
18 model = "Freescale i.MX50 Evaluation Kit";
19 compatible = "fsl,imx50-evk", "fsl,imx50";
20
21 memory {
22 reg = <0x70000000 0x80000000>;
23 };
24};
25
26&cspi {
27 pinctrl-names = "default";
28 pinctrl-0 = <&pinctrl_cspi>;
29 fsl,spi-num-chipselects = <2>;
30 cs-gpios = <&gpio4 11 0>, <&gpio4 13 0>;
31 status = "okay";
32
33 flash: m25p32@1 {
34 #address-cells = <1>;
35 #size-cells = <1>;
36 compatible = "m25p32", "m25p80";
37 spi-max-frequency = <25000000>;
38 reg = <1>;
39
40 partition@0 {
41 label = "bootloader";
42 reg = <0x0 0x100000>;
43 read-only;
44 };
45
46 partition@100000 {
47 label = "kernel";
48 reg = <0x100000 0x300000>;
49 };
50 };
51};
52
53&fec {
54 pinctrl-names = "default";
55 pinctrl-0 = <&pinctrl_fec>;
56 phy-mode = "rmii";
57 phy-reset-gpios = <&gpio4 12 0>;
58 status = "okay";
59};
60
61&iomuxc {
62 imx50-evk {
63 pinctrl_cspi: cspigrp {
64 fsl,pins = <
65 MX50_PAD_CSPI_SCLK__CSPI_SCLK 0x00
66 MX50_PAD_CSPI_MISO__CSPI_MISO 0x00
67 MX50_PAD_CSPI_MOSI__CSPI_MOSI 0x00
68 MX50_PAD_CSPI_SS0__GPIO4_11 0xc4
69 MX50_PAD_ECSPI1_MOSI__CSPI_SS1 0xf4
70 >;
71 };
72
73 pinctrl_fec: fecgrp {
74 fsl,pins = <
75 MX50_PAD_SSI_RXFS__FEC_MDC 0x80
76 MX50_PAD_SSI_RXC__FEC_MDIO 0x80
77 MX50_PAD_DISP_D0__FEC_TX_CLK 0x80
78 MX50_PAD_DISP_D1__FEC_RX_ERR 0x80
79 MX50_PAD_DISP_D2__FEC_RX_DV 0x80
80 MX50_PAD_DISP_D3__FEC_RDATA_1 0x80
81 MX50_PAD_DISP_D4__FEC_RDATA_0 0x80
82 MX50_PAD_DISP_D5__FEC_TX_EN 0x80
83 MX50_PAD_DISP_D6__FEC_TDATA_1 0x80
84 MX50_PAD_DISP_D7__FEC_TDATA_0 0x80
85 >;
86 };
87
88 pinctrl_uart1: uart1grp {
89 fsl,pins = <
90 MX50_PAD_UART1_TXD__UART1_TXD_MUX 0x1e4
91 MX50_PAD_UART1_RXD__UART1_RXD_MUX 0x1e4
92 MX50_PAD_UART1_RTS__UART1_RTS 0x1e4
93 MX50_PAD_UART1_CTS__UART1_CTS 0x1e4
94 >;
95 };
96 };
97};
98
99&uart1 {
100 pinctrl-names = "default";
101 pinctrl-0 = <&pinctrl_uart1>;
102 status = "okay";
103};
104
105&usbh1 {
106 status = "okay";
107};
108
109&usbh2 {
110 status = "okay";
111};
112
113&usbh3 {
114 status = "okay";
115};
116
117&usbotg {
118 status = "okay";
119};
diff --git a/arch/arm/boot/dts/imx50-pinfunc.h b/arch/arm/boot/dts/imx50-pinfunc.h
new file mode 100644
index 000000000000..97e6e7f4ebdd
--- /dev/null
+++ b/arch/arm/boot/dts/imx50-pinfunc.h
@@ -0,0 +1,923 @@
1/*
2 * Copyright 2013 Greg Ungerer <gerg@uclinux.org>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 */
9
10#ifndef __DTS_IMX50_PINFUNC_H
11#define __DTS_IMX50_PINFUNC_H
12
13/*
14 * The pin function ID is a tuple of
15 * <mux_reg conf_reg input_reg mux_mode input_val>
16 */
17#define MX50_PAD_KEY_COL0__KPP_COL_0 0x020 0x2cc 0x000 0x0 0x0
18#define MX50_PAD_KEY_COL0__GPIO4_0 0x020 0x2cc 0x000 0x1 0x0
19#define MX50_PAD_KEY_COL0__EIM_NANDF_CLE 0x020 0x2cc 0x000 0x2 0x0
20#define MX50_PAD_KEY_COL0__CTI_TRIGIN7 0x020 0x2cc 0x000 0x6 0x0
21#define MX50_PAD_KEY_COL0__USBPHY1_TXREADY 0x020 0x2cc 0x000 0x7 0x0
22#define MX50_PAD_KEY_ROW0__KPP_ROW_0 0x024 0x2d0 0x000 0x0 0x0
23#define MX50_PAD_KEY_ROW0__GPIO4_1 0x024 0x2d0 0x000 0x1 0x0
24#define MX50_PAD_KEY_ROW0__EIM_NANDF_ALE 0x024 0x2d0 0x000 0x2 0x0
25#define MX50_PAD_KEY_ROW0__CTI_TRIGIN_ACK7 0x024 0x2d0 0x000 0x6 0x0
26#define MX50_PAD_KEY_ROW0__USBPHY1_RXVALID 0x024 0x2d0 0x000 0x7 0x0
27#define MX50_PAD_KEY_COL1__KPP_COL_1 0x028 0x2d4 0x000 0x0 0x0
28#define MX50_PAD_KEY_COL1__GPIO4_2 0x028 0x2d4 0x000 0x1 0x0
29#define MX50_PAD_KEY_COL1__EIM_NANDF_CEN_0 0x028 0x2d4 0x000 0x2 0x0
30#define MX50_PAD_KEY_COL1__CTI_TRIGOUT_ACK6 0x028 0x2d4 0x000 0x6 0x0
31#define MX50_PAD_KEY_COL1__USBPHY1_RXACTIVE 0x028 0x2d4 0x000 0x7 0x0
32#define MX50_PAD_KEY_ROW1__KPP_ROW_1 0x02c 0x2d8 0x000 0x0 0x0
33#define MX50_PAD_KEY_ROW1__GPIO4_3 0x02c 0x2d8 0x000 0x1 0x0
34#define MX50_PAD_KEY_ROW1__EIM_NANDF_CEN_1 0x02c 0x2d8 0x000 0x2 0x0
35#define MX50_PAD_KEY_ROW1__CTI_TRIGOUT_ACK7 0x02c 0x2d8 0x000 0x6 0x0
36#define MX50_PAD_KEY_ROW1__USBPHY1_RXERROR 0x02c 0x2d8 0x000 0x7 0x0
37#define MX50_PAD_KEY_COL2__KPP_COL_1 0x030 0x2dc 0x000 0x0 0x0
38#define MX50_PAD_KEY_COL2__GPIO4_4 0x030 0x2dc 0x000 0x1 0x0
39#define MX50_PAD_KEY_COL2__EIM_NANDF_CEN_2 0x030 0x2dc 0x000 0x2 0x0
40#define MX50_PAD_KEY_COL2__CTI_TRIGOUT6 0x030 0x2dc 0x000 0x6 0x0
41#define MX50_PAD_KEY_COL2__USBPHY1_SIECLOCK 0x030 0x2dc 0x000 0x7 0x0
42#define MX50_PAD_KEY_ROW2__KPP_ROW_2 0x034 0x2e0 0x000 0x0 0x0
43#define MX50_PAD_KEY_ROW2__GPIO4_5 0x034 0x2e0 0x000 0x1 0x0
44#define MX50_PAD_KEY_ROW2__EIM_NANDF_CEN_3 0x034 0x2e0 0x000 0x2 0x0
45#define MX50_PAD_KEY_ROW2__CTI_TRIGOUT7 0x034 0x2e0 0x000 0x6 0x0
46#define MX50_PAD_KEY_ROW2__USBPHY1_LINESTATE_0 0x034 0x2e0 0x000 0x7 0x0
47#define MX50_PAD_KEY_COL3__KPP_COL_2 0x038 0x2e4 0x000 0x0 0x0
48#define MX50_PAD_KEY_COL3__GPIO4_6 0x038 0x2e4 0x000 0x1 0x0
49#define MX50_PAD_KEY_COL3__EIM_NANDF_READY0 0x038 0x2e4 0x7b4 0x2 0x0
50#define MX50_PAD_KEY_COL3__SDMA_EXT_EVENT_0 0x038 0x2e4 0x7b8 0x6 0x0
51#define MX50_PAD_KEY_COL3__USBPHY1_LINESTATE_1 0x038 0x2e4 0x000 0x7 0x0
52#define MX50_PAD_KEY_ROW3__KPP_ROW_3 0x03c 0x2e8 0x000 0x0 0x0
53#define MX50_PAD_KEY_ROW3__GPIO4_7 0x03c 0x2e8 0x000 0x1 0x0
54#define MX50_PAD_KEY_ROW3__EIM_NANDF_DQS 0x03c 0x2e8 0x7b0 0x2 0x0
55#define MX50_PAD_KEY_ROW3__SDMA_EXT_EVENT_1 0x03c 0x2e8 0x7bc 0x6 0x0
56#define MX50_PAD_KEY_ROW3__USBPHY1_VBUSVALID 0x03c 0x2e8 0x000 0x7 0x0
57#define MX50_PAD_I2C1_SCL__I2C1_SCL 0x040 0x2ec 0x000 0x0 0x0
58#define MX50_PAD_I2C1_SCL__GPIO6_18 0x040 0x2ec 0x000 0x1 0x0
59#define MX50_PAD_I2C1_SCL__UART2_TXD_MUX 0x040 0x2ec 0x7cc 0x2 0x0
60#define MX50_PAD_I2C1_SDA__I2C1_SDA 0x044 0x2f0 0x000 0x0 0x0
61#define MX50_PAD_I2C1_SDA__GPIO6_19 0x044 0x2f0 0x000 0x1 0x0
62#define MX50_PAD_I2C1_SDA__UART2_RXD_MUX 0x044 0x2f0 0x7cc 0x2 0x1
63#define MX50_PAD_I2C2_SCL__I2C2_SCL 0x048 0x2f4 0x000 0x0 0x0
64#define MX50_PAD_I2C2_SCL__GPIO6_20 0x048 0x2f4 0x000 0x1 0x0
65#define MX50_PAD_I2C2_SCL__UART2_CTS 0x048 0x2f4 0x000 0x2 0x0
66#define MX50_PAD_I2C2_SDA__I2C2_SDA 0x04c 0x2f8 0x000 0x0 0x0
67#define MX50_PAD_I2C2_SDA__GPIO6_21 0x04c 0x2f8 0x000 0x1 0x0
68#define MX50_PAD_I2C2_SDA__UART2_RTS 0x04c 0x2f8 0x7c8 0x2 0x1
69#define MX50_PAD_I2C3_SCL__I2C3_SCL 0x050 0x2fc 0x000 0x0 0x0
70#define MX50_PAD_I2C3_SCL__GPIO6_22 0x050 0x2fc 0x000 0x1 0x0
71#define MX50_PAD_I2C3_SCL__FEC_MDC 0x050 0x2fc 0x000 0x2 0x0
72#define MX50_PAD_I2C3_SCL__GPC_PMIC_RDY 0x050 0x2fc 0x000 0x3 0x0
73#define MX50_PAD_I2C3_SCL__GPT_CAPIN1 0x050 0x2fc 0x000 0x5 0x0
74#define MX50_PAD_I2C3_SCL__OBSERVE_MUX_OBSRV_INT_OUT0 0x050 0x2fc 0x000 0x6 0x0
75#define MX50_PAD_I2C3_SCL__USBOH1_USBOTG_OC 0x050 0x2fc 0x7e8 0x7 0x0
76#define MX50_PAD_I2C3_SDA__I2C3_SDA 0x054 0x300 0x000 0x0 0x0
77#define MX50_PAD_I2C3_SDA__GPIO6_23 0x054 0x300 0x000 0x1 0x0
78#define MX50_PAD_I2C3_SDA__FEC_MDIO 0x054 0x300 0x774 0x2 0x0
79#define MX50_PAD_I2C3_SDA__TZIC_PWRFAIL_INT 0x054 0x300 0x000 0x3 0x0
80#define MX50_PAD_I2C3_SDA__SRTC_ALARM_DEB 0x054 0x300 0x000 0x4 0x0
81#define MX50_PAD_I2C3_SDA__GPT_CAPIN2 0x054 0x300 0x000 0x5 0x0
82#define MX50_PAD_I2C3_SDA__OBSERVE_MUX_OBSRV_INT_OUT1 0x054 0x300 0x000 0x6 0x0
83#define MX50_PAD_I2C3_SDA__USBOH1_USBOTG_PWR 0x054 0x300 0x000 0x7 0x0
84#define MX50_PAD_PWM1__PWM1_PWMO 0x058 0x304 0x000 0x0 0x0
85#define MX50_PAD_PWM1__GPIO6_24 0x058 0x304 0x000 0x1 0x0
86#define MX50_PAD_PWM1__USBOH1_USBOTG_OC 0x058 0x304 0x7e8 0x2 0x1
87#define MX50_PAD_PWM1__GPT_CMPOUT1 0x058 0x304 0x000 0x5 0x0
88#define MX50_PAD_PWM1__OBSERVE_MUX_OBSRV_INT_OUT2 0x058 0x304 0x000 0x6 0x0
89#define MX50_PAD_PWM1__SJC_FAIL 0x058 0x304 0x000 0x7 0x0
90#define MX50_PAD_PWM2__PWM2_PWMO 0x05c 0x308 0x000 0x0 0x0
91#define MX50_PAD_PWM2__GPIO6_25 0x05c 0x308 0x000 0x1 0x0
92#define MX50_PAD_PWM2__USBOH1_USBOTG_PWR 0x05c 0x308 0x000 0x2 0x0
93#define MX50_PAD_PWM2__GPT_CMPOUT2 0x05c 0x308 0x000 0x5 0x0
94#define MX50_PAD_PWM2__OBSERVE_MUX_OBSRV_INT_OUT3 0x05c 0x308 0x000 0x6 0x0
95#define MX50_PAD_PWM2__SRC_ANY_PU_RST 0x05c 0x308 0x000 0x7 0x0
96#define MX50_PAD_OWIRE__OWIRE_LINE 0x060 0x30c 0x000 0x0 0x0
97#define MX50_PAD_OWIRE__GPIO6_26 0x060 0x30c 0x000 0x1 0x0
98#define MX50_PAD_OWIRE__USBOH1_USBH1_OC 0x060 0x30c 0x000 0x2 0x0
99#define MX50_PAD_OWIRE__CCM_SSI_EXT1_CLK 0x060 0x30c 0x000 0x3 0x0
100#define MX50_PAD_OWIRE__EPDC_PWRIRQ 0x060 0x30c 0x000 0x4 0x0
101#define MX50_PAD_OWIRE__GPT_CMPOUT3 0x060 0x30c 0x000 0x5 0x0
102#define MX50_PAD_OWIRE__OBSERVE_MUX_OBSRV_INT_OUT4 0x060 0x30c 0x000 0x6 0x0
103#define MX50_PAD_OWIRE__SJC_JTAG_ACT 0x060 0x30c 0x000 0x7 0x0
104#define MX50_PAD_EPITO__EPIT1_EPITO 0x064 0x310 0x000 0x0 0x0
105#define MX50_PAD_EPITO__GPIO6_27 0x064 0x310 0x000 0x1 0x0
106#define MX50_PAD_EPITO__USBOH1_USBH1_PWR 0x064 0x310 0x000 0x2 0x0
107#define MX50_PAD_EPITO__CCM_SSI_EXT2_CLK 0x064 0x310 0x000 0x3 0x0
108#define MX50_PAD_EPITO__DPLLIP1_TOG_EN 0x064 0x310 0x000 0x4 0x0
109#define MX50_PAD_EPITO__GPT_CLK_IN 0x064 0x310 0x000 0x5 0x0
110#define MX50_PAD_EPITO__PMU_IRQ_B 0x064 0x310 0x000 0x6 0x0
111#define MX50_PAD_EPITO__SJC_DE_B 0x064 0x310 0x000 0x7 0x0
112#define MX50_PAD_WDOG__WDOG1_WDOG_B 0x068 0x314 0x000 0x0 0x0
113#define MX50_PAD_WDOG__GPIO6_28 0x068 0x314 0x000 0x1 0x0
114#define MX50_PAD_WDOG__WDOG1_WDOG_RST_B_DEB 0x068 0x314 0x000 0x2 0x0
115#define MX50_PAD_WDOG__CCM_XTAL32K 0x068 0x314 0x000 0x6 0x0
116#define MX50_PAD_WDOG__SJC_DONE 0x068 0x314 0x000 0x7 0x0
117#define MX50_PAD_SSI_TXFS__AUDMUX_AUD3_TXFS 0x06c 0x318 0x000 0x0 0x0
118#define MX50_PAD_SSI_TXFS__GPIO6_0 0x06c 0x318 0x000 0x1 0x0
119#define MX50_PAD_SSI_TXFS__SRC_BT_FUSE_RSV_1 0x06c 0x318 0x000 0x6 0x0
120#define MX50_PAD_SSI_TXFS__USBPHY1_DATAOUT_8 0x06c 0x318 0x000 0x7 0x0
121#define MX50_PAD_SSI_TXC__AUDMUX_AUD3_TXC 0x070 0x31c 0x000 0x0 0x0
122#define MX50_PAD_SSI_TXC__GPIO6_1 0x070 0x31c 0x000 0x1 0x0
123#define MX50_PAD_SSI_TXC__SRC_BT_FUSE_RSV_0 0x070 0x31c 0x000 0x6 0x0
124#define MX50_PAD_SSI_TXC__USBPHY1_DATAOUT_9 0x070 0x31c 0x000 0x7 0x0
125#define MX50_PAD_SSI_TXD__AUDMUX_AUD3_TXD 0x074 0x320 0x000 0x0 0x0
126#define MX50_PAD_SSI_TXD__GPIO6_2 0x074 0x320 0x000 0x1 0x0
127#define MX50_PAD_SSI_TXD__CSPI_RDY 0x074 0x320 0x6e8 0x4 0x0
128#define MX50_PAD_SSI_TXD__USBPHY1_DATAOUT_10 0x074 0x320 0x000 0x7 0x0
129#define MX50_PAD_SSI_RXD__AUDMUX_AUD3_RXD 0x078 0x324 0x000 0x0 0x0
130#define MX50_PAD_SSI_RXD__GPIO6_3 0x078 0x324 0x000 0x1 0x0
131#define MX50_PAD_SSI_RXD__CSPI_SS3 0x078 0x324 0x6f4 0x4 0x0
132#define MX50_PAD_SSI_RXD__USBPHY1_DATAOUT_11 0x078 0x324 0x000 0x7 0x0
133#define MX50_PAD_SSI_RXFS__AUDMUX_AUD3_RXFS 0x07c 0x328 0x000 0x0 0x0
134#define MX50_PAD_SSI_RXFS__GPIO6_4 0x07c 0x328 0x000 0x1 0x0
135#define MX50_PAD_SSI_RXFS__UART5_TXD_MUX 0x07c 0x328 0x7e4 0x2 0x0
136#define MX50_PAD_SSI_RXFS__EIM_WEIM_D_6 0x07c 0x328 0x804 0x3 0x0
137#define MX50_PAD_SSI_RXFS__CSPI_SS2 0x07c 0x328 0x6f0 0x4 0x0
138#define MX50_PAD_SSI_RXFS__FEC_COL 0x07c 0x328 0x770 0x5 0x0
139#define MX50_PAD_SSI_RXFS__FEC_MDC 0x07c 0x328 0x000 0x6 0x0
140#define MX50_PAD_SSI_RXFS__USBPHY1_DATAOUT_12 0x07c 0x328 0x000 0x7 0x0
141#define MX50_PAD_SSI_RXC__AUDMUX_AUD3_RXC 0x080 0x32c 0x000 0x0 0x0
142#define MX50_PAD_SSI_RXC__GPIO6_5 0x080 0x32c 0x000 0x1 0x0
143#define MX50_PAD_SSI_RXC__UART5_RXD_MUX 0x080 0x32c 0x7e4 0x2 0x1
144#define MX50_PAD_SSI_RXC__EIM_WEIM_D_7 0x080 0x32c 0x808 0x3 0x0
145#define MX50_PAD_SSI_RXC__CSPI_SS1 0x080 0x32c 0x6ec 0x4 0x0
146#define MX50_PAD_SSI_RXC__FEC_RX_CLK 0x080 0x32c 0x780 0x5 0x0
147#define MX50_PAD_SSI_RXC__FEC_MDIO 0x080 0x32c 0x774 0x6 0x1
148#define MX50_PAD_SSI_RXC__USBPHY1_DATAOUT_13 0x080 0x32c 0x000 0x7 0x0
149#define MX50_PAD_UART1_TXD__UART1_TXD_MUX 0x084 0x330 0x7c4 0x0 0x0
150#define MX50_PAD_UART1_TXD__GPIO6_6 0x084 0x330 0x000 0x1 0x0
151#define MX50_PAD_UART1_TXD__USBPHY1_DATAOUT_14 0x084 0x330 0x000 0x7 0x0
152#define MX50_PAD_UART1_RXD__UART1_RXD_MUX 0x088 0x334 0x7c4 0x0 0x1
153#define MX50_PAD_UART1_RXD__GPIO6_7 0x088 0x334 0x000 0x1 0x0
154#define MX50_PAD_UART1_RXD__USBPHY1_DATAOUT_15 0x088 0x334 0x000 0x7 0x0
155#define MX50_PAD_UART1_CTS__UART1_CTS 0x08c 0x338 0x000 0x0 0x0
156#define MX50_PAD_UART1_CTS__GPIO6_8 0x08c 0x338 0x000 0x1 0x0
157#define MX50_PAD_UART1_CTS__UART5_TXD_MUX 0x08c 0x338 0x7e4 0x2 0x2
158#define MX50_PAD_UART1_CTS__ESDHC4_DAT4 0x08c 0x338 0x760 0x4 0x0
159#define MX50_PAD_UART1_CTS__ESDHC4_CMD 0x08c 0x338 0x74c 0x5 0x0
160#define MX50_PAD_UART1_CTS__USBPHY2_DATAOUT_8 0x08c 0x338 0x000 0x7 0x0
161#define MX50_PAD_UART1_RTS__UART1_RTS 0x090 0x33c 0x7c0 0x0 0x3
162#define MX50_PAD_UART1_RTS__GPIO6_9 0x090 0x33c 0x000 0x1 0x0
163#define MX50_PAD_UART1_RTS__UART5_RXD_MUX 0x090 0x33c 0x7e4 0x2 0x3
164#define MX50_PAD_UART1_RTS__ESDHC4_DAT5 0x090 0x33c 0x764 0x4 0x0
165#define MX50_PAD_UART1_RTS__ESDHC4_CLK 0x090 0x33c 0x748 0x5 0x0
166#define MX50_PAD_UART1_RTS__USBPHY2_DATAOUT_9 0x090 0x33c 0x000 0x7 0x0
167#define MX50_PAD_UART2_TXD__UART2_TXD_MUX 0x094 0x340 0x7cc 0x0 0x2
168#define MX50_PAD_UART2_TXD__GPIO6_10 0x094 0x340 0x000 0x1 0x0
169#define MX50_PAD_UART2_TXD__ESDHC4_DAT6 0x094 0x340 0x768 0x4 0x0
170#define MX50_PAD_UART2_TXD__ESDHC4_DAT4 0x094 0x340 0x760 0x5 0x1
171#define MX50_PAD_UART2_TXD__USBPHY2_DATAOUT_10 0x094 0x340 0x000 0x7 0x0
172#define MX50_PAD_UART2_RXD__UART2_RXD_MUX 0x098 0x344 0x7cc 0x0 0x3
173#define MX50_PAD_UART2_RXD__GPIO6_11 0x098 0x344 0x000 0x1 0x0
174#define MX50_PAD_UART2_RXD__ESDHC4_DAT7 0x098 0x344 0x76c 0x4 0x0
175#define MX50_PAD_UART2_RXD__ESDHC4_DAT5 0x098 0x344 0x764 0x5 0x1
176#define MX50_PAD_UART2_RXD__USBPHY2_DATAOUT_11 0x098 0x344 0x000 0x7 0x0
177#define MX50_PAD_UART2_CTS__UART2_CTS 0x09c 0x348 0x000 0x0 0x0
178#define MX50_PAD_UART2_CTS__GPIO6_12 0x09c 0x348 0x000 0x1 0x0
179#define MX50_PAD_UART2_CTS__ESDHC4_CMD 0x09c 0x348 0x74c 0x4 0x1
180#define MX50_PAD_UART2_CTS__ESDHC4_DAT6 0x09c 0x348 0x768 0x5 0x1
181#define MX50_PAD_UART2_CTS__USBPHY2_DATAOUT_12 0x09c 0x348 0x000 0x7 0x0
182#define MX50_PAD_UART2_RTS__UART2_RTS 0x0a0 0x34c 0x7c8 0x0 0x2
183#define MX50_PAD_UART2_RTS__GPIO6_13 0x0a0 0x34c 0x000 0x1 0x0
184#define MX50_PAD_UART2_RTS__ESDHC4_CLK 0x0a0 0x34c 0x748 0x4 0x1
185#define MX50_PAD_UART2_RTS__ESDHC4_DAT7 0x0a0 0x34c 0x76c 0x5 0x1
186#define MX50_PAD_UART2_RTS__USBPHY2_DATAOUT_13 0x0a0 0x34c 0x000 0x7 0x0
187#define MX50_PAD_UART3_TXD__UART3_TXD_MUX 0x0a4 0x350 0x7d4 0x0 0x0
188#define MX50_PAD_UART3_TXD__GPIO6_14 0x0a4 0x350 0x000 0x1 0x0
189#define MX50_PAD_UART3_TXD__ESDHC1_DAT4 0x0a4 0x350 0x000 0x3 0x0
190#define MX50_PAD_UART3_TXD__ESDHC4_DAT0 0x0a4 0x350 0x000 0x4 0x0
191#define MX50_PAD_UART3_TXD__ESDHC2_WP 0x0a4 0x350 0x744 0x5 0x0
192#define MX50_PAD_UART3_TXD__EIM_WEIM_D_12 0x0a4 0x350 0x81c 0x6 0x0
193#define MX50_PAD_UART3_TXD__USBPHY2_DATAOUT_14 0x0a4 0x350 0x000 0x7 0x0
194#define MX50_PAD_UART3_RXD__UART3_RXD_MUX 0x0a8 0x354 0x7d4 0x0 0x1
195#define MX50_PAD_UART3_RXD__GPIO6_15 0x0a8 0x354 0x000 0x1 0x0
196#define MX50_PAD_UART3_RXD__ESDHC1_DAT5 0x0a8 0x354 0x000 0x3 0x0
197#define MX50_PAD_UART3_RXD__ESDHC4_DAT1 0x0a8 0x354 0x754 0x4 0x0
198#define MX50_PAD_UART3_RXD__ESDHC2_CD 0x0a8 0x354 0x740 0x5 0x0
199#define MX50_PAD_UART3_RXD__EIM_WEIM_D_13 0x0a8 0x354 0x820 0x6 0x0
200#define MX50_PAD_UART3_RXD__USBPHY2_DATAOUT_15 0x0a8 0x354 0x000 0x7 0x0
201#define MX50_PAD_UART4_TXD__UART4_TXD_MUX 0x0ac 0x358 0x7dc 0x0 0x0
202#define MX50_PAD_UART4_TXD__GPIO6_16 0x0ac 0x358 0x000 0x1 0x0
203#define MX50_PAD_UART4_TXD__UART3_CTS 0x0ac 0x358 0x7d0 0x2 0x0
204#define MX50_PAD_UART4_TXD__ESDHC1_DAT6 0x0ac 0x358 0x000 0x3 0x0
205#define MX50_PAD_UART4_TXD__ESDHC4_DAT2 0x0ac 0x358 0x758 0x4 0x0
206#define MX50_PAD_UART4_TXD__ESDHC2_LCTL 0x0ac 0x358 0x000 0x5 0x0
207#define MX50_PAD_UART4_TXD__EIM_WEIM_D_14 0x0ac 0x358 0x824 0x6 0x0
208#define MX50_PAD_UART4_RXD__UART4_RXD_MUX 0x0b0 0x35c 0x7dc 0x0 0x1
209#define MX50_PAD_UART4_RXD__GPIO6_17 0x0b0 0x35c 0x000 0x1 0x0
210#define MX50_PAD_UART4_RXD__UART3_RTS 0x0b0 0x35c 0x7d0 0x2 0x1
211#define MX50_PAD_UART4_RXD__ESDHC1_DAT7 0x0b0 0x35c 0x000 0x3 0x0
212#define MX50_PAD_UART4_RXD__ESDHC4_DAT3 0x0b0 0x35c 0x75c 0x4 0x0
213#define MX50_PAD_UART4_RXD__ESDHC1_LCTL 0x0b0 0x35c 0x000 0x5 0x0
214#define MX50_PAD_UART4_RXD__EIM_WEIM_D_15 0x0b0 0x35c 0x828 0x6 0x0
215#define MX50_PAD_CSPI_SCLK__CSPI_SCLK 0x0b4 0x360 0x000 0x0 0x0
216#define MX50_PAD_CSPI_SCLK__GPIO4_8 0x0b4 0x360 0x000 0x1 0x0
217#define MX50_PAD_CSPI_MOSI__CSPI_MOSI 0x0b8 0x364 0x000 0x0 0x0
218#define MX50_PAD_CSPI_MOSI__GPIO4_9 0x0b8 0x364 0x000 0x1 0x0
219#define MX50_PAD_CSPI_MISO__CSPI_MISO 0x0bc 0x368 0x000 0x0 0x0
220#define MX50_PAD_CSPI_MISO__GPIO4_10 0x0bc 0x368 0x000 0x1 0x0
221#define MX50_PAD_CSPI_SS0__CSPI_SS0 0x0c0 0x36c 0x000 0x0 0x0
222#define MX50_PAD_CSPI_SS0__GPIO4_11 0x0c0 0x36c 0x000 0x1 0x0
223#define MX50_PAD_ECSPI1_SCLK__ECSPI1_SCLK 0x0c4 0x370 0x000 0x0 0x0
224#define MX50_PAD_ECSPI1_SCLK__GPIO4_12 0x0c4 0x370 0x000 0x1 0x0
225#define MX50_PAD_ECSPI1_SCLK__CSPI_RDY 0x0c4 0x370 0x6e8 0x2 0x1
226#define MX50_PAD_ECSPI1_SCLK__ECSPI2_RDY 0x0c4 0x370 0x000 0x3 0x0
227#define MX50_PAD_ECSPI1_SCLK__UART3_RTS 0x0c4 0x370 0x7d0 0x4 0x2
228#define MX50_PAD_ECSPI1_SCLK__EPDC_SDCE_6 0x0c4 0x370 0x000 0x5 0x0
229#define MX50_PAD_ECSPI1_SCLK__EIM_WEIM_D_8 0x0c4 0x370 0x80c 0x7 0x0
230#define MX50_PAD_ECSPI1_MOSI__ECSPI1_MOSI 0x0c8 0x374 0x000 0x0 0x0
231#define MX50_PAD_ECSPI1_MOSI__GPIO4_13 0x0c8 0x374 0x000 0x1 0x0
232#define MX50_PAD_ECSPI1_MOSI__CSPI_SS1 0x0c8 0x374 0x6ec 0x2 0x1
233#define MX50_PAD_ECSPI1_MOSI__ECSPI2_SS1 0x0c8 0x374 0x000 0x3 0x0
234#define MX50_PAD_ECSPI1_MOSI__UART3_CTS 0x0c8 0x374 0x000 0x4 0x0
235#define MX50_PAD_ECSPI1_MOSI__EPDC_SDCE_7 0x0c8 0x374 0x000 0x5 0x0
236#define MX50_PAD_ECSPI1_MOSI__EIM_WEIM_D_9 0x0c8 0x374 0x810 0x7 0x0
237#define MX50_PAD_ECSPI1_MISO__ECSPI1_MISO 0x0cc 0x378 0x000 0x0 0x0
238#define MX50_PAD_ECSPI1_MISO__GPIO4_14 0x0cc 0x378 0x000 0x1 0x0
239#define MX50_PAD_ECSPI1_MISO__CSPI_SS2 0x0cc 0x378 0x6f0 0x2 0x1
240#define MX50_PAD_ECSPI1_MISO__ECSPI2_SS2 0x0cc 0x378 0x000 0x3 0x0
241#define MX50_PAD_ECSPI1_MISO__UART4_RTS 0x0cc 0x378 0x7d8 0x4 0x0
242#define MX50_PAD_ECSPI1_MISO__EPDC_SDCE_8 0x0cc 0x378 0x000 0x5 0x0
243#define MX50_PAD_ECSPI1_MISO__EIM_WEIM_D_10 0x0cc 0x378 0x814 0x7 0x0
244#define MX50_PAD_ECSPI1_SS0__ECSPI1_SS0 0x0d0 0x37c 0x000 0x0 0x0
245#define MX50_PAD_ECSPI1_SS0__GPIO4_15 0x0d0 0x37c 0x000 0x1 0x0
246#define MX50_PAD_ECSPI1_SS0__CSPI_SS3 0x0d0 0x37c 0x6f4 0x2 0x1
247#define MX50_PAD_ECSPI1_SS0__ECSPI2_SS3 0x0d0 0x37c 0x000 0x3 0x0
248#define MX50_PAD_ECSPI1_SS0__UART4_CTS 0x0d0 0x37c 0x000 0x4 0x0
249#define MX50_PAD_ECSPI1_SS0__EPDC_SDCE_9 0x0d0 0x37c 0x000 0x5 0x0
250#define MX50_PAD_ECSPI1_SS0__EIM_WEIM_D_11 0x0d0 0x37c 0x818 0x7 0x0
251#define MX50_PAD_ECSPI2_SCLK__ECSPI2_SCLK 0x0d4 0x380 0x000 0x0 0x0
252#define MX50_PAD_ECSPI2_SCLK__GPIO4_16 0x0d4 0x380 0x000 0x1 0x0
253#define MX50_PAD_ECSPI2_SCLK__ELCDIF_WR_RWN 0x0d4 0x380 0x000 0x2 0x0
254#define MX50_PAD_ECSPI2_SCLK__ECSPI1_RDY 0x0d4 0x380 0x000 0x3 0x0
255#define MX50_PAD_ECSPI2_SCLK__UART5_RTS 0x0d4 0x380 0x7e0 0x4 0x0
256#define MX50_PAD_ECSPI2_SCLK__ELCDIF_DOTCLK 0x0d4 0x380 0x000 0x5 0x0
257#define MX50_PAD_ECSPI2_SCLK__EIM_NANDF_CEN_4 0x0d4 0x380 0x000 0x6 0x0
258#define MX50_PAD_ECSPI2_SCLK__EIM_WEIM_D_8 0x0d4 0x380 0x80c 0x7 0x1
259#define MX50_PAD_ECSPI2_MOSI__ECSPI2_MOSI 0x0d8 0x384 0x000 0x0 0x0
260#define MX50_PAD_ECSPI2_MOSI__GPIO4_17 0x0d8 0x384 0x000 0x1 0x0
261#define MX50_PAD_ECSPI2_MOSI__ELCDIF_RE_E 0x0d8 0x384 0x000 0x2 0x0
262#define MX50_PAD_ECSPI2_MOSI__ECSPI1_SS1 0x0d8 0x384 0x000 0x3 0x0
263#define MX50_PAD_ECSPI2_MOSI__UART5_CTS 0x0d8 0x384 0x7e0 0x4 0x1
264#define MX50_PAD_ECSPI2_MOSI__ELCDIF_ENABLE 0x0d8 0x384 0x000 0x5 0x0
265#define MX50_PAD_ECSPI2_MOSI__EIM_NANDF_CEN_5 0x0d8 0x384 0x000 0x6 0x0
266#define MX50_PAD_ECSPI2_MOSI__EIM_WEIM_D_9 0x0d8 0x384 0x810 0x7 0x1
267#define MX50_PAD_ECSPI2_MISO__ECSPI2_MISO 0x0dc 0x388 0x000 0x0 0x0
268#define MX50_PAD_ECSPI2_MISO__GPIO4_18 0x0dc 0x388 0x000 0x1 0x0
269#define MX50_PAD_ECSPI2_MISO__ELCDIF_RS 0x0dc 0x388 0x000 0x2 0x0
270#define MX50_PAD_ECSPI2_MISO__ECSPI1_SS2 0x0dc 0x388 0x000 0x3 0x0
271#define MX50_PAD_ECSPI2_MISO__UART5_TXD_MUX 0x0dc 0x388 0x7e4 0x4 0x4
272#define MX50_PAD_ECSPI2_MISO__ELCDIF_VSYNC 0x0dc 0x388 0x73c 0x5 0x0
273#define MX50_PAD_ECSPI2_MISO__EIM_NANDF_CEN_6 0x0dc 0x388 0x000 0x6 0x0
274#define MX50_PAD_ECSPI2_MISO__EIM_WEIM_D_10 0x0dc 0x388 0x814 0x7 0x1
275#define MX50_PAD_ECSPI2_SS0__ECSPI2_SS0 0x0e0 0x38c 0x000 0x0 0x0
276#define MX50_PAD_ECSPI2_SS0__GPIO4_19 0x0e0 0x38c 0x000 0x1 0x0
277#define MX50_PAD_ECSPI2_SS0__ELCDIF_CS 0x0e0 0x38c 0x000 0x2 0x0
278#define MX50_PAD_ECSPI2_SS0__ECSPI2_SS3 0x0e0 0x38c 0x000 0x3 0x0
279#define MX50_PAD_ECSPI2_SS0__UART5_RXD_MUX 0x0e0 0x38c 0x7e4 0x4 0x5
280#define MX50_PAD_ECSPI2_SS0__ELCDIF_HSYNC 0x0e0 0x38c 0x6f8 0x5 0x0
281#define MX50_PAD_ECSPI2_SS0__EIM_NANDF_CEN_7 0x0e0 0x38c 0x000 0x6 0x0
282#define MX50_PAD_ECSPI2_SS0__EIM_WEIM_D_11 0x0e0 0x38c 0x818 0x7 0x1
283#define MX50_PAD_SD1_CLK__ESDHC1_CLK 0x0e4 0x390 0x000 0x0 0x0
284#define MX50_PAD_SD1_CLK__GPIO5_0 0x0e4 0x390 0x000 0x1 0x0
285#define MX50_PAD_SD1_CLK__CCM_CLKO 0x0e4 0x390 0x000 0x7 0x0
286#define MX50_PAD_SD1_CMD__ESDHC1_CMD 0x0e8 0x394 0x000 0x0 0x0
287#define MX50_PAD_SD1_CMD__GPIO5_1 0x0e8 0x394 0x000 0x1 0x0
288#define MX50_PAD_SD1_CMD__CCM_CLKO2 0x0e8 0x394 0x000 0x7 0x0
289#define MX50_PAD_SD1_D0__ESDHC1_DAT0 0x0ec 0x398 0x000 0x0 0x0
290#define MX50_PAD_SD1_D0__GPIO5_2 0x0ec 0x398 0x000 0x1 0x0
291#define MX50_PAD_SD1_D0__CCM_PLL1_BYP 0x0ec 0x398 0x6dc 0x7 0x0
292#define MX50_PAD_SD1_D1__ESDHC1_DAT1 0x0f0 0x39c 0x000 0x0 0x0
293#define MX50_PAD_SD1_D1__GPIO5_3 0x0f0 0x39c 0x000 0x1 0x0
294#define MX50_PAD_SD1_D1__CCM_PLL2_BYP 0x0f0 0x39c 0x000 0x7 0x0
295#define MX50_PAD_SD1_D2__ESDHC1_DAT2 0x0f4 0x3a0 0x000 0x0 0x0
296#define MX50_PAD_SD1_D2__GPIO5_4 0x0f4 0x3a0 0x000 0x1 0x0
297#define MX50_PAD_SD1_D2__CCM_PLL3_BYP 0x0f4 0x3a0 0x6e4 0x7 0x0
298#define MX50_PAD_SD1_D3__ESDHC1_DAT3 0x0f8 0x3a4 0x000 0x0 0x0
299#define MX50_PAD_SD1_D3__GPIO5_5 0x0f8 0x3a4 0x000 0x1 0x0
300#define MX50_PAD_SD2_CLK__ESDHC2_CLK 0x0fc 0x3a8 0x000 0x0 0x0
301#define MX50_PAD_SD2_CLK__GPIO5_6 0x0fc 0x3a8 0x000 0x1 0x0
302#define MX50_PAD_SD2_CLK__MSHC_SCLK 0x0fc 0x3a8 0x000 0x2 0x0
303#define MX50_PAD_SD2_CMD__ESDHC2_CMD 0x100 0x3ac 0x000 0x0 0x0
304#define MX50_PAD_SD2_CMD__GPIO5_7 0x100 0x3ac 0x000 0x1 0x0
305#define MX50_PAD_SD2_CMD__MSHC_BS 0x100 0x3ac 0x000 0x2 0x0
306#define MX50_PAD_SD2_D0__ESDHC2_DAT0 0x104 0x3b0 0x000 0x0 0x0
307#define MX50_PAD_SD2_D0__GPIO5_8 0x104 0x3b0 0x000 0x1 0x0
308#define MX50_PAD_SD2_D0__MSHC_DATA_0 0x104 0x3b0 0x000 0x2 0x0
309#define MX50_PAD_SD2_D0__KPP_COL_4 0x104 0x3b0 0x790 0x3 0x0
310#define MX50_PAD_SD2_D1__ESDHC2_DAT1 0x108 0x3b4 0x000 0x0 0x0
311#define MX50_PAD_SD2_D1__GPIO5_9 0x108 0x3b4 0x000 0x1 0x0
312#define MX50_PAD_SD2_D1__MSHC_DATA_1 0x108 0x3b4 0x000 0x2 0x0
313#define MX50_PAD_SD2_D1__KPP_ROW_4 0x108 0x3b4 0x7a0 0x3 0x0
314#define MX50_PAD_SD2_D2__ESDHC2_DAT2 0x10c 0x3b8 0x000 0x0 0x0
315#define MX50_PAD_SD2_D2__GPIO5_10 0x10c 0x3b8 0x000 0x1 0x0
316#define MX50_PAD_SD2_D2__MSHC_DATA_2 0x10c 0x3b8 0x000 0x2 0x0
317#define MX50_PAD_SD2_D2__KPP_COL_5 0x10c 0x3b8 0x794 0x3 0x0
318#define MX50_PAD_SD2_D3__ESDHC2_DAT3 0x110 0x3bc 0x000 0x0 0x0
319#define MX50_PAD_SD2_D3__GPIO5_11 0x110 0x3bc 0x000 0x1 0x0
320#define MX50_PAD_SD2_D3__MSHC_DATA_3 0x110 0x3bc 0x000 0x2 0x0
321#define MX50_PAD_SD2_D3__KPP_ROW_5 0x110 0x3bc 0x7a4 0x3 0x0
322#define MX50_PAD_SD2_D4__ESDHC2_DAT4 0x114 0x3c0 0x000 0x0 0x0
323#define MX50_PAD_SD2_D4__GPIO5_12 0x114 0x3c0 0x000 0x1 0x0
324#define MX50_PAD_SD2_D4__AUDMUX_AUD4_RXFS 0x114 0x3c0 0x6d0 0x2 0x0
325#define MX50_PAD_SD2_D4__KPP_COL_6 0x114 0x3c0 0x798 0x3 0x0
326#define MX50_PAD_SD2_D4__EIM_WEIM_D_0 0x114 0x3c0 0x7ec 0x4 0x0
327#define MX50_PAD_SD2_D4__CCM_CCM_OUT_0 0x114 0x3c0 0x000 0x7 0x0
328#define MX50_PAD_SD2_D5__ESDHC2_DAT5 0x118 0x3c4 0x000 0x0 0x0
329#define MX50_PAD_SD2_D5__GPIO5_13 0x118 0x3c4 0x000 0x1 0x0
330#define MX50_PAD_SD2_D5__AUDMUX_AUD4_RXC 0x118 0x3c4 0x6cc 0x2 0x0
331#define MX50_PAD_SD2_D5__KPP_ROW_6 0x118 0x3c4 0x7a8 0x3 0x0
332#define MX50_PAD_SD2_D5__EIM_WEIM_D_1 0x118 0x3c4 0x7f0 0x4 0x0
333#define MX50_PAD_SD2_D5__CCM_CCM_OUT_1 0x118 0x3c4 0x000 0x7 0x0
334#define MX50_PAD_SD2_D6__ESDHC2_DAT6 0x11c 0x3c8 0x000 0x0 0x0
335#define MX50_PAD_SD2_D6__GPIO5_14 0x11c 0x3c8 0x000 0x1 0x0
336#define MX50_PAD_SD2_D6__AUDMUX_AUD4_RXD 0x11c 0x3c8 0x6c4 0x2 0x0
337#define MX50_PAD_SD2_D6__KPP_COL_7 0x11c 0x3c8 0x79c 0x3 0x0
338#define MX50_PAD_SD2_D6__EIM_WEIM_D_2 0x11c 0x3c8 0x7f4 0x4 0x0
339#define MX50_PAD_SD2_D6__CCM_CCM_OUT_2 0x11c 0x3c8 0x000 0x7 0x0
340#define MX50_PAD_SD2_D7__ESDHC2_DAT7 0x120 0x3cc 0x000 0x0 0x0
341#define MX50_PAD_SD2_D7__GPIO5_15 0x120 0x3cc 0x000 0x1 0x0
342#define MX50_PAD_SD2_D7__AUDMUX_AUD4_TXFS 0x120 0x3cc 0x6d8 0x2 0x0
343#define MX50_PAD_SD2_D7__KPP_ROW_7 0x120 0x3cc 0x7ac 0x3 0x0
344#define MX50_PAD_SD2_D7__EIM_WEIM_D_3 0x120 0x3cc 0x7f8 0x4 0x0
345#define MX50_PAD_SD2_D7__CCM_STOP 0x120 0x3cc 0x000 0x7 0x0
346#define MX50_PAD_SD2_WP__ESDHC2_WP 0x124 0x3d0 0x744 0x0 0x1
347#define MX50_PAD_SD2_WP__GPIO5_16 0x124 0x3d0 0x000 0x1 0x0
348#define MX50_PAD_SD2_WP__AUDMUX_AUD4_TXD 0x124 0x3d0 0x6c8 0x2 0x0
349#define MX50_PAD_SD2_WP__EIM_WEIM_D_4 0x124 0x3d0 0x7fc 0x4 0x0
350#define MX50_PAD_SD2_WP__CCM_WAIT 0x124 0x3d0 0x000 0x7 0x0
351#define MX50_PAD_SD2_CD__ESDHC2_CD 0x128 0x3d4 0x740 0x0 0x1
352#define MX50_PAD_SD2_CD__GPIO5_17 0x128 0x3d4 0x000 0x1 0x0
353#define MX50_PAD_SD2_CD__AUDMUX_AUD4_TXC 0x128 0x3d4 0x6d4 0x2 0x0
354#define MX50_PAD_SD2_CD__EIM_WEIM_D_5 0x128 0x3d4 0x800 0x4 0x0
355#define MX50_PAD_SD2_CD__CCM_REF_EN_B 0x128 0x3d4 0x000 0x7 0x0
356#define MX50_PAD_DISP_D0__ELCDIF_DAT_0 0x12c 0x40c 0x6fc 0x0 0x0
357#define MX50_PAD_DISP_D0__GPIO2_0 0x12c 0x40c 0x000 0x1 0x0
358#define MX50_PAD_DISP_D0__FEC_TX_CLK 0x12c 0x40c 0x78c 0x2 0x0
359#define MX50_PAD_DISP_D0__EIM_WEIM_A_16 0x12c 0x40c 0x000 0x3 0x0
360#define MX50_PAD_DISP_D0__SDMA_DEBUG_PC_0 0x12c 0x40c 0x000 0x6 0x0
361#define MX50_PAD_DISP_D0__USBPHY1_VSTATUS_0 0x12c 0x40c 0x000 0x7 0x0
362#define MX50_PAD_DISP_D1__ELCDIF_DAT_1 0x130 0x410 0x700 0x0 0x0
363#define MX50_PAD_DISP_D1__GPIO2_1 0x130 0x410 0x000 0x1 0x0
364#define MX50_PAD_DISP_D1__FEC_RX_ERR 0x130 0x410 0x788 0x2 0x0
365#define MX50_PAD_DISP_D1__EIM_WEIM_A_17 0x130 0x410 0x000 0x3 0x0
366#define MX50_PAD_DISP_D1__SDMA_DEBUG_PC_1 0x130 0x410 0x000 0x6 0x0
367#define MX50_PAD_DISP_D1__USBPHY1_VSTATUS_1 0x130 0x410 0x000 0x7 0x0
368#define MX50_PAD_DISP_D2__ELCDIF_DAT_2 0x134 0x414 0x704 0x0 0x0
369#define MX50_PAD_DISP_D2__GPIO2_2 0x134 0x414 0x000 0x1 0x0
370#define MX50_PAD_DISP_D2__FEC_RX_DV 0x134 0x414 0x784 0x2 0x0
371#define MX50_PAD_DISP_D2__EIM_WEIM_A_18 0x134 0x414 0x000 0x3 0x0
372#define MX50_PAD_DISP_D2__SDMA_DEBUG_PC_2 0x134 0x414 0x000 0x6 0x0
373#define MX50_PAD_DISP_D2__USBPHY1_VSTATUS_2 0x134 0x414 0x000 0x7 0x0
374#define MX50_PAD_DISP_D3__ELCDIF_DAT_3 0x138 0x418 0x708 0x0 0x0
375#define MX50_PAD_DISP_D3__GPIO2_3 0x138 0x418 0x000 0x1 0x0
376#define MX50_PAD_DISP_D3__FEC_RDATA_1 0x138 0x418 0x77c 0x2 0x0
377#define MX50_PAD_DISP_D3__EIM_WEIM_A_19 0x138 0x418 0x000 0x3 0x0
378#define MX50_PAD_DISP_D3__FEC_COL 0x138 0x418 0x770 0x4 0x1
379#define MX50_PAD_DISP_D3__SDMA_DEBUG_PC_3 0x138 0x418 0x000 0x6 0x0
380#define MX50_PAD_DISP_D3__USBPHY1_VSTATUS_3 0x138 0x418 0x000 0x7 0x0
381#define MX50_PAD_DISP_D4__ELCDIF_DAT_4 0x13c 0x41c 0x70c 0x0 0x0
382#define MX50_PAD_DISP_D4__GPIO2_4 0x13c 0x41c 0x000 0x1 0x0
383#define MX50_PAD_DISP_D4__FEC_RDATA_0 0x13c 0x41c 0x778 0x2 0x0
384#define MX50_PAD_DISP_D4__EIM_WEIM_A_20 0x13c 0x41c 0x000 0x3 0x0
385#define MX50_PAD_DISP_D4__SDMA_DEBUG_PC_4 0x13c 0x41c 0x000 0x6 0x0
386#define MX50_PAD_DISP_D4__USBPHY1_VSTATUS_4 0x13c 0x41c 0x000 0x7 0x0
387#define MX50_PAD_DISP_D5__ELCDIF_DAT_5 0x140 0x420 0x710 0x0 0x0
388#define MX50_PAD_DISP_D5__GPIO2_5 0x140 0x420 0x000 0x1 0x0
389#define MX50_PAD_DISP_D5__FEC_TX_EN 0x140 0x420 0x000 0x2 0x0
390#define MX50_PAD_DISP_D5__EIM_WEIM_A_21 0x140 0x420 0x000 0x3 0x0
391#define MX50_PAD_DISP_D5__SDMA_DEBUG_PC_5 0x140 0x420 0x000 0x6 0x0
392#define MX50_PAD_DISP_D5__USBPHY1_VSTATUS_5 0x140 0x420 0x000 0x7 0x0
393#define MX50_PAD_DISP_D6__ELCDIF_DAT_6 0x144 0x424 0x714 0x0 0x0
394#define MX50_PAD_DISP_D6__GPIO2_6 0x144 0x424 0x000 0x1 0x0
395#define MX50_PAD_DISP_D6__FEC_TDATA_1 0x144 0x424 0x000 0x2 0x0
396#define MX50_PAD_DISP_D6__EIM_WEIM_A_22 0x144 0x424 0x000 0x3 0x0
397#define MX50_PAD_DISP_D6__FEC_RX_CLK 0x144 0x424 0x780 0x4 0x1
398#define MX50_PAD_DISP_D6__SDMA_DEBUG_PC_6 0x144 0x424 0x000 0x6 0x0
399#define MX50_PAD_DISP_D6__USBPHY1_VSTATUS_6 0x144 0x424 0x000 0x7 0x0
400#define MX50_PAD_DISP_D7__ELCDIF_DAT_7 0x148 0x428 0x718 0x0 0x0
401#define MX50_PAD_DISP_D7__GPIO2_7 0x148 0x428 0x000 0x1 0x0
402#define MX50_PAD_DISP_D7__FEC_TDATA_0 0x148 0x428 0x000 0x2 0x0
403#define MX50_PAD_DISP_D7__EIM_WEIM_A_23 0x148 0x428 0x000 0x3 0x0
404#define MX50_PAD_DISP_D7__SDMA_DEBUG_PC_7 0x148 0x428 0x000 0x6 0x0
405#define MX50_PAD_DISP_D7__USBPHY1_VSTATUS_7 0x148 0x428 0x000 0x7 0x0
406#define MX50_PAD_DISP_WR__ELCDIF_WR_RWN 0x14c 0x42c 0x000 0x0 0x0
407#define MX50_PAD_DISP_WR__GPIO2_16 0x14c 0x42c 0x000 0x1 0x0
408#define MX50_PAD_DISP_WR__ELCDIF_DOTCLK 0x14c 0x42c 0x000 0x2 0x0
409#define MX50_PAD_DISP_WR__EIM_WEIM_A_24 0x14c 0x42c 0x000 0x3 0x0
410#define MX50_PAD_DISP_WR__SDMA_DEBUG_PC_8 0x14c 0x42c 0x000 0x6 0x0
411#define MX50_PAD_DISP_WR__USBPHY1_AVALID 0x14c 0x42c 0x000 0x7 0x0
412#define MX50_PAD_DISP_RD__ELCDIF_RD_E 0x150 0x430 0x000 0x0 0x0
413#define MX50_PAD_DISP_RD__GPIO2_19 0x150 0x430 0x000 0x1 0x0
414#define MX50_PAD_DISP_RD__ELCDIF_ENABLE 0x150 0x430 0x000 0x2 0x0
415#define MX50_PAD_DISP_RD__EIM_WEIM_A_25 0x150 0x430 0x000 0x3 0x0
416#define MX50_PAD_DISP_RD__SDMA_DEBUG_PC_9 0x150 0x430 0x000 0x6 0x0
417#define MX50_PAD_DISP_RD__USBPHY1_BVALID 0x150 0x430 0x000 0x7 0x0
418#define MX50_PAD_DISP_RS__ELCDIF_RS 0x154 0x434 0x000 0x0 0x0
419#define MX50_PAD_DISP_RS__GPIO2_17 0x154 0x434 0x000 0x1 0x0
420#define MX50_PAD_DISP_RS__ELCDIF_VSYNC 0x154 0x434 0x73c 0x2 0x1
421#define MX50_PAD_DISP_RS__EIM_WEIM_A_26 0x154 0x434 0x000 0x3 0x0
422#define MX50_PAD_DISP_RS__SDMA_DEBUG_PC_10 0x154 0x434 0x000 0x6 0x0
423#define MX50_PAD_DISP_RS__USBPHY1_ENDSESSION 0x154 0x434 0x000 0x7 0x0
424#define MX50_PAD_DISP_CS__ELCDIF_CS 0x158 0x438 0x000 0x0 0x0
425#define MX50_PAD_DISP_CS__GPIO2_21 0x158 0x438 0x000 0x1 0x0
426#define MX50_PAD_DISP_CS__ELCDIF_HSYNC 0x158 0x438 0x6f8 0x2 0x1
427#define MX50_PAD_DISP_CS__EIM_WEIM_A_27 0x158 0x438 0x000 0x3 0x0
428#define MX50_PAD_DISP_CS__EIM_WEIM_CS_3 0x158 0x438 0x000 0x4 0x0
429#define MX50_PAD_DISP_CS__SDMA_DEBUG_PC_11 0x158 0x438 0x000 0x6 0x0
430#define MX50_PAD_DISP_CS__USBPHY1_IDDIG 0x158 0x438 0x000 0x7 0x0
431#define MX50_PAD_DISP_BUSY__ELCDIF_BUSY 0x15c 0x43c 0x6f8 0x0 0x2
432#define MX50_PAD_DISP_BUSY__GPIO2_18 0x15c 0x43c 0x000 0x1 0x0
433#define MX50_PAD_DISP_BUSY__EIM_WEIM_CS_3 0x15c 0x43c 0x000 0x4 0x0
434#define MX50_PAD_DISP_BUSY__SDMA_DEBUG_PC_12 0x15c 0x43c 0x000 0x6 0x0
435#define MX50_PAD_DISP_BUSY__USBPHY2_HOSTDISCONNECT 0x15c 0x43c 0x000 0x7 0x0
436#define MX50_PAD_DISP_RESET__ELCDIF_RESET 0x160 0x440 0x000 0x0 0x0
437#define MX50_PAD_DISP_RESET__GPIO2_20 0x160 0x440 0x000 0x1 0x0
438#define MX50_PAD_DISP_RESET__EIM_WEIM_CS_3 0x160 0x440 0x000 0x4 0x0
439#define MX50_PAD_DISP_RESET__SDMA_DEBUG_PC_13 0x160 0x440 0x000 0x6 0x0
440#define MX50_PAD_DISP_RESET__USBPHY2_BISTOK 0x160 0x440 0x000 0x7 0x0
441#define MX50_PAD_SD3_CMD__ESDHC3_CMD 0x164 0x444 0x000 0x0 0x0
442#define MX50_PAD_SD3_CMD__GPIO5_18 0x164 0x444 0x000 0x1 0x0
443#define MX50_PAD_SD3_CMD__EIM_NANDF_WRN 0x164 0x444 0x000 0x2 0x0
444#define MX50_PAD_SD3_CMD__SSP_CMD 0x164 0x444 0x000 0x3 0x0
445#define MX50_PAD_SD3_CLK__ESDHC3_CLK 0x168 0x448 0x000 0x0 0x0
446#define MX50_PAD_SD3_CLK__GPIO5_19 0x168 0x448 0x000 0x1 0x0
447#define MX50_PAD_SD3_CLK__EIM_NANDF_RDN 0x168 0x448 0x000 0x2 0x0
448#define MX50_PAD_SD3_CLK__SSP_CLK 0x168 0x448 0x000 0x3 0x0
449#define MX50_PAD_SD3_D0__ESDHC3_DAT0 0x16c 0x44c 0x000 0x0 0x0
450#define MX50_PAD_SD3_D0__GPIO5_20 0x16c 0x44c 0x000 0x1 0x0
451#define MX50_PAD_SD3_D0__EIM_NANDF_D_4 0x16c 0x44c 0x000 0x2 0x0
452#define MX50_PAD_SD3_D0__SSP_D0 0x16c 0x44c 0x000 0x3 0x0
453#define MX50_PAD_SD3_D0__CCM_PLL1_BYP 0x16c 0x44c 0x6dc 0x7 0x1
454#define MX50_PAD_SD3_D1__ESDHC3_DAT1 0x170 0x450 0x000 0x0 0x0
455#define MX50_PAD_SD3_D1__GPIO5_21 0x170 0x450 0x000 0x1 0x0
456#define MX50_PAD_SD3_D1__EIM_NANDF_D_5 0x170 0x450 0x000 0x2 0x0
457#define MX50_PAD_SD3_D1__SSP_D1 0x170 0x450 0x000 0x3 0x0
458#define MX50_PAD_SD3_D1__CCM_PLL2_BYP 0x170 0x450 0x000 0x7 0x0
459#define MX50_PAD_SD3_D2__ESDHC3_DAT2 0x174 0x454 0x000 0x0 0x0
460#define MX50_PAD_SD3_D2__GPIO5_22 0x174 0x454 0x000 0x1 0x0
461#define MX50_PAD_SD3_D2__EIM_NANDF_D_6 0x174 0x454 0x000 0x2 0x0
462#define MX50_PAD_SD3_D2__SSP_D2 0x174 0x454 0x000 0x3 0x0
463#define MX50_PAD_SD3_D2__CCM_PLL3_BYP 0x174 0x454 0x6e4 0x7 0x1
464#define MX50_PAD_SD3_D3__ESDHC3_DAT3 0x178 0x458 0x000 0x0 0x0
465#define MX50_PAD_SD3_D3__GPIO5_23 0x178 0x458 0x000 0x1 0x0
466#define MX50_PAD_SD3_D3__EIM_NANDF_D_7 0x178 0x458 0x000 0x2 0x0
467#define MX50_PAD_SD3_D3__SSP_D3 0x178 0x458 0x000 0x3 0x0
468#define MX50_PAD_SD3_D4__ESDHC3_DAT4 0x17c 0x45c 0x000 0x0 0x0
469#define MX50_PAD_SD3_D4__GPIO5_24 0x17c 0x45c 0x000 0x1 0x0
470#define MX50_PAD_SD3_D4__EIM_NANDF_D_0 0x17c 0x45c 0x000 0x2 0x0
471#define MX50_PAD_SD3_D4__SSP_D4 0x17c 0x45c 0x000 0x3 0x0
472#define MX50_PAD_SD3_D5__ESDHC3_DAT5 0x180 0x460 0x000 0x0 0x0
473#define MX50_PAD_SD3_D5__GPIO5_25 0x180 0x460 0x000 0x1 0x0
474#define MX50_PAD_SD3_D5__EIM_NANDF_D_1 0x180 0x460 0x000 0x2 0x0
475#define MX50_PAD_SD3_D5__SSP_D5 0x180 0x460 0x000 0x3 0x0
476#define MX50_PAD_SD3_D6__ESDHC3_DAT6 0x184 0x464 0x000 0x0 0x0
477#define MX50_PAD_SD3_D6__GPIO5_26 0x184 0x464 0x000 0x1 0x0
478#define MX50_PAD_SD3_D6__EIM_NANDF_D_2 0x184 0x464 0x000 0x2 0x0
479#define MX50_PAD_SD3_D6__SSP_D6 0x184 0x464 0x000 0x3 0x0
480#define MX50_PAD_SD3_D7__ESDHC3_DAT7 0x188 0x468 0x000 0x0 0x0
481#define MX50_PAD_SD3_D7__GPIO5_27 0x188 0x468 0x000 0x1 0x0
482#define MX50_PAD_SD3_D7__EIM_NANDF_D_3 0x188 0x468 0x000 0x2 0x0
483#define MX50_PAD_SD3_D7__SSP_D7 0x188 0x468 0x000 0x3 0x0
484#define MX50_PAD_SD3_WP__ESDHC3_WP 0x18c 0x46C 0x000 0x0 0x0
485#define MX50_PAD_SD3_WP__GPIO5_28 0x18c 0x46C 0x000 0x1 0x0
486#define MX50_PAD_SD3_WP__EIM_NANDF_RESETN 0x18c 0x46C 0x000 0x2 0x0
487#define MX50_PAD_SD3_WP__SSP_CD 0x18c 0x46C 0x000 0x3 0x0
488#define MX50_PAD_SD3_WP__ESDHC4_LCTL 0x18c 0x46C 0x000 0x4 0x0
489#define MX50_PAD_SD3_WP__EIM_WEIM_CS_3 0x18c 0x46C 0x000 0x5 0x0
490#define MX50_PAD_DISP_D8__ELCDIF_DAT_8 0x190 0x470 0x71c 0x0 0x0
491#define MX50_PAD_DISP_D8__GPIO2_8 0x190 0x470 0x000 0x1 0x0
492#define MX50_PAD_DISP_D8__EIM_NANDF_CLE 0x190 0x470 0x000 0x2 0x0
493#define MX50_PAD_DISP_D8__ESDHC1_LCTL 0x190 0x470 0x000 0x3 0x0
494#define MX50_PAD_DISP_D8__ESDHC4_CMD 0x190 0x470 0x74c 0x4 0x2
495#define MX50_PAD_DISP_D8__KPP_COL_4 0x190 0x470 0x790 0x5 0x1
496#define MX50_PAD_DISP_D8__FEC_TX_CLK 0x190 0x470 0x78c 0x6 0x1
497#define MX50_PAD_DISP_D8__USBPHY1_DATAOUT_0 0x190 0x470 0x000 0x7 0x0
498#define MX50_PAD_DISP_D9__ELCDIF_DAT_9 0x194 0x474 0x720 0x0 0x0
499#define MX50_PAD_DISP_D9__GPIO2_9 0x194 0x474 0x000 0x1 0x0
500#define MX50_PAD_DISP_D9__EIM_NANDF_ALE 0x194 0x474 0x000 0x2 0x0
501#define MX50_PAD_DISP_D9__ESDHC2_LCTL 0x194 0x474 0x000 0x3 0x0
502#define MX50_PAD_DISP_D9__ESDHC4_CLK 0x194 0x474 0x748 0x4 0x2
503#define MX50_PAD_DISP_D9__KPP_ROW_4 0x194 0x474 0x7a0 0x5 0x1
504#define MX50_PAD_DISP_D9__FEC_RX_ER 0x194 0x474 0x788 0x6 0x1
505#define MX50_PAD_DISP_D9__USBPHY1_DATAOUT_1 0x194 0x474 0x000 0x7 0x0
506#define MX50_PAD_DISP_D10__ELCDIF_DAT_10 0x198 0x478 0x724 0x0 0x0
507#define MX50_PAD_DISP_D10__GPIO2_10 0x198 0x478 0x000 0x1 0x0
508#define MX50_PAD_DISP_D10__EIM_NANDF_CEN_0 0x198 0x478 0x000 0x2 0x0
509#define MX50_PAD_DISP_D10__ESDHC3_LCTL 0x198 0x478 0x000 0x3 0x0
510#define MX50_PAD_DISP_D10__ESDHC4_DAT0 0x198 0x478 0x000 0x4 0x0
511#define MX50_PAD_DISP_D10__KPP_COL_5 0x198 0x478 0x794 0x5 0x1
512#define MX50_PAD_DISP_D10__FEC_RX_DV 0x198 0x478 0x784 0x6 0x1
513#define MX50_PAD_DISP_D10__USBPHY1_DATAOUT_2 0x198 0x478 0x000 0x7 0x0
514#define MX50_PAD_DISP_D11__ELCDIF_DAT_11 0x19c 0x47c 0x728 0x0 0x0
515#define MX50_PAD_DISP_D11__GPIO2_11 0x19c 0x47c 0x000 0x1 0x0
516#define MX50_PAD_DISP_D11__EIM_NANDF_CEN_1 0x19c 0x47c 0x000 0x2 0x0
517#define MX50_PAD_DISP_D11__ESDHC4_DAT1 0x19c 0x47c 0x754 0x4 0x1
518#define MX50_PAD_DISP_D11__KPP_ROW_5 0x19c 0x47c 0x7a4 0x5 0x1
519#define MX50_PAD_DISP_D11__FEC_RDATA_1 0x19c 0x47c 0x77c 0x6 0x1
520#define MX50_PAD_DISP_D11__USBPHY1_DATAOUT_3 0x19c 0x47c 0x000 0x7 0x0
521#define MX50_PAD_DISP_D12__ELCDIF_DAT_12 0x1a0 0x480 0x72c 0x0 0x0
522#define MX50_PAD_DISP_D12__GPIO2_12 0x1a0 0x480 0x000 0x1 0x0
523#define MX50_PAD_DISP_D12__EIM_NANDF_CEN_2 0x1a0 0x480 0x000 0x2 0x0
524#define MX50_PAD_DISP_D12__ESDHC1_CD 0x1a0 0x480 0x000 0x3 0x0
525#define MX50_PAD_DISP_D12__ESDHC4_DAT2 0x1a0 0x480 0x758 0x4 0x1
526#define MX50_PAD_DISP_D12__KPP_COL_6 0x1a0 0x480 0x798 0x5 0x1
527#define MX50_PAD_DISP_D12__FEC_RDATA_0 0x1a0 0x480 0x778 0x6 0x1
528#define MX50_PAD_DISP_D12__USBPHY1_DATAOUT_4 0x1a0 0x480 0x000 0x7 0x0
529#define MX50_PAD_DISP_D13__ELCDIF_DAT_13 0x1a4 0x484 0x730 0x0 0x0
530#define MX50_PAD_DISP_D13__GPIO2_13 0x1a4 0x484 0x000 0x1 0x0
531#define MX50_PAD_DISP_D13__EIM_NANDF_CEN_3 0x1a4 0x484 0x000 0x2 0x0
532#define MX50_PAD_DISP_D13__ESDHC3_CD 0x1a4 0x484 0x000 0x3 0x0
533#define MX50_PAD_DISP_D13__ESDHC4_DAT3 0x1a4 0x484 0x75c 0x4 0x1
534#define MX50_PAD_DISP_D13__KPP_ROW_6 0x1a4 0x484 0x7a8 0x5 0x1
535#define MX50_PAD_DISP_D13__FEC_TX_EN 0x1a4 0x484 0x000 0x6 0x0
536#define MX50_PAD_DISP_D13__USBPHY1_DATAOUT_5 0x1a4 0x484 0x000 0x7 0x0
537#define MX50_PAD_DISP_D14__ELCDIF_DAT_14 0x1a8 0x488 0x734 0x0 0x0
538#define MX50_PAD_DISP_D14__GPIO2_14 0x1a8 0x488 0x000 0x1 0x0
539#define MX50_PAD_DISP_D14__EIM_NANDF_READY0 0x1a8 0x488 0x7b4 0x2 0x1
540#define MX50_PAD_DISP_D14__ESDHC1_WP 0x1a8 0x488 0x000 0x3 0x0
541#define MX50_PAD_DISP_D14__ESDHC4_WP 0x1a8 0x488 0x000 0x4 0x0
542#define MX50_PAD_DISP_D14__KPP_COL_7 0x1a8 0x488 0x79c 0x5 0x1
543#define MX50_PAD_DISP_D14__FEC_TDATA_1 0x1a8 0x488 0x000 0x6 0x0
544#define MX50_PAD_DISP_D14__USBPHY1_DATAOUT_6 0x1a8 0x488 0x000 0x7 0x0
545#define MX50_PAD_DISP_D15__ELCDIF_DAT_15 0x1ac 0x48c 0x738 0x0 0x0
546#define MX50_PAD_DISP_D15__GPIO2_15 0x1ac 0x48c 0x000 0x1 0x0
547#define MX50_PAD_DISP_D15__EIM_NANDF_DQS 0x1ac 0x48c 0x7b0 0x2 0x1
548#define MX50_PAD_DISP_D15__ESDHC3_RST 0x1ac 0x48c 0x000 0x3 0x0
549#define MX50_PAD_DISP_D15__ESDHC4_CD 0x1ac 0x48c 0x000 0x4 0x0
550#define MX50_PAD_DISP_D15__KPP_ROW_7 0x1ac 0x48c 0x7ac 0x5 0x1
551#define MX50_PAD_DISP_D15__FEC_TDATA_0 0x1ac 0x48c 0x000 0x6 0x0
552#define MX50_PAD_DISP_D15__USBPHY1_DATAOUT_7 0x1ac 0x48c 0x000 0x7 0x0
553#define MX50_PAD_EPDC_D0__EPDC_SDDO_0 0x1b0 0x54c 0x000 0x0 0x0
554#define MX50_PAD_EPDC_D0__GPIO3_0 0x1b0 0x54c 0x000 0x1 0x0
555#define MX50_PAD_EPDC_D0__EIM_WEIM_D_0 0x1b0 0x54c 0x7ec 0x2 0x1
556#define MX50_PAD_EPDC_D0__ELCDIF_RS 0x1b0 0x54c 0x000 0x3 0x0
557#define MX50_PAD_EPDC_D0__ELCDIF_DOTCLK 0x1b0 0x54c 0x000 0x4 0x0
558#define MX50_PAD_EPDC_D0__SDMA_DEBUG_EVT_CHN_LINES_0 0x1b0 0x54c 0x000 0x6 0x0
559#define MX50_PAD_EPDC_D0__USBPHY2_DATAOUT_0 0x1b0 0x54c 0x000 0x7 0x0
560#define MX50_PAD_EPDC_D1__EPDC_SDDO_1 0x1b4 0x550 0x000 0x0 0x0
561#define MX50_PAD_EPDC_D1__GPIO3_1 0x1b4 0x550 0x000 0x1 0x0
562#define MX50_PAD_EPDC_D1__EIM_WEIM_D_1 0x1b4 0x550 0x7f0 0x2 0x1
563#define MX50_PAD_EPDC_D1__ELCDIF_CS 0x1b4 0x550 0x000 0x3 0x0
564#define MX50_PAD_EPDC_D1__ELCDIF_ENABLE 0x1b4 0x550 0x000 0x4 0x0
565#define MX50_PAD_EPDC_D1__SDMA_DEBUG_EVT_CHN_LINES_1 0x1b4 0x550 0x000 0x6 0x0
566#define MX50_PAD_EPDC_D1__USBPHY2_DATAOUT_1 0x1b4 0x550 0x000 0x7 0x0
567#define MX50_PAD_EPDC_D2__EPDC_SDDO_2 0x1b8 0x554 0x000 0x0 0x0
568#define MX50_PAD_EPDC_D2__GPIO3_2 0x1b8 0x554 0x000 0x1 0x0
569#define MX50_PAD_EPDC_D2__EIM_WEIM_D_2 0x1b8 0x554 0x7f4 0x2 0x1
570#define MX50_PAD_EPDC_D2__ELCDIF_WR_RWN 0x1b8 0x554 0x000 0x3 0x0
571#define MX50_PAD_EPDC_D2__ELCDIF_VSYNC 0x1b8 0x554 0x73c 0x4 0x2
572#define MX50_PAD_EPDC_D2__SDMA_DEBUG_EVT_CHN_LINES_2 0x1b8 0x554 0x000 0x6 0x0
573#define MX50_PAD_EPDC_D2__USBPHY2_DATAOUT_2 0x1b8 0x554 0x000 0x7 0x0
574#define MX50_PAD_EPDC_D3__EPDC_SDDO_3 0x1bc 0x558 0x000 0x0 0x0
575#define MX50_PAD_EPDC_D3__GPIO3_3 0x1bc 0x558 0x000 0x1 0x0
576#define MX50_PAD_EPDC_D3__EIM_WEIM_D_3 0x1bc 0x558 0x7f8 0x2 0x1
577#define MX50_PAD_EPDC_D3__ELCDIF_RD_E 0x1bc 0x558 0x000 0x3 0x0
578#define MX50_PAD_EPDC_D3__ELCDIF_HSYNC 0x1bc 0x558 0x6f8 0x4 0x3
579#define MX50_PAD_EPDC_D3__SDMA_DEBUG_EVT_CHN_LINES_3 0x1bc 0x558 0x000 0x6 0x0
580#define MX50_PAD_EPDC_D3__USBPHY2_DATAOUT_3 0x1bc 0x558 0x000 0x7 0x0
581#define MX50_PAD_EPDC_D4__EPDC_SDDO_4 0x1c0 0x55c 0x000 0x0 0x0
582#define MX50_PAD_EPDC_D4__GPIO3_4 0x1c0 0x55c 0x000 0x1 0x0
583#define MX50_PAD_EPDC_D4__EIM_WEIM_D_4 0x1c0 0x55c 0x7fc 0x2 0x1
584#define MX50_PAD_EPDC_D4__SDMA_DEBUG_EVT_CHN_LINES_4 0x1c0 0x55c 0x000 0x6 0x0
585#define MX50_PAD_EPDC_D4__USBPHY2_DATAOUT_4 0x1c0 0x55c 0x000 0x7 0x0
586#define MX50_PAD_EPDC_D5__EPDC_SDDO_5 0x1c4 0x560 0x000 0x0 0x0
587#define MX50_PAD_EPDC_D5__GPIO3_5 0x1c4 0x560 0x000 0x1 0x0
588#define MX50_PAD_EPDC_D5__EIM_WEIM_D_5 0x1c4 0x560 0x800 0x2 0x1
589#define MX50_PAD_EPDC_D5__SDMA_DEBUG_EVT_CHN_LINES_5 0x1c4 0x560 0x000 0x6 0x0
590#define MX50_PAD_EPDC_D5__USBPHY2_DATAOUT_5 0x1c4 0x560 0x000 0x7 0x0
591#define MX50_PAD_EPDC_D6__EPDC_SDDO_6 0x1c8 0x564 0x000 0x0 0x0
592#define MX50_PAD_EPDC_D6__GPIO3_6 0x1c8 0x564 0x000 0x1 0x0
593#define MX50_PAD_EPDC_D6__EIM_WEIM_D_6 0x1c8 0x564 0x804 0x2 0x1
594#define MX50_PAD_EPDC_D6__SDMA_DEBUG_EVT_CHN_LINES_6 0x1c8 0x564 0x000 0x6 0x0
595#define MX50_PAD_EPDC_D6__USBPHY2_DATAOUT_6 0x1c8 0x564 0x000 0x7 0x0
596#define MX50_PAD_EPDC_D7__EPDC_SDDO_7 0x1cc 0x568 0x000 0x0 0x0
597#define MX50_PAD_EPDC_D7__GPIO3_7 0x1cc 0x568 0x000 0x1 0x0
598#define MX50_PAD_EPDC_D7__EIM_WEIM_D_7 0x1cc 0x568 0x808 0x2 0x1
599#define MX50_PAD_EPDC_D7__SDMA_DEBUG_EVT_CHN_LINES_7 0x1cc 0x568 0x000 0x6 0x0
600#define MX50_PAD_EPDC_D7__USBPHY2_DATAOUT_7 0x1cc 0x568 0x000 0x7 0x0
601#define MX50_PAD_EPDC_D8__EPDC_SDDO_8 0x1d0 0x56c 0x000 0x0 0x0
602#define MX50_PAD_EPDC_D8__GPIO3_8 0x1d0 0x56c 0x000 0x1 0x0
603#define MX50_PAD_EPDC_D8__EIM_WEIM_D_8 0x1d0 0x56c 0x80c 0x2 0x2
604#define MX50_PAD_EPDC_D8__ELCDIF_DAT_24 0x1d0 0x56c 0x000 0x3 0x0
605#define MX50_PAD_EPDC_D8__SDMA_DEBUG_MATCHED_DMBUS 0x1d0 0x56c 0x000 0x6 0x0
606#define MX50_PAD_EPDC_D8__USBPHY2_VSTATUS_0 0x1d0 0x56c 0x000 0x7 0x0
607#define MX50_PAD_EPDC_D9__EPDC_SDDO_9 0x1d4 0x570 0x000 0x0 0x0
608#define MX50_PAD_EPDC_D9__GPIO3_9 0x1d4 0x570 0x000 0x1 0x0
609#define MX50_PAD_EPDC_D9__EIM_WEIM_D_9 0x1d4 0x570 0x810 0x2 0x2
610#define MX50_PAD_EPDC_D9__ELCDIF_DAT_25 0x1d4 0x570 0x000 0x3 0x0
611#define MX50_PAD_EPDC_D9__SDMA_DEBUG_EVENT_CHANNEL_SEL 0x1d4 0x570 0x000 0x6 0x0
612#define MX50_PAD_EPDC_D9__USBPHY2_VSTATUS_1 0x1d4 0x570 0x000 0x7 0x0
613#define MX50_PAD_EPDC_D10__EPDC_SDDO_10 0x1d8 0x574 0x000 0x0 0x0
614#define MX50_PAD_EPDC_D10__GPIO3_10 0x1d8 0x574 0x000 0x1 0x0
615#define MX50_PAD_EPDC_D10__EIM_WEIM_D_10 0x1d8 0x574 0x814 0x2 0x2
616#define MX50_PAD_EPDC_D10__ELCDIF_DAT_26 0x1d8 0x574 0x000 0x3 0x0
617#define MX50_PAD_EPDC_D10__SDMA_DEBUG_EVENT_CHANNEL_0 0x1d8 0x574 0x000 0x6 0x0
618#define MX50_PAD_EPDC_D10__USBPHY2_VSTATUS_2 0x1d8 0x574 0x000 0x7 0x0
619#define MX50_PAD_EPDC_D11__EPDC_SDDO_11 0x1dc 0x578 0x000 0x0 0x0
620#define MX50_PAD_EPDC_D11__GPIO3_11 0x1dc 0x578 0x000 0x1 0x0
621#define MX50_PAD_EPDC_D11__EIM_WEIM_D_11 0x1dc 0x578 0x818 0x2 0x2
622#define MX50_PAD_EPDC_D11__ELCDIF_DAT_27 0x1dc 0x578 0x000 0x3 0x0
623#define MX50_PAD_EPDC_D11__SDMA_DEBUG_EVENT_CHANNEL_1 0x1dc 0x578 0x000 0x6 0x0
624#define MX50_PAD_EPDC_D11__USBPHY2_VSTATUS_3 0x1dc 0x578 0x000 0x7 0x0
625#define MX50_PAD_EPDC_D12__EPDC_SDDO_12 0x1e0 0x57c 0x000 0x0 0x0
626#define MX50_PAD_EPDC_D12__GPIO3_12 0x1e0 0x57c 0x000 0x1 0x0
627#define MX50_PAD_EPDC_D12__EIM_WEIM_D_12 0x1e0 0x57c 0x81c 0x2 0x1
628#define MX50_PAD_EPDC_D12__ELCDIF_DAT_28 0x1e0 0x57c 0x000 0x3 0x0
629#define MX50_PAD_EPDC_D12__SDMA_DEBUG_EVENT_CHANNEL_2 0x1e0 0x57c 0x000 0x6 0x0
630#define MX50_PAD_EPDC_D12__USBPHY2_VSTATUS_4 0x1e0 0x57c 0x000 0x7 0x0
631#define MX50_PAD_EPDC_D13__EPDC_SDDO_13 0x1e4 0x580 0x000 0x0 0x0
632#define MX50_PAD_EPDC_D13__GPIO3_13 0x1e4 0x580 0x000 0x1 0x0
633#define MX50_PAD_EPDC_D13__EIM_WEIM_D_13 0x1e4 0x580 0x820 0x2 0x1
634#define MX50_PAD_EPDC_D13__ELCDIF_DAT_29 0x1e4 0x580 0x000 0x3 0x0
635#define MX50_PAD_EPDC_D13__SDMA_DEBUG_EVENT_CHANNEL_3 0x1e4 0x580 0x000 0x6 0x0
636#define MX50_PAD_EPDC_D13__USBPHY2_VSTATUS_5 0x1e4 0x580 0x000 0x7 0x0
637#define MX50_PAD_EPDC_D14__EPDC_SDDO_14 0x1e8 0x584 0x000 0x0 0x0
638#define MX50_PAD_EPDC_D14__GPIO3_14 0x1e8 0x584 0x000 0x1 0x0
639#define MX50_PAD_EPDC_D14__EIM_WEIM_D_14 0x1e8 0x584 0x824 0x2 0x1
640#define MX50_PAD_EPDC_D14__ELCDIF_DAT_30 0x1e8 0x584 0x000 0x3 0x0
641#define MX50_PAD_EPDC_D14__AUDMUX_AUD6_TXD 0x1e8 0x584 0x000 0x4 0x0
642#define MX50_PAD_EPDC_D14__SDMA_DEBUG_EVENT_CHANNEL_4 0x1e8 0x584 0x000 0x6 0x0
643#define MX50_PAD_EPDC_D14__USBPHY2_VSTATUS_6 0x1e8 0x584 0x000 0x7 0x0
644#define MX50_PAD_EPDC_D15__EPDC_SDDO_15 0x1ec 0x588 0x000 0x0 0x0
645#define MX50_PAD_EPDC_D15__GPIO3_15 0x1ec 0x588 0x000 0x1 0x0
646#define MX50_PAD_EPDC_D15__EIM_WEIM_D_15 0x1ec 0x588 0x828 0x2 0x1
647#define MX50_PAD_EPDC_D15__ELCDIF_DAT_31 0x1ec 0x588 0x000 0x3 0x0
648#define MX50_PAD_EPDC_D15__AUDMUX_AUD6_TXC 0x1ec 0x588 0x000 0x4 0x0
649#define MX50_PAD_EPDC_D15__SDMA_DEBUG_EVENT_CHANNEL_5 0x1ec 0x588 0x000 0x6 0x0
650#define MX50_PAD_EPDC_D15__USBPHY2_VSTATUS_7 0x1ec 0x588 0x000 0x7 0x0
651#define MX50_PAD_EPDC_GDCLK__EPDC_GDCLK 0x1f0 0x58c 0x000 0x0 0x0
652#define MX50_PAD_EPDC_GDCLK__GPIO3_16 0x1f0 0x58c 0x000 0x1 0x0
653#define MX50_PAD_EPDC_GDCLK__EIM_WEIM_D_16 0x1f0 0x58c 0x000 0x2 0x0
654#define MX50_PAD_EPDC_GDCLK__ELCDIF_DAT_16 0x1f0 0x58c 0x000 0x3 0x0
655#define MX50_PAD_EPDC_GDCLK__AUDMUX_AUD6_TXFS 0x1f0 0x58c 0x000 0x4 0x0
656#define MX50_PAD_EPDC_GDCLK__SDMA_DEBUG_CORE_STATE_0 0x1f0 0x58c 0x000 0x6 0x0
657#define MX50_PAD_EPDC_GDCLK__USBPHY2_BISTOK 0x1f0 0x58c 0x000 0x7 0x0
658#define MX50_PAD_EPDC_GDSP__EPCD_GDSP 0x1f4 0x590 0x000 0x0 0x0
659#define MX50_PAD_EPDC_GDSP__GPIO3_17 0x1f4 0x590 0x000 0x1 0x0
660#define MX50_PAD_EPDC_GDSP__EIM_WEIM_D_17 0x1f4 0x590 0x000 0x2 0x0
661#define MX50_PAD_EPDC_GDSP__ELCDIF_DAT_17 0x1f4 0x590 0x000 0x3 0x0
662#define MX50_PAD_EPDC_GDSP__AUDMUX_AUD6_RXD 0x1f4 0x590 0x000 0x4 0x0
663#define MX50_PAD_EPDC_GDSP__SDMA_DEBUG_CORE_STATE_1 0x1f4 0x590 0x000 0x6 0x0
664#define MX50_PAD_EPDC_GDSP__USBPHY2_BVALID 0x1f4 0x590 0x000 0x7 0x0
665#define MX50_PAD_EPDC_GDOE__EPCD_GDOE 0x1f8 0x594 0x000 0x0 0x0
666#define MX50_PAD_EPDC_GDOE__GPIO3_18 0x1f8 0x594 0x000 0x1 0x0
667#define MX50_PAD_EPDC_GDOE__EIM_WEIM_D_18 0x1f8 0x594 0x000 0x2 0x0
668#define MX50_PAD_EPDC_GDOE__ELCDIF_DAT_18 0x1f8 0x594 0x000 0x3 0x0
669#define MX50_PAD_EPDC_GDOE__AUDMUX_AUD6_RXC 0x1f8 0x594 0x000 0x4 0x0
670#define MX50_PAD_EPDC_GDOE__SDMA_DEBUG_CORE_STATE_2 0x1f8 0x594 0x000 0x6 0x0
671#define MX50_PAD_EPDC_GDOE__USBPHY2_ENDSESSION 0x1f8 0x594 0x000 0x7 0x0
672#define MX50_PAD_EPDC_GDRL__EPCD_GDRL 0x1fc 0x598 0x000 0x0 0x0
673#define MX50_PAD_EPDC_GDRL__GPIO3_19 0x1fc 0x598 0x000 0x1 0x0
674#define MX50_PAD_EPDC_GDRL__EIM_WEIM_D_19 0x1f8 0x598 0x000 0x2 0x0
675#define MX50_PAD_EPDC_GDRL__ELCDIF_DAT_19 0x1fc 0x598 0x000 0x3 0x0
676#define MX50_PAD_EPDC_GDRL__AUDMUX_AUD6_RXFS 0x1fc 0x598 0x000 0x4 0x0
677#define MX50_PAD_EPDC_GDRL__SDMA_DEBUG_CORE_STATE_3 0x1fc 0x598 0x000 0x6 0x0
678#define MX50_PAD_EPDC_GDRL__USBPHY2_IDDIG 0x1fc 0x598 0x000 0x7 0x0
679#define MX50_PAD_EPDC_SDCLK__EPCD_SDCLK 0x200 0x59c 0x000 0x0 0x0
680#define MX50_PAD_EPDC_SDCLK__GPIO3_20 0x200 0x59c 0x000 0x1 0x0
681#define MX50_PAD_EPDC_SDCLK__EIM_WEIM_D_20 0x200 0x59c 0x000 0x2 0x0
682#define MX50_PAD_EPDC_SDCLK__ELCDIF_DAT_20 0x200 0x59c 0x000 0x3 0x0
683#define MX50_PAD_EPDC_SDCLK__AUDMUX_AUD5_TXD 0x200 0x59c 0x000 0x4 0x0
684#define MX50_PAD_EPDC_SDCLK__SDMA_DEBUG_BUS_DEVICE_0 0x200 0x59c 0x000 0x6 0x0
685#define MX50_PAD_EPDC_SDCLK__USBPHY2_HOSTDISCONNECT 0x200 0x59c 0x000 0x7 0x0
686#define MX50_PAD_EPDC_SDOEZ__EPCD_SDOEZ 0x204 0x5a0 0x000 0x0 0x0
687#define MX50_PAD_EPDC_SDOEZ__GPIO3_21 0x204 0x5a0 0x000 0x1 0x0
688#define MX50_PAD_EPDC_SDOEZ__EIM_WEIM_D_21 0x204 0x5a0 0x000 0x2 0x0
689#define MX50_PAD_EPDC_SDOEZ__ELCDIF_DAT_21 0x204 0x5a0 0x000 0x3 0x0
690#define MX50_PAD_EPDC_SDOEZ__AUDMUX_AUD5_TXC 0x204 0x5a0 0x000 0x4 0x0
691#define MX50_PAD_EPDC_SDOEZ__SDMA_DEBUG_BUS_DEVICE_1 0x204 0x5a0 0x000 0x6 0x0
692#define MX50_PAD_EPDC_SDOEZ__USBPHY2_TXREADY 0x204 0x5a0 0x000 0x7 0x0
693#define MX50_PAD_EPDC_SDOED__EPCD_SDOED 0x208 0x5a4 0x000 0x0 0x0
694#define MX50_PAD_EPDC_SDOED__GPIO3_22 0x208 0x5a4 0x000 0x1 0x0
695#define MX50_PAD_EPDC_SDOED__EIM_WEIM_D_22 0x208 0x5a4 0x000 0x2 0x0
696#define MX50_PAD_EPDC_SDOED__ELCDIF_DAT_22 0x208 0x5a4 0x000 0x3 0x0
697#define MX50_PAD_EPDC_SDOED__AUDMUX_AUD5_TXFS 0x208 0x5a4 0x000 0x4 0x0
698#define MX50_PAD_EPDC_SDOED__SDMA_DEBUG_BUS_DEVICE_2 0x208 0x5a4 0x000 0x6 0x0
699#define MX50_PAD_EPDC_SDOED__USBPHY2_RXVALID 0x208 0x5a4 0x000 0x7 0x0
700#define MX50_PAD_EPDC_SDOE__EPCD_SDOE 0x20c 0x5a8 0x000 0x0 0x0
701#define MX50_PAD_EPDC_SDOE__GPIO3_23 0x20c 0x5a8 0x000 0x1 0x0
702#define MX50_PAD_EPDC_SDOE__EIM_WEIM_D_23 0x20c 0x5a8 0x000 0x2 0x0
703#define MX50_PAD_EPDC_SDOE__ELCDIF_DAT_23 0x20c 0x5a8 0x000 0x3 0x0
704#define MX50_PAD_EPDC_SDOE__AUDMUX_AUD5_RXD 0x20c 0x5a8 0x000 0x4 0x0
705#define MX50_PAD_EPDC_SDOE__SDMA_DEBUG_BUS_DEVICE_3 0x20c 0x5a8 0x000 0x6 0x0
706#define MX50_PAD_EPDC_SDOE__USBPHY2_RXACTIVE 0x20c 0x5a8 0x000 0x7 0x0
707#define MX50_PAD_EPDC_SDLE__EPCD_SDLE 0x210 0x5ac 0x000 0x0 0x0
708#define MX50_PAD_EPDC_SDLE__GPIO3_24 0x210 0x5ac 0x000 0x1 0x0
709#define MX50_PAD_EPDC_SDLE__EIM_WEIM_D_24 0x210 0x5ac 0x000 0x2 0x0
710#define MX50_PAD_EPDC_SDLE__ELCDIF_DAT_8 0x210 0x5ac 0x71c 0x3 0x1
711#define MX50_PAD_EPDC_SDLE__AUDMUX_AUD5_RXC 0x210 0x5ac 0x000 0x4 0x0
712#define MX50_PAD_EPDC_SDLE__SDMA_DEBUG_BUS_DEVICE_4 0x210 0x5ac 0x000 0x6 0x0
713#define MX50_PAD_EPDC_SDLE__USBPHY2_RXERROR 0x210 0x5ac 0x000 0x7 0x0
714#define MX50_PAD_EPDC_SDCLKN__EPCD_SDCLKN 0x214 0x5b0 0x000 0x0 0x0
715#define MX50_PAD_EPDC_SDCLKN__GPIO3_25 0x214 0x5b0 0x000 0x1 0x0
716#define MX50_PAD_EPDC_SDCLKN__EIM_WEIM_D_25 0x214 0x5b0 0x000 0x2 0x0
717#define MX50_PAD_EPDC_SDCLKN__ELCDIF_DAT_9 0x214 0x5b0 0x720 0x3 0x1
718#define MX50_PAD_EPDC_SDCLKN__AUDMUX_AUD5_RXFS 0x214 0x5b0 0x000 0x4 0x0
719#define MX50_PAD_EPDC_SDCLKN__SDMA_DEBUG_BUS_ERROR 0x214 0x5b0 0x000 0x6 0x0
720#define MX50_PAD_EPDC_SDCLKN__USBPHY2_SIECLOCK 0x214 0x5b0 0x000 0x7 0x0
721#define MX50_PAD_EPDC_SDSHR__EPCD_SDSHR 0x218 0x5b4 0x000 0x0 0x0
722#define MX50_PAD_EPDC_SDSHR__GPIO3_26 0x218 0x5b4 0x000 0x1 0x0
723#define MX50_PAD_EPDC_SDSHR__EIM_WEIM_D_26 0x218 0x5b4 0x000 0x2 0x0
724#define MX50_PAD_EPDC_SDSHR__ELCDIF_DAT_10 0x218 0x5b4 0x724 0x3 0x1
725#define MX50_PAD_EPDC_SDSHR__AUDMUX_AUD4_TXD 0x218 0x5b4 0x6c8 0x4 0x1
726#define MX50_PAD_EPDC_SDSHR__SDMA_DEBUG_BUS_RWB 0x218 0x5b4 0x000 0x6 0x0
727#define MX50_PAD_EPDC_SDSHR__USBPHY2_LINESTATE_0 0x218 0x5b4 0x000 0x7 0x0
728#define MX50_PAD_EPDC_PWRCOM__EPCD_PWRCOM 0x21c 0x5b8 0x000 0x0 0x0
729#define MX50_PAD_EPDC_PWRCOM__GPIO3_27 0x21c 0x5b8 0x000 0x1 0x0
730#define MX50_PAD_EPDC_PWRCOM__EIM_WEIM_D_27 0x21c 0x5b8 0x000 0x2 0x0
731#define MX50_PAD_EPDC_PWRCOM__ELCDIF_DAT_11 0x21c 0x5b8 0x728 0x3 0x1
732#define MX50_PAD_EPDC_PWRCOM__AUDMUX_AUD4_TXC 0x21c 0x5b8 0x6d4 0x4 0x1
733#define MX50_PAD_EPDC_PWRCOM__SDMA_DEBUG_CORE_RUN 0x21c 0x5b8 0x000 0x6 0x0
734#define MX50_PAD_EPDC_PWRCOM__USBPHY2_LINESTATE_1 0x21c 0x5b8 0x000 0x7 0x0
735#define MX50_PAD_EPDC_PWRSTAT__EPCD_PWRSTAT 0x220 0x5bc 0x000 0x0 0x0
736#define MX50_PAD_EPDC_PWRSTAT__GPIO3_28 0x220 0x5bc 0x000 0x1 0x0
737#define MX50_PAD_EPDC_PWRSTAT__EIM_WEIM_D_28 0x220 0x5bc 0x000 0x2 0x0
738#define MX50_PAD_EPDC_PWRSTAT__ELCDIF_DAT_12 0x220 0x5bc 0x72c 0x3 0x1
739#define MX50_PAD_EPDC_PWRSTAT__AUDMUX_AUD4_TXFS 0x220 0x5bc 0x6d8 0x4 0x1
740#define MX50_PAD_EPDC_PWRSTAT__SDMA_DEBUG_MODE 0x220 0x5bc 0x000 0x6 0x0
741#define MX50_PAD_EPDC_PWRSTAT__USBPHY2_VBUSVALID 0x220 0x5bc 0x000 0x7 0x0
742#define MX50_PAD_EPDC_PWRCTRL0__EPCD_PWRCTRL0 0x224 0x5c0 0x000 0x0 0x0
743#define MX50_PAD_EPDC_PWRCTRL0__GPIO3_29 0x224 0x5c0 0x000 0x1 0x0
744#define MX50_PAD_EPDC_PWRCTRL0__EIM_WEIM_D_29 0x224 0x5c0 0x000 0x2 0x0
745#define MX50_PAD_EPDC_PWRCTRL0__ELCDIF_DAT_13 0x224 0x5c0 0x730 0x3 0x1
746#define MX50_PAD_EPDC_PWRCTRL0__AUDMUX_AUD4_RXD 0x224 0x5c0 0x6c4 0x4 0x1
747#define MX50_PAD_EPDC_PWRCTRL0__SDMA_DEBUG_RTBUFFER_WRITE 0x224 0x5c0 0x000 0x6 0x0
748#define MX50_PAD_EPDC_PWRCTRL0__USBPHY2_AVALID 0x224 0x5c0 0x000 0x7 0x0
749#define MX50_PAD_EPDC_PWRCTRL1__EPCD_PWRCTRL1 0x228 0x5c4 0x000 0x0 0x0
750#define MX50_PAD_EPDC_PWRCTRL1__GPIO3_30 0x228 0x5c4 0x000 0x1 0x0
751#define MX50_PAD_EPDC_PWRCTRL1__EIM_WEIM_D_30 0x228 0x5c4 0x000 0x2 0x0
752#define MX50_PAD_EPDC_PWRCTRL1__ELCDIF_DAT_14 0x228 0x5c4 0x734 0x3 0x1
753#define MX50_PAD_EPDC_PWRCTRL1__AUDMUX_AUD4_RXC 0x228 0x5c4 0x6cc 0x4 0x1
754#define MX50_PAD_EPDC_PWRCTRL1__SDMA_DEBUG_YIELD 0x228 0x5c4 0x000 0x6 0x0
755#define MX50_PAD_EPDC_PWRCTRL1__USBPHY1_ONBIST 0x228 0x5c4 0x000 0x7 0x0
756#define MX50_PAD_EPDC_PWRCTRL2__EPCD_PWRCTRL2 0x22c 0x5c8 0x000 0x0 0x0
757#define MX50_PAD_EPDC_PWRCTRL2__GPIO3_31 0x22c 0x5c8 0x000 0x1 0x0
758#define MX50_PAD_EPDC_PWRCTRL2__EIM_WEIM_D_31 0x22c 0x5c8 0x000 0x2 0x0
759#define MX50_PAD_EPDC_PWRCTRL2__ELCDIF_DAT_15 0x22c 0x5c8 0x738 0x3 0x1
760#define MX50_PAD_EPDC_PWRCTRL2__AUDMUX_AUD4_RXFS 0x22c 0x5c8 0x6d0 0x4 0x1
761#define MX50_PAD_EPDC_PWRCTRL2__SDMA_EXT_EVENT_0 0x22c 0x5c8 0x7b8 0x6 0x1
762#define MX50_PAD_EPDC_PWRCTRL2__USBPHY2_ONBIST 0x22c 0x5c8 0x000 0x7 0x0
763#define MX50_PAD_EPDC_PWRCTRL3__EPCD_PWRCTRL3 0x230 0x5cc 0x000 0x0 0x0
764#define MX50_PAD_EPDC_PWRCTRL3__GPIO4_20 0x230 0x5cc 0x000 0x1 0x0
765#define MX50_PAD_EPDC_PWRCTRL3__EIM_WEIM_EB_2 0x230 0x5cc 0x000 0x2 0x0
766#define MX50_PAD_EPDC_PWRCTRL3__SDMA_EXT_EVENT_1 0x230 0x5cc 0x7bc 0x6 0x1
767#define MX50_PAD_EPDC_PWRCTRL3__USBPHY1_BISTOK 0x230 0x5cc 0x000 0x7 0x0
768#define MX50_PAD_EPDC_VCOM0__EPCD_VCOM_0 0x234 0x5d0 0x000 0x0 0x0
769#define MX50_PAD_EPDC_VCOM0__GPIO4_21 0x234 0x5d0 0x000 0x1 0x0
770#define MX50_PAD_EPDC_VCOM0__EIM_WEIM_EB_3 0x234 0x5d0 0x000 0x2 0x0
771#define MX50_PAD_EPDC_VCOM0__USBPHY2_BISTOK 0x234 0x5d0 0x000 0x7 0x0
772#define MX50_PAD_EPDC_VCOM1__EPCD_VCOM_1 0x238 0x5d4 0x000 0x0 0x0
773#define MX50_PAD_EPDC_VCOM1__GPIO4_22 0x238 0x5d4 0x000 0x1 0x0
774#define MX50_PAD_EPDC_VCOM1__EIM_WEIM_CS_3 0x238 0x5d4 0x000 0x2 0x0
775#define MX50_PAD_EPDC_BDR0__EPCD_BDR_0 0x23c 0x5d8 0x000 0x0 0x0
776#define MX50_PAD_EPDC_BDR0__GPIO4_23 0x23c 0x5d8 0x000 0x1 0x0
777#define MX50_PAD_EPDC_BDR0__ELCDIF_DAT_7 0x23c 0x5d8 0x718 0x3 0x1
778#define MX50_PAD_EPDC_BDR1__EPCD_BDR_1 0x240 0x5dc 0x000 0x0 0x0
779#define MX50_PAD_EPDC_BDR1__GPIO4_24 0x240 0x5dc 0x000 0x1 0x0
780#define MX50_PAD_EPDC_BDR1__ELCDIF_DAT_6 0x240 0x5dc 0x714 0x3 0x1
781#define MX50_PAD_EPDC_SDCE0__EPCD_SDCE_0 0x244 0x5e0 0x000 0x0 0x0
782#define MX50_PAD_EPDC_SDCE0__GPIO4_25 0x244 0x5e0 0x000 0x1 0x0
783#define MX50_PAD_EPDC_SDCE0__ELCDIF_DAT_5 0x244 0x5e0 0x710 0x3 0x1
784#define MX50_PAD_EPDC_SDCE1__EPCD_SDCE_1 0x248 0x5e4 0x000 0x0 0x0
785#define MX50_PAD_EPDC_SDCE1__GPIO4_26 0x248 0x5e4 0x000 0x1 0x0
786#define MX50_PAD_EPDC_SDCE1__ELCDIF_DAT_4 0x248 0x5e4 0x70c 0x3 0x0
787#define MX50_PAD_EPDC_SDCE2__EPCD_SDCE_2 0x24c 0x5e8 0x000 0x0 0x0
788#define MX50_PAD_EPDC_SDCE2__GPIO4_27 0x24c 0x5e8 0x000 0x1 0x0
789#define MX50_PAD_EPDC_SDCE2__ELCDIF_DAT_3 0x24c 0x5e8 0x708 0x3 0x1
790#define MX50_PAD_EPDC_SDCE3__EPCD_SDCE_3 0x250 0x5ec 0x000 0x0 0x0
791#define MX50_PAD_EPDC_SDCE3__GPIO4_28 0x250 0x5ec 0x000 0x1 0x0
792#define MX50_PAD_EPDC_SDCE3__ELCDIF_DAT_2 0x250 0x5ec 0x704 0x3 0x1
793#define MX50_PAD_EPDC_SDCE4__EPCD_SDCE_4 0x254 0x5f0 0x000 0x0 0x0
794#define MX50_PAD_EPDC_SDCE4__GPIO4_29 0x254 0x5f0 0x000 0x1 0x0
795#define MX50_PAD_EPDC_SDCE4__ELCDIF_DAT_1 0x254 0x5f0 0x700 0x3 0x1
796#define MX50_PAD_EPDC_SDCE5__EPCD_SDCE_5 0x258 0x5f4 0x000 0x0 0x0
797#define MX50_PAD_EPDC_SDCE5__GPIO4_30 0x258 0x5f4 0x000 0x1 0x0
798#define MX50_PAD_EPDC_SDCE5__ELCDIF_DAT_0 0x258 0x5f4 0x6fc 0x3 0x1
799#define MX50_PAD_EIM_DA0__EIM_WEIM_A_0 0x25c 0x5f8 0x000 0x0 0x0
800#define MX50_PAD_EIM_DA0__GPIO1_0 0x25c 0x5f8 0x000 0x1 0x0
801#define MX50_PAD_EIM_DA0__KPP_COL_4 0x25c 0x5f8 0x790 0x3 0x2
802#define MX50_PAD_EIM_DA0__TPIU_TRACE_0 0x25c 0x5f8 0x000 0x6 0x0
803#define MX50_PAD_EIM_DA0__SRC_BT_CFG1_0 0x25c 0x5f8 0x000 0x7 0x0
804#define MX50_PAD_EIM_DA1__EIM_WEIM_A_1 0x260 0x5fc 0x000 0x0 0x0
805#define MX50_PAD_EIM_DA1__GPIO1_1 0x260 0x5fc 0x000 0x1 0x0
806#define MX50_PAD_EIM_DA1__KPP_ROW_4 0x260 0x5fc 0x7a0 0x3 0x2
807#define MX50_PAD_EIM_DA1__TPIU_TRACE_1 0x260 0x5fc 0x000 0x6 0x0
808#define MX50_PAD_EIM_DA1__SRC_BT_CFG1_1 0x260 0x5fc 0x000 0x7 0x0
809#define MX50_PAD_EIM_DA2__EIM_WEIM_A_2 0x264 0x600 0x000 0x0 0x0
810#define MX50_PAD_EIM_DA2__GPIO1_2 0x264 0x600 0x000 0x1 0x0
811#define MX50_PAD_EIM_DA2__KPP_COL_5 0x264 0x600 0x794 0x3 0x2
812#define MX50_PAD_EIM_DA2__TPIU_TRACE_2 0x264 0x600 0x000 0x6 0x0
813#define MX50_PAD_EIM_DA2__SRC_BT_CFG1_2 0x264 0x600 0x000 0x7 0x0
814#define MX50_PAD_EIM_DA3__EIM_WEIM_A_3 0x268 0x604 0x000 0x0 0x0
815#define MX50_PAD_EIM_DA3__GPIO1_3 0x268 0x604 0x000 0x1 0x0
816#define MX50_PAD_EIM_DA3__KPP_ROW_5 0x268 0x604 0x7a4 0x3 0x2
817#define MX50_PAD_EIM_DA3__TPIU_TRACE_3 0x268 0x604 0x000 0x6 0x0
818#define MX50_PAD_EIM_DA3__SRC_BT_CFG1_3 0x268 0x604 0x000 0x7 0x0
819#define MX50_PAD_EIM_DA4__EIM_WEIM_A_4 0x26c 0x608 0x000 0x0 0x0
820#define MX50_PAD_EIM_DA4__GPIO1_4 0x26c 0x608 0x000 0x1 0x0
821#define MX50_PAD_EIM_DA4__KPP_COL_6 0x26c 0x608 0x798 0x3 0x2
822#define MX50_PAD_EIM_DA4__TPIU_TRACE_4 0x26c 0x608 0x000 0x6 0x0
823#define MX50_PAD_EIM_DA4__SRC_BT_CFG1_4 0x26c 0x608 0x000 0x7 0x0
824#define MX50_PAD_EIM_DA5__EIM_WEIM_A_5 0x270 0x60c 0x000 0x0 0x0
825#define MX50_PAD_EIM_DA5__GPIO1_5 0x270 0x60c 0x000 0x1 0x0
826#define MX50_PAD_EIM_DA5__KPP_ROW_6 0x270 0x60c 0x7a8 0x3 0x2
827#define MX50_PAD_EIM_DA5__TPIU_TRACE_5 0x270 0x60c 0x000 0x6 0x0
828#define MX50_PAD_EIM_DA5__SRC_BT_CFG1_5 0x270 0x60c 0x000 0x7 0x0
829#define MX50_PAD_EIM_DA6__EIM_WEIM_A_6 0x274 0x610 0x000 0x0 0x0
830#define MX50_PAD_EIM_DA6__GPIO1_6 0x274 0x610 0x000 0x1 0x0
831#define MX50_PAD_EIM_DA6__KPP_COL_7 0x274 0x610 0x79c 0x3 0x2
832#define MX50_PAD_EIM_DA6__TPIU_TRACE_6 0x274 0x610 0x000 0x6 0x0
833#define MX50_PAD_EIM_DA6__SRC_BT_CFG1_6 0x274 0x610 0x000 0x7 0x0
834#define MX50_PAD_EIM_DA7__EIM_WEIM_A_7 0x278 0x614 0x000 0x0 0x0
835#define MX50_PAD_EIM_DA7__GPIO1_7 0x278 0x614 0x000 0x1 0x0
836#define MX50_PAD_EIM_DA7__KPP_ROW_7 0x278 0x614 0x7ac 0x3 0x2
837#define MX50_PAD_EIM_DA7__TPIU_TRACE_7 0x278 0x614 0x000 0x6 0x0
838#define MX50_PAD_EIM_DA7__SRC_BT_CFG1_7 0x278 0x614 0x000 0x7 0x0
839#define MX50_PAD_EIM_DA8__EIM_WEIM_A_8 0x27c 0x618 0x000 0x0 0x0
840#define MX50_PAD_EIM_DA8__GPIO1_8 0x27c 0x618 0x000 0x1 0x0
841#define MX50_PAD_EIM_DA8__EIM_NANDF_CLE 0x27c 0x618 0x000 0x2 0x0
842#define MX50_PAD_EIM_DA8__TPIU_TRACE_8 0x27c 0x618 0x000 0x6 0x0
843#define MX50_PAD_EIM_DA8__SRC_BT_CFG2_0 0x27c 0x618 0x000 0x7 0x0
844#define MX50_PAD_EIM_DA9__EIM_WEIM_A_9 0x280 0x61c 0x000 0x0 0x0
845#define MX50_PAD_EIM_DA9__GPIO1_9 0x280 0x61c 0x000 0x1 0x0
846#define MX50_PAD_EIM_DA9__EIM_NANDF_ALE 0x280 0x61c 0x000 0x2 0x0
847#define MX50_PAD_EIM_DA9__TPIU_TRACE_9 0x280 0x61c 0x000 0x6 0x0
848#define MX50_PAD_EIM_DA9__SRC_BT_CFG2_1 0x280 0x61c 0x000 0x7 0x0
849#define MX50_PAD_EIM_DA10__EIM_WEIM_A_10 0x284 0x620 0x000 0x0 0x0
850#define MX50_PAD_EIM_DA10__GPIO1_10 0x284 0x620 0x000 0x1 0x0
851#define MX50_PAD_EIM_DA10__EIM_NANDF_CEN_0 0x284 0x620 0x000 0x2 0x0
852#define MX50_PAD_EIM_DA10__TPIU_TRACE_10 0x284 0x620 0x000 0x6 0x0
853#define MX50_PAD_EIM_DA10__SRC_BT_CFG2_2 0x284 0x620 0x000 0x7 0x0
854#define MX50_PAD_EIM_DA11__EIM_WEIM_A_11 0x288 0x624 0x000 0x0 0x0
855#define MX50_PAD_EIM_DA11__GPIO1_11 0x288 0x624 0x000 0x1 0x0
856#define MX50_PAD_EIM_DA11__EIM_NANDF_CEN_1 0x288 0x624 0x000 0x2 0x0
857#define MX50_PAD_EIM_DA11__TPIU_TRACE_11 0x288 0x624 0x000 0x6 0x0
858#define MX50_PAD_EIM_DA11__SRC_BT_CFG2_3 0x288 0x624 0x000 0x7 0x0
859#define MX50_PAD_EIM_DA12__EIM_WEIM_A_12 0x28c 0x628 0x000 0x0 0x0
860#define MX50_PAD_EIM_DA12__GPIO1_12 0x28c 0x628 0x000 0x1 0x0
861#define MX50_PAD_EIM_DA12__EIM_NANDF_CEN_2 0x28c 0x628 0x000 0x2 0x0
862#define MX50_PAD_EIM_DA12__EPDC_SDCE_6 0x28c 0x628 0x000 0x3 0x0
863#define MX50_PAD_EIM_DA12__TPIU_TRACE_12 0x28c 0x628 0x000 0x6 0x0
864#define MX50_PAD_EIM_DA12__SRC_BT_CFG2_4 0x28c 0x628 0x000 0x7 0x0
865#define MX50_PAD_EIM_DA13__EIM_WEIM_A_13 0x290 0x62c 0x000 0x0 0x0
866#define MX50_PAD_EIM_DA13__GPIO1_13 0x290 0x62c 0x000 0x1 0x0
867#define MX50_PAD_EIM_DA13__EIM_NANDF_CEN_3 0x290 0x62c 0x000 0x2 0x0
868#define MX50_PAD_EIM_DA13__EPDC_SDCE_7 0x290 0x62c 0x000 0x3 0x0
869#define MX50_PAD_EIM_DA13__TPIU_TRACE_13 0x290 0x62c 0x000 0x6 0x0
870#define MX50_PAD_EIM_DA13__SRC_BT_CFG2_5 0x290 0x62c 0x000 0x7 0x0
871#define MX50_PAD_EIM_DA14__EIM_WEIM_A_14 0x294 0x630 0x000 0x0 0x0
872#define MX50_PAD_EIM_DA14__GPIO1_14 0x294 0x630 0x000 0x1 0x0
873#define MX50_PAD_EIM_DA14__EIM_NANDF_READY0 0x294 0x630 0x7b4 0x2 0x2
874#define MX50_PAD_EIM_DA14__EPDC_SDCE_8 0x294 0x630 0x000 0x3 0x0
875#define MX50_PAD_EIM_DA14__TPIU_TRACE_14 0x294 0x630 0x000 0x6 0x0
876#define MX50_PAD_EIM_DA14__SRC_BT_CFG2_6 0x294 0x630 0x000 0x7 0x0
877#define MX50_PAD_EIM_DA15__EIM_WEIM_A_15 0x298 0x634 0x000 0x0 0x0
878#define MX50_PAD_EIM_DA15__GPIO1_15 0x298 0x634 0x000 0x1 0x0
879#define MX50_PAD_EIM_DA15__EIM_NANDF_DQS 0x298 0x634 0x7b0 0x2 0x2
880#define MX50_PAD_EIM_DA15__EPDC_SDCE_9 0x298 0x634 0x000 0x3 0x0
881#define MX50_PAD_EIM_DA15__TPIU_TRACE_15 0x298 0x634 0x000 0x6 0x0
882#define MX50_PAD_EIM_DA15__SRC_BT_CFG2_7 0x298 0x634 0x000 0x7 0x0
883#define MX50_PAD_EIM_CS2__EIM_WEIM_CS_2 0x29c 0x638 0x000 0x0 0x0
884#define MX50_PAD_EIM_CS2__GPIO1_16 0x29c 0x638 0x000 0x1 0x0
885#define MX50_PAD_EIM_CS2__EIM_WEIM_A_27 0x29c 0x638 0x000 0x2 0x0
886#define MX50_PAD_EIM_CS2__TPIU_TRCLK 0x29c 0x638 0x000 0x6 0x0
887#define MX50_PAD_EIM_CS2__SRC_BT_CFG3_0 0x29c 0x638 0x000 0x7 0x0
888#define MX50_PAD_EIM_CS1__EIM_WEIM_CS_1 0x2a0 0x63c 0x000 0x0 0x0
889#define MX50_PAD_EIM_CS1__GPIO1_17 0x2a0 0x63c 0x000 0x1 0x0
890#define MX50_PAD_EIM_CS1__TPIU_TRCTL 0x2a0 0x63c 0x000 0x6 0x0
891#define MX50_PAD_EIM_CS1__SRC_BT_CFG3_1 0x2a0 0x63c 0x000 0x7 0x0
892#define MX50_PAD_EIM_CS0__EIM_WEIM_CS_0 0x2a4 0x640 0x000 0x0 0x0
893#define MX50_PAD_EIM_CS0__GPIO1_18 0x2a4 0x640 0x000 0x1 0x0
894#define MX50_PAD_EIM_CS0__SRC_BT_CFG3_2 0x2a4 0x640 0x000 0x7 0x0
895#define MX50_PAD_EIM_EB0__EIM_WEIM_EB_0 0x2a8 0x644 0x000 0x0 0x0
896#define MX50_PAD_EIM_EB0__GPIO1_19 0x2a8 0x644 0x000 0x1 0x0
897#define MX50_PAD_EIM_EB0__SRC_BT_CFG3_3 0x2a8 0x644 0x000 0x7 0x0
898#define MX50_PAD_EIM_EB1__EIM_WEIM_EB_1 0x2ac 0x648 0x000 0x0 0x0
899#define MX50_PAD_EIM_EB1__GPIO1_20 0x2ac 0x648 0x000 0x1 0x0
900#define MX50_PAD_EIM_EB1__SRC_BT_CFG3_4 0x2ac 0x648 0x000 0x7 0x0
901#define MX50_PAD_EIM_WAIT__EIM_WEIM_WAIT 0x2b0 0x64c 0x000 0x0 0x0
902#define MX50_PAD_EIM_WAIT__GPIO1_21 0x2b0 0x64c 0x000 0x1 0x0
903#define MX50_PAD_EIM_WAIT__EIM_WEIM_DTACK_B 0x2b0 0x64c 0x000 0x2 0x0
904#define MX50_PAD_EIM_WAIT__SRC_BT_CFG3_5 0x2b0 0x64c 0x000 0x7 0x0
905#define MX50_PAD_EIM_BCLK__EIM_WEIM_BCLK 0x2b4 0x650 0x000 0x0 0x0
906#define MX50_PAD_EIM_BCLK__GPIO1_22 0x2b4 0x650 0x000 0x1 0x0
907#define MX50_PAD_EIM_BCLK__SRC_BT_CFG3_6 0x2b4 0x650 0x000 0x7 0x0
908#define MX50_PAD_EIM_RDY__EIM_WEIM_RDY 0x2b8 0x654 0x000 0x0 0x0
909#define MX50_PAD_EIM_RDY__GPIO1_23 0x2b8 0x654 0x000 0x1 0x0
910#define MX50_PAD_EIM_RDY__SRC_BT_CFG3_7 0x2b8 0x654 0x000 0x7 0x0
911#define MX50_PAD_EIM_OE__EIM_WEIM_OE 0x2bc 0x658 0x000 0x0 0x0
912#define MX50_PAD_EIM_OE__GPIO1_24 0x2bc 0x658 0x000 0x1 0x0
913#define MX50_PAD_EIM_OE__INT_BOOT 0x2bc 0x658 0x000 0x7 0x0
914#define MX50_PAD_EIM_RW__EIM_WEIM_RW 0x2c0 0x65c 0x000 0x0 0x0
915#define MX50_PAD_EIM_RW__GPIO1_25 0x2c0 0x65c 0x000 0x1 0x0
916#define MX50_PAD_EIM_RW__SYSTEM_RST 0x2c0 0x65c 0x000 0x7 0x0
917#define MX50_PAD_EIM_LBA__EIM_WEIM_LBA 0x2c4 0x660 0x000 0x0 0x0
918#define MX50_PAD_EIM_LBA__GPIO1_26 0x2c4 0x660 0x000 0x1 0x0
919#define MX50_PAD_EIM_LBA__TESTER_ACK 0x2c4 0x660 0x000 0x7 0x0
920#define MX50_PAD_EIM_CRE__EIM_WEIM_CRE 0x2c8 0x664 0x000 0x0 0x0
921#define MX50_PAD_EIM_CRE__GPIO1_27 0x2c8 0x664 0x000 0x1 0x0
922
923#endif /* __DTS_IMX50_PINFUNC_H */
diff --git a/arch/arm/boot/dts/imx50.dtsi b/arch/arm/boot/dts/imx50.dtsi
new file mode 100644
index 000000000000..0c75fe3deb35
--- /dev/null
+++ b/arch/arm/boot/dts/imx50.dtsi
@@ -0,0 +1,478 @@
1/*
2 * Copyright 2013 Greg Ungerer <gerg@uclinux.org>
3 * Copyright 2011 Freescale Semiconductor, Inc.
4 * Copyright 2011 Linaro Ltd.
5 *
6 * The code contained herein is licensed under the GNU General Public
7 * License. You may obtain a copy of the GNU General Public License
8 * Version 2 or later at the following locations:
9 *
10 * http://www.opensource.org/licenses/gpl-license.html
11 * http://www.gnu.org/copyleft/gpl.html
12 */
13
14#include "skeleton.dtsi"
15#include "imx50-pinfunc.h"
16#include <dt-bindings/clock/imx5-clock.h>
17
18/ {
19 aliases {
20 gpio0 = &gpio1;
21 gpio1 = &gpio2;
22 gpio2 = &gpio3;
23 gpio3 = &gpio4;
24 gpio4 = &gpio5;
25 gpio5 = &gpio6;
26 serial0 = &uart1;
27 serial1 = &uart2;
28 serial2 = &uart3;
29 serial3 = &uart4;
30 serial4 = &uart5;
31 };
32
33 cpus {
34 #address-cells = <1>;
35 #size-cells = <0>;
36 cpu@0 {
37 device_type = "cpu";
38 compatible = "arm,cortex-a8";
39 reg = <0x0>;
40 };
41 };
42
43 tzic: tz-interrupt-controller@0fffc000 {
44 compatible = "fsl,imx50-tzic", "fsl,imx53-tzic", "fsl,tzic";
45 interrupt-controller;
46 #interrupt-cells = <1>;
47 reg = <0x0fffc000 0x4000>;
48 };
49
50 clocks {
51 #address-cells = <1>;
52 #size-cells = <0>;
53
54 ckil {
55 compatible = "fsl,imx-ckil", "fixed-clock";
56 clock-frequency = <32768>;
57 };
58
59 ckih1 {
60 compatible = "fsl,imx-ckih1", "fixed-clock";
61 clock-frequency = <22579200>;
62 };
63
64 ckih2 {
65 compatible = "fsl,imx-ckih2", "fixed-clock";
66 clock-frequency = <0>;
67 };
68
69 osc {
70 compatible = "fsl,imx-osc", "fixed-clock";
71 clock-frequency = <24000000>;
72 };
73 };
74
75 soc {
76 #address-cells = <1>;
77 #size-cells = <1>;
78 compatible = "simple-bus";
79 interrupt-parent = <&tzic>;
80 ranges;
81
82 aips@50000000 { /* AIPS1 */
83 compatible = "fsl,aips-bus", "simple-bus";
84 #address-cells = <1>;
85 #size-cells = <1>;
86 reg = <0x50000000 0x10000000>;
87 ranges;
88
89 spba@50000000 {
90 compatible = "fsl,spba-bus", "simple-bus";
91 #address-cells = <1>;
92 #size-cells = <1>;
93 reg = <0x50000000 0x40000>;
94 ranges;
95
96 esdhc1: esdhc@50004000 {
97 compatible = "fsl,imx50-esdhc";
98 reg = <0x50004000 0x4000>;
99 interrupts = <1>;
100 clocks = <&clks IMX5_CLK_ESDHC1_IPG_GATE>,
101 <&clks IMX5_CLK_DUMMY>,
102 <&clks IMX5_CLK_ESDHC1_PER_GATE>;
103 clock-names = "ipg", "ahb", "per";
104 bus-width = <4>;
105 status = "disabled";
106 };
107
108 esdhc2: esdhc@50008000 {
109 compatible = "fsl,imx50-esdhc";
110 reg = <0x50008000 0x4000>;
111 interrupts = <2>;
112 clocks = <&clks IMX5_CLK_ESDHC2_IPG_GATE>,
113 <&clks IMX5_CLK_DUMMY>,
114 <&clks IMX5_CLK_ESDHC2_PER_GATE>;
115 clock-names = "ipg", "ahb", "per";
116 bus-width = <4>;
117 status = "disabled";
118 };
119
120 uart3: serial@5000c000 {
121 compatible = "fsl,imx50-uart", "fsl,imx21-uart";
122 reg = <0x5000c000 0x4000>;
123 interrupts = <33>;
124 clocks = <&clks IMX5_CLK_UART3_IPG_GATE>,
125 <&clks IMX5_CLK_UART3_PER_GATE>;
126 clock-names = "ipg", "per";
127 status = "disabled";
128 };
129
130 ecspi1: ecspi@50010000 {
131 #address-cells = <1>;
132 #size-cells = <0>;
133 compatible = "fsl,imx50-ecspi", "fsl,imx51-ecspi";
134 reg = <0x50010000 0x4000>;
135 interrupts = <36>;
136 clocks = <&clks IMX5_CLK_ECSPI1_IPG_GATE>,
137 <&clks IMX5_CLK_ECSPI1_PER_GATE>;
138 clock-names = "ipg", "per";
139 status = "disabled";
140 };
141
142 ssi2: ssi@50014000 {
143 compatible = "fsl,imx50-ssi",
144 "fsl,imx51-ssi",
145 "fsl,imx21-ssi";
146 reg = <0x50014000 0x4000>;
147 interrupts = <30>;
148 clocks = <&clks IMX5_CLK_SSI2_IPG_GATE>;
149 fsl,fifo-depth = <15>;
150 fsl,ssi-dma-events = <25 24 23 22>; /* TX0 RX0 TX1 RX1 */
151 status = "disabled";
152 };
153
154 esdhc3: esdhc@50020000 {
155 compatible = "fsl,imx50-esdhc";
156 reg = <0x50020000 0x4000>;
157 interrupts = <3>;
158 clocks = <&clks IMX5_CLK_ESDHC3_IPG_GATE>,
159 <&clks IMX5_CLK_DUMMY>,
160 <&clks IMX5_CLK_ESDHC3_PER_GATE>;
161 clock-names = "ipg", "ahb", "per";
162 bus-width = <4>;
163 status = "disabled";
164 };
165
166 esdhc4: esdhc@50024000 {
167 compatible = "fsl,imx50-esdhc";
168 reg = <0x50024000 0x4000>;
169 interrupts = <4>;
170 clocks = <&clks IMX5_CLK_ESDHC4_IPG_GATE>,
171 <&clks IMX5_CLK_DUMMY>,
172 <&clks IMX5_CLK_ESDHC4_PER_GATE>;
173 clock-names = "ipg", "ahb", "per";
174 bus-width = <4>;
175 status = "disabled";
176 };
177 };
178
179 usbotg: usb@53f80000 {
180 compatible = "fsl,imx50-usb", "fsl,imx27-usb";
181 reg = <0x53f80000 0x0200>;
182 interrupts = <18>;
183 clocks = <&clks IMX5_CLK_USB_PHY1_GATE>;
184 status = "disabled";
185 };
186
187 usbh1: usb@53f80200 {
188 compatible = "fsl,imx50-usb", "fsl,imx27-usb";
189 reg = <0x53f80200 0x0200>;
190 interrupts = <14>;
191 clocks = <&clks IMX5_CLK_USB_PHY2_GATE>;
192 status = "disabled";
193 };
194
195 usbh2: usb@53f80400 {
196 compatible = "fsl,imx50-usb", "fsl,imx27-usb";
197 reg = <0x53f80400 0x0200>;
198 interrupts = <16>;
199 clocks = <&clks IMX5_CLK_USBOH3_GATE>;
200 status = "disabled";
201 };
202
203 usbh3: usb@53f80600 {
204 compatible = "fsl,imx50-usb", "fsl,imx27-usb";
205 reg = <0x53f80600 0x0200>;
206 interrupts = <17>;
207 clocks = <&clks IMX5_CLK_USBOH3_GATE>;
208 status = "disabled";
209 };
210
211 gpio1: gpio@53f84000 {
212 compatible = "fsl,imx50-gpio", "fsl,imx35-gpio";
213 reg = <0x53f84000 0x4000>;
214 interrupts = <50 51>;
215 gpio-controller;
216 #gpio-cells = <2>;
217 interrupt-controller;
218 #interrupt-cells = <2>;
219 };
220
221 gpio2: gpio@53f88000 {
222 compatible = "fsl,imx50-gpio", "fsl,imx35-gpio";
223 reg = <0x53f88000 0x4000>;
224 interrupts = <52 53>;
225 gpio-controller;
226 #gpio-cells = <2>;
227 interrupt-controller;
228 #interrupt-cells = <2>;
229 };
230
231 gpio3: gpio@53f8c000 {
232 compatible = "fsl,imx50-gpio", "fsl,imx35-gpio";
233 reg = <0x53f8c000 0x4000>;
234 interrupts = <54 55>;
235 gpio-controller;
236 #gpio-cells = <2>;
237 interrupt-controller;
238 #interrupt-cells = <2>;
239 };
240
241 gpio4: gpio@53f90000 {
242 compatible = "fsl,imx50-gpio", "fsl,imx35-gpio";
243 reg = <0x53f90000 0x4000>;
244 interrupts = <56 57>;
245 gpio-controller;
246 #gpio-cells = <2>;
247 interrupt-controller;
248 #interrupt-cells = <2>;
249 };
250
251 wdog1: wdog@53f98000 {
252 compatible = "fsl,imx50-wdt", "fsl,imx21-wdt";
253 reg = <0x53f98000 0x4000>;
254 interrupts = <58>;
255 clocks = <&clks IMX5_CLK_DUMMY>;
256 };
257
258 gpt: timer@53fa0000 {
259 compatible = "fsl,imx50-gpt", "fsl,imx31-gpt";
260 reg = <0x53fa0000 0x4000>;
261 interrupts = <39>;
262 clocks = <&clks IMX5_CLK_GPT_IPG_GATE>,
263 <&clks IMX5_CLK_GPT_HF_GATE>;
264 clock-names = "ipg", "per";
265 };
266
267 iomuxc: iomuxc@53fa8000 {
268 compatible = "fsl,imx50-iomuxc", "fsl,imx53-iomuxc";
269 reg = <0x53fa8000 0x4000>;
270 };
271
272 gpr: iomuxc-gpr@53fa8000 {
273 compatible = "fsl,imx50-iomuxc-gpr", "syscon";
274 reg = <0x53fa8000 0xc>;
275 };
276
277 pwm1: pwm@53fb4000 {
278 #pwm-cells = <2>;
279 compatible = "fsl,imx50-pwm", "fsl,imx27-pwm";
280 reg = <0x53fb4000 0x4000>;
281 clocks = <&clks IMX5_CLK_PWM1_IPG_GATE>,
282 <&clks IMX5_CLK_PWM1_HF_GATE>;
283 clock-names = "ipg", "per";
284 interrupts = <61>;
285 };
286
287 pwm2: pwm@53fb8000 {
288 #pwm-cells = <2>;
289 compatible = "fsl,imx50-pwm", "fsl,imx27-pwm";
290 reg = <0x53fb8000 0x4000>;
291 clocks = <&clks IMX5_CLK_PWM2_IPG_GATE>,
292 <&clks IMX5_CLK_PWM2_HF_GATE>;
293 clock-names = "ipg", "per";
294 interrupts = <94>;
295 };
296
297 uart1: serial@53fbc000 {
298 compatible = "fsl,imx50-uart", "fsl,imx21-uart";
299 reg = <0x53fbc000 0x4000>;
300 interrupts = <31>;
301 clocks = <&clks IMX5_CLK_UART1_IPG_GATE>,
302 <&clks IMX5_CLK_UART1_PER_GATE>;
303 clock-names = "ipg", "per";
304 status = "disabled";
305 };
306
307 uart2: serial@53fc0000 {
308 compatible = "fsl,imx50-uart", "fsl,imx21-uart";
309 reg = <0x53fc0000 0x4000>;
310 interrupts = <32>;
311 clocks = <&clks IMX5_CLK_UART2_IPG_GATE>,
312 <&clks IMX5_CLK_UART2_PER_GATE>;
313 clock-names = "ipg", "per";
314 status = "disabled";
315 };
316
317 src: src@53fd0000 {
318 compatible = "fsl,imx50-src", "fsl,imx51-src";
319 reg = <0x53fd0000 0x4000>;
320 #reset-cells = <1>;
321 };
322
323 clks: ccm@53fd4000{
324 compatible = "fsl,imx50-ccm";
325 reg = <0x53fd4000 0x4000>;
326 interrupts = <0 71 0x04 0 72 0x04>;
327 #clock-cells = <1>;
328 };
329
330 gpio5: gpio@53fdc000 {
331 compatible = "fsl,imx50-gpio", "fsl,imx35-gpio";
332 reg = <0x53fdc000 0x4000>;
333 interrupts = <103 104>;
334 gpio-controller;
335 #gpio-cells = <2>;
336 interrupt-controller;
337 #interrupt-cells = <2>;
338 };
339
340 gpio6: gpio@53fe0000 {
341 compatible = "fsl,imx50-gpio", "fsl,imx35-gpio";
342 reg = <0x53fe0000 0x4000>;
343 interrupts = <105 106>;
344 gpio-controller;
345 #gpio-cells = <2>;
346 interrupt-controller;
347 #interrupt-cells = <2>;
348 };
349
350 i2c3: i2c@53fec000 {
351 #address-cells = <1>;
352 #size-cells = <0>;
353 compatible = "fsl,imx50-i2c", "fsl,imx21-i2c";
354 reg = <0x53fec000 0x4000>;
355 interrupts = <64>;
356 clocks = <&clks IMX5_CLK_I2C3_GATE>;
357 status = "disabled";
358 };
359
360 uart4: serial@53ff0000 {
361 compatible = "fsl,imx50-uart", "fsl,imx21-uart";
362 reg = <0x53ff0000 0x4000>;
363 interrupts = <13>;
364 clocks = <&clks IMX5_CLK_UART4_IPG_GATE>,
365 <&clks IMX5_CLK_UART4_PER_GATE>;
366 clock-names = "ipg", "per";
367 status = "disabled";
368 };
369 };
370
371 aips@60000000 { /* AIPS2 */
372 compatible = "fsl,aips-bus", "simple-bus";
373 #address-cells = <1>;
374 #size-cells = <1>;
375 reg = <0x60000000 0x10000000>;
376 ranges;
377
378 uart5: serial@63f90000 {
379 compatible = "fsl,imx50-uart", "fsl,imx21-uart";
380 reg = <0x63f90000 0x4000>;
381 interrupts = <86>;
382 clocks = <&clks IMX5_CLK_UART5_IPG_GATE>,
383 <&clks IMX5_CLK_UART5_PER_GATE>;
384 clock-names = "ipg", "per";
385 status = "disabled";
386 };
387
388 owire: owire@63fa4000 {
389 compatible = "fsl,imx50-owire", "fsl,imx21-owire";
390 reg = <0x63fa4000 0x4000>;
391 clocks = <&clks IMX5_CLK_OWIRE_GATE>;
392 status = "disabled";
393 };
394
395 ecspi2: ecspi@63fac000 {
396 #address-cells = <1>;
397 #size-cells = <0>;
398 compatible = "fsl,imx50-ecspi", "fsl,imx51-ecspi";
399 reg = <0x63fac000 0x4000>;
400 interrupts = <37>;
401 clocks = <&clks IMX5_CLK_ECSPI2_IPG_GATE>,
402 <&clks IMX5_CLK_ECSPI2_PER_GATE>;
403 clock-names = "ipg", "per";
404 status = "disabled";
405 };
406
407 sdma: sdma@63fb0000 {
408 compatible = "fsl,imx50-sdma", "fsl,imx35-sdma";
409 reg = <0x63fb0000 0x4000>;
410 interrupts = <6>;
411 clocks = <&clks IMX5_CLK_SDMA_GATE>,
412 <&clks IMX5_CLK_SDMA_GATE>;
413 clock-names = "ipg", "ahb";
414 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx50.bin";
415 };
416
417 cspi: cspi@63fc0000 {
418 #address-cells = <1>;
419 #size-cells = <0>;
420 compatible = "fsl,imx50-cspi", "fsl,imx35-cspi";
421 reg = <0x63fc0000 0x4000>;
422 interrupts = <38>;
423 clocks = <&clks IMX5_CLK_CSPI_IPG_GATE>,
424 <&clks IMX5_CLK_CSPI_IPG_GATE>;
425 clock-names = "ipg", "per";
426 status = "disabled";
427 };
428
429 i2c2: i2c@63fc4000 {
430 #address-cells = <1>;
431 #size-cells = <0>;
432 compatible = "fsl,imx50-i2c", "fsl,imx21-i2c";
433 reg = <0x63fc4000 0x4000>;
434 interrupts = <63>;
435 clocks = <&clks IMX5_CLK_I2C2_GATE>;
436 status = "disabled";
437 };
438
439 i2c1: i2c@63fc8000 {
440 #address-cells = <1>;
441 #size-cells = <0>;
442 compatible = "fsl,imx50-i2c", "fsl,imx21-i2c";
443 reg = <0x63fc8000 0x4000>;
444 interrupts = <62>;
445 clocks = <&clks IMX5_CLK_I2C1_GATE>;
446 status = "disabled";
447 };
448
449 ssi1: ssi@63fcc000 {
450 compatible = "fsl,imx50-ssi", "fsl,imx51-ssi",
451 "fsl,imx21-ssi";
452 reg = <0x63fcc000 0x4000>;
453 interrupts = <29>;
454 clocks = <&clks IMX5_CLK_SSI1_IPG_GATE>;
455 fsl,fifo-depth = <15>;
456 fsl,ssi-dma-events = <29 28 27 26>; /* TX0 RX0 TX1 RX1 */
457 status = "disabled";
458 };
459
460 audmux: audmux@63fd0000 {
461 compatible = "fsl,imx50-audmux", "fsl,imx31-audmux";
462 reg = <0x63fd0000 0x4000>;
463 status = "disabled";
464 };
465
466 fec: ethernet@63fec000 {
467 compatible = "fsl,imx53-fec", "fsl,imx25-fec";
468 reg = <0x63fec000 0x4000>;
469 interrupts = <87>;
470 clocks = <&clks IMX5_CLK_FEC_GATE>,
471 <&clks IMX5_CLK_FEC_GATE>,
472 <&clks IMX5_CLK_FEC_GATE>;
473 clock-names = "ipg", "ahb", "ptp";
474 status = "disabled";
475 };
476 };
477 };
478};
diff --git a/arch/arm/boot/dts/imx51-apf51.dts b/arch/arm/boot/dts/imx51-apf51.dts
index b3606993f2e8..e88b2a6be079 100644
--- a/arch/arm/boot/dts/imx51-apf51.dts
+++ b/arch/arm/boot/dts/imx51-apf51.dts
@@ -34,13 +34,47 @@
34 34
35&fec { 35&fec {
36 pinctrl-names = "default"; 36 pinctrl-names = "default";
37 pinctrl-0 = <&pinctrl_fec_2>; 37 pinctrl-0 = <&pinctrl_fec>;
38 phy-mode = "mii"; 38 phy-mode = "mii";
39 phy-reset-gpios = <&gpio3 0 0>; 39 phy-reset-gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>;
40 phy-reset-duration = <1>; 40 phy-reset-duration = <1>;
41 status = "okay"; 41 status = "okay";
42}; 42};
43 43
44&iomuxc {
45 imx51-apf51 {
46 pinctrl_fec: fecgrp {
47 fsl,pins = <
48 MX51_PAD_DI_GP3__FEC_TX_ER 0x80000000
49 MX51_PAD_DI2_PIN4__FEC_CRS 0x80000000
50 MX51_PAD_DI2_PIN2__FEC_MDC 0x80000000
51 MX51_PAD_DI2_PIN3__FEC_MDIO 0x80000000
52 MX51_PAD_DI2_DISP_CLK__FEC_RDATA1 0x80000000
53 MX51_PAD_DI_GP4__FEC_RDATA2 0x80000000
54 MX51_PAD_DISP2_DAT0__FEC_RDATA3 0x80000000
55 MX51_PAD_DISP2_DAT1__FEC_RX_ER 0x80000000
56 MX51_PAD_DISP2_DAT6__FEC_TDATA1 0x80000000
57 MX51_PAD_DISP2_DAT7__FEC_TDATA2 0x80000000
58 MX51_PAD_DISP2_DAT8__FEC_TDATA3 0x80000000
59 MX51_PAD_DISP2_DAT9__FEC_TX_EN 0x80000000
60 MX51_PAD_DISP2_DAT10__FEC_COL 0x80000000
61 MX51_PAD_DISP2_DAT11__FEC_RX_CLK 0x80000000
62 MX51_PAD_DISP2_DAT12__FEC_RX_DV 0x80000000
63 MX51_PAD_DISP2_DAT13__FEC_TX_CLK 0x80000000
64 MX51_PAD_DISP2_DAT14__FEC_RDATA0 0x80000000
65 MX51_PAD_DISP2_DAT15__FEC_TDATA0 0x80000000
66 >;
67 };
68
69 pinctrl_uart3: uart3grp {
70 fsl,pins = <
71 MX51_PAD_UART3_RXD__UART3_RXD 0x1c5
72 MX51_PAD_UART3_TXD__UART3_TXD 0x1c5
73 >;
74 };
75 };
76};
77
44&nfc { 78&nfc {
45 nand-bus-width = <8>; 79 nand-bus-width = <8>;
46 nand-ecc-mode = "hw"; 80 nand-ecc-mode = "hw";
@@ -50,6 +84,6 @@
50 84
51&uart3 { 85&uart3 {
52 pinctrl-names = "default"; 86 pinctrl-names = "default";
53 pinctrl-0 = <&pinctrl_uart3_2>; 87 pinctrl-0 = <&pinctrl_uart3>;
54 status = "okay"; 88 status = "okay";
55}; 89};
diff --git a/arch/arm/boot/dts/imx51-apf51dev.dts b/arch/arm/boot/dts/imx51-apf51dev.dts
index 5a7f552786a1..c5a9a24c280a 100644
--- a/arch/arm/boot/dts/imx51-apf51dev.dts
+++ b/arch/arm/boot/dts/imx51-apf51dev.dts
@@ -18,10 +18,9 @@
18 18
19 display@di1 { 19 display@di1 {
20 compatible = "fsl,imx-parallel-display"; 20 compatible = "fsl,imx-parallel-display";
21 crtcs = <&ipu 0>;
22 interface-pix-fmt = "bgr666"; 21 interface-pix-fmt = "bgr666";
23 pinctrl-names = "default"; 22 pinctrl-names = "default";
24 pinctrl-0 = <&pinctrl_ipu_disp1_1>; 23 pinctrl-0 = <&pinctrl_ipu_disp1>;
25 24
26 display-timings { 25 display-timings {
27 lw700 { 26 lw700 {
@@ -41,6 +40,12 @@
41 pixelclk-active = <0>; 40 pixelclk-active = <0>;
42 }; 41 };
43 }; 42 };
43
44 port {
45 display_in: endpoint {
46 remote-endpoint = <&ipu_di0_disp0>;
47 };
48 };
44 }; 49 };
45 50
46 gpio-keys { 51 gpio-keys {
@@ -48,7 +53,7 @@
48 53
49 user-key { 54 user-key {
50 label = "user"; 55 label = "user";
51 gpios = <&gpio1 3 0>; 56 gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
52 linux,code = <256>; /* BTN_0 */ 57 linux,code = <256>; /* BTN_0 */
53 }; 58 };
54 }; 59 };
@@ -58,7 +63,7 @@
58 63
59 user { 64 user {
60 label = "Heartbeat"; 65 label = "Heartbeat";
61 gpios = <&gpio1 2 0>; 66 gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
62 linux,default-trigger = "heartbeat"; 67 linux,default-trigger = "heartbeat";
63 }; 68 };
64 }; 69 };
@@ -66,31 +71,33 @@
66 71
67&ecspi1 { 72&ecspi1 {
68 pinctrl-names = "default"; 73 pinctrl-names = "default";
69 pinctrl-0 = <&pinctrl_ecspi1_1>; 74 pinctrl-0 = <&pinctrl_ecspi1>;
70 fsl,spi-num-chipselects = <2>; 75 fsl,spi-num-chipselects = <2>;
71 cs-gpios = <&gpio4 24 0>, <&gpio4 25 0>; 76 cs-gpios = <&gpio4 24 GPIO_ACTIVE_HIGH>,
77 <&gpio4 25 GPIO_ACTIVE_HIGH>;
72 status = "okay"; 78 status = "okay";
73}; 79};
74 80
75&ecspi2 { 81&ecspi2 {
76 pinctrl-names = "default"; 82 pinctrl-names = "default";
77 pinctrl-0 = <&pinctrl_ecspi2_1>; 83 pinctrl-0 = <&pinctrl_ecspi2>;
78 fsl,spi-num-chipselects = <2>; 84 fsl,spi-num-chipselects = <2>;
79 cs-gpios = <&gpio3 28 1>, <&gpio3 27 1>; 85 cs-gpios = <&gpio3 28 GPIO_ACTIVE_LOW>,
86 <&gpio3 27 GPIO_ACTIVE_LOW>;
80 status = "okay"; 87 status = "okay";
81}; 88};
82 89
83&esdhc1 { 90&esdhc1 {
84 pinctrl-names = "default"; 91 pinctrl-names = "default";
85 pinctrl-0 = <&pinctrl_esdhc1_1>; 92 pinctrl-0 = <&pinctrl_esdhc1>;
86 cd-gpios = <&gpio2 29 0>; 93 cd-gpios = <&gpio2 29 GPIO_ACTIVE_HIGH>;
87 bus-width = <4>; 94 bus-width = <4>;
88 status = "okay"; 95 status = "okay";
89}; 96};
90 97
91&esdhc2 { 98&esdhc2 {
92 pinctrl-names = "default"; 99 pinctrl-names = "default";
93 pinctrl-0 = <&pinctrl_esdhc2_1>; 100 pinctrl-0 = <&pinctrl_esdhc2>;
94 bus-width = <4>; 101 bus-width = <4>;
95 non-removable; 102 non-removable;
96 status = "okay"; 103 status = "okay";
@@ -98,7 +105,7 @@
98 105
99&i2c2 { 106&i2c2 {
100 pinctrl-names = "default"; 107 pinctrl-names = "default";
101 pinctrl-0 = <&pinctrl_i2c2_2>; 108 pinctrl-0 = <&pinctrl_i2c2>;
102 status = "okay"; 109 status = "okay";
103}; 110};
104 111
@@ -106,7 +113,7 @@
106 pinctrl-names = "default"; 113 pinctrl-names = "default";
107 pinctrl-0 = <&pinctrl_hog>; 114 pinctrl-0 = <&pinctrl_hog>;
108 115
109 hog { 116 imx51-apf51dev {
110 pinctrl_hog: hoggrp { 117 pinctrl_hog: hoggrp {
111 fsl,pins = < 118 fsl,pins = <
112 MX51_PAD_EIM_EB2__GPIO2_22 0x0C5 119 MX51_PAD_EIM_EB2__GPIO2_22 0x0C5
@@ -120,5 +127,85 @@
120 MX51_PAD_GPIO1_3__GPIO1_3 0x0C5 127 MX51_PAD_GPIO1_3__GPIO1_3 0x0C5
121 >; 128 >;
122 }; 129 };
130
131 pinctrl_ecspi1: ecspi1grp {
132 fsl,pins = <
133 MX51_PAD_CSPI1_MISO__ECSPI1_MISO 0x185
134 MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI 0x185
135 MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK 0x185
136 >;
137 };
138
139 pinctrl_ecspi2: ecspi2grp {
140 fsl,pins = <
141 MX51_PAD_NANDF_RB3__ECSPI2_MISO 0x185
142 MX51_PAD_NANDF_D15__ECSPI2_MOSI 0x185
143 MX51_PAD_NANDF_RB2__ECSPI2_SCLK 0x185
144 >;
145 };
146
147 pinctrl_esdhc1: esdhc1grp {
148 fsl,pins = <
149 MX51_PAD_SD1_CMD__SD1_CMD 0x400020d5
150 MX51_PAD_SD1_CLK__SD1_CLK 0x20d5
151 MX51_PAD_SD1_DATA0__SD1_DATA0 0x20d5
152 MX51_PAD_SD1_DATA1__SD1_DATA1 0x20d5
153 MX51_PAD_SD1_DATA2__SD1_DATA2 0x20d5
154 MX51_PAD_SD1_DATA3__SD1_DATA3 0x20d5
155 >;
156 };
157
158 pinctrl_esdhc2: esdhc2grp {
159 fsl,pins = <
160 MX51_PAD_SD2_CMD__SD2_CMD 0x400020d5
161 MX51_PAD_SD2_CLK__SD2_CLK 0x20d5
162 MX51_PAD_SD2_DATA0__SD2_DATA0 0x20d5
163 MX51_PAD_SD2_DATA1__SD2_DATA1 0x20d5
164 MX51_PAD_SD2_DATA2__SD2_DATA2 0x20d5
165 MX51_PAD_SD2_DATA3__SD2_DATA3 0x20d5
166 >;
167 };
168
169 pinctrl_i2c2: i2c2grp {
170 fsl,pins = <
171 MX51_PAD_EIM_D27__I2C2_SCL 0x400001ed
172 MX51_PAD_EIM_D24__I2C2_SDA 0x400001ed
173 >;
174 };
175
176 pinctrl_ipu_disp1: ipudisp1grp {
177 fsl,pins = <
178 MX51_PAD_DISP1_DAT0__DISP1_DAT0 0x5
179 MX51_PAD_DISP1_DAT1__DISP1_DAT1 0x5
180 MX51_PAD_DISP1_DAT2__DISP1_DAT2 0x5
181 MX51_PAD_DISP1_DAT3__DISP1_DAT3 0x5
182 MX51_PAD_DISP1_DAT4__DISP1_DAT4 0x5
183 MX51_PAD_DISP1_DAT5__DISP1_DAT5 0x5
184 MX51_PAD_DISP1_DAT6__DISP1_DAT6 0x5
185 MX51_PAD_DISP1_DAT7__DISP1_DAT7 0x5
186 MX51_PAD_DISP1_DAT8__DISP1_DAT8 0x5
187 MX51_PAD_DISP1_DAT9__DISP1_DAT9 0x5
188 MX51_PAD_DISP1_DAT10__DISP1_DAT10 0x5
189 MX51_PAD_DISP1_DAT11__DISP1_DAT11 0x5
190 MX51_PAD_DISP1_DAT12__DISP1_DAT12 0x5
191 MX51_PAD_DISP1_DAT13__DISP1_DAT13 0x5
192 MX51_PAD_DISP1_DAT14__DISP1_DAT14 0x5
193 MX51_PAD_DISP1_DAT15__DISP1_DAT15 0x5
194 MX51_PAD_DISP1_DAT16__DISP1_DAT16 0x5
195 MX51_PAD_DISP1_DAT17__DISP1_DAT17 0x5
196 MX51_PAD_DISP1_DAT18__DISP1_DAT18 0x5
197 MX51_PAD_DISP1_DAT19__DISP1_DAT19 0x5
198 MX51_PAD_DISP1_DAT20__DISP1_DAT20 0x5
199 MX51_PAD_DISP1_DAT21__DISP1_DAT21 0x5
200 MX51_PAD_DISP1_DAT22__DISP1_DAT22 0x5
201 MX51_PAD_DISP1_DAT23__DISP1_DAT23 0x5
202 MX51_PAD_DI1_PIN2__DI1_PIN2 0x5
203 MX51_PAD_DI1_PIN3__DI1_PIN3 0x5
204 >;
205 };
123 }; 206 };
124}; 207};
208
209&ipu_di0_disp0 {
210 remote-endpoint = <&display_in>;
211};
diff --git a/arch/arm/boot/dts/imx51-babbage.dts b/arch/arm/boot/dts/imx51-babbage.dts
index be1407cf5abd..9e9deb244b76 100644
--- a/arch/arm/boot/dts/imx51-babbage.dts
+++ b/arch/arm/boot/dts/imx51-babbage.dts
@@ -21,12 +21,11 @@
21 reg = <0x90000000 0x20000000>; 21 reg = <0x90000000 0x20000000>;
22 }; 22 };
23 23
24 display@di0 { 24 display0: display@di0 {
25 compatible = "fsl,imx-parallel-display"; 25 compatible = "fsl,imx-parallel-display";
26 crtcs = <&ipu 0>;
27 interface-pix-fmt = "rgb24"; 26 interface-pix-fmt = "rgb24";
28 pinctrl-names = "default"; 27 pinctrl-names = "default";
29 pinctrl-0 = <&pinctrl_ipu_disp1_1>; 28 pinctrl-0 = <&pinctrl_ipu_disp1>;
30 display-timings { 29 display-timings {
31 native-mode = <&timing0>; 30 native-mode = <&timing0>;
32 timing0: dvi { 31 timing0: dvi {
@@ -41,14 +40,19 @@
41 vsync-len = <10>; 40 vsync-len = <10>;
42 }; 41 };
43 }; 42 };
43
44 port {
45 display0_in: endpoint {
46 remote-endpoint = <&ipu_di0_disp0>;
47 };
48 };
44 }; 49 };
45 50
46 display@di1 { 51 display1: display@di1 {
47 compatible = "fsl,imx-parallel-display"; 52 compatible = "fsl,imx-parallel-display";
48 crtcs = <&ipu 1>;
49 interface-pix-fmt = "rgb565"; 53 interface-pix-fmt = "rgb565";
50 pinctrl-names = "default"; 54 pinctrl-names = "default";
51 pinctrl-0 = <&pinctrl_ipu_disp2_1>; 55 pinctrl-0 = <&pinctrl_ipu_disp2>;
52 status = "disabled"; 56 status = "disabled";
53 display-timings { 57 display-timings {
54 native-mode = <&timing1>; 58 native-mode = <&timing1>;
@@ -68,6 +72,12 @@
68 pixelclk-active = <0>; 72 pixelclk-active = <0>;
69 }; 73 };
70 }; 74 };
75
76 port {
77 display1_in: endpoint {
78 remote-endpoint = <&ipu_di1_disp1>;
79 };
80 };
71 }; 81 };
72 82
73 gpio-keys { 83 gpio-keys {
@@ -75,12 +85,23 @@
75 85
76 power { 86 power {
77 label = "Power Button"; 87 label = "Power Button";
78 gpios = <&gpio2 21 0>; 88 gpios = <&gpio2 21 GPIO_ACTIVE_HIGH>;
79 linux,code = <116>; /* KEY_POWER */ 89 linux,code = <116>; /* KEY_POWER */
80 gpio-key,wakeup; 90 gpio-key,wakeup;
81 }; 91 };
82 }; 92 };
83 93
94 leds {
95 compatible = "gpio-leds";
96 pinctrl-names = "default";
97 pinctrl-0 = <&pinctrl_gpio_leds>;
98
99 led-diagnostic {
100 label = "diagnostic";
101 gpios = <&gpio2 6 GPIO_ACTIVE_HIGH>;
102 };
103 };
104
84 sound { 105 sound {
85 compatible = "fsl,imx51-babbage-sgtl5000", 106 compatible = "fsl,imx51-babbage-sgtl5000",
86 "fsl,imx-audio-sgtl5000"; 107 "fsl,imx-audio-sgtl5000";
@@ -105,14 +126,14 @@
105 reg=<0>; 126 reg=<0>;
106 #clock-cells = <0>; 127 #clock-cells = <0>;
107 clock-frequency = <26000000>; 128 clock-frequency = <26000000>;
108 gpios = <&gpio4 26 1>; 129 gpios = <&gpio4 26 GPIO_ACTIVE_LOW>;
109 }; 130 };
110 }; 131 };
111}; 132};
112 133
113&esdhc1 { 134&esdhc1 {
114 pinctrl-names = "default"; 135 pinctrl-names = "default";
115 pinctrl-0 = <&pinctrl_esdhc1_1>; 136 pinctrl-0 = <&pinctrl_esdhc1>;
116 fsl,cd-controller; 137 fsl,cd-controller;
117 fsl,wp-controller; 138 fsl,wp-controller;
118 status = "okay"; 139 status = "okay";
@@ -120,24 +141,25 @@
120 141
121&esdhc2 { 142&esdhc2 {
122 pinctrl-names = "default"; 143 pinctrl-names = "default";
123 pinctrl-0 = <&pinctrl_esdhc2_1>; 144 pinctrl-0 = <&pinctrl_esdhc2>;
124 cd-gpios = <&gpio1 6 0>; 145 cd-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
125 wp-gpios = <&gpio1 5 0>; 146 wp-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
126 status = "okay"; 147 status = "okay";
127}; 148};
128 149
129&uart3 { 150&uart3 {
130 pinctrl-names = "default"; 151 pinctrl-names = "default";
131 pinctrl-0 = <&pinctrl_uart3_1 &pinctrl_uart3_rtscts_1>; 152 pinctrl-0 = <&pinctrl_uart3>;
132 fsl,uart-has-rtscts; 153 fsl,uart-has-rtscts;
133 status = "okay"; 154 status = "okay";
134}; 155};
135 156
136&ecspi1 { 157&ecspi1 {
137 pinctrl-names = "default"; 158 pinctrl-names = "default";
138 pinctrl-0 = <&pinctrl_ecspi1_1>; 159 pinctrl-0 = <&pinctrl_ecspi1>;
139 fsl,spi-num-chipselects = <2>; 160 fsl,spi-num-chipselects = <2>;
140 cs-gpios = <&gpio4 24 0>, <&gpio4 25 0>; 161 cs-gpios = <&gpio4 24 GPIO_ACTIVE_HIGH>,
162 <&gpio4 25 GPIO_ACTIVE_LOW>;
141 status = "okay"; 163 status = "okay";
142 164
143 pmic: mc13892@0 { 165 pmic: mc13892@0 {
@@ -148,7 +170,7 @@
148 spi-cs-high; 170 spi-cs-high;
149 reg = <0>; 171 reg = <0>;
150 interrupt-parent = <&gpio1>; 172 interrupt-parent = <&gpio1>;
151 interrupts = <8 0x4>; 173 interrupts = <8 IRQ_TYPE_LEVEL_HIGH>;
152 174
153 regulators { 175 regulators {
154 sw1_reg: sw1 { 176 sw1_reg: sw1 {
@@ -258,6 +280,14 @@
258 }; 280 };
259}; 281};
260 282
283&ipu_di0_disp0 {
284 remote-endpoint = <&display0_in>;
285};
286
287&ipu_di1_disp1 {
288 remote-endpoint = <&display1_in>;
289};
290
261&ssi2 { 291&ssi2 {
262 fsl,mode = "i2s-slave"; 292 fsl,mode = "i2s-slave";
263 status = "okay"; 293 status = "okay";
@@ -267,7 +297,7 @@
267 pinctrl-names = "default"; 297 pinctrl-names = "default";
268 pinctrl-0 = <&pinctrl_hog>; 298 pinctrl-0 = <&pinctrl_hog>;
269 299
270 hog { 300 imx51-babbage {
271 pinctrl_hog: hoggrp { 301 pinctrl_hog: hoggrp {
272 fsl,pins = < 302 fsl,pins = <
273 MX51_PAD_GPIO1_0__SD1_CD 0x20d5 303 MX51_PAD_GPIO1_0__SD1_CD 0x20d5
@@ -280,25 +310,194 @@
280 MX51_PAD_CSPI1_RDY__GPIO4_26 0x80000000 310 MX51_PAD_CSPI1_RDY__GPIO4_26 0x80000000
281 >; 311 >;
282 }; 312 };
313
314 pinctrl_audmux: audmuxgrp {
315 fsl,pins = <
316 MX51_PAD_AUD3_BB_TXD__AUD3_TXD 0x80000000
317 MX51_PAD_AUD3_BB_RXD__AUD3_RXD 0x80000000
318 MX51_PAD_AUD3_BB_CK__AUD3_TXC 0x80000000
319 MX51_PAD_AUD3_BB_FS__AUD3_TXFS 0x80000000
320 >;
321 };
322
323 pinctrl_ecspi1: ecspi1grp {
324 fsl,pins = <
325 MX51_PAD_CSPI1_MISO__ECSPI1_MISO 0x185
326 MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI 0x185
327 MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK 0x185
328 >;
329 };
330
331 pinctrl_esdhc1: esdhc1grp {
332 fsl,pins = <
333 MX51_PAD_SD1_CMD__SD1_CMD 0x400020d5
334 MX51_PAD_SD1_CLK__SD1_CLK 0x20d5
335 MX51_PAD_SD1_DATA0__SD1_DATA0 0x20d5
336 MX51_PAD_SD1_DATA1__SD1_DATA1 0x20d5
337 MX51_PAD_SD1_DATA2__SD1_DATA2 0x20d5
338 MX51_PAD_SD1_DATA3__SD1_DATA3 0x20d5
339 >;
340 };
341
342 pinctrl_esdhc2: esdhc2grp {
343 fsl,pins = <
344 MX51_PAD_SD2_CMD__SD2_CMD 0x400020d5
345 MX51_PAD_SD2_CLK__SD2_CLK 0x20d5
346 MX51_PAD_SD2_DATA0__SD2_DATA0 0x20d5
347 MX51_PAD_SD2_DATA1__SD2_DATA1 0x20d5
348 MX51_PAD_SD2_DATA2__SD2_DATA2 0x20d5
349 MX51_PAD_SD2_DATA3__SD2_DATA3 0x20d5
350 >;
351 };
352
353 pinctrl_fec: fecgrp {
354 fsl,pins = <
355 MX51_PAD_EIM_EB2__FEC_MDIO 0x80000000
356 MX51_PAD_EIM_EB3__FEC_RDATA1 0x80000000
357 MX51_PAD_EIM_CS2__FEC_RDATA2 0x80000000
358 MX51_PAD_EIM_CS3__FEC_RDATA3 0x80000000
359 MX51_PAD_EIM_CS4__FEC_RX_ER 0x80000000
360 MX51_PAD_EIM_CS5__FEC_CRS 0x80000000
361 MX51_PAD_NANDF_RB2__FEC_COL 0x80000000
362 MX51_PAD_NANDF_RB3__FEC_RX_CLK 0x80000000
363 MX51_PAD_NANDF_D9__FEC_RDATA0 0x80000000
364 MX51_PAD_NANDF_D8__FEC_TDATA0 0x80000000
365 MX51_PAD_NANDF_CS2__FEC_TX_ER 0x80000000
366 MX51_PAD_NANDF_CS3__FEC_MDC 0x80000000
367 MX51_PAD_NANDF_CS4__FEC_TDATA1 0x80000000
368 MX51_PAD_NANDF_CS5__FEC_TDATA2 0x80000000
369 MX51_PAD_NANDF_CS6__FEC_TDATA3 0x80000000
370 MX51_PAD_NANDF_CS7__FEC_TX_EN 0x80000000
371 MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK 0x80000000
372 MX51_PAD_EIM_A20__GPIO2_14 0x85 /* Reset */
373 >;
374 };
375
376 pinctrl_gpio_leds: gpioledsgrp {
377 fsl,pins = <
378 MX51_PAD_EIM_D22__GPIO2_6 0x80000000
379 >;
380 };
381
382 pinctrl_i2c2: i2c2grp {
383 fsl,pins = <
384 MX51_PAD_KEY_COL4__I2C2_SCL 0x400001ed
385 MX51_PAD_KEY_COL5__I2C2_SDA 0x400001ed
386 >;
387 };
388
389 pinctrl_ipu_disp1: ipudisp1grp {
390 fsl,pins = <
391 MX51_PAD_DISP1_DAT0__DISP1_DAT0 0x5
392 MX51_PAD_DISP1_DAT1__DISP1_DAT1 0x5
393 MX51_PAD_DISP1_DAT2__DISP1_DAT2 0x5
394 MX51_PAD_DISP1_DAT3__DISP1_DAT3 0x5
395 MX51_PAD_DISP1_DAT4__DISP1_DAT4 0x5
396 MX51_PAD_DISP1_DAT5__DISP1_DAT5 0x5
397 MX51_PAD_DISP1_DAT6__DISP1_DAT6 0x5
398 MX51_PAD_DISP1_DAT7__DISP1_DAT7 0x5
399 MX51_PAD_DISP1_DAT8__DISP1_DAT8 0x5
400 MX51_PAD_DISP1_DAT9__DISP1_DAT9 0x5
401 MX51_PAD_DISP1_DAT10__DISP1_DAT10 0x5
402 MX51_PAD_DISP1_DAT11__DISP1_DAT11 0x5
403 MX51_PAD_DISP1_DAT12__DISP1_DAT12 0x5
404 MX51_PAD_DISP1_DAT13__DISP1_DAT13 0x5
405 MX51_PAD_DISP1_DAT14__DISP1_DAT14 0x5
406 MX51_PAD_DISP1_DAT15__DISP1_DAT15 0x5
407 MX51_PAD_DISP1_DAT16__DISP1_DAT16 0x5
408 MX51_PAD_DISP1_DAT17__DISP1_DAT17 0x5
409 MX51_PAD_DISP1_DAT18__DISP1_DAT18 0x5
410 MX51_PAD_DISP1_DAT19__DISP1_DAT19 0x5
411 MX51_PAD_DISP1_DAT20__DISP1_DAT20 0x5
412 MX51_PAD_DISP1_DAT21__DISP1_DAT21 0x5
413 MX51_PAD_DISP1_DAT22__DISP1_DAT22 0x5
414 MX51_PAD_DISP1_DAT23__DISP1_DAT23 0x5
415 MX51_PAD_DI1_PIN2__DI1_PIN2 0x5
416 MX51_PAD_DI1_PIN3__DI1_PIN3 0x5
417 >;
418 };
419
420 pinctrl_ipu_disp2: ipudisp2grp {
421 fsl,pins = <
422 MX51_PAD_DISP2_DAT0__DISP2_DAT0 0x5
423 MX51_PAD_DISP2_DAT1__DISP2_DAT1 0x5
424 MX51_PAD_DISP2_DAT2__DISP2_DAT2 0x5
425 MX51_PAD_DISP2_DAT3__DISP2_DAT3 0x5
426 MX51_PAD_DISP2_DAT4__DISP2_DAT4 0x5
427 MX51_PAD_DISP2_DAT5__DISP2_DAT5 0x5
428 MX51_PAD_DISP2_DAT6__DISP2_DAT6 0x5
429 MX51_PAD_DISP2_DAT7__DISP2_DAT7 0x5
430 MX51_PAD_DISP2_DAT8__DISP2_DAT8 0x5
431 MX51_PAD_DISP2_DAT9__DISP2_DAT9 0x5
432 MX51_PAD_DISP2_DAT10__DISP2_DAT10 0x5
433 MX51_PAD_DISP2_DAT11__DISP2_DAT11 0x5
434 MX51_PAD_DISP2_DAT12__DISP2_DAT12 0x5
435 MX51_PAD_DISP2_DAT13__DISP2_DAT13 0x5
436 MX51_PAD_DISP2_DAT14__DISP2_DAT14 0x5
437 MX51_PAD_DISP2_DAT15__DISP2_DAT15 0x5
438 MX51_PAD_DI2_PIN2__DI2_PIN2 0x5
439 MX51_PAD_DI2_PIN3__DI2_PIN3 0x5
440 MX51_PAD_DI2_DISP_CLK__DI2_DISP_CLK 0x5
441 MX51_PAD_DI_GP4__DI2_PIN15 0x5
442 >;
443 };
444
445 pinctrl_kpp: kppgrp {
446 fsl,pins = <
447 MX51_PAD_KEY_ROW0__KEY_ROW0 0xe0
448 MX51_PAD_KEY_ROW1__KEY_ROW1 0xe0
449 MX51_PAD_KEY_ROW2__KEY_ROW2 0xe0
450 MX51_PAD_KEY_ROW3__KEY_ROW3 0xe0
451 MX51_PAD_KEY_COL0__KEY_COL0 0xe8
452 MX51_PAD_KEY_COL1__KEY_COL1 0xe8
453 MX51_PAD_KEY_COL2__KEY_COL2 0xe8
454 MX51_PAD_KEY_COL3__KEY_COL3 0xe8
455 >;
456 };
457
458 pinctrl_uart1: uart1grp {
459 fsl,pins = <
460 MX51_PAD_UART1_RXD__UART1_RXD 0x1c5
461 MX51_PAD_UART1_TXD__UART1_TXD 0x1c5
462 MX51_PAD_UART1_RTS__UART1_RTS 0x1c5
463 MX51_PAD_UART1_CTS__UART1_CTS 0x1c5
464 >;
465 };
466
467 pinctrl_uart2: uart2grp {
468 fsl,pins = <
469 MX51_PAD_UART2_RXD__UART2_RXD 0x1c5
470 MX51_PAD_UART2_TXD__UART2_TXD 0x1c5
471 >;
472 };
473
474 pinctrl_uart3: uart3grp {
475 fsl,pins = <
476 MX51_PAD_EIM_D25__UART3_RXD 0x1c5
477 MX51_PAD_EIM_D26__UART3_TXD 0x1c5
478 MX51_PAD_EIM_D27__UART3_RTS 0x1c5
479 MX51_PAD_EIM_D24__UART3_CTS 0x1c5
480 >;
481 };
283 }; 482 };
284}; 483};
285 484
286&uart1 { 485&uart1 {
287 pinctrl-names = "default"; 486 pinctrl-names = "default";
288 pinctrl-0 = <&pinctrl_uart1_1 &pinctrl_uart1_rtscts_1>; 487 pinctrl-0 = <&pinctrl_uart1>;
289 fsl,uart-has-rtscts; 488 fsl,uart-has-rtscts;
290 status = "okay"; 489 status = "okay";
291}; 490};
292 491
293&uart2 { 492&uart2 {
294 pinctrl-names = "default"; 493 pinctrl-names = "default";
295 pinctrl-0 = <&pinctrl_uart2_1>; 494 pinctrl-0 = <&pinctrl_uart2>;
296 status = "okay"; 495 status = "okay";
297}; 496};
298 497
299&i2c2 { 498&i2c2 {
300 pinctrl-names = "default"; 499 pinctrl-names = "default";
301 pinctrl-0 = <&pinctrl_i2c2_1>; 500 pinctrl-0 = <&pinctrl_i2c2>;
302 status = "okay"; 501 status = "okay";
303 502
304 sgtl5000: codec@0a { 503 sgtl5000: codec@0a {
@@ -312,35 +511,39 @@
312 511
313&audmux { 512&audmux {
314 pinctrl-names = "default"; 513 pinctrl-names = "default";
315 pinctrl-0 = <&pinctrl_audmux_1>; 514 pinctrl-0 = <&pinctrl_audmux>;
316 status = "okay"; 515 status = "okay";
317}; 516};
318 517
319&fec { 518&fec {
320 pinctrl-names = "default"; 519 pinctrl-names = "default";
321 pinctrl-0 = <&pinctrl_fec_1>; 520 pinctrl-0 = <&pinctrl_fec>;
322 phy-mode = "mii"; 521 phy-mode = "mii";
522 phy-reset-gpios = <&gpio2 14 GPIO_ACTIVE_LOW>;
523 phy-reset-duration = <1>;
323 status = "okay"; 524 status = "okay";
324}; 525};
325 526
326&kpp { 527&kpp {
327 pinctrl-names = "default"; 528 pinctrl-names = "default";
328 pinctrl-0 = <&pinctrl_kpp_1>; 529 pinctrl-0 = <&pinctrl_kpp>;
329 linux,keymap = <0x00000067 /* KEY_UP */ 530 linux,keymap = <
330 0x0001006c /* KEY_DOWN */ 531 MATRIX_KEY(0, 0, KEY_UP)
331 0x00020072 /* KEY_VOLUMEDOWN */ 532 MATRIX_KEY(0, 1, KEY_DOWN)
332 0x00030066 /* KEY_HOME */ 533 MATRIX_KEY(0, 2, KEY_VOLUMEDOWN)
333 0x0100006a /* KEY_RIGHT */ 534 MATRIX_KEY(0, 3, KEY_HOME)
334 0x01010069 /* KEY_LEFT */ 535 MATRIX_KEY(1, 0, KEY_RIGHT)
335 0x0102001c /* KEY_ENTER */ 536 MATRIX_KEY(1, 1, KEY_LEFT)
336 0x01030073 /* KEY_VOLUMEUP */ 537 MATRIX_KEY(1, 2, KEY_ENTER)
337 0x02000040 /* KEY_F6 */ 538 MATRIX_KEY(1, 3, KEY_VOLUMEUP)
338 0x02010042 /* KEY_F8 */ 539 MATRIX_KEY(2, 0, KEY_F6)
339 0x02020043 /* KEY_F9 */ 540 MATRIX_KEY(2, 1, KEY_F8)
340 0x02030044 /* KEY_F10 */ 541 MATRIX_KEY(2, 2, KEY_F9)
341 0x0300003b /* KEY_F1 */ 542 MATRIX_KEY(2, 3, KEY_F10)
342 0x0301003c /* KEY_F2 */ 543 MATRIX_KEY(3, 0, KEY_F1)
343 0x0302003d /* KEY_F3 */ 544 MATRIX_KEY(3, 1, KEY_F2)
344 0x03030074>; /* KEY_POWER */ 545 MATRIX_KEY(3, 2, KEY_F3)
546 MATRIX_KEY(3, 3, KEY_POWER)
547 >;
345 status = "okay"; 548 status = "okay";
346}; 549};
diff --git a/arch/arm/boot/dts/imx51-eukrea-cpuimx51.dtsi b/arch/arm/boot/dts/imx51-eukrea-cpuimx51.dtsi
new file mode 100644
index 000000000000..9b3acf6e4282
--- /dev/null
+++ b/arch/arm/boot/dts/imx51-eukrea-cpuimx51.dtsi
@@ -0,0 +1,93 @@
1/*
2 * Copyright 2013 Eukréa Electromatique <denis@eukrea.com>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
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 Street, Fifth Floor, Boston,
16 * MA 02110-1301, USA.
17 */
18
19#include "imx51.dtsi"
20
21/ {
22 model = "Eukrea CPUIMX51";
23 compatible = "eukrea,cpuimx51", "fsl,imx51";
24
25 memory {
26 reg = <0x90000000 0x10000000>; /* 256M */
27 };
28};
29
30&fec {
31 pinctrl-names = "default";
32 pinctrl-0 = <&pinctrl_fec>;
33 status = "okay";
34};
35
36&i2c1 {
37 pinctrl-names = "default";
38 pinctrl-0 = <&pinctrl_i2c1>;
39 status = "okay";
40
41 pcf8563@51 {
42 compatible = "nxp,pcf8563";
43 reg = <0x51>;
44 };
45};
46
47&iomuxc {
48 imx51-eukrea {
49 pinctrl_tsc2007_1: tsc2007grp-1 {
50 fsl,pins = <
51 MX51_PAD_GPIO_NAND__GPIO_NAND 0x1f5
52 MX51_PAD_NANDF_D8__GPIO4_0 0x1f5
53 >;
54 };
55
56 pinctrl_fec: fecgrp {
57 fsl,pins = <
58 MX51_PAD_DI_GP3__FEC_TX_ER 0x80000000
59 MX51_PAD_DI2_PIN4__FEC_CRS 0x80000000
60 MX51_PAD_DI2_PIN2__FEC_MDC 0x80000000
61 MX51_PAD_DI2_PIN3__FEC_MDIO 0x80000000
62 MX51_PAD_DI2_DISP_CLK__FEC_RDATA1 0x80000000
63 MX51_PAD_DI_GP4__FEC_RDATA2 0x80000000
64 MX51_PAD_DISP2_DAT0__FEC_RDATA3 0x80000000
65 MX51_PAD_DISP2_DAT1__FEC_RX_ER 0x80000000
66 MX51_PAD_DISP2_DAT6__FEC_TDATA1 0x80000000
67 MX51_PAD_DISP2_DAT7__FEC_TDATA2 0x80000000
68 MX51_PAD_DISP2_DAT8__FEC_TDATA3 0x80000000
69 MX51_PAD_DISP2_DAT9__FEC_TX_EN 0x80000000
70 MX51_PAD_DISP2_DAT10__FEC_COL 0x80000000
71 MX51_PAD_DISP2_DAT11__FEC_RX_CLK 0x80000000
72 MX51_PAD_DISP2_DAT12__FEC_RX_DV 0x80000000
73 MX51_PAD_DISP2_DAT13__FEC_TX_CLK 0x80000000
74 MX51_PAD_DISP2_DAT14__FEC_RDATA0 0x80000000
75 MX51_PAD_DISP2_DAT15__FEC_TDATA0 0x80000000
76 >;
77 };
78
79 pinctrl_i2c1: i2c1grp {
80 fsl,pins = <
81 MX51_PAD_SD2_CMD__I2C1_SCL 0x400001ed
82 MX51_PAD_SD2_CLK__I2C1_SDA 0x400001ed
83 >;
84 };
85 };
86};
87
88&nfc {
89 nand-bus-width = <8>;
90 nand-ecc-mode = "hw";
91 nand-on-flash-bbt;
92 status = "okay";
93};
diff --git a/arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts b/arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts
new file mode 100644
index 000000000000..5cec4f322096
--- /dev/null
+++ b/arch/arm/boot/dts/imx51-eukrea-mbimxsd51-baseboard.dts
@@ -0,0 +1,175 @@
1/*
2 * Copyright 2013 Eukréa Electromatique <denis@eukrea.com>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
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 Street, Fifth Floor, Boston,
16 * MA 02110-1301, USA.
17 */
18
19/dts-v1/;
20#include "imx51-eukrea-cpuimx51.dtsi"
21#include <dt-bindings/gpio/gpio.h>
22
23/ {
24 model = "Eukrea CPUIMX51";
25 compatible = "eukrea,mbimxsd51","eukrea,cpuimx51", "fsl,imx51";
26
27 gpio_keys {
28 compatible = "gpio-keys";
29 pinctrl-names = "default";
30 pinctrl-0 = <&pinctrl_gpiokeys_1>;
31
32 button-1 {
33 label = "BP1";
34 gpios = <&gpio3 31 GPIO_ACTIVE_LOW>;
35 linux,code = <256>;
36 gpio-key,wakeup;
37 linux,input-type = <1>;
38 };
39 };
40
41 leds {
42 compatible = "gpio-leds";
43 pinctrl-names = "default";
44 pinctrl-0 = <&pinctrl_gpioled>;
45
46 led1 {
47 label = "led1";
48 gpios = <&gpio3 30 GPIO_ACTIVE_LOW>;
49 linux,default-trigger = "heartbeat";
50 };
51 };
52
53 sound {
54 compatible = "eukrea,asoc-tlv320";
55 eukrea,model = "imx51-eukrea-tlv320aic23";
56 ssi-controller = <&ssi2>;
57 fsl,mux-int-port = <2>;
58 fsl,mux-ext-port = <3>;
59 };
60};
61
62&audmux {
63 pinctrl-names = "default";
64 pinctrl-0 = <&pinctrl_audmux>;
65 status = "okay";
66};
67
68&esdhc1 {
69 pinctrl-names = "default";
70 pinctrl-0 = <&pinctrl_esdhc1 &pinctrl_esdhc1_cd>;
71 fsl,cd-controller;
72 status = "okay";
73};
74
75&i2c1 {
76 tlv320aic23: codec@1a {
77 compatible = "ti,tlv320aic23";
78 reg = <0x1a>;
79 };
80};
81
82&iomuxc {
83 imx51-eukrea {
84 pinctrl_audmux: audmuxgrp {
85 fsl,pins = <
86 MX51_PAD_AUD3_BB_TXD__AUD3_TXD 0x80000000
87 MX51_PAD_AUD3_BB_RXD__AUD3_RXD 0x80000000
88 MX51_PAD_AUD3_BB_CK__AUD3_TXC 0x80000000
89 MX51_PAD_AUD3_BB_FS__AUD3_TXFS 0x80000000
90 >;
91 };
92
93 pinctrl_esdhc1: esdhc1grp {
94 fsl,pins = <
95 MX51_PAD_SD1_CMD__SD1_CMD 0x400020d5
96 MX51_PAD_SD1_CLK__SD1_CLK 0x20d5
97 MX51_PAD_SD1_DATA0__SD1_DATA0 0x20d5
98 MX51_PAD_SD1_DATA1__SD1_DATA1 0x20d5
99 MX51_PAD_SD1_DATA2__SD1_DATA2 0x20d5
100 MX51_PAD_SD1_DATA3__SD1_DATA3 0x20d5
101 >;
102 };
103
104 pinctrl_uart1: uart1grp {
105 fsl,pins = <
106 MX51_PAD_UART1_RXD__UART1_RXD 0x1c5
107 MX51_PAD_UART1_TXD__UART1_TXD 0x1c5
108 >;
109 };
110
111 pinctrl_uart3: uart3grp {
112 fsl,pins = <
113 MX51_PAD_UART3_RXD__UART3_RXD 0x1c5
114 MX51_PAD_UART3_TXD__UART3_TXD 0x1c5
115 >;
116 };
117
118 pinctrl_uart3_rtscts: uart3rtsctsgrp {
119 fsl,pins = <
120 MX51_PAD_KEY_COL4__UART3_RTS 0x1c5
121 MX51_PAD_KEY_COL5__UART3_CTS 0x1c5
122 >;
123 };
124
125 pinctrl_backlight_1: backlightgrp-1 {
126 fsl,pins = <
127 MX51_PAD_DI1_D1_CS__GPIO3_4 0x1f5
128 >;
129 };
130
131 pinctrl_esdhc1_cd: esdhc1_cd {
132 fsl,pins = <
133 MX51_PAD_GPIO1_0__SD1_CD 0x20d5
134 >;
135 };
136
137 pinctrl_gpiokeys_1: gpiokeysgrp-1 {
138 fsl,pins = <
139 MX51_PAD_NANDF_D9__GPIO3_31 0x1f5
140 >;
141 };
142
143 pinctrl_gpioled: gpioledgrp-1 {
144 fsl,pins = <
145 MX51_PAD_NANDF_D10__GPIO3_30 0x80000000
146 >;
147 };
148
149 pinctrl_reg_lcd_3v3: reg_lcd_3v3 {
150 fsl,pins = <
151 MX51_PAD_CSI1_D9__GPIO3_13 0x1f5
152 >;
153 };
154 };
155};
156
157&ssi2 {
158 codec-handle = <&tlv320aic23>;
159 fsl,mode = "i2s-slave";
160 status = "okay";
161};
162
163&uart1 {
164 pinctrl-names = "default";
165 pinctrl-0 = <&pinctrl_uart1>;
166 fsl,uart-has-rtscts;
167 status = "okay";
168};
169
170&uart3 {
171 pinctrl-names = "default";
172 pinctrl-0 = <&pinctrl_uart3 &pinctrl_uart3_rtscts>;
173 fsl,uart-has-rtscts;
174 status = "okay";
175};
diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
index 4bcdd3ad15e5..5f8216d08f6b 100644
--- a/arch/arm/boot/dts/imx51.dtsi
+++ b/arch/arm/boot/dts/imx51.dtsi
@@ -12,6 +12,10 @@
12 12
13#include "skeleton.dtsi" 13#include "skeleton.dtsi"
14#include "imx51-pinfunc.h" 14#include "imx51-pinfunc.h"
15#include <dt-bindings/clock/imx5-clock.h>
16#include <dt-bindings/gpio/gpio.h>
17#include <dt-bindings/input/input.h>
18#include <dt-bindings/interrupt-controller/irq.h>
15 19
16/ { 20/ {
17 aliases { 21 aliases {
@@ -21,6 +25,10 @@
21 gpio3 = &gpio4; 25 gpio3 = &gpio4;
22 i2c0 = &i2c1; 26 i2c0 = &i2c1;
23 i2c1 = &i2c2; 27 i2c1 = &i2c2;
28 mmc0 = &esdhc1;
29 mmc1 = &esdhc2;
30 mmc2 = &esdhc3;
31 mmc3 = &esdhc4;
24 serial0 = &uart1; 32 serial0 = &uart1;
25 serial1 = &uart2; 33 serial1 = &uart2;
26 serial2 = &uart3; 34 serial2 = &uart3;
@@ -64,21 +72,40 @@
64 cpus { 72 cpus {
65 #address-cells = <1>; 73 #address-cells = <1>;
66 #size-cells = <0>; 74 #size-cells = <0>;
67 cpu@0 { 75 cpu: cpu@0 {
68 device_type = "cpu"; 76 device_type = "cpu";
69 compatible = "arm,cortex-a8"; 77 compatible = "arm,cortex-a8";
70 reg = <0>; 78 reg = <0>;
71 clock-latency = <61036>; /* two CLK32 periods */ 79 clock-latency = <62500>;
72 clocks = <&clks 24>; 80 clocks = <&clks IMX5_CLK_CPU_PODF>;
73 clock-names = "cpu"; 81 clock-names = "cpu";
74 operating-points = < 82 operating-points = <
75 /* kHz uV (No regulator support) */ 83 166000 1000000
76 160000 0 84 600000 1050000
77 800000 0 85 800000 1100000
78 >; 86 >;
87 voltage-tolerance = <5>;
79 }; 88 };
80 }; 89 };
81 90
91 usbphy {
92 #address-cells = <1>;
93 #size-cells = <0>;
94 compatible = "simple-bus";
95
96 usbphy0: usbphy@0 {
97 compatible = "usb-nop-xceiv";
98 reg = <0>;
99 clocks = <&clks IMX5_CLK_USB_PHY_GATE>;
100 clock-names = "main_clk";
101 };
102 };
103
104 display-subsystem {
105 compatible = "fsl,imx-display-subsystem";
106 ports = <&ipu_di0>, <&ipu_di1>;
107 };
108
82 soc { 109 soc {
83 #address-cells = <1>; 110 #address-cells = <1>;
84 #size-cells = <1>; 111 #size-cells = <1>;
@@ -92,13 +119,30 @@
92 }; 119 };
93 120
94 ipu: ipu@40000000 { 121 ipu: ipu@40000000 {
95 #crtc-cells = <1>; 122 #address-cells = <1>;
123 #size-cells = <0>;
96 compatible = "fsl,imx51-ipu"; 124 compatible = "fsl,imx51-ipu";
97 reg = <0x40000000 0x20000000>; 125 reg = <0x40000000 0x20000000>;
98 interrupts = <11 10>; 126 interrupts = <11 10>;
99 clocks = <&clks 59>, <&clks 110>, <&clks 61>; 127 clocks = <&clks IMX5_CLK_IPU_GATE>,
128 <&clks IMX5_CLK_IPU_DI0_GATE>,
129 <&clks IMX5_CLK_IPU_DI1_GATE>;
100 clock-names = "bus", "di0", "di1"; 130 clock-names = "bus", "di0", "di1";
101 resets = <&src 2>; 131 resets = <&src 2>;
132
133 ipu_di0: port@2 {
134 reg = <2>;
135
136 ipu_di0_disp0: endpoint {
137 };
138 };
139
140 ipu_di1: port@3 {
141 reg = <3>;
142
143 ipu_di1_disp1: endpoint {
144 };
145 };
102 }; 146 };
103 147
104 aips@70000000 { /* AIPS1 */ 148 aips@70000000 { /* AIPS1 */
@@ -119,7 +163,9 @@
119 compatible = "fsl,imx51-esdhc"; 163 compatible = "fsl,imx51-esdhc";
120 reg = <0x70004000 0x4000>; 164 reg = <0x70004000 0x4000>;
121 interrupts = <1>; 165 interrupts = <1>;
122 clocks = <&clks 44>, <&clks 0>, <&clks 71>; 166 clocks = <&clks IMX5_CLK_ESDHC1_IPG_GATE>,
167 <&clks IMX5_CLK_DUMMY>,
168 <&clks IMX5_CLK_ESDHC1_PER_GATE>;
123 clock-names = "ipg", "ahb", "per"; 169 clock-names = "ipg", "ahb", "per";
124 status = "disabled"; 170 status = "disabled";
125 }; 171 };
@@ -128,7 +174,9 @@
128 compatible = "fsl,imx51-esdhc"; 174 compatible = "fsl,imx51-esdhc";
129 reg = <0x70008000 0x4000>; 175 reg = <0x70008000 0x4000>;
130 interrupts = <2>; 176 interrupts = <2>;
131 clocks = <&clks 45>, <&clks 0>, <&clks 72>; 177 clocks = <&clks IMX5_CLK_ESDHC2_IPG_GATE>,
178 <&clks IMX5_CLK_DUMMY>,
179 <&clks IMX5_CLK_ESDHC2_PER_GATE>;
132 clock-names = "ipg", "ahb", "per"; 180 clock-names = "ipg", "ahb", "per";
133 bus-width = <4>; 181 bus-width = <4>;
134 status = "disabled"; 182 status = "disabled";
@@ -138,7 +186,8 @@
138 compatible = "fsl,imx51-uart", "fsl,imx21-uart"; 186 compatible = "fsl,imx51-uart", "fsl,imx21-uart";
139 reg = <0x7000c000 0x4000>; 187 reg = <0x7000c000 0x4000>;
140 interrupts = <33>; 188 interrupts = <33>;
141 clocks = <&clks 32>, <&clks 33>; 189 clocks = <&clks IMX5_CLK_UART3_IPG_GATE>,
190 <&clks IMX5_CLK_UART3_PER_GATE>;
142 clock-names = "ipg", "per"; 191 clock-names = "ipg", "per";
143 status = "disabled"; 192 status = "disabled";
144 }; 193 };
@@ -149,7 +198,8 @@
149 compatible = "fsl,imx51-ecspi"; 198 compatible = "fsl,imx51-ecspi";
150 reg = <0x70010000 0x4000>; 199 reg = <0x70010000 0x4000>;
151 interrupts = <36>; 200 interrupts = <36>;
152 clocks = <&clks 51>, <&clks 52>; 201 clocks = <&clks IMX5_CLK_ECSPI1_IPG_GATE>,
202 <&clks IMX5_CLK_ECSPI1_PER_GATE>;
153 clock-names = "ipg", "per"; 203 clock-names = "ipg", "per";
154 status = "disabled"; 204 status = "disabled";
155 }; 205 };
@@ -158,7 +208,7 @@
158 compatible = "fsl,imx51-ssi", "fsl,imx21-ssi"; 208 compatible = "fsl,imx51-ssi", "fsl,imx21-ssi";
159 reg = <0x70014000 0x4000>; 209 reg = <0x70014000 0x4000>;
160 interrupts = <30>; 210 interrupts = <30>;
161 clocks = <&clks 49>; 211 clocks = <&clks IMX5_CLK_SSI2_IPG_GATE>;
162 dmas = <&sdma 24 1 0>, 212 dmas = <&sdma 24 1 0>,
163 <&sdma 25 1 0>; 213 <&sdma 25 1 0>;
164 dma-names = "rx", "tx"; 214 dma-names = "rx", "tx";
@@ -171,7 +221,9 @@
171 compatible = "fsl,imx51-esdhc"; 221 compatible = "fsl,imx51-esdhc";
172 reg = <0x70020000 0x4000>; 222 reg = <0x70020000 0x4000>;
173 interrupts = <3>; 223 interrupts = <3>;
174 clocks = <&clks 46>, <&clks 0>, <&clks 73>; 224 clocks = <&clks IMX5_CLK_ESDHC3_IPG_GATE>,
225 <&clks IMX5_CLK_DUMMY>,
226 <&clks IMX5_CLK_ESDHC3_PER_GATE>;
175 clock-names = "ipg", "ahb", "per"; 227 clock-names = "ipg", "ahb", "per";
176 bus-width = <4>; 228 bus-width = <4>;
177 status = "disabled"; 229 status = "disabled";
@@ -181,25 +233,20 @@
181 compatible = "fsl,imx51-esdhc"; 233 compatible = "fsl,imx51-esdhc";
182 reg = <0x70024000 0x4000>; 234 reg = <0x70024000 0x4000>;
183 interrupts = <4>; 235 interrupts = <4>;
184 clocks = <&clks 47>, <&clks 0>, <&clks 74>; 236 clocks = <&clks IMX5_CLK_ESDHC4_IPG_GATE>,
237 <&clks IMX5_CLK_DUMMY>,
238 <&clks IMX5_CLK_ESDHC4_PER_GATE>;
185 clock-names = "ipg", "ahb", "per"; 239 clock-names = "ipg", "ahb", "per";
186 bus-width = <4>; 240 bus-width = <4>;
187 status = "disabled"; 241 status = "disabled";
188 }; 242 };
189 }; 243 };
190 244
191 usbphy0: usbphy@0 {
192 compatible = "usb-nop-xceiv";
193 clocks = <&clks 75>;
194 clock-names = "main_clk";
195 status = "okay";
196 };
197
198 usbotg: usb@73f80000 { 245 usbotg: usb@73f80000 {
199 compatible = "fsl,imx51-usb", "fsl,imx27-usb"; 246 compatible = "fsl,imx51-usb", "fsl,imx27-usb";
200 reg = <0x73f80000 0x0200>; 247 reg = <0x73f80000 0x0200>;
201 interrupts = <18>; 248 interrupts = <18>;
202 clocks = <&clks 108>; 249 clocks = <&clks IMX5_CLK_USBOH3_GATE>;
203 fsl,usbmisc = <&usbmisc 0>; 250 fsl,usbmisc = <&usbmisc 0>;
204 fsl,usbphy = <&usbphy0>; 251 fsl,usbphy = <&usbphy0>;
205 status = "disabled"; 252 status = "disabled";
@@ -209,7 +256,7 @@
209 compatible = "fsl,imx51-usb", "fsl,imx27-usb"; 256 compatible = "fsl,imx51-usb", "fsl,imx27-usb";
210 reg = <0x73f80200 0x0200>; 257 reg = <0x73f80200 0x0200>;
211 interrupts = <14>; 258 interrupts = <14>;
212 clocks = <&clks 108>; 259 clocks = <&clks IMX5_CLK_USBOH3_GATE>;
213 fsl,usbmisc = <&usbmisc 1>; 260 fsl,usbmisc = <&usbmisc 1>;
214 status = "disabled"; 261 status = "disabled";
215 }; 262 };
@@ -218,7 +265,7 @@
218 compatible = "fsl,imx51-usb", "fsl,imx27-usb"; 265 compatible = "fsl,imx51-usb", "fsl,imx27-usb";
219 reg = <0x73f80400 0x0200>; 266 reg = <0x73f80400 0x0200>;
220 interrupts = <16>; 267 interrupts = <16>;
221 clocks = <&clks 108>; 268 clocks = <&clks IMX5_CLK_USBOH3_GATE>;
222 fsl,usbmisc = <&usbmisc 2>; 269 fsl,usbmisc = <&usbmisc 2>;
223 status = "disabled"; 270 status = "disabled";
224 }; 271 };
@@ -227,7 +274,7 @@
227 compatible = "fsl,imx51-usb", "fsl,imx27-usb"; 274 compatible = "fsl,imx51-usb", "fsl,imx27-usb";
228 reg = <0x73f80600 0x0200>; 275 reg = <0x73f80600 0x0200>;
229 interrupts = <17>; 276 interrupts = <17>;
230 clocks = <&clks 108>; 277 clocks = <&clks IMX5_CLK_USBOH3_GATE>;
231 fsl,usbmisc = <&usbmisc 3>; 278 fsl,usbmisc = <&usbmisc 3>;
232 status = "disabled"; 279 status = "disabled";
233 }; 280 };
@@ -236,7 +283,7 @@
236 #index-cells = <1>; 283 #index-cells = <1>;
237 compatible = "fsl,imx51-usbmisc"; 284 compatible = "fsl,imx51-usbmisc";
238 reg = <0x73f80800 0x200>; 285 reg = <0x73f80800 0x200>;
239 clocks = <&clks 108>; 286 clocks = <&clks IMX5_CLK_USBOH3_GATE>;
240 }; 287 };
241 288
242 gpio1: gpio@73f84000 { 289 gpio1: gpio@73f84000 {
@@ -283,7 +330,7 @@
283 compatible = "fsl,imx51-kpp", "fsl,imx21-kpp"; 330 compatible = "fsl,imx51-kpp", "fsl,imx21-kpp";
284 reg = <0x73f94000 0x4000>; 331 reg = <0x73f94000 0x4000>;
285 interrupts = <60>; 332 interrupts = <60>;
286 clocks = <&clks 0>; 333 clocks = <&clks IMX5_CLK_DUMMY>;
287 status = "disabled"; 334 status = "disabled";
288 }; 335 };
289 336
@@ -291,14 +338,14 @@
291 compatible = "fsl,imx51-wdt", "fsl,imx21-wdt"; 338 compatible = "fsl,imx51-wdt", "fsl,imx21-wdt";
292 reg = <0x73f98000 0x4000>; 339 reg = <0x73f98000 0x4000>;
293 interrupts = <58>; 340 interrupts = <58>;
294 clocks = <&clks 0>; 341 clocks = <&clks IMX5_CLK_DUMMY>;
295 }; 342 };
296 343
297 wdog2: wdog@73f9c000 { 344 wdog2: wdog@73f9c000 {
298 compatible = "fsl,imx51-wdt", "fsl,imx21-wdt"; 345 compatible = "fsl,imx51-wdt", "fsl,imx21-wdt";
299 reg = <0x73f9c000 0x4000>; 346 reg = <0x73f9c000 0x4000>;
300 interrupts = <59>; 347 interrupts = <59>;
301 clocks = <&clks 0>; 348 clocks = <&clks IMX5_CLK_DUMMY>;
302 status = "disabled"; 349 status = "disabled";
303 }; 350 };
304 351
@@ -306,7 +353,8 @@
306 compatible = "fsl,imx51-gpt", "fsl,imx31-gpt"; 353 compatible = "fsl,imx51-gpt", "fsl,imx31-gpt";
307 reg = <0x73fa0000 0x4000>; 354 reg = <0x73fa0000 0x4000>;
308 interrupts = <39>; 355 interrupts = <39>;
309 clocks = <&clks 36>, <&clks 41>; 356 clocks = <&clks IMX5_CLK_GPT_IPG_GATE>,
357 <&clks IMX5_CLK_GPT_HF_GATE>;
310 clock-names = "ipg", "per"; 358 clock-names = "ipg", "per";
311 }; 359 };
312 360
@@ -319,7 +367,8 @@
319 #pwm-cells = <2>; 367 #pwm-cells = <2>;
320 compatible = "fsl,imx51-pwm", "fsl,imx27-pwm"; 368 compatible = "fsl,imx51-pwm", "fsl,imx27-pwm";
321 reg = <0x73fb4000 0x4000>; 369 reg = <0x73fb4000 0x4000>;
322 clocks = <&clks 37>, <&clks 38>; 370 clocks = <&clks IMX5_CLK_PWM1_IPG_GATE>,
371 <&clks IMX5_CLK_PWM1_HF_GATE>;
323 clock-names = "ipg", "per"; 372 clock-names = "ipg", "per";
324 interrupts = <61>; 373 interrupts = <61>;
325 }; 374 };
@@ -328,7 +377,8 @@
328 #pwm-cells = <2>; 377 #pwm-cells = <2>;
329 compatible = "fsl,imx51-pwm", "fsl,imx27-pwm"; 378 compatible = "fsl,imx51-pwm", "fsl,imx27-pwm";
330 reg = <0x73fb8000 0x4000>; 379 reg = <0x73fb8000 0x4000>;
331 clocks = <&clks 39>, <&clks 40>; 380 clocks = <&clks IMX5_CLK_PWM2_IPG_GATE>,
381 <&clks IMX5_CLK_PWM2_HF_GATE>;
332 clock-names = "ipg", "per"; 382 clock-names = "ipg", "per";
333 interrupts = <94>; 383 interrupts = <94>;
334 }; 384 };
@@ -337,7 +387,8 @@
337 compatible = "fsl,imx51-uart", "fsl,imx21-uart"; 387 compatible = "fsl,imx51-uart", "fsl,imx21-uart";
338 reg = <0x73fbc000 0x4000>; 388 reg = <0x73fbc000 0x4000>;
339 interrupts = <31>; 389 interrupts = <31>;
340 clocks = <&clks 28>, <&clks 29>; 390 clocks = <&clks IMX5_CLK_UART1_IPG_GATE>,
391 <&clks IMX5_CLK_UART1_PER_GATE>;
341 clock-names = "ipg", "per"; 392 clock-names = "ipg", "per";
342 status = "disabled"; 393 status = "disabled";
343 }; 394 };
@@ -346,7 +397,8 @@
346 compatible = "fsl,imx51-uart", "fsl,imx21-uart"; 397 compatible = "fsl,imx51-uart", "fsl,imx21-uart";
347 reg = <0x73fc0000 0x4000>; 398 reg = <0x73fc0000 0x4000>;
348 interrupts = <32>; 399 interrupts = <32>;
349 clocks = <&clks 30>, <&clks 31>; 400 clocks = <&clks IMX5_CLK_UART2_IPG_GATE>,
401 <&clks IMX5_CLK_UART2_PER_GATE>;
350 clock-names = "ipg", "per"; 402 clock-names = "ipg", "per";
351 status = "disabled"; 403 status = "disabled";
352 }; 404 };
@@ -376,14 +428,14 @@
376 compatible = "fsl,imx51-iim", "fsl,imx27-iim"; 428 compatible = "fsl,imx51-iim", "fsl,imx27-iim";
377 reg = <0x83f98000 0x4000>; 429 reg = <0x83f98000 0x4000>;
378 interrupts = <69>; 430 interrupts = <69>;
379 clocks = <&clks 107>; 431 clocks = <&clks IMX5_CLK_IIM_GATE>;
380 }; 432 };
381 433
382 owire: owire@83fa4000 { 434 owire: owire@83fa4000 {
383 compatible = "fsl,imx51-owire", "fsl,imx21-owire"; 435 compatible = "fsl,imx51-owire", "fsl,imx21-owire";
384 reg = <0x83fa4000 0x4000>; 436 reg = <0x83fa4000 0x4000>;
385 interrupts = <88>; 437 interrupts = <88>;
386 clocks = <&clks 159>; 438 clocks = <&clks IMX5_CLK_OWIRE_GATE>;
387 status = "disabled"; 439 status = "disabled";
388 }; 440 };
389 441
@@ -393,7 +445,8 @@
393 compatible = "fsl,imx51-ecspi"; 445 compatible = "fsl,imx51-ecspi";
394 reg = <0x83fac000 0x4000>; 446 reg = <0x83fac000 0x4000>;
395 interrupts = <37>; 447 interrupts = <37>;
396 clocks = <&clks 53>, <&clks 54>; 448 clocks = <&clks IMX5_CLK_ECSPI2_IPG_GATE>,
449 <&clks IMX5_CLK_ECSPI2_PER_GATE>;
397 clock-names = "ipg", "per"; 450 clock-names = "ipg", "per";
398 status = "disabled"; 451 status = "disabled";
399 }; 452 };
@@ -402,7 +455,8 @@
402 compatible = "fsl,imx51-sdma", "fsl,imx35-sdma"; 455 compatible = "fsl,imx51-sdma", "fsl,imx35-sdma";
403 reg = <0x83fb0000 0x4000>; 456 reg = <0x83fb0000 0x4000>;
404 interrupts = <6>; 457 interrupts = <6>;
405 clocks = <&clks 56>, <&clks 56>; 458 clocks = <&clks IMX5_CLK_SDMA_GATE>,
459 <&clks IMX5_CLK_SDMA_GATE>;
406 clock-names = "ipg", "ahb"; 460 clock-names = "ipg", "ahb";
407 #dma-cells = <3>; 461 #dma-cells = <3>;
408 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx51.bin"; 462 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx51.bin";
@@ -414,7 +468,8 @@
414 compatible = "fsl,imx51-cspi", "fsl,imx35-cspi"; 468 compatible = "fsl,imx51-cspi", "fsl,imx35-cspi";
415 reg = <0x83fc0000 0x4000>; 469 reg = <0x83fc0000 0x4000>;
416 interrupts = <38>; 470 interrupts = <38>;
417 clocks = <&clks 55>, <&clks 55>; 471 clocks = <&clks IMX5_CLK_CSPI_IPG_GATE>,
472 <&clks IMX5_CLK_CSPI_IPG_GATE>;
418 clock-names = "ipg", "per"; 473 clock-names = "ipg", "per";
419 status = "disabled"; 474 status = "disabled";
420 }; 475 };
@@ -425,7 +480,7 @@
425 compatible = "fsl,imx51-i2c", "fsl,imx21-i2c"; 480 compatible = "fsl,imx51-i2c", "fsl,imx21-i2c";
426 reg = <0x83fc4000 0x4000>; 481 reg = <0x83fc4000 0x4000>;
427 interrupts = <63>; 482 interrupts = <63>;
428 clocks = <&clks 35>; 483 clocks = <&clks IMX5_CLK_I2C2_GATE>;
429 status = "disabled"; 484 status = "disabled";
430 }; 485 };
431 486
@@ -435,7 +490,7 @@
435 compatible = "fsl,imx51-i2c", "fsl,imx21-i2c"; 490 compatible = "fsl,imx51-i2c", "fsl,imx21-i2c";
436 reg = <0x83fc8000 0x4000>; 491 reg = <0x83fc8000 0x4000>;
437 interrupts = <62>; 492 interrupts = <62>;
438 clocks = <&clks 34>; 493 clocks = <&clks IMX5_CLK_I2C1_GATE>;
439 status = "disabled"; 494 status = "disabled";
440 }; 495 };
441 496
@@ -443,7 +498,7 @@
443 compatible = "fsl,imx51-ssi", "fsl,imx21-ssi"; 498 compatible = "fsl,imx51-ssi", "fsl,imx21-ssi";
444 reg = <0x83fcc000 0x4000>; 499 reg = <0x83fcc000 0x4000>;
445 interrupts = <29>; 500 interrupts = <29>;
446 clocks = <&clks 48>; 501 clocks = <&clks IMX5_CLK_SSI1_IPG_GATE>;
447 dmas = <&sdma 28 0 0>, 502 dmas = <&sdma 28 0 0>,
448 <&sdma 29 0 0>; 503 <&sdma 29 0 0>;
449 dma-names = "rx", "tx"; 504 dma-names = "rx", "tx";
@@ -455,6 +510,8 @@
455 audmux: audmux@83fd0000 { 510 audmux: audmux@83fd0000 {
456 compatible = "fsl,imx51-audmux", "fsl,imx31-audmux"; 511 compatible = "fsl,imx51-audmux", "fsl,imx31-audmux";
457 reg = <0x83fd0000 0x4000>; 512 reg = <0x83fd0000 0x4000>;
513 clocks = <&clks IMX5_CLK_DUMMY>;
514 clock-names = "audmux";
458 status = "disabled"; 515 status = "disabled";
459 }; 516 };
460 517
@@ -463,7 +520,7 @@
463 #size-cells = <1>; 520 #size-cells = <1>;
464 compatible = "fsl,imx51-weim"; 521 compatible = "fsl,imx51-weim";
465 reg = <0x83fda000 0x1000>; 522 reg = <0x83fda000 0x1000>;
466 clocks = <&clks 57>; 523 clocks = <&clks IMX5_CLK_EMI_SLOW_GATE>;
467 ranges = < 524 ranges = <
468 0 0 0xb0000000 0x08000000 525 0 0 0xb0000000 0x08000000
469 1 0 0xb8000000 0x08000000 526 1 0 0xb8000000 0x08000000
@@ -479,7 +536,7 @@
479 compatible = "fsl,imx51-nand"; 536 compatible = "fsl,imx51-nand";
480 reg = <0x83fdb000 0x1000 0xcfff0000 0x10000>; 537 reg = <0x83fdb000 0x1000 0xcfff0000 0x10000>;
481 interrupts = <8>; 538 interrupts = <8>;
482 clocks = <&clks 60>; 539 clocks = <&clks IMX5_CLK_NFC_GATE>;
483 status = "disabled"; 540 status = "disabled";
484 }; 541 };
485 542
@@ -487,7 +544,7 @@
487 compatible = "fsl,imx51-pata", "fsl,imx27-pata"; 544 compatible = "fsl,imx51-pata", "fsl,imx27-pata";
488 reg = <0x83fe0000 0x4000>; 545 reg = <0x83fe0000 0x4000>;
489 interrupts = <70>; 546 interrupts = <70>;
490 clocks = <&clks 172>; 547 clocks = <&clks IMX5_CLK_PATA_GATE>;
491 status = "disabled"; 548 status = "disabled";
492 }; 549 };
493 550
@@ -495,7 +552,7 @@
495 compatible = "fsl,imx51-ssi", "fsl,imx21-ssi"; 552 compatible = "fsl,imx51-ssi", "fsl,imx21-ssi";
496 reg = <0x83fe8000 0x4000>; 553 reg = <0x83fe8000 0x4000>;
497 interrupts = <96>; 554 interrupts = <96>;
498 clocks = <&clks 50>; 555 clocks = <&clks IMX5_CLK_SSI3_IPG_GATE>;
499 dmas = <&sdma 46 0 0>, 556 dmas = <&sdma 46 0 0>,
500 <&sdma 47 0 0>; 557 <&sdma 47 0 0>;
501 dma-names = "rx", "tx"; 558 dma-names = "rx", "tx";
@@ -508,336 +565,12 @@
508 compatible = "fsl,imx51-fec", "fsl,imx27-fec"; 565 compatible = "fsl,imx51-fec", "fsl,imx27-fec";
509 reg = <0x83fec000 0x4000>; 566 reg = <0x83fec000 0x4000>;
510 interrupts = <87>; 567 interrupts = <87>;
511 clocks = <&clks 42>, <&clks 42>, <&clks 42>; 568 clocks = <&clks IMX5_CLK_FEC_GATE>,
569 <&clks IMX5_CLK_FEC_GATE>,
570 <&clks IMX5_CLK_FEC_GATE>;
512 clock-names = "ipg", "ahb", "ptp"; 571 clock-names = "ipg", "ahb", "ptp";
513 status = "disabled"; 572 status = "disabled";
514 }; 573 };
515 }; 574 };
516 }; 575 };
517}; 576};
518
519&iomuxc {
520 audmux {
521 pinctrl_audmux_1: audmuxgrp-1 {
522 fsl,pins = <
523 MX51_PAD_AUD3_BB_TXD__AUD3_TXD 0x80000000
524 MX51_PAD_AUD3_BB_RXD__AUD3_RXD 0x80000000
525 MX51_PAD_AUD3_BB_CK__AUD3_TXC 0x80000000
526 MX51_PAD_AUD3_BB_FS__AUD3_TXFS 0x80000000
527 >;
528 };
529 };
530
531 fec {
532 pinctrl_fec_1: fecgrp-1 {
533 fsl,pins = <
534 MX51_PAD_EIM_EB2__FEC_MDIO 0x80000000
535 MX51_PAD_EIM_EB3__FEC_RDATA1 0x80000000
536 MX51_PAD_EIM_CS2__FEC_RDATA2 0x80000000
537 MX51_PAD_EIM_CS3__FEC_RDATA3 0x80000000
538 MX51_PAD_EIM_CS4__FEC_RX_ER 0x80000000
539 MX51_PAD_EIM_CS5__FEC_CRS 0x80000000
540 MX51_PAD_NANDF_RB2__FEC_COL 0x80000000
541 MX51_PAD_NANDF_RB3__FEC_RX_CLK 0x80000000
542 MX51_PAD_NANDF_D9__FEC_RDATA0 0x80000000
543 MX51_PAD_NANDF_D8__FEC_TDATA0 0x80000000
544 MX51_PAD_NANDF_CS2__FEC_TX_ER 0x80000000
545 MX51_PAD_NANDF_CS3__FEC_MDC 0x80000000
546 MX51_PAD_NANDF_CS4__FEC_TDATA1 0x80000000
547 MX51_PAD_NANDF_CS5__FEC_TDATA2 0x80000000
548 MX51_PAD_NANDF_CS6__FEC_TDATA3 0x80000000
549 MX51_PAD_NANDF_CS7__FEC_TX_EN 0x80000000
550 MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK 0x80000000
551 >;
552 };
553
554 pinctrl_fec_2: fecgrp-2 {
555 fsl,pins = <
556 MX51_PAD_DI_GP3__FEC_TX_ER 0x80000000
557 MX51_PAD_DI2_PIN4__FEC_CRS 0x80000000
558 MX51_PAD_DI2_PIN2__FEC_MDC 0x80000000
559 MX51_PAD_DI2_PIN3__FEC_MDIO 0x80000000
560 MX51_PAD_DI2_DISP_CLK__FEC_RDATA1 0x80000000
561 MX51_PAD_DI_GP4__FEC_RDATA2 0x80000000
562 MX51_PAD_DISP2_DAT0__FEC_RDATA3 0x80000000
563 MX51_PAD_DISP2_DAT1__FEC_RX_ER 0x80000000
564 MX51_PAD_DISP2_DAT6__FEC_TDATA1 0x80000000
565 MX51_PAD_DISP2_DAT7__FEC_TDATA2 0x80000000
566 MX51_PAD_DISP2_DAT8__FEC_TDATA3 0x80000000
567 MX51_PAD_DISP2_DAT9__FEC_TX_EN 0x80000000
568 MX51_PAD_DISP2_DAT10__FEC_COL 0x80000000
569 MX51_PAD_DISP2_DAT11__FEC_RX_CLK 0x80000000
570 MX51_PAD_DISP2_DAT12__FEC_RX_DV 0x80000000
571 MX51_PAD_DISP2_DAT13__FEC_TX_CLK 0x80000000
572 MX51_PAD_DISP2_DAT14__FEC_RDATA0 0x80000000
573 MX51_PAD_DISP2_DAT15__FEC_TDATA0 0x80000000
574 >;
575 };
576 };
577
578 ecspi1 {
579 pinctrl_ecspi1_1: ecspi1grp-1 {
580 fsl,pins = <
581 MX51_PAD_CSPI1_MISO__ECSPI1_MISO 0x185
582 MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI 0x185
583 MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK 0x185
584 >;
585 };
586 };
587
588 ecspi2 {
589 pinctrl_ecspi2_1: ecspi2grp-1 {
590 fsl,pins = <
591 MX51_PAD_NANDF_RB3__ECSPI2_MISO 0x185
592 MX51_PAD_NANDF_D15__ECSPI2_MOSI 0x185
593 MX51_PAD_NANDF_RB2__ECSPI2_SCLK 0x185
594 >;
595 };
596 };
597
598 esdhc1 {
599 pinctrl_esdhc1_1: esdhc1grp-1 {
600 fsl,pins = <
601 MX51_PAD_SD1_CMD__SD1_CMD 0x400020d5
602 MX51_PAD_SD1_CLK__SD1_CLK 0x20d5
603 MX51_PAD_SD1_DATA0__SD1_DATA0 0x20d5
604 MX51_PAD_SD1_DATA1__SD1_DATA1 0x20d5
605 MX51_PAD_SD1_DATA2__SD1_DATA2 0x20d5
606 MX51_PAD_SD1_DATA3__SD1_DATA3 0x20d5
607 >;
608 };
609 };
610
611 esdhc2 {
612 pinctrl_esdhc2_1: esdhc2grp-1 {
613 fsl,pins = <
614 MX51_PAD_SD2_CMD__SD2_CMD 0x400020d5
615 MX51_PAD_SD2_CLK__SD2_CLK 0x20d5
616 MX51_PAD_SD2_DATA0__SD2_DATA0 0x20d5
617 MX51_PAD_SD2_DATA1__SD2_DATA1 0x20d5
618 MX51_PAD_SD2_DATA2__SD2_DATA2 0x20d5
619 MX51_PAD_SD2_DATA3__SD2_DATA3 0x20d5
620 >;
621 };
622 };
623
624 i2c2 {
625 pinctrl_i2c2_1: i2c2grp-1 {
626 fsl,pins = <
627 MX51_PAD_KEY_COL4__I2C2_SCL 0x400001ed
628 MX51_PAD_KEY_COL5__I2C2_SDA 0x400001ed
629 >;
630 };
631
632 pinctrl_i2c2_2: i2c2grp-2 {
633 fsl,pins = <
634 MX51_PAD_EIM_D27__I2C2_SCL 0x400001ed
635 MX51_PAD_EIM_D24__I2C2_SDA 0x400001ed
636 >;
637 };
638
639 pinctrl_i2c2_3: i2c2grp-3 {
640 fsl,pins = <
641 MX51_PAD_GPIO1_2__I2C2_SCL 0x400001ed
642 MX51_PAD_GPIO1_3__I2C2_SDA 0x400001ed
643 >;
644 };
645 };
646
647 ipu_disp1 {
648 pinctrl_ipu_disp1_1: ipudisp1grp-1 {
649 fsl,pins = <
650 MX51_PAD_DISP1_DAT0__DISP1_DAT0 0x5
651 MX51_PAD_DISP1_DAT1__DISP1_DAT1 0x5
652 MX51_PAD_DISP1_DAT2__DISP1_DAT2 0x5
653 MX51_PAD_DISP1_DAT3__DISP1_DAT3 0x5
654 MX51_PAD_DISP1_DAT4__DISP1_DAT4 0x5
655 MX51_PAD_DISP1_DAT5__DISP1_DAT5 0x5
656 MX51_PAD_DISP1_DAT6__DISP1_DAT6 0x5
657 MX51_PAD_DISP1_DAT7__DISP1_DAT7 0x5
658 MX51_PAD_DISP1_DAT8__DISP1_DAT8 0x5
659 MX51_PAD_DISP1_DAT9__DISP1_DAT9 0x5
660 MX51_PAD_DISP1_DAT10__DISP1_DAT10 0x5
661 MX51_PAD_DISP1_DAT11__DISP1_DAT11 0x5
662 MX51_PAD_DISP1_DAT12__DISP1_DAT12 0x5
663 MX51_PAD_DISP1_DAT13__DISP1_DAT13 0x5
664 MX51_PAD_DISP1_DAT14__DISP1_DAT14 0x5
665 MX51_PAD_DISP1_DAT15__DISP1_DAT15 0x5
666 MX51_PAD_DISP1_DAT16__DISP1_DAT16 0x5
667 MX51_PAD_DISP1_DAT17__DISP1_DAT17 0x5
668 MX51_PAD_DISP1_DAT18__DISP1_DAT18 0x5
669 MX51_PAD_DISP1_DAT19__DISP1_DAT19 0x5
670 MX51_PAD_DISP1_DAT20__DISP1_DAT20 0x5
671 MX51_PAD_DISP1_DAT21__DISP1_DAT21 0x5
672 MX51_PAD_DISP1_DAT22__DISP1_DAT22 0x5
673 MX51_PAD_DISP1_DAT23__DISP1_DAT23 0x5
674 MX51_PAD_DI1_PIN2__DI1_PIN2 0x5 /* hsync */
675 MX51_PAD_DI1_PIN3__DI1_PIN3 0x5 /* vsync */
676 >;
677 };
678 };
679
680 ipu_disp2 {
681 pinctrl_ipu_disp2_1: ipudisp2grp-1 {
682 fsl,pins = <
683 MX51_PAD_DISP2_DAT0__DISP2_DAT0 0x5
684 MX51_PAD_DISP2_DAT1__DISP2_DAT1 0x5
685 MX51_PAD_DISP2_DAT2__DISP2_DAT2 0x5
686 MX51_PAD_DISP2_DAT3__DISP2_DAT3 0x5
687 MX51_PAD_DISP2_DAT4__DISP2_DAT4 0x5
688 MX51_PAD_DISP2_DAT5__DISP2_DAT5 0x5
689 MX51_PAD_DISP2_DAT6__DISP2_DAT6 0x5
690 MX51_PAD_DISP2_DAT7__DISP2_DAT7 0x5
691 MX51_PAD_DISP2_DAT8__DISP2_DAT8 0x5
692 MX51_PAD_DISP2_DAT9__DISP2_DAT9 0x5
693 MX51_PAD_DISP2_DAT10__DISP2_DAT10 0x5
694 MX51_PAD_DISP2_DAT11__DISP2_DAT11 0x5
695 MX51_PAD_DISP2_DAT12__DISP2_DAT12 0x5
696 MX51_PAD_DISP2_DAT13__DISP2_DAT13 0x5
697 MX51_PAD_DISP2_DAT14__DISP2_DAT14 0x5
698 MX51_PAD_DISP2_DAT15__DISP2_DAT15 0x5
699 MX51_PAD_DI2_PIN2__DI2_PIN2 0x5 /* hsync */
700 MX51_PAD_DI2_PIN3__DI2_PIN3 0x5 /* vsync */
701 MX51_PAD_DI2_DISP_CLK__DI2_DISP_CLK 0x5 /* CLK */
702 MX51_PAD_DI_GP4__DI2_PIN15 0x5 /* DE */
703 >;
704 };
705 };
706
707 kpp {
708 pinctrl_kpp_1: kppgrp-1 {
709 fsl,pins = <
710 MX51_PAD_KEY_ROW0__KEY_ROW0 0xe0
711 MX51_PAD_KEY_ROW1__KEY_ROW1 0xe0
712 MX51_PAD_KEY_ROW2__KEY_ROW2 0xe0
713 MX51_PAD_KEY_ROW3__KEY_ROW3 0xe0
714 MX51_PAD_KEY_COL0__KEY_COL0 0xe8
715 MX51_PAD_KEY_COL1__KEY_COL1 0xe8
716 MX51_PAD_KEY_COL2__KEY_COL2 0xe8
717 MX51_PAD_KEY_COL3__KEY_COL3 0xe8
718 >;
719 };
720 };
721
722 pata {
723 pinctrl_pata_1: patagrp-1 {
724 fsl,pins = <
725 MX51_PAD_NANDF_WE_B__PATA_DIOW 0x2004
726 MX51_PAD_NANDF_RE_B__PATA_DIOR 0x2004
727 MX51_PAD_NANDF_ALE__PATA_BUFFER_EN 0x2004
728 MX51_PAD_NANDF_CLE__PATA_RESET_B 0x2004
729 MX51_PAD_NANDF_WP_B__PATA_DMACK 0x2004
730 MX51_PAD_NANDF_RB0__PATA_DMARQ 0x2004
731 MX51_PAD_NANDF_RB1__PATA_IORDY 0x2004
732 MX51_PAD_GPIO_NAND__PATA_INTRQ 0x2004
733 MX51_PAD_NANDF_CS2__PATA_CS_0 0x2004
734 MX51_PAD_NANDF_CS3__PATA_CS_1 0x2004
735 MX51_PAD_NANDF_CS4__PATA_DA_0 0x2004
736 MX51_PAD_NANDF_CS5__PATA_DA_1 0x2004
737 MX51_PAD_NANDF_CS6__PATA_DA_2 0x2004
738 MX51_PAD_NANDF_D15__PATA_DATA15 0x2004
739 MX51_PAD_NANDF_D14__PATA_DATA14 0x2004
740 MX51_PAD_NANDF_D13__PATA_DATA13 0x2004
741 MX51_PAD_NANDF_D12__PATA_DATA12 0x2004
742 MX51_PAD_NANDF_D11__PATA_DATA11 0x2004
743 MX51_PAD_NANDF_D10__PATA_DATA10 0x2004
744 MX51_PAD_NANDF_D9__PATA_DATA9 0x2004
745 MX51_PAD_NANDF_D8__PATA_DATA8 0x2004
746 MX51_PAD_NANDF_D7__PATA_DATA7 0x2004
747 MX51_PAD_NANDF_D6__PATA_DATA6 0x2004
748 MX51_PAD_NANDF_D5__PATA_DATA5 0x2004
749 MX51_PAD_NANDF_D4__PATA_DATA4 0x2004
750 MX51_PAD_NANDF_D3__PATA_DATA3 0x2004
751 MX51_PAD_NANDF_D2__PATA_DATA2 0x2004
752 MX51_PAD_NANDF_D1__PATA_DATA1 0x2004
753 MX51_PAD_NANDF_D0__PATA_DATA0 0x2004
754 >;
755 };
756 };
757
758 uart1 {
759 pinctrl_uart1_1: uart1grp-1 {
760 fsl,pins = <
761 MX51_PAD_UART1_RXD__UART1_RXD 0x1c5
762 MX51_PAD_UART1_TXD__UART1_TXD 0x1c5
763 >;
764 };
765
766 pinctrl_uart1_rtscts_1: uart1rtscts-1 {
767 fsl,pins = <
768 MX51_PAD_UART1_RTS__UART1_RTS 0x1c5
769 MX51_PAD_UART1_CTS__UART1_CTS 0x1c5
770 >;
771 };
772 };
773
774 uart2 {
775 pinctrl_uart2_1: uart2grp-1 {
776 fsl,pins = <
777 MX51_PAD_UART2_RXD__UART2_RXD 0x1c5
778 MX51_PAD_UART2_TXD__UART2_TXD 0x1c5
779 >;
780 };
781 };
782
783 uart3 {
784 pinctrl_uart3_1: uart3grp-1 {
785 fsl,pins = <
786 MX51_PAD_EIM_D25__UART3_RXD 0x1c5
787 MX51_PAD_EIM_D26__UART3_TXD 0x1c5
788 >;
789 };
790
791 pinctrl_uart3_rtscts_1: uart3rtscts-1 {
792 fsl,pins = <
793 MX51_PAD_EIM_D27__UART3_RTS 0x1c5
794 MX51_PAD_EIM_D24__UART3_CTS 0x1c5
795 >;
796 };
797
798 pinctrl_uart3_2: uart3grp-2 {
799 fsl,pins = <
800 MX51_PAD_UART3_RXD__UART3_RXD 0x1c5
801 MX51_PAD_UART3_TXD__UART3_TXD 0x1c5
802 >;
803 };
804 };
805
806 usbh1 {
807 pinctrl_usbh1_1: usbh1grp-1 {
808 fsl,pins = <
809 MX51_PAD_USBH1_DATA0__USBH1_DATA0 0x1e5
810 MX51_PAD_USBH1_DATA1__USBH1_DATA1 0x1e5
811 MX51_PAD_USBH1_DATA2__USBH1_DATA2 0x1e5
812 MX51_PAD_USBH1_DATA3__USBH1_DATA3 0x1e5
813 MX51_PAD_USBH1_DATA4__USBH1_DATA4 0x1e5
814 MX51_PAD_USBH1_DATA5__USBH1_DATA5 0x1e5
815 MX51_PAD_USBH1_DATA6__USBH1_DATA6 0x1e5
816 MX51_PAD_USBH1_DATA7__USBH1_DATA7 0x1e5
817 MX51_PAD_USBH1_CLK__USBH1_CLK 0x1e5
818 MX51_PAD_USBH1_DIR__USBH1_DIR 0x1e5
819 MX51_PAD_USBH1_NXT__USBH1_NXT 0x1e5
820 MX51_PAD_USBH1_STP__USBH1_STP 0x1e5
821 >;
822 };
823 };
824
825 usbh2 {
826 pinctrl_usbh2_1: usbh2grp-1 {
827 fsl,pins = <
828 MX51_PAD_EIM_D16__USBH2_DATA0 0x1e5
829 MX51_PAD_EIM_D17__USBH2_DATA1 0x1e5
830 MX51_PAD_EIM_D18__USBH2_DATA2 0x1e5
831 MX51_PAD_EIM_D19__USBH2_DATA3 0x1e5
832 MX51_PAD_EIM_D20__USBH2_DATA4 0x1e5
833 MX51_PAD_EIM_D21__USBH2_DATA5 0x1e5
834 MX51_PAD_EIM_D22__USBH2_DATA6 0x1e5
835 MX51_PAD_EIM_D23__USBH2_DATA7 0x1e5
836 MX51_PAD_EIM_A24__USBH2_CLK 0x1e5
837 MX51_PAD_EIM_A25__USBH2_DIR 0x1e5
838 MX51_PAD_EIM_A27__USBH2_NXT 0x1e5
839 MX51_PAD_EIM_A26__USBH2_STP 0x1e5
840 >;
841 };
842 };
843};
diff --git a/arch/arm/boot/dts/imx53-ard.dts b/arch/arm/boot/dts/imx53-ard.dts
index 174f86938c89..e9337ad52f59 100644
--- a/arch/arm/boot/dts/imx53-ard.dts
+++ b/arch/arm/boot/dts/imx53-ard.dts
@@ -49,9 +49,12 @@
49 49
50 regulators { 50 regulators {
51 compatible = "simple-bus"; 51 compatible = "simple-bus";
52 #address-cells = <1>;
53 #size-cells = <0>;
52 54
53 reg_3p3v: 3p3v { 55 reg_3p3v: regulator@0 {
54 compatible = "regulator-fixed"; 56 compatible = "regulator-fixed";
57 reg = <0>;
55 regulator-name = "3P3V"; 58 regulator-name = "3P3V";
56 regulator-min-microvolt = <3300000>; 59 regulator-min-microvolt = <3300000>;
57 regulator-max-microvolt = <3300000>; 60 regulator-max-microvolt = <3300000>;
@@ -99,7 +102,7 @@
99 102
100&esdhc1 { 103&esdhc1 {
101 pinctrl-names = "default"; 104 pinctrl-names = "default";
102 pinctrl-0 = <&pinctrl_esdhc1_2>; 105 pinctrl-0 = <&pinctrl_esdhc1>;
103 cd-gpios = <&gpio1 1 0>; 106 cd-gpios = <&gpio1 1 0>;
104 wp-gpios = <&gpio1 9 0>; 107 wp-gpios = <&gpio1 9 0>;
105 status = "okay"; 108 status = "okay";
@@ -109,7 +112,7 @@
109 pinctrl-names = "default"; 112 pinctrl-names = "default";
110 pinctrl-0 = <&pinctrl_hog>; 113 pinctrl-0 = <&pinctrl_hog>;
111 114
112 hog { 115 imx53-ard {
113 pinctrl_hog: hoggrp { 116 pinctrl_hog: hoggrp {
114 fsl,pins = < 117 fsl,pins = <
115 MX53_PAD_GPIO_1__GPIO1_1 0x80000000 118 MX53_PAD_GPIO_1__GPIO1_1 0x80000000
@@ -148,11 +151,33 @@
148 MX53_PAD_EIM_CS1__EMI_WEIM_CS_1 0x80000000 151 MX53_PAD_EIM_CS1__EMI_WEIM_CS_1 0x80000000
149 >; 152 >;
150 }; 153 };
154
155 pinctrl_esdhc1: esdhc1grp {
156 fsl,pins = <
157 MX53_PAD_SD1_DATA0__ESDHC1_DAT0 0x1d5
158 MX53_PAD_SD1_DATA1__ESDHC1_DAT1 0x1d5
159 MX53_PAD_SD1_DATA2__ESDHC1_DAT2 0x1d5
160 MX53_PAD_SD1_DATA3__ESDHC1_DAT3 0x1d5
161 MX53_PAD_PATA_DATA8__ESDHC1_DAT4 0x1d5
162 MX53_PAD_PATA_DATA9__ESDHC1_DAT5 0x1d5
163 MX53_PAD_PATA_DATA10__ESDHC1_DAT6 0x1d5
164 MX53_PAD_PATA_DATA11__ESDHC1_DAT7 0x1d5
165 MX53_PAD_SD1_CMD__ESDHC1_CMD 0x1d5
166 MX53_PAD_SD1_CLK__ESDHC1_CLK 0x1d5
167 >;
168 };
169
170 pinctrl_uart1: uart1grp {
171 fsl,pins = <
172 MX53_PAD_PATA_DIOW__UART1_TXD_MUX 0x1e4
173 MX53_PAD_PATA_DMACK__UART1_RXD_MUX 0x1e4
174 >;
175 };
151 }; 176 };
152}; 177};
153 178
154&uart1 { 179&uart1 {
155 pinctrl-names = "default"; 180 pinctrl-names = "default";
156 pinctrl-0 = <&pinctrl_uart1_2>; 181 pinctrl-0 = <&pinctrl_uart1>;
157 status = "okay"; 182 status = "okay";
158}; 183};
diff --git a/arch/arm/boot/dts/imx53-evk.dts b/arch/arm/boot/dts/imx53-evk.dts
deleted file mode 100644
index 801fda728ed6..000000000000
--- a/arch/arm/boot/dts/imx53-evk.dts
+++ /dev/null
@@ -1,126 +0,0 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc.
3 * Copyright 2011 Linaro Ltd.
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/dts-v1/;
14#include "imx53.dtsi"
15
16/ {
17 model = "Freescale i.MX53 Evaluation Kit";
18 compatible = "fsl,imx53-evk", "fsl,imx53";
19
20 memory {
21 reg = <0x70000000 0x80000000>;
22 };
23
24 leds {
25 compatible = "gpio-leds";
26
27 green {
28 label = "Heartbeat";
29 gpios = <&gpio7 7 0>;
30 linux,default-trigger = "heartbeat";
31 };
32 };
33};
34
35&esdhc1 {
36 pinctrl-names = "default";
37 pinctrl-0 = <&pinctrl_esdhc1_1>;
38 cd-gpios = <&gpio3 13 0>;
39 wp-gpios = <&gpio3 14 0>;
40 status = "okay";
41};
42
43&ecspi1 {
44 pinctrl-names = "default";
45 pinctrl-0 = <&pinctrl_ecspi1_1>;
46 fsl,spi-num-chipselects = <2>;
47 cs-gpios = <&gpio2 30 0>, <&gpio3 19 0>;
48 status = "okay";
49
50 flash: at45db321d@1 {
51 #address-cells = <1>;
52 #size-cells = <1>;
53 compatible = "atmel,at45db321d", "atmel,at45", "atmel,dataflash";
54 spi-max-frequency = <25000000>;
55 reg = <1>;
56
57 partition@0 {
58 label = "U-Boot";
59 reg = <0x0 0x40000>;
60 read-only;
61 };
62
63 partition@40000 {
64 label = "Kernel";
65 reg = <0x40000 0x3c0000>;
66 };
67 };
68};
69
70&esdhc3 {
71 pinctrl-names = "default";
72 pinctrl-0 = <&pinctrl_esdhc3_1>;
73 cd-gpios = <&gpio3 11 0>;
74 wp-gpios = <&gpio3 12 0>;
75 status = "okay";
76};
77
78&iomuxc {
79 pinctrl-names = "default";
80 pinctrl-0 = <&pinctrl_hog>;
81
82 hog {
83 pinctrl_hog: hoggrp {
84 fsl,pins = <
85 MX53_PAD_EIM_EB2__GPIO2_30 0x80000000
86 MX53_PAD_EIM_D19__GPIO3_19 0x80000000
87 MX53_PAD_EIM_DA11__GPIO3_11 0x80000000
88 MX53_PAD_EIM_DA12__GPIO3_12 0x80000000
89 MX53_PAD_EIM_DA13__GPIO3_13 0x80000000
90 MX53_PAD_EIM_DA14__GPIO3_14 0x80000000
91 MX53_PAD_PATA_DA_0__GPIO7_6 0x80000000
92 MX53_PAD_PATA_DA_1__GPIO7_7 0x80000000
93 >;
94 };
95 };
96};
97
98&uart1 {
99 pinctrl-names = "default";
100 pinctrl-0 = <&pinctrl_uart1_1>;
101 status = "okay";
102};
103
104&i2c2 {
105 pinctrl-names = "default";
106 pinctrl-0 = <&pinctrl_i2c2_1>;
107 status = "okay";
108
109 pmic: mc13892@08 {
110 compatible = "fsl,mc13892", "fsl,mc13xxx";
111 reg = <0x08>;
112 };
113
114 codec: sgtl5000@0a {
115 compatible = "fsl,sgtl5000";
116 reg = <0x0a>;
117 };
118};
119
120&fec {
121 pinctrl-names = "default";
122 pinctrl-0 = <&pinctrl_fec_1>;
123 phy-mode = "rmii";
124 phy-reset-gpios = <&gpio7 6 0>;
125 status = "okay";
126};
diff --git a/arch/arm/boot/dts/imx53-m53evk.dts b/arch/arm/boot/dts/imx53-m53evk.dts
index 7d304d02ed38..f6d3ac3e5587 100644
--- a/arch/arm/boot/dts/imx53-m53evk.dts
+++ b/arch/arm/boot/dts/imx53-m53evk.dts
@@ -21,12 +21,11 @@
21 }; 21 };
22 22
23 soc { 23 soc {
24 display@di1 { 24 display1: display@di1 {
25 compatible = "fsl,imx-parallel-display"; 25 compatible = "fsl,imx-parallel-display";
26 crtcs = <&ipu 1>;
27 interface-pix-fmt = "bgr666"; 26 interface-pix-fmt = "bgr666";
28 pinctrl-names = "default"; 27 pinctrl-names = "default";
29 pinctrl-0 = <&pinctrl_ipu_disp2_1>; 28 pinctrl-0 = <&pinctrl_ipu_disp1>;
30 29
31 display-timings { 30 display-timings {
32 800x480p60 { 31 800x480p60 {
@@ -44,6 +43,12 @@
44 }; 43 };
45 }; 44 };
46 }; 45 };
46
47 port {
48 display1_in: endpoint {
49 remote-endpoint = <&ipu_di1_disp1>;
50 };
51 };
47 }; 52 };
48 53
49 backlight { 54 backlight {
@@ -51,6 +56,7 @@
51 pwms = <&pwm1 0 3000>; 56 pwms = <&pwm1 0 3000>;
52 brightness-levels = <0 4 8 16 32 64 128 255>; 57 brightness-levels = <0 4 8 16 32 64 128 255>;
53 default-brightness-level = <6>; 58 default-brightness-level = <6>;
59 power-supply = <&reg_backlight>;
54 }; 60 };
55 61
56 leds { 62 leds {
@@ -73,14 +79,36 @@
73 79
74 regulators { 80 regulators {
75 compatible = "simple-bus"; 81 compatible = "simple-bus";
82 #address-cells = <1>;
83 #size-cells = <0>;
76 84
77 reg_3p2v: 3p2v { 85 reg_3p2v: regulator@0 {
78 compatible = "regulator-fixed"; 86 compatible = "regulator-fixed";
87 reg = <0>;
79 regulator-name = "3P2V"; 88 regulator-name = "3P2V";
80 regulator-min-microvolt = <3200000>; 89 regulator-min-microvolt = <3200000>;
81 regulator-max-microvolt = <3200000>; 90 regulator-max-microvolt = <3200000>;
82 regulator-always-on; 91 regulator-always-on;
83 }; 92 };
93
94
95 reg_backlight: regulator@1 {
96 compatible = "regulator-fixed";
97 reg = <1>;
98 regulator-name = "lcd-supply";
99 regulator-min-microvolt = <3200000>;
100 regulator-max-microvolt = <3200000>;
101 regulator-always-on;
102 };
103
104 reg_usbh1_vbus: regulator@3 {
105 compatible = "regulator-fixed";
106 reg = <3>;
107 regulator-name = "vbus";
108 regulator-min-microvolt = <5000000>;
109 regulator-max-microvolt = <5000000>;
110 gpio = <&gpio1 2 0>;
111 };
84 }; 112 };
85 113
86 sound { 114 sound {
@@ -102,25 +130,25 @@
102 130
103&audmux { 131&audmux {
104 pinctrl-names = "default"; 132 pinctrl-names = "default";
105 pinctrl-0 = <&pinctrl_audmux_2>; 133 pinctrl-0 = <&pinctrl_audmux>;
106 status = "okay"; 134 status = "okay";
107}; 135};
108 136
109&can1 { 137&can1 {
110 pinctrl-names = "default"; 138 pinctrl-names = "default";
111 pinctrl-0 = <&pinctrl_can1_3>; 139 pinctrl-0 = <&pinctrl_can1>;
112 status = "okay"; 140 status = "okay";
113}; 141};
114 142
115&can2 { 143&can2 {
116 pinctrl-names = "default"; 144 pinctrl-names = "default";
117 pinctrl-0 = <&pinctrl_can2_1>; 145 pinctrl-0 = <&pinctrl_can2>;
118 status = "okay"; 146 status = "okay";
119}; 147};
120 148
121&esdhc1 { 149&esdhc1 {
122 pinctrl-names = "default"; 150 pinctrl-names = "default";
123 pinctrl-0 = <&pinctrl_esdhc1_1>; 151 pinctrl-0 = <&pinctrl_esdhc1>;
124 cd-gpios = <&gpio1 1 0>; 152 cd-gpios = <&gpio1 1 0>;
125 wp-gpios = <&gpio1 9 0>; 153 wp-gpios = <&gpio1 9 0>;
126 status = "okay"; 154 status = "okay";
@@ -128,14 +156,14 @@
128 156
129&fec { 157&fec {
130 pinctrl-names = "default"; 158 pinctrl-names = "default";
131 pinctrl-0 = <&pinctrl_fec_1>; 159 pinctrl-0 = <&pinctrl_fec>;
132 phy-mode = "rmii"; 160 phy-mode = "rmii";
133 status = "okay"; 161 status = "okay";
134}; 162};
135 163
136&i2c1 { 164&i2c1 {
137 pinctrl-names = "default"; 165 pinctrl-names = "default";
138 pinctrl-0 = <&pinctrl_i2c1_2>; 166 pinctrl-0 = <&pinctrl_i2c1>;
139 status = "okay"; 167 status = "okay";
140 168
141 sgtl5000: codec@0a { 169 sgtl5000: codec@0a {
@@ -143,13 +171,13 @@
143 reg = <0x0a>; 171 reg = <0x0a>;
144 VDDA-supply = <&reg_3p2v>; 172 VDDA-supply = <&reg_3p2v>;
145 VDDIO-supply = <&reg_3p2v>; 173 VDDIO-supply = <&reg_3p2v>;
146 clocks = <&clks 150>; 174 clocks = <&clks IMX5_CLK_SSI_EXT1_GATE>;
147 }; 175 };
148}; 176};
149 177
150&i2c2 { 178&i2c2 {
151 pinctrl-names = "default"; 179 pinctrl-names = "default";
152 pinctrl-0 = <&pinctrl_i2c2_2>; 180 pinctrl-0 = <&pinctrl_i2c2>;
153 clock-frequency = <400000>; 181 clock-frequency = <400000>;
154 status = "okay"; 182 status = "okay";
155 183
@@ -193,7 +221,7 @@
193 221
194&i2c3 { 222&i2c3 {
195 pinctrl-names = "default"; 223 pinctrl-names = "default";
196 pinctrl-0 = <&pinctrl_i2c3_1>; 224 pinctrl-0 = <&pinctrl_i2c3>;
197 status = "okay"; 225 status = "okay";
198}; 226};
199 227
@@ -201,14 +229,14 @@
201 pinctrl-names = "default"; 229 pinctrl-names = "default";
202 pinctrl-0 = <&pinctrl_hog>; 230 pinctrl-0 = <&pinctrl_hog>;
203 231
204 hog { 232 imx53-m53evk {
205 pinctrl_hog: hoggrp { 233 pinctrl_hog: hoggrp {
206 fsl,pins = < 234 fsl,pins = <
207 MX53_PAD_GPIO_0__CCM_SSI_EXT1_CLK 0x80000000 235 MX53_PAD_GPIO_0__CCM_SSI_EXT1_CLK 0x80000000
208 MX53_PAD_EIM_EB3__GPIO2_31 0x80000000 236 MX53_PAD_EIM_EB3__GPIO2_31 0x80000000
209 MX53_PAD_PATA_DA_0__GPIO7_6 0x80000000 237 MX53_PAD_PATA_DA_0__GPIO7_6 0x80000000
210 MX53_PAD_DISP0_DAT8__PWM1_PWMO 0x5 238 MX53_PAD_GPIO_2__GPIO1_2 0x80000000
211 239 MX53_PAD_GPIO_3__USBOH3_USBH1_OC 0x80000000
212 >; 240 >;
213 }; 241 };
214 242
@@ -218,12 +246,172 @@
218 MX53_PAD_PATA_DATA9__GPIO2_9 0x80000000 246 MX53_PAD_PATA_DATA9__GPIO2_9 0x80000000
219 >; 247 >;
220 }; 248 };
249
250 pinctrl_audmux: audmuxgrp {
251 fsl,pins = <
252 MX53_PAD_SD2_DATA3__AUDMUX_AUD4_TXC 0x80000000
253 MX53_PAD_SD2_DATA2__AUDMUX_AUD4_TXD 0x80000000
254 MX53_PAD_SD2_DATA1__AUDMUX_AUD4_TXFS 0x80000000
255 MX53_PAD_SD2_DATA0__AUDMUX_AUD4_RXD 0x80000000
256 >;
257 };
258
259 pinctrl_can1: can1grp {
260 fsl,pins = <
261 MX53_PAD_GPIO_7__CAN1_TXCAN 0x80000000
262 MX53_PAD_GPIO_8__CAN1_RXCAN 0x80000000
263 >;
264 };
265
266 pinctrl_can2: can2grp {
267 fsl,pins = <
268 MX53_PAD_KEY_COL4__CAN2_TXCAN 0x80000000
269 MX53_PAD_KEY_ROW4__CAN2_RXCAN 0x80000000
270 >;
271 };
272
273 pinctrl_esdhc1: esdhc1grp {
274 fsl,pins = <
275 MX53_PAD_SD1_DATA0__ESDHC1_DAT0 0x1d5
276 MX53_PAD_SD1_DATA1__ESDHC1_DAT1 0x1d5
277 MX53_PAD_SD1_DATA2__ESDHC1_DAT2 0x1d5
278 MX53_PAD_SD1_DATA3__ESDHC1_DAT3 0x1d5
279 MX53_PAD_SD1_CMD__ESDHC1_CMD 0x1d5
280 MX53_PAD_SD1_CLK__ESDHC1_CLK 0x1d5
281 >;
282 };
283
284 pinctrl_fec: fecgrp {
285 fsl,pins = <
286 MX53_PAD_FEC_MDC__FEC_MDC 0x80000000
287 MX53_PAD_FEC_MDIO__FEC_MDIO 0x80000000
288 MX53_PAD_FEC_REF_CLK__FEC_TX_CLK 0x80000000
289 MX53_PAD_FEC_RX_ER__FEC_RX_ER 0x80000000
290 MX53_PAD_FEC_CRS_DV__FEC_RX_DV 0x80000000
291 MX53_PAD_FEC_RXD1__FEC_RDATA_1 0x80000000
292 MX53_PAD_FEC_RXD0__FEC_RDATA_0 0x80000000
293 MX53_PAD_FEC_TX_EN__FEC_TX_EN 0x80000000
294 MX53_PAD_FEC_TXD1__FEC_TDATA_1 0x80000000
295 MX53_PAD_FEC_TXD0__FEC_TDATA_0 0x80000000
296 >;
297 };
298
299 pinctrl_i2c1: i2c1grp {
300 fsl,pins = <
301 MX53_PAD_EIM_D21__I2C1_SCL 0xc0000000
302 MX53_PAD_EIM_D28__I2C1_SDA 0xc0000000
303 >;
304 };
305
306 pinctrl_i2c2: i2c2grp {
307 fsl,pins = <
308 MX53_PAD_EIM_D16__I2C2_SDA 0xc0000000
309 MX53_PAD_EIM_EB2__I2C2_SCL 0xc0000000
310 >;
311 };
312
313 pinctrl_i2c3: i2c3grp {
314 fsl,pins = <
315 MX53_PAD_GPIO_6__I2C3_SDA 0xc0000000
316 MX53_PAD_GPIO_5__I2C3_SCL 0xc0000000
317 >;
318 };
319
320 pinctrl_ipu_disp1: ipudisp1grp {
321 fsl,pins = <
322 MX53_PAD_EIM_DA9__IPU_DISP1_DAT_0 0x5
323 MX53_PAD_EIM_DA8__IPU_DISP1_DAT_1 0x5
324 MX53_PAD_EIM_DA7__IPU_DISP1_DAT_2 0x5
325 MX53_PAD_EIM_DA6__IPU_DISP1_DAT_3 0x5
326 MX53_PAD_EIM_DA5__IPU_DISP1_DAT_4 0x5
327 MX53_PAD_EIM_DA4__IPU_DISP1_DAT_5 0x5
328 MX53_PAD_EIM_DA3__IPU_DISP1_DAT_6 0x5
329 MX53_PAD_EIM_DA2__IPU_DISP1_DAT_7 0x5
330 MX53_PAD_EIM_DA1__IPU_DISP1_DAT_8 0x5
331 MX53_PAD_EIM_DA0__IPU_DISP1_DAT_9 0x5
332 MX53_PAD_EIM_EB1__IPU_DISP1_DAT_10 0x5
333 MX53_PAD_EIM_EB0__IPU_DISP1_DAT_11 0x5
334 MX53_PAD_EIM_A17__IPU_DISP1_DAT_12 0x5
335 MX53_PAD_EIM_A18__IPU_DISP1_DAT_13 0x5
336 MX53_PAD_EIM_A19__IPU_DISP1_DAT_14 0x5
337 MX53_PAD_EIM_A20__IPU_DISP1_DAT_15 0x5
338 MX53_PAD_EIM_A21__IPU_DISP1_DAT_16 0x5
339 MX53_PAD_EIM_A22__IPU_DISP1_DAT_17 0x5
340 MX53_PAD_EIM_A23__IPU_DISP1_DAT_18 0x5
341 MX53_PAD_EIM_A24__IPU_DISP1_DAT_19 0x5
342 MX53_PAD_EIM_D31__IPU_DISP1_DAT_20 0x5
343 MX53_PAD_EIM_D30__IPU_DISP1_DAT_21 0x5
344 MX53_PAD_EIM_D26__IPU_DISP1_DAT_22 0x5
345 MX53_PAD_EIM_D27__IPU_DISP1_DAT_23 0x5
346 MX53_PAD_EIM_A16__IPU_DI1_DISP_CLK 0x5
347 MX53_PAD_EIM_DA13__IPU_DI1_D0_CS 0x5
348 MX53_PAD_EIM_DA14__IPU_DI1_D1_CS 0x5
349 MX53_PAD_EIM_DA15__IPU_DI1_PIN1 0x5
350 MX53_PAD_EIM_DA11__IPU_DI1_PIN2 0x5
351 MX53_PAD_EIM_DA12__IPU_DI1_PIN3 0x5
352 MX53_PAD_EIM_A25__IPU_DI1_PIN12 0x5
353 MX53_PAD_EIM_DA10__IPU_DI1_PIN15 0x5
354 >;
355 };
356
357 pinctrl_nand: nandgrp {
358 fsl,pins = <
359 MX53_PAD_NANDF_WE_B__EMI_NANDF_WE_B 0x4
360 MX53_PAD_NANDF_RE_B__EMI_NANDF_RE_B 0x4
361 MX53_PAD_NANDF_CLE__EMI_NANDF_CLE 0x4
362 MX53_PAD_NANDF_ALE__EMI_NANDF_ALE 0x4
363 MX53_PAD_NANDF_WP_B__EMI_NANDF_WP_B 0xe0
364 MX53_PAD_NANDF_RB0__EMI_NANDF_RB_0 0xe0
365 MX53_PAD_NANDF_CS0__EMI_NANDF_CS_0 0x4
366 MX53_PAD_PATA_DATA0__EMI_NANDF_D_0 0xa4
367 MX53_PAD_PATA_DATA1__EMI_NANDF_D_1 0xa4
368 MX53_PAD_PATA_DATA2__EMI_NANDF_D_2 0xa4
369 MX53_PAD_PATA_DATA3__EMI_NANDF_D_3 0xa4
370 MX53_PAD_PATA_DATA4__EMI_NANDF_D_4 0xa4
371 MX53_PAD_PATA_DATA5__EMI_NANDF_D_5 0xa4
372 MX53_PAD_PATA_DATA6__EMI_NANDF_D_6 0xa4
373 MX53_PAD_PATA_DATA7__EMI_NANDF_D_7 0xa4
374 >;
375 };
376
377 pinctrl_pwm1: pwm1grp {
378 fsl,pins = <
379 MX53_PAD_DISP0_DAT8__PWM1_PWMO 0x5
380 >;
381 };
382
383 pinctrl_uart1: uart1grp {
384 fsl,pins = <
385 MX53_PAD_PATA_DIOW__UART1_TXD_MUX 0x1e4
386 MX53_PAD_PATA_DMACK__UART1_RXD_MUX 0x1e4
387 >;
388 };
389
390 pinctrl_uart2: uart2grp {
391 fsl,pins = <
392 MX53_PAD_PATA_BUFFER_EN__UART2_RXD_MUX 0x1e4
393 MX53_PAD_PATA_DMARQ__UART2_TXD_MUX 0x1e4
394 >;
395 };
396
397 pinctrl_uart3: uart3grp {
398 fsl,pins = <
399 MX53_PAD_PATA_CS_0__UART3_TXD_MUX 0x1e4
400 MX53_PAD_PATA_CS_1__UART3_RXD_MUX 0x1e4
401 MX53_PAD_PATA_DA_1__UART3_CTS 0x1e4
402 MX53_PAD_PATA_DA_2__UART3_RTS 0x1e4
403 >;
404 };
221 }; 405 };
222}; 406};
223 407
408&ipu_di1_disp1 {
409 remote-endpoint = <&display1_in>;
410};
411
224&nfc { 412&nfc {
225 pinctrl-names = "default"; 413 pinctrl-names = "default";
226 pinctrl-0 = <&pinctrl_nand_1>; 414 pinctrl-0 = <&pinctrl_nand>;
227 nand-bus-width = <8>; 415 nand-bus-width = <8>;
228 nand-ecc-mode = "hw"; 416 nand-ecc-mode = "hw";
229 status = "okay"; 417 status = "okay";
@@ -231,7 +419,11 @@
231 419
232&pwm1 { 420&pwm1 {
233 pinctrl-names = "default"; 421 pinctrl-names = "default";
234 pinctrl-0 = <&pinctrl_pwm1_1>; 422 pinctrl-0 = <&pinctrl_pwm1>;
423 status = "okay";
424};
425
426&sata {
235 status = "okay"; 427 status = "okay";
236}; 428};
237 429
@@ -242,18 +434,29 @@
242 434
243&uart1 { 435&uart1 {
244 pinctrl-names = "default"; 436 pinctrl-names = "default";
245 pinctrl-0 = <&pinctrl_uart1_2>; 437 pinctrl-0 = <&pinctrl_uart1>;
246 status = "okay"; 438 status = "okay";
247}; 439};
248 440
249&uart2 { 441&uart2 {
250 pinctrl-names = "default"; 442 pinctrl-names = "default";
251 pinctrl-0 = <&pinctrl_uart2_1>; 443 pinctrl-0 = <&pinctrl_uart2>;
252 status = "okay"; 444 status = "okay";
253}; 445};
254 446
255&uart3 { 447&uart3 {
256 pinctrl-names = "default"; 448 pinctrl-names = "default";
257 pinctrl-0 = <&pinctrl_uart3_1>; 449 pinctrl-0 = <&pinctrl_uart3>;
450 status = "okay";
451};
452
453&usbh1 {
454 vbus-supply = <&reg_usbh1_vbus>;
455 phy_type = "utmi";
456 status = "okay";
457};
458
459&usbotg {
460 dr_mode = "peripheral";
258 status = "okay"; 461 status = "okay";
259}; 462};
diff --git a/arch/arm/boot/dts/imx53-mba53.dts b/arch/arm/boot/dts/imx53-mba53.dts
index a63090267941..7c8c12969892 100644
--- a/arch/arm/boot/dts/imx53-mba53.dts
+++ b/arch/arm/boot/dts/imx53-mba53.dts
@@ -17,14 +17,6 @@
17 model = "TQ MBa53 starter kit"; 17 model = "TQ MBa53 starter kit";
18 compatible = "tq,mba53", "tq,tqma53", "fsl,imx53"; 18 compatible = "tq,mba53", "tq,tqma53", "fsl,imx53";
19 19
20 reg_backlight: fixed@0 {
21 compatible = "regulator-fixed";
22 regulator-name = "lcd-supply";
23 gpio = <&gpio2 5 0>;
24 startup-delay-us = <5000>;
25 enable-active-low;
26 };
27
28 backlight { 20 backlight {
29 compatible = "pwm-backlight"; 21 compatible = "pwm-backlight";
30 pwms = <&pwm2 0 50000>; 22 pwms = <&pwm2 0 50000>;
@@ -38,17 +30,37 @@
38 compatible = "fsl,imx-parallel-display"; 30 compatible = "fsl,imx-parallel-display";
39 pinctrl-names = "default"; 31 pinctrl-names = "default";
40 pinctrl-0 = <&pinctrl_disp1_1>; 32 pinctrl-0 = <&pinctrl_disp1_1>;
41 crtcs = <&ipu 1>;
42 interface-pix-fmt = "rgb24"; 33 interface-pix-fmt = "rgb24";
43 status = "disabled"; 34 status = "disabled";
35
36 port {
37 display1_in: endpoint {
38 remote-endpoint = <&ipu_di1_disp1>;
39 };
40 };
44 }; 41 };
45 42
46 reg_3p2v: 3p2v { 43 regulators {
47 compatible = "regulator-fixed"; 44 compatible = "simple-bus";
48 regulator-name = "3P2V"; 45 #address-cells = <1>;
49 regulator-min-microvolt = <3200000>; 46 #size-cells = <0>;
50 regulator-max-microvolt = <3200000>; 47
51 regulator-always-on; 48 reg_backlight: regulator@0 {
49 compatible = "regulator-fixed";
50 reg = <0>;
51 regulator-name = "lcd-supply";
52 gpio = <&gpio2 5 0>;
53 startup-delay-us = <5000>;
54 };
55
56 reg_3p2v: regulator@1 {
57 compatible = "regulator-fixed";
58 reg = <1>;
59 regulator-name = "3P2V";
60 regulator-min-microvolt = <3200000>;
61 regulator-max-microvolt = <3200000>;
62 regulator-always-on;
63 };
52 }; 64 };
53 65
54 sound { 66 sound {
@@ -141,6 +153,10 @@
141 }; 153 };
142}; 154};
143 155
156&ipu_di1_disp1 {
157 remote-endpoint = <&display1_in>;
158};
159
144&cspi { 160&cspi {
145 status = "okay"; 161 status = "okay";
146}; 162};
@@ -148,14 +164,14 @@
148&audmux { 164&audmux {
149 status = "okay"; 165 status = "okay";
150 pinctrl-names = "default"; 166 pinctrl-names = "default";
151 pinctrl-0 = <&pinctrl_audmux_1>; 167 pinctrl-0 = <&pinctrl_audmux>;
152}; 168};
153 169
154&i2c2 { 170&i2c2 {
155 codec: sgtl5000@a { 171 codec: sgtl5000@a {
156 compatible = "fsl,sgtl5000"; 172 compatible = "fsl,sgtl5000";
157 reg = <0x0a>; 173 reg = <0x0a>;
158 clocks = <&clks 150>; 174 clocks = <&clks IMX5_CLK_SSI_EXT1_GATE>;
159 VDDA-supply = <&reg_3p2v>; 175 VDDA-supply = <&reg_3p2v>;
160 VDDIO-supply = <&reg_3p2v>; 176 VDDIO-supply = <&reg_3p2v>;
161 }; 177 };
@@ -228,7 +244,7 @@
228&tve { 244&tve {
229 pinctrl-names = "default"; 245 pinctrl-names = "default";
230 pinctrl-0 = <&pinctrl_vga_sync_1>; 246 pinctrl-0 = <&pinctrl_vga_sync_1>;
231 ddc = <&i2c3>; 247 i2c-ddc-bus = <&i2c3>;
232 fsl,tve-mode = "vga"; 248 fsl,tve-mode = "vga";
233 fsl,hsync-pin = <4>; 249 fsl,hsync-pin = <4>;
234 fsl,vsync-pin = <6>; 250 fsl,vsync-pin = <6>;
diff --git a/arch/arm/boot/dts/imx53-qsb-common.dtsi b/arch/arm/boot/dts/imx53-qsb-common.dtsi
new file mode 100644
index 000000000000..3f825a6813da
--- /dev/null
+++ b/arch/arm/boot/dts/imx53-qsb-common.dtsi
@@ -0,0 +1,345 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc.
3 * Copyright 2011 Linaro Ltd.
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 "imx53.dtsi"
14
15/ {
16 memory {
17 reg = <0x70000000 0x40000000>;
18 };
19
20 display0: display@di0 {
21 compatible = "fsl,imx-parallel-display";
22 interface-pix-fmt = "rgb565";
23 pinctrl-names = "default";
24 pinctrl-0 = <&pinctrl_ipu_disp0>;
25 status = "disabled";
26 display-timings {
27 claawvga {
28 native-mode;
29 clock-frequency = <27000000>;
30 hactive = <800>;
31 vactive = <480>;
32 hback-porch = <40>;
33 hfront-porch = <60>;
34 vback-porch = <10>;
35 vfront-porch = <10>;
36 hsync-len = <20>;
37 vsync-len = <10>;
38 hsync-active = <0>;
39 vsync-active = <0>;
40 de-active = <1>;
41 pixelclk-active = <0>;
42 };
43 };
44
45 port {
46 display0_in: endpoint {
47 remote-endpoint = <&ipu_di0_disp0>;
48 };
49 };
50 };
51
52 gpio-keys {
53 compatible = "gpio-keys";
54
55 power {
56 label = "Power Button";
57 gpios = <&gpio1 8 0>;
58 linux,code = <116>; /* KEY_POWER */
59 };
60
61 volume-up {
62 label = "Volume Up";
63 gpios = <&gpio2 14 0>;
64 linux,code = <115>; /* KEY_VOLUMEUP */
65 gpio-key,wakeup;
66 };
67
68 volume-down {
69 label = "Volume Down";
70 gpios = <&gpio2 15 0>;
71 linux,code = <114>; /* KEY_VOLUMEDOWN */
72 gpio-key,wakeup;
73 };
74 };
75
76 leds {
77 compatible = "gpio-leds";
78 pinctrl-names = "default";
79 pinctrl-0 = <&led_pin_gpio7_7>;
80
81 user {
82 label = "Heartbeat";
83 gpios = <&gpio7 7 0>;
84 linux,default-trigger = "heartbeat";
85 };
86 };
87
88 regulators {
89 compatible = "simple-bus";
90 #address-cells = <1>;
91 #size-cells = <0>;
92
93 reg_3p2v: regulator@0 {
94 compatible = "regulator-fixed";
95 reg = <0>;
96 regulator-name = "3P2V";
97 regulator-min-microvolt = <3200000>;
98 regulator-max-microvolt = <3200000>;
99 regulator-always-on;
100 };
101
102 reg_usb_vbus: regulator@1 {
103 compatible = "regulator-fixed";
104 reg = <1>;
105 regulator-name = "usb_vbus";
106 regulator-min-microvolt = <5000000>;
107 regulator-max-microvolt = <5000000>;
108 gpio = <&gpio7 8 0>;
109 enable-active-high;
110 };
111 };
112
113 sound {
114 compatible = "fsl,imx53-qsb-sgtl5000",
115 "fsl,imx-audio-sgtl5000";
116 model = "imx53-qsb-sgtl5000";
117 ssi-controller = <&ssi2>;
118 audio-codec = <&sgtl5000>;
119 audio-routing =
120 "MIC_IN", "Mic Jack",
121 "Mic Jack", "Mic Bias",
122 "Headphone Jack", "HP_OUT";
123 mux-int-port = <2>;
124 mux-ext-port = <5>;
125 };
126};
127
128&esdhc1 {
129 pinctrl-names = "default";
130 pinctrl-0 = <&pinctrl_esdhc1>;
131 status = "okay";
132};
133
134&ipu_di0_disp0 {
135 remote-endpoint = <&display0_in>;
136};
137
138&ssi2 {
139 fsl,mode = "i2s-slave";
140 status = "okay";
141};
142
143&esdhc3 {
144 pinctrl-names = "default";
145 pinctrl-0 = <&pinctrl_esdhc3>;
146 cd-gpios = <&gpio3 11 0>;
147 wp-gpios = <&gpio3 12 0>;
148 bus-width = <8>;
149 status = "okay";
150};
151
152&iomuxc {
153 pinctrl-names = "default";
154 pinctrl-0 = <&pinctrl_hog>;
155
156 imx53-qsb {
157 pinctrl_hog: hoggrp {
158 fsl,pins = <
159 MX53_PAD_GPIO_0__CCM_SSI_EXT1_CLK 0x80000000
160 MX53_PAD_GPIO_8__GPIO1_8 0x80000000
161 MX53_PAD_PATA_DATA14__GPIO2_14 0x80000000
162 MX53_PAD_PATA_DATA15__GPIO2_15 0x80000000
163 MX53_PAD_EIM_DA11__GPIO3_11 0x80000000
164 MX53_PAD_EIM_DA12__GPIO3_12 0x80000000
165 MX53_PAD_PATA_DA_0__GPIO7_6 0x80000000
166 MX53_PAD_PATA_DA_2__GPIO7_8 0x80000000
167 MX53_PAD_GPIO_16__GPIO7_11 0x80000000
168 >;
169 };
170
171 led_pin_gpio7_7: led_gpio7_7@0 {
172 fsl,pins = <
173 MX53_PAD_PATA_DA_1__GPIO7_7 0x80000000
174 >;
175 };
176
177 pinctrl_audmux: audmuxgrp {
178 fsl,pins = <
179 MX53_PAD_KEY_COL0__AUDMUX_AUD5_TXC 0x80000000
180 MX53_PAD_KEY_ROW0__AUDMUX_AUD5_TXD 0x80000000
181 MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS 0x80000000
182 MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD 0x80000000
183 >;
184 };
185
186 pinctrl_esdhc1: esdhc1grp {
187 fsl,pins = <
188 MX53_PAD_SD1_DATA0__ESDHC1_DAT0 0x1d5
189 MX53_PAD_SD1_DATA1__ESDHC1_DAT1 0x1d5
190 MX53_PAD_SD1_DATA2__ESDHC1_DAT2 0x1d5
191 MX53_PAD_SD1_DATA3__ESDHC1_DAT3 0x1d5
192 MX53_PAD_SD1_CMD__ESDHC1_CMD 0x1d5
193 MX53_PAD_SD1_CLK__ESDHC1_CLK 0x1d5
194 >;
195 };
196
197 pinctrl_esdhc3: esdhc3grp {
198 fsl,pins = <
199 MX53_PAD_PATA_DATA8__ESDHC3_DAT0 0x1d5
200 MX53_PAD_PATA_DATA9__ESDHC3_DAT1 0x1d5
201 MX53_PAD_PATA_DATA10__ESDHC3_DAT2 0x1d5
202 MX53_PAD_PATA_DATA11__ESDHC3_DAT3 0x1d5
203 MX53_PAD_PATA_DATA0__ESDHC3_DAT4 0x1d5
204 MX53_PAD_PATA_DATA1__ESDHC3_DAT5 0x1d5
205 MX53_PAD_PATA_DATA2__ESDHC3_DAT6 0x1d5
206 MX53_PAD_PATA_DATA3__ESDHC3_DAT7 0x1d5
207 MX53_PAD_PATA_RESET_B__ESDHC3_CMD 0x1d5
208 MX53_PAD_PATA_IORDY__ESDHC3_CLK 0x1d5
209 >;
210 };
211
212 pinctrl_fec: fecgrp {
213 fsl,pins = <
214 MX53_PAD_FEC_MDC__FEC_MDC 0x80000000
215 MX53_PAD_FEC_MDIO__FEC_MDIO 0x80000000
216 MX53_PAD_FEC_REF_CLK__FEC_TX_CLK 0x80000000
217 MX53_PAD_FEC_RX_ER__FEC_RX_ER 0x80000000
218 MX53_PAD_FEC_CRS_DV__FEC_RX_DV 0x80000000
219 MX53_PAD_FEC_RXD1__FEC_RDATA_1 0x80000000
220 MX53_PAD_FEC_RXD0__FEC_RDATA_0 0x80000000
221 MX53_PAD_FEC_TX_EN__FEC_TX_EN 0x80000000
222 MX53_PAD_FEC_TXD1__FEC_TDATA_1 0x80000000
223 MX53_PAD_FEC_TXD0__FEC_TDATA_0 0x80000000
224 >;
225 };
226
227 pinctrl_i2c1: i2c1grp {
228 fsl,pins = <
229 MX53_PAD_CSI0_DAT8__I2C1_SDA 0xc0000000
230 MX53_PAD_CSI0_DAT9__I2C1_SCL 0xc0000000
231 >;
232 };
233
234 pinctrl_i2c2: i2c2grp {
235 fsl,pins = <
236 MX53_PAD_KEY_ROW3__I2C2_SDA 0xc0000000
237 MX53_PAD_KEY_COL3__I2C2_SCL 0xc0000000
238 >;
239 };
240
241 pinctrl_ipu_disp0: ipudisp0grp {
242 fsl,pins = <
243 MX53_PAD_DI0_DISP_CLK__IPU_DI0_DISP_CLK 0x5
244 MX53_PAD_DI0_PIN15__IPU_DI0_PIN15 0x5
245 MX53_PAD_DI0_PIN2__IPU_DI0_PIN2 0x5
246 MX53_PAD_DI0_PIN3__IPU_DI0_PIN3 0x5
247 MX53_PAD_DISP0_DAT0__IPU_DISP0_DAT_0 0x5
248 MX53_PAD_DISP0_DAT1__IPU_DISP0_DAT_1 0x5
249 MX53_PAD_DISP0_DAT2__IPU_DISP0_DAT_2 0x5
250 MX53_PAD_DISP0_DAT3__IPU_DISP0_DAT_3 0x5
251 MX53_PAD_DISP0_DAT4__IPU_DISP0_DAT_4 0x5
252 MX53_PAD_DISP0_DAT5__IPU_DISP0_DAT_5 0x5
253 MX53_PAD_DISP0_DAT6__IPU_DISP0_DAT_6 0x5
254 MX53_PAD_DISP0_DAT7__IPU_DISP0_DAT_7 0x5
255 MX53_PAD_DISP0_DAT8__IPU_DISP0_DAT_8 0x5
256 MX53_PAD_DISP0_DAT9__IPU_DISP0_DAT_9 0x5
257 MX53_PAD_DISP0_DAT10__IPU_DISP0_DAT_10 0x5
258 MX53_PAD_DISP0_DAT11__IPU_DISP0_DAT_11 0x5
259 MX53_PAD_DISP0_DAT12__IPU_DISP0_DAT_12 0x5
260 MX53_PAD_DISP0_DAT13__IPU_DISP0_DAT_13 0x5
261 MX53_PAD_DISP0_DAT14__IPU_DISP0_DAT_14 0x5
262 MX53_PAD_DISP0_DAT15__IPU_DISP0_DAT_15 0x5
263 MX53_PAD_DISP0_DAT16__IPU_DISP0_DAT_16 0x5
264 MX53_PAD_DISP0_DAT17__IPU_DISP0_DAT_17 0x5
265 MX53_PAD_DISP0_DAT18__IPU_DISP0_DAT_18 0x5
266 MX53_PAD_DISP0_DAT19__IPU_DISP0_DAT_19 0x5
267 MX53_PAD_DISP0_DAT20__IPU_DISP0_DAT_20 0x5
268 MX53_PAD_DISP0_DAT21__IPU_DISP0_DAT_21 0x5
269 MX53_PAD_DISP0_DAT22__IPU_DISP0_DAT_22 0x5
270 MX53_PAD_DISP0_DAT23__IPU_DISP0_DAT_23 0x5
271 >;
272 };
273
274 pinctrl_uart1: uart1grp {
275 fsl,pins = <
276 MX53_PAD_CSI0_DAT10__UART1_TXD_MUX 0x1e4
277 MX53_PAD_CSI0_DAT11__UART1_RXD_MUX 0x1e4
278 >;
279 };
280 };
281};
282
283&uart1 {
284 pinctrl-names = "default";
285 pinctrl-0 = <&pinctrl_uart1>;
286 status = "okay";
287};
288
289&i2c2 {
290 pinctrl-names = "default";
291 pinctrl-0 = <&pinctrl_i2c2>;
292 status = "okay";
293
294 sgtl5000: codec@0a {
295 compatible = "fsl,sgtl5000";
296 reg = <0x0a>;
297 VDDA-supply = <&reg_3p2v>;
298 VDDIO-supply = <&reg_3p2v>;
299 clocks = <&clks IMX5_CLK_SSI_EXT1_GATE>;
300 };
301};
302
303&i2c1 {
304 pinctrl-names = "default";
305 pinctrl-0 = <&pinctrl_i2c1>;
306 status = "okay";
307
308 accelerometer: mma8450@1c {
309 compatible = "fsl,mma8450";
310 reg = <0x1c>;
311 };
312};
313
314&audmux {
315 pinctrl-names = "default";
316 pinctrl-0 = <&pinctrl_audmux>;
317 status = "okay";
318};
319
320&fec {
321 pinctrl-names = "default";
322 pinctrl-0 = <&pinctrl_fec>;
323 phy-mode = "rmii";
324 phy-reset-gpios = <&gpio7 6 0>;
325 status = "okay";
326};
327
328&sata {
329 status = "okay";
330};
331
332&vpu {
333 status = "okay";
334};
335
336&usbh1 {
337 vbus-supply = <&reg_usb_vbus>;
338 phy_type = "utmi";
339 status = "okay";
340};
341
342&usbotg {
343 dr_mode = "peripheral";
344 status = "okay";
345};
diff --git a/arch/arm/boot/dts/imx53-qsb.dts b/arch/arm/boot/dts/imx53-qsb.dts
index 91a5935a4aac..dec4b073ceb1 100644
--- a/arch/arm/boot/dts/imx53-qsb.dts
+++ b/arch/arm/boot/dts/imx53-qsb.dts
@@ -11,193 +11,14 @@
11 */ 11 */
12 12
13/dts-v1/; 13/dts-v1/;
14#include "imx53.dtsi" 14#include "imx53-qsb-common.dtsi"
15 15
16/ { 16/ {
17 model = "Freescale i.MX53 Quick Start Board"; 17 model = "Freescale i.MX53 Quick Start Board";
18 compatible = "fsl,imx53-qsb", "fsl,imx53"; 18 compatible = "fsl,imx53-qsb", "fsl,imx53";
19
20 memory {
21 reg = <0x70000000 0x40000000>;
22 };
23
24 display@di0 {
25 compatible = "fsl,imx-parallel-display";
26 crtcs = <&ipu 0>;
27 interface-pix-fmt = "rgb565";
28 pinctrl-names = "default";
29 pinctrl-0 = <&pinctrl_ipu_disp0_1>;
30 status = "disabled";
31 display-timings {
32 claawvga {
33 native-mode;
34 clock-frequency = <27000000>;
35 hactive = <800>;
36 vactive = <480>;
37 hback-porch = <40>;
38 hfront-porch = <60>;
39 vback-porch = <10>;
40 vfront-porch = <10>;
41 hsync-len = <20>;
42 vsync-len = <10>;
43 hsync-active = <0>;
44 vsync-active = <0>;
45 de-active = <1>;
46 pixelclk-active = <0>;
47 };
48 };
49 };
50
51 gpio-keys {
52 compatible = "gpio-keys";
53
54 power {
55 label = "Power Button";
56 gpios = <&gpio1 8 0>;
57 linux,code = <116>; /* KEY_POWER */
58 };
59
60 volume-up {
61 label = "Volume Up";
62 gpios = <&gpio2 14 0>;
63 linux,code = <115>; /* KEY_VOLUMEUP */
64 gpio-key,wakeup;
65 };
66
67 volume-down {
68 label = "Volume Down";
69 gpios = <&gpio2 15 0>;
70 linux,code = <114>; /* KEY_VOLUMEDOWN */
71 gpio-key,wakeup;
72 };
73 };
74
75 leds {
76 compatible = "gpio-leds";
77 pinctrl-names = "default";
78 pinctrl-0 = <&led_pin_gpio7_7>;
79
80 user {
81 label = "Heartbeat";
82 gpios = <&gpio7 7 0>;
83 linux,default-trigger = "heartbeat";
84 };
85 };
86
87 regulators {
88 compatible = "simple-bus";
89
90 reg_3p2v: 3p2v {
91 compatible = "regulator-fixed";
92 regulator-name = "3P2V";
93 regulator-min-microvolt = <3200000>;
94 regulator-max-microvolt = <3200000>;
95 regulator-always-on;
96 };
97
98 reg_usb_vbus: usb_vbus {
99 compatible = "regulator-fixed";
100 regulator-name = "usb_vbus";
101 regulator-min-microvolt = <5000000>;
102 regulator-max-microvolt = <5000000>;
103 gpio = <&gpio7 8 0>;
104 enable-active-high;
105 };
106 };
107
108 sound {
109 compatible = "fsl,imx53-qsb-sgtl5000",
110 "fsl,imx-audio-sgtl5000";
111 model = "imx53-qsb-sgtl5000";
112 ssi-controller = <&ssi2>;
113 audio-codec = <&sgtl5000>;
114 audio-routing =
115 "MIC_IN", "Mic Jack",
116 "Mic Jack", "Mic Bias",
117 "Headphone Jack", "HP_OUT";
118 mux-int-port = <2>;
119 mux-ext-port = <5>;
120 };
121};
122
123&esdhc1 {
124 pinctrl-names = "default";
125 pinctrl-0 = <&pinctrl_esdhc1_1>;
126 status = "okay";
127};
128
129&ssi2 {
130 fsl,mode = "i2s-slave";
131 status = "okay";
132};
133
134&esdhc3 {
135 pinctrl-names = "default";
136 pinctrl-0 = <&pinctrl_esdhc3_1>;
137 cd-gpios = <&gpio3 11 0>;
138 wp-gpios = <&gpio3 12 0>;
139 bus-width = <8>;
140 status = "okay";
141};
142
143&iomuxc {
144 pinctrl-names = "default";
145 pinctrl-0 = <&pinctrl_hog>;
146
147 hog {
148 pinctrl_hog: hoggrp {
149 fsl,pins = <
150 MX53_PAD_GPIO_0__CCM_SSI_EXT1_CLK 0x80000000
151 MX53_PAD_GPIO_8__GPIO1_8 0x80000000
152 MX53_PAD_PATA_DATA14__GPIO2_14 0x80000000
153 MX53_PAD_PATA_DATA15__GPIO2_15 0x80000000
154 MX53_PAD_EIM_DA11__GPIO3_11 0x80000000
155 MX53_PAD_EIM_DA12__GPIO3_12 0x80000000
156 MX53_PAD_PATA_DA_0__GPIO7_6 0x80000000
157 MX53_PAD_PATA_DA_2__GPIO7_8 0x80000000
158 MX53_PAD_GPIO_16__GPIO7_11 0x80000000
159 >;
160 };
161
162 led_pin_gpio7_7: led_gpio7_7@0 {
163 fsl,pins = <
164 MX53_PAD_PATA_DA_1__GPIO7_7 0x80000000
165 >;
166 };
167 };
168
169};
170
171&uart1 {
172 pinctrl-names = "default";
173 pinctrl-0 = <&pinctrl_uart1_1>;
174 status = "okay";
175};
176
177&i2c2 {
178 pinctrl-names = "default";
179 pinctrl-0 = <&pinctrl_i2c2_1>;
180 status = "okay";
181
182 sgtl5000: codec@0a {
183 compatible = "fsl,sgtl5000";
184 reg = <0x0a>;
185 VDDA-supply = <&reg_3p2v>;
186 VDDIO-supply = <&reg_3p2v>;
187 clocks = <&clks 150>;
188 };
189}; 19};
190 20
191&i2c1 { 21&i2c1 {
192 pinctrl-names = "default";
193 pinctrl-0 = <&pinctrl_i2c1_1>;
194 status = "okay";
195
196 accelerometer: mma8450@1c {
197 compatible = "fsl,mma8450";
198 reg = <0x1c>;
199 };
200
201 pmic: dialog@48 { 22 pmic: dialog@48 {
202 compatible = "dlg,da9053-aa", "dlg,da9052"; 23 compatible = "dlg,da9053-aa", "dlg,da9052";
203 reg = <0x48>; 24 reg = <0x48>;
@@ -292,32 +113,3 @@
292 }; 113 };
293 }; 114 };
294}; 115};
295
296&audmux {
297 pinctrl-names = "default";
298 pinctrl-0 = <&pinctrl_audmux_1>;
299 status = "okay";
300};
301
302&fec {
303 pinctrl-names = "default";
304 pinctrl-0 = <&pinctrl_fec_1>;
305 phy-mode = "rmii";
306 phy-reset-gpios = <&gpio7 6 0>;
307 status = "okay";
308};
309
310&vpu {
311 status = "okay";
312};
313
314&usbh1 {
315 vbus-supply = <&reg_usb_vbus>;
316 phy_type = "utmi";
317 status = "okay";
318};
319
320&usbotg {
321 dr_mode = "peripheral";
322 status = "okay";
323};
diff --git a/arch/arm/boot/dts/imx53-qsrb.dts b/arch/arm/boot/dts/imx53-qsrb.dts
new file mode 100644
index 000000000000..f1bbf9a32991
--- /dev/null
+++ b/arch/arm/boot/dts/imx53-qsrb.dts
@@ -0,0 +1,158 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc.
3 * Copyright 2011 Linaro Ltd.
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/dts-v1/;
14
15#include "imx53-qsb-common.dtsi"
16
17/ {
18 model = "Freescale i.MX53 Quick Start-R Board";
19 compatible = "fsl,imx53-qsrb", "fsl,imx53";
20};
21
22&iomuxc {
23 i2c1 {
24 /* open drain */
25 pinctrl_i2c1_qsrb: i2c1grp-1 {
26 fsl,pins = <
27 MX53_PAD_CSI0_DAT8__I2C1_SDA 0x400001ec
28 MX53_PAD_CSI0_DAT9__I2C1_SCL 0x400001ec
29 >;
30 };
31 };
32};
33
34&i2c1 {
35 pinctrl-names = "default";
36 pinctrl-0 = <&pinctrl_i2c1_qsrb>;
37 status = "okay";
38
39 pmic: mc34708@8 {
40 compatible = "fsl,mc34708";
41 reg = <0x08>;
42 interrupt-parent = <&gpio5>;
43 interrupts = <23 0x8>;
44 regulators {
45 sw1_reg: sw1a {
46 regulator-name = "SW1";
47 regulator-min-microvolt = <650000>;
48 regulator-max-microvolt = <1437500>;
49 regulator-boot-on;
50 regulator-always-on;
51 };
52
53 sw1b_reg: sw1b {
54 regulator-name = "SW1B";
55 regulator-min-microvolt = <650000>;
56 regulator-max-microvolt = <1437500>;
57 regulator-boot-on;
58 regulator-always-on;
59 };
60
61 sw2_reg: sw2 {
62 regulator-name = "SW2";
63 regulator-min-microvolt = <650000>;
64 regulator-max-microvolt = <1437500>;
65 regulator-boot-on;
66 regulator-always-on;
67 };
68
69 sw3_reg: sw3 {
70 regulator-name = "SW3";
71 regulator-min-microvolt = <650000>;
72 regulator-max-microvolt = <1425000>;
73 regulator-boot-on;
74 };
75
76 sw4a_reg: sw4a {
77 regulator-name = "SW4A";
78 regulator-min-microvolt = <1200000>;
79 regulator-max-microvolt = <3300000>;
80 regulator-boot-on;
81 regulator-always-on;
82 };
83
84 sw4b_reg: sw4b {
85 regulator-name = "SW4B";
86 regulator-min-microvolt = <1200000>;
87 regulator-max-microvolt = <3300000>;
88 regulator-boot-on;
89 regulator-always-on;
90 };
91
92 sw5_reg: sw5 {
93 regulator-name = "SW5";
94 regulator-min-microvolt = <1200000>;
95 regulator-max-microvolt = <1975000>;
96 regulator-boot-on;
97 regulator-always-on;
98 };
99
100 swbst_reg: swbst {
101 regulator-name = "SWBST";
102 regulator-boot-on;
103 regulator-always-on;
104 };
105
106 vpll_reg: vpll {
107 regulator-name = "VPLL";
108 regulator-min-microvolt = <1200000>;
109 regulator-max-microvolt = <1800000>;
110 regulator-boot-on;
111 };
112
113 vrefddr_reg: vrefddr {
114 regulator-name = "VREFDDR";
115 regulator-boot-on;
116 regulator-always-on;
117 };
118
119 vusb_reg: vusb {
120 regulator-name = "VUSB";
121 regulator-boot-on;
122 regulator-always-on;
123 };
124
125 vusb2_reg: vusb2 {
126 regulator-name = "VUSB2";
127 regulator-min-microvolt = <2500000>;
128 regulator-max-microvolt = <3000000>;
129 regulator-boot-on;
130 regulator-always-on;
131 };
132
133 vdac_reg: vdac {
134 regulator-name = "VDAC";
135 regulator-min-microvolt = <2500000>;
136 regulator-max-microvolt = <2775000>;
137 regulator-boot-on;
138 regulator-always-on;
139 };
140
141 vgen1_reg: vgen1 {
142 regulator-name = "VGEN1";
143 regulator-min-microvolt = <1200000>;
144 regulator-max-microvolt = <1550000>;
145 regulator-boot-on;
146 regulator-always-on;
147 };
148
149 vgen2_reg: vgen2 {
150 regulator-name = "VGEN2";
151 regulator-min-microvolt = <2500000>;
152 regulator-max-microvolt = <3300000>;
153 regulator-boot-on;
154 regulator-always-on;
155 };
156 };
157 };
158};
diff --git a/arch/arm/boot/dts/imx53-smd.dts b/arch/arm/boot/dts/imx53-smd.dts
index a9b6e10de0a5..5ec1590ff7bc 100644
--- a/arch/arm/boot/dts/imx53-smd.dts
+++ b/arch/arm/boot/dts/imx53-smd.dts
@@ -40,7 +40,7 @@
40 40
41&esdhc1 { 41&esdhc1 {
42 pinctrl-names = "default"; 42 pinctrl-names = "default";
43 pinctrl-0 = <&pinctrl_esdhc1_1>; 43 pinctrl-0 = <&pinctrl_esdhc1>;
44 cd-gpios = <&gpio3 13 0>; 44 cd-gpios = <&gpio3 13 0>;
45 wp-gpios = <&gpio4 11 0>; 45 wp-gpios = <&gpio4 11 0>;
46 status = "okay"; 46 status = "okay";
@@ -48,21 +48,21 @@
48 48
49&esdhc2 { 49&esdhc2 {
50 pinctrl-names = "default"; 50 pinctrl-names = "default";
51 pinctrl-0 = <&pinctrl_esdhc2_1>; 51 pinctrl-0 = <&pinctrl_esdhc2>;
52 non-removable; 52 non-removable;
53 status = "okay"; 53 status = "okay";
54}; 54};
55 55
56&uart3 { 56&uart3 {
57 pinctrl-names = "default"; 57 pinctrl-names = "default";
58 pinctrl-0 = <&pinctrl_uart3_1>; 58 pinctrl-0 = <&pinctrl_uart3>;
59 fsl,uart-has-rtscts; 59 fsl,uart-has-rtscts;
60 status = "okay"; 60 status = "okay";
61}; 61};
62 62
63&ecspi1 { 63&ecspi1 {
64 pinctrl-names = "default"; 64 pinctrl-names = "default";
65 pinctrl-0 = <&pinctrl_ecspi1_1>; 65 pinctrl-0 = <&pinctrl_ecspi1>;
66 fsl,spi-num-chipselects = <2>; 66 fsl,spi-num-chipselects = <2>;
67 cs-gpios = <&gpio2 30 0>, <&gpio3 19 0>; 67 cs-gpios = <&gpio2 30 0>, <&gpio3 19 0>;
68 status = "okay"; 68 status = "okay";
@@ -95,7 +95,7 @@
95 95
96&esdhc3 { 96&esdhc3 {
97 pinctrl-names = "default"; 97 pinctrl-names = "default";
98 pinctrl-0 = <&pinctrl_esdhc3_1>; 98 pinctrl-0 = <&pinctrl_esdhc3>;
99 non-removable; 99 non-removable;
100 status = "okay"; 100 status = "okay";
101}; 101};
@@ -104,7 +104,7 @@
104 pinctrl-names = "default"; 104 pinctrl-names = "default";
105 pinctrl-0 = <&pinctrl_hog>; 105 pinctrl-0 = <&pinctrl_hog>;
106 106
107 hog { 107 imx53-smd {
108 pinctrl_hog: hoggrp { 108 pinctrl_hog: hoggrp {
109 fsl,pins = < 109 fsl,pins = <
110 MX53_PAD_PATA_DATA14__GPIO2_14 0x80000000 110 MX53_PAD_PATA_DATA14__GPIO2_14 0x80000000
@@ -116,24 +116,121 @@
116 MX53_PAD_PATA_DA_0__GPIO7_6 0x80000000 116 MX53_PAD_PATA_DA_0__GPIO7_6 0x80000000
117 >; 117 >;
118 }; 118 };
119
120 pinctrl_ecspi1: ecspi1grp {
121 fsl,pins = <
122 MX53_PAD_EIM_D16__ECSPI1_SCLK 0x80000000
123 MX53_PAD_EIM_D17__ECSPI1_MISO 0x80000000
124 MX53_PAD_EIM_D18__ECSPI1_MOSI 0x80000000
125 >;
126 };
127
128 pinctrl_esdhc1: esdhc1grp {
129 fsl,pins = <
130 MX53_PAD_SD1_DATA0__ESDHC1_DAT0 0x1d5
131 MX53_PAD_SD1_DATA1__ESDHC1_DAT1 0x1d5
132 MX53_PAD_SD1_DATA2__ESDHC1_DAT2 0x1d5
133 MX53_PAD_SD1_DATA3__ESDHC1_DAT3 0x1d5
134 MX53_PAD_SD1_CMD__ESDHC1_CMD 0x1d5
135 MX53_PAD_SD1_CLK__ESDHC1_CLK 0x1d5
136 >;
137 };
138
139 pinctrl_esdhc2: esdhc2grp {
140 fsl,pins = <
141 MX53_PAD_SD2_CMD__ESDHC2_CMD 0x1d5
142 MX53_PAD_SD2_CLK__ESDHC2_CLK 0x1d5
143 MX53_PAD_SD2_DATA0__ESDHC2_DAT0 0x1d5
144 MX53_PAD_SD2_DATA1__ESDHC2_DAT1 0x1d5
145 MX53_PAD_SD2_DATA2__ESDHC2_DAT2 0x1d5
146 MX53_PAD_SD2_DATA3__ESDHC2_DAT3 0x1d5
147 >;
148 };
149
150 pinctrl_esdhc3: esdhc3grp {
151 fsl,pins = <
152 MX53_PAD_PATA_DATA8__ESDHC3_DAT0 0x1d5
153 MX53_PAD_PATA_DATA9__ESDHC3_DAT1 0x1d5
154 MX53_PAD_PATA_DATA10__ESDHC3_DAT2 0x1d5
155 MX53_PAD_PATA_DATA11__ESDHC3_DAT3 0x1d5
156 MX53_PAD_PATA_DATA0__ESDHC3_DAT4 0x1d5
157 MX53_PAD_PATA_DATA1__ESDHC3_DAT5 0x1d5
158 MX53_PAD_PATA_DATA2__ESDHC3_DAT6 0x1d5
159 MX53_PAD_PATA_DATA3__ESDHC3_DAT7 0x1d5
160 MX53_PAD_PATA_RESET_B__ESDHC3_CMD 0x1d5
161 MX53_PAD_PATA_IORDY__ESDHC3_CLK 0x1d5
162 >;
163 };
164
165 pinctrl_fec: fecgrp {
166 fsl,pins = <
167 MX53_PAD_FEC_MDC__FEC_MDC 0x80000000
168 MX53_PAD_FEC_MDIO__FEC_MDIO 0x80000000
169 MX53_PAD_FEC_REF_CLK__FEC_TX_CLK 0x80000000
170 MX53_PAD_FEC_RX_ER__FEC_RX_ER 0x80000000
171 MX53_PAD_FEC_CRS_DV__FEC_RX_DV 0x80000000
172 MX53_PAD_FEC_RXD1__FEC_RDATA_1 0x80000000
173 MX53_PAD_FEC_RXD0__FEC_RDATA_0 0x80000000
174 MX53_PAD_FEC_TX_EN__FEC_TX_EN 0x80000000
175 MX53_PAD_FEC_TXD1__FEC_TDATA_1 0x80000000
176 MX53_PAD_FEC_TXD0__FEC_TDATA_0 0x80000000
177 >;
178 };
179
180 pinctrl_i2c1: i2c1grp {
181 fsl,pins = <
182 MX53_PAD_CSI0_DAT8__I2C1_SDA 0xc0000000
183 MX53_PAD_CSI0_DAT9__I2C1_SCL 0xc0000000
184 >;
185 };
186
187 pinctrl_i2c2: i2c2grp {
188 fsl,pins = <
189 MX53_PAD_KEY_ROW3__I2C2_SDA 0xc0000000
190 MX53_PAD_KEY_COL3__I2C2_SCL 0xc0000000
191 >;
192 };
193
194 pinctrl_uart1: uart1grp {
195 fsl,pins = <
196 MX53_PAD_CSI0_DAT10__UART1_TXD_MUX 0x1e4
197 MX53_PAD_CSI0_DAT11__UART1_RXD_MUX 0x1e4
198 >;
199 };
200
201 pinctrl_uart2: uart2grp {
202 fsl,pins = <
203 MX53_PAD_PATA_BUFFER_EN__UART2_RXD_MUX 0x1e4
204 MX53_PAD_PATA_DMARQ__UART2_TXD_MUX 0x1e4
205 >;
206 };
207
208 pinctrl_uart3: uart3grp {
209 fsl,pins = <
210 MX53_PAD_PATA_CS_0__UART3_TXD_MUX 0x1e4
211 MX53_PAD_PATA_CS_1__UART3_RXD_MUX 0x1e4
212 MX53_PAD_PATA_DA_1__UART3_CTS 0x1e4
213 MX53_PAD_PATA_DA_2__UART3_RTS 0x1e4
214 >;
215 };
119 }; 216 };
120}; 217};
121 218
122&uart1 { 219&uart1 {
123 pinctrl-names = "default"; 220 pinctrl-names = "default";
124 pinctrl-0 = <&pinctrl_uart1_1>; 221 pinctrl-0 = <&pinctrl_uart1>;
125 status = "okay"; 222 status = "okay";
126}; 223};
127 224
128&uart2 { 225&uart2 {
129 pinctrl-names = "default"; 226 pinctrl-names = "default";
130 pinctrl-0 = <&pinctrl_uart2_1>; 227 pinctrl-0 = <&pinctrl_uart2>;
131 status = "okay"; 228 status = "okay";
132}; 229};
133 230
134&i2c2 { 231&i2c2 {
135 pinctrl-names = "default"; 232 pinctrl-names = "default";
136 pinctrl-0 = <&pinctrl_i2c2_1>; 233 pinctrl-0 = <&pinctrl_i2c2>;
137 status = "okay"; 234 status = "okay";
138 235
139 codec: sgtl5000@0a { 236 codec: sgtl5000@0a {
@@ -154,7 +251,7 @@
154 251
155&i2c1 { 252&i2c1 {
156 pinctrl-names = "default"; 253 pinctrl-names = "default";
157 pinctrl-0 = <&pinctrl_i2c1_1>; 254 pinctrl-0 = <&pinctrl_i2c1>;
158 status = "okay"; 255 status = "okay";
159 256
160 accelerometer: mma8450@1c { 257 accelerometer: mma8450@1c {
@@ -175,7 +272,7 @@
175 272
176&fec { 273&fec {
177 pinctrl-names = "default"; 274 pinctrl-names = "default";
178 pinctrl-0 = <&pinctrl_fec_1>; 275 pinctrl-0 = <&pinctrl_fec>;
179 phy-mode = "rmii"; 276 phy-mode = "rmii";
180 phy-reset-gpios = <&gpio7 6 0>; 277 phy-reset-gpios = <&gpio7 6 0>;
181 status = "okay"; 278 status = "okay";
diff --git a/arch/arm/boot/dts/imx53-tqma53.dtsi b/arch/arm/boot/dts/imx53-tqma53.dtsi
index abd72af545bf..4f1f0e2868bf 100644
--- a/arch/arm/boot/dts/imx53-tqma53.dtsi
+++ b/arch/arm/boot/dts/imx53-tqma53.dtsi
@@ -22,9 +22,12 @@
22 22
23 regulators { 23 regulators {
24 compatible = "simple-bus"; 24 compatible = "simple-bus";
25 #address-cells = <1>;
26 #size-cells = <0>;
25 27
26 reg_3p3v: 3p3v { 28 reg_3p3v: regulator@0 {
27 compatible = "regulator-fixed"; 29 compatible = "regulator-fixed";
30 reg = <0>;
28 regulator-name = "3P3V"; 31 regulator-name = "3P3V";
29 regulator-min-microvolt = <3300000>; 32 regulator-min-microvolt = <3300000>;
30 regulator-max-microvolt = <3300000>; 33 regulator-max-microvolt = <3300000>;
@@ -35,8 +38,8 @@
35 38
36&esdhc2 { 39&esdhc2 {
37 pinctrl-names = "default"; 40 pinctrl-names = "default";
38 pinctrl-0 = <&pinctrl_esdhc2_1>, 41 pinctrl-0 = <&pinctrl_esdhc2>,
39 <&pinctrl_tqma53_esdhc2_2>; 42 <&pinctrl_esdhc2_cdwp>;
40 vmmc-supply = <&reg_3p3v>; 43 vmmc-supply = <&reg_3p3v>;
41 wp-gpios = <&gpio1 2 0>; 44 wp-gpios = <&gpio1 2 0>;
42 cd-gpios = <&gpio1 4 0>; 45 cd-gpios = <&gpio1 4 0>;
@@ -45,13 +48,13 @@
45 48
46&uart3 { 49&uart3 {
47 pinctrl-names = "default"; 50 pinctrl-names = "default";
48 pinctrl-0 = <&pinctrl_uart3_2>; 51 pinctrl-0 = <&pinctrl_uart3>;
49 status = "disabled"; 52 status = "disabled";
50}; 53};
51 54
52&ecspi1 { 55&ecspi1 {
53 pinctrl-names = "default"; 56 pinctrl-names = "default";
54 pinctrl-0 = <&pinctrl_ecspi1_1>; 57 pinctrl-0 = <&pinctrl_ecspi1>;
55 fsl,spi-num-chipselects = <4>; 58 fsl,spi-num-chipselects = <4>;
56 cs-gpios = <&gpio2 30 0>, <&gpio3 19 0>, 59 cs-gpios = <&gpio2 30 0>, <&gpio3 19 0>,
57 <&gpio3 24 0>, <&gpio3 25 0>; 60 <&gpio3 24 0>, <&gpio3 25 0>;
@@ -60,7 +63,7 @@
60 63
61&esdhc3 { /* EMMC */ 64&esdhc3 { /* EMMC */
62 pinctrl-names = "default"; 65 pinctrl-names = "default";
63 pinctrl-0 = <&pinctrl_esdhc3_1>; 66 pinctrl-0 = <&pinctrl_esdhc3>;
64 vmmc-supply = <&reg_3p3v>; 67 vmmc-supply = <&reg_3p3v>;
65 non-removable; 68 non-removable;
66 bus-width = <8>; 69 bus-width = <8>;
@@ -71,27 +74,7 @@
71 pinctrl-names = "default"; 74 pinctrl-names = "default";
72 pinctrl-0 = <&pinctrl_hog>; 75 pinctrl-0 = <&pinctrl_hog>;
73 76
74 esdhc2_2 { 77 imx53-tqma53 {
75 pinctrl_tqma53_esdhc2_2: esdhc2-tqma53-grp2 {
76 fsl,pins = <
77 MX53_PAD_GPIO_4__GPIO1_4 0x80000000 /* SD2_CD */
78 MX53_PAD_GPIO_2__GPIO1_2 0x80000000 /* SD2_WP */
79 >;
80 };
81 };
82
83 i2s {
84 pinctrl_i2s_1: i2s-grp1 {
85 fsl,pins = <
86 MX53_PAD_KEY_COL0__AUDMUX_AUD5_TXC 0x80000000 /* I2S_SCLK */
87 MX53_PAD_KEY_ROW0__AUDMUX_AUD5_TXD 0x80000000 /* I2S_DOUT */
88 MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS 0x80000000 /* I2S_LRCLK */
89 MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD 0x80000000 /* I2S_DIN */
90 >;
91 };
92 };
93
94 hog {
95 pinctrl_hog: hoggrp { 78 pinctrl_hog: hoggrp {
96 fsl,pins = < 79 fsl,pins = <
97 MX53_PAD_GPIO_0__CCM_SSI_EXT1_CLK 0x80000000 /* SSI_MCLK */ 80 MX53_PAD_GPIO_0__CCM_SSI_EXT1_CLK 0x80000000 /* SSI_MCLK */
@@ -107,43 +90,165 @@
107 MX53_PAD_GPIO_1__PWM2_PWMO 0x80000000 /* LCD_CONTRAST */ 90 MX53_PAD_GPIO_1__PWM2_PWMO 0x80000000 /* LCD_CONTRAST */
108 >; 91 >;
109 }; 92 };
93
94 pinctrl_audmux: audmuxgrp {
95 fsl,pins = <
96 MX53_PAD_KEY_COL0__AUDMUX_AUD5_TXC 0x80000000
97 MX53_PAD_KEY_ROW0__AUDMUX_AUD5_TXD 0x80000000
98 MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS 0x80000000
99 MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD 0x80000000
100 >;
101 };
102
103 pinctrl_can1: can1grp {
104 fsl,pins = <
105 MX53_PAD_KEY_COL2__CAN1_TXCAN 0x80000000
106 MX53_PAD_KEY_ROW2__CAN1_RXCAN 0x80000000
107 >;
108 };
109
110 pinctrl_can2: can2grp {
111 fsl,pins = <
112 MX53_PAD_KEY_COL4__CAN2_TXCAN 0x80000000
113 MX53_PAD_KEY_ROW4__CAN2_RXCAN 0x80000000
114 >;
115 };
116
117 pinctrl_cspi: cspigrp {
118 fsl,pins = <
119 MX53_PAD_SD1_DATA0__CSPI_MISO 0x1d5
120 MX53_PAD_SD1_CMD__CSPI_MOSI 0x1d5
121 MX53_PAD_SD1_CLK__CSPI_SCLK 0x1d5
122 >;
123 };
124
125 pinctrl_ecspi1: ecspi1grp {
126 fsl,pins = <
127 MX53_PAD_EIM_D16__ECSPI1_SCLK 0x80000000
128 MX53_PAD_EIM_D17__ECSPI1_MISO 0x80000000
129 MX53_PAD_EIM_D18__ECSPI1_MOSI 0x80000000
130 >;
131 };
132
133 pinctrl_esdhc2: esdhc2grp {
134 fsl,pins = <
135 MX53_PAD_SD2_CMD__ESDHC2_CMD 0x1d5
136 MX53_PAD_SD2_CLK__ESDHC2_CLK 0x1d5
137 MX53_PAD_SD2_DATA0__ESDHC2_DAT0 0x1d5
138 MX53_PAD_SD2_DATA1__ESDHC2_DAT1 0x1d5
139 MX53_PAD_SD2_DATA2__ESDHC2_DAT2 0x1d5
140 MX53_PAD_SD2_DATA3__ESDHC2_DAT3 0x1d5
141 >;
142 };
143
144 pinctrl_esdhc2_cdwp: esdhc2cdwp {
145 fsl,pins = <
146 MX53_PAD_GPIO_4__GPIO1_4 0x80000000 /* SD2_CD */
147 MX53_PAD_GPIO_2__GPIO1_2 0x80000000 /* SD2_WP */
148 >;
149 };
150
151 pinctrl_esdhc3: esdhc3grp {
152 fsl,pins = <
153 MX53_PAD_PATA_DATA8__ESDHC3_DAT0 0x1d5
154 MX53_PAD_PATA_DATA9__ESDHC3_DAT1 0x1d5
155 MX53_PAD_PATA_DATA10__ESDHC3_DAT2 0x1d5
156 MX53_PAD_PATA_DATA11__ESDHC3_DAT3 0x1d5
157 MX53_PAD_PATA_DATA0__ESDHC3_DAT4 0x1d5
158 MX53_PAD_PATA_DATA1__ESDHC3_DAT5 0x1d5
159 MX53_PAD_PATA_DATA2__ESDHC3_DAT6 0x1d5
160 MX53_PAD_PATA_DATA3__ESDHC3_DAT7 0x1d5
161 MX53_PAD_PATA_RESET_B__ESDHC3_CMD 0x1d5
162 MX53_PAD_PATA_IORDY__ESDHC3_CLK 0x1d5
163 >;
164 };
165
166 pinctrl_fec: fecgrp {
167 fsl,pins = <
168 MX53_PAD_FEC_MDC__FEC_MDC 0x80000000
169 MX53_PAD_FEC_MDIO__FEC_MDIO 0x80000000
170 MX53_PAD_FEC_REF_CLK__FEC_TX_CLK 0x80000000
171 MX53_PAD_FEC_RX_ER__FEC_RX_ER 0x80000000
172 MX53_PAD_FEC_CRS_DV__FEC_RX_DV 0x80000000
173 MX53_PAD_FEC_RXD1__FEC_RDATA_1 0x80000000
174 MX53_PAD_FEC_RXD0__FEC_RDATA_0 0x80000000
175 MX53_PAD_FEC_TX_EN__FEC_TX_EN 0x80000000
176 MX53_PAD_FEC_TXD1__FEC_TDATA_1 0x80000000
177 MX53_PAD_FEC_TXD0__FEC_TDATA_0 0x80000000
178 >;
179 };
180
181 pinctrl_i2c2: i2c2grp {
182 fsl,pins = <
183 MX53_PAD_KEY_ROW3__I2C2_SDA 0xc0000000
184 MX53_PAD_KEY_COL3__I2C2_SCL 0xc0000000
185 >;
186 };
187
188 pinctrl_i2c3: i2c3grp {
189 fsl,pins = <
190 MX53_PAD_GPIO_6__I2C3_SDA 0xc0000000
191 MX53_PAD_GPIO_5__I2C3_SCL 0xc0000000
192 >;
193 };
194
195 pinctrl_uart1: uart1grp {
196 fsl,pins = <
197 MX53_PAD_PATA_DIOW__UART1_TXD_MUX 0x1e4
198 MX53_PAD_PATA_DMACK__UART1_RXD_MUX 0x1e4
199 >;
200 };
201
202 pinctrl_uart2: uart2grp {
203 fsl,pins = <
204 MX53_PAD_PATA_BUFFER_EN__UART2_RXD_MUX 0x1e4
205 MX53_PAD_PATA_DMARQ__UART2_TXD_MUX 0x1e4
206 >;
207 };
208
209 pinctrl_uart3: uart3grp {
210 fsl,pins = <
211 MX53_PAD_PATA_CS_0__UART3_TXD_MUX 0x1e4
212 MX53_PAD_PATA_CS_1__UART3_RXD_MUX 0x1e4
213 >;
214 };
110 }; 215 };
111}; 216};
112 217
113&uart1 { 218&uart1 {
114 pinctrl-names = "default"; 219 pinctrl-names = "default";
115 pinctrl-0 = <&pinctrl_uart1_2>; 220 pinctrl-0 = <&pinctrl_uart1>;
116 fsl,uart-has-rtscts; 221 fsl,uart-has-rtscts;
117 status = "disabled"; 222 status = "disabled";
118}; 223};
119 224
120&uart2 { 225&uart2 {
121 pinctrl-names = "default"; 226 pinctrl-names = "default";
122 pinctrl-0 = <&pinctrl_uart2_1>; 227 pinctrl-0 = <&pinctrl_uart2>;
123 status = "disabled"; 228 status = "disabled";
124}; 229};
125 230
126&can1 { 231&can1 {
127 pinctrl-names = "default"; 232 pinctrl-names = "default";
128 pinctrl-0 = <&pinctrl_can1_2>; 233 pinctrl-0 = <&pinctrl_can1>;
129 status = "disabled"; 234 status = "disabled";
130}; 235};
131 236
132&can2 { 237&can2 {
133 pinctrl-names = "default"; 238 pinctrl-names = "default";
134 pinctrl-0 = <&pinctrl_can2_1>; 239 pinctrl-0 = <&pinctrl_can2>;
135 status = "disabled"; 240 status = "disabled";
136}; 241};
137 242
138&i2c3 { 243&i2c3 {
139 pinctrl-names = "default"; 244 pinctrl-names = "default";
140 pinctrl-0 = <&pinctrl_i2c3_1>; 245 pinctrl-0 = <&pinctrl_i2c3>;
141 status = "disabled"; 246 status = "disabled";
142}; 247};
143 248
144&cspi { 249&cspi {
145 pinctrl-names = "default"; 250 pinctrl-names = "default";
146 pinctrl-0 = <&pinctrl_cspi_1>; 251 pinctrl-0 = <&pinctrl_cspi>;
147 fsl,spi-num-chipselects = <3>; 252 fsl,spi-num-chipselects = <3>;
148 cs-gpios = <&gpio1 18 0>, <&gpio1 19 0>, 253 cs-gpios = <&gpio1 18 0>, <&gpio1 19 0>,
149 <&gpio1 21 0>; 254 <&gpio1 21 0>;
@@ -152,7 +257,7 @@
152 257
153&i2c2 { 258&i2c2 {
154 pinctrl-names = "default"; 259 pinctrl-names = "default";
155 pinctrl-0 = <&pinctrl_i2c2_1>; 260 pinctrl-0 = <&pinctrl_i2c2>;
156 status = "okay"; 261 status = "okay";
157 262
158 pmic: mc34708@8 { 263 pmic: mc34708@8 {
@@ -177,7 +282,7 @@
177 282
178&fec { 283&fec {
179 pinctrl-names = "default"; 284 pinctrl-names = "default";
180 pinctrl-0 = <&pinctrl_fec_1>; 285 pinctrl-0 = <&pinctrl_fec>;
181 phy-mode = "rmii"; 286 phy-mode = "rmii";
182 status = "disabled"; 287 status = "disabled";
183}; 288};
diff --git a/arch/arm/boot/dts/imx53-tx53-x03x.dts b/arch/arm/boot/dts/imx53-tx53-x03x.dts
new file mode 100644
index 000000000000..0217dde3b36b
--- /dev/null
+++ b/arch/arm/boot/dts/imx53-tx53-x03x.dts
@@ -0,0 +1,315 @@
1/*
2 * Copyright 2013 Lothar Waßmann <LW@KARO-electronics.de>
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 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/dts-v1/;
13#include "imx53-tx53.dtsi"
14#include <dt-bindings/input/input.h>
15#include <dt-bindings/pwm/pwm.h>
16
17/ {
18 model = "Ka-Ro electronics TX53 module (LCD)";
19 compatible = "karo,tx53", "fsl,imx53";
20
21 aliases {
22 display = &display;
23 };
24
25 soc {
26 display: display@di0 {
27 compatible = "fsl,imx-parallel-display";
28 crtcs = <&ipu 0>;
29 interface-pix-fmt = "rgb24";
30 pinctrl-names = "default";
31 pinctrl-0 = <&pinctrl_rgb24_vga1>;
32 status = "okay";
33
34 display-timings {
35 VGA {
36 clock-frequency = <25200000>;
37 hactive = <640>;
38 vactive = <480>;
39 hback-porch = <48>;
40 hsync-len = <96>;
41 hfront-porch = <16>;
42 vback-porch = <31>;
43 vsync-len = <2>;
44 vfront-porch = <12>;
45 hsync-active = <0>;
46 vsync-active = <0>;
47 de-active = <1>;
48 pixelclk-active = <0>;
49 };
50
51 ETV570 {
52 clock-frequency = <25200000>;
53 hactive = <640>;
54 vactive = <480>;
55 hback-porch = <114>;
56 hsync-len = <30>;
57 hfront-porch = <16>;
58 vback-porch = <32>;
59 vsync-len = <3>;
60 vfront-porch = <10>;
61 hsync-active = <0>;
62 vsync-active = <0>;
63 de-active = <1>;
64 pixelclk-active = <0>;
65 };
66
67 ET0350 {
68 clock-frequency = <6413760>;
69 hactive = <320>;
70 vactive = <240>;
71 hback-porch = <34>;
72 hsync-len = <34>;
73 hfront-porch = <20>;
74 vback-porch = <15>;
75 vsync-len = <3>;
76 vfront-porch = <4>;
77 hsync-active = <0>;
78 vsync-active = <0>;
79 de-active = <1>;
80 pixelclk-active = <0>;
81 };
82
83 ET0430 {
84 clock-frequency = <9009000>;
85 hactive = <480>;
86 vactive = <272>;
87 hback-porch = <2>;
88 hsync-len = <41>;
89 hfront-porch = <2>;
90 vback-porch = <2>;
91 vsync-len = <10>;
92 vfront-porch = <2>;
93 hsync-active = <0>;
94 vsync-active = <0>;
95 de-active = <1>;
96 pixelclk-active = <1>;
97 };
98
99 ET0500 {
100 clock-frequency = <33264000>;
101 hactive = <800>;
102 vactive = <480>;
103 hback-porch = <88>;
104 hsync-len = <128>;
105 hfront-porch = <40>;
106 vback-porch = <33>;
107 vsync-len = <2>;
108 vfront-porch = <10>;
109 hsync-active = <0>;
110 vsync-active = <0>;
111 de-active = <1>;
112 pixelclk-active = <0>;
113 };
114
115 ET0700 { /* same as ET0500 */
116 clock-frequency = <33264000>;
117 hactive = <800>;
118 vactive = <480>;
119 hback-porch = <88>;
120 hsync-len = <128>;
121 hfront-porch = <40>;
122 vback-porch = <33>;
123 vsync-len = <2>;
124 vfront-porch = <10>;
125 hsync-active = <0>;
126 vsync-active = <0>;
127 de-active = <1>;
128 pixelclk-active = <0>;
129 };
130
131 ETQ570 {
132 clock-frequency = <6596040>;
133 hactive = <320>;
134 vactive = <240>;
135 hback-porch = <38>;
136 hsync-len = <30>;
137 hfront-porch = <30>;
138 vback-porch = <16>;
139 vsync-len = <3>;
140 vfront-porch = <4>;
141 hsync-active = <0>;
142 vsync-active = <0>;
143 de-active = <1>;
144 pixelclk-active = <0>;
145 };
146 };
147 };
148 };
149
150 backlight: backlight {
151 compatible = "pwm-backlight";
152 pwms = <&pwm2 0 500000 PWM_POLARITY_INVERTED>;
153 power-supply = <&reg_3v3>;
154 brightness-levels = <
155 0 1 2 3 4 5 6 7 8 9
156 10 11 12 13 14 15 16 17 18 19
157 20 21 22 23 24 25 26 27 28 29
158 30 31 32 33 34 35 36 37 38 39
159 40 41 42 43 44 45 46 47 48 49
160 50 51 52 53 54 55 56 57 58 59
161 60 61 62 63 64 65 66 67 68 69
162 70 71 72 73 74 75 76 77 78 79
163 80 81 82 83 84 85 86 87 88 89
164 90 91 92 93 94 95 96 97 98 99
165 100
166 >;
167 default-brightness-level = <50>;
168 };
169
170 regulators {
171 reg_lcd_pwr: regulator@5 {
172 compatible = "regulator-fixed";
173 reg = <5>;
174 regulator-name = "LCD POWER";
175 regulator-min-microvolt = <3300000>;
176 regulator-max-microvolt = <3300000>;
177 gpio = <&gpio2 31 GPIO_ACTIVE_HIGH>;
178 enable-active-high;
179 regulator-boot-on;
180 };
181
182 reg_lcd_reset: regulator@6 {
183 compatible = "regulator-fixed";
184 reg = <6>;
185 regulator-name = "LCD RESET";
186 regulator-min-microvolt = <3300000>;
187 regulator-max-microvolt = <3300000>;
188 gpio = <&gpio3 29 GPIO_ACTIVE_HIGH>;
189 enable-active-high;
190 regulator-boot-on;
191 };
192 };
193};
194
195&i2c3 {
196 pinctrl-names = "default";
197 pinctrl-0 = <&pinctrl_i2c3>;
198 status = "okay";
199
200 sgtl5000: codec@0a {
201 compatible = "fsl,sgtl5000";
202 reg = <0x0a>;
203 VDDA-supply = <&reg_2v5>;
204 VDDIO-supply = <&reg_3v3>;
205 clocks = <&mclk>;
206 };
207
208 polytouch: edt-ft5x06@38 {
209 compatible = "edt,edt-ft5x06";
210 reg = <0x38>;
211 pinctrl-names = "default";
212 pinctrl-0 = <&pinctrl_edt_ft5x06_1>;
213 interrupt-parent = <&gpio6>;
214 interrupts = <15 0>;
215 reset-gpios = <&gpio2 22 GPIO_ACTIVE_LOW>;
216 wake-gpios = <&gpio2 21 GPIO_ACTIVE_HIGH>;
217 };
218
219 touchscreen: tsc2007@48 {
220 compatible = "ti,tsc2007";
221 reg = <0x48>;
222 pinctrl-names = "default";
223 pinctrl-0 = <&pinctrl_tsc2007>;
224 interrupt-parent = <&gpio3>;
225 interrupts = <26 0>;
226 gpios = <&gpio3 26 GPIO_ACTIVE_LOW>;
227 ti,x-plate-ohms = <660>;
228 linux,wakeup;
229 };
230};
231
232&iomuxc {
233 imx53-tx53-x03x {
234 pinctrl_edt_ft5x06_1: edt-ft5x06grp-1 {
235 fsl,pins = <
236 MX53_PAD_NANDF_CS2__GPIO6_15 0x1f0 /* Interrupt */
237 MX53_PAD_EIM_A16__GPIO2_22 0x04 /* Reset */
238 MX53_PAD_EIM_A17__GPIO2_21 0x04 /* Wake */
239 >;
240 };
241
242 pinctrl_kpp: kppgrp {
243 fsl,pins = <
244 MX53_PAD_GPIO_9__KPP_COL_6 0x1f4
245 MX53_PAD_GPIO_4__KPP_COL_7 0x1f4
246 MX53_PAD_KEY_COL2__KPP_COL_2 0x1f4
247 MX53_PAD_KEY_COL3__KPP_COL_3 0x1f4
248 MX53_PAD_GPIO_2__KPP_ROW_6 0x1f4
249 MX53_PAD_GPIO_5__KPP_ROW_7 0x1f4
250 MX53_PAD_KEY_ROW2__KPP_ROW_2 0x1f4
251 MX53_PAD_KEY_ROW3__KPP_ROW_3 0x1f4
252 >;
253 };
254
255 pinctrl_rgb24_vga1: rgb24-vgagrp1 {
256 fsl,pins = <
257 MX53_PAD_DI0_DISP_CLK__IPU_DI0_DISP_CLK 0x5
258 MX53_PAD_DI0_PIN15__IPU_DI0_PIN15 0x5
259 MX53_PAD_DI0_PIN2__IPU_DI0_PIN2 0x5
260 MX53_PAD_DI0_PIN3__IPU_DI0_PIN3 0x5
261 MX53_PAD_DISP0_DAT0__IPU_DISP0_DAT_0 0x5
262 MX53_PAD_DISP0_DAT1__IPU_DISP0_DAT_1 0x5
263 MX53_PAD_DISP0_DAT2__IPU_DISP0_DAT_2 0x5
264 MX53_PAD_DISP0_DAT3__IPU_DISP0_DAT_3 0x5
265 MX53_PAD_DISP0_DAT4__IPU_DISP0_DAT_4 0x5
266 MX53_PAD_DISP0_DAT5__IPU_DISP0_DAT_5 0x5
267 MX53_PAD_DISP0_DAT6__IPU_DISP0_DAT_6 0x5
268 MX53_PAD_DISP0_DAT7__IPU_DISP0_DAT_7 0x5
269 MX53_PAD_DISP0_DAT8__IPU_DISP0_DAT_8 0x5
270 MX53_PAD_DISP0_DAT9__IPU_DISP0_DAT_9 0x5
271 MX53_PAD_DISP0_DAT10__IPU_DISP0_DAT_10 0x5
272 MX53_PAD_DISP0_DAT11__IPU_DISP0_DAT_11 0x5
273 MX53_PAD_DISP0_DAT12__IPU_DISP0_DAT_12 0x5
274 MX53_PAD_DISP0_DAT13__IPU_DISP0_DAT_13 0x5
275 MX53_PAD_DISP0_DAT14__IPU_DISP0_DAT_14 0x5
276 MX53_PAD_DISP0_DAT15__IPU_DISP0_DAT_15 0x5
277 MX53_PAD_DISP0_DAT16__IPU_DISP0_DAT_16 0x5
278 MX53_PAD_DISP0_DAT17__IPU_DISP0_DAT_17 0x5
279 MX53_PAD_DISP0_DAT18__IPU_DISP0_DAT_18 0x5
280 MX53_PAD_DISP0_DAT19__IPU_DISP0_DAT_19 0x5
281 MX53_PAD_DISP0_DAT20__IPU_DISP0_DAT_20 0x5
282 MX53_PAD_DISP0_DAT21__IPU_DISP0_DAT_21 0x5
283 MX53_PAD_DISP0_DAT22__IPU_DISP0_DAT_22 0x5
284 MX53_PAD_DISP0_DAT23__IPU_DISP0_DAT_23 0x5
285 >;
286 };
287
288 pinctrl_tsc2007: tsc2007grp {
289 fsl,pins = <
290 MX53_PAD_EIM_D26__GPIO3_26 0x1f0 /* Interrupt */
291 >;
292 };
293 };
294};
295
296&kpp {
297 pinctrl-names = "default";
298 pinctrl-0 = <&pinctrl_kpp>;
299 /* sample keymap */
300 /* row/col 0,1 are mapped to KPP row/col 6,7 */
301 linux,keymap = <
302 MATRIX_KEY(6, 6, KEY_POWER)
303 MATRIX_KEY(6, 7, KEY_KP0)
304 MATRIX_KEY(6, 2, KEY_KP1)
305 MATRIX_KEY(6, 3, KEY_KP2)
306 MATRIX_KEY(7, 6, KEY_KP3)
307 MATRIX_KEY(7, 7, KEY_KP4)
308 MATRIX_KEY(7, 2, KEY_KP5)
309 MATRIX_KEY(7, 3, KEY_KP6)
310 MATRIX_KEY(2, 6, KEY_KP7)
311 MATRIX_KEY(2, 7, KEY_KP8)
312 MATRIX_KEY(2, 2, KEY_KP9)
313 >;
314 status = "okay";
315};
diff --git a/arch/arm/boot/dts/imx53-tx53-x13x.dts b/arch/arm/boot/dts/imx53-tx53-x13x.dts
new file mode 100644
index 000000000000..64804719f0f4
--- /dev/null
+++ b/arch/arm/boot/dts/imx53-tx53-x13x.dts
@@ -0,0 +1,243 @@
1/*
2 * Copyright 2013 Lothar Waßmann <LW@KARO-electronics.de>
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 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/dts-v1/;
13#include "imx53-tx53.dtsi"
14#include <dt-bindings/input/input.h>
15
16/ {
17 model = "Ka-Ro electronics TX53 module (LVDS)";
18 compatible = "karo,tx53", "fsl,imx53";
19
20 aliases {
21 display = &lvds0;
22 lvds0 = &lvds0;
23 lvds1 = &lvds1;
24 };
25
26 backlight0: backlight0 {
27 compatible = "pwm-backlight";
28 pwms = <&pwm2 0 500000 0>;
29 power-supply = <&reg_3v3>;
30 brightness-levels = <
31 0 1 2 3 4 5 6 7 8 9
32 10 11 12 13 14 15 16 17 18 19
33 20 21 22 23 24 25 26 27 28 29
34 30 31 32 33 34 35 36 37 38 39
35 40 41 42 43 44 45 46 47 48 49
36 50 51 52 53 54 55 56 57 58 59
37 60 61 62 63 64 65 66 67 68 69
38 70 71 72 73 74 75 76 77 78 79
39 80 81 82 83 84 85 86 87 88 89
40 90 91 92 93 94 95 96 97 98 99
41 100
42 >;
43 default-brightness-level = <50>;
44 };
45
46 backlight1: backlight1 {
47 compatible = "pwm-backlight";
48 pwms = <&pwm1 0 500000 0>;
49 power-supply = <&reg_3v3>;
50 brightness-levels = <
51 0 1 2 3 4 5 6 7 8 9
52 10 11 12 13 14 15 16 17 18 19
53 20 21 22 23 24 25 26 27 28 29
54 30 31 32 33 34 35 36 37 38 39
55 40 41 42 43 44 45 46 47 48 49
56 50 51 52 53 54 55 56 57 58 59
57 60 61 62 63 64 65 66 67 68 69
58 70 71 72 73 74 75 76 77 78 79
59 80 81 82 83 84 85 86 87 88 89
60 90 91 92 93 94 95 96 97 98 99
61 100
62 >;
63 default-brightness-level = <50>;
64 };
65
66 regulators {
67 reg_lcd_pwr0: regulator@5 {
68 compatible = "regulator-fixed";
69 reg = <5>;
70 regulator-name = "LVDS0 POWER";
71 regulator-min-microvolt = <3300000>;
72 regulator-max-microvolt = <3300000>;
73 gpio = <&gpio3 29 GPIO_ACTIVE_HIGH>;
74 enable-active-high;
75 regulator-boot-on;
76 };
77
78 reg_lcd_pwr1: regulator@6 {
79 compatible = "regulator-fixed";
80 reg = <6>;
81 regulator-name = "LVDS1 POWER";
82 regulator-min-microvolt = <3300000>;
83 regulator-max-microvolt = <3300000>;
84 gpio = <&gpio2 31 GPIO_ACTIVE_HIGH>;
85 enable-active-high;
86 regulator-boot-on;
87 };
88 };
89};
90
91&i2c2 {
92 pinctrl-names = "default";
93 pinctrl-0 = <&pinctrl_i2c2>;
94 status = "okay";
95
96 touchscreen2: eeti@04 {
97 compatible = "eeti,egalax_ts";
98 reg = <0x04>;
99 pinctrl-names = "default";
100 pinctrl-0 = <&pinctrl_eeti2>;
101 interrupt-parent = <&gpio3>;
102 interrupts = <23 0>;
103 wakeup-gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
104 linux,wakeup;
105 };
106};
107
108&i2c3 {
109 pinctrl-names = "default";
110 pinctrl-0 = <&pinctrl_i2c3>;
111 status = "okay";
112
113 sgtl5000: codec@0a {
114 compatible = "fsl,sgtl5000";
115 reg = <0x0a>;
116 VDDA-supply = <&reg_2v5>;
117 VDDIO-supply = <&reg_3v3>;
118 clocks = <&mclk>;
119 };
120
121 touchscreen1: eeti@04 {
122 compatible = "eeti,egalax_ts";
123 reg = <0x04>;
124 pinctrl-names = "default";
125 pinctrl-0 = <&pinctrl_eeti1>;
126 interrupt-parent = <&gpio3>;
127 interrupts = <22 0>;
128 wakeup-gpios = <&gpio3 22 GPIO_ACTIVE_HIGH>;
129 linux,wakeup;
130 };
131};
132
133&iomuxc {
134 imx53-tx53-x13x {
135 pinctrl_i2c2: i2c2-grp1 {
136 fsl,pins = <
137 MX53_PAD_KEY_ROW3__I2C2_SDA 0xc0000000
138 MX53_PAD_KEY_COL3__I2C2_SCL 0xc0000000
139 >;
140 };
141
142 pinctrl_lvds0: lvds0grp {
143 fsl,pins = <
144 MX53_PAD_LVDS0_TX3_P__LDB_LVDS0_TX3 0x80000000
145 MX53_PAD_LVDS0_CLK_P__LDB_LVDS0_CLK 0x80000000
146 MX53_PAD_LVDS0_TX2_P__LDB_LVDS0_TX2 0x80000000
147 MX53_PAD_LVDS0_TX1_P__LDB_LVDS0_TX1 0x80000000
148 MX53_PAD_LVDS0_TX0_P__LDB_LVDS0_TX0 0x80000000
149 >;
150 };
151
152 pinctrl_lvds1: lvds1grp {
153 fsl,pins = <
154 MX53_PAD_LVDS1_TX3_P__LDB_LVDS1_TX3 0x80000000
155 MX53_PAD_LVDS1_TX2_P__LDB_LVDS1_TX2 0x80000000
156 MX53_PAD_LVDS1_CLK_P__LDB_LVDS1_CLK 0x80000000
157 MX53_PAD_LVDS1_TX1_P__LDB_LVDS1_TX1 0x80000000
158 MX53_PAD_LVDS1_TX0_P__LDB_LVDS1_TX0 0x80000000
159 >;
160 };
161
162 pinctrl_pwm1: pwm1grp {
163 fsl,pins = <MX53_PAD_GPIO_9__PWM1_PWMO 0x04>;
164 };
165
166 pinctrl_eeti1: eeti1grp {
167 fsl,pins = <
168 MX53_PAD_EIM_D22__GPIO3_22 0x1f0 /* Interrupt */
169 >;
170 };
171
172 pinctrl_eeti2: eeti2grp {
173 fsl,pins = <
174 MX53_PAD_EIM_D23__GPIO3_23 0x1f0 /* Interrupt */
175 >;
176 };
177 };
178};
179
180&ldb {
181 pinctrl-names = "default";
182 pinctrl-0 = <&pinctrl_lvds0 &pinctrl_lvds1>;
183 status = "okay";
184
185 lvds0: lvds-channel@0 {
186 fsl,data-mapping = "jeida";
187 fsl,data-width = <24>;
188 status = "okay";
189
190 display-timings {
191 native-mode = <&lvds_timing0>;
192 lvds_timing0: hsd100pxn1 {
193 clock-frequency = <65000000>;
194 hactive = <1024>;
195 vactive = <768>;
196 hback-porch = <220>;
197 hsync-len = <60>;
198 hfront-porch = <40>;
199 vback-porch = <21>;
200 vsync-len = <10>;
201 vfront-porch = <7>;
202 hsync-active = <0>;
203 vsync-active = <0>;
204 de-active = <1>;
205 pixelclk-active = <0>;
206 };
207 };
208 };
209
210 lvds1: lvds-channel@1 {
211 fsl,data-mapping = "jeida";
212 fsl,data-width = <24>;
213 status = "okay";
214
215 display-timings {
216 native-mode = <&lvds_timing1>;
217 lvds_timing1: hsd100pxn1 {
218 clock-frequency = <65000000>;
219 hactive = <1024>;
220 vactive = <768>;
221 hback-porch = <220>;
222 hsync-len = <60>;
223 hfront-porch = <40>;
224 vback-porch = <21>;
225 vsync-len = <10>;
226 vfront-porch = <7>;
227 hsync-active = <0>;
228 vsync-active = <0>;
229 de-active = <1>;
230 pixelclk-active = <0>;
231 };
232 };
233 };
234};
235
236&pwm1 {
237 pinctrl-names = "default";
238 pinctrl-0 = <&pinctrl_pwm1>;
239};
240
241&sata {
242 status = "okay";
243};
diff --git a/arch/arm/boot/dts/imx53-tx53.dtsi b/arch/arm/boot/dts/imx53-tx53.dtsi
index f494766700a3..e348796ba689 100644
--- a/arch/arm/boot/dts/imx53-tx53.dtsi
+++ b/arch/arm/boot/dts/imx53-tx53.dtsi
@@ -1,122 +1,550 @@
1/* 1/*
2 * Copyright 2013 Steffen Trumtrar <s.trumtrar@pengutronix.de> 2 * Copyright 2012 <LW@KARO-electronics.de>
3 * based on imx53-qsb.dts
4 * Copyright 2011 Freescale Semiconductor, Inc.
5 * Copyright 2011 Linaro Ltd.
3 * 6 *
4 * The code contained herein is licensed under the GNU General Public 7 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License 8 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations: 9 * Version 2 at the following locations:
7 * 10 *
8 * http://www.opensource.org/licenses/gpl-license.html 11 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html 12 * http://www.gnu.org/copyleft/gpl.html
10 */ 13 */
11 14
12/include/ "imx53.dtsi" 15#include "imx53.dtsi"
16#include <dt-bindings/gpio/gpio.h>
13 17
14/ { 18/ {
15 model = "Ka-Ro TX53"; 19 model = "Ka-Ro electronics TX53 module";
16 compatible = "karo,tx53", "fsl,imx53"; 20 compatible = "karo,tx53", "fsl,imx53";
17 21
18 memory { 22 aliases {
19 reg = <0x70000000 0x40000000>; /* Up to 1GiB */ 23 can0 = &can2; /* Make the can interface indices consistent with TX28/TX48 modules */
24 can1 = &can1;
25 ipu = &ipu;
26 reg_can_xcvr = &reg_can_xcvr;
27 usbh1 = &usbh1;
28 usbotg = &usbotg;
29 };
30
31 clocks {
32 ckih1 {
33 clock-frequency = <0>;
34 };
35
36 mclk: clock@0 {
37 compatible = "fixed-clock";
38 reg = <0>;
39 #clock-cells = <0>;
40 clock-frequency = <27000000>;
41 };
42 };
43
44 gpio-keys {
45 compatible = "gpio-keys";
46 pinctrl-names = "default";
47 pinctrl-0 = <&pinctrl_gpio_key>;
48
49 power {
50 label = "Power Button";
51 gpios = <&gpio5 2 GPIO_ACTIVE_HIGH>;
52 linux,code = <116>; /* KEY_POWER */
53 gpio-key,wakeup;
54 };
55 };
56
57 leds {
58 compatible = "gpio-leds";
59 pinctrl-names = "default";
60 pinctrl-0 = <&pinctrl_stk5led>;
61
62 user {
63 label = "Heartbeat";
64 gpios = <&gpio2 20 GPIO_ACTIVE_HIGH>;
65 linux,default-trigger = "heartbeat";
66 };
20 }; 67 };
21 68
22 regulators { 69 regulators {
23 compatible = "simple-bus"; 70 compatible = "simple-bus";
71 #address-cells = <1>;
72 #size-cells = <0>;
24 73
25 reg_3p3v: 3p3v { 74 reg_2v5: regulator@0 {
26 compatible = "regulator-fixed"; 75 compatible = "regulator-fixed";
27 regulator-name = "3P3V"; 76 reg = <0>;
77 regulator-name = "2V5";
78 regulator-min-microvolt = <2500000>;
79 regulator-max-microvolt = <2500000>;
80 };
81
82 reg_3v3: regulator@1 {
83 compatible = "regulator-fixed";
84 reg = <1>;
85 regulator-name = "3V3";
28 regulator-min-microvolt = <3300000>; 86 regulator-min-microvolt = <3300000>;
29 regulator-max-microvolt = <3300000>; 87 regulator-max-microvolt = <3300000>;
30 regulator-always-on;
31 }; 88 };
89
90 reg_can_xcvr: regulator@2 {
91 compatible = "regulator-fixed";
92 reg = <2>;
93 regulator-name = "CAN XCVR";
94 regulator-min-microvolt = <3300000>;
95 regulator-max-microvolt = <3300000>;
96 pinctrl-names = "default";
97 pinctrl-0 = <&pinctrl_can_xcvr>;
98 gpio = <&gpio4 21 GPIO_ACTIVE_HIGH>;
99 };
100
101 reg_usbh1_vbus: regulator@3 {
102 compatible = "regulator-fixed";
103 reg = <3>;
104 regulator-name = "usbh1_vbus";
105 regulator-min-microvolt = <5000000>;
106 regulator-max-microvolt = <5000000>;
107 pinctrl-names = "default";
108 pinctrl-0 = <&pinctrl_usbh1_vbus>;
109 gpio = <&gpio3 31 GPIO_ACTIVE_HIGH>;
110 enable-active-high;
111 };
112
113 reg_usbotg_vbus: regulator@4 {
114 compatible = "regulator-fixed";
115 reg = <4>;
116 regulator-name = "usbotg_vbus";
117 regulator-min-microvolt = <5000000>;
118 regulator-max-microvolt = <5000000>;
119 pinctrl-names = "default";
120 pinctrl-0 = <&pinctrl_usbotg_vbus>;
121 gpio = <&gpio1 7 GPIO_ACTIVE_HIGH>;
122 enable-active-high;
123 };
124 };
125
126 sound {
127 compatible = "karo,tx53-audio-sgtl5000", "fsl,imx-audio-sgtl5000";
128 model = "tx53-audio-sgtl5000";
129 ssi-controller = <&ssi1>;
130 audio-codec = <&sgtl5000>;
131 audio-routing =
132 "MIC_IN", "Mic Jack",
133 "Mic Jack", "Mic Bias",
134 "Headphone Jack", "HP_OUT";
135 /* '1' based port numbers according to datasheet names */
136 mux-int-port = <1>;
137 mux-ext-port = <5>;
32 }; 138 };
33}; 139};
34 140
141&audmux {
142 pinctrl-names = "default";
143 pinctrl-0 = <&pinctrl_ssi1>;
144 status = "okay";
145};
146
35&can1 { 147&can1 {
36 pinctrl-names = "default"; 148 pinctrl-names = "default";
37 pinctrl-0 = <&pinctrl_can1_2>; 149 pinctrl-0 = <&pinctrl_can1>;
38 status = "disabled"; 150 xceiver-supply = <&reg_can_xcvr>;
151 status = "okay";
39}; 152};
40 153
41&can2 { 154&can2 {
42 pinctrl-names = "default"; 155 pinctrl-names = "default";
43 pinctrl-0 = <&pinctrl_can2_1>; 156 pinctrl-0 = <&pinctrl_can2>;
44 status = "disabled"; 157 xceiver-supply = <&reg_can_xcvr>;
158 status = "okay";
45}; 159};
46 160
47&ecspi1 { 161&ecspi1 {
48 pinctrl-names = "default"; 162 pinctrl-names = "default";
49 pinctrl-0 = <&pinctrl_ecspi1_2>; 163 pinctrl-0 = <&pinctrl_ecspi1>;
50 status = "disabled"; 164 fsl,spi-num-chipselects = <2>;
165 status = "okay";
166
167 cs-gpios = <
168 &gpio2 30 GPIO_ACTIVE_HIGH
169 &gpio3 19 GPIO_ACTIVE_HIGH
170 >;
171
172 spidev0: spi@0 {
173 compatible = "spidev";
174 reg = <0>;
175 spi-max-frequency = <54000000>;
176 };
177
178 spidev1: spi@1 {
179 compatible = "spidev";
180 reg = <1>;
181 spi-max-frequency = <54000000>;
182 };
51}; 183};
52 184
53&esdhc1 { 185&esdhc1 {
186 cd-gpios = <&gpio3 24 GPIO_ACTIVE_HIGH>;
187 fsl,wp-controller;
54 pinctrl-names = "default"; 188 pinctrl-names = "default";
55 pinctrl-0 = <&pinctrl_esdhc1_2>; 189 pinctrl-0 = <&pinctrl_esdhc1>;
56 status = "disabled"; 190 status = "okay";
57}; 191};
58 192
59&esdhc2 { 193&esdhc2 {
194 cd-gpios = <&gpio3 25 GPIO_ACTIVE_HIGH>;
195 fsl,wp-controller;
60 pinctrl-names = "default"; 196 pinctrl-names = "default";
61 pinctrl-0 = <&pinctrl_esdhc2_1>; 197 pinctrl-0 = <&pinctrl_esdhc2>;
62 status = "disabled"; 198 status = "okay";
63}; 199};
64 200
65&fec { 201&fec {
66 pinctrl-names = "default"; 202 pinctrl-names = "default";
67 pinctrl-0 = <&pinctrl_fec_1>; 203 pinctrl-0 = <&pinctrl_fec>;
68 phy-mode = "rmii"; 204 phy-mode = "rmii";
69 status = "disabled"; 205 phy-reset-gpios = <&gpio7 6 GPIO_ACTIVE_HIGH>;
206 phy-handle = <&phy0>;
207 mac-address = [000000000000]; /* placeholder; will be overwritten by bootloader */
208 status = "okay";
209
210 phy0: ethernet-phy@0 {
211 interrupt-parent = <&gpio2>;
212 interrupts = <4>;
213 device_type = "ethernet-phy";
214 };
70}; 215};
71 216
72&i2c3 { 217&i2c1 {
73 pinctrl-names = "default"; 218 pinctrl-names = "default";
74 pinctrl-0 = <&pinctrl_i2c3_2>; 219 pinctrl-0 = <&pinctrl_i2c1>;
75 status = "disabled"; 220 clock-frequency = <400000>;
221 status = "okay";
222
223 rtc1: ds1339@68 {
224 compatible = "dallas,ds1339";
225 reg = <0x68>;
226 pinctrl-names = "default";
227 pinctrl-0 = <&pinctrl_ds1339>;
228 interrupt-parent = <&gpio4>;
229 interrupts = <20 0>;
230 };
76}; 231};
77 232
78&owire { 233&iomuxc {
79 pinctrl-names = "default"; 234 pinctrl-names = "default";
80 pinctrl-0 = <&pinctrl_owire_1>; 235 pinctrl-0 = <&pinctrl_hog>;
81 status = "disabled"; 236
237 imx53-tx53 {
238 pinctrl_hog: hoggrp {
239 /* pins not in use by any device on the Starterkit board series */
240 fsl,pins = <
241 /* CMOS Sensor Interface */
242 MX53_PAD_CSI0_DAT12__GPIO5_30 0x1f4
243 MX53_PAD_CSI0_DAT13__GPIO5_31 0x1f4
244 MX53_PAD_CSI0_DAT14__GPIO6_0 0x1f4
245 MX53_PAD_CSI0_DAT15__GPIO6_1 0x1f4
246 MX53_PAD_CSI0_DAT16__GPIO6_2 0x1f4
247 MX53_PAD_CSI0_DAT17__GPIO6_3 0x1f4
248 MX53_PAD_CSI0_DAT18__GPIO6_4 0x1f4
249 MX53_PAD_CSI0_DAT19__GPIO6_5 0x1f4
250 MX53_PAD_CSI0_MCLK__GPIO5_19 0x1f4
251 MX53_PAD_CSI0_VSYNC__GPIO5_21 0x1f4
252 MX53_PAD_CSI0_PIXCLK__GPIO5_18 0x1f4
253 MX53_PAD_GPIO_0__GPIO1_0 0x1f4
254 /* Module Specific Signal */
255 /* MX53_PAD_NANDF_CS2__GPIO6_15 0x1f4 maybe used by EDT-FT5x06 */
256 /* MX53_PAD_EIM_A16__GPIO2_22 0x1f4 maybe used by EDT-FT5x06 */
257 MX53_PAD_EIM_D29__GPIO3_29 0x1f4
258 MX53_PAD_EIM_EB3__GPIO2_31 0x1f4
259 /* MX53_PAD_EIM_A17__GPIO2_21 0x1f4 maybe used by EDT-FT5x06 */
260 /* MX53_PAD_EIM_A18__GPIO2_20 0x1f4 used by LED */
261 MX53_PAD_EIM_A19__GPIO2_19 0x1f4
262 MX53_PAD_EIM_A20__GPIO2_18 0x1f4
263 MX53_PAD_EIM_A21__GPIO2_17 0x1f4
264 MX53_PAD_EIM_A22__GPIO2_16 0x1f4
265 MX53_PAD_EIM_A23__GPIO6_6 0x1f4
266 MX53_PAD_EIM_A24__GPIO5_4 0x1f4
267 MX53_PAD_CSI0_DAT8__GPIO5_26 0x1f4
268 MX53_PAD_CSI0_DAT9__GPIO5_27 0x1f4
269 MX53_PAD_CSI0_DAT10__GPIO5_28 0x1f4
270 MX53_PAD_CSI0_DAT11__GPIO5_29 0x1f4
271 /* MX53_PAD_EIM_D22__GPIO3_22 0x1f4 maybe used by EETI touchpanel driver */
272 /* MX53_PAD_EIM_D23__GPIO3_23 0x1f4 maybe used by EETI touchpanel driver */
273 MX53_PAD_GPIO_13__GPIO4_3 0x1f4
274 MX53_PAD_EIM_CS0__GPIO2_23 0x1f4
275 MX53_PAD_EIM_CS1__GPIO2_24 0x1f4
276 MX53_PAD_CSI0_DATA_EN__GPIO5_20 0x1f4
277 MX53_PAD_EIM_WAIT__GPIO5_0 0x1f4
278 MX53_PAD_EIM_EB0__GPIO2_28 0x1f4
279 MX53_PAD_EIM_EB1__GPIO2_29 0x1f4
280 MX53_PAD_EIM_OE__GPIO2_25 0x1f4
281 MX53_PAD_EIM_LBA__GPIO2_27 0x1f4
282 MX53_PAD_EIM_RW__GPIO2_26 0x1f4
283 MX53_PAD_EIM_DA8__GPIO3_8 0x1f4
284 MX53_PAD_EIM_DA9__GPIO3_9 0x1f4
285 MX53_PAD_EIM_DA10__GPIO3_10 0x1f4
286 MX53_PAD_EIM_DA11__GPIO3_11 0x1f4
287 MX53_PAD_EIM_DA12__GPIO3_12 0x1f4
288 MX53_PAD_EIM_DA13__GPIO3_13 0x1f4
289 MX53_PAD_EIM_DA14__GPIO3_14 0x1f4
290 MX53_PAD_EIM_DA15__GPIO3_15 0x1f4
291 >;
292 };
293
294 pinctrl_can1: can1grp {
295 fsl,pins = <
296 MX53_PAD_GPIO_7__CAN1_TXCAN 0x80000000
297 MX53_PAD_GPIO_8__CAN1_RXCAN 0x80000000
298 >;
299 };
300
301 pinctrl_can2: can2grp {
302 fsl,pins = <
303 MX53_PAD_KEY_COL4__CAN2_TXCAN 0x80000000
304 MX53_PAD_KEY_ROW4__CAN2_RXCAN 0x80000000
305 >;
306 };
307
308 pinctrl_can_xcvr: can-xcvrgrp {
309 fsl,pins = <MX53_PAD_DISP0_DAT0__GPIO4_21 0xe0>; /* Flexcan XCVR enable */
310 };
311
312 pinctrl_ds1339: ds1339grp {
313 fsl,pins = <MX53_PAD_DI0_PIN4__GPIO4_20 0xe0>;
314 };
315
316 pinctrl_ecspi1: ecspi1grp {
317 fsl,pins = <
318 MX53_PAD_GPIO_19__ECSPI1_RDY 0x80000000
319 MX53_PAD_EIM_EB2__ECSPI1_SS0 0x80000000
320 MX53_PAD_EIM_D16__ECSPI1_SCLK 0x80000000
321 MX53_PAD_EIM_D17__ECSPI1_MISO 0x80000000
322 MX53_PAD_EIM_D18__ECSPI1_MOSI 0x80000000
323 MX53_PAD_EIM_D19__ECSPI1_SS1 0x80000000
324 >;
325 };
326
327 pinctrl_esdhc1: esdhc1grp {
328 fsl,pins = <
329 MX53_PAD_SD1_DATA0__ESDHC1_DAT0 0x1d5
330 MX53_PAD_SD1_DATA1__ESDHC1_DAT1 0x1d5
331 MX53_PAD_SD1_DATA2__ESDHC1_DAT2 0x1d5
332 MX53_PAD_SD1_DATA3__ESDHC1_DAT3 0x1d5
333 MX53_PAD_SD1_CMD__ESDHC1_CMD 0x1d5
334 MX53_PAD_SD1_CLK__ESDHC1_CLK 0x1d5
335 MX53_PAD_EIM_D24__GPIO3_24 0x1f0
336 >;
337 };
338
339 pinctrl_esdhc2: esdhc2grp {
340 fsl,pins = <
341 MX53_PAD_SD2_CMD__ESDHC2_CMD 0x1d5
342 MX53_PAD_SD2_CLK__ESDHC2_CLK 0x1d5
343 MX53_PAD_SD2_DATA0__ESDHC2_DAT0 0x1d5
344 MX53_PAD_SD2_DATA1__ESDHC2_DAT1 0x1d5
345 MX53_PAD_SD2_DATA2__ESDHC2_DAT2 0x1d5
346 MX53_PAD_SD2_DATA3__ESDHC2_DAT3 0x1d5
347 MX53_PAD_EIM_D25__GPIO3_25 0x1f0
348 >;
349 };
350
351 pinctrl_fec: fecgrp {
352 fsl,pins = <
353 MX53_PAD_FEC_MDC__FEC_MDC 0x80000000
354 MX53_PAD_FEC_MDIO__FEC_MDIO 0x80000000
355 MX53_PAD_FEC_REF_CLK__FEC_TX_CLK 0x80000000
356 MX53_PAD_FEC_RX_ER__FEC_RX_ER 0x80000000
357 MX53_PAD_FEC_CRS_DV__FEC_RX_DV 0x80000000
358 MX53_PAD_FEC_RXD1__FEC_RDATA_1 0x80000000
359 MX53_PAD_FEC_RXD0__FEC_RDATA_0 0x80000000
360 MX53_PAD_FEC_TX_EN__FEC_TX_EN 0x80000000
361 MX53_PAD_FEC_TXD1__FEC_TDATA_1 0x80000000
362 MX53_PAD_FEC_TXD0__FEC_TDATA_0 0x80000000
363 >;
364 };
365
366 pinctrl_gpio_key: gpio-keygrp {
367 fsl,pins = <MX53_PAD_EIM_A25__GPIO5_2 0x1f4>;
368 };
369
370 pinctrl_i2c1: i2c1grp {
371 fsl,pins = <
372 MX53_PAD_EIM_D21__I2C1_SCL 0xc0000000
373 MX53_PAD_EIM_D28__I2C1_SDA 0xc0000000
374 >;
375 };
376
377 pinctrl_i2c3: i2c3grp {
378 fsl,pins = <
379 MX53_PAD_GPIO_3__I2C3_SCL 0xc0000000
380 MX53_PAD_GPIO_6__I2C3_SDA 0xc0000000
381 >;
382 };
383
384 pinctrl_nand: nandgrp {
385 fsl,pins = <
386 MX53_PAD_NANDF_WE_B__EMI_NANDF_WE_B 0x4
387 MX53_PAD_NANDF_RE_B__EMI_NANDF_RE_B 0x4
388 MX53_PAD_NANDF_CLE__EMI_NANDF_CLE 0x4
389 MX53_PAD_NANDF_ALE__EMI_NANDF_ALE 0x4
390 MX53_PAD_NANDF_WP_B__EMI_NANDF_WP_B 0xe0
391 MX53_PAD_NANDF_RB0__EMI_NANDF_RB_0 0xe0
392 MX53_PAD_NANDF_CS0__EMI_NANDF_CS_0 0x4
393 MX53_PAD_EIM_DA0__EMI_NAND_WEIM_DA_0 0xa4
394 MX53_PAD_EIM_DA1__EMI_NAND_WEIM_DA_1 0xa4
395 MX53_PAD_EIM_DA2__EMI_NAND_WEIM_DA_2 0xa4
396 MX53_PAD_EIM_DA3__EMI_NAND_WEIM_DA_3 0xa4
397 MX53_PAD_EIM_DA4__EMI_NAND_WEIM_DA_4 0xa4
398 MX53_PAD_EIM_DA5__EMI_NAND_WEIM_DA_5 0xa4
399 MX53_PAD_EIM_DA6__EMI_NAND_WEIM_DA_6 0xa4
400 MX53_PAD_EIM_DA7__EMI_NAND_WEIM_DA_7 0xa4
401 >;
402 };
403
404 pinctrl_pwm2: pwm2grp {
405 fsl,pins = <
406 MX53_PAD_GPIO_1__PWM2_PWMO 0x80000000
407 >;
408 };
409
410 pinctrl_ssi1: ssi1grp {
411 fsl,pins = <
412 MX53_PAD_KEY_COL0__AUDMUX_AUD5_TXC 0x80000000
413 MX53_PAD_KEY_ROW0__AUDMUX_AUD5_TXD 0x80000000
414 MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS 0x80000000
415 MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD 0x80000000
416 >;
417 };
418
419 pinctrl_ssi2: ssi2grp {
420 fsl,pins = <
421 MX53_PAD_CSI0_DAT4__AUDMUX_AUD3_TXC 0x80000000
422 MX53_PAD_CSI0_DAT5__AUDMUX_AUD3_TXD 0x80000000
423 MX53_PAD_CSI0_DAT6__AUDMUX_AUD3_TXFS 0x80000000
424 MX53_PAD_CSI0_DAT7__AUDMUX_AUD3_RXD 0x80000000
425 MX53_PAD_EIM_D27__GPIO3_27 0x1f0
426 >;
427 };
428
429 pinctrl_stk5led: stk5ledgrp {
430 fsl,pins = <MX53_PAD_EIM_A18__GPIO2_20 0xc0>;
431 };
432
433 pinctrl_uart1: uart1grp {
434 fsl,pins = <
435 MX53_PAD_PATA_DIOW__UART1_TXD_MUX 0x1e4
436 MX53_PAD_PATA_DMACK__UART1_RXD_MUX 0x1e4
437 MX53_PAD_PATA_RESET_B__UART1_CTS 0x1c5
438 MX53_PAD_PATA_IORDY__UART1_RTS 0x1c5
439 >;
440 };
441
442 pinctrl_uart2: uart2grp {
443 fsl,pins = <
444 MX53_PAD_PATA_BUFFER_EN__UART2_RXD_MUX 0x1c5
445 MX53_PAD_PATA_DMARQ__UART2_TXD_MUX 0x1c5
446 MX53_PAD_PATA_DIOR__UART2_RTS 0x1c5
447 MX53_PAD_PATA_INTRQ__UART2_CTS 0x1c5
448 >;
449 };
450
451 pinctrl_uart3: uart3grp {
452 fsl,pins = <
453 MX53_PAD_PATA_CS_0__UART3_TXD_MUX 0x1e4
454 MX53_PAD_PATA_CS_1__UART3_RXD_MUX 0x1e4
455 MX53_PAD_PATA_DA_1__UART3_CTS 0x1e4
456 MX53_PAD_PATA_DA_2__UART3_RTS 0x1e4
457 >;
458 };
459
460 pinctrl_usbh1: usbh1grp {
461 fsl,pins = <
462 MX53_PAD_EIM_D30__GPIO3_30 0x100 /* OC */
463 >;
464 };
465
466 pinctrl_usbh1_vbus: usbh1-vbusgrp {
467 fsl,pins = <
468 MX53_PAD_EIM_D31__GPIO3_31 0xe0 /* VBUS ENABLE */
469 >;
470 };
471
472 pinctrl_usbotg_vbus: usbotg-vbusgrp {
473 fsl,pins = <
474 MX53_PAD_GPIO_7__GPIO1_7 0xe0 /* VBUS ENABLE */
475 MX53_PAD_GPIO_8__GPIO1_8 0x100 /* OC */
476 >;
477 };
478 };
479};
480
481&ipu {
482 status = "okay";
483};
484
485&nfc {
486 pinctrl-names = "default";
487 pinctrl-0 = <&pinctrl_nand>;
488 nand-bus-width = <8>;
489 nand-ecc-mode = "hw";
490 nand-on-flash-bbt;
491 status = "okay";
82}; 492};
83 493
84&pwm2 { 494&pwm2 {
85 pinctrl-names = "default"; 495 pinctrl-names = "default";
86 pinctrl-0 = <&pinctrl_pwm2_1>; 496 pinctrl-0 = <&pinctrl_pwm2>;
87 status = "disabled"; 497 #pwm-cells = <3>;
498};
499
500&sdma {
501 fsl,sdma-ram-script-name = "sdma-imx53.bin";
88}; 502};
89 503
90&ssi1 { 504&ssi1 {
91 pinctrl-names = "default"; 505 fsl,mode = "i2s-slave";
92 pinctrl-0 = <&pinctrl_audmux_1>; 506 codec-handle = <&sgtl5000>;
93 status = "disabled"; 507 status = "okay";
94}; 508};
95 509
96&ssi2 { 510&ssi2 {
97 pinctrl-names = "default";
98 pinctrl-0 = <&pinctrl_audmux_2>;
99 status = "disabled"; 511 status = "disabled";
100}; 512};
101 513
102&uart1 { 514&uart1 {
103 pinctrl-names = "default"; 515 pinctrl-names = "default";
104 pinctrl-0 = <&pinctrl_uart1_2>, 516 pinctrl-0 = <&pinctrl_uart1>;
105 <&pinctrl_uart1_3>;
106 fsl,uart-has-rtscts; 517 fsl,uart-has-rtscts;
107 status = "disabled"; 518 status = "okay";
108}; 519};
109 520
110&uart2 { 521&uart2 {
111 pinctrl-names = "default"; 522 pinctrl-names = "default";
112 pinctrl-0 = <&pinctrl_uart2_2>; 523 pinctrl-0 = <&pinctrl_uart2>;
113 fsl,uart-has-rtscts; 524 fsl,uart-has-rtscts;
114 status = "disabled"; 525 status = "okay";
115}; 526};
116 527
117&uart3 { 528&uart3 {
118 pinctrl-names = "default"; 529 pinctrl-names = "default";
119 pinctrl-0 = <&pinctrl_uart3_1>; 530 pinctrl-0 = <&pinctrl_uart3>;
120 fsl,uart-has-rtscts; 531 fsl,uart-has-rtscts;
121 status = "disabled"; 532 status = "okay";
533};
534
535&usbh1 {
536 pinctrl-names = "default";
537 pinctrl-0 = <&pinctrl_usbh1>;
538 phy_type = "utmi";
539 disable-over-current;
540 vbus-supply = <&reg_usbh1_vbus>;
541 status = "okay";
542};
543
544&usbotg {
545 phy_type = "utmi";
546 dr_mode = "peripheral";
547 disable-over-current;
548 vbus-supply = <&reg_usbotg_vbus>;
549 status = "okay";
122}; 550};
diff --git a/arch/arm/boot/dts/imx53-voipac-bsb.dts b/arch/arm/boot/dts/imx53-voipac-bsb.dts
new file mode 100644
index 000000000000..7f6711a48615
--- /dev/null
+++ b/arch/arm/boot/dts/imx53-voipac-bsb.dts
@@ -0,0 +1,159 @@
1/*
2 * Copyright 2013 Rostislav Lisovy <lisovy@gmail.com>, PiKRON s.r.o.
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/dts-v1/;
13#include "imx53-voipac-dmm-668.dtsi"
14
15/ {
16 sound {
17 compatible = "fsl,imx53-voipac-sgtl5000",
18 "fsl,imx-audio-sgtl5000";
19 model = "imx53-voipac-sgtl5000";
20 ssi-controller = <&ssi2>;
21 audio-codec = <&sgtl5000>;
22 audio-routing =
23 "Headphone Jack", "HP_OUT";
24 mux-int-port = <2>;
25 mux-ext-port = <5>;
26 };
27
28 leds {
29 compatible = "gpio-leds";
30 pinctrl-names = "default";
31 pinctrl-0 = <&led_pin_gpio>;
32
33 led1 {
34 label = "led-red";
35 gpios = <&gpio3 29 0>;
36 default-state = "off";
37 };
38
39 led2 {
40 label = "led-orange";
41 gpios = <&gpio2 31 0>;
42 default-state = "off";
43 };
44 };
45};
46
47&iomuxc {
48 pinctrl-names = "default";
49 pinctrl-0 = <&pinctrl_hog>;
50
51 imx53-voipac {
52 pinctrl_hog: hoggrp {
53 fsl,pins = <
54 /* SD2_CD */
55 MX53_PAD_EIM_D25__GPIO3_25 0x80000000
56 /* SD2_WP */
57 MX53_PAD_EIM_A19__GPIO2_19 0x80000000
58 >;
59 };
60
61 led_pin_gpio: led_gpio {
62 fsl,pins = <
63 MX53_PAD_EIM_D29__GPIO3_29 0x80000000
64 MX53_PAD_EIM_EB3__GPIO2_31 0x80000000
65 >;
66 };
67
68 /* Keyboard controller */
69 pinctrl_kpp_1: kppgrp-1 {
70 fsl,pins = <
71 MX53_PAD_GPIO_9__KPP_COL_6 0xe8
72 MX53_PAD_GPIO_4__KPP_COL_7 0xe8
73 MX53_PAD_KEY_COL2__KPP_COL_2 0xe8
74 MX53_PAD_KEY_COL3__KPP_COL_3 0xe8
75 MX53_PAD_KEY_COL4__KPP_COL_4 0xe8
76 MX53_PAD_GPIO_2__KPP_ROW_6 0xe0
77 MX53_PAD_GPIO_5__KPP_ROW_7 0xe0
78 MX53_PAD_KEY_ROW2__KPP_ROW_2 0xe0
79 MX53_PAD_KEY_ROW3__KPP_ROW_3 0xe0
80 MX53_PAD_KEY_ROW4__KPP_ROW_4 0xe0
81 >;
82 };
83
84 pinctrl_audmux: audmuxgrp {
85 fsl,pins = <
86 MX53_PAD_KEY_COL0__AUDMUX_AUD5_TXC 0x80000000
87 MX53_PAD_KEY_ROW0__AUDMUX_AUD5_TXD 0x80000000
88 MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS 0x80000000
89 MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD 0x80000000
90 >;
91 };
92
93 pinctrl_esdhc2: esdhc2grp {
94 fsl,pins = <
95 MX53_PAD_SD2_CMD__ESDHC2_CMD 0x1d5
96 MX53_PAD_SD2_CLK__ESDHC2_CLK 0x1d5
97 MX53_PAD_SD2_DATA0__ESDHC2_DAT0 0x1d5
98 MX53_PAD_SD2_DATA1__ESDHC2_DAT1 0x1d5
99 MX53_PAD_SD2_DATA2__ESDHC2_DAT2 0x1d5
100 MX53_PAD_SD2_DATA3__ESDHC2_DAT3 0x1d5
101 >;
102 };
103
104 pinctrl_i2c3: i2c3grp {
105 fsl,pins = <
106 MX53_PAD_GPIO_3__I2C3_SCL 0xc0000000
107 MX53_PAD_GPIO_6__I2C3_SDA 0xc0000000
108 >;
109 };
110 };
111};
112
113&audmux {
114 pinctrl-names = "default";
115 pinctrl-0 = <&pinctrl_audmux>; /* SSI1 */
116 status = "okay";
117};
118
119&esdhc2 {
120 pinctrl-names = "default";
121 pinctrl-0 = <&pinctrl_esdhc2>;
122 cd-gpios = <&gpio3 25 0>;
123 wp-gpios = <&gpio2 19 0>;
124 vmmc-supply = <&reg_3p3v>;
125 status = "okay";
126};
127
128&i2c3 {
129 pinctrl-names = "default";
130 pinctrl-0 = <&pinctrl_i2c3>;
131 status = "okay";
132
133 sgtl5000: codec@0a {
134 compatible = "fsl,sgtl5000";
135 reg = <0x0a>;
136 VDDA-supply = <&reg_3p3v>;
137 VDDIO-supply = <&reg_3p3v>;
138 clocks = <&clks 150>;
139 };
140};
141
142&kpp {
143 pinctrl-names = "default";
144 pinctrl-0 = <&pinctrl_kpp_1>;
145 linux,keymap = <
146 0x0203003b /* KEY_F1 */
147 0x0603003c /* KEY_F2 */
148 0x0207003d /* KEY_F3 */
149 0x0607003e /* KEY_F4 */
150 >;
151 keypad,num-rows = <8>;
152 keypad,num-columns = <1>;
153 status = "okay";
154};
155
156&ssi2 {
157 fsl,mode = "i2s-slave";
158 status = "okay";
159};
diff --git a/arch/arm/boot/dts/imx53-voipac-dmm-668.dtsi b/arch/arm/boot/dts/imx53-voipac-dmm-668.dtsi
new file mode 100644
index 000000000000..ba689fbd0e41
--- /dev/null
+++ b/arch/arm/boot/dts/imx53-voipac-dmm-668.dtsi
@@ -0,0 +1,277 @@
1/*
2 * Copyright 2013 Rostislav Lisovy <lisovy@gmail.com>, PiKRON s.r.o.
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 "imx53.dtsi"
13
14/ {
15 model = "Voipac i.MX53 X53-DMM-668";
16 compatible = "voipac,imx53-dmm-668", "fsl,imx53";
17
18 memory@70000000 {
19 device_type = "memory";
20 reg = <0x70000000 0x20000000>;
21 };
22
23 memory@b0000000 {
24 device_type = "memory";
25 reg = <0xb0000000 0x20000000>;
26 };
27
28 regulators {
29 compatible = "simple-bus";
30 #address-cells = <1>;
31 #size-cells = <0>;
32
33 reg_3p3v: regulator@0 {
34 compatible = "regulator-fixed";
35 reg = <0>;
36 regulator-name = "3P3V";
37 regulator-min-microvolt = <3300000>;
38 regulator-max-microvolt = <3300000>;
39 regulator-always-on;
40 };
41
42 reg_usb_vbus: regulator@1 {
43 compatible = "regulator-fixed";
44 reg = <1>;
45 regulator-name = "usb_vbus";
46 regulator-min-microvolt = <5000000>;
47 regulator-max-microvolt = <5000000>;
48 gpio = <&gpio3 31 0>; /* PEN */
49 enable-active-high;
50 };
51 };
52};
53
54&iomuxc {
55 pinctrl-names = "default";
56 pinctrl-0 = <&pinctrl_hog>;
57
58 imx53-voipac {
59 pinctrl_hog: hoggrp {
60 fsl,pins = <
61 /* Make DA9053 regulator functional */
62 MX53_PAD_GPIO_16__GPIO7_11 0x80000000
63 /* FEC Power enable */
64 MX53_PAD_GPIO_11__GPIO4_1 0x80000000
65 /* FEC RST */
66 MX53_PAD_GPIO_12__GPIO4_2 0x80000000
67 >;
68 };
69
70 pinctrl_ecspi1: ecspi1grp {
71 fsl,pins = <
72 MX53_PAD_EIM_D16__ECSPI1_SCLK 0x80000000
73 MX53_PAD_EIM_D17__ECSPI1_MISO 0x80000000
74 MX53_PAD_EIM_D18__ECSPI1_MOSI 0x80000000
75 >;
76 };
77
78 pinctrl_fec: fecgrp {
79 fsl,pins = <
80 MX53_PAD_FEC_MDC__FEC_MDC 0x80000000
81 MX53_PAD_FEC_MDIO__FEC_MDIO 0x80000000
82 MX53_PAD_FEC_REF_CLK__FEC_TX_CLK 0x80000000
83 MX53_PAD_FEC_RX_ER__FEC_RX_ER 0x80000000
84 MX53_PAD_FEC_CRS_DV__FEC_RX_DV 0x80000000
85 MX53_PAD_FEC_RXD1__FEC_RDATA_1 0x80000000
86 MX53_PAD_FEC_RXD0__FEC_RDATA_0 0x80000000
87 MX53_PAD_FEC_TX_EN__FEC_TX_EN 0x80000000
88 MX53_PAD_FEC_TXD1__FEC_TDATA_1 0x80000000
89 MX53_PAD_FEC_TXD0__FEC_TDATA_0 0x80000000
90 >;
91 };
92
93 pinctrl_i2c1: i2c1grp {
94 fsl,pins = <
95 MX53_PAD_EIM_D21__I2C1_SCL 0xc0000000
96 MX53_PAD_EIM_D28__I2C1_SDA 0xc0000000
97 >;
98 };
99
100 pinctrl_uart1: uart1grp {
101 fsl,pins = <
102 MX53_PAD_PATA_DIOW__UART1_TXD_MUX 0x1e4
103 MX53_PAD_PATA_DMACK__UART1_RXD_MUX 0x1e4
104 >;
105 };
106
107 pinctrl_nand: nandgrp {
108 fsl,pins = <
109 MX53_PAD_NANDF_WE_B__EMI_NANDF_WE_B 0x4
110 MX53_PAD_NANDF_RE_B__EMI_NANDF_RE_B 0x4
111 MX53_PAD_NANDF_CLE__EMI_NANDF_CLE 0x4
112 MX53_PAD_NANDF_ALE__EMI_NANDF_ALE 0x4
113 MX53_PAD_NANDF_WP_B__EMI_NANDF_WP_B 0xe0
114 MX53_PAD_NANDF_RB0__EMI_NANDF_RB_0 0xe0
115 MX53_PAD_NANDF_CS0__EMI_NANDF_CS_0 0x4
116 MX53_PAD_PATA_DATA0__EMI_NANDF_D_0 0xa4
117 MX53_PAD_PATA_DATA1__EMI_NANDF_D_1 0xa4
118 MX53_PAD_PATA_DATA2__EMI_NANDF_D_2 0xa4
119 MX53_PAD_PATA_DATA3__EMI_NANDF_D_3 0xa4
120 MX53_PAD_PATA_DATA4__EMI_NANDF_D_4 0xa4
121 MX53_PAD_PATA_DATA5__EMI_NANDF_D_5 0xa4
122 MX53_PAD_PATA_DATA6__EMI_NANDF_D_6 0xa4
123 MX53_PAD_PATA_DATA7__EMI_NANDF_D_7 0xa4
124 >;
125 };
126 };
127};
128
129&ecspi1 {
130 pinctrl-names = "default";
131 pinctrl-0 = <&pinctrl_ecspi1>;
132 fsl,spi-num-chipselects = <4>;
133 cs-gpios = <&gpio2 30 0>, <&gpio3 19 0>, <&gpio2 16 0>, <&gpio2 17 0>;
134 status = "okay";
135};
136
137&fec {
138 pinctrl-names = "default";
139 pinctrl-0 = <&pinctrl_fec>;
140 phy-mode = "rmii";
141 phy-reset-gpios = <&gpio4 2 0>;
142 status = "okay";
143};
144
145&i2c1 {
146 pinctrl-names = "default";
147 pinctrl-0 = <&pinctrl_i2c1>;
148 status = "okay";
149
150 pmic: dialog@48 {
151 compatible = "dlg,da9053-aa", "dlg,da9052";
152 reg = <0x48>;
153 interrupt-parent = <&gpio7>;
154 interrupts = <11 0x8>; /* low-level active IRQ at GPIO7_11 */
155
156 regulators {
157 buck1_reg: buck1 {
158 regulator-name = "BUCKCORE";
159 regulator-min-microvolt = <1200000>;
160 regulator-max-microvolt = <1400000>;
161 regulator-always-on;
162 };
163
164 buck2_reg: buck2 {
165 regulator-name = "BUCKPRO";
166 regulator-min-microvolt = <900000>;
167 regulator-max-microvolt = <1350000>;
168 regulator-always-on;
169 };
170
171 buck3_reg: buck3 {
172 regulator-name = "BUCKMEM";
173 regulator-min-microvolt = <1420000>;
174 regulator-max-microvolt = <1580000>;
175 regulator-always-on;
176 };
177
178 buck4_reg: buck4 {
179 regulator-name = "BUCKPERI";
180 regulator-min-microvolt = <2370000>;
181 regulator-max-microvolt = <2630000>;
182 regulator-always-on;
183 };
184
185 ldo1_reg: ldo1 {
186 regulator-name = "ldo1_1v3";
187 regulator-min-microvolt = <1250000>;
188 regulator-max-microvolt = <1350000>;
189 regulator-boot-on;
190 regulator-always-on;
191 };
192
193 ldo2_reg: ldo2 {
194 regulator-name = "ldo2_1v3";
195 regulator-min-microvolt = <1250000>;
196 regulator-max-microvolt = <1350000>;
197 regulator-always-on;
198 };
199
200 ldo3_reg: ldo3 {
201 regulator-name = "ldo3_3v3";
202 regulator-min-microvolt = <3250000>;
203 regulator-max-microvolt = <3350000>;
204 regulator-always-on;
205 };
206
207 ldo4_reg: ldo4 {
208 regulator-name = "ldo4_2v775";
209 regulator-min-microvolt = <2770000>;
210 regulator-max-microvolt = <2780000>;
211 regulator-always-on;
212 };
213
214 ldo5_reg: ldo5 {
215 regulator-name = "ldo5_3v3";
216 regulator-min-microvolt = <3250000>;
217 regulator-max-microvolt = <3350000>;
218 regulator-always-on;
219 };
220
221 ldo6_reg: ldo6 {
222 regulator-name = "ldo6_1v3";
223 regulator-min-microvolt = <1250000>;
224 regulator-max-microvolt = <1350000>;
225 regulator-always-on;
226 };
227
228 ldo7_reg: ldo7 {
229 regulator-name = "ldo7_2v75";
230 regulator-min-microvolt = <2700000>;
231 regulator-max-microvolt = <2800000>;
232 regulator-always-on;
233 };
234
235 ldo8_reg: ldo8 {
236 regulator-name = "ldo8_1v8";
237 regulator-min-microvolt = <1750000>;
238 regulator-max-microvolt = <1850000>;
239 regulator-always-on;
240 };
241
242 ldo9_reg: ldo9 {
243 regulator-name = "ldo9_1v5";
244 regulator-min-microvolt = <1450000>;
245 regulator-max-microvolt = <1550000>;
246 regulator-always-on;
247 };
248
249 ldo10_reg: ldo10 {
250 regulator-name = "ldo10_1v3";
251 regulator-min-microvolt = <1250000>;
252 regulator-max-microvolt = <1350000>;
253 regulator-always-on;
254 };
255 };
256 };
257};
258
259&nfc {
260 pinctrl-names = "default";
261 pinctrl-0 = <&pinctrl_nand>;
262 nand-bus-width = <8>;
263 nand-ecc-mode = "hw";
264 status = "okay";
265};
266
267&uart1 {
268 pinctrl-names = "default";
269 pinctrl-0 = <&pinctrl_uart1>;
270 status = "okay";
271};
272
273&usbh1 {
274 vbus-supply = <&reg_usb_vbus>;
275 phy_type = "utmi";
276 status = "okay";
277};
diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi
index 4307e80b2d2e..b57ab57740f6 100644
--- a/arch/arm/boot/dts/imx53.dtsi
+++ b/arch/arm/boot/dts/imx53.dtsi
@@ -12,6 +12,9 @@
12 12
13#include "skeleton.dtsi" 13#include "skeleton.dtsi"
14#include "imx53-pinfunc.h" 14#include "imx53-pinfunc.h"
15#include <dt-bindings/clock/imx5-clock.h>
16#include <dt-bindings/gpio/gpio.h>
17#include <dt-bindings/input/input.h>
15 18
16/ { 19/ {
17 aliases { 20 aliases {
@@ -25,6 +28,10 @@
25 i2c0 = &i2c1; 28 i2c0 = &i2c1;
26 i2c1 = &i2c2; 29 i2c1 = &i2c2;
27 i2c2 = &i2c3; 30 i2c2 = &i2c3;
31 mmc0 = &esdhc1;
32 mmc1 = &esdhc2;
33 mmc2 = &esdhc3;
34 mmc3 = &esdhc4;
28 serial0 = &uart1; 35 serial0 = &uart1;
29 serial1 = &uart2; 36 serial1 = &uart2;
30 serial2 = &uart3; 37 serial2 = &uart3;
@@ -45,6 +52,11 @@
45 }; 52 };
46 }; 53 };
47 54
55 display-subsystem {
56 compatible = "fsl,imx-display-subsystem";
57 ports = <&ipu_di0>, <&ipu_di1>;
58 };
59
48 tzic: tz-interrupt-controller@0fffc000 { 60 tzic: tz-interrupt-controller@0fffc000 {
49 compatible = "fsl,imx53-tzic", "fsl,tzic"; 61 compatible = "fsl,imx53-tzic", "fsl,tzic";
50 interrupt-controller; 62 interrupt-controller;
@@ -84,14 +96,63 @@
84 interrupt-parent = <&tzic>; 96 interrupt-parent = <&tzic>;
85 ranges; 97 ranges;
86 98
99 sata: sata@10000000 {
100 compatible = "fsl,imx53-ahci";
101 reg = <0x10000000 0x1000>;
102 interrupts = <28>;
103 clocks = <&clks IMX5_CLK_SATA_GATE>,
104 <&clks IMX5_CLK_SATA_REF>,
105 <&clks IMX5_CLK_AHB>;
106 clock-names = "sata_gate", "sata_ref", "ahb";
107 status = "disabled";
108 };
109
87 ipu: ipu@18000000 { 110 ipu: ipu@18000000 {
88 #crtc-cells = <1>; 111 #address-cells = <1>;
112 #size-cells = <0>;
89 compatible = "fsl,imx53-ipu"; 113 compatible = "fsl,imx53-ipu";
90 reg = <0x18000000 0x080000000>; 114 reg = <0x18000000 0x080000000>;
91 interrupts = <11 10>; 115 interrupts = <11 10>;
92 clocks = <&clks 59>, <&clks 110>, <&clks 61>; 116 clocks = <&clks IMX5_CLK_IPU_GATE>,
117 <&clks IMX5_CLK_IPU_DI0_GATE>,
118 <&clks IMX5_CLK_IPU_DI1_GATE>;
93 clock-names = "bus", "di0", "di1"; 119 clock-names = "bus", "di0", "di1";
94 resets = <&src 2>; 120 resets = <&src 2>;
121
122 ipu_di0: port@2 {
123 #address-cells = <1>;
124 #size-cells = <0>;
125 reg = <2>;
126
127 ipu_di0_disp0: endpoint@0 {
128 reg = <0>;
129 };
130
131 ipu_di0_lvds0: endpoint@1 {
132 reg = <1>;
133 remote-endpoint = <&lvds0_in>;
134 };
135 };
136
137 ipu_di1: port@3 {
138 #address-cells = <1>;
139 #size-cells = <0>;
140 reg = <3>;
141
142 ipu_di1_disp1: endpoint@0 {
143 reg = <0>;
144 };
145
146 ipu_di1_lvds1: endpoint@1 {
147 reg = <1>;
148 remote-endpoint = <&lvds1_in>;
149 };
150
151 ipu_di1_tve: endpoint@2 {
152 reg = <2>;
153 remote-endpoint = <&tve_in>;
154 };
155 };
95 }; 156 };
96 157
97 aips@50000000 { /* AIPS1 */ 158 aips@50000000 { /* AIPS1 */
@@ -112,7 +173,9 @@
112 compatible = "fsl,imx53-esdhc"; 173 compatible = "fsl,imx53-esdhc";
113 reg = <0x50004000 0x4000>; 174 reg = <0x50004000 0x4000>;
114 interrupts = <1>; 175 interrupts = <1>;
115 clocks = <&clks 44>, <&clks 0>, <&clks 71>; 176 clocks = <&clks IMX5_CLK_ESDHC1_IPG_GATE>,
177 <&clks IMX5_CLK_DUMMY>,
178 <&clks IMX5_CLK_ESDHC1_PER_GATE>;
116 clock-names = "ipg", "ahb", "per"; 179 clock-names = "ipg", "ahb", "per";
117 bus-width = <4>; 180 bus-width = <4>;
118 status = "disabled"; 181 status = "disabled";
@@ -122,7 +185,9 @@
122 compatible = "fsl,imx53-esdhc"; 185 compatible = "fsl,imx53-esdhc";
123 reg = <0x50008000 0x4000>; 186 reg = <0x50008000 0x4000>;
124 interrupts = <2>; 187 interrupts = <2>;
125 clocks = <&clks 45>, <&clks 0>, <&clks 72>; 188 clocks = <&clks IMX5_CLK_ESDHC2_IPG_GATE>,
189 <&clks IMX5_CLK_DUMMY>,
190 <&clks IMX5_CLK_ESDHC2_PER_GATE>;
126 clock-names = "ipg", "ahb", "per"; 191 clock-names = "ipg", "ahb", "per";
127 bus-width = <4>; 192 bus-width = <4>;
128 status = "disabled"; 193 status = "disabled";
@@ -132,7 +197,8 @@
132 compatible = "fsl,imx53-uart", "fsl,imx21-uart"; 197 compatible = "fsl,imx53-uart", "fsl,imx21-uart";
133 reg = <0x5000c000 0x4000>; 198 reg = <0x5000c000 0x4000>;
134 interrupts = <33>; 199 interrupts = <33>;
135 clocks = <&clks 32>, <&clks 33>; 200 clocks = <&clks IMX5_CLK_UART3_IPG_GATE>,
201 <&clks IMX5_CLK_UART3_PER_GATE>;
136 clock-names = "ipg", "per"; 202 clock-names = "ipg", "per";
137 status = "disabled"; 203 status = "disabled";
138 }; 204 };
@@ -143,16 +209,19 @@
143 compatible = "fsl,imx53-ecspi", "fsl,imx51-ecspi"; 209 compatible = "fsl,imx53-ecspi", "fsl,imx51-ecspi";
144 reg = <0x50010000 0x4000>; 210 reg = <0x50010000 0x4000>;
145 interrupts = <36>; 211 interrupts = <36>;
146 clocks = <&clks 51>, <&clks 52>; 212 clocks = <&clks IMX5_CLK_ECSPI1_IPG_GATE>,
213 <&clks IMX5_CLK_ECSPI1_PER_GATE>;
147 clock-names = "ipg", "per"; 214 clock-names = "ipg", "per";
148 status = "disabled"; 215 status = "disabled";
149 }; 216 };
150 217
151 ssi2: ssi@50014000 { 218 ssi2: ssi@50014000 {
152 compatible = "fsl,imx53-ssi", "fsl,imx21-ssi"; 219 compatible = "fsl,imx53-ssi",
220 "fsl,imx51-ssi",
221 "fsl,imx21-ssi";
153 reg = <0x50014000 0x4000>; 222 reg = <0x50014000 0x4000>;
154 interrupts = <30>; 223 interrupts = <30>;
155 clocks = <&clks 49>; 224 clocks = <&clks IMX5_CLK_SSI2_IPG_GATE>;
156 dmas = <&sdma 24 1 0>, 225 dmas = <&sdma 24 1 0>,
157 <&sdma 25 1 0>; 226 <&sdma 25 1 0>;
158 dma-names = "rx", "tx"; 227 dma-names = "rx", "tx";
@@ -165,7 +234,9 @@
165 compatible = "fsl,imx53-esdhc"; 234 compatible = "fsl,imx53-esdhc";
166 reg = <0x50020000 0x4000>; 235 reg = <0x50020000 0x4000>;
167 interrupts = <3>; 236 interrupts = <3>;
168 clocks = <&clks 46>, <&clks 0>, <&clks 73>; 237 clocks = <&clks IMX5_CLK_ESDHC3_IPG_GATE>,
238 <&clks IMX5_CLK_DUMMY>,
239 <&clks IMX5_CLK_ESDHC3_PER_GATE>;
169 clock-names = "ipg", "ahb", "per"; 240 clock-names = "ipg", "ahb", "per";
170 bus-width = <4>; 241 bus-width = <4>;
171 status = "disabled"; 242 status = "disabled";
@@ -175,7 +246,9 @@
175 compatible = "fsl,imx53-esdhc"; 246 compatible = "fsl,imx53-esdhc";
176 reg = <0x50024000 0x4000>; 247 reg = <0x50024000 0x4000>;
177 interrupts = <4>; 248 interrupts = <4>;
178 clocks = <&clks 47>, <&clks 0>, <&clks 74>; 249 clocks = <&clks IMX5_CLK_ESDHC4_IPG_GATE>,
250 <&clks IMX5_CLK_DUMMY>,
251 <&clks IMX5_CLK_ESDHC4_PER_GATE>;
179 clock-names = "ipg", "ahb", "per"; 252 clock-names = "ipg", "ahb", "per";
180 bus-width = <4>; 253 bus-width = <4>;
181 status = "disabled"; 254 status = "disabled";
@@ -184,14 +257,14 @@
184 257
185 usbphy0: usbphy@0 { 258 usbphy0: usbphy@0 {
186 compatible = "usb-nop-xceiv"; 259 compatible = "usb-nop-xceiv";
187 clocks = <&clks 124>; 260 clocks = <&clks IMX5_CLK_USB_PHY1_GATE>;
188 clock-names = "main_clk"; 261 clock-names = "main_clk";
189 status = "okay"; 262 status = "okay";
190 }; 263 };
191 264
192 usbphy1: usbphy@1 { 265 usbphy1: usbphy@1 {
193 compatible = "usb-nop-xceiv"; 266 compatible = "usb-nop-xceiv";
194 clocks = <&clks 125>; 267 clocks = <&clks IMX5_CLK_USB_PHY2_GATE>;
195 clock-names = "main_clk"; 268 clock-names = "main_clk";
196 status = "okay"; 269 status = "okay";
197 }; 270 };
@@ -200,7 +273,7 @@
200 compatible = "fsl,imx53-usb", "fsl,imx27-usb"; 273 compatible = "fsl,imx53-usb", "fsl,imx27-usb";
201 reg = <0x53f80000 0x0200>; 274 reg = <0x53f80000 0x0200>;
202 interrupts = <18>; 275 interrupts = <18>;
203 clocks = <&clks 108>; 276 clocks = <&clks IMX5_CLK_USBOH3_GATE>;
204 fsl,usbmisc = <&usbmisc 0>; 277 fsl,usbmisc = <&usbmisc 0>;
205 fsl,usbphy = <&usbphy0>; 278 fsl,usbphy = <&usbphy0>;
206 status = "disabled"; 279 status = "disabled";
@@ -210,7 +283,7 @@
210 compatible = "fsl,imx53-usb", "fsl,imx27-usb"; 283 compatible = "fsl,imx53-usb", "fsl,imx27-usb";
211 reg = <0x53f80200 0x0200>; 284 reg = <0x53f80200 0x0200>;
212 interrupts = <14>; 285 interrupts = <14>;
213 clocks = <&clks 108>; 286 clocks = <&clks IMX5_CLK_USBOH3_GATE>;
214 fsl,usbmisc = <&usbmisc 1>; 287 fsl,usbmisc = <&usbmisc 1>;
215 fsl,usbphy = <&usbphy1>; 288 fsl,usbphy = <&usbphy1>;
216 status = "disabled"; 289 status = "disabled";
@@ -220,7 +293,7 @@
220 compatible = "fsl,imx53-usb", "fsl,imx27-usb"; 293 compatible = "fsl,imx53-usb", "fsl,imx27-usb";
221 reg = <0x53f80400 0x0200>; 294 reg = <0x53f80400 0x0200>;
222 interrupts = <16>; 295 interrupts = <16>;
223 clocks = <&clks 108>; 296 clocks = <&clks IMX5_CLK_USBOH3_GATE>;
224 fsl,usbmisc = <&usbmisc 2>; 297 fsl,usbmisc = <&usbmisc 2>;
225 status = "disabled"; 298 status = "disabled";
226 }; 299 };
@@ -229,7 +302,7 @@
229 compatible = "fsl,imx53-usb", "fsl,imx27-usb"; 302 compatible = "fsl,imx53-usb", "fsl,imx27-usb";
230 reg = <0x53f80600 0x0200>; 303 reg = <0x53f80600 0x0200>;
231 interrupts = <17>; 304 interrupts = <17>;
232 clocks = <&clks 108>; 305 clocks = <&clks IMX5_CLK_USBOH3_GATE>;
233 fsl,usbmisc = <&usbmisc 3>; 306 fsl,usbmisc = <&usbmisc 3>;
234 status = "disabled"; 307 status = "disabled";
235 }; 308 };
@@ -238,7 +311,7 @@
238 #index-cells = <1>; 311 #index-cells = <1>;
239 compatible = "fsl,imx53-usbmisc"; 312 compatible = "fsl,imx53-usbmisc";
240 reg = <0x53f80800 0x200>; 313 reg = <0x53f80800 0x200>;
241 clocks = <&clks 108>; 314 clocks = <&clks IMX5_CLK_USBOH3_GATE>;
242 }; 315 };
243 316
244 gpio1: gpio@53f84000 { 317 gpio1: gpio@53f84000 {
@@ -281,18 +354,26 @@
281 #interrupt-cells = <2>; 354 #interrupt-cells = <2>;
282 }; 355 };
283 356
357 kpp: kpp@53f94000 {
358 compatible = "fsl,imx53-kpp", "fsl,imx21-kpp";
359 reg = <0x53f94000 0x4000>;
360 interrupts = <60>;
361 clocks = <&clks IMX5_CLK_DUMMY>;
362 status = "disabled";
363 };
364
284 wdog1: wdog@53f98000 { 365 wdog1: wdog@53f98000 {
285 compatible = "fsl,imx53-wdt", "fsl,imx21-wdt"; 366 compatible = "fsl,imx53-wdt", "fsl,imx21-wdt";
286 reg = <0x53f98000 0x4000>; 367 reg = <0x53f98000 0x4000>;
287 interrupts = <58>; 368 interrupts = <58>;
288 clocks = <&clks 0>; 369 clocks = <&clks IMX5_CLK_DUMMY>;
289 }; 370 };
290 371
291 wdog2: wdog@53f9c000 { 372 wdog2: wdog@53f9c000 {
292 compatible = "fsl,imx53-wdt", "fsl,imx21-wdt"; 373 compatible = "fsl,imx53-wdt", "fsl,imx21-wdt";
293 reg = <0x53f9c000 0x4000>; 374 reg = <0x53f9c000 0x4000>;
294 interrupts = <59>; 375 interrupts = <59>;
295 clocks = <&clks 0>; 376 clocks = <&clks IMX5_CLK_DUMMY>;
296 status = "disabled"; 377 status = "disabled";
297 }; 378 };
298 379
@@ -300,521 +381,14 @@
300 compatible = "fsl,imx53-gpt", "fsl,imx31-gpt"; 381 compatible = "fsl,imx53-gpt", "fsl,imx31-gpt";
301 reg = <0x53fa0000 0x4000>; 382 reg = <0x53fa0000 0x4000>;
302 interrupts = <39>; 383 interrupts = <39>;
303 clocks = <&clks 36>, <&clks 41>; 384 clocks = <&clks IMX5_CLK_GPT_IPG_GATE>,
385 <&clks IMX5_CLK_GPT_HF_GATE>;
304 clock-names = "ipg", "per"; 386 clock-names = "ipg", "per";
305 }; 387 };
306 388
307 iomuxc: iomuxc@53fa8000 { 389 iomuxc: iomuxc@53fa8000 {
308 compatible = "fsl,imx53-iomuxc"; 390 compatible = "fsl,imx53-iomuxc";
309 reg = <0x53fa8000 0x4000>; 391 reg = <0x53fa8000 0x4000>;
310
311 audmux {
312 pinctrl_audmux_1: audmuxgrp-1 {
313 fsl,pins = <
314 MX53_PAD_KEY_COL0__AUDMUX_AUD5_TXC 0x80000000
315 MX53_PAD_KEY_ROW0__AUDMUX_AUD5_TXD 0x80000000
316 MX53_PAD_KEY_COL1__AUDMUX_AUD5_TXFS 0x80000000
317 MX53_PAD_KEY_ROW1__AUDMUX_AUD5_RXD 0x80000000
318 >;
319 };
320
321 pinctrl_audmux_2: audmuxgrp-2 {
322 fsl,pins = <
323 MX53_PAD_SD2_DATA3__AUDMUX_AUD4_TXC 0x80000000
324 MX53_PAD_SD2_DATA2__AUDMUX_AUD4_TXD 0x80000000
325 MX53_PAD_SD2_DATA1__AUDMUX_AUD4_TXFS 0x80000000
326 MX53_PAD_SD2_DATA0__AUDMUX_AUD4_RXD 0x80000000
327 >;
328 };
329
330 pinctrl_audmux_3: audmuxgrp-3 {
331 fsl,pins = <
332 MX53_PAD_CSI0_DAT4__AUDMUX_AUD3_TXC 0x80000000
333 MX53_PAD_CSI0_DAT5__AUDMUX_AUD3_TXD 0x80000000
334 MX53_PAD_CSI0_DAT6__AUDMUX_AUD3_TXFS 0x80000000
335 MX53_PAD_CSI0_DAT7__AUDMUX_AUD3_RXD 0x80000000
336 >;
337 };
338 };
339
340 fec {
341 pinctrl_fec_1: fecgrp-1 {
342 fsl,pins = <
343 MX53_PAD_FEC_MDC__FEC_MDC 0x80000000
344 MX53_PAD_FEC_MDIO__FEC_MDIO 0x80000000
345 MX53_PAD_FEC_REF_CLK__FEC_TX_CLK 0x80000000
346 MX53_PAD_FEC_RX_ER__FEC_RX_ER 0x80000000
347 MX53_PAD_FEC_CRS_DV__FEC_RX_DV 0x80000000
348 MX53_PAD_FEC_RXD1__FEC_RDATA_1 0x80000000
349 MX53_PAD_FEC_RXD0__FEC_RDATA_0 0x80000000
350 MX53_PAD_FEC_TX_EN__FEC_TX_EN 0x80000000
351 MX53_PAD_FEC_TXD1__FEC_TDATA_1 0x80000000
352 MX53_PAD_FEC_TXD0__FEC_TDATA_0 0x80000000
353 >;
354 };
355
356 pinctrl_fec_2: fecgrp-2 {
357 fsl,pins = <
358 MX53_PAD_FEC_MDC__FEC_MDC 0x80000000
359 MX53_PAD_FEC_MDIO__FEC_MDIO 0x80000000
360 MX53_PAD_FEC_REF_CLK__FEC_TX_CLK 0x80000000
361 MX53_PAD_FEC_RX_ER__FEC_RX_ER 0x80000000
362 MX53_PAD_FEC_CRS_DV__FEC_RX_DV 0x80000000
363 MX53_PAD_FEC_RXD1__FEC_RDATA_1 0x80000000
364 MX53_PAD_FEC_RXD0__FEC_RDATA_0 0x80000000
365 MX53_PAD_FEC_TX_EN__FEC_TX_EN 0x80000000
366 MX53_PAD_FEC_TXD1__FEC_TDATA_1 0x80000000
367 MX53_PAD_FEC_TXD0__FEC_TDATA_0 0x80000000
368 MX53_PAD_KEY_ROW1__FEC_COL 0x80000000
369 MX53_PAD_KEY_COL3__FEC_CRS 0x80000000
370 MX53_PAD_KEY_COL2__FEC_RDATA_2 0x80000000
371 MX53_PAD_KEY_COL0__FEC_RDATA_3 0x80000000
372 MX53_PAD_KEY_COL1__FEC_RX_CLK 0x80000000
373 MX53_PAD_KEY_ROW2__FEC_TDATA_2 0x80000000
374 MX53_PAD_GPIO_19__FEC_TDATA_3 0x80000000
375 MX53_PAD_KEY_ROW0__FEC_TX_ER 0x80000000
376 >;
377 };
378 };
379
380 csi {
381 pinctrl_csi_1: csigrp-1 {
382 fsl,pins = <
383 MX53_PAD_CSI0_DATA_EN__IPU_CSI0_DATA_EN 0x1d5
384 MX53_PAD_CSI0_VSYNC__IPU_CSI0_VSYNC 0x1d5
385 MX53_PAD_CSI0_MCLK__IPU_CSI0_HSYNC 0x1d5
386 MX53_PAD_CSI0_PIXCLK__IPU_CSI0_PIXCLK 0x1d5
387 MX53_PAD_CSI0_DAT19__IPU_CSI0_D_19 0x1d5
388 MX53_PAD_CSI0_DAT18__IPU_CSI0_D_18 0x1d5
389 MX53_PAD_CSI0_DAT17__IPU_CSI0_D_17 0x1d5
390 MX53_PAD_CSI0_DAT16__IPU_CSI0_D_16 0x1d5
391 MX53_PAD_CSI0_DAT15__IPU_CSI0_D_15 0x1d5
392 MX53_PAD_CSI0_DAT14__IPU_CSI0_D_14 0x1d5
393 MX53_PAD_CSI0_DAT13__IPU_CSI0_D_13 0x1d5
394 MX53_PAD_CSI0_DAT12__IPU_CSI0_D_12 0x1d5
395 MX53_PAD_CSI0_DAT11__IPU_CSI0_D_11 0x1d5
396 MX53_PAD_CSI0_DAT10__IPU_CSI0_D_10 0x1d5
397 MX53_PAD_CSI0_DAT9__IPU_CSI0_D_9 0x1d5
398 MX53_PAD_CSI0_DAT8__IPU_CSI0_D_8 0x1d5
399 MX53_PAD_CSI0_DAT7__IPU_CSI0_D_7 0x1d5
400 MX53_PAD_CSI0_DAT6__IPU_CSI0_D_6 0x1d5
401 MX53_PAD_CSI0_DAT5__IPU_CSI0_D_5 0x1d5
402 MX53_PAD_CSI0_DAT4__IPU_CSI0_D_4 0x1d5
403 MX53_PAD_CSI0_PIXCLK__IPU_CSI0_PIXCLK 0x1d5
404 >;
405 };
406
407 pinctrl_csi_2: csigrp-2 {
408 fsl,pins = <
409 MX53_PAD_CSI0_VSYNC__IPU_CSI0_VSYNC 0x1d5
410 MX53_PAD_CSI0_MCLK__IPU_CSI0_HSYNC 0x1d5
411 MX53_PAD_CSI0_PIXCLK__IPU_CSI0_PIXCLK 0x1d5
412 MX53_PAD_CSI0_DAT19__IPU_CSI0_D_19 0x1d5
413 MX53_PAD_CSI0_DAT18__IPU_CSI0_D_18 0x1d5
414 MX53_PAD_CSI0_DAT17__IPU_CSI0_D_17 0x1d5
415 MX53_PAD_CSI0_DAT16__IPU_CSI0_D_16 0x1d5
416 MX53_PAD_CSI0_DAT15__IPU_CSI0_D_15 0x1d5
417 MX53_PAD_CSI0_DAT14__IPU_CSI0_D_14 0x1d5
418 MX53_PAD_CSI0_DAT13__IPU_CSI0_D_13 0x1d5
419 MX53_PAD_CSI0_DAT12__IPU_CSI0_D_12 0x1d5
420 >;
421 };
422 };
423
424 cspi {
425 pinctrl_cspi_1: cspigrp-1 {
426 fsl,pins = <
427 MX53_PAD_SD1_DATA0__CSPI_MISO 0x1d5
428 MX53_PAD_SD1_CMD__CSPI_MOSI 0x1d5
429 MX53_PAD_SD1_CLK__CSPI_SCLK 0x1d5
430 >;
431 };
432
433 pinctrl_cspi_2: cspigrp-2 {
434 fsl,pins = <
435 MX53_PAD_EIM_D22__CSPI_MISO 0x1d5
436 MX53_PAD_EIM_D28__CSPI_MOSI 0x1d5
437 MX53_PAD_EIM_D21__CSPI_SCLK 0x1d5
438 >;
439 };
440 };
441
442 ecspi1 {
443 pinctrl_ecspi1_1: ecspi1grp-1 {
444 fsl,pins = <
445 MX53_PAD_EIM_D16__ECSPI1_SCLK 0x80000000
446 MX53_PAD_EIM_D17__ECSPI1_MISO 0x80000000
447 MX53_PAD_EIM_D18__ECSPI1_MOSI 0x80000000
448 >;
449 };
450
451 pinctrl_ecspi1_2: ecspi1grp-2 {
452 fsl,pins = <
453 MX53_PAD_GPIO_19__ECSPI1_RDY 0x80000000
454 MX53_PAD_EIM_EB2__ECSPI1_SS0 0x80000000
455 MX53_PAD_EIM_D16__ECSPI1_SCLK 0x80000000
456 MX53_PAD_EIM_D17__ECSPI1_MISO 0x80000000
457 MX53_PAD_EIM_D18__ECSPI1_MOSI 0x80000000
458 MX53_PAD_EIM_D19__ECSPI1_SS1 0x80000000
459 >;
460 };
461 };
462
463 ecspi2 {
464 pinctrl_ecspi2_1: ecspi2grp-1 {
465 fsl,pins = <
466 MX53_PAD_EIM_OE__ECSPI2_MISO 0x80000000
467 MX53_PAD_EIM_CS1__ECSPI2_MOSI 0x80000000
468 MX53_PAD_EIM_CS0__ECSPI2_SCLK 0x80000000
469 >;
470 };
471 };
472
473 esdhc1 {
474 pinctrl_esdhc1_1: esdhc1grp-1 {
475 fsl,pins = <
476 MX53_PAD_SD1_DATA0__ESDHC1_DAT0 0x1d5
477 MX53_PAD_SD1_DATA1__ESDHC1_DAT1 0x1d5
478 MX53_PAD_SD1_DATA2__ESDHC1_DAT2 0x1d5
479 MX53_PAD_SD1_DATA3__ESDHC1_DAT3 0x1d5
480 MX53_PAD_SD1_CMD__ESDHC1_CMD 0x1d5
481 MX53_PAD_SD1_CLK__ESDHC1_CLK 0x1d5
482 >;
483 };
484
485 pinctrl_esdhc1_2: esdhc1grp-2 {
486 fsl,pins = <
487 MX53_PAD_SD1_DATA0__ESDHC1_DAT0 0x1d5
488 MX53_PAD_SD1_DATA1__ESDHC1_DAT1 0x1d5
489 MX53_PAD_SD1_DATA2__ESDHC1_DAT2 0x1d5
490 MX53_PAD_SD1_DATA3__ESDHC1_DAT3 0x1d5
491 MX53_PAD_PATA_DATA8__ESDHC1_DAT4 0x1d5
492 MX53_PAD_PATA_DATA9__ESDHC1_DAT5 0x1d5
493 MX53_PAD_PATA_DATA10__ESDHC1_DAT6 0x1d5
494 MX53_PAD_PATA_DATA11__ESDHC1_DAT7 0x1d5
495 MX53_PAD_SD1_CMD__ESDHC1_CMD 0x1d5
496 MX53_PAD_SD1_CLK__ESDHC1_CLK 0x1d5
497 >;
498 };
499 };
500
501 esdhc2 {
502 pinctrl_esdhc2_1: esdhc2grp-1 {
503 fsl,pins = <
504 MX53_PAD_SD2_CMD__ESDHC2_CMD 0x1d5
505 MX53_PAD_SD2_CLK__ESDHC2_CLK 0x1d5
506 MX53_PAD_SD2_DATA0__ESDHC2_DAT0 0x1d5
507 MX53_PAD_SD2_DATA1__ESDHC2_DAT1 0x1d5
508 MX53_PAD_SD2_DATA2__ESDHC2_DAT2 0x1d5
509 MX53_PAD_SD2_DATA3__ESDHC2_DAT3 0x1d5
510 >;
511 };
512 };
513
514 esdhc3 {
515 pinctrl_esdhc3_1: esdhc3grp-1 {
516 fsl,pins = <
517 MX53_PAD_PATA_DATA8__ESDHC3_DAT0 0x1d5
518 MX53_PAD_PATA_DATA9__ESDHC3_DAT1 0x1d5
519 MX53_PAD_PATA_DATA10__ESDHC3_DAT2 0x1d5
520 MX53_PAD_PATA_DATA11__ESDHC3_DAT3 0x1d5
521 MX53_PAD_PATA_DATA0__ESDHC3_DAT4 0x1d5
522 MX53_PAD_PATA_DATA1__ESDHC3_DAT5 0x1d5
523 MX53_PAD_PATA_DATA2__ESDHC3_DAT6 0x1d5
524 MX53_PAD_PATA_DATA3__ESDHC3_DAT7 0x1d5
525 MX53_PAD_PATA_RESET_B__ESDHC3_CMD 0x1d5
526 MX53_PAD_PATA_IORDY__ESDHC3_CLK 0x1d5
527 >;
528 };
529 };
530
531 can1 {
532 pinctrl_can1_1: can1grp-1 {
533 fsl,pins = <
534 MX53_PAD_PATA_INTRQ__CAN1_TXCAN 0x80000000
535 MX53_PAD_PATA_DIOR__CAN1_RXCAN 0x80000000
536 >;
537 };
538
539 pinctrl_can1_2: can1grp-2 {
540 fsl,pins = <
541 MX53_PAD_KEY_COL2__CAN1_TXCAN 0x80000000
542 MX53_PAD_KEY_ROW2__CAN1_RXCAN 0x80000000
543 >;
544 };
545
546 pinctrl_can1_3: can1grp-3 {
547 fsl,pins = <
548 MX53_PAD_GPIO_7__CAN1_TXCAN 0x80000000
549 MX53_PAD_GPIO_8__CAN1_RXCAN 0x80000000
550 >;
551 };
552 };
553
554 can2 {
555 pinctrl_can2_1: can2grp-1 {
556 fsl,pins = <
557 MX53_PAD_KEY_COL4__CAN2_TXCAN 0x80000000
558 MX53_PAD_KEY_ROW4__CAN2_RXCAN 0x80000000
559 >;
560 };
561 };
562
563 i2c1 {
564 pinctrl_i2c1_1: i2c1grp-1 {
565 fsl,pins = <
566 MX53_PAD_CSI0_DAT8__I2C1_SDA 0xc0000000
567 MX53_PAD_CSI0_DAT9__I2C1_SCL 0xc0000000
568 >;
569 };
570
571 pinctrl_i2c1_2: i2c1grp-2 {
572 fsl,pins = <
573 MX53_PAD_EIM_D21__I2C1_SCL 0xc0000000
574 MX53_PAD_EIM_D28__I2C1_SDA 0xc0000000
575 >;
576 };
577 };
578
579 i2c2 {
580 pinctrl_i2c2_1: i2c2grp-1 {
581 fsl,pins = <
582 MX53_PAD_KEY_ROW3__I2C2_SDA 0xc0000000
583 MX53_PAD_KEY_COL3__I2C2_SCL 0xc0000000
584 >;
585 };
586
587 pinctrl_i2c2_2: i2c2grp-2 {
588 fsl,pins = <
589 MX53_PAD_EIM_D16__I2C2_SDA 0xc0000000
590 MX53_PAD_EIM_EB2__I2C2_SCL 0xc0000000
591 >;
592 };
593 };
594
595 i2c3 {
596 pinctrl_i2c3_1: i2c3grp-1 {
597 fsl,pins = <
598 MX53_PAD_GPIO_6__I2C3_SDA 0xc0000000
599 MX53_PAD_GPIO_5__I2C3_SCL 0xc0000000
600 >;
601 };
602 };
603
604 ipu_disp0 {
605 pinctrl_ipu_disp0_1: ipudisp0grp-1 {
606 fsl,pins = <
607 MX53_PAD_DI0_DISP_CLK__IPU_DI0_DISP_CLK 0x5
608 MX53_PAD_DI0_PIN15__IPU_DI0_PIN15 0x5
609 MX53_PAD_DI0_PIN2__IPU_DI0_PIN2 0x5
610 MX53_PAD_DI0_PIN3__IPU_DI0_PIN3 0x5
611 MX53_PAD_DISP0_DAT0__IPU_DISP0_DAT_0 0x5
612 MX53_PAD_DISP0_DAT1__IPU_DISP0_DAT_1 0x5
613 MX53_PAD_DISP0_DAT2__IPU_DISP0_DAT_2 0x5
614 MX53_PAD_DISP0_DAT3__IPU_DISP0_DAT_3 0x5
615 MX53_PAD_DISP0_DAT4__IPU_DISP0_DAT_4 0x5
616 MX53_PAD_DISP0_DAT5__IPU_DISP0_DAT_5 0x5
617 MX53_PAD_DISP0_DAT6__IPU_DISP0_DAT_6 0x5
618 MX53_PAD_DISP0_DAT7__IPU_DISP0_DAT_7 0x5
619 MX53_PAD_DISP0_DAT8__IPU_DISP0_DAT_8 0x5
620 MX53_PAD_DISP0_DAT9__IPU_DISP0_DAT_9 0x5
621 MX53_PAD_DISP0_DAT10__IPU_DISP0_DAT_10 0x5
622 MX53_PAD_DISP0_DAT11__IPU_DISP0_DAT_11 0x5
623 MX53_PAD_DISP0_DAT12__IPU_DISP0_DAT_12 0x5
624 MX53_PAD_DISP0_DAT13__IPU_DISP0_DAT_13 0x5
625 MX53_PAD_DISP0_DAT14__IPU_DISP0_DAT_14 0x5
626 MX53_PAD_DISP0_DAT15__IPU_DISP0_DAT_15 0x5
627 MX53_PAD_DISP0_DAT16__IPU_DISP0_DAT_16 0x5
628 MX53_PAD_DISP0_DAT17__IPU_DISP0_DAT_17 0x5
629 MX53_PAD_DISP0_DAT18__IPU_DISP0_DAT_18 0x5
630 MX53_PAD_DISP0_DAT19__IPU_DISP0_DAT_19 0x5
631 MX53_PAD_DISP0_DAT20__IPU_DISP0_DAT_20 0x5
632 MX53_PAD_DISP0_DAT21__IPU_DISP0_DAT_21 0x5
633 MX53_PAD_DISP0_DAT22__IPU_DISP0_DAT_22 0x5
634 MX53_PAD_DISP0_DAT23__IPU_DISP0_DAT_23 0x5
635 >;
636 };
637 };
638
639 ipu_disp1 {
640 pinctrl_ipu_disp1_1: ipudisp1grp-1 {
641 fsl,pins = <
642 MX53_PAD_EIM_DA9__IPU_DISP1_DAT_0 0x5
643 MX53_PAD_EIM_DA8__IPU_DISP1_DAT_1 0x5
644 MX53_PAD_EIM_DA7__IPU_DISP1_DAT_2 0x5
645 MX53_PAD_EIM_DA6__IPU_DISP1_DAT_3 0x5
646 MX53_PAD_EIM_DA5__IPU_DISP1_DAT_4 0x5
647 MX53_PAD_EIM_DA4__IPU_DISP1_DAT_5 0x5
648 MX53_PAD_EIM_DA3__IPU_DISP1_DAT_6 0x5
649 MX53_PAD_EIM_DA2__IPU_DISP1_DAT_7 0x5
650 MX53_PAD_EIM_DA1__IPU_DISP1_DAT_8 0x5
651 MX53_PAD_EIM_DA0__IPU_DISP1_DAT_9 0x5
652 MX53_PAD_EIM_EB1__IPU_DISP1_DAT_10 0x5
653 MX53_PAD_EIM_EB0__IPU_DISP1_DAT_11 0x5
654 MX53_PAD_EIM_A17__IPU_DISP1_DAT_12 0x5
655 MX53_PAD_EIM_A18__IPU_DISP1_DAT_13 0x5
656 MX53_PAD_EIM_A19__IPU_DISP1_DAT_14 0x5
657 MX53_PAD_EIM_A20__IPU_DISP1_DAT_15 0x5
658 MX53_PAD_EIM_A21__IPU_DISP1_DAT_16 0x5
659 MX53_PAD_EIM_A22__IPU_DISP1_DAT_17 0x5
660 MX53_PAD_EIM_A23__IPU_DISP1_DAT_18 0x5
661 MX53_PAD_EIM_A24__IPU_DISP1_DAT_19 0x5
662 MX53_PAD_EIM_D31__IPU_DISP1_DAT_20 0x5
663 MX53_PAD_EIM_D30__IPU_DISP1_DAT_21 0x5
664 MX53_PAD_EIM_D26__IPU_DISP1_DAT_22 0x5
665 MX53_PAD_EIM_D27__IPU_DISP1_DAT_23 0x5
666 MX53_PAD_EIM_A16__IPU_DI1_DISP_CLK 0x5
667 MX53_PAD_EIM_DA13__IPU_DI1_D0_CS 0x5
668 MX53_PAD_EIM_DA14__IPU_DI1_D1_CS 0x5
669 MX53_PAD_EIM_DA15__IPU_DI1_PIN1 0x5
670 MX53_PAD_EIM_DA11__IPU_DI1_PIN2 0x5
671 MX53_PAD_EIM_DA12__IPU_DI1_PIN3 0x5
672 MX53_PAD_EIM_A25__IPU_DI1_PIN12 0x5
673 MX53_PAD_EIM_DA10__IPU_DI1_PIN15 0x5
674 >;
675 };
676 };
677
678 ipu_disp2 {
679 pinctrl_ipu_disp2_1: ipudisp2grp-1 {
680 fsl,pins = <
681 MX53_PAD_LVDS0_TX0_P__LDB_LVDS0_TX0 0x80000000
682 MX53_PAD_LVDS0_TX1_P__LDB_LVDS0_TX1 0x80000000
683 MX53_PAD_LVDS0_TX2_P__LDB_LVDS0_TX2 0x80000000
684 MX53_PAD_LVDS0_TX3_P__LDB_LVDS0_TX3 0x80000000
685 MX53_PAD_LVDS0_CLK_P__LDB_LVDS0_CLK 0x80000000
686 MX53_PAD_LVDS1_TX0_P__LDB_LVDS1_TX0 0x80000000
687 MX53_PAD_LVDS1_TX1_P__LDB_LVDS1_TX1 0x80000000
688 MX53_PAD_LVDS1_TX2_P__LDB_LVDS1_TX2 0x80000000
689 MX53_PAD_LVDS1_TX3_P__LDB_LVDS1_TX3 0x80000000
690 MX53_PAD_LVDS1_CLK_P__LDB_LVDS1_CLK 0x80000000
691 >;
692 };
693 };
694
695 nand {
696 pinctrl_nand_1: nandgrp-1 {
697 fsl,pins = <
698 MX53_PAD_NANDF_WE_B__EMI_NANDF_WE_B 0x4
699 MX53_PAD_NANDF_RE_B__EMI_NANDF_RE_B 0x4
700 MX53_PAD_NANDF_CLE__EMI_NANDF_CLE 0x4
701 MX53_PAD_NANDF_ALE__EMI_NANDF_ALE 0x4
702 MX53_PAD_NANDF_WP_B__EMI_NANDF_WP_B 0xe0
703 MX53_PAD_NANDF_RB0__EMI_NANDF_RB_0 0xe0
704 MX53_PAD_NANDF_CS0__EMI_NANDF_CS_0 0x4
705 MX53_PAD_PATA_DATA0__EMI_NANDF_D_0 0xa4
706 MX53_PAD_PATA_DATA1__EMI_NANDF_D_1 0xa4
707 MX53_PAD_PATA_DATA2__EMI_NANDF_D_2 0xa4
708 MX53_PAD_PATA_DATA3__EMI_NANDF_D_3 0xa4
709 MX53_PAD_PATA_DATA4__EMI_NANDF_D_4 0xa4
710 MX53_PAD_PATA_DATA5__EMI_NANDF_D_5 0xa4
711 MX53_PAD_PATA_DATA6__EMI_NANDF_D_6 0xa4
712 MX53_PAD_PATA_DATA7__EMI_NANDF_D_7 0xa4
713 >;
714 };
715 };
716
717 owire {
718 pinctrl_owire_1: owiregrp-1 {
719 fsl,pins = <
720 MX53_PAD_GPIO_18__OWIRE_LINE 0x80000000
721 >;
722 };
723 };
724
725 pwm1 {
726 pinctrl_pwm1_1: pwm1grp-1 {
727 fsl,pins = <
728 MX53_PAD_DISP0_DAT8__PWM1_PWMO 0x5
729 >;
730 };
731 };
732
733 pwm2 {
734 pinctrl_pwm2_1: pwm2grp-1 {
735 fsl,pins = <
736 MX53_PAD_GPIO_1__PWM2_PWMO 0x80000000
737 >;
738 };
739 };
740
741 uart1 {
742 pinctrl_uart1_1: uart1grp-1 {
743 fsl,pins = <
744 MX53_PAD_CSI0_DAT10__UART1_TXD_MUX 0x1e4
745 MX53_PAD_CSI0_DAT11__UART1_RXD_MUX 0x1e4
746 >;
747 };
748
749 pinctrl_uart1_2: uart1grp-2 {
750 fsl,pins = <
751 MX53_PAD_PATA_DIOW__UART1_TXD_MUX 0x1e4
752 MX53_PAD_PATA_DMACK__UART1_RXD_MUX 0x1e4
753 >;
754 };
755
756 pinctrl_uart1_3: uart1grp-3 {
757 fsl,pins = <
758 MX53_PAD_PATA_RESET_B__UART1_CTS 0x1c5
759 MX53_PAD_PATA_IORDY__UART1_RTS 0x1c5
760 >;
761 };
762 };
763
764 uart2 {
765 pinctrl_uart2_1: uart2grp-1 {
766 fsl,pins = <
767 MX53_PAD_PATA_BUFFER_EN__UART2_RXD_MUX 0x1e4
768 MX53_PAD_PATA_DMARQ__UART2_TXD_MUX 0x1e4
769 >;
770 };
771
772 pinctrl_uart2_2: uart2grp-2 {
773 fsl,pins = <
774 MX53_PAD_PATA_BUFFER_EN__UART2_RXD_MUX 0x1c5
775 MX53_PAD_PATA_DMARQ__UART2_TXD_MUX 0x1c5
776 MX53_PAD_PATA_DIOR__UART2_RTS 0x1c5
777 MX53_PAD_PATA_INTRQ__UART2_CTS 0x1c5
778 >;
779 };
780 };
781
782 uart3 {
783 pinctrl_uart3_1: uart3grp-1 {
784 fsl,pins = <
785 MX53_PAD_PATA_CS_0__UART3_TXD_MUX 0x1e4
786 MX53_PAD_PATA_CS_1__UART3_RXD_MUX 0x1e4
787 MX53_PAD_PATA_DA_1__UART3_CTS 0x1e4
788 MX53_PAD_PATA_DA_2__UART3_RTS 0x1e4
789 >;
790 };
791
792 pinctrl_uart3_2: uart3grp-2 {
793 fsl,pins = <
794 MX53_PAD_PATA_CS_0__UART3_TXD_MUX 0x1e4
795 MX53_PAD_PATA_CS_1__UART3_RXD_MUX 0x1e4
796 >;
797 };
798
799 };
800
801 uart4 {
802 pinctrl_uart4_1: uart4grp-1 {
803 fsl,pins = <
804 MX53_PAD_KEY_COL0__UART4_TXD_MUX 0x1e4
805 MX53_PAD_KEY_ROW0__UART4_RXD_MUX 0x1e4
806 >;
807 };
808 };
809
810 uart5 {
811 pinctrl_uart5_1: uart5grp-1 {
812 fsl,pins = <
813 MX53_PAD_KEY_COL1__UART5_TXD_MUX 0x1e4
814 MX53_PAD_KEY_ROW1__UART5_RXD_MUX 0x1e4
815 >;
816 };
817 };
818 }; 392 };
819 393
820 gpr: iomuxc-gpr@53fa8000 { 394 gpr: iomuxc-gpr@53fa8000 {
@@ -828,9 +402,12 @@
828 compatible = "fsl,imx53-ldb"; 402 compatible = "fsl,imx53-ldb";
829 reg = <0x53fa8008 0x4>; 403 reg = <0x53fa8008 0x4>;
830 gpr = <&gpr>; 404 gpr = <&gpr>;
831 clocks = <&clks 122>, <&clks 120>, 405 clocks = <&clks IMX5_CLK_LDB_DI0_SEL>,
832 <&clks 115>, <&clks 116>, 406 <&clks IMX5_CLK_LDB_DI1_SEL>,
833 <&clks 123>, <&clks 85>; 407 <&clks IMX5_CLK_IPU_DI0_SEL>,
408 <&clks IMX5_CLK_IPU_DI1_SEL>,
409 <&clks IMX5_CLK_LDB_DI0_GATE>,
410 <&clks IMX5_CLK_LDB_DI1_GATE>;
834 clock-names = "di0_pll", "di1_pll", 411 clock-names = "di0_pll", "di1_pll",
835 "di0_sel", "di1_sel", 412 "di0_sel", "di1_sel",
836 "di0", "di1"; 413 "di0", "di1";
@@ -838,14 +415,24 @@
838 415
839 lvds-channel@0 { 416 lvds-channel@0 {
840 reg = <0>; 417 reg = <0>;
841 crtcs = <&ipu 0>;
842 status = "disabled"; 418 status = "disabled";
419
420 port {
421 lvds0_in: endpoint {
422 remote-endpoint = <&ipu_di0_lvds0>;
423 };
424 };
843 }; 425 };
844 426
845 lvds-channel@1 { 427 lvds-channel@1 {
846 reg = <1>; 428 reg = <1>;
847 crtcs = <&ipu 1>;
848 status = "disabled"; 429 status = "disabled";
430
431 port {
432 lvds1_in: endpoint {
433 remote-endpoint = <&ipu_di0_lvds0>;
434 };
435 };
849 }; 436 };
850 }; 437 };
851 438
@@ -853,7 +440,8 @@
853 #pwm-cells = <2>; 440 #pwm-cells = <2>;
854 compatible = "fsl,imx53-pwm", "fsl,imx27-pwm"; 441 compatible = "fsl,imx53-pwm", "fsl,imx27-pwm";
855 reg = <0x53fb4000 0x4000>; 442 reg = <0x53fb4000 0x4000>;
856 clocks = <&clks 37>, <&clks 38>; 443 clocks = <&clks IMX5_CLK_PWM1_IPG_GATE>,
444 <&clks IMX5_CLK_PWM1_HF_GATE>;
857 clock-names = "ipg", "per"; 445 clock-names = "ipg", "per";
858 interrupts = <61>; 446 interrupts = <61>;
859 }; 447 };
@@ -862,7 +450,8 @@
862 #pwm-cells = <2>; 450 #pwm-cells = <2>;
863 compatible = "fsl,imx53-pwm", "fsl,imx27-pwm"; 451 compatible = "fsl,imx53-pwm", "fsl,imx27-pwm";
864 reg = <0x53fb8000 0x4000>; 452 reg = <0x53fb8000 0x4000>;
865 clocks = <&clks 39>, <&clks 40>; 453 clocks = <&clks IMX5_CLK_PWM2_IPG_GATE>,
454 <&clks IMX5_CLK_PWM2_HF_GATE>;
866 clock-names = "ipg", "per"; 455 clock-names = "ipg", "per";
867 interrupts = <94>; 456 interrupts = <94>;
868 }; 457 };
@@ -871,7 +460,8 @@
871 compatible = "fsl,imx53-uart", "fsl,imx21-uart"; 460 compatible = "fsl,imx53-uart", "fsl,imx21-uart";
872 reg = <0x53fbc000 0x4000>; 461 reg = <0x53fbc000 0x4000>;
873 interrupts = <31>; 462 interrupts = <31>;
874 clocks = <&clks 28>, <&clks 29>; 463 clocks = <&clks IMX5_CLK_UART1_IPG_GATE>,
464 <&clks IMX5_CLK_UART1_PER_GATE>;
875 clock-names = "ipg", "per"; 465 clock-names = "ipg", "per";
876 status = "disabled"; 466 status = "disabled";
877 }; 467 };
@@ -880,7 +470,8 @@
880 compatible = "fsl,imx53-uart", "fsl,imx21-uart"; 470 compatible = "fsl,imx53-uart", "fsl,imx21-uart";
881 reg = <0x53fc0000 0x4000>; 471 reg = <0x53fc0000 0x4000>;
882 interrupts = <32>; 472 interrupts = <32>;
883 clocks = <&clks 30>, <&clks 31>; 473 clocks = <&clks IMX5_CLK_UART2_IPG_GATE>,
474 <&clks IMX5_CLK_UART2_PER_GATE>;
884 clock-names = "ipg", "per"; 475 clock-names = "ipg", "per";
885 status = "disabled"; 476 status = "disabled";
886 }; 477 };
@@ -889,7 +480,8 @@
889 compatible = "fsl,imx53-flexcan", "fsl,p1010-flexcan"; 480 compatible = "fsl,imx53-flexcan", "fsl,p1010-flexcan";
890 reg = <0x53fc8000 0x4000>; 481 reg = <0x53fc8000 0x4000>;
891 interrupts = <82>; 482 interrupts = <82>;
892 clocks = <&clks 158>, <&clks 157>; 483 clocks = <&clks IMX5_CLK_CAN1_IPG_GATE>,
484 <&clks IMX5_CLK_CAN1_SERIAL_GATE>;
893 clock-names = "ipg", "per"; 485 clock-names = "ipg", "per";
894 status = "disabled"; 486 status = "disabled";
895 }; 487 };
@@ -898,7 +490,8 @@
898 compatible = "fsl,imx53-flexcan", "fsl,p1010-flexcan"; 490 compatible = "fsl,imx53-flexcan", "fsl,p1010-flexcan";
899 reg = <0x53fcc000 0x4000>; 491 reg = <0x53fcc000 0x4000>;
900 interrupts = <83>; 492 interrupts = <83>;
901 clocks = <&clks 87>, <&clks 86>; 493 clocks = <&clks IMX5_CLK_CAN2_IPG_GATE>,
494 <&clks IMX5_CLK_CAN2_SERIAL_GATE>;
902 clock-names = "ipg", "per"; 495 clock-names = "ipg", "per";
903 status = "disabled"; 496 status = "disabled";
904 }; 497 };
@@ -952,7 +545,7 @@
952 compatible = "fsl,imx53-i2c", "fsl,imx21-i2c"; 545 compatible = "fsl,imx53-i2c", "fsl,imx21-i2c";
953 reg = <0x53fec000 0x4000>; 546 reg = <0x53fec000 0x4000>;
954 interrupts = <64>; 547 interrupts = <64>;
955 clocks = <&clks 88>; 548 clocks = <&clks IMX5_CLK_I2C3_GATE>;
956 status = "disabled"; 549 status = "disabled";
957 }; 550 };
958 551
@@ -960,7 +553,8 @@
960 compatible = "fsl,imx53-uart", "fsl,imx21-uart"; 553 compatible = "fsl,imx53-uart", "fsl,imx21-uart";
961 reg = <0x53ff0000 0x4000>; 554 reg = <0x53ff0000 0x4000>;
962 interrupts = <13>; 555 interrupts = <13>;
963 clocks = <&clks 65>, <&clks 66>; 556 clocks = <&clks IMX5_CLK_UART4_IPG_GATE>,
557 <&clks IMX5_CLK_UART4_PER_GATE>;
964 clock-names = "ipg", "per"; 558 clock-names = "ipg", "per";
965 status = "disabled"; 559 status = "disabled";
966 }; 560 };
@@ -977,14 +571,15 @@
977 compatible = "fsl,imx53-iim", "fsl,imx27-iim"; 571 compatible = "fsl,imx53-iim", "fsl,imx27-iim";
978 reg = <0x63f98000 0x4000>; 572 reg = <0x63f98000 0x4000>;
979 interrupts = <69>; 573 interrupts = <69>;
980 clocks = <&clks 107>; 574 clocks = <&clks IMX5_CLK_IIM_GATE>;
981 }; 575 };
982 576
983 uart5: serial@63f90000 { 577 uart5: serial@63f90000 {
984 compatible = "fsl,imx53-uart", "fsl,imx21-uart"; 578 compatible = "fsl,imx53-uart", "fsl,imx21-uart";
985 reg = <0x63f90000 0x4000>; 579 reg = <0x63f90000 0x4000>;
986 interrupts = <86>; 580 interrupts = <86>;
987 clocks = <&clks 67>, <&clks 68>; 581 clocks = <&clks IMX5_CLK_UART5_IPG_GATE>,
582 <&clks IMX5_CLK_UART5_PER_GATE>;
988 clock-names = "ipg", "per"; 583 clock-names = "ipg", "per";
989 status = "disabled"; 584 status = "disabled";
990 }; 585 };
@@ -992,7 +587,7 @@
992 owire: owire@63fa4000 { 587 owire: owire@63fa4000 {
993 compatible = "fsl,imx53-owire", "fsl,imx21-owire"; 588 compatible = "fsl,imx53-owire", "fsl,imx21-owire";
994 reg = <0x63fa4000 0x4000>; 589 reg = <0x63fa4000 0x4000>;
995 clocks = <&clks 159>; 590 clocks = <&clks IMX5_CLK_OWIRE_GATE>;
996 status = "disabled"; 591 status = "disabled";
997 }; 592 };
998 593
@@ -1002,7 +597,8 @@
1002 compatible = "fsl,imx53-ecspi", "fsl,imx51-ecspi"; 597 compatible = "fsl,imx53-ecspi", "fsl,imx51-ecspi";
1003 reg = <0x63fac000 0x4000>; 598 reg = <0x63fac000 0x4000>;
1004 interrupts = <37>; 599 interrupts = <37>;
1005 clocks = <&clks 53>, <&clks 54>; 600 clocks = <&clks IMX5_CLK_ECSPI2_IPG_GATE>,
601 <&clks IMX5_CLK_ECSPI2_PER_GATE>;
1006 clock-names = "ipg", "per"; 602 clock-names = "ipg", "per";
1007 status = "disabled"; 603 status = "disabled";
1008 }; 604 };
@@ -1011,7 +607,8 @@
1011 compatible = "fsl,imx53-sdma", "fsl,imx35-sdma"; 607 compatible = "fsl,imx53-sdma", "fsl,imx35-sdma";
1012 reg = <0x63fb0000 0x4000>; 608 reg = <0x63fb0000 0x4000>;
1013 interrupts = <6>; 609 interrupts = <6>;
1014 clocks = <&clks 56>, <&clks 56>; 610 clocks = <&clks IMX5_CLK_SDMA_GATE>,
611 <&clks IMX5_CLK_SDMA_GATE>;
1015 clock-names = "ipg", "ahb"; 612 clock-names = "ipg", "ahb";
1016 #dma-cells = <3>; 613 #dma-cells = <3>;
1017 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx53.bin"; 614 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx53.bin";
@@ -1023,7 +620,8 @@
1023 compatible = "fsl,imx53-cspi", "fsl,imx35-cspi"; 620 compatible = "fsl,imx53-cspi", "fsl,imx35-cspi";
1024 reg = <0x63fc0000 0x4000>; 621 reg = <0x63fc0000 0x4000>;
1025 interrupts = <38>; 622 interrupts = <38>;
1026 clocks = <&clks 55>, <&clks 55>; 623 clocks = <&clks IMX5_CLK_CSPI_IPG_GATE>,
624 <&clks IMX5_CLK_CSPI_IPG_GATE>;
1027 clock-names = "ipg", "per"; 625 clock-names = "ipg", "per";
1028 status = "disabled"; 626 status = "disabled";
1029 }; 627 };
@@ -1034,7 +632,7 @@
1034 compatible = "fsl,imx53-i2c", "fsl,imx21-i2c"; 632 compatible = "fsl,imx53-i2c", "fsl,imx21-i2c";
1035 reg = <0x63fc4000 0x4000>; 633 reg = <0x63fc4000 0x4000>;
1036 interrupts = <63>; 634 interrupts = <63>;
1037 clocks = <&clks 35>; 635 clocks = <&clks IMX5_CLK_I2C2_GATE>;
1038 status = "disabled"; 636 status = "disabled";
1039 }; 637 };
1040 638
@@ -1044,15 +642,16 @@
1044 compatible = "fsl,imx53-i2c", "fsl,imx21-i2c"; 642 compatible = "fsl,imx53-i2c", "fsl,imx21-i2c";
1045 reg = <0x63fc8000 0x4000>; 643 reg = <0x63fc8000 0x4000>;
1046 interrupts = <62>; 644 interrupts = <62>;
1047 clocks = <&clks 34>; 645 clocks = <&clks IMX5_CLK_I2C1_GATE>;
1048 status = "disabled"; 646 status = "disabled";
1049 }; 647 };
1050 648
1051 ssi1: ssi@63fcc000 { 649 ssi1: ssi@63fcc000 {
1052 compatible = "fsl,imx53-ssi", "fsl,imx21-ssi"; 650 compatible = "fsl,imx53-ssi", "fsl,imx51-ssi",
651 "fsl,imx21-ssi";
1053 reg = <0x63fcc000 0x4000>; 652 reg = <0x63fcc000 0x4000>;
1054 interrupts = <29>; 653 interrupts = <29>;
1055 clocks = <&clks 48>; 654 clocks = <&clks IMX5_CLK_SSI1_IPG_GATE>;
1056 dmas = <&sdma 28 0 0>, 655 dmas = <&sdma 28 0 0>,
1057 <&sdma 29 0 0>; 656 <&sdma 29 0 0>;
1058 dma-names = "rx", "tx"; 657 dma-names = "rx", "tx";
@@ -1071,15 +670,16 @@
1071 compatible = "fsl,imx53-nand"; 670 compatible = "fsl,imx53-nand";
1072 reg = <0x63fdb000 0x1000 0xf7ff0000 0x10000>; 671 reg = <0x63fdb000 0x1000 0xf7ff0000 0x10000>;
1073 interrupts = <8>; 672 interrupts = <8>;
1074 clocks = <&clks 60>; 673 clocks = <&clks IMX5_CLK_NFC_GATE>;
1075 status = "disabled"; 674 status = "disabled";
1076 }; 675 };
1077 676
1078 ssi3: ssi@63fe8000 { 677 ssi3: ssi@63fe8000 {
1079 compatible = "fsl,imx53-ssi", "fsl,imx21-ssi"; 678 compatible = "fsl,imx53-ssi", "fsl,imx51-ssi",
679 "fsl,imx21-ssi";
1080 reg = <0x63fe8000 0x4000>; 680 reg = <0x63fe8000 0x4000>;
1081 interrupts = <96>; 681 interrupts = <96>;
1082 clocks = <&clks 50>; 682 clocks = <&clks IMX5_CLK_SSI3_IPG_GATE>;
1083 dmas = <&sdma 46 0 0>, 683 dmas = <&sdma 46 0 0>,
1084 <&sdma 47 0 0>; 684 <&sdma 47 0 0>;
1085 dma-names = "rx", "tx"; 685 dma-names = "rx", "tx";
@@ -1092,7 +692,9 @@
1092 compatible = "fsl,imx53-fec", "fsl,imx25-fec"; 692 compatible = "fsl,imx53-fec", "fsl,imx25-fec";
1093 reg = <0x63fec000 0x4000>; 693 reg = <0x63fec000 0x4000>;
1094 interrupts = <87>; 694 interrupts = <87>;
1095 clocks = <&clks 42>, <&clks 42>, <&clks 42>; 695 clocks = <&clks IMX5_CLK_FEC_GATE>,
696 <&clks IMX5_CLK_FEC_GATE>,
697 <&clks IMX5_CLK_FEC_GATE>;
1096 clock-names = "ipg", "ahb", "ptp"; 698 clock-names = "ipg", "ahb", "ptp";
1097 status = "disabled"; 699 status = "disabled";
1098 }; 700 };
@@ -1101,17 +703,24 @@
1101 compatible = "fsl,imx53-tve"; 703 compatible = "fsl,imx53-tve";
1102 reg = <0x63ff0000 0x1000>; 704 reg = <0x63ff0000 0x1000>;
1103 interrupts = <92>; 705 interrupts = <92>;
1104 clocks = <&clks 69>, <&clks 116>; 706 clocks = <&clks IMX5_CLK_TVE_GATE>,
707 <&clks IMX5_CLK_IPU_DI1_SEL>;
1105 clock-names = "tve", "di_sel"; 708 clock-names = "tve", "di_sel";
1106 crtcs = <&ipu 1>;
1107 status = "disabled"; 709 status = "disabled";
710
711 port {
712 tve_in: endpoint {
713 remote-endpoint = <&ipu_di1_tve>;
714 };
715 };
1108 }; 716 };
1109 717
1110 vpu: vpu@63ff4000 { 718 vpu: vpu@63ff4000 {
1111 compatible = "fsl,imx53-vpu"; 719 compatible = "fsl,imx53-vpu";
1112 reg = <0x63ff4000 0x1000>; 720 reg = <0x63ff4000 0x1000>;
1113 interrupts = <9>; 721 interrupts = <9>;
1114 clocks = <&clks 63>, <&clks 63>; 722 clocks = <&clks IMX5_CLK_VPU_GATE>,
723 <&clks IMX5_CLK_VPU_GATE>;
1115 clock-names = "per", "ahb"; 724 clock-names = "per", "ahb";
1116 iram = <&ocram>; 725 iram = <&ocram>;
1117 status = "disabled"; 726 status = "disabled";
@@ -1121,7 +730,7 @@
1121 ocram: sram@f8000000 { 730 ocram: sram@f8000000 {
1122 compatible = "mmio-sram"; 731 compatible = "mmio-sram";
1123 reg = <0xf8000000 0x20000>; 732 reg = <0xf8000000 0x20000>;
1124 clocks = <&clks 186>; 733 clocks = <&clks IMX5_CLK_OCRAM>;
1125 }; 734 };
1126 }; 735 };
1127}; 736};
diff --git a/arch/arm/boot/dts/imx6dl-dfi-fs700-m60.dts b/arch/arm/boot/dts/imx6dl-dfi-fs700-m60.dts
new file mode 100644
index 000000000000..994f96a3fb54
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-dfi-fs700-m60.dts
@@ -0,0 +1,23 @@
1/*
2 * Copyright 2013 Sascha Hauer <s.hauer@pengutronix.de>
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 __DTS_V1__
13#define __DTS_V1__
14/dts-v1/;
15#endif
16
17#include "imx6dl.dtsi"
18#include "imx6qdl-dfi-fs700-m60.dtsi"
19
20/ {
21 model = "DFI FS700-M60-6DL i.MX6dl Q7 Board";
22 compatible = "dfi,fs700-m60-6dl", "dfi,fs700e-m60", "fsl,imx6dl";
23};
diff --git a/arch/arm/boot/dts/imx6dl-gw51xx.dts b/arch/arm/boot/dts/imx6dl-gw51xx.dts
new file mode 100644
index 000000000000..4bd055f4c930
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-gw51xx.dts
@@ -0,0 +1,19 @@
1/*
2 * Copyright 2013 Gateworks Corporation
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/dts-v1/;
13#include "imx6dl.dtsi"
14#include "imx6qdl-gw51xx.dtsi"
15
16/ {
17 model = "Gateworks Ventana i.MX6 DualLite GW51XX";
18 compatible = "gw,imx6dl-gw51xx", "gw,ventana", "fsl,imx6dl";
19};
diff --git a/arch/arm/boot/dts/imx6dl-gw52xx.dts b/arch/arm/boot/dts/imx6dl-gw52xx.dts
new file mode 100644
index 000000000000..c9136058f15e
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-gw52xx.dts
@@ -0,0 +1,19 @@
1/*
2 * Copyright 2013 Gateworks Corporation
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/dts-v1/;
13#include "imx6dl.dtsi"
14#include "imx6qdl-gw52xx.dtsi"
15
16/ {
17 model = "Gateworks Ventana i.MX6 DualLite GW52XX";
18 compatible = "gw,imx6dl-gw52xx", "gw,ventana", "fsl,imx6dl";
19};
diff --git a/arch/arm/boot/dts/imx6dl-gw53xx.dts b/arch/arm/boot/dts/imx6dl-gw53xx.dts
new file mode 100644
index 000000000000..61818a14fde6
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-gw53xx.dts
@@ -0,0 +1,19 @@
1/*
2 * Copyright 2013 Gateworks Corporation
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/dts-v1/;
13#include "imx6dl.dtsi"
14#include "imx6qdl-gw53xx.dtsi"
15
16/ {
17 model = "Gateworks Ventana i.MX6 DualLite GW53XX";
18 compatible = "gw,imx6dl-gw53xx", "gw,ventana", "fsl,imx6dl";
19};
diff --git a/arch/arm/boot/dts/imx6dl-gw54xx.dts b/arch/arm/boot/dts/imx6dl-gw54xx.dts
new file mode 100644
index 000000000000..ab38b6770a06
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-gw54xx.dts
@@ -0,0 +1,19 @@
1/*
2 * Copyright 2013 Gateworks Corporation
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/dts-v1/;
13#include "imx6dl.dtsi"
14#include "imx6qdl-gw54xx.dtsi"
15
16/ {
17 model = "Gateworks Ventana i.MX6 DualLite GW54XX";
18 compatible = "gw,imx6dl-gw54xx", "gw,ventana", "fsl,imx6dl";
19};
diff --git a/arch/arm/boot/dts/imx6dl-nitrogen6x.dts b/arch/arm/boot/dts/imx6dl-nitrogen6x.dts
new file mode 100644
index 000000000000..5f4d33ccc4b3
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-nitrogen6x.dts
@@ -0,0 +1,21 @@
1/*
2 * Copyright 2013 Boundary Devices, Inc.
3 * Copyright 2012 Freescale Semiconductor, Inc.
4 * Copyright 2011 Linaro Ltd.
5 *
6 * The code contained herein is licensed under the GNU General Public
7 * License. You may obtain a copy of the GNU General Public License
8 * Version 2 or later at the following locations:
9 *
10 * http://www.opensource.org/licenses/gpl-license.html
11 * http://www.gnu.org/copyleft/gpl.html
12 */
13
14/dts-v1/;
15#include "imx6dl.dtsi"
16#include "imx6qdl-nitrogen6x.dtsi"
17
18/ {
19 model = "Freescale i.MX6 DualLite Nitrogen6x Board";
20 compatible = "fsl,imx6dl-nitrogen6x", "fsl,imx6dl";
21};
diff --git a/arch/arm/boot/dts/imx6dl-pinfunc.h b/arch/arm/boot/dts/imx6dl-pinfunc.h
index b81a7a4ebab6..0ead323fdbd2 100644
--- a/arch/arm/boot/dts/imx6dl-pinfunc.h
+++ b/arch/arm/boot/dts/imx6dl-pinfunc.h
@@ -755,6 +755,7 @@
755#define MX6QDL_PAD_GPIO_5__I2C3_SCL 0x230 0x600 0x878 0x6 0x2 755#define MX6QDL_PAD_GPIO_5__I2C3_SCL 0x230 0x600 0x878 0x6 0x2
756#define MX6QDL_PAD_GPIO_5__ARM_EVENTI 0x230 0x600 0x000 0x7 0x0 756#define MX6QDL_PAD_GPIO_5__ARM_EVENTI 0x230 0x600 0x000 0x7 0x0
757#define MX6QDL_PAD_GPIO_6__ESAI_TX_CLK 0x234 0x604 0x840 0x0 0x1 757#define MX6QDL_PAD_GPIO_6__ESAI_TX_CLK 0x234 0x604 0x840 0x0 0x1
758#define MX6QDL_PAD_GPIO_6__ENET_IRQ 0x234 0x604 0x03c 0x11 0xff000609
758#define MX6QDL_PAD_GPIO_6__I2C3_SDA 0x234 0x604 0x87c 0x2 0x2 759#define MX6QDL_PAD_GPIO_6__I2C3_SDA 0x234 0x604 0x87c 0x2 0x2
759#define MX6QDL_PAD_GPIO_6__GPIO1_IO06 0x234 0x604 0x000 0x5 0x0 760#define MX6QDL_PAD_GPIO_6__GPIO1_IO06 0x234 0x604 0x000 0x5 0x0
760#define MX6QDL_PAD_GPIO_6__SD2_LCTL 0x234 0x604 0x000 0x6 0x0 761#define MX6QDL_PAD_GPIO_6__SD2_LCTL 0x234 0x604 0x000 0x6 0x0
@@ -950,6 +951,7 @@
950#define MX6QDL_PAD_RGMII_TXC__GPIO6_IO19 0x2d8 0x6c0 0x000 0x5 0x0 951#define MX6QDL_PAD_RGMII_TXC__GPIO6_IO19 0x2d8 0x6c0 0x000 0x5 0x0
951#define MX6QDL_PAD_RGMII_TXC__XTALOSC_REF_CLK_24M 0x2d8 0x6c0 0x000 0x7 0x0 952#define MX6QDL_PAD_RGMII_TXC__XTALOSC_REF_CLK_24M 0x2d8 0x6c0 0x000 0x7 0x0
952#define MX6QDL_PAD_SD1_CLK__SD1_CLK 0x2dc 0x6c4 0x928 0x0 0x1 953#define MX6QDL_PAD_SD1_CLK__SD1_CLK 0x2dc 0x6c4 0x928 0x0 0x1
954#define MX6QDL_PAD_SD1_CLK__OSC32K_32K_OUT 0x2dc 0x6c4 0x000 0x2 0x0
953#define MX6QDL_PAD_SD1_CLK__GPT_CLKIN 0x2dc 0x6c4 0x000 0x3 0x0 955#define MX6QDL_PAD_SD1_CLK__GPT_CLKIN 0x2dc 0x6c4 0x000 0x3 0x0
954#define MX6QDL_PAD_SD1_CLK__GPIO1_IO20 0x2dc 0x6c4 0x000 0x5 0x0 956#define MX6QDL_PAD_SD1_CLK__GPIO1_IO20 0x2dc 0x6c4 0x000 0x5 0x0
955#define MX6QDL_PAD_SD1_CMD__SD1_CMD 0x2e0 0x6c8 0x000 0x0 0x0 957#define MX6QDL_PAD_SD1_CMD__SD1_CMD 0x2e0 0x6c8 0x000 0x0 0x0
diff --git a/arch/arm/boot/dts/imx6dl-sabrelite.dts b/arch/arm/boot/dts/imx6dl-sabrelite.dts
new file mode 100644
index 000000000000..2de04479dc35
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-sabrelite.dts
@@ -0,0 +1,20 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc.
3 * Copyright 2011 Linaro Ltd.
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/dts-v1/;
14#include "imx6dl.dtsi"
15#include "imx6qdl-sabrelite.dtsi"
16
17/ {
18 model = "Freescale i.MX6 DualLite SABRE Lite Board";
19 compatible = "fsl,imx6dl-sabrelite", "fsl,imx6dl";
20};
diff --git a/arch/arm/boot/dts/imx6dl.dtsi b/arch/arm/boot/dts/imx6dl.dtsi
index 9e8ae118fdd4..5c5f574330f9 100644
--- a/arch/arm/boot/dts/imx6dl.dtsi
+++ b/arch/arm/boot/dts/imx6dl.dtsi
@@ -8,6 +8,7 @@
8 * 8 *
9 */ 9 */
10 10
11#include <dt-bindings/interrupt-controller/irq.h>
11#include "imx6dl-pinfunc.h" 12#include "imx6dl-pinfunc.h"
12#include "imx6qdl.dtsi" 13#include "imx6qdl.dtsi"
13 14
@@ -21,6 +22,26 @@
21 device_type = "cpu"; 22 device_type = "cpu";
22 reg = <0>; 23 reg = <0>;
23 next-level-cache = <&L2>; 24 next-level-cache = <&L2>;
25 operating-points = <
26 /* kHz uV */
27 996000 1275000
28 792000 1175000
29 396000 1075000
30 >;
31 fsl,soc-operating-points = <
32 /* ARM kHz SOC-PU uV */
33 996000 1175000
34 792000 1175000
35 396000 1175000
36 >;
37 clock-latency = <61036>; /* two CLK32 periods */
38 clocks = <&clks 104>, <&clks 6>, <&clks 16>,
39 <&clks 17>, <&clks 170>;
40 clock-names = "arm", "pll2_pfd2_396m", "step",
41 "pll1_sw", "pll1_sys";
42 arm-supply = <&reg_arm>;
43 pu-supply = <&reg_pu>;
44 soc-supply = <&reg_soc>;
24 }; 45 };
25 46
26 cpu@1 { 47 cpu@1 {
@@ -45,17 +66,17 @@
45 66
46 pxp: pxp@020f0000 { 67 pxp: pxp@020f0000 {
47 reg = <0x020f0000 0x4000>; 68 reg = <0x020f0000 0x4000>;
48 interrupts = <0 98 0x04>; 69 interrupts = <0 98 IRQ_TYPE_LEVEL_HIGH>;
49 }; 70 };
50 71
51 epdc: epdc@020f4000 { 72 epdc: epdc@020f4000 {
52 reg = <0x020f4000 0x4000>; 73 reg = <0x020f4000 0x4000>;
53 interrupts = <0 97 0x04>; 74 interrupts = <0 97 IRQ_TYPE_LEVEL_HIGH>;
54 }; 75 };
55 76
56 lcdif: lcdif@020f8000 { 77 lcdif: lcdif@020f8000 {
57 reg = <0x020f8000 0x4000>; 78 reg = <0x020f8000 0x4000>;
58 interrupts = <0 39 0x04>; 79 interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>;
59 }; 80 };
60 }; 81 };
61 82
@@ -65,11 +86,20 @@
65 #size-cells = <0>; 86 #size-cells = <0>;
66 compatible = "fsl,imx1-i2c"; 87 compatible = "fsl,imx1-i2c";
67 reg = <0x021f8000 0x4000>; 88 reg = <0x021f8000 0x4000>;
68 interrupts = <0 35 0x04>; 89 interrupts = <0 35 IRQ_TYPE_LEVEL_HIGH>;
69 status = "disabled"; 90 status = "disabled";
70 }; 91 };
71 }; 92 };
72 }; 93 };
94
95 display-subsystem {
96 compatible = "fsl,imx-display-subsystem";
97 ports = <&ipu1_di0>, <&ipu1_di1>;
98 };
99};
100
101&hdmi {
102 compatible = "fsl,imx6dl-hdmi";
73}; 103};
74 104
75&ldb { 105&ldb {
@@ -79,12 +109,4 @@
79 clock-names = "di0_pll", "di1_pll", 109 clock-names = "di0_pll", "di1_pll",
80 "di0_sel", "di1_sel", 110 "di0_sel", "di1_sel",
81 "di0", "di1"; 111 "di0", "di1";
82
83 lvds-channel@0 {
84 crtcs = <&ipu1 0>, <&ipu1 1>;
85 };
86
87 lvds-channel@1 {
88 crtcs = <&ipu1 0>, <&ipu1 1>;
89 };
90}; 112};
diff --git a/arch/arm/boot/dts/imx6q-arm2.dts b/arch/arm/boot/dts/imx6q-arm2.dts
index edf1bd967164..78df05e9d1ce 100644
--- a/arch/arm/boot/dts/imx6q-arm2.dts
+++ b/arch/arm/boot/dts/imx6q-arm2.dts
@@ -23,14 +23,27 @@
23 23
24 regulators { 24 regulators {
25 compatible = "simple-bus"; 25 compatible = "simple-bus";
26 #address-cells = <1>;
27 #size-cells = <0>;
26 28
27 reg_3p3v: 3p3v { 29 reg_3p3v: regulator@0 {
28 compatible = "regulator-fixed"; 30 compatible = "regulator-fixed";
31 reg = <0>;
29 regulator-name = "3P3V"; 32 regulator-name = "3P3V";
30 regulator-min-microvolt = <3300000>; 33 regulator-min-microvolt = <3300000>;
31 regulator-max-microvolt = <3300000>; 34 regulator-max-microvolt = <3300000>;
32 regulator-always-on; 35 regulator-always-on;
33 }; 36 };
37
38 reg_usb_otg_vbus: regulator@1 {
39 compatible = "regulator-fixed";
40 reg = <1>;
41 regulator-name = "usb_otg_vbus";
42 regulator-min-microvolt = <5000000>;
43 regulator-max-microvolt = <5000000>;
44 gpio = <&gpio3 22 0>;
45 enable-active-high;
46 };
34 }; 47 };
35 48
36 leds { 49 leds {
@@ -46,7 +59,7 @@
46 59
47&gpmi { 60&gpmi {
48 pinctrl-names = "default"; 61 pinctrl-names = "default";
49 pinctrl-0 = <&pinctrl_gpmi_nand_1>; 62 pinctrl-0 = <&pinctrl_gpmi_nand>;
50 status = "disabled"; /* gpmi nand conflicts with SD */ 63 status = "disabled"; /* gpmi nand conflicts with SD */
51}; 64};
52 65
@@ -54,28 +67,131 @@
54 pinctrl-names = "default"; 67 pinctrl-names = "default";
55 pinctrl-0 = <&pinctrl_hog>; 68 pinctrl-0 = <&pinctrl_hog>;
56 69
57 hog { 70 imx6q-arm2 {
58 pinctrl_hog: hoggrp { 71 pinctrl_hog: hoggrp {
59 fsl,pins = < 72 fsl,pins = <
60 MX6QDL_PAD_EIM_D25__GPIO3_IO25 0x80000000 73 MX6QDL_PAD_EIM_D25__GPIO3_IO25 0x80000000
61 >; 74 >;
62 }; 75 };
63 };
64 76
65 arm2 { 77 pinctrl_enet: enetgrp {
66 pinctrl_usdhc3_arm2: usdhc3grp-arm2 { 78 fsl,pins = <
79 MX6QDL_PAD_KEY_COL1__ENET_MDIO 0x1b0b0
80 MX6QDL_PAD_KEY_COL2__ENET_MDC 0x1b0b0
81 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
82 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
83 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
84 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
85 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
86 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
87 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
88 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
89 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
90 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
91 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
92 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
93 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
94 MX6QDL_PAD_GPIO_6__ENET_IRQ 0x000b1
95 >;
96 };
97
98 pinctrl_gpmi_nand: gpminandgrp {
99 fsl,pins = <
100 MX6QDL_PAD_NANDF_CLE__NAND_CLE 0xb0b1
101 MX6QDL_PAD_NANDF_ALE__NAND_ALE 0xb0b1
102 MX6QDL_PAD_NANDF_WP_B__NAND_WP_B 0xb0b1
103 MX6QDL_PAD_NANDF_RB0__NAND_READY_B 0xb000
104 MX6QDL_PAD_NANDF_CS0__NAND_CE0_B 0xb0b1
105 MX6QDL_PAD_NANDF_CS1__NAND_CE1_B 0xb0b1
106 MX6QDL_PAD_SD4_CMD__NAND_RE_B 0xb0b1
107 MX6QDL_PAD_SD4_CLK__NAND_WE_B 0xb0b1
108 MX6QDL_PAD_NANDF_D0__NAND_DATA00 0xb0b1
109 MX6QDL_PAD_NANDF_D1__NAND_DATA01 0xb0b1
110 MX6QDL_PAD_NANDF_D2__NAND_DATA02 0xb0b1
111 MX6QDL_PAD_NANDF_D3__NAND_DATA03 0xb0b1
112 MX6QDL_PAD_NANDF_D4__NAND_DATA04 0xb0b1
113 MX6QDL_PAD_NANDF_D5__NAND_DATA05 0xb0b1
114 MX6QDL_PAD_NANDF_D6__NAND_DATA06 0xb0b1
115 MX6QDL_PAD_NANDF_D7__NAND_DATA07 0xb0b1
116 MX6QDL_PAD_SD4_DAT0__NAND_DQS 0x00b1
117 >;
118 };
119
120 pinctrl_uart2: uart2grp {
121 fsl,pins = <
122 MX6QDL_PAD_EIM_D26__UART2_RX_DATA 0x1b0b1
123 MX6QDL_PAD_EIM_D27__UART2_TX_DATA 0x1b0b1
124 MX6QDL_PAD_EIM_D28__UART2_DTE_CTS_B 0x1b0b1
125 MX6QDL_PAD_EIM_D29__UART2_DTE_RTS_B 0x1b0b1
126 >;
127 };
128
129 pinctrl_uart4: uart4grp {
130 fsl,pins = <
131 MX6QDL_PAD_KEY_COL0__UART4_TX_DATA 0x1b0b1
132 MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA 0x1b0b1
133 >;
134 };
135
136 pinctrl_usbotg: usbotggrp {
137 fsl,pins = <
138 MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
139 >;
140 };
141
142 pinctrl_usdhc3: usdhc3grp {
143 fsl,pins = <
144 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059
145 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059
146 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059
147 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
148 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
149 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
150 MX6QDL_PAD_SD3_DAT4__SD3_DATA4 0x17059
151 MX6QDL_PAD_SD3_DAT5__SD3_DATA5 0x17059
152 MX6QDL_PAD_SD3_DAT6__SD3_DATA6 0x17059
153 MX6QDL_PAD_SD3_DAT7__SD3_DATA7 0x17059
154 >;
155 };
156
157 pinctrl_usdhc3_cdwp: usdhc3cdwp {
67 fsl,pins = < 158 fsl,pins = <
68 MX6QDL_PAD_NANDF_CS0__GPIO6_IO11 0x80000000 159 MX6QDL_PAD_NANDF_CS0__GPIO6_IO11 0x80000000
69 MX6QDL_PAD_NANDF_CS1__GPIO6_IO14 0x80000000 160 MX6QDL_PAD_NANDF_CS1__GPIO6_IO14 0x80000000
70 >; 161 >;
71 }; 162 };
163
164 pinctrl_usdhc4: usdhc4grp {
165 fsl,pins = <
166 MX6QDL_PAD_SD4_CMD__SD4_CMD 0x17059
167 MX6QDL_PAD_SD4_CLK__SD4_CLK 0x10059
168 MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17059
169 MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17059
170 MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17059
171 MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17059
172 MX6QDL_PAD_SD4_DAT4__SD4_DATA4 0x17059
173 MX6QDL_PAD_SD4_DAT5__SD4_DATA5 0x17059
174 MX6QDL_PAD_SD4_DAT6__SD4_DATA6 0x17059
175 MX6QDL_PAD_SD4_DAT7__SD4_DATA7 0x17059
176 >;
177 };
72 }; 178 };
73}; 179};
74 180
75&fec { 181&fec {
76 pinctrl-names = "default"; 182 pinctrl-names = "default";
77 pinctrl-0 = <&pinctrl_enet_2>; 183 pinctrl-0 = <&pinctrl_enet>;
78 phy-mode = "rgmii"; 184 phy-mode = "rgmii";
185 interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_HIGH>,
186 <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>;
187 status = "okay";
188};
189
190&usbotg {
191 vbus-supply = <&reg_usb_otg_vbus>;
192 pinctrl-names = "default";
193 pinctrl-0 = <&pinctrl_usbotg>;
194 disable-over-current;
79 status = "okay"; 195 status = "okay";
80}; 196};
81 197
@@ -84,8 +200,8 @@
84 wp-gpios = <&gpio6 14 0>; 200 wp-gpios = <&gpio6 14 0>;
85 vmmc-supply = <&reg_3p3v>; 201 vmmc-supply = <&reg_3p3v>;
86 pinctrl-names = "default"; 202 pinctrl-names = "default";
87 pinctrl-0 = <&pinctrl_usdhc3_1 203 pinctrl-0 = <&pinctrl_usdhc3
88 &pinctrl_usdhc3_arm2>; 204 &pinctrl_usdhc3_cdwp>;
89 status = "okay"; 205 status = "okay";
90}; 206};
91 207
@@ -93,13 +209,13 @@
93 non-removable; 209 non-removable;
94 vmmc-supply = <&reg_3p3v>; 210 vmmc-supply = <&reg_3p3v>;
95 pinctrl-names = "default"; 211 pinctrl-names = "default";
96 pinctrl-0 = <&pinctrl_usdhc4_1>; 212 pinctrl-0 = <&pinctrl_usdhc4>;
97 status = "okay"; 213 status = "okay";
98}; 214};
99 215
100&uart2 { 216&uart2 {
101 pinctrl-names = "default"; 217 pinctrl-names = "default";
102 pinctrl-0 = <&pinctrl_uart2_2>; 218 pinctrl-0 = <&pinctrl_uart2>;
103 fsl,dte-mode; 219 fsl,dte-mode;
104 fsl,uart-has-rtscts; 220 fsl,uart-has-rtscts;
105 status = "okay"; 221 status = "okay";
@@ -107,6 +223,6 @@
107 223
108&uart4 { 224&uart4 {
109 pinctrl-names = "default"; 225 pinctrl-names = "default";
110 pinctrl-0 = <&pinctrl_uart4_1>; 226 pinctrl-0 = <&pinctrl_uart4>;
111 status = "okay"; 227 status = "okay";
112}; 228};
diff --git a/arch/arm/boot/dts/imx6q-cm-fx6.dts b/arch/arm/boot/dts/imx6q-cm-fx6.dts
new file mode 100644
index 000000000000..99b46f8030ad
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-cm-fx6.dts
@@ -0,0 +1,107 @@
1/*
2 * Copyright 2013 CompuLab Ltd.
3 *
4 * Author: Valentin Raevsky <valentin@compulab.co.il>
5 *
6 * The code contained herein is licensed under the GNU General Public
7 * License. You may obtain a copy of the GNU General Public License
8 * Version 2 or later at the following locations:
9 *
10 * http://www.opensource.org/licenses/gpl-license.html
11 * http://www.gnu.org/copyleft/gpl.html
12 */
13
14/dts-v1/;
15#include "imx6q.dtsi"
16
17/ {
18 model = "CompuLab CM-FX6";
19 compatible = "compulab,cm-fx6", "fsl,imx6q";
20
21 memory {
22 reg = <0x10000000 0x80000000>;
23 };
24
25 leds {
26 compatible = "gpio-leds";
27
28 heartbeat-led {
29 label = "Heartbeat";
30 gpios = <&gpio2 31 0>;
31 linux,default-trigger = "heartbeat";
32 };
33 };
34};
35
36&fec {
37 pinctrl-names = "default";
38 pinctrl-0 = <&pinctrl_enet>;
39 phy-mode = "rgmii";
40 status = "okay";
41};
42
43&gpmi {
44 pinctrl-names = "default";
45 pinctrl-0 = <&pinctrl_gpmi_nand>;
46 status = "okay";
47};
48
49&iomuxc {
50 imx6q-cm-fx6 {
51 pinctrl_enet: enetgrp {
52 fsl,pins = <
53 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
54 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
55 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
56 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
57 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
58 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
59 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
60 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
61 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
62 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
63 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
64 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
65 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
66 MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
67 MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
68 MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0a8
69 >;
70 };
71
72 pinctrl_gpmi_nand: gpminandgrp {
73 fsl,pins = <
74 MX6QDL_PAD_NANDF_CLE__NAND_CLE 0xb0b1
75 MX6QDL_PAD_NANDF_ALE__NAND_ALE 0xb0b1
76 MX6QDL_PAD_NANDF_WP_B__NAND_WP_B 0xb0b1
77 MX6QDL_PAD_NANDF_RB0__NAND_READY_B 0xb000
78 MX6QDL_PAD_NANDF_CS0__NAND_CE0_B 0xb0b1
79 MX6QDL_PAD_NANDF_CS1__NAND_CE1_B 0xb0b1
80 MX6QDL_PAD_SD4_CMD__NAND_RE_B 0xb0b1
81 MX6QDL_PAD_SD4_CLK__NAND_WE_B 0xb0b1
82 MX6QDL_PAD_NANDF_D0__NAND_DATA00 0xb0b1
83 MX6QDL_PAD_NANDF_D1__NAND_DATA01 0xb0b1
84 MX6QDL_PAD_NANDF_D2__NAND_DATA02 0xb0b1
85 MX6QDL_PAD_NANDF_D3__NAND_DATA03 0xb0b1
86 MX6QDL_PAD_NANDF_D4__NAND_DATA04 0xb0b1
87 MX6QDL_PAD_NANDF_D5__NAND_DATA05 0xb0b1
88 MX6QDL_PAD_NANDF_D6__NAND_DATA06 0xb0b1
89 MX6QDL_PAD_NANDF_D7__NAND_DATA07 0xb0b1
90 MX6QDL_PAD_SD4_DAT0__NAND_DQS 0x00b1
91 >;
92 };
93
94 pinctrl_uart4: uart4grp {
95 fsl,pins = <
96 MX6QDL_PAD_KEY_COL0__UART4_TX_DATA 0x1b0b1
97 MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA 0x1b0b1
98 >;
99 };
100 };
101};
102
103&uart4 {
104 pinctrl-names = "default";
105 pinctrl-0 = <&pinctrl_uart4>;
106 status = "okay";
107};
diff --git a/arch/arm/boot/dts/imx6q-dfi-fs700-m60.dts b/arch/arm/boot/dts/imx6q-dfi-fs700-m60.dts
new file mode 100644
index 000000000000..fd0ad9a8866c
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-dfi-fs700-m60.dts
@@ -0,0 +1,23 @@
1/*
2 * Copyright 2013 Sascha Hauer <s.hauer@pengutronix.de>
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 __DTS_V1__
13#define __DTS_V1__
14/dts-v1/;
15#endif
16
17#include "imx6q.dtsi"
18#include "imx6qdl-dfi-fs700-m60.dtsi"
19
20/ {
21 model = "DFI FS700-M60-6QD i.MX6qd Q7 Board";
22 compatible = "dfi,fs700-m60-6qd", "dfi,fs700e-m60", "fsl,imx6q";
23};
diff --git a/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts b/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
new file mode 100644
index 000000000000..a63bbb3d46bb
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts
@@ -0,0 +1,372 @@
1/*
2 * Copyright 2013 Data Modul AG
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/dts-v1/;
13
14#include <dt-bindings/gpio/gpio.h>
15#include "imx6q.dtsi"
16
17/ {
18 model = "Data Modul eDM-QMX6 Board";
19 compatible = "dmo,imx6q-edmqmx6", "fsl,imx6q";
20
21 aliases {
22 gpio7 = &stmpe_gpio;
23 };
24
25 memory {
26 reg = <0x10000000 0x80000000>;
27 };
28
29 regulators {
30 compatible = "simple-bus";
31 #address-cells = <1>;
32 #size-cells = <0>;
33
34 reg_3p3v: regulator@0 {
35 compatible = "regulator-fixed";
36 reg = <0>;
37 regulator-name = "3P3V";
38 regulator-min-microvolt = <3300000>;
39 regulator-max-microvolt = <3300000>;
40 regulator-always-on;
41 };
42
43 reg_usb_otg_vbus: regulator@1 {
44 compatible = "regulator-fixed";
45 reg = <1>;
46 regulator-name = "usb_otg_vbus";
47 regulator-min-microvolt = <5000000>;
48 regulator-max-microvolt = <5000000>;
49 gpio = <&gpio7 12 0>;
50 };
51
52 reg_usb_host1: regulator@2 {
53 compatible = "regulator-fixed";
54 reg = <2>;
55 regulator-name = "usb_host1_en";
56 regulator-min-microvolt = <3300000>;
57 regulator-max-microvolt = <3300000>;
58 gpio = <&gpio3 31 0>;
59 enable-active-high;
60 };
61 };
62
63 gpio-leds {
64 compatible = "gpio-leds";
65
66 led-blue {
67 label = "blue";
68 gpios = <&stmpe_gpio 8 GPIO_ACTIVE_HIGH>;
69 linux,default-trigger = "heartbeat";
70 };
71
72 led-green {
73 label = "green";
74 gpios = <&stmpe_gpio 9 GPIO_ACTIVE_HIGH>;
75 };
76
77 led-pink {
78 label = "pink";
79 gpios = <&stmpe_gpio 10 GPIO_ACTIVE_HIGH>;
80 };
81
82 led-red {
83 label = "red";
84 gpios = <&stmpe_gpio 11 GPIO_ACTIVE_HIGH>;
85 };
86 };
87};
88
89&fec {
90 pinctrl-names = "default";
91 pinctrl-0 = <&pinctrl_enet>;
92 phy-mode = "rgmii";
93 phy-reset-gpios = <&gpio3 23 0>;
94 phy-supply = <&vgen2_1v2_eth>;
95 status = "okay";
96};
97
98&i2c2 {
99 clock-frequency = <100000>;
100 pinctrl-names = "default";
101 pinctrl-0 = <&pinctrl_i2c2
102 &pinctrl_stmpe>;
103 status = "okay";
104
105 pmic: pfuze100@08 {
106 compatible = "fsl,pfuze100";
107 reg = <0x08>;
108 interrupt-parent = <&gpio3>;
109 interrupts = <20 8>;
110
111 regulators {
112 sw1a_reg: sw1ab {
113 regulator-min-microvolt = <300000>;
114 regulator-max-microvolt = <1875000>;
115 regulator-boot-on;
116 regulator-always-on;
117 };
118
119 sw1c_reg: sw1c {
120 regulator-min-microvolt = <300000>;
121 regulator-max-microvolt = <1875000>;
122 regulator-boot-on;
123 regulator-always-on;
124 };
125
126 sw2_reg: sw2 {
127 regulator-min-microvolt = <800000>;
128 regulator-max-microvolt = <3300000>;
129 regulator-boot-on;
130 regulator-always-on;
131 };
132
133 sw3a_reg: sw3a {
134 regulator-min-microvolt = <400000>;
135 regulator-max-microvolt = <1975000>;
136 regulator-boot-on;
137 regulator-always-on;
138 };
139
140 sw3b_reg: sw3b {
141 regulator-min-microvolt = <400000>;
142 regulator-max-microvolt = <1975000>;
143 regulator-boot-on;
144 regulator-always-on;
145 };
146
147 sw4_reg: sw4 {
148 regulator-min-microvolt = <400000>;
149 regulator-max-microvolt = <1975000>;
150 regulator-always-on;
151 };
152
153 swbst_reg: swbst {
154 regulator-min-microvolt = <5000000>;
155 regulator-max-microvolt = <5150000>;
156 regulator-always-on;
157 };
158
159 snvs_reg: vsnvs {
160 regulator-min-microvolt = <1000000>;
161 regulator-max-microvolt = <3000000>;
162 regulator-boot-on;
163 regulator-always-on;
164 };
165
166 vref_reg: vrefddr {
167 regulator-boot-on;
168 regulator-always-on;
169 };
170
171 vgen1_reg: vgen1 {
172 regulator-min-microvolt = <800000>;
173 regulator-max-microvolt = <1550000>;
174 };
175
176 vgen2_1v2_eth: vgen2 {
177 regulator-min-microvolt = <800000>;
178 regulator-max-microvolt = <1550000>;
179 };
180
181 vdd_high_in: vgen3 {
182 regulator-min-microvolt = <1800000>;
183 regulator-max-microvolt = <3300000>;
184 regulator-boot-on;
185 regulator-always-on;
186 };
187
188 vgen4_reg: vgen4 {
189 regulator-min-microvolt = <1800000>;
190 regulator-max-microvolt = <3300000>;
191 regulator-always-on;
192 };
193
194 vgen5_reg: vgen5 {
195 regulator-min-microvolt = <1800000>;
196 regulator-max-microvolt = <3300000>;
197 regulator-always-on;
198 };
199
200 vgen6_reg: vgen6 {
201 regulator-min-microvolt = <1800000>;
202 regulator-max-microvolt = <3300000>;
203 regulator-always-on;
204 };
205 };
206 };
207
208 stmpe: stmpe1601@40 {
209 compatible = "st,stmpe1601";
210 reg = <0x40>;
211 interrupts = <30 0>;
212 interrupt-parent = <&gpio3>;
213
214 stmpe_gpio: stmpe_gpio {
215 #gpio-cells = <2>;
216 compatible = "st,stmpe-gpio";
217 };
218 };
219
220 temp1: ad7414@4c {
221 compatible = "ad,ad7414";
222 reg = <0x4c>;
223 };
224
225 temp2: ad7414@4d {
226 compatible = "ad,ad7414";
227 reg = <0x4d>;
228 };
229
230 rtc: m41t62@68 {
231 compatible = "stm,m41t62";
232 reg = <0x68>;
233 };
234};
235
236&iomuxc {
237 pinctrl-names = "default";
238 pinctrl-0 = <&pinctrl_hog>;
239
240 imx6q-dmo-edmqmx6 {
241 pinctrl_hog: hoggrp {
242 fsl,pins = <
243 MX6QDL_PAD_EIM_A16__GPIO2_IO22 0x80000000
244 MX6QDL_PAD_EIM_A17__GPIO2_IO21 0x80000000
245 >;
246 };
247
248 pinctrl_enet: enetgrp {
249 fsl,pins = <
250 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
251 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
252 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
253 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
254 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
255 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
256 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
257 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
258 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
259 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
260 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
261 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
262 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
263 MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
264 MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
265 MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0a8
266 >;
267 };
268
269 pinctrl_i2c2: i2c2grp {
270 fsl,pins = <
271 MX6QDL_PAD_EIM_EB2__I2C2_SCL 0x4001b8b1
272 MX6QDL_PAD_KEY_ROW3__I2C2_SDA 0x4001b8b1
273 >;
274 };
275
276 pinctrl_stmpe: stmpegrp {
277 fsl,pins = <MX6QDL_PAD_EIM_D30__GPIO3_IO30 0x80000000>;
278 };
279
280 pinctrl_uart1: uart1grp {
281 fsl,pins = <
282 MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA 0x1b0b1
283 MX6QDL_PAD_SD3_DAT6__UART1_RX_DATA 0x1b0b1
284 >;
285 };
286
287 pinctrl_uart2: uart2grp {
288 fsl,pins = <
289 MX6QDL_PAD_EIM_D26__UART2_TX_DATA 0x1b0b1
290 MX6QDL_PAD_EIM_D27__UART2_RX_DATA 0x1b0b1
291 >;
292 };
293
294 pinctrl_usbotg: usbotggrp {
295 fsl,pins = <
296 MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
297 >;
298 };
299
300 pinctrl_usdhc3: usdhc3grp {
301 fsl,pins = <
302 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059
303 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059
304 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059
305 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
306 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
307 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
308 >;
309 };
310
311 pinctrl_usdhc4: usdhc4grp {
312 fsl,pins = <
313 MX6QDL_PAD_SD4_CMD__SD4_CMD 0x17059
314 MX6QDL_PAD_SD4_CLK__SD4_CLK 0x10059
315 MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17059
316 MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17059
317 MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17059
318 MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17059
319 MX6QDL_PAD_SD4_DAT4__SD4_DATA4 0x17059
320 MX6QDL_PAD_SD4_DAT5__SD4_DATA5 0x17059
321 MX6QDL_PAD_SD4_DAT6__SD4_DATA6 0x17059
322 MX6QDL_PAD_SD4_DAT7__SD4_DATA7 0x17059
323 >;
324 };
325 };
326};
327
328&sata {
329 status = "okay";
330};
331
332&uart1 {
333 pinctrl-names = "default";
334 pinctrl-0 = <&pinctrl_uart1>;
335 status = "okay";
336};
337
338&uart2 {
339 pinctrl-names = "default";
340 pinctrl-0 = <&pinctrl_uart2>;
341 status = "okay";
342};
343
344&usbh1 {
345 vbus-supply = <&reg_usb_host1>;
346 disable-over-current;
347 status = "okay";
348};
349
350&usbotg {
351 vbus-supply = <&reg_usb_otg_vbus>;
352 pinctrl-names = "default";
353 pinctrl-0 = <&pinctrl_usbotg>;
354 disable-over-current;
355 status = "okay";
356};
357
358&usdhc3 {
359 pinctrl-names = "default";
360 pinctrl-0 = <&pinctrl_usdhc3>;
361 vmmc-supply = <&reg_3p3v>;
362 status = "okay";
363};
364
365&usdhc4 {
366 pinctrl-names = "default";
367 pinctrl-0 = <&pinctrl_usdhc4>;
368 vmmc-supply = <&reg_3p3v>;
369 non-removable;
370 bus-width = <8>;
371 status = "okay";
372};
diff --git a/arch/arm/boot/dts/imx6q-gk802.dts b/arch/arm/boot/dts/imx6q-gk802.dts
new file mode 100644
index 000000000000..4a9b4dc9afc0
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-gk802.dts
@@ -0,0 +1,171 @@
1/*
2 * Copyright (C) 2013 Philipp Zabel
3 *
4 * This file is licensed under the terms of the GNU General Public License
5 * version 2. This program is licensed "as is" without any warranty of any
6 * kind, whether express or implied.
7 */
8
9/dts-v1/;
10#include "imx6q.dtsi"
11
12/ {
13 model = "Zealz GK802";
14 compatible = "zealz,imx6q-gk802", "fsl,imx6q";
15
16 chosen {
17 linux,stdout-path = &uart4;
18 };
19
20 memory {
21 reg = <0x10000000 0x40000000>;
22 };
23
24 regulators {
25 compatible = "simple-bus";
26 #address-cells = <1>;
27 #size-cells = <0>;
28
29 reg_3p3v: regulator@0 {
30 compatible = "regulator-fixed";
31 reg = <0>;
32 regulator-name = "3P3V";
33 regulator-min-microvolt = <3300000>;
34 regulator-max-microvolt = <3300000>;
35 regulator-always-on;
36 };
37 };
38
39 gpio-keys {
40 compatible = "gpio-keys";
41
42 recovery-button {
43 label = "recovery";
44 gpios = <&gpio3 16 1>;
45 linux,code = <0x198>; /* KEY_RESTART */
46 gpio-key,wakeup;
47 };
48 };
49};
50
51/* Internal I2C */
52&i2c2 {
53 pinctrl-names = "default";
54 pinctrl-0 = <&pinctrl_i2c2>;
55 clock-frequency = <100000>;
56 status = "okay";
57
58 /* SDMC DM2016 1024 bit EEPROM + 128 bit OTP */
59 eeprom: dm2016@51 {
60 compatible = "sdmc,dm2016";
61 reg = <0x51>;
62 };
63};
64
65/* External I2C via HDMI */
66&i2c3 {
67 pinctrl-names = "default";
68 pinctrl-0 = <&pinctrl_i2c3>;
69 clock-frequency = <100000>;
70 status = "okay";
71};
72
73&iomuxc {
74 pinctrl-names = "default";
75 pinctrl-0 = <&pinctrl_hog>;
76
77 imx6q-gk802 {
78 pinctrl_hog: hoggrp {
79 fsl,pins = <
80 /* Recovery button, active-low */
81 MX6QDL_PAD_EIM_D16__GPIO3_IO16 0x100b1
82 /* RTL8192CU enable GPIO, active-low */
83 MX6QDL_PAD_NANDF_D0__GPIO2_IO00 0x1b0b0
84 >;
85 };
86
87 pinctrl_i2c2: i2c2grp {
88 fsl,pins = <
89 MX6QDL_PAD_KEY_COL3__I2C2_SCL 0x4001b8b1
90 MX6QDL_PAD_KEY_ROW3__I2C2_SDA 0x4001b8b1
91 >;
92 };
93
94 pinctrl_i2c3: i2c3grp {
95 fsl,pins = <
96 MX6QDL_PAD_GPIO_5__I2C3_SCL 0x4001b8b1
97 MX6QDL_PAD_GPIO_16__I2C3_SDA 0x4001b8b1
98 >;
99 };
100
101 pinctrl_uart4: uart4grp {
102 fsl,pins = <
103 MX6QDL_PAD_KEY_COL0__UART4_TX_DATA 0x1b0b1
104 MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA 0x1b0b1
105 >;
106 };
107
108 pinctrl_usdhc3: usdhc3grp {
109 fsl,pins = <
110 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059
111 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059
112 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059
113 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
114 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
115 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
116 >;
117 };
118
119 pinctrl_usdhc4: usdhc4grp {
120 fsl,pins = <
121 MX6QDL_PAD_SD4_CMD__SD4_CMD 0x17059
122 MX6QDL_PAD_SD4_CLK__SD4_CLK 0x10059
123 MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17059
124 MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17059
125 MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17059
126 MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17059
127 >;
128 };
129 };
130};
131
132&uart2 {
133 status = "okay";
134};
135
136&uart4 {
137 pinctrl-names = "default";
138 pinctrl-0 = <&pinctrl_uart4>;
139 status = "okay";
140};
141
142/* External USB-A port (USBOTG) */
143&usbotg {
144 disable-over-current;
145 status = "okay";
146};
147
148/* Internal USB port (USBH1), connected to RTL8192CU */
149&usbh1 {
150 disable-over-current;
151 status = "okay";
152};
153
154/* External microSD */
155&usdhc3 {
156 pinctrl-names = "default";
157 pinctrl-0 = <&pinctrl_usdhc3>;
158 bus-width = <4>;
159 cd-gpios = <&gpio6 11 0>;
160 vmmc-supply = <&reg_3p3v>;
161 status = "okay";
162};
163
164/* Internal microSD */
165&usdhc4 {
166 pinctrl-names = "default";
167 pinctrl-0 = <&pinctrl_usdhc4>;
168 bus-width = <4>;
169 vmmc-supply = <&reg_3p3v>;
170 status = "okay";
171};
diff --git a/arch/arm/boot/dts/imx6q-gw51xx.dts b/arch/arm/boot/dts/imx6q-gw51xx.dts
new file mode 100644
index 000000000000..af4929aee075
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-gw51xx.dts
@@ -0,0 +1,19 @@
1/*
2 * Copyright 2013 Gateworks Corporation
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/dts-v1/;
13#include "imx6q.dtsi"
14#include "imx6qdl-gw54xx.dtsi"
15
16/ {
17 model = "Gateworks Ventana i.MX6 Quad GW51XX";
18 compatible = "gw,imx6q-gw51xx", "gw,ventana", "fsl,imx6q";
19};
diff --git a/arch/arm/boot/dts/imx6q-gw52xx.dts b/arch/arm/boot/dts/imx6q-gw52xx.dts
new file mode 100644
index 000000000000..5f71ddbc7f05
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-gw52xx.dts
@@ -0,0 +1,23 @@
1/*
2 * Copyright 2013 Gateworks Corporation
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/dts-v1/;
13#include "imx6q.dtsi"
14#include "imx6qdl-gw52xx.dtsi"
15
16/ {
17 model = "Gateworks Ventana i.MX6 Quad GW52XX";
18 compatible = "gw,imx6q-gw52xx", "gw,ventana", "fsl,imx6q";
19};
20
21&sata {
22 status = "okay";
23};
diff --git a/arch/arm/boot/dts/imx6q-gw53xx.dts b/arch/arm/boot/dts/imx6q-gw53xx.dts
new file mode 100644
index 000000000000..360c316b4740
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-gw53xx.dts
@@ -0,0 +1,23 @@
1/*
2 * Copyright 2013 Gateworks Corporation
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/dts-v1/;
13#include "imx6q.dtsi"
14#include "imx6qdl-gw53xx.dtsi"
15
16/ {
17 model = "Gateworks Ventana i.MX6 Quad GW53XX";
18 compatible = "gw,imx6q-gw53xx", "gw,ventana", "fsl,imx6q";
19};
20
21&sata {
22 status = "okay";
23};
diff --git a/arch/arm/boot/dts/imx6q-gw5400-a.dts b/arch/arm/boot/dts/imx6q-gw5400-a.dts
new file mode 100644
index 000000000000..902f98310481
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-gw5400-a.dts
@@ -0,0 +1,546 @@
1/*
2 * Copyright 2013 Gateworks Corporation
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/dts-v1/;
13#include "imx6q.dtsi"
14
15/ {
16 model = "Gateworks Ventana GW5400-A";
17 compatible = "gw,imx6q-gw5400-a", "gw,ventana", "fsl,imx6q";
18
19 /* these are used by bootloader for disabling nodes */
20 aliases {
21 ethernet0 = &fec;
22 ethernet1 = &eth1;
23 i2c0 = &i2c1;
24 i2c1 = &i2c2;
25 i2c2 = &i2c3;
26 led0 = &led0;
27 led1 = &led1;
28 led2 = &led2;
29 sky2 = &eth1;
30 ssi0 = &ssi1;
31 spi0 = &ecspi1;
32 usb0 = &usbh1;
33 usb1 = &usbotg;
34 usdhc2 = &usdhc3;
35 };
36
37 chosen {
38 bootargs = "console=ttymxc1,115200";
39 };
40
41 leds {
42 compatible = "gpio-leds";
43
44 led0: user1 {
45 label = "user1";
46 gpios = <&gpio4 6 0>; /* 102 -> MX6_PANLEDG */
47 default-state = "on";
48 linux,default-trigger = "heartbeat";
49 };
50
51 led1: user2 {
52 label = "user2";
53 gpios = <&gpio4 10 0>; /* 106 -> MX6_PANLEDR */
54 default-state = "off";
55 };
56
57 led2: user3 {
58 label = "user3";
59 gpios = <&gpio4 15 1>; /* 111 -> MX6_LOCLED# */
60 default-state = "off";
61 };
62 };
63
64 memory {
65 reg = <0x10000000 0x40000000>;
66 };
67
68 pps {
69 compatible = "pps-gpio";
70 gpios = <&gpio1 5 0>;
71 status = "okay";
72 };
73
74 regulators {
75 compatible = "simple-bus";
76 #address-cells = <1>;
77 #size-cells = <0>;
78
79 reg_1p0v: regulator@0 {
80 compatible = "regulator-fixed";
81 reg = <0>;
82 regulator-name = "1P0V";
83 regulator-min-microvolt = <1000000>;
84 regulator-max-microvolt = <1000000>;
85 regulator-always-on;
86 };
87
88 reg_3p3v: regulator@1 {
89 compatible = "regulator-fixed";
90 reg = <1>;
91 regulator-name = "3P3V";
92 regulator-min-microvolt = <3300000>;
93 regulator-max-microvolt = <3300000>;
94 regulator-always-on;
95 };
96
97 reg_usb_h1_vbus: regulator@2 {
98 compatible = "regulator-fixed";
99 reg = <2>;
100 regulator-name = "usb_h1_vbus";
101 regulator-min-microvolt = <5000000>;
102 regulator-max-microvolt = <5000000>;
103 regulator-always-on;
104 };
105
106 reg_usb_otg_vbus: regulator@3 {
107 compatible = "regulator-fixed";
108 reg = <3>;
109 regulator-name = "usb_otg_vbus";
110 regulator-min-microvolt = <5000000>;
111 regulator-max-microvolt = <5000000>;
112 gpio = <&gpio3 22 0>;
113 enable-active-high;
114 };
115 };
116
117 sound {
118 compatible = "fsl,imx6q-sabrelite-sgtl5000",
119 "fsl,imx-audio-sgtl5000";
120 model = "imx6q-sabrelite-sgtl5000";
121 ssi-controller = <&ssi1>;
122 audio-codec = <&codec>;
123 audio-routing =
124 "MIC_IN", "Mic Jack",
125 "Mic Jack", "Mic Bias",
126 "Headphone Jack", "HP_OUT";
127 mux-int-port = <1>;
128 mux-ext-port = <4>;
129 };
130};
131
132&audmux {
133 pinctrl-names = "default";
134 pinctrl-0 = <&pinctrl_audmux>;
135 status = "okay";
136};
137
138&ecspi1 {
139 fsl,spi-num-chipselects = <1>;
140 cs-gpios = <&gpio3 19 0>;
141 pinctrl-names = "default";
142 pinctrl-0 = <&pinctrl_ecspi1>;
143 status = "okay";
144
145 flash: m25p80@0 {
146 compatible = "sst,w25q256";
147 spi-max-frequency = <30000000>;
148 reg = <0>;
149 };
150};
151
152&fec {
153 pinctrl-names = "default";
154 pinctrl-0 = <&pinctrl_enet>;
155 phy-mode = "rgmii";
156 phy-reset-gpios = <&gpio1 30 0>;
157 status = "okay";
158};
159
160&i2c1 {
161 clock-frequency = <100000>;
162 pinctrl-names = "default";
163 pinctrl-0 = <&pinctrl_i2c1>;
164 status = "okay";
165
166 eeprom1: eeprom@50 {
167 compatible = "atmel,24c02";
168 reg = <0x50>;
169 pagesize = <16>;
170 };
171
172 eeprom2: eeprom@51 {
173 compatible = "atmel,24c02";
174 reg = <0x51>;
175 pagesize = <16>;
176 };
177
178 eeprom3: eeprom@52 {
179 compatible = "atmel,24c02";
180 reg = <0x52>;
181 pagesize = <16>;
182 };
183
184 eeprom4: eeprom@53 {
185 compatible = "atmel,24c02";
186 reg = <0x53>;
187 pagesize = <16>;
188 };
189
190 gpio: pca9555@23 {
191 compatible = "nxp,pca9555";
192 reg = <0x23>;
193 gpio-controller;
194 #gpio-cells = <2>;
195 };
196
197 hwmon: gsc@29 {
198 compatible = "gw,gsp";
199 reg = <0x29>;
200 };
201
202 rtc: ds1672@68 {
203 compatible = "dallas,ds1672";
204 reg = <0x68>;
205 };
206};
207
208&i2c2 {
209 clock-frequency = <100000>;
210 pinctrl-names = "default";
211 pinctrl-0 = <&pinctrl_i2c2>;
212 status = "okay";
213
214 pmic: pfuze100@08 {
215 compatible = "fsl,pfuze100";
216 reg = <0x08>;
217
218 regulators {
219 sw1a_reg: sw1ab {
220 regulator-min-microvolt = <300000>;
221 regulator-max-microvolt = <1875000>;
222 regulator-boot-on;
223 regulator-always-on;
224 regulator-ramp-delay = <6250>;
225 };
226
227 sw1c_reg: sw1c {
228 regulator-min-microvolt = <300000>;
229 regulator-max-microvolt = <1875000>;
230 regulator-boot-on;
231 regulator-always-on;
232 regulator-ramp-delay = <6250>;
233 };
234
235 sw2_reg: sw2 {
236 regulator-min-microvolt = <800000>;
237 regulator-max-microvolt = <3950000>;
238 regulator-boot-on;
239 regulator-always-on;
240 };
241
242 sw3a_reg: sw3a {
243 regulator-min-microvolt = <400000>;
244 regulator-max-microvolt = <1975000>;
245 regulator-boot-on;
246 regulator-always-on;
247 };
248
249 sw3b_reg: sw3b {
250 regulator-min-microvolt = <400000>;
251 regulator-max-microvolt = <1975000>;
252 regulator-boot-on;
253 regulator-always-on;
254 };
255
256 sw4_reg: sw4 {
257 regulator-min-microvolt = <800000>;
258 regulator-max-microvolt = <3300000>;
259 };
260
261 swbst_reg: swbst {
262 regulator-min-microvolt = <5000000>;
263 regulator-max-microvolt = <5150000>;
264 };
265
266 snvs_reg: vsnvs {
267 regulator-min-microvolt = <1000000>;
268 regulator-max-microvolt = <3000000>;
269 regulator-boot-on;
270 regulator-always-on;
271 };
272
273 vref_reg: vrefddr {
274 regulator-boot-on;
275 regulator-always-on;
276 };
277
278 vgen1_reg: vgen1 {
279 regulator-min-microvolt = <800000>;
280 regulator-max-microvolt = <1550000>;
281 };
282
283 vgen2_reg: vgen2 {
284 regulator-min-microvolt = <800000>;
285 regulator-max-microvolt = <1550000>;
286 };
287
288 vgen3_reg: vgen3 {
289 regulator-min-microvolt = <1800000>;
290 regulator-max-microvolt = <3300000>;
291 };
292
293 vgen4_reg: vgen4 {
294 regulator-min-microvolt = <1800000>;
295 regulator-max-microvolt = <3300000>;
296 regulator-always-on;
297 };
298
299 vgen5_reg: vgen5 {
300 regulator-min-microvolt = <1800000>;
301 regulator-max-microvolt = <3300000>;
302 regulator-always-on;
303 };
304
305 vgen6_reg: vgen6 {
306 regulator-min-microvolt = <1800000>;
307 regulator-max-microvolt = <3300000>;
308 regulator-always-on;
309 };
310 };
311 };
312
313 pciswitch: pex8609@3f {
314 compatible = "plx,pex8609";
315 reg = <0x3f>;
316 };
317
318 pciclkgen: si52147@6b {
319 compatible = "sil,si52147";
320 reg = <0x6b>;
321 };
322};
323
324&i2c3 {
325 clock-frequency = <100000>;
326 pinctrl-names = "default";
327 pinctrl-0 = <&pinctrl_i2c3>;
328 status = "okay";
329
330 accelerometer: mma8450@1c {
331 compatible = "fsl,mma8450";
332 reg = <0x1c>;
333 };
334
335 codec: sgtl5000@0a {
336 compatible = "fsl,sgtl5000";
337 reg = <0x0a>;
338 clocks = <&clks 201>;
339 VDDA-supply = <&sw4_reg>;
340 VDDIO-supply = <&reg_3p3v>;
341 };
342
343 hdmiin: adv7611@4c {
344 compatible = "adi,adv7611";
345 reg = <0x4c>;
346 };
347
348 touchscreen: egalax_ts@04 {
349 compatible = "eeti,egalax_ts";
350 reg = <0x04>;
351 interrupt-parent = <&gpio7>;
352 interrupts = <12 2>; /* gpio7_12 active low */
353 wakeup-gpios = <&gpio7 12 0>;
354 };
355
356 videoout: adv7393@2a {
357 compatible = "adi,adv7393";
358 reg = <0x2a>;
359 };
360
361 videoin: adv7180@20 {
362 compatible = "adi,adv7180";
363 reg = <0x20>;
364 };
365};
366
367&iomuxc {
368 pinctrl-names = "default";
369 pinctrl-0 = <&pinctrl_hog>;
370
371 imx6q-gw5400-a {
372 pinctrl_hog: hoggrp {
373 fsl,pins = <
374 MX6QDL_PAD_EIM_D22__GPIO3_IO22 0x80000000 /* OTG_PWR_EN */
375 MX6QDL_PAD_EIM_D19__GPIO3_IO19 0x80000000 /* SPINOR_CS0# */
376 MX6QDL_PAD_ENET_TX_EN__GPIO1_IO28 0x80000000 /* PCIE IRQ */
377 MX6QDL_PAD_ENET_TXD1__GPIO1_IO29 0x80000000 /* PCIE RST */
378 MX6QDL_PAD_GPIO_0__CCM_CLKO1 0x000130b0 /* AUD4_MCK */
379 MX6QDL_PAD_GPIO_5__GPIO1_IO05 0x80000000 /* GPS_PPS */
380 MX6QDL_PAD_GPIO_17__GPIO7_IO12 0x80000000 /* TOUCH_IRQ# */
381 MX6QDL_PAD_KEY_COL0__GPIO4_IO06 0x80000000 /* user1 led */
382 MX6QDL_PAD_KEY_COL2__GPIO4_IO10 0x80000000 /* user2 led */
383 MX6QDL_PAD_KEY_ROW4__GPIO4_IO15 0x80000000 /* user3 led */
384 MX6QDL_PAD_SD1_DAT0__GPIO1_IO16 0x80000000 /* USBHUB_RST# */
385 MX6QDL_PAD_SD1_DAT3__GPIO1_IO21 0x80000000 /* MIPI_DIO */
386 >;
387 };
388
389 pinctrl_audmux: audmuxgrp {
390 fsl,pins = <
391 MX6QDL_PAD_SD2_DAT0__AUD4_RXD 0x130b0
392 MX6QDL_PAD_SD2_DAT3__AUD4_TXC 0x130b0
393 MX6QDL_PAD_SD2_DAT2__AUD4_TXD 0x110b0
394 MX6QDL_PAD_SD2_DAT1__AUD4_TXFS 0x130b0
395 >;
396 };
397
398 pinctrl_ecspi1: ecspi1grp {
399 fsl,pins = <
400 MX6QDL_PAD_EIM_D17__ECSPI1_MISO 0x100b1
401 MX6QDL_PAD_EIM_D18__ECSPI1_MOSI 0x100b1
402 MX6QDL_PAD_EIM_D16__ECSPI1_SCLK 0x100b1
403 >;
404 };
405
406 pinctrl_enet: enetgrp {
407 fsl,pins = <
408 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
409 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
410 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
411 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
412 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
413 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
414 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
415 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
416 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
417 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
418 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
419 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
420 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
421 MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
422 MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
423 MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0a8
424 >;
425 };
426
427 pinctrl_i2c1: i2c1grp {
428 fsl,pins = <
429 MX6QDL_PAD_EIM_D21__I2C1_SCL 0x4001b8b1
430 MX6QDL_PAD_EIM_D28__I2C1_SDA 0x4001b8b1
431 >;
432 };
433
434 pinctrl_i2c2: i2c2grp {
435 fsl,pins = <
436 MX6QDL_PAD_KEY_COL3__I2C2_SCL 0x4001b8b1
437 MX6QDL_PAD_KEY_ROW3__I2C2_SDA 0x4001b8b1
438 >;
439 };
440
441 pinctrl_i2c3: i2c3grp {
442 fsl,pins = <
443 MX6QDL_PAD_GPIO_3__I2C3_SCL 0x4001b8b1
444 MX6QDL_PAD_GPIO_6__I2C3_SDA 0x4001b8b1
445 >;
446 };
447
448 pinctrl_uart1: uart1grp {
449 fsl,pins = <
450 MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA 0x1b0b1
451 MX6QDL_PAD_SD3_DAT6__UART1_RX_DATA 0x1b0b1
452 >;
453 };
454
455 pinctrl_uart2: uart2grp {
456 fsl,pins = <
457 MX6QDL_PAD_SD4_DAT7__UART2_TX_DATA 0x1b0b1
458 MX6QDL_PAD_SD4_DAT4__UART2_RX_DATA 0x1b0b1
459 >;
460 };
461
462 pinctrl_uart5: uart5grp {
463 fsl,pins = <
464 MX6QDL_PAD_KEY_COL1__UART5_TX_DATA 0x1b0b1
465 MX6QDL_PAD_KEY_ROW1__UART5_RX_DATA 0x1b0b1
466 >;
467 };
468
469 pinctrl_usbotg: usbotggrp {
470 fsl,pins = <
471 MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
472 >;
473 };
474
475 pinctrl_usdhc3: usdhc3grp {
476 fsl,pins = <
477 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059
478 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059
479 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059
480 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
481 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
482 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
483 >;
484 };
485 };
486};
487
488&ldb {
489 status = "okay";
490 lvds-channel@0 {
491 crtcs = <&ipu1 0>, <&ipu1 1>, <&ipu2 0>, <&ipu2 1>;
492 };
493};
494
495&pcie {
496 reset-gpio = <&gpio1 29 0>;
497 status = "okay";
498
499 eth1: sky2@8 { /* MAC/PHY on bus 8 */
500 compatible = "marvell,sky2";
501 };
502};
503
504&ssi1 {
505 fsl,mode = "i2s-slave";
506 status = "okay";
507};
508
509&uart1 {
510 pinctrl-names = "default";
511 pinctrl-0 = <&pinctrl_uart1>;
512 status = "okay";
513};
514
515&uart2 {
516 pinctrl-names = "default";
517 pinctrl-0 = <&pinctrl_uart2>;
518 status = "okay";
519};
520
521&uart5 {
522 pinctrl-names = "default";
523 pinctrl-0 = <&pinctrl_uart5>;
524 status = "okay";
525};
526
527&usbotg {
528 vbus-supply = <&reg_usb_otg_vbus>;
529 pinctrl-names = "default";
530 pinctrl-0 = <&pinctrl_usbotg>;
531 disable-over-current;
532 status = "okay";
533};
534
535&usbh1 {
536 vbus-supply = <&reg_usb_h1_vbus>;
537 status = "okay";
538};
539
540&usdhc3 {
541 pinctrl-names = "default";
542 pinctrl-0 = <&pinctrl_usdhc3>;
543 cd-gpios = <&gpio7 0 0>;
544 vmmc-supply = <&reg_3p3v>;
545 status = "okay";
546};
diff --git a/arch/arm/boot/dts/imx6q-gw54xx.dts b/arch/arm/boot/dts/imx6q-gw54xx.dts
new file mode 100644
index 000000000000..ab518d66a75e
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-gw54xx.dts
@@ -0,0 +1,23 @@
1/*
2 * Copyright 2013 Gateworks Corporation
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/dts-v1/;
13#include "imx6q.dtsi"
14#include "imx6qdl-gw54xx.dtsi"
15
16/ {
17 model = "Gateworks Ventana i.MX6 Quad GW54XX";
18 compatible = "gw,imx6q-gw54xx", "gw,ventana", "fsl,imx6q";
19};
20
21&sata {
22 status = "okay";
23};
diff --git a/arch/arm/boot/dts/imx6q-nitrogen6x.dts b/arch/arm/boot/dts/imx6q-nitrogen6x.dts
new file mode 100644
index 000000000000..a57866b2e97e
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-nitrogen6x.dts
@@ -0,0 +1,25 @@
1/*
2 * Copyright 2013 Boundary Devices, Inc.
3 * Copyright 2012 Freescale Semiconductor, Inc.
4 * Copyright 2011 Linaro Ltd.
5 *
6 * The code contained herein is licensed under the GNU General Public
7 * License. You may obtain a copy of the GNU General Public License
8 * Version 2 or later at the following locations:
9 *
10 * http://www.opensource.org/licenses/gpl-license.html
11 * http://www.gnu.org/copyleft/gpl.html
12 */
13
14/dts-v1/;
15#include "imx6q.dtsi"
16#include "imx6qdl-nitrogen6x.dtsi"
17
18/ {
19 model = "Freescale i.MX6 Quad Nitrogen6x Board";
20 compatible = "fsl,imx6q-nitrogen6x", "fsl,imx6q";
21};
22
23&sata {
24 status = "okay";
25};
diff --git a/arch/arm/boot/dts/imx6q-phytec-pbab01.dts b/arch/arm/boot/dts/imx6q-phytec-pbab01.dts
index 7d37ec60d58d..5607c331fca8 100644
--- a/arch/arm/boot/dts/imx6q-phytec-pbab01.dts
+++ b/arch/arm/boot/dts/imx6q-phytec-pbab01.dts
@@ -21,10 +21,26 @@
21 status = "okay"; 21 status = "okay";
22}; 22};
23 23
24&gpmi {
25 status = "okay";
26};
27
28&sata {
29 status = "okay";
30};
31
24&uart4 { 32&uart4 {
25 status = "okay"; 33 status = "okay";
26}; 34};
27 35
36&usbh1 {
37 status = "okay";
38};
39
40&usbotg {
41 status = "okay";
42};
43
28&usdhc2 { 44&usdhc2 {
29 status = "okay"; 45 status = "okay";
30}; 46};
diff --git a/arch/arm/boot/dts/imx6q-phytec-pfla02.dtsi b/arch/arm/boot/dts/imx6q-phytec-pfla02.dtsi
index 1a3b50d4d8fa..324f1550976b 100644
--- a/arch/arm/boot/dts/imx6q-phytec-pfla02.dtsi
+++ b/arch/arm/boot/dts/imx6q-phytec-pfla02.dtsi
@@ -18,11 +18,35 @@
18 memory { 18 memory {
19 reg = <0x10000000 0x80000000>; 19 reg = <0x10000000 0x80000000>;
20 }; 20 };
21
22 regulators {
23 compatible = "simple-bus";
24 #address-cells = <1>;
25 #size-cells = <0>;
26
27 reg_usb_otg_vbus: regulator@0 {
28 compatible = "regulator-fixed";
29 reg = <0>;
30 regulator-name = "usb_otg_vbus";
31 regulator-min-microvolt = <5000000>;
32 regulator-max-microvolt = <5000000>;
33 gpio = <&gpio4 15 0>;
34 };
35
36 reg_usb_h1_vbus: regulator@1 {
37 compatible = "regulator-fixed";
38 reg = <1>;
39 regulator-name = "usb_h1_vbus";
40 regulator-min-microvolt = <5000000>;
41 regulator-max-microvolt = <5000000>;
42 gpio = <&gpio1 0 0>;
43 };
44 };
21}; 45};
22 46
23&ecspi3 { 47&ecspi3 {
24 pinctrl-names = "default"; 48 pinctrl-names = "default";
25 pinctrl-0 = <&pinctrl_ecspi3_1>; 49 pinctrl-0 = <&pinctrl_ecspi3>;
26 status = "okay"; 50 status = "okay";
27 fsl,spi-num-chipselects = <1>; 51 fsl,spi-num-chipselects = <1>;
28 cs-gpios = <&gpio4 24 0>; 52 cs-gpios = <&gpio4 24 0>;
@@ -36,7 +60,7 @@
36 60
37&i2c1 { 61&i2c1 {
38 pinctrl-names = "default"; 62 pinctrl-names = "default";
39 pinctrl-0 = <&pinctrl_i2c1_1>; 63 pinctrl-0 = <&pinctrl_i2c1>;
40 status = "okay"; 64 status = "okay";
41 65
42 eeprom@50 { 66 eeprom@50 {
@@ -128,7 +152,7 @@
128 pinctrl-names = "default"; 152 pinctrl-names = "default";
129 pinctrl-0 = <&pinctrl_hog>; 153 pinctrl-0 = <&pinctrl_hog>;
130 154
131 hog { 155 imx6q-phytec-pfla02 {
132 pinctrl_hog: hoggrp { 156 pinctrl_hog: hoggrp {
133 fsl,pins = < 157 fsl,pins = <
134 MX6QDL_PAD_EIM_D23__GPIO3_IO23 0x80000000 158 MX6QDL_PAD_EIM_D23__GPIO3_IO23 0x80000000
@@ -136,10 +160,109 @@
136 MX6QDL_PAD_DI0_PIN15__GPIO4_IO17 0x80000000 /* PMIC interrupt */ 160 MX6QDL_PAD_DI0_PIN15__GPIO4_IO17 0x80000000 /* PMIC interrupt */
137 >; 161 >;
138 }; 162 };
139 };
140 163
141 pfla02 { 164 pinctrl_ecspi3: ecspi3grp {
142 pinctrl_usdhc3_pfla02: usdhc3grp-pfla02 { 165 fsl,pins = <
166 MX6QDL_PAD_DISP0_DAT2__ECSPI3_MISO 0x100b1
167 MX6QDL_PAD_DISP0_DAT1__ECSPI3_MOSI 0x100b1
168 MX6QDL_PAD_DISP0_DAT0__ECSPI3_SCLK 0x100b1
169 >;
170 };
171
172 pinctrl_enet: enetgrp {
173 fsl,pins = <
174 MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
175 MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
176 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
177 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
178 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
179 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
180 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
181 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
182 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
183 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
184 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
185 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
186 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
187 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
188 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
189 MX6QDL_PAD_ENET_TX_EN__ENET_TX_EN 0x1b0b0
190 >;
191 };
192
193 pinctrl_gpmi_nand: gpminandgrp {
194 fsl,pins = <
195 MX6QDL_PAD_NANDF_CLE__NAND_CLE 0xb0b1
196 MX6QDL_PAD_NANDF_ALE__NAND_ALE 0xb0b1
197 MX6QDL_PAD_NANDF_WP_B__NAND_WP_B 0xb0b1
198 MX6QDL_PAD_NANDF_RB0__NAND_READY_B 0xb000
199 MX6QDL_PAD_NANDF_CS0__NAND_CE0_B 0xb0b1
200 MX6QDL_PAD_NANDF_CS1__NAND_CE1_B 0xb0b1
201 MX6QDL_PAD_SD4_CMD__NAND_RE_B 0xb0b1
202 MX6QDL_PAD_SD4_CLK__NAND_WE_B 0xb0b1
203 MX6QDL_PAD_NANDF_D0__NAND_DATA00 0xb0b1
204 MX6QDL_PAD_NANDF_D1__NAND_DATA01 0xb0b1
205 MX6QDL_PAD_NANDF_D2__NAND_DATA02 0xb0b1
206 MX6QDL_PAD_NANDF_D3__NAND_DATA03 0xb0b1
207 MX6QDL_PAD_NANDF_D4__NAND_DATA04 0xb0b1
208 MX6QDL_PAD_NANDF_D5__NAND_DATA05 0xb0b1
209 MX6QDL_PAD_NANDF_D6__NAND_DATA06 0xb0b1
210 MX6QDL_PAD_NANDF_D7__NAND_DATA07 0xb0b1
211 MX6QDL_PAD_SD4_DAT0__NAND_DQS 0x00b1
212 >;
213 };
214
215 pinctrl_i2c1: i2c1grp {
216 fsl,pins = <
217 MX6QDL_PAD_EIM_D21__I2C1_SCL 0x4001b8b1
218 MX6QDL_PAD_EIM_D28__I2C1_SDA 0x4001b8b1
219 >;
220 };
221
222 pinctrl_uart4: uart4grp {
223 fsl,pins = <
224 MX6QDL_PAD_KEY_COL0__UART4_TX_DATA 0x1b0b1
225 MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA 0x1b0b1
226 >;
227 };
228
229 pinctrl_usbh1: usbh1grp {
230 fsl,pins = <
231 MX6QDL_PAD_GPIO_0__USB_H1_PWR 0x80000000
232 >;
233 };
234
235 pinctrl_usbotg: usbotggrp {
236 fsl,pins = <
237 MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
238 MX6QDL_PAD_KEY_COL4__USB_OTG_OC 0x1b0b0
239 MX6QDL_PAD_KEY_ROW4__GPIO4_IO15 0x80000000
240 >;
241 };
242
243 pinctrl_usdhc2: usdhc2grp {
244 fsl,pins = <
245 MX6QDL_PAD_SD2_CMD__SD2_CMD 0x17059
246 MX6QDL_PAD_SD2_CLK__SD2_CLK 0x10059
247 MX6QDL_PAD_SD2_DAT0__SD2_DATA0 0x17059
248 MX6QDL_PAD_SD2_DAT1__SD2_DATA1 0x17059
249 MX6QDL_PAD_SD2_DAT2__SD2_DATA2 0x17059
250 MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x17059
251 >;
252 };
253
254 pinctrl_usdhc3: usdhc3grp {
255 fsl,pins = <
256 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059
257 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059
258 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059
259 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
260 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
261 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
262 >;
263 };
264
265 pinctrl_usdhc3_cdwp: usdhc3cdwp {
143 fsl,pins = < 266 fsl,pins = <
144 MX6QDL_PAD_ENET_RXD0__GPIO1_IO27 0x80000000 267 MX6QDL_PAD_ENET_RXD0__GPIO1_IO27 0x80000000
145 MX6QDL_PAD_ENET_TXD1__GPIO1_IO29 0x80000000 268 MX6QDL_PAD_ENET_TXD1__GPIO1_IO29 0x80000000
@@ -150,21 +273,43 @@
150 273
151&fec { 274&fec {
152 pinctrl-names = "default"; 275 pinctrl-names = "default";
153 pinctrl-0 = <&pinctrl_enet_3>; 276 pinctrl-0 = <&pinctrl_enet>;
154 phy-mode = "rgmii"; 277 phy-mode = "rgmii";
155 phy-reset-gpios = <&gpio3 23 0>; 278 phy-reset-gpios = <&gpio3 23 0>;
156 status = "disabled"; 279 status = "disabled";
157}; 280};
158 281
282&gpmi {
283 pinctrl-names = "default";
284 pinctrl-0 = <&pinctrl_gpmi_nand>;
285 nand-on-flash-bbt;
286 status = "disabled";
287};
288
159&uart4 { 289&uart4 {
160 pinctrl-names = "default"; 290 pinctrl-names = "default";
161 pinctrl-0 = <&pinctrl_uart4_1>; 291 pinctrl-0 = <&pinctrl_uart4>;
292 status = "disabled";
293};
294
295&usbh1 {
296 vbus-supply = <&reg_usb_h1_vbus>;
297 pinctrl-names = "default";
298 pinctrl-0 = <&pinctrl_usbh1>;
299 status = "disabled";
300};
301
302&usbotg {
303 vbus-supply = <&reg_usb_otg_vbus>;
304 pinctrl-names = "default";
305 pinctrl-0 = <&pinctrl_usbotg>;
306 disable-over-current;
162 status = "disabled"; 307 status = "disabled";
163}; 308};
164 309
165&usdhc2 { 310&usdhc2 {
166 pinctrl-names = "default"; 311 pinctrl-names = "default";
167 pinctrl-0 = <&pinctrl_usdhc2_2>; 312 pinctrl-0 = <&pinctrl_usdhc2>;
168 cd-gpios = <&gpio1 4 0>; 313 cd-gpios = <&gpio1 4 0>;
169 wp-gpios = <&gpio1 2 0>; 314 wp-gpios = <&gpio1 2 0>;
170 status = "disabled"; 315 status = "disabled";
@@ -172,8 +317,8 @@
172 317
173&usdhc3 { 318&usdhc3 {
174 pinctrl-names = "default"; 319 pinctrl-names = "default";
175 pinctrl-0 = <&pinctrl_usdhc3_2 320 pinctrl-0 = <&pinctrl_usdhc3
176 &pinctrl_usdhc3_pfla02>; 321 &pinctrl_usdhc3_cdwp>;
177 cd-gpios = <&gpio1 27 0>; 322 cd-gpios = <&gpio1 27 0>;
178 wp-gpios = <&gpio1 29 0>; 323 wp-gpios = <&gpio1 29 0>;
179 status = "disabled"; 324 status = "disabled";
diff --git a/arch/arm/boot/dts/imx6q-pinfunc.h b/arch/arm/boot/dts/imx6q-pinfunc.h
index 97ed0816a6e0..9fc6120a1853 100644
--- a/arch/arm/boot/dts/imx6q-pinfunc.h
+++ b/arch/arm/boot/dts/imx6q-pinfunc.h
@@ -673,6 +673,7 @@
673#define MX6QDL_PAD_GPIO_3__USB_H1_OC 0x22c 0x5fc 0x948 0x6 0x1 673#define MX6QDL_PAD_GPIO_3__USB_H1_OC 0x22c 0x5fc 0x948 0x6 0x1
674#define MX6QDL_PAD_GPIO_3__MLB_CLK 0x22c 0x5fc 0x900 0x7 0x1 674#define MX6QDL_PAD_GPIO_3__MLB_CLK 0x22c 0x5fc 0x900 0x7 0x1
675#define MX6QDL_PAD_GPIO_6__ESAI_TX_CLK 0x230 0x600 0x870 0x0 0x1 675#define MX6QDL_PAD_GPIO_6__ESAI_TX_CLK 0x230 0x600 0x870 0x0 0x1
676#define MX6QDL_PAD_GPIO_6__ENET_IRQ 0x230 0x600 0x03c 0x11 0xff000609
676#define MX6QDL_PAD_GPIO_6__I2C3_SDA 0x230 0x600 0x8ac 0x2 0x1 677#define MX6QDL_PAD_GPIO_6__I2C3_SDA 0x230 0x600 0x8ac 0x2 0x1
677#define MX6QDL_PAD_GPIO_6__GPIO1_IO06 0x230 0x600 0x000 0x5 0x0 678#define MX6QDL_PAD_GPIO_6__GPIO1_IO06 0x230 0x600 0x000 0x5 0x0
678#define MX6QDL_PAD_GPIO_6__SD2_LCTL 0x230 0x600 0x000 0x6 0x0 679#define MX6QDL_PAD_GPIO_6__SD2_LCTL 0x230 0x600 0x000 0x6 0x0
@@ -1024,6 +1025,7 @@
1024#define MX6QDL_PAD_SD1_DAT2__WDOG1_RESET_B_DEB 0x34c 0x734 0x000 0x6 0x0 1025#define MX6QDL_PAD_SD1_DAT2__WDOG1_RESET_B_DEB 0x34c 0x734 0x000 0x6 0x0
1025#define MX6QDL_PAD_SD1_CLK__SD1_CLK 0x350 0x738 0x000 0x0 0x0 1026#define MX6QDL_PAD_SD1_CLK__SD1_CLK 0x350 0x738 0x000 0x0 0x0
1026#define MX6QDL_PAD_SD1_CLK__ECSPI5_SCLK 0x350 0x738 0x828 0x1 0x0 1027#define MX6QDL_PAD_SD1_CLK__ECSPI5_SCLK 0x350 0x738 0x828 0x1 0x0
1028#define MX6QDL_PAD_SD1_CLK__OSC32K_32K_OUT 0x350 0x738 0x000 0x2 0x0
1027#define MX6QDL_PAD_SD1_CLK__GPT_CLKIN 0x350 0x738 0x000 0x3 0x0 1029#define MX6QDL_PAD_SD1_CLK__GPT_CLKIN 0x350 0x738 0x000 0x3 0x0
1028#define MX6QDL_PAD_SD1_CLK__GPIO1_IO20 0x350 0x738 0x000 0x5 0x0 1030#define MX6QDL_PAD_SD1_CLK__GPIO1_IO20 0x350 0x738 0x000 0x5 0x0
1029#define MX6QDL_PAD_SD2_CLK__SD2_CLK 0x354 0x73c 0x000 0x0 0x0 1031#define MX6QDL_PAD_SD2_CLK__SD2_CLK 0x354 0x73c 0x000 0x0 0x0
diff --git a/arch/arm/boot/dts/imx6q-sabrelite.dts b/arch/arm/boot/dts/imx6q-sabrelite.dts
index f004913f7d80..96e4688be77c 100644
--- a/arch/arm/boot/dts/imx6q-sabrelite.dts
+++ b/arch/arm/boot/dts/imx6q-sabrelite.dts
@@ -12,189 +12,13 @@
12 12
13/dts-v1/; 13/dts-v1/;
14#include "imx6q.dtsi" 14#include "imx6q.dtsi"
15#include "imx6qdl-sabrelite.dtsi"
15 16
16/ { 17/ {
17 model = "Freescale i.MX6 Quad SABRE Lite Board"; 18 model = "Freescale i.MX6 Quad SABRE Lite Board";
18 compatible = "fsl,imx6q-sabrelite", "fsl,imx6q"; 19 compatible = "fsl,imx6q-sabrelite", "fsl,imx6q";
19
20 memory {
21 reg = <0x10000000 0x40000000>;
22 };
23
24 regulators {
25 compatible = "simple-bus";
26
27 reg_2p5v: 2p5v {
28 compatible = "regulator-fixed";
29 regulator-name = "2P5V";
30 regulator-min-microvolt = <2500000>;
31 regulator-max-microvolt = <2500000>;
32 regulator-always-on;
33 };
34
35 reg_3p3v: 3p3v {
36 compatible = "regulator-fixed";
37 regulator-name = "3P3V";
38 regulator-min-microvolt = <3300000>;
39 regulator-max-microvolt = <3300000>;
40 regulator-always-on;
41 };
42
43 reg_usb_otg_vbus: usb_otg_vbus {
44 compatible = "regulator-fixed";
45 regulator-name = "usb_otg_vbus";
46 regulator-min-microvolt = <5000000>;
47 regulator-max-microvolt = <5000000>;
48 gpio = <&gpio3 22 0>;
49 enable-active-high;
50 };
51 };
52
53 sound {
54 compatible = "fsl,imx6q-sabrelite-sgtl5000",
55 "fsl,imx-audio-sgtl5000";
56 model = "imx6q-sabrelite-sgtl5000";
57 ssi-controller = <&ssi1>;
58 audio-codec = <&codec>;
59 audio-routing =
60 "MIC_IN", "Mic Jack",
61 "Mic Jack", "Mic Bias",
62 "Headphone Jack", "HP_OUT";
63 mux-int-port = <1>;
64 mux-ext-port = <4>;
65 };
66};
67
68&audmux {
69 status = "okay";
70 pinctrl-names = "default";
71 pinctrl-0 = <&pinctrl_audmux_1>;
72};
73
74&ecspi1 {
75 fsl,spi-num-chipselects = <1>;
76 cs-gpios = <&gpio3 19 0>;
77 pinctrl-names = "default";
78 pinctrl-0 = <&pinctrl_ecspi1_1>;
79 status = "okay";
80
81 flash: m25p80@0 {
82 compatible = "sst,sst25vf016b";
83 spi-max-frequency = <20000000>;
84 reg = <0>;
85 };
86};
87
88&fec {
89 pinctrl-names = "default";
90 pinctrl-0 = <&pinctrl_enet_1>;
91 phy-mode = "rgmii";
92 phy-reset-gpios = <&gpio3 23 0>;
93 status = "okay";
94};
95
96&i2c1 {
97 status = "okay";
98 clock-frequency = <100000>;
99 pinctrl-names = "default";
100 pinctrl-0 = <&pinctrl_i2c1_1>;
101
102 codec: sgtl5000@0a {
103 compatible = "fsl,sgtl5000";
104 reg = <0x0a>;
105 clocks = <&clks 201>;
106 VDDA-supply = <&reg_2p5v>;
107 VDDIO-supply = <&reg_3p3v>;
108 };
109};
110
111&iomuxc {
112 pinctrl-names = "default";
113 pinctrl-0 = <&pinctrl_hog>;
114
115 hog {
116 pinctrl_hog: hoggrp {
117 fsl,pins = <
118 MX6QDL_PAD_NANDF_D6__GPIO2_IO06 0x80000000
119 MX6QDL_PAD_NANDF_D7__GPIO2_IO07 0x80000000
120 MX6QDL_PAD_EIM_D19__GPIO3_IO19 0x80000000
121 MX6QDL_PAD_EIM_D22__GPIO3_IO22 0x80000000
122 MX6QDL_PAD_EIM_D23__GPIO3_IO23 0x80000000
123 MX6QDL_PAD_SD3_DAT5__GPIO7_IO00 0x80000000
124 MX6QDL_PAD_SD3_DAT4__GPIO7_IO01 0x1f0b0
125 MX6QDL_PAD_GPIO_0__CCM_CLKO1 0x80000000
126 MX6QDL_PAD_EIM_D23__GPIO3_IO23 0x80000000
127 >;
128 };
129 };
130};
131
132&ldb {
133 status = "okay";
134
135 lvds-channel@0 {
136 fsl,data-mapping = "spwg";
137 fsl,data-width = <18>;
138 status = "okay";
139
140 display-timings {
141 native-mode = <&timing0>;
142 timing0: hsd100pxn1 {
143 clock-frequency = <65000000>;
144 hactive = <1024>;
145 vactive = <768>;
146 hback-porch = <220>;
147 hfront-porch = <40>;
148 vback-porch = <21>;
149 vfront-porch = <7>;
150 hsync-len = <60>;
151 vsync-len = <10>;
152 };
153 };
154 };
155}; 20};
156 21
157&sata { 22&sata {
158 status = "okay"; 23 status = "okay";
159}; 24};
160
161&ssi1 {
162 fsl,mode = "i2s-slave";
163 status = "okay";
164};
165
166&uart2 {
167 status = "okay";
168 pinctrl-names = "default";
169 pinctrl-0 = <&pinctrl_uart2_1>;
170};
171
172&usbh1 {
173 status = "okay";
174};
175
176&usbotg {
177 vbus-supply = <&reg_usb_otg_vbus>;
178 pinctrl-names = "default";
179 pinctrl-0 = <&pinctrl_usbotg_1>;
180 disable-over-current;
181 status = "okay";
182};
183
184&usdhc3 {
185 pinctrl-names = "default";
186 pinctrl-0 = <&pinctrl_usdhc3_2>;
187 cd-gpios = <&gpio7 0 0>;
188 wp-gpios = <&gpio7 1 0>;
189 vmmc-supply = <&reg_3p3v>;
190 status = "okay";
191};
192
193&usdhc4 {
194 pinctrl-names = "default";
195 pinctrl-0 = <&pinctrl_usdhc4_2>;
196 cd-gpios = <&gpio2 6 0>;
197 wp-gpios = <&gpio2 7 0>;
198 vmmc-supply = <&reg_3p3v>;
199 status = "okay";
200};
diff --git a/arch/arm/boot/dts/imx6q-sbc6x.dts b/arch/arm/boot/dts/imx6q-sbc6x.dts
index ee6addf149af..86cf09364664 100644
--- a/arch/arm/boot/dts/imx6q-sbc6x.dts
+++ b/arch/arm/boot/dts/imx6q-sbc6x.dts
@@ -17,28 +17,78 @@
17 }; 17 };
18}; 18};
19 19
20
20&fec { 21&fec {
21 pinctrl-names = "default"; 22 pinctrl-names = "default";
22 pinctrl-0 = <&pinctrl_enet_1>; 23 pinctrl-0 = <&pinctrl_enet>;
23 phy-mode = "rgmii"; 24 phy-mode = "rgmii";
24 status = "okay"; 25 status = "okay";
25}; 26};
26 27
28&iomuxc {
29 imx6q-sbc6x {
30 pinctrl_enet: enetgrp {
31 fsl,pins = <
32 MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
33 MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
34 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
35 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
36 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
37 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
38 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
39 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
40 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
41 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
42 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
43 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
44 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
45 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
46 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
47 MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0a8
48 >;
49 };
50
51 pinctrl_uart1: uart1grp {
52 fsl,pins = <
53 MX6QDL_PAD_CSI0_DAT10__UART1_TX_DATA 0x1b0b1
54 MX6QDL_PAD_CSI0_DAT11__UART1_RX_DATA 0x1b0b1
55 >;
56 };
57
58 pinctrl_usbotg: usbotggrp {
59 fsl,pins = <
60 MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
61 >;
62 };
63
64 pinctrl_usdhc3: usdhc3grp {
65 fsl,pins = <
66 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059
67 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059
68 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059
69 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
70 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
71 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
72 >;
73 };
74 };
75};
76
27&uart1 { 77&uart1 {
28 pinctrl-names = "default"; 78 pinctrl-names = "default";
29 pinctrl-0 = <&pinctrl_uart1_1>; 79 pinctrl-0 = <&pinctrl_uart1>;
30 status = "okay"; 80 status = "okay";
31}; 81};
32 82
33&usbotg { 83&usbotg {
34 pinctrl-names = "default"; 84 pinctrl-names = "default";
35 pinctrl-0 = <&pinctrl_usbotg_1>; 85 pinctrl-0 = <&pinctrl_usbotg>;
36 disable-over-current; 86 disable-over-current;
37 status = "okay"; 87 status = "okay";
38}; 88};
39 89
40&usdhc3 { 90&usdhc3 {
41 pinctrl-names = "default"; 91 pinctrl-names = "default";
42 pinctrl-0 = <&pinctrl_usdhc3_2>; 92 pinctrl-0 = <&pinctrl_usdhc3>;
43 status = "okay"; 93 status = "okay";
44}; 94};
diff --git a/arch/arm/boot/dts/imx6q-udoo.dts b/arch/arm/boot/dts/imx6q-udoo.dts
index 6e1ccdc019a7..ed397d149ab6 100644
--- a/arch/arm/boot/dts/imx6q-udoo.dts
+++ b/arch/arm/boot/dts/imx6q-udoo.dts
@@ -21,19 +21,69 @@
21 }; 21 };
22}; 22};
23 23
24&fec {
25 pinctrl-names = "default";
26 pinctrl-0 = <&pinctrl_enet>;
27 phy-mode = "rgmii";
28 status = "okay";
29};
30
31&iomuxc {
32 imx6q-udoo {
33 pinctrl_enet: enetgrp {
34 fsl,pins = <
35 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
36 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
37 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
38 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
39 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
40 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
41 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
42 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
43 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
44 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
45 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
46 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
47 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
48 MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
49 MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
50 MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0a8
51 >;
52 };
53
54 pinctrl_uart2: uart2grp {
55 fsl,pins = <
56 MX6QDL_PAD_EIM_D26__UART2_TX_DATA 0x1b0b1
57 MX6QDL_PAD_EIM_D27__UART2_RX_DATA 0x1b0b1
58 >;
59 };
60
61 pinctrl_usdhc3: usdhc3grp {
62 fsl,pins = <
63 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059
64 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059
65 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059
66 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
67 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
68 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
69 >;
70 };
71 };
72};
73
24&sata { 74&sata {
25 status = "okay"; 75 status = "okay";
26}; 76};
27 77
28&uart2 { 78&uart2 {
29 pinctrl-names = "default"; 79 pinctrl-names = "default";
30 pinctrl-0 = <&pinctrl_uart2_1>; 80 pinctrl-0 = <&pinctrl_uart2>;
31 status = "okay"; 81 status = "okay";
32}; 82};
33 83
34&usdhc3 { 84&usdhc3 {
35 pinctrl-names = "default"; 85 pinctrl-names = "default";
36 pinctrl-0 = <&pinctrl_usdhc3_2>; 86 pinctrl-0 = <&pinctrl_usdhc3>;
37 non-removable; 87 non-removable;
38 status = "okay"; 88 status = "okay";
39}; 89};
diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi
index f024ef28b34b..addd3f881ce2 100644
--- a/arch/arm/boot/dts/imx6q.dtsi
+++ b/arch/arm/boot/dts/imx6q.dtsi
@@ -8,10 +8,15 @@
8 * 8 *
9 */ 9 */
10 10
11#include <dt-bindings/interrupt-controller/irq.h>
11#include "imx6q-pinfunc.h" 12#include "imx6q-pinfunc.h"
12#include "imx6qdl.dtsi" 13#include "imx6qdl.dtsi"
13 14
14/ { 15/ {
16 aliases {
17 spi4 = &ecspi5;
18 };
19
15 cpus { 20 cpus {
16 #address-cells = <1>; 21 #address-cells = <1>;
17 #size-cells = <0>; 22 #size-cells = <0>;
@@ -25,8 +30,17 @@
25 /* kHz uV */ 30 /* kHz uV */
26 1200000 1275000 31 1200000 1275000
27 996000 1250000 32 996000 1250000
33 852000 1250000
28 792000 1150000 34 792000 1150000
29 396000 950000 35 396000 975000
36 >;
37 fsl,soc-operating-points = <
38 /* ARM kHz SOC-PU uV */
39 1200000 1275000
40 996000 1250000
41 852000 1250000
42 792000 1175000
43 396000 1175000
30 >; 44 >;
31 clock-latency = <61036>; /* two CLK32 periods */ 45 clock-latency = <61036>; /* two CLK32 periods */
32 clocks = <&clks 104>, <&clks 6>, <&clks 16>, 46 clocks = <&clks 104>, <&clks 6>, <&clks 16>,
@@ -74,7 +88,7 @@
74 #size-cells = <0>; 88 #size-cells = <0>;
75 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi"; 89 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
76 reg = <0x02018000 0x4000>; 90 reg = <0x02018000 0x4000>;
77 interrupts = <0 35 0x04>; 91 interrupts = <0 35 IRQ_TYPE_LEVEL_HIGH>;
78 clocks = <&clks 116>, <&clks 116>; 92 clocks = <&clks 116>, <&clks 116>;
79 clock-names = "ipg", "per"; 93 clock-names = "ipg", "per";
80 status = "disabled"; 94 status = "disabled";
@@ -125,20 +139,92 @@
125 sata: sata@02200000 { 139 sata: sata@02200000 {
126 compatible = "fsl,imx6q-ahci"; 140 compatible = "fsl,imx6q-ahci";
127 reg = <0x02200000 0x4000>; 141 reg = <0x02200000 0x4000>;
128 interrupts = <0 39 0x04>; 142 interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>;
129 clocks = <&clks 154>, <&clks 187>, <&clks 105>; 143 clocks = <&clks 154>, <&clks 187>, <&clks 105>;
130 clock-names = "sata", "sata_ref", "ahb"; 144 clock-names = "sata", "sata_ref", "ahb";
131 status = "disabled"; 145 status = "disabled";
132 }; 146 };
133 147
134 ipu2: ipu@02800000 { 148 ipu2: ipu@02800000 {
135 #crtc-cells = <1>; 149 #address-cells = <1>;
150 #size-cells = <0>;
136 compatible = "fsl,imx6q-ipu"; 151 compatible = "fsl,imx6q-ipu";
137 reg = <0x02800000 0x400000>; 152 reg = <0x02800000 0x400000>;
138 interrupts = <0 8 0x4 0 7 0x4>; 153 interrupts = <0 8 IRQ_TYPE_LEVEL_HIGH>,
154 <0 7 IRQ_TYPE_LEVEL_HIGH>;
139 clocks = <&clks 133>, <&clks 134>, <&clks 137>; 155 clocks = <&clks 133>, <&clks 134>, <&clks 137>;
140 clock-names = "bus", "di0", "di1"; 156 clock-names = "bus", "di0", "di1";
141 resets = <&src 4>; 157 resets = <&src 4>;
158
159 ipu2_di0: port@2 {
160 #address-cells = <1>;
161 #size-cells = <0>;
162 reg = <2>;
163
164 ipu2_di0_disp0: endpoint@0 {
165 };
166
167 ipu2_di0_hdmi: endpoint@1 {
168 remote-endpoint = <&hdmi_mux_2>;
169 };
170
171 ipu2_di0_mipi: endpoint@2 {
172 };
173
174 ipu2_di0_lvds0: endpoint@3 {
175 remote-endpoint = <&lvds0_mux_2>;
176 };
177
178 ipu2_di0_lvds1: endpoint@4 {
179 remote-endpoint = <&lvds1_mux_2>;
180 };
181 };
182
183 ipu2_di1: port@3 {
184 #address-cells = <1>;
185 #size-cells = <0>;
186 reg = <3>;
187
188 ipu2_di1_hdmi: endpoint@1 {
189 remote-endpoint = <&hdmi_mux_3>;
190 };
191
192 ipu2_di1_mipi: endpoint@2 {
193 };
194
195 ipu2_di1_lvds0: endpoint@3 {
196 remote-endpoint = <&lvds0_mux_3>;
197 };
198
199 ipu2_di1_lvds1: endpoint@4 {
200 remote-endpoint = <&lvds1_mux_3>;
201 };
202 };
203 };
204 };
205
206 display-subsystem {
207 compatible = "fsl,imx-display-subsystem";
208 ports = <&ipu1_di0>, <&ipu1_di1>, <&ipu2_di0>, <&ipu2_di1>;
209 };
210};
211
212&hdmi {
213 compatible = "fsl,imx6q-hdmi";
214
215 port@2 {
216 reg = <2>;
217
218 hdmi_mux_2: endpoint {
219 remote-endpoint = <&ipu2_di0_hdmi>;
220 };
221 };
222
223 port@3 {
224 reg = <3>;
225
226 hdmi_mux_3: endpoint {
227 remote-endpoint = <&ipu2_di1_hdmi>;
142 }; 228 };
143 }; 229 };
144}; 230};
@@ -152,10 +238,56 @@
152 "di0", "di1"; 238 "di0", "di1";
153 239
154 lvds-channel@0 { 240 lvds-channel@0 {
155 crtcs = <&ipu1 0>, <&ipu1 1>, <&ipu2 0>, <&ipu2 1>; 241 port@2 {
242 reg = <2>;
243
244 lvds0_mux_2: endpoint {
245 remote-endpoint = <&ipu2_di0_lvds0>;
246 };
247 };
248
249 port@3 {
250 reg = <3>;
251
252 lvds0_mux_3: endpoint {
253 remote-endpoint = <&ipu2_di1_lvds0>;
254 };
255 };
156 }; 256 };
157 257
158 lvds-channel@1 { 258 lvds-channel@1 {
159 crtcs = <&ipu1 0>, <&ipu1 1>, <&ipu2 0>, <&ipu2 1>; 259 port@2 {
260 reg = <2>;
261
262 lvds1_mux_2: endpoint {
263 remote-endpoint = <&ipu2_di0_lvds1>;
264 };
265 };
266
267 port@3 {
268 reg = <3>;
269
270 lvds1_mux_3: endpoint {
271 remote-endpoint = <&ipu2_di1_lvds1>;
272 };
273 };
274 };
275};
276
277&mipi_dsi {
278 port@2 {
279 reg = <2>;
280
281 mipi_mux_2: endpoint {
282 remote-endpoint = <&ipu2_di0_mipi>;
283 };
284 };
285
286 port@3 {
287 reg = <3>;
288
289 mipi_mux_3: endpoint {
290 remote-endpoint = <&ipu2_di1_mipi>;
291 };
160 }; 292 };
161}; 293};
diff --git a/arch/arm/boot/dts/imx6qdl-dfi-fs700-m60.dtsi b/arch/arm/boot/dts/imx6qdl-dfi-fs700-m60.dtsi
new file mode 100644
index 000000000000..25cf035dd36e
--- /dev/null
+++ b/arch/arm/boot/dts/imx6qdl-dfi-fs700-m60.dtsi
@@ -0,0 +1,199 @@
1/ {
2 regulators {
3 compatible = "simple-bus";
4 #address-cells = <1>;
5 #size-cells = <0>;
6
7 dummy_reg: regulator@0 {
8 compatible = "regulator-fixed";
9 reg = <0>;
10 regulator-name = "dummy-supply";
11 };
12
13 reg_usb_otg_vbus: regulator@1 {
14 compatible = "regulator-fixed";
15 reg = <1>;
16 regulator-name = "usb_otg_vbus";
17 regulator-min-microvolt = <5000000>;
18 regulator-max-microvolt = <5000000>;
19 gpio = <&gpio3 22 0>;
20 enable-active-high;
21 };
22 };
23
24 chosen {
25 linux,stdout-path = &uart1;
26 };
27};
28
29&ecspi3 {
30 fsl,spi-num-chipselects = <1>;
31 cs-gpios = <&gpio4 24 0>;
32 pinctrl-names = "default";
33 pinctrl-0 = <&pinctrl_ecspi3>;
34 status = "okay";
35
36 flash: m25p80@0 {
37 #address-cells = <1>;
38 #size-cells = <1>;
39 compatible = "sst,sst25vf040b", "m25p80";
40 spi-max-frequency = <20000000>;
41 reg = <0>;
42 };
43};
44
45&fec {
46 pinctrl-names = "default";
47 pinctrl-0 = <&pinctrl_enet>;
48 status = "okay";
49 phy-mode = "rgmii";
50};
51
52&iomuxc {
53 pinctrl-names = "default";
54 pinctrl-0 = <&pinctrl_hog>;
55
56 imx6qdl-dfi-fs700-m60 {
57 pinctrl_hog: hoggrp {
58 fsl,pins = <
59 MX6QDL_PAD_ENET_CRS_DV__GPIO1_IO25 0x80000000
60 MX6QDL_PAD_GPIO_18__GPIO7_IO13 0x80000000 /* PMIC irq */
61 MX6QDL_PAD_EIM_D26__GPIO3_IO26 0x80000000 /* MAX11801 irq */
62 MX6QDL_PAD_NANDF_D5__GPIO2_IO05 0x000030b0 /* Backlight enable */
63 >;
64 };
65
66 pinctrl_enet: enetgrp {
67 fsl,pins = <
68 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
69 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
70 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
71 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
72 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
73 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
74 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
75 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
76 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
77 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
78 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
79 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
80 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
81 MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
82 MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
83 MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0a8
84 >;
85 };
86
87 pinctrl_i2c2: i2c2grp {
88 fsl,pins = <
89 MX6QDL_PAD_EIM_EB2__I2C2_SCL 0x4001b8b1
90 MX6QDL_PAD_EIM_D16__I2C2_SDA 0x4001b8b1
91 >;
92 };
93
94 pinctrl_uart1: uart1grp {
95 fsl,pins = <
96 MX6QDL_PAD_CSI0_DAT10__UART1_TX_DATA 0x1b0b1
97 MX6QDL_PAD_CSI0_DAT11__UART1_RX_DATA 0x1b0b1
98 >;
99 };
100
101 pinctrl_usbotg: usbotggrp {
102 fsl,pins = <
103 MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID 0x17059
104 >;
105 };
106
107 pinctrl_usdhc2: usdhc2grp {
108 fsl,pins = <
109 MX6QDL_PAD_SD2_CMD__SD2_CMD 0x17059
110 MX6QDL_PAD_SD2_CLK__SD2_CLK 0x10059
111 MX6QDL_PAD_SD2_DAT0__SD2_DATA0 0x17059
112 MX6QDL_PAD_SD2_DAT1__SD2_DATA1 0x17059
113 MX6QDL_PAD_SD2_DAT2__SD2_DATA2 0x17059
114 MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x17059
115 MX6QDL_PAD_NANDF_D2__GPIO2_IO02 0x80000000 /* card detect */
116 >;
117 };
118
119 pinctrl_usdhc3: usdhc3grp {
120 fsl,pins = <
121 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059
122 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059
123 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059
124 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
125 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
126 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
127 >;
128 };
129
130 pinctrl_usdhc4: usdhc4grp {
131 fsl,pins = <
132 MX6QDL_PAD_SD4_CMD__SD4_CMD 0x17059
133 MX6QDL_PAD_SD4_CLK__SD4_CLK 0x10059
134 MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17059
135 MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17059
136 MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17059
137 MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17059
138 MX6QDL_PAD_SD4_DAT4__SD4_DATA4 0x17059
139 MX6QDL_PAD_SD4_DAT5__SD4_DATA5 0x17059
140 MX6QDL_PAD_SD4_DAT6__SD4_DATA6 0x17059
141 MX6QDL_PAD_SD4_DAT7__SD4_DATA7 0x17059
142 >;
143 };
144
145 pinctrl_ecspi3: ecspi3grp {
146 fsl,pins = <
147 MX6QDL_PAD_DISP0_DAT2__ECSPI3_MISO 0x100b1
148 MX6QDL_PAD_DISP0_DAT1__ECSPI3_MOSI 0x100b1
149 MX6QDL_PAD_DISP0_DAT0__ECSPI3_SCLK 0x100b1
150 MX6QDL_PAD_DISP0_DAT3__GPIO4_IO24 0x80000000 /* SPI NOR chipselect */
151 >;
152 };
153 };
154};
155
156&i2c2 {
157 pinctrl-names = "default";
158 pinctrl-0 = <&pinctrl_i2c2>;
159 status = "okay";
160};
161
162&uart1 {
163 pinctrl-names = "default";
164 pinctrl-0 = <&pinctrl_uart1>;
165 status = "okay";
166};
167
168&usbh1 {
169 status = "okay";
170};
171
172&usbotg {
173 vbus-supply = <&reg_usb_otg_vbus>;
174 pinctrl-names = "default";
175 pinctrl-0 = <&pinctrl_usbotg>;
176 disable-over-current;
177 dr_mode = "host";
178 status = "okay";
179};
180
181&usdhc2 { /* module slot */
182 pinctrl-names = "default";
183 pinctrl-0 = <&pinctrl_usdhc2>;
184 cd-gpios = <&gpio2 2 0>;
185 status = "okay";
186};
187
188&usdhc3 { /* baseboard slot */
189 pinctrl-names = "default";
190 pinctrl-0 = <&pinctrl_usdhc3>;
191};
192
193&usdhc4 { /* eMMC */
194 pinctrl-names = "default";
195 pinctrl-0 = <&pinctrl_usdhc4>;
196 bus-width = <8>;
197 non-removable;
198 status = "okay";
199};
diff --git a/arch/arm/boot/dts/imx6qdl-gw51xx.dtsi b/arch/arm/boot/dts/imx6qdl-gw51xx.dtsi
new file mode 100644
index 000000000000..98a422153ce7
--- /dev/null
+++ b/arch/arm/boot/dts/imx6qdl-gw51xx.dtsi
@@ -0,0 +1,374 @@
1/*
2 * Copyright 2013 Gateworks Corporation
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/ {
13 /* these are used by bootloader for disabling nodes */
14 aliases {
15 can0 = &can1;
16 ethernet0 = &fec;
17 led0 = &led0;
18 led1 = &led1;
19 nand = &gpmi;
20 usb0 = &usbh1;
21 usb1 = &usbotg;
22 };
23
24 chosen {
25 bootargs = "console=ttymxc1,115200";
26 };
27
28 leds {
29 compatible = "gpio-leds";
30
31 led0: user1 {
32 label = "user1";
33 gpios = <&gpio4 6 0>; /* 102 -> MX6_PANLEDG */
34 default-state = "on";
35 linux,default-trigger = "heartbeat";
36 };
37
38 led1: user2 {
39 label = "user2";
40 gpios = <&gpio4 7 0>; /* 103 -> MX6_PANLEDR */
41 default-state = "off";
42 };
43 };
44
45 memory {
46 reg = <0x10000000 0x20000000>;
47 };
48
49 pps {
50 compatible = "pps-gpio";
51 gpios = <&gpio1 26 0>;
52 status = "okay";
53 };
54
55 regulators {
56 compatible = "simple-bus";
57 #address-cells = <1>;
58 #size-cells = <0>;
59
60 reg_3p3v: regulator@0 {
61 compatible = "regulator-fixed";
62 reg = <0>;
63 regulator-name = "3P3V";
64 regulator-min-microvolt = <3300000>;
65 regulator-max-microvolt = <3300000>;
66 regulator-always-on;
67 };
68
69 reg_5p0v: regulator@1 {
70 compatible = "regulator-fixed";
71 reg = <1>;
72 regulator-name = "5P0V";
73 regulator-min-microvolt = <5000000>;
74 regulator-max-microvolt = <5000000>;
75 regulator-always-on;
76 };
77
78 reg_usb_otg_vbus: regulator@2 {
79 compatible = "regulator-fixed";
80 reg = <2>;
81 regulator-name = "usb_otg_vbus";
82 regulator-min-microvolt = <5000000>;
83 regulator-max-microvolt = <5000000>;
84 gpio = <&gpio3 22 0>;
85 enable-active-high;
86 };
87 };
88};
89
90&fec {
91 pinctrl-names = "default";
92 pinctrl-0 = <&pinctrl_enet>;
93 phy-mode = "rgmii";
94 phy-reset-gpios = <&gpio1 30 0>;
95 status = "okay";
96};
97
98&gpmi {
99 pinctrl-names = "default";
100 pinctrl-0 = <&pinctrl_gpmi_nand>;
101 status = "okay";
102};
103
104&i2c1 {
105 clock-frequency = <100000>;
106 pinctrl-names = "default";
107 pinctrl-0 = <&pinctrl_i2c1>;
108 status = "okay";
109
110 eeprom1: eeprom@50 {
111 compatible = "atmel,24c02";
112 reg = <0x50>;
113 pagesize = <16>;
114 };
115
116 eeprom2: eeprom@51 {
117 compatible = "atmel,24c02";
118 reg = <0x51>;
119 pagesize = <16>;
120 };
121
122 eeprom3: eeprom@52 {
123 compatible = "atmel,24c02";
124 reg = <0x52>;
125 pagesize = <16>;
126 };
127
128 eeprom4: eeprom@53 {
129 compatible = "atmel,24c02";
130 reg = <0x53>;
131 pagesize = <16>;
132 };
133
134 gpio: pca9555@23 {
135 compatible = "nxp,pca9555";
136 reg = <0x23>;
137 gpio-controller;
138 #gpio-cells = <2>;
139 };
140
141 hwmon: gsc@29 {
142 compatible = "gw,gsp";
143 reg = <0x29>;
144 };
145
146 rtc: ds1672@68 {
147 compatible = "dallas,ds1672";
148 reg = <0x68>;
149 };
150};
151
152&i2c2 {
153 clock-frequency = <100000>;
154 pinctrl-names = "default";
155 pinctrl-0 = <&pinctrl_i2c2>;
156 status = "okay";
157
158 pmic: ltc3676@3c {
159 compatible = "ltc,ltc3676";
160 reg = <0x3c>;
161
162 regulators {
163 sw1_reg: ltc3676__sw1 {
164 regulator-min-microvolt = <1175000>;
165 regulator-max-microvolt = <1175000>;
166 regulator-boot-on;
167 regulator-always-on;
168 };
169
170 sw2_reg: ltc3676__sw2 {
171 regulator-min-microvolt = <1800000>;
172 regulator-max-microvolt = <1800000>;
173 regulator-boot-on;
174 regulator-always-on;
175 };
176
177 sw3_reg: ltc3676__sw3 {
178 regulator-min-microvolt = <1175000>;
179 regulator-max-microvolt = <1175000>;
180 regulator-boot-on;
181 regulator-always-on;
182 };
183
184 sw4_reg: ltc3676__sw4 {
185 regulator-min-microvolt = <1500000>;
186 regulator-max-microvolt = <1500000>;
187 regulator-boot-on;
188 regulator-always-on;
189 };
190
191 ldo2_reg: ltc3676__ldo2 {
192 regulator-min-microvolt = <2500000>;
193 regulator-max-microvolt = <2500000>;
194 regulator-boot-on;
195 regulator-always-on;
196 };
197
198 ldo4_reg: ltc3676__ldo4 {
199 regulator-min-microvolt = <3000000>;
200 regulator-max-microvolt = <3000000>;
201 };
202 };
203 };
204};
205
206&i2c3 {
207 clock-frequency = <100000>;
208 pinctrl-names = "default";
209 pinctrl-0 = <&pinctrl_i2c3>;
210 status = "okay";
211
212 videoin: adv7180@20 {
213 compatible = "adi,adv7180";
214 reg = <0x20>;
215 };
216};
217
218&iomuxc {
219 pinctrl-names = "default";
220 pinctrl-0 = <&pinctrl_hog>;
221
222 imx6qdl-gw51xx {
223 pinctrl_hog: hoggrp {
224 fsl,pins = <
225 MX6QDL_PAD_EIM_A19__GPIO2_IO19 0x80000000 /* MEZZ_DIO0 */
226 MX6QDL_PAD_EIM_A20__GPIO2_IO18 0x80000000 /* MEZZ_DIO1 */
227 MX6QDL_PAD_EIM_D22__GPIO3_IO22 0x80000000 /* OTG_PWR_EN */
228 MX6QDL_PAD_ENET_RXD1__GPIO1_IO26 0x80000000 /* GPS_PPS */
229 MX6QDL_PAD_ENET_TXD0__GPIO1_IO30 0x80000000 /* PHY Reset */
230 MX6QDL_PAD_GPIO_0__GPIO1_IO00 0x80000000 /* PCIE_RST# */
231 MX6QDL_PAD_KEY_COL0__GPIO4_IO06 0x80000000 /* user1 led */
232 MX6QDL_PAD_KEY_ROW0__GPIO4_IO07 0x80000000 /* user2 led */
233 >;
234 };
235
236 pinctrl_enet: enetgrp {
237 fsl,pins = <
238 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
239 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
240 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
241 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
242 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
243 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
244 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
245 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
246 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
247 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
248 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
249 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
250 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
251 MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
252 MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
253 MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0a8
254 >;
255 };
256
257 pinctrl_gpmi_nand: gpminandgrp {
258 fsl,pins = <
259 MX6QDL_PAD_NANDF_CLE__NAND_CLE 0xb0b1
260 MX6QDL_PAD_NANDF_ALE__NAND_ALE 0xb0b1
261 MX6QDL_PAD_NANDF_WP_B__NAND_WP_B 0xb0b1
262 MX6QDL_PAD_NANDF_RB0__NAND_READY_B 0xb000
263 MX6QDL_PAD_NANDF_CS0__NAND_CE0_B 0xb0b1
264 MX6QDL_PAD_NANDF_CS1__NAND_CE1_B 0xb0b1
265 MX6QDL_PAD_SD4_CMD__NAND_RE_B 0xb0b1
266 MX6QDL_PAD_SD4_CLK__NAND_WE_B 0xb0b1
267 MX6QDL_PAD_NANDF_D0__NAND_DATA00 0xb0b1
268 MX6QDL_PAD_NANDF_D1__NAND_DATA01 0xb0b1
269 MX6QDL_PAD_NANDF_D2__NAND_DATA02 0xb0b1
270 MX6QDL_PAD_NANDF_D3__NAND_DATA03 0xb0b1
271 MX6QDL_PAD_NANDF_D4__NAND_DATA04 0xb0b1
272 MX6QDL_PAD_NANDF_D5__NAND_DATA05 0xb0b1
273 MX6QDL_PAD_NANDF_D6__NAND_DATA06 0xb0b1
274 MX6QDL_PAD_NANDF_D7__NAND_DATA07 0xb0b1
275 >;
276 };
277
278 pinctrl_i2c1: i2c1grp {
279 fsl,pins = <
280 MX6QDL_PAD_EIM_D21__I2C1_SCL 0x4001b8b1
281 MX6QDL_PAD_EIM_D28__I2C1_SDA 0x4001b8b1
282 >;
283 };
284
285 pinctrl_i2c2: i2c2grp {
286 fsl,pins = <
287 MX6QDL_PAD_KEY_COL3__I2C2_SCL 0x4001b8b1
288 MX6QDL_PAD_KEY_ROW3__I2C2_SDA 0x4001b8b1
289 >;
290 };
291
292 pinctrl_i2c3: i2c3grp {
293 fsl,pins = <
294 MX6QDL_PAD_GPIO_3__I2C3_SCL 0x4001b8b1
295 MX6QDL_PAD_GPIO_6__I2C3_SDA 0x4001b8b1
296 >;
297 };
298
299 pinctrl_uart1: uart1grp {
300 fsl,pins = <
301 MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA 0x1b0b1
302 MX6QDL_PAD_SD3_DAT6__UART1_RX_DATA 0x1b0b1
303 >;
304 };
305
306 pinctrl_uart2: uart2grp {
307 fsl,pins = <
308 MX6QDL_PAD_SD4_DAT7__UART2_TX_DATA 0x1b0b1
309 MX6QDL_PAD_SD4_DAT4__UART2_RX_DATA 0x1b0b1
310 >;
311 };
312
313 pinctrl_uart3: uart3grp {
314 fsl,pins = <
315 MX6QDL_PAD_EIM_D24__UART3_TX_DATA 0x1b0b1
316 MX6QDL_PAD_EIM_D25__UART3_RX_DATA 0x1b0b1
317 >;
318 };
319
320 pinctrl_uart5: uart5grp {
321 fsl,pins = <
322 MX6QDL_PAD_KEY_COL1__UART5_TX_DATA 0x1b0b1
323 MX6QDL_PAD_KEY_ROW1__UART5_RX_DATA 0x1b0b1
324 >;
325 };
326
327 pinctrl_usbotg: usbotggrp {
328 fsl,pins = <
329 MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
330 >;
331 };
332 };
333};
334
335&pcie {
336 reset-gpio = <&gpio1 0 0>;
337 status = "okay";
338};
339
340&uart1 {
341 pinctrl-names = "default";
342 pinctrl-0 = <&pinctrl_uart1>;
343 status = "okay";
344};
345
346&uart2 {
347 pinctrl-names = "default";
348 pinctrl-0 = <&pinctrl_uart2>;
349 status = "okay";
350};
351
352&uart3 {
353 pinctrl-names = "default";
354 pinctrl-0 = <&pinctrl_uart3>;
355 status = "okay";
356};
357
358&uart5 {
359 pinctrl-names = "default";
360 pinctrl-0 = <&pinctrl_uart5>;
361 status = "okay";
362};
363
364&usbotg {
365 vbus-supply = <&reg_usb_otg_vbus>;
366 pinctrl-names = "default";
367 pinctrl-0 = <&pinctrl_usbotg>;
368 disable-over-current;
369 status = "okay";
370};
371
372&usbh1 {
373 status = "okay";
374};
diff --git a/arch/arm/boot/dts/imx6qdl-gw52xx.dtsi b/arch/arm/boot/dts/imx6qdl-gw52xx.dtsi
new file mode 100644
index 000000000000..8e99c9a9bc76
--- /dev/null
+++ b/arch/arm/boot/dts/imx6qdl-gw52xx.dtsi
@@ -0,0 +1,490 @@
1/*
2 * Copyright 2013 Gateworks Corporation
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/ {
13 /* these are used by bootloader for disabling nodes */
14 aliases {
15 ethernet0 = &fec;
16 led0 = &led0;
17 led1 = &led1;
18 led2 = &led2;
19 nand = &gpmi;
20 ssi0 = &ssi1;
21 usb0 = &usbh1;
22 usb1 = &usbotg;
23 usdhc2 = &usdhc3;
24 };
25
26 chosen {
27 bootargs = "console=ttymxc1,115200";
28 };
29
30 leds {
31 compatible = "gpio-leds";
32
33 led0: user1 {
34 label = "user1";
35 gpios = <&gpio4 6 0>; /* 102 -> MX6_PANLEDG */
36 default-state = "on";
37 linux,default-trigger = "heartbeat";
38 };
39
40 led1: user2 {
41 label = "user2";
42 gpios = <&gpio4 7 0>; /* 103 -> MX6_PANLEDR */
43 default-state = "off";
44 };
45
46 led2: user3 {
47 label = "user3";
48 gpios = <&gpio4 15 1>; /* 111 - MX6_LOCLED# */
49 default-state = "off";
50 };
51 };
52
53 memory {
54 reg = <0x10000000 0x20000000>;
55 };
56
57 pps {
58 compatible = "pps-gpio";
59 gpios = <&gpio1 26 0>;
60 status = "okay";
61 };
62
63 regulators {
64 compatible = "simple-bus";
65 #address-cells = <1>;
66 #size-cells = <0>;
67
68 reg_1p0v: regulator@0 {
69 compatible = "regulator-fixed";
70 reg = <0>;
71 regulator-name = "1P0V";
72 regulator-min-microvolt = <1000000>;
73 regulator-max-microvolt = <1000000>;
74 regulator-always-on;
75 };
76
77 /* remove this fixed regulator once ltc3676__sw2 driver available */
78 reg_1p8v: regulator@1 {
79 compatible = "regulator-fixed";
80 reg = <1>;
81 regulator-name = "1P8V";
82 regulator-min-microvolt = <1800000>;
83 regulator-max-microvolt = <1800000>;
84 regulator-always-on;
85 };
86
87 reg_3p3v: regulator@2 {
88 compatible = "regulator-fixed";
89 reg = <2>;
90 regulator-name = "3P3V";
91 regulator-min-microvolt = <3300000>;
92 regulator-max-microvolt = <3300000>;
93 regulator-always-on;
94 };
95
96 reg_5p0v: regulator@3 {
97 compatible = "regulator-fixed";
98 reg = <3>;
99 regulator-name = "5P0V";
100 regulator-min-microvolt = <5000000>;
101 regulator-max-microvolt = <5000000>;
102 regulator-always-on;
103 };
104
105 reg_usb_otg_vbus: regulator@4 {
106 compatible = "regulator-fixed";
107 reg = <4>;
108 regulator-name = "usb_otg_vbus";
109 regulator-min-microvolt = <5000000>;
110 regulator-max-microvolt = <5000000>;
111 gpio = <&gpio3 22 0>;
112 enable-active-high;
113 };
114 };
115
116 sound {
117 compatible = "fsl,imx6q-sabrelite-sgtl5000",
118 "fsl,imx-audio-sgtl5000";
119 model = "imx6q-sabrelite-sgtl5000";
120 ssi-controller = <&ssi1>;
121 audio-codec = <&codec>;
122 audio-routing =
123 "MIC_IN", "Mic Jack",
124 "Mic Jack", "Mic Bias",
125 "Headphone Jack", "HP_OUT";
126 mux-int-port = <1>;
127 mux-ext-port = <4>;
128 };
129};
130
131&audmux {
132 pinctrl-names = "default";
133 pinctrl-0 = <&pinctrl_audmux>;
134 status = "okay";
135};
136
137&fec {
138 pinctrl-names = "default";
139 pinctrl-0 = <&pinctrl_enet>;
140 phy-mode = "rgmii";
141 phy-reset-gpios = <&gpio1 30 0>;
142 status = "okay";
143};
144
145&gpmi {
146 pinctrl-names = "default";
147 pinctrl-0 = <&pinctrl_gpmi_nand>;
148 status = "okay";
149};
150
151&i2c1 {
152 clock-frequency = <100000>;
153 pinctrl-names = "default";
154 pinctrl-0 = <&pinctrl_i2c1>;
155 status = "okay";
156
157 eeprom1: eeprom@50 {
158 compatible = "atmel,24c02";
159 reg = <0x50>;
160 pagesize = <16>;
161 };
162
163 eeprom2: eeprom@51 {
164 compatible = "atmel,24c02";
165 reg = <0x51>;
166 pagesize = <16>;
167 };
168
169 eeprom3: eeprom@52 {
170 compatible = "atmel,24c02";
171 reg = <0x52>;
172 pagesize = <16>;
173 };
174
175 eeprom4: eeprom@53 {
176 compatible = "atmel,24c02";
177 reg = <0x53>;
178 pagesize = <16>;
179 };
180
181 gpio: pca9555@23 {
182 compatible = "nxp,pca9555";
183 reg = <0x23>;
184 gpio-controller;
185 #gpio-cells = <2>;
186 };
187
188 hwmon: gsc@29 {
189 compatible = "gw,gsp";
190 reg = <0x29>;
191 };
192
193 rtc: ds1672@68 {
194 compatible = "dallas,ds1672";
195 reg = <0x68>;
196 };
197};
198
199&i2c2 {
200 clock-frequency = <100000>;
201 pinctrl-names = "default";
202 pinctrl-0 = <&pinctrl_i2c2>;
203 status = "okay";
204
205 pciswitch: pex8609@3f {
206 compatible = "plx,pex8609";
207 reg = <0x3f>;
208 };
209
210 pmic: ltc3676@3c {
211 compatible = "ltc,ltc3676";
212 reg = <0x3c>;
213
214 regulators {
215 sw1_reg: ltc3676__sw1 {
216 regulator-min-microvolt = <1175000>;
217 regulator-max-microvolt = <1175000>;
218 regulator-boot-on;
219 regulator-always-on;
220 };
221
222 sw2_reg: ltc3676__sw2 {
223 regulator-min-microvolt = <1800000>;
224 regulator-max-microvolt = <1800000>;
225 regulator-boot-on;
226 regulator-always-on;
227 };
228
229 sw3_reg: ltc3676__sw3 {
230 regulator-min-microvolt = <1175000>;
231 regulator-max-microvolt = <1175000>;
232 regulator-boot-on;
233 regulator-always-on;
234 };
235
236 sw4_reg: ltc3676__sw4 {
237 regulator-min-microvolt = <1500000>;
238 regulator-max-microvolt = <1500000>;
239 regulator-boot-on;
240 regulator-always-on;
241 };
242
243 ldo2_reg: ltc3676__ldo2 {
244 regulator-min-microvolt = <2500000>;
245 regulator-max-microvolt = <2500000>;
246 regulator-boot-on;
247 regulator-always-on;
248 };
249
250 ldo3_reg: ltc3676__ldo3 {
251 regulator-min-microvolt = <1800000>;
252 regulator-max-microvolt = <1800000>;
253 regulator-boot-on;
254 regulator-always-on;
255 };
256
257 ldo4_reg: ltc3676__ldo4 {
258 regulator-min-microvolt = <3000000>;
259 regulator-max-microvolt = <3000000>;
260 };
261 };
262 };
263};
264
265&i2c3 {
266 clock-frequency = <100000>;
267 pinctrl-names = "default";
268 pinctrl-0 = <&pinctrl_i2c3>;
269 status = "okay";
270
271 accelerometer: fxos8700@1e {
272 compatible = "fsl,fxos8700";
273 reg = <0x13>;
274 };
275
276 codec: sgtl5000@0a {
277 compatible = "fsl,sgtl5000";
278 reg = <0x0a>;
279 clocks = <&clks 169>;
280 VDDA-supply = <&reg_1p8v>;
281 VDDIO-supply = <&reg_3p3v>;
282 };
283
284 touchscreen: egalax_ts@04 {
285 compatible = "eeti,egalax_ts";
286 reg = <0x04>;
287 interrupt-parent = <&gpio7>;
288 interrupts = <12 2>; /* gpio7_12 active low */
289 wakeup-gpios = <&gpio7 12 0>;
290 };
291
292 videoin: adv7180@20 {
293 compatible = "adi,adv7180";
294 reg = <0x20>;
295 };
296};
297
298&iomuxc {
299 pinctrl-names = "default";
300 pinctrl-0 = <&pinctrl_hog>;
301
302 imx6qdl-gw52xx {
303 pinctrl_hog: hoggrp {
304 fsl,pins = <
305 MX6QDL_PAD_EIM_A19__GPIO2_IO19 0x80000000 /* MEZZ_DIO0 */
306 MX6QDL_PAD_EIM_A20__GPIO2_IO18 0x80000000 /* MEZZ_DIO1 */
307 MX6QDL_PAD_EIM_D22__GPIO3_IO22 0x80000000 /* OTG_PWR_EN */
308 MX6QDL_PAD_EIM_D31__GPIO3_IO31 0x80000000 /* VIDDEC_PDN# */
309 MX6QDL_PAD_ENET_TXD0__GPIO1_IO30 0x80000000 /* PHY Reset */
310 MX6QDL_PAD_ENET_TXD1__GPIO1_IO29 0x80000000 /* PCIE_RST# */
311 MX6QDL_PAD_ENET_RXD0__GPIO1_IO27 0x80000000 /* GPS_PWDN */
312 MX6QDL_PAD_ENET_RXD1__GPIO1_IO26 0x80000000 /* GPS_PPS */
313 MX6QDL_PAD_GPIO_0__CCM_CLKO1 0x000130b0 /* AUD4_MCK */
314 MX6QDL_PAD_GPIO_2__GPIO1_IO02 0x80000000 /* USB_SEL_PCI */
315 MX6QDL_PAD_GPIO_17__GPIO7_IO12 0x80000000 /* TOUCH_IRQ# */
316 MX6QDL_PAD_KEY_COL0__GPIO4_IO06 0x80000000 /* user1 led */
317 MX6QDL_PAD_KEY_ROW0__GPIO4_IO07 0x80000000 /* user2 led */
318 MX6QDL_PAD_KEY_ROW4__GPIO4_IO15 0x80000000 /* user3 led */
319 MX6QDL_PAD_SD2_CMD__GPIO1_IO11 0x80000000 /* LVDS_TCH# */
320 MX6QDL_PAD_SD3_DAT5__GPIO7_IO00 0x80000000 /* SD3_CD# */
321 MX6QDL_PAD_SD4_DAT3__GPIO2_IO11 0x80000000 /* UART2_EN# */
322 >;
323 };
324
325 pinctrl_audmux: audmuxgrp {
326 fsl,pins = <
327 MX6QDL_PAD_SD2_DAT0__AUD4_RXD 0x130b0
328 MX6QDL_PAD_SD2_DAT3__AUD4_TXC 0x130b0
329 MX6QDL_PAD_SD2_DAT2__AUD4_TXD 0x110b0
330 MX6QDL_PAD_SD2_DAT1__AUD4_TXFS 0x130b0
331 >;
332 };
333
334 pinctrl_enet: enetgrp {
335 fsl,pins = <
336 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
337 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
338 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
339 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
340 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
341 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
342 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
343 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
344 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
345 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
346 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
347 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
348 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
349 MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
350 MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
351 MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0a8
352 >;
353 };
354
355 pinctrl_gpmi_nand: gpminandgrp {
356 fsl,pins = <
357 MX6QDL_PAD_NANDF_CLE__NAND_CLE 0xb0b1
358 MX6QDL_PAD_NANDF_ALE__NAND_ALE 0xb0b1
359 MX6QDL_PAD_NANDF_WP_B__NAND_WP_B 0xb0b1
360 MX6QDL_PAD_NANDF_RB0__NAND_READY_B 0xb000
361 MX6QDL_PAD_NANDF_CS0__NAND_CE0_B 0xb0b1
362 MX6QDL_PAD_NANDF_CS1__NAND_CE1_B 0xb0b1
363 MX6QDL_PAD_SD4_CMD__NAND_RE_B 0xb0b1
364 MX6QDL_PAD_SD4_CLK__NAND_WE_B 0xb0b1
365 MX6QDL_PAD_NANDF_D0__NAND_DATA00 0xb0b1
366 MX6QDL_PAD_NANDF_D1__NAND_DATA01 0xb0b1
367 MX6QDL_PAD_NANDF_D2__NAND_DATA02 0xb0b1
368 MX6QDL_PAD_NANDF_D3__NAND_DATA03 0xb0b1
369 MX6QDL_PAD_NANDF_D4__NAND_DATA04 0xb0b1
370 MX6QDL_PAD_NANDF_D5__NAND_DATA05 0xb0b1
371 MX6QDL_PAD_NANDF_D6__NAND_DATA06 0xb0b1
372 MX6QDL_PAD_NANDF_D7__NAND_DATA07 0xb0b1
373 >;
374 };
375
376 pinctrl_i2c1: i2c1grp {
377 fsl,pins = <
378 MX6QDL_PAD_EIM_D21__I2C1_SCL 0x4001b8b1
379 MX6QDL_PAD_EIM_D28__I2C1_SDA 0x4001b8b1
380 >;
381 };
382
383 pinctrl_i2c2: i2c2grp {
384 fsl,pins = <
385 MX6QDL_PAD_KEY_COL3__I2C2_SCL 0x4001b8b1
386 MX6QDL_PAD_KEY_ROW3__I2C2_SDA 0x4001b8b1
387 >;
388 };
389
390 pinctrl_i2c3: i2c3grp {
391 fsl,pins = <
392 MX6QDL_PAD_GPIO_3__I2C3_SCL 0x4001b8b1
393 MX6QDL_PAD_GPIO_6__I2C3_SDA 0x4001b8b1
394 >;
395 };
396
397 pinctrl_uart1: uart1grp {
398 fsl,pins = <
399 MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA 0x1b0b1
400 MX6QDL_PAD_SD3_DAT6__UART1_RX_DATA 0x1b0b1
401 >;
402 };
403
404 pinctrl_uart2: uart2grp {
405 fsl,pins = <
406 MX6QDL_PAD_SD4_DAT7__UART2_TX_DATA 0x1b0b1
407 MX6QDL_PAD_SD4_DAT4__UART2_RX_DATA 0x1b0b1
408 >;
409 };
410
411 pinctrl_uart5: uart5grp {
412 fsl,pins = <
413 MX6QDL_PAD_KEY_COL1__UART5_TX_DATA 0x1b0b1
414 MX6QDL_PAD_KEY_ROW1__UART5_RX_DATA 0x1b0b1
415 >;
416 };
417
418 pinctrl_usbotg: usbotggrp {
419 fsl,pins = <
420 MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
421 >;
422 };
423
424 pinctrl_usdhc3: usdhc3grp {
425 fsl,pins = <
426 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059
427 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059
428 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059
429 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
430 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
431 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
432 >;
433 };
434 };
435};
436
437&ldb {
438 status = "okay";
439 lvds-channel@0 {
440 crtcs = <&ipu1 0>, <&ipu1 1>;
441 };
442};
443
444&pcie {
445 reset-gpio = <&gpio1 29 0>;
446 status = "okay";
447};
448
449&ssi1 {
450 fsl,mode = "i2s-slave";
451 status = "okay";
452};
453
454&uart1 {
455 pinctrl-names = "default";
456 pinctrl-0 = <&pinctrl_uart1>;
457 status = "okay";
458};
459
460&uart2 {
461 pinctrl-names = "default";
462 pinctrl-0 = <&pinctrl_uart2>;
463 status = "okay";
464};
465
466&uart5 {
467 pinctrl-names = "default";
468 pinctrl-0 = <&pinctrl_uart5>;
469 status = "okay";
470};
471
472&usbotg {
473 vbus-supply = <&reg_usb_otg_vbus>;
474 pinctrl-names = "default";
475 pinctrl-0 = <&pinctrl_usbotg>;
476 disable-over-current;
477 status = "okay";
478};
479
480&usbh1 {
481 status = "okay";
482};
483
484&usdhc3 {
485 pinctrl-names = "default";
486 pinctrl-0 = <&pinctrl_usdhc3>;
487 cd-gpios = <&gpio7 0 0>;
488 vmmc-supply = <&reg_3p3v>;
489 status = "okay";
490};
diff --git a/arch/arm/boot/dts/imx6qdl-gw53xx.dtsi b/arch/arm/boot/dts/imx6qdl-gw53xx.dtsi
new file mode 100644
index 000000000000..c8e5ae06deaf
--- /dev/null
+++ b/arch/arm/boot/dts/imx6qdl-gw53xx.dtsi
@@ -0,0 +1,553 @@
1/*
2 * Copyright 2013 Gateworks Corporation
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/ {
13 /* these are used by bootloader for disabling nodes */
14 aliases {
15 can0 = &can1;
16 ethernet0 = &fec;
17 ethernet1 = &eth1;
18 led0 = &led0;
19 led1 = &led1;
20 led2 = &led2;
21 nand = &gpmi;
22 sky2 = &eth1;
23 ssi0 = &ssi1;
24 usb0 = &usbh1;
25 usb1 = &usbotg;
26 usdhc2 = &usdhc3;
27 };
28
29 chosen {
30 bootargs = "console=ttymxc1,115200";
31 };
32
33 leds {
34 compatible = "gpio-leds";
35
36 led0: user1 {
37 label = "user1";
38 gpios = <&gpio4 6 0>; /* 102 -> MX6_PANLEDG */
39 default-state = "on";
40 linux,default-trigger = "heartbeat";
41 };
42
43 led1: user2 {
44 label = "user2";
45 gpios = <&gpio4 7 0>; /* 103 -> MX6_PANLEDR */
46 default-state = "off";
47 };
48
49 led2: user3 {
50 label = "user3";
51 gpios = <&gpio4 15 1>; /* 111 -> MX6_LOCLED# */
52 default-state = "off";
53 };
54 };
55
56 memory {
57 reg = <0x10000000 0x40000000>;
58 };
59
60 pps {
61 compatible = "pps-gpio";
62 gpios = <&gpio1 26 0>;
63 status = "okay";
64 };
65
66 regulators {
67 compatible = "simple-bus";
68 #address-cells = <1>;
69 #size-cells = <0>;
70
71 reg_1p0v: regulator@0 {
72 compatible = "regulator-fixed";
73 reg = <0>;
74 regulator-name = "1P0V";
75 regulator-min-microvolt = <1000000>;
76 regulator-max-microvolt = <1000000>;
77 regulator-always-on;
78 };
79
80 /* remove when pmic 1p8 regulator available */
81 reg_1p8v: regulator@1 {
82 compatible = "regulator-fixed";
83 reg = <1>;
84 regulator-name = "1P8V";
85 regulator-min-microvolt = <1800000>;
86 regulator-max-microvolt = <1800000>;
87 regulator-always-on;
88 };
89
90 reg_3p3v: regulator@2 {
91 compatible = "regulator-fixed";
92 reg = <2>;
93 regulator-name = "3P3V";
94 regulator-min-microvolt = <3300000>;
95 regulator-max-microvolt = <3300000>;
96 regulator-always-on;
97 };
98
99 reg_usb_h1_vbus: regulator@3 {
100 compatible = "regulator-fixed";
101 reg = <3>;
102 regulator-name = "usb_h1_vbus";
103 regulator-min-microvolt = <5000000>;
104 regulator-max-microvolt = <5000000>;
105 regulator-always-on;
106 };
107
108 reg_usb_otg_vbus: regulator@4 {
109 compatible = "regulator-fixed";
110 reg = <4>;
111 regulator-name = "usb_otg_vbus";
112 regulator-min-microvolt = <5000000>;
113 regulator-max-microvolt = <5000000>;
114 gpio = <&gpio3 22 0>;
115 enable-active-high;
116 };
117 };
118
119 sound {
120 compatible = "fsl,imx6q-sabrelite-sgtl5000",
121 "fsl,imx-audio-sgtl5000";
122 model = "imx6q-sabrelite-sgtl5000";
123 ssi-controller = <&ssi1>;
124 audio-codec = <&codec>;
125 audio-routing =
126 "MIC_IN", "Mic Jack",
127 "Mic Jack", "Mic Bias",
128 "Headphone Jack", "HP_OUT";
129 mux-int-port = <1>;
130 mux-ext-port = <4>;
131 };
132};
133
134&audmux {
135 pinctrl-names = "default";
136 pinctrl-0 = <&pinctrl_audmux>;
137 status = "okay";
138};
139
140&can1 {
141 pinctrl-names = "default";
142 pinctrl-0 = <&pinctrl_flexcan1>;
143 status = "okay";
144};
145
146&fec {
147 pinctrl-names = "default";
148 pinctrl-0 = <&pinctrl_enet>;
149 phy-mode = "rgmii";
150 phy-reset-gpios = <&gpio1 30 0>;
151 status = "okay";
152};
153
154&gpmi {
155 pinctrl-names = "default";
156 pinctrl-0 = <&pinctrl_gpmi_nand>;
157 status = "okay";
158};
159
160&i2c1 {
161 clock-frequency = <100000>;
162 pinctrl-names = "default";
163 pinctrl-0 = <&pinctrl_i2c1>;
164 status = "okay";
165
166 eeprom1: eeprom@50 {
167 compatible = "atmel,24c02";
168 reg = <0x50>;
169 pagesize = <16>;
170 };
171
172 eeprom2: eeprom@51 {
173 compatible = "atmel,24c02";
174 reg = <0x51>;
175 pagesize = <16>;
176 };
177
178 eeprom3: eeprom@52 {
179 compatible = "atmel,24c02";
180 reg = <0x52>;
181 pagesize = <16>;
182 };
183
184 eeprom4: eeprom@53 {
185 compatible = "atmel,24c02";
186 reg = <0x53>;
187 pagesize = <16>;
188 };
189
190 gpio: pca9555@23 {
191 compatible = "nxp,pca9555";
192 reg = <0x23>;
193 gpio-controller;
194 #gpio-cells = <2>;
195 };
196
197 hwmon: gsc@29 {
198 compatible = "gw,gsp";
199 reg = <0x29>;
200 };
201
202 rtc: ds1672@68 {
203 compatible = "dallas,ds1672";
204 reg = <0x68>;
205 };
206};
207
208&i2c2 {
209 clock-frequency = <100000>;
210 pinctrl-names = "default";
211 pinctrl-0 = <&pinctrl_i2c2>;
212 status = "okay";
213
214 pciclkgen: si53156@6b {
215 compatible = "sil,si53156";
216 reg = <0x6b>;
217 };
218
219 pciswitch: pex8606@3f {
220 compatible = "plx,pex8606";
221 reg = <0x3f>;
222 };
223
224 pmic: ltc3676@3c {
225 compatible = "ltc,ltc3676";
226 reg = <0x3c>;
227
228 regulators {
229 /* VDD_SOC */
230 sw1_reg: ltc3676__sw1 {
231 regulator-min-microvolt = <1175000>;
232 regulator-max-microvolt = <1175000>;
233 regulator-boot-on;
234 regulator-always-on;
235 };
236
237 /* VDD_1P8 */
238 sw2_reg: ltc3676__sw2 {
239 regulator-min-microvolt = <1800000>;
240 regulator-max-microvolt = <1800000>;
241 regulator-boot-on;
242 regulator-always-on;
243 };
244
245 /* VDD_ARM */
246 sw3_reg: ltc3676__sw3 {
247 regulator-min-microvolt = <1175000>;
248 regulator-max-microvolt = <1175000>;
249 regulator-boot-on;
250 regulator-always-on;
251 };
252
253 /* VDD_DDR */
254 sw4_reg: ltc3676__sw4 {
255 regulator-min-microvolt = <1500000>;
256 regulator-max-microvolt = <1500000>;
257 regulator-boot-on;
258 regulator-always-on;
259 };
260
261 /* VDD_2P5 */
262 ldo2_reg: ltc3676__ldo2 {
263 regulator-min-microvolt = <2500000>;
264 regulator-max-microvolt = <2500000>;
265 regulator-boot-on;
266 regulator-always-on;
267 };
268
269 /* VDD_1P8 */
270 ldo3_reg: ltc3676__ldo3 {
271 regulator-min-microvolt = <1800000>;
272 regulator-max-microvolt = <1800000>;
273 regulator-boot-on;
274 regulator-always-on;
275 };
276
277 /* VDD_HIGH */
278 ldo4_reg: ltc3676__ldo4 {
279 regulator-min-microvolt = <3000000>;
280 regulator-max-microvolt = <3000000>;
281 };
282 };
283 };
284};
285
286&i2c3 {
287 clock-frequency = <100000>;
288 pinctrl-names = "default";
289 pinctrl-0 = <&pinctrl_i2c3>;
290 status = "okay";
291
292 accelerometer: fxos8700@1e {
293 compatible = "fsl,fxos8700";
294 reg = <0x1e>;
295 };
296
297 codec: sgtl5000@0a {
298 compatible = "fsl,sgtl5000";
299 reg = <0x0a>;
300 clocks = <&clks 201>;
301 VDDA-supply = <&reg_1p8v>;
302 VDDIO-supply = <&reg_3p3v>;
303 };
304
305 hdmiin: adv7611@4c {
306 compatible = "adi,adv7611";
307 reg = <0x4c>;
308 };
309
310 touchscreen: egalax_ts@04 {
311 compatible = "eeti,egalax_ts";
312 reg = <0x04>;
313 interrupt-parent = <&gpio1>;
314 interrupts = <11 2>; /* gpio1_11 active low */
315 wakeup-gpios = <&gpio1 11 0>;
316 };
317
318 videoout: adv7393@2a {
319 compatible = "adi,adv7393";
320 reg = <0x2a>;
321 };
322
323 videoin: adv7180@20 {
324 compatible = "adi,adv7180";
325 reg = <0x20>;
326 };
327};
328
329&iomuxc {
330 pinctrl-names = "default";
331 pinctrl-0 = <&pinctrl_hog>;
332
333 imx6qdl-gw53xx {
334 pinctrl_hog: hoggrp {
335 fsl,pins = <
336 MX6QDL_PAD_EIM_A19__GPIO2_IO19 0x80000000 /* PCIE6EXP_DIO0 */
337 MX6QDL_PAD_EIM_A20__GPIO2_IO18 0x80000000 /* PCIE6EXP_DIO1 */
338 MX6QDL_PAD_EIM_D22__GPIO3_IO22 0x80000000 /* OTG_PWR_EN */
339 MX6QDL_PAD_ENET_RXD0__GPIO1_IO27 0x80000000 /* GPS_SHDN */
340 MX6QDL_PAD_ENET_RXD1__GPIO1_IO26 0x80000000 /* GPS_PPS */
341 MX6QDL_PAD_ENET_TX_EN__GPIO1_IO28 0x80000000 /* PCIE IRQ */
342 MX6QDL_PAD_ENET_TXD1__GPIO1_IO29 0x80000000 /* PCIE RST */
343 MX6QDL_PAD_GPIO_0__CCM_CLKO1 0x000130b0 /* AUD4_MCK */
344 MX6QDL_PAD_GPIO_2__GPIO1_IO02 0x80000000 /* CAN_STBY */
345 MX6QDL_PAD_GPIO_8__GPIO1_IO08 0x80000000 /* PMIC_IRQ# */
346 MX6QDL_PAD_GPIO_9__GPIO1_IO09 0x80000000 /* HUB_RST# */
347 MX6QDL_PAD_GPIO_17__GPIO7_IO12 0x80000000 /* PCIE_WDIS# */
348 MX6QDL_PAD_GPIO_19__GPIO4_IO05 0x80000000 /* ACCEL_IRQ# */
349 MX6QDL_PAD_KEY_COL0__GPIO4_IO06 0x80000000 /* user1 led */
350 MX6QDL_PAD_KEY_COL4__GPIO4_IO14 0x80000000 /* USBOTG_OC# */
351 MX6QDL_PAD_KEY_ROW0__GPIO4_IO07 0x80000000 /* user2 led */
352 MX6QDL_PAD_KEY_ROW4__GPIO4_IO15 0x80000000 /* user3 led */
353 MX6QDL_PAD_SD2_CMD__GPIO1_IO11 0x80000000 /* TOUCH_IRQ# */
354 MX6QDL_PAD_SD3_DAT5__GPIO7_IO00 0x80000000 /* SD3_DET# */
355 >;
356 };
357
358 pinctrl_audmux: audmuxgrp {
359 fsl,pins = <
360 MX6QDL_PAD_SD2_DAT0__AUD4_RXD 0x130b0
361 MX6QDL_PAD_SD2_DAT3__AUD4_TXC 0x130b0
362 MX6QDL_PAD_SD2_DAT2__AUD4_TXD 0x110b0
363 MX6QDL_PAD_SD2_DAT1__AUD4_TXFS 0x130b0
364 >;
365 };
366
367 pinctrl_enet: enetgrp {
368 fsl,pins = <
369 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
370 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
371 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
372 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
373 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
374 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
375 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
376 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
377 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
378 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
379 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
380 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
381 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
382 MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
383 MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
384 MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0a8
385 >;
386 };
387
388 pinctrl_flexcan1: flexcan1grp {
389 fsl,pins = <
390 MX6QDL_PAD_KEY_ROW2__FLEXCAN1_RX 0x80000000
391 MX6QDL_PAD_KEY_COL2__FLEXCAN1_TX 0x80000000
392 >;
393 };
394
395 pinctrl_gpmi_nand: gpminandgrp {
396 fsl,pins = <
397 MX6QDL_PAD_NANDF_CLE__NAND_CLE 0xb0b1
398 MX6QDL_PAD_NANDF_ALE__NAND_ALE 0xb0b1
399 MX6QDL_PAD_NANDF_WP_B__NAND_WP_B 0xb0b1
400 MX6QDL_PAD_NANDF_RB0__NAND_READY_B 0xb000
401 MX6QDL_PAD_NANDF_CS0__NAND_CE0_B 0xb0b1
402 MX6QDL_PAD_NANDF_CS1__NAND_CE1_B 0xb0b1
403 MX6QDL_PAD_SD4_CMD__NAND_RE_B 0xb0b1
404 MX6QDL_PAD_SD4_CLK__NAND_WE_B 0xb0b1
405 MX6QDL_PAD_NANDF_D0__NAND_DATA00 0xb0b1
406 MX6QDL_PAD_NANDF_D1__NAND_DATA01 0xb0b1
407 MX6QDL_PAD_NANDF_D2__NAND_DATA02 0xb0b1
408 MX6QDL_PAD_NANDF_D3__NAND_DATA03 0xb0b1
409 MX6QDL_PAD_NANDF_D4__NAND_DATA04 0xb0b1
410 MX6QDL_PAD_NANDF_D5__NAND_DATA05 0xb0b1
411 MX6QDL_PAD_NANDF_D6__NAND_DATA06 0xb0b1
412 MX6QDL_PAD_NANDF_D7__NAND_DATA07 0xb0b1
413 >;
414 };
415
416 pinctrl_i2c1: i2c1grp {
417 fsl,pins = <
418 MX6QDL_PAD_EIM_D21__I2C1_SCL 0x4001b8b1
419 MX6QDL_PAD_EIM_D28__I2C1_SDA 0x4001b8b1
420 >;
421 };
422
423 pinctrl_i2c2: i2c2grp {
424 fsl,pins = <
425 MX6QDL_PAD_KEY_COL3__I2C2_SCL 0x4001b8b1
426 MX6QDL_PAD_KEY_ROW3__I2C2_SDA 0x4001b8b1
427 >;
428 };
429
430 pinctrl_i2c3: i2c3grp {
431 fsl,pins = <
432 MX6QDL_PAD_GPIO_3__I2C3_SCL 0x4001b8b1
433 MX6QDL_PAD_GPIO_6__I2C3_SDA 0x4001b8b1
434 >;
435 };
436
437 pinctrl_uart1: uart1grp {
438 fsl,pins = <
439 MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA 0x1b0b1
440 MX6QDL_PAD_SD3_DAT6__UART1_RX_DATA 0x1b0b1
441 >;
442 };
443
444 pinctrl_uart2: uart2grp {
445 fsl,pins = <
446 MX6QDL_PAD_SD4_DAT7__UART2_TX_DATA 0x1b0b1
447 MX6QDL_PAD_SD4_DAT4__UART2_RX_DATA 0x1b0b1
448 >;
449 };
450
451 pinctrl_uart5: uart5grp {
452 fsl,pins = <
453 MX6QDL_PAD_KEY_COL1__UART5_TX_DATA 0x1b0b1
454 MX6QDL_PAD_KEY_ROW1__UART5_RX_DATA 0x1b0b1
455 >;
456 };
457
458 pinctrl_usbotg: usbotggrp {
459 fsl,pins = <
460 MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
461 >;
462 };
463
464 pinctrl_usdhc3: usdhc3grp {
465 fsl,pins = <
466 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059
467 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059
468 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059
469 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
470 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
471 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
472 >;
473 };
474 };
475};
476
477&ldb {
478 status = "okay";
479
480 lvds-channel@1 {
481 fsl,data-mapping = "spwg";
482 fsl,data-width = <18>;
483 status = "okay";
484
485 display-timings {
486 native-mode = <&timing0>;
487 timing0: hsd100pxn1 {
488 clock-frequency = <65000000>;
489 hactive = <1024>;
490 vactive = <768>;
491 hback-porch = <220>;
492 hfront-porch = <40>;
493 vback-porch = <21>;
494 vfront-porch = <7>;
495 hsync-len = <60>;
496 vsync-len = <10>;
497 };
498 };
499 };
500};
501
502&pcie {
503 reset-gpio = <&gpio1 29 0>;
504 status = "okay";
505
506 eth1: sky2@8 { /* MAC/PHY on bus 8 */
507 compatible = "marvell,sky2";
508 };
509};
510
511&ssi1 {
512 fsl,mode = "i2s-slave";
513 status = "okay";
514};
515
516&uart1 {
517 pinctrl-names = "default";
518 pinctrl-0 = <&pinctrl_uart1>;
519 status = "okay";
520};
521
522&uart2 {
523 pinctrl-names = "default";
524 pinctrl-0 = <&pinctrl_uart2>;
525 status = "okay";
526};
527
528&uart5 {
529 pinctrl-names = "default";
530 pinctrl-0 = <&pinctrl_uart5>;
531 status = "okay";
532};
533
534&usbotg {
535 vbus-supply = <&reg_usb_otg_vbus>;
536 pinctrl-names = "default";
537 pinctrl-0 = <&pinctrl_usbotg>;
538 disable-over-current;
539 status = "okay";
540};
541
542&usbh1 {
543 vbus-supply = <&reg_usb_h1_vbus>;
544 status = "okay";
545};
546
547&usdhc3 {
548 pinctrl-names = "default";
549 pinctrl-0 = <&pinctrl_usdhc3>;
550 cd-gpios = <&gpio7 0 0>;
551 vmmc-supply = <&reg_3p3v>;
552 status = "okay";
553};
diff --git a/arch/arm/boot/dts/imx6qdl-gw54xx.dtsi b/arch/arm/boot/dts/imx6qdl-gw54xx.dtsi
new file mode 100644
index 000000000000..2795dfc8c926
--- /dev/null
+++ b/arch/arm/boot/dts/imx6qdl-gw54xx.dtsi
@@ -0,0 +1,580 @@
1/*
2 * Copyright 2013 Gateworks Corporation
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/ {
13 /* these are used by bootloader for disabling nodes */
14 aliases {
15 can0 = &can1;
16 ethernet0 = &fec;
17 ethernet1 = &eth1;
18 led0 = &led0;
19 led1 = &led1;
20 led2 = &led2;
21 nand = &gpmi;
22 sky2 = &eth1;
23 ssi0 = &ssi1;
24 usb0 = &usbh1;
25 usb1 = &usbotg;
26 usdhc2 = &usdhc3;
27 };
28
29 chosen {
30 bootargs = "console=ttymxc1,115200";
31 };
32
33 leds {
34 compatible = "gpio-leds";
35
36 led0: user1 {
37 label = "user1";
38 gpios = <&gpio4 6 0>; /* 102 -> MX6_PANLEDG */
39 default-state = "on";
40 linux,default-trigger = "heartbeat";
41 };
42
43 led1: user2 {
44 label = "user2";
45 gpios = <&gpio4 7 0>; /* 103 -> MX6_PANLEDR */
46 default-state = "off";
47 };
48
49 led2: user3 {
50 label = "user3";
51 gpios = <&gpio4 15 1>; /* 111 -> MX6_LOCLED# */
52 default-state = "off";
53 };
54 };
55
56 memory {
57 reg = <0x10000000 0x40000000>;
58 };
59
60 pps {
61 compatible = "pps-gpio";
62 gpios = <&gpio1 26 0>;
63 status = "okay";
64 };
65
66 regulators {
67 compatible = "simple-bus";
68 #address-cells = <1>;
69 #size-cells = <0>;
70
71 reg_1p0v: regulator@0 {
72 compatible = "regulator-fixed";
73 reg = <0>;
74 regulator-name = "1P0V";
75 regulator-min-microvolt = <1000000>;
76 regulator-max-microvolt = <1000000>;
77 regulator-always-on;
78 };
79
80 reg_3p3v: regulator@1 {
81 compatible = "regulator-fixed";
82 reg = <1>;
83 regulator-name = "3P3V";
84 regulator-min-microvolt = <3300000>;
85 regulator-max-microvolt = <3300000>;
86 regulator-always-on;
87 };
88
89 reg_usb_h1_vbus: regulator@2 {
90 compatible = "regulator-fixed";
91 reg = <2>;
92 regulator-name = "usb_h1_vbus";
93 regulator-min-microvolt = <5000000>;
94 regulator-max-microvolt = <5000000>;
95 regulator-always-on;
96 };
97
98 reg_usb_otg_vbus: regulator@3 {
99 compatible = "regulator-fixed";
100 reg = <3>;
101 regulator-name = "usb_otg_vbus";
102 regulator-min-microvolt = <5000000>;
103 regulator-max-microvolt = <5000000>;
104 gpio = <&gpio3 22 0>;
105 enable-active-high;
106 };
107 };
108
109 sound {
110 compatible = "fsl,imx6q-sabrelite-sgtl5000",
111 "fsl,imx-audio-sgtl5000";
112 model = "imx6q-sabrelite-sgtl5000";
113 ssi-controller = <&ssi1>;
114 audio-codec = <&codec>;
115 audio-routing =
116 "MIC_IN", "Mic Jack",
117 "Mic Jack", "Mic Bias",
118 "Headphone Jack", "HP_OUT";
119 mux-int-port = <1>;
120 mux-ext-port = <4>;
121 };
122};
123
124&audmux {
125 pinctrl-names = "default";
126 pinctrl-0 = <&pinctrl_audmux>; /* AUD4<->sgtl5000 */
127 status = "okay";
128};
129
130&can1 {
131 pinctrl-names = "default";
132 pinctrl-0 = <&pinctrl_flexcan1>;
133 status = "okay";
134};
135
136&fec {
137 pinctrl-names = "default";
138 pinctrl-0 = <&pinctrl_enet>;
139 phy-mode = "rgmii";
140 phy-reset-gpios = <&gpio1 30 0>;
141 status = "okay";
142};
143
144&gpmi {
145 pinctrl-names = "default";
146 pinctrl-0 = <&pinctrl_gpmi_nand>;
147 status = "okay";
148};
149
150&i2c1 {
151 clock-frequency = <100000>;
152 pinctrl-names = "default";
153 pinctrl-0 = <&pinctrl_i2c1>;
154 status = "okay";
155
156 eeprom1: eeprom@50 {
157 compatible = "atmel,24c02";
158 reg = <0x50>;
159 pagesize = <16>;
160 };
161
162 eeprom2: eeprom@51 {
163 compatible = "atmel,24c02";
164 reg = <0x51>;
165 pagesize = <16>;
166 };
167
168 eeprom3: eeprom@52 {
169 compatible = "atmel,24c02";
170 reg = <0x52>;
171 pagesize = <16>;
172 };
173
174 eeprom4: eeprom@53 {
175 compatible = "atmel,24c02";
176 reg = <0x53>;
177 pagesize = <16>;
178 };
179
180 gpio: pca9555@23 {
181 compatible = "nxp,pca9555";
182 reg = <0x23>;
183 gpio-controller;
184 #gpio-cells = <2>;
185 };
186
187 hwmon: gsc@29 {
188 compatible = "gw,gsp";
189 reg = <0x29>;
190 };
191
192 rtc: ds1672@68 {
193 compatible = "dallas,ds1672";
194 reg = <0x68>;
195 };
196};
197
198&i2c2 {
199 clock-frequency = <100000>;
200 pinctrl-names = "default";
201 pinctrl-0 = <&pinctrl_i2c2>;
202 status = "okay";
203
204 pmic: pfuze100@08 {
205 compatible = "fsl,pfuze100";
206 reg = <0x08>;
207
208 regulators {
209 sw1a_reg: sw1ab {
210 regulator-min-microvolt = <300000>;
211 regulator-max-microvolt = <1875000>;
212 regulator-boot-on;
213 regulator-always-on;
214 regulator-ramp-delay = <6250>;
215 };
216
217 sw1c_reg: sw1c {
218 regulator-min-microvolt = <300000>;
219 regulator-max-microvolt = <1875000>;
220 regulator-boot-on;
221 regulator-always-on;
222 regulator-ramp-delay = <6250>;
223 };
224
225 sw2_reg: sw2 {
226 regulator-min-microvolt = <800000>;
227 regulator-max-microvolt = <3950000>;
228 regulator-boot-on;
229 regulator-always-on;
230 };
231
232 sw3a_reg: sw3a {
233 regulator-min-microvolt = <400000>;
234 regulator-max-microvolt = <1975000>;
235 regulator-boot-on;
236 regulator-always-on;
237 };
238
239 sw3b_reg: sw3b {
240 regulator-min-microvolt = <400000>;
241 regulator-max-microvolt = <1975000>;
242 regulator-boot-on;
243 regulator-always-on;
244 };
245
246 sw4_reg: sw4 {
247 regulator-min-microvolt = <800000>;
248 regulator-max-microvolt = <3300000>;
249 };
250
251 swbst_reg: swbst {
252 regulator-min-microvolt = <5000000>;
253 regulator-max-microvolt = <5150000>;
254 };
255
256 snvs_reg: vsnvs {
257 regulator-min-microvolt = <1000000>;
258 regulator-max-microvolt = <3000000>;
259 regulator-boot-on;
260 regulator-always-on;
261 };
262
263 vref_reg: vrefddr {
264 regulator-boot-on;
265 regulator-always-on;
266 };
267
268 vgen1_reg: vgen1 {
269 regulator-min-microvolt = <800000>;
270 regulator-max-microvolt = <1550000>;
271 };
272
273 vgen2_reg: vgen2 {
274 regulator-min-microvolt = <800000>;
275 regulator-max-microvolt = <1550000>;
276 };
277
278 vgen3_reg: vgen3 {
279 regulator-min-microvolt = <1800000>;
280 regulator-max-microvolt = <3300000>;
281 };
282
283 vgen4_reg: vgen4 {
284 regulator-min-microvolt = <1800000>;
285 regulator-max-microvolt = <3300000>;
286 regulator-always-on;
287 };
288
289 vgen5_reg: vgen5 {
290 regulator-min-microvolt = <1800000>;
291 regulator-max-microvolt = <3300000>;
292 regulator-always-on;
293 };
294
295 vgen6_reg: vgen6 {
296 regulator-min-microvolt = <1800000>;
297 regulator-max-microvolt = <3300000>;
298 regulator-always-on;
299 };
300 };
301 };
302
303 pciswitch: pex8609@3f {
304 compatible = "plx,pex8609";
305 reg = <0x3f>;
306 };
307
308 pciclkgen: si52147@6b {
309 compatible = "sil,si52147";
310 reg = <0x6b>;
311 };
312};
313
314&i2c3 {
315 clock-frequency = <100000>;
316 pinctrl-names = "default";
317 pinctrl-0 = <&pinctrl_i2c3>;
318 status = "okay";
319
320 accelerometer: fxos8700@1e {
321 compatible = "fsl,fxos8700";
322 reg = <0x1e>;
323 };
324
325 codec: sgtl5000@0a {
326 compatible = "fsl,sgtl5000";
327 reg = <0x0a>;
328 clocks = <&clks 201>;
329 VDDA-supply = <&sw4_reg>;
330 VDDIO-supply = <&reg_3p3v>;
331 };
332
333 hdmiin: adv7611@4c {
334 compatible = "adi,adv7611";
335 reg = <0x4c>;
336 };
337
338 touchscreen: egalax_ts@04 {
339 compatible = "eeti,egalax_ts";
340 reg = <0x04>;
341 interrupt-parent = <&gpio7>;
342 interrupts = <12 2>; /* gpio7_12 active low */
343 wakeup-gpios = <&gpio7 12 0>;
344 };
345
346 videoout: adv7393@2a {
347 compatible = "adi,adv7393";
348 reg = <0x2a>;
349 };
350
351 videoin: adv7180@20 {
352 compatible = "adi,adv7180";
353 reg = <0x20>;
354 };
355};
356
357&iomuxc {
358 pinctrl-names = "default";
359 pinctrl-0 = <&pinctrl_hog>;
360
361 imx6qdl-gw54xx {
362 pinctrl_hog: hoggrp {
363 fsl,pins = <
364 MX6QDL_PAD_EIM_D22__GPIO3_IO22 0x80000000 /* OTG_PWR_EN */
365 MX6QDL_PAD_EIM_D19__GPIO3_IO19 0x80000000 /* SPINOR_CS0# */
366 MX6QDL_PAD_ENET_RXD1__GPIO1_IO26 0x80000000 /* GPS_PPS */
367 MX6QDL_PAD_ENET_TX_EN__GPIO1_IO28 0x80000000 /* PCIE IRQ */
368 MX6QDL_PAD_ENET_TXD1__GPIO1_IO29 0x80000000 /* PCIE RST */
369 MX6QDL_PAD_GPIO_0__CCM_CLKO1 0x000130b0 /* AUD4_MCK */
370 MX6QDL_PAD_GPIO_2__GPIO1_IO02 0x80000000 /* CAN_STBY */
371 MX6QDL_PAD_GPIO_17__GPIO7_IO12 0x80000000 /* TOUCH_IRQ# */
372 MX6QDL_PAD_KEY_COL0__GPIO4_IO06 0x80000000 /* user1 led */
373 MX6QDL_PAD_KEY_ROW0__GPIO4_IO07 0x80000000 /* user2 led */
374 MX6QDL_PAD_KEY_ROW4__GPIO4_IO15 0x80000000 /* user3 led */
375 MX6QDL_PAD_SD1_DAT0__GPIO1_IO16 0x80000000 /* USBHUB_RST# */
376 MX6QDL_PAD_SD1_DAT3__GPIO1_IO21 0x80000000 /* MIPI_DIO */
377 >;
378 };
379
380 pinctrl_audmux: audmuxgrp {
381 fsl,pins = <
382 MX6QDL_PAD_SD2_DAT0__AUD4_RXD 0x130b0
383 MX6QDL_PAD_SD2_DAT3__AUD4_TXC 0x130b0
384 MX6QDL_PAD_SD2_DAT2__AUD4_TXD 0x110b0
385 MX6QDL_PAD_SD2_DAT1__AUD4_TXFS 0x130b0
386 >;
387 };
388
389 pinctrl_enet: enetgrp {
390 fsl,pins = <
391 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
392 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
393 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
394 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
395 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
396 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
397 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
398 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
399 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
400 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
401 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
402 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
403 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
404 MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
405 MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
406 MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0a8
407 >;
408 };
409
410 pinctrl_flexcan1: flexcan1grp {
411 fsl,pins = <
412 MX6QDL_PAD_KEY_ROW2__FLEXCAN1_RX 0x80000000
413 MX6QDL_PAD_KEY_COL2__FLEXCAN1_TX 0x80000000
414 >;
415 };
416
417 pinctrl_gpmi_nand: gpminandgrp {
418 fsl,pins = <
419 MX6QDL_PAD_NANDF_CLE__NAND_CLE 0xb0b1
420 MX6QDL_PAD_NANDF_ALE__NAND_ALE 0xb0b1
421 MX6QDL_PAD_NANDF_WP_B__NAND_WP_B 0xb0b1
422 MX6QDL_PAD_NANDF_RB0__NAND_READY_B 0xb000
423 MX6QDL_PAD_NANDF_CS0__NAND_CE0_B 0xb0b1
424 MX6QDL_PAD_NANDF_CS1__NAND_CE1_B 0xb0b1
425 MX6QDL_PAD_SD4_CMD__NAND_RE_B 0xb0b1
426 MX6QDL_PAD_SD4_CLK__NAND_WE_B 0xb0b1
427 MX6QDL_PAD_NANDF_D0__NAND_DATA00 0xb0b1
428 MX6QDL_PAD_NANDF_D1__NAND_DATA01 0xb0b1
429 MX6QDL_PAD_NANDF_D2__NAND_DATA02 0xb0b1
430 MX6QDL_PAD_NANDF_D3__NAND_DATA03 0xb0b1
431 MX6QDL_PAD_NANDF_D4__NAND_DATA04 0xb0b1
432 MX6QDL_PAD_NANDF_D5__NAND_DATA05 0xb0b1
433 MX6QDL_PAD_NANDF_D6__NAND_DATA06 0xb0b1
434 MX6QDL_PAD_NANDF_D7__NAND_DATA07 0xb0b1
435 >;
436 };
437
438 pinctrl_i2c1: i2c1grp {
439 fsl,pins = <
440 MX6QDL_PAD_EIM_D21__I2C1_SCL 0x4001b8b1
441 MX6QDL_PAD_EIM_D28__I2C1_SDA 0x4001b8b1
442 >;
443 };
444
445 pinctrl_i2c2: i2c2grp {
446 fsl,pins = <
447 MX6QDL_PAD_KEY_COL3__I2C2_SCL 0x4001b8b1
448 MX6QDL_PAD_KEY_ROW3__I2C2_SDA 0x4001b8b1
449 >;
450 };
451
452 pinctrl_i2c3: i2c3grp {
453 fsl,pins = <
454 MX6QDL_PAD_GPIO_3__I2C3_SCL 0x4001b8b1
455 MX6QDL_PAD_GPIO_6__I2C3_SDA 0x4001b8b1
456 >;
457 };
458
459 pinctrl_uart1: uart1grp {
460 fsl,pins = <
461 MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA 0x1b0b1
462 MX6QDL_PAD_SD3_DAT6__UART1_RX_DATA 0x1b0b1
463 >;
464 };
465
466 pinctrl_uart2: uart2grp {
467 fsl,pins = <
468 MX6QDL_PAD_SD4_DAT7__UART2_TX_DATA 0x1b0b1
469 MX6QDL_PAD_SD4_DAT4__UART2_RX_DATA 0x1b0b1
470 >;
471 };
472
473 pinctrl_uart5: uart5grp {
474 fsl,pins = <
475 MX6QDL_PAD_KEY_COL1__UART5_TX_DATA 0x1b0b1
476 MX6QDL_PAD_KEY_ROW1__UART5_RX_DATA 0x1b0b1
477 >;
478 };
479
480 pinctrl_usbotg: usbotggrp {
481 fsl,pins = <
482 MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
483 >;
484 };
485
486 pinctrl_usdhc3: usdhc3grp {
487 fsl,pins = <
488 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059
489 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059
490 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059
491 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
492 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
493 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
494 >;
495 };
496 };
497};
498
499&ldb {
500 status = "okay";
501
502 lvds-channel@1 {
503 fsl,data-mapping = "spwg";
504 fsl,data-width = <18>;
505 status = "okay";
506
507 display-timings {
508 native-mode = <&timing0>;
509 timing0: hsd100pxn1 {
510 clock-frequency = <65000000>;
511 hactive = <1024>;
512 vactive = <768>;
513 hback-porch = <220>;
514 hfront-porch = <40>;
515 vback-porch = <21>;
516 vfront-porch = <7>;
517 hsync-len = <60>;
518 vsync-len = <10>;
519 };
520 };
521 };
522};
523
524&pcie {
525 reset-gpio = <&gpio1 29 0>;
526 status = "okay";
527
528 eth1: sky2@8 { /* MAC/PHY on bus 8 */
529 compatible = "marvell,sky2";
530 };
531};
532
533&ssi1 {
534 fsl,mode = "i2s-slave";
535 status = "okay";
536};
537
538&ssi2 {
539 fsl,mode = "i2s-slave";
540 status = "okay";
541};
542
543&uart1 {
544 pinctrl-names = "default";
545 pinctrl-0 = <&pinctrl_uart1>;
546 status = "okay";
547};
548
549&uart2 {
550 pinctrl-names = "default";
551 pinctrl-0 = <&pinctrl_uart2>;
552 status = "okay";
553};
554
555&uart5 {
556 pinctrl-names = "default";
557 pinctrl-0 = <&pinctrl_uart5>;
558 status = "okay";
559};
560
561&usbotg {
562 vbus-supply = <&reg_usb_otg_vbus>;
563 pinctrl-names = "default";
564 pinctrl-0 = <&pinctrl_usbotg>;
565 disable-over-current;
566 status = "okay";
567};
568
569&usbh1 {
570 vbus-supply = <&reg_usb_h1_vbus>;
571 status = "okay";
572};
573
574&usdhc3 {
575 pinctrl-names = "default";
576 pinctrl-0 = <&pinctrl_usdhc3>;
577 cd-gpios = <&gpio7 0 0>;
578 vmmc-supply = <&reg_3p3v>;
579 status = "okay";
580};
diff --git a/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi b/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi
new file mode 100644
index 000000000000..99be301b5232
--- /dev/null
+++ b/arch/arm/boot/dts/imx6qdl-nitrogen6x.dtsi
@@ -0,0 +1,422 @@
1/*
2 * Copyright 2013 Boundary Devices, Inc.
3 * Copyright 2011 Freescale Semiconductor, Inc.
4 * Copyright 2011 Linaro Ltd.
5 *
6 * The code contained herein is licensed under the GNU General Public
7 * License. You may obtain a copy of the GNU General Public License
8 * Version 2 or later at the following locations:
9 *
10 * http://www.opensource.org/licenses/gpl-license.html
11 * http://www.gnu.org/copyleft/gpl.html
12 */
13#include <dt-bindings/gpio/gpio.h>
14#include <dt-bindings/input/input.h>
15
16/ {
17 memory {
18 reg = <0x10000000 0x40000000>;
19 };
20
21 regulators {
22 compatible = "simple-bus";
23 #address-cells = <1>;
24 #size-cells = <0>;
25
26 reg_2p5v: regulator@0 {
27 compatible = "regulator-fixed";
28 reg = <0>;
29 regulator-name = "2P5V";
30 regulator-min-microvolt = <2500000>;
31 regulator-max-microvolt = <2500000>;
32 regulator-always-on;
33 };
34
35 reg_3p3v: regulator@1 {
36 compatible = "regulator-fixed";
37 reg = <1>;
38 regulator-name = "3P3V";
39 regulator-min-microvolt = <3300000>;
40 regulator-max-microvolt = <3300000>;
41 regulator-always-on;
42 };
43
44 reg_usb_otg_vbus: regulator@2 {
45 compatible = "regulator-fixed";
46 reg = <2>;
47 regulator-name = "usb_otg_vbus";
48 regulator-min-microvolt = <5000000>;
49 regulator-max-microvolt = <5000000>;
50 gpio = <&gpio3 22 0>;
51 enable-active-high;
52 };
53 };
54
55 gpio-keys {
56 compatible = "gpio-keys";
57 pinctrl-names = "default";
58 pinctrl-0 = <&pinctrl_gpio_keys>;
59
60 power {
61 label = "Power Button";
62 gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
63 linux,code = <KEY_POWER>;
64 gpio-key,wakeup;
65 };
66
67 menu {
68 label = "Menu";
69 gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
70 linux,code = <KEY_MENU>;
71 };
72
73 home {
74 label = "Home";
75 gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
76 linux,code = <KEY_HOME>;
77 };
78
79 back {
80 label = "Back";
81 gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
82 linux,code = <KEY_BACK>;
83 };
84
85 volume-up {
86 label = "Volume Up";
87 gpios = <&gpio7 13 GPIO_ACTIVE_LOW>;
88 linux,code = <KEY_VOLUMEUP>;
89 };
90
91 volume-down {
92 label = "Volume Down";
93 gpios = <&gpio4 5 GPIO_ACTIVE_LOW>;
94 linux,code = <KEY_VOLUMEDOWN>;
95 };
96 };
97
98 sound {
99 compatible = "fsl,imx6q-nitrogen6x-sgtl5000",
100 "fsl,imx-audio-sgtl5000";
101 model = "imx6q-nitrogen6x-sgtl5000";
102 ssi-controller = <&ssi1>;
103 audio-codec = <&codec>;
104 audio-routing =
105 "MIC_IN", "Mic Jack",
106 "Mic Jack", "Mic Bias",
107 "Headphone Jack", "HP_OUT";
108 mux-int-port = <1>;
109 mux-ext-port = <3>;
110 };
111
112 backlight_lcd {
113 compatible = "pwm-backlight";
114 pwms = <&pwm1 0 5000000>;
115 brightness-levels = <0 4 8 16 32 64 128 255>;
116 default-brightness-level = <7>;
117 power-supply = <&reg_3p3v>;
118 status = "okay";
119 };
120
121 backlight_lvds {
122 compatible = "pwm-backlight";
123 pwms = <&pwm4 0 5000000>;
124 brightness-levels = <0 4 8 16 32 64 128 255>;
125 default-brightness-level = <7>;
126 power-supply = <&reg_3p3v>;
127 status = "okay";
128 };
129};
130
131&audmux {
132 pinctrl-names = "default";
133 pinctrl-0 = <&pinctrl_audmux>;
134 status = "okay";
135};
136
137&ecspi1 {
138 fsl,spi-num-chipselects = <1>;
139 cs-gpios = <&gpio3 19 0>;
140 pinctrl-names = "default";
141 pinctrl-0 = <&pinctrl_ecspi1>;
142 status = "okay";
143
144 flash: m25p80@0 {
145 compatible = "sst,sst25vf016b";
146 spi-max-frequency = <20000000>;
147 reg = <0>;
148 };
149};
150
151&fec {
152 pinctrl-names = "default";
153 pinctrl-0 = <&pinctrl_enet>;
154 phy-mode = "rgmii";
155 phy-reset-gpios = <&gpio1 27 0>;
156 txen-skew-ps = <0>;
157 txc-skew-ps = <3000>;
158 rxdv-skew-ps = <0>;
159 rxc-skew-ps = <3000>;
160 rxd0-skew-ps = <0>;
161 rxd1-skew-ps = <0>;
162 rxd2-skew-ps = <0>;
163 rxd3-skew-ps = <0>;
164 txd0-skew-ps = <0>;
165 txd1-skew-ps = <0>;
166 txd2-skew-ps = <0>;
167 txd3-skew-ps = <0>;
168 interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_HIGH>,
169 <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>;
170 status = "okay";
171};
172
173&i2c1 {
174 clock-frequency = <100000>;
175 pinctrl-names = "default";
176 pinctrl-0 = <&pinctrl_i2c1>;
177 status = "okay";
178
179 codec: sgtl5000@0a {
180 compatible = "fsl,sgtl5000";
181 reg = <0x0a>;
182 clocks = <&clks 201>;
183 VDDA-supply = <&reg_2p5v>;
184 VDDIO-supply = <&reg_3p3v>;
185 };
186};
187
188&iomuxc {
189 pinctrl-names = "default";
190 pinctrl-0 = <&pinctrl_hog>;
191
192 imx6q-nitrogen6x {
193 pinctrl_hog: hoggrp {
194 fsl,pins = <
195 /* SGTL5000 sys_mclk */
196 MX6QDL_PAD_GPIO_0__CCM_CLKO1 0x030b0
197 >;
198 };
199
200 pinctrl_audmux: audmuxgrp {
201 fsl,pins = <
202 MX6QDL_PAD_CSI0_DAT7__AUD3_RXD 0x130b0
203 MX6QDL_PAD_CSI0_DAT4__AUD3_TXC 0x130b0
204 MX6QDL_PAD_CSI0_DAT5__AUD3_TXD 0x110b0
205 MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS 0x130b0
206 >;
207 };
208
209 pinctrl_ecspi1: ecspi1grp {
210 fsl,pins = <
211 MX6QDL_PAD_EIM_D17__ECSPI1_MISO 0x100b1
212 MX6QDL_PAD_EIM_D18__ECSPI1_MOSI 0x100b1
213 MX6QDL_PAD_EIM_D16__ECSPI1_SCLK 0x100b1
214 MX6QDL_PAD_EIM_D19__GPIO3_IO19 0x000b1 /* CS */
215 >;
216 };
217
218 pinctrl_enet: enetgrp {
219 fsl,pins = <
220 MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x100b0
221 MX6QDL_PAD_ENET_MDC__ENET_MDC 0x100b0
222 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x100b0
223 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x100b0
224 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x100b0
225 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x100b0
226 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x100b0
227 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x100b0
228 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x100b0
229 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
230 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
231 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
232 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
233 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
234 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
235 /* Phy reset */
236 MX6QDL_PAD_ENET_RXD0__GPIO1_IO27 0x000b0
237 MX6QDL_PAD_GPIO_6__ENET_IRQ 0x000b1
238 >;
239 };
240
241 pinctrl_gpio_keys: gpio_keysgrp {
242 fsl,pins = <
243 /* Power Button */
244 MX6QDL_PAD_NANDF_D3__GPIO2_IO03 0x1b0b0
245 /* Menu Button */
246 MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x1b0b0
247 /* Home Button */
248 MX6QDL_PAD_NANDF_D4__GPIO2_IO04 0x1b0b0
249 /* Back Button */
250 MX6QDL_PAD_NANDF_D2__GPIO2_IO02 0x1b0b0
251 /* Volume Up Button */
252 MX6QDL_PAD_GPIO_18__GPIO7_IO13 0x1b0b0
253 /* Volume Down Button */
254 MX6QDL_PAD_GPIO_19__GPIO4_IO05 0x1b0b0
255 >;
256 };
257
258 pinctrl_i2c1: i2c1grp {
259 fsl,pins = <
260 MX6QDL_PAD_EIM_D21__I2C1_SCL 0x4001b8b1
261 MX6QDL_PAD_EIM_D28__I2C1_SDA 0x4001b8b1
262 >;
263 };
264
265 pinctrl_pwm1: pwm1grp {
266 fsl,pins = <
267 MX6QDL_PAD_SD1_DAT3__PWM1_OUT 0x1b0b1
268 >;
269 };
270
271 pinctrl_pwm3: pwm3grp {
272 fsl,pins = <
273 MX6QDL_PAD_SD1_DAT1__PWM3_OUT 0x1b0b1
274 >;
275 };
276
277 pinctrl_pwm4: pwm4grp {
278 fsl,pins = <
279 MX6QDL_PAD_SD1_CMD__PWM4_OUT 0x1b0b1
280 >;
281 };
282
283 pinctrl_uart1: uart1grp {
284 fsl,pins = <
285 MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA 0x1b0b1
286 MX6QDL_PAD_SD3_DAT6__UART1_RX_DATA 0x1b0b1
287 >;
288 };
289
290 pinctrl_uart2: uart2grp {
291 fsl,pins = <
292 MX6QDL_PAD_EIM_D26__UART2_TX_DATA 0x1b0b1
293 MX6QDL_PAD_EIM_D27__UART2_RX_DATA 0x1b0b1
294 >;
295 };
296
297 pinctrl_usbotg: usbotggrp {
298 fsl,pins = <
299 MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
300 MX6QDL_PAD_KEY_COL4__USB_OTG_OC 0x1b0b0
301 /* power enable, high active */
302 MX6QDL_PAD_EIM_D22__GPIO3_IO22 0x000b0
303 >;
304 };
305
306 pinctrl_usdhc3: usdhc3grp {
307 fsl,pins = <
308 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059
309 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059
310 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059
311 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
312 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
313 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
314 MX6QDL_PAD_SD3_DAT5__GPIO7_IO00 0x1b0b0 /* CD */
315 >;
316 };
317
318 pinctrl_usdhc4: usdhc4grp {
319 fsl,pins = <
320 MX6QDL_PAD_SD4_CMD__SD4_CMD 0x17059
321 MX6QDL_PAD_SD4_CLK__SD4_CLK 0x10059
322 MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17059
323 MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17059
324 MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17059
325 MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17059
326 MX6QDL_PAD_NANDF_D6__GPIO2_IO06 0x1b0b0 /* CD */
327 >;
328 };
329 };
330};
331
332&ldb {
333 status = "okay";
334
335 lvds-channel@0 {
336 fsl,data-mapping = "spwg";
337 fsl,data-width = <18>;
338 status = "okay";
339
340 display-timings {
341 native-mode = <&timing0>;
342 timing0: hsd100pxn1 {
343 clock-frequency = <65000000>;
344 hactive = <1024>;
345 vactive = <768>;
346 hback-porch = <220>;
347 hfront-porch = <40>;
348 vback-porch = <21>;
349 vfront-porch = <7>;
350 hsync-len = <60>;
351 vsync-len = <10>;
352 };
353 };
354 };
355};
356
357&pcie {
358 status = "okay";
359};
360
361&pwm1 {
362 pinctrl-names = "default";
363 pinctrl-0 = <&pinctrl_pwm1>;
364 status = "okay";
365};
366
367&pwm3 {
368 pinctrl-names = "default";
369 pinctrl-0 = <&pinctrl_pwm3>;
370 status = "okay";
371};
372
373&pwm4 {
374 pinctrl-names = "default";
375 pinctrl-0 = <&pinctrl_pwm4>;
376 status = "okay";
377};
378
379&ssi1 {
380 fsl,mode = "i2s-slave";
381 status = "okay";
382};
383
384&uart1 {
385 pinctrl-names = "default";
386 pinctrl-0 = <&pinctrl_uart1>;
387 status = "okay";
388};
389
390&uart2 {
391 pinctrl-names = "default";
392 pinctrl-0 = <&pinctrl_uart2>;
393 status = "okay";
394};
395
396&usbh1 {
397 status = "okay";
398};
399
400&usbotg {
401 vbus-supply = <&reg_usb_otg_vbus>;
402 pinctrl-names = "default";
403 pinctrl-0 = <&pinctrl_usbotg>;
404 disable-over-current;
405 status = "okay";
406};
407
408&usdhc3 {
409 pinctrl-names = "default";
410 pinctrl-0 = <&pinctrl_usdhc3>;
411 cd-gpios = <&gpio7 0 0>;
412 vmmc-supply = <&reg_3p3v>;
413 status = "okay";
414};
415
416&usdhc4 {
417 pinctrl-names = "default";
418 pinctrl-0 = <&pinctrl_usdhc4>;
419 cd-gpios = <&gpio2 6 0>;
420 vmmc-supply = <&reg_3p3v>;
421 status = "okay";
422};
diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
index ff6f1e8f2dd9..009abd69385d 100644
--- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
@@ -10,17 +10,46 @@
10 * http://www.gnu.org/copyleft/gpl.html 10 * http://www.gnu.org/copyleft/gpl.html
11 */ 11 */
12 12
13#include <dt-bindings/gpio/gpio.h>
14
13/ { 15/ {
14 memory { 16 memory {
15 reg = <0x10000000 0x80000000>; 17 reg = <0x10000000 0x80000000>;
16 }; 18 };
19
20 leds {
21 compatible = "gpio-leds";
22 pinctrl-names = "default";
23 pinctrl-0 = <&pinctrl_gpio_leds>;
24
25 user {
26 label = "debug";
27 gpios = <&gpio5 15 GPIO_ACTIVE_HIGH>;
28 };
29 };
30
31 sound-spdif {
32 compatible = "fsl,imx-audio-spdif",
33 "fsl,imx-sabreauto-spdif";
34 model = "imx-spdif";
35 spdif-controller = <&spdif>;
36 spdif-in;
37 };
38
39 backlight {
40 compatible = "pwm-backlight";
41 pwms = <&pwm3 0 5000000>;
42 brightness-levels = <0 4 8 16 32 64 128 255>;
43 default-brightness-level = <7>;
44 status = "okay";
45 };
17}; 46};
18 47
19&ecspi1 { 48&ecspi1 {
20 fsl,spi-num-chipselects = <1>; 49 fsl,spi-num-chipselects = <1>;
21 cs-gpios = <&gpio3 19 0>; 50 cs-gpios = <&gpio3 19 0>;
22 pinctrl-names = "default"; 51 pinctrl-names = "default";
23 pinctrl-0 = <&pinctrl_ecspi1_1 &pinctrl_ecspi1_sabreauto>; 52 pinctrl-0 = <&pinctrl_ecspi1 &pinctrl_ecspi1_cs>;
24 status = "disabled"; /* pin conflict with WEIM NOR */ 53 status = "disabled"; /* pin conflict with WEIM NOR */
25 54
26 flash: m25p80@0 { 55 flash: m25p80@0 {
@@ -34,22 +63,130 @@
34 63
35&fec { 64&fec {
36 pinctrl-names = "default"; 65 pinctrl-names = "default";
37 pinctrl-0 = <&pinctrl_enet_2>; 66 pinctrl-0 = <&pinctrl_enet>;
38 phy-mode = "rgmii"; 67 phy-mode = "rgmii";
68 interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_HIGH>,
69 <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>;
39 status = "okay"; 70 status = "okay";
40}; 71};
41 72
42&gpmi { 73&gpmi {
43 pinctrl-names = "default"; 74 pinctrl-names = "default";
44 pinctrl-0 = <&pinctrl_gpmi_nand_1>; 75 pinctrl-0 = <&pinctrl_gpmi_nand>;
76 status = "okay";
77};
78
79&i2c2 {
80 clock-frequency = <100000>;
81 pinctrl-names = "default";
82 pinctrl-0 = <&pinctrl_i2c2>;
45 status = "okay"; 83 status = "okay";
84
85 pmic: pfuze100@08 {
86 compatible = "fsl,pfuze100";
87 reg = <0x08>;
88
89 regulators {
90 sw1a_reg: sw1ab {
91 regulator-min-microvolt = <300000>;
92 regulator-max-microvolt = <1875000>;
93 regulator-boot-on;
94 regulator-always-on;
95 regulator-ramp-delay = <6250>;
96 };
97
98 sw1c_reg: sw1c {
99 regulator-min-microvolt = <300000>;
100 regulator-max-microvolt = <1875000>;
101 regulator-boot-on;
102 regulator-always-on;
103 regulator-ramp-delay = <6250>;
104 };
105
106 sw2_reg: sw2 {
107 regulator-min-microvolt = <800000>;
108 regulator-max-microvolt = <3300000>;
109 regulator-boot-on;
110 regulator-always-on;
111 };
112
113 sw3a_reg: sw3a {
114 regulator-min-microvolt = <400000>;
115 regulator-max-microvolt = <1975000>;
116 regulator-boot-on;
117 regulator-always-on;
118 };
119
120 sw3b_reg: sw3b {
121 regulator-min-microvolt = <400000>;
122 regulator-max-microvolt = <1975000>;
123 regulator-boot-on;
124 regulator-always-on;
125 };
126
127 sw4_reg: sw4 {
128 regulator-min-microvolt = <800000>;
129 regulator-max-microvolt = <3300000>;
130 };
131
132 swbst_reg: swbst {
133 regulator-min-microvolt = <5000000>;
134 regulator-max-microvolt = <5150000>;
135 };
136
137 snvs_reg: vsnvs {
138 regulator-min-microvolt = <1000000>;
139 regulator-max-microvolt = <3000000>;
140 regulator-boot-on;
141 regulator-always-on;
142 };
143
144 vref_reg: vrefddr {
145 regulator-boot-on;
146 regulator-always-on;
147 };
148
149 vgen1_reg: vgen1 {
150 regulator-min-microvolt = <800000>;
151 regulator-max-microvolt = <1550000>;
152 };
153
154 vgen2_reg: vgen2 {
155 regulator-min-microvolt = <800000>;
156 regulator-max-microvolt = <1550000>;
157 };
158
159 vgen3_reg: vgen3 {
160 regulator-min-microvolt = <1800000>;
161 regulator-max-microvolt = <3300000>;
162 };
163
164 vgen4_reg: vgen4 {
165 regulator-min-microvolt = <1800000>;
166 regulator-max-microvolt = <3300000>;
167 regulator-always-on;
168 };
169
170 vgen5_reg: vgen5 {
171 regulator-min-microvolt = <1800000>;
172 regulator-max-microvolt = <3300000>;
173 regulator-always-on;
174 };
175
176 vgen6_reg: vgen6 {
177 regulator-min-microvolt = <1800000>;
178 regulator-max-microvolt = <3300000>;
179 regulator-always-on;
180 };
181 };
182 };
46}; 183};
47 184
48&iomuxc { 185&iomuxc {
49 pinctrl-names = "default"; 186 pinctrl-names = "default";
50 pinctrl-0 = <&pinctrl_hog>; 187 pinctrl-0 = <&pinctrl_hog>;
51 188
52 hog { 189 imx6qdl-sabreauto {
53 pinctrl_hog: hoggrp { 190 pinctrl_hog: hoggrp {
54 fsl,pins = < 191 fsl,pins = <
55 MX6QDL_PAD_NANDF_CS2__GPIO6_IO15 0x80000000 192 MX6QDL_PAD_NANDF_CS2__GPIO6_IO15 0x80000000
@@ -57,28 +194,245 @@
57 MX6QDL_PAD_GPIO_18__SD3_VSELECT 0x17059 194 MX6QDL_PAD_GPIO_18__SD3_VSELECT 0x17059
58 >; 195 >;
59 }; 196 };
60 };
61 197
62 ecspi1 { 198 pinctrl_ecspi1: ecspi1grp {
63 pinctrl_ecspi1_sabreauto: ecspi1-sabreauto { 199 fsl,pins = <
200 MX6QDL_PAD_EIM_D17__ECSPI1_MISO 0x100b1
201 MX6QDL_PAD_EIM_D18__ECSPI1_MOSI 0x100b1
202 MX6QDL_PAD_EIM_D16__ECSPI1_SCLK 0x100b1
203 >;
204 };
205
206 pinctrl_ecspi1_cs: ecspi1cs {
64 fsl,pins = < 207 fsl,pins = <
65 MX6QDL_PAD_EIM_D19__GPIO3_IO19 0x80000000 208 MX6QDL_PAD_EIM_D19__GPIO3_IO19 0x80000000
66 >; 209 >;
67 }; 210 };
211
212 pinctrl_enet: enetgrp {
213 fsl,pins = <
214 MX6QDL_PAD_KEY_COL1__ENET_MDIO 0x1b0b0
215 MX6QDL_PAD_KEY_COL2__ENET_MDC 0x1b0b0
216 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
217 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
218 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
219 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
220 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
221 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
222 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
223 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
224 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
225 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
226 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
227 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
228 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
229 MX6QDL_PAD_GPIO_6__ENET_IRQ 0x000b1
230 >;
231 };
232
233 pinctrl_gpio_leds: gpioledsgrp {
234 fsl,pins = <
235 MX6QDL_PAD_DISP0_DAT21__GPIO5_IO15 0x80000000
236 >;
237 };
238
239 pinctrl_gpmi_nand: gpminandgrp {
240 fsl,pins = <
241 MX6QDL_PAD_NANDF_CLE__NAND_CLE 0xb0b1
242 MX6QDL_PAD_NANDF_ALE__NAND_ALE 0xb0b1
243 MX6QDL_PAD_NANDF_WP_B__NAND_WP_B 0xb0b1
244 MX6QDL_PAD_NANDF_RB0__NAND_READY_B 0xb000
245 MX6QDL_PAD_NANDF_CS0__NAND_CE0_B 0xb0b1
246 MX6QDL_PAD_NANDF_CS1__NAND_CE1_B 0xb0b1
247 MX6QDL_PAD_SD4_CMD__NAND_RE_B 0xb0b1
248 MX6QDL_PAD_SD4_CLK__NAND_WE_B 0xb0b1
249 MX6QDL_PAD_NANDF_D0__NAND_DATA00 0xb0b1
250 MX6QDL_PAD_NANDF_D1__NAND_DATA01 0xb0b1
251 MX6QDL_PAD_NANDF_D2__NAND_DATA02 0xb0b1
252 MX6QDL_PAD_NANDF_D3__NAND_DATA03 0xb0b1
253 MX6QDL_PAD_NANDF_D4__NAND_DATA04 0xb0b1
254 MX6QDL_PAD_NANDF_D5__NAND_DATA05 0xb0b1
255 MX6QDL_PAD_NANDF_D6__NAND_DATA06 0xb0b1
256 MX6QDL_PAD_NANDF_D7__NAND_DATA07 0xb0b1
257 MX6QDL_PAD_SD4_DAT0__NAND_DQS 0x00b1
258 >;
259 };
260
261 pinctrl_i2c2: i2c2grp {
262 fsl,pins = <
263 MX6QDL_PAD_EIM_EB2__I2C2_SCL 0x4001b8b1
264 MX6QDL_PAD_KEY_ROW3__I2C2_SDA 0x4001b8b1
265 >;
266 };
267
268 pinctrl_pwm3: pwm1grp {
269 fsl,pins = <
270 MX6QDL_PAD_SD4_DAT1__PWM3_OUT 0x1b0b1
271 >;
272 };
273
274 pinctrl_spdif: spdifgrp {
275 fsl,pins = <
276 MX6QDL_PAD_KEY_COL3__SPDIF_IN 0x1b0b0
277 >;
278 };
279
280 pinctrl_uart4: uart4grp {
281 fsl,pins = <
282 MX6QDL_PAD_KEY_COL0__UART4_TX_DATA 0x1b0b1
283 MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA 0x1b0b1
284 >;
285 };
286
287 pinctrl_usdhc3: usdhc3grp {
288 fsl,pins = <
289 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059
290 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059
291 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059
292 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
293 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
294 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
295 MX6QDL_PAD_SD3_DAT4__SD3_DATA4 0x17059
296 MX6QDL_PAD_SD3_DAT5__SD3_DATA5 0x17059
297 MX6QDL_PAD_SD3_DAT6__SD3_DATA6 0x17059
298 MX6QDL_PAD_SD3_DAT7__SD3_DATA7 0x17059
299 >;
300 };
301
302 pinctrl_usdhc3_100mhz: usdhc3grp100mhz {
303 fsl,pins = <
304 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x170b9
305 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x100b9
306 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x170b9
307 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x170b9
308 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x170b9
309 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x170b9
310 MX6QDL_PAD_SD3_DAT4__SD3_DATA4 0x170b9
311 MX6QDL_PAD_SD3_DAT5__SD3_DATA5 0x170b9
312 MX6QDL_PAD_SD3_DAT6__SD3_DATA6 0x170b9
313 MX6QDL_PAD_SD3_DAT7__SD3_DATA7 0x170b9
314 >;
315 };
316
317 pinctrl_usdhc3_200mhz: usdhc3grp200mhz {
318 fsl,pins = <
319 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x170f9
320 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x100f9
321 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x170f9
322 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x170f9
323 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x170f9
324 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x170f9
325 MX6QDL_PAD_SD3_DAT4__SD3_DATA4 0x170f9
326 MX6QDL_PAD_SD3_DAT5__SD3_DATA5 0x170f9
327 MX6QDL_PAD_SD3_DAT6__SD3_DATA6 0x170f9
328 MX6QDL_PAD_SD3_DAT7__SD3_DATA7 0x170f9
329 >;
330 };
331
332 pinctrl_weim_cs0: weimcs0grp {
333 fsl,pins = <
334 MX6QDL_PAD_EIM_CS0__EIM_CS0_B 0xb0b1
335 >;
336 };
337
338 pinctrl_weim_nor: weimnorgrp {
339 fsl,pins = <
340 MX6QDL_PAD_EIM_OE__EIM_OE_B 0xb0b1
341 MX6QDL_PAD_EIM_RW__EIM_RW 0xb0b1
342 MX6QDL_PAD_EIM_WAIT__EIM_WAIT_B 0xb060
343 MX6QDL_PAD_EIM_D16__EIM_DATA16 0x1b0b0
344 MX6QDL_PAD_EIM_D17__EIM_DATA17 0x1b0b0
345 MX6QDL_PAD_EIM_D18__EIM_DATA18 0x1b0b0
346 MX6QDL_PAD_EIM_D19__EIM_DATA19 0x1b0b0
347 MX6QDL_PAD_EIM_D20__EIM_DATA20 0x1b0b0
348 MX6QDL_PAD_EIM_D21__EIM_DATA21 0x1b0b0
349 MX6QDL_PAD_EIM_D22__EIM_DATA22 0x1b0b0
350 MX6QDL_PAD_EIM_D23__EIM_DATA23 0x1b0b0
351 MX6QDL_PAD_EIM_D24__EIM_DATA24 0x1b0b0
352 MX6QDL_PAD_EIM_D25__EIM_DATA25 0x1b0b0
353 MX6QDL_PAD_EIM_D26__EIM_DATA26 0x1b0b0
354 MX6QDL_PAD_EIM_D27__EIM_DATA27 0x1b0b0
355 MX6QDL_PAD_EIM_D28__EIM_DATA28 0x1b0b0
356 MX6QDL_PAD_EIM_D29__EIM_DATA29 0x1b0b0
357 MX6QDL_PAD_EIM_D30__EIM_DATA30 0x1b0b0
358 MX6QDL_PAD_EIM_D31__EIM_DATA31 0x1b0b0
359 MX6QDL_PAD_EIM_A23__EIM_ADDR23 0xb0b1
360 MX6QDL_PAD_EIM_A22__EIM_ADDR22 0xb0b1
361 MX6QDL_PAD_EIM_A21__EIM_ADDR21 0xb0b1
362 MX6QDL_PAD_EIM_A20__EIM_ADDR20 0xb0b1
363 MX6QDL_PAD_EIM_A19__EIM_ADDR19 0xb0b1
364 MX6QDL_PAD_EIM_A18__EIM_ADDR18 0xb0b1
365 MX6QDL_PAD_EIM_A17__EIM_ADDR17 0xb0b1
366 MX6QDL_PAD_EIM_A16__EIM_ADDR16 0xb0b1
367 MX6QDL_PAD_EIM_DA15__EIM_AD15 0xb0b1
368 MX6QDL_PAD_EIM_DA14__EIM_AD14 0xb0b1
369 MX6QDL_PAD_EIM_DA13__EIM_AD13 0xb0b1
370 MX6QDL_PAD_EIM_DA12__EIM_AD12 0xb0b1
371 MX6QDL_PAD_EIM_DA11__EIM_AD11 0xb0b1
372 MX6QDL_PAD_EIM_DA10__EIM_AD10 0xb0b1
373 MX6QDL_PAD_EIM_DA9__EIM_AD09 0xb0b1
374 MX6QDL_PAD_EIM_DA8__EIM_AD08 0xb0b1
375 MX6QDL_PAD_EIM_DA7__EIM_AD07 0xb0b1
376 MX6QDL_PAD_EIM_DA6__EIM_AD06 0xb0b1
377 MX6QDL_PAD_EIM_DA5__EIM_AD05 0xb0b1
378 MX6QDL_PAD_EIM_DA4__EIM_AD04 0xb0b1
379 MX6QDL_PAD_EIM_DA3__EIM_AD03 0xb0b1
380 MX6QDL_PAD_EIM_DA2__EIM_AD02 0xb0b1
381 MX6QDL_PAD_EIM_DA1__EIM_AD01 0xb0b1
382 MX6QDL_PAD_EIM_DA0__EIM_AD00 0xb0b1
383 >;
384 };
385 };
386};
387
388&ldb {
389 status = "okay";
390
391 lvds-channel@0 {
392 fsl,data-mapping = "spwg";
393 fsl,data-width = <18>;
394 status = "okay";
395
396 display-timings {
397 native-mode = <&timing0>;
398 timing0: hsd100pxn1 {
399 clock-frequency = <65000000>;
400 hactive = <1024>;
401 vactive = <768>;
402 hback-porch = <220>;
403 hfront-porch = <40>;
404 vback-porch = <21>;
405 vfront-porch = <7>;
406 hsync-len = <60>;
407 vsync-len = <10>;
408 };
409 };
68 }; 410 };
69}; 411};
70 412
413&pwm3 {
414 pinctrl-names = "default";
415 pinctrl-0 = <&pinctrl_pwm3>;
416 status = "okay";
417};
418
419&spdif {
420 pinctrl-names = "default";
421 pinctrl-0 = <&pinctrl_spdif>;
422 status = "okay";
423};
424
71&uart4 { 425&uart4 {
72 pinctrl-names = "default"; 426 pinctrl-names = "default";
73 pinctrl-0 = <&pinctrl_uart4_1>; 427 pinctrl-0 = <&pinctrl_uart4>;
74 status = "okay"; 428 status = "okay";
75}; 429};
76 430
77&usdhc3 { 431&usdhc3 {
78 pinctrl-names = "default", "state_100mhz", "state_200mhz"; 432 pinctrl-names = "default", "state_100mhz", "state_200mhz";
79 pinctrl-0 = <&pinctrl_usdhc3_1>; 433 pinctrl-0 = <&pinctrl_usdhc3>;
80 pinctrl-1 = <&pinctrl_usdhc3_1_100mhz>; 434 pinctrl-1 = <&pinctrl_usdhc3_100mhz>;
81 pinctrl-2 = <&pinctrl_usdhc3_1_200mhz>; 435 pinctrl-2 = <&pinctrl_usdhc3_200mhz>;
82 cd-gpios = <&gpio6 15 0>; 436 cd-gpios = <&gpio6 15 0>;
83 wp-gpios = <&gpio1 13 0>; 437 wp-gpios = <&gpio1 13 0>;
84 status = "okay"; 438 status = "okay";
@@ -86,7 +440,7 @@
86 440
87&weim { 441&weim {
88 pinctrl-names = "default"; 442 pinctrl-names = "default";
89 pinctrl-0 = <&pinctrl_weim_nor_1 &pinctrl_weim_cs0_1>; 443 pinctrl-0 = <&pinctrl_weim_nor &pinctrl_weim_cs0>;
90 #address-cells = <2>; 444 #address-cells = <2>;
91 #size-cells = <1>; 445 #size-cells = <1>;
92 ranges = <0 0 0x08000000 0x08000000>; 446 ranges = <0 0 0x08000000 0x08000000>;
diff --git a/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi
new file mode 100644
index 000000000000..3bec128c7971
--- /dev/null
+++ b/arch/arm/boot/dts/imx6qdl-sabrelite.dtsi
@@ -0,0 +1,423 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc.
3 * Copyright 2011 Linaro Ltd.
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#include <dt-bindings/gpio/gpio.h>
13#include <dt-bindings/input/input.h>
14
15/ {
16 memory {
17 reg = <0x10000000 0x40000000>;
18 };
19
20 regulators {
21 compatible = "simple-bus";
22 #address-cells = <1>;
23 #size-cells = <0>;
24
25 reg_2p5v: regulator@0 {
26 compatible = "regulator-fixed";
27 reg = <0>;
28 regulator-name = "2P5V";
29 regulator-min-microvolt = <2500000>;
30 regulator-max-microvolt = <2500000>;
31 regulator-always-on;
32 };
33
34 reg_3p3v: regulator@1 {
35 compatible = "regulator-fixed";
36 reg = <1>;
37 regulator-name = "3P3V";
38 regulator-min-microvolt = <3300000>;
39 regulator-max-microvolt = <3300000>;
40 regulator-always-on;
41 };
42
43 reg_usb_otg_vbus: regulator@2 {
44 compatible = "regulator-fixed";
45 reg = <2>;
46 regulator-name = "usb_otg_vbus";
47 regulator-min-microvolt = <5000000>;
48 regulator-max-microvolt = <5000000>;
49 gpio = <&gpio3 22 0>;
50 enable-active-high;
51 };
52 };
53
54 gpio-keys {
55 compatible = "gpio-keys";
56 pinctrl-names = "default";
57 pinctrl-0 = <&pinctrl_gpio_keys>;
58
59 power {
60 label = "Power Button";
61 gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
62 linux,code = <KEY_POWER>;
63 gpio-key,wakeup;
64 };
65
66 menu {
67 label = "Menu";
68 gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
69 linux,code = <KEY_MENU>;
70 };
71
72 home {
73 label = "Home";
74 gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
75 linux,code = <KEY_HOME>;
76 };
77
78 back {
79 label = "Back";
80 gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
81 linux,code = <KEY_BACK>;
82 };
83
84 volume-up {
85 label = "Volume Up";
86 gpios = <&gpio7 13 GPIO_ACTIVE_LOW>;
87 linux,code = <KEY_VOLUMEUP>;
88 };
89
90 volume-down {
91 label = "Volume Down";
92 gpios = <&gpio4 5 GPIO_ACTIVE_LOW>;
93 linux,code = <KEY_VOLUMEDOWN>;
94 };
95 };
96
97 sound {
98 compatible = "fsl,imx6q-sabrelite-sgtl5000",
99 "fsl,imx-audio-sgtl5000";
100 model = "imx6q-sabrelite-sgtl5000";
101 ssi-controller = <&ssi1>;
102 audio-codec = <&codec>;
103 audio-routing =
104 "MIC_IN", "Mic Jack",
105 "Mic Jack", "Mic Bias",
106 "Headphone Jack", "HP_OUT";
107 mux-int-port = <1>;
108 mux-ext-port = <4>;
109 };
110
111 backlight_lcd {
112 compatible = "pwm-backlight";
113 pwms = <&pwm1 0 5000000>;
114 brightness-levels = <0 4 8 16 32 64 128 255>;
115 default-brightness-level = <7>;
116 power-supply = <&reg_3p3v>;
117 status = "okay";
118 };
119
120 backlight_lvds {
121 compatible = "pwm-backlight";
122 pwms = <&pwm4 0 5000000>;
123 brightness-levels = <0 4 8 16 32 64 128 255>;
124 default-brightness-level = <7>;
125 power-supply = <&reg_3p3v>;
126 status = "okay";
127 };
128};
129
130&audmux {
131 pinctrl-names = "default";
132 pinctrl-0 = <&pinctrl_audmux>;
133 status = "okay";
134};
135
136&ecspi1 {
137 fsl,spi-num-chipselects = <1>;
138 cs-gpios = <&gpio3 19 0>;
139 pinctrl-names = "default";
140 pinctrl-0 = <&pinctrl_ecspi1>;
141 status = "okay";
142
143 flash: m25p80@0 {
144 compatible = "sst,sst25vf016b";
145 spi-max-frequency = <20000000>;
146 reg = <0>;
147 };
148};
149
150&fec {
151 pinctrl-names = "default";
152 pinctrl-0 = <&pinctrl_enet>;
153 phy-mode = "rgmii";
154 phy-reset-gpios = <&gpio3 23 GPIO_ACTIVE_LOW>;
155 txen-skew-ps = <0>;
156 txc-skew-ps = <3000>;
157 rxdv-skew-ps = <0>;
158 rxc-skew-ps = <3000>;
159 rxd0-skew-ps = <0>;
160 rxd1-skew-ps = <0>;
161 rxd2-skew-ps = <0>;
162 rxd3-skew-ps = <0>;
163 txd0-skew-ps = <0>;
164 txd1-skew-ps = <0>;
165 txd2-skew-ps = <0>;
166 txd3-skew-ps = <0>;
167 interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_HIGH>,
168 <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>;
169 status = "okay";
170};
171
172&i2c1 {
173 clock-frequency = <100000>;
174 pinctrl-names = "default";
175 pinctrl-0 = <&pinctrl_i2c1>;
176 status = "okay";
177
178 codec: sgtl5000@0a {
179 compatible = "fsl,sgtl5000";
180 reg = <0x0a>;
181 clocks = <&clks 201>;
182 VDDA-supply = <&reg_2p5v>;
183 VDDIO-supply = <&reg_3p3v>;
184 };
185};
186
187&iomuxc {
188 pinctrl-names = "default";
189 pinctrl-0 = <&pinctrl_hog>;
190
191 imx6q-sabrelite {
192 pinctrl_hog: hoggrp {
193 fsl,pins = <
194 /* SGTL5000 sys_mclk */
195 MX6QDL_PAD_GPIO_0__CCM_CLKO1 0x030b0
196 >;
197 };
198
199 pinctrl_audmux: audmuxgrp {
200 fsl,pins = <
201 MX6QDL_PAD_SD2_DAT0__AUD4_RXD 0x130b0
202 MX6QDL_PAD_SD2_DAT3__AUD4_TXC 0x130b0
203 MX6QDL_PAD_SD2_DAT2__AUD4_TXD 0x110b0
204 MX6QDL_PAD_SD2_DAT1__AUD4_TXFS 0x130b0
205 >;
206 };
207
208 pinctrl_ecspi1: ecspi1grp {
209 fsl,pins = <
210 MX6QDL_PAD_EIM_D17__ECSPI1_MISO 0x100b1
211 MX6QDL_PAD_EIM_D18__ECSPI1_MOSI 0x100b1
212 MX6QDL_PAD_EIM_D16__ECSPI1_SCLK 0x100b1
213 MX6QDL_PAD_EIM_D19__GPIO3_IO19 0x000b1 /* CS */
214 >;
215 };
216
217 pinctrl_enet: enetgrp {
218 fsl,pins = <
219 MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x100b0
220 MX6QDL_PAD_ENET_MDC__ENET_MDC 0x100b0
221 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x100b0
222 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x100b0
223 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x100b0
224 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x100b0
225 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x100b0
226 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x100b0
227 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x100b0
228 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
229 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
230 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
231 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
232 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
233 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
234 /* Phy reset */
235 MX6QDL_PAD_EIM_D23__GPIO3_IO23 0x000b0
236 MX6QDL_PAD_GPIO_6__ENET_IRQ 0x000b1
237 >;
238 };
239
240 pinctrl_gpio_keys: gpio_keysgrp {
241 fsl,pins = <
242 /* Power Button */
243 MX6QDL_PAD_NANDF_D3__GPIO2_IO03 0x1b0b0
244 /* Menu Button */
245 MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x1b0b0
246 /* Home Button */
247 MX6QDL_PAD_NANDF_D4__GPIO2_IO04 0x1b0b0
248 /* Back Button */
249 MX6QDL_PAD_NANDF_D2__GPIO2_IO02 0x1b0b0
250 /* Volume Up Button */
251 MX6QDL_PAD_GPIO_18__GPIO7_IO13 0x1b0b0
252 /* Volume Down Button */
253 MX6QDL_PAD_GPIO_19__GPIO4_IO05 0x1b0b0
254 >;
255 };
256
257 pinctrl_i2c1: i2c1grp {
258 fsl,pins = <
259 MX6QDL_PAD_EIM_D21__I2C1_SCL 0x4001b8b1
260 MX6QDL_PAD_EIM_D28__I2C1_SDA 0x4001b8b1
261 >;
262 };
263
264 pinctrl_pwm1: pwm1grp {
265 fsl,pins = <
266 MX6QDL_PAD_SD1_DAT3__PWM1_OUT 0x1b0b1
267 >;
268 };
269
270 pinctrl_pwm3: pwm3grp {
271 fsl,pins = <
272 MX6QDL_PAD_SD1_DAT1__PWM3_OUT 0x1b0b1
273 >;
274 };
275
276 pinctrl_pwm4: pwm4grp {
277 fsl,pins = <
278 MX6QDL_PAD_SD1_CMD__PWM4_OUT 0x1b0b1
279 >;
280 };
281
282 pinctrl_uart1: uart1grp {
283 fsl,pins = <
284 MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA 0x1b0b1
285 MX6QDL_PAD_SD3_DAT6__UART1_RX_DATA 0x1b0b1
286 >;
287 };
288
289 pinctrl_uart2: uart2grp {
290 fsl,pins = <
291 MX6QDL_PAD_EIM_D26__UART2_TX_DATA 0x1b0b1
292 MX6QDL_PAD_EIM_D27__UART2_RX_DATA 0x1b0b1
293 >;
294 };
295
296 pinctrl_usbotg: usbotggrp {
297 fsl,pins = <
298 MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
299 MX6QDL_PAD_KEY_COL4__USB_OTG_OC 0x1b0b0
300 /* power enable, high active */
301 MX6QDL_PAD_EIM_D22__GPIO3_IO22 0x000b0
302 >;
303 };
304
305 pinctrl_usdhc3: usdhc3grp {
306 fsl,pins = <
307 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059
308 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059
309 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059
310 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
311 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
312 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
313 MX6QDL_PAD_SD3_DAT5__GPIO7_IO00 0x1b0b0 /* CD */
314 MX6QDL_PAD_SD3_DAT4__GPIO7_IO01 0x1f0b0 /* WP */
315 >;
316 };
317
318 pinctrl_usdhc4: usdhc4grp {
319 fsl,pins = <
320 MX6QDL_PAD_SD4_CMD__SD4_CMD 0x17059
321 MX6QDL_PAD_SD4_CLK__SD4_CLK 0x10059
322 MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17059
323 MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17059
324 MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17059
325 MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17059
326 MX6QDL_PAD_NANDF_D6__GPIO2_IO06 0x1b0b0 /* CD */
327 >;
328 };
329 };
330};
331
332&ldb {
333 status = "okay";
334
335 lvds-channel@0 {
336 fsl,data-mapping = "spwg";
337 fsl,data-width = <18>;
338 status = "okay";
339
340 display-timings {
341 native-mode = <&timing0>;
342 timing0: hsd100pxn1 {
343 clock-frequency = <65000000>;
344 hactive = <1024>;
345 vactive = <768>;
346 hback-porch = <220>;
347 hfront-porch = <40>;
348 vback-porch = <21>;
349 vfront-porch = <7>;
350 hsync-len = <60>;
351 vsync-len = <10>;
352 };
353 };
354 };
355};
356
357&pcie {
358 status = "okay";
359};
360
361&pwm1 {
362 pinctrl-names = "default";
363 pinctrl-0 = <&pinctrl_pwm1>;
364 status = "okay";
365};
366
367&pwm3 {
368 pinctrl-names = "default";
369 pinctrl-0 = <&pinctrl_pwm3>;
370 status = "okay";
371};
372
373&pwm4 {
374 pinctrl-names = "default";
375 pinctrl-0 = <&pinctrl_pwm4>;
376 status = "okay";
377};
378
379&ssi1 {
380 fsl,mode = "i2s-slave";
381 status = "okay";
382};
383
384&uart1 {
385 pinctrl-names = "default";
386 pinctrl-0 = <&pinctrl_uart1>;
387 status = "okay";
388};
389
390&uart2 {
391 pinctrl-names = "default";
392 pinctrl-0 = <&pinctrl_uart2>;
393 status = "okay";
394};
395
396&usbh1 {
397 status = "okay";
398};
399
400&usbotg {
401 vbus-supply = <&reg_usb_otg_vbus>;
402 pinctrl-names = "default";
403 pinctrl-0 = <&pinctrl_usbotg>;
404 disable-over-current;
405 status = "okay";
406};
407
408&usdhc3 {
409 pinctrl-names = "default";
410 pinctrl-0 = <&pinctrl_usdhc3>;
411 cd-gpios = <&gpio7 0 0>;
412 wp-gpios = <&gpio7 1 0>;
413 vmmc-supply = <&reg_3p3v>;
414 status = "okay";
415};
416
417&usdhc4 {
418 pinctrl-names = "default";
419 pinctrl-0 = <&pinctrl_usdhc4>;
420 cd-gpios = <&gpio2 6 0>;
421 vmmc-supply = <&reg_3p3v>;
422 status = "okay";
423};
diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
index e75e11b36dff..0d816d3be4b6 100644
--- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
@@ -10,6 +10,9 @@
10 * http://www.gnu.org/copyleft/gpl.html 10 * http://www.gnu.org/copyleft/gpl.html
11 */ 11 */
12 12
13#include <dt-bindings/gpio/gpio.h>
14#include <dt-bindings/input/input.h>
15
13/ { 16/ {
14 memory { 17 memory {
15 reg = <0x10000000 0x40000000>; 18 reg = <0x10000000 0x40000000>;
@@ -17,9 +20,12 @@
17 20
18 regulators { 21 regulators {
19 compatible = "simple-bus"; 22 compatible = "simple-bus";
23 #address-cells = <1>;
24 #size-cells = <0>;
20 25
21 reg_usb_otg_vbus: usb_otg_vbus { 26 reg_usb_otg_vbus: regulator@0 {
22 compatible = "regulator-fixed"; 27 compatible = "regulator-fixed";
28 reg = <0>;
23 regulator-name = "usb_otg_vbus"; 29 regulator-name = "usb_otg_vbus";
24 regulator-min-microvolt = <5000000>; 30 regulator-min-microvolt = <5000000>;
25 regulator-max-microvolt = <5000000>; 31 regulator-max-microvolt = <5000000>;
@@ -27,8 +33,9 @@
27 enable-active-high; 33 enable-active-high;
28 }; 34 };
29 35
30 reg_usb_h1_vbus: usb_h1_vbus { 36 reg_usb_h1_vbus: regulator@1 {
31 compatible = "regulator-fixed"; 37 compatible = "regulator-fixed";
38 reg = <1>;
32 regulator-name = "usb_h1_vbus"; 39 regulator-name = "usb_h1_vbus";
33 regulator-min-microvolt = <5000000>; 40 regulator-min-microvolt = <5000000>;
34 regulator-max-microvolt = <5000000>; 41 regulator-max-microvolt = <5000000>;
@@ -36,8 +43,9 @@
36 enable-active-high; 43 enable-active-high;
37 }; 44 };
38 45
39 reg_audio: wm8962_supply { 46 reg_audio: regulator@2 {
40 compatible = "regulator-fixed"; 47 compatible = "regulator-fixed";
48 reg = <2>;
41 regulator-name = "wm8962-supply"; 49 regulator-name = "wm8962-supply";
42 gpio = <&gpio4 10 0>; 50 gpio = <&gpio4 10 0>;
43 enable-active-high; 51 enable-active-high;
@@ -46,19 +54,28 @@
46 54
47 gpio-keys { 55 gpio-keys {
48 compatible = "gpio-keys"; 56 compatible = "gpio-keys";
57 pinctrl-names = "default";
58 pinctrl-0 = <&pinctrl_gpio_keys>;
59
60 power {
61 label = "Power Button";
62 gpios = <&gpio3 29 GPIO_ACTIVE_LOW>;
63 gpio-key,wakeup;
64 linux,code = <KEY_POWER>;
65 };
49 66
50 volume-up { 67 volume-up {
51 label = "Volume Up"; 68 label = "Volume Up";
52 gpios = <&gpio1 4 0>; 69 gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
53 gpio-key,wakeup; 70 gpio-key,wakeup;
54 linux,code = <115>; /* KEY_VOLUMEUP */ 71 linux,code = <KEY_VOLUMEUP>;
55 }; 72 };
56 73
57 volume-down { 74 volume-down {
58 label = "Volume Down"; 75 label = "Volume Down";
59 gpios = <&gpio1 5 0>; 76 gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
60 gpio-key,wakeup; 77 gpio-key,wakeup;
61 linux,code = <114>; /* KEY_VOLUMEDOWN */ 78 linux,code = <KEY_VOLUMEDOWN>;
62 }; 79 };
63 }; 80 };
64 81
@@ -92,7 +109,7 @@
92 109
93&audmux { 110&audmux {
94 pinctrl-names = "default"; 111 pinctrl-names = "default";
95 pinctrl-0 = <&pinctrl_audmux_2>; 112 pinctrl-0 = <&pinctrl_audmux>;
96 status = "okay"; 113 status = "okay";
97}; 114};
98 115
@@ -100,7 +117,7 @@
100 fsl,spi-num-chipselects = <1>; 117 fsl,spi-num-chipselects = <1>;
101 cs-gpios = <&gpio4 9 0>; 118 cs-gpios = <&gpio4 9 0>;
102 pinctrl-names = "default"; 119 pinctrl-names = "default";
103 pinctrl-0 = <&pinctrl_ecspi1_2>; 120 pinctrl-0 = <&pinctrl_ecspi1>;
104 status = "okay"; 121 status = "okay";
105 122
106 flash: m25p80@0 { 123 flash: m25p80@0 {
@@ -114,7 +131,7 @@
114 131
115&fec { 132&fec {
116 pinctrl-names = "default"; 133 pinctrl-names = "default";
117 pinctrl-0 = <&pinctrl_enet_1>; 134 pinctrl-0 = <&pinctrl_enet>;
118 phy-mode = "rgmii"; 135 phy-mode = "rgmii";
119 phy-reset-gpios = <&gpio1 25 0>; 136 phy-reset-gpios = <&gpio1 25 0>;
120 status = "okay"; 137 status = "okay";
@@ -123,7 +140,7 @@
123&i2c1 { 140&i2c1 {
124 clock-frequency = <100000>; 141 clock-frequency = <100000>;
125 pinctrl-names = "default"; 142 pinctrl-names = "default";
126 pinctrl-0 = <&pinctrl_i2c1_2>; 143 pinctrl-0 = <&pinctrl_i2c1>;
127 status = "okay"; 144 status = "okay";
128 145
129 codec: wm8962@1a { 146 codec: wm8962@1a {
@@ -149,10 +166,116 @@
149 }; 166 };
150}; 167};
151 168
169&i2c2 {
170 clock-frequency = <100000>;
171 pinctrl-names = "default";
172 pinctrl-0 = <&pinctrl_i2c2>;
173 status = "okay";
174
175 pmic: pfuze100@08 {
176 compatible = "fsl,pfuze100";
177 reg = <0x08>;
178
179 regulators {
180 sw1a_reg: sw1ab {
181 regulator-min-microvolt = <300000>;
182 regulator-max-microvolt = <1875000>;
183 regulator-boot-on;
184 regulator-always-on;
185 regulator-ramp-delay = <6250>;
186 };
187
188 sw1c_reg: sw1c {
189 regulator-min-microvolt = <300000>;
190 regulator-max-microvolt = <1875000>;
191 regulator-boot-on;
192 regulator-always-on;
193 regulator-ramp-delay = <6250>;
194 };
195
196 sw2_reg: sw2 {
197 regulator-min-microvolt = <800000>;
198 regulator-max-microvolt = <3300000>;
199 regulator-boot-on;
200 regulator-always-on;
201 };
202
203 sw3a_reg: sw3a {
204 regulator-min-microvolt = <400000>;
205 regulator-max-microvolt = <1975000>;
206 regulator-boot-on;
207 regulator-always-on;
208 };
209
210 sw3b_reg: sw3b {
211 regulator-min-microvolt = <400000>;
212 regulator-max-microvolt = <1975000>;
213 regulator-boot-on;
214 regulator-always-on;
215 };
216
217 sw4_reg: sw4 {
218 regulator-min-microvolt = <800000>;
219 regulator-max-microvolt = <3300000>;
220 };
221
222 swbst_reg: swbst {
223 regulator-min-microvolt = <5000000>;
224 regulator-max-microvolt = <5150000>;
225 };
226
227 snvs_reg: vsnvs {
228 regulator-min-microvolt = <1000000>;
229 regulator-max-microvolt = <3000000>;
230 regulator-boot-on;
231 regulator-always-on;
232 };
233
234 vref_reg: vrefddr {
235 regulator-boot-on;
236 regulator-always-on;
237 };
238
239 vgen1_reg: vgen1 {
240 regulator-min-microvolt = <800000>;
241 regulator-max-microvolt = <1550000>;
242 };
243
244 vgen2_reg: vgen2 {
245 regulator-min-microvolt = <800000>;
246 regulator-max-microvolt = <1550000>;
247 };
248
249 vgen3_reg: vgen3 {
250 regulator-min-microvolt = <1800000>;
251 regulator-max-microvolt = <3300000>;
252 };
253
254 vgen4_reg: vgen4 {
255 regulator-min-microvolt = <1800000>;
256 regulator-max-microvolt = <3300000>;
257 regulator-always-on;
258 };
259
260 vgen5_reg: vgen5 {
261 regulator-min-microvolt = <1800000>;
262 regulator-max-microvolt = <3300000>;
263 regulator-always-on;
264 };
265
266 vgen6_reg: vgen6 {
267 regulator-min-microvolt = <1800000>;
268 regulator-max-microvolt = <3300000>;
269 regulator-always-on;
270 };
271 };
272 };
273};
274
152&i2c3 { 275&i2c3 {
153 clock-frequency = <100000>; 276 clock-frequency = <100000>;
154 pinctrl-names = "default"; 277 pinctrl-names = "default";
155 pinctrl-0 = <&pinctrl_i2c3_2>; 278 pinctrl-0 = <&pinctrl_i2c3>;
156 status = "okay"; 279 status = "okay";
157 280
158 egalax_ts@04 { 281 egalax_ts@04 {
@@ -168,11 +291,9 @@
168 pinctrl-names = "default"; 291 pinctrl-names = "default";
169 pinctrl-0 = <&pinctrl_hog>; 292 pinctrl-0 = <&pinctrl_hog>;
170 293
171 hog { 294 imx6qdl-sabresd {
172 pinctrl_hog: hoggrp { 295 pinctrl_hog: hoggrp {
173 fsl,pins = < 296 fsl,pins = <
174 MX6QDL_PAD_GPIO_4__GPIO1_IO04 0x80000000
175 MX6QDL_PAD_GPIO_5__GPIO1_IO05 0x80000000
176 MX6QDL_PAD_NANDF_D0__GPIO2_IO00 0x80000000 297 MX6QDL_PAD_NANDF_D0__GPIO2_IO00 0x80000000
177 MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x80000000 298 MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x80000000
178 MX6QDL_PAD_NANDF_D2__GPIO2_IO02 0x80000000 299 MX6QDL_PAD_NANDF_D2__GPIO2_IO02 0x80000000
@@ -184,6 +305,122 @@
184 MX6QDL_PAD_ENET_CRS_DV__GPIO1_IO25 0x80000000 305 MX6QDL_PAD_ENET_CRS_DV__GPIO1_IO25 0x80000000
185 >; 306 >;
186 }; 307 };
308
309 pinctrl_audmux: audmuxgrp {
310 fsl,pins = <
311 MX6QDL_PAD_CSI0_DAT7__AUD3_RXD 0x130b0
312 MX6QDL_PAD_CSI0_DAT4__AUD3_TXC 0x130b0
313 MX6QDL_PAD_CSI0_DAT5__AUD3_TXD 0x110b0
314 MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS 0x130b0
315 >;
316 };
317
318 pinctrl_ecspi1: ecspi1grp {
319 fsl,pins = <
320 MX6QDL_PAD_KEY_COL1__ECSPI1_MISO 0x100b1
321 MX6QDL_PAD_KEY_ROW0__ECSPI1_MOSI 0x100b1
322 MX6QDL_PAD_KEY_COL0__ECSPI1_SCLK 0x100b1
323 >;
324 };
325
326 pinctrl_enet: enetgrp {
327 fsl,pins = <
328 MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
329 MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
330 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
331 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
332 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
333 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
334 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
335 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
336 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
337 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
338 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
339 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
340 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
341 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
342 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
343 MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0a8
344 >;
345 };
346
347 pinctrl_gpio_keys: gpio_keysgrp {
348 fsl,pins = <
349 MX6QDL_PAD_EIM_D29__GPIO3_IO29 0x80000000
350 MX6QDL_PAD_GPIO_4__GPIO1_IO04 0x80000000
351 MX6QDL_PAD_GPIO_5__GPIO1_IO05 0x80000000
352 >;
353 };
354
355 pinctrl_i2c1: i2c1grp {
356 fsl,pins = <
357 MX6QDL_PAD_CSI0_DAT8__I2C1_SDA 0x4001b8b1
358 MX6QDL_PAD_CSI0_DAT9__I2C1_SCL 0x4001b8b1
359 >;
360 };
361
362 pinctrl_i2c2: i2c2grp {
363 fsl,pins = <
364 MX6QDL_PAD_KEY_COL3__I2C2_SCL 0x4001b8b1
365 MX6QDL_PAD_KEY_ROW3__I2C2_SDA 0x4001b8b1
366 >;
367 };
368
369 pinctrl_i2c3: i2c3grp {
370 fsl,pins = <
371 MX6QDL_PAD_GPIO_3__I2C3_SCL 0x4001b8b1
372 MX6QDL_PAD_GPIO_6__I2C3_SDA 0x4001b8b1
373 >;
374 };
375
376 pinctrl_pwm1: pwm1grp {
377 fsl,pins = <
378 MX6QDL_PAD_SD1_DAT3__PWM1_OUT 0x1b0b1
379 >;
380 };
381
382 pinctrl_uart1: uart1grp {
383 fsl,pins = <
384 MX6QDL_PAD_CSI0_DAT10__UART1_TX_DATA 0x1b0b1
385 MX6QDL_PAD_CSI0_DAT11__UART1_RX_DATA 0x1b0b1
386 >;
387 };
388
389 pinctrl_usbotg: usbotggrp {
390 fsl,pins = <
391 MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID 0x17059
392 >;
393 };
394
395 pinctrl_usdhc2: usdhc2grp {
396 fsl,pins = <
397 MX6QDL_PAD_SD2_CMD__SD2_CMD 0x17059
398 MX6QDL_PAD_SD2_CLK__SD2_CLK 0x10059
399 MX6QDL_PAD_SD2_DAT0__SD2_DATA0 0x17059
400 MX6QDL_PAD_SD2_DAT1__SD2_DATA1 0x17059
401 MX6QDL_PAD_SD2_DAT2__SD2_DATA2 0x17059
402 MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x17059
403 MX6QDL_PAD_NANDF_D4__SD2_DATA4 0x17059
404 MX6QDL_PAD_NANDF_D5__SD2_DATA5 0x17059
405 MX6QDL_PAD_NANDF_D6__SD2_DATA6 0x17059
406 MX6QDL_PAD_NANDF_D7__SD2_DATA7 0x17059
407 >;
408 };
409
410 pinctrl_usdhc3: usdhc3grp {
411 fsl,pins = <
412 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059
413 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059
414 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059
415 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
416 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
417 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
418 MX6QDL_PAD_SD3_DAT4__SD3_DATA4 0x17059
419 MX6QDL_PAD_SD3_DAT5__SD3_DATA5 0x17059
420 MX6QDL_PAD_SD3_DAT6__SD3_DATA6 0x17059
421 MX6QDL_PAD_SD3_DAT7__SD3_DATA7 0x17059
422 >;
423 };
187 }; 424 };
188}; 425};
189 426
@@ -214,7 +451,7 @@
214 451
215&pwm1 { 452&pwm1 {
216 pinctrl-names = "default"; 453 pinctrl-names = "default";
217 pinctrl-0 = <&pinctrl_pwm0_1>; 454 pinctrl-0 = <&pinctrl_pwm1>;
218 status = "okay"; 455 status = "okay";
219}; 456};
220 457
@@ -225,7 +462,7 @@
225 462
226&uart1 { 463&uart1 {
227 pinctrl-names = "default"; 464 pinctrl-names = "default";
228 pinctrl-0 = <&pinctrl_uart1_1>; 465 pinctrl-0 = <&pinctrl_uart1>;
229 status = "okay"; 466 status = "okay";
230}; 467};
231 468
@@ -237,14 +474,14 @@
237&usbotg { 474&usbotg {
238 vbus-supply = <&reg_usb_otg_vbus>; 475 vbus-supply = <&reg_usb_otg_vbus>;
239 pinctrl-names = "default"; 476 pinctrl-names = "default";
240 pinctrl-0 = <&pinctrl_usbotg_2>; 477 pinctrl-0 = <&pinctrl_usbotg>;
241 disable-over-current; 478 disable-over-current;
242 status = "okay"; 479 status = "okay";
243}; 480};
244 481
245&usdhc2 { 482&usdhc2 {
246 pinctrl-names = "default"; 483 pinctrl-names = "default";
247 pinctrl-0 = <&pinctrl_usdhc2_1>; 484 pinctrl-0 = <&pinctrl_usdhc2>;
248 bus-width = <8>; 485 bus-width = <8>;
249 cd-gpios = <&gpio2 2 0>; 486 cd-gpios = <&gpio2 2 0>;
250 wp-gpios = <&gpio2 3 0>; 487 wp-gpios = <&gpio2 3 0>;
@@ -253,7 +490,7 @@
253 490
254&usdhc3 { 491&usdhc3 {
255 pinctrl-names = "default"; 492 pinctrl-names = "default";
256 pinctrl-0 = <&pinctrl_usdhc3_1>; 493 pinctrl-0 = <&pinctrl_usdhc3>;
257 bus-width = <8>; 494 bus-width = <8>;
258 cd-gpios = <&gpio2 0 0>; 495 cd-gpios = <&gpio2 0 0>;
259 wp-gpios = <&gpio2 1 0>; 496 wp-gpios = <&gpio2 1 0>;
diff --git a/arch/arm/boot/dts/imx6qdl-wandboard.dtsi b/arch/arm/boot/dts/imx6qdl-wandboard.dtsi
index 35f547929167..bdfdf89d405f 100644
--- a/arch/arm/boot/dts/imx6qdl-wandboard.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-wandboard.dtsi
@@ -12,17 +12,21 @@
12/ { 12/ {
13 regulators { 13 regulators {
14 compatible = "simple-bus"; 14 compatible = "simple-bus";
15 #address-cells = <1>;
16 #size-cells = <0>;
15 17
16 reg_2p5v: 2p5v { 18 reg_2p5v: regulator@0 {
17 compatible = "regulator-fixed"; 19 compatible = "regulator-fixed";
20 reg = <0>;
18 regulator-name = "2P5V"; 21 regulator-name = "2P5V";
19 regulator-min-microvolt = <2500000>; 22 regulator-min-microvolt = <2500000>;
20 regulator-max-microvolt = <2500000>; 23 regulator-max-microvolt = <2500000>;
21 regulator-always-on; 24 regulator-always-on;
22 }; 25 };
23 26
24 reg_3p3v: 3p3v { 27 reg_3p3v: regulator@1 {
25 compatible = "regulator-fixed"; 28 compatible = "regulator-fixed";
29 reg = <1>;
26 regulator-name = "3P3V"; 30 regulator-name = "3P3V";
27 regulator-min-microvolt = <3300000>; 31 regulator-min-microvolt = <3300000>;
28 regulator-max-microvolt = <3300000>; 32 regulator-max-microvolt = <3300000>;
@@ -54,14 +58,14 @@
54 58
55&audmux { 59&audmux {
56 pinctrl-names = "default"; 60 pinctrl-names = "default";
57 pinctrl-0 = <&pinctrl_audmux_2>; 61 pinctrl-0 = <&pinctrl_audmux>;
58 status = "okay"; 62 status = "okay";
59}; 63};
60 64
61&i2c2 { 65&i2c2 {
62 clock-frequency = <100000>; 66 clock-frequency = <100000>;
63 pinctrl-names = "default"; 67 pinctrl-names = "default";
64 pinctrl-0 = <&pinctrl_i2c2_2>; 68 pinctrl-0 = <&pinctrl_i2c2>;
65 status = "okay"; 69 status = "okay";
66 70
67 codec: sgtl5000@0a { 71 codec: sgtl5000@0a {
@@ -77,7 +81,7 @@
77 pinctrl-names = "default"; 81 pinctrl-names = "default";
78 pinctrl-0 = <&pinctrl_hog>; 82 pinctrl-0 = <&pinctrl_hog>;
79 83
80 hog { 84 imx6qdl-wandboard {
81 pinctrl_hog: hoggrp { 85 pinctrl_hog: hoggrp {
82 fsl,pins = < 86 fsl,pins = <
83 MX6QDL_PAD_GPIO_0__CCM_CLKO1 0x130b0 87 MX6QDL_PAD_GPIO_0__CCM_CLKO1 0x130b0
@@ -91,20 +95,121 @@
91 MX6QDL_PAD_EIM_D29__GPIO3_IO29 0x80000000 95 MX6QDL_PAD_EIM_D29__GPIO3_IO29 0x80000000
92 >; 96 >;
93 }; 97 };
98
99 pinctrl_audmux: audmuxgrp {
100 fsl,pins = <
101 MX6QDL_PAD_CSI0_DAT7__AUD3_RXD 0x130b0
102 MX6QDL_PAD_CSI0_DAT4__AUD3_TXC 0x130b0
103 MX6QDL_PAD_CSI0_DAT5__AUD3_TXD 0x110b0
104 MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS 0x130b0
105 >;
106 };
107
108 pinctrl_enet: enetgrp {
109 fsl,pins = <
110 MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
111 MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
112 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
113 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
114 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
115 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
116 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
117 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
118 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
119 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
120 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
121 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
122 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
123 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
124 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
125 MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0a8
126 MX6QDL_PAD_GPIO_6__ENET_IRQ 0x000b1
127 >;
128 };
129
130 pinctrl_i2c2: i2c2grp {
131 fsl,pins = <
132 MX6QDL_PAD_KEY_COL3__I2C2_SCL 0x4001b8b1
133 MX6QDL_PAD_KEY_ROW3__I2C2_SDA 0x4001b8b1
134 >;
135 };
136
137 pinctrl_spdif: spdifgrp {
138 fsl,pins = <
139 MX6QDL_PAD_ENET_RXD0__SPDIF_OUT 0x1b0b0
140 >;
141 };
142
143 pinctrl_uart1: uart1grp {
144 fsl,pins = <
145 MX6QDL_PAD_CSI0_DAT10__UART1_TX_DATA 0x1b0b1
146 MX6QDL_PAD_CSI0_DAT11__UART1_RX_DATA 0x1b0b1
147 >;
148 };
149
150 pinctrl_uart3: uart3grp {
151 fsl,pins = <
152 MX6QDL_PAD_EIM_D24__UART3_TX_DATA 0x1b0b1
153 MX6QDL_PAD_EIM_D25__UART3_RX_DATA 0x1b0b1
154 MX6QDL_PAD_EIM_D23__UART3_CTS_B 0x1b0b1
155 MX6QDL_PAD_EIM_EB3__UART3_RTS_B 0x1b0b1
156 >;
157 };
158
159 pinctrl_usbotg: usbotggrp {
160 fsl,pins = <
161 MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
162 >;
163 };
164
165 pinctrl_usdhc1: usdhc1grp {
166 fsl,pins = <
167 MX6QDL_PAD_SD1_CMD__SD1_CMD 0x17059
168 MX6QDL_PAD_SD1_CLK__SD1_CLK 0x10059
169 MX6QDL_PAD_SD1_DAT0__SD1_DATA0 0x17059
170 MX6QDL_PAD_SD1_DAT1__SD1_DATA1 0x17059
171 MX6QDL_PAD_SD1_DAT2__SD1_DATA2 0x17059
172 MX6QDL_PAD_SD1_DAT3__SD1_DATA3 0x17059
173 >;
174 };
175
176 pinctrl_usdhc2: usdhc2grp {
177 fsl,pins = <
178 MX6QDL_PAD_SD2_CMD__SD2_CMD 0x17059
179 MX6QDL_PAD_SD2_CLK__SD2_CLK 0x10059
180 MX6QDL_PAD_SD2_DAT0__SD2_DATA0 0x17059
181 MX6QDL_PAD_SD2_DAT1__SD2_DATA1 0x17059
182 MX6QDL_PAD_SD2_DAT2__SD2_DATA2 0x17059
183 MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x17059
184 >;
185 };
186
187 pinctrl_usdhc3: usdhc3grp {
188 fsl,pins = <
189 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059
190 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059
191 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059
192 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
193 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
194 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
195 >;
196 };
94 }; 197 };
95}; 198};
96 199
97&fec { 200&fec {
98 pinctrl-names = "default"; 201 pinctrl-names = "default";
99 pinctrl-0 = <&pinctrl_enet_1>; 202 pinctrl-0 = <&pinctrl_enet>;
100 phy-mode = "rgmii"; 203 phy-mode = "rgmii";
101 phy-reset-gpios = <&gpio3 29 0>; 204 phy-reset-gpios = <&gpio3 29 0>;
205 interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_HIGH>,
206 <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>;
102 status = "okay"; 207 status = "okay";
103}; 208};
104 209
105&spdif { 210&spdif {
106 pinctrl-names = "default"; 211 pinctrl-names = "default";
107 pinctrl-0 = <&pinctrl_spdif_3>; 212 pinctrl-0 = <&pinctrl_spdif>;
108 status = "okay"; 213 status = "okay";
109}; 214};
110 215
@@ -115,13 +220,13 @@
115 220
116&uart1 { 221&uart1 {
117 pinctrl-names = "default"; 222 pinctrl-names = "default";
118 pinctrl-0 = <&pinctrl_uart1_1>; 223 pinctrl-0 = <&pinctrl_uart1>;
119 status = "okay"; 224 status = "okay";
120}; 225};
121 226
122&uart3 { 227&uart3 {
123 pinctrl-names = "default"; 228 pinctrl-names = "default";
124 pinctrl-0 = <&pinctrl_uart3_2>; 229 pinctrl-0 = <&pinctrl_uart3>;
125 fsl,uart-has-rtscts; 230 fsl,uart-has-rtscts;
126 status = "okay"; 231 status = "okay";
127}; 232};
@@ -132,7 +237,7 @@
132 237
133&usbotg { 238&usbotg {
134 pinctrl-names = "default"; 239 pinctrl-names = "default";
135 pinctrl-0 = <&pinctrl_usbotg_1>; 240 pinctrl-0 = <&pinctrl_usbotg>;
136 disable-over-current; 241 disable-over-current;
137 dr_mode = "peripheral"; 242 dr_mode = "peripheral";
138 status = "okay"; 243 status = "okay";
@@ -140,21 +245,21 @@
140 245
141&usdhc1 { 246&usdhc1 {
142 pinctrl-names = "default"; 247 pinctrl-names = "default";
143 pinctrl-0 = <&pinctrl_usdhc1_2>; 248 pinctrl-0 = <&pinctrl_usdhc1>;
144 cd-gpios = <&gpio1 2 0>; 249 cd-gpios = <&gpio1 2 0>;
145 status = "okay"; 250 status = "okay";
146}; 251};
147 252
148&usdhc2 { 253&usdhc2 {
149 pinctrl-names = "default"; 254 pinctrl-names = "default";
150 pinctrl-0 = <&pinctrl_usdhc2_2>; 255 pinctrl-0 = <&pinctrl_usdhc2>;
151 non-removable; 256 non-removable;
152 status = "okay"; 257 status = "okay";
153}; 258};
154 259
155&usdhc3 { 260&usdhc3 {
156 pinctrl-names = "default"; 261 pinctrl-names = "default";
157 pinctrl-0 = <&pinctrl_usdhc3_2>; 262 pinctrl-0 = <&pinctrl_usdhc3>;
158 cd-gpios = <&gpio3 9 0>; 263 cd-gpios = <&gpio3 9 0>;
159 status = "okay"; 264 status = "okay";
160}; 265};
diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
index fb28b2ecb1db..55cb926fa3f7 100644
--- a/arch/arm/boot/dts/imx6qdl.dtsi
+++ b/arch/arm/boot/dts/imx6qdl.dtsi
@@ -14,6 +14,8 @@
14 14
15/ { 15/ {
16 aliases { 16 aliases {
17 can0 = &can1;
18 can1 = &can2;
17 gpio0 = &gpio1; 19 gpio0 = &gpio1;
18 gpio1 = &gpio2; 20 gpio1 = &gpio2;
19 gpio2 = &gpio3; 21 gpio2 = &gpio3;
@@ -24,6 +26,10 @@
24 i2c0 = &i2c1; 26 i2c0 = &i2c1;
25 i2c1 = &i2c2; 27 i2c1 = &i2c2;
26 i2c2 = &i2c3; 28 i2c2 = &i2c3;
29 mmc0 = &usdhc1;
30 mmc1 = &usdhc2;
31 mmc2 = &usdhc3;
32 mmc3 = &usdhc4;
27 serial0 = &uart1; 33 serial0 = &uart1;
28 serial1 = &uart2; 34 serial1 = &uart2;
29 serial2 = &uart3; 35 serial2 = &uart3;
@@ -33,6 +39,8 @@
33 spi1 = &ecspi2; 39 spi1 = &ecspi2;
34 spi2 = &ecspi3; 40 spi2 = &ecspi3;
35 spi3 = &ecspi4; 41 spi3 = &ecspi4;
42 usbphy0 = &usbphy1;
43 usbphy1 = &usbphy2;
36 }; 44 };
37 45
38 intc: interrupt-controller@00a01000 { 46 intc: interrupt-controller@00a01000 {
@@ -75,7 +83,10 @@
75 dma_apbh: dma-apbh@00110000 { 83 dma_apbh: dma-apbh@00110000 {
76 compatible = "fsl,imx6q-dma-apbh", "fsl,imx28-dma-apbh"; 84 compatible = "fsl,imx6q-dma-apbh", "fsl,imx28-dma-apbh";
77 reg = <0x00110000 0x2000>; 85 reg = <0x00110000 0x2000>;
78 interrupts = <0 13 0x04>, <0 13 0x04>, <0 13 0x04>, <0 13 0x04>; 86 interrupts = <0 13 IRQ_TYPE_LEVEL_HIGH>,
87 <0 13 IRQ_TYPE_LEVEL_HIGH>,
88 <0 13 IRQ_TYPE_LEVEL_HIGH>,
89 <0 13 IRQ_TYPE_LEVEL_HIGH>;
79 interrupt-names = "gpmi0", "gpmi1", "gpmi2", "gpmi3"; 90 interrupt-names = "gpmi0", "gpmi1", "gpmi2", "gpmi3";
80 #dma-cells = <1>; 91 #dma-cells = <1>;
81 dma-channels = <4>; 92 dma-channels = <4>;
@@ -88,7 +99,7 @@
88 #size-cells = <1>; 99 #size-cells = <1>;
89 reg = <0x00112000 0x2000>, <0x00114000 0x2000>; 100 reg = <0x00112000 0x2000>, <0x00114000 0x2000>;
90 reg-names = "gpmi-nand", "bch"; 101 reg-names = "gpmi-nand", "bch";
91 interrupts = <0 15 0x04>; 102 interrupts = <0 15 IRQ_TYPE_LEVEL_HIGH>;
92 interrupt-names = "bch"; 103 interrupt-names = "bch";
93 clocks = <&clks 152>, <&clks 153>, <&clks 151>, 104 clocks = <&clks 152>, <&clks 153>, <&clks 151>,
94 <&clks 150>, <&clks 149>; 105 <&clks 150>, <&clks 149>;
@@ -109,7 +120,7 @@
109 L2: l2-cache@00a02000 { 120 L2: l2-cache@00a02000 {
110 compatible = "arm,pl310-cache"; 121 compatible = "arm,pl310-cache";
111 reg = <0x00a02000 0x1000>; 122 reg = <0x00a02000 0x1000>;
112 interrupts = <0 92 0x04>; 123 interrupts = <0 92 IRQ_TYPE_LEVEL_HIGH>;
113 cache-unified; 124 cache-unified;
114 cache-level = <2>; 125 cache-level = <2>;
115 arm,tag-latency = <4 2 3>; 126 arm,tag-latency = <4 2 3>;
@@ -126,7 +137,7 @@
126 0x81000000 0 0 0x01f80000 0 0x00010000 /* downstream I/O */ 137 0x81000000 0 0 0x01f80000 0 0x00010000 /* downstream I/O */
127 0x82000000 0 0x01000000 0x01000000 0 0x00f00000>; /* non-prefetchable memory */ 138 0x82000000 0 0x01000000 0x01000000 0 0x00f00000>; /* non-prefetchable memory */
128 num-lanes = <1>; 139 num-lanes = <1>;
129 interrupts = <0 123 0x04>; 140 interrupts = <0 123 IRQ_TYPE_LEVEL_HIGH>;
130 clocks = <&clks 189>, <&clks 187>, <&clks 206>, <&clks 144>; 141 clocks = <&clks 189>, <&clks 187>, <&clks 206>, <&clks 144>;
131 clock-names = "pcie_ref_125m", "sata_ref_100m", "lvds_gate", "pcie_axi"; 142 clock-names = "pcie_ref_125m", "sata_ref_100m", "lvds_gate", "pcie_axi";
132 status = "disabled"; 143 status = "disabled";
@@ -134,7 +145,7 @@
134 145
135 pmu { 146 pmu {
136 compatible = "arm,cortex-a9-pmu"; 147 compatible = "arm,cortex-a9-pmu";
137 interrupts = <0 94 0x04>; 148 interrupts = <0 94 IRQ_TYPE_LEVEL_HIGH>;
138 }; 149 };
139 150
140 aips-bus@02000000 { /* AIPS1 */ 151 aips-bus@02000000 { /* AIPS1 */
@@ -154,7 +165,7 @@
154 spdif: spdif@02004000 { 165 spdif: spdif@02004000 {
155 compatible = "fsl,imx35-spdif"; 166 compatible = "fsl,imx35-spdif";
156 reg = <0x02004000 0x4000>; 167 reg = <0x02004000 0x4000>;
157 interrupts = <0 52 0x04>; 168 interrupts = <0 52 IRQ_TYPE_LEVEL_HIGH>;
158 dmas = <&sdma 14 18 0>, 169 dmas = <&sdma 14 18 0>,
159 <&sdma 15 18 0>; 170 <&sdma 15 18 0>;
160 dma-names = "rx", "tx"; 171 dma-names = "rx", "tx";
@@ -176,9 +187,11 @@
176 #size-cells = <0>; 187 #size-cells = <0>;
177 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi"; 188 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
178 reg = <0x02008000 0x4000>; 189 reg = <0x02008000 0x4000>;
179 interrupts = <0 31 0x04>; 190 interrupts = <0 31 IRQ_TYPE_LEVEL_HIGH>;
180 clocks = <&clks 112>, <&clks 112>; 191 clocks = <&clks 112>, <&clks 112>;
181 clock-names = "ipg", "per"; 192 clock-names = "ipg", "per";
193 dmas = <&sdma 3 7 1>, <&sdma 4 7 2>;
194 dma-names = "rx", "tx";
182 status = "disabled"; 195 status = "disabled";
183 }; 196 };
184 197
@@ -187,9 +200,11 @@
187 #size-cells = <0>; 200 #size-cells = <0>;
188 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi"; 201 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
189 reg = <0x0200c000 0x4000>; 202 reg = <0x0200c000 0x4000>;
190 interrupts = <0 32 0x04>; 203 interrupts = <0 32 IRQ_TYPE_LEVEL_HIGH>;
191 clocks = <&clks 113>, <&clks 113>; 204 clocks = <&clks 113>, <&clks 113>;
192 clock-names = "ipg", "per"; 205 clock-names = "ipg", "per";
206 dmas = <&sdma 5 7 1>, <&sdma 6 7 2>;
207 dma-names = "rx", "tx";
193 status = "disabled"; 208 status = "disabled";
194 }; 209 };
195 210
@@ -198,9 +213,11 @@
198 #size-cells = <0>; 213 #size-cells = <0>;
199 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi"; 214 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
200 reg = <0x02010000 0x4000>; 215 reg = <0x02010000 0x4000>;
201 interrupts = <0 33 0x04>; 216 interrupts = <0 33 IRQ_TYPE_LEVEL_HIGH>;
202 clocks = <&clks 114>, <&clks 114>; 217 clocks = <&clks 114>, <&clks 114>;
203 clock-names = "ipg", "per"; 218 clock-names = "ipg", "per";
219 dmas = <&sdma 7 7 1>, <&sdma 8 7 2>;
220 dma-names = "rx", "tx";
204 status = "disabled"; 221 status = "disabled";
205 }; 222 };
206 223
@@ -209,16 +226,18 @@
209 #size-cells = <0>; 226 #size-cells = <0>;
210 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi"; 227 compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";
211 reg = <0x02014000 0x4000>; 228 reg = <0x02014000 0x4000>;
212 interrupts = <0 34 0x04>; 229 interrupts = <0 34 IRQ_TYPE_LEVEL_HIGH>;
213 clocks = <&clks 115>, <&clks 115>; 230 clocks = <&clks 115>, <&clks 115>;
214 clock-names = "ipg", "per"; 231 clock-names = "ipg", "per";
232 dmas = <&sdma 9 7 1>, <&sdma 10 7 2>;
233 dma-names = "rx", "tx";
215 status = "disabled"; 234 status = "disabled";
216 }; 235 };
217 236
218 uart1: serial@02020000 { 237 uart1: serial@02020000 {
219 compatible = "fsl,imx6q-uart", "fsl,imx21-uart"; 238 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
220 reg = <0x02020000 0x4000>; 239 reg = <0x02020000 0x4000>;
221 interrupts = <0 26 0x04>; 240 interrupts = <0 26 IRQ_TYPE_LEVEL_HIGH>;
222 clocks = <&clks 160>, <&clks 161>; 241 clocks = <&clks 160>, <&clks 161>;
223 clock-names = "ipg", "per"; 242 clock-names = "ipg", "per";
224 dmas = <&sdma 25 4 0>, <&sdma 26 4 0>; 243 dmas = <&sdma 25 4 0>, <&sdma 26 4 0>;
@@ -228,13 +247,15 @@
228 247
229 esai: esai@02024000 { 248 esai: esai@02024000 {
230 reg = <0x02024000 0x4000>; 249 reg = <0x02024000 0x4000>;
231 interrupts = <0 51 0x04>; 250 interrupts = <0 51 IRQ_TYPE_LEVEL_HIGH>;
232 }; 251 };
233 252
234 ssi1: ssi@02028000 { 253 ssi1: ssi@02028000 {
235 compatible = "fsl,imx6q-ssi","fsl,imx21-ssi"; 254 compatible = "fsl,imx6q-ssi",
255 "fsl,imx51-ssi",
256 "fsl,imx21-ssi";
236 reg = <0x02028000 0x4000>; 257 reg = <0x02028000 0x4000>;
237 interrupts = <0 46 0x04>; 258 interrupts = <0 46 IRQ_TYPE_LEVEL_HIGH>;
238 clocks = <&clks 178>; 259 clocks = <&clks 178>;
239 dmas = <&sdma 37 1 0>, 260 dmas = <&sdma 37 1 0>,
240 <&sdma 38 1 0>; 261 <&sdma 38 1 0>;
@@ -245,9 +266,11 @@
245 }; 266 };
246 267
247 ssi2: ssi@0202c000 { 268 ssi2: ssi@0202c000 {
248 compatible = "fsl,imx6q-ssi","fsl,imx21-ssi"; 269 compatible = "fsl,imx6q-ssi",
270 "fsl,imx51-ssi",
271 "fsl,imx21-ssi";
249 reg = <0x0202c000 0x4000>; 272 reg = <0x0202c000 0x4000>;
250 interrupts = <0 47 0x04>; 273 interrupts = <0 47 IRQ_TYPE_LEVEL_HIGH>;
251 clocks = <&clks 179>; 274 clocks = <&clks 179>;
252 dmas = <&sdma 41 1 0>, 275 dmas = <&sdma 41 1 0>,
253 <&sdma 42 1 0>; 276 <&sdma 42 1 0>;
@@ -258,9 +281,11 @@
258 }; 281 };
259 282
260 ssi3: ssi@02030000 { 283 ssi3: ssi@02030000 {
261 compatible = "fsl,imx6q-ssi","fsl,imx21-ssi"; 284 compatible = "fsl,imx6q-ssi",
285 "fsl,imx51-ssi",
286 "fsl,imx21-ssi";
262 reg = <0x02030000 0x4000>; 287 reg = <0x02030000 0x4000>;
263 interrupts = <0 48 0x04>; 288 interrupts = <0 48 IRQ_TYPE_LEVEL_HIGH>;
264 clocks = <&clks 180>; 289 clocks = <&clks 180>;
265 dmas = <&sdma 45 1 0>, 290 dmas = <&sdma 45 1 0>,
266 <&sdma 46 1 0>; 291 <&sdma 46 1 0>;
@@ -272,7 +297,7 @@
272 297
273 asrc: asrc@02034000 { 298 asrc: asrc@02034000 {
274 reg = <0x02034000 0x4000>; 299 reg = <0x02034000 0x4000>;
275 interrupts = <0 50 0x04>; 300 interrupts = <0 50 IRQ_TYPE_LEVEL_HIGH>;
276 }; 301 };
277 302
278 spba@0203c000 { 303 spba@0203c000 {
@@ -282,7 +307,8 @@
282 307
283 vpu: vpu@02040000 { 308 vpu: vpu@02040000 {
284 reg = <0x02040000 0x3c000>; 309 reg = <0x02040000 0x3c000>;
285 interrupts = <0 3 0x04 0 12 0x04>; 310 interrupts = <0 3 IRQ_TYPE_LEVEL_HIGH>,
311 <0 12 IRQ_TYPE_LEVEL_HIGH>;
286 }; 312 };
287 313
288 aipstz@0207c000 { /* AIPSTZ1 */ 314 aipstz@0207c000 { /* AIPSTZ1 */
@@ -293,7 +319,7 @@
293 #pwm-cells = <2>; 319 #pwm-cells = <2>;
294 compatible = "fsl,imx6q-pwm", "fsl,imx27-pwm"; 320 compatible = "fsl,imx6q-pwm", "fsl,imx27-pwm";
295 reg = <0x02080000 0x4000>; 321 reg = <0x02080000 0x4000>;
296 interrupts = <0 83 0x04>; 322 interrupts = <0 83 IRQ_TYPE_LEVEL_HIGH>;
297 clocks = <&clks 62>, <&clks 145>; 323 clocks = <&clks 62>, <&clks 145>;
298 clock-names = "ipg", "per"; 324 clock-names = "ipg", "per";
299 }; 325 };
@@ -302,7 +328,7 @@
302 #pwm-cells = <2>; 328 #pwm-cells = <2>;
303 compatible = "fsl,imx6q-pwm", "fsl,imx27-pwm"; 329 compatible = "fsl,imx6q-pwm", "fsl,imx27-pwm";
304 reg = <0x02084000 0x4000>; 330 reg = <0x02084000 0x4000>;
305 interrupts = <0 84 0x04>; 331 interrupts = <0 84 IRQ_TYPE_LEVEL_HIGH>;
306 clocks = <&clks 62>, <&clks 146>; 332 clocks = <&clks 62>, <&clks 146>;
307 clock-names = "ipg", "per"; 333 clock-names = "ipg", "per";
308 }; 334 };
@@ -311,7 +337,7 @@
311 #pwm-cells = <2>; 337 #pwm-cells = <2>;
312 compatible = "fsl,imx6q-pwm", "fsl,imx27-pwm"; 338 compatible = "fsl,imx6q-pwm", "fsl,imx27-pwm";
313 reg = <0x02088000 0x4000>; 339 reg = <0x02088000 0x4000>;
314 interrupts = <0 85 0x04>; 340 interrupts = <0 85 IRQ_TYPE_LEVEL_HIGH>;
315 clocks = <&clks 62>, <&clks 147>; 341 clocks = <&clks 62>, <&clks 147>;
316 clock-names = "ipg", "per"; 342 clock-names = "ipg", "per";
317 }; 343 };
@@ -320,7 +346,7 @@
320 #pwm-cells = <2>; 346 #pwm-cells = <2>;
321 compatible = "fsl,imx6q-pwm", "fsl,imx27-pwm"; 347 compatible = "fsl,imx6q-pwm", "fsl,imx27-pwm";
322 reg = <0x0208c000 0x4000>; 348 reg = <0x0208c000 0x4000>;
323 interrupts = <0 86 0x04>; 349 interrupts = <0 86 IRQ_TYPE_LEVEL_HIGH>;
324 clocks = <&clks 62>, <&clks 148>; 350 clocks = <&clks 62>, <&clks 148>;
325 clock-names = "ipg", "per"; 351 clock-names = "ipg", "per";
326 }; 352 };
@@ -328,23 +354,25 @@
328 can1: flexcan@02090000 { 354 can1: flexcan@02090000 {
329 compatible = "fsl,imx6q-flexcan"; 355 compatible = "fsl,imx6q-flexcan";
330 reg = <0x02090000 0x4000>; 356 reg = <0x02090000 0x4000>;
331 interrupts = <0 110 0x04>; 357 interrupts = <0 110 IRQ_TYPE_LEVEL_HIGH>;
332 clocks = <&clks 108>, <&clks 109>; 358 clocks = <&clks 108>, <&clks 109>;
333 clock-names = "ipg", "per"; 359 clock-names = "ipg", "per";
360 status = "disabled";
334 }; 361 };
335 362
336 can2: flexcan@02094000 { 363 can2: flexcan@02094000 {
337 compatible = "fsl,imx6q-flexcan"; 364 compatible = "fsl,imx6q-flexcan";
338 reg = <0x02094000 0x4000>; 365 reg = <0x02094000 0x4000>;
339 interrupts = <0 111 0x04>; 366 interrupts = <0 111 IRQ_TYPE_LEVEL_HIGH>;
340 clocks = <&clks 110>, <&clks 111>; 367 clocks = <&clks 110>, <&clks 111>;
341 clock-names = "ipg", "per"; 368 clock-names = "ipg", "per";
369 status = "disabled";
342 }; 370 };
343 371
344 gpt: gpt@02098000 { 372 gpt: gpt@02098000 {
345 compatible = "fsl,imx6q-gpt", "fsl,imx31-gpt"; 373 compatible = "fsl,imx6q-gpt", "fsl,imx31-gpt";
346 reg = <0x02098000 0x4000>; 374 reg = <0x02098000 0x4000>;
347 interrupts = <0 55 0x04>; 375 interrupts = <0 55 IRQ_TYPE_LEVEL_HIGH>;
348 clocks = <&clks 119>, <&clks 120>; 376 clocks = <&clks 119>, <&clks 120>;
349 clock-names = "ipg", "per"; 377 clock-names = "ipg", "per";
350 }; 378 };
@@ -352,7 +380,8 @@
352 gpio1: gpio@0209c000 { 380 gpio1: gpio@0209c000 {
353 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; 381 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
354 reg = <0x0209c000 0x4000>; 382 reg = <0x0209c000 0x4000>;
355 interrupts = <0 66 0x04 0 67 0x04>; 383 interrupts = <0 66 IRQ_TYPE_LEVEL_HIGH>,
384 <0 67 IRQ_TYPE_LEVEL_HIGH>;
356 gpio-controller; 385 gpio-controller;
357 #gpio-cells = <2>; 386 #gpio-cells = <2>;
358 interrupt-controller; 387 interrupt-controller;
@@ -362,7 +391,8 @@
362 gpio2: gpio@020a0000 { 391 gpio2: gpio@020a0000 {
363 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; 392 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
364 reg = <0x020a0000 0x4000>; 393 reg = <0x020a0000 0x4000>;
365 interrupts = <0 68 0x04 0 69 0x04>; 394 interrupts = <0 68 IRQ_TYPE_LEVEL_HIGH>,
395 <0 69 IRQ_TYPE_LEVEL_HIGH>;
366 gpio-controller; 396 gpio-controller;
367 #gpio-cells = <2>; 397 #gpio-cells = <2>;
368 interrupt-controller; 398 interrupt-controller;
@@ -372,7 +402,8 @@
372 gpio3: gpio@020a4000 { 402 gpio3: gpio@020a4000 {
373 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; 403 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
374 reg = <0x020a4000 0x4000>; 404 reg = <0x020a4000 0x4000>;
375 interrupts = <0 70 0x04 0 71 0x04>; 405 interrupts = <0 70 IRQ_TYPE_LEVEL_HIGH>,
406 <0 71 IRQ_TYPE_LEVEL_HIGH>;
376 gpio-controller; 407 gpio-controller;
377 #gpio-cells = <2>; 408 #gpio-cells = <2>;
378 interrupt-controller; 409 interrupt-controller;
@@ -382,7 +413,8 @@
382 gpio4: gpio@020a8000 { 413 gpio4: gpio@020a8000 {
383 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; 414 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
384 reg = <0x020a8000 0x4000>; 415 reg = <0x020a8000 0x4000>;
385 interrupts = <0 72 0x04 0 73 0x04>; 416 interrupts = <0 72 IRQ_TYPE_LEVEL_HIGH>,
417 <0 73 IRQ_TYPE_LEVEL_HIGH>;
386 gpio-controller; 418 gpio-controller;
387 #gpio-cells = <2>; 419 #gpio-cells = <2>;
388 interrupt-controller; 420 interrupt-controller;
@@ -392,7 +424,8 @@
392 gpio5: gpio@020ac000 { 424 gpio5: gpio@020ac000 {
393 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; 425 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
394 reg = <0x020ac000 0x4000>; 426 reg = <0x020ac000 0x4000>;
395 interrupts = <0 74 0x04 0 75 0x04>; 427 interrupts = <0 74 IRQ_TYPE_LEVEL_HIGH>,
428 <0 75 IRQ_TYPE_LEVEL_HIGH>;
396 gpio-controller; 429 gpio-controller;
397 #gpio-cells = <2>; 430 #gpio-cells = <2>;
398 interrupt-controller; 431 interrupt-controller;
@@ -402,7 +435,8 @@
402 gpio6: gpio@020b0000 { 435 gpio6: gpio@020b0000 {
403 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; 436 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
404 reg = <0x020b0000 0x4000>; 437 reg = <0x020b0000 0x4000>;
405 interrupts = <0 76 0x04 0 77 0x04>; 438 interrupts = <0 76 IRQ_TYPE_LEVEL_HIGH>,
439 <0 77 IRQ_TYPE_LEVEL_HIGH>;
406 gpio-controller; 440 gpio-controller;
407 #gpio-cells = <2>; 441 #gpio-cells = <2>;
408 interrupt-controller; 442 interrupt-controller;
@@ -412,7 +446,8 @@
412 gpio7: gpio@020b4000 { 446 gpio7: gpio@020b4000 {
413 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; 447 compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio";
414 reg = <0x020b4000 0x4000>; 448 reg = <0x020b4000 0x4000>;
415 interrupts = <0 78 0x04 0 79 0x04>; 449 interrupts = <0 78 IRQ_TYPE_LEVEL_HIGH>,
450 <0 79 IRQ_TYPE_LEVEL_HIGH>;
416 gpio-controller; 451 gpio-controller;
417 #gpio-cells = <2>; 452 #gpio-cells = <2>;
418 interrupt-controller; 453 interrupt-controller;
@@ -421,20 +456,20 @@
421 456
422 kpp: kpp@020b8000 { 457 kpp: kpp@020b8000 {
423 reg = <0x020b8000 0x4000>; 458 reg = <0x020b8000 0x4000>;
424 interrupts = <0 82 0x04>; 459 interrupts = <0 82 IRQ_TYPE_LEVEL_HIGH>;
425 }; 460 };
426 461
427 wdog1: wdog@020bc000 { 462 wdog1: wdog@020bc000 {
428 compatible = "fsl,imx6q-wdt", "fsl,imx21-wdt"; 463 compatible = "fsl,imx6q-wdt", "fsl,imx21-wdt";
429 reg = <0x020bc000 0x4000>; 464 reg = <0x020bc000 0x4000>;
430 interrupts = <0 80 0x04>; 465 interrupts = <0 80 IRQ_TYPE_LEVEL_HIGH>;
431 clocks = <&clks 0>; 466 clocks = <&clks 0>;
432 }; 467 };
433 468
434 wdog2: wdog@020c0000 { 469 wdog2: wdog@020c0000 {
435 compatible = "fsl,imx6q-wdt", "fsl,imx21-wdt"; 470 compatible = "fsl,imx6q-wdt", "fsl,imx21-wdt";
436 reg = <0x020c0000 0x4000>; 471 reg = <0x020c0000 0x4000>;
437 interrupts = <0 81 0x04>; 472 interrupts = <0 81 IRQ_TYPE_LEVEL_HIGH>;
438 clocks = <&clks 0>; 473 clocks = <&clks 0>;
439 status = "disabled"; 474 status = "disabled";
440 }; 475 };
@@ -442,14 +477,17 @@
442 clks: ccm@020c4000 { 477 clks: ccm@020c4000 {
443 compatible = "fsl,imx6q-ccm"; 478 compatible = "fsl,imx6q-ccm";
444 reg = <0x020c4000 0x4000>; 479 reg = <0x020c4000 0x4000>;
445 interrupts = <0 87 0x04 0 88 0x04>; 480 interrupts = <0 87 IRQ_TYPE_LEVEL_HIGH>,
481 <0 88 IRQ_TYPE_LEVEL_HIGH>;
446 #clock-cells = <1>; 482 #clock-cells = <1>;
447 }; 483 };
448 484
449 anatop: anatop@020c8000 { 485 anatop: anatop@020c8000 {
450 compatible = "fsl,imx6q-anatop", "syscon", "simple-bus"; 486 compatible = "fsl,imx6q-anatop", "syscon", "simple-bus";
451 reg = <0x020c8000 0x1000>; 487 reg = <0x020c8000 0x1000>;
452 interrupts = <0 49 0x04 0 54 0x04 0 127 0x04>; 488 interrupts = <0 49 IRQ_TYPE_LEVEL_HIGH>,
489 <0 54 IRQ_TYPE_LEVEL_HIGH>,
490 <0 127 IRQ_TYPE_LEVEL_HIGH>;
453 491
454 regulator-1p1@110 { 492 regulator-1p1@110 {
455 compatible = "fsl,anatop-regulator"; 493 compatible = "fsl,anatop-regulator";
@@ -495,7 +533,7 @@
495 533
496 reg_arm: regulator-vddcore@140 { 534 reg_arm: regulator-vddcore@140 {
497 compatible = "fsl,anatop-regulator"; 535 compatible = "fsl,anatop-regulator";
498 regulator-name = "cpu"; 536 regulator-name = "vddarm";
499 regulator-min-microvolt = <725000>; 537 regulator-min-microvolt = <725000>;
500 regulator-max-microvolt = <1450000>; 538 regulator-max-microvolt = <1450000>;
501 regulator-always-on; 539 regulator-always-on;
@@ -547,23 +585,26 @@
547 585
548 tempmon: tempmon { 586 tempmon: tempmon {
549 compatible = "fsl,imx6q-tempmon"; 587 compatible = "fsl,imx6q-tempmon";
550 interrupts = <0 49 0x04>; 588 interrupts = <0 49 IRQ_TYPE_LEVEL_HIGH>;
551 fsl,tempmon = <&anatop>; 589 fsl,tempmon = <&anatop>;
552 fsl,tempmon-data = <&ocotp>; 590 fsl,tempmon-data = <&ocotp>;
591 clocks = <&clks 172>;
553 }; 592 };
554 593
555 usbphy1: usbphy@020c9000 { 594 usbphy1: usbphy@020c9000 {
556 compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy"; 595 compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy";
557 reg = <0x020c9000 0x1000>; 596 reg = <0x020c9000 0x1000>;
558 interrupts = <0 44 0x04>; 597 interrupts = <0 44 IRQ_TYPE_LEVEL_HIGH>;
559 clocks = <&clks 182>; 598 clocks = <&clks 182>;
599 fsl,anatop = <&anatop>;
560 }; 600 };
561 601
562 usbphy2: usbphy@020ca000 { 602 usbphy2: usbphy@020ca000 {
563 compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy"; 603 compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy";
564 reg = <0x020ca000 0x1000>; 604 reg = <0x020ca000 0x1000>;
565 interrupts = <0 45 0x04>; 605 interrupts = <0 45 IRQ_TYPE_LEVEL_HIGH>;
566 clocks = <&clks 183>; 606 clocks = <&clks 183>;
607 fsl,anatop = <&anatop>;
567 }; 608 };
568 609
569 snvs@020cc000 { 610 snvs@020cc000 {
@@ -575,31 +616,34 @@
575 snvs-rtc-lp@34 { 616 snvs-rtc-lp@34 {
576 compatible = "fsl,sec-v4.0-mon-rtc-lp"; 617 compatible = "fsl,sec-v4.0-mon-rtc-lp";
577 reg = <0x34 0x58>; 618 reg = <0x34 0x58>;
578 interrupts = <0 19 0x04 0 20 0x04>; 619 interrupts = <0 19 IRQ_TYPE_LEVEL_HIGH>,
620 <0 20 IRQ_TYPE_LEVEL_HIGH>;
579 }; 621 };
580 }; 622 };
581 623
582 epit1: epit@020d0000 { /* EPIT1 */ 624 epit1: epit@020d0000 { /* EPIT1 */
583 reg = <0x020d0000 0x4000>; 625 reg = <0x020d0000 0x4000>;
584 interrupts = <0 56 0x04>; 626 interrupts = <0 56 IRQ_TYPE_LEVEL_HIGH>;
585 }; 627 };
586 628
587 epit2: epit@020d4000 { /* EPIT2 */ 629 epit2: epit@020d4000 { /* EPIT2 */
588 reg = <0x020d4000 0x4000>; 630 reg = <0x020d4000 0x4000>;
589 interrupts = <0 57 0x04>; 631 interrupts = <0 57 IRQ_TYPE_LEVEL_HIGH>;
590 }; 632 };
591 633
592 src: src@020d8000 { 634 src: src@020d8000 {
593 compatible = "fsl,imx6q-src", "fsl,imx51-src"; 635 compatible = "fsl,imx6q-src", "fsl,imx51-src";
594 reg = <0x020d8000 0x4000>; 636 reg = <0x020d8000 0x4000>;
595 interrupts = <0 91 0x04 0 96 0x04>; 637 interrupts = <0 91 IRQ_TYPE_LEVEL_HIGH>,
638 <0 96 IRQ_TYPE_LEVEL_HIGH>;
596 #reset-cells = <1>; 639 #reset-cells = <1>;
597 }; 640 };
598 641
599 gpc: gpc@020dc000 { 642 gpc: gpc@020dc000 {
600 compatible = "fsl,imx6q-gpc"; 643 compatible = "fsl,imx6q-gpc";
601 reg = <0x020dc000 0x4000>; 644 reg = <0x020dc000 0x4000>;
602 interrupts = <0 89 0x04 0 90 0x04>; 645 interrupts = <0 89 IRQ_TYPE_LEVEL_HIGH>,
646 <0 90 IRQ_TYPE_LEVEL_HIGH>;
603 }; 647 };
604 648
605 gpr: iomuxc-gpr@020e0000 { 649 gpr: iomuxc-gpr@020e0000 {
@@ -610,778 +654,103 @@
610 iomuxc: iomuxc@020e0000 { 654 iomuxc: iomuxc@020e0000 {
611 compatible = "fsl,imx6dl-iomuxc", "fsl,imx6q-iomuxc"; 655 compatible = "fsl,imx6dl-iomuxc", "fsl,imx6q-iomuxc";
612 reg = <0x020e0000 0x4000>; 656 reg = <0x020e0000 0x4000>;
657 };
613 658
614 audmux { 659 ldb: ldb@020e0008 {
615 pinctrl_audmux_1: audmux-1 { 660 #address-cells = <1>;
616 fsl,pins = < 661 #size-cells = <0>;
617 MX6QDL_PAD_SD2_DAT0__AUD4_RXD 0x80000000 662 compatible = "fsl,imx6q-ldb", "fsl,imx53-ldb";
618 MX6QDL_PAD_SD2_DAT3__AUD4_TXC 0x80000000 663 gpr = <&gpr>;
619 MX6QDL_PAD_SD2_DAT2__AUD4_TXD 0x80000000 664 status = "disabled";
620 MX6QDL_PAD_SD2_DAT1__AUD4_TXFS 0x80000000
621 >;
622 };
623
624 pinctrl_audmux_2: audmux-2 {
625 fsl,pins = <
626 MX6QDL_PAD_CSI0_DAT7__AUD3_RXD 0x80000000
627 MX6QDL_PAD_CSI0_DAT4__AUD3_TXC 0x80000000
628 MX6QDL_PAD_CSI0_DAT5__AUD3_TXD 0x80000000
629 MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS 0x80000000
630 >;
631 };
632
633 pinctrl_audmux_3: audmux-3 {
634 fsl,pins = <
635 MX6QDL_PAD_DISP0_DAT16__AUD5_TXC 0x80000000
636 MX6QDL_PAD_DISP0_DAT18__AUD5_TXFS 0x80000000
637 MX6QDL_PAD_DISP0_DAT19__AUD5_RXD 0x80000000
638 >;
639 };
640 };
641
642 ecspi1 {
643 pinctrl_ecspi1_1: ecspi1grp-1 {
644 fsl,pins = <
645 MX6QDL_PAD_EIM_D17__ECSPI1_MISO 0x100b1
646 MX6QDL_PAD_EIM_D18__ECSPI1_MOSI 0x100b1
647 MX6QDL_PAD_EIM_D16__ECSPI1_SCLK 0x100b1
648 >;
649 };
650
651 pinctrl_ecspi1_2: ecspi1grp-2 {
652 fsl,pins = <
653 MX6QDL_PAD_KEY_COL1__ECSPI1_MISO 0x100b1
654 MX6QDL_PAD_KEY_ROW0__ECSPI1_MOSI 0x100b1
655 MX6QDL_PAD_KEY_COL0__ECSPI1_SCLK 0x100b1
656 >;
657 };
658 };
659
660 ecspi3 {
661 pinctrl_ecspi3_1: ecspi3grp-1 {
662 fsl,pins = <
663 MX6QDL_PAD_DISP0_DAT2__ECSPI3_MISO 0x100b1
664 MX6QDL_PAD_DISP0_DAT1__ECSPI3_MOSI 0x100b1
665 MX6QDL_PAD_DISP0_DAT0__ECSPI3_SCLK 0x100b1
666 >;
667 };
668 };
669
670 enet {
671 pinctrl_enet_1: enetgrp-1 {
672 fsl,pins = <
673 MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
674 MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
675 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
676 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
677 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
678 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
679 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
680 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
681 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
682 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
683 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
684 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
685 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
686 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
687 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
688 MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0a8
689 >;
690 };
691
692 pinctrl_enet_2: enetgrp-2 {
693 fsl,pins = <
694 MX6QDL_PAD_KEY_COL1__ENET_MDIO 0x1b0b0
695 MX6QDL_PAD_KEY_COL2__ENET_MDC 0x1b0b0
696 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
697 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
698 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
699 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
700 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
701 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
702 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
703 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
704 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
705 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
706 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
707 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
708 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
709 >;
710 };
711
712 pinctrl_enet_3: enetgrp-3 {
713 fsl,pins = <
714 MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
715 MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
716 MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x1b0b0
717 MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0
718 MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0
719 MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0
720 MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0
721 MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0
722 MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x1b0b0
723 MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0
724 MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0
725 MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0
726 MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0
727 MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0
728 MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0
729 MX6QDL_PAD_ENET_TX_EN__ENET_TX_EN 0x1b0b0
730 >;
731 };
732 };
733
734 esai {
735 pinctrl_esai_1: esaigrp-1 {
736 fsl,pins = <
737 MX6QDL_PAD_ENET_RXD0__ESAI_TX_HF_CLK 0x1b030
738 MX6QDL_PAD_ENET_CRS_DV__ESAI_TX_CLK 0x1b030
739 MX6QDL_PAD_ENET_RXD1__ESAI_TX_FS 0x1b030
740 MX6QDL_PAD_ENET_TX_EN__ESAI_TX3_RX2 0x1b030
741 MX6QDL_PAD_ENET_TXD1__ESAI_TX2_RX3 0x1b030
742 MX6QDL_PAD_ENET_TXD0__ESAI_TX4_RX1 0x1b030
743 MX6QDL_PAD_ENET_MDC__ESAI_TX5_RX0 0x1b030
744 MX6QDL_PAD_NANDF_CS2__ESAI_TX0 0x1b030
745 MX6QDL_PAD_NANDF_CS3__ESAI_TX1 0x1b030
746 >;
747 };
748
749 pinctrl_esai_2: esaigrp-2 {
750 fsl,pins = <
751 MX6QDL_PAD_ENET_CRS_DV__ESAI_TX_CLK 0x1b030
752 MX6QDL_PAD_ENET_RXD1__ESAI_TX_FS 0x1b030
753 MX6QDL_PAD_ENET_TX_EN__ESAI_TX3_RX2 0x1b030
754 MX6QDL_PAD_GPIO_5__ESAI_TX2_RX3 0x1b030
755 MX6QDL_PAD_ENET_TXD0__ESAI_TX4_RX1 0x1b030
756 MX6QDL_PAD_ENET_MDC__ESAI_TX5_RX0 0x1b030
757 MX6QDL_PAD_GPIO_17__ESAI_TX0 0x1b030
758 MX6QDL_PAD_NANDF_CS3__ESAI_TX1 0x1b030
759 MX6QDL_PAD_ENET_MDIO__ESAI_RX_CLK 0x1b030
760 MX6QDL_PAD_GPIO_9__ESAI_RX_FS 0x1b030
761 >;
762 };
763 };
764
765 flexcan1 {
766 pinctrl_flexcan1_1: flexcan1grp-1 {
767 fsl,pins = <
768 MX6QDL_PAD_KEY_ROW2__FLEXCAN1_RX 0x80000000
769 MX6QDL_PAD_KEY_COL2__FLEXCAN1_TX 0x80000000
770 >;
771 };
772
773 pinctrl_flexcan1_2: flexcan1grp-2 {
774 fsl,pins = <
775 MX6QDL_PAD_GPIO_7__FLEXCAN1_TX 0x80000000
776 MX6QDL_PAD_KEY_ROW2__FLEXCAN1_RX 0x80000000
777 >;
778 };
779 };
780
781 flexcan2 {
782 pinctrl_flexcan2_1: flexcan2grp-1 {
783 fsl,pins = <
784 MX6QDL_PAD_KEY_COL4__FLEXCAN2_TX 0x80000000
785 MX6QDL_PAD_KEY_ROW4__FLEXCAN2_RX 0x80000000
786 >;
787 };
788 };
789
790 gpmi-nand {
791 pinctrl_gpmi_nand_1: gpmi-nand-1 {
792 fsl,pins = <
793 MX6QDL_PAD_NANDF_CLE__NAND_CLE 0xb0b1
794 MX6QDL_PAD_NANDF_ALE__NAND_ALE 0xb0b1
795 MX6QDL_PAD_NANDF_WP_B__NAND_WP_B 0xb0b1
796 MX6QDL_PAD_NANDF_RB0__NAND_READY_B 0xb000
797 MX6QDL_PAD_NANDF_CS0__NAND_CE0_B 0xb0b1
798 MX6QDL_PAD_NANDF_CS1__NAND_CE1_B 0xb0b1
799 MX6QDL_PAD_SD4_CMD__NAND_RE_B 0xb0b1
800 MX6QDL_PAD_SD4_CLK__NAND_WE_B 0xb0b1
801 MX6QDL_PAD_NANDF_D0__NAND_DATA00 0xb0b1
802 MX6QDL_PAD_NANDF_D1__NAND_DATA01 0xb0b1
803 MX6QDL_PAD_NANDF_D2__NAND_DATA02 0xb0b1
804 MX6QDL_PAD_NANDF_D3__NAND_DATA03 0xb0b1
805 MX6QDL_PAD_NANDF_D4__NAND_DATA04 0xb0b1
806 MX6QDL_PAD_NANDF_D5__NAND_DATA05 0xb0b1
807 MX6QDL_PAD_NANDF_D6__NAND_DATA06 0xb0b1
808 MX6QDL_PAD_NANDF_D7__NAND_DATA07 0xb0b1
809 MX6QDL_PAD_SD4_DAT0__NAND_DQS 0x00b1
810 >;
811 };
812 };
813
814 hdmi_hdcp {
815 pinctrl_hdmi_hdcp_1: hdmihdcpgrp-1 {
816 fsl,pins = <
817 MX6QDL_PAD_KEY_COL3__HDMI_TX_DDC_SCL 0x4001b8b1
818 MX6QDL_PAD_KEY_ROW3__HDMI_TX_DDC_SDA 0x4001b8b1
819 >;
820 };
821
822 pinctrl_hdmi_hdcp_2: hdmihdcpgrp-2 {
823 fsl,pins = <
824 MX6QDL_PAD_EIM_EB2__HDMI_TX_DDC_SCL 0x4001b8b1
825 MX6QDL_PAD_EIM_D16__HDMI_TX_DDC_SDA 0x4001b8b1
826 >;
827 };
828
829 pinctrl_hdmi_hdcp_3: hdmihdcpgrp-3 {
830 fsl,pins = <
831 MX6QDL_PAD_EIM_EB2__HDMI_TX_DDC_SCL 0x4001b8b1
832 MX6QDL_PAD_KEY_ROW3__HDMI_TX_DDC_SDA 0x4001b8b1
833 >;
834 };
835 };
836
837 hdmi_cec {
838 pinctrl_hdmi_cec_1: hdmicecgrp-1 {
839 fsl,pins = <
840 MX6QDL_PAD_EIM_A25__HDMI_TX_CEC_LINE 0x1f8b0
841 >;
842 };
843
844 pinctrl_hdmi_cec_2: hdmicecgrp-2 {
845 fsl,pins = <
846 MX6QDL_PAD_KEY_ROW2__HDMI_TX_CEC_LINE 0x1f8b0
847 >;
848 };
849 };
850
851 i2c1 {
852 pinctrl_i2c1_1: i2c1grp-1 {
853 fsl,pins = <
854 MX6QDL_PAD_EIM_D21__I2C1_SCL 0x4001b8b1
855 MX6QDL_PAD_EIM_D28__I2C1_SDA 0x4001b8b1
856 >;
857 };
858
859 pinctrl_i2c1_2: i2c1grp-2 {
860 fsl,pins = <
861 MX6QDL_PAD_CSI0_DAT8__I2C1_SDA 0x4001b8b1
862 MX6QDL_PAD_CSI0_DAT9__I2C1_SCL 0x4001b8b1
863 >;
864 };
865 };
866
867 i2c2 {
868 pinctrl_i2c2_1: i2c2grp-1 {
869 fsl,pins = <
870 MX6QDL_PAD_EIM_EB2__I2C2_SCL 0x4001b8b1
871 MX6QDL_PAD_EIM_D16__I2C2_SDA 0x4001b8b1
872 >;
873 };
874
875 pinctrl_i2c2_2: i2c2grp-2 {
876 fsl,pins = <
877 MX6QDL_PAD_KEY_COL3__I2C2_SCL 0x4001b8b1
878 MX6QDL_PAD_KEY_ROW3__I2C2_SDA 0x4001b8b1
879 >;
880 };
881
882 pinctrl_i2c2_3: i2c2grp-3 {
883 fsl,pins = <
884 MX6QDL_PAD_EIM_EB2__I2C2_SCL 0x4001b8b1
885 MX6QDL_PAD_KEY_ROW3__I2C2_SDA 0x4001b8b1
886 >;
887 };
888 };
889
890 i2c3 {
891 pinctrl_i2c3_1: i2c3grp-1 {
892 fsl,pins = <
893 MX6QDL_PAD_EIM_D17__I2C3_SCL 0x4001b8b1
894 MX6QDL_PAD_EIM_D18__I2C3_SDA 0x4001b8b1
895 >;
896 };
897
898 pinctrl_i2c3_2: i2c3grp-2 {
899 fsl,pins = <
900 MX6QDL_PAD_GPIO_3__I2C3_SCL 0x4001b8b1
901 MX6QDL_PAD_GPIO_6__I2C3_SDA 0x4001b8b1
902 >;
903 };
904
905 pinctrl_i2c3_3: i2c3grp-3 {
906 fsl,pins = <
907 MX6QDL_PAD_GPIO_5__I2C3_SCL 0x4001b8b1
908 MX6QDL_PAD_GPIO_16__I2C3_SDA 0x4001b8b1
909 >;
910 };
911
912 pinctrl_i2c3_4: i2c3grp-4 {
913 fsl,pins = <
914 MX6QDL_PAD_GPIO_3__I2C3_SCL 0x4001b8b1
915 MX6QDL_PAD_EIM_D18__I2C3_SDA 0x4001b8b1
916 >;
917 };
918 };
919
920 ipu1 {
921 pinctrl_ipu1_1: ipu1grp-1 {
922 fsl,pins = <
923 MX6QDL_PAD_DI0_DISP_CLK__IPU1_DI0_DISP_CLK 0x10
924 MX6QDL_PAD_DI0_PIN15__IPU1_DI0_PIN15 0x10
925 MX6QDL_PAD_DI0_PIN2__IPU1_DI0_PIN02 0x10
926 MX6QDL_PAD_DI0_PIN3__IPU1_DI0_PIN03 0x10
927 MX6QDL_PAD_DI0_PIN4__IPU1_DI0_PIN04 0x80000000
928 MX6QDL_PAD_DISP0_DAT0__IPU1_DISP0_DATA00 0x10
929 MX6QDL_PAD_DISP0_DAT1__IPU1_DISP0_DATA01 0x10
930 MX6QDL_PAD_DISP0_DAT2__IPU1_DISP0_DATA02 0x10
931 MX6QDL_PAD_DISP0_DAT3__IPU1_DISP0_DATA03 0x10
932 MX6QDL_PAD_DISP0_DAT4__IPU1_DISP0_DATA04 0x10
933 MX6QDL_PAD_DISP0_DAT5__IPU1_DISP0_DATA05 0x10
934 MX6QDL_PAD_DISP0_DAT6__IPU1_DISP0_DATA06 0x10
935 MX6QDL_PAD_DISP0_DAT7__IPU1_DISP0_DATA07 0x10
936 MX6QDL_PAD_DISP0_DAT8__IPU1_DISP0_DATA08 0x10
937 MX6QDL_PAD_DISP0_DAT9__IPU1_DISP0_DATA09 0x10
938 MX6QDL_PAD_DISP0_DAT10__IPU1_DISP0_DATA10 0x10
939 MX6QDL_PAD_DISP0_DAT11__IPU1_DISP0_DATA11 0x10
940 MX6QDL_PAD_DISP0_DAT12__IPU1_DISP0_DATA12 0x10
941 MX6QDL_PAD_DISP0_DAT13__IPU1_DISP0_DATA13 0x10
942 MX6QDL_PAD_DISP0_DAT14__IPU1_DISP0_DATA14 0x10
943 MX6QDL_PAD_DISP0_DAT15__IPU1_DISP0_DATA15 0x10
944 MX6QDL_PAD_DISP0_DAT16__IPU1_DISP0_DATA16 0x10
945 MX6QDL_PAD_DISP0_DAT17__IPU1_DISP0_DATA17 0x10
946 MX6QDL_PAD_DISP0_DAT18__IPU1_DISP0_DATA18 0x10
947 MX6QDL_PAD_DISP0_DAT19__IPU1_DISP0_DATA19 0x10
948 MX6QDL_PAD_DISP0_DAT20__IPU1_DISP0_DATA20 0x10
949 MX6QDL_PAD_DISP0_DAT21__IPU1_DISP0_DATA21 0x10
950 MX6QDL_PAD_DISP0_DAT22__IPU1_DISP0_DATA22 0x10
951 MX6QDL_PAD_DISP0_DAT23__IPU1_DISP0_DATA23 0x10
952 >;
953 };
954
955 pinctrl_ipu1_2: ipu1grp-2 { /* parallel camera */
956 fsl,pins = <
957 MX6QDL_PAD_CSI0_DAT12__IPU1_CSI0_DATA12 0x80000000
958 MX6QDL_PAD_CSI0_DAT13__IPU1_CSI0_DATA13 0x80000000
959 MX6QDL_PAD_CSI0_DAT14__IPU1_CSI0_DATA14 0x80000000
960 MX6QDL_PAD_CSI0_DAT15__IPU1_CSI0_DATA15 0x80000000
961 MX6QDL_PAD_CSI0_DAT16__IPU1_CSI0_DATA16 0x80000000
962 MX6QDL_PAD_CSI0_DAT17__IPU1_CSI0_DATA17 0x80000000
963 MX6QDL_PAD_CSI0_DAT18__IPU1_CSI0_DATA18 0x80000000
964 MX6QDL_PAD_CSI0_DAT19__IPU1_CSI0_DATA19 0x80000000
965 MX6QDL_PAD_CSI0_DATA_EN__IPU1_CSI0_DATA_EN 0x80000000
966 MX6QDL_PAD_CSI0_PIXCLK__IPU1_CSI0_PIXCLK 0x80000000
967 MX6QDL_PAD_CSI0_MCLK__IPU1_CSI0_HSYNC 0x80000000
968 MX6QDL_PAD_CSI0_VSYNC__IPU1_CSI0_VSYNC 0x80000000
969 >;
970 };
971
972 pinctrl_ipu1_3: ipu1grp-3 { /* parallel port 16-bit */
973 fsl,pins = <
974 MX6QDL_PAD_CSI0_DAT4__IPU1_CSI0_DATA04 0x80000000
975 MX6QDL_PAD_CSI0_DAT5__IPU1_CSI0_DATA05 0x80000000
976 MX6QDL_PAD_CSI0_DAT6__IPU1_CSI0_DATA06 0x80000000
977 MX6QDL_PAD_CSI0_DAT7__IPU1_CSI0_DATA07 0x80000000
978 MX6QDL_PAD_CSI0_DAT8__IPU1_CSI0_DATA08 0x80000000
979 MX6QDL_PAD_CSI0_DAT9__IPU1_CSI0_DATA09 0x80000000
980 MX6QDL_PAD_CSI0_DAT10__IPU1_CSI0_DATA10 0x80000000
981 MX6QDL_PAD_CSI0_DAT11__IPU1_CSI0_DATA11 0x80000000
982 MX6QDL_PAD_CSI0_DAT12__IPU1_CSI0_DATA12 0x80000000
983 MX6QDL_PAD_CSI0_DAT13__IPU1_CSI0_DATA13 0x80000000
984 MX6QDL_PAD_CSI0_DAT14__IPU1_CSI0_DATA14 0x80000000
985 MX6QDL_PAD_CSI0_DAT15__IPU1_CSI0_DATA15 0x80000000
986 MX6QDL_PAD_CSI0_DAT16__IPU1_CSI0_DATA16 0x80000000
987 MX6QDL_PAD_CSI0_DAT17__IPU1_CSI0_DATA17 0x80000000
988 MX6QDL_PAD_CSI0_DAT18__IPU1_CSI0_DATA18 0x80000000
989 MX6QDL_PAD_CSI0_DAT19__IPU1_CSI0_DATA19 0x80000000
990 MX6QDL_PAD_CSI0_PIXCLK__IPU1_CSI0_PIXCLK 0x80000000
991 MX6QDL_PAD_CSI0_MCLK__IPU1_CSI0_HSYNC 0x80000000
992 MX6QDL_PAD_CSI0_VSYNC__IPU1_CSI0_VSYNC 0x80000000
993 >;
994 };
995 };
996
997 mlb {
998 pinctrl_mlb_1: mlbgrp-1 {
999 fsl,pins = <
1000 MX6QDL_PAD_GPIO_3__MLB_CLK 0x71
1001 MX6QDL_PAD_GPIO_6__MLB_SIG 0x71
1002 MX6QDL_PAD_GPIO_2__MLB_DATA 0x71
1003 >;
1004 };
1005
1006 pinctrl_mlb_2: mlbgrp-2 {
1007 fsl,pins = <
1008 MX6QDL_PAD_ENET_TXD1__MLB_CLK 0x71
1009 MX6QDL_PAD_GPIO_6__MLB_SIG 0x71
1010 MX6QDL_PAD_GPIO_2__MLB_DATA 0x71
1011 >;
1012 };
1013 };
1014
1015 pwm0 {
1016 pinctrl_pwm0_1: pwm0grp-1 {
1017 fsl,pins = <
1018 MX6QDL_PAD_SD1_DAT3__PWM1_OUT 0x1b0b1
1019 >;
1020 };
1021 };
1022
1023 pwm3 {
1024 pinctrl_pwm3_1: pwm3grp-1 {
1025 fsl,pins = <
1026 MX6QDL_PAD_SD4_DAT1__PWM3_OUT 0x1b0b1
1027 >;
1028 };
1029 };
1030
1031 spdif {
1032 pinctrl_spdif_1: spdifgrp-1 {
1033 fsl,pins = <
1034 MX6QDL_PAD_KEY_COL3__SPDIF_IN 0x1b0b0
1035 >;
1036 };
1037
1038 pinctrl_spdif_2: spdifgrp-2 {
1039 fsl,pins = <
1040 MX6QDL_PAD_GPIO_16__SPDIF_IN 0x1b0b0
1041 MX6QDL_PAD_GPIO_17__SPDIF_OUT 0x1b0b0
1042 >;
1043 };
1044
1045 pinctrl_spdif_3: spdifgrp-3 {
1046 fsl,pins = <
1047 MX6QDL_PAD_ENET_RXD0__SPDIF_OUT 0x1b0b0
1048 >;
1049 };
1050 };
1051
1052 uart1 {
1053 pinctrl_uart1_1: uart1grp-1 {
1054 fsl,pins = <
1055 MX6QDL_PAD_CSI0_DAT10__UART1_TX_DATA 0x1b0b1
1056 MX6QDL_PAD_CSI0_DAT11__UART1_RX_DATA 0x1b0b1
1057 >;
1058 };
1059 };
1060
1061 uart2 {
1062 pinctrl_uart2_1: uart2grp-1 {
1063 fsl,pins = <
1064 MX6QDL_PAD_EIM_D26__UART2_TX_DATA 0x1b0b1
1065 MX6QDL_PAD_EIM_D27__UART2_RX_DATA 0x1b0b1
1066 >;
1067 };
1068
1069 pinctrl_uart2_2: uart2grp-2 { /* DTE mode */
1070 fsl,pins = <
1071 MX6QDL_PAD_EIM_D26__UART2_RX_DATA 0x1b0b1
1072 MX6QDL_PAD_EIM_D27__UART2_TX_DATA 0x1b0b1
1073 MX6QDL_PAD_EIM_D28__UART2_DTE_CTS_B 0x1b0b1
1074 MX6QDL_PAD_EIM_D29__UART2_DTE_RTS_B 0x1b0b1
1075 >;
1076 };
1077 };
1078
1079 uart3 {
1080 pinctrl_uart3_1: uart3grp-1 {
1081 fsl,pins = <
1082 MX6QDL_PAD_SD4_CLK__UART3_RX_DATA 0x1b0b1
1083 MX6QDL_PAD_SD4_CMD__UART3_TX_DATA 0x1b0b1
1084 MX6QDL_PAD_EIM_D30__UART3_CTS_B 0x1b0b1
1085 MX6QDL_PAD_EIM_EB3__UART3_RTS_B 0x1b0b1
1086 >;
1087 };
1088
1089 pinctrl_uart3_2: uart3grp-2 {
1090 fsl,pins = <
1091 MX6QDL_PAD_EIM_D24__UART3_TX_DATA 0x1b0b1
1092 MX6QDL_PAD_EIM_D25__UART3_RX_DATA 0x1b0b1
1093 MX6QDL_PAD_EIM_D23__UART3_CTS_B 0x1b0b1
1094 MX6QDL_PAD_EIM_EB3__UART3_RTS_B 0x1b0b1
1095 >;
1096 };
1097 };
1098
1099 uart4 {
1100 pinctrl_uart4_1: uart4grp-1 {
1101 fsl,pins = <
1102 MX6QDL_PAD_KEY_COL0__UART4_TX_DATA 0x1b0b1
1103 MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA 0x1b0b1
1104 >;
1105 };
1106 };
1107
1108 usbotg {
1109 pinctrl_usbotg_1: usbotggrp-1 {
1110 fsl,pins = <
1111 MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
1112 >;
1113 };
1114
1115 pinctrl_usbotg_2: usbotggrp-2 {
1116 fsl,pins = <
1117 MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID 0x17059
1118 >;
1119 };
1120 };
1121
1122 usbh2 {
1123 pinctrl_usbh2_1: usbh2grp-1 {
1124 fsl,pins = <
1125 MX6QDL_PAD_RGMII_TXC__USB_H2_DATA 0x40013030
1126 MX6QDL_PAD_RGMII_TX_CTL__USB_H2_STROBE 0x40013030
1127 >;
1128 };
1129
1130 pinctrl_usbh2_2: usbh2grp-2 {
1131 fsl,pins = <
1132 MX6QDL_PAD_RGMII_TX_CTL__USB_H2_STROBE 0x40017030
1133 >;
1134 };
1135 };
1136
1137 usbh3 {
1138 pinctrl_usbh3_1: usbh3grp-1 {
1139 fsl,pins = <
1140 MX6QDL_PAD_RGMII_RX_CTL__USB_H3_DATA 0x40013030
1141 MX6QDL_PAD_RGMII_RXC__USB_H3_STROBE 0x40013030
1142 >;
1143 };
1144 665
1145 pinctrl_usbh3_2: usbh3grp-2 { 666 lvds-channel@0 {
1146 fsl,pins = < 667 #address-cells = <1>;
1147 MX6QDL_PAD_RGMII_RXC__USB_H3_STROBE 0x40017030 668 #size-cells = <0>;
1148 >; 669 reg = <0>;
1149 }; 670 status = "disabled";
1150 };
1151 671
1152 usdhc1 { 672 port@0 {
1153 pinctrl_usdhc1_1: usdhc1grp-1 { 673 reg = <0>;
1154 fsl,pins = <
1155 MX6QDL_PAD_SD1_CMD__SD1_CMD 0x17059
1156 MX6QDL_PAD_SD1_CLK__SD1_CLK 0x10059
1157 MX6QDL_PAD_SD1_DAT0__SD1_DATA0 0x17059
1158 MX6QDL_PAD_SD1_DAT1__SD1_DATA1 0x17059
1159 MX6QDL_PAD_SD1_DAT2__SD1_DATA2 0x17059
1160 MX6QDL_PAD_SD1_DAT3__SD1_DATA3 0x17059
1161 MX6QDL_PAD_NANDF_D0__SD1_DATA4 0x17059
1162 MX6QDL_PAD_NANDF_D1__SD1_DATA5 0x17059
1163 MX6QDL_PAD_NANDF_D2__SD1_DATA6 0x17059
1164 MX6QDL_PAD_NANDF_D3__SD1_DATA7 0x17059
1165 >;
1166 };
1167 674
1168 pinctrl_usdhc1_2: usdhc1grp-2 { 675 lvds0_mux_0: endpoint {
1169 fsl,pins = < 676 remote-endpoint = <&ipu1_di0_lvds0>;
1170 MX6QDL_PAD_SD1_CMD__SD1_CMD 0x17059 677 };
1171 MX6QDL_PAD_SD1_CLK__SD1_CLK 0x10059
1172 MX6QDL_PAD_SD1_DAT0__SD1_DATA0 0x17059
1173 MX6QDL_PAD_SD1_DAT1__SD1_DATA1 0x17059
1174 MX6QDL_PAD_SD1_DAT2__SD1_DATA2 0x17059
1175 MX6QDL_PAD_SD1_DAT3__SD1_DATA3 0x17059
1176 >;
1177 }; 678 };
1178 };
1179 679
1180 usdhc2 { 680 port@1 {
1181 pinctrl_usdhc2_1: usdhc2grp-1 { 681 reg = <1>;
1182 fsl,pins = <
1183 MX6QDL_PAD_SD2_CMD__SD2_CMD 0x17059
1184 MX6QDL_PAD_SD2_CLK__SD2_CLK 0x10059
1185 MX6QDL_PAD_SD2_DAT0__SD2_DATA0 0x17059
1186 MX6QDL_PAD_SD2_DAT1__SD2_DATA1 0x17059
1187 MX6QDL_PAD_SD2_DAT2__SD2_DATA2 0x17059
1188 MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x17059
1189 MX6QDL_PAD_NANDF_D4__SD2_DATA4 0x17059
1190 MX6QDL_PAD_NANDF_D5__SD2_DATA5 0x17059
1191 MX6QDL_PAD_NANDF_D6__SD2_DATA6 0x17059
1192 MX6QDL_PAD_NANDF_D7__SD2_DATA7 0x17059
1193 >;
1194 };
1195 682
1196 pinctrl_usdhc2_2: usdhc2grp-2 { 683 lvds0_mux_1: endpoint {
1197 fsl,pins = < 684 remote-endpoint = <&ipu1_di1_lvds0>;
1198 MX6QDL_PAD_SD2_CMD__SD2_CMD 0x17059 685 };
1199 MX6QDL_PAD_SD2_CLK__SD2_CLK 0x10059
1200 MX6QDL_PAD_SD2_DAT0__SD2_DATA0 0x17059
1201 MX6QDL_PAD_SD2_DAT1__SD2_DATA1 0x17059
1202 MX6QDL_PAD_SD2_DAT2__SD2_DATA2 0x17059
1203 MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x17059
1204 >;
1205 }; 686 };
1206 }; 687 };
1207 688
1208 usdhc3 { 689 lvds-channel@1 {
1209 pinctrl_usdhc3_1: usdhc3grp-1 { 690 #address-cells = <1>;
1210 fsl,pins = < 691 #size-cells = <0>;
1211 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059 692 reg = <1>;
1212 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059 693 status = "disabled";
1213 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059
1214 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
1215 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
1216 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
1217 MX6QDL_PAD_SD3_DAT4__SD3_DATA4 0x17059
1218 MX6QDL_PAD_SD3_DAT5__SD3_DATA5 0x17059
1219 MX6QDL_PAD_SD3_DAT6__SD3_DATA6 0x17059
1220 MX6QDL_PAD_SD3_DAT7__SD3_DATA7 0x17059
1221 >;
1222 };
1223
1224 pinctrl_usdhc3_1_100mhz: usdhc3grp-1-100mhz { /* 100Mhz */
1225 fsl,pins = <
1226 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x170b9
1227 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x100b9
1228 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x170b9
1229 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x170b9
1230 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x170b9
1231 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x170b9
1232 MX6QDL_PAD_SD3_DAT4__SD3_DATA4 0x170b9
1233 MX6QDL_PAD_SD3_DAT5__SD3_DATA5 0x170b9
1234 MX6QDL_PAD_SD3_DAT6__SD3_DATA6 0x170b9
1235 MX6QDL_PAD_SD3_DAT7__SD3_DATA7 0x170b9
1236 >;
1237 };
1238 694
1239 pinctrl_usdhc3_1_200mhz: usdhc3grp-1-200mhz { /* 200Mhz */ 695 port@0 {
1240 fsl,pins = < 696 reg = <0>;
1241 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x170f9
1242 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x100f9
1243 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x170f9
1244 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x170f9
1245 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x170f9
1246 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x170f9
1247 MX6QDL_PAD_SD3_DAT4__SD3_DATA4 0x170f9
1248 MX6QDL_PAD_SD3_DAT5__SD3_DATA5 0x170f9
1249 MX6QDL_PAD_SD3_DAT6__SD3_DATA6 0x170f9
1250 MX6QDL_PAD_SD3_DAT7__SD3_DATA7 0x170f9
1251 >;
1252 };
1253 697
1254 pinctrl_usdhc3_2: usdhc3grp-2 { 698 lvds1_mux_0: endpoint {
1255 fsl,pins = < 699 remote-endpoint = <&ipu1_di0_lvds1>;
1256 MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059 700 };
1257 MX6QDL_PAD_SD3_CLK__SD3_CLK 0x10059
1258 MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x17059
1259 MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059
1260 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059
1261 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059
1262 >;
1263 }; 701 };
1264 };
1265 702
1266 usdhc4 { 703 port@1 {
1267 pinctrl_usdhc4_1: usdhc4grp-1 { 704 reg = <1>;
1268 fsl,pins = <
1269 MX6QDL_PAD_SD4_CMD__SD4_CMD 0x17059
1270 MX6QDL_PAD_SD4_CLK__SD4_CLK 0x10059
1271 MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17059
1272 MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17059
1273 MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17059
1274 MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17059
1275 MX6QDL_PAD_SD4_DAT4__SD4_DATA4 0x17059
1276 MX6QDL_PAD_SD4_DAT5__SD4_DATA5 0x17059
1277 MX6QDL_PAD_SD4_DAT6__SD4_DATA6 0x17059
1278 MX6QDL_PAD_SD4_DAT7__SD4_DATA7 0x17059
1279 >;
1280 };
1281 705
1282 pinctrl_usdhc4_2: usdhc4grp-2 { 706 lvds1_mux_1: endpoint {
1283 fsl,pins = < 707 remote-endpoint = <&ipu1_di1_lvds1>;
1284 MX6QDL_PAD_SD4_CMD__SD4_CMD 0x17059 708 };
1285 MX6QDL_PAD_SD4_CLK__SD4_CLK 0x10059
1286 MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17059
1287 MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17059
1288 MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17059
1289 MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17059
1290 >;
1291 };
1292 };
1293
1294 weim {
1295 pinctrl_weim_cs0_1: weim_cs0grp-1 {
1296 fsl,pins = <
1297 MX6QDL_PAD_EIM_CS0__EIM_CS0_B 0xb0b1
1298 >;
1299 };
1300
1301 pinctrl_weim_nor_1: weim_norgrp-1 {
1302 fsl,pins = <
1303 MX6QDL_PAD_EIM_OE__EIM_OE_B 0xb0b1
1304 MX6QDL_PAD_EIM_RW__EIM_RW 0xb0b1
1305 MX6QDL_PAD_EIM_WAIT__EIM_WAIT_B 0xb060
1306 /* data */
1307 MX6QDL_PAD_EIM_D16__EIM_DATA16 0x1b0b0
1308 MX6QDL_PAD_EIM_D17__EIM_DATA17 0x1b0b0
1309 MX6QDL_PAD_EIM_D18__EIM_DATA18 0x1b0b0
1310 MX6QDL_PAD_EIM_D19__EIM_DATA19 0x1b0b0
1311 MX6QDL_PAD_EIM_D20__EIM_DATA20 0x1b0b0
1312 MX6QDL_PAD_EIM_D21__EIM_DATA21 0x1b0b0
1313 MX6QDL_PAD_EIM_D22__EIM_DATA22 0x1b0b0
1314 MX6QDL_PAD_EIM_D23__EIM_DATA23 0x1b0b0
1315 MX6QDL_PAD_EIM_D24__EIM_DATA24 0x1b0b0
1316 MX6QDL_PAD_EIM_D25__EIM_DATA25 0x1b0b0
1317 MX6QDL_PAD_EIM_D26__EIM_DATA26 0x1b0b0
1318 MX6QDL_PAD_EIM_D27__EIM_DATA27 0x1b0b0
1319 MX6QDL_PAD_EIM_D28__EIM_DATA28 0x1b0b0
1320 MX6QDL_PAD_EIM_D29__EIM_DATA29 0x1b0b0
1321 MX6QDL_PAD_EIM_D30__EIM_DATA30 0x1b0b0
1322 MX6QDL_PAD_EIM_D31__EIM_DATA31 0x1b0b0
1323 /* address */
1324 MX6QDL_PAD_EIM_A23__EIM_ADDR23 0xb0b1
1325 MX6QDL_PAD_EIM_A22__EIM_ADDR22 0xb0b1
1326 MX6QDL_PAD_EIM_A21__EIM_ADDR21 0xb0b1
1327 MX6QDL_PAD_EIM_A20__EIM_ADDR20 0xb0b1
1328 MX6QDL_PAD_EIM_A19__EIM_ADDR19 0xb0b1
1329 MX6QDL_PAD_EIM_A18__EIM_ADDR18 0xb0b1
1330 MX6QDL_PAD_EIM_A17__EIM_ADDR17 0xb0b1
1331 MX6QDL_PAD_EIM_A16__EIM_ADDR16 0xb0b1
1332 MX6QDL_PAD_EIM_DA15__EIM_AD15 0xb0b1
1333 MX6QDL_PAD_EIM_DA14__EIM_AD14 0xb0b1
1334 MX6QDL_PAD_EIM_DA13__EIM_AD13 0xb0b1
1335 MX6QDL_PAD_EIM_DA12__EIM_AD12 0xb0b1
1336 MX6QDL_PAD_EIM_DA11__EIM_AD11 0xb0b1
1337 MX6QDL_PAD_EIM_DA10__EIM_AD10 0xb0b1
1338 MX6QDL_PAD_EIM_DA9__EIM_AD09 0xb0b1
1339 MX6QDL_PAD_EIM_DA8__EIM_AD08 0xb0b1
1340 MX6QDL_PAD_EIM_DA7__EIM_AD07 0xb0b1
1341 MX6QDL_PAD_EIM_DA6__EIM_AD06 0xb0b1
1342 MX6QDL_PAD_EIM_DA5__EIM_AD05 0xb0b1
1343 MX6QDL_PAD_EIM_DA4__EIM_AD04 0xb0b1
1344 MX6QDL_PAD_EIM_DA3__EIM_AD03 0xb0b1
1345 MX6QDL_PAD_EIM_DA2__EIM_AD02 0xb0b1
1346 MX6QDL_PAD_EIM_DA1__EIM_AD01 0xb0b1
1347 MX6QDL_PAD_EIM_DA0__EIM_AD00 0xb0b1
1348 >;
1349 }; 709 };
1350 }; 710 };
1351 }; 711 };
1352 712
1353 ldb: ldb@020e0008 { 713 hdmi: hdmi@0120000 {
1354 #address-cells = <1>; 714 #address-cells = <1>;
1355 #size-cells = <0>; 715 #size-cells = <0>;
1356 compatible = "fsl,imx6q-ldb", "fsl,imx53-ldb"; 716 reg = <0x00120000 0x9000>;
717 interrupts = <0 115 0x04>;
1357 gpr = <&gpr>; 718 gpr = <&gpr>;
719 clocks = <&clks 123>, <&clks 124>;
720 clock-names = "iahb", "isfr";
1358 status = "disabled"; 721 status = "disabled";
1359 722
1360 lvds-channel@0 { 723 port@0 {
1361 reg = <0>; 724 reg = <0>;
1362 status = "disabled"; 725
726 hdmi_mux_0: endpoint {
727 remote-endpoint = <&ipu1_di0_hdmi>;
728 };
1363 }; 729 };
1364 730
1365 lvds-channel@1 { 731 port@1 {
1366 reg = <1>; 732 reg = <1>;
1367 status = "disabled"; 733
734 hdmi_mux_1: endpoint {
735 remote-endpoint = <&ipu1_di1_hdmi>;
736 };
1368 }; 737 };
1369 }; 738 };
1370 739
1371 dcic1: dcic@020e4000 { 740 dcic1: dcic@020e4000 {
1372 reg = <0x020e4000 0x4000>; 741 reg = <0x020e4000 0x4000>;
1373 interrupts = <0 124 0x04>; 742 interrupts = <0 124 IRQ_TYPE_LEVEL_HIGH>;
1374 }; 743 };
1375 744
1376 dcic2: dcic@020e8000 { 745 dcic2: dcic@020e8000 {
1377 reg = <0x020e8000 0x4000>; 746 reg = <0x020e8000 0x4000>;
1378 interrupts = <0 125 0x04>; 747 interrupts = <0 125 IRQ_TYPE_LEVEL_HIGH>;
1379 }; 748 };
1380 749
1381 sdma: sdma@020ec000 { 750 sdma: sdma@020ec000 {
1382 compatible = "fsl,imx6q-sdma", "fsl,imx35-sdma"; 751 compatible = "fsl,imx6q-sdma", "fsl,imx35-sdma";
1383 reg = <0x020ec000 0x4000>; 752 reg = <0x020ec000 0x4000>;
1384 interrupts = <0 2 0x04>; 753 interrupts = <0 2 IRQ_TYPE_LEVEL_HIGH>;
1385 clocks = <&clks 155>, <&clks 155>; 754 clocks = <&clks 155>, <&clks 155>;
1386 clock-names = "ipg", "ahb"; 755 clock-names = "ipg", "ahb";
1387 #dma-cells = <3>; 756 #dma-cells = <3>;
@@ -1398,7 +767,8 @@
1398 767
1399 caam@02100000 { 768 caam@02100000 {
1400 reg = <0x02100000 0x40000>; 769 reg = <0x02100000 0x40000>;
1401 interrupts = <0 105 0x04 0 106 0x04>; 770 interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>,
771 <0 106 IRQ_TYPE_LEVEL_HIGH>;
1402 }; 772 };
1403 773
1404 aipstz@0217c000 { /* AIPSTZ2 */ 774 aipstz@0217c000 { /* AIPSTZ2 */
@@ -1408,7 +778,7 @@
1408 usbotg: usb@02184000 { 778 usbotg: usb@02184000 {
1409 compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; 779 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
1410 reg = <0x02184000 0x200>; 780 reg = <0x02184000 0x200>;
1411 interrupts = <0 43 0x04>; 781 interrupts = <0 43 IRQ_TYPE_LEVEL_HIGH>;
1412 clocks = <&clks 162>; 782 clocks = <&clks 162>;
1413 fsl,usbphy = <&usbphy1>; 783 fsl,usbphy = <&usbphy1>;
1414 fsl,usbmisc = <&usbmisc 0>; 784 fsl,usbmisc = <&usbmisc 0>;
@@ -1418,7 +788,7 @@
1418 usbh1: usb@02184200 { 788 usbh1: usb@02184200 {
1419 compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; 789 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
1420 reg = <0x02184200 0x200>; 790 reg = <0x02184200 0x200>;
1421 interrupts = <0 40 0x04>; 791 interrupts = <0 40 IRQ_TYPE_LEVEL_HIGH>;
1422 clocks = <&clks 162>; 792 clocks = <&clks 162>;
1423 fsl,usbphy = <&usbphy2>; 793 fsl,usbphy = <&usbphy2>;
1424 fsl,usbmisc = <&usbmisc 1>; 794 fsl,usbmisc = <&usbmisc 1>;
@@ -1428,7 +798,7 @@
1428 usbh2: usb@02184400 { 798 usbh2: usb@02184400 {
1429 compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; 799 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
1430 reg = <0x02184400 0x200>; 800 reg = <0x02184400 0x200>;
1431 interrupts = <0 41 0x04>; 801 interrupts = <0 41 IRQ_TYPE_LEVEL_HIGH>;
1432 clocks = <&clks 162>; 802 clocks = <&clks 162>;
1433 fsl,usbmisc = <&usbmisc 2>; 803 fsl,usbmisc = <&usbmisc 2>;
1434 status = "disabled"; 804 status = "disabled";
@@ -1437,7 +807,7 @@
1437 usbh3: usb@02184600 { 807 usbh3: usb@02184600 {
1438 compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; 808 compatible = "fsl,imx6q-usb", "fsl,imx27-usb";
1439 reg = <0x02184600 0x200>; 809 reg = <0x02184600 0x200>;
1440 interrupts = <0 42 0x04>; 810 interrupts = <0 42 IRQ_TYPE_LEVEL_HIGH>;
1441 clocks = <&clks 162>; 811 clocks = <&clks 162>;
1442 fsl,usbmisc = <&usbmisc 3>; 812 fsl,usbmisc = <&usbmisc 3>;
1443 status = "disabled"; 813 status = "disabled";
@@ -1453,7 +823,9 @@
1453 fec: ethernet@02188000 { 823 fec: ethernet@02188000 {
1454 compatible = "fsl,imx6q-fec"; 824 compatible = "fsl,imx6q-fec";
1455 reg = <0x02188000 0x4000>; 825 reg = <0x02188000 0x4000>;
1456 interrupts = <0 118 0x04 0 119 0x04>; 826 interrupts-extended =
827 <&intc 0 118 IRQ_TYPE_LEVEL_HIGH>,
828 <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>;
1457 clocks = <&clks 117>, <&clks 117>, <&clks 190>; 829 clocks = <&clks 117>, <&clks 117>, <&clks 190>;
1458 clock-names = "ipg", "ahb", "ptp"; 830 clock-names = "ipg", "ahb", "ptp";
1459 status = "disabled"; 831 status = "disabled";
@@ -1461,13 +833,15 @@
1461 833
1462 mlb@0218c000 { 834 mlb@0218c000 {
1463 reg = <0x0218c000 0x4000>; 835 reg = <0x0218c000 0x4000>;
1464 interrupts = <0 53 0x04 0 117 0x04 0 126 0x04>; 836 interrupts = <0 53 IRQ_TYPE_LEVEL_HIGH>,
837 <0 117 IRQ_TYPE_LEVEL_HIGH>,
838 <0 126 IRQ_TYPE_LEVEL_HIGH>;
1465 }; 839 };
1466 840
1467 usdhc1: usdhc@02190000 { 841 usdhc1: usdhc@02190000 {
1468 compatible = "fsl,imx6q-usdhc"; 842 compatible = "fsl,imx6q-usdhc";
1469 reg = <0x02190000 0x4000>; 843 reg = <0x02190000 0x4000>;
1470 interrupts = <0 22 0x04>; 844 interrupts = <0 22 IRQ_TYPE_LEVEL_HIGH>;
1471 clocks = <&clks 163>, <&clks 163>, <&clks 163>; 845 clocks = <&clks 163>, <&clks 163>, <&clks 163>;
1472 clock-names = "ipg", "ahb", "per"; 846 clock-names = "ipg", "ahb", "per";
1473 bus-width = <4>; 847 bus-width = <4>;
@@ -1477,7 +851,7 @@
1477 usdhc2: usdhc@02194000 { 851 usdhc2: usdhc@02194000 {
1478 compatible = "fsl,imx6q-usdhc"; 852 compatible = "fsl,imx6q-usdhc";
1479 reg = <0x02194000 0x4000>; 853 reg = <0x02194000 0x4000>;
1480 interrupts = <0 23 0x04>; 854 interrupts = <0 23 IRQ_TYPE_LEVEL_HIGH>;
1481 clocks = <&clks 164>, <&clks 164>, <&clks 164>; 855 clocks = <&clks 164>, <&clks 164>, <&clks 164>;
1482 clock-names = "ipg", "ahb", "per"; 856 clock-names = "ipg", "ahb", "per";
1483 bus-width = <4>; 857 bus-width = <4>;
@@ -1487,7 +861,7 @@
1487 usdhc3: usdhc@02198000 { 861 usdhc3: usdhc@02198000 {
1488 compatible = "fsl,imx6q-usdhc"; 862 compatible = "fsl,imx6q-usdhc";
1489 reg = <0x02198000 0x4000>; 863 reg = <0x02198000 0x4000>;
1490 interrupts = <0 24 0x04>; 864 interrupts = <0 24 IRQ_TYPE_LEVEL_HIGH>;
1491 clocks = <&clks 165>, <&clks 165>, <&clks 165>; 865 clocks = <&clks 165>, <&clks 165>, <&clks 165>;
1492 clock-names = "ipg", "ahb", "per"; 866 clock-names = "ipg", "ahb", "per";
1493 bus-width = <4>; 867 bus-width = <4>;
@@ -1497,7 +871,7 @@
1497 usdhc4: usdhc@0219c000 { 871 usdhc4: usdhc@0219c000 {
1498 compatible = "fsl,imx6q-usdhc"; 872 compatible = "fsl,imx6q-usdhc";
1499 reg = <0x0219c000 0x4000>; 873 reg = <0x0219c000 0x4000>;
1500 interrupts = <0 25 0x04>; 874 interrupts = <0 25 IRQ_TYPE_LEVEL_HIGH>;
1501 clocks = <&clks 166>, <&clks 166>, <&clks 166>; 875 clocks = <&clks 166>, <&clks 166>, <&clks 166>;
1502 clock-names = "ipg", "ahb", "per"; 876 clock-names = "ipg", "ahb", "per";
1503 bus-width = <4>; 877 bus-width = <4>;
@@ -1509,7 +883,7 @@
1509 #size-cells = <0>; 883 #size-cells = <0>;
1510 compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c"; 884 compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c";
1511 reg = <0x021a0000 0x4000>; 885 reg = <0x021a0000 0x4000>;
1512 interrupts = <0 36 0x04>; 886 interrupts = <0 36 IRQ_TYPE_LEVEL_HIGH>;
1513 clocks = <&clks 125>; 887 clocks = <&clks 125>;
1514 status = "disabled"; 888 status = "disabled";
1515 }; 889 };
@@ -1519,7 +893,7 @@
1519 #size-cells = <0>; 893 #size-cells = <0>;
1520 compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c"; 894 compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c";
1521 reg = <0x021a4000 0x4000>; 895 reg = <0x021a4000 0x4000>;
1522 interrupts = <0 37 0x04>; 896 interrupts = <0 37 IRQ_TYPE_LEVEL_HIGH>;
1523 clocks = <&clks 126>; 897 clocks = <&clks 126>;
1524 status = "disabled"; 898 status = "disabled";
1525 }; 899 };
@@ -1529,7 +903,7 @@
1529 #size-cells = <0>; 903 #size-cells = <0>;
1530 compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c"; 904 compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c";
1531 reg = <0x021a8000 0x4000>; 905 reg = <0x021a8000 0x4000>;
1532 interrupts = <0 38 0x04>; 906 interrupts = <0 38 IRQ_TYPE_LEVEL_HIGH>;
1533 clocks = <&clks 127>; 907 clocks = <&clks 127>;
1534 status = "disabled"; 908 status = "disabled";
1535 }; 909 };
@@ -1550,7 +924,7 @@
1550 weim: weim@021b8000 { 924 weim: weim@021b8000 {
1551 compatible = "fsl,imx6q-weim"; 925 compatible = "fsl,imx6q-weim";
1552 reg = <0x021b8000 0x4000>; 926 reg = <0x021b8000 0x4000>;
1553 interrupts = <0 14 0x04>; 927 interrupts = <0 14 IRQ_TYPE_LEVEL_HIGH>;
1554 clocks = <&clks 196>; 928 clocks = <&clks 196>;
1555 }; 929 };
1556 930
@@ -1561,12 +935,12 @@
1561 935
1562 tzasc@021d0000 { /* TZASC1 */ 936 tzasc@021d0000 { /* TZASC1 */
1563 reg = <0x021d0000 0x4000>; 937 reg = <0x021d0000 0x4000>;
1564 interrupts = <0 108 0x04>; 938 interrupts = <0 108 IRQ_TYPE_LEVEL_HIGH>;
1565 }; 939 };
1566 940
1567 tzasc@021d4000 { /* TZASC2 */ 941 tzasc@021d4000 { /* TZASC2 */
1568 reg = <0x021d4000 0x4000>; 942 reg = <0x021d4000 0x4000>;
1569 interrupts = <0 109 0x04>; 943 interrupts = <0 109 IRQ_TYPE_LEVEL_HIGH>;
1570 }; 944 };
1571 945
1572 audmux: audmux@021d8000 { 946 audmux: audmux@021d8000 {
@@ -1575,23 +949,42 @@
1575 status = "disabled"; 949 status = "disabled";
1576 }; 950 };
1577 951
1578 mipi@021dc000 { /* MIPI-CSI */ 952 mipi_csi: mipi@021dc000 {
1579 reg = <0x021dc000 0x4000>; 953 reg = <0x021dc000 0x4000>;
1580 }; 954 };
1581 955
1582 mipi@021e0000 { /* MIPI-DSI */ 956 mipi_dsi: mipi@021e0000 {
957 #address-cells = <1>;
958 #size-cells = <0>;
1583 reg = <0x021e0000 0x4000>; 959 reg = <0x021e0000 0x4000>;
960 status = "disabled";
961
962 port@0 {
963 reg = <0>;
964
965 mipi_mux_0: endpoint {
966 remote-endpoint = <&ipu1_di0_mipi>;
967 };
968 };
969
970 port@1 {
971 reg = <1>;
972
973 mipi_mux_1: endpoint {
974 remote-endpoint = <&ipu1_di1_mipi>;
975 };
976 };
1584 }; 977 };
1585 978
1586 vdoa@021e4000 { 979 vdoa@021e4000 {
1587 reg = <0x021e4000 0x4000>; 980 reg = <0x021e4000 0x4000>;
1588 interrupts = <0 18 0x04>; 981 interrupts = <0 18 IRQ_TYPE_LEVEL_HIGH>;
1589 }; 982 };
1590 983
1591 uart2: serial@021e8000 { 984 uart2: serial@021e8000 {
1592 compatible = "fsl,imx6q-uart", "fsl,imx21-uart"; 985 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
1593 reg = <0x021e8000 0x4000>; 986 reg = <0x021e8000 0x4000>;
1594 interrupts = <0 27 0x04>; 987 interrupts = <0 27 IRQ_TYPE_LEVEL_HIGH>;
1595 clocks = <&clks 160>, <&clks 161>; 988 clocks = <&clks 160>, <&clks 161>;
1596 clock-names = "ipg", "per"; 989 clock-names = "ipg", "per";
1597 dmas = <&sdma 27 4 0>, <&sdma 28 4 0>; 990 dmas = <&sdma 27 4 0>, <&sdma 28 4 0>;
@@ -1602,7 +995,7 @@
1602 uart3: serial@021ec000 { 995 uart3: serial@021ec000 {
1603 compatible = "fsl,imx6q-uart", "fsl,imx21-uart"; 996 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
1604 reg = <0x021ec000 0x4000>; 997 reg = <0x021ec000 0x4000>;
1605 interrupts = <0 28 0x04>; 998 interrupts = <0 28 IRQ_TYPE_LEVEL_HIGH>;
1606 clocks = <&clks 160>, <&clks 161>; 999 clocks = <&clks 160>, <&clks 161>;
1607 clock-names = "ipg", "per"; 1000 clock-names = "ipg", "per";
1608 dmas = <&sdma 29 4 0>, <&sdma 30 4 0>; 1001 dmas = <&sdma 29 4 0>, <&sdma 30 4 0>;
@@ -1613,7 +1006,7 @@
1613 uart4: serial@021f0000 { 1006 uart4: serial@021f0000 {
1614 compatible = "fsl,imx6q-uart", "fsl,imx21-uart"; 1007 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
1615 reg = <0x021f0000 0x4000>; 1008 reg = <0x021f0000 0x4000>;
1616 interrupts = <0 29 0x04>; 1009 interrupts = <0 29 IRQ_TYPE_LEVEL_HIGH>;
1617 clocks = <&clks 160>, <&clks 161>; 1010 clocks = <&clks 160>, <&clks 161>;
1618 clock-names = "ipg", "per"; 1011 clock-names = "ipg", "per";
1619 dmas = <&sdma 31 4 0>, <&sdma 32 4 0>; 1012 dmas = <&sdma 31 4 0>, <&sdma 32 4 0>;
@@ -1624,7 +1017,7 @@
1624 uart5: serial@021f4000 { 1017 uart5: serial@021f4000 {
1625 compatible = "fsl,imx6q-uart", "fsl,imx21-uart"; 1018 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";
1626 reg = <0x021f4000 0x4000>; 1019 reg = <0x021f4000 0x4000>;
1627 interrupts = <0 30 0x04>; 1020 interrupts = <0 30 IRQ_TYPE_LEVEL_HIGH>;
1628 clocks = <&clks 160>, <&clks 161>; 1021 clocks = <&clks 160>, <&clks 161>;
1629 clock-names = "ipg", "per"; 1022 clock-names = "ipg", "per";
1630 dmas = <&sdma 33 4 0>, <&sdma 34 4 0>; 1023 dmas = <&sdma 33 4 0>, <&sdma 34 4 0>;
@@ -1634,13 +1027,65 @@
1634 }; 1027 };
1635 1028
1636 ipu1: ipu@02400000 { 1029 ipu1: ipu@02400000 {
1637 #crtc-cells = <1>; 1030 #address-cells = <1>;
1031 #size-cells = <0>;
1638 compatible = "fsl,imx6q-ipu"; 1032 compatible = "fsl,imx6q-ipu";
1639 reg = <0x02400000 0x400000>; 1033 reg = <0x02400000 0x400000>;
1640 interrupts = <0 6 0x4 0 5 0x4>; 1034 interrupts = <0 6 IRQ_TYPE_LEVEL_HIGH>,
1035 <0 5 IRQ_TYPE_LEVEL_HIGH>;
1641 clocks = <&clks 130>, <&clks 131>, <&clks 132>; 1036 clocks = <&clks 130>, <&clks 131>, <&clks 132>;
1642 clock-names = "bus", "di0", "di1"; 1037 clock-names = "bus", "di0", "di1";
1643 resets = <&src 2>; 1038 resets = <&src 2>;
1039
1040 ipu1_di0: port@2 {
1041 #address-cells = <1>;
1042 #size-cells = <0>;
1043 reg = <2>;
1044
1045 ipu1_di0_disp0: endpoint@0 {
1046 };
1047
1048 ipu1_di0_hdmi: endpoint@1 {
1049 remote-endpoint = <&hdmi_mux_0>;
1050 };
1051
1052 ipu1_di0_mipi: endpoint@2 {
1053 remote-endpoint = <&mipi_mux_0>;
1054 };
1055
1056 ipu1_di0_lvds0: endpoint@3 {
1057 remote-endpoint = <&lvds0_mux_0>;
1058 };
1059
1060 ipu1_di0_lvds1: endpoint@4 {
1061 remote-endpoint = <&lvds1_mux_0>;
1062 };
1063 };
1064
1065 ipu1_di1: port@3 {
1066 #address-cells = <1>;
1067 #size-cells = <0>;
1068 reg = <3>;
1069
1070 ipu1_di0_disp1: endpoint@0 {
1071 };
1072
1073 ipu1_di1_hdmi: endpoint@1 {
1074 remote-endpoint = <&hdmi_mux_1>;
1075 };
1076
1077 ipu1_di1_mipi: endpoint@2 {
1078 remote-endpoint = <&mipi_mux_1>;
1079 };
1080
1081 ipu1_di1_lvds0: endpoint@3 {
1082 remote-endpoint = <&lvds0_mux_1>;
1083 };
1084
1085 ipu1_di1_lvds1: endpoint@4 {
1086 remote-endpoint = <&lvds1_mux_1>;
1087 };
1088 };
1644 }; 1089 };
1645 }; 1090 };
1646}; 1091};
diff --git a/arch/arm/boot/dts/imx6sl-evk.dts b/arch/arm/boot/dts/imx6sl-evk.dts
index cc68e19c5163..864d8dfb51ca 100644
--- a/arch/arm/boot/dts/imx6sl-evk.dts
+++ b/arch/arm/boot/dts/imx6sl-evk.dts
@@ -8,6 +8,8 @@
8 8
9/dts-v1/; 9/dts-v1/;
10 10
11#include <dt-bindings/gpio/gpio.h>
12#include <dt-bindings/input/input.h>
11#include "imx6sl.dtsi" 13#include "imx6sl.dtsi"
12 14
13/ { 15/ {
@@ -18,11 +20,26 @@
18 reg = <0x80000000 0x40000000>; 20 reg = <0x80000000 0x40000000>;
19 }; 21 };
20 22
23 leds {
24 compatible = "gpio-leds";
25 pinctrl-names = "default";
26 pinctrl-0 = <&pinctrl_led>;
27
28 user {
29 label = "debug";
30 gpios = <&gpio3 20 GPIO_ACTIVE_HIGH>;
31 linux,default-trigger = "heartbeat";
32 };
33 };
34
21 regulators { 35 regulators {
22 compatible = "simple-bus"; 36 compatible = "simple-bus";
37 #address-cells = <1>;
38 #size-cells = <0>;
23 39
24 reg_usb_otg1_vbus: usb_otg1_vbus { 40 reg_usb_otg1_vbus: regulator@0 {
25 compatible = "regulator-fixed"; 41 compatible = "regulator-fixed";
42 reg = <0>;
26 regulator-name = "usb_otg1_vbus"; 43 regulator-name = "usb_otg1_vbus";
27 regulator-min-microvolt = <5000000>; 44 regulator-min-microvolt = <5000000>;
28 regulator-max-microvolt = <5000000>; 45 regulator-max-microvolt = <5000000>;
@@ -30,22 +47,63 @@
30 enable-active-high; 47 enable-active-high;
31 }; 48 };
32 49
33 reg_usb_otg2_vbus: usb_otg2_vbus { 50 reg_usb_otg2_vbus: regulator@1 {
34 compatible = "regulator-fixed"; 51 compatible = "regulator-fixed";
52 reg = <1>;
35 regulator-name = "usb_otg2_vbus"; 53 regulator-name = "usb_otg2_vbus";
36 regulator-min-microvolt = <5000000>; 54 regulator-min-microvolt = <5000000>;
37 regulator-max-microvolt = <5000000>; 55 regulator-max-microvolt = <5000000>;
38 gpio = <&gpio4 2 0>; 56 gpio = <&gpio4 2 0>;
39 enable-active-high; 57 enable-active-high;
40 }; 58 };
59
60 reg_aud3v: regulator@2 {
61 compatible = "regulator-fixed";
62 reg = <2>;
63 regulator-name = "wm8962-supply-3v15";
64 regulator-min-microvolt = <3150000>;
65 regulator-max-microvolt = <3150000>;
66 regulator-boot-on;
67 };
68
69 reg_aud4v: regulator@3 {
70 compatible = "regulator-fixed";
71 reg = <3>;
72 regulator-name = "wm8962-supply-4v2";
73 regulator-min-microvolt = <4325000>;
74 regulator-max-microvolt = <4325000>;
75 regulator-boot-on;
76 };
77 };
78
79 sound {
80 compatible = "fsl,imx6sl-evk-wm8962", "fsl,imx-audio-wm8962";
81 model = "wm8962-audio";
82 ssi-controller = <&ssi2>;
83 audio-codec = <&codec>;
84 audio-routing =
85 "Headphone Jack", "HPOUTL",
86 "Headphone Jack", "HPOUTR",
87 "Ext Spk", "SPKOUTL",
88 "Ext Spk", "SPKOUTR",
89 "AMIC", "MICBIAS",
90 "IN3R", "AMIC";
91 mux-int-port = <2>;
92 mux-ext-port = <3>;
41 }; 93 };
42}; 94};
43 95
96&audmux {
97 pinctrl-names = "default";
98 pinctrl-0 = <&pinctrl_audmux3>;
99 status = "okay";
100};
101
44&ecspi1 { 102&ecspi1 {
45 fsl,spi-num-chipselects = <1>; 103 fsl,spi-num-chipselects = <1>;
46 cs-gpios = <&gpio4 11 0>; 104 cs-gpios = <&gpio4 11 0>;
47 pinctrl-names = "default"; 105 pinctrl-names = "default";
48 pinctrl-0 = <&pinctrl_ecspi1_1>; 106 pinctrl-0 = <&pinctrl_ecspi1>;
49 status = "okay"; 107 status = "okay";
50 108
51 flash: m25p80@0 { 109 flash: m25p80@0 {
@@ -59,16 +117,144 @@
59 117
60&fec { 118&fec {
61 pinctrl-names = "default"; 119 pinctrl-names = "default";
62 pinctrl-0 = <&pinctrl_fec_1>; 120 pinctrl-0 = <&pinctrl_fec>;
63 phy-mode = "rmii"; 121 phy-mode = "rmii";
64 status = "okay"; 122 status = "okay";
65}; 123};
66 124
125&i2c1 {
126 clock-frequency = <100000>;
127 pinctrl-names = "default";
128 pinctrl-0 = <&pinctrl_i2c1>;
129 status = "okay";
130
131 pmic: pfuze100@08 {
132 compatible = "fsl,pfuze100";
133 reg = <0x08>;
134
135 regulators {
136 sw1a_reg: sw1ab {
137 regulator-min-microvolt = <300000>;
138 regulator-max-microvolt = <1875000>;
139 regulator-boot-on;
140 regulator-always-on;
141 regulator-ramp-delay = <6250>;
142 };
143
144 sw1c_reg: sw1c {
145 regulator-min-microvolt = <300000>;
146 regulator-max-microvolt = <1875000>;
147 regulator-boot-on;
148 regulator-always-on;
149 regulator-ramp-delay = <6250>;
150 };
151
152 sw2_reg: sw2 {
153 regulator-min-microvolt = <800000>;
154 regulator-max-microvolt = <3300000>;
155 regulator-boot-on;
156 regulator-always-on;
157 };
158
159 sw3a_reg: sw3a {
160 regulator-min-microvolt = <400000>;
161 regulator-max-microvolt = <1975000>;
162 regulator-boot-on;
163 regulator-always-on;
164 };
165
166 sw3b_reg: sw3b {
167 regulator-min-microvolt = <400000>;
168 regulator-max-microvolt = <1975000>;
169 regulator-boot-on;
170 regulator-always-on;
171 };
172
173 sw4_reg: sw4 {
174 regulator-min-microvolt = <800000>;
175 regulator-max-microvolt = <3300000>;
176 };
177
178 swbst_reg: swbst {
179 regulator-min-microvolt = <5000000>;
180 regulator-max-microvolt = <5150000>;
181 };
182
183 snvs_reg: vsnvs {
184 regulator-min-microvolt = <1000000>;
185 regulator-max-microvolt = <3000000>;
186 regulator-boot-on;
187 regulator-always-on;
188 };
189
190 vref_reg: vrefddr {
191 regulator-boot-on;
192 regulator-always-on;
193 };
194
195 vgen1_reg: vgen1 {
196 regulator-min-microvolt = <800000>;
197 regulator-max-microvolt = <1550000>;
198 regulator-always-on;
199 };
200
201 vgen2_reg: vgen2 {
202 regulator-min-microvolt = <800000>;
203 regulator-max-microvolt = <1550000>;
204 };
205
206 vgen3_reg: vgen3 {
207 regulator-min-microvolt = <1800000>;
208 regulator-max-microvolt = <3300000>;
209 };
210
211 vgen4_reg: vgen4 {
212 regulator-min-microvolt = <1800000>;
213 regulator-max-microvolt = <3300000>;
214 regulator-always-on;
215 };
216
217 vgen5_reg: vgen5 {
218 regulator-min-microvolt = <1800000>;
219 regulator-max-microvolt = <3300000>;
220 regulator-always-on;
221 };
222
223 vgen6_reg: vgen6 {
224 regulator-min-microvolt = <1800000>;
225 regulator-max-microvolt = <3300000>;
226 regulator-always-on;
227 };
228 };
229 };
230};
231
232&i2c2 {
233 clock-frequency = <100000>;
234 pinctrl-names = "default";
235 pinctrl-0 = <&pinctrl_i2c2>;
236 status = "okay";
237
238 codec: wm8962@1a {
239 compatible = "wlf,wm8962";
240 reg = <0x1a>;
241 clocks = <&clks IMX6SL_CLK_EXTERN_AUDIO>;
242 DCVDD-supply = <&vgen3_reg>;
243 DBVDD-supply = <&reg_aud3v>;
244 AVDD-supply = <&vgen3_reg>;
245 CPVDD-supply = <&vgen3_reg>;
246 MICVDD-supply = <&reg_aud3v>;
247 PLLVDD-supply = <&vgen3_reg>;
248 SPKVDD1-supply = <&reg_aud4v>;
249 SPKVDD2-supply = <&reg_aud4v>;
250 };
251};
252
67&iomuxc { 253&iomuxc {
68 pinctrl-names = "default"; 254 pinctrl-names = "default";
69 pinctrl-0 = <&pinctrl_hog>; 255 pinctrl-0 = <&pinctrl_hog>;
70 256
71 hog { 257 imx6sl-evk {
72 pinctrl_hog: hoggrp { 258 pinctrl_hog: hoggrp {
73 fsl,pins = < 259 fsl,pins = <
74 MX6SL_PAD_KEY_ROW7__GPIO4_IO07 0x17059 260 MX6SL_PAD_KEY_ROW7__GPIO4_IO07 0x17059
@@ -78,21 +264,230 @@
78 MX6SL_PAD_REF_CLK_32K__GPIO3_IO22 0x17059 264 MX6SL_PAD_REF_CLK_32K__GPIO3_IO22 0x17059
79 MX6SL_PAD_KEY_COL4__GPIO4_IO00 0x80000000 265 MX6SL_PAD_KEY_COL4__GPIO4_IO00 0x80000000
80 MX6SL_PAD_KEY_COL5__GPIO4_IO02 0x80000000 266 MX6SL_PAD_KEY_COL5__GPIO4_IO02 0x80000000
267 MX6SL_PAD_AUD_MCLK__AUDIO_CLK_OUT 0x4130b0
268 >;
269 };
270
271 pinctrl_audmux3: audmux3grp {
272 fsl,pins = <
273 MX6SL_PAD_AUD_RXD__AUD3_RXD 0x4130b0
274 MX6SL_PAD_AUD_TXC__AUD3_TXC 0x4130b0
275 MX6SL_PAD_AUD_TXD__AUD3_TXD 0x4110b0
276 MX6SL_PAD_AUD_TXFS__AUD3_TXFS 0x4130b0
277 >;
278 };
279
280 pinctrl_ecspi1: ecspi1grp {
281 fsl,pins = <
282 MX6SL_PAD_ECSPI1_MISO__ECSPI1_MISO 0x100b1
283 MX6SL_PAD_ECSPI1_MOSI__ECSPI1_MOSI 0x100b1
284 MX6SL_PAD_ECSPI1_SCLK__ECSPI1_SCLK 0x100b1
285 >;
286 };
287
288 pinctrl_fec: fecgrp {
289 fsl,pins = <
290 MX6SL_PAD_FEC_MDC__FEC_MDC 0x1b0b0
291 MX6SL_PAD_FEC_MDIO__FEC_MDIO 0x1b0b0
292 MX6SL_PAD_FEC_CRS_DV__FEC_RX_DV 0x1b0b0
293 MX6SL_PAD_FEC_RXD0__FEC_RX_DATA0 0x1b0b0
294 MX6SL_PAD_FEC_RXD1__FEC_RX_DATA1 0x1b0b0
295 MX6SL_PAD_FEC_TX_EN__FEC_TX_EN 0x1b0b0
296 MX6SL_PAD_FEC_TXD0__FEC_TX_DATA0 0x1b0b0
297 MX6SL_PAD_FEC_TXD1__FEC_TX_DATA1 0x1b0b0
298 MX6SL_PAD_FEC_REF_CLK__FEC_REF_OUT 0x4001b0a8
299 >;
300 };
301
302 pinctrl_i2c1: i2c1grp {
303 fsl,pins = <
304 MX6SL_PAD_I2C1_SCL__I2C1_SCL 0x4001b8b1
305 MX6SL_PAD_I2C1_SDA__I2C1_SDA 0x4001b8b1
306 >;
307 };
308
309
310 pinctrl_i2c2: i2c2grp {
311 fsl,pins = <
312 MX6SL_PAD_I2C2_SCL__I2C2_SCL 0x4001b8b1
313 MX6SL_PAD_I2C2_SDA__I2C2_SDA 0x4001b8b1
314 >;
315 };
316
317 pinctrl_led: ledgrp {
318 fsl,pins = <
319 MX6SL_PAD_HSIC_STROBE__GPIO3_IO20 0x17059
320 >;
321 };
322
323 pinctrl_kpp: kppgrp {
324 fsl,pins = <
325 MX6SL_PAD_KEY_ROW0__KEY_ROW0 0x1b010
326 MX6SL_PAD_KEY_ROW1__KEY_ROW1 0x1b010
327 MX6SL_PAD_KEY_ROW2__KEY_ROW2 0x1b0b0
328 MX6SL_PAD_KEY_COL0__KEY_COL0 0x110b0
329 MX6SL_PAD_KEY_COL1__KEY_COL1 0x110b0
330 MX6SL_PAD_KEY_COL2__KEY_COL2 0x110b0
331 >;
332 };
333
334 pinctrl_uart1: uart1grp {
335 fsl,pins = <
336 MX6SL_PAD_UART1_RXD__UART1_RX_DATA 0x1b0b1
337 MX6SL_PAD_UART1_TXD__UART1_TX_DATA 0x1b0b1
338 >;
339 };
340
341 pinctrl_usbotg1: usbotg1grp {
342 fsl,pins = <
343 MX6SL_PAD_EPDC_PWRCOM__USB_OTG1_ID 0x17059
344 >;
345 };
346
347 pinctrl_usdhc1: usdhc1grp {
348 fsl,pins = <
349 MX6SL_PAD_SD1_CMD__SD1_CMD 0x17059
350 MX6SL_PAD_SD1_CLK__SD1_CLK 0x10059
351 MX6SL_PAD_SD1_DAT0__SD1_DATA0 0x17059
352 MX6SL_PAD_SD1_DAT1__SD1_DATA1 0x17059
353 MX6SL_PAD_SD1_DAT2__SD1_DATA2 0x17059
354 MX6SL_PAD_SD1_DAT3__SD1_DATA3 0x17059
355 MX6SL_PAD_SD1_DAT4__SD1_DATA4 0x17059
356 MX6SL_PAD_SD1_DAT5__SD1_DATA5 0x17059
357 MX6SL_PAD_SD1_DAT6__SD1_DATA6 0x17059
358 MX6SL_PAD_SD1_DAT7__SD1_DATA7 0x17059
359 >;
360 };
361
362 pinctrl_usdhc1_100mhz: usdhc1grp100mhz {
363 fsl,pins = <
364 MX6SL_PAD_SD1_CMD__SD1_CMD 0x170b9
365 MX6SL_PAD_SD1_CLK__SD1_CLK 0x100b9
366 MX6SL_PAD_SD1_DAT0__SD1_DATA0 0x170b9
367 MX6SL_PAD_SD1_DAT1__SD1_DATA1 0x170b9
368 MX6SL_PAD_SD1_DAT2__SD1_DATA2 0x170b9
369 MX6SL_PAD_SD1_DAT3__SD1_DATA3 0x170b9
370 MX6SL_PAD_SD1_DAT4__SD1_DATA4 0x170b9
371 MX6SL_PAD_SD1_DAT5__SD1_DATA5 0x170b9
372 MX6SL_PAD_SD1_DAT6__SD1_DATA6 0x170b9
373 MX6SL_PAD_SD1_DAT7__SD1_DATA7 0x170b9
374 >;
375 };
376
377 pinctrl_usdhc1_200mhz: usdhc1grp200mhz {
378 fsl,pins = <
379 MX6SL_PAD_SD1_CMD__SD1_CMD 0x170f9
380 MX6SL_PAD_SD1_CLK__SD1_CLK 0x100f9
381 MX6SL_PAD_SD1_DAT0__SD1_DATA0 0x170f9
382 MX6SL_PAD_SD1_DAT1__SD1_DATA1 0x170f9
383 MX6SL_PAD_SD1_DAT2__SD1_DATA2 0x170f9
384 MX6SL_PAD_SD1_DAT3__SD1_DATA3 0x170f9
385 MX6SL_PAD_SD1_DAT4__SD1_DATA4 0x170f9
386 MX6SL_PAD_SD1_DAT5__SD1_DATA5 0x170f9
387 MX6SL_PAD_SD1_DAT6__SD1_DATA6 0x170f9
388 MX6SL_PAD_SD1_DAT7__SD1_DATA7 0x170f9
389 >;
390 };
391
392 pinctrl_usdhc2: usdhc2grp {
393 fsl,pins = <
394 MX6SL_PAD_SD2_CMD__SD2_CMD 0x17059
395 MX6SL_PAD_SD2_CLK__SD2_CLK 0x10059
396 MX6SL_PAD_SD2_DAT0__SD2_DATA0 0x17059
397 MX6SL_PAD_SD2_DAT1__SD2_DATA1 0x17059
398 MX6SL_PAD_SD2_DAT2__SD2_DATA2 0x17059
399 MX6SL_PAD_SD2_DAT3__SD2_DATA3 0x17059
400 >;
401 };
402
403 pinctrl_usdhc2_100mhz: usdhc2grp100mhz {
404 fsl,pins = <
405 MX6SL_PAD_SD2_CMD__SD2_CMD 0x170b9
406 MX6SL_PAD_SD2_CLK__SD2_CLK 0x100b9
407 MX6SL_PAD_SD2_DAT0__SD2_DATA0 0x170b9
408 MX6SL_PAD_SD2_DAT1__SD2_DATA1 0x170b9
409 MX6SL_PAD_SD2_DAT2__SD2_DATA2 0x170b9
410 MX6SL_PAD_SD2_DAT3__SD2_DATA3 0x170b9
411 >;
412 };
413
414 pinctrl_usdhc2_200mhz: usdhc2grp200mhz {
415 fsl,pins = <
416 MX6SL_PAD_SD2_CMD__SD2_CMD 0x170f9
417 MX6SL_PAD_SD2_CLK__SD2_CLK 0x100f9
418 MX6SL_PAD_SD2_DAT0__SD2_DATA0 0x170f9
419 MX6SL_PAD_SD2_DAT1__SD2_DATA1 0x170f9
420 MX6SL_PAD_SD2_DAT2__SD2_DATA2 0x170f9
421 MX6SL_PAD_SD2_DAT3__SD2_DATA3 0x170f9
422 >;
423 };
424
425 pinctrl_usdhc3: usdhc3grp {
426 fsl,pins = <
427 MX6SL_PAD_SD3_CMD__SD3_CMD 0x17059
428 MX6SL_PAD_SD3_CLK__SD3_CLK 0x10059
429 MX6SL_PAD_SD3_DAT0__SD3_DATA0 0x17059
430 MX6SL_PAD_SD3_DAT1__SD3_DATA1 0x17059
431 MX6SL_PAD_SD3_DAT2__SD3_DATA2 0x17059
432 MX6SL_PAD_SD3_DAT3__SD3_DATA3 0x17059
433 >;
434 };
435
436 pinctrl_usdhc3_100mhz: usdhc3grp100mhz {
437 fsl,pins = <
438 MX6SL_PAD_SD3_CMD__SD3_CMD 0x170b9
439 MX6SL_PAD_SD3_CLK__SD3_CLK 0x100b9
440 MX6SL_PAD_SD3_DAT0__SD3_DATA0 0x170b9
441 MX6SL_PAD_SD3_DAT1__SD3_DATA1 0x170b9
442 MX6SL_PAD_SD3_DAT2__SD3_DATA2 0x170b9
443 MX6SL_PAD_SD3_DAT3__SD3_DATA3 0x170b9
444 >;
445 };
446
447 pinctrl_usdhc3_200mhz: usdhc3grp200mhz {
448 fsl,pins = <
449 MX6SL_PAD_SD3_CMD__SD3_CMD 0x170f9
450 MX6SL_PAD_SD3_CLK__SD3_CLK 0x100f9
451 MX6SL_PAD_SD3_DAT0__SD3_DATA0 0x170f9
452 MX6SL_PAD_SD3_DAT1__SD3_DATA1 0x170f9
453 MX6SL_PAD_SD3_DAT2__SD3_DATA2 0x170f9
454 MX6SL_PAD_SD3_DAT3__SD3_DATA3 0x170f9
81 >; 455 >;
82 }; 456 };
83 }; 457 };
84}; 458};
85 459
460&kpp {
461 pinctrl-names = "default";
462 pinctrl-0 = <&pinctrl_kpp>;
463 linux,keymap = <
464 MATRIX_KEY(0x0, 0x0, KEY_UP) /* ROW0, COL0 */
465 MATRIX_KEY(0x0, 0x1, KEY_DOWN) /* ROW0, COL1 */
466 MATRIX_KEY(0x0, 0x2, KEY_ENTER) /* ROW0, COL2 */
467 MATRIX_KEY(0x1, 0x0, KEY_HOME) /* ROW1, COL0 */
468 MATRIX_KEY(0x1, 0x1, KEY_RIGHT) /* ROW1, COL1 */
469 MATRIX_KEY(0x1, 0x2, KEY_LEFT) /* ROW1, COL2 */
470 MATRIX_KEY(0x2, 0x0, KEY_VOLUMEDOWN) /* ROW2, COL0 */
471 MATRIX_KEY(0x2, 0x1, KEY_VOLUMEUP) /* ROW2, COL1 */
472 >;
473 status = "okay";
474};
475
476&ssi2 {
477 fsl,mode = "i2s-slave";
478 status = "okay";
479};
480
86&uart1 { 481&uart1 {
87 pinctrl-names = "default"; 482 pinctrl-names = "default";
88 pinctrl-0 = <&pinctrl_uart1_1>; 483 pinctrl-0 = <&pinctrl_uart1>;
89 status = "okay"; 484 status = "okay";
90}; 485};
91 486
92&usbotg1 { 487&usbotg1 {
93 vbus-supply = <&reg_usb_otg1_vbus>; 488 vbus-supply = <&reg_usb_otg1_vbus>;
94 pinctrl-names = "default"; 489 pinctrl-names = "default";
95 pinctrl-0 = <&pinctrl_usbotg1_1>; 490 pinctrl-0 = <&pinctrl_usbotg1>;
96 disable-over-current; 491 disable-over-current;
97 status = "okay"; 492 status = "okay";
98}; 493};
@@ -106,9 +501,9 @@
106 501
107&usdhc1 { 502&usdhc1 {
108 pinctrl-names = "default", "state_100mhz", "state_200mhz"; 503 pinctrl-names = "default", "state_100mhz", "state_200mhz";
109 pinctrl-0 = <&pinctrl_usdhc1_1>; 504 pinctrl-0 = <&pinctrl_usdhc1>;
110 pinctrl-1 = <&pinctrl_usdhc1_1_100mhz>; 505 pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
111 pinctrl-2 = <&pinctrl_usdhc1_1_200mhz>; 506 pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
112 bus-width = <8>; 507 bus-width = <8>;
113 cd-gpios = <&gpio4 7 0>; 508 cd-gpios = <&gpio4 7 0>;
114 wp-gpios = <&gpio4 6 0>; 509 wp-gpios = <&gpio4 6 0>;
@@ -117,9 +512,9 @@
117 512
118&usdhc2 { 513&usdhc2 {
119 pinctrl-names = "default", "state_100mhz", "state_200mhz"; 514 pinctrl-names = "default", "state_100mhz", "state_200mhz";
120 pinctrl-0 = <&pinctrl_usdhc2_1>; 515 pinctrl-0 = <&pinctrl_usdhc2>;
121 pinctrl-1 = <&pinctrl_usdhc2_1_100mhz>; 516 pinctrl-1 = <&pinctrl_usdhc2_100mhz>;
122 pinctrl-2 = <&pinctrl_usdhc2_1_200mhz>; 517 pinctrl-2 = <&pinctrl_usdhc2_200mhz>;
123 cd-gpios = <&gpio5 0 0>; 518 cd-gpios = <&gpio5 0 0>;
124 wp-gpios = <&gpio4 29 0>; 519 wp-gpios = <&gpio4 29 0>;
125 status = "okay"; 520 status = "okay";
@@ -127,9 +522,9 @@
127 522
128&usdhc3 { 523&usdhc3 {
129 pinctrl-names = "default", "state_100mhz", "state_200mhz"; 524 pinctrl-names = "default", "state_100mhz", "state_200mhz";
130 pinctrl-0 = <&pinctrl_usdhc3_1>; 525 pinctrl-0 = <&pinctrl_usdhc3>;
131 pinctrl-1 = <&pinctrl_usdhc3_1_100mhz>; 526 pinctrl-1 = <&pinctrl_usdhc3_100mhz>;
132 pinctrl-2 = <&pinctrl_usdhc3_1_200mhz>; 527 pinctrl-2 = <&pinctrl_usdhc3_200mhz>;
133 cd-gpios = <&gpio3 22 0>; 528 cd-gpios = <&gpio3 22 0>;
134 status = "okay"; 529 status = "okay";
135}; 530};
diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi
index 28558f1aaf2d..3cb4941afeef 100644
--- a/arch/arm/boot/dts/imx6sl.dtsi
+++ b/arch/arm/boot/dts/imx6sl.dtsi
@@ -7,6 +7,7 @@
7 * 7 *
8 */ 8 */
9 9
10#include <dt-bindings/interrupt-controller/irq.h>
10#include "skeleton.dtsi" 11#include "skeleton.dtsi"
11#include "imx6sl-pinfunc.h" 12#include "imx6sl-pinfunc.h"
12#include <dt-bindings/clock/imx6sl-clock.h> 13#include <dt-bindings/clock/imx6sl-clock.h>
@@ -27,6 +28,8 @@
27 spi1 = &ecspi2; 28 spi1 = &ecspi2;
28 spi2 = &ecspi3; 29 spi2 = &ecspi3;
29 spi3 = &ecspi4; 30 spi3 = &ecspi4;
31 usbphy0 = &usbphy1;
32 usbphy1 = &usbphy2;
30 }; 33 };
31 34
32 cpus { 35 cpus {
@@ -38,6 +41,27 @@
38 device_type = "cpu"; 41 device_type = "cpu";
39 reg = <0x0>; 42 reg = <0x0>;
40 next-level-cache = <&L2>; 43 next-level-cache = <&L2>;
44 operating-points = <
45 /* kHz uV */
46 996000 1275000
47 792000 1175000
48 396000 975000
49 >;
50 fsl,soc-operating-points = <
51 /* ARM kHz SOC-PU uV */
52 996000 1225000
53 792000 1175000
54 396000 1175000
55 >;
56 clock-latency = <61036>; /* two CLK32 periods */
57 clocks = <&clks IMX6SL_CLK_ARM>, <&clks IMX6SL_CLK_PLL2_PFD2>,
58 <&clks IMX6SL_CLK_STEP>, <&clks IMX6SL_CLK_PLL1_SW>,
59 <&clks IMX6SL_CLK_PLL1_SYS>;
60 clock-names = "arm", "pll2_pfd2_396m", "step",
61 "pll1_sw", "pll1_sys";
62 arm-supply = <&reg_arm>;
63 pu-supply = <&reg_pu>;
64 soc-supply = <&reg_soc>;
41 }; 65 };
42 }; 66 };
43 67
@@ -73,10 +97,16 @@
73 interrupt-parent = <&intc>; 97 interrupt-parent = <&intc>;
74 ranges; 98 ranges;
75 99
100 ocram: sram@00900000 {
101 compatible = "mmio-sram";
102 reg = <0x00900000 0x20000>;
103 clocks = <&clks IMX6SL_CLK_OCRAM>;
104 };
105
76 L2: l2-cache@00a02000 { 106 L2: l2-cache@00a02000 {
77 compatible = "arm,pl310-cache"; 107 compatible = "arm,pl310-cache";
78 reg = <0x00a02000 0x1000>; 108 reg = <0x00a02000 0x1000>;
79 interrupts = <0 92 0x04>; 109 interrupts = <0 92 IRQ_TYPE_LEVEL_HIGH>;
80 cache-unified; 110 cache-unified;
81 cache-level = <2>; 111 cache-level = <2>;
82 arm,tag-latency = <4 2 3>; 112 arm,tag-latency = <4 2 3>;
@@ -85,7 +115,7 @@
85 115
86 pmu { 116 pmu {
87 compatible = "arm,cortex-a9-pmu"; 117 compatible = "arm,cortex-a9-pmu";
88 interrupts = <0 94 0x04>; 118 interrupts = <0 94 IRQ_TYPE_LEVEL_HIGH>;
89 }; 119 };
90 120
91 aips1: aips-bus@02000000 { 121 aips1: aips-bus@02000000 {
@@ -104,7 +134,7 @@
104 134
105 spdif: spdif@02004000 { 135 spdif: spdif@02004000 {
106 reg = <0x02004000 0x4000>; 136 reg = <0x02004000 0x4000>;
107 interrupts = <0 52 0x04>; 137 interrupts = <0 52 IRQ_TYPE_LEVEL_HIGH>;
108 }; 138 };
109 139
110 ecspi1: ecspi@02008000 { 140 ecspi1: ecspi@02008000 {
@@ -112,7 +142,7 @@
112 #size-cells = <0>; 142 #size-cells = <0>;
113 compatible = "fsl,imx6sl-ecspi", "fsl,imx51-ecspi"; 143 compatible = "fsl,imx6sl-ecspi", "fsl,imx51-ecspi";
114 reg = <0x02008000 0x4000>; 144 reg = <0x02008000 0x4000>;
115 interrupts = <0 31 0x04>; 145 interrupts = <0 31 IRQ_TYPE_LEVEL_HIGH>;
116 clocks = <&clks IMX6SL_CLK_ECSPI1>, 146 clocks = <&clks IMX6SL_CLK_ECSPI1>,
117 <&clks IMX6SL_CLK_ECSPI1>; 147 <&clks IMX6SL_CLK_ECSPI1>;
118 clock-names = "ipg", "per"; 148 clock-names = "ipg", "per";
@@ -124,7 +154,7 @@
124 #size-cells = <0>; 154 #size-cells = <0>;
125 compatible = "fsl,imx6sl-ecspi", "fsl,imx51-ecspi"; 155 compatible = "fsl,imx6sl-ecspi", "fsl,imx51-ecspi";
126 reg = <0x0200c000 0x4000>; 156 reg = <0x0200c000 0x4000>;
127 interrupts = <0 32 0x04>; 157 interrupts = <0 32 IRQ_TYPE_LEVEL_HIGH>;
128 clocks = <&clks IMX6SL_CLK_ECSPI2>, 158 clocks = <&clks IMX6SL_CLK_ECSPI2>,
129 <&clks IMX6SL_CLK_ECSPI2>; 159 <&clks IMX6SL_CLK_ECSPI2>;
130 clock-names = "ipg", "per"; 160 clock-names = "ipg", "per";
@@ -136,7 +166,7 @@
136 #size-cells = <0>; 166 #size-cells = <0>;
137 compatible = "fsl,imx6sl-ecspi", "fsl,imx51-ecspi"; 167 compatible = "fsl,imx6sl-ecspi", "fsl,imx51-ecspi";
138 reg = <0x02010000 0x4000>; 168 reg = <0x02010000 0x4000>;
139 interrupts = <0 33 0x04>; 169 interrupts = <0 33 IRQ_TYPE_LEVEL_HIGH>;
140 clocks = <&clks IMX6SL_CLK_ECSPI3>, 170 clocks = <&clks IMX6SL_CLK_ECSPI3>,
141 <&clks IMX6SL_CLK_ECSPI3>; 171 <&clks IMX6SL_CLK_ECSPI3>;
142 clock-names = "ipg", "per"; 172 clock-names = "ipg", "per";
@@ -148,7 +178,7 @@
148 #size-cells = <0>; 178 #size-cells = <0>;
149 compatible = "fsl,imx6sl-ecspi", "fsl,imx51-ecspi"; 179 compatible = "fsl,imx6sl-ecspi", "fsl,imx51-ecspi";
150 reg = <0x02014000 0x4000>; 180 reg = <0x02014000 0x4000>;
151 interrupts = <0 34 0x04>; 181 interrupts = <0 34 IRQ_TYPE_LEVEL_HIGH>;
152 clocks = <&clks IMX6SL_CLK_ECSPI4>, 182 clocks = <&clks IMX6SL_CLK_ECSPI4>,
153 <&clks IMX6SL_CLK_ECSPI4>; 183 <&clks IMX6SL_CLK_ECSPI4>;
154 clock-names = "ipg", "per"; 184 clock-names = "ipg", "per";
@@ -159,7 +189,7 @@
159 compatible = "fsl,imx6sl-uart", 189 compatible = "fsl,imx6sl-uart",
160 "fsl,imx6q-uart", "fsl,imx21-uart"; 190 "fsl,imx6q-uart", "fsl,imx21-uart";
161 reg = <0x02018000 0x4000>; 191 reg = <0x02018000 0x4000>;
162 interrupts = <0 30 0x04>; 192 interrupts = <0 30 IRQ_TYPE_LEVEL_HIGH>;
163 clocks = <&clks IMX6SL_CLK_UART>, 193 clocks = <&clks IMX6SL_CLK_UART>,
164 <&clks IMX6SL_CLK_UART_SERIAL>; 194 <&clks IMX6SL_CLK_UART_SERIAL>;
165 clock-names = "ipg", "per"; 195 clock-names = "ipg", "per";
@@ -172,7 +202,7 @@
172 compatible = "fsl,imx6sl-uart", 202 compatible = "fsl,imx6sl-uart",
173 "fsl,imx6q-uart", "fsl,imx21-uart"; 203 "fsl,imx6q-uart", "fsl,imx21-uart";
174 reg = <0x02020000 0x4000>; 204 reg = <0x02020000 0x4000>;
175 interrupts = <0 26 0x04>; 205 interrupts = <0 26 IRQ_TYPE_LEVEL_HIGH>;
176 clocks = <&clks IMX6SL_CLK_UART>, 206 clocks = <&clks IMX6SL_CLK_UART>,
177 <&clks IMX6SL_CLK_UART_SERIAL>; 207 <&clks IMX6SL_CLK_UART_SERIAL>;
178 clock-names = "ipg", "per"; 208 clock-names = "ipg", "per";
@@ -185,7 +215,7 @@
185 compatible = "fsl,imx6sl-uart", 215 compatible = "fsl,imx6sl-uart",
186 "fsl,imx6q-uart", "fsl,imx21-uart"; 216 "fsl,imx6q-uart", "fsl,imx21-uart";
187 reg = <0x02024000 0x4000>; 217 reg = <0x02024000 0x4000>;
188 interrupts = <0 27 0x04>; 218 interrupts = <0 27 IRQ_TYPE_LEVEL_HIGH>;
189 clocks = <&clks IMX6SL_CLK_UART>, 219 clocks = <&clks IMX6SL_CLK_UART>,
190 <&clks IMX6SL_CLK_UART_SERIAL>; 220 <&clks IMX6SL_CLK_UART_SERIAL>;
191 clock-names = "ipg", "per"; 221 clock-names = "ipg", "per";
@@ -195,9 +225,11 @@
195 }; 225 };
196 226
197 ssi1: ssi@02028000 { 227 ssi1: ssi@02028000 {
198 compatible = "fsl,imx6sl-ssi","fsl,imx21-ssi"; 228 compatible = "fsl,imx6sl-ssi",
229 "fsl,imx51-ssi",
230 "fsl,imx21-ssi";
199 reg = <0x02028000 0x4000>; 231 reg = <0x02028000 0x4000>;
200 interrupts = <0 46 0x04>; 232 interrupts = <0 46 IRQ_TYPE_LEVEL_HIGH>;
201 clocks = <&clks IMX6SL_CLK_SSI1>; 233 clocks = <&clks IMX6SL_CLK_SSI1>;
202 dmas = <&sdma 37 1 0>, 234 dmas = <&sdma 37 1 0>,
203 <&sdma 38 1 0>; 235 <&sdma 38 1 0>;
@@ -207,9 +239,11 @@
207 }; 239 };
208 240
209 ssi2: ssi@0202c000 { 241 ssi2: ssi@0202c000 {
210 compatible = "fsl,imx6sl-ssi","fsl,imx21-ssi"; 242 compatible = "fsl,imx6sl-ssi",
243 "fsl,imx51-ssi",
244 "fsl,imx21-ssi";
211 reg = <0x0202c000 0x4000>; 245 reg = <0x0202c000 0x4000>;
212 interrupts = <0 47 0x04>; 246 interrupts = <0 47 IRQ_TYPE_LEVEL_HIGH>;
213 clocks = <&clks IMX6SL_CLK_SSI2>; 247 clocks = <&clks IMX6SL_CLK_SSI2>;
214 dmas = <&sdma 41 1 0>, 248 dmas = <&sdma 41 1 0>,
215 <&sdma 42 1 0>; 249 <&sdma 42 1 0>;
@@ -219,9 +253,11 @@
219 }; 253 };
220 254
221 ssi3: ssi@02030000 { 255 ssi3: ssi@02030000 {
222 compatible = "fsl,imx6sl-ssi","fsl,imx21-ssi"; 256 compatible = "fsl,imx6sl-ssi",
257 "fsl,imx51-ssi",
258 "fsl,imx21-ssi";
223 reg = <0x02030000 0x4000>; 259 reg = <0x02030000 0x4000>;
224 interrupts = <0 48 0x04>; 260 interrupts = <0 48 IRQ_TYPE_LEVEL_HIGH>;
225 clocks = <&clks IMX6SL_CLK_SSI3>; 261 clocks = <&clks IMX6SL_CLK_SSI3>;
226 dmas = <&sdma 45 1 0>, 262 dmas = <&sdma 45 1 0>,
227 <&sdma 46 1 0>; 263 <&sdma 46 1 0>;
@@ -234,7 +270,7 @@
234 compatible = "fsl,imx6sl-uart", 270 compatible = "fsl,imx6sl-uart",
235 "fsl,imx6q-uart", "fsl,imx21-uart"; 271 "fsl,imx6q-uart", "fsl,imx21-uart";
236 reg = <0x02034000 0x4000>; 272 reg = <0x02034000 0x4000>;
237 interrupts = <0 28 0x04>; 273 interrupts = <0 28 IRQ_TYPE_LEVEL_HIGH>;
238 clocks = <&clks IMX6SL_CLK_UART>, 274 clocks = <&clks IMX6SL_CLK_UART>,
239 <&clks IMX6SL_CLK_UART_SERIAL>; 275 <&clks IMX6SL_CLK_UART_SERIAL>;
240 clock-names = "ipg", "per"; 276 clock-names = "ipg", "per";
@@ -247,7 +283,7 @@
247 compatible = "fsl,imx6sl-uart", 283 compatible = "fsl,imx6sl-uart",
248 "fsl,imx6q-uart", "fsl,imx21-uart"; 284 "fsl,imx6q-uart", "fsl,imx21-uart";
249 reg = <0x02038000 0x4000>; 285 reg = <0x02038000 0x4000>;
250 interrupts = <0 29 0x04>; 286 interrupts = <0 29 IRQ_TYPE_LEVEL_HIGH>;
251 clocks = <&clks IMX6SL_CLK_UART>, 287 clocks = <&clks IMX6SL_CLK_UART>,
252 <&clks IMX6SL_CLK_UART_SERIAL>; 288 <&clks IMX6SL_CLK_UART_SERIAL>;
253 clock-names = "ipg", "per"; 289 clock-names = "ipg", "per";
@@ -261,7 +297,7 @@
261 #pwm-cells = <2>; 297 #pwm-cells = <2>;
262 compatible = "fsl,imx6sl-pwm", "fsl,imx27-pwm"; 298 compatible = "fsl,imx6sl-pwm", "fsl,imx27-pwm";
263 reg = <0x02080000 0x4000>; 299 reg = <0x02080000 0x4000>;
264 interrupts = <0 83 0x04>; 300 interrupts = <0 83 IRQ_TYPE_LEVEL_HIGH>;
265 clocks = <&clks IMX6SL_CLK_PWM1>, 301 clocks = <&clks IMX6SL_CLK_PWM1>,
266 <&clks IMX6SL_CLK_PWM1>; 302 <&clks IMX6SL_CLK_PWM1>;
267 clock-names = "ipg", "per"; 303 clock-names = "ipg", "per";
@@ -271,7 +307,7 @@
271 #pwm-cells = <2>; 307 #pwm-cells = <2>;
272 compatible = "fsl,imx6sl-pwm", "fsl,imx27-pwm"; 308 compatible = "fsl,imx6sl-pwm", "fsl,imx27-pwm";
273 reg = <0x02084000 0x4000>; 309 reg = <0x02084000 0x4000>;
274 interrupts = <0 84 0x04>; 310 interrupts = <0 84 IRQ_TYPE_LEVEL_HIGH>;
275 clocks = <&clks IMX6SL_CLK_PWM2>, 311 clocks = <&clks IMX6SL_CLK_PWM2>,
276 <&clks IMX6SL_CLK_PWM2>; 312 <&clks IMX6SL_CLK_PWM2>;
277 clock-names = "ipg", "per"; 313 clock-names = "ipg", "per";
@@ -281,7 +317,7 @@
281 #pwm-cells = <2>; 317 #pwm-cells = <2>;
282 compatible = "fsl,imx6sl-pwm", "fsl,imx27-pwm"; 318 compatible = "fsl,imx6sl-pwm", "fsl,imx27-pwm";
283 reg = <0x02088000 0x4000>; 319 reg = <0x02088000 0x4000>;
284 interrupts = <0 85 0x04>; 320 interrupts = <0 85 IRQ_TYPE_LEVEL_HIGH>;
285 clocks = <&clks IMX6SL_CLK_PWM3>, 321 clocks = <&clks IMX6SL_CLK_PWM3>,
286 <&clks IMX6SL_CLK_PWM3>; 322 <&clks IMX6SL_CLK_PWM3>;
287 clock-names = "ipg", "per"; 323 clock-names = "ipg", "per";
@@ -291,7 +327,7 @@
291 #pwm-cells = <2>; 327 #pwm-cells = <2>;
292 compatible = "fsl,imx6sl-pwm", "fsl,imx27-pwm"; 328 compatible = "fsl,imx6sl-pwm", "fsl,imx27-pwm";
293 reg = <0x0208c000 0x4000>; 329 reg = <0x0208c000 0x4000>;
294 interrupts = <0 86 0x04>; 330 interrupts = <0 86 IRQ_TYPE_LEVEL_HIGH>;
295 clocks = <&clks IMX6SL_CLK_PWM4>, 331 clocks = <&clks IMX6SL_CLK_PWM4>,
296 <&clks IMX6SL_CLK_PWM4>; 332 <&clks IMX6SL_CLK_PWM4>;
297 clock-names = "ipg", "per"; 333 clock-names = "ipg", "per";
@@ -300,7 +336,7 @@
300 gpt: gpt@02098000 { 336 gpt: gpt@02098000 {
301 compatible = "fsl,imx6sl-gpt"; 337 compatible = "fsl,imx6sl-gpt";
302 reg = <0x02098000 0x4000>; 338 reg = <0x02098000 0x4000>;
303 interrupts = <0 55 0x04>; 339 interrupts = <0 55 IRQ_TYPE_LEVEL_HIGH>;
304 clocks = <&clks IMX6SL_CLK_GPT>, 340 clocks = <&clks IMX6SL_CLK_GPT>,
305 <&clks IMX6SL_CLK_GPT_SERIAL>; 341 <&clks IMX6SL_CLK_GPT_SERIAL>;
306 clock-names = "ipg", "per"; 342 clock-names = "ipg", "per";
@@ -309,7 +345,8 @@
309 gpio1: gpio@0209c000 { 345 gpio1: gpio@0209c000 {
310 compatible = "fsl,imx6sl-gpio", "fsl,imx35-gpio"; 346 compatible = "fsl,imx6sl-gpio", "fsl,imx35-gpio";
311 reg = <0x0209c000 0x4000>; 347 reg = <0x0209c000 0x4000>;
312 interrupts = <0 66 0x04 0 67 0x04>; 348 interrupts = <0 66 IRQ_TYPE_LEVEL_HIGH>,
349 <0 67 IRQ_TYPE_LEVEL_HIGH>;
313 gpio-controller; 350 gpio-controller;
314 #gpio-cells = <2>; 351 #gpio-cells = <2>;
315 interrupt-controller; 352 interrupt-controller;
@@ -319,7 +356,8 @@
319 gpio2: gpio@020a0000 { 356 gpio2: gpio@020a0000 {
320 compatible = "fsl,imx6sl-gpio", "fsl,imx35-gpio"; 357 compatible = "fsl,imx6sl-gpio", "fsl,imx35-gpio";
321 reg = <0x020a0000 0x4000>; 358 reg = <0x020a0000 0x4000>;
322 interrupts = <0 68 0x04 0 69 0x04>; 359 interrupts = <0 68 IRQ_TYPE_LEVEL_HIGH>,
360 <0 69 IRQ_TYPE_LEVEL_HIGH>;
323 gpio-controller; 361 gpio-controller;
324 #gpio-cells = <2>; 362 #gpio-cells = <2>;
325 interrupt-controller; 363 interrupt-controller;
@@ -329,7 +367,8 @@
329 gpio3: gpio@020a4000 { 367 gpio3: gpio@020a4000 {
330 compatible = "fsl,imx6sl-gpio", "fsl,imx35-gpio"; 368 compatible = "fsl,imx6sl-gpio", "fsl,imx35-gpio";
331 reg = <0x020a4000 0x4000>; 369 reg = <0x020a4000 0x4000>;
332 interrupts = <0 70 0x04 0 71 0x04>; 370 interrupts = <0 70 IRQ_TYPE_LEVEL_HIGH>,
371 <0 71 IRQ_TYPE_LEVEL_HIGH>;
333 gpio-controller; 372 gpio-controller;
334 #gpio-cells = <2>; 373 #gpio-cells = <2>;
335 interrupt-controller; 374 interrupt-controller;
@@ -339,7 +378,8 @@
339 gpio4: gpio@020a8000 { 378 gpio4: gpio@020a8000 {
340 compatible = "fsl,imx6sl-gpio", "fsl,imx35-gpio"; 379 compatible = "fsl,imx6sl-gpio", "fsl,imx35-gpio";
341 reg = <0x020a8000 0x4000>; 380 reg = <0x020a8000 0x4000>;
342 interrupts = <0 72 0x04 0 73 0x04>; 381 interrupts = <0 72 IRQ_TYPE_LEVEL_HIGH>,
382 <0 73 IRQ_TYPE_LEVEL_HIGH>;
343 gpio-controller; 383 gpio-controller;
344 #gpio-cells = <2>; 384 #gpio-cells = <2>;
345 interrupt-controller; 385 interrupt-controller;
@@ -349,7 +389,8 @@
349 gpio5: gpio@020ac000 { 389 gpio5: gpio@020ac000 {
350 compatible = "fsl,imx6sl-gpio", "fsl,imx35-gpio"; 390 compatible = "fsl,imx6sl-gpio", "fsl,imx35-gpio";
351 reg = <0x020ac000 0x4000>; 391 reg = <0x020ac000 0x4000>;
352 interrupts = <0 74 0x04 0 75 0x04>; 392 interrupts = <0 74 IRQ_TYPE_LEVEL_HIGH>,
393 <0 75 IRQ_TYPE_LEVEL_HIGH>;
353 gpio-controller; 394 gpio-controller;
354 #gpio-cells = <2>; 395 #gpio-cells = <2>;
355 interrupt-controller; 396 interrupt-controller;
@@ -357,21 +398,23 @@
357 }; 398 };
358 399
359 kpp: kpp@020b8000 { 400 kpp: kpp@020b8000 {
401 compatible = "fsl,imx6sl-kpp", "fsl,imx21-kpp";
360 reg = <0x020b8000 0x4000>; 402 reg = <0x020b8000 0x4000>;
361 interrupts = <0 82 0x04>; 403 interrupts = <0 82 IRQ_TYPE_LEVEL_HIGH>;
404 clocks = <&clks IMX6SL_CLK_DUMMY>;
362 }; 405 };
363 406
364 wdog1: wdog@020bc000 { 407 wdog1: wdog@020bc000 {
365 compatible = "fsl,imx6sl-wdt", "fsl,imx21-wdt"; 408 compatible = "fsl,imx6sl-wdt", "fsl,imx21-wdt";
366 reg = <0x020bc000 0x4000>; 409 reg = <0x020bc000 0x4000>;
367 interrupts = <0 80 0x04>; 410 interrupts = <0 80 IRQ_TYPE_LEVEL_HIGH>;
368 clocks = <&clks IMX6SL_CLK_DUMMY>; 411 clocks = <&clks IMX6SL_CLK_DUMMY>;
369 }; 412 };
370 413
371 wdog2: wdog@020c0000 { 414 wdog2: wdog@020c0000 {
372 compatible = "fsl,imx6sl-wdt", "fsl,imx21-wdt"; 415 compatible = "fsl,imx6sl-wdt", "fsl,imx21-wdt";
373 reg = <0x020c0000 0x4000>; 416 reg = <0x020c0000 0x4000>;
374 interrupts = <0 81 0x04>; 417 interrupts = <0 81 IRQ_TYPE_LEVEL_HIGH>;
375 clocks = <&clks IMX6SL_CLK_DUMMY>; 418 clocks = <&clks IMX6SL_CLK_DUMMY>;
376 status = "disabled"; 419 status = "disabled";
377 }; 420 };
@@ -379,7 +422,8 @@
379 clks: ccm@020c4000 { 422 clks: ccm@020c4000 {
380 compatible = "fsl,imx6sl-ccm"; 423 compatible = "fsl,imx6sl-ccm";
381 reg = <0x020c4000 0x4000>; 424 reg = <0x020c4000 0x4000>;
382 interrupts = <0 87 0x04 0 88 0x04>; 425 interrupts = <0 87 IRQ_TYPE_LEVEL_HIGH>,
426 <0 88 IRQ_TYPE_LEVEL_HIGH>;
383 #clock-cells = <1>; 427 #clock-cells = <1>;
384 }; 428 };
385 429
@@ -388,7 +432,9 @@
388 "fsl,imx6q-anatop", 432 "fsl,imx6q-anatop",
389 "syscon", "simple-bus"; 433 "syscon", "simple-bus";
390 reg = <0x020c8000 0x1000>; 434 reg = <0x020c8000 0x1000>;
391 interrupts = <0 49 0x04 0 54 0x04 0 127 0x04>; 435 interrupts = <0 49 IRQ_TYPE_LEVEL_HIGH>,
436 <0 54 IRQ_TYPE_LEVEL_HIGH>,
437 <0 127 IRQ_TYPE_LEVEL_HIGH>;
392 438
393 regulator-1p1@110 { 439 regulator-1p1@110 {
394 compatible = "fsl,anatop-regulator"; 440 compatible = "fsl,anatop-regulator";
@@ -434,7 +480,7 @@
434 480
435 reg_arm: regulator-vddcore@140 { 481 reg_arm: regulator-vddcore@140 {
436 compatible = "fsl,anatop-regulator"; 482 compatible = "fsl,anatop-regulator";
437 regulator-name = "cpu"; 483 regulator-name = "vddarm";
438 regulator-min-microvolt = <725000>; 484 regulator-min-microvolt = <725000>;
439 regulator-max-microvolt = <1450000>; 485 regulator-max-microvolt = <1450000>;
440 regulator-always-on; 486 regulator-always-on;
@@ -487,15 +533,17 @@
487 usbphy1: usbphy@020c9000 { 533 usbphy1: usbphy@020c9000 {
488 compatible = "fsl,imx6sl-usbphy", "fsl,imx23-usbphy"; 534 compatible = "fsl,imx6sl-usbphy", "fsl,imx23-usbphy";
489 reg = <0x020c9000 0x1000>; 535 reg = <0x020c9000 0x1000>;
490 interrupts = <0 44 0x04>; 536 interrupts = <0 44 IRQ_TYPE_LEVEL_HIGH>;
491 clocks = <&clks IMX6SL_CLK_USBPHY1>; 537 clocks = <&clks IMX6SL_CLK_USBPHY1>;
538 fsl,anatop = <&anatop>;
492 }; 539 };
493 540
494 usbphy2: usbphy@020ca000 { 541 usbphy2: usbphy@020ca000 {
495 compatible = "fsl,imx6sl-usbphy", "fsl,imx23-usbphy"; 542 compatible = "fsl,imx6sl-usbphy", "fsl,imx23-usbphy";
496 reg = <0x020ca000 0x1000>; 543 reg = <0x020ca000 0x1000>;
497 interrupts = <0 45 0x04>; 544 interrupts = <0 45 IRQ_TYPE_LEVEL_HIGH>;
498 clocks = <&clks IMX6SL_CLK_USBPHY2>; 545 clocks = <&clks IMX6SL_CLK_USBPHY2>;
546 fsl,anatop = <&anatop>;
499 }; 547 };
500 548
501 snvs@020cc000 { 549 snvs@020cc000 {
@@ -507,31 +555,33 @@
507 snvs-rtc-lp@34 { 555 snvs-rtc-lp@34 {
508 compatible = "fsl,sec-v4.0-mon-rtc-lp"; 556 compatible = "fsl,sec-v4.0-mon-rtc-lp";
509 reg = <0x34 0x58>; 557 reg = <0x34 0x58>;
510 interrupts = <0 19 0x04 0 20 0x04>; 558 interrupts = <0 19 IRQ_TYPE_LEVEL_HIGH>,
559 <0 20 IRQ_TYPE_LEVEL_HIGH>;
511 }; 560 };
512 }; 561 };
513 562
514 epit1: epit@020d0000 { 563 epit1: epit@020d0000 {
515 reg = <0x020d0000 0x4000>; 564 reg = <0x020d0000 0x4000>;
516 interrupts = <0 56 0x04>; 565 interrupts = <0 56 IRQ_TYPE_LEVEL_HIGH>;
517 }; 566 };
518 567
519 epit2: epit@020d4000 { 568 epit2: epit@020d4000 {
520 reg = <0x020d4000 0x4000>; 569 reg = <0x020d4000 0x4000>;
521 interrupts = <0 57 0x04>; 570 interrupts = <0 57 IRQ_TYPE_LEVEL_HIGH>;
522 }; 571 };
523 572
524 src: src@020d8000 { 573 src: src@020d8000 {
525 compatible = "fsl,imx6sl-src", "fsl,imx51-src"; 574 compatible = "fsl,imx6sl-src", "fsl,imx51-src";
526 reg = <0x020d8000 0x4000>; 575 reg = <0x020d8000 0x4000>;
527 interrupts = <0 91 0x04 0 96 0x04>; 576 interrupts = <0 91 IRQ_TYPE_LEVEL_HIGH>,
577 <0 96 IRQ_TYPE_LEVEL_HIGH>;
528 #reset-cells = <1>; 578 #reset-cells = <1>;
529 }; 579 };
530 580
531 gpc: gpc@020dc000 { 581 gpc: gpc@020dc000 {
532 compatible = "fsl,imx6sl-gpc", "fsl,imx6q-gpc"; 582 compatible = "fsl,imx6sl-gpc", "fsl,imx6q-gpc";
533 reg = <0x020dc000 0x4000>; 583 reg = <0x020dc000 0x4000>;
534 interrupts = <0 89 0x04>; 584 interrupts = <0 89 IRQ_TYPE_LEVEL_HIGH>;
535 }; 585 };
536 586
537 gpr: iomuxc-gpr@020e0000 { 587 gpr: iomuxc-gpr@020e0000 {
@@ -543,235 +593,22 @@
543 iomuxc: iomuxc@020e0000 { 593 iomuxc: iomuxc@020e0000 {
544 compatible = "fsl,imx6sl-iomuxc"; 594 compatible = "fsl,imx6sl-iomuxc";
545 reg = <0x020e0000 0x4000>; 595 reg = <0x020e0000 0x4000>;
546
547 ecspi1 {
548 pinctrl_ecspi1_1: ecspi1grp-1 {
549 fsl,pins = <
550 MX6SL_PAD_ECSPI1_MISO__ECSPI1_MISO 0x100b1
551 MX6SL_PAD_ECSPI1_MOSI__ECSPI1_MOSI 0x100b1
552 MX6SL_PAD_ECSPI1_SCLK__ECSPI1_SCLK 0x100b1
553 >;
554 };
555 };
556
557 fec {
558 pinctrl_fec_1: fecgrp-1 {
559 fsl,pins = <
560 MX6SL_PAD_FEC_MDC__FEC_MDC 0x1b0b0
561 MX6SL_PAD_FEC_MDIO__FEC_MDIO 0x1b0b0
562 MX6SL_PAD_FEC_CRS_DV__FEC_RX_DV 0x1b0b0
563 MX6SL_PAD_FEC_RXD0__FEC_RX_DATA0 0x1b0b0
564 MX6SL_PAD_FEC_RXD1__FEC_RX_DATA1 0x1b0b0
565 MX6SL_PAD_FEC_TX_EN__FEC_TX_EN 0x1b0b0
566 MX6SL_PAD_FEC_TXD0__FEC_TX_DATA0 0x1b0b0
567 MX6SL_PAD_FEC_TXD1__FEC_TX_DATA1 0x1b0b0
568 MX6SL_PAD_FEC_REF_CLK__FEC_REF_OUT 0x4001b0a8
569 >;
570 };
571 };
572
573 uart1 {
574 pinctrl_uart1_1: uart1grp-1 {
575 fsl,pins = <
576 MX6SL_PAD_UART1_RXD__UART1_RX_DATA 0x1b0b1
577 MX6SL_PAD_UART1_TXD__UART1_TX_DATA 0x1b0b1
578 >;
579 };
580 };
581
582 usbotg1 {
583 pinctrl_usbotg1_1: usbotg1grp-1 {
584 fsl,pins = <
585 MX6SL_PAD_EPDC_PWRCOM__USB_OTG1_ID 0x17059
586 >;
587 };
588
589 pinctrl_usbotg1_2: usbotg1grp-2 {
590 fsl,pins = <
591 MX6SL_PAD_FEC_RXD0__USB_OTG1_ID 0x17059
592 >;
593 };
594
595 pinctrl_usbotg1_3: usbotg1grp-3 {
596 fsl,pins = <
597 MX6SL_PAD_LCD_DAT1__USB_OTG1_ID 0x17059
598 >;
599 };
600
601 pinctrl_usbotg1_4: usbotg1grp-4 {
602 fsl,pins = <
603 MX6SL_PAD_REF_CLK_32K__USB_OTG1_ID 0x17059
604 >;
605 };
606
607 pinctrl_usbotg1_5: usbotg1grp-5 {
608 fsl,pins = <
609 MX6SL_PAD_SD3_DAT0__USB_OTG1_ID 0x17059
610 >;
611 };
612 };
613
614 usbotg2 {
615 pinctrl_usbotg2_1: usbotg2grp-1 {
616 fsl,pins = <
617 MX6SL_PAD_ECSPI1_SCLK__USB_OTG2_OC 0x17059
618 >;
619 };
620
621 pinctrl_usbotg2_2: usbotg2grp-2 {
622 fsl,pins = <
623 MX6SL_PAD_ECSPI2_SCLK__USB_OTG2_OC 0x17059
624 >;
625 };
626
627 pinctrl_usbotg2_3: usbotg2grp-3 {
628 fsl,pins = <
629 MX6SL_PAD_KEY_ROW5__USB_OTG2_OC 0x17059
630 >;
631 };
632
633 pinctrl_usbotg2_4: usbotg2grp-4 {
634 fsl,pins = <
635 MX6SL_PAD_SD3_DAT2__USB_OTG2_OC 0x17059
636 >;
637 };
638 };
639
640 usdhc1 {
641 pinctrl_usdhc1_1: usdhc1grp-1 {
642 fsl,pins = <
643 MX6SL_PAD_SD1_CMD__SD1_CMD 0x17059
644 MX6SL_PAD_SD1_CLK__SD1_CLK 0x10059
645 MX6SL_PAD_SD1_DAT0__SD1_DATA0 0x17059
646 MX6SL_PAD_SD1_DAT1__SD1_DATA1 0x17059
647 MX6SL_PAD_SD1_DAT2__SD1_DATA2 0x17059
648 MX6SL_PAD_SD1_DAT3__SD1_DATA3 0x17059
649 MX6SL_PAD_SD1_DAT4__SD1_DATA4 0x17059
650 MX6SL_PAD_SD1_DAT5__SD1_DATA5 0x17059
651 MX6SL_PAD_SD1_DAT6__SD1_DATA6 0x17059
652 MX6SL_PAD_SD1_DAT7__SD1_DATA7 0x17059
653 >;
654 };
655
656 pinctrl_usdhc1_1_100mhz: usdhc1grp-1-100mhz {
657 fsl,pins = <
658 MX6SL_PAD_SD1_CMD__SD1_CMD 0x170b9
659 MX6SL_PAD_SD1_CLK__SD1_CLK 0x100b9
660 MX6SL_PAD_SD1_DAT0__SD1_DATA0 0x170b9
661 MX6SL_PAD_SD1_DAT1__SD1_DATA1 0x170b9
662 MX6SL_PAD_SD1_DAT2__SD1_DATA2 0x170b9
663 MX6SL_PAD_SD1_DAT3__SD1_DATA3 0x170b9
664 MX6SL_PAD_SD1_DAT4__SD1_DATA4 0x170b9
665 MX6SL_PAD_SD1_DAT5__SD1_DATA5 0x170b9
666 MX6SL_PAD_SD1_DAT6__SD1_DATA6 0x170b9
667 MX6SL_PAD_SD1_DAT7__SD1_DATA7 0x170b9
668 >;
669 };
670
671 pinctrl_usdhc1_1_200mhz: usdhc1grp-1-200mhz {
672 fsl,pins = <
673 MX6SL_PAD_SD1_CMD__SD1_CMD 0x170f9
674 MX6SL_PAD_SD1_CLK__SD1_CLK 0x100f9
675 MX6SL_PAD_SD1_DAT0__SD1_DATA0 0x170f9
676 MX6SL_PAD_SD1_DAT1__SD1_DATA1 0x170f9
677 MX6SL_PAD_SD1_DAT2__SD1_DATA2 0x170f9
678 MX6SL_PAD_SD1_DAT3__SD1_DATA3 0x170f9
679 MX6SL_PAD_SD1_DAT4__SD1_DATA4 0x170f9
680 MX6SL_PAD_SD1_DAT5__SD1_DATA5 0x170f9
681 MX6SL_PAD_SD1_DAT6__SD1_DATA6 0x170f9
682 MX6SL_PAD_SD1_DAT7__SD1_DATA7 0x170f9
683 >;
684 };
685
686
687 };
688
689 usdhc2 {
690 pinctrl_usdhc2_1: usdhc2grp-1 {
691 fsl,pins = <
692 MX6SL_PAD_SD2_CMD__SD2_CMD 0x17059
693 MX6SL_PAD_SD2_CLK__SD2_CLK 0x10059
694 MX6SL_PAD_SD2_DAT0__SD2_DATA0 0x17059
695 MX6SL_PAD_SD2_DAT1__SD2_DATA1 0x17059
696 MX6SL_PAD_SD2_DAT2__SD2_DATA2 0x17059
697 MX6SL_PAD_SD2_DAT3__SD2_DATA3 0x17059
698 >;
699 };
700
701 pinctrl_usdhc2_1_100mhz: usdhc2grp-1-100mhz {
702 fsl,pins = <
703 MX6SL_PAD_SD2_CMD__SD2_CMD 0x170b9
704 MX6SL_PAD_SD2_CLK__SD2_CLK 0x100b9
705 MX6SL_PAD_SD2_DAT0__SD2_DATA0 0x170b9
706 MX6SL_PAD_SD2_DAT1__SD2_DATA1 0x170b9
707 MX6SL_PAD_SD2_DAT2__SD2_DATA2 0x170b9
708 MX6SL_PAD_SD2_DAT3__SD2_DATA3 0x170b9
709 >;
710 };
711
712 pinctrl_usdhc2_1_200mhz: usdhc2grp-1-200mhz {
713 fsl,pins = <
714 MX6SL_PAD_SD2_CMD__SD2_CMD 0x170f9
715 MX6SL_PAD_SD2_CLK__SD2_CLK 0x100f9
716 MX6SL_PAD_SD2_DAT0__SD2_DATA0 0x170f9
717 MX6SL_PAD_SD2_DAT1__SD2_DATA1 0x170f9
718 MX6SL_PAD_SD2_DAT2__SD2_DATA2 0x170f9
719 MX6SL_PAD_SD2_DAT3__SD2_DATA3 0x170f9
720 >;
721 };
722
723 };
724
725 usdhc3 {
726 pinctrl_usdhc3_1: usdhc3grp-1 {
727 fsl,pins = <
728 MX6SL_PAD_SD3_CMD__SD3_CMD 0x17059
729 MX6SL_PAD_SD3_CLK__SD3_CLK 0x10059
730 MX6SL_PAD_SD3_DAT0__SD3_DATA0 0x17059
731 MX6SL_PAD_SD3_DAT1__SD3_DATA1 0x17059
732 MX6SL_PAD_SD3_DAT2__SD3_DATA2 0x17059
733 MX6SL_PAD_SD3_DAT3__SD3_DATA3 0x17059
734 >;
735 };
736
737 pinctrl_usdhc3_1_100mhz: usdhc3grp-1-100mhz {
738 fsl,pins = <
739 MX6SL_PAD_SD3_CMD__SD3_CMD 0x170b9
740 MX6SL_PAD_SD3_CLK__SD3_CLK 0x100b9
741 MX6SL_PAD_SD3_DAT0__SD3_DATA0 0x170b9
742 MX6SL_PAD_SD3_DAT1__SD3_DATA1 0x170b9
743 MX6SL_PAD_SD3_DAT2__SD3_DATA2 0x170b9
744 MX6SL_PAD_SD3_DAT3__SD3_DATA3 0x170b9
745 >;
746 };
747
748 pinctrl_usdhc3_1_200mhz: usdhc3grp-1-200mhz {
749 fsl,pins = <
750 MX6SL_PAD_SD3_CMD__SD3_CMD 0x170f9
751 MX6SL_PAD_SD3_CLK__SD3_CLK 0x100f9
752 MX6SL_PAD_SD3_DAT0__SD3_DATA0 0x170f9
753 MX6SL_PAD_SD3_DAT1__SD3_DATA1 0x170f9
754 MX6SL_PAD_SD3_DAT2__SD3_DATA2 0x170f9
755 MX6SL_PAD_SD3_DAT3__SD3_DATA3 0x170f9
756 >;
757 };
758 };
759 }; 596 };
760 597
761 csi: csi@020e4000 { 598 csi: csi@020e4000 {
762 reg = <0x020e4000 0x4000>; 599 reg = <0x020e4000 0x4000>;
763 interrupts = <0 7 0x04>; 600 interrupts = <0 7 IRQ_TYPE_LEVEL_HIGH>;
764 }; 601 };
765 602
766 spdc: spdc@020e8000 { 603 spdc: spdc@020e8000 {
767 reg = <0x020e8000 0x4000>; 604 reg = <0x020e8000 0x4000>;
768 interrupts = <0 6 0x04>; 605 interrupts = <0 6 IRQ_TYPE_LEVEL_HIGH>;
769 }; 606 };
770 607
771 sdma: sdma@020ec000 { 608 sdma: sdma@020ec000 {
772 compatible = "fsl,imx6sl-sdma", "fsl,imx35-sdma"; 609 compatible = "fsl,imx6sl-sdma", "fsl,imx35-sdma";
773 reg = <0x020ec000 0x4000>; 610 reg = <0x020ec000 0x4000>;
774 interrupts = <0 2 0x04>; 611 interrupts = <0 2 IRQ_TYPE_LEVEL_HIGH>;
775 clocks = <&clks IMX6SL_CLK_SDMA>, 612 clocks = <&clks IMX6SL_CLK_SDMA>,
776 <&clks IMX6SL_CLK_SDMA>; 613 <&clks IMX6SL_CLK_SDMA>;
777 clock-names = "ipg", "ahb"; 614 clock-names = "ipg", "ahb";
@@ -782,22 +619,22 @@
782 619
783 pxp: pxp@020f0000 { 620 pxp: pxp@020f0000 {
784 reg = <0x020f0000 0x4000>; 621 reg = <0x020f0000 0x4000>;
785 interrupts = <0 98 0x04>; 622 interrupts = <0 98 IRQ_TYPE_LEVEL_HIGH>;
786 }; 623 };
787 624
788 epdc: epdc@020f4000 { 625 epdc: epdc@020f4000 {
789 reg = <0x020f4000 0x4000>; 626 reg = <0x020f4000 0x4000>;
790 interrupts = <0 97 0x04>; 627 interrupts = <0 97 IRQ_TYPE_LEVEL_HIGH>;
791 }; 628 };
792 629
793 lcdif: lcdif@020f8000 { 630 lcdif: lcdif@020f8000 {
794 reg = <0x020f8000 0x4000>; 631 reg = <0x020f8000 0x4000>;
795 interrupts = <0 39 0x04>; 632 interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>;
796 }; 633 };
797 634
798 dcp: dcp@020fc000 { 635 dcp: dcp@020fc000 {
799 reg = <0x020fc000 0x4000>; 636 reg = <0x020fc000 0x4000>;
800 interrupts = <0 99 0x04>; 637 interrupts = <0 99 IRQ_TYPE_LEVEL_HIGH>;
801 }; 638 };
802 }; 639 };
803 640
@@ -811,7 +648,7 @@
811 usbotg1: usb@02184000 { 648 usbotg1: usb@02184000 {
812 compatible = "fsl,imx6sl-usb", "fsl,imx27-usb"; 649 compatible = "fsl,imx6sl-usb", "fsl,imx27-usb";
813 reg = <0x02184000 0x200>; 650 reg = <0x02184000 0x200>;
814 interrupts = <0 43 0x04>; 651 interrupts = <0 43 IRQ_TYPE_LEVEL_HIGH>;
815 clocks = <&clks IMX6SL_CLK_USBOH3>; 652 clocks = <&clks IMX6SL_CLK_USBOH3>;
816 fsl,usbphy = <&usbphy1>; 653 fsl,usbphy = <&usbphy1>;
817 fsl,usbmisc = <&usbmisc 0>; 654 fsl,usbmisc = <&usbmisc 0>;
@@ -821,7 +658,7 @@
821 usbotg2: usb@02184200 { 658 usbotg2: usb@02184200 {
822 compatible = "fsl,imx6sl-usb", "fsl,imx27-usb"; 659 compatible = "fsl,imx6sl-usb", "fsl,imx27-usb";
823 reg = <0x02184200 0x200>; 660 reg = <0x02184200 0x200>;
824 interrupts = <0 42 0x04>; 661 interrupts = <0 42 IRQ_TYPE_LEVEL_HIGH>;
825 clocks = <&clks IMX6SL_CLK_USBOH3>; 662 clocks = <&clks IMX6SL_CLK_USBOH3>;
826 fsl,usbphy = <&usbphy2>; 663 fsl,usbphy = <&usbphy2>;
827 fsl,usbmisc = <&usbmisc 1>; 664 fsl,usbmisc = <&usbmisc 1>;
@@ -831,7 +668,7 @@
831 usbh: usb@02184400 { 668 usbh: usb@02184400 {
832 compatible = "fsl,imx6sl-usb", "fsl,imx27-usb"; 669 compatible = "fsl,imx6sl-usb", "fsl,imx27-usb";
833 reg = <0x02184400 0x200>; 670 reg = <0x02184400 0x200>;
834 interrupts = <0 40 0x04>; 671 interrupts = <0 40 IRQ_TYPE_LEVEL_HIGH>;
835 clocks = <&clks IMX6SL_CLK_USBOH3>; 672 clocks = <&clks IMX6SL_CLK_USBOH3>;
836 fsl,usbmisc = <&usbmisc 2>; 673 fsl,usbmisc = <&usbmisc 2>;
837 status = "disabled"; 674 status = "disabled";
@@ -847,7 +684,7 @@
847 fec: ethernet@02188000 { 684 fec: ethernet@02188000 {
848 compatible = "fsl,imx6sl-fec", "fsl,imx25-fec"; 685 compatible = "fsl,imx6sl-fec", "fsl,imx25-fec";
849 reg = <0x02188000 0x4000>; 686 reg = <0x02188000 0x4000>;
850 interrupts = <0 114 0x04>; 687 interrupts = <0 114 IRQ_TYPE_LEVEL_HIGH>;
851 clocks = <&clks IMX6SL_CLK_ENET_REF>, 688 clocks = <&clks IMX6SL_CLK_ENET_REF>,
852 <&clks IMX6SL_CLK_ENET_REF>; 689 <&clks IMX6SL_CLK_ENET_REF>;
853 clock-names = "ipg", "ahb"; 690 clock-names = "ipg", "ahb";
@@ -857,7 +694,7 @@
857 usdhc1: usdhc@02190000 { 694 usdhc1: usdhc@02190000 {
858 compatible = "fsl,imx6sl-usdhc", "fsl,imx6q-usdhc"; 695 compatible = "fsl,imx6sl-usdhc", "fsl,imx6q-usdhc";
859 reg = <0x02190000 0x4000>; 696 reg = <0x02190000 0x4000>;
860 interrupts = <0 22 0x04>; 697 interrupts = <0 22 IRQ_TYPE_LEVEL_HIGH>;
861 clocks = <&clks IMX6SL_CLK_USDHC1>, 698 clocks = <&clks IMX6SL_CLK_USDHC1>,
862 <&clks IMX6SL_CLK_USDHC1>, 699 <&clks IMX6SL_CLK_USDHC1>,
863 <&clks IMX6SL_CLK_USDHC1>; 700 <&clks IMX6SL_CLK_USDHC1>;
@@ -869,7 +706,7 @@
869 usdhc2: usdhc@02194000 { 706 usdhc2: usdhc@02194000 {
870 compatible = "fsl,imx6sl-usdhc", "fsl,imx6q-usdhc"; 707 compatible = "fsl,imx6sl-usdhc", "fsl,imx6q-usdhc";
871 reg = <0x02194000 0x4000>; 708 reg = <0x02194000 0x4000>;
872 interrupts = <0 23 0x04>; 709 interrupts = <0 23 IRQ_TYPE_LEVEL_HIGH>;
873 clocks = <&clks IMX6SL_CLK_USDHC2>, 710 clocks = <&clks IMX6SL_CLK_USDHC2>,
874 <&clks IMX6SL_CLK_USDHC2>, 711 <&clks IMX6SL_CLK_USDHC2>,
875 <&clks IMX6SL_CLK_USDHC2>; 712 <&clks IMX6SL_CLK_USDHC2>;
@@ -881,7 +718,7 @@
881 usdhc3: usdhc@02198000 { 718 usdhc3: usdhc@02198000 {
882 compatible = "fsl,imx6sl-usdhc", "fsl,imx6q-usdhc"; 719 compatible = "fsl,imx6sl-usdhc", "fsl,imx6q-usdhc";
883 reg = <0x02198000 0x4000>; 720 reg = <0x02198000 0x4000>;
884 interrupts = <0 24 0x04>; 721 interrupts = <0 24 IRQ_TYPE_LEVEL_HIGH>;
885 clocks = <&clks IMX6SL_CLK_USDHC3>, 722 clocks = <&clks IMX6SL_CLK_USDHC3>,
886 <&clks IMX6SL_CLK_USDHC3>, 723 <&clks IMX6SL_CLK_USDHC3>,
887 <&clks IMX6SL_CLK_USDHC3>; 724 <&clks IMX6SL_CLK_USDHC3>;
@@ -893,7 +730,7 @@
893 usdhc4: usdhc@0219c000 { 730 usdhc4: usdhc@0219c000 {
894 compatible = "fsl,imx6sl-usdhc", "fsl,imx6q-usdhc"; 731 compatible = "fsl,imx6sl-usdhc", "fsl,imx6q-usdhc";
895 reg = <0x0219c000 0x4000>; 732 reg = <0x0219c000 0x4000>;
896 interrupts = <0 25 0x04>; 733 interrupts = <0 25 IRQ_TYPE_LEVEL_HIGH>;
897 clocks = <&clks IMX6SL_CLK_USDHC4>, 734 clocks = <&clks IMX6SL_CLK_USDHC4>,
898 <&clks IMX6SL_CLK_USDHC4>, 735 <&clks IMX6SL_CLK_USDHC4>,
899 <&clks IMX6SL_CLK_USDHC4>; 736 <&clks IMX6SL_CLK_USDHC4>;
@@ -907,7 +744,7 @@
907 #size-cells = <0>; 744 #size-cells = <0>;
908 compatible = "fsl,imx6sl-i2c", "fsl,imx21-i2c"; 745 compatible = "fsl,imx6sl-i2c", "fsl,imx21-i2c";
909 reg = <0x021a0000 0x4000>; 746 reg = <0x021a0000 0x4000>;
910 interrupts = <0 36 0x04>; 747 interrupts = <0 36 IRQ_TYPE_LEVEL_HIGH>;
911 clocks = <&clks IMX6SL_CLK_I2C1>; 748 clocks = <&clks IMX6SL_CLK_I2C1>;
912 status = "disabled"; 749 status = "disabled";
913 }; 750 };
@@ -917,7 +754,7 @@
917 #size-cells = <0>; 754 #size-cells = <0>;
918 compatible = "fsl,imx6sl-i2c", "fsl,imx21-i2c"; 755 compatible = "fsl,imx6sl-i2c", "fsl,imx21-i2c";
919 reg = <0x021a4000 0x4000>; 756 reg = <0x021a4000 0x4000>;
920 interrupts = <0 37 0x04>; 757 interrupts = <0 37 IRQ_TYPE_LEVEL_HIGH>;
921 clocks = <&clks IMX6SL_CLK_I2C2>; 758 clocks = <&clks IMX6SL_CLK_I2C2>;
922 status = "disabled"; 759 status = "disabled";
923 }; 760 };
@@ -927,7 +764,7 @@
927 #size-cells = <0>; 764 #size-cells = <0>;
928 compatible = "fsl,imx6sl-i2c", "fsl,imx21-i2c"; 765 compatible = "fsl,imx6sl-i2c", "fsl,imx21-i2c";
929 reg = <0x021a8000 0x4000>; 766 reg = <0x021a8000 0x4000>;
930 interrupts = <0 38 0x04>; 767 interrupts = <0 38 IRQ_TYPE_LEVEL_HIGH>;
931 clocks = <&clks IMX6SL_CLK_I2C3>; 768 clocks = <&clks IMX6SL_CLK_I2C3>;
932 status = "disabled"; 769 status = "disabled";
933 }; 770 };
@@ -939,12 +776,12 @@
939 776
940 rngb: rngb@021b4000 { 777 rngb: rngb@021b4000 {
941 reg = <0x021b4000 0x4000>; 778 reg = <0x021b4000 0x4000>;
942 interrupts = <0 5 0x04>; 779 interrupts = <0 5 IRQ_TYPE_LEVEL_HIGH>;
943 }; 780 };
944 781
945 weim: weim@021b8000 { 782 weim: weim@021b8000 {
946 reg = <0x021b8000 0x4000>; 783 reg = <0x021b8000 0x4000>;
947 interrupts = <0 14 0x04>; 784 interrupts = <0 14 IRQ_TYPE_LEVEL_HIGH>;
948 }; 785 };
949 786
950 ocotp: ocotp@021bc000 { 787 ocotp: ocotp@021bc000 {
diff --git a/arch/arm/boot/dts/integratorap.dts b/arch/arm/boot/dts/integratorap.dts
index e6be9315ff0a..b10e6351da53 100644
--- a/arch/arm/boot/dts/integratorap.dts
+++ b/arch/arm/boot/dts/integratorap.dts
@@ -18,6 +18,28 @@
18 bootargs = "root=/dev/ram0 console=ttyAM0,38400n8 earlyprintk"; 18 bootargs = "root=/dev/ram0 console=ttyAM0,38400n8 earlyprintk";
19 }; 19 };
20 20
21 /* 24 MHz chrystal on the core module */
22 xtal24mhz: xtal24mhz@24M {
23 #clock-cells = <0>;
24 compatible = "fixed-clock";
25 clock-frequency = <24000000>;
26 };
27
28 pclk: pclk@0 {
29 #clock-cells = <0>;
30 compatible = "fixed-factor-clock";
31 clock-div = <1>;
32 clock-mult = <1>;
33 clocks = <&xtal24mhz>;
34 };
35
36 /* The UART clock is 14.74 MHz divided by an ICS525 */
37 uartclk: uartclk@14.74M {
38 #clock-cells = <0>;
39 compatible = "fixed-clock";
40 clock-frequency = <14745600>;
41 };
42
21 syscon { 43 syscon {
22 compatible = "arm,integrator-ap-syscon"; 44 compatible = "arm,integrator-ap-syscon";
23 reg = <0x11000000 0x100>; 45 reg = <0x11000000 0x100>;
@@ -28,14 +50,17 @@
28 50
29 timer0: timer@13000000 { 51 timer0: timer@13000000 {
30 compatible = "arm,integrator-timer"; 52 compatible = "arm,integrator-timer";
53 clocks = <&xtal24mhz>;
31 }; 54 };
32 55
33 timer1: timer@13000100 { 56 timer1: timer@13000100 {
34 compatible = "arm,integrator-timer"; 57 compatible = "arm,integrator-timer";
58 clocks = <&xtal24mhz>;
35 }; 59 };
36 60
37 timer2: timer@13000200 { 61 timer2: timer@13000200 {
38 compatible = "arm,integrator-timer"; 62 compatible = "arm,integrator-timer";
63 clocks = <&xtal24mhz>;
39 }; 64 };
40 65
41 pic: pic@14000000 { 66 pic: pic@14000000 {
@@ -92,26 +117,36 @@
92 rtc: rtc@15000000 { 117 rtc: rtc@15000000 {
93 compatible = "arm,pl030", "arm,primecell"; 118 compatible = "arm,pl030", "arm,primecell";
94 arm,primecell-periphid = <0x00041030>; 119 arm,primecell-periphid = <0x00041030>;
120 clocks = <&pclk>;
121 clock-names = "apb_pclk";
95 }; 122 };
96 123
97 uart0: uart@16000000 { 124 uart0: uart@16000000 {
98 compatible = "arm,pl010", "arm,primecell"; 125 compatible = "arm,pl010", "arm,primecell";
99 arm,primecell-periphid = <0x00041010>; 126 arm,primecell-periphid = <0x00041010>;
127 clocks = <&uartclk>, <&pclk>;
128 clock-names = "uartclk", "apb_pclk";
100 }; 129 };
101 130
102 uart1: uart@17000000 { 131 uart1: uart@17000000 {
103 compatible = "arm,pl010", "arm,primecell"; 132 compatible = "arm,pl010", "arm,primecell";
104 arm,primecell-periphid = <0x00041010>; 133 arm,primecell-periphid = <0x00041010>;
134 clocks = <&uartclk>, <&pclk>;
135 clock-names = "uartclk", "apb_pclk";
105 }; 136 };
106 137
107 kmi0: kmi@18000000 { 138 kmi0: kmi@18000000 {
108 compatible = "arm,pl050", "arm,primecell"; 139 compatible = "arm,pl050", "arm,primecell";
109 arm,primecell-periphid = <0x00041050>; 140 arm,primecell-periphid = <0x00041050>;
141 clocks = <&xtal24mhz>, <&pclk>;
142 clock-names = "KMIREFCLK", "apb_pclk";
110 }; 143 };
111 144
112 kmi1: kmi@19000000 { 145 kmi1: kmi@19000000 {
113 compatible = "arm,pl050", "arm,primecell"; 146 compatible = "arm,pl050", "arm,primecell";
114 arm,primecell-periphid = <0x00041050>; 147 arm,primecell-periphid = <0x00041050>;
148 clocks = <&xtal24mhz>, <&pclk>;
149 clock-names = "KMIREFCLK", "apb_pclk";
115 }; 150 };
116 }; 151 };
117}; 152};
diff --git a/arch/arm/boot/dts/integratorcp.dts b/arch/arm/boot/dts/integratorcp.dts
index a21c17de9a5e..d43f15b4f79a 100644
--- a/arch/arm/boot/dts/integratorcp.dts
+++ b/arch/arm/boot/dts/integratorcp.dts
@@ -13,25 +13,107 @@
13 bootargs = "root=/dev/ram0 console=ttyAMA0,38400n8 earlyprintk"; 13 bootargs = "root=/dev/ram0 console=ttyAMA0,38400n8 earlyprintk";
14 }; 14 };
15 15
16 /*
17 * The Integrator/CP overall clocking architecture can be found in
18 * ARM DUI 0184B page 7-28 "Integrator/CP922T system clocks" which
19 * appear to illustrate the layout used in most configurations.
20 */
21
22 /* The codec chrystal operates at 24.576 MHz */
23 xtal_codec: xtal24.576@24.576M {
24 #clock-cells = <0>;
25 compatible = "fixed-clock";
26 clock-frequency = <24576000>;
27 };
28
29 /* The chrystal is divided by 2 by the codec for the AACI bit clock */
30 aaci_bitclk: aaci_bitclk@12.288M {
31 #clock-cells = <0>;
32 compatible = "fixed-factor-clock";
33 clock-div = <2>;
34 clock-mult = <1>;
35 clocks = <&xtal_codec>;
36 };
37
38 /* This is a 25MHz chrystal on the base board */
39 xtal25mhz: xtal25mhz@25M {
40 #clock-cells = <0>;
41 compatible = "fixed-clock";
42 clock-frequency = <25000000>;
43 };
44
45 /* The UART clock is 14.74 MHz divided from 25MHz by an ICS525 */
46 uartclk: uartclk@14.74M {
47 #clock-cells = <0>;
48 compatible = "fixed-clock";
49 clock-frequency = <14745600>;
50 };
51
52 /* Actually sysclk I think */
53 pclk: pclk@0 {
54 #clock-cells = <0>;
55 compatible = "fixed-clock";
56 clock-frequency = <0>;
57 };
58
59 core-module@10000000 {
60 /* 24 MHz chrystal on the core module */
61 xtal24mhz: xtal24mhz@24M {
62 #clock-cells = <0>;
63 compatible = "fixed-clock";
64 clock-frequency = <24000000>;
65 };
66
67 /*
68 * External oscillator on the core module, usually used
69 * to drive video circuitry. Driven from the 24MHz clock.
70 */
71 auxosc: cm_aux_osc@25M {
72 #clock-cells = <0>;
73 compatible = "arm,integrator-cm-auxosc";
74 clocks = <&xtal24mhz>;
75 };
76
77 /* The KMI clock is the 24 MHz oscillator divided to 8MHz */
78 kmiclk: kmiclk@1M {
79 #clock-cells = <0>;
80 compatible = "fixed-factor-clock";
81 clock-div = <3>;
82 clock-mult = <1>;
83 clocks = <&xtal24mhz>;
84 };
85
86 /* The timer clock is the 24 MHz oscillator divided to 1MHz */
87 timclk: timclk@1M {
88 #clock-cells = <0>;
89 compatible = "fixed-factor-clock";
90 clock-div = <24>;
91 clock-mult = <1>;
92 clocks = <&xtal24mhz>;
93 };
94 };
95
16 syscon { 96 syscon {
17 compatible = "arm,integrator-cp-syscon"; 97 compatible = "arm,integrator-cp-syscon";
18 reg = <0xcb000000 0x100>; 98 reg = <0xcb000000 0x100>;
19 }; 99 };
20 100
21 timer0: timer@13000000 { 101 timer0: timer@13000000 {
22 /* TIMER0 runs @ 25MHz */ 102 /* TIMER0 runs directly on the 25MHz chrystal */
23 compatible = "arm,integrator-cp-timer"; 103 compatible = "arm,integrator-cp-timer";
24 status = "disabled"; 104 clocks = <&xtal25mhz>;
25 }; 105 };
26 106
27 timer1: timer@13000100 { 107 timer1: timer@13000100 {
28 /* TIMER1 runs @ 1MHz */ 108 /* TIMER1 runs @ 1MHz */
29 compatible = "arm,integrator-cp-timer"; 109 compatible = "arm,integrator-cp-timer";
110 clocks = <&timclk>;
30 }; 111 };
31 112
32 timer2: timer@13000200 { 113 timer2: timer@13000200 {
33 /* TIMER2 runs @ 1MHz */ 114 /* TIMER2 runs @ 1MHz */
34 compatible = "arm,integrator-cp-timer"; 115 compatible = "arm,integrator-cp-timer";
116 clocks = <&timclk>;
35 }; 117 };
36 118
37 pic: pic@14000000 { 119 pic: pic@14000000 {
@@ -74,22 +156,32 @@
74 */ 156 */
75 rtc@15000000 { 157 rtc@15000000 {
76 compatible = "arm,pl031", "arm,primecell"; 158 compatible = "arm,pl031", "arm,primecell";
159 clocks = <&pclk>;
160 clock-names = "apb_pclk";
77 }; 161 };
78 162
79 uart@16000000 { 163 uart@16000000 {
80 compatible = "arm,pl011", "arm,primecell"; 164 compatible = "arm,pl011", "arm,primecell";
165 clocks = <&uartclk>, <&pclk>;
166 clock-names = "uartclk", "apb_pclk";
81 }; 167 };
82 168
83 uart@17000000 { 169 uart@17000000 {
84 compatible = "arm,pl011", "arm,primecell"; 170 compatible = "arm,pl011", "arm,primecell";
171 clocks = <&uartclk>, <&pclk>;
172 clock-names = "uartclk", "apb_pclk";
85 }; 173 };
86 174
87 kmi@18000000 { 175 kmi@18000000 {
88 compatible = "arm,pl050", "arm,primecell"; 176 compatible = "arm,pl050", "arm,primecell";
177 clocks = <&kmiclk>, <&pclk>;
178 clock-names = "KMIREFCLK", "apb_pclk";
89 }; 179 };
90 180
91 kmi@19000000 { 181 kmi@19000000 {
92 compatible = "arm,pl050", "arm,primecell"; 182 compatible = "arm,pl050", "arm,primecell";
183 clocks = <&kmiclk>, <&pclk>;
184 clock-names = "KMIREFCLK", "apb_pclk";
93 }; 185 };
94 186
95 /* 187 /*
@@ -100,18 +192,24 @@
100 reg = <0x1c000000 0x1000>; 192 reg = <0x1c000000 0x1000>;
101 interrupts = <23 24>; 193 interrupts = <23 24>;
102 max-frequency = <515633>; 194 max-frequency = <515633>;
195 clocks = <&uartclk>, <&pclk>;
196 clock-names = "mclk", "apb_pclk";
103 }; 197 };
104 198
105 aaci@1d000000 { 199 aaci@1d000000 {
106 compatible = "arm,pl041", "arm,primecell"; 200 compatible = "arm,pl041", "arm,primecell";
107 reg = <0x1d000000 0x1000>; 201 reg = <0x1d000000 0x1000>;
108 interrupts = <25>; 202 interrupts = <25>;
203 clocks = <&pclk>;
204 clock-names = "apb_pclk";
109 }; 205 };
110 206
111 clcd@c0000000 { 207 clcd@c0000000 {
112 compatible = "arm,pl110", "arm,primecell"; 208 compatible = "arm,pl110", "arm,primecell";
113 reg = <0xC0000000 0x1000>; 209 reg = <0xC0000000 0x1000>;
114 interrupts = <22>; 210 interrupts = <22>;
211 clocks = <&auxosc>, <&pclk>;
212 clock-names = "clcd", "apb_pclk";
115 }; 213 };
116 }; 214 };
117}; 215};
diff --git a/arch/arm/boot/dts/k2e-clocks.dtsi b/arch/arm/boot/dts/k2e-clocks.dtsi
new file mode 100644
index 000000000000..90774d604bc1
--- /dev/null
+++ b/arch/arm/boot/dts/k2e-clocks.dtsi
@@ -0,0 +1,78 @@
1/*
2 * Copyright 2014 Texas Instruments, Inc.
3 *
4 * Keystone 2 Edison SoC specific device tree
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
11clocks {
12 mainpllclk: mainpllclk@2310110 {
13 #clock-cells = <0>;
14 compatible = "ti,keystone,main-pll-clock";
15 clocks = <&refclksys>;
16 reg = <0x02620350 4>, <0x02310110 4>;
17 reg-names = "control", "multiplier";
18 fixed-postdiv = <2>;
19 };
20
21 papllclk: papllclk@2620358 {
22 #clock-cells = <0>;
23 compatible = "ti,keystone,pll-clock";
24 clocks = <&refclkpass>;
25 clock-output-names = "pa-pll-clk";
26 reg = <0x02620358 4>;
27 reg-names = "control";
28 };
29
30 ddr3apllclk: ddr3apllclk@2620360 {
31 #clock-cells = <0>;
32 compatible = "ti,keystone,pll-clock";
33 clocks = <&refclkddr3a>;
34 clock-output-names = "ddr-3a-pll-clk";
35 reg = <0x02620360 4>;
36 reg-names = "control";
37 };
38
39 clkusb1: clkusb1 {
40 #clock-cells = <0>;
41 compatible = "ti,keystone,psc-clock";
42 clocks = <&chipclk16>;
43 clock-output-names = "usb";
44 reg = <0x02350004 0xb00>, <0x02350000 0x400>;
45 reg-names = "control", "domain";
46 domain-id = <0>;
47 };
48
49 clkhyperlink0: clkhyperlink0 {
50 #clock-cells = <0>;
51 compatible = "ti,keystone,psc-clock";
52 clocks = <&chipclk12>;
53 clock-output-names = "hyperlink-0";
54 reg = <0x02350030 0xb00>, <0x02350014 0x400>;
55 reg-names = "control", "domain";
56 domain-id = <5>;
57 };
58
59 clkpcie1: clkpcie1 {
60 #clock-cells = <0>;
61 compatible = "ti,keystone,psc-clock";
62 clocks = <&chipclk12>;
63 clock-output-names = "pcie";
64 reg = <0x0235006c 0xb00>, <0x02350000 0x400>;
65 reg-names = "control", "domain";
66 domain-id = <18>;
67 };
68
69 clkxge: clkxge {
70 #clock-cells = <0>;
71 compatible = "ti,keystone,psc-clock";
72 clocks = <&chipclk13>;
73 clock-output-names = "xge";
74 reg = <0x023500c8 0xb00>, <0x02350074 0x400>;
75 reg-names = "control", "domain";
76 domain-id = <29>;
77 };
78};
diff --git a/arch/arm/boot/dts/k2e-evm.dts b/arch/arm/boot/dts/k2e-evm.dts
new file mode 100644
index 000000000000..74b3b63e94cf
--- /dev/null
+++ b/arch/arm/boot/dts/k2e-evm.dts
@@ -0,0 +1,60 @@
1/*
2 * Copyright 2013-2014 Texas Instruments, Inc.
3 *
4 * Keystone 2 Edison EVM device tree
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/dts-v1/;
11
12#include "keystone.dtsi"
13#include "k2e.dtsi"
14
15/ {
16 compatible = "ti,k2e-evm","ti,keystone";
17 model = "Texas Instruments Keystone 2 Edison EVM";
18
19 soc {
20
21 clocks {
22 refclksys: refclksys {
23 #clock-cells = <0>;
24 compatible = "fixed-clock";
25 clock-frequency = <100000000>;
26 clock-output-names = "refclk-sys";
27 };
28
29 refclkpass: refclkpass {
30 #clock-cells = <0>;
31 compatible = "fixed-clock";
32 clock-frequency = <100000000>;
33 clock-output-names = "refclk-pass";
34 };
35
36 refclkddr3a: refclkddr3a {
37 #clock-cells = <0>;
38 compatible = "fixed-clock";
39 clock-frequency = <100000000>;
40 clock-output-names = "refclk-ddr3a";
41 };
42 };
43 };
44};
45
46&usb_phy {
47 status = "okay";
48};
49
50&usb {
51 status = "okay";
52};
53
54&usb1_phy {
55 status = "okay";
56};
57
58&usb1 {
59 status = "okay";
60};
diff --git a/arch/arm/boot/dts/k2e.dtsi b/arch/arm/boot/dts/k2e.dtsi
new file mode 100644
index 000000000000..03d01909525b
--- /dev/null
+++ b/arch/arm/boot/dts/k2e.dtsi
@@ -0,0 +1,80 @@
1/*
2 * Copyright 2013-2014 Texas Instruments, Inc.
3 *
4 * Keystone 2 Edison soc device tree
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/ {
12 cpus {
13 #address-cells = <1>;
14 #size-cells = <0>;
15
16 interrupt-parent = <&gic>;
17
18 cpu@0 {
19 compatible = "arm,cortex-a15";
20 device_type = "cpu";
21 reg = <0>;
22 };
23
24 cpu@1 {
25 compatible = "arm,cortex-a15";
26 device_type = "cpu";
27 reg = <1>;
28 };
29
30 cpu@2 {
31 compatible = "arm,cortex-a15";
32 device_type = "cpu";
33 reg = <2>;
34 };
35
36 cpu@3 {
37 compatible = "arm,cortex-a15";
38 device_type = "cpu";
39 reg = <3>;
40 };
41 };
42
43 soc {
44 /include/ "k2e-clocks.dtsi"
45
46 usb: usb@2680000 {
47 interrupts = <GIC_SPI 152 IRQ_TYPE_EDGE_RISING>;
48 dwc3@2690000 {
49 interrupts = <GIC_SPI 152 IRQ_TYPE_EDGE_RISING>;
50 };
51 };
52
53 usb1_phy: usb_phy@2620750 {
54 compatible = "ti,keystone-usbphy";
55 #address-cells = <1>;
56 #size-cells = <1>;
57 reg = <0x2620750 24>;
58 status = "disabled";
59 };
60
61 usb1: usb@25000000 {
62 compatible = "ti,keystone-dwc3";
63 #address-cells = <1>;
64 #size-cells = <1>;
65 reg = <0x25000000 0x10000>;
66 clocks = <&clkusb1>;
67 clock-names = "usb";
68 interrupts = <GIC_SPI 414 IRQ_TYPE_EDGE_RISING>;
69 ranges;
70 status = "disabled";
71
72 dwc3@25010000 {
73 compatible = "synopsys,dwc3";
74 reg = <0x25010000 0x70000>;
75 interrupts = <GIC_SPI 414 IRQ_TYPE_EDGE_RISING>;
76 usb-phy = <&usb1_phy>, <&usb1_phy>;
77 };
78 };
79 };
80};
diff --git a/arch/arm/boot/dts/k2hk-clocks.dtsi b/arch/arm/boot/dts/k2hk-clocks.dtsi
new file mode 100644
index 000000000000..96e65365afe3
--- /dev/null
+++ b/arch/arm/boot/dts/k2hk-clocks.dtsi
@@ -0,0 +1,426 @@
1/*
2 * Copyright 2013-2014 Texas Instruments, Inc.
3 *
4 * Keystone 2 Kepler/Hawking SoC clock nodes
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
11clocks {
12 armpllclk: armpllclk@2620370 {
13 #clock-cells = <0>;
14 compatible = "ti,keystone,pll-clock";
15 clocks = <&refclkarm>;
16 clock-output-names = "arm-pll-clk";
17 reg = <0x02620370 4>;
18 reg-names = "control";
19 };
20
21 mainpllclk: mainpllclk@2310110 {
22 #clock-cells = <0>;
23 compatible = "ti,keystone,main-pll-clock";
24 clocks = <&refclksys>;
25 reg = <0x02620350 4>, <0x02310110 4>;
26 reg-names = "control", "multiplier";
27 fixed-postdiv = <2>;
28 };
29
30 papllclk: papllclk@2620358 {
31 #clock-cells = <0>;
32 compatible = "ti,keystone,pll-clock";
33 clocks = <&refclkpass>;
34 clock-output-names = "pa-pll-clk";
35 reg = <0x02620358 4>;
36 reg-names = "control";
37 };
38
39 ddr3apllclk: ddr3apllclk@2620360 {
40 #clock-cells = <0>;
41 compatible = "ti,keystone,pll-clock";
42 clocks = <&refclkddr3a>;
43 clock-output-names = "ddr-3a-pll-clk";
44 reg = <0x02620360 4>;
45 reg-names = "control";
46 };
47
48 ddr3bpllclk: ddr3bpllclk@2620368 {
49 #clock-cells = <0>;
50 compatible = "ti,keystone,pll-clock";
51 clocks = <&refclkddr3b>;
52 clock-output-names = "ddr-3b-pll-clk";
53 reg = <0x02620368 4>;
54 reg-names = "control";
55 };
56
57 clktsip: clktsip {
58 #clock-cells = <0>;
59 compatible = "ti,keystone,psc-clock";
60 clocks = <&chipclk16>;
61 clock-output-names = "tsip";
62 reg = <0x02350000 0xb00>, <0x02350000 0x400>;
63 reg-names = "control", "domain";
64 domain-id = <0>;
65 };
66
67 clksrio: clksrio {
68 #clock-cells = <0>;
69 compatible = "ti,keystone,psc-clock";
70 clocks = <&chipclk1rstiso13>;
71 clock-output-names = "srio";
72 reg = <0x0235002c 0xb00>, <0x02350010 0x400>;
73 reg-names = "control", "domain";
74 domain-id = <4>;
75 };
76
77 clkhyperlink0: clkhyperlink0 {
78 #clock-cells = <0>;
79 compatible = "ti,keystone,psc-clock";
80 clocks = <&chipclk12>;
81 clock-output-names = "hyperlink-0";
82 reg = <0x02350030 0xb00>, <0x02350014 0x400>;
83 reg-names = "control", "domain";
84 domain-id = <5>;
85 };
86
87 clkgem1: clkgem1 {
88 #clock-cells = <0>;
89 compatible = "ti,keystone,psc-clock";
90 clocks = <&chipclk1>;
91 clock-output-names = "gem1";
92 reg = <0x02350040 0xb00>, <0x02350024 0x400>;
93 reg-names = "control", "domain";
94 domain-id = <9>;
95 };
96
97 clkgem2: clkgem2 {
98 #clock-cells = <0>;
99 compatible = "ti,keystone,psc-clock";
100 clocks = <&chipclk1>;
101 clock-output-names = "gem2";
102 reg = <0x02350044 0xb00>, <0x02350028 0x400>;
103 reg-names = "control", "domain";
104 domain-id = <10>;
105 };
106
107 clkgem3: clkgem3 {
108 #clock-cells = <0>;
109 compatible = "ti,keystone,psc-clock";
110 clocks = <&chipclk1>;
111 clock-output-names = "gem3";
112 reg = <0x02350048 0xb00>, <0x0235002c 0x400>;
113 reg-names = "control", "domain";
114 domain-id = <11>;
115 };
116
117 clkgem4: clkgem4 {
118 #clock-cells = <0>;
119 compatible = "ti,keystone,psc-clock";
120 clocks = <&chipclk1>;
121 clock-output-names = "gem4";
122 reg = <0x0235004c 0xb00>, <0x02350030 0x400>;
123 reg-names = "control", "domain";
124 domain-id = <12>;
125 };
126
127 clkgem5: clkgem5 {
128 #clock-cells = <0>;
129 compatible = "ti,keystone,psc-clock";
130 clocks = <&chipclk1>;
131 clock-output-names = "gem5";
132 reg = <0x02350050 0xb00>, <0x02350034 0x400>;
133 reg-names = "control", "domain";
134 domain-id = <13>;
135 };
136
137 clkgem6: clkgem6 {
138 #clock-cells = <0>;
139 compatible = "ti,keystone,psc-clock";
140 clocks = <&chipclk1>;
141 clock-output-names = "gem6";
142 reg = <0x02350054 0xb00>, <0x02350038 0x400>;
143 reg-names = "control", "domain";
144 domain-id = <14>;
145 };
146
147 clkgem7: clkgem7 {
148 #clock-cells = <0>;
149 compatible = "ti,keystone,psc-clock";
150 clocks = <&chipclk1>;
151 clock-output-names = "gem7";
152 reg = <0x02350058 0xb00>, <0x0235003c 0x400>;
153 reg-names = "control", "domain";
154 domain-id = <15>;
155 };
156
157 clkddr31: clkddr31 {
158 #clock-cells = <0>;
159 compatible = "ti,keystone,psc-clock";
160 clocks = <&chipclk13>;
161 clock-output-names = "ddr3-1";
162 reg = <0x02350060 0xb00>, <0x02350040 0x400>;
163 reg-names = "control", "domain";
164 domain-id = <16>;
165 };
166
167 clktac: clktac {
168 #clock-cells = <0>;
169 compatible = "ti,keystone,psc-clock";
170 clocks = <&chipclk13>;
171 clock-output-names = "tac";
172 reg = <0x02350064 0xb00>, <0x02350044 0x400>;
173 reg-names = "control", "domain";
174 domain-id = <17>;
175 };
176
177 clkrac01: clkrac01 {
178 #clock-cells = <0>;
179 compatible = "ti,keystone,psc-clock";
180 clocks = <&chipclk13>;
181 clock-output-names = "rac-01";
182 reg = <0x02350068 0xb00>, <0x02350044 0x400>;
183 reg-names = "control", "domain";
184 domain-id = <17>;
185 };
186
187 clkrac23: clkrac23 {
188 #clock-cells = <0>;
189 compatible = "ti,keystone,psc-clock";
190 clocks = <&chipclk13>;
191 clock-output-names = "rac-23";
192 reg = <0x0235006c 0xb00>, <0x02350048 0x400>;
193 reg-names = "control", "domain";
194 domain-id = <18>;
195 };
196
197 clkfftc0: clkfftc0 {
198 #clock-cells = <0>;
199 compatible = "ti,keystone,psc-clock";
200 clocks = <&chipclk13>;
201 clock-output-names = "fftc-0";
202 reg = <0x02350070 0xb00>, <0x0235004c 0x400>;
203 reg-names = "control", "domain";
204 domain-id = <19>;
205 };
206
207 clkfftc1: clkfftc1 {
208 #clock-cells = <0>;
209 compatible = "ti,keystone,psc-clock";
210 clocks = <&chipclk13>;
211 clock-output-names = "fftc-1";
212 reg = <0x02350074 0xb00>, <0x0235004c 0x400>;
213 reg-names = "control", "domain";
214 domain-id = <19>;
215 };
216
217 clkfftc2: clkfftc2 {
218 #clock-cells = <0>;
219 compatible = "ti,keystone,psc-clock";
220 clocks = <&chipclk13>;
221 clock-output-names = "fftc-2";
222 reg = <0x02350078 0xb00>, <0x02350050 0x400>;
223 reg-names = "control", "domain";
224 domain-id = <20>;
225 };
226
227 clkfftc3: clkfftc3 {
228 #clock-cells = <0>;
229 compatible = "ti,keystone,psc-clock";
230 clocks = <&chipclk13>;
231 clock-output-names = "fftc-3";
232 reg = <0x0235007c 0xb00>, <0x02350050 0x400>;
233 reg-names = "control", "domain";
234 domain-id = <20>;
235 };
236
237 clkfftc4: clkfftc4 {
238 #clock-cells = <0>;
239 compatible = "ti,keystone,psc-clock";
240 clocks = <&chipclk13>;
241 clock-output-names = "fftc-4";
242 reg = <0x02350080 0xb00>, <0x02350050 0x400>;
243 reg-names = "control", "domain";
244 domain-id = <20>;
245 };
246
247 clkfftc5: clkfftc5 {
248 #clock-cells = <0>;
249 compatible = "ti,keystone,psc-clock";
250 clocks = <&chipclk13>;
251 clock-output-names = "fftc-5";
252 reg = <0x02350084 0xb00>, <0x02350050 0x400>;
253 reg-names = "control", "domain";
254 domain-id = <20>;
255 };
256
257 clkaif: clkaif {
258 #clock-cells = <0>;
259 compatible = "ti,keystone,psc-clock";
260 clocks = <&chipclk13>;
261 clock-output-names = "aif";
262 reg = <0x02350088 0xb00>, <0x02350054 0x400>;
263 reg-names = "control", "domain";
264 domain-id = <21>;
265 };
266
267 clktcp3d0: clktcp3d0 {
268 #clock-cells = <0>;
269 compatible = "ti,keystone,psc-clock";
270 clocks = <&chipclk13>;
271 clock-output-names = "tcp3d-0";
272 reg = <0x0235008c 0xb00>, <0x02350058 0x400>;
273 reg-names = "control", "domain";
274 domain-id = <22>;
275 };
276
277 clktcp3d1: clktcp3d1 {
278 #clock-cells = <0>;
279 compatible = "ti,keystone,psc-clock";
280 clocks = <&chipclk13>;
281 clock-output-names = "tcp3d-1";
282 reg = <0x02350090 0xb00>, <0x02350058 0x400>;
283 reg-names = "control", "domain";
284 domain-id = <22>;
285 };
286
287 clktcp3d2: clktcp3d2 {
288 #clock-cells = <0>;
289 compatible = "ti,keystone,psc-clock";
290 clocks = <&chipclk13>;
291 clock-output-names = "tcp3d-2";
292 reg = <0x02350094 0xb00>, <0x0235005c 0x400>;
293 reg-names = "control", "domain";
294 domain-id = <23>;
295 };
296
297 clktcp3d3: clktcp3d3 {
298 #clock-cells = <0>;
299 compatible = "ti,keystone,psc-clock";
300 clocks = <&chipclk13>;
301 clock-output-names = "tcp3d-3";
302 reg = <0x02350098 0xb00>, <0x0235005c 0x400>;
303 reg-names = "control", "domain";
304 domain-id = <23>;
305 };
306
307 clkvcp0: clkvcp0 {
308 #clock-cells = <0>;
309 compatible = "ti,keystone,psc-clock";
310 clocks = <&chipclk13>;
311 clock-output-names = "vcp-0";
312 reg = <0x0235009c 0xb00>, <0x02350060 0x400>;
313 reg-names = "control", "domain";
314 domain-id = <24>;
315 };
316
317 clkvcp1: clkvcp1 {
318 #clock-cells = <0>;
319 compatible = "ti,keystone,psc-clock";
320 clocks = <&chipclk13>;
321 clock-output-names = "vcp-1";
322 reg = <0x023500a0 0xb00>, <0x02350060 0x400>;
323 reg-names = "control", "domain";
324 domain-id = <24>;
325 };
326
327 clkvcp2: clkvcp2 {
328 #clock-cells = <0>;
329 compatible = "ti,keystone,psc-clock";
330 clocks = <&chipclk13>;
331 clock-output-names = "vcp-2";
332 reg = <0x023500a4 0xb00>, <0x02350060 0x400>;
333 reg-names = "control", "domain";
334 domain-id = <24>;
335 };
336
337 clkvcp3: clkvcp3 {
338 #clock-cells = <0>;
339 compatible = "ti,keystone,psc-clock";
340 clocks = <&chipclk13>;
341 clock-output-names = "vcp-3";
342 reg = <0x023500a8 0xb00>, <0x02350060 0x400>;
343 reg-names = "control", "domain";
344 domain-id = <24>;
345 };
346
347 clkvcp4: clkvcp4 {
348 #clock-cells = <0>;
349 compatible = "ti,keystone,psc-clock";
350 clocks = <&chipclk13>;
351 clock-output-names = "vcp-4";
352 reg = <0x023500ac 0xb00>, <0x02350064 0x400>;
353 reg-names = "control", "domain";
354 domain-id = <25>;
355 };
356
357 clkvcp5: clkvcp5 {
358 #clock-cells = <0>;
359 compatible = "ti,keystone,psc-clock";
360 clocks = <&chipclk13>;
361 clock-output-names = "vcp-5";
362 reg = <0x023500b0 0xb00>, <0x02350064 0x400>;
363 reg-names = "control", "domain";
364 domain-id = <25>;
365 };
366
367 clkvcp6: clkvcp6 {
368 #clock-cells = <0>;
369 compatible = "ti,keystone,psc-clock";
370 clocks = <&chipclk13>;
371 clock-output-names = "vcp-6";
372 reg = <0x023500b4 0xb00>, <0x02350064 0x400>;
373 reg-names = "control", "domain";
374 domain-id = <25>;
375 };
376
377 clkvcp7: clkvcp7 {
378 #clock-cells = <0>;
379 compatible = "ti,keystone,psc-clock";
380 clocks = <&chipclk13>;
381 clock-output-names = "vcp-7";
382 reg = <0x023500b8 0xb00>, <0x02350064 0x400>;
383 reg-names = "control", "domain";
384 domain-id = <25>;
385 };
386
387 clkbcp: clkbcp {
388 #clock-cells = <0>;
389 compatible = "ti,keystone,psc-clock";
390 clocks = <&chipclk13>;
391 clock-output-names = "bcp";
392 reg = <0x023500bc 0xb00>, <0x02350068 0x400>;
393 reg-names = "control", "domain";
394 domain-id = <26>;
395 };
396
397 clkdxb: clkdxb {
398 #clock-cells = <0>;
399 compatible = "ti,keystone,psc-clock";
400 clocks = <&chipclk13>;
401 clock-output-names = "dxb";
402 reg = <0x023500c0 0xb00>, <0x0235006c 0x400>;
403 reg-names = "control", "domain";
404 domain-id = <27>;
405 };
406
407 clkhyperlink1: clkhyperlink1 {
408 #clock-cells = <0>;
409 compatible = "ti,keystone,psc-clock";
410 clocks = <&chipclk12>;
411 clock-output-names = "hyperlink-1";
412 reg = <0x023500c4 0xb00>, <0x02350070 0x400>;
413 reg-names = "control", "domain";
414 domain-id = <28>;
415 };
416
417 clkxge: clkxge {
418 #clock-cells = <0>;
419 compatible = "ti,keystone,psc-clock";
420 clocks = <&chipclk13>;
421 clock-output-names = "xge";
422 reg = <0x023500c8 0xb00>, <0x02350074 0x400>;
423 reg-names = "control", "domain";
424 domain-id = <29>;
425 };
426};
diff --git a/arch/arm/boot/dts/k2hk-evm.dts b/arch/arm/boot/dts/k2hk-evm.dts
index eaefdfef65c3..c93d06f9f2a8 100644
--- a/arch/arm/boot/dts/k2hk-evm.dts
+++ b/arch/arm/boot/dts/k2hk-evm.dts
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright 2013 Texas Instruments, Inc. 2 * Copyright 2013-2014 Texas Instruments, Inc.
3 * 3 *
4 * Keystone 2 Kepler/Hawking EVM device tree 4 * Keystone 2 Kepler/Hawking EVM device tree
5 * 5 *
@@ -10,12 +10,14 @@
10/dts-v1/; 10/dts-v1/;
11 11
12#include "keystone.dtsi" 12#include "keystone.dtsi"
13#include "k2hk.dtsi"
13 14
14/ { 15/ {
15 compatible = "ti,keystone-evm"; 16 compatible = "ti,k2hk-evm","ti,keystone";
17 model = "Texas Instruments Keystone 2 Kepler/Hawking EVM";
16 18
17 soc { 19 soc {
18 clock { 20 clocks {
19 refclksys: refclksys { 21 refclksys: refclksys {
20 #clock-cells = <0>; 22 #clock-cells = <0>;
21 compatible = "fixed-clock"; 23 compatible = "fixed-clock";
@@ -52,6 +54,29 @@
52 }; 54 };
53 }; 55 };
54 }; 56 };
57
58 leds {
59 compatible = "gpio-leds";
60 debug1_1 {
61 label = "keystone:green:debug1";
62 gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; /* 12 */
63 };
64
65 debug1_2 {
66 label = "keystone:red:debug1";
67 gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; /* 13 */
68 };
69
70 debug2 {
71 label = "keystone:blue:debug2";
72 gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>; /* 14 */
73 };
74
75 debug3 {
76 label = "keystone:blue:debug3";
77 gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; /* 15 */
78 };
79 };
55}; 80};
56 81
57&usb_phy { 82&usb_phy {
@@ -61,3 +86,55 @@
61&usb { 86&usb {
62 status = "okay"; 87 status = "okay";
63}; 88};
89
90&aemif {
91 cs0 {
92 #address-cells = <2>;
93 #size-cells = <1>;
94 clock-ranges;
95 ranges;
96
97 ti,cs-chipselect = <0>;
98 /* all timings in nanoseconds */
99 ti,cs-min-turnaround-ns = <12>;
100 ti,cs-read-hold-ns = <6>;
101 ti,cs-read-strobe-ns = <23>;
102 ti,cs-read-setup-ns = <9>;
103 ti,cs-write-hold-ns = <8>;
104 ti,cs-write-strobe-ns = <23>;
105 ti,cs-write-setup-ns = <8>;
106
107 nand@0,0 {
108 compatible = "ti,keystone-nand","ti,davinci-nand";
109 #address-cells = <1>;
110 #size-cells = <1>;
111 reg = <0 0 0x4000000
112 1 0 0x0000100>;
113
114 ti,davinci-chipselect = <0>;
115 ti,davinci-mask-ale = <0x2000>;
116 ti,davinci-mask-cle = <0x4000>;
117 ti,davinci-mask-chipsel = <0>;
118 nand-ecc-mode = "hw";
119 ti,davinci-ecc-bits = <4>;
120 nand-on-flash-bbt;
121
122 partition@0 {
123 label = "u-boot";
124 reg = <0x0 0x100000>;
125 read-only;
126 };
127
128 partition@100000 {
129 label = "params";
130 reg = <0x100000 0x80000>;
131 read-only;
132 };
133
134 partition@180000 {
135 label = "ubifs";
136 reg = <0x180000 0x1fe80000>;
137 };
138 };
139 };
140};
diff --git a/arch/arm/boot/dts/k2hk.dtsi b/arch/arm/boot/dts/k2hk.dtsi
new file mode 100644
index 000000000000..c73899c73118
--- /dev/null
+++ b/arch/arm/boot/dts/k2hk.dtsi
@@ -0,0 +1,46 @@
1/*
2 * Copyright 2013-2014 Texas Instruments, Inc.
3 *
4 * Keystone 2 Kepler/Hawking soc specific device tree
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/ {
12 cpus {
13 #address-cells = <1>;
14 #size-cells = <0>;
15
16 interrupt-parent = <&gic>;
17
18 cpu@0 {
19 compatible = "arm,cortex-a15";
20 device_type = "cpu";
21 reg = <0>;
22 };
23
24 cpu@1 {
25 compatible = "arm,cortex-a15";
26 device_type = "cpu";
27 reg = <1>;
28 };
29
30 cpu@2 {
31 compatible = "arm,cortex-a15";
32 device_type = "cpu";
33 reg = <2>;
34 };
35
36 cpu@3 {
37 compatible = "arm,cortex-a15";
38 device_type = "cpu";
39 reg = <3>;
40 };
41 };
42
43 soc {
44 /include/ "k2hk-clocks.dtsi"
45 };
46};
diff --git a/arch/arm/boot/dts/k2l-clocks.dtsi b/arch/arm/boot/dts/k2l-clocks.dtsi
new file mode 100644
index 000000000000..f584b80200f8
--- /dev/null
+++ b/arch/arm/boot/dts/k2l-clocks.dtsi
@@ -0,0 +1,267 @@
1/*
2 * Copyright 2013-2014 Texas Instruments, Inc.
3 *
4 * Keystone 2 lamarr SoC clock nodes
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
11clocks {
12 armpllclk: armpllclk@2620370 {
13 #clock-cells = <0>;
14 compatible = "ti,keystone,pll-clock";
15 clocks = <&refclksys>;
16 clock-output-names = "arm-pll-clk";
17 reg = <0x02620370 4>;
18 reg-names = "control";
19 };
20
21 mainpllclk: mainpllclk@2310110 {
22 #clock-cells = <0>;
23 compatible = "ti,keystone,main-pll-clock";
24 clocks = <&refclksys>;
25 reg = <0x02620350 4>, <0x02310110 4>;
26 reg-names = "control", "multiplier";
27 fixed-postdiv = <2>;
28 };
29
30 papllclk: papllclk@2620358 {
31 #clock-cells = <0>;
32 compatible = "ti,keystone,pll-clock";
33 clocks = <&refclksys>;
34 clock-output-names = "pa-pll-clk";
35 reg = <0x02620358 4>;
36 reg-names = "control";
37 };
38
39 ddr3apllclk: ddr3apllclk@2620360 {
40 #clock-cells = <0>;
41 compatible = "ti,keystone,pll-clock";
42 clocks = <&refclksys>;
43 clock-output-names = "ddr-3a-pll-clk";
44 reg = <0x02620360 4>;
45 reg-names = "control";
46 };
47
48 clkdfeiqnsys: clkdfeiqnsys {
49 #clock-cells = <0>;
50 compatible = "ti,keystone,psc-clock";
51 clocks = <&chipclk12>;
52 clock-output-names = "dfe";
53 reg-names = "control", "domain";
54 reg = <0x02350004 0xb00>, <0x02350000 0x400>;
55 domain-id = <0>;
56 };
57
58 clkpcie1: clkpcie1 {
59 #clock-cells = <0>;
60 compatible = "ti,keystone,psc-clock";
61 clocks = <&chipclk12>;
62 clock-output-names = "pcie";
63 reg = <0x0235002c 0xb00>, <0x02350000 0x400>;
64 reg-names = "control", "domain";
65 domain-id = <4>;
66 };
67
68 clkgem1: clkgem1 {
69 #clock-cells = <0>;
70 compatible = "ti,keystone,psc-clock";
71 clocks = <&chipclk1>;
72 clock-output-names = "gem1";
73 reg = <0x02350040 0xb00>, <0x02350024 0x400>;
74 reg-names = "control", "domain";
75 domain-id = <9>;
76 };
77
78 clkgem2: clkgem2 {
79 #clock-cells = <0>;
80 compatible = "ti,keystone,psc-clock";
81 clocks = <&chipclk1>;
82 clock-output-names = "gem2";
83 reg = <0x02350044 0xb00>, <0x02350028 0x400>;
84 reg-names = "control", "domain";
85 domain-id = <10>;
86 };
87
88 clkgem3: clkgem3 {
89 #clock-cells = <0>;
90 compatible = "ti,keystone,psc-clock";
91 clocks = <&chipclk1>;
92 clock-output-names = "gem3";
93 reg = <0x02350048 0xb00>, <0x0235002c 0x400>;
94 reg-names = "control", "domain";
95 domain-id = <11>;
96 };
97
98 clktac: clktac {
99 #clock-cells = <0>;
100 compatible = "ti,keystone,psc-clock";
101 clocks = <&chipclk13>;
102 clock-output-names = "tac";
103 reg = <0x02350064 0xb00>, <0x02350044 0x400>;
104 reg-names = "control", "domain";
105 domain-id = <17>;
106 };
107
108 clkrac: clkrac {
109 #clock-cells = <0>;
110 compatible = "ti,keystone,psc-clock";
111 clocks = <&chipclk13>;
112 clock-output-names = "rac";
113 reg = <0x02350068 0xb00>, <0x02350044 0x400>;
114 reg-names = "control", "domain";
115 domain-id = <17>;
116 };
117
118 clkdfepd0: clkdfepd0 {
119 #clock-cells = <0>;
120 compatible = "ti,keystone,psc-clock";
121 clocks = <&chipclk13>;
122 clock-output-names = "dfe-pd0";
123 reg = <0x0235006c 0xb00>, <0x02350044 0x400>;
124 reg-names = "control", "domain";
125 domain-id = <18>;
126 };
127
128 clkfftc0: clkfftc0 {
129 #clock-cells = <0>;
130 compatible = "ti,keystone,psc-clock";
131 clocks = <&chipclk13>;
132 clock-output-names = "fftc-0";
133 reg = <0x02350070 0xb00>, <0x0235004c 0x400>;
134 reg-names = "control", "domain";
135 domain-id = <19>;
136 };
137
138 clkosr: clkosr {
139 #clock-cells = <0>;
140 compatible = "ti,keystone,psc-clock";
141 clocks = <&chipclk13>;
142 clock-output-names = "osr";
143 reg = <0x02350088 0xb00>, <0x0235004c 0x400>;
144 reg-names = "control", "domain";
145 domain-id = <21>;
146 };
147
148 clktcp3d0: clktcp3d0 {
149 #clock-cells = <0>;
150 compatible = "ti,keystone,psc-clock";
151 clocks = <&chipclk13>;
152 clock-output-names = "tcp3d-0";
153 reg = <0x0235008c 0xb00>, <0x02350058 0x400>;
154 reg-names = "control", "domain";
155 domain-id = <22>;
156 };
157
158 clktcp3d1: clktcp3d1 {
159 #clock-cells = <0>;
160 compatible = "ti,keystone,psc-clock";
161 clocks = <&chipclk13>;
162 clock-output-names = "tcp3d-1";
163 reg = <0x02350094 0xb00>, <0x02350058 0x400>;
164 reg-names = "control", "domain";
165 domain-id = <23>;
166 };
167
168 clkvcp0: clkvcp0 {
169 #clock-cells = <0>;
170 compatible = "ti,keystone,psc-clock";
171 clocks = <&chipclk13>;
172 clock-output-names = "vcp-0";
173 reg = <0x0235009c 0xb00>, <0x02350060 0x400>;
174 reg-names = "control", "domain";
175 domain-id = <24>;
176 };
177
178 clkvcp1: clkvcp1 {
179 #clock-cells = <0>;
180 compatible = "ti,keystone,psc-clock";
181 clocks = <&chipclk13>;
182 clock-output-names = "vcp-1";
183 reg = <0x023500a0 0xb00>, <0x02350060 0x400>;
184 reg-names = "control", "domain";
185 domain-id = <24>;
186 };
187
188 clkvcp2: clkvcp2 {
189 #clock-cells = <0>;
190 compatible = "ti,keystone,psc-clock";
191 clocks = <&chipclk13>;
192 clock-output-names = "vcp-2";
193 reg = <0x023500a4 0xb00>, <0x02350060 0x400>;
194 reg-names = "control", "domain";
195 domain-id = <24>;
196 };
197
198 clkvcp3: clkvcp3 {
199 #clock-cells = <0>;
200 compatible = "ti,keystone,psc-clock";
201 clocks = <&chipclk13>;
202 clock-output-names = "vcp-3";
203 reg = <0x023500a8 0xb00>, <0x02350060 0x400>;
204 reg-names = "control", "domain";
205 domain-id = <24>;
206 };
207
208 clkbcp: clkbcp {
209 #clock-cells = <0>;
210 compatible = "ti,keystone,psc-clock";
211 clocks = <&chipclk13>;
212 clock-output-names = "bcp";
213 reg = <0x023500bc 0xb00>, <0x02350068 0x400>;
214 reg-names = "control", "domain";
215 domain-id = <26>;
216 };
217
218 clkdfepd1: clkdfepd1 {
219 #clock-cells = <0>;
220 compatible = "ti,keystone,psc-clock";
221 clocks = <&chipclk13>;
222 clock-output-names = "dfe-pd1";
223 reg = <0x023500c0 0xb00>, <0x02350044 0x400>;
224 reg-names = "control", "domain";
225 domain-id = <27>;
226 };
227
228 clkfftc1: clkfftc1 {
229 #clock-cells = <0>;
230 compatible = "ti,keystone,psc-clock";
231 clocks = <&chipclk13>;
232 clock-output-names = "fftc-1";
233 reg = <0x023500c4 0xb00>, <0x023504c0 0x400>;
234 reg-names = "control", "domain";
235 domain-id = <28>;
236 };
237
238 clkiqnail: clkiqnail {
239 #clock-cells = <0>;
240 compatible = "ti,keystone,psc-clock";
241 clocks = <&chipclk13>;
242 clock-output-names = "iqn-ail";
243 reg = <0x023500c8 0xb00>, <0x0235004c 0x400>;
244 reg-names = "control", "domain";
245 domain-id = <29>;
246 };
247
248 clkuart2: clkuart2 {
249 #clock-cells = <0>;
250 compatible = "ti,keystone,psc-clock";
251 clocks = <&clkmodrst0>;
252 clock-output-names = "uart2";
253 reg = <0x02350000 0xb00>, <0x02350000 0x400>;
254 reg-names = "control", "domain";
255 domain-id = <0>;
256 };
257
258 clkuart3: clkuart3 {
259 #clock-cells = <0>;
260 compatible = "ti,keystone,psc-clock";
261 clocks = <&clkmodrst0>;
262 clock-output-names = "uart3";
263 reg = <0x02350000 0xb00>, <0x02350000 0x400>;
264 reg-names = "control", "domain";
265 domain-id = <0>;
266 };
267};
diff --git a/arch/arm/boot/dts/k2l-evm.dts b/arch/arm/boot/dts/k2l-evm.dts
new file mode 100644
index 000000000000..50a70132ac9e
--- /dev/null
+++ b/arch/arm/boot/dts/k2l-evm.dts
@@ -0,0 +1,37 @@
1/*
2 * Copyright 2014 Texas Instruments, Inc.
3 *
4 * Keystone 2 Lamarr EVM device tree
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/dts-v1/;
11
12#include "keystone.dtsi"
13#include "k2l.dtsi"
14
15/ {
16 compatible = "ti,k2l-evm","ti,keystone";
17 model = "Texas Instruments Keystone 2 Lamarr EVM";
18
19 soc {
20 clocks {
21 refclksys: refclksys {
22 #clock-cells = <0>;
23 compatible = "fixed-clock";
24 clock-frequency = <122880000>;
25 clock-output-names = "refclk-sys";
26 };
27 };
28 };
29};
30
31&usb_phy {
32 status = "okay";
33};
34
35&usb {
36 status = "okay";
37};
diff --git a/arch/arm/boot/dts/k2l.dtsi b/arch/arm/boot/dts/k2l.dtsi
new file mode 100644
index 000000000000..1f7f479589e1
--- /dev/null
+++ b/arch/arm/boot/dts/k2l.dtsi
@@ -0,0 +1,55 @@
1/*
2 * Copyright 2014 Texas Instruments, Inc.
3 *
4 * Keystone 2 Lamarr SoC specific device tree
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/ {
12 cpus {
13 #address-cells = <1>;
14 #size-cells = <0>;
15
16 interrupt-parent = <&gic>;
17
18 cpu@0 {
19 compatible = "arm,cortex-a15";
20 device_type = "cpu";
21 reg = <0>;
22 };
23
24 cpu@1 {
25 compatible = "arm,cortex-a15";
26 device_type = "cpu";
27 reg = <1>;
28 };
29 };
30
31 soc {
32
33 /include/ "k2l-clocks.dtsi"
34
35 uart2: serial@02348400 {
36 compatible = "ns16550a";
37 current-speed = <115200>;
38 reg-shift = <2>;
39 reg-io-width = <4>;
40 reg = <0x02348400 0x100>;
41 clocks = <&clkuart2>;
42 interrupts = <GIC_SPI 432 IRQ_TYPE_EDGE_RISING>;
43 };
44
45 uart3: serial@02348800 {
46 compatible = "ns16550a";
47 current-speed = <115200>;
48 reg-shift = <2>;
49 reg-io-width = <4>;
50 reg = <0x02348800 0x100>;
51 clocks = <&clkuart3>;
52 interrupts = <GIC_SPI 435 IRQ_TYPE_EDGE_RISING>;
53 };
54 };
55};
diff --git a/arch/arm/boot/dts/keystone-clocks.dtsi b/arch/arm/boot/dts/keystone-clocks.dtsi
index ef58d1c24313..93f82c7010ab 100644
--- a/arch/arm/boot/dts/keystone-clocks.dtsi
+++ b/arch/arm/boot/dts/keystone-clocks.dtsi
@@ -13,51 +13,6 @@ clocks {
13 #size-cells = <1>; 13 #size-cells = <1>;
14 ranges; 14 ranges;
15 15
16 mainpllclk: mainpllclk@2310110 {
17 #clock-cells = <0>;
18 compatible = "ti,keystone,main-pll-clock";
19 clocks = <&refclksys>;
20 reg = <0x02620350 4>, <0x02310110 4>;
21 reg-names = "control", "multiplier";
22 fixed-postdiv = <2>;
23 };
24
25 papllclk: papllclk@2620358 {
26 #clock-cells = <0>;
27 compatible = "ti,keystone,pll-clock";
28 clocks = <&refclkpass>;
29 clock-output-names = "pa-pll-clk";
30 reg = <0x02620358 4>;
31 reg-names = "control";
32 };
33
34 ddr3apllclk: ddr3apllclk@2620360 {
35 #clock-cells = <0>;
36 compatible = "ti,keystone,pll-clock";
37 clocks = <&refclkddr3a>;
38 clock-output-names = "ddr-3a-pll-clk";
39 reg = <0x02620360 4>;
40 reg-names = "control";
41 };
42
43 ddr3bpllclk: ddr3bpllclk@2620368 {
44 #clock-cells = <0>;
45 compatible = "ti,keystone,pll-clock";
46 clocks = <&refclkddr3b>;
47 clock-output-names = "ddr-3b-pll-clk";
48 reg = <0x02620368 4>;
49 reg-names = "control";
50 };
51
52 armpllclk: armpllclk@2620370 {
53 #clock-cells = <0>;
54 compatible = "ti,keystone,pll-clock";
55 clocks = <&refclkarm>;
56 clock-output-names = "arm-pll-clk";
57 reg = <0x02620370 4>;
58 reg-names = "control";
59 };
60
61 mainmuxclk: mainmuxclk@2310108 { 16 mainmuxclk: mainmuxclk@2310108 {
62 #clock-cells = <0>; 17 #clock-cells = <0>;
63 compatible = "ti,keystone,pll-mux-clock"; 18 compatible = "ti,keystone,pll-mux-clock";
@@ -244,7 +199,7 @@ clocks {
244 clock-output-names = "debugss-trc"; 199 clock-output-names = "debugss-trc";
245 reg = <0x02350014 0xb00>, <0x02350000 0x400>; 200 reg = <0x02350014 0xb00>, <0x02350000 0x400>;
246 reg-names = "control", "domain"; 201 reg-names = "control", "domain";
247 domain-id = <0>; 202 domain-id = <1>;
248 }; 203 };
249 204
250 clktetbtrc: clktetbtrc { 205 clktetbtrc: clktetbtrc {
@@ -297,26 +252,6 @@ clocks {
297 domain-id = <3>; 252 domain-id = <3>;
298 }; 253 };
299 254
300 clksrio: clksrio {
301 #clock-cells = <0>;
302 compatible = "ti,keystone,psc-clock";
303 clocks = <&chipclk1rstiso13>;
304 clock-output-names = "srio";
305 reg = <0x0235002c 0xb00>, <0x02350010 0x400>;
306 reg-names = "control", "domain";
307 domain-id = <4>;
308 };
309
310 clkhyperlink0: clkhyperlink0 {
311 #clock-cells = <0>;
312 compatible = "ti,keystone,psc-clock";
313 clocks = <&chipclk12>;
314 clock-output-names = "hyperlink-0";
315 reg = <0x02350030 0xb00>, <0x02350014 0x400>;
316 reg-names = "control", "domain";
317 domain-id = <5>;
318 };
319
320 clksr: clksr { 255 clksr: clksr {
321 #clock-cells = <0>; 256 #clock-cells = <0>;
322 compatible = "ti,keystone,psc-clock"; 257 compatible = "ti,keystone,psc-clock";
@@ -327,16 +262,6 @@ clocks {
327 domain-id = <6>; 262 domain-id = <6>;
328 }; 263 };
329 264
330 clkmsmcsram: clkmsmcsram {
331 #clock-cells = <0>;
332 compatible = "ti,keystone,psc-clock";
333 clocks = <&chipclk1>;
334 clock-output-names = "msmcsram";
335 reg = <0x02350038 0xb00>, <0x0235001c 0x400>;
336 reg-names = "control", "domain";
337 domain-id = <7>;
338 };
339
340 clkgem0: clkgem0 { 265 clkgem0: clkgem0 {
341 #clock-cells = <0>; 266 #clock-cells = <0>;
342 compatible = "ti,keystone,psc-clock"; 267 compatible = "ti,keystone,psc-clock";
@@ -347,76 +272,6 @@ clocks {
347 domain-id = <8>; 272 domain-id = <8>;
348 }; 273 };
349 274
350 clkgem1: clkgem1 {
351 #clock-cells = <0>;
352 compatible = "ti,keystone,psc-clock";
353 clocks = <&chipclk1>;
354 clock-output-names = "gem1";
355 reg = <0x02350040 0xb00>, <0x02350024 0x400>;
356 reg-names = "control", "domain";
357 domain-id = <9>;
358 };
359
360 clkgem2: clkgem2 {
361 #clock-cells = <0>;
362 compatible = "ti,keystone,psc-clock";
363 clocks = <&chipclk1>;
364 clock-output-names = "gem2";
365 reg = <0x02350044 0xb00>, <0x02350028 0x400>;
366 reg-names = "control", "domain";
367 domain-id = <10>;
368 };
369
370 clkgem3: clkgem3 {
371 #clock-cells = <0>;
372 compatible = "ti,keystone,psc-clock";
373 clocks = <&chipclk1>;
374 clock-output-names = "gem3";
375 reg = <0x02350048 0xb00>, <0x0235002c 0x400>;
376 reg-names = "control", "domain";
377 domain-id = <11>;
378 };
379
380 clkgem4: clkgem4 {
381 #clock-cells = <0>;
382 compatible = "ti,keystone,psc-clock";
383 clocks = <&chipclk1>;
384 clock-output-names = "gem4";
385 reg = <0x0235004c 0xb00>, <0x02350030 0x400>;
386 reg-names = "control", "domain";
387 domain-id = <12>;
388 };
389
390 clkgem5: clkgem5 {
391 #clock-cells = <0>;
392 compatible = "ti,keystone,psc-clock";
393 clocks = <&chipclk1>;
394 clock-output-names = "gem5";
395 reg = <0x02350050 0xb00>, <0x02350034 0x400>;
396 reg-names = "control", "domain";
397 domain-id = <13>;
398 };
399
400 clkgem6: clkgem6 {
401 #clock-cells = <0>;
402 compatible = "ti,keystone,psc-clock";
403 clocks = <&chipclk1>;
404 clock-output-names = "gem6";
405 reg = <0x02350054 0xb00>, <0x02350038 0x400>;
406 reg-names = "control", "domain";
407 domain-id = <14>;
408 };
409
410 clkgem7: clkgem7 {
411 #clock-cells = <0>;
412 compatible = "ti,keystone,psc-clock";
413 clocks = <&chipclk1>;
414 clock-output-names = "gem7";
415 reg = <0x02350058 0xb00>, <0x0235003c 0x400>;
416 reg-names = "control", "domain";
417 domain-id = <15>;
418 };
419
420 clkddr30: clkddr30 { 275 clkddr30: clkddr30 {
421 #clock-cells = <0>; 276 #clock-cells = <0>;
422 compatible = "ti,keystone,psc-clock"; 277 compatible = "ti,keystone,psc-clock";
@@ -427,276 +282,6 @@ clocks {
427 domain-id = <16>; 282 domain-id = <16>;
428 }; 283 };
429 284
430 clkddr31: clkddr31 {
431 #clock-cells = <0>;
432 compatible = "ti,keystone,psc-clock";
433 clocks = <&chipclk13>;
434 clock-output-names = "ddr3-1";
435 reg = <0x02350060 0xb00>, <0x02350040 0x400>;
436 reg-names = "control", "domain";
437 domain-id = <16>;
438 };
439
440 clktac: clktac {
441 #clock-cells = <0>;
442 compatible = "ti,keystone,psc-clock";
443 clocks = <&chipclk13>;
444 clock-output-names = "tac";
445 reg = <0x02350064 0xb00>, <0x02350044 0x400>;
446 reg-names = "control", "domain";
447 domain-id = <17>;
448 };
449
450 clkrac01: clktac01 {
451 #clock-cells = <0>;
452 compatible = "ti,keystone,psc-clock";
453 clocks = <&chipclk13>;
454 clock-output-names = "rac-01";
455 reg = <0x02350068 0xb00>, <0x02350044 0x400>;
456 reg-names = "control", "domain";
457 domain-id = <17>;
458 };
459
460 clkrac23: clktac23 {
461 #clock-cells = <0>;
462 compatible = "ti,keystone,psc-clock";
463 clocks = <&chipclk13>;
464 clock-output-names = "rac-23";
465 reg = <0x0235006c 0xb00>, <0x02350048 0x400>;
466 reg-names = "control", "domain";
467 domain-id = <18>;
468 };
469
470 clkfftc0: clkfftc0 {
471 #clock-cells = <0>;
472 compatible = "ti,keystone,psc-clock";
473 clocks = <&chipclk13>;
474 clock-output-names = "fftc-0";
475 reg = <0x02350070 0xb00>, <0x0235004c 0x400>;
476 reg-names = "control", "domain";
477 domain-id = <19>;
478 };
479
480 clkfftc1: clkfftc1 {
481 #clock-cells = <0>;
482 compatible = "ti,keystone,psc-clock";
483 clocks = <&chipclk13>;
484 clock-output-names = "fftc-1";
485 reg = <0x02350074 0xb00>, <0x023504c0 0x400>;
486 reg-names = "control", "domain";
487 domain-id = <19>;
488 };
489
490 clkfftc2: clkfftc2 {
491 #clock-cells = <0>;
492 compatible = "ti,keystone,psc-clock";
493 clocks = <&chipclk13>;
494 clock-output-names = "fftc-2";
495 reg = <0x02350078 0xb00>, <0x02350050 0x400>;
496 reg-names = "control", "domain";
497 domain-id = <20>;
498 };
499
500 clkfftc3: clkfftc3 {
501 #clock-cells = <0>;
502 compatible = "ti,keystone,psc-clock";
503 clocks = <&chipclk13>;
504 clock-output-names = "fftc-3";
505 reg = <0x0235007c 0xb00>, <0x02350050 0x400>;
506 reg-names = "control", "domain";
507 domain-id = <20>;
508 };
509
510 clkfftc4: clkfftc4 {
511 #clock-cells = <0>;
512 compatible = "ti,keystone,psc-clock";
513 clocks = <&chipclk13>;
514 clock-output-names = "fftc-4";
515 reg = <0x02350080 0xb00>, <0x02350050 0x400>;
516 reg-names = "control", "domain";
517 domain-id = <20>;
518 };
519
520 clkfftc5: clkfftc5 {
521 #clock-cells = <0>;
522 compatible = "ti,keystone,psc-clock";
523 clocks = <&chipclk13>;
524 clock-output-names = "fftc-5";
525 reg = <0x02350084 0xb00>, <0x02350050 0x400>;
526 reg-names = "control", "domain";
527 domain-id = <20>;
528 };
529
530 clkaif: clkaif {
531 #clock-cells = <0>;
532 compatible = "ti,keystone,psc-clock";
533 clocks = <&chipclk13>;
534 clock-output-names = "aif";
535 reg = <0x02350088 0xb00>, <0x02350054 0x400>;
536 reg-names = "control", "domain";
537 domain-id = <21>;
538 };
539
540 clktcp3d0: clktcp3d0 {
541 #clock-cells = <0>;
542 compatible = "ti,keystone,psc-clock";
543 clocks = <&chipclk13>;
544 clock-output-names = "tcp3d-0";
545 reg = <0x0235008c 0xb00>, <0x02350058 0x400>;
546 reg-names = "control", "domain";
547 domain-id = <22>;
548 };
549
550 clktcp3d1: clktcp3d1 {
551 #clock-cells = <0>;
552 compatible = "ti,keystone,psc-clock";
553 clocks = <&chipclk13>;
554 clock-output-names = "tcp3d-1";
555 reg = <0x02350090 0xb00>, <0x02350058 0x400>;
556 reg-names = "control", "domain";
557 domain-id = <22>;
558 };
559
560 clktcp3d2: clktcp3d2 {
561 #clock-cells = <0>;
562 compatible = "ti,keystone,psc-clock";
563 clocks = <&chipclk13>;
564 clock-output-names = "tcp3d-2";
565 reg = <0x02350094 0xb00>, <0x0235005c 0x400>;
566 reg-names = "control", "domain";
567 domain-id = <23>;
568 };
569
570 clktcp3d3: clktcp3d3 {
571 #clock-cells = <0>;
572 compatible = "ti,keystone,psc-clock";
573 clocks = <&chipclk13>;
574 clock-output-names = "tcp3d-3";
575 reg = <0x02350098 0xb00>, <0x0235005c 0x400>;
576 reg-names = "control", "domain";
577 domain-id = <23>;
578 };
579
580 clkvcp0: clkvcp0 {
581 #clock-cells = <0>;
582 compatible = "ti,keystone,psc-clock";
583 clocks = <&chipclk13>;
584 clock-output-names = "vcp-0";
585 reg = <0x0235009c 0xb00>, <0x02350060 0x400>;
586 reg-names = "control", "domain";
587 domain-id = <24>;
588 };
589
590 clkvcp1: clkvcp1 {
591 #clock-cells = <0>;
592 compatible = "ti,keystone,psc-clock";
593 clocks = <&chipclk13>;
594 clock-output-names = "vcp-1";
595 reg = <0x023500a0 0xb00>, <0x02350060 0x400>;
596 reg-names = "control", "domain";
597 domain-id = <24>;
598 };
599
600 clkvcp2: clkvcp2 {
601 #clock-cells = <0>;
602 compatible = "ti,keystone,psc-clock";
603 clocks = <&chipclk13>;
604 clock-output-names = "vcp-2";
605 reg = <0x023500a4 0xb00>, <0x02350060 0x400>;
606 reg-names = "control", "domain";
607 domain-id = <24>;
608 };
609
610 clkvcp3: clkvcp3 {
611 #clock-cells = <0>;
612 compatible = "ti,keystone,psc-clock";
613 clocks = <&chipclk13>;
614 clock-output-names = "vcp-3";
615 reg = <0x023500a8 0xb00>, <0x02350060 0x400>;
616 reg-names = "control", "domain";
617 domain-id = <24>;
618 };
619
620 clkvcp4: clkvcp4 {
621 #clock-cells = <0>;
622 compatible = "ti,keystone,psc-clock";
623 clocks = <&chipclk13>;
624 clock-output-names = "vcp-4";
625 reg = <0x023500ac 0xb00>, <0x02350064 0x400>;
626 reg-names = "control", "domain";
627 domain-id = <25>;
628 };
629
630 clkvcp5: clkvcp5 {
631 #clock-cells = <0>;
632 compatible = "ti,keystone,psc-clock";
633 clocks = <&chipclk13>;
634 clock-output-names = "vcp-5";
635 reg = <0x023500b0 0xb00>, <0x02350064 0x400>;
636 reg-names = "control", "domain";
637 domain-id = <25>;
638 };
639
640 clkvcp6: clkvcp6 {
641 #clock-cells = <0>;
642 compatible = "ti,keystone,psc-clock";
643 clocks = <&chipclk13>;
644 clock-output-names = "vcp-6";
645 reg = <0x023500b4 0xb00>, <0x02350064 0x400>;
646 reg-names = "control", "domain";
647 domain-id = <25>;
648 };
649
650 clkvcp7: clkvcp7 {
651 #clock-cells = <0>;
652 compatible = "ti,keystone,psc-clock";
653 clocks = <&chipclk13>;
654 clock-output-names = "vcp-7";
655 reg = <0x023500b8 0xb00>, <0x02350064 0x400>;
656 reg-names = "control", "domain";
657 domain-id = <25>;
658 };
659
660 clkbcp: clkbcp {
661 #clock-cells = <0>;
662 compatible = "ti,keystone,psc-clock";
663 clocks = <&chipclk13>;
664 clock-output-names = "bcp";
665 reg = <0x023500bc 0xb00>, <0x02350068 0x400>;
666 reg-names = "control", "domain";
667 domain-id = <26>;
668 };
669
670 clkdxb: clkdxb {
671 #clock-cells = <0>;
672 compatible = "ti,keystone,psc-clock";
673 clocks = <&chipclk13>;
674 clock-output-names = "dxb";
675 reg = <0x023500c0 0xb00>, <0x0235006c 0x400>;
676 reg-names = "control", "domain";
677 domain-id = <27>;
678 };
679
680 clkhyperlink1: clkhyperlink1 {
681 #clock-cells = <0>;
682 compatible = "ti,keystone,psc-clock";
683 clocks = <&chipclk12>;
684 clock-output-names = "hyperlink-1";
685 reg = <0x023500c4 0xb00>, <0x02350070 0x400>;
686 reg-names = "control", "domain";
687 domain-id = <28>;
688 };
689
690 clkxge: clkxge {
691 #clock-cells = <0>;
692 compatible = "ti,keystone,psc-clock";
693 clocks = <&chipclk13>;
694 clock-output-names = "xge";
695 reg = <0x023500c8 0xb00>, <0x02350074 0x400>;
696 reg-names = "control", "domain";
697 domain-id = <29>;
698 };
699
700 clkwdtimer0: clkwdtimer0 { 285 clkwdtimer0: clkwdtimer0 {
701 #clock-cells = <0>; 286 #clock-cells = <0>;
702 compatible = "ti,keystone,psc-clock"; 287 compatible = "ti,keystone,psc-clock";
@@ -737,6 +322,16 @@ clocks {
737 domain-id = <0>; 322 domain-id = <0>;
738 }; 323 };
739 324
325 clktimer15: clktimer15 {
326 #clock-cells = <0>;
327 compatible = "ti,keystone,psc-clock";
328 clocks = <&clkmodrst0>;
329 clock-output-names = "timer15";
330 reg = <0x02350000 0xb00>, <0x02350000 0x400>;
331 reg-names = "control", "domain";
332 domain-id = <0>;
333 };
334
740 clkuart0: clkuart0 { 335 clkuart0: clkuart0 {
741 #clock-cells = <0>; 336 #clock-cells = <0>;
742 compatible = "ti,keystone,psc-clock"; 337 compatible = "ti,keystone,psc-clock";
diff --git a/arch/arm/boot/dts/keystone.dtsi b/arch/arm/boot/dts/keystone.dtsi
index b4202907a27b..90823eb90c1b 100644
--- a/arch/arm/boot/dts/keystone.dtsi
+++ b/arch/arm/boot/dts/keystone.dtsi
@@ -7,6 +7,7 @@
7 */ 7 */
8 8
9#include <dt-bindings/interrupt-controller/arm-gic.h> 9#include <dt-bindings/interrupt-controller/arm-gic.h>
10#include <dt-bindings/gpio/gpio.h>
10 11
11#include "skeleton.dtsi" 12#include "skeleton.dtsi"
12 13
@@ -24,37 +25,6 @@
24 reg = <0x00000000 0x80000000 0x00000000 0x40000000>; 25 reg = <0x00000000 0x80000000 0x00000000 0x40000000>;
25 }; 26 };
26 27
27 cpus {
28 #address-cells = <1>;
29 #size-cells = <0>;
30
31 interrupt-parent = <&gic>;
32
33 cpu@0 {
34 compatible = "arm,cortex-a15";
35 device_type = "cpu";
36 reg = <0>;
37 };
38
39 cpu@1 {
40 compatible = "arm,cortex-a15";
41 device_type = "cpu";
42 reg = <1>;
43 };
44
45 cpu@2 {
46 compatible = "arm,cortex-a15";
47 device_type = "cpu";
48 reg = <2>;
49 };
50
51 cpu@3 {
52 compatible = "arm,cortex-a15";
53 device_type = "cpu";
54 reg = <3>;
55 };
56 };
57
58 gic: interrupt-controller { 28 gic: interrupt-controller {
59 compatible = "arm,cortex-a15-gic"; 29 compatible = "arm,cortex-a15-gic";
60 #interrupt-cells = <3>; 30 #interrupt-cells = <3>;
@@ -208,5 +178,75 @@
208 usb-phy = <&usb_phy>, <&usb_phy>; 178 usb-phy = <&usb_phy>, <&usb_phy>;
209 }; 179 };
210 }; 180 };
181
182 wdt: wdt@022f0080 {
183 compatible = "ti,keystone-wdt","ti,davinci-wdt";
184 reg = <0x022f0080 0x80>;
185 clocks = <&clkwdtimer0>;
186 };
187
188 clock_event: timer@22f0000 {
189 compatible = "ti,keystone-timer";
190 reg = <0x022f0000 0x80>;
191 interrupts = <GIC_SPI 110 IRQ_TYPE_EDGE_RISING>;
192 clocks = <&clktimer15>;
193 };
194
195 gpio0: gpio@260bf00 {
196 compatible = "ti,keystone-gpio";
197 reg = <0x0260bf00 0x100>;
198 gpio-controller;
199 #gpio-cells = <2>;
200 /* HW Interrupts mapped to GPIO pins */
201 interrupts = <GIC_SPI 120 IRQ_TYPE_EDGE_RISING>,
202 <GIC_SPI 121 IRQ_TYPE_EDGE_RISING>,
203 <GIC_SPI 122 IRQ_TYPE_EDGE_RISING>,
204 <GIC_SPI 123 IRQ_TYPE_EDGE_RISING>,
205 <GIC_SPI 124 IRQ_TYPE_EDGE_RISING>,
206 <GIC_SPI 125 IRQ_TYPE_EDGE_RISING>,
207 <GIC_SPI 126 IRQ_TYPE_EDGE_RISING>,
208 <GIC_SPI 127 IRQ_TYPE_EDGE_RISING>,
209 <GIC_SPI 128 IRQ_TYPE_EDGE_RISING>,
210 <GIC_SPI 129 IRQ_TYPE_EDGE_RISING>,
211 <GIC_SPI 130 IRQ_TYPE_EDGE_RISING>,
212 <GIC_SPI 131 IRQ_TYPE_EDGE_RISING>,
213 <GIC_SPI 132 IRQ_TYPE_EDGE_RISING>,
214 <GIC_SPI 133 IRQ_TYPE_EDGE_RISING>,
215 <GIC_SPI 134 IRQ_TYPE_EDGE_RISING>,
216 <GIC_SPI 135 IRQ_TYPE_EDGE_RISING>,
217 <GIC_SPI 136 IRQ_TYPE_EDGE_RISING>,
218 <GIC_SPI 137 IRQ_TYPE_EDGE_RISING>,
219 <GIC_SPI 138 IRQ_TYPE_EDGE_RISING>,
220 <GIC_SPI 139 IRQ_TYPE_EDGE_RISING>,
221 <GIC_SPI 140 IRQ_TYPE_EDGE_RISING>,
222 <GIC_SPI 141 IRQ_TYPE_EDGE_RISING>,
223 <GIC_SPI 142 IRQ_TYPE_EDGE_RISING>,
224 <GIC_SPI 143 IRQ_TYPE_EDGE_RISING>,
225 <GIC_SPI 144 IRQ_TYPE_EDGE_RISING>,
226 <GIC_SPI 145 IRQ_TYPE_EDGE_RISING>,
227 <GIC_SPI 146 IRQ_TYPE_EDGE_RISING>,
228 <GIC_SPI 147 IRQ_TYPE_EDGE_RISING>,
229 <GIC_SPI 148 IRQ_TYPE_EDGE_RISING>,
230 <GIC_SPI 149 IRQ_TYPE_EDGE_RISING>,
231 <GIC_SPI 150 IRQ_TYPE_EDGE_RISING>,
232 <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
233 clocks = <&clkgpio>;
234 clock-names = "gpio";
235 ti,ngpio = <32>;
236 ti,davinci-gpio-unbanked = <32>;
237 };
238
239 aemif: aemif@21000A00 {
240 compatible = "ti,keystone-aemif", "ti,davinci-aemif";
241 #address-cells = <2>;
242 #size-cells = <1>;
243 clocks = <&clkaemif>;
244 clock-names = "aemif";
245 clock-ranges;
246
247 reg = <0x21000A00 0x00000100>;
248 ranges = <0 0 0x30000000 0x10000000
249 1 0 0x21000A00 0x00000100>;
250 };
211 }; 251 };
212}; 252};
diff --git a/arch/arm/boot/dts/kirkwood-b3.dts b/arch/arm/boot/dts/kirkwood-b3.dts
new file mode 100644
index 000000000000..40791053106b
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-b3.dts
@@ -0,0 +1,204 @@
1/*
2 * Device Tree file for Excito Bubba B3
3 *
4 * Copyright (C) 2013, Andrew Lunn <andrew@lunn.ch>
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 * Note: This requires a new'ish version of u-boot, which disables the
12 * L2 cache. If your B3 silently fails to boot, u-boot is probably too
13 * old. Either upgrade, or consider the following email:
14 *
15 * http://lists.debian.org/debian-arm/2012/08/msg00128.html
16 */
17
18/dts-v1/;
19
20#include "kirkwood.dtsi"
21#include "kirkwood-6281.dtsi"
22
23/ {
24 model = "Excito B3";
25 compatible = "excito,b3", "marvell,kirkwood-88f6281", "marvell,kirkwood";
26 memory { /* 512 MB */
27 device_type = "memory";
28 reg = <0x00000000 0x20000000>;
29 };
30
31 chosen {
32 bootargs = "console=ttyS0,115200n8 earlyprintk";
33 };
34
35 mbus {
36 pcie-controller {
37 status = "okay";
38
39 /* Wifi model has Atheros chipset on pcie port */
40 pcie@1,0 {
41 status = "okay";
42 };
43 };
44 };
45
46 ocp@f1000000 {
47 pinctrl: pinctrl@10000 {
48 pmx_button_power: pmx-button-power {
49 marvell,pins = "mpp39";
50 marvell,function = "gpio";
51 };
52 pmx_led_green: pmx-led-green {
53 marvell,pins = "mpp38";
54 marvell,function = "gpio";
55 };
56 pmx_led_red: pmx-led-red {
57 marvell,pins = "mpp41";
58 marvell,function = "gpio";
59 };
60 pmx_led_blue: pmx-led-blue {
61 marvell,pins = "mpp42";
62 marvell,function = "gpio";
63 };
64 pmx_beeper: pmx-beeper {
65 marvell,pins = "mpp40";
66 marvell,function = "gpio";
67 };
68 };
69
70 spi@10600 {
71 status = "okay";
72 pinctrl-0 = <&pmx_spi>;
73 pinctrl-names = "default";
74
75 m25p16@0 {
76 #address-cells = <1>;
77 #size-cells = <1>;
78 compatible = "m25p16";
79 reg = <0>;
80 spi-max-frequency = <40000000>;
81 mode = <0>;
82
83 partition@0 {
84 reg = <0x0 0xc0000>;
85 label = "u-boot";
86 };
87
88 partition@c0000 {
89 reg = <0xc0000 0x20000>;
90 label = "u-boot env";
91 };
92
93 partition@e0000 {
94 reg = <0xe0000 0x120000>;
95 label = "data";
96 };
97 };
98 };
99
100 i2c@11000 {
101 status = "okay";
102 /*
103 * There is something on the bus at address 0x64.
104 * Not yet identified what it is, maybe the eeprom
105 * for the Atheros WiFi chip?
106 */
107 };
108
109
110 serial@12000 {
111 /* Internal on test pins, 3.3v TTL
112 * UART0_RX = Testpoint 65
113 * UART0_TX = Testpoint 66
114 * See the Excito Wiki for more details.
115 */
116 pinctrl-0 = <&pmx_uart0>;
117 pinctrl-names = "default";
118 status = "okay";
119 };
120
121 sata@80000 {
122 /* One internal, the second as eSATA */
123 status = "okay";
124 nr-ports = <2>;
125 };
126 };
127
128 gpio-leds {
129 /*
130 * There is one LED "port" on the front and the colours
131 * mix together giving some interesting combinations.
132 */
133 compatible = "gpio-leds";
134 pinctrl-0 = < &pmx_led_green &pmx_led_red
135 &pmx_led_blue >;
136 pinctrl-names = "default";
137
138 programming_led {
139 label = "bubba3:green:programming";
140 gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
141 default-state = "off";
142 };
143
144 error_led {
145 label = "bubba3:red:error";
146 gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
147 };
148
149 active_led {
150 label = "bubba3:blue:active";
151 gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
152 };
153 };
154
155 gpio-keys {
156 compatible = "gpio-keys";
157 pinctrl-0 = <&pmx_button_power>;
158 pinctrl-names = "default";
159
160 power-button {
161 /* On the back */
162 label = "Power Button";
163 linux,code = <KEY_POWER>;
164 gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
165 };
166 };
167
168 beeper: beeper {
169 /* 4KHz Piezoelectric buzzer */
170 compatible = "gpio-beeper";
171 pinctrl-0 = <&pmx_beeper>;
172 pinctrl-names = "default";
173 gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
174 };
175};
176
177&mdio {
178 status = "okay";
179
180 ethphy0: ethernet-phy@8 {
181 device_type = "ethernet-phy";
182 reg = <8>;
183 };
184
185 ethphy1: ethernet-phy@24 {
186 device_type = "ethernet-phy";
187 reg = <24>;
188 };
189};
190
191&eth0 {
192 status = "okay";
193 ethernet0-port@0 {
194 phy-handle = <&ethphy0>;
195 };
196};
197
198&eth1 {
199 status = "okay";
200 ethernet1-port@0 {
201 phy-handle = <&ethphy1>;
202 };
203};
204
diff --git a/arch/arm/boot/dts/kirkwood-ds109.dts b/arch/arm/boot/dts/kirkwood-ds109.dts
new file mode 100644
index 000000000000..772092c94ca3
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ds109.dts
@@ -0,0 +1,41 @@
1/*
2 * Andrew Lunn <andrew@lunn.ch>
3 * Ben Peddell <klightspeed@killerwolves.net>
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9
10/dts-v1/;
11
12#include "kirkwood.dtsi"
13#include "kirkwood-6281.dtsi"
14#include "kirkwood-synology.dtsi"
15
16/ {
17 model = "Synology DS109, DS110, DS110jv20";
18 compatible = "synology,ds109", "synology,ds110jv20",
19 "synology,ds110", "marvell,kirkwood";
20
21 memory {
22 device_type = "memory";
23 reg = <0x00000000 0x8000000>;
24 };
25
26 chosen {
27 bootargs = "console=ttyS0,115200n8";
28 };
29
30 gpio-fan-150-32-35 {
31 status = "okay";
32 };
33
34 gpio-leds-hdd-21-1 {
35 status = "okay";
36 };
37};
38
39&rs5c372 {
40 status = "okay";
41};
diff --git a/arch/arm/boot/dts/kirkwood-ds110jv10.dts b/arch/arm/boot/dts/kirkwood-ds110jv10.dts
new file mode 100644
index 000000000000..aabafbe0da4c
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ds110jv10.dts
@@ -0,0 +1,41 @@
1/*
2 * Andrew Lunn <andrew@lunn.ch>
3 * Ben Peddell <klightspeed@killerwolves.net>
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9
10/dts-v1/;
11
12#include "kirkwood.dtsi"
13#include "kirkwood-6281.dtsi"
14#include "kirkwood-synology.dtsi"
15
16/ {
17 model = "Synology DS110j v10 and v30";
18 compatible = "synology,ds110jv10", "synology,ds110jv30",
19 "marvell,kirkwood";
20
21 memory {
22 device_type = "memory";
23 reg = <0x00000000 0x8000000>;
24 };
25
26 chosen {
27 bootargs = "console=ttyS0,115200n8";
28 };
29
30 gpio-fan-150-32-35 {
31 status = "okay";
32 };
33
34 gpio-leds-hdd-21-1 {
35 status = "okay";
36 };
37};
38
39&s35390a {
40 status = "okay";
41};
diff --git a/arch/arm/boot/dts/kirkwood-ds111.dts b/arch/arm/boot/dts/kirkwood-ds111.dts
new file mode 100644
index 000000000000..16ec7fbab573
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ds111.dts
@@ -0,0 +1,44 @@
1/*
2 * Andrew Lunn <andrew@lunn.ch>
3 * Ben Peddell <klightspeed@killerwolves.net>
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9
10/dts-v1/;
11
12#include "kirkwood.dtsi"
13#include "kirkwood-6282.dtsi"
14#include "kirkwood-synology.dtsi"
15
16/ {
17 model = "Synology DS111";
18 compatible = "synology,ds111", "marvell,kirkwood";
19
20 memory {
21 device_type = "memory";
22 reg = <0x00000000 0x8000000>;
23 };
24
25 chosen {
26 bootargs = "console=ttyS0,115200n8";
27 };
28
29 gpio-fan-100-15-35-1 {
30 status = "okay";
31 };
32
33 gpio-leds-hdd-21-1 {
34 status = "okay";
35 };
36};
37
38&s35390a {
39 status = "okay";
40};
41
42&pcie2 {
43 status = "okay";
44};
diff --git a/arch/arm/boot/dts/kirkwood-ds112.dts b/arch/arm/boot/dts/kirkwood-ds112.dts
new file mode 100644
index 000000000000..cff1b2388765
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ds112.dts
@@ -0,0 +1,48 @@
1/*
2 * Andrew Lunn <andrew@lunn.ch>
3 * Ben Peddell <klightspeed@killerwolves.net>
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9
10/dts-v1/;
11
12#include "kirkwood.dtsi"
13#include "kirkwood-6282.dtsi"
14#include "kirkwood-synology.dtsi"
15
16/ {
17 model = "Synology DS111";
18 compatible = "synology,ds111", "marvell,kirkwood";
19
20 memory {
21 device_type = "memory";
22 reg = <0x00000000 0x8000000>;
23 };
24
25 chosen {
26 bootargs = "console=ttyS0,115200n8";
27 };
28
29 gpio-fan-100-15-35-1 {
30 status = "okay";
31 };
32
33 gpio-leds-21-2 {
34 status = "okay";
35 };
36
37 regulators-hdd-30 {
38 status = "okay";
39 };
40};
41
42&s35390a {
43 status = "okay";
44};
45
46&pcie2 {
47 status = "okay";
48};
diff --git a/arch/arm/boot/dts/kirkwood-ds209.dts b/arch/arm/boot/dts/kirkwood-ds209.dts
new file mode 100644
index 000000000000..330411993d38
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ds209.dts
@@ -0,0 +1,44 @@
1/*
2 * Andrew Lunn <andrew@lunn.ch>
3 * Ben Peddell <klightspeed@killerwolves.net>
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9
10/dts-v1/;
11
12#include "kirkwood.dtsi"
13#include "kirkwood-6281.dtsi"
14#include "kirkwood-synology.dtsi"
15
16/ {
17 model = "Synology DS209";
18 compatible = "synology,ds209", "marvell,kirkwood";
19
20 memory {
21 device_type = "memory";
22 reg = <0x00000000 0x8000000>;
23 };
24
25 chosen {
26 bootargs = "console=ttyS0,115200n8";
27 };
28
29 gpio-fan-150-32-35 {
30 status = "okay";
31 };
32
33 gpio-leds-hdd-21-2 {
34 status = "okay";
35 };
36
37 regulators-hdd-31 {
38 status = "okay";
39 };
40};
41
42&rs5c372 {
43 status = "okay";
44};
diff --git a/arch/arm/boot/dts/kirkwood-ds210.dts b/arch/arm/boot/dts/kirkwood-ds210.dts
new file mode 100644
index 000000000000..6052eaa37d4f
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ds210.dts
@@ -0,0 +1,46 @@
1/*
2 * Andrew Lunn <andrew@lunn.ch>
3 * Ben Peddell <klightspeed@killerwolves.net>
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9
10/dts-v1/;
11
12#include "kirkwood.dtsi"
13#include "kirkwood-6281.dtsi"
14#include "kirkwood-synology.dtsi"
15
16/ {
17 model = "Synology DS210 v10, v20, v30, DS211j";
18 compatible = "synology,ds210jv10", "synology,ds210jv20",
19 "synology,ds210jv30", "synology,ds211j",
20 "marvell,kirkwood";
21
22 memory {
23 device_type = "memory";
24 reg = <0x00000000 0x8000000>;
25 };
26
27 chosen {
28 bootargs = "console=ttyS0,115200n8";
29 };
30
31 gpio-fan-150-32-35 {
32 status = "okay";
33 };
34
35 gpio-leds-hdd-21-2 {
36 status = "okay";
37 };
38
39 regulators-hdd-31 {
40 status = "okay";
41 };
42};
43
44&s35390a {
45 status = "okay";
46};
diff --git a/arch/arm/boot/dts/kirkwood-ds212.dts b/arch/arm/boot/dts/kirkwood-ds212.dts
new file mode 100644
index 000000000000..7f76cd30e84e
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ds212.dts
@@ -0,0 +1,47 @@
1/*
2 * Andrew Lunn <andrew@lunn.ch>
3 * Ben Peddell <klightspeed@killerwolves.net>
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9
10/dts-v1/;
11
12#include "kirkwood.dtsi"
13#include "kirkwood-6282.dtsi"
14#include "kirkwood-synology.dtsi"
15
16/ {
17 model = "Synology DS212, DS212p v10, v20, DS213air v10, DS213 v10";
18 compatible = "synology,ds212", "synology,ds212pv10",
19 "synology,ds212pv10", "synology,ds212pv20",
20 "synology,ds213airv10", "synology,ds213v10",
21 "marvell,kirkwood";
22
23 memory {
24 device_type = "memory";
25 reg = <0x00000000 0x8000000>;
26 };
27
28 chosen {
29 bootargs = "console=ttyS0,115200n8";
30 };
31
32 gpio-fan-100-15-35-1 {
33 status = "okay";
34 };
35
36 gpio-leds-hdd-21-2 {
37 status = "okay";
38 };
39};
40
41&s35390a {
42 status = "okay";
43};
44
45&pcie2 {
46 status = "okay";
47};
diff --git a/arch/arm/boot/dts/kirkwood-ds212j.dts b/arch/arm/boot/dts/kirkwood-ds212j.dts
new file mode 100644
index 000000000000..1f83a00f1f74
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ds212j.dts
@@ -0,0 +1,41 @@
1/*
2 * Andrew Lunn <andrew@lunn.ch>
3 * Ben Peddell <klightspeed@killerwolves.net>
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9
10/dts-v1/;
11
12#include "kirkwood.dtsi"
13#include "kirkwood-6281.dtsi"
14#include "kirkwood-synology.dtsi"
15
16/ {
17 model = "Synology DS212j v10, v20";
18 compatible = "synology,ds212jv10", "synology,ds212jv20",
19 "marvell,kirkwood";
20
21 memory {
22 device_type = "memory";
23 reg = <0x00000000 0x8000000>;
24 };
25
26 chosen {
27 bootargs = "console=ttyS0,115200n8";
28 };
29
30 gpio-fan-100-32-35 {
31 status = "okay";
32 };
33
34 gpio-leds-hdd-21-2 {
35 status = "okay";
36 };
37};
38
39&s35390a {
40 status = "okay";
41};
diff --git a/arch/arm/boot/dts/kirkwood-ds409.dts b/arch/arm/boot/dts/kirkwood-ds409.dts
new file mode 100644
index 000000000000..0a573add44a2
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ds409.dts
@@ -0,0 +1,48 @@
1/*
2 * Andrew Lunn <andrew@lunn.ch>
3 * Ben Peddell <klightspeed@killerwolves.net>
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9
10/dts-v1/;
11
12#include "kirkwood.dtsi"
13#include "kirkwood-6281.dtsi"
14#include "kirkwood-synology.dtsi"
15
16/ {
17 model = "Synology DS409, DS410j";
18 compatible = "synology,ds409", "synology,ds410j", "marvell,kirkwood";
19
20 memory {
21 device_type = "memory";
22 reg = <0x00000000 0x8000000>;
23 };
24
25 chosen {
26 bootargs = "console=ttyS0,115200n8";
27 };
28
29 gpio-fan-150-15-18 {
30 status = "okay";
31 };
32
33 gpio-leds-hdd-36 {
34 status = "okay";
35 };
36
37 gpio-leds-alarm-12 {
38 status = "okay";
39 };
40};
41
42&eth1 {
43 status = "okay";
44};
45
46&rs5c372 {
47 status = "okay";
48};
diff --git a/arch/arm/boot/dts/kirkwood-ds409slim.dts b/arch/arm/boot/dts/kirkwood-ds409slim.dts
new file mode 100644
index 000000000000..1848a6245fd3
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ds409slim.dts
@@ -0,0 +1,40 @@
1/*
2 * Andrew Lunn <andrew@lunn.ch>
3 * Ben Peddell <klightspeed@killerwolves.net>
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9
10/dts-v1/;
11
12#include "kirkwood.dtsi"
13#include "kirkwood-6281.dtsi"
14#include "kirkwood-synology.dtsi"
15
16/ {
17 model = "Synology 409slim";
18 compatible = "synology,ds409slim", "marvell,kirkwood";
19
20 memory {
21 device_type = "memory";
22 reg = <0x00000000 0x8000000>;
23 };
24
25 chosen {
26 bootargs = "console=ttyS0,115200n8";
27 };
28
29 gpio-fan-150-32-35 {
30 status = "okay";
31 };
32
33 gpio-leds-hdd-20 {
34 status = "okay";
35 };
36};
37
38&rs5c372 {
39 status = "okay";
40};
diff --git a/arch/arm/boot/dts/kirkwood-ds411.dts b/arch/arm/boot/dts/kirkwood-ds411.dts
new file mode 100644
index 000000000000..a1737b4311c6
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ds411.dts
@@ -0,0 +1,52 @@
1/*
2 * Andrew Lunn <andrew@lunn.ch>
3 * Ben Peddell <klightspeed@killerwolves.net>
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9
10/dts-v1/;
11
12#include "kirkwood.dtsi"
13#include "kirkwood-6282.dtsi"
14#include "kirkwood-synology.dtsi"
15
16/ {
17 model = "Synology DS411, DS413jv10";
18 compatible = "synology,ds411", "synology,ds413jv10", "marvell,kirkwood";
19
20 memory {
21 device_type = "memory";
22 reg = <0x00000000 0x8000000>;
23 };
24
25 chosen {
26 bootargs = "console=ttyS0,115200n8";
27 };
28
29 gpio-fan-100-15-35-1 {
30 status = "okay";
31 };
32
33 gpio-leds-hdd-36 {
34 status = "okay";
35 };
36
37 regulators-hdd-34 {
38 status = "okay";
39 };
40};
41
42&eth1 {
43 status = "okay";
44};
45
46&s35390a {
47 status = "okay";
48};
49
50&pcie2 {
51 status = "okay";
52};
diff --git a/arch/arm/boot/dts/kirkwood-ds411j.dts b/arch/arm/boot/dts/kirkwood-ds411j.dts
new file mode 100644
index 000000000000..0cde914eceae
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ds411j.dts
@@ -0,0 +1,48 @@
1/*
2 * Andrew Lunn <andrew@lunn.ch>
3 * Ben Peddell <klightspeed@killerwolves.net>
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9
10/dts-v1/;
11
12#include "kirkwood.dtsi"
13#include "kirkwood-6281.dtsi"
14#include "kirkwood-synology.dtsi"
15
16/ {
17 model = "Synology DS411j";
18 compatible = "synology,ds411j", "marvell,kirkwood";
19
20 memory {
21 device_type = "memory";
22 reg = <0x00000000 0x8000000>;
23 };
24
25 chosen {
26 bootargs = "console=ttyS0,115200n8";
27 };
28
29 gpio-fan-150-15-18 {
30 status = "okay";
31 };
32
33 gpio-leds-hdd-36 {
34 status = "okay";
35 };
36
37 gpio-leds-alarm-12 {
38 status = "okay";
39 };
40};
41
42&eth1 {
43 status = "okay";
44};
45
46&s35390a {
47 status = "okay";
48};
diff --git a/arch/arm/boot/dts/kirkwood-ds411slim.dts b/arch/arm/boot/dts/kirkwood-ds411slim.dts
new file mode 100644
index 000000000000..aef0cadc2c78
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ds411slim.dts
@@ -0,0 +1,48 @@
1/*
2 * Andrew Lunn <andrew@lunn.ch>
3 * Ben Peddell <klightspeed@killerwolves.net>
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9
10/dts-v1/;
11
12#include "kirkwood.dtsi"
13#include "kirkwood-6282.dtsi"
14#include "kirkwood-synology.dtsi"
15
16/ {
17 model = "Synology DS411slim";
18 compatible = "synology,ds411slim", "marvell,kirkwood";
19
20 memory {
21 device_type = "memory";
22 reg = <0x00000000 0x8000000>;
23 };
24
25 chosen {
26 bootargs = "console=ttyS0,115200n8";
27 };
28
29 gpio-fan-100-15-35-1 {
30 status = "okay";
31 };
32
33 gpio-leds-hdd-36 {
34 status = "okay";
35 };
36};
37
38&eth1 {
39 status = "okay";
40};
41
42&s35390a {
43 status = "okay";
44};
45
46&pcie2 {
47 status = "okay";
48};
diff --git a/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts b/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
index dc86429756d7..2cb0dc529165 100644
--- a/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
+++ b/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
@@ -122,4 +122,66 @@
122 gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; 122 gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
123 }; 123 };
124 }; 124 };
125
126 dsa@0 {
127 compatible = "marvell,dsa";
128 #address-cells = <2>;
129 #size-cells = <0>;
130
131 dsa,ethernet = <&eth0>;
132 dsa,mii-bus = <&ethphy0>;
133
134 switch@0 {
135 #address-cells = <1>;
136 #size-cells = <0>;
137 reg = <0 0>; /* MDIO address 0, switch 0 in tree */
138
139 port@0 {
140 reg = <0>;
141 label = "lan1";
142 };
143
144 port@1 {
145 reg = <1>;
146 label = "lan2";
147 };
148
149 port@2 {
150 reg = <2>;
151 label = "lan3";
152 };
153
154 port@3 {
155 reg = <3>;
156 label = "lan4";
157 };
158
159 port@4 {
160 reg = <4>;
161 label = "wan";
162 };
163
164 port@5 {
165 reg = <5>;
166 label = "cpu";
167 };
168 };
169 };
170};
171
172&mdio {
173 status = "okay";
174
175 ethphy0: ethernet-phy@ff {
176 reg = <0xff>; /* No phy attached */
177 speed = <1000>;
178 duplex = <1>;
179 };
180};
181
182&eth0 {
183 status = "okay";
184 ethernet0-port@0 {
185 phy-handle = <&ethphy0>;
186 };
125}; 187};
diff --git a/arch/arm/boot/dts/kirkwood-rd88f6192.dts b/arch/arm/boot/dts/kirkwood-rd88f6192.dts
new file mode 100644
index 000000000000..e9dd85049297
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-rd88f6192.dts
@@ -0,0 +1,112 @@
1/*
2 * Marvell RD88F6192 Board descrition
3 *
4 * Andrew Lunn <andrew@lunn.ch>
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 * This file contains the definitions that are common between the three
11 * variants of the Marvell Kirkwood Development Board.
12 */
13/dts-v1/;
14
15#include "kirkwood.dtsi"
16#include "kirkwood-6192.dtsi"
17
18/ {
19 model = "Marvell RD88F6192 reference design";
20 compatible = "marvell,rd88f6192", "marvell,kirkwood-88f6192", "marvell,kirkwood";
21
22 memory {
23 device_type = "memory";
24 reg = <0x00000000 0x20000000>;
25 };
26
27 chosen {
28 bootargs = "console=ttyS0,115200n8";
29 };
30
31 mbus {
32 pcie-controller {
33 status = "okay";
34
35 pcie@1,0 {
36 status = "okay";
37 };
38 };
39 };
40
41 ocp@f1000000 {
42 pinctrl: pinctrl@10000 {
43 pinctrl-0 = <&pmx_usb_power>;
44 pinctrl-names = "default";
45
46 pmx_usb_power: pmx-usb-power {
47 marvell,pins = "mpp10";
48 marvell,function = "gpo";
49 };
50 };
51
52 serial@12000 {
53 status = "okay";
54
55 };
56
57 spi@10600 {
58 status = "okay";
59 pinctrl-0 = <&pmx_spi>;
60 pinctrl-names = "default";
61
62 m25p128@0 {
63 #address-cells = <1>;
64 #size-cells = <1>;
65 compatible = "st,m25p128";
66 reg = <0>;
67 spi-max-frequency = <20000000>;
68 mode = <0>;
69 };
70 };
71
72 sata@80000 {
73 status = "okay";
74 nr-ports = <2>;
75 };
76 };
77
78 regulators {
79 compatible = "simple-bus";
80 #address-cells = <1>;
81 #size-cells = <0>;
82 pinctrl-0 = <&pmx_usb_power>;
83 pinctrl-names = "default";
84
85 usb_power: regulator@0 {
86 compatible = "regulator-fixed";
87 reg = <0>;
88 regulator-name = "USB VBUS";
89 regulator-min-microvolt = <5000000>;
90 regulator-max-microvolt = <5000000>;
91 enable-active-high;
92 regulator-always-on;
93 regulator-boot-on;
94 gpio = <&gpio0 10 GPIO_ACTIVE_HIGH>;
95 };
96 };
97};
98
99&mdio {
100 status = "okay";
101
102 ethphy0: ethernet-phy@8 {
103 reg = <8>;
104 };
105};
106
107&eth0 {
108 status = "okay";
109 ethernet0-port@0 {
110 phy-handle = <&ethphy0>;
111 };
112}; \ No newline at end of file
diff --git a/arch/arm/boot/dts/kirkwood-rd88f6281-a0.dts b/arch/arm/boot/dts/kirkwood-rd88f6281-a0.dts
new file mode 100644
index 000000000000..a803bbb70bc8
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-rd88f6281-a0.dts
@@ -0,0 +1,26 @@
1/*
2 * Marvell RD88F6181 A0 Board descrition
3 *
4 * Andrew Lunn <andrew@lunn.ch>
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 * This file contains the definitions for the board with the A0 variant of
11 * the SoC. The ethernet switch does not have a "wan" port.
12 */
13
14/dts-v1/;
15#include "kirkwood-rd88f6281.dtsi"
16
17/ {
18 model = "Marvell RD88f6281 Reference design, with A0 SoC";
19 compatible = "marvell,rd88f6281-a0", "marvell,rd88f6281","marvell,kirkwood-88f6281", "marvell,kirkwood";
20
21 dsa@0 {
22 switch@0 {
23 reg = <10 0>; /* MDIO address 10, switch 0 in tree */
24 };
25 };
26}; \ No newline at end of file
diff --git a/arch/arm/boot/dts/kirkwood-rd88f6281-a1.dts b/arch/arm/boot/dts/kirkwood-rd88f6281-a1.dts
new file mode 100644
index 000000000000..baeebbf1d8c7
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-rd88f6281-a1.dts
@@ -0,0 +1,31 @@
1/*
2 * Marvell RD88F6181 A1 Board descrition
3 *
4 * Andrew Lunn <andrew@lunn.ch>
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 * This file contains the definitions for the board with the A1 variant of
11 * the SoC. The ethernet switch has a "wan" port.
12 */
13
14/dts-v1/;
15
16#include "kirkwood-rd88f6281.dtsi"
17
18/ {
19 model = "Marvell RD88f6281 Reference design, with A1 SoC";
20 compatible = "marvell,rd88f6281-a1", "marvell,rd88f6281","marvell,kirkwood-88f6281", "marvell,kirkwood";
21
22 dsa@0 {
23 switch@0 {
24 reg = <0 0>; /* MDIO address 0, switch 0 in tree */
25 port@4 {
26 reg = <4>;
27 label = "wan";
28 };
29 };
30 };
31}; \ No newline at end of file
diff --git a/arch/arm/boot/dts/kirkwood-rd88f6281.dtsi b/arch/arm/boot/dts/kirkwood-rd88f6281.dtsi
new file mode 100644
index 000000000000..d6368c39102e
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-rd88f6281.dtsi
@@ -0,0 +1,152 @@
1/*
2 * Marvell RD88F6181 Common Board descrition
3 *
4 * Andrew Lunn <andrew@lunn.ch>
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 * This file contains the definitions that are common between the two
11 * variants of the Marvell Kirkwood Development Board.
12 */
13
14#include "kirkwood.dtsi"
15#include "kirkwood-6281.dtsi"
16
17/ {
18 memory {
19 device_type = "memory";
20 reg = <0x00000000 0x20000000>;
21 };
22
23 chosen {
24 bootargs = "console=ttyS0,115200n8";
25 };
26
27 mbus {
28 pcie-controller {
29 status = "okay";
30
31 pcie@1,0 {
32 status = "okay";
33 };
34 };
35 };
36
37 ocp@f1000000 {
38 pinctrl: pinctrl@10000 {
39 pinctrl-0 = <&pmx_sdio_cd>;
40 pinctrl-names = "default";
41
42 pmx_sdio_cd: pmx-sdio-cd {
43 marvell,pins = "mpp28";
44 marvell,function = "gpio";
45 };
46 };
47
48 serial@12000 {
49 status = "okay";
50
51 };
52
53 sata@80000 {
54 status = "okay";
55 nr-ports = <2>;
56 };
57 mvsdio@90000 {
58 pinctrl-0 = <&pmx_sdio &pmx_sdio_cd>;
59 pinctrl-names = "default";
60 status = "okay";
61 cd-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>;
62 /* No WP GPIO */
63 };
64 };
65
66 dsa@0 {
67 compatible = "marvell,dsa";
68 #address-cells = <2>;
69 #size-cells = <0>;
70
71 dsa,ethernet = <&eth0>;
72 dsa,mii-bus = <&ethphy1>;
73
74 switch@0 {
75 #address-cells = <1>;
76 #size-cells = <0>;
77
78 port@0 {
79 reg = <0>;
80 label = "lan1";
81 };
82
83 port@1 {
84 reg = <1>;
85 label = "lan2";
86 };
87
88 port@2 {
89 reg = <2>;
90 label = "lan3";
91 };
92
93 port@3 {
94 reg = <3>;
95 label = "lan4";
96 };
97
98 port@5 {
99 reg = <5>;
100 label = "cpu";
101 };
102 };
103 };
104};
105
106&nand {
107 status = "okay";
108
109 partition@0 {
110 label = "u-boot";
111 reg = <0x0000000 0x100000>;
112 read-only;
113 };
114
115 partition@100000 {
116 label = "uImage";
117 reg = <0x0100000 0x200000>;
118 };
119
120 partition@300000 {
121 label = "data";
122 reg = <0x0300000 0x500000>;
123 };
124};
125
126&mdio {
127 status = "okay";
128
129 ethphy0: ethernet-phy@0 {
130 reg = <0>;
131 };
132
133 ethphy1: ethernet-phy@ff {
134 reg = <0xff>; /* No PHY attached */
135 speed = <1000>;
136 duple = <1>;
137 };
138};
139
140&eth0 {
141 status = "okay";
142 ethernet0-port@0 {
143 phy-handle = <&ethphy0>;
144 };
145};
146
147&eth1 {
148 status = "okay";
149 ethernet1-port@0 {
150 phy-handle = <&ethphy1>;
151 };
152};
diff --git a/arch/arm/boot/dts/kirkwood-rs212.dts b/arch/arm/boot/dts/kirkwood-rs212.dts
new file mode 100644
index 000000000000..93ec3d00c6ab
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-rs212.dts
@@ -0,0 +1,48 @@
1/*
2 * Andrew Lunn <andrew@lunn.ch>
3 * Ben Peddell <klightspeed@killerwolves.net>
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9
10/dts-v1/;
11
12#include "kirkwood.dtsi"
13#include "kirkwood-6282.dtsi"
14#include "kirkwood-synology.dtsi"
15
16/ {
17 model = "Synology RS212";
18 compatible = "synology,rs212", "marvell,kirkwood";
19
20 memory {
21 device_type = "memory";
22 reg = <0x00000000 0x8000000>;
23 };
24
25 chosen {
26 bootargs = "console=ttyS0,115200n8";
27 };
28
29 gpio-fan-100-15-35-3 {
30 status = "okay";
31 };
32
33 gpio-leds-hdd-38 {
34 status = "okay";
35 };
36
37 regulators-hdd-30-2 {
38 status = "okay";
39 };
40};
41
42&s35390a {
43 status = "okay";
44};
45
46&pcie2 {
47 status = "okay";
48};
diff --git a/arch/arm/boot/dts/kirkwood-rs409.dts b/arch/arm/boot/dts/kirkwood-rs409.dts
new file mode 100644
index 000000000000..311df4e5aa28
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-rs409.dts
@@ -0,0 +1,44 @@
1/*
2 * Andrew Lunn <andrew@lunn.ch>
3 * Ben Peddell <klightspeed@killerwolves.net>
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9
10/dts-v1/;
11
12#include "kirkwood.dtsi"
13#include "kirkwood-6281.dtsi"
14#include "kirkwood-synology.dtsi"
15
16/ {
17 model = "Synology RS409";
18 compatible = "synology,rs409", "marvell,kirkwood";
19
20 memory {
21 device_type = "memory";
22 reg = <0x00000000 0x8000000>;
23 };
24
25 chosen {
26 bootargs = "console=ttyS0,115200n8";
27 };
28
29 gpio-fan-150-15-18 {
30 status = "okay";
31 };
32
33 gpio-leds-hdd-36 {
34 status = "okay";
35 };
36};
37
38&eth1 {
39 status = "okay";
40};
41
42&rs5c372 {
43 status = "okay";
44};
diff --git a/arch/arm/boot/dts/kirkwood-rs411.dts b/arch/arm/boot/dts/kirkwood-rs411.dts
new file mode 100644
index 000000000000..f90da850bb31
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-rs411.dts
@@ -0,0 +1,44 @@
1/*
2 * Andrew Lunn <andrew@lunn.ch>
3 * Ben Peddell <klightspeed@killerwolves.net>
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9
10/dts-v1/;
11
12#include "kirkwood.dtsi"
13#include "kirkwood-6282.dtsi"
14#include "kirkwood-synology.dtsi"
15
16/ {
17 model = "Synology RS411 RS812";
18 compatible = "synology,rs411", "synology,rs812", "marvell,kirkwood";
19
20 memory {
21 device_type = "memory";
22 reg = <0x00000000 0x8000000>;
23 };
24
25 chosen {
26 bootargs = "console=ttyS0,115200n8";
27 };
28
29 gpio-fan-100-15-35-3 {
30 status = "okay";
31 };
32
33 gpio-leds-hdd-36 {
34 status = "okay";
35 };
36};
37
38&eth1 {
39 status = "okay";
40};
41
42&s35390a {
43 status = "okay";
44};
diff --git a/arch/arm/boot/dts/kirkwood-synology.dtsi b/arch/arm/boot/dts/kirkwood-synology.dtsi
new file mode 100644
index 000000000000..4227c974729d
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-synology.dtsi
@@ -0,0 +1,871 @@
1/*
2 * Nodes for Marvell 628x Synology devices
3 *
4 * Andrew Lunn <andrew@lunn.ch>
5 * Ben Peddell <klightspeed@killerwolves.net>
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/ {
13 mbus {
14 pcie-controller {
15 status = "okay";
16
17 pcie@1,0 {
18 status = "okay";
19 };
20
21 pcie2: pcie@2,0 {
22 status = "disabled";
23 };
24 };
25 };
26
27 ocp@f1000000 {
28 pinctrl: pinctrl@10000 {
29 pmx_alarmled_12: pmx-alarmled-12 {
30 marvell,pins = "mpp12";
31 marvell,function = "gpio";
32 };
33
34 pmx_fanctrl_15: pmx-fanctrl-15 {
35 marvell,pins = "mpp15";
36 marvell,function = "gpio";
37 };
38
39 pmx_fanctrl_16: pmx-fanctrl-16 {
40 marvell,pins = "mpp16";
41 marvell,function = "gpio";
42 };
43
44 pmx_fanctrl_17: pmx-fanctrl-17 {
45 marvell,pins = "mpp17";
46 marvell,function = "gpio";
47 };
48
49 pmx_fanalarm_18: pmx-fanalarm-18 {
50 marvell,pins = "mpp18";
51 marvell,function = "gpo";
52 };
53
54 pmx_hddled_20: pmx-hddled-20 {
55 marvell,pins = "mpp20";
56 marvell,function = "gpio";
57 };
58
59 pmx_hddled_21: pmx-hddled-21 {
60 marvell,pins = "mpp21";
61 marvell,function = "gpio";
62 };
63
64 pmx_hddled_22: pmx-hddled-22 {
65 marvell,pins = "mpp22";
66 marvell,function = "gpio";
67 };
68
69 pmx_hddled_23: pmx-hddled-23 {
70 marvell,pins = "mpp23";
71 marvell,function = "gpio";
72 };
73
74 pmx_hddled_24: pmx-hddled-24 {
75 marvell,pins = "mpp24";
76 marvell,function = "gpio";
77 };
78
79 pmx_hddled_25: pmx-hddled-25 {
80 marvell,pins = "mpp25";
81 marvell,function = "gpio";
82 };
83
84 pmx_hddled_26: pmx-hddled-26 {
85 marvell,pins = "mpp26";
86 marvell,function = "gpio";
87 };
88
89 pmx_hddled_27: pmx-hddled-27 {
90 marvell,pins = "mpp27";
91 marvell,function = "gpio";
92 };
93
94 pmx_hddled_28: pmx-hddled-28 {
95 marvell,pins = "mpp28";
96 marvell,function = "gpio";
97 };
98
99 pmx_hdd1_pwr_29: pmx-hdd1-pwr-29 {
100 marvell,pins = "mpp29";
101 marvell,function = "gpio";
102 };
103
104 pmx_hdd1_pwr_30: pmx-hdd-pwr-30 {
105 marvell,pins = "mpp30";
106 marvell,function = "gpio";
107 };
108
109 pmx_hdd2_pwr_31: pmx-hdd2-pwr-31 {
110 marvell,pins = "mpp31";
111 marvell,function = "gpio";
112 };
113
114 pmx_fanctrl_32: pmx-fanctrl-32 {
115 marvell,pins = "mpp32";
116 marvell,function = "gpio";
117 };
118
119 pmx_fanctrl_33: pmx-fanctrl-33 {
120 marvell,pins = "mpp33";
121 marvell,function = "gpo";
122 };
123
124 pmx_fanctrl_34: pmx-fanctrl-34 {
125 marvell,pins = "mpp34";
126 marvell,function = "gpio";
127 };
128
129 pmx_hdd2_pwr_34: pmx-hdd2-pwr-34 {
130 marvell,pins = "mpp34";
131 marvell,function = "gpio";
132 };
133
134 pmx_fanalarm_35: pmx-fanalarm-35 {
135 marvell,pins = "mpp35";
136 marvell,function = "gpio";
137 };
138
139 pmx_hddled_36: pmx-hddled-36 {
140 marvell,pins = "mpp36";
141 marvell,function = "gpio";
142 };
143
144 pmx_hddled_37: pmx-hddled-37 {
145 marvell,pins = "mpp37";
146 marvell,function = "gpio";
147 };
148
149 pmx_hddled_38: pmx-hddled-38 {
150 marvell,pins = "mpp38";
151 marvell,function = "gpio";
152 };
153
154 pmx_hddled_39: pmx-hddled-39 {
155 marvell,pins = "mpp39";
156 marvell,function = "gpio";
157 };
158
159 pmx_hddled_40: pmx-hddled-40 {
160 marvell,pins = "mpp40";
161 marvell,function = "gpio";
162 };
163
164 pmx_hddled_41: pmx-hddled-41 {
165 marvell,pins = "mpp41";
166 marvell,function = "gpio";
167 };
168
169 pmx_hddled_42: pmx-hddled-42 {
170 marvell,pins = "mpp42";
171 marvell,function = "gpio";
172 };
173
174 pmx_hddled_43: pmx-hddled-43 {
175 marvell,pins = "mpp43";
176 marvell,function = "gpio";
177 };
178
179 pmx_hddled_44: pmx-hddled-44 {
180 marvell,pins = "mpp44";
181 marvell,function = "gpio";
182 };
183
184 pmx_hddled_45: pmx-hddled-45 {
185 marvell,pins = "mpp45";
186 marvell,function = "gpio";
187 };
188
189 pmx_hdd3_pwr_44: pmx-hdd3-pwr-44 {
190 marvell,pins = "mpp44";
191 marvell,function = "gpio";
192 };
193
194 pmx_hdd4_pwr_45: pmx-hdd4-pwr-45 {
195 marvell,pins = "mpp45";
196 marvell,function = "gpio";
197 };
198
199 pmx_fanalarm_44: pmx-fanalarm-44 {
200 marvell,pins = "mpp44";
201 marvell,function = "gpio";
202 };
203
204 pmx_fanalarm_45: pmx-fanalarm-45 {
205 marvell,pins = "mpp45";
206 marvell,function = "gpio";
207 };
208 };
209
210 rtc@10300 {
211 status = "disabled";
212 };
213
214 spi@10600 {
215 status = "okay";
216 pinctrl-0 = <&pmx_spi>;
217 pinctrl-names = "default";
218
219 m25p80@0 {
220 #address-cells = <1>;
221 #size-cells = <1>;
222 compatible = "st,m25p80";
223 reg = <0>;
224 spi-max-frequency = <20000000>;
225 mode = <0>;
226
227 partition@00000000 {
228 reg = <0x00000000 0x00080000>;
229 label = "RedBoot";
230 };
231
232 partition@00080000 {
233 reg = <0x00080000 0x00200000>;
234 label = "zImage";
235 };
236
237 partition@00280000 {
238 reg = <0x00280000 0x00140000>;
239 label = "rd.gz";
240 };
241
242 partition@003c0000 {
243 reg = <0x003c0000 0x00010000>;
244 label = "vendor";
245 };
246
247 partition@003d0000 {
248 reg = <0x003d0000 0x00020000>;
249 label = "RedBoot config";
250 };
251
252 partition@003f0000 {
253 reg = <0x003f0000 0x00010000>;
254 label = "FIS directory";
255 };
256 };
257 };
258
259 i2c@11000 {
260 status = "okay";
261 clock-frequency = <400000>;
262 pinctrl-0 = <&pmx_twsi0>;
263 pinctrl-names = "default";
264
265 rs5c372: rs5c372@32 {
266 status = "disabled";
267 compatible = "ricoh,rs5c372";
268 reg = <0x32>;
269 };
270
271 s35390a: s35390a@30 {
272 status = "disabled";
273 compatible = "ssi,s35390a";
274 reg = <0x30>;
275 };
276 };
277
278 serial@12000 {
279 status = "okay";
280 pinctrl-0 = <&pmx_uart0>;
281 pinctrl-names = "default";
282 };
283
284 serial@12100 {
285 status = "okay";
286 pinctrl-0 = <&pmx_uart1>;
287 pinctrl-names = "default";
288 };
289
290 poweroff@12100 {
291 compatible = "synology,power-off";
292 reg = <0x12100 0x100>;
293 clocks = <&gate_clk 7>;
294 };
295
296 sata@80000 {
297 pinctrl-0 = <&pmx_sata0 &pmx_sata1>;
298 pinctrl-names = "default";
299 status = "okay";
300 nr-ports = <2>;
301 };
302 };
303
304 gpio-fan-150-32-35 {
305 status = "disabled";
306 compatible = "gpio-fan";
307 pinctrl-0 = <&pmx_fanctrl_32 &pmx_fanctrl_33 &pmx_fanctrl_34
308 &pmx_fanalarm_35>;
309 pinctrl-names = "default";
310 gpios = <&gpio1 0 GPIO_ACTIVE_HIGH
311 &gpio1 1 GPIO_ACTIVE_HIGH
312 &gpio1 2 GPIO_ACTIVE_HIGH>;
313 gpio-fan,speed-map = < 0 0
314 2200 1
315 2500 2
316 3000 4
317 3300 3
318 3700 5
319 3800 6
320 4200 7 >;
321 };
322
323 gpio-fan-150-15-18 {
324 status = "disabled";
325 compatible = "gpio-fan";
326 pinctrl-0 = <&pmx_fanctrl_15 &pmx_fanctrl_16 &pmx_fanctrl_17
327 &pmx_fanalarm_18>;
328 pinctrl-names = "default";
329 gpios = <&gpio0 15 GPIO_ACTIVE_HIGH
330 &gpio0 16 GPIO_ACTIVE_HIGH
331 &gpio0 17 GPIO_ACTIVE_HIGH>;
332 alarm-gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>;
333 gpio-fan,speed-map = < 0 0
334 2200 1
335 2500 2
336 3000 4
337 3300 3
338 3700 5
339 3800 6
340 4200 7 >;
341 };
342
343 gpio-fan-100-32-35 {
344 status = "disabled";
345 compatible = "gpio-fan";
346 pinctrl-0 = <&pmx_fanctrl_32 &pmx_fanctrl_33 &pmx_fanctrl_34
347 &pmx_fanalarm_35>;
348 pinctrl-names = "default";
349 gpios = <&gpio1 0 GPIO_ACTIVE_HIGH
350 &gpio1 1 GPIO_ACTIVE_HIGH
351 &gpio1 2 GPIO_ACTIVE_HIGH>;
352 alarm-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
353 gpio-fan,speed-map = < 0 0
354 2500 1
355 3100 2
356 3800 3
357 4600 4
358 4800 5
359 4900 6
360 5000 7 >;
361 };
362
363 gpio-fan-100-15-18 {
364 status = "disabled";
365 compatible = "gpio-fan";
366 pinctrl-0 = <&pmx_fanctrl_15 &pmx_fanctrl_16 &pmx_fanctrl_17
367 &pmx_fanalarm_18>;
368 pinctrl-names = "default";
369 gpios = <&gpio0 15 GPIO_ACTIVE_HIGH
370 &gpio0 16 GPIO_ACTIVE_HIGH
371 &gpio0 17 GPIO_ACTIVE_HIGH>;
372 alarm-gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>;
373 gpio-fan,speed-map = < 0 0
374 2500 1
375 3100 2
376 3800 3
377 4600 4
378 4800 5
379 4900 6
380 5000 7 >;
381 };
382
383 gpio-fan-100-15-35-1 {
384 status = "disabled";
385 compatible = "gpio-fan";
386 pinctrl-0 = <&pmx_fanctrl_15 &pmx_fanctrl_16 &pmx_fanctrl_17
387 &pmx_fanalarm_35>;
388 pinctrl-names = "default";
389 gpios = <&gpio0 15 GPIO_ACTIVE_HIGH
390 &gpio0 16 GPIO_ACTIVE_HIGH
391 &gpio0 17 GPIO_ACTIVE_HIGH>;
392 alarm-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
393 gpio-fan,speed-map = < 0 0
394 2500 1
395 3100 2
396 3800 3
397 4600 4
398 4800 5
399 4900 6
400 5000 7 >;
401 };
402
403 gpio-fan-100-15-35-3 {
404 status = "disabled";
405 compatible = "gpio-fan";
406 pinctrl-0 = <&pmx_fanctrl_15 &pmx_fanctrl_16 &pmx_fanctrl_17
407 &pmx_fanalarm_35 &pmx_fanalarm_44 &pmx_fanalarm_45>;
408 pinctrl-names = "default";
409 gpios = <&gpio0 15 GPIO_ACTIVE_HIGH
410 &gpio0 16 GPIO_ACTIVE_HIGH
411 &gpio0 17 GPIO_ACTIVE_HIGH>;
412 alarm-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH
413 &gpio1 12 GPIO_ACTIVE_HIGH
414 &gpio1 13 GPIO_ACTIVE_HIGH>;
415 gpio-fan,speed-map = < 0 0
416 2500 1
417 3100 2
418 3800 3
419 4600 4
420 4800 5
421 4900 6
422 5000 7 >;
423 };
424
425 gpio-leds-alarm-12 {
426 status = "disabled";
427 compatible = "gpio-leds";
428 pinctrl-0 = <&pmx_alarmled_12>;
429 pinctrl-names = "default";
430
431 hdd1-green {
432 label = "synology:alarm";
433 gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
434 };
435 };
436
437 gpio-leds-hdd-20 {
438 status = "disabled";
439 compatible = "gpio-leds";
440 pinctrl-0 = <&pmx_hddled_20 &pmx_hddled_21 &pmx_hddled_22
441 &pmx_hddled_23 &pmx_hddled_24 &pmx_hddled_25
442 &pmx_hddled_26 &pmx_hddled_27>;
443 pinctrl-names = "default";
444
445 hdd1-green {
446 label = "synology:green:hdd1";
447 gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
448 };
449
450 hdd1-amber {
451 label = "synology:amber:hdd1";
452 gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
453 };
454
455 hdd2-green {
456 label = "synology:green:hdd2";
457 gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
458 };
459
460 hdd2-amber {
461 label = "synology:amber:hdd2";
462 gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
463 };
464
465 hdd3-green {
466 label = "synology:green:hdd3";
467 gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
468 };
469
470 hdd3-amber {
471 label = "synology:amber:hdd3";
472 gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
473 };
474
475 hdd4-green {
476 label = "synology:green:hdd4";
477 gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
478 };
479
480 hdd4-amber {
481 label = "synology:amber:hdd4";
482 gpios = <&gpio0 27 GPIO_ACTIVE_LOW>;
483 };
484 };
485
486 gpio-leds-hdd-21-1 {
487 status = "disabled";
488 compatible = "gpio-leds";
489 pinctrl-0 = <&pmx_hddled_21 &pmx_hddled_23>;
490 pinctrl-names = "default";
491
492 hdd1-green {
493 label = "synology:green:hdd1";
494 gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
495 };
496
497 hdd1-amber {
498 label = "synology:amber:hdd1";
499 gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
500 };
501 };
502
503 gpio-leds-hdd-21-2 {
504 status = "disabled";
505 compatible = "gpio-leds";
506 pinctrl-0 = <&pmx_hddled_21 &pmx_hddled_23 &pmx_hddled_20 &pmx_hddled_22>;
507 pinctrl-names = "default";
508
509 hdd1-green {
510 label = "synology:green:hdd1";
511 gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
512 };
513
514 hdd1-amber {
515 label = "synology:amber:hdd1";
516 gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
517 };
518
519 hdd2-green {
520 label = "synology:green:hdd2";
521 gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
522 };
523
524 hdd2-amber {
525 label = "synology:amber:hdd2";
526 gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
527 };
528 };
529
530 gpio-leds-hdd-36 {
531 status = "disabled";
532 compatible = "gpio-leds";
533 pinctrl-0 = <&pmx_hddled_36 &pmx_hddled_37 &pmx_hddled_38
534 &pmx_hddled_39 &pmx_hddled_40 &pmx_hddled_41
535 &pmx_hddled_42 &pmx_hddled_43 &pmx_hddled_44
536 &pmx_hddled_45>;
537 pinctrl-names = "default";
538
539 hdd1-green {
540 label = "synology:green:hdd1";
541 gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
542 };
543
544 hdd1-amber {
545 label = "synology:amber:hdd1";
546 gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
547 };
548
549 hdd2-green {
550 label = "synology:green:hdd2";
551 gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
552 };
553
554 hdd2-amber {
555 label = "synology:amber:hdd2";
556 gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
557 };
558
559 hdd3-green {
560 label = "synology:green:hdd3";
561 gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
562 };
563
564 hdd3-amber {
565 label = "synology:amber:hdd3";
566 gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
567 };
568
569 hdd4-green {
570 label = "synology:green:hdd4";
571 gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
572 };
573
574 hdd4-amber {
575 label = "synology:amber:hdd4";
576 gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
577 };
578
579 hdd5-green {
580 label = "synology:green:hdd5";
581 gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
582 };
583
584 hdd5-amber {
585 label = "synology:amber:hdd5";
586 gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
587 };
588 };
589
590 gpio-leds-hdd-38 {
591 status = "disabled";
592 compatible = "gpio-leds";
593 pinctrl-0 = <&pmx_hddled_38 &pmx_hddled_39 &pmx_hddled_36 &pmx_hddled_37>;
594 pinctrl-names = "default";
595
596 hdd1-green {
597 label = "synology:green:hdd1";
598 gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
599 };
600
601 hdd1-amber {
602 label = "synology:amber:hdd1";
603 gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
604 };
605
606 hdd2-green {
607 label = "synology:green:hdd2";
608 gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
609 };
610
611 hdd2-amber {
612 label = "synology:amber:hdd2";
613 gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
614 };
615 };
616
617 regulators-hdd-29 {
618 status = "disabled";
619 compatible = "simple-bus";
620 #address-cells = <1>;
621 #size-cells = <0>;
622 pinctrl-0 = <&pmx_hdd1_pwr_29 &pmx_hdd2_pwr_31>;
623 pinctrl-names = "default";
624
625 regulator@1 {
626 compatible = "regulator-fixed";
627 reg = <1>;
628 regulator-name = "hdd1power";
629 regulator-min-microvolt = <5000000>;
630 regulator-max-microvolt = <5000000>;
631 enable-active-high;
632 regulator-always-on;
633 regulator-boot-on;
634 startup-delay-us = <5000000>;
635 gpio = <&gpio0 29 GPIO_ACTIVE_HIGH>;
636 };
637
638 regulator@2 {
639 compatible = "regulator-fixed";
640 reg = <2>;
641 regulator-name = "hdd2power";
642 regulator-min-microvolt = <5000000>;
643 regulator-max-microvolt = <5000000>;
644 enable-active-high;
645 regulator-always-on;
646 regulator-boot-on;
647 startup-delay-us = <5000000>;
648 gpio = <&gpio0 31 GPIO_ACTIVE_HIGH>;
649 };
650 };
651
652 regulators-hdd-30-1 {
653 status = "disabled";
654 compatible = "simple-bus";
655 #address-cells = <1>;
656 #size-cells = <0>;
657 pinctrl-0 = <&pmx_hdd1_pwr_30>;
658 pinctrl-names = "default";
659
660 regulator@1 {
661 compatible = "regulator-fixed";
662 reg = <1>;
663 regulator-name = "hdd1power";
664 regulator-min-microvolt = <5000000>;
665 regulator-max-microvolt = <5000000>;
666 enable-active-high;
667 regulator-always-on;
668 regulator-boot-on;
669 startup-delay-us = <5000000>;
670 gpio = <&gpio0 30 GPIO_ACTIVE_HIGH>;
671 };
672 };
673
674 regulators-hdd-30-2 {
675 status = "disabled";
676 compatible = "simple-bus";
677 #address-cells = <1>;
678 #size-cells = <0>;
679 pinctrl-0 = <&pmx_hdd1_pwr_30 &pmx_hdd2_pwr_34>;
680 pinctrl-names = "default";
681
682 regulator@1 {
683 compatible = "regulator-fixed";
684 reg = <1>;
685 regulator-name = "hdd1power";
686 regulator-min-microvolt = <5000000>;
687 regulator-max-microvolt = <5000000>;
688 enable-active-high;
689 regulator-always-on;
690 regulator-boot-on;
691 startup-delay-us = <5000000>;
692 gpio = <&gpio0 30 GPIO_ACTIVE_HIGH>;
693 };
694
695 regulator@2 {
696 compatible = "regulator-fixed";
697 reg = <2>;
698 regulator-name = "hdd2power";
699 regulator-min-microvolt = <5000000>;
700 regulator-max-microvolt = <5000000>;
701 enable-active-high;
702 regulator-always-on;
703 regulator-boot-on;
704 startup-delay-us = <5000000>;
705 gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>;
706 };
707 };
708
709 regulators-hdd-30-4 {
710 status = "disabled";
711 compatible = "simple-bus";
712 #address-cells = <1>;
713 #size-cells = <0>;
714 pinctrl-0 = <&pmx_hdd1_pwr_30 &pmx_hdd2_pwr_34
715 &pmx_hdd3_pwr_44 &pmx_hdd4_pwr_45>;
716 pinctrl-names = "default";
717
718 regulator@1 {
719 compatible = "regulator-fixed";
720 reg = <1>;
721 regulator-name = "hdd1power";
722 regulator-min-microvolt = <5000000>;
723 regulator-max-microvolt = <5000000>;
724 enable-active-high;
725 regulator-always-on;
726 regulator-boot-on;
727 startup-delay-us = <5000000>;
728 gpio = <&gpio0 30 GPIO_ACTIVE_HIGH>;
729 };
730
731 regulator@2 {
732 compatible = "regulator-fixed";
733 reg = <2>;
734 regulator-name = "hdd2power";
735 regulator-min-microvolt = <5000000>;
736 regulator-max-microvolt = <5000000>;
737 enable-active-high;
738 regulator-always-on;
739 regulator-boot-on;
740 startup-delay-us = <5000000>;
741 gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>;
742 };
743
744 regulator@3 {
745 compatible = "regulator-fixed";
746 reg = <3>;
747 regulator-name = "hdd3power";
748 regulator-min-microvolt = <5000000>;
749 regulator-max-microvolt = <5000000>;
750 enable-active-high;
751 regulator-always-on;
752 regulator-boot-on;
753 startup-delay-us = <5000000>;
754 gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>;
755 };
756
757 regulator@4 {
758 compatible = "regulator-fixed";
759 reg = <4>;
760 regulator-name = "hdd4power";
761 regulator-min-microvolt = <5000000>;
762 regulator-max-microvolt = <5000000>;
763 enable-active-high;
764 regulator-always-on;
765 regulator-boot-on;
766 startup-delay-us = <5000000>;
767 gpio = <&gpio1 13 GPIO_ACTIVE_HIGH>;
768 };
769 };
770
771 regulators-hdd-31 {
772 status = "disabled";
773 compatible = "simple-bus";
774 #address-cells = <1>;
775 #size-cells = <0>;
776 pinctrl-0 = <&pmx_hdd2_pwr_31>;
777 pinctrl-names = "default";
778
779 regulator@1 {
780 compatible = "regulator-fixed";
781 reg = <1>;
782 regulator-name = "hdd2power";
783 regulator-min-microvolt = <5000000>;
784 regulator-max-microvolt = <5000000>;
785 enable-active-high;
786 regulator-always-on;
787 regulator-boot-on;
788 startup-delay-us = <5000000>;
789 gpio = <&gpio0 31 GPIO_ACTIVE_HIGH>;
790 };
791 };
792
793 regulators-hdd-34 {
794 status = "disabled";
795 compatible = "simple-bus";
796 #address-cells = <1>;
797 #size-cells = <0>;
798 pinctrl-0 = <&pmx_hdd2_pwr_34 &pmx_hdd3_pwr_44
799 &pmx_hdd4_pwr_45>;
800 pinctrl-names = "default";
801
802 regulator@2 {
803 compatible = "regulator-fixed";
804 reg = <2>;
805 regulator-name = "hdd2power";
806 regulator-min-microvolt = <5000000>;
807 regulator-max-microvolt = <5000000>;
808 enable-active-high;
809 regulator-always-on;
810 regulator-boot-on;
811 startup-delay-us = <5000000>;
812 gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>;
813 };
814
815 regulator@3 {
816 compatible = "regulator-fixed";
817 reg = <3>;
818 regulator-name = "hdd3power";
819 regulator-min-microvolt = <5000000>;
820 regulator-max-microvolt = <5000000>;
821 enable-active-high;
822 regulator-always-on;
823 regulator-boot-on;
824 startup-delay-us = <5000000>;
825 gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>;
826 };
827
828 regulator@4 {
829 compatible = "regulator-fixed";
830 reg = <4>;
831 regulator-name = "hdd4power";
832 regulator-min-microvolt = <5000000>;
833 regulator-max-microvolt = <5000000>;
834 enable-active-high;
835 regulator-always-on;
836 regulator-boot-on;
837 startup-delay-us = <5000000>;
838 gpio = <&gpio1 13 GPIO_ACTIVE_HIGH>;
839 };
840 };
841};
842
843&mdio {
844 status = "okay";
845
846 ethphy0: ethernet-phy@0 {
847 device_type = "ethernet-phy";
848 reg = <8>;
849 };
850
851 ethphy1: ethernet-phy@1 {
852 device_type = "ethernet-phy";
853 reg = <9>;
854 };
855};
856
857&eth0 {
858 status = "okay";
859
860 ethernet0-port@0 {
861 phy-handle = <&ethphy0>;
862 };
863};
864
865&eth1 {
866 status = "disabled";
867
868 ethernet1-port@0 {
869 phy-handle = <&ethphy1>;
870 };
871};
diff --git a/arch/arm/boot/dts/kirkwood-t5325.dts b/arch/arm/boot/dts/kirkwood-t5325.dts
new file mode 100644
index 000000000000..7d1c7677a18f
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-t5325.dts
@@ -0,0 +1,208 @@
1/*
2 * Device Tree file for HP t5325 Thin Client"
3 *
4 * Copyright (C) 2014
5 *
6 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
7 * Andrew Lunn <andrew@lunn.ch>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12*/
13
14/dts-v1/;
15
16#include "kirkwood.dtsi"
17#include "kirkwood-6281.dtsi"
18
19/ {
20 model = "HP t5325 Thin Client";
21 compatible = "hp,t5325", "marvell,kirkwood-88f6281", "marvell,kirkwood";
22
23 memory {
24 device_type = "memory";
25 reg = <0x00000000 0x20000000>;
26 };
27
28 chosen {
29 bootargs = "console=ttyS0,115200n8";
30 };
31
32 mbus {
33 pcie-controller {
34 status = "okay";
35
36 pcie@1,0 {
37 status = "okay";
38 };
39 };
40 };
41
42 ocp@f1000000 {
43 pinctrl: pinctrl@10000 {
44 pinctrl-0 = <&pmx_i2s &pmx_sysrst>;
45 pinctrl-names = "default";
46
47 pmx_button_power: pmx-button_power {
48 marvell,pins = "mpp45";
49 marvell,function = "gpio";
50 };
51
52 pmx_power_off: pmx-power-off {
53 marvell,pins = "mpp48";
54 marvell,function = "gpio";
55 };
56
57 pmx_led: pmx-led {
58 marvell,pins = "mpp21";
59 marvell,function = "gpio";
60 };
61
62 pmx_usb_sata_power_enable: pmx-usb-sata-power-enable {
63 marvell,pins = "mpp44";
64 marvell,function = "gpio";
65 };
66
67 /*
68 * Redefined from kirkwood-6281.dtsi, because
69 * we don't use SPI CS on MPP0, but on MPP7.
70 */
71 pmx_spi: pmx-spi {
72 marvell,pins = "mpp1", "mpp2", "mpp3", "mpp7";
73 marvell,function = "spi";
74 };
75
76 pmx_sysrst: pmx-sysrst {
77 marvell,pins = "mpp6";
78 marvell,function = "sysrst";
79 };
80
81 pmx_i2s: pmx-i2s {
82 marvell,pins = "mpp39", "mpp40", "mpp41", "mpp42",
83 "mpp43";
84 marvell,function = "audio";
85 };
86 };
87
88 spi@10600 {
89 pinctrl-0 = <&pmx_spi>;
90 pinctrl-names = "default";
91 status = "okay";
92
93 flash@0 {
94 #address-cells = <1>;
95 #size-cells = <1>;
96 compatible = "st,m25p80";
97 spi-max-frequency = <86000000>;
98 reg = <0>;
99 mode = <0>;
100
101 partition@0 {
102 reg = <0x0 0x80000>;
103 label = "u-boot";
104 };
105
106 partition@1 {
107 reg = <0x80000 0x40000>;
108 label = "SSD firmware";
109 };
110
111 partition@2 {
112 reg = <0xc0000 0x10000>;
113 label = "u-boot env";
114 };
115
116 partition@3 {
117 reg = <0xd0000 0x10000>;
118 label = "permanent u-boot env";
119 };
120
121 partition@4 {
122 reg = <0xd0000 0x10000>;
123 label = "permanent u-boot env";
124 };
125 };
126 };
127
128 i2c@11000 {
129 status = "okay";
130
131 alc5621: alc5621@1a {
132 compatible = "realtek,alc5621";
133 reg = <0x1a>;
134 };
135 };
136
137 serial@12000 {
138 status = "okay";
139 };
140
141 sata@80000 {
142 status = "okay";
143 nr-ports = <2>;
144 };
145
146 audio: audio-controller@a0000 {
147 status = "okay";
148 };
149 };
150
151 regulators {
152 compatible = "simple-bus";
153 #address-cells = <1>;
154 #size-cells = <0>;
155 pinctrl-0 = <&pmx_usb_sata_power_enable>;
156 pinctrl-names = "default";
157
158 usb_power: regulator@1 {
159 compatible = "regulator-fixed";
160 reg = <1>;
161 regulator-name = "USB-SATA Power";
162 regulator-min-microvolt = <5000000>;
163 regulator-max-microvolt = <5000000>;
164 enable-active-high;
165 regulator-always-on;
166 regulator-boot-on;
167 gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>;
168 };
169 };
170
171 gpio_keys {
172 compatible = "gpio-keys";
173 #address-cells = <1>;
174 #size-cells = <0>;
175 pinctrl-0 = <&pmx_button_power>;
176 pinctrl-names = "default";
177
178 button@1 {
179 label = "Power Button";
180 linux,code = <KEY_POWER>;
181 gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
182 };
183 };
184
185 gpio_poweroff {
186 compatible = "gpio-poweroff";
187 pinctrl-0 = <&pmx_power_off>;
188 pinctrl-names = "default";
189 gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
190 };
191
192};
193
194&mdio {
195 status = "okay";
196
197 ethphy0: ethernet-phy {
198 device_type = "ethernet-phy";
199 reg = <8>;
200 };
201};
202
203&eth0 {
204 status = "okay";
205 ethernet0-port@0 {
206 phy-handle = <&ethphy0>;
207 };
208};
diff --git a/arch/arm/boot/dts/kirkwood-ts419-6281.dts b/arch/arm/boot/dts/kirkwood-ts419-6281.dts
new file mode 100644
index 000000000000..aa22aa862857
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ts419-6281.dts
@@ -0,0 +1,20 @@
1/*
2 * Device Tree file for QNAP TS41X with 6281 SoC
3 *
4 * Copyright (C) 2013, Andrew Lunn <andrew@lunn.ch>
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/dts-v1/;
13
14#include "kirkwood.dtsi"
15#include "kirkwood-6281.dtsi"
16#include "kirkwood-ts219.dtsi"
17#include "kirkwood-ts419.dtsi"
18
19&ethphy0 { reg = <8>; };
20&ethphy1 { reg = <0>; };
diff --git a/arch/arm/boot/dts/kirkwood-ts419-6282.dts b/arch/arm/boot/dts/kirkwood-ts419-6282.dts
new file mode 100644
index 000000000000..d7512d4cdced
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ts419-6282.dts
@@ -0,0 +1,32 @@
1/*
2 * Device Tree file for QNAP TS41X with 6282 SoC
3 *
4 * Copyright (C) 2013, Andrew Lunn <andrew@lunn.ch>
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/dts-v1/;
13
14#include "kirkwood.dtsi"
15#include "kirkwood-6282.dtsi"
16#include "kirkwood-ts219.dtsi"
17#include "kirkwood-ts419.dtsi"
18
19/ {
20 mbus {
21 pcie-controller {
22 status = "okay";
23
24 pcie@2,0 {
25 status = "okay";
26 };
27 };
28 };
29};
30
31&ethphy0 { reg = <0>; };
32&ethphy1 { reg = <1>; };
diff --git a/arch/arm/boot/dts/kirkwood-ts419.dtsi b/arch/arm/boot/dts/kirkwood-ts419.dtsi
new file mode 100644
index 000000000000..1a9c624c7a92
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ts419.dtsi
@@ -0,0 +1,75 @@
1/*
2 * Device Tree include file for QNAP TS41X
3 *
4 * Copyright (C) 2013, Andrew Lunn <andrew@lunn.ch>
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/ {
13 model = "QNAP TS419 family";
14 compatible = "qnap,ts419", "marvell,kirkwood";
15
16 ocp@f1000000 {
17 pinctrl: pinctrl@10000 {
18 pinctrl-names = "default";
19
20 pmx_USB_copy_button: pmx-USB-copy-button {
21 marvell,pins = "mpp43";
22 marvell,function = "gpio";
23 };
24 pmx_reset_button: pmx-reset-button {
25 marvell,pins = "mpp37";
26 marvell,function = "gpio";
27 };
28 /*
29 * JP1 indicates if an LCD module is installed
30 * on the serial port (0), or if the port is used
31 * as a console (1).
32 */
33 pmx_jumper_jp1: pmx-jumper_jp1 {
34 marvell,pins = "mpp45";
35 marvell,function = "gpio";
36 };
37
38 };
39 };
40
41 gpio_keys {
42 compatible = "gpio-keys";
43 #address-cells = <1>;
44 #size-cells = <0>;
45 pinctrl-0 = <&pmx_reset_button &pmx_USB_copy_button>;
46 pinctrl-names = "default";
47
48 button@1 {
49 label = "USB Copy";
50 linux,code = <KEY_COPY>;
51 gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
52 };
53 button@2 {
54 label = "Reset";
55 linux,code = <KEY_RESTART>;
56 gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
57 };
58 };
59};
60
61&mdio {
62 status = "okay";
63
64 ethphy1: ethernet-phy@1 {
65 device_type = "ethernet-phy";
66 /* overwrite reg property in board file */
67 };
68};
69
70&eth1 {
71 status = "okay";
72 ethernet1-port@0 {
73 phy-handle = <&ethphy1>;
74 };
75};
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 6abf44d257df..90384587c278 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -24,6 +24,7 @@
24 aliases { 24 aliases {
25 gpio0 = &gpio0; 25 gpio0 = &gpio0;
26 gpio1 = &gpio1; 26 gpio1 = &gpio1;
27 i2c0 = &i2c0;
27 }; 28 };
28 29
29 mbus { 30 mbus {
@@ -111,7 +112,7 @@
111 clocks = <&gate_clk 7>; 112 clocks = <&gate_clk 7>;
112 }; 113 };
113 114
114 i2c@11000 { 115 i2c0: i2c@11000 {
115 compatible = "marvell,mv64xxx-i2c"; 116 compatible = "marvell,mv64xxx-i2c";
116 reg = <0x11000 0x20>; 117 reg = <0x11000 0x20>;
117 #address-cells = <1>; 118 #address-cells = <1>;
@@ -145,6 +146,11 @@
145 reg = <0x20000 0x80>, <0x1500 0x20>; 146 reg = <0x20000 0x80>, <0x1500 0x20>;
146 }; 147 };
147 148
149 system-controller@20000 {
150 compatible = "marvell,orion-system-controller";
151 reg = <0x20000 0x120>;
152 };
153
148 bridge_intc: bridge-interrupt-ctrl@20110 { 154 bridge_intc: bridge-interrupt-ctrl@20110 {
149 compatible = "marvell,orion-bridge-intc"; 155 compatible = "marvell,orion-bridge-intc";
150 interrupt-controller; 156 interrupt-controller;
@@ -161,6 +167,11 @@
161 #clock-cells = <1>; 167 #clock-cells = <1>;
162 }; 168 };
163 169
170 l2: l2-cache@20128 {
171 compatible = "marvell,kirkwood-cache";
172 reg = <0x20128 0x4>;
173 };
174
164 intc: main-interrupt-ctrl@20200 { 175 intc: main-interrupt-ctrl@20200 {
165 compatible = "marvell,orion-intc"; 176 compatible = "marvell,orion-intc";
166 interrupt-controller; 177 interrupt-controller;
@@ -178,7 +189,7 @@
178 189
179 wdt: watchdog-timer@20300 { 190 wdt: watchdog-timer@20300 {
180 compatible = "marvell,orion-wdt"; 191 compatible = "marvell,orion-wdt";
181 reg = <0x20300 0x28>; 192 reg = <0x20300 0x28>, <0x20108 0x4>;
182 interrupt-parent = <&bridge_intc>; 193 interrupt-parent = <&bridge_intc>;
183 interrupts = <3>; 194 interrupts = <3>;
184 clocks = <&gate_clk 7>; 195 clocks = <&gate_clk 7>;
@@ -300,5 +311,14 @@
300 #phy-cells = <0>; 311 #phy-cells = <0>;
301 status = "ok"; 312 status = "ok";
302 }; 313 };
314
315 audio0: audio-controller@a0000 {
316 compatible = "marvell,kirkwood-audio";
317 reg = <0xa0000 0x2210>;
318 interrupts = <24>;
319 clocks = <&gate_clk 9>;
320 clock-names = "internal";
321 status = "disabled";
322 };
303 }; 323 };
304}; 324};
diff --git a/arch/arm/boot/dts/marco.dtsi b/arch/arm/boot/dts/marco.dtsi
index 1579c3491ccd..0c9647d28765 100644
--- a/arch/arm/boot/dts/marco.dtsi
+++ b/arch/arm/boot/dts/marco.dtsi
@@ -58,9 +58,10 @@
58 #size-cells = <1>; 58 #size-cells = <1>;
59 ranges = <0xc2000000 0xc2000000 0x1000000>; 59 ranges = <0xc2000000 0xc2000000 0x1000000>;
60 60
61 reset-controller@c2000000 { 61 rstc: reset-controller@c2000000 {
62 compatible = "sirf,marco-rstc"; 62 compatible = "sirf,marco-rstc";
63 reg = <0xc2000000 0x10000>; 63 reg = <0xc2000000 0x10000>;
64 #reset-cells = <1>;
64 }; 65 };
65 }; 66 };
66 67
diff --git a/arch/arm/boot/dts/omap-gpmc-smsc9221.dtsi b/arch/arm/boot/dts/omap-gpmc-smsc9221.dtsi
new file mode 100644
index 000000000000..73e272fadc20
--- /dev/null
+++ b/arch/arm/boot/dts/omap-gpmc-smsc9221.dtsi
@@ -0,0 +1,58 @@
1/*
2 * Common file for GPMC connected smsc9221 on omaps
3 *
4 * Compared to smsc911x, smsc9221 (and others like smsc9217
5 * or smsc 9218) has faster timings, leading to higher
6 * bandwidth.
7 *
8 * Note that the board specifc DTS file needs to specify
9 * ranges, pinctrl, reg, interrupt parent and interrupts.
10 */
11
12/ {
13 vddvario: regulator-vddvario {
14 compatible = "regulator-fixed";
15 regulator-name = "vddvario";
16 regulator-always-on;
17 };
18
19 vdd33a: regulator-vdd33a {
20 compatible = "regulator-fixed";
21 regulator-name = "vdd33a";
22 regulator-always-on;
23 };
24};
25
26&gpmc {
27 ethernet@gpmc {
28 compatible = "smsc,lan9221","smsc,lan9115";
29 bank-width = <2>;
30
31 gpmc,mux-add-data;
32 gpmc,cs-on-ns = <0>;
33 gpmc,cs-rd-off-ns = <42>;
34 gpmc,cs-wr-off-ns = <36>;
35 gpmc,adv-on-ns = <6>;
36 gpmc,adv-rd-off-ns = <12>;
37 gpmc,adv-wr-off-ns = <12>;
38 gpmc,oe-on-ns = <0>;
39 gpmc,oe-off-ns = <42>;
40 gpmc,we-on-ns = <0>;
41 gpmc,we-off-ns = <36>;
42 gpmc,rd-cycle-ns = <60>;
43 gpmc,wr-cycle-ns = <54>;
44 gpmc,access-ns = <36>;
45 gpmc,page-burst-access-ns = <0>;
46 gpmc,bus-turnaround-ns = <0>;
47 gpmc,cycle2cycle-delay-ns = <0>;
48 gpmc,wr-data-mux-bus-ns = <18>;
49 gpmc,wr-access-ns = <42>;
50 gpmc,cycle2cycle-samecsen;
51 gpmc,cycle2cycle-diffcsen;
52
53 vddvario-supply = <&vddvario>;
54 vdd33a-supply = <&vdd33a>;
55 reg-io-width = <4>;
56 smsc,save-mac-address;
57 };
58};
diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi
index 5377ddf83bf8..22f35ea142c1 100644
--- a/arch/arm/boot/dts/omap2.dtsi
+++ b/arch/arm/boot/dts/omap2.dtsi
@@ -271,5 +271,36 @@
271 ti,hwmods = "timer12"; 271 ti,hwmods = "timer12";
272 ti,timer-pwm; 272 ti,timer-pwm;
273 }; 273 };
274
275 dss: dss@48050000 {
276 compatible = "ti,omap2-dss";
277 reg = <0x48050000 0x400>;
278 status = "disabled";
279 ti,hwmods = "dss_core";
280 #address-cells = <1>;
281 #size-cells = <1>;
282 ranges;
283
284 dispc@48050400 {
285 compatible = "ti,omap2-dispc";
286 reg = <0x48050400 0x400>;
287 interrupts = <25>;
288 ti,hwmods = "dss_dispc";
289 };
290
291 rfbi: encoder@48050800 {
292 compatible = "ti,omap2-rfbi";
293 reg = <0x48050800 0x400>;
294 status = "disabled";
295 ti,hwmods = "dss_rfbi";
296 };
297
298 venc: encoder@48050c00 {
299 compatible = "ti,omap2-venc";
300 reg = <0x48050c00 0x400>;
301 status = "disabled";
302 ti,hwmods = "dss_venc";
303 };
304 };
274 }; 305 };
275}; 306};
diff --git a/arch/arm/boot/dts/omap2420.dtsi b/arch/arm/boot/dts/omap2420.dtsi
index 60c605de22dd..85b1fb014c43 100644
--- a/arch/arm/boot/dts/omap2420.dtsi
+++ b/arch/arm/boot/dts/omap2420.dtsi
@@ -99,6 +99,7 @@
99 dmas = <&sdma 31>, 99 dmas = <&sdma 31>,
100 <&sdma 32>; 100 <&sdma 32>;
101 dma-names = "tx", "rx"; 101 dma-names = "tx", "rx";
102 status = "disabled";
102 }; 103 };
103 104
104 mcbsp2: mcbsp@48076000 { 105 mcbsp2: mcbsp@48076000 {
@@ -112,6 +113,7 @@
112 dmas = <&sdma 33>, 113 dmas = <&sdma 33>,
113 <&sdma 34>; 114 <&sdma 34>;
114 dma-names = "tx", "rx"; 115 dma-names = "tx", "rx";
116 status = "disabled";
115 }; 117 };
116 118
117 msdi1: mmc@4809c000 { 119 msdi1: mmc@4809c000 {
diff --git a/arch/arm/boot/dts/omap2430.dtsi b/arch/arm/boot/dts/omap2430.dtsi
index d624345666f5..d09697dab55e 100644
--- a/arch/arm/boot/dts/omap2430.dtsi
+++ b/arch/arm/boot/dts/omap2430.dtsi
@@ -29,6 +29,22 @@
29 pinctrl-single,function-mask = <0x3f>; 29 pinctrl-single,function-mask = <0x3f>;
30 }; 30 };
31 31
32 omap2_scm_general: tisyscon@49002270 {
33 compatible = "syscon";
34 reg = <0x49002270 0x240>;
35 };
36
37 pbias_regulator: pbias_regulator {
38 compatible = "ti,pbias-omap";
39 reg = <0x230 0x4>;
40 syscon = <&omap2_scm_general>;
41 pbias_mmc_reg: pbias_mmc_omap2430 {
42 regulator-name = "pbias_mmc_omap2430";
43 regulator-min-microvolt = <1800000>;
44 regulator-max-microvolt = <3000000>;
45 };
46 };
47
32 gpio1: gpio@4900c000 { 48 gpio1: gpio@4900c000 {
33 compatible = "ti,omap2-gpio"; 49 compatible = "ti,omap2-gpio";
34 reg = <0x4900c000 0x200>; 50 reg = <0x4900c000 0x200>;
@@ -113,6 +129,7 @@
113 dmas = <&sdma 31>, 129 dmas = <&sdma 31>,
114 <&sdma 32>; 130 <&sdma 32>;
115 dma-names = "tx", "rx"; 131 dma-names = "tx", "rx";
132 status = "disabled";
116 }; 133 };
117 134
118 mcbsp2: mcbsp@48076000 { 135 mcbsp2: mcbsp@48076000 {
@@ -128,6 +145,7 @@
128 dmas = <&sdma 33>, 145 dmas = <&sdma 33>,
129 <&sdma 34>; 146 <&sdma 34>;
130 dma-names = "tx", "rx"; 147 dma-names = "tx", "rx";
148 status = "disabled";
131 }; 149 };
132 150
133 mcbsp3: mcbsp@4808c000 { 151 mcbsp3: mcbsp@4808c000 {
@@ -143,6 +161,7 @@
143 dmas = <&sdma 17>, 161 dmas = <&sdma 17>,
144 <&sdma 18>; 162 <&sdma 18>;
145 dma-names = "tx", "rx"; 163 dma-names = "tx", "rx";
164 status = "disabled";
146 }; 165 };
147 166
148 mcbsp4: mcbsp@4808e000 { 167 mcbsp4: mcbsp@4808e000 {
@@ -158,6 +177,7 @@
158 dmas = <&sdma 19>, 177 dmas = <&sdma 19>,
159 <&sdma 20>; 178 <&sdma 20>;
160 dma-names = "tx", "rx"; 179 dma-names = "tx", "rx";
180 status = "disabled";
161 }; 181 };
162 182
163 mcbsp5: mcbsp@48096000 { 183 mcbsp5: mcbsp@48096000 {
@@ -173,6 +193,7 @@
173 dmas = <&sdma 21>, 193 dmas = <&sdma 21>,
174 <&sdma 22>; 194 <&sdma 22>;
175 dma-names = "tx", "rx"; 195 dma-names = "tx", "rx";
196 status = "disabled";
176 }; 197 };
177 198
178 mmc1: mmc@4809c000 { 199 mmc1: mmc@4809c000 {
@@ -183,6 +204,7 @@
183 ti,dual-volt; 204 ti,dual-volt;
184 dmas = <&sdma 61>, <&sdma 62>; 205 dmas = <&sdma 61>, <&sdma 62>;
185 dma-names = "tx", "rx"; 206 dma-names = "tx", "rx";
207 pbias-supply = <&pbias_mmc_reg>;
186 }; 208 };
187 209
188 mmc2: mmc@480b4000 { 210 mmc2: mmc@480b4000 {
diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts b/arch/arm/boot/dts/omap3-beagle-xm.dts
index 447e714d435b..cf0be662297e 100644
--- a/arch/arm/boot/dts/omap3-beagle-xm.dts
+++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
@@ -24,6 +24,11 @@
24 reg = <0x80000000 0x20000000>; /* 512 MB */ 24 reg = <0x80000000 0x20000000>; /* 512 MB */
25 }; 25 };
26 26
27 aliases {
28 display0 = &dvi0;
29 display1 = &tv0;
30 };
31
27 leds { 32 leds {
28 compatible = "gpio-leds"; 33 compatible = "gpio-leds";
29 34
@@ -86,6 +91,60 @@
86 reset-gpios = <&gpio5 19 GPIO_ACTIVE_LOW>; /* gpio_147 */ 91 reset-gpios = <&gpio5 19 GPIO_ACTIVE_LOW>; /* gpio_147 */
87 vcc-supply = <&hsusb2_power>; 92 vcc-supply = <&hsusb2_power>;
88 }; 93 };
94
95 tfp410: encoder@0 {
96 compatible = "ti,tfp410";
97 powerdown-gpios = <&twl_gpio 2 GPIO_ACTIVE_LOW>;
98
99 /* XXX pinctrl from twl */
100
101 ports {
102 #address-cells = <1>;
103 #size-cells = <0>;
104
105 port@0 {
106 reg = <0>;
107
108 tfp410_in: endpoint@0 {
109 remote-endpoint = <&dpi_out>;
110 };
111 };
112
113 port@1 {
114 reg = <1>;
115
116 tfp410_out: endpoint@0 {
117 remote-endpoint = <&dvi_connector_in>;
118 };
119 };
120 };
121 };
122
123 dvi0: connector@0 {
124 compatible = "dvi-connector";
125 label = "dvi";
126
127 digital;
128
129 ddc-i2c-bus = <&i2c3>;
130
131 port {
132 dvi_connector_in: endpoint {
133 remote-endpoint = <&tfp410_out>;
134 };
135 };
136 };
137
138 tv0: connector@1 {
139 compatible = "svideo-connector";
140 label = "tv";
141
142 port {
143 tv_connector_in: endpoint {
144 remote-endpoint = <&venc_out>;
145 };
146 };
147 };
89}; 148};
90 149
91&omap3_pmx_wkup { 150&omap3_pmx_wkup {
@@ -94,6 +153,17 @@
94 0x0e (PIN_INPUT | PIN_OFF_WAKEUPENABLE | MUX_MODE4) /* sys_boot2.gpio_4 */ 153 0x0e (PIN_INPUT | PIN_OFF_WAKEUPENABLE | MUX_MODE4) /* sys_boot2.gpio_4 */
95 >; 154 >;
96 }; 155 };
156
157 dss_dpi_pins2: pinmux_dss_dpi_pins1 {
158 pinctrl-single,pins = <
159 0x0a (PIN_OUTPUT | MUX_MODE3) /* sys_boot0.dss_data18 */
160 0x0c (PIN_OUTPUT | MUX_MODE3) /* sys_boot1.dss_data19 */
161 0x10 (PIN_OUTPUT | MUX_MODE3) /* sys_boot3.dss_data20 */
162 0x12 (PIN_OUTPUT | MUX_MODE3) /* sys_boot4.dss_data21 */
163 0x14 (PIN_OUTPUT | MUX_MODE3) /* sys_boot5.dss_data22 */
164 0x16 (PIN_OUTPUT | MUX_MODE3) /* sys_boot6.dss_data23 */
165 >;
166 };
97}; 167};
98 168
99&omap3_pmx_core { 169&omap3_pmx_core {
@@ -119,6 +189,35 @@
119 OMAP3_CORE1_IOPAD(0x21de, PIN_INPUT_PULLDOWN | MUX_MODE3) /* mcspi2_cs1.hsusb2_data3 */ 189 OMAP3_CORE1_IOPAD(0x21de, PIN_INPUT_PULLDOWN | MUX_MODE3) /* mcspi2_cs1.hsusb2_data3 */
120 >; 190 >;
121 }; 191 };
192
193 dss_dpi_pins1: pinmux_dss_dpi_pins2 {
194 pinctrl-single,pins = <
195 OMAP3_CORE1_IOPAD(0x20d4, PIN_OUTPUT | MUX_MODE0) /* dss_pclk.dss_pclk */
196 OMAP3_CORE1_IOPAD(0x20d6, PIN_OUTPUT | MUX_MODE0) /* dss_hsync.dss_hsync */
197 OMAP3_CORE1_IOPAD(0x20d8, PIN_OUTPUT | MUX_MODE0) /* dss_vsync.dss_vsync */
198 OMAP3_CORE1_IOPAD(0x20da, PIN_OUTPUT | MUX_MODE0) /* dss_acbias.dss_acbias */
199
200 OMAP3_CORE1_IOPAD(0x20e8, PIN_OUTPUT | MUX_MODE0) /* dss_data6.dss_data6 */
201 OMAP3_CORE1_IOPAD(0x20ea, PIN_OUTPUT | MUX_MODE0) /* dss_data7.dss_data7 */
202 OMAP3_CORE1_IOPAD(0x20ec, PIN_OUTPUT | MUX_MODE0) /* dss_data8.dss_data8 */
203 OMAP3_CORE1_IOPAD(0x20ee, PIN_OUTPUT | MUX_MODE0) /* dss_data9.dss_data9 */
204 OMAP3_CORE1_IOPAD(0x20f0, PIN_OUTPUT | MUX_MODE0) /* dss_data10.dss_data10 */
205 OMAP3_CORE1_IOPAD(0x20f2, PIN_OUTPUT | MUX_MODE0) /* dss_data11.dss_data11 */
206 OMAP3_CORE1_IOPAD(0x20f4, PIN_OUTPUT | MUX_MODE0) /* dss_data12.dss_data12 */
207 OMAP3_CORE1_IOPAD(0x20f6, PIN_OUTPUT | MUX_MODE0) /* dss_data13.dss_data13 */
208 OMAP3_CORE1_IOPAD(0x20f8, PIN_OUTPUT | MUX_MODE0) /* dss_data14.dss_data14 */
209 OMAP3_CORE1_IOPAD(0x20fa, PIN_OUTPUT | MUX_MODE0) /* dss_data15.dss_data15 */
210 OMAP3_CORE1_IOPAD(0x20fc, PIN_OUTPUT | MUX_MODE0) /* dss_data16.dss_data16 */
211 OMAP3_CORE1_IOPAD(0x20fe, PIN_OUTPUT | MUX_MODE0) /* dss_data17.dss_data17 */
212
213 OMAP3_CORE1_IOPAD(0x2100, PIN_OUTPUT | MUX_MODE3) /* dss_data18.dss_data0 */
214 OMAP3_CORE1_IOPAD(0x2102, PIN_OUTPUT | MUX_MODE3) /* dss_data19.dss_data1 */
215 OMAP3_CORE1_IOPAD(0x2104, PIN_OUTPUT | MUX_MODE3) /* dss_data20.dss_data2 */
216 OMAP3_CORE1_IOPAD(0x2106, PIN_OUTPUT | MUX_MODE3) /* dss_data21.dss_data3 */
217 OMAP3_CORE1_IOPAD(0x2108, PIN_OUTPUT | MUX_MODE3) /* dss_data22.dss_data4 */
218 OMAP3_CORE1_IOPAD(0x210a, PIN_OUTPUT | MUX_MODE3) /* dss_data23.dss_data5 */
219 >;
220 };
122}; 221};
123 222
124&omap3_pmx_core2 { 223&omap3_pmx_core2 {
@@ -164,15 +263,6 @@
164 263
165&i2c3 { 264&i2c3 {
166 clock-frequency = <100000>; 265 clock-frequency = <100000>;
167
168 /*
169 * Display monitor features are burnt in the EEPROM
170 * as EDID data.
171 */
172 eeprom@50 {
173 compatible = "ti,eeprom";
174 reg = <0x50>;
175 };
176}; 266};
177 267
178&mmc1 { 268&mmc1 {
@@ -234,3 +324,37 @@
234 regulator-max-microvolt = <1800000>; 324 regulator-max-microvolt = <1800000>;
235 regulator-always-on; 325 regulator-always-on;
236}; 326};
327
328&mcbsp2 {
329 status = "okay";
330};
331
332&dss {
333 status = "ok";
334
335 pinctrl-names = "default";
336 pinctrl-0 = <
337 &dss_dpi_pins1
338 &dss_dpi_pins2
339 >;
340
341 port {
342 dpi_out: endpoint {
343 remote-endpoint = <&tfp410_in>;
344 data-lines = <24>;
345 };
346 };
347};
348
349&venc {
350 status = "ok";
351
352 vdda-supply = <&vdac>;
353
354 port {
355 venc_out: endpoint {
356 remote-endpoint = <&tv_connector_in>;
357 ti,channels = <2>;
358 };
359 };
360};
diff --git a/arch/arm/boot/dts/omap3-beagle.dts b/arch/arm/boot/dts/omap3-beagle.dts
index 5053766d369b..3c3e6da1deac 100644
--- a/arch/arm/boot/dts/omap3-beagle.dts
+++ b/arch/arm/boot/dts/omap3-beagle.dts
@@ -24,6 +24,11 @@
24 reg = <0x80000000 0x10000000>; /* 256 MB */ 24 reg = <0x80000000 0x10000000>; /* 256 MB */
25 }; 25 };
26 26
27 aliases {
28 display0 = &dvi0;
29 display1 = &tv0;
30 };
31
27 leds { 32 leds {
28 compatible = "gpio-leds"; 33 compatible = "gpio-leds";
29 pmu_stat { 34 pmu_stat {
@@ -80,6 +85,61 @@
80 }; 85 };
81 86
82 }; 87 };
88
89 tfp410: encoder@0 {
90 compatible = "ti,tfp410";
91 powerdown-gpios = <&gpio6 10 GPIO_ACTIVE_LOW>; /* gpio_170 */
92
93 pinctrl-names = "default";
94 pinctrl-0 = <&tfp410_pins>;
95
96 ports {
97 #address-cells = <1>;
98 #size-cells = <0>;
99
100 port@0 {
101 reg = <0>;
102
103 tfp410_in: endpoint@0 {
104 remote-endpoint = <&dpi_out>;
105 };
106 };
107
108 port@1 {
109 reg = <1>;
110
111 tfp410_out: endpoint@0 {
112 remote-endpoint = <&dvi_connector_in>;
113 };
114 };
115 };
116 };
117
118 dvi0: connector@0 {
119 compatible = "dvi-connector";
120 label = "dvi";
121
122 digital;
123
124 ddc-i2c-bus = <&i2c3>;
125
126 port {
127 dvi_connector_in: endpoint {
128 remote-endpoint = <&tfp410_out>;
129 };
130 };
131 };
132
133 tv0: connector@1 {
134 compatible = "svideo-connector";
135 label = "tv";
136
137 port {
138 tv_connector_in: endpoint {
139 remote-endpoint = <&venc_out>;
140 };
141 };
142 };
83}; 143};
84 144
85&omap3_pmx_wkup { 145&omap3_pmx_wkup {
@@ -113,6 +173,45 @@
113 0x170 (PIN_OUTPUT | MUX_MODE0) /* uart3_tx_irtx.uart3_tx_irtx */ 173 0x170 (PIN_OUTPUT | MUX_MODE0) /* uart3_tx_irtx.uart3_tx_irtx */
114 >; 174 >;
115 }; 175 };
176
177 tfp410_pins: pinmux_tfp410_pins {
178 pinctrl-single,pins = <
179 0x194 (PIN_OUTPUT | MUX_MODE4) /* hdq_sio.gpio_170 */
180 >;
181 };
182
183 dss_dpi_pins: pinmux_dss_dpi_pins {
184 pinctrl-single,pins = <
185 0x0a4 (PIN_OUTPUT | MUX_MODE0) /* dss_pclk.dss_pclk */
186 0x0a6 (PIN_OUTPUT | MUX_MODE0) /* dss_hsync.dss_hsync */
187 0x0a8 (PIN_OUTPUT | MUX_MODE0) /* dss_vsync.dss_vsync */
188 0x0aa (PIN_OUTPUT | MUX_MODE0) /* dss_acbias.dss_acbias */
189 0x0ac (PIN_OUTPUT | MUX_MODE0) /* dss_data0.dss_data0 */
190 0x0ae (PIN_OUTPUT | MUX_MODE0) /* dss_data1.dss_data1 */
191 0x0b0 (PIN_OUTPUT | MUX_MODE0) /* dss_data2.dss_data2 */
192 0x0b2 (PIN_OUTPUT | MUX_MODE0) /* dss_data3.dss_data3 */
193 0x0b4 (PIN_OUTPUT | MUX_MODE0) /* dss_data4.dss_data4 */
194 0x0b6 (PIN_OUTPUT | MUX_MODE0) /* dss_data5.dss_data5 */
195 0x0b8 (PIN_OUTPUT | MUX_MODE0) /* dss_data6.dss_data6 */
196 0x0ba (PIN_OUTPUT | MUX_MODE0) /* dss_data7.dss_data7 */
197 0x0bc (PIN_OUTPUT | MUX_MODE0) /* dss_data8.dss_data8 */
198 0x0be (PIN_OUTPUT | MUX_MODE0) /* dss_data9.dss_data9 */
199 0x0c0 (PIN_OUTPUT | MUX_MODE0) /* dss_data10.dss_data10 */
200 0x0c2 (PIN_OUTPUT | MUX_MODE0) /* dss_data11.dss_data11 */
201 0x0c4 (PIN_OUTPUT | MUX_MODE0) /* dss_data12.dss_data12 */
202 0x0c6 (PIN_OUTPUT | MUX_MODE0) /* dss_data13.dss_data13 */
203 0x0c8 (PIN_OUTPUT | MUX_MODE0) /* dss_data14.dss_data14 */
204 0x0ca (PIN_OUTPUT | MUX_MODE0) /* dss_data15.dss_data15 */
205 0x0cc (PIN_OUTPUT | MUX_MODE0) /* dss_data16.dss_data16 */
206 0x0ce (PIN_OUTPUT | MUX_MODE0) /* dss_data17.dss_data17 */
207 0x0d0 (PIN_OUTPUT | MUX_MODE0) /* dss_data18.dss_data18 */
208 0x0d2 (PIN_OUTPUT | MUX_MODE0) /* dss_data19.dss_data19 */
209 0x0d4 (PIN_OUTPUT | MUX_MODE0) /* dss_data20.dss_data20 */
210 0x0d6 (PIN_OUTPUT | MUX_MODE0) /* dss_data21.dss_data21 */
211 0x0d8 (PIN_OUTPUT | MUX_MODE0) /* dss_data22.dss_data22 */
212 0x0da (PIN_OUTPUT | MUX_MODE0) /* dss_data23.dss_data23 */
213 >;
214 };
116}; 215};
117 216
118&omap3_pmx_core2 { 217&omap3_pmx_core2 {
@@ -152,6 +251,10 @@
152#include "twl4030.dtsi" 251#include "twl4030.dtsi"
153#include "twl4030_omap3.dtsi" 252#include "twl4030_omap3.dtsi"
154 253
254&i2c3 {
255 clock-frequency = <100000>;
256};
257
155&mmc1 { 258&mmc1 {
156 vmmc-supply = <&vmmc1>; 259 vmmc-supply = <&vmmc1>;
157 vmmc_aux-supply = <&vsim>; 260 vmmc_aux-supply = <&vsim>;
@@ -211,3 +314,39 @@
211 regulator-max-microvolt = <1800000>; 314 regulator-max-microvolt = <1800000>;
212 regulator-always-on; 315 regulator-always-on;
213}; 316};
317
318&mcbsp2 {
319 status = "okay";
320};
321
322/* Needed to power the DPI pins */
323&vpll2 {
324 regulator-always-on;
325};
326
327&dss {
328 status = "ok";
329
330 pinctrl-names = "default";
331 pinctrl-0 = <&dss_dpi_pins>;
332
333 port {
334 dpi_out: endpoint {
335 remote-endpoint = <&tfp410_in>;
336 data-lines = <24>;
337 };
338 };
339};
340
341&venc {
342 status = "ok";
343
344 vdda-supply = <&vdac>;
345
346 port {
347 venc_out: endpoint {
348 remote-endpoint = <&tv_connector_in>;
349 ti,channels = <2>;
350 };
351 };
352};
diff --git a/arch/arm/boot/dts/omap3-cm-t3517.dts b/arch/arm/boot/dts/omap3-cm-t3517.dts
new file mode 100644
index 000000000000..d00502f4fd9b
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-cm-t3517.dts
@@ -0,0 +1,136 @@
1/*
2 * Support for CompuLab CM-T3517
3 */
4/dts-v1/;
5
6#include "am3517.dtsi"
7#include "omap3-cm-t3x.dtsi"
8
9/ {
10 model = "CompuLab CM-T3517";
11 compatible = "compulab,omap3-cm-t3517", "ti,am3517", "ti,omap3";
12
13 vmmc: regulator-vmmc {
14 compatible = "regulator-fixed";
15 regulator-name = "vmmc";
16 regulator-min-microvolt = <3300000>;
17 regulator-max-microvolt = <3300000>;
18 };
19
20 wl12xx_vmmc2: wl12xx_vmmc2 {
21 compatible = "regulator-fixed";
22 regulator-name = "vw1271";
23 pinctrl-names = "default";
24 pinctrl-0 = <
25 &wl12xx_wkup_pins
26 &wl12xx_core_pins
27 >;
28 regulator-min-microvolt = <1800000>;
29 regulator-max-microvolt = <1800000>;
30 gpio = <&gpio1 6 GPIO_ACTIVE_HIGH >; /* gpio6 */
31 startup-delay-us = <20000>;
32 enable-active-high;
33 };
34
35 wl12xx_vaux2: wl12xx_vaux2 {
36 compatible = "regulator-fixed";
37 regulator-name = "vwl1271_vaux2";
38 regulator-min-microvolt = <1800000>;
39 regulator-max-microvolt = <1800000>;
40 };
41};
42
43&omap3_pmx_wkup {
44
45 wl12xx_wkup_pins: pinmux_wl12xx_wkup_pins {
46 pinctrl-single,pins = <
47 OMAP3_WKUP_IOPAD(0x2a0e, PIN_OUTPUT | MUX_MODE4) /* sys_boot2.gpio_4 */
48 OMAP3_WKUP_IOPAD(0x2a12, PIN_OUTPUT | MUX_MODE4) /* sys_boot4.gpio_6 */
49 >;
50 };
51};
52
53&omap3_pmx_core {
54
55 phy1_reset_pins: pinmux_hsusb1_phy_reset_pins {
56 pinctrl-single,pins = <
57 OMAP3_CORE1_IOPAD(0x2178, PIN_OUTPUT | MUX_MODE4) /* uart2_tx.gpio_146 */
58 >;
59 };
60
61 phy2_reset_pins: pinmux_hsusb2_phy_reset_pins {
62 pinctrl-single,pins = <
63 OMAP3_CORE1_IOPAD(0x217a, PIN_OUTPUT | MUX_MODE4) /* uart2_rx.gpio_147 */
64 >;
65 };
66
67 otg_drv_vbus: pinmux_otg_drv_vbus {
68 pinctrl-single,pins = <
69 OMAP3_CORE1_IOPAD(0x2210, PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii_50Mhz_clk.usb0_drvvbus */
70 >;
71 };
72
73 mmc2_pins: pinmux_mmc2_pins {
74 pinctrl-single,pins = <
75 OMAP3_CORE1_IOPAD(0x2158, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_clk.sdmmc2_clk */
76 OMAP3_CORE1_IOPAD(0x215a, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_cmd.sdmmc2_cmd */
77 OMAP3_CORE1_IOPAD(0x215c, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat0.sdmmc2_dat0 */
78 OMAP3_CORE1_IOPAD(0x215e, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat1.sdmmc2_dat1 */
79 OMAP3_CORE1_IOPAD(0x2160, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat2.sdmmc2_dat2 */
80 OMAP3_CORE1_IOPAD(0x2162, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat3.sdmmc2_dat3 */
81 >;
82 };
83
84 wl12xx_core_pins: pinmux_wl12xx_core_pins {
85 pinctrl-single,pins = <
86 OMAP3_CORE1_IOPAD(0x20b8, PIN_OUTPUT | MUX_MODE4) /* gpmc_ncs5.gpio_56 */
87 OMAP3_CORE1_IOPAD(0x2176, PIN_INPUT_PULLUP | MUX_MODE4) /* uart2_rts.gpio_145 */
88 >;
89 };
90
91 usb_hub_pins: pinmux_usb_hub_pins {
92 pinctrl-single,pins = <
93 OMAP3_CORE1_IOPAD(0x2184, PIN_OUTPUT | MUX_MODE4) /* mcbsp4_clkx.gpio_152 - USB HUB RST */
94 >;
95 };
96};
97
98&hsusb1_phy {
99 pinctrl-names = "default";
100 pinctrl-0 = <&phy1_reset_pins>;
101 reset-gpios = <&gpio5 18 GPIO_ACTIVE_LOW>;
102};
103
104&hsusb2_phy {
105 pinctrl-names = "default";
106 pinctrl-0 = <&phy2_reset_pins>;
107 reset-gpios = <&gpio5 19 GPIO_ACTIVE_LOW>;
108};
109
110&davinci_emac {
111 status = "okay";
112};
113
114&davinci_mdio {
115 status = "okay";
116};
117
118&am35x_otg_hs {
119 status = "okay";
120 pinctrl-names = "default";
121 pinctrl-0 = <&otg_drv_vbus>;
122};
123
124&mmc1 {
125 vmmc-supply = <&vmmc>;
126};
127
128&mmc2 {
129 pinctrl-names = "default";
130 pinctrl-0 = <&mmc2_pins>;
131 vmmc-supply = <&wl12xx_vmmc2>;
132 vmmc_aux-supply = <&wl12xx_vaux2>;
133 non-removable;
134 bus-width = <4>;
135 cap-power-off-card;
136};
diff --git a/arch/arm/boot/dts/omap3-cm-t3530.dts b/arch/arm/boot/dts/omap3-cm-t3530.dts
new file mode 100644
index 000000000000..d1458496520e
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-cm-t3530.dts
@@ -0,0 +1,48 @@
1/*
2 * Support for CompuLab CM-T3530
3 */
4/dts-v1/;
5
6#include "omap34xx.dtsi"
7#include "omap3-cm-t3x30.dtsi"
8
9/ {
10 model = "CompuLab CM-T3530";
11 compatible = "compulab,omap3-cm-t3530", "ti,omap34xx", "ti,omap3";
12
13 /* Regulator to trigger the reset signal of the Wifi module */
14 mmc2_sdio_reset: regulator-mmc2-sdio-reset {
15 compatible = "regulator-fixed";
16 regulator-name = "regulator-mmc2-sdio-reset";
17 regulator-min-microvolt = <3300000>;
18 regulator-max-microvolt = <3300000>;
19 gpio = <&twl_gpio 2 GPIO_ACTIVE_HIGH>;
20 enable-active-high;
21 };
22};
23
24&omap3_pmx_core {
25 mmc2_pins: pinmux_mmc2_pins {
26 pinctrl-single,pins = <
27 OMAP3_CORE1_IOPAD(0x2158, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_clk.sdmmc2_clk */
28 OMAP3_CORE1_IOPAD(0x215a, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_cmd.sdmmc2_cmd */
29 OMAP3_CORE1_IOPAD(0x215c, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat0.sdmmc2_dat0 */
30 OMAP3_CORE1_IOPAD(0x215e, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat1.sdmmc2_dat1 */
31 OMAP3_CORE1_IOPAD(0x2160, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat2.sdmmc2_dat2 */
32 OMAP3_CORE1_IOPAD(0x2162, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat3.sdmmc2_dat3 */
33 OMAP3_CORE1_IOPAD(0x2164, PIN_OUTPUT | MUX_MODE1) /* sdmmc2_dat4.sdmmc2_dir_dat0 */
34 OMAP3_CORE1_IOPAD(0x2166, PIN_OUTPUT | MUX_MODE1) /* sdmmc2_dat5.sdmmc2_dir_dat1 */
35 OMAP3_CORE1_IOPAD(0x2168, PIN_OUTPUT | MUX_MODE1) /* sdmmc2_dat6.sdmmc2_dir_cmd */
36 OMAP3_CORE1_IOPAD(0x216a, PIN_INPUT | MUX_MODE1) /* sdmmc2_dat7.sdmmc2_clkin */
37 >;
38 };
39};
40
41&mmc2 {
42 pinctrl-names = "default";
43 pinctrl-0 = <&mmc2_pins>;
44 vmmc-supply = <&mmc2_sdio_reset>;
45 non-removable;
46 bus-width = <4>;
47 cap-power-off-card;
48};
diff --git a/arch/arm/boot/dts/omap3-cm-t3730.dts b/arch/arm/boot/dts/omap3-cm-t3730.dts
index 486f4d6c4219..b3f9a50b3bc8 100644
--- a/arch/arm/boot/dts/omap3-cm-t3730.dts
+++ b/arch/arm/boot/dts/omap3-cm-t3730.dts
@@ -32,57 +32,26 @@
32}; 32};
33 33
34&omap3_pmx_core { 34&omap3_pmx_core {
35 mmc1_pins: pinmux_mmc1_pins {
36 pinctrl-single,pins = <
37 0x114 (PIN_OUTPUT_PULLUP | MUX_MODE0) /* sdmmc1_clk.sdmmc1_clk */
38 0x116 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_cmd.sdmmc1_cmd */
39 0x118 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat0.sdmmc1_dat0 */
40 0x11a (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat1.sdmmc1_dat1 */
41 0x11c (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat2.sdmmc1_dat2 */
42 0x11e (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat3.sdmmc1_dat3 */
43 >;
44 };
45 35
46 mmc2_pins: pinmux_mmc2_pins { 36 mmc2_pins: pinmux_mmc2_pins {
47 pinctrl-single,pins = < 37 pinctrl-single,pins = <
48 0x128 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_clk.sdmmc2_clk */ 38 OMAP3_CORE1_IOPAD(0x2158, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_clk.sdmmc2_clk */
49 0x12a (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_cmd.sdmmc2_cmd */ 39 OMAP3_CORE1_IOPAD(0x215a, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_cmd.sdmmc2_cmd */
50 0x12c (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat0.sdmmc2_dat0 */ 40 OMAP3_CORE1_IOPAD(0x215c, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat0.sdmmc2_dat0 */
51 0x12e (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat1.sdmmc2_dat1 */ 41 OMAP3_CORE1_IOPAD(0x215e, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat1.sdmmc2_dat1 */
52 0x130 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat2.sdmmc2_dat2 */ 42 OMAP3_CORE1_IOPAD(0x2160, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat2.sdmmc2_dat2 */
53 0x132 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat3.sdmmc2_dat3 */ 43 OMAP3_CORE1_IOPAD(0x2162, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat3.sdmmc2_dat3 */
54 >;
55 };
56
57 smsc1_pins: pinmux_smsc1_pins {
58 pinctrl-single,pins = <
59 0x88 (PIN_OUTPUT | MUX_MODE0) /* gpmc_ncs5.gpmc_ncs5 */
60 0x16a (PIN_INPUT_PULLUP | MUX_MODE4) /* uart3_cts_rctx.gpio_163 */
61 >;
62 };
63
64 uart3_pins: pinmux_uart3_pins {
65 pinctrl-single,pins = <
66 0x16e (PIN_INPUT | MUX_MODE0) /* uart3_rx_irrx.uart3_rx_irrx */
67 0x170 (PIN_OUTPUT | MUX_MODE0) /* uart3_tx_irtx.uart3_tx_irtx */
68 >; 44 >;
69 }; 45 };
70 46
71 wl12xx_gpio: pinmux_wl12xx_gpio { 47 wl12xx_gpio: pinmux_wl12xx_gpio {
72 pinctrl-single,pins = < 48 pinctrl-single,pins = <
73 0xb2 (PIN_OUTPUT | MUX_MODE4) /* dss_data3.gpio_73 */ 49 OMAP3_CORE1_IOPAD(0x20e2, PIN_OUTPUT | MUX_MODE4) /* dss_data3.gpio_73 */
74 0x134 (PIN_INPUT | MUX_MODE4) /* sdmmc2_dat4.gpio_136 */ 50 OMAP3_CORE1_IOPAD(0x2164, PIN_INPUT | MUX_MODE4) /* sdmmc2_dat4.gpio_136 */
75 >; 51 >;
76 }; 52 };
77}; 53};
78 54
79&mmc1 {
80 vmmc-supply = <&vmmc1>;
81 bus-width = <4>;
82 pinctrl-names = "default";
83 pinctrl-0 = <&mmc1_pins>;
84};
85
86&mmc2 { 55&mmc2 {
87 pinctrl-names = "default"; 56 pinctrl-names = "default";
88 pinctrl-0 = <&mmc2_pins>; 57 pinctrl-0 = <&mmc2_pins>;
@@ -92,13 +61,3 @@
92 bus-width = <4>; 61 bus-width = <4>;
93 cap-power-off-card; 62 cap-power-off-card;
94}; 63};
95
96&smsc1 {
97 pinctrl-names = "default";
98 pinctrl-0 = <&smsc1_pins>;
99};
100
101&uart3 {
102 pinctrl-names = "default";
103 pinctrl-0 = <&uart3_pins>;
104};
diff --git a/arch/arm/boot/dts/omap3-cm-t3x.dtsi b/arch/arm/boot/dts/omap3-cm-t3x.dtsi
new file mode 100644
index 000000000000..c671a2299ea8
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-cm-t3x.dtsi
@@ -0,0 +1,110 @@
1/*
2 * Common support for CompuLab CM-T3x CoMs
3 */
4
5/ {
6
7 memory {
8 device_type = "memory";
9 reg = <0x80000000 0x10000000>; /* 256 MB */
10 };
11
12 leds {
13 compatible = "gpio-leds";
14 pinctrl-names = "default";
15 pinctrl-0 = <&green_led_pins>;
16 ledb {
17 label = "cm-t3x:green";
18 gpios = <&gpio6 26 GPIO_ACTIVE_HIGH>; /* gpio186 */
19 linux,default-trigger = "heartbeat";
20 };
21 };
22
23 /* HS USB Port 1 Power */
24 hsusb1_power: hsusb1_power_reg {
25 compatible = "regulator-fixed";
26 regulator-name = "hsusb1_vbus";
27 regulator-min-microvolt = <3300000>;
28 regulator-max-microvolt = <3300000>;
29 startup-delay-us = <70000>;
30 };
31
32 /* HS USB Port 2 Power */
33 hsusb2_power: hsusb2_power_reg {
34 compatible = "regulator-fixed";
35 regulator-name = "hsusb2_vbus";
36 regulator-min-microvolt = <3300000>;
37 regulator-max-microvolt = <3300000>;
38 startup-delay-us = <70000>;
39 };
40
41 /* HS USB Host PHY on PORT 1 */
42 hsusb1_phy: hsusb1_phy {
43 compatible = "usb-nop-xceiv";
44 vcc-supply = <&hsusb1_power>;
45 };
46
47 /* HS USB Host PHY on PORT 2 */
48 hsusb2_phy: hsusb2_phy {
49 compatible = "usb-nop-xceiv";
50 vcc-supply = <&hsusb2_power>;
51 };
52};
53
54&omap3_pmx_core {
55
56 uart3_pins: pinmux_uart3_pins {
57 pinctrl-single,pins = <
58 OMAP3_CORE1_IOPAD(0x219e, PIN_INPUT | MUX_MODE0) /* uart3_rx_irrx.uart3_rx_irrx */
59 OMAP3_CORE1_IOPAD(0x21a0, PIN_OUTPUT | MUX_MODE0) /* uart3_tx_irtx.uart3_tx_irtx */
60 >;
61 };
62
63 mmc1_pins: pinmux_mmc1_pins {
64 pinctrl-single,pins = <
65 OMAP3_CORE1_IOPAD(0x2144, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_clk.sdmmc1_clk */
66 OMAP3_CORE1_IOPAD(0x2146, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_cmd.sdmmc1_cmd */
67 OMAP3_CORE1_IOPAD(0x2148, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat0.sdmmc1_dat0 */
68 OMAP3_CORE1_IOPAD(0x214a, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat1.sdmmc1_dat1 */
69 OMAP3_CORE1_IOPAD(0x214c, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat2.sdmmc1_dat2 */
70 OMAP3_CORE1_IOPAD(0x214e, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat3.sdmmc1_dat3 */
71 >;
72 };
73
74 green_led_pins: pinmux_green_led_pins {
75 pinctrl-single,pins = <
76 OMAP3_CORE1_IOPAD(0x21e2, PIN_OUTPUT | MUX_MODE4) /* sys_clkout2.gpio_186 */
77 >;
78 };
79};
80
81&uart3 {
82 pinctrl-names = "default";
83 pinctrl-0 = <&uart3_pins>;
84};
85
86&mmc1 {
87 pinctrl-names = "default";
88 pinctrl-0 = <&mmc1_pins>;
89 bus-width = <4>;
90};
91
92&mmc3 {
93 status = "disabled";
94};
95
96&i2c1 {
97 clock-frequency = <400000>;
98};
99
100&i2c3 {
101 clock-frequency = <400000>;
102};
103&usbhshost {
104 port1-mode = "ehci-phy";
105 port2-mode = "ehci-phy";
106};
107
108&usbhsehci {
109 phys = <&hsusb1_phy &hsusb2_phy>;
110};
diff --git a/arch/arm/boot/dts/omap3-cm-t3x30.dtsi b/arch/arm/boot/dts/omap3-cm-t3x30.dtsi
index 3a9f004d8924..d00055809e31 100644
--- a/arch/arm/boot/dts/omap3-cm-t3x30.dtsi
+++ b/arch/arm/boot/dts/omap3-cm-t3x30.dtsi
@@ -1,28 +1,16 @@
1/* 1/*
2 * Common support for CompuLab CM-T3530 and CM-T3730 2 * Common support for CompuLab CM-T3x30 CoMs
3 */ 3 */
4 4
5/ { 5#include "omap3-cm-t3x.dtsi"
6 memory {
7 device_type = "memory";
8 reg = <0x80000000 0x10000000>; /* 256 MB */
9 };
10 6
7/ {
11 cpus { 8 cpus {
12 cpu@0 { 9 cpu@0 {
13 cpu0-supply = <&vcc>; 10 cpu0-supply = <&vcc>;
14 }; 11 };
15 }; 12 };
16 13
17 leds {
18 compatible = "gpio-leds";
19 ledb {
20 label = "cm-t35:green";
21 gpios = <&gpio6 26 GPIO_ACTIVE_HIGH>; /* gpio186 */
22 linux,default-trigger = "heartbeat";
23 };
24 };
25
26 vddvario: regulator-vddvario { 14 vddvario: regulator-vddvario {
27 compatible = "regulator-fixed"; 15 compatible = "regulator-fixed";
28 regulator-name = "vddvario"; 16 regulator-name = "vddvario";
@@ -36,11 +24,40 @@
36 }; 24 };
37}; 25};
38 26
27&omap3_pmx_core {
28
29 smsc1_pins: pinmux_smsc1_pins {
30 pinctrl-single,pins = <
31 OMAP3_CORE1_IOPAD(0x20b8, PIN_OUTPUT | MUX_MODE0) /* gpmc_ncs5.gpmc_ncs5 */
32 OMAP3_CORE1_IOPAD(0x219a, PIN_INPUT_PULLUP | MUX_MODE4) /* uart3_cts_rctx.gpio_163 */
33 >;
34 };
35
36 hsusb0_pins: pinmux_hsusb0_pins {
37 pinctrl-single,pins = <
38 OMAP3_CORE1_IOPAD(0x21a0, PIN_OUTPUT | MUX_MODE0) /* hsusb0_clk.hsusb0_clk */
39 OMAP3_CORE1_IOPAD(0x21a2, PIN_OUTPUT | MUX_MODE0) /* hsusb0_stp.hsusb0_stp */
40 OMAP3_CORE1_IOPAD(0x21a4, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_dir.hsusb0_dir */
41 OMAP3_CORE1_IOPAD(0x21a6, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_nxt.hsusb0_nxt */
42 OMAP3_CORE1_IOPAD(0x21a8, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data0.hsusb2_data0 */
43 OMAP3_CORE1_IOPAD(0x21aa, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data1.hsusb0_data1 */
44 OMAP3_CORE1_IOPAD(0x21ac, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data2.hsusb0_data2 */
45 OMAP3_CORE1_IOPAD(0x21ae, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data7.hsusb0_data3 */
46 OMAP3_CORE1_IOPAD(0x21b0, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data7.hsusb0_data4 */
47 OMAP3_CORE1_IOPAD(0x21b2, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data7.hsusb0_data5 */
48 OMAP3_CORE1_IOPAD(0x21b4, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data7.hsusb0_data6 */
49 OMAP3_CORE1_IOPAD(0x21b6, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data7.hsusb0_data7 */
50 >;
51 };
52};
53
39&gpmc { 54&gpmc {
40 ranges = <5 0 0x2c000000 0x01000000>; 55 ranges = <5 0 0x2c000000 0x01000000>;
41 56
42 smsc1: ethernet@5,0 { 57 smsc1: ethernet@5,0 {
43 compatible = "smsc,lan9221", "smsc,lan9115"; 58 compatible = "smsc,lan9221", "smsc,lan9115";
59 pinctrl-names = "default";
60 pinctrl-0 = <&smsc1_pins>;
44 interrupt-parent = <&gpio6>; 61 interrupt-parent = <&gpio6>;
45 interrupts = <3 IRQ_TYPE_LEVEL_LOW>; 62 interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
46 reg = <5 0 0xff>; 63 reg = <5 0 0xff>;
@@ -74,8 +91,6 @@
74}; 91};
75 92
76&i2c1 { 93&i2c1 {
77 clock-frequency = <400000>;
78
79 twl: twl@48 { 94 twl: twl@48 {
80 reg = <0x48>; 95 reg = <0x48>;
81 interrupts = <7>; /* SYS_NIRQ cascaded to intc */ 96 interrupts = <7>; /* SYS_NIRQ cascaded to intc */
@@ -86,10 +101,31 @@
86#include "twl4030.dtsi" 101#include "twl4030.dtsi"
87#include "twl4030_omap3.dtsi" 102#include "twl4030_omap3.dtsi"
88 103
89&i2c3 { 104&mmc1 {
90 clock-frequency = <400000>; 105 vmmc-supply = <&vmmc1>;
91}; 106};
92 107
93&twl_gpio { 108&twl_gpio {
94 ti,use-leds; 109 ti,use-leds;
110 /* pullups: BIT(0) */
111 ti,pullups = <0x000001>;
112};
113
114&hsusb1_phy {
115 reset-gpios = <&twl_gpio 6 GPIO_ACTIVE_LOW>;
116};
117
118&hsusb2_phy {
119 reset-gpios = <&twl_gpio 7 GPIO_ACTIVE_LOW>;
120};
121
122&usb_otg_hs {
123 pinctrl-names = "default";
124 pinctrl-0 = <&hsusb0_pins>;
125 interface-type = <0>;
126 usb-phy = <&usb2_phy>;
127 phys = <&usb2_phy>;
128 phy-names = "usb2-phy";
129 mode = <3>;
130 power = <50>;
95}; 131};
diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts
index 4665421bb7bc..bf5a515a3247 100644
--- a/arch/arm/boot/dts/omap3-devkit8000.dts
+++ b/arch/arm/boot/dts/omap3-devkit8000.dts
@@ -101,20 +101,8 @@
101 status = "disabled"; 101 status = "disabled";
102}; 102};
103 103
104&mcbsp1 { 104&mcbsp2 {
105 status = "disabled"; 105 status = "okay";
106};
107
108&mcbsp3 {
109 status = "disabled";
110};
111
112&mcbsp4 {
113 status = "disabled";
114};
115
116&mcbsp5 {
117 status = "disabled";
118}; 106};
119 107
120&gpmc { 108&gpmc {
diff --git a/arch/arm/boot/dts/omap3-gta04.dts b/arch/arm/boot/dts/omap3-gta04.dts
index d3b253bbc885..f8ad125fa46f 100644
--- a/arch/arm/boot/dts/omap3-gta04.dts
+++ b/arch/arm/boot/dts/omap3-gta04.dts
@@ -36,6 +36,14 @@
36 gpio-key,wakeup; 36 gpio-key,wakeup;
37 }; 37 };
38 }; 38 };
39
40 sound {
41 compatible = "ti,omap-twl4030";
42 ti,model = "gta04";
43
44 ti,mcbsp = <&mcbsp2>;
45 ti,codec = <&twl_audio>;
46 };
39}; 47};
40 48
41&omap3_pmx_core { 49&omap3_pmx_core {
@@ -80,6 +88,12 @@
80 interrupts = <7>; /* SYS_NIRQ cascaded to intc */ 88 interrupts = <7>; /* SYS_NIRQ cascaded to intc */
81 interrupt-parent = <&intc>; 89 interrupt-parent = <&intc>;
82 }; 90 };
91
92 twl_audio: audio {
93 compatible = "ti,twl4030-audio";
94 codec {
95 };
96 };
83}; 97};
84 98
85#include "twl4030.dtsi" 99#include "twl4030.dtsi"
@@ -96,6 +110,14 @@
96 interrupts = <17 IRQ_TYPE_EDGE_RISING>; 110 interrupts = <17 IRQ_TYPE_EDGE_RISING>;
97 }; 111 };
98 112
113 /* accelerometer */
114 bma180@41 {
115 compatible = "bosch,bma180";
116 reg = <0x41>;
117 interrupt-parent = <&gpio3>;
118 interrupts = <19 IRQ_TYPE_LEVEL_HIGH>;
119 };
120
99 /* leds */ 121 /* leds */
100 tca6507@45 { 122 tca6507@45 {
101 compatible = "ti,tca6507"; 123 compatible = "ti,tca6507";
@@ -124,6 +146,22 @@
124 reg = <0x4>; 146 reg = <0x4>;
125 }; 147 };
126 }; 148 };
149
150 /* compass aka magnetometer */
151 hmc5843@1e {
152 compatible = "honeywell,hmc5843";
153 reg = <0x1e>;
154 };
155
156 /* touchscreen */
157 tsc2007@48 {
158 compatible = "ti,tsc2007";
159 reg = <0x48>;
160 interrupt-parent = <&gpio6>;
161 interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
162 gpios = <&gpio6 0 GPIO_ACTIVE_LOW>;
163 ti,x-plate-ohms = <600>;
164 };
127}; 165};
128 166
129&i2c3 { 167&i2c3 {
@@ -148,7 +186,9 @@
148}; 186};
149 187
150&mmc2 { 188&mmc2 {
151 status = "disabled"; 189 vmmc-supply = <&vaux4>;
190 bus-width = <4>;
191 ti,non-removable;
152}; 192};
153 193
154&mmc3 { 194&mmc3 {
@@ -170,3 +210,12 @@
170 pinctrl-0 = <&uart3_pins>; 210 pinctrl-0 = <&uart3_pins>;
171}; 211};
172 212
213&charger {
214 bb_uvolt = <3200000>;
215 bb_uamp = <150>;
216};
217
218&vaux4 {
219 regulator-min-microvolt = <2800000>;
220 regulator-max-microvolt = <3150000>;
221};
diff --git a/arch/arm/boot/dts/omap3-igep.dtsi b/arch/arm/boot/dts/omap3-igep.dtsi
index c17009323520..b97736d98a64 100644
--- a/arch/arm/boot/dts/omap3-igep.dtsi
+++ b/arch/arm/boot/dts/omap3-igep.dtsi
@@ -170,6 +170,7 @@
170&mcbsp2 { 170&mcbsp2 {
171 pinctrl-names = "default"; 171 pinctrl-names = "default";
172 pinctrl-0 = <&mcbsp2_pins>; 172 pinctrl-0 = <&mcbsp2_pins>;
173 status = "okay";
173}; 174};
174 175
175&mmc1 { 176&mmc1 {
diff --git a/arch/arm/boot/dts/omap3-igep0020.dts b/arch/arm/boot/dts/omap3-igep0020.dts
index f2779ac75872..7abd64f6ae21 100644
--- a/arch/arm/boot/dts/omap3-igep0020.dts
+++ b/arch/arm/boot/dts/omap3-igep0020.dts
@@ -61,22 +61,63 @@
61 reset-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>; /* gpio_24 */ 61 reset-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>; /* gpio_24 */
62 vcc-supply = <&hsusb1_power>; 62 vcc-supply = <&hsusb1_power>;
63 }; 63 };
64
65 tfp410: encoder@0 {
66 compatible = "ti,tfp410";
67 powerdown-gpios = <&gpio6 10 GPIO_ACTIVE_LOW>; /* gpio_170 */
68
69 ports {
70 #address-cells = <1>;
71 #size-cells = <0>;
72
73 port@0 {
74 reg = <0>;
75
76 tfp410_in: endpoint@0 {
77 remote-endpoint = <&dpi_out>;
78 };
79 };
80
81 port@1 {
82 reg = <1>;
83
84 tfp410_out: endpoint@0 {
85 remote-endpoint = <&dvi_connector_in>;
86 };
87 };
88 };
89 };
90
91 dvi0: connector@0 {
92 compatible = "dvi-connector";
93 label = "dvi";
94
95 digital;
96
97 ddc-i2c-bus = <&i2c3>;
98
99 port {
100 dvi_connector_in: endpoint {
101 remote-endpoint = <&tfp410_out>;
102 };
103 };
104 };
64}; 105};
65 106
66&omap3_pmx_core { 107&omap3_pmx_core {
67 pinctrl-names = "default"; 108 pinctrl-names = "default";
68 pinctrl-0 = < 109 pinctrl-0 = <
69 &tfp410_pins 110 &tfp410_pins
70 &dss_pins 111 &dss_dpi_pins
71 >; 112 >;
72 113
73 tfp410_pins: tfp410_dvi_pins { 114 tfp410_pins: pinmux_tfp410_pins {
74 pinctrl-single,pins = < 115 pinctrl-single,pins = <
75 0x196 (PIN_OUTPUT | MUX_MODE4) /* hdq_sio.gpio_170 */ 116 0x196 (PIN_OUTPUT | MUX_MODE4) /* hdq_sio.gpio_170 */
76 >; 117 >;
77 }; 118 };
78 119
79 dss_pins: pinmux_dss_dvi_pins { 120 dss_dpi_pins: pinmux_dss_dpi_pins {
80 pinctrl-single,pins = < 121 pinctrl-single,pins = <
81 0x0a4 (PIN_OUTPUT | MUX_MODE0) /* dss_pclk.dss_pclk */ 122 0x0a4 (PIN_OUTPUT | MUX_MODE0) /* dss_pclk.dss_pclk */
82 0x0a6 (PIN_OUTPUT | MUX_MODE0) /* dss_hsync.dss_hsync */ 123 0x0a6 (PIN_OUTPUT | MUX_MODE0) /* dss_hsync.dss_hsync */
@@ -226,3 +267,14 @@
226 /* Needed for DSS */ 267 /* Needed for DSS */
227 regulator-name = "vdds_dsi"; 268 regulator-name = "vdds_dsi";
228}; 269};
270
271&dss {
272 status = "ok";
273
274 port {
275 dpi_out: endpoint {
276 remote-endpoint = <&tfp410_in>;
277 data-lines = <24>;
278 };
279 };
280};
diff --git a/arch/arm/boot/dts/omap3-ldp.dts b/arch/arm/boot/dts/omap3-ldp.dts
index ddce0d807f70..0abe986a4ecc 100644
--- a/arch/arm/boot/dts/omap3-ldp.dts
+++ b/arch/arm/boot/dts/omap3-ldp.dts
@@ -174,8 +174,20 @@
174}; 174};
175 175
176&mmc1 { 176&mmc1 {
177 /* See 35xx errata 2.1.1.128 in SPRZ278F */
178 compatible = "ti,omap3-pre-es3-hsmmc";
177 vmmc-supply = <&vmmc1>; 179 vmmc-supply = <&vmmc1>;
178 bus-width = <4>; 180 bus-width = <4>;
181 pinctrl-names = "default";
182 pinctrl-0 = <&mmc1_pins>;
183};
184
185&mmc2 {
186 status="disabled";
187};
188
189&mmc3 {
190 status="disabled";
179}; 191};
180 192
181&omap3_pmx_core { 193&omap3_pmx_core {
@@ -209,6 +221,17 @@
209 0x174 (PIN_OUTPUT | MUX_MODE0) /* hsusb0_stp.hsusb0_stp */ 221 0x174 (PIN_OUTPUT | MUX_MODE0) /* hsusb0_stp.hsusb0_stp */
210 >; 222 >;
211 }; 223 };
224
225 mmc1_pins: pinmux_mmc1_pins {
226 pinctrl-single,pins = <
227 OMAP3_CORE1_IOPAD(0x2144, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_clk.mmc1_clk */
228 OMAP3_CORE1_IOPAD(0x2146, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_cmd.mmc1_cmd */
229 OMAP3_CORE1_IOPAD(0x2148, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat0.mmc1_dat0 */
230 OMAP3_CORE1_IOPAD(0x214A, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat1.mmc1_dat1 */
231 OMAP3_CORE1_IOPAD(0x214C, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat2.mmc1_dat2 */
232 OMAP3_CORE1_IOPAD(0x214e, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat3.mmc1_dat3 */
233 >;
234 };
212}; 235};
213 236
214&usb_otg_hs { 237&usb_otg_hs {
diff --git a/arch/arm/boot/dts/omap3-lilly-a83x.dtsi b/arch/arm/boot/dts/omap3-lilly-a83x.dtsi
new file mode 100644
index 000000000000..6369d9f43ca2
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-lilly-a83x.dtsi
@@ -0,0 +1,459 @@
1/*
2 * Copyright (C) 2014 Christoph Fritz <chf.fritzc@googlemail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 */
9
10#include "omap36xx.dtsi"
11
12/ {
13 model = "INCOstartec LILLY-A83X module (DM3730)";
14 compatible = "incostartec,omap3-lilly-a83x", "ti,omap36xx", "ti,omap3";
15
16 chosen {
17 bootargs = "console=ttyO0,115200n8 vt.global_cursor_default=0 consoleblank=0";
18 };
19
20 memory {
21 device_type = "memory";
22 reg = <0x80000000 0x8000000>; /* 128 MB */
23 };
24
25 leds {
26 compatible = "gpio-leds";
27
28 led1 {
29 label = "lilly-a83x::led1";
30 gpios = <&gpio1 29 GPIO_ACTIVE_LOW>;
31 linux,default-trigger = "default-on";
32 };
33
34 };
35
36 sound {
37 compatible = "ti,omap-twl4030";
38 ti,model = "lilly-a83x";
39
40 ti,mcbsp = <&mcbsp2>;
41 ti,codec = <&twl_audio>;
42 };
43
44 reg_vcc3: vcc3 {
45 compatible = "regulator-fixed";
46 regulator-name = "VCC3";
47 regulator-min-microvolt = <3300000>;
48 regulator-max-microvolt = <3300000>;
49 regulator-always-on;
50 };
51
52 hsusb1_phy: hsusb1_phy {
53 compatible = "usb-nop-xceiv";
54 vcc-supply = <&reg_vcc3>;
55 };
56};
57
58&omap3_pmx_wkup {
59 pinctrl-names = "default";
60
61 lan9221_pins: pinmux_lan9221_pins {
62 pinctrl-single,pins = <
63 OMAP3_WKUP_IOPAD(0x2a5a, PIN_INPUT | MUX_MODE4) /* reserved.gpio_129 */
64 >;
65 };
66
67 tsc2048_pins: pinmux_tsc2048_pins {
68 pinctrl-single,pins = <
69 OMAP3_WKUP_IOPAD(0x2a16, PIN_INPUT_PULLUP | MUX_MODE4) /* sys_boot6.gpio_8 */
70 >;
71 };
72
73 mmc1cd_pins: pinmux_mmc1cd_pins {
74 pinctrl-single,pins = <
75 OMAP3_WKUP_IOPAD(0x2a56, PIN_INPUT | MUX_MODE4) /* reserved.gpio_126 */
76 >;
77 };
78};
79
80&omap3_pmx_core {
81 pinctrl-names = "default";
82
83 uart1_pins: pinmux_uart1_pins {
84 pinctrl-single,pins = <
85 OMAP3_CORE1_IOPAD(0x217c, PIN_OUTPUT | MUX_MODE0) /* uart1_tx.uart1_tx */
86 OMAP3_CORE1_IOPAD(0x217e, PIN_OUTPUT | MUX_MODE0) /* uart1_rts.uart1_rts */
87 OMAP3_CORE1_IOPAD(0x2180, PIN_INPUT | MUX_MODE0) /* uart1_cts.uart1_cts */
88 OMAP3_CORE1_IOPAD(0x2182, PIN_INPUT | MUX_MODE0) /* uart1_rx.uart1_rx */
89 >;
90 };
91
92 uart2_pins: pinmux_uart2_pins {
93 pinctrl-single,pins = <
94 OMAP3_CORE1_IOPAD(0x2170, PIN_OUTPUT | MUX_MODE1) /* mcbsp3_clkx.uart2_tx */
95 OMAP3_CORE1_IOPAD(0x2172, PIN_INPUT | MUX_MODE1) /* mcbsp3_fsx.uart2_rx */
96 >;
97 };
98
99 uart3_pins: pinmux_uart3_pins {
100 pinctrl-single,pins = <
101 OMAP3_CORE1_IOPAD(0x219e, PIN_INPUT | MUX_MODE0) /* uart3_rx_irrx.uart3_rx_irrx */
102 OMAP3_CORE1_IOPAD(0x21a0, PIN_OUTPUT | MUX_MODE0) /* uart3_tx_irtx.uart3_tx_irtx */
103 >;
104 };
105
106 i2c1_pins: pinmux_i2c1_pins {
107 pinctrl-single,pins = <
108 OMAP3_CORE1_IOPAD(0x21ba ,PIN_INPUT_PULLUP | MUX_MODE0) /* i2c1_scl.i2c1_scl */
109 OMAP3_CORE1_IOPAD(0x21bc ,PIN_INPUT_PULLUP | MUX_MODE0) /* i2c1_sda.i2c1_sda */
110 >;
111 };
112
113 i2c2_pins: pinmux_i2c2_pins {
114 pinctrl-single,pins = <
115 OMAP3_CORE1_IOPAD(0x21be, PIN_INPUT | MUX_MODE0) /* i2c2_scl.i2c2_scl */
116 OMAP3_CORE1_IOPAD(0x21c0, PIN_INPUT | MUX_MODE0) /* i2c2_sda.i2c2_sda */
117 >;
118 };
119
120 i2c3_pins: pinmux_i2c3_pins {
121 pinctrl-single,pins = <
122 OMAP3_CORE1_IOPAD(0x21c2, PIN_INPUT | MUX_MODE0) /* i2c3_scl.i2c3_scl */
123 OMAP3_CORE1_IOPAD(0x21c4, PIN_INPUT | MUX_MODE0) /* i2c3_sda.i2c3_sda */
124 >;
125 };
126
127 hsusb1_pins: pinmux_hsusb1_pins {
128 pinctrl-single,pins = <
129
130 /* GPIO 182 controls USB-Hub reset. But USB-Phy its
131 * reset can't be controlled. So we clamp this GPIO to
132 * high (PIN_OFF_OUTPUT_HIGH) to always enable USB-Hub.
133 */
134
135 OMAP3_CORE1_IOPAD(0x21de, PIN_OUTPUT_PULLUP | PIN_OFF_OUTPUT_HIGH | MUX_MODE4) /* mcspi2_cs1.gpio_182 */
136 >;
137 };
138
139 hsusb_otg_pins: pinmux_hsusb_otg_pins {
140 pinctrl-single,pins = <
141 OMAP3_CORE1_IOPAD(0x21a2, PIN_INPUT | MUX_MODE0) /* hsusb0_clk.hsusb0_clk */
142 OMAP3_CORE1_IOPAD(0x21a4, PIN_OUTPUT | MUX_MODE0) /* hsusb0_stp.hsusb0_stp */
143 OMAP3_CORE1_IOPAD(0x21a6, PIN_INPUT | MUX_MODE0) /* hsusb0_dir.hsusb0_dir */
144 OMAP3_CORE1_IOPAD(0x21a8, PIN_INPUT | MUX_MODE0) /* hsusb0_nxt.hsusb0_nxt */
145 OMAP3_CORE1_IOPAD(0x21aa, PIN_INPUT | MUX_MODE0) /* hsusb0_data0.hsusb0_data0 */
146 OMAP3_CORE1_IOPAD(0x21ac, PIN_INPUT | MUX_MODE0) /* hsusb0_data1.hsusb0_data1 */
147 OMAP3_CORE1_IOPAD(0x21ae, PIN_INPUT | MUX_MODE0) /* hsusb0_data2.hsusb0_data2 */
148 OMAP3_CORE1_IOPAD(0x21b0, PIN_INPUT | MUX_MODE0) /* hsusb0_data3.hsusb0_data3 */
149 OMAP3_CORE1_IOPAD(0x21b2, PIN_INPUT | MUX_MODE0) /* hsusb0_data4.hsusb0_data4 */
150 OMAP3_CORE1_IOPAD(0x21b4, PIN_INPUT | MUX_MODE0) /* hsusb0_data5.hsusb0_data5 */
151 OMAP3_CORE1_IOPAD(0x21b6, PIN_INPUT | MUX_MODE0) /* hsusb0_data6.hsusb0_data6 */
152 OMAP3_CORE1_IOPAD(0x21b8, PIN_INPUT | MUX_MODE0) /* hsusb0_data7.hsusb0_data7 */
153 >;
154 };
155
156 mmc1_pins: pinmux_mmc1_pins {
157 pinctrl-single,pins = <
158 OMAP3_CORE1_IOPAD(0x2144, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_clk.sdmmc1_clk */
159 OMAP3_CORE1_IOPAD(0x2146, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_cmd.sdmmc1_cmd */
160 OMAP3_CORE1_IOPAD(0x2148, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat0.sdmmc1_dat0 */
161 OMAP3_CORE1_IOPAD(0x214a, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat1.sdmmc1_dat1 */
162 OMAP3_CORE1_IOPAD(0x214c, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat2.sdmmc1_dat2 */
163 OMAP3_CORE1_IOPAD(0x214e, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat3.sdmmc1_dat3 */
164 >;
165 };
166
167 spi2_pins: pinmux_spi2_pins {
168 pinctrl-single,pins = <
169 OMAP3_CORE1_IOPAD(0x21d6, PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcspi2_clk.mcspi2_clk */
170 OMAP3_CORE1_IOPAD(0x21d8, PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcspi2_simo.mcspi2_simo */
171 OMAP3_CORE1_IOPAD(0x21da, PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcspi2_somi.mcspi2_somi */
172 OMAP3_CORE1_IOPAD(0x21dc, PIN_OUTPUT | MUX_MODE0) /* mcspi2_cs0.mcspi2_cs0 */
173 >;
174 };
175};
176
177&omap3_pmx_core2 {
178 pinctrl-names = "default";
179 pinctrl-0 = <
180 &hsusb1_2_pins
181 >;
182
183 hsusb1_2_pins: pinmux_hsusb1_2_pins {
184 pinctrl-single,pins = <
185 OMAP3630_CORE2_IOPAD(0x25d8, PIN_OUTPUT | MUX_MODE3) /* etk_clk.hsusb1_stp */
186 OMAP3630_CORE2_IOPAD(0x25da, PIN_INPUT | MUX_MODE3) /* etk_ctl.hsusb1_clk */
187 OMAP3630_CORE2_IOPAD(0x25dc, PIN_INPUT | MUX_MODE3) /* etk_d0.hsusb1_data0 */
188 OMAP3630_CORE2_IOPAD(0x25de, PIN_INPUT | MUX_MODE3) /* etk_d1.hsusb1_data1 */
189 OMAP3630_CORE2_IOPAD(0x25e0, PIN_INPUT | MUX_MODE3) /* etk_d2.hsusb1_data2 */
190 OMAP3630_CORE2_IOPAD(0x25e2, PIN_INPUT | MUX_MODE3) /* etk_d3.hsusb1_data7 */
191 OMAP3630_CORE2_IOPAD(0x25e4, PIN_INPUT | MUX_MODE3) /* etk_d4.hsusb1_data4 */
192 OMAP3630_CORE2_IOPAD(0x25e6, PIN_INPUT | MUX_MODE3) /* etk_d5.hsusb1_data5 */
193 OMAP3630_CORE2_IOPAD(0x25e8, PIN_INPUT | MUX_MODE3) /* etk_d6.hsusb1_data6 */
194 OMAP3630_CORE2_IOPAD(0x25ea, PIN_INPUT | MUX_MODE3) /* etk_d7.hsusb1_data3 */
195 OMAP3630_CORE2_IOPAD(0x25ec, PIN_INPUT | MUX_MODE3) /* etk_d8.hsusb1_dir */
196 OMAP3630_CORE2_IOPAD(0x25ee, PIN_INPUT | MUX_MODE3) /* etk_d9.hsusb1_nxt */
197 >;
198 };
199
200 gpio1_pins: pinmux_gpio1_pins {
201 pinctrl-single,pins = <
202 OMAP3630_CORE2_IOPAD(0x25fa, PIN_OUTPUT_PULLDOWN | MUX_MODE4) /* etk_d15.gpio_29 */
203 >;
204 };
205
206};
207
208&gpio1 {
209 pinctrl-names = "default";
210 pinctrl-0 = <&gpio1_pins>;
211};
212
213&gpio6 {
214 pinctrl-names = "default";
215 pinctrl-0 = <&hsusb1_pins>;
216};
217
218&i2c1 {
219 clock-frequency = <2600000>;
220 pinctrl-names = "default";
221 pinctrl-0 = <&i2c1_pins>;
222
223 twl: twl@48 {
224 reg = <0x48>;
225 interrupts = <7>; /* SYS_NIRQ cascaded to intc */
226 interrupt-parent = <&intc>;
227
228 twl_audio: audio {
229 compatible = "ti,twl4030-audio";
230 codec {
231 };
232 };
233 };
234};
235
236#include "twl4030.dtsi"
237#include "twl4030_omap3.dtsi"
238
239&twl {
240 vmmc1: regulator-vmmc1 {
241 regulator-always-on;
242 };
243
244 vdd1: regulator-vdd1 {
245 regulator-always-on;
246 };
247
248 vdd2: regulator-vdd2 {
249 regulator-always-on;
250 };
251};
252
253&i2c2 {
254 clock-frequency = <2600000>;
255 pinctrl-names = "default";
256 pinctrl-0 = <&i2c2_pins>;
257};
258
259&i2c3 {
260 clock-frequency = <2600000>;
261 pinctrl-names = "default";
262 pinctrl-0 = <&i2c3_pins>;
263 gpiom1: gpio@20 {
264 compatible = "mcp,mcp23017";
265 gpio-controller;
266 #gpio-cells = <2>;
267 reg = <0x20>;
268 };
269};
270
271&uart1 {
272 pinctrl-names = "default";
273 pinctrl-0 = <&uart1_pins>;
274};
275
276&uart2 {
277 pinctrl-names = "default";
278 pinctrl-0 = <&uart2_pins>;
279};
280
281&uart3 {
282 pinctrl-names = "default";
283 pinctrl-0 = <&uart3_pins>;
284};
285
286&uart4 {
287 status = "disabled";
288};
289
290&mmc1 {
291 cd-gpios = <&gpio4 30 IRQ_TYPE_LEVEL_LOW>;
292 cd-inverted;
293 vmmc-supply = <&vmmc1>;
294 bus-width = <4>;
295 pinctrl-names = "default";
296 pinctrl-0 = <&mmc1_pins &mmc1cd_pins>;
297 cap-sdio-irq;
298 cap-sd-highspeed;
299 cap-mmc-highspeed;
300};
301
302&mmc2 {
303 status = "disabled";
304};
305
306&mmc3 {
307 status = "disabled";
308};
309
310&mcspi2 {
311 status = "okay";
312 pinctrl-names = "default";
313 pinctrl-0 = <&spi2_pins>;
314
315 tsc2046@0 {
316 reg = <0>; /* CS0 */
317 compatible = "ti,tsc2046";
318 interrupt-parent = <&gpio1>;
319 interrupts = <8 0>; /* boot6 / gpio_8 */
320 spi-max-frequency = <1000000>;
321 pendown-gpio = <&gpio1 8 0>;
322 vcc-supply = <&reg_vcc3>;
323 pinctrl-names = "default";
324 pinctrl-0 = <&tsc2048_pins>;
325
326 ti,x-min = <300>;
327 ti,x-max = <3000>;
328 ti,y-min = <600>;
329 ti,y-max = <3600>;
330 ti,x-plate-ohms = <80>;
331 ti,pressure-max = <255>;
332 ti,swap-xy;
333
334 linux,wakeup;
335 };
336};
337
338&usbhsehci {
339 phys = <&hsusb1_phy>;
340};
341
342&usbhshost {
343 pinctrl-names = "default";
344 pinctrl-0 = <&hsusb1_2_pins>;
345 num-ports = <2>;
346 port1-mode = "ehci-phy";
347};
348
349&usb_otg_hs {
350 pinctrl-names = "default";
351 pinctrl-0 = <&hsusb_otg_pins>;
352 interface-type = <0>;
353 usb-phy = <&usb2_phy>;
354 phys = <&usb2_phy>;
355 phy-names = "usb2-phy";
356 mode = <3>;
357 power = <50>;
358};
359
360&gpmc {
361 ranges = <0 0 0x30000000 0x1000000>,
362 <7 0 0x15000000 0x01000000>;
363
364 nand@0,0 {
365 reg = <0 0 0x1000000>;
366 nand-bus-width = <16>;
367 ti,nand-ecc-opt = "bch8";
368 /* no elm on omap3 */
369
370 gpmc,mux-add-data = <0>;
371 gpmc,device-nand;
372 gpmc,device-width = <2>;
373 gpmc,wait-pin = <0>;
374 gpmc,wait-monitoring-ns = <0>;
375 gpmc,burst-length= <4>;
376 gpmc,cs-on-ns = <0>;
377 gpmc,cs-rd-off-ns = <100>;
378 gpmc,cs-wr-off-ns = <100>;
379 gpmc,adv-on-ns = <0>;
380 gpmc,adv-rd-off-ns = <100>;
381 gpmc,adv-wr-off-ns = <100>;
382 gpmc,oe-on-ns = <5>;
383 gpmc,oe-off-ns = <75>;
384 gpmc,we-on-ns = <5>;
385 gpmc,we-off-ns = <75>;
386 gpmc,rd-cycle-ns = <100>;
387 gpmc,wr-cycle-ns = <100>;
388 gpmc,access-ns = <60>;
389 gpmc,page-burst-access-ns = <5>;
390 gpmc,bus-turnaround-ns = <0>;
391 gpmc,cycle2cycle-samecsen;
392 gpmc,cycle2cycle-delay-ns = <50>;
393 gpmc,wr-data-mux-bus-ns = <75>;
394 gpmc,wr-access-ns = <155>;
395
396 #address-cells = <1>;
397 #size-cells = <1>;
398
399 partition@0 {
400 label = "MLO";
401 reg = <0 0x80000>;
402 };
403
404 partition@0x80000 {
405 label = "u-boot";
406 reg = <0x80000 0x1e0000>;
407 };
408
409 partition@0x260000 {
410 label = "u-boot-environment";
411 reg = <0x260000 0x20000>;
412 };
413
414 partition@0x280000 {
415 label = "kernel";
416 reg = <0x280000 0x500000>;
417 };
418
419 partition@0x780000 {
420 label = "filesystem";
421 reg = <0x780000 0xf880000>;
422 };
423 };
424
425 ethernet@7,0 {
426 compatible = "smsc,lan9221", "smsc,lan9115";
427 bank-width = <2>;
428 gpmc,mux-add-data = <2>;
429 gpmc,cs-on-ns = <10>;
430 gpmc,cs-rd-off-ns = <60>;
431 gpmc,cs-wr-off-ns = <60>;
432 gpmc,adv-on-ns = <0>;
433 gpmc,adv-rd-off-ns = <10>;
434 gpmc,adv-wr-off-ns = <10>;
435 gpmc,oe-on-ns = <10>;
436 gpmc,oe-off-ns = <60>;
437 gpmc,we-on-ns = <10>;
438 gpmc,we-off-ns = <60>;
439 gpmc,rd-cycle-ns = <100>;
440 gpmc,wr-cycle-ns = <100>;
441 gpmc,access-ns = <50>;
442 gpmc,page-burst-access-ns = <5>;
443 gpmc,bus-turnaround-ns = <0>;
444 gpmc,cycle2cycle-delay-ns = <75>;
445 gpmc,wr-data-mux-bus-ns = <15>;
446 gpmc,wr-access-ns = <75>;
447 gpmc,cycle2cycle-samecsen;
448 gpmc,cycle2cycle-diffcsen;
449 vddvario-supply = <&reg_vcc3>;
450 vdd33a-supply = <&reg_vcc3>;
451 reg-io-width = <4>;
452 interrupt-parent = <&gpio5>;
453 interrupts = <1 0x2>;
454 reg = <7 0 0xff>;
455 pinctrl-names = "default";
456 pinctrl-0 = <&lan9221_pins>;
457 phy-mode = "mii";
458 };
459};
diff --git a/arch/arm/boot/dts/omap3-lilly-dbb056.dts b/arch/arm/boot/dts/omap3-lilly-dbb056.dts
new file mode 100644
index 000000000000..834f7c65f62d
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-lilly-dbb056.dts
@@ -0,0 +1,170 @@
1/*
2 * Copyright (C) 2014 Christoph Fritz <chf.fritzc@googlemail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 */
9/dts-v1/;
10
11#include "omap3-lilly-a83x.dtsi"
12
13/ {
14 model = "INCOstartec LILLY-DBB056 (DM3730)";
15 compatible = "incostartec,omap3-lilly-dbb056", "incostartec,omap3-lilly-a83x", "ti,omap36xx", "ti,omap3";
16};
17
18&twl {
19 vaux2: regulator-vaux2 {
20 compatible = "ti,twl4030-vaux2";
21 regulator-min-microvolt = <2800000>;
22 regulator-max-microvolt = <2800000>;
23 regulator-always-on;
24 };
25};
26
27&omap3_pmx_core {
28 pinctrl-names = "default";
29 pinctrl-0 = <&lcd_pins>;
30
31 lan9117_pins: pinmux_lan9117_pins {
32 pinctrl-single,pins = <
33 OMAP3_CORE1_IOPAD(0x2114, PIN_INPUT | MUX_MODE4) /* cam_fld.gpio_98 */
34 >;
35 };
36
37 gpio4_pins: pinmux_gpio4_pins {
38 pinctrl-single,pins = <
39 OMAP3_CORE1_IOPAD(0x212e, PIN_INPUT | MUX_MODE4) /* cam_xclkb.gpio_111 -> sja1000 IRQ */
40 >;
41 };
42
43 gpio5_pins: pinmux_gpio5_pins {
44 pinctrl-single,pins = <
45 OMAP3_CORE1_IOPAD(0x218c, PIN_OUTPUT | PIN_OFF_OUTPUT_HIGH | MUX_MODE4) /* mcbsp1_clk.gpio_156 -> enable DSS */
46 >;
47 };
48
49 lcd_pins: pinmux_lcd_pins {
50 pinctrl-single,pins = <
51 OMAP3_CORE1_IOPAD(0x20d4, PIN_OUTPUT | MUX_MODE0) /* dss_pclk.dss_pclk */
52 OMAP3_CORE1_IOPAD(0x20d6, PIN_OUTPUT | MUX_MODE0) /* dss_hsync.dss_hsync */
53 OMAP3_CORE1_IOPAD(0x20d8, PIN_OUTPUT | MUX_MODE0) /* dss_vsync.dss_vsync */
54 OMAP3_CORE1_IOPAD(0x20da, PIN_OUTPUT | MUX_MODE0) /* dss_acbias.dss_acbias */
55 OMAP3_CORE1_IOPAD(0x20dc, PIN_OUTPUT | MUX_MODE0) /* dss_data0.dss_data0 */
56 OMAP3_CORE1_IOPAD(0x20de, PIN_OUTPUT | MUX_MODE0) /* dss_data1.dss_data1 */
57 OMAP3_CORE1_IOPAD(0x20e0, PIN_OUTPUT | MUX_MODE0) /* dss_data2.dss_data2 */
58 OMAP3_CORE1_IOPAD(0x20e2, PIN_OUTPUT | MUX_MODE0) /* dss_data3.dss_data3 */
59 OMAP3_CORE1_IOPAD(0x20e4, PIN_OUTPUT | MUX_MODE0) /* dss_data4.dss_data4 */
60 OMAP3_CORE1_IOPAD(0x20e6, PIN_OUTPUT | MUX_MODE0) /* dss_data5.dss_data5 */
61 OMAP3_CORE1_IOPAD(0x20e8, PIN_OUTPUT | MUX_MODE0) /* dss_data6.dss_data6 */
62 OMAP3_CORE1_IOPAD(0x20ea, PIN_OUTPUT | MUX_MODE0) /* dss_data7.dss_data7 */
63 OMAP3_CORE1_IOPAD(0x20ec, PIN_OUTPUT | MUX_MODE0) /* dss_data8.dss_data8 */
64 OMAP3_CORE1_IOPAD(0x20ee, PIN_OUTPUT | MUX_MODE0) /* dss_data9.dss_data9 */
65 OMAP3_CORE1_IOPAD(0x20f0, PIN_OUTPUT | MUX_MODE0) /* dss_data10.dss_data10 */
66 OMAP3_CORE1_IOPAD(0x20f2, PIN_OUTPUT | MUX_MODE0) /* dss_data11.dss_data11 */
67 OMAP3_CORE1_IOPAD(0x20f4, PIN_OUTPUT | MUX_MODE0) /* dss_data12.dss_data12 */
68 OMAP3_CORE1_IOPAD(0x20f6, PIN_OUTPUT | MUX_MODE0) /* dss_data13.dss_data13 */
69 OMAP3_CORE1_IOPAD(0x20f8, PIN_OUTPUT | MUX_MODE0) /* dss_data14.dss_data14 */
70 OMAP3_CORE1_IOPAD(0x20fa, PIN_OUTPUT | MUX_MODE0) /* dss_data15.dss_data15 */
71 OMAP3_CORE1_IOPAD(0x20fc, PIN_OUTPUT | MUX_MODE0) /* dss_data16.dss_data16 */
72 OMAP3_CORE1_IOPAD(0x20fe, PIN_OUTPUT | MUX_MODE0) /* dss_data17.dss_data17 */
73 >;
74 };
75
76 mmc2_pins: pinmux_mmc2_pins {
77 pinctrl-single,pins = <
78 OMAP3_CORE1_IOPAD(0x2158, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_clk.sdmmc2_clk */
79 OMAP3_CORE1_IOPAD(0x215a, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_cmd.sdmmc2_cmd */
80 OMAP3_CORE1_IOPAD(0x215c, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat0.sdmmc2_dat0 */
81 OMAP3_CORE1_IOPAD(0x215e, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat1.sdmmc2_dat1 */
82 OMAP3_CORE1_IOPAD(0x2160, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat2.sdmmc2_dat2 */
83 OMAP3_CORE1_IOPAD(0x2162, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat3.sdmmc2_dat3 */
84 OMAP3_CORE1_IOPAD(0x2164, PIN_OUTPUT | MUX_MODE1) /* sdmmc2_dat4.sdmmc2_dir_dat0 */
85 OMAP3_CORE1_IOPAD(0x2166, PIN_OUTPUT | MUX_MODE1) /* sdmmc2_dat5.sdmmc2_dir_dat1 */
86 OMAP3_CORE1_IOPAD(0x2168, PIN_OUTPUT | MUX_MODE1) /* sdmmc2_dat6.sdmmc2_dir_cmd */
87 OMAP3_CORE1_IOPAD(0x216a, PIN_INPUT | MUX_MODE1) /* sdmmc2_dat7.sdmmc2_clkin */
88 OMAP3_CORE1_IOPAD(0x219a, PIN_INPUT_PULLUP | MUX_MODE4) /* uart3_cts_rctx.gpio_163 -> wp */
89 OMAP3_CORE1_IOPAD(0x219c, PIN_INPUT_PULLUP | MUX_MODE4) /* uart3_rts_sd.gpio_164 -> cd */
90 >;
91 };
92
93 spi1_pins: pinmux_spi1_pins {
94 pinctrl-single,pins = <
95 OMAP3_CORE1_IOPAD(0x21c8, PIN_INPUT | MUX_MODE0) /* mcspi1_clk.mcspi1_clk */
96 OMAP3_CORE1_IOPAD(0x21ca, PIN_INPUT | MUX_MODE0) /* mcspi1_simo.mcspi1_simo */
97 OMAP3_CORE1_IOPAD(0x21cc, PIN_INPUT | MUX_MODE0) /* mcspi1_somi.mcspi1_somi */
98 OMAP3_CORE1_IOPAD(0x21ce, PIN_INPUT_PULLDOWN | MUX_MODE0) /* mcspi1_cs0.mcspi1_cs0 */
99 >;
100 };
101};
102
103&gpio4 {
104 pinctrl-names = "default";
105 pinctrl-0 = <&gpio4_pins>;
106};
107
108&gpio5 {
109 pinctrl-names = "default";
110 pinctrl-0 = <&gpio5_pins>;
111};
112
113&mmc2 {
114 status = "okay";
115 bus-width = <4>;
116 vmmc-supply = <&vmmc1>;
117 cd-gpios = <&gpio6 4 0>; /* gpio_164 */
118 wp-gpios = <&gpio6 3 0>; /* gpio_163 */
119 pinctrl-names = "default";
120 pinctrl-0 = <&mmc2_pins>;
121 ti,dual-volt;
122};
123
124&mcspi1 {
125 status = "okay";
126 pinctrl-names = "default";
127 pinctrl-0 = <&spi1_pins>;
128};
129
130&gpmc {
131 ranges = <0 0 0x30000000 0x1000000>, /* nand assigned by COM a83x */
132 <4 0 0x20000000 0x01000000>,
133 <7 0 0x15000000 0x01000000>; /* eth assigend by COM a83x */
134
135 ethernet@4,0 {
136 compatible = "smsc,lan9117", "smsc,lan9115";
137 bank-width = <2>;
138 gpmc,mux-add-data = <2>;
139 gpmc,cs-on-ns = <10>;
140 gpmc,cs-rd-off-ns = <65>;
141 gpmc,cs-wr-off-ns = <65>;
142 gpmc,adv-on-ns = <0>;
143 gpmc,adv-rd-off-ns = <10>;
144 gpmc,adv-wr-off-ns = <10>;
145 gpmc,oe-on-ns = <10>;
146 gpmc,oe-off-ns = <65>;
147 gpmc,we-on-ns = <10>;
148 gpmc,we-off-ns = <65>;
149 gpmc,rd-cycle-ns = <100>;
150 gpmc,wr-cycle-ns = <100>;
151 gpmc,access-ns = <60>;
152 gpmc,page-burst-access-ns = <5>;
153 gpmc,bus-turnaround-ns = <0>;
154 gpmc,cycle2cycle-delay-ns = <75>;
155 gpmc,wr-data-mux-bus-ns = <15>;
156 gpmc,wr-access-ns = <75>;
157 gpmc,cycle2cycle-samecsen;
158 gpmc,cycle2cycle-diffcsen;
159 vddvario-supply = <&reg_vcc3>;
160 vdd33a-supply = <&reg_vcc3>;
161 reg-io-width = <4>;
162 interrupt-parent = <&gpio4>;
163 interrupts = <2 0x2>;
164 reg = <4 0 0xff>;
165 pinctrl-names = "default";
166 pinctrl-0 = <&lan9117_pins>;
167 phy-mode = "mii";
168 smsc,force-internal-phy;
169 };
170};
diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index 0bf40c90faba..1a57b61f5e24 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -74,6 +74,22 @@
74 }; 74 };
75 }; 75 };
76 76
77 isp1704: isp1704 {
78 compatible = "nxp,isp1704";
79 nxp,enable-gpio = <&gpio3 3 GPIO_ACTIVE_HIGH>;
80 usb-phy = <&usb2_phy>;
81 };
82
83 tv: connector {
84 compatible = "composite-connector";
85 label = "tv";
86
87 port {
88 tv_connector_in: endpoint {
89 remote-endpoint = <&venc_out>;
90 };
91 };
92 };
77}; 93};
78 94
79&omap3_pmx_core { 95&omap3_pmx_core {
@@ -140,11 +156,23 @@
140 >; 156 >;
141 }; 157 };
142 158
143 display_pins: pinmux_display_pins { 159 acx565akm_pins: pinmux_acx565akm_pins {
144 pinctrl-single,pins = < 160 pinctrl-single,pins = <
145 0x0d4 (PIN_OUTPUT | MUX_MODE4) /* RX51_LCD_RESET_GPIO */ 161 0x0d4 (PIN_OUTPUT | MUX_MODE4) /* RX51_LCD_RESET_GPIO */
146 >; 162 >;
147 }; 163 };
164
165 dss_sdi_pins: pinmux_dss_sdi_pins {
166 pinctrl-single,pins = <
167 0x0c0 (PIN_OUTPUT | MUX_MODE1) /* dss_data10.sdi_dat1n */
168 0x0c2 (PIN_OUTPUT | MUX_MODE1) /* dss_data11.sdi_dat1p */
169 0x0c4 (PIN_OUTPUT | MUX_MODE1) /* dss_data12.sdi_dat2n */
170 0x0c6 (PIN_OUTPUT | MUX_MODE1) /* dss_data13.sdi_dat2p */
171
172 0x0d8 (PIN_OUTPUT | MUX_MODE1) /* dss_data22.sdi_clkp */
173 0x0da (PIN_OUTPUT | MUX_MODE1) /* dss_data23.sdi_clkn */
174 >;
175 };
148}; 176};
149 177
150&i2c1 { 178&i2c1 {
@@ -254,6 +282,61 @@
254 }; 282 };
255}; 283};
256 284
285&twl_keypad {
286 linux,keymap = < 0x00000010 /* KEY_Q */
287 0x00010018 /* KEY_O */
288 0x00020019 /* KEY_P */
289 0x00030033 /* KEY_COMMA */
290 0x0004000e /* KEY_BACKSPACE */
291 0x0006001e /* KEY_A */
292 0x0007001f /* KEY_S */
293
294 0x01000011 /* KEY_W */
295 0x01010020 /* KEY_D */
296 0x01020021 /* KEY_F */
297 0x01030022 /* KEY_G */
298 0x01040023 /* KEY_H */
299 0x01050024 /* KEY_J */
300 0x01060025 /* KEY_K */
301 0x01070026 /* KEY_L */
302
303 0x02000012 /* KEY_E */
304 0x02010034 /* KEY_DOT */
305 0x02020067 /* KEY_UP */
306 0x0203001c /* KEY_ENTER */
307 0x0205002c /* KEY_Z */
308 0x0206002d /* KEY_X */
309 0x0207002e /* KEY_C */
310 0x02080043 /* KEY_F9 */
311
312 0x03000013 /* KEY_R */
313 0x0301002f /* KEY_V */
314 0x03020030 /* KEY_B */
315 0x03030031 /* KEY_N */
316 0x03040032 /* KEY_M */
317 0x03050039 /* KEY_SPACE */
318 0x03060039 /* KEY_SPACE */
319 0x03070069 /* KEY_LEFT */
320
321 0x04000014 /* KEY_T */
322 0x0401006c /* KEY_DOWN */
323 0x0402006a /* KEY_RIGHT */
324 0x0404001d /* KEY_LEFTCTRL */
325 0x04050064 /* KEY_RIGHTALT */
326 0x0406002a /* KEY_LEFTSHIFT */
327 0x04080044 /* KEY_F10 */
328
329 0x05000015 /* KEY_Y */
330 0x05080057 /* KEY_F11 */
331
332 0x06000016 /* KEY_U */
333
334 0x07000017 /* KEY_I */
335 0x07010041 /* KEY_F7 */
336 0x07020042 /* KEY_F8 */
337 >;
338};
339
257&twl_gpio { 340&twl_gpio {
258 ti,pullups = <0x0>; 341 ti,pullups = <0x0>;
259 ti,pulldowns = <0x03ff3f>; /* BIT(0..5) | BIT(8..17) */ 342 ti,pulldowns = <0x03ff3f>; /* BIT(0..5) | BIT(8..17) */
@@ -291,6 +374,13 @@
291 DVDD-supply = <&vio>; 374 DVDD-supply = <&vio>;
292 }; 375 };
293 376
377 tsl2563: tsl2563@29 {
378 compatible = "amstaos,tsl2563";
379 reg = <0x29>;
380
381 amstaos,cover-comp-gain = <16>;
382 };
383
294 lp5523: lp5523@32 { 384 lp5523: lp5523@32 {
295 compatible = "national,lp5523"; 385 compatible = "national,lp5523";
296 reg = <0x32>; 386 reg = <0x32>;
@@ -356,6 +446,29 @@
356 compatible = "ti,bq27200"; 446 compatible = "ti,bq27200";
357 reg = <0x55>; 447 reg = <0x55>;
358 }; 448 };
449
450 tpa6130a2: tpa6130a2@60 {
451 compatible = "ti,tpa6130a2";
452 reg = <0x60>;
453
454 Vdd-supply = <&vmmc2>;
455
456 power-gpio = <&gpio4 2 GPIO_ACTIVE_HIGH>; /* 98 */
457 };
458
459 bq24150a: bq24150a@6b {
460 compatible = "ti,bq24150a";
461 reg = <0x6b>;
462
463 ti,current-limit = <100>;
464 ti,weak-battery-voltage = <3400>;
465 ti,battery-regulation-voltage = <4200>;
466 ti,charge-current = <650>;
467 ti,termination-current = <100>;
468 ti,resistor-sense = <68>;
469
470 ti,usb-charger-detection = <&isp1704>;
471 };
359}; 472};
360 473
361&i2c3 { 474&i2c3 {
@@ -471,13 +584,23 @@
471 spi-max-frequency = <6000000>; 584 spi-max-frequency = <6000000>;
472 reg = <0>; 585 reg = <0>;
473 }; 586 };
474 mipid@2 { 587
475 compatible = "acx565akm"; 588 acx565akm@2 {
589 compatible = "sony,acx565akm";
476 spi-max-frequency = <6000000>; 590 spi-max-frequency = <6000000>;
477 reg = <2>; 591 reg = <2>;
478 592
479 pinctrl-names = "default"; 593 pinctrl-names = "default";
480 pinctrl-0 = <&display_pins>; 594 pinctrl-0 = <&acx565akm_pins>;
595
596 label = "lcd";
597 reset-gpios = <&gpio3 26 GPIO_ACTIVE_HIGH>; /* 90 */
598
599 port {
600 lcd_in: endpoint {
601 remote-endpoint = <&sdi_out>;
602 };
603 };
481 }; 604 };
482}; 605};
483 606
@@ -503,3 +626,39 @@
503 pinctrl-names = "default"; 626 pinctrl-names = "default";
504 pinctrl-0 = <&uart3_pins>; 627 pinctrl-0 = <&uart3_pins>;
505}; 628};
629
630&dss {
631 status = "ok";
632
633 pinctrl-names = "default";
634 pinctrl-0 = <&dss_sdi_pins>;
635
636 vdds_sdi-supply = <&vaux1>;
637
638 ports {
639 #address-cells = <1>;
640 #size-cells = <0>;
641
642 port@1 {
643 reg = <1>;
644
645 sdi_out: endpoint {
646 remote-endpoint = <&lcd_in>;
647 datapairs = <2>;
648 };
649 };
650 };
651};
652
653&venc {
654 status = "ok";
655
656 vdda-supply = <&vdac>;
657
658 port {
659 venc_out: endpoint {
660 remote-endpoint = <&tv_connector_in>;
661 ti,channels = <1>;
662 };
663 };
664};
diff --git a/arch/arm/boot/dts/omap3-overo-alto35-common.dtsi b/arch/arm/boot/dts/omap3-overo-alto35-common.dtsi
new file mode 100644
index 000000000000..19d64864a109
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo-alto35-common.dtsi
@@ -0,0 +1,77 @@
1/*
2 * Copyright (C) 2014 Florian Vaussard, 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Alto35 expansion board is manufactured by Gumstix Inc.
11 */
12
13#include "omap3-overo-common-peripherals.dtsi"
14
15#include <dt-bindings/input/input.h>
16
17/ {
18 leds {
19 compatible = "gpio-leds";
20 pinctrl-names = "default";
21 pinctrl-0 = <&led_pins>;
22 gpio148 {
23 label = "overo:red:gpio148";
24 gpios = <&gpio5 20 GPIO_ACTIVE_HIGH>; /* gpio 148 */
25 };
26 gpio150 {
27 label = "overo:yellow:gpio150";
28 gpios = <&gpio5 22 GPIO_ACTIVE_HIGH>; /* gpio 150 */
29 };
30 gpio151 {
31 label = "overo:blue:gpio151";
32 gpios = <&gpio5 23 GPIO_ACTIVE_HIGH>; /* gpio 151 */
33 };
34 gpio170 {
35 label = "overo:green:gpio170";
36 gpios = <&gpio6 10 GPIO_ACTIVE_HIGH>; /* gpio 170 */
37 };
38 };
39
40 gpio_keys {
41 compatible = "gpio-keys";
42 #address-cells = <1>;
43 #size-cells = <0>;
44 pinctrl-names = "default";
45 pinctrl-0 = <&button_pins>;
46 button0@10 {
47 label = "button0";
48 linux,code = <BTN_0>;
49 gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; /* gpio_10 */
50 gpio-key,wakeup;
51 };
52 };
53};
54
55&omap3_pmx_core {
56 led_pins: pinmux_led_pins {
57 pinctrl-single,pins = <
58 OMAP3_CORE1_IOPAD(0x217c, PIN_OUTPUT | MUX_MODE4) /* uart1_tx.gpio_148 */
59 OMAP3_CORE1_IOPAD(0x2180, PIN_OUTPUT | MUX_MODE4) /* uart1_cts.gpio_150 */
60 OMAP3_CORE1_IOPAD(0x2182, PIN_OUTPUT | MUX_MODE4) /* uart1_rx.gpio_151 */
61 OMAP3_CORE1_IOPAD(0x21c6, PIN_OUTPUT | MUX_MODE4) /* hdq_sio.gpio_170 */
62 >;
63 };
64};
65
66&omap3_pmx_wkup {
67 button_pins: pinmux_button_pins {
68 pinctrl-single,pins = <
69 OMAP3_WKUP_IOPAD(0x2a18, PIN_INPUT | MUX_MODE4) /* sys_clkout1.gpio_10 */
70 >;
71 };
72};
73
74&usbhshost {
75 status = "disabled";
76};
77
diff --git a/arch/arm/boot/dts/omap3-overo-alto35.dts b/arch/arm/boot/dts/omap3-overo-alto35.dts
new file mode 100644
index 000000000000..a3249eb7501d
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo-alto35.dts
@@ -0,0 +1,22 @@
1/*
2 * Copyright (C) 2014 Florian Vaussard, 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Alto35 expansion board is manufactured by Gumstix Inc.
11 */
12
13/dts-v1/;
14
15#include "omap3-overo.dtsi"
16#include "omap3-overo-alto35-common.dtsi"
17
18/ {
19 model = "OMAP35xx Gumstix Overo on Alto35";
20 compatible = "gumstix,omap3-overo-alto35", "gumstix,omap3-overo", "ti,omap3430", "ti,omap3";
21};
22
diff --git a/arch/arm/boot/dts/omap3-overo-base.dtsi b/arch/arm/boot/dts/omap3-overo-base.dtsi
new file mode 100644
index 000000000000..d36bf0250a05
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo-base.dtsi
@@ -0,0 +1,221 @@
1/*
2 * Copyright (C) 2012 Florian Vaussard, 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * The Gumstix Overo must be combined with an expansion board.
11 */
12
13/ {
14 pwmleds {
15 compatible = "pwm-leds";
16
17 overo {
18 label = "overo:blue:COM";
19 pwms = <&twl_pwmled 1 7812500>;
20 max-brightness = <127>;
21 linux,default-trigger = "mmc0";
22 };
23 };
24
25 sound {
26 compatible = "ti,omap-twl4030";
27 ti,model = "overo";
28
29 ti,mcbsp = <&mcbsp2>;
30 ti,codec = <&twl_audio>;
31 };
32
33 /* HS USB Port 2 Power */
34 hsusb2_power: hsusb2_power_reg {
35 compatible = "regulator-fixed";
36 regulator-name = "hsusb2_vbus";
37 regulator-min-microvolt = <5000000>;
38 regulator-max-microvolt = <5000000>;
39 gpio = <&gpio6 8 0>; /* gpio_168: vbus enable */
40 startup-delay-us = <70000>;
41 enable-active-high;
42 };
43
44 /* HS USB Host PHY on PORT 2 */
45 hsusb2_phy: hsusb2_phy {
46 compatible = "usb-nop-xceiv";
47 reset-gpios = <&gpio6 23 GPIO_ACTIVE_LOW>; /* gpio_183 */
48 vcc-supply = <&hsusb2_power>;
49 };
50
51 /* Regulator to trigger the nPoweron signal of the Wifi module */
52 w3cbw003c_npoweron: regulator-w3cbw003c-npoweron {
53 compatible = "regulator-fixed";
54 regulator-name = "regulator-w3cbw003c-npoweron";
55 regulator-min-microvolt = <3300000>;
56 regulator-max-microvolt = <3300000>;
57 gpio = <&gpio2 22 GPIO_ACTIVE_HIGH>; /* gpio_54: nPoweron */
58 enable-active-high;
59 };
60
61 /* Regulator to trigger the nReset signal of the Wifi module */
62 w3cbw003c_wifi_nreset: regulator-w3cbw003c-wifi-nreset {
63 pinctrl-names = "default";
64 pinctrl-0 = <&w3cbw003c_pins &w3cbw003c_2_pins>;
65 compatible = "regulator-fixed";
66 regulator-name = "regulator-w3cbw003c-wifi-nreset";
67 regulator-min-microvolt = <3300000>;
68 regulator-max-microvolt = <3300000>;
69 gpio = <&gpio1 16 GPIO_ACTIVE_HIGH>; /* gpio_16: WiFi nReset */
70 startup-delay-us = <10000>;
71 };
72
73 /* Regulator to trigger the nReset signal of the Bluetooth module */
74 w3cbw003c_bt_nreset: regulator-w3cbw003c-bt-nreset {
75 compatible = "regulator-fixed";
76 regulator-name = "regulator-w3cbw003c-bt-nreset";
77 regulator-min-microvolt = <3300000>;
78 regulator-max-microvolt = <3300000>;
79 gpio = <&gpio6 4 GPIO_ACTIVE_HIGH>; /* gpio_164: BT nReset */
80 startup-delay-us = <10000>;
81 };
82};
83
84&omap3_pmx_core {
85 pinctrl-names = "default";
86 pinctrl-0 = <
87 &hsusb2_pins
88 >;
89
90 uart2_pins: pinmux_uart2_pins {
91 pinctrl-single,pins = <
92 OMAP3_CORE1_IOPAD(0x216c, PIN_INPUT | MUX_MODE1) /* mcbsp3_dx.uart2_cts */
93 OMAP3_CORE1_IOPAD(0x216e, PIN_OUTPUT | MUX_MODE1) /* mcbsp3_dr.uart2_rts */
94 OMAP3_CORE1_IOPAD(0x2170, PIN_OUTPUT | MUX_MODE1) /* mcbsp3_clk.uart2_tx */
95 OMAP3_CORE1_IOPAD(0x2172, PIN_INPUT | MUX_MODE1) /* mcbsp3_fsx.uart2_rx */
96 >;
97 };
98
99 i2c1_pins: pinmux_i2c1_pins {
100 pinctrl-single,pins = <
101 OMAP3_CORE1_IOPAD(0x21ba, PIN_INPUT | MUX_MODE0) /* i2c1_scl.i2c1_scl */
102 OMAP3_CORE1_IOPAD(0x21bc, PIN_INPUT | MUX_MODE0) /* i2c1_sda.i2c1_sda */
103 >;
104 };
105
106 mmc1_pins: pinmux_mmc1_pins {
107 pinctrl-single,pins = <
108 OMAP3_CORE1_IOPAD(0x2144, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_clk.sdmmc1_clk */
109 OMAP3_CORE1_IOPAD(0x2146, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_cmd.sdmmc1_cmd */
110 OMAP3_CORE1_IOPAD(0x2148, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat0.sdmmc1_dat0 */
111 OMAP3_CORE1_IOPAD(0x214a, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat1.sdmmc1_dat1 */
112 OMAP3_CORE1_IOPAD(0x214c, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat2.sdmmc1_dat2 */
113 OMAP3_CORE1_IOPAD(0x214e, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat3.sdmmc1_dat3 */
114 >;
115 };
116
117 mmc2_pins: pinmux_mmc2_pins {
118 pinctrl-single,pins = <
119 OMAP3_CORE1_IOPAD(0x2158, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_clk.sdmmc2_clk */
120 OMAP3_CORE1_IOPAD(0x215a, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_cmd.sdmmc2_cmd */
121 OMAP3_CORE1_IOPAD(0x215c, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat0.sdmmc2_dat0 */
122 OMAP3_CORE1_IOPAD(0x215e, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat1.sdmmc2_dat1 */
123 OMAP3_CORE1_IOPAD(0x2160, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat2.sdmmc2_dat2 */
124 OMAP3_CORE1_IOPAD(0x2162, PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc2_dat3.sdmmc2_dat3 */
125 >;
126 };
127
128 /* WiFi/BT combo */
129 w3cbw003c_pins: pinmux_w3cbw003c_pins {
130 pinctrl-single,pins = <
131 OMAP3_CORE1_IOPAD(0x20b4, PIN_OUTPUT | MUX_MODE4) /* gpmc_ncs3.gpio_54 */
132 OMAP3_CORE1_IOPAD(0x219c, PIN_OUTPUT | MUX_MODE4) /* uart3_rts_sd.gpio_164 */
133 >;
134 };
135
136 hsusb2_pins: pinmux_hsusb2_pins {
137 pinctrl-single,pins = <
138 OMAP3_CORE1_IOPAD(0x21d4, PIN_INPUT_PULLDOWN | MUX_MODE3) /* mcspi1_cs3.hsusb2_data2 */
139 OMAP3_CORE1_IOPAD(0x21d6, PIN_INPUT_PULLDOWN | MUX_MODE3) /* mcspi2_clk.hsusb2_data7 */
140 OMAP3_CORE1_IOPAD(0x21d8, PIN_INPUT_PULLDOWN | MUX_MODE3) /* mcspi2_simo.hsusb2_data4 */
141 OMAP3_CORE1_IOPAD(0x21da, PIN_INPUT_PULLDOWN | MUX_MODE3) /* mcspi2_somi.hsusb2_data5 */
142 OMAP3_CORE1_IOPAD(0x21dc, PIN_INPUT_PULLDOWN | MUX_MODE3) /* mcspi2_cs0.hsusb2_data6 */
143 OMAP3_CORE1_IOPAD(0x21de, PIN_INPUT_PULLDOWN | MUX_MODE3) /* mcspi2_cs1.hsusb2_data3 */
144 OMAP3_CORE1_IOPAD(0x21be, PIN_OUTPUT | MUX_MODE4) /* i2c2_scl.gpio_168 */
145 OMAP3_CORE1_IOPAD(0x21c0, PIN_OUTPUT | MUX_MODE4) /* i2c2_sda.gpio_183 */
146 >;
147 };
148};
149
150&i2c1 {
151 pinctrl-names = "default";
152 pinctrl-0 = <&i2c1_pins>;
153 clock-frequency = <2600000>;
154
155 twl: twl@48 {
156 reg = <0x48>;
157 interrupts = <7>; /* SYS_NIRQ cascaded to intc */
158 interrupt-parent = <&intc>;
159
160 twl_audio: audio {
161 compatible = "ti,twl4030-audio";
162 codec {
163 };
164 };
165 };
166};
167
168#include "twl4030.dtsi"
169#include "twl4030_omap3.dtsi"
170
171/* i2c2 pins are used for gpio */
172&i2c2 {
173 status = "disabled";
174};
175
176/* on board microSD slot */
177&mmc1 {
178 pinctrl-names = "default";
179 pinctrl-0 = <&mmc1_pins>;
180 vmmc-supply = <&vmmc1>;
181 bus-width = <4>;
182};
183
184/* optional on board WiFi */
185&mmc2 {
186 pinctrl-names = "default";
187 pinctrl-0 = <&mmc2_pins>;
188 vmmc-supply = <&w3cbw003c_npoweron>;
189 vqmmc-supply = <&w3cbw003c_bt_nreset>;
190 vmmc_aux-supply = <&w3cbw003c_wifi_nreset>;
191 bus-width = <4>;
192 cap-sdio-irq;
193 non-removable;
194};
195
196&twl_gpio {
197 ti,use-leds;
198};
199
200&usb_otg_hs {
201 interface-type = <0>;
202 usb-phy = <&usb2_phy>;
203 phys = <&usb2_phy>;
204 phy-names = "usb2-phy";
205 mode = <3>;
206 power = <50>;
207};
208
209&usbhshost {
210 port2-mode = "ehci-phy";
211};
212
213&usbhsehci {
214 phys = <0 &hsusb2_phy>;
215};
216
217&uart2 {
218 pinctrl-names = "default";
219 pinctrl-0 = <&uart2_pins>;
220};
221
diff --git a/arch/arm/boot/dts/omap3-overo-chestnut43-common.dtsi b/arch/arm/boot/dts/omap3-overo-chestnut43-common.dtsi
new file mode 100644
index 000000000000..19de6ff79686
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo-chestnut43-common.dtsi
@@ -0,0 +1,69 @@
1/*
2 * Copyright (C) 2014 Florian Vaussard, 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Chestnut43 expansion board is manufactured by Gumstix Inc.
11 */
12
13#include "omap3-overo-common-peripherals.dtsi"
14
15#include <dt-bindings/input/input.h>
16
17/ {
18 leds {
19 compatible = "gpio-leds";
20 pinctrl-names = "default";
21 pinctrl-0 = <&led_pins>;
22 heartbeat {
23 label = "overo:red:gpio21";
24 gpios = <&gpio1 21 GPIO_ACTIVE_LOW>; /* gpio_21 */
25 linux,default-trigger = "heartbeat";
26 };
27 gpio22 {
28 label = "overo:blue:gpio22";
29 gpios = <&gpio1 22 GPIO_ACTIVE_LOW>; /* gpio_22 */
30 };
31 };
32
33 gpio_keys {
34 compatible = "gpio-keys";
35 pinctrl-names = "default";
36 pinctrl-0 = <&button_pins>;
37 #address-cells = <1>;
38 #size-cells = <0>;
39 button0@23 {
40 label = "button0";
41 linux,code = <BTN_0>;
42 gpios = <&gpio1 23 GPIO_ACTIVE_LOW>; /* gpio_23 */
43 gpio-key,wakeup;
44 };
45 button1@14 {
46 label = "button1";
47 linux,code = <BTN_1>;
48 gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; /* gpio_14 */
49 gpio-key,wakeup;
50 };
51 };
52};
53
54#include "omap-gpmc-smsc9221.dtsi"
55
56&gpmc {
57 ranges = <5 0 0x2c000000 0x1000000>; /* CS5 */
58
59 ethernet@gpmc {
60 reg = <5 0 0xff>;
61 interrupt-parent = <&gpio6>;
62 interrupts = <16 IRQ_TYPE_LEVEL_LOW>; /* GPIO 176 */
63 };
64};
65
66&lis33de {
67 status = "disabled";
68};
69
diff --git a/arch/arm/boot/dts/omap3-overo-chestnut43.dts b/arch/arm/boot/dts/omap3-overo-chestnut43.dts
new file mode 100644
index 000000000000..fe0824aca3c0
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo-chestnut43.dts
@@ -0,0 +1,38 @@
1/*
2 * Copyright (C) 2014 Florian Vaussard, 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Chestnut43 expansion board is manufactured by Gumstix Inc.
11 */
12
13/dts-v1/;
14
15#include "omap3-overo.dtsi"
16#include "omap3-overo-chestnut43-common.dtsi"
17
18/ {
19 model = "OMAP35xx Gumstix Overo on Chestnut43";
20 compatible = "gumstix,omap3-overo-chestnut43", "gumstix,omap3-overo", "ti,omap3430", "ti,omap3";
21};
22
23&omap3_pmx_core2 {
24 led_pins: pinmux_led_pins {
25 pinctrl-single,pins = <
26 OMAP3430_CORE2_IOPAD(0x25ea, PIN_OUTPUT | MUX_MODE4) /* etk_d7.gpio_21 */
27 OMAP3430_CORE2_IOPAD(0x25ec, PIN_OUTPUT | MUX_MODE4) /* etk_d8.gpio_22 */
28 >;
29 };
30
31 button_pins: pinmux_button_pins {
32 pinctrl-single,pins = <
33 OMAP3430_CORE2_IOPAD(0x25ee, PIN_INPUT | MUX_MODE4) /* etk_d9.gpio_23 */
34 OMAP3430_CORE2_IOPAD(0x25dc, PIN_INPUT | MUX_MODE4) /* etk_d0.gpio_14 */
35 >;
36 };
37};
38
diff --git a/arch/arm/boot/dts/omap3-overo-common-peripherals.dtsi b/arch/arm/boot/dts/omap3-overo-common-peripherals.dtsi
new file mode 100644
index 000000000000..5831bcc52966
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo-common-peripherals.dtsi
@@ -0,0 +1,94 @@
1/*
2 * Copyright (C) 2014 Florian Vaussard, 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Peripherals common to all Gumstix Overo boards (Tobi, Summit, Palo43,...)
11 */
12
13/ {
14 lis33_3v3: lis33-3v3-reg {
15 compatible = "regulator-fixed";
16 regulator-name = "lis33-3v3-reg";
17 regulator-min-microvolt = <3300000>;
18 regulator-max-microvolt = <3300000>;
19 };
20
21 lis33_1v8: lis33-1v8-reg {
22 compatible = "regulator-fixed";
23 regulator-name = "lis33-1v8-reg";
24 regulator-min-microvolt = <1800000>;
25 regulator-max-microvolt = <1800000>;
26 };
27};
28
29&omap3_pmx_core {
30 i2c3_pins: pinmux_i2c3_pins {
31 pinctrl-single,pins = <
32 OMAP3_CORE1_IOPAD(0x21c2, PIN_INPUT | MUX_MODE0) /* i2c3_scl.i2c3_scl */
33 OMAP3_CORE1_IOPAD(0x21c4, PIN_INPUT | MUX_MODE0) /* i2c3_sda.i2c3_sda */
34 >;
35 };
36
37 uart3_pins: pinmux_uart3_pins {
38 pinctrl-single,pins = <
39 OMAP3_CORE1_IOPAD(0x219e, PIN_INPUT | PIN_OFF_WAKEUPENABLE | MUX_MODE0) /* uart3_rx_irrx.uart3_rx_irrx */
40 OMAP3_CORE1_IOPAD(0x21a0, PIN_OUTPUT | MUX_MODE0) /* uart3_tx_irtx.uart3_tx_irtx */
41 >;
42 };
43};
44
45&i2c3 {
46 pinctrl-names = "default";
47 pinctrl-0 = <&i2c3_pins>;
48 clock-frequency = <100000>;
49
50 /* optional 1K EEPROM with revision information */
51 eeprom@51 {
52 compatible = "atmel,24c01";
53 reg = <0x51>;
54 pagesize = <8>;
55 };
56
57 lis33de: lis33de@1d {
58 compatible = "st,lis33de", "st,lis3lv02d";
59 reg = <0x1d>;
60 Vdd-supply = <&lis33_1v8>;
61 Vdd_IO-supply = <&lis33_3v3>;
62
63 st,click-single-x;
64 st,click-single-y;
65 st,click-single-z;
66 st,click-thresh-x = <10>;
67 st,click-thresh-y = <10>;
68 st,click-thresh-z = <10>;
69 st,irq1-click;
70 st,irq2-click;
71 st,wakeup-x-lo;
72 st,wakeup-x-hi;
73 st,wakeup-y-lo;
74 st,wakeup-y-hi;
75 st,wakeup-z-lo;
76 st,wakeup-z-hi;
77 st,min-limit-x = <120>;
78 st,min-limit-y = <120>;
79 st,min-limit-z = <140>;
80 st,max-limit-x = <550>;
81 st,max-limit-y = <550>;
82 st,max-limit-z = <750>;
83 };
84};
85
86&mmc3 {
87 status = "disabled";
88};
89
90&uart3 {
91 pinctrl-names = "default";
92 pinctrl-0 = <&uart3_pins>;
93};
94
diff --git a/arch/arm/boot/dts/omap3-overo-gallop43-common.dtsi b/arch/arm/boot/dts/omap3-overo-gallop43-common.dtsi
new file mode 100644
index 000000000000..5e848c26986b
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo-gallop43-common.dtsi
@@ -0,0 +1,57 @@
1/*
2 * Copyright (C) 2014 Florian Vaussard, 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Gallop43 expansion board is manufactured by Gumstix Inc.
11 */
12
13#include "omap3-overo-common-peripherals.dtsi"
14
15#include <dt-bindings/input/input.h>
16
17/ {
18 leds {
19 compatible = "gpio-leds";
20 pinctrl-names = "default";
21 pinctrl-0 = <&led_pins>;
22 heartbeat {
23 label = "overo:red:gpio21";
24 gpios = <&gpio1 21 GPIO_ACTIVE_LOW>; /* gpio_21 */
25 linux,default-trigger = "heartbeat";
26 };
27 gpio22 {
28 label = "overo:blue:gpio22";
29 gpios = <&gpio1 22 GPIO_ACTIVE_LOW>; /* gpio_22 */
30 };
31 };
32
33 gpio_keys {
34 compatible = "gpio-keys";
35 pinctrl-names = "default";
36 pinctrl-0 = <&button_pins>;
37 #address-cells = <1>;
38 #size-cells = <0>;
39 button0@23 {
40 label = "button0";
41 linux,code = <BTN_0>;
42 gpios = <&gpio1 23 GPIO_ACTIVE_LOW>; /* gpio_23 */
43 gpio-key,wakeup;
44 };
45 button1@14 {
46 label = "button1";
47 linux,code = <BTN_1>;
48 gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; /* gpio_14 */
49 gpio-key,wakeup;
50 };
51 };
52};
53
54&usbhshost {
55 status = "disabled";
56};
57
diff --git a/arch/arm/boot/dts/omap3-overo-gallop43.dts b/arch/arm/boot/dts/omap3-overo-gallop43.dts
new file mode 100644
index 000000000000..241f5c1914e0
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo-gallop43.dts
@@ -0,0 +1,38 @@
1/*
2 * Copyright (C) 2014 Florian Vaussard, 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Gallop43 expansion board is manufactured by Gumstix Inc.
11 */
12
13/dts-v1/;
14
15#include "omap3-overo.dtsi"
16#include "omap3-overo-gallop43-common.dtsi"
17
18/ {
19 model = "OMAP35xx Gumstix Overo on Gallop43";
20 compatible = "gumstix,omap3-overo-gallop43", "gumstix,omap3-overo", "ti,omap3430", "ti,omap3";
21};
22
23&omap3_pmx_core2 {
24 led_pins: pinmux_led_pins {
25 pinctrl-single,pins = <
26 OMAP3430_CORE2_IOPAD(0x25ea, PIN_OUTPUT | MUX_MODE4) /* etk_d7.gpio_21 */
27 OMAP3430_CORE2_IOPAD(0x25ec, PIN_OUTPUT | MUX_MODE4) /* etk_d8.gpio_22 */
28 >;
29 };
30
31 button_pins: pinmux_button_pins {
32 pinctrl-single,pins = <
33 OMAP3430_CORE2_IOPAD(0x25ee, PIN_INPUT | MUX_MODE4) /* etk_d9.gpio_23 */
34 OMAP3430_CORE2_IOPAD(0x25dc, PIN_INPUT | MUX_MODE4) /* etk_d0.gpio_14 */
35 >;
36 };
37};
38
diff --git a/arch/arm/boot/dts/omap3-overo-palo43-common.dtsi b/arch/arm/boot/dts/omap3-overo-palo43-common.dtsi
new file mode 100644
index 000000000000..abea232825b9
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo-palo43-common.dtsi
@@ -0,0 +1,53 @@
1/*
2 * Copyright (C) 2014 Florian Vaussard, 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Palo43 expansion board is manufactured by Gumstix Inc.
11 */
12
13#include "omap3-overo-common-peripherals.dtsi"
14
15#include <dt-bindings/input/input.h>
16
17/ {
18 leds {
19 compatible = "gpio-leds";
20 pinctrl-names = "default";
21 pinctrl-0 = <&led_pins>;
22 heartbeat {
23 label = "overo:red:gpio21";
24 gpios = <&gpio1 21 GPIO_ACTIVE_LOW>; /* gpio_21 */
25 linux,default-trigger = "heartbeat";
26 };
27 gpio22 {
28 label = "overo:blue:gpio22";
29 gpios = <&gpio1 22 GPIO_ACTIVE_LOW>; /* gpio_22 */
30 };
31 };
32
33 gpio_keys {
34 compatible = "gpio-keys";
35 pinctrl-names = "default";
36 pinctrl-0 = <&button_pins>;
37 #address-cells = <1>;
38 #size-cells = <0>;
39 button0@23 {
40 label = "button0";
41 linux,code = <BTN_0>;
42 gpios = <&gpio1 23 GPIO_ACTIVE_LOW>; /* gpio_23 */
43 gpio-key,wakeup;
44 };
45 button1@14 {
46 label = "button1";
47 linux,code = <BTN_1>;
48 gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; /* gpio_14 */
49 gpio-key,wakeup;
50 };
51 };
52};
53
diff --git a/arch/arm/boot/dts/omap3-overo-palo43.dts b/arch/arm/boot/dts/omap3-overo-palo43.dts
new file mode 100644
index 000000000000..cedb103b4b66
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo-palo43.dts
@@ -0,0 +1,38 @@
1/*
2 * Copyright (C) 2014 Florian Vaussard, 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Palo43 expansion board is manufactured by Gumstix Inc.
11 */
12
13/dts-v1/;
14
15#include "omap3-overo.dtsi"
16#include "omap3-overo-palo43-common.dtsi"
17
18/ {
19 model = "OMAP35xx Gumstix Overo on Palo43";
20 compatible = "gumstix,omap3-overo-palo43", "gumstix,omap3-overo", "ti,omap3430", "ti,omap3";
21};
22
23&omap3_pmx_core2 {
24 led_pins: pinmux_led_pins {
25 pinctrl-single,pins = <
26 OMAP3430_CORE2_IOPAD(0x25ea, PIN_OUTPUT | MUX_MODE4) /* etk_d7.gpio_21 */
27 OMAP3430_CORE2_IOPAD(0x25ec, PIN_OUTPUT | MUX_MODE4) /* etk_d8.gpio_22 */
28 >;
29 };
30
31 button_pins: pinmux_button_pins {
32 pinctrl-single,pins = <
33 OMAP3430_CORE2_IOPAD(0x25ee, PIN_INPUT | MUX_MODE4) /* etk_d9.gpio_23 */
34 OMAP3430_CORE2_IOPAD(0x25dc, PIN_INPUT | MUX_MODE4) /* etk_d0.gpio_14 */
35 >;
36 };
37};
38
diff --git a/arch/arm/boot/dts/omap3-overo-storm-alto35.dts b/arch/arm/boot/dts/omap3-overo-storm-alto35.dts
new file mode 100644
index 000000000000..e9cae52afc25
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo-storm-alto35.dts
@@ -0,0 +1,21 @@
1/*
2 * Copyright (C) 2014 Florian Vaussard, 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Alto35 expansion board is manufactured by Gumstix Inc.
11 */
12
13/dts-v1/;
14
15#include "omap3-overo-storm.dtsi"
16#include "omap3-overo-alto35-common.dtsi"
17
18/ {
19 model = "OMAP36xx/AM37xx/DM37xx Gumstix Overo on Alto35";
20 compatible = "gumstix,omap3-overo-alto35", "gumstix,omap3-overo", "ti,omap36xx", "ti,omap3";
21};
diff --git a/arch/arm/boot/dts/omap3-overo-storm-chestnut43.dts b/arch/arm/boot/dts/omap3-overo-storm-chestnut43.dts
new file mode 100644
index 000000000000..7d82fdfd9909
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo-storm-chestnut43.dts
@@ -0,0 +1,38 @@
1/*
2 * Copyright (C) 2014 Florian Vaussard, 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Chestnut43 expansion board is manufactured by Gumstix Inc.
11 */
12
13/dts-v1/;
14
15#include "omap3-overo-storm.dtsi"
16#include "omap3-overo-chestnut43-common.dtsi"
17
18/ {
19 model = "OMAP36xx/AM37xx/DM37xx Gumstix Overo on Chestnut43";
20 compatible = "gumstix,omap3-overo-chestnut43", "gumstix,omap3-overo", "ti,omap36xx", "ti,omap3";
21};
22
23&omap3_pmx_core2 {
24 led_pins: pinmux_led_pins {
25 pinctrl-single,pins = <
26 OMAP3630_CORE2_IOPAD(0x25ea, PIN_OUTPUT | MUX_MODE4) /* etk_d7.gpio_21 */
27 OMAP3630_CORE2_IOPAD(0x25ec, PIN_OUTPUT | MUX_MODE4) /* etk_d8.gpio_22 */
28 >;
29 };
30
31 button_pins: pinmux_button_pins {
32 pinctrl-single,pins = <
33 OMAP3630_CORE2_IOPAD(0x25ee, PIN_INPUT | MUX_MODE4) /* etk_d9.gpio_23 */
34 OMAP3630_CORE2_IOPAD(0x25dc, PIN_INPUT | MUX_MODE4) /* etk_d0.gpio_14 */
35 >;
36 };
37};
38
diff --git a/arch/arm/boot/dts/omap3-overo-storm-gallop43.dts b/arch/arm/boot/dts/omap3-overo-storm-gallop43.dts
new file mode 100644
index 000000000000..a1b57e0cf37f
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo-storm-gallop43.dts
@@ -0,0 +1,38 @@
1/*
2 * Copyright (C) 2014 Florian Vaussard, 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Gallop43 expansion board is manufactured by Gumstix Inc.
11 */
12
13/dts-v1/;
14
15#include "omap3-overo-storm.dtsi"
16#include "omap3-overo-gallop43-common.dtsi"
17
18/ {
19 model = "OMAP36xx/AM37xx/DM37xx Gumstix Overo on Gallop43";
20 compatible = "gumstix,omap3-overo-gallop43", "gumstix,omap3-overo", "ti,omap36xx", "ti,omap3";
21};
22
23&omap3_pmx_core2 {
24 led_pins: pinmux_led_pins {
25 pinctrl-single,pins = <
26 OMAP3630_CORE2_IOPAD(0x25ea, PIN_OUTPUT | MUX_MODE4) /* etk_d7.gpio_21 */
27 OMAP3630_CORE2_IOPAD(0x25ec, PIN_OUTPUT | MUX_MODE4) /* etk_d8.gpio_22 */
28 >;
29 };
30
31 button_pins: pinmux_button_pins {
32 pinctrl-single,pins = <
33 OMAP3630_CORE2_IOPAD(0x25ee, PIN_INPUT | MUX_MODE4) /* etk_d9.gpio_23 */
34 OMAP3630_CORE2_IOPAD(0x25dc, PIN_INPUT | MUX_MODE4) /* etk_d0.gpio_14 */
35 >;
36 };
37};
38
diff --git a/arch/arm/boot/dts/omap3-overo-storm-palo43.dts b/arch/arm/boot/dts/omap3-overo-storm-palo43.dts
new file mode 100644
index 000000000000..b585d8fbc347
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo-storm-palo43.dts
@@ -0,0 +1,38 @@
1/*
2 * Copyright (C) 2014 Florian Vaussard, 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Palo43 expansion board is manufactured by Gumstix Inc.
11 */
12
13/dts-v1/;
14
15#include "omap3-overo-storm.dtsi"
16#include "omap3-overo-palo43-common.dtsi"
17
18/ {
19 model = "OMAP36xx/AM37xx/DM37xx Gumstix Overo on Palo43";
20 compatible = "gumstix,omap3-overo-palo43", "gumstix,omap3-overo", "ti,omap36xx", "ti,omap3";
21};
22
23&omap3_pmx_core2 {
24 led_pins: pinmux_led_pins {
25 pinctrl-single,pins = <
26 OMAP3630_CORE2_IOPAD(0x25ea, PIN_OUTPUT | MUX_MODE4) /* etk_d7.gpio_21 */
27 OMAP3630_CORE2_IOPAD(0x25ec, PIN_OUTPUT | MUX_MODE4) /* etk_d8.gpio_22 */
28 >;
29 };
30
31 button_pins: pinmux_button_pins {
32 pinctrl-single,pins = <
33 OMAP3630_CORE2_IOPAD(0x25ee, PIN_INPUT | MUX_MODE4) /* etk_d9.gpio_23 */
34 OMAP3630_CORE2_IOPAD(0x25dc, PIN_INPUT | MUX_MODE4) /* etk_d0.gpio_14 */
35 >;
36 };
37};
38
diff --git a/arch/arm/boot/dts/omap3-overo-storm-summit.dts b/arch/arm/boot/dts/omap3-overo-storm-summit.dts
new file mode 100644
index 000000000000..a0d7fd8369d7
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo-storm-summit.dts
@@ -0,0 +1,30 @@
1/*
2 * Copyright (C) 2014 Florian Vaussard, 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Summit expansion board is manufactured by Gumstix Inc.
11 */
12
13/dts-v1/;
14
15#include "omap3-overo-storm.dtsi"
16#include "omap3-overo-summit-common.dtsi"
17
18/ {
19 model = "OMAP36xx/AM37xx/DM37xx Gumstix Overo on Summit";
20 compatible = "gumstix,omap3-overo-summit", "gumstix,omap3-overo", "ti,omap36xx", "ti,omap3";
21};
22
23&omap3_pmx_core2 {
24 led_pins: pinmux_led_pins {
25 pinctrl-single,pins = <
26 OMAP3630_CORE2_IOPAD(0x25ea, PIN_OUTPUT | MUX_MODE4) /* etk_d7.gpio_21 */
27 >;
28 };
29};
30
diff --git a/arch/arm/boot/dts/omap3-overo-storm-tobi.dts b/arch/arm/boot/dts/omap3-overo-storm-tobi.dts
index 966b5c9cd96a..879383acad87 100644
--- a/arch/arm/boot/dts/omap3-overo-storm-tobi.dts
+++ b/arch/arm/boot/dts/omap3-overo-storm-tobi.dts
@@ -12,7 +12,7 @@
12 12
13/dts-v1/; 13/dts-v1/;
14 14
15#include "omap36xx.dtsi" 15#include "omap3-overo-storm.dtsi"
16#include "omap3-overo-tobi-common.dtsi" 16#include "omap3-overo-tobi-common.dtsi"
17 17
18/ { 18/ {
diff --git a/arch/arm/boot/dts/omap3-overo-storm.dtsi b/arch/arm/boot/dts/omap3-overo-storm.dtsi
new file mode 100644
index 000000000000..6cb418b4124a
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo-storm.dtsi
@@ -0,0 +1,35 @@
1/*
2 * Copyright (C) 2014 Florian Vaussard, 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#include "omap36xx.dtsi"
10#include "omap3-overo-base.dtsi"
11
12&omap3_pmx_core2 {
13 pinctrl-names = "default";
14 pinctrl-0 = <
15 &hsusb2_2_pins
16 >;
17
18 hsusb2_2_pins: pinmux_hsusb2_2_pins {
19 pinctrl-single,pins = <
20 OMAP3630_CORE2_IOPAD(0x25f0, PIN_OUTPUT | MUX_MODE3) /* etk_d10.hsusb2_clk */
21 OMAP3630_CORE2_IOPAD(0x25f2, PIN_OUTPUT | MUX_MODE3) /* etk_d11.hsusb2_stp */
22 OMAP3630_CORE2_IOPAD(0x25f4, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d12.hsusb2_dir */
23 OMAP3630_CORE2_IOPAD(0x25f6, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d13.hsusb2_nxt */
24 OMAP3630_CORE2_IOPAD(0x25f8, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d14.hsusb2_data0 */
25 OMAP3630_CORE2_IOPAD(0x25fa, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d15.hsusb2_data1 */
26 >;
27 };
28
29 w3cbw003c_2_pins: pinmux_w3cbw003c_2_pins {
30 pinctrl-single,pins = <
31 OMAP3630_CORE2_IOPAD(0x25e0, PIN_OUTPUT | MUX_MODE4) /* etk_d2.gpio_16 */
32 >;
33 };
34};
35
diff --git a/arch/arm/boot/dts/omap3-overo-summit-common.dtsi b/arch/arm/boot/dts/omap3-overo-summit-common.dtsi
new file mode 100644
index 000000000000..999d1cd4a09f
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo-summit-common.dtsi
@@ -0,0 +1,31 @@
1/*
2 * Copyright (C) 2014 Florian Vaussard, 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Summit expansion board is manufactured by Gumstix Inc.
11 */
12
13#include "omap3-overo-common-peripherals.dtsi"
14
15/ {
16 leds {
17 compatible = "gpio-leds";
18 pinctrl-names = "default";
19 pinctrl-0 = <&led_pins>;
20 heartbeat {
21 label = "overo:red:gpio21";
22 gpios = <&gpio1 21 GPIO_ACTIVE_LOW>; /* gpio_21 */
23 linux,default-trigger = "heartbeat";
24 };
25 };
26};
27
28&lis33de {
29 status = "disabled";
30};
31
diff --git a/arch/arm/boot/dts/omap3-overo-summit.dts b/arch/arm/boot/dts/omap3-overo-summit.dts
new file mode 100644
index 000000000000..69765609455a
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-overo-summit.dts
@@ -0,0 +1,30 @@
1/*
2 * Copyright (C) 2014 Florian Vaussard, 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9/*
10 * Summit expansion board is manufactured by Gumstix Inc.
11 */
12
13/dts-v1/;
14
15#include "omap3-overo.dtsi"
16#include "omap3-overo-summit-common.dtsi"
17
18/ {
19 model = "OMAP35xx Gumstix Overo on Summit";
20 compatible = "gumstix,omap3-overo-summit", "gumstix,omap3-overo", "ti,omap3430", "ti,omap3";
21};
22
23&omap3_pmx_core2 {
24 led_pins: pinmux_led_pins {
25 pinctrl-single,pins = <
26 OMAP3430_CORE2_IOPAD(0x25ea, PIN_OUTPUT | MUX_MODE4) /* etk_d7.gpio_21 */
27 >;
28 };
29};
30
diff --git a/arch/arm/boot/dts/omap3-overo-tobi-common.dtsi b/arch/arm/boot/dts/omap3-overo-tobi-common.dtsi
index 4edc013a91c1..13df50b39442 100644
--- a/arch/arm/boot/dts/omap3-overo-tobi-common.dtsi
+++ b/arch/arm/boot/dts/omap3-overo-tobi-common.dtsi
@@ -10,7 +10,7 @@
10 * Tobi expansion board is manufactured by Gumstix Inc. 10 * Tobi expansion board is manufactured by Gumstix Inc.
11 */ 11 */
12 12
13#include "omap3-overo.dtsi" 13#include "omap3-overo-common-peripherals.dtsi"
14 14
15/ { 15/ {
16 leds { 16 leds {
@@ -21,60 +21,21 @@
21 linux,default-trigger = "heartbeat"; 21 linux,default-trigger = "heartbeat";
22 }; 22 };
23 }; 23 };
24
25 vddvario: regulator-vddvario {
26 compatible = "regulator-fixed";
27 regulator-name = "vddvario";
28 regulator-always-on;
29 };
30
31 vdd33a: regulator-vdd33a {
32 compatible = "regulator-fixed";
33 regulator-name = "vdd33a";
34 regulator-always-on;
35 };
36}; 24};
37 25
26#include "omap-gpmc-smsc9221.dtsi"
27
38&gpmc { 28&gpmc {
39 ranges = <5 0 0x2c000000 0x1000000>; /* CS5 */ 29 ranges = <5 0 0x2c000000 0x1000000>; /* CS5 */
40 30
41 ethernet@5,0 { 31 ethernet@gpmc {
42 compatible = "smsc,lan9221", "smsc,lan9115";
43 reg = <5 0 0xff>; 32 reg = <5 0 0xff>;
44 bank-width = <2>;
45
46 gpmc,mux-add-data;
47 gpmc,cs-on-ns = <0>;
48 gpmc,cs-rd-off-ns = <42>;
49 gpmc,cs-wr-off-ns = <36>;
50 gpmc,adv-on-ns = <6>;
51 gpmc,adv-rd-off-ns = <12>;
52 gpmc,adv-wr-off-ns = <12>;
53 gpmc,oe-on-ns = <0>;
54 gpmc,oe-off-ns = <42>;
55 gpmc,we-on-ns = <0>;
56 gpmc,we-off-ns = <36>;
57 gpmc,rd-cycle-ns = <60>;
58 gpmc,wr-cycle-ns = <54>;
59 gpmc,access-ns = <36>;
60 gpmc,page-burst-access-ns = <0>;
61 gpmc,bus-turnaround-ns = <0>;
62 gpmc,cycle2cycle-delay-ns = <0>;
63 gpmc,wr-data-mux-bus-ns = <18>;
64 gpmc,wr-access-ns = <42>;
65 gpmc,cycle2cycle-samecsen;
66 gpmc,cycle2cycle-diffcsen;
67
68 interrupt-parent = <&gpio6>; 33 interrupt-parent = <&gpio6>;
69 interrupts = <16 IRQ_TYPE_LEVEL_LOW>; /* GPIO 176 */ 34 interrupts = <16 IRQ_TYPE_LEVEL_LOW>; /* GPIO 176 */
70 reg-io-width = <4>;
71 }; 35 };
72}; 36};
73 37
74&i2c3 { 38&lis33de {
75 clock-frequency = <100000>;
76};
77
78&mmc3 {
79 status = "disabled"; 39 status = "disabled";
80}; 40};
41
diff --git a/arch/arm/boot/dts/omap3-overo-tobi.dts b/arch/arm/boot/dts/omap3-overo-tobi.dts
index de5653e1b5ca..fd6400efcdee 100644
--- a/arch/arm/boot/dts/omap3-overo-tobi.dts
+++ b/arch/arm/boot/dts/omap3-overo-tobi.dts
@@ -12,7 +12,7 @@
12 12
13/dts-v1/; 13/dts-v1/;
14 14
15#include "omap34xx.dtsi" 15#include "omap3-overo.dtsi"
16#include "omap3-overo-tobi-common.dtsi" 16#include "omap3-overo-tobi-common.dtsi"
17 17
18/ { 18/ {
diff --git a/arch/arm/boot/dts/omap3-overo.dtsi b/arch/arm/boot/dts/omap3-overo.dtsi
index 597099907f8e..69ca7c45bca2 100644
--- a/arch/arm/boot/dts/omap3-overo.dtsi
+++ b/arch/arm/boot/dts/omap3-overo.dtsi
@@ -1,94 +1,38 @@
1/* 1/*
2 * Copyright (C) 2012 Florian Vaussard, EPFL Mobots group 2 * Copyright (C) 2014 Florian Vaussard, EPFL Mobots group
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8 8
9/* 9#include "omap34xx.dtsi"
10 * The Gumstix Overo must be combined with an expansion board. 10#include "omap3-overo-base.dtsi"
11 */
12 11
13/ { 12&omap3_pmx_core2 {
14 pwmleds { 13 pinctrl-names = "default";
15 compatible = "pwm-leds"; 14 pinctrl-0 = <
16 15 &hsusb2_2_pins
17 overo { 16 >;
18 label = "overo:blue:COM";
19 pwms = <&twl_pwmled 1 7812500>;
20 max-brightness = <127>;
21 linux,default-trigger = "mmc0";
22 };
23 };
24
25 sound {
26 compatible = "ti,omap-twl4030";
27 ti,model = "overo";
28
29 ti,mcbsp = <&mcbsp2>;
30 ti,codec = <&twl_audio>;
31 };
32};
33
34&i2c1 {
35 clock-frequency = <2600000>;
36
37 twl: twl@48 {
38 reg = <0x48>;
39 interrupts = <7>; /* SYS_NIRQ cascaded to intc */
40 interrupt-parent = <&intc>;
41 17
42 twl_audio: audio { 18 hsusb2_2_pins: pinmux_hsusb2_2_pins {
43 compatible = "ti,twl4030-audio"; 19 pinctrl-single,pins = <
44 codec { 20 OMAP3430_CORE2_IOPAD(0x25f0, PIN_OUTPUT | MUX_MODE3) /* etk_d10.hsusb2_clk */
45 }; 21 OMAP3430_CORE2_IOPAD(0x25f2, PIN_OUTPUT | MUX_MODE3) /* etk_d11.hsusb2_stp */
46 }; 22 OMAP3430_CORE2_IOPAD(0x25f4, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d12.hsusb2_dir */
23 OMAP3430_CORE2_IOPAD(0x25f6, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d13.hsusb2_nxt */
24 OMAP3430_CORE2_IOPAD(0x25f8, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d14.hsusb2_data0 */
25 OMAP3430_CORE2_IOPAD(0x25fa, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d15.hsusb2_data1 */
26 >;
47 }; 27 };
48};
49
50#include "twl4030.dtsi"
51#include "twl4030_omap3.dtsi"
52
53/* i2c2 pins are used for gpio */
54&i2c2 {
55 status = "disabled";
56};
57 28
58/* on board microSD slot */ 29 w3cbw003c_2_pins: pinmux_w3cbw003c_2_pins {
59&mmc1 {
60 vmmc-supply = <&vmmc1>;
61 bus-width = <4>;
62};
63
64/* optional on board WiFi */
65&mmc2 {
66 bus-width = <4>;
67};
68
69&twl_gpio {
70 ti,use-leds;
71};
72
73&usb_otg_hs {
74 interface-type = <0>;
75 usb-phy = <&usb2_phy>;
76 phys = <&usb2_phy>;
77 phy-names = "usb2-phy";
78 mode = <3>;
79 power = <50>;
80};
81
82&omap3_pmx_core {
83 uart3_pins: pinmux_uart3_pins {
84 pinctrl-single,pins = < 30 pinctrl-single,pins = <
85 0x16e (PIN_INPUT | PIN_OFF_WAKEUPENABLE | MUX_MODE0) /* uart3_rx_irrx.uart3_rx_irrx */ 31 OMAP3430_CORE2_IOPAD(0x25e0, PIN_OUTPUT | MUX_MODE4) /* etk_d2.gpio_16 */
86 0x170 (PIN_OUTPUT | MUX_MODE0) /* uart3_tx_irtx.uart3_tx_irtx */
87 >; 32 >;
88 }; 33 };
89}; 34};
90 35
91&uart3 { 36&mcbsp2 {
92 pinctrl-names = "default"; 37 status = "okay";
93 pinctrl-0 = <&uart3_pins>;
94}; 38};
diff --git a/arch/arm/boot/dts/omap3-sb-t35.dtsi b/arch/arm/boot/dts/omap3-sb-t35.dtsi
index b9a2fedce7ee..7909c51b05a5 100644
--- a/arch/arm/boot/dts/omap3-sb-t35.dtsi
+++ b/arch/arm/boot/dts/omap3-sb-t35.dtsi
@@ -2,11 +2,36 @@
2 * Common support for CompuLab SB-T35 used on SBC-T3530, SBC-T3517 and SBC-T3730 2 * Common support for CompuLab SB-T35 used on SBC-T3530, SBC-T3517 and SBC-T3730
3 */ 3 */
4 4
5/ {
6 vddvario_sb_t35: regulator-vddvario-sb-t35 {
7 compatible = "regulator-fixed";
8 regulator-name = "vddvario";
9 regulator-always-on;
10 };
11
12 vdd33a_sb_t35: regulator-vdd33a-sb-t35 {
13 compatible = "regulator-fixed";
14 regulator-name = "vdd33a";
15 regulator-always-on;
16 };
17};
18
19&omap3_pmx_core {
20 smsc2_pins: pinmux_smsc2_pins {
21 pinctrl-single,pins = <
22 OMAP3_CORE1_IOPAD(0x20b6, PIN_OUTPUT | MUX_MODE0) /* gpmc_ncs4.gpmc_ncs4 */
23 OMAP3_CORE1_IOPAD(0x20d2, PIN_INPUT_PULLUP | MUX_MODE4) /* gpmc_wait3.gpio_65 */
24 >;
25 };
26};
27
5&gpmc { 28&gpmc {
6 ranges = <4 0 0x2d000000 0x01000000>; 29 ranges = <4 0 0x2d000000 0x01000000>;
7 30
8 smsc2: ethernet@4,0 { 31 smsc2: ethernet@4,0 {
9 compatible = "smsc,lan9221", "smsc,lan9115"; 32 compatible = "smsc,lan9221", "smsc,lan9115";
33 pinctrl-names = "default";
34 pinctrl-0 = <&smsc2_pins>;
10 interrupt-parent = <&gpio3>; 35 interrupt-parent = <&gpio3>;
11 interrupts = <1 IRQ_TYPE_LEVEL_LOW>; 36 interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
12 reg = <4 0 0xff>; 37 reg = <4 0 0xff>;
@@ -32,8 +57,8 @@
32 gpmc,wr-access-ns = <186>; 57 gpmc,wr-access-ns = <186>;
33 gpmc,cycle2cycle-samecsen; 58 gpmc,cycle2cycle-samecsen;
34 gpmc,cycle2cycle-diffcsen; 59 gpmc,cycle2cycle-diffcsen;
35 vddvario-supply = <&vddvario>; 60 vddvario-supply = <&vddvario_sb_t35>;
36 vdd33a-supply = <&vdd33a>; 61 vdd33a-supply = <&vdd33a_sb_t35>;
37 reg-io-width = <4>; 62 reg-io-width = <4>;
38 smsc,save-mac-address; 63 smsc,save-mac-address;
39 }; 64 };
diff --git a/arch/arm/boot/dts/omap3-sbc-t3517.dts b/arch/arm/boot/dts/omap3-sbc-t3517.dts
new file mode 100644
index 000000000000..024c9c6c682d
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-sbc-t3517.dts
@@ -0,0 +1,43 @@
1/*
2 * Suppport for CompuLab SBC-T3517 with CM-T3517
3 */
4
5#include "omap3-cm-t3517.dts"
6#include "omap3-sb-t35.dtsi"
7
8/ {
9 model = "CompuLab SBC-T3517 with CM-T3517";
10 compatible = "compulab,omap3-sbc-t3517", "compulab,omap3-cm-t3517", "ti,am3517", "ti,omap3";
11};
12
13&omap3_pmx_core {
14 pinctrl-names = "default";
15 pinctrl-0 = <
16 &sb_t35_usb_hub_pins
17 &usb_hub_pins
18 >;
19
20 mmc1_aux_pins: pinmux_mmc1_aux_pins {
21 pinctrl-single,pins = <
22 OMAP3_CORE1_IOPAD(0x20c0, PIN_INPUT_PULLUP | MUX_MODE4) /* gpmc_clk.gpio_59 */
23 OMAP3_CORE1_IOPAD(0x2174, PIN_INPUT_PULLUP | MUX_MODE4) /* uart2_cts.gpio_144 */
24 >;
25 };
26
27 sb_t35_usb_hub_pins: pinmux_sb_t35_usb_hub_pins {
28 pinctrl-single,pins = <
29 OMAP3_CORE1_IOPAD(0x21ec, PIN_OUTPUT | MUX_MODE4) /* ccdc_wen.gpio_98 - SB-T35 USB HUB RST */
30 >;
31 };
32};
33
34&mmc1 {
35 pinctrl-names = "default";
36 pinctrl-0 = <
37 &mmc1_pins
38 &mmc1_aux_pins
39 >;
40
41 wp-gpios = <&gpio2 27 GPIO_ACTIVE_HIGH>; /* gpio_59 */
42 cd-gpios = <&gpio5 16 GPIO_ACTIVE_HIGH>; /* gpio_144 */
43};
diff --git a/arch/arm/boot/dts/omap3-sbc-t3530.dts b/arch/arm/boot/dts/omap3-sbc-t3530.dts
new file mode 100644
index 000000000000..bbbeea6b1988
--- /dev/null
+++ b/arch/arm/boot/dts/omap3-sbc-t3530.dts
@@ -0,0 +1,36 @@
1/*
2 * Suppport for CompuLab SBC-T3530 with CM-T3530
3 */
4
5#include "omap3-cm-t3530.dts"
6#include "omap3-sb-t35.dtsi"
7
8/ {
9 model = "CompuLab SBC-T3530 with CM-T3530";
10 compatible = "compulab,omap3-sbc-t3530", "compulab,omap3-cm-t3530", "ti,omap34xx", "ti,omap3";
11};
12
13&omap3_pmx_core {
14 pinctrl-names = "default";
15 pinctrl-0 = <&sb_t35_usb_hub_pins>;
16
17 sb_t35_usb_hub_pins: pinmux_sb_t35_usb_hub_pins {
18 pinctrl-single,pins = <
19 OMAP3_CORE1_IOPAD(0x2130, PIN_OUTPUT | MUX_MODE4) /* ccdc_wen.gpio_167 - SB-T35 USB HUB RST */
20 >;
21 };
22};
23
24/*
25 * The following ranges correspond to SMSC9x eth chips on CM-T3530 CoM and
26 * SB-T35 baseboard respectively.
27 * This setting includes both chips in SBC-T3530 board device tree.
28 */
29&gpmc {
30 ranges = <5 0 0x2c000000 0x01000000>,
31 <4 0 0x2d000000 0x01000000>;
32};
33
34&mmc1 {
35 cd-gpios = <&twl_gpio 0 GPIO_ACTIVE_HIGH>;
36};
diff --git a/arch/arm/boot/dts/omap3-sbc-t3730.dts b/arch/arm/boot/dts/omap3-sbc-t3730.dts
index c119bd545053..08e4a7086f22 100644
--- a/arch/arm/boot/dts/omap3-sbc-t3730.dts
+++ b/arch/arm/boot/dts/omap3-sbc-t3730.dts
@@ -10,21 +10,18 @@
10 compatible = "compulab,omap3-sbc-t3730", "compulab,omap3-cm-t3730", "ti,omap36xx", "ti,omap3"; 10 compatible = "compulab,omap3-sbc-t3730", "compulab,omap3-cm-t3730", "ti,omap36xx", "ti,omap3";
11}; 11};
12 12
13&gpmc { 13&omap3_pmx_core {
14 ranges = <5 0 0x2c000000 0x01000000>,
15 <4 0 0x2d000000 0x01000000>;
16};
17
18&smsc2 {
19 pinctrl-names = "default"; 14 pinctrl-names = "default";
20 pinctrl-0 = <&smsc2_pins>; 15 pinctrl-0 = <&sb_t35_usb_hub_pins>;
21};
22 16
23&omap3_pmx_core { 17 sb_t35_usb_hub_pins: pinmux_sb_t35_usb_hub_pins {
24 smsc2_pins: pinmux_smsc2_pins {
25 pinctrl-single,pins = < 18 pinctrl-single,pins = <
26 0x86 (PIN_OUTPUT | MUX_MODE0) /* gpmc_ncs4.gpmc_ncs4 */ 19 OMAP3_CORE1_IOPAD(0x2130, PIN_OUTPUT | MUX_MODE4) /* ccdc_wen.gpio_167 - SB-T35 USB HUB RST */
27 0xa2 (PIN_INPUT_PULLUP | MUX_MODE4) /* gpmc_wait3.gpio_65 */
28 >; 20 >;
29 }; 21 };
30}; \ No newline at end of file 22};
23
24&gpmc {
25 ranges = <5 0 0x2c000000 0x01000000>,
26 <4 0 0x2d000000 0x01000000>;
27};
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index a5fc83b9c835..5e5790f631eb 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -35,6 +35,11 @@
35 compatible = "arm,cortex-a8"; 35 compatible = "arm,cortex-a8";
36 device_type = "cpu"; 36 device_type = "cpu";
37 reg = <0x0>; 37 reg = <0x0>;
38
39 clocks = <&dpll1_ck>;
40 clock-names = "cpu";
41
42 clock-latency = <300000>; /* From omap-cpufreq driver */
38 }; 43 };
39 }; 44 };
40 45
@@ -176,6 +181,22 @@
176 pinctrl-single,function-mask = <0xff1f>; 181 pinctrl-single,function-mask = <0xff1f>;
177 }; 182 };
178 183
184 omap3_scm_general: tisyscon@48002270 {
185 compatible = "syscon";
186 reg = <0x48002270 0x2f0>;
187 };
188
189 pbias_regulator: pbias_regulator {
190 compatible = "ti,pbias-omap";
191 reg = <0x2b0 0x4>;
192 syscon = <&omap3_scm_general>;
193 pbias_mmc_reg: pbias_mmc_omap2430 {
194 regulator-name = "pbias_mmc_omap2430";
195 regulator-min-microvolt = <1800000>;
196 regulator-max-microvolt = <3000000>;
197 };
198 };
199
179 gpio1: gpio@48310000 { 200 gpio1: gpio@48310000 {
180 compatible = "ti,omap3-gpio"; 201 compatible = "ti,omap3-gpio";
181 reg = <0x48310000 0x200>; 202 reg = <0x48310000 0x200>;
@@ -390,6 +411,7 @@
390 ti,dual-volt; 411 ti,dual-volt;
391 dmas = <&sdma 61>, <&sdma 62>; 412 dmas = <&sdma 61>, <&sdma 62>;
392 dma-names = "tx", "rx"; 413 dma-names = "tx", "rx";
414 pbias-supply = <&pbias_mmc_reg>;
393 }; 415 };
394 416
395 mmc2: mmc@480b4000 { 417 mmc2: mmc@480b4000 {
@@ -411,10 +433,19 @@
411 }; 433 };
412 434
413 mmu_isp: mmu@480bd400 { 435 mmu_isp: mmu@480bd400 {
414 compatible = "ti,omap3-mmu-isp"; 436 compatible = "ti,omap2-iommu";
415 ti,hwmods = "mmu_isp";
416 reg = <0x480bd400 0x80>; 437 reg = <0x480bd400 0x80>;
417 interrupts = <8>; 438 interrupts = <24>;
439 ti,hwmods = "mmu_isp";
440 ti,#tlb-entries = <8>;
441 };
442
443 mmu_iva: mmu@5d000000 {
444 compatible = "ti,omap2-iommu";
445 reg = <0x5d000000 0x80>;
446 interrupts = <28>;
447 ti,hwmods = "mmu_iva";
448 status = "disabled";
418 }; 449 };
419 450
420 wdt2: wdt@48314000 { 451 wdt2: wdt@48314000 {
@@ -436,6 +467,7 @@
436 dmas = <&sdma 31>, 467 dmas = <&sdma 31>,
437 <&sdma 32>; 468 <&sdma 32>;
438 dma-names = "tx", "rx"; 469 dma-names = "tx", "rx";
470 status = "disabled";
439 }; 471 };
440 472
441 mcbsp2: mcbsp@49022000 { 473 mcbsp2: mcbsp@49022000 {
@@ -453,6 +485,7 @@
453 dmas = <&sdma 33>, 485 dmas = <&sdma 33>,
454 <&sdma 34>; 486 <&sdma 34>;
455 dma-names = "tx", "rx"; 487 dma-names = "tx", "rx";
488 status = "disabled";
456 }; 489 };
457 490
458 mcbsp3: mcbsp@49024000 { 491 mcbsp3: mcbsp@49024000 {
@@ -470,6 +503,7 @@
470 dmas = <&sdma 17>, 503 dmas = <&sdma 17>,
471 <&sdma 18>; 504 <&sdma 18>;
472 dma-names = "tx", "rx"; 505 dma-names = "tx", "rx";
506 status = "disabled";
473 }; 507 };
474 508
475 mcbsp4: mcbsp@49026000 { 509 mcbsp4: mcbsp@49026000 {
@@ -485,6 +519,7 @@
485 dmas = <&sdma 19>, 519 dmas = <&sdma 19>,
486 <&sdma 20>; 520 <&sdma 20>;
487 dma-names = "tx", "rx"; 521 dma-names = "tx", "rx";
522 status = "disabled";
488 }; 523 };
489 524
490 mcbsp5: mcbsp@48096000 { 525 mcbsp5: mcbsp@48096000 {
@@ -500,6 +535,7 @@
500 dmas = <&sdma 21>, 535 dmas = <&sdma 21>,
501 <&sdma 22>; 536 <&sdma 22>;
502 dma-names = "tx", "rx"; 537 dma-names = "tx", "rx";
538 status = "disabled";
503 }; 539 };
504 540
505 sham: sham@480c3000 { 541 sham: sham@480c3000 {
@@ -634,14 +670,14 @@
634 ranges; 670 ranges;
635 671
636 usbhsohci: ohci@48064400 { 672 usbhsohci: ohci@48064400 {
637 compatible = "ti,ohci-omap3", "usb-ohci"; 673 compatible = "ti,ohci-omap3";
638 reg = <0x48064400 0x400>; 674 reg = <0x48064400 0x400>;
639 interrupt-parent = <&intc>; 675 interrupt-parent = <&intc>;
640 interrupts = <76>; 676 interrupts = <76>;
641 }; 677 };
642 678
643 usbhsehci: ehci@48064800 { 679 usbhsehci: ehci@48064800 {
644 compatible = "ti,ehci-omap", "usb-ehci"; 680 compatible = "ti,ehci-omap";
645 reg = <0x48064800 0x400>; 681 reg = <0x48064800 0x400>;
646 interrupt-parent = <&intc>; 682 interrupt-parent = <&intc>;
647 interrupts = <77>; 683 interrupts = <77>;
@@ -669,6 +705,58 @@
669 num-eps = <16>; 705 num-eps = <16>;
670 ram-bits = <12>; 706 ram-bits = <12>;
671 }; 707 };
708
709 dss: dss@48050000 {
710 compatible = "ti,omap3-dss";
711 reg = <0x48050000 0x200>;
712 status = "disabled";
713 ti,hwmods = "dss_core";
714 clocks = <&dss1_alwon_fck>;
715 clock-names = "fck";
716 #address-cells = <1>;
717 #size-cells = <1>;
718 ranges;
719
720 dispc@48050400 {
721 compatible = "ti,omap3-dispc";
722 reg = <0x48050400 0x400>;
723 interrupts = <25>;
724 ti,hwmods = "dss_dispc";
725 clocks = <&dss1_alwon_fck>;
726 clock-names = "fck";
727 };
728
729 dsi: encoder@4804fc00 {
730 compatible = "ti,omap3-dsi";
731 reg = <0x4804fc00 0x200>,
732 <0x4804fe00 0x40>,
733 <0x4804ff00 0x20>;
734 reg-names = "proto", "phy", "pll";
735 interrupts = <25>;
736 status = "disabled";
737 ti,hwmods = "dss_dsi1";
738 clocks = <&dss1_alwon_fck>, <&dss2_alwon_fck>;
739 clock-names = "fck", "sys_clk";
740 };
741
742 rfbi: encoder@48050800 {
743 compatible = "ti,omap3-rfbi";
744 reg = <0x48050800 0x100>;
745 status = "disabled";
746 ti,hwmods = "dss_rfbi";
747 clocks = <&dss1_alwon_fck>, <&dss_ick>;
748 clock-names = "fck", "ick";
749 };
750
751 venc: encoder@48050c00 {
752 compatible = "ti,omap3-venc";
753 reg = <0x48050c00 0x100>;
754 status = "disabled";
755 ti,hwmods = "dss_venc";
756 clocks = <&dss_tv_fck>;
757 clock-names = "fck";
758 };
759 };
672 }; 760 };
673}; 761};
674 762
diff --git a/arch/arm/boot/dts/omap3430-sdp.dts b/arch/arm/boot/dts/omap3430-sdp.dts
index 281914ed0151..02f69f4a8fd3 100644
--- a/arch/arm/boot/dts/omap3430-sdp.dts
+++ b/arch/arm/boot/dts/omap3430-sdp.dts
@@ -34,6 +34,10 @@
34&mmc1 { 34&mmc1 {
35 vmmc-supply = <&vmmc1>; 35 vmmc-supply = <&vmmc1>;
36 vmmc_aux-supply = <&vsim>; 36 vmmc_aux-supply = <&vsim>;
37 /*
38 * S6-3 must be in ON position for 8 bit mode to function
39 * Else, use 4 bit mode
40 */
37 bus-width = <8>; 41 bus-width = <8>;
38}; 42};
39 43
@@ -103,9 +107,8 @@
103 #address-cells = <1>; 107 #address-cells = <1>;
104 #size-cells = <1>; 108 #size-cells = <1>;
105 reg = <1 0 0x08000000>; 109 reg = <1 0 0x08000000>;
110 ti,nand-ecc-opt = "ham1";
106 nand-bus-width = <8>; 111 nand-bus-width = <8>;
107
108 ti,nand-ecc-opt = "sw";
109 gpmc,cs-on-ns = <0>; 112 gpmc,cs-on-ns = <0>;
110 gpmc,cs-rd-off-ns = <36>; 113 gpmc,cs-rd-off-ns = <36>;
111 gpmc,cs-wr-off-ns = <36>; 114 gpmc,cs-wr-off-ns = <36>;
diff --git a/arch/arm/boot/dts/omap3430es1-clocks.dtsi b/arch/arm/boot/dts/omap3430es1-clocks.dtsi
index 02f6c7fabbec..4c22f3a7f813 100644
--- a/arch/arm/boot/dts/omap3430es1-clocks.dtsi
+++ b/arch/arm/boot/dts/omap3430es1-clocks.dtsi
@@ -82,16 +82,16 @@
82 ti,dividers = <0>, <1>, <2>, <3>, <4>, <0>, <6>, <0>, <8>; 82 ti,dividers = <0>, <1>, <2>, <3>, <4>, <0>, <6>, <0>, <8>;
83 }; 83 };
84 84
85 ssi_ssr_fck_3430es1: ssi_ssr_fck_3430es1 { 85 ssi_ssr_fck: ssi_ssr_fck_3430es1 {
86 #clock-cells = <0>; 86 #clock-cells = <0>;
87 compatible = "ti,composite-clock"; 87 compatible = "ti,composite-clock";
88 clocks = <&ssi_ssr_gate_fck_3430es1>, <&ssi_ssr_div_fck_3430es1>; 88 clocks = <&ssi_ssr_gate_fck_3430es1>, <&ssi_ssr_div_fck_3430es1>;
89 }; 89 };
90 90
91 ssi_sst_fck_3430es1: ssi_sst_fck_3430es1 { 91 ssi_sst_fck: ssi_sst_fck_3430es1 {
92 #clock-cells = <0>; 92 #clock-cells = <0>;
93 compatible = "fixed-factor-clock"; 93 compatible = "fixed-factor-clock";
94 clocks = <&ssi_ssr_fck_3430es1>; 94 clocks = <&ssi_ssr_fck>;
95 clock-mult = <1>; 95 clock-mult = <1>;
96 clock-div = <2>; 96 clock-div = <2>;
97 }; 97 };
@@ -120,7 +120,7 @@
120 clock-div = <1>; 120 clock-div = <1>;
121 }; 121 };
122 122
123 ssi_ick_3430es1: ssi_ick_3430es1 { 123 ssi_ick: ssi_ick_3430es1 {
124 #clock-cells = <0>; 124 #clock-cells = <0>;
125 compatible = "ti,omap3-no-wait-interface-clock"; 125 compatible = "ti,omap3-no-wait-interface-clock";
126 clocks = <&ssi_l4_ick>; 126 clocks = <&ssi_l4_ick>;
@@ -152,7 +152,7 @@
152 clocks = <&usb_l4_gate_ick>, <&usb_l4_div_ick>; 152 clocks = <&usb_l4_gate_ick>, <&usb_l4_div_ick>;
153 }; 153 };
154 154
155 dss1_alwon_fck_3430es1: dss1_alwon_fck_3430es1 { 155 dss1_alwon_fck: dss1_alwon_fck_3430es1 {
156 #clock-cells = <0>; 156 #clock-cells = <0>;
157 compatible = "ti,gate-clock"; 157 compatible = "ti,gate-clock";
158 clocks = <&dpll4_m4x2_ck>; 158 clocks = <&dpll4_m4x2_ck>;
@@ -161,7 +161,7 @@
161 ti,set-rate-parent; 161 ti,set-rate-parent;
162 }; 162 };
163 163
164 dss_ick_3430es1: dss_ick_3430es1 { 164 dss_ick: dss_ick_3430es1 {
165 #clock-cells = <0>; 165 #clock-cells = <0>;
166 compatible = "ti,omap3-no-wait-interface-clock"; 166 compatible = "ti,omap3-no-wait-interface-clock";
167 clocks = <&l4_ick>; 167 clocks = <&l4_ick>;
@@ -184,7 +184,7 @@
184 dss_clkdm: dss_clkdm { 184 dss_clkdm: dss_clkdm {
185 compatible = "ti,clockdomain"; 185 compatible = "ti,clockdomain";
186 clocks = <&dss_tv_fck>, <&dss_96m_fck>, <&dss2_alwon_fck>, 186 clocks = <&dss_tv_fck>, <&dss_96m_fck>, <&dss2_alwon_fck>,
187 <&dss1_alwon_fck_3430es1>, <&dss_ick_3430es1>; 187 <&dss1_alwon_fck>, <&dss_ick>;
188 }; 188 };
189 189
190 d2d_clkdm: d2d_clkdm { 190 d2d_clkdm: d2d_clkdm {
@@ -203,6 +203,6 @@
203 <&i2c1_ick>, <&uart2_ick>, <&uart1_ick>, <&gpt11_ick>, 203 <&i2c1_ick>, <&uart2_ick>, <&uart1_ick>, <&gpt11_ick>,
204 <&gpt10_ick>, <&mcbsp5_ick>, <&mcbsp1_ick>, 204 <&gpt10_ick>, <&mcbsp5_ick>, <&mcbsp1_ick>,
205 <&omapctrl_ick>, <&aes2_ick>, <&sha12_ick>, 205 <&omapctrl_ick>, <&aes2_ick>, <&sha12_ick>,
206 <&fshostusb_fck>, <&fac_ick>, <&ssi_ick_3430es1>; 206 <&fshostusb_fck>, <&fac_ick>, <&ssi_ick>;
207 }; 207 };
208}; 208};
diff --git a/arch/arm/boot/dts/omap36xx-am35xx-omap3430es2plus-clocks.dtsi b/arch/arm/boot/dts/omap36xx-am35xx-omap3430es2plus-clocks.dtsi
index af9ae5346bf2..080fb3f4e429 100644
--- a/arch/arm/boot/dts/omap36xx-am35xx-omap3430es2plus-clocks.dtsi
+++ b/arch/arm/boot/dts/omap36xx-am35xx-omap3430es2plus-clocks.dtsi
@@ -160,7 +160,7 @@
160 ti,bit-shift = <30>; 160 ti,bit-shift = <30>;
161 }; 161 };
162 162
163 dss1_alwon_fck_3430es2: dss1_alwon_fck_3430es2 { 163 dss1_alwon_fck: dss1_alwon_fck_3430es2 {
164 #clock-cells = <0>; 164 #clock-cells = <0>;
165 compatible = "ti,dss-gate-clock"; 165 compatible = "ti,dss-gate-clock";
166 clocks = <&dpll4_m4x2_ck>; 166 clocks = <&dpll4_m4x2_ck>;
@@ -169,7 +169,7 @@
169 ti,set-rate-parent; 169 ti,set-rate-parent;
170 }; 170 };
171 171
172 dss_ick_3430es2: dss_ick_3430es2 { 172 dss_ick: dss_ick_3430es2 {
173 #clock-cells = <0>; 173 #clock-cells = <0>;
174 compatible = "ti,omap3-dss-interface-clock"; 174 compatible = "ti,omap3-dss-interface-clock";
175 clocks = <&l4_ick>; 175 clocks = <&l4_ick>;
@@ -216,7 +216,7 @@
216 dss_clkdm: dss_clkdm { 216 dss_clkdm: dss_clkdm {
217 compatible = "ti,clockdomain"; 217 compatible = "ti,clockdomain";
218 clocks = <&dss_tv_fck>, <&dss_96m_fck>, <&dss2_alwon_fck>, 218 clocks = <&dss_tv_fck>, <&dss_96m_fck>, <&dss2_alwon_fck>,
219 <&dss1_alwon_fck_3430es2>, <&dss_ick_3430es2>; 219 <&dss1_alwon_fck>, <&dss_ick>;
220 }; 220 };
221 221
222 core_l4_clkdm: core_l4_clkdm { 222 core_l4_clkdm: core_l4_clkdm {
diff --git a/arch/arm/boot/dts/omap36xx-clocks.dtsi b/arch/arm/boot/dts/omap36xx-clocks.dtsi
index 2fcf253b677c..6b5280d04a0e 100644
--- a/arch/arm/boot/dts/omap36xx-clocks.dtsi
+++ b/arch/arm/boot/dts/omap36xx-clocks.dtsi
@@ -70,6 +70,26 @@
70 }; 70 };
71}; 71};
72 72
73&dpll4_m2x2_mul_ck {
74 clock-mult = <1>;
75};
76
77&dpll4_m3x2_mul_ck {
78 clock-mult = <1>;
79};
80
81&dpll4_m4x2_mul_ck {
82 ti,clock-mult = <1>;
83};
84
85&dpll4_m5x2_mul_ck {
86 clock-mult = <1>;
87};
88
89&dpll4_m6x2_mul_ck {
90 clock-mult = <1>;
91};
92
73&cm_clockdomains { 93&cm_clockdomains {
74 dpll4_clkdm: dpll4_clkdm { 94 dpll4_clkdm: dpll4_clkdm {
75 compatible = "ti,clockdomain"; 95 compatible = "ti,clockdomain";
diff --git a/arch/arm/boot/dts/omap36xx-omap3430es2plus-clocks.dtsi b/arch/arm/boot/dts/omap36xx-omap3430es2plus-clocks.dtsi
index 8ed475dd63c9..877318c28364 100644
--- a/arch/arm/boot/dts/omap36xx-omap3430es2plus-clocks.dtsi
+++ b/arch/arm/boot/dts/omap36xx-omap3430es2plus-clocks.dtsi
@@ -25,16 +25,16 @@
25 ti,dividers = <0>, <1>, <2>, <3>, <4>, <0>, <6>, <0>, <8>; 25 ti,dividers = <0>, <1>, <2>, <3>, <4>, <0>, <6>, <0>, <8>;
26 }; 26 };
27 27
28 ssi_ssr_fck_3430es2: ssi_ssr_fck_3430es2 { 28 ssi_ssr_fck: ssi_ssr_fck_3430es2 {
29 #clock-cells = <0>; 29 #clock-cells = <0>;
30 compatible = "ti,composite-clock"; 30 compatible = "ti,composite-clock";
31 clocks = <&ssi_ssr_gate_fck_3430es2>, <&ssi_ssr_div_fck_3430es2>; 31 clocks = <&ssi_ssr_gate_fck_3430es2>, <&ssi_ssr_div_fck_3430es2>;
32 }; 32 };
33 33
34 ssi_sst_fck_3430es2: ssi_sst_fck_3430es2 { 34 ssi_sst_fck: ssi_sst_fck_3430es2 {
35 #clock-cells = <0>; 35 #clock-cells = <0>;
36 compatible = "fixed-factor-clock"; 36 compatible = "fixed-factor-clock";
37 clocks = <&ssi_ssr_fck_3430es2>; 37 clocks = <&ssi_ssr_fck>;
38 clock-mult = <1>; 38 clock-mult = <1>;
39 clock-div = <2>; 39 clock-div = <2>;
40 }; 40 };
@@ -55,7 +55,7 @@
55 clock-div = <1>; 55 clock-div = <1>;
56 }; 56 };
57 57
58 ssi_ick_3430es2: ssi_ick_3430es2 { 58 ssi_ick: ssi_ick_3430es2 {
59 #clock-cells = <0>; 59 #clock-cells = <0>;
60 compatible = "ti,omap3-ssi-interface-clock"; 60 compatible = "ti,omap3-ssi-interface-clock";
61 clocks = <&ssi_l4_ick>; 61 clocks = <&ssi_l4_ick>;
@@ -193,6 +193,6 @@
193 <&i2c1_ick>, <&uart2_ick>, <&uart1_ick>, <&gpt11_ick>, 193 <&i2c1_ick>, <&uart2_ick>, <&uart1_ick>, <&gpt11_ick>,
194 <&gpt10_ick>, <&mcbsp5_ick>, <&mcbsp1_ick>, 194 <&gpt10_ick>, <&mcbsp5_ick>, <&mcbsp1_ick>,
195 <&omapctrl_ick>, <&aes2_ick>, <&sha12_ick>, 195 <&omapctrl_ick>, <&aes2_ick>, <&sha12_ick>,
196 <&ssi_ick_3430es2>; 196 <&ssi_ick>;
197 }; 197 };
198}; 198};
diff --git a/arch/arm/boot/dts/omap36xx.dtsi b/arch/arm/boot/dts/omap36xx.dtsi
index 7e8dee9175d6..22cf4647087e 100644
--- a/arch/arm/boot/dts/omap36xx.dtsi
+++ b/arch/arm/boot/dts/omap36xx.dtsi
@@ -39,6 +39,26 @@
39 clock-frequency = <48000000>; 39 clock-frequency = <48000000>;
40 }; 40 };
41 41
42 abb_mpu_iva: regulator-abb-mpu {
43 compatible = "ti,abb-v1";
44 regulator-name = "abb_mpu_iva";
45 #address-cell = <0>;
46 #size-cells = <0>;
47 reg = <0x483072f0 0x8>, <0x48306818 0x4>;
48 reg-names = "base-address", "int-address";
49 ti,tranxdone-status-mask = <0x4000000>;
50 clocks = <&sys_ck>;
51 ti,settling-time = <30>;
52 ti,clock-cycles = <8>;
53 ti,abb_info = <
54 /*uV ABB efuse rbb_m fbb_m vset_m*/
55 1012500 0 0 0 0 0
56 1200000 0 0 0 0 0
57 1325000 0 0 0 0 0
58 1375000 1 0 0 0 0
59 >;
60 };
61
42 omap3_pmx_core2: pinmux@480025a0 { 62 omap3_pmx_core2: pinmux@480025a0 {
43 compatible = "ti,omap3-padconf", "pinctrl-single"; 63 compatible = "ti,omap3-padconf", "pinctrl-single";
44 reg = <0x480025a0 0x5c>; 64 reg = <0x480025a0 0x5c>;
@@ -52,7 +72,13 @@
52 }; 72 };
53}; 73};
54 74
55/include/ "omap36xx-clocks.dtsi" 75/* OMAP3630 needs dss_96m_fck for VENC */
76&venc {
77 clocks = <&dss_tv_fck>, <&dss_96m_fck>;
78 clock-names = "fck", "tv_dac_clk";
79};
80
56/include/ "omap34xx-omap36xx-clocks.dtsi" 81/include/ "omap34xx-omap36xx-clocks.dtsi"
57/include/ "omap36xx-omap3430es2plus-clocks.dtsi" 82/include/ "omap36xx-omap3430es2plus-clocks.dtsi"
58/include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi" 83/include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi"
84/include/ "omap36xx-clocks.dtsi"
diff --git a/arch/arm/boot/dts/omap3xxx-clocks.dtsi b/arch/arm/boot/dts/omap3xxx-clocks.dtsi
index cb04d4b37e7f..12be2b35dae9 100644
--- a/arch/arm/boot/dts/omap3xxx-clocks.dtsi
+++ b/arch/arm/boot/dts/omap3xxx-clocks.dtsi
@@ -425,10 +425,11 @@
425 425
426 dpll4_m4x2_mul_ck: dpll4_m4x2_mul_ck { 426 dpll4_m4x2_mul_ck: dpll4_m4x2_mul_ck {
427 #clock-cells = <0>; 427 #clock-cells = <0>;
428 compatible = "fixed-factor-clock"; 428 compatible = "ti,fixed-factor-clock";
429 clocks = <&dpll4_m4_ck>; 429 clocks = <&dpll4_m4_ck>;
430 clock-mult = <2>; 430 ti,clock-mult = <2>;
431 clock-div = <1>; 431 ti,clock-div = <1>;
432 ti,set-rate-parent;
432 }; 433 };
433 434
434 dpll4_m4x2_ck: dpll4_m4x2_ck { 435 dpll4_m4x2_ck: dpll4_m4x2_ck {
@@ -438,6 +439,7 @@
438 ti,bit-shift = <0x1d>; 439 ti,bit-shift = <0x1d>;
439 reg = <0x0d00>; 440 reg = <0x0d00>;
440 ti,set-bit-to-disable; 441 ti,set-bit-to-disable;
442 ti,set-rate-parent;
441 }; 443 };
442 444
443 dpll4_m5_ck: dpll4_m5_ck { 445 dpll4_m5_ck: dpll4_m5_ck {
diff --git a/arch/arm/boot/dts/omap4-duovero-parlor.dts b/arch/arm/boot/dts/omap4-duovero-parlor.dts
new file mode 100644
index 000000000000..96f51d870812
--- /dev/null
+++ b/arch/arm/boot/dts/omap4-duovero-parlor.dts
@@ -0,0 +1,146 @@
1/*
2 * Copyright (C) 2014 Florian Vaussard, 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8/dts-v1/;
9
10#include "omap4-duovero.dtsi"
11
12#include <dt-bindings/input/input.h>
13
14/ {
15 model = "OMAP4430 Gumstix Duovero on Parlor";
16 compatible = "gumstix,omap4-duovero-parlor", "gumstix,omap4-duovero", "ti,omap4430", "ti,omap4";
17
18 leds {
19 compatible = "gpio-leds";
20 led0 {
21 label = "duovero:blue:led0";
22 gpios = <&gpio4 26 GPIO_ACTIVE_HIGH>; /* gpio_122 */
23 linux,default-trigger = "heartbeat";
24 };
25 };
26
27 gpio_keys {
28 compatible = "gpio-keys";
29 #address-cells = <1>;
30 #size-cells = <0>;
31 button0@121 {
32 label = "button0";
33 linux,code = <BTN_0>;
34 gpios = <&gpio4 25 GPIO_ACTIVE_LOW>; /* gpio_121 */
35 gpio-key,wakeup;
36 };
37 };
38};
39
40&omap4_pmx_core {
41 pinctrl-0 = <
42 &led_pins
43 &button_pins
44 &smsc_pins
45 >;
46
47 led_pins: pinmux_led_pins {
48 pinctrl-single,pins = <
49 0xd6 (PIN_OUTPUT | MUX_MODE3) /* abe_dmic_din3.gpio_122 */
50 >;
51 };
52
53 button_pins: pinmux_button_pins {
54 pinctrl-single,pins = <
55 0xd4 (PIN_INPUT_PULLUP | MUX_MODE3) /* abe_dmic_din2.gpio_121 */
56 >;
57 };
58
59 i2c2_pins: pinmux_i2c2_pins {
60 pinctrl-single,pins = <
61 0xe6 (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c2_scl */
62 0xe8 (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c2_sda */
63 >;
64 };
65
66 i2c3_pins: pinmux_i2c3_pins {
67 pinctrl-single,pins = <
68 0xea (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c3_scl */
69 0xec (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c3_sda */
70 >;
71 };
72
73 smsc_pins: pinmux_smsc_pins {
74 pinctrl-single,pins = <
75 0x28 (PIN_INPUT | MUX_MODE3) /* gpmc_a20.gpio_44: IRQ */
76 0x2a (PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_a21.gpio_45: nReset */
77 0x30 (PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_a24.gpio_48: amdix enabled */
78 >;
79 };
80};
81
82&i2c2 {
83 pinctrl-names = "default";
84 pinctrl-0 = <&i2c2_pins>;
85
86 clock-frequency = <400000>;
87};
88
89&i2c3 {
90 pinctrl-names = "default";
91 pinctrl-0 = <&i2c3_pins>;
92
93 clock-frequency = <100000>;
94
95 /* optional 1K EEPROM with revision information */
96 eeprom@51 {
97 compatible = "atmel,24c01";
98 reg = <0x51>;
99 pagesize = <8>;
100 };
101};
102
103&mmc3 {
104 status = "disabled";
105};
106
107#include "omap-gpmc-smsc911x.dtsi"
108
109&gpmc {
110 ranges = <5 0 0x2c000000 0x1000000>; /* CS5 */
111
112 ethernet@gpmc {
113 reg = <5 0 0xff>;
114 interrupt-parent = <&gpio2>;
115 interrupts = <12 IRQ_TYPE_LEVEL_LOW>; /* gpio_44 */
116
117 phy-mode = "mii";
118
119 gpmc,cs-on-ns = <10>;
120 gpmc,cs-rd-off-ns = <50>;
121 gpmc,cs-wr-off-ns = <50>;
122 gpmc,adv-on-ns = <0>;
123 gpmc,adv-rd-off-ns = <10>;
124 gpmc,adv-wr-off-ns = <10>;
125 gpmc,oe-on-ns = <15>;
126 gpmc,oe-off-ns = <50>;
127 gpmc,we-on-ns = <15>;
128 gpmc,we-off-ns = <50>;
129 gpmc,rd-cycle-ns = <50>;
130 gpmc,wr-cycle-ns = <50>;
131 gpmc,access-ns = <50>;
132 gpmc,page-burst-access-ns = <0>;
133 gpmc,bus-turnaround-ns = <35>;
134 gpmc,cycle2cycle-delay-ns = <35>;
135 gpmc,wr-data-mux-bus-ns = <35>;
136 gpmc,wr-access-ns = <50>;
137
138 gpmc,mux-add-data = <2>;
139 gpmc,sync-read;
140 gpmc,sync-write;
141 gpmc,clk-activation-ns = <5>;
142 gpmc,sync-clk-ps = <20000>;
143 };
144};
145
146
diff --git a/arch/arm/boot/dts/omap4-duovero.dtsi b/arch/arm/boot/dts/omap4-duovero.dtsi
new file mode 100644
index 000000000000..a514791154eb
--- /dev/null
+++ b/arch/arm/boot/dts/omap4-duovero.dtsi
@@ -0,0 +1,252 @@
1/*
2 * Copyright (C) 2014 Florian Vaussard, 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 version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#include "omap443x.dtsi"
10
11/ {
12 model = "Gumstix Duovero";
13 compatible = "gumstix,omap4-duovero", "ti,omap4430", "ti,omap4";
14
15 memory {
16 device_type = "memory";
17 reg = <0x80000000 0x40000000>; /* 1 GB */
18 };
19
20 sound {
21 compatible = "ti,abe-twl6040";
22 ti,model = "DuoVero";
23
24 ti,mclk-freq = <38400000>;
25
26 ti,mcpdm = <&mcpdm>;
27
28 ti,twl6040 = <&twl6040>;
29
30 /* Audio routing */
31 ti,audio-routing =
32 "Headset Stereophone", "HSOL",
33 "Headset Stereophone", "HSOR",
34 "HSMIC", "Headset Mic",
35 "Headset Mic", "Headset Mic Bias";
36 };
37
38 /* HS USB Host PHY on PORT 1 */
39 hsusb1_phy: hsusb1_phy {
40 compatible = "usb-nop-xceiv";
41 reset-gpios = <&gpio2 30 GPIO_ACTIVE_LOW>; /* gpio_62 */
42
43 pinctrl-names = "default";
44 pinctrl-0 = <&hsusb1phy_pins>;
45
46 clocks = <&auxclk3_ck>;
47 clock-names = "main_clk";
48 clock-frequency = <19200000>;
49 };
50
51 /* regulator for w2cbw0015 on sdio5 */
52 w2cbw0015_vmmc: w2cbw0015_vmmc {
53 pinctrl-names = "default";
54 pinctrl-0 = <&w2cbw0015_pins>;
55 compatible = "regulator-fixed";
56 regulator-name = "w2cbw0015";
57 regulator-min-microvolt = <3000000>;
58 regulator-max-microvolt = <3000000>;
59 gpio = <&gpio2 11 GPIO_ACTIVE_LOW>; /* gpio_43 */
60 startup-delay-us = <70000>;
61 enable-active-high;
62 regulator-boot-on;
63 };
64};
65
66&omap4_pmx_core {
67 pinctrl-names = "default";
68 pinctrl-0 = <
69 &twl6040_pins
70 &mcpdm_pins
71 &mcbsp1_pins
72 &hsusbb1_pins
73 >;
74
75 twl6040_pins: pinmux_twl6040_pins {
76 pinctrl-single,pins = <
77 0x126 (PIN_OUTPUT | MUX_MODE3) /* usbb2_ulpitll_nxt.gpio_160 */
78 0x160 (PIN_INPUT | MUX_MODE0) /* sys_nirq2.sys_nirq2 */
79 >;
80 };
81
82 mcpdm_pins: pinmux_mcpdm_pins {
83 pinctrl-single,pins = <
84 0xc6 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* abe_pdm_ul_data.abe_pdm_ul_data */
85 0xc8 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* abe_pdm_dl_data.abe_pdm_dl_data */
86 0xca (PIN_INPUT_PULLUP | MUX_MODE0) /* abe_pdm_frame.abe_pdm_frame */
87 0xcc (PIN_INPUT_PULLDOWN | MUX_MODE0) /* abe_pdm_lb_clk.abe_pdm_lb_clk */
88 0xce (PIN_INPUT_PULLDOWN | MUX_MODE0) /* abe_clks.abe_clks */
89 >;
90 };
91
92 mcbsp1_pins: pinmux_mcbsp1_pins {
93 pinctrl-single,pins = <
94 0xbe (PIN_INPUT | MUX_MODE0) /* abe_mcbsp1_clkx.abe_mcbsp1_clkx */
95 0xc0 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* abe_mcbsp1_dr.abe_mcbsp1_dr */
96 0xc2 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* abe_mcbsp1_dx.abe_mcbsp1_dx */
97 0xc4 (PIN_INPUT | MUX_MODE0) /* abe_mcbsp1_fsx.abe_mcbsp1_fsx */
98 >;
99 };
100
101 hsusbb1_pins: pinmux_hsusbb1_pins {
102 pinctrl-single,pins = <
103 0x82 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* usbb1_ulpitll_clk.usbb1_ulpiphy_clk */
104 0x84 (PIN_OUTPUT | MUX_MODE4) /* usbb1_ulpitll_stp.usbb1_ulpiphy_stp */
105 0x86 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* usbb1_ulpitll_dir.usbb1_ulpiphy_dir */
106 0x88 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* usbb1_ulpitll_nxt.usbb1_ulpiphy_nxt */
107 0x8a (PIN_INPUT_PULLDOWN | MUX_MODE4) /* usbb1_ulpitll_dat0.usbb1_ulpiphy_dat0 */
108 0x8c (PIN_INPUT_PULLDOWN | MUX_MODE4) /* usbb1_ulpitll_dat1.usbb1_ulpiphy_dat1 */
109 0x8e (PIN_INPUT_PULLDOWN | MUX_MODE4) /* usbb1_ulpitll_dat2.usbb1_ulpiphy_dat2 */
110 0x90 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* usbb1_ulpitll_dat3.usbb1_ulpiphy_dat3 */
111 0x92 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* usbb1_ulpitll_dat4.usbb1_ulpiphy_dat4 */
112 0x94 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* usbb1_ulpitll_dat5.usbb1_ulpiphy_dat5 */
113 0x96 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* usbb1_ulpitll_dat6.usbb1_ulpiphy_dat6 */
114 0x98 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* usbb1_ulpitll_dat7.usbb1_ulpiphy_dat7 */
115 >;
116 };
117
118 hsusb1phy_pins: pinmux_hsusb1phy_pins {
119 pinctrl-single,pins = <
120 0x4c (PIN_OUTPUT | MUX_MODE3) /* gpmc_wait1.gpio_62 */
121 >;
122 };
123
124 w2cbw0015_pins: pinmux_w2cbw0015_pins {
125 pinctrl-single,pins = <
126 0x26 (PIN_OUTPUT | MUX_MODE3) /* gpmc_a19.gpio_43 */
127 0x3a (PIN_INPUT | MUX_MODE3) /* gpmc_ncs3.gpio_53 */
128 >;
129 };
130
131 i2c1_pins: pinmux_i2c1_pins {
132 pinctrl-single,pins = <
133 0xe2 (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c1_scl */
134 0xe4 (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c1_sda */
135 >;
136 };
137
138 i2c4_pins: pinmux_i2c4_pins {
139 pinctrl-single,pins = <
140 0xee (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c4_scl */
141 0xf0 (PIN_INPUT_PULLUP | MUX_MODE0) /* i2c4_sda */
142 >;
143 };
144
145 mmc1_pins: pinmux_mmc1_pins {
146 pinctrl-single,pins = <
147 0xa2 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_clk */
148 0xa4 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmcc1_cmd */
149 0xa6 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmcc1_dat0 */
150 0xa8 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat1 */
151 0xaa (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat2 */
152 0xac (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc1_dat3 */
153 >;
154 };
155
156 mmc5_pins: pinmux_mmc5_pins {
157 pinctrl-single,pins = <
158 0x108 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_clk */
159 0x10a (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmcc5_cmd */
160 0x10c (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmcc5_dat0 */
161 0x10e (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat1 */
162 0x110 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat2 */
163 0x112 (PIN_INPUT_PULLUP | MUX_MODE0) /* sdmmc5_dat3 */
164 >;
165 };
166};
167
168/* PMIC */
169&i2c1 {
170 pinctrl-names = "default";
171 pinctrl-0 = <&i2c1_pins>;
172
173 clock-frequency = <400000>;
174
175 twl: twl@48 {
176 reg = <0x48>;
177 interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; /* IRQ_SYS_1N cascaded to gic */
178 interrupt-parent = <&gic>;
179 };
180
181 twl6040: twl@4b {
182 compatible = "ti,twl6040";
183 reg = <0x4b>;
184 interrupts = <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>; /* IRQ_SYS_2N cascaded to gic */
185 interrupt-parent = <&gic>;
186 ti,audpwron-gpio = <&gpio6 0 GPIO_ACTIVE_HIGH>; /* gpio_160 */
187
188 vio-supply = <&v1v8>;
189 v2v1-supply = <&v2v1>;
190 enable-active-high;
191 };
192};
193
194#include "twl6030.dtsi"
195#include "twl6030_omap4.dtsi"
196
197/* on-board bluetooth / WiFi module */
198&i2c4 {
199 pinctrl-names = "default";
200 pinctrl-0 = <&i2c4_pins>;
201
202 clock-frequency = <400000>;
203};
204
205&mmc1 {
206 pinctrl-names = "default";
207 pinctrl-0 = <&mmc1_pins>;
208
209 vmmc-supply = <&vmmc>;
210 ti,bus-width = <4>;
211 ti,non-removable; /* FIXME: use PMIC_MMC detect */
212};
213
214&mmc2 {
215 status = "disabled";
216};
217
218/* mmc3 is available to the expansion board */
219
220&mmc4 {
221 status = "disabled";
222};
223
224/* on-board WiFi module */
225&mmc5 {
226 pinctrl-names = "default";
227 pinctrl-0 = <&mmc5_pins>;
228
229 vmmc-supply = <&w2cbw0015_vmmc>;
230 ti,bus-width = <4>;
231 ti,non-removable;
232 cap-power-off-card;
233};
234
235&twl_usb_comparator {
236 usb-supply = <&vusb>;
237};
238
239&usb_otg_hs {
240 interface-type = <1>;
241 mode = <3>;
242 power = <50>;
243};
244
245&usbhshost {
246 port1-mode = "ehci-phy";
247};
248
249&usbhsehci {
250 phys = <&hsusb1_phy>;
251};
252
diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi
index 88c6a05cab41..d2c45bfaaa2c 100644
--- a/arch/arm/boot/dts/omap4-panda-common.dtsi
+++ b/arch/arm/boot/dts/omap4-panda-common.dtsi
@@ -16,6 +16,11 @@
16 reg = <0x80000000 0x40000000>; /* 1 GB */ 16 reg = <0x80000000 0x40000000>; /* 1 GB */
17 }; 17 };
18 18
19 aliases {
20 display0 = &dvi0;
21 display1 = &hdmi0;
22 };
23
19 leds: leds { 24 leds: leds {
20 compatible = "gpio-leds"; 25 compatible = "gpio-leds";
21 pinctrl-names = "default"; 26 pinctrl-names = "default";
@@ -83,12 +88,8 @@
83 compatible = "usb-nop-xceiv"; 88 compatible = "usb-nop-xceiv";
84 reset-gpios = <&gpio2 30 GPIO_ACTIVE_LOW>; /* gpio_62 */ 89 reset-gpios = <&gpio2 30 GPIO_ACTIVE_LOW>; /* gpio_62 */
85 vcc-supply = <&hsusb1_power>; 90 vcc-supply = <&hsusb1_power>;
86 /** 91 clocks = <&auxclk3_ck>;
87 * FIXME: 92 clock-names = "main_clk";
88 * put the right clock phandle here when available
89 * clocks = <&auxclk3>;
90 * clock-names = "main_clk";
91 */
92 clock-frequency = <19200000>; 93 clock-frequency = <19200000>;
93 }; 94 };
94 95
@@ -104,14 +105,94 @@
104 startup-delay-us = <70000>; 105 startup-delay-us = <70000>;
105 enable-active-high; 106 enable-active-high;
106 }; 107 };
108
109 tfp410: encoder@0 {
110 compatible = "ti,tfp410";
111 powerdown-gpios = <&gpio1 0 GPIO_ACTIVE_LOW>; /* gpio_0 */
112
113 ports {
114 #address-cells = <1>;
115 #size-cells = <0>;
116
117 port@0 {
118 reg = <0>;
119
120 tfp410_in: endpoint@0 {
121 remote-endpoint = <&dpi_out>;
122 };
123 };
124
125 port@1 {
126 reg = <1>;
127
128 tfp410_out: endpoint@0 {
129 remote-endpoint = <&dvi_connector_in>;
130 };
131 };
132 };
133 };
134
135 dvi0: connector@0 {
136 compatible = "dvi-connector";
137 label = "dvi";
138
139 digital;
140
141 ddc-i2c-bus = <&i2c3>;
142
143 port {
144 dvi_connector_in: endpoint {
145 remote-endpoint = <&tfp410_out>;
146 };
147 };
148 };
149
150 tpd12s015: encoder@1 {
151 compatible = "ti,tpd12s015";
152
153 gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>, /* 60, CT CP HPD */
154 <&gpio2 9 GPIO_ACTIVE_HIGH>, /* 41, LS OE */
155 <&gpio2 31 GPIO_ACTIVE_HIGH>; /* 63, HPD */
156
157 ports {
158 #address-cells = <1>;
159 #size-cells = <0>;
160
161 port@0 {
162 reg = <0>;
163
164 tpd12s015_in: endpoint@0 {
165 remote-endpoint = <&hdmi_out>;
166 };
167 };
168
169 port@1 {
170 reg = <1>;
171
172 tpd12s015_out: endpoint@0 {
173 remote-endpoint = <&hdmi_connector_in>;
174 };
175 };
176 };
177 };
178
179 hdmi0: connector@1 {
180 compatible = "hdmi-connector";
181 label = "hdmi";
182
183 type = "a";
184
185 port {
186 hdmi_connector_in: endpoint {
187 remote-endpoint = <&tpd12s015_out>;
188 };
189 };
190 };
107}; 191};
108 192
109&omap4_pmx_core { 193&omap4_pmx_core {
110 pinctrl-names = "default"; 194 pinctrl-names = "default";
111 pinctrl-0 = < 195 pinctrl-0 = <
112 &twl6040_pins
113 &mcpdm_pins
114 &mcbsp1_pins
115 &dss_dpi_pins 196 &dss_dpi_pins
116 &tfp410_pins 197 &tfp410_pins
117 &dss_hdmi_pins 198 &dss_hdmi_pins
@@ -300,6 +381,10 @@
300 twl6040: twl@4b { 381 twl6040: twl@4b {
301 compatible = "ti,twl6040"; 382 compatible = "ti,twl6040";
302 reg = <0x4b>; 383 reg = <0x4b>;
384
385 pinctrl-names = "default";
386 pinctrl-0 = <&twl6040_pins>;
387
303 /* IRQ# = 119 */ 388 /* IRQ# = 119 */
304 interrupts = <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>; /* IRQ_SYS_2N cascaded to gic */ 389 interrupts = <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>; /* IRQ_SYS_2N cascaded to gic */
305 interrupt-parent = <&gic>; 390 interrupt-parent = <&gic>;
@@ -380,16 +465,16 @@
380 device-handle = <&elpida_ECB240ABACN>; 465 device-handle = <&elpida_ECB240ABACN>;
381}; 466};
382 467
383&mcbsp2 { 468&mcbsp1 {
384 status = "disabled"; 469 pinctrl-names = "default";
385}; 470 pinctrl-0 = <&mcbsp1_pins>;
386 471 status = "okay";
387&mcbsp3 {
388 status = "disabled";
389}; 472};
390 473
391&dmic { 474&mcpdm {
392 status = "disabled"; 475 pinctrl-names = "default";
476 pinctrl-0 = <&mcpdm_pins>;
477 status = "okay";
393}; 478};
394 479
395&twl_usb_comparator { 480&twl_usb_comparator {
@@ -409,3 +494,30 @@
409&usbhsehci { 494&usbhsehci {
410 phys = <&hsusb1_phy>; 495 phys = <&hsusb1_phy>;
411}; 496};
497
498&dss {
499 status = "ok";
500
501 port {
502 dpi_out: endpoint {
503 remote-endpoint = <&tfp410_in>;
504 data-lines = <24>;
505 };
506 };
507};
508
509&dsi2 {
510 status = "ok";
511 vdd-supply = <&vcxio>;
512};
513
514&hdmi {
515 status = "ok";
516 vdda-supply = <&vdac>;
517
518 port {
519 hdmi_out: endpoint {
520 remote-endpoint = <&tpd12s015_in>;
521 };
522 };
523};
diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts
index dbc81fb6ef03..48983c8d56c2 100644
--- a/arch/arm/boot/dts/omap4-sdp.dts
+++ b/arch/arm/boot/dts/omap4-sdp.dts
@@ -19,6 +19,12 @@
19 reg = <0x80000000 0x40000000>; /* 1 GB */ 19 reg = <0x80000000 0x40000000>; /* 1 GB */
20 }; 20 };
21 21
22 aliases {
23 display0 = &lcd0;
24 display1 = &lcd1;
25 display2 = &hdmi0;
26 };
27
22 vdd_eth: fixedregulator-vdd-eth { 28 vdd_eth: fixedregulator-vdd-eth {
23 compatible = "regulator-fixed"; 29 compatible = "regulator-fixed";
24 regulator-name = "VDD_ETH"; 30 regulator-name = "VDD_ETH";
@@ -153,16 +159,53 @@
153 startup-delay-us = <70000>; 159 startup-delay-us = <70000>;
154 enable-active-high; 160 enable-active-high;
155 }; 161 };
162
163 tpd12s015: encoder@0 {
164 compatible = "ti,tpd12s015";
165
166 gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>, /* 60, CT CP HPD */
167 <&gpio2 9 GPIO_ACTIVE_HIGH>, /* 41, LS OE */
168 <&gpio2 31 GPIO_ACTIVE_HIGH>; /* 63, HPD */
169
170 ports {
171 #address-cells = <1>;
172 #size-cells = <0>;
173
174 port@0 {
175 reg = <0>;
176
177 tpd12s015_in: endpoint@0 {
178 remote-endpoint = <&hdmi_out>;
179 };
180 };
181
182 port@1 {
183 reg = <1>;
184
185 tpd12s015_out: endpoint@0 {
186 remote-endpoint = <&hdmi_connector_in>;
187 };
188 };
189 };
190 };
191
192 hdmi0: connector@0 {
193 compatible = "hdmi-connector";
194 label = "hdmi";
195
196 type = "c";
197
198 port {
199 hdmi_connector_in: endpoint {
200 remote-endpoint = <&tpd12s015_out>;
201 };
202 };
203 };
156}; 204};
157 205
158&omap4_pmx_core { 206&omap4_pmx_core {
159 pinctrl-names = "default"; 207 pinctrl-names = "default";
160 pinctrl-0 = < 208 pinctrl-0 = <
161 &twl6040_pins
162 &mcpdm_pins
163 &dmic_pins
164 &mcbsp1_pins
165 &mcbsp2_pins
166 &dss_hdmi_pins 209 &dss_hdmi_pins
167 &tpd12s015_pins 210 &tpd12s015_pins
168 >; 211 >;
@@ -326,6 +369,10 @@
326 twl6040: twl@4b { 369 twl6040: twl@4b {
327 compatible = "ti,twl6040"; 370 compatible = "ti,twl6040";
328 reg = <0x4b>; 371 reg = <0x4b>;
372
373 pinctrl-names = "default";
374 pinctrl-0 = <&twl6040_pins>;
375
329 /* SPI = 0, IRQ# = 119, 4 = active high level-sensitive */ 376 /* SPI = 0, IRQ# = 119, 4 = active high level-sensitive */
330 interrupts = <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>; /* IRQ_SYS_2N cascaded to gic */ 377 interrupts = <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>; /* IRQ_SYS_2N cascaded to gic */
331 interrupt-parent = <&gic>; 378 interrupt-parent = <&gic>;
@@ -537,8 +584,28 @@
537 pinctrl-0 = <&uart4_pins>; 584 pinctrl-0 = <&uart4_pins>;
538}; 585};
539 586
540&mcbsp3 { 587&mcbsp1 {
541 status = "disabled"; 588 pinctrl-names = "default";
589 pinctrl-0 = <&mcbsp1_pins>;
590 status = "okay";
591};
592
593&mcbsp2 {
594 pinctrl-names = "default";
595 pinctrl-0 = <&mcbsp2_pins>;
596 status = "okay";
597};
598
599&dmic {
600 pinctrl-names = "default";
601 pinctrl-0 = <&dmic_pins>;
602 status = "okay";
603};
604
605&mcpdm {
606 pinctrl-names = "default";
607 pinctrl-0 = <&mcpdm_pins>;
608 status = "okay";
542}; 609};
543 610
544&twl_usb_comparator { 611&twl_usb_comparator {
@@ -550,3 +617,68 @@
550 mode = <3>; 617 mode = <3>;
551 power = <50>; 618 power = <50>;
552}; 619};
620
621&dss {
622 status = "ok";
623};
624
625&dsi1 {
626 status = "ok";
627 vdd-supply = <&vcxio>;
628
629 port {
630 dsi1_out_ep: endpoint {
631 remote-endpoint = <&lcd0_in>;
632 lanes = <0 1 2 3 4 5>;
633 };
634 };
635
636 lcd0: display {
637 compatible = "tpo,taal", "panel-dsi-cm";
638 label = "lcd0";
639
640 reset-gpios = <&gpio4 6 GPIO_ACTIVE_HIGH>; /* 102 */
641
642 port {
643 lcd0_in: endpoint {
644 remote-endpoint = <&dsi1_out_ep>;
645 };
646 };
647 };
648};
649
650&dsi2 {
651 status = "ok";
652 vdd-supply = <&vcxio>;
653
654 port {
655 dsi2_out_ep: endpoint {
656 remote-endpoint = <&lcd1_in>;
657 lanes = <0 1 2 3 4 5>;
658 };
659 };
660
661 lcd1: display {
662 compatible = "tpo,taal", "panel-dsi-cm";
663 label = "lcd1";
664
665 reset-gpios = <&gpio4 8 GPIO_ACTIVE_HIGH>; /* 104 */
666
667 port {
668 lcd1_in: endpoint {
669 remote-endpoint = <&dsi2_out_ep>;
670 };
671 };
672 };
673};
674
675&hdmi {
676 status = "ok";
677 vdda-supply = <&vdac>;
678
679 port {
680 hdmi_out: endpoint {
681 remote-endpoint = <&tpd12s015_in>;
682 };
683 };
684};
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index d3f8a6e8ca20..27fcac874742 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -36,6 +36,11 @@
36 device_type = "cpu"; 36 device_type = "cpu";
37 next-level-cache = <&L2>; 37 next-level-cache = <&L2>;
38 reg = <0x0>; 38 reg = <0x0>;
39
40 clocks = <&dpll_mpu_ck>;
41 clock-names = "cpu";
42
43 clock-latency = <300000>; /* From omap-cpufreq driver */
39 }; 44 };
40 cpu@1 { 45 cpu@1 {
41 compatible = "arm,cortex-a9"; 46 compatible = "arm,cortex-a9";
@@ -186,6 +191,22 @@
186 pinctrl-single,function-mask = <0x7fff>; 191 pinctrl-single,function-mask = <0x7fff>;
187 }; 192 };
188 193
194 omap4_padconf_global: tisyscon@4a1005a0 {
195 compatible = "syscon";
196 reg = <0x4a1005a0 0x170>;
197 };
198
199 pbias_regulator: pbias_regulator {
200 compatible = "ti,pbias-omap";
201 reg = <0x60 0x4>;
202 syscon = <&omap4_padconf_global>;
203 pbias_mmc_reg: pbias_mmc_omap4 {
204 regulator-name = "pbias_mmc_omap4";
205 regulator-min-microvolt = <1800000>;
206 regulator-max-microvolt = <3000000>;
207 };
208 };
209
189 sdma: dma-controller@4a056000 { 210 sdma: dma-controller@4a056000 {
190 compatible = "ti,omap4430-sdma"; 211 compatible = "ti,omap4430-sdma";
191 reg = <0x4a056000 0x1000>; 212 reg = <0x4a056000 0x1000>;
@@ -275,6 +296,8 @@
275 gpmc,num-waitpins = <4>; 296 gpmc,num-waitpins = <4>;
276 ti,hwmods = "gpmc"; 297 ti,hwmods = "gpmc";
277 ti,no-idle-on-init; 298 ti,no-idle-on-init;
299 clocks = <&l3_div_ck>;
300 clock-names = "fck";
278 }; 301 };
279 302
280 uart1: serial@4806a000 { 303 uart1: serial@4806a000 {
@@ -313,6 +336,7 @@
313 compatible = "ti,omap4-hwspinlock"; 336 compatible = "ti,omap4-hwspinlock";
314 reg = <0x4a0f6000 0x1000>; 337 reg = <0x4a0f6000 0x1000>;
315 ti,hwmods = "spinlock"; 338 ti,hwmods = "spinlock";
339 #hwlock-cells = <1>;
316 }; 340 };
317 341
318 i2c1: i2c@48070000 { 342 i2c1: i2c@48070000 {
@@ -419,6 +443,7 @@
419 ti,needs-special-reset; 443 ti,needs-special-reset;
420 dmas = <&sdma 61>, <&sdma 62>; 444 dmas = <&sdma 61>, <&sdma 62>;
421 dma-names = "tx", "rx"; 445 dma-names = "tx", "rx";
446 pbias-supply = <&pbias_mmc_reg>;
422 }; 447 };
423 448
424 mmc2: mmc@480b4000 { 449 mmc2: mmc@480b4000 {
@@ -461,6 +486,21 @@
461 dma-names = "tx", "rx"; 486 dma-names = "tx", "rx";
462 }; 487 };
463 488
489 mmu_dsp: mmu@4a066000 {
490 compatible = "ti,omap4-iommu";
491 reg = <0x4a066000 0x100>;
492 interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
493 ti,hwmods = "mmu_dsp";
494 };
495
496 mmu_ipu: mmu@55082000 {
497 compatible = "ti,omap4-iommu";
498 reg = <0x55082000 0x100>;
499 interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
500 ti,hwmods = "mmu_ipu";
501 ti,iommu-bus-err-back;
502 };
503
464 wdt2: wdt@4a314000 { 504 wdt2: wdt@4a314000 {
465 compatible = "ti,omap4-wdt", "ti,omap3-wdt"; 505 compatible = "ti,omap4-wdt", "ti,omap3-wdt";
466 reg = <0x4a314000 0x80>; 506 reg = <0x4a314000 0x80>;
@@ -478,6 +518,7 @@
478 dmas = <&sdma 65>, 518 dmas = <&sdma 65>,
479 <&sdma 66>; 519 <&sdma 66>;
480 dma-names = "up_link", "dn_link"; 520 dma-names = "up_link", "dn_link";
521 status = "disabled";
481 }; 522 };
482 523
483 dmic: dmic@4012e000 { 524 dmic: dmic@4012e000 {
@@ -489,6 +530,7 @@
489 ti,hwmods = "dmic"; 530 ti,hwmods = "dmic";
490 dmas = <&sdma 67>; 531 dmas = <&sdma 67>;
491 dma-names = "up_link"; 532 dma-names = "up_link";
533 status = "disabled";
492 }; 534 };
493 535
494 mcbsp1: mcbsp@40122000 { 536 mcbsp1: mcbsp@40122000 {
@@ -503,6 +545,7 @@
503 dmas = <&sdma 33>, 545 dmas = <&sdma 33>,
504 <&sdma 34>; 546 <&sdma 34>;
505 dma-names = "tx", "rx"; 547 dma-names = "tx", "rx";
548 status = "disabled";
506 }; 549 };
507 550
508 mcbsp2: mcbsp@40124000 { 551 mcbsp2: mcbsp@40124000 {
@@ -517,6 +560,7 @@
517 dmas = <&sdma 17>, 560 dmas = <&sdma 17>,
518 <&sdma 18>; 561 <&sdma 18>;
519 dma-names = "tx", "rx"; 562 dma-names = "tx", "rx";
563 status = "disabled";
520 }; 564 };
521 565
522 mcbsp3: mcbsp@40126000 { 566 mcbsp3: mcbsp@40126000 {
@@ -531,6 +575,7 @@
531 dmas = <&sdma 19>, 575 dmas = <&sdma 19>,
532 <&sdma 20>; 576 <&sdma 20>;
533 dma-names = "tx", "rx"; 577 dma-names = "tx", "rx";
578 status = "disabled";
534 }; 579 };
535 580
536 mcbsp4: mcbsp@48096000 { 581 mcbsp4: mcbsp@48096000 {
@@ -544,6 +589,7 @@
544 dmas = <&sdma 31>, 589 dmas = <&sdma 31>,
545 <&sdma 32>; 590 <&sdma 32>;
546 dma-names = "tx", "rx"; 591 dma-names = "tx", "rx";
592 status = "disabled";
547 }; 593 };
548 594
549 keypad: keypad@4a31c000 { 595 keypad: keypad@4a31c000 {
@@ -554,6 +600,13 @@
554 ti,hwmods = "kbd"; 600 ti,hwmods = "kbd";
555 }; 601 };
556 602
603 dmm@4e000000 {
604 compatible = "ti,omap4-dmm";
605 reg = <0x4e000000 0x800>;
606 interrupts = <0 113 0x4>;
607 ti,hwmods = "dmm";
608 };
609
557 emif1: emif@4c000000 { 610 emif1: emif@4c000000 {
558 compatible = "ti,emif-4d"; 611 compatible = "ti,emif-4d";
559 reg = <0x4c000000 0x100>; 612 reg = <0x4c000000 0x100>;
@@ -697,16 +750,22 @@
697 #address-cells = <1>; 750 #address-cells = <1>;
698 #size-cells = <1>; 751 #size-cells = <1>;
699 ranges; 752 ranges;
753 clocks = <&init_60m_fclk>,
754 <&xclk60mhsp1_ck>,
755 <&xclk60mhsp2_ck>;
756 clock-names = "refclk_60m_int",
757 "refclk_60m_ext_p1",
758 "refclk_60m_ext_p2";
700 759
701 usbhsohci: ohci@4a064800 { 760 usbhsohci: ohci@4a064800 {
702 compatible = "ti,ohci-omap3", "usb-ohci"; 761 compatible = "ti,ohci-omap3";
703 reg = <0x4a064800 0x400>; 762 reg = <0x4a064800 0x400>;
704 interrupt-parent = <&gic>; 763 interrupt-parent = <&gic>;
705 interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>; 764 interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
706 }; 765 };
707 766
708 usbhsehci: ehci@4a064c00 { 767 usbhsehci: ehci@4a064c00 {
709 compatible = "ti,ehci-omap", "usb-ehci"; 768 compatible = "ti,ehci-omap";
710 reg = <0x4a064c00 0x400>; 769 reg = <0x4a064c00 0x400>;
711 interrupt-parent = <&gic>; 770 interrupt-parent = <&gic>;
712 interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>; 771 interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
@@ -757,6 +816,111 @@
757 dmas = <&sdma 117>, <&sdma 116>; 816 dmas = <&sdma 117>, <&sdma 116>;
758 dma-names = "tx", "rx"; 817 dma-names = "tx", "rx";
759 }; 818 };
819
820 abb_mpu: regulator-abb-mpu {
821 compatible = "ti,abb-v2";
822 regulator-name = "abb_mpu";
823 #address-cells = <0>;
824 #size-cells = <0>;
825 ti,tranxdone-status-mask = <0x80>;
826 clocks = <&sys_clkin_ck>;
827 ti,settling-time = <50>;
828 ti,clock-cycles = <16>;
829
830 status = "disabled";
831 };
832
833 abb_iva: regulator-abb-iva {
834 compatible = "ti,abb-v2";
835 regulator-name = "abb_iva";
836 #address-cells = <0>;
837 #size-cells = <0>;
838 ti,tranxdone-status-mask = <0x80000000>;
839 clocks = <&sys_clkin_ck>;
840 ti,settling-time = <50>;
841 ti,clock-cycles = <16>;
842
843 status = "disabled";
844 };
845
846 dss: dss@58000000 {
847 compatible = "ti,omap4-dss";
848 reg = <0x58000000 0x80>;
849 status = "disabled";
850 ti,hwmods = "dss_core";
851 clocks = <&dss_dss_clk>;
852 clock-names = "fck";
853 #address-cells = <1>;
854 #size-cells = <1>;
855 ranges;
856
857 dispc@58001000 {
858 compatible = "ti,omap4-dispc";
859 reg = <0x58001000 0x1000>;
860 interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
861 ti,hwmods = "dss_dispc";
862 clocks = <&dss_dss_clk>;
863 clock-names = "fck";
864 };
865
866 rfbi: encoder@58002000 {
867 compatible = "ti,omap4-rfbi";
868 reg = <0x58002000 0x1000>;
869 status = "disabled";
870 ti,hwmods = "dss_rfbi";
871 clocks = <&dss_dss_clk>, <&dss_fck>;
872 clock-names = "fck", "ick";
873 };
874
875 venc: encoder@58003000 {
876 compatible = "ti,omap4-venc";
877 reg = <0x58003000 0x1000>;
878 status = "disabled";
879 ti,hwmods = "dss_venc";
880 clocks = <&dss_tv_clk>;
881 clock-names = "fck";
882 };
883
884 dsi1: encoder@58004000 {
885 compatible = "ti,omap4-dsi";
886 reg = <0x58004000 0x200>,
887 <0x58004200 0x40>,
888 <0x58004300 0x20>;
889 reg-names = "proto", "phy", "pll";
890 interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>;
891 status = "disabled";
892 ti,hwmods = "dss_dsi1";
893 clocks = <&dss_dss_clk>, <&dss_sys_clk>;
894 clock-names = "fck", "sys_clk";
895 };
896
897 dsi2: encoder@58005000 {
898 compatible = "ti,omap4-dsi";
899 reg = <0x58005000 0x200>,
900 <0x58005200 0x40>,
901 <0x58005300 0x20>;
902 reg-names = "proto", "phy", "pll";
903 interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
904 status = "disabled";
905 ti,hwmods = "dss_dsi2";
906 clocks = <&dss_dss_clk>, <&dss_sys_clk>;
907 clock-names = "fck", "sys_clk";
908 };
909
910 hdmi: encoder@58006000 {
911 compatible = "ti,omap4-hdmi";
912 reg = <0x58006000 0x200>,
913 <0x58006200 0x100>,
914 <0x58006300 0x100>,
915 <0x58006400 0x1000>;
916 reg-names = "wp", "pll", "phy", "core";
917 interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
918 status = "disabled";
919 ti,hwmods = "dss_hdmi";
920 clocks = <&dss_48mhz_clk>, <&dss_sys_clk>;
921 clock-names = "fck", "sys_clk";
922 };
923 };
760 }; 924 };
761}; 925};
762 926
diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
index 8c1cfad30d60..0adfa1d1ef20 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -43,6 +43,32 @@
43 #thermal-sensor-cells = <0>; 43 #thermal-sensor-cells = <0>;
44 }; 44 };
45 }; 45 };
46
47 ocp {
48 abb_mpu: regulator-abb-mpu {
49 status = "okay";
50
51 reg = <0x4a307bd0 0x8>, <0x4a306014 0x4>;
52 reg-names = "base-address", "int-address";
53
54 ti,abb_info = <
55 /*uV ABB efuse rbb_m fbb_m vset_m*/
56 1025000 0 0 0 0 0
57 1200000 0 0 0 0 0
58 1313000 0 0 0 0 0
59 1375000 1 0 0 0 0
60 1389000 1 0 0 0 0
61 >;
62 };
63
64 /* Default unused, just provide register info for record */
65 abb_iva: regulator-abb-iva {
66 reg = <0x4a307bd8 0x8>, <0x4a306010 0x4>;
67 reg-names = "base-address", "int-address";
68 };
69
70 };
71
46}; 72};
47 73
48/include/ "omap443x-clocks.dtsi" 74/include/ "omap443x-clocks.dtsi"
diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
index 6b32f520741a..194f9ef0a009 100644
--- a/arch/arm/boot/dts/omap4460.dtsi
+++ b/arch/arm/boot/dts/omap4460.dtsi
@@ -50,7 +50,44 @@
50 50
51 #thermal-sensor-cells = <0>; 51 #thermal-sensor-cells = <0>;
52 }; 52 };
53
54 abb_mpu: regulator-abb-mpu {
55 status = "okay";
56
57 reg = <0x4a307bd0 0x8>, <0x4a306014 0x4>,
58 <0x4A002268 0x4>;
59 reg-names = "base-address", "int-address",
60 "efuse-address";
61
62 ti,abb_info = <
63 /*uV ABB efuse rbb_m fbb_m vset_m*/
64 1025000 0 0 0 0 0
65 1200000 0 0 0 0 0
66 1313000 0 0 0x100000 0x40000 0
67 1375000 1 0 0 0 0
68 1389000 1 0 0 0 0
69 >;
70 };
71
72 abb_iva: regulator-abb-iva {
73 status = "okay";
74
75 reg = <0x4a307bd8 0x8>, <0x4a306010 0x4>,
76 <0x4A002268 0x4>;
77 reg-names = "base-address", "int-address",
78 "efuse-address";
79
80 ti,abb_info = <
81 /*uV ABB efuse rbb_m fbb_m vset_m*/
82 950000 0 0 0 0 0
83 1140000 0 0 0 0 0
84 1291000 0 0 0x200000 0 0
85 1375000 1 0 0 0 0
86 1376000 1 0 0 0 0
87 >;
88 };
53 }; 89 };
90
54}; 91};
55 92
56/include/ "omap446x-clocks.dtsi" 93/include/ "omap446x-clocks.dtsi"
diff --git a/arch/arm/boot/dts/omap5-uevm.dts b/arch/arm/boot/dts/omap5-uevm.dts
index 002fa70180a5..3b99ec25b748 100644
--- a/arch/arm/boot/dts/omap5-uevm.dts
+++ b/arch/arm/boot/dts/omap5-uevm.dts
@@ -31,12 +31,8 @@
31 hsusb2_phy: hsusb2_phy { 31 hsusb2_phy: hsusb2_phy {
32 compatible = "usb-nop-xceiv"; 32 compatible = "usb-nop-xceiv";
33 reset-gpios = <&gpio3 16 GPIO_ACTIVE_LOW>; /* gpio3_80 HUB_NRESET */ 33 reset-gpios = <&gpio3 16 GPIO_ACTIVE_LOW>; /* gpio3_80 HUB_NRESET */
34 /** 34 clocks = <&auxclk1_ck>;
35 * FIXME 35 clock-names = "main_clk";
36 * Put the right clock phandle here when available
37 * clocks = <&auxclk1>;
38 * clock-names = "main_clk";
39 */
40 clock-frequency = <19200000>; 36 clock-frequency = <19200000>;
41 }; 37 };
42 38
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index a72813a9663e..6f3de22fb266 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -49,6 +49,12 @@
49 1000000 1060000 49 1000000 1060000
50 1500000 1250000 50 1500000 1250000
51 >; 51 >;
52
53 clocks = <&dpll_mpu_ck>;
54 clock-names = "cpu";
55
56 clock-latency = <300000>; /* From omap-cpufreq driver */
57
52 /* cooling options */ 58 /* cooling options */
53 cooling-min-level = <0>; 59 cooling-min-level = <0>;
54 cooling-max-level = <2>; 60 cooling-max-level = <2>;
@@ -192,6 +198,22 @@
192 pinctrl-single,function-mask = <0x7fff>; 198 pinctrl-single,function-mask = <0x7fff>;
193 }; 199 };
194 200
201 omap5_padconf_global: tisyscon@4a002da0 {
202 compatible = "syscon";
203 reg = <0x4A002da0 0xec>;
204 };
205
206 pbias_regulator: pbias_regulator {
207 compatible = "ti,pbias-omap";
208 reg = <0x60 0x4>;
209 syscon = <&omap5_padconf_global>;
210 pbias_mmc_reg: pbias_mmc_omap5 {
211 regulator-name = "pbias_mmc_omap5";
212 regulator-min-microvolt = <1800000>;
213 regulator-max-microvolt = <3000000>;
214 };
215 };
216
195 sdma: dma-controller@4a056000 { 217 sdma: dma-controller@4a056000 {
196 compatible = "ti,omap4430-sdma"; 218 compatible = "ti,omap4430-sdma";
197 reg = <0x4a056000 0x1000>; 219 reg = <0x4a056000 0x1000>;
@@ -302,6 +324,8 @@
302 gpmc,num-cs = <8>; 324 gpmc,num-cs = <8>;
303 gpmc,num-waitpins = <4>; 325 gpmc,num-waitpins = <4>;
304 ti,hwmods = "gpmc"; 326 ti,hwmods = "gpmc";
327 clocks = <&l3_iclk_div>;
328 clock-names = "fck";
305 }; 329 };
306 330
307 i2c1: i2c@48070000 { 331 i2c1: i2c@48070000 {
@@ -353,6 +377,7 @@
353 compatible = "ti,omap4-hwspinlock"; 377 compatible = "ti,omap4-hwspinlock";
354 reg = <0x4a0f6000 0x1000>; 378 reg = <0x4a0f6000 0x1000>;
355 ti,hwmods = "spinlock"; 379 ti,hwmods = "spinlock";
380 #hwlock-cells = <1>;
356 }; 381 };
357 382
358 mcspi1: spi@48098000 { 383 mcspi1: spi@48098000 {
@@ -471,6 +496,7 @@
471 ti,needs-special-reset; 496 ti,needs-special-reset;
472 dmas = <&sdma 61>, <&sdma 62>; 497 dmas = <&sdma 61>, <&sdma 62>;
473 dma-names = "tx", "rx"; 498 dma-names = "tx", "rx";
499 pbias-supply = <&pbias_mmc_reg>;
474 }; 500 };
475 501
476 mmc2: mmc@480b4000 { 502 mmc2: mmc@480b4000 {
@@ -513,6 +539,21 @@
513 dma-names = "tx", "rx"; 539 dma-names = "tx", "rx";
514 }; 540 };
515 541
542 mmu_dsp: mmu@4a066000 {
543 compatible = "ti,omap4-iommu";
544 reg = <0x4a066000 0x100>;
545 interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
546 ti,hwmods = "mmu_dsp";
547 };
548
549 mmu_ipu: mmu@55082000 {
550 compatible = "ti,omap4-iommu";
551 reg = <0x55082000 0x100>;
552 interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
553 ti,hwmods = "mmu_ipu";
554 ti,iommu-bus-err-back;
555 };
556
516 keypad: keypad@4ae1c000 { 557 keypad: keypad@4ae1c000 {
517 compatible = "ti,omap4-keypad"; 558 compatible = "ti,omap4-keypad";
518 reg = <0x4ae1c000 0x400>; 559 reg = <0x4ae1c000 0x400>;
@@ -529,6 +570,7 @@
529 dmas = <&sdma 65>, 570 dmas = <&sdma 65>,
530 <&sdma 66>; 571 <&sdma 66>;
531 dma-names = "up_link", "dn_link"; 572 dma-names = "up_link", "dn_link";
573 status = "disabled";
532 }; 574 };
533 575
534 dmic: dmic@4012e000 { 576 dmic: dmic@4012e000 {
@@ -540,6 +582,7 @@
540 ti,hwmods = "dmic"; 582 ti,hwmods = "dmic";
541 dmas = <&sdma 67>; 583 dmas = <&sdma 67>;
542 dma-names = "up_link"; 584 dma-names = "up_link";
585 status = "disabled";
543 }; 586 };
544 587
545 mcbsp1: mcbsp@40122000 { 588 mcbsp1: mcbsp@40122000 {
@@ -554,6 +597,7 @@
554 dmas = <&sdma 33>, 597 dmas = <&sdma 33>,
555 <&sdma 34>; 598 <&sdma 34>;
556 dma-names = "tx", "rx"; 599 dma-names = "tx", "rx";
600 status = "disabled";
557 }; 601 };
558 602
559 mcbsp2: mcbsp@40124000 { 603 mcbsp2: mcbsp@40124000 {
@@ -568,6 +612,7 @@
568 dmas = <&sdma 17>, 612 dmas = <&sdma 17>,
569 <&sdma 18>; 613 <&sdma 18>;
570 dma-names = "tx", "rx"; 614 dma-names = "tx", "rx";
615 status = "disabled";
571 }; 616 };
572 617
573 mcbsp3: mcbsp@40126000 { 618 mcbsp3: mcbsp@40126000 {
@@ -582,6 +627,7 @@
582 dmas = <&sdma 19>, 627 dmas = <&sdma 19>,
583 <&sdma 20>; 628 <&sdma 20>;
584 dma-names = "tx", "rx"; 629 dma-names = "tx", "rx";
630 status = "disabled";
585 }; 631 };
586 632
587 timer1: timer@4ae18000 { 633 timer1: timer@4ae18000 {
@@ -683,6 +729,13 @@
683 ti,hwmods = "wd_timer2"; 729 ti,hwmods = "wd_timer2";
684 }; 730 };
685 731
732 dmm@4e000000 {
733 compatible = "ti,omap5-dmm";
734 reg = <0x4e000000 0x800>;
735 interrupts = <0 113 0x4>;
736 ti,hwmods = "dmm";
737 };
738
686 emif1: emif@4c000000 { 739 emif1: emif@4c000000 {
687 compatible = "ti,emif-4d5"; 740 compatible = "ti,emif-4d5";
688 ti,hwmods = "emif1"; 741 ti,hwmods = "emif1";
@@ -732,7 +785,8 @@
732 compatible = "snps,dwc3"; 785 compatible = "snps,dwc3";
733 reg = <0x4a030000 0x10000>; 786 reg = <0x4a030000 0x10000>;
734 interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>; 787 interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
735 usb-phy = <&usb2_phy>, <&usb3_phy>; 788 phys = <&usb2_phy>, <&usb3_phy>;
789 phy-names = "usb2-phy", "usb3-phy";
736 dr_mode = "peripheral"; 790 dr_mode = "peripheral";
737 tx-fifo-resize; 791 tx-fifo-resize;
738 }; 792 };
@@ -749,6 +803,7 @@
749 compatible = "ti,omap-usb2"; 803 compatible = "ti,omap-usb2";
750 reg = <0x4a084000 0x7c>; 804 reg = <0x4a084000 0x7c>;
751 ctrl-module = <&omap_control_usb2phy>; 805 ctrl-module = <&omap_control_usb2phy>;
806 #phy-cells = <0>;
752 }; 807 };
753 808
754 usb3_phy: usb3phy@4a084400 { 809 usb3_phy: usb3phy@4a084400 {
@@ -758,6 +813,7 @@
758 <0x4a084c00 0x40>; 813 <0x4a084c00 0x40>;
759 reg-names = "phy_rx", "phy_tx", "pll_ctrl"; 814 reg-names = "phy_rx", "phy_tx", "pll_ctrl";
760 ctrl-module = <&omap_control_usb3phy>; 815 ctrl-module = <&omap_control_usb3phy>;
816 #phy-cells = <0>;
761 }; 817 };
762 }; 818 };
763 819
@@ -775,16 +831,22 @@
775 #address-cells = <1>; 831 #address-cells = <1>;
776 #size-cells = <1>; 832 #size-cells = <1>;
777 ranges; 833 ranges;
834 clocks = <&l3init_60m_fclk>,
835 <&xclk60mhsp1_ck>,
836 <&xclk60mhsp2_ck>;
837 clock-names = "refclk_60m_int",
838 "refclk_60m_ext_p1",
839 "refclk_60m_ext_p2";
778 840
779 usbhsohci: ohci@4a064800 { 841 usbhsohci: ohci@4a064800 {
780 compatible = "ti,ohci-omap3", "usb-ohci"; 842 compatible = "ti,ohci-omap3";
781 reg = <0x4a064800 0x400>; 843 reg = <0x4a064800 0x400>;
782 interrupt-parent = <&gic>; 844 interrupt-parent = <&gic>;
783 interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>; 845 interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
784 }; 846 };
785 847
786 usbhsehci: ehci@4a064c00 { 848 usbhsehci: ehci@4a064c00 {
787 compatible = "ti,ehci-omap", "usb-ehci"; 849 compatible = "ti,ehci-omap";
788 reg = <0x4a064c00 0x400>; 850 reg = <0x4a064c00 0x400>;
789 interrupt-parent = <&gic>; 851 interrupt-parent = <&gic>;
790 interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>; 852 interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
diff --git a/arch/arm/boot/dts/prima2.dtsi b/arch/arm/boot/dts/prima2.dtsi
index 0e219932d7cc..1e82571d6823 100644
--- a/arch/arm/boot/dts/prima2.dtsi
+++ b/arch/arm/boot/dts/prima2.dtsi
@@ -76,9 +76,10 @@
76 #clock-cells = <1>; 76 #clock-cells = <1>;
77 }; 77 };
78 78
79 reset-controller@88010000 { 79 rstc: reset-controller@88010000 {
80 compatible = "sirf,prima2-rstc"; 80 compatible = "sirf,prima2-rstc";
81 reg = <0x88010000 0x1000>; 81 reg = <0x88010000 0x1000>;
82 #reset-cells = <1>;
82 }; 83 };
83 84
84 rsc-controller@88020000 { 85 rsc-controller@88020000 {
@@ -223,8 +224,8 @@
223 interrupts = <17>; 224 interrupts = <17>;
224 fifosize = <128>; 225 fifosize = <128>;
225 clocks = <&clks 13>; 226 clocks = <&clks 13>;
226 sirf,uart-dma-rx-channel = <21>; 227 dmas = <&dmac1 5>, <&dmac0 2>;
227 sirf,uart-dma-tx-channel = <2>; 228 dma-names = "rx", "tx";
228 }; 229 };
229 230
230 uart1: uart@b0060000 { 231 uart1: uart@b0060000 {
@@ -243,8 +244,8 @@
243 interrupts = <19>; 244 interrupts = <19>;
244 fifosize = <128>; 245 fifosize = <128>;
245 clocks = <&clks 15>; 246 clocks = <&clks 15>;
246 sirf,uart-dma-rx-channel = <6>; 247 dmas = <&dmac0 6>, <&dmac0 7>;
247 sirf,uart-dma-tx-channel = <7>; 248 dma-names = "rx", "tx";
248 }; 249 };
249 250
250 usp0: usp@b0080000 { 251 usp0: usp@b0080000 {
@@ -254,8 +255,8 @@
254 interrupts = <20>; 255 interrupts = <20>;
255 fifosize = <128>; 256 fifosize = <128>;
256 clocks = <&clks 28>; 257 clocks = <&clks 28>;
257 sirf,usp-dma-rx-channel = <17>; 258 dmas = <&dmac1 1>, <&dmac1 2>;
258 sirf,usp-dma-tx-channel = <18>; 259 dma-names = "rx", "tx";
259 }; 260 };
260 261
261 usp1: usp@b0090000 { 262 usp1: usp@b0090000 {
@@ -265,8 +266,8 @@
265 interrupts = <21>; 266 interrupts = <21>;
266 fifosize = <128>; 267 fifosize = <128>;
267 clocks = <&clks 29>; 268 clocks = <&clks 29>;
268 sirf,usp-dma-rx-channel = <14>; 269 dmas = <&dmac0 14>, <&dmac0 15>;
269 sirf,usp-dma-tx-channel = <15>; 270 dma-names = "rx", "tx";
270 }; 271 };
271 272
272 usp2: usp@b00a0000 { 273 usp2: usp@b00a0000 {
@@ -276,8 +277,8 @@
276 interrupts = <22>; 277 interrupts = <22>;
277 fifosize = <128>; 278 fifosize = <128>;
278 clocks = <&clks 30>; 279 clocks = <&clks 30>;
279 sirf,usp-dma-rx-channel = <10>; 280 dmas = <&dmac0 10>, <&dmac0 11>;
280 sirf,usp-dma-tx-channel = <11>; 281 dma-names = "rx", "tx";
281 }; 282 };
282 283
283 dmac0: dma-controller@b00b0000 { 284 dmac0: dma-controller@b00b0000 {
@@ -286,6 +287,7 @@
286 reg = <0xb00b0000 0x10000>; 287 reg = <0xb00b0000 0x10000>;
287 interrupts = <12>; 288 interrupts = <12>;
288 clocks = <&clks 24>; 289 clocks = <&clks 24>;
290 #dma-cells = <1>;
289 }; 291 };
290 292
291 dmac1: dma-controller@b0160000 { 293 dmac1: dma-controller@b0160000 {
@@ -294,6 +296,7 @@
294 reg = <0xb0160000 0x10000>; 296 reg = <0xb0160000 0x10000>;
295 interrupts = <13>; 297 interrupts = <13>;
296 clocks = <&clks 25>; 298 clocks = <&clks 25>;
299 #dma-cells = <1>;
297 }; 300 };
298 301
299 vip@b00C0000 { 302 vip@b00C0000 {
diff --git a/arch/arm/boot/dts/qcom-msm8660-surf.dts b/arch/arm/boot/dts/qcom-msm8660-surf.dts
index 68a72f5507b9..169bad90dac9 100644
--- a/arch/arm/boot/dts/qcom-msm8660-surf.dts
+++ b/arch/arm/boot/dts/qcom-msm8660-surf.dts
@@ -1,63 +1,6 @@
1/dts-v1/; 1#include "qcom-msm8660.dtsi"
2
3/include/ "skeleton.dtsi"
4
5#include <dt-bindings/clock/qcom,gcc-msm8660.h>
6 2
7/ { 3/ {
8 model = "Qualcomm MSM8660 SURF"; 4 model = "Qualcomm MSM8660 SURF";
9 compatible = "qcom,msm8660-surf", "qcom,msm8660"; 5 compatible = "qcom,msm8660-surf", "qcom,msm8660";
10 interrupt-parent = <&intc>;
11
12 intc: interrupt-controller@2080000 {
13 compatible = "qcom,msm-8660-qgic";
14 interrupt-controller;
15 #interrupt-cells = <3>;
16 reg = < 0x02080000 0x1000 >,
17 < 0x02081000 0x1000 >;
18 };
19
20 timer@2000000 {
21 compatible = "qcom,scss-timer", "qcom,msm-timer";
22 interrupts = <1 0 0x301>,
23 <1 1 0x301>,
24 <1 2 0x301>;
25 reg = <0x02000000 0x100>;
26 clock-frequency = <27000000>,
27 <32768>;
28 cpu-offset = <0x40000>;
29 };
30
31 msmgpio: gpio@800000 {
32 compatible = "qcom,msm-gpio";
33 reg = <0x00800000 0x4000>;
34 gpio-controller;
35 #gpio-cells = <2>;
36 ngpio = <173>;
37 interrupts = <0 16 0x4>;
38 interrupt-controller;
39 #interrupt-cells = <2>;
40 };
41
42 gcc: clock-controller@900000 {
43 compatible = "qcom,gcc-msm8660";
44 #clock-cells = <1>;
45 #reset-cells = <1>;
46 reg = <0x900000 0x4000>;
47 };
48
49 serial@19c40000 {
50 compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
51 reg = <0x19c40000 0x1000>,
52 <0x19c00000 0x1000>;
53 interrupts = <0 195 0x0>;
54 clocks = <&gcc GSBI12_UART_CLK>, <&gcc GSBI12_H_CLK>;
55 clock-names = "core", "iface";
56 };
57
58 qcom,ssbi@500000 {
59 compatible = "qcom,ssbi";
60 reg = <0x500000 0x1000>;
61 qcom,controller-type = "pmic-arbiter";
62 };
63}; 6};
diff --git a/arch/arm/boot/dts/qcom-msm8660.dtsi b/arch/arm/boot/dts/qcom-msm8660.dtsi
new file mode 100644
index 000000000000..c52a9e964a44
--- /dev/null
+++ b/arch/arm/boot/dts/qcom-msm8660.dtsi
@@ -0,0 +1,87 @@
1/dts-v1/;
2
3/include/ "skeleton.dtsi"
4
5#include <dt-bindings/clock/qcom,gcc-msm8660.h>
6
7/ {
8 model = "Qualcomm MSM8660";
9 compatible = "qcom,msm8660";
10 interrupt-parent = <&intc>;
11
12 cpus {
13 #address-cells = <1>;
14 #size-cells = <0>;
15 compatible = "qcom,scorpion";
16 enable-method = "qcom,gcc-msm8660";
17
18 cpu@0 {
19 device_type = "cpu";
20 reg = <0>;
21 next-level-cache = <&L2>;
22 };
23
24 cpu@1 {
25 device_type = "cpu";
26 reg = <1>;
27 next-level-cache = <&L2>;
28 };
29
30 L2: l2-cache {
31 compatible = "cache";
32 cache-level = <2>;
33 };
34 };
35
36 intc: interrupt-controller@2080000 {
37 compatible = "qcom,msm-8660-qgic";
38 interrupt-controller;
39 #interrupt-cells = <3>;
40 reg = < 0x02080000 0x1000 >,
41 < 0x02081000 0x1000 >;
42 };
43
44 timer@2000000 {
45 compatible = "qcom,scss-timer", "qcom,msm-timer";
46 interrupts = <1 0 0x301>,
47 <1 1 0x301>,
48 <1 2 0x301>;
49 reg = <0x02000000 0x100>;
50 clock-frequency = <27000000>,
51 <32768>;
52 cpu-offset = <0x40000>;
53 };
54
55 msmgpio: gpio@800000 {
56 compatible = "qcom,msm-gpio";
57 reg = <0x00800000 0x4000>;
58 gpio-controller;
59 #gpio-cells = <2>;
60 ngpio = <173>;
61 interrupts = <0 16 0x4>;
62 interrupt-controller;
63 #interrupt-cells = <2>;
64 };
65
66 gcc: clock-controller@900000 {
67 compatible = "qcom,gcc-msm8660";
68 #clock-cells = <1>;
69 #reset-cells = <1>;
70 reg = <0x900000 0x4000>;
71 };
72
73 serial@19c40000 {
74 compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
75 reg = <0x19c40000 0x1000>,
76 <0x19c00000 0x1000>;
77 interrupts = <0 195 0x0>;
78 clocks = <&gcc GSBI12_UART_CLK>, <&gcc GSBI12_H_CLK>;
79 clock-names = "core", "iface";
80 };
81
82 qcom,ssbi@500000 {
83 compatible = "qcom,ssbi";
84 reg = <0x500000 0x1000>;
85 qcom,controller-type = "pmic-arbiter";
86 };
87};
diff --git a/arch/arm/boot/dts/qcom-msm8960-cdp.dts b/arch/arm/boot/dts/qcom-msm8960-cdp.dts
index 7c30de4fa302..a58fb88315f6 100644
--- a/arch/arm/boot/dts/qcom-msm8960-cdp.dts
+++ b/arch/arm/boot/dts/qcom-msm8960-cdp.dts
@@ -1,70 +1,6 @@
1/dts-v1/; 1#include "qcom-msm8960.dtsi"
2
3/include/ "skeleton.dtsi"
4
5#include <dt-bindings/clock/qcom,gcc-msm8960.h>
6 2
7/ { 3/ {
8 model = "Qualcomm MSM8960 CDP"; 4 model = "Qualcomm MSM8960 CDP";
9 compatible = "qcom,msm8960-cdp", "qcom,msm8960"; 5 compatible = "qcom,msm8960-cdp", "qcom,msm8960";
10 interrupt-parent = <&intc>;
11
12 intc: interrupt-controller@2000000 {
13 compatible = "qcom,msm-qgic2";
14 interrupt-controller;
15 #interrupt-cells = <3>;
16 reg = < 0x02000000 0x1000 >,
17 < 0x02002000 0x1000 >;
18 };
19
20 timer@200a000 {
21 compatible = "qcom,kpss-timer", "qcom,msm-timer";
22 interrupts = <1 1 0x301>,
23 <1 2 0x301>,
24 <1 3 0x301>;
25 reg = <0x0200a000 0x100>;
26 clock-frequency = <27000000>,
27 <32768>;
28 cpu-offset = <0x80000>;
29 };
30
31 msmgpio: gpio@800000 {
32 compatible = "qcom,msm-gpio";
33 gpio-controller;
34 #gpio-cells = <2>;
35 ngpio = <150>;
36 interrupts = <0 16 0x4>;
37 interrupt-controller;
38 #interrupt-cells = <2>;
39 reg = <0x800000 0x4000>;
40 };
41
42 gcc: clock-controller@900000 {
43 compatible = "qcom,gcc-msm8960";
44 #clock-cells = <1>;
45 #reset-cells = <1>;
46 reg = <0x900000 0x4000>;
47 };
48
49 clock-controller@4000000 {
50 compatible = "qcom,mmcc-msm8960";
51 reg = <0x4000000 0x1000>;
52 #clock-cells = <1>;
53 #reset-cells = <1>;
54 };
55
56 serial@16440000 {
57 compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
58 reg = <0x16440000 0x1000>,
59 <0x16400000 0x1000>;
60 interrupts = <0 154 0x0>;
61 clocks = <&gcc GSBI5_UART_CLK>, <&gcc GSBI5_H_CLK>;
62 clock-names = "core", "iface";
63 };
64
65 qcom,ssbi@500000 {
66 compatible = "qcom,ssbi";
67 reg = <0x500000 0x1000>;
68 qcom,controller-type = "pmic-arbiter";
69 };
70}; 6};
diff --git a/arch/arm/boot/dts/qcom-msm8960.dtsi b/arch/arm/boot/dts/qcom-msm8960.dtsi
new file mode 100644
index 000000000000..997b7b94e117
--- /dev/null
+++ b/arch/arm/boot/dts/qcom-msm8960.dtsi
@@ -0,0 +1,135 @@
1/dts-v1/;
2
3/include/ "skeleton.dtsi"
4
5#include <dt-bindings/clock/qcom,gcc-msm8960.h>
6
7/ {
8 model = "Qualcomm MSM8960";
9 compatible = "qcom,msm8960";
10 interrupt-parent = <&intc>;
11
12 cpus {
13 #address-cells = <1>;
14 #size-cells = <0>;
15 interrupts = <1 14 0x304>;
16 compatible = "qcom,krait";
17 enable-method = "qcom,kpss-acc-v1";
18
19 cpu@0 {
20 device_type = "cpu";
21 reg = <0>;
22 next-level-cache = <&L2>;
23 qcom,acc = <&acc0>;
24 qcom,saw = <&saw0>;
25 };
26
27 cpu@1 {
28 device_type = "cpu";
29 reg = <1>;
30 next-level-cache = <&L2>;
31 qcom,acc = <&acc1>;
32 qcom,saw = <&saw1>;
33 };
34
35 L2: l2-cache {
36 compatible = "cache";
37 cache-level = <2>;
38 interrupts = <0 2 0x4>;
39 };
40 };
41
42 cpu-pmu {
43 compatible = "qcom,krait-pmu";
44 interrupts = <1 10 0x304>;
45 qcom,no-pc-write;
46 };
47
48 intc: interrupt-controller@2000000 {
49 compatible = "qcom,msm-qgic2";
50 interrupt-controller;
51 #interrupt-cells = <3>;
52 reg = < 0x02000000 0x1000 >,
53 < 0x02002000 0x1000 >;
54 };
55
56 timer@200a000 {
57 compatible = "qcom,kpss-timer", "qcom,msm-timer";
58 interrupts = <1 1 0x301>,
59 <1 2 0x301>,
60 <1 3 0x301>;
61 reg = <0x0200a000 0x100>;
62 clock-frequency = <27000000>,
63 <32768>;
64 cpu-offset = <0x80000>;
65 };
66
67 msmgpio: gpio@800000 {
68 compatible = "qcom,msm-gpio";
69 gpio-controller;
70 #gpio-cells = <2>;
71 ngpio = <150>;
72 interrupts = <0 16 0x4>;
73 interrupt-controller;
74 #interrupt-cells = <2>;
75 reg = <0x800000 0x4000>;
76 };
77
78 gcc: clock-controller@900000 {
79 compatible = "qcom,gcc-msm8960";
80 #clock-cells = <1>;
81 #reset-cells = <1>;
82 reg = <0x900000 0x4000>;
83 };
84
85 clock-controller@4000000 {
86 compatible = "qcom,mmcc-msm8960";
87 reg = <0x4000000 0x1000>;
88 #clock-cells = <1>;
89 #reset-cells = <1>;
90 };
91
92 acc0: clock-controller@2088000 {
93 compatible = "qcom,kpss-acc-v1";
94 reg = <0x02088000 0x1000>, <0x02008000 0x1000>;
95 };
96
97 acc1: clock-controller@2098000 {
98 compatible = "qcom,kpss-acc-v1";
99 reg = <0x02098000 0x1000>, <0x02008000 0x1000>;
100 };
101
102 saw0: regulator@2089000 {
103 compatible = "qcom,saw2";
104 reg = <0x02089000 0x1000>, <0x02009000 0x1000>;
105 regulator;
106 };
107
108 saw1: regulator@2099000 {
109 compatible = "qcom,saw2";
110 reg = <0x02099000 0x1000>, <0x02009000 0x1000>;
111 regulator;
112 };
113
114 serial@16440000 {
115 compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
116 reg = <0x16440000 0x1000>,
117 <0x16400000 0x1000>;
118 interrupts = <0 154 0x0>;
119 clocks = <&gcc GSBI5_UART_CLK>, <&gcc GSBI5_H_CLK>;
120 clock-names = "core", "iface";
121 };
122
123 qcom,ssbi@500000 {
124 compatible = "qcom,ssbi";
125 reg = <0x500000 0x1000>;
126 qcom,controller-type = "pmic-arbiter";
127 };
128
129 rng@1a500000 {
130 compatible = "qcom,prng";
131 reg = <0x1a500000 0x200>;
132 clocks = <&gcc PRNG_CLK>;
133 clock-names = "core";
134 };
135};
diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi
index 9e5dadb101eb..f68723918b3f 100644
--- a/arch/arm/boot/dts/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom-msm8974.dtsi
@@ -9,6 +9,54 @@
9 compatible = "qcom,msm8974"; 9 compatible = "qcom,msm8974";
10 interrupt-parent = <&intc>; 10 interrupt-parent = <&intc>;
11 11
12 cpus {
13 #address-cells = <1>;
14 #size-cells = <0>;
15 interrupts = <1 9 0xf04>;
16 compatible = "qcom,krait";
17 enable-method = "qcom,kpss-acc-v2";
18
19 cpu@0 {
20 device_type = "cpu";
21 reg = <0>;
22 next-level-cache = <&L2>;
23 qcom,acc = <&acc0>;
24 };
25
26 cpu@1 {
27 device_type = "cpu";
28 reg = <1>;
29 next-level-cache = <&L2>;
30 qcom,acc = <&acc1>;
31 };
32
33 cpu@2 {
34 device_type = "cpu";
35 reg = <2>;
36 next-level-cache = <&L2>;
37 qcom,acc = <&acc2>;
38 };
39
40 cpu@3 {
41 device_type = "cpu";
42 reg = <3>;
43 next-level-cache = <&L2>;
44 qcom,acc = <&acc3>;
45 };
46
47 L2: l2-cache {
48 compatible = "cache";
49 cache-level = <2>;
50 interrupts = <0 2 0x4>;
51 qcom,saw = <&saw_l2>;
52 };
53 };
54
55 cpu-pmu {
56 compatible = "qcom,krait-pmu";
57 interrupts = <1 7 0xf04>;
58 };
59
12 soc: soc { 60 soc: soc {
13 #address-cells = <1>; 61 #address-cells = <1>;
14 #size-cells = <1>; 62 #size-cells = <1>;
@@ -91,6 +139,32 @@
91 }; 139 };
92 }; 140 };
93 141
142 saw_l2: regulator@f9012000 {
143 compatible = "qcom,saw2";
144 reg = <0xf9012000 0x1000>;
145 regulator;
146 };
147
148 acc0: clock-controller@f9088000 {
149 compatible = "qcom,kpss-acc-v2";
150 reg = <0xf9088000 0x1000>, <0xf9008000 0x1000>;
151 };
152
153 acc1: clock-controller@f9098000 {
154 compatible = "qcom,kpss-acc-v2";
155 reg = <0xf9098000 0x1000>, <0xf9008000 0x1000>;
156 };
157
158 acc2: clock-controller@f90a8000 {
159 compatible = "qcom,kpss-acc-v2";
160 reg = <0xf90a8000 0x1000>, <0xf9008000 0x1000>;
161 };
162
163 acc3: clock-controller@f90b8000 {
164 compatible = "qcom,kpss-acc-v2";
165 reg = <0xf90b8000 0x1000>, <0xf9008000 0x1000>;
166 };
167
94 restart@fc4ab000 { 168 restart@fc4ab000 {
95 compatible = "qcom,pshold"; 169 compatible = "qcom,pshold";
96 reg = <0xfc4ab000 0x4>; 170 reg = <0xfc4ab000 0x4>;
@@ -117,5 +191,12 @@
117 clocks = <&gcc GCC_BLSP1_UART2_APPS_CLK>, <&gcc GCC_BLSP1_AHB_CLK>; 191 clocks = <&gcc GCC_BLSP1_UART2_APPS_CLK>, <&gcc GCC_BLSP1_AHB_CLK>;
118 clock-names = "core", "iface"; 192 clock-names = "core", "iface";
119 }; 193 };
194
195 rng@f9bff000 {
196 compatible = "qcom,prng";
197 reg = <0xf9bff000 0x200>;
198 clocks = <&gcc GCC_PRNG_AHB_CLK>;
199 clock-names = "core";
200 };
120 }; 201 };
121}; 202};
diff --git a/arch/arm/boot/dts/r7s72100-genmai-reference.dts b/arch/arm/boot/dts/r7s72100-genmai-reference.dts
index da19c70ed82b..e664611a47c8 100644
--- a/arch/arm/boot/dts/r7s72100-genmai-reference.dts
+++ b/arch/arm/boot/dts/r7s72100-genmai-reference.dts
@@ -9,7 +9,7 @@
9 */ 9 */
10 10
11/dts-v1/; 11/dts-v1/;
12/include/ "r7s72100.dtsi" 12#include "r7s72100.dtsi"
13 13
14/ { 14/ {
15 model = "Genmai"; 15 model = "Genmai";
@@ -29,3 +29,14 @@
29 #size-cells = <1>; 29 #size-cells = <1>;
30 }; 30 };
31}; 31};
32
33&i2c2 {
34 status = "okay";
35 clock-frequency = <400000>;
36
37 eeprom@50 {
38 compatible = "renesas,24c128";
39 reg = <0x50>;
40 pagesize = <64>;
41 };
42};
diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
index 46b82aa7dc4e..ee700717a34b 100644
--- a/arch/arm/boot/dts/r7s72100.dtsi
+++ b/arch/arm/boot/dts/r7s72100.dtsi
@@ -8,12 +8,26 @@
8 * kind, whether express or implied. 8 * kind, whether express or implied.
9 */ 9 */
10 10
11#include <dt-bindings/interrupt-controller/irq.h>
12
11/ { 13/ {
12 compatible = "renesas,r7s72100"; 14 compatible = "renesas,r7s72100";
13 interrupt-parent = <&gic>; 15 interrupt-parent = <&gic>;
14 #address-cells = <1>; 16 #address-cells = <1>;
15 #size-cells = <1>; 17 #size-cells = <1>;
16 18
19 aliases {
20 i2c0 = &i2c0;
21 i2c1 = &i2c1;
22 i2c2 = &i2c2;
23 i2c3 = &i2c3;
24 spi0 = &spi0;
25 spi1 = &spi1;
26 spi2 = &spi2;
27 spi3 = &spi3;
28 spi4 = &spi4;
29 };
30
17 cpus { 31 cpus {
18 #address-cells = <1>; 32 #address-cells = <1>;
19 #size-cells = <0>; 33 #size-cells = <0>;
@@ -33,4 +47,137 @@
33 reg = <0xe8201000 0x1000>, 47 reg = <0xe8201000 0x1000>,
34 <0xe8202000 0x1000>; 48 <0xe8202000 0x1000>;
35 }; 49 };
50
51 i2c0: i2c@fcfee000 {
52 #address-cells = <1>;
53 #size-cells = <0>;
54 compatible = "renesas,riic-r7s72100", "renesas,riic-rz";
55 reg = <0xfcfee000 0x44>;
56 interrupts = <0 157 IRQ_TYPE_LEVEL_HIGH>,
57 <0 158 IRQ_TYPE_EDGE_RISING>,
58 <0 159 IRQ_TYPE_EDGE_RISING>,
59 <0 160 IRQ_TYPE_LEVEL_HIGH>,
60 <0 161 IRQ_TYPE_LEVEL_HIGH>,
61 <0 162 IRQ_TYPE_LEVEL_HIGH>,
62 <0 163 IRQ_TYPE_LEVEL_HIGH>,
63 <0 164 IRQ_TYPE_LEVEL_HIGH>;
64 clock-frequency = <100000>;
65 status = "disabled";
66 };
67
68 i2c1: i2c@fcfee400 {
69 #address-cells = <1>;
70 #size-cells = <0>;
71 compatible = "renesas,riic-r7s72100", "renesas,riic-rz";
72 reg = <0xfcfee400 0x44>;
73 interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>,
74 <0 166 IRQ_TYPE_EDGE_RISING>,
75 <0 167 IRQ_TYPE_EDGE_RISING>,
76 <0 168 IRQ_TYPE_LEVEL_HIGH>,
77 <0 169 IRQ_TYPE_LEVEL_HIGH>,
78 <0 170 IRQ_TYPE_LEVEL_HIGH>,
79 <0 171 IRQ_TYPE_LEVEL_HIGH>,
80 <0 172 IRQ_TYPE_LEVEL_HIGH>;
81 clock-frequency = <100000>;
82 status = "disabled";
83 };
84
85 i2c2: i2c@fcfee800 {
86 #address-cells = <1>;
87 #size-cells = <0>;
88 compatible = "renesas,riic-r7s72100", "renesas,riic-rz";
89 reg = <0xfcfee800 0x44>;
90 interrupts = <0 173 IRQ_TYPE_LEVEL_HIGH>,
91 <0 174 IRQ_TYPE_EDGE_RISING>,
92 <0 175 IRQ_TYPE_EDGE_RISING>,
93 <0 176 IRQ_TYPE_LEVEL_HIGH>,
94 <0 177 IRQ_TYPE_LEVEL_HIGH>,
95 <0 178 IRQ_TYPE_LEVEL_HIGH>,
96 <0 179 IRQ_TYPE_LEVEL_HIGH>,
97 <0 180 IRQ_TYPE_LEVEL_HIGH>;
98 clock-frequency = <100000>;
99 status = "disabled";
100 };
101
102 i2c3: i2c@fcfeec00 {
103 #address-cells = <1>;
104 #size-cells = <0>;
105 compatible = "renesas,riic-r7s72100", "renesas,riic-rz";
106 reg = <0xfcfeec00 0x44>;
107 interrupts = <0 181 IRQ_TYPE_LEVEL_HIGH>,
108 <0 182 IRQ_TYPE_EDGE_RISING>,
109 <0 183 IRQ_TYPE_EDGE_RISING>,
110 <0 184 IRQ_TYPE_LEVEL_HIGH>,
111 <0 185 IRQ_TYPE_LEVEL_HIGH>,
112 <0 186 IRQ_TYPE_LEVEL_HIGH>,
113 <0 187 IRQ_TYPE_LEVEL_HIGH>,
114 <0 188 IRQ_TYPE_LEVEL_HIGH>;
115 clock-frequency = <100000>;
116 status = "disabled";
117 };
118
119 spi0: spi@e800c800 {
120 compatible = "renesas,rspi-r7s72100", "renesas,rspi-rz";
121 reg = <0xe800c800 0x24>;
122 interrupts = <0 238 IRQ_TYPE_LEVEL_HIGH>,
123 <0 239 IRQ_TYPE_LEVEL_HIGH>,
124 <0 240 IRQ_TYPE_LEVEL_HIGH>;
125 interrupt-names = "error", "rx", "tx";
126 num-cs = <1>;
127 #address-cells = <1>;
128 #size-cells = <0>;
129 status = "disabled";
130 };
131
132 spi1: spi@e800d000 {
133 compatible = "renesas,rspi-r7s72100", "renesas,rspi-rz";
134 reg = <0xe800d000 0x24>;
135 interrupts = <0 241 IRQ_TYPE_LEVEL_HIGH>,
136 <0 242 IRQ_TYPE_LEVEL_HIGH>,
137 <0 243 IRQ_TYPE_LEVEL_HIGH>;
138 interrupt-names = "error", "rx", "tx";
139 num-cs = <1>;
140 #address-cells = <1>;
141 #size-cells = <0>;
142 status = "disabled";
143 };
144
145 spi2: spi@e800d800 {
146 compatible = "renesas,rspi-r7s72100", "renesas,rspi-rz";
147 reg = <0xe800d800 0x24>;
148 interrupts = <0 244 IRQ_TYPE_LEVEL_HIGH>,
149 <0 245 IRQ_TYPE_LEVEL_HIGH>,
150 <0 246 IRQ_TYPE_LEVEL_HIGH>;
151 interrupt-names = "error", "rx", "tx";
152 num-cs = <1>;
153 #address-cells = <1>;
154 #size-cells = <0>;
155 status = "disabled";
156 };
157
158 spi3: spi@e800e000 {
159 compatible = "renesas,rspi-r7s72100", "renesas,rspi-rz";
160 reg = <0xe800e000 0x24>;
161 interrupts = <0 247 IRQ_TYPE_LEVEL_HIGH>,
162 <0 248 IRQ_TYPE_LEVEL_HIGH>,
163 <0 249 IRQ_TYPE_LEVEL_HIGH>;
164 interrupt-names = "error", "rx", "tx";
165 num-cs = <1>;
166 #address-cells = <1>;
167 #size-cells = <0>;
168 status = "disabled";
169 };
170
171 spi4: spi@e800e800 {
172 compatible = "renesas,rspi-r7s72100", "renesas,rspi-rz";
173 reg = <0xe800e800 0x24>;
174 interrupts = <0 250 IRQ_TYPE_LEVEL_HIGH>,
175 <0 251 IRQ_TYPE_LEVEL_HIGH>,
176 <0 252 IRQ_TYPE_LEVEL_HIGH>;
177 interrupt-names = "error", "rx", "tx";
178 num-cs = <1>;
179 #address-cells = <1>;
180 #size-cells = <0>;
181 status = "disabled";
182 };
36}; 183};
diff --git a/arch/arm/boot/dts/r8a7778-bockw-reference.dts b/arch/arm/boot/dts/r8a7778-bockw-reference.dts
index bb62c7a906f4..06cda19dac6a 100644
--- a/arch/arm/boot/dts/r8a7778-bockw-reference.dts
+++ b/arch/arm/boot/dts/r8a7778-bockw-reference.dts
@@ -17,6 +17,7 @@
17/dts-v1/; 17/dts-v1/;
18#include "r8a7778.dtsi" 18#include "r8a7778.dtsi"
19#include <dt-bindings/interrupt-controller/irq.h> 19#include <dt-bindings/interrupt-controller/irq.h>
20#include <dt-bindings/gpio/gpio.h>
20 21
21/ { 22/ {
22 model = "bockw"; 23 model = "bockw";
@@ -84,7 +85,7 @@
84 85
85 sdhi0_pins: sd0 { 86 sdhi0_pins: sd0 {
86 renesas,groups = "sdhi0_data4", "sdhi0_ctrl", 87 renesas,groups = "sdhi0_data4", "sdhi0_ctrl",
87 "sdhi0_cd", "sdhi0_wp"; 88 "sdhi0_cd";
88 renesas,function = "sdhi0"; 89 renesas,function = "sdhi0";
89 }; 90 };
90 91
@@ -101,6 +102,7 @@
101 vmmc-supply = <&fixedregulator3v3>; 102 vmmc-supply = <&fixedregulator3v3>;
102 bus-width = <4>; 103 bus-width = <4>;
103 status = "okay"; 104 status = "okay";
105 wp-gpios = <&gpio3 18 GPIO_ACTIVE_HIGH>;
104}; 106};
105 107
106&hspi0 { 108&hspi0 {
diff --git a/arch/arm/boot/dts/r8a7778.dtsi b/arch/arm/boot/dts/r8a7778.dtsi
index ddb3bd7a8838..85c5b3b99f5e 100644
--- a/arch/arm/boot/dts/r8a7778.dtsi
+++ b/arch/arm/boot/dts/r8a7778.dtsi
@@ -203,46 +203,6 @@
203 status = "disabled"; 203 status = "disabled";
204 }; 204 };
205 205
206 i2c0: i2c@ffc70000 {
207 #address-cells = <1>;
208 #size-cells = <0>;
209 compatible = "renesas,i2c-r8a7778";
210 reg = <0xffc70000 0x1000>;
211 interrupt-parent = <&gic>;
212 interrupts = <0 67 IRQ_TYPE_LEVEL_HIGH>;
213 status = "disabled";
214 };
215
216 i2c1: i2c@ffc71000 {
217 #address-cells = <1>;
218 #size-cells = <0>;
219 compatible = "renesas,i2c-r8a7778";
220 reg = <0xffc71000 0x1000>;
221 interrupt-parent = <&gic>;
222 interrupts = <0 78 IRQ_TYPE_LEVEL_HIGH>;
223 status = "disabled";
224 };
225
226 i2c2: i2c@ffc72000 {
227 #address-cells = <1>;
228 #size-cells = <0>;
229 compatible = "renesas,i2c-r8a7778";
230 reg = <0xffc72000 0x1000>;
231 interrupt-parent = <&gic>;
232 interrupts = <0 76 IRQ_TYPE_LEVEL_HIGH>;
233 status = "disabled";
234 };
235
236 i2c3: i2c@ffc73000 {
237 #address-cells = <1>;
238 #size-cells = <0>;
239 compatible = "renesas,i2c-r8a7778";
240 reg = <0xffc73000 0x1000>;
241 interrupt-parent = <&gic>;
242 interrupts = <0 77 IRQ_TYPE_LEVEL_HIGH>;
243 status = "disabled";
244 };
245
246 hspi0: spi@fffc7000 { 206 hspi0: spi@fffc7000 {
247 compatible = "renesas,hspi"; 207 compatible = "renesas,hspi";
248 reg = <0xfffc7000 0x18>; 208 reg = <0xfffc7000 0x18>;
diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
index 57569cba1528..6e99eb2df076 100644
--- a/arch/arm/boot/dts/r8a7790-lager.dts
+++ b/arch/arm/boot/dts/r8a7790-lager.dts
@@ -1,7 +1,8 @@
1/* 1/*
2 * Device Tree Source for the Lager board 2 * Device Tree Source for the Lager board
3 * 3 *
4 * Copyright (C) 2013 Renesas Solutions Corp. 4 * Copyright (C) 2013-2014 Renesas Solutions Corp.
5 * Copyright (C) 2014 Cogent Embedded, Inc.
5 * 6 *
6 * This file is licensed under the terms of the GNU General Public License 7 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any 8 * version 2. This program is licensed "as is" without any warranty of any
@@ -56,6 +57,54 @@
56 regulator-boot-on; 57 regulator-boot-on;
57 regulator-always-on; 58 regulator-always-on;
58 }; 59 };
60
61 vcc_sdhi0: regulator@1 {
62 compatible = "regulator-fixed";
63
64 regulator-name = "SDHI0 Vcc";
65 regulator-min-microvolt = <3300000>;
66 regulator-max-microvolt = <3300000>;
67
68 gpio = <&gpio5 24 GPIO_ACTIVE_HIGH>;
69 enable-active-high;
70 };
71
72 vccq_sdhi0: regulator@2 {
73 compatible = "regulator-gpio";
74
75 regulator-name = "SDHI0 VccQ";
76 regulator-min-microvolt = <1800000>;
77 regulator-max-microvolt = <3300000>;
78
79 gpios = <&gpio5 29 GPIO_ACTIVE_HIGH>;
80 gpios-states = <1>;
81 states = <3300000 1
82 1800000 0>;
83 };
84
85 vcc_sdhi2: regulator@3 {
86 compatible = "regulator-fixed";
87
88 regulator-name = "SDHI2 Vcc";
89 regulator-min-microvolt = <3300000>;
90 regulator-max-microvolt = <3300000>;
91
92 gpio = <&gpio5 25 GPIO_ACTIVE_HIGH>;
93 enable-active-high;
94 };
95
96 vccq_sdhi2: regulator@4 {
97 compatible = "regulator-gpio";
98
99 regulator-name = "SDHI2 VccQ";
100 regulator-min-microvolt = <1800000>;
101 regulator-max-microvolt = <3300000>;
102
103 gpios = <&gpio5 30 GPIO_ACTIVE_HIGH>;
104 gpios-states = <1>;
105 states = <3300000 1
106 1800000 0>;
107 };
59}; 108};
60 109
61&extal_clk { 110&extal_clk {
@@ -63,23 +112,68 @@
63}; 112};
64 113
65&pfc { 114&pfc {
66 pinctrl-0 = <&scif0_pins &scif1_pins>; 115 pinctrl-0 = <&du_pins &scif0_pins &scif1_pins>;
67 pinctrl-names = "default"; 116 pinctrl-names = "default";
68 117
118 du_pins: du {
119 renesas,groups = "du_rgb666", "du_sync_1", "du_clk_out_0";
120 renesas,function = "du";
121 };
122
69 scif0_pins: serial0 { 123 scif0_pins: serial0 {
70 renesas,groups = "scif0_data"; 124 renesas,groups = "scif0_data";
71 renesas,function = "scif0"; 125 renesas,function = "scif0";
72 }; 126 };
73 127
128 ether_pins: ether {
129 renesas,groups = "eth_link", "eth_mdio", "eth_rmii";
130 renesas,function = "eth";
131 };
132
133 phy1_pins: phy1 {
134 renesas,groups = "intc_irq0";
135 renesas,function = "intc";
136 };
137
74 scif1_pins: serial1 { 138 scif1_pins: serial1 {
75 renesas,groups = "scif1_data"; 139 renesas,groups = "scif1_data";
76 renesas,function = "scif1"; 140 renesas,function = "scif1";
77 }; 141 };
78 142
143 sdhi0_pins: sd0 {
144 renesas,gpios = "sdhi0_data4", "sdhi0_ctrl";
145 renesas,function = "sdhi0";
146 };
147
148 sdhi2_pins: sd2 {
149 renesas,gpios = "sdhi2_data4", "sdhi2_ctrl";
150 renesas,function = "sdhi2";
151 };
152
79 mmc1_pins: mmc1 { 153 mmc1_pins: mmc1 {
80 renesas,groups = "mmc1_data8", "mmc1_ctrl"; 154 renesas,groups = "mmc1_data8", "mmc1_ctrl";
81 renesas,function = "mmc1"; 155 renesas,function = "mmc1";
82 }; 156 };
157
158 qspi_pins: spi {
159 renesas,groups = "qspi_ctrl", "qspi_data4";
160 renesas,function = "qspi";
161 };
162};
163
164&ether {
165 pinctrl-0 = <&ether_pins &phy1_pins>;
166 pinctrl-names = "default";
167
168 phy-handle = <&phy1>;
169 renesas,ether-link-active-low;
170 status = "ok";
171
172 phy1: ethernet-phy@1 {
173 reg = <1>;
174 interrupt-parent = <&irqc0>;
175 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
176 };
83}; 177};
84 178
85&mmcif1 { 179&mmcif1 {
@@ -91,3 +185,58 @@
91 non-removable; 185 non-removable;
92 status = "okay"; 186 status = "okay";
93}; 187};
188
189&sata1 {
190 status = "okay";
191};
192
193&spi {
194 pinctrl-0 = <&qspi_pins>;
195 pinctrl-names = "default";
196
197 status = "okay";
198
199 flash: flash@0 {
200 #address-cells = <1>;
201 #size-cells = <1>;
202 compatible = "spansion,s25fl512s";
203 reg = <0>;
204 spi-max-frequency = <30000000>;
205 m25p,fast-read;
206
207 partition@0 {
208 label = "loader";
209 reg = <0x00000000 0x00040000>;
210 read-only;
211 };
212 partition@40000 {
213 label = "user";
214 reg = <0x00040000 0x00400000>;
215 read-only;
216 };
217 partition@440000 {
218 label = "flash";
219 reg = <0x00440000 0x03bc0000>;
220 };
221 };
222};
223
224&sdhi0 {
225 pinctrl-0 = <&sdhi0_pins>;
226 pinctrl-names = "default";
227
228 vmmc-supply = <&vcc_sdhi0>;
229 vqmmc-supply = <&vccq_sdhi0>;
230 cd-gpios = <&gpio3 6 GPIO_ACTIVE_LOW>;
231 status = "okay";
232};
233
234&sdhi2 {
235 pinctrl-0 = <&sdhi2_pins>;
236 pinctrl-names = "default";
237
238 vmmc-supply = <&vcc_sdhi2>;
239 vqmmc-supply = <&vccq_sdhi2>;
240 cd-gpios = <&gpio3 22 GPIO_ACTIVE_LOW>;
241 status = "okay";
242};
diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 71b1251f79c7..618e5b537eaf 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -1,7 +1,8 @@
1/* 1/*
2 * Device Tree Source for the r8a7790 SoC 2 * Device Tree Source for the r8a7790 SoC
3 * 3 *
4 * Copyright (C) 2013 Renesas Solutions Corp. 4 * Copyright (C) 2013-2014 Renesas Solutions Corp.
5 * Copyright (C) 2014 Cogent Embedded Inc.
5 * 6 *
6 * This file is licensed under the terms of the GNU General Public License 7 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any 8 * version 2. This program is licensed "as is" without any warranty of any
@@ -18,6 +19,13 @@
18 #address-cells = <2>; 19 #address-cells = <2>;
19 #size-cells = <2>; 20 #size-cells = <2>;
20 21
22 aliases {
23 i2c0 = &i2c0;
24 i2c1 = &i2c1;
25 i2c2 = &i2c2;
26 i2c3 = &i2c3;
27 };
28
21 cpus { 29 cpus {
22 #address-cells = <1>; 30 #address-cells = <1>;
23 #size-cells = <0>; 31 #size-cells = <0>;
@@ -94,7 +102,6 @@
94 gpio0: gpio@e6050000 { 102 gpio0: gpio@e6050000 {
95 compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar"; 103 compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar";
96 reg = <0 0xe6050000 0 0x50>; 104 reg = <0 0xe6050000 0 0x50>;
97 interrupt-parent = <&gic>;
98 interrupts = <0 4 IRQ_TYPE_LEVEL_HIGH>; 105 interrupts = <0 4 IRQ_TYPE_LEVEL_HIGH>;
99 #gpio-cells = <2>; 106 #gpio-cells = <2>;
100 gpio-controller; 107 gpio-controller;
@@ -106,7 +113,6 @@
106 gpio1: gpio@e6051000 { 113 gpio1: gpio@e6051000 {
107 compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar"; 114 compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar";
108 reg = <0 0xe6051000 0 0x50>; 115 reg = <0 0xe6051000 0 0x50>;
109 interrupt-parent = <&gic>;
110 interrupts = <0 5 IRQ_TYPE_LEVEL_HIGH>; 116 interrupts = <0 5 IRQ_TYPE_LEVEL_HIGH>;
111 #gpio-cells = <2>; 117 #gpio-cells = <2>;
112 gpio-controller; 118 gpio-controller;
@@ -118,7 +124,6 @@
118 gpio2: gpio@e6052000 { 124 gpio2: gpio@e6052000 {
119 compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar"; 125 compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar";
120 reg = <0 0xe6052000 0 0x50>; 126 reg = <0 0xe6052000 0 0x50>;
121 interrupt-parent = <&gic>;
122 interrupts = <0 6 IRQ_TYPE_LEVEL_HIGH>; 127 interrupts = <0 6 IRQ_TYPE_LEVEL_HIGH>;
123 #gpio-cells = <2>; 128 #gpio-cells = <2>;
124 gpio-controller; 129 gpio-controller;
@@ -130,7 +135,6 @@
130 gpio3: gpio@e6053000 { 135 gpio3: gpio@e6053000 {
131 compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar"; 136 compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar";
132 reg = <0 0xe6053000 0 0x50>; 137 reg = <0 0xe6053000 0 0x50>;
133 interrupt-parent = <&gic>;
134 interrupts = <0 7 IRQ_TYPE_LEVEL_HIGH>; 138 interrupts = <0 7 IRQ_TYPE_LEVEL_HIGH>;
135 #gpio-cells = <2>; 139 #gpio-cells = <2>;
136 gpio-controller; 140 gpio-controller;
@@ -142,7 +146,6 @@
142 gpio4: gpio@e6054000 { 146 gpio4: gpio@e6054000 {
143 compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar"; 147 compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar";
144 reg = <0 0xe6054000 0 0x50>; 148 reg = <0 0xe6054000 0 0x50>;
145 interrupt-parent = <&gic>;
146 interrupts = <0 8 IRQ_TYPE_LEVEL_HIGH>; 149 interrupts = <0 8 IRQ_TYPE_LEVEL_HIGH>;
147 #gpio-cells = <2>; 150 #gpio-cells = <2>;
148 gpio-controller; 151 gpio-controller;
@@ -154,7 +157,6 @@
154 gpio5: gpio@e6055000 { 157 gpio5: gpio@e6055000 {
155 compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar"; 158 compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar";
156 reg = <0 0xe6055000 0 0x50>; 159 reg = <0 0xe6055000 0 0x50>;
157 interrupt-parent = <&gic>;
158 interrupts = <0 9 IRQ_TYPE_LEVEL_HIGH>; 160 interrupts = <0 9 IRQ_TYPE_LEVEL_HIGH>;
159 #gpio-cells = <2>; 161 #gpio-cells = <2>;
160 gpio-controller; 162 gpio-controller;
@@ -166,8 +168,8 @@
166 thermal@e61f0000 { 168 thermal@e61f0000 {
167 compatible = "renesas,thermal-r8a7790", "renesas,rcar-thermal"; 169 compatible = "renesas,thermal-r8a7790", "renesas,rcar-thermal";
168 reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>; 170 reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
169 interrupt-parent = <&gic>;
170 interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>; 171 interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
172 clocks = <&mstp5_clks R8A7790_CLK_THERMAL>;
171 }; 173 };
172 174
173 timer { 175 timer {
@@ -183,7 +185,6 @@
183 #interrupt-cells = <2>; 185 #interrupt-cells = <2>;
184 interrupt-controller; 186 interrupt-controller;
185 reg = <0 0xe61c0000 0 0x200>; 187 reg = <0 0xe61c0000 0 0x200>;
186 interrupt-parent = <&gic>;
187 interrupts = <0 0 IRQ_TYPE_LEVEL_HIGH>, 188 interrupts = <0 0 IRQ_TYPE_LEVEL_HIGH>,
188 <0 1 IRQ_TYPE_LEVEL_HIGH>, 189 <0 1 IRQ_TYPE_LEVEL_HIGH>,
189 <0 2 IRQ_TYPE_LEVEL_HIGH>, 190 <0 2 IRQ_TYPE_LEVEL_HIGH>,
@@ -195,7 +196,6 @@
195 #size-cells = <0>; 196 #size-cells = <0>;
196 compatible = "renesas,i2c-r8a7790"; 197 compatible = "renesas,i2c-r8a7790";
197 reg = <0 0xe6508000 0 0x40>; 198 reg = <0 0xe6508000 0 0x40>;
198 interrupt-parent = <&gic>;
199 interrupts = <0 287 IRQ_TYPE_LEVEL_HIGH>; 199 interrupts = <0 287 IRQ_TYPE_LEVEL_HIGH>;
200 clocks = <&mstp9_clks R8A7790_CLK_I2C0>; 200 clocks = <&mstp9_clks R8A7790_CLK_I2C0>;
201 status = "disabled"; 201 status = "disabled";
@@ -206,7 +206,6 @@
206 #size-cells = <0>; 206 #size-cells = <0>;
207 compatible = "renesas,i2c-r8a7790"; 207 compatible = "renesas,i2c-r8a7790";
208 reg = <0 0xe6518000 0 0x40>; 208 reg = <0 0xe6518000 0 0x40>;
209 interrupt-parent = <&gic>;
210 interrupts = <0 288 IRQ_TYPE_LEVEL_HIGH>; 209 interrupts = <0 288 IRQ_TYPE_LEVEL_HIGH>;
211 clocks = <&mstp9_clks R8A7790_CLK_I2C1>; 210 clocks = <&mstp9_clks R8A7790_CLK_I2C1>;
212 status = "disabled"; 211 status = "disabled";
@@ -217,7 +216,6 @@
217 #size-cells = <0>; 216 #size-cells = <0>;
218 compatible = "renesas,i2c-r8a7790"; 217 compatible = "renesas,i2c-r8a7790";
219 reg = <0 0xe6530000 0 0x40>; 218 reg = <0 0xe6530000 0 0x40>;
220 interrupt-parent = <&gic>;
221 interrupts = <0 286 IRQ_TYPE_LEVEL_HIGH>; 219 interrupts = <0 286 IRQ_TYPE_LEVEL_HIGH>;
222 clocks = <&mstp9_clks R8A7790_CLK_I2C2>; 220 clocks = <&mstp9_clks R8A7790_CLK_I2C2>;
223 status = "disabled"; 221 status = "disabled";
@@ -228,7 +226,6 @@
228 #size-cells = <0>; 226 #size-cells = <0>;
229 compatible = "renesas,i2c-r8a7790"; 227 compatible = "renesas,i2c-r8a7790";
230 reg = <0 0xe6540000 0 0x40>; 228 reg = <0 0xe6540000 0 0x40>;
231 interrupt-parent = <&gic>;
232 interrupts = <0 290 IRQ_TYPE_LEVEL_HIGH>; 229 interrupts = <0 290 IRQ_TYPE_LEVEL_HIGH>;
233 clocks = <&mstp9_clks R8A7790_CLK_I2C3>; 230 clocks = <&mstp9_clks R8A7790_CLK_I2C3>;
234 status = "disabled"; 231 status = "disabled";
@@ -237,7 +234,6 @@
237 mmcif0: mmcif@ee200000 { 234 mmcif0: mmcif@ee200000 {
238 compatible = "renesas,mmcif-r8a7790", "renesas,sh-mmcif"; 235 compatible = "renesas,mmcif-r8a7790", "renesas,sh-mmcif";
239 reg = <0 0xee200000 0 0x80>; 236 reg = <0 0xee200000 0 0x80>;
240 interrupt-parent = <&gic>;
241 interrupts = <0 169 IRQ_TYPE_LEVEL_HIGH>; 237 interrupts = <0 169 IRQ_TYPE_LEVEL_HIGH>;
242 clocks = <&mstp3_clks R8A7790_CLK_MMCIF0>; 238 clocks = <&mstp3_clks R8A7790_CLK_MMCIF0>;
243 reg-io-width = <4>; 239 reg-io-width = <4>;
@@ -247,7 +243,6 @@
247 mmcif1: mmc@ee220000 { 243 mmcif1: mmc@ee220000 {
248 compatible = "renesas,mmcif-r8a7790", "renesas,sh-mmcif"; 244 compatible = "renesas,mmcif-r8a7790", "renesas,sh-mmcif";
249 reg = <0 0xee220000 0 0x80>; 245 reg = <0 0xee220000 0 0x80>;
250 interrupt-parent = <&gic>;
251 interrupts = <0 170 IRQ_TYPE_LEVEL_HIGH>; 246 interrupts = <0 170 IRQ_TYPE_LEVEL_HIGH>;
252 clocks = <&mstp3_clks R8A7790_CLK_MMCIF1>; 247 clocks = <&mstp3_clks R8A7790_CLK_MMCIF1>;
253 reg-io-width = <4>; 248 reg-io-width = <4>;
@@ -262,7 +257,6 @@
262 sdhi0: sd@ee100000 { 257 sdhi0: sd@ee100000 {
263 compatible = "renesas,sdhi-r8a7790"; 258 compatible = "renesas,sdhi-r8a7790";
264 reg = <0 0xee100000 0 0x200>; 259 reg = <0 0xee100000 0 0x200>;
265 interrupt-parent = <&gic>;
266 interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>; 260 interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
267 clocks = <&mstp3_clks R8A7790_CLK_SDHI0>; 261 clocks = <&mstp3_clks R8A7790_CLK_SDHI0>;
268 cap-sd-highspeed; 262 cap-sd-highspeed;
@@ -272,7 +266,6 @@
272 sdhi1: sd@ee120000 { 266 sdhi1: sd@ee120000 {
273 compatible = "renesas,sdhi-r8a7790"; 267 compatible = "renesas,sdhi-r8a7790";
274 reg = <0 0xee120000 0 0x200>; 268 reg = <0 0xee120000 0 0x200>;
275 interrupt-parent = <&gic>;
276 interrupts = <0 166 IRQ_TYPE_LEVEL_HIGH>; 269 interrupts = <0 166 IRQ_TYPE_LEVEL_HIGH>;
277 clocks = <&mstp3_clks R8A7790_CLK_SDHI1>; 270 clocks = <&mstp3_clks R8A7790_CLK_SDHI1>;
278 cap-sd-highspeed; 271 cap-sd-highspeed;
@@ -282,7 +275,6 @@
282 sdhi2: sd@ee140000 { 275 sdhi2: sd@ee140000 {
283 compatible = "renesas,sdhi-r8a7790"; 276 compatible = "renesas,sdhi-r8a7790";
284 reg = <0 0xee140000 0 0x100>; 277 reg = <0 0xee140000 0 0x100>;
285 interrupt-parent = <&gic>;
286 interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>; 278 interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>;
287 clocks = <&mstp3_clks R8A7790_CLK_SDHI2>; 279 clocks = <&mstp3_clks R8A7790_CLK_SDHI2>;
288 cap-sd-highspeed; 280 cap-sd-highspeed;
@@ -292,13 +284,129 @@
292 sdhi3: sd@ee160000 { 284 sdhi3: sd@ee160000 {
293 compatible = "renesas,sdhi-r8a7790"; 285 compatible = "renesas,sdhi-r8a7790";
294 reg = <0 0xee160000 0 0x100>; 286 reg = <0 0xee160000 0 0x100>;
295 interrupt-parent = <&gic>;
296 interrupts = <0 168 IRQ_TYPE_LEVEL_HIGH>; 287 interrupts = <0 168 IRQ_TYPE_LEVEL_HIGH>;
297 clocks = <&mstp3_clks R8A7790_CLK_SDHI3>; 288 clocks = <&mstp3_clks R8A7790_CLK_SDHI3>;
298 cap-sd-highspeed; 289 cap-sd-highspeed;
299 status = "disabled"; 290 status = "disabled";
300 }; 291 };
301 292
293 scifa0: serial@e6c40000 {
294 compatible = "renesas,scifa-r8a7790", "renesas,scifa";
295 reg = <0 0xe6c40000 0 64>;
296 interrupts = <0 144 IRQ_TYPE_LEVEL_HIGH>;
297 clocks = <&mstp2_clks R8A7790_CLK_SCIFA0>;
298 clock-names = "sci_ick";
299 status = "disabled";
300 };
301
302 scifa1: serial@e6c50000 {
303 compatible = "renesas,scifa-r8a7790", "renesas,scifa";
304 reg = <0 0xe6c50000 0 64>;
305 interrupts = <0 145 IRQ_TYPE_LEVEL_HIGH>;
306 clocks = <&mstp2_clks R8A7790_CLK_SCIFA1>;
307 clock-names = "sci_ick";
308 status = "disabled";
309 };
310
311 scifa2: serial@e6c60000 {
312 compatible = "renesas,scifa-r8a7790", "renesas,scifa";
313 reg = <0 0xe6c60000 0 64>;
314 interrupts = <0 151 IRQ_TYPE_LEVEL_HIGH>;
315 clocks = <&mstp2_clks R8A7790_CLK_SCIFA2>;
316 clock-names = "sci_ick";
317 status = "disabled";
318 };
319
320 scifb0: serial@e6c20000 {
321 compatible = "renesas,scifb-r8a7790", "renesas,scifb";
322 reg = <0 0xe6c20000 0 64>;
323 interrupts = <0 148 IRQ_TYPE_LEVEL_HIGH>;
324 clocks = <&mstp2_clks R8A7790_CLK_SCIFB0>;
325 clock-names = "sci_ick";
326 status = "disabled";
327 };
328
329 scifb1: serial@e6c30000 {
330 compatible = "renesas,scifb-r8a7790", "renesas,scifb";
331 reg = <0 0xe6c30000 0 64>;
332 interrupts = <0 149 IRQ_TYPE_LEVEL_HIGH>;
333 clocks = <&mstp2_clks R8A7790_CLK_SCIFB1>;
334 clock-names = "sci_ick";
335 status = "disabled";
336 };
337
338 scifb2: serial@e6ce0000 {
339 compatible = "renesas,scifb-r8a7790", "renesas,scifb";
340 reg = <0 0xe6ce0000 0 64>;
341 interrupts = <0 150 IRQ_TYPE_LEVEL_HIGH>;
342 clocks = <&mstp2_clks R8A7790_CLK_SCIFB2>;
343 clock-names = "sci_ick";
344 status = "disabled";
345 };
346
347 scif0: serial@e6e60000 {
348 compatible = "renesas,scif-r8a7790", "renesas,scif";
349 reg = <0 0xe6e60000 0 64>;
350 interrupts = <0 152 IRQ_TYPE_LEVEL_HIGH>;
351 clocks = <&mstp7_clks R8A7790_CLK_SCIF0>;
352 clock-names = "sci_ick";
353 status = "disabled";
354 };
355
356 scif1: serial@e6e68000 {
357 compatible = "renesas,scif-r8a7790", "renesas,scif";
358 reg = <0 0xe6e68000 0 64>;
359 interrupts = <0 153 IRQ_TYPE_LEVEL_HIGH>;
360 clocks = <&mstp7_clks R8A7790_CLK_SCIF1>;
361 clock-names = "sci_ick";
362 status = "disabled";
363 };
364
365 hscif0: serial@e62c0000 {
366 compatible = "renesas,hscif-r8a7790", "renesas,hscif";
367 reg = <0 0xe62c0000 0 96>;
368 interrupts = <0 154 IRQ_TYPE_LEVEL_HIGH>;
369 clocks = <&mstp7_clks R8A7790_CLK_HSCIF0>;
370 clock-names = "sci_ick";
371 status = "disabled";
372 };
373
374 hscif1: serial@e62c8000 {
375 compatible = "renesas,hscif-r8a7790", "renesas,hscif";
376 reg = <0 0xe62c8000 0 96>;
377 interrupts = <0 155 IRQ_TYPE_LEVEL_HIGH>;
378 clocks = <&mstp7_clks R8A7790_CLK_HSCIF1>;
379 clock-names = "sci_ick";
380 status = "disabled";
381 };
382
383 ether: ethernet@ee700000 {
384 compatible = "renesas,ether-r8a7790";
385 reg = <0 0xee700000 0 0x400>;
386 interrupts = <0 162 IRQ_TYPE_LEVEL_HIGH>;
387 clocks = <&mstp8_clks R8A7790_CLK_ETHER>;
388 phy-mode = "rmii";
389 #address-cells = <1>;
390 #size-cells = <0>;
391 status = "disabled";
392 };
393
394 sata0: sata@ee300000 {
395 compatible = "renesas,sata-r8a7790";
396 reg = <0 0xee300000 0 0x2000>;
397 interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>;
398 clocks = <&mstp8_clks R8A7790_CLK_SATA0>;
399 status = "disabled";
400 };
401
402 sata1: sata@ee500000 {
403 compatible = "renesas,sata-r8a7790";
404 reg = <0 0xee500000 0 0x2000>;
405 interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
406 clocks = <&mstp8_clks R8A7790_CLK_SATA1>;
407 status = "disabled";
408 };
409
302 clocks { 410 clocks {
303 #address-cells = <2>; 411 #address-cells = <2>;
304 #size-cells = <2>; 412 #size-cells = <2>;
@@ -313,6 +421,29 @@
313 clock-output-names = "extal"; 421 clock-output-names = "extal";
314 }; 422 };
315 423
424 /*
425 * The external audio clocks are configured as 0 Hz fixed frequency clocks by
426 * default. Boards that provide audio clocks should override them.
427 */
428 audio_clk_a: audio_clk_a {
429 compatible = "fixed-clock";
430 #clock-cells = <0>;
431 clock-frequency = <0>;
432 clock-output-names = "audio_clk_a";
433 };
434 audio_clk_b: audio_clk_b {
435 compatible = "fixed-clock";
436 #clock-cells = <0>;
437 clock-frequency = <0>;
438 clock-output-names = "audio_clk_b";
439 };
440 audio_clk_c: audio_clk_c {
441 compatible = "fixed-clock";
442 #clock-cells = <0>;
443 clock-frequency = <0>;
444 clock-output-names = "audio_clk_c";
445 };
446
316 /* Special CPG clocks */ 447 /* Special CPG clocks */
317 cpg_clocks: cpg_clocks@e6150000 { 448 cpg_clocks: cpg_clocks@e6150000 {
318 compatible = "renesas,r8a7790-cpg-clocks", 449 compatible = "renesas,r8a7790-cpg-clocks",
@@ -607,10 +738,16 @@
607 mstp8_clks: mstp8_clks@e6150990 { 738 mstp8_clks: mstp8_clks@e6150990 {
608 compatible = "renesas,r8a7790-mstp-clocks", "renesas,cpg-mstp-clocks"; 739 compatible = "renesas,r8a7790-mstp-clocks", "renesas,cpg-mstp-clocks";
609 reg = <0 0xe6150990 0 4>, <0 0xe61509a0 0 4>; 740 reg = <0 0xe6150990 0 4>, <0 0xe61509a0 0 4>;
610 clocks = <&p_clk>; 741 clocks = <&zg_clk>, <&zg_clk>, <&zg_clk>, <&zg_clk>, <&p_clk>,
742 <&zs_clk>, <&zs_clk>;
611 #clock-cells = <1>; 743 #clock-cells = <1>;
612 renesas,clock-indices = <R8A7790_CLK_ETHER>; 744 renesas,clock-indices = <
613 clock-output-names = "ether"; 745 R8A7790_CLK_VIN3 R8A7790_CLK_VIN2 R8A7790_CLK_VIN1
746 R8A7790_CLK_VIN0 R8A7790_CLK_ETHER R8A7790_CLK_SATA1
747 R8A7790_CLK_SATA0
748 >;
749 clock-output-names =
750 "vin3", "vin2", "vin1", "vin0", "ether", "sata1", "sata0";
614 }; 751 };
615 mstp9_clks: mstp9_clks@e6150994 { 752 mstp9_clks: mstp9_clks@e6150994 {
616 compatible = "renesas,r8a7790-mstp-clocks", "renesas,cpg-mstp-clocks"; 753 compatible = "renesas,r8a7790-mstp-clocks", "renesas,cpg-mstp-clocks";
@@ -627,4 +764,15 @@
627 "rcan1", "rcan0", "qspi_mod", "i2c3", "i2c2", "i2c1", "i2c0"; 764 "rcan1", "rcan0", "qspi_mod", "i2c3", "i2c2", "i2c1", "i2c0";
628 }; 765 };
629 }; 766 };
767
768 spi: spi@e6b10000 {
769 compatible = "renesas,qspi-r8a7790", "renesas,qspi";
770 reg = <0 0xe6b10000 0 0x2c>;
771 interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
772 clocks = <&mstp9_clks R8A7790_CLK_QSPI_MOD>;
773 num-cs = <1>;
774 #address-cells = <1>;
775 #size-cells = <0>;
776 status = "disabled";
777 };
630}; 778};
diff --git a/arch/arm/boot/dts/r8a7791-koelsch-reference.dts b/arch/arm/boot/dts/r8a7791-koelsch-reference.dts
deleted file mode 100644
index 588ca17ea1f0..000000000000
--- a/arch/arm/boot/dts/r8a7791-koelsch-reference.dts
+++ /dev/null
@@ -1,115 +0,0 @@
1/*
2 * Device Tree Source for the Koelsch board
3 *
4 * Copyright (C) 2013 Renesas Electronics Corporation
5 * Copyright (C) 2013 Renesas Solutions Corp.
6 *
7 * This file is licensed under the terms of the GNU General Public License
8 * version 2. This program is licensed "as is" without any warranty of any
9 * kind, whether express or implied.
10 */
11
12/dts-v1/;
13#include "r8a7791.dtsi"
14#include <dt-bindings/gpio/gpio.h>
15
16/ {
17 model = "Koelsch";
18 compatible = "renesas,koelsch-reference", "renesas,r8a7791";
19
20 chosen {
21 bootargs = "console=ttySC6,115200 ignore_loglevel rw root=/dev/nfs ip=dhcp";
22 };
23
24 memory@40000000 {
25 device_type = "memory";
26 reg = <0 0x40000000 0 0x80000000>;
27 };
28
29 lbsc {
30 #address-cells = <1>;
31 #size-cells = <1>;
32 };
33
34 gpio-keys {
35 compatible = "gpio-keys";
36
37 key-a {
38 gpios = <&gpio7 0 GPIO_ACTIVE_LOW>;
39 linux,code = <30>;
40 label = "SW30";
41 gpio-key,wakeup;
42 debounce-interval = <20>;
43 };
44 key-b {
45 gpios = <&gpio7 1 GPIO_ACTIVE_LOW>;
46 linux,code = <48>;
47 label = "SW31";
48 gpio-key,wakeup;
49 debounce-interval = <20>;
50 };
51 key-c {
52 gpios = <&gpio7 2 GPIO_ACTIVE_LOW>;
53 linux,code = <46>;
54 label = "SW32";
55 gpio-key,wakeup;
56 debounce-interval = <20>;
57 };
58 key-d {
59 gpios = <&gpio7 3 GPIO_ACTIVE_LOW>;
60 linux,code = <32>;
61 label = "SW33";
62 gpio-key,wakeup;
63 debounce-interval = <20>;
64 };
65 key-e {
66 gpios = <&gpio7 4 GPIO_ACTIVE_LOW>;
67 linux,code = <18>;
68 label = "SW34";
69 gpio-key,wakeup;
70 debounce-interval = <20>;
71 };
72 key-f {
73 gpios = <&gpio7 5 GPIO_ACTIVE_LOW>;
74 linux,code = <33>;
75 label = "SW35";
76 gpio-key,wakeup;
77 debounce-interval = <20>;
78 };
79 key-g {
80 gpios = <&gpio7 6 GPIO_ACTIVE_LOW>;
81 linux,code = <34>;
82 label = "SW36";
83 gpio-key,wakeup;
84 debounce-interval = <20>;
85 };
86 };
87
88 leds {
89 compatible = "gpio-leds";
90 led6 {
91 gpios = <&gpio2 19 GPIO_ACTIVE_HIGH>;
92 };
93 led7 {
94 gpios = <&gpio2 20 GPIO_ACTIVE_HIGH>;
95 };
96 led8 {
97 gpios = <&gpio2 21 GPIO_ACTIVE_HIGH>;
98 };
99 };
100};
101
102&pfc {
103 pinctrl-0 = <&scif0_pins &scif1_pins>;
104 pinctrl-names = "default";
105
106 scif0_pins: serial0 {
107 renesas,groups = "scif0_data_d";
108 renesas,function = "scif0";
109 };
110
111 scif1_pins: serial1 {
112 renesas,groups = "scif1_data_d";
113 renesas,function = "scif1";
114 };
115};
diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts
index fd556c3483e3..bdd73e6657b2 100644
--- a/arch/arm/boot/dts/r8a7791-koelsch.dts
+++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
@@ -2,7 +2,8 @@
2 * Device Tree Source for the Koelsch board 2 * Device Tree Source for the Koelsch board
3 * 3 *
4 * Copyright (C) 2013 Renesas Electronics Corporation 4 * Copyright (C) 2013 Renesas Electronics Corporation
5 * Copyright (C) 2013 Renesas Solutions Corp. 5 * Copyright (C) 2013-2014 Renesas Solutions Corp.
6 * Copyright (C) 2014 Cogent Embedded, Inc.
6 * 7 *
7 * 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
8 * 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
@@ -23,7 +24,12 @@
23 24
24 memory@40000000 { 25 memory@40000000 {
25 device_type = "memory"; 26 device_type = "memory";
26 reg = <0 0x40000000 0 0x80000000>; 27 reg = <0 0x40000000 0 0x40000000>;
28 };
29
30 memory@200000000 {
31 device_type = "memory";
32 reg = <2 0x00000000 0 0x40000000>;
27 }; 33 };
28 34
29 lbsc { 35 lbsc {
@@ -31,6 +37,60 @@
31 #size-cells = <1>; 37 #size-cells = <1>;
32 }; 38 };
33 39
40 gpio-keys {
41 compatible = "gpio-keys";
42
43 key-a {
44 gpios = <&gpio7 0 GPIO_ACTIVE_LOW>;
45 linux,code = <30>;
46 label = "SW30";
47 gpio-key,wakeup;
48 debounce-interval = <20>;
49 };
50 key-b {
51 gpios = <&gpio7 1 GPIO_ACTIVE_LOW>;
52 linux,code = <48>;
53 label = "SW31";
54 gpio-key,wakeup;
55 debounce-interval = <20>;
56 };
57 key-c {
58 gpios = <&gpio7 2 GPIO_ACTIVE_LOW>;
59 linux,code = <46>;
60 label = "SW32";
61 gpio-key,wakeup;
62 debounce-interval = <20>;
63 };
64 key-d {
65 gpios = <&gpio7 3 GPIO_ACTIVE_LOW>;
66 linux,code = <32>;
67 label = "SW33";
68 gpio-key,wakeup;
69 debounce-interval = <20>;
70 };
71 key-e {
72 gpios = <&gpio7 4 GPIO_ACTIVE_LOW>;
73 linux,code = <18>;
74 label = "SW34";
75 gpio-key,wakeup;
76 debounce-interval = <20>;
77 };
78 key-f {
79 gpios = <&gpio7 5 GPIO_ACTIVE_LOW>;
80 linux,code = <33>;
81 label = "SW35";
82 gpio-key,wakeup;
83 debounce-interval = <20>;
84 };
85 key-g {
86 gpios = <&gpio7 6 GPIO_ACTIVE_LOW>;
87 linux,code = <34>;
88 label = "SW36";
89 gpio-key,wakeup;
90 debounce-interval = <20>;
91 };
92 };
93
34 leds { 94 leds {
35 compatible = "gpio-leds"; 95 compatible = "gpio-leds";
36 led6 { 96 led6 {
@@ -43,16 +103,112 @@
43 gpios = <&gpio2 21 GPIO_ACTIVE_HIGH>; 103 gpios = <&gpio2 21 GPIO_ACTIVE_HIGH>;
44 }; 104 };
45 }; 105 };
106
107 vcc_sdhi0: regulator@0 {
108 compatible = "regulator-fixed";
109
110 regulator-name = "SDHI0 Vcc";
111 regulator-min-microvolt = <3300000>;
112 regulator-max-microvolt = <3300000>;
113
114 gpio = <&gpio7 17 GPIO_ACTIVE_HIGH>;
115 enable-active-high;
116 };
117
118 vccq_sdhi0: regulator@1 {
119 compatible = "regulator-gpio";
120
121 regulator-name = "SDHI0 VccQ";
122 regulator-min-microvolt = <1800000>;
123 regulator-max-microvolt = <3300000>;
124
125 gpios = <&gpio2 12 GPIO_ACTIVE_HIGH>;
126 gpios-states = <1>;
127 states = <3300000 1
128 1800000 0>;
129 };
130
131 vcc_sdhi1: regulator@2 {
132 compatible = "regulator-fixed";
133
134 regulator-name = "SDHI1 Vcc";
135 regulator-min-microvolt = <3300000>;
136 regulator-max-microvolt = <3300000>;
137
138 gpio = <&gpio7 18 GPIO_ACTIVE_HIGH>;
139 enable-active-high;
140 };
141
142 vccq_sdhi1: regulator@3 {
143 compatible = "regulator-gpio";
144
145 regulator-name = "SDHI1 VccQ";
146 regulator-min-microvolt = <1800000>;
147 regulator-max-microvolt = <3300000>;
148
149 gpios = <&gpio2 13 GPIO_ACTIVE_HIGH>;
150 gpios-states = <1>;
151 states = <3300000 1
152 1800000 0>;
153 };
154
155 vcc_sdhi2: regulator@4 {
156 compatible = "regulator-fixed";
157
158 regulator-name = "SDHI2 Vcc";
159 regulator-min-microvolt = <3300000>;
160 regulator-max-microvolt = <3300000>;
161
162 gpio = <&gpio7 19 GPIO_ACTIVE_HIGH>;
163 enable-active-high;
164 };
165
166 vccq_sdhi2: regulator@5 {
167 compatible = "regulator-gpio";
168
169 regulator-name = "SDHI2 VccQ";
170 regulator-min-microvolt = <1800000>;
171 regulator-max-microvolt = <3300000>;
172
173 gpios = <&gpio2 26 GPIO_ACTIVE_HIGH>;
174 gpios-states = <1>;
175 states = <3300000 1
176 1800000 0>;
177 };
46}; 178};
47 179
48&extal_clk { 180&extal_clk {
49 clock-frequency = <20000000>; 181 clock-frequency = <20000000>;
50}; 182};
51 183
184&i2c2 {
185 pinctrl-0 = <&i2c2_pins>;
186 pinctrl-names = "default";
187
188 status = "okay";
189 clock-frequency = <400000>;
190
191 eeprom@50 {
192 compatible = "renesas,24c02";
193 reg = <0x50>;
194 pagesize = <16>;
195 };
196};
197
52&pfc { 198&pfc {
53 pinctrl-0 = <&scif0_pins &scif1_pins>; 199 pinctrl-0 = <&du_pins &scif0_pins &scif1_pins>;
54 pinctrl-names = "default"; 200 pinctrl-names = "default";
55 201
202 i2c2_pins: i2c {
203 renesas,groups = "i2c2";
204 renesas,function = "i2c2";
205 };
206
207 du_pins: du {
208 renesas,groups = "du_rgb666", "du_sync", "du_clk_out_0";
209 renesas,function = "du";
210 };
211
56 scif0_pins: serial0 { 212 scif0_pins: serial0 {
57 renesas,groups = "scif0_data_d"; 213 renesas,groups = "scif0_data_d";
58 renesas,function = "scif0"; 214 renesas,function = "scif0";
@@ -62,4 +218,116 @@
62 renesas,groups = "scif1_data_d"; 218 renesas,groups = "scif1_data_d";
63 renesas,function = "scif1"; 219 renesas,function = "scif1";
64 }; 220 };
221
222 ether_pins: ether {
223 renesas,groups = "eth_link", "eth_mdio", "eth_rmii";
224 renesas,function = "eth";
225 };
226
227 phy1_pins: phy1 {
228 renesas,groups = "intc_irq0";
229 renesas,function = "intc";
230 };
231
232 sdhi0_pins: sd0 {
233 renesas,gpios = "sdhi0_data4", "sdhi0_ctrl";
234 renesas,function = "sdhi0";
235 };
236
237 sdhi1_pins: sd1 {
238 renesas,gpios = "sdhi1_data4", "sdhi1_ctrl";
239 renesas,function = "sdhi1";
240 };
241
242 sdhi2_pins: sd2 {
243 renesas,gpios = "sdhi2_data4", "sdhi2_ctrl";
244 renesas,function = "sdhi2";
245 };
246
247 qspi_pins: spi {
248 renesas,groups = "qspi_ctrl", "qspi_data4";
249 renesas,function = "qspi";
250 };
251};
252
253&ether {
254 pinctrl-0 = <&ether_pins &phy1_pins>;
255 pinctrl-names = "default";
256
257 phy-handle = <&phy1>;
258 renesas,ether-link-active-low;
259 status = "ok";
260
261 phy1: ethernet-phy@1 {
262 reg = <1>;
263 interrupt-parent = <&irqc0>;
264 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
265 };
266};
267
268&sata0 {
269 status = "okay";
270};
271
272&sdhi0 {
273 pinctrl-0 = <&sdhi0_pins>;
274 pinctrl-names = "default";
275
276 vmmc-supply = <&vcc_sdhi0>;
277 vqmmc-supply = <&vccq_sdhi0>;
278 cd-gpios = <&gpio6 6 GPIO_ACTIVE_LOW>;
279 wp-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
280 status = "okay";
281};
282
283&sdhi1 {
284 pinctrl-0 = <&sdhi1_pins>;
285 pinctrl-names = "default";
286
287 vmmc-supply = <&vcc_sdhi1>;
288 vqmmc-supply = <&vccq_sdhi1>;
289 cd-gpios = <&gpio6 14 GPIO_ACTIVE_LOW>;
290 wp-gpios = <&gpio6 15 GPIO_ACTIVE_HIGH>;
291 status = "okay";
292};
293
294&sdhi2 {
295 pinctrl-0 = <&sdhi2_pins>;
296 pinctrl-names = "default";
297
298 vmmc-supply = <&vcc_sdhi2>;
299 vqmmc-supply = <&vccq_sdhi2>;
300 cd-gpios = <&gpio6 22 GPIO_ACTIVE_LOW>;
301 status = "okay";
302};
303
304&spi {
305 pinctrl-0 = <&qspi_pins>;
306 pinctrl-names = "default";
307
308 status = "okay";
309
310 flash: flash@0 {
311 #address-cells = <1>;
312 #size-cells = <1>;
313 compatible = "spansion,s25fl512s";
314 reg = <0>;
315 spi-max-frequency = <30000000>;
316 m25p,fast-read;
317
318 partition@0 {
319 label = "loader";
320 reg = <0x00000000 0x00080000>;
321 read-only;
322 };
323 partition@80000 {
324 label = "bootenv";
325 reg = <0x00080000 0x00080000>;
326 read-only;
327 };
328 partition@100000 {
329 label = "data";
330 reg = <0x00100000 0x03f00000>;
331 };
332 };
65}; 333};
diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 19c65509a22d..46181708e59c 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -2,7 +2,8 @@
2 * Device Tree Source for the r8a7791 SoC 2 * Device Tree Source for the r8a7791 SoC
3 * 3 *
4 * Copyright (C) 2013 Renesas Electronics Corporation 4 * Copyright (C) 2013 Renesas Electronics Corporation
5 * Copyright (C) 2013 Renesas Solutions Corp. 5 * Copyright (C) 2013-2014 Renesas Solutions Corp.
6 * Copyright (C) 2014 Cogent Embedded Inc.
6 * 7 *
7 * 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
8 * 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
@@ -19,6 +20,15 @@
19 #address-cells = <2>; 20 #address-cells = <2>;
20 #size-cells = <2>; 21 #size-cells = <2>;
21 22
23 aliases {
24 i2c0 = &i2c0;
25 i2c1 = &i2c1;
26 i2c2 = &i2c2;
27 i2c3 = &i2c3;
28 i2c4 = &i2c4;
29 i2c5 = &i2c5;
30 };
31
22 cpus { 32 cpus {
23 #address-cells = <1>; 33 #address-cells = <1>;
24 #size-cells = <0>; 34 #size-cells = <0>;
@@ -53,7 +63,6 @@
53 gpio0: gpio@e6050000 { 63 gpio0: gpio@e6050000 {
54 compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar"; 64 compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar";
55 reg = <0 0xe6050000 0 0x50>; 65 reg = <0 0xe6050000 0 0x50>;
56 interrupt-parent = <&gic>;
57 interrupts = <0 4 IRQ_TYPE_LEVEL_HIGH>; 66 interrupts = <0 4 IRQ_TYPE_LEVEL_HIGH>;
58 #gpio-cells = <2>; 67 #gpio-cells = <2>;
59 gpio-controller; 68 gpio-controller;
@@ -65,7 +74,6 @@
65 gpio1: gpio@e6051000 { 74 gpio1: gpio@e6051000 {
66 compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar"; 75 compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar";
67 reg = <0 0xe6051000 0 0x50>; 76 reg = <0 0xe6051000 0 0x50>;
68 interrupt-parent = <&gic>;
69 interrupts = <0 5 IRQ_TYPE_LEVEL_HIGH>; 77 interrupts = <0 5 IRQ_TYPE_LEVEL_HIGH>;
70 #gpio-cells = <2>; 78 #gpio-cells = <2>;
71 gpio-controller; 79 gpio-controller;
@@ -77,7 +85,6 @@
77 gpio2: gpio@e6052000 { 85 gpio2: gpio@e6052000 {
78 compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar"; 86 compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar";
79 reg = <0 0xe6052000 0 0x50>; 87 reg = <0 0xe6052000 0 0x50>;
80 interrupt-parent = <&gic>;
81 interrupts = <0 6 IRQ_TYPE_LEVEL_HIGH>; 88 interrupts = <0 6 IRQ_TYPE_LEVEL_HIGH>;
82 #gpio-cells = <2>; 89 #gpio-cells = <2>;
83 gpio-controller; 90 gpio-controller;
@@ -89,7 +96,6 @@
89 gpio3: gpio@e6053000 { 96 gpio3: gpio@e6053000 {
90 compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar"; 97 compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar";
91 reg = <0 0xe6053000 0 0x50>; 98 reg = <0 0xe6053000 0 0x50>;
92 interrupt-parent = <&gic>;
93 interrupts = <0 7 IRQ_TYPE_LEVEL_HIGH>; 99 interrupts = <0 7 IRQ_TYPE_LEVEL_HIGH>;
94 #gpio-cells = <2>; 100 #gpio-cells = <2>;
95 gpio-controller; 101 gpio-controller;
@@ -101,7 +107,6 @@
101 gpio4: gpio@e6054000 { 107 gpio4: gpio@e6054000 {
102 compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar"; 108 compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar";
103 reg = <0 0xe6054000 0 0x50>; 109 reg = <0 0xe6054000 0 0x50>;
104 interrupt-parent = <&gic>;
105 interrupts = <0 8 IRQ_TYPE_LEVEL_HIGH>; 110 interrupts = <0 8 IRQ_TYPE_LEVEL_HIGH>;
106 #gpio-cells = <2>; 111 #gpio-cells = <2>;
107 gpio-controller; 112 gpio-controller;
@@ -113,7 +118,6 @@
113 gpio5: gpio@e6055000 { 118 gpio5: gpio@e6055000 {
114 compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar"; 119 compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar";
115 reg = <0 0xe6055000 0 0x50>; 120 reg = <0 0xe6055000 0 0x50>;
116 interrupt-parent = <&gic>;
117 interrupts = <0 9 IRQ_TYPE_LEVEL_HIGH>; 121 interrupts = <0 9 IRQ_TYPE_LEVEL_HIGH>;
118 #gpio-cells = <2>; 122 #gpio-cells = <2>;
119 gpio-controller; 123 gpio-controller;
@@ -125,7 +129,6 @@
125 gpio6: gpio@e6055400 { 129 gpio6: gpio@e6055400 {
126 compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar"; 130 compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar";
127 reg = <0 0xe6055400 0 0x50>; 131 reg = <0 0xe6055400 0 0x50>;
128 interrupt-parent = <&gic>;
129 interrupts = <0 10 IRQ_TYPE_LEVEL_HIGH>; 132 interrupts = <0 10 IRQ_TYPE_LEVEL_HIGH>;
130 #gpio-cells = <2>; 133 #gpio-cells = <2>;
131 gpio-controller; 134 gpio-controller;
@@ -137,7 +140,6 @@
137 gpio7: gpio@e6055800 { 140 gpio7: gpio@e6055800 {
138 compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar"; 141 compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar";
139 reg = <0 0xe6055800 0 0x50>; 142 reg = <0 0xe6055800 0 0x50>;
140 interrupt-parent = <&gic>;
141 interrupts = <0 11 IRQ_TYPE_LEVEL_HIGH>; 143 interrupts = <0 11 IRQ_TYPE_LEVEL_HIGH>;
142 #gpio-cells = <2>; 144 #gpio-cells = <2>;
143 gpio-controller; 145 gpio-controller;
@@ -149,8 +151,8 @@
149 thermal@e61f0000 { 151 thermal@e61f0000 {
150 compatible = "renesas,thermal-r8a7791", "renesas,rcar-thermal"; 152 compatible = "renesas,thermal-r8a7791", "renesas,rcar-thermal";
151 reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>; 153 reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
152 interrupt-parent = <&gic>;
153 interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>; 154 interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
155 clocks = <&mstp5_clks R8A7791_CLK_THERMAL>;
154 }; 156 };
155 157
156 timer { 158 timer {
@@ -166,7 +168,6 @@
166 #interrupt-cells = <2>; 168 #interrupt-cells = <2>;
167 interrupt-controller; 169 interrupt-controller;
168 reg = <0 0xe61c0000 0 0x200>; 170 reg = <0 0xe61c0000 0 0x200>;
169 interrupt-parent = <&gic>;
170 interrupts = <0 0 IRQ_TYPE_LEVEL_HIGH>, 171 interrupts = <0 0 IRQ_TYPE_LEVEL_HIGH>,
171 <0 1 IRQ_TYPE_LEVEL_HIGH>, 172 <0 1 IRQ_TYPE_LEVEL_HIGH>,
172 <0 2 IRQ_TYPE_LEVEL_HIGH>, 173 <0 2 IRQ_TYPE_LEVEL_HIGH>,
@@ -179,12 +180,288 @@
179 <0 17 IRQ_TYPE_LEVEL_HIGH>; 180 <0 17 IRQ_TYPE_LEVEL_HIGH>;
180 }; 181 };
181 182
183 i2c0: i2c@e6508000 {
184 #address-cells = <1>;
185 #size-cells = <0>;
186 compatible = "renesas,i2c-r8a7791";
187 reg = <0 0xe6508000 0 0x40>;
188 interrupts = <0 287 IRQ_TYPE_LEVEL_HIGH>;
189 clocks = <&mstp9_clks R8A7791_CLK_I2C0>;
190 status = "disabled";
191 };
192
193 i2c1: i2c@e6518000 {
194 #address-cells = <1>;
195 #size-cells = <0>;
196 compatible = "renesas,i2c-r8a7791";
197 reg = <0 0xe6518000 0 0x40>;
198 interrupts = <0 288 IRQ_TYPE_LEVEL_HIGH>;
199 clocks = <&mstp9_clks R8A7791_CLK_I2C1>;
200 status = "disabled";
201 };
202
203 i2c2: i2c@e6530000 {
204 #address-cells = <1>;
205 #size-cells = <0>;
206 compatible = "renesas,i2c-r8a7791";
207 reg = <0 0xe6530000 0 0x40>;
208 interrupts = <0 286 IRQ_TYPE_LEVEL_HIGH>;
209 clocks = <&mstp9_clks R8A7791_CLK_I2C2>;
210 status = "disabled";
211 };
212
213 i2c3: i2c@e6540000 {
214 #address-cells = <1>;
215 #size-cells = <0>;
216 compatible = "renesas,i2c-r8a7791";
217 reg = <0 0xe6540000 0 0x40>;
218 interrupts = <0 290 IRQ_TYPE_LEVEL_HIGH>;
219 clocks = <&mstp9_clks R8A7791_CLK_I2C3>;
220 status = "disabled";
221 };
222
223 i2c4: i2c@e6520000 {
224 #address-cells = <1>;
225 #size-cells = <0>;
226 compatible = "renesas,i2c-r8a7791";
227 reg = <0 0xe6520000 0 0x40>;
228 interrupts = <0 19 IRQ_TYPE_LEVEL_HIGH>;
229 clocks = <&mstp9_clks R8A7791_CLK_I2C4>;
230 status = "disabled";
231 };
232
233 i2c5: i2c@e6528000 {
234 #address-cells = <1>;
235 #size-cells = <0>;
236 compatible = "renesas,i2c-r8a7791";
237 reg = <0 0xe6528000 0 0x40>;
238 interrupts = <0 20 IRQ_TYPE_LEVEL_HIGH>;
239 clocks = <&mstp9_clks R8A7791_CLK_I2C5>;
240 status = "disabled";
241 };
242
182 pfc: pfc@e6060000 { 243 pfc: pfc@e6060000 {
183 compatible = "renesas,pfc-r8a7791"; 244 compatible = "renesas,pfc-r8a7791";
184 reg = <0 0xe6060000 0 0x250>; 245 reg = <0 0xe6060000 0 0x250>;
185 #gpio-range-cells = <3>; 246 #gpio-range-cells = <3>;
186 }; 247 };
187 248
249 sdhi0: sd@ee100000 {
250 compatible = "renesas,sdhi-r8a7791";
251 reg = <0 0xee100000 0 0x200>;
252 interrupt-parent = <&gic>;
253 interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
254 clocks = <&mstp3_clks R8A7791_CLK_SDHI0>;
255 status = "disabled";
256 };
257
258 sdhi1: sd@ee140000 {
259 compatible = "renesas,sdhi-r8a7791";
260 reg = <0 0xee140000 0 0x100>;
261 interrupt-parent = <&gic>;
262 interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>;
263 clocks = <&mstp3_clks R8A7791_CLK_SDHI1>;
264 status = "disabled";
265 };
266
267 sdhi2: sd@ee160000 {
268 compatible = "renesas,sdhi-r8a7791";
269 reg = <0 0xee160000 0 0x100>;
270 interrupt-parent = <&gic>;
271 interrupts = <0 168 IRQ_TYPE_LEVEL_HIGH>;
272 clocks = <&mstp3_clks R8A7791_CLK_SDHI2>;
273 status = "disabled";
274 };
275
276 scifa0: serial@e6c40000 {
277 compatible = "renesas,scifa-r8a7791", "renesas,scifa";
278 reg = <0 0xe6c40000 0 64>;
279 interrupts = <0 144 IRQ_TYPE_LEVEL_HIGH>;
280 clocks = <&mstp2_clks R8A7791_CLK_SCIFA0>;
281 clock-names = "sci_ick";
282 status = "disabled";
283 };
284
285 scifa1: serial@e6c50000 {
286 compatible = "renesas,scifa-r8a7791", "renesas,scifa";
287 reg = <0 0xe6c50000 0 64>;
288 interrupts = <0 145 IRQ_TYPE_LEVEL_HIGH>;
289 clocks = <&mstp2_clks R8A7791_CLK_SCIFA1>;
290 clock-names = "sci_ick";
291 status = "disabled";
292 };
293
294 scifa2: serial@e6c60000 {
295 compatible = "renesas,scifa-r8a7791", "renesas,scifa";
296 reg = <0 0xe6c60000 0 64>;
297 interrupts = <0 151 IRQ_TYPE_LEVEL_HIGH>;
298 clocks = <&mstp2_clks R8A7791_CLK_SCIFA2>;
299 clock-names = "sci_ick";
300 status = "disabled";
301 };
302
303 scifa3: serial@e6c70000 {
304 compatible = "renesas,scifa-r8a7791", "renesas,scifa";
305 reg = <0 0xe6c70000 0 64>;
306 interrupts = <0 29 IRQ_TYPE_LEVEL_HIGH>;
307 clocks = <&mstp11_clks R8A7791_CLK_SCIFA3>;
308 clock-names = "sci_ick";
309 status = "disabled";
310 };
311
312 scifa4: serial@e6c78000 {
313 compatible = "renesas,scifa-r8a7791", "renesas,scifa";
314 reg = <0 0xe6c78000 0 64>;
315 interrupts = <0 30 IRQ_TYPE_LEVEL_HIGH>;
316 clocks = <&mstp11_clks R8A7791_CLK_SCIFA4>;
317 clock-names = "sci_ick";
318 status = "disabled";
319 };
320
321 scifa5: serial@e6c80000 {
322 compatible = "renesas,scifa-r8a7791", "renesas,scifa";
323 reg = <0 0xe6c80000 0 64>;
324 interrupts = <0 31 IRQ_TYPE_LEVEL_HIGH>;
325 clocks = <&mstp11_clks R8A7791_CLK_SCIFA5>;
326 clock-names = "sci_ick";
327 status = "disabled";
328 };
329
330 scifb0: serial@e6c20000 {
331 compatible = "renesas,scifb-r8a7791", "renesas,scifb";
332 reg = <0 0xe6c20000 0 64>;
333 interrupts = <0 148 IRQ_TYPE_LEVEL_HIGH>;
334 clocks = <&mstp2_clks R8A7791_CLK_SCIFB0>;
335 clock-names = "sci_ick";
336 status = "disabled";
337 };
338
339 scifb1: serial@e6c30000 {
340 compatible = "renesas,scifb-r8a7791", "renesas,scifb";
341 reg = <0 0xe6c30000 0 64>;
342 interrupts = <0 149 IRQ_TYPE_LEVEL_HIGH>;
343 clocks = <&mstp2_clks R8A7791_CLK_SCIFB1>;
344 clock-names = "sci_ick";
345 status = "disabled";
346 };
347
348 scifb2: serial@e6ce0000 {
349 compatible = "renesas,scifb-r8a7791", "renesas,scifb";
350 reg = <0 0xe6ce0000 0 64>;
351 interrupts = <0 150 IRQ_TYPE_LEVEL_HIGH>;
352 clocks = <&mstp2_clks R8A7791_CLK_SCIFB2>;
353 clock-names = "sci_ick";
354 status = "disabled";
355 };
356
357 scif0: serial@e6e60000 {
358 compatible = "renesas,scif-r8a7791", "renesas,scif";
359 reg = <0 0xe6e60000 0 64>;
360 interrupts = <0 152 IRQ_TYPE_LEVEL_HIGH>;
361 clocks = <&mstp7_clks R8A7791_CLK_SCIF0>;
362 clock-names = "sci_ick";
363 status = "disabled";
364 };
365
366 scif1: serial@e6e68000 {
367 compatible = "renesas,scif-r8a7791", "renesas,scif";
368 reg = <0 0xe6e68000 0 64>;
369 interrupts = <0 153 IRQ_TYPE_LEVEL_HIGH>;
370 clocks = <&mstp7_clks R8A7791_CLK_SCIF1>;
371 clock-names = "sci_ick";
372 status = "disabled";
373 };
374
375 scif2: serial@e6e58000 {
376 compatible = "renesas,scif-r8a7791", "renesas,scif";
377 reg = <0 0xe6e58000 0 64>;
378 interrupts = <0 22 IRQ_TYPE_LEVEL_HIGH>;
379 clocks = <&mstp7_clks R8A7791_CLK_SCIF2>;
380 clock-names = "sci_ick";
381 status = "disabled";
382 };
383
384 scif3: serial@e6ea8000 {
385 compatible = "renesas,scif-r8a7791", "renesas,scif";
386 reg = <0 0xe6ea8000 0 64>;
387 interrupts = <0 23 IRQ_TYPE_LEVEL_HIGH>;
388 clocks = <&mstp7_clks R8A7791_CLK_SCIF3>;
389 clock-names = "sci_ick";
390 status = "disabled";
391 };
392
393 scif4: serial@e6ee0000 {
394 compatible = "renesas,scif-r8a7791", "renesas,scif";
395 reg = <0 0xe6ee0000 0 64>;
396 interrupts = <0 24 IRQ_TYPE_LEVEL_HIGH>;
397 clocks = <&mstp7_clks R8A7791_CLK_SCIF4>;
398 clock-names = "sci_ick";
399 status = "disabled";
400 };
401
402 scif5: serial@e6ee8000 {
403 compatible = "renesas,scif-r8a7791", "renesas,scif";
404 reg = <0 0xe6ee8000 0 64>;
405 interrupts = <0 25 IRQ_TYPE_LEVEL_HIGH>;
406 clocks = <&mstp7_clks R8A7791_CLK_SCIF5>;
407 clock-names = "sci_ick";
408 status = "disabled";
409 };
410
411 hscif0: serial@e62c0000 {
412 compatible = "renesas,hscif-r8a7791", "renesas,hscif";
413 reg = <0 0xe62c0000 0 96>;
414 interrupts = <0 154 IRQ_TYPE_LEVEL_HIGH>;
415 clocks = <&mstp7_clks R8A7791_CLK_HSCIF0>;
416 clock-names = "sci_ick";
417 status = "disabled";
418 };
419
420 hscif1: serial@e62c8000 {
421 compatible = "renesas,hscif-r8a7791", "renesas,hscif";
422 reg = <0 0xe62c8000 0 96>;
423 interrupts = <0 155 IRQ_TYPE_LEVEL_HIGH>;
424 clocks = <&mstp7_clks R8A7791_CLK_HSCIF1>;
425 clock-names = "sci_ick";
426 status = "disabled";
427 };
428
429 hscif2: serial@e62d0000 {
430 compatible = "renesas,hscif-r8a7791", "renesas,hscif";
431 reg = <0 0xe62d0000 0 96>;
432 interrupts = <0 21 IRQ_TYPE_LEVEL_HIGH>;
433 clocks = <&mstp7_clks R8A7791_CLK_HSCIF2>;
434 clock-names = "sci_ick";
435 status = "disabled";
436 };
437
438 ether: ethernet@ee700000 {
439 compatible = "renesas,ether-r8a7791";
440 reg = <0 0xee700000 0 0x400>;
441 interrupts = <0 162 IRQ_TYPE_LEVEL_HIGH>;
442 clocks = <&mstp8_clks R8A7791_CLK_ETHER>;
443 phy-mode = "rmii";
444 #address-cells = <1>;
445 #size-cells = <0>;
446 status = "disabled";
447 };
448
449 sata0: sata@ee300000 {
450 compatible = "renesas,sata-r8a7791";
451 reg = <0 0xee300000 0 0x2000>;
452 interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>;
453 clocks = <&mstp8_clks R8A7791_CLK_SATA0>;
454 status = "disabled";
455 };
456
457 sata1: sata@ee500000 {
458 compatible = "renesas,sata-r8a7791";
459 reg = <0 0xee500000 0 0x2000>;
460 interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
461 clocks = <&mstp8_clks R8A7791_CLK_SATA1>;
462 status = "disabled";
463 };
464
188 clocks { 465 clocks {
189 #address-cells = <2>; 466 #address-cells = <2>;
190 #size-cells = <2>; 467 #size-cells = <2>;
@@ -429,7 +706,7 @@
429 R8A7791_CLK_MSIOF1 R8A7791_CLK_SCIFB2 706 R8A7791_CLK_MSIOF1 R8A7791_CLK_SCIFB2
430 >; 707 >;
431 clock-output-names = 708 clock-output-names =
432 "scifa2", "scifa1", "scifa0", "misof2", "scifb0", 709 "scifa2", "scifa1", "scifa0", "msiof2", "scifb0",
433 "scifb1", "msiof1", "scifb2"; 710 "scifb1", "msiof1", "scifb2";
434 }; 711 };
435 mstp3_clks: mstp3_clks@e615013c { 712 mstp3_clks: mstp3_clks@e615013c {
@@ -474,10 +751,15 @@
474 mstp8_clks: mstp8_clks@e6150990 { 751 mstp8_clks: mstp8_clks@e6150990 {
475 compatible = "renesas,r8a7791-mstp-clocks", "renesas,cpg-mstp-clocks"; 752 compatible = "renesas,r8a7791-mstp-clocks", "renesas,cpg-mstp-clocks";
476 reg = <0 0xe6150990 0 4>, <0 0xe61509a0 0 4>; 753 reg = <0 0xe6150990 0 4>, <0 0xe61509a0 0 4>;
477 clocks = <&p_clk>; 754 clocks = <&zg_clk>, <&zg_clk>, <&zg_clk>, <&p_clk>, <&zs_clk>,
755 <&zs_clk>;
478 #clock-cells = <1>; 756 #clock-cells = <1>;
479 renesas,clock-indices = <R8A7791_CLK_ETHER>; 757 renesas,clock-indices = <
480 clock-output-names = "ether"; 758 R8A7791_CLK_VIN2 R8A7791_CLK_VIN1 R8A7791_CLK_VIN0
759 R8A7791_CLK_ETHER R8A7791_CLK_SATA1 R8A7791_CLK_SATA0
760 >;
761 clock-output-names =
762 "vin2", "vin1", "vin0", "ether", "sata1", "sata0";
481 }; 763 };
482 mstp9_clks: mstp9_clks@e6150994 { 764 mstp9_clks: mstp9_clks@e6150994 {
483 compatible = "renesas,r8a7791-mstp-clocks", "renesas,cpg-mstp-clocks"; 765 compatible = "renesas,r8a7791-mstp-clocks", "renesas,cpg-mstp-clocks";
@@ -488,7 +770,7 @@
488 #clock-cells = <1>; 770 #clock-cells = <1>;
489 renesas,clock-indices = < 771 renesas,clock-indices = <
490 R8A7791_CLK_RCAN1 R8A7791_CLK_RCAN0 R8A7791_CLK_QSPI_MOD 772 R8A7791_CLK_RCAN1 R8A7791_CLK_RCAN0 R8A7791_CLK_QSPI_MOD
491 R8A7791_CLK_I2C4 R8A7791_CLK_I2C4 R8A7791_CLK_I2C3 773 R8A7791_CLK_I2C5 R8A7791_CLK_I2C4 R8A7791_CLK_I2C3
492 R8A7791_CLK_I2C2 R8A7791_CLK_I2C1 R8A7791_CLK_I2C0 774 R8A7791_CLK_I2C2 R8A7791_CLK_I2C1 R8A7791_CLK_I2C0
493 >; 775 >;
494 clock-output-names = 776 clock-output-names =
@@ -506,4 +788,15 @@
506 clock-output-names = "scifa3", "scifa4", "scifa5"; 788 clock-output-names = "scifa3", "scifa4", "scifa5";
507 }; 789 };
508 }; 790 };
791
792 spi: spi@e6b10000 {
793 compatible = "renesas,qspi-r8a7791", "renesas,qspi";
794 reg = <0 0xe6b10000 0 0x2c>;
795 interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
796 clocks = <&mstp9_clks R8A7791_CLK_QSPI_MOD>;
797 num-cs = <1>;
798 #address-cells = <1>;
799 #size-cells = <0>;
800 status = "disabled";
801 };
509}; 802};
diff --git a/arch/arm/boot/dts/rk3066a.dtsi b/arch/arm/boot/dts/rk3066a.dtsi
index be5d2b09a363..4d4dfbb59f4b 100644
--- a/arch/arm/boot/dts/rk3066a.dtsi
+++ b/arch/arm/boot/dts/rk3066a.dtsi
@@ -64,6 +64,19 @@
64 clock-names = "timer", "pclk"; 64 clock-names = "timer", "pclk";
65 }; 65 };
66 66
67 sram: sram@10080000 {
68 compatible = "mmio-sram";
69 reg = <0x10080000 0x10000>;
70 #address-cells = <1>;
71 #size-cells = <1>;
72 ranges = <0 0x10080000 0x10000>;
73
74 smp-sram@0 {
75 compatible = "rockchip,rk3066-smp-sram";
76 reg = <0x0 0x50>;
77 };
78 };
79
67 pinctrl@20008000 { 80 pinctrl@20008000 {
68 compatible = "rockchip,rk3066a-pinctrl"; 81 compatible = "rockchip,rk3066a-pinctrl";
69 reg = <0x20008000 0x150>; 82 reg = <0x20008000 0x150>;
diff --git a/arch/arm/boot/dts/rk3188.dtsi b/arch/arm/boot/dts/rk3188.dtsi
index 1a26b03b3649..bb36596ea205 100644
--- a/arch/arm/boot/dts/rk3188.dtsi
+++ b/arch/arm/boot/dts/rk3188.dtsi
@@ -60,6 +60,19 @@
60 interrupts = <GIC_PPI 13 0xf04>; 60 interrupts = <GIC_PPI 13 0xf04>;
61 }; 61 };
62 62
63 sram: sram@10080000 {
64 compatible = "mmio-sram";
65 reg = <0x10080000 0x8000>;
66 #address-cells = <1>;
67 #size-cells = <1>;
68 ranges = <0 0x10080000 0x8000>;
69
70 smp-sram@0 {
71 compatible = "rockchip,rk3066-smp-sram";
72 reg = <0x0 0x50>;
73 };
74 };
75
63 pinctrl@20008000 { 76 pinctrl@20008000 {
64 compatible = "rockchip,rk3188-pinctrl"; 77 compatible = "rockchip,rk3188-pinctrl";
65 reg = <0x20008000 0xa0>, 78 reg = <0x20008000 0xa0>,
diff --git a/arch/arm/boot/dts/rk3xxx.dtsi b/arch/arm/boot/dts/rk3xxx.dtsi
index 0fcbcfd67de2..26e5a968d49d 100644
--- a/arch/arm/boot/dts/rk3xxx.dtsi
+++ b/arch/arm/boot/dts/rk3xxx.dtsi
@@ -26,6 +26,16 @@
26 compatible = "simple-bus"; 26 compatible = "simple-bus";
27 ranges; 27 ranges;
28 28
29 scu@1013c000 {
30 compatible = "arm,cortex-a9-scu";
31 reg = <0x1013c000 0x100>;
32 };
33
34 pmu@20004000 {
35 compatible = "rockchip,rk3066-pmu";
36 reg = <0x20004000 0x100>;
37 };
38
29 gic: interrupt-controller@1013d000 { 39 gic: interrupt-controller@1013d000 {
30 compatible = "arm,cortex-a9-gic"; 40 compatible = "arm,cortex-a9-gic";
31 interrupt-controller; 41 interrupt-controller;
diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi
index 3d5faf85f51b..eabcfdbb403a 100644
--- a/arch/arm/boot/dts/sama5d3.dtsi
+++ b/arch/arm/boot/dts/sama5d3.dtsi
@@ -239,7 +239,9 @@
239 }; 239 };
240 240
241 adc0: adc@f8018000 { 241 adc0: adc@f8018000 {
242 compatible = "atmel,at91sam9260-adc"; 242 #address-cells = <1>;
243 #size-cells = <0>;
244 compatible = "atmel,at91sam9x5-adc";
243 reg = <0xf8018000 0x100>; 245 reg = <0xf8018000 0x100>;
244 interrupts = <29 IRQ_TYPE_LEVEL_HIGH 5>; 246 interrupts = <29 IRQ_TYPE_LEVEL_HIGH 5>;
245 pinctrl-names = "default"; 247 pinctrl-names = "default";
@@ -261,52 +263,39 @@
261 clocks = <&adc_clk>, 263 clocks = <&adc_clk>,
262 <&adc_op_clk>; 264 <&adc_op_clk>;
263 clock-names = "adc_clk", "adc_op_clk"; 265 clock-names = "adc_clk", "adc_op_clk";
264 atmel,adc-channel-base = <0x50>;
265 atmel,adc-channels-used = <0xfff>; 266 atmel,adc-channels-used = <0xfff>;
266 atmel,adc-drdy-mask = <0x1000000>;
267 atmel,adc-num-channels = <12>;
268 atmel,adc-startup-time = <40>; 267 atmel,adc-startup-time = <40>;
269 atmel,adc-status-register = <0x30>; 268 atmel,adc-use-external-triggers;
270 atmel,adc-trigger-register = <0xc0>;
271 atmel,adc-use-external;
272 atmel,adc-vref = <3000>; 269 atmel,adc-vref = <3000>;
273 atmel,adc-res = <10 12>; 270 atmel,adc-res = <10 12>;
274 atmel,adc-res-names = "lowres", "highres"; 271 atmel,adc-res-names = "lowres", "highres";
275 status = "disabled"; 272 status = "disabled";
276 273
277 trigger@0 { 274 trigger@0 {
275 reg = <0>;
278 trigger-name = "external-rising"; 276 trigger-name = "external-rising";
279 trigger-value = <0x1>; 277 trigger-value = <0x1>;
280 trigger-external; 278 trigger-external;
281 }; 279 };
282 trigger@1 { 280 trigger@1 {
281 reg = <1>;
283 trigger-name = "external-falling"; 282 trigger-name = "external-falling";
284 trigger-value = <0x2>; 283 trigger-value = <0x2>;
285 trigger-external; 284 trigger-external;
286 }; 285 };
287 trigger@2 { 286 trigger@2 {
287 reg = <2>;
288 trigger-name = "external-any"; 288 trigger-name = "external-any";
289 trigger-value = <0x3>; 289 trigger-value = <0x3>;
290 trigger-external; 290 trigger-external;
291 }; 291 };
292 trigger@3 { 292 trigger@3 {
293 reg = <3>;
293 trigger-name = "continuous"; 294 trigger-name = "continuous";
294 trigger-value = <0x6>; 295 trigger-value = <0x6>;
295 }; 296 };
296 }; 297 };
297 298
298 tsadcc: tsadcc@f8018000 {
299 compatible = "atmel,at91sam9x5-tsadcc";
300 reg = <0xf8018000 0x4000>;
301 interrupts = <29 IRQ_TYPE_LEVEL_HIGH 5>;
302 atmel,tsadcc_clock = <300000>;
303 atmel,filtering_average = <0x03>;
304 atmel,pendet_debounce = <0x08>;
305 atmel,pendet_sensitivity = <0x02>;
306 atmel,ts_sample_hold_time = <0x0a>;
307 status = "disabled";
308 };
309
310 i2c2: i2c@f801c000 { 299 i2c2: i2c@f801c000 {
311 compatible = "atmel,at91sam9x5-i2c"; 300 compatible = "atmel,at91sam9x5-i2c";
312 reg = <0xf801c000 0x4000>; 301 reg = <0xf801c000 0x4000>;
@@ -1256,6 +1245,7 @@
1256 interrupts = <5 IRQ_TYPE_LEVEL_HIGH 6>; 1245 interrupts = <5 IRQ_TYPE_LEVEL_HIGH 6>;
1257 atmel,nand-addr-offset = <21>; 1246 atmel,nand-addr-offset = <21>;
1258 atmel,nand-cmd-offset = <22>; 1247 atmel,nand-cmd-offset = <22>;
1248 atmel,nand-has-dma;
1259 pinctrl-names = "default"; 1249 pinctrl-names = "default";
1260 pinctrl-0 = <&pinctrl_nand0_ale_cle>; 1250 pinctrl-0 = <&pinctrl_nand0_ale_cle>;
1261 atmel,pmecc-lookup-table-offset = <0x0 0x8000>; 1251 atmel,pmecc-lookup-table-offset = <0x0 0x8000>;
diff --git a/arch/arm/boot/dts/sama5d3xdm.dtsi b/arch/arm/boot/dts/sama5d3xdm.dtsi
index f9bdde542ced..035ab72b3990 100644
--- a/arch/arm/boot/dts/sama5d3xdm.dtsi
+++ b/arch/arm/boot/dts/sama5d3xdm.dtsi
@@ -23,10 +23,8 @@
23 }; 23 };
24 24
25 adc0: adc@f8018000 { 25 adc0: adc@f8018000 {
26 status = "disabled"; 26 atmel,adc-ts-wires = <4>;
27 }; 27 atmel,adc-ts-pressure-threshold = <10000>;
28
29 tsadcc: tsadcc@f8018000 {
30 status = "okay"; 28 status = "okay";
31 }; 29 };
32 30
diff --git a/arch/arm/boot/dts/socfpga.dtsi b/arch/arm/boot/dts/socfpga.dtsi
index 537f1a5c07f5..56fc214e6d2c 100644
--- a/arch/arm/boot/dts/socfpga.dtsi
+++ b/arch/arm/boot/dts/socfpga.dtsi
@@ -92,7 +92,12 @@
92 #address-cells = <1>; 92 #address-cells = <1>;
93 #size-cells = <0>; 93 #size-cells = <0>;
94 94
95 osc: osc1 { 95 osc1: osc1 {
96 #clock-cells = <0>;
97 compatible = "fixed-clock";
98 };
99
100 osc2: osc2 {
96 #clock-cells = <0>; 101 #clock-cells = <0>;
97 compatible = "fixed-clock"; 102 compatible = "fixed-clock";
98 }; 103 };
@@ -100,7 +105,11 @@
100 f2s_periph_ref_clk: f2s_periph_ref_clk { 105 f2s_periph_ref_clk: f2s_periph_ref_clk {
101 #clock-cells = <0>; 106 #clock-cells = <0>;
102 compatible = "fixed-clock"; 107 compatible = "fixed-clock";
103 clock-frequency = <10000000>; 108 };
109
110 f2s_sdram_ref_clk: f2s_sdram_ref_clk {
111 #clock-cells = <0>;
112 compatible = "fixed-clock";
104 }; 113 };
105 114
106 main_pll: main_pll { 115 main_pll: main_pll {
@@ -108,7 +117,7 @@
108 #size-cells = <0>; 117 #size-cells = <0>;
109 #clock-cells = <0>; 118 #clock-cells = <0>;
110 compatible = "altr,socfpga-pll-clock"; 119 compatible = "altr,socfpga-pll-clock";
111 clocks = <&osc>; 120 clocks = <&osc1>;
112 reg = <0x40>; 121 reg = <0x40>;
113 122
114 mpuclk: mpuclk { 123 mpuclk: mpuclk {
@@ -162,7 +171,7 @@
162 #size-cells = <0>; 171 #size-cells = <0>;
163 #clock-cells = <0>; 172 #clock-cells = <0>;
164 compatible = "altr,socfpga-pll-clock"; 173 compatible = "altr,socfpga-pll-clock";
165 clocks = <&osc>; 174 clocks = <&osc1>, <&osc2>, <&f2s_periph_ref_clk>;
166 reg = <0x80>; 175 reg = <0x80>;
167 176
168 emac0_clk: emac0_clk { 177 emac0_clk: emac0_clk {
@@ -213,7 +222,7 @@
213 #size-cells = <0>; 222 #size-cells = <0>;
214 #clock-cells = <0>; 223 #clock-cells = <0>;
215 compatible = "altr,socfpga-pll-clock"; 224 compatible = "altr,socfpga-pll-clock";
216 clocks = <&osc>; 225 clocks = <&osc1>, <&osc2>, <&f2s_sdram_ref_clk>;
217 reg = <0xC0>; 226 reg = <0xC0>;
218 227
219 ddr_dqs_clk: ddr_dqs_clk { 228 ddr_dqs_clk: ddr_dqs_clk {
@@ -415,6 +424,7 @@
415 compatible = "altr,socfpga-gate-clk"; 424 compatible = "altr,socfpga-gate-clk";
416 clocks = <&f2s_periph_ref_clk>, <&main_nand_sdmmc_clk>, <&per_nand_mmc_clk>; 425 clocks = <&f2s_periph_ref_clk>, <&main_nand_sdmmc_clk>, <&per_nand_mmc_clk>;
417 clk-gate = <0xa0 8>; 426 clk-gate = <0xa0 8>;
427 clk-phase = <0 135>;
418 }; 428 };
419 429
420 nand_x_clk: nand_x_clk { 430 nand_x_clk: nand_x_clk {
@@ -443,6 +453,7 @@
443 453
444 gmac0: ethernet@ff700000 { 454 gmac0: ethernet@ff700000 {
445 compatible = "altr,socfpga-stmmac", "snps,dwmac-3.70a", "snps,dwmac"; 455 compatible = "altr,socfpga-stmmac", "snps,dwmac-3.70a", "snps,dwmac";
456 altr,sysmgr-syscon = <&sysmgr 0x60 0>;
446 reg = <0xff700000 0x2000>; 457 reg = <0xff700000 0x2000>;
447 interrupts = <0 115 4>; 458 interrupts = <0 115 4>;
448 interrupt-names = "macirq"; 459 interrupt-names = "macirq";
@@ -454,6 +465,7 @@
454 465
455 gmac1: ethernet@ff702000 { 466 gmac1: ethernet@ff702000 {
456 compatible = "altr,socfpga-stmmac", "snps,dwmac-3.70a", "snps,dwmac"; 467 compatible = "altr,socfpga-stmmac", "snps,dwmac-3.70a", "snps,dwmac";
468 altr,sysmgr-syscon = <&sysmgr 0x60 2>;
457 reg = <0xff702000 0x2000>; 469 reg = <0xff702000 0x2000>;
458 interrupts = <0 120 4>; 470 interrupts = <0 120 4>;
459 interrupt-names = "macirq"; 471 interrupt-names = "macirq";
@@ -473,6 +485,17 @@
473 arm,data-latency = <2 1 1>; 485 arm,data-latency = <2 1 1>;
474 }; 486 };
475 487
488 mmc: dwmmc0@ff704000 {
489 compatible = "altr,socfpga-dw-mshc";
490 reg = <0xff704000 0x1000>;
491 interrupts = <0 139 4>;
492 fifo-depth = <0x400>;
493 #address-cells = <1>;
494 #size-cells = <0>;
495 clocks = <&l4_mp_clk>, <&sdmmc_clk>;
496 clock-names = "biu", "ciu";
497 };
498
476 /* Local timer */ 499 /* Local timer */
477 timer@fffec600 { 500 timer@fffec600 {
478 compatible = "arm,cortex-a9-twd-timer"; 501 compatible = "arm,cortex-a9-twd-timer";
@@ -526,9 +549,9 @@
526 reg = <0xffd05000 0x1000>; 549 reg = <0xffd05000 0x1000>;
527 }; 550 };
528 551
529 sysmgr@ffd08000 { 552 sysmgr: sysmgr@ffd08000 {
530 compatible = "altr,sys-mgr"; 553 compatible = "altr,sys-mgr", "syscon";
531 reg = <0xffd08000 0x4000>; 554 reg = <0xffd08000 0x4000>;
532 }; 555 };
533 }; 556 };
534}; 557};
diff --git a/arch/arm/boot/dts/socfpga_arria5.dtsi b/arch/arm/boot/dts/socfpga_arria5.dtsi
index a85b4043f888..6c87b7070ca7 100644
--- a/arch/arm/boot/dts/socfpga_arria5.dtsi
+++ b/arch/arm/boot/dts/socfpga_arria5.dtsi
@@ -27,6 +27,17 @@
27 }; 27 };
28 }; 28 };
29 29
30 dwmmc0@ff704000 {
31 num-slots = <1>;
32 supports-highspeed;
33 broken-cd;
34
35 slot@0 {
36 reg = <0>;
37 bus-width = <4>;
38 };
39 };
40
30 serial0@ffc02000 { 41 serial0@ffc02000 {
31 clock-frequency = <100000000>; 42 clock-frequency = <100000000>;
32 }; 43 };
diff --git a/arch/arm/boot/dts/socfpga_arria5_socdk.dts b/arch/arm/boot/dts/socfpga_arria5_socdk.dts
index 5beffb2265f4..a87ee1c07661 100644
--- a/arch/arm/boot/dts/socfpga_arria5_socdk.dts
+++ b/arch/arm/boot/dts/socfpga_arria5_socdk.dts
@@ -37,4 +37,25 @@
37 */ 37 */
38 ethernet0 = &gmac1; 38 ethernet0 = &gmac1;
39 }; 39 };
40
41 aliases {
42 /* this allow the ethaddr uboot environmnet variable contents
43 * to be added to the gmac1 device tree blob.
44 */
45 ethernet0 = &gmac1;
46 };
47};
48
49&gmac1 {
50 status = "okay";
51 phy-mode = "rgmii";
52
53 rxd0-skew-ps = <0>;
54 rxd1-skew-ps = <0>;
55 rxd2-skew-ps = <0>;
56 rxd3-skew-ps = <0>;
57 txen-skew-ps = <0>;
58 txc-skew-ps = <2600>;
59 rxdv-skew-ps = <0>;
60 rxc-skew-ps = <2000>;
40}; 61};
diff --git a/arch/arm/boot/dts/socfpga_cyclone5.dtsi b/arch/arm/boot/dts/socfpga_cyclone5.dtsi
index a8716f6dbe2e..ca41b0ebf461 100644
--- a/arch/arm/boot/dts/socfpga_cyclone5.dtsi
+++ b/arch/arm/boot/dts/socfpga_cyclone5.dtsi
@@ -28,6 +28,17 @@
28 }; 28 };
29 }; 29 };
30 30
31 dwmmc0@ff704000 {
32 num-slots = <1>;
33 supports-highspeed;
34 broken-cd;
35
36 slot@0 {
37 reg = <0>;
38 bus-width = <4>;
39 };
40 };
41
31 ethernet@ff702000 { 42 ethernet@ff702000 {
32 phy-mode = "rgmii"; 43 phy-mode = "rgmii";
33 phy-addr = <0xffffffff>; /* probe for phy addr */ 44 phy-addr = <0xffffffff>; /* probe for phy addr */
diff --git a/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts b/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts
index 2ee52ab8cabb..ae16d975196d 100644
--- a/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts
+++ b/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts
@@ -38,3 +38,17 @@
38 ethernet0 = &gmac1; 38 ethernet0 = &gmac1;
39 }; 39 };
40}; 40};
41
42&gmac1 {
43 status = "okay";
44 phy-mode = "rgmii";
45
46 rxd0-skew-ps = <0>;
47 rxd1-skew-ps = <0>;
48 rxd2-skew-ps = <0>;
49 rxd3-skew-ps = <0>;
50 txen-skew-ps = <0>;
51 txc-skew-ps = <2600>;
52 rxdv-skew-ps = <0>;
53 rxc-skew-ps = <2000>;
54};
diff --git a/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts b/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts
index 50b99a2c12ae..b79e2a2bf175 100644
--- a/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts
+++ b/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts
@@ -30,8 +30,25 @@
30 device_type = "memory"; 30 device_type = "memory";
31 reg = <0x0 0x40000000>; /* 1GB */ 31 reg = <0x0 0x40000000>; /* 1GB */
32 }; 32 };
33
34 aliases {
35 /* this allow the ethaddr uboot environmnet variable contents
36 * to be added to the gmac1 device tree blob.
37 */
38 ethernet0 = &gmac1;
39 };
33}; 40};
34 41
35&gmac1 { 42&gmac1 {
36 status = "okay"; 43 status = "okay";
44 phy-mode = "rgmii";
45
46 rxd0-skew-ps = <0>;
47 rxd1-skew-ps = <0>;
48 rxd2-skew-ps = <0>;
49 rxd3-skew-ps = <0>;
50 txen-skew-ps = <0>;
51 txc-skew-ps = <2600>;
52 rxdv-skew-ps = <0>;
53 rxc-skew-ps = <2000>;
37}; 54};
diff --git a/arch/arm/boot/dts/socfpga_vt.dts b/arch/arm/boot/dts/socfpga_vt.dts
index d1ec0cab2dee..87d6f759a9c1 100644
--- a/arch/arm/boot/dts/socfpga_vt.dts
+++ b/arch/arm/boot/dts/socfpga_vt.dts
@@ -41,6 +41,17 @@
41 }; 41 };
42 }; 42 };
43 43
44 dwmmc0@ff704000 {
45 num-slots = <1>;
46 supports-highspeed;
47 broken-cd;
48
49 slot@0 {
50 reg = <0>;
51 bus-width = <4>;
52 };
53 };
54
44 ethernet@ff700000 { 55 ethernet@ff700000 {
45 phy-mode = "gmii"; 56 phy-mode = "gmii";
46 status = "okay"; 57 status = "okay";
@@ -75,3 +86,8 @@
75 }; 86 };
76 }; 87 };
77}; 88};
89
90&gmac0 {
91 status = "okay";
92 phy-mode = "gmii";
93};
diff --git a/arch/arm/boot/dts/ste-dbx5x0.dtsi b/arch/arm/boot/dts/ste-dbx5x0.dtsi
index e0853ea02df2..e41eedca3ce3 100644
--- a/arch/arm/boot/dts/ste-dbx5x0.dtsi
+++ b/arch/arm/boot/dts/ste-dbx5x0.dtsi
@@ -705,7 +705,7 @@
705 #address-cells = <1>; 705 #address-cells = <1>;
706 #size-cells = <0>; 706 #size-cells = <0>;
707 clocks = <&prcc_kclk 3 1>, <&prcc_pclk 3 1>; 707 clocks = <&prcc_kclk 3 1>, <&prcc_pclk 3 1>;
708 clock-names = "ssp0clk", "apb_pclk"; 708 clock-names = "SSPCLK", "apb_pclk";
709 dmas = <&dma 8 0 0x2>, /* Logical - DevToMem */ 709 dmas = <&dma 8 0 0x2>, /* Logical - DevToMem */
710 <&dma 8 0 0x0>; /* Logical - MemToDev */ 710 <&dma 8 0 0x0>; /* Logical - MemToDev */
711 dma-names = "rx", "tx"; 711 dma-names = "rx", "tx";
@@ -718,7 +718,7 @@
718 #address-cells = <1>; 718 #address-cells = <1>;
719 #size-cells = <0>; 719 #size-cells = <0>;
720 clocks = <&prcc_kclk 3 2>, <&prcc_pclk 3 2>; 720 clocks = <&prcc_kclk 3 2>, <&prcc_pclk 3 2>;
721 clock-names = "ssp1clk", "apb_pclk"; 721 clock-names = "SSPCLK", "apb_pclk";
722 dmas = <&dma 9 0 0x2>, /* Logical - DevToMem */ 722 dmas = <&dma 9 0 0x2>, /* Logical - DevToMem */
723 <&dma 9 0 0x0>; /* Logical - MemToDev */ 723 <&dma 9 0 0x0>; /* Logical - MemToDev */
724 dma-names = "rx", "tx"; 724 dma-names = "rx", "tx";
@@ -732,7 +732,7 @@
732 #size-cells = <0>; 732 #size-cells = <0>;
733 /* Same clock wired to kernel and pclk */ 733 /* Same clock wired to kernel and pclk */
734 clocks = <&prcc_pclk 2 8>, <&prcc_pclk 2 8>; 734 clocks = <&prcc_pclk 2 8>, <&prcc_pclk 2 8>;
735 clock-names = "spi0clk", "apb_pclk"; 735 clock-names = "SSPCLK", "apb_pclk";
736 dmas = <&dma 0 0 0x2>, /* Logical - DevToMem */ 736 dmas = <&dma 0 0 0x2>, /* Logical - DevToMem */
737 <&dma 0 0 0x0>; /* Logical - MemToDev */ 737 <&dma 0 0 0x0>; /* Logical - MemToDev */
738 dma-names = "rx", "tx"; 738 dma-names = "rx", "tx";
@@ -746,7 +746,7 @@
746 #size-cells = <0>; 746 #size-cells = <0>;
747 /* Same clock wired to kernel and pclk */ 747 /* Same clock wired to kernel and pclk */
748 clocks = <&prcc_pclk 2 2>, <&prcc_pclk 2 2>; 748 clocks = <&prcc_pclk 2 2>, <&prcc_pclk 2 2>;
749 clock-names = "spi1clk", "apb_pclk"; 749 clock-names = "SSPCLK", "apb_pclk";
750 dmas = <&dma 35 0 0x2>, /* Logical - DevToMem */ 750 dmas = <&dma 35 0 0x2>, /* Logical - DevToMem */
751 <&dma 35 0 0x0>; /* Logical - MemToDev */ 751 <&dma 35 0 0x0>; /* Logical - MemToDev */
752 dma-names = "rx", "tx"; 752 dma-names = "rx", "tx";
@@ -760,7 +760,7 @@
760 #size-cells = <0>; 760 #size-cells = <0>;
761 /* Same clock wired to kernel and pclk */ 761 /* Same clock wired to kernel and pclk */
762 clocks = <&prcc_pclk 2 1>, <&prcc_pclk 2 1>; 762 clocks = <&prcc_pclk 2 1>, <&prcc_pclk 2 1>;
763 clock-names = "spi2clk", "apb_pclk"; 763 clock-names = "SSPCLK", "apb_pclk";
764 dmas = <&dma 33 0 0x2>, /* Logical - DevToMem */ 764 dmas = <&dma 33 0 0x2>, /* Logical - DevToMem */
765 <&dma 33 0 0x0>; /* Logical - MemToDev */ 765 <&dma 33 0 0x0>; /* Logical - MemToDev */
766 dma-names = "rx", "tx"; 766 dma-names = "rx", "tx";
@@ -774,7 +774,7 @@
774 #size-cells = <0>; 774 #size-cells = <0>;
775 /* Same clock wired to kernel and pclk */ 775 /* Same clock wired to kernel and pclk */
776 clocks = <&prcc_pclk 1 7>, <&prcc_pclk 1 7>; 776 clocks = <&prcc_pclk 1 7>, <&prcc_pclk 1 7>;
777 clock-names = "spi3clk", "apb_pclk"; 777 clock-names = "SSPCLK", "apb_pclk";
778 dmas = <&dma 40 0 0x2>, /* Logical - DevToMem */ 778 dmas = <&dma 40 0 0x2>, /* Logical - DevToMem */
779 <&dma 40 0 0x0>; /* Logical - MemToDev */ 779 <&dma 40 0 0x0>; /* Logical - MemToDev */
780 dma-names = "rx", "tx"; 780 dma-names = "rx", "tx";
diff --git a/arch/arm/boot/dts/ste-href-ab8500.dtsi b/arch/arm/boot/dts/ste-href-ab8500.dtsi
new file mode 100644
index 000000000000..30f8601da323
--- /dev/null
+++ b/arch/arm/boot/dts/ste-href-ab8500.dtsi
@@ -0,0 +1,428 @@
1/*
2 * Copyright 2014 Linaro Ltd.
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/ {
13 soc {
14 prcmu@80157000 {
15 ab8500 {
16 ab8500-gpio {
17 /* Hog a few default settings */
18 pinctrl-names = "default";
19 pinctrl-0 = <&gpio2_default_mode>,
20 <&gpio4_default_mode>,
21 <&gpio10_default_mode>,
22 <&gpio11_default_mode>,
23 <&gpio12_default_mode>,
24 <&gpio13_default_mode>,
25 <&gpio16_default_mode>,
26 <&gpio24_default_mode>,
27 <&gpio25_default_mode>,
28 <&gpio36_default_mode>,
29 <&gpio37_default_mode>,
30 <&gpio38_default_mode>,
31 <&gpio39_default_mode>,
32 <&gpio42_default_mode>,
33 <&gpio26_default_mode>,
34 <&gpio35_default_mode>,
35 <&ycbcr_default_mode>,
36 <&pwm_default_mode>,
37 <&adi1_default_mode>,
38 <&usbuicc_default_mode>,
39 <&dmic_default_mode>,
40 <&extcpena_default_mode>,
41 <&modsclsda_default_mode>;
42
43 /*
44 * Pins 2, 4, 10, 11, 12, 13, 16, 24, 25, 36, 37, 38, 39 and 42
45 * are muxed in as GPIO, and configured as INPUT PULL DOWN
46 */
47 gpio2 {
48 gpio2_default_mode: gpio2_default {
49 default_mux {
50 ste,function = "gpio";
51 ste,pins = "gpio2_a_1";
52 };
53 default_cfg {
54 ste,pins = "GPIO2_T9";
55 input-enable;
56 bias-pull-down;
57 };
58 };
59 };
60 gpio4 {
61 gpio4_default_mode: gpio4_default {
62 default_mux {
63 ste,function = "gpio";
64 ste,pins = "gpio4_a_1";
65 };
66 default_cfg {
67 ste,pins = "GPIO4_W2";
68 input-enable;
69 bias-pull-down;
70 };
71 };
72 };
73 gpio10 {
74 gpio10_default_mode: gpio10_default {
75 default_mux {
76 ste,function = "gpio";
77 ste,pins = "gpio10_d_1";
78 };
79 default_cfg {
80 ste,pins = "GPIO10_U17";
81 input-enable;
82 bias-pull-down;
83 };
84 };
85 };
86 gpio11 {
87 gpio11_default_mode: gpio11_default {
88 default_mux {
89 ste,function = "gpio";
90 ste,pins = "gpio11_d_1";
91 };
92 default_cfg {
93 ste,pins = "GPIO11_AA18";
94 input-enable;
95 bias-pull-down;
96 };
97 };
98 };
99 gpio12 {
100 gpio12_default_mode: gpio12_default {
101 default_mux {
102 ste,function = "gpio";
103 ste,pins = "gpio12_d_1";
104 };
105 default_cfg {
106 ste,pins = "GPIO12_U16";
107 input-enable;
108 bias-pull-down;
109 };
110 };
111 };
112 gpio13 {
113 gpio13_default_mode: gpio13_default {
114 default_mux {
115 ste,function = "gpio";
116 ste,pins = "gpio13_d_1";
117 };
118 default_cfg {
119 ste,pins = "GPIO13_W17";
120 input-enable;
121 bias-pull-down;
122 };
123 };
124 };
125 gpio16 {
126 gpio16_default_mode: gpio16_default {
127 default_mux {
128 ste,function = "gpio";
129 ste,pins = "gpio16_a_1";
130 };
131 default_cfg {
132 ste,pins = "GPIO16_F15";
133 input-enable;
134 bias-pull-down;
135 };
136 };
137 };
138 gpio24 {
139 gpio24_default_mode: gpio24_default {
140 default_mux {
141 ste,function = "gpio";
142 ste,pins = "gpio24_a_1";
143 };
144 default_cfg {
145 ste,pins = "GPIO24_T14";
146 input-enable;
147 bias-pull-down;
148 };
149 };
150 };
151 gpio25 {
152 gpio25_default_mode: gpio25_default {
153 default_mux {
154 ste,function = "gpio";
155 ste,pins = "gpio25_a_1";
156 };
157 default_cfg {
158 ste,pins = "GPIO25_R16";
159 input-enable;
160 bias-pull-down;
161 };
162 };
163 };
164 gpio36 {
165 gpio36_default_mode: gpio36_default {
166 default_mux {
167 ste,function = "gpio";
168 ste,pins = "gpio36_a_1";
169 };
170 default_cfg {
171 ste,pins = "GPIO36_A17";
172 input-enable;
173 bias-pull-down;
174 };
175 };
176 };
177 gpio37 {
178 gpio37_default_mode: gpio37_default {
179 default_mux {
180 ste,function = "gpio";
181 ste,pins = "gpio37_a_1";
182 };
183 default_cfg {
184 ste,pins = "GPIO37_E15";
185 input-enable;
186 bias-pull-down;
187 };
188 };
189 };
190 gpio38 {
191 gpio38_default_mode: gpio38_default {
192 default_mux {
193 ste,function = "gpio";
194 ste,pins = "gpio38_a_1";
195 };
196 default_cfg {
197 ste,pins = "GPIO38_C17";
198 input-enable;
199 bias-pull-down;
200 };
201 };
202 };
203 gpio39 {
204 gpio39_default_mode: gpio39_default {
205 default_mux {
206 ste,function = "gpio";
207 ste,pins = "gpio39_a_1";
208 };
209 default_cfg {
210 ste,pins = "GPIO39_E16";
211 input-enable;
212 bias-pull-down;
213 };
214 };
215 };
216 gpio42 {
217 gpio42_default_mode: gpio42_default {
218 default_mux {
219 ste,function = "gpio";
220 ste,pins = "gpio42_a_1";
221 };
222 default_cfg {
223 ste,pins = "GPIO42_U2";
224 input-enable;
225 bias-pull-down;
226 };
227 };
228 };
229 /*
230 * Pins 26 and 35 muxed in as GPIO, and configured as OUTPUT LOW
231 */
232 gpio26 {
233 gpio26_default_mode: gpio26_default {
234 default_mux {
235 ste,function = "gpio";
236 ste,pins = "gpio26_d_1";
237 };
238 default_cfg {
239 ste,pins = "GPIO26_M16";
240 output-low;
241 };
242 };
243 };
244 gpio35 {
245 gpio35_default_mode: gpio35_default {
246 default_mux {
247 ste,function = "gpio";
248 ste,pins = "gpio35_d_1";
249 };
250 default_cfg {
251 ste,pins = "GPIO35_W15";
252 output-low;
253 };
254 };
255 };
256 /*
257 * This sets up the YCBCR connector pins, i.e. analog video out.
258 * Set as input with no bias.
259 */
260 ycbcr {
261 ycbcr_default_mode: ycbcr_default {
262 default_mux {
263 ste,function = "ycbcr";
264 ste,pins = "ycbcr0123_d_1";
265 };
266 default_cfg {
267 ste,pins = "GPIO6_Y18",
268 "GPIO7_AA20",
269 "GPIO8_W18",
270 "GPIO9_AA19";
271 input-enable;
272 bias-disable;
273 };
274 };
275 };
276 /* This sets up the PWM pins 14 and 15 */
277 pwm {
278 pwm_default_mode: pwm_default {
279 default_mux {
280 ste,function = "pwmout";
281 ste,pins = "pwmout1_d_1", "pwmout2_d_1";
282 };
283 default_cfg {
284 ste,pins = "GPIO14_F14",
285 "GPIO15_B17";
286 input-enable;
287 bias-pull-down;
288 };
289 };
290 };
291 /* This sets up audio interface 1 */
292 adi1 {
293 adi1_default_mode: adi1_default {
294 default_mux {
295 ste,function = "adi1";
296 ste,pins = "adi1_d_1";
297 };
298 default_cfg {
299 ste,pins = "GPIO17_P5",
300 "GPIO18_R5",
301 "GPIO19_U5",
302 "GPIO20_T5";
303 input-enable;
304 bias-pull-down;
305 };
306 };
307 };
308 /* This sets up the USB UICC pins */
309 usbuicc {
310 usbuicc_default_mode: usbuicc_default {
311 default_mux {
312 ste,function = "usbuicc";
313 ste,pins = "usbuicc_d_1";
314 };
315 default_cfg {
316 ste,pins = "GPIO21_H19",
317 "GPIO22_G20",
318 "GPIO23_G19";
319 input-enable;
320 bias-pull-down;
321 };
322 };
323 };
324 /* This sets up the microphone pins */
325 dmic {
326 dmic_default_mode: dmic_default {
327 default_mux {
328 ste,function = "dmic";
329 ste,pins = "dmic12_d_1",
330 "dmic34_d_1",
331 "dmic56_d_1";
332 };
333 default_cfg {
334 ste,pins = "GPIO27_J6",
335 "GPIO28_K6",
336 "GPIO29_G6",
337 "GPIO30_H6",
338 "GPIO31_F5",
339 "GPIO32_G5";
340 input-enable;
341 bias-pull-down;
342 };
343 };
344 };
345 extcpena {
346 extcpena_default_mode: extcpena_default {
347 default_mux {
348 ste,function = "extcpena";
349 ste,pins = "extcpena_d_1";
350 };
351 default_cfg {
352 ste,pins = "GPIO34_R17";
353 input-enable;
354 bias-pull-down;
355 };
356 };
357 };
358 /* Modem I2C setup (SCL and SDA pins) */
359 modsclsda {
360 modsclsda_default_mode: modsclsda_default {
361 default_mux {
362 ste,function = "modsclsda";
363 ste,pins = "modsclsda_d_1";
364 };
365 default_cfg {
366 ste,pins = "GPIO40_T19",
367 "GPIO41_U19";
368 input-enable;
369 bias-pull-down;
370 };
371 };
372 };
373 /*
374 * Clock output pins associated with regulators.
375 */
376 sysclkreq2 {
377 sysclkreq2_default_mode: sysclkreq2_default {
378 default_mux {
379 ste,function = "sysclkreq";
380 ste,pins = "sysclkreq2_d_1";
381 };
382 default_cfg {
383 ste,pins = "GPIO1_T10";
384 input-enable;
385 bias-disable;
386 };
387 };
388 sysclkreq2_sleep_mode: sysclkreq2_sleep {
389 default_mux {
390 ste,function = "gpio";
391 ste,pins = "gpio1_a_1";
392 };
393 default_cfg {
394 ste,pins = "GPIO1_T10";
395 input-enable;
396 bias-pull-down;
397 };
398 };
399 };
400 sysclkreq4 {
401 sysclkreq4_default_mode: sysclkreq4_default {
402 default_mux {
403 ste,function = "sysclkreq";
404 ste,pins = "sysclkreq4_d_1";
405 };
406 default_cfg {
407 ste,pins = "GPIO3_U9";
408 input-enable;
409 bias-disable;
410 };
411 };
412 sysclkreq4_sleep_mode: sysclkreq4_sleep {
413 default_mux {
414 ste,function = "gpio";
415 ste,pins = "gpio3_a_1";
416 };
417 default_cfg {
418 ste,pins = "GPIO3_U9";
419 input-enable;
420 bias-pull-down;
421 };
422 };
423 };
424 };
425 };
426 };
427 };
428};
diff --git a/arch/arm/boot/dts/ste-href-ab8505.dtsi b/arch/arm/boot/dts/ste-href-ab8505.dtsi
new file mode 100644
index 000000000000..6006d62086a2
--- /dev/null
+++ b/arch/arm/boot/dts/ste-href-ab8505.dtsi
@@ -0,0 +1,240 @@
1/*
2 * Copyright 2014 Linaro Ltd.
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/ {
13 soc {
14 prcmu@80157000 {
15 ab8505 {
16 ab8505-gpio {
17 /* Hog a few default settings */
18 pinctrl-names = "default";
19 pinctrl-0 = <&gpio2_default_mode>,
20 <&gpio10_default_mode>,
21 <&gpio11_default_mode>,
22 <&gpio13_default_mode>,
23 <&gpio34_default_mode>,
24 <&gpio50_default_mode>,
25 <&pwm_default_mode>,
26 <&adi2_default_mode>,
27 <&modsclsda_default_mode>,
28 <&resethw_default_mode>,
29 <&service_default_mode>;
30
31 /*
32 * Pins 2, 10, 11, 13, 34 and 50
33 * are muxed in as GPIO, and configured as INPUT PULL DOWN
34 */
35 gpio2 {
36 gpio2_default_mode: gpio2_default {
37 default_mux {
38 ste,function = "gpio";
39 ste,pins = "gpio2_a_1";
40 };
41 default_cfg {
42 ste,pins = "GPIO2_R5";
43 input-enable;
44 bias-pull-down;
45 };
46 };
47 };
48 gpio10 {
49 gpio10_default_mode: gpio10_default {
50 default_mux {
51 ste,function = "gpio";
52 ste,pins = "gpio10_d_1";
53 };
54 default_cfg {
55 ste,pins = "GPIO10_B16";
56 input-enable;
57 bias-pull-down;
58 };
59 };
60 };
61 gpio11 {
62 gpio11_default_mode: gpio11_default {
63 default_mux {
64 ste,function = "gpio";
65 ste,pins = "gpio11_d_1";
66 };
67 default_cfg {
68 ste,pins = "GPIO11_B17";
69 input-enable;
70 bias-pull-down;
71 };
72 };
73 };
74 gpio13 {
75 gpio13_default_mode: gpio13_default {
76 default_mux {
77 ste,function = "gpio";
78 ste,pins = "gpio13_d_1";
79 };
80 default_cfg {
81 ste,pins = "GPIO13_D17";
82 input-enable;
83 bias-disable;
84 };
85 };
86 };
87 gpio34 {
88 gpio34_default_mode: gpio34_default {
89 default_mux {
90 ste,function = "gpio";
91 ste,pins = "gpio34_a_1";
92 };
93 default_cfg {
94 ste,pins = "GPIO34_H14";
95 input-enable;
96 bias-pull-down;
97 };
98 };
99 };
100 gpio50 {
101 gpio50_default_mode: gpio50_default {
102 default_mux {
103 ste,function = "gpio";
104 ste,pins = "gpio50_d_1";
105 };
106 default_cfg {
107 ste,pins = "GPIO50_L4";
108 input-enable;
109 bias-disable;
110 };
111 };
112 };
113 /* This sets up the PWM pin 14 */
114 pwm {
115 pwm_default_mode: pwm_default {
116 default_mux {
117 ste,function = "pwmout";
118 ste,pins = "pwmout1_d_1";
119 };
120 default_cfg {
121 ste,pins = "GPIO14_C16";
122 input-enable;
123 bias-pull-down;
124 };
125 };
126 };
127 /* This sets up audio interface 2 */
128 adi2 {
129 adi2_default_mode: adi2_default {
130 default_mux {
131 ste,function = "adi2";
132 ste,pins = "adi2_d_1";
133 };
134 default_cfg {
135 ste,pins = "GPIO17_P2",
136 "GPIO18_N3",
137 "GPIO19_T1",
138 "GPIO20_P3";
139 input-enable;
140 bias-pull-down;
141 };
142 };
143 };
144 /* Modem I2C setup (SCL and SDA pins) */
145 modsclsda {
146 modsclsda_default_mode: modsclsda_default {
147 default_mux {
148 ste,function = "modsclsda";
149 ste,pins = "modsclsda_d_1";
150 };
151 default_cfg {
152 ste,pins = "GPIO40_J15",
153 "GPIO41_J14";
154 input-enable;
155 bias-pull-down;
156 };
157 };
158 };
159 resethw {
160 resethw_default_mode: resethw_default {
161 default_mux {
162 ste,function = "resethw";
163 ste,pins = "resethw_d_1";
164 };
165 default_cfg {
166 ste,pins = "GPIO52_D16";
167 input-enable;
168 bias-pull-down;
169 };
170 };
171 };
172 service {
173 service_default_mode: service_default {
174 default_mux {
175 ste,function = "service";
176 ste,pins = "service_d_1";
177 };
178 default_cfg {
179 ste,pins = "GPIO53_D15";
180 input-enable;
181 bias-pull-down;
182 };
183 };
184 };
185 /*
186 * Clock output pins associated with regulators.
187 */
188 sysclkreq2 {
189 sysclkreq2_default_mode: sysclkreq2_default {
190 default_mux {
191 ste,function = "sysclkreq";
192 ste,pins = "sysclkreq2_d_1";
193 };
194 default_cfg {
195 ste,pins = "GPIO1_N4";
196 input-enable;
197 bias-disable;
198 };
199 };
200 sysclkreq2_sleep_mode: sysclkreq2_sleep {
201 default_mux {
202 ste,function = "gpio";
203 ste,pins = "gpio1_a_1";
204 };
205 default_cfg {
206 ste,pins = "GPIO1_N4";
207 input-enable;
208 bias-pull-down;
209 };
210 };
211 };
212 sysclkreq4 {
213 sysclkreq4_default_mode: sysclkreq4_default {
214 default_mux {
215 ste,function = "sysclkreq";
216 ste,pins = "sysclkreq4_d_1";
217 };
218 default_cfg {
219 ste,pins = "GPIO3_P5";
220 input-enable;
221 bias-disable;
222 };
223 };
224 sysclkreq4_sleep_mode: sysclkreq4_sleep {
225 default_mux {
226 ste,function = "gpio";
227 ste,pins = "gpio3_a_1";
228 };
229 default_cfg {
230 ste,pins = "GPIO3_P5";
231 input-enable;
232 bias-pull-down;
233 };
234 };
235 };
236 };
237 };
238 };
239 };
240};
diff --git a/arch/arm/boot/dts/ste-hrefprev60.dtsi b/arch/arm/boot/dts/ste-hrefprev60.dtsi
index 40f0ecdf9303..abc762e24fcb 100644
--- a/arch/arm/boot/dts/ste-hrefprev60.dtsi
+++ b/arch/arm/boot/dts/ste-hrefprev60.dtsi
@@ -12,6 +12,7 @@
12 */ 12 */
13 13
14#include "ste-dbx5x0.dtsi" 14#include "ste-dbx5x0.dtsi"
15#include "ste-href-ab8500.dtsi"
15#include "ste-href.dtsi" 16#include "ste-href.dtsi"
16 17
17/ { 18/ {
diff --git a/arch/arm/boot/dts/ste-hrefv60plus.dtsi b/arch/arm/boot/dts/ste-hrefv60plus.dtsi
index 3b6d1181939b..c2341061b943 100644
--- a/arch/arm/boot/dts/ste-hrefv60plus.dtsi
+++ b/arch/arm/boot/dts/ste-hrefv60plus.dtsi
@@ -10,6 +10,7 @@
10 */ 10 */
11 11
12#include "ste-dbx5x0.dtsi" 12#include "ste-dbx5x0.dtsi"
13#include "ste-href-ab8500.dtsi"
13#include "ste-href.dtsi" 14#include "ste-href.dtsi"
14 15
15/ { 16/ {
diff --git a/arch/arm/boot/dts/ste-snowball.dts b/arch/arm/boot/dts/ste-snowball.dts
index 97d5d21b7db7..a2f632d0be2a 100644
--- a/arch/arm/boot/dts/ste-snowball.dts
+++ b/arch/arm/boot/dts/ste-snowball.dts
@@ -11,6 +11,7 @@
11 11
12/dts-v1/; 12/dts-v1/;
13#include "ste-dbx5x0.dtsi" 13#include "ste-dbx5x0.dtsi"
14#include "ste-href-ab8500.dtsi"
14#include "ste-href-family-pinctrl.dtsi" 15#include "ste-href-family-pinctrl.dtsi"
15 16
16/ { 17/ {
diff --git a/arch/arm/boot/dts/ste-u300.dts b/arch/arm/boot/dts/ste-u300.dts
index a9da4800daf0..6fe688e9e4da 100644
--- a/arch/arm/boot/dts/ste-u300.dts
+++ b/arch/arm/boot/dts/ste-u300.dts
@@ -457,7 +457,7 @@
457 interrupt-parent = <&vica>; 457 interrupt-parent = <&vica>;
458 interrupts = <23>; 458 interrupts = <23>;
459 clocks = <&spi_clk>, <&spi_clk>; 459 clocks = <&spi_clk>, <&spi_clk>;
460 clock-names = "apb_pclk", "spi_clk"; 460 clock-names = "SSPCLK", "apb_pclk";
461 dmas = <&dmac 27 &dmac 28>; 461 dmas = <&dmac 27 &dmac 28>;
462 dma-names = "tx", "rx"; 462 dma-names = "tx", "rx";
463 num-cs = <3>; 463 num-cs = <3>;
diff --git a/arch/arm/boot/dts/stih415-clock.dtsi b/arch/arm/boot/dts/stih415-clock.dtsi
index 174c799df741..d047dbc28d61 100644
--- a/arch/arm/boot/dts/stih415-clock.dtsi
+++ b/arch/arm/boot/dts/stih415-clock.dtsi
@@ -34,5 +34,19 @@
34 compatible = "fixed-clock"; 34 compatible = "fixed-clock";
35 clock-frequency = <100000000>; 35 clock-frequency = <100000000>;
36 }; 36 };
37
38 CLKS_GMAC0_PHY: clockgenA1@7 {
39 #clock-cells = <0>;
40 compatible = "fixed-clock";
41 clock-frequency = <25000000>;
42 clock-output-names = "CLKS_GMAC0_PHY";
43 };
44
45 CLKS_ETH1_PHY: clockgenA0@7 {
46 #clock-cells = <0>;
47 compatible = "fixed-clock";
48 clock-frequency = <25000000>;
49 clock-output-names = "CLKS_ETH1_PHY";
50 };
37 }; 51 };
38}; 52};
diff --git a/arch/arm/boot/dts/stih415-pinctrl.dtsi b/arch/arm/boot/dts/stih415-pinctrl.dtsi
index e56449d41481..f09fb10a3791 100644
--- a/arch/arm/boot/dts/stih415-pinctrl.dtsi
+++ b/arch/arm/boot/dts/stih415-pinctrl.dtsi
@@ -7,6 +7,7 @@
7 * publishhed by the Free Software Foundation. 7 * publishhed by the Free Software Foundation.
8 */ 8 */
9#include "st-pincfg.h" 9#include "st-pincfg.h"
10#include <dt-bindings/interrupt-controller/arm-gic.h>
10/ { 11/ {
11 12
12 aliases { 13 aliases {
@@ -45,35 +46,49 @@
45 #size-cells = <1>; 46 #size-cells = <1>;
46 compatible = "st,stih415-sbc-pinctrl"; 47 compatible = "st,stih415-sbc-pinctrl";
47 st,syscfg = <&syscfg_sbc>; 48 st,syscfg = <&syscfg_sbc>;
49 reg = <0xfe61f080 0x4>;
50 reg-names = "irqmux";
51 interrupts = <GIC_SPI 180 IRQ_TYPE_LEVEL_HIGH>;
52 interrupts-names = "irqmux";
48 ranges = <0 0xfe610000 0x5000>; 53 ranges = <0 0xfe610000 0x5000>;
49 54
50 PIO0: gpio@fe610000 { 55 PIO0: gpio@fe610000 {
51 gpio-controller; 56 gpio-controller;
52 #gpio-cells = <1>; 57 #gpio-cells = <1>;
58 interrupt-controller;
59 #interrupt-cells = <2>;
53 reg = <0 0x100>; 60 reg = <0 0x100>;
54 st,bank-name = "PIO0"; 61 st,bank-name = "PIO0";
55 }; 62 };
56 PIO1: gpio@fe611000 { 63 PIO1: gpio@fe611000 {
57 gpio-controller; 64 gpio-controller;
58 #gpio-cells = <1>; 65 #gpio-cells = <1>;
66 interrupt-controller;
67 #interrupt-cells = <2>;
59 reg = <0x1000 0x100>; 68 reg = <0x1000 0x100>;
60 st,bank-name = "PIO1"; 69 st,bank-name = "PIO1";
61 }; 70 };
62 PIO2: gpio@fe612000 { 71 PIO2: gpio@fe612000 {
63 gpio-controller; 72 gpio-controller;
64 #gpio-cells = <1>; 73 #gpio-cells = <1>;
74 interrupt-controller;
75 #interrupt-cells = <2>;
65 reg = <0x2000 0x100>; 76 reg = <0x2000 0x100>;
66 st,bank-name = "PIO2"; 77 st,bank-name = "PIO2";
67 }; 78 };
68 PIO3: gpio@fe613000 { 79 PIO3: gpio@fe613000 {
69 gpio-controller; 80 gpio-controller;
70 #gpio-cells = <1>; 81 #gpio-cells = <1>;
82 interrupt-controller;
83 #interrupt-cells = <2>;
71 reg = <0x3000 0x100>; 84 reg = <0x3000 0x100>;
72 st,bank-name = "PIO3"; 85 st,bank-name = "PIO3";
73 }; 86 };
74 PIO4: gpio@fe614000 { 87 PIO4: gpio@fe614000 {
75 gpio-controller; 88 gpio-controller;
76 #gpio-cells = <1>; 89 #gpio-cells = <1>;
90 interrupt-controller;
91 #interrupt-cells = <2>;
77 reg = <0x4000 0x100>; 92 reg = <0x4000 0x100>;
78 st,bank-name = "PIO4"; 93 st,bank-name = "PIO4";
79 }; 94 };
@@ -104,6 +119,64 @@
104 }; 119 };
105 }; 120 };
106 }; 121 };
122
123 rc{
124 pinctrl_ir: ir0 {
125 st,pins {
126 ir = <&PIO4 0 ALT2 IN>;
127 };
128 };
129 };
130
131 gmac1 {
132 pinctrl_mii1: mii1 {
133 st,pins {
134 txd0 = <&PIO0 0 ALT1 OUT SE_NICLK_IO 0 CLK_A>;
135 txd1 = <&PIO0 1 ALT1 OUT SE_NICLK_IO 0 CLK_A>;
136 txd2 = <&PIO0 2 ALT1 OUT SE_NICLK_IO 0 CLK_A>;
137 txd3 = <&PIO0 3 ALT1 OUT SE_NICLK_IO 0 CLK_A>;
138 txer = <&PIO0 4 ALT1 OUT SE_NICLK_IO 0 CLK_A>;
139 txen = <&PIO0 5 ALT1 OUT SE_NICLK_IO 0 CLK_A>;
140 txclk = <&PIO0 6 ALT1 IN NICLK 0 CLK_A>;
141 col = <&PIO0 7 ALT1 IN BYPASS 1000>;
142 mdio = <&PIO1 0 ALT1 OUT BYPASS 0>;
143 mdc = <&PIO1 1 ALT1 OUT NICLK 0 CLK_A>;
144 crs = <&PIO1 2 ALT1 IN BYPASS 1000>;
145 mdint = <&PIO1 3 ALT1 IN BYPASS 0>;
146 rxd0 = <&PIO1 4 ALT1 IN SE_NICLK_IO 0 CLK_A>;
147 rxd1 = <&PIO1 5 ALT1 IN SE_NICLK_IO 0 CLK_A>;
148 rxd2 = <&PIO1 6 ALT1 IN SE_NICLK_IO 0 CLK_A>;
149 rxd3 = <&PIO1 7 ALT1 IN SE_NICLK_IO 0 CLK_A>;
150 rxdv = <&PIO2 0 ALT1 IN SE_NICLK_IO 0 CLK_A>;
151 rx_er = <&PIO2 1 ALT1 IN SE_NICLK_IO 0 CLK_A>;
152 rxclk = <&PIO2 2 ALT1 IN NICLK 0 CLK_A>;
153 phyclk = <&PIO2 3 ALT1 IN NICLK 1000 CLK_A>;
154 };
155 };
156
157 pinctrl_rgmii1: rgmii1-0 {
158 st,pins {
159 txd0 = <&PIO0 0 ALT1 OUT DE_IO 1000 CLK_A>;
160 txd1 = <&PIO0 1 ALT1 OUT DE_IO 1000 CLK_A>;
161 txd2 = <&PIO0 2 ALT1 OUT DE_IO 1000 CLK_A>;
162 txd3 = <&PIO0 3 ALT1 OUT DE_IO 1000 CLK_A>;
163 txen = <&PIO0 5 ALT1 OUT DE_IO 0 CLK_A>;
164 txclk = <&PIO0 6 ALT1 IN NICLK 0 CLK_A>;
165 mdio = <&PIO1 0 ALT1 OUT BYPASS 0>;
166 mdc = <&PIO1 1 ALT1 OUT NICLK 0 CLK_A>;
167 rxd0 = <&PIO1 4 ALT1 IN DE_IO 0 CLK_A>;
168 rxd1 = <&PIO1 5 ALT1 IN DE_IO 0 CLK_A>;
169 rxd2 = <&PIO1 6 ALT1 IN DE_IO 0 CLK_A>;
170 rxd3 = <&PIO1 7 ALT1 IN DE_IO 0 CLK_A>;
171
172 rxdv = <&PIO2 0 ALT1 IN DE_IO 500 CLK_A>;
173 rxclk = <&PIO2 2 ALT1 IN NICLK 0 CLK_A>;
174 phyclk = <&PIO2 3 ALT4 OUT NICLK 0 CLK_B>;
175
176 clk125= <&PIO3 7 ALT4 IN NICLK 0 CLK_A>;
177 };
178 };
179 };
107 }; 180 };
108 181
109 pin-controller-front { 182 pin-controller-front {
@@ -111,53 +184,73 @@
111 #size-cells = <1>; 184 #size-cells = <1>;
112 compatible = "st,stih415-front-pinctrl"; 185 compatible = "st,stih415-front-pinctrl";
113 st,syscfg = <&syscfg_front>; 186 st,syscfg = <&syscfg_front>;
187 reg = <0xfee0f080 0x4>;
188 reg-names = "irqmux";
189 interrupts = <GIC_SPI 181 IRQ_TYPE_LEVEL_HIGH>;
190 interrupts-names = "irqmux";
114 ranges = <0 0xfee00000 0x8000>; 191 ranges = <0 0xfee00000 0x8000>;
115 192
116 PIO5: gpio@fee00000 { 193 PIO5: gpio@fee00000 {
117 gpio-controller; 194 gpio-controller;
118 #gpio-cells = <1>; 195 #gpio-cells = <1>;
196 interrupt-controller;
197 #interrupt-cells = <2>;
119 reg = <0 0x100>; 198 reg = <0 0x100>;
120 st,bank-name = "PIO5"; 199 st,bank-name = "PIO5";
121 }; 200 };
122 PIO6: gpio@fee01000 { 201 PIO6: gpio@fee01000 {
123 gpio-controller; 202 gpio-controller;
124 #gpio-cells = <1>; 203 #gpio-cells = <1>;
204 interrupt-controller;
205 #interrupt-cells = <2>;
125 reg = <0x1000 0x100>; 206 reg = <0x1000 0x100>;
126 st,bank-name = "PIO6"; 207 st,bank-name = "PIO6";
127 }; 208 };
128 PIO7: gpio@fee02000 { 209 PIO7: gpio@fee02000 {
129 gpio-controller; 210 gpio-controller;
130 #gpio-cells = <1>; 211 #gpio-cells = <1>;
212 interrupt-controller;
213 #interrupt-cells = <2>;
131 reg = <0x2000 0x100>; 214 reg = <0x2000 0x100>;
132 st,bank-name = "PIO7"; 215 st,bank-name = "PIO7";
133 }; 216 };
134 PIO8: gpio@fee03000 { 217 PIO8: gpio@fee03000 {
135 gpio-controller; 218 gpio-controller;
136 #gpio-cells = <1>; 219 #gpio-cells = <1>;
220 interrupt-controller;
221 #interrupt-cells = <2>;
137 reg = <0x3000 0x100>; 222 reg = <0x3000 0x100>;
138 st,bank-name = "PIO8"; 223 st,bank-name = "PIO8";
139 }; 224 };
140 PIO9: gpio@fee04000 { 225 PIO9: gpio@fee04000 {
141 gpio-controller; 226 gpio-controller;
142 #gpio-cells = <1>; 227 #gpio-cells = <1>;
228 interrupt-controller;
229 #interrupt-cells = <2>;
143 reg = <0x4000 0x100>; 230 reg = <0x4000 0x100>;
144 st,bank-name = "PIO9"; 231 st,bank-name = "PIO9";
145 }; 232 };
146 PIO10: gpio@fee05000 { 233 PIO10: gpio@fee05000 {
147 gpio-controller; 234 gpio-controller;
148 #gpio-cells = <1>; 235 #gpio-cells = <1>;
236 interrupt-controller;
237 #interrupt-cells = <2>;
149 reg = <0x5000 0x100>; 238 reg = <0x5000 0x100>;
150 st,bank-name = "PIO10"; 239 st,bank-name = "PIO10";
151 }; 240 };
152 PIO11: gpio@fee06000 { 241 PIO11: gpio@fee06000 {
153 gpio-controller; 242 gpio-controller;
154 #gpio-cells = <1>; 243 #gpio-cells = <1>;
244 interrupt-controller;
245 #interrupt-cells = <2>;
155 reg = <0x6000 0x100>; 246 reg = <0x6000 0x100>;
156 st,bank-name = "PIO11"; 247 st,bank-name = "PIO11";
157 }; 248 };
158 PIO12: gpio@fee07000 { 249 PIO12: gpio@fee07000 {
159 gpio-controller; 250 gpio-controller;
160 #gpio-cells = <1>; 251 #gpio-cells = <1>;
252 interrupt-controller;
253 #interrupt-cells = <2>;
161 reg = <0x7000 0x100>; 254 reg = <0x7000 0x100>;
162 st,bank-name = "PIO12"; 255 st,bank-name = "PIO12";
163 }; 256 };
@@ -186,41 +279,57 @@
186 #size-cells = <1>; 279 #size-cells = <1>;
187 compatible = "st,stih415-rear-pinctrl"; 280 compatible = "st,stih415-rear-pinctrl";
188 st,syscfg = <&syscfg_rear>; 281 st,syscfg = <&syscfg_rear>;
282 reg = <0xfe82f080 0x4>;
283 reg-names = "irqmux";
284 interrupts = <GIC_SPI 182 IRQ_TYPE_LEVEL_HIGH>;
285 interrupts-names = "irqmux";
189 ranges = <0 0xfe820000 0x8000>; 286 ranges = <0 0xfe820000 0x8000>;
190 287
191 PIO13: gpio@fe820000 { 288 PIO13: gpio@fe820000 {
192 gpio-controller; 289 gpio-controller;
193 #gpio-cells = <1>; 290 #gpio-cells = <1>;
291 interrupt-controller;
292 #interrupt-cells = <2>;
194 reg = <0 0x100>; 293 reg = <0 0x100>;
195 st,bank-name = "PIO13"; 294 st,bank-name = "PIO13";
196 }; 295 };
197 PIO14: gpio@fe821000 { 296 PIO14: gpio@fe821000 {
198 gpio-controller; 297 gpio-controller;
199 #gpio-cells = <1>; 298 #gpio-cells = <1>;
299 interrupt-controller;
300 #interrupt-cells = <2>;
200 reg = <0x1000 0x100>; 301 reg = <0x1000 0x100>;
201 st,bank-name = "PIO14"; 302 st,bank-name = "PIO14";
202 }; 303 };
203 PIO15: gpio@fe822000 { 304 PIO15: gpio@fe822000 {
204 gpio-controller; 305 gpio-controller;
205 #gpio-cells = <1>; 306 #gpio-cells = <1>;
307 interrupt-controller;
308 #interrupt-cells = <2>;
206 reg = <0x2000 0x100>; 309 reg = <0x2000 0x100>;
207 st,bank-name = "PIO15"; 310 st,bank-name = "PIO15";
208 }; 311 };
209 PIO16: gpio@fe823000 { 312 PIO16: gpio@fe823000 {
210 gpio-controller; 313 gpio-controller;
211 #gpio-cells = <1>; 314 #gpio-cells = <1>;
315 interrupt-controller;
316 #interrupt-cells = <2>;
212 reg = <0x3000 0x100>; 317 reg = <0x3000 0x100>;
213 st,bank-name = "PIO16"; 318 st,bank-name = "PIO16";
214 }; 319 };
215 PIO17: gpio@fe824000 { 320 PIO17: gpio@fe824000 {
216 gpio-controller; 321 gpio-controller;
217 #gpio-cells = <1>; 322 #gpio-cells = <1>;
323 interrupt-controller;
324 #interrupt-cells = <2>;
218 reg = <0x4000 0x100>; 325 reg = <0x4000 0x100>;
219 st,bank-name = "PIO17"; 326 st,bank-name = "PIO17";
220 }; 327 };
221 PIO18: gpio@fe825000 { 328 PIO18: gpio@fe825000 {
222 gpio-controller; 329 gpio-controller;
223 #gpio-cells = <1>; 330 #gpio-cells = <1>;
331 interrupt-controller;
332 #interrupt-cells = <2>;
224 reg = <0x5000 0x100>; 333 reg = <0x5000 0x100>;
225 st,bank-name = "PIO18"; 334 st,bank-name = "PIO18";
226 }; 335 };
@@ -233,6 +342,77 @@
233 }; 342 };
234 }; 343 };
235 }; 344 };
345
346 gmac0{
347 pinctrl_mii0: mii0 {
348 st,pins {
349 mdint = <&PIO13 6 ALT2 IN BYPASS 0>;
350 txen = <&PIO13 7 ALT2 OUT SE_NICLK_IO 0 CLK_A>;
351
352 txd0 = <&PIO14 0 ALT2 OUT SE_NICLK_IO 0 CLK_A>;
353 txd1 = <&PIO14 1 ALT2 OUT SE_NICLK_IO 0 CLK_A>;
354 txd2 = <&PIO14 2 ALT2 OUT SE_NICLK_IO 0 CLK_B>;
355 txd3 = <&PIO14 3 ALT2 OUT SE_NICLK_IO 0 CLK_B>;
356
357 txclk = <&PIO15 0 ALT2 IN NICLK 0 CLK_A>;
358 txer = <&PIO15 1 ALT2 OUT SE_NICLK_IO 0 CLK_A>;
359 crs = <&PIO15 2 ALT2 IN BYPASS 1000>;
360 col = <&PIO15 3 ALT2 IN BYPASS 1000>;
361 mdio = <&PIO15 4 ALT2 OUT BYPASS 3000>;
362 mdc = <&PIO15 5 ALT2 OUT NICLK 0 CLK_B>;
363
364 rxd0 = <&PIO16 0 ALT2 IN SE_NICLK_IO 0 CLK_A>;
365 rxd1 = <&PIO16 1 ALT2 IN SE_NICLK_IO 0 CLK_A>;
366 rxd2 = <&PIO16 2 ALT2 IN SE_NICLK_IO 0 CLK_A>;
367 rxd3 = <&PIO16 3 ALT2 IN SE_NICLK_IO 0 CLK_A>;
368 rxdv = <&PIO15 6 ALT2 IN SE_NICLK_IO 0 CLK_A>;
369 rx_er = <&PIO15 7 ALT2 IN SE_NICLK_IO 0 CLK_A>;
370 rxclk = <&PIO17 0 ALT2 IN NICLK 0 CLK_A>;
371 phyclk = <&PIO13 5 ALT2 OUT NICLK 1000 CLK_A>;
372
373 };
374 };
375
376 pinctrl_gmii0: gmii0 {
377 st,pins {
378 mdint = <&PIO13 6 ALT2 IN BYPASS 0>;
379 mdio = <&PIO15 4 ALT2 OUT BYPASS 3000>;
380 mdc = <&PIO15 5 ALT2 OUT NICLK 0 CLK_B>;
381 txen = <&PIO13 7 ALT2 OUT SE_NICLK_IO 3000 CLK_A>;
382
383 txd0 = <&PIO14 0 ALT2 OUT SE_NICLK_IO 3000 CLK_A>;
384 txd1 = <&PIO14 1 ALT2 OUT SE_NICLK_IO 3000 CLK_A>;
385 txd2 = <&PIO14 2 ALT2 OUT SE_NICLK_IO 3000 CLK_B>;
386 txd3 = <&PIO14 3 ALT2 OUT SE_NICLK_IO 3000 CLK_B>;
387 txd4 = <&PIO14 4 ALT2 OUT SE_NICLK_IO 3000 CLK_B>;
388 txd5 = <&PIO14 5 ALT2 OUT SE_NICLK_IO 3000 CLK_B>;
389 txd6 = <&PIO14 6 ALT2 OUT SE_NICLK_IO 3000 CLK_B>;
390 txd7 = <&PIO14 7 ALT2 OUT SE_NICLK_IO 3000 CLK_B>;
391
392 txclk = <&PIO15 0 ALT2 IN NICLK 0 CLK_A>;
393 txer = <&PIO15 1 ALT2 OUT SE_NICLK_IO 3000 CLK_A>;
394 crs = <&PIO15 2 ALT2 IN BYPASS 1000>;
395 col = <&PIO15 3 ALT2 IN BYPASS 1000>;
396 rxdv = <&PIO15 6 ALT2 IN SE_NICLK_IO 1500 CLK_A>;
397 rx_er = <&PIO15 7 ALT2 IN SE_NICLK_IO 1500 CLK_A>;
398
399 rxd0 = <&PIO16 0 ALT2 IN SE_NICLK_IO 1500 CLK_A>;
400 rxd1 = <&PIO16 1 ALT2 IN SE_NICLK_IO 1500 CLK_A>;
401 rxd2 = <&PIO16 2 ALT2 IN SE_NICLK_IO 1500 CLK_A>;
402 rxd3 = <&PIO16 3 ALT2 IN SE_NICLK_IO 1500 CLK_A>;
403 rxd4 = <&PIO16 4 ALT2 IN SE_NICLK_IO 1500 CLK_A>;
404 rxd5 = <&PIO16 5 ALT2 IN SE_NICLK_IO 1500 CLK_A>;
405 rxd6 = <&PIO16 6 ALT2 IN SE_NICLK_IO 1500 CLK_A>;
406 rxd7 = <&PIO16 7 ALT2 IN SE_NICLK_IO 1500 CLK_A>;
407
408 rxclk = <&PIO17 0 ALT2 IN NICLK 0 CLK_A>;
409 clk125 = <&PIO17 6 ALT1 IN NICLK 0 CLK_A>;
410 phyclk = <&PIO13 5 ALT4 OUT NICLK 0 CLK_B>;
411
412
413 };
414 };
415 };
236 }; 416 };
237 417
238 pin-controller-left { 418 pin-controller-left {
@@ -240,23 +420,33 @@
240 #size-cells = <1>; 420 #size-cells = <1>;
241 compatible = "st,stih415-left-pinctrl"; 421 compatible = "st,stih415-left-pinctrl";
242 st,syscfg = <&syscfg_left>; 422 st,syscfg = <&syscfg_left>;
423 reg = <0xfd6bf080 0x4>;
424 reg-names = "irqmux";
425 interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
426 interrupts-names = "irqmux";
243 ranges = <0 0xfd6b0000 0x3000>; 427 ranges = <0 0xfd6b0000 0x3000>;
244 428
245 PIO100: gpio@fd6b0000 { 429 PIO100: gpio@fd6b0000 {
246 gpio-controller; 430 gpio-controller;
247 #gpio-cells = <1>; 431 #gpio-cells = <1>;
432 interrupt-controller;
433 #interrupt-cells = <2>;
248 reg = <0 0x100>; 434 reg = <0 0x100>;
249 st,bank-name = "PIO100"; 435 st,bank-name = "PIO100";
250 }; 436 };
251 PIO101: gpio@fd6b1000 { 437 PIO101: gpio@fd6b1000 {
252 gpio-controller; 438 gpio-controller;
253 #gpio-cells = <1>; 439 #gpio-cells = <1>;
440 interrupt-controller;
441 #interrupt-cells = <2>;
254 reg = <0x1000 0x100>; 442 reg = <0x1000 0x100>;
255 st,bank-name = "PIO101"; 443 st,bank-name = "PIO101";
256 }; 444 };
257 PIO102: gpio@fd6b2000 { 445 PIO102: gpio@fd6b2000 {
258 gpio-controller; 446 gpio-controller;
259 #gpio-cells = <1>; 447 #gpio-cells = <1>;
448 interrupt-controller;
449 #interrupt-cells = <2>;
260 reg = <0x2000 0x100>; 450 reg = <0x2000 0x100>;
261 st,bank-name = "PIO102"; 451 st,bank-name = "PIO102";
262 }; 452 };
@@ -267,35 +457,49 @@
267 #size-cells = <1>; 457 #size-cells = <1>;
268 compatible = "st,stih415-right-pinctrl"; 458 compatible = "st,stih415-right-pinctrl";
269 st,syscfg = <&syscfg_right>; 459 st,syscfg = <&syscfg_right>;
460 reg = <0xfd33f080 0x4>;
461 reg-names = "irqmux";
462 interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
463 interrupts-names = "irqmux";
270 ranges = <0 0xfd330000 0x5000>; 464 ranges = <0 0xfd330000 0x5000>;
271 465
272 PIO103: gpio@fd330000 { 466 PIO103: gpio@fd330000 {
273 gpio-controller; 467 gpio-controller;
274 #gpio-cells = <1>; 468 #gpio-cells = <1>;
469 interrupt-controller;
470 #interrupt-cells = <2>;
275 reg = <0 0x100>; 471 reg = <0 0x100>;
276 st,bank-name = "PIO103"; 472 st,bank-name = "PIO103";
277 }; 473 };
278 PIO104: gpio@fd331000 { 474 PIO104: gpio@fd331000 {
279 gpio-controller; 475 gpio-controller;
280 #gpio-cells = <1>; 476 #gpio-cells = <1>;
477 interrupt-controller;
478 #interrupt-cells = <2>;
281 reg = <0x1000 0x100>; 479 reg = <0x1000 0x100>;
282 st,bank-name = "PIO104"; 480 st,bank-name = "PIO104";
283 }; 481 };
284 PIO105: gpio@fd332000 { 482 PIO105: gpio@fd332000 {
285 gpio-controller; 483 gpio-controller;
286 #gpio-cells = <1>; 484 #gpio-cells = <1>;
485 interrupt-controller;
486 #interrupt-cells = <2>;
287 reg = <0x2000 0x100>; 487 reg = <0x2000 0x100>;
288 st,bank-name = "PIO105"; 488 st,bank-name = "PIO105";
289 }; 489 };
290 PIO106: gpio@fd333000 { 490 PIO106: gpio@fd333000 {
291 gpio-controller; 491 gpio-controller;
292 #gpio-cells = <1>; 492 #gpio-cells = <1>;
493 interrupt-controller;
494 #interrupt-cells = <2>;
293 reg = <0x3000 0x100>; 495 reg = <0x3000 0x100>;
294 st,bank-name = "PIO106"; 496 st,bank-name = "PIO106";
295 }; 497 };
296 PIO107: gpio@fd334000 { 498 PIO107: gpio@fd334000 {
297 gpio-controller; 499 gpio-controller;
298 #gpio-cells = <1>; 500 #gpio-cells = <1>;
501 interrupt-controller;
502 #interrupt-cells = <2>;
299 reg = <0x4000 0x100>; 503 reg = <0x4000 0x100>;
300 st,bank-name = "PIO107"; 504 st,bank-name = "PIO107";
301 }; 505 };
diff --git a/arch/arm/boot/dts/stih415.dtsi b/arch/arm/boot/dts/stih415.dtsi
index d9c7dd1d95a4..d89064c20c8a 100644
--- a/arch/arm/boot/dts/stih415.dtsi
+++ b/arch/arm/boot/dts/stih415.dtsi
@@ -10,6 +10,7 @@
10#include "stih415-clock.dtsi" 10#include "stih415-clock.dtsi"
11#include "stih415-pinctrl.dtsi" 11#include "stih415-pinctrl.dtsi"
12#include <dt-bindings/interrupt-controller/arm-gic.h> 12#include <dt-bindings/interrupt-controller/arm-gic.h>
13#include <dt-bindings/reset-controller/stih415-resets.h>
13/ { 14/ {
14 15
15 L2: cache-controller { 16 L2: cache-controller {
@@ -28,6 +29,16 @@
28 ranges; 29 ranges;
29 compatible = "simple-bus"; 30 compatible = "simple-bus";
30 31
32 powerdown: powerdown-controller {
33 #reset-cells = <1>;
34 compatible = "st,stih415-powerdown";
35 };
36
37 softreset: softreset-controller {
38 #reset-cells = <1>;
39 compatible = "st,stih415-softreset";
40 };
41
31 syscfg_sbc: sbc-syscfg@fe600000{ 42 syscfg_sbc: sbc-syscfg@fe600000{
32 compatible = "st,stih415-sbc-syscfg", "syscon"; 43 compatible = "st,stih415-sbc-syscfg", "syscon";
33 reg = <0xfe600000 0xb4>; 44 reg = <0xfe600000 0xb4>;
@@ -136,5 +147,64 @@
136 147
137 status = "disabled"; 148 status = "disabled";
138 }; 149 };
150
151 ethernet0: dwmac@fe810000 {
152 device_type = "network";
153 compatible = "st,stih415-dwmac", "snps,dwmac", "snps,dwmac-3.610";
154 status = "disabled";
155
156 reg = <0xfe810000 0x8000>, <0x148 0x4>;
157 reg-names = "stmmaceth", "sti-ethconf";
158
159 interrupts = <0 147 0>, <0 148 0>, <0 149 0>;
160 interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
161 resets = <&softreset STIH415_ETH0_SOFTRESET>;
162 reset-names = "stmmaceth";
163
164 snps,pbl = <32>;
165 snps,mixed-burst;
166 snps,force_sf_dma_mode;
167
168 st,syscon = <&syscfg_rear>;
169
170 pinctrl-names = "default";
171 pinctrl-0 = <&pinctrl_mii0>;
172 clock-names = "stmmaceth";
173 clocks = <&CLKS_GMAC0_PHY>;
174 };
175
176 ethernet1: dwmac@fef08000 {
177 device_type = "network";
178 compatible = "st,stih415-dwmac", "snps,dwmac", "snps,dwmac-3.610";
179 status = "disabled";
180 reg = <0xfef08000 0x8000>, <0x74 0x4>;
181 reg-names = "stmmaceth", "sti-ethconf";
182 interrupts = <0 150 0>, <0 151 0>, <0 152 0>;
183 interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
184
185 snps,pbl = <32>;
186 snps,mixed-burst;
187 snps,force_sf_dma_mode;
188
189 st,syscon = <&syscfg_sbc>;
190
191 resets = <&softreset STIH415_ETH1_SOFTRESET>;
192 reset-names = "stmmaceth";
193 pinctrl-names = "default";
194 pinctrl-0 = <&pinctrl_mii1>;
195 clock-names = "stmmaceth";
196 clocks = <&CLKS_ETH1_PHY>;
197 };
198
199 rc: rc@fe518000 {
200 compatible = "st,comms-irb";
201 reg = <0xfe518000 0x234>;
202 interrupts = <0 203 0>;
203 clocks = <&CLK_SYSIN>;
204 rx-mode = "infrared";
205 pinctrl-names = "default";
206 pinctrl-0 = <&pinctrl_ir>;
207 resets = <&softreset STIH415_IRB_SOFTRESET>;
208 };
139 }; 209 };
140}; 210};
diff --git a/arch/arm/boot/dts/stih416-clock.dtsi b/arch/arm/boot/dts/stih416-clock.dtsi
index 7026bf1158d8..a6942c75cbbb 100644
--- a/arch/arm/boot/dts/stih416-clock.dtsi
+++ b/arch/arm/boot/dts/stih416-clock.dtsi
@@ -37,5 +37,19 @@
37 clock-frequency = <100000000>; 37 clock-frequency = <100000000>;
38 clock-output-names = "CLK_S_ICN_REG_0"; 38 clock-output-names = "CLK_S_ICN_REG_0";
39 }; 39 };
40
41 CLK_S_GMAC0_PHY: clockgenA1@7 {
42 #clock-cells = <0>;
43 compatible = "fixed-clock";
44 clock-frequency = <25000000>;
45 clock-output-names = "CLK_S_GMAC0_PHY";
46 };
47
48 CLK_S_ETH1_PHY: clockgenA0@7 {
49 #clock-cells = <0>;
50 compatible = "fixed-clock";
51 clock-frequency = <25000000>;
52 clock-output-names = "CLK_S_ETH1_PHY";
53 };
40 }; 54 };
41}; 55};
diff --git a/arch/arm/boot/dts/stih416-pinctrl.dtsi b/arch/arm/boot/dts/stih416-pinctrl.dtsi
index b29ff4ba542c..aeea304086eb 100644
--- a/arch/arm/boot/dts/stih416-pinctrl.dtsi
+++ b/arch/arm/boot/dts/stih416-pinctrl.dtsi
@@ -8,6 +8,7 @@
8 * publishhed by the Free Software Foundation. 8 * publishhed by the Free Software Foundation.
9 */ 9 */
10#include "st-pincfg.h" 10#include "st-pincfg.h"
11#include <dt-bindings/interrupt-controller/arm-gic.h>
11/ { 12/ {
12 13
13 aliases { 14 aliases {
@@ -49,46 +50,69 @@
49 #size-cells = <1>; 50 #size-cells = <1>;
50 compatible = "st,stih416-sbc-pinctrl"; 51 compatible = "st,stih416-sbc-pinctrl";
51 st,syscfg = <&syscfg_sbc>; 52 st,syscfg = <&syscfg_sbc>;
53 reg = <0xfe61f080 0x4>;
54 reg-names = "irqmux";
55 interrupts = <GIC_SPI 182 IRQ_TYPE_LEVEL_HIGH>;
56 interrupts-names = "irqmux";
52 ranges = <0 0xfe610000 0x6000>; 57 ranges = <0 0xfe610000 0x6000>;
53 58
54 PIO0: gpio@fe610000 { 59 PIO0: gpio@fe610000 {
55 gpio-controller; 60 gpio-controller;
56 #gpio-cells = <1>; 61 #gpio-cells = <1>;
62 interrupt-controller;
63 #interrupt-cells = <2>;
57 reg = <0 0x100>; 64 reg = <0 0x100>;
58 st,bank-name = "PIO0"; 65 st,bank-name = "PIO0";
59 }; 66 };
60 PIO1: gpio@fe611000 { 67 PIO1: gpio@fe611000 {
61 gpio-controller; 68 gpio-controller;
62 #gpio-cells = <1>; 69 #gpio-cells = <1>;
70 interrupt-controller;
71 #interrupt-cells = <2>;
63 reg = <0x1000 0x100>; 72 reg = <0x1000 0x100>;
64 st,bank-name = "PIO1"; 73 st,bank-name = "PIO1";
65 }; 74 };
66 PIO2: gpio@fe612000 { 75 PIO2: gpio@fe612000 {
67 gpio-controller; 76 gpio-controller;
68 #gpio-cells = <1>; 77 #gpio-cells = <1>;
78 interrupt-controller;
79 #interrupt-cells = <2>;
69 reg = <0x2000 0x100>; 80 reg = <0x2000 0x100>;
70 st,bank-name = "PIO2"; 81 st,bank-name = "PIO2";
71 }; 82 };
72 PIO3: gpio@fe613000 { 83 PIO3: gpio@fe613000 {
73 gpio-controller; 84 gpio-controller;
74 #gpio-cells = <1>; 85 #gpio-cells = <1>;
86 interrupt-controller;
87 #interrupt-cells = <2>;
75 reg = <0x3000 0x100>; 88 reg = <0x3000 0x100>;
76 st,bank-name = "PIO3"; 89 st,bank-name = "PIO3";
77 }; 90 };
78 PIO4: gpio@fe614000 { 91 PIO4: gpio@fe614000 {
79 gpio-controller; 92 gpio-controller;
80 #gpio-cells = <1>; 93 #gpio-cells = <1>;
94 interrupt-controller;
95 #interrupt-cells = <2>;
81 reg = <0x4000 0x100>; 96 reg = <0x4000 0x100>;
82 st,bank-name = "PIO4"; 97 st,bank-name = "PIO4";
83 }; 98 };
84 PIO40: gpio@fe615000 { 99 PIO40: gpio@fe615000 {
85 gpio-controller; 100 gpio-controller;
86 #gpio-cells = <1>; 101 #gpio-cells = <1>;
102 interrupt-controller;
103 #interrupt-cells = <2>;
87 reg = <0x5000 0x100>; 104 reg = <0x5000 0x100>;
88 st,bank-name = "PIO40"; 105 st,bank-name = "PIO40";
89 st,retime-pin-mask = <0x7f>; 106 st,retime-pin-mask = <0x7f>;
90 }; 107 };
91 108
109 rc{
110 pinctrl_ir: ir0 {
111 st,pins {
112 ir = <&PIO4 0 ALT2 IN>;
113 };
114 };
115 };
92 sbc_serial1 { 116 sbc_serial1 {
93 pinctrl_sbc_serial1: sbc_serial1 { 117 pinctrl_sbc_serial1: sbc_serial1 {
94 st,pins { 118 st,pins {
@@ -115,6 +139,58 @@
115 }; 139 };
116 }; 140 };
117 }; 141 };
142
143 gmac1 {
144 pinctrl_mii1: mii1 {
145 st,pins {
146 txd0 = <&PIO0 0 ALT1 OUT SE_NICLK_IO 0 CLK_A>;
147 txd1 = <&PIO0 1 ALT1 OUT SE_NICLK_IO 0 CLK_A>;
148 txd2 = <&PIO0 2 ALT1 OUT SE_NICLK_IO 0 CLK_A>;
149 txd3 = <&PIO0 3 ALT1 OUT SE_NICLK_IO 0 CLK_A>;
150 txer = <&PIO0 4 ALT1 OUT SE_NICLK_IO 0 CLK_A>;
151 txen = <&PIO0 5 ALT1 OUT SE_NICLK_IO 0 CLK_A>;
152 txclk = <&PIO0 6 ALT1 IN NICLK 0 CLK_A>;
153 col = <&PIO0 7 ALT1 IN BYPASS 1000>;
154
155 mdio = <&PIO1 0 ALT1 OUT BYPASS 1500>;
156 mdc = <&PIO1 1 ALT1 OUT NICLK 0 CLK_A>;
157 crs = <&PIO1 2 ALT1 IN BYPASS 1000>;
158 mdint = <&PIO1 3 ALT1 IN BYPASS 0>;
159 rxd0 = <&PIO1 4 ALT1 IN SE_NICLK_IO 0 CLK_A>;
160 rxd1 = <&PIO1 5 ALT1 IN SE_NICLK_IO 0 CLK_A>;
161 rxd2 = <&PIO1 6 ALT1 IN SE_NICLK_IO 0 CLK_A>;
162 rxd3 = <&PIO1 7 ALT1 IN SE_NICLK_IO 0 CLK_A>;
163
164 rxdv = <&PIO2 0 ALT1 IN SE_NICLK_IO 0 CLK_A>;
165 rx_er = <&PIO2 1 ALT1 IN SE_NICLK_IO 0 CLK_A>;
166 rxclk = <&PIO2 2 ALT1 IN NICLK 0 CLK_A>;
167 phyclk = <&PIO2 3 ALT1 OUT NICLK 0 CLK_A>;
168 };
169 };
170 pinctrl_rgmii1: rgmii1-0 {
171 st,pins {
172 txd0 = <&PIO0 0 ALT1 OUT DE_IO 500 CLK_A>;
173 txd1 = <&PIO0 1 ALT1 OUT DE_IO 500 CLK_A>;
174 txd2 = <&PIO0 2 ALT1 OUT DE_IO 500 CLK_A>;
175 txd3 = <&PIO0 3 ALT1 OUT DE_IO 500 CLK_A>;
176 txen = <&PIO0 5 ALT1 OUT DE_IO 0 CLK_A>;
177 txclk = <&PIO0 6 ALT1 IN NICLK 0 CLK_A>;
178
179 mdio = <&PIO1 0 ALT1 OUT BYPASS 0>;
180 mdc = <&PIO1 1 ALT1 OUT NICLK 0 CLK_A>;
181 rxd0 = <&PIO1 4 ALT1 IN DE_IO 500 CLK_A>;
182 rxd1 = <&PIO1 5 ALT1 IN DE_IO 500 CLK_A>;
183 rxd2 = <&PIO1 6 ALT1 IN DE_IO 500 CLK_A>;
184 rxd3 = <&PIO1 7 ALT1 IN DE_IO 500 CLK_A>;
185
186 rxdv = <&PIO2 0 ALT1 IN DE_IO 500 CLK_A>;
187 rxclk = <&PIO2 2 ALT1 IN NICLK 0 CLK_A>;
188 phyclk = <&PIO2 3 ALT4 OUT NICLK 0 CLK_B>;
189
190 clk125= <&PIO3 7 ALT4 IN NICLK 0 CLK_A>;
191 };
192 };
193 };
118 }; 194 };
119 195
120 pin-controller-front { 196 pin-controller-front {
@@ -122,65 +198,89 @@
122 #size-cells = <1>; 198 #size-cells = <1>;
123 compatible = "st,stih416-front-pinctrl"; 199 compatible = "st,stih416-front-pinctrl";
124 st,syscfg = <&syscfg_front>; 200 st,syscfg = <&syscfg_front>;
201 reg = <0xfee0f080 0x4>;
202 reg-names = "irqmux";
203 interrupts = <GIC_SPI 183 IRQ_TYPE_LEVEL_HIGH>;
204 interrupts-names = "irqmux";
125 ranges = <0 0xfee00000 0x10000>; 205 ranges = <0 0xfee00000 0x10000>;
126 206
127 PIO5: gpio@fee00000 { 207 PIO5: gpio@fee00000 {
128 gpio-controller; 208 gpio-controller;
129 #gpio-cells = <1>; 209 #gpio-cells = <1>;
210 interrupt-controller;
211 #interrupt-cells = <2>;
130 reg = <0 0x100>; 212 reg = <0 0x100>;
131 st,bank-name = "PIO5"; 213 st,bank-name = "PIO5";
132 }; 214 };
133 PIO6: gpio@fee01000 { 215 PIO6: gpio@fee01000 {
134 gpio-controller; 216 gpio-controller;
135 #gpio-cells = <1>; 217 #gpio-cells = <1>;
218 interrupt-controller;
219 #interrupt-cells = <2>;
136 reg = <0x1000 0x100>; 220 reg = <0x1000 0x100>;
137 st,bank-name = "PIO6"; 221 st,bank-name = "PIO6";
138 }; 222 };
139 PIO7: gpio@fee02000 { 223 PIO7: gpio@fee02000 {
140 gpio-controller; 224 gpio-controller;
141 #gpio-cells = <1>; 225 #gpio-cells = <1>;
226 interrupt-controller;
227 #interrupt-cells = <2>;
142 reg = <0x2000 0x100>; 228 reg = <0x2000 0x100>;
143 st,bank-name = "PIO7"; 229 st,bank-name = "PIO7";
144 }; 230 };
145 PIO8: gpio@fee03000 { 231 PIO8: gpio@fee03000 {
146 gpio-controller; 232 gpio-controller;
147 #gpio-cells = <1>; 233 #gpio-cells = <1>;
234 interrupt-controller;
235 #interrupt-cells = <2>;
148 reg = <0x3000 0x100>; 236 reg = <0x3000 0x100>;
149 st,bank-name = "PIO8"; 237 st,bank-name = "PIO8";
150 }; 238 };
151 PIO9: gpio@fee04000 { 239 PIO9: gpio@fee04000 {
152 gpio-controller; 240 gpio-controller;
153 #gpio-cells = <1>; 241 #gpio-cells = <1>;
242 interrupt-controller;
243 #interrupt-cells = <2>;
154 reg = <0x4000 0x100>; 244 reg = <0x4000 0x100>;
155 st,bank-name = "PIO9"; 245 st,bank-name = "PIO9";
156 }; 246 };
157 PIO10: gpio@fee05000 { 247 PIO10: gpio@fee05000 {
158 gpio-controller; 248 gpio-controller;
159 #gpio-cells = <1>; 249 #gpio-cells = <1>;
250 interrupt-controller;
251 #interrupt-cells = <2>;
160 reg = <0x5000 0x100>; 252 reg = <0x5000 0x100>;
161 st,bank-name = "PIO10"; 253 st,bank-name = "PIO10";
162 }; 254 };
163 PIO11: gpio@fee06000 { 255 PIO11: gpio@fee06000 {
164 gpio-controller; 256 gpio-controller;
165 #gpio-cells = <1>; 257 #gpio-cells = <1>;
258 interrupt-controller;
259 #interrupt-cells = <2>;
166 reg = <0x6000 0x100>; 260 reg = <0x6000 0x100>;
167 st,bank-name = "PIO11"; 261 st,bank-name = "PIO11";
168 }; 262 };
169 PIO12: gpio@fee07000 { 263 PIO12: gpio@fee07000 {
170 gpio-controller; 264 gpio-controller;
171 #gpio-cells = <1>; 265 #gpio-cells = <1>;
266 interrupt-controller;
267 #interrupt-cells = <2>;
172 reg = <0x7000 0x100>; 268 reg = <0x7000 0x100>;
173 st,bank-name = "PIO12"; 269 st,bank-name = "PIO12";
174 }; 270 };
175 PIO30: gpio@fee08000 { 271 PIO30: gpio@fee08000 {
176 gpio-controller; 272 gpio-controller;
177 #gpio-cells = <1>; 273 #gpio-cells = <1>;
274 interrupt-controller;
275 #interrupt-cells = <2>;
178 reg = <0x8000 0x100>; 276 reg = <0x8000 0x100>;
179 st,bank-name = "PIO30"; 277 st,bank-name = "PIO30";
180 }; 278 };
181 PIO31: gpio@fee09000 { 279 PIO31: gpio@fee09000 {
182 gpio-controller; 280 gpio-controller;
183 #gpio-cells = <1>; 281 #gpio-cells = <1>;
282 interrupt-controller;
283 #interrupt-cells = <2>;
184 reg = <0x9000 0x100>; 284 reg = <0x9000 0x100>;
185 st,bank-name = "PIO31"; 285 st,bank-name = "PIO31";
186 }; 286 };
@@ -210,6 +310,19 @@
210 }; 310 };
211 }; 311 };
212 }; 312 };
313
314 fsm {
315 pinctrl_fsm: fsm {
316 st,pins {
317 spi-fsm-clk = <&PIO12 2 ALT1 OUT>;
318 spi-fsm-cs = <&PIO12 3 ALT1 OUT>;
319 spi-fsm-mosi = <&PIO12 4 ALT1 OUT>;
320 spi-fsm-miso = <&PIO12 5 ALT1 IN>;
321 spi-fsm-hol = <&PIO12 6 ALT1 OUT>;
322 spi-fsm-wp = <&PIO12 7 ALT1 OUT>;
323 };
324 };
325 };
213 }; 326 };
214 327
215 pin-controller-rear { 328 pin-controller-rear {
@@ -217,41 +330,57 @@
217 #size-cells = <1>; 330 #size-cells = <1>;
218 compatible = "st,stih416-rear-pinctrl"; 331 compatible = "st,stih416-rear-pinctrl";
219 st,syscfg = <&syscfg_rear>; 332 st,syscfg = <&syscfg_rear>;
333 reg = <0xfe82f080 0x4>;
334 reg-names = "irqmux";
335 interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
336 interrupts-names = "irqmux";
220 ranges = <0 0xfe820000 0x6000>; 337 ranges = <0 0xfe820000 0x6000>;
221 338
222 PIO13: gpio@fe820000 { 339 PIO13: gpio@fe820000 {
223 gpio-controller; 340 gpio-controller;
224 #gpio-cells = <1>; 341 #gpio-cells = <1>;
342 interrupt-controller;
343 #interrupt-cells = <2>;
225 reg = <0 0x100>; 344 reg = <0 0x100>;
226 st,bank-name = "PIO13"; 345 st,bank-name = "PIO13";
227 }; 346 };
228 PIO14: gpio@fe821000 { 347 PIO14: gpio@fe821000 {
229 gpio-controller; 348 gpio-controller;
230 #gpio-cells = <1>; 349 #gpio-cells = <1>;
350 interrupt-controller;
351 #interrupt-cells = <2>;
231 reg = <0x1000 0x100>; 352 reg = <0x1000 0x100>;
232 st,bank-name = "PIO14"; 353 st,bank-name = "PIO14";
233 }; 354 };
234 PIO15: gpio@fe822000 { 355 PIO15: gpio@fe822000 {
235 gpio-controller; 356 gpio-controller;
236 #gpio-cells = <1>; 357 #gpio-cells = <1>;
358 interrupt-controller;
359 #interrupt-cells = <2>;
237 reg = <0x2000 0x100>; 360 reg = <0x2000 0x100>;
238 st,bank-name = "PIO15"; 361 st,bank-name = "PIO15";
239 }; 362 };
240 PIO16: gpio@fe823000 { 363 PIO16: gpio@fe823000 {
241 gpio-controller; 364 gpio-controller;
242 #gpio-cells = <1>; 365 #gpio-cells = <1>;
366 interrupt-controller;
367 #interrupt-cells = <2>;
243 reg = <0x3000 0x100>; 368 reg = <0x3000 0x100>;
244 st,bank-name = "PIO16"; 369 st,bank-name = "PIO16";
245 }; 370 };
246 PIO17: gpio@fe824000 { 371 PIO17: gpio@fe824000 {
247 gpio-controller; 372 gpio-controller;
248 #gpio-cells = <1>; 373 #gpio-cells = <1>;
374 interrupt-controller;
375 #interrupt-cells = <2>;
249 reg = <0x4000 0x100>; 376 reg = <0x4000 0x100>;
250 st,bank-name = "PIO17"; 377 st,bank-name = "PIO17";
251 }; 378 };
252 PIO18: gpio@fe825000 { 379 PIO18: gpio@fe825000 {
253 gpio-controller; 380 gpio-controller;
254 #gpio-cells = <1>; 381 #gpio-cells = <1>;
382 interrupt-controller;
383 #interrupt-cells = <2>;
255 reg = <0x5000 0x100>; 384 reg = <0x5000 0x100>;
256 st,bank-name = "PIO18"; 385 st,bank-name = "PIO18";
257 st,retime-pin-mask = <0xf>; 386 st,retime-pin-mask = <0xf>;
@@ -265,6 +394,63 @@
265 }; 394 };
266 }; 395 };
267 }; 396 };
397
398 gmac0 {
399 pinctrl_mii0: mii0 {
400 st,pins {
401 mdint = <&PIO13 6 ALT2 IN BYPASS 0>;
402 txen = <&PIO13 7 ALT2 OUT SE_NICLK_IO 0 CLK_A>;
403 txd0 = <&PIO14 0 ALT2 OUT SE_NICLK_IO 0 CLK_A>;
404 txd1 = <&PIO14 1 ALT2 OUT SE_NICLK_IO 0 CLK_A>;
405 txd2 = <&PIO14 2 ALT2 OUT SE_NICLK_IO 0 CLK_B>;
406 txd3 = <&PIO14 3 ALT2 OUT SE_NICLK_IO 0 CLK_B>;
407
408 txclk = <&PIO15 0 ALT2 IN NICLK 0 CLK_A>;
409 txer = <&PIO15 1 ALT2 OUT SE_NICLK_IO 0 CLK_A>;
410 crs = <&PIO15 2 ALT2 IN BYPASS 1000>;
411 col = <&PIO15 3 ALT2 IN BYPASS 1000>;
412 mdio= <&PIO15 4 ALT2 OUT BYPASS 1500>;
413 mdc = <&PIO15 5 ALT2 OUT NICLK 0 CLK_B>;
414
415 rxd0 = <&PIO16 0 ALT2 IN SE_NICLK_IO 0 CLK_A>;
416 rxd1 = <&PIO16 1 ALT2 IN SE_NICLK_IO 0 CLK_A>;
417 rxd2 = <&PIO16 2 ALT2 IN SE_NICLK_IO 0 CLK_A>;
418 rxd3 = <&PIO16 3 ALT2 IN SE_NICLK_IO 0 CLK_A>;
419 rxdv = <&PIO15 6 ALT2 IN SE_NICLK_IO 0 CLK_A>;
420 rx_er = <&PIO15 7 ALT2 IN SE_NICLK_IO 0 CLK_A>;
421 rxclk = <&PIO17 0 ALT2 IN NICLK 0 CLK_A>;
422 phyclk = <&PIO13 5 ALT2 OUT NICLK 0 CLK_B>;
423 };
424 };
425
426 pinctrl_gmii0: gmii0 {
427 st,pins {
428 };
429 };
430 pinctrl_rgmii0: rgmii0 {
431 st,pins {
432 phyclk = <&PIO13 5 ALT4 OUT NICLK 0 CLK_B>;
433 txen = <&PIO13 7 ALT2 OUT DE_IO 0 CLK_A>;
434 txd0 = <&PIO14 0 ALT2 OUT DE_IO 500 CLK_A>;
435 txd1 = <&PIO14 1 ALT2 OUT DE_IO 500 CLK_A>;
436 txd2 = <&PIO14 2 ALT2 OUT DE_IO 500 CLK_B>;
437 txd3 = <&PIO14 3 ALT2 OUT DE_IO 500 CLK_B>;
438 txclk = <&PIO15 0 ALT2 IN NICLK 0 CLK_A>;
439
440 mdio = <&PIO15 4 ALT2 OUT BYPASS 0>;
441 mdc = <&PIO15 5 ALT2 OUT NICLK 0 CLK_B>;
442
443 rxdv = <&PIO15 6 ALT2 IN DE_IO 500 CLK_A>;
444 rxd0 =<&PIO16 0 ALT2 IN DE_IO 500 CLK_A>;
445 rxd1 =<&PIO16 1 ALT2 IN DE_IO 500 CLK_A>;
446 rxd2 =<&PIO16 2 ALT2 IN DE_IO 500 CLK_A>;
447 rxd3 =<&PIO16 3 ALT2 IN DE_IO 500 CLK_A>;
448 rxclk =<&PIO17 0 ALT2 IN NICLK 0 CLK_A>;
449
450 clk125=<&PIO17 6 ALT1 IN NICLK 0 CLK_A>;
451 };
452 };
453 };
268 }; 454 };
269 455
270 pin-controller-fvdp-fe { 456 pin-controller-fvdp-fe {
@@ -272,23 +458,33 @@
272 #size-cells = <1>; 458 #size-cells = <1>;
273 compatible = "st,stih416-fvdp-fe-pinctrl"; 459 compatible = "st,stih416-fvdp-fe-pinctrl";
274 st,syscfg = <&syscfg_fvdp_fe>; 460 st,syscfg = <&syscfg_fvdp_fe>;
461 reg = <0xfd6bf080 0x4>;
462 reg-names = "irqmux";
463 interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
464 interrupts-names = "irqmux";
275 ranges = <0 0xfd6b0000 0x3000>; 465 ranges = <0 0xfd6b0000 0x3000>;
276 466
277 PIO100: gpio@fd6b0000 { 467 PIO100: gpio@fd6b0000 {
278 gpio-controller; 468 gpio-controller;
279 #gpio-cells = <1>; 469 #gpio-cells = <1>;
470 interrupt-controller;
471 #interrupt-cells = <2>;
280 reg = <0 0x100>; 472 reg = <0 0x100>;
281 st,bank-name = "PIO100"; 473 st,bank-name = "PIO100";
282 }; 474 };
283 PIO101: gpio@fd6b1000 { 475 PIO101: gpio@fd6b1000 {
284 gpio-controller; 476 gpio-controller;
285 #gpio-cells = <1>; 477 #gpio-cells = <1>;
478 interrupt-controller;
479 #interrupt-cells = <2>;
286 reg = <0x1000 0x100>; 480 reg = <0x1000 0x100>;
287 st,bank-name = "PIO101"; 481 st,bank-name = "PIO101";
288 }; 482 };
289 PIO102: gpio@fd6b2000 { 483 PIO102: gpio@fd6b2000 {
290 gpio-controller; 484 gpio-controller;
291 #gpio-cells = <1>; 485 #gpio-cells = <1>;
486 interrupt-controller;
487 #interrupt-cells = <2>;
292 reg = <0x2000 0x100>; 488 reg = <0x2000 0x100>;
293 st,bank-name = "PIO102"; 489 st,bank-name = "PIO102";
294 }; 490 };
@@ -299,29 +495,41 @@
299 #size-cells = <1>; 495 #size-cells = <1>;
300 compatible = "st,stih416-fvdp-lite-pinctrl"; 496 compatible = "st,stih416-fvdp-lite-pinctrl";
301 st,syscfg = <&syscfg_fvdp_lite>; 497 st,syscfg = <&syscfg_fvdp_lite>;
498 reg = <0xfd33f080 0x4>;
499 reg-names = "irqmux";
500 interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
501 interrupts-names = "irqmux";
302 ranges = <0 0xfd330000 0x5000>; 502 ranges = <0 0xfd330000 0x5000>;
303 503
304 PIO103: gpio@fd330000 { 504 PIO103: gpio@fd330000 {
305 gpio-controller; 505 gpio-controller;
306 #gpio-cells = <1>; 506 #gpio-cells = <1>;
507 interrupt-controller;
508 #interrupt-cells = <2>;
307 reg = <0 0x100>; 509 reg = <0 0x100>;
308 st,bank-name = "PIO103"; 510 st,bank-name = "PIO103";
309 }; 511 };
310 PIO104: gpio@fd331000 { 512 PIO104: gpio@fd331000 {
311 gpio-controller; 513 gpio-controller;
312 #gpio-cells = <1>; 514 #gpio-cells = <1>;
515 interrupt-controller;
516 #interrupt-cells = <2>;
313 reg = <0x1000 0x100>; 517 reg = <0x1000 0x100>;
314 st,bank-name = "PIO104"; 518 st,bank-name = "PIO104";
315 }; 519 };
316 PIO105: gpio@fd332000 { 520 PIO105: gpio@fd332000 {
317 gpio-controller; 521 gpio-controller;
318 #gpio-cells = <1>; 522 #gpio-cells = <1>;
523 interrupt-controller;
524 #interrupt-cells = <2>;
319 reg = <0x2000 0x100>; 525 reg = <0x2000 0x100>;
320 st,bank-name = "PIO105"; 526 st,bank-name = "PIO105";
321 }; 527 };
322 PIO106: gpio@fd333000 { 528 PIO106: gpio@fd333000 {
323 gpio-controller; 529 gpio-controller;
324 #gpio-cells = <1>; 530 #gpio-cells = <1>;
531 interrupt-controller;
532 #interrupt-cells = <2>;
325 reg = <0x3000 0x100>; 533 reg = <0x3000 0x100>;
326 st,bank-name = "PIO106"; 534 st,bank-name = "PIO106";
327 }; 535 };
@@ -329,6 +537,8 @@
329 PIO107: gpio@fd334000 { 537 PIO107: gpio@fd334000 {
330 gpio-controller; 538 gpio-controller;
331 #gpio-cells = <1>; 539 #gpio-cells = <1>;
540 interrupt-controller;
541 #interrupt-cells = <2>;
332 reg = <0x4000 0x100>; 542 reg = <0x4000 0x100>;
333 st,bank-name = "PIO107"; 543 st,bank-name = "PIO107";
334 st,retime-pin-mask = <0xf>; 544 st,retime-pin-mask = <0xf>;
diff --git a/arch/arm/boot/dts/stih416.dtsi b/arch/arm/boot/dts/stih416.dtsi
index b7ab47b95816..78746d20382e 100644
--- a/arch/arm/boot/dts/stih416.dtsi
+++ b/arch/arm/boot/dts/stih416.dtsi
@@ -10,6 +10,7 @@
10#include "stih416-clock.dtsi" 10#include "stih416-clock.dtsi"
11#include "stih416-pinctrl.dtsi" 11#include "stih416-pinctrl.dtsi"
12#include <dt-bindings/interrupt-controller/arm-gic.h> 12#include <dt-bindings/interrupt-controller/arm-gic.h>
13#include <dt-bindings/reset-controller/stih416-resets.h>
13/ { 14/ {
14 L2: cache-controller { 15 L2: cache-controller {
15 compatible = "arm,pl310-cache"; 16 compatible = "arm,pl310-cache";
@@ -27,6 +28,16 @@
27 ranges; 28 ranges;
28 compatible = "simple-bus"; 29 compatible = "simple-bus";
29 30
31 powerdown: powerdown-controller {
32 #reset-cells = <1>;
33 compatible = "st,stih416-powerdown";
34 };
35
36 softreset: softreset-controller {
37 #reset-cells = <1>;
38 compatible = "st,stih416-softreset";
39 };
40
30 syscfg_sbc:sbc-syscfg@fe600000{ 41 syscfg_sbc:sbc-syscfg@fe600000{
31 compatible = "st,stih416-sbc-syscfg", "syscon"; 42 compatible = "st,stih416-sbc-syscfg", "syscon";
32 reg = <0xfe600000 0x1000>; 43 reg = <0xfe600000 0x1000>;
@@ -145,5 +156,73 @@
145 156
146 status = "disabled"; 157 status = "disabled";
147 }; 158 };
159
160 ethernet0: dwmac@fe810000 {
161 device_type = "network";
162 compatible = "st,stih416-dwmac", "snps,dwmac", "snps,dwmac-3.710";
163 status = "disabled";
164 reg = <0xfe810000 0x8000>, <0x8bc 0x4>;
165 reg-names = "stmmaceth", "sti-ethconf";
166
167 interrupts = <0 133 0>, <0 134 0>, <0 135 0>;
168 interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
169
170 snps,pbl = <32>;
171 snps,mixed-burst;
172
173 st,syscon = <&syscfg_rear>;
174 resets = <&softreset STIH416_ETH0_SOFTRESET>;
175 reset-names = "stmmaceth";
176 pinctrl-names = "default";
177 pinctrl-0 = <&pinctrl_mii0>;
178 clock-names = "stmmaceth";
179 clocks = <&CLK_S_GMAC0_PHY>;
180 };
181
182 ethernet1: dwmac@fef08000 {
183 device_type = "network";
184 compatible = "st,stih416-dwmac", "snps,dwmac", "snps,dwmac-3.710";
185 status = "disabled";
186 reg = <0xfef08000 0x8000>, <0x7f0 0x4>;
187 reg-names = "stmmaceth", "sti-ethconf";
188 interrupts = <0 136 0>, <0 137 0>, <0 138 0>;
189 interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
190
191 snps,pbl = <32>;
192 snps,mixed-burst;
193
194 st,syscon = <&syscfg_sbc>;
195
196 resets = <&softreset STIH416_ETH1_SOFTRESET>;
197 reset-names = "stmmaceth";
198 pinctrl-names = "default";
199 pinctrl-0 = <&pinctrl_mii1>;
200 clock-names = "stmmaceth";
201 clocks = <&CLK_S_ETH1_PHY>;
202 };
203
204 rc: rc@fe518000 {
205 compatible = "st,comms-irb";
206 reg = <0xfe518000 0x234>;
207 interrupts = <0 203 0>;
208 rx-mode = "infrared";
209 clocks = <&CLK_SYSIN>;
210 pinctrl-names = "default";
211 pinctrl-0 = <&pinctrl_ir>;
212 resets = <&softreset STIH416_IRB_SOFTRESET>;
213 };
214
215 /* FSM */
216 spifsm: spifsm@fe902000 {
217 compatible = "st,spi-fsm";
218 reg = <0xfe902000 0x1000>;
219 pinctrl-0 = <&pinctrl_fsm>;
220
221 st,syscfg = <&syscfg_rear>;
222 st,boot-device-reg = <0x958>;
223 st,boot-device-spi = <0x1a>;
224
225 status = "disabled";
226 };
148 }; 227 };
149}; 228};
diff --git a/arch/arm/boot/dts/stih41x-b2000.dtsi b/arch/arm/boot/dts/stih41x-b2000.dtsi
index 1e6aa92772f5..bf65c49095af 100644
--- a/arch/arm/boot/dts/stih41x-b2000.dtsi
+++ b/arch/arm/boot/dts/stih41x-b2000.dtsi
@@ -20,6 +20,8 @@
20 20
21 aliases { 21 aliases {
22 ttyAS0 = &serial2; 22 ttyAS0 = &serial2;
23 ethernet0 = &ethernet0;
24 ethernet1 = &ethernet1;
23 }; 25 };
24 26
25 soc { 27 soc {
@@ -46,5 +48,25 @@
46 48
47 status = "okay"; 49 status = "okay";
48 }; 50 };
51
52 ethernet0: dwmac@fe810000 {
53 status = "okay";
54 phy-mode = "mii";
55 pinctrl-0 = <&pinctrl_mii0>;
56
57 snps,reset-gpio = <&PIO106 2>;
58 snps,reset-active-low;
59 snps,reset-delays-us = <0 10000 10000>;
60 };
61
62 ethernet1: dwmac@fef08000 {
63 status = "disabled";
64 phy-mode = "mii";
65 st,tx-retime-src = "txclk";
66
67 snps,reset-gpio = <&PIO4 7>;
68 snps,reset-active-low;
69 snps,reset-delays-us = <0 10000 10000>;
70 };
49 }; 71 };
50}; 72};
diff --git a/arch/arm/boot/dts/stih41x-b2020.dtsi b/arch/arm/boot/dts/stih41x-b2020.dtsi
index 0ef0a69df8ea..838513f9ddc0 100644
--- a/arch/arm/boot/dts/stih41x-b2020.dtsi
+++ b/arch/arm/boot/dts/stih41x-b2020.dtsi
@@ -6,6 +6,7 @@
6 * it under the terms of the GNU General Public License version 2 as 6 * it under the terms of the GNU General Public License version 2 as
7 * publishhed by the Free Software Foundation. 7 * publishhed by the Free Software Foundation.
8 */ 8 */
9#include "stih41x-b2020x.dtsi"
9/ { 10/ {
10 memory{ 11 memory{
11 device_type = "memory"; 12 device_type = "memory";
@@ -19,6 +20,7 @@
19 20
20 aliases { 21 aliases {
21 ttyAS0 = &sbc_serial1; 22 ttyAS0 = &sbc_serial1;
23 ethernet1 = &ethernet1;
22 }; 24 };
23 soc { 25 soc {
24 sbc_serial1: serial@fe531000 { 26 sbc_serial1: serial@fe531000 {
@@ -60,5 +62,17 @@
60 i2c@fe541000 { 62 i2c@fe541000 {
61 status = "okay"; 63 status = "okay";
62 }; 64 };
65
66 ethernet1: dwmac@fef08000 {
67 status = "okay";
68 phy-mode = "rgmii-id";
69 max-speed = <1000>;
70 st,tx-retime-src = "clk_125";
71 snps,reset-gpio = <&PIO3 0>;
72 snps,reset-active-low;
73 snps,reset-delays-us = <0 10000 10000>;
74
75 pinctrl-0 = <&pinctrl_rgmii1>;
76 };
63 }; 77 };
64}; 78};
diff --git a/arch/arm/boot/dts/stih41x-b2020x.dtsi b/arch/arm/boot/dts/stih41x-b2020x.dtsi
new file mode 100644
index 000000000000..df01c1211b32
--- /dev/null
+++ b/arch/arm/boot/dts/stih41x-b2020x.dtsi
@@ -0,0 +1,28 @@
1/*
2 * Copyright (C) 2013 STMicroelectronics (R&D) Limited.
3 * Author: Lee Jones <lee.jones@linaro.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 * publishhed by the Free Software Foundation.
8 */
9/ {
10 soc {
11 spifsm: spifsm@fe902000 {
12 #address-cells = <1>;
13 #size-cells = <1>;
14
15 status = "okay";
16
17 partition@0 {
18 label = "SerialFlash1";
19 reg = <0x00000000 0x00500000>;
20 };
21
22 partition@500000 {
23 label = "SerialFlash2";
24 reg = <0x00500000 0x00b00000>;
25 };
26 };
27 };
28};
diff --git a/arch/arm/boot/dts/sun4i-a10-a1000.dts b/arch/arm/boot/dts/sun4i-a10-a1000.dts
index d4b081d6a167..fa746aea5e66 100644
--- a/arch/arm/boot/dts/sun4i-a10-a1000.dts
+++ b/arch/arm/boot/dts/sun4i-a10-a1000.dts
@@ -13,6 +13,7 @@
13 13
14/dts-v1/; 14/dts-v1/;
15/include/ "sun4i-a10.dtsi" 15/include/ "sun4i-a10.dtsi"
16/include/ "sunxi-common-regulators.dtsi"
16 17
17/ { 18/ {
18 model = "Mele A1000"; 19 model = "Mele A1000";
@@ -35,6 +36,32 @@
35 }; 36 };
36 }; 37 };
37 38
39 usbphy: phy@01c13400 {
40 usb1_vbus-supply = <&reg_usb1_vbus>;
41 usb2_vbus-supply = <&reg_usb2_vbus>;
42 status = "okay";
43 };
44
45 ehci0: usb@01c14000 {
46 status = "okay";
47 };
48
49 ohci0: usb@01c14400 {
50 status = "okay";
51 };
52
53 ahci: sata@01c18000 {
54 status = "okay";
55 };
56
57 ehci1: usb@01c1c000 {
58 status = "okay";
59 };
60
61 ohci1: usb@01c1c400 {
62 status = "okay";
63 };
64
38 pinctrl@01c20800 { 65 pinctrl@01c20800 {
39 emac_power_pin_a1000: emac_power_pin@0 { 66 emac_power_pin_a1000: emac_power_pin@0 {
40 allwinner,pins = "PH15"; 67 allwinner,pins = "PH15";
@@ -80,18 +107,22 @@
80 }; 107 };
81 }; 108 };
82 109
83 regulators { 110 reg_emac_3v3: emac-3v3 {
84 compatible = "simple-bus"; 111 compatible = "regulator-fixed";
112 pinctrl-names = "default";
113 pinctrl-0 = <&emac_power_pin_a1000>;
114 regulator-name = "emac-3v3";
115 regulator-min-microvolt = <3300000>;
116 regulator-max-microvolt = <3300000>;
117 enable-active-high;
118 gpio = <&pio 7 15 0>;
119 };
85 120
86 reg_emac_3v3: emac-3v3 { 121 reg_usb1_vbus: usb1-vbus {
87 compatible = "regulator-fixed"; 122 status = "okay";
88 pinctrl-names = "default"; 123 };
89 pinctrl-0 = <&emac_power_pin_a1000>; 124
90 regulator-name = "emac-3v3"; 125 reg_usb2_vbus: usb2-vbus {
91 regulator-min-microvolt = <3300000>; 126 status = "okay";
92 regulator-max-microvolt = <3300000>;
93 enable-active-high;
94 gpio = <&pio 7 15 0>;
95 };
96 }; 127 };
97}; 128};
diff --git a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
index b139ee6bcf99..4684cbe6843b 100644
--- a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
+++ b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
@@ -12,6 +12,7 @@
12 12
13/dts-v1/; 13/dts-v1/;
14/include/ "sun4i-a10.dtsi" 14/include/ "sun4i-a10.dtsi"
15/include/ "sunxi-common-regulators.dtsi"
15 16
16/ { 17/ {
17 model = "Cubietech Cubieboard"; 18 model = "Cubietech Cubieboard";
@@ -33,6 +34,33 @@
33 }; 34 };
34 }; 35 };
35 36
37 usbphy: phy@01c13400 {
38 usb1_vbus-supply = <&reg_usb1_vbus>;
39 usb2_vbus-supply = <&reg_usb2_vbus>;
40 status = "okay";
41 };
42
43 ehci0: usb@01c14000 {
44 status = "okay";
45 };
46
47 ohci0: usb@01c14400 {
48 status = "okay";
49 };
50
51 ahci: sata@01c18000 {
52 target-supply = <&reg_ahci_5v>;
53 status = "okay";
54 };
55
56 ehci1: usb@01c1c000 {
57 status = "okay";
58 };
59
60 ohci1: usb@01c1c400 {
61 status = "okay";
62 };
63
36 pinctrl@01c20800 { 64 pinctrl@01c20800 {
37 led_pins_cubieboard: led_pins@0 { 65 led_pins_cubieboard: led_pins@0 {
38 allwinner,pins = "PH20", "PH21"; 66 allwinner,pins = "PH20", "PH21";
@@ -77,4 +105,16 @@
77 linux,default-trigger = "heartbeat"; 105 linux,default-trigger = "heartbeat";
78 }; 106 };
79 }; 107 };
108
109 reg_ahci_5v: ahci-5v {
110 status = "okay";
111 };
112
113 reg_usb1_vbus: usb1-vbus {
114 status = "okay";
115 };
116
117 reg_usb2_vbus: usb2-vbus {
118 status = "okay";
119 };
80}; 120};
diff --git a/arch/arm/boot/dts/sun4i-a10-hackberry.dts b/arch/arm/boot/dts/sun4i-a10-hackberry.dts
index 3a1595f67823..d7c17e46ce23 100644
--- a/arch/arm/boot/dts/sun4i-a10-hackberry.dts
+++ b/arch/arm/boot/dts/sun4i-a10-hackberry.dts
@@ -13,6 +13,7 @@
13 13
14/dts-v1/; 14/dts-v1/;
15/include/ "sun4i-a10.dtsi" 15/include/ "sun4i-a10.dtsi"
16/include/ "sunxi-common-regulators.dtsi"
16 17
17/ { 18/ {
18 model = "Miniand Hackberry"; 19 model = "Miniand Hackberry";
@@ -35,6 +36,28 @@
35 }; 36 };
36 }; 37 };
37 38
39 usbphy: phy@01c13400 {
40 usb1_vbus-supply = <&reg_usb1_vbus>;
41 usb2_vbus-supply = <&reg_usb2_vbus>;
42 status = "okay";
43 };
44
45 ehci0: usb@01c14000 {
46 status = "okay";
47 };
48
49 ohci0: usb@01c14400 {
50 status = "okay";
51 };
52
53 ehci1: usb@01c1c000 {
54 status = "okay";
55 };
56
57 ohci1: usb@01c1c400 {
58 status = "okay";
59 };
60
38 pio: pinctrl@01c20800 { 61 pio: pinctrl@01c20800 {
39 pinctrl-names = "default"; 62 pinctrl-names = "default";
40 pinctrl-0 = <&hackberry_hogs>; 63 pinctrl-0 = <&hackberry_hogs>;
@@ -45,6 +68,13 @@
45 allwinner,drive = <0>; 68 allwinner,drive = <0>;
46 allwinner,pull = <0>; 69 allwinner,pull = <0>;
47 }; 70 };
71
72 usb2_vbus_pin_hackberry: usb2_vbus_pin@0 {
73 allwinner,pins = "PH12";
74 allwinner,function = "gpio_out";
75 allwinner,drive = <0>;
76 allwinner,pull = <0>;
77 };
48 }; 78 };
49 79
50 uart0: serial@01c28000 { 80 uart0: serial@01c28000 {
@@ -54,16 +84,22 @@
54 }; 84 };
55 }; 85 };
56 86
57 regulators { 87 reg_emac_3v3: emac-3v3 {
58 compatible = "simple-bus"; 88 compatible = "regulator-fixed";
89 regulator-name = "emac-3v3";
90 regulator-min-microvolt = <3300000>;
91 regulator-max-microvolt = <3300000>;
92 enable-active-high;
93 gpio = <&pio 7 19 0>;
94 };
59 95
60 reg_emac_3v3: emac-3v3 { 96 reg_usb1_vbus: usb1-vbus {
61 compatible = "regulator-fixed"; 97 status = "okay";
62 regulator-name = "emac-3v3"; 98 };
63 regulator-min-microvolt = <3300000>; 99
64 regulator-max-microvolt = <3300000>; 100 reg_usb2_vbus: usb2-vbus {
65 enable-active-high; 101 pinctrl-0 = <&usb2_vbus_pin_hackberry>;
66 gpio = <&pio 7 19 0>; 102 gpio = <&pio 7 12 0>;
67 }; 103 status = "okay";
68 }; 104 };
69}; 105};
diff --git a/arch/arm/boot/dts/sun4i-a10-inet97fv2.dts b/arch/arm/boot/dts/sun4i-a10-inet97fv2.dts
new file mode 100644
index 000000000000..fe9272ee55c3
--- /dev/null
+++ b/arch/arm/boot/dts/sun4i-a10-inet97fv2.dts
@@ -0,0 +1,69 @@
1/*
2 * Copyright 2014 Open Source Support GmbH
3 *
4 * David Lanzendörfer <david.lanzendoerfer@o2s.ch>
5 *
6 * The code contained herein is licensed under the GNU General Public
7 * License. You may obtain a copy of the GNU General Public License
8 * Version 2 or later at the following locations:
9 *
10 * http://www.opensource.org/licenses/gpl-license.html
11 * http://www.gnu.org/copyleft/gpl.html
12 */
13
14/dts-v1/;
15/include/ "sun4i-a10.dtsi"
16/include/ "sunxi-common-regulators.dtsi"
17
18/ {
19 model = "INet-97F Rev 02";
20 compatible = "primux,inet97fv2", "allwinner,sun4i-a10";
21
22 aliases {
23 serial0 = &uart0;
24 };
25
26 soc@01c00000 {
27 uart0: serial@01c28000 {
28 pinctrl-names = "default";
29 pinctrl-0 = <&uart0_pins_a>;
30 status = "okay";
31 };
32
33 i2c0: i2c@01c2ac00 {
34 pinctrl-names = "default";
35 pinctrl-0 = <&i2c0_pins_a>;
36 status = "okay";
37 };
38
39 usbphy: phy@01c13400 {
40 usb1_vbus-supply = <&reg_usb1_vbus>;
41 usb2_vbus-supply = <&reg_usb2_vbus>;
42 status = "okay";
43 };
44
45 ehci0: usb@01c14000 {
46 status = "okay";
47 };
48
49 ohci0: usb@01c14400 {
50 status = "okay";
51 };
52
53 ehci1: usb@01c1c000 {
54 status = "okay";
55 };
56
57 ohci1: usb@01c1c400 {
58 status = "okay";
59 };
60 };
61
62 reg_usb1_vbus: usb1-vbus {
63 status = "okay";
64 };
65
66 reg_usb2_vbus: usb2-vbus {
67 status = "okay";
68 };
69};
diff --git a/arch/arm/boot/dts/sun4i-a10-mini-xplus.dts b/arch/arm/boot/dts/sun4i-a10-mini-xplus.dts
index 70b3323caf1a..dd84a9e313b3 100644
--- a/arch/arm/boot/dts/sun4i-a10-mini-xplus.dts
+++ b/arch/arm/boot/dts/sun4i-a10-mini-xplus.dts
@@ -13,16 +13,47 @@
13 13
14/dts-v1/; 14/dts-v1/;
15/include/ "sun4i-a10.dtsi" 15/include/ "sun4i-a10.dtsi"
16/include/ "sunxi-common-regulators.dtsi"
16 17
17/ { 18/ {
18 model = "PineRiver Mini X-Plus"; 19 model = "PineRiver Mini X-Plus";
19 compatible = "pineriver,mini-xplus", "allwinner,sun4i-a10"; 20 compatible = "pineriver,mini-xplus", "allwinner,sun4i-a10";
20 21
21 soc@01c00000 { 22 soc@01c00000 {
23 usbphy: phy@01c13400 {
24 usb1_vbus-supply = <&reg_usb1_vbus>;
25 usb2_vbus-supply = <&reg_usb2_vbus>;
26 status = "okay";
27 };
28
29 ehci0: usb@01c14000 {
30 status = "okay";
31 };
32
33 ohci0: usb@01c14400 {
34 status = "okay";
35 };
36
37 ehci1: usb@01c1c000 {
38 status = "okay";
39 };
40
41 ohci1: usb@01c1c400 {
42 status = "okay";
43 };
44
22 uart0: serial@01c28000 { 45 uart0: serial@01c28000 {
23 pinctrl-names = "default"; 46 pinctrl-names = "default";
24 pinctrl-0 = <&uart0_pins_a>; 47 pinctrl-0 = <&uart0_pins_a>;
25 status = "okay"; 48 status = "okay";
26 }; 49 };
27 }; 50 };
51
52 reg_usb1_vbus: usb1-vbus {
53 status = "okay";
54 };
55
56 reg_usb2_vbus: usb2-vbus {
57 status = "okay";
58 };
28}; 59};
diff --git a/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts b/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts
new file mode 100644
index 000000000000..66cf0c7cf5b7
--- /dev/null
+++ b/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts
@@ -0,0 +1,111 @@
1/*
2 * Copyright 2014 - Hans de Goede <hdegoede@redhat.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/dts-v1/;
13/include/ "sun4i-a10.dtsi"
14/include/ "sunxi-common-regulators.dtsi"
15
16/ {
17 model = "Olimex A10-OLinuXino-LIME";
18 compatible = "olimex,a10-olinuxino-lime", "allwinner,sun4i-a10";
19
20 soc@01c00000 {
21 emac: ethernet@01c0b000 {
22 pinctrl-names = "default";
23 pinctrl-0 = <&emac_pins_a>;
24 phy = <&phy1>;
25 status = "okay";
26 };
27
28 mdio@01c0b080 {
29 status = "okay";
30
31 phy1: ethernet-phy@1 {
32 reg = <1>;
33 };
34 };
35
36 usbphy: phy@01c13400 {
37 usb1_vbus-supply = <&reg_usb1_vbus>;
38 usb2_vbus-supply = <&reg_usb2_vbus>;
39 status = "okay";
40 };
41
42 ehci0: usb@01c14000 {
43 status = "okay";
44 };
45
46 ohci0: usb@01c14400 {
47 status = "okay";
48 };
49
50 ahci: sata@01c18000 {
51 target-supply = <&reg_ahci_5v>;
52 status = "okay";
53 };
54
55 ehci1: usb@01c1c000 {
56 status = "okay";
57 };
58
59 ohci1: usb@01c1c400 {
60 status = "okay";
61 };
62
63 pinctrl@01c20800 {
64 ahci_pwr_pin_olinuxinolime: ahci_pwr_pin@1 {
65 allwinner,pins = "PC3";
66 allwinner,function = "gpio_out";
67 allwinner,drive = <0>;
68 allwinner,pull = <0>;
69 };
70
71 led_pins_olinuxinolime: led_pins@0 {
72 allwinner,pins = "PH2";
73 allwinner,function = "gpio_out";
74 allwinner,drive = <1>;
75 allwinner,pull = <0>;
76 };
77 };
78
79 uart0: serial@01c28000 {
80 pinctrl-names = "default";
81 pinctrl-0 = <&uart0_pins_a>;
82 status = "okay";
83 };
84 };
85
86 leds {
87 compatible = "gpio-leds";
88 pinctrl-names = "default";
89 pinctrl-0 = <&led_pins_olinuxinolime>;
90
91 green {
92 label = "a10-olinuxino-lime:green:usr";
93 gpios = <&pio 7 2 0>;
94 default-state = "on";
95 };
96 };
97
98 reg_ahci_5v: ahci-5v {
99 pinctrl-0 = <&ahci_pwr_pin_olinuxinolime>;
100 gpio = <&pio 2 3 0>;
101 status = "okay";
102 };
103
104 reg_usb1_vbus: usb1-vbus {
105 status = "okay";
106 };
107
108 reg_usb2_vbus: usb2-vbus {
109 status = "okay";
110 };
111};
diff --git a/arch/arm/boot/dts/sun4i-a10-pcduino.dts b/arch/arm/boot/dts/sun4i-a10-pcduino.dts
new file mode 100644
index 000000000000..255b47e7019c
--- /dev/null
+++ b/arch/arm/boot/dts/sun4i-a10-pcduino.dts
@@ -0,0 +1,79 @@
1/*
2 * Copyright 2014 Zoltan HERPAI
3 * Zoltan HERPAI <wigyori@uid0.hu>
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/dts-v1/;
14/include/ "sun4i-a10.dtsi"
15/include/ "sunxi-common-regulators.dtsi"
16
17/ {
18 model = "LinkSprite pcDuino";
19 compatible = "linksprite,a10-pcduino", "allwinner,sun4i-a10";
20
21 soc@01c00000 {
22 emac: ethernet@01c0b000 {
23 pinctrl-names = "default";
24 pinctrl-0 = <&emac_pins_a>;
25 phy = <&phy1>;
26 status = "okay";
27 };
28
29 mdio@01c0b080 {
30 status = "okay";
31
32 phy1: ethernet-phy@1 {
33 reg = <1>;
34 };
35 };
36
37 usbphy: phy@01c13400 {
38 usb1_vbus-supply = <&reg_usb1_vbus>;
39 usb2_vbus-supply = <&reg_usb2_vbus>;
40 status = "okay";
41 };
42
43 ehci0: usb@01c14000 {
44 status = "okay";
45 };
46
47 ohci0: usb@01c14400 {
48 status = "okay";
49 };
50
51 ehci1: usb@01c1c000 {
52 status = "okay";
53 };
54
55 ohci1: usb@01c1c400 {
56 status = "okay";
57 };
58
59 uart0: serial@01c28000 {
60 pinctrl-names = "default";
61 pinctrl-0 = <&uart0_pins_a>;
62 status = "okay";
63 };
64
65 i2c0: i2c@01c2ac00 {
66 pinctrl-names = "default";
67 pinctrl-0 = <&i2c0_pins_a>;
68 status = "okay";
69 };
70 };
71
72 reg_usb1_vbus: usb1-vbus {
73 status = "okay";
74 };
75
76 reg_usb2_vbus: usb2-vbus {
77 status = "okay";
78 };
79};
diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
index 249b6e0ba737..9174724571e2 100644
--- a/arch/arm/boot/dts/sun4i-a10.dtsi
+++ b/arch/arm/boot/dts/sun4i-a10.dtsi
@@ -19,6 +19,12 @@
19 ethernet0 = &emac; 19 ethernet0 = &emac;
20 serial0 = &uart0; 20 serial0 = &uart0;
21 serial1 = &uart1; 21 serial1 = &uart1;
22 serial2 = &uart2;
23 serial3 = &uart3;
24 serial4 = &uart4;
25 serial5 = &uart5;
26 serial6 = &uart6;
27 serial7 = &uart7;
22 }; 28 };
23 29
24 cpus { 30 cpus {
@@ -52,44 +58,48 @@
52 clock-frequency = <0>; 58 clock-frequency = <0>;
53 }; 59 };
54 60
55 osc24M: osc24M@01c20050 { 61 osc24M: clk@01c20050 {
56 #clock-cells = <0>; 62 #clock-cells = <0>;
57 compatible = "allwinner,sun4i-osc-clk"; 63 compatible = "allwinner,sun4i-a10-osc-clk";
58 reg = <0x01c20050 0x4>; 64 reg = <0x01c20050 0x4>;
59 clock-frequency = <24000000>; 65 clock-frequency = <24000000>;
66 clock-output-names = "osc24M";
60 }; 67 };
61 68
62 osc32k: osc32k { 69 osc32k: clk@0 {
63 #clock-cells = <0>; 70 #clock-cells = <0>;
64 compatible = "fixed-clock"; 71 compatible = "fixed-clock";
65 clock-frequency = <32768>; 72 clock-frequency = <32768>;
73 clock-output-names = "osc32k";
66 }; 74 };
67 75
68 pll1: pll1@01c20000 { 76 pll1: clk@01c20000 {
69 #clock-cells = <0>; 77 #clock-cells = <0>;
70 compatible = "allwinner,sun4i-pll1-clk"; 78 compatible = "allwinner,sun4i-a10-pll1-clk";
71 reg = <0x01c20000 0x4>; 79 reg = <0x01c20000 0x4>;
72 clocks = <&osc24M>; 80 clocks = <&osc24M>;
81 clock-output-names = "pll1";
73 }; 82 };
74 83
75 pll4: pll4@01c20018 { 84 pll4: clk@01c20018 {
76 #clock-cells = <0>; 85 #clock-cells = <0>;
77 compatible = "allwinner,sun4i-pll1-clk"; 86 compatible = "allwinner,sun4i-a10-pll1-clk";
78 reg = <0x01c20018 0x4>; 87 reg = <0x01c20018 0x4>;
79 clocks = <&osc24M>; 88 clocks = <&osc24M>;
89 clock-output-names = "pll4";
80 }; 90 };
81 91
82 pll5: pll5@01c20020 { 92 pll5: clk@01c20020 {
83 #clock-cells = <1>; 93 #clock-cells = <1>;
84 compatible = "allwinner,sun4i-pll5-clk"; 94 compatible = "allwinner,sun4i-a10-pll5-clk";
85 reg = <0x01c20020 0x4>; 95 reg = <0x01c20020 0x4>;
86 clocks = <&osc24M>; 96 clocks = <&osc24M>;
87 clock-output-names = "pll5_ddr", "pll5_other"; 97 clock-output-names = "pll5_ddr", "pll5_other";
88 }; 98 };
89 99
90 pll6: pll6@01c20028 { 100 pll6: clk@01c20028 {
91 #clock-cells = <1>; 101 #clock-cells = <1>;
92 compatible = "allwinner,sun4i-pll6-clk"; 102 compatible = "allwinner,sun4i-a10-pll6-clk";
93 reg = <0x01c20028 0x4>; 103 reg = <0x01c20028 0x4>;
94 clocks = <&osc24M>; 104 clocks = <&osc24M>;
95 clock-output-names = "pll6_sata", "pll6_other", "pll6"; 105 clock-output-names = "pll6_sata", "pll6_other", "pll6";
@@ -98,21 +108,23 @@
98 /* dummy is 200M */ 108 /* dummy is 200M */
99 cpu: cpu@01c20054 { 109 cpu: cpu@01c20054 {
100 #clock-cells = <0>; 110 #clock-cells = <0>;
101 compatible = "allwinner,sun4i-cpu-clk"; 111 compatible = "allwinner,sun4i-a10-cpu-clk";
102 reg = <0x01c20054 0x4>; 112 reg = <0x01c20054 0x4>;
103 clocks = <&osc32k>, <&osc24M>, <&pll1>, <&dummy>; 113 clocks = <&osc32k>, <&osc24M>, <&pll1>, <&dummy>;
114 clock-output-names = "cpu";
104 }; 115 };
105 116
106 axi: axi@01c20054 { 117 axi: axi@01c20054 {
107 #clock-cells = <0>; 118 #clock-cells = <0>;
108 compatible = "allwinner,sun4i-axi-clk"; 119 compatible = "allwinner,sun4i-a10-axi-clk";
109 reg = <0x01c20054 0x4>; 120 reg = <0x01c20054 0x4>;
110 clocks = <&cpu>; 121 clocks = <&cpu>;
122 clock-output-names = "axi";
111 }; 123 };
112 124
113 axi_gates: axi_gates@01c2005c { 125 axi_gates: clk@01c2005c {
114 #clock-cells = <1>; 126 #clock-cells = <1>;
115 compatible = "allwinner,sun4i-axi-gates-clk"; 127 compatible = "allwinner,sun4i-a10-axi-gates-clk";
116 reg = <0x01c2005c 0x4>; 128 reg = <0x01c2005c 0x4>;
117 clocks = <&axi>; 129 clocks = <&axi>;
118 clock-output-names = "axi_dram"; 130 clock-output-names = "axi_dram";
@@ -120,14 +132,15 @@
120 132
121 ahb: ahb@01c20054 { 133 ahb: ahb@01c20054 {
122 #clock-cells = <0>; 134 #clock-cells = <0>;
123 compatible = "allwinner,sun4i-ahb-clk"; 135 compatible = "allwinner,sun4i-a10-ahb-clk";
124 reg = <0x01c20054 0x4>; 136 reg = <0x01c20054 0x4>;
125 clocks = <&axi>; 137 clocks = <&axi>;
138 clock-output-names = "ahb";
126 }; 139 };
127 140
128 ahb_gates: ahb_gates@01c20060 { 141 ahb_gates: clk@01c20060 {
129 #clock-cells = <1>; 142 #clock-cells = <1>;
130 compatible = "allwinner,sun4i-ahb-gates-clk"; 143 compatible = "allwinner,sun4i-a10-ahb-gates-clk";
131 reg = <0x01c20060 0x8>; 144 reg = <0x01c20060 0x8>;
132 clocks = <&ahb>; 145 clocks = <&ahb>;
133 clock-output-names = "ahb_usb0", "ahb_ehci0", 146 clock-output-names = "ahb_usb0", "ahb_ehci0",
@@ -145,14 +158,15 @@
145 158
146 apb0: apb0@01c20054 { 159 apb0: apb0@01c20054 {
147 #clock-cells = <0>; 160 #clock-cells = <0>;
148 compatible = "allwinner,sun4i-apb0-clk"; 161 compatible = "allwinner,sun4i-a10-apb0-clk";
149 reg = <0x01c20054 0x4>; 162 reg = <0x01c20054 0x4>;
150 clocks = <&ahb>; 163 clocks = <&ahb>;
164 clock-output-names = "apb0";
151 }; 165 };
152 166
153 apb0_gates: apb0_gates@01c20068 { 167 apb0_gates: clk@01c20068 {
154 #clock-cells = <1>; 168 #clock-cells = <1>;
155 compatible = "allwinner,sun4i-apb0-gates-clk"; 169 compatible = "allwinner,sun4i-a10-apb0-gates-clk";
156 reg = <0x01c20068 0x4>; 170 reg = <0x01c20068 0x4>;
157 clocks = <&apb0>; 171 clocks = <&apb0>;
158 clock-output-names = "apb0_codec", "apb0_spdif", 172 clock-output-names = "apb0_codec", "apb0_spdif",
@@ -162,21 +176,23 @@
162 176
163 apb1_mux: apb1_mux@01c20058 { 177 apb1_mux: apb1_mux@01c20058 {
164 #clock-cells = <0>; 178 #clock-cells = <0>;
165 compatible = "allwinner,sun4i-apb1-mux-clk"; 179 compatible = "allwinner,sun4i-a10-apb1-mux-clk";
166 reg = <0x01c20058 0x4>; 180 reg = <0x01c20058 0x4>;
167 clocks = <&osc24M>, <&pll6 1>, <&osc32k>; 181 clocks = <&osc24M>, <&pll6 1>, <&osc32k>;
182 clock-output-names = "apb1_mux";
168 }; 183 };
169 184
170 apb1: apb1@01c20058 { 185 apb1: apb1@01c20058 {
171 #clock-cells = <0>; 186 #clock-cells = <0>;
172 compatible = "allwinner,sun4i-apb1-clk"; 187 compatible = "allwinner,sun4i-a10-apb1-clk";
173 reg = <0x01c20058 0x4>; 188 reg = <0x01c20058 0x4>;
174 clocks = <&apb1_mux>; 189 clocks = <&apb1_mux>;
190 clock-output-names = "apb1";
175 }; 191 };
176 192
177 apb1_gates: apb1_gates@01c2006c { 193 apb1_gates: clk@01c2006c {
178 #clock-cells = <1>; 194 #clock-cells = <1>;
179 compatible = "allwinner,sun4i-apb1-gates-clk"; 195 compatible = "allwinner,sun4i-a10-apb1-gates-clk";
180 reg = <0x01c2006c 0x4>; 196 reg = <0x01c2006c 0x4>;
181 clocks = <&apb1>; 197 clocks = <&apb1>;
182 clock-output-names = "apb1_i2c0", "apb1_i2c1", 198 clock-output-names = "apb1_i2c0", "apb1_i2c1",
@@ -189,7 +205,7 @@
189 205
190 nand_clk: clk@01c20080 { 206 nand_clk: clk@01c20080 {
191 #clock-cells = <0>; 207 #clock-cells = <0>;
192 compatible = "allwinner,sun4i-mod0-clk"; 208 compatible = "allwinner,sun4i-a10-mod0-clk";
193 reg = <0x01c20080 0x4>; 209 reg = <0x01c20080 0x4>;
194 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 210 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
195 clock-output-names = "nand"; 211 clock-output-names = "nand";
@@ -197,7 +213,7 @@
197 213
198 ms_clk: clk@01c20084 { 214 ms_clk: clk@01c20084 {
199 #clock-cells = <0>; 215 #clock-cells = <0>;
200 compatible = "allwinner,sun4i-mod0-clk"; 216 compatible = "allwinner,sun4i-a10-mod0-clk";
201 reg = <0x01c20084 0x4>; 217 reg = <0x01c20084 0x4>;
202 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 218 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
203 clock-output-names = "ms"; 219 clock-output-names = "ms";
@@ -205,7 +221,7 @@
205 221
206 mmc0_clk: clk@01c20088 { 222 mmc0_clk: clk@01c20088 {
207 #clock-cells = <0>; 223 #clock-cells = <0>;
208 compatible = "allwinner,sun4i-mod0-clk"; 224 compatible = "allwinner,sun4i-a10-mod0-clk";
209 reg = <0x01c20088 0x4>; 225 reg = <0x01c20088 0x4>;
210 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 226 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
211 clock-output-names = "mmc0"; 227 clock-output-names = "mmc0";
@@ -213,7 +229,7 @@
213 229
214 mmc1_clk: clk@01c2008c { 230 mmc1_clk: clk@01c2008c {
215 #clock-cells = <0>; 231 #clock-cells = <0>;
216 compatible = "allwinner,sun4i-mod0-clk"; 232 compatible = "allwinner,sun4i-a10-mod0-clk";
217 reg = <0x01c2008c 0x4>; 233 reg = <0x01c2008c 0x4>;
218 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 234 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
219 clock-output-names = "mmc1"; 235 clock-output-names = "mmc1";
@@ -221,7 +237,7 @@
221 237
222 mmc2_clk: clk@01c20090 { 238 mmc2_clk: clk@01c20090 {
223 #clock-cells = <0>; 239 #clock-cells = <0>;
224 compatible = "allwinner,sun4i-mod0-clk"; 240 compatible = "allwinner,sun4i-a10-mod0-clk";
225 reg = <0x01c20090 0x4>; 241 reg = <0x01c20090 0x4>;
226 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 242 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
227 clock-output-names = "mmc2"; 243 clock-output-names = "mmc2";
@@ -229,7 +245,7 @@
229 245
230 mmc3_clk: clk@01c20094 { 246 mmc3_clk: clk@01c20094 {
231 #clock-cells = <0>; 247 #clock-cells = <0>;
232 compatible = "allwinner,sun4i-mod0-clk"; 248 compatible = "allwinner,sun4i-a10-mod0-clk";
233 reg = <0x01c20094 0x4>; 249 reg = <0x01c20094 0x4>;
234 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 250 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
235 clock-output-names = "mmc3"; 251 clock-output-names = "mmc3";
@@ -237,7 +253,7 @@
237 253
238 ts_clk: clk@01c20098 { 254 ts_clk: clk@01c20098 {
239 #clock-cells = <0>; 255 #clock-cells = <0>;
240 compatible = "allwinner,sun4i-mod0-clk"; 256 compatible = "allwinner,sun4i-a10-mod0-clk";
241 reg = <0x01c20098 0x4>; 257 reg = <0x01c20098 0x4>;
242 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 258 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
243 clock-output-names = "ts"; 259 clock-output-names = "ts";
@@ -245,7 +261,7 @@
245 261
246 ss_clk: clk@01c2009c { 262 ss_clk: clk@01c2009c {
247 #clock-cells = <0>; 263 #clock-cells = <0>;
248 compatible = "allwinner,sun4i-mod0-clk"; 264 compatible = "allwinner,sun4i-a10-mod0-clk";
249 reg = <0x01c2009c 0x4>; 265 reg = <0x01c2009c 0x4>;
250 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 266 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
251 clock-output-names = "ss"; 267 clock-output-names = "ss";
@@ -253,7 +269,7 @@
253 269
254 spi0_clk: clk@01c200a0 { 270 spi0_clk: clk@01c200a0 {
255 #clock-cells = <0>; 271 #clock-cells = <0>;
256 compatible = "allwinner,sun4i-mod0-clk"; 272 compatible = "allwinner,sun4i-a10-mod0-clk";
257 reg = <0x01c200a0 0x4>; 273 reg = <0x01c200a0 0x4>;
258 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 274 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
259 clock-output-names = "spi0"; 275 clock-output-names = "spi0";
@@ -261,7 +277,7 @@
261 277
262 spi1_clk: clk@01c200a4 { 278 spi1_clk: clk@01c200a4 {
263 #clock-cells = <0>; 279 #clock-cells = <0>;
264 compatible = "allwinner,sun4i-mod0-clk"; 280 compatible = "allwinner,sun4i-a10-mod0-clk";
265 reg = <0x01c200a4 0x4>; 281 reg = <0x01c200a4 0x4>;
266 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 282 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
267 clock-output-names = "spi1"; 283 clock-output-names = "spi1";
@@ -269,7 +285,7 @@
269 285
270 spi2_clk: clk@01c200a8 { 286 spi2_clk: clk@01c200a8 {
271 #clock-cells = <0>; 287 #clock-cells = <0>;
272 compatible = "allwinner,sun4i-mod0-clk"; 288 compatible = "allwinner,sun4i-a10-mod0-clk";
273 reg = <0x01c200a8 0x4>; 289 reg = <0x01c200a8 0x4>;
274 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 290 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
275 clock-output-names = "spi2"; 291 clock-output-names = "spi2";
@@ -277,7 +293,7 @@
277 293
278 pata_clk: clk@01c200ac { 294 pata_clk: clk@01c200ac {
279 #clock-cells = <0>; 295 #clock-cells = <0>;
280 compatible = "allwinner,sun4i-mod0-clk"; 296 compatible = "allwinner,sun4i-a10-mod0-clk";
281 reg = <0x01c200ac 0x4>; 297 reg = <0x01c200ac 0x4>;
282 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 298 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
283 clock-output-names = "pata"; 299 clock-output-names = "pata";
@@ -285,7 +301,7 @@
285 301
286 ir0_clk: clk@01c200b0 { 302 ir0_clk: clk@01c200b0 {
287 #clock-cells = <0>; 303 #clock-cells = <0>;
288 compatible = "allwinner,sun4i-mod0-clk"; 304 compatible = "allwinner,sun4i-a10-mod0-clk";
289 reg = <0x01c200b0 0x4>; 305 reg = <0x01c200b0 0x4>;
290 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 306 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
291 clock-output-names = "ir0"; 307 clock-output-names = "ir0";
@@ -293,15 +309,24 @@
293 309
294 ir1_clk: clk@01c200b4 { 310 ir1_clk: clk@01c200b4 {
295 #clock-cells = <0>; 311 #clock-cells = <0>;
296 compatible = "allwinner,sun4i-mod0-clk"; 312 compatible = "allwinner,sun4i-a10-mod0-clk";
297 reg = <0x01c200b4 0x4>; 313 reg = <0x01c200b4 0x4>;
298 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 314 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
299 clock-output-names = "ir1"; 315 clock-output-names = "ir1";
300 }; 316 };
301 317
318 usb_clk: clk@01c200cc {
319 #clock-cells = <1>;
320 #reset-cells = <1>;
321 compatible = "allwinner,sun4i-a10-usb-clk";
322 reg = <0x01c200cc 0x4>;
323 clocks = <&pll6 1>;
324 clock-output-names = "usb_ohci0", "usb_ohci1", "usb_phy";
325 };
326
302 spi3_clk: clk@01c200d4 { 327 spi3_clk: clk@01c200d4 {
303 #clock-cells = <0>; 328 #clock-cells = <0>;
304 compatible = "allwinner,sun4i-mod0-clk"; 329 compatible = "allwinner,sun4i-a10-mod0-clk";
305 reg = <0x01c200d4 0x4>; 330 reg = <0x01c200d4 0x4>;
306 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 331 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
307 clock-output-names = "spi3"; 332 clock-output-names = "spi3";
@@ -314,6 +339,28 @@
314 #size-cells = <1>; 339 #size-cells = <1>;
315 ranges; 340 ranges;
316 341
342 spi0: spi@01c05000 {
343 compatible = "allwinner,sun4i-a10-spi";
344 reg = <0x01c05000 0x1000>;
345 interrupts = <10>;
346 clocks = <&ahb_gates 20>, <&spi0_clk>;
347 clock-names = "ahb", "mod";
348 status = "disabled";
349 #address-cells = <1>;
350 #size-cells = <0>;
351 };
352
353 spi1: spi@01c06000 {
354 compatible = "allwinner,sun4i-a10-spi";
355 reg = <0x01c06000 0x1000>;
356 interrupts = <11>;
357 clocks = <&ahb_gates 21>, <&spi1_clk>;
358 clock-names = "ahb", "mod";
359 status = "disabled";
360 #address-cells = <1>;
361 #size-cells = <0>;
362 };
363
317 emac: ethernet@01c0b000 { 364 emac: ethernet@01c0b000 {
318 compatible = "allwinner,sun4i-a10-emac"; 365 compatible = "allwinner,sun4i-a10-emac";
319 reg = <0x01c0b000 0x1000>; 366 reg = <0x01c0b000 0x1000>;
@@ -330,6 +377,88 @@
330 #size-cells = <0>; 377 #size-cells = <0>;
331 }; 378 };
332 379
380 usbphy: phy@01c13400 {
381 #phy-cells = <1>;
382 compatible = "allwinner,sun4i-a10-usb-phy";
383 reg = <0x01c13400 0x10 0x01c14800 0x4 0x01c1c800 0x4>;
384 reg-names = "phy_ctrl", "pmu1", "pmu2";
385 clocks = <&usb_clk 8>;
386 clock-names = "usb_phy";
387 resets = <&usb_clk 1>, <&usb_clk 2>;
388 reset-names = "usb1_reset", "usb2_reset";
389 status = "disabled";
390 };
391
392 ehci0: usb@01c14000 {
393 compatible = "allwinner,sun4i-a10-ehci", "generic-ehci";
394 reg = <0x01c14000 0x100>;
395 interrupts = <39>;
396 clocks = <&ahb_gates 1>;
397 phys = <&usbphy 1>;
398 phy-names = "usb";
399 status = "disabled";
400 };
401
402 ohci0: usb@01c14400 {
403 compatible = "allwinner,sun4i-a10-ohci", "generic-ohci";
404 reg = <0x01c14400 0x100>;
405 interrupts = <64>;
406 clocks = <&usb_clk 6>, <&ahb_gates 2>;
407 phys = <&usbphy 1>;
408 phy-names = "usb";
409 status = "disabled";
410 };
411
412 spi2: spi@01c17000 {
413 compatible = "allwinner,sun4i-a10-spi";
414 reg = <0x01c17000 0x1000>;
415 interrupts = <12>;
416 clocks = <&ahb_gates 22>, <&spi2_clk>;
417 clock-names = "ahb", "mod";
418 status = "disabled";
419 #address-cells = <1>;
420 #size-cells = <0>;
421 };
422
423 ahci: sata@01c18000 {
424 compatible = "allwinner,sun4i-a10-ahci";
425 reg = <0x01c18000 0x1000>;
426 interrupts = <56>;
427 clocks = <&pll6 0>, <&ahb_gates 25>;
428 status = "disabled";
429 };
430
431 ehci1: usb@01c1c000 {
432 compatible = "allwinner,sun4i-a10-ehci", "generic-ehci";
433 reg = <0x01c1c000 0x100>;
434 interrupts = <40>;
435 clocks = <&ahb_gates 3>;
436 phys = <&usbphy 2>;
437 phy-names = "usb";
438 status = "disabled";
439 };
440
441 ohci1: usb@01c1c400 {
442 compatible = "allwinner,sun4i-a10-ohci", "generic-ohci";
443 reg = <0x01c1c400 0x100>;
444 interrupts = <65>;
445 clocks = <&usb_clk 7>, <&ahb_gates 4>;
446 phys = <&usbphy 2>;
447 phy-names = "usb";
448 status = "disabled";
449 };
450
451 spi3: spi@01c1f000 {
452 compatible = "allwinner,sun4i-a10-spi";
453 reg = <0x01c1f000 0x1000>;
454 interrupts = <50>;
455 clocks = <&ahb_gates 23>, <&spi3_clk>;
456 clock-names = "ahb", "mod";
457 status = "disabled";
458 #address-cells = <1>;
459 #size-cells = <0>;
460 };
461
333 intc: interrupt-controller@01c20400 { 462 intc: interrupt-controller@01c20400 {
334 compatible = "allwinner,sun4i-a10-ic"; 463 compatible = "allwinner,sun4i-a10-ic";
335 reg = <0x01c20400 0x400>; 464 reg = <0x01c20400 0x400>;
@@ -410,18 +539,18 @@
410 }; 539 };
411 540
412 wdt: watchdog@01c20c90 { 541 wdt: watchdog@01c20c90 {
413 compatible = "allwinner,sun4i-wdt"; 542 compatible = "allwinner,sun4i-a10-wdt";
414 reg = <0x01c20c90 0x10>; 543 reg = <0x01c20c90 0x10>;
415 }; 544 };
416 545
417 rtc: rtc@01c20d00 { 546 rtc: rtc@01c20d00 {
418 compatible = "allwinner,sun4i-rtc"; 547 compatible = "allwinner,sun4i-a10-rtc";
419 reg = <0x01c20d00 0x20>; 548 reg = <0x01c20d00 0x20>;
420 interrupts = <24>; 549 interrupts = <24>;
421 }; 550 };
422 551
423 sid: eeprom@01c23800 { 552 sid: eeprom@01c23800 {
424 compatible = "allwinner,sun4i-sid"; 553 compatible = "allwinner,sun4i-a10-sid";
425 reg = <0x01c23800 0x10>; 554 reg = <0x01c23800 0x10>;
426 }; 555 };
427 556
diff --git a/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts b/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
index 3c9f8b3cd3e3..23611b71d3aa 100644
--- a/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
+++ b/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
@@ -13,6 +13,7 @@
13 13
14/dts-v1/; 14/dts-v1/;
15/include/ "sun5i-a10s.dtsi" 15/include/ "sun5i-a10s.dtsi"
16/include/ "sunxi-common-regulators.dtsi"
16 17
17/ { 18/ {
18 model = "Olimex A10s-Olinuxino Micro"; 19 model = "Olimex A10s-Olinuxino Micro";
@@ -34,6 +35,19 @@
34 }; 35 };
35 }; 36 };
36 37
38 usbphy: phy@01c13400 {
39 usb1_vbus-supply = <&reg_usb1_vbus>;
40 status = "okay";
41 };
42
43 ehci0: usb@01c14000 {
44 status = "okay";
45 };
46
47 ohci0: usb@01c14400 {
48 status = "okay";
49 };
50
37 pinctrl@01c20800 { 51 pinctrl@01c20800 {
38 led_pins_olinuxino: led_pins@0 { 52 led_pins_olinuxino: led_pins@0 {
39 allwinner,pins = "PE3"; 53 allwinner,pins = "PE3";
@@ -41,6 +55,13 @@
41 allwinner,drive = <1>; 55 allwinner,drive = <1>;
42 allwinner,pull = <0>; 56 allwinner,pull = <0>;
43 }; 57 };
58
59 usb1_vbus_pin_olinuxino_m: usb1_vbus_pin@0 {
60 allwinner,pins = "PB10";
61 allwinner,function = "gpio_out";
62 allwinner,drive = <0>;
63 allwinner,pull = <0>;
64 };
44 }; 65 };
45 66
46 uart0: serial@01c28000 { 67 uart0: serial@01c28000 {
@@ -98,4 +119,10 @@
98 default-state = "on"; 119 default-state = "on";
99 }; 120 };
100 }; 121 };
122
123 reg_usb1_vbus: usb1-vbus {
124 pinctrl-0 = <&usb1_vbus_pin_olinuxino_m>;
125 gpio = <&pio 1 10 0>;
126 status = "okay";
127 };
101}; 128};
diff --git a/arch/arm/boot/dts/sun5i-a10s.dtsi b/arch/arm/boot/dts/sun5i-a10s.dtsi
index ddb25452d78e..79989ed5658d 100644
--- a/arch/arm/boot/dts/sun5i-a10s.dtsi
+++ b/arch/arm/boot/dts/sun5i-a10s.dtsi
@@ -18,6 +18,10 @@
18 18
19 aliases { 19 aliases {
20 ethernet0 = &emac; 20 ethernet0 = &emac;
21 serial0 = &uart0;
22 serial1 = &uart1;
23 serial2 = &uart2;
24 serial3 = &uart3;
21 }; 25 };
22 26
23 cpus { 27 cpus {
@@ -47,44 +51,48 @@
47 clock-frequency = <0>; 51 clock-frequency = <0>;
48 }; 52 };
49 53
50 osc24M: osc24M@01c20050 { 54 osc24M: clk@01c20050 {
51 #clock-cells = <0>; 55 #clock-cells = <0>;
52 compatible = "allwinner,sun4i-osc-clk"; 56 compatible = "allwinner,sun4i-a10-osc-clk";
53 reg = <0x01c20050 0x4>; 57 reg = <0x01c20050 0x4>;
54 clock-frequency = <24000000>; 58 clock-frequency = <24000000>;
59 clock-output-names = "osc24M";
55 }; 60 };
56 61
57 osc32k: osc32k { 62 osc32k: clk@0 {
58 #clock-cells = <0>; 63 #clock-cells = <0>;
59 compatible = "fixed-clock"; 64 compatible = "fixed-clock";
60 clock-frequency = <32768>; 65 clock-frequency = <32768>;
66 clock-output-names = "osc32k";
61 }; 67 };
62 68
63 pll1: pll1@01c20000 { 69 pll1: clk@01c20000 {
64 #clock-cells = <0>; 70 #clock-cells = <0>;
65 compatible = "allwinner,sun4i-pll1-clk"; 71 compatible = "allwinner,sun4i-a10-pll1-clk";
66 reg = <0x01c20000 0x4>; 72 reg = <0x01c20000 0x4>;
67 clocks = <&osc24M>; 73 clocks = <&osc24M>;
74 clock-output-names = "pll1";
68 }; 75 };
69 76
70 pll4: pll4@01c20018 { 77 pll4: clk@01c20018 {
71 #clock-cells = <0>; 78 #clock-cells = <0>;
72 compatible = "allwinner,sun4i-pll1-clk"; 79 compatible = "allwinner,sun4i-a10-pll1-clk";
73 reg = <0x01c20018 0x4>; 80 reg = <0x01c20018 0x4>;
74 clocks = <&osc24M>; 81 clocks = <&osc24M>;
82 clock-output-names = "pll4";
75 }; 83 };
76 84
77 pll5: pll5@01c20020 { 85 pll5: clk@01c20020 {
78 #clock-cells = <1>; 86 #clock-cells = <1>;
79 compatible = "allwinner,sun4i-pll5-clk"; 87 compatible = "allwinner,sun4i-a10-pll5-clk";
80 reg = <0x01c20020 0x4>; 88 reg = <0x01c20020 0x4>;
81 clocks = <&osc24M>; 89 clocks = <&osc24M>;
82 clock-output-names = "pll5_ddr", "pll5_other"; 90 clock-output-names = "pll5_ddr", "pll5_other";
83 }; 91 };
84 92
85 pll6: pll6@01c20028 { 93 pll6: clk@01c20028 {
86 #clock-cells = <1>; 94 #clock-cells = <1>;
87 compatible = "allwinner,sun4i-pll6-clk"; 95 compatible = "allwinner,sun4i-a10-pll6-clk";
88 reg = <0x01c20028 0x4>; 96 reg = <0x01c20028 0x4>;
89 clocks = <&osc24M>; 97 clocks = <&osc24M>;
90 clock-output-names = "pll6_sata", "pll6_other", "pll6"; 98 clock-output-names = "pll6_sata", "pll6_other", "pll6";
@@ -93,21 +101,23 @@
93 /* dummy is 200M */ 101 /* dummy is 200M */
94 cpu: cpu@01c20054 { 102 cpu: cpu@01c20054 {
95 #clock-cells = <0>; 103 #clock-cells = <0>;
96 compatible = "allwinner,sun4i-cpu-clk"; 104 compatible = "allwinner,sun4i-a10-cpu-clk";
97 reg = <0x01c20054 0x4>; 105 reg = <0x01c20054 0x4>;
98 clocks = <&osc32k>, <&osc24M>, <&pll1>, <&dummy>; 106 clocks = <&osc32k>, <&osc24M>, <&pll1>, <&dummy>;
107 clock-output-names = "cpu";
99 }; 108 };
100 109
101 axi: axi@01c20054 { 110 axi: axi@01c20054 {
102 #clock-cells = <0>; 111 #clock-cells = <0>;
103 compatible = "allwinner,sun4i-axi-clk"; 112 compatible = "allwinner,sun4i-a10-axi-clk";
104 reg = <0x01c20054 0x4>; 113 reg = <0x01c20054 0x4>;
105 clocks = <&cpu>; 114 clocks = <&cpu>;
115 clock-output-names = "axi";
106 }; 116 };
107 117
108 axi_gates: axi_gates@01c2005c { 118 axi_gates: clk@01c2005c {
109 #clock-cells = <1>; 119 #clock-cells = <1>;
110 compatible = "allwinner,sun4i-axi-gates-clk"; 120 compatible = "allwinner,sun4i-a10-axi-gates-clk";
111 reg = <0x01c2005c 0x4>; 121 reg = <0x01c2005c 0x4>;
112 clocks = <&axi>; 122 clocks = <&axi>;
113 clock-output-names = "axi_dram"; 123 clock-output-names = "axi_dram";
@@ -115,12 +125,13 @@
115 125
116 ahb: ahb@01c20054 { 126 ahb: ahb@01c20054 {
117 #clock-cells = <0>; 127 #clock-cells = <0>;
118 compatible = "allwinner,sun4i-ahb-clk"; 128 compatible = "allwinner,sun4i-a10-ahb-clk";
119 reg = <0x01c20054 0x4>; 129 reg = <0x01c20054 0x4>;
120 clocks = <&axi>; 130 clocks = <&axi>;
131 clock-output-names = "ahb";
121 }; 132 };
122 133
123 ahb_gates: ahb_gates@01c20060 { 134 ahb_gates: clk@01c20060 {
124 #clock-cells = <1>; 135 #clock-cells = <1>;
125 compatible = "allwinner,sun5i-a10s-ahb-gates-clk"; 136 compatible = "allwinner,sun5i-a10s-ahb-gates-clk";
126 reg = <0x01c20060 0x8>; 137 reg = <0x01c20060 0x8>;
@@ -136,12 +147,13 @@
136 147
137 apb0: apb0@01c20054 { 148 apb0: apb0@01c20054 {
138 #clock-cells = <0>; 149 #clock-cells = <0>;
139 compatible = "allwinner,sun4i-apb0-clk"; 150 compatible = "allwinner,sun4i-a10-apb0-clk";
140 reg = <0x01c20054 0x4>; 151 reg = <0x01c20054 0x4>;
141 clocks = <&ahb>; 152 clocks = <&ahb>;
153 clock-output-names = "apb0";
142 }; 154 };
143 155
144 apb0_gates: apb0_gates@01c20068 { 156 apb0_gates: clk@01c20068 {
145 #clock-cells = <1>; 157 #clock-cells = <1>;
146 compatible = "allwinner,sun5i-a10s-apb0-gates-clk"; 158 compatible = "allwinner,sun5i-a10s-apb0-gates-clk";
147 reg = <0x01c20068 0x4>; 159 reg = <0x01c20068 0x4>;
@@ -152,19 +164,21 @@
152 164
153 apb1_mux: apb1_mux@01c20058 { 165 apb1_mux: apb1_mux@01c20058 {
154 #clock-cells = <0>; 166 #clock-cells = <0>;
155 compatible = "allwinner,sun4i-apb1-mux-clk"; 167 compatible = "allwinner,sun4i-a10-apb1-mux-clk";
156 reg = <0x01c20058 0x4>; 168 reg = <0x01c20058 0x4>;
157 clocks = <&osc24M>, <&pll6 1>, <&osc32k>; 169 clocks = <&osc24M>, <&pll6 1>, <&osc32k>;
170 clock-output-names = "apb1_mux";
158 }; 171 };
159 172
160 apb1: apb1@01c20058 { 173 apb1: apb1@01c20058 {
161 #clock-cells = <0>; 174 #clock-cells = <0>;
162 compatible = "allwinner,sun4i-apb1-clk"; 175 compatible = "allwinner,sun4i-a10-apb1-clk";
163 reg = <0x01c20058 0x4>; 176 reg = <0x01c20058 0x4>;
164 clocks = <&apb1_mux>; 177 clocks = <&apb1_mux>;
178 clock-output-names = "apb1";
165 }; 179 };
166 180
167 apb1_gates: apb1_gates@01c2006c { 181 apb1_gates: clk@01c2006c {
168 #clock-cells = <1>; 182 #clock-cells = <1>;
169 compatible = "allwinner,sun5i-a10s-apb1-gates-clk"; 183 compatible = "allwinner,sun5i-a10s-apb1-gates-clk";
170 reg = <0x01c2006c 0x4>; 184 reg = <0x01c2006c 0x4>;
@@ -176,7 +190,7 @@
176 190
177 nand_clk: clk@01c20080 { 191 nand_clk: clk@01c20080 {
178 #clock-cells = <0>; 192 #clock-cells = <0>;
179 compatible = "allwinner,sun4i-mod0-clk"; 193 compatible = "allwinner,sun4i-a10-mod0-clk";
180 reg = <0x01c20080 0x4>; 194 reg = <0x01c20080 0x4>;
181 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 195 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
182 clock-output-names = "nand"; 196 clock-output-names = "nand";
@@ -184,7 +198,7 @@
184 198
185 ms_clk: clk@01c20084 { 199 ms_clk: clk@01c20084 {
186 #clock-cells = <0>; 200 #clock-cells = <0>;
187 compatible = "allwinner,sun4i-mod0-clk"; 201 compatible = "allwinner,sun4i-a10-mod0-clk";
188 reg = <0x01c20084 0x4>; 202 reg = <0x01c20084 0x4>;
189 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 203 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
190 clock-output-names = "ms"; 204 clock-output-names = "ms";
@@ -192,7 +206,7 @@
192 206
193 mmc0_clk: clk@01c20088 { 207 mmc0_clk: clk@01c20088 {
194 #clock-cells = <0>; 208 #clock-cells = <0>;
195 compatible = "allwinner,sun4i-mod0-clk"; 209 compatible = "allwinner,sun4i-a10-mod0-clk";
196 reg = <0x01c20088 0x4>; 210 reg = <0x01c20088 0x4>;
197 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 211 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
198 clock-output-names = "mmc0"; 212 clock-output-names = "mmc0";
@@ -200,7 +214,7 @@
200 214
201 mmc1_clk: clk@01c2008c { 215 mmc1_clk: clk@01c2008c {
202 #clock-cells = <0>; 216 #clock-cells = <0>;
203 compatible = "allwinner,sun4i-mod0-clk"; 217 compatible = "allwinner,sun4i-a10-mod0-clk";
204 reg = <0x01c2008c 0x4>; 218 reg = <0x01c2008c 0x4>;
205 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 219 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
206 clock-output-names = "mmc1"; 220 clock-output-names = "mmc1";
@@ -208,7 +222,7 @@
208 222
209 mmc2_clk: clk@01c20090 { 223 mmc2_clk: clk@01c20090 {
210 #clock-cells = <0>; 224 #clock-cells = <0>;
211 compatible = "allwinner,sun4i-mod0-clk"; 225 compatible = "allwinner,sun4i-a10-mod0-clk";
212 reg = <0x01c20090 0x4>; 226 reg = <0x01c20090 0x4>;
213 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 227 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
214 clock-output-names = "mmc2"; 228 clock-output-names = "mmc2";
@@ -216,7 +230,7 @@
216 230
217 ts_clk: clk@01c20098 { 231 ts_clk: clk@01c20098 {
218 #clock-cells = <0>; 232 #clock-cells = <0>;
219 compatible = "allwinner,sun4i-mod0-clk"; 233 compatible = "allwinner,sun4i-a10-mod0-clk";
220 reg = <0x01c20098 0x4>; 234 reg = <0x01c20098 0x4>;
221 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 235 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
222 clock-output-names = "ts"; 236 clock-output-names = "ts";
@@ -224,7 +238,7 @@
224 238
225 ss_clk: clk@01c2009c { 239 ss_clk: clk@01c2009c {
226 #clock-cells = <0>; 240 #clock-cells = <0>;
227 compatible = "allwinner,sun4i-mod0-clk"; 241 compatible = "allwinner,sun4i-a10-mod0-clk";
228 reg = <0x01c2009c 0x4>; 242 reg = <0x01c2009c 0x4>;
229 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 243 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
230 clock-output-names = "ss"; 244 clock-output-names = "ss";
@@ -232,7 +246,7 @@
232 246
233 spi0_clk: clk@01c200a0 { 247 spi0_clk: clk@01c200a0 {
234 #clock-cells = <0>; 248 #clock-cells = <0>;
235 compatible = "allwinner,sun4i-mod0-clk"; 249 compatible = "allwinner,sun4i-a10-mod0-clk";
236 reg = <0x01c200a0 0x4>; 250 reg = <0x01c200a0 0x4>;
237 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 251 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
238 clock-output-names = "spi0"; 252 clock-output-names = "spi0";
@@ -240,7 +254,7 @@
240 254
241 spi1_clk: clk@01c200a4 { 255 spi1_clk: clk@01c200a4 {
242 #clock-cells = <0>; 256 #clock-cells = <0>;
243 compatible = "allwinner,sun4i-mod0-clk"; 257 compatible = "allwinner,sun4i-a10-mod0-clk";
244 reg = <0x01c200a4 0x4>; 258 reg = <0x01c200a4 0x4>;
245 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 259 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
246 clock-output-names = "spi1"; 260 clock-output-names = "spi1";
@@ -248,7 +262,7 @@
248 262
249 spi2_clk: clk@01c200a8 { 263 spi2_clk: clk@01c200a8 {
250 #clock-cells = <0>; 264 #clock-cells = <0>;
251 compatible = "allwinner,sun4i-mod0-clk"; 265 compatible = "allwinner,sun4i-a10-mod0-clk";
252 reg = <0x01c200a8 0x4>; 266 reg = <0x01c200a8 0x4>;
253 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 267 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
254 clock-output-names = "spi2"; 268 clock-output-names = "spi2";
@@ -256,15 +270,24 @@
256 270
257 ir0_clk: clk@01c200b0 { 271 ir0_clk: clk@01c200b0 {
258 #clock-cells = <0>; 272 #clock-cells = <0>;
259 compatible = "allwinner,sun4i-mod0-clk"; 273 compatible = "allwinner,sun4i-a10-mod0-clk";
260 reg = <0x01c200b0 0x4>; 274 reg = <0x01c200b0 0x4>;
261 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 275 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
262 clock-output-names = "ir0"; 276 clock-output-names = "ir0";
263 }; 277 };
264 278
279 usb_clk: clk@01c200cc {
280 #clock-cells = <1>;
281 #reset-cells = <1>;
282 compatible = "allwinner,sun5i-a13-usb-clk";
283 reg = <0x01c200cc 0x4>;
284 clocks = <&pll6 1>;
285 clock-output-names = "usb_ohci0", "usb_phy";
286 };
287
265 mbus_clk: clk@01c2015c { 288 mbus_clk: clk@01c2015c {
266 #clock-cells = <0>; 289 #clock-cells = <0>;
267 compatible = "allwinner,sun4i-mod0-clk"; 290 compatible = "allwinner,sun4i-a10-mod0-clk";
268 reg = <0x01c2015c 0x4>; 291 reg = <0x01c2015c 0x4>;
269 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 292 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
270 clock-output-names = "mbus"; 293 clock-output-names = "mbus";
@@ -277,6 +300,28 @@
277 #size-cells = <1>; 300 #size-cells = <1>;
278 ranges; 301 ranges;
279 302
303 spi0: spi@01c05000 {
304 compatible = "allwinner,sun4i-a10-spi";
305 reg = <0x01c05000 0x1000>;
306 interrupts = <10>;
307 clocks = <&ahb_gates 20>, <&spi0_clk>;
308 clock-names = "ahb", "mod";
309 status = "disabled";
310 #address-cells = <1>;
311 #size-cells = <0>;
312 };
313
314 spi1: spi@01c06000 {
315 compatible = "allwinner,sun4i-a10-spi";
316 reg = <0x01c06000 0x1000>;
317 interrupts = <11>;
318 clocks = <&ahb_gates 21>, <&spi1_clk>;
319 clock-names = "ahb", "mod";
320 status = "disabled";
321 #address-cells = <1>;
322 #size-cells = <0>;
323 };
324
280 emac: ethernet@01c0b000 { 325 emac: ethernet@01c0b000 {
281 compatible = "allwinner,sun4i-a10-emac"; 326 compatible = "allwinner,sun4i-a10-emac";
282 reg = <0x01c0b000 0x1000>; 327 reg = <0x01c0b000 0x1000>;
@@ -293,6 +338,49 @@
293 #size-cells = <0>; 338 #size-cells = <0>;
294 }; 339 };
295 340
341 usbphy: phy@01c13400 {
342 #phy-cells = <1>;
343 compatible = "allwinner,sun5i-a13-usb-phy";
344 reg = <0x01c13400 0x10 0x01c14800 0x4>;
345 reg-names = "phy_ctrl", "pmu1";
346 clocks = <&usb_clk 8>;
347 clock-names = "usb_phy";
348 resets = <&usb_clk 1>;
349 reset-names = "usb1_reset";
350 status = "disabled";
351 };
352
353 ehci0: usb@01c14000 {
354 compatible = "allwinner,sun5i-a10s-ehci", "generic-ehci";
355 reg = <0x01c14000 0x100>;
356 interrupts = <39>;
357 clocks = <&ahb_gates 1>;
358 phys = <&usbphy 1>;
359 phy-names = "usb";
360 status = "disabled";
361 };
362
363 ohci0: usb@01c14400 {
364 compatible = "allwinner,sun5i-a10s-ohci", "generic-ohci";
365 reg = <0x01c14400 0x100>;
366 interrupts = <40>;
367 clocks = <&usb_clk 6>, <&ahb_gates 2>;
368 phys = <&usbphy 1>;
369 phy-names = "usb";
370 status = "disabled";
371 };
372
373 spi2: spi@01c17000 {
374 compatible = "allwinner,sun4i-a10-spi";
375 reg = <0x01c17000 0x1000>;
376 interrupts = <12>;
377 clocks = <&ahb_gates 22>, <&spi2_clk>;
378 clock-names = "ahb", "mod";
379 status = "disabled";
380 #address-cells = <1>;
381 #size-cells = <0>;
382 };
383
296 intc: interrupt-controller@01c20400 { 384 intc: interrupt-controller@01c20400 {
297 compatible = "allwinner,sun4i-a10-ic"; 385 compatible = "allwinner,sun4i-a10-ic";
298 reg = <0x01c20400 0x400>; 386 reg = <0x01c20400 0x400>;
@@ -373,12 +461,12 @@
373 }; 461 };
374 462
375 wdt: watchdog@01c20c90 { 463 wdt: watchdog@01c20c90 {
376 compatible = "allwinner,sun4i-wdt"; 464 compatible = "allwinner,sun4i-a10-wdt";
377 reg = <0x01c20c90 0x10>; 465 reg = <0x01c20c90 0x10>;
378 }; 466 };
379 467
380 sid: eeprom@01c23800 { 468 sid: eeprom@01c23800 {
381 compatible = "allwinner,sun4i-sid"; 469 compatible = "allwinner,sun4i-a10-sid";
382 reg = <0x01c23800 0x10>; 470 reg = <0x01c23800 0x10>;
383 }; 471 };
384 472
diff --git a/arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts b/arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts
index fe2ce0acdb06..11169d5b5b86 100644
--- a/arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts
+++ b/arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts
@@ -14,12 +14,26 @@
14 14
15/dts-v1/; 15/dts-v1/;
16/include/ "sun5i-a13.dtsi" 16/include/ "sun5i-a13.dtsi"
17/include/ "sunxi-common-regulators.dtsi"
17 18
18/ { 19/ {
19 model = "Olimex A13-Olinuxino Micro"; 20 model = "Olimex A13-Olinuxino Micro";
20 compatible = "olimex,a13-olinuxino-micro", "allwinner,sun5i-a13"; 21 compatible = "olimex,a13-olinuxino-micro", "allwinner,sun5i-a13";
21 22
22 soc@01c00000 { 23 soc@01c00000 {
24 usbphy: phy@01c13400 {
25 usb1_vbus-supply = <&reg_usb1_vbus>;
26 status = "okay";
27 };
28
29 ehci0: usb@01c14000 {
30 status = "okay";
31 };
32
33 ohci0: usb@01c14400 {
34 status = "okay";
35 };
36
23 pinctrl@01c20800 { 37 pinctrl@01c20800 {
24 led_pins_olinuxinom: led_pins@0 { 38 led_pins_olinuxinom: led_pins@0 {
25 allwinner,pins = "PG9"; 39 allwinner,pins = "PG9";
@@ -27,6 +41,13 @@
27 allwinner,drive = <1>; 41 allwinner,drive = <1>;
28 allwinner,pull = <0>; 42 allwinner,pull = <0>;
29 }; 43 };
44
45 usb1_vbus_pin_olinuxinom: usb1_vbus_pin@0 {
46 allwinner,pins = "PG11";
47 allwinner,function = "gpio_out";
48 allwinner,drive = <0>;
49 allwinner,pull = <0>;
50 };
30 }; 51 };
31 52
32 uart1: serial@01c28400 { 53 uart1: serial@01c28400 {
@@ -65,4 +86,10 @@
65 default-state = "on"; 86 default-state = "on";
66 }; 87 };
67 }; 88 };
89
90 reg_usb1_vbus: usb1-vbus {
91 pinctrl-0 = <&usb1_vbus_pin_olinuxinom>;
92 gpio = <&pio 6 11 0>;
93 status = "okay";
94 };
68}; 95};
diff --git a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
index a4ba5ff010cf..7a9187bbeb28 100644
--- a/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
+++ b/arch/arm/boot/dts/sun5i-a13-olinuxino.dts
@@ -13,12 +13,26 @@
13 13
14/dts-v1/; 14/dts-v1/;
15/include/ "sun5i-a13.dtsi" 15/include/ "sun5i-a13.dtsi"
16/include/ "sunxi-common-regulators.dtsi"
16 17
17/ { 18/ {
18 model = "Olimex A13-Olinuxino"; 19 model = "Olimex A13-Olinuxino";
19 compatible = "olimex,a13-olinuxino", "allwinner,sun5i-a13"; 20 compatible = "olimex,a13-olinuxino", "allwinner,sun5i-a13";
20 21
21 soc@01c00000 { 22 soc@01c00000 {
23 usbphy: phy@01c13400 {
24 usb1_vbus-supply = <&reg_usb1_vbus>;
25 status = "okay";
26 };
27
28 ehci0: usb@01c14000 {
29 status = "okay";
30 };
31
32 ohci0: usb@01c14400 {
33 status = "okay";
34 };
35
22 pinctrl@01c20800 { 36 pinctrl@01c20800 {
23 led_pins_olinuxino: led_pins@0 { 37 led_pins_olinuxino: led_pins@0 {
24 allwinner,pins = "PG9"; 38 allwinner,pins = "PG9";
@@ -26,6 +40,13 @@
26 allwinner,drive = <1>; 40 allwinner,drive = <1>;
27 allwinner,pull = <0>; 41 allwinner,pull = <0>;
28 }; 42 };
43
44 usb1_vbus_pin_olinuxino: usb1_vbus_pin@0 {
45 allwinner,pins = "PG11";
46 allwinner,function = "gpio_out";
47 allwinner,drive = <0>;
48 allwinner,pull = <0>;
49 };
29 }; 50 };
30 51
31 uart1: serial@01c28400 { 52 uart1: serial@01c28400 {
@@ -63,4 +84,10 @@
63 default-state = "on"; 84 default-state = "on";
64 }; 85 };
65 }; 86 };
87
88 reg_usb1_vbus: usb1-vbus {
89 pinctrl-0 = <&usb1_vbus_pin_olinuxino>;
90 gpio = <&pio 6 11 0>;
91 status = "okay";
92 };
66}; 93};
diff --git a/arch/arm/boot/dts/sun5i-a13.dtsi b/arch/arm/boot/dts/sun5i-a13.dtsi
index b373c74a9b3d..f01c315bdc4b 100644
--- a/arch/arm/boot/dts/sun5i-a13.dtsi
+++ b/arch/arm/boot/dts/sun5i-a13.dtsi
@@ -16,6 +16,11 @@
16/ { 16/ {
17 interrupt-parent = <&intc>; 17 interrupt-parent = <&intc>;
18 18
19 aliases {
20 serial0 = &uart1;
21 serial1 = &uart3;
22 };
23
19 cpus { 24 cpus {
20 #address-cells = <1>; 25 #address-cells = <1>;
21 #size-cells = <0>; 26 #size-cells = <0>;
@@ -47,44 +52,48 @@
47 clock-frequency = <0>; 52 clock-frequency = <0>;
48 }; 53 };
49 54
50 osc24M: osc24M@01c20050 { 55 osc24M: clk@01c20050 {
51 #clock-cells = <0>; 56 #clock-cells = <0>;
52 compatible = "allwinner,sun4i-osc-clk"; 57 compatible = "allwinner,sun4i-a10-osc-clk";
53 reg = <0x01c20050 0x4>; 58 reg = <0x01c20050 0x4>;
54 clock-frequency = <24000000>; 59 clock-frequency = <24000000>;
60 clock-output-names = "osc24M";
55 }; 61 };
56 62
57 osc32k: osc32k { 63 osc32k: clk@0 {
58 #clock-cells = <0>; 64 #clock-cells = <0>;
59 compatible = "fixed-clock"; 65 compatible = "fixed-clock";
60 clock-frequency = <32768>; 66 clock-frequency = <32768>;
67 clock-output-names = "osc32k";
61 }; 68 };
62 69
63 pll1: pll1@01c20000 { 70 pll1: clk@01c20000 {
64 #clock-cells = <0>; 71 #clock-cells = <0>;
65 compatible = "allwinner,sun4i-pll1-clk"; 72 compatible = "allwinner,sun4i-a10-pll1-clk";
66 reg = <0x01c20000 0x4>; 73 reg = <0x01c20000 0x4>;
67 clocks = <&osc24M>; 74 clocks = <&osc24M>;
75 clock-output-names = "pll1";
68 }; 76 };
69 77
70 pll4: pll4@01c20018 { 78 pll4: clk@01c20018 {
71 #clock-cells = <0>; 79 #clock-cells = <0>;
72 compatible = "allwinner,sun4i-pll1-clk"; 80 compatible = "allwinner,sun4i-a10-pll1-clk";
73 reg = <0x01c20018 0x4>; 81 reg = <0x01c20018 0x4>;
74 clocks = <&osc24M>; 82 clocks = <&osc24M>;
83 clock-output-names = "pll4";
75 }; 84 };
76 85
77 pll5: pll5@01c20020 { 86 pll5: clk@01c20020 {
78 #clock-cells = <1>; 87 #clock-cells = <1>;
79 compatible = "allwinner,sun4i-pll5-clk"; 88 compatible = "allwinner,sun4i-a10-pll5-clk";
80 reg = <0x01c20020 0x4>; 89 reg = <0x01c20020 0x4>;
81 clocks = <&osc24M>; 90 clocks = <&osc24M>;
82 clock-output-names = "pll5_ddr", "pll5_other"; 91 clock-output-names = "pll5_ddr", "pll5_other";
83 }; 92 };
84 93
85 pll6: pll6@01c20028 { 94 pll6: clk@01c20028 {
86 #clock-cells = <1>; 95 #clock-cells = <1>;
87 compatible = "allwinner,sun4i-pll6-clk"; 96 compatible = "allwinner,sun4i-a10-pll6-clk";
88 reg = <0x01c20028 0x4>; 97 reg = <0x01c20028 0x4>;
89 clocks = <&osc24M>; 98 clocks = <&osc24M>;
90 clock-output-names = "pll6_sata", "pll6_other", "pll6"; 99 clock-output-names = "pll6_sata", "pll6_other", "pll6";
@@ -93,21 +102,23 @@
93 /* dummy is 200M */ 102 /* dummy is 200M */
94 cpu: cpu@01c20054 { 103 cpu: cpu@01c20054 {
95 #clock-cells = <0>; 104 #clock-cells = <0>;
96 compatible = "allwinner,sun4i-cpu-clk"; 105 compatible = "allwinner,sun4i-a10-cpu-clk";
97 reg = <0x01c20054 0x4>; 106 reg = <0x01c20054 0x4>;
98 clocks = <&osc32k>, <&osc24M>, <&pll1>, <&dummy>; 107 clocks = <&osc32k>, <&osc24M>, <&pll1>, <&dummy>;
108 clock-output-names = "cpu";
99 }; 109 };
100 110
101 axi: axi@01c20054 { 111 axi: axi@01c20054 {
102 #clock-cells = <0>; 112 #clock-cells = <0>;
103 compatible = "allwinner,sun4i-axi-clk"; 113 compatible = "allwinner,sun4i-a10-axi-clk";
104 reg = <0x01c20054 0x4>; 114 reg = <0x01c20054 0x4>;
105 clocks = <&cpu>; 115 clocks = <&cpu>;
116 clock-output-names = "axi";
106 }; 117 };
107 118
108 axi_gates: axi_gates@01c2005c { 119 axi_gates: clk@01c2005c {
109 #clock-cells = <1>; 120 #clock-cells = <1>;
110 compatible = "allwinner,sun4i-axi-gates-clk"; 121 compatible = "allwinner,sun4i-a10-axi-gates-clk";
111 reg = <0x01c2005c 0x4>; 122 reg = <0x01c2005c 0x4>;
112 clocks = <&axi>; 123 clocks = <&axi>;
113 clock-output-names = "axi_dram"; 124 clock-output-names = "axi_dram";
@@ -115,12 +126,13 @@
115 126
116 ahb: ahb@01c20054 { 127 ahb: ahb@01c20054 {
117 #clock-cells = <0>; 128 #clock-cells = <0>;
118 compatible = "allwinner,sun4i-ahb-clk"; 129 compatible = "allwinner,sun4i-a10-ahb-clk";
119 reg = <0x01c20054 0x4>; 130 reg = <0x01c20054 0x4>;
120 clocks = <&axi>; 131 clocks = <&axi>;
132 clock-output-names = "ahb";
121 }; 133 };
122 134
123 ahb_gates: ahb_gates@01c20060 { 135 ahb_gates: clk@01c20060 {
124 #clock-cells = <1>; 136 #clock-cells = <1>;
125 compatible = "allwinner,sun5i-a13-ahb-gates-clk"; 137 compatible = "allwinner,sun5i-a13-ahb-gates-clk";
126 reg = <0x01c20060 0x8>; 138 reg = <0x01c20060 0x8>;
@@ -135,12 +147,13 @@
135 147
136 apb0: apb0@01c20054 { 148 apb0: apb0@01c20054 {
137 #clock-cells = <0>; 149 #clock-cells = <0>;
138 compatible = "allwinner,sun4i-apb0-clk"; 150 compatible = "allwinner,sun4i-a10-apb0-clk";
139 reg = <0x01c20054 0x4>; 151 reg = <0x01c20054 0x4>;
140 clocks = <&ahb>; 152 clocks = <&ahb>;
153 clock-output-names = "apb0";
141 }; 154 };
142 155
143 apb0_gates: apb0_gates@01c20068 { 156 apb0_gates: clk@01c20068 {
144 #clock-cells = <1>; 157 #clock-cells = <1>;
145 compatible = "allwinner,sun5i-a13-apb0-gates-clk"; 158 compatible = "allwinner,sun5i-a13-apb0-gates-clk";
146 reg = <0x01c20068 0x4>; 159 reg = <0x01c20068 0x4>;
@@ -150,19 +163,21 @@
150 163
151 apb1_mux: apb1_mux@01c20058 { 164 apb1_mux: apb1_mux@01c20058 {
152 #clock-cells = <0>; 165 #clock-cells = <0>;
153 compatible = "allwinner,sun4i-apb1-mux-clk"; 166 compatible = "allwinner,sun4i-a10-apb1-mux-clk";
154 reg = <0x01c20058 0x4>; 167 reg = <0x01c20058 0x4>;
155 clocks = <&osc24M>, <&pll6 1>, <&osc32k>; 168 clocks = <&osc24M>, <&pll6 1>, <&osc32k>;
169 clock-output-names = "apb1_mux";
156 }; 170 };
157 171
158 apb1: apb1@01c20058 { 172 apb1: apb1@01c20058 {
159 #clock-cells = <0>; 173 #clock-cells = <0>;
160 compatible = "allwinner,sun4i-apb1-clk"; 174 compatible = "allwinner,sun4i-a10-apb1-clk";
161 reg = <0x01c20058 0x4>; 175 reg = <0x01c20058 0x4>;
162 clocks = <&apb1_mux>; 176 clocks = <&apb1_mux>;
177 clock-output-names = "apb1";
163 }; 178 };
164 179
165 apb1_gates: apb1_gates@01c2006c { 180 apb1_gates: clk@01c2006c {
166 #clock-cells = <1>; 181 #clock-cells = <1>;
167 compatible = "allwinner,sun5i-a13-apb1-gates-clk"; 182 compatible = "allwinner,sun5i-a13-apb1-gates-clk";
168 reg = <0x01c2006c 0x4>; 183 reg = <0x01c2006c 0x4>;
@@ -173,7 +188,7 @@
173 188
174 nand_clk: clk@01c20080 { 189 nand_clk: clk@01c20080 {
175 #clock-cells = <0>; 190 #clock-cells = <0>;
176 compatible = "allwinner,sun4i-mod0-clk"; 191 compatible = "allwinner,sun4i-a10-mod0-clk";
177 reg = <0x01c20080 0x4>; 192 reg = <0x01c20080 0x4>;
178 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 193 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
179 clock-output-names = "nand"; 194 clock-output-names = "nand";
@@ -181,7 +196,7 @@
181 196
182 ms_clk: clk@01c20084 { 197 ms_clk: clk@01c20084 {
183 #clock-cells = <0>; 198 #clock-cells = <0>;
184 compatible = "allwinner,sun4i-mod0-clk"; 199 compatible = "allwinner,sun4i-a10-mod0-clk";
185 reg = <0x01c20084 0x4>; 200 reg = <0x01c20084 0x4>;
186 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 201 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
187 clock-output-names = "ms"; 202 clock-output-names = "ms";
@@ -189,7 +204,7 @@
189 204
190 mmc0_clk: clk@01c20088 { 205 mmc0_clk: clk@01c20088 {
191 #clock-cells = <0>; 206 #clock-cells = <0>;
192 compatible = "allwinner,sun4i-mod0-clk"; 207 compatible = "allwinner,sun4i-a10-mod0-clk";
193 reg = <0x01c20088 0x4>; 208 reg = <0x01c20088 0x4>;
194 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 209 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
195 clock-output-names = "mmc0"; 210 clock-output-names = "mmc0";
@@ -197,7 +212,7 @@
197 212
198 mmc1_clk: clk@01c2008c { 213 mmc1_clk: clk@01c2008c {
199 #clock-cells = <0>; 214 #clock-cells = <0>;
200 compatible = "allwinner,sun4i-mod0-clk"; 215 compatible = "allwinner,sun4i-a10-mod0-clk";
201 reg = <0x01c2008c 0x4>; 216 reg = <0x01c2008c 0x4>;
202 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 217 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
203 clock-output-names = "mmc1"; 218 clock-output-names = "mmc1";
@@ -205,7 +220,7 @@
205 220
206 mmc2_clk: clk@01c20090 { 221 mmc2_clk: clk@01c20090 {
207 #clock-cells = <0>; 222 #clock-cells = <0>;
208 compatible = "allwinner,sun4i-mod0-clk"; 223 compatible = "allwinner,sun4i-a10-mod0-clk";
209 reg = <0x01c20090 0x4>; 224 reg = <0x01c20090 0x4>;
210 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 225 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
211 clock-output-names = "mmc2"; 226 clock-output-names = "mmc2";
@@ -213,7 +228,7 @@
213 228
214 ts_clk: clk@01c20098 { 229 ts_clk: clk@01c20098 {
215 #clock-cells = <0>; 230 #clock-cells = <0>;
216 compatible = "allwinner,sun4i-mod0-clk"; 231 compatible = "allwinner,sun4i-a10-mod0-clk";
217 reg = <0x01c20098 0x4>; 232 reg = <0x01c20098 0x4>;
218 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 233 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
219 clock-output-names = "ts"; 234 clock-output-names = "ts";
@@ -221,7 +236,7 @@
221 236
222 ss_clk: clk@01c2009c { 237 ss_clk: clk@01c2009c {
223 #clock-cells = <0>; 238 #clock-cells = <0>;
224 compatible = "allwinner,sun4i-mod0-clk"; 239 compatible = "allwinner,sun4i-a10-mod0-clk";
225 reg = <0x01c2009c 0x4>; 240 reg = <0x01c2009c 0x4>;
226 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 241 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
227 clock-output-names = "ss"; 242 clock-output-names = "ss";
@@ -229,7 +244,7 @@
229 244
230 spi0_clk: clk@01c200a0 { 245 spi0_clk: clk@01c200a0 {
231 #clock-cells = <0>; 246 #clock-cells = <0>;
232 compatible = "allwinner,sun4i-mod0-clk"; 247 compatible = "allwinner,sun4i-a10-mod0-clk";
233 reg = <0x01c200a0 0x4>; 248 reg = <0x01c200a0 0x4>;
234 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 249 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
235 clock-output-names = "spi0"; 250 clock-output-names = "spi0";
@@ -237,7 +252,7 @@
237 252
238 spi1_clk: clk@01c200a4 { 253 spi1_clk: clk@01c200a4 {
239 #clock-cells = <0>; 254 #clock-cells = <0>;
240 compatible = "allwinner,sun4i-mod0-clk"; 255 compatible = "allwinner,sun4i-a10-mod0-clk";
241 reg = <0x01c200a4 0x4>; 256 reg = <0x01c200a4 0x4>;
242 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 257 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
243 clock-output-names = "spi1"; 258 clock-output-names = "spi1";
@@ -245,7 +260,7 @@
245 260
246 spi2_clk: clk@01c200a8 { 261 spi2_clk: clk@01c200a8 {
247 #clock-cells = <0>; 262 #clock-cells = <0>;
248 compatible = "allwinner,sun4i-mod0-clk"; 263 compatible = "allwinner,sun4i-a10-mod0-clk";
249 reg = <0x01c200a8 0x4>; 264 reg = <0x01c200a8 0x4>;
250 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 265 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
251 clock-output-names = "spi2"; 266 clock-output-names = "spi2";
@@ -253,15 +268,24 @@
253 268
254 ir0_clk: clk@01c200b0 { 269 ir0_clk: clk@01c200b0 {
255 #clock-cells = <0>; 270 #clock-cells = <0>;
256 compatible = "allwinner,sun4i-mod0-clk"; 271 compatible = "allwinner,sun4i-a10-mod0-clk";
257 reg = <0x01c200b0 0x4>; 272 reg = <0x01c200b0 0x4>;
258 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 273 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
259 clock-output-names = "ir0"; 274 clock-output-names = "ir0";
260 }; 275 };
261 276
277 usb_clk: clk@01c200cc {
278 #clock-cells = <1>;
279 #reset-cells = <1>;
280 compatible = "allwinner,sun5i-a13-usb-clk";
281 reg = <0x01c200cc 0x4>;
282 clocks = <&pll6 1>;
283 clock-output-names = "usb_ohci0", "usb_phy";
284 };
285
262 mbus_clk: clk@01c2015c { 286 mbus_clk: clk@01c2015c {
263 #clock-cells = <0>; 287 #clock-cells = <0>;
264 compatible = "allwinner,sun4i-mod0-clk"; 288 compatible = "allwinner,sun4i-a10-mod0-clk";
265 reg = <0x01c2015c 0x4>; 289 reg = <0x01c2015c 0x4>;
266 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 290 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
267 clock-output-names = "mbus"; 291 clock-output-names = "mbus";
@@ -274,6 +298,71 @@
274 #size-cells = <1>; 298 #size-cells = <1>;
275 ranges; 299 ranges;
276 300
301 spi0: spi@01c05000 {
302 compatible = "allwinner,sun4i-a10-spi";
303 reg = <0x01c05000 0x1000>;
304 interrupts = <10>;
305 clocks = <&ahb_gates 20>, <&spi0_clk>;
306 clock-names = "ahb", "mod";
307 status = "disabled";
308 #address-cells = <1>;
309 #size-cells = <0>;
310 };
311
312 spi1: spi@01c06000 {
313 compatible = "allwinner,sun4i-a10-spi";
314 reg = <0x01c06000 0x1000>;
315 interrupts = <11>;
316 clocks = <&ahb_gates 21>, <&spi1_clk>;
317 clock-names = "ahb", "mod";
318 status = "disabled";
319 #address-cells = <1>;
320 #size-cells = <0>;
321 };
322
323 usbphy: phy@01c13400 {
324 #phy-cells = <1>;
325 compatible = "allwinner,sun5i-a13-usb-phy";
326 reg = <0x01c13400 0x10 0x01c14800 0x4>;
327 reg-names = "phy_ctrl", "pmu1";
328 clocks = <&usb_clk 8>;
329 clock-names = "usb_phy";
330 resets = <&usb_clk 1>;
331 reset-names = "usb1_reset";
332 status = "disabled";
333 };
334
335 ehci0: usb@01c14000 {
336 compatible = "allwinner,sun5i-a13-ehci", "generic-ehci";
337 reg = <0x01c14000 0x100>;
338 interrupts = <39>;
339 clocks = <&ahb_gates 1>;
340 phys = <&usbphy 1>;
341 phy-names = "usb";
342 status = "disabled";
343 };
344
345 ohci0: usb@01c14400 {
346 compatible = "allwinner,sun5i-a13-ohci", "generic-ohci";
347 reg = <0x01c14400 0x100>;
348 interrupts = <40>;
349 clocks = <&usb_clk 6>, <&ahb_gates 2>;
350 phys = <&usbphy 1>;
351 phy-names = "usb";
352 status = "disabled";
353 };
354
355 spi2: spi@01c17000 {
356 compatible = "allwinner,sun4i-a10-spi";
357 reg = <0x01c17000 0x1000>;
358 interrupts = <12>;
359 clocks = <&ahb_gates 22>, <&spi2_clk>;
360 clock-names = "ahb", "mod";
361 status = "disabled";
362 #address-cells = <1>;
363 #size-cells = <0>;
364 };
365
277 intc: interrupt-controller@01c20400 { 366 intc: interrupt-controller@01c20400 {
278 compatible = "allwinner,sun4i-a10-ic"; 367 compatible = "allwinner,sun4i-a10-ic";
279 reg = <0x01c20400 0x400>; 368 reg = <0x01c20400 0x400>;
@@ -336,12 +425,12 @@
336 }; 425 };
337 426
338 wdt: watchdog@01c20c90 { 427 wdt: watchdog@01c20c90 {
339 compatible = "allwinner,sun4i-wdt"; 428 compatible = "allwinner,sun4i-a10-wdt";
340 reg = <0x01c20c90 0x10>; 429 reg = <0x01c20c90 0x10>;
341 }; 430 };
342 431
343 sid: eeprom@01c23800 { 432 sid: eeprom@01c23800 {
344 compatible = "allwinner,sun4i-sid"; 433 compatible = "allwinner,sun4i-a10-sid";
345 reg = <0x01c23800 0x10>; 434 reg = <0x01c23800 0x10>;
346 }; 435 };
347 436
diff --git a/arch/arm/boot/dts/sun6i-a31-colombus.dts b/arch/arm/boot/dts/sun6i-a31-colombus.dts
index e5adae30899b..3898a7bce831 100644
--- a/arch/arm/boot/dts/sun6i-a31-colombus.dts
+++ b/arch/arm/boot/dts/sun6i-a31-colombus.dts
@@ -28,5 +28,23 @@
28 pinctrl-0 = <&uart0_pins_a>; 28 pinctrl-0 = <&uart0_pins_a>;
29 status = "okay"; 29 status = "okay";
30 }; 30 };
31
32 i2c0: i2c@01c2ac00 {
33 pinctrl-names = "default";
34 pinctrl-0 = <&i2c0_pins_a>;
35 status = "fail";
36 };
37
38 i2c1: i2c@01c2b000 {
39 pinctrl-names = "default";
40 pinctrl-0 = <&i2c1_pins_a>;
41 status = "okay";
42 };
43
44 i2c2: i2c@01c2b400 {
45 pinctrl-names = "default";
46 pinctrl-0 = <&i2c2_pins_a>;
47 status = "okay";
48 };
31 }; 49 };
32}; 50};
diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi
index 38d43febda4c..d45efa74827c 100644
--- a/arch/arm/boot/dts/sun6i-a31.dtsi
+++ b/arch/arm/boot/dts/sun6i-a31.dtsi
@@ -16,6 +16,16 @@
16/ { 16/ {
17 interrupt-parent = <&gic>; 17 interrupt-parent = <&gic>;
18 18
19 aliases {
20 serial0 = &uart0;
21 serial1 = &uart1;
22 serial2 = &uart2;
23 serial3 = &uart3;
24 serial4 = &uart4;
25 serial5 = &uart5;
26 };
27
28
19 cpus { 29 cpus {
20 #address-cells = <1>; 30 #address-cells = <1>;
21 #size-cells = <0>; 31 #size-cells = <0>;
@@ -60,34 +70,32 @@
60 clock-frequency = <24000000>; 70 clock-frequency = <24000000>;
61 }; 71 };
62 72
63 osc32k: osc32k { 73 osc32k: clk@0 {
64 #clock-cells = <0>; 74 #clock-cells = <0>;
65 compatible = "fixed-clock"; 75 compatible = "fixed-clock";
66 clock-frequency = <32768>; 76 clock-frequency = <32768>;
77 clock-output-names = "osc32k";
67 }; 78 };
68 79
69 pll1: pll1@01c20000 { 80 pll1: clk@01c20000 {
70 #clock-cells = <0>; 81 #clock-cells = <0>;
71 compatible = "allwinner,sun6i-a31-pll1-clk"; 82 compatible = "allwinner,sun6i-a31-pll1-clk";
72 reg = <0x01c20000 0x4>; 83 reg = <0x01c20000 0x4>;
73 clocks = <&osc24M>; 84 clocks = <&osc24M>;
85 clock-output-names = "pll1";
74 }; 86 };
75 87
76 /* 88 pll6: clk@01c20028 {
77 * This is a dummy clock, to be used as placeholder on
78 * other mux clocks when a specific parent clock is not
79 * yet implemented. It should be dropped when the driver
80 * is complete.
81 */
82 pll6: pll6 {
83 #clock-cells = <0>; 89 #clock-cells = <0>;
84 compatible = "fixed-clock"; 90 compatible = "allwinner,sun6i-a31-pll6-clk";
85 clock-frequency = <0>; 91 reg = <0x01c20028 0x4>;
92 clocks = <&osc24M>;
93 clock-output-names = "pll6";
86 }; 94 };
87 95
88 cpu: cpu@01c20050 { 96 cpu: cpu@01c20050 {
89 #clock-cells = <0>; 97 #clock-cells = <0>;
90 compatible = "allwinner,sun4i-cpu-clk"; 98 compatible = "allwinner,sun4i-a10-cpu-clk";
91 reg = <0x01c20050 0x4>; 99 reg = <0x01c20050 0x4>;
92 100
93 /* 101 /*
@@ -97,13 +105,15 @@
97 * Allwinner. 105 * Allwinner.
98 */ 106 */
99 clocks = <&osc32k>, <&osc24M>, <&pll1>, <&pll1>; 107 clocks = <&osc32k>, <&osc24M>, <&pll1>, <&pll1>;
108 clock-output-names = "cpu";
100 }; 109 };
101 110
102 axi: axi@01c20050 { 111 axi: axi@01c20050 {
103 #clock-cells = <0>; 112 #clock-cells = <0>;
104 compatible = "allwinner,sun4i-axi-clk"; 113 compatible = "allwinner,sun4i-a10-axi-clk";
105 reg = <0x01c20050 0x4>; 114 reg = <0x01c20050 0x4>;
106 clocks = <&cpu>; 115 clocks = <&cpu>;
116 clock-output-names = "axi";
107 }; 117 };
108 118
109 ahb1_mux: ahb1_mux@01c20054 { 119 ahb1_mux: ahb1_mux@01c20054 {
@@ -111,16 +121,18 @@
111 compatible = "allwinner,sun6i-a31-ahb1-mux-clk"; 121 compatible = "allwinner,sun6i-a31-ahb1-mux-clk";
112 reg = <0x01c20054 0x4>; 122 reg = <0x01c20054 0x4>;
113 clocks = <&osc32k>, <&osc24M>, <&axi>, <&pll6>; 123 clocks = <&osc32k>, <&osc24M>, <&axi>, <&pll6>;
124 clock-output-names = "ahb1_mux";
114 }; 125 };
115 126
116 ahb1: ahb1@01c20054 { 127 ahb1: ahb1@01c20054 {
117 #clock-cells = <0>; 128 #clock-cells = <0>;
118 compatible = "allwinner,sun4i-ahb-clk"; 129 compatible = "allwinner,sun4i-a10-ahb-clk";
119 reg = <0x01c20054 0x4>; 130 reg = <0x01c20054 0x4>;
120 clocks = <&ahb1_mux>; 131 clocks = <&ahb1_mux>;
132 clock-output-names = "ahb1";
121 }; 133 };
122 134
123 ahb1_gates: ahb1_gates@01c20060 { 135 ahb1_gates: clk@01c20060 {
124 #clock-cells = <1>; 136 #clock-cells = <1>;
125 compatible = "allwinner,sun6i-a31-ahb1-gates-clk"; 137 compatible = "allwinner,sun6i-a31-ahb1-gates-clk";
126 reg = <0x01c20060 0x8>; 138 reg = <0x01c20060 0x8>;
@@ -143,12 +155,13 @@
143 155
144 apb1: apb1@01c20054 { 156 apb1: apb1@01c20054 {
145 #clock-cells = <0>; 157 #clock-cells = <0>;
146 compatible = "allwinner,sun4i-apb0-clk"; 158 compatible = "allwinner,sun4i-a10-apb0-clk";
147 reg = <0x01c20054 0x4>; 159 reg = <0x01c20054 0x4>;
148 clocks = <&ahb1>; 160 clocks = <&ahb1>;
161 clock-output-names = "apb1";
149 }; 162 };
150 163
151 apb1_gates: apb1_gates@01c20060 { 164 apb1_gates: clk@01c20068 {
152 #clock-cells = <1>; 165 #clock-cells = <1>;
153 compatible = "allwinner,sun6i-a31-apb1-gates-clk"; 166 compatible = "allwinner,sun6i-a31-apb1-gates-clk";
154 reg = <0x01c20068 0x4>; 167 reg = <0x01c20068 0x4>;
@@ -160,9 +173,10 @@
160 173
161 apb2_mux: apb2_mux@01c20058 { 174 apb2_mux: apb2_mux@01c20058 {
162 #clock-cells = <0>; 175 #clock-cells = <0>;
163 compatible = "allwinner,sun4i-apb1-mux-clk"; 176 compatible = "allwinner,sun4i-a10-apb1-mux-clk";
164 reg = <0x01c20058 0x4>; 177 reg = <0x01c20058 0x4>;
165 clocks = <&osc32k>, <&osc24M>, <&pll6>, <&pll6>; 178 clocks = <&osc32k>, <&osc24M>, <&pll6>, <&pll6>;
179 clock-output-names = "apb2_mux";
166 }; 180 };
167 181
168 apb2: apb2@01c20058 { 182 apb2: apb2@01c20058 {
@@ -170,9 +184,10 @@
170 compatible = "allwinner,sun6i-a31-apb2-div-clk"; 184 compatible = "allwinner,sun6i-a31-apb2-div-clk";
171 reg = <0x01c20058 0x4>; 185 reg = <0x01c20058 0x4>;
172 clocks = <&apb2_mux>; 186 clocks = <&apb2_mux>;
187 clock-output-names = "apb2";
173 }; 188 };
174 189
175 apb2_gates: apb2_gates@01c2006c { 190 apb2_gates: clk@01c2006c {
176 #clock-cells = <1>; 191 #clock-cells = <1>;
177 compatible = "allwinner,sun6i-a31-apb2-gates-clk"; 192 compatible = "allwinner,sun6i-a31-apb2-gates-clk";
178 reg = <0x01c2006c 0x4>; 193 reg = <0x01c2006c 0x4>;
@@ -182,6 +197,38 @@
182 "apb2_uart1", "apb2_uart2", "apb2_uart3", 197 "apb2_uart1", "apb2_uart2", "apb2_uart3",
183 "apb2_uart4", "apb2_uart5"; 198 "apb2_uart4", "apb2_uart5";
184 }; 199 };
200
201 spi0_clk: clk@01c200a0 {
202 #clock-cells = <0>;
203 compatible = "allwinner,sun4i-a10-mod0-clk";
204 reg = <0x01c200a0 0x4>;
205 clocks = <&osc24M>, <&pll6>;
206 clock-output-names = "spi0";
207 };
208
209 spi1_clk: clk@01c200a4 {
210 #clock-cells = <0>;
211 compatible = "allwinner,sun4i-a10-mod0-clk";
212 reg = <0x01c200a4 0x4>;
213 clocks = <&osc24M>, <&pll6>;
214 clock-output-names = "spi1";
215 };
216
217 spi2_clk: clk@01c200a8 {
218 #clock-cells = <0>;
219 compatible = "allwinner,sun4i-a10-mod0-clk";
220 reg = <0x01c200a8 0x4>;
221 clocks = <&osc24M>, <&pll6>;
222 clock-output-names = "spi2";
223 };
224
225 spi3_clk: clk@01c200ac {
226 #clock-cells = <0>;
227 compatible = "allwinner,sun4i-a10-mod0-clk";
228 reg = <0x01c200ac 0x4>;
229 clocks = <&osc24M>, <&pll6>;
230 clock-output-names = "spi3";
231 };
185 }; 232 };
186 233
187 soc@01c00000 { 234 soc@01c00000 {
@@ -218,6 +265,27 @@
218 allwinner,drive = <0>; 265 allwinner,drive = <0>;
219 allwinner,pull = <0>; 266 allwinner,pull = <0>;
220 }; 267 };
268
269 i2c0_pins_a: i2c0@0 {
270 allwinner,pins = "PH14", "PH15";
271 allwinner,function = "i2c0";
272 allwinner,drive = <0>;
273 allwinner,pull = <0>;
274 };
275
276 i2c1_pins_a: i2c1@0 {
277 allwinner,pins = "PH16", "PH17";
278 allwinner,function = "i2c1";
279 allwinner,drive = <0>;
280 allwinner,pull = <0>;
281 };
282
283 i2c2_pins_a: i2c2@0 {
284 allwinner,pins = "PH18", "PH19";
285 allwinner,function = "i2c2";
286 allwinner,drive = <0>;
287 allwinner,pull = <0>;
288 };
221 }; 289 };
222 290
223 ahb1_rst: reset@01c202c0 { 291 ahb1_rst: reset@01c202c0 {
@@ -250,7 +318,7 @@
250 }; 318 };
251 319
252 wdt1: watchdog@01c20ca0 { 320 wdt1: watchdog@01c20ca0 {
253 compatible = "allwinner,sun6i-wdt"; 321 compatible = "allwinner,sun6i-a31-wdt";
254 reg = <0x01c20ca0 0x20>; 322 reg = <0x01c20ca0 0x20>;
255 }; 323 };
256 324
@@ -320,6 +388,86 @@
320 status = "disabled"; 388 status = "disabled";
321 }; 389 };
322 390
391 i2c0: i2c@01c2ac00 {
392 compatible = "allwinner,sun6i-a31-i2c";
393 reg = <0x01c2ac00 0x400>;
394 interrupts = <0 6 4>;
395 clocks = <&apb2_gates 0>;
396 clock-frequency = <100000>;
397 resets = <&apb2_rst 0>;
398 status = "disabled";
399 };
400
401 i2c1: i2c@01c2b000 {
402 compatible = "allwinner,sun6i-a31-i2c";
403 reg = <0x01c2b000 0x400>;
404 interrupts = <0 7 4>;
405 clocks = <&apb2_gates 1>;
406 clock-frequency = <100000>;
407 resets = <&apb2_rst 1>;
408 status = "disabled";
409 };
410
411 i2c2: i2c@01c2b400 {
412 compatible = "allwinner,sun6i-a31-i2c";
413 reg = <0x01c2b400 0x400>;
414 interrupts = <0 8 4>;
415 clocks = <&apb2_gates 2>;
416 clock-frequency = <100000>;
417 resets = <&apb2_rst 2>;
418 status = "disabled";
419 };
420
421 i2c3: i2c@01c2b800 {
422 compatible = "allwinner,sun6i-a31-i2c";
423 reg = <0x01c2b800 0x400>;
424 interrupts = <0 9 4>;
425 clocks = <&apb2_gates 3>;
426 clock-frequency = <100000>;
427 resets = <&apb2_rst 3>;
428 status = "disabled";
429 };
430
431 spi0: spi@01c68000 {
432 compatible = "allwinner,sun6i-a31-spi";
433 reg = <0x01c68000 0x1000>;
434 interrupts = <0 65 4>;
435 clocks = <&ahb1_gates 20>, <&spi0_clk>;
436 clock-names = "ahb", "mod";
437 resets = <&ahb1_rst 20>;
438 status = "disabled";
439 };
440
441 spi1: spi@01c69000 {
442 compatible = "allwinner,sun6i-a31-spi";
443 reg = <0x01c69000 0x1000>;
444 interrupts = <0 66 4>;
445 clocks = <&ahb1_gates 21>, <&spi1_clk>;
446 clock-names = "ahb", "mod";
447 resets = <&ahb1_rst 21>;
448 status = "disabled";
449 };
450
451 spi2: spi@01c6a000 {
452 compatible = "allwinner,sun6i-a31-spi";
453 reg = <0x01c6a000 0x1000>;
454 interrupts = <0 67 4>;
455 clocks = <&ahb1_gates 22>, <&spi2_clk>;
456 clock-names = "ahb", "mod";
457 resets = <&ahb1_rst 22>;
458 status = "disabled";
459 };
460
461 spi3: spi@01c6b000 {
462 compatible = "allwinner,sun6i-a31-spi";
463 reg = <0x01c6b000 0x1000>;
464 interrupts = <0 68 4>;
465 clocks = <&ahb1_gates 23>, <&spi3_clk>;
466 clock-names = "ahb", "mod";
467 resets = <&ahb1_rst 23>;
468 status = "disabled";
469 };
470
323 gic: interrupt-controller@01c81000 { 471 gic: interrupt-controller@01c81000 {
324 compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic"; 472 compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";
325 reg = <0x01c81000 0x1000>, 473 reg = <0x01c81000 0x1000>,
diff --git a/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts b/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
index 5c51cb8a98b0..68de89ffbdfa 100644
--- a/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
+++ b/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
@@ -13,25 +13,38 @@
13 13
14/dts-v1/; 14/dts-v1/;
15/include/ "sun7i-a20.dtsi" 15/include/ "sun7i-a20.dtsi"
16/include/ "sunxi-common-regulators.dtsi"
16 17
17/ { 18/ {
18 model = "Cubietech Cubieboard2"; 19 model = "Cubietech Cubieboard2";
19 compatible = "cubietech,cubieboard2", "allwinner,sun7i-a20"; 20 compatible = "cubietech,cubieboard2", "allwinner,sun7i-a20";
20 21
21 soc@01c00000 { 22 soc@01c00000 {
22 emac: ethernet@01c0b000 { 23 usbphy: phy@01c13400 {
23 pinctrl-names = "default"; 24 usb1_vbus-supply = <&reg_usb1_vbus>;
24 pinctrl-0 = <&emac_pins_a>; 25 usb2_vbus-supply = <&reg_usb2_vbus>;
25 phy = <&phy1>;
26 status = "okay"; 26 status = "okay";
27 }; 27 };
28 28
29 mdio@01c0b080 { 29 ehci0: usb@01c14000 {
30 status = "okay"; 30 status = "okay";
31 };
31 32
32 phy1: ethernet-phy@1 { 33 ohci0: usb@01c14400 {
33 reg = <1>; 34 status = "okay";
34 }; 35 };
36
37 ahci: sata@01c18000 {
38 target-supply = <&reg_ahci_5v>;
39 status = "okay";
40 };
41
42 ehci1: usb@01c1c000 {
43 status = "okay";
44 };
45
46 ohci1: usb@01c1c400 {
47 status = "okay";
35 }; 48 };
36 49
37 pinctrl@01c20800 { 50 pinctrl@01c20800 {
@@ -60,6 +73,18 @@
60 pinctrl-0 = <&i2c1_pins_a>; 73 pinctrl-0 = <&i2c1_pins_a>;
61 status = "okay"; 74 status = "okay";
62 }; 75 };
76
77 gmac: ethernet@01c50000 {
78 pinctrl-names = "default";
79 pinctrl-0 = <&gmac_pins_mii_a>;
80 phy = <&phy1>;
81 phy-mode = "mii";
82 status = "okay";
83
84 phy1: ethernet-phy@1 {
85 reg = <1>;
86 };
87 };
63 }; 88 };
64 89
65 leds { 90 leds {
@@ -77,4 +102,16 @@
77 gpios = <&pio 7 20 0>; 102 gpios = <&pio 7 20 0>;
78 }; 103 };
79 }; 104 };
105
106 reg_ahci_5v: ahci-5v {
107 status = "okay";
108 };
109
110 reg_usb1_vbus: usb1-vbus {
111 status = "okay";
112 };
113
114 reg_usb2_vbus: usb2-vbus {
115 status = "okay";
116 };
80}; 117};
diff --git a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
index f9dcb61a5305..cb25d3c8da58 100644
--- a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
+++ b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
@@ -13,13 +13,48 @@
13 13
14/dts-v1/; 14/dts-v1/;
15/include/ "sun7i-a20.dtsi" 15/include/ "sun7i-a20.dtsi"
16/include/ "sunxi-common-regulators.dtsi"
16 17
17/ { 18/ {
18 model = "Cubietech Cubietruck"; 19 model = "Cubietech Cubietruck";
19 compatible = "cubietech,cubietruck", "allwinner,sun7i-a20"; 20 compatible = "cubietech,cubietruck", "allwinner,sun7i-a20";
20 21
21 soc@01c00000 { 22 soc@01c00000 {
23 usbphy: phy@01c13400 {
24 usb1_vbus-supply = <&reg_usb1_vbus>;
25 usb2_vbus-supply = <&reg_usb2_vbus>;
26 status = "okay";
27 };
28
29 ehci0: usb@01c14000 {
30 status = "okay";
31 };
32
33 ohci0: usb@01c14400 {
34 status = "okay";
35 };
36
37 ahci: sata@01c18000 {
38 target-supply = <&reg_ahci_5v>;
39 status = "okay";
40 };
41
42 ehci1: usb@01c1c000 {
43 status = "okay";
44 };
45
46 ohci1: usb@01c1c400 {
47 status = "okay";
48 };
49
22 pinctrl@01c20800 { 50 pinctrl@01c20800 {
51 ahci_pwr_pin_cubietruck: ahci_pwr_pin@1 {
52 allwinner,pins = "PH12";
53 allwinner,function = "gpio_out";
54 allwinner,drive = <0>;
55 allwinner,pull = <0>;
56 };
57
23 led_pins_cubietruck: led_pins@0 { 58 led_pins_cubietruck: led_pins@0 {
24 allwinner,pins = "PH7", "PH11", "PH20", "PH21"; 59 allwinner,pins = "PH7", "PH11", "PH20", "PH21";
25 allwinner,function = "gpio_out"; 60 allwinner,function = "gpio_out";
@@ -51,6 +86,18 @@
51 pinctrl-0 = <&i2c2_pins_a>; 86 pinctrl-0 = <&i2c2_pins_a>;
52 status = "okay"; 87 status = "okay";
53 }; 88 };
89
90 gmac: ethernet@01c50000 {
91 pinctrl-names = "default";
92 pinctrl-0 = <&gmac_pins_rgmii_a>;
93 phy = <&phy1>;
94 phy-mode = "rgmii";
95 status = "okay";
96
97 phy1: ethernet-phy@1 {
98 reg = <1>;
99 };
100 };
54 }; 101 };
55 102
56 leds { 103 leds {
@@ -78,4 +125,18 @@
78 gpios = <&pio 7 7 0>; 125 gpios = <&pio 7 7 0>;
79 }; 126 };
80 }; 127 };
128
129 reg_ahci_5v: ahci-5v {
130 pinctrl-0 = <&ahci_pwr_pin_cubietruck>;
131 gpio = <&pio 7 12 0>;
132 status = "okay";
133 };
134
135 reg_usb1_vbus: usb1-vbus {
136 status = "okay";
137 };
138
139 reg_usb2_vbus: usb2-vbus {
140 status = "okay";
141 };
81}; 142};
diff --git a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
index ead3013f9aca..eeadf76362fa 100644
--- a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
+++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
@@ -13,25 +13,55 @@
13 13
14/dts-v1/; 14/dts-v1/;
15/include/ "sun7i-a20.dtsi" 15/include/ "sun7i-a20.dtsi"
16/include/ "sunxi-common-regulators.dtsi"
16 17
17/ { 18/ {
18 model = "Olimex A20-Olinuxino Micro"; 19 model = "Olimex A20-Olinuxino Micro";
19 compatible = "olimex,a20-olinuxino-micro", "allwinner,sun7i-a20"; 20 compatible = "olimex,a20-olinuxino-micro", "allwinner,sun7i-a20";
20 21
22 aliases {
23 spi0 = &spi1;
24 spi1 = &spi2;
25 };
26
21 soc@01c00000 { 27 soc@01c00000 {
22 emac: ethernet@01c0b000 { 28 spi1: spi@01c06000 {
23 pinctrl-names = "default"; 29 pinctrl-names = "default";
24 pinctrl-0 = <&emac_pins_a>; 30 pinctrl-0 = <&spi1_pins_a>;
25 phy = <&phy1>;
26 status = "okay"; 31 status = "okay";
27 }; 32 };
28 33
29 mdio@01c0b080 { 34 usbphy: phy@01c13400 {
35 usb1_vbus-supply = <&reg_usb1_vbus>;
36 usb2_vbus-supply = <&reg_usb2_vbus>;
30 status = "okay"; 37 status = "okay";
38 };
31 39
32 phy1: ethernet-phy@1 { 40 ehci0: usb@01c14000 {
33 reg = <1>; 41 status = "okay";
34 }; 42 };
43
44 ohci0: usb@01c14400 {
45 status = "okay";
46 };
47
48 spi2: spi@01c17000 {
49 pinctrl-names = "default";
50 pinctrl-0 = <&spi2_pins_a>;
51 status = "okay";
52 };
53
54 ahci: sata@01c18000 {
55 target-supply = <&reg_ahci_5v>;
56 status = "okay";
57 };
58
59 ehci1: usb@01c1c000 {
60 status = "okay";
61 };
62
63 ohci1: usb@01c1c400 {
64 status = "okay";
35 }; 65 };
36 66
37 pinctrl@01c20800 { 67 pinctrl@01c20800 {
@@ -78,6 +108,18 @@
78 pinctrl-0 = <&i2c2_pins_a>; 108 pinctrl-0 = <&i2c2_pins_a>;
79 status = "okay"; 109 status = "okay";
80 }; 110 };
111
112 gmac: ethernet@01c50000 {
113 pinctrl-names = "default";
114 pinctrl-0 = <&gmac_pins_mii_a>;
115 phy = <&phy1>;
116 phy-mode = "mii";
117 status = "okay";
118
119 phy1: ethernet-phy@1 {
120 reg = <1>;
121 };
122 };
81 }; 123 };
82 124
83 leds { 125 leds {
@@ -91,4 +133,16 @@
91 default-state = "on"; 133 default-state = "on";
92 }; 134 };
93 }; 135 };
136
137 reg_ahci_5v: ahci-5v {
138 status = "okay";
139 };
140
141 reg_usb1_vbus: usb1-vbus {
142 status = "okay";
143 };
144
145 reg_usb2_vbus: usb2-vbus {
146 status = "okay";
147 };
94}; 148};
diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
index cadcf2f9881d..32efc105df83 100644
--- a/arch/arm/boot/dts/sun7i-a20.dtsi
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi
@@ -17,7 +17,15 @@
17 interrupt-parent = <&gic>; 17 interrupt-parent = <&gic>;
18 18
19 aliases { 19 aliases {
20 ethernet0 = &emac; 20 ethernet0 = &gmac;
21 serial0 = &uart0;
22 serial1 = &uart1;
23 serial2 = &uart2;
24 serial3 = &uart3;
25 serial4 = &uart4;
26 serial5 = &uart5;
27 serial6 = &uart6;
28 serial7 = &uart7;
21 }; 29 };
22 30
23 cpus { 31 cpus {
@@ -41,16 +49,25 @@
41 reg = <0x40000000 0x80000000>; 49 reg = <0x40000000 0x80000000>;
42 }; 50 };
43 51
52 timer {
53 compatible = "arm,armv7-timer";
54 interrupts = <1 13 0xf08>,
55 <1 14 0xf08>,
56 <1 11 0xf08>,
57 <1 10 0xf08>;
58 };
59
44 clocks { 60 clocks {
45 #address-cells = <1>; 61 #address-cells = <1>;
46 #size-cells = <1>; 62 #size-cells = <1>;
47 ranges; 63 ranges;
48 64
49 osc24M: osc24M@01c20050 { 65 osc24M: clk@01c20050 {
50 #clock-cells = <0>; 66 #clock-cells = <0>;
51 compatible = "allwinner,sun4i-osc-clk"; 67 compatible = "allwinner,sun4i-a10-osc-clk";
52 reg = <0x01c20050 0x4>; 68 reg = <0x01c20050 0x4>;
53 clock-frequency = <24000000>; 69 clock-frequency = <24000000>;
70 clock-output-names = "osc24M";
54 }; 71 };
55 72
56 osc32k: clk@0 { 73 osc32k: clk@0 {
@@ -60,31 +77,33 @@
60 clock-output-names = "osc32k"; 77 clock-output-names = "osc32k";
61 }; 78 };
62 79
63 pll1: pll1@01c20000 { 80 pll1: clk@01c20000 {
64 #clock-cells = <0>; 81 #clock-cells = <0>;
65 compatible = "allwinner,sun4i-pll1-clk"; 82 compatible = "allwinner,sun4i-a10-pll1-clk";
66 reg = <0x01c20000 0x4>; 83 reg = <0x01c20000 0x4>;
67 clocks = <&osc24M>; 84 clocks = <&osc24M>;
85 clock-output-names = "pll1";
68 }; 86 };
69 87
70 pll4: pll4@01c20018 { 88 pll4: clk@01c20018 {
71 #clock-cells = <0>; 89 #clock-cells = <0>;
72 compatible = "allwinner,sun4i-pll1-clk"; 90 compatible = "allwinner,sun4i-a10-pll1-clk";
73 reg = <0x01c20018 0x4>; 91 reg = <0x01c20018 0x4>;
74 clocks = <&osc24M>; 92 clocks = <&osc24M>;
93 clock-output-names = "pll4";
75 }; 94 };
76 95
77 pll5: pll5@01c20020 { 96 pll5: clk@01c20020 {
78 #clock-cells = <1>; 97 #clock-cells = <1>;
79 compatible = "allwinner,sun4i-pll5-clk"; 98 compatible = "allwinner,sun4i-a10-pll5-clk";
80 reg = <0x01c20020 0x4>; 99 reg = <0x01c20020 0x4>;
81 clocks = <&osc24M>; 100 clocks = <&osc24M>;
82 clock-output-names = "pll5_ddr", "pll5_other"; 101 clock-output-names = "pll5_ddr", "pll5_other";
83 }; 102 };
84 103
85 pll6: pll6@01c20028 { 104 pll6: clk@01c20028 {
86 #clock-cells = <1>; 105 #clock-cells = <1>;
87 compatible = "allwinner,sun4i-pll6-clk"; 106 compatible = "allwinner,sun4i-a10-pll6-clk";
88 reg = <0x01c20028 0x4>; 107 reg = <0x01c20028 0x4>;
89 clocks = <&osc24M>; 108 clocks = <&osc24M>;
90 clock-output-names = "pll6_sata", "pll6_other", "pll6"; 109 clock-output-names = "pll6_sata", "pll6_other", "pll6";
@@ -92,26 +111,29 @@
92 111
93 cpu: cpu@01c20054 { 112 cpu: cpu@01c20054 {
94 #clock-cells = <0>; 113 #clock-cells = <0>;
95 compatible = "allwinner,sun4i-cpu-clk"; 114 compatible = "allwinner,sun4i-a10-cpu-clk";
96 reg = <0x01c20054 0x4>; 115 reg = <0x01c20054 0x4>;
97 clocks = <&osc32k>, <&osc24M>, <&pll1>, <&pll6 1>; 116 clocks = <&osc32k>, <&osc24M>, <&pll1>, <&pll6 1>;
117 clock-output-names = "cpu";
98 }; 118 };
99 119
100 axi: axi@01c20054 { 120 axi: axi@01c20054 {
101 #clock-cells = <0>; 121 #clock-cells = <0>;
102 compatible = "allwinner,sun4i-axi-clk"; 122 compatible = "allwinner,sun4i-a10-axi-clk";
103 reg = <0x01c20054 0x4>; 123 reg = <0x01c20054 0x4>;
104 clocks = <&cpu>; 124 clocks = <&cpu>;
125 clock-output-names = "axi";
105 }; 126 };
106 127
107 ahb: ahb@01c20054 { 128 ahb: ahb@01c20054 {
108 #clock-cells = <0>; 129 #clock-cells = <0>;
109 compatible = "allwinner,sun4i-ahb-clk"; 130 compatible = "allwinner,sun4i-a10-ahb-clk";
110 reg = <0x01c20054 0x4>; 131 reg = <0x01c20054 0x4>;
111 clocks = <&axi>; 132 clocks = <&axi>;
133 clock-output-names = "ahb";
112 }; 134 };
113 135
114 ahb_gates: ahb_gates@01c20060 { 136 ahb_gates: clk@01c20060 {
115 #clock-cells = <1>; 137 #clock-cells = <1>;
116 compatible = "allwinner,sun7i-a20-ahb-gates-clk"; 138 compatible = "allwinner,sun7i-a20-ahb-gates-clk";
117 reg = <0x01c20060 0x8>; 139 reg = <0x01c20060 0x8>;
@@ -133,12 +155,13 @@
133 155
134 apb0: apb0@01c20054 { 156 apb0: apb0@01c20054 {
135 #clock-cells = <0>; 157 #clock-cells = <0>;
136 compatible = "allwinner,sun4i-apb0-clk"; 158 compatible = "allwinner,sun4i-a10-apb0-clk";
137 reg = <0x01c20054 0x4>; 159 reg = <0x01c20054 0x4>;
138 clocks = <&ahb>; 160 clocks = <&ahb>;
161 clock-output-names = "apb0";
139 }; 162 };
140 163
141 apb0_gates: apb0_gates@01c20068 { 164 apb0_gates: clk@01c20068 {
142 #clock-cells = <1>; 165 #clock-cells = <1>;
143 compatible = "allwinner,sun7i-a20-apb0-gates-clk"; 166 compatible = "allwinner,sun7i-a20-apb0-gates-clk";
144 reg = <0x01c20068 0x4>; 167 reg = <0x01c20068 0x4>;
@@ -151,19 +174,21 @@
151 174
152 apb1_mux: apb1_mux@01c20058 { 175 apb1_mux: apb1_mux@01c20058 {
153 #clock-cells = <0>; 176 #clock-cells = <0>;
154 compatible = "allwinner,sun4i-apb1-mux-clk"; 177 compatible = "allwinner,sun4i-a10-apb1-mux-clk";
155 reg = <0x01c20058 0x4>; 178 reg = <0x01c20058 0x4>;
156 clocks = <&osc24M>, <&pll6 1>, <&osc32k>; 179 clocks = <&osc24M>, <&pll6 1>, <&osc32k>;
180 clock-output-names = "apb1_mux";
157 }; 181 };
158 182
159 apb1: apb1@01c20058 { 183 apb1: apb1@01c20058 {
160 #clock-cells = <0>; 184 #clock-cells = <0>;
161 compatible = "allwinner,sun4i-apb1-clk"; 185 compatible = "allwinner,sun4i-a10-apb1-clk";
162 reg = <0x01c20058 0x4>; 186 reg = <0x01c20058 0x4>;
163 clocks = <&apb1_mux>; 187 clocks = <&apb1_mux>;
188 clock-output-names = "apb1";
164 }; 189 };
165 190
166 apb1_gates: apb1_gates@01c2006c { 191 apb1_gates: clk@01c2006c {
167 #clock-cells = <1>; 192 #clock-cells = <1>;
168 compatible = "allwinner,sun7i-a20-apb1-gates-clk"; 193 compatible = "allwinner,sun7i-a20-apb1-gates-clk";
169 reg = <0x01c2006c 0x4>; 194 reg = <0x01c2006c 0x4>;
@@ -178,7 +203,7 @@
178 203
179 nand_clk: clk@01c20080 { 204 nand_clk: clk@01c20080 {
180 #clock-cells = <0>; 205 #clock-cells = <0>;
181 compatible = "allwinner,sun4i-mod0-clk"; 206 compatible = "allwinner,sun4i-a10-mod0-clk";
182 reg = <0x01c20080 0x4>; 207 reg = <0x01c20080 0x4>;
183 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 208 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
184 clock-output-names = "nand"; 209 clock-output-names = "nand";
@@ -186,7 +211,7 @@
186 211
187 ms_clk: clk@01c20084 { 212 ms_clk: clk@01c20084 {
188 #clock-cells = <0>; 213 #clock-cells = <0>;
189 compatible = "allwinner,sun4i-mod0-clk"; 214 compatible = "allwinner,sun4i-a10-mod0-clk";
190 reg = <0x01c20084 0x4>; 215 reg = <0x01c20084 0x4>;
191 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 216 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
192 clock-output-names = "ms"; 217 clock-output-names = "ms";
@@ -194,7 +219,7 @@
194 219
195 mmc0_clk: clk@01c20088 { 220 mmc0_clk: clk@01c20088 {
196 #clock-cells = <0>; 221 #clock-cells = <0>;
197 compatible = "allwinner,sun4i-mod0-clk"; 222 compatible = "allwinner,sun4i-a10-mod0-clk";
198 reg = <0x01c20088 0x4>; 223 reg = <0x01c20088 0x4>;
199 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 224 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
200 clock-output-names = "mmc0"; 225 clock-output-names = "mmc0";
@@ -202,7 +227,7 @@
202 227
203 mmc1_clk: clk@01c2008c { 228 mmc1_clk: clk@01c2008c {
204 #clock-cells = <0>; 229 #clock-cells = <0>;
205 compatible = "allwinner,sun4i-mod0-clk"; 230 compatible = "allwinner,sun4i-a10-mod0-clk";
206 reg = <0x01c2008c 0x4>; 231 reg = <0x01c2008c 0x4>;
207 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 232 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
208 clock-output-names = "mmc1"; 233 clock-output-names = "mmc1";
@@ -210,7 +235,7 @@
210 235
211 mmc2_clk: clk@01c20090 { 236 mmc2_clk: clk@01c20090 {
212 #clock-cells = <0>; 237 #clock-cells = <0>;
213 compatible = "allwinner,sun4i-mod0-clk"; 238 compatible = "allwinner,sun4i-a10-mod0-clk";
214 reg = <0x01c20090 0x4>; 239 reg = <0x01c20090 0x4>;
215 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 240 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
216 clock-output-names = "mmc2"; 241 clock-output-names = "mmc2";
@@ -218,7 +243,7 @@
218 243
219 mmc3_clk: clk@01c20094 { 244 mmc3_clk: clk@01c20094 {
220 #clock-cells = <0>; 245 #clock-cells = <0>;
221 compatible = "allwinner,sun4i-mod0-clk"; 246 compatible = "allwinner,sun4i-a10-mod0-clk";
222 reg = <0x01c20094 0x4>; 247 reg = <0x01c20094 0x4>;
223 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 248 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
224 clock-output-names = "mmc3"; 249 clock-output-names = "mmc3";
@@ -226,7 +251,7 @@
226 251
227 ts_clk: clk@01c20098 { 252 ts_clk: clk@01c20098 {
228 #clock-cells = <0>; 253 #clock-cells = <0>;
229 compatible = "allwinner,sun4i-mod0-clk"; 254 compatible = "allwinner,sun4i-a10-mod0-clk";
230 reg = <0x01c20098 0x4>; 255 reg = <0x01c20098 0x4>;
231 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 256 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
232 clock-output-names = "ts"; 257 clock-output-names = "ts";
@@ -234,7 +259,7 @@
234 259
235 ss_clk: clk@01c2009c { 260 ss_clk: clk@01c2009c {
236 #clock-cells = <0>; 261 #clock-cells = <0>;
237 compatible = "allwinner,sun4i-mod0-clk"; 262 compatible = "allwinner,sun4i-a10-mod0-clk";
238 reg = <0x01c2009c 0x4>; 263 reg = <0x01c2009c 0x4>;
239 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 264 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
240 clock-output-names = "ss"; 265 clock-output-names = "ss";
@@ -242,7 +267,7 @@
242 267
243 spi0_clk: clk@01c200a0 { 268 spi0_clk: clk@01c200a0 {
244 #clock-cells = <0>; 269 #clock-cells = <0>;
245 compatible = "allwinner,sun4i-mod0-clk"; 270 compatible = "allwinner,sun4i-a10-mod0-clk";
246 reg = <0x01c200a0 0x4>; 271 reg = <0x01c200a0 0x4>;
247 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 272 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
248 clock-output-names = "spi0"; 273 clock-output-names = "spi0";
@@ -250,7 +275,7 @@
250 275
251 spi1_clk: clk@01c200a4 { 276 spi1_clk: clk@01c200a4 {
252 #clock-cells = <0>; 277 #clock-cells = <0>;
253 compatible = "allwinner,sun4i-mod0-clk"; 278 compatible = "allwinner,sun4i-a10-mod0-clk";
254 reg = <0x01c200a4 0x4>; 279 reg = <0x01c200a4 0x4>;
255 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 280 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
256 clock-output-names = "spi1"; 281 clock-output-names = "spi1";
@@ -258,7 +283,7 @@
258 283
259 spi2_clk: clk@01c200a8 { 284 spi2_clk: clk@01c200a8 {
260 #clock-cells = <0>; 285 #clock-cells = <0>;
261 compatible = "allwinner,sun4i-mod0-clk"; 286 compatible = "allwinner,sun4i-a10-mod0-clk";
262 reg = <0x01c200a8 0x4>; 287 reg = <0x01c200a8 0x4>;
263 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 288 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
264 clock-output-names = "spi2"; 289 clock-output-names = "spi2";
@@ -266,7 +291,7 @@
266 291
267 pata_clk: clk@01c200ac { 292 pata_clk: clk@01c200ac {
268 #clock-cells = <0>; 293 #clock-cells = <0>;
269 compatible = "allwinner,sun4i-mod0-clk"; 294 compatible = "allwinner,sun4i-a10-mod0-clk";
270 reg = <0x01c200ac 0x4>; 295 reg = <0x01c200ac 0x4>;
271 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 296 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
272 clock-output-names = "pata"; 297 clock-output-names = "pata";
@@ -274,7 +299,7 @@
274 299
275 ir0_clk: clk@01c200b0 { 300 ir0_clk: clk@01c200b0 {
276 #clock-cells = <0>; 301 #clock-cells = <0>;
277 compatible = "allwinner,sun4i-mod0-clk"; 302 compatible = "allwinner,sun4i-a10-mod0-clk";
278 reg = <0x01c200b0 0x4>; 303 reg = <0x01c200b0 0x4>;
279 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 304 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
280 clock-output-names = "ir0"; 305 clock-output-names = "ir0";
@@ -282,15 +307,24 @@
282 307
283 ir1_clk: clk@01c200b4 { 308 ir1_clk: clk@01c200b4 {
284 #clock-cells = <0>; 309 #clock-cells = <0>;
285 compatible = "allwinner,sun4i-mod0-clk"; 310 compatible = "allwinner,sun4i-a10-mod0-clk";
286 reg = <0x01c200b4 0x4>; 311 reg = <0x01c200b4 0x4>;
287 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 312 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
288 clock-output-names = "ir1"; 313 clock-output-names = "ir1";
289 }; 314 };
290 315
316 usb_clk: clk@01c200cc {
317 #clock-cells = <1>;
318 #reset-cells = <1>;
319 compatible = "allwinner,sun4i-a10-usb-clk";
320 reg = <0x01c200cc 0x4>;
321 clocks = <&pll6 1>;
322 clock-output-names = "usb_ohci0", "usb_ohci1", "usb_phy";
323 };
324
291 spi3_clk: clk@01c200d4 { 325 spi3_clk: clk@01c200d4 {
292 #clock-cells = <0>; 326 #clock-cells = <0>;
293 compatible = "allwinner,sun4i-mod0-clk"; 327 compatible = "allwinner,sun4i-a10-mod0-clk";
294 reg = <0x01c200d4 0x4>; 328 reg = <0x01c200d4 0x4>;
295 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; 329 clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
296 clock-output-names = "spi3"; 330 clock-output-names = "spi3";
@@ -298,13 +332,41 @@
298 332
299 mbus_clk: clk@01c2015c { 333 mbus_clk: clk@01c2015c {
300 #clock-cells = <0>; 334 #clock-cells = <0>;
301 compatible = "allwinner,sun4i-mod0-clk"; 335 compatible = "allwinner,sun4i-a10-mod0-clk";
302 reg = <0x01c2015c 0x4>; 336 reg = <0x01c2015c 0x4>;
303 clocks = <&osc24M>, <&pll6 2>, <&pll5 1>; 337 clocks = <&osc24M>, <&pll6 2>, <&pll5 1>;
304 clock-output-names = "mbus"; 338 clock-output-names = "mbus";
305 }; 339 };
306 340
307 /* 341 /*
342 * The following two are dummy clocks, placeholders used in the gmac_tx
343 * clock. The gmac driver will choose one parent depending on the PHY
344 * interface mode, using clk_set_rate auto-reparenting.
345 * The actual TX clock rate is not controlled by the gmac_tx clock.
346 */
347 mii_phy_tx_clk: clk@2 {
348 #clock-cells = <0>;
349 compatible = "fixed-clock";
350 clock-frequency = <25000000>;
351 clock-output-names = "mii_phy_tx";
352 };
353
354 gmac_int_tx_clk: clk@3 {
355 #clock-cells = <0>;
356 compatible = "fixed-clock";
357 clock-frequency = <125000000>;
358 clock-output-names = "gmac_int_tx";
359 };
360
361 gmac_tx_clk: clk@01c20164 {
362 #clock-cells = <0>;
363 compatible = "allwinner,sun7i-a20-gmac-clk";
364 reg = <0x01c20164 0x4>;
365 clocks = <&mii_phy_tx_clk>, <&gmac_int_tx_clk>;
366 clock-output-names = "gmac_tx";
367 };
368
369 /*
308 * Dummy clock used by output clocks 370 * Dummy clock used by output clocks
309 */ 371 */
310 osc24M_32k: clk@1 { 372 osc24M_32k: clk@1 {
@@ -347,6 +409,28 @@
347 interrupts = <0 0 4>; 409 interrupts = <0 0 4>;
348 }; 410 };
349 411
412 spi0: spi@01c05000 {
413 compatible = "allwinner,sun4i-a10-spi";
414 reg = <0x01c05000 0x1000>;
415 interrupts = <0 10 4>;
416 clocks = <&ahb_gates 20>, <&spi0_clk>;
417 clock-names = "ahb", "mod";
418 status = "disabled";
419 #address-cells = <1>;
420 #size-cells = <0>;
421 };
422
423 spi1: spi@01c06000 {
424 compatible = "allwinner,sun4i-a10-spi";
425 reg = <0x01c06000 0x1000>;
426 interrupts = <0 11 4>;
427 clocks = <&ahb_gates 21>, <&spi1_clk>;
428 clock-names = "ahb", "mod";
429 status = "disabled";
430 #address-cells = <1>;
431 #size-cells = <0>;
432 };
433
350 emac: ethernet@01c0b000 { 434 emac: ethernet@01c0b000 {
351 compatible = "allwinner,sun4i-a10-emac"; 435 compatible = "allwinner,sun4i-a10-emac";
352 reg = <0x01c0b000 0x1000>; 436 reg = <0x01c0b000 0x1000>;
@@ -363,6 +447,88 @@
363 #size-cells = <0>; 447 #size-cells = <0>;
364 }; 448 };
365 449
450 usbphy: phy@01c13400 {
451 #phy-cells = <1>;
452 compatible = "allwinner,sun7i-a20-usb-phy";
453 reg = <0x01c13400 0x10 0x01c14800 0x4 0x01c1c800 0x4>;
454 reg-names = "phy_ctrl", "pmu1", "pmu2";
455 clocks = <&usb_clk 8>;
456 clock-names = "usb_phy";
457 resets = <&usb_clk 1>, <&usb_clk 2>;
458 reset-names = "usb1_reset", "usb2_reset";
459 status = "disabled";
460 };
461
462 ehci0: usb@01c14000 {
463 compatible = "allwinner,sun7i-a20-ehci", "generic-ehci";
464 reg = <0x01c14000 0x100>;
465 interrupts = <0 39 4>;
466 clocks = <&ahb_gates 1>;
467 phys = <&usbphy 1>;
468 phy-names = "usb";
469 status = "disabled";
470 };
471
472 ohci0: usb@01c14400 {
473 compatible = "allwinner,sun7i-a20-ohci", "generic-ohci";
474 reg = <0x01c14400 0x100>;
475 interrupts = <0 64 4>;
476 clocks = <&usb_clk 6>, <&ahb_gates 2>;
477 phys = <&usbphy 1>;
478 phy-names = "usb";
479 status = "disabled";
480 };
481
482 spi2: spi@01c17000 {
483 compatible = "allwinner,sun4i-a10-spi";
484 reg = <0x01c17000 0x1000>;
485 interrupts = <0 12 4>;
486 clocks = <&ahb_gates 22>, <&spi2_clk>;
487 clock-names = "ahb", "mod";
488 status = "disabled";
489 #address-cells = <1>;
490 #size-cells = <0>;
491 };
492
493 ahci: sata@01c18000 {
494 compatible = "allwinner,sun4i-a10-ahci";
495 reg = <0x01c18000 0x1000>;
496 interrupts = <0 56 4>;
497 clocks = <&pll6 0>, <&ahb_gates 25>;
498 status = "disabled";
499 };
500
501 ehci1: usb@01c1c000 {
502 compatible = "allwinner,sun7i-a20-ehci", "generic-ehci";
503 reg = <0x01c1c000 0x100>;
504 interrupts = <0 40 4>;
505 clocks = <&ahb_gates 3>;
506 phys = <&usbphy 2>;
507 phy-names = "usb";
508 status = "disabled";
509 };
510
511 ohci1: usb@01c1c400 {
512 compatible = "allwinner,sun7i-a20-ohci", "generic-ohci";
513 reg = <0x01c1c400 0x100>;
514 interrupts = <0 65 4>;
515 clocks = <&usb_clk 7>, <&ahb_gates 4>;
516 phys = <&usbphy 2>;
517 phy-names = "usb";
518 status = "disabled";
519 };
520
521 spi3: spi@01c1f000 {
522 compatible = "allwinner,sun4i-a10-spi";
523 reg = <0x01c1f000 0x1000>;
524 interrupts = <0 50 4>;
525 clocks = <&ahb_gates 23>, <&spi3_clk>;
526 clock-names = "ahb", "mod";
527 status = "disabled";
528 #address-cells = <1>;
529 #size-cells = <0>;
530 };
531
366 pio: pinctrl@01c20800 { 532 pio: pinctrl@01c20800 {
367 compatible = "allwinner,sun7i-a20-pinctrl"; 533 compatible = "allwinner,sun7i-a20-pinctrl";
368 reg = <0x01c20800 0x400>; 534 reg = <0x01c20800 0x400>;
@@ -381,6 +547,13 @@
381 allwinner,pull = <0>; 547 allwinner,pull = <0>;
382 }; 548 };
383 549
550 uart2_pins_a: uart2@0 {
551 allwinner,pins = "PI16", "PI17", "PI18", "PI19";
552 allwinner,function = "uart2";
553 allwinner,drive = <0>;
554 allwinner,pull = <0>;
555 };
556
384 uart6_pins_a: uart6@0 { 557 uart6_pins_a: uart6@0 {
385 allwinner,pins = "PI12", "PI13"; 558 allwinner,pins = "PI12", "PI13";
386 allwinner,function = "uart6"; 559 allwinner,function = "uart6";
@@ -440,6 +613,46 @@
440 allwinner,drive = <0>; 613 allwinner,drive = <0>;
441 allwinner,pull = <0>; 614 allwinner,pull = <0>;
442 }; 615 };
616
617 gmac_pins_mii_a: gmac_mii@0 {
618 allwinner,pins = "PA0", "PA1", "PA2",
619 "PA3", "PA4", "PA5", "PA6",
620 "PA7", "PA8", "PA9", "PA10",
621 "PA11", "PA12", "PA13", "PA14",
622 "PA15", "PA16";
623 allwinner,function = "gmac";
624 allwinner,drive = <0>;
625 allwinner,pull = <0>;
626 };
627
628 gmac_pins_rgmii_a: gmac_rgmii@0 {
629 allwinner,pins = "PA0", "PA1", "PA2",
630 "PA3", "PA4", "PA5", "PA6",
631 "PA7", "PA8", "PA10",
632 "PA11", "PA12", "PA13",
633 "PA15", "PA16";
634 allwinner,function = "gmac";
635 /*
636 * data lines in RGMII mode use DDR mode
637 * and need a higher signal drive strength
638 */
639 allwinner,drive = <3>;
640 allwinner,pull = <0>;
641 };
642
643 spi1_pins_a: spi1@0 {
644 allwinner,pins = "PI16", "PI17", "PI18", "PI19";
645 allwinner,function = "spi1";
646 allwinner,drive = <0>;
647 allwinner,pull = <0>;
648 };
649
650 spi2_pins_a: spi2@0 {
651 allwinner,pins = "PC19", "PC20", "PC21", "PC22";
652 allwinner,function = "spi2";
653 allwinner,drive = <0>;
654 allwinner,pull = <0>;
655 };
443 }; 656 };
444 657
445 timer@01c20c00 { 658 timer@01c20c00 {
@@ -455,7 +668,7 @@
455 }; 668 };
456 669
457 wdt: watchdog@01c20c90 { 670 wdt: watchdog@01c20c90 {
458 compatible = "allwinner,sun4i-wdt"; 671 compatible = "allwinner,sun4i-a10-wdt";
459 reg = <0x01c20c90 0x10>; 672 reg = <0x01c20c90 0x10>;
460 }; 673 };
461 674
@@ -601,6 +814,21 @@
601 status = "disabled"; 814 status = "disabled";
602 }; 815 };
603 816
817 gmac: ethernet@01c50000 {
818 compatible = "allwinner,sun7i-a20-gmac";
819 reg = <0x01c50000 0x10000>;
820 interrupts = <0 85 4>;
821 interrupt-names = "macirq";
822 clocks = <&ahb_gates 49>, <&gmac_tx_clk>;
823 clock-names = "stmmaceth", "allwinner_gmac_tx";
824 snps,pbl = <2>;
825 snps,fixed-burst;
826 snps,force_sf_dma_mode;
827 status = "disabled";
828 #address-cells = <1>;
829 #size-cells = <0>;
830 };
831
604 hstimer@01c60000 { 832 hstimer@01c60000 {
605 compatible = "allwinner,sun7i-a20-hstimer"; 833 compatible = "allwinner,sun7i-a20-hstimer";
606 reg = <0x01c60000 0x1000>; 834 reg = <0x01c60000 0x1000>;
diff --git a/arch/arm/boot/dts/sunxi-common-regulators.dtsi b/arch/arm/boot/dts/sunxi-common-regulators.dtsi
new file mode 100644
index 000000000000..18eeac0670b9
--- /dev/null
+++ b/arch/arm/boot/dts/sunxi-common-regulators.dtsi
@@ -0,0 +1,75 @@
1/*
2 * sunxi boards common regulator (ahci target power supply, usb-vbus) code
3 *
4 * Copyright 2014 - Hans de Goede <hdegoede@redhat.com>
5 *
6 * The code contained herein is licensed under the GNU General Public
7 * License. You may obtain a copy of the GNU General Public License
8 * Version 2 or later at the following locations:
9 *
10 * http://www.opensource.org/licenses/gpl-license.html
11 * http://www.gnu.org/copyleft/gpl.html
12 */
13
14/ {
15 soc@01c00000 {
16 pio: pinctrl@01c20800 {
17 ahci_pwr_pin_a: ahci_pwr_pin@0 {
18 allwinner,pins = "PB8";
19 allwinner,function = "gpio_out";
20 allwinner,drive = <0>;
21 allwinner,pull = <0>;
22 };
23
24 usb1_vbus_pin_a: usb1_vbus_pin@0 {
25 allwinner,pins = "PH6";
26 allwinner,function = "gpio_out";
27 allwinner,drive = <0>;
28 allwinner,pull = <0>;
29 };
30
31 usb2_vbus_pin_a: usb2_vbus_pin@0 {
32 allwinner,pins = "PH3";
33 allwinner,function = "gpio_out";
34 allwinner,drive = <0>;
35 allwinner,pull = <0>;
36 };
37 };
38 };
39
40 reg_ahci_5v: ahci-5v {
41 compatible = "regulator-fixed";
42 pinctrl-names = "default";
43 pinctrl-0 = <&ahci_pwr_pin_a>;
44 regulator-name = "ahci-5v";
45 regulator-min-microvolt = <5000000>;
46 regulator-max-microvolt = <5000000>;
47 enable-active-high;
48 gpio = <&pio 1 8 0>;
49 status = "disabled";
50 };
51
52 reg_usb1_vbus: usb1-vbus {
53 compatible = "regulator-fixed";
54 pinctrl-names = "default";
55 pinctrl-0 = <&usb1_vbus_pin_a>;
56 regulator-name = "usb1-vbus";
57 regulator-min-microvolt = <5000000>;
58 regulator-max-microvolt = <5000000>;
59 enable-active-high;
60 gpio = <&pio 7 6 0>;
61 status = "disabled";
62 };
63
64 reg_usb2_vbus: usb2-vbus {
65 compatible = "regulator-fixed";
66 pinctrl-names = "default";
67 pinctrl-0 = <&usb2_vbus_pin_a>;
68 regulator-name = "usb2-vbus";
69 regulator-min-microvolt = <5000000>;
70 regulator-max-microvolt = <5000000>;
71 enable-active-high;
72 gpio = <&pio 7 3 0>;
73 status = "disabled";
74 };
75};
diff --git a/arch/arm/boot/dts/tegra114-dalmore.dts b/arch/arm/boot/dts/tegra114-dalmore.dts
index 73aecfb57ccb..a288a12823ed 100644
--- a/arch/arm/boot/dts/tegra114-dalmore.dts
+++ b/arch/arm/boot/dts/tegra114-dalmore.dts
@@ -1,3 +1,8 @@
1/*
2 * This dts file supports Dalmore A04.
3 * Other board revisions are not supported
4 */
5
1/dts-v1/; 6/dts-v1/;
2 7
3#include <dt-bindings/input/input.h> 8#include <dt-bindings/input/input.h>
@@ -715,7 +720,6 @@
715 nvidia,pins = "drive_sdio1"; 720 nvidia,pins = "drive_sdio1";
716 nvidia,high-speed-mode = <TEGRA_PIN_ENABLE>; 721 nvidia,high-speed-mode = <TEGRA_PIN_ENABLE>;
717 nvidia,schmitt = <TEGRA_PIN_DISABLE>; 722 nvidia,schmitt = <TEGRA_PIN_DISABLE>;
718 nvidia,low-power-mode = <TEGRA_PIN_LP_DRIVE_DIV_1>;
719 nvidia,pull-down-strength = <36>; 723 nvidia,pull-down-strength = <36>;
720 nvidia,pull-up-strength = <20>; 724 nvidia,pull-up-strength = <20>;
721 nvidia,slew-rate-rising = <TEGRA_PIN_SLEW_RATE_SLOW>; 725 nvidia,slew-rate-rising = <TEGRA_PIN_SLEW_RATE_SLOW>;
@@ -725,7 +729,6 @@
725 nvidia,pins = "drive_sdio3"; 729 nvidia,pins = "drive_sdio3";
726 nvidia,high-speed-mode = <TEGRA_PIN_ENABLE>; 730 nvidia,high-speed-mode = <TEGRA_PIN_ENABLE>;
727 nvidia,schmitt = <TEGRA_PIN_DISABLE>; 731 nvidia,schmitt = <TEGRA_PIN_DISABLE>;
728 nvidia,low-power-mode = <TEGRA_PIN_LP_DRIVE_DIV_1>;
729 nvidia,pull-down-strength = <22>; 732 nvidia,pull-down-strength = <22>;
730 nvidia,pull-up-strength = <36>; 733 nvidia,pull-up-strength = <36>;
731 nvidia,slew-rate-rising = <TEGRA_PIN_SLEW_RATE_FASTEST>; 734 nvidia,slew-rate-rising = <TEGRA_PIN_SLEW_RATE_FASTEST>;
@@ -735,12 +738,10 @@
735 nvidia,pins = "drive_gma"; 738 nvidia,pins = "drive_gma";
736 nvidia,high-speed-mode = <TEGRA_PIN_ENABLE>; 739 nvidia,high-speed-mode = <TEGRA_PIN_ENABLE>;
737 nvidia,schmitt = <TEGRA_PIN_DISABLE>; 740 nvidia,schmitt = <TEGRA_PIN_DISABLE>;
738 nvidia,low-power-mode = <TEGRA_PIN_LP_DRIVE_DIV_1>;
739 nvidia,pull-down-strength = <2>; 741 nvidia,pull-down-strength = <2>;
740 nvidia,pull-up-strength = <1>; 742 nvidia,pull-up-strength = <1>;
741 nvidia,slew-rate-rising = <TEGRA_PIN_SLEW_RATE_FASTEST>; 743 nvidia,slew-rate-rising = <TEGRA_PIN_SLEW_RATE_FASTEST>;
742 nvidia,slew-rate-falling = <TEGRA_PIN_SLEW_RATE_FASTEST>; 744 nvidia,slew-rate-falling = <TEGRA_PIN_SLEW_RATE_FASTEST>;
743 nvidia,drive-type = <1>;
744 }; 745 };
745 }; 746 };
746 }; 747 };
diff --git a/arch/arm/boot/dts/tegra114.dtsi b/arch/arm/boot/dts/tegra114.dtsi
index 44ec401ec366..fdc559ab2db3 100644
--- a/arch/arm/boot/dts/tegra114.dtsi
+++ b/arch/arm/boot/dts/tegra114.dtsi
@@ -604,7 +604,7 @@
604 clocks = <&tegra_car TEGRA114_CLK_SDMMC1>; 604 clocks = <&tegra_car TEGRA114_CLK_SDMMC1>;
605 resets = <&tegra_car 14>; 605 resets = <&tegra_car 14>;
606 reset-names = "sdhci"; 606 reset-names = "sdhci";
607 status = "disable"; 607 status = "disabled";
608 }; 608 };
609 609
610 sdhci@78000200 { 610 sdhci@78000200 {
@@ -614,7 +614,7 @@
614 clocks = <&tegra_car TEGRA114_CLK_SDMMC2>; 614 clocks = <&tegra_car TEGRA114_CLK_SDMMC2>;
615 resets = <&tegra_car 9>; 615 resets = <&tegra_car 9>;
616 reset-names = "sdhci"; 616 reset-names = "sdhci";
617 status = "disable"; 617 status = "disabled";
618 }; 618 };
619 619
620 sdhci@78000400 { 620 sdhci@78000400 {
@@ -624,7 +624,7 @@
624 clocks = <&tegra_car TEGRA114_CLK_SDMMC3>; 624 clocks = <&tegra_car TEGRA114_CLK_SDMMC3>;
625 resets = <&tegra_car 69>; 625 resets = <&tegra_car 69>;
626 reset-names = "sdhci"; 626 reset-names = "sdhci";
627 status = "disable"; 627 status = "disabled";
628 }; 628 };
629 629
630 sdhci@78000600 { 630 sdhci@78000600 {
@@ -634,7 +634,7 @@
634 clocks = <&tegra_car TEGRA114_CLK_SDMMC4>; 634 clocks = <&tegra_car TEGRA114_CLK_SDMMC4>;
635 resets = <&tegra_car 15>; 635 resets = <&tegra_car 15>;
636 reset-names = "sdhci"; 636 reset-names = "sdhci";
637 status = "disable"; 637 status = "disabled";
638 }; 638 };
639 639
640 usb@7d000000 { 640 usb@7d000000 {
diff --git a/arch/arm/boot/dts/tegra124-venice2.dts b/arch/arm/boot/dts/tegra124-venice2.dts
index c6dcef513e5d..c17283c04598 100644
--- a/arch/arm/boot/dts/tegra124-venice2.dts
+++ b/arch/arm/boot/dts/tegra124-venice2.dts
@@ -8,15 +8,29 @@
8 compatible = "nvidia,venice2", "nvidia,tegra124"; 8 compatible = "nvidia,venice2", "nvidia,tegra124";
9 9
10 aliases { 10 aliases {
11 rtc0 = "/i2c@7000d000/as3722@40"; 11 rtc0 = "/i2c@0,7000d000/pmic@40";
12 rtc1 = "/rtc@7000e000"; 12 rtc1 = "/rtc@0,7000e000";
13 }; 13 };
14 14
15 memory { 15 memory {
16 reg = <0x80000000 0x80000000>; 16 reg = <0x0 0x80000000 0x0 0x80000000>;
17 }; 17 };
18 18
19 pinmux: pinmux@70000868 { 19 host1x@0,50000000 {
20 sor@0,54540000 {
21 status = "okay";
22
23 nvidia,dpaux = <&dpaux>;
24 nvidia,panel = <&panel>;
25 };
26
27 dpaux: dpaux@0,545c0000 {
28 vdd-supply = <&vdd_3v3_panel>;
29 status = "okay";
30 };
31 };
32
33 pinmux: pinmux@0,70000868 {
20 pinctrl-names = "default"; 34 pinctrl-names = "default";
21 pinctrl-0 = <&pinmux_default>; 35 pinctrl-0 = <&pinmux_default>;
22 36
@@ -138,14 +152,9 @@
138 nvidia,enable-input = <TEGRA_PIN_ENABLE>; 152 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
139 }; 153 };
140 sdmmc1_clk_pz0 { 154 sdmmc1_clk_pz0 {
141 nvidia,pins = "sdmmc1_clk_pz0", 155 nvidia,pins = "sdmmc1_clk_pz0";
142 "sdmmc1_cmd_pz1",
143 "sdmmc1_dat0_py7",
144 "sdmmc1_dat1_py6",
145 "sdmmc1_dat2_py5",
146 "sdmmc1_dat3_py4";
147 nvidia,function = "sdmmc1"; 156 nvidia,function = "sdmmc1";
148 nvidia,enable-input = <TEGRA_PIN_ENABLE>; 157 nvidia,enable-input = <TEGRA_PIN_DISABLE>;
149 nvidia,pull = <TEGRA_PIN_PULL_NONE>; 158 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
150 nvidia,tristate = <TEGRA_PIN_DISABLE>; 159 nvidia,tristate = <TEGRA_PIN_DISABLE>;
151 }; 160 };
@@ -402,19 +411,11 @@
402 nvidia,enable-input = <TEGRA_PIN_ENABLE>; 411 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
403 }; 412 };
404 usb_vbus_en0_pn4 { 413 usb_vbus_en0_pn4 {
405 nvidia,pins = "usb_vbus_en0_pn4"; 414 nvidia,pins = "usb_vbus_en0_pn4",
415 "usb_vbus_en1_pn5";
406 nvidia,function = "usb"; 416 nvidia,function = "usb";
407 nvidia,enable-input = <TEGRA_PIN_ENABLE>; 417 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
408 nvidia,pull = <TEGRA_PIN_PULL_UP>; 418 nvidia,pull = <TEGRA_PIN_PULL_NONE>;
409 nvidia,tristate = <TEGRA_PIN_DISABLE>;
410 nvidia,lock = <TEGRA_PIN_DISABLE>;
411 nvidia,open-drain = <TEGRA_PIN_ENABLE>;
412 };
413 usb_vbus_en1_pn5 {
414 nvidia,pins = "usb_vbus_en1_pn5";
415 nvidia,function = "usb";
416 nvidia,enable-input = <TEGRA_PIN_ENABLE>;
417 nvidia,pull = <TEGRA_PIN_PULL_UP>;
418 nvidia,tristate = <TEGRA_PIN_DISABLE>; 419 nvidia,tristate = <TEGRA_PIN_DISABLE>;
419 nvidia,lock = <TEGRA_PIN_DISABLE>; 420 nvidia,lock = <TEGRA_PIN_DISABLE>;
420 nvidia,open-drain = <TEGRA_PIN_ENABLE>; 421 nvidia,open-drain = <TEGRA_PIN_ENABLE>;
@@ -423,7 +424,6 @@
423 nvidia,pins = "drive_sdio1"; 424 nvidia,pins = "drive_sdio1";
424 nvidia,high-speed-mode = <TEGRA_PIN_ENABLE>; 425 nvidia,high-speed-mode = <TEGRA_PIN_ENABLE>;
425 nvidia,schmitt = <TEGRA_PIN_DISABLE>; 426 nvidia,schmitt = <TEGRA_PIN_DISABLE>;
426 nvidia,low-power-mode = <TEGRA_PIN_LP_DRIVE_DIV_1>;
427 nvidia,pull-down-strength = <32>; 427 nvidia,pull-down-strength = <32>;
428 nvidia,pull-up-strength = <42>; 428 nvidia,pull-up-strength = <42>;
429 nvidia,slew-rate-rising = <TEGRA_PIN_SLEW_RATE_FASTEST>; 429 nvidia,slew-rate-rising = <TEGRA_PIN_SLEW_RATE_FASTEST>;
@@ -433,7 +433,6 @@
433 nvidia,pins = "drive_sdio3"; 433 nvidia,pins = "drive_sdio3";
434 nvidia,high-speed-mode = <TEGRA_PIN_ENABLE>; 434 nvidia,high-speed-mode = <TEGRA_PIN_ENABLE>;
435 nvidia,schmitt = <TEGRA_PIN_DISABLE>; 435 nvidia,schmitt = <TEGRA_PIN_DISABLE>;
436 nvidia,low-power-mode = <TEGRA_PIN_LP_DRIVE_DIV_1>;
437 nvidia,pull-down-strength = <20>; 436 nvidia,pull-down-strength = <20>;
438 nvidia,pull-up-strength = <36>; 437 nvidia,pull-up-strength = <36>;
439 nvidia,slew-rate-rising = <TEGRA_PIN_SLEW_RATE_FASTEST>; 438 nvidia,slew-rate-rising = <TEGRA_PIN_SLEW_RATE_FASTEST>;
@@ -572,15 +571,15 @@
572 }; 571 };
573 }; 572 };
574 573
575 serial@70006000 { 574 serial@0,70006000 {
576 status = "okay"; 575 status = "okay";
577 }; 576 };
578 577
579 pwm: pwm@7000a000 { 578 pwm: pwm@0,7000a000 {
580 status = "okay"; 579 status = "okay";
581 }; 580 };
582 581
583 i2c@7000c000 { 582 i2c@0,7000c000 {
584 status = "okay"; 583 status = "okay";
585 clock-frequency = <100000>; 584 clock-frequency = <100000>;
586 585
@@ -592,30 +591,32 @@
592 }; 591 };
593 }; 592 };
594 593
595 i2c@7000c400 { 594 i2c@0,7000c400 {
596 status = "okay"; 595 status = "okay";
597 clock-frequency = <100000>; 596 clock-frequency = <100000>;
598 }; 597 };
599 598
600 i2c@7000c500 { 599 i2c@0,7000c500 {
601 status = "okay"; 600 status = "okay";
602 clock-frequency = <100000>; 601 clock-frequency = <100000>;
603 }; 602 };
604 603
605 i2c@7000c700 { 604 i2c@0,7000c700 {
606 status = "okay"; 605 status = "okay";
607 clock-frequency = <100000>; 606 clock-frequency = <100000>;
608 }; 607 };
609 608
610 i2c@7000d000 { 609 i2c@0,7000d000 {
611 status = "okay"; 610 status = "okay";
612 clock-frequency = <400000>; 611 clock-frequency = <400000>;
613 612
614 as3722: as3722@40 { 613 pmic: pmic@40 {
615 compatible = "ams,as3722"; 614 compatible = "ams,as3722";
616 reg = <0x40>; 615 reg = <0x40>;
617 interrupts = <0 86 IRQ_TYPE_LEVEL_HIGH>; 616 interrupts = <0 86 IRQ_TYPE_LEVEL_HIGH>;
618 617
618 ams,system-power-controller;
619
619 #interrupt-cells = <2>; 620 #interrupt-cells = <2>;
620 interrupt-controller; 621 interrupt-controller;
621 622
@@ -650,19 +651,19 @@
650 }; 651 };
651 652
652 regulators { 653 regulators {
653 vsup-sd2-supply = <&vdd_ac_bat_reg>; 654 vsup-sd2-supply = <&vdd_5v0_sys>;
654 vsup-sd3-supply = <&vdd_ac_bat_reg>; 655 vsup-sd3-supply = <&vdd_5v0_sys>;
655 vsup-sd4-supply = <&vdd_ac_bat_reg>; 656 vsup-sd4-supply = <&vdd_5v0_sys>;
656 vsup-sd5-supply = <&vdd_ac_bat_reg>; 657 vsup-sd5-supply = <&vdd_5v0_sys>;
657 vin-ldo0-supply = <&as3722_sd2>; 658 vin-ldo0-supply = <&vdd_1v35_lp0>;
658 vin-ldo1-6-supply = <&vdd_ac_bat_reg>; 659 vin-ldo1-6-supply = <&vdd_3v3_run>;
659 vin-ldo2-5-7-supply = <&as3722_sd5>; 660 vin-ldo2-5-7-supply = <&vddio_1v8>;
660 vin-ldo3-4-supply = <&vdd_ac_bat_reg>; 661 vin-ldo3-4-supply = <&vdd_3v3_sys>;
661 vin-ldo9-10-supply = <&vdd_ac_bat_reg>; 662 vin-ldo9-10-supply = <&vdd_5v0_sys>;
662 vin-ldo11-supply = <&vdd_ac_bat_reg>; 663 vin-ldo11-supply = <&vdd_3v3_run>;
663 664
664 sd0 { 665 sd0 {
665 regulator-name = "vdd-cpu"; 666 regulator-name = "+VDD_CPU_AP";
666 regulator-min-microvolt = <700000>; 667 regulator-min-microvolt = <700000>;
667 regulator-max-microvolt = <1400000>; 668 regulator-max-microvolt = <1400000>;
668 regulator-min-microamp = <3500000>; 669 regulator-min-microamp = <3500000>;
@@ -673,7 +674,7 @@
673 }; 674 };
674 675
675 sd1 { 676 sd1 {
676 regulator-name = "vdd-core"; 677 regulator-name = "+VDD_CORE";
677 regulator-min-microvolt = <700000>; 678 regulator-min-microvolt = <700000>;
678 regulator-max-microvolt = <1350000>; 679 regulator-max-microvolt = <1350000>;
679 regulator-min-microamp = <2500000>; 680 regulator-min-microamp = <2500000>;
@@ -683,8 +684,8 @@
683 ams,external-control = <1>; 684 ams,external-control = <1>;
684 }; 685 };
685 686
686 as3722_sd2: sd2 { 687 vdd_1v35_lp0: sd2 {
687 regulator-name = "vddio-ddr"; 688 regulator-name = "+1.35V_LP0(sd2)";
688 regulator-min-microvolt = <1350000>; 689 regulator-min-microvolt = <1350000>;
689 regulator-max-microvolt = <1350000>; 690 regulator-max-microvolt = <1350000>;
690 regulator-always-on; 691 regulator-always-on;
@@ -692,7 +693,7 @@
692 }; 693 };
693 694
694 sd3 { 695 sd3 {
695 regulator-name = "vddio-ddr-2phase"; 696 regulator-name = "+1.35V_LP0(sd3)";
696 regulator-min-microvolt = <1350000>; 697 regulator-min-microvolt = <1350000>;
697 regulator-max-microvolt = <1350000>; 698 regulator-max-microvolt = <1350000>;
698 regulator-always-on; 699 regulator-always-on;
@@ -700,15 +701,13 @@
700 }; 701 };
701 702
702 sd4 { 703 sd4 {
703 regulator-name = "avdd-pex-sata"; 704 regulator-name = "+1.05V_RUN";
704 regulator-min-microvolt = <1050000>; 705 regulator-min-microvolt = <1050000>;
705 regulator-max-microvolt = <1050000>; 706 regulator-max-microvolt = <1050000>;
706 regulator-boot-on;
707 regulator-always-on;
708 }; 707 };
709 708
710 as3722_sd5: sd5 { 709 vddio_1v8: sd5 {
711 regulator-name = "vddio-sys"; 710 regulator-name = "+1.8V_VDDIO";
712 regulator-min-microvolt = <1800000>; 711 regulator-min-microvolt = <1800000>;
713 regulator-max-microvolt = <1800000>; 712 regulator-max-microvolt = <1800000>;
714 regulator-boot-on; 713 regulator-boot-on;
@@ -716,7 +715,7 @@
716 }; 715 };
717 716
718 sd6 { 717 sd6 {
719 regulator-name = "vdd-gpu"; 718 regulator-name = "+VDD_GPU_AP";
720 regulator-min-microvolt = <650000>; 719 regulator-min-microvolt = <650000>;
721 regulator-max-microvolt = <1200000>; 720 regulator-max-microvolt = <1200000>;
722 regulator-min-microamp = <3500000>; 721 regulator-min-microamp = <3500000>;
@@ -726,7 +725,7 @@
726 }; 725 };
727 726
728 ldo0 { 727 ldo0 {
729 regulator-name = "avdd_pll"; 728 regulator-name = "+1.05V_RUN_AVDD";
730 regulator-min-microvolt = <1050000>; 729 regulator-min-microvolt = <1050000>;
731 regulator-max-microvolt = <1050000>; 730 regulator-max-microvolt = <1050000>;
732 regulator-boot-on; 731 regulator-boot-on;
@@ -735,13 +734,13 @@
735 }; 734 };
736 735
737 ldo1 { 736 ldo1 {
738 regulator-name = "run-cam-1.8"; 737 regulator-name = "+1.8V_RUN_CAM";
739 regulator-min-microvolt = <1800000>; 738 regulator-min-microvolt = <1800000>;
740 regulator-max-microvolt = <1800000>; 739 regulator-max-microvolt = <1800000>;
741 }; 740 };
742 741
743 ldo2 { 742 ldo2 {
744 regulator-name = "gen-avdd,vddio-hsic"; 743 regulator-name = "+1.2V_GEN_AVDD";
745 regulator-min-microvolt = <1200000>; 744 regulator-min-microvolt = <1200000>;
746 regulator-max-microvolt = <1200000>; 745 regulator-max-microvolt = <1200000>;
747 regulator-boot-on; 746 regulator-boot-on;
@@ -749,7 +748,7 @@
749 }; 748 };
750 749
751 ldo3 { 750 ldo3 {
752 regulator-name = "vdd-rtc"; 751 regulator-name = "+1.00V_LP0_VDD_RTC";
753 regulator-min-microvolt = <1000000>; 752 regulator-min-microvolt = <1000000>;
754 regulator-max-microvolt = <1000000>; 753 regulator-max-microvolt = <1000000>;
755 regulator-boot-on; 754 regulator-boot-on;
@@ -757,48 +756,44 @@
757 ams,enable-tracking; 756 ams,enable-tracking;
758 }; 757 };
759 758
760 ldo4 { 759 vdd_run_cam: ldo4 {
761 regulator-name = "vdd-cam"; 760 regulator-name = "+3.3V_RUN_CAM";
762 regulator-min-microvolt = <2800000>; 761 regulator-min-microvolt = <2800000>;
763 regulator-max-microvolt = <2800000>; 762 regulator-max-microvolt = <2800000>;
764 regulator-boot-on;
765 regulator-always-on;
766 }; 763 };
767 764
768 ldo5 { 765 ldo5 {
769 regulator-name = "vdd-cam-front"; 766 regulator-name = "+1.2V_RUN_CAM_FRONT";
770 regulator-min-microvolt = <1200000>; 767 regulator-min-microvolt = <1200000>;
771 regulator-max-microvolt = <1200000>; 768 regulator-max-microvolt = <1200000>;
772 }; 769 };
773 770
774 ldo6 { 771 vddio_sdmmc3: ldo6 {
775 regulator-name = "vddio-sdmmc3"; 772 regulator-name = "+VDDIO_SDMMC3";
776 regulator-min-microvolt = <1800000>; 773 regulator-min-microvolt = <1800000>;
777 regulator-max-microvolt = <3300000>; 774 regulator-max-microvolt = <3300000>;
778 regulator-boot-on;
779 regulator-always-on;
780 }; 775 };
781 776
782 ldo7 { 777 ldo7 {
783 regulator-name = "vdd-cam-rear"; 778 regulator-name = "+1.05V_RUN_CAM_REAR";
784 regulator-min-microvolt = <1050000>; 779 regulator-min-microvolt = <1050000>;
785 regulator-max-microvolt = <1050000>; 780 regulator-max-microvolt = <1050000>;
786 }; 781 };
787 782
788 ldo9 { 783 ldo9 {
789 regulator-name = "vdd-touch"; 784 regulator-name = "+2.8V_RUN_TOUCH";
790 regulator-min-microvolt = <2800000>; 785 regulator-min-microvolt = <2800000>;
791 regulator-max-microvolt = <2800000>; 786 regulator-max-microvolt = <2800000>;
792 }; 787 };
793 788
794 ldo10 { 789 ldo10 {
795 regulator-name = "vdd-cam-af"; 790 regulator-name = "+2.8V_RUN_CAM_AF";
796 regulator-min-microvolt = <2800000>; 791 regulator-min-microvolt = <2800000>;
797 regulator-max-microvolt = <2800000>; 792 regulator-max-microvolt = <2800000>;
798 }; 793 };
799 794
800 ldo11 { 795 ldo11 {
801 regulator-name = "vpp-fuse"; 796 regulator-name = "+1.8V_RUN_VPP_FUSE";
802 regulator-min-microvolt = <1800000>; 797 regulator-min-microvolt = <1800000>;
803 regulator-max-microvolt = <1800000>; 798 regulator-max-microvolt = <1800000>;
804 }; 799 };
@@ -806,7 +801,7 @@
806 }; 801 };
807 }; 802 };
808 803
809 spi@7000d400 { 804 spi@0,7000d400 {
810 status = "okay"; 805 status = "okay";
811 806
812 cros-ec@0 { 807 cros-ec@0 {
@@ -912,7 +907,17 @@
912 }; 907 };
913 }; 908 };
914 909
915 pmc@7000e400 { 910 spi@0,7000da00 {
911 status = "okay";
912 spi-max-frequency = <25000000>;
913 spi-flash@0 {
914 compatible = "winbond,w25q32dw";
915 reg = <0>;
916 spi-max-frequency = <20000000>;
917 };
918 };
919
920 pmc@0,7000e400 {
916 nvidia,invert-interrupt; 921 nvidia,invert-interrupt;
917 nvidia,suspend-mode = <1>; 922 nvidia,suspend-mode = <1>;
918 nvidia,cpu-pwr-good-time = <500>; 923 nvidia,cpu-pwr-good-time = <500>;
@@ -923,24 +928,63 @@
923 nvidia,sys-clock-req-active-high; 928 nvidia,sys-clock-req-active-high;
924 }; 929 };
925 930
926 sdhci@700b0400 { 931 sdhci@0,700b0400 {
927 cd-gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_HIGH>; 932 cd-gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_HIGH>;
928 power-gpios = <&gpio TEGRA_GPIO(R, 0) GPIO_ACTIVE_HIGH>; 933 power-gpios = <&gpio TEGRA_GPIO(R, 0) GPIO_ACTIVE_HIGH>;
929 status = "okay"; 934 status = "okay";
930 bus-width = <4>; 935 bus-width = <4>;
936 vmmc-supply = <&vddio_sdmmc3>;
931 }; 937 };
932 938
933 sdhci@700b0600 { 939 sdhci@0,700b0600 {
934 status = "okay"; 940 status = "okay";
935 bus-width = <8>; 941 bus-width = <8>;
936 }; 942 };
937 943
938 ahub@70300000 { 944 ahub@0,70300000 {
939 i2s@70301100 { 945 i2s@0,70301100 {
940 status = "okay"; 946 status = "okay";
941 }; 947 };
942 }; 948 };
943 949
950 usb@0,7d000000 {
951 status = "okay";
952 };
953
954 usb-phy@0,7d000000 {
955 status = "okay";
956 vbus-supply = <&vdd_usb1_vbus>;
957 };
958
959 usb@0,7d004000 {
960 status = "okay";
961 };
962
963 usb-phy@0,7d004000 {
964 status = "okay";
965 vbus-supply = <&vdd_run_cam>;
966 };
967
968 usb@0,7d008000 {
969 status = "okay";
970 };
971
972 usb-phy@0,7d008000 {
973 status = "okay";
974 vbus-supply = <&vdd_usb3_vbus>;
975 };
976
977 backlight: backlight {
978 compatible = "pwm-backlight";
979
980 enable-gpios = <&gpio TEGRA_GPIO(H, 2) GPIO_ACTIVE_HIGH>;
981 power-supply = <&vdd_led>;
982 pwms = <&pwm 1 1000000>;
983
984 brightness-levels = <0 4 8 16 32 64 128 255>;
985 default-brightness-level = <6>;
986 };
987
944 clocks { 988 clocks {
945 compatible = "simple-bus"; 989 compatible = "simple-bus";
946 #address-cells = <1>; 990 #address-cells = <1>;
@@ -948,7 +992,7 @@
948 992
949 clk32k_in: clock@0 { 993 clk32k_in: clock@0 {
950 compatible = "fixed-clock"; 994 compatible = "fixed-clock";
951 reg=<0>; 995 reg = <0>;
952 #clock-cells = <0>; 996 #clock-cells = <0>;
953 clock-frequency = <32768>; 997 clock-frequency = <32768>;
954 }; 998 };
@@ -966,104 +1010,140 @@
966 }; 1010 };
967 }; 1011 };
968 1012
1013 panel: panel {
1014 compatible = "lg,lp129qe", "simple-panel";
1015
1016 backlight = <&backlight>;
1017 ddc-i2c-bus = <&dpaux>;
1018 };
1019
969 regulators { 1020 regulators {
970 compatible = "simple-bus"; 1021 compatible = "simple-bus";
971 #address-cells = <1>; 1022 #address-cells = <1>;
972 #size-cells = <0>; 1023 #size-cells = <0>;
973 1024
974 vdd_ac_bat_reg: regulator@0 { 1025 vdd_mux: regulator@0 {
975 compatible = "regulator-fixed"; 1026 compatible = "regulator-fixed";
976 reg = <0>; 1027 reg = <0>;
977 regulator-name = "vdd_ac_bat"; 1028 regulator-name = "+VDD_MUX";
978 regulator-min-microvolt = <5000000>; 1029 regulator-min-microvolt = <12000000>;
979 regulator-max-microvolt = <5000000>; 1030 regulator-max-microvolt = <12000000>;
980 regulator-always-on; 1031 regulator-always-on;
1032 regulator-boot-on;
981 }; 1033 };
982 1034
983 vdd_3v3_reg: regulator@1 { 1035 vdd_5v0_sys: regulator@1 {
984 compatible = "regulator-fixed"; 1036 compatible = "regulator-fixed";
985 reg = <1>; 1037 reg = <1>;
986 regulator-name = "vdd_3v3"; 1038 regulator-name = "+5V_SYS";
987 regulator-min-microvolt = <3300000>; 1039 regulator-min-microvolt = <5000000>;
988 regulator-max-microvolt = <3300000>; 1040 regulator-max-microvolt = <5000000>;
989 regulator-always-on; 1041 regulator-always-on;
990 regulator-boot-on; 1042 regulator-boot-on;
991 enable-active-high; 1043 vin-supply = <&vdd_mux>;
992 gpio = <&as3722 1 GPIO_ACTIVE_HIGH>;
993 }; 1044 };
994 1045
995 vdd_3v3_modem_reg: regulator@2 { 1046 vdd_3v3_sys: regulator@2 {
996 compatible = "regulator-fixed"; 1047 compatible = "regulator-fixed";
997 reg = <2>; 1048 reg = <2>;
998 regulator-name = "vdd-modem-3v3"; 1049 regulator-name = "+3.3V_SYS";
999 regulator-min-microvolt = <3300000>; 1050 regulator-min-microvolt = <3300000>;
1000 regulator-max-microvolt = <3300000>; 1051 regulator-max-microvolt = <3300000>;
1001 enable-active-high; 1052 regulator-always-on;
1002 gpio = <&as3722 2 GPIO_ACTIVE_HIGH>; 1053 regulator-boot-on;
1054 vin-supply = <&vdd_mux>;
1003 }; 1055 };
1004 1056
1005 vdd_hdmi_5v0_reg: regulator@3 { 1057 vdd_3v3_run: regulator@3 {
1006 compatible = "regulator-fixed"; 1058 compatible = "regulator-fixed";
1007 reg = <3>; 1059 reg = <3>;
1008 regulator-name = "vdd-hdmi-5v0"; 1060 regulator-name = "+3.3V_RUN";
1009 regulator-min-microvolt = <5000000>; 1061 regulator-min-microvolt = <3300000>;
1010 regulator-max-microvolt = <5000000>; 1062 regulator-max-microvolt = <3300000>;
1063 gpio = <&pmic 1 GPIO_ACTIVE_HIGH>;
1011 enable-active-high; 1064 enable-active-high;
1012 gpio = <&gpio TEGRA_GPIO(K, 6) GPIO_ACTIVE_HIGH>; 1065 vin-supply = <&vdd_3v3_sys>;
1013 }; 1066 };
1014 1067
1015 vdd_bl_reg: regulator@4 { 1068 vdd_3v3_hdmi: regulator@4 {
1016 compatible = "regulator-fixed"; 1069 compatible = "regulator-fixed";
1017 reg = <4>; 1070 reg = <4>;
1018 regulator-name = "vdd-bl"; 1071 regulator-name = "+3.3V_AVDD_HDMI_AP_GATED";
1019 regulator-min-microvolt = <3300000>; 1072 regulator-min-microvolt = <3300000>;
1020 regulator-max-microvolt = <3300000>; 1073 regulator-max-microvolt = <3300000>;
1021 gpio = <&gpio TEGRA_GPIO(P, 2) GPIO_ACTIVE_LOW>; 1074 vin-supply = <&vdd_3v3_run>;
1022 }; 1075 };
1023 1076
1024 vdd_ts_sw_5v0: regulator@5 { 1077 vdd_led: regulator@5 {
1025 compatible = "regulator-fixed"; 1078 compatible = "regulator-fixed";
1026 reg = <5>; 1079 reg = <5>;
1027 regulator-name = "vdd_ts_sw"; 1080 regulator-name = "+VDD_LED";
1028 regulator-min-microvolt = <5000000>; 1081 gpio = <&gpio TEGRA_GPIO(P, 2) GPIO_ACTIVE_HIGH>;
1029 regulator-max-microvolt = <5000000>;
1030 enable-active-high; 1082 enable-active-high;
1031 regulator-boot-on; 1083 vin-supply = <&vdd_mux>;
1032 gpio = <&gpio TEGRA_GPIO(K, 1) GPIO_ACTIVE_LOW>;
1033 }; 1084 };
1034 1085
1035 usb1_vbus_reg: regulator@6 { 1086 vdd_5v0_ts: regulator@6 {
1036 compatible = "regulator-fixed"; 1087 compatible = "regulator-fixed";
1037 reg = <6>; 1088 reg = <6>;
1038 regulator-name = "usb1_vbus"; 1089 regulator-name = "+5V_VDD_TS_SW";
1039 regulator-min-microvolt = <5000000>; 1090 regulator-min-microvolt = <5000000>;
1040 regulator-max-microvolt = <5000000>; 1091 regulator-max-microvolt = <5000000>;
1041 regulator-boot-on; 1092 regulator-boot-on;
1093 gpio = <&gpio TEGRA_GPIO(K, 1) GPIO_ACTIVE_HIGH>;
1042 enable-active-high; 1094 enable-active-high;
1043 gpio = <&gpio TEGRA_GPIO(N, 4) GPIO_ACTIVE_HIGH>; 1095 vin-supply = <&vdd_5v0_sys>;
1044 gpio-open-drain;
1045 }; 1096 };
1046 1097
1047 usb3_vbus_reg: regulator@7 { 1098 vdd_usb1_vbus: regulator@7 {
1048 compatible = "regulator-fixed"; 1099 compatible = "regulator-fixed";
1049 reg = <7>; 1100 reg = <7>;
1050 regulator-name = "usb3_vbus"; 1101 regulator-name = "+5V_USB_HS";
1051 regulator-min-microvolt = <5000000>; 1102 regulator-min-microvolt = <5000000>;
1052 regulator-max-microvolt = <5000000>; 1103 regulator-max-microvolt = <5000000>;
1053 regulator-boot-on; 1104 gpio = <&gpio TEGRA_GPIO(N, 4) GPIO_ACTIVE_HIGH>;
1054 enable-active-high; 1105 enable-active-high;
1055 gpio = <&gpio TEGRA_GPIO(N, 5) GPIO_ACTIVE_HIGH>;
1056 gpio-open-drain; 1106 gpio-open-drain;
1107 vin-supply = <&vdd_5v0_sys>;
1057 }; 1108 };
1058 1109
1059 panel_3v3_reg: regulator@8 { 1110 vdd_usb3_vbus: regulator@8 {
1060 compatible = "regulator-fixed"; 1111 compatible = "regulator-fixed";
1061 reg = <8>; 1112 reg = <8>;
1062 regulator-name = "panel_3v3"; 1113 regulator-name = "+5V_USB_SS";
1114 regulator-min-microvolt = <5000000>;
1115 regulator-max-microvolt = <5000000>;
1116 gpio = <&gpio TEGRA_GPIO(N, 5) GPIO_ACTIVE_HIGH>;
1117 enable-active-high;
1118 gpio-open-drain;
1119 vin-supply = <&vdd_5v0_sys>;
1120 };
1121
1122 vdd_3v3_panel: regulator@9 {
1123 compatible = "regulator-fixed";
1124 reg = <9>;
1125 regulator-name = "+3.3V_PANEL";
1126 regulator-min-microvolt = <3300000>;
1127 regulator-max-microvolt = <3300000>;
1128 gpio = <&pmic 4 GPIO_ACTIVE_HIGH>;
1129 enable-active-high;
1130 vin-supply = <&vdd_3v3_run>;
1131 };
1132
1133 vdd_3v3_lp0: regulator@10 {
1134 compatible = "regulator-fixed";
1135 reg = <10>;
1136 regulator-name = "+3.3V_LP0";
1063 regulator-min-microvolt = <3300000>; 1137 regulator-min-microvolt = <3300000>;
1064 regulator-max-microvolt = <3300000>; 1138 regulator-max-microvolt = <3300000>;
1139 /*
1140 * TODO: find a way to wire this up with the USB EHCI
1141 * controllers so that it can be enabled on demand.
1142 */
1143 regulator-always-on;
1144 gpio = <&pmic 2 GPIO_ACTIVE_HIGH>;
1065 enable-active-high; 1145 enable-active-high;
1066 gpio = <&as3722 4 GPIO_ACTIVE_HIGH>; 1146 vin-supply = <&vdd_3v3_sys>;
1067 }; 1147 };
1068 }; 1148 };
1069 1149
diff --git a/arch/arm/boot/dts/tegra124.dtsi b/arch/arm/boot/dts/tegra124.dtsi
index ec0698a8354a..cf45a1a39483 100644
--- a/arch/arm/boot/dts/tegra124.dtsi
+++ b/arch/arm/boot/dts/tegra124.dtsi
@@ -8,22 +8,91 @@
8/ { 8/ {
9 compatible = "nvidia,tegra124"; 9 compatible = "nvidia,tegra124";
10 interrupt-parent = <&gic>; 10 interrupt-parent = <&gic>;
11 #address-cells = <2>;
12 #size-cells = <2>;
13
14 host1x@0,50000000 {
15 compatible = "nvidia,tegra124-host1x", "simple-bus";
16 reg = <0x0 0x50000000 0x0 0x00034000>;
17 interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>, /* syncpt */
18 <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>; /* general */
19 clocks = <&tegra_car TEGRA124_CLK_HOST1X>;
20 resets = <&tegra_car 28>;
21 reset-names = "host1x";
22
23 #address-cells = <2>;
24 #size-cells = <2>;
25
26 ranges = <0 0x54000000 0 0x54000000 0 0x01000000>;
27
28 dc@0,54200000 {
29 compatible = "nvidia,tegra124-dc";
30 reg = <0x0 0x54200000 0x0 0x00040000>;
31 interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
32 clocks = <&tegra_car TEGRA124_CLK_DISP1>,
33 <&tegra_car TEGRA124_CLK_PLL_P>;
34 clock-names = "dc", "parent";
35 resets = <&tegra_car 27>;
36 reset-names = "dc";
37
38 nvidia,head = <0>;
39 };
40
41 dc@0,54240000 {
42 compatible = "nvidia,tegra124-dc";
43 reg = <0x0 0x54240000 0x0 0x00040000>;
44 interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
45 clocks = <&tegra_car TEGRA124_CLK_DISP2>,
46 <&tegra_car TEGRA124_CLK_PLL_P>;
47 clock-names = "dc", "parent";
48 resets = <&tegra_car 26>;
49 reset-names = "dc";
50
51 nvidia,head = <1>;
52 };
11 53
12 gic: interrupt-controller@50041000 { 54 sor@0,54540000 {
55 compatible = "nvidia,tegra124-sor";
56 reg = <0x0 0x54540000 0x0 0x00040000>;
57 interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
58 clocks = <&tegra_car TEGRA124_CLK_SOR0>,
59 <&tegra_car TEGRA124_CLK_PLL_D_OUT0>,
60 <&tegra_car TEGRA124_CLK_PLL_DP>,
61 <&tegra_car TEGRA124_CLK_CLK_M>;
62 clock-names = "sor", "parent", "dp", "safe";
63 resets = <&tegra_car 182>;
64 reset-names = "sor";
65 status = "disabled";
66 };
67
68 dpaux@0,545c0000 {
69 compatible = "nvidia,tegra124-dpaux";
70 reg = <0x0 0x545c0000 0x0 0x00040000>;
71 interrupts = <GIC_SPI 159 IRQ_TYPE_LEVEL_HIGH>;
72 clocks = <&tegra_car TEGRA124_CLK_DPAUX>,
73 <&tegra_car TEGRA124_CLK_PLL_DP>;
74 clock-names = "dpaux", "parent";
75 resets = <&tegra_car 181>;
76 reset-names = "dpaux";
77 status = "disabled";
78 };
79 };
80
81 gic: interrupt-controller@0,50041000 {
13 compatible = "arm,cortex-a15-gic"; 82 compatible = "arm,cortex-a15-gic";
14 #interrupt-cells = <3>; 83 #interrupt-cells = <3>;
15 interrupt-controller; 84 interrupt-controller;
16 reg = <0x50041000 0x1000>, 85 reg = <0x0 0x50041000 0x0 0x1000>,
17 <0x50042000 0x1000>, 86 <0x0 0x50042000 0x0 0x1000>,
18 <0x50044000 0x2000>, 87 <0x0 0x50044000 0x0 0x2000>,
19 <0x50046000 0x2000>; 88 <0x0 0x50046000 0x0 0x2000>;
20 interrupts = <GIC_PPI 9 89 interrupts = <GIC_PPI 9
21 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; 90 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
22 }; 91 };
23 92
24 timer@60005000 { 93 timer@0,60005000 {
25 compatible = "nvidia,tegra124-timer", "nvidia,tegra20-timer"; 94 compatible = "nvidia,tegra124-timer", "nvidia,tegra20-timer";
26 reg = <0x60005000 0x400>; 95 reg = <0x0 0x60005000 0x0 0x400>;
27 interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>, 96 interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
28 <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>, 97 <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
29 <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>, 98 <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>,
@@ -33,16 +102,16 @@
33 clocks = <&tegra_car TEGRA124_CLK_TIMER>; 102 clocks = <&tegra_car TEGRA124_CLK_TIMER>;
34 }; 103 };
35 104
36 tegra_car: clock@60006000 { 105 tegra_car: clock@0,60006000 {
37 compatible = "nvidia,tegra124-car"; 106 compatible = "nvidia,tegra124-car";
38 reg = <0x60006000 0x1000>; 107 reg = <0x0 0x60006000 0x0 0x1000>;
39 #clock-cells = <1>; 108 #clock-cells = <1>;
40 #reset-cells = <1>; 109 #reset-cells = <1>;
41 }; 110 };
42 111
43 gpio: gpio@6000d000 { 112 gpio: gpio@0,6000d000 {
44 compatible = "nvidia,tegra124-gpio", "nvidia,tegra30-gpio"; 113 compatible = "nvidia,tegra124-gpio", "nvidia,tegra30-gpio";
45 reg = <0x6000d000 0x1000>; 114 reg = <0x0 0x6000d000 0x0 0x1000>;
46 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>, 115 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>,
47 <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>, 116 <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>,
48 <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>, 117 <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>,
@@ -57,9 +126,9 @@
57 interrupt-controller; 126 interrupt-controller;
58 }; 127 };
59 128
60 apbdma: dma@60020000 { 129 apbdma: dma@0,60020000 {
61 compatible = "nvidia,tegra124-apbdma", "nvidia,tegra148-apbdma"; 130 compatible = "nvidia,tegra124-apbdma", "nvidia,tegra148-apbdma";
62 reg = <0x60020000 0x1400>; 131 reg = <0x0 0x60020000 0x0 0x1400>;
63 interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>, 132 interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>,
64 <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>, 133 <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>,
65 <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>, 134 <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>,
@@ -98,10 +167,10 @@
98 #dma-cells = <1>; 167 #dma-cells = <1>;
99 }; 168 };
100 169
101 pinmux: pinmux@70000868 { 170 pinmux: pinmux@0,70000868 {
102 compatible = "nvidia,tegra124-pinmux"; 171 compatible = "nvidia,tegra124-pinmux";
103 reg = <0x70000868 0x164>, /* Pad control registers */ 172 reg = <0x0 0x70000868 0x0 0x164>, /* Pad control registers */
104 <0x70003000 0x434>; /* Mux registers */ 173 <0x0 0x70003000 0x0 0x434>; /* Mux registers */
105 }; 174 };
106 175
107 /* 176 /*
@@ -112,9 +181,9 @@
112 * the APB DMA based serial driver, the comptible is 181 * the APB DMA based serial driver, the comptible is
113 * "nvidia,tegra124-hsuart", "nvidia,tegra30-hsuart". 182 * "nvidia,tegra124-hsuart", "nvidia,tegra30-hsuart".
114 */ 183 */
115 serial@70006000 { 184 serial@0,70006000 {
116 compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart"; 185 compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart";
117 reg = <0x70006000 0x40>; 186 reg = <0x0 0x70006000 0x0 0x40>;
118 reg-shift = <2>; 187 reg-shift = <2>;
119 interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; 188 interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
120 clocks = <&tegra_car TEGRA124_CLK_UARTA>; 189 clocks = <&tegra_car TEGRA124_CLK_UARTA>;
@@ -125,9 +194,9 @@
125 status = "disabled"; 194 status = "disabled";
126 }; 195 };
127 196
128 serial@70006040 { 197 serial@0,70006040 {
129 compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart"; 198 compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart";
130 reg = <0x70006040 0x40>; 199 reg = <0x0 0x70006040 0x0 0x40>;
131 reg-shift = <2>; 200 reg-shift = <2>;
132 interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>; 201 interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
133 clocks = <&tegra_car TEGRA124_CLK_UARTB>; 202 clocks = <&tegra_car TEGRA124_CLK_UARTB>;
@@ -138,9 +207,9 @@
138 status = "disabled"; 207 status = "disabled";
139 }; 208 };
140 209
141 serial@70006200 { 210 serial@0,70006200 {
142 compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart"; 211 compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart";
143 reg = <0x70006200 0x40>; 212 reg = <0x0 0x70006200 0x0 0x40>;
144 reg-shift = <2>; 213 reg-shift = <2>;
145 interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>; 214 interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
146 clocks = <&tegra_car TEGRA124_CLK_UARTC>; 215 clocks = <&tegra_car TEGRA124_CLK_UARTC>;
@@ -151,9 +220,9 @@
151 status = "disabled"; 220 status = "disabled";
152 }; 221 };
153 222
154 serial@70006300 { 223 serial@0,70006300 {
155 compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart"; 224 compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart";
156 reg = <0x70006300 0x40>; 225 reg = <0x0 0x70006300 0x0 0x40>;
157 reg-shift = <2>; 226 reg-shift = <2>;
158 interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>; 227 interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
159 clocks = <&tegra_car TEGRA124_CLK_UARTD>; 228 clocks = <&tegra_car TEGRA124_CLK_UARTD>;
@@ -164,9 +233,9 @@
164 status = "disabled"; 233 status = "disabled";
165 }; 234 };
166 235
167 serial@70006400 { 236 serial@0,70006400 {
168 compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart"; 237 compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart";
169 reg = <0x70006400 0x40>; 238 reg = <0x0 0x70006400 0x0 0x40>;
170 reg-shift = <2>; 239 reg-shift = <2>;
171 interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>; 240 interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>;
172 clocks = <&tegra_car TEGRA124_CLK_UARTE>; 241 clocks = <&tegra_car TEGRA124_CLK_UARTE>;
@@ -177,9 +246,9 @@
177 status = "disabled"; 246 status = "disabled";
178 }; 247 };
179 248
180 pwm@7000a000 { 249 pwm@0,7000a000 {
181 compatible = "nvidia,tegra124-pwm", "nvidia,tegra20-pwm"; 250 compatible = "nvidia,tegra124-pwm", "nvidia,tegra20-pwm";
182 reg = <0x7000a000 0x100>; 251 reg = <0x0 0x7000a000 0x0 0x100>;
183 #pwm-cells = <2>; 252 #pwm-cells = <2>;
184 clocks = <&tegra_car TEGRA124_CLK_PWM>; 253 clocks = <&tegra_car TEGRA124_CLK_PWM>;
185 resets = <&tegra_car 17>; 254 resets = <&tegra_car 17>;
@@ -187,9 +256,9 @@
187 status = "disabled"; 256 status = "disabled";
188 }; 257 };
189 258
190 i2c@7000c000 { 259 i2c@0,7000c000 {
191 compatible = "nvidia,tegra124-i2c", "nvidia,tegra114-i2c"; 260 compatible = "nvidia,tegra124-i2c", "nvidia,tegra114-i2c";
192 reg = <0x7000c000 0x100>; 261 reg = <0x0 0x7000c000 0x0 0x100>;
193 interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>; 262 interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
194 #address-cells = <1>; 263 #address-cells = <1>;
195 #size-cells = <0>; 264 #size-cells = <0>;
@@ -202,9 +271,9 @@
202 status = "disabled"; 271 status = "disabled";
203 }; 272 };
204 273
205 i2c@7000c400 { 274 i2c@0,7000c400 {
206 compatible = "nvidia,tegra124-i2c", "nvidia,tegra114-i2c"; 275 compatible = "nvidia,tegra124-i2c", "nvidia,tegra114-i2c";
207 reg = <0x7000c400 0x100>; 276 reg = <0x0 0x7000c400 0x0 0x100>;
208 interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>; 277 interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
209 #address-cells = <1>; 278 #address-cells = <1>;
210 #size-cells = <0>; 279 #size-cells = <0>;
@@ -217,9 +286,9 @@
217 status = "disabled"; 286 status = "disabled";
218 }; 287 };
219 288
220 i2c@7000c500 { 289 i2c@0,7000c500 {
221 compatible = "nvidia,tegra124-i2c", "nvidia,tegra114-i2c"; 290 compatible = "nvidia,tegra124-i2c", "nvidia,tegra114-i2c";
222 reg = <0x7000c500 0x100>; 291 reg = <0x0 0x7000c500 0x0 0x100>;
223 interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>; 292 interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
224 #address-cells = <1>; 293 #address-cells = <1>;
225 #size-cells = <0>; 294 #size-cells = <0>;
@@ -232,9 +301,9 @@
232 status = "disabled"; 301 status = "disabled";
233 }; 302 };
234 303
235 i2c@7000c700 { 304 i2c@0,7000c700 {
236 compatible = "nvidia,tegra124-i2c", "nvidia,tegra114-i2c"; 305 compatible = "nvidia,tegra124-i2c", "nvidia,tegra114-i2c";
237 reg = <0x7000c700 0x100>; 306 reg = <0x0 0x7000c700 0x0 0x100>;
238 interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>; 307 interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
239 #address-cells = <1>; 308 #address-cells = <1>;
240 #size-cells = <0>; 309 #size-cells = <0>;
@@ -247,9 +316,9 @@
247 status = "disabled"; 316 status = "disabled";
248 }; 317 };
249 318
250 i2c@7000d000 { 319 i2c@0,7000d000 {
251 compatible = "nvidia,tegra124-i2c", "nvidia,tegra114-i2c"; 320 compatible = "nvidia,tegra124-i2c", "nvidia,tegra114-i2c";
252 reg = <0x7000d000 0x100>; 321 reg = <0x0 0x7000d000 0x0 0x100>;
253 interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>; 322 interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>;
254 #address-cells = <1>; 323 #address-cells = <1>;
255 #size-cells = <0>; 324 #size-cells = <0>;
@@ -262,9 +331,9 @@
262 status = "disabled"; 331 status = "disabled";
263 }; 332 };
264 333
265 i2c@7000d100 { 334 i2c@0,7000d100 {
266 compatible = "nvidia,tegra124-i2c", "nvidia,tegra114-i2c"; 335 compatible = "nvidia,tegra124-i2c", "nvidia,tegra114-i2c";
267 reg = <0x7000d100 0x100>; 336 reg = <0x0 0x7000d100 0x0 0x100>;
268 interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>; 337 interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>;
269 #address-cells = <1>; 338 #address-cells = <1>;
270 #size-cells = <0>; 339 #size-cells = <0>;
@@ -277,9 +346,9 @@
277 status = "disabled"; 346 status = "disabled";
278 }; 347 };
279 348
280 spi@7000d400 { 349 spi@0,7000d400 {
281 compatible = "nvidia,tegra124-spi", "nvidia,tegra114-spi"; 350 compatible = "nvidia,tegra124-spi", "nvidia,tegra114-spi";
282 reg = <0x7000d400 0x200>; 351 reg = <0x0 0x7000d400 0x0 0x200>;
283 interrupts = <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>; 352 interrupts = <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>;
284 #address-cells = <1>; 353 #address-cells = <1>;
285 #size-cells = <0>; 354 #size-cells = <0>;
@@ -292,9 +361,9 @@
292 status = "disabled"; 361 status = "disabled";
293 }; 362 };
294 363
295 spi@7000d600 { 364 spi@0,7000d600 {
296 compatible = "nvidia,tegra124-spi", "nvidia,tegra114-spi"; 365 compatible = "nvidia,tegra124-spi", "nvidia,tegra114-spi";
297 reg = <0x7000d600 0x200>; 366 reg = <0x0 0x7000d600 0x0 0x200>;
298 interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>; 367 interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
299 #address-cells = <1>; 368 #address-cells = <1>;
300 #size-cells = <0>; 369 #size-cells = <0>;
@@ -307,9 +376,9 @@
307 status = "disabled"; 376 status = "disabled";
308 }; 377 };
309 378
310 spi@7000d800 { 379 spi@0,7000d800 {
311 compatible = "nvidia,tegra124-spi", "nvidia,tegra114-spi"; 380 compatible = "nvidia,tegra124-spi", "nvidia,tegra114-spi";
312 reg = <0x7000d800 0x200>; 381 reg = <0x0 0x7000d800 0x0 0x200>;
313 interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>; 382 interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
314 #address-cells = <1>; 383 #address-cells = <1>;
315 #size-cells = <0>; 384 #size-cells = <0>;
@@ -322,9 +391,9 @@
322 status = "disabled"; 391 status = "disabled";
323 }; 392 };
324 393
325 spi@7000da00 { 394 spi@0,7000da00 {
326 compatible = "nvidia,tegra124-spi", "nvidia,tegra114-spi"; 395 compatible = "nvidia,tegra124-spi", "nvidia,tegra114-spi";
327 reg = <0x7000da00 0x200>; 396 reg = <0x0 0x7000da00 0x0 0x200>;
328 interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>; 397 interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
329 #address-cells = <1>; 398 #address-cells = <1>;
330 #size-cells = <0>; 399 #size-cells = <0>;
@@ -337,9 +406,9 @@
337 status = "disabled"; 406 status = "disabled";
338 }; 407 };
339 408
340 spi@7000dc00 { 409 spi@0,7000dc00 {
341 compatible = "nvidia,tegra124-spi", "nvidia,tegra114-spi"; 410 compatible = "nvidia,tegra124-spi", "nvidia,tegra114-spi";
342 reg = <0x7000dc00 0x200>; 411 reg = <0x0 0x7000dc00 0x0 0x200>;
343 interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>; 412 interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
344 #address-cells = <1>; 413 #address-cells = <1>;
345 #size-cells = <0>; 414 #size-cells = <0>;
@@ -352,9 +421,9 @@
352 status = "disabled"; 421 status = "disabled";
353 }; 422 };
354 423
355 spi@7000de00 { 424 spi@0,7000de00 {
356 compatible = "nvidia,tegra124-spi", "nvidia,tegra114-spi"; 425 compatible = "nvidia,tegra124-spi", "nvidia,tegra114-spi";
357 reg = <0x7000de00 0x200>; 426 reg = <0x0 0x7000de00 0x0 0x200>;
358 interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>; 427 interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
359 #address-cells = <1>; 428 #address-cells = <1>;
360 #size-cells = <0>; 429 #size-cells = <0>;
@@ -367,65 +436,65 @@
367 status = "disabled"; 436 status = "disabled";
368 }; 437 };
369 438
370 rtc@7000e000 { 439 rtc@0,7000e000 {
371 compatible = "nvidia,tegra124-rtc", "nvidia,tegra20-rtc"; 440 compatible = "nvidia,tegra124-rtc", "nvidia,tegra20-rtc";
372 reg = <0x7000e000 0x100>; 441 reg = <0x0 0x7000e000 0x0 0x100>;
373 interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>; 442 interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
374 clocks = <&tegra_car TEGRA124_CLK_RTC>; 443 clocks = <&tegra_car TEGRA124_CLK_RTC>;
375 }; 444 };
376 445
377 pmc@7000e400 { 446 pmc@0,7000e400 {
378 compatible = "nvidia,tegra124-pmc"; 447 compatible = "nvidia,tegra124-pmc";
379 reg = <0x7000e400 0x400>; 448 reg = <0x0 0x7000e400 0x0 0x400>;
380 clocks = <&tegra_car TEGRA124_CLK_PCLK>, <&clk32k_in>; 449 clocks = <&tegra_car TEGRA124_CLK_PCLK>, <&clk32k_in>;
381 clock-names = "pclk", "clk32k_in"; 450 clock-names = "pclk", "clk32k_in";
382 }; 451 };
383 452
384 sdhci@700b0000 { 453 sdhci@0,700b0000 {
385 compatible = "nvidia,tegra124-sdhci"; 454 compatible = "nvidia,tegra124-sdhci";
386 reg = <0x700b0000 0x200>; 455 reg = <0x0 0x700b0000 0x0 0x200>;
387 interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; 456 interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
388 clocks = <&tegra_car TEGRA124_CLK_SDMMC1>; 457 clocks = <&tegra_car TEGRA124_CLK_SDMMC1>;
389 resets = <&tegra_car 14>; 458 resets = <&tegra_car 14>;
390 reset-names = "sdhci"; 459 reset-names = "sdhci";
391 status = "disable"; 460 status = "disabled";
392 }; 461 };
393 462
394 sdhci@700b0200 { 463 sdhci@0,700b0200 {
395 compatible = "nvidia,tegra124-sdhci"; 464 compatible = "nvidia,tegra124-sdhci";
396 reg = <0x700b0200 0x200>; 465 reg = <0x0 0x700b0200 0x0 0x200>;
397 interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>; 466 interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
398 clocks = <&tegra_car TEGRA124_CLK_SDMMC2>; 467 clocks = <&tegra_car TEGRA124_CLK_SDMMC2>;
399 resets = <&tegra_car 9>; 468 resets = <&tegra_car 9>;
400 reset-names = "sdhci"; 469 reset-names = "sdhci";
401 status = "disable"; 470 status = "disabled";
402 }; 471 };
403 472
404 sdhci@700b0400 { 473 sdhci@0,700b0400 {
405 compatible = "nvidia,tegra124-sdhci"; 474 compatible = "nvidia,tegra124-sdhci";
406 reg = <0x700b0400 0x200>; 475 reg = <0x0 0x700b0400 0x0 0x200>;
407 interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>; 476 interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
408 clocks = <&tegra_car TEGRA124_CLK_SDMMC3>; 477 clocks = <&tegra_car TEGRA124_CLK_SDMMC3>;
409 resets = <&tegra_car 69>; 478 resets = <&tegra_car 69>;
410 reset-names = "sdhci"; 479 reset-names = "sdhci";
411 status = "disable"; 480 status = "disabled";
412 }; 481 };
413 482
414 sdhci@700b0600 { 483 sdhci@0,700b0600 {
415 compatible = "nvidia,tegra124-sdhci"; 484 compatible = "nvidia,tegra124-sdhci";
416 reg = <0x700b0600 0x200>; 485 reg = <0x0 0x700b0600 0x0 0x200>;
417 interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>; 486 interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
418 clocks = <&tegra_car TEGRA124_CLK_SDMMC4>; 487 clocks = <&tegra_car TEGRA124_CLK_SDMMC4>;
419 resets = <&tegra_car 15>; 488 resets = <&tegra_car 15>;
420 reset-names = "sdhci"; 489 reset-names = "sdhci";
421 status = "disable"; 490 status = "disabled";
422 }; 491 };
423 492
424 ahub@70300000 { 493 ahub@0,70300000 {
425 compatible = "nvidia,tegra124-ahub"; 494 compatible = "nvidia,tegra124-ahub";
426 reg = <0x70300000 0x200>, 495 reg = <0x0 0x70300000 0x0 0x200>,
427 <0x70300800 0x800>, 496 <0x0 0x70300800 0x0 0x800>,
428 <0x70300200 0x600>; 497 <0x0 0x70300200 0x0 0x600>;
429 interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>; 498 interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
430 clocks = <&tegra_car TEGRA124_CLK_D_AUDIO>, 499 clocks = <&tegra_car TEGRA124_CLK_D_AUDIO>,
431 <&tegra_car TEGRA124_CLK_APBIF>; 500 <&tegra_car TEGRA124_CLK_APBIF>;
@@ -470,12 +539,12 @@
470 "rx6", "tx6", "rx7", "tx7", "rx8", "tx8", 539 "rx6", "tx6", "rx7", "tx7", "rx8", "tx8",
471 "rx9", "tx9"; 540 "rx9", "tx9";
472 ranges; 541 ranges;
473 #address-cells = <1>; 542 #address-cells = <2>;
474 #size-cells = <1>; 543 #size-cells = <2>;
475 544
476 tegra_i2s0: i2s@70301000 { 545 tegra_i2s0: i2s@0,70301000 {
477 compatible = "nvidia,tegra124-i2s"; 546 compatible = "nvidia,tegra124-i2s";
478 reg = <0x70301000 0x100>; 547 reg = <0x0 0x70301000 0x0 0x100>;
479 nvidia,ahub-cif-ids = <4 4>; 548 nvidia,ahub-cif-ids = <4 4>;
480 clocks = <&tegra_car TEGRA124_CLK_I2S0>; 549 clocks = <&tegra_car TEGRA124_CLK_I2S0>;
481 resets = <&tegra_car 30>; 550 resets = <&tegra_car 30>;
@@ -483,9 +552,9 @@
483 status = "disabled"; 552 status = "disabled";
484 }; 553 };
485 554
486 tegra_i2s1: i2s@70301100 { 555 tegra_i2s1: i2s@0,70301100 {
487 compatible = "nvidia,tegra124-i2s"; 556 compatible = "nvidia,tegra124-i2s";
488 reg = <0x70301100 0x100>; 557 reg = <0x0 0x70301100 0x0 0x100>;
489 nvidia,ahub-cif-ids = <5 5>; 558 nvidia,ahub-cif-ids = <5 5>;
490 clocks = <&tegra_car TEGRA124_CLK_I2S1>; 559 clocks = <&tegra_car TEGRA124_CLK_I2S1>;
491 resets = <&tegra_car 11>; 560 resets = <&tegra_car 11>;
@@ -493,9 +562,9 @@
493 status = "disabled"; 562 status = "disabled";
494 }; 563 };
495 564
496 tegra_i2s2: i2s@70301200 { 565 tegra_i2s2: i2s@0,70301200 {
497 compatible = "nvidia,tegra124-i2s"; 566 compatible = "nvidia,tegra124-i2s";
498 reg = <0x70301200 0x100>; 567 reg = <0x0 0x70301200 0x0 0x100>;
499 nvidia,ahub-cif-ids = <6 6>; 568 nvidia,ahub-cif-ids = <6 6>;
500 clocks = <&tegra_car TEGRA124_CLK_I2S2>; 569 clocks = <&tegra_car TEGRA124_CLK_I2S2>;
501 resets = <&tegra_car 18>; 570 resets = <&tegra_car 18>;
@@ -503,9 +572,9 @@
503 status = "disabled"; 572 status = "disabled";
504 }; 573 };
505 574
506 tegra_i2s3: i2s@70301300 { 575 tegra_i2s3: i2s@0,70301300 {
507 compatible = "nvidia,tegra124-i2s"; 576 compatible = "nvidia,tegra124-i2s";
508 reg = <0x70301300 0x100>; 577 reg = <0x0 0x70301300 0x0 0x100>;
509 nvidia,ahub-cif-ids = <7 7>; 578 nvidia,ahub-cif-ids = <7 7>;
510 clocks = <&tegra_car TEGRA124_CLK_I2S3>; 579 clocks = <&tegra_car TEGRA124_CLK_I2S3>;
511 resets = <&tegra_car 101>; 580 resets = <&tegra_car 101>;
@@ -513,9 +582,9 @@
513 status = "disabled"; 582 status = "disabled";
514 }; 583 };
515 584
516 tegra_i2s4: i2s@70301400 { 585 tegra_i2s4: i2s@0,70301400 {
517 compatible = "nvidia,tegra124-i2s"; 586 compatible = "nvidia,tegra124-i2s";
518 reg = <0x70301400 0x100>; 587 reg = <0x0 0x70301400 0x0 0x100>;
519 nvidia,ahub-cif-ids = <8 8>; 588 nvidia,ahub-cif-ids = <8 8>;
520 clocks = <&tegra_car TEGRA124_CLK_I2S4>; 589 clocks = <&tegra_car TEGRA124_CLK_I2S4>;
521 resets = <&tegra_car 102>; 590 resets = <&tegra_car 102>;
@@ -524,6 +593,108 @@
524 }; 593 };
525 }; 594 };
526 595
596 usb@0,7d000000 {
597 compatible = "nvidia,tegra124-ehci", "nvidia,tegra30-ehci", "usb-ehci";
598 reg = <0x0 0x7d000000 0x0 0x4000>;
599 interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
600 phy_type = "utmi";
601 clocks = <&tegra_car TEGRA124_CLK_USBD>;
602 resets = <&tegra_car 22>;
603 reset-names = "usb";
604 nvidia,phy = <&phy1>;
605 status = "disabled";
606 };
607
608 phy1: usb-phy@0,7d000000 {
609 compatible = "nvidia,tegra124-usb-phy", "nvidia,tegra30-usb-phy";
610 reg = <0x0 0x7d000000 0x0 0x4000>,
611 <0x0 0x7d000000 0x0 0x4000>;
612 phy_type = "utmi";
613 clocks = <&tegra_car TEGRA124_CLK_USBD>,
614 <&tegra_car TEGRA124_CLK_PLL_U>,
615 <&tegra_car TEGRA124_CLK_USBD>;
616 clock-names = "reg", "pll_u", "utmi-pads";
617 nvidia,hssync-start-delay = <0>;
618 nvidia,idle-wait-delay = <17>;
619 nvidia,elastic-limit = <16>;
620 nvidia,term-range-adj = <6>;
621 nvidia,xcvr-setup = <9>;
622 nvidia,xcvr-lsfslew = <0>;
623 nvidia,xcvr-lsrslew = <3>;
624 nvidia,hssquelch-level = <2>;
625 nvidia,hsdiscon-level = <5>;
626 nvidia,xcvr-hsslew = <12>;
627 status = "disabled";
628 };
629
630 usb@0,7d004000 {
631 compatible = "nvidia,tegra124-ehci", "nvidia,tegra30-ehci", "usb-ehci";
632 reg = <0x0 0x7d004000 0x0 0x4000>;
633 interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
634 phy_type = "utmi";
635 clocks = <&tegra_car TEGRA124_CLK_USB2>;
636 resets = <&tegra_car 58>;
637 reset-names = "usb";
638 nvidia,phy = <&phy2>;
639 status = "disabled";
640 };
641
642 phy2: usb-phy@0,7d004000 {
643 compatible = "nvidia,tegra124-usb-phy", "nvidia,tegra30-usb-phy";
644 reg = <0x0 0x7d004000 0x0 0x4000>,
645 <0x0 0x7d000000 0x0 0x4000>;
646 phy_type = "utmi";
647 clocks = <&tegra_car TEGRA124_CLK_USB2>,
648 <&tegra_car TEGRA124_CLK_PLL_U>,
649 <&tegra_car TEGRA124_CLK_USBD>;
650 clock-names = "reg", "pll_u", "utmi-pads";
651 nvidia,hssync-start-delay = <0>;
652 nvidia,idle-wait-delay = <17>;
653 nvidia,elastic-limit = <16>;
654 nvidia,term-range-adj = <6>;
655 nvidia,xcvr-setup = <9>;
656 nvidia,xcvr-lsfslew = <0>;
657 nvidia,xcvr-lsrslew = <3>;
658 nvidia,hssquelch-level = <2>;
659 nvidia,hsdiscon-level = <5>;
660 nvidia,xcvr-hsslew = <12>;
661 status = "disabled";
662 };
663
664 usb@0,7d008000 {
665 compatible = "nvidia,tegra124-ehci", "nvidia,tegra30-ehci", "usb-ehci";
666 reg = <0x0 0x7d008000 0x0 0x4000>;
667 interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>;
668 phy_type = "utmi";
669 clocks = <&tegra_car TEGRA124_CLK_USB3>;
670 resets = <&tegra_car 59>;
671 reset-names = "usb";
672 nvidia,phy = <&phy3>;
673 status = "disabled";
674 };
675
676 phy3: usb-phy@0,7d008000 {
677 compatible = "nvidia,tegra124-usb-phy", "nvidia,tegra30-usb-phy";
678 reg = <0x0 0x7d008000 0x0 0x4000>,
679 <0x0 0x7d000000 0x0 0x4000>;
680 phy_type = "utmi";
681 clocks = <&tegra_car TEGRA124_CLK_USB3>,
682 <&tegra_car TEGRA124_CLK_PLL_U>,
683 <&tegra_car TEGRA124_CLK_USBD>;
684 clock-names = "reg", "pll_u", "utmi-pads";
685 nvidia,hssync-start-delay = <0>;
686 nvidia,idle-wait-delay = <17>;
687 nvidia,elastic-limit = <16>;
688 nvidia,term-range-adj = <6>;
689 nvidia,xcvr-setup = <9>;
690 nvidia,xcvr-lsfslew = <0>;
691 nvidia,xcvr-lsrslew = <3>;
692 nvidia,hssquelch-level = <2>;
693 nvidia,hsdiscon-level = <5>;
694 nvidia,xcvr-hsslew = <12>;
695 status = "disabled";
696 };
697
527 cpus { 698 cpus {
528 #address-cells = <1>; 699 #address-cells = <1>;
529 #size-cells = <0>; 700 #size-cells = <0>;
diff --git a/arch/arm/boot/dts/tegra20-paz00.dts b/arch/arm/boot/dts/tegra20-paz00.dts
index c7cd8e6802d7..9a39a8001f78 100644
--- a/arch/arm/boot/dts/tegra20-paz00.dts
+++ b/arch/arm/boot/dts/tegra20-paz00.dts
@@ -17,6 +17,14 @@
17 }; 17 };
18 18
19 host1x@50000000 { 19 host1x@50000000 {
20 dc@54200000 {
21 rgb {
22 status = "okay";
23
24 nvidia,panel = <&panel>;
25 };
26 };
27
20 hdmi@54280000 { 28 hdmi@54280000 {
21 status = "okay"; 29 status = "okay";
22 30
@@ -257,7 +265,11 @@
257 status = "okay"; 265 status = "okay";
258 }; 266 };
259 267
260 i2c@7000c000 { 268 pwm: pwm@7000a000 {
269 status = "okay";
270 };
271
272 lvds_ddc: i2c@7000c000 {
261 status = "okay"; 273 status = "okay";
262 clock-frequency = <400000>; 274 clock-frequency = <400000>;
263 275
@@ -475,6 +487,18 @@
475 non-removable; 487 non-removable;
476 }; 488 };
477 489
490 backlight: backlight {
491 compatible = "pwm-backlight";
492
493 enable-gpios = <&gpio TEGRA_GPIO(U, 4) GPIO_ACTIVE_HIGH>;
494 pwms = <&pwm 0 5000000>;
495
496 brightness-levels = <0 16 32 48 64 80 96 112 128 144 160 176 192 208 224 240 255>;
497 default-brightness-level = <10>;
498
499 backlight-boot-off;
500 };
501
478 clocks { 502 clocks {
479 compatible = "simple-bus"; 503 compatible = "simple-bus";
480 #address-cells = <1>; 504 #address-cells = <1>;
@@ -509,6 +533,16 @@
509 }; 533 };
510 }; 534 };
511 535
536 panel: panel {
537 compatible = "samsung,ltn101nt05", "simple-panel";
538
539 ddc-i2c-bus = <&lvds_ddc>;
540 power-supply = <&vdd_pnl_reg>;
541 enable-gpios = <&gpio TEGRA_GPIO(M, 6) GPIO_ACTIVE_HIGH>;
542
543 backlight = <&backlight>;
544 };
545
512 regulators { 546 regulators {
513 compatible = "simple-bus"; 547 compatible = "simple-bus";
514 #address-cells = <1>; 548 #address-cells = <1>;
@@ -522,6 +556,16 @@
522 regulator-max-microvolt = <5000000>; 556 regulator-max-microvolt = <5000000>;
523 regulator-always-on; 557 regulator-always-on;
524 }; 558 };
559
560 vdd_pnl_reg: regulator@1 {
561 compatible = "regulator-fixed";
562 reg = <1>;
563 regulator-name = "+3VS,vdd_pnl";
564 regulator-min-microvolt = <3300000>;
565 regulator-max-microvolt = <3300000>;
566 gpio = <&gpio TEGRA_GPIO(A, 4) GPIO_ACTIVE_HIGH>;
567 enable-active-high;
568 };
525 }; 569 };
526 570
527 sound { 571 sound {
diff --git a/arch/arm/boot/dts/tegra20-seaboard.dts b/arch/arm/boot/dts/tegra20-seaboard.dts
index a11b6e7b4759..a1d4bf9895d7 100644
--- a/arch/arm/boot/dts/tegra20-seaboard.dts
+++ b/arch/arm/boot/dts/tegra20-seaboard.dts
@@ -17,6 +17,14 @@
17 }; 17 };
18 18
19 host1x@50000000 { 19 host1x@50000000 {
20 dc@54200000 {
21 rgb {
22 status = "okay";
23
24 nvidia,panel = <&panel>;
25 };
26 };
27
20 hdmi@54280000 { 28 hdmi@54280000 {
21 status = "okay"; 29 status = "okay";
22 30
@@ -312,6 +320,10 @@
312 status = "okay"; 320 status = "okay";
313 }; 321 };
314 322
323 pwm: pwm@7000a000 {
324 status = "okay";
325 };
326
315 i2c@7000c000 { 327 i2c@7000c000 {
316 status = "okay"; 328 status = "okay";
317 clock-frequency = <400000>; 329 clock-frequency = <400000>;
@@ -369,7 +381,7 @@
369 #size-cells = <0>; 381 #size-cells = <0>;
370 }; 382 };
371 383
372 i2c@1 { 384 lvds_ddc: i2c@1 {
373 reg = <1>; 385 reg = <1>;
374 #address-cells = <1>; 386 #address-cells = <1>;
375 #size-cells = <0>; 387 #size-cells = <0>;
@@ -762,6 +774,17 @@
762 non-removable; 774 non-removable;
763 }; 775 };
764 776
777 backlight: backlight {
778 compatible = "pwm-backlight";
779
780 enable-gpios = <&gpio TEGRA_GPIO(D, 4) GPIO_ACTIVE_HIGH>;
781 power-supply = <&vdd_bl_reg>;
782 pwms = <&pwm 2 5000000>;
783
784 brightness-levels = <0 4 8 16 32 64 128 255>;
785 default-brightness-level = <6>;
786 };
787
765 clocks { 788 clocks {
766 compatible = "simple-bus"; 789 compatible = "simple-bus";
767 #address-cells = <1>; 790 #address-cells = <1>;
@@ -795,6 +818,16 @@
795 }; 818 };
796 }; 819 };
797 820
821 panel: panel {
822 compatible = "chunghwa,claa101wa01a", "simple-panel";
823
824 power-supply = <&vdd_pnl_reg>;
825 enable-gpios = <&gpio TEGRA_GPIO(B, 2) GPIO_ACTIVE_HIGH>;
826
827 backlight = <&backlight>;
828 ddc-i2c-bus = <&lvds_ddc>;
829 };
830
798 regulators { 831 regulators {
799 compatible = "simple-bus"; 832 compatible = "simple-bus";
800 #address-cells = <1>; 833 #address-cells = <1>;
@@ -839,6 +872,26 @@
839 regulator-always-on; 872 regulator-always-on;
840 regulator-boot-on; 873 regulator-boot-on;
841 }; 874 };
875
876 vdd_pnl_reg: regulator@4 {
877 compatible = "regulator-fixed";
878 reg = <4>;
879 regulator-name = "vdd_pnl";
880 regulator-min-microvolt = <2800000>;
881 regulator-max-microvolt = <2800000>;
882 gpio = <&gpio TEGRA_GPIO(C, 6) GPIO_ACTIVE_HIGH>;
883 enable-active-high;
884 };
885
886 vdd_bl_reg: regulator@5 {
887 compatible = "regulator-fixed";
888 reg = <5>;
889 regulator-name = "vdd_bl";
890 regulator-min-microvolt = <2800000>;
891 regulator-max-microvolt = <2800000>;
892 gpio = <&gpio TEGRA_GPIO(W, 0) GPIO_ACTIVE_HIGH>;
893 enable-active-high;
894 };
842 }; 895 };
843 896
844 sound { 897 sound {
diff --git a/arch/arm/boot/dts/tegra20-ventana.dts b/arch/arm/boot/dts/tegra20-ventana.dts
index 571d12e6ac2d..ca8484cccddc 100644
--- a/arch/arm/boot/dts/tegra20-ventana.dts
+++ b/arch/arm/boot/dts/tegra20-ventana.dts
@@ -17,6 +17,14 @@
17 }; 17 };
18 18
19 host1x@50000000 { 19 host1x@50000000 {
20 dc@54200000 {
21 rgb {
22 status = "okay";
23
24 nvidia,panel = <&panel>;
25 };
26 };
27
20 hdmi@54280000 { 28 hdmi@54280000 {
21 status = "okay"; 29 status = "okay";
22 30
@@ -309,6 +317,10 @@
309 status = "okay"; 317 status = "okay";
310 }; 318 };
311 319
320 pwm: pwm@7000a000 {
321 status = "okay";
322 };
323
312 i2c@7000c000 { 324 i2c@7000c000 {
313 status = "okay"; 325 status = "okay";
314 clock-frequency = <400000>; 326 clock-frequency = <400000>;
@@ -359,7 +371,7 @@
359 #size-cells = <0>; 371 #size-cells = <0>;
360 }; 372 };
361 373
362 i2c@1 { 374 lvds_ddc: i2c@1 {
363 reg = <1>; 375 reg = <1>;
364 #address-cells = <1>; 376 #address-cells = <1>;
365 #size-cells = <0>; 377 #size-cells = <0>;
@@ -557,6 +569,17 @@
557 non-removable; 569 non-removable;
558 }; 570 };
559 571
572 backlight: backlight {
573 compatible = "pwm-backlight";
574
575 enable-gpios = <&gpio TEGRA_GPIO(D, 4) GPIO_ACTIVE_HIGH>;
576 power-supply = <&vdd_bl_reg>;
577 pwms = <&pwm 2 5000000>;
578
579 brightness-levels = <0 4 8 16 32 64 128 255>;
580 default-brightness-level = <6>;
581 };
582
560 clocks { 583 clocks {
561 compatible = "simple-bus"; 584 compatible = "simple-bus";
562 #address-cells = <1>; 585 #address-cells = <1>;
@@ -581,6 +604,16 @@
581 }; 604 };
582 }; 605 };
583 606
607 panel: panel {
608 compatible = "chunghwa,claa101wa01a", "simple-panel";
609
610 power-supply = <&vdd_pnl_reg>;
611 enable-gpios = <&gpio TEGRA_GPIO(B, 2) GPIO_ACTIVE_HIGH>;
612
613 backlight = <&backlight>;
614 ddc-i2c-bus = <&lvds_ddc>;
615 };
616
584 regulators { 617 regulators {
585 compatible = "simple-bus"; 618 compatible = "simple-bus";
586 #address-cells = <1>; 619 #address-cells = <1>;
@@ -614,7 +647,7 @@
614 enable-active-high; 647 enable-active-high;
615 }; 648 };
616 649
617 regulator@3 { 650 vdd_pnl_reg: regulator@3 {
618 compatible = "regulator-fixed"; 651 compatible = "regulator-fixed";
619 reg = <3>; 652 reg = <3>;
620 regulator-name = "vdd_pnl"; 653 regulator-name = "vdd_pnl";
@@ -624,7 +657,7 @@
624 enable-active-high; 657 enable-active-high;
625 }; 658 };
626 659
627 regulator@4 { 660 vdd_bl_reg: regulator@4 {
628 compatible = "regulator-fixed"; 661 compatible = "regulator-fixed";
629 reg = <4>; 662 reg = <4>;
630 regulator-name = "vdd_bl"; 663 regulator-name = "vdd_bl";
diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
index 48d2a7f4d0c0..a7ddf70df50b 100644
--- a/arch/arm/boot/dts/tegra20.dtsi
+++ b/arch/arm/boot/dts/tegra20.dtsi
@@ -556,6 +556,10 @@
556 GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ 556 GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */
557 interrupt-names = "intr", "msi"; 557 interrupt-names = "intr", "msi";
558 558
559 #interrupt-cells = <1>;
560 interrupt-map-mask = <0 0 0 0>;
561 interrupt-map = <0 0 0 0 &intc GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>;
562
559 bus-range = <0x00 0xff>; 563 bus-range = <0x00 0xff>;
560 #address-cells = <3>; 564 #address-cells = <3>;
561 #size-cells = <2>; 565 #size-cells = <2>;
diff --git a/arch/arm/boot/dts/tegra30-cardhu.dtsi b/arch/arm/boot/dts/tegra30-cardhu.dtsi
index 1e156d9d0506..0cf0848a82d8 100644
--- a/arch/arm/boot/dts/tegra30-cardhu.dtsi
+++ b/arch/arm/boot/dts/tegra30-cardhu.dtsi
@@ -187,6 +187,13 @@
187 interrupt-parent = <&gpio>; 187 interrupt-parent = <&gpio>;
188 interrupts = <TEGRA_GPIO(L, 0) IRQ_TYPE_LEVEL_HIGH>; 188 interrupts = <TEGRA_GPIO(L, 0) IRQ_TYPE_LEVEL_HIGH>;
189 }; 189 };
190
191 i2cmux@70 {
192 compatible = "nxp,pca9546";
193 #address-cells = <1>;
194 #size-cells = <0>;
195 reg = <0x70>;
196 };
190 }; 197 };
191 198
192 i2c@7000c700 { 199 i2c@7000c700 {
diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
index 19a84e933f4e..dec4fc823901 100644
--- a/arch/arm/boot/dts/tegra30.dtsi
+++ b/arch/arm/boot/dts/tegra30.dtsi
@@ -28,6 +28,10 @@
28 GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */ 28 GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>; /* MSI interrupt */
29 interrupt-names = "intr", "msi"; 29 interrupt-names = "intr", "msi";
30 30
31 #interrupt-cells = <1>;
32 interrupt-map-mask = <0 0 0 0>;
33 interrupt-map = <0 0 0 0 &intc GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>;
34
31 bus-range = <0x00 0xff>; 35 bus-range = <0x00 0xff>;
32 #address-cells = <3>; 36 #address-cells = <3>;
33 #size-cells = <2>; 37 #size-cells = <2>;
@@ -144,9 +148,9 @@
144 compatible = "nvidia,tegra30-gr2d"; 148 compatible = "nvidia,tegra30-gr2d";
145 reg = <0x54140000 0x00040000>; 149 reg = <0x54140000 0x00040000>;
146 interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>; 150 interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
151 clocks = <&tegra_car TEGRA30_CLK_GR2D>;
147 resets = <&tegra_car 21>; 152 resets = <&tegra_car 21>;
148 reset-names = "2d"; 153 reset-names = "2d";
149 clocks = <&tegra_car TEGRA30_CLK_GR2D>;
150 }; 154 };
151 155
152 gr3d@54180000 { 156 gr3d@54180000 {
diff --git a/arch/arm/boot/dts/tps65910.dtsi b/arch/arm/boot/dts/tps65910.dtsi
index 92693a89160e..b0ac6657a170 100644
--- a/arch/arm/boot/dts/tps65910.dtsi
+++ b/arch/arm/boot/dts/tps65910.dtsi
@@ -82,5 +82,10 @@
82 reg = <12>; 82 reg = <12>;
83 regulator-compatible = "vmmc"; 83 regulator-compatible = "vmmc";
84 }; 84 };
85
86 vbb_reg: regulator@13 {
87 reg = <13>;
88 regulator-compatible = "vbb";
89 };
85 }; 90 };
86}; 91};
diff --git a/arch/arm/boot/dts/twl4030.dtsi b/arch/arm/boot/dts/twl4030.dtsi
index 4217096ee677..86cfc7d15ca7 100644
--- a/arch/arm/boot/dts/twl4030.dtsi
+++ b/arch/arm/boot/dts/twl4030.dtsi
@@ -145,4 +145,11 @@
145 compatible = "ti,twl4030-pwrbutton"; 145 compatible = "ti,twl4030-pwrbutton";
146 interrupts = <8>; 146 interrupts = <8>;
147 }; 147 };
148
149 twl_keypad: keypad {
150 compatible = "ti,twl4030-keypad";
151 interrupts = <1>;
152 keypad,num-rows = <8>;
153 keypad,num-columns = <8>;
154 };
148}; 155};
diff --git a/arch/arm/boot/dts/vf610-cosmic.dts b/arch/arm/boot/dts/vf610-cosmic.dts
index c42e4f938dcd..3fd1b74e1216 100644
--- a/arch/arm/boot/dts/vf610-cosmic.dts
+++ b/arch/arm/boot/dts/vf610-cosmic.dts
@@ -36,12 +36,37 @@
36&fec1 { 36&fec1 {
37 phy-mode = "rmii"; 37 phy-mode = "rmii";
38 pinctrl-names = "default"; 38 pinctrl-names = "default";
39 pinctrl-0 = <&pinctrl_fec1_1>; 39 pinctrl-0 = <&pinctrl_fec1>;
40 status = "okay"; 40 status = "okay";
41}; 41};
42 42
43&iomuxc {
44 vf610-cosmic {
45 pinctrl_fec1: fec1grp {
46 fsl,pins = <
47 VF610_PAD_PTC9__ENET_RMII1_MDC 0x30d2
48 VF610_PAD_PTC10__ENET_RMII1_MDIO 0x30d3
49 VF610_PAD_PTC11__ENET_RMII1_CRS 0x30d1
50 VF610_PAD_PTC12__ENET_RMII_RXD1 0x30d1
51 VF610_PAD_PTC13__ENET_RMII1_RXD0 0x30d1
52 VF610_PAD_PTC14__ENET_RMII1_RXER 0x30d1
53 VF610_PAD_PTC15__ENET_RMII1_TXD1 0x30d2
54 VF610_PAD_PTC16__ENET_RMII1_TXD0 0x30d2
55 VF610_PAD_PTC17__ENET_RMII1_TXEN 0x30d2
56 >;
57 };
58
59 pinctrl_uart1: uart1grp {
60 fsl,pins = <
61 VF610_PAD_PTB4__UART1_TX 0x21a2
62 VF610_PAD_PTB5__UART1_RX 0x21a1
63 >;
64 };
65 };
66};
67
43&uart1 { 68&uart1 {
44 pinctrl-names = "default"; 69 pinctrl-names = "default";
45 pinctrl-0 = <&pinctrl_uart1_1>; 70 pinctrl-0 = <&pinctrl_uart1>;
46 status = "okay"; 71 status = "okay";
47}; 72};
diff --git a/arch/arm/boot/dts/vf610-twr.dts b/arch/arm/boot/dts/vf610-twr.dts
index c8047ca16501..7dd1d6ede525 100644
--- a/arch/arm/boot/dts/vf610-twr.dts
+++ b/arch/arm/boot/dts/vf610-twr.dts
@@ -34,12 +34,70 @@
34 }; 34 };
35 }; 35 };
36 36
37 regulators {
38 compatible = "simple-bus";
39 #address-cells = <1>;
40 #size-cells = <0>;
41
42 reg_3p3v: regulator@0 {
43 compatible = "regulator-fixed";
44 reg = <0>;
45 regulator-name = "3P3V";
46 regulator-min-microvolt = <3300000>;
47 regulator-max-microvolt = <3300000>;
48 regulator-always-on;
49 };
50
51 reg_vcc_3v3_mcu: regulator@1 {
52 compatible = "regulator-fixed";
53 reg = <1>;
54 regulator-name = "vcc_3v3_mcu";
55 regulator-min-microvolt = <3300000>;
56 regulator-max-microvolt = <3300000>;
57 };
58 };
59
60 sound {
61 compatible = "simple-audio-card";
62 simple-audio-card,format = "i2s";
63 simple-audio-card,widgets =
64 "Microphone", "Microphone Jack",
65 "Headphone", "Headphone Jack",
66 "Speaker", "Speaker Ext",
67 "Line", "Line In Jack";
68 simple-audio-card,routing =
69 "MIC_IN", "Microphone Jack",
70 "Microphone Jack", "Mic Bias",
71 "LINE_IN", "Line In Jack",
72 "Headphone Jack", "HP_OUT",
73 "Speaker Ext", "LINE_OUT";
74
75 simple-audio-card,cpu {
76 sound-dai = <&sai2>;
77 master-clkdir-out;
78 frame-master;
79 bitclock-master;
80 };
81
82 simple-audio-card,codec {
83 sound-dai = <&codec>;
84 frame-master;
85 bitclock-master;
86 };
87 };
88};
89
90&adc0 {
91 pinctrl-names = "default";
92 pinctrl-0 = <&pinctrl_adc0_ad5>;
93 vref-supply = <&reg_vcc_3v3_mcu>;
94 status = "okay";
37}; 95};
38 96
39&dspi0 { 97&dspi0 {
40 bus-num = <0>; 98 bus-num = <0>;
41 pinctrl-names = "default"; 99 pinctrl-names = "default";
42 pinctrl-0 = <&pinctrl_dspi0_1>; 100 pinctrl-0 = <&pinctrl_dspi0>;
43 status = "okay"; 101 status = "okay";
44 102
45 sflash: at26df081a@0 { 103 sflash: at26df081a@0 {
@@ -56,26 +114,116 @@
56&fec0 { 114&fec0 {
57 phy-mode = "rmii"; 115 phy-mode = "rmii";
58 pinctrl-names = "default"; 116 pinctrl-names = "default";
59 pinctrl-0 = <&pinctrl_fec0_1>; 117 pinctrl-0 = <&pinctrl_fec0>;
60 status = "okay"; 118 status = "okay";
61}; 119};
62 120
63&fec1 { 121&fec1 {
64 phy-mode = "rmii"; 122 phy-mode = "rmii";
65 pinctrl-names = "default"; 123 pinctrl-names = "default";
66 pinctrl-0 = <&pinctrl_fec1_1>; 124 pinctrl-0 = <&pinctrl_fec1>;
67 status = "okay"; 125 status = "okay";
68}; 126};
69 127
70&i2c0 { 128&i2c0 {
71 clock-frequency = <100000>; 129 clock-frequency = <100000>;
72 pinctrl-names = "default"; 130 pinctrl-names = "default";
73 pinctrl-0 = <&pinctrl_i2c0_1>; 131 pinctrl-0 = <&pinctrl_i2c0>;
132 status = "okay";
133
134 codec: sgtl5000@0a {
135 #sound-dai-cells = <0>;
136 compatible = "fsl,sgtl5000";
137 reg = <0x0a>;
138 VDDA-supply = <&reg_3p3v>;
139 VDDIO-supply = <&reg_3p3v>;
140 clocks = <&clks VF610_CLK_SAI2>;
141 };
142};
143
144&iomuxc {
145 vf610-twr {
146 pinctrl_adc0_ad5: adc0ad5grp {
147 fsl,pins = <
148 VF610_PAD_PTC30__ADC0_SE5 0xa1
149 >;
150 };
151
152 pinctrl_dspi0: dspi0grp {
153 fsl,pins = <
154 VF610_PAD_PTB19__DSPI0_CS0 0x1182
155 VF610_PAD_PTB20__DSPI0_SIN 0x1181
156 VF610_PAD_PTB21__DSPI0_SOUT 0x1182
157 VF610_PAD_PTB22__DSPI0_SCK 0x1182
158 >;
159 };
160
161 pinctrl_fec0: fec0grp {
162 fsl,pins = <
163 VF610_PAD_PTA6__RMII_CLKIN 0x30d1
164 VF610_PAD_PTC0__ENET_RMII0_MDC 0x30d3
165 VF610_PAD_PTC1__ENET_RMII0_MDIO 0x30d1
166 VF610_PAD_PTC2__ENET_RMII0_CRS 0x30d1
167 VF610_PAD_PTC3__ENET_RMII0_RXD1 0x30d1
168 VF610_PAD_PTC4__ENET_RMII0_RXD0 0x30d1
169 VF610_PAD_PTC5__ENET_RMII0_RXER 0x30d1
170 VF610_PAD_PTC6__ENET_RMII0_TXD1 0x30d2
171 VF610_PAD_PTC7__ENET_RMII0_TXD0 0x30d2
172 VF610_PAD_PTC8__ENET_RMII0_TXEN 0x30d2
173 >;
174 };
175
176 pinctrl_fec1: fec1grp {
177 fsl,pins = <
178 VF610_PAD_PTC9__ENET_RMII1_MDC 0x30d2
179 VF610_PAD_PTC10__ENET_RMII1_MDIO 0x30d3
180 VF610_PAD_PTC11__ENET_RMII1_CRS 0x30d1
181 VF610_PAD_PTC12__ENET_RMII_RXD1 0x30d1
182 VF610_PAD_PTC13__ENET_RMII1_RXD0 0x30d1
183 VF610_PAD_PTC14__ENET_RMII1_RXER 0x30d1
184 VF610_PAD_PTC15__ENET_RMII1_TXD1 0x30d2
185 VF610_PAD_PTC16__ENET_RMII1_TXD0 0x30d2
186 VF610_PAD_PTC17__ENET_RMII1_TXEN 0x30d2
187 >;
188 };
189
190 pinctrl_i2c0: i2c0grp {
191 fsl,pins = <
192 VF610_PAD_PTB14__I2C0_SCL 0x30d3
193 VF610_PAD_PTB15__I2C0_SDA 0x30d3
194 >;
195 };
196
197 pinctrl_sai2: sai2grp {
198 fsl,pins = <
199 VF610_PAD_PTA16__SAI2_TX_BCLK 0x02ed
200 VF610_PAD_PTA18__SAI2_TX_DATA 0x02ee
201 VF610_PAD_PTA19__SAI2_TX_SYNC 0x02ed
202 VF610_PAD_PTA21__SAI2_RX_BCLK 0x02ed
203 VF610_PAD_PTA22__SAI2_RX_DATA 0x02ed
204 VF610_PAD_PTA23__SAI2_RX_SYNC 0x02ed
205 VF610_PAD_PTB18__EXT_AUDIO_MCLK 0x02ed
206 >;
207 };
208
209 pinctrl_uart1: uart1grp {
210 fsl,pins = <
211 VF610_PAD_PTB4__UART1_TX 0x21a2
212 VF610_PAD_PTB5__UART1_RX 0x21a1
213 >;
214 };
215 };
216};
217
218&sai2 {
219 #sound-dai-cells = <0>;
220 pinctrl-names = "default";
221 pinctrl-0 = <&pinctrl_sai2>;
74 status = "okay"; 222 status = "okay";
75}; 223};
76 224
77&uart1 { 225&uart1 {
78 pinctrl-names = "default"; 226 pinctrl-names = "default";
79 pinctrl-0 = <&pinctrl_uart1_1>; 227 pinctrl-0 = <&pinctrl_uart1>;
80 status = "okay"; 228 status = "okay";
81}; 229};
diff --git a/arch/arm/boot/dts/vf610.dtsi b/arch/arm/boot/dts/vf610.dtsi
index d31ce1b4a7b0..804873367669 100644
--- a/arch/arm/boot/dts/vf610.dtsi
+++ b/arch/arm/boot/dts/vf610.dtsi
@@ -10,6 +10,7 @@
10#include "skeleton.dtsi" 10#include "skeleton.dtsi"
11#include "vf610-pinfunc.h" 11#include "vf610-pinfunc.h"
12#include <dt-bindings/clock/vf610-clock.h> 12#include <dt-bindings/clock/vf610-clock.h>
13#include <dt-bindings/interrupt-controller/irq.h>
13 14
14/ { 15/ {
15 aliases { 16 aliases {
@@ -87,39 +88,66 @@
87 arm,tag-latency = <2 2 2>; 88 arm,tag-latency = <2 2 2>;
88 }; 89 };
89 90
91 edma0: dma-controller@40018000 {
92 #dma-cells = <2>;
93 compatible = "fsl,vf610-edma";
94 reg = <0x40018000 0x2000>,
95 <0x40024000 0x1000>,
96 <0x40025000 0x1000>;
97 interrupts = <0 8 IRQ_TYPE_LEVEL_HIGH>,
98 <0 9 IRQ_TYPE_LEVEL_HIGH>;
99 interrupt-names = "edma-tx", "edma-err";
100 dma-channels = <32>;
101 clock-names = "dmamux0", "dmamux1";
102 clocks = <&clks VF610_CLK_DMAMUX0>,
103 <&clks VF610_CLK_DMAMUX1>;
104 };
105
90 uart0: serial@40027000 { 106 uart0: serial@40027000 {
91 compatible = "fsl,vf610-lpuart"; 107 compatible = "fsl,vf610-lpuart";
92 reg = <0x40027000 0x1000>; 108 reg = <0x40027000 0x1000>;
93 interrupts = <0 61 0x00>; 109 interrupts = <0 61 IRQ_TYPE_LEVEL_HIGH>;
94 clocks = <&clks VF610_CLK_UART0>; 110 clocks = <&clks VF610_CLK_UART0>;
95 clock-names = "ipg"; 111 clock-names = "ipg";
112 dmas = <&edma0 0 2>,
113 <&edma0 0 3>;
114 dma-names = "rx","tx";
96 status = "disabled"; 115 status = "disabled";
97 }; 116 };
98 117
99 uart1: serial@40028000 { 118 uart1: serial@40028000 {
100 compatible = "fsl,vf610-lpuart"; 119 compatible = "fsl,vf610-lpuart";
101 reg = <0x40028000 0x1000>; 120 reg = <0x40028000 0x1000>;
102 interrupts = <0 62 0x04>; 121 interrupts = <0 62 IRQ_TYPE_LEVEL_HIGH>;
103 clocks = <&clks VF610_CLK_UART1>; 122 clocks = <&clks VF610_CLK_UART1>;
104 clock-names = "ipg"; 123 clock-names = "ipg";
124 dmas = <&edma0 0 4>,
125 <&edma0 0 5>;
126 dma-names = "rx","tx";
105 status = "disabled"; 127 status = "disabled";
106 }; 128 };
107 129
108 uart2: serial@40029000 { 130 uart2: serial@40029000 {
109 compatible = "fsl,vf610-lpuart"; 131 compatible = "fsl,vf610-lpuart";
110 reg = <0x40029000 0x1000>; 132 reg = <0x40029000 0x1000>;
111 interrupts = <0 63 0x04>; 133 interrupts = <0 63 IRQ_TYPE_LEVEL_HIGH>;
112 clocks = <&clks VF610_CLK_UART2>; 134 clocks = <&clks VF610_CLK_UART2>;
113 clock-names = "ipg"; 135 clock-names = "ipg";
136 dmas = <&edma0 0 6>,
137 <&edma0 0 7>;
138 dma-names = "rx","tx";
114 status = "disabled"; 139 status = "disabled";
115 }; 140 };
116 141
117 uart3: serial@4002a000 { 142 uart3: serial@4002a000 {
118 compatible = "fsl,vf610-lpuart"; 143 compatible = "fsl,vf610-lpuart";
119 reg = <0x4002a000 0x1000>; 144 reg = <0x4002a000 0x1000>;
120 interrupts = <0 64 0x04>; 145 interrupts = <0 64 IRQ_TYPE_LEVEL_HIGH>;
121 clocks = <&clks VF610_CLK_UART3>; 146 clocks = <&clks VF610_CLK_UART3>;
122 clock-names = "ipg"; 147 clock-names = "ipg";
148 dmas = <&edma0 0 8>,
149 <&edma0 0 9>;
150 dma-names = "rx","tx";
123 status = "disabled"; 151 status = "disabled";
124 }; 152 };
125 153
@@ -128,7 +156,7 @@
128 #size-cells = <0>; 156 #size-cells = <0>;
129 compatible = "fsl,vf610-dspi"; 157 compatible = "fsl,vf610-dspi";
130 reg = <0x4002c000 0x1000>; 158 reg = <0x4002c000 0x1000>;
131 interrupts = <0 67 0x04>; 159 interrupts = <0 67 IRQ_TYPE_LEVEL_HIGH>;
132 clocks = <&clks VF610_CLK_DSPI0>; 160 clocks = <&clks VF610_CLK_DSPI0>;
133 clock-names = "dspi"; 161 clock-names = "dspi";
134 spi-num-chipselects = <5>; 162 spi-num-chipselects = <5>;
@@ -138,20 +166,32 @@
138 sai2: sai@40031000 { 166 sai2: sai@40031000 {
139 compatible = "fsl,vf610-sai"; 167 compatible = "fsl,vf610-sai";
140 reg = <0x40031000 0x1000>; 168 reg = <0x40031000 0x1000>;
141 interrupts = <0 86 0x04>; 169 interrupts = <0 86 IRQ_TYPE_LEVEL_HIGH>;
142 clocks = <&clks VF610_CLK_SAI2>; 170 clocks = <&clks VF610_CLK_SAI2>;
143 clock-names = "sai"; 171 clock-names = "sai";
172 dma-names = "tx", "rx";
173 dmas = <&edma0 0 21>,
174 <&edma0 0 20>;
144 status = "disabled"; 175 status = "disabled";
145 }; 176 };
146 177
147 pit: pit@40037000 { 178 pit: pit@40037000 {
148 compatible = "fsl,vf610-pit"; 179 compatible = "fsl,vf610-pit";
149 reg = <0x40037000 0x1000>; 180 reg = <0x40037000 0x1000>;
150 interrupts = <0 39 0x04>; 181 interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>;
151 clocks = <&clks VF610_CLK_PIT>; 182 clocks = <&clks VF610_CLK_PIT>;
152 clock-names = "pit"; 183 clock-names = "pit";
153 }; 184 };
154 185
186 adc0: adc@4003b000 {
187 compatible = "fsl,vf610-adc";
188 reg = <0x4003b000 0x1000>;
189 interrupts = <0 53 0x04>;
190 clocks = <&clks VF610_CLK_ADC0>;
191 clock-names = "adc";
192 status = "disabled";
193 };
194
155 wdog@4003e000 { 195 wdog@4003e000 {
156 compatible = "fsl,vf610-wdt", "fsl,imx21-wdt"; 196 compatible = "fsl,vf610-wdt", "fsl,imx21-wdt";
157 reg = <0x4003e000 0x1000>; 197 reg = <0x4003e000 0x1000>;
@@ -164,7 +204,7 @@
164 #size-cells = <0>; 204 #size-cells = <0>;
165 compatible = "fsl,vf610-qspi"; 205 compatible = "fsl,vf610-qspi";
166 reg = <0x40044000 0x1000>; 206 reg = <0x40044000 0x1000>;
167 interrupts = <0 24 0x04>; 207 interrupts = <0 24 IRQ_TYPE_LEVEL_HIGH>;
168 clocks = <&clks VF610_CLK_QSPI0_EN>, 208 clocks = <&clks VF610_CLK_QSPI0_EN>,
169 <&clks VF610_CLK_QSPI0>; 209 <&clks VF610_CLK_QSPI0>;
170 clock-names = "qspi_en", "qspi"; 210 clock-names = "qspi_en", "qspi";
@@ -175,182 +215,12 @@
175 compatible = "fsl,vf610-iomuxc"; 215 compatible = "fsl,vf610-iomuxc";
176 reg = <0x40048000 0x1000>; 216 reg = <0x40048000 0x1000>;
177 #gpio-range-cells = <3>; 217 #gpio-range-cells = <3>;
178
179 /* functions and groups pins */
180
181 dcu0 {
182 pinctrl_dcu0_1: dcu0grp_1 {
183 fsl,pins = <
184 VF610_PAD_PTB8__GPIO_30 0x42
185 VF610_PAD_PTE0__DCU0_HSYNC 0x42
186 VF610_PAD_PTE1__DCU0_VSYNC 0x42
187 VF610_PAD_PTE2__DCU0_PCLK 0x42
188 VF610_PAD_PTE4__DCU0_DE 0x42
189 VF610_PAD_PTE5__DCU0_R0 0x42
190 VF610_PAD_PTE6__DCU0_R1 0x42
191 VF610_PAD_PTE7__DCU0_R2 0x42
192 VF610_PAD_PTE8__DCU0_R3 0x42
193 VF610_PAD_PTE9__DCU0_R4 0x42
194 VF610_PAD_PTE10__DCU0_R5 0x42
195 VF610_PAD_PTE11__DCU0_R6 0x42
196 VF610_PAD_PTE12__DCU0_R7 0x42
197 VF610_PAD_PTE13__DCU0_G0 0x42
198 VF610_PAD_PTE14__DCU0_G1 0x42
199 VF610_PAD_PTE15__DCU0_G2 0x42
200 VF610_PAD_PTE16__DCU0_G3 0x42
201 VF610_PAD_PTE17__DCU0_G4 0x42
202 VF610_PAD_PTE18__DCU0_G5 0x42
203 VF610_PAD_PTE19__DCU0_G6 0x42
204 VF610_PAD_PTE20__DCU0_G7 0x42
205 VF610_PAD_PTE21__DCU0_B0 0x42
206 VF610_PAD_PTE22__DCU0_B1 0x42
207 VF610_PAD_PTE23__DCU0_B2 0x42
208 VF610_PAD_PTE24__DCU0_B3 0x42
209 VF610_PAD_PTE25__DCU0_B4 0x42
210 VF610_PAD_PTE26__DCU0_B5 0x42
211 VF610_PAD_PTE27__DCU0_B6 0x42
212 VF610_PAD_PTE28__DCU0_B7 0x42
213 >;
214 };
215 };
216
217 dspi0 {
218 pinctrl_dspi0_1: dspi0grp_1 {
219 fsl,pins = <
220 VF610_PAD_PTB19__DSPI0_CS0 0x1182
221 VF610_PAD_PTB20__DSPI0_SIN 0x1181
222 VF610_PAD_PTB21__DSPI0_SOUT 0x1182
223 VF610_PAD_PTB22__DSPI0_SCK 0x1182
224 >;
225 };
226 };
227
228 esdhc1 {
229 pinctrl_esdhc1_1: esdhc1grp_1 {
230 fsl,pins = <
231 VF610_PAD_PTA24__ESDHC1_CLK 0x31ef
232 VF610_PAD_PTA25__ESDHC1_CMD 0x31ef
233 VF610_PAD_PTA26__ESDHC1_DAT0 0x31ef
234 VF610_PAD_PTA27__ESDHC1_DAT1 0x31ef
235 VF610_PAD_PTA28__ESDHC1_DATA2 0x31ef
236 VF610_PAD_PTA29__ESDHC1_DAT3 0x31ef
237 VF610_PAD_PTA7__GPIO_134 0x219d
238 >;
239 };
240 };
241
242 fec0 {
243 pinctrl_fec0_1: fec0grp_1 {
244 fsl,pins = <
245 VF610_PAD_PTA6__RMII_CLKIN 0x30d1
246 VF610_PAD_PTC0__ENET_RMII0_MDC 0x30d3
247 VF610_PAD_PTC1__ENET_RMII0_MDIO 0x30d1
248 VF610_PAD_PTC2__ENET_RMII0_CRS 0x30d1
249 VF610_PAD_PTC3__ENET_RMII0_RXD1 0x30d1
250 VF610_PAD_PTC4__ENET_RMII0_RXD0 0x30d1
251 VF610_PAD_PTC5__ENET_RMII0_RXER 0x30d1
252 VF610_PAD_PTC6__ENET_RMII0_TXD1 0x30d2
253 VF610_PAD_PTC7__ENET_RMII0_TXD0 0x30d2
254 VF610_PAD_PTC8__ENET_RMII0_TXEN 0x30d2
255 >;
256 };
257 };
258
259 fec1 {
260 pinctrl_fec1_1: fec1grp_1 {
261 fsl,pins = <
262 VF610_PAD_PTC9__ENET_RMII1_MDC 0x30d2
263 VF610_PAD_PTC10__ENET_RMII1_MDIO 0x30d3
264 VF610_PAD_PTC11__ENET_RMII1_CRS 0x30d1
265 VF610_PAD_PTC12__ENET_RMII_RXD1 0x30d1
266 VF610_PAD_PTC13__ENET_RMII1_RXD0 0x30d1
267 VF610_PAD_PTC14__ENET_RMII1_RXER 0x30d1
268 VF610_PAD_PTC15__ENET_RMII1_TXD1 0x30d2
269 VF610_PAD_PTC16__ENET_RMII1_TXD0 0x30d2
270 VF610_PAD_PTC17__ENET_RMII1_TXEN 0x30d2
271 >;
272 };
273 };
274
275 i2c0 {
276 pinctrl_i2c0_1: i2c0grp_1 {
277 fsl,pins = <
278 VF610_PAD_PTB14__I2C0_SCL 0x30d3
279 VF610_PAD_PTB15__I2C0_SDA 0x30d3
280 >;
281 };
282 };
283
284 pwm0 {
285 pinctrl_pwm0_1: pwm0grp_1 {
286 fsl,pins = <
287 VF610_PAD_PTB0__FTM0_CH0 0x1582
288 VF610_PAD_PTB1__FTM0_CH1 0x1582
289 VF610_PAD_PTB2__FTM0_CH2 0x1582
290 VF610_PAD_PTB3__FTM0_CH3 0x1582
291 VF610_PAD_PTB6__FTM0_CH6 0x1582
292 VF610_PAD_PTB7__FTM0_CH7 0x1582
293 >;
294 };
295 };
296
297 qspi0 {
298 pinctrl_qspi0_1: qspi0grp_1 {
299 fsl,pins = <
300 VF610_PAD_PTD0__QSPI0_A_QSCK 0x307b
301 VF610_PAD_PTD1__QSPI0_A_CS0 0x307f
302 VF610_PAD_PTD2__QSPI0_A_DATA3 0x3073
303 VF610_PAD_PTD3__QSPI0_A_DATA2 0x3073
304 VF610_PAD_PTD4__QSPI0_A_DATA1 0x3073
305 VF610_PAD_PTD5__QSPI0_A_DATA0 0x307b
306 VF610_PAD_PTD7__QSPI0_B_QSCK 0x307b
307 VF610_PAD_PTD8__QSPI0_B_CS0 0x307f
308 VF610_PAD_PTD9__QSPI0_B_DATA3 0x3073
309 VF610_PAD_PTD10__QSPI0_B_DATA2 0x3073
310 VF610_PAD_PTD11__QSPI0_B_DATA1 0x3073
311 VF610_PAD_PTD12__QSPI0_B_DATA0 0x307b
312 >;
313 };
314 };
315
316 sai2 {
317 pinctrl_sai2_1: sai2grp_1 {
318 fsl,pins = <
319 VF610_PAD_PTA16__SAI2_TX_BCLK 0x02ed
320 VF610_PAD_PTA18__SAI2_TX_DATA 0x02ee
321 VF610_PAD_PTA19__SAI2_TX_SYNC 0x02ed
322 VF610_PAD_PTA21__SAI2_RX_BCLK 0x02ed
323 VF610_PAD_PTA22__SAI2_RX_DATA 0x02ed
324 VF610_PAD_PTA23__SAI2_RX_SYNC 0x02ed
325 VF610_PAD_PTB18__EXT_AUDIO_MCLK 0x02ed
326 >;
327 };
328 };
329
330 uart1 {
331 pinctrl_uart1_1: uart1grp_1 {
332 fsl,pins = <
333 VF610_PAD_PTB4__UART1_TX 0x21a2
334 VF610_PAD_PTB5__UART1_RX 0x21a1
335 >;
336 };
337 };
338
339 usbvbus {
340 pinctrl_usbvbus_1: usbvbusgrp_1 {
341 fsl,pins = <
342 VF610_PAD_PTA24__USB1_VBUS_EN 0x219c
343 VF610_PAD_PTA16__USB0_VBUS_EN 0x219c
344 >;
345 };
346 };
347
348 }; 218 };
349 219
350 gpio1: gpio@40049000 { 220 gpio1: gpio@40049000 {
351 compatible = "fsl,vf610-gpio"; 221 compatible = "fsl,vf610-gpio";
352 reg = <0x40049000 0x1000 0x400ff000 0x40>; 222 reg = <0x40049000 0x1000 0x400ff000 0x40>;
353 interrupts = <0 107 0x04>; 223 interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
354 gpio-controller; 224 gpio-controller;
355 #gpio-cells = <2>; 225 #gpio-cells = <2>;
356 interrupt-controller; 226 interrupt-controller;
@@ -361,7 +231,7 @@
361 gpio2: gpio@4004a000 { 231 gpio2: gpio@4004a000 {
362 compatible = "fsl,vf610-gpio"; 232 compatible = "fsl,vf610-gpio";
363 reg = <0x4004a000 0x1000 0x400ff040 0x40>; 233 reg = <0x4004a000 0x1000 0x400ff040 0x40>;
364 interrupts = <0 108 0x04>; 234 interrupts = <0 108 IRQ_TYPE_LEVEL_HIGH>;
365 gpio-controller; 235 gpio-controller;
366 #gpio-cells = <2>; 236 #gpio-cells = <2>;
367 interrupt-controller; 237 interrupt-controller;
@@ -372,7 +242,7 @@
372 gpio3: gpio@4004b000 { 242 gpio3: gpio@4004b000 {
373 compatible = "fsl,vf610-gpio"; 243 compatible = "fsl,vf610-gpio";
374 reg = <0x4004b000 0x1000 0x400ff080 0x40>; 244 reg = <0x4004b000 0x1000 0x400ff080 0x40>;
375 interrupts = <0 109 0x04>; 245 interrupts = <0 109 IRQ_TYPE_LEVEL_HIGH>;
376 gpio-controller; 246 gpio-controller;
377 #gpio-cells = <2>; 247 #gpio-cells = <2>;
378 interrupt-controller; 248 interrupt-controller;
@@ -383,7 +253,7 @@
383 gpio4: gpio@4004c000 { 253 gpio4: gpio@4004c000 {
384 compatible = "fsl,vf610-gpio"; 254 compatible = "fsl,vf610-gpio";
385 reg = <0x4004c000 0x1000 0x400ff0c0 0x40>; 255 reg = <0x4004c000 0x1000 0x400ff0c0 0x40>;
386 interrupts = <0 110 0x04>; 256 interrupts = <0 110 IRQ_TYPE_LEVEL_HIGH>;
387 gpio-controller; 257 gpio-controller;
388 #gpio-cells = <2>; 258 #gpio-cells = <2>;
389 interrupt-controller; 259 interrupt-controller;
@@ -394,7 +264,7 @@
394 gpio5: gpio@4004d000 { 264 gpio5: gpio@4004d000 {
395 compatible = "fsl,vf610-gpio"; 265 compatible = "fsl,vf610-gpio";
396 reg = <0x4004d000 0x1000 0x400ff100 0x40>; 266 reg = <0x4004d000 0x1000 0x400ff100 0x40>;
397 interrupts = <0 111 0x04>; 267 interrupts = <0 111 IRQ_TYPE_LEVEL_HIGH>;
398 gpio-controller; 268 gpio-controller;
399 #gpio-cells = <2>; 269 #gpio-cells = <2>;
400 interrupt-controller; 270 interrupt-controller;
@@ -412,9 +282,12 @@
412 #size-cells = <0>; 282 #size-cells = <0>;
413 compatible = "fsl,vf610-i2c"; 283 compatible = "fsl,vf610-i2c";
414 reg = <0x40066000 0x1000>; 284 reg = <0x40066000 0x1000>;
415 interrupts =<0 71 0x04>; 285 interrupts =<0 71 IRQ_TYPE_LEVEL_HIGH>;
416 clocks = <&clks VF610_CLK_I2C0>; 286 clocks = <&clks VF610_CLK_I2C0>;
417 clock-names = "ipg"; 287 clock-names = "ipg";
288 dmas = <&edma0 0 50>,
289 <&edma0 0 51>;
290 dma-names = "rx","tx";
418 status = "disabled"; 291 status = "disabled";
419 }; 292 };
420 293
@@ -432,10 +305,25 @@
432 reg = <0x40080000 0x80000>; 305 reg = <0x40080000 0x80000>;
433 ranges; 306 ranges;
434 307
308 edma1: dma-controller@40098000 {
309 #dma-cells = <2>;
310 compatible = "fsl,vf610-edma";
311 reg = <0x40098000 0x2000>,
312 <0x400a1000 0x1000>,
313 <0x400a2000 0x1000>;
314 interrupts = <0 10 IRQ_TYPE_LEVEL_HIGH>,
315 <0 11 IRQ_TYPE_LEVEL_HIGH>;
316 interrupt-names = "edma-tx", "edma-err";
317 dma-channels = <32>;
318 clock-names = "dmamux0", "dmamux1";
319 clocks = <&clks VF610_CLK_DMAMUX2>,
320 <&clks VF610_CLK_DMAMUX3>;
321 };
322
435 uart4: serial@400a9000 { 323 uart4: serial@400a9000 {
436 compatible = "fsl,vf610-lpuart"; 324 compatible = "fsl,vf610-lpuart";
437 reg = <0x400a9000 0x1000>; 325 reg = <0x400a9000 0x1000>;
438 interrupts = <0 65 0x04>; 326 interrupts = <0 65 IRQ_TYPE_LEVEL_HIGH>;
439 clocks = <&clks VF610_CLK_UART4>; 327 clocks = <&clks VF610_CLK_UART4>;
440 clock-names = "ipg"; 328 clock-names = "ipg";
441 status = "disabled"; 329 status = "disabled";
@@ -444,16 +332,25 @@
444 uart5: serial@400aa000 { 332 uart5: serial@400aa000 {
445 compatible = "fsl,vf610-lpuart"; 333 compatible = "fsl,vf610-lpuart";
446 reg = <0x400aa000 0x1000>; 334 reg = <0x400aa000 0x1000>;
447 interrupts = <0 66 0x04>; 335 interrupts = <0 66 IRQ_TYPE_LEVEL_HIGH>;
448 clocks = <&clks VF610_CLK_UART5>; 336 clocks = <&clks VF610_CLK_UART5>;
449 clock-names = "ipg"; 337 clock-names = "ipg";
450 status = "disabled"; 338 status = "disabled";
451 }; 339 };
452 340
341 adc1: adc@400bb000 {
342 compatible = "fsl,vf610-adc";
343 reg = <0x400bb000 0x1000>;
344 interrupts = <0 54 0x04>;
345 clocks = <&clks VF610_CLK_ADC1>;
346 clock-names = "adc";
347 status = "disabled";
348 };
349
453 fec0: ethernet@400d0000 { 350 fec0: ethernet@400d0000 {
454 compatible = "fsl,mvf600-fec"; 351 compatible = "fsl,mvf600-fec";
455 reg = <0x400d0000 0x1000>; 352 reg = <0x400d0000 0x1000>;
456 interrupts = <0 78 0x04>; 353 interrupts = <0 78 IRQ_TYPE_LEVEL_HIGH>;
457 clocks = <&clks VF610_CLK_ENET0>, 354 clocks = <&clks VF610_CLK_ENET0>,
458 <&clks VF610_CLK_ENET0>, 355 <&clks VF610_CLK_ENET0>,
459 <&clks VF610_CLK_ENET>; 356 <&clks VF610_CLK_ENET>;
@@ -464,7 +361,7 @@
464 fec1: ethernet@400d1000 { 361 fec1: ethernet@400d1000 {
465 compatible = "fsl,mvf600-fec"; 362 compatible = "fsl,mvf600-fec";
466 reg = <0x400d1000 0x1000>; 363 reg = <0x400d1000 0x1000>;
467 interrupts = <0 79 0x04>; 364 interrupts = <0 79 IRQ_TYPE_LEVEL_HIGH>;
468 clocks = <&clks VF610_CLK_ENET1>, 365 clocks = <&clks VF610_CLK_ENET1>,
469 <&clks VF610_CLK_ENET1>, 366 <&clks VF610_CLK_ENET1>,
470 <&clks VF610_CLK_ENET>; 367 <&clks VF610_CLK_ENET>;
diff --git a/arch/arm/boot/dts/zynq-7000.dtsi b/arch/arm/boot/dts/zynq-7000.dtsi
index 789d0bacc110..511180769af5 100644
--- a/arch/arm/boot/dts/zynq-7000.dtsi
+++ b/arch/arm/boot/dts/zynq-7000.dtsi
@@ -129,29 +129,28 @@
129 } ; 129 } ;
130 130
131 slcr: slcr@f8000000 { 131 slcr: slcr@f8000000 {
132 compatible = "xlnx,zynq-slcr"; 132 #address-cells = <1>;
133 #size-cells = <1>;
134 compatible = "xlnx,zynq-slcr", "syscon";
133 reg = <0xF8000000 0x1000>; 135 reg = <0xF8000000 0x1000>;
134 136 ranges;
135 clocks { 137 clkc: clkc@100 {
136 #address-cells = <1>; 138 #clock-cells = <1>;
137 #size-cells = <0>; 139 compatible = "xlnx,ps7-clkc";
138 140 ps-clk-frequency = <33333333>;
139 clkc: clkc { 141 fclk-enable = <0>;
140 #clock-cells = <1>; 142 clock-output-names = "armpll", "ddrpll", "iopll", "cpu_6or4x",
141 compatible = "xlnx,ps7-clkc"; 143 "cpu_3or2x", "cpu_2x", "cpu_1x", "ddr2x", "ddr3x",
142 ps-clk-frequency = <33333333>; 144 "dci", "lqspi", "smc", "pcap", "gem0", "gem1",
143 clock-output-names = "armpll", "ddrpll", "iopll", "cpu_6or4x", 145 "fclk0", "fclk1", "fclk2", "fclk3", "can0", "can1",
144 "cpu_3or2x", "cpu_2x", "cpu_1x", "ddr2x", "ddr3x", 146 "sdio0", "sdio1", "uart0", "uart1", "spi0", "spi1",
145 "dci", "lqspi", "smc", "pcap", "gem0", "gem1", 147 "dma", "usb0_aper", "usb1_aper", "gem0_aper",
146 "fclk0", "fclk1", "fclk2", "fclk3", "can0", "can1", 148 "gem1_aper", "sdio0_aper", "sdio1_aper",
147 "sdio0", "sdio1", "uart0", "uart1", "spi0", "spi1", 149 "spi0_aper", "spi1_aper", "can0_aper", "can1_aper",
148 "dma", "usb0_aper", "usb1_aper", "gem0_aper", 150 "i2c0_aper", "i2c1_aper", "uart0_aper", "uart1_aper",
149 "gem1_aper", "sdio0_aper", "sdio1_aper", 151 "gpio_aper", "lqspi_aper", "smc_aper", "swdt",
150 "spi0_aper", "spi1_aper", "can0_aper", "can1_aper", 152 "dbg_trc", "dbg_apb";
151 "i2c0_aper", "i2c1_aper", "uart0_aper", "uart1_aper", 153 reg = <0x100 0x100>;
152 "gpio_aper", "lqspi_aper", "smc_aper", "swdt",
153 "dbg_trc", "dbg_apb";
154 };
155 }; 154 };
156 }; 155 };
157 156
diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
index 4bdc41622c36..70b1eff477b3 100644
--- a/arch/arm/common/Makefile
+++ b/arch/arm/common/Makefile
@@ -13,6 +13,7 @@ obj-$(CONFIG_SHARP_SCOOP) += scoop.o
13obj-$(CONFIG_PCI_HOST_ITE8152) += it8152.o 13obj-$(CONFIG_PCI_HOST_ITE8152) += it8152.o
14obj-$(CONFIG_ARM_TIMER_SP804) += timer-sp.o 14obj-$(CONFIG_ARM_TIMER_SP804) += timer-sp.o
15obj-$(CONFIG_MCPM) += mcpm_head.o mcpm_entry.o mcpm_platsmp.o vlock.o 15obj-$(CONFIG_MCPM) += mcpm_head.o mcpm_entry.o mcpm_platsmp.o vlock.o
16CFLAGS_REMOVE_mcpm_entry.o = -pg
16AFLAGS_mcpm_head.o := -march=armv7-a 17AFLAGS_mcpm_head.o := -march=armv7-a
17AFLAGS_vlock.o := -march=armv7-a 18AFLAGS_vlock.o := -march=armv7-a
18obj-$(CONFIG_TI_PRIV_EDMA) += edma.o 19obj-$(CONFIG_TI_PRIV_EDMA) += edma.o
diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c
index a5c3dc38aa18..6ef146edd0cd 100644
--- a/arch/arm/common/scoop.c
+++ b/arch/arm/common/scoop.c
@@ -232,8 +232,6 @@ static int scoop_probe(struct platform_device *pdev)
232 232
233 return 0; 233 return 0;
234 234
235 if (devptr->gpio.base != -1)
236 temp = gpiochip_remove(&devptr->gpio);
237err_gpio: 235err_gpio:
238 platform_set_drvdata(pdev, NULL); 236 platform_set_drvdata(pdev, NULL);
239err_ioremap: 237err_ioremap:
diff --git a/arch/arm/common/timer-sp.c b/arch/arm/common/timer-sp.c
index 53c6a26b633d..fd6bff0c5b96 100644
--- a/arch/arm/common/timer-sp.c
+++ b/arch/arm/common/timer-sp.c
@@ -271,10 +271,14 @@ static void __init integrator_cp_of_init(struct device_node *np)
271 void __iomem *base; 271 void __iomem *base;
272 int irq; 272 int irq;
273 const char *name = of_get_property(np, "compatible", NULL); 273 const char *name = of_get_property(np, "compatible", NULL);
274 struct clk *clk;
274 275
275 base = of_iomap(np, 0); 276 base = of_iomap(np, 0);
276 if (WARN_ON(!base)) 277 if (WARN_ON(!base))
277 return; 278 return;
279 clk = of_clk_get(np, 0);
280 if (WARN_ON(IS_ERR(clk)))
281 return;
278 282
279 /* Ensure timer is disabled */ 283 /* Ensure timer is disabled */
280 writel(0, base + TIMER_CTRL); 284 writel(0, base + TIMER_CTRL);
@@ -283,13 +287,13 @@ static void __init integrator_cp_of_init(struct device_node *np)
283 goto err; 287 goto err;
284 288
285 if (!init_count) 289 if (!init_count)
286 sp804_clocksource_init(base, name); 290 __sp804_clocksource_and_sched_clock_init(base, name, clk, 0);
287 else { 291 else {
288 irq = irq_of_parse_and_map(np, 0); 292 irq = irq_of_parse_and_map(np, 0);
289 if (irq <= 0) 293 if (irq <= 0)
290 goto err; 294 goto err;
291 295
292 sp804_clockevents_init(base, irq, name); 296 __sp804_clockevents_init(base, irq, clk, name);
293 } 297 }
294 298
295 init_count++; 299 init_count++;
diff --git a/arch/arm/configs/ape6evm_defconfig b/arch/arm/configs/ape6evm_defconfig
index cb26c62dc722..bb396c0e5fda 100644
--- a/arch/arm/configs/ape6evm_defconfig
+++ b/arch/arm/configs/ape6evm_defconfig
@@ -48,6 +48,8 @@ CONFIG_IP_PNP_DHCP=y
48# CONFIG_IPV6_SIT is not set 48# CONFIG_IPV6_SIT is not set
49CONFIG_NETFILTER=y 49CONFIG_NETFILTER=y
50CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 50CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
51CONFIG_DEVTMPFS=y
52CONFIG_DEVTMPFS_MOUNT=y
51# CONFIG_FW_LOADER_USER_HELPER is not set 53# CONFIG_FW_LOADER_USER_HELPER is not set
52CONFIG_NETDEVICES=y 54CONFIG_NETDEVICES=y
53# CONFIG_NET_CADENCE is not set 55# CONFIG_NET_CADENCE is not set
diff --git a/arch/arm/configs/armadillo800eva_defconfig b/arch/arm/configs/armadillo800eva_defconfig
index 9287a62de830..065adddeee3e 100644
--- a/arch/arm/configs/armadillo800eva_defconfig
+++ b/arch/arm/configs/armadillo800eva_defconfig
@@ -58,6 +58,8 @@ CONFIG_IP_PNP_DHCP=y
58# CONFIG_IPV6 is not set 58# CONFIG_IPV6 is not set
59# CONFIG_WIRELESS is not set 59# CONFIG_WIRELESS is not set
60CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 60CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
61CONFIG_DEVTMPFS=y
62CONFIG_DEVTMPFS_MOUNT=y
61CONFIG_SCSI=y 63CONFIG_SCSI=y
62CONFIG_BLK_DEV_SD=y 64CONFIG_BLK_DEV_SD=y
63CONFIG_MD=y 65CONFIG_MD=y
diff --git a/arch/arm/configs/at91_dt_defconfig b/arch/arm/configs/at91_dt_defconfig
index 0b4e9b5210d8..300ded9acbe9 100644
--- a/arch/arm/configs/at91_dt_defconfig
+++ b/arch/arm/configs/at91_dt_defconfig
@@ -16,10 +16,12 @@ CONFIG_MODULE_UNLOAD=y
16CONFIG_ARCH_AT91=y 16CONFIG_ARCH_AT91=y
17CONFIG_SOC_AT91RM9200=y 17CONFIG_SOC_AT91RM9200=y
18CONFIG_SOC_AT91SAM9260=y 18CONFIG_SOC_AT91SAM9260=y
19CONFIG_SOC_AT91SAM9261=y
19CONFIG_SOC_AT91SAM9263=y 20CONFIG_SOC_AT91SAM9263=y
20CONFIG_SOC_AT91SAM9G45=y 21CONFIG_SOC_AT91SAM9G45=y
21CONFIG_SOC_AT91SAM9X5=y 22CONFIG_SOC_AT91SAM9X5=y
22CONFIG_SOC_AT91SAM9N12=y 23CONFIG_SOC_AT91SAM9N12=y
24CONFIG_SOC_AT91SAM9RL=y
23CONFIG_MACH_AT91RM9200_DT=y 25CONFIG_MACH_AT91RM9200_DT=y
24CONFIG_MACH_AT91SAM9_DT=y 26CONFIG_MACH_AT91SAM9_DT=y
25CONFIG_AT91_TIMER_HZ=128 27CONFIG_AT91_TIMER_HZ=128
@@ -119,6 +121,7 @@ CONFIG_INPUT_EVDEV=y
119CONFIG_KEYBOARD_GPIO=y 121CONFIG_KEYBOARD_GPIO=y
120# CONFIG_INPUT_MOUSE is not set 122# CONFIG_INPUT_MOUSE is not set
121CONFIG_INPUT_TOUCHSCREEN=y 123CONFIG_INPUT_TOUCHSCREEN=y
124CONFIG_TOUCHSCREEN_ADS7846=y
122# CONFIG_SERIO is not set 125# CONFIG_SERIO is not set
123CONFIG_LEGACY_PTY_COUNT=4 126CONFIG_LEGACY_PTY_COUNT=4
124CONFIG_SERIAL_ATMEL=y 127CONFIG_SERIAL_ATMEL=y
diff --git a/arch/arm/configs/at91sam9260_9g20_defconfig b/arch/arm/configs/at91sam9260_9g20_defconfig
index 2cd832918e9c..c4c160fc8791 100644
--- a/arch/arm/configs/at91sam9260_9g20_defconfig
+++ b/arch/arm/configs/at91sam9260_9g20_defconfig
@@ -3,6 +3,7 @@
3CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
4CONFIG_LOG_BUF_SHIFT=14 4CONFIG_LOG_BUF_SHIFT=14
5CONFIG_BLK_DEV_INITRD=y 5CONFIG_BLK_DEV_INITRD=y
6CONFIG_EMBEDDED=y
6CONFIG_SLAB=y 7CONFIG_SLAB=y
7CONFIG_MODULES=y 8CONFIG_MODULES=y
8CONFIG_MODULE_UNLOAD=y 9CONFIG_MODULE_UNLOAD=y
@@ -30,15 +31,12 @@ CONFIG_MACH_AT91SAM9_DT=y
30CONFIG_AT91_SLOW_CLOCK=y 31CONFIG_AT91_SLOW_CLOCK=y
31# CONFIG_ARM_THUMB is not set 32# CONFIG_ARM_THUMB is not set
32CONFIG_AEABI=y 33CONFIG_AEABI=y
33CONFIG_LEDS=y
34CONFIG_LEDS_CPU=y
35CONFIG_ZBOOT_ROM_TEXT=0x0 34CONFIG_ZBOOT_ROM_TEXT=0x0
36CONFIG_ZBOOT_ROM_BSS=0x0 35CONFIG_ZBOOT_ROM_BSS=0x0
37CONFIG_ARM_APPENDED_DTB=y 36CONFIG_ARM_APPENDED_DTB=y
38CONFIG_ARM_ATAG_DTB_COMPAT=y 37CONFIG_ARM_ATAG_DTB_COMPAT=y
39CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw" 38CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,3145728 root=/dev/ram0 rw"
40CONFIG_AUTO_ZRELADDR=y 39CONFIG_AUTO_ZRELADDR=y
41CONFIG_FPE_NWFPE=y
42CONFIG_NET=y 40CONFIG_NET=y
43CONFIG_PACKET=y 41CONFIG_PACKET=y
44CONFIG_UNIX=y 42CONFIG_UNIX=y
@@ -57,15 +55,14 @@ CONFIG_DEVTMPFS_MOUNT=y
57CONFIG_MTD=y 55CONFIG_MTD=y
58CONFIG_MTD_CMDLINE_PARTS=y 56CONFIG_MTD_CMDLINE_PARTS=y
59CONFIG_MTD_OF_PARTS=y 57CONFIG_MTD_OF_PARTS=y
60CONFIG_MTD_CHAR=y
61CONFIG_MTD_BLOCK=y 58CONFIG_MTD_BLOCK=y
62CONFIG_MTD_DATAFLASH=y 59CONFIG_MTD_DATAFLASH=y
63CONFIG_MTD_NAND=y 60CONFIG_MTD_NAND=y
64CONFIG_MTD_NAND_ATMEL=y 61CONFIG_MTD_NAND_ATMEL=y
62CONFIG_MTD_UBI=y
65CONFIG_BLK_DEV_LOOP=y 63CONFIG_BLK_DEV_LOOP=y
66CONFIG_BLK_DEV_RAM=y 64CONFIG_BLK_DEV_RAM=y
67CONFIG_BLK_DEV_RAM_SIZE=8192 65CONFIG_BLK_DEV_RAM_SIZE=8192
68CONFIG_MISC_DEVICES=y
69CONFIG_EEPROM_AT25=y 66CONFIG_EEPROM_AT25=y
70CONFIG_SCSI=y 67CONFIG_SCSI=y
71CONFIG_BLK_DEV_SD=y 68CONFIG_BLK_DEV_SD=y
@@ -112,8 +109,6 @@ CONFIG_SND_PCM_OSS=y
112CONFIG_SND_SEQUENCER_OSS=y 109CONFIG_SND_SEQUENCER_OSS=y
113# CONFIG_SND_VERBOSE_PROCFS is not set 110# CONFIG_SND_VERBOSE_PROCFS is not set
114CONFIG_USB=y 111CONFIG_USB=y
115CONFIG_USB_DEVICEFS=y
116# CONFIG_USB_DEVICE_CLASS is not set
117CONFIG_USB_MON=y 112CONFIG_USB_MON=y
118CONFIG_USB_OHCI_HCD=y 113CONFIG_USB_OHCI_HCD=y
119CONFIG_USB_STORAGE=y 114CONFIG_USB_STORAGE=y
diff --git a/arch/arm/configs/at91sam9rl_defconfig b/arch/arm/configs/at91sam9rl_defconfig
index 7b6f131cecd6..85f846ae9ff2 100644
--- a/arch/arm/configs/at91sam9rl_defconfig
+++ b/arch/arm/configs/at91sam9rl_defconfig
@@ -1,8 +1,8 @@
1CONFIG_EXPERIMENTAL=y
2# CONFIG_LOCALVERSION_AUTO is not set 1# CONFIG_LOCALVERSION_AUTO is not set
3# CONFIG_SWAP is not set 2# CONFIG_SWAP is not set
4CONFIG_SYSVIPC=y 3CONFIG_SYSVIPC=y
5CONFIG_LOG_BUF_SHIFT=14 4CONFIG_LOG_BUF_SHIFT=14
5CONFIG_EMBEDDED=y
6CONFIG_BLK_DEV_INITRD=y 6CONFIG_BLK_DEV_INITRD=y
7CONFIG_SLAB=y 7CONFIG_SLAB=y
8CONFIG_MODULES=y 8CONFIG_MODULES=y
@@ -14,20 +14,23 @@ CONFIG_ARCH_AT91=y
14CONFIG_ARCH_AT91SAM9RL=y 14CONFIG_ARCH_AT91SAM9RL=y
15CONFIG_MACH_AT91SAM9RLEK=y 15CONFIG_MACH_AT91SAM9RLEK=y
16# CONFIG_ARM_THUMB is not set 16# CONFIG_ARM_THUMB is not set
17CONFIG_AEABI=y
17CONFIG_ZBOOT_ROM_TEXT=0x0 18CONFIG_ZBOOT_ROM_TEXT=0x0
18CONFIG_ZBOOT_ROM_BSS=0x0 19CONFIG_ZBOOT_ROM_BSS=0x0
19CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,17105363 root=/dev/ram0 rw" 20CONFIG_CMDLINE="mem=64M console=ttyS0,115200 initrd=0x21100000,17105363 root=/dev/ram0 rw"
20CONFIG_FPE_NWFPE=y 21CONFIG_AUTO_ZRELADDR=y
21CONFIG_NET=y 22CONFIG_NET=y
22CONFIG_UNIX=y 23CONFIG_UNIX=y
23CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 24CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
25CONFIG_DEVTMPFS=y
26CONFIG_DEVTMPFS_MOUNT=y
24CONFIG_MTD=y 27CONFIG_MTD=y
25CONFIG_MTD_CMDLINE_PARTS=y 28CONFIG_MTD_CMDLINE_PARTS=y
26CONFIG_MTD_CHAR=y
27CONFIG_MTD_BLOCK=y 29CONFIG_MTD_BLOCK=y
28CONFIG_MTD_DATAFLASH=y 30CONFIG_MTD_DATAFLASH=y
29CONFIG_MTD_NAND=y 31CONFIG_MTD_NAND=y
30CONFIG_MTD_NAND_ATMEL=y 32CONFIG_MTD_NAND_ATMEL=y
33CONFIG_MTD_UBI=y
31CONFIG_BLK_DEV_LOOP=y 34CONFIG_BLK_DEV_LOOP=y
32CONFIG_BLK_DEV_RAM=y 35CONFIG_BLK_DEV_RAM=y
33CONFIG_BLK_DEV_RAM_COUNT=4 36CONFIG_BLK_DEV_RAM_COUNT=4
@@ -66,6 +69,7 @@ CONFIG_EXT2_FS=y
66CONFIG_MSDOS_FS=y 69CONFIG_MSDOS_FS=y
67CONFIG_VFAT_FS=y 70CONFIG_VFAT_FS=y
68CONFIG_TMPFS=y 71CONFIG_TMPFS=y
72CONFIG_UBIFS_FS=y
69CONFIG_CRAMFS=y 73CONFIG_CRAMFS=y
70CONFIG_NLS_CODEPAGE_437=y 74CONFIG_NLS_CODEPAGE_437=y
71CONFIG_NLS_CODEPAGE_850=y 75CONFIG_NLS_CODEPAGE_850=y
diff --git a/arch/arm/configs/bcm2835_defconfig b/arch/arm/configs/bcm2835_defconfig
index f43392dc2dcf..0302d293fba0 100644
--- a/arch/arm/configs/bcm2835_defconfig
+++ b/arch/arm/configs/bcm2835_defconfig
@@ -31,6 +31,7 @@ CONFIG_OPROFILE=y
31CONFIG_JUMP_LABEL=y 31CONFIG_JUMP_LABEL=y
32CONFIG_ARCH_MULTI_V6=y 32CONFIG_ARCH_MULTI_V6=y
33# CONFIG_ARCH_MULTI_V7 is not set 33# CONFIG_ARCH_MULTI_V7 is not set
34CONFIG_ARCH_BCM=y
34CONFIG_ARCH_BCM2835=y 35CONFIG_ARCH_BCM2835=y
35CONFIG_PREEMPT_VOLUNTARY=y 36CONFIG_PREEMPT_VOLUNTARY=y
36CONFIG_AEABI=y 37CONFIG_AEABI=y
diff --git a/arch/arm/configs/bcm_defconfig b/arch/arm/configs/bcm_defconfig
index 2519d6de0640..01004640ee4d 100644
--- a/arch/arm/configs/bcm_defconfig
+++ b/arch/arm/configs/bcm_defconfig
@@ -79,6 +79,13 @@ CONFIG_HW_RANDOM=y
79CONFIG_I2C=y 79CONFIG_I2C=y
80CONFIG_I2C_CHARDEV=y 80CONFIG_I2C_CHARDEV=y
81# CONFIG_HWMON is not set 81# CONFIG_HWMON is not set
82CONFIG_MFD_BCM590XX=y
83CONFIG_REGULATOR=y
84CONFIG_REGULATOR_FIXED_VOLTAGE=y
85CONFIG_REGULATOR_VIRTUAL_CONSUMER=y
86CONFIG_REGULATOR_USERSPACE_CONSUMER=y
87CONFIG_REGULATOR_BCM590XX=y
88
82CONFIG_VIDEO_OUTPUT_CONTROL=y 89CONFIG_VIDEO_OUTPUT_CONTROL=y
83CONFIG_FB=y 90CONFIG_FB=y
84CONFIG_BACKLIGHT_LCD_SUPPORT=y 91CONFIG_BACKLIGHT_LCD_SUPPORT=y
diff --git a/arch/arm/configs/bockw_defconfig b/arch/arm/configs/bockw_defconfig
index 80cff50beb34..e816140d81c5 100644
--- a/arch/arm/configs/bockw_defconfig
+++ b/arch/arm/configs/bockw_defconfig
@@ -44,6 +44,8 @@ CONFIG_IP_PNP_DHCP=y
44# CONFIG_INET_DIAG is not set 44# CONFIG_INET_DIAG is not set
45# CONFIG_IPV6 is not set 45# CONFIG_IPV6 is not set
46CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 46CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
47CONFIG_DEVTMPFS=y
48CONFIG_DEVTMPFS_MOUNT=y
47# CONFIG_STANDALONE is not set 49# CONFIG_STANDALONE is not set
48# CONFIG_PREVENT_FIRMWARE_BUILD is not set 50# CONFIG_PREVENT_FIRMWARE_BUILD is not set
49# CONFIG_FW_LOADER is not set 51# CONFIG_FW_LOADER is not set
diff --git a/arch/arm/configs/clps711x_defconfig b/arch/arm/configs/clps711x_defconfig
index 9e8c8316d6b0..0facf9da047c 100644
--- a/arch/arm/configs/clps711x_defconfig
+++ b/arch/arm/configs/clps711x_defconfig
@@ -15,7 +15,6 @@ CONFIG_ARCH_CDB89712=y
15CONFIG_ARCH_CLEP7312=y 15CONFIG_ARCH_CLEP7312=y
16CONFIG_ARCH_EDB7211=y 16CONFIG_ARCH_EDB7211=y
17CONFIG_ARCH_P720T=y 17CONFIG_ARCH_P720T=y
18CONFIG_ARCH_FORTUNET=y
19CONFIG_AEABI=y 18CONFIG_AEABI=y
20CONFIG_ZBOOT_ROM_TEXT=0x0 19CONFIG_ZBOOT_ROM_TEXT=0x0
21CONFIG_ZBOOT_ROM_BSS=0x0 20CONFIG_ZBOOT_ROM_BSS=0x0
@@ -27,7 +26,6 @@ CONFIG_INET=y
27# CONFIG_IPV6 is not set 26# CONFIG_IPV6 is not set
28CONFIG_IRDA=y 27CONFIG_IRDA=y
29CONFIG_IRTTY_SIR=y 28CONFIG_IRTTY_SIR=y
30CONFIG_EP7211_DONGLE=y
31# CONFIG_WIRELESS is not set 29# CONFIG_WIRELESS is not set
32CONFIG_MTD=y 30CONFIG_MTD=y
33CONFIG_MTD_CMDLINE_PARTS=y 31CONFIG_MTD_CMDLINE_PARTS=y
@@ -58,6 +56,7 @@ CONFIG_CS89x0_PLATFORM=y
58# CONFIG_INPUT is not set 56# CONFIG_INPUT is not set
59# CONFIG_SERIO is not set 57# CONFIG_SERIO is not set
60# CONFIG_VT is not set 58# CONFIG_VT is not set
59CONFIG_SERIAL_CLPS711X=y
61CONFIG_SERIAL_CLPS711X_CONSOLE=y 60CONFIG_SERIAL_CLPS711X_CONSOLE=y
62# CONFIG_HW_RANDOM is not set 61# CONFIG_HW_RANDOM is not set
63CONFIG_I2C=y 62CONFIG_I2C=y
diff --git a/arch/arm/configs/da8xx_omapl_defconfig b/arch/arm/configs/da8xx_omapl_defconfig
deleted file mode 100644
index 1571bea48bed..000000000000
--- a/arch/arm/configs/da8xx_omapl_defconfig
+++ /dev/null
@@ -1,139 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2# CONFIG_SWAP is not set
3CONFIG_SYSVIPC=y
4CONFIG_POSIX_MQUEUE=y
5CONFIG_IKCONFIG=y
6CONFIG_IKCONFIG_PROC=y
7CONFIG_LOG_BUF_SHIFT=14
8CONFIG_CGROUPS=y
9CONFIG_BLK_DEV_INITRD=y
10CONFIG_EXPERT=y
11CONFIG_MODULES=y
12CONFIG_MODULE_UNLOAD=y
13CONFIG_MODULE_FORCE_UNLOAD=y
14CONFIG_MODVERSIONS=y
15# CONFIG_BLK_DEV_BSG is not set
16# CONFIG_IOSCHED_DEADLINE is not set
17# CONFIG_IOSCHED_CFQ is not set
18CONFIG_ARCH_DAVINCI=y
19CONFIG_ARCH_DAVINCI_DA830=y
20CONFIG_ARCH_DAVINCI_DA850=y
21CONFIG_MACH_DA8XX_DT=y
22CONFIG_MACH_MITYOMAPL138=y
23CONFIG_MACH_OMAPL138_HAWKBOARD=y
24CONFIG_DAVINCI_RESET_CLOCKS=y
25CONFIG_NO_HZ=y
26CONFIG_HIGH_RES_TIMERS=y
27CONFIG_PREEMPT=y
28CONFIG_AEABI=y
29# CONFIG_OABI_COMPAT is not set
30CONFIG_LEDS=y
31CONFIG_USE_OF=y
32CONFIG_ZBOOT_ROM_TEXT=0x0
33CONFIG_ZBOOT_ROM_BSS=0x0
34CONFIG_CPU_FREQ=y
35CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
36CONFIG_CPU_FREQ_GOV_PERFORMANCE=m
37CONFIG_CPU_FREQ_GOV_POWERSAVE=m
38CONFIG_CPU_FREQ_GOV_ONDEMAND=m
39CONFIG_CPU_IDLE=y
40CONFIG_PM_RUNTIME=y
41CONFIG_NET=y
42CONFIG_PACKET=y
43CONFIG_UNIX=y
44CONFIG_INET=y
45CONFIG_IP_PNP=y
46CONFIG_IP_PNP_DHCP=y
47# CONFIG_INET_LRO is not set
48CONFIG_NETFILTER=y
49CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
50CONFIG_DEVTMPFS=y
51CONFIG_DEVTMPFS_MOUNT=y
52# CONFIG_FW_LOADER is not set
53CONFIG_BLK_DEV_LOOP=m
54CONFIG_BLK_DEV_RAM=y
55CONFIG_BLK_DEV_RAM_COUNT=1
56CONFIG_BLK_DEV_RAM_SIZE=32768
57CONFIG_EEPROM_AT24=y
58CONFIG_SCSI=m
59CONFIG_BLK_DEV_SD=m
60CONFIG_NETDEVICES=y
61CONFIG_TUN=m
62CONFIG_LXT_PHY=y
63CONFIG_LSI_ET1011C_PHY=y
64CONFIG_NET_ETHERNET=y
65CONFIG_MII=y
66CONFIG_TI_DAVINCI_EMAC=y
67# CONFIG_NETDEV_1000 is not set
68# CONFIG_NETDEV_10000 is not set
69CONFIG_NETCONSOLE=y
70CONFIG_NETPOLL_TRAP=y
71CONFIG_INPUT_MOUSEDEV=m
72CONFIG_INPUT_EVDEV=m
73CONFIG_INPUT_EVBUG=m
74CONFIG_KEYBOARD_ATKBD=m
75CONFIG_KEYBOARD_GPIO=y
76CONFIG_KEYBOARD_XTKBD=m
77# CONFIG_INPUT_MOUSE is not set
78CONFIG_INPUT_TOUCHSCREEN=y
79CONFIG_SERIO_LIBPS2=y
80# CONFIG_VT_CONSOLE is not set
81CONFIG_SERIAL_8250=y
82CONFIG_SERIAL_8250_CONSOLE=y
83CONFIG_SERIAL_8250_NR_UARTS=3
84CONFIG_SERIAL_OF_PLATFORM=y
85CONFIG_I2C=y
86CONFIG_I2C_CHARDEV=y
87CONFIG_I2C_DAVINCI=y
88CONFIG_PINCTRL_SINGLE=y
89# CONFIG_HWMON is not set
90CONFIG_WATCHDOG=y
91CONFIG_REGULATOR=y
92CONFIG_REGULATOR_DUMMY=y
93CONFIG_REGULATOR_TPS6507X=y
94CONFIG_FB=y
95CONFIG_FB_DA8XX=y
96# CONFIG_VGA_CONSOLE is not set
97CONFIG_FRAMEBUFFER_CONSOLE=y
98CONFIG_LOGO=y
99CONFIG_SOUND=m
100CONFIG_SND=m
101CONFIG_SND_SOC=m
102CONFIG_SND_DAVINCI_SOC=m
103# CONFIG_HID_SUPPORT is not set
104# CONFIG_USB_SUPPORT is not set
105CONFIG_DMADEVICES=y
106CONFIG_TI_EDMA=y
107CONFIG_EXT2_FS=y
108CONFIG_EXT3_FS=y
109CONFIG_XFS_FS=m
110CONFIG_INOTIFY=y
111CONFIG_AUTOFS4_FS=m
112CONFIG_MSDOS_FS=y
113CONFIG_VFAT_FS=y
114CONFIG_TMPFS=y
115CONFIG_CRAMFS=y
116CONFIG_MINIX_FS=m
117CONFIG_NFS_FS=y
118CONFIG_NFS_V3=y
119CONFIG_ROOT_NFS=y
120CONFIG_NFSD=m
121CONFIG_NFSD_V3=y
122CONFIG_SMB_FS=m
123CONFIG_PARTITION_ADVANCED=y
124CONFIG_NLS_CODEPAGE_437=y
125CONFIG_NLS_ASCII=m
126CONFIG_NLS_ISO8859_1=y
127CONFIG_NLS_UTF8=m
128CONFIG_DEBUG_FS=y
129CONFIG_DEBUG_KERNEL=y
130CONFIG_TIMER_STATS=y
131CONFIG_DEBUG_RT_MUTEXES=y
132CONFIG_DEBUG_MUTEXES=y
133# CONFIG_RCU_CPU_STALL_DETECTOR is not set
134CONFIG_DEBUG_USER=y
135CONFIG_DEBUG_ERRORS=y
136# CONFIG_CRYPTO_ANSI_CPRNG is not set
137# CONFIG_CRYPTO_HW is not set
138CONFIG_CRC_CCITT=m
139CONFIG_CRC_T10DIF=m
diff --git a/arch/arm/configs/davinci_all_defconfig b/arch/arm/configs/davinci_all_defconfig
index ab2f7378352c..2a282c051cfd 100644
--- a/arch/arm/configs/davinci_all_defconfig
+++ b/arch/arm/configs/davinci_all_defconfig
@@ -20,9 +20,14 @@ CONFIG_ARCH_DAVINCI_DM644x=y
20CONFIG_ARCH_DAVINCI_DM355=y 20CONFIG_ARCH_DAVINCI_DM355=y
21CONFIG_ARCH_DAVINCI_DM646x=y 21CONFIG_ARCH_DAVINCI_DM646x=y
22CONFIG_ARCH_DAVINCI_DM365=y 22CONFIG_ARCH_DAVINCI_DM365=y
23CONFIG_ARCH_DAVINCI_DA830=y
24CONFIG_ARCH_DAVINCI_DA850=y
25CONFIG_MACH_DA8XX_DT=y
23CONFIG_MACH_SFFSDR=y 26CONFIG_MACH_SFFSDR=y
24CONFIG_MACH_NEUROS_OSD2=y 27CONFIG_MACH_NEUROS_OSD2=y
25CONFIG_MACH_DM355_LEOPARD=y 28CONFIG_MACH_DM355_LEOPARD=y
29CONFIG_MACH_MITYOMAPL138=y
30CONFIG_MACH_OMAPL138_HAWKBOARD=y
26CONFIG_DAVINCI_MUX_DEBUG=y 31CONFIG_DAVINCI_MUX_DEBUG=y
27CONFIG_DAVINCI_MUX_WARNINGS=y 32CONFIG_DAVINCI_MUX_WARNINGS=y
28CONFIG_DAVINCI_RESET_CLOCKS=y 33CONFIG_DAVINCI_RESET_CLOCKS=y
@@ -32,8 +37,18 @@ CONFIG_PREEMPT=y
32CONFIG_AEABI=y 37CONFIG_AEABI=y
33# CONFIG_OABI_COMPAT is not set 38# CONFIG_OABI_COMPAT is not set
34CONFIG_LEDS=y 39CONFIG_LEDS=y
40CONFIG_USE_OF=y
35CONFIG_ZBOOT_ROM_TEXT=0x0 41CONFIG_ZBOOT_ROM_TEXT=0x0
36CONFIG_ZBOOT_ROM_BSS=0x0 42CONFIG_ZBOOT_ROM_BSS=0x0
43CONFIG_ARM_APPENDED_DTB=y
44CONFIG_ARM_ATAG_DTB_COMPAT=y
45CONFIG_AUTO_ZRELADDR=y
46CONFIG_CPU_FREQ=y
47CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
48CONFIG_CPU_FREQ_GOV_PERFORMANCE=m
49CONFIG_CPU_FREQ_GOV_POWERSAVE=m
50CONFIG_CPU_FREQ_GOV_ONDEMAND=m
51CONFIG_CPU_IDLE=y
37CONFIG_PM_RUNTIME=y 52CONFIG_PM_RUNTIME=y
38CONFIG_NET=y 53CONFIG_NET=y
39CONFIG_PACKET=y 54CONFIG_PACKET=y
@@ -57,6 +72,7 @@ CONFIG_MTD_CFI_AMDSTD=m
57CONFIG_MTD_PHYSMAP=m 72CONFIG_MTD_PHYSMAP=m
58CONFIG_MTD_NAND=m 73CONFIG_MTD_NAND=m
59CONFIG_MTD_NAND_DAVINCI=m 74CONFIG_MTD_NAND_DAVINCI=m
75CONFIG_PROC_DEVICETREE=y
60CONFIG_BLK_DEV_LOOP=m 76CONFIG_BLK_DEV_LOOP=m
61CONFIG_BLK_DEV_RAM=y 77CONFIG_BLK_DEV_RAM=y
62CONFIG_BLK_DEV_RAM_COUNT=1 78CONFIG_BLK_DEV_RAM_COUNT=1
@@ -71,6 +87,7 @@ CONFIG_TUN=m
71CONFIG_LXT_PHY=y 87CONFIG_LXT_PHY=y
72CONFIG_LSI_ET1011C_PHY=y 88CONFIG_LSI_ET1011C_PHY=y
73CONFIG_NET_ETHERNET=y 89CONFIG_NET_ETHERNET=y
90CONFIG_MII=y
74CONFIG_TI_DAVINCI_EMAC=y 91CONFIG_TI_DAVINCI_EMAC=y
75CONFIG_DM9000=y 92CONFIG_DM9000=y
76# CONFIG_NETDEV_1000 is not set 93# CONFIG_NETDEV_1000 is not set
@@ -97,15 +114,21 @@ CONFIG_SERIAL_8250=y
97CONFIG_SERIAL_8250_CONSOLE=y 114CONFIG_SERIAL_8250_CONSOLE=y
98CONFIG_SERIAL_8250_NR_UARTS=3 115CONFIG_SERIAL_8250_NR_UARTS=3
99# CONFIG_HW_RANDOM is not set 116# CONFIG_HW_RANDOM is not set
117CONFIG_SERIAL_OF_PLATFORM=y
100CONFIG_I2C=y 118CONFIG_I2C=y
101CONFIG_I2C_CHARDEV=y 119CONFIG_I2C_CHARDEV=y
102CONFIG_I2C_DAVINCI=y 120CONFIG_I2C_DAVINCI=y
121CONFIG_PINCTRL_SINGLE=y
103CONFIG_GPIO_PCF857X=y 122CONFIG_GPIO_PCF857X=y
104CONFIG_WATCHDOG=y 123CONFIG_WATCHDOG=y
105CONFIG_DAVINCI_WATCHDOG=m 124CONFIG_DAVINCI_WATCHDOG=m
106CONFIG_MFD_DM355EVM_MSP=y 125CONFIG_MFD_DM355EVM_MSP=y
126CONFIG_TPS6507X=y
107CONFIG_VIDEO_OUTPUT_CONTROL=m 127CONFIG_VIDEO_OUTPUT_CONTROL=m
128CONFIG_REGULATOR=y
129CONFIG_REGULATOR_TPS6507X=y
108CONFIG_FB=y 130CONFIG_FB=y
131CONFIG_FB_DA8XX=y
109CONFIG_FIRMWARE_EDID=y 132CONFIG_FIRMWARE_EDID=y
110# CONFIG_VGA_CONSOLE is not set 133# CONFIG_VGA_CONSOLE is not set
111CONFIG_FRAMEBUFFER_CONSOLE=y 134CONFIG_FRAMEBUFFER_CONSOLE=y
@@ -198,3 +221,5 @@ CONFIG_DEBUG_ERRORS=y
198# CONFIG_CRYPTO_ANSI_CPRNG is not set 221# CONFIG_CRYPTO_ANSI_CPRNG is not set
199# CONFIG_CRYPTO_HW is not set 222# CONFIG_CRYPTO_HW is not set
200CONFIG_CRC_T10DIF=m 223CONFIG_CRC_T10DIF=m
224CONFIG_GPIO_PCA953X=y
225CONFIG_KEYBOARD_GPIO_POLLED=y
diff --git a/arch/arm/configs/dove_defconfig b/arch/arm/configs/dove_defconfig
index 110105476848..f15955144175 100644
--- a/arch/arm/configs/dove_defconfig
+++ b/arch/arm/configs/dove_defconfig
@@ -48,7 +48,6 @@ CONFIG_MTD_CFI_INTELEXT=y
48CONFIG_MTD_CFI_STAA=y 48CONFIG_MTD_CFI_STAA=y
49CONFIG_MTD_PHYSMAP=y 49CONFIG_MTD_PHYSMAP=y
50CONFIG_MTD_M25P80=y 50CONFIG_MTD_M25P80=y
51CONFIG_MTD_UBI=y
52CONFIG_BLK_DEV_LOOP=y 51CONFIG_BLK_DEV_LOOP=y
53CONFIG_BLK_DEV_RAM=y 52CONFIG_BLK_DEV_RAM=y
54CONFIG_BLK_DEV_RAM_COUNT=1 53CONFIG_BLK_DEV_RAM_COUNT=1
@@ -80,6 +79,8 @@ CONFIG_SPI_ORION=y
80# CONFIG_HWMON is not set 79# CONFIG_HWMON is not set
81CONFIG_THERMAL=y 80CONFIG_THERMAL=y
82CONFIG_DOVE_THERMAL=y 81CONFIG_DOVE_THERMAL=y
82CONFIG_WATCHDOG=y
83CONFIG_ORION_WATCHDOG=y
83CONFIG_USB=y 84CONFIG_USB=y
84CONFIG_USB_XHCI_HCD=y 85CONFIG_USB_XHCI_HCD=y
85CONFIG_USB_EHCI_HCD=y 86CONFIG_USB_EHCI_HCD=y
diff --git a/arch/arm/configs/exynos_defconfig b/arch/arm/configs/exynos_defconfig
index dbe1f1c47bb0..4ce7b70ea901 100644
--- a/arch/arm/configs/exynos_defconfig
+++ b/arch/arm/configs/exynos_defconfig
@@ -94,7 +94,7 @@ CONFIG_FONT_7x14=y
94CONFIG_LOGO=y 94CONFIG_LOGO=y
95CONFIG_USB=y 95CONFIG_USB=y
96CONFIG_USB_EHCI_HCD=y 96CONFIG_USB_EHCI_HCD=y
97CONFIG_USB_EHCI_S5P=y 97CONFIG_USB_EHCI_EXYNOS=y
98CONFIG_USB_STORAGE=y 98CONFIG_USB_STORAGE=y
99CONFIG_USB_DWC3=y 99CONFIG_USB_DWC3=y
100CONFIG_USB_PHY=y 100CONFIG_USB_PHY=y
diff --git a/arch/arm/configs/genmai_defconfig b/arch/arm/configs/genmai_defconfig
index aa0b704f48af..d238fafb6762 100644
--- a/arch/arm/configs/genmai_defconfig
+++ b/arch/arm/configs/genmai_defconfig
@@ -50,6 +50,9 @@ CONFIG_IP_PNP_DHCP=y
50# CONFIG_IPV6 is not set 50# CONFIG_IPV6 is not set
51# CONFIG_WIRELESS is not set 51# CONFIG_WIRELESS is not set
52CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 52CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
53CONFIG_DEVTMPFS=y
54CONFIG_DEVTMPFS_MOUNT=y
55CONFIG_EEPROM_AT24=y
53CONFIG_NETDEVICES=y 56CONFIG_NETDEVICES=y
54# CONFIG_NET_CORE is not set 57# CONFIG_NET_CORE is not set
55# CONFIG_NET_VENDOR_ARC is not set 58# CONFIG_NET_VENDOR_ARC is not set
@@ -78,7 +81,10 @@ CONFIG_SERIAL_SH_SCI=y
78CONFIG_SERIAL_SH_SCI_NR_UARTS=10 81CONFIG_SERIAL_SH_SCI_NR_UARTS=10
79CONFIG_SERIAL_SH_SCI_CONSOLE=y 82CONFIG_SERIAL_SH_SCI_CONSOLE=y
80# CONFIG_HW_RANDOM is not set 83# CONFIG_HW_RANDOM is not set
81CONFIG_I2C_SH_MOBILE=y 84CONFIG_I2C_CHARDEV=y
85CONFIG_I2C_RIIC=y
86CONFIG_SPI=y
87CONFIG_SPI_RSPI=y
82# CONFIG_HWMON is not set 88# CONFIG_HWMON is not set
83CONFIG_THERMAL=y 89CONFIG_THERMAL=y
84CONFIG_RCAR_THERMAL=y 90CONFIG_RCAR_THERMAL=y
diff --git a/arch/arm/configs/imx_v4_v5_defconfig b/arch/arm/configs/imx_v4_v5_defconfig
index 6309ee52ccfc..f1aeb7d72712 100644
--- a/arch/arm/configs/imx_v4_v5_defconfig
+++ b/arch/arm/configs/imx_v4_v5_defconfig
@@ -154,6 +154,7 @@ CONFIG_USB=y
154CONFIG_USB_EHCI_HCD=y 154CONFIG_USB_EHCI_HCD=y
155CONFIG_USB_EHCI_MXC=y 155CONFIG_USB_EHCI_MXC=y
156CONFIG_MMC=y 156CONFIG_MMC=y
157CONFIG_MMC_UNSAFE_RESUME=y
157CONFIG_MMC_SDHCI=y 158CONFIG_MMC_SDHCI=y
158CONFIG_MMC_SDHCI_PLTFM=y 159CONFIG_MMC_SDHCI_PLTFM=y
159CONFIG_MMC_SDHCI_ESDHC_IMX=y 160CONFIG_MMC_SDHCI_ESDHC_IMX=y
diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index 53e82c2523eb..09e974392fa1 100644
--- a/arch/arm/configs/imx_v6_v7_defconfig
+++ b/arch/arm/configs/imx_v6_v7_defconfig
@@ -39,6 +39,8 @@ CONFIG_SOC_IMX53=y
39CONFIG_SOC_IMX6Q=y 39CONFIG_SOC_IMX6Q=y
40CONFIG_SOC_IMX6SL=y 40CONFIG_SOC_IMX6SL=y
41CONFIG_SOC_VF610=y 41CONFIG_SOC_VF610=y
42CONFIG_PCI=y
43CONFIG_PCI_IMX6=y
42CONFIG_SMP=y 44CONFIG_SMP=y
43CONFIG_VMSPLIT_2G=y 45CONFIG_VMSPLIT_2G=y
44CONFIG_PREEMPT_VOLUNTARY=y 46CONFIG_PREEMPT_VOLUNTARY=y
@@ -165,6 +167,7 @@ CONFIG_REGULATOR=y
165CONFIG_REGULATOR_FIXED_VOLTAGE=y 167CONFIG_REGULATOR_FIXED_VOLTAGE=y
166CONFIG_REGULATOR_ANATOP=y 168CONFIG_REGULATOR_ANATOP=y
167CONFIG_REGULATOR_DA9052=y 169CONFIG_REGULATOR_DA9052=y
170CONFIG_REGULATOR_GPIO=y
168CONFIG_REGULATOR_MC13783=y 171CONFIG_REGULATOR_MC13783=y
169CONFIG_REGULATOR_MC13892=y 172CONFIG_REGULATOR_MC13892=y
170CONFIG_REGULATOR_PFUZE100=y 173CONFIG_REGULATOR_PFUZE100=y
@@ -186,6 +189,7 @@ CONFIG_LCD_L4F00242T03=y
186CONFIG_LCD_PLATFORM=y 189CONFIG_LCD_PLATFORM=y
187CONFIG_BACKLIGHT_CLASS_DEVICE=y 190CONFIG_BACKLIGHT_CLASS_DEVICE=y
188CONFIG_BACKLIGHT_PWM=y 191CONFIG_BACKLIGHT_PWM=y
192CONFIG_BACKLIGHT_GPIO=y
189CONFIG_FRAMEBUFFER_CONSOLE=y 193CONFIG_FRAMEBUFFER_CONSOLE=y
190CONFIG_LOGO=y 194CONFIG_LOGO=y
191CONFIG_SOUND=y 195CONFIG_SOUND=y
@@ -211,6 +215,7 @@ CONFIG_USB_GADGET=y
211CONFIG_USB_ETH=m 215CONFIG_USB_ETH=m
212CONFIG_USB_MASS_STORAGE=m 216CONFIG_USB_MASS_STORAGE=m
213CONFIG_MMC=y 217CONFIG_MMC=y
218CONFIG_MMC_UNSAFE_RESUME=y
214CONFIG_MMC_SDHCI=y 219CONFIG_MMC_SDHCI=y
215CONFIG_MMC_SDHCI_PLTFM=y 220CONFIG_MMC_SDHCI_PLTFM=y
216CONFIG_MMC_SDHCI_ESDHC_IMX=y 221CONFIG_MMC_SDHCI_ESDHC_IMX=y
@@ -225,6 +230,7 @@ CONFIG_LEDS_TRIGGER_BACKLIGHT=y
225CONFIG_LEDS_TRIGGER_GPIO=y 230CONFIG_LEDS_TRIGGER_GPIO=y
226CONFIG_RTC_CLASS=y 231CONFIG_RTC_CLASS=y
227CONFIG_RTC_INTF_DEV_UIE_EMUL=y 232CONFIG_RTC_INTF_DEV_UIE_EMUL=y
233CONFIG_RTC_DRV_PCF8563=y
228CONFIG_RTC_DRV_MC13XXX=y 234CONFIG_RTC_DRV_MC13XXX=y
229CONFIG_RTC_DRV_MXC=y 235CONFIG_RTC_DRV_MXC=y
230CONFIG_RTC_DRV_SNVS=y 236CONFIG_RTC_DRV_SNVS=y
@@ -277,6 +283,7 @@ CONFIG_NLS_ASCII=y
277CONFIG_NLS_ISO8859_1=y 283CONFIG_NLS_ISO8859_1=y
278CONFIG_NLS_ISO8859_15=m 284CONFIG_NLS_ISO8859_15=m
279CONFIG_NLS_UTF8=y 285CONFIG_NLS_UTF8=y
286CONFIG_DEBUG_FS=y
280CONFIG_MAGIC_SYSRQ=y 287CONFIG_MAGIC_SYSRQ=y
281# CONFIG_SCHED_DEBUG is not set 288# CONFIG_SCHED_DEBUG is not set
282CONFIG_PROVE_LOCKING=y 289CONFIG_PROVE_LOCKING=y
diff --git a/arch/arm/configs/keystone_defconfig b/arch/arm/configs/keystone_defconfig
index 4582e160feab..ec9a41d50680 100644
--- a/arch/arm/configs/keystone_defconfig
+++ b/arch/arm/configs/keystone_defconfig
@@ -111,6 +111,7 @@ CONFIG_MTD_BLOCK=y
111CONFIG_MTD_PLATRAM=y 111CONFIG_MTD_PLATRAM=y
112CONFIG_MTD_M25P80=y 112CONFIG_MTD_M25P80=y
113CONFIG_MTD_NAND=y 113CONFIG_MTD_NAND=y
114CONFIG_MTD_NAND_DAVINCI=y
114CONFIG_MTD_UBI=y 115CONFIG_MTD_UBI=y
115CONFIG_PROC_DEVICETREE=y 116CONFIG_PROC_DEVICETREE=y
116CONFIG_BLK_DEV_LOOP=y 117CONFIG_BLK_DEV_LOOP=y
@@ -131,6 +132,8 @@ CONFIG_SPI_DAVINCI=y
131CONFIG_SPI_SPIDEV=y 132CONFIG_SPI_SPIDEV=y
132# CONFIG_HWMON is not set 133# CONFIG_HWMON is not set
133CONFIG_WATCHDOG=y 134CONFIG_WATCHDOG=y
135CONFIG_WATCHDOG_CORE=y
136CONFIG_DAVINCI_WATCHDOG=y
134CONFIG_USB=y 137CONFIG_USB=y
135CONFIG_USB_DEBUG=y 138CONFIG_USB_DEBUG=y
136CONFIG_USB_ANNOUNCE_NEW_DEVICES=y 139CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
@@ -145,6 +148,7 @@ CONFIG_DMADEVICES=y
145CONFIG_TI_EDMA=y 148CONFIG_TI_EDMA=y
146CONFIG_COMMON_CLK_DEBUG=y 149CONFIG_COMMON_CLK_DEBUG=y
147CONFIG_MEMORY=y 150CONFIG_MEMORY=y
151CONFIG_TI_AEMIF=y
148CONFIG_EXT4_FS=y 152CONFIG_EXT4_FS=y
149CONFIG_EXT4_FS_POSIX_ACL=y 153CONFIG_EXT4_FS_POSIX_ACL=y
150CONFIG_MSDOS_FS=y 154CONFIG_MSDOS_FS=y
@@ -177,3 +181,14 @@ CONFIG_CRYPTO_DES=y
177CONFIG_CRYPTO_ANSI_CPRNG=y 181CONFIG_CRYPTO_ANSI_CPRNG=y
178CONFIG_CRYPTO_USER_API_HASH=y 182CONFIG_CRYPTO_USER_API_HASH=y
179CONFIG_CRYPTO_USER_API_SKCIPHER=y 183CONFIG_CRYPTO_USER_API_SKCIPHER=y
184CONFIG_GPIOLIB=y
185CONFIG_GPIO_SYSFS=y
186CONFIG_GPIO_DAVINCI=y
187CONFIG_LEDS_CLASS=y
188CONFIG_NEW_LEDS=y
189CONFIG_LEDS_GPIO=y
190CONFIG_LEDS_TRIGGERS=y
191CONFIG_LEDS_TRIGGER_ONESHOT=y
192CONFIG_LEDS_TRIGGER_HEARTBEAT=y
193CONFIG_LEDS_TRIGGER_BACKLIGHT=y
194CONFIG_LEDS_TRIGGER_GPIO=y
diff --git a/arch/arm/configs/koelsch_defconfig b/arch/arm/configs/koelsch_defconfig
index e248f49d5549..86faab565a96 100644
--- a/arch/arm/configs/koelsch_defconfig
+++ b/arch/arm/configs/koelsch_defconfig
@@ -8,7 +8,6 @@ CONFIG_SYSCTL_SYSCALL=y
8CONFIG_EMBEDDED=y 8CONFIG_EMBEDDED=y
9CONFIG_PERF_EVENTS=y 9CONFIG_PERF_EVENTS=y
10CONFIG_SLAB=y 10CONFIG_SLAB=y
11# CONFIG_BLOCK is not set
12CONFIG_ARCH_SHMOBILE_LEGACY=y 11CONFIG_ARCH_SHMOBILE_LEGACY=y
13CONFIG_ARCH_R8A7791=y 12CONFIG_ARCH_R8A7791=y
14CONFIG_MACH_KOELSCH=y 13CONFIG_MACH_KOELSCH=y
@@ -35,7 +34,14 @@ CONFIG_UNIX=y
35CONFIG_INET=y 34CONFIG_INET=y
36CONFIG_IP_PNP=y 35CONFIG_IP_PNP=y
37CONFIG_IP_PNP_DHCP=y 36CONFIG_IP_PNP_DHCP=y
37CONFIG_DEVTMPFS=y
38CONFIG_DEVTMPFS_MOUNT=y
38CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 39CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
40CONFIG_BLK_DEV_SD=y
41CONFIG_ATA=y
42CONFIG_SATA_RCAR=y
43CONFIG_MTD=y
44CONFIG_MTD_M25P80=y
39CONFIG_NETDEVICES=y 45CONFIG_NETDEVICES=y
40# CONFIG_NET_VENDOR_ARC is not set 46# CONFIG_NET_VENDOR_ARC is not set
41# CONFIG_NET_CADENCE is not set 47# CONFIG_NET_CADENCE is not set
@@ -53,18 +59,31 @@ CONFIG_SH_ETH=y
53# CONFIG_NET_VENDOR_VIA is not set 59# CONFIG_NET_VENDOR_VIA is not set
54# CONFIG_NET_VENDOR_WIZNET is not set 60# CONFIG_NET_VENDOR_WIZNET is not set
55# CONFIG_INPUT_MOUSEDEV_PSAUX is not set 61# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
62CONFIG_KEYBOARD_GPIO=y
56# CONFIG_INPUT_MOUSE is not set 63# CONFIG_INPUT_MOUSE is not set
57# CONFIG_LEGACY_PTYS is not set 64# CONFIG_LEGACY_PTYS is not set
58CONFIG_SERIAL_SH_SCI=y 65CONFIG_SERIAL_SH_SCI=y
59CONFIG_SERIAL_SH_SCI_NR_UARTS=20 66CONFIG_SERIAL_SH_SCI_NR_UARTS=20
60CONFIG_SERIAL_SH_SCI_CONSOLE=y 67CONFIG_SERIAL_SH_SCI_CONSOLE=y
68CONFIG_I2C=y
69CONFIG_I2C_RCAR=y
70CONFIG_SPI=y
71CONFIG_SPI_RSPI=y
72CONFIG_GPIOLIB=y
73CONFIG_GPIO_RCAR=y
61# CONFIG_HWMON is not set 74# CONFIG_HWMON is not set
62CONFIG_THERMAL=y 75CONFIG_THERMAL=y
63CONFIG_RCAR_THERMAL=y 76CONFIG_RCAR_THERMAL=y
77CONFIG_REGULATOR=y
78CONFIG_REGULATOR_FIXED_VOLTAGE=y
79CONFIG_REGULATOR_GPIO=y
64# CONFIG_HID is not set 80# CONFIG_HID is not set
65# CONFIG_USB_SUPPORT is not set 81# CONFIG_USB_SUPPORT is not set
82CONFIG_MMC=y
83CONFIG_MMC_SDHI=y
66CONFIG_NEW_LEDS=y 84CONFIG_NEW_LEDS=y
67CONFIG_LEDS_CLASS=y 85CONFIG_LEDS_CLASS=y
86CONFIG_LEDS_GPIO=y
68# CONFIG_IOMMU_SUPPORT is not set 87# CONFIG_IOMMU_SUPPORT is not set
69# CONFIG_DNOTIFY is not set 88# CONFIG_DNOTIFY is not set
70CONFIG_TMPFS=y 89CONFIG_TMPFS=y
diff --git a/arch/arm/configs/kzm9d_defconfig b/arch/arm/configs/kzm9d_defconfig
deleted file mode 100644
index e42ce3756af3..000000000000
--- a/arch/arm/configs/kzm9d_defconfig
+++ /dev/null
@@ -1,89 +0,0 @@
1# CONFIG_ARM_PATCH_PHYS_VIRT is not set
2CONFIG_EXPERIMENTAL=y
3CONFIG_SYSVIPC=y
4CONFIG_NO_HZ=y
5CONFIG_IKCONFIG=y
6CONFIG_IKCONFIG_PROC=y
7CONFIG_LOG_BUF_SHIFT=16
8CONFIG_CC_OPTIMIZE_FOR_SIZE=y
9CONFIG_SYSCTL_SYSCALL=y
10CONFIG_EMBEDDED=y
11CONFIG_PERF_EVENTS=y
12CONFIG_SLAB=y
13# CONFIG_BLK_DEV_BSG is not set
14# CONFIG_IOSCHED_DEADLINE is not set
15# CONFIG_IOSCHED_CFQ is not set
16CONFIG_ARCH_SHMOBILE_LEGACY=y
17CONFIG_ARCH_EMEV2=y
18CONFIG_MACH_KZM9D=y
19CONFIG_MEMORY_START=0x40000000
20CONFIG_MEMORY_SIZE=0x10000000
21# CONFIG_SH_TIMER_TMU is not set
22# CONFIG_SWP_EMULATE is not set
23# CONFIG_CACHE_L2X0 is not set
24CONFIG_SMP=y
25CONFIG_NR_CPUS=2
26CONFIG_HOTPLUG_CPU=y
27# CONFIG_LOCAL_TIMERS is not set
28CONFIG_AEABI=y
29# CONFIG_OABI_COMPAT is not set
30# CONFIG_CROSS_MEMORY_ATTACH is not set
31CONFIG_FORCE_MAX_ZONEORDER=13
32CONFIG_ZBOOT_ROM_TEXT=0x0
33CONFIG_ZBOOT_ROM_BSS=0x0
34CONFIG_ARM_APPENDED_DTB=y
35CONFIG_AUTO_ZRELADDR=y
36CONFIG_VFP=y
37# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
38CONFIG_PM_RUNTIME=y
39CONFIG_NET=y
40CONFIG_PACKET=y
41CONFIG_UNIX=y
42CONFIG_INET=y
43CONFIG_IP_PNP=y
44CONFIG_IP_PNP_DHCP=y
45# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
46# CONFIG_INET_XFRM_MODE_TUNNEL is not set
47# CONFIG_INET_XFRM_MODE_BEET is not set
48# CONFIG_INET_LRO is not set
49# CONFIG_INET_DIAG is not set
50# CONFIG_IPV6 is not set
51# CONFIG_WIRELESS is not set
52CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
53# CONFIG_BLK_DEV is not set
54CONFIG_NETDEVICES=y
55# CONFIG_NET_VENDOR_BROADCOM is not set
56# CONFIG_NET_VENDOR_CHELSIO is not set
57# CONFIG_NET_VENDOR_CIRRUS is not set
58# CONFIG_NET_VENDOR_FARADAY is not set
59# CONFIG_NET_VENDOR_INTEL is not set
60# CONFIG_NET_VENDOR_MARVELL is not set
61# CONFIG_NET_VENDOR_MICREL is not set
62# CONFIG_NET_VENDOR_NATSEMI is not set
63# CONFIG_NET_VENDOR_SEEQ is not set
64CONFIG_SMSC911X=y
65# CONFIG_NET_VENDOR_STMICRO is not set
66# CONFIG_NET_VENDOR_WIZNET is not set
67# CONFIG_WLAN is not set
68# CONFIG_INPUT_MOUSEDEV is not set
69# CONFIG_INPUT_KEYBOARD is not set
70# CONFIG_INPUT_MOUSE is not set
71# CONFIG_SERIO is not set
72# CONFIG_LEGACY_PTYS is not set
73# CONFIG_DEVKMEM is not set
74CONFIG_SERIAL_8250=y
75CONFIG_SERIAL_8250_CONSOLE=y
76CONFIG_SERIAL_8250_EM=y
77# CONFIG_HW_RANDOM is not set
78CONFIG_GPIOLIB=y
79CONFIG_GPIO_EM=y
80# CONFIG_HWMON is not set
81# CONFIG_HID_SUPPORT is not set
82# CONFIG_USB_SUPPORT is not set
83# CONFIG_IOMMU_SUPPORT is not set
84# CONFIG_DNOTIFY is not set
85CONFIG_TMPFS=y
86# CONFIG_MISC_FILESYSTEMS is not set
87CONFIG_NFS_FS=y
88CONFIG_ROOT_NFS=y
89# CONFIG_FTRACE is not set
diff --git a/arch/arm/configs/kzm9g_defconfig b/arch/arm/configs/kzm9g_defconfig
index 9934dbc23d64..12bd1f63c399 100644
--- a/arch/arm/configs/kzm9g_defconfig
+++ b/arch/arm/configs/kzm9g_defconfig
@@ -60,6 +60,8 @@ CONFIG_IRDA=y
60CONFIG_SH_IRDA=y 60CONFIG_SH_IRDA=y
61# CONFIG_WIRELESS is not set 61# CONFIG_WIRELESS is not set
62CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 62CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
63CONFIG_DEVTMPFS=y
64CONFIG_DEVTMPFS_MOUNT=y
63CONFIG_SCSI=y 65CONFIG_SCSI=y
64CONFIG_BLK_DEV_SD=y 66CONFIG_BLK_DEV_SD=y
65CONFIG_NETDEVICES=y 67CONFIG_NETDEVICES=y
diff --git a/arch/arm/configs/lager_defconfig b/arch/arm/configs/lager_defconfig
index 883443f8f4f3..58702440472a 100644
--- a/arch/arm/configs/lager_defconfig
+++ b/arch/arm/configs/lager_defconfig
@@ -49,6 +49,13 @@ CONFIG_IP_PNP_DHCP=y
49# CONFIG_IPV6 is not set 49# CONFIG_IPV6 is not set
50# CONFIG_WIRELESS is not set 50# CONFIG_WIRELESS is not set
51CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 51CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
52CONFIG_DEVTMPFS=y
53CONFIG_DEVTMPFS_MOUNT=y
54CONFIG_MTD=y
55CONFIG_MTD_M25P80=y
56CONFIG_BLK_DEV_SD=y
57CONFIG_ATA=y
58CONFIG_SATA_RCAR=y
52CONFIG_NETDEVICES=y 59CONFIG_NETDEVICES=y
53# CONFIG_NET_CORE is not set 60# CONFIG_NET_CORE is not set
54# CONFIG_NET_VENDOR_ARC is not set 61# CONFIG_NET_VENDOR_ARC is not set
@@ -81,6 +88,8 @@ CONFIG_SERIAL_SH_SCI_CONSOLE=y
81CONFIG_I2C=y 88CONFIG_I2C=y
82CONFIG_I2C_GPIO=y 89CONFIG_I2C_GPIO=y
83CONFIG_I2C_RCAR=y 90CONFIG_I2C_RCAR=y
91CONFIG_SPI=y
92CONFIG_SPI_RSPI=y
84CONFIG_GPIO_SH_PFC=y 93CONFIG_GPIO_SH_PFC=y
85CONFIG_GPIOLIB=y 94CONFIG_GPIOLIB=y
86CONFIG_GPIO_RCAR=y 95CONFIG_GPIO_RCAR=y
@@ -90,8 +99,20 @@ CONFIG_RCAR_THERMAL=y
90CONFIG_REGULATOR=y 99CONFIG_REGULATOR=y
91CONFIG_REGULATOR_FIXED_VOLTAGE=y 100CONFIG_REGULATOR_FIXED_VOLTAGE=y
92CONFIG_REGULATOR_GPIO=y 101CONFIG_REGULATOR_GPIO=y
102CONFIG_MEDIA_SUPPORT=y
103CONFIG_MEDIA_CAMERA_SUPPORT=y
104CONFIG_V4L_PLATFORM_DRIVERS=y
105CONFIG_SOC_CAMERA=y
106CONFIG_SOC_CAMERA_PLATFORM=y
107CONFIG_VIDEO_RCAR_VIN=y
108# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set
109CONFIG_VIDEO_ADV7180=y
93CONFIG_DRM=y 110CONFIG_DRM=y
94CONFIG_DRM_RCAR_DU=y 111CONFIG_DRM_RCAR_DU=y
112CONFIG_SOUND=y
113CONFIG_SND=y
114CONFIG_SND_SOC=y
115CONFIG_SND_SOC_RCAR=y
95# CONFIG_USB_SUPPORT is not set 116# CONFIG_USB_SUPPORT is not set
96CONFIG_MMC=y 117CONFIG_MMC=y
97CONFIG_MMC_SDHI=y 118CONFIG_MMC_SDHI=y
diff --git a/arch/arm/configs/mackerel_defconfig b/arch/arm/configs/mackerel_defconfig
index a61e1653fc5e..57ececba2ae6 100644
--- a/arch/arm/configs/mackerel_defconfig
+++ b/arch/arm/configs/mackerel_defconfig
@@ -42,6 +42,8 @@ CONFIG_IP_PNP_DHCP=y
42# CONFIG_IPV6 is not set 42# CONFIG_IPV6 is not set
43# CONFIG_WIRELESS is not set 43# CONFIG_WIRELESS is not set
44CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 44CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
45CONFIG_DEVTMPFS=y
46CONFIG_DEVTMPFS_MOUNT=y
45# CONFIG_FIRMWARE_IN_KERNEL is not set 47# CONFIG_FIRMWARE_IN_KERNEL is not set
46CONFIG_MTD=y 48CONFIG_MTD=y
47CONFIG_MTD_CONCAT=y 49CONFIG_MTD_CONCAT=y
diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
index f21bd405cc2a..92994f7f6fd8 100644
--- a/arch/arm/configs/marzen_defconfig
+++ b/arch/arm/configs/marzen_defconfig
@@ -43,6 +43,8 @@ CONFIG_IP_PNP_DHCP=y
43# CONFIG_IPV6 is not set 43# CONFIG_IPV6 is not set
44# CONFIG_WIRELESS is not set 44# CONFIG_WIRELESS is not set
45CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 45CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
46CONFIG_DEVTMPFS=y
47CONFIG_DEVTMPFS_MOUNT=y
46# CONFIG_STANDALONE is not set 48# CONFIG_STANDALONE is not set
47# CONFIG_PREVENT_FIRMWARE_BUILD is not set 49# CONFIG_PREVENT_FIRMWARE_BUILD is not set
48# CONFIG_FW_LOADER is not set 50# CONFIG_FW_LOADER is not set
diff --git a/arch/arm/configs/multi_v5_defconfig b/arch/arm/configs/multi_v5_defconfig
new file mode 100644
index 000000000000..aa3dfb084fed
--- /dev/null
+++ b/arch/arm/configs/multi_v5_defconfig
@@ -0,0 +1,190 @@
1CONFIG_SYSVIPC=y
2CONFIG_NO_HZ=y
3CONFIG_HIGH_RES_TIMERS=y
4CONFIG_LOG_BUF_SHIFT=19
5CONFIG_PROFILING=y
6CONFIG_OPROFILE=y
7CONFIG_KPROBES=y
8CONFIG_MODULES=y
9CONFIG_MODULE_UNLOAD=y
10# CONFIG_BLK_DEV_BSG is not set
11# CONFIG_ARCH_MULTI_V7 is not set
12CONFIG_ARCH_MVEBU=y
13CONFIG_MACH_KIRKWOOD=y
14CONFIG_MACH_T5325=y
15CONFIG_ARCH_MXC=y
16CONFIG_MACH_IMX25_DT=y
17CONFIG_MACH_IMX27_DT=y
18CONFIG_ARCH_U300=y
19CONFIG_PCI_MVEBU=y
20CONFIG_PREEMPT=y
21CONFIG_AEABI=y
22CONFIG_HIGHMEM=y
23CONFIG_ZBOOT_ROM_TEXT=0x0
24CONFIG_ZBOOT_ROM_BSS=0x0
25CONFIG_ARM_APPENDED_DTB=y
26CONFIG_ARM_ATAG_DTB_COMPAT=y
27CONFIG_CPU_FREQ=y
28CONFIG_CPU_FREQ_STAT_DETAILS=y
29CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
30CONFIG_CPU_IDLE=y
31CONFIG_ARM_KIRKWOOD_CPUIDLE=y
32CONFIG_NET=y
33CONFIG_PACKET=y
34CONFIG_UNIX=y
35CONFIG_INET=y
36CONFIG_IP_MULTICAST=y
37CONFIG_IP_PNP=y
38CONFIG_IP_PNP_DHCP=y
39CONFIG_IP_PNP_BOOTP=y
40# CONFIG_IPV6 is not set
41CONFIG_NET_PKTGEN=m
42CONFIG_CFG80211=y
43CONFIG_MAC80211=y
44CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
45CONFIG_MTD=y
46CONFIG_MTD_CMDLINE_PARTS=y
47CONFIG_MTD_BLOCK=y
48CONFIG_MTD_CFI=y
49CONFIG_MTD_JEDECPROBE=y
50CONFIG_MTD_CFI_ADV_OPTIONS=y
51CONFIG_MTD_CFI_GEOMETRY=y
52# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
53CONFIG_MTD_CFI_INTELEXT=y
54CONFIG_MTD_CFI_STAA=y
55CONFIG_MTD_PHYSMAP=y
56CONFIG_MTD_M25P80=y
57CONFIG_MTD_NAND=y
58CONFIG_MTD_NAND_ORION=y
59CONFIG_BLK_DEV_LOOP=y
60CONFIG_EEPROM_AT24=y
61# CONFIG_SCSI_PROC_FS is not set
62CONFIG_BLK_DEV_SD=y
63CONFIG_BLK_DEV_SR=m
64CONFIG_CHR_DEV_SG=m
65CONFIG_ATA=y
66CONFIG_SATA_AHCI=y
67CONFIG_SATA_MV=y
68CONFIG_NETDEVICES=y
69CONFIG_NET_DSA_MV88E6123_61_65=y
70CONFIG_MV643XX_ETH=y
71CONFIG_R8169=y
72CONFIG_MARVELL_PHY=y
73CONFIG_LIBERTAS=y
74CONFIG_LIBERTAS_SDIO=y
75CONFIG_INPUT_EVDEV=y
76CONFIG_KEYBOARD_GPIO=y
77# CONFIG_INPUT_MOUSE is not set
78CONFIG_LEGACY_PTY_COUNT=16
79# CONFIG_DEVKMEM is not set
80CONFIG_SERIAL_8250=y
81CONFIG_SERIAL_8250_CONSOLE=y
82CONFIG_SERIAL_8250_RUNTIME_UARTS=2
83CONFIG_SERIAL_OF_PLATFORM=y
84# CONFIG_HW_RANDOM is not set
85CONFIG_I2C=y
86# CONFIG_I2C_COMPAT is not set
87CONFIG_I2C_CHARDEV=y
88CONFIG_I2C_MV64XXX=y
89CONFIG_I2C_NOMADIK=y
90CONFIG_SPI=y
91CONFIG_SPI_ORION=y
92CONFIG_GPIO_SYSFS=y
93CONFIG_POWER_SUPPLY=y
94CONFIG_POWER_RESET=y
95CONFIG_POWER_RESET_GPIO=y
96CONFIG_POWER_RESET_QNAP=y
97CONFIG_SENSORS_ADT7475=y
98CONFIG_SENSORS_LM63=y
99CONFIG_SENSORS_LM75=y
100CONFIG_SENSORS_LM85=y
101CONFIG_THERMAL=y
102CONFIG_KIRKWOOD_THERMAL=y
103CONFIG_WATCHDOG=y
104CONFIG_ORION_WATCHDOG=y
105CONFIG_FB=y
106CONFIG_SOUND=y
107CONFIG_SND=y
108CONFIG_SND_SOC=y
109CONFIG_SND_KIRKWOOD_SOC=y
110CONFIG_SND_KIRKWOOD_SOC_T5325=y
111# CONFIG_ABX500_CORE is not set
112CONFIG_REGULATOR=y
113CONFIG_REGULATOR_FIXED_VOLTAGE=y
114CONFIG_HID_DRAGONRISE=y
115CONFIG_HID_GYRATION=y
116CONFIG_HID_TWINHAN=y
117CONFIG_HID_NTRIG=y
118CONFIG_HID_PANTHERLORD=y
119CONFIG_HID_PETALYNX=y
120CONFIG_HID_SAMSUNG=y
121CONFIG_HID_SONY=y
122CONFIG_HID_SUNPLUS=y
123CONFIG_HID_GREENASIA=y
124CONFIG_HID_SMARTJOYPLUS=y
125CONFIG_HID_TOPSEED=y
126CONFIG_HID_THRUSTMASTER=y
127CONFIG_HID_ZEROPLUS=y
128CONFIG_USB=y
129CONFIG_USB_XHCI_HCD=y
130CONFIG_USB_EHCI_HCD=y
131CONFIG_USB_EHCI_ROOT_HUB_TT=y
132CONFIG_USB_PRINTER=m
133CONFIG_USB_STORAGE=y
134CONFIG_USB_STORAGE_DATAFAB=y
135CONFIG_USB_STORAGE_FREECOM=y
136CONFIG_USB_STORAGE_SDDR09=y
137CONFIG_USB_STORAGE_SDDR55=y
138CONFIG_USB_STORAGE_JUMPSHOT=y
139CONFIG_MMC=y
140CONFIG_SDIO_UART=y
141CONFIG_MMC_MVSDIO=y
142CONFIG_NEW_LEDS=y
143CONFIG_LEDS_CLASS=y
144CONFIG_LEDS_GPIO=y
145CONFIG_LEDS_TRIGGERS=y
146CONFIG_LEDS_TRIGGER_TIMER=y
147CONFIG_LEDS_TRIGGER_HEARTBEAT=y
148CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
149CONFIG_RTC_CLASS=y
150CONFIG_RTC_DRV_RS5C372=y
151CONFIG_RTC_DRV_PCF8563=y
152CONFIG_RTC_DRV_S35390A=y
153CONFIG_RTC_DRV_MV=y
154CONFIG_DMADEVICES=y
155CONFIG_MV_XOR=y
156CONFIG_STAGING=y
157CONFIG_FB_XGI=y
158CONFIG_EXT2_FS=y
159CONFIG_EXT3_FS=y
160# CONFIG_EXT3_FS_XATTR is not set
161CONFIG_EXT4_FS=y
162CONFIG_ISO9660_FS=m
163CONFIG_JOLIET=y
164CONFIG_UDF_FS=m
165CONFIG_MSDOS_FS=y
166CONFIG_VFAT_FS=y
167CONFIG_TMPFS=y
168CONFIG_JFFS2_FS=y
169CONFIG_CRAMFS=y
170CONFIG_NFS_FS=y
171CONFIG_ROOT_NFS=y
172CONFIG_NLS_CODEPAGE_437=y
173CONFIG_NLS_CODEPAGE_850=y
174CONFIG_NLS_ISO8859_1=y
175CONFIG_NLS_ISO8859_2=y
176CONFIG_NLS_UTF8=y
177CONFIG_DEBUG_INFO=y
178CONFIG_DEBUG_FS=y
179CONFIG_MAGIC_SYSRQ=y
180CONFIG_DEBUG_KERNEL=y
181# CONFIG_SCHED_DEBUG is not set
182# CONFIG_DEBUG_PREEMPT is not set
183# CONFIG_FTRACE is not set
184CONFIG_DEBUG_USER=y
185CONFIG_CRYPTO_CBC=m
186CONFIG_CRYPTO_PCBC=m
187# CONFIG_CRYPTO_ANSI_CPRNG is not set
188CONFIG_CRYPTO_DEV_MV_CESA=y
189CONFIG_CRC_CCITT=y
190CONFIG_LIBCRC32C=y
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index ee6982976d66..d4e8a47a2f7c 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -1,4 +1,5 @@
1CONFIG_SYSVIPC=y 1CONFIG_SYSVIPC=y
2CONFIG_FHANDLE=y
2CONFIG_IRQ_DOMAIN_DEBUG=y 3CONFIG_IRQ_DOMAIN_DEBUG=y
3CONFIG_NO_HZ=y 4CONFIG_NO_HZ=y
4CONFIG_HIGH_RES_TIMERS=y 5CONFIG_HIGH_RES_TIMERS=y
@@ -9,8 +10,12 @@ CONFIG_MODULE_UNLOAD=y
9CONFIG_PARTITION_ADVANCED=y 10CONFIG_PARTITION_ADVANCED=y
10CONFIG_ARCH_MVEBU=y 11CONFIG_ARCH_MVEBU=y
11CONFIG_MACH_ARMADA_370=y 12CONFIG_MACH_ARMADA_370=y
13CONFIG_MACH_ARMADA_375=y
14CONFIG_MACH_ARMADA_38X=y
12CONFIG_MACH_ARMADA_XP=y 15CONFIG_MACH_ARMADA_XP=y
16CONFIG_MACH_DOVE=y
13CONFIG_ARCH_BCM=y 17CONFIG_ARCH_BCM=y
18CONFIG_ARCH_BCM_5301X=y
14CONFIG_ARCH_BCM_MOBILE=y 19CONFIG_ARCH_BCM_MOBILE=y
15CONFIG_ARCH_BERLIN=y 20CONFIG_ARCH_BERLIN=y
16CONFIG_MACH_BERLIN_BG2=y 21CONFIG_MACH_BERLIN_BG2=y
@@ -31,6 +36,10 @@ CONFIG_SOC_OMAP5=y
31CONFIG_SOC_AM33XX=y 36CONFIG_SOC_AM33XX=y
32CONFIG_SOC_DRA7XX=y 37CONFIG_SOC_DRA7XX=y
33CONFIG_SOC_AM43XX=y 38CONFIG_SOC_AM43XX=y
39CONFIG_ARCH_QCOM=y
40CONFIG_ARCH_MSM8X60=y
41CONFIG_ARCH_MSM8960=y
42CONFIG_ARCH_MSM8974=y
34CONFIG_ARCH_ROCKCHIP=y 43CONFIG_ARCH_ROCKCHIP=y
35CONFIG_ARCH_SOCFPGA=y 44CONFIG_ARCH_SOCFPGA=y
36CONFIG_PLAT_SPEAR=y 45CONFIG_PLAT_SPEAR=y
@@ -55,6 +64,7 @@ CONFIG_ARCH_VEXPRESS_CA9X4=y
55CONFIG_ARCH_VIRT=y 64CONFIG_ARCH_VIRT=y
56CONFIG_ARCH_WM8850=y 65CONFIG_ARCH_WM8850=y
57CONFIG_ARCH_ZYNQ=y 66CONFIG_ARCH_ZYNQ=y
67CONFIG_NEON=y
58CONFIG_TRUSTED_FOUNDATIONS=y 68CONFIG_TRUSTED_FOUNDATIONS=y
59CONFIG_PCI=y 69CONFIG_PCI=y
60CONFIG_PCI_MSI=y 70CONFIG_PCI_MSI=y
@@ -94,6 +104,7 @@ CONFIG_RFKILL_GPIO=y
94CONFIG_DEVTMPFS=y 104CONFIG_DEVTMPFS=y
95CONFIG_DEVTMPFS_MOUNT=y 105CONFIG_DEVTMPFS_MOUNT=y
96CONFIG_DMA_CMA=y 106CONFIG_DMA_CMA=y
107CONFIG_CMA_SIZE_MBYTES=64
97CONFIG_OMAP_OCP2SCP=y 108CONFIG_OMAP_OCP2SCP=y
98CONFIG_MTD=y 109CONFIG_MTD=y
99CONFIG_MTD_M25P80=y 110CONFIG_MTD_M25P80=y
@@ -111,6 +122,7 @@ CONFIG_SATA_MV=y
111CONFIG_NETDEVICES=y 122CONFIG_NETDEVICES=y
112CONFIG_SUN4I_EMAC=y 123CONFIG_SUN4I_EMAC=y
113CONFIG_NET_CALXEDA_XGMAC=y 124CONFIG_NET_CALXEDA_XGMAC=y
125CONFIG_MV643XX_ETH=y
114CONFIG_MVNETA=y 126CONFIG_MVNETA=y
115CONFIG_KS8851=y 127CONFIG_KS8851=y
116CONFIG_R8169=y 128CONFIG_R8169=y
@@ -146,6 +158,8 @@ CONFIG_SERIAL_SIRFSOC_CONSOLE=y
146CONFIG_SERIAL_TEGRA=y 158CONFIG_SERIAL_TEGRA=y
147CONFIG_SERIAL_IMX=y 159CONFIG_SERIAL_IMX=y
148CONFIG_SERIAL_IMX_CONSOLE=y 160CONFIG_SERIAL_IMX_CONSOLE=y
161CONFIG_SERIAL_MSM=y
162CONFIG_SERIAL_MSM_CONSOLE=y
149CONFIG_SERIAL_VT8500=y 163CONFIG_SERIAL_VT8500=y
150CONFIG_SERIAL_VT8500_CONSOLE=y 164CONFIG_SERIAL_VT8500_CONSOLE=y
151CONFIG_SERIAL_OF_PLATFORM=y 165CONFIG_SERIAL_OF_PLATFORM=y
@@ -159,6 +173,7 @@ CONFIG_SERIAL_ST_ASC=y
159CONFIG_SERIAL_ST_ASC_CONSOLE=y 173CONFIG_SERIAL_ST_ASC_CONSOLE=y
160CONFIG_I2C_CHARDEV=y 174CONFIG_I2C_CHARDEV=y
161CONFIG_I2C_MUX=y 175CONFIG_I2C_MUX=y
176CONFIG_I2C_MUX_PCA954x=y
162CONFIG_I2C_MUX_PINCTRL=y 177CONFIG_I2C_MUX_PINCTRL=y
163CONFIG_I2C_DESIGNWARE_PLATFORM=y 178CONFIG_I2C_DESIGNWARE_PLATFORM=y
164CONFIG_I2C_MV64XXX=y 179CONFIG_I2C_MV64XXX=y
@@ -187,7 +202,10 @@ CONFIG_POWER_RESET_AS3722=y
187CONFIG_POWER_RESET_GPIO=y 202CONFIG_POWER_RESET_GPIO=y
188CONFIG_SENSORS_LM90=y 203CONFIG_SENSORS_LM90=y
189CONFIG_THERMAL=y 204CONFIG_THERMAL=y
205CONFIG_DOVE_THERMAL=y
190CONFIG_ARMADA_THERMAL=y 206CONFIG_ARMADA_THERMAL=y
207CONFIG_WATCHDOG=y
208CONFIG_ORION_WATCHDOG=y
191CONFIG_MFD_AS3722=y 209CONFIG_MFD_AS3722=y
192CONFIG_MFD_CROS_EC=y 210CONFIG_MFD_CROS_EC=y
193CONFIG_MFD_CROS_EC_SPI=y 211CONFIG_MFD_CROS_EC_SPI=y
@@ -212,6 +230,8 @@ CONFIG_REGULATOR_VEXPRESS=y
212CONFIG_MEDIA_SUPPORT=y 230CONFIG_MEDIA_SUPPORT=y
213CONFIG_MEDIA_CAMERA_SUPPORT=y 231CONFIG_MEDIA_CAMERA_SUPPORT=y
214CONFIG_MEDIA_USB_SUPPORT=y 232CONFIG_MEDIA_USB_SUPPORT=y
233CONFIG_USB_VIDEO_CLASS=y
234CONFIG_USB_GSPCA=y
215CONFIG_DRM=y 235CONFIG_DRM=y
216CONFIG_DRM_TEGRA=y 236CONFIG_DRM_TEGRA=y
217CONFIG_DRM_PANEL_SIMPLE=y 237CONFIG_DRM_PANEL_SIMPLE=y
@@ -254,6 +274,7 @@ CONFIG_MMC_ARMMMCI=y
254CONFIG_MMC_SDHCI=y 274CONFIG_MMC_SDHCI=y
255CONFIG_MMC_SDHCI_ESDHC_IMX=y 275CONFIG_MMC_SDHCI_ESDHC_IMX=y
256CONFIG_MMC_SDHCI_TEGRA=y 276CONFIG_MMC_SDHCI_TEGRA=y
277CONFIG_MMC_SDHCI_DOVE=y
257CONFIG_MMC_SDHCI_SPEAR=y 278CONFIG_MMC_SDHCI_SPEAR=y
258CONFIG_MMC_SDHCI_BCM_KONA=y 279CONFIG_MMC_SDHCI_BCM_KONA=y
259CONFIG_MMC_OMAP=y 280CONFIG_MMC_OMAP=y
@@ -294,6 +315,10 @@ CONFIG_MFD_NVEC=y
294CONFIG_KEYBOARD_NVEC=y 315CONFIG_KEYBOARD_NVEC=y
295CONFIG_SERIO_NVEC_PS2=y 316CONFIG_SERIO_NVEC_PS2=y
296CONFIG_NVEC_POWER=y 317CONFIG_NVEC_POWER=y
318CONFIG_COMMON_CLK_QCOM=y
319CONFIG_MSM_GCC_8660=y
320CONFIG_MSM_MMCC_8960=y
321CONFIG_MSM_MMCC_8974=y
297CONFIG_TEGRA_IOMMU_GART=y 322CONFIG_TEGRA_IOMMU_GART=y
298CONFIG_TEGRA_IOMMU_SMMU=y 323CONFIG_TEGRA_IOMMU_SMMU=y
299CONFIG_MEMORY=y 324CONFIG_MEMORY=y
diff --git a/arch/arm/configs/mvebu_v5_defconfig b/arch/arm/configs/mvebu_v5_defconfig
new file mode 100644
index 000000000000..36484a37a1ca
--- /dev/null
+++ b/arch/arm/configs/mvebu_v5_defconfig
@@ -0,0 +1,181 @@
1CONFIG_SYSVIPC=y
2CONFIG_NO_HZ=y
3CONFIG_HIGH_RES_TIMERS=y
4CONFIG_LOG_BUF_SHIFT=19
5CONFIG_PROFILING=y
6CONFIG_OPROFILE=y
7CONFIG_KPROBES=y
8CONFIG_MODULES=y
9CONFIG_MODULE_UNLOAD=y
10# CONFIG_BLK_DEV_BSG is not set
11# CONFIG_ARCH_MULTI_V7 is not set
12CONFIG_ARCH_MVEBU=y
13CONFIG_MACH_KIRKWOOD=y
14CONFIG_MACH_T5325=y
15# CONFIG_CPU_FEROCEON_OLD_ID is not set
16CONFIG_PCI_MVEBU=y
17CONFIG_PREEMPT=y
18CONFIG_AEABI=y
19CONFIG_HIGHMEM=y
20CONFIG_ZBOOT_ROM_TEXT=0x0
21CONFIG_ZBOOT_ROM_BSS=0x0
22CONFIG_CPU_FREQ=y
23CONFIG_CPU_FREQ_STAT_DETAILS=y
24CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
25CONFIG_CPU_IDLE=y
26CONFIG_NET=y
27CONFIG_PACKET=y
28CONFIG_UNIX=y
29CONFIG_INET=y
30CONFIG_IP_MULTICAST=y
31CONFIG_IP_PNP=y
32CONFIG_IP_PNP_DHCP=y
33CONFIG_IP_PNP_BOOTP=y
34# CONFIG_IPV6 is not set
35CONFIG_NET_PKTGEN=m
36CONFIG_CFG80211=y
37CONFIG_MAC80211=y
38CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
39CONFIG_MTD=y
40CONFIG_MTD_CMDLINE_PARTS=y
41CONFIG_MTD_BLOCK=y
42CONFIG_MTD_CFI=y
43CONFIG_MTD_JEDECPROBE=y
44CONFIG_MTD_CFI_ADV_OPTIONS=y
45CONFIG_MTD_CFI_GEOMETRY=y
46# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
47CONFIG_MTD_CFI_INTELEXT=y
48CONFIG_MTD_CFI_STAA=y
49CONFIG_MTD_PHYSMAP=y
50CONFIG_MTD_M25P80=y
51CONFIG_MTD_NAND=y
52CONFIG_MTD_NAND_ORION=y
53CONFIG_BLK_DEV_LOOP=y
54CONFIG_EEPROM_AT24=y
55# CONFIG_SCSI_PROC_FS is not set
56CONFIG_BLK_DEV_SD=y
57CONFIG_BLK_DEV_SR=m
58CONFIG_CHR_DEV_SG=m
59CONFIG_ATA=y
60CONFIG_SATA_AHCI=y
61CONFIG_SATA_MV=y
62CONFIG_NETDEVICES=y
63CONFIG_NET_DSA_MV88E6123_61_65=y
64CONFIG_MV643XX_ETH=y
65CONFIG_R8169=y
66CONFIG_MARVELL_PHY=y
67CONFIG_LIBERTAS=y
68CONFIG_LIBERTAS_SDIO=y
69CONFIG_INPUT_EVDEV=y
70CONFIG_KEYBOARD_GPIO=y
71# CONFIG_INPUT_MOUSE is not set
72CONFIG_LEGACY_PTY_COUNT=16
73# CONFIG_DEVKMEM is not set
74CONFIG_SERIAL_8250=y
75CONFIG_SERIAL_8250_CONSOLE=y
76CONFIG_SERIAL_8250_RUNTIME_UARTS=2
77CONFIG_SERIAL_OF_PLATFORM=y
78# CONFIG_HW_RANDOM is not set
79CONFIG_I2C=y
80# CONFIG_I2C_COMPAT is not set
81CONFIG_I2C_CHARDEV=y
82CONFIG_I2C_MV64XXX=y
83CONFIG_SPI=y
84CONFIG_SPI_ORION=y
85CONFIG_GPIO_SYSFS=y
86CONFIG_POWER_SUPPLY=y
87CONFIG_POWER_RESET=y
88CONFIG_POWER_RESET_GPIO=y
89CONFIG_POWER_RESET_QNAP=y
90CONFIG_SENSORS_ADT7475=y
91CONFIG_SENSORS_LM63=y
92CONFIG_SENSORS_LM75=y
93CONFIG_SENSORS_LM85=y
94CONFIG_THERMAL=y
95CONFIG_WATCHDOG=y
96CONFIG_ORION_WATCHDOG=y
97CONFIG_FB=y
98CONFIG_SOUND=y
99CONFIG_SND=y
100CONFIG_SND_SOC=y
101CONFIG_SND_KIRKWOOD_SOC=y
102CONFIG_SND_KIRKWOOD_SOC_T5325=y
103CONFIG_REGULATOR=y
104CONFIG_REGULATOR_FIXED_VOLTAGE=y
105CONFIG_HID_DRAGONRISE=y
106CONFIG_HID_GYRATION=y
107CONFIG_HID_TWINHAN=y
108CONFIG_HID_NTRIG=y
109CONFIG_HID_PANTHERLORD=y
110CONFIG_HID_PETALYNX=y
111CONFIG_HID_SAMSUNG=y
112CONFIG_HID_SONY=y
113CONFIG_HID_SUNPLUS=y
114CONFIG_HID_GREENASIA=y
115CONFIG_HID_SMARTJOYPLUS=y
116CONFIG_HID_TOPSEED=y
117CONFIG_HID_THRUSTMASTER=y
118CONFIG_HID_ZEROPLUS=y
119CONFIG_USB=y
120CONFIG_USB_XHCI_HCD=y
121CONFIG_USB_EHCI_HCD=y
122CONFIG_USB_EHCI_ROOT_HUB_TT=y
123CONFIG_USB_PRINTER=m
124CONFIG_USB_STORAGE=y
125CONFIG_USB_STORAGE_DATAFAB=y
126CONFIG_USB_STORAGE_FREECOM=y
127CONFIG_USB_STORAGE_SDDR09=y
128CONFIG_USB_STORAGE_SDDR55=y
129CONFIG_USB_STORAGE_JUMPSHOT=y
130CONFIG_MMC=y
131CONFIG_SDIO_UART=y
132CONFIG_MMC_MVSDIO=y
133CONFIG_NEW_LEDS=y
134CONFIG_LEDS_CLASS=y
135CONFIG_LEDS_GPIO=y
136CONFIG_LEDS_TRIGGERS=y
137CONFIG_LEDS_TRIGGER_TIMER=y
138CONFIG_LEDS_TRIGGER_HEARTBEAT=y
139CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
140CONFIG_RTC_CLASS=y
141CONFIG_RTC_DRV_RS5C372=y
142CONFIG_RTC_DRV_PCF8563=y
143CONFIG_RTC_DRV_S35390A=y
144CONFIG_RTC_DRV_MV=y
145CONFIG_DMADEVICES=y
146CONFIG_MV_XOR=y
147CONFIG_STAGING=y
148CONFIG_FB_XGI=y
149CONFIG_EXT2_FS=y
150CONFIG_EXT3_FS=y
151# CONFIG_EXT3_FS_XATTR is not set
152CONFIG_EXT4_FS=y
153CONFIG_ISO9660_FS=m
154CONFIG_JOLIET=y
155CONFIG_UDF_FS=m
156CONFIG_MSDOS_FS=y
157CONFIG_VFAT_FS=y
158CONFIG_TMPFS=y
159CONFIG_JFFS2_FS=y
160CONFIG_CRAMFS=y
161CONFIG_NFS_FS=y
162CONFIG_ROOT_NFS=y
163CONFIG_NLS_CODEPAGE_437=y
164CONFIG_NLS_CODEPAGE_850=y
165CONFIG_NLS_ISO8859_1=y
166CONFIG_NLS_ISO8859_2=y
167CONFIG_NLS_UTF8=y
168CONFIG_DEBUG_INFO=y
169CONFIG_DEBUG_FS=y
170CONFIG_MAGIC_SYSRQ=y
171CONFIG_DEBUG_KERNEL=y
172# CONFIG_SCHED_DEBUG is not set
173# CONFIG_DEBUG_PREEMPT is not set
174# CONFIG_FTRACE is not set
175CONFIG_DEBUG_USER=y
176CONFIG_CRYPTO_CBC=m
177CONFIG_CRYPTO_PCBC=m
178# CONFIG_CRYPTO_ANSI_CPRNG is not set
179CONFIG_CRYPTO_DEV_MV_CESA=y
180CONFIG_CRC_CCITT=y
181CONFIG_LIBCRC32C=y
diff --git a/arch/arm/configs/mvebu_defconfig b/arch/arm/configs/mvebu_v7_defconfig
index 0f4511d2849f..a34713d8db9f 100644
--- a/arch/arm/configs/mvebu_defconfig
+++ b/arch/arm/configs/mvebu_v7_defconfig
@@ -10,7 +10,10 @@ CONFIG_MODULES=y
10CONFIG_MODULE_UNLOAD=y 10CONFIG_MODULE_UNLOAD=y
11CONFIG_ARCH_MVEBU=y 11CONFIG_ARCH_MVEBU=y
12CONFIG_MACH_ARMADA_370=y 12CONFIG_MACH_ARMADA_370=y
13CONFIG_MACH_ARMADA_375=y
14CONFIG_MACH_ARMADA_38X=y
13CONFIG_MACH_ARMADA_XP=y 15CONFIG_MACH_ARMADA_XP=y
16CONFIG_NEON=y
14# CONFIG_CACHE_L2X0 is not set 17# CONFIG_CACHE_L2X0 is not set
15# CONFIG_SWP_EMULATE is not set 18# CONFIG_SWP_EMULATE is not set
16CONFIG_PCI=y 19CONFIG_PCI=y
@@ -62,6 +65,13 @@ CONFIG_GPIOLIB=y
62CONFIG_GPIO_SYSFS=y 65CONFIG_GPIO_SYSFS=y
63CONFIG_THERMAL=y 66CONFIG_THERMAL=y
64CONFIG_ARMADA_THERMAL=y 67CONFIG_ARMADA_THERMAL=y
68CONFIG_SOUND=y
69CONFIG_SND=y
70CONFIG_SND_SOC=y
71CONFIG_SND_KIRKWOOD_SOC=y
72CONFIG_SND_KIRKWOOD_SOC_ARMADA370_DB=y
73CONFIG_WATCHDOG=y
74CONFIG_ORION_WATCHDOG=y
65CONFIG_USB_SUPPORT=y 75CONFIG_USB_SUPPORT=y
66CONFIG_USB=y 76CONFIG_USB=y
67CONFIG_USB_EHCI_HCD=y 77CONFIG_USB_EHCI_HCD=y
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index 3a0b53d225e7..a9667957b757 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -28,6 +28,7 @@ CONFIG_ARCH_OMAP3=y
28CONFIG_ARCH_OMAP4=y 28CONFIG_ARCH_OMAP4=y
29CONFIG_SOC_OMAP5=y 29CONFIG_SOC_OMAP5=y
30CONFIG_SOC_AM33XX=y 30CONFIG_SOC_AM33XX=y
31CONFIG_SOC_AM43XX=y
31CONFIG_SOC_DRA7XX=y 32CONFIG_SOC_DRA7XX=y
32CONFIG_ARM_THUMBEE=y 33CONFIG_ARM_THUMBEE=y
33CONFIG_ARM_ERRATA_411920=y 34CONFIG_ARM_ERRATA_411920=y
@@ -169,6 +170,7 @@ CONFIG_DRA752_THERMAL=y
169CONFIG_WATCHDOG=y 170CONFIG_WATCHDOG=y
170CONFIG_OMAP_WATCHDOG=y 171CONFIG_OMAP_WATCHDOG=y
171CONFIG_TWL4030_WATCHDOG=y 172CONFIG_TWL4030_WATCHDOG=y
173CONFIG_MFD_SYSCON=y
172CONFIG_MFD_PALMAS=y 174CONFIG_MFD_PALMAS=y
173CONFIG_MFD_TPS65217=y 175CONFIG_MFD_TPS65217=y
174CONFIG_MFD_TPS65910=y 176CONFIG_MFD_TPS65910=y
@@ -180,6 +182,7 @@ CONFIG_REGULATOR_TPS6507X=y
180CONFIG_REGULATOR_TPS65217=y 182CONFIG_REGULATOR_TPS65217=y
181CONFIG_REGULATOR_TPS65910=y 183CONFIG_REGULATOR_TPS65910=y
182CONFIG_REGULATOR_TWL4030=y 184CONFIG_REGULATOR_TWL4030=y
185CONFIG_REGULATOR_PBIAS=y
183CONFIG_FB=y 186CONFIG_FB=y
184CONFIG_FIRMWARE_EDID=y 187CONFIG_FIRMWARE_EDID=y
185CONFIG_FB_MODE_HELPERS=y 188CONFIG_FB_MODE_HELPERS=y
diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmobile_defconfig
new file mode 100644
index 000000000000..83b07258a385
--- /dev/null
+++ b/arch/arm/configs/shmobile_defconfig
@@ -0,0 +1,129 @@
1CONFIG_SYSVIPC=y
2CONFIG_NO_HZ=y
3CONFIG_IKCONFIG=y
4CONFIG_IKCONFIG_PROC=y
5CONFIG_LOG_BUF_SHIFT=16
6CONFIG_CC_OPTIMIZE_FOR_SIZE=y
7CONFIG_SYSCTL_SYSCALL=y
8CONFIG_EMBEDDED=y
9CONFIG_PERF_EVENTS=y
10CONFIG_SLAB=y
11CONFIG_ARCH_SHMOBILE_MULTI=y
12CONFIG_ARCH_EMEV2=y
13CONFIG_ARCH_R8A7790=y
14CONFIG_ARCH_R8A7791=y
15CONFIG_MACH_KOELSCH=y
16CONFIG_MACH_LAGER=y
17# CONFIG_SWP_EMULATE is not set
18CONFIG_CPU_BPREDICT_DISABLE=y
19CONFIG_PL310_ERRATA_588369=y
20CONFIG_ARM_ERRATA_754322=y
21CONFIG_PCI=y
22CONFIG_PCI_RCAR_GEN2=y
23CONFIG_SMP=y
24CONFIG_SCHED_MC=y
25CONFIG_HAVE_ARM_ARCH_TIMER=y
26CONFIG_NR_CPUS=8
27CONFIG_AEABI=y
28CONFIG_ZBOOT_ROM_TEXT=0x0
29CONFIG_ZBOOT_ROM_BSS=0x0
30CONFIG_ARM_APPENDED_DTB=y
31CONFIG_KEXEC=y
32CONFIG_VFP=y
33CONFIG_NEON=y
34# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
35CONFIG_NET=y
36CONFIG_PACKET=y
37CONFIG_UNIX=y
38CONFIG_INET=y
39CONFIG_IP_PNP=y
40CONFIG_IP_PNP_DHCP=y
41CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
42CONFIG_DEVTMPFS=y
43CONFIG_DEVTMPFS_MOUNT=y
44CONFIG_MTD=y
45CONFIG_MTD_M25P80=y
46CONFIG_BLK_DEV_SD=y
47CONFIG_ATA=y
48CONFIG_SATA_RCAR=y
49CONFIG_NETDEVICES=y
50# CONFIG_NET_VENDOR_ARC is not set
51# CONFIG_NET_CADENCE is not set
52# CONFIG_NET_VENDOR_BROADCOM is not set
53# CONFIG_NET_VENDOR_CIRRUS is not set
54# CONFIG_NET_VENDOR_FARADAY is not set
55# CONFIG_NET_VENDOR_INTEL is not set
56# CONFIG_NET_VENDOR_MARVELL is not set
57# CONFIG_NET_VENDOR_MICREL is not set
58# CONFIG_NET_VENDOR_NATSEMI is not set
59CONFIG_SH_ETH=y
60# CONFIG_NET_VENDOR_SEEQ is not set
61CONFIG_SMSC911X=y
62# CONFIG_NET_VENDOR_STMICRO is not set
63# CONFIG_NET_VENDOR_VIA is not set
64# CONFIG_NET_VENDOR_WIZNET is not set
65CONFIG_SMSC_PHY=y
66# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
67CONFIG_KEYBOARD_GPIO=y
68# CONFIG_INPUT_MOUSE is not set
69# CONFIG_LEGACY_PTYS is not set
70CONFIG_SERIAL_8250=y
71CONFIG_SERIAL_8250_CONSOLE=y
72CONFIG_SERIAL_8250_EXTENDED=y
73CONFIG_SERIAL_8250_EM=y
74CONFIG_SERIAL_SH_SCI=y
75CONFIG_SERIAL_SH_SCI_NR_UARTS=20
76CONFIG_SERIAL_SH_SCI_CONSOLE=y
77CONFIG_I2C_GPIO=y
78CONFIG_I2C_RCAR=y
79CONFIG_SPI=y
80CONFIG_SPI_RSPI=y
81CONFIG_GPIO_EM=y
82CONFIG_GPIO_RCAR=y
83# CONFIG_HWMON is not set
84CONFIG_THERMAL=y
85CONFIG_RCAR_THERMAL=y
86CONFIG_REGULATOR=y
87CONFIG_REGULATOR_FIXED_VOLTAGE=y
88CONFIG_REGULATOR_GPIO=y
89CONFIG_MEDIA_SUPPORT=y
90CONFIG_MEDIA_CAMERA_SUPPORT=y
91CONFIG_V4L_PLATFORM_DRIVERS=y
92CONFIG_SOC_CAMERA=y
93CONFIG_SOC_CAMERA_PLATFORM=y
94CONFIG_VIDEO_RCAR_VIN=y
95# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set
96CONFIG_VIDEO_ADV7180=y
97CONFIG_DRM=y
98CONFIG_DRM_RCAR_DU=y
99CONFIG_SOUND=y
100CONFIG_SND=y
101CONFIG_SND_SOC=y
102CONFIG_SND_SOC_RCAR=y
103CONFIG_USB_RCAR_GEN2_PHY=y
104CONFIG_MMC=y
105CONFIG_MMC_SDHI=y
106CONFIG_MMC_SH_MMCIF=y
107CONFIG_NEW_LEDS=y
108CONFIG_LEDS_CLASS=y
109CONFIG_LEDS_GPIO=y
110CONFIG_RTC_CLASS=y
111CONFIG_DMADEVICES=y
112CONFIG_SH_DMAE=y
113# CONFIG_IOMMU_SUPPORT is not set
114# CONFIG_DNOTIFY is not set
115CONFIG_MSDOS_FS=y
116CONFIG_VFAT_FS=y
117CONFIG_TMPFS=y
118CONFIG_CONFIGFS_FS=y
119# CONFIG_MISC_FILESYSTEMS is not set
120CONFIG_NFS_FS=y
121CONFIG_NFS_V3_ACL=y
122CONFIG_NFS_V4=y
123CONFIG_NFS_V4_1=y
124CONFIG_ROOT_NFS=y
125CONFIG_NLS_CODEPAGE_437=y
126CONFIG_NLS_ISO8859_1=y
127# CONFIG_ENABLE_WARN_DEPRECATED is not set
128# CONFIG_ENABLE_MUST_CHECK is not set
129# CONFIG_ARM_UNWIND is not set
diff --git a/arch/arm/configs/socfpga_defconfig b/arch/arm/configs/socfpga_defconfig
index 4e1ce211d43f..e3a05e8801d8 100644
--- a/arch/arm/configs/socfpga_defconfig
+++ b/arch/arm/configs/socfpga_defconfig
@@ -52,6 +52,7 @@ CONFIG_BLK_DEV_SD=y
52# CONFIG_SCSI_LOWLEVEL is not set 52# CONFIG_SCSI_LOWLEVEL is not set
53CONFIG_NETDEVICES=y 53CONFIG_NETDEVICES=y
54CONFIG_STMMAC_ETH=y 54CONFIG_STMMAC_ETH=y
55CONFIG_MICREL_PHY=y
55# CONFIG_STMMAC_PHY_ID_ZERO_WORKAROUND is not set 56# CONFIG_STMMAC_PHY_ID_ZERO_WORKAROUND is not set
56CONFIG_INPUT_EVDEV=y 57CONFIG_INPUT_EVDEV=y
57# CONFIG_SERIO_SERPORT is not set 58# CONFIG_SERIO_SERPORT is not set
@@ -66,6 +67,9 @@ CONFIG_SERIAL_8250_DW=y
66CONFIG_EXT2_FS=y 67CONFIG_EXT2_FS=y
67CONFIG_EXT2_FS_XATTR=y 68CONFIG_EXT2_FS_XATTR=y
68CONFIG_EXT2_FS_POSIX_ACL=y 69CONFIG_EXT2_FS_POSIX_ACL=y
70CONFIG_EXT3_FS=y
71CONFIG_NFS_FS=y
72CONFIG_ROOT_NFS=y
69# CONFIG_DNOTIFY is not set 73# CONFIG_DNOTIFY is not set
70# CONFIG_INOTIFY_USER is not set 74# CONFIG_INOTIFY_USER is not set
71CONFIG_VFAT_FS=y 75CONFIG_VFAT_FS=y
@@ -82,3 +86,5 @@ CONFIG_DEBUG_INFO=y
82CONFIG_ENABLE_DEFAULT_TRACERS=y 86CONFIG_ENABLE_DEFAULT_TRACERS=y
83CONFIG_DEBUG_USER=y 87CONFIG_DEBUG_USER=y
84CONFIG_XZ_DEC=y 88CONFIG_XZ_DEC=y
89CONFIG_MMC=y
90CONFIG_MMC_DW=y
diff --git a/arch/arm/configs/sunxi_defconfig b/arch/arm/configs/sunxi_defconfig
index 3e2259b60236..b5df4a511b0a 100644
--- a/arch/arm/configs/sunxi_defconfig
+++ b/arch/arm/configs/sunxi_defconfig
@@ -24,6 +24,7 @@ CONFIG_IP_PNP_BOOTP=y
24# CONFIG_WIRELESS is not set 24# CONFIG_WIRELESS is not set
25CONFIG_DEVTMPFS=y 25CONFIG_DEVTMPFS=y
26CONFIG_DEVTMPFS_MOUNT=y 26CONFIG_DEVTMPFS_MOUNT=y
27CONFIG_EEPROM_SUNXI_SID=y
27CONFIG_NETDEVICES=y 28CONFIG_NETDEVICES=y
28CONFIG_SUN4I_EMAC=y 29CONFIG_SUN4I_EMAC=y
29# CONFIG_NET_CADENCE is not set 30# CONFIG_NET_CADENCE is not set
@@ -48,6 +49,8 @@ CONFIG_I2C=y
48# CONFIG_I2C_COMPAT is not set 49# CONFIG_I2C_COMPAT is not set
49CONFIG_I2C_CHARDEV=y 50CONFIG_I2C_CHARDEV=y
50CONFIG_I2C_MV64XXX=y 51CONFIG_I2C_MV64XXX=y
52CONFIG_SPI=y
53CONFIG_SPI_SUN6I=y
51CONFIG_GPIO_SYSFS=y 54CONFIG_GPIO_SYSFS=y
52# CONFIG_HWMON is not set 55# CONFIG_HWMON is not set
53CONFIG_WATCHDOG=y 56CONFIG_WATCHDOG=y
diff --git a/arch/arm/configs/tegra_defconfig b/arch/arm/configs/tegra_defconfig
index 27d69b558c5d..2926281368ab 100644
--- a/arch/arm/configs/tegra_defconfig
+++ b/arch/arm/configs/tegra_defconfig
@@ -1,4 +1,5 @@
1CONFIG_SYSVIPC=y 1CONFIG_SYSVIPC=y
2CONFIG_FHANDLE=y
2CONFIG_NO_HZ=y 3CONFIG_NO_HZ=y
3CONFIG_HIGH_RES_TIMERS=y 4CONFIG_HIGH_RES_TIMERS=y
4CONFIG_IKCONFIG=y 5CONFIG_IKCONFIG=y
@@ -86,6 +87,7 @@ CONFIG_DEVTMPFS=y
86CONFIG_DEVTMPFS_MOUNT=y 87CONFIG_DEVTMPFS_MOUNT=y
87# CONFIG_FIRMWARE_IN_KERNEL is not set 88# CONFIG_FIRMWARE_IN_KERNEL is not set
88CONFIG_DMA_CMA=y 89CONFIG_DMA_CMA=y
90CONFIG_CMA_SIZE_MBYTES=64
89CONFIG_MTD=y 91CONFIG_MTD=y
90CONFIG_MTD_M25P80=y 92CONFIG_MTD_M25P80=y
91CONFIG_PROC_DEVICETREE=y 93CONFIG_PROC_DEVICETREE=y
@@ -125,6 +127,7 @@ CONFIG_SERIAL_TEGRA=y
125CONFIG_SERIAL_OF_PLATFORM=y 127CONFIG_SERIAL_OF_PLATFORM=y
126# CONFIG_HW_RANDOM is not set 128# CONFIG_HW_RANDOM is not set
127# CONFIG_I2C_COMPAT is not set 129# CONFIG_I2C_COMPAT is not set
130CONFIG_I2C_MUX_PCA954x=y
128CONFIG_I2C_MUX_PINCTRL=y 131CONFIG_I2C_MUX_PINCTRL=y
129CONFIG_I2C_TEGRA=y 132CONFIG_I2C_TEGRA=y
130CONFIG_SPI=y 133CONFIG_SPI=y
@@ -141,6 +144,7 @@ CONFIG_POWER_SUPPLY=y
141CONFIG_BATTERY_SBS=y 144CONFIG_BATTERY_SBS=y
142CONFIG_CHARGER_TPS65090=y 145CONFIG_CHARGER_TPS65090=y
143CONFIG_POWER_RESET=y 146CONFIG_POWER_RESET=y
147CONFIG_POWER_RESET_AS3722=y
144CONFIG_POWER_RESET_GPIO=y 148CONFIG_POWER_RESET_GPIO=y
145CONFIG_SENSORS_LM90=y 149CONFIG_SENSORS_LM90=y
146CONFIG_MFD_AS3722=y 150CONFIG_MFD_AS3722=y
@@ -166,7 +170,8 @@ CONFIG_REGULATOR_TPS65910=y
166CONFIG_MEDIA_SUPPORT=y 170CONFIG_MEDIA_SUPPORT=y
167CONFIG_MEDIA_CAMERA_SUPPORT=y 171CONFIG_MEDIA_CAMERA_SUPPORT=y
168CONFIG_MEDIA_USB_SUPPORT=y 172CONFIG_MEDIA_USB_SUPPORT=y
169CONFIG_USB_VIDEO_CLASS=m 173CONFIG_USB_VIDEO_CLASS=y
174CONFIG_USB_GSPCA=y
170CONFIG_DRM=y 175CONFIG_DRM=y
171CONFIG_DRM_TEGRA=y 176CONFIG_DRM_TEGRA=y
172CONFIG_DRM_PANEL_SIMPLE=y 177CONFIG_DRM_PANEL_SIMPLE=y
diff --git a/arch/arm/firmware/Kconfig b/arch/arm/firmware/Kconfig
index bb00ccf00d66..ad396af68e47 100644
--- a/arch/arm/firmware/Kconfig
+++ b/arch/arm/firmware/Kconfig
@@ -11,6 +11,7 @@ menu "Firmware options"
11config TRUSTED_FOUNDATIONS 11config TRUSTED_FOUNDATIONS
12 bool "Trusted Foundations secure monitor support" 12 bool "Trusted Foundations secure monitor support"
13 depends on ARCH_SUPPORTS_TRUSTED_FOUNDATIONS 13 depends on ARCH_SUPPORTS_TRUSTED_FOUNDATIONS
14 default y
14 help 15 help
15 Some devices (including most Tegra-based consumer devices on the 16 Some devices (including most Tegra-based consumer devices on the
16 market) are booted with the Trusted Foundations secure monitor 17 market) are booted with the Trusted Foundations secure monitor
@@ -20,7 +21,7 @@ config TRUSTED_FOUNDATIONS
20 This option allows the kernel to invoke the secure monitor whenever 21 This option allows the kernel to invoke the secure monitor whenever
21 required on devices using Trusted Foundations. See 22 required on devices using Trusted Foundations. See
22 arch/arm/include/asm/trusted_foundations.h or the 23 arch/arm/include/asm/trusted_foundations.h or the
23 tl,trusted-foundations device tree binding documentation for details 24 tlm,trusted-foundations device tree binding documentation for details
24 on how to use it. 25 on how to use it.
25 26
26 Say n if you don't know what this is about. 27 Say n if you don't know what this is about.
diff --git a/arch/arm/firmware/trusted_foundations.c b/arch/arm/firmware/trusted_foundations.c
index ef1e3d8f4af0..3fb1b5a1dce9 100644
--- a/arch/arm/firmware/trusted_foundations.c
+++ b/arch/arm/firmware/trusted_foundations.c
@@ -22,6 +22,15 @@
22 22
23#define TF_SET_CPU_BOOT_ADDR_SMC 0xfffff200 23#define TF_SET_CPU_BOOT_ADDR_SMC 0xfffff200
24 24
25#define TF_CPU_PM 0xfffffffc
26#define TF_CPU_PM_S3 0xffffffe3
27#define TF_CPU_PM_S2 0xffffffe6
28#define TF_CPU_PM_S2_NO_MC_CLK 0xffffffe5
29#define TF_CPU_PM_S1 0xffffffe4
30#define TF_CPU_PM_S1_NOFLUSH_L2 0xffffffe7
31
32static unsigned long cpu_boot_addr;
33
25static void __naked tf_generic_smc(u32 type, u32 arg1, u32 arg2) 34static void __naked tf_generic_smc(u32 type, u32 arg1, u32 arg2)
26{ 35{
27 asm volatile( 36 asm volatile(
@@ -41,13 +50,22 @@ static void __naked tf_generic_smc(u32 type, u32 arg1, u32 arg2)
41 50
42static int tf_set_cpu_boot_addr(int cpu, unsigned long boot_addr) 51static int tf_set_cpu_boot_addr(int cpu, unsigned long boot_addr)
43{ 52{
44 tf_generic_smc(TF_SET_CPU_BOOT_ADDR_SMC, boot_addr, 0); 53 cpu_boot_addr = boot_addr;
54 tf_generic_smc(TF_SET_CPU_BOOT_ADDR_SMC, cpu_boot_addr, 0);
55
56 return 0;
57}
58
59static int tf_prepare_idle(void)
60{
61 tf_generic_smc(TF_CPU_PM, TF_CPU_PM_S1_NOFLUSH_L2, cpu_boot_addr);
45 62
46 return 0; 63 return 0;
47} 64}
48 65
49static const struct firmware_ops trusted_foundations_ops = { 66static const struct firmware_ops trusted_foundations_ops = {
50 .set_cpu_boot_addr = tf_set_cpu_boot_addr, 67 .set_cpu_boot_addr = tf_set_cpu_boot_addr,
68 .prepare_idle = tf_prepare_idle,
51}; 69};
52 70
53void register_trusted_foundations(struct trusted_foundations_platform_data *pd) 71void register_trusted_foundations(struct trusted_foundations_platform_data *pd)
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
index 5c2285160575..b974184f9941 100644
--- a/arch/arm/include/asm/assembler.h
+++ b/arch/arm/include/asm/assembler.h
@@ -23,6 +23,7 @@
23#include <asm/ptrace.h> 23#include <asm/ptrace.h>
24#include <asm/domain.h> 24#include <asm/domain.h>
25#include <asm/opcodes-virt.h> 25#include <asm/opcodes-virt.h>
26#include <asm/asm-offsets.h>
26 27
27#define IOMEM(x) (x) 28#define IOMEM(x) (x)
28 29
@@ -30,8 +31,8 @@
30 * Endian independent macros for shifting bytes within registers. 31 * Endian independent macros for shifting bytes within registers.
31 */ 32 */
32#ifndef __ARMEB__ 33#ifndef __ARMEB__
33#define pull lsr 34#define lspull lsr
34#define push lsl 35#define lspush lsl
35#define get_byte_0 lsl #0 36#define get_byte_0 lsl #0
36#define get_byte_1 lsr #8 37#define get_byte_1 lsr #8
37#define get_byte_2 lsr #16 38#define get_byte_2 lsr #16
@@ -41,8 +42,8 @@
41#define put_byte_2 lsl #16 42#define put_byte_2 lsl #16
42#define put_byte_3 lsl #24 43#define put_byte_3 lsl #24
43#else 44#else
44#define pull lsl 45#define lspull lsl
45#define push lsr 46#define lspush lsr
46#define get_byte_0 lsr #24 47#define get_byte_0 lsr #24
47#define get_byte_1 lsr #16 48#define get_byte_1 lsr #16
48#define get_byte_2 lsr #8 49#define get_byte_2 lsr #8
@@ -174,6 +175,47 @@
174 restore_irqs_notrace \oldcpsr 175 restore_irqs_notrace \oldcpsr
175 .endm 176 .endm
176 177
178/*
179 * Get current thread_info.
180 */
181 .macro get_thread_info, rd
182 ARM( mov \rd, sp, lsr #13 )
183 THUMB( mov \rd, sp )
184 THUMB( lsr \rd, \rd, #13 )
185 mov \rd, \rd, lsl #13
186 .endm
187
188/*
189 * Increment/decrement the preempt count.
190 */
191#ifdef CONFIG_PREEMPT_COUNT
192 .macro inc_preempt_count, ti, tmp
193 ldr \tmp, [\ti, #TI_PREEMPT] @ get preempt count
194 add \tmp, \tmp, #1 @ increment it
195 str \tmp, [\ti, #TI_PREEMPT]
196 .endm
197
198 .macro dec_preempt_count, ti, tmp
199 ldr \tmp, [\ti, #TI_PREEMPT] @ get preempt count
200 sub \tmp, \tmp, #1 @ decrement it
201 str \tmp, [\ti, #TI_PREEMPT]
202 .endm
203
204 .macro dec_preempt_count_ti, ti, tmp
205 get_thread_info \ti
206 dec_preempt_count \ti, \tmp
207 .endm
208#else
209 .macro inc_preempt_count, ti, tmp
210 .endm
211
212 .macro dec_preempt_count, ti, tmp
213 .endm
214
215 .macro dec_preempt_count_ti, ti, tmp
216 .endm
217#endif
218
177#define USER(x...) \ 219#define USER(x...) \
1789999: x; \ 2209999: x; \
179 .pushsection __ex_table,"a"; \ 221 .pushsection __ex_table,"a"; \
diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h
index 62d2cb53b069..9a92fd7864a8 100644
--- a/arch/arm/include/asm/atomic.h
+++ b/arch/arm/include/asm/atomic.h
@@ -60,6 +60,7 @@ static inline int atomic_add_return(int i, atomic_t *v)
60 int result; 60 int result;
61 61
62 smp_mb(); 62 smp_mb();
63 prefetchw(&v->counter);
63 64
64 __asm__ __volatile__("@ atomic_add_return\n" 65 __asm__ __volatile__("@ atomic_add_return\n"
65"1: ldrex %0, [%3]\n" 66"1: ldrex %0, [%3]\n"
@@ -99,6 +100,7 @@ static inline int atomic_sub_return(int i, atomic_t *v)
99 int result; 100 int result;
100 101
101 smp_mb(); 102 smp_mb();
103 prefetchw(&v->counter);
102 104
103 __asm__ __volatile__("@ atomic_sub_return\n" 105 __asm__ __volatile__("@ atomic_sub_return\n"
104"1: ldrex %0, [%3]\n" 106"1: ldrex %0, [%3]\n"
@@ -121,6 +123,7 @@ static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
121 unsigned long res; 123 unsigned long res;
122 124
123 smp_mb(); 125 smp_mb();
126 prefetchw(&ptr->counter);
124 127
125 do { 128 do {
126 __asm__ __volatile__("@ atomic_cmpxchg\n" 129 __asm__ __volatile__("@ atomic_cmpxchg\n"
@@ -138,6 +141,33 @@ static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
138 return oldval; 141 return oldval;
139} 142}
140 143
144static inline int __atomic_add_unless(atomic_t *v, int a, int u)
145{
146 int oldval, newval;
147 unsigned long tmp;
148
149 smp_mb();
150 prefetchw(&v->counter);
151
152 __asm__ __volatile__ ("@ atomic_add_unless\n"
153"1: ldrex %0, [%4]\n"
154" teq %0, %5\n"
155" beq 2f\n"
156" add %1, %0, %6\n"
157" strex %2, %1, [%4]\n"
158" teq %2, #0\n"
159" bne 1b\n"
160"2:"
161 : "=&r" (oldval), "=&r" (newval), "=&r" (tmp), "+Qo" (v->counter)
162 : "r" (&v->counter), "r" (u), "r" (a)
163 : "cc");
164
165 if (oldval != u)
166 smp_mb();
167
168 return oldval;
169}
170
141#else /* ARM_ARCH_6 */ 171#else /* ARM_ARCH_6 */
142 172
143#ifdef CONFIG_SMP 173#ifdef CONFIG_SMP
@@ -186,10 +216,6 @@ static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
186 return ret; 216 return ret;
187} 217}
188 218
189#endif /* __LINUX_ARM_ARCH__ */
190
191#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
192
193static inline int __atomic_add_unless(atomic_t *v, int a, int u) 219static inline int __atomic_add_unless(atomic_t *v, int a, int u)
194{ 220{
195 int c, old; 221 int c, old;
@@ -200,6 +226,10 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
200 return c; 226 return c;
201} 227}
202 228
229#endif /* __LINUX_ARM_ARCH__ */
230
231#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
232
203#define atomic_inc(v) atomic_add(1, v) 233#define atomic_inc(v) atomic_add(1, v)
204#define atomic_dec(v) atomic_sub(1, v) 234#define atomic_dec(v) atomic_sub(1, v)
205 235
@@ -299,6 +329,7 @@ static inline long long atomic64_add_return(long long i, atomic64_t *v)
299 unsigned long tmp; 329 unsigned long tmp;
300 330
301 smp_mb(); 331 smp_mb();
332 prefetchw(&v->counter);
302 333
303 __asm__ __volatile__("@ atomic64_add_return\n" 334 __asm__ __volatile__("@ atomic64_add_return\n"
304"1: ldrexd %0, %H0, [%3]\n" 335"1: ldrexd %0, %H0, [%3]\n"
@@ -340,6 +371,7 @@ static inline long long atomic64_sub_return(long long i, atomic64_t *v)
340 unsigned long tmp; 371 unsigned long tmp;
341 372
342 smp_mb(); 373 smp_mb();
374 prefetchw(&v->counter);
343 375
344 __asm__ __volatile__("@ atomic64_sub_return\n" 376 __asm__ __volatile__("@ atomic64_sub_return\n"
345"1: ldrexd %0, %H0, [%3]\n" 377"1: ldrexd %0, %H0, [%3]\n"
@@ -364,6 +396,7 @@ static inline long long atomic64_cmpxchg(atomic64_t *ptr, long long old,
364 unsigned long res; 396 unsigned long res;
365 397
366 smp_mb(); 398 smp_mb();
399 prefetchw(&ptr->counter);
367 400
368 do { 401 do {
369 __asm__ __volatile__("@ atomic64_cmpxchg\n" 402 __asm__ __volatile__("@ atomic64_cmpxchg\n"
@@ -388,6 +421,7 @@ static inline long long atomic64_xchg(atomic64_t *ptr, long long new)
388 unsigned long tmp; 421 unsigned long tmp;
389 422
390 smp_mb(); 423 smp_mb();
424 prefetchw(&ptr->counter);
391 425
392 __asm__ __volatile__("@ atomic64_xchg\n" 426 __asm__ __volatile__("@ atomic64_xchg\n"
393"1: ldrexd %0, %H0, [%3]\n" 427"1: ldrexd %0, %H0, [%3]\n"
@@ -409,6 +443,7 @@ static inline long long atomic64_dec_if_positive(atomic64_t *v)
409 unsigned long tmp; 443 unsigned long tmp;
410 444
411 smp_mb(); 445 smp_mb();
446 prefetchw(&v->counter);
412 447
413 __asm__ __volatile__("@ atomic64_dec_if_positive\n" 448 __asm__ __volatile__("@ atomic64_dec_if_positive\n"
414"1: ldrexd %0, %H0, [%3]\n" 449"1: ldrexd %0, %H0, [%3]\n"
@@ -436,6 +471,7 @@ static inline int atomic64_add_unless(atomic64_t *v, long long a, long long u)
436 int ret = 1; 471 int ret = 1;
437 472
438 smp_mb(); 473 smp_mb();
474 prefetchw(&v->counter);
439 475
440 __asm__ __volatile__("@ atomic64_add_unless\n" 476 __asm__ __volatile__("@ atomic64_add_unless\n"
441"1: ldrexd %0, %H0, [%4]\n" 477"1: ldrexd %0, %H0, [%4]\n"
diff --git a/arch/arm/include/asm/cmpxchg.h b/arch/arm/include/asm/cmpxchg.h
index df2fbba7efc8..abb2c3769b01 100644
--- a/arch/arm/include/asm/cmpxchg.h
+++ b/arch/arm/include/asm/cmpxchg.h
@@ -2,6 +2,7 @@
2#define __ASM_ARM_CMPXCHG_H 2#define __ASM_ARM_CMPXCHG_H
3 3
4#include <linux/irqflags.h> 4#include <linux/irqflags.h>
5#include <linux/prefetch.h>
5#include <asm/barrier.h> 6#include <asm/barrier.h>
6 7
7#if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110) 8#if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110)
@@ -35,6 +36,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size
35#endif 36#endif
36 37
37 smp_mb(); 38 smp_mb();
39 prefetchw((const void *)ptr);
38 40
39 switch (size) { 41 switch (size) {
40#if __LINUX_ARM_ARCH__ >= 6 42#if __LINUX_ARM_ARCH__ >= 6
@@ -138,6 +140,8 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
138{ 140{
139 unsigned long oldval, res; 141 unsigned long oldval, res;
140 142
143 prefetchw((const void *)ptr);
144
141 switch (size) { 145 switch (size) {
142#ifndef CONFIG_CPU_V6 /* min ARCH >= ARMv6K */ 146#ifndef CONFIG_CPU_V6 /* min ARCH >= ARMv6K */
143 case 1: 147 case 1:
@@ -230,6 +234,8 @@ static inline unsigned long long __cmpxchg64(unsigned long long *ptr,
230 unsigned long long oldval; 234 unsigned long long oldval;
231 unsigned long res; 235 unsigned long res;
232 236
237 prefetchw(ptr);
238
233 __asm__ __volatile__( 239 __asm__ __volatile__(
234"1: ldrexd %1, %H1, [%3]\n" 240"1: ldrexd %1, %H1, [%3]\n"
235" teq %1, %4\n" 241" teq %1, %4\n"
diff --git a/arch/arm/include/asm/cputype.h b/arch/arm/include/asm/cputype.h
index acdde76b39bb..c651e3b26ec7 100644
--- a/arch/arm/include/asm/cputype.h
+++ b/arch/arm/include/asm/cputype.h
@@ -71,6 +71,7 @@
71#define ARM_CPU_PART_CORTEX_A5 0xC050 71#define ARM_CPU_PART_CORTEX_A5 0xC050
72#define ARM_CPU_PART_CORTEX_A15 0xC0F0 72#define ARM_CPU_PART_CORTEX_A15 0xC0F0
73#define ARM_CPU_PART_CORTEX_A7 0xC070 73#define ARM_CPU_PART_CORTEX_A7 0xC070
74#define ARM_CPU_PART_CORTEX_A12 0xC0D0
74 75
75#define ARM_CPU_XSCALE_ARCH_MASK 0xe000 76#define ARM_CPU_XSCALE_ARCH_MASK 0xe000
76#define ARM_CPU_XSCALE_ARCH_V1 0x2000 77#define ARM_CPU_XSCALE_ARCH_V1 0x2000
@@ -220,4 +221,23 @@ static inline int cpu_is_xsc3(void)
220#define cpu_is_xscale() 1 221#define cpu_is_xscale() 1
221#endif 222#endif
222 223
224/*
225 * Marvell's PJ4 core is based on V7 version. It has some modification
226 * for coprocessor setting. For this reason, we need a way to distinguish
227 * it.
228 */
229#ifndef CONFIG_CPU_PJ4
230#define cpu_is_pj4() 0
231#else
232static inline int cpu_is_pj4(void)
233{
234 unsigned int id;
235
236 id = read_cpuid_id();
237 if ((id & 0xfffffff0) == 0x562f5840)
238 return 1;
239
240 return 0;
241}
242#endif
223#endif 243#endif
diff --git a/arch/arm/include/asm/dma-iommu.h b/arch/arm/include/asm/dma-iommu.h
index a8c56acc8c98..eec0a12c5c1d 100644
--- a/arch/arm/include/asm/dma-iommu.h
+++ b/arch/arm/include/asm/dma-iommu.h
@@ -13,9 +13,12 @@ struct dma_iommu_mapping {
13 /* iommu specific data */ 13 /* iommu specific data */
14 struct iommu_domain *domain; 14 struct iommu_domain *domain;
15 15
16 void *bitmap; 16 unsigned long **bitmaps; /* array of bitmaps */
17 size_t bits; 17 unsigned int nr_bitmaps; /* nr of elements in array */
18 unsigned int order; 18 unsigned int extensions;
19 size_t bitmap_size; /* size of a single bitmap */
20 size_t bits; /* per bitmap */
21 unsigned int size; /* per bitmap */
19 dma_addr_t base; 22 dma_addr_t base;
20 23
21 spinlock_t lock; 24 spinlock_t lock;
@@ -23,8 +26,7 @@ struct dma_iommu_mapping {
23}; 26};
24 27
25struct dma_iommu_mapping * 28struct dma_iommu_mapping *
26arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size, 29arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size);
27 int order);
28 30
29void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping); 31void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping);
30 32
diff --git a/arch/arm/include/asm/firmware.h b/arch/arm/include/asm/firmware.h
index 15631300c238..2c9f10df7568 100644
--- a/arch/arm/include/asm/firmware.h
+++ b/arch/arm/include/asm/firmware.h
@@ -22,6 +22,10 @@
22 */ 22 */
23struct firmware_ops { 23struct firmware_ops {
24 /* 24 /*
25 * Inform the firmware we intend to enter CPU idle mode
26 */
27 int (*prepare_idle)(void);
28 /*
25 * Enters CPU idle mode 29 * Enters CPU idle mode
26 */ 30 */
27 int (*do_idle)(void); 31 int (*do_idle)(void);
diff --git a/arch/arm/include/asm/floppy.h b/arch/arm/include/asm/floppy.h
index c9f03eccc9d8..f4882553fbb0 100644
--- a/arch/arm/include/asm/floppy.h
+++ b/arch/arm/include/asm/floppy.h
@@ -25,7 +25,7 @@
25 25
26#define fd_inb(port) inb((port)) 26#define fd_inb(port) inb((port))
27#define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\ 27#define fd_request_irq() request_irq(IRQ_FLOPPYDISK,floppy_interrupt,\
28 IRQF_DISABLED,"floppy",NULL) 28 0,"floppy",NULL)
29#define fd_free_irq() free_irq(IRQ_FLOPPYDISK,NULL) 29#define fd_free_irq() free_irq(IRQ_FLOPPYDISK,NULL)
30#define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK) 30#define fd_disable_irq() disable_irq(IRQ_FLOPPYDISK)
31#define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK) 31#define fd_enable_irq() enable_irq(IRQ_FLOPPYDISK)
diff --git a/arch/arm/include/asm/futex.h b/arch/arm/include/asm/futex.h
index e42cf597f6e6..53e69dae796f 100644
--- a/arch/arm/include/asm/futex.h
+++ b/arch/arm/include/asm/futex.h
@@ -3,11 +3,6 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#if defined(CONFIG_CPU_USE_DOMAINS) && defined(CONFIG_SMP)
7/* ARM doesn't provide unprivileged exclusive memory accessors */
8#include <asm-generic/futex.h>
9#else
10
11#include <linux/futex.h> 6#include <linux/futex.h>
12#include <linux/uaccess.h> 7#include <linux/uaccess.h>
13#include <asm/errno.h> 8#include <asm/errno.h>
@@ -28,6 +23,7 @@
28 23
29#define __futex_atomic_op(insn, ret, oldval, tmp, uaddr, oparg) \ 24#define __futex_atomic_op(insn, ret, oldval, tmp, uaddr, oparg) \
30 smp_mb(); \ 25 smp_mb(); \
26 prefetchw(uaddr); \
31 __asm__ __volatile__( \ 27 __asm__ __volatile__( \
32 "1: ldrex %1, [%3]\n" \ 28 "1: ldrex %1, [%3]\n" \
33 " " insn "\n" \ 29 " " insn "\n" \
@@ -51,6 +47,8 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
51 return -EFAULT; 47 return -EFAULT;
52 48
53 smp_mb(); 49 smp_mb();
50 /* Prefetching cannot fault */
51 prefetchw(uaddr);
54 __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n" 52 __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n"
55 "1: ldrex %1, [%4]\n" 53 "1: ldrex %1, [%4]\n"
56 " teq %1, %2\n" 54 " teq %1, %2\n"
@@ -164,6 +162,5 @@ futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr)
164 return ret; 162 return ret;
165} 163}
166 164
167#endif /* !(CPU_USE_DOMAINS && SMP) */
168#endif /* __KERNEL__ */ 165#endif /* __KERNEL__ */
169#endif /* _ASM_ARM_FUTEX_H */ 166#endif /* _ASM_ARM_FUTEX_H */
diff --git a/arch/arm/plat-orion/include/plat/cache-feroceon-l2.h b/arch/arm/include/asm/hardware/cache-feroceon-l2.h
index 06f982d55697..12e1588dc4f1 100644
--- a/arch/arm/plat-orion/include/plat/cache-feroceon-l2.h
+++ b/arch/arm/include/asm/hardware/cache-feroceon-l2.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * arch/arm/plat-orion/include/plat/cache-feroceon-l2.h 2 * arch/arm/include/asm/hardware/cache-feroceon-l2.h
3 * 3 *
4 * Copyright (C) 2008 Marvell Semiconductor 4 * Copyright (C) 2008 Marvell Semiconductor
5 * 5 *
@@ -9,3 +9,5 @@
9 */ 9 */
10 10
11extern void __init feroceon_l2_init(int l2_wt_override); 11extern void __init feroceon_l2_init(int l2_wt_override);
12extern int __init feroceon_of_init(void);
13
diff --git a/arch/arm/include/asm/hw_breakpoint.h b/arch/arm/include/asm/hw_breakpoint.h
index eef55ea9ef00..8e427c7b4425 100644
--- a/arch/arm/include/asm/hw_breakpoint.h
+++ b/arch/arm/include/asm/hw_breakpoint.h
@@ -51,6 +51,7 @@ static inline void decode_ctrl_reg(u32 reg,
51#define ARM_DEBUG_ARCH_V7_ECP14 3 51#define ARM_DEBUG_ARCH_V7_ECP14 3
52#define ARM_DEBUG_ARCH_V7_MM 4 52#define ARM_DEBUG_ARCH_V7_MM 4
53#define ARM_DEBUG_ARCH_V7_1 5 53#define ARM_DEBUG_ARCH_V7_1 5
54#define ARM_DEBUG_ARCH_V8 6
54 55
55/* Breakpoint */ 56/* Breakpoint */
56#define ARM_BREAKPOINT_EXECUTE 0 57#define ARM_BREAKPOINT_EXECUTE 0
diff --git a/arch/arm/include/asm/hwcap.h b/arch/arm/include/asm/hwcap.h
index 6ff56eca3f1f..6e183fd269fb 100644
--- a/arch/arm/include/asm/hwcap.h
+++ b/arch/arm/include/asm/hwcap.h
@@ -9,6 +9,7 @@
9 * instruction set this cpu supports. 9 * instruction set this cpu supports.
10 */ 10 */
11#define ELF_HWCAP (elf_hwcap) 11#define ELF_HWCAP (elf_hwcap)
12extern unsigned int elf_hwcap; 12#define ELF_HWCAP2 (elf_hwcap2)
13extern unsigned int elf_hwcap, elf_hwcap2;
13#endif 14#endif
14#endif 15#endif
diff --git a/arch/arm/include/asm/jump_label.h b/arch/arm/include/asm/jump_label.h
index 863c892b4aaa..70f9b9bfb1f9 100644
--- a/arch/arm/include/asm/jump_label.h
+++ b/arch/arm/include/asm/jump_label.h
@@ -4,7 +4,6 @@
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/types.h> 6#include <linux/types.h>
7#include <asm/system.h>
8 7
9#define JUMP_LABEL_NOP_SIZE 4 8#define JUMP_LABEL_NOP_SIZE 4
10 9
diff --git a/arch/arm/include/asm/kprobes.h b/arch/arm/include/asm/kprobes.h
index f82ec22eeb11..49fa0dfaad33 100644
--- a/arch/arm/include/asm/kprobes.h
+++ b/arch/arm/include/asm/kprobes.h
@@ -18,7 +18,7 @@
18 18
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/ptrace.h> 20#include <linux/ptrace.h>
21#include <linux/percpu.h> 21#include <linux/notifier.h>
22 22
23#define __ARCH_WANT_KPROBES_INSN_SLOT 23#define __ARCH_WANT_KPROBES_INSN_SLOT
24#define MAX_INSN_SIZE 2 24#define MAX_INSN_SIZE 2
@@ -28,21 +28,10 @@
28#define kretprobe_blacklist_size 0 28#define kretprobe_blacklist_size 0
29 29
30typedef u32 kprobe_opcode_t; 30typedef u32 kprobe_opcode_t;
31
32struct kprobe; 31struct kprobe;
33typedef void (kprobe_insn_handler_t)(struct kprobe *, struct pt_regs *); 32#include <asm/probes.h>
34typedef unsigned long (kprobe_check_cc)(unsigned long);
35typedef void (kprobe_insn_singlestep_t)(struct kprobe *, struct pt_regs *);
36typedef void (kprobe_insn_fn_t)(void);
37 33
38/* Architecture specific copy of original instruction. */ 34#define arch_specific_insn arch_probes_insn
39struct arch_specific_insn {
40 kprobe_opcode_t *insn;
41 kprobe_insn_handler_t *insn_handler;
42 kprobe_check_cc *insn_check_cc;
43 kprobe_insn_singlestep_t *insn_singlestep;
44 kprobe_insn_fn_t *insn_fn;
45};
46 35
47struct prev_kprobe { 36struct prev_kprobe {
48 struct kprobe *kp; 37 struct kprobe *kp;
diff --git a/arch/arm/include/asm/kvm_arm.h b/arch/arm/include/asm/kvm_arm.h
index 1d3153c7eb41..816db0bf2dd8 100644
--- a/arch/arm/include/asm/kvm_arm.h
+++ b/arch/arm/include/asm/kvm_arm.h
@@ -55,6 +55,7 @@
55 * The bits we set in HCR: 55 * The bits we set in HCR:
56 * TAC: Trap ACTLR 56 * TAC: Trap ACTLR
57 * TSC: Trap SMC 57 * TSC: Trap SMC
58 * TVM: Trap VM ops (until MMU and caches are on)
58 * TSW: Trap cache operations by set/way 59 * TSW: Trap cache operations by set/way
59 * TWI: Trap WFI 60 * TWI: Trap WFI
60 * TWE: Trap WFE 61 * TWE: Trap WFE
@@ -68,8 +69,7 @@
68 */ 69 */
69#define HCR_GUEST_MASK (HCR_TSC | HCR_TSW | HCR_TWI | HCR_VM | HCR_BSU_IS | \ 70#define HCR_GUEST_MASK (HCR_TSC | HCR_TSW | HCR_TWI | HCR_VM | HCR_BSU_IS | \
70 HCR_FB | HCR_TAC | HCR_AMO | HCR_IMO | HCR_FMO | \ 71 HCR_FB | HCR_TAC | HCR_AMO | HCR_IMO | HCR_FMO | \
71 HCR_TWE | HCR_SWIO | HCR_TIDCP) 72 HCR_TVM | HCR_TWE | HCR_SWIO | HCR_TIDCP)
72#define HCR_VIRT_EXCP_MASK (HCR_VA | HCR_VI | HCR_VF)
73 73
74/* System Control Register (SCTLR) bits */ 74/* System Control Register (SCTLR) bits */
75#define SCTLR_TE (1 << 30) 75#define SCTLR_TE (1 << 30)
diff --git a/arch/arm/include/asm/kvm_asm.h b/arch/arm/include/asm/kvm_asm.h
index 661da11f76f4..53b3c4a50d5c 100644
--- a/arch/arm/include/asm/kvm_asm.h
+++ b/arch/arm/include/asm/kvm_asm.h
@@ -48,7 +48,9 @@
48#define c13_TID_URO 26 /* Thread ID, User R/O */ 48#define c13_TID_URO 26 /* Thread ID, User R/O */
49#define c13_TID_PRIV 27 /* Thread ID, Privileged */ 49#define c13_TID_PRIV 27 /* Thread ID, Privileged */
50#define c14_CNTKCTL 28 /* Timer Control Register (PL1) */ 50#define c14_CNTKCTL 28 /* Timer Control Register (PL1) */
51#define NR_CP15_REGS 29 /* Number of regs (incl. invalid) */ 51#define c10_AMAIR0 29 /* Auxilary Memory Attribute Indirection Reg0 */
52#define c10_AMAIR1 30 /* Auxilary Memory Attribute Indirection Reg1 */
53#define NR_CP15_REGS 31 /* Number of regs (incl. invalid) */
52 54
53#define ARM_EXCEPTION_RESET 0 55#define ARM_EXCEPTION_RESET 0
54#define ARM_EXCEPTION_UNDEFINED 1 56#define ARM_EXCEPTION_UNDEFINED 1
diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
index 098f7dd6d564..09af14999c9b 100644
--- a/arch/arm/include/asm/kvm_host.h
+++ b/arch/arm/include/asm/kvm_host.h
@@ -101,6 +101,12 @@ struct kvm_vcpu_arch {
101 /* The CPU type we expose to the VM */ 101 /* The CPU type we expose to the VM */
102 u32 midr; 102 u32 midr;
103 103
104 /* HYP trapping configuration */
105 u32 hcr;
106
107 /* Interrupt related fields */
108 u32 irq_lines; /* IRQ and FIQ levels */
109
104 /* Exception Information */ 110 /* Exception Information */
105 struct kvm_vcpu_fault_info fault; 111 struct kvm_vcpu_fault_info fault;
106 112
@@ -128,9 +134,6 @@ struct kvm_vcpu_arch {
128 /* IO related fields */ 134 /* IO related fields */
129 struct kvm_decode mmio_decode; 135 struct kvm_decode mmio_decode;
130 136
131 /* Interrupt related fields */
132 u32 irq_lines; /* IRQ and FIQ levels */
133
134 /* Cache some mmu pages needed inside spinlock regions */ 137 /* Cache some mmu pages needed inside spinlock regions */
135 struct kvm_mmu_memory_cache mmu_page_cache; 138 struct kvm_mmu_memory_cache mmu_page_cache;
136 139
diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
index 2d122adcdb22..5c7aa3c1519f 100644
--- a/arch/arm/include/asm/kvm_mmu.h
+++ b/arch/arm/include/asm/kvm_mmu.h
@@ -114,11 +114,34 @@ static inline void kvm_set_s2pmd_writable(pmd_t *pmd)
114 pmd_val(*pmd) |= L_PMD_S2_RDWR; 114 pmd_val(*pmd) |= L_PMD_S2_RDWR;
115} 115}
116 116
117/* Open coded p*d_addr_end that can deal with 64bit addresses */
118#define kvm_pgd_addr_end(addr, end) \
119({ u64 __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK; \
120 (__boundary - 1 < (end) - 1)? __boundary: (end); \
121})
122
123#define kvm_pud_addr_end(addr,end) (end)
124
125#define kvm_pmd_addr_end(addr, end) \
126({ u64 __boundary = ((addr) + PMD_SIZE) & PMD_MASK; \
127 (__boundary - 1 < (end) - 1)? __boundary: (end); \
128})
129
117struct kvm; 130struct kvm;
118 131
119static inline void coherent_icache_guest_page(struct kvm *kvm, hva_t hva, 132#define kvm_flush_dcache_to_poc(a,l) __cpuc_flush_dcache_area((a), (l))
120 unsigned long size) 133
134static inline bool vcpu_has_cache_enabled(struct kvm_vcpu *vcpu)
121{ 135{
136 return (vcpu->arch.cp15[c1_SCTLR] & 0b101) == 0b101;
137}
138
139static inline void coherent_cache_guest_page(struct kvm_vcpu *vcpu, hva_t hva,
140 unsigned long size)
141{
142 if (!vcpu_has_cache_enabled(vcpu))
143 kvm_flush_dcache_to_poc((void *)hva, size);
144
122 /* 145 /*
123 * If we are going to insert an instruction page and the icache is 146 * If we are going to insert an instruction page and the icache is
124 * either VIPT or PIPT, there is a potential problem where the host 147 * either VIPT or PIPT, there is a potential problem where the host
@@ -139,9 +162,10 @@ static inline void coherent_icache_guest_page(struct kvm *kvm, hva_t hva,
139 } 162 }
140} 163}
141 164
142#define kvm_flush_dcache_to_poc(a,l) __cpuc_flush_dcache_area((a), (l))
143#define kvm_virt_to_phys(x) virt_to_idmap((unsigned long)(x)) 165#define kvm_virt_to_phys(x) virt_to_idmap((unsigned long)(x))
144 166
167void stage2_flush_vm(struct kvm *kvm);
168
145#endif /* !__ASSEMBLY__ */ 169#endif /* !__ASSEMBLY__ */
146 170
147#endif /* __ARM_KVM_MMU_H__ */ 171#endif /* __ARM_KVM_MMU_H__ */
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 4afb376d9c7c..02fa2558f662 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -166,9 +166,17 @@
166 * Physical vs virtual RAM address space conversion. These are 166 * Physical vs virtual RAM address space conversion. These are
167 * private definitions which should NOT be used outside memory.h 167 * private definitions which should NOT be used outside memory.h
168 * files. Use virt_to_phys/phys_to_virt/__pa/__va instead. 168 * files. Use virt_to_phys/phys_to_virt/__pa/__va instead.
169 *
170 * PFNs are used to describe any physical page; this means
171 * PFN 0 == physical address 0.
169 */ 172 */
170#ifndef __virt_to_phys 173#if defined(__virt_to_phys)
171#ifdef CONFIG_ARM_PATCH_PHYS_VIRT 174#define PHYS_OFFSET PLAT_PHYS_OFFSET
175#define PHYS_PFN_OFFSET ((unsigned long)(PHYS_OFFSET >> PAGE_SHIFT))
176
177#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
178
179#elif defined(CONFIG_ARM_PATCH_PHYS_VIRT)
172 180
173/* 181/*
174 * Constants used to force the right instruction encodings and shifts 182 * Constants used to force the right instruction encodings and shifts
@@ -177,12 +185,17 @@
177#define __PV_BITS_31_24 0x81000000 185#define __PV_BITS_31_24 0x81000000
178#define __PV_BITS_7_0 0x81 186#define __PV_BITS_7_0 0x81
179 187
180extern u64 __pv_phys_offset; 188extern unsigned long __pv_phys_pfn_offset;
181extern u64 __pv_offset; 189extern u64 __pv_offset;
182extern void fixup_pv_table(const void *, unsigned long); 190extern void fixup_pv_table(const void *, unsigned long);
183extern const void *__pv_table_begin, *__pv_table_end; 191extern const void *__pv_table_begin, *__pv_table_end;
184 192
185#define PHYS_OFFSET __pv_phys_offset 193#define PHYS_OFFSET ((phys_addr_t)__pv_phys_pfn_offset << PAGE_SHIFT)
194#define PHYS_PFN_OFFSET (__pv_phys_pfn_offset)
195
196#define virt_to_pfn(kaddr) \
197 ((((unsigned long)(kaddr) - PAGE_OFFSET) >> PAGE_SHIFT) + \
198 PHYS_PFN_OFFSET)
186 199
187#define __pv_stub(from,to,instr,type) \ 200#define __pv_stub(from,to,instr,type) \
188 __asm__("@ __pv_stub\n" \ 201 __asm__("@ __pv_stub\n" \
@@ -243,6 +256,7 @@ static inline unsigned long __phys_to_virt(phys_addr_t x)
243#else 256#else
244 257
245#define PHYS_OFFSET PLAT_PHYS_OFFSET 258#define PHYS_OFFSET PLAT_PHYS_OFFSET
259#define PHYS_PFN_OFFSET ((unsigned long)(PHYS_OFFSET >> PAGE_SHIFT))
246 260
247static inline phys_addr_t __virt_to_phys(unsigned long x) 261static inline phys_addr_t __virt_to_phys(unsigned long x)
248{ 262{
@@ -254,18 +268,11 @@ static inline unsigned long __phys_to_virt(phys_addr_t x)
254 return x - PHYS_OFFSET + PAGE_OFFSET; 268 return x - PHYS_OFFSET + PAGE_OFFSET;
255} 269}
256 270
257#endif 271#define virt_to_pfn(kaddr) \
258#endif 272 ((((unsigned long)(kaddr) - PAGE_OFFSET) >> PAGE_SHIFT) + \
273 PHYS_PFN_OFFSET)
259 274
260/* 275#endif
261 * PFNs are used to describe any physical page; this means
262 * PFN 0 == physical address 0.
263 *
264 * This is the PFN of the first RAM page in the kernel
265 * direct-mapped view. We assume this is the first page
266 * of RAM in the mem_map as well.
267 */
268#define PHYS_PFN_OFFSET ((unsigned long)(PHYS_OFFSET >> PAGE_SHIFT))
269 276
270/* 277/*
271 * These are *only* valid on the kernel direct mapped RAM memory. 278 * These are *only* valid on the kernel direct mapped RAM memory.
@@ -343,9 +350,9 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
343 */ 350 */
344#define ARCH_PFN_OFFSET PHYS_PFN_OFFSET 351#define ARCH_PFN_OFFSET PHYS_PFN_OFFSET
345 352
346#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 353#define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr))
347#define virt_addr_valid(kaddr) (((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) \ 354#define virt_addr_valid(kaddr) (((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) \
348 && pfn_valid(__pa(kaddr) >> PAGE_SHIFT) ) 355 && pfn_valid(virt_to_pfn(kaddr)))
349 356
350#endif 357#endif
351 358
diff --git a/arch/arm/include/asm/pgtable-2level.h b/arch/arm/include/asm/pgtable-2level.h
index dfff709fda3c..219ac88a9542 100644
--- a/arch/arm/include/asm/pgtable-2level.h
+++ b/arch/arm/include/asm/pgtable-2level.h
@@ -140,6 +140,7 @@
140#define L_PTE_MT_DEV_NONSHARED (_AT(pteval_t, 0x0c) << 2) /* 1100 */ 140#define L_PTE_MT_DEV_NONSHARED (_AT(pteval_t, 0x0c) << 2) /* 1100 */
141#define L_PTE_MT_DEV_WC (_AT(pteval_t, 0x09) << 2) /* 1001 */ 141#define L_PTE_MT_DEV_WC (_AT(pteval_t, 0x09) << 2) /* 1001 */
142#define L_PTE_MT_DEV_CACHED (_AT(pteval_t, 0x0b) << 2) /* 1011 */ 142#define L_PTE_MT_DEV_CACHED (_AT(pteval_t, 0x0b) << 2) /* 1011 */
143#define L_PTE_MT_VECTORS (_AT(pteval_t, 0x0f) << 2) /* 1111 */
143#define L_PTE_MT_MASK (_AT(pteval_t, 0x0f) << 2) 144#define L_PTE_MT_MASK (_AT(pteval_t, 0x0f) << 2)
144 145
145#ifndef __ASSEMBLY__ 146#ifndef __ASSEMBLY__
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index 7d59b524f2af..5478e5d6ad89 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -216,13 +216,16 @@ static inline pte_t *pmd_page_vaddr(pmd_t pmd)
216 216
217#define pte_none(pte) (!pte_val(pte)) 217#define pte_none(pte) (!pte_val(pte))
218#define pte_present(pte) (pte_val(pte) & L_PTE_PRESENT) 218#define pte_present(pte) (pte_val(pte) & L_PTE_PRESENT)
219#define pte_valid(pte) (pte_val(pte) & L_PTE_VALID)
220#define pte_accessible(mm, pte) (mm_tlb_flush_pending(mm) ? pte_present(pte) : pte_valid(pte))
219#define pte_write(pte) (!(pte_val(pte) & L_PTE_RDONLY)) 221#define pte_write(pte) (!(pte_val(pte) & L_PTE_RDONLY))
220#define pte_dirty(pte) (pte_val(pte) & L_PTE_DIRTY) 222#define pte_dirty(pte) (pte_val(pte) & L_PTE_DIRTY)
221#define pte_young(pte) (pte_val(pte) & L_PTE_YOUNG) 223#define pte_young(pte) (pte_val(pte) & L_PTE_YOUNG)
222#define pte_exec(pte) (!(pte_val(pte) & L_PTE_XN)) 224#define pte_exec(pte) (!(pte_val(pte) & L_PTE_XN))
223#define pte_special(pte) (0) 225#define pte_special(pte) (0)
224 226
225#define pte_present_user(pte) (pte_present(pte) && (pte_val(pte) & L_PTE_USER)) 227#define pte_valid_user(pte) \
228 (pte_valid(pte) && (pte_val(pte) & L_PTE_USER) && pte_young(pte))
226 229
227#if __LINUX_ARM_ARCH__ < 6 230#if __LINUX_ARM_ARCH__ < 6
228static inline void __sync_icache_dcache(pte_t pteval) 231static inline void __sync_icache_dcache(pte_t pteval)
@@ -237,7 +240,7 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
237{ 240{
238 unsigned long ext = 0; 241 unsigned long ext = 0;
239 242
240 if (addr < TASK_SIZE && pte_present_user(pteval)) { 243 if (addr < TASK_SIZE && pte_valid_user(pteval)) {
241 __sync_icache_dcache(pteval); 244 __sync_icache_dcache(pteval);
242 ext |= PTE_EXT_NG; 245 ext |= PTE_EXT_NG;
243 } 246 }
diff --git a/arch/arm/include/asm/pmu.h b/arch/arm/include/asm/pmu.h
index f24edad26c70..ae1919be8f98 100644
--- a/arch/arm/include/asm/pmu.h
+++ b/arch/arm/include/asm/pmu.h
@@ -71,6 +71,8 @@ struct arm_pmu {
71 void (*disable)(struct perf_event *event); 71 void (*disable)(struct perf_event *event);
72 int (*get_event_idx)(struct pmu_hw_events *hw_events, 72 int (*get_event_idx)(struct pmu_hw_events *hw_events,
73 struct perf_event *event); 73 struct perf_event *event);
74 void (*clear_event_idx)(struct pmu_hw_events *hw_events,
75 struct perf_event *event);
74 int (*set_event_filter)(struct hw_perf_event *evt, 76 int (*set_event_filter)(struct hw_perf_event *evt,
75 struct perf_event_attr *attr); 77 struct perf_event_attr *attr);
76 u32 (*read_counter)(struct perf_event *event); 78 u32 (*read_counter)(struct perf_event *event);
diff --git a/arch/arm/include/asm/probes.h b/arch/arm/include/asm/probes.h
new file mode 100644
index 000000000000..806cfe622a9e
--- /dev/null
+++ b/arch/arm/include/asm/probes.h
@@ -0,0 +1,43 @@
1/*
2 * arch/arm/include/asm/probes.h
3 *
4 * Original contents copied from arch/arm/include/asm/kprobes.h
5 * which contains the following notice...
6 *
7 * Copyright (C) 2006, 2007 Motorola Inc.
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 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 */
18
19#ifndef _ASM_PROBES_H
20#define _ASM_PROBES_H
21
22typedef u32 probes_opcode_t;
23
24struct arch_probes_insn;
25typedef void (probes_insn_handler_t)(probes_opcode_t,
26 struct arch_probes_insn *,
27 struct pt_regs *);
28typedef unsigned long (probes_check_cc)(unsigned long);
29typedef void (probes_insn_singlestep_t)(probes_opcode_t,
30 struct arch_probes_insn *,
31 struct pt_regs *);
32typedef void (probes_insn_fn_t)(void);
33
34/* Architecture specific copy of original instruction. */
35struct arch_probes_insn {
36 probes_opcode_t *insn;
37 probes_insn_handler_t *insn_handler;
38 probes_check_cc *insn_check_cc;
39 probes_insn_singlestep_t *insn_singlestep;
40 probes_insn_fn_t *insn_fn;
41};
42
43#endif
diff --git a/arch/arm/include/asm/ptrace.h b/arch/arm/include/asm/ptrace.h
index 04c99f36ff7f..c877654fe3bf 100644
--- a/arch/arm/include/asm/ptrace.h
+++ b/arch/arm/include/asm/ptrace.h
@@ -27,9 +27,13 @@ struct pt_regs {
27#define thumb_mode(regs) (0) 27#define thumb_mode(regs) (0)
28#endif 28#endif
29 29
30#ifndef CONFIG_CPU_V7M
30#define isa_mode(regs) \ 31#define isa_mode(regs) \
31 ((((regs)->ARM_cpsr & PSR_J_BIT) >> 23) | \ 32 ((((regs)->ARM_cpsr & PSR_J_BIT) >> (__ffs(PSR_J_BIT) - 1)) | \
32 (((regs)->ARM_cpsr & PSR_T_BIT) >> 5)) 33 (((regs)->ARM_cpsr & PSR_T_BIT) >> (__ffs(PSR_T_BIT))))
34#else
35#define isa_mode(regs) 1 /* Thumb */
36#endif
33 37
34#define processor_mode(regs) \ 38#define processor_mode(regs) \
35 ((regs)->ARM_cpsr & MODE_MASK) 39 ((regs)->ARM_cpsr & MODE_MASK)
@@ -80,6 +84,12 @@ static inline long regs_return_value(struct pt_regs *regs)
80 84
81#define instruction_pointer(regs) (regs)->ARM_pc 85#define instruction_pointer(regs) (regs)->ARM_pc
82 86
87static inline void instruction_pointer_set(struct pt_regs *regs,
88 unsigned long val)
89{
90 instruction_pointer(regs) = val;
91}
92
83#ifdef CONFIG_SMP 93#ifdef CONFIG_SMP
84extern unsigned long profile_pc(struct pt_regs *regs); 94extern unsigned long profile_pc(struct pt_regs *regs);
85#else 95#else
diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
index 22a3b9b5d4a1..2ec765c39ab4 100644
--- a/arch/arm/include/asm/smp.h
+++ b/arch/arm/include/asm/smp.h
@@ -74,6 +74,7 @@ struct secondary_data {
74}; 74};
75extern struct secondary_data secondary_data; 75extern struct secondary_data secondary_data;
76extern volatile int pen_release; 76extern volatile int pen_release;
77extern void secondary_startup(void);
77 78
78extern int __cpu_disable(void); 79extern int __cpu_disable(void);
79 80
@@ -114,6 +115,15 @@ struct smp_operations {
114#endif 115#endif
115}; 116};
116 117
118struct of_cpu_method {
119 const char *method;
120 struct smp_operations *ops;
121};
122
123#define CPU_METHOD_OF_DECLARE(name, _method, _ops) \
124 static const struct of_cpu_method __cpu_method_of_table_##name \
125 __used __section(__cpu_method_of_table) \
126 = { .method = _method, .ops = _ops }
117/* 127/*
118 * set platform specific SMP operations 128 * set platform specific SMP operations
119 */ 129 */
diff --git a/arch/arm/include/asm/sync_bitops.h b/arch/arm/include/asm/sync_bitops.h
index 63479eecbf76..9732b8e11e63 100644
--- a/arch/arm/include/asm/sync_bitops.h
+++ b/arch/arm/include/asm/sync_bitops.h
@@ -2,7 +2,6 @@
2#define __ASM_SYNC_BITOPS_H__ 2#define __ASM_SYNC_BITOPS_H__
3 3
4#include <asm/bitops.h> 4#include <asm/bitops.h>
5#include <asm/system.h>
6 5
7/* sync_bitops functions are equivalent to the SMP implementation of the 6/* sync_bitops functions are equivalent to the SMP implementation of the
8 * original functions, independently from CONFIG_SMP being defined. 7 * original functions, independently from CONFIG_SMP being defined.
diff --git a/arch/arm/include/asm/syscall.h b/arch/arm/include/asm/syscall.h
index 73ddd7239b33..4651f6999b7d 100644
--- a/arch/arm/include/asm/syscall.h
+++ b/arch/arm/include/asm/syscall.h
@@ -7,7 +7,7 @@
7#ifndef _ASM_ARM_SYSCALL_H 7#ifndef _ASM_ARM_SYSCALL_H
8#define _ASM_ARM_SYSCALL_H 8#define _ASM_ARM_SYSCALL_H
9 9
10#include <linux/audit.h> /* for AUDIT_ARCH_* */ 10#include <uapi/linux/audit.h> /* for AUDIT_ARCH_* */
11#include <linux/elf.h> /* for ELF_EM */ 11#include <linux/elf.h> /* for ELF_EM */
12#include <linux/err.h> 12#include <linux/err.h>
13#include <linux/sched.h> 13#include <linux/sched.h>
@@ -103,8 +103,7 @@ static inline void syscall_set_arguments(struct task_struct *task,
103 memcpy(&regs->ARM_r0 + i, args, n * sizeof(args[0])); 103 memcpy(&regs->ARM_r0 + i, args, n * sizeof(args[0]));
104} 104}
105 105
106static inline int syscall_get_arch(struct task_struct *task, 106static inline int syscall_get_arch(void)
107 struct pt_regs *regs)
108{ 107{
109 /* ARM tasks don't change audit architectures on the fly. */ 108 /* ARM tasks don't change audit architectures on the fly. */
110 return AUDIT_ARCH_ARM; 109 return AUDIT_ARCH_ARM;
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
deleted file mode 100644
index 368165e33c1c..000000000000
--- a/arch/arm/include/asm/system.h
+++ /dev/null
@@ -1,7 +0,0 @@
1/* FILE TO BE DELETED. DO NOT ADD STUFF HERE! */
2#include <asm/barrier.h>
3#include <asm/compiler.h>
4#include <asm/cmpxchg.h>
5#include <asm/switch_to.h>
6#include <asm/system_info.h>
7#include <asm/system_misc.h>
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
index 71a06b293489..f989d7c22dc5 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -153,6 +153,7 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
153#define TIF_SIGPENDING 0 153#define TIF_SIGPENDING 0
154#define TIF_NEED_RESCHED 1 154#define TIF_NEED_RESCHED 1
155#define TIF_NOTIFY_RESUME 2 /* callback before returning to user */ 155#define TIF_NOTIFY_RESUME 2 /* callback before returning to user */
156#define TIF_UPROBE 7
156#define TIF_SYSCALL_TRACE 8 157#define TIF_SYSCALL_TRACE 8
157#define TIF_SYSCALL_AUDIT 9 158#define TIF_SYSCALL_AUDIT 9
158#define TIF_SYSCALL_TRACEPOINT 10 159#define TIF_SYSCALL_TRACEPOINT 10
@@ -165,6 +166,7 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
165#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 166#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
166#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) 167#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
167#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) 168#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
169#define _TIF_UPROBE (1 << TIF_UPROBE)
168#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 170#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
169#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) 171#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
170#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) 172#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
@@ -178,7 +180,8 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *,
178/* 180/*
179 * Change these and you break ASM code in entry-common.S 181 * Change these and you break ASM code in entry-common.S
180 */ 182 */
181#define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | _TIF_NOTIFY_RESUME) 183#define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \
184 _TIF_NOTIFY_RESUME | _TIF_UPROBE)
182 185
183#endif /* __KERNEL__ */ 186#endif /* __KERNEL__ */
184#endif /* __ASM_ARM_THREAD_INFO_H */ 187#endif /* __ASM_ARM_THREAD_INFO_H */
diff --git a/arch/arm/include/asm/timex.h b/arch/arm/include/asm/timex.h
index 83f2aa83899c..f6fcc67ef06e 100644
--- a/arch/arm/include/asm/timex.h
+++ b/arch/arm/include/asm/timex.h
@@ -12,12 +12,6 @@
12#ifndef _ASMARM_TIMEX_H 12#ifndef _ASMARM_TIMEX_H
13#define _ASMARM_TIMEX_H 13#define _ASMARM_TIMEX_H
14 14
15#ifdef CONFIG_ARCH_MULTIPLATFORM
16#define CLOCK_TICK_RATE 1000000
17#else
18#include <mach/timex.h>
19#endif
20
21typedef unsigned long cycles_t; 15typedef unsigned long cycles_t;
22#define get_cycles() ({ cycles_t c; read_current_timer(&c) ? 0 : c; }) 16#define get_cycles() ({ cycles_t c; read_current_timer(&c) ? 0 : c; })
23 17
diff --git a/arch/arm/include/asm/trusted_foundations.h b/arch/arm/include/asm/trusted_foundations.h
index 3bd36e2c5f2e..b5f7705abcb0 100644
--- a/arch/arm/include/asm/trusted_foundations.h
+++ b/arch/arm/include/asm/trusted_foundations.h
@@ -30,6 +30,8 @@
30#include <linux/printk.h> 30#include <linux/printk.h>
31#include <linux/bug.h> 31#include <linux/bug.h>
32#include <linux/of.h> 32#include <linux/of.h>
33#include <linux/cpu.h>
34#include <linux/smp.h>
33 35
34struct trusted_foundations_platform_data { 36struct trusted_foundations_platform_data {
35 unsigned int version_major; 37 unsigned int version_major;
@@ -47,10 +49,13 @@ static inline void register_trusted_foundations(
47 struct trusted_foundations_platform_data *pd) 49 struct trusted_foundations_platform_data *pd)
48{ 50{
49 /* 51 /*
50 * If we try to register TF, this means the system needs it to continue. 52 * If the system requires TF and we cannot provide it, continue booting
51 * Its absence if thus a fatal error. 53 * but disable features that cannot be provided.
52 */ 54 */
53 panic("No support for Trusted Foundations, stopping...\n"); 55 pr_err("No support for Trusted Foundations, continuing in degraded mode.\n");
56 pr_err("Secondary processors as well as CPU PM will be disabled.\n");
57 setup_max_cpus = 0;
58 cpu_idle_poll_ctrl(true);
54} 59}
55 60
56static inline void of_register_trusted_foundations(void) 61static inline void of_register_trusted_foundations(void)
@@ -59,7 +64,7 @@ static inline void of_register_trusted_foundations(void)
59 * If we find the target should enable TF but does not support it, 64 * If we find the target should enable TF but does not support it,
60 * fail as the system won't be able to do much anyway 65 * fail as the system won't be able to do much anyway
61 */ 66 */
62 if (of_find_compatible_node(NULL, NULL, "tl,trusted-foundations")) 67 if (of_find_compatible_node(NULL, NULL, "tlm,trusted-foundations"))
63 register_trusted_foundations(NULL); 68 register_trusted_foundations(NULL);
64} 69}
65#endif /* CONFIG_TRUSTED_FOUNDATIONS */ 70#endif /* CONFIG_TRUSTED_FOUNDATIONS */
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
index 72abdc541f38..12c3a5decc60 100644
--- a/arch/arm/include/asm/uaccess.h
+++ b/arch/arm/include/asm/uaccess.h
@@ -19,7 +19,7 @@
19#include <asm/unified.h> 19#include <asm/unified.h>
20#include <asm/compiler.h> 20#include <asm/compiler.h>
21 21
22#if __LINUX_ARM_ARCH__ < 6 22#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
23#include <asm-generic/uaccess-unaligned.h> 23#include <asm-generic/uaccess-unaligned.h>
24#else 24#else
25#define __get_user_unaligned __get_user 25#define __get_user_unaligned __get_user
diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h
index acabef1a75df..43876245fc57 100644
--- a/arch/arm/include/asm/unistd.h
+++ b/arch/arm/include/asm/unistd.h
@@ -48,6 +48,5 @@
48 */ 48 */
49#define __IGNORE_fadvise64_64 49#define __IGNORE_fadvise64_64
50#define __IGNORE_migrate_pages 50#define __IGNORE_migrate_pages
51#define __IGNORE_kcmp
52 51
53#endif /* __ASM_ARM_UNISTD_H */ 52#endif /* __ASM_ARM_UNISTD_H */
diff --git a/arch/arm/include/asm/uprobes.h b/arch/arm/include/asm/uprobes.h
new file mode 100644
index 000000000000..9472c20b7d49
--- /dev/null
+++ b/arch/arm/include/asm/uprobes.h
@@ -0,0 +1,45 @@
1/*
2 * Copyright (C) 2012 Rabin Vincent <rabin at rab.in>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef _ASM_UPROBES_H
10#define _ASM_UPROBES_H
11
12#include <asm/probes.h>
13#include <asm/opcodes.h>
14
15typedef u32 uprobe_opcode_t;
16
17#define MAX_UINSN_BYTES 4
18#define UPROBE_XOL_SLOT_BYTES 64
19
20#define UPROBE_SWBP_ARM_INSN 0xe7f001f9
21#define UPROBE_SS_ARM_INSN 0xe7f001fa
22#define UPROBE_SWBP_INSN __opcode_to_mem_arm(UPROBE_SWBP_ARM_INSN)
23#define UPROBE_SWBP_INSN_SIZE 4
24
25struct arch_uprobe_task {
26 u32 backup;
27 unsigned long saved_trap_no;
28};
29
30struct arch_uprobe {
31 u8 insn[MAX_UINSN_BYTES];
32 unsigned long ixol[2];
33 uprobe_opcode_t bpinsn;
34 bool simulate;
35 u32 pcreg;
36 void (*prehandler)(struct arch_uprobe *auprobe,
37 struct arch_uprobe_task *autask,
38 struct pt_regs *regs);
39 void (*posthandler)(struct arch_uprobe *auprobe,
40 struct arch_uprobe_task *autask,
41 struct pt_regs *regs);
42 struct arch_probes_insn asi;
43};
44
45#endif
diff --git a/arch/arm/include/asm/xen/page.h b/arch/arm/include/asm/xen/page.h
index e0965abacb7d..cf4f3e867395 100644
--- a/arch/arm/include/asm/xen/page.h
+++ b/arch/arm/include/asm/xen/page.h
@@ -97,16 +97,13 @@ static inline pte_t *lookup_address(unsigned long address, unsigned int *level)
97 return NULL; 97 return NULL;
98} 98}
99 99
100static inline int m2p_add_override(unsigned long mfn, struct page *page, 100extern int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
101 struct gnttab_map_grant_ref *kmap_op) 101 struct gnttab_map_grant_ref *kmap_ops,
102{ 102 struct page **pages, unsigned int count);
103 return 0;
104}
105 103
106static inline int m2p_remove_override(struct page *page, bool clear_pte) 104extern int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops,
107{ 105 struct gnttab_map_grant_ref *kmap_ops,
108 return 0; 106 struct page **pages, unsigned int count);
109}
110 107
111bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn); 108bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn);
112bool __set_phys_to_machine_multi(unsigned long pfn, unsigned long mfn, 109bool __set_phys_to_machine_multi(unsigned long pfn, unsigned long mfn,
diff --git a/arch/arm/include/debug/samsung.S b/arch/arm/include/debug/samsung.S
index f3a9cff6d5d4..8d8d922e5e44 100644
--- a/arch/arm/include/debug/samsung.S
+++ b/arch/arm/include/debug/samsung.S
@@ -9,7 +9,7 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10*/ 10*/
11 11
12#include <plat/regs-serial.h> 12#include <linux/serial_s3c.h>
13 13
14/* The S5PV210/S5PC110 implementations are as belows. */ 14/* The S5PV210/S5PC110 implementations are as belows. */
15 15
diff --git a/arch/arm/include/debug/tegra.S b/arch/arm/include/debug/tegra.S
index f98763f0bc17..3bc80599c022 100644
--- a/arch/arm/include/debug/tegra.S
+++ b/arch/arm/include/debug/tegra.S
@@ -53,8 +53,7 @@
53 53
54#define checkuart(rp, rv, lhu, bit, uart) \ 54#define checkuart(rp, rv, lhu, bit, uart) \
55 /* Load address of CLK_RST register */ \ 55 /* Load address of CLK_RST register */ \
56 movw rp, #TEGRA_CLK_RST_DEVICES_##lhu & 0xffff ; \ 56 ldr rp, =TEGRA_CLK_RST_DEVICES_##lhu ; \
57 movt rp, #TEGRA_CLK_RST_DEVICES_##lhu >> 16 ; \
58 /* Load value from CLK_RST register */ \ 57 /* Load value from CLK_RST register */ \
59 ldr rp, [rp, #0] ; \ 58 ldr rp, [rp, #0] ; \
60 /* Test UART's reset bit */ \ 59 /* Test UART's reset bit */ \
@@ -62,8 +61,7 @@
62 /* If set, can't use UART; jump to save no UART */ \ 61 /* If set, can't use UART; jump to save no UART */ \
63 bne 90f ; \ 62 bne 90f ; \
64 /* Load address of CLK_OUT_ENB register */ \ 63 /* Load address of CLK_OUT_ENB register */ \
65 movw rp, #TEGRA_CLK_OUT_ENB_##lhu & 0xffff ; \ 64 ldr rp, =TEGRA_CLK_OUT_ENB_##lhu ; \
66 movt rp, #TEGRA_CLK_OUT_ENB_##lhu >> 16 ; \
67 /* Load value from CLK_OUT_ENB register */ \ 65 /* Load value from CLK_OUT_ENB register */ \
68 ldr rp, [rp, #0] ; \ 66 ldr rp, [rp, #0] ; \
69 /* Test UART's clock enable bit */ \ 67 /* Test UART's clock enable bit */ \
@@ -71,8 +69,7 @@
71 /* If clear, can't use UART; jump to save no UART */ \ 69 /* If clear, can't use UART; jump to save no UART */ \
72 beq 90f ; \ 70 beq 90f ; \
73 /* Passed all tests, load address of UART registers */ \ 71 /* Passed all tests, load address of UART registers */ \
74 movw rp, #TEGRA_UART##uart##_BASE & 0xffff ; \ 72 ldr rp, =TEGRA_UART##uart##_BASE ; \
75 movt rp, #TEGRA_UART##uart##_BASE >> 16 ; \
76 /* Jump to save UART address */ \ 73 /* Jump to save UART address */ \
77 b 91f 74 b 91f
78 75
@@ -90,15 +87,16 @@
90 87
91#ifdef CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA 88#ifdef CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA
92 /* Check ODMDATA */ 89 /* Check ODMDATA */
9310: movw \rp, #TEGRA_PMC_SCRATCH20 & 0xffff 9010: ldr \rp, =TEGRA_PMC_SCRATCH20
94 movt \rp, #TEGRA_PMC_SCRATCH20 >> 16
95 ldr \rp, [\rp, #0] @ Load PMC_SCRATCH20 91 ldr \rp, [\rp, #0] @ Load PMC_SCRATCH20
96 ubfx \rv, \rp, #18, #2 @ 19:18 are console type 92 lsr \rv, \rp, #18 @ 19:18 are console type
93 and \rv, \rv, #3
97 cmp \rv, #2 @ 2 and 3 mean DCC, UART 94 cmp \rv, #2 @ 2 and 3 mean DCC, UART
98 beq 11f @ some boards swap the meaning 95 beq 11f @ some boards swap the meaning
99 cmp \rv, #3 @ so accept either 96 cmp \rv, #3 @ so accept either
100 bne 90f 97 bne 90f
10111: ubfx \rv, \rp, #15, #3 @ 17:15 are UART ID 9811: lsr \rv, \rp, #15 @ 17:15 are UART ID
99 and \rv, #7
102 cmp \rv, #0 @ UART 0? 100 cmp \rv, #0 @ UART 0?
103 beq 20f 101 beq 20f
104 cmp \rv, #1 @ UART 1? 102 cmp \rv, #1 @ UART 1?
diff --git a/arch/arm/include/debug/zynq.S b/arch/arm/include/debug/zynq.S
index f9aa9740a73f..0b762fafa758 100644
--- a/arch/arm/include/debug/zynq.S
+++ b/arch/arm/include/debug/zynq.S
@@ -42,6 +42,9 @@
42 .endm 42 .endm
43 43
44 .macro waituart,rd,rx 44 .macro waituart,rd,rx
451001: ldr \rd, [\rx, #UART_SR_OFFSET]
46 tst \rd, #UART_SR_TXEMPTY
47 beq 1001b
45 .endm 48 .endm
46 49
47 .macro busyuart,rd,rx 50 .macro busyuart,rd,rx
diff --git a/arch/arm/include/uapi/asm/hwcap.h b/arch/arm/include/uapi/asm/hwcap.h
index 7dcc10d67253..20d12f230a2f 100644
--- a/arch/arm/include/uapi/asm/hwcap.h
+++ b/arch/arm/include/uapi/asm/hwcap.h
@@ -28,4 +28,13 @@
28#define HWCAP_LPAE (1 << 20) 28#define HWCAP_LPAE (1 << 20)
29#define HWCAP_EVTSTRM (1 << 21) 29#define HWCAP_EVTSTRM (1 << 21)
30 30
31/*
32 * HWCAP2 flags - for elf_hwcap2 (in kernel) and AT_HWCAP2
33 */
34#define HWCAP2_AES (1 << 0)
35#define HWCAP2_PMULL (1 << 1)
36#define HWCAP2_SHA1 (1 << 2)
37#define HWCAP2_SHA2 (1 << 3)
38#define HWCAP2_CRC32 (1 << 4)
39
31#endif /* _UAPI__ASMARM_HWCAP_H */ 40#endif /* _UAPI__ASMARM_HWCAP_H */
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index a30fc9be9e9e..a766bcbaf8ad 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -50,11 +50,12 @@ obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o insn.o
50obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o insn.o 50obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o insn.o
51obj-$(CONFIG_JUMP_LABEL) += jump_label.o insn.o patch.o 51obj-$(CONFIG_JUMP_LABEL) += jump_label.o insn.o patch.o
52obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o 52obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
53obj-$(CONFIG_KPROBES) += kprobes.o kprobes-common.o patch.o 53obj-$(CONFIG_UPROBES) += probes.o probes-arm.o uprobes.o uprobes-arm.o
54obj-$(CONFIG_KPROBES) += probes.o kprobes.o kprobes-common.o patch.o
54ifdef CONFIG_THUMB2_KERNEL 55ifdef CONFIG_THUMB2_KERNEL
55obj-$(CONFIG_KPROBES) += kprobes-thumb.o 56obj-$(CONFIG_KPROBES) += kprobes-thumb.o probes-thumb.o
56else 57else
57obj-$(CONFIG_KPROBES) += kprobes-arm.o 58obj-$(CONFIG_KPROBES) += kprobes-arm.o probes-arm.o
58endif 59endif
59obj-$(CONFIG_ARM_KPROBES_TEST) += test-kprobes.o 60obj-$(CONFIG_ARM_KPROBES_TEST) += test-kprobes.o
60test-kprobes-objs := kprobes-test.o 61test-kprobes-objs := kprobes-test.o
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
index 85e664b6a5f1..f7b450f97e68 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -158,6 +158,6 @@ EXPORT_SYMBOL(__gnu_mcount_nc);
158#endif 158#endif
159 159
160#ifdef CONFIG_ARM_PATCH_PHYS_VIRT 160#ifdef CONFIG_ARM_PATCH_PHYS_VIRT
161EXPORT_SYMBOL(__pv_phys_offset); 161EXPORT_SYMBOL(__pv_phys_pfn_offset);
162EXPORT_SYMBOL(__pv_offset); 162EXPORT_SYMBOL(__pv_offset);
163#endif 163#endif
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
index ded041711beb..85598b5d1efd 100644
--- a/arch/arm/kernel/asm-offsets.c
+++ b/arch/arm/kernel/asm-offsets.c
@@ -174,6 +174,7 @@ int main(void)
174 DEFINE(VCPU_FIQ_REGS, offsetof(struct kvm_vcpu, arch.regs.fiq_regs)); 174 DEFINE(VCPU_FIQ_REGS, offsetof(struct kvm_vcpu, arch.regs.fiq_regs));
175 DEFINE(VCPU_PC, offsetof(struct kvm_vcpu, arch.regs.usr_regs.ARM_pc)); 175 DEFINE(VCPU_PC, offsetof(struct kvm_vcpu, arch.regs.usr_regs.ARM_pc));
176 DEFINE(VCPU_CPSR, offsetof(struct kvm_vcpu, arch.regs.usr_regs.ARM_cpsr)); 176 DEFINE(VCPU_CPSR, offsetof(struct kvm_vcpu, arch.regs.usr_regs.ARM_cpsr));
177 DEFINE(VCPU_HCR, offsetof(struct kvm_vcpu, arch.hcr));
177 DEFINE(VCPU_IRQ_LINES, offsetof(struct kvm_vcpu, arch.irq_lines)); 178 DEFINE(VCPU_IRQ_LINES, offsetof(struct kvm_vcpu, arch.irq_lines));
178 DEFINE(VCPU_HSR, offsetof(struct kvm_vcpu, arch.fault.hsr)); 179 DEFINE(VCPU_HSR, offsetof(struct kvm_vcpu, arch.fault.hsr));
179 DEFINE(VCPU_HxFAR, offsetof(struct kvm_vcpu, arch.fault.hxfar)); 180 DEFINE(VCPU_HxFAR, offsetof(struct kvm_vcpu, arch.fault.hxfar));
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 317da88ae65b..16d43cd45619 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -19,7 +19,7 @@
19static int debug_pci; 19static int debug_pci;
20 20
21/* 21/*
22 * We can't use pci_find_device() here since we are 22 * We can't use pci_get_device() here since we are
23 * called from interrupt context. 23 * called from interrupt context.
24 */ 24 */
25static void pcibios_bus_report_status(struct pci_bus *bus, u_int status_mask, int warn) 25static void pcibios_bus_report_status(struct pci_bus *bus, u_int status_mask, int warn)
@@ -57,13 +57,10 @@ static void pcibios_bus_report_status(struct pci_bus *bus, u_int status_mask, in
57 57
58void pcibios_report_status(u_int status_mask, int warn) 58void pcibios_report_status(u_int status_mask, int warn)
59{ 59{
60 struct list_head *l; 60 struct pci_bus *bus;
61
62 list_for_each(l, &pci_root_buses) {
63 struct pci_bus *bus = pci_bus_b(l);
64 61
62 list_for_each_entry(bus, &pci_root_buses, node)
65 pcibios_bus_report_status(bus, status_mask, warn); 63 pcibios_bus_report_status(bus, status_mask, warn);
66 }
67} 64}
68 65
69/* 66/*
@@ -608,41 +605,10 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res,
608 */ 605 */
609int pcibios_enable_device(struct pci_dev *dev, int mask) 606int pcibios_enable_device(struct pci_dev *dev, int mask)
610{ 607{
611 u16 cmd, old_cmd; 608 if (pci_has_flag(PCI_PROBE_ONLY))
612 int idx; 609 return 0;
613 struct resource *r;
614
615 pci_read_config_word(dev, PCI_COMMAND, &cmd);
616 old_cmd = cmd;
617 for (idx = 0; idx < 6; idx++) {
618 /* Only set up the requested stuff */
619 if (!(mask & (1 << idx)))
620 continue;
621
622 r = dev->resource + idx;
623 if (!r->start && r->end) {
624 printk(KERN_ERR "PCI: Device %s not available because"
625 " of resource collisions\n", pci_name(dev));
626 return -EINVAL;
627 }
628 if (r->flags & IORESOURCE_IO)
629 cmd |= PCI_COMMAND_IO;
630 if (r->flags & IORESOURCE_MEM)
631 cmd |= PCI_COMMAND_MEMORY;
632 }
633
634 /*
635 * Bridges (eg, cardbus bridges) need to be fully enabled
636 */
637 if ((dev->class >> 16) == PCI_BASE_CLASS_BRIDGE)
638 cmd |= PCI_COMMAND_IO | PCI_COMMAND_MEMORY;
639 610
640 if (cmd != old_cmd) { 611 return pci_enable_resources(dev, mask);
641 printk("PCI: enabling device %s (%04x -> %04x)\n",
642 pci_name(dev), old_cmd, cmd);
643 pci_write_config_word(dev, PCI_COMMAND, cmd);
644 }
645 return 0;
646} 612}
647 613
648int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, 614int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
diff --git a/arch/arm/kernel/crash_dump.c b/arch/arm/kernel/crash_dump.c
index 90c50d4b43f7..5d1286d51154 100644
--- a/arch/arm/kernel/crash_dump.c
+++ b/arch/arm/kernel/crash_dump.c
@@ -39,7 +39,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
39 if (!csize) 39 if (!csize)
40 return 0; 40 return 0;
41 41
42 vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE); 42 vaddr = ioremap(__pfn_to_phys(pfn), PAGE_SIZE);
43 if (!vaddr) 43 if (!vaddr)
44 return -ENOMEM; 44 return -ENOMEM;
45 45
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
index f751714d52c1..c7419a585ddc 100644
--- a/arch/arm/kernel/devtree.c
+++ b/arch/arm/kernel/devtree.c
@@ -18,6 +18,7 @@
18#include <linux/of_fdt.h> 18#include <linux/of_fdt.h>
19#include <linux/of_irq.h> 19#include <linux/of_irq.h>
20#include <linux/of_platform.h> 20#include <linux/of_platform.h>
21#include <linux/smp.h>
21 22
22#include <asm/cputype.h> 23#include <asm/cputype.h>
23#include <asm/setup.h> 24#include <asm/setup.h>
@@ -63,6 +64,34 @@ void __init arm_dt_memblock_reserve(void)
63 } 64 }
64} 65}
65 66
67#ifdef CONFIG_SMP
68extern struct of_cpu_method __cpu_method_of_table_begin[];
69extern struct of_cpu_method __cpu_method_of_table_end[];
70
71static int __init set_smp_ops_by_method(struct device_node *node)
72{
73 const char *method;
74 struct of_cpu_method *m = __cpu_method_of_table_begin;
75
76 if (of_property_read_string(node, "enable-method", &method))
77 return 0;
78
79 for (; m < __cpu_method_of_table_end; m++)
80 if (!strcmp(m->method, method)) {
81 smp_set_ops(m->ops);
82 return 1;
83 }
84
85 return 0;
86}
87#else
88static inline int set_smp_ops_by_method(struct device_node *node)
89{
90 return 1;
91}
92#endif
93
94
66/* 95/*
67 * arm_dt_init_cpu_maps - Function retrieves cpu nodes from the device tree 96 * arm_dt_init_cpu_maps - Function retrieves cpu nodes from the device tree
68 * and builds the cpu logical map array containing MPIDR values related to 97 * and builds the cpu logical map array containing MPIDR values related to
@@ -79,6 +108,7 @@ void __init arm_dt_init_cpu_maps(void)
79 * read as 0. 108 * read as 0.
80 */ 109 */
81 struct device_node *cpu, *cpus; 110 struct device_node *cpu, *cpus;
111 int found_method = 0;
82 u32 i, j, cpuidx = 1; 112 u32 i, j, cpuidx = 1;
83 u32 mpidr = is_smp() ? read_cpuid_mpidr() & MPIDR_HWID_BITMASK : 0; 113 u32 mpidr = is_smp() ? read_cpuid_mpidr() & MPIDR_HWID_BITMASK : 0;
84 114
@@ -150,8 +180,18 @@ void __init arm_dt_init_cpu_maps(void)
150 } 180 }
151 181
152 tmp_map[i] = hwid; 182 tmp_map[i] = hwid;
183
184 if (!found_method)
185 found_method = set_smp_ops_by_method(cpu);
153 } 186 }
154 187
188 /*
189 * Fallback to an enable-method in the cpus node if nothing found in
190 * a cpu node.
191 */
192 if (!found_method)
193 set_smp_ops_by_method(cpus);
194
155 if (!bootcpu_valid) { 195 if (!bootcpu_valid) {
156 pr_warn("DT missing boot CPU MPIDR[23:0], fall back to default cpu_logical_map\n"); 196 pr_warn("DT missing boot CPU MPIDR[23:0], fall back to default cpu_logical_map\n");
157 return; 197 return;
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
index 39f89fbd5111..1420725142ca 100644
--- a/arch/arm/kernel/entry-header.S
+++ b/arch/arm/kernel/entry-header.S
@@ -236,11 +236,6 @@
236 movs pc, lr @ return & move spsr_svc into cpsr 236 movs pc, lr @ return & move spsr_svc into cpsr
237 .endm 237 .endm
238 238
239 .macro get_thread_info, rd
240 mov \rd, sp, lsr #13
241 mov \rd, \rd, lsl #13
242 .endm
243
244 @ 239 @
245 @ 32-bit wide "mov pc, reg" 240 @ 32-bit wide "mov pc, reg"
246 @ 241 @
@@ -306,12 +301,6 @@
306 .endm 301 .endm
307#endif /* ifdef CONFIG_CPU_V7M / else */ 302#endif /* ifdef CONFIG_CPU_V7M / else */
308 303
309 .macro get_thread_info, rd
310 mov \rd, sp
311 lsr \rd, \rd, #13
312 mov \rd, \rd, lsl #13
313 .endm
314
315 @ 304 @
316 @ 32-bit wide "mov pc, reg" 305 @ 32-bit wide "mov pc, reg"
317 @ 306 @
diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c
index 34e56647dcee..c108ddcb9ba4 100644
--- a/arch/arm/kernel/ftrace.c
+++ b/arch/arm/kernel/ftrace.c
@@ -156,10 +156,8 @@ int ftrace_make_nop(struct module *mod,
156 return ret; 156 return ret;
157} 157}
158 158
159int __init ftrace_dyn_arch_init(void *data) 159int __init ftrace_dyn_arch_init(void)
160{ 160{
161 *(unsigned long *)data = 0;
162
163 return 0; 161 return 0;
164} 162}
165#endif /* CONFIG_DYNAMIC_FTRACE */ 163#endif /* CONFIG_DYNAMIC_FTRACE */
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index f5f381d91556..f8c08839edf3 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -584,9 +584,10 @@ __fixup_pv_table:
584 subs r3, r0, r3 @ PHYS_OFFSET - PAGE_OFFSET 584 subs r3, r0, r3 @ PHYS_OFFSET - PAGE_OFFSET
585 add r4, r4, r3 @ adjust table start address 585 add r4, r4, r3 @ adjust table start address
586 add r5, r5, r3 @ adjust table end address 586 add r5, r5, r3 @ adjust table end address
587 add r6, r6, r3 @ adjust __pv_phys_offset address 587 add r6, r6, r3 @ adjust __pv_phys_pfn_offset address
588 add r7, r7, r3 @ adjust __pv_offset address 588 add r7, r7, r3 @ adjust __pv_offset address
589 str r8, [r6, #LOW_OFFSET] @ save computed PHYS_OFFSET to __pv_phys_offset 589 mov r0, r8, lsr #12 @ convert to PFN
590 str r0, [r6, #LOW_OFFSET] @ save computed PHYS_OFFSET to __pv_phys_pfn_offset
590 strcc ip, [r7, #HIGH_OFFSET] @ save to __pv_offset high bits 591 strcc ip, [r7, #HIGH_OFFSET] @ save to __pv_offset high bits
591 mov r6, r3, lsr #24 @ constant for add/sub instructions 592 mov r6, r3, lsr #24 @ constant for add/sub instructions
592 teq r3, r6, lsl #24 @ must be 16MiB aligned 593 teq r3, r6, lsl #24 @ must be 16MiB aligned
@@ -600,7 +601,7 @@ ENDPROC(__fixup_pv_table)
6001: .long . 6011: .long .
601 .long __pv_table_begin 602 .long __pv_table_begin
602 .long __pv_table_end 603 .long __pv_table_end
6032: .long __pv_phys_offset 6042: .long __pv_phys_pfn_offset
604 .long __pv_offset 605 .long __pv_offset
605 606
606 .text 607 .text
@@ -688,11 +689,11 @@ ENTRY(fixup_pv_table)
688ENDPROC(fixup_pv_table) 689ENDPROC(fixup_pv_table)
689 690
690 .data 691 .data
691 .globl __pv_phys_offset 692 .globl __pv_phys_pfn_offset
692 .type __pv_phys_offset, %object 693 .type __pv_phys_pfn_offset, %object
693__pv_phys_offset: 694__pv_phys_pfn_offset:
694 .quad 0 695 .word 0
695 .size __pv_phys_offset, . -__pv_phys_offset 696 .size __pv_phys_pfn_offset, . -__pv_phys_pfn_offset
696 697
697 .globl __pv_offset 698 .globl __pv_offset
698 .type __pv_offset, %object 699 .type __pv_offset, %object
diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c
index 3d446605cbf8..4d963fb66e3f 100644
--- a/arch/arm/kernel/hw_breakpoint.c
+++ b/arch/arm/kernel/hw_breakpoint.c
@@ -167,7 +167,7 @@ static int debug_arch_supported(void)
167/* Can we determine the watchpoint access type from the fsr? */ 167/* Can we determine the watchpoint access type from the fsr? */
168static int debug_exception_updates_fsr(void) 168static int debug_exception_updates_fsr(void)
169{ 169{
170 return 0; 170 return get_debug_arch() >= ARM_DEBUG_ARCH_V8;
171} 171}
172 172
173/* Determine number of WRP registers available. */ 173/* Determine number of WRP registers available. */
@@ -257,6 +257,7 @@ static int enable_monitor_mode(void)
257 break; 257 break;
258 case ARM_DEBUG_ARCH_V7_ECP14: 258 case ARM_DEBUG_ARCH_V7_ECP14:
259 case ARM_DEBUG_ARCH_V7_1: 259 case ARM_DEBUG_ARCH_V7_1:
260 case ARM_DEBUG_ARCH_V8:
260 ARM_DBG_WRITE(c0, c2, 2, (dscr | ARM_DSCR_MDBGEN)); 261 ARM_DBG_WRITE(c0, c2, 2, (dscr | ARM_DSCR_MDBGEN));
261 isb(); 262 isb();
262 break; 263 break;
@@ -1072,6 +1073,8 @@ static int __init arch_hw_breakpoint_init(void)
1072 core_num_brps = get_num_brps(); 1073 core_num_brps = get_num_brps();
1073 core_num_wrps = get_num_wrps(); 1074 core_num_wrps = get_num_wrps();
1074 1075
1076 cpu_notifier_register_begin();
1077
1075 /* 1078 /*
1076 * We need to tread carefully here because DBGSWENABLE may be 1079 * We need to tread carefully here because DBGSWENABLE may be
1077 * driven low on this core and there isn't an architected way to 1080 * driven low on this core and there isn't an architected way to
@@ -1088,6 +1091,7 @@ static int __init arch_hw_breakpoint_init(void)
1088 if (!cpumask_empty(&debug_err_mask)) { 1091 if (!cpumask_empty(&debug_err_mask)) {
1089 core_num_brps = 0; 1092 core_num_brps = 0;
1090 core_num_wrps = 0; 1093 core_num_wrps = 0;
1094 cpu_notifier_register_done();
1091 return 0; 1095 return 0;
1092 } 1096 }
1093 1097
@@ -1107,7 +1111,10 @@ static int __init arch_hw_breakpoint_init(void)
1107 TRAP_HWBKPT, "breakpoint debug exception"); 1111 TRAP_HWBKPT, "breakpoint debug exception");
1108 1112
1109 /* Register hotplug and PM notifiers. */ 1113 /* Register hotplug and PM notifiers. */
1110 register_cpu_notifier(&dbg_reset_nb); 1114 __register_cpu_notifier(&dbg_reset_nb);
1115
1116 cpu_notifier_register_done();
1117
1111 pm_init(); 1118 pm_init();
1112 return 0; 1119 return 0;
1113} 1120}
diff --git a/arch/arm/kernel/kprobes-arm.c b/arch/arm/kernel/kprobes-arm.c
index 8a30c89da70e..ac300c60d656 100644
--- a/arch/arm/kernel/kprobes-arm.c
+++ b/arch/arm/kernel/kprobes-arm.c
@@ -60,13 +60,10 @@
60 60
61#include <linux/kernel.h> 61#include <linux/kernel.h>
62#include <linux/kprobes.h> 62#include <linux/kprobes.h>
63#include <linux/module.h> 63#include <linux/ptrace.h>
64 64
65#include "kprobes.h" 65#include "kprobes.h"
66 66#include "probes-arm.h"
67#define sign_extend(x, signbit) ((x) | (0 - ((x) & (1 << (signbit)))))
68
69#define branch_displacement(insn) sign_extend(((insn) & 0xffffff) << 2, 25)
70 67
71#if __LINUX_ARM_ARCH__ >= 6 68#if __LINUX_ARM_ARCH__ >= 6
72#define BLX(reg) "blx "reg" \n\t" 69#define BLX(reg) "blx "reg" \n\t"
@@ -75,92 +72,11 @@
75 "mov pc, "reg" \n\t" 72 "mov pc, "reg" \n\t"
76#endif 73#endif
77 74
78/*
79 * To avoid the complications of mimicing single-stepping on a
80 * processor without a Next-PC or a single-step mode, and to
81 * avoid having to deal with the side-effects of boosting, we
82 * simulate or emulate (almost) all ARM instructions.
83 *
84 * "Simulation" is where the instruction's behavior is duplicated in
85 * C code. "Emulation" is where the original instruction is rewritten
86 * and executed, often by altering its registers.
87 *
88 * By having all behavior of the kprobe'd instruction completed before
89 * returning from the kprobe_handler(), all locks (scheduler and
90 * interrupt) can safely be released. There is no need for secondary
91 * breakpoints, no race with MP or preemptable kernels, nor having to
92 * clean up resources counts at a later time impacting overall system
93 * performance. By rewriting the instruction, only the minimum registers
94 * need to be loaded and saved back optimizing performance.
95 *
96 * Calling the insnslot_*_rwflags version of a function doesn't hurt
97 * anything even when the CPSR flags aren't updated by the
98 * instruction. It's just a little slower in return for saving
99 * a little space by not having a duplicate function that doesn't
100 * update the flags. (The same optimization can be said for
101 * instructions that do or don't perform register writeback)
102 * Also, instructions can either read the flags, only write the
103 * flags, or read and write the flags. To save combinations
104 * rather than for sheer performance, flag functions just assume
105 * read and write of flags.
106 */
107
108static void __kprobes simulate_bbl(struct kprobe *p, struct pt_regs *regs)
109{
110 kprobe_opcode_t insn = p->opcode;
111 long iaddr = (long)p->addr;
112 int disp = branch_displacement(insn);
113
114 if (insn & (1 << 24))
115 regs->ARM_lr = iaddr + 4;
116
117 regs->ARM_pc = iaddr + 8 + disp;
118}
119
120static void __kprobes simulate_blx1(struct kprobe *p, struct pt_regs *regs)
121{
122 kprobe_opcode_t insn = p->opcode;
123 long iaddr = (long)p->addr;
124 int disp = branch_displacement(insn);
125
126 regs->ARM_lr = iaddr + 4;
127 regs->ARM_pc = iaddr + 8 + disp + ((insn >> 23) & 0x2);
128 regs->ARM_cpsr |= PSR_T_BIT;
129}
130
131static void __kprobes simulate_blx2bx(struct kprobe *p, struct pt_regs *regs)
132{
133 kprobe_opcode_t insn = p->opcode;
134 int rm = insn & 0xf;
135 long rmv = regs->uregs[rm];
136
137 if (insn & (1 << 5))
138 regs->ARM_lr = (long)p->addr + 4;
139
140 regs->ARM_pc = rmv & ~0x1;
141 regs->ARM_cpsr &= ~PSR_T_BIT;
142 if (rmv & 0x1)
143 regs->ARM_cpsr |= PSR_T_BIT;
144}
145
146static void __kprobes simulate_mrs(struct kprobe *p, struct pt_regs *regs)
147{
148 kprobe_opcode_t insn = p->opcode;
149 int rd = (insn >> 12) & 0xf;
150 unsigned long mask = 0xf8ff03df; /* Mask out execution state */
151 regs->uregs[rd] = regs->ARM_cpsr & mask;
152}
153
154static void __kprobes simulate_mov_ipsp(struct kprobe *p, struct pt_regs *regs)
155{
156 regs->uregs[12] = regs->uregs[13];
157}
158
159static void __kprobes 75static void __kprobes
160emulate_ldrdstrd(struct kprobe *p, struct pt_regs *regs) 76emulate_ldrdstrd(probes_opcode_t insn,
77 struct arch_probes_insn *asi, struct pt_regs *regs)
161{ 78{
162 kprobe_opcode_t insn = p->opcode; 79 unsigned long pc = regs->ARM_pc + 4;
163 unsigned long pc = (unsigned long)p->addr + 8;
164 int rt = (insn >> 12) & 0xf; 80 int rt = (insn >> 12) & 0xf;
165 int rn = (insn >> 16) & 0xf; 81 int rn = (insn >> 16) & 0xf;
166 int rm = insn & 0xf; 82 int rm = insn & 0xf;
@@ -175,7 +91,7 @@ emulate_ldrdstrd(struct kprobe *p, struct pt_regs *regs)
175 BLX("%[fn]") 91 BLX("%[fn]")
176 : "=r" (rtv), "=r" (rt2v), "=r" (rnv) 92 : "=r" (rtv), "=r" (rt2v), "=r" (rnv)
177 : "0" (rtv), "1" (rt2v), "2" (rnv), "r" (rmv), 93 : "0" (rtv), "1" (rt2v), "2" (rnv), "r" (rmv),
178 [fn] "r" (p->ainsn.insn_fn) 94 [fn] "r" (asi->insn_fn)
179 : "lr", "memory", "cc" 95 : "lr", "memory", "cc"
180 ); 96 );
181 97
@@ -186,10 +102,10 @@ emulate_ldrdstrd(struct kprobe *p, struct pt_regs *regs)
186} 102}
187 103
188static void __kprobes 104static void __kprobes
189emulate_ldr(struct kprobe *p, struct pt_regs *regs) 105emulate_ldr(probes_opcode_t insn,
106 struct arch_probes_insn *asi, struct pt_regs *regs)
190{ 107{
191 kprobe_opcode_t insn = p->opcode; 108 unsigned long pc = regs->ARM_pc + 4;
192 unsigned long pc = (unsigned long)p->addr + 8;
193 int rt = (insn >> 12) & 0xf; 109 int rt = (insn >> 12) & 0xf;
194 int rn = (insn >> 16) & 0xf; 110 int rn = (insn >> 16) & 0xf;
195 int rm = insn & 0xf; 111 int rm = insn & 0xf;
@@ -202,7 +118,7 @@ emulate_ldr(struct kprobe *p, struct pt_regs *regs)
202 __asm__ __volatile__ ( 118 __asm__ __volatile__ (
203 BLX("%[fn]") 119 BLX("%[fn]")
204 : "=r" (rtv), "=r" (rnv) 120 : "=r" (rtv), "=r" (rnv)
205 : "1" (rnv), "r" (rmv), [fn] "r" (p->ainsn.insn_fn) 121 : "1" (rnv), "r" (rmv), [fn] "r" (asi->insn_fn)
206 : "lr", "memory", "cc" 122 : "lr", "memory", "cc"
207 ); 123 );
208 124
@@ -216,11 +132,11 @@ emulate_ldr(struct kprobe *p, struct pt_regs *regs)
216} 132}
217 133
218static void __kprobes 134static void __kprobes
219emulate_str(struct kprobe *p, struct pt_regs *regs) 135emulate_str(probes_opcode_t insn,
136 struct arch_probes_insn *asi, struct pt_regs *regs)
220{ 137{
221 kprobe_opcode_t insn = p->opcode; 138 unsigned long rtpc = regs->ARM_pc - 4 + str_pc_offset;
222 unsigned long rtpc = (unsigned long)p->addr + str_pc_offset; 139 unsigned long rnpc = regs->ARM_pc + 4;
223 unsigned long rnpc = (unsigned long)p->addr + 8;
224 int rt = (insn >> 12) & 0xf; 140 int rt = (insn >> 12) & 0xf;
225 int rn = (insn >> 16) & 0xf; 141 int rn = (insn >> 16) & 0xf;
226 int rm = insn & 0xf; 142 int rm = insn & 0xf;
@@ -234,7 +150,7 @@ emulate_str(struct kprobe *p, struct pt_regs *regs)
234 __asm__ __volatile__ ( 150 __asm__ __volatile__ (
235 BLX("%[fn]") 151 BLX("%[fn]")
236 : "=r" (rnv) 152 : "=r" (rnv)
237 : "r" (rtv), "0" (rnv), "r" (rmv), [fn] "r" (p->ainsn.insn_fn) 153 : "r" (rtv), "0" (rnv), "r" (rmv), [fn] "r" (asi->insn_fn)
238 : "lr", "memory", "cc" 154 : "lr", "memory", "cc"
239 ); 155 );
240 156
@@ -243,10 +159,10 @@ emulate_str(struct kprobe *p, struct pt_regs *regs)
243} 159}
244 160
245static void __kprobes 161static void __kprobes
246emulate_rd12rn16rm0rs8_rwflags(struct kprobe *p, struct pt_regs *regs) 162emulate_rd12rn16rm0rs8_rwflags(probes_opcode_t insn,
163 struct arch_probes_insn *asi, struct pt_regs *regs)
247{ 164{
248 kprobe_opcode_t insn = p->opcode; 165 unsigned long pc = regs->ARM_pc + 4;
249 unsigned long pc = (unsigned long)p->addr + 8;
250 int rd = (insn >> 12) & 0xf; 166 int rd = (insn >> 12) & 0xf;
251 int rn = (insn >> 16) & 0xf; 167 int rn = (insn >> 16) & 0xf;
252 int rm = insn & 0xf; 168 int rm = insn & 0xf;
@@ -266,7 +182,7 @@ emulate_rd12rn16rm0rs8_rwflags(struct kprobe *p, struct pt_regs *regs)
266 "mrs %[cpsr], cpsr \n\t" 182 "mrs %[cpsr], cpsr \n\t"
267 : "=r" (rdv), [cpsr] "=r" (cpsr) 183 : "=r" (rdv), [cpsr] "=r" (cpsr)
268 : "0" (rdv), "r" (rnv), "r" (rmv), "r" (rsv), 184 : "0" (rdv), "r" (rnv), "r" (rmv), "r" (rsv),
269 "1" (cpsr), [fn] "r" (p->ainsn.insn_fn) 185 "1" (cpsr), [fn] "r" (asi->insn_fn)
270 : "lr", "memory", "cc" 186 : "lr", "memory", "cc"
271 ); 187 );
272 188
@@ -278,9 +194,9 @@ emulate_rd12rn16rm0rs8_rwflags(struct kprobe *p, struct pt_regs *regs)
278} 194}
279 195
280static void __kprobes 196static void __kprobes
281emulate_rd12rn16rm0_rwflags_nopc(struct kprobe *p, struct pt_regs *regs) 197emulate_rd12rn16rm0_rwflags_nopc(probes_opcode_t insn,
198 struct arch_probes_insn *asi, struct pt_regs *regs)
282{ 199{
283 kprobe_opcode_t insn = p->opcode;
284 int rd = (insn >> 12) & 0xf; 200 int rd = (insn >> 12) & 0xf;
285 int rn = (insn >> 16) & 0xf; 201 int rn = (insn >> 16) & 0xf;
286 int rm = insn & 0xf; 202 int rm = insn & 0xf;
@@ -296,7 +212,7 @@ emulate_rd12rn16rm0_rwflags_nopc(struct kprobe *p, struct pt_regs *regs)
296 "mrs %[cpsr], cpsr \n\t" 212 "mrs %[cpsr], cpsr \n\t"
297 : "=r" (rdv), [cpsr] "=r" (cpsr) 213 : "=r" (rdv), [cpsr] "=r" (cpsr)
298 : "0" (rdv), "r" (rnv), "r" (rmv), 214 : "0" (rdv), "r" (rnv), "r" (rmv),
299 "1" (cpsr), [fn] "r" (p->ainsn.insn_fn) 215 "1" (cpsr), [fn] "r" (asi->insn_fn)
300 : "lr", "memory", "cc" 216 : "lr", "memory", "cc"
301 ); 217 );
302 218
@@ -305,9 +221,10 @@ emulate_rd12rn16rm0_rwflags_nopc(struct kprobe *p, struct pt_regs *regs)
305} 221}
306 222
307static void __kprobes 223static void __kprobes
308emulate_rd16rn12rm0rs8_rwflags_nopc(struct kprobe *p, struct pt_regs *regs) 224emulate_rd16rn12rm0rs8_rwflags_nopc(probes_opcode_t insn,
225 struct arch_probes_insn *asi,
226 struct pt_regs *regs)
309{ 227{
310 kprobe_opcode_t insn = p->opcode;
311 int rd = (insn >> 16) & 0xf; 228 int rd = (insn >> 16) & 0xf;
312 int rn = (insn >> 12) & 0xf; 229 int rn = (insn >> 12) & 0xf;
313 int rm = insn & 0xf; 230 int rm = insn & 0xf;
@@ -325,7 +242,7 @@ emulate_rd16rn12rm0rs8_rwflags_nopc(struct kprobe *p, struct pt_regs *regs)
325 "mrs %[cpsr], cpsr \n\t" 242 "mrs %[cpsr], cpsr \n\t"
326 : "=r" (rdv), [cpsr] "=r" (cpsr) 243 : "=r" (rdv), [cpsr] "=r" (cpsr)
327 : "0" (rdv), "r" (rnv), "r" (rmv), "r" (rsv), 244 : "0" (rdv), "r" (rnv), "r" (rmv), "r" (rsv),
328 "1" (cpsr), [fn] "r" (p->ainsn.insn_fn) 245 "1" (cpsr), [fn] "r" (asi->insn_fn)
329 : "lr", "memory", "cc" 246 : "lr", "memory", "cc"
330 ); 247 );
331 248
@@ -334,9 +251,9 @@ emulate_rd16rn12rm0rs8_rwflags_nopc(struct kprobe *p, struct pt_regs *regs)
334} 251}
335 252
336static void __kprobes 253static void __kprobes
337emulate_rd12rm0_noflags_nopc(struct kprobe *p, struct pt_regs *regs) 254emulate_rd12rm0_noflags_nopc(probes_opcode_t insn,
255 struct arch_probes_insn *asi, struct pt_regs *regs)
338{ 256{
339 kprobe_opcode_t insn = p->opcode;
340 int rd = (insn >> 12) & 0xf; 257 int rd = (insn >> 12) & 0xf;
341 int rm = insn & 0xf; 258 int rm = insn & 0xf;
342 259
@@ -346,7 +263,7 @@ emulate_rd12rm0_noflags_nopc(struct kprobe *p, struct pt_regs *regs)
346 __asm__ __volatile__ ( 263 __asm__ __volatile__ (
347 BLX("%[fn]") 264 BLX("%[fn]")
348 : "=r" (rdv) 265 : "=r" (rdv)
349 : "0" (rdv), "r" (rmv), [fn] "r" (p->ainsn.insn_fn) 266 : "0" (rdv), "r" (rmv), [fn] "r" (asi->insn_fn)
350 : "lr", "memory", "cc" 267 : "lr", "memory", "cc"
351 ); 268 );
352 269
@@ -354,9 +271,10 @@ emulate_rd12rm0_noflags_nopc(struct kprobe *p, struct pt_regs *regs)
354} 271}
355 272
356static void __kprobes 273static void __kprobes
357emulate_rdlo12rdhi16rn0rm8_rwflags_nopc(struct kprobe *p, struct pt_regs *regs) 274emulate_rdlo12rdhi16rn0rm8_rwflags_nopc(probes_opcode_t insn,
275 struct arch_probes_insn *asi,
276 struct pt_regs *regs)
358{ 277{
359 kprobe_opcode_t insn = p->opcode;
360 int rdlo = (insn >> 12) & 0xf; 278 int rdlo = (insn >> 12) & 0xf;
361 int rdhi = (insn >> 16) & 0xf; 279 int rdhi = (insn >> 16) & 0xf;
362 int rn = insn & 0xf; 280 int rn = insn & 0xf;
@@ -374,7 +292,7 @@ emulate_rdlo12rdhi16rn0rm8_rwflags_nopc(struct kprobe *p, struct pt_regs *regs)
374 "mrs %[cpsr], cpsr \n\t" 292 "mrs %[cpsr], cpsr \n\t"
375 : "=r" (rdlov), "=r" (rdhiv), [cpsr] "=r" (cpsr) 293 : "=r" (rdlov), "=r" (rdhiv), [cpsr] "=r" (cpsr)
376 : "0" (rdlov), "1" (rdhiv), "r" (rnv), "r" (rmv), 294 : "0" (rdlov), "1" (rdhiv), "r" (rnv), "r" (rmv),
377 "2" (cpsr), [fn] "r" (p->ainsn.insn_fn) 295 "2" (cpsr), [fn] "r" (asi->insn_fn)
378 : "lr", "memory", "cc" 296 : "lr", "memory", "cc"
379 ); 297 );
380 298
@@ -383,623 +301,43 @@ emulate_rdlo12rdhi16rn0rm8_rwflags_nopc(struct kprobe *p, struct pt_regs *regs)
383 regs->ARM_cpsr = (regs->ARM_cpsr & ~APSR_MASK) | (cpsr & APSR_MASK); 301 regs->ARM_cpsr = (regs->ARM_cpsr & ~APSR_MASK) | (cpsr & APSR_MASK);
384} 302}
385 303
386/* 304const union decode_action kprobes_arm_actions[NUM_PROBES_ARM_ACTIONS] = {
387 * For the instruction masking and comparisons in all the "space_*" 305 [PROBES_EMULATE_NONE] = {.handler = probes_emulate_none},
388 * functions below, Do _not_ rearrange the order of tests unless 306 [PROBES_SIMULATE_NOP] = {.handler = probes_simulate_nop},
389 * you're very, very sure of what you are doing. For the sake of 307 [PROBES_PRELOAD_IMM] = {.handler = probes_simulate_nop},
390 * efficiency, the masks for some tests sometimes assume other test 308 [PROBES_PRELOAD_REG] = {.handler = probes_simulate_nop},
391 * have been done prior to them so the number of patterns to test 309 [PROBES_BRANCH_IMM] = {.handler = simulate_blx1},
392 * for an instruction set can be as broad as possible to reduce the 310 [PROBES_MRS] = {.handler = simulate_mrs},
393 * number of tests needed. 311 [PROBES_BRANCH_REG] = {.handler = simulate_blx2bx},
394 */ 312 [PROBES_CLZ] = {.handler = emulate_rd12rm0_noflags_nopc},
395 313 [PROBES_SATURATING_ARITHMETIC] = {
396static const union decode_item arm_1111_table[] = { 314 .handler = emulate_rd12rn16rm0_rwflags_nopc},
397 /* Unconditional instructions */ 315 [PROBES_MUL1] = {.handler = emulate_rdlo12rdhi16rn0rm8_rwflags_nopc},
398 316 [PROBES_MUL2] = {.handler = emulate_rd16rn12rm0rs8_rwflags_nopc},
399 /* memory hint 1111 0100 x001 xxxx xxxx xxxx xxxx xxxx */ 317 [PROBES_SWP] = {.handler = emulate_rd12rn16rm0_rwflags_nopc},
400 /* PLDI (immediate) 1111 0100 x101 xxxx xxxx xxxx xxxx xxxx */ 318 [PROBES_LDRSTRD] = {.handler = emulate_ldrdstrd},
401 /* PLDW (immediate) 1111 0101 x001 xxxx xxxx xxxx xxxx xxxx */ 319 [PROBES_LOAD_EXTRA] = {.handler = emulate_ldr},
402 /* PLD (immediate) 1111 0101 x101 xxxx xxxx xxxx xxxx xxxx */ 320 [PROBES_LOAD] = {.handler = emulate_ldr},
403 DECODE_SIMULATE (0xfe300000, 0xf4100000, kprobe_simulate_nop), 321 [PROBES_STORE_EXTRA] = {.handler = emulate_str},
404 322 [PROBES_STORE] = {.handler = emulate_str},
405 /* memory hint 1111 0110 x001 xxxx xxxx xxxx xxx0 xxxx */ 323 [PROBES_MOV_IP_SP] = {.handler = simulate_mov_ipsp},
406 /* PLDI (register) 1111 0110 x101 xxxx xxxx xxxx xxx0 xxxx */ 324 [PROBES_DATA_PROCESSING_REG] = {
407 /* PLDW (register) 1111 0111 x001 xxxx xxxx xxxx xxx0 xxxx */ 325 .handler = emulate_rd12rn16rm0rs8_rwflags},
408 /* PLD (register) 1111 0111 x101 xxxx xxxx xxxx xxx0 xxxx */ 326 [PROBES_DATA_PROCESSING_IMM] = {
409 DECODE_SIMULATE (0xfe300010, 0xf6100000, kprobe_simulate_nop), 327 .handler = emulate_rd12rn16rm0rs8_rwflags},
410 328 [PROBES_MOV_HALFWORD] = {.handler = emulate_rd12rm0_noflags_nopc},
411 /* BLX (immediate) 1111 101x xxxx xxxx xxxx xxxx xxxx xxxx */ 329 [PROBES_SEV] = {.handler = probes_emulate_none},
412 DECODE_SIMULATE (0xfe000000, 0xfa000000, simulate_blx1), 330 [PROBES_WFE] = {.handler = probes_simulate_nop},
413 331 [PROBES_SATURATE] = {.handler = emulate_rd12rn16rm0_rwflags_nopc},
414 /* CPS 1111 0001 0000 xxx0 xxxx xxxx xx0x xxxx */ 332 [PROBES_REV] = {.handler = emulate_rd12rm0_noflags_nopc},
415 /* SETEND 1111 0001 0000 0001 xxxx xxxx 0000 xxxx */ 333 [PROBES_MMI] = {.handler = emulate_rd12rn16rm0_rwflags_nopc},
416 /* SRS 1111 100x x1x0 xxxx xxxx xxxx xxxx xxxx */ 334 [PROBES_PACK] = {.handler = emulate_rd12rn16rm0_rwflags_nopc},
417 /* RFE 1111 100x x0x1 xxxx xxxx xxxx xxxx xxxx */ 335 [PROBES_EXTEND] = {.handler = emulate_rd12rm0_noflags_nopc},
418 336 [PROBES_EXTEND_ADD] = {.handler = emulate_rd12rn16rm0_rwflags_nopc},
419 /* Coprocessor instructions... */ 337 [PROBES_MUL_ADD_LONG] = {
420 /* MCRR2 1111 1100 0100 xxxx xxxx xxxx xxxx xxxx */ 338 .handler = emulate_rdlo12rdhi16rn0rm8_rwflags_nopc},
421 /* MRRC2 1111 1100 0101 xxxx xxxx xxxx xxxx xxxx */ 339 [PROBES_MUL_ADD] = {.handler = emulate_rd16rn12rm0rs8_rwflags_nopc},
422 /* LDC2 1111 110x xxx1 xxxx xxxx xxxx xxxx xxxx */ 340 [PROBES_BITFIELD] = {.handler = emulate_rd12rm0_noflags_nopc},
423 /* STC2 1111 110x xxx0 xxxx xxxx xxxx xxxx xxxx */ 341 [PROBES_BRANCH] = {.handler = simulate_bbl},
424 /* CDP2 1111 1110 xxxx xxxx xxxx xxxx xxx0 xxxx */ 342 [PROBES_LDMSTM] = {.decoder = kprobe_decode_ldmstm}
425 /* MCR2 1111 1110 xxx0 xxxx xxxx xxxx xxx1 xxxx */
426 /* MRC2 1111 1110 xxx1 xxxx xxxx xxxx xxx1 xxxx */
427
428 /* Other unallocated instructions... */
429 DECODE_END
430};
431
432static const union decode_item arm_cccc_0001_0xx0____0xxx_table[] = {
433 /* Miscellaneous instructions */
434
435 /* MRS cpsr cccc 0001 0000 xxxx xxxx xxxx 0000 xxxx */
436 DECODE_SIMULATEX(0x0ff000f0, 0x01000000, simulate_mrs,
437 REGS(0, NOPC, 0, 0, 0)),
438
439 /* BX cccc 0001 0010 xxxx xxxx xxxx 0001 xxxx */
440 DECODE_SIMULATE (0x0ff000f0, 0x01200010, simulate_blx2bx),
441
442 /* BLX (register) cccc 0001 0010 xxxx xxxx xxxx 0011 xxxx */
443 DECODE_SIMULATEX(0x0ff000f0, 0x01200030, simulate_blx2bx,
444 REGS(0, 0, 0, 0, NOPC)),
445
446 /* CLZ cccc 0001 0110 xxxx xxxx xxxx 0001 xxxx */
447 DECODE_EMULATEX (0x0ff000f0, 0x01600010, emulate_rd12rm0_noflags_nopc,
448 REGS(0, NOPC, 0, 0, NOPC)),
449
450 /* QADD cccc 0001 0000 xxxx xxxx xxxx 0101 xxxx */
451 /* QSUB cccc 0001 0010 xxxx xxxx xxxx 0101 xxxx */
452 /* QDADD cccc 0001 0100 xxxx xxxx xxxx 0101 xxxx */
453 /* QDSUB cccc 0001 0110 xxxx xxxx xxxx 0101 xxxx */
454 DECODE_EMULATEX (0x0f9000f0, 0x01000050, emulate_rd12rn16rm0_rwflags_nopc,
455 REGS(NOPC, NOPC, 0, 0, NOPC)),
456
457 /* BXJ cccc 0001 0010 xxxx xxxx xxxx 0010 xxxx */
458 /* MSR cccc 0001 0x10 xxxx xxxx xxxx 0000 xxxx */
459 /* MRS spsr cccc 0001 0100 xxxx xxxx xxxx 0000 xxxx */
460 /* BKPT 1110 0001 0010 xxxx xxxx xxxx 0111 xxxx */
461 /* SMC cccc 0001 0110 xxxx xxxx xxxx 0111 xxxx */
462 /* And unallocated instructions... */
463 DECODE_END
464};
465
466static const union decode_item arm_cccc_0001_0xx0____1xx0_table[] = {
467 /* Halfword multiply and multiply-accumulate */
468
469 /* SMLALxy cccc 0001 0100 xxxx xxxx xxxx 1xx0 xxxx */
470 DECODE_EMULATEX (0x0ff00090, 0x01400080, emulate_rdlo12rdhi16rn0rm8_rwflags_nopc,
471 REGS(NOPC, NOPC, NOPC, 0, NOPC)),
472
473 /* SMULWy cccc 0001 0010 xxxx xxxx xxxx 1x10 xxxx */
474 DECODE_OR (0x0ff000b0, 0x012000a0),
475 /* SMULxy cccc 0001 0110 xxxx xxxx xxxx 1xx0 xxxx */
476 DECODE_EMULATEX (0x0ff00090, 0x01600080, emulate_rd16rn12rm0rs8_rwflags_nopc,
477 REGS(NOPC, 0, NOPC, 0, NOPC)),
478
479 /* SMLAxy cccc 0001 0000 xxxx xxxx xxxx 1xx0 xxxx */
480 DECODE_OR (0x0ff00090, 0x01000080),
481 /* SMLAWy cccc 0001 0010 xxxx xxxx xxxx 1x00 xxxx */
482 DECODE_EMULATEX (0x0ff000b0, 0x01200080, emulate_rd16rn12rm0rs8_rwflags_nopc,
483 REGS(NOPC, NOPC, NOPC, 0, NOPC)),
484
485 DECODE_END
486}; 343};
487
488static const union decode_item arm_cccc_0000_____1001_table[] = {
489 /* Multiply and multiply-accumulate */
490
491 /* MUL cccc 0000 0000 xxxx xxxx xxxx 1001 xxxx */
492 /* MULS cccc 0000 0001 xxxx xxxx xxxx 1001 xxxx */
493 DECODE_EMULATEX (0x0fe000f0, 0x00000090, emulate_rd16rn12rm0rs8_rwflags_nopc,
494 REGS(NOPC, 0, NOPC, 0, NOPC)),
495
496 /* MLA cccc 0000 0010 xxxx xxxx xxxx 1001 xxxx */
497 /* MLAS cccc 0000 0011 xxxx xxxx xxxx 1001 xxxx */
498 DECODE_OR (0x0fe000f0, 0x00200090),
499 /* MLS cccc 0000 0110 xxxx xxxx xxxx 1001 xxxx */
500 DECODE_EMULATEX (0x0ff000f0, 0x00600090, emulate_rd16rn12rm0rs8_rwflags_nopc,
501 REGS(NOPC, NOPC, NOPC, 0, NOPC)),
502
503 /* UMAAL cccc 0000 0100 xxxx xxxx xxxx 1001 xxxx */
504 DECODE_OR (0x0ff000f0, 0x00400090),
505 /* UMULL cccc 0000 1000 xxxx xxxx xxxx 1001 xxxx */
506 /* UMULLS cccc 0000 1001 xxxx xxxx xxxx 1001 xxxx */
507 /* UMLAL cccc 0000 1010 xxxx xxxx xxxx 1001 xxxx */
508 /* UMLALS cccc 0000 1011 xxxx xxxx xxxx 1001 xxxx */
509 /* SMULL cccc 0000 1100 xxxx xxxx xxxx 1001 xxxx */
510 /* SMULLS cccc 0000 1101 xxxx xxxx xxxx 1001 xxxx */
511 /* SMLAL cccc 0000 1110 xxxx xxxx xxxx 1001 xxxx */
512 /* SMLALS cccc 0000 1111 xxxx xxxx xxxx 1001 xxxx */
513 DECODE_EMULATEX (0x0f8000f0, 0x00800090, emulate_rdlo12rdhi16rn0rm8_rwflags_nopc,
514 REGS(NOPC, NOPC, NOPC, 0, NOPC)),
515
516 DECODE_END
517};
518
519static const union decode_item arm_cccc_0001_____1001_table[] = {
520 /* Synchronization primitives */
521
522#if __LINUX_ARM_ARCH__ < 6
523 /* Deprecated on ARMv6 and may be UNDEFINED on v7 */
524 /* SMP/SWPB cccc 0001 0x00 xxxx xxxx xxxx 1001 xxxx */
525 DECODE_EMULATEX (0x0fb000f0, 0x01000090, emulate_rd12rn16rm0_rwflags_nopc,
526 REGS(NOPC, NOPC, 0, 0, NOPC)),
527#endif
528 /* LDREX/STREX{,D,B,H} cccc 0001 1xxx xxxx xxxx xxxx 1001 xxxx */
529 /* And unallocated instructions... */
530 DECODE_END
531};
532
533static const union decode_item arm_cccc_000x_____1xx1_table[] = {
534 /* Extra load/store instructions */
535
536 /* STRHT cccc 0000 xx10 xxxx xxxx xxxx 1011 xxxx */
537 /* ??? cccc 0000 xx10 xxxx xxxx xxxx 11x1 xxxx */
538 /* LDRHT cccc 0000 xx11 xxxx xxxx xxxx 1011 xxxx */
539 /* LDRSBT cccc 0000 xx11 xxxx xxxx xxxx 1101 xxxx */
540 /* LDRSHT cccc 0000 xx11 xxxx xxxx xxxx 1111 xxxx */
541 DECODE_REJECT (0x0f200090, 0x00200090),
542
543 /* LDRD/STRD lr,pc,{... cccc 000x x0x0 xxxx 111x xxxx 1101 xxxx */
544 DECODE_REJECT (0x0e10e0d0, 0x0000e0d0),
545
546 /* LDRD (register) cccc 000x x0x0 xxxx xxxx xxxx 1101 xxxx */
547 /* STRD (register) cccc 000x x0x0 xxxx xxxx xxxx 1111 xxxx */
548 DECODE_EMULATEX (0x0e5000d0, 0x000000d0, emulate_ldrdstrd,
549 REGS(NOPCWB, NOPCX, 0, 0, NOPC)),
550
551 /* LDRD (immediate) cccc 000x x1x0 xxxx xxxx xxxx 1101 xxxx */
552 /* STRD (immediate) cccc 000x x1x0 xxxx xxxx xxxx 1111 xxxx */
553 DECODE_EMULATEX (0x0e5000d0, 0x004000d0, emulate_ldrdstrd,
554 REGS(NOPCWB, NOPCX, 0, 0, 0)),
555
556 /* STRH (register) cccc 000x x0x0 xxxx xxxx xxxx 1011 xxxx */
557 DECODE_EMULATEX (0x0e5000f0, 0x000000b0, emulate_str,
558 REGS(NOPCWB, NOPC, 0, 0, NOPC)),
559
560 /* LDRH (register) cccc 000x x0x1 xxxx xxxx xxxx 1011 xxxx */
561 /* LDRSB (register) cccc 000x x0x1 xxxx xxxx xxxx 1101 xxxx */
562 /* LDRSH (register) cccc 000x x0x1 xxxx xxxx xxxx 1111 xxxx */
563 DECODE_EMULATEX (0x0e500090, 0x00100090, emulate_ldr,
564 REGS(NOPCWB, NOPC, 0, 0, NOPC)),
565
566 /* STRH (immediate) cccc 000x x1x0 xxxx xxxx xxxx 1011 xxxx */
567 DECODE_EMULATEX (0x0e5000f0, 0x004000b0, emulate_str,
568 REGS(NOPCWB, NOPC, 0, 0, 0)),
569
570 /* LDRH (immediate) cccc 000x x1x1 xxxx xxxx xxxx 1011 xxxx */
571 /* LDRSB (immediate) cccc 000x x1x1 xxxx xxxx xxxx 1101 xxxx */
572 /* LDRSH (immediate) cccc 000x x1x1 xxxx xxxx xxxx 1111 xxxx */
573 DECODE_EMULATEX (0x0e500090, 0x00500090, emulate_ldr,
574 REGS(NOPCWB, NOPC, 0, 0, 0)),
575
576 DECODE_END
577};
578
579static const union decode_item arm_cccc_000x_table[] = {
580 /* Data-processing (register) */
581
582 /* <op>S PC, ... cccc 000x xxx1 xxxx 1111 xxxx xxxx xxxx */
583 DECODE_REJECT (0x0e10f000, 0x0010f000),
584
585 /* MOV IP, SP 1110 0001 1010 0000 1100 0000 0000 1101 */
586 DECODE_SIMULATE (0xffffffff, 0xe1a0c00d, simulate_mov_ipsp),
587
588 /* TST (register) cccc 0001 0001 xxxx xxxx xxxx xxx0 xxxx */
589 /* TEQ (register) cccc 0001 0011 xxxx xxxx xxxx xxx0 xxxx */
590 /* CMP (register) cccc 0001 0101 xxxx xxxx xxxx xxx0 xxxx */
591 /* CMN (register) cccc 0001 0111 xxxx xxxx xxxx xxx0 xxxx */
592 DECODE_EMULATEX (0x0f900010, 0x01100000, emulate_rd12rn16rm0rs8_rwflags,
593 REGS(ANY, 0, 0, 0, ANY)),
594
595 /* MOV (register) cccc 0001 101x xxxx xxxx xxxx xxx0 xxxx */
596 /* MVN (register) cccc 0001 111x xxxx xxxx xxxx xxx0 xxxx */
597 DECODE_EMULATEX (0x0fa00010, 0x01a00000, emulate_rd12rn16rm0rs8_rwflags,
598 REGS(0, ANY, 0, 0, ANY)),
599
600 /* AND (register) cccc 0000 000x xxxx xxxx xxxx xxx0 xxxx */
601 /* EOR (register) cccc 0000 001x xxxx xxxx xxxx xxx0 xxxx */
602 /* SUB (register) cccc 0000 010x xxxx xxxx xxxx xxx0 xxxx */
603 /* RSB (register) cccc 0000 011x xxxx xxxx xxxx xxx0 xxxx */
604 /* ADD (register) cccc 0000 100x xxxx xxxx xxxx xxx0 xxxx */
605 /* ADC (register) cccc 0000 101x xxxx xxxx xxxx xxx0 xxxx */
606 /* SBC (register) cccc 0000 110x xxxx xxxx xxxx xxx0 xxxx */
607 /* RSC (register) cccc 0000 111x xxxx xxxx xxxx xxx0 xxxx */
608 /* ORR (register) cccc 0001 100x xxxx xxxx xxxx xxx0 xxxx */
609 /* BIC (register) cccc 0001 110x xxxx xxxx xxxx xxx0 xxxx */
610 DECODE_EMULATEX (0x0e000010, 0x00000000, emulate_rd12rn16rm0rs8_rwflags,
611 REGS(ANY, ANY, 0, 0, ANY)),
612
613 /* TST (reg-shift reg) cccc 0001 0001 xxxx xxxx xxxx 0xx1 xxxx */
614 /* TEQ (reg-shift reg) cccc 0001 0011 xxxx xxxx xxxx 0xx1 xxxx */
615 /* CMP (reg-shift reg) cccc 0001 0101 xxxx xxxx xxxx 0xx1 xxxx */
616 /* CMN (reg-shift reg) cccc 0001 0111 xxxx xxxx xxxx 0xx1 xxxx */
617 DECODE_EMULATEX (0x0f900090, 0x01100010, emulate_rd12rn16rm0rs8_rwflags,
618 REGS(ANY, 0, NOPC, 0, ANY)),
619
620 /* MOV (reg-shift reg) cccc 0001 101x xxxx xxxx xxxx 0xx1 xxxx */
621 /* MVN (reg-shift reg) cccc 0001 111x xxxx xxxx xxxx 0xx1 xxxx */
622 DECODE_EMULATEX (0x0fa00090, 0x01a00010, emulate_rd12rn16rm0rs8_rwflags,
623 REGS(0, ANY, NOPC, 0, ANY)),
624
625 /* AND (reg-shift reg) cccc 0000 000x xxxx xxxx xxxx 0xx1 xxxx */
626 /* EOR (reg-shift reg) cccc 0000 001x xxxx xxxx xxxx 0xx1 xxxx */
627 /* SUB (reg-shift reg) cccc 0000 010x xxxx xxxx xxxx 0xx1 xxxx */
628 /* RSB (reg-shift reg) cccc 0000 011x xxxx xxxx xxxx 0xx1 xxxx */
629 /* ADD (reg-shift reg) cccc 0000 100x xxxx xxxx xxxx 0xx1 xxxx */
630 /* ADC (reg-shift reg) cccc 0000 101x xxxx xxxx xxxx 0xx1 xxxx */
631 /* SBC (reg-shift reg) cccc 0000 110x xxxx xxxx xxxx 0xx1 xxxx */
632 /* RSC (reg-shift reg) cccc 0000 111x xxxx xxxx xxxx 0xx1 xxxx */
633 /* ORR (reg-shift reg) cccc 0001 100x xxxx xxxx xxxx 0xx1 xxxx */
634 /* BIC (reg-shift reg) cccc 0001 110x xxxx xxxx xxxx 0xx1 xxxx */
635 DECODE_EMULATEX (0x0e000090, 0x00000010, emulate_rd12rn16rm0rs8_rwflags,
636 REGS(ANY, ANY, NOPC, 0, ANY)),
637
638 DECODE_END
639};
640
641static const union decode_item arm_cccc_001x_table[] = {
642 /* Data-processing (immediate) */
643
644 /* MOVW cccc 0011 0000 xxxx xxxx xxxx xxxx xxxx */
645 /* MOVT cccc 0011 0100 xxxx xxxx xxxx xxxx xxxx */
646 DECODE_EMULATEX (0x0fb00000, 0x03000000, emulate_rd12rm0_noflags_nopc,
647 REGS(0, NOPC, 0, 0, 0)),
648
649 /* YIELD cccc 0011 0010 0000 xxxx xxxx 0000 0001 */
650 DECODE_OR (0x0fff00ff, 0x03200001),
651 /* SEV cccc 0011 0010 0000 xxxx xxxx 0000 0100 */
652 DECODE_EMULATE (0x0fff00ff, 0x03200004, kprobe_emulate_none),
653 /* NOP cccc 0011 0010 0000 xxxx xxxx 0000 0000 */
654 /* WFE cccc 0011 0010 0000 xxxx xxxx 0000 0010 */
655 /* WFI cccc 0011 0010 0000 xxxx xxxx 0000 0011 */
656 DECODE_SIMULATE (0x0fff00fc, 0x03200000, kprobe_simulate_nop),
657 /* DBG cccc 0011 0010 0000 xxxx xxxx ffff xxxx */
658 /* unallocated hints cccc 0011 0010 0000 xxxx xxxx xxxx xxxx */
659 /* MSR (immediate) cccc 0011 0x10 xxxx xxxx xxxx xxxx xxxx */
660 DECODE_REJECT (0x0fb00000, 0x03200000),
661
662 /* <op>S PC, ... cccc 001x xxx1 xxxx 1111 xxxx xxxx xxxx */
663 DECODE_REJECT (0x0e10f000, 0x0210f000),
664
665 /* TST (immediate) cccc 0011 0001 xxxx xxxx xxxx xxxx xxxx */
666 /* TEQ (immediate) cccc 0011 0011 xxxx xxxx xxxx xxxx xxxx */
667 /* CMP (immediate) cccc 0011 0101 xxxx xxxx xxxx xxxx xxxx */
668 /* CMN (immediate) cccc 0011 0111 xxxx xxxx xxxx xxxx xxxx */
669 DECODE_EMULATEX (0x0f900000, 0x03100000, emulate_rd12rn16rm0rs8_rwflags,
670 REGS(ANY, 0, 0, 0, 0)),
671
672 /* MOV (immediate) cccc 0011 101x xxxx xxxx xxxx xxxx xxxx */
673 /* MVN (immediate) cccc 0011 111x xxxx xxxx xxxx xxxx xxxx */
674 DECODE_EMULATEX (0x0fa00000, 0x03a00000, emulate_rd12rn16rm0rs8_rwflags,
675 REGS(0, ANY, 0, 0, 0)),
676
677 /* AND (immediate) cccc 0010 000x xxxx xxxx xxxx xxxx xxxx */
678 /* EOR (immediate) cccc 0010 001x xxxx xxxx xxxx xxxx xxxx */
679 /* SUB (immediate) cccc 0010 010x xxxx xxxx xxxx xxxx xxxx */
680 /* RSB (immediate) cccc 0010 011x xxxx xxxx xxxx xxxx xxxx */
681 /* ADD (immediate) cccc 0010 100x xxxx xxxx xxxx xxxx xxxx */
682 /* ADC (immediate) cccc 0010 101x xxxx xxxx xxxx xxxx xxxx */
683 /* SBC (immediate) cccc 0010 110x xxxx xxxx xxxx xxxx xxxx */
684 /* RSC (immediate) cccc 0010 111x xxxx xxxx xxxx xxxx xxxx */
685 /* ORR (immediate) cccc 0011 100x xxxx xxxx xxxx xxxx xxxx */
686 /* BIC (immediate) cccc 0011 110x xxxx xxxx xxxx xxxx xxxx */
687 DECODE_EMULATEX (0x0e000000, 0x02000000, emulate_rd12rn16rm0rs8_rwflags,
688 REGS(ANY, ANY, 0, 0, 0)),
689
690 DECODE_END
691};
692
693static const union decode_item arm_cccc_0110_____xxx1_table[] = {
694 /* Media instructions */
695
696 /* SEL cccc 0110 1000 xxxx xxxx xxxx 1011 xxxx */
697 DECODE_EMULATEX (0x0ff000f0, 0x068000b0, emulate_rd12rn16rm0_rwflags_nopc,
698 REGS(NOPC, NOPC, 0, 0, NOPC)),
699
700 /* SSAT cccc 0110 101x xxxx xxxx xxxx xx01 xxxx */
701 /* USAT cccc 0110 111x xxxx xxxx xxxx xx01 xxxx */
702 DECODE_OR(0x0fa00030, 0x06a00010),
703 /* SSAT16 cccc 0110 1010 xxxx xxxx xxxx 0011 xxxx */
704 /* USAT16 cccc 0110 1110 xxxx xxxx xxxx 0011 xxxx */
705 DECODE_EMULATEX (0x0fb000f0, 0x06a00030, emulate_rd12rn16rm0_rwflags_nopc,
706 REGS(0, NOPC, 0, 0, NOPC)),
707
708 /* REV cccc 0110 1011 xxxx xxxx xxxx 0011 xxxx */
709 /* REV16 cccc 0110 1011 xxxx xxxx xxxx 1011 xxxx */
710 /* RBIT cccc 0110 1111 xxxx xxxx xxxx 0011 xxxx */
711 /* REVSH cccc 0110 1111 xxxx xxxx xxxx 1011 xxxx */
712 DECODE_EMULATEX (0x0fb00070, 0x06b00030, emulate_rd12rm0_noflags_nopc,
713 REGS(0, NOPC, 0, 0, NOPC)),
714
715 /* ??? cccc 0110 0x00 xxxx xxxx xxxx xxx1 xxxx */
716 DECODE_REJECT (0x0fb00010, 0x06000010),
717 /* ??? cccc 0110 0xxx xxxx xxxx xxxx 1011 xxxx */
718 DECODE_REJECT (0x0f8000f0, 0x060000b0),
719 /* ??? cccc 0110 0xxx xxxx xxxx xxxx 1101 xxxx */
720 DECODE_REJECT (0x0f8000f0, 0x060000d0),
721 /* SADD16 cccc 0110 0001 xxxx xxxx xxxx 0001 xxxx */
722 /* SADDSUBX cccc 0110 0001 xxxx xxxx xxxx 0011 xxxx */
723 /* SSUBADDX cccc 0110 0001 xxxx xxxx xxxx 0101 xxxx */
724 /* SSUB16 cccc 0110 0001 xxxx xxxx xxxx 0111 xxxx */
725 /* SADD8 cccc 0110 0001 xxxx xxxx xxxx 1001 xxxx */
726 /* SSUB8 cccc 0110 0001 xxxx xxxx xxxx 1111 xxxx */
727 /* QADD16 cccc 0110 0010 xxxx xxxx xxxx 0001 xxxx */
728 /* QADDSUBX cccc 0110 0010 xxxx xxxx xxxx 0011 xxxx */
729 /* QSUBADDX cccc 0110 0010 xxxx xxxx xxxx 0101 xxxx */
730 /* QSUB16 cccc 0110 0010 xxxx xxxx xxxx 0111 xxxx */
731 /* QADD8 cccc 0110 0010 xxxx xxxx xxxx 1001 xxxx */
732 /* QSUB8 cccc 0110 0010 xxxx xxxx xxxx 1111 xxxx */
733 /* SHADD16 cccc 0110 0011 xxxx xxxx xxxx 0001 xxxx */
734 /* SHADDSUBX cccc 0110 0011 xxxx xxxx xxxx 0011 xxxx */
735 /* SHSUBADDX cccc 0110 0011 xxxx xxxx xxxx 0101 xxxx */
736 /* SHSUB16 cccc 0110 0011 xxxx xxxx xxxx 0111 xxxx */
737 /* SHADD8 cccc 0110 0011 xxxx xxxx xxxx 1001 xxxx */
738 /* SHSUB8 cccc 0110 0011 xxxx xxxx xxxx 1111 xxxx */
739 /* UADD16 cccc 0110 0101 xxxx xxxx xxxx 0001 xxxx */
740 /* UADDSUBX cccc 0110 0101 xxxx xxxx xxxx 0011 xxxx */
741 /* USUBADDX cccc 0110 0101 xxxx xxxx xxxx 0101 xxxx */
742 /* USUB16 cccc 0110 0101 xxxx xxxx xxxx 0111 xxxx */
743 /* UADD8 cccc 0110 0101 xxxx xxxx xxxx 1001 xxxx */
744 /* USUB8 cccc 0110 0101 xxxx xxxx xxxx 1111 xxxx */
745 /* UQADD16 cccc 0110 0110 xxxx xxxx xxxx 0001 xxxx */
746 /* UQADDSUBX cccc 0110 0110 xxxx xxxx xxxx 0011 xxxx */
747 /* UQSUBADDX cccc 0110 0110 xxxx xxxx xxxx 0101 xxxx */
748 /* UQSUB16 cccc 0110 0110 xxxx xxxx xxxx 0111 xxxx */
749 /* UQADD8 cccc 0110 0110 xxxx xxxx xxxx 1001 xxxx */
750 /* UQSUB8 cccc 0110 0110 xxxx xxxx xxxx 1111 xxxx */
751 /* UHADD16 cccc 0110 0111 xxxx xxxx xxxx 0001 xxxx */
752 /* UHADDSUBX cccc 0110 0111 xxxx xxxx xxxx 0011 xxxx */
753 /* UHSUBADDX cccc 0110 0111 xxxx xxxx xxxx 0101 xxxx */
754 /* UHSUB16 cccc 0110 0111 xxxx xxxx xxxx 0111 xxxx */
755 /* UHADD8 cccc 0110 0111 xxxx xxxx xxxx 1001 xxxx */
756 /* UHSUB8 cccc 0110 0111 xxxx xxxx xxxx 1111 xxxx */
757 DECODE_EMULATEX (0x0f800010, 0x06000010, emulate_rd12rn16rm0_rwflags_nopc,
758 REGS(NOPC, NOPC, 0, 0, NOPC)),
759
760 /* PKHBT cccc 0110 1000 xxxx xxxx xxxx x001 xxxx */
761 /* PKHTB cccc 0110 1000 xxxx xxxx xxxx x101 xxxx */
762 DECODE_EMULATEX (0x0ff00030, 0x06800010, emulate_rd12rn16rm0_rwflags_nopc,
763 REGS(NOPC, NOPC, 0, 0, NOPC)),
764
765 /* ??? cccc 0110 1001 xxxx xxxx xxxx 0111 xxxx */
766 /* ??? cccc 0110 1101 xxxx xxxx xxxx 0111 xxxx */
767 DECODE_REJECT (0x0fb000f0, 0x06900070),
768
769 /* SXTB16 cccc 0110 1000 1111 xxxx xxxx 0111 xxxx */
770 /* SXTB cccc 0110 1010 1111 xxxx xxxx 0111 xxxx */
771 /* SXTH cccc 0110 1011 1111 xxxx xxxx 0111 xxxx */
772 /* UXTB16 cccc 0110 1100 1111 xxxx xxxx 0111 xxxx */
773 /* UXTB cccc 0110 1110 1111 xxxx xxxx 0111 xxxx */
774 /* UXTH cccc 0110 1111 1111 xxxx xxxx 0111 xxxx */
775 DECODE_EMULATEX (0x0f8f00f0, 0x068f0070, emulate_rd12rm0_noflags_nopc,
776 REGS(0, NOPC, 0, 0, NOPC)),
777
778 /* SXTAB16 cccc 0110 1000 xxxx xxxx xxxx 0111 xxxx */
779 /* SXTAB cccc 0110 1010 xxxx xxxx xxxx 0111 xxxx */
780 /* SXTAH cccc 0110 1011 xxxx xxxx xxxx 0111 xxxx */
781 /* UXTAB16 cccc 0110 1100 xxxx xxxx xxxx 0111 xxxx */
782 /* UXTAB cccc 0110 1110 xxxx xxxx xxxx 0111 xxxx */
783 /* UXTAH cccc 0110 1111 xxxx xxxx xxxx 0111 xxxx */
784 DECODE_EMULATEX (0x0f8000f0, 0x06800070, emulate_rd12rn16rm0_rwflags_nopc,
785 REGS(NOPCX, NOPC, 0, 0, NOPC)),
786
787 DECODE_END
788};
789
790static const union decode_item arm_cccc_0111_____xxx1_table[] = {
791 /* Media instructions */
792
793 /* UNDEFINED cccc 0111 1111 xxxx xxxx xxxx 1111 xxxx */
794 DECODE_REJECT (0x0ff000f0, 0x07f000f0),
795
796 /* SMLALD cccc 0111 0100 xxxx xxxx xxxx 00x1 xxxx */
797 /* SMLSLD cccc 0111 0100 xxxx xxxx xxxx 01x1 xxxx */
798 DECODE_EMULATEX (0x0ff00090, 0x07400010, emulate_rdlo12rdhi16rn0rm8_rwflags_nopc,
799 REGS(NOPC, NOPC, NOPC, 0, NOPC)),
800
801 /* SMUAD cccc 0111 0000 xxxx 1111 xxxx 00x1 xxxx */
802 /* SMUSD cccc 0111 0000 xxxx 1111 xxxx 01x1 xxxx */
803 DECODE_OR (0x0ff0f090, 0x0700f010),
804 /* SMMUL cccc 0111 0101 xxxx 1111 xxxx 00x1 xxxx */
805 DECODE_OR (0x0ff0f0d0, 0x0750f010),
806 /* USAD8 cccc 0111 1000 xxxx 1111 xxxx 0001 xxxx */
807 DECODE_EMULATEX (0x0ff0f0f0, 0x0780f010, emulate_rd16rn12rm0rs8_rwflags_nopc,
808 REGS(NOPC, 0, NOPC, 0, NOPC)),
809
810 /* SMLAD cccc 0111 0000 xxxx xxxx xxxx 00x1 xxxx */
811 /* SMLSD cccc 0111 0000 xxxx xxxx xxxx 01x1 xxxx */
812 DECODE_OR (0x0ff00090, 0x07000010),
813 /* SMMLA cccc 0111 0101 xxxx xxxx xxxx 00x1 xxxx */
814 DECODE_OR (0x0ff000d0, 0x07500010),
815 /* USADA8 cccc 0111 1000 xxxx xxxx xxxx 0001 xxxx */
816 DECODE_EMULATEX (0x0ff000f0, 0x07800010, emulate_rd16rn12rm0rs8_rwflags_nopc,
817 REGS(NOPC, NOPCX, NOPC, 0, NOPC)),
818
819 /* SMMLS cccc 0111 0101 xxxx xxxx xxxx 11x1 xxxx */
820 DECODE_EMULATEX (0x0ff000d0, 0x075000d0, emulate_rd16rn12rm0rs8_rwflags_nopc,
821 REGS(NOPC, NOPC, NOPC, 0, NOPC)),
822
823 /* SBFX cccc 0111 101x xxxx xxxx xxxx x101 xxxx */
824 /* UBFX cccc 0111 111x xxxx xxxx xxxx x101 xxxx */
825 DECODE_EMULATEX (0x0fa00070, 0x07a00050, emulate_rd12rm0_noflags_nopc,
826 REGS(0, NOPC, 0, 0, NOPC)),
827
828 /* BFC cccc 0111 110x xxxx xxxx xxxx x001 1111 */
829 DECODE_EMULATEX (0x0fe0007f, 0x07c0001f, emulate_rd12rm0_noflags_nopc,
830 REGS(0, NOPC, 0, 0, 0)),
831
832 /* BFI cccc 0111 110x xxxx xxxx xxxx x001 xxxx */
833 DECODE_EMULATEX (0x0fe00070, 0x07c00010, emulate_rd12rm0_noflags_nopc,
834 REGS(0, NOPC, 0, 0, NOPCX)),
835
836 DECODE_END
837};
838
839static const union decode_item arm_cccc_01xx_table[] = {
840 /* Load/store word and unsigned byte */
841
842 /* LDRB/STRB pc,[...] cccc 01xx x0xx xxxx xxxx xxxx xxxx xxxx */
843 DECODE_REJECT (0x0c40f000, 0x0440f000),
844
845 /* STRT cccc 01x0 x010 xxxx xxxx xxxx xxxx xxxx */
846 /* LDRT cccc 01x0 x011 xxxx xxxx xxxx xxxx xxxx */
847 /* STRBT cccc 01x0 x110 xxxx xxxx xxxx xxxx xxxx */
848 /* LDRBT cccc 01x0 x111 xxxx xxxx xxxx xxxx xxxx */
849 DECODE_REJECT (0x0d200000, 0x04200000),
850
851 /* STR (immediate) cccc 010x x0x0 xxxx xxxx xxxx xxxx xxxx */
852 /* STRB (immediate) cccc 010x x1x0 xxxx xxxx xxxx xxxx xxxx */
853 DECODE_EMULATEX (0x0e100000, 0x04000000, emulate_str,
854 REGS(NOPCWB, ANY, 0, 0, 0)),
855
856 /* LDR (immediate) cccc 010x x0x1 xxxx xxxx xxxx xxxx xxxx */
857 /* LDRB (immediate) cccc 010x x1x1 xxxx xxxx xxxx xxxx xxxx */
858 DECODE_EMULATEX (0x0e100000, 0x04100000, emulate_ldr,
859 REGS(NOPCWB, ANY, 0, 0, 0)),
860
861 /* STR (register) cccc 011x x0x0 xxxx xxxx xxxx xxxx xxxx */
862 /* STRB (register) cccc 011x x1x0 xxxx xxxx xxxx xxxx xxxx */
863 DECODE_EMULATEX (0x0e100000, 0x06000000, emulate_str,
864 REGS(NOPCWB, ANY, 0, 0, NOPC)),
865
866 /* LDR (register) cccc 011x x0x1 xxxx xxxx xxxx xxxx xxxx */
867 /* LDRB (register) cccc 011x x1x1 xxxx xxxx xxxx xxxx xxxx */
868 DECODE_EMULATEX (0x0e100000, 0x06100000, emulate_ldr,
869 REGS(NOPCWB, ANY, 0, 0, NOPC)),
870
871 DECODE_END
872};
873
874static const union decode_item arm_cccc_100x_table[] = {
875 /* Block data transfer instructions */
876
877 /* LDM cccc 100x x0x1 xxxx xxxx xxxx xxxx xxxx */
878 /* STM cccc 100x x0x0 xxxx xxxx xxxx xxxx xxxx */
879 DECODE_CUSTOM (0x0e400000, 0x08000000, kprobe_decode_ldmstm),
880
881 /* STM (user registers) cccc 100x x1x0 xxxx xxxx xxxx xxxx xxxx */
882 /* LDM (user registers) cccc 100x x1x1 xxxx 0xxx xxxx xxxx xxxx */
883 /* LDM (exception ret) cccc 100x x1x1 xxxx 1xxx xxxx xxxx xxxx */
884 DECODE_END
885};
886
887const union decode_item kprobe_decode_arm_table[] = {
888 /*
889 * Unconditional instructions
890 * 1111 xxxx xxxx xxxx xxxx xxxx xxxx xxxx
891 */
892 DECODE_TABLE (0xf0000000, 0xf0000000, arm_1111_table),
893
894 /*
895 * Miscellaneous instructions
896 * cccc 0001 0xx0 xxxx xxxx xxxx 0xxx xxxx
897 */
898 DECODE_TABLE (0x0f900080, 0x01000000, arm_cccc_0001_0xx0____0xxx_table),
899
900 /*
901 * Halfword multiply and multiply-accumulate
902 * cccc 0001 0xx0 xxxx xxxx xxxx 1xx0 xxxx
903 */
904 DECODE_TABLE (0x0f900090, 0x01000080, arm_cccc_0001_0xx0____1xx0_table),
905
906 /*
907 * Multiply and multiply-accumulate
908 * cccc 0000 xxxx xxxx xxxx xxxx 1001 xxxx
909 */
910 DECODE_TABLE (0x0f0000f0, 0x00000090, arm_cccc_0000_____1001_table),
911
912 /*
913 * Synchronization primitives
914 * cccc 0001 xxxx xxxx xxxx xxxx 1001 xxxx
915 */
916 DECODE_TABLE (0x0f0000f0, 0x01000090, arm_cccc_0001_____1001_table),
917
918 /*
919 * Extra load/store instructions
920 * cccc 000x xxxx xxxx xxxx xxxx 1xx1 xxxx
921 */
922 DECODE_TABLE (0x0e000090, 0x00000090, arm_cccc_000x_____1xx1_table),
923
924 /*
925 * Data-processing (register)
926 * cccc 000x xxxx xxxx xxxx xxxx xxx0 xxxx
927 * Data-processing (register-shifted register)
928 * cccc 000x xxxx xxxx xxxx xxxx 0xx1 xxxx
929 */
930 DECODE_TABLE (0x0e000000, 0x00000000, arm_cccc_000x_table),
931
932 /*
933 * Data-processing (immediate)
934 * cccc 001x xxxx xxxx xxxx xxxx xxxx xxxx
935 */
936 DECODE_TABLE (0x0e000000, 0x02000000, arm_cccc_001x_table),
937
938 /*
939 * Media instructions
940 * cccc 011x xxxx xxxx xxxx xxxx xxx1 xxxx
941 */
942 DECODE_TABLE (0x0f000010, 0x06000010, arm_cccc_0110_____xxx1_table),
943 DECODE_TABLE (0x0f000010, 0x07000010, arm_cccc_0111_____xxx1_table),
944
945 /*
946 * Load/store word and unsigned byte
947 * cccc 01xx xxxx xxxx xxxx xxxx xxxx xxxx
948 */
949 DECODE_TABLE (0x0c000000, 0x04000000, arm_cccc_01xx_table),
950
951 /*
952 * Block data transfer instructions
953 * cccc 100x xxxx xxxx xxxx xxxx xxxx xxxx
954 */
955 DECODE_TABLE (0x0e000000, 0x08000000, arm_cccc_100x_table),
956
957 /* B cccc 1010 xxxx xxxx xxxx xxxx xxxx xxxx */
958 /* BL cccc 1011 xxxx xxxx xxxx xxxx xxxx xxxx */
959 DECODE_SIMULATE (0x0e000000, 0x0a000000, simulate_bbl),
960
961 /*
962 * Supervisor Call, and coprocessor instructions
963 */
964
965 /* MCRR cccc 1100 0100 xxxx xxxx xxxx xxxx xxxx */
966 /* MRRC cccc 1100 0101 xxxx xxxx xxxx xxxx xxxx */
967 /* LDC cccc 110x xxx1 xxxx xxxx xxxx xxxx xxxx */
968 /* STC cccc 110x xxx0 xxxx xxxx xxxx xxxx xxxx */
969 /* CDP cccc 1110 xxxx xxxx xxxx xxxx xxx0 xxxx */
970 /* MCR cccc 1110 xxx0 xxxx xxxx xxxx xxx1 xxxx */
971 /* MRC cccc 1110 xxx1 xxxx xxxx xxxx xxx1 xxxx */
972 /* SVC cccc 1111 xxxx xxxx xxxx xxxx xxxx xxxx */
973 DECODE_REJECT (0x0c000000, 0x0c000000),
974
975 DECODE_END
976};
977#ifdef CONFIG_ARM_KPROBES_TEST_MODULE
978EXPORT_SYMBOL_GPL(kprobe_decode_arm_table);
979#endif
980
981static void __kprobes arm_singlestep(struct kprobe *p, struct pt_regs *regs)
982{
983 regs->ARM_pc += 4;
984 p->ainsn.insn_handler(p, regs);
985}
986
987/* Return:
988 * INSN_REJECTED If instruction is one not allowed to kprobe,
989 * INSN_GOOD If instruction is supported and uses instruction slot,
990 * INSN_GOOD_NO_SLOT If instruction is supported but doesn't use its slot.
991 *
992 * For instructions we don't want to kprobe (INSN_REJECTED return result):
993 * These are generally ones that modify the processor state making
994 * them "hard" to simulate such as switches processor modes or
995 * make accesses in alternate modes. Any of these could be simulated
996 * if the work was put into it, but low return considering they
997 * should also be very rare.
998 */
999enum kprobe_insn __kprobes
1000arm_kprobe_decode_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi)
1001{
1002 asi->insn_singlestep = arm_singlestep;
1003 asi->insn_check_cc = kprobe_condition_checks[insn>>28];
1004 return kprobe_decode_insn(insn, asi, kprobe_decode_arm_table, false);
1005}
diff --git a/arch/arm/kernel/kprobes-common.c b/arch/arm/kernel/kprobes-common.c
index 18a76282970e..0bf5d64eba1d 100644
--- a/arch/arm/kernel/kprobes-common.c
+++ b/arch/arm/kernel/kprobes-common.c
@@ -13,178 +13,15 @@
13 13
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/kprobes.h> 15#include <linux/kprobes.h>
16#include <asm/system_info.h> 16#include <asm/opcodes.h>
17 17
18#include "kprobes.h" 18#include "kprobes.h"
19 19
20 20
21#ifndef find_str_pc_offset 21static void __kprobes simulate_ldm1stm1(probes_opcode_t insn,
22 22 struct arch_probes_insn *asi,
23/* 23 struct pt_regs *regs)
24 * For STR and STM instructions, an ARM core may choose to use either
25 * a +8 or a +12 displacement from the current instruction's address.
26 * Whichever value is chosen for a given core, it must be the same for
27 * both instructions and may not change. This function measures it.
28 */
29
30int str_pc_offset;
31
32void __init find_str_pc_offset(void)
33{
34 int addr, scratch, ret;
35
36 __asm__ (
37 "sub %[ret], pc, #4 \n\t"
38 "str pc, %[addr] \n\t"
39 "ldr %[scr], %[addr] \n\t"
40 "sub %[ret], %[scr], %[ret] \n\t"
41 : [ret] "=r" (ret), [scr] "=r" (scratch), [addr] "+m" (addr));
42
43 str_pc_offset = ret;
44}
45
46#endif /* !find_str_pc_offset */
47
48
49#ifndef test_load_write_pc_interworking
50
51bool load_write_pc_interworks;
52
53void __init test_load_write_pc_interworking(void)
54{
55 int arch = cpu_architecture();
56 BUG_ON(arch == CPU_ARCH_UNKNOWN);
57 load_write_pc_interworks = arch >= CPU_ARCH_ARMv5T;
58}
59
60#endif /* !test_load_write_pc_interworking */
61
62
63#ifndef test_alu_write_pc_interworking
64
65bool alu_write_pc_interworks;
66
67void __init test_alu_write_pc_interworking(void)
68{
69 int arch = cpu_architecture();
70 BUG_ON(arch == CPU_ARCH_UNKNOWN);
71 alu_write_pc_interworks = arch >= CPU_ARCH_ARMv7;
72}
73
74#endif /* !test_alu_write_pc_interworking */
75
76
77void __init arm_kprobe_decode_init(void)
78{
79 find_str_pc_offset();
80 test_load_write_pc_interworking();
81 test_alu_write_pc_interworking();
82}
83
84
85static unsigned long __kprobes __check_eq(unsigned long cpsr)
86{
87 return cpsr & PSR_Z_BIT;
88}
89
90static unsigned long __kprobes __check_ne(unsigned long cpsr)
91{
92 return (~cpsr) & PSR_Z_BIT;
93}
94
95static unsigned long __kprobes __check_cs(unsigned long cpsr)
96{
97 return cpsr & PSR_C_BIT;
98}
99
100static unsigned long __kprobes __check_cc(unsigned long cpsr)
101{
102 return (~cpsr) & PSR_C_BIT;
103}
104
105static unsigned long __kprobes __check_mi(unsigned long cpsr)
106{
107 return cpsr & PSR_N_BIT;
108}
109
110static unsigned long __kprobes __check_pl(unsigned long cpsr)
111{
112 return (~cpsr) & PSR_N_BIT;
113}
114
115static unsigned long __kprobes __check_vs(unsigned long cpsr)
116{
117 return cpsr & PSR_V_BIT;
118}
119
120static unsigned long __kprobes __check_vc(unsigned long cpsr)
121{
122 return (~cpsr) & PSR_V_BIT;
123}
124
125static unsigned long __kprobes __check_hi(unsigned long cpsr)
126{
127 cpsr &= ~(cpsr >> 1); /* PSR_C_BIT &= ~PSR_Z_BIT */
128 return cpsr & PSR_C_BIT;
129}
130
131static unsigned long __kprobes __check_ls(unsigned long cpsr)
132{
133 cpsr &= ~(cpsr >> 1); /* PSR_C_BIT &= ~PSR_Z_BIT */
134 return (~cpsr) & PSR_C_BIT;
135}
136
137static unsigned long __kprobes __check_ge(unsigned long cpsr)
138{
139 cpsr ^= (cpsr << 3); /* PSR_N_BIT ^= PSR_V_BIT */
140 return (~cpsr) & PSR_N_BIT;
141}
142
143static unsigned long __kprobes __check_lt(unsigned long cpsr)
144{
145 cpsr ^= (cpsr << 3); /* PSR_N_BIT ^= PSR_V_BIT */
146 return cpsr & PSR_N_BIT;
147}
148
149static unsigned long __kprobes __check_gt(unsigned long cpsr)
150{
151 unsigned long temp = cpsr ^ (cpsr << 3); /* PSR_N_BIT ^= PSR_V_BIT */
152 temp |= (cpsr << 1); /* PSR_N_BIT |= PSR_Z_BIT */
153 return (~temp) & PSR_N_BIT;
154}
155
156static unsigned long __kprobes __check_le(unsigned long cpsr)
157{
158 unsigned long temp = cpsr ^ (cpsr << 3); /* PSR_N_BIT ^= PSR_V_BIT */
159 temp |= (cpsr << 1); /* PSR_N_BIT |= PSR_Z_BIT */
160 return temp & PSR_N_BIT;
161}
162
163static unsigned long __kprobes __check_al(unsigned long cpsr)
164{
165 return true;
166}
167
168kprobe_check_cc * const kprobe_condition_checks[16] = {
169 &__check_eq, &__check_ne, &__check_cs, &__check_cc,
170 &__check_mi, &__check_pl, &__check_vs, &__check_vc,
171 &__check_hi, &__check_ls, &__check_ge, &__check_lt,
172 &__check_gt, &__check_le, &__check_al, &__check_al
173};
174
175
176void __kprobes kprobe_simulate_nop(struct kprobe *p, struct pt_regs *regs)
177{
178}
179
180void __kprobes kprobe_emulate_none(struct kprobe *p, struct pt_regs *regs)
181{
182 p->ainsn.insn_fn();
183}
184
185static void __kprobes simulate_ldm1stm1(struct kprobe *p, struct pt_regs *regs)
186{ 24{
187 kprobe_opcode_t insn = p->opcode;
188 int rn = (insn >> 16) & 0xf; 25 int rn = (insn >> 16) & 0xf;
189 int lbit = insn & (1 << 20); 26 int lbit = insn & (1 << 20);
190 int wbit = insn & (1 << 21); 27 int wbit = insn & (1 << 21);
@@ -223,24 +60,31 @@ static void __kprobes simulate_ldm1stm1(struct kprobe *p, struct pt_regs *regs)
223 } 60 }
224} 61}
225 62
226static void __kprobes simulate_stm1_pc(struct kprobe *p, struct pt_regs *regs) 63static void __kprobes simulate_stm1_pc(probes_opcode_t insn,
64 struct arch_probes_insn *asi,
65 struct pt_regs *regs)
227{ 66{
228 regs->ARM_pc = (long)p->addr + str_pc_offset; 67 unsigned long addr = regs->ARM_pc - 4;
229 simulate_ldm1stm1(p, regs); 68
230 regs->ARM_pc = (long)p->addr + 4; 69 regs->ARM_pc = (long)addr + str_pc_offset;
70 simulate_ldm1stm1(insn, asi, regs);
71 regs->ARM_pc = (long)addr + 4;
231} 72}
232 73
233static void __kprobes simulate_ldm1_pc(struct kprobe *p, struct pt_regs *regs) 74static void __kprobes simulate_ldm1_pc(probes_opcode_t insn,
75 struct arch_probes_insn *asi,
76 struct pt_regs *regs)
234{ 77{
235 simulate_ldm1stm1(p, regs); 78 simulate_ldm1stm1(insn, asi, regs);
236 load_write_pc(regs->ARM_pc, regs); 79 load_write_pc(regs->ARM_pc, regs);
237} 80}
238 81
239static void __kprobes 82static void __kprobes
240emulate_generic_r0_12_noflags(struct kprobe *p, struct pt_regs *regs) 83emulate_generic_r0_12_noflags(probes_opcode_t insn,
84 struct arch_probes_insn *asi, struct pt_regs *regs)
241{ 85{
242 register void *rregs asm("r1") = regs; 86 register void *rregs asm("r1") = regs;
243 register void *rfn asm("lr") = p->ainsn.insn_fn; 87 register void *rfn asm("lr") = asi->insn_fn;
244 88
245 __asm__ __volatile__ ( 89 __asm__ __volatile__ (
246 "stmdb sp!, {%[regs], r11} \n\t" 90 "stmdb sp!, {%[regs], r11} \n\t"
@@ -264,22 +108,27 @@ emulate_generic_r0_12_noflags(struct kprobe *p, struct pt_regs *regs)
264} 108}
265 109
266static void __kprobes 110static void __kprobes
267emulate_generic_r2_14_noflags(struct kprobe *p, struct pt_regs *regs) 111emulate_generic_r2_14_noflags(probes_opcode_t insn,
112 struct arch_probes_insn *asi, struct pt_regs *regs)
268{ 113{
269 emulate_generic_r0_12_noflags(p, (struct pt_regs *)(regs->uregs+2)); 114 emulate_generic_r0_12_noflags(insn, asi,
115 (struct pt_regs *)(regs->uregs+2));
270} 116}
271 117
272static void __kprobes 118static void __kprobes
273emulate_ldm_r3_15(struct kprobe *p, struct pt_regs *regs) 119emulate_ldm_r3_15(probes_opcode_t insn,
120 struct arch_probes_insn *asi, struct pt_regs *regs)
274{ 121{
275 emulate_generic_r0_12_noflags(p, (struct pt_regs *)(regs->uregs+3)); 122 emulate_generic_r0_12_noflags(insn, asi,
123 (struct pt_regs *)(regs->uregs+3));
276 load_write_pc(regs->ARM_pc, regs); 124 load_write_pc(regs->ARM_pc, regs);
277} 125}
278 126
279enum kprobe_insn __kprobes 127enum probes_insn __kprobes
280kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_specific_insn *asi) 128kprobe_decode_ldmstm(probes_opcode_t insn, struct arch_probes_insn *asi,
129 const struct decode_header *h)
281{ 130{
282 kprobe_insn_handler_t *handler = 0; 131 probes_insn_handler_t *handler = 0;
283 unsigned reglist = insn & 0xffff; 132 unsigned reglist = insn & 0xffff;
284 int is_ldm = insn & 0x100000; 133 int is_ldm = insn & 0x100000;
285 int rn = (insn >> 16) & 0xf; 134 int rn = (insn >> 16) & 0xf;
@@ -305,7 +154,8 @@ kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_specific_insn *asi)
305 154
306 if (handler) { 155 if (handler) {
307 /* We can emulate the instruction in (possibly) modified form */ 156 /* We can emulate the instruction in (possibly) modified form */
308 asi->insn[0] = (insn & 0xfff00000) | (rn << 16) | reglist; 157 asi->insn[0] = __opcode_to_mem_arm((insn & 0xfff00000) |
158 (rn << 16) | reglist);
309 asi->insn_handler = handler; 159 asi->insn_handler = handler;
310 return INSN_GOOD; 160 return INSN_GOOD;
311 } 161 }
@@ -319,260 +169,3 @@ kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_specific_insn *asi)
319 return INSN_GOOD_NO_SLOT; 169 return INSN_GOOD_NO_SLOT;
320} 170}
321 171
322
323/*
324 * Prepare an instruction slot to receive an instruction for emulating.
325 * This is done by placing a subroutine return after the location where the
326 * instruction will be placed. We also modify ARM instructions to be
327 * unconditional as the condition code will already be checked before any
328 * emulation handler is called.
329 */
330static kprobe_opcode_t __kprobes
331prepare_emulated_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi,
332 bool thumb)
333{
334#ifdef CONFIG_THUMB2_KERNEL
335 if (thumb) {
336 u16 *thumb_insn = (u16 *)asi->insn;
337 thumb_insn[1] = 0x4770; /* Thumb bx lr */
338 thumb_insn[2] = 0x4770; /* Thumb bx lr */
339 return insn;
340 }
341 asi->insn[1] = 0xe12fff1e; /* ARM bx lr */
342#else
343 asi->insn[1] = 0xe1a0f00e; /* mov pc, lr */
344#endif
345 /* Make an ARM instruction unconditional */
346 if (insn < 0xe0000000)
347 insn = (insn | 0xe0000000) & ~0x10000000;
348 return insn;
349}
350
351/*
352 * Write a (probably modified) instruction into the slot previously prepared by
353 * prepare_emulated_insn
354 */
355static void __kprobes
356set_emulated_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi,
357 bool thumb)
358{
359#ifdef CONFIG_THUMB2_KERNEL
360 if (thumb) {
361 u16 *ip = (u16 *)asi->insn;
362 if (is_wide_instruction(insn))
363 *ip++ = insn >> 16;
364 *ip++ = insn;
365 return;
366 }
367#endif
368 asi->insn[0] = insn;
369}
370
371/*
372 * When we modify the register numbers encoded in an instruction to be emulated,
373 * the new values come from this define. For ARM and 32-bit Thumb instructions
374 * this gives...
375 *
376 * bit position 16 12 8 4 0
377 * ---------------+---+---+---+---+---+
378 * register r2 r0 r1 -- r3
379 */
380#define INSN_NEW_BITS 0x00020103
381
382/* Each nibble has same value as that at INSN_NEW_BITS bit 16 */
383#define INSN_SAMEAS16_BITS 0x22222222
384
385/*
386 * Validate and modify each of the registers encoded in an instruction.
387 *
388 * Each nibble in regs contains a value from enum decode_reg_type. For each
389 * non-zero value, the corresponding nibble in pinsn is validated and modified
390 * according to the type.
391 */
392static bool __kprobes decode_regs(kprobe_opcode_t* pinsn, u32 regs)
393{
394 kprobe_opcode_t insn = *pinsn;
395 kprobe_opcode_t mask = 0xf; /* Start at least significant nibble */
396
397 for (; regs != 0; regs >>= 4, mask <<= 4) {
398
399 kprobe_opcode_t new_bits = INSN_NEW_BITS;
400
401 switch (regs & 0xf) {
402
403 case REG_TYPE_NONE:
404 /* Nibble not a register, skip to next */
405 continue;
406
407 case REG_TYPE_ANY:
408 /* Any register is allowed */
409 break;
410
411 case REG_TYPE_SAMEAS16:
412 /* Replace register with same as at bit position 16 */
413 new_bits = INSN_SAMEAS16_BITS;
414 break;
415
416 case REG_TYPE_SP:
417 /* Only allow SP (R13) */
418 if ((insn ^ 0xdddddddd) & mask)
419 goto reject;
420 break;
421
422 case REG_TYPE_PC:
423 /* Only allow PC (R15) */
424 if ((insn ^ 0xffffffff) & mask)
425 goto reject;
426 break;
427
428 case REG_TYPE_NOSP:
429 /* Reject SP (R13) */
430 if (((insn ^ 0xdddddddd) & mask) == 0)
431 goto reject;
432 break;
433
434 case REG_TYPE_NOSPPC:
435 case REG_TYPE_NOSPPCX:
436 /* Reject SP and PC (R13 and R15) */
437 if (((insn ^ 0xdddddddd) & 0xdddddddd & mask) == 0)
438 goto reject;
439 break;
440
441 case REG_TYPE_NOPCWB:
442 if (!is_writeback(insn))
443 break; /* No writeback, so any register is OK */
444 /* fall through... */
445 case REG_TYPE_NOPC:
446 case REG_TYPE_NOPCX:
447 /* Reject PC (R15) */
448 if (((insn ^ 0xffffffff) & mask) == 0)
449 goto reject;
450 break;
451 }
452
453 /* Replace value of nibble with new register number... */
454 insn &= ~mask;
455 insn |= new_bits & mask;
456 }
457
458 *pinsn = insn;
459 return true;
460
461reject:
462 return false;
463}
464
465static const int decode_struct_sizes[NUM_DECODE_TYPES] = {
466 [DECODE_TYPE_TABLE] = sizeof(struct decode_table),
467 [DECODE_TYPE_CUSTOM] = sizeof(struct decode_custom),
468 [DECODE_TYPE_SIMULATE] = sizeof(struct decode_simulate),
469 [DECODE_TYPE_EMULATE] = sizeof(struct decode_emulate),
470 [DECODE_TYPE_OR] = sizeof(struct decode_or),
471 [DECODE_TYPE_REJECT] = sizeof(struct decode_reject)
472};
473
474/*
475 * kprobe_decode_insn operates on data tables in order to decode an ARM
476 * architecture instruction onto which a kprobe has been placed.
477 *
478 * These instruction decoding tables are a concatenation of entries each
479 * of which consist of one of the following structs:
480 *
481 * decode_table
482 * decode_custom
483 * decode_simulate
484 * decode_emulate
485 * decode_or
486 * decode_reject
487 *
488 * Each of these starts with a struct decode_header which has the following
489 * fields:
490 *
491 * type_regs
492 * mask
493 * value
494 *
495 * The least significant DECODE_TYPE_BITS of type_regs contains a value
496 * from enum decode_type, this indicates which of the decode_* structs
497 * the entry contains. The value DECODE_TYPE_END indicates the end of the
498 * table.
499 *
500 * When the table is parsed, each entry is checked in turn to see if it
501 * matches the instruction to be decoded using the test:
502 *
503 * (insn & mask) == value
504 *
505 * If no match is found before the end of the table is reached then decoding
506 * fails with INSN_REJECTED.
507 *
508 * When a match is found, decode_regs() is called to validate and modify each
509 * of the registers encoded in the instruction; the data it uses to do this
510 * is (type_regs >> DECODE_TYPE_BITS). A validation failure will cause decoding
511 * to fail with INSN_REJECTED.
512 *
513 * Once the instruction has passed the above tests, further processing
514 * depends on the type of the table entry's decode struct.
515 *
516 */
517int __kprobes
518kprobe_decode_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi,
519 const union decode_item *table, bool thumb)
520{
521 const struct decode_header *h = (struct decode_header *)table;
522 const struct decode_header *next;
523 bool matched = false;
524
525 insn = prepare_emulated_insn(insn, asi, thumb);
526
527 for (;; h = next) {
528 enum decode_type type = h->type_regs.bits & DECODE_TYPE_MASK;
529 u32 regs = h->type_regs.bits >> DECODE_TYPE_BITS;
530
531 if (type == DECODE_TYPE_END)
532 return INSN_REJECTED;
533
534 next = (struct decode_header *)
535 ((uintptr_t)h + decode_struct_sizes[type]);
536
537 if (!matched && (insn & h->mask.bits) != h->value.bits)
538 continue;
539
540 if (!decode_regs(&insn, regs))
541 return INSN_REJECTED;
542
543 switch (type) {
544
545 case DECODE_TYPE_TABLE: {
546 struct decode_table *d = (struct decode_table *)h;
547 next = (struct decode_header *)d->table.table;
548 break;
549 }
550
551 case DECODE_TYPE_CUSTOM: {
552 struct decode_custom *d = (struct decode_custom *)h;
553 return (*d->decoder.decoder)(insn, asi);
554 }
555
556 case DECODE_TYPE_SIMULATE: {
557 struct decode_simulate *d = (struct decode_simulate *)h;
558 asi->insn_handler = d->handler.handler;
559 return INSN_GOOD_NO_SLOT;
560 }
561
562 case DECODE_TYPE_EMULATE: {
563 struct decode_emulate *d = (struct decode_emulate *)h;
564 asi->insn_handler = d->handler.handler;
565 set_emulated_insn(insn, asi, thumb);
566 return INSN_GOOD;
567 }
568
569 case DECODE_TYPE_OR:
570 matched = true;
571 break;
572
573 case DECODE_TYPE_REJECT:
574 default:
575 return INSN_REJECTED;
576 }
577 }
578 }
diff --git a/arch/arm/kernel/kprobes-test-arm.c b/arch/arm/kernel/kprobes-test-arm.c
index 839312905067..9db4b659d03e 100644
--- a/arch/arm/kernel/kprobes-test-arm.c
+++ b/arch/arm/kernel/kprobes-test-arm.c
@@ -10,6 +10,8 @@
10 10
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/module.h> 12#include <linux/module.h>
13#include <asm/system_info.h>
14#include <asm/opcodes.h>
13 15
14#include "kprobes-test.h" 16#include "kprobes-test.h"
15 17
@@ -158,9 +160,9 @@ void kprobe_arm_test_cases(void)
158 TEST_SUPPORTED("cmp sp, #0x1000"); 160 TEST_SUPPORTED("cmp sp, #0x1000");
159 161
160 /* Data-processing with PC as shift*/ 162 /* Data-processing with PC as shift*/
161 TEST_UNSUPPORTED(".word 0xe15c0f1e @ cmp r12, r14, asl pc") 163 TEST_UNSUPPORTED(__inst_arm(0xe15c0f1e) " @ cmp r12, r14, asl pc")
162 TEST_UNSUPPORTED(".word 0xe1a0cf1e @ mov r12, r14, asl pc") 164 TEST_UNSUPPORTED(__inst_arm(0xe1a0cf1e) " @ mov r12, r14, asl pc")
163 TEST_UNSUPPORTED(".word 0xe08caf1e @ add r10, r12, r14, asl pc") 165 TEST_UNSUPPORTED(__inst_arm(0xe08caf1e) " @ add r10, r12, r14, asl pc")
164 166
165 /* Data-processing with PC as shift*/ 167 /* Data-processing with PC as shift*/
166 TEST_UNSUPPORTED("movs pc, r1") 168 TEST_UNSUPPORTED("movs pc, r1")
@@ -202,7 +204,7 @@ void kprobe_arm_test_cases(void)
202 TEST("mrs r0, cpsr") 204 TEST("mrs r0, cpsr")
203 TEST("mrspl r7, cpsr") 205 TEST("mrspl r7, cpsr")
204 TEST("mrs r14, cpsr") 206 TEST("mrs r14, cpsr")
205 TEST_UNSUPPORTED(".word 0xe10ff000 @ mrs r15, cpsr") 207 TEST_UNSUPPORTED(__inst_arm(0xe10ff000) " @ mrs r15, cpsr")
206 TEST_UNSUPPORTED("mrs r0, spsr") 208 TEST_UNSUPPORTED("mrs r0, spsr")
207 TEST_UNSUPPORTED("mrs lr, spsr") 209 TEST_UNSUPPORTED("mrs lr, spsr")
208 210
@@ -218,8 +220,8 @@ void kprobe_arm_test_cases(void)
218 TEST_R("clzeq r7, r",14,0x1,"") 220 TEST_R("clzeq r7, r",14,0x1,"")
219 TEST_R("clz lr, r",7, 0xffffffff,"") 221 TEST_R("clz lr, r",7, 0xffffffff,"")
220 TEST( "clz r4, sp") 222 TEST( "clz r4, sp")
221 TEST_UNSUPPORTED(".word 0x016fff10 @ clz pc, r0") 223 TEST_UNSUPPORTED(__inst_arm(0x016fff10) " @ clz pc, r0")
222 TEST_UNSUPPORTED(".word 0x016f0f1f @ clz r0, pc") 224 TEST_UNSUPPORTED(__inst_arm(0x016f0f1f) " @ clz r0, pc")
223 225
224#if __LINUX_ARM_ARCH__ >= 6 226#if __LINUX_ARM_ARCH__ >= 6
225 TEST_UNSUPPORTED("bxj r0") 227 TEST_UNSUPPORTED("bxj r0")
@@ -228,7 +230,7 @@ void kprobe_arm_test_cases(void)
228 TEST_BF_R("blx r",0,2f,"") 230 TEST_BF_R("blx r",0,2f,"")
229 TEST_BB_R("blx r",7,2f,"") 231 TEST_BB_R("blx r",7,2f,"")
230 TEST_BF_R("blxeq r",14,2f,"") 232 TEST_BF_R("blxeq r",14,2f,"")
231 TEST_UNSUPPORTED(".word 0x0120003f @ blx pc") 233 TEST_UNSUPPORTED(__inst_arm(0x0120003f) " @ blx pc")
232 234
233 TEST_RR( "qadd r0, r",1, VAL1,", r",2, VAL2,"") 235 TEST_RR( "qadd r0, r",1, VAL1,", r",2, VAL2,"")
234 TEST_RR( "qaddvs lr, r",9, VAL2,", r",8, VAL1,"") 236 TEST_RR( "qaddvs lr, r",9, VAL2,", r",8, VAL1,"")
@@ -242,190 +244,190 @@ void kprobe_arm_test_cases(void)
242 TEST_RR( "qdsub r0, r",1, VAL1,", r",2, VAL2,"") 244 TEST_RR( "qdsub r0, r",1, VAL1,", r",2, VAL2,"")
243 TEST_RR( "qdsubvs lr, r",9, VAL2,", r",8, VAL1,"") 245 TEST_RR( "qdsubvs lr, r",9, VAL2,", r",8, VAL1,"")
244 TEST_R( "qdsub lr, r",9, VAL2,", r13") 246 TEST_R( "qdsub lr, r",9, VAL2,", r13")
245 TEST_UNSUPPORTED(".word 0xe101f050 @ qadd pc, r0, r1") 247 TEST_UNSUPPORTED(__inst_arm(0xe101f050) " @ qadd pc, r0, r1")
246 TEST_UNSUPPORTED(".word 0xe121f050 @ qsub pc, r0, r1") 248 TEST_UNSUPPORTED(__inst_arm(0xe121f050) " @ qsub pc, r0, r1")
247 TEST_UNSUPPORTED(".word 0xe141f050 @ qdadd pc, r0, r1") 249 TEST_UNSUPPORTED(__inst_arm(0xe141f050) " @ qdadd pc, r0, r1")
248 TEST_UNSUPPORTED(".word 0xe161f050 @ qdsub pc, r0, r1") 250 TEST_UNSUPPORTED(__inst_arm(0xe161f050) " @ qdsub pc, r0, r1")
249 TEST_UNSUPPORTED(".word 0xe16f2050 @ qdsub r2, r0, pc") 251 TEST_UNSUPPORTED(__inst_arm(0xe16f2050) " @ qdsub r2, r0, pc")
250 TEST_UNSUPPORTED(".word 0xe161205f @ qdsub r2, pc, r1") 252 TEST_UNSUPPORTED(__inst_arm(0xe161205f) " @ qdsub r2, pc, r1")
251 253
252 TEST_UNSUPPORTED("bkpt 0xffff") 254 TEST_UNSUPPORTED("bkpt 0xffff")
253 TEST_UNSUPPORTED("bkpt 0x0000") 255 TEST_UNSUPPORTED("bkpt 0x0000")
254 256
255 TEST_UNSUPPORTED(".word 0xe1600070 @ smc #0") 257 TEST_UNSUPPORTED(__inst_arm(0xe1600070) " @ smc #0")
256 258
257 TEST_GROUP("Halfword multiply and multiply-accumulate") 259 TEST_GROUP("Halfword multiply and multiply-accumulate")
258 260
259 TEST_RRR( "smlabb r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"") 261 TEST_RRR( "smlabb r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
260 TEST_RRR( "smlabbge r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"") 262 TEST_RRR( "smlabbge r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
261 TEST_RR( "smlabb lr, r",1, VAL2,", r",2, VAL3,", r13") 263 TEST_RR( "smlabb lr, r",1, VAL2,", r",2, VAL3,", r13")
262 TEST_UNSUPPORTED(".word 0xe10f3281 @ smlabb pc, r1, r2, r3") 264 TEST_UNSUPPORTED(__inst_arm(0xe10f3281) " @ smlabb pc, r1, r2, r3")
263 TEST_RRR( "smlatb r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"") 265 TEST_RRR( "smlatb r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
264 TEST_RRR( "smlatbge r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"") 266 TEST_RRR( "smlatbge r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
265 TEST_RR( "smlatb lr, r",1, VAL2,", r",2, VAL3,", r13") 267 TEST_RR( "smlatb lr, r",1, VAL2,", r",2, VAL3,", r13")
266 TEST_UNSUPPORTED(".word 0xe10f32a1 @ smlatb pc, r1, r2, r3") 268 TEST_UNSUPPORTED(__inst_arm(0xe10f32a1) " @ smlatb pc, r1, r2, r3")
267 TEST_RRR( "smlabt r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"") 269 TEST_RRR( "smlabt r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
268 TEST_RRR( "smlabtge r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"") 270 TEST_RRR( "smlabtge r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
269 TEST_RR( "smlabt lr, r",1, VAL2,", r",2, VAL3,", r13") 271 TEST_RR( "smlabt lr, r",1, VAL2,", r",2, VAL3,", r13")
270 TEST_UNSUPPORTED(".word 0xe10f32c1 @ smlabt pc, r1, r2, r3") 272 TEST_UNSUPPORTED(__inst_arm(0xe10f32c1) " @ smlabt pc, r1, r2, r3")
271 TEST_RRR( "smlatt r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"") 273 TEST_RRR( "smlatt r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
272 TEST_RRR( "smlattge r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"") 274 TEST_RRR( "smlattge r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
273 TEST_RR( "smlatt lr, r",1, VAL2,", r",2, VAL3,", r13") 275 TEST_RR( "smlatt lr, r",1, VAL2,", r",2, VAL3,", r13")
274 TEST_UNSUPPORTED(".word 0xe10f32e1 @ smlatt pc, r1, r2, r3") 276 TEST_UNSUPPORTED(__inst_arm(0xe10f32e1) " @ smlatt pc, r1, r2, r3")
275 277
276 TEST_RRR( "smlawb r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"") 278 TEST_RRR( "smlawb r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
277 TEST_RRR( "smlawbge r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"") 279 TEST_RRR( "smlawbge r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
278 TEST_RR( "smlawb lr, r",1, VAL2,", r",2, VAL3,", r13") 280 TEST_RR( "smlawb lr, r",1, VAL2,", r",2, VAL3,", r13")
279 TEST_UNSUPPORTED(".word 0xe12f3281 @ smlawb pc, r1, r2, r3") 281 TEST_UNSUPPORTED(__inst_arm(0xe12f3281) " @ smlawb pc, r1, r2, r3")
280 TEST_RRR( "smlawt r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"") 282 TEST_RRR( "smlawt r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
281 TEST_RRR( "smlawtge r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"") 283 TEST_RRR( "smlawtge r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
282 TEST_RR( "smlawt lr, r",1, VAL2,", r",2, VAL3,", r13") 284 TEST_RR( "smlawt lr, r",1, VAL2,", r",2, VAL3,", r13")
283 TEST_UNSUPPORTED(".word 0xe12f32c1 @ smlawt pc, r1, r2, r3") 285 TEST_UNSUPPORTED(__inst_arm(0xe12f32c1) " @ smlawt pc, r1, r2, r3")
284 TEST_UNSUPPORTED(".word 0xe12032cf @ smlawt r0, pc, r2, r3") 286 TEST_UNSUPPORTED(__inst_arm(0xe12032cf) " @ smlawt r0, pc, r2, r3")
285 TEST_UNSUPPORTED(".word 0xe1203fc1 @ smlawt r0, r1, pc, r3") 287 TEST_UNSUPPORTED(__inst_arm(0xe1203fc1) " @ smlawt r0, r1, pc, r3")
286 TEST_UNSUPPORTED(".word 0xe120f2c1 @ smlawt r0, r1, r2, pc") 288 TEST_UNSUPPORTED(__inst_arm(0xe120f2c1) " @ smlawt r0, r1, r2, pc")
287 289
288 TEST_RR( "smulwb r0, r",1, VAL1,", r",2, VAL2,"") 290 TEST_RR( "smulwb r0, r",1, VAL1,", r",2, VAL2,"")
289 TEST_RR( "smulwbge r7, r",8, VAL3,", r",9, VAL1,"") 291 TEST_RR( "smulwbge r7, r",8, VAL3,", r",9, VAL1,"")
290 TEST_R( "smulwb lr, r",1, VAL2,", r13") 292 TEST_R( "smulwb lr, r",1, VAL2,", r13")
291 TEST_UNSUPPORTED(".word 0xe12f02a1 @ smulwb pc, r1, r2") 293 TEST_UNSUPPORTED(__inst_arm(0xe12f02a1) " @ smulwb pc, r1, r2")
292 TEST_RR( "smulwt r0, r",1, VAL1,", r",2, VAL2,"") 294 TEST_RR( "smulwt r0, r",1, VAL1,", r",2, VAL2,"")
293 TEST_RR( "smulwtge r7, r",8, VAL3,", r",9, VAL1,"") 295 TEST_RR( "smulwtge r7, r",8, VAL3,", r",9, VAL1,"")
294 TEST_R( "smulwt lr, r",1, VAL2,", r13") 296 TEST_R( "smulwt lr, r",1, VAL2,", r13")
295 TEST_UNSUPPORTED(".word 0xe12f02e1 @ smulwt pc, r1, r2") 297 TEST_UNSUPPORTED(__inst_arm(0xe12f02e1) " @ smulwt pc, r1, r2")
296 298
297 TEST_RRRR( "smlalbb r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4) 299 TEST_RRRR( "smlalbb r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
298 TEST_RRRR( "smlalbble r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3) 300 TEST_RRRR( "smlalbble r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
299 TEST_RRR( "smlalbb r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13") 301 TEST_RRR( "smlalbb r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
300 TEST_UNSUPPORTED(".word 0xe14f1382 @ smlalbb pc, r1, r2, r3") 302 TEST_UNSUPPORTED(__inst_arm(0xe14f1382) " @ smlalbb pc, r1, r2, r3")
301 TEST_UNSUPPORTED(".word 0xe141f382 @ smlalbb r1, pc, r2, r3") 303 TEST_UNSUPPORTED(__inst_arm(0xe141f382) " @ smlalbb r1, pc, r2, r3")
302 TEST_RRRR( "smlaltb r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4) 304 TEST_RRRR( "smlaltb r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
303 TEST_RRRR( "smlaltble r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3) 305 TEST_RRRR( "smlaltble r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
304 TEST_RRR( "smlaltb r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13") 306 TEST_RRR( "smlaltb r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
305 TEST_UNSUPPORTED(".word 0xe14f13a2 @ smlaltb pc, r1, r2, r3") 307 TEST_UNSUPPORTED(__inst_arm(0xe14f13a2) " @ smlaltb pc, r1, r2, r3")
306 TEST_UNSUPPORTED(".word 0xe141f3a2 @ smlaltb r1, pc, r2, r3") 308 TEST_UNSUPPORTED(__inst_arm(0xe141f3a2) " @ smlaltb r1, pc, r2, r3")
307 TEST_RRRR( "smlalbt r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4) 309 TEST_RRRR( "smlalbt r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
308 TEST_RRRR( "smlalbtle r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3) 310 TEST_RRRR( "smlalbtle r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
309 TEST_RRR( "smlalbt r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13") 311 TEST_RRR( "smlalbt r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
310 TEST_UNSUPPORTED(".word 0xe14f13c2 @ smlalbt pc, r1, r2, r3") 312 TEST_UNSUPPORTED(__inst_arm(0xe14f13c2) " @ smlalbt pc, r1, r2, r3")
311 TEST_UNSUPPORTED(".word 0xe141f3c2 @ smlalbt r1, pc, r2, r3") 313 TEST_UNSUPPORTED(__inst_arm(0xe141f3c2) " @ smlalbt r1, pc, r2, r3")
312 TEST_RRRR( "smlaltt r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4) 314 TEST_RRRR( "smlaltt r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
313 TEST_RRRR( "smlalttle r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3) 315 TEST_RRRR( "smlalttle r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
314 TEST_RRR( "smlaltt r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13") 316 TEST_RRR( "smlaltt r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
315 TEST_UNSUPPORTED(".word 0xe14f13e2 @ smlalbb pc, r1, r2, r3") 317 TEST_UNSUPPORTED(__inst_arm(0xe14f13e2) " @ smlalbb pc, r1, r2, r3")
316 TEST_UNSUPPORTED(".word 0xe140f3e2 @ smlalbb r0, pc, r2, r3") 318 TEST_UNSUPPORTED(__inst_arm(0xe140f3e2) " @ smlalbb r0, pc, r2, r3")
317 TEST_UNSUPPORTED(".word 0xe14013ef @ smlalbb r0, r1, pc, r3") 319 TEST_UNSUPPORTED(__inst_arm(0xe14013ef) " @ smlalbb r0, r1, pc, r3")
318 TEST_UNSUPPORTED(".word 0xe1401fe2 @ smlalbb r0, r1, r2, pc") 320 TEST_UNSUPPORTED(__inst_arm(0xe1401fe2) " @ smlalbb r0, r1, r2, pc")
319 321
320 TEST_RR( "smulbb r0, r",1, VAL1,", r",2, VAL2,"") 322 TEST_RR( "smulbb r0, r",1, VAL1,", r",2, VAL2,"")
321 TEST_RR( "smulbbge r7, r",8, VAL3,", r",9, VAL1,"") 323 TEST_RR( "smulbbge r7, r",8, VAL3,", r",9, VAL1,"")
322 TEST_R( "smulbb lr, r",1, VAL2,", r13") 324 TEST_R( "smulbb lr, r",1, VAL2,", r13")
323 TEST_UNSUPPORTED(".word 0xe16f0281 @ smulbb pc, r1, r2") 325 TEST_UNSUPPORTED(__inst_arm(0xe16f0281) " @ smulbb pc, r1, r2")
324 TEST_RR( "smultb r0, r",1, VAL1,", r",2, VAL2,"") 326 TEST_RR( "smultb r0, r",1, VAL1,", r",2, VAL2,"")
325 TEST_RR( "smultbge r7, r",8, VAL3,", r",9, VAL1,"") 327 TEST_RR( "smultbge r7, r",8, VAL3,", r",9, VAL1,"")
326 TEST_R( "smultb lr, r",1, VAL2,", r13") 328 TEST_R( "smultb lr, r",1, VAL2,", r13")
327 TEST_UNSUPPORTED(".word 0xe16f02a1 @ smultb pc, r1, r2") 329 TEST_UNSUPPORTED(__inst_arm(0xe16f02a1) " @ smultb pc, r1, r2")
328 TEST_RR( "smulbt r0, r",1, VAL1,", r",2, VAL2,"") 330 TEST_RR( "smulbt r0, r",1, VAL1,", r",2, VAL2,"")
329 TEST_RR( "smulbtge r7, r",8, VAL3,", r",9, VAL1,"") 331 TEST_RR( "smulbtge r7, r",8, VAL3,", r",9, VAL1,"")
330 TEST_R( "smulbt lr, r",1, VAL2,", r13") 332 TEST_R( "smulbt lr, r",1, VAL2,", r13")
331 TEST_UNSUPPORTED(".word 0xe16f02c1 @ smultb pc, r1, r2") 333 TEST_UNSUPPORTED(__inst_arm(0xe16f02c1) " @ smultb pc, r1, r2")
332 TEST_RR( "smultt r0, r",1, VAL1,", r",2, VAL2,"") 334 TEST_RR( "smultt r0, r",1, VAL1,", r",2, VAL2,"")
333 TEST_RR( "smulttge r7, r",8, VAL3,", r",9, VAL1,"") 335 TEST_RR( "smulttge r7, r",8, VAL3,", r",9, VAL1,"")
334 TEST_R( "smultt lr, r",1, VAL2,", r13") 336 TEST_R( "smultt lr, r",1, VAL2,", r13")
335 TEST_UNSUPPORTED(".word 0xe16f02e1 @ smultt pc, r1, r2") 337 TEST_UNSUPPORTED(__inst_arm(0xe16f02e1) " @ smultt pc, r1, r2")
336 TEST_UNSUPPORTED(".word 0xe16002ef @ smultt r0, pc, r2") 338 TEST_UNSUPPORTED(__inst_arm(0xe16002ef) " @ smultt r0, pc, r2")
337 TEST_UNSUPPORTED(".word 0xe1600fe1 @ smultt r0, r1, pc") 339 TEST_UNSUPPORTED(__inst_arm(0xe1600fe1) " @ smultt r0, r1, pc")
338 340
339 TEST_GROUP("Multiply and multiply-accumulate") 341 TEST_GROUP("Multiply and multiply-accumulate")
340 342
341 TEST_RR( "mul r0, r",1, VAL1,", r",2, VAL2,"") 343 TEST_RR( "mul r0, r",1, VAL1,", r",2, VAL2,"")
342 TEST_RR( "mulls r7, r",8, VAL2,", r",9, VAL2,"") 344 TEST_RR( "mulls r7, r",8, VAL2,", r",9, VAL2,"")
343 TEST_R( "mul lr, r",4, VAL3,", r13") 345 TEST_R( "mul lr, r",4, VAL3,", r13")
344 TEST_UNSUPPORTED(".word 0xe00f0291 @ mul pc, r1, r2") 346 TEST_UNSUPPORTED(__inst_arm(0xe00f0291) " @ mul pc, r1, r2")
345 TEST_UNSUPPORTED(".word 0xe000029f @ mul r0, pc, r2") 347 TEST_UNSUPPORTED(__inst_arm(0xe000029f) " @ mul r0, pc, r2")
346 TEST_UNSUPPORTED(".word 0xe0000f91 @ mul r0, r1, pc") 348 TEST_UNSUPPORTED(__inst_arm(0xe0000f91) " @ mul r0, r1, pc")
347 TEST_RR( "muls r0, r",1, VAL1,", r",2, VAL2,"") 349 TEST_RR( "muls r0, r",1, VAL1,", r",2, VAL2,"")
348 TEST_RR( "mullss r7, r",8, VAL2,", r",9, VAL2,"") 350 TEST_RR( "mullss r7, r",8, VAL2,", r",9, VAL2,"")
349 TEST_R( "muls lr, r",4, VAL3,", r13") 351 TEST_R( "muls lr, r",4, VAL3,", r13")
350 TEST_UNSUPPORTED(".word 0xe01f0291 @ muls pc, r1, r2") 352 TEST_UNSUPPORTED(__inst_arm(0xe01f0291) " @ muls pc, r1, r2")
351 353
352 TEST_RRR( "mla r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"") 354 TEST_RRR( "mla r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
353 TEST_RRR( "mlahi r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"") 355 TEST_RRR( "mlahi r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
354 TEST_RR( "mla lr, r",1, VAL2,", r",2, VAL3,", r13") 356 TEST_RR( "mla lr, r",1, VAL2,", r",2, VAL3,", r13")
355 TEST_UNSUPPORTED(".word 0xe02f3291 @ mla pc, r1, r2, r3") 357 TEST_UNSUPPORTED(__inst_arm(0xe02f3291) " @ mla pc, r1, r2, r3")
356 TEST_RRR( "mlas r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"") 358 TEST_RRR( "mlas r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
357 TEST_RRR( "mlahis r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"") 359 TEST_RRR( "mlahis r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
358 TEST_RR( "mlas lr, r",1, VAL2,", r",2, VAL3,", r13") 360 TEST_RR( "mlas lr, r",1, VAL2,", r",2, VAL3,", r13")
359 TEST_UNSUPPORTED(".word 0xe03f3291 @ mlas pc, r1, r2, r3") 361 TEST_UNSUPPORTED(__inst_arm(0xe03f3291) " @ mlas pc, r1, r2, r3")
360 362
361#if __LINUX_ARM_ARCH__ >= 6 363#if __LINUX_ARM_ARCH__ >= 6
362 TEST_RR( "umaal r0, r1, r",2, VAL1,", r",3, VAL2,"") 364 TEST_RR( "umaal r0, r1, r",2, VAL1,", r",3, VAL2,"")
363 TEST_RR( "umaalls r7, r8, r",9, VAL2,", r",10, VAL1,"") 365 TEST_RR( "umaalls r7, r8, r",9, VAL2,", r",10, VAL1,"")
364 TEST_R( "umaal lr, r12, r",11,VAL3,", r13") 366 TEST_R( "umaal lr, r12, r",11,VAL3,", r13")
365 TEST_UNSUPPORTED(".word 0xe041f392 @ umaal pc, r1, r2, r3") 367 TEST_UNSUPPORTED(__inst_arm(0xe041f392) " @ umaal pc, r1, r2, r3")
366 TEST_UNSUPPORTED(".word 0xe04f0392 @ umaal r0, pc, r2, r3") 368 TEST_UNSUPPORTED(__inst_arm(0xe04f0392) " @ umaal r0, pc, r2, r3")
367 TEST_UNSUPPORTED(".word 0xe0500090 @ undef") 369 TEST_UNSUPPORTED(__inst_arm(0xe0500090) " @ undef")
368 TEST_UNSUPPORTED(".word 0xe05fff9f @ undef") 370 TEST_UNSUPPORTED(__inst_arm(0xe05fff9f) " @ undef")
369#endif 371#endif
370 372
371#if __LINUX_ARM_ARCH__ >= 7 373#if __LINUX_ARM_ARCH__ >= 7
372 TEST_RRR( "mls r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"") 374 TEST_RRR( "mls r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
373 TEST_RRR( "mlshi r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"") 375 TEST_RRR( "mlshi r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
374 TEST_RR( "mls lr, r",1, VAL2,", r",2, VAL3,", r13") 376 TEST_RR( "mls lr, r",1, VAL2,", r",2, VAL3,", r13")
375 TEST_UNSUPPORTED(".word 0xe06f3291 @ mls pc, r1, r2, r3") 377 TEST_UNSUPPORTED(__inst_arm(0xe06f3291) " @ mls pc, r1, r2, r3")
376 TEST_UNSUPPORTED(".word 0xe060329f @ mls r0, pc, r2, r3") 378 TEST_UNSUPPORTED(__inst_arm(0xe060329f) " @ mls r0, pc, r2, r3")
377 TEST_UNSUPPORTED(".word 0xe0603f91 @ mls r0, r1, pc, r3") 379 TEST_UNSUPPORTED(__inst_arm(0xe0603f91) " @ mls r0, r1, pc, r3")
378 TEST_UNSUPPORTED(".word 0xe060f291 @ mls r0, r1, r2, pc") 380 TEST_UNSUPPORTED(__inst_arm(0xe060f291) " @ mls r0, r1, r2, pc")
379#endif 381#endif
380 382
381 TEST_UNSUPPORTED(".word 0xe0700090 @ undef") 383 TEST_UNSUPPORTED(__inst_arm(0xe0700090) " @ undef")
382 TEST_UNSUPPORTED(".word 0xe07fff9f @ undef") 384 TEST_UNSUPPORTED(__inst_arm(0xe07fff9f) " @ undef")
383 385
384 TEST_RR( "umull r0, r1, r",2, VAL1,", r",3, VAL2,"") 386 TEST_RR( "umull r0, r1, r",2, VAL1,", r",3, VAL2,"")
385 TEST_RR( "umullls r7, r8, r",9, VAL2,", r",10, VAL1,"") 387 TEST_RR( "umullls r7, r8, r",9, VAL2,", r",10, VAL1,"")
386 TEST_R( "umull lr, r12, r",11,VAL3,", r13") 388 TEST_R( "umull lr, r12, r",11,VAL3,", r13")
387 TEST_UNSUPPORTED(".word 0xe081f392 @ umull pc, r1, r2, r3") 389 TEST_UNSUPPORTED(__inst_arm(0xe081f392) " @ umull pc, r1, r2, r3")
388 TEST_UNSUPPORTED(".word 0xe08f1392 @ umull r1, pc, r2, r3") 390 TEST_UNSUPPORTED(__inst_arm(0xe08f1392) " @ umull r1, pc, r2, r3")
389 TEST_RR( "umulls r0, r1, r",2, VAL1,", r",3, VAL2,"") 391 TEST_RR( "umulls r0, r1, r",2, VAL1,", r",3, VAL2,"")
390 TEST_RR( "umulllss r7, r8, r",9, VAL2,", r",10, VAL1,"") 392 TEST_RR( "umulllss r7, r8, r",9, VAL2,", r",10, VAL1,"")
391 TEST_R( "umulls lr, r12, r",11,VAL3,", r13") 393 TEST_R( "umulls lr, r12, r",11,VAL3,", r13")
392 TEST_UNSUPPORTED(".word 0xe091f392 @ umulls pc, r1, r2, r3") 394 TEST_UNSUPPORTED(__inst_arm(0xe091f392) " @ umulls pc, r1, r2, r3")
393 TEST_UNSUPPORTED(".word 0xe09f1392 @ umulls r1, pc, r2, r3") 395 TEST_UNSUPPORTED(__inst_arm(0xe09f1392) " @ umulls r1, pc, r2, r3")
394 396
395 TEST_RRRR( "umlal r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4) 397 TEST_RRRR( "umlal r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
396 TEST_RRRR( "umlalle r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3) 398 TEST_RRRR( "umlalle r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
397 TEST_RRR( "umlal r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13") 399 TEST_RRR( "umlal r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
398 TEST_UNSUPPORTED(".word 0xe0af1392 @ umlal pc, r1, r2, r3") 400 TEST_UNSUPPORTED(__inst_arm(0xe0af1392) " @ umlal pc, r1, r2, r3")
399 TEST_UNSUPPORTED(".word 0xe0a1f392 @ umlal r1, pc, r2, r3") 401 TEST_UNSUPPORTED(__inst_arm(0xe0a1f392) " @ umlal r1, pc, r2, r3")
400 TEST_RRRR( "umlals r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4) 402 TEST_RRRR( "umlals r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
401 TEST_RRRR( "umlalles r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3) 403 TEST_RRRR( "umlalles r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
402 TEST_RRR( "umlals r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13") 404 TEST_RRR( "umlals r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
403 TEST_UNSUPPORTED(".word 0xe0bf1392 @ umlals pc, r1, r2, r3") 405 TEST_UNSUPPORTED(__inst_arm(0xe0bf1392) " @ umlals pc, r1, r2, r3")
404 TEST_UNSUPPORTED(".word 0xe0b1f392 @ umlals r1, pc, r2, r3") 406 TEST_UNSUPPORTED(__inst_arm(0xe0b1f392) " @ umlals r1, pc, r2, r3")
405 407
406 TEST_RR( "smull r0, r1, r",2, VAL1,", r",3, VAL2,"") 408 TEST_RR( "smull r0, r1, r",2, VAL1,", r",3, VAL2,"")
407 TEST_RR( "smullls r7, r8, r",9, VAL2,", r",10, VAL1,"") 409 TEST_RR( "smullls r7, r8, r",9, VAL2,", r",10, VAL1,"")
408 TEST_R( "smull lr, r12, r",11,VAL3,", r13") 410 TEST_R( "smull lr, r12, r",11,VAL3,", r13")
409 TEST_UNSUPPORTED(".word 0xe0c1f392 @ smull pc, r1, r2, r3") 411 TEST_UNSUPPORTED(__inst_arm(0xe0c1f392) " @ smull pc, r1, r2, r3")
410 TEST_UNSUPPORTED(".word 0xe0cf1392 @ smull r1, pc, r2, r3") 412 TEST_UNSUPPORTED(__inst_arm(0xe0cf1392) " @ smull r1, pc, r2, r3")
411 TEST_RR( "smulls r0, r1, r",2, VAL1,", r",3, VAL2,"") 413 TEST_RR( "smulls r0, r1, r",2, VAL1,", r",3, VAL2,"")
412 TEST_RR( "smulllss r7, r8, r",9, VAL2,", r",10, VAL1,"") 414 TEST_RR( "smulllss r7, r8, r",9, VAL2,", r",10, VAL1,"")
413 TEST_R( "smulls lr, r12, r",11,VAL3,", r13") 415 TEST_R( "smulls lr, r12, r",11,VAL3,", r13")
414 TEST_UNSUPPORTED(".word 0xe0d1f392 @ smulls pc, r1, r2, r3") 416 TEST_UNSUPPORTED(__inst_arm(0xe0d1f392) " @ smulls pc, r1, r2, r3")
415 TEST_UNSUPPORTED(".word 0xe0df1392 @ smulls r1, pc, r2, r3") 417 TEST_UNSUPPORTED(__inst_arm(0xe0df1392) " @ smulls r1, pc, r2, r3")
416 418
417 TEST_RRRR( "smlal r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4) 419 TEST_RRRR( "smlal r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
418 TEST_RRRR( "smlalle r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3) 420 TEST_RRRR( "smlalle r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
419 TEST_RRR( "smlal r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13") 421 TEST_RRR( "smlal r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
420 TEST_UNSUPPORTED(".word 0xe0ef1392 @ smlal pc, r1, r2, r3") 422 TEST_UNSUPPORTED(__inst_arm(0xe0ef1392) " @ smlal pc, r1, r2, r3")
421 TEST_UNSUPPORTED(".word 0xe0e1f392 @ smlal r1, pc, r2, r3") 423 TEST_UNSUPPORTED(__inst_arm(0xe0e1f392) " @ smlal r1, pc, r2, r3")
422 TEST_RRRR( "smlals r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4) 424 TEST_RRRR( "smlals r",0, VAL1,", r",1, VAL2,", r",2, VAL3,", r",3, VAL4)
423 TEST_RRRR( "smlalles r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3) 425 TEST_RRRR( "smlalles r",8, VAL4,", r",9, VAL1,", r",10,VAL2,", r",11,VAL3)
424 TEST_RRR( "smlals r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13") 426 TEST_RRR( "smlals r",14,VAL3,", r",7, VAL4,", r",5, VAL1,", r13")
425 TEST_UNSUPPORTED(".word 0xe0ff1392 @ smlals pc, r1, r2, r3") 427 TEST_UNSUPPORTED(__inst_arm(0xe0ff1392) " @ smlals pc, r1, r2, r3")
426 TEST_UNSUPPORTED(".word 0xe0f0f392 @ smlals r0, pc, r2, r3") 428 TEST_UNSUPPORTED(__inst_arm(0xe0f0f392) " @ smlals r0, pc, r2, r3")
427 TEST_UNSUPPORTED(".word 0xe0f0139f @ smlals r0, r1, pc, r3") 429 TEST_UNSUPPORTED(__inst_arm(0xe0f0139f) " @ smlals r0, r1, pc, r3")
428 TEST_UNSUPPORTED(".word 0xe0f01f92 @ smlals r0, r1, r2, pc") 430 TEST_UNSUPPORTED(__inst_arm(0xe0f01f92) " @ smlals r0, r1, r2, pc")
429 431
430 TEST_GROUP("Synchronization primitives") 432 TEST_GROUP("Synchronization primitives")
431 433
@@ -434,28 +436,28 @@ void kprobe_arm_test_cases(void)
434 TEST_R( "swpvs r0, r",1,VAL1,", [sp]") 436 TEST_R( "swpvs r0, r",1,VAL1,", [sp]")
435 TEST_RP("swp sp, r",14,VAL2,", [r",12,13*4,"]") 437 TEST_RP("swp sp, r",14,VAL2,", [r",12,13*4,"]")
436#else 438#else
437 TEST_UNSUPPORTED(".word 0xe108e097 @ swp lr, r7, [r8]") 439 TEST_UNSUPPORTED(__inst_arm(0xe108e097) " @ swp lr, r7, [r8]")
438 TEST_UNSUPPORTED(".word 0x610d0091 @ swpvs r0, r1, [sp]") 440 TEST_UNSUPPORTED(__inst_arm(0x610d0091) " @ swpvs r0, r1, [sp]")
439 TEST_UNSUPPORTED(".word 0xe10cd09e @ swp sp, r14 [r12]") 441 TEST_UNSUPPORTED(__inst_arm(0xe10cd09e) " @ swp sp, r14 [r12]")
440#endif 442#endif
441 TEST_UNSUPPORTED(".word 0xe102f091 @ swp pc, r1, [r2]") 443 TEST_UNSUPPORTED(__inst_arm(0xe102f091) " @ swp pc, r1, [r2]")
442 TEST_UNSUPPORTED(".word 0xe102009f @ swp r0, pc, [r2]") 444 TEST_UNSUPPORTED(__inst_arm(0xe102009f) " @ swp r0, pc, [r2]")
443 TEST_UNSUPPORTED(".word 0xe10f0091 @ swp r0, r1, [pc]") 445 TEST_UNSUPPORTED(__inst_arm(0xe10f0091) " @ swp r0, r1, [pc]")
444#if __LINUX_ARM_ARCH__ < 6 446#if __LINUX_ARM_ARCH__ < 6
445 TEST_RP("swpb lr, r",7,VAL2,", [r",8,0,"]") 447 TEST_RP("swpb lr, r",7,VAL2,", [r",8,0,"]")
446 TEST_R( "swpvsb r0, r",1,VAL1,", [sp]") 448 TEST_R( "swpvsb r0, r",1,VAL1,", [sp]")
447#else 449#else
448 TEST_UNSUPPORTED(".word 0xe148e097 @ swpb lr, r7, [r8]") 450 TEST_UNSUPPORTED(__inst_arm(0xe148e097) " @ swpb lr, r7, [r8]")
449 TEST_UNSUPPORTED(".word 0x614d0091 @ swpvsb r0, r1, [sp]") 451 TEST_UNSUPPORTED(__inst_arm(0x614d0091) " @ swpvsb r0, r1, [sp]")
450#endif 452#endif
451 TEST_UNSUPPORTED(".word 0xe142f091 @ swpb pc, r1, [r2]") 453 TEST_UNSUPPORTED(__inst_arm(0xe142f091) " @ swpb pc, r1, [r2]")
452 454
453 TEST_UNSUPPORTED(".word 0xe1100090") /* Unallocated space */ 455 TEST_UNSUPPORTED(__inst_arm(0xe1100090)) /* Unallocated space */
454 TEST_UNSUPPORTED(".word 0xe1200090") /* Unallocated space */ 456 TEST_UNSUPPORTED(__inst_arm(0xe1200090)) /* Unallocated space */
455 TEST_UNSUPPORTED(".word 0xe1300090") /* Unallocated space */ 457 TEST_UNSUPPORTED(__inst_arm(0xe1300090)) /* Unallocated space */
456 TEST_UNSUPPORTED(".word 0xe1500090") /* Unallocated space */ 458 TEST_UNSUPPORTED(__inst_arm(0xe1500090)) /* Unallocated space */
457 TEST_UNSUPPORTED(".word 0xe1600090") /* Unallocated space */ 459 TEST_UNSUPPORTED(__inst_arm(0xe1600090)) /* Unallocated space */
458 TEST_UNSUPPORTED(".word 0xe1700090") /* Unallocated space */ 460 TEST_UNSUPPORTED(__inst_arm(0xe1700090)) /* Unallocated space */
459#if __LINUX_ARM_ARCH__ >= 6 461#if __LINUX_ARM_ARCH__ >= 6
460 TEST_UNSUPPORTED("ldrex r2, [sp]") 462 TEST_UNSUPPORTED("ldrex r2, [sp]")
461#endif 463#endif
@@ -475,9 +477,9 @@ void kprobe_arm_test_cases(void)
475 TEST_RPR( "strneh r",12,VAL2,", [r",11,48,", -r",10,24,"]!") 477 TEST_RPR( "strneh r",12,VAL2,", [r",11,48,", -r",10,24,"]!")
476 TEST_RPR( "strh r",2, VAL1,", [r",3, 24,"], r",4, 48,"") 478 TEST_RPR( "strh r",2, VAL1,", [r",3, 24,"], r",4, 48,"")
477 TEST_RPR( "strh r",10,VAL2,", [r",9, 48,"], -r",11,24,"") 479 TEST_RPR( "strh r",10,VAL2,", [r",9, 48,"], -r",11,24,"")
478 TEST_UNSUPPORTED(".word 0xe1afc0ba @ strh r12, [pc, r10]!") 480 TEST_UNSUPPORTED(__inst_arm(0xe1afc0ba) " @ strh r12, [pc, r10]!")
479 TEST_UNSUPPORTED(".word 0xe089f0bb @ strh pc, [r9], r11") 481 TEST_UNSUPPORTED(__inst_arm(0xe089f0bb) " @ strh pc, [r9], r11")
480 TEST_UNSUPPORTED(".word 0xe089a0bf @ strh r10, [r9], pc") 482 TEST_UNSUPPORTED(__inst_arm(0xe089a0bf) " @ strh r10, [r9], pc")
481 483
482 TEST_PR( "ldrh r0, [r",0, 48,", -r",2, 24,"]") 484 TEST_PR( "ldrh r0, [r",0, 48,", -r",2, 24,"]")
483 TEST_PR( "ldrcsh r14, [r",13,0, ", r",12, 48,"]") 485 TEST_PR( "ldrcsh r14, [r",13,0, ", r",12, 48,"]")
@@ -485,9 +487,9 @@ void kprobe_arm_test_cases(void)
485 TEST_PR( "ldrcch r12, [r",11,48,", -r",10,24,"]!") 487 TEST_PR( "ldrcch r12, [r",11,48,", -r",10,24,"]!")
486 TEST_PR( "ldrh r2, [r",3, 24,"], r",4, 48,"") 488 TEST_PR( "ldrh r2, [r",3, 24,"], r",4, 48,"")
487 TEST_PR( "ldrh r10, [r",9, 48,"], -r",11,24,"") 489 TEST_PR( "ldrh r10, [r",9, 48,"], -r",11,24,"")
488 TEST_UNSUPPORTED(".word 0xe1bfc0ba @ ldrh r12, [pc, r10]!") 490 TEST_UNSUPPORTED(__inst_arm(0xe1bfc0ba) " @ ldrh r12, [pc, r10]!")
489 TEST_UNSUPPORTED(".word 0xe099f0bb @ ldrh pc, [r9], r11") 491 TEST_UNSUPPORTED(__inst_arm(0xe099f0bb) " @ ldrh pc, [r9], r11")
490 TEST_UNSUPPORTED(".word 0xe099a0bf @ ldrh r10, [r9], pc") 492 TEST_UNSUPPORTED(__inst_arm(0xe099a0bf) " @ ldrh r10, [r9], pc")
491 493
492 TEST_RP( "strh r",0, VAL1,", [r",1, 24,", #-2]") 494 TEST_RP( "strh r",0, VAL1,", [r",1, 24,", #-2]")
493 TEST_RP( "strmih r",14,VAL2,", [r",13,0, ", #2]") 495 TEST_RP( "strmih r",14,VAL2,", [r",13,0, ", #2]")
@@ -495,8 +497,8 @@ void kprobe_arm_test_cases(void)
495 TEST_RP( "strplh r",12,VAL2,", [r",11,24,", #-4]!") 497 TEST_RP( "strplh r",12,VAL2,", [r",11,24,", #-4]!")
496 TEST_RP( "strh r",2, VAL1,", [r",3, 24,"], #48") 498 TEST_RP( "strh r",2, VAL1,", [r",3, 24,"], #48")
497 TEST_RP( "strh r",10,VAL2,", [r",9, 64,"], #-48") 499 TEST_RP( "strh r",10,VAL2,", [r",9, 64,"], #-48")
498 TEST_UNSUPPORTED(".word 0xe1efc3b0 @ strh r12, [pc, #48]!") 500 TEST_UNSUPPORTED(__inst_arm(0xe1efc3b0) " @ strh r12, [pc, #48]!")
499 TEST_UNSUPPORTED(".word 0xe0c9f3b0 @ strh pc, [r9], #48") 501 TEST_UNSUPPORTED(__inst_arm(0xe0c9f3b0) " @ strh pc, [r9], #48")
500 502
501 TEST_P( "ldrh r0, [r",0, 24,", #-2]") 503 TEST_P( "ldrh r0, [r",0, 24,", #-2]")
502 TEST_P( "ldrvsh r14, [r",13,0, ", #2]") 504 TEST_P( "ldrvsh r14, [r",13,0, ", #2]")
@@ -505,8 +507,8 @@ void kprobe_arm_test_cases(void)
505 TEST_P( "ldrh r2, [r",3, 24,"], #48") 507 TEST_P( "ldrh r2, [r",3, 24,"], #48")
506 TEST_P( "ldrh r10, [r",9, 64,"], #-48") 508 TEST_P( "ldrh r10, [r",9, 64,"], #-48")
507 TEST( "ldrh r0, [pc, #0]") 509 TEST( "ldrh r0, [pc, #0]")
508 TEST_UNSUPPORTED(".word 0xe1ffc3b0 @ ldrh r12, [pc, #48]!") 510 TEST_UNSUPPORTED(__inst_arm(0xe1ffc3b0) " @ ldrh r12, [pc, #48]!")
509 TEST_UNSUPPORTED(".word 0xe0d9f3b0 @ ldrh pc, [r9], #48") 511 TEST_UNSUPPORTED(__inst_arm(0xe0d9f3b0) " @ ldrh pc, [r9], #48")
510 512
511 TEST_PR( "ldrsb r0, [r",0, 48,", -r",2, 24,"]") 513 TEST_PR( "ldrsb r0, [r",0, 48,", -r",2, 24,"]")
512 TEST_PR( "ldrhisb r14, [r",13,0,", r",12, 48,"]") 514 TEST_PR( "ldrhisb r14, [r",13,0,", r",12, 48,"]")
@@ -514,8 +516,8 @@ void kprobe_arm_test_cases(void)
514 TEST_PR( "ldrlssb r12, [r",11,48,", -r",10,24,"]!") 516 TEST_PR( "ldrlssb r12, [r",11,48,", -r",10,24,"]!")
515 TEST_PR( "ldrsb r2, [r",3, 24,"], r",4, 48,"") 517 TEST_PR( "ldrsb r2, [r",3, 24,"], r",4, 48,"")
516 TEST_PR( "ldrsb r10, [r",9, 48,"], -r",11,24,"") 518 TEST_PR( "ldrsb r10, [r",9, 48,"], -r",11,24,"")
517 TEST_UNSUPPORTED(".word 0xe1bfc0da @ ldrsb r12, [pc, r10]!") 519 TEST_UNSUPPORTED(__inst_arm(0xe1bfc0da) " @ ldrsb r12, [pc, r10]!")
518 TEST_UNSUPPORTED(".word 0xe099f0db @ ldrsb pc, [r9], r11") 520 TEST_UNSUPPORTED(__inst_arm(0xe099f0db) " @ ldrsb pc, [r9], r11")
519 521
520 TEST_P( "ldrsb r0, [r",0, 24,", #-1]") 522 TEST_P( "ldrsb r0, [r",0, 24,", #-1]")
521 TEST_P( "ldrgesb r14, [r",13,0, ", #1]") 523 TEST_P( "ldrgesb r14, [r",13,0, ", #1]")
@@ -524,8 +526,8 @@ void kprobe_arm_test_cases(void)
524 TEST_P( "ldrsb r2, [r",3, 24,"], #48") 526 TEST_P( "ldrsb r2, [r",3, 24,"], #48")
525 TEST_P( "ldrsb r10, [r",9, 64,"], #-48") 527 TEST_P( "ldrsb r10, [r",9, 64,"], #-48")
526 TEST( "ldrsb r0, [pc, #0]") 528 TEST( "ldrsb r0, [pc, #0]")
527 TEST_UNSUPPORTED(".word 0xe1ffc3d0 @ ldrsb r12, [pc, #48]!") 529 TEST_UNSUPPORTED(__inst_arm(0xe1ffc3d0) " @ ldrsb r12, [pc, #48]!")
528 TEST_UNSUPPORTED(".word 0xe0d9f3d0 @ ldrsb pc, [r9], #48") 530 TEST_UNSUPPORTED(__inst_arm(0xe0d9f3d0) " @ ldrsb pc, [r9], #48")
529 531
530 TEST_PR( "ldrsh r0, [r",0, 48,", -r",2, 24,"]") 532 TEST_PR( "ldrsh r0, [r",0, 48,", -r",2, 24,"]")
531 TEST_PR( "ldrgtsh r14, [r",13,0, ", r",12, 48,"]") 533 TEST_PR( "ldrgtsh r14, [r",13,0, ", r",12, 48,"]")
@@ -533,8 +535,8 @@ void kprobe_arm_test_cases(void)
533 TEST_PR( "ldrlesh r12, [r",11,48,", -r",10,24,"]!") 535 TEST_PR( "ldrlesh r12, [r",11,48,", -r",10,24,"]!")
534 TEST_PR( "ldrsh r2, [r",3, 24,"], r",4, 48,"") 536 TEST_PR( "ldrsh r2, [r",3, 24,"], r",4, 48,"")
535 TEST_PR( "ldrsh r10, [r",9, 48,"], -r",11,24,"") 537 TEST_PR( "ldrsh r10, [r",9, 48,"], -r",11,24,"")
536 TEST_UNSUPPORTED(".word 0xe1bfc0fa @ ldrsh r12, [pc, r10]!") 538 TEST_UNSUPPORTED(__inst_arm(0xe1bfc0fa) " @ ldrsh r12, [pc, r10]!")
537 TEST_UNSUPPORTED(".word 0xe099f0fb @ ldrsh pc, [r9], r11") 539 TEST_UNSUPPORTED(__inst_arm(0xe099f0fb) " @ ldrsh pc, [r9], r11")
538 540
539 TEST_P( "ldrsh r0, [r",0, 24,", #-1]") 541 TEST_P( "ldrsh r0, [r",0, 24,", #-1]")
540 TEST_P( "ldreqsh r14, [r",13,0 ,", #1]") 542 TEST_P( "ldreqsh r14, [r",13,0 ,", #1]")
@@ -543,8 +545,8 @@ void kprobe_arm_test_cases(void)
543 TEST_P( "ldrsh r2, [r",3, 24,"], #48") 545 TEST_P( "ldrsh r2, [r",3, 24,"], #48")
544 TEST_P( "ldrsh r10, [r",9, 64,"], #-48") 546 TEST_P( "ldrsh r10, [r",9, 64,"], #-48")
545 TEST( "ldrsh r0, [pc, #0]") 547 TEST( "ldrsh r0, [pc, #0]")
546 TEST_UNSUPPORTED(".word 0xe1ffc3f0 @ ldrsh r12, [pc, #48]!") 548 TEST_UNSUPPORTED(__inst_arm(0xe1ffc3f0) " @ ldrsh r12, [pc, #48]!")
547 TEST_UNSUPPORTED(".word 0xe0d9f3f0 @ ldrsh pc, [r9], #48") 549 TEST_UNSUPPORTED(__inst_arm(0xe0d9f3f0) " @ ldrsh pc, [r9], #48")
548 550
549#if __LINUX_ARM_ARCH__ >= 7 551#if __LINUX_ARM_ARCH__ >= 7
550 TEST_UNSUPPORTED("strht r1, [r2], r3") 552 TEST_UNSUPPORTED("strht r1, [r2], r3")
@@ -563,7 +565,7 @@ void kprobe_arm_test_cases(void)
563 TEST_RPR( "strcsd r",12,VAL2,", [r",11,48,", -r",10,24,"]!") 565 TEST_RPR( "strcsd r",12,VAL2,", [r",11,48,", -r",10,24,"]!")
564 TEST_RPR( "strd r",2, VAL1,", [r",5, 24,"], r",4,48,"") 566 TEST_RPR( "strd r",2, VAL1,", [r",5, 24,"], r",4,48,"")
565 TEST_RPR( "strd r",10,VAL2,", [r",9, 48,"], -r",7,24,"") 567 TEST_RPR( "strd r",10,VAL2,", [r",9, 48,"], -r",7,24,"")
566 TEST_UNSUPPORTED(".word 0xe1afc0fa @ strd r12, [pc, r10]!") 568 TEST_UNSUPPORTED(__inst_arm(0xe1afc0fa) " @ strd r12, [pc, r10]!")
567 569
568 TEST_PR( "ldrd r0, [r",0, 48,", -r",2,24,"]") 570 TEST_PR( "ldrd r0, [r",0, 48,", -r",2,24,"]")
569 TEST_PR( "ldrmid r8, [r",13,0, ", r",12,48,"]") 571 TEST_PR( "ldrmid r8, [r",13,0, ", r",12,48,"]")
@@ -571,10 +573,10 @@ void kprobe_arm_test_cases(void)
571 TEST_PR( "ldrpld r6, [r",11,48,", -r",10,24,"]!") 573 TEST_PR( "ldrpld r6, [r",11,48,", -r",10,24,"]!")
572 TEST_PR( "ldrd r2, [r",5, 24,"], r",4,48,"") 574 TEST_PR( "ldrd r2, [r",5, 24,"], r",4,48,"")
573 TEST_PR( "ldrd r10, [r",9,48,"], -r",7,24,"") 575 TEST_PR( "ldrd r10, [r",9,48,"], -r",7,24,"")
574 TEST_UNSUPPORTED(".word 0xe1afc0da @ ldrd r12, [pc, r10]!") 576 TEST_UNSUPPORTED(__inst_arm(0xe1afc0da) " @ ldrd r12, [pc, r10]!")
575 TEST_UNSUPPORTED(".word 0xe089f0db @ ldrd pc, [r9], r11") 577 TEST_UNSUPPORTED(__inst_arm(0xe089f0db) " @ ldrd pc, [r9], r11")
576 TEST_UNSUPPORTED(".word 0xe089e0db @ ldrd lr, [r9], r11") 578 TEST_UNSUPPORTED(__inst_arm(0xe089e0db) " @ ldrd lr, [r9], r11")
577 TEST_UNSUPPORTED(".word 0xe089c0df @ ldrd r12, [r9], pc") 579 TEST_UNSUPPORTED(__inst_arm(0xe089c0df) " @ ldrd r12, [r9], pc")
578 580
579 TEST_RP( "strd r",0, VAL1,", [r",1, 24,", #-8]") 581 TEST_RP( "strd r",0, VAL1,", [r",1, 24,", #-8]")
580 TEST_RP( "strvsd r",8, VAL2,", [r",13,0, ", #8]") 582 TEST_RP( "strvsd r",8, VAL2,", [r",13,0, ", #8]")
@@ -582,7 +584,7 @@ void kprobe_arm_test_cases(void)
582 TEST_RP( "strvcd r",12,VAL2,", [r",11,24,", #-16]!") 584 TEST_RP( "strvcd r",12,VAL2,", [r",11,24,", #-16]!")
583 TEST_RP( "strd r",2, VAL1,", [r",4, 24,"], #48") 585 TEST_RP( "strd r",2, VAL1,", [r",4, 24,"], #48")
584 TEST_RP( "strd r",10,VAL2,", [r",9, 64,"], #-48") 586 TEST_RP( "strd r",10,VAL2,", [r",9, 64,"], #-48")
585 TEST_UNSUPPORTED(".word 0xe1efc3f0 @ strd r12, [pc, #48]!") 587 TEST_UNSUPPORTED(__inst_arm(0xe1efc3f0) " @ strd r12, [pc, #48]!")
586 588
587 TEST_P( "ldrd r0, [r",0, 24,", #-8]") 589 TEST_P( "ldrd r0, [r",0, 24,", #-8]")
588 TEST_P( "ldrhid r8, [r",13,0, ", #8]") 590 TEST_P( "ldrhid r8, [r",13,0, ", #8]")
@@ -590,9 +592,9 @@ void kprobe_arm_test_cases(void)
590 TEST_P( "ldrlsd r6, [r",11,24,", #-16]!") 592 TEST_P( "ldrlsd r6, [r",11,24,", #-16]!")
591 TEST_P( "ldrd r2, [r",5, 24,"], #48") 593 TEST_P( "ldrd r2, [r",5, 24,"], #48")
592 TEST_P( "ldrd r10, [r",9,6,"], #-48") 594 TEST_P( "ldrd r10, [r",9,6,"], #-48")
593 TEST_UNSUPPORTED(".word 0xe1efc3d0 @ ldrd r12, [pc, #48]!") 595 TEST_UNSUPPORTED(__inst_arm(0xe1efc3d0) " @ ldrd r12, [pc, #48]!")
594 TEST_UNSUPPORTED(".word 0xe0c9f3d0 @ ldrd pc, [r9], #48") 596 TEST_UNSUPPORTED(__inst_arm(0xe0c9f3d0) " @ ldrd pc, [r9], #48")
595 TEST_UNSUPPORTED(".word 0xe0c9e3d0 @ ldrd lr, [r9], #48") 597 TEST_UNSUPPORTED(__inst_arm(0xe0c9e3d0) " @ ldrd lr, [r9], #48")
596 598
597 TEST_GROUP("Miscellaneous") 599 TEST_GROUP("Miscellaneous")
598 600
@@ -600,11 +602,11 @@ void kprobe_arm_test_cases(void)
600 TEST("movw r0, #0") 602 TEST("movw r0, #0")
601 TEST("movw r0, #0xffff") 603 TEST("movw r0, #0xffff")
602 TEST("movw lr, #0xffff") 604 TEST("movw lr, #0xffff")
603 TEST_UNSUPPORTED(".word 0xe300f000 @ movw pc, #0") 605 TEST_UNSUPPORTED(__inst_arm(0xe300f000) " @ movw pc, #0")
604 TEST_R("movt r",0, VAL1,", #0") 606 TEST_R("movt r",0, VAL1,", #0")
605 TEST_R("movt r",0, VAL2,", #0xffff") 607 TEST_R("movt r",0, VAL2,", #0xffff")
606 TEST_R("movt r",14,VAL1,", #0xffff") 608 TEST_R("movt r",14,VAL1,", #0xffff")
607 TEST_UNSUPPORTED(".word 0xe340f000 @ movt pc, #0") 609 TEST_UNSUPPORTED(__inst_arm(0xe340f000) " @ movt pc, #0")
608#endif 610#endif
609 611
610 TEST_UNSUPPORTED("msr cpsr, 0x13") 612 TEST_UNSUPPORTED("msr cpsr, 0x13")
@@ -672,20 +674,20 @@ void kprobe_arm_test_cases(void)
672#ifdef CONFIG_THUMB2_KERNEL 674#ifdef CONFIG_THUMB2_KERNEL
673 TEST_ARM_TO_THUMB_INTERWORK_P("ldr pc, [r",0,0,", #15*4]") 675 TEST_ARM_TO_THUMB_INTERWORK_P("ldr pc, [r",0,0,", #15*4]")
674#endif 676#endif
675 TEST_UNSUPPORTED(".word 0xe5af6008 @ str r6, [pc, #8]!") 677 TEST_UNSUPPORTED(__inst_arm(0xe5af6008) " @ str r6, [pc, #8]!")
676 TEST_UNSUPPORTED(".word 0xe7af6008 @ str r6, [pc, r8]!") 678 TEST_UNSUPPORTED(__inst_arm(0xe7af6008) " @ str r6, [pc, r8]!")
677 TEST_UNSUPPORTED(".word 0xe5bf6008 @ ldr r6, [pc, #8]!") 679 TEST_UNSUPPORTED(__inst_arm(0xe5bf6008) " @ ldr r6, [pc, #8]!")
678 TEST_UNSUPPORTED(".word 0xe7bf6008 @ ldr r6, [pc, r8]!") 680 TEST_UNSUPPORTED(__inst_arm(0xe7bf6008) " @ ldr r6, [pc, r8]!")
679 TEST_UNSUPPORTED(".word 0xe788600f @ str r6, [r8, pc]") 681 TEST_UNSUPPORTED(__inst_arm(0xe788600f) " @ str r6, [r8, pc]")
680 TEST_UNSUPPORTED(".word 0xe798600f @ ldr r6, [r8, pc]") 682 TEST_UNSUPPORTED(__inst_arm(0xe798600f) " @ ldr r6, [r8, pc]")
681 683
682 LOAD_STORE("b") 684 LOAD_STORE("b")
683 TEST_UNSUPPORTED(".word 0xe5f7f008 @ ldrb pc, [r7, #8]!") 685 TEST_UNSUPPORTED(__inst_arm(0xe5f7f008) " @ ldrb pc, [r7, #8]!")
684 TEST_UNSUPPORTED(".word 0xe7f7f008 @ ldrb pc, [r7, r8]!") 686 TEST_UNSUPPORTED(__inst_arm(0xe7f7f008) " @ ldrb pc, [r7, r8]!")
685 TEST_UNSUPPORTED(".word 0xe5ef6008 @ strb r6, [pc, #8]!") 687 TEST_UNSUPPORTED(__inst_arm(0xe5ef6008) " @ strb r6, [pc, #8]!")
686 TEST_UNSUPPORTED(".word 0xe7ef6008 @ strb r6, [pc, r3]!") 688 TEST_UNSUPPORTED(__inst_arm(0xe7ef6008) " @ strb r6, [pc, r3]!")
687 TEST_UNSUPPORTED(".word 0xe5ff6008 @ ldrb r6, [pc, #8]!") 689 TEST_UNSUPPORTED(__inst_arm(0xe5ff6008) " @ ldrb r6, [pc, #8]!")
688 TEST_UNSUPPORTED(".word 0xe7ff6008 @ ldrb r6, [pc, r3]!") 690 TEST_UNSUPPORTED(__inst_arm(0xe7ff6008) " @ ldrb r6, [pc, r3]!")
689 691
690 TEST_UNSUPPORTED("ldrt r0, [r1], #4") 692 TEST_UNSUPPORTED("ldrt r0, [r1], #4")
691 TEST_UNSUPPORTED("ldrt r1, [r2], r3") 693 TEST_UNSUPPORTED("ldrt r1, [r2], r3")
@@ -699,153 +701,153 @@ void kprobe_arm_test_cases(void)
699#if __LINUX_ARM_ARCH__ >= 7 701#if __LINUX_ARM_ARCH__ >= 7
700 TEST_GROUP("Parallel addition and subtraction, signed") 702 TEST_GROUP("Parallel addition and subtraction, signed")
701 703
702 TEST_UNSUPPORTED(".word 0xe6000010") /* Unallocated space */ 704 TEST_UNSUPPORTED(__inst_arm(0xe6000010) "") /* Unallocated space */
703 TEST_UNSUPPORTED(".word 0xe60fffff") /* Unallocated space */ 705 TEST_UNSUPPORTED(__inst_arm(0xe60fffff) "") /* Unallocated space */
704 706
705 TEST_RR( "sadd16 r0, r",0, HH1,", r",1, HH2,"") 707 TEST_RR( "sadd16 r0, r",0, HH1,", r",1, HH2,"")
706 TEST_RR( "sadd16 r14, r",12,HH2,", r",10,HH1,"") 708 TEST_RR( "sadd16 r14, r",12,HH2,", r",10,HH1,"")
707 TEST_UNSUPPORTED(".word 0xe61cff1a @ sadd16 pc, r12, r10") 709 TEST_UNSUPPORTED(__inst_arm(0xe61cff1a) " @ sadd16 pc, r12, r10")
708 TEST_RR( "sasx r0, r",0, HH1,", r",1, HH2,"") 710 TEST_RR( "sasx r0, r",0, HH1,", r",1, HH2,"")
709 TEST_RR( "sasx r14, r",12,HH2,", r",10,HH1,"") 711 TEST_RR( "sasx r14, r",12,HH2,", r",10,HH1,"")
710 TEST_UNSUPPORTED(".word 0xe61cff3a @ sasx pc, r12, r10") 712 TEST_UNSUPPORTED(__inst_arm(0xe61cff3a) " @ sasx pc, r12, r10")
711 TEST_RR( "ssax r0, r",0, HH1,", r",1, HH2,"") 713 TEST_RR( "ssax r0, r",0, HH1,", r",1, HH2,"")
712 TEST_RR( "ssax r14, r",12,HH2,", r",10,HH1,"") 714 TEST_RR( "ssax r14, r",12,HH2,", r",10,HH1,"")
713 TEST_UNSUPPORTED(".word 0xe61cff5a @ ssax pc, r12, r10") 715 TEST_UNSUPPORTED(__inst_arm(0xe61cff5a) " @ ssax pc, r12, r10")
714 TEST_RR( "ssub16 r0, r",0, HH1,", r",1, HH2,"") 716 TEST_RR( "ssub16 r0, r",0, HH1,", r",1, HH2,"")
715 TEST_RR( "ssub16 r14, r",12,HH2,", r",10,HH1,"") 717 TEST_RR( "ssub16 r14, r",12,HH2,", r",10,HH1,"")
716 TEST_UNSUPPORTED(".word 0xe61cff7a @ ssub16 pc, r12, r10") 718 TEST_UNSUPPORTED(__inst_arm(0xe61cff7a) " @ ssub16 pc, r12, r10")
717 TEST_RR( "sadd8 r0, r",0, HH1,", r",1, HH2,"") 719 TEST_RR( "sadd8 r0, r",0, HH1,", r",1, HH2,"")
718 TEST_RR( "sadd8 r14, r",12,HH2,", r",10,HH1,"") 720 TEST_RR( "sadd8 r14, r",12,HH2,", r",10,HH1,"")
719 TEST_UNSUPPORTED(".word 0xe61cff9a @ sadd8 pc, r12, r10") 721 TEST_UNSUPPORTED(__inst_arm(0xe61cff9a) " @ sadd8 pc, r12, r10")
720 TEST_UNSUPPORTED(".word 0xe61000b0") /* Unallocated space */ 722 TEST_UNSUPPORTED(__inst_arm(0xe61000b0) "") /* Unallocated space */
721 TEST_UNSUPPORTED(".word 0xe61fffbf") /* Unallocated space */ 723 TEST_UNSUPPORTED(__inst_arm(0xe61fffbf) "") /* Unallocated space */
722 TEST_UNSUPPORTED(".word 0xe61000d0") /* Unallocated space */ 724 TEST_UNSUPPORTED(__inst_arm(0xe61000d0) "") /* Unallocated space */
723 TEST_UNSUPPORTED(".word 0xe61fffdf") /* Unallocated space */ 725 TEST_UNSUPPORTED(__inst_arm(0xe61fffdf) "") /* Unallocated space */
724 TEST_RR( "ssub8 r0, r",0, HH1,", r",1, HH2,"") 726 TEST_RR( "ssub8 r0, r",0, HH1,", r",1, HH2,"")
725 TEST_RR( "ssub8 r14, r",12,HH2,", r",10,HH1,"") 727 TEST_RR( "ssub8 r14, r",12,HH2,", r",10,HH1,"")
726 TEST_UNSUPPORTED(".word 0xe61cfffa @ ssub8 pc, r12, r10") 728 TEST_UNSUPPORTED(__inst_arm(0xe61cfffa) " @ ssub8 pc, r12, r10")
727 729
728 TEST_RR( "qadd16 r0, r",0, HH1,", r",1, HH2,"") 730 TEST_RR( "qadd16 r0, r",0, HH1,", r",1, HH2,"")
729 TEST_RR( "qadd16 r14, r",12,HH2,", r",10,HH1,"") 731 TEST_RR( "qadd16 r14, r",12,HH2,", r",10,HH1,"")
730 TEST_UNSUPPORTED(".word 0xe62cff1a @ qadd16 pc, r12, r10") 732 TEST_UNSUPPORTED(__inst_arm(0xe62cff1a) " @ qadd16 pc, r12, r10")
731 TEST_RR( "qasx r0, r",0, HH1,", r",1, HH2,"") 733 TEST_RR( "qasx r0, r",0, HH1,", r",1, HH2,"")
732 TEST_RR( "qasx r14, r",12,HH2,", r",10,HH1,"") 734 TEST_RR( "qasx r14, r",12,HH2,", r",10,HH1,"")
733 TEST_UNSUPPORTED(".word 0xe62cff3a @ qasx pc, r12, r10") 735 TEST_UNSUPPORTED(__inst_arm(0xe62cff3a) " @ qasx pc, r12, r10")
734 TEST_RR( "qsax r0, r",0, HH1,", r",1, HH2,"") 736 TEST_RR( "qsax r0, r",0, HH1,", r",1, HH2,"")
735 TEST_RR( "qsax r14, r",12,HH2,", r",10,HH1,"") 737 TEST_RR( "qsax r14, r",12,HH2,", r",10,HH1,"")
736 TEST_UNSUPPORTED(".word 0xe62cff5a @ qsax pc, r12, r10") 738 TEST_UNSUPPORTED(__inst_arm(0xe62cff5a) " @ qsax pc, r12, r10")
737 TEST_RR( "qsub16 r0, r",0, HH1,", r",1, HH2,"") 739 TEST_RR( "qsub16 r0, r",0, HH1,", r",1, HH2,"")
738 TEST_RR( "qsub16 r14, r",12,HH2,", r",10,HH1,"") 740 TEST_RR( "qsub16 r14, r",12,HH2,", r",10,HH1,"")
739 TEST_UNSUPPORTED(".word 0xe62cff7a @ qsub16 pc, r12, r10") 741 TEST_UNSUPPORTED(__inst_arm(0xe62cff7a) " @ qsub16 pc, r12, r10")
740 TEST_RR( "qadd8 r0, r",0, HH1,", r",1, HH2,"") 742 TEST_RR( "qadd8 r0, r",0, HH1,", r",1, HH2,"")
741 TEST_RR( "qadd8 r14, r",12,HH2,", r",10,HH1,"") 743 TEST_RR( "qadd8 r14, r",12,HH2,", r",10,HH1,"")
742 TEST_UNSUPPORTED(".word 0xe62cff9a @ qadd8 pc, r12, r10") 744 TEST_UNSUPPORTED(__inst_arm(0xe62cff9a) " @ qadd8 pc, r12, r10")
743 TEST_UNSUPPORTED(".word 0xe62000b0") /* Unallocated space */ 745 TEST_UNSUPPORTED(__inst_arm(0xe62000b0) "") /* Unallocated space */
744 TEST_UNSUPPORTED(".word 0xe62fffbf") /* Unallocated space */ 746 TEST_UNSUPPORTED(__inst_arm(0xe62fffbf) "") /* Unallocated space */
745 TEST_UNSUPPORTED(".word 0xe62000d0") /* Unallocated space */ 747 TEST_UNSUPPORTED(__inst_arm(0xe62000d0) "") /* Unallocated space */
746 TEST_UNSUPPORTED(".word 0xe62fffdf") /* Unallocated space */ 748 TEST_UNSUPPORTED(__inst_arm(0xe62fffdf) "") /* Unallocated space */
747 TEST_RR( "qsub8 r0, r",0, HH1,", r",1, HH2,"") 749 TEST_RR( "qsub8 r0, r",0, HH1,", r",1, HH2,"")
748 TEST_RR( "qsub8 r14, r",12,HH2,", r",10,HH1,"") 750 TEST_RR( "qsub8 r14, r",12,HH2,", r",10,HH1,"")
749 TEST_UNSUPPORTED(".word 0xe62cfffa @ qsub8 pc, r12, r10") 751 TEST_UNSUPPORTED(__inst_arm(0xe62cfffa) " @ qsub8 pc, r12, r10")
750 752
751 TEST_RR( "shadd16 r0, r",0, HH1,", r",1, HH2,"") 753 TEST_RR( "shadd16 r0, r",0, HH1,", r",1, HH2,"")
752 TEST_RR( "shadd16 r14, r",12,HH2,", r",10,HH1,"") 754 TEST_RR( "shadd16 r14, r",12,HH2,", r",10,HH1,"")
753 TEST_UNSUPPORTED(".word 0xe63cff1a @ shadd16 pc, r12, r10") 755 TEST_UNSUPPORTED(__inst_arm(0xe63cff1a) " @ shadd16 pc, r12, r10")
754 TEST_RR( "shasx r0, r",0, HH1,", r",1, HH2,"") 756 TEST_RR( "shasx r0, r",0, HH1,", r",1, HH2,"")
755 TEST_RR( "shasx r14, r",12,HH2,", r",10,HH1,"") 757 TEST_RR( "shasx r14, r",12,HH2,", r",10,HH1,"")
756 TEST_UNSUPPORTED(".word 0xe63cff3a @ shasx pc, r12, r10") 758 TEST_UNSUPPORTED(__inst_arm(0xe63cff3a) " @ shasx pc, r12, r10")
757 TEST_RR( "shsax r0, r",0, HH1,", r",1, HH2,"") 759 TEST_RR( "shsax r0, r",0, HH1,", r",1, HH2,"")
758 TEST_RR( "shsax r14, r",12,HH2,", r",10,HH1,"") 760 TEST_RR( "shsax r14, r",12,HH2,", r",10,HH1,"")
759 TEST_UNSUPPORTED(".word 0xe63cff5a @ shsax pc, r12, r10") 761 TEST_UNSUPPORTED(__inst_arm(0xe63cff5a) " @ shsax pc, r12, r10")
760 TEST_RR( "shsub16 r0, r",0, HH1,", r",1, HH2,"") 762 TEST_RR( "shsub16 r0, r",0, HH1,", r",1, HH2,"")
761 TEST_RR( "shsub16 r14, r",12,HH2,", r",10,HH1,"") 763 TEST_RR( "shsub16 r14, r",12,HH2,", r",10,HH1,"")
762 TEST_UNSUPPORTED(".word 0xe63cff7a @ shsub16 pc, r12, r10") 764 TEST_UNSUPPORTED(__inst_arm(0xe63cff7a) " @ shsub16 pc, r12, r10")
763 TEST_RR( "shadd8 r0, r",0, HH1,", r",1, HH2,"") 765 TEST_RR( "shadd8 r0, r",0, HH1,", r",1, HH2,"")
764 TEST_RR( "shadd8 r14, r",12,HH2,", r",10,HH1,"") 766 TEST_RR( "shadd8 r14, r",12,HH2,", r",10,HH1,"")
765 TEST_UNSUPPORTED(".word 0xe63cff9a @ shadd8 pc, r12, r10") 767 TEST_UNSUPPORTED(__inst_arm(0xe63cff9a) " @ shadd8 pc, r12, r10")
766 TEST_UNSUPPORTED(".word 0xe63000b0") /* Unallocated space */ 768 TEST_UNSUPPORTED(__inst_arm(0xe63000b0) "") /* Unallocated space */
767 TEST_UNSUPPORTED(".word 0xe63fffbf") /* Unallocated space */ 769 TEST_UNSUPPORTED(__inst_arm(0xe63fffbf) "") /* Unallocated space */
768 TEST_UNSUPPORTED(".word 0xe63000d0") /* Unallocated space */ 770 TEST_UNSUPPORTED(__inst_arm(0xe63000d0) "") /* Unallocated space */
769 TEST_UNSUPPORTED(".word 0xe63fffdf") /* Unallocated space */ 771 TEST_UNSUPPORTED(__inst_arm(0xe63fffdf) "") /* Unallocated space */
770 TEST_RR( "shsub8 r0, r",0, HH1,", r",1, HH2,"") 772 TEST_RR( "shsub8 r0, r",0, HH1,", r",1, HH2,"")
771 TEST_RR( "shsub8 r14, r",12,HH2,", r",10,HH1,"") 773 TEST_RR( "shsub8 r14, r",12,HH2,", r",10,HH1,"")
772 TEST_UNSUPPORTED(".word 0xe63cfffa @ shsub8 pc, r12, r10") 774 TEST_UNSUPPORTED(__inst_arm(0xe63cfffa) " @ shsub8 pc, r12, r10")
773 775
774 TEST_GROUP("Parallel addition and subtraction, unsigned") 776 TEST_GROUP("Parallel addition and subtraction, unsigned")
775 777
776 TEST_UNSUPPORTED(".word 0xe6400010") /* Unallocated space */ 778 TEST_UNSUPPORTED(__inst_arm(0xe6400010) "") /* Unallocated space */
777 TEST_UNSUPPORTED(".word 0xe64fffff") /* Unallocated space */ 779 TEST_UNSUPPORTED(__inst_arm(0xe64fffff) "") /* Unallocated space */
778 780
779 TEST_RR( "uadd16 r0, r",0, HH1,", r",1, HH2,"") 781 TEST_RR( "uadd16 r0, r",0, HH1,", r",1, HH2,"")
780 TEST_RR( "uadd16 r14, r",12,HH2,", r",10,HH1,"") 782 TEST_RR( "uadd16 r14, r",12,HH2,", r",10,HH1,"")
781 TEST_UNSUPPORTED(".word 0xe65cff1a @ uadd16 pc, r12, r10") 783 TEST_UNSUPPORTED(__inst_arm(0xe65cff1a) " @ uadd16 pc, r12, r10")
782 TEST_RR( "uasx r0, r",0, HH1,", r",1, HH2,"") 784 TEST_RR( "uasx r0, r",0, HH1,", r",1, HH2,"")
783 TEST_RR( "uasx r14, r",12,HH2,", r",10,HH1,"") 785 TEST_RR( "uasx r14, r",12,HH2,", r",10,HH1,"")
784 TEST_UNSUPPORTED(".word 0xe65cff3a @ uasx pc, r12, r10") 786 TEST_UNSUPPORTED(__inst_arm(0xe65cff3a) " @ uasx pc, r12, r10")
785 TEST_RR( "usax r0, r",0, HH1,", r",1, HH2,"") 787 TEST_RR( "usax r0, r",0, HH1,", r",1, HH2,"")
786 TEST_RR( "usax r14, r",12,HH2,", r",10,HH1,"") 788 TEST_RR( "usax r14, r",12,HH2,", r",10,HH1,"")
787 TEST_UNSUPPORTED(".word 0xe65cff5a @ usax pc, r12, r10") 789 TEST_UNSUPPORTED(__inst_arm(0xe65cff5a) " @ usax pc, r12, r10")
788 TEST_RR( "usub16 r0, r",0, HH1,", r",1, HH2,"") 790 TEST_RR( "usub16 r0, r",0, HH1,", r",1, HH2,"")
789 TEST_RR( "usub16 r14, r",12,HH2,", r",10,HH1,"") 791 TEST_RR( "usub16 r14, r",12,HH2,", r",10,HH1,"")
790 TEST_UNSUPPORTED(".word 0xe65cff7a @ usub16 pc, r12, r10") 792 TEST_UNSUPPORTED(__inst_arm(0xe65cff7a) " @ usub16 pc, r12, r10")
791 TEST_RR( "uadd8 r0, r",0, HH1,", r",1, HH2,"") 793 TEST_RR( "uadd8 r0, r",0, HH1,", r",1, HH2,"")
792 TEST_RR( "uadd8 r14, r",12,HH2,", r",10,HH1,"") 794 TEST_RR( "uadd8 r14, r",12,HH2,", r",10,HH1,"")
793 TEST_UNSUPPORTED(".word 0xe65cff9a @ uadd8 pc, r12, r10") 795 TEST_UNSUPPORTED(__inst_arm(0xe65cff9a) " @ uadd8 pc, r12, r10")
794 TEST_UNSUPPORTED(".word 0xe65000b0") /* Unallocated space */ 796 TEST_UNSUPPORTED(__inst_arm(0xe65000b0) "") /* Unallocated space */
795 TEST_UNSUPPORTED(".word 0xe65fffbf") /* Unallocated space */ 797 TEST_UNSUPPORTED(__inst_arm(0xe65fffbf) "") /* Unallocated space */
796 TEST_UNSUPPORTED(".word 0xe65000d0") /* Unallocated space */ 798 TEST_UNSUPPORTED(__inst_arm(0xe65000d0) "") /* Unallocated space */
797 TEST_UNSUPPORTED(".word 0xe65fffdf") /* Unallocated space */ 799 TEST_UNSUPPORTED(__inst_arm(0xe65fffdf) "") /* Unallocated space */
798 TEST_RR( "usub8 r0, r",0, HH1,", r",1, HH2,"") 800 TEST_RR( "usub8 r0, r",0, HH1,", r",1, HH2,"")
799 TEST_RR( "usub8 r14, r",12,HH2,", r",10,HH1,"") 801 TEST_RR( "usub8 r14, r",12,HH2,", r",10,HH1,"")
800 TEST_UNSUPPORTED(".word 0xe65cfffa @ usub8 pc, r12, r10") 802 TEST_UNSUPPORTED(__inst_arm(0xe65cfffa) " @ usub8 pc, r12, r10")
801 803
802 TEST_RR( "uqadd16 r0, r",0, HH1,", r",1, HH2,"") 804 TEST_RR( "uqadd16 r0, r",0, HH1,", r",1, HH2,"")
803 TEST_RR( "uqadd16 r14, r",12,HH2,", r",10,HH1,"") 805 TEST_RR( "uqadd16 r14, r",12,HH2,", r",10,HH1,"")
804 TEST_UNSUPPORTED(".word 0xe66cff1a @ uqadd16 pc, r12, r10") 806 TEST_UNSUPPORTED(__inst_arm(0xe66cff1a) " @ uqadd16 pc, r12, r10")
805 TEST_RR( "uqasx r0, r",0, HH1,", r",1, HH2,"") 807 TEST_RR( "uqasx r0, r",0, HH1,", r",1, HH2,"")
806 TEST_RR( "uqasx r14, r",12,HH2,", r",10,HH1,"") 808 TEST_RR( "uqasx r14, r",12,HH2,", r",10,HH1,"")
807 TEST_UNSUPPORTED(".word 0xe66cff3a @ uqasx pc, r12, r10") 809 TEST_UNSUPPORTED(__inst_arm(0xe66cff3a) " @ uqasx pc, r12, r10")
808 TEST_RR( "uqsax r0, r",0, HH1,", r",1, HH2,"") 810 TEST_RR( "uqsax r0, r",0, HH1,", r",1, HH2,"")
809 TEST_RR( "uqsax r14, r",12,HH2,", r",10,HH1,"") 811 TEST_RR( "uqsax r14, r",12,HH2,", r",10,HH1,"")
810 TEST_UNSUPPORTED(".word 0xe66cff5a @ uqsax pc, r12, r10") 812 TEST_UNSUPPORTED(__inst_arm(0xe66cff5a) " @ uqsax pc, r12, r10")
811 TEST_RR( "uqsub16 r0, r",0, HH1,", r",1, HH2,"") 813 TEST_RR( "uqsub16 r0, r",0, HH1,", r",1, HH2,"")
812 TEST_RR( "uqsub16 r14, r",12,HH2,", r",10,HH1,"") 814 TEST_RR( "uqsub16 r14, r",12,HH2,", r",10,HH1,"")
813 TEST_UNSUPPORTED(".word 0xe66cff7a @ uqsub16 pc, r12, r10") 815 TEST_UNSUPPORTED(__inst_arm(0xe66cff7a) " @ uqsub16 pc, r12, r10")
814 TEST_RR( "uqadd8 r0, r",0, HH1,", r",1, HH2,"") 816 TEST_RR( "uqadd8 r0, r",0, HH1,", r",1, HH2,"")
815 TEST_RR( "uqadd8 r14, r",12,HH2,", r",10,HH1,"") 817 TEST_RR( "uqadd8 r14, r",12,HH2,", r",10,HH1,"")
816 TEST_UNSUPPORTED(".word 0xe66cff9a @ uqadd8 pc, r12, r10") 818 TEST_UNSUPPORTED(__inst_arm(0xe66cff9a) " @ uqadd8 pc, r12, r10")
817 TEST_UNSUPPORTED(".word 0xe66000b0") /* Unallocated space */ 819 TEST_UNSUPPORTED(__inst_arm(0xe66000b0) "") /* Unallocated space */
818 TEST_UNSUPPORTED(".word 0xe66fffbf") /* Unallocated space */ 820 TEST_UNSUPPORTED(__inst_arm(0xe66fffbf) "") /* Unallocated space */
819 TEST_UNSUPPORTED(".word 0xe66000d0") /* Unallocated space */ 821 TEST_UNSUPPORTED(__inst_arm(0xe66000d0) "") /* Unallocated space */
820 TEST_UNSUPPORTED(".word 0xe66fffdf") /* Unallocated space */ 822 TEST_UNSUPPORTED(__inst_arm(0xe66fffdf) "") /* Unallocated space */
821 TEST_RR( "uqsub8 r0, r",0, HH1,", r",1, HH2,"") 823 TEST_RR( "uqsub8 r0, r",0, HH1,", r",1, HH2,"")
822 TEST_RR( "uqsub8 r14, r",12,HH2,", r",10,HH1,"") 824 TEST_RR( "uqsub8 r14, r",12,HH2,", r",10,HH1,"")
823 TEST_UNSUPPORTED(".word 0xe66cfffa @ uqsub8 pc, r12, r10") 825 TEST_UNSUPPORTED(__inst_arm(0xe66cfffa) " @ uqsub8 pc, r12, r10")
824 826
825 TEST_RR( "uhadd16 r0, r",0, HH1,", r",1, HH2,"") 827 TEST_RR( "uhadd16 r0, r",0, HH1,", r",1, HH2,"")
826 TEST_RR( "uhadd16 r14, r",12,HH2,", r",10,HH1,"") 828 TEST_RR( "uhadd16 r14, r",12,HH2,", r",10,HH1,"")
827 TEST_UNSUPPORTED(".word 0xe67cff1a @ uhadd16 pc, r12, r10") 829 TEST_UNSUPPORTED(__inst_arm(0xe67cff1a) " @ uhadd16 pc, r12, r10")
828 TEST_RR( "uhasx r0, r",0, HH1,", r",1, HH2,"") 830 TEST_RR( "uhasx r0, r",0, HH1,", r",1, HH2,"")
829 TEST_RR( "uhasx r14, r",12,HH2,", r",10,HH1,"") 831 TEST_RR( "uhasx r14, r",12,HH2,", r",10,HH1,"")
830 TEST_UNSUPPORTED(".word 0xe67cff3a @ uhasx pc, r12, r10") 832 TEST_UNSUPPORTED(__inst_arm(0xe67cff3a) " @ uhasx pc, r12, r10")
831 TEST_RR( "uhsax r0, r",0, HH1,", r",1, HH2,"") 833 TEST_RR( "uhsax r0, r",0, HH1,", r",1, HH2,"")
832 TEST_RR( "uhsax r14, r",12,HH2,", r",10,HH1,"") 834 TEST_RR( "uhsax r14, r",12,HH2,", r",10,HH1,"")
833 TEST_UNSUPPORTED(".word 0xe67cff5a @ uhsax pc, r12, r10") 835 TEST_UNSUPPORTED(__inst_arm(0xe67cff5a) " @ uhsax pc, r12, r10")
834 TEST_RR( "uhsub16 r0, r",0, HH1,", r",1, HH2,"") 836 TEST_RR( "uhsub16 r0, r",0, HH1,", r",1, HH2,"")
835 TEST_RR( "uhsub16 r14, r",12,HH2,", r",10,HH1,"") 837 TEST_RR( "uhsub16 r14, r",12,HH2,", r",10,HH1,"")
836 TEST_UNSUPPORTED(".word 0xe67cff7a @ uhsub16 pc, r12, r10") 838 TEST_UNSUPPORTED(__inst_arm(0xe67cff7a) " @ uhsub16 pc, r12, r10")
837 TEST_RR( "uhadd8 r0, r",0, HH1,", r",1, HH2,"") 839 TEST_RR( "uhadd8 r0, r",0, HH1,", r",1, HH2,"")
838 TEST_RR( "uhadd8 r14, r",12,HH2,", r",10,HH1,"") 840 TEST_RR( "uhadd8 r14, r",12,HH2,", r",10,HH1,"")
839 TEST_UNSUPPORTED(".word 0xe67cff9a @ uhadd8 pc, r12, r10") 841 TEST_UNSUPPORTED(__inst_arm(0xe67cff9a) " @ uhadd8 pc, r12, r10")
840 TEST_UNSUPPORTED(".word 0xe67000b0") /* Unallocated space */ 842 TEST_UNSUPPORTED(__inst_arm(0xe67000b0) "") /* Unallocated space */
841 TEST_UNSUPPORTED(".word 0xe67fffbf") /* Unallocated space */ 843 TEST_UNSUPPORTED(__inst_arm(0xe67fffbf) "") /* Unallocated space */
842 TEST_UNSUPPORTED(".word 0xe67000d0") /* Unallocated space */ 844 TEST_UNSUPPORTED(__inst_arm(0xe67000d0) "") /* Unallocated space */
843 TEST_UNSUPPORTED(".word 0xe67fffdf") /* Unallocated space */ 845 TEST_UNSUPPORTED(__inst_arm(0xe67fffdf) "") /* Unallocated space */
844 TEST_RR( "uhsub8 r0, r",0, HH1,", r",1, HH2,"") 846 TEST_RR( "uhsub8 r0, r",0, HH1,", r",1, HH2,"")
845 TEST_RR( "uhsub8 r14, r",12,HH2,", r",10,HH1,"") 847 TEST_RR( "uhsub8 r14, r",12,HH2,", r",10,HH1,"")
846 TEST_UNSUPPORTED(".word 0xe67cfffa @ uhsub8 pc, r12, r10") 848 TEST_UNSUPPORTED(__inst_arm(0xe67cfffa) " @ uhsub8 pc, r12, r10")
847 TEST_UNSUPPORTED(".word 0xe67feffa @ uhsub8 r14, pc, r10") 849 TEST_UNSUPPORTED(__inst_arm(0xe67feffa) " @ uhsub8 r14, pc, r10")
848 TEST_UNSUPPORTED(".word 0xe67cefff @ uhsub8 r14, r12, pc") 850 TEST_UNSUPPORTED(__inst_arm(0xe67cefff) " @ uhsub8 r14, r12, pc")
849#endif /* __LINUX_ARM_ARCH__ >= 7 */ 851#endif /* __LINUX_ARM_ARCH__ >= 7 */
850 852
851#if __LINUX_ARM_ARCH__ >= 6 853#if __LINUX_ARM_ARCH__ >= 6
@@ -853,99 +855,99 @@ void kprobe_arm_test_cases(void)
853 855
854 TEST_RR( "pkhbt r0, r",0, HH1,", r",1, HH2,"") 856 TEST_RR( "pkhbt r0, r",0, HH1,", r",1, HH2,"")
855 TEST_RR( "pkhbt r14,r",12, HH1,", r",10,HH2,", lsl #2") 857 TEST_RR( "pkhbt r14,r",12, HH1,", r",10,HH2,", lsl #2")
856 TEST_UNSUPPORTED(".word 0xe68cf11a @ pkhbt pc, r12, r10, lsl #2") 858 TEST_UNSUPPORTED(__inst_arm(0xe68cf11a) " @ pkhbt pc, r12, r10, lsl #2")
857 TEST_RR( "pkhtb r0, r",0, HH1,", r",1, HH2,"") 859 TEST_RR( "pkhtb r0, r",0, HH1,", r",1, HH2,"")
858 TEST_RR( "pkhtb r14,r",12, HH1,", r",10,HH2,", asr #2") 860 TEST_RR( "pkhtb r14,r",12, HH1,", r",10,HH2,", asr #2")
859 TEST_UNSUPPORTED(".word 0xe68cf15a @ pkhtb pc, r12, r10, asr #2") 861 TEST_UNSUPPORTED(__inst_arm(0xe68cf15a) " @ pkhtb pc, r12, r10, asr #2")
860 TEST_UNSUPPORTED(".word 0xe68fe15a @ pkhtb r14, pc, r10, asr #2") 862 TEST_UNSUPPORTED(__inst_arm(0xe68fe15a) " @ pkhtb r14, pc, r10, asr #2")
861 TEST_UNSUPPORTED(".word 0xe68ce15f @ pkhtb r14, r12, pc, asr #2") 863 TEST_UNSUPPORTED(__inst_arm(0xe68ce15f) " @ pkhtb r14, r12, pc, asr #2")
862 TEST_UNSUPPORTED(".word 0xe6900010") /* Unallocated space */ 864 TEST_UNSUPPORTED(__inst_arm(0xe6900010) "") /* Unallocated space */
863 TEST_UNSUPPORTED(".word 0xe69fffdf") /* Unallocated space */ 865 TEST_UNSUPPORTED(__inst_arm(0xe69fffdf) "") /* Unallocated space */
864 866
865 TEST_R( "ssat r0, #24, r",0, VAL1,"") 867 TEST_R( "ssat r0, #24, r",0, VAL1,"")
866 TEST_R( "ssat r14, #24, r",12, VAL2,"") 868 TEST_R( "ssat r14, #24, r",12, VAL2,"")
867 TEST_R( "ssat r0, #24, r",0, VAL1,", lsl #8") 869 TEST_R( "ssat r0, #24, r",0, VAL1,", lsl #8")
868 TEST_R( "ssat r14, #24, r",12, VAL2,", asr #8") 870 TEST_R( "ssat r14, #24, r",12, VAL2,", asr #8")
869 TEST_UNSUPPORTED(".word 0xe6b7f01c @ ssat pc, #24, r12") 871 TEST_UNSUPPORTED(__inst_arm(0xe6b7f01c) " @ ssat pc, #24, r12")
870 872
871 TEST_R( "usat r0, #24, r",0, VAL1,"") 873 TEST_R( "usat r0, #24, r",0, VAL1,"")
872 TEST_R( "usat r14, #24, r",12, VAL2,"") 874 TEST_R( "usat r14, #24, r",12, VAL2,"")
873 TEST_R( "usat r0, #24, r",0, VAL1,", lsl #8") 875 TEST_R( "usat r0, #24, r",0, VAL1,", lsl #8")
874 TEST_R( "usat r14, #24, r",12, VAL2,", asr #8") 876 TEST_R( "usat r14, #24, r",12, VAL2,", asr #8")
875 TEST_UNSUPPORTED(".word 0xe6f7f01c @ usat pc, #24, r12") 877 TEST_UNSUPPORTED(__inst_arm(0xe6f7f01c) " @ usat pc, #24, r12")
876 878
877 TEST_RR( "sxtab16 r0, r",0, HH1,", r",1, HH2,"") 879 TEST_RR( "sxtab16 r0, r",0, HH1,", r",1, HH2,"")
878 TEST_RR( "sxtab16 r14,r",12, HH2,", r",10,HH1,", ror #8") 880 TEST_RR( "sxtab16 r14,r",12, HH2,", r",10,HH1,", ror #8")
879 TEST_R( "sxtb16 r8, r",7, HH1,"") 881 TEST_R( "sxtb16 r8, r",7, HH1,"")
880 TEST_UNSUPPORTED(".word 0xe68cf47a @ sxtab16 pc,r12, r10, ror #8") 882 TEST_UNSUPPORTED(__inst_arm(0xe68cf47a) " @ sxtab16 pc,r12, r10, ror #8")
881 883
882 TEST_RR( "sel r0, r",0, VAL1,", r",1, VAL2,"") 884 TEST_RR( "sel r0, r",0, VAL1,", r",1, VAL2,"")
883 TEST_RR( "sel r14, r",12,VAL1,", r",10, VAL2,"") 885 TEST_RR( "sel r14, r",12,VAL1,", r",10, VAL2,"")
884 TEST_UNSUPPORTED(".word 0xe68cffba @ sel pc, r12, r10") 886 TEST_UNSUPPORTED(__inst_arm(0xe68cffba) " @ sel pc, r12, r10")
885 TEST_UNSUPPORTED(".word 0xe68fefba @ sel r14, pc, r10") 887 TEST_UNSUPPORTED(__inst_arm(0xe68fefba) " @ sel r14, pc, r10")
886 TEST_UNSUPPORTED(".word 0xe68cefbf @ sel r14, r12, pc") 888 TEST_UNSUPPORTED(__inst_arm(0xe68cefbf) " @ sel r14, r12, pc")
887 889
888 TEST_R( "ssat16 r0, #12, r",0, HH1,"") 890 TEST_R( "ssat16 r0, #12, r",0, HH1,"")
889 TEST_R( "ssat16 r14, #12, r",12, HH2,"") 891 TEST_R( "ssat16 r14, #12, r",12, HH2,"")
890 TEST_UNSUPPORTED(".word 0xe6abff3c @ ssat16 pc, #12, r12") 892 TEST_UNSUPPORTED(__inst_arm(0xe6abff3c) " @ ssat16 pc, #12, r12")
891 893
892 TEST_RR( "sxtab r0, r",0, HH1,", r",1, HH2,"") 894 TEST_RR( "sxtab r0, r",0, HH1,", r",1, HH2,"")
893 TEST_RR( "sxtab r14,r",12, HH2,", r",10,HH1,", ror #8") 895 TEST_RR( "sxtab r14,r",12, HH2,", r",10,HH1,", ror #8")
894 TEST_R( "sxtb r8, r",7, HH1,"") 896 TEST_R( "sxtb r8, r",7, HH1,"")
895 TEST_UNSUPPORTED(".word 0xe6acf47a @ sxtab pc,r12, r10, ror #8") 897 TEST_UNSUPPORTED(__inst_arm(0xe6acf47a) " @ sxtab pc,r12, r10, ror #8")
896 898
897 TEST_R( "rev r0, r",0, VAL1,"") 899 TEST_R( "rev r0, r",0, VAL1,"")
898 TEST_R( "rev r14, r",12, VAL2,"") 900 TEST_R( "rev r14, r",12, VAL2,"")
899 TEST_UNSUPPORTED(".word 0xe6bfff3c @ rev pc, r12") 901 TEST_UNSUPPORTED(__inst_arm(0xe6bfff3c) " @ rev pc, r12")
900 902
901 TEST_RR( "sxtah r0, r",0, HH1,", r",1, HH2,"") 903 TEST_RR( "sxtah r0, r",0, HH1,", r",1, HH2,"")
902 TEST_RR( "sxtah r14,r",12, HH2,", r",10,HH1,", ror #8") 904 TEST_RR( "sxtah r14,r",12, HH2,", r",10,HH1,", ror #8")
903 TEST_R( "sxth r8, r",7, HH1,"") 905 TEST_R( "sxth r8, r",7, HH1,"")
904 TEST_UNSUPPORTED(".word 0xe6bcf47a @ sxtah pc,r12, r10, ror #8") 906 TEST_UNSUPPORTED(__inst_arm(0xe6bcf47a) " @ sxtah pc,r12, r10, ror #8")
905 907
906 TEST_R( "rev16 r0, r",0, VAL1,"") 908 TEST_R( "rev16 r0, r",0, VAL1,"")
907 TEST_R( "rev16 r14, r",12, VAL2,"") 909 TEST_R( "rev16 r14, r",12, VAL2,"")
908 TEST_UNSUPPORTED(".word 0xe6bfffbc @ rev16 pc, r12") 910 TEST_UNSUPPORTED(__inst_arm(0xe6bfffbc) " @ rev16 pc, r12")
909 911
910 TEST_RR( "uxtab16 r0, r",0, HH1,", r",1, HH2,"") 912 TEST_RR( "uxtab16 r0, r",0, HH1,", r",1, HH2,"")
911 TEST_RR( "uxtab16 r14,r",12, HH2,", r",10,HH1,", ror #8") 913 TEST_RR( "uxtab16 r14,r",12, HH2,", r",10,HH1,", ror #8")
912 TEST_R( "uxtb16 r8, r",7, HH1,"") 914 TEST_R( "uxtb16 r8, r",7, HH1,"")
913 TEST_UNSUPPORTED(".word 0xe6ccf47a @ uxtab16 pc,r12, r10, ror #8") 915 TEST_UNSUPPORTED(__inst_arm(0xe6ccf47a) " @ uxtab16 pc,r12, r10, ror #8")
914 916
915 TEST_R( "usat16 r0, #12, r",0, HH1,"") 917 TEST_R( "usat16 r0, #12, r",0, HH1,"")
916 TEST_R( "usat16 r14, #12, r",12, HH2,"") 918 TEST_R( "usat16 r14, #12, r",12, HH2,"")
917 TEST_UNSUPPORTED(".word 0xe6ecff3c @ usat16 pc, #12, r12") 919 TEST_UNSUPPORTED(__inst_arm(0xe6ecff3c) " @ usat16 pc, #12, r12")
918 TEST_UNSUPPORTED(".word 0xe6ecef3f @ usat16 r14, #12, pc") 920 TEST_UNSUPPORTED(__inst_arm(0xe6ecef3f) " @ usat16 r14, #12, pc")
919 921
920 TEST_RR( "uxtab r0, r",0, HH1,", r",1, HH2,"") 922 TEST_RR( "uxtab r0, r",0, HH1,", r",1, HH2,"")
921 TEST_RR( "uxtab r14,r",12, HH2,", r",10,HH1,", ror #8") 923 TEST_RR( "uxtab r14,r",12, HH2,", r",10,HH1,", ror #8")
922 TEST_R( "uxtb r8, r",7, HH1,"") 924 TEST_R( "uxtb r8, r",7, HH1,"")
923 TEST_UNSUPPORTED(".word 0xe6ecf47a @ uxtab pc,r12, r10, ror #8") 925 TEST_UNSUPPORTED(__inst_arm(0xe6ecf47a) " @ uxtab pc,r12, r10, ror #8")
924 926
925#if __LINUX_ARM_ARCH__ >= 7 927#if __LINUX_ARM_ARCH__ >= 7
926 TEST_R( "rbit r0, r",0, VAL1,"") 928 TEST_R( "rbit r0, r",0, VAL1,"")
927 TEST_R( "rbit r14, r",12, VAL2,"") 929 TEST_R( "rbit r14, r",12, VAL2,"")
928 TEST_UNSUPPORTED(".word 0xe6ffff3c @ rbit pc, r12") 930 TEST_UNSUPPORTED(__inst_arm(0xe6ffff3c) " @ rbit pc, r12")
929#endif 931#endif
930 932
931 TEST_RR( "uxtah r0, r",0, HH1,", r",1, HH2,"") 933 TEST_RR( "uxtah r0, r",0, HH1,", r",1, HH2,"")
932 TEST_RR( "uxtah r14,r",12, HH2,", r",10,HH1,", ror #8") 934 TEST_RR( "uxtah r14,r",12, HH2,", r",10,HH1,", ror #8")
933 TEST_R( "uxth r8, r",7, HH1,"") 935 TEST_R( "uxth r8, r",7, HH1,"")
934 TEST_UNSUPPORTED(".word 0xe6fff077 @ uxth pc, r7") 936 TEST_UNSUPPORTED(__inst_arm(0xe6fff077) " @ uxth pc, r7")
935 TEST_UNSUPPORTED(".word 0xe6ff807f @ uxth r8, pc") 937 TEST_UNSUPPORTED(__inst_arm(0xe6ff807f) " @ uxth r8, pc")
936 TEST_UNSUPPORTED(".word 0xe6fcf47a @ uxtah pc, r12, r10, ror #8") 938 TEST_UNSUPPORTED(__inst_arm(0xe6fcf47a) " @ uxtah pc, r12, r10, ror #8")
937 TEST_UNSUPPORTED(".word 0xe6fce47f @ uxtah r14, r12, pc, ror #8") 939 TEST_UNSUPPORTED(__inst_arm(0xe6fce47f) " @ uxtah r14, r12, pc, ror #8")
938 940
939 TEST_R( "revsh r0, r",0, VAL1,"") 941 TEST_R( "revsh r0, r",0, VAL1,"")
940 TEST_R( "revsh r14, r",12, VAL2,"") 942 TEST_R( "revsh r14, r",12, VAL2,"")
941 TEST_UNSUPPORTED(".word 0xe6ffff3c @ revsh pc, r12") 943 TEST_UNSUPPORTED(__inst_arm(0xe6ffff3c) " @ revsh pc, r12")
942 TEST_UNSUPPORTED(".word 0xe6ffef3f @ revsh r14, pc") 944 TEST_UNSUPPORTED(__inst_arm(0xe6ffef3f) " @ revsh r14, pc")
943 945
944 TEST_UNSUPPORTED(".word 0xe6900070") /* Unallocated space */ 946 TEST_UNSUPPORTED(__inst_arm(0xe6900070) "") /* Unallocated space */
945 TEST_UNSUPPORTED(".word 0xe69fff7f") /* Unallocated space */ 947 TEST_UNSUPPORTED(__inst_arm(0xe69fff7f) "") /* Unallocated space */
946 948
947 TEST_UNSUPPORTED(".word 0xe6d00070") /* Unallocated space */ 949 TEST_UNSUPPORTED(__inst_arm(0xe6d00070) "") /* Unallocated space */
948 TEST_UNSUPPORTED(".word 0xe6dfff7f") /* Unallocated space */ 950 TEST_UNSUPPORTED(__inst_arm(0xe6dfff7f) "") /* Unallocated space */
949#endif /* __LINUX_ARM_ARCH__ >= 6 */ 951#endif /* __LINUX_ARM_ARCH__ >= 6 */
950 952
951#if __LINUX_ARM_ARCH__ >= 6 953#if __LINUX_ARM_ARCH__ >= 6
@@ -953,79 +955,79 @@ void kprobe_arm_test_cases(void)
953 955
954 TEST_RRR( "smlad r0, r",0, HH1,", r",1, HH2,", r",2, VAL1,"") 956 TEST_RRR( "smlad r0, r",0, HH1,", r",1, HH2,", r",2, VAL1,"")
955 TEST_RRR( "smlad r14, r",12,HH2,", r",10,HH1,", r",8, VAL2,"") 957 TEST_RRR( "smlad r14, r",12,HH2,", r",10,HH1,", r",8, VAL2,"")
956 TEST_UNSUPPORTED(".word 0xe70f8a1c @ smlad pc, r12, r10, r8") 958 TEST_UNSUPPORTED(__inst_arm(0xe70f8a1c) " @ smlad pc, r12, r10, r8")
957 TEST_RRR( "smladx r0, r",0, HH1,", r",1, HH2,", r",2, VAL1,"") 959 TEST_RRR( "smladx r0, r",0, HH1,", r",1, HH2,", r",2, VAL1,"")
958 TEST_RRR( "smladx r14, r",12,HH2,", r",10,HH1,", r",8, VAL2,"") 960 TEST_RRR( "smladx r14, r",12,HH2,", r",10,HH1,", r",8, VAL2,"")
959 TEST_UNSUPPORTED(".word 0xe70f8a3c @ smladx pc, r12, r10, r8") 961 TEST_UNSUPPORTED(__inst_arm(0xe70f8a3c) " @ smladx pc, r12, r10, r8")
960 962
961 TEST_RR( "smuad r0, r",0, HH1,", r",1, HH2,"") 963 TEST_RR( "smuad r0, r",0, HH1,", r",1, HH2,"")
962 TEST_RR( "smuad r14, r",12,HH2,", r",10,HH1,"") 964 TEST_RR( "smuad r14, r",12,HH2,", r",10,HH1,"")
963 TEST_UNSUPPORTED(".word 0xe70ffa1c @ smuad pc, r12, r10") 965 TEST_UNSUPPORTED(__inst_arm(0xe70ffa1c) " @ smuad pc, r12, r10")
964 TEST_RR( "smuadx r0, r",0, HH1,", r",1, HH2,"") 966 TEST_RR( "smuadx r0, r",0, HH1,", r",1, HH2,"")
965 TEST_RR( "smuadx r14, r",12,HH2,", r",10,HH1,"") 967 TEST_RR( "smuadx r14, r",12,HH2,", r",10,HH1,"")
966 TEST_UNSUPPORTED(".word 0xe70ffa3c @ smuadx pc, r12, r10") 968 TEST_UNSUPPORTED(__inst_arm(0xe70ffa3c) " @ smuadx pc, r12, r10")
967 969
968 TEST_RRR( "smlsd r0, r",0, HH1,", r",1, HH2,", r",2, VAL1,"") 970 TEST_RRR( "smlsd r0, r",0, HH1,", r",1, HH2,", r",2, VAL1,"")
969 TEST_RRR( "smlsd r14, r",12,HH2,", r",10,HH1,", r",8, VAL2,"") 971 TEST_RRR( "smlsd r14, r",12,HH2,", r",10,HH1,", r",8, VAL2,"")
970 TEST_UNSUPPORTED(".word 0xe70f8a5c @ smlsd pc, r12, r10, r8") 972 TEST_UNSUPPORTED(__inst_arm(0xe70f8a5c) " @ smlsd pc, r12, r10, r8")
971 TEST_RRR( "smlsdx r0, r",0, HH1,", r",1, HH2,", r",2, VAL1,"") 973 TEST_RRR( "smlsdx r0, r",0, HH1,", r",1, HH2,", r",2, VAL1,"")
972 TEST_RRR( "smlsdx r14, r",12,HH2,", r",10,HH1,", r",8, VAL2,"") 974 TEST_RRR( "smlsdx r14, r",12,HH2,", r",10,HH1,", r",8, VAL2,"")
973 TEST_UNSUPPORTED(".word 0xe70f8a7c @ smlsdx pc, r12, r10, r8") 975 TEST_UNSUPPORTED(__inst_arm(0xe70f8a7c) " @ smlsdx pc, r12, r10, r8")
974 976
975 TEST_RR( "smusd r0, r",0, HH1,", r",1, HH2,"") 977 TEST_RR( "smusd r0, r",0, HH1,", r",1, HH2,"")
976 TEST_RR( "smusd r14, r",12,HH2,", r",10,HH1,"") 978 TEST_RR( "smusd r14, r",12,HH2,", r",10,HH1,"")
977 TEST_UNSUPPORTED(".word 0xe70ffa5c @ smusd pc, r12, r10") 979 TEST_UNSUPPORTED(__inst_arm(0xe70ffa5c) " @ smusd pc, r12, r10")
978 TEST_RR( "smusdx r0, r",0, HH1,", r",1, HH2,"") 980 TEST_RR( "smusdx r0, r",0, HH1,", r",1, HH2,"")
979 TEST_RR( "smusdx r14, r",12,HH2,", r",10,HH1,"") 981 TEST_RR( "smusdx r14, r",12,HH2,", r",10,HH1,"")
980 TEST_UNSUPPORTED(".word 0xe70ffa7c @ smusdx pc, r12, r10") 982 TEST_UNSUPPORTED(__inst_arm(0xe70ffa7c) " @ smusdx pc, r12, r10")
981 983
982 TEST_RRRR( "smlald r",0, VAL1,", r",1, VAL2, ", r",0, HH1,", r",1, HH2) 984 TEST_RRRR( "smlald r",0, VAL1,", r",1, VAL2, ", r",0, HH1,", r",1, HH2)
983 TEST_RRRR( "smlald r",11,VAL2,", r",10,VAL1, ", r",9, HH2,", r",8, HH1) 985 TEST_RRRR( "smlald r",11,VAL2,", r",10,VAL1, ", r",9, HH2,", r",8, HH1)
984 TEST_UNSUPPORTED(".word 0xe74af819 @ smlald pc, r10, r9, r8") 986 TEST_UNSUPPORTED(__inst_arm(0xe74af819) " @ smlald pc, r10, r9, r8")
985 TEST_UNSUPPORTED(".word 0xe74fb819 @ smlald r11, pc, r9, r8") 987 TEST_UNSUPPORTED(__inst_arm(0xe74fb819) " @ smlald r11, pc, r9, r8")
986 TEST_UNSUPPORTED(".word 0xe74ab81f @ smlald r11, r10, pc, r8") 988 TEST_UNSUPPORTED(__inst_arm(0xe74ab81f) " @ smlald r11, r10, pc, r8")
987 TEST_UNSUPPORTED(".word 0xe74abf19 @ smlald r11, r10, r9, pc") 989 TEST_UNSUPPORTED(__inst_arm(0xe74abf19) " @ smlald r11, r10, r9, pc")
988 990
989 TEST_RRRR( "smlaldx r",0, VAL1,", r",1, VAL2, ", r",0, HH1,", r",1, HH2) 991 TEST_RRRR( "smlaldx r",0, VAL1,", r",1, VAL2, ", r",0, HH1,", r",1, HH2)
990 TEST_RRRR( "smlaldx r",11,VAL2,", r",10,VAL1, ", r",9, HH2,", r",8, HH1) 992 TEST_RRRR( "smlaldx r",11,VAL2,", r",10,VAL1, ", r",9, HH2,", r",8, HH1)
991 TEST_UNSUPPORTED(".word 0xe74af839 @ smlaldx pc, r10, r9, r8") 993 TEST_UNSUPPORTED(__inst_arm(0xe74af839) " @ smlaldx pc, r10, r9, r8")
992 TEST_UNSUPPORTED(".word 0xe74fb839 @ smlaldx r11, pc, r9, r8") 994 TEST_UNSUPPORTED(__inst_arm(0xe74fb839) " @ smlaldx r11, pc, r9, r8")
993 995
994 TEST_RRR( "smmla r0, r",0, VAL1,", r",1, VAL2,", r",2, VAL1,"") 996 TEST_RRR( "smmla r0, r",0, VAL1,", r",1, VAL2,", r",2, VAL1,"")
995 TEST_RRR( "smmla r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL2,"") 997 TEST_RRR( "smmla r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL2,"")
996 TEST_UNSUPPORTED(".word 0xe75f8a1c @ smmla pc, r12, r10, r8") 998 TEST_UNSUPPORTED(__inst_arm(0xe75f8a1c) " @ smmla pc, r12, r10, r8")
997 TEST_RRR( "smmlar r0, r",0, VAL1,", r",1, VAL2,", r",2, VAL1,"") 999 TEST_RRR( "smmlar r0, r",0, VAL1,", r",1, VAL2,", r",2, VAL1,"")
998 TEST_RRR( "smmlar r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL2,"") 1000 TEST_RRR( "smmlar r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL2,"")
999 TEST_UNSUPPORTED(".word 0xe75f8a3c @ smmlar pc, r12, r10, r8") 1001 TEST_UNSUPPORTED(__inst_arm(0xe75f8a3c) " @ smmlar pc, r12, r10, r8")
1000 1002
1001 TEST_RR( "smmul r0, r",0, VAL1,", r",1, VAL2,"") 1003 TEST_RR( "smmul r0, r",0, VAL1,", r",1, VAL2,"")
1002 TEST_RR( "smmul r14, r",12,VAL2,", r",10,VAL1,"") 1004 TEST_RR( "smmul r14, r",12,VAL2,", r",10,VAL1,"")
1003 TEST_UNSUPPORTED(".word 0xe75ffa1c @ smmul pc, r12, r10") 1005 TEST_UNSUPPORTED(__inst_arm(0xe75ffa1c) " @ smmul pc, r12, r10")
1004 TEST_RR( "smmulr r0, r",0, VAL1,", r",1, VAL2,"") 1006 TEST_RR( "smmulr r0, r",0, VAL1,", r",1, VAL2,"")
1005 TEST_RR( "smmulr r14, r",12,VAL2,", r",10,VAL1,"") 1007 TEST_RR( "smmulr r14, r",12,VAL2,", r",10,VAL1,"")
1006 TEST_UNSUPPORTED(".word 0xe75ffa3c @ smmulr pc, r12, r10") 1008 TEST_UNSUPPORTED(__inst_arm(0xe75ffa3c) " @ smmulr pc, r12, r10")
1007 1009
1008 TEST_RRR( "smmls r0, r",0, VAL1,", r",1, VAL2,", r",2, VAL1,"") 1010 TEST_RRR( "smmls r0, r",0, VAL1,", r",1, VAL2,", r",2, VAL1,"")
1009 TEST_RRR( "smmls r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL2,"") 1011 TEST_RRR( "smmls r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL2,"")
1010 TEST_UNSUPPORTED(".word 0xe75f8adc @ smmls pc, r12, r10, r8") 1012 TEST_UNSUPPORTED(__inst_arm(0xe75f8adc) " @ smmls pc, r12, r10, r8")
1011 TEST_RRR( "smmlsr r0, r",0, VAL1,", r",1, VAL2,", r",2, VAL1,"") 1013 TEST_RRR( "smmlsr r0, r",0, VAL1,", r",1, VAL2,", r",2, VAL1,"")
1012 TEST_RRR( "smmlsr r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL2,"") 1014 TEST_RRR( "smmlsr r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL2,"")
1013 TEST_UNSUPPORTED(".word 0xe75f8afc @ smmlsr pc, r12, r10, r8") 1015 TEST_UNSUPPORTED(__inst_arm(0xe75f8afc) " @ smmlsr pc, r12, r10, r8")
1014 TEST_UNSUPPORTED(".word 0xe75e8aff @ smmlsr r14, pc, r10, r8") 1016 TEST_UNSUPPORTED(__inst_arm(0xe75e8aff) " @ smmlsr r14, pc, r10, r8")
1015 TEST_UNSUPPORTED(".word 0xe75e8ffc @ smmlsr r14, r12, pc, r8") 1017 TEST_UNSUPPORTED(__inst_arm(0xe75e8ffc) " @ smmlsr r14, r12, pc, r8")
1016 TEST_UNSUPPORTED(".word 0xe75efafc @ smmlsr r14, r12, r10, pc") 1018 TEST_UNSUPPORTED(__inst_arm(0xe75efafc) " @ smmlsr r14, r12, r10, pc")
1017 1019
1018 TEST_RR( "usad8 r0, r",0, VAL1,", r",1, VAL2,"") 1020 TEST_RR( "usad8 r0, r",0, VAL1,", r",1, VAL2,"")
1019 TEST_RR( "usad8 r14, r",12,VAL2,", r",10,VAL1,"") 1021 TEST_RR( "usad8 r14, r",12,VAL2,", r",10,VAL1,"")
1020 TEST_UNSUPPORTED(".word 0xe75ffa1c @ usad8 pc, r12, r10") 1022 TEST_UNSUPPORTED(__inst_arm(0xe75ffa1c) " @ usad8 pc, r12, r10")
1021 TEST_UNSUPPORTED(".word 0xe75efa1f @ usad8 r14, pc, r10") 1023 TEST_UNSUPPORTED(__inst_arm(0xe75efa1f) " @ usad8 r14, pc, r10")
1022 TEST_UNSUPPORTED(".word 0xe75eff1c @ usad8 r14, r12, pc") 1024 TEST_UNSUPPORTED(__inst_arm(0xe75eff1c) " @ usad8 r14, r12, pc")
1023 1025
1024 TEST_RRR( "usada8 r0, r",0, VAL1,", r",1, VAL2,", r",2, VAL3,"") 1026 TEST_RRR( "usada8 r0, r",0, VAL1,", r",1, VAL2,", r",2, VAL3,"")
1025 TEST_RRR( "usada8 r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL3,"") 1027 TEST_RRR( "usada8 r14, r",12,VAL2,", r",10,VAL1,", r",8, VAL3,"")
1026 TEST_UNSUPPORTED(".word 0xe78f8a1c @ usada8 pc, r12, r10, r8") 1028 TEST_UNSUPPORTED(__inst_arm(0xe78f8a1c) " @ usada8 pc, r12, r10, r8")
1027 TEST_UNSUPPORTED(".word 0xe78e8a1f @ usada8 r14, pc, r10, r8") 1029 TEST_UNSUPPORTED(__inst_arm(0xe78e8a1f) " @ usada8 r14, pc, r10, r8")
1028 TEST_UNSUPPORTED(".word 0xe78e8f1c @ usada8 r14, r12, pc, r8") 1030 TEST_UNSUPPORTED(__inst_arm(0xe78e8f1c) " @ usada8 r14, r12, pc, r8")
1029#endif /* __LINUX_ARM_ARCH__ >= 6 */ 1031#endif /* __LINUX_ARM_ARCH__ >= 6 */
1030 1032
1031#if __LINUX_ARM_ARCH__ >= 7 1033#if __LINUX_ARM_ARCH__ >= 7
@@ -1034,26 +1036,26 @@ void kprobe_arm_test_cases(void)
1034 TEST_R( "sbfx r0, r",0 , VAL1,", #0, #31") 1036 TEST_R( "sbfx r0, r",0 , VAL1,", #0, #31")
1035 TEST_R( "sbfxeq r14, r",12, VAL2,", #8, #16") 1037 TEST_R( "sbfxeq r14, r",12, VAL2,", #8, #16")
1036 TEST_R( "sbfx r4, r",10, VAL1,", #16, #15") 1038 TEST_R( "sbfx r4, r",10, VAL1,", #16, #15")
1037 TEST_UNSUPPORTED(".word 0xe7aff45c @ sbfx pc, r12, #8, #16") 1039 TEST_UNSUPPORTED(__inst_arm(0xe7aff45c) " @ sbfx pc, r12, #8, #16")
1038 1040
1039 TEST_R( "ubfx r0, r",0 , VAL1,", #0, #31") 1041 TEST_R( "ubfx r0, r",0 , VAL1,", #0, #31")
1040 TEST_R( "ubfxcs r14, r",12, VAL2,", #8, #16") 1042 TEST_R( "ubfxcs r14, r",12, VAL2,", #8, #16")
1041 TEST_R( "ubfx r4, r",10, VAL1,", #16, #15") 1043 TEST_R( "ubfx r4, r",10, VAL1,", #16, #15")
1042 TEST_UNSUPPORTED(".word 0xe7eff45c @ ubfx pc, r12, #8, #16") 1044 TEST_UNSUPPORTED(__inst_arm(0xe7eff45c) " @ ubfx pc, r12, #8, #16")
1043 TEST_UNSUPPORTED(".word 0xe7efc45f @ ubfx r12, pc, #8, #16") 1045 TEST_UNSUPPORTED(__inst_arm(0xe7efc45f) " @ ubfx r12, pc, #8, #16")
1044 1046
1045 TEST_R( "bfc r",0, VAL1,", #4, #20") 1047 TEST_R( "bfc r",0, VAL1,", #4, #20")
1046 TEST_R( "bfcvs r",14,VAL2,", #4, #20") 1048 TEST_R( "bfcvs r",14,VAL2,", #4, #20")
1047 TEST_R( "bfc r",7, VAL1,", #0, #31") 1049 TEST_R( "bfc r",7, VAL1,", #0, #31")
1048 TEST_R( "bfc r",8, VAL2,", #0, #31") 1050 TEST_R( "bfc r",8, VAL2,", #0, #31")
1049 TEST_UNSUPPORTED(".word 0xe7def01f @ bfc pc, #0, #31"); 1051 TEST_UNSUPPORTED(__inst_arm(0xe7def01f) " @ bfc pc, #0, #31");
1050 1052
1051 TEST_RR( "bfi r",0, VAL1,", r",0 , VAL2,", #0, #31") 1053 TEST_RR( "bfi r",0, VAL1,", r",0 , VAL2,", #0, #31")
1052 TEST_RR( "bfipl r",12,VAL1,", r",14 , VAL2,", #4, #20") 1054 TEST_RR( "bfipl r",12,VAL1,", r",14 , VAL2,", #4, #20")
1053 TEST_UNSUPPORTED(".word 0xe7d7f21e @ bfi pc, r14, #4, #20") 1055 TEST_UNSUPPORTED(__inst_arm(0xe7d7f21e) " @ bfi pc, r14, #4, #20")
1054 1056
1055 TEST_UNSUPPORTED(".word 0x07f000f0") /* Permanently UNDEFINED */ 1057 TEST_UNSUPPORTED(__inst_arm(0x07f000f0) "") /* Permanently UNDEFINED */
1056 TEST_UNSUPPORTED(".word 0x07ffffff") /* Permanently UNDEFINED */ 1058 TEST_UNSUPPORTED(__inst_arm(0x07ffffff) "") /* Permanently UNDEFINED */
1057#endif /* __LINUX_ARM_ARCH__ >= 6 */ 1059#endif /* __LINUX_ARM_ARCH__ >= 6 */
1058 1060
1059 TEST_GROUP("Branch, branch with link, and block data transfer") 1061 TEST_GROUP("Branch, branch with link, and block data transfer")
@@ -1180,43 +1182,43 @@ void kprobe_arm_test_cases(void)
1180 \ 1182 \
1181 TEST_COPROCESSOR( "stc"two" 0, cr0, [r15, #4]") \ 1183 TEST_COPROCESSOR( "stc"two" 0, cr0, [r15, #4]") \
1182 TEST_COPROCESSOR( "stc"two" 0, cr0, [r15, #-4]") \ 1184 TEST_COPROCESSOR( "stc"two" 0, cr0, [r15, #-4]") \
1183 TEST_UNSUPPORTED(".word 0x"cc"daf0001 @ stc"two" 0, cr0, [r15, #4]!") \ 1185 TEST_UNSUPPORTED(__inst_arm(0x##cc##daf0001) " @ stc"two" 0, cr0, [r15, #4]!") \
1184 TEST_UNSUPPORTED(".word 0x"cc"d2f0001 @ stc"two" 0, cr0, [r15, #-4]!") \ 1186 TEST_UNSUPPORTED(__inst_arm(0x##cc##d2f0001) " @ stc"two" 0, cr0, [r15, #-4]!") \
1185 TEST_UNSUPPORTED(".word 0x"cc"caf0001 @ stc"two" 0, cr0, [r15], #4") \ 1187 TEST_UNSUPPORTED(__inst_arm(0x##cc##caf0001) " @ stc"two" 0, cr0, [r15], #4") \
1186 TEST_UNSUPPORTED(".word 0x"cc"c2f0001 @ stc"two" 0, cr0, [r15], #-4") \ 1188 TEST_UNSUPPORTED(__inst_arm(0x##cc##c2f0001) " @ stc"two" 0, cr0, [r15], #-4") \
1187 TEST_COPROCESSOR( "stc"two" 0, cr0, [r15], {1}") \ 1189 TEST_COPROCESSOR( "stc"two" 0, cr0, [r15], {1}") \
1188 TEST_COPROCESSOR( "stc"two"l 0, cr0, [r15, #4]") \ 1190 TEST_COPROCESSOR( "stc"two"l 0, cr0, [r15, #4]") \
1189 TEST_COPROCESSOR( "stc"two"l 0, cr0, [r15, #-4]") \ 1191 TEST_COPROCESSOR( "stc"two"l 0, cr0, [r15, #-4]") \
1190 TEST_UNSUPPORTED(".word 0x"cc"def0001 @ stc"two"l 0, cr0, [r15, #4]!") \ 1192 TEST_UNSUPPORTED(__inst_arm(0x##cc##def0001) " @ stc"two"l 0, cr0, [r15, #4]!") \
1191 TEST_UNSUPPORTED(".word 0x"cc"d6f0001 @ stc"two"l 0, cr0, [r15, #-4]!") \ 1193 TEST_UNSUPPORTED(__inst_arm(0x##cc##d6f0001) " @ stc"two"l 0, cr0, [r15, #-4]!") \
1192 TEST_UNSUPPORTED(".word 0x"cc"cef0001 @ stc"two"l 0, cr0, [r15], #4") \ 1194 TEST_UNSUPPORTED(__inst_arm(0x##cc##cef0001) " @ stc"two"l 0, cr0, [r15], #4") \
1193 TEST_UNSUPPORTED(".word 0x"cc"c6f0001 @ stc"two"l 0, cr0, [r15], #-4") \ 1195 TEST_UNSUPPORTED(__inst_arm(0x##cc##c6f0001) " @ stc"two"l 0, cr0, [r15], #-4") \
1194 TEST_COPROCESSOR( "stc"two"l 0, cr0, [r15], {1}") \ 1196 TEST_COPROCESSOR( "stc"two"l 0, cr0, [r15], {1}") \
1195 TEST_COPROCESSOR( "ldc"two" 0, cr0, [r15, #4]") \ 1197 TEST_COPROCESSOR( "ldc"two" 0, cr0, [r15, #4]") \
1196 TEST_COPROCESSOR( "ldc"two" 0, cr0, [r15, #-4]") \ 1198 TEST_COPROCESSOR( "ldc"two" 0, cr0, [r15, #-4]") \
1197 TEST_UNSUPPORTED(".word 0x"cc"dbf0001 @ ldc"two" 0, cr0, [r15, #4]!") \ 1199 TEST_UNSUPPORTED(__inst_arm(0x##cc##dbf0001) " @ ldc"two" 0, cr0, [r15, #4]!") \
1198 TEST_UNSUPPORTED(".word 0x"cc"d3f0001 @ ldc"two" 0, cr0, [r15, #-4]!") \ 1200 TEST_UNSUPPORTED(__inst_arm(0x##cc##d3f0001) " @ ldc"two" 0, cr0, [r15, #-4]!") \
1199 TEST_UNSUPPORTED(".word 0x"cc"cbf0001 @ ldc"two" 0, cr0, [r15], #4") \ 1201 TEST_UNSUPPORTED(__inst_arm(0x##cc##cbf0001) " @ ldc"two" 0, cr0, [r15], #4") \
1200 TEST_UNSUPPORTED(".word 0x"cc"c3f0001 @ ldc"two" 0, cr0, [r15], #-4") \ 1202 TEST_UNSUPPORTED(__inst_arm(0x##cc##c3f0001) " @ ldc"two" 0, cr0, [r15], #-4") \
1201 TEST_COPROCESSOR( "ldc"two" 0, cr0, [r15], {1}") \ 1203 TEST_COPROCESSOR( "ldc"two" 0, cr0, [r15], {1}") \
1202 TEST_COPROCESSOR( "ldc"two"l 0, cr0, [r15, #4]") \ 1204 TEST_COPROCESSOR( "ldc"two"l 0, cr0, [r15, #4]") \
1203 TEST_COPROCESSOR( "ldc"two"l 0, cr0, [r15, #-4]") \ 1205 TEST_COPROCESSOR( "ldc"two"l 0, cr0, [r15, #-4]") \
1204 TEST_UNSUPPORTED(".word 0x"cc"dff0001 @ ldc"two"l 0, cr0, [r15, #4]!") \ 1206 TEST_UNSUPPORTED(__inst_arm(0x##cc##dff0001) " @ ldc"two"l 0, cr0, [r15, #4]!") \
1205 TEST_UNSUPPORTED(".word 0x"cc"d7f0001 @ ldc"two"l 0, cr0, [r15, #-4]!") \ 1207 TEST_UNSUPPORTED(__inst_arm(0x##cc##d7f0001) " @ ldc"two"l 0, cr0, [r15, #-4]!") \
1206 TEST_UNSUPPORTED(".word 0x"cc"cff0001 @ ldc"two"l 0, cr0, [r15], #4") \ 1208 TEST_UNSUPPORTED(__inst_arm(0x##cc##cff0001) " @ ldc"two"l 0, cr0, [r15], #4") \
1207 TEST_UNSUPPORTED(".word 0x"cc"c7f0001 @ ldc"two"l 0, cr0, [r15], #-4") \ 1209 TEST_UNSUPPORTED(__inst_arm(0x##cc##c7f0001) " @ ldc"two"l 0, cr0, [r15], #-4") \
1208 TEST_COPROCESSOR( "ldc"two"l 0, cr0, [r15], {1}") 1210 TEST_COPROCESSOR( "ldc"two"l 0, cr0, [r15], {1}")
1209 1211
1210#define COPROCESSOR_INSTRUCTIONS_MC_MR(two,cc) \ 1212#define COPROCESSOR_INSTRUCTIONS_MC_MR(two,cc) \
1211 \ 1213 \
1212 TEST_COPROCESSOR( "mcrr"two" 0, 15, r0, r14, cr0") \ 1214 TEST_COPROCESSOR( "mcrr"two" 0, 15, r0, r14, cr0") \
1213 TEST_COPROCESSOR( "mcrr"two" 15, 0, r14, r0, cr15") \ 1215 TEST_COPROCESSOR( "mcrr"two" 15, 0, r14, r0, cr15") \
1214 TEST_UNSUPPORTED(".word 0x"cc"c4f00f0 @ mcrr"two" 0, 15, r0, r15, cr0") \ 1216 TEST_UNSUPPORTED(__inst_arm(0x##cc##c4f00f0) " @ mcrr"two" 0, 15, r0, r15, cr0") \
1215 TEST_UNSUPPORTED(".word 0x"cc"c40ff0f @ mcrr"two" 15, 0, r15, r0, cr15") \ 1217 TEST_UNSUPPORTED(__inst_arm(0x##cc##c40ff0f) " @ mcrr"two" 15, 0, r15, r0, cr15") \
1216 TEST_COPROCESSOR( "mrrc"two" 0, 15, r0, r14, cr0") \ 1218 TEST_COPROCESSOR( "mrrc"two" 0, 15, r0, r14, cr0") \
1217 TEST_COPROCESSOR( "mrrc"two" 15, 0, r14, r0, cr15") \ 1219 TEST_COPROCESSOR( "mrrc"two" 15, 0, r14, r0, cr15") \
1218 TEST_UNSUPPORTED(".word 0x"cc"c5f00f0 @ mrrc"two" 0, 15, r0, r15, cr0") \ 1220 TEST_UNSUPPORTED(__inst_arm(0x##cc##c5f00f0) " @ mrrc"two" 0, 15, r0, r15, cr0") \
1219 TEST_UNSUPPORTED(".word 0x"cc"c50ff0f @ mrrc"two" 15, 0, r15, r0, cr15") \ 1221 TEST_UNSUPPORTED(__inst_arm(0x##cc##c50ff0f) " @ mrrc"two" 15, 0, r15, r0, cr15") \
1220 TEST_COPROCESSOR( "cdp"two" 15, 15, cr15, cr15, cr15, 7") \ 1222 TEST_COPROCESSOR( "cdp"two" 15, 15, cr15, cr15, cr15, 7") \
1221 TEST_COPROCESSOR( "cdp"two" 0, 0, cr0, cr0, cr0, 0") \ 1223 TEST_COPROCESSOR( "cdp"two" 0, 0, cr0, cr0, cr0, 0") \
1222 TEST_COPROCESSOR( "mcr"two" 15, 7, r15, cr15, cr15, 7") \ 1224 TEST_COPROCESSOR( "mcr"two" 15, 7, r15, cr15, cr15, 7") \
@@ -1224,8 +1226,8 @@ void kprobe_arm_test_cases(void)
1224 TEST_COPROCESSOR( "mrc"two" 15, 7, r15, cr15, cr15, 7") \ 1226 TEST_COPROCESSOR( "mrc"two" 15, 7, r15, cr15, cr15, 7") \
1225 TEST_COPROCESSOR( "mrc"two" 0, 0, r0, cr0, cr0, 0") 1227 TEST_COPROCESSOR( "mrc"two" 0, 0, r0, cr0, cr0, 0")
1226 1228
1227 COPROCESSOR_INSTRUCTIONS_ST_LD("","e") 1229 COPROCESSOR_INSTRUCTIONS_ST_LD("",e)
1228 COPROCESSOR_INSTRUCTIONS_MC_MR("","e") 1230 COPROCESSOR_INSTRUCTIONS_MC_MR("",e)
1229 TEST_UNSUPPORTED("svc 0") 1231 TEST_UNSUPPORTED("svc 0")
1230 TEST_UNSUPPORTED("svc 0xffffff") 1232 TEST_UNSUPPORTED("svc 0xffffff")
1231 1233
@@ -1251,14 +1253,14 @@ void kprobe_arm_test_cases(void)
1251 TEST_UNSUPPORTED("rfedb sp!") 1253 TEST_UNSUPPORTED("rfedb sp!")
1252 TEST_UNSUPPORTED("rfeia sp!") 1254 TEST_UNSUPPORTED("rfeia sp!")
1253 TEST_UNSUPPORTED("rfeib sp!") 1255 TEST_UNSUPPORTED("rfeib sp!")
1254 TEST_UNSUPPORTED(".word 0xf81d0a00 @ rfeda pc") 1256 TEST_UNSUPPORTED(__inst_arm(0xf81d0a00) " @ rfeda pc")
1255 TEST_UNSUPPORTED(".word 0xf91d0a00 @ rfedb pc") 1257 TEST_UNSUPPORTED(__inst_arm(0xf91d0a00) " @ rfedb pc")
1256 TEST_UNSUPPORTED(".word 0xf89d0a00 @ rfeia pc") 1258 TEST_UNSUPPORTED(__inst_arm(0xf89d0a00) " @ rfeia pc")
1257 TEST_UNSUPPORTED(".word 0xf99d0a00 @ rfeib pc") 1259 TEST_UNSUPPORTED(__inst_arm(0xf99d0a00) " @ rfeib pc")
1258 TEST_UNSUPPORTED(".word 0xf83d0a00 @ rfeda pc!") 1260 TEST_UNSUPPORTED(__inst_arm(0xf83d0a00) " @ rfeda pc!")
1259 TEST_UNSUPPORTED(".word 0xf93d0a00 @ rfedb pc!") 1261 TEST_UNSUPPORTED(__inst_arm(0xf93d0a00) " @ rfedb pc!")
1260 TEST_UNSUPPORTED(".word 0xf8bd0a00 @ rfeia pc!") 1262 TEST_UNSUPPORTED(__inst_arm(0xf8bd0a00) " @ rfeia pc!")
1261 TEST_UNSUPPORTED(".word 0xf9bd0a00 @ rfeib pc!") 1263 TEST_UNSUPPORTED(__inst_arm(0xf9bd0a00) " @ rfeib pc!")
1262#endif /* __LINUX_ARM_ARCH__ >= 6 */ 1264#endif /* __LINUX_ARM_ARCH__ >= 6 */
1263 1265
1264#if __LINUX_ARM_ARCH__ >= 6 1266#if __LINUX_ARM_ARCH__ >= 6
@@ -1285,9 +1287,9 @@ void kprobe_arm_test_cases(void)
1285 TEST( "blx __dummy_thumb_subroutine_odd") 1287 TEST( "blx __dummy_thumb_subroutine_odd")
1286#endif /* __LINUX_ARM_ARCH__ >= 6 */ 1288#endif /* __LINUX_ARM_ARCH__ >= 6 */
1287 1289
1288 COPROCESSOR_INSTRUCTIONS_ST_LD("2","f") 1290 COPROCESSOR_INSTRUCTIONS_ST_LD("2",f)
1289#if __LINUX_ARM_ARCH__ >= 6 1291#if __LINUX_ARM_ARCH__ >= 6
1290 COPROCESSOR_INSTRUCTIONS_MC_MR("2","f") 1292 COPROCESSOR_INSTRUCTIONS_MC_MR("2",f)
1291#endif 1293#endif
1292 1294
1293 TEST_GROUP("Miscellaneous instructions, memory hints, and Advanced SIMD instructions") 1295 TEST_GROUP("Miscellaneous instructions, memory hints, and Advanced SIMD instructions")
@@ -1317,9 +1319,9 @@ void kprobe_arm_test_cases(void)
1317#endif 1319#endif
1318 1320
1319#if __LINUX_ARM_ARCH__ >= 7 1321#if __LINUX_ARM_ARCH__ >= 7
1320 TEST_SUPPORTED( ".word 0xf590f000 @ pldw [r0, #0]") 1322 TEST_SUPPORTED( __inst_arm(0xf590f000) " @ pldw [r0, #0]")
1321 TEST_SUPPORTED( ".word 0xf797f000 @ pldw [r7, r0]") 1323 TEST_SUPPORTED( __inst_arm(0xf797f000) " @ pldw [r7, r0]")
1322 TEST_SUPPORTED( ".word 0xf798f18c @ pldw [r8, r12, lsl #3]"); 1324 TEST_SUPPORTED( __inst_arm(0xf798f18c) " @ pldw [r8, r12, lsl #3]");
1323#endif 1325#endif
1324 1326
1325#if __LINUX_ARM_ARCH__ >= 7 1327#if __LINUX_ARM_ARCH__ >= 7
diff --git a/arch/arm/kernel/kprobes-test-thumb.c b/arch/arm/kernel/kprobes-test-thumb.c
index 5d8b85792222..844dd10d8593 100644
--- a/arch/arm/kernel/kprobes-test-thumb.c
+++ b/arch/arm/kernel/kprobes-test-thumb.c
@@ -10,6 +10,7 @@
10 10
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/module.h> 12#include <linux/module.h>
13#include <asm/opcodes.h>
13 14
14#include "kprobes-test.h" 15#include "kprobes-test.h"
15 16
@@ -119,7 +120,7 @@ void kprobe_thumb16_test_cases(void)
119 TEST_R( "add sp" ", r",8,-8, "") 120 TEST_R( "add sp" ", r",8,-8, "")
120 TEST_R( "add r",14,VAL1,", pc") 121 TEST_R( "add r",14,VAL1,", pc")
121 TEST_BF_R("add pc" ", r",0,2f-1f-8,"") 122 TEST_BF_R("add pc" ", r",0,2f-1f-8,"")
122 TEST_UNSUPPORTED(".short 0x44ff @ add pc, pc") 123 TEST_UNSUPPORTED(__inst_thumb16(0x44ff) " @ add pc, pc")
123 124
124 TEST_RR( "cmp r",3,VAL1,", r",8,VAL2,"") 125 TEST_RR( "cmp r",3,VAL1,", r",8,VAL2,"")
125 TEST_RR( "cmp r",8,VAL2,", r",0,VAL1,"") 126 TEST_RR( "cmp r",8,VAL2,", r",0,VAL1,"")
@@ -150,7 +151,7 @@ void kprobe_thumb16_test_cases(void)
150 151
151 TEST_BF_R("blx r",0, 2f+1,"") 152 TEST_BF_R("blx r",0, 2f+1,"")
152 TEST_BB_R("blx r",14,2f+1,"") 153 TEST_BB_R("blx r",14,2f+1,"")
153 TEST_UNSUPPORTED(".short 0x47f8 @ blx pc") 154 TEST_UNSUPPORTED(__inst_thumb16(0x47f8) " @ blx pc")
154 155
155 TEST_GROUP("Load from Literal Pool") 156 TEST_GROUP("Load from Literal Pool")
156 157
@@ -237,8 +238,8 @@ DONT_TEST_IN_ITBLOCK(
237 TEST_R("rev r7, r",0, VAL2,"") 238 TEST_R("rev r7, r",0, VAL2,"")
238 TEST_R("rev16 r0, r",7, VAL1,"") 239 TEST_R("rev16 r0, r",7, VAL1,"")
239 TEST_R("rev16 r7, r",0, VAL2,"") 240 TEST_R("rev16 r7, r",0, VAL2,"")
240 TEST_UNSUPPORTED(".short 0xba80") 241 TEST_UNSUPPORTED(__inst_thumb16(0xba80) "")
241 TEST_UNSUPPORTED(".short 0xbabf") 242 TEST_UNSUPPORTED(__inst_thumb16(0xbabf) "")
242 TEST_R("revsh r0, r",7, VAL1,"") 243 TEST_R("revsh r0, r",7, VAL1,"")
243 TEST_R("revsh r7, r",0, VAL2,"") 244 TEST_R("revsh r7, r",0, VAL2,"")
244 245
@@ -272,8 +273,8 @@ DONT_TEST_IN_ITBLOCK(
272 TEST("nop") 273 TEST("nop")
273 TEST("wfi") 274 TEST("wfi")
274 TEST_SUPPORTED("wfe") 275 TEST_SUPPORTED("wfe")
275 TEST_UNSUPPORTED(".short 0xbf50") /* Unassigned hints */ 276 TEST_UNSUPPORTED(__inst_thumb16(0xbf50) "") /* Unassigned hints */
276 TEST_UNSUPPORTED(".short 0xbff0") /* Unassigned hints */ 277 TEST_UNSUPPORTED(__inst_thumb16(0xbff0) "") /* Unassigned hints */
277 278
278#define TEST_IT(code, code2) \ 279#define TEST_IT(code, code2) \
279 TESTCASE_START(code) \ 280 TESTCASE_START(code) \
@@ -310,8 +311,8 @@ CONDITION_INSTRUCTIONS(8,
310 TEST_BF("bgt 2f") 311 TEST_BF("bgt 2f")
311 TEST_BB("blt 2b") 312 TEST_BB("blt 2b")
312) 313)
313 TEST_UNSUPPORTED(".short 0xde00") 314 TEST_UNSUPPORTED(__inst_thumb16(0xde00) "")
314 TEST_UNSUPPORTED(".short 0xdeff") 315 TEST_UNSUPPORTED(__inst_thumb16(0xdeff) "")
315 TEST_UNSUPPORTED("svc #0x00") 316 TEST_UNSUPPORTED("svc #0x00")
316 TEST_UNSUPPORTED("svc #0xff") 317 TEST_UNSUPPORTED("svc #0xff")
317 318
@@ -380,13 +381,13 @@ void kprobe_thumb32_test_cases(void)
380 TEST_THUMB_TO_ARM_INTERWORK_P("ldmia r",0,14*4,", {r12,pc}") 381 TEST_THUMB_TO_ARM_INTERWORK_P("ldmia r",0,14*4,", {r12,pc}")
381 TEST_THUMB_TO_ARM_INTERWORK_P("ldmia r",13,2*4,", {r0-r12,pc}") 382 TEST_THUMB_TO_ARM_INTERWORK_P("ldmia r",13,2*4,", {r0-r12,pc}")
382 383
383 TEST_UNSUPPORTED(".short 0xe88f,0x0101 @ stmia pc, {r0,r8}") 384 TEST_UNSUPPORTED(__inst_thumb32(0xe88f0101) " @ stmia pc, {r0,r8}")
384 TEST_UNSUPPORTED(".short 0xe92f,0x5f00 @ stmdb pc!, {r8-r12,r14}") 385 TEST_UNSUPPORTED(__inst_thumb32(0xe92f5f00) " @ stmdb pc!, {r8-r12,r14}")
385 TEST_UNSUPPORTED(".short 0xe8bd,0xc000 @ ldmia r13!, {r14,pc}") 386 TEST_UNSUPPORTED(__inst_thumb32(0xe8bdc000) " @ ldmia r13!, {r14,pc}")
386 TEST_UNSUPPORTED(".short 0xe93e,0xc000 @ ldmdb r14!, {r14,pc}") 387 TEST_UNSUPPORTED(__inst_thumb32(0xe93ec000) " @ ldmdb r14!, {r14,pc}")
387 TEST_UNSUPPORTED(".short 0xe8a7,0x3f00 @ stmia r7!, {r8-r12,sp}") 388 TEST_UNSUPPORTED(__inst_thumb32(0xe8a73f00) " @ stmia r7!, {r8-r12,sp}")
388 TEST_UNSUPPORTED(".short 0xe8a7,0x9f00 @ stmia r7!, {r8-r12,pc}") 389 TEST_UNSUPPORTED(__inst_thumb32(0xe8a79f00) " @ stmia r7!, {r8-r12,pc}")
389 TEST_UNSUPPORTED(".short 0xe93e,0x2010 @ ldmdb r14!, {r4,sp}") 390 TEST_UNSUPPORTED(__inst_thumb32(0xe93e2010) " @ ldmdb r14!, {r4,sp}")
390 391
391 TEST_GROUP("Load/store double or exclusive, table branch") 392 TEST_GROUP("Load/store double or exclusive, table branch")
392 393
@@ -402,12 +403,12 @@ void kprobe_thumb32_test_cases(void)
402 "3: .word "__stringify(VAL1)" \n\t" 403 "3: .word "__stringify(VAL1)" \n\t"
403 " .word "__stringify(VAL2)) 404 " .word "__stringify(VAL2))
404 405
405 TEST_UNSUPPORTED(".short 0xe9ff,0xec04 @ ldrd r14, r12, [pc, #16]!") 406 TEST_UNSUPPORTED(__inst_thumb32(0xe9ffec04) " @ ldrd r14, r12, [pc, #16]!")
406 TEST_UNSUPPORTED(".short 0xe8ff,0xec04 @ ldrd r14, r12, [pc], #16") 407 TEST_UNSUPPORTED(__inst_thumb32(0xe8ffec04) " @ ldrd r14, r12, [pc], #16")
407 TEST_UNSUPPORTED(".short 0xe9d4,0xd800 @ ldrd sp, r8, [r4]") 408 TEST_UNSUPPORTED(__inst_thumb32(0xe9d4d800) " @ ldrd sp, r8, [r4]")
408 TEST_UNSUPPORTED(".short 0xe9d4,0xf800 @ ldrd pc, r8, [r4]") 409 TEST_UNSUPPORTED(__inst_thumb32(0xe9d4f800) " @ ldrd pc, r8, [r4]")
409 TEST_UNSUPPORTED(".short 0xe9d4,0x7d00 @ ldrd r7, sp, [r4]") 410 TEST_UNSUPPORTED(__inst_thumb32(0xe9d47d00) " @ ldrd r7, sp, [r4]")
410 TEST_UNSUPPORTED(".short 0xe9d4,0x7f00 @ ldrd r7, pc, [r4]") 411 TEST_UNSUPPORTED(__inst_thumb32(0xe9d47f00) " @ ldrd r7, pc, [r4]")
411 412
412 TEST_RRP("strd r",0, VAL1,", r",1, VAL2,", [r",1, 24,", #-16]") 413 TEST_RRP("strd r",0, VAL1,", r",1, VAL2,", [r",1, 24,", #-16]")
413 TEST_RR( "strd r",12,VAL2,", r",14,VAL1,", [sp, #16]") 414 TEST_RR( "strd r",12,VAL2,", r",14,VAL1,", [sp, #16]")
@@ -415,8 +416,8 @@ void kprobe_thumb32_test_cases(void)
415 TEST_RR( "strd r",14,VAL2,", r",12,VAL1,", [sp, #16]!") 416 TEST_RR( "strd r",14,VAL2,", r",12,VAL1,", [sp, #16]!")
416 TEST_RRP("strd r",1, VAL1,", r",0, VAL2,", [r",7, 24,"], #16") 417 TEST_RRP("strd r",1, VAL1,", r",0, VAL2,", [r",7, 24,"], #16")
417 TEST_RR( "strd r",7, VAL2,", r",8, VAL1,", [sp], #-16") 418 TEST_RR( "strd r",7, VAL2,", r",8, VAL1,", [sp], #-16")
418 TEST_UNSUPPORTED(".short 0xe9ef,0xec04 @ strd r14, r12, [pc, #16]!") 419 TEST_UNSUPPORTED(__inst_thumb32(0xe9efec04) " @ strd r14, r12, [pc, #16]!")
419 TEST_UNSUPPORTED(".short 0xe8ef,0xec04 @ strd r14, r12, [pc], #16") 420 TEST_UNSUPPORTED(__inst_thumb32(0xe8efec04) " @ strd r14, r12, [pc], #16")
420 421
421 TEST_RX("tbb [pc, r",0, (9f-(1f+4)),"]", 422 TEST_RX("tbb [pc, r",0, (9f-(1f+4)),"]",
422 "9: \n\t" 423 "9: \n\t"
@@ -460,9 +461,9 @@ void kprobe_thumb32_test_cases(void)
460 "3: mvn r0, r0 \n\t" 461 "3: mvn r0, r0 \n\t"
461 "2: nop \n\t") 462 "2: nop \n\t")
462 463
463 TEST_UNSUPPORTED(".short 0xe8d1,0xf01f @ tbh [r1, pc]") 464 TEST_UNSUPPORTED(__inst_thumb32(0xe8d1f01f) " @ tbh [r1, pc]")
464 TEST_UNSUPPORTED(".short 0xe8d1,0xf01d @ tbh [r1, sp]") 465 TEST_UNSUPPORTED(__inst_thumb32(0xe8d1f01d) " @ tbh [r1, sp]")
465 TEST_UNSUPPORTED(".short 0xe8dd,0xf012 @ tbh [sp, r2]") 466 TEST_UNSUPPORTED(__inst_thumb32(0xe8ddf012) " @ tbh [sp, r2]")
466 467
467 TEST_UNSUPPORTED("strexb r0, r1, [r2]") 468 TEST_UNSUPPORTED("strexb r0, r1, [r2]")
468 TEST_UNSUPPORTED("strexh r0, r1, [r2]") 469 TEST_UNSUPPORTED("strexh r0, r1, [r2]")
@@ -540,40 +541,40 @@ void kprobe_thumb32_test_cases(void)
540 TEST_RR("pkhtb r0, r",0, HH1,", r",1, HH2,"") 541 TEST_RR("pkhtb r0, r",0, HH1,", r",1, HH2,"")
541 TEST_RR("pkhtb r14,r",12, HH1,", r",10,HH2,", asr #2") 542 TEST_RR("pkhtb r14,r",12, HH1,", r",10,HH2,", asr #2")
542 543
543 TEST_UNSUPPORTED(".short 0xea17,0x0f0d @ tst.w r7, sp") 544 TEST_UNSUPPORTED(__inst_thumb32(0xea170f0d) " @ tst.w r7, sp")
544 TEST_UNSUPPORTED(".short 0xea17,0x0f0f @ tst.w r7, pc") 545 TEST_UNSUPPORTED(__inst_thumb32(0xea170f0f) " @ tst.w r7, pc")
545 TEST_UNSUPPORTED(".short 0xea1d,0x0f07 @ tst.w sp, r7") 546 TEST_UNSUPPORTED(__inst_thumb32(0xea1d0f07) " @ tst.w sp, r7")
546 TEST_UNSUPPORTED(".short 0xea1f,0x0f07 @ tst.w pc, r7") 547 TEST_UNSUPPORTED(__inst_thumb32(0xea1f0f07) " @ tst.w pc, r7")
547 TEST_UNSUPPORTED(".short 0xf01d,0x1f08 @ tst sp, #0x00080008") 548 TEST_UNSUPPORTED(__inst_thumb32(0xf01d1f08) " @ tst sp, #0x00080008")
548 TEST_UNSUPPORTED(".short 0xf01f,0x1f08 @ tst pc, #0x00080008") 549 TEST_UNSUPPORTED(__inst_thumb32(0xf01f1f08) " @ tst pc, #0x00080008")
549 550
550 TEST_UNSUPPORTED(".short 0xea97,0x0f0d @ teq.w r7, sp") 551 TEST_UNSUPPORTED(__inst_thumb32(0xea970f0d) " @ teq.w r7, sp")
551 TEST_UNSUPPORTED(".short 0xea97,0x0f0f @ teq.w r7, pc") 552 TEST_UNSUPPORTED(__inst_thumb32(0xea970f0f) " @ teq.w r7, pc")
552 TEST_UNSUPPORTED(".short 0xea9d,0x0f07 @ teq.w sp, r7") 553 TEST_UNSUPPORTED(__inst_thumb32(0xea9d0f07) " @ teq.w sp, r7")
553 TEST_UNSUPPORTED(".short 0xea9f,0x0f07 @ teq.w pc, r7") 554 TEST_UNSUPPORTED(__inst_thumb32(0xea9f0f07) " @ teq.w pc, r7")
554 TEST_UNSUPPORTED(".short 0xf09d,0x1f08 @ tst sp, #0x00080008") 555 TEST_UNSUPPORTED(__inst_thumb32(0xf09d1f08) " @ tst sp, #0x00080008")
555 TEST_UNSUPPORTED(".short 0xf09f,0x1f08 @ tst pc, #0x00080008") 556 TEST_UNSUPPORTED(__inst_thumb32(0xf09f1f08) " @ tst pc, #0x00080008")
556 557
557 TEST_UNSUPPORTED(".short 0xeb17,0x0f0d @ cmn.w r7, sp") 558 TEST_UNSUPPORTED(__inst_thumb32(0xeb170f0d) " @ cmn.w r7, sp")
558 TEST_UNSUPPORTED(".short 0xeb17,0x0f0f @ cmn.w r7, pc") 559 TEST_UNSUPPORTED(__inst_thumb32(0xeb170f0f) " @ cmn.w r7, pc")
559 TEST_P("cmn.w sp, r",7,0,"") 560 TEST_P("cmn.w sp, r",7,0,"")
560 TEST_UNSUPPORTED(".short 0xeb1f,0x0f07 @ cmn.w pc, r7") 561 TEST_UNSUPPORTED(__inst_thumb32(0xeb1f0f07) " @ cmn.w pc, r7")
561 TEST( "cmn sp, #0x00080008") 562 TEST( "cmn sp, #0x00080008")
562 TEST_UNSUPPORTED(".short 0xf11f,0x1f08 @ cmn pc, #0x00080008") 563 TEST_UNSUPPORTED(__inst_thumb32(0xf11f1f08) " @ cmn pc, #0x00080008")
563 564
564 TEST_UNSUPPORTED(".short 0xebb7,0x0f0d @ cmp.w r7, sp") 565 TEST_UNSUPPORTED(__inst_thumb32(0xebb70f0d) " @ cmp.w r7, sp")
565 TEST_UNSUPPORTED(".short 0xebb7,0x0f0f @ cmp.w r7, pc") 566 TEST_UNSUPPORTED(__inst_thumb32(0xebb70f0f) " @ cmp.w r7, pc")
566 TEST_P("cmp.w sp, r",7,0,"") 567 TEST_P("cmp.w sp, r",7,0,"")
567 TEST_UNSUPPORTED(".short 0xebbf,0x0f07 @ cmp.w pc, r7") 568 TEST_UNSUPPORTED(__inst_thumb32(0xebbf0f07) " @ cmp.w pc, r7")
568 TEST( "cmp sp, #0x00080008") 569 TEST( "cmp sp, #0x00080008")
569 TEST_UNSUPPORTED(".short 0xf1bf,0x1f08 @ cmp pc, #0x00080008") 570 TEST_UNSUPPORTED(__inst_thumb32(0xf1bf1f08) " @ cmp pc, #0x00080008")
570 571
571 TEST_UNSUPPORTED(".short 0xea5f,0x070d @ movs.w r7, sp") 572 TEST_UNSUPPORTED(__inst_thumb32(0xea5f070d) " @ movs.w r7, sp")
572 TEST_UNSUPPORTED(".short 0xea5f,0x070f @ movs.w r7, pc") 573 TEST_UNSUPPORTED(__inst_thumb32(0xea5f070f) " @ movs.w r7, pc")
573 TEST_UNSUPPORTED(".short 0xea5f,0x0d07 @ movs.w sp, r7") 574 TEST_UNSUPPORTED(__inst_thumb32(0xea5f0d07) " @ movs.w sp, r7")
574 TEST_UNSUPPORTED(".short 0xea4f,0x0f07 @ mov.w pc, r7") 575 TEST_UNSUPPORTED(__inst_thumb32(0xea4f0f07) " @ mov.w pc, r7")
575 TEST_UNSUPPORTED(".short 0xf04f,0x1d08 @ mov sp, #0x00080008") 576 TEST_UNSUPPORTED(__inst_thumb32(0xf04f1d08) " @ mov sp, #0x00080008")
576 TEST_UNSUPPORTED(".short 0xf04f,0x1f08 @ mov pc, #0x00080008") 577 TEST_UNSUPPORTED(__inst_thumb32(0xf04f1f08) " @ mov pc, #0x00080008")
577 578
578 TEST_R("add.w r0, sp, r",1, 4,"") 579 TEST_R("add.w r0, sp, r",1, 4,"")
579 TEST_R("adds r0, sp, r",1, 4,", asl #3") 580 TEST_R("adds r0, sp, r",1, 4,", asl #3")
@@ -581,15 +582,15 @@ void kprobe_thumb32_test_cases(void)
581 TEST_R("add r0, sp, r",1, 16,", ror #1") 582 TEST_R("add r0, sp, r",1, 16,", ror #1")
582 TEST_R("add.w sp, sp, r",1, 4,"") 583 TEST_R("add.w sp, sp, r",1, 4,"")
583 TEST_R("add sp, sp, r",1, 4,", asl #3") 584 TEST_R("add sp, sp, r",1, 4,", asl #3")
584 TEST_UNSUPPORTED(".short 0xeb0d,0x1d01 @ add sp, sp, r1, asl #4") 585 TEST_UNSUPPORTED(__inst_thumb32(0xeb0d1d01) " @ add sp, sp, r1, asl #4")
585 TEST_UNSUPPORTED(".short 0xeb0d,0x0d71 @ add sp, sp, r1, ror #1") 586 TEST_UNSUPPORTED(__inst_thumb32(0xeb0d0d71) " @ add sp, sp, r1, ror #1")
586 TEST( "add.w r0, sp, #24") 587 TEST( "add.w r0, sp, #24")
587 TEST( "add.w sp, sp, #24") 588 TEST( "add.w sp, sp, #24")
588 TEST_UNSUPPORTED(".short 0xeb0d,0x0f01 @ add pc, sp, r1") 589 TEST_UNSUPPORTED(__inst_thumb32(0xeb0d0f01) " @ add pc, sp, r1")
589 TEST_UNSUPPORTED(".short 0xeb0d,0x000f @ add r0, sp, pc") 590 TEST_UNSUPPORTED(__inst_thumb32(0xeb0d000f) " @ add r0, sp, pc")
590 TEST_UNSUPPORTED(".short 0xeb0d,0x000d @ add r0, sp, sp") 591 TEST_UNSUPPORTED(__inst_thumb32(0xeb0d000d) " @ add r0, sp, sp")
591 TEST_UNSUPPORTED(".short 0xeb0d,0x0d0f @ add sp, sp, pc") 592 TEST_UNSUPPORTED(__inst_thumb32(0xeb0d0d0f) " @ add sp, sp, pc")
592 TEST_UNSUPPORTED(".short 0xeb0d,0x0d0d @ add sp, sp, sp") 593 TEST_UNSUPPORTED(__inst_thumb32(0xeb0d0d0d) " @ add sp, sp, sp")
593 594
594 TEST_R("sub.w r0, sp, r",1, 4,"") 595 TEST_R("sub.w r0, sp, r",1, 4,"")
595 TEST_R("subs r0, sp, r",1, 4,", asl #3") 596 TEST_R("subs r0, sp, r",1, 4,", asl #3")
@@ -597,54 +598,54 @@ void kprobe_thumb32_test_cases(void)
597 TEST_R("sub r0, sp, r",1, 16,", ror #1") 598 TEST_R("sub r0, sp, r",1, 16,", ror #1")
598 TEST_R("sub.w sp, sp, r",1, 4,"") 599 TEST_R("sub.w sp, sp, r",1, 4,"")
599 TEST_R("sub sp, sp, r",1, 4,", asl #3") 600 TEST_R("sub sp, sp, r",1, 4,", asl #3")
600 TEST_UNSUPPORTED(".short 0xebad,0x1d01 @ sub sp, sp, r1, asl #4") 601 TEST_UNSUPPORTED(__inst_thumb32(0xebad1d01) " @ sub sp, sp, r1, asl #4")
601 TEST_UNSUPPORTED(".short 0xebad,0x0d71 @ sub sp, sp, r1, ror #1") 602 TEST_UNSUPPORTED(__inst_thumb32(0xebad0d71) " @ sub sp, sp, r1, ror #1")
602 TEST_UNSUPPORTED(".short 0xebad,0x0f01 @ sub pc, sp, r1") 603 TEST_UNSUPPORTED(__inst_thumb32(0xebad0f01) " @ sub pc, sp, r1")
603 TEST( "sub.w r0, sp, #24") 604 TEST( "sub.w r0, sp, #24")
604 TEST( "sub.w sp, sp, #24") 605 TEST( "sub.w sp, sp, #24")
605 606
606 TEST_UNSUPPORTED(".short 0xea02,0x010f @ and r1, r2, pc") 607 TEST_UNSUPPORTED(__inst_thumb32(0xea02010f) " @ and r1, r2, pc")
607 TEST_UNSUPPORTED(".short 0xea0f,0x0103 @ and r1, pc, r3") 608 TEST_UNSUPPORTED(__inst_thumb32(0xea0f0103) " @ and r1, pc, r3")
608 TEST_UNSUPPORTED(".short 0xea02,0x0f03 @ and pc, r2, r3") 609 TEST_UNSUPPORTED(__inst_thumb32(0xea020f03) " @ and pc, r2, r3")
609 TEST_UNSUPPORTED(".short 0xea02,0x010d @ and r1, r2, sp") 610 TEST_UNSUPPORTED(__inst_thumb32(0xea02010d) " @ and r1, r2, sp")
610 TEST_UNSUPPORTED(".short 0xea0d,0x0103 @ and r1, sp, r3") 611 TEST_UNSUPPORTED(__inst_thumb32(0xea0d0103) " @ and r1, sp, r3")
611 TEST_UNSUPPORTED(".short 0xea02,0x0d03 @ and sp, r2, r3") 612 TEST_UNSUPPORTED(__inst_thumb32(0xea020d03) " @ and sp, r2, r3")
612 TEST_UNSUPPORTED(".short 0xf00d,0x1108 @ and r1, sp, #0x00080008") 613 TEST_UNSUPPORTED(__inst_thumb32(0xf00d1108) " @ and r1, sp, #0x00080008")
613 TEST_UNSUPPORTED(".short 0xf00f,0x1108 @ and r1, pc, #0x00080008") 614 TEST_UNSUPPORTED(__inst_thumb32(0xf00f1108) " @ and r1, pc, #0x00080008")
614 TEST_UNSUPPORTED(".short 0xf002,0x1d08 @ and sp, r8, #0x00080008") 615 TEST_UNSUPPORTED(__inst_thumb32(0xf0021d08) " @ and sp, r8, #0x00080008")
615 TEST_UNSUPPORTED(".short 0xf002,0x1f08 @ and pc, r8, #0x00080008") 616 TEST_UNSUPPORTED(__inst_thumb32(0xf0021f08) " @ and pc, r8, #0x00080008")
616 617
617 TEST_UNSUPPORTED(".short 0xeb02,0x010f @ add r1, r2, pc") 618 TEST_UNSUPPORTED(__inst_thumb32(0xeb02010f) " @ add r1, r2, pc")
618 TEST_UNSUPPORTED(".short 0xeb0f,0x0103 @ add r1, pc, r3") 619 TEST_UNSUPPORTED(__inst_thumb32(0xeb0f0103) " @ add r1, pc, r3")
619 TEST_UNSUPPORTED(".short 0xeb02,0x0f03 @ add pc, r2, r3") 620 TEST_UNSUPPORTED(__inst_thumb32(0xeb020f03) " @ add pc, r2, r3")
620 TEST_UNSUPPORTED(".short 0xeb02,0x010d @ add r1, r2, sp") 621 TEST_UNSUPPORTED(__inst_thumb32(0xeb02010d) " @ add r1, r2, sp")
621 TEST_SUPPORTED( ".short 0xeb0d,0x0103 @ add r1, sp, r3") 622 TEST_SUPPORTED( __inst_thumb32(0xeb0d0103) " @ add r1, sp, r3")
622 TEST_UNSUPPORTED(".short 0xeb02,0x0d03 @ add sp, r2, r3") 623 TEST_UNSUPPORTED(__inst_thumb32(0xeb020d03) " @ add sp, r2, r3")
623 TEST_SUPPORTED( ".short 0xf10d,0x1108 @ add r1, sp, #0x00080008") 624 TEST_SUPPORTED( __inst_thumb32(0xf10d1108) " @ add r1, sp, #0x00080008")
624 TEST_UNSUPPORTED(".short 0xf10d,0x1f08 @ add pc, sp, #0x00080008") 625 TEST_UNSUPPORTED(__inst_thumb32(0xf10d1f08) " @ add pc, sp, #0x00080008")
625 TEST_UNSUPPORTED(".short 0xf10f,0x1108 @ add r1, pc, #0x00080008") 626 TEST_UNSUPPORTED(__inst_thumb32(0xf10f1108) " @ add r1, pc, #0x00080008")
626 TEST_UNSUPPORTED(".short 0xf102,0x1d08 @ add sp, r8, #0x00080008") 627 TEST_UNSUPPORTED(__inst_thumb32(0xf1021d08) " @ add sp, r8, #0x00080008")
627 TEST_UNSUPPORTED(".short 0xf102,0x1f08 @ add pc, r8, #0x00080008") 628 TEST_UNSUPPORTED(__inst_thumb32(0xf1021f08) " @ add pc, r8, #0x00080008")
628 629
629 TEST_UNSUPPORTED(".short 0xeaa0,0x0000") 630 TEST_UNSUPPORTED(__inst_thumb32(0xeaa00000) "")
630 TEST_UNSUPPORTED(".short 0xeaf0,0x0000") 631 TEST_UNSUPPORTED(__inst_thumb32(0xeaf00000) "")
631 TEST_UNSUPPORTED(".short 0xeb20,0x0000") 632 TEST_UNSUPPORTED(__inst_thumb32(0xeb200000) "")
632 TEST_UNSUPPORTED(".short 0xeb80,0x0000") 633 TEST_UNSUPPORTED(__inst_thumb32(0xeb800000) "")
633 TEST_UNSUPPORTED(".short 0xebe0,0x0000") 634 TEST_UNSUPPORTED(__inst_thumb32(0xebe00000) "")
634 635
635 TEST_UNSUPPORTED(".short 0xf0a0,0x0000") 636 TEST_UNSUPPORTED(__inst_thumb32(0xf0a00000) "")
636 TEST_UNSUPPORTED(".short 0xf0c0,0x0000") 637 TEST_UNSUPPORTED(__inst_thumb32(0xf0c00000) "")
637 TEST_UNSUPPORTED(".short 0xf0f0,0x0000") 638 TEST_UNSUPPORTED(__inst_thumb32(0xf0f00000) "")
638 TEST_UNSUPPORTED(".short 0xf120,0x0000") 639 TEST_UNSUPPORTED(__inst_thumb32(0xf1200000) "")
639 TEST_UNSUPPORTED(".short 0xf180,0x0000") 640 TEST_UNSUPPORTED(__inst_thumb32(0xf1800000) "")
640 TEST_UNSUPPORTED(".short 0xf1e0,0x0000") 641 TEST_UNSUPPORTED(__inst_thumb32(0xf1e00000) "")
641 642
642 TEST_GROUP("Coprocessor instructions") 643 TEST_GROUP("Coprocessor instructions")
643 644
644 TEST_UNSUPPORTED(".short 0xec00,0x0000") 645 TEST_UNSUPPORTED(__inst_thumb32(0xec000000) "")
645 TEST_UNSUPPORTED(".short 0xeff0,0x0000") 646 TEST_UNSUPPORTED(__inst_thumb32(0xeff00000) "")
646 TEST_UNSUPPORTED(".short 0xfc00,0x0000") 647 TEST_UNSUPPORTED(__inst_thumb32(0xfc000000) "")
647 TEST_UNSUPPORTED(".short 0xfff0,0x0000") 648 TEST_UNSUPPORTED(__inst_thumb32(0xfff00000) "")
648 649
649 TEST_GROUP("Data-processing (plain binary immediate)") 650 TEST_GROUP("Data-processing (plain binary immediate)")
650 651
@@ -652,92 +653,92 @@ void kprobe_thumb32_test_cases(void)
652 TEST( "addw r14, sp, #0xf5a") 653 TEST( "addw r14, sp, #0xf5a")
653 TEST( "addw sp, sp, #0x20") 654 TEST( "addw sp, sp, #0x20")
654 TEST( "addw r7, pc, #0x888") 655 TEST( "addw r7, pc, #0x888")
655 TEST_UNSUPPORTED(".short 0xf20f,0x1f20 @ addw pc, pc, #0x120") 656 TEST_UNSUPPORTED(__inst_thumb32(0xf20f1f20) " @ addw pc, pc, #0x120")
656 TEST_UNSUPPORTED(".short 0xf20d,0x1f20 @ addw pc, sp, #0x120") 657 TEST_UNSUPPORTED(__inst_thumb32(0xf20d1f20) " @ addw pc, sp, #0x120")
657 TEST_UNSUPPORTED(".short 0xf20f,0x1d20 @ addw sp, pc, #0x120") 658 TEST_UNSUPPORTED(__inst_thumb32(0xf20f1d20) " @ addw sp, pc, #0x120")
658 TEST_UNSUPPORTED(".short 0xf200,0x1d20 @ addw sp, r0, #0x120") 659 TEST_UNSUPPORTED(__inst_thumb32(0xf2001d20) " @ addw sp, r0, #0x120")
659 660
660 TEST_R("subw r0, r",1, VAL1,", #0x123") 661 TEST_R("subw r0, r",1, VAL1,", #0x123")
661 TEST( "subw r14, sp, #0xf5a") 662 TEST( "subw r14, sp, #0xf5a")
662 TEST( "subw sp, sp, #0x20") 663 TEST( "subw sp, sp, #0x20")
663 TEST( "subw r7, pc, #0x888") 664 TEST( "subw r7, pc, #0x888")
664 TEST_UNSUPPORTED(".short 0xf2af,0x1f20 @ subw pc, pc, #0x120") 665 TEST_UNSUPPORTED(__inst_thumb32(0xf2af1f20) " @ subw pc, pc, #0x120")
665 TEST_UNSUPPORTED(".short 0xf2ad,0x1f20 @ subw pc, sp, #0x120") 666 TEST_UNSUPPORTED(__inst_thumb32(0xf2ad1f20) " @ subw pc, sp, #0x120")
666 TEST_UNSUPPORTED(".short 0xf2af,0x1d20 @ subw sp, pc, #0x120") 667 TEST_UNSUPPORTED(__inst_thumb32(0xf2af1d20) " @ subw sp, pc, #0x120")
667 TEST_UNSUPPORTED(".short 0xf2a0,0x1d20 @ subw sp, r0, #0x120") 668 TEST_UNSUPPORTED(__inst_thumb32(0xf2a01d20) " @ subw sp, r0, #0x120")
668 669
669 TEST("movw r0, #0") 670 TEST("movw r0, #0")
670 TEST("movw r0, #0xffff") 671 TEST("movw r0, #0xffff")
671 TEST("movw lr, #0xffff") 672 TEST("movw lr, #0xffff")
672 TEST_UNSUPPORTED(".short 0xf240,0x0d00 @ movw sp, #0") 673 TEST_UNSUPPORTED(__inst_thumb32(0xf2400d00) " @ movw sp, #0")
673 TEST_UNSUPPORTED(".short 0xf240,0x0f00 @ movw pc, #0") 674 TEST_UNSUPPORTED(__inst_thumb32(0xf2400f00) " @ movw pc, #0")
674 675
675 TEST_R("movt r",0, VAL1,", #0") 676 TEST_R("movt r",0, VAL1,", #0")
676 TEST_R("movt r",0, VAL2,", #0xffff") 677 TEST_R("movt r",0, VAL2,", #0xffff")
677 TEST_R("movt r",14,VAL1,", #0xffff") 678 TEST_R("movt r",14,VAL1,", #0xffff")
678 TEST_UNSUPPORTED(".short 0xf2c0,0x0d00 @ movt sp, #0") 679 TEST_UNSUPPORTED(__inst_thumb32(0xf2c00d00) " @ movt sp, #0")
679 TEST_UNSUPPORTED(".short 0xf2c0,0x0f00 @ movt pc, #0") 680 TEST_UNSUPPORTED(__inst_thumb32(0xf2c00f00) " @ movt pc, #0")
680 681
681 TEST_R( "ssat r0, #24, r",0, VAL1,"") 682 TEST_R( "ssat r0, #24, r",0, VAL1,"")
682 TEST_R( "ssat r14, #24, r",12, VAL2,"") 683 TEST_R( "ssat r14, #24, r",12, VAL2,"")
683 TEST_R( "ssat r0, #24, r",0, VAL1,", lsl #8") 684 TEST_R( "ssat r0, #24, r",0, VAL1,", lsl #8")
684 TEST_R( "ssat r14, #24, r",12, VAL2,", asr #8") 685 TEST_R( "ssat r14, #24, r",12, VAL2,", asr #8")
685 TEST_UNSUPPORTED(".short 0xf30c,0x0d17 @ ssat sp, #24, r12") 686 TEST_UNSUPPORTED(__inst_thumb32(0xf30c0d17) " @ ssat sp, #24, r12")
686 TEST_UNSUPPORTED(".short 0xf30c,0x0f17 @ ssat pc, #24, r12") 687 TEST_UNSUPPORTED(__inst_thumb32(0xf30c0f17) " @ ssat pc, #24, r12")
687 TEST_UNSUPPORTED(".short 0xf30d,0x0c17 @ ssat r12, #24, sp") 688 TEST_UNSUPPORTED(__inst_thumb32(0xf30d0c17) " @ ssat r12, #24, sp")
688 TEST_UNSUPPORTED(".short 0xf30f,0x0c17 @ ssat r12, #24, pc") 689 TEST_UNSUPPORTED(__inst_thumb32(0xf30f0c17) " @ ssat r12, #24, pc")
689 690
690 TEST_R( "usat r0, #24, r",0, VAL1,"") 691 TEST_R( "usat r0, #24, r",0, VAL1,"")
691 TEST_R( "usat r14, #24, r",12, VAL2,"") 692 TEST_R( "usat r14, #24, r",12, VAL2,"")
692 TEST_R( "usat r0, #24, r",0, VAL1,", lsl #8") 693 TEST_R( "usat r0, #24, r",0, VAL1,", lsl #8")
693 TEST_R( "usat r14, #24, r",12, VAL2,", asr #8") 694 TEST_R( "usat r14, #24, r",12, VAL2,", asr #8")
694 TEST_UNSUPPORTED(".short 0xf38c,0x0d17 @ usat sp, #24, r12") 695 TEST_UNSUPPORTED(__inst_thumb32(0xf38c0d17) " @ usat sp, #24, r12")
695 TEST_UNSUPPORTED(".short 0xf38c,0x0f17 @ usat pc, #24, r12") 696 TEST_UNSUPPORTED(__inst_thumb32(0xf38c0f17) " @ usat pc, #24, r12")
696 TEST_UNSUPPORTED(".short 0xf38d,0x0c17 @ usat r12, #24, sp") 697 TEST_UNSUPPORTED(__inst_thumb32(0xf38d0c17) " @ usat r12, #24, sp")
697 TEST_UNSUPPORTED(".short 0xf38f,0x0c17 @ usat r12, #24, pc") 698 TEST_UNSUPPORTED(__inst_thumb32(0xf38f0c17) " @ usat r12, #24, pc")
698 699
699 TEST_R( "ssat16 r0, #12, r",0, HH1,"") 700 TEST_R( "ssat16 r0, #12, r",0, HH1,"")
700 TEST_R( "ssat16 r14, #12, r",12, HH2,"") 701 TEST_R( "ssat16 r14, #12, r",12, HH2,"")
701 TEST_UNSUPPORTED(".short 0xf32c,0x0d0b @ ssat16 sp, #12, r12") 702 TEST_UNSUPPORTED(__inst_thumb32(0xf32c0d0b) " @ ssat16 sp, #12, r12")
702 TEST_UNSUPPORTED(".short 0xf32c,0x0f0b @ ssat16 pc, #12, r12") 703 TEST_UNSUPPORTED(__inst_thumb32(0xf32c0f0b) " @ ssat16 pc, #12, r12")
703 TEST_UNSUPPORTED(".short 0xf32d,0x0c0b @ ssat16 r12, #12, sp") 704 TEST_UNSUPPORTED(__inst_thumb32(0xf32d0c0b) " @ ssat16 r12, #12, sp")
704 TEST_UNSUPPORTED(".short 0xf32f,0x0c0b @ ssat16 r12, #12, pc") 705 TEST_UNSUPPORTED(__inst_thumb32(0xf32f0c0b) " @ ssat16 r12, #12, pc")
705 706
706 TEST_R( "usat16 r0, #12, r",0, HH1,"") 707 TEST_R( "usat16 r0, #12, r",0, HH1,"")
707 TEST_R( "usat16 r14, #12, r",12, HH2,"") 708 TEST_R( "usat16 r14, #12, r",12, HH2,"")
708 TEST_UNSUPPORTED(".short 0xf3ac,0x0d0b @ usat16 sp, #12, r12") 709 TEST_UNSUPPORTED(__inst_thumb32(0xf3ac0d0b) " @ usat16 sp, #12, r12")
709 TEST_UNSUPPORTED(".short 0xf3ac,0x0f0b @ usat16 pc, #12, r12") 710 TEST_UNSUPPORTED(__inst_thumb32(0xf3ac0f0b) " @ usat16 pc, #12, r12")
710 TEST_UNSUPPORTED(".short 0xf3ad,0x0c0b @ usat16 r12, #12, sp") 711 TEST_UNSUPPORTED(__inst_thumb32(0xf3ad0c0b) " @ usat16 r12, #12, sp")
711 TEST_UNSUPPORTED(".short 0xf3af,0x0c0b @ usat16 r12, #12, pc") 712 TEST_UNSUPPORTED(__inst_thumb32(0xf3af0c0b) " @ usat16 r12, #12, pc")
712 713
713 TEST_R( "sbfx r0, r",0 , VAL1,", #0, #31") 714 TEST_R( "sbfx r0, r",0 , VAL1,", #0, #31")
714 TEST_R( "sbfx r14, r",12, VAL2,", #8, #16") 715 TEST_R( "sbfx r14, r",12, VAL2,", #8, #16")
715 TEST_R( "sbfx r4, r",10, VAL1,", #16, #15") 716 TEST_R( "sbfx r4, r",10, VAL1,", #16, #15")
716 TEST_UNSUPPORTED(".short 0xf34c,0x2d0f @ sbfx sp, r12, #8, #16") 717 TEST_UNSUPPORTED(__inst_thumb32(0xf34c2d0f) " @ sbfx sp, r12, #8, #16")
717 TEST_UNSUPPORTED(".short 0xf34c,0x2f0f @ sbfx pc, r12, #8, #16") 718 TEST_UNSUPPORTED(__inst_thumb32(0xf34c2f0f) " @ sbfx pc, r12, #8, #16")
718 TEST_UNSUPPORTED(".short 0xf34d,0x2c0f @ sbfx r12, sp, #8, #16") 719 TEST_UNSUPPORTED(__inst_thumb32(0xf34d2c0f) " @ sbfx r12, sp, #8, #16")
719 TEST_UNSUPPORTED(".short 0xf34f,0x2c0f @ sbfx r12, pc, #8, #16") 720 TEST_UNSUPPORTED(__inst_thumb32(0xf34f2c0f) " @ sbfx r12, pc, #8, #16")
720 721
721 TEST_R( "ubfx r0, r",0 , VAL1,", #0, #31") 722 TEST_R( "ubfx r0, r",0 , VAL1,", #0, #31")
722 TEST_R( "ubfx r14, r",12, VAL2,", #8, #16") 723 TEST_R( "ubfx r14, r",12, VAL2,", #8, #16")
723 TEST_R( "ubfx r4, r",10, VAL1,", #16, #15") 724 TEST_R( "ubfx r4, r",10, VAL1,", #16, #15")
724 TEST_UNSUPPORTED(".short 0xf3cc,0x2d0f @ ubfx sp, r12, #8, #16") 725 TEST_UNSUPPORTED(__inst_thumb32(0xf3cc2d0f) " @ ubfx sp, r12, #8, #16")
725 TEST_UNSUPPORTED(".short 0xf3cc,0x2f0f @ ubfx pc, r12, #8, #16") 726 TEST_UNSUPPORTED(__inst_thumb32(0xf3cc2f0f) " @ ubfx pc, r12, #8, #16")
726 TEST_UNSUPPORTED(".short 0xf3cd,0x2c0f @ ubfx r12, sp, #8, #16") 727 TEST_UNSUPPORTED(__inst_thumb32(0xf3cd2c0f) " @ ubfx r12, sp, #8, #16")
727 TEST_UNSUPPORTED(".short 0xf3cf,0x2c0f @ ubfx r12, pc, #8, #16") 728 TEST_UNSUPPORTED(__inst_thumb32(0xf3cf2c0f) " @ ubfx r12, pc, #8, #16")
728 729
729 TEST_R( "bfc r",0, VAL1,", #4, #20") 730 TEST_R( "bfc r",0, VAL1,", #4, #20")
730 TEST_R( "bfc r",14,VAL2,", #4, #20") 731 TEST_R( "bfc r",14,VAL2,", #4, #20")
731 TEST_R( "bfc r",7, VAL1,", #0, #31") 732 TEST_R( "bfc r",7, VAL1,", #0, #31")
732 TEST_R( "bfc r",8, VAL2,", #0, #31") 733 TEST_R( "bfc r",8, VAL2,", #0, #31")
733 TEST_UNSUPPORTED(".short 0xf36f,0x0d1e @ bfc sp, #0, #31") 734 TEST_UNSUPPORTED(__inst_thumb32(0xf36f0d1e) " @ bfc sp, #0, #31")
734 TEST_UNSUPPORTED(".short 0xf36f,0x0f1e @ bfc pc, #0, #31") 735 TEST_UNSUPPORTED(__inst_thumb32(0xf36f0f1e) " @ bfc pc, #0, #31")
735 736
736 TEST_RR( "bfi r",0, VAL1,", r",0 , VAL2,", #0, #31") 737 TEST_RR( "bfi r",0, VAL1,", r",0 , VAL2,", #0, #31")
737 TEST_RR( "bfi r",12,VAL1,", r",14 , VAL2,", #4, #20") 738 TEST_RR( "bfi r",12,VAL1,", r",14 , VAL2,", #4, #20")
738 TEST_UNSUPPORTED(".short 0xf36e,0x1d17 @ bfi sp, r14, #4, #20") 739 TEST_UNSUPPORTED(__inst_thumb32(0xf36e1d17) " @ bfi sp, r14, #4, #20")
739 TEST_UNSUPPORTED(".short 0xf36e,0x1f17 @ bfi pc, r14, #4, #20") 740 TEST_UNSUPPORTED(__inst_thumb32(0xf36e1f17) " @ bfi pc, r14, #4, #20")
740 TEST_UNSUPPORTED(".short 0xf36d,0x1e17 @ bfi r14, sp, #4, #20") 741 TEST_UNSUPPORTED(__inst_thumb32(0xf36d1e17) " @ bfi r14, sp, #4, #20")
741 742
742 TEST_GROUP("Branches and miscellaneous control") 743 TEST_GROUP("Branches and miscellaneous control")
743 744
@@ -775,14 +776,14 @@ CONDITION_INSTRUCTIONS(22,
775 776
776 TEST("mrs r0, cpsr") 777 TEST("mrs r0, cpsr")
777 TEST("mrs r14, cpsr") 778 TEST("mrs r14, cpsr")
778 TEST_UNSUPPORTED(".short 0xf3ef,0x8d00 @ mrs sp, spsr") 779 TEST_UNSUPPORTED(__inst_thumb32(0xf3ef8d00) " @ mrs sp, spsr")
779 TEST_UNSUPPORTED(".short 0xf3ef,0x8f00 @ mrs pc, spsr") 780 TEST_UNSUPPORTED(__inst_thumb32(0xf3ef8f00) " @ mrs pc, spsr")
780 TEST_UNSUPPORTED("mrs r0, spsr") 781 TEST_UNSUPPORTED("mrs r0, spsr")
781 TEST_UNSUPPORTED("mrs lr, spsr") 782 TEST_UNSUPPORTED("mrs lr, spsr")
782 783
783 TEST_UNSUPPORTED(".short 0xf7f0,0x8000 @ smc #0") 784 TEST_UNSUPPORTED(__inst_thumb32(0xf7f08000) " @ smc #0")
784 785
785 TEST_UNSUPPORTED(".short 0xf7f0,0xa000 @ undefeined") 786 TEST_UNSUPPORTED(__inst_thumb32(0xf7f0a000) " @ undefeined")
786 787
787 TEST_BF( "b.w 2f") 788 TEST_BF( "b.w 2f")
788 TEST_BB( "b.w 2b") 789 TEST_BB( "b.w 2b")
@@ -829,15 +830,15 @@ CONDITION_INSTRUCTIONS(22,
829 SINGLE_STORE("") 830 SINGLE_STORE("")
830 831
831 TEST("str sp, [sp]") 832 TEST("str sp, [sp]")
832 TEST_UNSUPPORTED(".short 0xf8cf,0xe000 @ str r14, [pc]") 833 TEST_UNSUPPORTED(__inst_thumb32(0xf8cfe000) " @ str r14, [pc]")
833 TEST_UNSUPPORTED(".short 0xf8ce,0xf000 @ str pc, [r14]") 834 TEST_UNSUPPORTED(__inst_thumb32(0xf8cef000) " @ str pc, [r14]")
834 835
835 TEST_GROUP("Advanced SIMD element or structure load/store instructions") 836 TEST_GROUP("Advanced SIMD element or structure load/store instructions")
836 837
837 TEST_UNSUPPORTED(".short 0xf900,0x0000") 838 TEST_UNSUPPORTED(__inst_thumb32(0xf9000000) "")
838 TEST_UNSUPPORTED(".short 0xf92f,0xffff") 839 TEST_UNSUPPORTED(__inst_thumb32(0xf92fffff) "")
839 TEST_UNSUPPORTED(".short 0xf980,0x0000") 840 TEST_UNSUPPORTED(__inst_thumb32(0xf9800000) "")
840 TEST_UNSUPPORTED(".short 0xf9ef,0xffff") 841 TEST_UNSUPPORTED(__inst_thumb32(0xf9efffff) "")
841 842
842 TEST_GROUP("Load single data item and memory hints") 843 TEST_GROUP("Load single data item and memory hints")
843 844
@@ -881,20 +882,20 @@ CONDITION_INSTRUCTIONS(22,
881 TEST_SUPPORTED("ldr sp, 99f") 882 TEST_SUPPORTED("ldr sp, 99f")
882 TEST_SUPPORTED("ldr pc, 99f") 883 TEST_SUPPORTED("ldr pc, 99f")
883 884
884 TEST_UNSUPPORTED(".short 0xf854,0x700d @ ldr r7, [r4, sp]") 885 TEST_UNSUPPORTED(__inst_thumb32(0xf854700d) " @ ldr r7, [r4, sp]")
885 TEST_UNSUPPORTED(".short 0xf854,0x700f @ ldr r7, [r4, pc]") 886 TEST_UNSUPPORTED(__inst_thumb32(0xf854700f) " @ ldr r7, [r4, pc]")
886 TEST_UNSUPPORTED(".short 0xf814,0x700d @ ldrb r7, [r4, sp]") 887 TEST_UNSUPPORTED(__inst_thumb32(0xf814700d) " @ ldrb r7, [r4, sp]")
887 TEST_UNSUPPORTED(".short 0xf814,0x700f @ ldrb r7, [r4, pc]") 888 TEST_UNSUPPORTED(__inst_thumb32(0xf814700f) " @ ldrb r7, [r4, pc]")
888 TEST_UNSUPPORTED(".short 0xf89f,0xd004 @ ldrb sp, 99f") 889 TEST_UNSUPPORTED(__inst_thumb32(0xf89fd004) " @ ldrb sp, 99f")
889 TEST_UNSUPPORTED(".short 0xf814,0xd008 @ ldrb sp, [r4, r8]") 890 TEST_UNSUPPORTED(__inst_thumb32(0xf814d008) " @ ldrb sp, [r4, r8]")
890 TEST_UNSUPPORTED(".short 0xf894,0xd000 @ ldrb sp, [r4]") 891 TEST_UNSUPPORTED(__inst_thumb32(0xf894d000) " @ ldrb sp, [r4]")
891 892
892 TEST_UNSUPPORTED(".short 0xf860,0x0000") /* Unallocated space */ 893 TEST_UNSUPPORTED(__inst_thumb32(0xf8600000) "") /* Unallocated space */
893 TEST_UNSUPPORTED(".short 0xf9ff,0xffff") /* Unallocated space */ 894 TEST_UNSUPPORTED(__inst_thumb32(0xf9ffffff) "") /* Unallocated space */
894 TEST_UNSUPPORTED(".short 0xf950,0x0000") /* Unallocated space */ 895 TEST_UNSUPPORTED(__inst_thumb32(0xf9500000) "") /* Unallocated space */
895 TEST_UNSUPPORTED(".short 0xf95f,0xffff") /* Unallocated space */ 896 TEST_UNSUPPORTED(__inst_thumb32(0xf95fffff) "") /* Unallocated space */
896 TEST_UNSUPPORTED(".short 0xf800,0x0800") /* Unallocated space */ 897 TEST_UNSUPPORTED(__inst_thumb32(0xf8000800) "") /* Unallocated space */
897 TEST_UNSUPPORTED(".short 0xf97f,0xfaff") /* Unallocated space */ 898 TEST_UNSUPPORTED(__inst_thumb32(0xf97ffaff) "") /* Unallocated space */
898 899
899 TEST( "pli [pc, #4]") 900 TEST( "pli [pc, #4]")
900 TEST( "pli [pc, #-4]") 901 TEST( "pli [pc, #-4]")
@@ -902,22 +903,22 @@ CONDITION_INSTRUCTIONS(22,
902 TEST( "pld [pc, #-4]") 903 TEST( "pld [pc, #-4]")
903 904
904 TEST_P( "pld [r",0,-1024,", #1024]") 905 TEST_P( "pld [r",0,-1024,", #1024]")
905 TEST( ".short 0xf8b0,0xf400 @ pldw [r0, #1024]") 906 TEST( __inst_thumb32(0xf8b0f400) " @ pldw [r0, #1024]")
906 TEST_P( "pli [r",4, 0b,", #1024]") 907 TEST_P( "pli [r",4, 0b,", #1024]")
907 TEST_P( "pld [r",7, 120,", #-120]") 908 TEST_P( "pld [r",7, 120,", #-120]")
908 TEST( ".short 0xf837,0xfc78 @ pldw [r7, #-120]") 909 TEST( __inst_thumb32(0xf837fc78) " @ pldw [r7, #-120]")
909 TEST_P( "pli [r",11,120,", #-120]") 910 TEST_P( "pli [r",11,120,", #-120]")
910 TEST( "pld [sp, #0]") 911 TEST( "pld [sp, #0]")
911 912
912 TEST_PR("pld [r",7, 24, ", r",0, 16,"]") 913 TEST_PR("pld [r",7, 24, ", r",0, 16,"]")
913 TEST_PR("pld [r",8, 24, ", r",12,16,", lsl #3]") 914 TEST_PR("pld [r",8, 24, ", r",12,16,", lsl #3]")
914 TEST_SUPPORTED(".short 0xf837,0xf000 @ pldw [r7, r0]") 915 TEST_SUPPORTED(__inst_thumb32(0xf837f000) " @ pldw [r7, r0]")
915 TEST_SUPPORTED(".short 0xf838,0xf03c @ pldw [r8, r12, lsl #3]"); 916 TEST_SUPPORTED(__inst_thumb32(0xf838f03c) " @ pldw [r8, r12, lsl #3]");
916 TEST_RR("pli [r",12,0b,", r",0, 16,"]") 917 TEST_RR("pli [r",12,0b,", r",0, 16,"]")
917 TEST_RR("pli [r",0, 0b,", r",12,16,", lsl #3]") 918 TEST_RR("pli [r",0, 0b,", r",12,16,", lsl #3]")
918 TEST_R( "pld [sp, r",1, 16,"]") 919 TEST_R( "pld [sp, r",1, 16,"]")
919 TEST_UNSUPPORTED(".short 0xf817,0xf00d @pld [r7, sp]") 920 TEST_UNSUPPORTED(__inst_thumb32(0xf817f00d) " @pld [r7, sp]")
920 TEST_UNSUPPORTED(".short 0xf817,0xf00f @pld [r7, pc]") 921 TEST_UNSUPPORTED(__inst_thumb32(0xf817f00f) " @pld [r7, pc]")
921 922
922 TEST_GROUP("Data-processing (register)") 923 TEST_GROUP("Data-processing (register)")
923 924
@@ -934,21 +935,21 @@ CONDITION_INSTRUCTIONS(22,
934 SHIFTS32("ror") 935 SHIFTS32("ror")
935 SHIFTS32("rors") 936 SHIFTS32("rors")
936 937
937 TEST_UNSUPPORTED(".short 0xfa01,0xff02 @ lsl pc, r1, r2") 938 TEST_UNSUPPORTED(__inst_thumb32(0xfa01ff02) " @ lsl pc, r1, r2")
938 TEST_UNSUPPORTED(".short 0xfa01,0xfd02 @ lsl sp, r1, r2") 939 TEST_UNSUPPORTED(__inst_thumb32(0xfa01fd02) " @ lsl sp, r1, r2")
939 TEST_UNSUPPORTED(".short 0xfa0f,0xf002 @ lsl r0, pc, r2") 940 TEST_UNSUPPORTED(__inst_thumb32(0xfa0ff002) " @ lsl r0, pc, r2")
940 TEST_UNSUPPORTED(".short 0xfa0d,0xf002 @ lsl r0, sp, r2") 941 TEST_UNSUPPORTED(__inst_thumb32(0xfa0df002) " @ lsl r0, sp, r2")
941 TEST_UNSUPPORTED(".short 0xfa01,0xf00f @ lsl r0, r1, pc") 942 TEST_UNSUPPORTED(__inst_thumb32(0xfa01f00f) " @ lsl r0, r1, pc")
942 TEST_UNSUPPORTED(".short 0xfa01,0xf00d @ lsl r0, r1, sp") 943 TEST_UNSUPPORTED(__inst_thumb32(0xfa01f00d) " @ lsl r0, r1, sp")
943 944
944 TEST_RR( "sxtah r0, r",0, HH1,", r",1, HH2,"") 945 TEST_RR( "sxtah r0, r",0, HH1,", r",1, HH2,"")
945 TEST_RR( "sxtah r14,r",12, HH2,", r",10,HH1,", ror #8") 946 TEST_RR( "sxtah r14,r",12, HH2,", r",10,HH1,", ror #8")
946 TEST_R( "sxth r8, r",7, HH1,"") 947 TEST_R( "sxth r8, r",7, HH1,"")
947 948
948 TEST_UNSUPPORTED(".short 0xfa0f,0xff87 @ sxth pc, r7"); 949 TEST_UNSUPPORTED(__inst_thumb32(0xfa0fff87) " @ sxth pc, r7");
949 TEST_UNSUPPORTED(".short 0xfa0f,0xfd87 @ sxth sp, r7"); 950 TEST_UNSUPPORTED(__inst_thumb32(0xfa0ffd87) " @ sxth sp, r7");
950 TEST_UNSUPPORTED(".short 0xfa0f,0xf88f @ sxth r8, pc"); 951 TEST_UNSUPPORTED(__inst_thumb32(0xfa0ff88f) " @ sxth r8, pc");
951 TEST_UNSUPPORTED(".short 0xfa0f,0xf88d @ sxth r8, sp"); 952 TEST_UNSUPPORTED(__inst_thumb32(0xfa0ff88d) " @ sxth r8, sp");
952 953
953 TEST_RR( "uxtah r0, r",0, HH1,", r",1, HH2,"") 954 TEST_RR( "uxtah r0, r",0, HH1,", r",1, HH2,"")
954 TEST_RR( "uxtah r14,r",12, HH2,", r",10,HH1,", ror #8") 955 TEST_RR( "uxtah r14,r",12, HH2,", r",10,HH1,", ror #8")
@@ -970,8 +971,8 @@ CONDITION_INSTRUCTIONS(22,
970 TEST_RR( "uxtab r14,r",12, HH2,", r",10,HH1,", ror #8") 971 TEST_RR( "uxtab r14,r",12, HH2,", r",10,HH1,", ror #8")
971 TEST_R( "uxtb r8, r",7, HH1,"") 972 TEST_R( "uxtb r8, r",7, HH1,"")
972 973
973 TEST_UNSUPPORTED(".short 0xfa60,0x00f0") 974 TEST_UNSUPPORTED(__inst_thumb32(0xfa6000f0) "")
974 TEST_UNSUPPORTED(".short 0xfa7f,0xffff") 975 TEST_UNSUPPORTED(__inst_thumb32(0xfa7fffff) "")
975 976
976#define PARALLEL_ADD_SUB(op) \ 977#define PARALLEL_ADD_SUB(op) \
977 TEST_RR( op"add16 r0, r",0, HH1,", r",1, HH2,"") \ 978 TEST_RR( op"add16 r0, r",0, HH1,", r",1, HH2,"") \
@@ -1019,10 +1020,10 @@ CONDITION_INSTRUCTIONS(22,
1019 TEST_R("revsh.w r0, r",0, VAL1,"") 1020 TEST_R("revsh.w r0, r",0, VAL1,"")
1020 TEST_R("revsh r14, r",12, VAL2,"") 1021 TEST_R("revsh r14, r",12, VAL2,"")
1021 1022
1022 TEST_UNSUPPORTED(".short 0xfa9c,0xff8c @ rev pc, r12"); 1023 TEST_UNSUPPORTED(__inst_thumb32(0xfa9cff8c) " @ rev pc, r12");
1023 TEST_UNSUPPORTED(".short 0xfa9c,0xfd8c @ rev sp, r12"); 1024 TEST_UNSUPPORTED(__inst_thumb32(0xfa9cfd8c) " @ rev sp, r12");
1024 TEST_UNSUPPORTED(".short 0xfa9f,0xfe8f @ rev r14, pc"); 1025 TEST_UNSUPPORTED(__inst_thumb32(0xfa9ffe8f) " @ rev r14, pc");
1025 TEST_UNSUPPORTED(".short 0xfa9d,0xfe8d @ rev r14, sp"); 1026 TEST_UNSUPPORTED(__inst_thumb32(0xfa9dfe8d) " @ rev r14, sp");
1026 1027
1027 TEST_RR("sel r0, r",0, VAL1,", r",1, VAL2,"") 1028 TEST_RR("sel r0, r",0, VAL1,", r",1, VAL2,"")
1028 TEST_RR("sel r14, r",12,VAL1,", r",10, VAL2,"") 1029 TEST_RR("sel r14, r",12,VAL1,", r",10, VAL2,"")
@@ -1031,31 +1032,31 @@ CONDITION_INSTRUCTIONS(22,
1031 TEST_R("clz r7, r",14,0x1,"") 1032 TEST_R("clz r7, r",14,0x1,"")
1032 TEST_R("clz lr, r",7, 0xffffffff,"") 1033 TEST_R("clz lr, r",7, 0xffffffff,"")
1033 1034
1034 TEST_UNSUPPORTED(".short 0xfa80,0xf030") /* Unallocated space */ 1035 TEST_UNSUPPORTED(__inst_thumb32(0xfa80f030) "") /* Unallocated space */
1035 TEST_UNSUPPORTED(".short 0xfaff,0xff7f") /* Unallocated space */ 1036 TEST_UNSUPPORTED(__inst_thumb32(0xfaffff7f) "") /* Unallocated space */
1036 TEST_UNSUPPORTED(".short 0xfab0,0xf000") /* Unallocated space */ 1037 TEST_UNSUPPORTED(__inst_thumb32(0xfab0f000) "") /* Unallocated space */
1037 TEST_UNSUPPORTED(".short 0xfaff,0xff7f") /* Unallocated space */ 1038 TEST_UNSUPPORTED(__inst_thumb32(0xfaffff7f) "") /* Unallocated space */
1038 1039
1039 TEST_GROUP("Multiply, multiply accumulate, and absolute difference operations") 1040 TEST_GROUP("Multiply, multiply accumulate, and absolute difference operations")
1040 1041
1041 TEST_RR( "mul r0, r",1, VAL1,", r",2, VAL2,"") 1042 TEST_RR( "mul r0, r",1, VAL1,", r",2, VAL2,"")
1042 TEST_RR( "mul r7, r",8, VAL2,", r",9, VAL2,"") 1043 TEST_RR( "mul r7, r",8, VAL2,", r",9, VAL2,"")
1043 TEST_UNSUPPORTED(".short 0xfb08,0xff09 @ mul pc, r8, r9") 1044 TEST_UNSUPPORTED(__inst_thumb32(0xfb08ff09) " @ mul pc, r8, r9")
1044 TEST_UNSUPPORTED(".short 0xfb08,0xfd09 @ mul sp, r8, r9") 1045 TEST_UNSUPPORTED(__inst_thumb32(0xfb08fd09) " @ mul sp, r8, r9")
1045 TEST_UNSUPPORTED(".short 0xfb0f,0xf709 @ mul r7, pc, r9") 1046 TEST_UNSUPPORTED(__inst_thumb32(0xfb0ff709) " @ mul r7, pc, r9")
1046 TEST_UNSUPPORTED(".short 0xfb0d,0xf709 @ mul r7, sp, r9") 1047 TEST_UNSUPPORTED(__inst_thumb32(0xfb0df709) " @ mul r7, sp, r9")
1047 TEST_UNSUPPORTED(".short 0xfb08,0xf70f @ mul r7, r8, pc") 1048 TEST_UNSUPPORTED(__inst_thumb32(0xfb08f70f) " @ mul r7, r8, pc")
1048 TEST_UNSUPPORTED(".short 0xfb08,0xf70d @ mul r7, r8, sp") 1049 TEST_UNSUPPORTED(__inst_thumb32(0xfb08f70d) " @ mul r7, r8, sp")
1049 1050
1050 TEST_RRR( "mla r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"") 1051 TEST_RRR( "mla r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
1051 TEST_RRR( "mla r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"") 1052 TEST_RRR( "mla r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
1052 TEST_UNSUPPORTED(".short 0xfb08,0xaf09 @ mla pc, r8, r9, r10"); 1053 TEST_UNSUPPORTED(__inst_thumb32(0xfb08af09) " @ mla pc, r8, r9, r10");
1053 TEST_UNSUPPORTED(".short 0xfb08,0xad09 @ mla sp, r8, r9, r10"); 1054 TEST_UNSUPPORTED(__inst_thumb32(0xfb08ad09) " @ mla sp, r8, r9, r10");
1054 TEST_UNSUPPORTED(".short 0xfb0f,0xa709 @ mla r7, pc, r9, r10"); 1055 TEST_UNSUPPORTED(__inst_thumb32(0xfb0fa709) " @ mla r7, pc, r9, r10");
1055 TEST_UNSUPPORTED(".short 0xfb0d,0xa709 @ mla r7, sp, r9, r10"); 1056 TEST_UNSUPPORTED(__inst_thumb32(0xfb0da709) " @ mla r7, sp, r9, r10");
1056 TEST_UNSUPPORTED(".short 0xfb08,0xa70f @ mla r7, r8, pc, r10"); 1057 TEST_UNSUPPORTED(__inst_thumb32(0xfb08a70f) " @ mla r7, r8, pc, r10");
1057 TEST_UNSUPPORTED(".short 0xfb08,0xa70d @ mla r7, r8, sp, r10"); 1058 TEST_UNSUPPORTED(__inst_thumb32(0xfb08a70d) " @ mla r7, r8, sp, r10");
1058 TEST_UNSUPPORTED(".short 0xfb08,0xd709 @ mla r7, r8, r9, sp"); 1059 TEST_UNSUPPORTED(__inst_thumb32(0xfb08d709) " @ mla r7, r8, r9, sp");
1059 1060
1060 TEST_RRR( "mls r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"") 1061 TEST_RRR( "mls r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"")
1061 TEST_RRR( "mls r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"") 1062 TEST_RRR( "mls r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"")
@@ -1123,25 +1124,25 @@ CONDITION_INSTRUCTIONS(22,
1123 TEST_RR( "usad8 r0, r",0, VAL1,", r",1, VAL2,"") 1124 TEST_RR( "usad8 r0, r",0, VAL1,", r",1, VAL2,"")
1124 TEST_RR( "usad8 r14, r",12,VAL2,", r",10,VAL1,"") 1125 TEST_RR( "usad8 r14, r",12,VAL2,", r",10,VAL1,"")
1125 1126
1126 TEST_UNSUPPORTED(".short 0xfb00,0xf010") /* Unallocated space */ 1127 TEST_UNSUPPORTED(__inst_thumb32(0xfb00f010) "") /* Unallocated space */
1127 TEST_UNSUPPORTED(".short 0xfb0f,0xff1f") /* Unallocated space */ 1128 TEST_UNSUPPORTED(__inst_thumb32(0xfb0fff1f) "") /* Unallocated space */
1128 TEST_UNSUPPORTED(".short 0xfb70,0xf010") /* Unallocated space */ 1129 TEST_UNSUPPORTED(__inst_thumb32(0xfb70f010) "") /* Unallocated space */
1129 TEST_UNSUPPORTED(".short 0xfb7f,0xff1f") /* Unallocated space */ 1130 TEST_UNSUPPORTED(__inst_thumb32(0xfb7fff1f) "") /* Unallocated space */
1130 TEST_UNSUPPORTED(".short 0xfb70,0x0010") /* Unallocated space */ 1131 TEST_UNSUPPORTED(__inst_thumb32(0xfb700010) "") /* Unallocated space */
1131 TEST_UNSUPPORTED(".short 0xfb7f,0xff1f") /* Unallocated space */ 1132 TEST_UNSUPPORTED(__inst_thumb32(0xfb7fff1f) "") /* Unallocated space */
1132 1133
1133 TEST_GROUP("Long multiply, long multiply accumulate, and divide") 1134 TEST_GROUP("Long multiply, long multiply accumulate, and divide")
1134 1135
1135 TEST_RR( "smull r0, r1, r",2, VAL1,", r",3, VAL2,"") 1136 TEST_RR( "smull r0, r1, r",2, VAL1,", r",3, VAL2,"")
1136 TEST_RR( "smull r7, r8, r",9, VAL2,", r",10, VAL1,"") 1137 TEST_RR( "smull r7, r8, r",9, VAL2,", r",10, VAL1,"")
1137 TEST_UNSUPPORTED(".short 0xfb89,0xf80a @ smull pc, r8, r9, r10"); 1138 TEST_UNSUPPORTED(__inst_thumb32(0xfb89f80a) " @ smull pc, r8, r9, r10");
1138 TEST_UNSUPPORTED(".short 0xfb89,0xd80a @ smull sp, r8, r9, r10"); 1139 TEST_UNSUPPORTED(__inst_thumb32(0xfb89d80a) " @ smull sp, r8, r9, r10");
1139 TEST_UNSUPPORTED(".short 0xfb89,0x7f0a @ smull r7, pc, r9, r10"); 1140 TEST_UNSUPPORTED(__inst_thumb32(0xfb897f0a) " @ smull r7, pc, r9, r10");
1140 TEST_UNSUPPORTED(".short 0xfb89,0x7d0a @ smull r7, sp, r9, r10"); 1141 TEST_UNSUPPORTED(__inst_thumb32(0xfb897d0a) " @ smull r7, sp, r9, r10");
1141 TEST_UNSUPPORTED(".short 0xfb8f,0x780a @ smull r7, r8, pc, r10"); 1142 TEST_UNSUPPORTED(__inst_thumb32(0xfb8f780a) " @ smull r7, r8, pc, r10");
1142 TEST_UNSUPPORTED(".short 0xfb8d,0x780a @ smull r7, r8, sp, r10"); 1143 TEST_UNSUPPORTED(__inst_thumb32(0xfb8d780a) " @ smull r7, r8, sp, r10");
1143 TEST_UNSUPPORTED(".short 0xfb89,0x780f @ smull r7, r8, r9, pc"); 1144 TEST_UNSUPPORTED(__inst_thumb32(0xfb89780f) " @ smull r7, r8, r9, pc");
1144 TEST_UNSUPPORTED(".short 0xfb89,0x780d @ smull r7, r8, r9, sp"); 1145 TEST_UNSUPPORTED(__inst_thumb32(0xfb89780d) " @ smull r7, r8, r9, sp");
1145 1146
1146 TEST_RR( "umull r0, r1, r",2, VAL1,", r",3, VAL2,"") 1147 TEST_RR( "umull r0, r1, r",2, VAL1,", r",3, VAL2,"")
1147 TEST_RR( "umull r7, r8, r",9, VAL2,", r",10, VAL1,"") 1148 TEST_RR( "umull r7, r8, r",9, VAL2,", r",10, VAL1,"")
@@ -1175,8 +1176,8 @@ CONDITION_INSTRUCTIONS(22,
1175 1176
1176 TEST_GROUP("Coprocessor instructions") 1177 TEST_GROUP("Coprocessor instructions")
1177 1178
1178 TEST_UNSUPPORTED(".short 0xfc00,0x0000") 1179 TEST_UNSUPPORTED(__inst_thumb32(0xfc000000) "")
1179 TEST_UNSUPPORTED(".short 0xffff,0xffff") 1180 TEST_UNSUPPORTED(__inst_thumb32(0xffffffff) "")
1180 1181
1181 TEST_GROUP("Testing instructions in IT blocks") 1182 TEST_GROUP("Testing instructions in IT blocks")
1182 1183
diff --git a/arch/arm/kernel/kprobes-test.c b/arch/arm/kernel/kprobes-test.c
index 0cd63d080c7b..379639998d5a 100644
--- a/arch/arm/kernel/kprobes-test.c
+++ b/arch/arm/kernel/kprobes-test.c
@@ -113,7 +113,7 @@
113 * @ start of inline data... 113 * @ start of inline data...
114 * .ascii "mov r0, r7" @ text title for test case 114 * .ascii "mov r0, r7" @ text title for test case
115 * .byte 0 115 * .byte 0
116 * .align 2 116 * .align 2, 0
117 * 117 *
118 * @ TEST_ARG_REG 118 * @ TEST_ARG_REG
119 * .byte ARG_TYPE_REG 119 * .byte ARG_TYPE_REG
@@ -201,10 +201,14 @@
201#include <linux/module.h> 201#include <linux/module.h>
202#include <linux/slab.h> 202#include <linux/slab.h>
203#include <linux/kprobes.h> 203#include <linux/kprobes.h>
204 204#include <linux/errno.h>
205#include <linux/stddef.h>
206#include <linux/bug.h>
205#include <asm/opcodes.h> 207#include <asm/opcodes.h>
206 208
207#include "kprobes.h" 209#include "kprobes.h"
210#include "probes-arm.h"
211#include "probes-thumb.h"
208#include "kprobes-test.h" 212#include "kprobes-test.h"
209 213
210 214
@@ -1329,7 +1333,8 @@ static void test_case_failed(const char *message)
1329static unsigned long next_instruction(unsigned long pc) 1333static unsigned long next_instruction(unsigned long pc)
1330{ 1334{
1331#ifdef CONFIG_THUMB2_KERNEL 1335#ifdef CONFIG_THUMB2_KERNEL
1332 if ((pc & 1) && !is_wide_instruction(*(u16 *)(pc - 1))) 1336 if ((pc & 1) &&
1337 !is_wide_instruction(__mem_to_opcode_thumb16(*(u16 *)(pc - 1))))
1333 return pc + 2; 1338 return pc + 2;
1334 else 1339 else
1335#endif 1340#endif
@@ -1374,13 +1379,13 @@ static uintptr_t __used kprobes_test_case_start(const char *title, void *stack)
1374 1379
1375 if (test_case_is_thumb) { 1380 if (test_case_is_thumb) {
1376 u16 *p = (u16 *)(test_code & ~1); 1381 u16 *p = (u16 *)(test_code & ~1);
1377 current_instruction = p[0]; 1382 current_instruction = __mem_to_opcode_thumb16(p[0]);
1378 if (is_wide_instruction(current_instruction)) { 1383 if (is_wide_instruction(current_instruction)) {
1379 current_instruction <<= 16; 1384 u16 instr2 = __mem_to_opcode_thumb16(p[1]);
1380 current_instruction |= p[1]; 1385 current_instruction = __opcode_thumb32_compose(current_instruction, instr2);
1381 } 1386 }
1382 } else { 1387 } else {
1383 current_instruction = *(u32 *)test_code; 1388 current_instruction = __mem_to_opcode_arm(*(u32 *)test_code);
1384 } 1389 }
1385 1390
1386 if (current_title[0] == '.') 1391 if (current_title[0] == '.')
@@ -1608,7 +1613,7 @@ static int __init run_all_tests(void)
1608 goto out; 1613 goto out;
1609 1614
1610 pr_info("ARM instruction simulation\n"); 1615 pr_info("ARM instruction simulation\n");
1611 ret = run_test_cases(kprobe_arm_test_cases, kprobe_decode_arm_table); 1616 ret = run_test_cases(kprobe_arm_test_cases, probes_decode_arm_table);
1612 if (ret) 1617 if (ret)
1613 goto out; 1618 goto out;
1614 1619
@@ -1631,13 +1636,13 @@ static int __init run_all_tests(void)
1631 1636
1632 pr_info("16-bit Thumb instruction simulation\n"); 1637 pr_info("16-bit Thumb instruction simulation\n");
1633 ret = run_test_cases(kprobe_thumb16_test_cases, 1638 ret = run_test_cases(kprobe_thumb16_test_cases,
1634 kprobe_decode_thumb16_table); 1639 probes_decode_thumb16_table);
1635 if (ret) 1640 if (ret)
1636 goto out; 1641 goto out;
1637 1642
1638 pr_info("32-bit Thumb instruction simulation\n"); 1643 pr_info("32-bit Thumb instruction simulation\n");
1639 ret = run_test_cases(kprobe_thumb32_test_cases, 1644 ret = run_test_cases(kprobe_thumb32_test_cases,
1640 kprobe_decode_thumb32_table); 1645 probes_decode_thumb32_table);
1641 if (ret) 1646 if (ret)
1642 goto out; 1647 goto out;
1643#endif 1648#endif
diff --git a/arch/arm/kernel/kprobes-test.h b/arch/arm/kernel/kprobes-test.h
index e28a869b1ae4..eecc90a0fd91 100644
--- a/arch/arm/kernel/kprobes-test.h
+++ b/arch/arm/kernel/kprobes-test.h
@@ -115,7 +115,7 @@ struct test_arg_end {
115 /* multiple strings to be concatenated. */ \ 115 /* multiple strings to be concatenated. */ \
116 ".ascii "#title" \n\t" \ 116 ".ascii "#title" \n\t" \
117 ".byte 0 \n\t" \ 117 ".byte 0 \n\t" \
118 ".align 2 \n\t" 118 ".align 2, 0 \n\t"
119 119
120#define TEST_ARG_REG(reg, val) \ 120#define TEST_ARG_REG(reg, val) \
121 ".byte "__stringify(ARG_TYPE_REG)" \n\t" \ 121 ".byte "__stringify(ARG_TYPE_REG)" \n\t" \
diff --git a/arch/arm/kernel/kprobes-thumb.c b/arch/arm/kernel/kprobes-thumb.c
index 6123daf397a7..9495d7f3516f 100644
--- a/arch/arm/kernel/kprobes-thumb.c
+++ b/arch/arm/kernel/kprobes-thumb.c
@@ -8,41 +8,25 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#include <linux/types.h>
11#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/ptrace.h>
12#include <linux/kprobes.h> 14#include <linux/kprobes.h>
13#include <linux/module.h>
14 15
15#include "kprobes.h" 16#include "kprobes.h"
17#include "probes-thumb.h"
16 18
19/* These emulation encodings are functionally equivalent... */
20#define t32_emulate_rd8rn16rm0ra12_noflags \
21 t32_emulate_rdlo12rdhi8rn16rm0_noflags
17 22
18/* 23/* t32 thumb actions */
19 * True if current instruction is in an IT block.
20 */
21#define in_it_block(cpsr) ((cpsr & 0x06000c00) != 0x00000000)
22
23/*
24 * Return the condition code to check for the currently executing instruction.
25 * This is in ITSTATE<7:4> which is in CPSR<15:12> but is only valid if
26 * in_it_block returns true.
27 */
28#define current_cond(cpsr) ((cpsr >> 12) & 0xf)
29
30/*
31 * Return the PC value for a probe in thumb code.
32 * This is the address of the probed instruction plus 4.
33 * We subtract one because the address will have bit zero set to indicate
34 * a pointer to thumb code.
35 */
36static inline unsigned long __kprobes thumb_probe_pc(struct kprobe *p)
37{
38 return (unsigned long)p->addr - 1 + 4;
39}
40 24
41static void __kprobes 25static void __kprobes
42t32_simulate_table_branch(struct kprobe *p, struct pt_regs *regs) 26t32_simulate_table_branch(probes_opcode_t insn,
27 struct arch_probes_insn *asi, struct pt_regs *regs)
43{ 28{
44 kprobe_opcode_t insn = p->opcode; 29 unsigned long pc = regs->ARM_pc;
45 unsigned long pc = thumb_probe_pc(p);
46 int rn = (insn >> 16) & 0xf; 30 int rn = (insn >> 16) & 0xf;
47 int rm = insn & 0xf; 31 int rm = insn & 0xf;
48 32
@@ -59,19 +43,19 @@ t32_simulate_table_branch(struct kprobe *p, struct pt_regs *regs)
59} 43}
60 44
61static void __kprobes 45static void __kprobes
62t32_simulate_mrs(struct kprobe *p, struct pt_regs *regs) 46t32_simulate_mrs(probes_opcode_t insn,
47 struct arch_probes_insn *asi, struct pt_regs *regs)
63{ 48{
64 kprobe_opcode_t insn = p->opcode;
65 int rd = (insn >> 8) & 0xf; 49 int rd = (insn >> 8) & 0xf;
66 unsigned long mask = 0xf8ff03df; /* Mask out execution state */ 50 unsigned long mask = 0xf8ff03df; /* Mask out execution state */
67 regs->uregs[rd] = regs->ARM_cpsr & mask; 51 regs->uregs[rd] = regs->ARM_cpsr & mask;
68} 52}
69 53
70static void __kprobes 54static void __kprobes
71t32_simulate_cond_branch(struct kprobe *p, struct pt_regs *regs) 55t32_simulate_cond_branch(probes_opcode_t insn,
56 struct arch_probes_insn *asi, struct pt_regs *regs)
72{ 57{
73 kprobe_opcode_t insn = p->opcode; 58 unsigned long pc = regs->ARM_pc;
74 unsigned long pc = thumb_probe_pc(p);
75 59
76 long offset = insn & 0x7ff; /* imm11 */ 60 long offset = insn & 0x7ff; /* imm11 */
77 offset += (insn & 0x003f0000) >> 5; /* imm6 */ 61 offset += (insn & 0x003f0000) >> 5; /* imm6 */
@@ -82,20 +66,21 @@ t32_simulate_cond_branch(struct kprobe *p, struct pt_regs *regs)
82 regs->ARM_pc = pc + (offset * 2); 66 regs->ARM_pc = pc + (offset * 2);
83} 67}
84 68
85static enum kprobe_insn __kprobes 69static enum probes_insn __kprobes
86t32_decode_cond_branch(kprobe_opcode_t insn, struct arch_specific_insn *asi) 70t32_decode_cond_branch(probes_opcode_t insn, struct arch_probes_insn *asi,
71 const struct decode_header *d)
87{ 72{
88 int cc = (insn >> 22) & 0xf; 73 int cc = (insn >> 22) & 0xf;
89 asi->insn_check_cc = kprobe_condition_checks[cc]; 74 asi->insn_check_cc = probes_condition_checks[cc];
90 asi->insn_handler = t32_simulate_cond_branch; 75 asi->insn_handler = t32_simulate_cond_branch;
91 return INSN_GOOD_NO_SLOT; 76 return INSN_GOOD_NO_SLOT;
92} 77}
93 78
94static void __kprobes 79static void __kprobes
95t32_simulate_branch(struct kprobe *p, struct pt_regs *regs) 80t32_simulate_branch(probes_opcode_t insn,
81 struct arch_probes_insn *asi, struct pt_regs *regs)
96{ 82{
97 kprobe_opcode_t insn = p->opcode; 83 unsigned long pc = regs->ARM_pc;
98 unsigned long pc = thumb_probe_pc(p);
99 84
100 long offset = insn & 0x7ff; /* imm11 */ 85 long offset = insn & 0x7ff; /* imm11 */
101 offset += (insn & 0x03ff0000) >> 5; /* imm10 */ 86 offset += (insn & 0x03ff0000) >> 5; /* imm10 */
@@ -108,7 +93,7 @@ t32_simulate_branch(struct kprobe *p, struct pt_regs *regs)
108 93
109 if (insn & (1 << 14)) { 94 if (insn & (1 << 14)) {
110 /* BL or BLX */ 95 /* BL or BLX */
111 regs->ARM_lr = (unsigned long)p->addr + 4; 96 regs->ARM_lr = regs->ARM_pc | 1;
112 if (!(insn & (1 << 12))) { 97 if (!(insn & (1 << 12))) {
113 /* BLX so switch to ARM mode */ 98 /* BLX so switch to ARM mode */
114 regs->ARM_cpsr &= ~PSR_T_BIT; 99 regs->ARM_cpsr &= ~PSR_T_BIT;
@@ -120,10 +105,10 @@ t32_simulate_branch(struct kprobe *p, struct pt_regs *regs)
120} 105}
121 106
122static void __kprobes 107static void __kprobes
123t32_simulate_ldr_literal(struct kprobe *p, struct pt_regs *regs) 108t32_simulate_ldr_literal(probes_opcode_t insn,
109 struct arch_probes_insn *asi, struct pt_regs *regs)
124{ 110{
125 kprobe_opcode_t insn = p->opcode; 111 unsigned long addr = regs->ARM_pc & ~3;
126 unsigned long addr = thumb_probe_pc(p) & ~3;
127 int rt = (insn >> 12) & 0xf; 112 int rt = (insn >> 12) & 0xf;
128 unsigned long rtv; 113 unsigned long rtv;
129 114
@@ -157,24 +142,25 @@ t32_simulate_ldr_literal(struct kprobe *p, struct pt_regs *regs)
157 regs->uregs[rt] = rtv; 142 regs->uregs[rt] = rtv;
158} 143}
159 144
160static enum kprobe_insn __kprobes 145static enum probes_insn __kprobes
161t32_decode_ldmstm(kprobe_opcode_t insn, struct arch_specific_insn *asi) 146t32_decode_ldmstm(probes_opcode_t insn, struct arch_probes_insn *asi,
147 const struct decode_header *d)
162{ 148{
163 enum kprobe_insn ret = kprobe_decode_ldmstm(insn, asi); 149 enum probes_insn ret = kprobe_decode_ldmstm(insn, asi, d);
164 150
165 /* Fixup modified instruction to have halfwords in correct order...*/ 151 /* Fixup modified instruction to have halfwords in correct order...*/
166 insn = asi->insn[0]; 152 insn = __mem_to_opcode_arm(asi->insn[0]);
167 ((u16 *)asi->insn)[0] = insn >> 16; 153 ((u16 *)asi->insn)[0] = __opcode_to_mem_thumb16(insn >> 16);
168 ((u16 *)asi->insn)[1] = insn & 0xffff; 154 ((u16 *)asi->insn)[1] = __opcode_to_mem_thumb16(insn & 0xffff);
169 155
170 return ret; 156 return ret;
171} 157}
172 158
173static void __kprobes 159static void __kprobes
174t32_emulate_ldrdstrd(struct kprobe *p, struct pt_regs *regs) 160t32_emulate_ldrdstrd(probes_opcode_t insn,
161 struct arch_probes_insn *asi, struct pt_regs *regs)
175{ 162{
176 kprobe_opcode_t insn = p->opcode; 163 unsigned long pc = regs->ARM_pc & ~3;
177 unsigned long pc = thumb_probe_pc(p) & ~3;
178 int rt1 = (insn >> 12) & 0xf; 164 int rt1 = (insn >> 12) & 0xf;
179 int rt2 = (insn >> 8) & 0xf; 165 int rt2 = (insn >> 8) & 0xf;
180 int rn = (insn >> 16) & 0xf; 166 int rn = (insn >> 16) & 0xf;
@@ -187,7 +173,7 @@ t32_emulate_ldrdstrd(struct kprobe *p, struct pt_regs *regs)
187 __asm__ __volatile__ ( 173 __asm__ __volatile__ (
188 "blx %[fn]" 174 "blx %[fn]"
189 : "=r" (rt1v), "=r" (rt2v), "=r" (rnv) 175 : "=r" (rt1v), "=r" (rt2v), "=r" (rnv)
190 : "0" (rt1v), "1" (rt2v), "2" (rnv), [fn] "r" (p->ainsn.insn_fn) 176 : "0" (rt1v), "1" (rt2v), "2" (rnv), [fn] "r" (asi->insn_fn)
191 : "lr", "memory", "cc" 177 : "lr", "memory", "cc"
192 ); 178 );
193 179
@@ -198,9 +184,9 @@ t32_emulate_ldrdstrd(struct kprobe *p, struct pt_regs *regs)
198} 184}
199 185
200static void __kprobes 186static void __kprobes
201t32_emulate_ldrstr(struct kprobe *p, struct pt_regs *regs) 187t32_emulate_ldrstr(probes_opcode_t insn,
188 struct arch_probes_insn *asi, struct pt_regs *regs)
202{ 189{
203 kprobe_opcode_t insn = p->opcode;
204 int rt = (insn >> 12) & 0xf; 190 int rt = (insn >> 12) & 0xf;
205 int rn = (insn >> 16) & 0xf; 191 int rn = (insn >> 16) & 0xf;
206 int rm = insn & 0xf; 192 int rm = insn & 0xf;
@@ -212,7 +198,7 @@ t32_emulate_ldrstr(struct kprobe *p, struct pt_regs *regs)
212 __asm__ __volatile__ ( 198 __asm__ __volatile__ (
213 "blx %[fn]" 199 "blx %[fn]"
214 : "=r" (rtv), "=r" (rnv) 200 : "=r" (rtv), "=r" (rnv)
215 : "0" (rtv), "1" (rnv), "r" (rmv), [fn] "r" (p->ainsn.insn_fn) 201 : "0" (rtv), "1" (rnv), "r" (rmv), [fn] "r" (asi->insn_fn)
216 : "lr", "memory", "cc" 202 : "lr", "memory", "cc"
217 ); 203 );
218 204
@@ -224,9 +210,9 @@ t32_emulate_ldrstr(struct kprobe *p, struct pt_regs *regs)
224} 210}
225 211
226static void __kprobes 212static void __kprobes
227t32_emulate_rd8rn16rm0_rwflags(struct kprobe *p, struct pt_regs *regs) 213t32_emulate_rd8rn16rm0_rwflags(probes_opcode_t insn,
214 struct arch_probes_insn *asi, struct pt_regs *regs)
228{ 215{
229 kprobe_opcode_t insn = p->opcode;
230 int rd = (insn >> 8) & 0xf; 216 int rd = (insn >> 8) & 0xf;
231 int rn = (insn >> 16) & 0xf; 217 int rn = (insn >> 16) & 0xf;
232 int rm = insn & 0xf; 218 int rm = insn & 0xf;
@@ -242,7 +228,7 @@ t32_emulate_rd8rn16rm0_rwflags(struct kprobe *p, struct pt_regs *regs)
242 "mrs %[cpsr], cpsr \n\t" 228 "mrs %[cpsr], cpsr \n\t"
243 : "=r" (rdv), [cpsr] "=r" (cpsr) 229 : "=r" (rdv), [cpsr] "=r" (cpsr)
244 : "0" (rdv), "r" (rnv), "r" (rmv), 230 : "0" (rdv), "r" (rnv), "r" (rmv),
245 "1" (cpsr), [fn] "r" (p->ainsn.insn_fn) 231 "1" (cpsr), [fn] "r" (asi->insn_fn)
246 : "lr", "memory", "cc" 232 : "lr", "memory", "cc"
247 ); 233 );
248 234
@@ -251,10 +237,10 @@ t32_emulate_rd8rn16rm0_rwflags(struct kprobe *p, struct pt_regs *regs)
251} 237}
252 238
253static void __kprobes 239static void __kprobes
254t32_emulate_rd8pc16_noflags(struct kprobe *p, struct pt_regs *regs) 240t32_emulate_rd8pc16_noflags(probes_opcode_t insn,
241 struct arch_probes_insn *asi, struct pt_regs *regs)
255{ 242{
256 kprobe_opcode_t insn = p->opcode; 243 unsigned long pc = regs->ARM_pc;
257 unsigned long pc = thumb_probe_pc(p);
258 int rd = (insn >> 8) & 0xf; 244 int rd = (insn >> 8) & 0xf;
259 245
260 register unsigned long rdv asm("r1") = regs->uregs[rd]; 246 register unsigned long rdv asm("r1") = regs->uregs[rd];
@@ -263,7 +249,7 @@ t32_emulate_rd8pc16_noflags(struct kprobe *p, struct pt_regs *regs)
263 __asm__ __volatile__ ( 249 __asm__ __volatile__ (
264 "blx %[fn]" 250 "blx %[fn]"
265 : "=r" (rdv) 251 : "=r" (rdv)
266 : "0" (rdv), "r" (rnv), [fn] "r" (p->ainsn.insn_fn) 252 : "0" (rdv), "r" (rnv), [fn] "r" (asi->insn_fn)
267 : "lr", "memory", "cc" 253 : "lr", "memory", "cc"
268 ); 254 );
269 255
@@ -271,9 +257,9 @@ t32_emulate_rd8pc16_noflags(struct kprobe *p, struct pt_regs *regs)
271} 257}
272 258
273static void __kprobes 259static void __kprobes
274t32_emulate_rd8rn16_noflags(struct kprobe *p, struct pt_regs *regs) 260t32_emulate_rd8rn16_noflags(probes_opcode_t insn,
261 struct arch_probes_insn *asi, struct pt_regs *regs)
275{ 262{
276 kprobe_opcode_t insn = p->opcode;
277 int rd = (insn >> 8) & 0xf; 263 int rd = (insn >> 8) & 0xf;
278 int rn = (insn >> 16) & 0xf; 264 int rn = (insn >> 16) & 0xf;
279 265
@@ -283,7 +269,7 @@ t32_emulate_rd8rn16_noflags(struct kprobe *p, struct pt_regs *regs)
283 __asm__ __volatile__ ( 269 __asm__ __volatile__ (
284 "blx %[fn]" 270 "blx %[fn]"
285 : "=r" (rdv) 271 : "=r" (rdv)
286 : "0" (rdv), "r" (rnv), [fn] "r" (p->ainsn.insn_fn) 272 : "0" (rdv), "r" (rnv), [fn] "r" (asi->insn_fn)
287 : "lr", "memory", "cc" 273 : "lr", "memory", "cc"
288 ); 274 );
289 275
@@ -291,9 +277,10 @@ t32_emulate_rd8rn16_noflags(struct kprobe *p, struct pt_regs *regs)
291} 277}
292 278
293static void __kprobes 279static void __kprobes
294t32_emulate_rdlo12rdhi8rn16rm0_noflags(struct kprobe *p, struct pt_regs *regs) 280t32_emulate_rdlo12rdhi8rn16rm0_noflags(probes_opcode_t insn,
281 struct arch_probes_insn *asi,
282 struct pt_regs *regs)
295{ 283{
296 kprobe_opcode_t insn = p->opcode;
297 int rdlo = (insn >> 12) & 0xf; 284 int rdlo = (insn >> 12) & 0xf;
298 int rdhi = (insn >> 8) & 0xf; 285 int rdhi = (insn >> 8) & 0xf;
299 int rn = (insn >> 16) & 0xf; 286 int rn = (insn >> 16) & 0xf;
@@ -308,674 +295,43 @@ t32_emulate_rdlo12rdhi8rn16rm0_noflags(struct kprobe *p, struct pt_regs *regs)
308 "blx %[fn]" 295 "blx %[fn]"
309 : "=r" (rdlov), "=r" (rdhiv) 296 : "=r" (rdlov), "=r" (rdhiv)
310 : "0" (rdlov), "1" (rdhiv), "r" (rnv), "r" (rmv), 297 : "0" (rdlov), "1" (rdhiv), "r" (rnv), "r" (rmv),
311 [fn] "r" (p->ainsn.insn_fn) 298 [fn] "r" (asi->insn_fn)
312 : "lr", "memory", "cc" 299 : "lr", "memory", "cc"
313 ); 300 );
314 301
315 regs->uregs[rdlo] = rdlov; 302 regs->uregs[rdlo] = rdlov;
316 regs->uregs[rdhi] = rdhiv; 303 regs->uregs[rdhi] = rdhiv;
317} 304}
318 305/* t16 thumb actions */
319/* These emulation encodings are functionally equivalent... */
320#define t32_emulate_rd8rn16rm0ra12_noflags \
321 t32_emulate_rdlo12rdhi8rn16rm0_noflags
322
323static const union decode_item t32_table_1110_100x_x0xx[] = {
324 /* Load/store multiple instructions */
325
326 /* Rn is PC 1110 100x x0xx 1111 xxxx xxxx xxxx xxxx */
327 DECODE_REJECT (0xfe4f0000, 0xe80f0000),
328
329 /* SRS 1110 1000 00x0 xxxx xxxx xxxx xxxx xxxx */
330 /* RFE 1110 1000 00x1 xxxx xxxx xxxx xxxx xxxx */
331 DECODE_REJECT (0xffc00000, 0xe8000000),
332 /* SRS 1110 1001 10x0 xxxx xxxx xxxx xxxx xxxx */
333 /* RFE 1110 1001 10x1 xxxx xxxx xxxx xxxx xxxx */
334 DECODE_REJECT (0xffc00000, 0xe9800000),
335
336 /* STM Rn, {...pc} 1110 100x x0x0 xxxx 1xxx xxxx xxxx xxxx */
337 DECODE_REJECT (0xfe508000, 0xe8008000),
338 /* LDM Rn, {...lr,pc} 1110 100x x0x1 xxxx 11xx xxxx xxxx xxxx */
339 DECODE_REJECT (0xfe50c000, 0xe810c000),
340 /* LDM/STM Rn, {...sp} 1110 100x x0xx xxxx xx1x xxxx xxxx xxxx */
341 DECODE_REJECT (0xfe402000, 0xe8002000),
342
343 /* STMIA 1110 1000 10x0 xxxx xxxx xxxx xxxx xxxx */
344 /* LDMIA 1110 1000 10x1 xxxx xxxx xxxx xxxx xxxx */
345 /* STMDB 1110 1001 00x0 xxxx xxxx xxxx xxxx xxxx */
346 /* LDMDB 1110 1001 00x1 xxxx xxxx xxxx xxxx xxxx */
347 DECODE_CUSTOM (0xfe400000, 0xe8000000, t32_decode_ldmstm),
348
349 DECODE_END
350};
351
352static const union decode_item t32_table_1110_100x_x1xx[] = {
353 /* Load/store dual, load/store exclusive, table branch */
354
355 /* STRD (immediate) 1110 1000 x110 xxxx xxxx xxxx xxxx xxxx */
356 /* LDRD (immediate) 1110 1000 x111 xxxx xxxx xxxx xxxx xxxx */
357 DECODE_OR (0xff600000, 0xe8600000),
358 /* STRD (immediate) 1110 1001 x1x0 xxxx xxxx xxxx xxxx xxxx */
359 /* LDRD (immediate) 1110 1001 x1x1 xxxx xxxx xxxx xxxx xxxx */
360 DECODE_EMULATEX (0xff400000, 0xe9400000, t32_emulate_ldrdstrd,
361 REGS(NOPCWB, NOSPPC, NOSPPC, 0, 0)),
362
363 /* TBB 1110 1000 1101 xxxx xxxx xxxx 0000 xxxx */
364 /* TBH 1110 1000 1101 xxxx xxxx xxxx 0001 xxxx */
365 DECODE_SIMULATEX(0xfff000e0, 0xe8d00000, t32_simulate_table_branch,
366 REGS(NOSP, 0, 0, 0, NOSPPC)),
367
368 /* STREX 1110 1000 0100 xxxx xxxx xxxx xxxx xxxx */
369 /* LDREX 1110 1000 0101 xxxx xxxx xxxx xxxx xxxx */
370 /* STREXB 1110 1000 1100 xxxx xxxx xxxx 0100 xxxx */
371 /* STREXH 1110 1000 1100 xxxx xxxx xxxx 0101 xxxx */
372 /* STREXD 1110 1000 1100 xxxx xxxx xxxx 0111 xxxx */
373 /* LDREXB 1110 1000 1101 xxxx xxxx xxxx 0100 xxxx */
374 /* LDREXH 1110 1000 1101 xxxx xxxx xxxx 0101 xxxx */
375 /* LDREXD 1110 1000 1101 xxxx xxxx xxxx 0111 xxxx */
376 /* And unallocated instructions... */
377 DECODE_END
378};
379
380static const union decode_item t32_table_1110_101x[] = {
381 /* Data-processing (shifted register) */
382
383 /* TST 1110 1010 0001 xxxx xxxx 1111 xxxx xxxx */
384 /* TEQ 1110 1010 1001 xxxx xxxx 1111 xxxx xxxx */
385 DECODE_EMULATEX (0xff700f00, 0xea100f00, t32_emulate_rd8rn16rm0_rwflags,
386 REGS(NOSPPC, 0, 0, 0, NOSPPC)),
387
388 /* CMN 1110 1011 0001 xxxx xxxx 1111 xxxx xxxx */
389 DECODE_OR (0xfff00f00, 0xeb100f00),
390 /* CMP 1110 1011 1011 xxxx xxxx 1111 xxxx xxxx */
391 DECODE_EMULATEX (0xfff00f00, 0xebb00f00, t32_emulate_rd8rn16rm0_rwflags,
392 REGS(NOPC, 0, 0, 0, NOSPPC)),
393
394 /* MOV 1110 1010 010x 1111 xxxx xxxx xxxx xxxx */
395 /* MVN 1110 1010 011x 1111 xxxx xxxx xxxx xxxx */
396 DECODE_EMULATEX (0xffcf0000, 0xea4f0000, t32_emulate_rd8rn16rm0_rwflags,
397 REGS(0, 0, NOSPPC, 0, NOSPPC)),
398
399 /* ??? 1110 1010 101x xxxx xxxx xxxx xxxx xxxx */
400 /* ??? 1110 1010 111x xxxx xxxx xxxx xxxx xxxx */
401 DECODE_REJECT (0xffa00000, 0xeaa00000),
402 /* ??? 1110 1011 001x xxxx xxxx xxxx xxxx xxxx */
403 DECODE_REJECT (0xffe00000, 0xeb200000),
404 /* ??? 1110 1011 100x xxxx xxxx xxxx xxxx xxxx */
405 DECODE_REJECT (0xffe00000, 0xeb800000),
406 /* ??? 1110 1011 111x xxxx xxxx xxxx xxxx xxxx */
407 DECODE_REJECT (0xffe00000, 0xebe00000),
408
409 /* ADD/SUB SP, SP, Rm, LSL #0..3 */
410 /* 1110 1011 x0xx 1101 x000 1101 xx00 xxxx */
411 DECODE_EMULATEX (0xff4f7f30, 0xeb0d0d00, t32_emulate_rd8rn16rm0_rwflags,
412 REGS(SP, 0, SP, 0, NOSPPC)),
413
414 /* ADD/SUB SP, SP, Rm, shift */
415 /* 1110 1011 x0xx 1101 xxxx 1101 xxxx xxxx */
416 DECODE_REJECT (0xff4f0f00, 0xeb0d0d00),
417
418 /* ADD/SUB Rd, SP, Rm, shift */
419 /* 1110 1011 x0xx 1101 xxxx xxxx xxxx xxxx */
420 DECODE_EMULATEX (0xff4f0000, 0xeb0d0000, t32_emulate_rd8rn16rm0_rwflags,
421 REGS(SP, 0, NOPC, 0, NOSPPC)),
422
423 /* AND 1110 1010 000x xxxx xxxx xxxx xxxx xxxx */
424 /* BIC 1110 1010 001x xxxx xxxx xxxx xxxx xxxx */
425 /* ORR 1110 1010 010x xxxx xxxx xxxx xxxx xxxx */
426 /* ORN 1110 1010 011x xxxx xxxx xxxx xxxx xxxx */
427 /* EOR 1110 1010 100x xxxx xxxx xxxx xxxx xxxx */
428 /* PKH 1110 1010 110x xxxx xxxx xxxx xxxx xxxx */
429 /* ADD 1110 1011 000x xxxx xxxx xxxx xxxx xxxx */
430 /* ADC 1110 1011 010x xxxx xxxx xxxx xxxx xxxx */
431 /* SBC 1110 1011 011x xxxx xxxx xxxx xxxx xxxx */
432 /* SUB 1110 1011 101x xxxx xxxx xxxx xxxx xxxx */
433 /* RSB 1110 1011 110x xxxx xxxx xxxx xxxx xxxx */
434 DECODE_EMULATEX (0xfe000000, 0xea000000, t32_emulate_rd8rn16rm0_rwflags,
435 REGS(NOSPPC, 0, NOSPPC, 0, NOSPPC)),
436
437 DECODE_END
438};
439
440static const union decode_item t32_table_1111_0x0x___0[] = {
441 /* Data-processing (modified immediate) */
442
443 /* TST 1111 0x00 0001 xxxx 0xxx 1111 xxxx xxxx */
444 /* TEQ 1111 0x00 1001 xxxx 0xxx 1111 xxxx xxxx */
445 DECODE_EMULATEX (0xfb708f00, 0xf0100f00, t32_emulate_rd8rn16rm0_rwflags,
446 REGS(NOSPPC, 0, 0, 0, 0)),
447
448 /* CMN 1111 0x01 0001 xxxx 0xxx 1111 xxxx xxxx */
449 DECODE_OR (0xfbf08f00, 0xf1100f00),
450 /* CMP 1111 0x01 1011 xxxx 0xxx 1111 xxxx xxxx */
451 DECODE_EMULATEX (0xfbf08f00, 0xf1b00f00, t32_emulate_rd8rn16rm0_rwflags,
452 REGS(NOPC, 0, 0, 0, 0)),
453
454 /* MOV 1111 0x00 010x 1111 0xxx xxxx xxxx xxxx */
455 /* MVN 1111 0x00 011x 1111 0xxx xxxx xxxx xxxx */
456 DECODE_EMULATEX (0xfbcf8000, 0xf04f0000, t32_emulate_rd8rn16rm0_rwflags,
457 REGS(0, 0, NOSPPC, 0, 0)),
458
459 /* ??? 1111 0x00 101x xxxx 0xxx xxxx xxxx xxxx */
460 DECODE_REJECT (0xfbe08000, 0xf0a00000),
461 /* ??? 1111 0x00 110x xxxx 0xxx xxxx xxxx xxxx */
462 /* ??? 1111 0x00 111x xxxx 0xxx xxxx xxxx xxxx */
463 DECODE_REJECT (0xfbc08000, 0xf0c00000),
464 /* ??? 1111 0x01 001x xxxx 0xxx xxxx xxxx xxxx */
465 DECODE_REJECT (0xfbe08000, 0xf1200000),
466 /* ??? 1111 0x01 100x xxxx 0xxx xxxx xxxx xxxx */
467 DECODE_REJECT (0xfbe08000, 0xf1800000),
468 /* ??? 1111 0x01 111x xxxx 0xxx xxxx xxxx xxxx */
469 DECODE_REJECT (0xfbe08000, 0xf1e00000),
470
471 /* ADD Rd, SP, #imm 1111 0x01 000x 1101 0xxx xxxx xxxx xxxx */
472 /* SUB Rd, SP, #imm 1111 0x01 101x 1101 0xxx xxxx xxxx xxxx */
473 DECODE_EMULATEX (0xfb4f8000, 0xf10d0000, t32_emulate_rd8rn16rm0_rwflags,
474 REGS(SP, 0, NOPC, 0, 0)),
475
476 /* AND 1111 0x00 000x xxxx 0xxx xxxx xxxx xxxx */
477 /* BIC 1111 0x00 001x xxxx 0xxx xxxx xxxx xxxx */
478 /* ORR 1111 0x00 010x xxxx 0xxx xxxx xxxx xxxx */
479 /* ORN 1111 0x00 011x xxxx 0xxx xxxx xxxx xxxx */
480 /* EOR 1111 0x00 100x xxxx 0xxx xxxx xxxx xxxx */
481 /* ADD 1111 0x01 000x xxxx 0xxx xxxx xxxx xxxx */
482 /* ADC 1111 0x01 010x xxxx 0xxx xxxx xxxx xxxx */
483 /* SBC 1111 0x01 011x xxxx 0xxx xxxx xxxx xxxx */
484 /* SUB 1111 0x01 101x xxxx 0xxx xxxx xxxx xxxx */
485 /* RSB 1111 0x01 110x xxxx 0xxx xxxx xxxx xxxx */
486 DECODE_EMULATEX (0xfa008000, 0xf0000000, t32_emulate_rd8rn16rm0_rwflags,
487 REGS(NOSPPC, 0, NOSPPC, 0, 0)),
488
489 DECODE_END
490};
491
492static const union decode_item t32_table_1111_0x1x___0[] = {
493 /* Data-processing (plain binary immediate) */
494
495 /* ADDW Rd, PC, #imm 1111 0x10 0000 1111 0xxx xxxx xxxx xxxx */
496 DECODE_OR (0xfbff8000, 0xf20f0000),
497 /* SUBW Rd, PC, #imm 1111 0x10 1010 1111 0xxx xxxx xxxx xxxx */
498 DECODE_EMULATEX (0xfbff8000, 0xf2af0000, t32_emulate_rd8pc16_noflags,
499 REGS(PC, 0, NOSPPC, 0, 0)),
500
501 /* ADDW SP, SP, #imm 1111 0x10 0000 1101 0xxx 1101 xxxx xxxx */
502 DECODE_OR (0xfbff8f00, 0xf20d0d00),
503 /* SUBW SP, SP, #imm 1111 0x10 1010 1101 0xxx 1101 xxxx xxxx */
504 DECODE_EMULATEX (0xfbff8f00, 0xf2ad0d00, t32_emulate_rd8rn16_noflags,
505 REGS(SP, 0, SP, 0, 0)),
506
507 /* ADDW 1111 0x10 0000 xxxx 0xxx xxxx xxxx xxxx */
508 DECODE_OR (0xfbf08000, 0xf2000000),
509 /* SUBW 1111 0x10 1010 xxxx 0xxx xxxx xxxx xxxx */
510 DECODE_EMULATEX (0xfbf08000, 0xf2a00000, t32_emulate_rd8rn16_noflags,
511 REGS(NOPCX, 0, NOSPPC, 0, 0)),
512
513 /* MOVW 1111 0x10 0100 xxxx 0xxx xxxx xxxx xxxx */
514 /* MOVT 1111 0x10 1100 xxxx 0xxx xxxx xxxx xxxx */
515 DECODE_EMULATEX (0xfb708000, 0xf2400000, t32_emulate_rd8rn16_noflags,
516 REGS(0, 0, NOSPPC, 0, 0)),
517
518 /* SSAT16 1111 0x11 0010 xxxx 0000 xxxx 00xx xxxx */
519 /* SSAT 1111 0x11 00x0 xxxx 0xxx xxxx xxxx xxxx */
520 /* USAT16 1111 0x11 1010 xxxx 0000 xxxx 00xx xxxx */
521 /* USAT 1111 0x11 10x0 xxxx 0xxx xxxx xxxx xxxx */
522 DECODE_EMULATEX (0xfb508000, 0xf3000000, t32_emulate_rd8rn16rm0_rwflags,
523 REGS(NOSPPC, 0, NOSPPC, 0, 0)),
524
525 /* SFBX 1111 0x11 0100 xxxx 0xxx xxxx xxxx xxxx */
526 /* UFBX 1111 0x11 1100 xxxx 0xxx xxxx xxxx xxxx */
527 DECODE_EMULATEX (0xfb708000, 0xf3400000, t32_emulate_rd8rn16_noflags,
528 REGS(NOSPPC, 0, NOSPPC, 0, 0)),
529
530 /* BFC 1111 0x11 0110 1111 0xxx xxxx xxxx xxxx */
531 DECODE_EMULATEX (0xfbff8000, 0xf36f0000, t32_emulate_rd8rn16_noflags,
532 REGS(0, 0, NOSPPC, 0, 0)),
533
534 /* BFI 1111 0x11 0110 xxxx 0xxx xxxx xxxx xxxx */
535 DECODE_EMULATEX (0xfbf08000, 0xf3600000, t32_emulate_rd8rn16_noflags,
536 REGS(NOSPPCX, 0, NOSPPC, 0, 0)),
537
538 DECODE_END
539};
540
541static const union decode_item t32_table_1111_0xxx___1[] = {
542 /* Branches and miscellaneous control */
543
544 /* YIELD 1111 0011 1010 xxxx 10x0 x000 0000 0001 */
545 DECODE_OR (0xfff0d7ff, 0xf3a08001),
546 /* SEV 1111 0011 1010 xxxx 10x0 x000 0000 0100 */
547 DECODE_EMULATE (0xfff0d7ff, 0xf3a08004, kprobe_emulate_none),
548 /* NOP 1111 0011 1010 xxxx 10x0 x000 0000 0000 */
549 /* WFE 1111 0011 1010 xxxx 10x0 x000 0000 0010 */
550 /* WFI 1111 0011 1010 xxxx 10x0 x000 0000 0011 */
551 DECODE_SIMULATE (0xfff0d7fc, 0xf3a08000, kprobe_simulate_nop),
552
553 /* MRS Rd, CPSR 1111 0011 1110 xxxx 10x0 xxxx xxxx xxxx */
554 DECODE_SIMULATEX(0xfff0d000, 0xf3e08000, t32_simulate_mrs,
555 REGS(0, 0, NOSPPC, 0, 0)),
556
557 /*
558 * Unsupported instructions
559 * 1111 0x11 1xxx xxxx 10x0 xxxx xxxx xxxx
560 *
561 * MSR 1111 0011 100x xxxx 10x0 xxxx xxxx xxxx
562 * DBG hint 1111 0011 1010 xxxx 10x0 x000 1111 xxxx
563 * Unallocated hints 1111 0011 1010 xxxx 10x0 x000 xxxx xxxx
564 * CPS 1111 0011 1010 xxxx 10x0 xxxx xxxx xxxx
565 * CLREX/DSB/DMB/ISB 1111 0011 1011 xxxx 10x0 xxxx xxxx xxxx
566 * BXJ 1111 0011 1100 xxxx 10x0 xxxx xxxx xxxx
567 * SUBS PC,LR,#<imm8> 1111 0011 1101 xxxx 10x0 xxxx xxxx xxxx
568 * MRS Rd, SPSR 1111 0011 1111 xxxx 10x0 xxxx xxxx xxxx
569 * SMC 1111 0111 1111 xxxx 1000 xxxx xxxx xxxx
570 * UNDEFINED 1111 0111 1111 xxxx 1010 xxxx xxxx xxxx
571 * ??? 1111 0111 1xxx xxxx 1010 xxxx xxxx xxxx
572 */
573 DECODE_REJECT (0xfb80d000, 0xf3808000),
574
575 /* Bcc 1111 0xxx xxxx xxxx 10x0 xxxx xxxx xxxx */
576 DECODE_CUSTOM (0xf800d000, 0xf0008000, t32_decode_cond_branch),
577
578 /* BLX 1111 0xxx xxxx xxxx 11x0 xxxx xxxx xxx0 */
579 DECODE_OR (0xf800d001, 0xf000c000),
580 /* B 1111 0xxx xxxx xxxx 10x1 xxxx xxxx xxxx */
581 /* BL 1111 0xxx xxxx xxxx 11x1 xxxx xxxx xxxx */
582 DECODE_SIMULATE (0xf8009000, 0xf0009000, t32_simulate_branch),
583
584 DECODE_END
585};
586
587static const union decode_item t32_table_1111_100x_x0x1__1111[] = {
588 /* Memory hints */
589
590 /* PLD (literal) 1111 1000 x001 1111 1111 xxxx xxxx xxxx */
591 /* PLI (literal) 1111 1001 x001 1111 1111 xxxx xxxx xxxx */
592 DECODE_SIMULATE (0xfe7ff000, 0xf81ff000, kprobe_simulate_nop),
593
594 /* PLD{W} (immediate) 1111 1000 10x1 xxxx 1111 xxxx xxxx xxxx */
595 DECODE_OR (0xffd0f000, 0xf890f000),
596 /* PLD{W} (immediate) 1111 1000 00x1 xxxx 1111 1100 xxxx xxxx */
597 DECODE_OR (0xffd0ff00, 0xf810fc00),
598 /* PLI (immediate) 1111 1001 1001 xxxx 1111 xxxx xxxx xxxx */
599 DECODE_OR (0xfff0f000, 0xf990f000),
600 /* PLI (immediate) 1111 1001 0001 xxxx 1111 1100 xxxx xxxx */
601 DECODE_SIMULATEX(0xfff0ff00, 0xf910fc00, kprobe_simulate_nop,
602 REGS(NOPCX, 0, 0, 0, 0)),
603
604 /* PLD{W} (register) 1111 1000 00x1 xxxx 1111 0000 00xx xxxx */
605 DECODE_OR (0xffd0ffc0, 0xf810f000),
606 /* PLI (register) 1111 1001 0001 xxxx 1111 0000 00xx xxxx */
607 DECODE_SIMULATEX(0xfff0ffc0, 0xf910f000, kprobe_simulate_nop,
608 REGS(NOPCX, 0, 0, 0, NOSPPC)),
609
610 /* Other unallocated instructions... */
611 DECODE_END
612};
613
614static const union decode_item t32_table_1111_100x[] = {
615 /* Store/Load single data item */
616
617 /* ??? 1111 100x x11x xxxx xxxx xxxx xxxx xxxx */
618 DECODE_REJECT (0xfe600000, 0xf8600000),
619
620 /* ??? 1111 1001 0101 xxxx xxxx xxxx xxxx xxxx */
621 DECODE_REJECT (0xfff00000, 0xf9500000),
622
623 /* ??? 1111 100x 0xxx xxxx xxxx 10x0 xxxx xxxx */
624 DECODE_REJECT (0xfe800d00, 0xf8000800),
625
626 /* STRBT 1111 1000 0000 xxxx xxxx 1110 xxxx xxxx */
627 /* STRHT 1111 1000 0010 xxxx xxxx 1110 xxxx xxxx */
628 /* STRT 1111 1000 0100 xxxx xxxx 1110 xxxx xxxx */
629 /* LDRBT 1111 1000 0001 xxxx xxxx 1110 xxxx xxxx */
630 /* LDRSBT 1111 1001 0001 xxxx xxxx 1110 xxxx xxxx */
631 /* LDRHT 1111 1000 0011 xxxx xxxx 1110 xxxx xxxx */
632 /* LDRSHT 1111 1001 0011 xxxx xxxx 1110 xxxx xxxx */
633 /* LDRT 1111 1000 0101 xxxx xxxx 1110 xxxx xxxx */
634 DECODE_REJECT (0xfe800f00, 0xf8000e00),
635
636 /* STR{,B,H} Rn,[PC...] 1111 1000 xxx0 1111 xxxx xxxx xxxx xxxx */
637 DECODE_REJECT (0xff1f0000, 0xf80f0000),
638
639 /* STR{,B,H} PC,[Rn...] 1111 1000 xxx0 xxxx 1111 xxxx xxxx xxxx */
640 DECODE_REJECT (0xff10f000, 0xf800f000),
641
642 /* LDR (literal) 1111 1000 x101 1111 xxxx xxxx xxxx xxxx */
643 DECODE_SIMULATEX(0xff7f0000, 0xf85f0000, t32_simulate_ldr_literal,
644 REGS(PC, ANY, 0, 0, 0)),
645
646 /* STR (immediate) 1111 1000 0100 xxxx xxxx 1xxx xxxx xxxx */
647 /* LDR (immediate) 1111 1000 0101 xxxx xxxx 1xxx xxxx xxxx */
648 DECODE_OR (0xffe00800, 0xf8400800),
649 /* STR (immediate) 1111 1000 1100 xxxx xxxx xxxx xxxx xxxx */
650 /* LDR (immediate) 1111 1000 1101 xxxx xxxx xxxx xxxx xxxx */
651 DECODE_EMULATEX (0xffe00000, 0xf8c00000, t32_emulate_ldrstr,
652 REGS(NOPCX, ANY, 0, 0, 0)),
653
654 /* STR (register) 1111 1000 0100 xxxx xxxx 0000 00xx xxxx */
655 /* LDR (register) 1111 1000 0101 xxxx xxxx 0000 00xx xxxx */
656 DECODE_EMULATEX (0xffe00fc0, 0xf8400000, t32_emulate_ldrstr,
657 REGS(NOPCX, ANY, 0, 0, NOSPPC)),
658
659 /* LDRB (literal) 1111 1000 x001 1111 xxxx xxxx xxxx xxxx */
660 /* LDRSB (literal) 1111 1001 x001 1111 xxxx xxxx xxxx xxxx */
661 /* LDRH (literal) 1111 1000 x011 1111 xxxx xxxx xxxx xxxx */
662 /* LDRSH (literal) 1111 1001 x011 1111 xxxx xxxx xxxx xxxx */
663 DECODE_SIMULATEX(0xfe5f0000, 0xf81f0000, t32_simulate_ldr_literal,
664 REGS(PC, NOSPPCX, 0, 0, 0)),
665
666 /* STRB (immediate) 1111 1000 0000 xxxx xxxx 1xxx xxxx xxxx */
667 /* STRH (immediate) 1111 1000 0010 xxxx xxxx 1xxx xxxx xxxx */
668 /* LDRB (immediate) 1111 1000 0001 xxxx xxxx 1xxx xxxx xxxx */
669 /* LDRSB (immediate) 1111 1001 0001 xxxx xxxx 1xxx xxxx xxxx */
670 /* LDRH (immediate) 1111 1000 0011 xxxx xxxx 1xxx xxxx xxxx */
671 /* LDRSH (immediate) 1111 1001 0011 xxxx xxxx 1xxx xxxx xxxx */
672 DECODE_OR (0xfec00800, 0xf8000800),
673 /* STRB (immediate) 1111 1000 1000 xxxx xxxx xxxx xxxx xxxx */
674 /* STRH (immediate) 1111 1000 1010 xxxx xxxx xxxx xxxx xxxx */
675 /* LDRB (immediate) 1111 1000 1001 xxxx xxxx xxxx xxxx xxxx */
676 /* LDRSB (immediate) 1111 1001 1001 xxxx xxxx xxxx xxxx xxxx */
677 /* LDRH (immediate) 1111 1000 1011 xxxx xxxx xxxx xxxx xxxx */
678 /* LDRSH (immediate) 1111 1001 1011 xxxx xxxx xxxx xxxx xxxx */
679 DECODE_EMULATEX (0xfec00000, 0xf8800000, t32_emulate_ldrstr,
680 REGS(NOPCX, NOSPPCX, 0, 0, 0)),
681
682 /* STRB (register) 1111 1000 0000 xxxx xxxx 0000 00xx xxxx */
683 /* STRH (register) 1111 1000 0010 xxxx xxxx 0000 00xx xxxx */
684 /* LDRB (register) 1111 1000 0001 xxxx xxxx 0000 00xx xxxx */
685 /* LDRSB (register) 1111 1001 0001 xxxx xxxx 0000 00xx xxxx */
686 /* LDRH (register) 1111 1000 0011 xxxx xxxx 0000 00xx xxxx */
687 /* LDRSH (register) 1111 1001 0011 xxxx xxxx 0000 00xx xxxx */
688 DECODE_EMULATEX (0xfe800fc0, 0xf8000000, t32_emulate_ldrstr,
689 REGS(NOPCX, NOSPPCX, 0, 0, NOSPPC)),
690
691 /* Other unallocated instructions... */
692 DECODE_END
693};
694
695static const union decode_item t32_table_1111_1010___1111[] = {
696 /* Data-processing (register) */
697
698 /* ??? 1111 1010 011x xxxx 1111 xxxx 1xxx xxxx */
699 DECODE_REJECT (0xffe0f080, 0xfa60f080),
700
701 /* SXTH 1111 1010 0000 1111 1111 xxxx 1xxx xxxx */
702 /* UXTH 1111 1010 0001 1111 1111 xxxx 1xxx xxxx */
703 /* SXTB16 1111 1010 0010 1111 1111 xxxx 1xxx xxxx */
704 /* UXTB16 1111 1010 0011 1111 1111 xxxx 1xxx xxxx */
705 /* SXTB 1111 1010 0100 1111 1111 xxxx 1xxx xxxx */
706 /* UXTB 1111 1010 0101 1111 1111 xxxx 1xxx xxxx */
707 DECODE_EMULATEX (0xff8ff080, 0xfa0ff080, t32_emulate_rd8rn16rm0_rwflags,
708 REGS(0, 0, NOSPPC, 0, NOSPPC)),
709
710
711 /* ??? 1111 1010 1xxx xxxx 1111 xxxx 0x11 xxxx */
712 DECODE_REJECT (0xff80f0b0, 0xfa80f030),
713 /* ??? 1111 1010 1x11 xxxx 1111 xxxx 0xxx xxxx */
714 DECODE_REJECT (0xffb0f080, 0xfab0f000),
715
716 /* SADD16 1111 1010 1001 xxxx 1111 xxxx 0000 xxxx */
717 /* SASX 1111 1010 1010 xxxx 1111 xxxx 0000 xxxx */
718 /* SSAX 1111 1010 1110 xxxx 1111 xxxx 0000 xxxx */
719 /* SSUB16 1111 1010 1101 xxxx 1111 xxxx 0000 xxxx */
720 /* SADD8 1111 1010 1000 xxxx 1111 xxxx 0000 xxxx */
721 /* SSUB8 1111 1010 1100 xxxx 1111 xxxx 0000 xxxx */
722
723 /* QADD16 1111 1010 1001 xxxx 1111 xxxx 0001 xxxx */
724 /* QASX 1111 1010 1010 xxxx 1111 xxxx 0001 xxxx */
725 /* QSAX 1111 1010 1110 xxxx 1111 xxxx 0001 xxxx */
726 /* QSUB16 1111 1010 1101 xxxx 1111 xxxx 0001 xxxx */
727 /* QADD8 1111 1010 1000 xxxx 1111 xxxx 0001 xxxx */
728 /* QSUB8 1111 1010 1100 xxxx 1111 xxxx 0001 xxxx */
729
730 /* SHADD16 1111 1010 1001 xxxx 1111 xxxx 0010 xxxx */
731 /* SHASX 1111 1010 1010 xxxx 1111 xxxx 0010 xxxx */
732 /* SHSAX 1111 1010 1110 xxxx 1111 xxxx 0010 xxxx */
733 /* SHSUB16 1111 1010 1101 xxxx 1111 xxxx 0010 xxxx */
734 /* SHADD8 1111 1010 1000 xxxx 1111 xxxx 0010 xxxx */
735 /* SHSUB8 1111 1010 1100 xxxx 1111 xxxx 0010 xxxx */
736
737 /* UADD16 1111 1010 1001 xxxx 1111 xxxx 0100 xxxx */
738 /* UASX 1111 1010 1010 xxxx 1111 xxxx 0100 xxxx */
739 /* USAX 1111 1010 1110 xxxx 1111 xxxx 0100 xxxx */
740 /* USUB16 1111 1010 1101 xxxx 1111 xxxx 0100 xxxx */
741 /* UADD8 1111 1010 1000 xxxx 1111 xxxx 0100 xxxx */
742 /* USUB8 1111 1010 1100 xxxx 1111 xxxx 0100 xxxx */
743
744 /* UQADD16 1111 1010 1001 xxxx 1111 xxxx 0101 xxxx */
745 /* UQASX 1111 1010 1010 xxxx 1111 xxxx 0101 xxxx */
746 /* UQSAX 1111 1010 1110 xxxx 1111 xxxx 0101 xxxx */
747 /* UQSUB16 1111 1010 1101 xxxx 1111 xxxx 0101 xxxx */
748 /* UQADD8 1111 1010 1000 xxxx 1111 xxxx 0101 xxxx */
749 /* UQSUB8 1111 1010 1100 xxxx 1111 xxxx 0101 xxxx */
750
751 /* UHADD16 1111 1010 1001 xxxx 1111 xxxx 0110 xxxx */
752 /* UHASX 1111 1010 1010 xxxx 1111 xxxx 0110 xxxx */
753 /* UHSAX 1111 1010 1110 xxxx 1111 xxxx 0110 xxxx */
754 /* UHSUB16 1111 1010 1101 xxxx 1111 xxxx 0110 xxxx */
755 /* UHADD8 1111 1010 1000 xxxx 1111 xxxx 0110 xxxx */
756 /* UHSUB8 1111 1010 1100 xxxx 1111 xxxx 0110 xxxx */
757 DECODE_OR (0xff80f080, 0xfa80f000),
758
759 /* SXTAH 1111 1010 0000 xxxx 1111 xxxx 1xxx xxxx */
760 /* UXTAH 1111 1010 0001 xxxx 1111 xxxx 1xxx xxxx */
761 /* SXTAB16 1111 1010 0010 xxxx 1111 xxxx 1xxx xxxx */
762 /* UXTAB16 1111 1010 0011 xxxx 1111 xxxx 1xxx xxxx */
763 /* SXTAB 1111 1010 0100 xxxx 1111 xxxx 1xxx xxxx */
764 /* UXTAB 1111 1010 0101 xxxx 1111 xxxx 1xxx xxxx */
765 DECODE_OR (0xff80f080, 0xfa00f080),
766
767 /* QADD 1111 1010 1000 xxxx 1111 xxxx 1000 xxxx */
768 /* QDADD 1111 1010 1000 xxxx 1111 xxxx 1001 xxxx */
769 /* QSUB 1111 1010 1000 xxxx 1111 xxxx 1010 xxxx */
770 /* QDSUB 1111 1010 1000 xxxx 1111 xxxx 1011 xxxx */
771 DECODE_OR (0xfff0f0c0, 0xfa80f080),
772
773 /* SEL 1111 1010 1010 xxxx 1111 xxxx 1000 xxxx */
774 DECODE_OR (0xfff0f0f0, 0xfaa0f080),
775
776 /* LSL 1111 1010 000x xxxx 1111 xxxx 0000 xxxx */
777 /* LSR 1111 1010 001x xxxx 1111 xxxx 0000 xxxx */
778 /* ASR 1111 1010 010x xxxx 1111 xxxx 0000 xxxx */
779 /* ROR 1111 1010 011x xxxx 1111 xxxx 0000 xxxx */
780 DECODE_EMULATEX (0xff80f0f0, 0xfa00f000, t32_emulate_rd8rn16rm0_rwflags,
781 REGS(NOSPPC, 0, NOSPPC, 0, NOSPPC)),
782
783 /* CLZ 1111 1010 1010 xxxx 1111 xxxx 1000 xxxx */
784 DECODE_OR (0xfff0f0f0, 0xfab0f080),
785
786 /* REV 1111 1010 1001 xxxx 1111 xxxx 1000 xxxx */
787 /* REV16 1111 1010 1001 xxxx 1111 xxxx 1001 xxxx */
788 /* RBIT 1111 1010 1001 xxxx 1111 xxxx 1010 xxxx */
789 /* REVSH 1111 1010 1001 xxxx 1111 xxxx 1011 xxxx */
790 DECODE_EMULATEX (0xfff0f0c0, 0xfa90f080, t32_emulate_rd8rn16_noflags,
791 REGS(NOSPPC, 0, NOSPPC, 0, SAMEAS16)),
792
793 /* Other unallocated instructions... */
794 DECODE_END
795};
796
797static const union decode_item t32_table_1111_1011_0[] = {
798 /* Multiply, multiply accumulate, and absolute difference */
799
800 /* ??? 1111 1011 0000 xxxx 1111 xxxx 0001 xxxx */
801 DECODE_REJECT (0xfff0f0f0, 0xfb00f010),
802 /* ??? 1111 1011 0111 xxxx 1111 xxxx 0001 xxxx */
803 DECODE_REJECT (0xfff0f0f0, 0xfb70f010),
804
805 /* SMULxy 1111 1011 0001 xxxx 1111 xxxx 00xx xxxx */
806 DECODE_OR (0xfff0f0c0, 0xfb10f000),
807 /* MUL 1111 1011 0000 xxxx 1111 xxxx 0000 xxxx */
808 /* SMUAD{X} 1111 1011 0010 xxxx 1111 xxxx 000x xxxx */
809 /* SMULWy 1111 1011 0011 xxxx 1111 xxxx 000x xxxx */
810 /* SMUSD{X} 1111 1011 0100 xxxx 1111 xxxx 000x xxxx */
811 /* SMMUL{R} 1111 1011 0101 xxxx 1111 xxxx 000x xxxx */
812 /* USAD8 1111 1011 0111 xxxx 1111 xxxx 0000 xxxx */
813 DECODE_EMULATEX (0xff80f0e0, 0xfb00f000, t32_emulate_rd8rn16rm0_rwflags,
814 REGS(NOSPPC, 0, NOSPPC, 0, NOSPPC)),
815
816 /* ??? 1111 1011 0111 xxxx xxxx xxxx 0001 xxxx */
817 DECODE_REJECT (0xfff000f0, 0xfb700010),
818
819 /* SMLAxy 1111 1011 0001 xxxx xxxx xxxx 00xx xxxx */
820 DECODE_OR (0xfff000c0, 0xfb100000),
821 /* MLA 1111 1011 0000 xxxx xxxx xxxx 0000 xxxx */
822 /* MLS 1111 1011 0000 xxxx xxxx xxxx 0001 xxxx */
823 /* SMLAD{X} 1111 1011 0010 xxxx xxxx xxxx 000x xxxx */
824 /* SMLAWy 1111 1011 0011 xxxx xxxx xxxx 000x xxxx */
825 /* SMLSD{X} 1111 1011 0100 xxxx xxxx xxxx 000x xxxx */
826 /* SMMLA{R} 1111 1011 0101 xxxx xxxx xxxx 000x xxxx */
827 /* SMMLS{R} 1111 1011 0110 xxxx xxxx xxxx 000x xxxx */
828 /* USADA8 1111 1011 0111 xxxx xxxx xxxx 0000 xxxx */
829 DECODE_EMULATEX (0xff8000c0, 0xfb000000, t32_emulate_rd8rn16rm0ra12_noflags,
830 REGS(NOSPPC, NOSPPCX, NOSPPC, 0, NOSPPC)),
831
832 /* Other unallocated instructions... */
833 DECODE_END
834};
835
836static const union decode_item t32_table_1111_1011_1[] = {
837 /* Long multiply, long multiply accumulate, and divide */
838
839 /* UMAAL 1111 1011 1110 xxxx xxxx xxxx 0110 xxxx */
840 DECODE_OR (0xfff000f0, 0xfbe00060),
841 /* SMLALxy 1111 1011 1100 xxxx xxxx xxxx 10xx xxxx */
842 DECODE_OR (0xfff000c0, 0xfbc00080),
843 /* SMLALD{X} 1111 1011 1100 xxxx xxxx xxxx 110x xxxx */
844 /* SMLSLD{X} 1111 1011 1101 xxxx xxxx xxxx 110x xxxx */
845 DECODE_OR (0xffe000e0, 0xfbc000c0),
846 /* SMULL 1111 1011 1000 xxxx xxxx xxxx 0000 xxxx */
847 /* UMULL 1111 1011 1010 xxxx xxxx xxxx 0000 xxxx */
848 /* SMLAL 1111 1011 1100 xxxx xxxx xxxx 0000 xxxx */
849 /* UMLAL 1111 1011 1110 xxxx xxxx xxxx 0000 xxxx */
850 DECODE_EMULATEX (0xff9000f0, 0xfb800000, t32_emulate_rdlo12rdhi8rn16rm0_noflags,
851 REGS(NOSPPC, NOSPPC, NOSPPC, 0, NOSPPC)),
852
853 /* SDIV 1111 1011 1001 xxxx xxxx xxxx 1111 xxxx */
854 /* UDIV 1111 1011 1011 xxxx xxxx xxxx 1111 xxxx */
855 /* Other unallocated instructions... */
856 DECODE_END
857};
858
859const union decode_item kprobe_decode_thumb32_table[] = {
860
861 /*
862 * Load/store multiple instructions
863 * 1110 100x x0xx xxxx xxxx xxxx xxxx xxxx
864 */
865 DECODE_TABLE (0xfe400000, 0xe8000000, t32_table_1110_100x_x0xx),
866
867 /*
868 * Load/store dual, load/store exclusive, table branch
869 * 1110 100x x1xx xxxx xxxx xxxx xxxx xxxx
870 */
871 DECODE_TABLE (0xfe400000, 0xe8400000, t32_table_1110_100x_x1xx),
872
873 /*
874 * Data-processing (shifted register)
875 * 1110 101x xxxx xxxx xxxx xxxx xxxx xxxx
876 */
877 DECODE_TABLE (0xfe000000, 0xea000000, t32_table_1110_101x),
878
879 /*
880 * Coprocessor instructions
881 * 1110 11xx xxxx xxxx xxxx xxxx xxxx xxxx
882 */
883 DECODE_REJECT (0xfc000000, 0xec000000),
884
885 /*
886 * Data-processing (modified immediate)
887 * 1111 0x0x xxxx xxxx 0xxx xxxx xxxx xxxx
888 */
889 DECODE_TABLE (0xfa008000, 0xf0000000, t32_table_1111_0x0x___0),
890
891 /*
892 * Data-processing (plain binary immediate)
893 * 1111 0x1x xxxx xxxx 0xxx xxxx xxxx xxxx
894 */
895 DECODE_TABLE (0xfa008000, 0xf2000000, t32_table_1111_0x1x___0),
896
897 /*
898 * Branches and miscellaneous control
899 * 1111 0xxx xxxx xxxx 1xxx xxxx xxxx xxxx
900 */
901 DECODE_TABLE (0xf8008000, 0xf0008000, t32_table_1111_0xxx___1),
902
903 /*
904 * Advanced SIMD element or structure load/store instructions
905 * 1111 1001 xxx0 xxxx xxxx xxxx xxxx xxxx
906 */
907 DECODE_REJECT (0xff100000, 0xf9000000),
908
909 /*
910 * Memory hints
911 * 1111 100x x0x1 xxxx 1111 xxxx xxxx xxxx
912 */
913 DECODE_TABLE (0xfe50f000, 0xf810f000, t32_table_1111_100x_x0x1__1111),
914
915 /*
916 * Store single data item
917 * 1111 1000 xxx0 xxxx xxxx xxxx xxxx xxxx
918 * Load single data items
919 * 1111 100x xxx1 xxxx xxxx xxxx xxxx xxxx
920 */
921 DECODE_TABLE (0xfe000000, 0xf8000000, t32_table_1111_100x),
922
923 /*
924 * Data-processing (register)
925 * 1111 1010 xxxx xxxx 1111 xxxx xxxx xxxx
926 */
927 DECODE_TABLE (0xff00f000, 0xfa00f000, t32_table_1111_1010___1111),
928
929 /*
930 * Multiply, multiply accumulate, and absolute difference
931 * 1111 1011 0xxx xxxx xxxx xxxx xxxx xxxx
932 */
933 DECODE_TABLE (0xff800000, 0xfb000000, t32_table_1111_1011_0),
934
935 /*
936 * Long multiply, long multiply accumulate, and divide
937 * 1111 1011 1xxx xxxx xxxx xxxx xxxx xxxx
938 */
939 DECODE_TABLE (0xff800000, 0xfb800000, t32_table_1111_1011_1),
940
941 /*
942 * Coprocessor instructions
943 * 1111 11xx xxxx xxxx xxxx xxxx xxxx xxxx
944 */
945 DECODE_END
946};
947#ifdef CONFIG_ARM_KPROBES_TEST_MODULE
948EXPORT_SYMBOL_GPL(kprobe_decode_thumb32_table);
949#endif
950 306
951static void __kprobes 307static void __kprobes
952t16_simulate_bxblx(struct kprobe *p, struct pt_regs *regs) 308t16_simulate_bxblx(probes_opcode_t insn,
309 struct arch_probes_insn *asi, struct pt_regs *regs)
953{ 310{
954 kprobe_opcode_t insn = p->opcode; 311 unsigned long pc = regs->ARM_pc + 2;
955 unsigned long pc = thumb_probe_pc(p);
956 int rm = (insn >> 3) & 0xf; 312 int rm = (insn >> 3) & 0xf;
957 unsigned long rmv = (rm == 15) ? pc : regs->uregs[rm]; 313 unsigned long rmv = (rm == 15) ? pc : regs->uregs[rm];
958 314
959 if (insn & (1 << 7)) /* BLX ? */ 315 if (insn & (1 << 7)) /* BLX ? */
960 regs->ARM_lr = (unsigned long)p->addr + 2; 316 regs->ARM_lr = regs->ARM_pc | 1;
961 317
962 bx_write_pc(rmv, regs); 318 bx_write_pc(rmv, regs);
963} 319}
964 320
965static void __kprobes 321static void __kprobes
966t16_simulate_ldr_literal(struct kprobe *p, struct pt_regs *regs) 322t16_simulate_ldr_literal(probes_opcode_t insn,
323 struct arch_probes_insn *asi, struct pt_regs *regs)
967{ 324{
968 kprobe_opcode_t insn = p->opcode; 325 unsigned long *base = (unsigned long *)((regs->ARM_pc + 2) & ~3);
969 unsigned long* base = (unsigned long *)(thumb_probe_pc(p) & ~3);
970 long index = insn & 0xff; 326 long index = insn & 0xff;
971 int rt = (insn >> 8) & 0x7; 327 int rt = (insn >> 8) & 0x7;
972 regs->uregs[rt] = base[index]; 328 regs->uregs[rt] = base[index];
973} 329}
974 330
975static void __kprobes 331static void __kprobes
976t16_simulate_ldrstr_sp_relative(struct kprobe *p, struct pt_regs *regs) 332t16_simulate_ldrstr_sp_relative(probes_opcode_t insn,
333 struct arch_probes_insn *asi, struct pt_regs *regs)
977{ 334{
978 kprobe_opcode_t insn = p->opcode;
979 unsigned long* base = (unsigned long *)regs->ARM_sp; 335 unsigned long* base = (unsigned long *)regs->ARM_sp;
980 long index = insn & 0xff; 336 long index = insn & 0xff;
981 int rt = (insn >> 8) & 0x7; 337 int rt = (insn >> 8) & 0x7;
@@ -986,20 +342,20 @@ t16_simulate_ldrstr_sp_relative(struct kprobe *p, struct pt_regs *regs)
986} 342}
987 343
988static void __kprobes 344static void __kprobes
989t16_simulate_reladr(struct kprobe *p, struct pt_regs *regs) 345t16_simulate_reladr(probes_opcode_t insn,
346 struct arch_probes_insn *asi, struct pt_regs *regs)
990{ 347{
991 kprobe_opcode_t insn = p->opcode;
992 unsigned long base = (insn & 0x800) ? regs->ARM_sp 348 unsigned long base = (insn & 0x800) ? regs->ARM_sp
993 : (thumb_probe_pc(p) & ~3); 349 : ((regs->ARM_pc + 2) & ~3);
994 long offset = insn & 0xff; 350 long offset = insn & 0xff;
995 int rt = (insn >> 8) & 0x7; 351 int rt = (insn >> 8) & 0x7;
996 regs->uregs[rt] = base + offset * 4; 352 regs->uregs[rt] = base + offset * 4;
997} 353}
998 354
999static void __kprobes 355static void __kprobes
1000t16_simulate_add_sp_imm(struct kprobe *p, struct pt_regs *regs) 356t16_simulate_add_sp_imm(probes_opcode_t insn,
357 struct arch_probes_insn *asi, struct pt_regs *regs)
1001{ 358{
1002 kprobe_opcode_t insn = p->opcode;
1003 long imm = insn & 0x7f; 359 long imm = insn & 0x7f;
1004 if (insn & 0x80) /* SUB */ 360 if (insn & 0x80) /* SUB */
1005 regs->ARM_sp -= imm * 4; 361 regs->ARM_sp -= imm * 4;
@@ -1008,21 +364,22 @@ t16_simulate_add_sp_imm(struct kprobe *p, struct pt_regs *regs)
1008} 364}
1009 365
1010static void __kprobes 366static void __kprobes
1011t16_simulate_cbz(struct kprobe *p, struct pt_regs *regs) 367t16_simulate_cbz(probes_opcode_t insn,
368 struct arch_probes_insn *asi, struct pt_regs *regs)
1012{ 369{
1013 kprobe_opcode_t insn = p->opcode;
1014 int rn = insn & 0x7; 370 int rn = insn & 0x7;
1015 kprobe_opcode_t nonzero = regs->uregs[rn] ? insn : ~insn; 371 probes_opcode_t nonzero = regs->uregs[rn] ? insn : ~insn;
1016 if (nonzero & 0x800) { 372 if (nonzero & 0x800) {
1017 long i = insn & 0x200; 373 long i = insn & 0x200;
1018 long imm5 = insn & 0xf8; 374 long imm5 = insn & 0xf8;
1019 unsigned long pc = thumb_probe_pc(p); 375 unsigned long pc = regs->ARM_pc + 2;
1020 regs->ARM_pc = pc + (i >> 3) + (imm5 >> 2); 376 regs->ARM_pc = pc + (i >> 3) + (imm5 >> 2);
1021 } 377 }
1022} 378}
1023 379
1024static void __kprobes 380static void __kprobes
1025t16_simulate_it(struct kprobe *p, struct pt_regs *regs) 381t16_simulate_it(probes_opcode_t insn,
382 struct arch_probes_insn *asi, struct pt_regs *regs)
1026{ 383{
1027 /* 384 /*
1028 * The 8 IT state bits are split into two parts in CPSR: 385 * The 8 IT state bits are split into two parts in CPSR:
@@ -1030,7 +387,6 @@ t16_simulate_it(struct kprobe *p, struct pt_regs *regs)
1030 * ITSTATE<7:2> are in CPSR<15:10> 387 * ITSTATE<7:2> are in CPSR<15:10>
1031 * The new IT state is in the lower byte of insn. 388 * The new IT state is in the lower byte of insn.
1032 */ 389 */
1033 kprobe_opcode_t insn = p->opcode;
1034 unsigned long cpsr = regs->ARM_cpsr; 390 unsigned long cpsr = regs->ARM_cpsr;
1035 cpsr &= ~PSR_IT_MASK; 391 cpsr &= ~PSR_IT_MASK;
1036 cpsr |= (insn & 0xfc) << 8; 392 cpsr |= (insn & 0xfc) << 8;
@@ -1039,50 +395,54 @@ t16_simulate_it(struct kprobe *p, struct pt_regs *regs)
1039} 395}
1040 396
1041static void __kprobes 397static void __kprobes
1042t16_singlestep_it(struct kprobe *p, struct pt_regs *regs) 398t16_singlestep_it(probes_opcode_t insn,
399 struct arch_probes_insn *asi, struct pt_regs *regs)
1043{ 400{
1044 regs->ARM_pc += 2; 401 regs->ARM_pc += 2;
1045 t16_simulate_it(p, regs); 402 t16_simulate_it(insn, asi, regs);
1046} 403}
1047 404
1048static enum kprobe_insn __kprobes 405static enum probes_insn __kprobes
1049t16_decode_it(kprobe_opcode_t insn, struct arch_specific_insn *asi) 406t16_decode_it(probes_opcode_t insn, struct arch_probes_insn *asi,
407 const struct decode_header *d)
1050{ 408{
1051 asi->insn_singlestep = t16_singlestep_it; 409 asi->insn_singlestep = t16_singlestep_it;
1052 return INSN_GOOD_NO_SLOT; 410 return INSN_GOOD_NO_SLOT;
1053} 411}
1054 412
1055static void __kprobes 413static void __kprobes
1056t16_simulate_cond_branch(struct kprobe *p, struct pt_regs *regs) 414t16_simulate_cond_branch(probes_opcode_t insn,
415 struct arch_probes_insn *asi, struct pt_regs *regs)
1057{ 416{
1058 kprobe_opcode_t insn = p->opcode; 417 unsigned long pc = regs->ARM_pc + 2;
1059 unsigned long pc = thumb_probe_pc(p);
1060 long offset = insn & 0x7f; 418 long offset = insn & 0x7f;
1061 offset -= insn & 0x80; /* Apply sign bit */ 419 offset -= insn & 0x80; /* Apply sign bit */
1062 regs->ARM_pc = pc + (offset * 2); 420 regs->ARM_pc = pc + (offset * 2);
1063} 421}
1064 422
1065static enum kprobe_insn __kprobes 423static enum probes_insn __kprobes
1066t16_decode_cond_branch(kprobe_opcode_t insn, struct arch_specific_insn *asi) 424t16_decode_cond_branch(probes_opcode_t insn, struct arch_probes_insn *asi,
425 const struct decode_header *d)
1067{ 426{
1068 int cc = (insn >> 8) & 0xf; 427 int cc = (insn >> 8) & 0xf;
1069 asi->insn_check_cc = kprobe_condition_checks[cc]; 428 asi->insn_check_cc = probes_condition_checks[cc];
1070 asi->insn_handler = t16_simulate_cond_branch; 429 asi->insn_handler = t16_simulate_cond_branch;
1071 return INSN_GOOD_NO_SLOT; 430 return INSN_GOOD_NO_SLOT;
1072} 431}
1073 432
1074static void __kprobes 433static void __kprobes
1075t16_simulate_branch(struct kprobe *p, struct pt_regs *regs) 434t16_simulate_branch(probes_opcode_t insn,
435 struct arch_probes_insn *asi, struct pt_regs *regs)
1076{ 436{
1077 kprobe_opcode_t insn = p->opcode; 437 unsigned long pc = regs->ARM_pc + 2;
1078 unsigned long pc = thumb_probe_pc(p);
1079 long offset = insn & 0x3ff; 438 long offset = insn & 0x3ff;
1080 offset -= insn & 0x400; /* Apply sign bit */ 439 offset -= insn & 0x400; /* Apply sign bit */
1081 regs->ARM_pc = pc + (offset * 2); 440 regs->ARM_pc = pc + (offset * 2);
1082} 441}
1083 442
1084static unsigned long __kprobes 443static unsigned long __kprobes
1085t16_emulate_loregs(struct kprobe *p, struct pt_regs *regs) 444t16_emulate_loregs(probes_opcode_t insn,
445 struct arch_probes_insn *asi, struct pt_regs *regs)
1086{ 446{
1087 unsigned long oldcpsr = regs->ARM_cpsr; 447 unsigned long oldcpsr = regs->ARM_cpsr;
1088 unsigned long newcpsr; 448 unsigned long newcpsr;
@@ -1095,7 +455,7 @@ t16_emulate_loregs(struct kprobe *p, struct pt_regs *regs)
1095 "mrs %[newcpsr], cpsr \n\t" 455 "mrs %[newcpsr], cpsr \n\t"
1096 : [newcpsr] "=r" (newcpsr) 456 : [newcpsr] "=r" (newcpsr)
1097 : [oldcpsr] "r" (oldcpsr), [regs] "r" (regs), 457 : [oldcpsr] "r" (oldcpsr), [regs] "r" (regs),
1098 [fn] "r" (p->ainsn.insn_fn) 458 [fn] "r" (asi->insn_fn)
1099 : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", 459 : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
1100 "lr", "memory", "cc" 460 "lr", "memory", "cc"
1101 ); 461 );
@@ -1104,24 +464,26 @@ t16_emulate_loregs(struct kprobe *p, struct pt_regs *regs)
1104} 464}
1105 465
1106static void __kprobes 466static void __kprobes
1107t16_emulate_loregs_rwflags(struct kprobe *p, struct pt_regs *regs) 467t16_emulate_loregs_rwflags(probes_opcode_t insn,
468 struct arch_probes_insn *asi, struct pt_regs *regs)
1108{ 469{
1109 regs->ARM_cpsr = t16_emulate_loregs(p, regs); 470 regs->ARM_cpsr = t16_emulate_loregs(insn, asi, regs);
1110} 471}
1111 472
1112static void __kprobes 473static void __kprobes
1113t16_emulate_loregs_noitrwflags(struct kprobe *p, struct pt_regs *regs) 474t16_emulate_loregs_noitrwflags(probes_opcode_t insn,
475 struct arch_probes_insn *asi, struct pt_regs *regs)
1114{ 476{
1115 unsigned long cpsr = t16_emulate_loregs(p, regs); 477 unsigned long cpsr = t16_emulate_loregs(insn, asi, regs);
1116 if (!in_it_block(cpsr)) 478 if (!in_it_block(cpsr))
1117 regs->ARM_cpsr = cpsr; 479 regs->ARM_cpsr = cpsr;
1118} 480}
1119 481
1120static void __kprobes 482static void __kprobes
1121t16_emulate_hiregs(struct kprobe *p, struct pt_regs *regs) 483t16_emulate_hiregs(probes_opcode_t insn,
484 struct arch_probes_insn *asi, struct pt_regs *regs)
1122{ 485{
1123 kprobe_opcode_t insn = p->opcode; 486 unsigned long pc = regs->ARM_pc + 2;
1124 unsigned long pc = thumb_probe_pc(p);
1125 int rdn = (insn & 0x7) | ((insn & 0x80) >> 4); 487 int rdn = (insn & 0x7) | ((insn & 0x80) >> 4);
1126 int rm = (insn >> 3) & 0xf; 488 int rm = (insn >> 3) & 0xf;
1127 489
@@ -1137,7 +499,7 @@ t16_emulate_hiregs(struct kprobe *p, struct pt_regs *regs)
1137 "blx %[fn] \n\t" 499 "blx %[fn] \n\t"
1138 "mrs %[cpsr], cpsr \n\t" 500 "mrs %[cpsr], cpsr \n\t"
1139 : "=r" (rdnv), [cpsr] "=r" (cpsr) 501 : "=r" (rdnv), [cpsr] "=r" (cpsr)
1140 : "0" (rdnv), "r" (rmv), "1" (cpsr), [fn] "r" (p->ainsn.insn_fn) 502 : "0" (rdnv), "r" (rmv), "1" (cpsr), [fn] "r" (asi->insn_fn)
1141 : "lr", "memory", "cc" 503 : "lr", "memory", "cc"
1142 ); 504 );
1143 505
@@ -1148,18 +510,20 @@ t16_emulate_hiregs(struct kprobe *p, struct pt_regs *regs)
1148 regs->ARM_cpsr = (regs->ARM_cpsr & ~APSR_MASK) | (cpsr & APSR_MASK); 510 regs->ARM_cpsr = (regs->ARM_cpsr & ~APSR_MASK) | (cpsr & APSR_MASK);
1149} 511}
1150 512
1151static enum kprobe_insn __kprobes 513static enum probes_insn __kprobes
1152t16_decode_hiregs(kprobe_opcode_t insn, struct arch_specific_insn *asi) 514t16_decode_hiregs(probes_opcode_t insn, struct arch_probes_insn *asi,
515 const struct decode_header *d)
1153{ 516{
1154 insn &= ~0x00ff; 517 insn &= ~0x00ff;
1155 insn |= 0x001; /* Set Rdn = R1 and Rm = R0 */ 518 insn |= 0x001; /* Set Rdn = R1 and Rm = R0 */
1156 ((u16 *)asi->insn)[0] = insn; 519 ((u16 *)asi->insn)[0] = __opcode_to_mem_thumb16(insn);
1157 asi->insn_handler = t16_emulate_hiregs; 520 asi->insn_handler = t16_emulate_hiregs;
1158 return INSN_GOOD; 521 return INSN_GOOD;
1159} 522}
1160 523
1161static void __kprobes 524static void __kprobes
1162t16_emulate_push(struct kprobe *p, struct pt_regs *regs) 525t16_emulate_push(probes_opcode_t insn,
526 struct arch_probes_insn *asi, struct pt_regs *regs)
1163{ 527{
1164 __asm__ __volatile__ ( 528 __asm__ __volatile__ (
1165 "ldr r9, [%[regs], #13*4] \n\t" 529 "ldr r9, [%[regs], #13*4] \n\t"
@@ -1168,28 +532,32 @@ t16_emulate_push(struct kprobe *p, struct pt_regs *regs)
1168 "blx %[fn] \n\t" 532 "blx %[fn] \n\t"
1169 "str r9, [%[regs], #13*4] \n\t" 533 "str r9, [%[regs], #13*4] \n\t"
1170 : 534 :
1171 : [regs] "r" (regs), [fn] "r" (p->ainsn.insn_fn) 535 : [regs] "r" (regs), [fn] "r" (asi->insn_fn)
1172 : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", 536 : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9",
1173 "lr", "memory", "cc" 537 "lr", "memory", "cc"
1174 ); 538 );
1175} 539}
1176 540
1177static enum kprobe_insn __kprobes 541static enum probes_insn __kprobes
1178t16_decode_push(kprobe_opcode_t insn, struct arch_specific_insn *asi) 542t16_decode_push(probes_opcode_t insn, struct arch_probes_insn *asi,
543 const struct decode_header *d)
1179{ 544{
1180 /* 545 /*
1181 * To simulate a PUSH we use a Thumb-2 "STMDB R9!, {registers}" 546 * To simulate a PUSH we use a Thumb-2 "STMDB R9!, {registers}"
1182 * and call it with R9=SP and LR in the register list represented 547 * and call it with R9=SP and LR in the register list represented
1183 * by R8. 548 * by R8.
1184 */ 549 */
1185 ((u16 *)asi->insn)[0] = 0xe929; /* 1st half STMDB R9!,{} */ 550 /* 1st half STMDB R9!,{} */
1186 ((u16 *)asi->insn)[1] = insn & 0x1ff; /* 2nd half (register list) */ 551 ((u16 *)asi->insn)[0] = __opcode_to_mem_thumb16(0xe929);
552 /* 2nd half (register list) */
553 ((u16 *)asi->insn)[1] = __opcode_to_mem_thumb16(insn & 0x1ff);
1187 asi->insn_handler = t16_emulate_push; 554 asi->insn_handler = t16_emulate_push;
1188 return INSN_GOOD; 555 return INSN_GOOD;
1189} 556}
1190 557
1191static void __kprobes 558static void __kprobes
1192t16_emulate_pop_nopc(struct kprobe *p, struct pt_regs *regs) 559t16_emulate_pop_nopc(probes_opcode_t insn,
560 struct arch_probes_insn *asi, struct pt_regs *regs)
1193{ 561{
1194 __asm__ __volatile__ ( 562 __asm__ __volatile__ (
1195 "ldr r9, [%[regs], #13*4] \n\t" 563 "ldr r9, [%[regs], #13*4] \n\t"
@@ -1198,14 +566,15 @@ t16_emulate_pop_nopc(struct kprobe *p, struct pt_regs *regs)
1198 "stmia %[regs], {r0-r7} \n\t" 566 "stmia %[regs], {r0-r7} \n\t"
1199 "str r9, [%[regs], #13*4] \n\t" 567 "str r9, [%[regs], #13*4] \n\t"
1200 : 568 :
1201 : [regs] "r" (regs), [fn] "r" (p->ainsn.insn_fn) 569 : [regs] "r" (regs), [fn] "r" (asi->insn_fn)
1202 : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r9", 570 : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r9",
1203 "lr", "memory", "cc" 571 "lr", "memory", "cc"
1204 ); 572 );
1205} 573}
1206 574
1207static void __kprobes 575static void __kprobes
1208t16_emulate_pop_pc(struct kprobe *p, struct pt_regs *regs) 576t16_emulate_pop_pc(probes_opcode_t insn,
577 struct arch_probes_insn *asi, struct pt_regs *regs)
1209{ 578{
1210 register unsigned long pc asm("r8"); 579 register unsigned long pc asm("r8");
1211 580
@@ -1216,7 +585,7 @@ t16_emulate_pop_pc(struct kprobe *p, struct pt_regs *regs)
1216 "stmia %[regs], {r0-r7} \n\t" 585 "stmia %[regs], {r0-r7} \n\t"
1217 "str r9, [%[regs], #13*4] \n\t" 586 "str r9, [%[regs], #13*4] \n\t"
1218 : "=r" (pc) 587 : "=r" (pc)
1219 : [regs] "r" (regs), [fn] "r" (p->ainsn.insn_fn) 588 : [regs] "r" (regs), [fn] "r" (asi->insn_fn)
1220 : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r9", 589 : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r9",
1221 "lr", "memory", "cc" 590 "lr", "memory", "cc"
1222 ); 591 );
@@ -1224,246 +593,74 @@ t16_emulate_pop_pc(struct kprobe *p, struct pt_regs *regs)
1224 bx_write_pc(pc, regs); 593 bx_write_pc(pc, regs);
1225} 594}
1226 595
1227static enum kprobe_insn __kprobes 596static enum probes_insn __kprobes
1228t16_decode_pop(kprobe_opcode_t insn, struct arch_specific_insn *asi) 597t16_decode_pop(probes_opcode_t insn, struct arch_probes_insn *asi,
598 const struct decode_header *d)
1229{ 599{
1230 /* 600 /*
1231 * To simulate a POP we use a Thumb-2 "LDMDB R9!, {registers}" 601 * To simulate a POP we use a Thumb-2 "LDMDB R9!, {registers}"
1232 * and call it with R9=SP and PC in the register list represented 602 * and call it with R9=SP and PC in the register list represented
1233 * by R8. 603 * by R8.
1234 */ 604 */
1235 ((u16 *)asi->insn)[0] = 0xe8b9; /* 1st half LDMIA R9!,{} */ 605 /* 1st half LDMIA R9!,{} */
1236 ((u16 *)asi->insn)[1] = insn & 0x1ff; /* 2nd half (register list) */ 606 ((u16 *)asi->insn)[0] = __opcode_to_mem_thumb16(0xe8b9);
607 /* 2nd half (register list) */
608 ((u16 *)asi->insn)[1] = __opcode_to_mem_thumb16(insn & 0x1ff);
1237 asi->insn_handler = insn & 0x100 ? t16_emulate_pop_pc 609 asi->insn_handler = insn & 0x100 ? t16_emulate_pop_pc
1238 : t16_emulate_pop_nopc; 610 : t16_emulate_pop_nopc;
1239 return INSN_GOOD; 611 return INSN_GOOD;
1240} 612}
1241 613
1242static const union decode_item t16_table_1011[] = { 614const union decode_action kprobes_t16_actions[NUM_PROBES_T16_ACTIONS] = {
1243 /* Miscellaneous 16-bit instructions */ 615 [PROBES_T16_ADD_SP] = {.handler = t16_simulate_add_sp_imm},
1244 616 [PROBES_T16_CBZ] = {.handler = t16_simulate_cbz},
1245 /* ADD (SP plus immediate) 1011 0000 0xxx xxxx */ 617 [PROBES_T16_SIGN_EXTEND] = {.handler = t16_emulate_loregs_rwflags},
1246 /* SUB (SP minus immediate) 1011 0000 1xxx xxxx */ 618 [PROBES_T16_PUSH] = {.decoder = t16_decode_push},
1247 DECODE_SIMULATE (0xff00, 0xb000, t16_simulate_add_sp_imm), 619 [PROBES_T16_POP] = {.decoder = t16_decode_pop},
1248 620 [PROBES_T16_SEV] = {.handler = probes_emulate_none},
1249 /* CBZ 1011 00x1 xxxx xxxx */ 621 [PROBES_T16_WFE] = {.handler = probes_simulate_nop},
1250 /* CBNZ 1011 10x1 xxxx xxxx */ 622 [PROBES_T16_IT] = {.decoder = t16_decode_it},
1251 DECODE_SIMULATE (0xf500, 0xb100, t16_simulate_cbz), 623 [PROBES_T16_CMP] = {.handler = t16_emulate_loregs_rwflags},
1252 624 [PROBES_T16_ADDSUB] = {.handler = t16_emulate_loregs_noitrwflags},
1253 /* SXTH 1011 0010 00xx xxxx */ 625 [PROBES_T16_LOGICAL] = {.handler = t16_emulate_loregs_noitrwflags},
1254 /* SXTB 1011 0010 01xx xxxx */ 626 [PROBES_T16_LDR_LIT] = {.handler = t16_simulate_ldr_literal},
1255 /* UXTH 1011 0010 10xx xxxx */ 627 [PROBES_T16_BLX] = {.handler = t16_simulate_bxblx},
1256 /* UXTB 1011 0010 11xx xxxx */ 628 [PROBES_T16_HIREGOPS] = {.decoder = t16_decode_hiregs},
1257 /* REV 1011 1010 00xx xxxx */ 629 [PROBES_T16_LDRHSTRH] = {.handler = t16_emulate_loregs_rwflags},
1258 /* REV16 1011 1010 01xx xxxx */ 630 [PROBES_T16_LDRSTR] = {.handler = t16_simulate_ldrstr_sp_relative},
1259 /* ??? 1011 1010 10xx xxxx */ 631 [PROBES_T16_ADR] = {.handler = t16_simulate_reladr},
1260 /* REVSH 1011 1010 11xx xxxx */ 632 [PROBES_T16_LDMSTM] = {.handler = t16_emulate_loregs_rwflags},
1261 DECODE_REJECT (0xffc0, 0xba80), 633 [PROBES_T16_BRANCH_COND] = {.decoder = t16_decode_cond_branch},
1262 DECODE_EMULATE (0xf500, 0xb000, t16_emulate_loregs_rwflags), 634 [PROBES_T16_BRANCH] = {.handler = t16_simulate_branch},
1263
1264 /* PUSH 1011 010x xxxx xxxx */
1265 DECODE_CUSTOM (0xfe00, 0xb400, t16_decode_push),
1266 /* POP 1011 110x xxxx xxxx */
1267 DECODE_CUSTOM (0xfe00, 0xbc00, t16_decode_pop),
1268
1269 /*
1270 * If-Then, and hints
1271 * 1011 1111 xxxx xxxx
1272 */
1273
1274 /* YIELD 1011 1111 0001 0000 */
1275 DECODE_OR (0xffff, 0xbf10),
1276 /* SEV 1011 1111 0100 0000 */
1277 DECODE_EMULATE (0xffff, 0xbf40, kprobe_emulate_none),
1278 /* NOP 1011 1111 0000 0000 */
1279 /* WFE 1011 1111 0010 0000 */
1280 /* WFI 1011 1111 0011 0000 */
1281 DECODE_SIMULATE (0xffcf, 0xbf00, kprobe_simulate_nop),
1282 /* Unassigned hints 1011 1111 xxxx 0000 */
1283 DECODE_REJECT (0xff0f, 0xbf00),
1284 /* IT 1011 1111 xxxx xxxx */
1285 DECODE_CUSTOM (0xff00, 0xbf00, t16_decode_it),
1286
1287 /* SETEND 1011 0110 010x xxxx */
1288 /* CPS 1011 0110 011x xxxx */
1289 /* BKPT 1011 1110 xxxx xxxx */
1290 /* And unallocated instructions... */
1291 DECODE_END
1292}; 635};
1293 636
1294const union decode_item kprobe_decode_thumb16_table[] = { 637const union decode_action kprobes_t32_actions[NUM_PROBES_T32_ACTIONS] = {
1295 638 [PROBES_T32_LDMSTM] = {.decoder = t32_decode_ldmstm},
1296 /* 639 [PROBES_T32_LDRDSTRD] = {.handler = t32_emulate_ldrdstrd},
1297 * Shift (immediate), add, subtract, move, and compare 640 [PROBES_T32_TABLE_BRANCH] = {.handler = t32_simulate_table_branch},
1298 * 00xx xxxx xxxx xxxx 641 [PROBES_T32_TST] = {.handler = t32_emulate_rd8rn16rm0_rwflags},
1299 */ 642 [PROBES_T32_MOV] = {.handler = t32_emulate_rd8rn16rm0_rwflags},
1300 643 [PROBES_T32_ADDSUB] = {.handler = t32_emulate_rd8rn16rm0_rwflags},
1301 /* CMP (immediate) 0010 1xxx xxxx xxxx */ 644 [PROBES_T32_LOGICAL] = {.handler = t32_emulate_rd8rn16rm0_rwflags},
1302 DECODE_EMULATE (0xf800, 0x2800, t16_emulate_loregs_rwflags), 645 [PROBES_T32_CMP] = {.handler = t32_emulate_rd8rn16rm0_rwflags},
1303 646 [PROBES_T32_ADDWSUBW_PC] = {.handler = t32_emulate_rd8pc16_noflags,},
1304 /* ADD (register) 0001 100x xxxx xxxx */ 647 [PROBES_T32_ADDWSUBW] = {.handler = t32_emulate_rd8rn16_noflags},
1305 /* SUB (register) 0001 101x xxxx xxxx */ 648 [PROBES_T32_MOVW] = {.handler = t32_emulate_rd8rn16_noflags},
1306 /* LSL (immediate) 0000 0xxx xxxx xxxx */ 649 [PROBES_T32_SAT] = {.handler = t32_emulate_rd8rn16rm0_rwflags},
1307 /* LSR (immediate) 0000 1xxx xxxx xxxx */ 650 [PROBES_T32_BITFIELD] = {.handler = t32_emulate_rd8rn16_noflags},
1308 /* ASR (immediate) 0001 0xxx xxxx xxxx */ 651 [PROBES_T32_SEV] = {.handler = probes_emulate_none},
1309 /* ADD (immediate, Thumb) 0001 110x xxxx xxxx */ 652 [PROBES_T32_WFE] = {.handler = probes_simulate_nop},
1310 /* SUB (immediate, Thumb) 0001 111x xxxx xxxx */ 653 [PROBES_T32_MRS] = {.handler = t32_simulate_mrs},
1311 /* MOV (immediate) 0010 0xxx xxxx xxxx */ 654 [PROBES_T32_BRANCH_COND] = {.decoder = t32_decode_cond_branch},
1312 /* ADD (immediate, Thumb) 0011 0xxx xxxx xxxx */ 655 [PROBES_T32_BRANCH] = {.handler = t32_simulate_branch},
1313 /* SUB (immediate, Thumb) 0011 1xxx xxxx xxxx */ 656 [PROBES_T32_PLDI] = {.handler = probes_simulate_nop},
1314 DECODE_EMULATE (0xc000, 0x0000, t16_emulate_loregs_noitrwflags), 657 [PROBES_T32_LDR_LIT] = {.handler = t32_simulate_ldr_literal},
1315 658 [PROBES_T32_LDRSTR] = {.handler = t32_emulate_ldrstr},
1316 /* 659 [PROBES_T32_SIGN_EXTEND] = {.handler = t32_emulate_rd8rn16rm0_rwflags},
1317 * 16-bit Thumb data-processing instructions 660 [PROBES_T32_MEDIA] = {.handler = t32_emulate_rd8rn16rm0_rwflags},
1318 * 0100 00xx xxxx xxxx 661 [PROBES_T32_REVERSE] = {.handler = t32_emulate_rd8rn16_noflags},
1319 */ 662 [PROBES_T32_MUL_ADD] = {.handler = t32_emulate_rd8rn16rm0_rwflags},
1320 663 [PROBES_T32_MUL_ADD2] = {.handler = t32_emulate_rd8rn16rm0ra12_noflags},
1321 /* TST (register) 0100 0010 00xx xxxx */ 664 [PROBES_T32_MUL_ADD_LONG] = {
1322 DECODE_EMULATE (0xffc0, 0x4200, t16_emulate_loregs_rwflags), 665 .handler = t32_emulate_rdlo12rdhi8rn16rm0_noflags},
1323 /* CMP (register) 0100 0010 10xx xxxx */
1324 /* CMN (register) 0100 0010 11xx xxxx */
1325 DECODE_EMULATE (0xff80, 0x4280, t16_emulate_loregs_rwflags),
1326 /* AND (register) 0100 0000 00xx xxxx */
1327 /* EOR (register) 0100 0000 01xx xxxx */
1328 /* LSL (register) 0100 0000 10xx xxxx */
1329 /* LSR (register) 0100 0000 11xx xxxx */
1330 /* ASR (register) 0100 0001 00xx xxxx */
1331 /* ADC (register) 0100 0001 01xx xxxx */
1332 /* SBC (register) 0100 0001 10xx xxxx */
1333 /* ROR (register) 0100 0001 11xx xxxx */
1334 /* RSB (immediate) 0100 0010 01xx xxxx */
1335 /* ORR (register) 0100 0011 00xx xxxx */
1336 /* MUL 0100 0011 00xx xxxx */
1337 /* BIC (register) 0100 0011 10xx xxxx */
1338 /* MVN (register) 0100 0011 10xx xxxx */
1339 DECODE_EMULATE (0xfc00, 0x4000, t16_emulate_loregs_noitrwflags),
1340
1341 /*
1342 * Special data instructions and branch and exchange
1343 * 0100 01xx xxxx xxxx
1344 */
1345
1346 /* BLX pc 0100 0111 1111 1xxx */
1347 DECODE_REJECT (0xfff8, 0x47f8),
1348
1349 /* BX (register) 0100 0111 0xxx xxxx */
1350 /* BLX (register) 0100 0111 1xxx xxxx */
1351 DECODE_SIMULATE (0xff00, 0x4700, t16_simulate_bxblx),
1352
1353 /* ADD pc, pc 0100 0100 1111 1111 */
1354 DECODE_REJECT (0xffff, 0x44ff),
1355
1356 /* ADD (register) 0100 0100 xxxx xxxx */
1357 /* CMP (register) 0100 0101 xxxx xxxx */
1358 /* MOV (register) 0100 0110 xxxx xxxx */
1359 DECODE_CUSTOM (0xfc00, 0x4400, t16_decode_hiregs),
1360
1361 /*
1362 * Load from Literal Pool
1363 * LDR (literal) 0100 1xxx xxxx xxxx
1364 */
1365 DECODE_SIMULATE (0xf800, 0x4800, t16_simulate_ldr_literal),
1366
1367 /*
1368 * 16-bit Thumb Load/store instructions
1369 * 0101 xxxx xxxx xxxx
1370 * 011x xxxx xxxx xxxx
1371 * 100x xxxx xxxx xxxx
1372 */
1373
1374 /* STR (register) 0101 000x xxxx xxxx */
1375 /* STRH (register) 0101 001x xxxx xxxx */
1376 /* STRB (register) 0101 010x xxxx xxxx */
1377 /* LDRSB (register) 0101 011x xxxx xxxx */
1378 /* LDR (register) 0101 100x xxxx xxxx */
1379 /* LDRH (register) 0101 101x xxxx xxxx */
1380 /* LDRB (register) 0101 110x xxxx xxxx */
1381 /* LDRSH (register) 0101 111x xxxx xxxx */
1382 /* STR (immediate, Thumb) 0110 0xxx xxxx xxxx */
1383 /* LDR (immediate, Thumb) 0110 1xxx xxxx xxxx */
1384 /* STRB (immediate, Thumb) 0111 0xxx xxxx xxxx */
1385 /* LDRB (immediate, Thumb) 0111 1xxx xxxx xxxx */
1386 DECODE_EMULATE (0xc000, 0x4000, t16_emulate_loregs_rwflags),
1387 /* STRH (immediate, Thumb) 1000 0xxx xxxx xxxx */
1388 /* LDRH (immediate, Thumb) 1000 1xxx xxxx xxxx */
1389 DECODE_EMULATE (0xf000, 0x8000, t16_emulate_loregs_rwflags),
1390 /* STR (immediate, Thumb) 1001 0xxx xxxx xxxx */
1391 /* LDR (immediate, Thumb) 1001 1xxx xxxx xxxx */
1392 DECODE_SIMULATE (0xf000, 0x9000, t16_simulate_ldrstr_sp_relative),
1393
1394 /*
1395 * Generate PC-/SP-relative address
1396 * ADR (literal) 1010 0xxx xxxx xxxx
1397 * ADD (SP plus immediate) 1010 1xxx xxxx xxxx
1398 */
1399 DECODE_SIMULATE (0xf000, 0xa000, t16_simulate_reladr),
1400
1401 /*
1402 * Miscellaneous 16-bit instructions
1403 * 1011 xxxx xxxx xxxx
1404 */
1405 DECODE_TABLE (0xf000, 0xb000, t16_table_1011),
1406
1407 /* STM 1100 0xxx xxxx xxxx */
1408 /* LDM 1100 1xxx xxxx xxxx */
1409 DECODE_EMULATE (0xf000, 0xc000, t16_emulate_loregs_rwflags),
1410
1411 /*
1412 * Conditional branch, and Supervisor Call
1413 */
1414
1415 /* Permanently UNDEFINED 1101 1110 xxxx xxxx */
1416 /* SVC 1101 1111 xxxx xxxx */
1417 DECODE_REJECT (0xfe00, 0xde00),
1418
1419 /* Conditional branch 1101 xxxx xxxx xxxx */
1420 DECODE_CUSTOM (0xf000, 0xd000, t16_decode_cond_branch),
1421
1422 /*
1423 * Unconditional branch
1424 * B 1110 0xxx xxxx xxxx
1425 */
1426 DECODE_SIMULATE (0xf800, 0xe000, t16_simulate_branch),
1427
1428 DECODE_END
1429}; 666};
1430#ifdef CONFIG_ARM_KPROBES_TEST_MODULE
1431EXPORT_SYMBOL_GPL(kprobe_decode_thumb16_table);
1432#endif
1433
1434static unsigned long __kprobes thumb_check_cc(unsigned long cpsr)
1435{
1436 if (unlikely(in_it_block(cpsr)))
1437 return kprobe_condition_checks[current_cond(cpsr)](cpsr);
1438 return true;
1439}
1440
1441static void __kprobes thumb16_singlestep(struct kprobe *p, struct pt_regs *regs)
1442{
1443 regs->ARM_pc += 2;
1444 p->ainsn.insn_handler(p, regs);
1445 regs->ARM_cpsr = it_advance(regs->ARM_cpsr);
1446}
1447
1448static void __kprobes thumb32_singlestep(struct kprobe *p, struct pt_regs *regs)
1449{
1450 regs->ARM_pc += 4;
1451 p->ainsn.insn_handler(p, regs);
1452 regs->ARM_cpsr = it_advance(regs->ARM_cpsr);
1453}
1454
1455enum kprobe_insn __kprobes
1456thumb16_kprobe_decode_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi)
1457{
1458 asi->insn_singlestep = thumb16_singlestep;
1459 asi->insn_check_cc = thumb_check_cc;
1460 return kprobe_decode_insn(insn, asi, kprobe_decode_thumb16_table, true);
1461}
1462
1463enum kprobe_insn __kprobes
1464thumb32_kprobe_decode_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi)
1465{
1466 asi->insn_singlestep = thumb32_singlestep;
1467 asi->insn_check_cc = thumb_check_cc;
1468 return kprobe_decode_insn(insn, asi, kprobe_decode_thumb32_table, true);
1469}
diff --git a/arch/arm/kernel/kprobes.c b/arch/arm/kernel/kprobes.c
index a7b621ece23d..6d644202c8dc 100644
--- a/arch/arm/kernel/kprobes.c
+++ b/arch/arm/kernel/kprobes.c
@@ -26,9 +26,14 @@
26#include <linux/stop_machine.h> 26#include <linux/stop_machine.h>
27#include <linux/stringify.h> 27#include <linux/stringify.h>
28#include <asm/traps.h> 28#include <asm/traps.h>
29#include <asm/opcodes.h>
29#include <asm/cacheflush.h> 30#include <asm/cacheflush.h>
31#include <linux/percpu.h>
32#include <linux/bug.h>
30 33
31#include "kprobes.h" 34#include "kprobes.h"
35#include "probes-arm.h"
36#include "probes-thumb.h"
32#include "patch.h" 37#include "patch.h"
33 38
34#define MIN_STACK_SIZE(addr) \ 39#define MIN_STACK_SIZE(addr) \
@@ -54,6 +59,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
54 unsigned long addr = (unsigned long)p->addr; 59 unsigned long addr = (unsigned long)p->addr;
55 bool thumb; 60 bool thumb;
56 kprobe_decode_insn_t *decode_insn; 61 kprobe_decode_insn_t *decode_insn;
62 const union decode_action *actions;
57 int is; 63 int is;
58 64
59 if (in_exception_text(addr)) 65 if (in_exception_text(addr))
@@ -62,25 +68,29 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
62#ifdef CONFIG_THUMB2_KERNEL 68#ifdef CONFIG_THUMB2_KERNEL
63 thumb = true; 69 thumb = true;
64 addr &= ~1; /* Bit 0 would normally be set to indicate Thumb code */ 70 addr &= ~1; /* Bit 0 would normally be set to indicate Thumb code */
65 insn = ((u16 *)addr)[0]; 71 insn = __mem_to_opcode_thumb16(((u16 *)addr)[0]);
66 if (is_wide_instruction(insn)) { 72 if (is_wide_instruction(insn)) {
67 insn <<= 16; 73 u16 inst2 = __mem_to_opcode_thumb16(((u16 *)addr)[1]);
68 insn |= ((u16 *)addr)[1]; 74 insn = __opcode_thumb32_compose(insn, inst2);
69 decode_insn = thumb32_kprobe_decode_insn; 75 decode_insn = thumb32_probes_decode_insn;
70 } else 76 actions = kprobes_t32_actions;
71 decode_insn = thumb16_kprobe_decode_insn; 77 } else {
78 decode_insn = thumb16_probes_decode_insn;
79 actions = kprobes_t16_actions;
80 }
72#else /* !CONFIG_THUMB2_KERNEL */ 81#else /* !CONFIG_THUMB2_KERNEL */
73 thumb = false; 82 thumb = false;
74 if (addr & 0x3) 83 if (addr & 0x3)
75 return -EINVAL; 84 return -EINVAL;
76 insn = *p->addr; 85 insn = __mem_to_opcode_arm(*p->addr);
77 decode_insn = arm_kprobe_decode_insn; 86 decode_insn = arm_probes_decode_insn;
87 actions = kprobes_arm_actions;
78#endif 88#endif
79 89
80 p->opcode = insn; 90 p->opcode = insn;
81 p->ainsn.insn = tmp_insn; 91 p->ainsn.insn = tmp_insn;
82 92
83 switch ((*decode_insn)(insn, &p->ainsn)) { 93 switch ((*decode_insn)(insn, &p->ainsn, true, actions)) {
84 case INSN_REJECTED: /* not supported */ 94 case INSN_REJECTED: /* not supported */
85 return -EINVAL; 95 return -EINVAL;
86 96
@@ -92,7 +102,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
92 p->ainsn.insn[is] = tmp_insn[is]; 102 p->ainsn.insn[is] = tmp_insn[is];
93 flush_insns(p->ainsn.insn, 103 flush_insns(p->ainsn.insn,
94 sizeof(p->ainsn.insn[0]) * MAX_INSN_SIZE); 104 sizeof(p->ainsn.insn[0]) * MAX_INSN_SIZE);
95 p->ainsn.insn_fn = (kprobe_insn_fn_t *) 105 p->ainsn.insn_fn = (probes_insn_fn_t *)
96 ((uintptr_t)p->ainsn.insn | thumb); 106 ((uintptr_t)p->ainsn.insn | thumb);
97 break; 107 break;
98 108
@@ -197,7 +207,7 @@ singlestep_skip(struct kprobe *p, struct pt_regs *regs)
197static inline void __kprobes 207static inline void __kprobes
198singlestep(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *kcb) 208singlestep(struct kprobe *p, struct pt_regs *regs, struct kprobe_ctlblk *kcb)
199{ 209{
200 p->ainsn.insn_singlestep(p, regs); 210 p->ainsn.insn_singlestep(p->opcode, &p->ainsn, regs);
201} 211}
202 212
203/* 213/*
@@ -607,7 +617,7 @@ static struct undef_hook kprobes_arm_break_hook = {
607 617
608int __init arch_init_kprobes() 618int __init arch_init_kprobes()
609{ 619{
610 arm_kprobe_decode_init(); 620 arm_probes_decode_init();
611#ifdef CONFIG_THUMB2_KERNEL 621#ifdef CONFIG_THUMB2_KERNEL
612 register_undef_hook(&kprobes_thumb16_break_hook); 622 register_undef_hook(&kprobes_thumb16_break_hook);
613 register_undef_hook(&kprobes_thumb32_break_hook); 623 register_undef_hook(&kprobes_thumb32_break_hook);
diff --git a/arch/arm/kernel/kprobes.h b/arch/arm/kernel/kprobes.h
index 38945f78f9f1..9a2712ecefc3 100644
--- a/arch/arm/kernel/kprobes.h
+++ b/arch/arm/kernel/kprobes.h
@@ -19,6 +19,8 @@
19#ifndef _ARM_KERNEL_KPROBES_H 19#ifndef _ARM_KERNEL_KPROBES_H
20#define _ARM_KERNEL_KPROBES_H 20#define _ARM_KERNEL_KPROBES_H
21 21
22#include "probes.h"
23
22/* 24/*
23 * These undefined instructions must be unique and 25 * These undefined instructions must be unique and
24 * reserved solely for kprobes' use. 26 * reserved solely for kprobes' use.
@@ -27,402 +29,24 @@
27#define KPROBE_THUMB16_BREAKPOINT_INSTRUCTION 0xde18 29#define KPROBE_THUMB16_BREAKPOINT_INSTRUCTION 0xde18
28#define KPROBE_THUMB32_BREAKPOINT_INSTRUCTION 0xf7f0a018 30#define KPROBE_THUMB32_BREAKPOINT_INSTRUCTION 0xf7f0a018
29 31
32enum probes_insn __kprobes
33kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_probes_insn *asi,
34 const struct decode_header *h);
30 35
31enum kprobe_insn { 36typedef enum probes_insn (kprobe_decode_insn_t)(probes_opcode_t,
32 INSN_REJECTED, 37 struct arch_probes_insn *,
33 INSN_GOOD, 38 bool,
34 INSN_GOOD_NO_SLOT 39 const union decode_action *);
35};
36
37typedef enum kprobe_insn (kprobe_decode_insn_t)(kprobe_opcode_t,
38 struct arch_specific_insn *);
39 40
40#ifdef CONFIG_THUMB2_KERNEL 41#ifdef CONFIG_THUMB2_KERNEL
41 42
42enum kprobe_insn thumb16_kprobe_decode_insn(kprobe_opcode_t, 43extern const union decode_action kprobes_t32_actions[];
43 struct arch_specific_insn *); 44extern const union decode_action kprobes_t16_actions[];
44enum kprobe_insn thumb32_kprobe_decode_insn(kprobe_opcode_t,
45 struct arch_specific_insn *);
46 45
47#else /* !CONFIG_THUMB2_KERNEL */ 46#else /* !CONFIG_THUMB2_KERNEL */
48 47
49enum kprobe_insn arm_kprobe_decode_insn(kprobe_opcode_t, 48extern const union decode_action kprobes_arm_actions[];
50 struct arch_specific_insn *);
51#endif
52
53void __init arm_kprobe_decode_init(void);
54
55extern kprobe_check_cc * const kprobe_condition_checks[16];
56
57
58#if __LINUX_ARM_ARCH__ >= 7
59
60/* str_pc_offset is architecturally defined from ARMv7 onwards */
61#define str_pc_offset 8
62#define find_str_pc_offset()
63
64#else /* __LINUX_ARM_ARCH__ < 7 */
65
66/* We need a run-time check to determine str_pc_offset */
67extern int str_pc_offset;
68void __init find_str_pc_offset(void);
69 49
70#endif 50#endif
71 51
72
73/*
74 * Update ITSTATE after normal execution of an IT block instruction.
75 *
76 * The 8 IT state bits are split into two parts in CPSR:
77 * ITSTATE<1:0> are in CPSR<26:25>
78 * ITSTATE<7:2> are in CPSR<15:10>
79 */
80static inline unsigned long it_advance(unsigned long cpsr)
81 {
82 if ((cpsr & 0x06000400) == 0) {
83 /* ITSTATE<2:0> == 0 means end of IT block, so clear IT state */
84 cpsr &= ~PSR_IT_MASK;
85 } else {
86 /* We need to shift left ITSTATE<4:0> */
87 const unsigned long mask = 0x06001c00; /* Mask ITSTATE<4:0> */
88 unsigned long it = cpsr & mask;
89 it <<= 1;
90 it |= it >> (27 - 10); /* Carry ITSTATE<2> to correct place */
91 it &= mask;
92 cpsr &= ~mask;
93 cpsr |= it;
94 }
95 return cpsr;
96}
97
98static inline void __kprobes bx_write_pc(long pcv, struct pt_regs *regs)
99{
100 long cpsr = regs->ARM_cpsr;
101 if (pcv & 0x1) {
102 cpsr |= PSR_T_BIT;
103 pcv &= ~0x1;
104 } else {
105 cpsr &= ~PSR_T_BIT;
106 pcv &= ~0x2; /* Avoid UNPREDICTABLE address allignment */
107 }
108 regs->ARM_cpsr = cpsr;
109 regs->ARM_pc = pcv;
110}
111
112
113#if __LINUX_ARM_ARCH__ >= 6
114
115/* Kernels built for >= ARMv6 should never run on <= ARMv5 hardware, so... */
116#define load_write_pc_interworks true
117#define test_load_write_pc_interworking()
118
119#else /* __LINUX_ARM_ARCH__ < 6 */
120
121/* We need run-time testing to determine if load_write_pc() should interwork. */
122extern bool load_write_pc_interworks;
123void __init test_load_write_pc_interworking(void);
124
125#endif
126
127static inline void __kprobes load_write_pc(long pcv, struct pt_regs *regs)
128{
129 if (load_write_pc_interworks)
130 bx_write_pc(pcv, regs);
131 else
132 regs->ARM_pc = pcv;
133}
134
135
136#if __LINUX_ARM_ARCH__ >= 7
137
138#define alu_write_pc_interworks true
139#define test_alu_write_pc_interworking()
140
141#elif __LINUX_ARM_ARCH__ <= 5
142
143/* Kernels built for <= ARMv5 should never run on >= ARMv6 hardware, so... */
144#define alu_write_pc_interworks false
145#define test_alu_write_pc_interworking()
146
147#else /* __LINUX_ARM_ARCH__ == 6 */
148
149/* We could be an ARMv6 binary on ARMv7 hardware so we need a run-time check. */
150extern bool alu_write_pc_interworks;
151void __init test_alu_write_pc_interworking(void);
152
153#endif /* __LINUX_ARM_ARCH__ == 6 */
154
155static inline void __kprobes alu_write_pc(long pcv, struct pt_regs *regs)
156{
157 if (alu_write_pc_interworks)
158 bx_write_pc(pcv, regs);
159 else
160 regs->ARM_pc = pcv;
161}
162
163
164void __kprobes kprobe_simulate_nop(struct kprobe *p, struct pt_regs *regs);
165void __kprobes kprobe_emulate_none(struct kprobe *p, struct pt_regs *regs);
166
167enum kprobe_insn __kprobes
168kprobe_decode_ldmstm(kprobe_opcode_t insn, struct arch_specific_insn *asi);
169
170/*
171 * Test if load/store instructions writeback the address register.
172 * if P (bit 24) == 0 or W (bit 21) == 1
173 */
174#define is_writeback(insn) ((insn ^ 0x01000000) & 0x01200000)
175
176/*
177 * The following definitions and macros are used to build instruction
178 * decoding tables for use by kprobe_decode_insn.
179 *
180 * These tables are a concatenation of entries each of which consist of one of
181 * the decode_* structs. All of the fields in every type of decode structure
182 * are of the union type decode_item, therefore the entire decode table can be
183 * viewed as an array of these and declared like:
184 *
185 * static const union decode_item table_name[] = {};
186 *
187 * In order to construct each entry in the table, macros are used to
188 * initialise a number of sequential decode_item values in a layout which
189 * matches the relevant struct. E.g. DECODE_SIMULATE initialise a struct
190 * decode_simulate by initialising four decode_item objects like this...
191 *
192 * {.bits = _type},
193 * {.bits = _mask},
194 * {.bits = _value},
195 * {.handler = _handler},
196 *
197 * Initialising a specified member of the union means that the compiler
198 * will produce a warning if the argument is of an incorrect type.
199 *
200 * Below is a list of each of the macros used to initialise entries and a
201 * description of the action performed when that entry is matched to an
202 * instruction. A match is found when (instruction & mask) == value.
203 *
204 * DECODE_TABLE(mask, value, table)
205 * Instruction decoding jumps to parsing the new sub-table 'table'.
206 *
207 * DECODE_CUSTOM(mask, value, decoder)
208 * The custom function 'decoder' is called to the complete decoding
209 * of an instruction.
210 *
211 * DECODE_SIMULATE(mask, value, handler)
212 * Set the probes instruction handler to 'handler', this will be used
213 * to simulate the instruction when the probe is hit. Decoding returns
214 * with INSN_GOOD_NO_SLOT.
215 *
216 * DECODE_EMULATE(mask, value, handler)
217 * Set the probes instruction handler to 'handler', this will be used
218 * to emulate the instruction when the probe is hit. The modified
219 * instruction (see below) is placed in the probes instruction slot so it
220 * may be called by the emulation code. Decoding returns with INSN_GOOD.
221 *
222 * DECODE_REJECT(mask, value)
223 * Instruction decoding fails with INSN_REJECTED
224 *
225 * DECODE_OR(mask, value)
226 * This allows the mask/value test of multiple table entries to be
227 * logically ORed. Once an 'or' entry is matched the decoding action to
228 * be performed is that of the next entry which isn't an 'or'. E.g.
229 *
230 * DECODE_OR (mask1, value1)
231 * DECODE_OR (mask2, value2)
232 * DECODE_SIMULATE (mask3, value3, simulation_handler)
233 *
234 * This means that if any of the three mask/value pairs match the
235 * instruction being decoded, then 'simulation_handler' will be used
236 * for it.
237 *
238 * Both the SIMULATE and EMULATE macros have a second form which take an
239 * additional 'regs' argument.
240 *
241 * DECODE_SIMULATEX(mask, value, handler, regs)
242 * DECODE_EMULATEX (mask, value, handler, regs)
243 *
244 * These are used to specify what kind of CPU register is encoded in each of the
245 * least significant 5 nibbles of the instruction being decoded. The regs value
246 * is specified using the REGS macro, this takes any of the REG_TYPE_* values
247 * from enum decode_reg_type as arguments; only the '*' part of the name is
248 * given. E.g.
249 *
250 * REGS(0, ANY, NOPC, 0, ANY)
251 *
252 * This indicates an instruction is encoded like:
253 *
254 * bits 19..16 ignore
255 * bits 15..12 any register allowed here
256 * bits 11.. 8 any register except PC allowed here
257 * bits 7.. 4 ignore
258 * bits 3.. 0 any register allowed here
259 *
260 * This register specification is checked after a decode table entry is found to
261 * match an instruction (through the mask/value test). Any invalid register then
262 * found in the instruction will cause decoding to fail with INSN_REJECTED. In
263 * the above example this would happen if bits 11..8 of the instruction were
264 * 1111, indicating R15 or PC.
265 *
266 * As well as checking for legal combinations of registers, this data is also
267 * used to modify the registers encoded in the instructions so that an
268 * emulation routines can use it. (See decode_regs() and INSN_NEW_BITS.)
269 *
270 * Here is a real example which matches ARM instructions of the form
271 * "AND <Rd>,<Rn>,<Rm>,<shift> <Rs>"
272 *
273 * DECODE_EMULATEX (0x0e000090, 0x00000010, emulate_rd12rn16rm0rs8_rwflags,
274 * REGS(ANY, ANY, NOPC, 0, ANY)),
275 * ^ ^ ^ ^
276 * Rn Rd Rs Rm
277 *
278 * Decoding the instruction "AND R4, R5, R6, ASL R15" will be rejected because
279 * Rs == R15
280 *
281 * Decoding the instruction "AND R4, R5, R6, ASL R7" will be accepted and the
282 * instruction will be modified to "AND R0, R2, R3, ASL R1" and then placed into
283 * the kprobes instruction slot. This can then be called later by the handler
284 * function emulate_rd12rn16rm0rs8_rwflags in order to simulate the instruction.
285 */
286
287enum decode_type {
288 DECODE_TYPE_END,
289 DECODE_TYPE_TABLE,
290 DECODE_TYPE_CUSTOM,
291 DECODE_TYPE_SIMULATE,
292 DECODE_TYPE_EMULATE,
293 DECODE_TYPE_OR,
294 DECODE_TYPE_REJECT,
295 NUM_DECODE_TYPES /* Must be last enum */
296};
297
298#define DECODE_TYPE_BITS 4
299#define DECODE_TYPE_MASK ((1 << DECODE_TYPE_BITS) - 1)
300
301enum decode_reg_type {
302 REG_TYPE_NONE = 0, /* Not a register, ignore */
303 REG_TYPE_ANY, /* Any register allowed */
304 REG_TYPE_SAMEAS16, /* Register should be same as that at bits 19..16 */
305 REG_TYPE_SP, /* Register must be SP */
306 REG_TYPE_PC, /* Register must be PC */
307 REG_TYPE_NOSP, /* Register must not be SP */
308 REG_TYPE_NOSPPC, /* Register must not be SP or PC */
309 REG_TYPE_NOPC, /* Register must not be PC */
310 REG_TYPE_NOPCWB, /* No PC if load/store write-back flag also set */
311
312 /* The following types are used when the encoding for PC indicates
313 * another instruction form. This distiction only matters for test
314 * case coverage checks.
315 */
316 REG_TYPE_NOPCX, /* Register must not be PC */
317 REG_TYPE_NOSPPCX, /* Register must not be SP or PC */
318
319 /* Alias to allow '0' arg to be used in REGS macro. */
320 REG_TYPE_0 = REG_TYPE_NONE
321};
322
323#define REGS(r16, r12, r8, r4, r0) \
324 ((REG_TYPE_##r16) << 16) + \
325 ((REG_TYPE_##r12) << 12) + \
326 ((REG_TYPE_##r8) << 8) + \
327 ((REG_TYPE_##r4) << 4) + \
328 (REG_TYPE_##r0)
329
330union decode_item {
331 u32 bits;
332 const union decode_item *table;
333 kprobe_insn_handler_t *handler;
334 kprobe_decode_insn_t *decoder;
335};
336
337
338#define DECODE_END \
339 {.bits = DECODE_TYPE_END}
340
341
342struct decode_header {
343 union decode_item type_regs;
344 union decode_item mask;
345 union decode_item value;
346};
347
348#define DECODE_HEADER(_type, _mask, _value, _regs) \
349 {.bits = (_type) | ((_regs) << DECODE_TYPE_BITS)}, \
350 {.bits = (_mask)}, \
351 {.bits = (_value)}
352
353
354struct decode_table {
355 struct decode_header header;
356 union decode_item table;
357};
358
359#define DECODE_TABLE(_mask, _value, _table) \
360 DECODE_HEADER(DECODE_TYPE_TABLE, _mask, _value, 0), \
361 {.table = (_table)}
362
363
364struct decode_custom {
365 struct decode_header header;
366 union decode_item decoder;
367};
368
369#define DECODE_CUSTOM(_mask, _value, _decoder) \
370 DECODE_HEADER(DECODE_TYPE_CUSTOM, _mask, _value, 0), \
371 {.decoder = (_decoder)}
372
373
374struct decode_simulate {
375 struct decode_header header;
376 union decode_item handler;
377};
378
379#define DECODE_SIMULATEX(_mask, _value, _handler, _regs) \
380 DECODE_HEADER(DECODE_TYPE_SIMULATE, _mask, _value, _regs), \
381 {.handler = (_handler)}
382
383#define DECODE_SIMULATE(_mask, _value, _handler) \
384 DECODE_SIMULATEX(_mask, _value, _handler, 0)
385
386
387struct decode_emulate {
388 struct decode_header header;
389 union decode_item handler;
390};
391
392#define DECODE_EMULATEX(_mask, _value, _handler, _regs) \
393 DECODE_HEADER(DECODE_TYPE_EMULATE, _mask, _value, _regs), \
394 {.handler = (_handler)}
395
396#define DECODE_EMULATE(_mask, _value, _handler) \
397 DECODE_EMULATEX(_mask, _value, _handler, 0)
398
399
400struct decode_or {
401 struct decode_header header;
402};
403
404#define DECODE_OR(_mask, _value) \
405 DECODE_HEADER(DECODE_TYPE_OR, _mask, _value, 0)
406
407
408struct decode_reject {
409 struct decode_header header;
410};
411
412#define DECODE_REJECT(_mask, _value) \
413 DECODE_HEADER(DECODE_TYPE_REJECT, _mask, _value, 0)
414
415
416#ifdef CONFIG_THUMB2_KERNEL
417extern const union decode_item kprobe_decode_thumb16_table[];
418extern const union decode_item kprobe_decode_thumb32_table[];
419#else
420extern const union decode_item kprobe_decode_arm_table[];
421#endif
422
423
424int kprobe_decode_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi,
425 const union decode_item *table, bool thumb16);
426
427
428#endif /* _ARM_KERNEL_KPROBES_H */ 52#endif /* _ARM_KERNEL_KPROBES_H */
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 789d846a9184..a6bc431cde70 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -16,6 +16,8 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/pm_runtime.h> 17#include <linux/pm_runtime.h>
18#include <linux/uaccess.h> 18#include <linux/uaccess.h>
19#include <linux/irq.h>
20#include <linux/irqdesc.h>
19 21
20#include <asm/irq_regs.h> 22#include <asm/irq_regs.h>
21#include <asm/pmu.h> 23#include <asm/pmu.h>
@@ -205,6 +207,8 @@ armpmu_del(struct perf_event *event, int flags)
205 armpmu_stop(event, PERF_EF_UPDATE); 207 armpmu_stop(event, PERF_EF_UPDATE);
206 hw_events->events[idx] = NULL; 208 hw_events->events[idx] = NULL;
207 clear_bit(idx, hw_events->used_mask); 209 clear_bit(idx, hw_events->used_mask);
210 if (armpmu->clear_event_idx)
211 armpmu->clear_event_idx(hw_events, event);
208 212
209 perf_event_update_userpage(event); 213 perf_event_update_userpage(event);
210} 214}
@@ -295,14 +299,27 @@ validate_group(struct perf_event *event)
295 299
296static irqreturn_t armpmu_dispatch_irq(int irq, void *dev) 300static irqreturn_t armpmu_dispatch_irq(int irq, void *dev)
297{ 301{
298 struct arm_pmu *armpmu = (struct arm_pmu *) dev; 302 struct arm_pmu *armpmu;
299 struct platform_device *plat_device = armpmu->plat_device; 303 struct platform_device *plat_device;
300 struct arm_pmu_platdata *plat = dev_get_platdata(&plat_device->dev); 304 struct arm_pmu_platdata *plat;
305 int ret;
306 u64 start_clock, finish_clock;
301 307
308 if (irq_is_percpu(irq))
309 dev = *(void **)dev;
310 armpmu = dev;
311 plat_device = armpmu->plat_device;
312 plat = dev_get_platdata(&plat_device->dev);
313
314 start_clock = sched_clock();
302 if (plat && plat->handle_irq) 315 if (plat && plat->handle_irq)
303 return plat->handle_irq(irq, dev, armpmu->handle_irq); 316 ret = plat->handle_irq(irq, dev, armpmu->handle_irq);
304 else 317 else
305 return armpmu->handle_irq(irq, dev); 318 ret = armpmu->handle_irq(irq, dev);
319 finish_clock = sched_clock();
320
321 perf_sample_event_took(finish_clock - start_clock);
322 return ret;
306} 323}
307 324
308static void 325static void
diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c
index 20d553c9f5e2..51798d7854ac 100644
--- a/arch/arm/kernel/perf_event_cpu.c
+++ b/arch/arm/kernel/perf_event_cpu.c
@@ -25,6 +25,8 @@
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/spinlock.h> 27#include <linux/spinlock.h>
28#include <linux/irq.h>
29#include <linux/irqdesc.h>
28 30
29#include <asm/cputype.h> 31#include <asm/cputype.h>
30#include <asm/irq_regs.h> 32#include <asm/irq_regs.h>
@@ -33,6 +35,7 @@
33/* Set at runtime when we know what CPU type we are. */ 35/* Set at runtime when we know what CPU type we are. */
34static struct arm_pmu *cpu_pmu; 36static struct arm_pmu *cpu_pmu;
35 37
38static DEFINE_PER_CPU(struct arm_pmu *, percpu_pmu);
36static DEFINE_PER_CPU(struct perf_event * [ARMPMU_MAX_HWEVENTS], hw_events); 39static DEFINE_PER_CPU(struct perf_event * [ARMPMU_MAX_HWEVENTS], hw_events);
37static DEFINE_PER_CPU(unsigned long [BITS_TO_LONGS(ARMPMU_MAX_HWEVENTS)], used_mask); 40static DEFINE_PER_CPU(unsigned long [BITS_TO_LONGS(ARMPMU_MAX_HWEVENTS)], used_mask);
38static DEFINE_PER_CPU(struct pmu_hw_events, cpu_hw_events); 41static DEFINE_PER_CPU(struct pmu_hw_events, cpu_hw_events);
@@ -71,6 +74,26 @@ static struct pmu_hw_events *cpu_pmu_get_cpu_events(void)
71 return this_cpu_ptr(&cpu_hw_events); 74 return this_cpu_ptr(&cpu_hw_events);
72} 75}
73 76
77static void cpu_pmu_enable_percpu_irq(void *data)
78{
79 struct arm_pmu *cpu_pmu = data;
80 struct platform_device *pmu_device = cpu_pmu->plat_device;
81 int irq = platform_get_irq(pmu_device, 0);
82
83 enable_percpu_irq(irq, IRQ_TYPE_NONE);
84 cpumask_set_cpu(smp_processor_id(), &cpu_pmu->active_irqs);
85}
86
87static void cpu_pmu_disable_percpu_irq(void *data)
88{
89 struct arm_pmu *cpu_pmu = data;
90 struct platform_device *pmu_device = cpu_pmu->plat_device;
91 int irq = platform_get_irq(pmu_device, 0);
92
93 cpumask_clear_cpu(smp_processor_id(), &cpu_pmu->active_irqs);
94 disable_percpu_irq(irq);
95}
96
74static void cpu_pmu_free_irq(struct arm_pmu *cpu_pmu) 97static void cpu_pmu_free_irq(struct arm_pmu *cpu_pmu)
75{ 98{
76 int i, irq, irqs; 99 int i, irq, irqs;
@@ -78,12 +101,18 @@ static void cpu_pmu_free_irq(struct arm_pmu *cpu_pmu)
78 101
79 irqs = min(pmu_device->num_resources, num_possible_cpus()); 102 irqs = min(pmu_device->num_resources, num_possible_cpus());
80 103
81 for (i = 0; i < irqs; ++i) { 104 irq = platform_get_irq(pmu_device, 0);
82 if (!cpumask_test_and_clear_cpu(i, &cpu_pmu->active_irqs)) 105 if (irq >= 0 && irq_is_percpu(irq)) {
83 continue; 106 on_each_cpu(cpu_pmu_disable_percpu_irq, cpu_pmu, 1);
84 irq = platform_get_irq(pmu_device, i); 107 free_percpu_irq(irq, &percpu_pmu);
85 if (irq >= 0) 108 } else {
86 free_irq(irq, cpu_pmu); 109 for (i = 0; i < irqs; ++i) {
110 if (!cpumask_test_and_clear_cpu(i, &cpu_pmu->active_irqs))
111 continue;
112 irq = platform_get_irq(pmu_device, i);
113 if (irq >= 0)
114 free_irq(irq, cpu_pmu);
115 }
87 } 116 }
88} 117}
89 118
@@ -101,33 +130,44 @@ static int cpu_pmu_request_irq(struct arm_pmu *cpu_pmu, irq_handler_t handler)
101 return -ENODEV; 130 return -ENODEV;
102 } 131 }
103 132
104 for (i = 0; i < irqs; ++i) { 133 irq = platform_get_irq(pmu_device, 0);
105 err = 0; 134 if (irq >= 0 && irq_is_percpu(irq)) {
106 irq = platform_get_irq(pmu_device, i); 135 err = request_percpu_irq(irq, handler, "arm-pmu", &percpu_pmu);
107 if (irq < 0)
108 continue;
109
110 /*
111 * If we have a single PMU interrupt that we can't shift,
112 * assume that we're running on a uniprocessor machine and
113 * continue. Otherwise, continue without this interrupt.
114 */
115 if (irq_set_affinity(irq, cpumask_of(i)) && irqs > 1) {
116 pr_warning("unable to set irq affinity (irq=%d, cpu=%u)\n",
117 irq, i);
118 continue;
119 }
120
121 err = request_irq(irq, handler,
122 IRQF_NOBALANCING | IRQF_NO_THREAD, "arm-pmu",
123 cpu_pmu);
124 if (err) { 136 if (err) {
125 pr_err("unable to request IRQ%d for ARM PMU counters\n", 137 pr_err("unable to request IRQ%d for ARM PMU counters\n",
126 irq); 138 irq);
127 return err; 139 return err;
128 } 140 }
129 141 on_each_cpu(cpu_pmu_enable_percpu_irq, cpu_pmu, 1);
130 cpumask_set_cpu(i, &cpu_pmu->active_irqs); 142 } else {
143 for (i = 0; i < irqs; ++i) {
144 err = 0;
145 irq = platform_get_irq(pmu_device, i);
146 if (irq < 0)
147 continue;
148
149 /*
150 * If we have a single PMU interrupt that we can't shift,
151 * assume that we're running on a uniprocessor machine and
152 * continue. Otherwise, continue without this interrupt.
153 */
154 if (irq_set_affinity(irq, cpumask_of(i)) && irqs > 1) {
155 pr_warning("unable to set irq affinity (irq=%d, cpu=%u)\n",
156 irq, i);
157 continue;
158 }
159
160 err = request_irq(irq, handler,
161 IRQF_NOBALANCING | IRQF_NO_THREAD, "arm-pmu",
162 cpu_pmu);
163 if (err) {
164 pr_err("unable to request IRQ%d for ARM PMU counters\n",
165 irq);
166 return err;
167 }
168
169 cpumask_set_cpu(i, &cpu_pmu->active_irqs);
170 }
131 } 171 }
132 172
133 return 0; 173 return 0;
@@ -141,6 +181,7 @@ static void cpu_pmu_init(struct arm_pmu *cpu_pmu)
141 events->events = per_cpu(hw_events, cpu); 181 events->events = per_cpu(hw_events, cpu);
142 events->used_mask = per_cpu(used_mask, cpu); 182 events->used_mask = per_cpu(used_mask, cpu);
143 raw_spin_lock_init(&events->pmu_lock); 183 raw_spin_lock_init(&events->pmu_lock);
184 per_cpu(percpu_pmu, cpu) = cpu_pmu;
144 } 185 }
145 186
146 cpu_pmu->get_hw_events = cpu_pmu_get_cpu_events; 187 cpu_pmu->get_hw_events = cpu_pmu_get_cpu_events;
@@ -181,6 +222,7 @@ static struct notifier_block cpu_pmu_hotplug_notifier = {
181 */ 222 */
182static struct of_device_id cpu_pmu_of_device_ids[] = { 223static struct of_device_id cpu_pmu_of_device_ids[] = {
183 {.compatible = "arm,cortex-a15-pmu", .data = armv7_a15_pmu_init}, 224 {.compatible = "arm,cortex-a15-pmu", .data = armv7_a15_pmu_init},
225 {.compatible = "arm,cortex-a12-pmu", .data = armv7_a12_pmu_init},
184 {.compatible = "arm,cortex-a9-pmu", .data = armv7_a9_pmu_init}, 226 {.compatible = "arm,cortex-a9-pmu", .data = armv7_a9_pmu_init},
185 {.compatible = "arm,cortex-a8-pmu", .data = armv7_a8_pmu_init}, 227 {.compatible = "arm,cortex-a8-pmu", .data = armv7_a8_pmu_init},
186 {.compatible = "arm,cortex-a7-pmu", .data = armv7_a7_pmu_init}, 228 {.compatible = "arm,cortex-a7-pmu", .data = armv7_a7_pmu_init},
@@ -188,6 +230,7 @@ static struct of_device_id cpu_pmu_of_device_ids[] = {
188 {.compatible = "arm,arm11mpcore-pmu", .data = armv6mpcore_pmu_init}, 230 {.compatible = "arm,arm11mpcore-pmu", .data = armv6mpcore_pmu_init},
189 {.compatible = "arm,arm1176-pmu", .data = armv6pmu_init}, 231 {.compatible = "arm,arm1176-pmu", .data = armv6pmu_init},
190 {.compatible = "arm,arm1136-pmu", .data = armv6pmu_init}, 232 {.compatible = "arm,arm1136-pmu", .data = armv6pmu_init},
233 {.compatible = "qcom,krait-pmu", .data = krait_pmu_init},
191 {}, 234 {},
192}; 235};
193 236
@@ -225,15 +268,6 @@ static int probe_current_pmu(struct arm_pmu *pmu)
225 case ARM_CPU_PART_CORTEX_A9: 268 case ARM_CPU_PART_CORTEX_A9:
226 ret = armv7_a9_pmu_init(pmu); 269 ret = armv7_a9_pmu_init(pmu);
227 break; 270 break;
228 case ARM_CPU_PART_CORTEX_A5:
229 ret = armv7_a5_pmu_init(pmu);
230 break;
231 case ARM_CPU_PART_CORTEX_A15:
232 ret = armv7_a15_pmu_init(pmu);
233 break;
234 case ARM_CPU_PART_CORTEX_A7:
235 ret = armv7_a7_pmu_init(pmu);
236 break;
237 } 271 }
238 /* Intel CPUs [xscale]. */ 272 /* Intel CPUs [xscale]. */
239 } else if (implementor == ARM_CPU_IMP_INTEL) { 273 } else if (implementor == ARM_CPU_IMP_INTEL) {
@@ -270,6 +304,9 @@ static int cpu_pmu_device_probe(struct platform_device *pdev)
270 return -ENOMEM; 304 return -ENOMEM;
271 } 305 }
272 306
307 cpu_pmu = pmu;
308 cpu_pmu->plat_device = pdev;
309
273 if (node && (of_id = of_match_node(cpu_pmu_of_device_ids, pdev->dev.of_node))) { 310 if (node && (of_id = of_match_node(cpu_pmu_of_device_ids, pdev->dev.of_node))) {
274 init_fn = of_id->data; 311 init_fn = of_id->data;
275 ret = init_fn(pmu); 312 ret = init_fn(pmu);
@@ -282,8 +319,6 @@ static int cpu_pmu_device_probe(struct platform_device *pdev)
282 goto out_free; 319 goto out_free;
283 } 320 }
284 321
285 cpu_pmu = pmu;
286 cpu_pmu->plat_device = pdev;
287 cpu_pmu_init(cpu_pmu); 322 cpu_pmu_init(cpu_pmu);
288 ret = armpmu_register(cpu_pmu, PERF_TYPE_RAW); 323 ret = armpmu_register(cpu_pmu, PERF_TYPE_RAW);
289 324
diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c
index 039cffb053a7..f4ef3981ed02 100644
--- a/arch/arm/kernel/perf_event_v7.c
+++ b/arch/arm/kernel/perf_event_v7.c
@@ -18,6 +18,10 @@
18 18
19#ifdef CONFIG_CPU_V7 19#ifdef CONFIG_CPU_V7
20 20
21#include <asm/cp15.h>
22#include <asm/vfp.h>
23#include "../vfp/vfpinstr.h"
24
21/* 25/*
22 * Common ARMv7 event types 26 * Common ARMv7 event types
23 * 27 *
@@ -109,6 +113,33 @@ enum armv7_a15_perf_types {
109 ARMV7_A15_PERFCTR_PC_WRITE_SPEC = 0x76, 113 ARMV7_A15_PERFCTR_PC_WRITE_SPEC = 0x76,
110}; 114};
111 115
116/* ARMv7 Cortex-A12 specific event types */
117enum armv7_a12_perf_types {
118 ARMV7_A12_PERFCTR_L1_DCACHE_ACCESS_READ = 0x40,
119 ARMV7_A12_PERFCTR_L1_DCACHE_ACCESS_WRITE = 0x41,
120
121 ARMV7_A12_PERFCTR_L2_CACHE_ACCESS_READ = 0x50,
122 ARMV7_A12_PERFCTR_L2_CACHE_ACCESS_WRITE = 0x51,
123
124 ARMV7_A12_PERFCTR_PC_WRITE_SPEC = 0x76,
125
126 ARMV7_A12_PERFCTR_PF_TLB_REFILL = 0xe7,
127};
128
129/* ARMv7 Krait specific event types */
130enum krait_perf_types {
131 KRAIT_PMRESR0_GROUP0 = 0xcc,
132 KRAIT_PMRESR1_GROUP0 = 0xd0,
133 KRAIT_PMRESR2_GROUP0 = 0xd4,
134 KRAIT_VPMRESR0_GROUP0 = 0xd8,
135
136 KRAIT_PERFCTR_L1_ICACHE_ACCESS = 0x10011,
137 KRAIT_PERFCTR_L1_ICACHE_MISS = 0x10010,
138
139 KRAIT_PERFCTR_L1_ITLB_ACCESS = 0x12222,
140 KRAIT_PERFCTR_L1_DTLB_ACCESS = 0x12210,
141};
142
112/* 143/*
113 * Cortex-A8 HW events mapping 144 * Cortex-A8 HW events mapping
114 * 145 *
@@ -732,6 +763,262 @@ static const unsigned armv7_a7_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
732}; 763};
733 764
734/* 765/*
766 * Cortex-A12 HW events mapping
767 */
768static const unsigned armv7_a12_perf_map[PERF_COUNT_HW_MAX] = {
769 [PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES,
770 [PERF_COUNT_HW_INSTRUCTIONS] = ARMV7_PERFCTR_INSTR_EXECUTED,
771 [PERF_COUNT_HW_CACHE_REFERENCES] = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
772 [PERF_COUNT_HW_CACHE_MISSES] = ARMV7_PERFCTR_L1_DCACHE_REFILL,
773 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_A12_PERFCTR_PC_WRITE_SPEC,
774 [PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
775 [PERF_COUNT_HW_BUS_CYCLES] = ARMV7_PERFCTR_BUS_CYCLES,
776 [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = HW_OP_UNSUPPORTED,
777 [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = HW_OP_UNSUPPORTED,
778};
779
780static const unsigned armv7_a12_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
781 [PERF_COUNT_HW_CACHE_OP_MAX]
782 [PERF_COUNT_HW_CACHE_RESULT_MAX] = {
783 [C(L1D)] = {
784 [C(OP_READ)] = {
785 [C(RESULT_ACCESS)] = ARMV7_A12_PERFCTR_L1_DCACHE_ACCESS_READ,
786 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_DCACHE_REFILL,
787 },
788 [C(OP_WRITE)] = {
789 [C(RESULT_ACCESS)] = ARMV7_A12_PERFCTR_L1_DCACHE_ACCESS_WRITE,
790 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_DCACHE_REFILL,
791 },
792 [C(OP_PREFETCH)] = {
793 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
794 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
795 },
796 },
797 [C(L1I)] = {
798 /*
799 * Not all performance counters differentiate between read
800 * and write accesses/misses so we're not always strictly
801 * correct, but it's the best we can do. Writes and reads get
802 * combined in these cases.
803 */
804 [C(OP_READ)] = {
805 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_ICACHE_ACCESS,
806 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_ICACHE_REFILL,
807 },
808 [C(OP_WRITE)] = {
809 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
810 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
811 },
812 [C(OP_PREFETCH)] = {
813 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
814 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
815 },
816 },
817 [C(LL)] = {
818 [C(OP_READ)] = {
819 [C(RESULT_ACCESS)] = ARMV7_A12_PERFCTR_L2_CACHE_ACCESS_READ,
820 [C(RESULT_MISS)] = ARMV7_PERFCTR_L2_CACHE_REFILL,
821 },
822 [C(OP_WRITE)] = {
823 [C(RESULT_ACCESS)] = ARMV7_A12_PERFCTR_L2_CACHE_ACCESS_WRITE,
824 [C(RESULT_MISS)] = ARMV7_PERFCTR_L2_CACHE_REFILL,
825 },
826 [C(OP_PREFETCH)] = {
827 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
828 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
829 },
830 },
831 [C(DTLB)] = {
832 [C(OP_READ)] = {
833 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
834 [C(RESULT_MISS)] = ARMV7_PERFCTR_DTLB_REFILL,
835 },
836 [C(OP_WRITE)] = {
837 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
838 [C(RESULT_MISS)] = ARMV7_PERFCTR_DTLB_REFILL,
839 },
840 [C(OP_PREFETCH)] = {
841 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
842 [C(RESULT_MISS)] = ARMV7_A12_PERFCTR_PF_TLB_REFILL,
843 },
844 },
845 [C(ITLB)] = {
846 [C(OP_READ)] = {
847 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
848 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_REFILL,
849 },
850 [C(OP_WRITE)] = {
851 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
852 [C(RESULT_MISS)] = ARMV7_PERFCTR_ITLB_REFILL,
853 },
854 [C(OP_PREFETCH)] = {
855 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
856 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
857 },
858 },
859 [C(BPU)] = {
860 [C(OP_READ)] = {
861 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_BRANCH_PRED,
862 [C(RESULT_MISS)] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
863 },
864 [C(OP_WRITE)] = {
865 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_BRANCH_PRED,
866 [C(RESULT_MISS)] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
867 },
868 [C(OP_PREFETCH)] = {
869 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
870 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
871 },
872 },
873 [C(NODE)] = {
874 [C(OP_READ)] = {
875 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
876 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
877 },
878 [C(OP_WRITE)] = {
879 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
880 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
881 },
882 [C(OP_PREFETCH)] = {
883 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
884 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
885 },
886 },
887};
888
889/*
890 * Krait HW events mapping
891 */
892static const unsigned krait_perf_map[PERF_COUNT_HW_MAX] = {
893 [PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES,
894 [PERF_COUNT_HW_INSTRUCTIONS] = ARMV7_PERFCTR_INSTR_EXECUTED,
895 [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED,
896 [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED,
897 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = ARMV7_PERFCTR_PC_WRITE,
898 [PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
899 [PERF_COUNT_HW_BUS_CYCLES] = ARMV7_PERFCTR_CLOCK_CYCLES,
900};
901
902static const unsigned krait_perf_map_no_branch[PERF_COUNT_HW_MAX] = {
903 [PERF_COUNT_HW_CPU_CYCLES] = ARMV7_PERFCTR_CPU_CYCLES,
904 [PERF_COUNT_HW_INSTRUCTIONS] = ARMV7_PERFCTR_INSTR_EXECUTED,
905 [PERF_COUNT_HW_CACHE_REFERENCES] = HW_OP_UNSUPPORTED,
906 [PERF_COUNT_HW_CACHE_MISSES] = HW_OP_UNSUPPORTED,
907 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = HW_OP_UNSUPPORTED,
908 [PERF_COUNT_HW_BRANCH_MISSES] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
909 [PERF_COUNT_HW_BUS_CYCLES] = ARMV7_PERFCTR_CLOCK_CYCLES,
910};
911
912static const unsigned krait_perf_cache_map[PERF_COUNT_HW_CACHE_MAX]
913 [PERF_COUNT_HW_CACHE_OP_MAX]
914 [PERF_COUNT_HW_CACHE_RESULT_MAX] = {
915 [C(L1D)] = {
916 /*
917 * The performance counters don't differentiate between read
918 * and write accesses/misses so this isn't strictly correct,
919 * but it's the best we can do. Writes and reads get
920 * combined.
921 */
922 [C(OP_READ)] = {
923 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
924 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_DCACHE_REFILL,
925 },
926 [C(OP_WRITE)] = {
927 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_L1_DCACHE_ACCESS,
928 [C(RESULT_MISS)] = ARMV7_PERFCTR_L1_DCACHE_REFILL,
929 },
930 [C(OP_PREFETCH)] = {
931 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
932 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
933 },
934 },
935 [C(L1I)] = {
936 [C(OP_READ)] = {
937 [C(RESULT_ACCESS)] = KRAIT_PERFCTR_L1_ICACHE_ACCESS,
938 [C(RESULT_MISS)] = KRAIT_PERFCTR_L1_ICACHE_MISS,
939 },
940 [C(OP_WRITE)] = {
941 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
942 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
943 },
944 [C(OP_PREFETCH)] = {
945 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
946 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
947 },
948 },
949 [C(LL)] = {
950 [C(OP_READ)] = {
951 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
952 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
953 },
954 [C(OP_WRITE)] = {
955 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
956 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
957 },
958 [C(OP_PREFETCH)] = {
959 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
960 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
961 },
962 },
963 [C(DTLB)] = {
964 [C(OP_READ)] = {
965 [C(RESULT_ACCESS)] = KRAIT_PERFCTR_L1_DTLB_ACCESS,
966 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
967 },
968 [C(OP_WRITE)] = {
969 [C(RESULT_ACCESS)] = KRAIT_PERFCTR_L1_DTLB_ACCESS,
970 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
971 },
972 [C(OP_PREFETCH)] = {
973 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
974 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
975 },
976 },
977 [C(ITLB)] = {
978 [C(OP_READ)] = {
979 [C(RESULT_ACCESS)] = KRAIT_PERFCTR_L1_ITLB_ACCESS,
980 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
981 },
982 [C(OP_WRITE)] = {
983 [C(RESULT_ACCESS)] = KRAIT_PERFCTR_L1_ITLB_ACCESS,
984 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
985 },
986 [C(OP_PREFETCH)] = {
987 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
988 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
989 },
990 },
991 [C(BPU)] = {
992 [C(OP_READ)] = {
993 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_BRANCH_PRED,
994 [C(RESULT_MISS)] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
995 },
996 [C(OP_WRITE)] = {
997 [C(RESULT_ACCESS)] = ARMV7_PERFCTR_PC_BRANCH_PRED,
998 [C(RESULT_MISS)] = ARMV7_PERFCTR_PC_BRANCH_MIS_PRED,
999 },
1000 [C(OP_PREFETCH)] = {
1001 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1002 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
1003 },
1004 },
1005 [C(NODE)] = {
1006 [C(OP_READ)] = {
1007 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1008 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
1009 },
1010 [C(OP_WRITE)] = {
1011 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1012 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
1013 },
1014 [C(OP_PREFETCH)] = {
1015 [C(RESULT_ACCESS)] = CACHE_OP_UNSUPPORTED,
1016 [C(RESULT_MISS)] = CACHE_OP_UNSUPPORTED,
1017 },
1018 },
1019};
1020
1021/*
735 * Perf Events' indices 1022 * Perf Events' indices
736 */ 1023 */
737#define ARMV7_IDX_CYCLE_COUNTER 0 1024#define ARMV7_IDX_CYCLE_COUNTER 0
@@ -1212,6 +1499,24 @@ static int armv7_a7_map_event(struct perf_event *event)
1212 &armv7_a7_perf_cache_map, 0xFF); 1499 &armv7_a7_perf_cache_map, 0xFF);
1213} 1500}
1214 1501
1502static int armv7_a12_map_event(struct perf_event *event)
1503{
1504 return armpmu_map_event(event, &armv7_a12_perf_map,
1505 &armv7_a12_perf_cache_map, 0xFF);
1506}
1507
1508static int krait_map_event(struct perf_event *event)
1509{
1510 return armpmu_map_event(event, &krait_perf_map,
1511 &krait_perf_cache_map, 0xFFFFF);
1512}
1513
1514static int krait_map_event_no_branch(struct perf_event *event)
1515{
1516 return armpmu_map_event(event, &krait_perf_map_no_branch,
1517 &krait_perf_cache_map, 0xFFFFF);
1518}
1519
1215static void armv7pmu_init(struct arm_pmu *cpu_pmu) 1520static void armv7pmu_init(struct arm_pmu *cpu_pmu)
1216{ 1521{
1217 cpu_pmu->handle_irq = armv7pmu_handle_irq; 1522 cpu_pmu->handle_irq = armv7pmu_handle_irq;
@@ -1283,6 +1588,408 @@ static int armv7_a7_pmu_init(struct arm_pmu *cpu_pmu)
1283 cpu_pmu->set_event_filter = armv7pmu_set_event_filter; 1588 cpu_pmu->set_event_filter = armv7pmu_set_event_filter;
1284 return 0; 1589 return 0;
1285} 1590}
1591
1592static int armv7_a12_pmu_init(struct arm_pmu *cpu_pmu)
1593{
1594 armv7pmu_init(cpu_pmu);
1595 cpu_pmu->name = "ARMv7 Cortex-A12";
1596 cpu_pmu->map_event = armv7_a12_map_event;
1597 cpu_pmu->num_events = armv7_read_num_pmnc_events();
1598 cpu_pmu->set_event_filter = armv7pmu_set_event_filter;
1599 return 0;
1600}
1601
1602/*
1603 * Krait Performance Monitor Region Event Selection Register (PMRESRn)
1604 *
1605 * 31 30 24 16 8 0
1606 * +--------------------------------+
1607 * PMRESR0 | EN | CC | CC | CC | CC | N = 1, R = 0
1608 * +--------------------------------+
1609 * PMRESR1 | EN | CC | CC | CC | CC | N = 1, R = 1
1610 * +--------------------------------+
1611 * PMRESR2 | EN | CC | CC | CC | CC | N = 1, R = 2
1612 * +--------------------------------+
1613 * VPMRESR0 | EN | CC | CC | CC | CC | N = 2, R = ?
1614 * +--------------------------------+
1615 * EN | G=3 | G=2 | G=1 | G=0
1616 *
1617 * Event Encoding:
1618 *
1619 * hwc->config_base = 0xNRCCG
1620 *
1621 * N = prefix, 1 for Krait CPU (PMRESRn), 2 for Venum VFP (VPMRESR)
1622 * R = region register
1623 * CC = class of events the group G is choosing from
1624 * G = group or particular event
1625 *
1626 * Example: 0x12021 is a Krait CPU event in PMRESR2's group 1 with code 2
1627 *
1628 * A region (R) corresponds to a piece of the CPU (execution unit, instruction
1629 * unit, etc.) while the event code (CC) corresponds to a particular class of
1630 * events (interrupts for example). An event code is broken down into
1631 * groups (G) that can be mapped into the PMU (irq, fiqs, and irq+fiqs for
1632 * example).
1633 */
1634
1635#define KRAIT_EVENT (1 << 16)
1636#define VENUM_EVENT (2 << 16)
1637#define KRAIT_EVENT_MASK (KRAIT_EVENT | VENUM_EVENT)
1638#define PMRESRn_EN BIT(31)
1639
1640static u32 krait_read_pmresrn(int n)
1641{
1642 u32 val;
1643
1644 switch (n) {
1645 case 0:
1646 asm volatile("mrc p15, 1, %0, c9, c15, 0" : "=r" (val));
1647 break;
1648 case 1:
1649 asm volatile("mrc p15, 1, %0, c9, c15, 1" : "=r" (val));
1650 break;
1651 case 2:
1652 asm volatile("mrc p15, 1, %0, c9, c15, 2" : "=r" (val));
1653 break;
1654 default:
1655 BUG(); /* Should be validated in krait_pmu_get_event_idx() */
1656 }
1657
1658 return val;
1659}
1660
1661static void krait_write_pmresrn(int n, u32 val)
1662{
1663 switch (n) {
1664 case 0:
1665 asm volatile("mcr p15, 1, %0, c9, c15, 0" : : "r" (val));
1666 break;
1667 case 1:
1668 asm volatile("mcr p15, 1, %0, c9, c15, 1" : : "r" (val));
1669 break;
1670 case 2:
1671 asm volatile("mcr p15, 1, %0, c9, c15, 2" : : "r" (val));
1672 break;
1673 default:
1674 BUG(); /* Should be validated in krait_pmu_get_event_idx() */
1675 }
1676}
1677
1678static u32 krait_read_vpmresr0(void)
1679{
1680 u32 val;
1681 asm volatile("mrc p10, 7, %0, c11, c0, 0" : "=r" (val));
1682 return val;
1683}
1684
1685static void krait_write_vpmresr0(u32 val)
1686{
1687 asm volatile("mcr p10, 7, %0, c11, c0, 0" : : "r" (val));
1688}
1689
1690static void krait_pre_vpmresr0(u32 *venum_orig_val, u32 *fp_orig_val)
1691{
1692 u32 venum_new_val;
1693 u32 fp_new_val;
1694
1695 BUG_ON(preemptible());
1696 /* CPACR Enable CP10 and CP11 access */
1697 *venum_orig_val = get_copro_access();
1698 venum_new_val = *venum_orig_val | CPACC_SVC(10) | CPACC_SVC(11);
1699 set_copro_access(venum_new_val);
1700
1701 /* Enable FPEXC */
1702 *fp_orig_val = fmrx(FPEXC);
1703 fp_new_val = *fp_orig_val | FPEXC_EN;
1704 fmxr(FPEXC, fp_new_val);
1705}
1706
1707static void krait_post_vpmresr0(u32 venum_orig_val, u32 fp_orig_val)
1708{
1709 BUG_ON(preemptible());
1710 /* Restore FPEXC */
1711 fmxr(FPEXC, fp_orig_val);
1712 isb();
1713 /* Restore CPACR */
1714 set_copro_access(venum_orig_val);
1715}
1716
1717static u32 krait_get_pmresrn_event(unsigned int region)
1718{
1719 static const u32 pmresrn_table[] = { KRAIT_PMRESR0_GROUP0,
1720 KRAIT_PMRESR1_GROUP0,
1721 KRAIT_PMRESR2_GROUP0 };
1722 return pmresrn_table[region];
1723}
1724
1725static void krait_evt_setup(int idx, u32 config_base)
1726{
1727 u32 val;
1728 u32 mask;
1729 u32 vval, fval;
1730 unsigned int region;
1731 unsigned int group;
1732 unsigned int code;
1733 unsigned int group_shift;
1734 bool venum_event;
1735
1736 venum_event = !!(config_base & VENUM_EVENT);
1737 region = (config_base >> 12) & 0xf;
1738 code = (config_base >> 4) & 0xff;
1739 group = (config_base >> 0) & 0xf;
1740
1741 group_shift = group * 8;
1742 mask = 0xff << group_shift;
1743
1744 /* Configure evtsel for the region and group */
1745 if (venum_event)
1746 val = KRAIT_VPMRESR0_GROUP0;
1747 else
1748 val = krait_get_pmresrn_event(region);
1749 val += group;
1750 /* Mix in mode-exclusion bits */
1751 val |= config_base & (ARMV7_EXCLUDE_USER | ARMV7_EXCLUDE_PL1);
1752 armv7_pmnc_write_evtsel(idx, val);
1753
1754 asm volatile("mcr p15, 0, %0, c9, c15, 0" : : "r" (0));
1755
1756 if (venum_event) {
1757 krait_pre_vpmresr0(&vval, &fval);
1758 val = krait_read_vpmresr0();
1759 val &= ~mask;
1760 val |= code << group_shift;
1761 val |= PMRESRn_EN;
1762 krait_write_vpmresr0(val);
1763 krait_post_vpmresr0(vval, fval);
1764 } else {
1765 val = krait_read_pmresrn(region);
1766 val &= ~mask;
1767 val |= code << group_shift;
1768 val |= PMRESRn_EN;
1769 krait_write_pmresrn(region, val);
1770 }
1771}
1772
1773static u32 krait_clear_pmresrn_group(u32 val, int group)
1774{
1775 u32 mask;
1776 int group_shift;
1777
1778 group_shift = group * 8;
1779 mask = 0xff << group_shift;
1780 val &= ~mask;
1781
1782 /* Don't clear enable bit if entire region isn't disabled */
1783 if (val & ~PMRESRn_EN)
1784 return val |= PMRESRn_EN;
1785
1786 return 0;
1787}
1788
1789static void krait_clearpmu(u32 config_base)
1790{
1791 u32 val;
1792 u32 vval, fval;
1793 unsigned int region;
1794 unsigned int group;
1795 bool venum_event;
1796
1797 venum_event = !!(config_base & VENUM_EVENT);
1798 region = (config_base >> 12) & 0xf;
1799 group = (config_base >> 0) & 0xf;
1800
1801 if (venum_event) {
1802 krait_pre_vpmresr0(&vval, &fval);
1803 val = krait_read_vpmresr0();
1804 val = krait_clear_pmresrn_group(val, group);
1805 krait_write_vpmresr0(val);
1806 krait_post_vpmresr0(vval, fval);
1807 } else {
1808 val = krait_read_pmresrn(region);
1809 val = krait_clear_pmresrn_group(val, group);
1810 krait_write_pmresrn(region, val);
1811 }
1812}
1813
1814static void krait_pmu_disable_event(struct perf_event *event)
1815{
1816 unsigned long flags;
1817 struct hw_perf_event *hwc = &event->hw;
1818 int idx = hwc->idx;
1819 struct pmu_hw_events *events = cpu_pmu->get_hw_events();
1820
1821 /* Disable counter and interrupt */
1822 raw_spin_lock_irqsave(&events->pmu_lock, flags);
1823
1824 /* Disable counter */
1825 armv7_pmnc_disable_counter(idx);
1826
1827 /*
1828 * Clear pmresr code (if destined for PMNx counters)
1829 */
1830 if (hwc->config_base & KRAIT_EVENT_MASK)
1831 krait_clearpmu(hwc->config_base);
1832
1833 /* Disable interrupt for this counter */
1834 armv7_pmnc_disable_intens(idx);
1835
1836 raw_spin_unlock_irqrestore(&events->pmu_lock, flags);
1837}
1838
1839static void krait_pmu_enable_event(struct perf_event *event)
1840{
1841 unsigned long flags;
1842 struct hw_perf_event *hwc = &event->hw;
1843 int idx = hwc->idx;
1844 struct pmu_hw_events *events = cpu_pmu->get_hw_events();
1845
1846 /*
1847 * Enable counter and interrupt, and set the counter to count
1848 * the event that we're interested in.
1849 */
1850 raw_spin_lock_irqsave(&events->pmu_lock, flags);
1851
1852 /* Disable counter */
1853 armv7_pmnc_disable_counter(idx);
1854
1855 /*
1856 * Set event (if destined for PMNx counters)
1857 * We set the event for the cycle counter because we
1858 * have the ability to perform event filtering.
1859 */
1860 if (hwc->config_base & KRAIT_EVENT_MASK)
1861 krait_evt_setup(idx, hwc->config_base);
1862 else
1863 armv7_pmnc_write_evtsel(idx, hwc->config_base);
1864
1865 /* Enable interrupt for this counter */
1866 armv7_pmnc_enable_intens(idx);
1867
1868 /* Enable counter */
1869 armv7_pmnc_enable_counter(idx);
1870
1871 raw_spin_unlock_irqrestore(&events->pmu_lock, flags);
1872}
1873
1874static void krait_pmu_reset(void *info)
1875{
1876 u32 vval, fval;
1877
1878 armv7pmu_reset(info);
1879
1880 /* Clear all pmresrs */
1881 krait_write_pmresrn(0, 0);
1882 krait_write_pmresrn(1, 0);
1883 krait_write_pmresrn(2, 0);
1884
1885 krait_pre_vpmresr0(&vval, &fval);
1886 krait_write_vpmresr0(0);
1887 krait_post_vpmresr0(vval, fval);
1888}
1889
1890static int krait_event_to_bit(struct perf_event *event, unsigned int region,
1891 unsigned int group)
1892{
1893 int bit;
1894 struct hw_perf_event *hwc = &event->hw;
1895 struct arm_pmu *cpu_pmu = to_arm_pmu(event->pmu);
1896
1897 if (hwc->config_base & VENUM_EVENT)
1898 bit = KRAIT_VPMRESR0_GROUP0;
1899 else
1900 bit = krait_get_pmresrn_event(region);
1901 bit -= krait_get_pmresrn_event(0);
1902 bit += group;
1903 /*
1904 * Lower bits are reserved for use by the counters (see
1905 * armv7pmu_get_event_idx() for more info)
1906 */
1907 bit += ARMV7_IDX_COUNTER_LAST(cpu_pmu) + 1;
1908
1909 return bit;
1910}
1911
1912/*
1913 * We check for column exclusion constraints here.
1914 * Two events cant use the same group within a pmresr register.
1915 */
1916static int krait_pmu_get_event_idx(struct pmu_hw_events *cpuc,
1917 struct perf_event *event)
1918{
1919 int idx;
1920 int bit;
1921 unsigned int prefix;
1922 unsigned int region;
1923 unsigned int code;
1924 unsigned int group;
1925 bool krait_event;
1926 struct hw_perf_event *hwc = &event->hw;
1927
1928 region = (hwc->config_base >> 12) & 0xf;
1929 code = (hwc->config_base >> 4) & 0xff;
1930 group = (hwc->config_base >> 0) & 0xf;
1931 krait_event = !!(hwc->config_base & KRAIT_EVENT_MASK);
1932
1933 if (krait_event) {
1934 /* Ignore invalid events */
1935 if (group > 3 || region > 2)
1936 return -EINVAL;
1937 prefix = hwc->config_base & KRAIT_EVENT_MASK;
1938 if (prefix != KRAIT_EVENT && prefix != VENUM_EVENT)
1939 return -EINVAL;
1940 if (prefix == VENUM_EVENT && (code & 0xe0))
1941 return -EINVAL;
1942
1943 bit = krait_event_to_bit(event, region, group);
1944 if (test_and_set_bit(bit, cpuc->used_mask))
1945 return -EAGAIN;
1946 }
1947
1948 idx = armv7pmu_get_event_idx(cpuc, event);
1949 if (idx < 0 && krait_event)
1950 clear_bit(bit, cpuc->used_mask);
1951
1952 return idx;
1953}
1954
1955static void krait_pmu_clear_event_idx(struct pmu_hw_events *cpuc,
1956 struct perf_event *event)
1957{
1958 int bit;
1959 struct hw_perf_event *hwc = &event->hw;
1960 unsigned int region;
1961 unsigned int group;
1962 bool krait_event;
1963
1964 region = (hwc->config_base >> 12) & 0xf;
1965 group = (hwc->config_base >> 0) & 0xf;
1966 krait_event = !!(hwc->config_base & KRAIT_EVENT_MASK);
1967
1968 if (krait_event) {
1969 bit = krait_event_to_bit(event, region, group);
1970 clear_bit(bit, cpuc->used_mask);
1971 }
1972}
1973
1974static int krait_pmu_init(struct arm_pmu *cpu_pmu)
1975{
1976 armv7pmu_init(cpu_pmu);
1977 cpu_pmu->name = "ARMv7 Krait";
1978 /* Some early versions of Krait don't support PC write events */
1979 if (of_property_read_bool(cpu_pmu->plat_device->dev.of_node,
1980 "qcom,no-pc-write"))
1981 cpu_pmu->map_event = krait_map_event_no_branch;
1982 else
1983 cpu_pmu->map_event = krait_map_event;
1984 cpu_pmu->num_events = armv7_read_num_pmnc_events();
1985 cpu_pmu->set_event_filter = armv7pmu_set_event_filter;
1986 cpu_pmu->reset = krait_pmu_reset;
1987 cpu_pmu->enable = krait_pmu_enable_event;
1988 cpu_pmu->disable = krait_pmu_disable_event;
1989 cpu_pmu->get_event_idx = krait_pmu_get_event_idx;
1990 cpu_pmu->clear_event_idx = krait_pmu_clear_event_idx;
1991 return 0;
1992}
1286#else 1993#else
1287static inline int armv7_a8_pmu_init(struct arm_pmu *cpu_pmu) 1994static inline int armv7_a8_pmu_init(struct arm_pmu *cpu_pmu)
1288{ 1995{
@@ -1308,4 +2015,14 @@ static inline int armv7_a7_pmu_init(struct arm_pmu *cpu_pmu)
1308{ 2015{
1309 return -ENODEV; 2016 return -ENODEV;
1310} 2017}
2018
2019static inline int armv7_a12_pmu_init(struct arm_pmu *cpu_pmu)
2020{
2021 return -ENODEV;
2022}
2023
2024static inline int krait_pmu_init(struct arm_pmu *cpu_pmu)
2025{
2026 return -ENODEV;
2027}
1311#endif /* CONFIG_CPU_V7 */ 2028#endif /* CONFIG_CPU_V7 */
diff --git a/arch/arm/kernel/pj4-cp0.c b/arch/arm/kernel/pj4-cp0.c
index 679cf4d18c08..fc7208636284 100644
--- a/arch/arm/kernel/pj4-cp0.c
+++ b/arch/arm/kernel/pj4-cp0.c
@@ -17,6 +17,7 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <asm/thread_notify.h> 19#include <asm/thread_notify.h>
20#include <asm/cputype.h>
20 21
21static int iwmmxt_do(struct notifier_block *self, unsigned long cmd, void *t) 22static int iwmmxt_do(struct notifier_block *self, unsigned long cmd, void *t)
22{ 23{
@@ -80,6 +81,9 @@ static int __init pj4_cp0_init(void)
80{ 81{
81 u32 cp_access; 82 u32 cp_access;
82 83
84 if (!cpu_is_pj4())
85 return 0;
86
83 cp_access = pj4_cp_access_read() & ~0xf; 87 cp_access = pj4_cp_access_read() & ~0xf;
84 pj4_cp_access_write(cp_access); 88 pj4_cp_access_write(cp_access);
85 89
diff --git a/arch/arm/kernel/probes-arm.c b/arch/arm/kernel/probes-arm.c
new file mode 100644
index 000000000000..51a13a027989
--- /dev/null
+++ b/arch/arm/kernel/probes-arm.c
@@ -0,0 +1,734 @@
1/*
2 * arch/arm/kernel/probes-arm.c
3 *
4 * Some code moved here from arch/arm/kernel/kprobes-arm.c
5 *
6 * Copyright (C) 2006, 2007 Motorola 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 * 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 GNU
15 * General Public License for more details.
16 */
17
18#include <linux/kernel.h>
19#include <linux/module.h>
20#include <linux/stddef.h>
21#include <linux/ptrace.h>
22
23#include "probes.h"
24#include "probes-arm.h"
25
26#define sign_extend(x, signbit) ((x) | (0 - ((x) & (1 << (signbit)))))
27
28#define branch_displacement(insn) sign_extend(((insn) & 0xffffff) << 2, 25)
29
30/*
31 * To avoid the complications of mimicing single-stepping on a
32 * processor without a Next-PC or a single-step mode, and to
33 * avoid having to deal with the side-effects of boosting, we
34 * simulate or emulate (almost) all ARM instructions.
35 *
36 * "Simulation" is where the instruction's behavior is duplicated in
37 * C code. "Emulation" is where the original instruction is rewritten
38 * and executed, often by altering its registers.
39 *
40 * By having all behavior of the kprobe'd instruction completed before
41 * returning from the kprobe_handler(), all locks (scheduler and
42 * interrupt) can safely be released. There is no need for secondary
43 * breakpoints, no race with MP or preemptable kernels, nor having to
44 * clean up resources counts at a later time impacting overall system
45 * performance. By rewriting the instruction, only the minimum registers
46 * need to be loaded and saved back optimizing performance.
47 *
48 * Calling the insnslot_*_rwflags version of a function doesn't hurt
49 * anything even when the CPSR flags aren't updated by the
50 * instruction. It's just a little slower in return for saving
51 * a little space by not having a duplicate function that doesn't
52 * update the flags. (The same optimization can be said for
53 * instructions that do or don't perform register writeback)
54 * Also, instructions can either read the flags, only write the
55 * flags, or read and write the flags. To save combinations
56 * rather than for sheer performance, flag functions just assume
57 * read and write of flags.
58 */
59
60void __kprobes simulate_bbl(probes_opcode_t insn,
61 struct arch_probes_insn *asi, struct pt_regs *regs)
62{
63 long iaddr = (long) regs->ARM_pc - 4;
64 int disp = branch_displacement(insn);
65
66 if (insn & (1 << 24))
67 regs->ARM_lr = iaddr + 4;
68
69 regs->ARM_pc = iaddr + 8 + disp;
70}
71
72void __kprobes simulate_blx1(probes_opcode_t insn,
73 struct arch_probes_insn *asi, struct pt_regs *regs)
74{
75 long iaddr = (long) regs->ARM_pc - 4;
76 int disp = branch_displacement(insn);
77
78 regs->ARM_lr = iaddr + 4;
79 regs->ARM_pc = iaddr + 8 + disp + ((insn >> 23) & 0x2);
80 regs->ARM_cpsr |= PSR_T_BIT;
81}
82
83void __kprobes simulate_blx2bx(probes_opcode_t insn,
84 struct arch_probes_insn *asi, struct pt_regs *regs)
85{
86 int rm = insn & 0xf;
87 long rmv = regs->uregs[rm];
88
89 if (insn & (1 << 5))
90 regs->ARM_lr = (long) regs->ARM_pc;
91
92 regs->ARM_pc = rmv & ~0x1;
93 regs->ARM_cpsr &= ~PSR_T_BIT;
94 if (rmv & 0x1)
95 regs->ARM_cpsr |= PSR_T_BIT;
96}
97
98void __kprobes simulate_mrs(probes_opcode_t insn,
99 struct arch_probes_insn *asi, struct pt_regs *regs)
100{
101 int rd = (insn >> 12) & 0xf;
102 unsigned long mask = 0xf8ff03df; /* Mask out execution state */
103 regs->uregs[rd] = regs->ARM_cpsr & mask;
104}
105
106void __kprobes simulate_mov_ipsp(probes_opcode_t insn,
107 struct arch_probes_insn *asi, struct pt_regs *regs)
108{
109 regs->uregs[12] = regs->uregs[13];
110}
111
112/*
113 * For the instruction masking and comparisons in all the "space_*"
114 * functions below, Do _not_ rearrange the order of tests unless
115 * you're very, very sure of what you are doing. For the sake of
116 * efficiency, the masks for some tests sometimes assume other test
117 * have been done prior to them so the number of patterns to test
118 * for an instruction set can be as broad as possible to reduce the
119 * number of tests needed.
120 */
121
122static const union decode_item arm_1111_table[] = {
123 /* Unconditional instructions */
124
125 /* memory hint 1111 0100 x001 xxxx xxxx xxxx xxxx xxxx */
126 /* PLDI (immediate) 1111 0100 x101 xxxx xxxx xxxx xxxx xxxx */
127 /* PLDW (immediate) 1111 0101 x001 xxxx xxxx xxxx xxxx xxxx */
128 /* PLD (immediate) 1111 0101 x101 xxxx xxxx xxxx xxxx xxxx */
129 DECODE_SIMULATE (0xfe300000, 0xf4100000, PROBES_PRELOAD_IMM),
130
131 /* memory hint 1111 0110 x001 xxxx xxxx xxxx xxx0 xxxx */
132 /* PLDI (register) 1111 0110 x101 xxxx xxxx xxxx xxx0 xxxx */
133 /* PLDW (register) 1111 0111 x001 xxxx xxxx xxxx xxx0 xxxx */
134 /* PLD (register) 1111 0111 x101 xxxx xxxx xxxx xxx0 xxxx */
135 DECODE_SIMULATE (0xfe300010, 0xf6100000, PROBES_PRELOAD_REG),
136
137 /* BLX (immediate) 1111 101x xxxx xxxx xxxx xxxx xxxx xxxx */
138 DECODE_SIMULATE (0xfe000000, 0xfa000000, PROBES_BRANCH_IMM),
139
140 /* CPS 1111 0001 0000 xxx0 xxxx xxxx xx0x xxxx */
141 /* SETEND 1111 0001 0000 0001 xxxx xxxx 0000 xxxx */
142 /* SRS 1111 100x x1x0 xxxx xxxx xxxx xxxx xxxx */
143 /* RFE 1111 100x x0x1 xxxx xxxx xxxx xxxx xxxx */
144
145 /* Coprocessor instructions... */
146 /* MCRR2 1111 1100 0100 xxxx xxxx xxxx xxxx xxxx */
147 /* MRRC2 1111 1100 0101 xxxx xxxx xxxx xxxx xxxx */
148 /* LDC2 1111 110x xxx1 xxxx xxxx xxxx xxxx xxxx */
149 /* STC2 1111 110x xxx0 xxxx xxxx xxxx xxxx xxxx */
150 /* CDP2 1111 1110 xxxx xxxx xxxx xxxx xxx0 xxxx */
151 /* MCR2 1111 1110 xxx0 xxxx xxxx xxxx xxx1 xxxx */
152 /* MRC2 1111 1110 xxx1 xxxx xxxx xxxx xxx1 xxxx */
153
154 /* Other unallocated instructions... */
155 DECODE_END
156};
157
158static const union decode_item arm_cccc_0001_0xx0____0xxx_table[] = {
159 /* Miscellaneous instructions */
160
161 /* MRS cpsr cccc 0001 0000 xxxx xxxx xxxx 0000 xxxx */
162 DECODE_SIMULATEX(0x0ff000f0, 0x01000000, PROBES_MRS,
163 REGS(0, NOPC, 0, 0, 0)),
164
165 /* BX cccc 0001 0010 xxxx xxxx xxxx 0001 xxxx */
166 DECODE_SIMULATE (0x0ff000f0, 0x01200010, PROBES_BRANCH_REG),
167
168 /* BLX (register) cccc 0001 0010 xxxx xxxx xxxx 0011 xxxx */
169 DECODE_SIMULATEX(0x0ff000f0, 0x01200030, PROBES_BRANCH_REG,
170 REGS(0, 0, 0, 0, NOPC)),
171
172 /* CLZ cccc 0001 0110 xxxx xxxx xxxx 0001 xxxx */
173 DECODE_EMULATEX (0x0ff000f0, 0x01600010, PROBES_CLZ,
174 REGS(0, NOPC, 0, 0, NOPC)),
175
176 /* QADD cccc 0001 0000 xxxx xxxx xxxx 0101 xxxx */
177 /* QSUB cccc 0001 0010 xxxx xxxx xxxx 0101 xxxx */
178 /* QDADD cccc 0001 0100 xxxx xxxx xxxx 0101 xxxx */
179 /* QDSUB cccc 0001 0110 xxxx xxxx xxxx 0101 xxxx */
180 DECODE_EMULATEX (0x0f9000f0, 0x01000050, PROBES_SATURATING_ARITHMETIC,
181 REGS(NOPC, NOPC, 0, 0, NOPC)),
182
183 /* BXJ cccc 0001 0010 xxxx xxxx xxxx 0010 xxxx */
184 /* MSR cccc 0001 0x10 xxxx xxxx xxxx 0000 xxxx */
185 /* MRS spsr cccc 0001 0100 xxxx xxxx xxxx 0000 xxxx */
186 /* BKPT 1110 0001 0010 xxxx xxxx xxxx 0111 xxxx */
187 /* SMC cccc 0001 0110 xxxx xxxx xxxx 0111 xxxx */
188 /* And unallocated instructions... */
189 DECODE_END
190};
191
192static const union decode_item arm_cccc_0001_0xx0____1xx0_table[] = {
193 /* Halfword multiply and multiply-accumulate */
194
195 /* SMLALxy cccc 0001 0100 xxxx xxxx xxxx 1xx0 xxxx */
196 DECODE_EMULATEX (0x0ff00090, 0x01400080, PROBES_MUL1,
197 REGS(NOPC, NOPC, NOPC, 0, NOPC)),
198
199 /* SMULWy cccc 0001 0010 xxxx xxxx xxxx 1x10 xxxx */
200 DECODE_OR (0x0ff000b0, 0x012000a0),
201 /* SMULxy cccc 0001 0110 xxxx xxxx xxxx 1xx0 xxxx */
202 DECODE_EMULATEX (0x0ff00090, 0x01600080, PROBES_MUL2,
203 REGS(NOPC, 0, NOPC, 0, NOPC)),
204
205 /* SMLAxy cccc 0001 0000 xxxx xxxx xxxx 1xx0 xxxx */
206 DECODE_OR (0x0ff00090, 0x01000080),
207 /* SMLAWy cccc 0001 0010 xxxx xxxx xxxx 1x00 xxxx */
208 DECODE_EMULATEX (0x0ff000b0, 0x01200080, PROBES_MUL2,
209 REGS(NOPC, NOPC, NOPC, 0, NOPC)),
210
211 DECODE_END
212};
213
214static const union decode_item arm_cccc_0000_____1001_table[] = {
215 /* Multiply and multiply-accumulate */
216
217 /* MUL cccc 0000 0000 xxxx xxxx xxxx 1001 xxxx */
218 /* MULS cccc 0000 0001 xxxx xxxx xxxx 1001 xxxx */
219 DECODE_EMULATEX (0x0fe000f0, 0x00000090, PROBES_MUL2,
220 REGS(NOPC, 0, NOPC, 0, NOPC)),
221
222 /* MLA cccc 0000 0010 xxxx xxxx xxxx 1001 xxxx */
223 /* MLAS cccc 0000 0011 xxxx xxxx xxxx 1001 xxxx */
224 DECODE_OR (0x0fe000f0, 0x00200090),
225 /* MLS cccc 0000 0110 xxxx xxxx xxxx 1001 xxxx */
226 DECODE_EMULATEX (0x0ff000f0, 0x00600090, PROBES_MUL2,
227 REGS(NOPC, NOPC, NOPC, 0, NOPC)),
228
229 /* UMAAL cccc 0000 0100 xxxx xxxx xxxx 1001 xxxx */
230 DECODE_OR (0x0ff000f0, 0x00400090),
231 /* UMULL cccc 0000 1000 xxxx xxxx xxxx 1001 xxxx */
232 /* UMULLS cccc 0000 1001 xxxx xxxx xxxx 1001 xxxx */
233 /* UMLAL cccc 0000 1010 xxxx xxxx xxxx 1001 xxxx */
234 /* UMLALS cccc 0000 1011 xxxx xxxx xxxx 1001 xxxx */
235 /* SMULL cccc 0000 1100 xxxx xxxx xxxx 1001 xxxx */
236 /* SMULLS cccc 0000 1101 xxxx xxxx xxxx 1001 xxxx */
237 /* SMLAL cccc 0000 1110 xxxx xxxx xxxx 1001 xxxx */
238 /* SMLALS cccc 0000 1111 xxxx xxxx xxxx 1001 xxxx */
239 DECODE_EMULATEX (0x0f8000f0, 0x00800090, PROBES_MUL1,
240 REGS(NOPC, NOPC, NOPC, 0, NOPC)),
241
242 DECODE_END
243};
244
245static const union decode_item arm_cccc_0001_____1001_table[] = {
246 /* Synchronization primitives */
247
248#if __LINUX_ARM_ARCH__ < 6
249 /* Deprecated on ARMv6 and may be UNDEFINED on v7 */
250 /* SMP/SWPB cccc 0001 0x00 xxxx xxxx xxxx 1001 xxxx */
251 DECODE_EMULATEX (0x0fb000f0, 0x01000090, PROBES_SWP,
252 REGS(NOPC, NOPC, 0, 0, NOPC)),
253#endif
254 /* LDREX/STREX{,D,B,H} cccc 0001 1xxx xxxx xxxx xxxx 1001 xxxx */
255 /* And unallocated instructions... */
256 DECODE_END
257};
258
259static const union decode_item arm_cccc_000x_____1xx1_table[] = {
260 /* Extra load/store instructions */
261
262 /* STRHT cccc 0000 xx10 xxxx xxxx xxxx 1011 xxxx */
263 /* ??? cccc 0000 xx10 xxxx xxxx xxxx 11x1 xxxx */
264 /* LDRHT cccc 0000 xx11 xxxx xxxx xxxx 1011 xxxx */
265 /* LDRSBT cccc 0000 xx11 xxxx xxxx xxxx 1101 xxxx */
266 /* LDRSHT cccc 0000 xx11 xxxx xxxx xxxx 1111 xxxx */
267 DECODE_REJECT (0x0f200090, 0x00200090),
268
269 /* LDRD/STRD lr,pc,{... cccc 000x x0x0 xxxx 111x xxxx 1101 xxxx */
270 DECODE_REJECT (0x0e10e0d0, 0x0000e0d0),
271
272 /* LDRD (register) cccc 000x x0x0 xxxx xxxx xxxx 1101 xxxx */
273 /* STRD (register) cccc 000x x0x0 xxxx xxxx xxxx 1111 xxxx */
274 DECODE_EMULATEX (0x0e5000d0, 0x000000d0, PROBES_LDRSTRD,
275 REGS(NOPCWB, NOPCX, 0, 0, NOPC)),
276
277 /* LDRD (immediate) cccc 000x x1x0 xxxx xxxx xxxx 1101 xxxx */
278 /* STRD (immediate) cccc 000x x1x0 xxxx xxxx xxxx 1111 xxxx */
279 DECODE_EMULATEX (0x0e5000d0, 0x004000d0, PROBES_LDRSTRD,
280 REGS(NOPCWB, NOPCX, 0, 0, 0)),
281
282 /* STRH (register) cccc 000x x0x0 xxxx xxxx xxxx 1011 xxxx */
283 DECODE_EMULATEX (0x0e5000f0, 0x000000b0, PROBES_STORE_EXTRA,
284 REGS(NOPCWB, NOPC, 0, 0, NOPC)),
285
286 /* LDRH (register) cccc 000x x0x1 xxxx xxxx xxxx 1011 xxxx */
287 /* LDRSB (register) cccc 000x x0x1 xxxx xxxx xxxx 1101 xxxx */
288 /* LDRSH (register) cccc 000x x0x1 xxxx xxxx xxxx 1111 xxxx */
289 DECODE_EMULATEX (0x0e500090, 0x00100090, PROBES_LOAD_EXTRA,
290 REGS(NOPCWB, NOPC, 0, 0, NOPC)),
291
292 /* STRH (immediate) cccc 000x x1x0 xxxx xxxx xxxx 1011 xxxx */
293 DECODE_EMULATEX (0x0e5000f0, 0x004000b0, PROBES_STORE_EXTRA,
294 REGS(NOPCWB, NOPC, 0, 0, 0)),
295
296 /* LDRH (immediate) cccc 000x x1x1 xxxx xxxx xxxx 1011 xxxx */
297 /* LDRSB (immediate) cccc 000x x1x1 xxxx xxxx xxxx 1101 xxxx */
298 /* LDRSH (immediate) cccc 000x x1x1 xxxx xxxx xxxx 1111 xxxx */
299 DECODE_EMULATEX (0x0e500090, 0x00500090, PROBES_LOAD_EXTRA,
300 REGS(NOPCWB, NOPC, 0, 0, 0)),
301
302 DECODE_END
303};
304
305static const union decode_item arm_cccc_000x_table[] = {
306 /* Data-processing (register) */
307
308 /* <op>S PC, ... cccc 000x xxx1 xxxx 1111 xxxx xxxx xxxx */
309 DECODE_REJECT (0x0e10f000, 0x0010f000),
310
311 /* MOV IP, SP 1110 0001 1010 0000 1100 0000 0000 1101 */
312 DECODE_SIMULATE (0xffffffff, 0xe1a0c00d, PROBES_MOV_IP_SP),
313
314 /* TST (register) cccc 0001 0001 xxxx xxxx xxxx xxx0 xxxx */
315 /* TEQ (register) cccc 0001 0011 xxxx xxxx xxxx xxx0 xxxx */
316 /* CMP (register) cccc 0001 0101 xxxx xxxx xxxx xxx0 xxxx */
317 /* CMN (register) cccc 0001 0111 xxxx xxxx xxxx xxx0 xxxx */
318 DECODE_EMULATEX (0x0f900010, 0x01100000, PROBES_DATA_PROCESSING_REG,
319 REGS(ANY, 0, 0, 0, ANY)),
320
321 /* MOV (register) cccc 0001 101x xxxx xxxx xxxx xxx0 xxxx */
322 /* MVN (register) cccc 0001 111x xxxx xxxx xxxx xxx0 xxxx */
323 DECODE_EMULATEX (0x0fa00010, 0x01a00000, PROBES_DATA_PROCESSING_REG,
324 REGS(0, ANY, 0, 0, ANY)),
325
326 /* AND (register) cccc 0000 000x xxxx xxxx xxxx xxx0 xxxx */
327 /* EOR (register) cccc 0000 001x xxxx xxxx xxxx xxx0 xxxx */
328 /* SUB (register) cccc 0000 010x xxxx xxxx xxxx xxx0 xxxx */
329 /* RSB (register) cccc 0000 011x xxxx xxxx xxxx xxx0 xxxx */
330 /* ADD (register) cccc 0000 100x xxxx xxxx xxxx xxx0 xxxx */
331 /* ADC (register) cccc 0000 101x xxxx xxxx xxxx xxx0 xxxx */
332 /* SBC (register) cccc 0000 110x xxxx xxxx xxxx xxx0 xxxx */
333 /* RSC (register) cccc 0000 111x xxxx xxxx xxxx xxx0 xxxx */
334 /* ORR (register) cccc 0001 100x xxxx xxxx xxxx xxx0 xxxx */
335 /* BIC (register) cccc 0001 110x xxxx xxxx xxxx xxx0 xxxx */
336 DECODE_EMULATEX (0x0e000010, 0x00000000, PROBES_DATA_PROCESSING_REG,
337 REGS(ANY, ANY, 0, 0, ANY)),
338
339 /* TST (reg-shift reg) cccc 0001 0001 xxxx xxxx xxxx 0xx1 xxxx */
340 /* TEQ (reg-shift reg) cccc 0001 0011 xxxx xxxx xxxx 0xx1 xxxx */
341 /* CMP (reg-shift reg) cccc 0001 0101 xxxx xxxx xxxx 0xx1 xxxx */
342 /* CMN (reg-shift reg) cccc 0001 0111 xxxx xxxx xxxx 0xx1 xxxx */
343 DECODE_EMULATEX (0x0f900090, 0x01100010, PROBES_DATA_PROCESSING_REG,
344 REGS(ANY, 0, NOPC, 0, ANY)),
345
346 /* MOV (reg-shift reg) cccc 0001 101x xxxx xxxx xxxx 0xx1 xxxx */
347 /* MVN (reg-shift reg) cccc 0001 111x xxxx xxxx xxxx 0xx1 xxxx */
348 DECODE_EMULATEX (0x0fa00090, 0x01a00010, PROBES_DATA_PROCESSING_REG,
349 REGS(0, ANY, NOPC, 0, ANY)),
350
351 /* AND (reg-shift reg) cccc 0000 000x xxxx xxxx xxxx 0xx1 xxxx */
352 /* EOR (reg-shift reg) cccc 0000 001x xxxx xxxx xxxx 0xx1 xxxx */
353 /* SUB (reg-shift reg) cccc 0000 010x xxxx xxxx xxxx 0xx1 xxxx */
354 /* RSB (reg-shift reg) cccc 0000 011x xxxx xxxx xxxx 0xx1 xxxx */
355 /* ADD (reg-shift reg) cccc 0000 100x xxxx xxxx xxxx 0xx1 xxxx */
356 /* ADC (reg-shift reg) cccc 0000 101x xxxx xxxx xxxx 0xx1 xxxx */
357 /* SBC (reg-shift reg) cccc 0000 110x xxxx xxxx xxxx 0xx1 xxxx */
358 /* RSC (reg-shift reg) cccc 0000 111x xxxx xxxx xxxx 0xx1 xxxx */
359 /* ORR (reg-shift reg) cccc 0001 100x xxxx xxxx xxxx 0xx1 xxxx */
360 /* BIC (reg-shift reg) cccc 0001 110x xxxx xxxx xxxx 0xx1 xxxx */
361 DECODE_EMULATEX (0x0e000090, 0x00000010, PROBES_DATA_PROCESSING_REG,
362 REGS(ANY, ANY, NOPC, 0, ANY)),
363
364 DECODE_END
365};
366
367static const union decode_item arm_cccc_001x_table[] = {
368 /* Data-processing (immediate) */
369
370 /* MOVW cccc 0011 0000 xxxx xxxx xxxx xxxx xxxx */
371 /* MOVT cccc 0011 0100 xxxx xxxx xxxx xxxx xxxx */
372 DECODE_EMULATEX (0x0fb00000, 0x03000000, PROBES_DATA_PROCESSING_IMM,
373 REGS(0, NOPC, 0, 0, 0)),
374
375 /* YIELD cccc 0011 0010 0000 xxxx xxxx 0000 0001 */
376 DECODE_OR (0x0fff00ff, 0x03200001),
377 /* SEV cccc 0011 0010 0000 xxxx xxxx 0000 0100 */
378 DECODE_EMULATE (0x0fff00ff, 0x03200004, PROBES_EMULATE_NONE),
379 /* NOP cccc 0011 0010 0000 xxxx xxxx 0000 0000 */
380 /* WFE cccc 0011 0010 0000 xxxx xxxx 0000 0010 */
381 /* WFI cccc 0011 0010 0000 xxxx xxxx 0000 0011 */
382 DECODE_SIMULATE (0x0fff00fc, 0x03200000, PROBES_SIMULATE_NOP),
383 /* DBG cccc 0011 0010 0000 xxxx xxxx ffff xxxx */
384 /* unallocated hints cccc 0011 0010 0000 xxxx xxxx xxxx xxxx */
385 /* MSR (immediate) cccc 0011 0x10 xxxx xxxx xxxx xxxx xxxx */
386 DECODE_REJECT (0x0fb00000, 0x03200000),
387
388 /* <op>S PC, ... cccc 001x xxx1 xxxx 1111 xxxx xxxx xxxx */
389 DECODE_REJECT (0x0e10f000, 0x0210f000),
390
391 /* TST (immediate) cccc 0011 0001 xxxx xxxx xxxx xxxx xxxx */
392 /* TEQ (immediate) cccc 0011 0011 xxxx xxxx xxxx xxxx xxxx */
393 /* CMP (immediate) cccc 0011 0101 xxxx xxxx xxxx xxxx xxxx */
394 /* CMN (immediate) cccc 0011 0111 xxxx xxxx xxxx xxxx xxxx */
395 DECODE_EMULATEX (0x0f900000, 0x03100000, PROBES_DATA_PROCESSING_IMM,
396 REGS(ANY, 0, 0, 0, 0)),
397
398 /* MOV (immediate) cccc 0011 101x xxxx xxxx xxxx xxxx xxxx */
399 /* MVN (immediate) cccc 0011 111x xxxx xxxx xxxx xxxx xxxx */
400 DECODE_EMULATEX (0x0fa00000, 0x03a00000, PROBES_DATA_PROCESSING_IMM,
401 REGS(0, ANY, 0, 0, 0)),
402
403 /* AND (immediate) cccc 0010 000x xxxx xxxx xxxx xxxx xxxx */
404 /* EOR (immediate) cccc 0010 001x xxxx xxxx xxxx xxxx xxxx */
405 /* SUB (immediate) cccc 0010 010x xxxx xxxx xxxx xxxx xxxx */
406 /* RSB (immediate) cccc 0010 011x xxxx xxxx xxxx xxxx xxxx */
407 /* ADD (immediate) cccc 0010 100x xxxx xxxx xxxx xxxx xxxx */
408 /* ADC (immediate) cccc 0010 101x xxxx xxxx xxxx xxxx xxxx */
409 /* SBC (immediate) cccc 0010 110x xxxx xxxx xxxx xxxx xxxx */
410 /* RSC (immediate) cccc 0010 111x xxxx xxxx xxxx xxxx xxxx */
411 /* ORR (immediate) cccc 0011 100x xxxx xxxx xxxx xxxx xxxx */
412 /* BIC (immediate) cccc 0011 110x xxxx xxxx xxxx xxxx xxxx */
413 DECODE_EMULATEX (0x0e000000, 0x02000000, PROBES_DATA_PROCESSING_IMM,
414 REGS(ANY, ANY, 0, 0, 0)),
415
416 DECODE_END
417};
418
419static const union decode_item arm_cccc_0110_____xxx1_table[] = {
420 /* Media instructions */
421
422 /* SEL cccc 0110 1000 xxxx xxxx xxxx 1011 xxxx */
423 DECODE_EMULATEX (0x0ff000f0, 0x068000b0, PROBES_SATURATE,
424 REGS(NOPC, NOPC, 0, 0, NOPC)),
425
426 /* SSAT cccc 0110 101x xxxx xxxx xxxx xx01 xxxx */
427 /* USAT cccc 0110 111x xxxx xxxx xxxx xx01 xxxx */
428 DECODE_OR(0x0fa00030, 0x06a00010),
429 /* SSAT16 cccc 0110 1010 xxxx xxxx xxxx 0011 xxxx */
430 /* USAT16 cccc 0110 1110 xxxx xxxx xxxx 0011 xxxx */
431 DECODE_EMULATEX (0x0fb000f0, 0x06a00030, PROBES_SATURATE,
432 REGS(0, NOPC, 0, 0, NOPC)),
433
434 /* REV cccc 0110 1011 xxxx xxxx xxxx 0011 xxxx */
435 /* REV16 cccc 0110 1011 xxxx xxxx xxxx 1011 xxxx */
436 /* RBIT cccc 0110 1111 xxxx xxxx xxxx 0011 xxxx */
437 /* REVSH cccc 0110 1111 xxxx xxxx xxxx 1011 xxxx */
438 DECODE_EMULATEX (0x0fb00070, 0x06b00030, PROBES_REV,
439 REGS(0, NOPC, 0, 0, NOPC)),
440
441 /* ??? cccc 0110 0x00 xxxx xxxx xxxx xxx1 xxxx */
442 DECODE_REJECT (0x0fb00010, 0x06000010),
443 /* ??? cccc 0110 0xxx xxxx xxxx xxxx 1011 xxxx */
444 DECODE_REJECT (0x0f8000f0, 0x060000b0),
445 /* ??? cccc 0110 0xxx xxxx xxxx xxxx 1101 xxxx */
446 DECODE_REJECT (0x0f8000f0, 0x060000d0),
447 /* SADD16 cccc 0110 0001 xxxx xxxx xxxx 0001 xxxx */
448 /* SADDSUBX cccc 0110 0001 xxxx xxxx xxxx 0011 xxxx */
449 /* SSUBADDX cccc 0110 0001 xxxx xxxx xxxx 0101 xxxx */
450 /* SSUB16 cccc 0110 0001 xxxx xxxx xxxx 0111 xxxx */
451 /* SADD8 cccc 0110 0001 xxxx xxxx xxxx 1001 xxxx */
452 /* SSUB8 cccc 0110 0001 xxxx xxxx xxxx 1111 xxxx */
453 /* QADD16 cccc 0110 0010 xxxx xxxx xxxx 0001 xxxx */
454 /* QADDSUBX cccc 0110 0010 xxxx xxxx xxxx 0011 xxxx */
455 /* QSUBADDX cccc 0110 0010 xxxx xxxx xxxx 0101 xxxx */
456 /* QSUB16 cccc 0110 0010 xxxx xxxx xxxx 0111 xxxx */
457 /* QADD8 cccc 0110 0010 xxxx xxxx xxxx 1001 xxxx */
458 /* QSUB8 cccc 0110 0010 xxxx xxxx xxxx 1111 xxxx */
459 /* SHADD16 cccc 0110 0011 xxxx xxxx xxxx 0001 xxxx */
460 /* SHADDSUBX cccc 0110 0011 xxxx xxxx xxxx 0011 xxxx */
461 /* SHSUBADDX cccc 0110 0011 xxxx xxxx xxxx 0101 xxxx */
462 /* SHSUB16 cccc 0110 0011 xxxx xxxx xxxx 0111 xxxx */
463 /* SHADD8 cccc 0110 0011 xxxx xxxx xxxx 1001 xxxx */
464 /* SHSUB8 cccc 0110 0011 xxxx xxxx xxxx 1111 xxxx */
465 /* UADD16 cccc 0110 0101 xxxx xxxx xxxx 0001 xxxx */
466 /* UADDSUBX cccc 0110 0101 xxxx xxxx xxxx 0011 xxxx */
467 /* USUBADDX cccc 0110 0101 xxxx xxxx xxxx 0101 xxxx */
468 /* USUB16 cccc 0110 0101 xxxx xxxx xxxx 0111 xxxx */
469 /* UADD8 cccc 0110 0101 xxxx xxxx xxxx 1001 xxxx */
470 /* USUB8 cccc 0110 0101 xxxx xxxx xxxx 1111 xxxx */
471 /* UQADD16 cccc 0110 0110 xxxx xxxx xxxx 0001 xxxx */
472 /* UQADDSUBX cccc 0110 0110 xxxx xxxx xxxx 0011 xxxx */
473 /* UQSUBADDX cccc 0110 0110 xxxx xxxx xxxx 0101 xxxx */
474 /* UQSUB16 cccc 0110 0110 xxxx xxxx xxxx 0111 xxxx */
475 /* UQADD8 cccc 0110 0110 xxxx xxxx xxxx 1001 xxxx */
476 /* UQSUB8 cccc 0110 0110 xxxx xxxx xxxx 1111 xxxx */
477 /* UHADD16 cccc 0110 0111 xxxx xxxx xxxx 0001 xxxx */
478 /* UHADDSUBX cccc 0110 0111 xxxx xxxx xxxx 0011 xxxx */
479 /* UHSUBADDX cccc 0110 0111 xxxx xxxx xxxx 0101 xxxx */
480 /* UHSUB16 cccc 0110 0111 xxxx xxxx xxxx 0111 xxxx */
481 /* UHADD8 cccc 0110 0111 xxxx xxxx xxxx 1001 xxxx */
482 /* UHSUB8 cccc 0110 0111 xxxx xxxx xxxx 1111 xxxx */
483 DECODE_EMULATEX (0x0f800010, 0x06000010, PROBES_MMI,
484 REGS(NOPC, NOPC, 0, 0, NOPC)),
485
486 /* PKHBT cccc 0110 1000 xxxx xxxx xxxx x001 xxxx */
487 /* PKHTB cccc 0110 1000 xxxx xxxx xxxx x101 xxxx */
488 DECODE_EMULATEX (0x0ff00030, 0x06800010, PROBES_PACK,
489 REGS(NOPC, NOPC, 0, 0, NOPC)),
490
491 /* ??? cccc 0110 1001 xxxx xxxx xxxx 0111 xxxx */
492 /* ??? cccc 0110 1101 xxxx xxxx xxxx 0111 xxxx */
493 DECODE_REJECT (0x0fb000f0, 0x06900070),
494
495 /* SXTB16 cccc 0110 1000 1111 xxxx xxxx 0111 xxxx */
496 /* SXTB cccc 0110 1010 1111 xxxx xxxx 0111 xxxx */
497 /* SXTH cccc 0110 1011 1111 xxxx xxxx 0111 xxxx */
498 /* UXTB16 cccc 0110 1100 1111 xxxx xxxx 0111 xxxx */
499 /* UXTB cccc 0110 1110 1111 xxxx xxxx 0111 xxxx */
500 /* UXTH cccc 0110 1111 1111 xxxx xxxx 0111 xxxx */
501 DECODE_EMULATEX (0x0f8f00f0, 0x068f0070, PROBES_EXTEND,
502 REGS(0, NOPC, 0, 0, NOPC)),
503
504 /* SXTAB16 cccc 0110 1000 xxxx xxxx xxxx 0111 xxxx */
505 /* SXTAB cccc 0110 1010 xxxx xxxx xxxx 0111 xxxx */
506 /* SXTAH cccc 0110 1011 xxxx xxxx xxxx 0111 xxxx */
507 /* UXTAB16 cccc 0110 1100 xxxx xxxx xxxx 0111 xxxx */
508 /* UXTAB cccc 0110 1110 xxxx xxxx xxxx 0111 xxxx */
509 /* UXTAH cccc 0110 1111 xxxx xxxx xxxx 0111 xxxx */
510 DECODE_EMULATEX (0x0f8000f0, 0x06800070, PROBES_EXTEND_ADD,
511 REGS(NOPCX, NOPC, 0, 0, NOPC)),
512
513 DECODE_END
514};
515
516static const union decode_item arm_cccc_0111_____xxx1_table[] = {
517 /* Media instructions */
518
519 /* UNDEFINED cccc 0111 1111 xxxx xxxx xxxx 1111 xxxx */
520 DECODE_REJECT (0x0ff000f0, 0x07f000f0),
521
522 /* SMLALD cccc 0111 0100 xxxx xxxx xxxx 00x1 xxxx */
523 /* SMLSLD cccc 0111 0100 xxxx xxxx xxxx 01x1 xxxx */
524 DECODE_EMULATEX (0x0ff00090, 0x07400010, PROBES_MUL_ADD_LONG,
525 REGS(NOPC, NOPC, NOPC, 0, NOPC)),
526
527 /* SMUAD cccc 0111 0000 xxxx 1111 xxxx 00x1 xxxx */
528 /* SMUSD cccc 0111 0000 xxxx 1111 xxxx 01x1 xxxx */
529 DECODE_OR (0x0ff0f090, 0x0700f010),
530 /* SMMUL cccc 0111 0101 xxxx 1111 xxxx 00x1 xxxx */
531 DECODE_OR (0x0ff0f0d0, 0x0750f010),
532 /* USAD8 cccc 0111 1000 xxxx 1111 xxxx 0001 xxxx */
533 DECODE_EMULATEX (0x0ff0f0f0, 0x0780f010, PROBES_MUL_ADD,
534 REGS(NOPC, 0, NOPC, 0, NOPC)),
535
536 /* SMLAD cccc 0111 0000 xxxx xxxx xxxx 00x1 xxxx */
537 /* SMLSD cccc 0111 0000 xxxx xxxx xxxx 01x1 xxxx */
538 DECODE_OR (0x0ff00090, 0x07000010),
539 /* SMMLA cccc 0111 0101 xxxx xxxx xxxx 00x1 xxxx */
540 DECODE_OR (0x0ff000d0, 0x07500010),
541 /* USADA8 cccc 0111 1000 xxxx xxxx xxxx 0001 xxxx */
542 DECODE_EMULATEX (0x0ff000f0, 0x07800010, PROBES_MUL_ADD,
543 REGS(NOPC, NOPCX, NOPC, 0, NOPC)),
544
545 /* SMMLS cccc 0111 0101 xxxx xxxx xxxx 11x1 xxxx */
546 DECODE_EMULATEX (0x0ff000d0, 0x075000d0, PROBES_MUL_ADD,
547 REGS(NOPC, NOPC, NOPC, 0, NOPC)),
548
549 /* SBFX cccc 0111 101x xxxx xxxx xxxx x101 xxxx */
550 /* UBFX cccc 0111 111x xxxx xxxx xxxx x101 xxxx */
551 DECODE_EMULATEX (0x0fa00070, 0x07a00050, PROBES_BITFIELD,
552 REGS(0, NOPC, 0, 0, NOPC)),
553
554 /* BFC cccc 0111 110x xxxx xxxx xxxx x001 1111 */
555 DECODE_EMULATEX (0x0fe0007f, 0x07c0001f, PROBES_BITFIELD,
556 REGS(0, NOPC, 0, 0, 0)),
557
558 /* BFI cccc 0111 110x xxxx xxxx xxxx x001 xxxx */
559 DECODE_EMULATEX (0x0fe00070, 0x07c00010, PROBES_BITFIELD,
560 REGS(0, NOPC, 0, 0, NOPCX)),
561
562 DECODE_END
563};
564
565static const union decode_item arm_cccc_01xx_table[] = {
566 /* Load/store word and unsigned byte */
567
568 /* LDRB/STRB pc,[...] cccc 01xx x0xx xxxx xxxx xxxx xxxx xxxx */
569 DECODE_REJECT (0x0c40f000, 0x0440f000),
570
571 /* STRT cccc 01x0 x010 xxxx xxxx xxxx xxxx xxxx */
572 /* LDRT cccc 01x0 x011 xxxx xxxx xxxx xxxx xxxx */
573 /* STRBT cccc 01x0 x110 xxxx xxxx xxxx xxxx xxxx */
574 /* LDRBT cccc 01x0 x111 xxxx xxxx xxxx xxxx xxxx */
575 DECODE_REJECT (0x0d200000, 0x04200000),
576
577 /* STR (immediate) cccc 010x x0x0 xxxx xxxx xxxx xxxx xxxx */
578 /* STRB (immediate) cccc 010x x1x0 xxxx xxxx xxxx xxxx xxxx */
579 DECODE_EMULATEX (0x0e100000, 0x04000000, PROBES_STORE,
580 REGS(NOPCWB, ANY, 0, 0, 0)),
581
582 /* LDR (immediate) cccc 010x x0x1 xxxx xxxx xxxx xxxx xxxx */
583 /* LDRB (immediate) cccc 010x x1x1 xxxx xxxx xxxx xxxx xxxx */
584 DECODE_EMULATEX (0x0e100000, 0x04100000, PROBES_LOAD,
585 REGS(NOPCWB, ANY, 0, 0, 0)),
586
587 /* STR (register) cccc 011x x0x0 xxxx xxxx xxxx xxxx xxxx */
588 /* STRB (register) cccc 011x x1x0 xxxx xxxx xxxx xxxx xxxx */
589 DECODE_EMULATEX (0x0e100000, 0x06000000, PROBES_STORE,
590 REGS(NOPCWB, ANY, 0, 0, NOPC)),
591
592 /* LDR (register) cccc 011x x0x1 xxxx xxxx xxxx xxxx xxxx */
593 /* LDRB (register) cccc 011x x1x1 xxxx xxxx xxxx xxxx xxxx */
594 DECODE_EMULATEX (0x0e100000, 0x06100000, PROBES_LOAD,
595 REGS(NOPCWB, ANY, 0, 0, NOPC)),
596
597 DECODE_END
598};
599
600static const union decode_item arm_cccc_100x_table[] = {
601 /* Block data transfer instructions */
602
603 /* LDM cccc 100x x0x1 xxxx xxxx xxxx xxxx xxxx */
604 /* STM cccc 100x x0x0 xxxx xxxx xxxx xxxx xxxx */
605 DECODE_CUSTOM (0x0e400000, 0x08000000, PROBES_LDMSTM),
606
607 /* STM (user registers) cccc 100x x1x0 xxxx xxxx xxxx xxxx xxxx */
608 /* LDM (user registers) cccc 100x x1x1 xxxx 0xxx xxxx xxxx xxxx */
609 /* LDM (exception ret) cccc 100x x1x1 xxxx 1xxx xxxx xxxx xxxx */
610 DECODE_END
611};
612
613const union decode_item probes_decode_arm_table[] = {
614 /*
615 * Unconditional instructions
616 * 1111 xxxx xxxx xxxx xxxx xxxx xxxx xxxx
617 */
618 DECODE_TABLE (0xf0000000, 0xf0000000, arm_1111_table),
619
620 /*
621 * Miscellaneous instructions
622 * cccc 0001 0xx0 xxxx xxxx xxxx 0xxx xxxx
623 */
624 DECODE_TABLE (0x0f900080, 0x01000000, arm_cccc_0001_0xx0____0xxx_table),
625
626 /*
627 * Halfword multiply and multiply-accumulate
628 * cccc 0001 0xx0 xxxx xxxx xxxx 1xx0 xxxx
629 */
630 DECODE_TABLE (0x0f900090, 0x01000080, arm_cccc_0001_0xx0____1xx0_table),
631
632 /*
633 * Multiply and multiply-accumulate
634 * cccc 0000 xxxx xxxx xxxx xxxx 1001 xxxx
635 */
636 DECODE_TABLE (0x0f0000f0, 0x00000090, arm_cccc_0000_____1001_table),
637
638 /*
639 * Synchronization primitives
640 * cccc 0001 xxxx xxxx xxxx xxxx 1001 xxxx
641 */
642 DECODE_TABLE (0x0f0000f0, 0x01000090, arm_cccc_0001_____1001_table),
643
644 /*
645 * Extra load/store instructions
646 * cccc 000x xxxx xxxx xxxx xxxx 1xx1 xxxx
647 */
648 DECODE_TABLE (0x0e000090, 0x00000090, arm_cccc_000x_____1xx1_table),
649
650 /*
651 * Data-processing (register)
652 * cccc 000x xxxx xxxx xxxx xxxx xxx0 xxxx
653 * Data-processing (register-shifted register)
654 * cccc 000x xxxx xxxx xxxx xxxx 0xx1 xxxx
655 */
656 DECODE_TABLE (0x0e000000, 0x00000000, arm_cccc_000x_table),
657
658 /*
659 * Data-processing (immediate)
660 * cccc 001x xxxx xxxx xxxx xxxx xxxx xxxx
661 */
662 DECODE_TABLE (0x0e000000, 0x02000000, arm_cccc_001x_table),
663
664 /*
665 * Media instructions
666 * cccc 011x xxxx xxxx xxxx xxxx xxx1 xxxx
667 */
668 DECODE_TABLE (0x0f000010, 0x06000010, arm_cccc_0110_____xxx1_table),
669 DECODE_TABLE (0x0f000010, 0x07000010, arm_cccc_0111_____xxx1_table),
670
671 /*
672 * Load/store word and unsigned byte
673 * cccc 01xx xxxx xxxx xxxx xxxx xxxx xxxx
674 */
675 DECODE_TABLE (0x0c000000, 0x04000000, arm_cccc_01xx_table),
676
677 /*
678 * Block data transfer instructions
679 * cccc 100x xxxx xxxx xxxx xxxx xxxx xxxx
680 */
681 DECODE_TABLE (0x0e000000, 0x08000000, arm_cccc_100x_table),
682
683 /* B cccc 1010 xxxx xxxx xxxx xxxx xxxx xxxx */
684 /* BL cccc 1011 xxxx xxxx xxxx xxxx xxxx xxxx */
685 DECODE_SIMULATE (0x0e000000, 0x0a000000, PROBES_BRANCH),
686
687 /*
688 * Supervisor Call, and coprocessor instructions
689 */
690
691 /* MCRR cccc 1100 0100 xxxx xxxx xxxx xxxx xxxx */
692 /* MRRC cccc 1100 0101 xxxx xxxx xxxx xxxx xxxx */
693 /* LDC cccc 110x xxx1 xxxx xxxx xxxx xxxx xxxx */
694 /* STC cccc 110x xxx0 xxxx xxxx xxxx xxxx xxxx */
695 /* CDP cccc 1110 xxxx xxxx xxxx xxxx xxx0 xxxx */
696 /* MCR cccc 1110 xxx0 xxxx xxxx xxxx xxx1 xxxx */
697 /* MRC cccc 1110 xxx1 xxxx xxxx xxxx xxx1 xxxx */
698 /* SVC cccc 1111 xxxx xxxx xxxx xxxx xxxx xxxx */
699 DECODE_REJECT (0x0c000000, 0x0c000000),
700
701 DECODE_END
702};
703#ifdef CONFIG_ARM_KPROBES_TEST_MODULE
704EXPORT_SYMBOL_GPL(probes_decode_arm_table);
705#endif
706
707static void __kprobes arm_singlestep(probes_opcode_t insn,
708 struct arch_probes_insn *asi, struct pt_regs *regs)
709{
710 regs->ARM_pc += 4;
711 asi->insn_handler(insn, asi, regs);
712}
713
714/* Return:
715 * INSN_REJECTED If instruction is one not allowed to kprobe,
716 * INSN_GOOD If instruction is supported and uses instruction slot,
717 * INSN_GOOD_NO_SLOT If instruction is supported but doesn't use its slot.
718 *
719 * For instructions we don't want to kprobe (INSN_REJECTED return result):
720 * These are generally ones that modify the processor state making
721 * them "hard" to simulate such as switches processor modes or
722 * make accesses in alternate modes. Any of these could be simulated
723 * if the work was put into it, but low return considering they
724 * should also be very rare.
725 */
726enum probes_insn __kprobes
727arm_probes_decode_insn(probes_opcode_t insn, struct arch_probes_insn *asi,
728 bool emulate, const union decode_action *actions)
729{
730 asi->insn_singlestep = arm_singlestep;
731 asi->insn_check_cc = probes_condition_checks[insn>>28];
732 return probes_decode_insn(insn, asi, probes_decode_arm_table, false,
733 emulate, actions);
734}
diff --git a/arch/arm/kernel/probes-arm.h b/arch/arm/kernel/probes-arm.h
new file mode 100644
index 000000000000..ace6572f6e26
--- /dev/null
+++ b/arch/arm/kernel/probes-arm.h
@@ -0,0 +1,73 @@
1/*
2 * arch/arm/kernel/probes-arm.h
3 *
4 * Copyright 2013 Linaro Ltd.
5 * Written by: David A. Long
6 *
7 * The code contained herein is licensed under the GNU General Public
8 * License. You may obtain a copy of the GNU General Public License
9 * Version 2 or later at the following locations:
10 *
11 * http://www.opensource.org/licenses/gpl-license.html
12 * http://www.gnu.org/copyleft/gpl.html
13 */
14
15#ifndef _ARM_KERNEL_PROBES_ARM_H
16#define _ARM_KERNEL_PROBES_ARM_H
17
18enum probes_arm_action {
19 PROBES_EMULATE_NONE,
20 PROBES_SIMULATE_NOP,
21 PROBES_PRELOAD_IMM,
22 PROBES_PRELOAD_REG,
23 PROBES_BRANCH_IMM,
24 PROBES_BRANCH_REG,
25 PROBES_MRS,
26 PROBES_CLZ,
27 PROBES_SATURATING_ARITHMETIC,
28 PROBES_MUL1,
29 PROBES_MUL2,
30 PROBES_SWP,
31 PROBES_LDRSTRD,
32 PROBES_LOAD,
33 PROBES_STORE,
34 PROBES_LOAD_EXTRA,
35 PROBES_STORE_EXTRA,
36 PROBES_MOV_IP_SP,
37 PROBES_DATA_PROCESSING_REG,
38 PROBES_DATA_PROCESSING_IMM,
39 PROBES_MOV_HALFWORD,
40 PROBES_SEV,
41 PROBES_WFE,
42 PROBES_SATURATE,
43 PROBES_REV,
44 PROBES_MMI,
45 PROBES_PACK,
46 PROBES_EXTEND,
47 PROBES_EXTEND_ADD,
48 PROBES_MUL_ADD_LONG,
49 PROBES_MUL_ADD,
50 PROBES_BITFIELD,
51 PROBES_BRANCH,
52 PROBES_LDMSTM,
53 NUM_PROBES_ARM_ACTIONS
54};
55
56void __kprobes simulate_bbl(probes_opcode_t opcode,
57 struct arch_probes_insn *asi, struct pt_regs *regs);
58void __kprobes simulate_blx1(probes_opcode_t opcode,
59 struct arch_probes_insn *asi, struct pt_regs *regs);
60void __kprobes simulate_blx2bx(probes_opcode_t opcode,
61 struct arch_probes_insn *asi, struct pt_regs *regs);
62void __kprobes simulate_mrs(probes_opcode_t opcode,
63 struct arch_probes_insn *asi, struct pt_regs *regs);
64void __kprobes simulate_mov_ipsp(probes_opcode_t opcode,
65 struct arch_probes_insn *asi, struct pt_regs *regs);
66
67extern const union decode_item probes_decode_arm_table[];
68
69enum probes_insn arm_probes_decode_insn(probes_opcode_t,
70 struct arch_probes_insn *, bool emulate,
71 const union decode_action *actions);
72
73#endif
diff --git a/arch/arm/kernel/probes-thumb.c b/arch/arm/kernel/probes-thumb.c
new file mode 100644
index 000000000000..4131351e812f
--- /dev/null
+++ b/arch/arm/kernel/probes-thumb.c
@@ -0,0 +1,882 @@
1/*
2 * arch/arm/kernel/probes-thumb.c
3 *
4 * Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>.
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/stddef.h>
12#include <linux/kernel.h>
13#include <linux/module.h>
14
15#include "probes.h"
16#include "probes-thumb.h"
17
18
19static const union decode_item t32_table_1110_100x_x0xx[] = {
20 /* Load/store multiple instructions */
21
22 /* Rn is PC 1110 100x x0xx 1111 xxxx xxxx xxxx xxxx */
23 DECODE_REJECT (0xfe4f0000, 0xe80f0000),
24
25 /* SRS 1110 1000 00x0 xxxx xxxx xxxx xxxx xxxx */
26 /* RFE 1110 1000 00x1 xxxx xxxx xxxx xxxx xxxx */
27 DECODE_REJECT (0xffc00000, 0xe8000000),
28 /* SRS 1110 1001 10x0 xxxx xxxx xxxx xxxx xxxx */
29 /* RFE 1110 1001 10x1 xxxx xxxx xxxx xxxx xxxx */
30 DECODE_REJECT (0xffc00000, 0xe9800000),
31
32 /* STM Rn, {...pc} 1110 100x x0x0 xxxx 1xxx xxxx xxxx xxxx */
33 DECODE_REJECT (0xfe508000, 0xe8008000),
34 /* LDM Rn, {...lr,pc} 1110 100x x0x1 xxxx 11xx xxxx xxxx xxxx */
35 DECODE_REJECT (0xfe50c000, 0xe810c000),
36 /* LDM/STM Rn, {...sp} 1110 100x x0xx xxxx xx1x xxxx xxxx xxxx */
37 DECODE_REJECT (0xfe402000, 0xe8002000),
38
39 /* STMIA 1110 1000 10x0 xxxx xxxx xxxx xxxx xxxx */
40 /* LDMIA 1110 1000 10x1 xxxx xxxx xxxx xxxx xxxx */
41 /* STMDB 1110 1001 00x0 xxxx xxxx xxxx xxxx xxxx */
42 /* LDMDB 1110 1001 00x1 xxxx xxxx xxxx xxxx xxxx */
43 DECODE_CUSTOM (0xfe400000, 0xe8000000, PROBES_T32_LDMSTM),
44
45 DECODE_END
46};
47
48static const union decode_item t32_table_1110_100x_x1xx[] = {
49 /* Load/store dual, load/store exclusive, table branch */
50
51 /* STRD (immediate) 1110 1000 x110 xxxx xxxx xxxx xxxx xxxx */
52 /* LDRD (immediate) 1110 1000 x111 xxxx xxxx xxxx xxxx xxxx */
53 DECODE_OR (0xff600000, 0xe8600000),
54 /* STRD (immediate) 1110 1001 x1x0 xxxx xxxx xxxx xxxx xxxx */
55 /* LDRD (immediate) 1110 1001 x1x1 xxxx xxxx xxxx xxxx xxxx */
56 DECODE_EMULATEX (0xff400000, 0xe9400000, PROBES_T32_LDRDSTRD,
57 REGS(NOPCWB, NOSPPC, NOSPPC, 0, 0)),
58
59 /* TBB 1110 1000 1101 xxxx xxxx xxxx 0000 xxxx */
60 /* TBH 1110 1000 1101 xxxx xxxx xxxx 0001 xxxx */
61 DECODE_SIMULATEX(0xfff000e0, 0xe8d00000, PROBES_T32_TABLE_BRANCH,
62 REGS(NOSP, 0, 0, 0, NOSPPC)),
63
64 /* STREX 1110 1000 0100 xxxx xxxx xxxx xxxx xxxx */
65 /* LDREX 1110 1000 0101 xxxx xxxx xxxx xxxx xxxx */
66 /* STREXB 1110 1000 1100 xxxx xxxx xxxx 0100 xxxx */
67 /* STREXH 1110 1000 1100 xxxx xxxx xxxx 0101 xxxx */
68 /* STREXD 1110 1000 1100 xxxx xxxx xxxx 0111 xxxx */
69 /* LDREXB 1110 1000 1101 xxxx xxxx xxxx 0100 xxxx */
70 /* LDREXH 1110 1000 1101 xxxx xxxx xxxx 0101 xxxx */
71 /* LDREXD 1110 1000 1101 xxxx xxxx xxxx 0111 xxxx */
72 /* And unallocated instructions... */
73 DECODE_END
74};
75
76static const union decode_item t32_table_1110_101x[] = {
77 /* Data-processing (shifted register) */
78
79 /* TST 1110 1010 0001 xxxx xxxx 1111 xxxx xxxx */
80 /* TEQ 1110 1010 1001 xxxx xxxx 1111 xxxx xxxx */
81 DECODE_EMULATEX (0xff700f00, 0xea100f00, PROBES_T32_TST,
82 REGS(NOSPPC, 0, 0, 0, NOSPPC)),
83
84 /* CMN 1110 1011 0001 xxxx xxxx 1111 xxxx xxxx */
85 DECODE_OR (0xfff00f00, 0xeb100f00),
86 /* CMP 1110 1011 1011 xxxx xxxx 1111 xxxx xxxx */
87 DECODE_EMULATEX (0xfff00f00, 0xebb00f00, PROBES_T32_TST,
88 REGS(NOPC, 0, 0, 0, NOSPPC)),
89
90 /* MOV 1110 1010 010x 1111 xxxx xxxx xxxx xxxx */
91 /* MVN 1110 1010 011x 1111 xxxx xxxx xxxx xxxx */
92 DECODE_EMULATEX (0xffcf0000, 0xea4f0000, PROBES_T32_MOV,
93 REGS(0, 0, NOSPPC, 0, NOSPPC)),
94
95 /* ??? 1110 1010 101x xxxx xxxx xxxx xxxx xxxx */
96 /* ??? 1110 1010 111x xxxx xxxx xxxx xxxx xxxx */
97 DECODE_REJECT (0xffa00000, 0xeaa00000),
98 /* ??? 1110 1011 001x xxxx xxxx xxxx xxxx xxxx */
99 DECODE_REJECT (0xffe00000, 0xeb200000),
100 /* ??? 1110 1011 100x xxxx xxxx xxxx xxxx xxxx */
101 DECODE_REJECT (0xffe00000, 0xeb800000),
102 /* ??? 1110 1011 111x xxxx xxxx xxxx xxxx xxxx */
103 DECODE_REJECT (0xffe00000, 0xebe00000),
104
105 /* ADD/SUB SP, SP, Rm, LSL #0..3 */
106 /* 1110 1011 x0xx 1101 x000 1101 xx00 xxxx */
107 DECODE_EMULATEX (0xff4f7f30, 0xeb0d0d00, PROBES_T32_ADDSUB,
108 REGS(SP, 0, SP, 0, NOSPPC)),
109
110 /* ADD/SUB SP, SP, Rm, shift */
111 /* 1110 1011 x0xx 1101 xxxx 1101 xxxx xxxx */
112 DECODE_REJECT (0xff4f0f00, 0xeb0d0d00),
113
114 /* ADD/SUB Rd, SP, Rm, shift */
115 /* 1110 1011 x0xx 1101 xxxx xxxx xxxx xxxx */
116 DECODE_EMULATEX (0xff4f0000, 0xeb0d0000, PROBES_T32_ADDSUB,
117 REGS(SP, 0, NOPC, 0, NOSPPC)),
118
119 /* AND 1110 1010 000x xxxx xxxx xxxx xxxx xxxx */
120 /* BIC 1110 1010 001x xxxx xxxx xxxx xxxx xxxx */
121 /* ORR 1110 1010 010x xxxx xxxx xxxx xxxx xxxx */
122 /* ORN 1110 1010 011x xxxx xxxx xxxx xxxx xxxx */
123 /* EOR 1110 1010 100x xxxx xxxx xxxx xxxx xxxx */
124 /* PKH 1110 1010 110x xxxx xxxx xxxx xxxx xxxx */
125 /* ADD 1110 1011 000x xxxx xxxx xxxx xxxx xxxx */
126 /* ADC 1110 1011 010x xxxx xxxx xxxx xxxx xxxx */
127 /* SBC 1110 1011 011x xxxx xxxx xxxx xxxx xxxx */
128 /* SUB 1110 1011 101x xxxx xxxx xxxx xxxx xxxx */
129 /* RSB 1110 1011 110x xxxx xxxx xxxx xxxx xxxx */
130 DECODE_EMULATEX (0xfe000000, 0xea000000, PROBES_T32_LOGICAL,
131 REGS(NOSPPC, 0, NOSPPC, 0, NOSPPC)),
132
133 DECODE_END
134};
135
136static const union decode_item t32_table_1111_0x0x___0[] = {
137 /* Data-processing (modified immediate) */
138
139 /* TST 1111 0x00 0001 xxxx 0xxx 1111 xxxx xxxx */
140 /* TEQ 1111 0x00 1001 xxxx 0xxx 1111 xxxx xxxx */
141 DECODE_EMULATEX (0xfb708f00, 0xf0100f00, PROBES_T32_TST,
142 REGS(NOSPPC, 0, 0, 0, 0)),
143
144 /* CMN 1111 0x01 0001 xxxx 0xxx 1111 xxxx xxxx */
145 DECODE_OR (0xfbf08f00, 0xf1100f00),
146 /* CMP 1111 0x01 1011 xxxx 0xxx 1111 xxxx xxxx */
147 DECODE_EMULATEX (0xfbf08f00, 0xf1b00f00, PROBES_T32_CMP,
148 REGS(NOPC, 0, 0, 0, 0)),
149
150 /* MOV 1111 0x00 010x 1111 0xxx xxxx xxxx xxxx */
151 /* MVN 1111 0x00 011x 1111 0xxx xxxx xxxx xxxx */
152 DECODE_EMULATEX (0xfbcf8000, 0xf04f0000, PROBES_T32_MOV,
153 REGS(0, 0, NOSPPC, 0, 0)),
154
155 /* ??? 1111 0x00 101x xxxx 0xxx xxxx xxxx xxxx */
156 DECODE_REJECT (0xfbe08000, 0xf0a00000),
157 /* ??? 1111 0x00 110x xxxx 0xxx xxxx xxxx xxxx */
158 /* ??? 1111 0x00 111x xxxx 0xxx xxxx xxxx xxxx */
159 DECODE_REJECT (0xfbc08000, 0xf0c00000),
160 /* ??? 1111 0x01 001x xxxx 0xxx xxxx xxxx xxxx */
161 DECODE_REJECT (0xfbe08000, 0xf1200000),
162 /* ??? 1111 0x01 100x xxxx 0xxx xxxx xxxx xxxx */
163 DECODE_REJECT (0xfbe08000, 0xf1800000),
164 /* ??? 1111 0x01 111x xxxx 0xxx xxxx xxxx xxxx */
165 DECODE_REJECT (0xfbe08000, 0xf1e00000),
166
167 /* ADD Rd, SP, #imm 1111 0x01 000x 1101 0xxx xxxx xxxx xxxx */
168 /* SUB Rd, SP, #imm 1111 0x01 101x 1101 0xxx xxxx xxxx xxxx */
169 DECODE_EMULATEX (0xfb4f8000, 0xf10d0000, PROBES_T32_ADDSUB,
170 REGS(SP, 0, NOPC, 0, 0)),
171
172 /* AND 1111 0x00 000x xxxx 0xxx xxxx xxxx xxxx */
173 /* BIC 1111 0x00 001x xxxx 0xxx xxxx xxxx xxxx */
174 /* ORR 1111 0x00 010x xxxx 0xxx xxxx xxxx xxxx */
175 /* ORN 1111 0x00 011x xxxx 0xxx xxxx xxxx xxxx */
176 /* EOR 1111 0x00 100x xxxx 0xxx xxxx xxxx xxxx */
177 /* ADD 1111 0x01 000x xxxx 0xxx xxxx xxxx xxxx */
178 /* ADC 1111 0x01 010x xxxx 0xxx xxxx xxxx xxxx */
179 /* SBC 1111 0x01 011x xxxx 0xxx xxxx xxxx xxxx */
180 /* SUB 1111 0x01 101x xxxx 0xxx xxxx xxxx xxxx */
181 /* RSB 1111 0x01 110x xxxx 0xxx xxxx xxxx xxxx */
182 DECODE_EMULATEX (0xfa008000, 0xf0000000, PROBES_T32_LOGICAL,
183 REGS(NOSPPC, 0, NOSPPC, 0, 0)),
184
185 DECODE_END
186};
187
188static const union decode_item t32_table_1111_0x1x___0[] = {
189 /* Data-processing (plain binary immediate) */
190
191 /* ADDW Rd, PC, #imm 1111 0x10 0000 1111 0xxx xxxx xxxx xxxx */
192 DECODE_OR (0xfbff8000, 0xf20f0000),
193 /* SUBW Rd, PC, #imm 1111 0x10 1010 1111 0xxx xxxx xxxx xxxx */
194 DECODE_EMULATEX (0xfbff8000, 0xf2af0000, PROBES_T32_ADDWSUBW_PC,
195 REGS(PC, 0, NOSPPC, 0, 0)),
196
197 /* ADDW SP, SP, #imm 1111 0x10 0000 1101 0xxx 1101 xxxx xxxx */
198 DECODE_OR (0xfbff8f00, 0xf20d0d00),
199 /* SUBW SP, SP, #imm 1111 0x10 1010 1101 0xxx 1101 xxxx xxxx */
200 DECODE_EMULATEX (0xfbff8f00, 0xf2ad0d00, PROBES_T32_ADDWSUBW,
201 REGS(SP, 0, SP, 0, 0)),
202
203 /* ADDW 1111 0x10 0000 xxxx 0xxx xxxx xxxx xxxx */
204 DECODE_OR (0xfbf08000, 0xf2000000),
205 /* SUBW 1111 0x10 1010 xxxx 0xxx xxxx xxxx xxxx */
206 DECODE_EMULATEX (0xfbf08000, 0xf2a00000, PROBES_T32_ADDWSUBW,
207 REGS(NOPCX, 0, NOSPPC, 0, 0)),
208
209 /* MOVW 1111 0x10 0100 xxxx 0xxx xxxx xxxx xxxx */
210 /* MOVT 1111 0x10 1100 xxxx 0xxx xxxx xxxx xxxx */
211 DECODE_EMULATEX (0xfb708000, 0xf2400000, PROBES_T32_MOVW,
212 REGS(0, 0, NOSPPC, 0, 0)),
213
214 /* SSAT16 1111 0x11 0010 xxxx 0000 xxxx 00xx xxxx */
215 /* SSAT 1111 0x11 00x0 xxxx 0xxx xxxx xxxx xxxx */
216 /* USAT16 1111 0x11 1010 xxxx 0000 xxxx 00xx xxxx */
217 /* USAT 1111 0x11 10x0 xxxx 0xxx xxxx xxxx xxxx */
218 DECODE_EMULATEX (0xfb508000, 0xf3000000, PROBES_T32_SAT,
219 REGS(NOSPPC, 0, NOSPPC, 0, 0)),
220
221 /* SFBX 1111 0x11 0100 xxxx 0xxx xxxx xxxx xxxx */
222 /* UFBX 1111 0x11 1100 xxxx 0xxx xxxx xxxx xxxx */
223 DECODE_EMULATEX (0xfb708000, 0xf3400000, PROBES_T32_BITFIELD,
224 REGS(NOSPPC, 0, NOSPPC, 0, 0)),
225
226 /* BFC 1111 0x11 0110 1111 0xxx xxxx xxxx xxxx */
227 DECODE_EMULATEX (0xfbff8000, 0xf36f0000, PROBES_T32_BITFIELD,
228 REGS(0, 0, NOSPPC, 0, 0)),
229
230 /* BFI 1111 0x11 0110 xxxx 0xxx xxxx xxxx xxxx */
231 DECODE_EMULATEX (0xfbf08000, 0xf3600000, PROBES_T32_BITFIELD,
232 REGS(NOSPPCX, 0, NOSPPC, 0, 0)),
233
234 DECODE_END
235};
236
237static const union decode_item t32_table_1111_0xxx___1[] = {
238 /* Branches and miscellaneous control */
239
240 /* YIELD 1111 0011 1010 xxxx 10x0 x000 0000 0001 */
241 DECODE_OR (0xfff0d7ff, 0xf3a08001),
242 /* SEV 1111 0011 1010 xxxx 10x0 x000 0000 0100 */
243 DECODE_EMULATE (0xfff0d7ff, 0xf3a08004, PROBES_T32_SEV),
244 /* NOP 1111 0011 1010 xxxx 10x0 x000 0000 0000 */
245 /* WFE 1111 0011 1010 xxxx 10x0 x000 0000 0010 */
246 /* WFI 1111 0011 1010 xxxx 10x0 x000 0000 0011 */
247 DECODE_SIMULATE (0xfff0d7fc, 0xf3a08000, PROBES_T32_WFE),
248
249 /* MRS Rd, CPSR 1111 0011 1110 xxxx 10x0 xxxx xxxx xxxx */
250 DECODE_SIMULATEX(0xfff0d000, 0xf3e08000, PROBES_T32_MRS,
251 REGS(0, 0, NOSPPC, 0, 0)),
252
253 /*
254 * Unsupported instructions
255 * 1111 0x11 1xxx xxxx 10x0 xxxx xxxx xxxx
256 *
257 * MSR 1111 0011 100x xxxx 10x0 xxxx xxxx xxxx
258 * DBG hint 1111 0011 1010 xxxx 10x0 x000 1111 xxxx
259 * Unallocated hints 1111 0011 1010 xxxx 10x0 x000 xxxx xxxx
260 * CPS 1111 0011 1010 xxxx 10x0 xxxx xxxx xxxx
261 * CLREX/DSB/DMB/ISB 1111 0011 1011 xxxx 10x0 xxxx xxxx xxxx
262 * BXJ 1111 0011 1100 xxxx 10x0 xxxx xxxx xxxx
263 * SUBS PC,LR,#<imm8> 1111 0011 1101 xxxx 10x0 xxxx xxxx xxxx
264 * MRS Rd, SPSR 1111 0011 1111 xxxx 10x0 xxxx xxxx xxxx
265 * SMC 1111 0111 1111 xxxx 1000 xxxx xxxx xxxx
266 * UNDEFINED 1111 0111 1111 xxxx 1010 xxxx xxxx xxxx
267 * ??? 1111 0111 1xxx xxxx 1010 xxxx xxxx xxxx
268 */
269 DECODE_REJECT (0xfb80d000, 0xf3808000),
270
271 /* Bcc 1111 0xxx xxxx xxxx 10x0 xxxx xxxx xxxx */
272 DECODE_CUSTOM (0xf800d000, 0xf0008000, PROBES_T32_BRANCH_COND),
273
274 /* BLX 1111 0xxx xxxx xxxx 11x0 xxxx xxxx xxx0 */
275 DECODE_OR (0xf800d001, 0xf000c000),
276 /* B 1111 0xxx xxxx xxxx 10x1 xxxx xxxx xxxx */
277 /* BL 1111 0xxx xxxx xxxx 11x1 xxxx xxxx xxxx */
278 DECODE_SIMULATE (0xf8009000, 0xf0009000, PROBES_T32_BRANCH),
279
280 DECODE_END
281};
282
283static const union decode_item t32_table_1111_100x_x0x1__1111[] = {
284 /* Memory hints */
285
286 /* PLD (literal) 1111 1000 x001 1111 1111 xxxx xxxx xxxx */
287 /* PLI (literal) 1111 1001 x001 1111 1111 xxxx xxxx xxxx */
288 DECODE_SIMULATE (0xfe7ff000, 0xf81ff000, PROBES_T32_PLDI),
289
290 /* PLD{W} (immediate) 1111 1000 10x1 xxxx 1111 xxxx xxxx xxxx */
291 DECODE_OR (0xffd0f000, 0xf890f000),
292 /* PLD{W} (immediate) 1111 1000 00x1 xxxx 1111 1100 xxxx xxxx */
293 DECODE_OR (0xffd0ff00, 0xf810fc00),
294 /* PLI (immediate) 1111 1001 1001 xxxx 1111 xxxx xxxx xxxx */
295 DECODE_OR (0xfff0f000, 0xf990f000),
296 /* PLI (immediate) 1111 1001 0001 xxxx 1111 1100 xxxx xxxx */
297 DECODE_SIMULATEX(0xfff0ff00, 0xf910fc00, PROBES_T32_PLDI,
298 REGS(NOPCX, 0, 0, 0, 0)),
299
300 /* PLD{W} (register) 1111 1000 00x1 xxxx 1111 0000 00xx xxxx */
301 DECODE_OR (0xffd0ffc0, 0xf810f000),
302 /* PLI (register) 1111 1001 0001 xxxx 1111 0000 00xx xxxx */
303 DECODE_SIMULATEX(0xfff0ffc0, 0xf910f000, PROBES_T32_PLDI,
304 REGS(NOPCX, 0, 0, 0, NOSPPC)),
305
306 /* Other unallocated instructions... */
307 DECODE_END
308};
309
310static const union decode_item t32_table_1111_100x[] = {
311 /* Store/Load single data item */
312
313 /* ??? 1111 100x x11x xxxx xxxx xxxx xxxx xxxx */
314 DECODE_REJECT (0xfe600000, 0xf8600000),
315
316 /* ??? 1111 1001 0101 xxxx xxxx xxxx xxxx xxxx */
317 DECODE_REJECT (0xfff00000, 0xf9500000),
318
319 /* ??? 1111 100x 0xxx xxxx xxxx 10x0 xxxx xxxx */
320 DECODE_REJECT (0xfe800d00, 0xf8000800),
321
322 /* STRBT 1111 1000 0000 xxxx xxxx 1110 xxxx xxxx */
323 /* STRHT 1111 1000 0010 xxxx xxxx 1110 xxxx xxxx */
324 /* STRT 1111 1000 0100 xxxx xxxx 1110 xxxx xxxx */
325 /* LDRBT 1111 1000 0001 xxxx xxxx 1110 xxxx xxxx */
326 /* LDRSBT 1111 1001 0001 xxxx xxxx 1110 xxxx xxxx */
327 /* LDRHT 1111 1000 0011 xxxx xxxx 1110 xxxx xxxx */
328 /* LDRSHT 1111 1001 0011 xxxx xxxx 1110 xxxx xxxx */
329 /* LDRT 1111 1000 0101 xxxx xxxx 1110 xxxx xxxx */
330 DECODE_REJECT (0xfe800f00, 0xf8000e00),
331
332 /* STR{,B,H} Rn,[PC...] 1111 1000 xxx0 1111 xxxx xxxx xxxx xxxx */
333 DECODE_REJECT (0xff1f0000, 0xf80f0000),
334
335 /* STR{,B,H} PC,[Rn...] 1111 1000 xxx0 xxxx 1111 xxxx xxxx xxxx */
336 DECODE_REJECT (0xff10f000, 0xf800f000),
337
338 /* LDR (literal) 1111 1000 x101 1111 xxxx xxxx xxxx xxxx */
339 DECODE_SIMULATEX(0xff7f0000, 0xf85f0000, PROBES_T32_LDR_LIT,
340 REGS(PC, ANY, 0, 0, 0)),
341
342 /* STR (immediate) 1111 1000 0100 xxxx xxxx 1xxx xxxx xxxx */
343 /* LDR (immediate) 1111 1000 0101 xxxx xxxx 1xxx xxxx xxxx */
344 DECODE_OR (0xffe00800, 0xf8400800),
345 /* STR (immediate) 1111 1000 1100 xxxx xxxx xxxx xxxx xxxx */
346 /* LDR (immediate) 1111 1000 1101 xxxx xxxx xxxx xxxx xxxx */
347 DECODE_EMULATEX (0xffe00000, 0xf8c00000, PROBES_T32_LDRSTR,
348 REGS(NOPCX, ANY, 0, 0, 0)),
349
350 /* STR (register) 1111 1000 0100 xxxx xxxx 0000 00xx xxxx */
351 /* LDR (register) 1111 1000 0101 xxxx xxxx 0000 00xx xxxx */
352 DECODE_EMULATEX (0xffe00fc0, 0xf8400000, PROBES_T32_LDRSTR,
353 REGS(NOPCX, ANY, 0, 0, NOSPPC)),
354
355 /* LDRB (literal) 1111 1000 x001 1111 xxxx xxxx xxxx xxxx */
356 /* LDRSB (literal) 1111 1001 x001 1111 xxxx xxxx xxxx xxxx */
357 /* LDRH (literal) 1111 1000 x011 1111 xxxx xxxx xxxx xxxx */
358 /* LDRSH (literal) 1111 1001 x011 1111 xxxx xxxx xxxx xxxx */
359 DECODE_SIMULATEX(0xfe5f0000, 0xf81f0000, PROBES_T32_LDR_LIT,
360 REGS(PC, NOSPPCX, 0, 0, 0)),
361
362 /* STRB (immediate) 1111 1000 0000 xxxx xxxx 1xxx xxxx xxxx */
363 /* STRH (immediate) 1111 1000 0010 xxxx xxxx 1xxx xxxx xxxx */
364 /* LDRB (immediate) 1111 1000 0001 xxxx xxxx 1xxx xxxx xxxx */
365 /* LDRSB (immediate) 1111 1001 0001 xxxx xxxx 1xxx xxxx xxxx */
366 /* LDRH (immediate) 1111 1000 0011 xxxx xxxx 1xxx xxxx xxxx */
367 /* LDRSH (immediate) 1111 1001 0011 xxxx xxxx 1xxx xxxx xxxx */
368 DECODE_OR (0xfec00800, 0xf8000800),
369 /* STRB (immediate) 1111 1000 1000 xxxx xxxx xxxx xxxx xxxx */
370 /* STRH (immediate) 1111 1000 1010 xxxx xxxx xxxx xxxx xxxx */
371 /* LDRB (immediate) 1111 1000 1001 xxxx xxxx xxxx xxxx xxxx */
372 /* LDRSB (immediate) 1111 1001 1001 xxxx xxxx xxxx xxxx xxxx */
373 /* LDRH (immediate) 1111 1000 1011 xxxx xxxx xxxx xxxx xxxx */
374 /* LDRSH (immediate) 1111 1001 1011 xxxx xxxx xxxx xxxx xxxx */
375 DECODE_EMULATEX (0xfec00000, 0xf8800000, PROBES_T32_LDRSTR,
376 REGS(NOPCX, NOSPPCX, 0, 0, 0)),
377
378 /* STRB (register) 1111 1000 0000 xxxx xxxx 0000 00xx xxxx */
379 /* STRH (register) 1111 1000 0010 xxxx xxxx 0000 00xx xxxx */
380 /* LDRB (register) 1111 1000 0001 xxxx xxxx 0000 00xx xxxx */
381 /* LDRSB (register) 1111 1001 0001 xxxx xxxx 0000 00xx xxxx */
382 /* LDRH (register) 1111 1000 0011 xxxx xxxx 0000 00xx xxxx */
383 /* LDRSH (register) 1111 1001 0011 xxxx xxxx 0000 00xx xxxx */
384 DECODE_EMULATEX (0xfe800fc0, 0xf8000000, PROBES_T32_LDRSTR,
385 REGS(NOPCX, NOSPPCX, 0, 0, NOSPPC)),
386
387 /* Other unallocated instructions... */
388 DECODE_END
389};
390
391static const union decode_item t32_table_1111_1010___1111[] = {
392 /* Data-processing (register) */
393
394 /* ??? 1111 1010 011x xxxx 1111 xxxx 1xxx xxxx */
395 DECODE_REJECT (0xffe0f080, 0xfa60f080),
396
397 /* SXTH 1111 1010 0000 1111 1111 xxxx 1xxx xxxx */
398 /* UXTH 1111 1010 0001 1111 1111 xxxx 1xxx xxxx */
399 /* SXTB16 1111 1010 0010 1111 1111 xxxx 1xxx xxxx */
400 /* UXTB16 1111 1010 0011 1111 1111 xxxx 1xxx xxxx */
401 /* SXTB 1111 1010 0100 1111 1111 xxxx 1xxx xxxx */
402 /* UXTB 1111 1010 0101 1111 1111 xxxx 1xxx xxxx */
403 DECODE_EMULATEX (0xff8ff080, 0xfa0ff080, PROBES_T32_SIGN_EXTEND,
404 REGS(0, 0, NOSPPC, 0, NOSPPC)),
405
406
407 /* ??? 1111 1010 1xxx xxxx 1111 xxxx 0x11 xxxx */
408 DECODE_REJECT (0xff80f0b0, 0xfa80f030),
409 /* ??? 1111 1010 1x11 xxxx 1111 xxxx 0xxx xxxx */
410 DECODE_REJECT (0xffb0f080, 0xfab0f000),
411
412 /* SADD16 1111 1010 1001 xxxx 1111 xxxx 0000 xxxx */
413 /* SASX 1111 1010 1010 xxxx 1111 xxxx 0000 xxxx */
414 /* SSAX 1111 1010 1110 xxxx 1111 xxxx 0000 xxxx */
415 /* SSUB16 1111 1010 1101 xxxx 1111 xxxx 0000 xxxx */
416 /* SADD8 1111 1010 1000 xxxx 1111 xxxx 0000 xxxx */
417 /* SSUB8 1111 1010 1100 xxxx 1111 xxxx 0000 xxxx */
418
419 /* QADD16 1111 1010 1001 xxxx 1111 xxxx 0001 xxxx */
420 /* QASX 1111 1010 1010 xxxx 1111 xxxx 0001 xxxx */
421 /* QSAX 1111 1010 1110 xxxx 1111 xxxx 0001 xxxx */
422 /* QSUB16 1111 1010 1101 xxxx 1111 xxxx 0001 xxxx */
423 /* QADD8 1111 1010 1000 xxxx 1111 xxxx 0001 xxxx */
424 /* QSUB8 1111 1010 1100 xxxx 1111 xxxx 0001 xxxx */
425
426 /* SHADD16 1111 1010 1001 xxxx 1111 xxxx 0010 xxxx */
427 /* SHASX 1111 1010 1010 xxxx 1111 xxxx 0010 xxxx */
428 /* SHSAX 1111 1010 1110 xxxx 1111 xxxx 0010 xxxx */
429 /* SHSUB16 1111 1010 1101 xxxx 1111 xxxx 0010 xxxx */
430 /* SHADD8 1111 1010 1000 xxxx 1111 xxxx 0010 xxxx */
431 /* SHSUB8 1111 1010 1100 xxxx 1111 xxxx 0010 xxxx */
432
433 /* UADD16 1111 1010 1001 xxxx 1111 xxxx 0100 xxxx */
434 /* UASX 1111 1010 1010 xxxx 1111 xxxx 0100 xxxx */
435 /* USAX 1111 1010 1110 xxxx 1111 xxxx 0100 xxxx */
436 /* USUB16 1111 1010 1101 xxxx 1111 xxxx 0100 xxxx */
437 /* UADD8 1111 1010 1000 xxxx 1111 xxxx 0100 xxxx */
438 /* USUB8 1111 1010 1100 xxxx 1111 xxxx 0100 xxxx */
439
440 /* UQADD16 1111 1010 1001 xxxx 1111 xxxx 0101 xxxx */
441 /* UQASX 1111 1010 1010 xxxx 1111 xxxx 0101 xxxx */
442 /* UQSAX 1111 1010 1110 xxxx 1111 xxxx 0101 xxxx */
443 /* UQSUB16 1111 1010 1101 xxxx 1111 xxxx 0101 xxxx */
444 /* UQADD8 1111 1010 1000 xxxx 1111 xxxx 0101 xxxx */
445 /* UQSUB8 1111 1010 1100 xxxx 1111 xxxx 0101 xxxx */
446
447 /* UHADD16 1111 1010 1001 xxxx 1111 xxxx 0110 xxxx */
448 /* UHASX 1111 1010 1010 xxxx 1111 xxxx 0110 xxxx */
449 /* UHSAX 1111 1010 1110 xxxx 1111 xxxx 0110 xxxx */
450 /* UHSUB16 1111 1010 1101 xxxx 1111 xxxx 0110 xxxx */
451 /* UHADD8 1111 1010 1000 xxxx 1111 xxxx 0110 xxxx */
452 /* UHSUB8 1111 1010 1100 xxxx 1111 xxxx 0110 xxxx */
453 DECODE_OR (0xff80f080, 0xfa80f000),
454
455 /* SXTAH 1111 1010 0000 xxxx 1111 xxxx 1xxx xxxx */
456 /* UXTAH 1111 1010 0001 xxxx 1111 xxxx 1xxx xxxx */
457 /* SXTAB16 1111 1010 0010 xxxx 1111 xxxx 1xxx xxxx */
458 /* UXTAB16 1111 1010 0011 xxxx 1111 xxxx 1xxx xxxx */
459 /* SXTAB 1111 1010 0100 xxxx 1111 xxxx 1xxx xxxx */
460 /* UXTAB 1111 1010 0101 xxxx 1111 xxxx 1xxx xxxx */
461 DECODE_OR (0xff80f080, 0xfa00f080),
462
463 /* QADD 1111 1010 1000 xxxx 1111 xxxx 1000 xxxx */
464 /* QDADD 1111 1010 1000 xxxx 1111 xxxx 1001 xxxx */
465 /* QSUB 1111 1010 1000 xxxx 1111 xxxx 1010 xxxx */
466 /* QDSUB 1111 1010 1000 xxxx 1111 xxxx 1011 xxxx */
467 DECODE_OR (0xfff0f0c0, 0xfa80f080),
468
469 /* SEL 1111 1010 1010 xxxx 1111 xxxx 1000 xxxx */
470 DECODE_OR (0xfff0f0f0, 0xfaa0f080),
471
472 /* LSL 1111 1010 000x xxxx 1111 xxxx 0000 xxxx */
473 /* LSR 1111 1010 001x xxxx 1111 xxxx 0000 xxxx */
474 /* ASR 1111 1010 010x xxxx 1111 xxxx 0000 xxxx */
475 /* ROR 1111 1010 011x xxxx 1111 xxxx 0000 xxxx */
476 DECODE_EMULATEX (0xff80f0f0, 0xfa00f000, PROBES_T32_MEDIA,
477 REGS(NOSPPC, 0, NOSPPC, 0, NOSPPC)),
478
479 /* CLZ 1111 1010 1010 xxxx 1111 xxxx 1000 xxxx */
480 DECODE_OR (0xfff0f0f0, 0xfab0f080),
481
482 /* REV 1111 1010 1001 xxxx 1111 xxxx 1000 xxxx */
483 /* REV16 1111 1010 1001 xxxx 1111 xxxx 1001 xxxx */
484 /* RBIT 1111 1010 1001 xxxx 1111 xxxx 1010 xxxx */
485 /* REVSH 1111 1010 1001 xxxx 1111 xxxx 1011 xxxx */
486 DECODE_EMULATEX (0xfff0f0c0, 0xfa90f080, PROBES_T32_REVERSE,
487 REGS(NOSPPC, 0, NOSPPC, 0, SAMEAS16)),
488
489 /* Other unallocated instructions... */
490 DECODE_END
491};
492
493static const union decode_item t32_table_1111_1011_0[] = {
494 /* Multiply, multiply accumulate, and absolute difference */
495
496 /* ??? 1111 1011 0000 xxxx 1111 xxxx 0001 xxxx */
497 DECODE_REJECT (0xfff0f0f0, 0xfb00f010),
498 /* ??? 1111 1011 0111 xxxx 1111 xxxx 0001 xxxx */
499 DECODE_REJECT (0xfff0f0f0, 0xfb70f010),
500
501 /* SMULxy 1111 1011 0001 xxxx 1111 xxxx 00xx xxxx */
502 DECODE_OR (0xfff0f0c0, 0xfb10f000),
503 /* MUL 1111 1011 0000 xxxx 1111 xxxx 0000 xxxx */
504 /* SMUAD{X} 1111 1011 0010 xxxx 1111 xxxx 000x xxxx */
505 /* SMULWy 1111 1011 0011 xxxx 1111 xxxx 000x xxxx */
506 /* SMUSD{X} 1111 1011 0100 xxxx 1111 xxxx 000x xxxx */
507 /* SMMUL{R} 1111 1011 0101 xxxx 1111 xxxx 000x xxxx */
508 /* USAD8 1111 1011 0111 xxxx 1111 xxxx 0000 xxxx */
509 DECODE_EMULATEX (0xff80f0e0, 0xfb00f000, PROBES_T32_MUL_ADD,
510 REGS(NOSPPC, 0, NOSPPC, 0, NOSPPC)),
511
512 /* ??? 1111 1011 0111 xxxx xxxx xxxx 0001 xxxx */
513 DECODE_REJECT (0xfff000f0, 0xfb700010),
514
515 /* SMLAxy 1111 1011 0001 xxxx xxxx xxxx 00xx xxxx */
516 DECODE_OR (0xfff000c0, 0xfb100000),
517 /* MLA 1111 1011 0000 xxxx xxxx xxxx 0000 xxxx */
518 /* MLS 1111 1011 0000 xxxx xxxx xxxx 0001 xxxx */
519 /* SMLAD{X} 1111 1011 0010 xxxx xxxx xxxx 000x xxxx */
520 /* SMLAWy 1111 1011 0011 xxxx xxxx xxxx 000x xxxx */
521 /* SMLSD{X} 1111 1011 0100 xxxx xxxx xxxx 000x xxxx */
522 /* SMMLA{R} 1111 1011 0101 xxxx xxxx xxxx 000x xxxx */
523 /* SMMLS{R} 1111 1011 0110 xxxx xxxx xxxx 000x xxxx */
524 /* USADA8 1111 1011 0111 xxxx xxxx xxxx 0000 xxxx */
525 DECODE_EMULATEX (0xff8000c0, 0xfb000000, PROBES_T32_MUL_ADD2,
526 REGS(NOSPPC, NOSPPCX, NOSPPC, 0, NOSPPC)),
527
528 /* Other unallocated instructions... */
529 DECODE_END
530};
531
532static const union decode_item t32_table_1111_1011_1[] = {
533 /* Long multiply, long multiply accumulate, and divide */
534
535 /* UMAAL 1111 1011 1110 xxxx xxxx xxxx 0110 xxxx */
536 DECODE_OR (0xfff000f0, 0xfbe00060),
537 /* SMLALxy 1111 1011 1100 xxxx xxxx xxxx 10xx xxxx */
538 DECODE_OR (0xfff000c0, 0xfbc00080),
539 /* SMLALD{X} 1111 1011 1100 xxxx xxxx xxxx 110x xxxx */
540 /* SMLSLD{X} 1111 1011 1101 xxxx xxxx xxxx 110x xxxx */
541 DECODE_OR (0xffe000e0, 0xfbc000c0),
542 /* SMULL 1111 1011 1000 xxxx xxxx xxxx 0000 xxxx */
543 /* UMULL 1111 1011 1010 xxxx xxxx xxxx 0000 xxxx */
544 /* SMLAL 1111 1011 1100 xxxx xxxx xxxx 0000 xxxx */
545 /* UMLAL 1111 1011 1110 xxxx xxxx xxxx 0000 xxxx */
546 DECODE_EMULATEX (0xff9000f0, 0xfb800000, PROBES_T32_MUL_ADD_LONG,
547 REGS(NOSPPC, NOSPPC, NOSPPC, 0, NOSPPC)),
548
549 /* SDIV 1111 1011 1001 xxxx xxxx xxxx 1111 xxxx */
550 /* UDIV 1111 1011 1011 xxxx xxxx xxxx 1111 xxxx */
551 /* Other unallocated instructions... */
552 DECODE_END
553};
554
555const union decode_item probes_decode_thumb32_table[] = {
556
557 /*
558 * Load/store multiple instructions
559 * 1110 100x x0xx xxxx xxxx xxxx xxxx xxxx
560 */
561 DECODE_TABLE (0xfe400000, 0xe8000000, t32_table_1110_100x_x0xx),
562
563 /*
564 * Load/store dual, load/store exclusive, table branch
565 * 1110 100x x1xx xxxx xxxx xxxx xxxx xxxx
566 */
567 DECODE_TABLE (0xfe400000, 0xe8400000, t32_table_1110_100x_x1xx),
568
569 /*
570 * Data-processing (shifted register)
571 * 1110 101x xxxx xxxx xxxx xxxx xxxx xxxx
572 */
573 DECODE_TABLE (0xfe000000, 0xea000000, t32_table_1110_101x),
574
575 /*
576 * Coprocessor instructions
577 * 1110 11xx xxxx xxxx xxxx xxxx xxxx xxxx
578 */
579 DECODE_REJECT (0xfc000000, 0xec000000),
580
581 /*
582 * Data-processing (modified immediate)
583 * 1111 0x0x xxxx xxxx 0xxx xxxx xxxx xxxx
584 */
585 DECODE_TABLE (0xfa008000, 0xf0000000, t32_table_1111_0x0x___0),
586
587 /*
588 * Data-processing (plain binary immediate)
589 * 1111 0x1x xxxx xxxx 0xxx xxxx xxxx xxxx
590 */
591 DECODE_TABLE (0xfa008000, 0xf2000000, t32_table_1111_0x1x___0),
592
593 /*
594 * Branches and miscellaneous control
595 * 1111 0xxx xxxx xxxx 1xxx xxxx xxxx xxxx
596 */
597 DECODE_TABLE (0xf8008000, 0xf0008000, t32_table_1111_0xxx___1),
598
599 /*
600 * Advanced SIMD element or structure load/store instructions
601 * 1111 1001 xxx0 xxxx xxxx xxxx xxxx xxxx
602 */
603 DECODE_REJECT (0xff100000, 0xf9000000),
604
605 /*
606 * Memory hints
607 * 1111 100x x0x1 xxxx 1111 xxxx xxxx xxxx
608 */
609 DECODE_TABLE (0xfe50f000, 0xf810f000, t32_table_1111_100x_x0x1__1111),
610
611 /*
612 * Store single data item
613 * 1111 1000 xxx0 xxxx xxxx xxxx xxxx xxxx
614 * Load single data items
615 * 1111 100x xxx1 xxxx xxxx xxxx xxxx xxxx
616 */
617 DECODE_TABLE (0xfe000000, 0xf8000000, t32_table_1111_100x),
618
619 /*
620 * Data-processing (register)
621 * 1111 1010 xxxx xxxx 1111 xxxx xxxx xxxx
622 */
623 DECODE_TABLE (0xff00f000, 0xfa00f000, t32_table_1111_1010___1111),
624
625 /*
626 * Multiply, multiply accumulate, and absolute difference
627 * 1111 1011 0xxx xxxx xxxx xxxx xxxx xxxx
628 */
629 DECODE_TABLE (0xff800000, 0xfb000000, t32_table_1111_1011_0),
630
631 /*
632 * Long multiply, long multiply accumulate, and divide
633 * 1111 1011 1xxx xxxx xxxx xxxx xxxx xxxx
634 */
635 DECODE_TABLE (0xff800000, 0xfb800000, t32_table_1111_1011_1),
636
637 /*
638 * Coprocessor instructions
639 * 1111 11xx xxxx xxxx xxxx xxxx xxxx xxxx
640 */
641 DECODE_END
642};
643#ifdef CONFIG_ARM_KPROBES_TEST_MODULE
644EXPORT_SYMBOL_GPL(probes_decode_thumb32_table);
645#endif
646
647static const union decode_item t16_table_1011[] = {
648 /* Miscellaneous 16-bit instructions */
649
650 /* ADD (SP plus immediate) 1011 0000 0xxx xxxx */
651 /* SUB (SP minus immediate) 1011 0000 1xxx xxxx */
652 DECODE_SIMULATE (0xff00, 0xb000, PROBES_T16_ADD_SP),
653
654 /* CBZ 1011 00x1 xxxx xxxx */
655 /* CBNZ 1011 10x1 xxxx xxxx */
656 DECODE_SIMULATE (0xf500, 0xb100, PROBES_T16_CBZ),
657
658 /* SXTH 1011 0010 00xx xxxx */
659 /* SXTB 1011 0010 01xx xxxx */
660 /* UXTH 1011 0010 10xx xxxx */
661 /* UXTB 1011 0010 11xx xxxx */
662 /* REV 1011 1010 00xx xxxx */
663 /* REV16 1011 1010 01xx xxxx */
664 /* ??? 1011 1010 10xx xxxx */
665 /* REVSH 1011 1010 11xx xxxx */
666 DECODE_REJECT (0xffc0, 0xba80),
667 DECODE_EMULATE (0xf500, 0xb000, PROBES_T16_SIGN_EXTEND),
668
669 /* PUSH 1011 010x xxxx xxxx */
670 DECODE_CUSTOM (0xfe00, 0xb400, PROBES_T16_PUSH),
671 /* POP 1011 110x xxxx xxxx */
672 DECODE_CUSTOM (0xfe00, 0xbc00, PROBES_T16_POP),
673
674 /*
675 * If-Then, and hints
676 * 1011 1111 xxxx xxxx
677 */
678
679 /* YIELD 1011 1111 0001 0000 */
680 DECODE_OR (0xffff, 0xbf10),
681 /* SEV 1011 1111 0100 0000 */
682 DECODE_EMULATE (0xffff, 0xbf40, PROBES_T16_SEV),
683 /* NOP 1011 1111 0000 0000 */
684 /* WFE 1011 1111 0010 0000 */
685 /* WFI 1011 1111 0011 0000 */
686 DECODE_SIMULATE (0xffcf, 0xbf00, PROBES_T16_WFE),
687 /* Unassigned hints 1011 1111 xxxx 0000 */
688 DECODE_REJECT (0xff0f, 0xbf00),
689 /* IT 1011 1111 xxxx xxxx */
690 DECODE_CUSTOM (0xff00, 0xbf00, PROBES_T16_IT),
691
692 /* SETEND 1011 0110 010x xxxx */
693 /* CPS 1011 0110 011x xxxx */
694 /* BKPT 1011 1110 xxxx xxxx */
695 /* And unallocated instructions... */
696 DECODE_END
697};
698
699const union decode_item probes_decode_thumb16_table[] = {
700
701 /*
702 * Shift (immediate), add, subtract, move, and compare
703 * 00xx xxxx xxxx xxxx
704 */
705
706 /* CMP (immediate) 0010 1xxx xxxx xxxx */
707 DECODE_EMULATE (0xf800, 0x2800, PROBES_T16_CMP),
708
709 /* ADD (register) 0001 100x xxxx xxxx */
710 /* SUB (register) 0001 101x xxxx xxxx */
711 /* LSL (immediate) 0000 0xxx xxxx xxxx */
712 /* LSR (immediate) 0000 1xxx xxxx xxxx */
713 /* ASR (immediate) 0001 0xxx xxxx xxxx */
714 /* ADD (immediate, Thumb) 0001 110x xxxx xxxx */
715 /* SUB (immediate, Thumb) 0001 111x xxxx xxxx */
716 /* MOV (immediate) 0010 0xxx xxxx xxxx */
717 /* ADD (immediate, Thumb) 0011 0xxx xxxx xxxx */
718 /* SUB (immediate, Thumb) 0011 1xxx xxxx xxxx */
719 DECODE_EMULATE (0xc000, 0x0000, PROBES_T16_ADDSUB),
720
721 /*
722 * 16-bit Thumb data-processing instructions
723 * 0100 00xx xxxx xxxx
724 */
725
726 /* TST (register) 0100 0010 00xx xxxx */
727 DECODE_EMULATE (0xffc0, 0x4200, PROBES_T16_CMP),
728 /* CMP (register) 0100 0010 10xx xxxx */
729 /* CMN (register) 0100 0010 11xx xxxx */
730 DECODE_EMULATE (0xff80, 0x4280, PROBES_T16_CMP),
731 /* AND (register) 0100 0000 00xx xxxx */
732 /* EOR (register) 0100 0000 01xx xxxx */
733 /* LSL (register) 0100 0000 10xx xxxx */
734 /* LSR (register) 0100 0000 11xx xxxx */
735 /* ASR (register) 0100 0001 00xx xxxx */
736 /* ADC (register) 0100 0001 01xx xxxx */
737 /* SBC (register) 0100 0001 10xx xxxx */
738 /* ROR (register) 0100 0001 11xx xxxx */
739 /* RSB (immediate) 0100 0010 01xx xxxx */
740 /* ORR (register) 0100 0011 00xx xxxx */
741 /* MUL 0100 0011 00xx xxxx */
742 /* BIC (register) 0100 0011 10xx xxxx */
743 /* MVN (register) 0100 0011 10xx xxxx */
744 DECODE_EMULATE (0xfc00, 0x4000, PROBES_T16_LOGICAL),
745
746 /*
747 * Special data instructions and branch and exchange
748 * 0100 01xx xxxx xxxx
749 */
750
751 /* BLX pc 0100 0111 1111 1xxx */
752 DECODE_REJECT (0xfff8, 0x47f8),
753
754 /* BX (register) 0100 0111 0xxx xxxx */
755 /* BLX (register) 0100 0111 1xxx xxxx */
756 DECODE_SIMULATE (0xff00, 0x4700, PROBES_T16_BLX),
757
758 /* ADD pc, pc 0100 0100 1111 1111 */
759 DECODE_REJECT (0xffff, 0x44ff),
760
761 /* ADD (register) 0100 0100 xxxx xxxx */
762 /* CMP (register) 0100 0101 xxxx xxxx */
763 /* MOV (register) 0100 0110 xxxx xxxx */
764 DECODE_CUSTOM (0xfc00, 0x4400, PROBES_T16_HIREGOPS),
765
766 /*
767 * Load from Literal Pool
768 * LDR (literal) 0100 1xxx xxxx xxxx
769 */
770 DECODE_SIMULATE (0xf800, 0x4800, PROBES_T16_LDR_LIT),
771
772 /*
773 * 16-bit Thumb Load/store instructions
774 * 0101 xxxx xxxx xxxx
775 * 011x xxxx xxxx xxxx
776 * 100x xxxx xxxx xxxx
777 */
778
779 /* STR (register) 0101 000x xxxx xxxx */
780 /* STRH (register) 0101 001x xxxx xxxx */
781 /* STRB (register) 0101 010x xxxx xxxx */
782 /* LDRSB (register) 0101 011x xxxx xxxx */
783 /* LDR (register) 0101 100x xxxx xxxx */
784 /* LDRH (register) 0101 101x xxxx xxxx */
785 /* LDRB (register) 0101 110x xxxx xxxx */
786 /* LDRSH (register) 0101 111x xxxx xxxx */
787 /* STR (immediate, Thumb) 0110 0xxx xxxx xxxx */
788 /* LDR (immediate, Thumb) 0110 1xxx xxxx xxxx */
789 /* STRB (immediate, Thumb) 0111 0xxx xxxx xxxx */
790 /* LDRB (immediate, Thumb) 0111 1xxx xxxx xxxx */
791 DECODE_EMULATE (0xc000, 0x4000, PROBES_T16_LDRHSTRH),
792 /* STRH (immediate, Thumb) 1000 0xxx xxxx xxxx */
793 /* LDRH (immediate, Thumb) 1000 1xxx xxxx xxxx */
794 DECODE_EMULATE (0xf000, 0x8000, PROBES_T16_LDRHSTRH),
795 /* STR (immediate, Thumb) 1001 0xxx xxxx xxxx */
796 /* LDR (immediate, Thumb) 1001 1xxx xxxx xxxx */
797 DECODE_SIMULATE (0xf000, 0x9000, PROBES_T16_LDRSTR),
798
799 /*
800 * Generate PC-/SP-relative address
801 * ADR (literal) 1010 0xxx xxxx xxxx
802 * ADD (SP plus immediate) 1010 1xxx xxxx xxxx
803 */
804 DECODE_SIMULATE (0xf000, 0xa000, PROBES_T16_ADR),
805
806 /*
807 * Miscellaneous 16-bit instructions
808 * 1011 xxxx xxxx xxxx
809 */
810 DECODE_TABLE (0xf000, 0xb000, t16_table_1011),
811
812 /* STM 1100 0xxx xxxx xxxx */
813 /* LDM 1100 1xxx xxxx xxxx */
814 DECODE_EMULATE (0xf000, 0xc000, PROBES_T16_LDMSTM),
815
816 /*
817 * Conditional branch, and Supervisor Call
818 */
819
820 /* Permanently UNDEFINED 1101 1110 xxxx xxxx */
821 /* SVC 1101 1111 xxxx xxxx */
822 DECODE_REJECT (0xfe00, 0xde00),
823
824 /* Conditional branch 1101 xxxx xxxx xxxx */
825 DECODE_CUSTOM (0xf000, 0xd000, PROBES_T16_BRANCH_COND),
826
827 /*
828 * Unconditional branch
829 * B 1110 0xxx xxxx xxxx
830 */
831 DECODE_SIMULATE (0xf800, 0xe000, PROBES_T16_BRANCH),
832
833 DECODE_END
834};
835#ifdef CONFIG_ARM_KPROBES_TEST_MODULE
836EXPORT_SYMBOL_GPL(probes_decode_thumb16_table);
837#endif
838
839static unsigned long __kprobes thumb_check_cc(unsigned long cpsr)
840{
841 if (unlikely(in_it_block(cpsr)))
842 return probes_condition_checks[current_cond(cpsr)](cpsr);
843 return true;
844}
845
846static void __kprobes thumb16_singlestep(probes_opcode_t opcode,
847 struct arch_probes_insn *asi,
848 struct pt_regs *regs)
849{
850 regs->ARM_pc += 2;
851 asi->insn_handler(opcode, asi, regs);
852 regs->ARM_cpsr = it_advance(regs->ARM_cpsr);
853}
854
855static void __kprobes thumb32_singlestep(probes_opcode_t opcode,
856 struct arch_probes_insn *asi,
857 struct pt_regs *regs)
858{
859 regs->ARM_pc += 4;
860 asi->insn_handler(opcode, asi, regs);
861 regs->ARM_cpsr = it_advance(regs->ARM_cpsr);
862}
863
864enum probes_insn __kprobes
865thumb16_probes_decode_insn(probes_opcode_t insn, struct arch_probes_insn *asi,
866 bool emulate, const union decode_action *actions)
867{
868 asi->insn_singlestep = thumb16_singlestep;
869 asi->insn_check_cc = thumb_check_cc;
870 return probes_decode_insn(insn, asi, probes_decode_thumb16_table, true,
871 emulate, actions);
872}
873
874enum probes_insn __kprobes
875thumb32_probes_decode_insn(probes_opcode_t insn, struct arch_probes_insn *asi,
876 bool emulate, const union decode_action *actions)
877{
878 asi->insn_singlestep = thumb32_singlestep;
879 asi->insn_check_cc = thumb_check_cc;
880 return probes_decode_insn(insn, asi, probes_decode_thumb32_table, true,
881 emulate, actions);
882}
diff --git a/arch/arm/kernel/probes-thumb.h b/arch/arm/kernel/probes-thumb.h
new file mode 100644
index 000000000000..7c6f6ebe514f
--- /dev/null
+++ b/arch/arm/kernel/probes-thumb.h
@@ -0,0 +1,97 @@
1/*
2 * arch/arm/kernel/probes-thumb.h
3 *
4 * Copyright 2013 Linaro Ltd.
5 * Written by: David A. Long
6 *
7 * The code contained herein is licensed under the GNU General Public
8 * License. You may obtain a copy of the GNU General Public License
9 * Version 2 or later at the following locations:
10 *
11 * http://www.opensource.org/licenses/gpl-license.html
12 * http://www.gnu.org/copyleft/gpl.html
13 */
14
15#ifndef _ARM_KERNEL_PROBES_THUMB_H
16#define _ARM_KERNEL_PROBES_THUMB_H
17
18/*
19 * True if current instruction is in an IT block.
20 */
21#define in_it_block(cpsr) ((cpsr & 0x06000c00) != 0x00000000)
22
23/*
24 * Return the condition code to check for the currently executing instruction.
25 * This is in ITSTATE<7:4> which is in CPSR<15:12> but is only valid if
26 * in_it_block returns true.
27 */
28#define current_cond(cpsr) ((cpsr >> 12) & 0xf)
29
30enum probes_t32_action {
31 PROBES_T32_EMULATE_NONE,
32 PROBES_T32_SIMULATE_NOP,
33 PROBES_T32_LDMSTM,
34 PROBES_T32_LDRDSTRD,
35 PROBES_T32_TABLE_BRANCH,
36 PROBES_T32_TST,
37 PROBES_T32_CMP,
38 PROBES_T32_MOV,
39 PROBES_T32_ADDSUB,
40 PROBES_T32_LOGICAL,
41 PROBES_T32_ADDWSUBW_PC,
42 PROBES_T32_ADDWSUBW,
43 PROBES_T32_MOVW,
44 PROBES_T32_SAT,
45 PROBES_T32_BITFIELD,
46 PROBES_T32_SEV,
47 PROBES_T32_WFE,
48 PROBES_T32_MRS,
49 PROBES_T32_BRANCH_COND,
50 PROBES_T32_BRANCH,
51 PROBES_T32_PLDI,
52 PROBES_T32_LDR_LIT,
53 PROBES_T32_LDRSTR,
54 PROBES_T32_SIGN_EXTEND,
55 PROBES_T32_MEDIA,
56 PROBES_T32_REVERSE,
57 PROBES_T32_MUL_ADD,
58 PROBES_T32_MUL_ADD2,
59 PROBES_T32_MUL_ADD_LONG,
60 NUM_PROBES_T32_ACTIONS
61};
62
63enum probes_t16_action {
64 PROBES_T16_ADD_SP,
65 PROBES_T16_CBZ,
66 PROBES_T16_SIGN_EXTEND,
67 PROBES_T16_PUSH,
68 PROBES_T16_POP,
69 PROBES_T16_SEV,
70 PROBES_T16_WFE,
71 PROBES_T16_IT,
72 PROBES_T16_CMP,
73 PROBES_T16_ADDSUB,
74 PROBES_T16_LOGICAL,
75 PROBES_T16_BLX,
76 PROBES_T16_HIREGOPS,
77 PROBES_T16_LDR_LIT,
78 PROBES_T16_LDRHSTRH,
79 PROBES_T16_LDRSTR,
80 PROBES_T16_ADR,
81 PROBES_T16_LDMSTM,
82 PROBES_T16_BRANCH_COND,
83 PROBES_T16_BRANCH,
84 NUM_PROBES_T16_ACTIONS
85};
86
87extern const union decode_item probes_decode_thumb32_table[];
88extern const union decode_item probes_decode_thumb16_table[];
89
90enum probes_insn __kprobes
91thumb16_probes_decode_insn(probes_opcode_t insn, struct arch_probes_insn *asi,
92 bool emulate, const union decode_action *actions);
93enum probes_insn __kprobes
94thumb32_probes_decode_insn(probes_opcode_t insn, struct arch_probes_insn *asi,
95 bool emulate, const union decode_action *actions);
96
97#endif
diff --git a/arch/arm/kernel/probes.c b/arch/arm/kernel/probes.c
new file mode 100644
index 000000000000..a8ab540d7e73
--- /dev/null
+++ b/arch/arm/kernel/probes.c
@@ -0,0 +1,456 @@
1/*
2 * arch/arm/kernel/probes.c
3 *
4 * Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>.
5 *
6 * Some contents moved here from arch/arm/include/asm/kprobes-arm.c which is
7 * Copyright (C) 2006, 2007 Motorola Inc.
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/kernel.h>
15#include <linux/types.h>
16#include <asm/system_info.h>
17#include <asm/ptrace.h>
18#include <linux/bug.h>
19
20#include "probes.h"
21
22
23#ifndef find_str_pc_offset
24
25/*
26 * For STR and STM instructions, an ARM core may choose to use either
27 * a +8 or a +12 displacement from the current instruction's address.
28 * Whichever value is chosen for a given core, it must be the same for
29 * both instructions and may not change. This function measures it.
30 */
31
32int str_pc_offset;
33
34void __init find_str_pc_offset(void)
35{
36 int addr, scratch, ret;
37
38 __asm__ (
39 "sub %[ret], pc, #4 \n\t"
40 "str pc, %[addr] \n\t"
41 "ldr %[scr], %[addr] \n\t"
42 "sub %[ret], %[scr], %[ret] \n\t"
43 : [ret] "=r" (ret), [scr] "=r" (scratch), [addr] "+m" (addr));
44
45 str_pc_offset = ret;
46}
47
48#endif /* !find_str_pc_offset */
49
50
51#ifndef test_load_write_pc_interworking
52
53bool load_write_pc_interworks;
54
55void __init test_load_write_pc_interworking(void)
56{
57 int arch = cpu_architecture();
58 BUG_ON(arch == CPU_ARCH_UNKNOWN);
59 load_write_pc_interworks = arch >= CPU_ARCH_ARMv5T;
60}
61
62#endif /* !test_load_write_pc_interworking */
63
64
65#ifndef test_alu_write_pc_interworking
66
67bool alu_write_pc_interworks;
68
69void __init test_alu_write_pc_interworking(void)
70{
71 int arch = cpu_architecture();
72 BUG_ON(arch == CPU_ARCH_UNKNOWN);
73 alu_write_pc_interworks = arch >= CPU_ARCH_ARMv7;
74}
75
76#endif /* !test_alu_write_pc_interworking */
77
78
79void __init arm_probes_decode_init(void)
80{
81 find_str_pc_offset();
82 test_load_write_pc_interworking();
83 test_alu_write_pc_interworking();
84}
85
86
87static unsigned long __kprobes __check_eq(unsigned long cpsr)
88{
89 return cpsr & PSR_Z_BIT;
90}
91
92static unsigned long __kprobes __check_ne(unsigned long cpsr)
93{
94 return (~cpsr) & PSR_Z_BIT;
95}
96
97static unsigned long __kprobes __check_cs(unsigned long cpsr)
98{
99 return cpsr & PSR_C_BIT;
100}
101
102static unsigned long __kprobes __check_cc(unsigned long cpsr)
103{
104 return (~cpsr) & PSR_C_BIT;
105}
106
107static unsigned long __kprobes __check_mi(unsigned long cpsr)
108{
109 return cpsr & PSR_N_BIT;
110}
111
112static unsigned long __kprobes __check_pl(unsigned long cpsr)
113{
114 return (~cpsr) & PSR_N_BIT;
115}
116
117static unsigned long __kprobes __check_vs(unsigned long cpsr)
118{
119 return cpsr & PSR_V_BIT;
120}
121
122static unsigned long __kprobes __check_vc(unsigned long cpsr)
123{
124 return (~cpsr) & PSR_V_BIT;
125}
126
127static unsigned long __kprobes __check_hi(unsigned long cpsr)
128{
129 cpsr &= ~(cpsr >> 1); /* PSR_C_BIT &= ~PSR_Z_BIT */
130 return cpsr & PSR_C_BIT;
131}
132
133static unsigned long __kprobes __check_ls(unsigned long cpsr)
134{
135 cpsr &= ~(cpsr >> 1); /* PSR_C_BIT &= ~PSR_Z_BIT */
136 return (~cpsr) & PSR_C_BIT;
137}
138
139static unsigned long __kprobes __check_ge(unsigned long cpsr)
140{
141 cpsr ^= (cpsr << 3); /* PSR_N_BIT ^= PSR_V_BIT */
142 return (~cpsr) & PSR_N_BIT;
143}
144
145static unsigned long __kprobes __check_lt(unsigned long cpsr)
146{
147 cpsr ^= (cpsr << 3); /* PSR_N_BIT ^= PSR_V_BIT */
148 return cpsr & PSR_N_BIT;
149}
150
151static unsigned long __kprobes __check_gt(unsigned long cpsr)
152{
153 unsigned long temp = cpsr ^ (cpsr << 3); /* PSR_N_BIT ^= PSR_V_BIT */
154 temp |= (cpsr << 1); /* PSR_N_BIT |= PSR_Z_BIT */
155 return (~temp) & PSR_N_BIT;
156}
157
158static unsigned long __kprobes __check_le(unsigned long cpsr)
159{
160 unsigned long temp = cpsr ^ (cpsr << 3); /* PSR_N_BIT ^= PSR_V_BIT */
161 temp |= (cpsr << 1); /* PSR_N_BIT |= PSR_Z_BIT */
162 return temp & PSR_N_BIT;
163}
164
165static unsigned long __kprobes __check_al(unsigned long cpsr)
166{
167 return true;
168}
169
170probes_check_cc * const probes_condition_checks[16] = {
171 &__check_eq, &__check_ne, &__check_cs, &__check_cc,
172 &__check_mi, &__check_pl, &__check_vs, &__check_vc,
173 &__check_hi, &__check_ls, &__check_ge, &__check_lt,
174 &__check_gt, &__check_le, &__check_al, &__check_al
175};
176
177
178void __kprobes probes_simulate_nop(probes_opcode_t opcode,
179 struct arch_probes_insn *asi,
180 struct pt_regs *regs)
181{
182}
183
184void __kprobes probes_emulate_none(probes_opcode_t opcode,
185 struct arch_probes_insn *asi,
186 struct pt_regs *regs)
187{
188 asi->insn_fn();
189}
190
191/*
192 * Prepare an instruction slot to receive an instruction for emulating.
193 * This is done by placing a subroutine return after the location where the
194 * instruction will be placed. We also modify ARM instructions to be
195 * unconditional as the condition code will already be checked before any
196 * emulation handler is called.
197 */
198static probes_opcode_t __kprobes
199prepare_emulated_insn(probes_opcode_t insn, struct arch_probes_insn *asi,
200 bool thumb)
201{
202#ifdef CONFIG_THUMB2_KERNEL
203 if (thumb) {
204 u16 *thumb_insn = (u16 *)asi->insn;
205 /* Thumb bx lr */
206 thumb_insn[1] = __opcode_to_mem_thumb16(0x4770);
207 thumb_insn[2] = __opcode_to_mem_thumb16(0x4770);
208 return insn;
209 }
210 asi->insn[1] = __opcode_to_mem_arm(0xe12fff1e); /* ARM bx lr */
211#else
212 asi->insn[1] = __opcode_to_mem_arm(0xe1a0f00e); /* mov pc, lr */
213#endif
214 /* Make an ARM instruction unconditional */
215 if (insn < 0xe0000000)
216 insn = (insn | 0xe0000000) & ~0x10000000;
217 return insn;
218}
219
220/*
221 * Write a (probably modified) instruction into the slot previously prepared by
222 * prepare_emulated_insn
223 */
224static void __kprobes
225set_emulated_insn(probes_opcode_t insn, struct arch_probes_insn *asi,
226 bool thumb)
227{
228#ifdef CONFIG_THUMB2_KERNEL
229 if (thumb) {
230 u16 *ip = (u16 *)asi->insn;
231 if (is_wide_instruction(insn))
232 *ip++ = __opcode_to_mem_thumb16(insn >> 16);
233 *ip++ = __opcode_to_mem_thumb16(insn);
234 return;
235 }
236#endif
237 asi->insn[0] = __opcode_to_mem_arm(insn);
238}
239
240/*
241 * When we modify the register numbers encoded in an instruction to be emulated,
242 * the new values come from this define. For ARM and 32-bit Thumb instructions
243 * this gives...
244 *
245 * bit position 16 12 8 4 0
246 * ---------------+---+---+---+---+---+
247 * register r2 r0 r1 -- r3
248 */
249#define INSN_NEW_BITS 0x00020103
250
251/* Each nibble has same value as that at INSN_NEW_BITS bit 16 */
252#define INSN_SAMEAS16_BITS 0x22222222
253
254/*
255 * Validate and modify each of the registers encoded in an instruction.
256 *
257 * Each nibble in regs contains a value from enum decode_reg_type. For each
258 * non-zero value, the corresponding nibble in pinsn is validated and modified
259 * according to the type.
260 */
261static bool __kprobes decode_regs(probes_opcode_t *pinsn, u32 regs, bool modify)
262{
263 probes_opcode_t insn = *pinsn;
264 probes_opcode_t mask = 0xf; /* Start at least significant nibble */
265
266 for (; regs != 0; regs >>= 4, mask <<= 4) {
267
268 probes_opcode_t new_bits = INSN_NEW_BITS;
269
270 switch (regs & 0xf) {
271
272 case REG_TYPE_NONE:
273 /* Nibble not a register, skip to next */
274 continue;
275
276 case REG_TYPE_ANY:
277 /* Any register is allowed */
278 break;
279
280 case REG_TYPE_SAMEAS16:
281 /* Replace register with same as at bit position 16 */
282 new_bits = INSN_SAMEAS16_BITS;
283 break;
284
285 case REG_TYPE_SP:
286 /* Only allow SP (R13) */
287 if ((insn ^ 0xdddddddd) & mask)
288 goto reject;
289 break;
290
291 case REG_TYPE_PC:
292 /* Only allow PC (R15) */
293 if ((insn ^ 0xffffffff) & mask)
294 goto reject;
295 break;
296
297 case REG_TYPE_NOSP:
298 /* Reject SP (R13) */
299 if (((insn ^ 0xdddddddd) & mask) == 0)
300 goto reject;
301 break;
302
303 case REG_TYPE_NOSPPC:
304 case REG_TYPE_NOSPPCX:
305 /* Reject SP and PC (R13 and R15) */
306 if (((insn ^ 0xdddddddd) & 0xdddddddd & mask) == 0)
307 goto reject;
308 break;
309
310 case REG_TYPE_NOPCWB:
311 if (!is_writeback(insn))
312 break; /* No writeback, so any register is OK */
313 /* fall through... */
314 case REG_TYPE_NOPC:
315 case REG_TYPE_NOPCX:
316 /* Reject PC (R15) */
317 if (((insn ^ 0xffffffff) & mask) == 0)
318 goto reject;
319 break;
320 }
321
322 /* Replace value of nibble with new register number... */
323 insn &= ~mask;
324 insn |= new_bits & mask;
325 }
326
327 if (modify)
328 *pinsn = insn;
329
330 return true;
331
332reject:
333 return false;
334}
335
336static const int decode_struct_sizes[NUM_DECODE_TYPES] = {
337 [DECODE_TYPE_TABLE] = sizeof(struct decode_table),
338 [DECODE_TYPE_CUSTOM] = sizeof(struct decode_custom),
339 [DECODE_TYPE_SIMULATE] = sizeof(struct decode_simulate),
340 [DECODE_TYPE_EMULATE] = sizeof(struct decode_emulate),
341 [DECODE_TYPE_OR] = sizeof(struct decode_or),
342 [DECODE_TYPE_REJECT] = sizeof(struct decode_reject)
343};
344
345/*
346 * probes_decode_insn operates on data tables in order to decode an ARM
347 * architecture instruction onto which a kprobe has been placed.
348 *
349 * These instruction decoding tables are a concatenation of entries each
350 * of which consist of one of the following structs:
351 *
352 * decode_table
353 * decode_custom
354 * decode_simulate
355 * decode_emulate
356 * decode_or
357 * decode_reject
358 *
359 * Each of these starts with a struct decode_header which has the following
360 * fields:
361 *
362 * type_regs
363 * mask
364 * value
365 *
366 * The least significant DECODE_TYPE_BITS of type_regs contains a value
367 * from enum decode_type, this indicates which of the decode_* structs
368 * the entry contains. The value DECODE_TYPE_END indicates the end of the
369 * table.
370 *
371 * When the table is parsed, each entry is checked in turn to see if it
372 * matches the instruction to be decoded using the test:
373 *
374 * (insn & mask) == value
375 *
376 * If no match is found before the end of the table is reached then decoding
377 * fails with INSN_REJECTED.
378 *
379 * When a match is found, decode_regs() is called to validate and modify each
380 * of the registers encoded in the instruction; the data it uses to do this
381 * is (type_regs >> DECODE_TYPE_BITS). A validation failure will cause decoding
382 * to fail with INSN_REJECTED.
383 *
384 * Once the instruction has passed the above tests, further processing
385 * depends on the type of the table entry's decode struct.
386 *
387 */
388int __kprobes
389probes_decode_insn(probes_opcode_t insn, struct arch_probes_insn *asi,
390 const union decode_item *table, bool thumb,
391 bool emulate, const union decode_action *actions)
392{
393 const struct decode_header *h = (struct decode_header *)table;
394 const struct decode_header *next;
395 bool matched = false;
396
397 if (emulate)
398 insn = prepare_emulated_insn(insn, asi, thumb);
399
400 for (;; h = next) {
401 enum decode_type type = h->type_regs.bits & DECODE_TYPE_MASK;
402 u32 regs = h->type_regs.bits >> DECODE_TYPE_BITS;
403
404 if (type == DECODE_TYPE_END)
405 return INSN_REJECTED;
406
407 next = (struct decode_header *)
408 ((uintptr_t)h + decode_struct_sizes[type]);
409
410 if (!matched && (insn & h->mask.bits) != h->value.bits)
411 continue;
412
413 if (!decode_regs(&insn, regs, emulate))
414 return INSN_REJECTED;
415
416 switch (type) {
417
418 case DECODE_TYPE_TABLE: {
419 struct decode_table *d = (struct decode_table *)h;
420 next = (struct decode_header *)d->table.table;
421 break;
422 }
423
424 case DECODE_TYPE_CUSTOM: {
425 struct decode_custom *d = (struct decode_custom *)h;
426 return actions[d->decoder.action].decoder(insn, asi, h);
427 }
428
429 case DECODE_TYPE_SIMULATE: {
430 struct decode_simulate *d = (struct decode_simulate *)h;
431 asi->insn_handler = actions[d->handler.action].handler;
432 return INSN_GOOD_NO_SLOT;
433 }
434
435 case DECODE_TYPE_EMULATE: {
436 struct decode_emulate *d = (struct decode_emulate *)h;
437
438 if (!emulate)
439 return actions[d->handler.action].decoder(insn,
440 asi, h);
441
442 asi->insn_handler = actions[d->handler.action].handler;
443 set_emulated_insn(insn, asi, thumb);
444 return INSN_GOOD;
445 }
446
447 case DECODE_TYPE_OR:
448 matched = true;
449 break;
450
451 case DECODE_TYPE_REJECT:
452 default:
453 return INSN_REJECTED;
454 }
455 }
456}
diff --git a/arch/arm/kernel/probes.h b/arch/arm/kernel/probes.h
new file mode 100644
index 000000000000..dba9f2466a93
--- /dev/null
+++ b/arch/arm/kernel/probes.h
@@ -0,0 +1,407 @@
1/*
2 * arch/arm/kernel/probes.h
3 *
4 * Copyright (C) 2011 Jon Medhurst <tixy@yxit.co.uk>.
5 *
6 * Some contents moved here from arch/arm/include/asm/kprobes.h which is
7 * Copyright (C) 2006, 2007 Motorola Inc.
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 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 */
18
19#ifndef _ARM_KERNEL_PROBES_H
20#define _ARM_KERNEL_PROBES_H
21
22#include <linux/types.h>
23#include <linux/stddef.h>
24#include <asm/probes.h>
25
26void __init arm_probes_decode_init(void);
27
28extern probes_check_cc * const probes_condition_checks[16];
29
30#if __LINUX_ARM_ARCH__ >= 7
31
32/* str_pc_offset is architecturally defined from ARMv7 onwards */
33#define str_pc_offset 8
34#define find_str_pc_offset()
35
36#else /* __LINUX_ARM_ARCH__ < 7 */
37
38/* We need a run-time check to determine str_pc_offset */
39extern int str_pc_offset;
40void __init find_str_pc_offset(void);
41
42#endif
43
44
45/*
46 * Update ITSTATE after normal execution of an IT block instruction.
47 *
48 * The 8 IT state bits are split into two parts in CPSR:
49 * ITSTATE<1:0> are in CPSR<26:25>
50 * ITSTATE<7:2> are in CPSR<15:10>
51 */
52static inline unsigned long it_advance(unsigned long cpsr)
53 {
54 if ((cpsr & 0x06000400) == 0) {
55 /* ITSTATE<2:0> == 0 means end of IT block, so clear IT state */
56 cpsr &= ~PSR_IT_MASK;
57 } else {
58 /* We need to shift left ITSTATE<4:0> */
59 const unsigned long mask = 0x06001c00; /* Mask ITSTATE<4:0> */
60 unsigned long it = cpsr & mask;
61 it <<= 1;
62 it |= it >> (27 - 10); /* Carry ITSTATE<2> to correct place */
63 it &= mask;
64 cpsr &= ~mask;
65 cpsr |= it;
66 }
67 return cpsr;
68}
69
70static inline void __kprobes bx_write_pc(long pcv, struct pt_regs *regs)
71{
72 long cpsr = regs->ARM_cpsr;
73 if (pcv & 0x1) {
74 cpsr |= PSR_T_BIT;
75 pcv &= ~0x1;
76 } else {
77 cpsr &= ~PSR_T_BIT;
78 pcv &= ~0x2; /* Avoid UNPREDICTABLE address allignment */
79 }
80 regs->ARM_cpsr = cpsr;
81 regs->ARM_pc = pcv;
82}
83
84
85#if __LINUX_ARM_ARCH__ >= 6
86
87/* Kernels built for >= ARMv6 should never run on <= ARMv5 hardware, so... */
88#define load_write_pc_interworks true
89#define test_load_write_pc_interworking()
90
91#else /* __LINUX_ARM_ARCH__ < 6 */
92
93/* We need run-time testing to determine if load_write_pc() should interwork. */
94extern bool load_write_pc_interworks;
95void __init test_load_write_pc_interworking(void);
96
97#endif
98
99static inline void __kprobes load_write_pc(long pcv, struct pt_regs *regs)
100{
101 if (load_write_pc_interworks)
102 bx_write_pc(pcv, regs);
103 else
104 regs->ARM_pc = pcv;
105}
106
107
108#if __LINUX_ARM_ARCH__ >= 7
109
110#define alu_write_pc_interworks true
111#define test_alu_write_pc_interworking()
112
113#elif __LINUX_ARM_ARCH__ <= 5
114
115/* Kernels built for <= ARMv5 should never run on >= ARMv6 hardware, so... */
116#define alu_write_pc_interworks false
117#define test_alu_write_pc_interworking()
118
119#else /* __LINUX_ARM_ARCH__ == 6 */
120
121/* We could be an ARMv6 binary on ARMv7 hardware so we need a run-time check. */
122extern bool alu_write_pc_interworks;
123void __init test_alu_write_pc_interworking(void);
124
125#endif /* __LINUX_ARM_ARCH__ == 6 */
126
127static inline void __kprobes alu_write_pc(long pcv, struct pt_regs *regs)
128{
129 if (alu_write_pc_interworks)
130 bx_write_pc(pcv, regs);
131 else
132 regs->ARM_pc = pcv;
133}
134
135
136/*
137 * Test if load/store instructions writeback the address register.
138 * if P (bit 24) == 0 or W (bit 21) == 1
139 */
140#define is_writeback(insn) ((insn ^ 0x01000000) & 0x01200000)
141
142/*
143 * The following definitions and macros are used to build instruction
144 * decoding tables for use by probes_decode_insn.
145 *
146 * These tables are a concatenation of entries each of which consist of one of
147 * the decode_* structs. All of the fields in every type of decode structure
148 * are of the union type decode_item, therefore the entire decode table can be
149 * viewed as an array of these and declared like:
150 *
151 * static const union decode_item table_name[] = {};
152 *
153 * In order to construct each entry in the table, macros are used to
154 * initialise a number of sequential decode_item values in a layout which
155 * matches the relevant struct. E.g. DECODE_SIMULATE initialise a struct
156 * decode_simulate by initialising four decode_item objects like this...
157 *
158 * {.bits = _type},
159 * {.bits = _mask},
160 * {.bits = _value},
161 * {.action = _handler},
162 *
163 * Initialising a specified member of the union means that the compiler
164 * will produce a warning if the argument is of an incorrect type.
165 *
166 * Below is a list of each of the macros used to initialise entries and a
167 * description of the action performed when that entry is matched to an
168 * instruction. A match is found when (instruction & mask) == value.
169 *
170 * DECODE_TABLE(mask, value, table)
171 * Instruction decoding jumps to parsing the new sub-table 'table'.
172 *
173 * DECODE_CUSTOM(mask, value, decoder)
174 * The value of 'decoder' is used as an index into the array of
175 * action functions, and the retrieved decoder function is invoked
176 * to complete decoding of the instruction.
177 *
178 * DECODE_SIMULATE(mask, value, handler)
179 * The probes instruction handler is set to the value found by
180 * indexing into the action array using the value of 'handler'. This
181 * will be used to simulate the instruction when the probe is hit.
182 * Decoding returns with INSN_GOOD_NO_SLOT.
183 *
184 * DECODE_EMULATE(mask, value, handler)
185 * The probes instruction handler is set to the value found by
186 * indexing into the action array using the value of 'handler'. This
187 * will be used to emulate the instruction when the probe is hit. The
188 * modified instruction (see below) is placed in the probes instruction
189 * slot so it may be called by the emulation code. Decoding returns
190 * with INSN_GOOD.
191 *
192 * DECODE_REJECT(mask, value)
193 * Instruction decoding fails with INSN_REJECTED
194 *
195 * DECODE_OR(mask, value)
196 * This allows the mask/value test of multiple table entries to be
197 * logically ORed. Once an 'or' entry is matched the decoding action to
198 * be performed is that of the next entry which isn't an 'or'. E.g.
199 *
200 * DECODE_OR (mask1, value1)
201 * DECODE_OR (mask2, value2)
202 * DECODE_SIMULATE (mask3, value3, simulation_handler)
203 *
204 * This means that if any of the three mask/value pairs match the
205 * instruction being decoded, then 'simulation_handler' will be used
206 * for it.
207 *
208 * Both the SIMULATE and EMULATE macros have a second form which take an
209 * additional 'regs' argument.
210 *
211 * DECODE_SIMULATEX(mask, value, handler, regs)
212 * DECODE_EMULATEX (mask, value, handler, regs)
213 *
214 * These are used to specify what kind of CPU register is encoded in each of the
215 * least significant 5 nibbles of the instruction being decoded. The regs value
216 * is specified using the REGS macro, this takes any of the REG_TYPE_* values
217 * from enum decode_reg_type as arguments; only the '*' part of the name is
218 * given. E.g.
219 *
220 * REGS(0, ANY, NOPC, 0, ANY)
221 *
222 * This indicates an instruction is encoded like:
223 *
224 * bits 19..16 ignore
225 * bits 15..12 any register allowed here
226 * bits 11.. 8 any register except PC allowed here
227 * bits 7.. 4 ignore
228 * bits 3.. 0 any register allowed here
229 *
230 * This register specification is checked after a decode table entry is found to
231 * match an instruction (through the mask/value test). Any invalid register then
232 * found in the instruction will cause decoding to fail with INSN_REJECTED. In
233 * the above example this would happen if bits 11..8 of the instruction were
234 * 1111, indicating R15 or PC.
235 *
236 * As well as checking for legal combinations of registers, this data is also
237 * used to modify the registers encoded in the instructions so that an
238 * emulation routines can use it. (See decode_regs() and INSN_NEW_BITS.)
239 *
240 * Here is a real example which matches ARM instructions of the form
241 * "AND <Rd>,<Rn>,<Rm>,<shift> <Rs>"
242 *
243 * DECODE_EMULATEX (0x0e000090, 0x00000010, PROBES_DATA_PROCESSING_REG,
244 * REGS(ANY, ANY, NOPC, 0, ANY)),
245 * ^ ^ ^ ^
246 * Rn Rd Rs Rm
247 *
248 * Decoding the instruction "AND R4, R5, R6, ASL R15" will be rejected because
249 * Rs == R15
250 *
251 * Decoding the instruction "AND R4, R5, R6, ASL R7" will be accepted and the
252 * instruction will be modified to "AND R0, R2, R3, ASL R1" and then placed into
253 * the kprobes instruction slot. This can then be called later by the handler
254 * function emulate_rd12rn16rm0rs8_rwflags (a pointer to which is retrieved from
255 * the indicated slot in the action array), in order to simulate the instruction.
256 */
257
258enum decode_type {
259 DECODE_TYPE_END,
260 DECODE_TYPE_TABLE,
261 DECODE_TYPE_CUSTOM,
262 DECODE_TYPE_SIMULATE,
263 DECODE_TYPE_EMULATE,
264 DECODE_TYPE_OR,
265 DECODE_TYPE_REJECT,
266 NUM_DECODE_TYPES /* Must be last enum */
267};
268
269#define DECODE_TYPE_BITS 4
270#define DECODE_TYPE_MASK ((1 << DECODE_TYPE_BITS) - 1)
271
272enum decode_reg_type {
273 REG_TYPE_NONE = 0, /* Not a register, ignore */
274 REG_TYPE_ANY, /* Any register allowed */
275 REG_TYPE_SAMEAS16, /* Register should be same as that at bits 19..16 */
276 REG_TYPE_SP, /* Register must be SP */
277 REG_TYPE_PC, /* Register must be PC */
278 REG_TYPE_NOSP, /* Register must not be SP */
279 REG_TYPE_NOSPPC, /* Register must not be SP or PC */
280 REG_TYPE_NOPC, /* Register must not be PC */
281 REG_TYPE_NOPCWB, /* No PC if load/store write-back flag also set */
282
283 /* The following types are used when the encoding for PC indicates
284 * another instruction form. This distiction only matters for test
285 * case coverage checks.
286 */
287 REG_TYPE_NOPCX, /* Register must not be PC */
288 REG_TYPE_NOSPPCX, /* Register must not be SP or PC */
289
290 /* Alias to allow '0' arg to be used in REGS macro. */
291 REG_TYPE_0 = REG_TYPE_NONE
292};
293
294#define REGS(r16, r12, r8, r4, r0) \
295 (((REG_TYPE_##r16) << 16) + \
296 ((REG_TYPE_##r12) << 12) + \
297 ((REG_TYPE_##r8) << 8) + \
298 ((REG_TYPE_##r4) << 4) + \
299 (REG_TYPE_##r0))
300
301union decode_item {
302 u32 bits;
303 const union decode_item *table;
304 int action;
305};
306
307struct decode_header;
308typedef enum probes_insn (probes_custom_decode_t)(probes_opcode_t,
309 struct arch_probes_insn *,
310 const struct decode_header *);
311
312union decode_action {
313 probes_insn_handler_t *handler;
314 probes_custom_decode_t *decoder;
315};
316
317#define DECODE_END \
318 {.bits = DECODE_TYPE_END}
319
320
321struct decode_header {
322 union decode_item type_regs;
323 union decode_item mask;
324 union decode_item value;
325};
326
327#define DECODE_HEADER(_type, _mask, _value, _regs) \
328 {.bits = (_type) | ((_regs) << DECODE_TYPE_BITS)}, \
329 {.bits = (_mask)}, \
330 {.bits = (_value)}
331
332
333struct decode_table {
334 struct decode_header header;
335 union decode_item table;
336};
337
338#define DECODE_TABLE(_mask, _value, _table) \
339 DECODE_HEADER(DECODE_TYPE_TABLE, _mask, _value, 0), \
340 {.table = (_table)}
341
342
343struct decode_custom {
344 struct decode_header header;
345 union decode_item decoder;
346};
347
348#define DECODE_CUSTOM(_mask, _value, _decoder) \
349 DECODE_HEADER(DECODE_TYPE_CUSTOM, _mask, _value, 0), \
350 {.action = (_decoder)}
351
352
353struct decode_simulate {
354 struct decode_header header;
355 union decode_item handler;
356};
357
358#define DECODE_SIMULATEX(_mask, _value, _handler, _regs) \
359 DECODE_HEADER(DECODE_TYPE_SIMULATE, _mask, _value, _regs), \
360 {.action = (_handler)}
361
362#define DECODE_SIMULATE(_mask, _value, _handler) \
363 DECODE_SIMULATEX(_mask, _value, _handler, 0)
364
365
366struct decode_emulate {
367 struct decode_header header;
368 union decode_item handler;
369};
370
371#define DECODE_EMULATEX(_mask, _value, _handler, _regs) \
372 DECODE_HEADER(DECODE_TYPE_EMULATE, _mask, _value, _regs), \
373 {.action = (_handler)}
374
375#define DECODE_EMULATE(_mask, _value, _handler) \
376 DECODE_EMULATEX(_mask, _value, _handler, 0)
377
378
379struct decode_or {
380 struct decode_header header;
381};
382
383#define DECODE_OR(_mask, _value) \
384 DECODE_HEADER(DECODE_TYPE_OR, _mask, _value, 0)
385
386enum probes_insn {
387 INSN_REJECTED,
388 INSN_GOOD,
389 INSN_GOOD_NO_SLOT
390};
391
392struct decode_reject {
393 struct decode_header header;
394};
395
396#define DECODE_REJECT(_mask, _value) \
397 DECODE_HEADER(DECODE_TYPE_REJECT, _mask, _value, 0)
398
399probes_insn_handler_t probes_simulate_nop;
400probes_insn_handler_t probes_emulate_none;
401
402int __kprobes
403probes_decode_insn(probes_opcode_t insn, struct arch_probes_insn *asi,
404 const union decode_item *table, bool thumb, bool emulate,
405 const union decode_action *actions);
406
407#endif
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index adabeababeb0..81ef686a91ca 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -38,6 +38,7 @@
38#include <asm/processor.h> 38#include <asm/processor.h>
39#include <asm/thread_notify.h> 39#include <asm/thread_notify.h>
40#include <asm/stacktrace.h> 40#include <asm/stacktrace.h>
41#include <asm/system_misc.h>
41#include <asm/mach/time.h> 42#include <asm/mach/time.h>
42#include <asm/tls.h> 43#include <asm/tls.h>
43 44
@@ -47,14 +48,14 @@ unsigned long __stack_chk_guard __read_mostly;
47EXPORT_SYMBOL(__stack_chk_guard); 48EXPORT_SYMBOL(__stack_chk_guard);
48#endif 49#endif
49 50
50static const char *processor_modes[] = { 51static const char *processor_modes[] __maybe_unused = {
51 "USER_26", "FIQ_26" , "IRQ_26" , "SVC_26" , "UK4_26" , "UK5_26" , "UK6_26" , "UK7_26" , 52 "USER_26", "FIQ_26" , "IRQ_26" , "SVC_26" , "UK4_26" , "UK5_26" , "UK6_26" , "UK7_26" ,
52 "UK8_26" , "UK9_26" , "UK10_26", "UK11_26", "UK12_26", "UK13_26", "UK14_26", "UK15_26", 53 "UK8_26" , "UK9_26" , "UK10_26", "UK11_26", "UK12_26", "UK13_26", "UK14_26", "UK15_26",
53 "USER_32", "FIQ_32" , "IRQ_32" , "SVC_32" , "UK4_32" , "UK5_32" , "UK6_32" , "ABT_32" , 54 "USER_32", "FIQ_32" , "IRQ_32" , "SVC_32" , "UK4_32" , "UK5_32" , "UK6_32" , "ABT_32" ,
54 "UK8_32" , "UK9_32" , "UK10_32", "UND_32" , "UK12_32", "UK13_32", "UK14_32", "SYS_32" 55 "UK8_32" , "UK9_32" , "UK10_32", "UND_32" , "UK12_32", "UK13_32", "UK14_32", "SYS_32"
55}; 56};
56 57
57static const char *isa_modes[] = { 58static const char *isa_modes[] __maybe_unused = {
58 "ARM" , "Thumb" , "Jazelle", "ThumbEE" 59 "ARM" , "Thumb" , "Jazelle", "ThumbEE"
59}; 60};
60 61
@@ -99,7 +100,7 @@ void soft_restart(unsigned long addr)
99 u64 *stack = soft_restart_stack + ARRAY_SIZE(soft_restart_stack); 100 u64 *stack = soft_restart_stack + ARRAY_SIZE(soft_restart_stack);
100 101
101 /* Disable interrupts first */ 102 /* Disable interrupts first */
102 local_irq_disable(); 103 raw_local_irq_disable();
103 local_fiq_disable(); 104 local_fiq_disable();
104 105
105 /* Disable the L2 if we're the last man standing. */ 106 /* Disable the L2 if we're the last man standing. */
@@ -270,12 +271,17 @@ void __show_regs(struct pt_regs *regs)
270 buf[3] = flags & PSR_V_BIT ? 'V' : 'v'; 271 buf[3] = flags & PSR_V_BIT ? 'V' : 'v';
271 buf[4] = '\0'; 272 buf[4] = '\0';
272 273
274#ifndef CONFIG_CPU_V7M
273 printk("Flags: %s IRQs o%s FIQs o%s Mode %s ISA %s Segment %s\n", 275 printk("Flags: %s IRQs o%s FIQs o%s Mode %s ISA %s Segment %s\n",
274 buf, interrupts_enabled(regs) ? "n" : "ff", 276 buf, interrupts_enabled(regs) ? "n" : "ff",
275 fast_interrupts_enabled(regs) ? "n" : "ff", 277 fast_interrupts_enabled(regs) ? "n" : "ff",
276 processor_modes[processor_mode(regs)], 278 processor_modes[processor_mode(regs)],
277 isa_modes[isa_mode(regs)], 279 isa_modes[isa_mode(regs)],
278 get_fs() == get_ds() ? "kernel" : "user"); 280 get_fs() == get_ds() ? "kernel" : "user");
281#else
282 printk("xPSR: %08lx\n", regs->ARM_cpsr);
283#endif
284
279#ifdef CONFIG_CPU_CP15 285#ifdef CONFIG_CPU_CP15
280 { 286 {
281 unsigned int ctrl; 287 unsigned int ctrl;
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 1e8b030dbefd..50e198c1e9c8 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -100,6 +100,9 @@ EXPORT_SYMBOL(system_serial_high);
100unsigned int elf_hwcap __read_mostly; 100unsigned int elf_hwcap __read_mostly;
101EXPORT_SYMBOL(elf_hwcap); 101EXPORT_SYMBOL(elf_hwcap);
102 102
103unsigned int elf_hwcap2 __read_mostly;
104EXPORT_SYMBOL(elf_hwcap2);
105
103 106
104#ifdef MULTI_CPU 107#ifdef MULTI_CPU
105struct processor processor __read_mostly; 108struct processor processor __read_mostly;
@@ -1005,6 +1008,15 @@ static const char *hwcap_str[] = {
1005 NULL 1008 NULL
1006}; 1009};
1007 1010
1011static const char *hwcap2_str[] = {
1012 "aes",
1013 "pmull",
1014 "sha1",
1015 "sha2",
1016 "crc32",
1017 NULL
1018};
1019
1008static int c_show(struct seq_file *m, void *v) 1020static int c_show(struct seq_file *m, void *v)
1009{ 1021{
1010 int i, j; 1022 int i, j;
@@ -1028,6 +1040,10 @@ static int c_show(struct seq_file *m, void *v)
1028 if (elf_hwcap & (1 << j)) 1040 if (elf_hwcap & (1 << j))
1029 seq_printf(m, "%s ", hwcap_str[j]); 1041 seq_printf(m, "%s ", hwcap_str[j]);
1030 1042
1043 for (j = 0; hwcap2_str[j]; j++)
1044 if (elf_hwcap2 & (1 << j))
1045 seq_printf(m, "%s ", hwcap2_str[j]);
1046
1031 seq_printf(m, "\nCPU implementer\t: 0x%02x\n", cpuid >> 24); 1047 seq_printf(m, "\nCPU implementer\t: 0x%02x\n", cpuid >> 24);
1032 seq_printf(m, "CPU architecture: %s\n", 1048 seq_printf(m, "CPU architecture: %s\n",
1033 proc_arch[cpu_architecture()]); 1049 proc_arch[cpu_architecture()]);
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 04d63880037f..bd1983437205 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -13,6 +13,7 @@
13#include <linux/personality.h> 13#include <linux/personality.h>
14#include <linux/uaccess.h> 14#include <linux/uaccess.h>
15#include <linux/tracehook.h> 15#include <linux/tracehook.h>
16#include <linux/uprobes.h>
16 17
17#include <asm/elf.h> 18#include <asm/elf.h>
18#include <asm/cacheflush.h> 19#include <asm/cacheflush.h>
@@ -590,6 +591,9 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall)
590 return restart; 591 return restart;
591 } 592 }
592 syscall = 0; 593 syscall = 0;
594 } else if (thread_flags & _TIF_UPROBE) {
595 clear_thread_flag(TIF_UPROBE);
596 uprobe_notify_resume(regs);
593 } else { 597 } else {
594 clear_thread_flag(TIF_NOTIFY_RESUME); 598 clear_thread_flag(TIF_NOTIFY_RESUME);
595 tracehook_notify_resume(regs); 599 tracehook_notify_resume(regs);
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index b7b4c86e338b..7c4fada440f0 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -674,8 +674,7 @@ static int cpufreq_callback(struct notifier_block *nb,
674 } 674 }
675 675
676 if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) || 676 if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) ||
677 (val == CPUFREQ_POSTCHANGE && freq->old > freq->new) || 677 (val == CPUFREQ_POSTCHANGE && freq->old > freq->new)) {
678 (val == CPUFREQ_RESUMECHANGE || val == CPUFREQ_SUSPENDCHANGE)) {
679 loops_per_jiffy = cpufreq_scale(global_l_p_j_ref, 678 loops_per_jiffy = cpufreq_scale(global_l_p_j_ref,
680 global_l_p_j_ref_freq, 679 global_l_p_j_ref_freq,
681 freq->new); 680 freq->new);
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 6591e26fc13f..dfc32130bc44 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -166,7 +166,7 @@ static int twd_cpufreq_transition(struct notifier_block *nb,
166 * frequency. The timer is local to a cpu, so cross-call to the 166 * frequency. The timer is local to a cpu, so cross-call to the
167 * changing cpu. 167 * changing cpu.
168 */ 168 */
169 if (state == CPUFREQ_POSTCHANGE || state == CPUFREQ_RESUMECHANGE) 169 if (state == CPUFREQ_POSTCHANGE)
170 smp_call_function_single(freqs->cpu, twd_update_frequency, 170 smp_call_function_single(freqs->cpu, twd_update_frequency,
171 NULL, 1); 171 NULL, 1);
172 172
diff --git a/arch/arm/kernel/sys_oabi-compat.c b/arch/arm/kernel/sys_oabi-compat.c
index 3e94811690ce..702bd329d9d0 100644
--- a/arch/arm/kernel/sys_oabi-compat.c
+++ b/arch/arm/kernel/sys_oabi-compat.c
@@ -203,6 +203,9 @@ asmlinkage long sys_oabi_fcntl64(unsigned int fd, unsigned int cmd,
203 int ret; 203 int ret;
204 204
205 switch (cmd) { 205 switch (cmd) {
206 case F_GETLKP:
207 case F_SETLKP:
208 case F_SETLKPW:
206 case F_GETLK64: 209 case F_GETLK64:
207 case F_SETLK64: 210 case F_SETLK64:
208 case F_SETLKW64: 211 case F_SETLKW64:
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 172ee18ff124..abd2fc067736 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -445,6 +445,7 @@ die_sig:
445 if (user_debug & UDBG_UNDEFINED) { 445 if (user_debug & UDBG_UNDEFINED) {
446 printk(KERN_INFO "%s (%d): undefined instruction: pc=%p\n", 446 printk(KERN_INFO "%s (%d): undefined instruction: pc=%p\n",
447 current->comm, task_pid_nr(current), pc); 447 current->comm, task_pid_nr(current), pc);
448 __show_regs(regs);
448 dump_instr(KERN_INFO, regs); 449 dump_instr(KERN_INFO, regs);
449 } 450 }
450#endif 451#endif
diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c
index 00df012c4678..3c217694ebec 100644
--- a/arch/arm/kernel/unwind.c
+++ b/arch/arm/kernel/unwind.c
@@ -68,6 +68,12 @@ EXPORT_SYMBOL(__aeabi_unwind_cpp_pr2);
68struct unwind_ctrl_block { 68struct unwind_ctrl_block {
69 unsigned long vrs[16]; /* virtual register set */ 69 unsigned long vrs[16]; /* virtual register set */
70 const unsigned long *insn; /* pointer to the current instructions word */ 70 const unsigned long *insn; /* pointer to the current instructions word */
71 unsigned long sp_high; /* highest value of sp allowed */
72 /*
73 * 1 : check for stack overflow for each register pop.
74 * 0 : save overhead if there is plenty of stack remaining.
75 */
76 int check_each_pop;
71 int entries; /* number of entries left to interpret */ 77 int entries; /* number of entries left to interpret */
72 int byte; /* current byte number in the instructions word */ 78 int byte; /* current byte number in the instructions word */
73}; 79};
@@ -235,12 +241,85 @@ static unsigned long unwind_get_byte(struct unwind_ctrl_block *ctrl)
235 return ret; 241 return ret;
236} 242}
237 243
244/* Before poping a register check whether it is feasible or not */
245static int unwind_pop_register(struct unwind_ctrl_block *ctrl,
246 unsigned long **vsp, unsigned int reg)
247{
248 if (unlikely(ctrl->check_each_pop))
249 if (*vsp >= (unsigned long *)ctrl->sp_high)
250 return -URC_FAILURE;
251
252 ctrl->vrs[reg] = *(*vsp)++;
253 return URC_OK;
254}
255
256/* Helper functions to execute the instructions */
257static int unwind_exec_pop_subset_r4_to_r13(struct unwind_ctrl_block *ctrl,
258 unsigned long mask)
259{
260 unsigned long *vsp = (unsigned long *)ctrl->vrs[SP];
261 int load_sp, reg = 4;
262
263 load_sp = mask & (1 << (13 - 4));
264 while (mask) {
265 if (mask & 1)
266 if (unwind_pop_register(ctrl, &vsp, reg))
267 return -URC_FAILURE;
268 mask >>= 1;
269 reg++;
270 }
271 if (!load_sp)
272 ctrl->vrs[SP] = (unsigned long)vsp;
273
274 return URC_OK;
275}
276
277static int unwind_exec_pop_r4_to_rN(struct unwind_ctrl_block *ctrl,
278 unsigned long insn)
279{
280 unsigned long *vsp = (unsigned long *)ctrl->vrs[SP];
281 int reg;
282
283 /* pop R4-R[4+bbb] */
284 for (reg = 4; reg <= 4 + (insn & 7); reg++)
285 if (unwind_pop_register(ctrl, &vsp, reg))
286 return -URC_FAILURE;
287
288 if (insn & 0x80)
289 if (unwind_pop_register(ctrl, &vsp, 14))
290 return -URC_FAILURE;
291
292 ctrl->vrs[SP] = (unsigned long)vsp;
293
294 return URC_OK;
295}
296
297static int unwind_exec_pop_subset_r0_to_r3(struct unwind_ctrl_block *ctrl,
298 unsigned long mask)
299{
300 unsigned long *vsp = (unsigned long *)ctrl->vrs[SP];
301 int reg = 0;
302
303 /* pop R0-R3 according to mask */
304 while (mask) {
305 if (mask & 1)
306 if (unwind_pop_register(ctrl, &vsp, reg))
307 return -URC_FAILURE;
308 mask >>= 1;
309 reg++;
310 }
311 ctrl->vrs[SP] = (unsigned long)vsp;
312
313 return URC_OK;
314}
315
238/* 316/*
239 * Execute the current unwind instruction. 317 * Execute the current unwind instruction.
240 */ 318 */
241static int unwind_exec_insn(struct unwind_ctrl_block *ctrl) 319static int unwind_exec_insn(struct unwind_ctrl_block *ctrl)
242{ 320{
243 unsigned long insn = unwind_get_byte(ctrl); 321 unsigned long insn = unwind_get_byte(ctrl);
322 int ret = URC_OK;
244 323
245 pr_debug("%s: insn = %08lx\n", __func__, insn); 324 pr_debug("%s: insn = %08lx\n", __func__, insn);
246 325
@@ -250,8 +329,6 @@ static int unwind_exec_insn(struct unwind_ctrl_block *ctrl)
250 ctrl->vrs[SP] -= ((insn & 0x3f) << 2) + 4; 329 ctrl->vrs[SP] -= ((insn & 0x3f) << 2) + 4;
251 else if ((insn & 0xf0) == 0x80) { 330 else if ((insn & 0xf0) == 0x80) {
252 unsigned long mask; 331 unsigned long mask;
253 unsigned long *vsp = (unsigned long *)ctrl->vrs[SP];
254 int load_sp, reg = 4;
255 332
256 insn = (insn << 8) | unwind_get_byte(ctrl); 333 insn = (insn << 8) | unwind_get_byte(ctrl);
257 mask = insn & 0x0fff; 334 mask = insn & 0x0fff;
@@ -261,29 +338,16 @@ static int unwind_exec_insn(struct unwind_ctrl_block *ctrl)
261 return -URC_FAILURE; 338 return -URC_FAILURE;
262 } 339 }
263 340
264 /* pop R4-R15 according to mask */ 341 ret = unwind_exec_pop_subset_r4_to_r13(ctrl, mask);
265 load_sp = mask & (1 << (13 - 4)); 342 if (ret)
266 while (mask) { 343 goto error;
267 if (mask & 1)
268 ctrl->vrs[reg] = *vsp++;
269 mask >>= 1;
270 reg++;
271 }
272 if (!load_sp)
273 ctrl->vrs[SP] = (unsigned long)vsp;
274 } else if ((insn & 0xf0) == 0x90 && 344 } else if ((insn & 0xf0) == 0x90 &&
275 (insn & 0x0d) != 0x0d) 345 (insn & 0x0d) != 0x0d)
276 ctrl->vrs[SP] = ctrl->vrs[insn & 0x0f]; 346 ctrl->vrs[SP] = ctrl->vrs[insn & 0x0f];
277 else if ((insn & 0xf0) == 0xa0) { 347 else if ((insn & 0xf0) == 0xa0) {
278 unsigned long *vsp = (unsigned long *)ctrl->vrs[SP]; 348 ret = unwind_exec_pop_r4_to_rN(ctrl, insn);
279 int reg; 349 if (ret)
280 350 goto error;
281 /* pop R4-R[4+bbb] */
282 for (reg = 4; reg <= 4 + (insn & 7); reg++)
283 ctrl->vrs[reg] = *vsp++;
284 if (insn & 0x80)
285 ctrl->vrs[14] = *vsp++;
286 ctrl->vrs[SP] = (unsigned long)vsp;
287 } else if (insn == 0xb0) { 351 } else if (insn == 0xb0) {
288 if (ctrl->vrs[PC] == 0) 352 if (ctrl->vrs[PC] == 0)
289 ctrl->vrs[PC] = ctrl->vrs[LR]; 353 ctrl->vrs[PC] = ctrl->vrs[LR];
@@ -291,8 +355,6 @@ static int unwind_exec_insn(struct unwind_ctrl_block *ctrl)
291 ctrl->entries = 0; 355 ctrl->entries = 0;
292 } else if (insn == 0xb1) { 356 } else if (insn == 0xb1) {
293 unsigned long mask = unwind_get_byte(ctrl); 357 unsigned long mask = unwind_get_byte(ctrl);
294 unsigned long *vsp = (unsigned long *)ctrl->vrs[SP];
295 int reg = 0;
296 358
297 if (mask == 0 || mask & 0xf0) { 359 if (mask == 0 || mask & 0xf0) {
298 pr_warning("unwind: Spare encoding %04lx\n", 360 pr_warning("unwind: Spare encoding %04lx\n",
@@ -300,14 +362,9 @@ static int unwind_exec_insn(struct unwind_ctrl_block *ctrl)
300 return -URC_FAILURE; 362 return -URC_FAILURE;
301 } 363 }
302 364
303 /* pop R0-R3 according to mask */ 365 ret = unwind_exec_pop_subset_r0_to_r3(ctrl, mask);
304 while (mask) { 366 if (ret)
305 if (mask & 1) 367 goto error;
306 ctrl->vrs[reg] = *vsp++;
307 mask >>= 1;
308 reg++;
309 }
310 ctrl->vrs[SP] = (unsigned long)vsp;
311 } else if (insn == 0xb2) { 368 } else if (insn == 0xb2) {
312 unsigned long uleb128 = unwind_get_byte(ctrl); 369 unsigned long uleb128 = unwind_get_byte(ctrl);
313 370
@@ -320,7 +377,8 @@ static int unwind_exec_insn(struct unwind_ctrl_block *ctrl)
320 pr_debug("%s: fp = %08lx sp = %08lx lr = %08lx pc = %08lx\n", __func__, 377 pr_debug("%s: fp = %08lx sp = %08lx lr = %08lx pc = %08lx\n", __func__,
321 ctrl->vrs[FP], ctrl->vrs[SP], ctrl->vrs[LR], ctrl->vrs[PC]); 378 ctrl->vrs[FP], ctrl->vrs[SP], ctrl->vrs[LR], ctrl->vrs[PC]);
322 379
323 return URC_OK; 380error:
381 return ret;
324} 382}
325 383
326/* 384/*
@@ -329,13 +387,13 @@ static int unwind_exec_insn(struct unwind_ctrl_block *ctrl)
329 */ 387 */
330int unwind_frame(struct stackframe *frame) 388int unwind_frame(struct stackframe *frame)
331{ 389{
332 unsigned long high, low; 390 unsigned long low;
333 const struct unwind_idx *idx; 391 const struct unwind_idx *idx;
334 struct unwind_ctrl_block ctrl; 392 struct unwind_ctrl_block ctrl;
335 393
336 /* only go to a higher address on the stack */ 394 /* store the highest address on the stack to avoid crossing it*/
337 low = frame->sp; 395 low = frame->sp;
338 high = ALIGN(low, THREAD_SIZE); 396 ctrl.sp_high = ALIGN(low, THREAD_SIZE);
339 397
340 pr_debug("%s(pc = %08lx lr = %08lx sp = %08lx)\n", __func__, 398 pr_debug("%s(pc = %08lx lr = %08lx sp = %08lx)\n", __func__,
341 frame->pc, frame->lr, frame->sp); 399 frame->pc, frame->lr, frame->sp);
@@ -382,11 +440,16 @@ int unwind_frame(struct stackframe *frame)
382 return -URC_FAILURE; 440 return -URC_FAILURE;
383 } 441 }
384 442
443 ctrl.check_each_pop = 0;
444
385 while (ctrl.entries > 0) { 445 while (ctrl.entries > 0) {
386 int urc = unwind_exec_insn(&ctrl); 446 int urc;
447 if ((ctrl.sp_high - ctrl.vrs[SP]) < sizeof(ctrl.vrs))
448 ctrl.check_each_pop = 1;
449 urc = unwind_exec_insn(&ctrl);
387 if (urc < 0) 450 if (urc < 0)
388 return urc; 451 return urc;
389 if (ctrl.vrs[SP] < low || ctrl.vrs[SP] >= high) 452 if (ctrl.vrs[SP] < low || ctrl.vrs[SP] >= ctrl.sp_high)
390 return -URC_FAILURE; 453 return -URC_FAILURE;
391 } 454 }
392 455
diff --git a/arch/arm/kernel/uprobes-arm.c b/arch/arm/kernel/uprobes-arm.c
new file mode 100644
index 000000000000..d3b655ff17da
--- /dev/null
+++ b/arch/arm/kernel/uprobes-arm.c
@@ -0,0 +1,234 @@
1/*
2 * Copyright (C) 2012 Rabin Vincent <rabin at rab.in>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#include <linux/kernel.h>
10#include <linux/types.h>
11#include <linux/stddef.h>
12#include <linux/wait.h>
13#include <linux/uprobes.h>
14#include <linux/module.h>
15
16#include "probes.h"
17#include "probes-arm.h"
18#include "uprobes.h"
19
20static int uprobes_substitute_pc(unsigned long *pinsn, u32 oregs)
21{
22 probes_opcode_t insn = __mem_to_opcode_arm(*pinsn);
23 probes_opcode_t temp;
24 probes_opcode_t mask;
25 int freereg;
26 u32 free = 0xffff;
27 u32 regs;
28
29 for (regs = oregs; regs; regs >>= 4, insn >>= 4) {
30 if ((regs & 0xf) == REG_TYPE_NONE)
31 continue;
32
33 free &= ~(1 << (insn & 0xf));
34 }
35
36 /* No PC, no problem */
37 if (free & (1 << 15))
38 return 15;
39
40 if (!free)
41 return -1;
42
43 /*
44 * fls instead of ffs ensures that for "ldrd r0, r1, [pc]" we would
45 * pick LR instead of R1.
46 */
47 freereg = free = fls(free) - 1;
48
49 temp = __mem_to_opcode_arm(*pinsn);
50 insn = temp;
51 regs = oregs;
52 mask = 0xf;
53
54 for (; regs; regs >>= 4, mask <<= 4, free <<= 4, temp >>= 4) {
55 if ((regs & 0xf) == REG_TYPE_NONE)
56 continue;
57
58 if ((temp & 0xf) != 15)
59 continue;
60
61 insn &= ~mask;
62 insn |= free & mask;
63 }
64
65 *pinsn = __opcode_to_mem_arm(insn);
66 return freereg;
67}
68
69static void uprobe_set_pc(struct arch_uprobe *auprobe,
70 struct arch_uprobe_task *autask,
71 struct pt_regs *regs)
72{
73 u32 pcreg = auprobe->pcreg;
74
75 autask->backup = regs->uregs[pcreg];
76 regs->uregs[pcreg] = regs->ARM_pc + 8;
77}
78
79static void uprobe_unset_pc(struct arch_uprobe *auprobe,
80 struct arch_uprobe_task *autask,
81 struct pt_regs *regs)
82{
83 /* PC will be taken care of by common code */
84 regs->uregs[auprobe->pcreg] = autask->backup;
85}
86
87static void uprobe_aluwrite_pc(struct arch_uprobe *auprobe,
88 struct arch_uprobe_task *autask,
89 struct pt_regs *regs)
90{
91 u32 pcreg = auprobe->pcreg;
92
93 alu_write_pc(regs->uregs[pcreg], regs);
94 regs->uregs[pcreg] = autask->backup;
95}
96
97static void uprobe_write_pc(struct arch_uprobe *auprobe,
98 struct arch_uprobe_task *autask,
99 struct pt_regs *regs)
100{
101 u32 pcreg = auprobe->pcreg;
102
103 load_write_pc(regs->uregs[pcreg], regs);
104 regs->uregs[pcreg] = autask->backup;
105}
106
107enum probes_insn
108decode_pc_ro(probes_opcode_t insn, struct arch_probes_insn *asi,
109 const struct decode_header *d)
110{
111 struct arch_uprobe *auprobe = container_of(asi, struct arch_uprobe,
112 asi);
113 struct decode_emulate *decode = (struct decode_emulate *) d;
114 u32 regs = decode->header.type_regs.bits >> DECODE_TYPE_BITS;
115 int reg;
116
117 reg = uprobes_substitute_pc(&auprobe->ixol[0], regs);
118 if (reg == 15)
119 return INSN_GOOD;
120
121 if (reg == -1)
122 return INSN_REJECTED;
123
124 auprobe->pcreg = reg;
125 auprobe->prehandler = uprobe_set_pc;
126 auprobe->posthandler = uprobe_unset_pc;
127
128 return INSN_GOOD;
129}
130
131enum probes_insn
132decode_wb_pc(probes_opcode_t insn, struct arch_probes_insn *asi,
133 const struct decode_header *d, bool alu)
134{
135 struct arch_uprobe *auprobe = container_of(asi, struct arch_uprobe,
136 asi);
137 enum probes_insn ret = decode_pc_ro(insn, asi, d);
138
139 if (((insn >> 12) & 0xf) == 15)
140 auprobe->posthandler = alu ? uprobe_aluwrite_pc
141 : uprobe_write_pc;
142
143 return ret;
144}
145
146enum probes_insn
147decode_rd12rn16rm0rs8_rwflags(probes_opcode_t insn,
148 struct arch_probes_insn *asi,
149 const struct decode_header *d)
150{
151 return decode_wb_pc(insn, asi, d, true);
152}
153
154enum probes_insn
155decode_ldr(probes_opcode_t insn, struct arch_probes_insn *asi,
156 const struct decode_header *d)
157{
158 return decode_wb_pc(insn, asi, d, false);
159}
160
161enum probes_insn
162uprobe_decode_ldmstm(probes_opcode_t insn,
163 struct arch_probes_insn *asi,
164 const struct decode_header *d)
165{
166 struct arch_uprobe *auprobe = container_of(asi, struct arch_uprobe,
167 asi);
168 unsigned reglist = insn & 0xffff;
169 int rn = (insn >> 16) & 0xf;
170 int lbit = insn & (1 << 20);
171 unsigned used = reglist | (1 << rn);
172
173 if (rn == 15)
174 return INSN_REJECTED;
175
176 if (!(used & (1 << 15)))
177 return INSN_GOOD;
178
179 if (used & (1 << 14))
180 return INSN_REJECTED;
181
182 /* Use LR instead of PC */
183 insn ^= 0xc000;
184
185 auprobe->pcreg = 14;
186 auprobe->ixol[0] = __opcode_to_mem_arm(insn);
187
188 auprobe->prehandler = uprobe_set_pc;
189 if (lbit)
190 auprobe->posthandler = uprobe_write_pc;
191 else
192 auprobe->posthandler = uprobe_unset_pc;
193
194 return INSN_GOOD;
195}
196
197const union decode_action uprobes_probes_actions[] = {
198 [PROBES_EMULATE_NONE] = {.handler = probes_simulate_nop},
199 [PROBES_SIMULATE_NOP] = {.handler = probes_simulate_nop},
200 [PROBES_PRELOAD_IMM] = {.handler = probes_simulate_nop},
201 [PROBES_PRELOAD_REG] = {.handler = probes_simulate_nop},
202 [PROBES_BRANCH_IMM] = {.handler = simulate_blx1},
203 [PROBES_MRS] = {.handler = simulate_mrs},
204 [PROBES_BRANCH_REG] = {.handler = simulate_blx2bx},
205 [PROBES_CLZ] = {.handler = probes_simulate_nop},
206 [PROBES_SATURATING_ARITHMETIC] = {.handler = probes_simulate_nop},
207 [PROBES_MUL1] = {.handler = probes_simulate_nop},
208 [PROBES_MUL2] = {.handler = probes_simulate_nop},
209 [PROBES_SWP] = {.handler = probes_simulate_nop},
210 [PROBES_LDRSTRD] = {.decoder = decode_pc_ro},
211 [PROBES_LOAD_EXTRA] = {.decoder = decode_pc_ro},
212 [PROBES_LOAD] = {.decoder = decode_ldr},
213 [PROBES_STORE_EXTRA] = {.decoder = decode_pc_ro},
214 [PROBES_STORE] = {.decoder = decode_pc_ro},
215 [PROBES_MOV_IP_SP] = {.handler = simulate_mov_ipsp},
216 [PROBES_DATA_PROCESSING_REG] = {
217 .decoder = decode_rd12rn16rm0rs8_rwflags},
218 [PROBES_DATA_PROCESSING_IMM] = {
219 .decoder = decode_rd12rn16rm0rs8_rwflags},
220 [PROBES_MOV_HALFWORD] = {.handler = probes_simulate_nop},
221 [PROBES_SEV] = {.handler = probes_simulate_nop},
222 [PROBES_WFE] = {.handler = probes_simulate_nop},
223 [PROBES_SATURATE] = {.handler = probes_simulate_nop},
224 [PROBES_REV] = {.handler = probes_simulate_nop},
225 [PROBES_MMI] = {.handler = probes_simulate_nop},
226 [PROBES_PACK] = {.handler = probes_simulate_nop},
227 [PROBES_EXTEND] = {.handler = probes_simulate_nop},
228 [PROBES_EXTEND_ADD] = {.handler = probes_simulate_nop},
229 [PROBES_MUL_ADD_LONG] = {.handler = probes_simulate_nop},
230 [PROBES_MUL_ADD] = {.handler = probes_simulate_nop},
231 [PROBES_BITFIELD] = {.handler = probes_simulate_nop},
232 [PROBES_BRANCH] = {.handler = simulate_bbl},
233 [PROBES_LDMSTM] = {.decoder = uprobe_decode_ldmstm}
234};
diff --git a/arch/arm/kernel/uprobes.c b/arch/arm/kernel/uprobes.c
new file mode 100644
index 000000000000..f9bacee973bf
--- /dev/null
+++ b/arch/arm/kernel/uprobes.c
@@ -0,0 +1,210 @@
1/*
2 * Copyright (C) 2012 Rabin Vincent <rabin at rab.in>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#include <linux/kernel.h>
10#include <linux/stddef.h>
11#include <linux/errno.h>
12#include <linux/highmem.h>
13#include <linux/sched.h>
14#include <linux/uprobes.h>
15#include <linux/notifier.h>
16
17#include <asm/opcodes.h>
18#include <asm/traps.h>
19
20#include "probes.h"
21#include "probes-arm.h"
22#include "uprobes.h"
23
24#define UPROBE_TRAP_NR UINT_MAX
25
26bool is_swbp_insn(uprobe_opcode_t *insn)
27{
28 return (__mem_to_opcode_arm(*insn) & 0x0fffffff) ==
29 (UPROBE_SWBP_ARM_INSN & 0x0fffffff);
30}
31
32int set_swbp(struct arch_uprobe *auprobe, struct mm_struct *mm,
33 unsigned long vaddr)
34{
35 return uprobe_write_opcode(mm, vaddr,
36 __opcode_to_mem_arm(auprobe->bpinsn));
37}
38
39bool arch_uprobe_ignore(struct arch_uprobe *auprobe, struct pt_regs *regs)
40{
41 if (!auprobe->asi.insn_check_cc(regs->ARM_cpsr)) {
42 regs->ARM_pc += 4;
43 return true;
44 }
45
46 return false;
47}
48
49bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs)
50{
51 probes_opcode_t opcode;
52
53 if (!auprobe->simulate)
54 return false;
55
56 opcode = __mem_to_opcode_arm(*(unsigned int *) auprobe->insn);
57
58 auprobe->asi.insn_singlestep(opcode, &auprobe->asi, regs);
59
60 return true;
61}
62
63unsigned long
64arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr,
65 struct pt_regs *regs)
66{
67 unsigned long orig_ret_vaddr;
68
69 orig_ret_vaddr = regs->ARM_lr;
70 /* Replace the return addr with trampoline addr */
71 regs->ARM_lr = trampoline_vaddr;
72 return orig_ret_vaddr;
73}
74
75int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm,
76 unsigned long addr)
77{
78 unsigned int insn;
79 unsigned int bpinsn;
80 enum probes_insn ret;
81
82 /* Thumb not yet support */
83 if (addr & 0x3)
84 return -EINVAL;
85
86 insn = __mem_to_opcode_arm(*(unsigned int *)auprobe->insn);
87 auprobe->ixol[0] = __opcode_to_mem_arm(insn);
88 auprobe->ixol[1] = __opcode_to_mem_arm(UPROBE_SS_ARM_INSN);
89
90 ret = arm_probes_decode_insn(insn, &auprobe->asi, false,
91 uprobes_probes_actions);
92 switch (ret) {
93 case INSN_REJECTED:
94 return -EINVAL;
95
96 case INSN_GOOD_NO_SLOT:
97 auprobe->simulate = true;
98 break;
99
100 case INSN_GOOD:
101 default:
102 break;
103 }
104
105 bpinsn = UPROBE_SWBP_ARM_INSN & 0x0fffffff;
106 if (insn >= 0xe0000000)
107 bpinsn |= 0xe0000000; /* Unconditional instruction */
108 else
109 bpinsn |= insn & 0xf0000000; /* Copy condition from insn */
110
111 auprobe->bpinsn = bpinsn;
112
113 return 0;
114}
115
116int arch_uprobe_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
117{
118 struct uprobe_task *utask = current->utask;
119
120 if (auprobe->prehandler)
121 auprobe->prehandler(auprobe, &utask->autask, regs);
122
123 utask->autask.saved_trap_no = current->thread.trap_no;
124 current->thread.trap_no = UPROBE_TRAP_NR;
125 regs->ARM_pc = utask->xol_vaddr;
126
127 return 0;
128}
129
130int arch_uprobe_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
131{
132 struct uprobe_task *utask = current->utask;
133
134 WARN_ON_ONCE(current->thread.trap_no != UPROBE_TRAP_NR);
135
136 current->thread.trap_no = utask->autask.saved_trap_no;
137 regs->ARM_pc = utask->vaddr + 4;
138
139 if (auprobe->posthandler)
140 auprobe->posthandler(auprobe, &utask->autask, regs);
141
142 return 0;
143}
144
145bool arch_uprobe_xol_was_trapped(struct task_struct *t)
146{
147 if (t->thread.trap_no != UPROBE_TRAP_NR)
148 return true;
149
150 return false;
151}
152
153void arch_uprobe_abort_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
154{
155 struct uprobe_task *utask = current->utask;
156
157 current->thread.trap_no = utask->autask.saved_trap_no;
158 instruction_pointer_set(regs, utask->vaddr);
159}
160
161int arch_uprobe_exception_notify(struct notifier_block *self,
162 unsigned long val, void *data)
163{
164 return NOTIFY_DONE;
165}
166
167static int uprobe_trap_handler(struct pt_regs *regs, unsigned int instr)
168{
169 unsigned long flags;
170
171 local_irq_save(flags);
172 instr &= 0x0fffffff;
173 if (instr == (UPROBE_SWBP_ARM_INSN & 0x0fffffff))
174 uprobe_pre_sstep_notifier(regs);
175 else if (instr == (UPROBE_SS_ARM_INSN & 0x0fffffff))
176 uprobe_post_sstep_notifier(regs);
177 local_irq_restore(flags);
178
179 return 0;
180}
181
182unsigned long uprobe_get_swbp_addr(struct pt_regs *regs)
183{
184 return instruction_pointer(regs);
185}
186
187static struct undef_hook uprobes_arm_break_hook = {
188 .instr_mask = 0x0fffffff,
189 .instr_val = (UPROBE_SWBP_ARM_INSN & 0x0fffffff),
190 .cpsr_mask = MODE_MASK,
191 .cpsr_val = USR_MODE,
192 .fn = uprobe_trap_handler,
193};
194
195static struct undef_hook uprobes_arm_ss_hook = {
196 .instr_mask = 0x0fffffff,
197 .instr_val = (UPROBE_SS_ARM_INSN & 0x0fffffff),
198 .cpsr_mask = MODE_MASK,
199 .cpsr_val = USR_MODE,
200 .fn = uprobe_trap_handler,
201};
202
203static int arch_uprobes_init(void)
204{
205 register_undef_hook(&uprobes_arm_break_hook);
206 register_undef_hook(&uprobes_arm_ss_hook);
207
208 return 0;
209}
210device_initcall(arch_uprobes_init);
diff --git a/arch/arm/kernel/uprobes.h b/arch/arm/kernel/uprobes.h
new file mode 100644
index 000000000000..1d0c12dfbd03
--- /dev/null
+++ b/arch/arm/kernel/uprobes.h
@@ -0,0 +1,35 @@
1/*
2 * Copyright (C) 2012 Rabin Vincent <rabin at rab.in>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __ARM_KERNEL_UPROBES_H
10#define __ARM_KERNEL_UPROBES_H
11
12enum probes_insn uprobe_decode_ldmstm(probes_opcode_t insn,
13 struct arch_probes_insn *asi,
14 const struct decode_header *d);
15
16enum probes_insn decode_ldr(probes_opcode_t insn,
17 struct arch_probes_insn *asi,
18 const struct decode_header *d);
19
20enum probes_insn
21decode_rd12rn16rm0rs8_rwflags(probes_opcode_t insn,
22 struct arch_probes_insn *asi,
23 const struct decode_header *d);
24
25enum probes_insn
26decode_wb_pc(probes_opcode_t insn, struct arch_probes_insn *asi,
27 const struct decode_header *d, bool alu);
28
29enum probes_insn
30decode_pc_ro(probes_opcode_t insn, struct arch_probes_insn *asi,
31 const struct decode_header *d);
32
33extern const union decode_action uprobes_probes_actions[];
34
35#endif
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index bd18bb8b2770..f0e50a0f3a65 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -1051,21 +1051,26 @@ int kvm_arch_init(void *opaque)
1051 } 1051 }
1052 } 1052 }
1053 1053
1054 cpu_notifier_register_begin();
1055
1054 err = init_hyp_mode(); 1056 err = init_hyp_mode();
1055 if (err) 1057 if (err)
1056 goto out_err; 1058 goto out_err;
1057 1059
1058 err = register_cpu_notifier(&hyp_init_cpu_nb); 1060 err = __register_cpu_notifier(&hyp_init_cpu_nb);
1059 if (err) { 1061 if (err) {
1060 kvm_err("Cannot register HYP init CPU notifier (%d)\n", err); 1062 kvm_err("Cannot register HYP init CPU notifier (%d)\n", err);
1061 goto out_err; 1063 goto out_err;
1062 } 1064 }
1063 1065
1066 cpu_notifier_register_done();
1067
1064 hyp_cpu_pm_init(); 1068 hyp_cpu_pm_init();
1065 1069
1066 kvm_coproc_table_init(); 1070 kvm_coproc_table_init();
1067 return 0; 1071 return 0;
1068out_err: 1072out_err:
1073 cpu_notifier_register_done();
1069 return err; 1074 return err;
1070} 1075}
1071 1076
diff --git a/arch/arm/kvm/coproc.c b/arch/arm/kvm/coproc.c
index 78c0885d6501..c58a35116f63 100644
--- a/arch/arm/kvm/coproc.c
+++ b/arch/arm/kvm/coproc.c
@@ -23,6 +23,7 @@
23#include <asm/kvm_host.h> 23#include <asm/kvm_host.h>
24#include <asm/kvm_emulate.h> 24#include <asm/kvm_emulate.h>
25#include <asm/kvm_coproc.h> 25#include <asm/kvm_coproc.h>
26#include <asm/kvm_mmu.h>
26#include <asm/cacheflush.h> 27#include <asm/cacheflush.h>
27#include <asm/cputype.h> 28#include <asm/cputype.h>
28#include <trace/events/kvm.h> 29#include <trace/events/kvm.h>
@@ -205,6 +206,44 @@ done:
205} 206}
206 207
207/* 208/*
209 * Generic accessor for VM registers. Only called as long as HCR_TVM
210 * is set.
211 */
212static bool access_vm_reg(struct kvm_vcpu *vcpu,
213 const struct coproc_params *p,
214 const struct coproc_reg *r)
215{
216 BUG_ON(!p->is_write);
217
218 vcpu->arch.cp15[r->reg] = *vcpu_reg(vcpu, p->Rt1);
219 if (p->is_64bit)
220 vcpu->arch.cp15[r->reg + 1] = *vcpu_reg(vcpu, p->Rt2);
221
222 return true;
223}
224
225/*
226 * SCTLR accessor. Only called as long as HCR_TVM is set. If the
227 * guest enables the MMU, we stop trapping the VM sys_regs and leave
228 * it in complete control of the caches.
229 *
230 * Used by the cpu-specific code.
231 */
232bool access_sctlr(struct kvm_vcpu *vcpu,
233 const struct coproc_params *p,
234 const struct coproc_reg *r)
235{
236 access_vm_reg(vcpu, p, r);
237
238 if (vcpu_has_cache_enabled(vcpu)) { /* MMU+Caches enabled? */
239 vcpu->arch.hcr &= ~HCR_TVM;
240 stage2_flush_vm(vcpu->kvm);
241 }
242
243 return true;
244}
245
246/*
208 * We could trap ID_DFR0 and tell the guest we don't support performance 247 * We could trap ID_DFR0 and tell the guest we don't support performance
209 * monitoring. Unfortunately the patch to make the kernel check ID_DFR0 was 248 * monitoring. Unfortunately the patch to make the kernel check ID_DFR0 was
210 * NAKed, so it will read the PMCR anyway. 249 * NAKed, so it will read the PMCR anyway.
@@ -261,33 +300,36 @@ static const struct coproc_reg cp15_regs[] = {
261 { CRn( 1), CRm( 0), Op1( 0), Op2( 2), is32, 300 { CRn( 1), CRm( 0), Op1( 0), Op2( 2), is32,
262 NULL, reset_val, c1_CPACR, 0x00000000 }, 301 NULL, reset_val, c1_CPACR, 0x00000000 },
263 302
264 /* TTBR0/TTBR1: swapped by interrupt.S. */ 303 /* TTBR0/TTBR1/TTBCR: swapped by interrupt.S. */
265 { CRm64( 2), Op1( 0), is64, NULL, reset_unknown64, c2_TTBR0 }, 304 { CRm64( 2), Op1( 0), is64, access_vm_reg, reset_unknown64, c2_TTBR0 },
266 { CRm64( 2), Op1( 1), is64, NULL, reset_unknown64, c2_TTBR1 }, 305 { CRn(2), CRm( 0), Op1( 0), Op2( 0), is32,
267 306 access_vm_reg, reset_unknown, c2_TTBR0 },
268 /* TTBCR: swapped by interrupt.S. */ 307 { CRn(2), CRm( 0), Op1( 0), Op2( 1), is32,
308 access_vm_reg, reset_unknown, c2_TTBR1 },
269 { CRn( 2), CRm( 0), Op1( 0), Op2( 2), is32, 309 { CRn( 2), CRm( 0), Op1( 0), Op2( 2), is32,
270 NULL, reset_val, c2_TTBCR, 0x00000000 }, 310 access_vm_reg, reset_val, c2_TTBCR, 0x00000000 },
311 { CRm64( 2), Op1( 1), is64, access_vm_reg, reset_unknown64, c2_TTBR1 },
312
271 313
272 /* DACR: swapped by interrupt.S. */ 314 /* DACR: swapped by interrupt.S. */
273 { CRn( 3), CRm( 0), Op1( 0), Op2( 0), is32, 315 { CRn( 3), CRm( 0), Op1( 0), Op2( 0), is32,
274 NULL, reset_unknown, c3_DACR }, 316 access_vm_reg, reset_unknown, c3_DACR },
275 317
276 /* DFSR/IFSR/ADFSR/AIFSR: swapped by interrupt.S. */ 318 /* DFSR/IFSR/ADFSR/AIFSR: swapped by interrupt.S. */
277 { CRn( 5), CRm( 0), Op1( 0), Op2( 0), is32, 319 { CRn( 5), CRm( 0), Op1( 0), Op2( 0), is32,
278 NULL, reset_unknown, c5_DFSR }, 320 access_vm_reg, reset_unknown, c5_DFSR },
279 { CRn( 5), CRm( 0), Op1( 0), Op2( 1), is32, 321 { CRn( 5), CRm( 0), Op1( 0), Op2( 1), is32,
280 NULL, reset_unknown, c5_IFSR }, 322 access_vm_reg, reset_unknown, c5_IFSR },
281 { CRn( 5), CRm( 1), Op1( 0), Op2( 0), is32, 323 { CRn( 5), CRm( 1), Op1( 0), Op2( 0), is32,
282 NULL, reset_unknown, c5_ADFSR }, 324 access_vm_reg, reset_unknown, c5_ADFSR },
283 { CRn( 5), CRm( 1), Op1( 0), Op2( 1), is32, 325 { CRn( 5), CRm( 1), Op1( 0), Op2( 1), is32,
284 NULL, reset_unknown, c5_AIFSR }, 326 access_vm_reg, reset_unknown, c5_AIFSR },
285 327
286 /* DFAR/IFAR: swapped by interrupt.S. */ 328 /* DFAR/IFAR: swapped by interrupt.S. */
287 { CRn( 6), CRm( 0), Op1( 0), Op2( 0), is32, 329 { CRn( 6), CRm( 0), Op1( 0), Op2( 0), is32,
288 NULL, reset_unknown, c6_DFAR }, 330 access_vm_reg, reset_unknown, c6_DFAR },
289 { CRn( 6), CRm( 0), Op1( 0), Op2( 2), is32, 331 { CRn( 6), CRm( 0), Op1( 0), Op2( 2), is32,
290 NULL, reset_unknown, c6_IFAR }, 332 access_vm_reg, reset_unknown, c6_IFAR },
291 333
292 /* PAR swapped by interrupt.S */ 334 /* PAR swapped by interrupt.S */
293 { CRm64( 7), Op1( 0), is64, NULL, reset_unknown64, c7_PAR }, 335 { CRm64( 7), Op1( 0), is64, NULL, reset_unknown64, c7_PAR },
@@ -324,9 +366,15 @@ static const struct coproc_reg cp15_regs[] = {
324 366
325 /* PRRR/NMRR (aka MAIR0/MAIR1): swapped by interrupt.S. */ 367 /* PRRR/NMRR (aka MAIR0/MAIR1): swapped by interrupt.S. */
326 { CRn(10), CRm( 2), Op1( 0), Op2( 0), is32, 368 { CRn(10), CRm( 2), Op1( 0), Op2( 0), is32,
327 NULL, reset_unknown, c10_PRRR}, 369 access_vm_reg, reset_unknown, c10_PRRR},
328 { CRn(10), CRm( 2), Op1( 0), Op2( 1), is32, 370 { CRn(10), CRm( 2), Op1( 0), Op2( 1), is32,
329 NULL, reset_unknown, c10_NMRR}, 371 access_vm_reg, reset_unknown, c10_NMRR},
372
373 /* AMAIR0/AMAIR1: swapped by interrupt.S. */
374 { CRn(10), CRm( 3), Op1( 0), Op2( 0), is32,
375 access_vm_reg, reset_unknown, c10_AMAIR0},
376 { CRn(10), CRm( 3), Op1( 0), Op2( 1), is32,
377 access_vm_reg, reset_unknown, c10_AMAIR1},
330 378
331 /* VBAR: swapped by interrupt.S. */ 379 /* VBAR: swapped by interrupt.S. */
332 { CRn(12), CRm( 0), Op1( 0), Op2( 0), is32, 380 { CRn(12), CRm( 0), Op1( 0), Op2( 0), is32,
@@ -334,7 +382,7 @@ static const struct coproc_reg cp15_regs[] = {
334 382
335 /* CONTEXTIDR/TPIDRURW/TPIDRURO/TPIDRPRW: swapped by interrupt.S. */ 383 /* CONTEXTIDR/TPIDRURW/TPIDRURO/TPIDRPRW: swapped by interrupt.S. */
336 { CRn(13), CRm( 0), Op1( 0), Op2( 1), is32, 384 { CRn(13), CRm( 0), Op1( 0), Op2( 1), is32,
337 NULL, reset_val, c13_CID, 0x00000000 }, 385 access_vm_reg, reset_val, c13_CID, 0x00000000 },
338 { CRn(13), CRm( 0), Op1( 0), Op2( 2), is32, 386 { CRn(13), CRm( 0), Op1( 0), Op2( 2), is32,
339 NULL, reset_unknown, c13_TID_URW }, 387 NULL, reset_unknown, c13_TID_URW },
340 { CRn(13), CRm( 0), Op1( 0), Op2( 3), is32, 388 { CRn(13), CRm( 0), Op1( 0), Op2( 3), is32,
@@ -443,7 +491,7 @@ int kvm_handle_cp15_64(struct kvm_vcpu *vcpu, struct kvm_run *run)
443{ 491{
444 struct coproc_params params; 492 struct coproc_params params;
445 493
446 params.CRm = (kvm_vcpu_get_hsr(vcpu) >> 1) & 0xf; 494 params.CRn = (kvm_vcpu_get_hsr(vcpu) >> 1) & 0xf;
447 params.Rt1 = (kvm_vcpu_get_hsr(vcpu) >> 5) & 0xf; 495 params.Rt1 = (kvm_vcpu_get_hsr(vcpu) >> 5) & 0xf;
448 params.is_write = ((kvm_vcpu_get_hsr(vcpu) & 1) == 0); 496 params.is_write = ((kvm_vcpu_get_hsr(vcpu) & 1) == 0);
449 params.is_64bit = true; 497 params.is_64bit = true;
@@ -451,7 +499,7 @@ int kvm_handle_cp15_64(struct kvm_vcpu *vcpu, struct kvm_run *run)
451 params.Op1 = (kvm_vcpu_get_hsr(vcpu) >> 16) & 0xf; 499 params.Op1 = (kvm_vcpu_get_hsr(vcpu) >> 16) & 0xf;
452 params.Op2 = 0; 500 params.Op2 = 0;
453 params.Rt2 = (kvm_vcpu_get_hsr(vcpu) >> 10) & 0xf; 501 params.Rt2 = (kvm_vcpu_get_hsr(vcpu) >> 10) & 0xf;
454 params.CRn = 0; 502 params.CRm = 0;
455 503
456 return emulate_cp15(vcpu, &params); 504 return emulate_cp15(vcpu, &params);
457} 505}
diff --git a/arch/arm/kvm/coproc.h b/arch/arm/kvm/coproc.h
index 0461d5c8d3de..1a44bbe39643 100644
--- a/arch/arm/kvm/coproc.h
+++ b/arch/arm/kvm/coproc.h
@@ -58,8 +58,8 @@ static inline void print_cp_instr(const struct coproc_params *p)
58{ 58{
59 /* Look, we even formatted it for you to paste into the table! */ 59 /* Look, we even formatted it for you to paste into the table! */
60 if (p->is_64bit) { 60 if (p->is_64bit) {
61 kvm_pr_unimpl(" { CRm(%2lu), Op1(%2lu), is64, func_%s },\n", 61 kvm_pr_unimpl(" { CRm64(%2lu), Op1(%2lu), is64, func_%s },\n",
62 p->CRm, p->Op1, p->is_write ? "write" : "read"); 62 p->CRn, p->Op1, p->is_write ? "write" : "read");
63 } else { 63 } else {
64 kvm_pr_unimpl(" { CRn(%2lu), CRm(%2lu), Op1(%2lu), Op2(%2lu), is32," 64 kvm_pr_unimpl(" { CRn(%2lu), CRm(%2lu), Op1(%2lu), Op2(%2lu), is32,"
65 " func_%s },\n", 65 " func_%s },\n",
@@ -135,13 +135,13 @@ static inline int cmp_reg(const struct coproc_reg *i1,
135 return -1; 135 return -1;
136 if (i1->CRn != i2->CRn) 136 if (i1->CRn != i2->CRn)
137 return i1->CRn - i2->CRn; 137 return i1->CRn - i2->CRn;
138 if (i1->is_64 != i2->is_64)
139 return i2->is_64 - i1->is_64;
140 if (i1->CRm != i2->CRm) 138 if (i1->CRm != i2->CRm)
141 return i1->CRm - i2->CRm; 139 return i1->CRm - i2->CRm;
142 if (i1->Op1 != i2->Op1) 140 if (i1->Op1 != i2->Op1)
143 return i1->Op1 - i2->Op1; 141 return i1->Op1 - i2->Op1;
144 return i1->Op2 - i2->Op2; 142 if (i1->Op2 != i2->Op2)
143 return i1->Op2 - i2->Op2;
144 return i2->is_64 - i1->is_64;
145} 145}
146 146
147 147
@@ -153,4 +153,8 @@ static inline int cmp_reg(const struct coproc_reg *i1,
153#define is64 .is_64 = true 153#define is64 .is_64 = true
154#define is32 .is_64 = false 154#define is32 .is_64 = false
155 155
156bool access_sctlr(struct kvm_vcpu *vcpu,
157 const struct coproc_params *p,
158 const struct coproc_reg *r);
159
156#endif /* __ARM_KVM_COPROC_LOCAL_H__ */ 160#endif /* __ARM_KVM_COPROC_LOCAL_H__ */
diff --git a/arch/arm/kvm/coproc_a15.c b/arch/arm/kvm/coproc_a15.c
index bb0cac1410cc..e6f4ae48bda9 100644
--- a/arch/arm/kvm/coproc_a15.c
+++ b/arch/arm/kvm/coproc_a15.c
@@ -34,7 +34,7 @@
34static const struct coproc_reg a15_regs[] = { 34static const struct coproc_reg a15_regs[] = {
35 /* SCTLR: swapped by interrupt.S. */ 35 /* SCTLR: swapped by interrupt.S. */
36 { CRn( 1), CRm( 0), Op1( 0), Op2( 0), is32, 36 { CRn( 1), CRm( 0), Op1( 0), Op2( 0), is32,
37 NULL, reset_val, c1_SCTLR, 0x00C50078 }, 37 access_sctlr, reset_val, c1_SCTLR, 0x00C50078 },
38}; 38};
39 39
40static struct kvm_coproc_target_table a15_target_table = { 40static struct kvm_coproc_target_table a15_target_table = {
diff --git a/arch/arm/kvm/coproc_a7.c b/arch/arm/kvm/coproc_a7.c
index 1df767331588..17fc7cd479d3 100644
--- a/arch/arm/kvm/coproc_a7.c
+++ b/arch/arm/kvm/coproc_a7.c
@@ -37,7 +37,7 @@
37static const struct coproc_reg a7_regs[] = { 37static const struct coproc_reg a7_regs[] = {
38 /* SCTLR: swapped by interrupt.S. */ 38 /* SCTLR: swapped by interrupt.S. */
39 { CRn( 1), CRm( 0), Op1( 0), Op2( 0), is32, 39 { CRn( 1), CRm( 0), Op1( 0), Op2( 0), is32,
40 NULL, reset_val, c1_SCTLR, 0x00C50878 }, 40 access_sctlr, reset_val, c1_SCTLR, 0x00C50878 },
41}; 41};
42 42
43static struct kvm_coproc_target_table a7_target_table = { 43static struct kvm_coproc_target_table a7_target_table = {
diff --git a/arch/arm/kvm/guest.c b/arch/arm/kvm/guest.c
index 2786eae10c0d..b23a59c1c522 100644
--- a/arch/arm/kvm/guest.c
+++ b/arch/arm/kvm/guest.c
@@ -38,6 +38,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
38 38
39int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu) 39int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
40{ 40{
41 vcpu->arch.hcr = HCR_GUEST_MASK;
41 return 0; 42 return 0;
42} 43}
43 44
diff --git a/arch/arm/kvm/interrupts_head.S b/arch/arm/kvm/interrupts_head.S
index 6f18695a09cb..76af93025574 100644
--- a/arch/arm/kvm/interrupts_head.S
+++ b/arch/arm/kvm/interrupts_head.S
@@ -303,13 +303,17 @@ vcpu .req r0 @ vcpu pointer always in r0
303 303
304 mrc p15, 0, r2, c14, c1, 0 @ CNTKCTL 304 mrc p15, 0, r2, c14, c1, 0 @ CNTKCTL
305 mrrc p15, 0, r4, r5, c7 @ PAR 305 mrrc p15, 0, r4, r5, c7 @ PAR
306 mrc p15, 0, r6, c10, c3, 0 @ AMAIR0
307 mrc p15, 0, r7, c10, c3, 1 @ AMAIR1
306 308
307 .if \store_to_vcpu == 0 309 .if \store_to_vcpu == 0
308 push {r2,r4-r5} 310 push {r2,r4-r7}
309 .else 311 .else
310 str r2, [vcpu, #CP15_OFFSET(c14_CNTKCTL)] 312 str r2, [vcpu, #CP15_OFFSET(c14_CNTKCTL)]
311 add r12, vcpu, #CP15_OFFSET(c7_PAR) 313 add r12, vcpu, #CP15_OFFSET(c7_PAR)
312 strd r4, r5, [r12] 314 strd r4, r5, [r12]
315 str r6, [vcpu, #CP15_OFFSET(c10_AMAIR0)]
316 str r7, [vcpu, #CP15_OFFSET(c10_AMAIR1)]
313 .endif 317 .endif
314.endm 318.endm
315 319
@@ -322,15 +326,19 @@ vcpu .req r0 @ vcpu pointer always in r0
322 */ 326 */
323.macro write_cp15_state read_from_vcpu 327.macro write_cp15_state read_from_vcpu
324 .if \read_from_vcpu == 0 328 .if \read_from_vcpu == 0
325 pop {r2,r4-r5} 329 pop {r2,r4-r7}
326 .else 330 .else
327 ldr r2, [vcpu, #CP15_OFFSET(c14_CNTKCTL)] 331 ldr r2, [vcpu, #CP15_OFFSET(c14_CNTKCTL)]
328 add r12, vcpu, #CP15_OFFSET(c7_PAR) 332 add r12, vcpu, #CP15_OFFSET(c7_PAR)
329 ldrd r4, r5, [r12] 333 ldrd r4, r5, [r12]
334 ldr r6, [vcpu, #CP15_OFFSET(c10_AMAIR0)]
335 ldr r7, [vcpu, #CP15_OFFSET(c10_AMAIR1)]
330 .endif 336 .endif
331 337
332 mcr p15, 0, r2, c14, c1, 0 @ CNTKCTL 338 mcr p15, 0, r2, c14, c1, 0 @ CNTKCTL
333 mcrr p15, 0, r4, r5, c7 @ PAR 339 mcrr p15, 0, r4, r5, c7 @ PAR
340 mcr p15, 0, r6, c10, c3, 0 @ AMAIR0
341 mcr p15, 0, r7, c10, c3, 1 @ AMAIR1
334 342
335 .if \read_from_vcpu == 0 343 .if \read_from_vcpu == 0
336 pop {r2-r12} 344 pop {r2-r12}
@@ -597,17 +605,14 @@ vcpu .req r0 @ vcpu pointer always in r0
597 605
598/* Enable/Disable: stage-2 trans., trap interrupts, trap wfi, trap smc */ 606/* Enable/Disable: stage-2 trans., trap interrupts, trap wfi, trap smc */
599.macro configure_hyp_role operation 607.macro configure_hyp_role operation
600 mrc p15, 4, r2, c1, c1, 0 @ HCR
601 bic r2, r2, #HCR_VIRT_EXCP_MASK
602 ldr r3, =HCR_GUEST_MASK
603 .if \operation == vmentry 608 .if \operation == vmentry
604 orr r2, r2, r3 609 ldr r2, [vcpu, #VCPU_HCR]
605 ldr r3, [vcpu, #VCPU_IRQ_LINES] 610 ldr r3, [vcpu, #VCPU_IRQ_LINES]
606 orr r2, r2, r3 611 orr r2, r2, r3
607 .else 612 .else
608 bic r2, r2, r3 613 mov r2, #0
609 .endif 614 .endif
610 mcr p15, 4, r2, c1, c1, 0 615 mcr p15, 4, r2, c1, c1, 0 @ HCR
611.endm 616.endm
612 617
613.macro load_vcpu 618.macro load_vcpu
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 7789857d1470..80bb1e6c2c29 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -144,8 +144,9 @@ static void unmap_range(struct kvm *kvm, pgd_t *pgdp,
144 while (addr < end) { 144 while (addr < end) {
145 pgd = pgdp + pgd_index(addr); 145 pgd = pgdp + pgd_index(addr);
146 pud = pud_offset(pgd, addr); 146 pud = pud_offset(pgd, addr);
147 pte = NULL;
147 if (pud_none(*pud)) { 148 if (pud_none(*pud)) {
148 addr = pud_addr_end(addr, end); 149 addr = kvm_pud_addr_end(addr, end);
149 continue; 150 continue;
150 } 151 }
151 152
@@ -155,13 +156,13 @@ static void unmap_range(struct kvm *kvm, pgd_t *pgdp,
155 * move on. 156 * move on.
156 */ 157 */
157 clear_pud_entry(kvm, pud, addr); 158 clear_pud_entry(kvm, pud, addr);
158 addr = pud_addr_end(addr, end); 159 addr = kvm_pud_addr_end(addr, end);
159 continue; 160 continue;
160 } 161 }
161 162
162 pmd = pmd_offset(pud, addr); 163 pmd = pmd_offset(pud, addr);
163 if (pmd_none(*pmd)) { 164 if (pmd_none(*pmd)) {
164 addr = pmd_addr_end(addr, end); 165 addr = kvm_pmd_addr_end(addr, end);
165 continue; 166 continue;
166 } 167 }
167 168
@@ -174,12 +175,12 @@ static void unmap_range(struct kvm *kvm, pgd_t *pgdp,
174 /* 175 /*
175 * If the pmd entry is to be cleared, walk back up the ladder 176 * If the pmd entry is to be cleared, walk back up the ladder
176 */ 177 */
177 if (kvm_pmd_huge(*pmd) || page_empty(pte)) { 178 if (kvm_pmd_huge(*pmd) || (pte && page_empty(pte))) {
178 clear_pmd_entry(kvm, pmd, addr); 179 clear_pmd_entry(kvm, pmd, addr);
179 next = pmd_addr_end(addr, end); 180 next = kvm_pmd_addr_end(addr, end);
180 if (page_empty(pmd) && !page_empty(pud)) { 181 if (page_empty(pmd) && !page_empty(pud)) {
181 clear_pud_entry(kvm, pud, addr); 182 clear_pud_entry(kvm, pud, addr);
182 next = pud_addr_end(addr, end); 183 next = kvm_pud_addr_end(addr, end);
183 } 184 }
184 } 185 }
185 186
@@ -187,6 +188,99 @@ static void unmap_range(struct kvm *kvm, pgd_t *pgdp,
187 } 188 }
188} 189}
189 190
191static void stage2_flush_ptes(struct kvm *kvm, pmd_t *pmd,
192 phys_addr_t addr, phys_addr_t end)
193{
194 pte_t *pte;
195
196 pte = pte_offset_kernel(pmd, addr);
197 do {
198 if (!pte_none(*pte)) {
199 hva_t hva = gfn_to_hva(kvm, addr >> PAGE_SHIFT);
200 kvm_flush_dcache_to_poc((void*)hva, PAGE_SIZE);
201 }
202 } while (pte++, addr += PAGE_SIZE, addr != end);
203}
204
205static void stage2_flush_pmds(struct kvm *kvm, pud_t *pud,
206 phys_addr_t addr, phys_addr_t end)
207{
208 pmd_t *pmd;
209 phys_addr_t next;
210
211 pmd = pmd_offset(pud, addr);
212 do {
213 next = kvm_pmd_addr_end(addr, end);
214 if (!pmd_none(*pmd)) {
215 if (kvm_pmd_huge(*pmd)) {
216 hva_t hva = gfn_to_hva(kvm, addr >> PAGE_SHIFT);
217 kvm_flush_dcache_to_poc((void*)hva, PMD_SIZE);
218 } else {
219 stage2_flush_ptes(kvm, pmd, addr, next);
220 }
221 }
222 } while (pmd++, addr = next, addr != end);
223}
224
225static void stage2_flush_puds(struct kvm *kvm, pgd_t *pgd,
226 phys_addr_t addr, phys_addr_t end)
227{
228 pud_t *pud;
229 phys_addr_t next;
230
231 pud = pud_offset(pgd, addr);
232 do {
233 next = kvm_pud_addr_end(addr, end);
234 if (!pud_none(*pud)) {
235 if (pud_huge(*pud)) {
236 hva_t hva = gfn_to_hva(kvm, addr >> PAGE_SHIFT);
237 kvm_flush_dcache_to_poc((void*)hva, PUD_SIZE);
238 } else {
239 stage2_flush_pmds(kvm, pud, addr, next);
240 }
241 }
242 } while (pud++, addr = next, addr != end);
243}
244
245static void stage2_flush_memslot(struct kvm *kvm,
246 struct kvm_memory_slot *memslot)
247{
248 phys_addr_t addr = memslot->base_gfn << PAGE_SHIFT;
249 phys_addr_t end = addr + PAGE_SIZE * memslot->npages;
250 phys_addr_t next;
251 pgd_t *pgd;
252
253 pgd = kvm->arch.pgd + pgd_index(addr);
254 do {
255 next = kvm_pgd_addr_end(addr, end);
256 stage2_flush_puds(kvm, pgd, addr, next);
257 } while (pgd++, addr = next, addr != end);
258}
259
260/**
261 * stage2_flush_vm - Invalidate cache for pages mapped in stage 2
262 * @kvm: The struct kvm pointer
263 *
264 * Go through the stage 2 page tables and invalidate any cache lines
265 * backing memory already mapped to the VM.
266 */
267void stage2_flush_vm(struct kvm *kvm)
268{
269 struct kvm_memslots *slots;
270 struct kvm_memory_slot *memslot;
271 int idx;
272
273 idx = srcu_read_lock(&kvm->srcu);
274 spin_lock(&kvm->mmu_lock);
275
276 slots = kvm_memslots(kvm);
277 kvm_for_each_memslot(memslot, slots)
278 stage2_flush_memslot(kvm, memslot);
279
280 spin_unlock(&kvm->mmu_lock);
281 srcu_read_unlock(&kvm->srcu, idx);
282}
283
190/** 284/**
191 * free_boot_hyp_pgd - free HYP boot page tables 285 * free_boot_hyp_pgd - free HYP boot page tables
192 * 286 *
@@ -715,7 +809,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
715 kvm_set_s2pmd_writable(&new_pmd); 809 kvm_set_s2pmd_writable(&new_pmd);
716 kvm_set_pfn_dirty(pfn); 810 kvm_set_pfn_dirty(pfn);
717 } 811 }
718 coherent_icache_guest_page(kvm, hva & PMD_MASK, PMD_SIZE); 812 coherent_cache_guest_page(vcpu, hva & PMD_MASK, PMD_SIZE);
719 ret = stage2_set_pmd_huge(kvm, memcache, fault_ipa, &new_pmd); 813 ret = stage2_set_pmd_huge(kvm, memcache, fault_ipa, &new_pmd);
720 } else { 814 } else {
721 pte_t new_pte = pfn_pte(pfn, PAGE_S2); 815 pte_t new_pte = pfn_pte(pfn, PAGE_S2);
@@ -723,7 +817,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
723 kvm_set_s2pte_writable(&new_pte); 817 kvm_set_s2pte_writable(&new_pte);
724 kvm_set_pfn_dirty(pfn); 818 kvm_set_pfn_dirty(pfn);
725 } 819 }
726 coherent_icache_guest_page(kvm, hva, PAGE_SIZE); 820 coherent_cache_guest_page(vcpu, hva, PAGE_SIZE);
727 ret = stage2_set_pte(kvm, memcache, fault_ipa, &new_pte, false); 821 ret = stage2_set_pte(kvm, memcache, fault_ipa, &new_pte, false);
728 } 822 }
729 823
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h
index 52886b89706c..9f12ed1eea86 100644
--- a/arch/arm/lib/bitops.h
+++ b/arch/arm/lib/bitops.h
@@ -37,6 +37,11 @@ UNWIND( .fnstart )
37 add r1, r1, r0, lsl #2 @ Get word offset 37 add r1, r1, r0, lsl #2 @ Get word offset
38 mov r3, r2, lsl r3 @ create mask 38 mov r3, r2, lsl r3 @ create mask
39 smp_dmb 39 smp_dmb
40#if __LINUX_ARM_ARCH__ >= 7 && defined(CONFIG_SMP)
41 .arch_extension mp
42 ALT_SMP(W(pldw) [r1])
43 ALT_UP(W(nop))
44#endif
401: ldrex r2, [r1] 451: ldrex r2, [r1]
41 ands r0, r2, r3 @ save old value of bit 46 ands r0, r2, r3 @ save old value of bit
42 \instr r2, r2, r3 @ toggle bit 47 \instr r2, r2, r3 @ toggle bit
diff --git a/arch/arm/lib/copy_template.S b/arch/arm/lib/copy_template.S
index 805e3f8fb007..3bc8eb811a73 100644
--- a/arch/arm/lib/copy_template.S
+++ b/arch/arm/lib/copy_template.S
@@ -197,24 +197,24 @@
197 197
19812: PLD( pld [r1, #124] ) 19812: PLD( pld [r1, #124] )
19913: ldr4w r1, r4, r5, r6, r7, abort=19f 19913: ldr4w r1, r4, r5, r6, r7, abort=19f
200 mov r3, lr, pull #\pull 200 mov r3, lr, lspull #\pull
201 subs r2, r2, #32 201 subs r2, r2, #32
202 ldr4w r1, r8, r9, ip, lr, abort=19f 202 ldr4w r1, r8, r9, ip, lr, abort=19f
203 orr r3, r3, r4, push #\push 203 orr r3, r3, r4, lspush #\push
204 mov r4, r4, pull #\pull 204 mov r4, r4, lspull #\pull
205 orr r4, r4, r5, push #\push 205 orr r4, r4, r5, lspush #\push
206 mov r5, r5, pull #\pull 206 mov r5, r5, lspull #\pull
207 orr r5, r5, r6, push #\push 207 orr r5, r5, r6, lspush #\push
208 mov r6, r6, pull #\pull 208 mov r6, r6, lspull #\pull
209 orr r6, r6, r7, push #\push 209 orr r6, r6, r7, lspush #\push
210 mov r7, r7, pull #\pull 210 mov r7, r7, lspull #\pull
211 orr r7, r7, r8, push #\push 211 orr r7, r7, r8, lspush #\push
212 mov r8, r8, pull #\pull 212 mov r8, r8, lspull #\pull
213 orr r8, r8, r9, push #\push 213 orr r8, r8, r9, lspush #\push
214 mov r9, r9, pull #\pull 214 mov r9, r9, lspull #\pull
215 orr r9, r9, ip, push #\push 215 orr r9, r9, ip, lspush #\push
216 mov ip, ip, pull #\pull 216 mov ip, ip, lspull #\pull
217 orr ip, ip, lr, push #\push 217 orr ip, ip, lr, lspush #\push
218 str8w r0, r3, r4, r5, r6, r7, r8, r9, ip, , abort=19f 218 str8w r0, r3, r4, r5, r6, r7, r8, r9, ip, , abort=19f
219 bge 12b 219 bge 12b
220 PLD( cmn r2, #96 ) 220 PLD( cmn r2, #96 )
@@ -225,10 +225,10 @@
22514: ands ip, r2, #28 22514: ands ip, r2, #28
226 beq 16f 226 beq 16f
227 227
22815: mov r3, lr, pull #\pull 22815: mov r3, lr, lspull #\pull
229 ldr1w r1, lr, abort=21f 229 ldr1w r1, lr, abort=21f
230 subs ip, ip, #4 230 subs ip, ip, #4
231 orr r3, r3, lr, push #\push 231 orr r3, r3, lr, lspush #\push
232 str1w r0, r3, abort=21f 232 str1w r0, r3, abort=21f
233 bgt 15b 233 bgt 15b
234 CALGN( cmp r2, #0 ) 234 CALGN( cmp r2, #0 )
diff --git a/arch/arm/lib/csumpartialcopygeneric.S b/arch/arm/lib/csumpartialcopygeneric.S
index d620a5f22a09..d6e742d24007 100644
--- a/arch/arm/lib/csumpartialcopygeneric.S
+++ b/arch/arm/lib/csumpartialcopygeneric.S
@@ -141,7 +141,7 @@ FN_ENTRY
141 tst len, #2 141 tst len, #2
142 mov r5, r4, get_byte_0 142 mov r5, r4, get_byte_0
143 beq .Lexit 143 beq .Lexit
144 adcs sum, sum, r4, push #16 144 adcs sum, sum, r4, lspush #16
145 strb r5, [dst], #1 145 strb r5, [dst], #1
146 mov r5, r4, get_byte_1 146 mov r5, r4, get_byte_1
147 strb r5, [dst], #1 147 strb r5, [dst], #1
@@ -171,23 +171,23 @@ FN_ENTRY
171 cmp ip, #2 171 cmp ip, #2
172 beq .Lsrc2_aligned 172 beq .Lsrc2_aligned
173 bhi .Lsrc3_aligned 173 bhi .Lsrc3_aligned
174 mov r4, r5, pull #8 @ C = 0 174 mov r4, r5, lspull #8 @ C = 0
175 bics ip, len, #15 175 bics ip, len, #15
176 beq 2f 176 beq 2f
1771: load4l r5, r6, r7, r8 1771: load4l r5, r6, r7, r8
178 orr r4, r4, r5, push #24 178 orr r4, r4, r5, lspush #24
179 mov r5, r5, pull #8 179 mov r5, r5, lspull #8
180 orr r5, r5, r6, push #24 180 orr r5, r5, r6, lspush #24
181 mov r6, r6, pull #8 181 mov r6, r6, lspull #8
182 orr r6, r6, r7, push #24 182 orr r6, r6, r7, lspush #24
183 mov r7, r7, pull #8 183 mov r7, r7, lspull #8
184 orr r7, r7, r8, push #24 184 orr r7, r7, r8, lspush #24
185 stmia dst!, {r4, r5, r6, r7} 185 stmia dst!, {r4, r5, r6, r7}
186 adcs sum, sum, r4 186 adcs sum, sum, r4
187 adcs sum, sum, r5 187 adcs sum, sum, r5
188 adcs sum, sum, r6 188 adcs sum, sum, r6
189 adcs sum, sum, r7 189 adcs sum, sum, r7
190 mov r4, r8, pull #8 190 mov r4, r8, lspull #8
191 sub ip, ip, #16 191 sub ip, ip, #16
192 teq ip, #0 192 teq ip, #0
193 bne 1b 193 bne 1b
@@ -196,50 +196,50 @@ FN_ENTRY
196 tst ip, #8 196 tst ip, #8
197 beq 3f 197 beq 3f
198 load2l r5, r6 198 load2l r5, r6
199 orr r4, r4, r5, push #24 199 orr r4, r4, r5, lspush #24
200 mov r5, r5, pull #8 200 mov r5, r5, lspull #8
201 orr r5, r5, r6, push #24 201 orr r5, r5, r6, lspush #24
202 stmia dst!, {r4, r5} 202 stmia dst!, {r4, r5}
203 adcs sum, sum, r4 203 adcs sum, sum, r4
204 adcs sum, sum, r5 204 adcs sum, sum, r5
205 mov r4, r6, pull #8 205 mov r4, r6, lspull #8
206 tst ip, #4 206 tst ip, #4
207 beq 4f 207 beq 4f
2083: load1l r5 2083: load1l r5
209 orr r4, r4, r5, push #24 209 orr r4, r4, r5, lspush #24
210 str r4, [dst], #4 210 str r4, [dst], #4
211 adcs sum, sum, r4 211 adcs sum, sum, r4
212 mov r4, r5, pull #8 212 mov r4, r5, lspull #8
2134: ands len, len, #3 2134: ands len, len, #3
214 beq .Ldone 214 beq .Ldone
215 mov r5, r4, get_byte_0 215 mov r5, r4, get_byte_0
216 tst len, #2 216 tst len, #2
217 beq .Lexit 217 beq .Lexit
218 adcs sum, sum, r4, push #16 218 adcs sum, sum, r4, lspush #16
219 strb r5, [dst], #1 219 strb r5, [dst], #1
220 mov r5, r4, get_byte_1 220 mov r5, r4, get_byte_1
221 strb r5, [dst], #1 221 strb r5, [dst], #1
222 mov r5, r4, get_byte_2 222 mov r5, r4, get_byte_2
223 b .Lexit 223 b .Lexit
224 224
225.Lsrc2_aligned: mov r4, r5, pull #16 225.Lsrc2_aligned: mov r4, r5, lspull #16
226 adds sum, sum, #0 226 adds sum, sum, #0
227 bics ip, len, #15 227 bics ip, len, #15
228 beq 2f 228 beq 2f
2291: load4l r5, r6, r7, r8 2291: load4l r5, r6, r7, r8
230 orr r4, r4, r5, push #16 230 orr r4, r4, r5, lspush #16
231 mov r5, r5, pull #16 231 mov r5, r5, lspull #16
232 orr r5, r5, r6, push #16 232 orr r5, r5, r6, lspush #16
233 mov r6, r6, pull #16 233 mov r6, r6, lspull #16
234 orr r6, r6, r7, push #16 234 orr r6, r6, r7, lspush #16
235 mov r7, r7, pull #16 235 mov r7, r7, lspull #16
236 orr r7, r7, r8, push #16 236 orr r7, r7, r8, lspush #16
237 stmia dst!, {r4, r5, r6, r7} 237 stmia dst!, {r4, r5, r6, r7}
238 adcs sum, sum, r4 238 adcs sum, sum, r4
239 adcs sum, sum, r5 239 adcs sum, sum, r5
240 adcs sum, sum, r6 240 adcs sum, sum, r6
241 adcs sum, sum, r7 241 adcs sum, sum, r7
242 mov r4, r8, pull #16 242 mov r4, r8, lspull #16
243 sub ip, ip, #16 243 sub ip, ip, #16
244 teq ip, #0 244 teq ip, #0
245 bne 1b 245 bne 1b
@@ -248,20 +248,20 @@ FN_ENTRY
248 tst ip, #8 248 tst ip, #8
249 beq 3f 249 beq 3f
250 load2l r5, r6 250 load2l r5, r6
251 orr r4, r4, r5, push #16 251 orr r4, r4, r5, lspush #16
252 mov r5, r5, pull #16 252 mov r5, r5, lspull #16
253 orr r5, r5, r6, push #16 253 orr r5, r5, r6, lspush #16
254 stmia dst!, {r4, r5} 254 stmia dst!, {r4, r5}
255 adcs sum, sum, r4 255 adcs sum, sum, r4
256 adcs sum, sum, r5 256 adcs sum, sum, r5
257 mov r4, r6, pull #16 257 mov r4, r6, lspull #16
258 tst ip, #4 258 tst ip, #4
259 beq 4f 259 beq 4f
2603: load1l r5 2603: load1l r5
261 orr r4, r4, r5, push #16 261 orr r4, r4, r5, lspush #16
262 str r4, [dst], #4 262 str r4, [dst], #4
263 adcs sum, sum, r4 263 adcs sum, sum, r4
264 mov r4, r5, pull #16 264 mov r4, r5, lspull #16
2654: ands len, len, #3 2654: ands len, len, #3
266 beq .Ldone 266 beq .Ldone
267 mov r5, r4, get_byte_0 267 mov r5, r4, get_byte_0
@@ -276,24 +276,24 @@ FN_ENTRY
276 load1b r5 276 load1b r5
277 b .Lexit 277 b .Lexit
278 278
279.Lsrc3_aligned: mov r4, r5, pull #24 279.Lsrc3_aligned: mov r4, r5, lspull #24
280 adds sum, sum, #0 280 adds sum, sum, #0
281 bics ip, len, #15 281 bics ip, len, #15
282 beq 2f 282 beq 2f
2831: load4l r5, r6, r7, r8 2831: load4l r5, r6, r7, r8
284 orr r4, r4, r5, push #8 284 orr r4, r4, r5, lspush #8
285 mov r5, r5, pull #24 285 mov r5, r5, lspull #24
286 orr r5, r5, r6, push #8 286 orr r5, r5, r6, lspush #8
287 mov r6, r6, pull #24 287 mov r6, r6, lspull #24
288 orr r6, r6, r7, push #8 288 orr r6, r6, r7, lspush #8
289 mov r7, r7, pull #24 289 mov r7, r7, lspull #24
290 orr r7, r7, r8, push #8 290 orr r7, r7, r8, lspush #8
291 stmia dst!, {r4, r5, r6, r7} 291 stmia dst!, {r4, r5, r6, r7}
292 adcs sum, sum, r4 292 adcs sum, sum, r4
293 adcs sum, sum, r5 293 adcs sum, sum, r5
294 adcs sum, sum, r6 294 adcs sum, sum, r6
295 adcs sum, sum, r7 295 adcs sum, sum, r7
296 mov r4, r8, pull #24 296 mov r4, r8, lspull #24
297 sub ip, ip, #16 297 sub ip, ip, #16
298 teq ip, #0 298 teq ip, #0
299 bne 1b 299 bne 1b
@@ -302,20 +302,20 @@ FN_ENTRY
302 tst ip, #8 302 tst ip, #8
303 beq 3f 303 beq 3f
304 load2l r5, r6 304 load2l r5, r6
305 orr r4, r4, r5, push #8 305 orr r4, r4, r5, lspush #8
306 mov r5, r5, pull #24 306 mov r5, r5, lspull #24
307 orr r5, r5, r6, push #8 307 orr r5, r5, r6, lspush #8
308 stmia dst!, {r4, r5} 308 stmia dst!, {r4, r5}
309 adcs sum, sum, r4 309 adcs sum, sum, r4
310 adcs sum, sum, r5 310 adcs sum, sum, r5
311 mov r4, r6, pull #24 311 mov r4, r6, lspull #24
312 tst ip, #4 312 tst ip, #4
313 beq 4f 313 beq 4f
3143: load1l r5 3143: load1l r5
315 orr r4, r4, r5, push #8 315 orr r4, r4, r5, lspush #8
316 str r4, [dst], #4 316 str r4, [dst], #4
317 adcs sum, sum, r4 317 adcs sum, sum, r4
318 mov r4, r5, pull #24 318 mov r4, r5, lspull #24
3194: ands len, len, #3 3194: ands len, len, #3
320 beq .Ldone 320 beq .Ldone
321 mov r5, r4, get_byte_0 321 mov r5, r4, get_byte_0
@@ -326,7 +326,7 @@ FN_ENTRY
326 load1l r4 326 load1l r4
327 mov r5, r4, get_byte_0 327 mov r5, r4, get_byte_0
328 strb r5, [dst], #1 328 strb r5, [dst], #1
329 adcs sum, sum, r4, push #24 329 adcs sum, sum, r4, lspush #24
330 mov r5, r4, get_byte_1 330 mov r5, r4, get_byte_1
331 b .Lexit 331 b .Lexit
332FN_EXIT 332FN_EXIT
diff --git a/arch/arm/lib/io-readsl.S b/arch/arm/lib/io-readsl.S
index 5fb97e7f9f4b..7a7430950c79 100644
--- a/arch/arm/lib/io-readsl.S
+++ b/arch/arm/lib/io-readsl.S
@@ -47,25 +47,25 @@ ENTRY(__raw_readsl)
47 strb ip, [r1], #1 47 strb ip, [r1], #1
48 48
494: subs r2, r2, #1 494: subs r2, r2, #1
50 mov ip, r3, pull #24 50 mov ip, r3, lspull #24
51 ldrne r3, [r0] 51 ldrne r3, [r0]
52 orrne ip, ip, r3, push #8 52 orrne ip, ip, r3, lspush #8
53 strne ip, [r1], #4 53 strne ip, [r1], #4
54 bne 4b 54 bne 4b
55 b 8f 55 b 8f
56 56
575: subs r2, r2, #1 575: subs r2, r2, #1
58 mov ip, r3, pull #16 58 mov ip, r3, lspull #16
59 ldrne r3, [r0] 59 ldrne r3, [r0]
60 orrne ip, ip, r3, push #16 60 orrne ip, ip, r3, lspush #16
61 strne ip, [r1], #4 61 strne ip, [r1], #4
62 bne 5b 62 bne 5b
63 b 7f 63 b 7f
64 64
656: subs r2, r2, #1 656: subs r2, r2, #1
66 mov ip, r3, pull #8 66 mov ip, r3, lspull #8
67 ldrne r3, [r0] 67 ldrne r3, [r0]
68 orrne ip, ip, r3, push #24 68 orrne ip, ip, r3, lspush #24
69 strne ip, [r1], #4 69 strne ip, [r1], #4
70 bne 6b 70 bne 6b
71 71
diff --git a/arch/arm/lib/io-writesl.S b/arch/arm/lib/io-writesl.S
index 8d3b7813725c..d0d104a0dd11 100644
--- a/arch/arm/lib/io-writesl.S
+++ b/arch/arm/lib/io-writesl.S
@@ -41,26 +41,26 @@ ENTRY(__raw_writesl)
41 blt 5f 41 blt 5f
42 bgt 6f 42 bgt 6f
43 43
444: mov ip, r3, pull #16 444: mov ip, r3, lspull #16
45 ldr r3, [r1], #4 45 ldr r3, [r1], #4
46 subs r2, r2, #1 46 subs r2, r2, #1
47 orr ip, ip, r3, push #16 47 orr ip, ip, r3, lspush #16
48 str ip, [r0] 48 str ip, [r0]
49 bne 4b 49 bne 4b
50 mov pc, lr 50 mov pc, lr
51 51
525: mov ip, r3, pull #8 525: mov ip, r3, lspull #8
53 ldr r3, [r1], #4 53 ldr r3, [r1], #4
54 subs r2, r2, #1 54 subs r2, r2, #1
55 orr ip, ip, r3, push #24 55 orr ip, ip, r3, lspush #24
56 str ip, [r0] 56 str ip, [r0]
57 bne 5b 57 bne 5b
58 mov pc, lr 58 mov pc, lr
59 59
606: mov ip, r3, pull #24 606: mov ip, r3, lspull #24
61 ldr r3, [r1], #4 61 ldr r3, [r1], #4
62 subs r2, r2, #1 62 subs r2, r2, #1
63 orr ip, ip, r3, push #8 63 orr ip, ip, r3, lspush #8
64 str ip, [r0] 64 str ip, [r0]
65 bne 6b 65 bne 6b
66 mov pc, lr 66 mov pc, lr
diff --git a/arch/arm/lib/memmove.S b/arch/arm/lib/memmove.S
index 938fc14f962d..d1fc0c0c342c 100644
--- a/arch/arm/lib/memmove.S
+++ b/arch/arm/lib/memmove.S
@@ -147,24 +147,24 @@ ENTRY(memmove)
147 147
14812: PLD( pld [r1, #-128] ) 14812: PLD( pld [r1, #-128] )
14913: ldmdb r1!, {r7, r8, r9, ip} 14913: ldmdb r1!, {r7, r8, r9, ip}
150 mov lr, r3, push #\push 150 mov lr, r3, lspush #\push
151 subs r2, r2, #32 151 subs r2, r2, #32
152 ldmdb r1!, {r3, r4, r5, r6} 152 ldmdb r1!, {r3, r4, r5, r6}
153 orr lr, lr, ip, pull #\pull 153 orr lr, lr, ip, lspull #\pull
154 mov ip, ip, push #\push 154 mov ip, ip, lspush #\push
155 orr ip, ip, r9, pull #\pull 155 orr ip, ip, r9, lspull #\pull
156 mov r9, r9, push #\push 156 mov r9, r9, lspush #\push
157 orr r9, r9, r8, pull #\pull 157 orr r9, r9, r8, lspull #\pull
158 mov r8, r8, push #\push 158 mov r8, r8, lspush #\push
159 orr r8, r8, r7, pull #\pull 159 orr r8, r8, r7, lspull #\pull
160 mov r7, r7, push #\push 160 mov r7, r7, lspush #\push
161 orr r7, r7, r6, pull #\pull 161 orr r7, r7, r6, lspull #\pull
162 mov r6, r6, push #\push 162 mov r6, r6, lspush #\push
163 orr r6, r6, r5, pull #\pull 163 orr r6, r6, r5, lspull #\pull
164 mov r5, r5, push #\push 164 mov r5, r5, lspush #\push
165 orr r5, r5, r4, pull #\pull 165 orr r5, r5, r4, lspull #\pull
166 mov r4, r4, push #\push 166 mov r4, r4, lspush #\push
167 orr r4, r4, r3, pull #\pull 167 orr r4, r4, r3, lspull #\pull
168 stmdb r0!, {r4 - r9, ip, lr} 168 stmdb r0!, {r4 - r9, ip, lr}
169 bge 12b 169 bge 12b
170 PLD( cmn r2, #96 ) 170 PLD( cmn r2, #96 )
@@ -175,10 +175,10 @@ ENTRY(memmove)
17514: ands ip, r2, #28 17514: ands ip, r2, #28
176 beq 16f 176 beq 16f
177 177
17815: mov lr, r3, push #\push 17815: mov lr, r3, lspush #\push
179 ldr r3, [r1, #-4]! 179 ldr r3, [r1, #-4]!
180 subs ip, ip, #4 180 subs ip, ip, #4
181 orr lr, lr, r3, pull #\pull 181 orr lr, lr, r3, lspull #\pull
182 str lr, [r0, #-4]! 182 str lr, [r0, #-4]!
183 bgt 15b 183 bgt 15b
184 CALGN( cmp r2, #0 ) 184 CALGN( cmp r2, #0 )
diff --git a/arch/arm/lib/uaccess.S b/arch/arm/lib/uaccess.S
index 5c908b1cb8ed..e50520904b76 100644
--- a/arch/arm/lib/uaccess.S
+++ b/arch/arm/lib/uaccess.S
@@ -117,9 +117,9 @@ USER( TUSER( strgtb) r3, [r0], #1) @ May fault
117.Lc2u_1fupi: subs r2, r2, #4 117.Lc2u_1fupi: subs r2, r2, #4
118 addmi ip, r2, #4 118 addmi ip, r2, #4
119 bmi .Lc2u_1nowords 119 bmi .Lc2u_1nowords
120 mov r3, r7, pull #8 120 mov r3, r7, lspull #8
121 ldr r7, [r1], #4 121 ldr r7, [r1], #4
122 orr r3, r3, r7, push #24 122 orr r3, r3, r7, lspush #24
123USER( TUSER( str) r3, [r0], #4) @ May fault 123USER( TUSER( str) r3, [r0], #4) @ May fault
124 mov ip, r0, lsl #32 - PAGE_SHIFT 124 mov ip, r0, lsl #32 - PAGE_SHIFT
125 rsb ip, ip, #0 125 rsb ip, ip, #0
@@ -131,30 +131,30 @@ USER( TUSER( str) r3, [r0], #4) @ May fault
131 subs ip, ip, #16 131 subs ip, ip, #16
132 blt .Lc2u_1rem8lp 132 blt .Lc2u_1rem8lp
133 133
134.Lc2u_1cpy8lp: mov r3, r7, pull #8 134.Lc2u_1cpy8lp: mov r3, r7, lspull #8
135 ldmia r1!, {r4 - r7} 135 ldmia r1!, {r4 - r7}
136 subs ip, ip, #16 136 subs ip, ip, #16
137 orr r3, r3, r4, push #24 137 orr r3, r3, r4, lspush #24
138 mov r4, r4, pull #8 138 mov r4, r4, lspull #8
139 orr r4, r4, r5, push #24 139 orr r4, r4, r5, lspush #24
140 mov r5, r5, pull #8 140 mov r5, r5, lspull #8
141 orr r5, r5, r6, push #24 141 orr r5, r5, r6, lspush #24
142 mov r6, r6, pull #8 142 mov r6, r6, lspull #8
143 orr r6, r6, r7, push #24 143 orr r6, r6, r7, lspush #24
144 stmia r0!, {r3 - r6} @ Shouldnt fault 144 stmia r0!, {r3 - r6} @ Shouldnt fault
145 bpl .Lc2u_1cpy8lp 145 bpl .Lc2u_1cpy8lp
146 146
147.Lc2u_1rem8lp: tst ip, #8 147.Lc2u_1rem8lp: tst ip, #8
148 movne r3, r7, pull #8 148 movne r3, r7, lspull #8
149 ldmneia r1!, {r4, r7} 149 ldmneia r1!, {r4, r7}
150 orrne r3, r3, r4, push #24 150 orrne r3, r3, r4, lspush #24
151 movne r4, r4, pull #8 151 movne r4, r4, lspull #8
152 orrne r4, r4, r7, push #24 152 orrne r4, r4, r7, lspush #24
153 stmneia r0!, {r3 - r4} @ Shouldnt fault 153 stmneia r0!, {r3 - r4} @ Shouldnt fault
154 tst ip, #4 154 tst ip, #4
155 movne r3, r7, pull #8 155 movne r3, r7, lspull #8
156 ldrne r7, [r1], #4 156 ldrne r7, [r1], #4
157 orrne r3, r3, r7, push #24 157 orrne r3, r3, r7, lspush #24
158 TUSER( strne) r3, [r0], #4 @ Shouldnt fault 158 TUSER( strne) r3, [r0], #4 @ Shouldnt fault
159 ands ip, ip, #3 159 ands ip, ip, #3
160 beq .Lc2u_1fupi 160 beq .Lc2u_1fupi
@@ -172,9 +172,9 @@ USER( TUSER( strgtb) r3, [r0], #1) @ May fault
172.Lc2u_2fupi: subs r2, r2, #4 172.Lc2u_2fupi: subs r2, r2, #4
173 addmi ip, r2, #4 173 addmi ip, r2, #4
174 bmi .Lc2u_2nowords 174 bmi .Lc2u_2nowords
175 mov r3, r7, pull #16 175 mov r3, r7, lspull #16
176 ldr r7, [r1], #4 176 ldr r7, [r1], #4
177 orr r3, r3, r7, push #16 177 orr r3, r3, r7, lspush #16
178USER( TUSER( str) r3, [r0], #4) @ May fault 178USER( TUSER( str) r3, [r0], #4) @ May fault
179 mov ip, r0, lsl #32 - PAGE_SHIFT 179 mov ip, r0, lsl #32 - PAGE_SHIFT
180 rsb ip, ip, #0 180 rsb ip, ip, #0
@@ -186,30 +186,30 @@ USER( TUSER( str) r3, [r0], #4) @ May fault
186 subs ip, ip, #16 186 subs ip, ip, #16
187 blt .Lc2u_2rem8lp 187 blt .Lc2u_2rem8lp
188 188
189.Lc2u_2cpy8lp: mov r3, r7, pull #16 189.Lc2u_2cpy8lp: mov r3, r7, lspull #16
190 ldmia r1!, {r4 - r7} 190 ldmia r1!, {r4 - r7}
191 subs ip, ip, #16 191 subs ip, ip, #16
192 orr r3, r3, r4, push #16 192 orr r3, r3, r4, lspush #16
193 mov r4, r4, pull #16 193 mov r4, r4, lspull #16
194 orr r4, r4, r5, push #16 194 orr r4, r4, r5, lspush #16
195 mov r5, r5, pull #16 195 mov r5, r5, lspull #16
196 orr r5, r5, r6, push #16 196 orr r5, r5, r6, lspush #16
197 mov r6, r6, pull #16 197 mov r6, r6, lspull #16
198 orr r6, r6, r7, push #16 198 orr r6, r6, r7, lspush #16
199 stmia r0!, {r3 - r6} @ Shouldnt fault 199 stmia r0!, {r3 - r6} @ Shouldnt fault
200 bpl .Lc2u_2cpy8lp 200 bpl .Lc2u_2cpy8lp
201 201
202.Lc2u_2rem8lp: tst ip, #8 202.Lc2u_2rem8lp: tst ip, #8
203 movne r3, r7, pull #16 203 movne r3, r7, lspull #16
204 ldmneia r1!, {r4, r7} 204 ldmneia r1!, {r4, r7}
205 orrne r3, r3, r4, push #16 205 orrne r3, r3, r4, lspush #16
206 movne r4, r4, pull #16 206 movne r4, r4, lspull #16
207 orrne r4, r4, r7, push #16 207 orrne r4, r4, r7, lspush #16
208 stmneia r0!, {r3 - r4} @ Shouldnt fault 208 stmneia r0!, {r3 - r4} @ Shouldnt fault
209 tst ip, #4 209 tst ip, #4
210 movne r3, r7, pull #16 210 movne r3, r7, lspull #16
211 ldrne r7, [r1], #4 211 ldrne r7, [r1], #4
212 orrne r3, r3, r7, push #16 212 orrne r3, r3, r7, lspush #16
213 TUSER( strne) r3, [r0], #4 @ Shouldnt fault 213 TUSER( strne) r3, [r0], #4 @ Shouldnt fault
214 ands ip, ip, #3 214 ands ip, ip, #3
215 beq .Lc2u_2fupi 215 beq .Lc2u_2fupi
@@ -227,9 +227,9 @@ USER( TUSER( strgtb) r3, [r0], #1) @ May fault
227.Lc2u_3fupi: subs r2, r2, #4 227.Lc2u_3fupi: subs r2, r2, #4
228 addmi ip, r2, #4 228 addmi ip, r2, #4
229 bmi .Lc2u_3nowords 229 bmi .Lc2u_3nowords
230 mov r3, r7, pull #24 230 mov r3, r7, lspull #24
231 ldr r7, [r1], #4 231 ldr r7, [r1], #4
232 orr r3, r3, r7, push #8 232 orr r3, r3, r7, lspush #8
233USER( TUSER( str) r3, [r0], #4) @ May fault 233USER( TUSER( str) r3, [r0], #4) @ May fault
234 mov ip, r0, lsl #32 - PAGE_SHIFT 234 mov ip, r0, lsl #32 - PAGE_SHIFT
235 rsb ip, ip, #0 235 rsb ip, ip, #0
@@ -241,30 +241,30 @@ USER( TUSER( str) r3, [r0], #4) @ May fault
241 subs ip, ip, #16 241 subs ip, ip, #16
242 blt .Lc2u_3rem8lp 242 blt .Lc2u_3rem8lp
243 243
244.Lc2u_3cpy8lp: mov r3, r7, pull #24 244.Lc2u_3cpy8lp: mov r3, r7, lspull #24
245 ldmia r1!, {r4 - r7} 245 ldmia r1!, {r4 - r7}
246 subs ip, ip, #16 246 subs ip, ip, #16
247 orr r3, r3, r4, push #8 247 orr r3, r3, r4, lspush #8
248 mov r4, r4, pull #24 248 mov r4, r4, lspull #24
249 orr r4, r4, r5, push #8 249 orr r4, r4, r5, lspush #8
250 mov r5, r5, pull #24 250 mov r5, r5, lspull #24
251 orr r5, r5, r6, push #8 251 orr r5, r5, r6, lspush #8
252 mov r6, r6, pull #24 252 mov r6, r6, lspull #24
253 orr r6, r6, r7, push #8 253 orr r6, r6, r7, lspush #8
254 stmia r0!, {r3 - r6} @ Shouldnt fault 254 stmia r0!, {r3 - r6} @ Shouldnt fault
255 bpl .Lc2u_3cpy8lp 255 bpl .Lc2u_3cpy8lp
256 256
257.Lc2u_3rem8lp: tst ip, #8 257.Lc2u_3rem8lp: tst ip, #8
258 movne r3, r7, pull #24 258 movne r3, r7, lspull #24
259 ldmneia r1!, {r4, r7} 259 ldmneia r1!, {r4, r7}
260 orrne r3, r3, r4, push #8 260 orrne r3, r3, r4, lspush #8
261 movne r4, r4, pull #24 261 movne r4, r4, lspull #24
262 orrne r4, r4, r7, push #8 262 orrne r4, r4, r7, lspush #8
263 stmneia r0!, {r3 - r4} @ Shouldnt fault 263 stmneia r0!, {r3 - r4} @ Shouldnt fault
264 tst ip, #4 264 tst ip, #4
265 movne r3, r7, pull #24 265 movne r3, r7, lspull #24
266 ldrne r7, [r1], #4 266 ldrne r7, [r1], #4
267 orrne r3, r3, r7, push #8 267 orrne r3, r3, r7, lspush #8
268 TUSER( strne) r3, [r0], #4 @ Shouldnt fault 268 TUSER( strne) r3, [r0], #4 @ Shouldnt fault
269 ands ip, ip, #3 269 ands ip, ip, #3
270 beq .Lc2u_3fupi 270 beq .Lc2u_3fupi
@@ -382,9 +382,9 @@ USER( TUSER( ldr) r7, [r1], #4) @ May fault
382.Lcfu_1fupi: subs r2, r2, #4 382.Lcfu_1fupi: subs r2, r2, #4
383 addmi ip, r2, #4 383 addmi ip, r2, #4
384 bmi .Lcfu_1nowords 384 bmi .Lcfu_1nowords
385 mov r3, r7, pull #8 385 mov r3, r7, lspull #8
386USER( TUSER( ldr) r7, [r1], #4) @ May fault 386USER( TUSER( ldr) r7, [r1], #4) @ May fault
387 orr r3, r3, r7, push #24 387 orr r3, r3, r7, lspush #24
388 str r3, [r0], #4 388 str r3, [r0], #4
389 mov ip, r1, lsl #32 - PAGE_SHIFT 389 mov ip, r1, lsl #32 - PAGE_SHIFT
390 rsb ip, ip, #0 390 rsb ip, ip, #0
@@ -396,30 +396,30 @@ USER( TUSER( ldr) r7, [r1], #4) @ May fault
396 subs ip, ip, #16 396 subs ip, ip, #16
397 blt .Lcfu_1rem8lp 397 blt .Lcfu_1rem8lp
398 398
399.Lcfu_1cpy8lp: mov r3, r7, pull #8 399.Lcfu_1cpy8lp: mov r3, r7, lspull #8
400 ldmia r1!, {r4 - r7} @ Shouldnt fault 400 ldmia r1!, {r4 - r7} @ Shouldnt fault
401 subs ip, ip, #16 401 subs ip, ip, #16
402 orr r3, r3, r4, push #24 402 orr r3, r3, r4, lspush #24
403 mov r4, r4, pull #8 403 mov r4, r4, lspull #8
404 orr r4, r4, r5, push #24 404 orr r4, r4, r5, lspush #24
405 mov r5, r5, pull #8 405 mov r5, r5, lspull #8
406 orr r5, r5, r6, push #24 406 orr r5, r5, r6, lspush #24
407 mov r6, r6, pull #8 407 mov r6, r6, lspull #8
408 orr r6, r6, r7, push #24 408 orr r6, r6, r7, lspush #24
409 stmia r0!, {r3 - r6} 409 stmia r0!, {r3 - r6}
410 bpl .Lcfu_1cpy8lp 410 bpl .Lcfu_1cpy8lp
411 411
412.Lcfu_1rem8lp: tst ip, #8 412.Lcfu_1rem8lp: tst ip, #8
413 movne r3, r7, pull #8 413 movne r3, r7, lspull #8
414 ldmneia r1!, {r4, r7} @ Shouldnt fault 414 ldmneia r1!, {r4, r7} @ Shouldnt fault
415 orrne r3, r3, r4, push #24 415 orrne r3, r3, r4, lspush #24
416 movne r4, r4, pull #8 416 movne r4, r4, lspull #8
417 orrne r4, r4, r7, push #24 417 orrne r4, r4, r7, lspush #24
418 stmneia r0!, {r3 - r4} 418 stmneia r0!, {r3 - r4}
419 tst ip, #4 419 tst ip, #4
420 movne r3, r7, pull #8 420 movne r3, r7, lspull #8
421USER( TUSER( ldrne) r7, [r1], #4) @ May fault 421USER( TUSER( ldrne) r7, [r1], #4) @ May fault
422 orrne r3, r3, r7, push #24 422 orrne r3, r3, r7, lspush #24
423 strne r3, [r0], #4 423 strne r3, [r0], #4
424 ands ip, ip, #3 424 ands ip, ip, #3
425 beq .Lcfu_1fupi 425 beq .Lcfu_1fupi
@@ -437,9 +437,9 @@ USER( TUSER( ldrne) r7, [r1], #4) @ May fault
437.Lcfu_2fupi: subs r2, r2, #4 437.Lcfu_2fupi: subs r2, r2, #4
438 addmi ip, r2, #4 438 addmi ip, r2, #4
439 bmi .Lcfu_2nowords 439 bmi .Lcfu_2nowords
440 mov r3, r7, pull #16 440 mov r3, r7, lspull #16
441USER( TUSER( ldr) r7, [r1], #4) @ May fault 441USER( TUSER( ldr) r7, [r1], #4) @ May fault
442 orr r3, r3, r7, push #16 442 orr r3, r3, r7, lspush #16
443 str r3, [r0], #4 443 str r3, [r0], #4
444 mov ip, r1, lsl #32 - PAGE_SHIFT 444 mov ip, r1, lsl #32 - PAGE_SHIFT
445 rsb ip, ip, #0 445 rsb ip, ip, #0
@@ -452,30 +452,30 @@ USER( TUSER( ldr) r7, [r1], #4) @ May fault
452 blt .Lcfu_2rem8lp 452 blt .Lcfu_2rem8lp
453 453
454 454
455.Lcfu_2cpy8lp: mov r3, r7, pull #16 455.Lcfu_2cpy8lp: mov r3, r7, lspull #16
456 ldmia r1!, {r4 - r7} @ Shouldnt fault 456 ldmia r1!, {r4 - r7} @ Shouldnt fault
457 subs ip, ip, #16 457 subs ip, ip, #16
458 orr r3, r3, r4, push #16 458 orr r3, r3, r4, lspush #16
459 mov r4, r4, pull #16 459 mov r4, r4, lspull #16
460 orr r4, r4, r5, push #16 460 orr r4, r4, r5, lspush #16
461 mov r5, r5, pull #16 461 mov r5, r5, lspull #16
462 orr r5, r5, r6, push #16 462 orr r5, r5, r6, lspush #16
463 mov r6, r6, pull #16 463 mov r6, r6, lspull #16
464 orr r6, r6, r7, push #16 464 orr r6, r6, r7, lspush #16
465 stmia r0!, {r3 - r6} 465 stmia r0!, {r3 - r6}
466 bpl .Lcfu_2cpy8lp 466 bpl .Lcfu_2cpy8lp
467 467
468.Lcfu_2rem8lp: tst ip, #8 468.Lcfu_2rem8lp: tst ip, #8
469 movne r3, r7, pull #16 469 movne r3, r7, lspull #16
470 ldmneia r1!, {r4, r7} @ Shouldnt fault 470 ldmneia r1!, {r4, r7} @ Shouldnt fault
471 orrne r3, r3, r4, push #16 471 orrne r3, r3, r4, lspush #16
472 movne r4, r4, pull #16 472 movne r4, r4, lspull #16
473 orrne r4, r4, r7, push #16 473 orrne r4, r4, r7, lspush #16
474 stmneia r0!, {r3 - r4} 474 stmneia r0!, {r3 - r4}
475 tst ip, #4 475 tst ip, #4
476 movne r3, r7, pull #16 476 movne r3, r7, lspull #16
477USER( TUSER( ldrne) r7, [r1], #4) @ May fault 477USER( TUSER( ldrne) r7, [r1], #4) @ May fault
478 orrne r3, r3, r7, push #16 478 orrne r3, r3, r7, lspush #16
479 strne r3, [r0], #4 479 strne r3, [r0], #4
480 ands ip, ip, #3 480 ands ip, ip, #3
481 beq .Lcfu_2fupi 481 beq .Lcfu_2fupi
@@ -493,9 +493,9 @@ USER( TUSER( ldrgtb) r3, [r1], #0) @ May fault
493.Lcfu_3fupi: subs r2, r2, #4 493.Lcfu_3fupi: subs r2, r2, #4
494 addmi ip, r2, #4 494 addmi ip, r2, #4
495 bmi .Lcfu_3nowords 495 bmi .Lcfu_3nowords
496 mov r3, r7, pull #24 496 mov r3, r7, lspull #24
497USER( TUSER( ldr) r7, [r1], #4) @ May fault 497USER( TUSER( ldr) r7, [r1], #4) @ May fault
498 orr r3, r3, r7, push #8 498 orr r3, r3, r7, lspush #8
499 str r3, [r0], #4 499 str r3, [r0], #4
500 mov ip, r1, lsl #32 - PAGE_SHIFT 500 mov ip, r1, lsl #32 - PAGE_SHIFT
501 rsb ip, ip, #0 501 rsb ip, ip, #0
@@ -507,30 +507,30 @@ USER( TUSER( ldr) r7, [r1], #4) @ May fault
507 subs ip, ip, #16 507 subs ip, ip, #16
508 blt .Lcfu_3rem8lp 508 blt .Lcfu_3rem8lp
509 509
510.Lcfu_3cpy8lp: mov r3, r7, pull #24 510.Lcfu_3cpy8lp: mov r3, r7, lspull #24
511 ldmia r1!, {r4 - r7} @ Shouldnt fault 511 ldmia r1!, {r4 - r7} @ Shouldnt fault
512 orr r3, r3, r4, push #8 512 orr r3, r3, r4, lspush #8
513 mov r4, r4, pull #24 513 mov r4, r4, lspull #24
514 orr r4, r4, r5, push #8 514 orr r4, r4, r5, lspush #8
515 mov r5, r5, pull #24 515 mov r5, r5, lspull #24
516 orr r5, r5, r6, push #8 516 orr r5, r5, r6, lspush #8
517 mov r6, r6, pull #24 517 mov r6, r6, lspull #24
518 orr r6, r6, r7, push #8 518 orr r6, r6, r7, lspush #8
519 stmia r0!, {r3 - r6} 519 stmia r0!, {r3 - r6}
520 subs ip, ip, #16 520 subs ip, ip, #16
521 bpl .Lcfu_3cpy8lp 521 bpl .Lcfu_3cpy8lp
522 522
523.Lcfu_3rem8lp: tst ip, #8 523.Lcfu_3rem8lp: tst ip, #8
524 movne r3, r7, pull #24 524 movne r3, r7, lspull #24
525 ldmneia r1!, {r4, r7} @ Shouldnt fault 525 ldmneia r1!, {r4, r7} @ Shouldnt fault
526 orrne r3, r3, r4, push #8 526 orrne r3, r3, r4, lspush #8
527 movne r4, r4, pull #24 527 movne r4, r4, lspull #24
528 orrne r4, r4, r7, push #8 528 orrne r4, r4, r7, lspush #8
529 stmneia r0!, {r3 - r4} 529 stmneia r0!, {r3 - r4}
530 tst ip, #4 530 tst ip, #4
531 movne r3, r7, pull #24 531 movne r3, r7, lspull #24
532USER( TUSER( ldrne) r7, [r1], #4) @ May fault 532USER( TUSER( ldrne) r7, [r1], #4) @ May fault
533 orrne r3, r3, r7, push #8 533 orrne r3, r3, r7, lspush #8
534 strne r3, [r0], #4 534 strne r3, [r0], #4
535 ands ip, ip, #3 535 ands ip, ip, #3
536 beq .Lcfu_3fupi 536 beq .Lcfu_3fupi
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 4f0e800e7e71..b2d2cf4dc052 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -57,6 +57,7 @@ config SOC_SAMA5
57 select GENERIC_CLOCKEVENTS 57 select GENERIC_CLOCKEVENTS
58 select MULTI_IRQ_HANDLER 58 select MULTI_IRQ_HANDLER
59 select SPARSE_IRQ 59 select SPARSE_IRQ
60 select USE_OF
60 61
61menu "Atmel AT91 System-on-Chip" 62menu "Atmel AT91 System-on-Chip"
62 63
@@ -64,11 +65,22 @@ choice
64 65
65 prompt "Core type" 66 prompt "Core type"
66 67
68config ARCH_AT91X40
69 bool "ARM7 AT91X40"
70 depends on !MMU
71 select CPU_ARM7TDMI
72 select ARCH_USES_GETTIMEOFFSET
73 select MULTI_IRQ_HANDLER
74 select SPARSE_IRQ
75
76 help
77 Select this if you are using one of Atmel's AT91X40 SoC.
78
67config SOC_SAM_V4_V5 79config SOC_SAM_V4_V5
68 bool "ARM7/ARM9" 80 bool "ARM9 AT91SAM9/AT91RM9200"
69 help 81 help
70 Select this if you are using one of Atmel's AT91SAM9, AT91RM9200 82 Select this if you are using one of Atmel's AT91SAM9 or
71 or AT91X40 SoC. 83 AT91RM9200 SoC.
72 84
73config SOC_SAM_V7 85config SOC_SAM_V7
74 bool "Cortex A5" 86 bool "Cortex A5"
@@ -119,7 +131,6 @@ config SOC_AT91SAM9261
119 select HAVE_AT91_DBGU0 131 select HAVE_AT91_DBGU0
120 select HAVE_FB_ATMEL 132 select HAVE_FB_ATMEL
121 select SOC_AT91SAM9 133 select SOC_AT91SAM9
122 select AT91_USE_OLD_CLK
123 select HAVE_AT91_USB_CLK 134 select HAVE_AT91_USB_CLK
124 help 135 help
125 Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC. 136 Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
@@ -137,7 +148,6 @@ config SOC_AT91SAM9RL
137 select HAVE_AT91_DBGU0 148 select HAVE_AT91_DBGU0
138 select HAVE_FB_ATMEL 149 select HAVE_FB_ATMEL
139 select SOC_AT91SAM9 150 select SOC_AT91SAM9
140 select AT91_USE_OLD_CLK
141 select HAVE_AT91_UTMI 151 select HAVE_AT91_UTMI
142 152
143config SOC_AT91SAM9G45 153config SOC_AT91SAM9G45
@@ -179,9 +189,12 @@ config SOC_AT91SAM9N12
179 Select this if you are using Atmel's AT91SAM9N12 SoC. 189 Select this if you are using Atmel's AT91SAM9N12 SoC.
180 190
181# ---------------------------------------------------------- 191# ----------------------------------------------------------
192endif # SOC_SAM_V4_V5
182 193
194
195if SOC_SAM_V4_V5 || ARCH_AT91X40
183source arch/arm/mach-at91/Kconfig.non_dt 196source arch/arm/mach-at91/Kconfig.non_dt
184endif # SOC_SAM_V4_V5 197endif
185 198
186comment "Generic Board Type" 199comment "Generic Board Type"
187 200
diff --git a/arch/arm/mach-at91/Kconfig.non_dt b/arch/arm/mach-at91/Kconfig.non_dt
index 1f73e9b527da..44ace320d2e1 100644
--- a/arch/arm/mach-at91/Kconfig.non_dt
+++ b/arch/arm/mach-at91/Kconfig.non_dt
@@ -5,6 +5,7 @@ config HAVE_AT91_DATAFLASH_CARD
5 5
6choice 6choice
7 prompt "Atmel AT91 Processor Devices for non DT boards" 7 prompt "Atmel AT91 Processor Devices for non DT boards"
8 depends on !ARCH_AT91X40
8 9
9config ARCH_AT91_NONE 10config ARCH_AT91_NONE
10 bool "None" 11 bool "None"
@@ -39,13 +40,6 @@ config ARCH_AT91SAM9G45
39 select SOC_AT91SAM9G45 40 select SOC_AT91SAM9G45
40 select AT91_USE_OLD_CLK 41 select AT91_USE_OLD_CLK
41 42
42config ARCH_AT91X40
43 bool "AT91x40"
44 depends on !MMU
45 select ARCH_USES_GETTIMEOFFSET
46 select MULTI_IRQ_HANDLER
47 select SPARSE_IRQ
48
49endchoice 43endchoice
50 44
51config ARCH_AT91SAM9G20 45config ARCH_AT91SAM9G20
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index e47f5fd232f5..787bb50a4dff 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -21,6 +21,7 @@
21#include <mach/at91rm9200.h> 21#include <mach/at91rm9200.h>
22#include <mach/at91_st.h> 22#include <mach/at91_st.h>
23#include <mach/cpu.h> 23#include <mach/cpu.h>
24#include <mach/hardware.h>
24 25
25#include "at91_aic.h" 26#include "at91_aic.h"
26#include "soc.h" 27#include "soc.h"
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index 3ebc9792560c..f3f19f21352a 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -21,6 +21,7 @@
21#include <mach/at91rm9200.h> 21#include <mach/at91rm9200.h>
22#include <mach/at91rm9200_mc.h> 22#include <mach/at91rm9200_mc.h>
23#include <mach/at91_ramc.h> 23#include <mach/at91_ramc.h>
24#include <mach/hardware.h>
24 25
25#include "board.h" 26#include "board.h"
26#include "generic.h" 27#include "generic.h"
@@ -922,6 +923,7 @@ static struct resource dbgu_resources[] = {
922static struct atmel_uart_data dbgu_data = { 923static struct atmel_uart_data dbgu_data = {
923 .use_dma_tx = 0, 924 .use_dma_tx = 0,
924 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 925 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
926 .rts_gpio = -EINVAL,
925}; 927};
926 928
927static u64 dbgu_dmamask = DMA_BIT_MASK(32); 929static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -960,6 +962,7 @@ static struct resource uart0_resources[] = {
960static struct atmel_uart_data uart0_data = { 962static struct atmel_uart_data uart0_data = {
961 .use_dma_tx = 1, 963 .use_dma_tx = 1,
962 .use_dma_rx = 1, 964 .use_dma_rx = 1,
965 .rts_gpio = -EINVAL,
963}; 966};
964 967
965static u64 uart0_dmamask = DMA_BIT_MASK(32); 968static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -987,9 +990,10 @@ static inline void configure_usart0_pins(unsigned pins)
987 if (pins & ATMEL_UART_RTS) { 990 if (pins & ATMEL_UART_RTS) {
988 /* 991 /*
989 * AT91RM9200 Errata #39 - RTS0 is not internally connected to PA21. 992 * AT91RM9200 Errata #39 - RTS0 is not internally connected to PA21.
990 * We need to drive the pin manually. Default is off (RTS is active low). 993 * We need to drive the pin manually. The serial driver will driver
994 * this to high when initializing.
991 */ 995 */
992 at91_set_gpio_output(AT91_PIN_PA21, 1); 996 uart0_data.rts_gpio = AT91_PIN_PA21;
993 } 997 }
994} 998}
995 999
@@ -1009,6 +1013,7 @@ static struct resource uart1_resources[] = {
1009static struct atmel_uart_data uart1_data = { 1013static struct atmel_uart_data uart1_data = {
1010 .use_dma_tx = 1, 1014 .use_dma_tx = 1,
1011 .use_dma_rx = 1, 1015 .use_dma_rx = 1,
1016 .rts_gpio = -EINVAL,
1012}; 1017};
1013 1018
1014static u64 uart1_dmamask = DMA_BIT_MASK(32); 1019static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -1060,6 +1065,7 @@ static struct resource uart2_resources[] = {
1060static struct atmel_uart_data uart2_data = { 1065static struct atmel_uart_data uart2_data = {
1061 .use_dma_tx = 1, 1066 .use_dma_tx = 1,
1062 .use_dma_rx = 1, 1067 .use_dma_rx = 1,
1068 .rts_gpio = -EINVAL,
1063}; 1069};
1064 1070
1065static u64 uart2_dmamask = DMA_BIT_MASK(32); 1071static u64 uart2_dmamask = DMA_BIT_MASK(32);
@@ -1103,6 +1109,7 @@ static struct resource uart3_resources[] = {
1103static struct atmel_uart_data uart3_data = { 1109static struct atmel_uart_data uart3_data = {
1104 .use_dma_tx = 1, 1110 .use_dma_tx = 1,
1105 .use_dma_rx = 1, 1111 .use_dma_rx = 1,
1112 .rts_gpio = -EINVAL,
1106}; 1113};
1107 1114
1108static u64 uart3_dmamask = DMA_BIT_MASK(32); 1115static u64 uart3_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
index bc7b363a3083..7fd13aef9827 100644
--- a/arch/arm/mach-at91/at91rm9200_time.c
+++ b/arch/arm/mach-at91/at91rm9200_time.c
@@ -31,6 +31,7 @@
31#include <asm/mach/time.h> 31#include <asm/mach/time.h>
32 32
33#include <mach/at91_st.h> 33#include <mach/at91_st.h>
34#include <mach/hardware.h>
34 35
35static unsigned long last_crtr; 36static unsigned long last_crtr;
36static u32 irqmask; 37static u32 irqmask;
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index 6c821e562159..c3d22be73b7c 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -21,6 +21,7 @@
21#include <mach/cpu.h> 21#include <mach/cpu.h>
22#include <mach/at91_dbgu.h> 22#include <mach/at91_dbgu.h>
23#include <mach/at91sam9260.h> 23#include <mach/at91sam9260.h>
24#include <mach/hardware.h>
24 25
25#include "at91_aic.h" 26#include "at91_aic.h"
26#include "at91_rstc.h" 27#include "at91_rstc.h"
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index eda8d1679d40..8b1b0a870025 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -25,6 +25,7 @@
25#include <mach/at91_matrix.h> 25#include <mach/at91_matrix.h>
26#include <mach/at91sam9_smc.h> 26#include <mach/at91sam9_smc.h>
27#include <mach/at91_adc.h> 27#include <mach/at91_adc.h>
28#include <mach/hardware.h>
28 29
29#include "board.h" 30#include "board.h"
30#include "generic.h" 31#include "generic.h"
@@ -819,6 +820,7 @@ static struct resource dbgu_resources[] = {
819static struct atmel_uart_data dbgu_data = { 820static struct atmel_uart_data dbgu_data = {
820 .use_dma_tx = 0, 821 .use_dma_tx = 0,
821 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 822 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
823 .rts_gpio = -EINVAL,
822}; 824};
823 825
824static u64 dbgu_dmamask = DMA_BIT_MASK(32); 826static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -857,6 +859,7 @@ static struct resource uart0_resources[] = {
857static struct atmel_uart_data uart0_data = { 859static struct atmel_uart_data uart0_data = {
858 .use_dma_tx = 1, 860 .use_dma_tx = 1,
859 .use_dma_rx = 1, 861 .use_dma_rx = 1,
862 .rts_gpio = -EINVAL,
860}; 863};
861 864
862static u64 uart0_dmamask = DMA_BIT_MASK(32); 865static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -908,6 +911,7 @@ static struct resource uart1_resources[] = {
908static struct atmel_uart_data uart1_data = { 911static struct atmel_uart_data uart1_data = {
909 .use_dma_tx = 1, 912 .use_dma_tx = 1,
910 .use_dma_rx = 1, 913 .use_dma_rx = 1,
914 .rts_gpio = -EINVAL,
911}; 915};
912 916
913static u64 uart1_dmamask = DMA_BIT_MASK(32); 917static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -951,6 +955,7 @@ static struct resource uart2_resources[] = {
951static struct atmel_uart_data uart2_data = { 955static struct atmel_uart_data uart2_data = {
952 .use_dma_tx = 1, 956 .use_dma_tx = 1,
953 .use_dma_rx = 1, 957 .use_dma_rx = 1,
958 .rts_gpio = -EINVAL,
954}; 959};
955 960
956static u64 uart2_dmamask = DMA_BIT_MASK(32); 961static u64 uart2_dmamask = DMA_BIT_MASK(32);
@@ -994,6 +999,7 @@ static struct resource uart3_resources[] = {
994static struct atmel_uart_data uart3_data = { 999static struct atmel_uart_data uart3_data = {
995 .use_dma_tx = 1, 1000 .use_dma_tx = 1,
996 .use_dma_rx = 1, 1001 .use_dma_rx = 1,
1002 .rts_gpio = -EINVAL,
997}; 1003};
998 1004
999static u64 uart3_dmamask = DMA_BIT_MASK(32); 1005static u64 uart3_dmamask = DMA_BIT_MASK(32);
@@ -1037,6 +1043,7 @@ static struct resource uart4_resources[] = {
1037static struct atmel_uart_data uart4_data = { 1043static struct atmel_uart_data uart4_data = {
1038 .use_dma_tx = 1, 1044 .use_dma_tx = 1,
1039 .use_dma_rx = 1, 1045 .use_dma_rx = 1,
1046 .rts_gpio = -EINVAL,
1040}; 1047};
1041 1048
1042static u64 uart4_dmamask = DMA_BIT_MASK(32); 1049static u64 uart4_dmamask = DMA_BIT_MASK(32);
@@ -1075,6 +1082,7 @@ static struct resource uart5_resources[] = {
1075static struct atmel_uart_data uart5_data = { 1082static struct atmel_uart_data uart5_data = {
1076 .use_dma_tx = 1, 1083 .use_dma_tx = 1,
1077 .use_dma_rx = 1, 1084 .use_dma_rx = 1,
1085 .rts_gpio = -EINVAL,
1078}; 1086};
1079 1087
1080static u64 uart5_dmamask = DMA_BIT_MASK(32); 1088static u64 uart5_dmamask = DMA_BIT_MASK(32);
@@ -1255,12 +1263,8 @@ void __init at91_add_device_cf(struct at91_cf_data *data)
1255 at91_set_A_periph(AT91_PIN_PC10, 0); /* CFRNW */ 1263 at91_set_A_periph(AT91_PIN_PC10, 0); /* CFRNW */
1256 at91_set_A_periph(AT91_PIN_PC15, 1); /* NWAIT */ 1264 at91_set_A_periph(AT91_PIN_PC15, 1); /* NWAIT */
1257 1265
1258 if (data->flags & AT91_CF_TRUE_IDE) 1266 if (IS_ENABLED(CONFIG_PATA_AT91) && (data->flags & AT91_CF_TRUE_IDE))
1259#if defined(CONFIG_PATA_AT91) || defined(CONFIG_PATA_AT91_MODULE)
1260 pdev->name = "pata_at91"; 1267 pdev->name = "pata_at91";
1261#else
1262#warning "board requires AT91_CF_TRUE_IDE: enable pata_at91"
1263#endif
1264 else 1268 else
1265 pdev->name = "at91_cf"; 1269 pdev->name = "at91_cf";
1266 1270
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 6276b4c1acfe..fb164a5d04a9 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -20,15 +20,18 @@
20#include <asm/system_misc.h> 20#include <asm/system_misc.h>
21#include <mach/cpu.h> 21#include <mach/cpu.h>
22#include <mach/at91sam9261.h> 22#include <mach/at91sam9261.h>
23#include <mach/hardware.h>
23 24
24#include "at91_aic.h" 25#include "at91_aic.h"
25#include "at91_rstc.h" 26#include "at91_rstc.h"
26#include "soc.h" 27#include "soc.h"
27#include "generic.h" 28#include "generic.h"
28#include "clock.h"
29#include "sam9_smc.h" 29#include "sam9_smc.h"
30#include "pm.h" 30#include "pm.h"
31 31
32#if defined(CONFIG_OLD_CLK_AT91)
33#include "clock.h"
34
32/* -------------------------------------------------------------------- 35/* --------------------------------------------------------------------
33 * Clocks 36 * Clocks
34 * -------------------------------------------------------------------- */ 37 * -------------------------------------------------------------------- */
@@ -189,6 +192,23 @@ static struct clk_lookup periph_clocks_lookups[] = {
189 CLKDEV_CON_ID("pioA", &pioA_clk), 192 CLKDEV_CON_ID("pioA", &pioA_clk),
190 CLKDEV_CON_ID("pioB", &pioB_clk), 193 CLKDEV_CON_ID("pioB", &pioB_clk),
191 CLKDEV_CON_ID("pioC", &pioC_clk), 194 CLKDEV_CON_ID("pioC", &pioC_clk),
195 /* more lookup table for DT entries */
196 CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck),
197 CLKDEV_CON_DEV_ID("usart", "fffb0000.serial", &usart0_clk),
198 CLKDEV_CON_DEV_ID("usart", "ffffb400.serial", &usart1_clk),
199 CLKDEV_CON_DEV_ID("usart", "fff94000.serial", &usart2_clk),
200 CLKDEV_CON_DEV_ID("t0_clk", "fffa0000.timer", &tc0_clk),
201 CLKDEV_CON_DEV_ID("t1_clk", "fffa0000.timer", &tc1_clk),
202 CLKDEV_CON_DEV_ID("t2_clk", "fffa0000.timer", &tc2_clk),
203 CLKDEV_CON_DEV_ID("hclk", "500000.ohci", &hck0),
204 CLKDEV_CON_DEV_ID("hclk", "600000.fb", &hck1),
205 CLKDEV_CON_DEV_ID("spi_clk", "fffc8000.spi", &spi0_clk),
206 CLKDEV_CON_DEV_ID("spi_clk", "fffcc000.spi", &spi1_clk),
207 CLKDEV_CON_DEV_ID("mci_clk", "fffa8000.mmc", &mmc_clk),
208 CLKDEV_CON_DEV_ID(NULL, "fffac000.i2c", &twi_clk),
209 CLKDEV_CON_DEV_ID(NULL, "fffff400.gpio", &pioA_clk),
210 CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioB_clk),
211 CLKDEV_CON_DEV_ID(NULL, "fffff800.gpio", &pioC_clk),
192}; 212};
193 213
194static struct clk_lookup usart_clocks_lookups[] = { 214static struct clk_lookup usart_clocks_lookups[] = {
@@ -247,7 +267,9 @@ static void __init at91sam9261_register_clocks(void)
247 clk_register(&hck0); 267 clk_register(&hck0);
248 clk_register(&hck1); 268 clk_register(&hck1);
249} 269}
250 270#else
271#define at91sam9261_register_clocks NULL
272#endif
251/* -------------------------------------------------------------------- 273/* --------------------------------------------------------------------
252 * GPIO 274 * GPIO
253 * -------------------------------------------------------------------- */ 275 * -------------------------------------------------------------------- */
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index b2a34740146a..80e35895d28f 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -25,6 +25,7 @@
25#include <mach/at91sam9261_matrix.h> 25#include <mach/at91sam9261_matrix.h>
26#include <mach/at91_matrix.h> 26#include <mach/at91_matrix.h>
27#include <mach/at91sam9_smc.h> 27#include <mach/at91sam9_smc.h>
28#include <mach/hardware.h>
28 29
29#include "board.h" 30#include "board.h"
30#include "generic.h" 31#include "generic.h"
@@ -880,6 +881,7 @@ static struct resource dbgu_resources[] = {
880static struct atmel_uart_data dbgu_data = { 881static struct atmel_uart_data dbgu_data = {
881 .use_dma_tx = 0, 882 .use_dma_tx = 0,
882 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 883 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
884 .rts_gpio = -EINVAL,
883}; 885};
884 886
885static u64 dbgu_dmamask = DMA_BIT_MASK(32); 887static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -918,6 +920,7 @@ static struct resource uart0_resources[] = {
918static struct atmel_uart_data uart0_data = { 920static struct atmel_uart_data uart0_data = {
919 .use_dma_tx = 1, 921 .use_dma_tx = 1,
920 .use_dma_rx = 1, 922 .use_dma_rx = 1,
923 .rts_gpio = -EINVAL,
921}; 924};
922 925
923static u64 uart0_dmamask = DMA_BIT_MASK(32); 926static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -961,6 +964,7 @@ static struct resource uart1_resources[] = {
961static struct atmel_uart_data uart1_data = { 964static struct atmel_uart_data uart1_data = {
962 .use_dma_tx = 1, 965 .use_dma_tx = 1,
963 .use_dma_rx = 1, 966 .use_dma_rx = 1,
967 .rts_gpio = -EINVAL,
964}; 968};
965 969
966static u64 uart1_dmamask = DMA_BIT_MASK(32); 970static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -1004,6 +1008,7 @@ static struct resource uart2_resources[] = {
1004static struct atmel_uart_data uart2_data = { 1008static struct atmel_uart_data uart2_data = {
1005 .use_dma_tx = 1, 1009 .use_dma_tx = 1,
1006 .use_dma_rx = 1, 1010 .use_dma_rx = 1,
1011 .rts_gpio = -EINVAL,
1007}; 1012};
1008 1013
1009static u64 uart2_dmamask = DMA_BIT_MASK(32); 1014static u64 uart2_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 37b90f4b990c..f30290572293 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -19,6 +19,7 @@
19#include <asm/mach/map.h> 19#include <asm/mach/map.h>
20#include <asm/system_misc.h> 20#include <asm/system_misc.h>
21#include <mach/at91sam9263.h> 21#include <mach/at91sam9263.h>
22#include <mach/hardware.h>
22 23
23#include "at91_aic.h" 24#include "at91_aic.h"
24#include "at91_rstc.h" 25#include "at91_rstc.h"
@@ -223,6 +224,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
223 CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioCDE_clk), 224 CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioCDE_clk),
224 CLKDEV_CON_DEV_ID(NULL, "fffff800.gpio", &pioCDE_clk), 225 CLKDEV_CON_DEV_ID(NULL, "fffff800.gpio", &pioCDE_clk),
225 CLKDEV_CON_DEV_ID(NULL, "fffffa00.gpio", &pioCDE_clk), 226 CLKDEV_CON_DEV_ID(NULL, "fffffa00.gpio", &pioCDE_clk),
227 CLKDEV_CON_DEV_ID(NULL, "fffb8000.pwm", &pwm_clk),
226}; 228};
227 229
228static struct clk_lookup usart_clocks_lookups[] = { 230static struct clk_lookup usart_clocks_lookups[] = {
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index 4aeadddbc181..43d53d6156dd 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -24,6 +24,7 @@
24#include <mach/at91sam9263_matrix.h> 24#include <mach/at91sam9263_matrix.h>
25#include <mach/at91_matrix.h> 25#include <mach/at91_matrix.h>
26#include <mach/at91sam9_smc.h> 26#include <mach/at91sam9_smc.h>
27#include <mach/hardware.h>
27 28
28#include "board.h" 29#include "board.h"
29#include "generic.h" 30#include "generic.h"
@@ -1324,6 +1325,7 @@ static struct resource dbgu_resources[] = {
1324static struct atmel_uart_data dbgu_data = { 1325static struct atmel_uart_data dbgu_data = {
1325 .use_dma_tx = 0, 1326 .use_dma_tx = 0,
1326 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 1327 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
1328 .rts_gpio = -EINVAL,
1327}; 1329};
1328 1330
1329static u64 dbgu_dmamask = DMA_BIT_MASK(32); 1331static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -1362,6 +1364,7 @@ static struct resource uart0_resources[] = {
1362static struct atmel_uart_data uart0_data = { 1364static struct atmel_uart_data uart0_data = {
1363 .use_dma_tx = 1, 1365 .use_dma_tx = 1,
1364 .use_dma_rx = 1, 1366 .use_dma_rx = 1,
1367 .rts_gpio = -EINVAL,
1365}; 1368};
1366 1369
1367static u64 uart0_dmamask = DMA_BIT_MASK(32); 1370static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -1405,6 +1408,7 @@ static struct resource uart1_resources[] = {
1405static struct atmel_uart_data uart1_data = { 1408static struct atmel_uart_data uart1_data = {
1406 .use_dma_tx = 1, 1409 .use_dma_tx = 1,
1407 .use_dma_rx = 1, 1410 .use_dma_rx = 1,
1411 .rts_gpio = -EINVAL,
1408}; 1412};
1409 1413
1410static u64 uart1_dmamask = DMA_BIT_MASK(32); 1414static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -1448,6 +1452,7 @@ static struct resource uart2_resources[] = {
1448static struct atmel_uart_data uart2_data = { 1452static struct atmel_uart_data uart2_data = {
1449 .use_dma_tx = 1, 1453 .use_dma_tx = 1,
1450 .use_dma_rx = 1, 1454 .use_dma_rx = 1,
1455 .rts_gpio = -EINVAL,
1451}; 1456};
1452 1457
1453static u64 uart2_dmamask = DMA_BIT_MASK(32); 1458static u64 uart2_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c
index 0f04ffe9c5a8..0a9e2fc8f796 100644
--- a/arch/arm/mach-at91/at91sam926x_time.c
+++ b/arch/arm/mach-at91/at91sam926x_time.c
@@ -19,6 +19,7 @@
19#include <linux/of_irq.h> 19#include <linux/of_irq.h>
20 20
21#include <asm/mach/time.h> 21#include <asm/mach/time.h>
22#include <mach/hardware.h>
22 23
23#define AT91_PIT_MR 0x00 /* Mode Register */ 24#define AT91_PIT_MR 0x00 /* Mode Register */
24#define AT91_PIT_PITIEN (1 << 25) /* Timer Interrupt Enable */ 25#define AT91_PIT_PITIEN (1 << 25) /* Timer Interrupt Enable */
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index 2f455ce35268..5e6f498db0a8 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -20,6 +20,7 @@
20#include <asm/system_misc.h> 20#include <asm/system_misc.h>
21#include <mach/at91sam9g45.h> 21#include <mach/at91sam9g45.h>
22#include <mach/cpu.h> 22#include <mach/cpu.h>
23#include <mach/hardware.h>
23 24
24#include "at91_aic.h" 25#include "at91_aic.h"
25#include "soc.h" 26#include "soc.h"
@@ -284,6 +285,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
284 CLKDEV_CON_ID("pioE", &pioDE_clk), 285 CLKDEV_CON_ID("pioE", &pioDE_clk),
285 /* Fake adc clock */ 286 /* Fake adc clock */
286 CLKDEV_CON_ID("adc_clk", &tsc_clk), 287 CLKDEV_CON_ID("adc_clk", &tsc_clk),
288 CLKDEV_CON_DEV_ID(NULL, "fffb8000.pwm", &pwm_clk),
287}; 289};
288 290
289static struct clk_lookup usart_clocks_lookups[] = { 291static struct clk_lookup usart_clocks_lookups[] = {
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index cb36fa872d30..77b04c2edd78 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -32,6 +32,7 @@
32#include <mach/at91sam9_smc.h> 32#include <mach/at91sam9_smc.h>
33#include <linux/platform_data/dma-atmel.h> 33#include <linux/platform_data/dma-atmel.h>
34#include <mach/atmel-mci.h> 34#include <mach/atmel-mci.h>
35#include <mach/hardware.h>
35 36
36#include <media/atmel-isi.h> 37#include <media/atmel-isi.h>
37 38
@@ -1587,6 +1588,7 @@ static struct resource dbgu_resources[] = {
1587static struct atmel_uart_data dbgu_data = { 1588static struct atmel_uart_data dbgu_data = {
1588 .use_dma_tx = 0, 1589 .use_dma_tx = 0,
1589 .use_dma_rx = 0, 1590 .use_dma_rx = 0,
1591 .rts_gpio = -EINVAL,
1590}; 1592};
1591 1593
1592static u64 dbgu_dmamask = DMA_BIT_MASK(32); 1594static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -1625,6 +1627,7 @@ static struct resource uart0_resources[] = {
1625static struct atmel_uart_data uart0_data = { 1627static struct atmel_uart_data uart0_data = {
1626 .use_dma_tx = 1, 1628 .use_dma_tx = 1,
1627 .use_dma_rx = 1, 1629 .use_dma_rx = 1,
1630 .rts_gpio = -EINVAL,
1628}; 1631};
1629 1632
1630static u64 uart0_dmamask = DMA_BIT_MASK(32); 1633static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -1668,6 +1671,7 @@ static struct resource uart1_resources[] = {
1668static struct atmel_uart_data uart1_data = { 1671static struct atmel_uart_data uart1_data = {
1669 .use_dma_tx = 1, 1672 .use_dma_tx = 1,
1670 .use_dma_rx = 1, 1673 .use_dma_rx = 1,
1674 .rts_gpio = -EINVAL,
1671}; 1675};
1672 1676
1673static u64 uart1_dmamask = DMA_BIT_MASK(32); 1677static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -1711,6 +1715,7 @@ static struct resource uart2_resources[] = {
1711static struct atmel_uart_data uart2_data = { 1715static struct atmel_uart_data uart2_data = {
1712 .use_dma_tx = 1, 1716 .use_dma_tx = 1,
1713 .use_dma_rx = 1, 1717 .use_dma_rx = 1,
1718 .rts_gpio = -EINVAL,
1714}; 1719};
1715 1720
1716static u64 uart2_dmamask = DMA_BIT_MASK(32); 1721static u64 uart2_dmamask = DMA_BIT_MASK(32);
@@ -1754,6 +1759,7 @@ static struct resource uart3_resources[] = {
1754static struct atmel_uart_data uart3_data = { 1759static struct atmel_uart_data uart3_data = {
1755 .use_dma_tx = 1, 1760 .use_dma_tx = 1,
1756 .use_dma_rx = 1, 1761 .use_dma_rx = 1,
1762 .rts_gpio = -EINVAL,
1757}; 1763};
1758 1764
1759static u64 uart3_dmamask = DMA_BIT_MASK(32); 1765static u64 uart3_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91sam9n12.c b/arch/arm/mach-at91/at91sam9n12.c
index 4ef088c62eab..f2ea7b0a02da 100644
--- a/arch/arm/mach-at91/at91sam9n12.c
+++ b/arch/arm/mach-at91/at91sam9n12.c
@@ -182,6 +182,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
182 /* additional fake clock for macb_hclk */ 182 /* additional fake clock for macb_hclk */
183 CLKDEV_CON_DEV_ID("hclk", "500000.ohci", &uhp_clk), 183 CLKDEV_CON_DEV_ID("hclk", "500000.ohci", &uhp_clk),
184 CLKDEV_CON_DEV_ID("ohci_clk", "500000.ohci", &uhp_clk), 184 CLKDEV_CON_DEV_ID("ohci_clk", "500000.ohci", &uhp_clk),
185 CLKDEV_CON_DEV_ID(NULL, "f8034000.pwm", &pwm_clk),
185}; 186};
186 187
187/* 188/*
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index 3651517abedf..57f12d86c0e6 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -20,18 +20,20 @@
20#include <mach/cpu.h> 20#include <mach/cpu.h>
21#include <mach/at91_dbgu.h> 21#include <mach/at91_dbgu.h>
22#include <mach/at91sam9rl.h> 22#include <mach/at91sam9rl.h>
23#include <mach/hardware.h>
23 24
24#include "at91_aic.h" 25#include "at91_aic.h"
25#include "at91_rstc.h" 26#include "at91_rstc.h"
26#include "soc.h" 27#include "soc.h"
27#include "generic.h" 28#include "generic.h"
28#include "clock.h"
29#include "sam9_smc.h" 29#include "sam9_smc.h"
30#include "pm.h" 30#include "pm.h"
31 31
32/* -------------------------------------------------------------------- 32/* --------------------------------------------------------------------
33 * Clocks 33 * Clocks
34 * -------------------------------------------------------------------- */ 34 * -------------------------------------------------------------------- */
35#if defined(CONFIG_OLD_CLK_AT91)
36#include "clock.h"
35 37
36/* 38/*
37 * The peripheral clocks. 39 * The peripheral clocks.
@@ -196,6 +198,24 @@ static struct clk_lookup periph_clocks_lookups[] = {
196 CLKDEV_CON_ID("pioB", &pioB_clk), 198 CLKDEV_CON_ID("pioB", &pioB_clk),
197 CLKDEV_CON_ID("pioC", &pioC_clk), 199 CLKDEV_CON_ID("pioC", &pioC_clk),
198 CLKDEV_CON_ID("pioD", &pioD_clk), 200 CLKDEV_CON_ID("pioD", &pioD_clk),
201 /* more lookup table for DT entries */
202 CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck),
203 CLKDEV_CON_DEV_ID("usart", "fffb0000.serial", &usart0_clk),
204 CLKDEV_CON_DEV_ID("usart", "ffffb400.serial", &usart1_clk),
205 CLKDEV_CON_DEV_ID("usart", "ffffb800.serial", &usart2_clk),
206 CLKDEV_CON_DEV_ID("usart", "ffffbc00.serial", &usart3_clk),
207 CLKDEV_CON_DEV_ID("t0_clk", "fffa0000.timer", &tc0_clk),
208 CLKDEV_CON_DEV_ID("t1_clk", "fffa0000.timer", &tc1_clk),
209 CLKDEV_CON_DEV_ID("t2_clk", "fffa0000.timer", &tc2_clk),
210 CLKDEV_CON_DEV_ID("mci_clk", "fffa4000.mmc", &mmc_clk),
211 CLKDEV_CON_DEV_ID(NULL, "fffa8000.i2c", &twi0_clk),
212 CLKDEV_CON_DEV_ID(NULL, "fffac000.i2c", &twi1_clk),
213 CLKDEV_CON_DEV_ID(NULL, "fffc8000.pwm", &pwm_clk),
214 CLKDEV_CON_DEV_ID(NULL, "ffffc800.pwm", &pwm_clk),
215 CLKDEV_CON_DEV_ID(NULL, "fffff400.gpio", &pioA_clk),
216 CLKDEV_CON_DEV_ID(NULL, "fffff600.gpio", &pioB_clk),
217 CLKDEV_CON_DEV_ID(NULL, "fffff800.gpio", &pioC_clk),
218 CLKDEV_CON_DEV_ID(NULL, "fffffa00.gpio", &pioD_clk),
199}; 219};
200 220
201static struct clk_lookup usart_clocks_lookups[] = { 221static struct clk_lookup usart_clocks_lookups[] = {
@@ -238,6 +258,7 @@ static void __init at91sam9rl_register_clocks(void)
238 clk_register(&pck0); 258 clk_register(&pck0);
239 clk_register(&pck1); 259 clk_register(&pck1);
240} 260}
261#endif
241 262
242/* -------------------------------------------------------------------- 263/* --------------------------------------------------------------------
243 * GPIO 264 * GPIO
@@ -350,6 +371,8 @@ AT91_SOC_START(at91sam9rl)
350 .default_irq_priority = at91sam9rl_default_irq_priority, 371 .default_irq_priority = at91sam9rl_default_irq_priority,
351 .extern_irq = (1 << AT91SAM9RL_ID_IRQ0), 372 .extern_irq = (1 << AT91SAM9RL_ID_IRQ0),
352 .ioremap_registers = at91sam9rl_ioremap_registers, 373 .ioremap_registers = at91sam9rl_ioremap_registers,
374#if defined(CONFIG_OLD_CLK_AT91)
353 .register_clocks = at91sam9rl_register_clocks, 375 .register_clocks = at91sam9rl_register_clocks,
376#endif
354 .init = at91sam9rl_initialize, 377 .init = at91sam9rl_initialize,
355AT91_SOC_END 378AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
index a698bdab2cce..428fc412aaf1 100644
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -21,6 +21,7 @@
21#include <mach/at91sam9rl_matrix.h> 21#include <mach/at91sam9rl_matrix.h>
22#include <mach/at91_matrix.h> 22#include <mach/at91_matrix.h>
23#include <mach/at91sam9_smc.h> 23#include <mach/at91sam9_smc.h>
24#include <mach/hardware.h>
24#include <linux/platform_data/dma-atmel.h> 25#include <linux/platform_data/dma-atmel.h>
25 26
26#include "board.h" 27#include "board.h"
@@ -956,6 +957,7 @@ static struct resource dbgu_resources[] = {
956static struct atmel_uart_data dbgu_data = { 957static struct atmel_uart_data dbgu_data = {
957 .use_dma_tx = 0, 958 .use_dma_tx = 0,
958 .use_dma_rx = 0, /* DBGU not capable of receive DMA */ 959 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
960 .rts_gpio = -EINVAL,
959}; 961};
960 962
961static u64 dbgu_dmamask = DMA_BIT_MASK(32); 963static u64 dbgu_dmamask = DMA_BIT_MASK(32);
@@ -994,6 +996,7 @@ static struct resource uart0_resources[] = {
994static struct atmel_uart_data uart0_data = { 996static struct atmel_uart_data uart0_data = {
995 .use_dma_tx = 1, 997 .use_dma_tx = 1,
996 .use_dma_rx = 1, 998 .use_dma_rx = 1,
999 .rts_gpio = -EINVAL,
997}; 1000};
998 1001
999static u64 uart0_dmamask = DMA_BIT_MASK(32); 1002static u64 uart0_dmamask = DMA_BIT_MASK(32);
@@ -1045,6 +1048,7 @@ static struct resource uart1_resources[] = {
1045static struct atmel_uart_data uart1_data = { 1048static struct atmel_uart_data uart1_data = {
1046 .use_dma_tx = 1, 1049 .use_dma_tx = 1,
1047 .use_dma_rx = 1, 1050 .use_dma_rx = 1,
1051 .rts_gpio = -EINVAL,
1048}; 1052};
1049 1053
1050static u64 uart1_dmamask = DMA_BIT_MASK(32); 1054static u64 uart1_dmamask = DMA_BIT_MASK(32);
@@ -1088,6 +1092,7 @@ static struct resource uart2_resources[] = {
1088static struct atmel_uart_data uart2_data = { 1092static struct atmel_uart_data uart2_data = {
1089 .use_dma_tx = 1, 1093 .use_dma_tx = 1,
1090 .use_dma_rx = 1, 1094 .use_dma_rx = 1,
1095 .rts_gpio = -EINVAL,
1091}; 1096};
1092 1097
1093static u64 uart2_dmamask = DMA_BIT_MASK(32); 1098static u64 uart2_dmamask = DMA_BIT_MASK(32);
@@ -1131,6 +1136,7 @@ static struct resource uart3_resources[] = {
1131static struct atmel_uart_data uart3_data = { 1136static struct atmel_uart_data uart3_data = {
1132 .use_dma_tx = 1, 1137 .use_dma_tx = 1,
1133 .use_dma_rx = 1, 1138 .use_dma_rx = 1,
1139 .rts_gpio = -EINVAL,
1134}; 1140};
1135 1141
1136static u64 uart3_dmamask = DMA_BIT_MASK(32); 1142static u64 uart3_dmamask = DMA_BIT_MASK(32);
diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c
index 3e8ec26e39dc..9ad781d5ee7c 100644
--- a/arch/arm/mach-at91/at91sam9x5.c
+++ b/arch/arm/mach-at91/at91sam9x5.c
@@ -253,6 +253,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
253 CLKDEV_CON_DEV_ID("ehci_clk", "700000.ehci", &uhphs_clk), 253 CLKDEV_CON_DEV_ID("ehci_clk", "700000.ehci", &uhphs_clk),
254 CLKDEV_CON_DEV_ID("hclk", "500000.gadget", &utmi_clk), 254 CLKDEV_CON_DEV_ID("hclk", "500000.gadget", &utmi_clk),
255 CLKDEV_CON_DEV_ID("pclk", "500000.gadget", &udphs_clk), 255 CLKDEV_CON_DEV_ID("pclk", "500000.gadget", &udphs_clk),
256 CLKDEV_CON_DEV_ID(NULL, "f8034000.pwm", &pwm_clk),
256}; 257};
257 258
258/* 259/*
diff --git a/arch/arm/mach-at91/at91x40.c b/arch/arm/mach-at91/at91x40.c
index bad94b84a46f..7523f1cdfe1d 100644
--- a/arch/arm/mach-at91/at91x40.c
+++ b/arch/arm/mach-at91/at91x40.c
@@ -19,7 +19,7 @@
19#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
20#include <mach/at91x40.h> 20#include <mach/at91x40.h>
21#include <mach/at91_st.h> 21#include <mach/at91_st.h>
22#include <mach/timex.h> 22#include <mach/hardware.h>
23 23
24#include "at91_aic.h" 24#include "at91_aic.h"
25#include "generic.h" 25#include "generic.h"
diff --git a/arch/arm/mach-at91/at91x40_time.c b/arch/arm/mach-at91/at91x40_time.c
index c0e637adf65d..07d0bf2ac2da 100644
--- a/arch/arm/mach-at91/at91x40_time.c
+++ b/arch/arm/mach-at91/at91x40_time.c
@@ -25,6 +25,7 @@
25#include <linux/time.h> 25#include <linux/time.h>
26#include <linux/io.h> 26#include <linux/io.h>
27#include <mach/hardware.h> 27#include <mach/hardware.h>
28#include <mach/at91x40.h>
28#include <asm/mach/time.h> 29#include <asm/mach/time.h>
29 30
30#include "at91_tc.h" 31#include "at91_tc.h"
diff --git a/arch/arm/mach-at91/board-dt-sam9.c b/arch/arm/mach-at91/board-dt-sam9.c
index 3dab868b02fa..575b0be66ca8 100644
--- a/arch/arm/mach-at91/board-dt-sam9.c
+++ b/arch/arm/mach-at91/board-dt-sam9.c
@@ -13,6 +13,7 @@
13#include <linux/gpio.h> 13#include <linux/gpio.h>
14#include <linux/of.h> 14#include <linux/of.h>
15#include <linux/of_irq.h> 15#include <linux/of_irq.h>
16#include <linux/clk-provider.h>
16 17
17#include <asm/setup.h> 18#include <asm/setup.h>
18#include <asm/irq.h> 19#include <asm/irq.h>
@@ -25,6 +26,14 @@
25#include "generic.h" 26#include "generic.h"
26 27
27 28
29static void __init sam9_dt_timer_init(void)
30{
31#if defined(CONFIG_COMMON_CLK)
32 of_clk_init(NULL);
33#endif
34 at91sam926x_pit_init();
35}
36
28static const struct of_device_id irq_of_match[] __initconst = { 37static const struct of_device_id irq_of_match[] __initconst = {
29 38
30 { .compatible = "atmel,at91rm9200-aic", .data = at91_aic_of_init }, 39 { .compatible = "atmel,at91rm9200-aic", .data = at91_aic_of_init },
@@ -43,7 +52,7 @@ static const char *at91_dt_board_compat[] __initdata = {
43 52
44DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)") 53DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)")
45 /* Maintainer: Atmel */ 54 /* Maintainer: Atmel */
46 .init_time = at91sam926x_pit_init, 55 .init_time = sam9_dt_timer_init,
47 .map_io = at91_map_io, 56 .map_io = at91_map_io,
48 .handle_irq = at91_aic_handle_irq, 57 .handle_irq = at91_aic_handle_irq,
49 .init_early = at91_dt_initialize, 58 .init_early = at91_dt_initialize,
diff --git a/arch/arm/mach-at91/board-gsia18s.c b/arch/arm/mach-at91/board-gsia18s.c
index c1d61d247790..416bae8435ee 100644
--- a/arch/arm/mach-at91/board-gsia18s.c
+++ b/arch/arm/mach-at91/board-gsia18s.c
@@ -31,6 +31,7 @@
31#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
32 32
33#include <mach/at91sam9_smc.h> 33#include <mach/at91sam9_smc.h>
34#include <mach/hardware.h>
34 35
35#include "at91_aic.h" 36#include "at91_aic.h"
36#include "board.h" 37#include "board.h"
diff --git a/arch/arm/mach-at91/board-pcontrol-g20.c b/arch/arm/mach-at91/board-pcontrol-g20.c
index 65c0d6b5ecba..5f25fa54eb93 100644
--- a/arch/arm/mach-at91/board-pcontrol-g20.c
+++ b/arch/arm/mach-at91/board-pcontrol-g20.c
@@ -30,6 +30,7 @@
30#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31 31
32#include <mach/at91sam9_smc.h> 32#include <mach/at91sam9_smc.h>
33#include <mach/hardware.h>
33 34
34#include "at91_aic.h" 35#include "at91_aic.h"
35#include "board.h" 36#include "board.h"
diff --git a/arch/arm/mach-at91/board-stamp9g20.c b/arch/arm/mach-at91/board-stamp9g20.c
index 869cbecf00b7..e4a5ac17cdbc 100644
--- a/arch/arm/mach-at91/board-stamp9g20.c
+++ b/arch/arm/mach-at91/board-stamp9g20.c
@@ -26,6 +26,7 @@
26#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
27 27
28#include <mach/at91sam9_smc.h> 28#include <mach/at91sam9_smc.h>
29#include <mach/hardware.h>
29 30
30#include "at91_aic.h" 31#include "at91_aic.h"
31#include "board.h" 32#include "board.h"
diff --git a/arch/arm/mach-at91/include/mach/at91x40.h b/arch/arm/mach-at91/include/mach/at91x40.h
index 90680217064e..38dca2bb027f 100644
--- a/arch/arm/mach-at91/include/mach/at91x40.h
+++ b/arch/arm/mach-at91/include/mach/at91x40.h
@@ -55,4 +55,6 @@
55#define AT91_PS_CR (AT91_PS + 0) /* PS Control register */ 55#define AT91_PS_CR (AT91_PS + 0) /* PS Control register */
56#define AT91_PS_CR_CPU (1 << 0) /* CPU clock disable bit */ 56#define AT91_PS_CR_CPU (1 << 0) /* CPU clock disable bit */
57 57
58#define AT91X40_MASTER_CLOCK 40000000
59
58#endif /* AT91X40_H */ 60#endif /* AT91X40_H */
diff --git a/arch/arm/mach-at91/include/mach/timex.h b/arch/arm/mach-at91/include/mach/timex.h
deleted file mode 100644
index 5e917a66edd7..000000000000
--- a/arch/arm/mach-at91/include/mach/timex.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * arch/arm/mach-at91/include/mach/timex.h
3 *
4 * Copyright (C) 2003 SAN People
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 * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef __ASM_ARCH_TIMEX_H
22#define __ASM_ARCH_TIMEX_H
23
24#include <mach/hardware.h>
25
26#ifdef CONFIG_ARCH_AT91X40
27
28#define AT91X40_MASTER_CLOCK 40000000
29#define CLOCK_TICK_RATE (AT91X40_MASTER_CLOCK)
30
31#else
32
33#define CLOCK_TICK_RATE 12345678
34
35#endif
36
37#endif /* __ASM_ARCH_TIMEX_H */
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 590b52dea9f7..8bda1cefdf96 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -27,6 +27,7 @@
27#include <asm/mach/irq.h> 27#include <asm/mach/irq.h>
28 28
29#include <mach/cpu.h> 29#include <mach/cpu.h>
30#include <mach/hardware.h>
30 31
31#include "at91_aic.h" 32#include "at91_aic.h"
32#include "generic.h" 33#include "generic.h"
diff --git a/arch/arm/mach-at91/sam9_smc.c b/arch/arm/mach-at91/sam9_smc.c
index b26156bf15db..826315af6d11 100644
--- a/arch/arm/mach-at91/sam9_smc.c
+++ b/arch/arm/mach-at91/sam9_smc.c
@@ -36,6 +36,7 @@ void sam9_smc_write_mode(int id, int cs,
36{ 36{
37 sam9_smc_cs_write_mode(AT91_SMC_CS(id, cs), config); 37 sam9_smc_cs_write_mode(AT91_SMC_CS(id, cs), config);
38} 38}
39EXPORT_SYMBOL_GPL(sam9_smc_write_mode);
39 40
40static void sam9_smc_cs_configure(void __iomem *base, 41static void sam9_smc_cs_configure(void __iomem *base,
41 struct sam9_smc_config *config) 42 struct sam9_smc_config *config)
@@ -69,6 +70,7 @@ void sam9_smc_configure(int id, int cs,
69{ 70{
70 sam9_smc_cs_configure(AT91_SMC_CS(id, cs), config); 71 sam9_smc_cs_configure(AT91_SMC_CS(id, cs), config);
71} 72}
73EXPORT_SYMBOL_GPL(sam9_smc_configure);
72 74
73static void sam9_smc_cs_read_mode(void __iomem *base, 75static void sam9_smc_cs_read_mode(void __iomem *base,
74 struct sam9_smc_config *config) 76 struct sam9_smc_config *config)
@@ -84,6 +86,7 @@ void sam9_smc_read_mode(int id, int cs,
84{ 86{
85 sam9_smc_cs_read_mode(AT91_SMC_CS(id, cs), config); 87 sam9_smc_cs_read_mode(AT91_SMC_CS(id, cs), config);
86} 88}
89EXPORT_SYMBOL_GPL(sam9_smc_read_mode);
87 90
88static void sam9_smc_cs_read(void __iomem *base, 91static void sam9_smc_cs_read(void __iomem *base,
89 struct sam9_smc_config *config) 92 struct sam9_smc_config *config)
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index f7ca97b7291e..f7a07a58ebb6 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -351,7 +351,7 @@ void __init at91_ioremap_matrix(u32 base_addr)
351 panic("Impossible to ioremap at91_matrix_base\n"); 351 panic("Impossible to ioremap at91_matrix_base\n");
352} 352}
353 353
354#if defined(CONFIG_OF) 354#if defined(CONFIG_OF) && !defined(CONFIG_ARCH_AT91X40)
355static struct of_device_id rstc_ids[] = { 355static struct of_device_id rstc_ids[] = {
356 { .compatible = "atmel,at91sam9260-rstc", .data = at91sam9_alt_restart }, 356 { .compatible = "atmel,at91sam9260-rstc", .data = at91sam9_alt_restart },
357 { .compatible = "atmel,at91sam9g45-rstc", .data = at91sam9g45_restart }, 357 { .compatible = "atmel,at91sam9g45-rstc", .data = at91sam9g45_restart },
diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
index b1aa6a9b3bd1..49c914cd9c7a 100644
--- a/arch/arm/mach-bcm/Kconfig
+++ b/arch/arm/mach-bcm/Kconfig
@@ -16,12 +16,7 @@ config ARCH_BCM_MOBILE
16 select ARM_ERRATA_754322 16 select ARM_ERRATA_754322
17 select ARM_ERRATA_764369 if SMP 17 select ARM_ERRATA_764369 if SMP
18 select ARM_GIC 18 select ARM_GIC
19 select CPU_V7
20 select CLKSRC_OF
21 select GENERIC_CLOCKEVENTS
22 select GENERIC_TIME
23 select GPIO_BCM_KONA 19 select GPIO_BCM_KONA
24 select SPARSE_IRQ
25 select TICK_ONESHOT 20 select TICK_ONESHOT
26 select CACHE_L2X0 21 select CACHE_L2X0
27 select HAVE_ARM_ARCH_TIMER 22 select HAVE_ARM_ARCH_TIMER
@@ -32,6 +27,48 @@ config ARCH_BCM_MOBILE
32 BCM11130, BCM11140, BCM11351, BCM28145 and 27 BCM11130, BCM11140, BCM11351, BCM28145 and
33 BCM28155 variants. 28 BCM28155 variants.
34 29
30config ARCH_BCM2835
31 bool "Broadcom BCM2835 family" if ARCH_MULTI_V6
32 select ARCH_REQUIRE_GPIOLIB
33 select ARM_AMBA
34 select ARM_ERRATA_411920
35 select ARM_TIMER_SP804
36 select CLKDEV_LOOKUP
37 select CLKSRC_OF
38 select CPU_V6
39 select GENERIC_CLOCKEVENTS
40 select PINCTRL
41 select PINCTRL_BCM2835
42 help
43 This enables support for the Broadcom BCM2835 SoC. This SoC is
44 used in the Raspberry Pi and Roku 2 devices.
45
46config ARCH_BCM_5301X
47 bool "Broadcom BCM470X / BCM5301X ARM SoC" if ARCH_MULTI_V7
48 depends on MMU
49 select ARM_GIC
50 select CACHE_L2X0
51 select HAVE_ARM_SCU if SMP
52 select HAVE_ARM_TWD if SMP
53 select HAVE_SMP
54 select COMMON_CLK
55 select GENERIC_CLOCKEVENTS
56 select ARM_GLOBAL_TIMER
57 select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
58 select MIGHT_HAVE_PCI
59 help
60 Support for Broadcom BCM470X and BCM5301X SoCs with ARM CPU cores.
61
62 This is a network SoC line mostly used in home routers and
63 wifi access points, it's internal name is Northstar.
64 This inclused the following SoC: BCM53010, BCM53011, BCM53012,
65 BCM53014, BCM53015, BCM53016, BCM53017, BCM53018, BCM4707,
66 BCM4708 and BCM4709.
67
68 Do not confuse this with the BCM4760 which is a totally
69 different SoC or with the older BCM47XX and BCM53XX based
70 network SoC using a MIPS CPU, they are supported by arch/mips/bcm47xx
71
35endmenu 72endmenu
36 73
37endif 74endif
diff --git a/arch/arm/mach-bcm/Makefile b/arch/arm/mach-bcm/Makefile
index c2ccd5a0f772..a326b28c4406 100644
--- a/arch/arm/mach-bcm/Makefile
+++ b/arch/arm/mach-bcm/Makefile
@@ -1,5 +1,5 @@
1# 1#
2# Copyright (C) 2012-2013 Broadcom Corporation 2# Copyright (C) 2012-2014 Broadcom Corporation
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 as 5# modify it under the terms of the GNU General Public License as
@@ -10,6 +10,10 @@
10# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10# of 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
13obj-$(CONFIG_ARCH_BCM_MOBILE) := board_bcm281xx.o bcm_kona_smc.o bcm_kona_smc_asm.o kona.o 13obj-$(CONFIG_ARCH_BCM_MOBILE) := board_bcm281xx.o board_bcm21664.o \
14 bcm_kona_smc.o bcm_kona_smc_asm.o kona.o
15obj-$(CONFIG_ARCH_BCM2835) += board_bcm2835.o
16
14plus_sec := $(call as-instr,.arch_extension sec,+sec) 17plus_sec := $(call as-instr,.arch_extension sec,+sec)
15AFLAGS_bcm_kona_smc_asm.o :=-Wa,-march=armv7-a$(plus_sec) 18AFLAGS_bcm_kona_smc_asm.o :=-Wa,-march=armv7-a$(plus_sec)
19obj-$(CONFIG_ARCH_BCM_5301X) += bcm_5301x.o
diff --git a/arch/arm/mach-bcm/bcm_5301x.c b/arch/arm/mach-bcm/bcm_5301x.c
new file mode 100644
index 000000000000..edff69761e04
--- /dev/null
+++ b/arch/arm/mach-bcm/bcm_5301x.c
@@ -0,0 +1,61 @@
1/*
2 * Broadcom BCM470X / BCM5301X ARM platform code.
3 *
4 * Copyright 2013 Hauke Mehrtens <hauke@hauke-m.de>
5 *
6 * Licensed under the GNU/GPL. See COPYING for details.
7 */
8#include <linux/of_platform.h>
9#include <asm/hardware/cache-l2x0.h>
10
11#include <asm/mach/arch.h>
12#include <asm/siginfo.h>
13#include <asm/signal.h>
14
15
16static bool first_fault = true;
17
18static int bcm5301x_abort_handler(unsigned long addr, unsigned int fsr,
19 struct pt_regs *regs)
20{
21 if (fsr == 0x1c06 && first_fault) {
22 first_fault = false;
23
24 /*
25 * These faults with code 0x1c06 happens for no good reason,
26 * possibly left over from the CFE boot loader.
27 */
28 pr_warn("External imprecise Data abort at addr=%#lx, fsr=%#x ignored.\n",
29 addr, fsr);
30
31 /* Returning non-zero causes fault display and panic */
32 return 0;
33 }
34
35 /* Others should cause a fault */
36 return 1;
37}
38
39static void __init bcm5301x_init_early(void)
40{
41 /* Install our hook */
42 hook_fault_code(16 + 6, bcm5301x_abort_handler, SIGBUS, BUS_OBJERR,
43 "imprecise external abort");
44}
45
46static void __init bcm5301x_dt_init(void)
47{
48 l2x0_of_init(0, ~0UL);
49 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
50}
51
52static const char __initconst *bcm5301x_dt_compat[] = {
53 "brcm,bcm4708",
54 NULL,
55};
56
57DT_MACHINE_START(BCM5301X, "BCM5301X")
58 .init_early = bcm5301x_init_early,
59 .init_machine = bcm5301x_dt_init,
60 .dt_compat = bcm5301x_dt_compat,
61MACHINE_END
diff --git a/arch/arm/mach-bcm/board_bcm21664.c b/arch/arm/mach-bcm/board_bcm21664.c
new file mode 100644
index 000000000000..acc1573fd005
--- /dev/null
+++ b/arch/arm/mach-bcm/board_bcm21664.c
@@ -0,0 +1,78 @@
1/*
2 * Copyright (C) 2014 Broadcom Corporation
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation version 2.
7 *
8 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
9 * kind, whether express or implied; without even the implied warranty
10 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#include <linux/clocksource.h>
15#include <linux/of_address.h>
16#include <linux/of_platform.h>
17
18#include <asm/mach/arch.h>
19
20#include "bcm_kona_smc.h"
21#include "kona.h"
22
23#define RSTMGR_DT_STRING "brcm,bcm21664-resetmgr"
24
25#define RSTMGR_REG_WR_ACCESS_OFFSET 0
26#define RSTMGR_REG_CHIP_SOFT_RST_OFFSET 4
27
28#define RSTMGR_WR_PASSWORD 0xa5a5
29#define RSTMGR_WR_PASSWORD_SHIFT 8
30#define RSTMGR_WR_ACCESS_ENABLE 1
31
32static void bcm21664_restart(enum reboot_mode mode, const char *cmd)
33{
34 void __iomem *base;
35 struct device_node *resetmgr;
36
37 resetmgr = of_find_compatible_node(NULL, NULL, RSTMGR_DT_STRING);
38 if (!resetmgr) {
39 pr_emerg("Couldn't find " RSTMGR_DT_STRING "\n");
40 return;
41 }
42 base = of_iomap(resetmgr, 0);
43 if (!base) {
44 pr_emerg("Couldn't map " RSTMGR_DT_STRING "\n");
45 return;
46 }
47
48 /*
49 * A soft reset is triggered by writing a 0 to bit 0 of the soft reset
50 * register. To write to that register we must first write the password
51 * and the enable bit in the write access enable register.
52 */
53 writel((RSTMGR_WR_PASSWORD << RSTMGR_WR_PASSWORD_SHIFT) |
54 RSTMGR_WR_ACCESS_ENABLE,
55 base + RSTMGR_REG_WR_ACCESS_OFFSET);
56 writel(0, base + RSTMGR_REG_CHIP_SOFT_RST_OFFSET);
57
58 /* Wait for reset */
59 while (1);
60}
61
62static void __init bcm21664_init(void)
63{
64 of_platform_populate(NULL, of_default_bus_match_table, NULL,
65 &platform_bus);
66 kona_l2_cache_init();
67}
68
69static const char * const bcm21664_dt_compat[] = {
70 "brcm,bcm21664",
71 NULL,
72};
73
74DT_MACHINE_START(BCM21664_DT, "BCM21664 Broadcom Application Processor")
75 .init_machine = bcm21664_init,
76 .restart = bcm21664_restart,
77 .dt_compat = bcm21664_dt_compat,
78MACHINE_END
diff --git a/arch/arm/mach-bcm/board_bcm281xx.c b/arch/arm/mach-bcm/board_bcm281xx.c
index cb3dc364405c..6be54c10f8cb 100644
--- a/arch/arm/mach-bcm/board_bcm281xx.c
+++ b/arch/arm/mach-bcm/board_bcm281xx.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2012-2013 Broadcom Corporation 2 * Copyright (C) 2012-2014 Broadcom Corporation
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 as 5 * modify it under the terms of the GNU General Public License as
@@ -11,64 +11,65 @@
11 * GNU General Public License for more details. 11 * GNU General Public License for more details.
12 */ 12 */
13 13
14#include <linux/of_platform.h>
15#include <linux/init.h>
16#include <linux/device.h>
17#include <linux/platform_device.h>
18#include <linux/clocksource.h> 14#include <linux/clocksource.h>
15#include <linux/of_address.h>
16#include <linux/of_platform.h>
19 17
20#include <asm/mach/arch.h> 18#include <asm/mach/arch.h>
21#include <asm/mach/time.h>
22#include <asm/hardware/cache-l2x0.h>
23 19
24#include "bcm_kona_smc.h"
25#include "kona.h" 20#include "kona.h"
26 21
27static int __init kona_l2_cache_init(void) 22#define SECWDOG_OFFSET 0x00000000
23#define SECWDOG_RESERVED_MASK 0xe2000000
24#define SECWDOG_WD_LOAD_FLAG_MASK 0x10000000
25#define SECWDOG_EN_MASK 0x08000000
26#define SECWDOG_SRSTEN_MASK 0x04000000
27#define SECWDOG_CLKS_SHIFT 20
28#define SECWDOG_COUNT_SHIFT 0
29
30static void bcm281xx_restart(enum reboot_mode mode, const char *cmd)
28{ 31{
29 if (!IS_ENABLED(CONFIG_CACHE_L2X0)) 32 uint32_t val;
30 return 0; 33 void __iomem *base;
34 struct device_node *np_wdog;
31 35
32 if (bcm_kona_smc_init() < 0) { 36 np_wdog = of_find_compatible_node(NULL, NULL, "brcm,kona-wdt");
33 pr_info("Kona secure API not available. Skipping L2 init\n"); 37 if (!np_wdog) {
34 return 0; 38 pr_emerg("Couldn't find brcm,kona-wdt\n");
39 return;
40 }
41 base = of_iomap(np_wdog, 0);
42 if (!base) {
43 pr_emerg("Couldn't map brcm,kona-wdt\n");
44 return;
35 } 45 }
36 46
37 bcm_kona_smc(SSAPI_ENABLE_L2_CACHE, 0, 0, 0, 0); 47 /* Enable watchdog with short timeout (244us). */
38 48 val = readl(base + SECWDOG_OFFSET);
39 /* 49 val &= SECWDOG_RESERVED_MASK | SECWDOG_WD_LOAD_FLAG_MASK;
40 * The aux_val and aux_mask have no effect since L2 cache is already 50 val |= SECWDOG_EN_MASK | SECWDOG_SRSTEN_MASK |
41 * enabled. Pass 0s for aux_val and 1s for aux_mask for default value. 51 (0x15 << SECWDOG_CLKS_SHIFT) |
42 */ 52 (0x8 << SECWDOG_COUNT_SHIFT);
43 return l2x0_of_init(0, ~0); 53 writel(val, base + SECWDOG_OFFSET);
44}
45
46static void bcm_board_setup_restart(void)
47{
48 struct device_node *np;
49 54
50 np = of_find_compatible_node(NULL, NULL, "brcm,bcm11351"); 55 /* Wait for reset */
51 if (np) { 56 while (1);
52 if (of_device_is_available(np))
53 bcm_kona_setup_restart();
54 of_node_put(np);
55 }
56 /* Restart setup for other boards goes here */
57} 57}
58 58
59static void __init board_init(void) 59static void __init bcm281xx_init(void)
60{ 60{
61 of_platform_populate(NULL, of_default_bus_match_table, NULL, 61 of_platform_populate(NULL, of_default_bus_match_table, NULL,
62 &platform_bus); 62 &platform_bus);
63
64 bcm_board_setup_restart();
65 kona_l2_cache_init(); 63 kona_l2_cache_init();
66} 64}
67 65
68static const char * const bcm11351_dt_compat[] = { "brcm,bcm11351", NULL, }; 66static const char * const bcm281xx_dt_compat[] = {
67 "brcm,bcm11351", /* Have to use the first number upstreamed */
68 NULL,
69};
69 70
70DT_MACHINE_START(BCM11351_DT, "BCM281xx Broadcom Application Processor") 71DT_MACHINE_START(BCM281XX_DT, "BCM281xx Broadcom Application Processor")
71 .init_machine = board_init, 72 .init_machine = bcm281xx_init,
72 .restart = bcm_kona_restart, 73 .restart = bcm281xx_restart,
73 .dt_compat = bcm11351_dt_compat, 74 .dt_compat = bcm281xx_dt_compat,
74MACHINE_END 75MACHINE_END
diff --git a/arch/arm/mach-bcm2835/bcm2835.c b/arch/arm/mach-bcm/board_bcm2835.c
index 70f2f3925f0e..70f2f3925f0e 100644
--- a/arch/arm/mach-bcm2835/bcm2835.c
+++ b/arch/arm/mach-bcm/board_bcm2835.c
diff --git a/arch/arm/mach-bcm/kona.c b/arch/arm/mach-bcm/kona.c
index 6939d9017f63..768bc2837bf5 100644
--- a/arch/arm/mach-bcm/kona.c
+++ b/arch/arm/mach-bcm/kona.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2013 Broadcom Corporation 2 * Copyright (C) 2012-2014 Broadcom Corporation
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 as 5 * modify it under the terms of the GNU General Public License as
@@ -11,55 +11,33 @@
11 * GNU General Public License for more details. 11 * GNU General Public License for more details.
12 */ 12 */
13 13
14#include <linux/of_address.h> 14#include <linux/of_platform.h>
15#include <asm/io.h> 15#include <asm/hardware/cache-l2x0.h>
16 16
17#include "bcm_kona_smc.h"
17#include "kona.h" 18#include "kona.h"
18 19
19static void __iomem *watchdog_base; 20void __init kona_l2_cache_init(void)
20
21void bcm_kona_setup_restart(void)
22{ 21{
23 struct device_node *np_wdog; 22 int ret;
24 23
25 /* 24 if (!IS_ENABLED(CONFIG_CACHE_L2X0))
26 * The assumption is that whoever calls bcm_kona_setup_restart()
27 * also needs a Kona Watchdog Timer entry in Device Tree, i.e. we
28 * report an error if the DT entry is missing.
29 */
30 np_wdog = of_find_compatible_node(NULL, NULL, "brcm,kona-wdt");
31 if (!np_wdog) {
32 pr_err("brcm,kona-wdt not found in DT, reboot disabled\n");
33 return; 25 return;
34 }
35 watchdog_base = of_iomap(np_wdog, 0);
36 WARN(!watchdog_base, "failed to map watchdog base");
37 of_node_put(np_wdog);
38}
39
40#define SECWDOG_OFFSET 0x00000000
41#define SECWDOG_RESERVED_MASK 0xE2000000
42#define SECWDOG_WD_LOAD_FLAG_MASK 0x10000000
43#define SECWDOG_EN_MASK 0x08000000
44#define SECWDOG_SRSTEN_MASK 0x04000000
45#define SECWDOG_CLKS_SHIFT 20
46#define SECWDOG_LOCK_SHIFT 0
47 26
48void bcm_kona_restart(enum reboot_mode mode, const char *cmd) 27 ret = bcm_kona_smc_init();
49{ 28 if (ret) {
50 uint32_t val; 29 pr_info("Secure API not available (%d). Skipping L2 init.\n",
51 30 ret);
52 if (!watchdog_base) 31 return;
53 panic("Watchdog not mapped. Reboot failed.\n"); 32 }
54 33
55 /* Enable watchdog2 with very short timeout. */ 34 bcm_kona_smc(SSAPI_ENABLE_L2_CACHE, 0, 0, 0, 0);
56 val = readl(watchdog_base + SECWDOG_OFFSET);
57 val &= SECWDOG_RESERVED_MASK | SECWDOG_WD_LOAD_FLAG_MASK;
58 val |= SECWDOG_EN_MASK | SECWDOG_SRSTEN_MASK |
59 (0x8 << SECWDOG_CLKS_SHIFT) |
60 (0x8 << SECWDOG_LOCK_SHIFT);
61 writel(val, watchdog_base + SECWDOG_OFFSET);
62 35
63 while (1) 36 /*
64 ; 37 * The aux_val and aux_mask have no effect since L2 cache is already
38 * enabled. Pass 0s for aux_val and 1s for aux_mask for default value.
39 */
40 ret = l2x0_of_init(0, ~0);
41 if (ret)
42 pr_err("Couldn't enable L2 cache: %d\n", ret);
65} 43}
diff --git a/arch/arm/mach-bcm/kona.h b/arch/arm/mach-bcm/kona.h
index 291eca3e06ff..3a7a017c29cd 100644
--- a/arch/arm/mach-bcm/kona.h
+++ b/arch/arm/mach-bcm/kona.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2013 Broadcom Corporation 2 * Copyright (C) 2012-2014 Broadcom Corporation
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 as 5 * modify it under the terms of the GNU General Public License as
@@ -11,7 +11,4 @@
11 * GNU General Public License for more details. 11 * GNU General Public License for more details.
12 */ 12 */
13 13
14#include <linux/reboot.h> 14void __init kona_l2_cache_init(void);
15
16void bcm_kona_setup_restart(void);
17void bcm_kona_restart(enum reboot_mode mode, const char *cmd);
diff --git a/arch/arm/mach-bcm2835/Kconfig b/arch/arm/mach-bcm2835/Kconfig
deleted file mode 100644
index d1f9612f8c15..000000000000
--- a/arch/arm/mach-bcm2835/Kconfig
+++ /dev/null
@@ -1,15 +0,0 @@
1config ARCH_BCM2835
2 bool "Broadcom BCM2835 family" if ARCH_MULTI_V6
3 select ARCH_REQUIRE_GPIOLIB
4 select ARM_AMBA
5 select ARM_ERRATA_411920
6 select ARM_TIMER_SP804
7 select CLKDEV_LOOKUP
8 select CLKSRC_OF
9 select CPU_V6
10 select GENERIC_CLOCKEVENTS
11 select PINCTRL
12 select PINCTRL_BCM2835
13 help
14 This enables support for the Broadcom BCM2835 SoC. This SoC is
15 used in the Raspberry Pi and Roku 2 devices.
diff --git a/arch/arm/mach-bcm2835/Makefile b/arch/arm/mach-bcm2835/Makefile
deleted file mode 100644
index 4c3892fe02c3..000000000000
--- a/arch/arm/mach-bcm2835/Makefile
+++ /dev/null
@@ -1 +0,0 @@
1obj-y += bcm2835.o
diff --git a/arch/arm/mach-berlin/Kconfig b/arch/arm/mach-berlin/Kconfig
index 7a02d222c378..b0cb0722acd2 100644
--- a/arch/arm/mach-berlin/Kconfig
+++ b/arch/arm/mach-berlin/Kconfig
@@ -1,9 +1,7 @@
1config ARCH_BERLIN 1config ARCH_BERLIN
2 bool "Marvell Berlin SoCs" if ARCH_MULTI_V7 2 bool "Marvell Berlin SoCs" if ARCH_MULTI_V7
3 select ARM_GIC 3 select ARM_GIC
4 select GENERIC_CLOCKEVENTS
5 select GENERIC_IRQ_CHIP 4 select GENERIC_IRQ_CHIP
6 select COMMON_CLK
7 select DW_APB_ICTL 5 select DW_APB_ICTL
8 select DW_APB_TIMER_OF 6 select DW_APB_TIMER_OF
9 7
@@ -16,12 +14,10 @@ config MACH_BERLIN_BG2
16 select CACHE_L2X0 14 select CACHE_L2X0
17 select CPU_PJ4B 15 select CPU_PJ4B
18 select HAVE_ARM_TWD if SMP 16 select HAVE_ARM_TWD if SMP
19 select HAVE_SMP
20 17
21config MACH_BERLIN_BG2CD 18config MACH_BERLIN_BG2CD
22 bool "Marvell Armada 1500-mini (BG2CD)" 19 bool "Marvell Armada 1500-mini (BG2CD)"
23 select CACHE_L2X0 20 select CACHE_L2X0
24 select CPU_V7
25 select HAVE_ARM_TWD if SMP 21 select HAVE_ARM_TWD if SMP
26 22
27endmenu 23endmenu
diff --git a/arch/arm/mach-clps711x/Kconfig b/arch/arm/mach-clps711x/Kconfig
index bea6295c8c59..f711498c180c 100644
--- a/arch/arm/mach-clps711x/Kconfig
+++ b/arch/arm/mach-clps711x/Kconfig
@@ -33,20 +33,6 @@ config ARCH_P720T
33 Say Y here if you intend to run this kernel on the ARM Prospector 33 Say Y here if you intend to run this kernel on the ARM Prospector
34 720T. 34 720T.
35 35
36config EP72XX_ROM_BOOT
37 bool "EP721x/EP731x ROM boot"
38 help
39 If you say Y here, your CLPS711x-based kernel will use the bootstrap
40 mode memory map instead of the normal memory map.
41
42 Processors derived from the Cirrus CLPS711X core support two boot
43 modes. Normal mode boots from the external memory device at CS0.
44 Bootstrap mode rearranges parts of the memory map, placing an
45 internal 128 byte bootstrap ROM at CS0. This option performs the
46 address map changes required to support booting in this mode.
47
48 You almost surely want to say N here.
49
50endmenu 36endmenu
51 37
52endif 38endif
diff --git a/arch/arm/mach-clps711x/board-autcpu12.c b/arch/arm/mach-clps711x/board-autcpu12.c
index f8d71a89644a..d62ca16d5394 100644
--- a/arch/arm/mach-clps711x/board-autcpu12.c
+++ b/arch/arm/mach-clps711x/board-autcpu12.c
@@ -73,7 +73,7 @@
73#define AUTCPU12_SMC_NCE (AUTCPU12_MMGPIO_BASE + 0) /* Bit 0 */ 73#define AUTCPU12_SMC_NCE (AUTCPU12_MMGPIO_BASE + 0) /* Bit 0 */
74#define AUTCPU12_SMC_RDY CLPS711X_GPIO(1, 2) 74#define AUTCPU12_SMC_RDY CLPS711X_GPIO(1, 2)
75#define AUTCPU12_SMC_ALE CLPS711X_GPIO(1, 3) 75#define AUTCPU12_SMC_ALE CLPS711X_GPIO(1, 3)
76#define AUTCPU12_SMC_CLE CLPS711X_GPIO(1, 3) 76#define AUTCPU12_SMC_CLE CLPS711X_GPIO(1, 4)
77 77
78/* LCD contrast digital potentiometer */ 78/* LCD contrast digital potentiometer */
79#define AUTCPU12_DPOT_CS CLPS711X_GPIO(4, 0) 79#define AUTCPU12_DPOT_CS CLPS711X_GPIO(4, 0)
@@ -265,14 +265,12 @@ static void __init autcpu12_init_late(void)
265MACHINE_START(AUTCPU12, "autronix autcpu12") 265MACHINE_START(AUTCPU12, "autronix autcpu12")
266 /* Maintainer: Thomas Gleixner */ 266 /* Maintainer: Thomas Gleixner */
267 .atag_offset = 0x20000, 267 .atag_offset = 0x20000,
268 .nr_irqs = CLPS711X_NR_IRQS,
269 .map_io = clps711x_map_io, 268 .map_io = clps711x_map_io,
270 .init_early = clps711x_init_early, 269 .init_early = clps711x_init_early,
271 .init_irq = clps711x_init_irq, 270 .init_irq = clps711x_init_irq,
272 .init_time = clps711x_timer_init, 271 .init_time = clps711x_timer_init,
273 .init_machine = autcpu12_init, 272 .init_machine = autcpu12_init,
274 .init_late = autcpu12_init_late, 273 .init_late = autcpu12_init_late,
275 .handle_irq = clps711x_handle_irq,
276 .restart = clps711x_restart, 274 .restart = clps711x_restart,
277MACHINE_END 275MACHINE_END
278 276
diff --git a/arch/arm/mach-clps711x/board-cdb89712.c b/arch/arm/mach-clps711x/board-cdb89712.c
index a9e38c6bcfb4..e261a47f2aff 100644
--- a/arch/arm/mach-clps711x/board-cdb89712.c
+++ b/arch/arm/mach-clps711x/board-cdb89712.c
@@ -139,12 +139,10 @@ static void __init cdb89712_init(void)
139MACHINE_START(CDB89712, "Cirrus-CDB89712") 139MACHINE_START(CDB89712, "Cirrus-CDB89712")
140 /* Maintainer: Ray Lehtiniemi */ 140 /* Maintainer: Ray Lehtiniemi */
141 .atag_offset = 0x100, 141 .atag_offset = 0x100,
142 .nr_irqs = CLPS711X_NR_IRQS,
143 .map_io = clps711x_map_io, 142 .map_io = clps711x_map_io,
144 .init_early = clps711x_init_early, 143 .init_early = clps711x_init_early,
145 .init_irq = clps711x_init_irq, 144 .init_irq = clps711x_init_irq,
146 .init_time = clps711x_timer_init, 145 .init_time = clps711x_timer_init,
147 .init_machine = cdb89712_init, 146 .init_machine = cdb89712_init,
148 .handle_irq = clps711x_handle_irq,
149 .restart = clps711x_restart, 147 .restart = clps711x_restart,
150MACHINE_END 148MACHINE_END
diff --git a/arch/arm/mach-clps711x/board-clep7312.c b/arch/arm/mach-clps711x/board-clep7312.c
index b4764246d0f8..221b9de32dd6 100644
--- a/arch/arm/mach-clps711x/board-clep7312.c
+++ b/arch/arm/mach-clps711x/board-clep7312.c
@@ -36,12 +36,10 @@ fixup_clep7312(struct tag *tags, char **cmdline, struct meminfo *mi)
36MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312") 36MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312")
37 /* Maintainer: Nobody */ 37 /* Maintainer: Nobody */
38 .atag_offset = 0x0100, 38 .atag_offset = 0x0100,
39 .nr_irqs = CLPS711X_NR_IRQS,
40 .fixup = fixup_clep7312, 39 .fixup = fixup_clep7312,
41 .map_io = clps711x_map_io, 40 .map_io = clps711x_map_io,
42 .init_early = clps711x_init_early, 41 .init_early = clps711x_init_early,
43 .init_irq = clps711x_init_irq, 42 .init_irq = clps711x_init_irq,
44 .init_time = clps711x_timer_init, 43 .init_time = clps711x_timer_init,
45 .handle_irq = clps711x_handle_irq,
46 .restart = clps711x_restart, 44 .restart = clps711x_restart,
47MACHINE_END 45MACHINE_END
diff --git a/arch/arm/mach-clps711x/board-edb7211.c b/arch/arm/mach-clps711x/board-edb7211.c
index fe6184ead896..077609841f14 100644
--- a/arch/arm/mach-clps711x/board-edb7211.c
+++ b/arch/arm/mach-clps711x/board-edb7211.c
@@ -177,7 +177,6 @@ static void __init edb7211_init_late(void)
177MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)") 177MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)")
178 /* Maintainer: Jon McClintock */ 178 /* Maintainer: Jon McClintock */
179 .atag_offset = VIDEORAM_SIZE + 0x100, 179 .atag_offset = VIDEORAM_SIZE + 0x100,
180 .nr_irqs = CLPS711X_NR_IRQS,
181 .fixup = fixup_edb7211, 180 .fixup = fixup_edb7211,
182 .reserve = edb7211_reserve, 181 .reserve = edb7211_reserve,
183 .map_io = clps711x_map_io, 182 .map_io = clps711x_map_io,
@@ -186,6 +185,5 @@ MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)")
186 .init_time = clps711x_timer_init, 185 .init_time = clps711x_timer_init,
187 .init_machine = edb7211_init, 186 .init_machine = edb7211_init,
188 .init_late = edb7211_init_late, 187 .init_late = edb7211_init_late,
189 .handle_irq = clps711x_handle_irq,
190 .restart = clps711x_restart, 188 .restart = clps711x_restart,
191MACHINE_END 189MACHINE_END
diff --git a/arch/arm/mach-clps711x/board-p720t.c b/arch/arm/mach-clps711x/board-p720t.c
index dd81b06f68fe..67b733744ed7 100644
--- a/arch/arm/mach-clps711x/board-p720t.c
+++ b/arch/arm/mach-clps711x/board-p720t.c
@@ -363,7 +363,6 @@ static void __init p720t_init_late(void)
363MACHINE_START(P720T, "ARM-Prospector720T") 363MACHINE_START(P720T, "ARM-Prospector720T")
364 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 364 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
365 .atag_offset = 0x100, 365 .atag_offset = 0x100,
366 .nr_irqs = CLPS711X_NR_IRQS,
367 .fixup = fixup_p720t, 366 .fixup = fixup_p720t,
368 .map_io = clps711x_map_io, 367 .map_io = clps711x_map_io,
369 .init_early = clps711x_init_early, 368 .init_early = clps711x_init_early,
@@ -371,6 +370,5 @@ MACHINE_START(P720T, "ARM-Prospector720T")
371 .init_time = clps711x_timer_init, 370 .init_time = clps711x_timer_init,
372 .init_machine = p720t_init, 371 .init_machine = p720t_init,
373 .init_late = p720t_init_late, 372 .init_late = p720t_init_late,
374 .handle_irq = clps711x_handle_irq,
375 .restart = clps711x_restart, 373 .restart = clps711x_restart,
376MACHINE_END 374MACHINE_END
diff --git a/arch/arm/mach-clps711x/common.c b/arch/arm/mach-clps711x/common.c
index a1935911e4f1..aee81fa46ccf 100644
--- a/arch/arm/mach-clps711x/common.c
+++ b/arch/arm/mach-clps711x/common.c
@@ -31,14 +31,14 @@
31#include <linux/clk-provider.h> 31#include <linux/clk-provider.h>
32#include <linux/sched_clock.h> 32#include <linux/sched_clock.h>
33 33
34#include <asm/exception.h>
35#include <asm/mach/irq.h>
36#include <asm/mach/map.h> 34#include <asm/mach/map.h>
37#include <asm/mach/time.h> 35#include <asm/mach/time.h>
38#include <asm/system_misc.h> 36#include <asm/system_misc.h>
39 37
40#include <mach/hardware.h> 38#include <mach/hardware.h>
41 39
40#include "common.h"
41
42static struct clk *clk_pll, *clk_bus, *clk_uart, *clk_timerl, *clk_timerh, 42static struct clk *clk_pll, *clk_bus, *clk_uart, *clk_timerl, *clk_timerh,
43 *clk_tint, *clk_spi; 43 *clk_tint, *clk_spi;
44 44
@@ -59,204 +59,9 @@ void __init clps711x_map_io(void)
59 iotable_init(clps711x_io_desc, ARRAY_SIZE(clps711x_io_desc)); 59 iotable_init(clps711x_io_desc, ARRAY_SIZE(clps711x_io_desc));
60} 60}
61 61
62static void int1_mask(struct irq_data *d)
63{
64 u32 intmr1;
65
66 intmr1 = clps_readl(INTMR1);
67 intmr1 &= ~(1 << d->irq);
68 clps_writel(intmr1, INTMR1);
69}
70
71static void int1_eoi(struct irq_data *d)
72{
73 switch (d->irq) {
74 case IRQ_CSINT: clps_writel(0, COEOI); break;
75 case IRQ_TC1OI: clps_writel(0, TC1EOI); break;
76 case IRQ_TC2OI: clps_writel(0, TC2EOI); break;
77 case IRQ_RTCMI: clps_writel(0, RTCEOI); break;
78 case IRQ_TINT: clps_writel(0, TEOI); break;
79 case IRQ_UMSINT: clps_writel(0, UMSEOI); break;
80 }
81}
82
83static void int1_unmask(struct irq_data *d)
84{
85 u32 intmr1;
86
87 intmr1 = clps_readl(INTMR1);
88 intmr1 |= 1 << d->irq;
89 clps_writel(intmr1, INTMR1);
90}
91
92static struct irq_chip int1_chip = {
93 .name = "Interrupt Vector 1",
94 .irq_eoi = int1_eoi,
95 .irq_mask = int1_mask,
96 .irq_unmask = int1_unmask,
97};
98
99static void int2_mask(struct irq_data *d)
100{
101 u32 intmr2;
102
103 intmr2 = clps_readl(INTMR2);
104 intmr2 &= ~(1 << (d->irq - 16));
105 clps_writel(intmr2, INTMR2);
106}
107
108static void int2_eoi(struct irq_data *d)
109{
110 switch (d->irq) {
111 case IRQ_KBDINT: clps_writel(0, KBDEOI); break;
112 }
113}
114
115static void int2_unmask(struct irq_data *d)
116{
117 u32 intmr2;
118
119 intmr2 = clps_readl(INTMR2);
120 intmr2 |= 1 << (d->irq - 16);
121 clps_writel(intmr2, INTMR2);
122}
123
124static struct irq_chip int2_chip = {
125 .name = "Interrupt Vector 2",
126 .irq_eoi = int2_eoi,
127 .irq_mask = int2_mask,
128 .irq_unmask = int2_unmask,
129};
130
131static void int3_mask(struct irq_data *d)
132{
133 u32 intmr3;
134
135 intmr3 = clps_readl(INTMR3);
136 intmr3 &= ~(1 << (d->irq - 32));
137 clps_writel(intmr3, INTMR3);
138}
139
140static void int3_unmask(struct irq_data *d)
141{
142 u32 intmr3;
143
144 intmr3 = clps_readl(INTMR3);
145 intmr3 |= 1 << (d->irq - 32);
146 clps_writel(intmr3, INTMR3);
147}
148
149static struct irq_chip int3_chip = {
150 .name = "Interrupt Vector 3",
151 .irq_mask = int3_mask,
152 .irq_unmask = int3_unmask,
153};
154
155static struct {
156 int nr;
157 struct irq_chip *chip;
158 irq_flow_handler_t handle;
159} clps711x_irqdescs[] __initdata = {
160 { IRQ_CSINT, &int1_chip, handle_fasteoi_irq, },
161 { IRQ_EINT1, &int1_chip, handle_level_irq, },
162 { IRQ_EINT2, &int1_chip, handle_level_irq, },
163 { IRQ_EINT3, &int1_chip, handle_level_irq, },
164 { IRQ_TC1OI, &int1_chip, handle_fasteoi_irq, },
165 { IRQ_TC2OI, &int1_chip, handle_fasteoi_irq, },
166 { IRQ_RTCMI, &int1_chip, handle_fasteoi_irq, },
167 { IRQ_TINT, &int1_chip, handle_fasteoi_irq, },
168 { IRQ_UTXINT1, &int1_chip, handle_level_irq, },
169 { IRQ_URXINT1, &int1_chip, handle_level_irq, },
170 { IRQ_UMSINT, &int1_chip, handle_fasteoi_irq, },
171 { IRQ_SSEOTI, &int1_chip, handle_level_irq, },
172 { IRQ_KBDINT, &int2_chip, handle_fasteoi_irq, },
173 { IRQ_SS2RX, &int2_chip, handle_level_irq, },
174 { IRQ_SS2TX, &int2_chip, handle_level_irq, },
175 { IRQ_UTXINT2, &int2_chip, handle_level_irq, },
176 { IRQ_URXINT2, &int2_chip, handle_level_irq, },
177};
178
179void __init clps711x_init_irq(void) 62void __init clps711x_init_irq(void)
180{ 63{
181 unsigned int i; 64 clps711x_intc_init(CLPS711X_PHYS_BASE, SZ_16K);
182
183 /* Disable interrupts */
184 clps_writel(0, INTMR1);
185 clps_writel(0, INTMR2);
186 clps_writel(0, INTMR3);
187
188 /* Clear down any pending interrupts */
189 clps_writel(0, BLEOI);
190 clps_writel(0, MCEOI);
191 clps_writel(0, COEOI);
192 clps_writel(0, TC1EOI);
193 clps_writel(0, TC2EOI);
194 clps_writel(0, RTCEOI);
195 clps_writel(0, TEOI);
196 clps_writel(0, UMSEOI);
197 clps_writel(0, KBDEOI);
198 clps_writel(0, SRXEOF);
199 clps_writel(0xffffffff, DAISR);
200
201 for (i = 0; i < ARRAY_SIZE(clps711x_irqdescs); i++) {
202 irq_set_chip_and_handler(clps711x_irqdescs[i].nr,
203 clps711x_irqdescs[i].chip,
204 clps711x_irqdescs[i].handle);
205 set_irq_flags(clps711x_irqdescs[i].nr,
206 IRQF_VALID | IRQF_PROBE);
207 }
208
209 if (IS_ENABLED(CONFIG_FIQ)) {
210 init_FIQ(0);
211 irq_set_chip_and_handler(IRQ_DAIINT, &int3_chip,
212 handle_bad_irq);
213 set_irq_flags(IRQ_DAIINT,
214 IRQF_VALID | IRQF_PROBE | IRQF_NOAUTOEN);
215 }
216}
217
218static inline u32 fls16(u32 x)
219{
220 u32 r = 15;
221
222 if (!(x & 0xff00)) {
223 x <<= 8;
224 r -= 8;
225 }
226 if (!(x & 0xf000)) {
227 x <<= 4;
228 r -= 4;
229 }
230 if (!(x & 0xc000)) {
231 x <<= 2;
232 r -= 2;
233 }
234 if (!(x & 0x8000))
235 r--;
236
237 return r;
238}
239
240asmlinkage void __exception_irq_entry clps711x_handle_irq(struct pt_regs *regs)
241{
242 do {
243 u32 irqstat;
244 void __iomem *base = CLPS711X_VIRT_BASE;
245
246 irqstat = readw_relaxed(base + INTSR1) &
247 readw_relaxed(base + INTMR1);
248 if (irqstat)
249 handle_IRQ(fls16(irqstat), regs);
250
251 irqstat = readw_relaxed(base + INTSR2) &
252 readw_relaxed(base + INTMR2);
253 if (irqstat) {
254 handle_IRQ(fls16(irqstat) + 16, regs);
255 continue;
256 }
257
258 break;
259 } while (1);
260} 65}
261 66
262static u64 notrace clps711x_sched_clock_read(void) 67static u64 notrace clps711x_sched_clock_read(void)
diff --git a/arch/arm/mach-clps711x/common.h b/arch/arm/mach-clps711x/common.h
index 9a6767bfdc47..7489139d5d63 100644
--- a/arch/arm/mach-clps711x/common.h
+++ b/arch/arm/mach-clps711x/common.h
@@ -6,13 +6,14 @@
6 6
7#include <linux/reboot.h> 7#include <linux/reboot.h>
8 8
9#define CLPS711X_NR_IRQS (33)
10#define CLPS711X_NR_GPIO (4 * 8 + 3) 9#define CLPS711X_NR_GPIO (4 * 8 + 3)
11#define CLPS711X_GPIO(prt, bit) ((prt) * 8 + (bit)) 10#define CLPS711X_GPIO(prt, bit) ((prt) * 8 + (bit))
12 11
13extern void clps711x_map_io(void); 12extern void clps711x_map_io(void);
14extern void clps711x_init_irq(void); 13extern void clps711x_init_irq(void);
15extern void clps711x_timer_init(void); 14extern void clps711x_timer_init(void);
16extern void clps711x_handle_irq(struct pt_regs *regs);
17extern void clps711x_restart(enum reboot_mode mode, const char *cmd); 15extern void clps711x_restart(enum reboot_mode mode, const char *cmd);
18extern void clps711x_init_early(void); 16extern void clps711x_init_early(void);
17
18/* drivers/irqchip/irq-clps711x.c */
19void clps711x_intc_init(phys_addr_t, resource_size_t);
diff --git a/arch/arm/mach-clps711x/include/mach/clps711x.h b/arch/arm/mach-clps711x/include/mach/clps711x.h
index 0286f4bf9945..eb052a11aa9d 100644
--- a/arch/arm/mach-clps711x/include/mach/clps711x.h
+++ b/arch/arm/mach-clps711x/include/mach/clps711x.h
@@ -40,8 +40,6 @@
40#define MEMCFG1 (0x0180) 40#define MEMCFG1 (0x0180)
41#define MEMCFG2 (0x01c0) 41#define MEMCFG2 (0x01c0)
42#define DRFPR (0x0200) 42#define DRFPR (0x0200)
43#define INTSR1 (0x0240)
44#define INTMR1 (0x0280)
45#define LCDCON (0x02c0) 43#define LCDCON (0x02c0)
46#define TC1D (0x0300) 44#define TC1D (0x0300)
47#define TC2D (0x0340) 45#define TC2D (0x0340)
@@ -55,28 +53,16 @@
55#define PALLSW (0x0540) 53#define PALLSW (0x0540)
56#define PALMSW (0x0580) 54#define PALMSW (0x0580)
57#define STFCLR (0x05c0) 55#define STFCLR (0x05c0)
58#define BLEOI (0x0600)
59#define MCEOI (0x0640)
60#define TEOI (0x0680)
61#define TC1EOI (0x06c0)
62#define TC2EOI (0x0700)
63#define RTCEOI (0x0740)
64#define UMSEOI (0x0780)
65#define COEOI (0x07c0)
66#define HALT (0x0800) 56#define HALT (0x0800)
67#define STDBY (0x0840) 57#define STDBY (0x0840)
68 58
69#define FBADDR (0x1000) 59#define FBADDR (0x1000)
70#define SYSCON2 (0x1100) 60#define SYSCON2 (0x1100)
71#define SYSFLG2 (0x1140) 61#define SYSFLG2 (0x1140)
72#define INTSR2 (0x1240)
73#define INTMR2 (0x1280)
74#define UARTDR2 (0x1480) 62#define UARTDR2 (0x1480)
75#define UBRLCR2 (0x14c0) 63#define UBRLCR2 (0x14c0)
76#define SS2DR (0x1500) 64#define SS2DR (0x1500)
77#define SRXEOF (0x1600)
78#define SS2POP (0x16c0) 65#define SS2POP (0x16c0)
79#define KBDEOI (0x1700)
80 66
81#define DAIR (0x2000) 67#define DAIR (0x2000)
82#define DAIDR0 (0x2040) 68#define DAIDR0 (0x2040)
@@ -84,8 +70,6 @@
84#define DAIDR2 (0x20c0) 70#define DAIDR2 (0x20c0)
85#define DAISR (0x2100) 71#define DAISR (0x2100)
86#define SYSCON3 (0x2200) 72#define SYSCON3 (0x2200)
87#define INTSR3 (0x2240)
88#define INTMR3 (0x2280)
89#define LEDFLSH (0x22c0) 73#define LEDFLSH (0x22c0)
90#define SDCONF (0x2300) 74#define SDCONF (0x2300)
91#define SDRFPR (0x2340) 75#define SDRFPR (0x2340)
diff --git a/arch/arm/mach-clps711x/include/mach/hardware.h b/arch/arm/mach-clps711x/include/mach/hardware.h
index c5a8ea6839ef..5d6afda1c0e8 100644
--- a/arch/arm/mach-clps711x/include/mach/hardware.h
+++ b/arch/arm/mach-clps711x/include/mach/hardware.h
@@ -38,13 +38,6 @@
38#define clps_writel(val,off) writel(val, CLPS711X_VIRT_BASE + (off)) 38#define clps_writel(val,off) writel(val, CLPS711X_VIRT_BASE + (off))
39#endif 39#endif
40 40
41/*
42 * The physical addresses that the external chip select signals map to is
43 * dependent on the setting of the nMEDCHG signal on EP7211 and EP7212
44 * processors. CONFIG_EP72XX_BOOT_ROM is only available if these
45 * processors are in use.
46 */
47#ifndef CONFIG_EP72XX_ROM_BOOT
48#define CS0_PHYS_BASE (0x00000000) 41#define CS0_PHYS_BASE (0x00000000)
49#define CS1_PHYS_BASE (0x10000000) 42#define CS1_PHYS_BASE (0x10000000)
50#define CS2_PHYS_BASE (0x20000000) 43#define CS2_PHYS_BASE (0x20000000)
@@ -53,16 +46,6 @@
53#define CS5_PHYS_BASE (0x50000000) 46#define CS5_PHYS_BASE (0x50000000)
54#define CS6_PHYS_BASE (0x60000000) 47#define CS6_PHYS_BASE (0x60000000)
55#define CS7_PHYS_BASE (0x70000000) 48#define CS7_PHYS_BASE (0x70000000)
56#else
57#define CS0_PHYS_BASE (0x70000000)
58#define CS1_PHYS_BASE (0x60000000)
59#define CS2_PHYS_BASE (0x50000000)
60#define CS3_PHYS_BASE (0x40000000)
61#define CS4_PHYS_BASE (0x30000000)
62#define CS5_PHYS_BASE (0x20000000)
63#define CS6_PHYS_BASE (0x10000000)
64#define CS7_PHYS_BASE (0x00000000)
65#endif
66 49
67#define CLPS711X_SRAM_BASE CS6_PHYS_BASE 50#define CLPS711X_SRAM_BASE CS6_PHYS_BASE
68#define CLPS711X_SRAM_SIZE (48 * 1024) 51#define CLPS711X_SRAM_SIZE (48 * 1024)
diff --git a/arch/arm/mach-clps711x/include/mach/timex.h b/arch/arm/mach-clps711x/include/mach/timex.h
deleted file mode 100644
index de6fd192d1c3..000000000000
--- a/arch/arm/mach-clps711x/include/mach/timex.h
+++ /dev/null
@@ -1,2 +0,0 @@
1/* Bogus value */
2#define CLOCK_TICK_RATE 512000
diff --git a/arch/arm/mach-cns3xxx/Kconfig b/arch/arm/mach-cns3xxx/Kconfig
index dbf0df8bb0ac..dce8decd5d46 100644
--- a/arch/arm/mach-cns3xxx/Kconfig
+++ b/arch/arm/mach-cns3xxx/Kconfig
@@ -1,9 +1,6 @@
1config ARCH_CNS3XXX 1config ARCH_CNS3XXX
2 bool "Cavium Networks CNS3XXX family" if ARCH_MULTI_V6 2 bool "Cavium Networks CNS3XXX family" if ARCH_MULTI_V6
3 select ARM_GIC 3 select ARM_GIC
4 select CPU_V6K
5 select GENERIC_CLOCKEVENTS
6 select MIGHT_HAVE_CACHE_L2X0
7 select MIGHT_HAVE_PCI 4 select MIGHT_HAVE_PCI
8 select PCI_DOMAINS if PCI 5 select PCI_DOMAINS if PCI
9 help 6 help
diff --git a/arch/arm/mach-cns3xxx/cns3420vb.c b/arch/arm/mach-cns3xxx/cns3420vb.c
index ce096d678aa4..d863d8729edc 100644
--- a/arch/arm/mach-cns3xxx/cns3420vb.c
+++ b/arch/arm/mach-cns3xxx/cns3420vb.c
@@ -246,7 +246,6 @@ static void __init cns3420_map_io(void)
246 246
247MACHINE_START(CNS3420VB, "Cavium Networks CNS3420 Validation Board") 247MACHINE_START(CNS3420VB, "Cavium Networks CNS3420 Validation Board")
248 .atag_offset = 0x100, 248 .atag_offset = 0x100,
249 .nr_irqs = NR_IRQS_CNS3XXX,
250 .map_io = cns3420_map_io, 249 .map_io = cns3420_map_io,
251 .init_irq = cns3xxx_init_irq, 250 .init_irq = cns3xxx_init_irq,
252 .init_time = cns3xxx_timer_init, 251 .init_time = cns3xxx_timer_init,
diff --git a/arch/arm/mach-cns3xxx/core.c b/arch/arm/mach-cns3xxx/core.c
index e38b279f402c..2ae28a69e3e5 100644
--- a/arch/arm/mach-cns3xxx/core.c
+++ b/arch/arm/mach-cns3xxx/core.c
@@ -47,6 +47,38 @@ static struct map_desc cns3xxx_io_desc[] __initdata = {
47 .pfn = __phys_to_pfn(CNS3XXX_PM_BASE), 47 .pfn = __phys_to_pfn(CNS3XXX_PM_BASE),
48 .length = SZ_4K, 48 .length = SZ_4K,
49 .type = MT_DEVICE, 49 .type = MT_DEVICE,
50#ifdef CONFIG_PCI
51 }, {
52 .virtual = CNS3XXX_PCIE0_HOST_BASE_VIRT,
53 .pfn = __phys_to_pfn(CNS3XXX_PCIE0_HOST_BASE),
54 .length = SZ_4K,
55 .type = MT_DEVICE,
56 }, {
57 .virtual = CNS3XXX_PCIE0_CFG0_BASE_VIRT,
58 .pfn = __phys_to_pfn(CNS3XXX_PCIE0_CFG0_BASE),
59 .length = SZ_64K, /* really 4 KiB at offset 32 KiB */
60 .type = MT_DEVICE,
61 }, {
62 .virtual = CNS3XXX_PCIE0_CFG1_BASE_VIRT,
63 .pfn = __phys_to_pfn(CNS3XXX_PCIE0_CFG1_BASE),
64 .length = SZ_16M,
65 .type = MT_DEVICE,
66 }, {
67 .virtual = CNS3XXX_PCIE1_HOST_BASE_VIRT,
68 .pfn = __phys_to_pfn(CNS3XXX_PCIE1_HOST_BASE),
69 .length = SZ_4K,
70 .type = MT_DEVICE,
71 }, {
72 .virtual = CNS3XXX_PCIE1_CFG0_BASE_VIRT,
73 .pfn = __phys_to_pfn(CNS3XXX_PCIE1_CFG0_BASE),
74 .length = SZ_64K, /* really 4 KiB at offset 32 KiB */
75 .type = MT_DEVICE,
76 }, {
77 .virtual = CNS3XXX_PCIE1_CFG1_BASE_VIRT,
78 .pfn = __phys_to_pfn(CNS3XXX_PCIE1_CFG1_BASE),
79 .length = SZ_16M,
80 .type = MT_DEVICE,
81#endif
50 }, 82 },
51}; 83};
52 84
@@ -155,7 +187,7 @@ static irqreturn_t cns3xxx_timer_interrupt(int irq, void *dev_id)
155 187
156static struct irqaction cns3xxx_timer_irq = { 188static struct irqaction cns3xxx_timer_irq = {
157 .name = "timer", 189 .name = "timer",
158 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 190 .flags = IRQF_TIMER | IRQF_IRQPOLL,
159 .handler = cns3xxx_timer_interrupt, 191 .handler = cns3xxx_timer_interrupt,
160}; 192};
161 193
@@ -368,7 +400,6 @@ static const char *cns3xxx_dt_compat[] __initdata = {
368 400
369DT_MACHINE_START(CNS3XXX_DT, "Cavium Networks CNS3xxx") 401DT_MACHINE_START(CNS3XXX_DT, "Cavium Networks CNS3xxx")
370 .dt_compat = cns3xxx_dt_compat, 402 .dt_compat = cns3xxx_dt_compat,
371 .nr_irqs = NR_IRQS_CNS3XXX,
372 .map_io = cns3xxx_map_io, 403 .map_io = cns3xxx_map_io,
373 .init_irq = cns3xxx_init_irq, 404 .init_irq = cns3xxx_init_irq,
374 .init_time = cns3xxx_timer_init, 405 .init_time = cns3xxx_timer_init,
diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c
index c7b204bff386..413134c54452 100644
--- a/arch/arm/mach-cns3xxx/pcie.c
+++ b/arch/arm/mach-cns3xxx/pcie.c
@@ -23,15 +23,10 @@
23#include "cns3xxx.h" 23#include "cns3xxx.h"
24#include "core.h" 24#include "core.h"
25 25
26enum cns3xxx_access_type {
27 CNS3XXX_HOST_TYPE = 0,
28 CNS3XXX_CFG0_TYPE,
29 CNS3XXX_CFG1_TYPE,
30 CNS3XXX_NUM_ACCESS_TYPES,
31};
32
33struct cns3xxx_pcie { 26struct cns3xxx_pcie {
34 struct map_desc cfg_bases[CNS3XXX_NUM_ACCESS_TYPES]; 27 void __iomem *host_regs; /* PCI config registers for host bridge */
28 void __iomem *cfg0_regs; /* PCI Type 0 config registers */
29 void __iomem *cfg1_regs; /* PCI Type 1 config registers */
35 unsigned int irqs[2]; 30 unsigned int irqs[2];
36 struct resource res_io; 31 struct resource res_io;
37 struct resource res_mem; 32 struct resource res_mem;
@@ -66,7 +61,6 @@ static void __iomem *cns3xxx_pci_cfg_base(struct pci_bus *bus,
66 int busno = bus->number; 61 int busno = bus->number;
67 int slot = PCI_SLOT(devfn); 62 int slot = PCI_SLOT(devfn);
68 int offset; 63 int offset;
69 enum cns3xxx_access_type type;
70 void __iomem *base; 64 void __iomem *base;
71 65
72 /* If there is no link, just show the CNS PCI bridge. */ 66 /* If there is no link, just show the CNS PCI bridge. */
@@ -78,17 +72,21 @@ static void __iomem *cns3xxx_pci_cfg_base(struct pci_bus *bus,
78 * we still want to access it. For this to work, we must place 72 * we still want to access it. For this to work, we must place
79 * the first device on the same bus as the CNS PCI bridge. 73 * the first device on the same bus as the CNS PCI bridge.
80 */ 74 */
81 if (busno == 0) { 75 if (busno == 0) { /* directly connected PCIe bus */
82 if (slot > 1) 76 switch (slot) {
83 return NULL; 77 case 0: /* host bridge device, function 0 only */
84 type = slot; 78 base = cnspci->host_regs;
85 } else { 79 break;
86 type = CNS3XXX_CFG1_TYPE; 80 case 1: /* directly connected device */
87 } 81 base = cnspci->cfg0_regs;
82 break;
83 default:
84 return NULL; /* no such device */
85 }
86 } else /* remote PCI bus */
87 base = cnspci->cfg1_regs;
88 88
89 base = (void __iomem *)cnspci->cfg_bases[type].virtual;
90 offset = ((busno & 0xf) << 20) | (devfn << 12) | (where & 0xffc); 89 offset = ((busno & 0xf) << 20) | (devfn << 12) | (where & 0xffc);
91
92 return base + offset; 90 return base + offset;
93} 91}
94 92
@@ -180,36 +178,19 @@ static int cns3xxx_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
180 178
181static struct cns3xxx_pcie cns3xxx_pcie[] = { 179static struct cns3xxx_pcie cns3xxx_pcie[] = {
182 [0] = { 180 [0] = {
183 .cfg_bases = { 181 .host_regs = (void __iomem *)CNS3XXX_PCIE0_HOST_BASE_VIRT,
184 [CNS3XXX_HOST_TYPE] = { 182 .cfg0_regs = (void __iomem *)CNS3XXX_PCIE0_CFG0_BASE_VIRT,
185 .virtual = CNS3XXX_PCIE0_HOST_BASE_VIRT, 183 .cfg1_regs = (void __iomem *)CNS3XXX_PCIE0_CFG1_BASE_VIRT,
186 .pfn = __phys_to_pfn(CNS3XXX_PCIE0_HOST_BASE),
187 .length = SZ_16M,
188 .type = MT_DEVICE,
189 },
190 [CNS3XXX_CFG0_TYPE] = {
191 .virtual = CNS3XXX_PCIE0_CFG0_BASE_VIRT,
192 .pfn = __phys_to_pfn(CNS3XXX_PCIE0_CFG0_BASE),
193 .length = SZ_16M,
194 .type = MT_DEVICE,
195 },
196 [CNS3XXX_CFG1_TYPE] = {
197 .virtual = CNS3XXX_PCIE0_CFG1_BASE_VIRT,
198 .pfn = __phys_to_pfn(CNS3XXX_PCIE0_CFG1_BASE),
199 .length = SZ_16M,
200 .type = MT_DEVICE,
201 },
202 },
203 .res_io = { 184 .res_io = {
204 .name = "PCIe0 I/O space", 185 .name = "PCIe0 I/O space",
205 .start = CNS3XXX_PCIE0_IO_BASE, 186 .start = CNS3XXX_PCIE0_IO_BASE,
206 .end = CNS3XXX_PCIE0_IO_BASE + SZ_16M - 1, 187 .end = CNS3XXX_PCIE0_CFG0_BASE - 1, /* 16 MiB */
207 .flags = IORESOURCE_IO, 188 .flags = IORESOURCE_IO,
208 }, 189 },
209 .res_mem = { 190 .res_mem = {
210 .name = "PCIe0 non-prefetchable", 191 .name = "PCIe0 non-prefetchable",
211 .start = CNS3XXX_PCIE0_MEM_BASE, 192 .start = CNS3XXX_PCIE0_MEM_BASE,
212 .end = CNS3XXX_PCIE0_MEM_BASE + SZ_16M - 1, 193 .end = CNS3XXX_PCIE0_HOST_BASE - 1, /* 176 MiB */
213 .flags = IORESOURCE_MEM, 194 .flags = IORESOURCE_MEM,
214 }, 195 },
215 .irqs = { IRQ_CNS3XXX_PCIE0_RC, IRQ_CNS3XXX_PCIE0_DEVICE, }, 196 .irqs = { IRQ_CNS3XXX_PCIE0_RC, IRQ_CNS3XXX_PCIE0_DEVICE, },
@@ -222,36 +203,19 @@ static struct cns3xxx_pcie cns3xxx_pcie[] = {
222 }, 203 },
223 }, 204 },
224 [1] = { 205 [1] = {
225 .cfg_bases = { 206 .host_regs = (void __iomem *)CNS3XXX_PCIE1_HOST_BASE_VIRT,
226 [CNS3XXX_HOST_TYPE] = { 207 .cfg0_regs = (void __iomem *)CNS3XXX_PCIE1_CFG0_BASE_VIRT,
227 .virtual = CNS3XXX_PCIE1_HOST_BASE_VIRT, 208 .cfg1_regs = (void __iomem *)CNS3XXX_PCIE1_CFG1_BASE_VIRT,
228 .pfn = __phys_to_pfn(CNS3XXX_PCIE1_HOST_BASE),
229 .length = SZ_16M,
230 .type = MT_DEVICE,
231 },
232 [CNS3XXX_CFG0_TYPE] = {
233 .virtual = CNS3XXX_PCIE1_CFG0_BASE_VIRT,
234 .pfn = __phys_to_pfn(CNS3XXX_PCIE1_CFG0_BASE),
235 .length = SZ_16M,
236 .type = MT_DEVICE,
237 },
238 [CNS3XXX_CFG1_TYPE] = {
239 .virtual = CNS3XXX_PCIE1_CFG1_BASE_VIRT,
240 .pfn = __phys_to_pfn(CNS3XXX_PCIE1_CFG1_BASE),
241 .length = SZ_16M,
242 .type = MT_DEVICE,
243 },
244 },
245 .res_io = { 209 .res_io = {
246 .name = "PCIe1 I/O space", 210 .name = "PCIe1 I/O space",
247 .start = CNS3XXX_PCIE1_IO_BASE, 211 .start = CNS3XXX_PCIE1_IO_BASE,
248 .end = CNS3XXX_PCIE1_IO_BASE + SZ_16M - 1, 212 .end = CNS3XXX_PCIE1_CFG0_BASE - 1, /* 16 MiB */
249 .flags = IORESOURCE_IO, 213 .flags = IORESOURCE_IO,
250 }, 214 },
251 .res_mem = { 215 .res_mem = {
252 .name = "PCIe1 non-prefetchable", 216 .name = "PCIe1 non-prefetchable",
253 .start = CNS3XXX_PCIE1_MEM_BASE, 217 .start = CNS3XXX_PCIE1_MEM_BASE,
254 .end = CNS3XXX_PCIE1_MEM_BASE + SZ_16M - 1, 218 .end = CNS3XXX_PCIE1_HOST_BASE - 1, /* 176 MiB */
255 .flags = IORESOURCE_MEM, 219 .flags = IORESOURCE_MEM,
256 }, 220 },
257 .irqs = { IRQ_CNS3XXX_PCIE1_RC, IRQ_CNS3XXX_PCIE1_DEVICE, }, 221 .irqs = { IRQ_CNS3XXX_PCIE1_RC, IRQ_CNS3XXX_PCIE1_DEVICE, },
@@ -307,18 +271,15 @@ static void __init cns3xxx_pcie_hw_init(struct cns3xxx_pcie *cnspci)
307 .ops = &cns3xxx_pcie_ops, 271 .ops = &cns3xxx_pcie_ops,
308 .sysdata = &sd, 272 .sysdata = &sd,
309 }; 273 };
310 u32 io_base = cnspci->res_io.start >> 16; 274 u16 mem_base = cnspci->res_mem.start >> 16;
311 u32 mem_base = cnspci->res_mem.start >> 16; 275 u16 mem_limit = cnspci->res_mem.end >> 16;
312 u32 host_base = cnspci->cfg_bases[CNS3XXX_HOST_TYPE].pfn; 276 u16 io_base = cnspci->res_io.start >> 16;
313 u32 cfg0_base = cnspci->cfg_bases[CNS3XXX_CFG0_TYPE].pfn; 277 u16 io_limit = cnspci->res_io.end >> 16;
314 u32 devfn = 0; 278 u32 devfn = 0;
315 u8 tmp8; 279 u8 tmp8;
316 u16 pos; 280 u16 pos;
317 u16 dc; 281 u16 dc;
318 282
319 host_base = (__pfn_to_phys(host_base) - 1) >> 16;
320 cfg0_base = (__pfn_to_phys(cfg0_base) - 1) >> 16;
321
322 pci_bus_write_config_byte(&bus, devfn, PCI_PRIMARY_BUS, 0); 283 pci_bus_write_config_byte(&bus, devfn, PCI_PRIMARY_BUS, 0);
323 pci_bus_write_config_byte(&bus, devfn, PCI_SECONDARY_BUS, 1); 284 pci_bus_write_config_byte(&bus, devfn, PCI_SECONDARY_BUS, 1);
324 pci_bus_write_config_byte(&bus, devfn, PCI_SUBORDINATE_BUS, 1); 285 pci_bus_write_config_byte(&bus, devfn, PCI_SUBORDINATE_BUS, 1);
@@ -328,9 +289,9 @@ static void __init cns3xxx_pcie_hw_init(struct cns3xxx_pcie *cnspci)
328 pci_bus_read_config_byte(&bus, devfn, PCI_SUBORDINATE_BUS, &tmp8); 289 pci_bus_read_config_byte(&bus, devfn, PCI_SUBORDINATE_BUS, &tmp8);
329 290
330 pci_bus_write_config_word(&bus, devfn, PCI_MEMORY_BASE, mem_base); 291 pci_bus_write_config_word(&bus, devfn, PCI_MEMORY_BASE, mem_base);
331 pci_bus_write_config_word(&bus, devfn, PCI_MEMORY_LIMIT, host_base); 292 pci_bus_write_config_word(&bus, devfn, PCI_MEMORY_LIMIT, mem_limit);
332 pci_bus_write_config_word(&bus, devfn, PCI_IO_BASE_UPPER16, io_base); 293 pci_bus_write_config_word(&bus, devfn, PCI_IO_BASE_UPPER16, io_base);
333 pci_bus_write_config_word(&bus, devfn, PCI_IO_LIMIT_UPPER16, cfg0_base); 294 pci_bus_write_config_word(&bus, devfn, PCI_IO_LIMIT_UPPER16, io_limit);
334 295
335 if (!cnspci->linked) 296 if (!cnspci->linked)
336 return; 297 return;
@@ -368,8 +329,6 @@ static int __init cns3xxx_pcie_init(void)
368 "imprecise external abort"); 329 "imprecise external abort");
369 330
370 for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) { 331 for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) {
371 iotable_init(cns3xxx_pcie[i].cfg_bases,
372 ARRAY_SIZE(cns3xxx_pcie[i].cfg_bases));
373 cns3xxx_pwr_clk_en(0x1 << PM_CLK_GATE_REG_OFFSET_PCIE(i)); 332 cns3xxx_pwr_clk_en(0x1 << PM_CLK_GATE_REG_OFFSET_PCIE(i));
374 cns3xxx_pwr_soft_rst(0x1 << PM_SOFT_RST_REG_OFFST_PCIE(i)); 333 cns3xxx_pwr_soft_rst(0x1 << PM_SOFT_RST_REG_OFFST_PCIE(i));
375 cns3xxx_pcie_check_link(&cns3xxx_pcie[i]); 334 cns3xxx_pcie_check_link(&cns3xxx_pcie[i]);
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index a075b3e0c5c7..db18ef866593 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -51,11 +51,6 @@ config ARCH_DAVINCI_DM365
51 select AINTC 51 select AINTC
52 select ARCH_DAVINCI_DMx 52 select ARCH_DAVINCI_DMx
53 53
54config ARCH_DAVINCI_TNETV107X
55 bool "TNETV107X based system"
56 select CPU_V6
57 select CP_INTC
58
59comment "DaVinci Board Type" 54comment "DaVinci Board Type"
60 55
61config MACH_DA8XX_DT 56config MACH_DA8XX_DT
@@ -214,18 +209,6 @@ config DA850_WL12XX
214 Say Y if you want to use a wl1271 expansion card connected to the 209 Say Y if you want to use a wl1271 expansion card connected to the
215 AM18x EVM. 210 AM18x EVM.
216 211
217config GPIO_PCA953X
218 default MACH_DAVINCI_DA850_EVM
219
220config KEYBOARD_GPIO_POLLED
221 default MACH_DAVINCI_DA850_EVM
222
223config MACH_TNETV107X
224 bool "TI TNETV107X Reference Platform"
225 default ARCH_DAVINCI_TNETV107X
226 depends on ARCH_DAVINCI_TNETV107X
227 help
228 Say Y here to select the TI TNETV107X Evaluation Module.
229 212
230config MACH_MITYOMAPL138 213config MACH_MITYOMAPL138
231 bool "Critical Link MityDSP-L138/MityARM-1808 SoM" 214 bool "Critical Link MityDSP-L138/MityARM-1808 SoM"
diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile
index 63997a1128e6..2204239ed243 100644
--- a/arch/arm/mach-davinci/Makefile
+++ b/arch/arm/mach-davinci/Makefile
@@ -16,7 +16,6 @@ obj-$(CONFIG_ARCH_DAVINCI_DM646x) += dm646x.o devices.o
16obj-$(CONFIG_ARCH_DAVINCI_DM365) += dm365.o devices.o 16obj-$(CONFIG_ARCH_DAVINCI_DM365) += dm365.o devices.o
17obj-$(CONFIG_ARCH_DAVINCI_DA830) += da830.o devices-da8xx.o 17obj-$(CONFIG_ARCH_DAVINCI_DA830) += da830.o devices-da8xx.o
18obj-$(CONFIG_ARCH_DAVINCI_DA850) += da850.o devices-da8xx.o 18obj-$(CONFIG_ARCH_DAVINCI_DA850) += da850.o devices-da8xx.o
19obj-$(CONFIG_ARCH_DAVINCI_TNETV107X) += tnetv107x.o devices-tnetv107x.o
20 19
21obj-$(CONFIG_AINTC) += irq.o 20obj-$(CONFIG_AINTC) += irq.o
22obj-$(CONFIG_CP_INTC) += cp_intc.o 21obj-$(CONFIG_CP_INTC) += cp_intc.o
@@ -32,7 +31,6 @@ obj-$(CONFIG_MACH_DAVINCI_DM6467_EVM) += board-dm646x-evm.o cdce949.o
32obj-$(CONFIG_MACH_DAVINCI_DM365_EVM) += board-dm365-evm.o 31obj-$(CONFIG_MACH_DAVINCI_DM365_EVM) += board-dm365-evm.o
33obj-$(CONFIG_MACH_DAVINCI_DA830_EVM) += board-da830-evm.o 32obj-$(CONFIG_MACH_DAVINCI_DA830_EVM) += board-da830-evm.o
34obj-$(CONFIG_MACH_DAVINCI_DA850_EVM) += board-da850-evm.o 33obj-$(CONFIG_MACH_DAVINCI_DA850_EVM) += board-da850-evm.o
35obj-$(CONFIG_MACH_TNETV107X) += board-tnetv107x-evm.o
36obj-$(CONFIG_MACH_MITYOMAPL138) += board-mityomapl138.o 34obj-$(CONFIG_MACH_MITYOMAPL138) += board-mityomapl138.o
37obj-$(CONFIG_MACH_OMAPL138_HAWKBOARD) += board-omapl138-hawk.o 35obj-$(CONFIG_MACH_OMAPL138_HAWKBOARD) += board-omapl138-hawk.o
38 36
diff --git a/arch/arm/mach-davinci/Makefile.boot b/arch/arm/mach-davinci/Makefile.boot
index 04a6c4e67b14..4b81601754a2 100644
--- a/arch/arm/mach-davinci/Makefile.boot
+++ b/arch/arm/mach-davinci/Makefile.boot
@@ -1,13 +1,7 @@
1ifeq ($(CONFIG_ARCH_DAVINCI_DA8XX),y) 1zreladdr-$(CONFIG_ARCH_DAVINCI_DA8XX) += 0xc0008000
2ifeq ($(CONFIG_ARCH_DAVINCI_DMx),y) 2params_phys-$(CONFIG_ARCH_DAVINCI_DA8XX) := 0xc0000100
3$(error Cannot enable DaVinci and DA8XX platforms concurrently) 3initrd_phys-$(CONFIG_ARCH_DAVINCI_DA8XX) := 0xc0800000
4else 4
5 zreladdr-y += 0xc0008000 5zreladdr-$(CONFIG_ARCH_DAVINCI_DMx) += 0x80008000
6params_phys-y := 0xc0000100 6params_phys-$(CONFIG_ARCH_DAVINCI_DMx) := 0x80000100
7initrd_phys-y := 0xc0800000 7initrd_phys-$(CONFIG_ARCH_DAVINCI_DMx) := 0x80800000
8endif
9else
10 zreladdr-y += 0x80008000
11params_phys-y := 0x80000100
12initrd_phys-y := 0x80800000
13endif
diff --git a/arch/arm/mach-davinci/aemif.c b/arch/arm/mach-davinci/aemif.c
index f091a9010c2f..ff8b7e76b6e9 100644
--- a/arch/arm/mach-davinci/aemif.c
+++ b/arch/arm/mach-davinci/aemif.c
@@ -16,6 +16,7 @@
16#include <linux/time.h> 16#include <linux/time.h>
17 17
18#include <linux/platform_data/mtd-davinci-aemif.h> 18#include <linux/platform_data/mtd-davinci-aemif.h>
19#include <linux/platform_data/mtd-davinci.h>
19 20
20/* Timing value configuration */ 21/* Timing value configuration */
21 22
@@ -43,6 +44,17 @@
43 WSTROBE(WSTROBE_MAX) | \ 44 WSTROBE(WSTROBE_MAX) | \
44 WSETUP(WSETUP_MAX)) 45 WSETUP(WSETUP_MAX))
45 46
47static inline unsigned int davinci_aemif_readl(void __iomem *base, int offset)
48{
49 return readl_relaxed(base + offset);
50}
51
52static inline void davinci_aemif_writel(void __iomem *base,
53 int offset, unsigned long value)
54{
55 writel_relaxed(value, base + offset);
56}
57
46/* 58/*
47 * aemif_calc_rate - calculate timing data. 59 * aemif_calc_rate - calculate timing data.
48 * @wanted: The cycle time needed in nanoseconds. 60 * @wanted: The cycle time needed in nanoseconds.
@@ -76,6 +88,7 @@ static int aemif_calc_rate(int wanted, unsigned long clk, int max)
76 * @t: timing values to be progammed 88 * @t: timing values to be progammed
77 * @base: The virtual base address of the AEMIF interface 89 * @base: The virtual base address of the AEMIF interface
78 * @cs: chip-select to program the timing values for 90 * @cs: chip-select to program the timing values for
91 * @clkrate: the AEMIF clkrate
79 * 92 *
80 * This function programs the given timing values (in real clock) into the 93 * This function programs the given timing values (in real clock) into the
81 * AEMIF registers taking the AEMIF clock into account. 94 * AEMIF registers taking the AEMIF clock into account.
@@ -86,24 +99,17 @@ static int aemif_calc_rate(int wanted, unsigned long clk, int max)
86 * 99 *
87 * Returns 0 on success, else negative errno. 100 * Returns 0 on success, else negative errno.
88 */ 101 */
89int davinci_aemif_setup_timing(struct davinci_aemif_timing *t, 102static int davinci_aemif_setup_timing(struct davinci_aemif_timing *t,
90 void __iomem *base, unsigned cs) 103 void __iomem *base, unsigned cs,
104 unsigned long clkrate)
91{ 105{
92 unsigned set, val; 106 unsigned set, val;
93 int ta, rhold, rstrobe, rsetup, whold, wstrobe, wsetup; 107 int ta, rhold, rstrobe, rsetup, whold, wstrobe, wsetup;
94 unsigned offset = A1CR_OFFSET + cs * 4; 108 unsigned offset = A1CR_OFFSET + cs * 4;
95 struct clk *aemif_clk;
96 unsigned long clkrate;
97 109
98 if (!t) 110 if (!t)
99 return 0; /* Nothing to do */ 111 return 0; /* Nothing to do */
100 112
101 aemif_clk = clk_get(NULL, "aemif");
102 if (IS_ERR(aemif_clk))
103 return PTR_ERR(aemif_clk);
104
105 clkrate = clk_get_rate(aemif_clk);
106
107 clkrate /= 1000; /* turn clock into kHz for ease of use */ 113 clkrate /= 1000; /* turn clock into kHz for ease of use */
108 114
109 ta = aemif_calc_rate(t->ta, clkrate, TA_MAX); 115 ta = aemif_calc_rate(t->ta, clkrate, TA_MAX);
@@ -130,4 +136,83 @@ int davinci_aemif_setup_timing(struct davinci_aemif_timing *t,
130 136
131 return 0; 137 return 0;
132} 138}
133EXPORT_SYMBOL(davinci_aemif_setup_timing); 139
140/**
141 * davinci_aemif_setup - setup AEMIF interface by davinci_nand_pdata
142 * @pdev - link to platform device to setup settings for
143 *
144 * This function does not use any locking while programming the AEMIF
145 * because it is expected that there is only one user of a given
146 * chip-select.
147 *
148 * Returns 0 on success, else negative errno.
149 */
150int davinci_aemif_setup(struct platform_device *pdev)
151{
152 struct davinci_nand_pdata *pdata = dev_get_platdata(&pdev->dev);
153 uint32_t val;
154 unsigned long clkrate;
155 struct resource *res;
156 void __iomem *base;
157 struct clk *clk;
158 int ret = 0;
159
160 clk = clk_get(&pdev->dev, "aemif");
161 if (IS_ERR(clk)) {
162 ret = PTR_ERR(clk);
163 dev_dbg(&pdev->dev, "unable to get AEMIF clock, err %d\n", ret);
164 return ret;
165 }
166
167 ret = clk_prepare_enable(clk);
168 if (ret < 0) {
169 dev_dbg(&pdev->dev, "unable to enable AEMIF clock, err %d\n",
170 ret);
171 goto err_put;
172 }
173
174 res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
175 if (!res) {
176 dev_err(&pdev->dev, "cannot get IORESOURCE_MEM\n");
177 ret = -ENOMEM;
178 goto err;
179 }
180
181 base = ioremap(res->start, resource_size(res));
182 if (!base) {
183 dev_err(&pdev->dev, "ioremap failed for resource %pR\n", res);
184 ret = -ENOMEM;
185 goto err;
186 }
187
188 /*
189 * Setup Async configuration register in case we did not boot
190 * from NAND and so bootloader did not bother to set it up.
191 */
192 val = davinci_aemif_readl(base, A1CR_OFFSET + pdev->id * 4);
193 /*
194 * Extended Wait is not valid and Select Strobe mode is not
195 * used
196 */
197 val &= ~(ACR_ASIZE_MASK | ACR_EW_MASK | ACR_SS_MASK);
198 if (pdata->options & NAND_BUSWIDTH_16)
199 val |= 0x1;
200
201 davinci_aemif_writel(base, A1CR_OFFSET + pdev->id * 4, val);
202
203 clkrate = clk_get_rate(clk);
204
205 if (pdata->timing)
206 ret = davinci_aemif_setup_timing(pdata->timing, base, pdev->id,
207 clkrate);
208
209 if (ret < 0)
210 dev_dbg(&pdev->dev, "NAND timing values setup fail\n");
211
212 iounmap(base);
213err:
214 clk_disable_unprepare(clk);
215err_put:
216 clk_put(clk);
217 return ret;
218}
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index d1f45af7a530..5623131c4f0b 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -419,6 +419,9 @@ static inline void da830_evm_init_nand(int mux_mode)
419 if (ret) 419 if (ret)
420 pr_warning("da830_evm_init: NAND device not registered.\n"); 420 pr_warning("da830_evm_init: NAND device not registered.\n");
421 421
422 if (davinci_aemif_setup(&da830_evm_nand_device))
423 pr_warn("%s: Cannot configure AEMIF.\n", __func__);
424
422 gpio_direction_output(mux_mode, 1); 425 gpio_direction_output(mux_mode, 1);
423} 426}
424#else 427#else
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index e0af0eccde8f..234c5bb091f5 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -358,6 +358,9 @@ static inline void da850_evm_setup_nor_nand(void)
358 358
359 platform_add_devices(da850_evm_devices, 359 platform_add_devices(da850_evm_devices,
360 ARRAY_SIZE(da850_evm_devices)); 360 ARRAY_SIZE(da850_evm_devices));
361
362 if (davinci_aemif_setup(&da850_evm_nandflash_device))
363 pr_warn("%s: Cannot configure AEMIF.\n", __func__);
361 } 364 }
362} 365}
363 366
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 987605b78556..e583e58b5e1e 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -778,6 +778,11 @@ static __init void davinci_evm_init(void)
778 /* only one device will be jumpered and detected */ 778 /* only one device will be jumpered and detected */
779 if (HAS_NAND) { 779 if (HAS_NAND) {
780 platform_device_register(&davinci_evm_nandflash_device); 780 platform_device_register(&davinci_evm_nandflash_device);
781
782 if (davinci_aemif_setup(&davinci_evm_nandflash_device))
783 pr_warn("%s: Cannot configure AEMIF.\n",
784 __func__);
785
781 evm_leds[7].default_trigger = "nand-disk"; 786 evm_leds[7].default_trigger = "nand-disk";
782 if (HAS_NOR) 787 if (HAS_NOR)
783 pr_warning("WARNING: both NAND and NOR flash " 788 pr_warning("WARNING: both NAND and NOR flash "
@@ -799,11 +804,12 @@ static __init void davinci_evm_init(void)
799 /* irlml6401 switches over 1A, in under 8 msec */ 804 /* irlml6401 switches over 1A, in under 8 msec */
800 davinci_setup_usb(1000, 8); 805 davinci_setup_usb(1000, 8);
801 806
802 soc_info->emac_pdata->phy_id = DM644X_EVM_PHY_ID; 807 if (IS_BUILTIN(CONFIG_PHYLIB)) {
803 /* Register the fixup for PHY on DaVinci */ 808 soc_info->emac_pdata->phy_id = DM644X_EVM_PHY_ID;
804 phy_register_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK, 809 /* Register the fixup for PHY on DaVinci */
805 davinci_phy_fixup); 810 phy_register_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK,
806 811 davinci_phy_fixup);
812 }
807} 813}
808 814
809MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM") 815MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM")
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index 13d0801fd6b1..ae129bc49273 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -805,6 +805,9 @@ static __init void evm_init(void)
805 805
806 platform_device_register(&davinci_nand_device); 806 platform_device_register(&davinci_nand_device);
807 807
808 if (davinci_aemif_setup(&davinci_nand_device))
809 pr_warn("%s: Cannot configure AEMIF.\n", __func__);
810
808 dm646x_init_edma(dm646x_edma_rsv); 811 dm646x_init_edma(dm646x_edma_rsv);
809 812
810 if (HAS_ATA) 813 if (HAS_ATA)
diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c
index 7aa105b1fd0f..96fc00a167f5 100644
--- a/arch/arm/mach-davinci/board-mityomapl138.c
+++ b/arch/arm/mach-davinci/board-mityomapl138.c
@@ -27,6 +27,7 @@
27#include <mach/cp_intc.h> 27#include <mach/cp_intc.h>
28#include <mach/da8xx.h> 28#include <mach/da8xx.h>
29#include <linux/platform_data/mtd-davinci.h> 29#include <linux/platform_data/mtd-davinci.h>
30#include <linux/platform_data/mtd-davinci-aemif.h>
30#include <mach/mux.h> 31#include <mach/mux.h>
31#include <linux/platform_data/spi-davinci.h> 32#include <linux/platform_data/spi-davinci.h>
32 33
@@ -432,6 +433,9 @@ static void __init mityomapl138_setup_nand(void)
432{ 433{
433 platform_add_devices(mityomapl138_devices, 434 platform_add_devices(mityomapl138_devices,
434 ARRAY_SIZE(mityomapl138_devices)); 435 ARRAY_SIZE(mityomapl138_devices));
436
437 if (davinci_aemif_setup(&mityomapl138_nandflash_device))
438 pr_warn("%s: Cannot configure AEMIF.\n", __func__);
435} 439}
436 440
437static const short mityomap_mii_pins[] = { 441static const short mityomap_mii_pins[] = {
diff --git a/arch/arm/mach-davinci/board-tnetv107x-evm.c b/arch/arm/mach-davinci/board-tnetv107x-evm.c
deleted file mode 100644
index 78ea395d2aca..000000000000
--- a/arch/arm/mach-davinci/board-tnetv107x-evm.c
+++ /dev/null
@@ -1,287 +0,0 @@
1/*
2 * Texas Instruments TNETV107X EVM Board Support
3 *
4 * Copyright (C) 2010 Texas Instruments
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.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/console.h>
18#include <linux/dma-mapping.h>
19#include <linux/interrupt.h>
20#include <linux/gpio.h>
21#include <linux/delay.h>
22#include <linux/platform_device.h>
23#include <linux/ratelimit.h>
24#include <linux/mtd/mtd.h>
25#include <linux/mtd/partitions.h>
26#include <linux/input.h>
27#include <linux/input/matrix_keypad.h>
28#include <linux/spi/spi.h>
29#include <linux/platform_data/edma.h>
30
31#include <asm/mach/arch.h>
32#include <asm/mach-types.h>
33
34#include <mach/irqs.h>
35#include <mach/mux.h>
36#include <mach/cp_intc.h>
37#include <mach/tnetv107x.h>
38
39#define EVM_MMC_WP_GPIO 21
40#define EVM_MMC_CD_GPIO 24
41#define EVM_SPI_CS_GPIO 54
42
43static int initialize_gpio(int gpio, char *desc)
44{
45 int ret;
46
47 ret = gpio_request(gpio, desc);
48 if (ret < 0) {
49 pr_err_ratelimited("cannot open %s gpio\n", desc);
50 return -ENOSYS;
51 }
52 gpio_direction_input(gpio);
53 return gpio;
54}
55
56static int mmc_get_cd(int index)
57{
58 static int gpio;
59
60 if (!gpio)
61 gpio = initialize_gpio(EVM_MMC_CD_GPIO, "mmc card detect");
62
63 if (gpio < 0)
64 return gpio;
65
66 return gpio_get_value(gpio) ? 0 : 1;
67}
68
69static int mmc_get_ro(int index)
70{
71 static int gpio;
72
73 if (!gpio)
74 gpio = initialize_gpio(EVM_MMC_WP_GPIO, "mmc write protect");
75
76 if (gpio < 0)
77 return gpio;
78
79 return gpio_get_value(gpio) ? 1 : 0;
80}
81
82static struct davinci_mmc_config mmc_config = {
83 .get_cd = mmc_get_cd,
84 .get_ro = mmc_get_ro,
85 .wires = 4,
86 .max_freq = 50000000,
87 .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
88};
89
90static const short sdio1_pins[] __initconst = {
91 TNETV107X_SDIO1_CLK_1, TNETV107X_SDIO1_CMD_1,
92 TNETV107X_SDIO1_DATA0_1, TNETV107X_SDIO1_DATA1_1,
93 TNETV107X_SDIO1_DATA2_1, TNETV107X_SDIO1_DATA3_1,
94 TNETV107X_GPIO21, TNETV107X_GPIO24,
95 -1
96};
97
98static const short uart1_pins[] __initconst = {
99 TNETV107X_UART1_RD, TNETV107X_UART1_TD,
100 -1
101};
102
103static const short ssp_pins[] __initconst = {
104 TNETV107X_SSP0_0, TNETV107X_SSP0_1, TNETV107X_SSP0_2,
105 TNETV107X_SSP1_0, TNETV107X_SSP1_1, TNETV107X_SSP1_2,
106 TNETV107X_SSP1_3, -1
107};
108
109static struct mtd_partition nand_partitions[] = {
110 /* bootloader (U-Boot, etc) in first 12 sectors */
111 {
112 .name = "bootloader",
113 .offset = 0,
114 .size = (12*SZ_128K),
115 .mask_flags = MTD_WRITEABLE, /* force read-only */
116 },
117 /* bootloader params in the next sector */
118 {
119 .name = "params",
120 .offset = MTDPART_OFS_NXTBLK,
121 .size = SZ_128K,
122 .mask_flags = MTD_WRITEABLE, /* force read-only */
123 },
124 /* kernel */
125 {
126 .name = "kernel",
127 .offset = MTDPART_OFS_NXTBLK,
128 .size = SZ_4M,
129 .mask_flags = 0,
130 },
131 /* file system */
132 {
133 .name = "filesystem",
134 .offset = MTDPART_OFS_NXTBLK,
135 .size = MTDPART_SIZ_FULL,
136 .mask_flags = 0,
137 }
138};
139
140static struct davinci_nand_pdata nand_config = {
141 .mask_cle = 0x4000,
142 .mask_ale = 0x2000,
143 .parts = nand_partitions,
144 .nr_parts = ARRAY_SIZE(nand_partitions),
145 .ecc_mode = NAND_ECC_HW,
146 .bbt_options = NAND_BBT_USE_FLASH,
147 .ecc_bits = 1,
148};
149
150static struct davinci_uart_config serial_config __initconst = {
151 .enabled_uarts = BIT(1),
152};
153
154static const uint32_t keymap[] = {
155 KEY(0, 0, KEY_NUMERIC_1),
156 KEY(0, 1, KEY_NUMERIC_2),
157 KEY(0, 2, KEY_NUMERIC_3),
158 KEY(0, 3, KEY_FN_F1),
159 KEY(0, 4, KEY_MENU),
160
161 KEY(1, 0, KEY_NUMERIC_4),
162 KEY(1, 1, KEY_NUMERIC_5),
163 KEY(1, 2, KEY_NUMERIC_6),
164 KEY(1, 3, KEY_UP),
165 KEY(1, 4, KEY_FN_F2),
166
167 KEY(2, 0, KEY_NUMERIC_7),
168 KEY(2, 1, KEY_NUMERIC_8),
169 KEY(2, 2, KEY_NUMERIC_9),
170 KEY(2, 3, KEY_LEFT),
171 KEY(2, 4, KEY_ENTER),
172
173 KEY(3, 0, KEY_NUMERIC_STAR),
174 KEY(3, 1, KEY_NUMERIC_0),
175 KEY(3, 2, KEY_NUMERIC_POUND),
176 KEY(3, 3, KEY_DOWN),
177 KEY(3, 4, KEY_RIGHT),
178
179 KEY(4, 0, KEY_FN_F3),
180 KEY(4, 1, KEY_FN_F4),
181 KEY(4, 2, KEY_MUTE),
182 KEY(4, 3, KEY_HOME),
183 KEY(4, 4, KEY_BACK),
184
185 KEY(5, 0, KEY_VOLUMEDOWN),
186 KEY(5, 1, KEY_VOLUMEUP),
187 KEY(5, 2, KEY_F1),
188 KEY(5, 3, KEY_F2),
189 KEY(5, 4, KEY_F3),
190};
191
192static const struct matrix_keymap_data keymap_data = {
193 .keymap = keymap,
194 .keymap_size = ARRAY_SIZE(keymap),
195};
196
197static struct matrix_keypad_platform_data keypad_config = {
198 .keymap_data = &keymap_data,
199 .num_row_gpios = 6,
200 .num_col_gpios = 5,
201 .debounce_ms = 0, /* minimum */
202 .active_low = 0, /* pull up realization */
203 .no_autorepeat = 0,
204};
205
206static void spi_select_device(int cs)
207{
208 static int gpio;
209
210 if (!gpio) {
211 int ret;
212 ret = gpio_request(EVM_SPI_CS_GPIO, "spi chipsel");
213 if (ret < 0) {
214 pr_err("cannot open spi chipsel gpio\n");
215 gpio = -ENOSYS;
216 return;
217 } else {
218 gpio = EVM_SPI_CS_GPIO;
219 gpio_direction_output(gpio, 0);
220 }
221 }
222
223 if (gpio < 0)
224 return;
225
226 return gpio_set_value(gpio, cs ? 1 : 0);
227}
228
229static struct ti_ssp_spi_data spi_master_data = {
230 .num_cs = 2,
231 .select = spi_select_device,
232 .iosel = SSP_PIN_SEL(0, SSP_CLOCK) | SSP_PIN_SEL(1, SSP_DATA) |
233 SSP_PIN_SEL(2, SSP_CHIPSEL) | SSP_PIN_SEL(3, SSP_IN) |
234 SSP_INPUT_SEL(3),
235};
236
237static struct ti_ssp_data ssp_config = {
238 .out_clock = 250 * 1000,
239 .dev_data = {
240 [1] = {
241 .dev_name = "ti-ssp-spi",
242 .pdata = &spi_master_data,
243 .pdata_size = sizeof(spi_master_data),
244 },
245 },
246};
247
248static struct tnetv107x_device_info evm_device_info __initconst = {
249 .serial_config = &serial_config,
250 .mmc_config[1] = &mmc_config, /* controller 1 */
251 .nand_config[0] = &nand_config, /* chip select 0 */
252 .keypad_config = &keypad_config,
253 .ssp_config = &ssp_config,
254};
255
256static struct spi_board_info spi_info[] __initconst = {
257};
258
259static __init void tnetv107x_evm_board_init(void)
260{
261 davinci_cfg_reg_list(sdio1_pins);
262 davinci_cfg_reg_list(uart1_pins);
263 davinci_cfg_reg_list(ssp_pins);
264
265 tnetv107x_devices_init(&evm_device_info);
266
267 spi_register_board_info(spi_info, ARRAY_SIZE(spi_info));
268}
269
270#ifdef CONFIG_SERIAL_8250_CONSOLE
271static int __init tnetv107x_evm_console_init(void)
272{
273 return add_preferred_console("ttyS", 0, "115200");
274}
275console_initcall(tnetv107x_evm_console_init);
276#endif
277
278MACHINE_START(TNETV107X, "TNETV107X EVM")
279 .atag_offset = 0x100,
280 .map_io = tnetv107x_init,
281 .init_irq = cp_intc_init,
282 .init_time = davinci_timer_init,
283 .init_machine = tnetv107x_evm_board_init,
284 .init_late = davinci_init_late,
285 .dma_zone_size = SZ_128M,
286 .restart = tnetv107x_restart,
287MACHINE_END
diff --git a/arch/arm/mach-davinci/davinci.h b/arch/arm/mach-davinci/davinci.h
index 2eebc4338802..4ffc37accce0 100644
--- a/arch/arm/mach-davinci/davinci.h
+++ b/arch/arm/mach-davinci/davinci.h
@@ -79,6 +79,8 @@ int davinci_gpio_register(struct resource *res, int size, void *pdata);
79#define DM646X_ASYNC_EMIF_CONTROL_BASE 0x20008000 79#define DM646X_ASYNC_EMIF_CONTROL_BASE 0x20008000
80#define DM646X_ASYNC_EMIF_CS2_SPACE_BASE 0x42000000 80#define DM646X_ASYNC_EMIF_CS2_SPACE_BASE 0x42000000
81 81
82int davinci_init_wdt(void);
83
82/* DM355 function declarations */ 84/* DM355 function declarations */
83void dm355_init(void); 85void dm355_init(void);
84void dm355_init_spi0(unsigned chipselect_mask, 86void dm355_init_spi0(unsigned chipselect_mask,
diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c b/arch/arm/mach-davinci/devices-tnetv107x.c
deleted file mode 100644
index 01d8686e553c..000000000000
--- a/arch/arm/mach-davinci/devices-tnetv107x.c
+++ /dev/null
@@ -1,434 +0,0 @@
1/*
2 * Texas Instruments TNETV107X SoC devices
3 *
4 * Copyright (C) 2010 Texas Instruments
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.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/platform_device.h>
18#include <linux/dma-mapping.h>
19#include <linux/clk.h>
20#include <linux/slab.h>
21#include <linux/platform_data/edma.h>
22
23#include <mach/common.h>
24#include <mach/irqs.h>
25#include <mach/tnetv107x.h>
26
27#include "clock.h"
28
29/* Base addresses for on-chip devices */
30#define TNETV107X_TPCC_BASE 0x01c00000
31#define TNETV107X_TPTC0_BASE 0x01c10000
32#define TNETV107X_TPTC1_BASE 0x01c10400
33#define TNETV107X_WDOG_BASE 0x08086700
34#define TNETV107X_TSC_BASE 0x08088500
35#define TNETV107X_SDIO0_BASE 0x08088700
36#define TNETV107X_SDIO1_BASE 0x08088800
37#define TNETV107X_KEYPAD_BASE 0x08088a00
38#define TNETV107X_SSP_BASE 0x08088c00
39#define TNETV107X_ASYNC_EMIF_CNTRL_BASE 0x08200000
40#define TNETV107X_ASYNC_EMIF_DATA_CE0_BASE 0x30000000
41#define TNETV107X_ASYNC_EMIF_DATA_CE1_BASE 0x40000000
42#define TNETV107X_ASYNC_EMIF_DATA_CE2_BASE 0x44000000
43#define TNETV107X_ASYNC_EMIF_DATA_CE3_BASE 0x48000000
44
45/* TNETV107X specific EDMA3 information */
46#define EDMA_TNETV107X_NUM_DMACH 64
47#define EDMA_TNETV107X_NUM_TCC 64
48#define EDMA_TNETV107X_NUM_PARAMENTRY 128
49#define EDMA_TNETV107X_NUM_EVQUE 2
50#define EDMA_TNETV107X_NUM_TC 2
51#define EDMA_TNETV107X_CHMAP_EXIST 0
52#define EDMA_TNETV107X_NUM_REGIONS 4
53#define TNETV107X_DMACH2EVENT_MAP0 0x3C0CE000u
54#define TNETV107X_DMACH2EVENT_MAP1 0x000FFFFFu
55
56#define TNETV107X_DMACH_SDIO0_RX 26
57#define TNETV107X_DMACH_SDIO0_TX 27
58#define TNETV107X_DMACH_SDIO1_RX 28
59#define TNETV107X_DMACH_SDIO1_TX 29
60
61static s8 edma_tc_mapping[][2] = {
62 /* event queue no TC no */
63 { 0, 0 },
64 { 1, 1 },
65 { -1, -1 }
66};
67
68static s8 edma_priority_mapping[][2] = {
69 /* event queue no Prio */
70 { 0, 3 },
71 { 1, 7 },
72 { -1, -1 }
73};
74
75static struct edma_soc_info edma_cc0_info = {
76 .n_channel = EDMA_TNETV107X_NUM_DMACH,
77 .n_region = EDMA_TNETV107X_NUM_REGIONS,
78 .n_slot = EDMA_TNETV107X_NUM_PARAMENTRY,
79 .n_tc = EDMA_TNETV107X_NUM_TC,
80 .n_cc = 1,
81 .queue_tc_mapping = edma_tc_mapping,
82 .queue_priority_mapping = edma_priority_mapping,
83 .default_queue = EVENTQ_1,
84};
85
86static struct edma_soc_info *tnetv107x_edma_info[EDMA_MAX_CC] = {
87 &edma_cc0_info,
88};
89
90static struct resource edma_resources[] = {
91 {
92 .name = "edma_cc0",
93 .start = TNETV107X_TPCC_BASE,
94 .end = TNETV107X_TPCC_BASE + SZ_32K - 1,
95 .flags = IORESOURCE_MEM,
96 },
97 {
98 .name = "edma_tc0",
99 .start = TNETV107X_TPTC0_BASE,
100 .end = TNETV107X_TPTC0_BASE + SZ_1K - 1,
101 .flags = IORESOURCE_MEM,
102 },
103 {
104 .name = "edma_tc1",
105 .start = TNETV107X_TPTC1_BASE,
106 .end = TNETV107X_TPTC1_BASE + SZ_1K - 1,
107 .flags = IORESOURCE_MEM,
108 },
109 {
110 .name = "edma0",
111 .start = IRQ_TNETV107X_TPCC,
112 .flags = IORESOURCE_IRQ,
113 },
114 {
115 .name = "edma0_err",
116 .start = IRQ_TNETV107X_TPCC_ERR,
117 .flags = IORESOURCE_IRQ,
118 },
119};
120
121static struct platform_device edma_device = {
122 .name = "edma",
123 .id = -1,
124 .num_resources = ARRAY_SIZE(edma_resources),
125 .resource = edma_resources,
126 .dev.platform_data = tnetv107x_edma_info,
127};
128
129static struct plat_serial8250_port serial0_platform_data[] = {
130 {
131 .mapbase = TNETV107X_UART0_BASE,
132 .irq = IRQ_TNETV107X_UART0,
133 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
134 UPF_FIXED_TYPE | UPF_IOREMAP,
135 .type = PORT_AR7,
136 .iotype = UPIO_MEM32,
137 .regshift = 2,
138 },
139 {
140 .flags = 0,
141 }
142};
143static struct plat_serial8250_port serial1_platform_data[] = {
144 {
145 .mapbase = TNETV107X_UART1_BASE,
146 .irq = IRQ_TNETV107X_UART1,
147 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
148 UPF_FIXED_TYPE | UPF_IOREMAP,
149 .type = PORT_AR7,
150 .iotype = UPIO_MEM32,
151 .regshift = 2,
152 },
153 {
154 .flags = 0,
155 }
156};
157static struct plat_serial8250_port serial2_platform_data[] = {
158 {
159 .mapbase = TNETV107X_UART2_BASE,
160 .irq = IRQ_TNETV107X_UART2,
161 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
162 UPF_FIXED_TYPE | UPF_IOREMAP,
163 .type = PORT_AR7,
164 .iotype = UPIO_MEM32,
165 .regshift = 2,
166 },
167 {
168 .flags = 0,
169 }
170};
171
172
173struct platform_device tnetv107x_serial_device[] = {
174 {
175 .name = "serial8250",
176 .id = PLAT8250_DEV_PLATFORM,
177 .dev.platform_data = serial0_platform_data,
178 },
179 {
180 .name = "serial8250",
181 .id = PLAT8250_DEV_PLATFORM1,
182 .dev.platform_data = serial1_platform_data,
183 },
184 {
185 .name = "serial8250",
186 .id = PLAT8250_DEV_PLATFORM2,
187 .dev.platform_data = serial2_platform_data,
188 },
189 {
190 }
191};
192
193static struct resource mmc0_resources[] = {
194 { /* Memory mapped registers */
195 .start = TNETV107X_SDIO0_BASE,
196 .end = TNETV107X_SDIO0_BASE + 0x0ff,
197 .flags = IORESOURCE_MEM
198 },
199 { /* MMC interrupt */
200 .start = IRQ_TNETV107X_MMC0,
201 .flags = IORESOURCE_IRQ
202 },
203 { /* SDIO interrupt */
204 .start = IRQ_TNETV107X_SDIO0,
205 .flags = IORESOURCE_IRQ
206 },
207 { /* DMA RX */
208 .start = EDMA_CTLR_CHAN(0, TNETV107X_DMACH_SDIO0_RX),
209 .flags = IORESOURCE_DMA
210 },
211 { /* DMA TX */
212 .start = EDMA_CTLR_CHAN(0, TNETV107X_DMACH_SDIO0_TX),
213 .flags = IORESOURCE_DMA
214 },
215};
216
217static struct resource mmc1_resources[] = {
218 { /* Memory mapped registers */
219 .start = TNETV107X_SDIO1_BASE,
220 .end = TNETV107X_SDIO1_BASE + 0x0ff,
221 .flags = IORESOURCE_MEM
222 },
223 { /* MMC interrupt */
224 .start = IRQ_TNETV107X_MMC1,
225 .flags = IORESOURCE_IRQ
226 },
227 { /* SDIO interrupt */
228 .start = IRQ_TNETV107X_SDIO1,
229 .flags = IORESOURCE_IRQ
230 },
231 { /* DMA RX */
232 .start = EDMA_CTLR_CHAN(0, TNETV107X_DMACH_SDIO1_RX),
233 .flags = IORESOURCE_DMA
234 },
235 { /* DMA TX */
236 .start = EDMA_CTLR_CHAN(0, TNETV107X_DMACH_SDIO1_TX),
237 .flags = IORESOURCE_DMA
238 },
239};
240
241static u64 mmc0_dma_mask = DMA_BIT_MASK(32);
242static u64 mmc1_dma_mask = DMA_BIT_MASK(32);
243
244static struct platform_device mmc_devices[2] = {
245 {
246 .name = "dm6441-mmc",
247 .id = 0,
248 .dev = {
249 .dma_mask = &mmc0_dma_mask,
250 .coherent_dma_mask = DMA_BIT_MASK(32),
251 },
252 .num_resources = ARRAY_SIZE(mmc0_resources),
253 .resource = mmc0_resources
254 },
255 {
256 .name = "dm6441-mmc",
257 .id = 1,
258 .dev = {
259 .dma_mask = &mmc1_dma_mask,
260 .coherent_dma_mask = DMA_BIT_MASK(32),
261 },
262 .num_resources = ARRAY_SIZE(mmc1_resources),
263 .resource = mmc1_resources
264 },
265};
266
267static const u32 emif_windows[] = {
268 TNETV107X_ASYNC_EMIF_DATA_CE0_BASE, TNETV107X_ASYNC_EMIF_DATA_CE1_BASE,
269 TNETV107X_ASYNC_EMIF_DATA_CE2_BASE, TNETV107X_ASYNC_EMIF_DATA_CE3_BASE,
270};
271
272static const u32 emif_window_sizes[] = { SZ_256M, SZ_64M, SZ_64M, SZ_64M };
273
274static struct resource wdt_resources[] = {
275 {
276 .start = TNETV107X_WDOG_BASE,
277 .end = TNETV107X_WDOG_BASE + SZ_4K - 1,
278 .flags = IORESOURCE_MEM,
279 },
280};
281
282struct platform_device tnetv107x_wdt_device = {
283 .name = "tnetv107x_wdt",
284 .id = 0,
285 .num_resources = ARRAY_SIZE(wdt_resources),
286 .resource = wdt_resources,
287};
288
289static int __init nand_init(int chipsel, struct davinci_nand_pdata *data)
290{
291 struct resource res[2];
292 struct platform_device *pdev;
293 u32 range;
294 int ret;
295
296 /* Figure out the resource range from the ale/cle masks */
297 range = max(data->mask_cle, data->mask_ale);
298 range = PAGE_ALIGN(range + 4) - 1;
299
300 if (range >= emif_window_sizes[chipsel])
301 return -EINVAL;
302
303 pdev = kzalloc(sizeof(*pdev), GFP_KERNEL);
304 if (!pdev)
305 return -ENOMEM;
306
307 pdev->name = "davinci_nand";
308 pdev->id = chipsel;
309 pdev->dev.platform_data = data;
310
311 memset(res, 0, sizeof(res));
312
313 res[0].start = emif_windows[chipsel];
314 res[0].end = res[0].start + range;
315 res[0].flags = IORESOURCE_MEM;
316
317 res[1].start = TNETV107X_ASYNC_EMIF_CNTRL_BASE;
318 res[1].end = res[1].start + SZ_4K - 1;
319 res[1].flags = IORESOURCE_MEM;
320
321 ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res));
322 if (ret < 0) {
323 kfree(pdev);
324 return ret;
325 }
326
327 return platform_device_register(pdev);
328}
329
330static struct resource keypad_resources[] = {
331 {
332 .start = TNETV107X_KEYPAD_BASE,
333 .end = TNETV107X_KEYPAD_BASE + 0xff,
334 .flags = IORESOURCE_MEM,
335 },
336 {
337 .start = IRQ_TNETV107X_KEYPAD,
338 .flags = IORESOURCE_IRQ,
339 .name = "press",
340 },
341 {
342 .start = IRQ_TNETV107X_KEYPAD_FREE,
343 .flags = IORESOURCE_IRQ,
344 .name = "release",
345 },
346};
347
348static struct platform_device keypad_device = {
349 .name = "tnetv107x-keypad",
350 .num_resources = ARRAY_SIZE(keypad_resources),
351 .resource = keypad_resources,
352};
353
354static struct resource tsc_resources[] = {
355 {
356 .start = TNETV107X_TSC_BASE,
357 .end = TNETV107X_TSC_BASE + 0xff,
358 .flags = IORESOURCE_MEM,
359 },
360 {
361 .start = IRQ_TNETV107X_TSC,
362 .flags = IORESOURCE_IRQ,
363 },
364};
365
366static struct platform_device tsc_device = {
367 .name = "tnetv107x-ts",
368 .num_resources = ARRAY_SIZE(tsc_resources),
369 .resource = tsc_resources,
370};
371
372static struct resource ssp_resources[] = {
373 {
374 .start = TNETV107X_SSP_BASE,
375 .end = TNETV107X_SSP_BASE + 0x1ff,
376 .flags = IORESOURCE_MEM,
377 },
378 {
379 .start = IRQ_TNETV107X_SSP,
380 .flags = IORESOURCE_IRQ,
381 },
382};
383
384static struct platform_device ssp_device = {
385 .name = "ti-ssp",
386 .id = -1,
387 .num_resources = ARRAY_SIZE(ssp_resources),
388 .resource = ssp_resources,
389};
390
391void __init tnetv107x_devices_init(struct tnetv107x_device_info *info)
392{
393 int i, error;
394 struct clk *tsc_clk;
395
396 /*
397 * The reset defaults for tnetv107x tsc clock divider is set too high.
398 * This forces the clock down to a range that allows the ADC to
399 * complete sample conversion in time.
400 */
401 tsc_clk = clk_get(NULL, "sys_tsc_clk");
402 if (!IS_ERR(tsc_clk)) {
403 error = clk_set_rate(tsc_clk, 5000000);
404 WARN_ON(error < 0);
405 clk_put(tsc_clk);
406 }
407
408 platform_device_register(&edma_device);
409 platform_device_register(&tnetv107x_wdt_device);
410 platform_device_register(&tsc_device);
411
412 if (info->serial_config)
413 davinci_serial_init(tnetv107x_serial_device);
414
415 for (i = 0; i < 2; i++)
416 if (info->mmc_config[i]) {
417 mmc_devices[i].dev.platform_data = info->mmc_config[i];
418 platform_device_register(&mmc_devices[i]);
419 }
420
421 for (i = 0; i < 4; i++)
422 if (info->nand_config[i])
423 nand_init(i, info->nand_config[i]);
424
425 if (info->keypad_config) {
426 keypad_device.dev.platform_data = info->keypad_config;
427 platform_device_register(&keypad_device);
428 }
429
430 if (info->ssp_config) {
431 ssp_device.dev.platform_data = info->ssp_config;
432 platform_device_register(&ssp_device);
433 }
434}
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
index 5cf9a027dcc6..6257aa452568 100644
--- a/arch/arm/mach-davinci/devices.c
+++ b/arch/arm/mach-davinci/devices.c
@@ -313,9 +313,9 @@ void davinci_restart(enum reboot_mode mode, const char *cmd)
313 davinci_watchdog_reset(&davinci_wdt_device); 313 davinci_watchdog_reset(&davinci_wdt_device);
314} 314}
315 315
316static void davinci_init_wdt(void) 316int davinci_init_wdt(void)
317{ 317{
318 platform_device_register(&davinci_wdt_device); 318 return platform_device_register(&davinci_wdt_device);
319} 319}
320 320
321static struct platform_device davinci_gpio_device = { 321static struct platform_device davinci_gpio_device = {
@@ -348,16 +348,3 @@ struct davinci_timer_instance davinci_timer_instance[2] = {
348 }, 348 },
349}; 349};
350 350
351/*-------------------------------------------------------------------------*/
352
353static int __init davinci_init_devices(void)
354{
355 /* please keep these calls, and their implementations above,
356 * in alphabetical order so they're easier to sort through.
357 */
358 davinci_init_wdt();
359
360 return 0;
361}
362arch_initcall(davinci_init_devices);
363
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index 4668c0e19767..07381d8cea62 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -1076,12 +1076,18 @@ int __init dm355_init_video(struct vpfe_config *vpfe_cfg,
1076 1076
1077static int __init dm355_init_devices(void) 1077static int __init dm355_init_devices(void)
1078{ 1078{
1079 int ret = 0;
1080
1079 if (!cpu_is_davinci_dm355()) 1081 if (!cpu_is_davinci_dm355())
1080 return 0; 1082 return 0;
1081 1083
1082 davinci_cfg_reg(DM355_INT_EDMA_CC); 1084 davinci_cfg_reg(DM355_INT_EDMA_CC);
1083 platform_device_register(&dm355_edma_device); 1085 platform_device_register(&dm355_edma_device);
1084 1086
1085 return 0; 1087 ret = davinci_init_wdt();
1088 if (ret)
1089 pr_warn("%s: watchdog init failed: %d\n", __func__, ret);
1090
1091 return ret;
1086} 1092}
1087postcore_initcall(dm355_init_devices); 1093postcore_initcall(dm355_init_devices);
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index b44b49e2801a..08a61b938333 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -1436,6 +1436,8 @@ int __init dm365_init_video(struct vpfe_config *vpfe_cfg,
1436 1436
1437static int __init dm365_init_devices(void) 1437static int __init dm365_init_devices(void)
1438{ 1438{
1439 int ret = 0;
1440
1439 if (!cpu_is_davinci_dm365()) 1441 if (!cpu_is_davinci_dm365())
1440 return 0; 1442 return 0;
1441 1443
@@ -1445,6 +1447,10 @@ static int __init dm365_init_devices(void)
1445 platform_device_register(&dm365_mdio_device); 1447 platform_device_register(&dm365_mdio_device);
1446 platform_device_register(&dm365_emac_device); 1448 platform_device_register(&dm365_emac_device);
1447 1449
1448 return 0; 1450 ret = davinci_init_wdt();
1451 if (ret)
1452 pr_warn("%s: watchdog init failed: %d\n", __func__, ret);
1453
1454 return ret;
1449} 1455}
1450postcore_initcall(dm365_init_devices); 1456postcore_initcall(dm365_init_devices);
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 5c3e0be95ef3..5debffba4b24 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -964,6 +964,8 @@ int __init dm644x_init_video(struct vpfe_config *vpfe_cfg,
964 964
965static int __init dm644x_init_devices(void) 965static int __init dm644x_init_devices(void)
966{ 966{
967 int ret = 0;
968
967 if (!cpu_is_davinci_dm644x()) 969 if (!cpu_is_davinci_dm644x())
968 return 0; 970 return 0;
969 971
@@ -972,6 +974,10 @@ static int __init dm644x_init_devices(void)
972 platform_device_register(&dm644x_mdio_device); 974 platform_device_register(&dm644x_mdio_device);
973 platform_device_register(&dm644x_emac_device); 975 platform_device_register(&dm644x_emac_device);
974 976
975 return 0; 977 ret = davinci_init_wdt();
978 if (ret)
979 pr_warn("%s: watchdog init failed: %d\n", __func__, ret);
980
981 return ret;
976} 982}
977postcore_initcall(dm644x_init_devices); 983postcore_initcall(dm644x_init_devices);
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 81768dd47096..332d00d24dc2 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -955,12 +955,18 @@ void __init dm646x_init(void)
955 955
956static int __init dm646x_init_devices(void) 956static int __init dm646x_init_devices(void)
957{ 957{
958 int ret = 0;
959
958 if (!cpu_is_davinci_dm646x()) 960 if (!cpu_is_davinci_dm646x())
959 return 0; 961 return 0;
960 962
961 platform_device_register(&dm646x_mdio_device); 963 platform_device_register(&dm646x_mdio_device);
962 platform_device_register(&dm646x_emac_device); 964 platform_device_register(&dm646x_emac_device);
963 965
964 return 0; 966 ret = davinci_init_wdt();
967 if (ret)
968 pr_warn("%s: watchdog init failed: %d\n", __func__, ret);
969
970 return ret;
965} 971}
966postcore_initcall(dm646x_init_devices); 972postcore_initcall(dm646x_init_devices);
diff --git a/arch/arm/mach-davinci/include/mach/cputype.h b/arch/arm/mach-davinci/include/mach/cputype.h
index 957fb87e832e..1fc84e21664d 100644
--- a/arch/arm/mach-davinci/include/mach/cputype.h
+++ b/arch/arm/mach-davinci/include/mach/cputype.h
@@ -33,7 +33,6 @@ struct davinci_id {
33#define DAVINCI_CPU_ID_DM365 0x03650000 33#define DAVINCI_CPU_ID_DM365 0x03650000
34#define DAVINCI_CPU_ID_DA830 0x08300000 34#define DAVINCI_CPU_ID_DA830 0x08300000
35#define DAVINCI_CPU_ID_DA850 0x08500000 35#define DAVINCI_CPU_ID_DA850 0x08500000
36#define DAVINCI_CPU_ID_TNETV107X 0x0b8a0000
37 36
38#define IS_DAVINCI_CPU(type, id) \ 37#define IS_DAVINCI_CPU(type, id) \
39static inline int is_davinci_ ##type(void) \ 38static inline int is_davinci_ ##type(void) \
@@ -47,7 +46,6 @@ IS_DAVINCI_CPU(dm355, DAVINCI_CPU_ID_DM355)
47IS_DAVINCI_CPU(dm365, DAVINCI_CPU_ID_DM365) 46IS_DAVINCI_CPU(dm365, DAVINCI_CPU_ID_DM365)
48IS_DAVINCI_CPU(da830, DAVINCI_CPU_ID_DA830) 47IS_DAVINCI_CPU(da830, DAVINCI_CPU_ID_DA830)
49IS_DAVINCI_CPU(da850, DAVINCI_CPU_ID_DA850) 48IS_DAVINCI_CPU(da850, DAVINCI_CPU_ID_DA850)
50IS_DAVINCI_CPU(tnetv107x, DAVINCI_CPU_ID_TNETV107X)
51 49
52#ifdef CONFIG_ARCH_DAVINCI_DM644x 50#ifdef CONFIG_ARCH_DAVINCI_DM644x
53#define cpu_is_davinci_dm644x() is_davinci_dm644x() 51#define cpu_is_davinci_dm644x() is_davinci_dm644x()
@@ -85,10 +83,4 @@ IS_DAVINCI_CPU(tnetv107x, DAVINCI_CPU_ID_TNETV107X)
85#define cpu_is_davinci_da850() 0 83#define cpu_is_davinci_da850() 0
86#endif 84#endif
87 85
88#ifdef CONFIG_ARCH_DAVINCI_TNETV107X
89#define cpu_is_davinci_tnetv107x() is_davinci_tnetv107x()
90#else
91#define cpu_is_davinci_tnetv107x() 0
92#endif
93
94#endif 86#endif
diff --git a/arch/arm/mach-davinci/include/mach/irqs.h b/arch/arm/mach-davinci/include/mach/irqs.h
index ec76c7775c2e..354af71798dc 100644
--- a/arch/arm/mach-davinci/include/mach/irqs.h
+++ b/arch/arm/mach-davinci/include/mach/irqs.h
@@ -401,103 +401,6 @@
401 401
402#define DA850_N_CP_INTC_IRQ 101 402#define DA850_N_CP_INTC_IRQ 101
403 403
404
405/* TNETV107X specific interrupts */
406#define IRQ_TNETV107X_TDM1_TXDMA 0
407#define IRQ_TNETV107X_EXT_INT_0 1
408#define IRQ_TNETV107X_EXT_INT_1 2
409#define IRQ_TNETV107X_GPIO_INT12 3
410#define IRQ_TNETV107X_GPIO_INT13 4
411#define IRQ_TNETV107X_TIMER_0_TINT12 5
412#define IRQ_TNETV107X_TIMER_1_TINT12 6
413#define IRQ_TNETV107X_UART0 7
414#define IRQ_TNETV107X_TDM1_RXDMA 8
415#define IRQ_TNETV107X_MCDMA_INT0 9
416#define IRQ_TNETV107X_MCDMA_INT1 10
417#define IRQ_TNETV107X_TPCC 11
418#define IRQ_TNETV107X_TPCC_INT0 12
419#define IRQ_TNETV107X_TPCC_INT1 13
420#define IRQ_TNETV107X_TPCC_INT2 14
421#define IRQ_TNETV107X_TPCC_INT3 15
422#define IRQ_TNETV107X_TPTC0 16
423#define IRQ_TNETV107X_TPTC1 17
424#define IRQ_TNETV107X_TIMER_0_TINT34 18
425#define IRQ_TNETV107X_ETHSS 19
426#define IRQ_TNETV107X_TIMER_1_TINT34 20
427#define IRQ_TNETV107X_DSP2ARM_INT0 21
428#define IRQ_TNETV107X_DSP2ARM_INT1 22
429#define IRQ_TNETV107X_ARM_NPMUIRQ 23
430#define IRQ_TNETV107X_USB1 24
431#define IRQ_TNETV107X_VLYNQ 25
432#define IRQ_TNETV107X_UART0_DMATX 26
433#define IRQ_TNETV107X_UART0_DMARX 27
434#define IRQ_TNETV107X_TDM1_TXMCSP 28
435#define IRQ_TNETV107X_SSP 29
436#define IRQ_TNETV107X_MCDMA_INT2 30
437#define IRQ_TNETV107X_MCDMA_INT3 31
438#define IRQ_TNETV107X_TDM_CODECIF_EOT 32
439#define IRQ_TNETV107X_IMCOP_SQR_ARM 33
440#define IRQ_TNETV107X_USB0 34
441#define IRQ_TNETV107X_USB_CDMA 35
442#define IRQ_TNETV107X_LCD 36
443#define IRQ_TNETV107X_KEYPAD 37
444#define IRQ_TNETV107X_KEYPAD_FREE 38
445#define IRQ_TNETV107X_RNG 39
446#define IRQ_TNETV107X_PKA 40
447#define IRQ_TNETV107X_TDM0_TXDMA 41
448#define IRQ_TNETV107X_TDM0_RXDMA 42
449#define IRQ_TNETV107X_TDM0_TXMCSP 43
450#define IRQ_TNETV107X_TDM0_RXMCSP 44
451#define IRQ_TNETV107X_TDM1_RXMCSP 45
452#define IRQ_TNETV107X_SDIO1 46
453#define IRQ_TNETV107X_SDIO0 47
454#define IRQ_TNETV107X_TSC 48
455#define IRQ_TNETV107X_TS 49
456#define IRQ_TNETV107X_UART1 50
457#define IRQ_TNETV107X_MBX_LITE 51
458#define IRQ_TNETV107X_GPIO_INT00 52
459#define IRQ_TNETV107X_GPIO_INT01 53
460#define IRQ_TNETV107X_GPIO_INT02 54
461#define IRQ_TNETV107X_GPIO_INT03 55
462#define IRQ_TNETV107X_UART2 56
463#define IRQ_TNETV107X_UART2_DMATX 57
464#define IRQ_TNETV107X_UART2_DMARX 58
465#define IRQ_TNETV107X_IMCOP_IMX 59
466#define IRQ_TNETV107X_IMCOP_VLCD 60
467#define IRQ_TNETV107X_AES 61
468#define IRQ_TNETV107X_DES 62
469#define IRQ_TNETV107X_SHAMD5 63
470#define IRQ_TNETV107X_TPCC_ERR 68
471#define IRQ_TNETV107X_TPCC_PROT 69
472#define IRQ_TNETV107X_TPTC0_ERR 70
473#define IRQ_TNETV107X_TPTC1_ERR 71
474#define IRQ_TNETV107X_UART0_ERR 72
475#define IRQ_TNETV107X_UART1_ERR 73
476#define IRQ_TNETV107X_AEMIF_ERR 74
477#define IRQ_TNETV107X_DDR_ERR 75
478#define IRQ_TNETV107X_WDTARM_INT0 76
479#define IRQ_TNETV107X_MCDMA_ERR 77
480#define IRQ_TNETV107X_GPIO_ERR 78
481#define IRQ_TNETV107X_MPU_ADDR 79
482#define IRQ_TNETV107X_MPU_PROT 80
483#define IRQ_TNETV107X_IOPU_ADDR 81
484#define IRQ_TNETV107X_IOPU_PROT 82
485#define IRQ_TNETV107X_KEYPAD_ADDR_ERR 83
486#define IRQ_TNETV107X_WDT0_ADDR_ERR 84
487#define IRQ_TNETV107X_WDT1_ADDR_ERR 85
488#define IRQ_TNETV107X_CLKCTL_ADDR_ERR 86
489#define IRQ_TNETV107X_PLL_UNLOCK 87
490#define IRQ_TNETV107X_WDTDSP_INT0 88
491#define IRQ_TNETV107X_SEC_CTRL_VIOLATION 89
492#define IRQ_TNETV107X_KEY_MNG_VIOLATION 90
493#define IRQ_TNETV107X_PBIST_CPU 91
494#define IRQ_TNETV107X_WDTARM 92
495#define IRQ_TNETV107X_PSC 93
496#define IRQ_TNETV107X_MMC0 94
497#define IRQ_TNETV107X_MMC1 95
498
499#define TNETV107X_N_CP_INTC_IRQ 96
500
501/* da850 currently has the most gpio pins (144) */ 404/* da850 currently has the most gpio pins (144) */
502#define DAVINCI_N_GPIO 144 405#define DAVINCI_N_GPIO 144
503/* da850 currently has the most irqs so use DA850_N_CP_INTC_IRQ */ 406/* da850 currently has the most irqs so use DA850_N_CP_INTC_IRQ */
diff --git a/arch/arm/mach-davinci/include/mach/mux.h b/arch/arm/mach-davinci/include/mach/mux.h
index 9e95b8a1edb6..631655e68ae0 100644
--- a/arch/arm/mach-davinci/include/mach/mux.h
+++ b/arch/arm/mach-davinci/include/mach/mux.h
@@ -972,275 +972,6 @@ enum davinci_da850_index {
972 DA850_VPIF_CLKO3, 972 DA850_VPIF_CLKO3,
973}; 973};
974 974
975enum davinci_tnetv107x_index {
976 TNETV107X_ASR_A00,
977 TNETV107X_GPIO32,
978 TNETV107X_ASR_A01,
979 TNETV107X_GPIO33,
980 TNETV107X_ASR_A02,
981 TNETV107X_GPIO34,
982 TNETV107X_ASR_A03,
983 TNETV107X_GPIO35,
984 TNETV107X_ASR_A04,
985 TNETV107X_GPIO36,
986 TNETV107X_ASR_A05,
987 TNETV107X_GPIO37,
988 TNETV107X_ASR_A06,
989 TNETV107X_GPIO38,
990 TNETV107X_ASR_A07,
991 TNETV107X_GPIO39,
992 TNETV107X_ASR_A08,
993 TNETV107X_GPIO40,
994 TNETV107X_ASR_A09,
995 TNETV107X_GPIO41,
996 TNETV107X_ASR_A10,
997 TNETV107X_GPIO42,
998 TNETV107X_ASR_A11,
999 TNETV107X_BOOT_STRP_0,
1000 TNETV107X_ASR_A12,
1001 TNETV107X_BOOT_STRP_1,
1002 TNETV107X_ASR_A13,
1003 TNETV107X_GPIO43,
1004 TNETV107X_ASR_A14,
1005 TNETV107X_GPIO44,
1006 TNETV107X_ASR_A15,
1007 TNETV107X_GPIO45,
1008 TNETV107X_ASR_A16,
1009 TNETV107X_GPIO46,
1010 TNETV107X_ASR_A17,
1011 TNETV107X_GPIO47,
1012 TNETV107X_ASR_A18,
1013 TNETV107X_GPIO48,
1014 TNETV107X_SDIO1_DATA3_0,
1015 TNETV107X_ASR_A19,
1016 TNETV107X_GPIO49,
1017 TNETV107X_SDIO1_DATA2_0,
1018 TNETV107X_ASR_A20,
1019 TNETV107X_GPIO50,
1020 TNETV107X_SDIO1_DATA1_0,
1021 TNETV107X_ASR_A21,
1022 TNETV107X_GPIO51,
1023 TNETV107X_SDIO1_DATA0_0,
1024 TNETV107X_ASR_A22,
1025 TNETV107X_GPIO52,
1026 TNETV107X_SDIO1_CMD_0,
1027 TNETV107X_ASR_A23,
1028 TNETV107X_GPIO53,
1029 TNETV107X_SDIO1_CLK_0,
1030 TNETV107X_ASR_BA_1,
1031 TNETV107X_GPIO54,
1032 TNETV107X_SYS_PLL_CLK,
1033 TNETV107X_ASR_CS0,
1034 TNETV107X_ASR_CS1,
1035 TNETV107X_ASR_CS2,
1036 TNETV107X_TDM_PLL_CLK,
1037 TNETV107X_ASR_CS3,
1038 TNETV107X_ETH_PHY_CLK,
1039 TNETV107X_ASR_D00,
1040 TNETV107X_GPIO55,
1041 TNETV107X_ASR_D01,
1042 TNETV107X_GPIO56,
1043 TNETV107X_ASR_D02,
1044 TNETV107X_GPIO57,
1045 TNETV107X_ASR_D03,
1046 TNETV107X_GPIO58,
1047 TNETV107X_ASR_D04,
1048 TNETV107X_GPIO59_0,
1049 TNETV107X_ASR_D05,
1050 TNETV107X_GPIO60_0,
1051 TNETV107X_ASR_D06,
1052 TNETV107X_GPIO61_0,
1053 TNETV107X_ASR_D07,
1054 TNETV107X_GPIO62_0,
1055 TNETV107X_ASR_D08,
1056 TNETV107X_GPIO63_0,
1057 TNETV107X_ASR_D09,
1058 TNETV107X_GPIO64_0,
1059 TNETV107X_ASR_D10,
1060 TNETV107X_SDIO1_DATA3_1,
1061 TNETV107X_ASR_D11,
1062 TNETV107X_SDIO1_DATA2_1,
1063 TNETV107X_ASR_D12,
1064 TNETV107X_SDIO1_DATA1_1,
1065 TNETV107X_ASR_D13,
1066 TNETV107X_SDIO1_DATA0_1,
1067 TNETV107X_ASR_D14,
1068 TNETV107X_SDIO1_CMD_1,
1069 TNETV107X_ASR_D15,
1070 TNETV107X_SDIO1_CLK_1,
1071 TNETV107X_ASR_OE,
1072 TNETV107X_BOOT_STRP_2,
1073 TNETV107X_ASR_RNW,
1074 TNETV107X_GPIO29_0,
1075 TNETV107X_ASR_WAIT,
1076 TNETV107X_GPIO30_0,
1077 TNETV107X_ASR_WE,
1078 TNETV107X_BOOT_STRP_3,
1079 TNETV107X_ASR_WE_DQM0,
1080 TNETV107X_GPIO31,
1081 TNETV107X_LCD_PD17_0,
1082 TNETV107X_ASR_WE_DQM1,
1083 TNETV107X_ASR_BA0_0,
1084 TNETV107X_VLYNQ_CLK,
1085 TNETV107X_GPIO14,
1086 TNETV107X_LCD_PD19_0,
1087 TNETV107X_VLYNQ_RXD0,
1088 TNETV107X_GPIO15,
1089 TNETV107X_LCD_PD20_0,
1090 TNETV107X_VLYNQ_RXD1,
1091 TNETV107X_GPIO16,
1092 TNETV107X_LCD_PD21_0,
1093 TNETV107X_VLYNQ_TXD0,
1094 TNETV107X_GPIO17,
1095 TNETV107X_LCD_PD22_0,
1096 TNETV107X_VLYNQ_TXD1,
1097 TNETV107X_GPIO18,
1098 TNETV107X_LCD_PD23_0,
1099 TNETV107X_SDIO0_CLK,
1100 TNETV107X_GPIO19,
1101 TNETV107X_SDIO0_CMD,
1102 TNETV107X_GPIO20,
1103 TNETV107X_SDIO0_DATA0,
1104 TNETV107X_GPIO21,
1105 TNETV107X_SDIO0_DATA1,
1106 TNETV107X_GPIO22,
1107 TNETV107X_SDIO0_DATA2,
1108 TNETV107X_GPIO23,
1109 TNETV107X_SDIO0_DATA3,
1110 TNETV107X_GPIO24,
1111 TNETV107X_EMU0,
1112 TNETV107X_EMU1,
1113 TNETV107X_RTCK,
1114 TNETV107X_TRST_N,
1115 TNETV107X_TCK,
1116 TNETV107X_TDI,
1117 TNETV107X_TDO,
1118 TNETV107X_TMS,
1119 TNETV107X_TDM1_CLK,
1120 TNETV107X_TDM1_RX,
1121 TNETV107X_TDM1_TX,
1122 TNETV107X_TDM1_FS,
1123 TNETV107X_KEYPAD_R0,
1124 TNETV107X_KEYPAD_R1,
1125 TNETV107X_KEYPAD_R2,
1126 TNETV107X_KEYPAD_R3,
1127 TNETV107X_KEYPAD_R4,
1128 TNETV107X_KEYPAD_R5,
1129 TNETV107X_KEYPAD_R6,
1130 TNETV107X_GPIO12,
1131 TNETV107X_KEYPAD_R7,
1132 TNETV107X_GPIO10,
1133 TNETV107X_KEYPAD_C0,
1134 TNETV107X_KEYPAD_C1,
1135 TNETV107X_KEYPAD_C2,
1136 TNETV107X_KEYPAD_C3,
1137 TNETV107X_KEYPAD_C4,
1138 TNETV107X_KEYPAD_C5,
1139 TNETV107X_KEYPAD_C6,
1140 TNETV107X_GPIO13,
1141 TNETV107X_TEST_CLK_IN,
1142 TNETV107X_KEYPAD_C7,
1143 TNETV107X_GPIO11,
1144 TNETV107X_SSP0_0,
1145 TNETV107X_SCC_DCLK,
1146 TNETV107X_LCD_PD20_1,
1147 TNETV107X_SSP0_1,
1148 TNETV107X_SCC_CS_N,
1149 TNETV107X_LCD_PD21_1,
1150 TNETV107X_SSP0_2,
1151 TNETV107X_SCC_D,
1152 TNETV107X_LCD_PD22_1,
1153 TNETV107X_SSP0_3,
1154 TNETV107X_SCC_RESETN,
1155 TNETV107X_LCD_PD23_1,
1156 TNETV107X_SSP1_0,
1157 TNETV107X_GPIO25,
1158 TNETV107X_UART2_CTS,
1159 TNETV107X_SSP1_1,
1160 TNETV107X_GPIO26,
1161 TNETV107X_UART2_RD,
1162 TNETV107X_SSP1_2,
1163 TNETV107X_GPIO27,
1164 TNETV107X_UART2_RTS,
1165 TNETV107X_SSP1_3,
1166 TNETV107X_GPIO28,
1167 TNETV107X_UART2_TD,
1168 TNETV107X_UART0_CTS,
1169 TNETV107X_UART0_RD,
1170 TNETV107X_UART0_RTS,
1171 TNETV107X_UART0_TD,
1172 TNETV107X_UART1_RD,
1173 TNETV107X_UART1_TD,
1174 TNETV107X_LCD_AC_NCS,
1175 TNETV107X_LCD_HSYNC_RNW,
1176 TNETV107X_LCD_VSYNC_A0,
1177 TNETV107X_LCD_MCLK,
1178 TNETV107X_LCD_PD16_0,
1179 TNETV107X_LCD_PCLK_E,
1180 TNETV107X_LCD_PD00,
1181 TNETV107X_LCD_PD01,
1182 TNETV107X_LCD_PD02,
1183 TNETV107X_LCD_PD03,
1184 TNETV107X_LCD_PD04,
1185 TNETV107X_LCD_PD05,
1186 TNETV107X_LCD_PD06,
1187 TNETV107X_LCD_PD07,
1188 TNETV107X_LCD_PD08,
1189 TNETV107X_GPIO59_1,
1190 TNETV107X_LCD_PD09,
1191 TNETV107X_GPIO60_1,
1192 TNETV107X_LCD_PD10,
1193 TNETV107X_ASR_BA0_1,
1194 TNETV107X_GPIO61_1,
1195 TNETV107X_LCD_PD11,
1196 TNETV107X_GPIO62_1,
1197 TNETV107X_LCD_PD12,
1198 TNETV107X_GPIO63_1,
1199 TNETV107X_LCD_PD13,
1200 TNETV107X_GPIO64_1,
1201 TNETV107X_LCD_PD14,
1202 TNETV107X_GPIO29_1,
1203 TNETV107X_LCD_PD15,
1204 TNETV107X_GPIO30_1,
1205 TNETV107X_EINT0,
1206 TNETV107X_GPIO08,
1207 TNETV107X_EINT1,
1208 TNETV107X_GPIO09,
1209 TNETV107X_GPIO00,
1210 TNETV107X_LCD_PD20_2,
1211 TNETV107X_TDM_CLK_IN_2,
1212 TNETV107X_GPIO01,
1213 TNETV107X_LCD_PD21_2,
1214 TNETV107X_24M_CLK_OUT_1,
1215 TNETV107X_GPIO02,
1216 TNETV107X_LCD_PD22_2,
1217 TNETV107X_GPIO03,
1218 TNETV107X_LCD_PD23_2,
1219 TNETV107X_GPIO04,
1220 TNETV107X_LCD_PD16_1,
1221 TNETV107X_USB0_RXERR,
1222 TNETV107X_GPIO05,
1223 TNETV107X_LCD_PD17_1,
1224 TNETV107X_TDM_CLK_IN_1,
1225 TNETV107X_GPIO06,
1226 TNETV107X_LCD_PD18,
1227 TNETV107X_24M_CLK_OUT_2,
1228 TNETV107X_GPIO07,
1229 TNETV107X_LCD_PD19_1,
1230 TNETV107X_USB1_RXERR,
1231 TNETV107X_ETH_PLL_CLK,
1232 TNETV107X_MDIO,
1233 TNETV107X_MDC,
1234 TNETV107X_AIC_MUTE_STAT_N,
1235 TNETV107X_TDM0_CLK,
1236 TNETV107X_AIC_HNS_EN_N,
1237 TNETV107X_TDM0_FS,
1238 TNETV107X_AIC_HDS_EN_STAT_N,
1239 TNETV107X_TDM0_TX,
1240 TNETV107X_AIC_HNF_EN_STAT_N,
1241 TNETV107X_TDM0_RX,
1242};
1243
1244#define PINMUX(x) (4 * (x)) 975#define PINMUX(x) (4 * (x))
1245 976
1246#ifdef CONFIG_DAVINCI_MUX 977#ifdef CONFIG_DAVINCI_MUX
diff --git a/arch/arm/mach-davinci/include/mach/psc.h b/arch/arm/mach-davinci/include/mach/psc.h
index 0a22710493fd..99d47cfa301f 100644
--- a/arch/arm/mach-davinci/include/mach/psc.h
+++ b/arch/arm/mach-davinci/include/mach/psc.h
@@ -182,53 +182,6 @@
182#define DA8XX_LPSC1_CR_P3_SS 26 182#define DA8XX_LPSC1_CR_P3_SS 26
183#define DA8XX_LPSC1_L3_CBA_RAM 31 183#define DA8XX_LPSC1_L3_CBA_RAM 31
184 184
185/* TNETV107X LPSC Assignments */
186#define TNETV107X_LPSC_ARM 0
187#define TNETV107X_LPSC_GEM 1
188#define TNETV107X_LPSC_DDR2_PHY 2
189#define TNETV107X_LPSC_TPCC 3
190#define TNETV107X_LPSC_TPTC0 4
191#define TNETV107X_LPSC_TPTC1 5
192#define TNETV107X_LPSC_RAM 6
193#define TNETV107X_LPSC_MBX_LITE 7
194#define TNETV107X_LPSC_LCD 8
195#define TNETV107X_LPSC_ETHSS 9
196#define TNETV107X_LPSC_AEMIF 10
197#define TNETV107X_LPSC_CHIP_CFG 11
198#define TNETV107X_LPSC_TSC 12
199#define TNETV107X_LPSC_ROM 13
200#define TNETV107X_LPSC_UART2 14
201#define TNETV107X_LPSC_PKTSEC 15
202#define TNETV107X_LPSC_SECCTL 16
203#define TNETV107X_LPSC_KEYMGR 17
204#define TNETV107X_LPSC_KEYPAD 18
205#define TNETV107X_LPSC_GPIO 19
206#define TNETV107X_LPSC_MDIO 20
207#define TNETV107X_LPSC_SDIO0 21
208#define TNETV107X_LPSC_UART0 22
209#define TNETV107X_LPSC_UART1 23
210#define TNETV107X_LPSC_TIMER0 24
211#define TNETV107X_LPSC_TIMER1 25
212#define TNETV107X_LPSC_WDT_ARM 26
213#define TNETV107X_LPSC_WDT_DSP 27
214#define TNETV107X_LPSC_SSP 28
215#define TNETV107X_LPSC_TDM0 29
216#define TNETV107X_LPSC_VLYNQ 30
217#define TNETV107X_LPSC_MCDMA 31
218#define TNETV107X_LPSC_USB0 32
219#define TNETV107X_LPSC_TDM1 33
220#define TNETV107X_LPSC_DEBUGSS 34
221#define TNETV107X_LPSC_ETHSS_RGMII 35
222#define TNETV107X_LPSC_SYSTEM 36
223#define TNETV107X_LPSC_IMCOP 37
224#define TNETV107X_LPSC_SPARE 38
225#define TNETV107X_LPSC_SDIO1 39
226#define TNETV107X_LPSC_USB1 40
227#define TNETV107X_LPSC_USBSS 41
228#define TNETV107X_LPSC_DDR2_EMIF1_VRST 42
229#define TNETV107X_LPSC_DDR2_EMIF2_VCTL_RST 43
230#define TNETV107X_LPSC_MAX 44
231
232/* PSC register offsets */ 185/* PSC register offsets */
233#define EPCPR 0x070 186#define EPCPR 0x070
234#define PTCMD 0x120 187#define PTCMD 0x120
diff --git a/arch/arm/mach-davinci/include/mach/serial.h b/arch/arm/mach-davinci/include/mach/serial.h
index ce402cd21fa0..d4b4aa87964f 100644
--- a/arch/arm/mach-davinci/include/mach/serial.h
+++ b/arch/arm/mach-davinci/include/mach/serial.h
@@ -23,14 +23,6 @@
23#define DA8XX_UART1_BASE (IO_PHYS + 0x10c000) 23#define DA8XX_UART1_BASE (IO_PHYS + 0x10c000)
24#define DA8XX_UART2_BASE (IO_PHYS + 0x10d000) 24#define DA8XX_UART2_BASE (IO_PHYS + 0x10d000)
25 25
26#define TNETV107X_UART0_BASE 0x08108100
27#define TNETV107X_UART1_BASE 0x08088400
28#define TNETV107X_UART2_BASE 0x08108300
29
30#define TNETV107X_UART0_VIRT IOMEM(0xfee08100)
31#define TNETV107X_UART1_VIRT IOMEM(0xfed88400)
32#define TNETV107X_UART2_VIRT IOMEM(0xfee08300)
33
34/* DaVinci UART register offsets */ 26/* DaVinci UART register offsets */
35#define UART_DAVINCI_PWREMU 0x0c 27#define UART_DAVINCI_PWREMU 0x0c
36#define UART_DM646X_SCR 0x10 28#define UART_DM646X_SCR 0x10
diff --git a/arch/arm/mach-davinci/include/mach/timex.h b/arch/arm/mach-davinci/include/mach/timex.h
deleted file mode 100644
index 9b885298f106..000000000000
--- a/arch/arm/mach-davinci/include/mach/timex.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * DaVinci timer defines
3 *
4 * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
5 *
6 * 2007 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11#ifndef __ASM_ARCH_TIMEX_H
12#define __ASM_ARCH_TIMEX_H
13
14/*
15 * Alert: Not all timers of the DaVinci family run at a frequency of 27MHz,
16 * but we should be fine as long as CLOCK_TICK_RATE or LATCH (see include/
17 * linux/jiffies.h) are not used directly in code. Currently none of the
18 * code relevant to DaVinci platform depends on these values directly.
19 */
20#define CLOCK_TICK_RATE 27000000
21
22#endif /* __ASM_ARCH_TIMEX_H__ */
diff --git a/arch/arm/mach-davinci/include/mach/tnetv107x.h b/arch/arm/mach-davinci/include/mach/tnetv107x.h
deleted file mode 100644
index 494fcf5ccfe1..000000000000
--- a/arch/arm/mach-davinci/include/mach/tnetv107x.h
+++ /dev/null
@@ -1,61 +0,0 @@
1/*
2 * Texas Instruments TNETV107X SoC Specific Defines
3 *
4 * Copyright (C) 2010 Texas Instruments
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.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15#ifndef __ASM_ARCH_DAVINCI_TNETV107X_H
16#define __ASM_ARCH_DAVINCI_TNETV107X_H
17
18#include <asm/sizes.h>
19
20#define TNETV107X_DDR_BASE 0x80000000
21
22/*
23 * Fixed mapping for early init starts here. If low-level debug is enabled,
24 * this area also gets mapped via io_pg_offset and io_phys by the boot code.
25 * To fit in with the io_pg_offset calculation, the io base address selected
26 * here _must_ be a multiple of 2^20.
27 */
28#define TNETV107X_IO_BASE 0x08000000
29#define TNETV107X_IO_VIRT (IO_VIRT + SZ_1M)
30
31#define TNETV107X_N_GPIO 65
32
33#ifndef __ASSEMBLY__
34
35#include <linux/serial_8250.h>
36#include <linux/input/matrix_keypad.h>
37#include <linux/mfd/ti_ssp.h>
38#include <linux/reboot.h>
39
40#include <linux/platform_data/mmc-davinci.h>
41#include <linux/platform_data/mtd-davinci.h>
42#include <mach/serial.h>
43
44struct tnetv107x_device_info {
45 struct davinci_mmc_config *mmc_config[2]; /* 2 controllers */
46 struct davinci_nand_pdata *nand_config[4]; /* 4 chipsels */
47 struct matrix_keypad_platform_data *keypad_config;
48 struct ti_ssp_data *ssp_config;
49};
50
51extern struct platform_device tnetv107x_wdt_device;
52extern struct platform_device tnetv107x_serial_device[];
53
54extern void tnetv107x_init(void);
55extern void tnetv107x_devices_init(struct tnetv107x_device_info *);
56extern void tnetv107x_irq_init(void);
57void tnetv107x_restart(enum reboot_mode mode, const char *cmd);
58
59#endif
60
61#endif /* __ASM_ARCH_DAVINCI_TNETV107X_H */
diff --git a/arch/arm/mach-davinci/include/mach/uncompress.h b/arch/arm/mach-davinci/include/mach/uncompress.h
index f49c2916aa3a..8fb97b93b6bb 100644
--- a/arch/arm/mach-davinci/include/mach/uncompress.h
+++ b/arch/arm/mach-davinci/include/mach/uncompress.h
@@ -68,9 +68,6 @@ static inline void set_uart_info(u32 phys)
68#define DEBUG_LL_DA8XX(machine, port) \ 68#define DEBUG_LL_DA8XX(machine, port) \
69 _DEBUG_LL_ENTRY(machine, DA8XX_UART##port##_BASE) 69 _DEBUG_LL_ENTRY(machine, DA8XX_UART##port##_BASE)
70 70
71#define DEBUG_LL_TNETV107X(machine, port) \
72 _DEBUG_LL_ENTRY(machine, TNETV107X_UART##port##_BASE)
73
74static inline void __arch_decomp_setup(unsigned long arch_id) 71static inline void __arch_decomp_setup(unsigned long arch_id)
75{ 72{
76 /* 73 /*
@@ -94,9 +91,6 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
94 DEBUG_LL_DA8XX(davinci_da850_evm, 2); 91 DEBUG_LL_DA8XX(davinci_da850_evm, 2);
95 DEBUG_LL_DA8XX(mityomapl138, 1); 92 DEBUG_LL_DA8XX(mityomapl138, 1);
96 DEBUG_LL_DA8XX(omapl138_hawkboard, 2); 93 DEBUG_LL_DA8XX(omapl138_hawkboard, 2);
97
98 /* TNETV107x boards */
99 DEBUG_LL_TNETV107X(tnetv107x, 1);
100 } while (0); 94 } while (0);
101} 95}
102 96
diff --git a/arch/arm/mach-davinci/tnetv107x.c b/arch/arm/mach-davinci/tnetv107x.c
deleted file mode 100644
index f4d7fbb24b3b..000000000000
--- a/arch/arm/mach-davinci/tnetv107x.c
+++ /dev/null
@@ -1,766 +0,0 @@
1/*
2 * Texas Instruments TNETV107X SoC Support
3 *
4 * Copyright (C) 2010 Texas Instruments
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.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15#include <linux/gpio.h>
16#include <linux/kernel.h>
17#include <linux/init.h>
18#include <linux/clk.h>
19#include <linux/io.h>
20#include <linux/err.h>
21#include <linux/platform_device.h>
22#include <linux/reboot.h>
23
24#include <asm/mach/map.h>
25
26#include <mach/common.h>
27#include <mach/time.h>
28#include <mach/cputype.h>
29#include <mach/psc.h>
30#include <mach/cp_intc.h>
31#include <mach/irqs.h>
32#include <mach/hardware.h>
33#include <mach/tnetv107x.h>
34#include <mach/gpio-davinci.h>
35
36#include "clock.h"
37#include "mux.h"
38
39/* Base addresses for on-chip devices */
40#define TNETV107X_INTC_BASE 0x03000000
41#define TNETV107X_TIMER0_BASE 0x08086500
42#define TNETV107X_TIMER1_BASE 0x08086600
43#define TNETV107X_CHIP_CFG_BASE 0x08087000
44#define TNETV107X_GPIO_BASE 0x08088000
45#define TNETV107X_CLOCK_CONTROL_BASE 0x0808a000
46#define TNETV107X_PSC_BASE 0x0808b000
47
48/* Reference clock frequencies */
49#define OSC_FREQ_ONCHIP (24000 * 1000)
50#define OSC_FREQ_OFFCHIP_SYS (25000 * 1000)
51#define OSC_FREQ_OFFCHIP_ETH (25000 * 1000)
52#define OSC_FREQ_OFFCHIP_TDM (19200 * 1000)
53
54#define N_PLLS 3
55
56/* Clock Control Registers */
57struct clk_ctrl_regs {
58 u32 pll_bypass;
59 u32 _reserved0;
60 u32 gem_lrst;
61 u32 _reserved1;
62 u32 pll_unlock_stat;
63 u32 sys_unlock;
64 u32 eth_unlock;
65 u32 tdm_unlock;
66};
67
68/* SSPLL Registers */
69struct sspll_regs {
70 u32 modes;
71 u32 post_div;
72 u32 pre_div;
73 u32 mult_factor;
74 u32 divider_range;
75 u32 bw_divider;
76 u32 spr_amount;
77 u32 spr_rate_div;
78 u32 diag;
79};
80
81/* Watchdog Timer Registers */
82struct wdt_regs {
83 u32 kick_lock;
84 u32 kick;
85 u32 change_lock;
86 u32 change ;
87 u32 disable_lock;
88 u32 disable;
89 u32 prescale_lock;
90 u32 prescale;
91};
92
93static struct clk_ctrl_regs __iomem *clk_ctrl_regs;
94
95static struct sspll_regs __iomem *sspll_regs[N_PLLS];
96static int sspll_regs_base[N_PLLS] = { 0x40, 0x80, 0xc0 };
97
98/* PLL bypass bit shifts in clk_ctrl_regs->pll_bypass register */
99static u32 bypass_mask[N_PLLS] = { BIT(0), BIT(2), BIT(1) };
100
101/* offchip (external) reference clock frequencies */
102static u32 pll_ext_freq[] = {
103 OSC_FREQ_OFFCHIP_SYS,
104 OSC_FREQ_OFFCHIP_TDM,
105 OSC_FREQ_OFFCHIP_ETH
106};
107
108/* PSC control registers */
109static u32 psc_regs[] = { TNETV107X_PSC_BASE };
110
111/* Host map for interrupt controller */
112static u32 intc_host_map[] = { 0x01010000, 0x01010101, -1 };
113
114static unsigned long clk_sspll_recalc(struct clk *clk);
115
116/* Level 1 - the PLLs */
117#define define_pll_clk(cname, pll, divmask, base) \
118 static struct pll_data pll_##cname##_data = { \
119 .num = pll, \
120 .div_ratio_mask = divmask, \
121 .phys_base = base + \
122 TNETV107X_CLOCK_CONTROL_BASE, \
123 }; \
124 static struct clk pll_##cname##_clk = { \
125 .name = "pll_" #cname "_clk", \
126 .pll_data = &pll_##cname##_data, \
127 .flags = CLK_PLL, \
128 .recalc = clk_sspll_recalc, \
129 }
130
131define_pll_clk(sys, 0, 0x1ff, 0x600);
132define_pll_clk(tdm, 1, 0x0ff, 0x200);
133define_pll_clk(eth, 2, 0x0ff, 0x400);
134
135/* Level 2 - divided outputs from the PLLs */
136#define define_pll_div_clk(pll, cname, div) \
137 static struct clk pll##_##cname##_clk = { \
138 .name = #pll "_" #cname "_clk", \
139 .parent = &pll_##pll##_clk, \
140 .flags = CLK_PLL, \
141 .div_reg = PLLDIV##div, \
142 .set_rate = davinci_set_sysclk_rate, \
143 }
144
145define_pll_div_clk(sys, arm1176, 1);
146define_pll_div_clk(sys, dsp, 2);
147define_pll_div_clk(sys, ddr, 3);
148define_pll_div_clk(sys, full, 4);
149define_pll_div_clk(sys, lcd, 5);
150define_pll_div_clk(sys, vlynq_ref, 6);
151define_pll_div_clk(sys, tsc, 7);
152define_pll_div_clk(sys, half, 8);
153
154define_pll_div_clk(eth, 5mhz, 1);
155define_pll_div_clk(eth, 50mhz, 2);
156define_pll_div_clk(eth, 125mhz, 3);
157define_pll_div_clk(eth, 250mhz, 4);
158define_pll_div_clk(eth, 25mhz, 5);
159
160define_pll_div_clk(tdm, 0, 1);
161define_pll_div_clk(tdm, extra, 2);
162define_pll_div_clk(tdm, 1, 3);
163
164
165/* Level 3 - LPSC gated clocks */
166#define __lpsc_clk(cname, _parent, mod, flg) \
167 static struct clk clk_##cname = { \
168 .name = #cname, \
169 .parent = &_parent, \
170 .lpsc = TNETV107X_LPSC_##mod,\
171 .flags = flg, \
172 }
173
174#define lpsc_clk_enabled(cname, parent, mod) \
175 __lpsc_clk(cname, parent, mod, ALWAYS_ENABLED)
176
177#define lpsc_clk(cname, parent, mod) \
178 __lpsc_clk(cname, parent, mod, 0)
179
180lpsc_clk_enabled(arm, sys_arm1176_clk, ARM);
181lpsc_clk_enabled(gem, sys_dsp_clk, GEM);
182lpsc_clk_enabled(ddr2_phy, sys_ddr_clk, DDR2_PHY);
183lpsc_clk_enabled(tpcc, sys_full_clk, TPCC);
184lpsc_clk_enabled(tptc0, sys_full_clk, TPTC0);
185lpsc_clk_enabled(tptc1, sys_full_clk, TPTC1);
186lpsc_clk_enabled(ram, sys_full_clk, RAM);
187lpsc_clk_enabled(aemif, sys_full_clk, AEMIF);
188lpsc_clk_enabled(chipcfg, sys_half_clk, CHIP_CFG);
189lpsc_clk_enabled(rom, sys_half_clk, ROM);
190lpsc_clk_enabled(secctl, sys_half_clk, SECCTL);
191lpsc_clk_enabled(keymgr, sys_half_clk, KEYMGR);
192lpsc_clk_enabled(gpio, sys_half_clk, GPIO);
193lpsc_clk_enabled(debugss, sys_half_clk, DEBUGSS);
194lpsc_clk_enabled(system, sys_half_clk, SYSTEM);
195lpsc_clk_enabled(ddr2_vrst, sys_ddr_clk, DDR2_EMIF1_VRST);
196lpsc_clk_enabled(ddr2_vctl_rst, sys_ddr_clk, DDR2_EMIF2_VCTL_RST);
197lpsc_clk_enabled(wdt_arm, sys_half_clk, WDT_ARM);
198lpsc_clk_enabled(timer1, sys_half_clk, TIMER1);
199
200lpsc_clk(mbx_lite, sys_arm1176_clk, MBX_LITE);
201lpsc_clk(ethss, eth_125mhz_clk, ETHSS);
202lpsc_clk(tsc, sys_tsc_clk, TSC);
203lpsc_clk(uart0, sys_half_clk, UART0);
204lpsc_clk(uart1, sys_half_clk, UART1);
205lpsc_clk(uart2, sys_half_clk, UART2);
206lpsc_clk(pktsec, sys_half_clk, PKTSEC);
207lpsc_clk(keypad, sys_half_clk, KEYPAD);
208lpsc_clk(mdio, sys_half_clk, MDIO);
209lpsc_clk(sdio0, sys_half_clk, SDIO0);
210lpsc_clk(sdio1, sys_half_clk, SDIO1);
211lpsc_clk(timer0, sys_half_clk, TIMER0);
212lpsc_clk(wdt_dsp, sys_half_clk, WDT_DSP);
213lpsc_clk(ssp, sys_half_clk, SSP);
214lpsc_clk(tdm0, tdm_0_clk, TDM0);
215lpsc_clk(tdm1, tdm_1_clk, TDM1);
216lpsc_clk(vlynq, sys_vlynq_ref_clk, VLYNQ);
217lpsc_clk(mcdma, sys_half_clk, MCDMA);
218lpsc_clk(usbss, sys_half_clk, USBSS);
219lpsc_clk(usb0, clk_usbss, USB0);
220lpsc_clk(usb1, clk_usbss, USB1);
221lpsc_clk(ethss_rgmii, eth_250mhz_clk, ETHSS_RGMII);
222lpsc_clk(imcop, sys_dsp_clk, IMCOP);
223lpsc_clk(spare, sys_half_clk, SPARE);
224
225/* LCD needs a full power down to clear controller state */
226__lpsc_clk(lcd, sys_lcd_clk, LCD, PSC_SWRSTDISABLE);
227
228
229/* Level 4 - leaf clocks for LPSC modules shared across drivers */
230static struct clk clk_rng = { .name = "rng", .parent = &clk_pktsec };
231static struct clk clk_pka = { .name = "pka", .parent = &clk_pktsec };
232
233static struct clk_lookup clks[] = {
234 CLK(NULL, "pll_sys_clk", &pll_sys_clk),
235 CLK(NULL, "pll_eth_clk", &pll_eth_clk),
236 CLK(NULL, "pll_tdm_clk", &pll_tdm_clk),
237 CLK(NULL, "sys_arm1176_clk", &sys_arm1176_clk),
238 CLK(NULL, "sys_dsp_clk", &sys_dsp_clk),
239 CLK(NULL, "sys_ddr_clk", &sys_ddr_clk),
240 CLK(NULL, "sys_full_clk", &sys_full_clk),
241 CLK(NULL, "sys_lcd_clk", &sys_lcd_clk),
242 CLK(NULL, "sys_vlynq_ref_clk", &sys_vlynq_ref_clk),
243 CLK(NULL, "sys_tsc_clk", &sys_tsc_clk),
244 CLK(NULL, "sys_half_clk", &sys_half_clk),
245 CLK(NULL, "eth_5mhz_clk", &eth_5mhz_clk),
246 CLK(NULL, "eth_50mhz_clk", &eth_50mhz_clk),
247 CLK(NULL, "eth_125mhz_clk", &eth_125mhz_clk),
248 CLK(NULL, "eth_250mhz_clk", &eth_250mhz_clk),
249 CLK(NULL, "eth_25mhz_clk", &eth_25mhz_clk),
250 CLK(NULL, "tdm_0_clk", &tdm_0_clk),
251 CLK(NULL, "tdm_extra_clk", &tdm_extra_clk),
252 CLK(NULL, "tdm_1_clk", &tdm_1_clk),
253 CLK(NULL, "clk_arm", &clk_arm),
254 CLK(NULL, "clk_gem", &clk_gem),
255 CLK(NULL, "clk_ddr2_phy", &clk_ddr2_phy),
256 CLK(NULL, "clk_tpcc", &clk_tpcc),
257 CLK(NULL, "clk_tptc0", &clk_tptc0),
258 CLK(NULL, "clk_tptc1", &clk_tptc1),
259 CLK(NULL, "clk_ram", &clk_ram),
260 CLK(NULL, "clk_mbx_lite", &clk_mbx_lite),
261 CLK("tnetv107x-fb.0", NULL, &clk_lcd),
262 CLK(NULL, "clk_ethss", &clk_ethss),
263 CLK(NULL, "aemif", &clk_aemif),
264 CLK(NULL, "clk_chipcfg", &clk_chipcfg),
265 CLK("tnetv107x-ts.0", NULL, &clk_tsc),
266 CLK(NULL, "clk_rom", &clk_rom),
267 CLK("serial8250.2", NULL, &clk_uart2),
268 CLK(NULL, "clk_pktsec", &clk_pktsec),
269 CLK("tnetv107x-rng.0", NULL, &clk_rng),
270 CLK("tnetv107x-pka.0", NULL, &clk_pka),
271 CLK(NULL, "clk_secctl", &clk_secctl),
272 CLK(NULL, "clk_keymgr", &clk_keymgr),
273 CLK("tnetv107x-keypad.0", NULL, &clk_keypad),
274 CLK(NULL, "clk_gpio", &clk_gpio),
275 CLK(NULL, "clk_mdio", &clk_mdio),
276 CLK("dm6441-mmc.0", NULL, &clk_sdio0),
277 CLK("serial8250.0", NULL, &clk_uart0),
278 CLK("serial8250.1", NULL, &clk_uart1),
279 CLK(NULL, "timer0", &clk_timer0),
280 CLK(NULL, "timer1", &clk_timer1),
281 CLK("tnetv107x_wdt.0", NULL, &clk_wdt_arm),
282 CLK(NULL, "clk_wdt_dsp", &clk_wdt_dsp),
283 CLK("ti-ssp", NULL, &clk_ssp),
284 CLK(NULL, "clk_tdm0", &clk_tdm0),
285 CLK(NULL, "clk_vlynq", &clk_vlynq),
286 CLK(NULL, "clk_mcdma", &clk_mcdma),
287 CLK(NULL, "clk_usbss", &clk_usbss),
288 CLK(NULL, "clk_usb0", &clk_usb0),
289 CLK(NULL, "clk_usb1", &clk_usb1),
290 CLK(NULL, "clk_tdm1", &clk_tdm1),
291 CLK(NULL, "clk_debugss", &clk_debugss),
292 CLK(NULL, "clk_ethss_rgmii", &clk_ethss_rgmii),
293 CLK(NULL, "clk_system", &clk_system),
294 CLK(NULL, "clk_imcop", &clk_imcop),
295 CLK(NULL, "clk_spare", &clk_spare),
296 CLK("dm6441-mmc.1", NULL, &clk_sdio1),
297 CLK(NULL, "clk_ddr2_vrst", &clk_ddr2_vrst),
298 CLK(NULL, "clk_ddr2_vctl_rst", &clk_ddr2_vctl_rst),
299 CLK(NULL, NULL, NULL),
300};
301
302static const struct mux_config pins[] = {
303#ifdef CONFIG_DAVINCI_MUX
304 MUX_CFG(TNETV107X, ASR_A00, 0, 0, 0x1f, 0x00, false)
305 MUX_CFG(TNETV107X, GPIO32, 0, 0, 0x1f, 0x04, false)
306 MUX_CFG(TNETV107X, ASR_A01, 0, 5, 0x1f, 0x00, false)
307 MUX_CFG(TNETV107X, GPIO33, 0, 5, 0x1f, 0x04, false)
308 MUX_CFG(TNETV107X, ASR_A02, 0, 10, 0x1f, 0x00, false)
309 MUX_CFG(TNETV107X, GPIO34, 0, 10, 0x1f, 0x04, false)
310 MUX_CFG(TNETV107X, ASR_A03, 0, 15, 0x1f, 0x00, false)
311 MUX_CFG(TNETV107X, GPIO35, 0, 15, 0x1f, 0x04, false)
312 MUX_CFG(TNETV107X, ASR_A04, 0, 20, 0x1f, 0x00, false)
313 MUX_CFG(TNETV107X, GPIO36, 0, 20, 0x1f, 0x04, false)
314 MUX_CFG(TNETV107X, ASR_A05, 0, 25, 0x1f, 0x00, false)
315 MUX_CFG(TNETV107X, GPIO37, 0, 25, 0x1f, 0x04, false)
316 MUX_CFG(TNETV107X, ASR_A06, 1, 0, 0x1f, 0x00, false)
317 MUX_CFG(TNETV107X, GPIO38, 1, 0, 0x1f, 0x04, false)
318 MUX_CFG(TNETV107X, ASR_A07, 1, 5, 0x1f, 0x00, false)
319 MUX_CFG(TNETV107X, GPIO39, 1, 5, 0x1f, 0x04, false)
320 MUX_CFG(TNETV107X, ASR_A08, 1, 10, 0x1f, 0x00, false)
321 MUX_CFG(TNETV107X, GPIO40, 1, 10, 0x1f, 0x04, false)
322 MUX_CFG(TNETV107X, ASR_A09, 1, 15, 0x1f, 0x00, false)
323 MUX_CFG(TNETV107X, GPIO41, 1, 15, 0x1f, 0x04, false)
324 MUX_CFG(TNETV107X, ASR_A10, 1, 20, 0x1f, 0x00, false)
325 MUX_CFG(TNETV107X, GPIO42, 1, 20, 0x1f, 0x04, false)
326 MUX_CFG(TNETV107X, ASR_A11, 1, 25, 0x1f, 0x00, false)
327 MUX_CFG(TNETV107X, BOOT_STRP_0, 1, 25, 0x1f, 0x04, false)
328 MUX_CFG(TNETV107X, ASR_A12, 2, 0, 0x1f, 0x00, false)
329 MUX_CFG(TNETV107X, BOOT_STRP_1, 2, 0, 0x1f, 0x04, false)
330 MUX_CFG(TNETV107X, ASR_A13, 2, 5, 0x1f, 0x00, false)
331 MUX_CFG(TNETV107X, GPIO43, 2, 5, 0x1f, 0x04, false)
332 MUX_CFG(TNETV107X, ASR_A14, 2, 10, 0x1f, 0x00, false)
333 MUX_CFG(TNETV107X, GPIO44, 2, 10, 0x1f, 0x04, false)
334 MUX_CFG(TNETV107X, ASR_A15, 2, 15, 0x1f, 0x00, false)
335 MUX_CFG(TNETV107X, GPIO45, 2, 15, 0x1f, 0x04, false)
336 MUX_CFG(TNETV107X, ASR_A16, 2, 20, 0x1f, 0x00, false)
337 MUX_CFG(TNETV107X, GPIO46, 2, 20, 0x1f, 0x04, false)
338 MUX_CFG(TNETV107X, ASR_A17, 2, 25, 0x1f, 0x00, false)
339 MUX_CFG(TNETV107X, GPIO47, 2, 25, 0x1f, 0x04, false)
340 MUX_CFG(TNETV107X, ASR_A18, 3, 0, 0x1f, 0x00, false)
341 MUX_CFG(TNETV107X, GPIO48, 3, 0, 0x1f, 0x04, false)
342 MUX_CFG(TNETV107X, SDIO1_DATA3_0, 3, 0, 0x1f, 0x1c, false)
343 MUX_CFG(TNETV107X, ASR_A19, 3, 5, 0x1f, 0x00, false)
344 MUX_CFG(TNETV107X, GPIO49, 3, 5, 0x1f, 0x04, false)
345 MUX_CFG(TNETV107X, SDIO1_DATA2_0, 3, 5, 0x1f, 0x1c, false)
346 MUX_CFG(TNETV107X, ASR_A20, 3, 10, 0x1f, 0x00, false)
347 MUX_CFG(TNETV107X, GPIO50, 3, 10, 0x1f, 0x04, false)
348 MUX_CFG(TNETV107X, SDIO1_DATA1_0, 3, 10, 0x1f, 0x1c, false)
349 MUX_CFG(TNETV107X, ASR_A21, 3, 15, 0x1f, 0x00, false)
350 MUX_CFG(TNETV107X, GPIO51, 3, 15, 0x1f, 0x04, false)
351 MUX_CFG(TNETV107X, SDIO1_DATA0_0, 3, 15, 0x1f, 0x1c, false)
352 MUX_CFG(TNETV107X, ASR_A22, 3, 20, 0x1f, 0x00, false)
353 MUX_CFG(TNETV107X, GPIO52, 3, 20, 0x1f, 0x04, false)
354 MUX_CFG(TNETV107X, SDIO1_CMD_0, 3, 20, 0x1f, 0x1c, false)
355 MUX_CFG(TNETV107X, ASR_A23, 3, 25, 0x1f, 0x00, false)
356 MUX_CFG(TNETV107X, GPIO53, 3, 25, 0x1f, 0x04, false)
357 MUX_CFG(TNETV107X, SDIO1_CLK_0, 3, 25, 0x1f, 0x1c, false)
358 MUX_CFG(TNETV107X, ASR_BA_1, 4, 0, 0x1f, 0x00, false)
359 MUX_CFG(TNETV107X, GPIO54, 4, 0, 0x1f, 0x04, false)
360 MUX_CFG(TNETV107X, SYS_PLL_CLK, 4, 0, 0x1f, 0x1c, false)
361 MUX_CFG(TNETV107X, ASR_CS0, 4, 5, 0x1f, 0x00, false)
362 MUX_CFG(TNETV107X, ASR_CS1, 4, 10, 0x1f, 0x00, false)
363 MUX_CFG(TNETV107X, ASR_CS2, 4, 15, 0x1f, 0x00, false)
364 MUX_CFG(TNETV107X, TDM_PLL_CLK, 4, 15, 0x1f, 0x1c, false)
365 MUX_CFG(TNETV107X, ASR_CS3, 4, 20, 0x1f, 0x00, false)
366 MUX_CFG(TNETV107X, ETH_PHY_CLK, 4, 20, 0x1f, 0x0c, false)
367 MUX_CFG(TNETV107X, ASR_D00, 4, 25, 0x1f, 0x00, false)
368 MUX_CFG(TNETV107X, GPIO55, 4, 25, 0x1f, 0x1c, false)
369 MUX_CFG(TNETV107X, ASR_D01, 5, 0, 0x1f, 0x00, false)
370 MUX_CFG(TNETV107X, GPIO56, 5, 0, 0x1f, 0x1c, false)
371 MUX_CFG(TNETV107X, ASR_D02, 5, 5, 0x1f, 0x00, false)
372 MUX_CFG(TNETV107X, GPIO57, 5, 5, 0x1f, 0x1c, false)
373 MUX_CFG(TNETV107X, ASR_D03, 5, 10, 0x1f, 0x00, false)
374 MUX_CFG(TNETV107X, GPIO58, 5, 10, 0x1f, 0x1c, false)
375 MUX_CFG(TNETV107X, ASR_D04, 5, 15, 0x1f, 0x00, false)
376 MUX_CFG(TNETV107X, GPIO59_0, 5, 15, 0x1f, 0x1c, false)
377 MUX_CFG(TNETV107X, ASR_D05, 5, 20, 0x1f, 0x00, false)
378 MUX_CFG(TNETV107X, GPIO60_0, 5, 20, 0x1f, 0x1c, false)
379 MUX_CFG(TNETV107X, ASR_D06, 5, 25, 0x1f, 0x00, false)
380 MUX_CFG(TNETV107X, GPIO61_0, 5, 25, 0x1f, 0x1c, false)
381 MUX_CFG(TNETV107X, ASR_D07, 6, 0, 0x1f, 0x00, false)
382 MUX_CFG(TNETV107X, GPIO62_0, 6, 0, 0x1f, 0x1c, false)
383 MUX_CFG(TNETV107X, ASR_D08, 6, 5, 0x1f, 0x00, false)
384 MUX_CFG(TNETV107X, GPIO63_0, 6, 5, 0x1f, 0x1c, false)
385 MUX_CFG(TNETV107X, ASR_D09, 6, 10, 0x1f, 0x00, false)
386 MUX_CFG(TNETV107X, GPIO64_0, 6, 10, 0x1f, 0x1c, false)
387 MUX_CFG(TNETV107X, ASR_D10, 6, 15, 0x1f, 0x00, false)
388 MUX_CFG(TNETV107X, SDIO1_DATA3_1, 6, 15, 0x1f, 0x1c, false)
389 MUX_CFG(TNETV107X, ASR_D11, 6, 20, 0x1f, 0x00, false)
390 MUX_CFG(TNETV107X, SDIO1_DATA2_1, 6, 20, 0x1f, 0x1c, false)
391 MUX_CFG(TNETV107X, ASR_D12, 6, 25, 0x1f, 0x00, false)
392 MUX_CFG(TNETV107X, SDIO1_DATA1_1, 6, 25, 0x1f, 0x1c, false)
393 MUX_CFG(TNETV107X, ASR_D13, 7, 0, 0x1f, 0x00, false)
394 MUX_CFG(TNETV107X, SDIO1_DATA0_1, 7, 0, 0x1f, 0x1c, false)
395 MUX_CFG(TNETV107X, ASR_D14, 7, 5, 0x1f, 0x00, false)
396 MUX_CFG(TNETV107X, SDIO1_CMD_1, 7, 5, 0x1f, 0x1c, false)
397 MUX_CFG(TNETV107X, ASR_D15, 7, 10, 0x1f, 0x00, false)
398 MUX_CFG(TNETV107X, SDIO1_CLK_1, 7, 10, 0x1f, 0x1c, false)
399 MUX_CFG(TNETV107X, ASR_OE, 7, 15, 0x1f, 0x00, false)
400 MUX_CFG(TNETV107X, BOOT_STRP_2, 7, 15, 0x1f, 0x04, false)
401 MUX_CFG(TNETV107X, ASR_RNW, 7, 20, 0x1f, 0x00, false)
402 MUX_CFG(TNETV107X, GPIO29_0, 7, 20, 0x1f, 0x04, false)
403 MUX_CFG(TNETV107X, ASR_WAIT, 7, 25, 0x1f, 0x00, false)
404 MUX_CFG(TNETV107X, GPIO30_0, 7, 25, 0x1f, 0x04, false)
405 MUX_CFG(TNETV107X, ASR_WE, 8, 0, 0x1f, 0x00, false)
406 MUX_CFG(TNETV107X, BOOT_STRP_3, 8, 0, 0x1f, 0x04, false)
407 MUX_CFG(TNETV107X, ASR_WE_DQM0, 8, 5, 0x1f, 0x00, false)
408 MUX_CFG(TNETV107X, GPIO31, 8, 5, 0x1f, 0x04, false)
409 MUX_CFG(TNETV107X, LCD_PD17_0, 8, 5, 0x1f, 0x1c, false)
410 MUX_CFG(TNETV107X, ASR_WE_DQM1, 8, 10, 0x1f, 0x00, false)
411 MUX_CFG(TNETV107X, ASR_BA0_0, 8, 10, 0x1f, 0x04, false)
412 MUX_CFG(TNETV107X, VLYNQ_CLK, 9, 0, 0x1f, 0x00, false)
413 MUX_CFG(TNETV107X, GPIO14, 9, 0, 0x1f, 0x04, false)
414 MUX_CFG(TNETV107X, LCD_PD19_0, 9, 0, 0x1f, 0x1c, false)
415 MUX_CFG(TNETV107X, VLYNQ_RXD0, 9, 5, 0x1f, 0x00, false)
416 MUX_CFG(TNETV107X, GPIO15, 9, 5, 0x1f, 0x04, false)
417 MUX_CFG(TNETV107X, LCD_PD20_0, 9, 5, 0x1f, 0x1c, false)
418 MUX_CFG(TNETV107X, VLYNQ_RXD1, 9, 10, 0x1f, 0x00, false)
419 MUX_CFG(TNETV107X, GPIO16, 9, 10, 0x1f, 0x04, false)
420 MUX_CFG(TNETV107X, LCD_PD21_0, 9, 10, 0x1f, 0x1c, false)
421 MUX_CFG(TNETV107X, VLYNQ_TXD0, 9, 15, 0x1f, 0x00, false)
422 MUX_CFG(TNETV107X, GPIO17, 9, 15, 0x1f, 0x04, false)
423 MUX_CFG(TNETV107X, LCD_PD22_0, 9, 15, 0x1f, 0x1c, false)
424 MUX_CFG(TNETV107X, VLYNQ_TXD1, 9, 20, 0x1f, 0x00, false)
425 MUX_CFG(TNETV107X, GPIO18, 9, 20, 0x1f, 0x04, false)
426 MUX_CFG(TNETV107X, LCD_PD23_0, 9, 20, 0x1f, 0x1c, false)
427 MUX_CFG(TNETV107X, SDIO0_CLK, 10, 0, 0x1f, 0x00, false)
428 MUX_CFG(TNETV107X, GPIO19, 10, 0, 0x1f, 0x04, false)
429 MUX_CFG(TNETV107X, SDIO0_CMD, 10, 5, 0x1f, 0x00, false)
430 MUX_CFG(TNETV107X, GPIO20, 10, 5, 0x1f, 0x04, false)
431 MUX_CFG(TNETV107X, SDIO0_DATA0, 10, 10, 0x1f, 0x00, false)
432 MUX_CFG(TNETV107X, GPIO21, 10, 10, 0x1f, 0x04, false)
433 MUX_CFG(TNETV107X, SDIO0_DATA1, 10, 15, 0x1f, 0x00, false)
434 MUX_CFG(TNETV107X, GPIO22, 10, 15, 0x1f, 0x04, false)
435 MUX_CFG(TNETV107X, SDIO0_DATA2, 10, 20, 0x1f, 0x00, false)
436 MUX_CFG(TNETV107X, GPIO23, 10, 20, 0x1f, 0x04, false)
437 MUX_CFG(TNETV107X, SDIO0_DATA3, 10, 25, 0x1f, 0x00, false)
438 MUX_CFG(TNETV107X, GPIO24, 10, 25, 0x1f, 0x04, false)
439 MUX_CFG(TNETV107X, EMU0, 11, 0, 0x1f, 0x00, false)
440 MUX_CFG(TNETV107X, EMU1, 11, 5, 0x1f, 0x00, false)
441 MUX_CFG(TNETV107X, RTCK, 12, 0, 0x1f, 0x00, false)
442 MUX_CFG(TNETV107X, TRST_N, 12, 5, 0x1f, 0x00, false)
443 MUX_CFG(TNETV107X, TCK, 12, 10, 0x1f, 0x00, false)
444 MUX_CFG(TNETV107X, TDI, 12, 15, 0x1f, 0x00, false)
445 MUX_CFG(TNETV107X, TDO, 12, 20, 0x1f, 0x00, false)
446 MUX_CFG(TNETV107X, TMS, 12, 25, 0x1f, 0x00, false)
447 MUX_CFG(TNETV107X, TDM1_CLK, 13, 0, 0x1f, 0x00, false)
448 MUX_CFG(TNETV107X, TDM1_RX, 13, 5, 0x1f, 0x00, false)
449 MUX_CFG(TNETV107X, TDM1_TX, 13, 10, 0x1f, 0x00, false)
450 MUX_CFG(TNETV107X, TDM1_FS, 13, 15, 0x1f, 0x00, false)
451 MUX_CFG(TNETV107X, KEYPAD_R0, 14, 0, 0x1f, 0x00, false)
452 MUX_CFG(TNETV107X, KEYPAD_R1, 14, 5, 0x1f, 0x00, false)
453 MUX_CFG(TNETV107X, KEYPAD_R2, 14, 10, 0x1f, 0x00, false)
454 MUX_CFG(TNETV107X, KEYPAD_R3, 14, 15, 0x1f, 0x00, false)
455 MUX_CFG(TNETV107X, KEYPAD_R4, 14, 20, 0x1f, 0x00, false)
456 MUX_CFG(TNETV107X, KEYPAD_R5, 14, 25, 0x1f, 0x00, false)
457 MUX_CFG(TNETV107X, KEYPAD_R6, 15, 0, 0x1f, 0x00, false)
458 MUX_CFG(TNETV107X, GPIO12, 15, 0, 0x1f, 0x04, false)
459 MUX_CFG(TNETV107X, KEYPAD_R7, 15, 5, 0x1f, 0x00, false)
460 MUX_CFG(TNETV107X, GPIO10, 15, 5, 0x1f, 0x04, false)
461 MUX_CFG(TNETV107X, KEYPAD_C0, 15, 10, 0x1f, 0x00, false)
462 MUX_CFG(TNETV107X, KEYPAD_C1, 15, 15, 0x1f, 0x00, false)
463 MUX_CFG(TNETV107X, KEYPAD_C2, 15, 20, 0x1f, 0x00, false)
464 MUX_CFG(TNETV107X, KEYPAD_C3, 15, 25, 0x1f, 0x00, false)
465 MUX_CFG(TNETV107X, KEYPAD_C4, 16, 0, 0x1f, 0x00, false)
466 MUX_CFG(TNETV107X, KEYPAD_C5, 16, 5, 0x1f, 0x00, false)
467 MUX_CFG(TNETV107X, KEYPAD_C6, 16, 10, 0x1f, 0x00, false)
468 MUX_CFG(TNETV107X, GPIO13, 16, 10, 0x1f, 0x04, false)
469 MUX_CFG(TNETV107X, TEST_CLK_IN, 16, 10, 0x1f, 0x0c, false)
470 MUX_CFG(TNETV107X, KEYPAD_C7, 16, 15, 0x1f, 0x00, false)
471 MUX_CFG(TNETV107X, GPIO11, 16, 15, 0x1f, 0x04, false)
472 MUX_CFG(TNETV107X, SSP0_0, 17, 0, 0x1f, 0x00, false)
473 MUX_CFG(TNETV107X, SCC_DCLK, 17, 0, 0x1f, 0x04, false)
474 MUX_CFG(TNETV107X, LCD_PD20_1, 17, 0, 0x1f, 0x0c, false)
475 MUX_CFG(TNETV107X, SSP0_1, 17, 5, 0x1f, 0x00, false)
476 MUX_CFG(TNETV107X, SCC_CS_N, 17, 5, 0x1f, 0x04, false)
477 MUX_CFG(TNETV107X, LCD_PD21_1, 17, 5, 0x1f, 0x0c, false)
478 MUX_CFG(TNETV107X, SSP0_2, 17, 10, 0x1f, 0x00, false)
479 MUX_CFG(TNETV107X, SCC_D, 17, 10, 0x1f, 0x04, false)
480 MUX_CFG(TNETV107X, LCD_PD22_1, 17, 10, 0x1f, 0x0c, false)
481 MUX_CFG(TNETV107X, SSP0_3, 17, 15, 0x1f, 0x00, false)
482 MUX_CFG(TNETV107X, SCC_RESETN, 17, 15, 0x1f, 0x04, false)
483 MUX_CFG(TNETV107X, LCD_PD23_1, 17, 15, 0x1f, 0x0c, false)
484 MUX_CFG(TNETV107X, SSP1_0, 18, 0, 0x1f, 0x00, false)
485 MUX_CFG(TNETV107X, GPIO25, 18, 0, 0x1f, 0x04, false)
486 MUX_CFG(TNETV107X, UART2_CTS, 18, 0, 0x1f, 0x0c, false)
487 MUX_CFG(TNETV107X, SSP1_1, 18, 5, 0x1f, 0x00, false)
488 MUX_CFG(TNETV107X, GPIO26, 18, 5, 0x1f, 0x04, false)
489 MUX_CFG(TNETV107X, UART2_RD, 18, 5, 0x1f, 0x0c, false)
490 MUX_CFG(TNETV107X, SSP1_2, 18, 10, 0x1f, 0x00, false)
491 MUX_CFG(TNETV107X, GPIO27, 18, 10, 0x1f, 0x04, false)
492 MUX_CFG(TNETV107X, UART2_RTS, 18, 10, 0x1f, 0x0c, false)
493 MUX_CFG(TNETV107X, SSP1_3, 18, 15, 0x1f, 0x00, false)
494 MUX_CFG(TNETV107X, GPIO28, 18, 15, 0x1f, 0x04, false)
495 MUX_CFG(TNETV107X, UART2_TD, 18, 15, 0x1f, 0x0c, false)
496 MUX_CFG(TNETV107X, UART0_CTS, 19, 0, 0x1f, 0x00, false)
497 MUX_CFG(TNETV107X, UART0_RD, 19, 5, 0x1f, 0x00, false)
498 MUX_CFG(TNETV107X, UART0_RTS, 19, 10, 0x1f, 0x00, false)
499 MUX_CFG(TNETV107X, UART0_TD, 19, 15, 0x1f, 0x00, false)
500 MUX_CFG(TNETV107X, UART1_RD, 19, 20, 0x1f, 0x00, false)
501 MUX_CFG(TNETV107X, UART1_TD, 19, 25, 0x1f, 0x00, false)
502 MUX_CFG(TNETV107X, LCD_AC_NCS, 20, 0, 0x1f, 0x00, false)
503 MUX_CFG(TNETV107X, LCD_HSYNC_RNW, 20, 5, 0x1f, 0x00, false)
504 MUX_CFG(TNETV107X, LCD_VSYNC_A0, 20, 10, 0x1f, 0x00, false)
505 MUX_CFG(TNETV107X, LCD_MCLK, 20, 15, 0x1f, 0x00, false)
506 MUX_CFG(TNETV107X, LCD_PD16_0, 20, 15, 0x1f, 0x0c, false)
507 MUX_CFG(TNETV107X, LCD_PCLK_E, 20, 20, 0x1f, 0x00, false)
508 MUX_CFG(TNETV107X, LCD_PD00, 20, 25, 0x1f, 0x00, false)
509 MUX_CFG(TNETV107X, LCD_PD01, 21, 0, 0x1f, 0x00, false)
510 MUX_CFG(TNETV107X, LCD_PD02, 21, 5, 0x1f, 0x00, false)
511 MUX_CFG(TNETV107X, LCD_PD03, 21, 10, 0x1f, 0x00, false)
512 MUX_CFG(TNETV107X, LCD_PD04, 21, 15, 0x1f, 0x00, false)
513 MUX_CFG(TNETV107X, LCD_PD05, 21, 20, 0x1f, 0x00, false)
514 MUX_CFG(TNETV107X, LCD_PD06, 21, 25, 0x1f, 0x00, false)
515 MUX_CFG(TNETV107X, LCD_PD07, 22, 0, 0x1f, 0x00, false)
516 MUX_CFG(TNETV107X, LCD_PD08, 22, 5, 0x1f, 0x00, false)
517 MUX_CFG(TNETV107X, GPIO59_1, 22, 5, 0x1f, 0x0c, false)
518 MUX_CFG(TNETV107X, LCD_PD09, 22, 10, 0x1f, 0x00, false)
519 MUX_CFG(TNETV107X, GPIO60_1, 22, 10, 0x1f, 0x0c, false)
520 MUX_CFG(TNETV107X, LCD_PD10, 22, 15, 0x1f, 0x00, false)
521 MUX_CFG(TNETV107X, ASR_BA0_1, 22, 15, 0x1f, 0x04, false)
522 MUX_CFG(TNETV107X, GPIO61_1, 22, 15, 0x1f, 0x0c, false)
523 MUX_CFG(TNETV107X, LCD_PD11, 22, 20, 0x1f, 0x00, false)
524 MUX_CFG(TNETV107X, GPIO62_1, 22, 20, 0x1f, 0x0c, false)
525 MUX_CFG(TNETV107X, LCD_PD12, 22, 25, 0x1f, 0x00, false)
526 MUX_CFG(TNETV107X, GPIO63_1, 22, 25, 0x1f, 0x0c, false)
527 MUX_CFG(TNETV107X, LCD_PD13, 23, 0, 0x1f, 0x00, false)
528 MUX_CFG(TNETV107X, GPIO64_1, 23, 0, 0x1f, 0x0c, false)
529 MUX_CFG(TNETV107X, LCD_PD14, 23, 5, 0x1f, 0x00, false)
530 MUX_CFG(TNETV107X, GPIO29_1, 23, 5, 0x1f, 0x0c, false)
531 MUX_CFG(TNETV107X, LCD_PD15, 23, 10, 0x1f, 0x00, false)
532 MUX_CFG(TNETV107X, GPIO30_1, 23, 10, 0x1f, 0x0c, false)
533 MUX_CFG(TNETV107X, EINT0, 24, 0, 0x1f, 0x00, false)
534 MUX_CFG(TNETV107X, GPIO08, 24, 0, 0x1f, 0x04, false)
535 MUX_CFG(TNETV107X, EINT1, 24, 5, 0x1f, 0x00, false)
536 MUX_CFG(TNETV107X, GPIO09, 24, 5, 0x1f, 0x04, false)
537 MUX_CFG(TNETV107X, GPIO00, 24, 10, 0x1f, 0x00, false)
538 MUX_CFG(TNETV107X, LCD_PD20_2, 24, 10, 0x1f, 0x04, false)
539 MUX_CFG(TNETV107X, TDM_CLK_IN_2, 24, 10, 0x1f, 0x0c, false)
540 MUX_CFG(TNETV107X, GPIO01, 24, 15, 0x1f, 0x00, false)
541 MUX_CFG(TNETV107X, LCD_PD21_2, 24, 15, 0x1f, 0x04, false)
542 MUX_CFG(TNETV107X, 24M_CLK_OUT_1, 24, 15, 0x1f, 0x0c, false)
543 MUX_CFG(TNETV107X, GPIO02, 24, 20, 0x1f, 0x00, false)
544 MUX_CFG(TNETV107X, LCD_PD22_2, 24, 20, 0x1f, 0x04, false)
545 MUX_CFG(TNETV107X, GPIO03, 24, 25, 0x1f, 0x00, false)
546 MUX_CFG(TNETV107X, LCD_PD23_2, 24, 25, 0x1f, 0x04, false)
547 MUX_CFG(TNETV107X, GPIO04, 25, 0, 0x1f, 0x00, false)
548 MUX_CFG(TNETV107X, LCD_PD16_1, 25, 0, 0x1f, 0x04, false)
549 MUX_CFG(TNETV107X, USB0_RXERR, 25, 0, 0x1f, 0x0c, false)
550 MUX_CFG(TNETV107X, GPIO05, 25, 5, 0x1f, 0x00, false)
551 MUX_CFG(TNETV107X, LCD_PD17_1, 25, 5, 0x1f, 0x04, false)
552 MUX_CFG(TNETV107X, TDM_CLK_IN_1, 25, 5, 0x1f, 0x0c, false)
553 MUX_CFG(TNETV107X, GPIO06, 25, 10, 0x1f, 0x00, false)
554 MUX_CFG(TNETV107X, LCD_PD18, 25, 10, 0x1f, 0x04, false)
555 MUX_CFG(TNETV107X, 24M_CLK_OUT_2, 25, 10, 0x1f, 0x0c, false)
556 MUX_CFG(TNETV107X, GPIO07, 25, 15, 0x1f, 0x00, false)
557 MUX_CFG(TNETV107X, LCD_PD19_1, 25, 15, 0x1f, 0x04, false)
558 MUX_CFG(TNETV107X, USB1_RXERR, 25, 15, 0x1f, 0x0c, false)
559 MUX_CFG(TNETV107X, ETH_PLL_CLK, 25, 15, 0x1f, 0x1c, false)
560 MUX_CFG(TNETV107X, MDIO, 26, 0, 0x1f, 0x00, false)
561 MUX_CFG(TNETV107X, MDC, 26, 5, 0x1f, 0x00, false)
562 MUX_CFG(TNETV107X, AIC_MUTE_STAT_N, 26, 10, 0x1f, 0x00, false)
563 MUX_CFG(TNETV107X, TDM0_CLK, 26, 10, 0x1f, 0x04, false)
564 MUX_CFG(TNETV107X, AIC_HNS_EN_N, 26, 15, 0x1f, 0x00, false)
565 MUX_CFG(TNETV107X, TDM0_FS, 26, 15, 0x1f, 0x04, false)
566 MUX_CFG(TNETV107X, AIC_HDS_EN_STAT_N, 26, 20, 0x1f, 0x00, false)
567 MUX_CFG(TNETV107X, TDM0_TX, 26, 20, 0x1f, 0x04, false)
568 MUX_CFG(TNETV107X, AIC_HNF_EN_STAT_N, 26, 25, 0x1f, 0x00, false)
569 MUX_CFG(TNETV107X, TDM0_RX, 26, 25, 0x1f, 0x04, false)
570#endif
571};
572
573/* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */
574static u8 irq_prios[TNETV107X_N_CP_INTC_IRQ] = {
575 /* fill in default priority 7 */
576 [0 ... (TNETV107X_N_CP_INTC_IRQ - 1)] = 7,
577 /* now override as needed, e.g. [xxx] = 5 */
578};
579
580/* Contents of JTAG ID register used to identify exact cpu type */
581static struct davinci_id ids[] = {
582 {
583 .variant = 0x0,
584 .part_no = 0xb8a1,
585 .manufacturer = 0x017,
586 .cpu_id = DAVINCI_CPU_ID_TNETV107X,
587 .name = "tnetv107x rev 1.0",
588 },
589 {
590 .variant = 0x1,
591 .part_no = 0xb8a1,
592 .manufacturer = 0x017,
593 .cpu_id = DAVINCI_CPU_ID_TNETV107X,
594 .name = "tnetv107x rev 1.1/1.2",
595 },
596};
597
598static struct davinci_timer_instance timer_instance[2] = {
599 {
600 .base = TNETV107X_TIMER0_BASE,
601 .bottom_irq = IRQ_TNETV107X_TIMER_0_TINT12,
602 .top_irq = IRQ_TNETV107X_TIMER_0_TINT34,
603 },
604 {
605 .base = TNETV107X_TIMER1_BASE,
606 .bottom_irq = IRQ_TNETV107X_TIMER_1_TINT12,
607 .top_irq = IRQ_TNETV107X_TIMER_1_TINT34,
608 },
609};
610
611static struct davinci_timer_info timer_info = {
612 .timers = timer_instance,
613 .clockevent_id = T0_BOT,
614 .clocksource_id = T0_TOP,
615};
616
617/*
618 * TNETV107X platforms do not use the static mappings from Davinci
619 * IO_PHYS/IO_VIRT. This SOC's interesting MMRs are at different addresses,
620 * and changing IO_PHYS would break away from existing Davinci SOCs.
621 *
622 * The primary impact of the current model is that IO_ADDRESS() is not to be
623 * used to map registers on TNETV107X.
624 *
625 * 1. The first chunk is for INTC: This needs to be mapped in via iotable
626 * because ioremap() does not seem to be operational at the time when
627 * irqs are initialized. Without this, consistent dma init bombs.
628 *
629 * 2. The second chunk maps in register areas that need to be populated into
630 * davinci_soc_info. Note that alignment restrictions come into play if
631 * low-level debug is enabled (see note in <mach/tnetv107x.h>).
632 */
633static struct map_desc io_desc[] = {
634 { /* INTC */
635 .virtual = IO_VIRT,
636 .pfn = __phys_to_pfn(TNETV107X_INTC_BASE),
637 .length = SZ_16K,
638 .type = MT_DEVICE
639 },
640 { /* Most of the rest */
641 .virtual = TNETV107X_IO_VIRT,
642 .pfn = __phys_to_pfn(TNETV107X_IO_BASE),
643 .length = IO_SIZE - SZ_1M,
644 .type = MT_DEVICE
645 },
646};
647
648static unsigned long clk_sspll_recalc(struct clk *clk)
649{
650 int pll;
651 unsigned long mult = 0, prediv = 1, postdiv = 1;
652 unsigned long ref = OSC_FREQ_ONCHIP, ret;
653 u32 tmp;
654
655 if (WARN_ON(!clk->pll_data))
656 return clk->rate;
657
658 if (!clk_ctrl_regs) {
659 void __iomem *tmp;
660
661 tmp = ioremap(TNETV107X_CLOCK_CONTROL_BASE, SZ_4K);
662
663 if (WARN(!tmp, "failed ioremap for clock control regs\n"))
664 return clk->parent ? clk->parent->rate : 0;
665
666 for (pll = 0; pll < N_PLLS; pll++)
667 sspll_regs[pll] = tmp + sspll_regs_base[pll];
668
669 clk_ctrl_regs = tmp;
670 }
671
672 pll = clk->pll_data->num;
673
674 tmp = __raw_readl(&clk_ctrl_regs->pll_bypass);
675 if (!(tmp & bypass_mask[pll])) {
676 mult = __raw_readl(&sspll_regs[pll]->mult_factor);
677 prediv = __raw_readl(&sspll_regs[pll]->pre_div) + 1;
678 postdiv = __raw_readl(&sspll_regs[pll]->post_div) + 1;
679 }
680
681 tmp = __raw_readl(clk->pll_data->base + PLLCTL);
682 if (tmp & PLLCTL_CLKMODE)
683 ref = pll_ext_freq[pll];
684
685 clk->pll_data->input_rate = ref;
686
687 tmp = __raw_readl(clk->pll_data->base + PLLCTL);
688 if (!(tmp & PLLCTL_PLLEN))
689 return ref;
690
691 ret = ref;
692 if (mult)
693 ret += ((unsigned long long)ref * mult) / 256;
694
695 ret /= (prediv * postdiv);
696
697 return ret;
698}
699
700static void tnetv107x_watchdog_reset(struct platform_device *pdev)
701{
702 struct wdt_regs __iomem *regs;
703
704 regs = ioremap(pdev->resource[0].start, SZ_4K);
705
706 /* disable watchdog */
707 __raw_writel(0x7777, &regs->disable_lock);
708 __raw_writel(0xcccc, &regs->disable_lock);
709 __raw_writel(0xdddd, &regs->disable_lock);
710 __raw_writel(0, &regs->disable);
711
712 /* program prescale */
713 __raw_writel(0x5a5a, &regs->prescale_lock);
714 __raw_writel(0xa5a5, &regs->prescale_lock);
715 __raw_writel(0, &regs->prescale);
716
717 /* program countdown */
718 __raw_writel(0x6666, &regs->change_lock);
719 __raw_writel(0xbbbb, &regs->change_lock);
720 __raw_writel(1, &regs->change);
721
722 /* enable watchdog */
723 __raw_writel(0x7777, &regs->disable_lock);
724 __raw_writel(0xcccc, &regs->disable_lock);
725 __raw_writel(0xdddd, &regs->disable_lock);
726 __raw_writel(1, &regs->disable);
727
728 /* kick */
729 __raw_writel(0x5555, &regs->kick_lock);
730 __raw_writel(0xaaaa, &regs->kick_lock);
731 __raw_writel(1, &regs->kick);
732}
733
734void tnetv107x_restart(enum reboot_mode mode, const char *cmd)
735{
736 tnetv107x_watchdog_reset(&tnetv107x_wdt_device);
737}
738
739static struct davinci_soc_info tnetv107x_soc_info = {
740 .io_desc = io_desc,
741 .io_desc_num = ARRAY_SIZE(io_desc),
742 .ids = ids,
743 .ids_num = ARRAY_SIZE(ids),
744 .jtag_id_reg = TNETV107X_CHIP_CFG_BASE + 0x018,
745 .cpu_clks = clks,
746 .psc_bases = psc_regs,
747 .psc_bases_num = ARRAY_SIZE(psc_regs),
748 .pinmux_base = TNETV107X_CHIP_CFG_BASE + 0x150,
749 .pinmux_pins = pins,
750 .pinmux_pins_num = ARRAY_SIZE(pins),
751 .intc_type = DAVINCI_INTC_TYPE_CP_INTC,
752 .intc_base = TNETV107X_INTC_BASE,
753 .intc_irq_prios = irq_prios,
754 .intc_irq_num = TNETV107X_N_CP_INTC_IRQ,
755 .intc_host_map = intc_host_map,
756 .gpio_base = TNETV107X_GPIO_BASE,
757 .gpio_type = GPIO_TYPE_TNETV107X,
758 .gpio_num = TNETV107X_N_GPIO,
759 .timer_info = &timer_info,
760 .serial_dev = tnetv107x_serial_device,
761};
762
763void __init tnetv107x_init(void)
764{
765 davinci_common_init(&tnetv107x_soc_info);
766}
diff --git a/arch/arm/mach-dove/Kconfig b/arch/arm/mach-dove/Kconfig
index 0bc7cdf8cf46..d8c439c89ea9 100644
--- a/arch/arm/mach-dove/Kconfig
+++ b/arch/arm/mach-dove/Kconfig
@@ -20,18 +20,6 @@ config MACH_CM_A510
20 Say 'Y' here if you want your kernel to support the 20 Say 'Y' here if you want your kernel to support the
21 CompuLab CM-A510 Board. 21 CompuLab CM-A510 Board.
22 22
23config MACH_DOVE_DT
24 bool "Marvell Dove Flattened Device Tree"
25 select DOVE_CLK
26 select ORION_IRQCHIP
27 select ORION_TIMER
28 select REGULATOR
29 select REGULATOR_FIXED_VOLTAGE
30 select USE_OF
31 help
32 Say 'Y' here if you want your kernel to support the
33 Marvell Dove using flattened device tree.
34
35endmenu 23endmenu
36 24
37endif 25endif
diff --git a/arch/arm/mach-dove/Makefile b/arch/arm/mach-dove/Makefile
index cbc5c0618788..b608a21919fb 100644
--- a/arch/arm/mach-dove/Makefile
+++ b/arch/arm/mach-dove/Makefile
@@ -2,5 +2,4 @@ obj-y += common.o
2obj-$(CONFIG_DOVE_LEGACY) += irq.o mpp.o 2obj-$(CONFIG_DOVE_LEGACY) += irq.o mpp.o
3obj-$(CONFIG_PCI) += pcie.o 3obj-$(CONFIG_PCI) += pcie.o
4obj-$(CONFIG_MACH_DOVE_DB) += dove-db-setup.o 4obj-$(CONFIG_MACH_DOVE_DB) += dove-db-setup.o
5obj-$(CONFIG_MACH_DOVE_DT) += board-dt.o
6obj-$(CONFIG_MACH_CM_A510) += cm-a510.o 5obj-$(CONFIG_MACH_CM_A510) += cm-a510.o
diff --git a/arch/arm/mach-dove/include/mach/bridge-regs.h b/arch/arm/mach-dove/include/mach/bridge-regs.h
index 5362df3df89f..f4a5b34489b7 100644
--- a/arch/arm/mach-dove/include/mach/bridge-regs.h
+++ b/arch/arm/mach-dove/include/mach/bridge-regs.h
@@ -21,6 +21,7 @@
21#define CPU_CTRL_PCIE1_LINK 0x00000008 21#define CPU_CTRL_PCIE1_LINK 0x00000008
22 22
23#define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108) 23#define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108)
24#define RSTOUTn_MASK_PHYS (BRIDGE_PHYS_BASE + 0x0108)
24#define SOFT_RESET_OUT_EN 0x00000004 25#define SOFT_RESET_OUT_EN 0x00000004
25 26
26#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c) 27#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c)
diff --git a/arch/arm/mach-dove/include/mach/timex.h b/arch/arm/mach-dove/include/mach/timex.h
deleted file mode 100644
index 251d538541db..000000000000
--- a/arch/arm/mach-dove/include/mach/timex.h
+++ /dev/null
@@ -1,9 +0,0 @@
1/*
2 * arch/arm/mach-dove/include/mach/timex.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#define CLOCK_TICK_RATE (100 * HZ)
diff --git a/arch/arm/mach-ebsa110/core.c b/arch/arm/mach-ebsa110/core.c
index 68ac934d4565..8254e716b095 100644
--- a/arch/arm/mach-ebsa110/core.c
+++ b/arch/arm/mach-ebsa110/core.c
@@ -206,7 +206,7 @@ ebsa110_timer_interrupt(int irq, void *dev_id)
206 206
207static struct irqaction ebsa110_timer_irq = { 207static struct irqaction ebsa110_timer_irq = {
208 .name = "EBSA110 Timer Tick", 208 .name = "EBSA110 Timer Tick",
209 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 209 .flags = IRQF_TIMER | IRQF_IRQPOLL,
210 .handler = ebsa110_timer_interrupt, 210 .handler = ebsa110_timer_interrupt,
211}; 211};
212 212
diff --git a/arch/arm/mach-ebsa110/include/mach/timex.h b/arch/arm/mach-ebsa110/include/mach/timex.h
deleted file mode 100644
index 4fb43b22a102..000000000000
--- a/arch/arm/mach-ebsa110/include/mach/timex.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/mach-ebsa110/include/mach/timex.h
3 *
4 * Copyright (C) 1997, 1998 Russell King
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 * EBSA110 architecture timex specifications
11 */
12
13/*
14 * On the EBSA, the clock ticks at weird rates.
15 * This is therefore not used to calculate the
16 * divisor.
17 */
18#define CLOCK_TICK_RATE 47894000
19
diff --git a/arch/arm/mach-efm32/include/mach/entry-macro.S b/arch/arm/mach-efm32/include/mach/entry-macro.S
deleted file mode 100644
index 322159d5ed91..000000000000
--- a/arch/arm/mach-efm32/include/mach/entry-macro.S
+++ /dev/null
@@ -1,4 +0,0 @@
1/*
2 * Empty file waiting for deletion once <mach/entry-macro.S> isn't needed any
3 * more. Patch "ARM: v7-M: drop using mach/entry-macro.S" sitting in next.
4 */
diff --git a/arch/arm/mach-efm32/include/mach/timex.h b/arch/arm/mach-efm32/include/mach/timex.h
deleted file mode 100644
index 7a8b26da6599..000000000000
--- a/arch/arm/mach-efm32/include/mach/timex.h
+++ /dev/null
@@ -1,3 +0,0 @@
1/*
2 * Empty file waiting for deletion once <mach/timex.h> isn't needed any more.
3 */
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index 157ba88433c9..0e571f1749d6 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -117,7 +117,7 @@ void __init ep93xx_map_io(void)
117#define EP93XX_TIMER4_CLOCK 983040 117#define EP93XX_TIMER4_CLOCK 983040
118 118
119#define TIMER1_RELOAD ((EP93XX_TIMER123_CLOCK / HZ) - 1) 119#define TIMER1_RELOAD ((EP93XX_TIMER123_CLOCK / HZ) - 1)
120#define TIMER4_TICKS_PER_JIFFY DIV_ROUND_CLOSEST(CLOCK_TICK_RATE, HZ) 120#define TIMER4_TICKS_PER_JIFFY DIV_ROUND_CLOSEST(EP93XX_TIMER4_CLOCK, HZ)
121 121
122static unsigned int last_jiffy_time; 122static unsigned int last_jiffy_time;
123 123
@@ -242,6 +242,7 @@ unsigned int ep93xx_chip_revision(void)
242 v >>= EP93XX_SYSCON_SYSCFG_REV_SHIFT; 242 v >>= EP93XX_SYSCON_SYSCFG_REV_SHIFT;
243 return v; 243 return v;
244} 244}
245EXPORT_SYMBOL_GPL(ep93xx_chip_revision);
245 246
246/************************************************************************* 247/*************************************************************************
247 * EP93xx GPIO 248 * EP93xx GPIO
diff --git a/arch/arm/mach-ep93xx/include/mach/timex.h b/arch/arm/mach-ep93xx/include/mach/timex.h
deleted file mode 100644
index 6b3503b01fa6..000000000000
--- a/arch/arm/mach-ep93xx/include/mach/timex.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * arch/arm/mach-ep93xx/include/mach/timex.h
3 */
4
5#define CLOCK_TICK_RATE 983040
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 4c414af75ef0..fc8bf18e222d 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -24,7 +24,7 @@ config ARCH_EXYNOS4
24 select HAVE_SMP 24 select HAVE_SMP
25 select MIGHT_HAVE_CACHE_L2X0 25 select MIGHT_HAVE_CACHE_L2X0
26 select PINCTRL 26 select PINCTRL
27 select PM_GENERIC_DOMAINS if PM 27 select PM_GENERIC_DOMAINS if PM_RUNTIME
28 select S5P_DEV_MFC 28 select S5P_DEV_MFC
29 help 29 help
30 Samsung EXYNOS4 SoCs based systems 30 Samsung EXYNOS4 SoCs based systems
@@ -36,7 +36,6 @@ config ARCH_EXYNOS5
36 select HAVE_ARM_SCU if SMP 36 select HAVE_ARM_SCU if SMP
37 select HAVE_SMP 37 select HAVE_SMP
38 select PINCTRL 38 select PINCTRL
39 select USB_ARCH_HAS_XHCI
40 help 39 help
41 Samsung EXYNOS5 (Cortex-A15) SoC based systems 40 Samsung EXYNOS5 (Cortex-A15) SoC based systems
42 41
@@ -47,10 +46,8 @@ config CPU_EXYNOS4210
47 default y 46 default y
48 depends on ARCH_EXYNOS4 47 depends on ARCH_EXYNOS4
49 select ARCH_HAS_BANDGAP 48 select ARCH_HAS_BANDGAP
50 select ARM_CPU_SUSPEND if PM 49 select ARM_CPU_SUSPEND if PM_SLEEP
51 select PINCTRL_EXYNOS 50 select PINCTRL_EXYNOS
52 select S5P_PM if PM
53 select S5P_SLEEP if PM
54 select SAMSUNG_DMADEV 51 select SAMSUNG_DMADEV
55 help 52 help
56 Enable EXYNOS4210 CPU support 53 Enable EXYNOS4210 CPU support
@@ -61,8 +58,6 @@ config SOC_EXYNOS4212
61 depends on ARCH_EXYNOS4 58 depends on ARCH_EXYNOS4
62 select ARCH_HAS_BANDGAP 59 select ARCH_HAS_BANDGAP
63 select PINCTRL_EXYNOS 60 select PINCTRL_EXYNOS
64 select S5P_PM if PM
65 select S5P_SLEEP if PM
66 select SAMSUNG_DMADEV 61 select SAMSUNG_DMADEV
67 help 62 help
68 Enable EXYNOS4212 SoC support 63 Enable EXYNOS4212 SoC support
@@ -83,9 +78,7 @@ config SOC_EXYNOS5250
83 depends on ARCH_EXYNOS5 78 depends on ARCH_EXYNOS5
84 select ARCH_HAS_BANDGAP 79 select ARCH_HAS_BANDGAP
85 select PINCTRL_EXYNOS 80 select PINCTRL_EXYNOS
86 select PM_GENERIC_DOMAINS if PM 81 select PM_GENERIC_DOMAINS if PM_RUNTIME
87 select S5P_PM if PM
88 select S5P_SLEEP if PM
89 select S5P_DEV_MFC 82 select S5P_DEV_MFC
90 select SAMSUNG_DMADEV 83 select SAMSUNG_DMADEV
91 help 84 help
@@ -95,9 +88,7 @@ config SOC_EXYNOS5420
95 bool "SAMSUNG EXYNOS5420" 88 bool "SAMSUNG EXYNOS5420"
96 default y 89 default y
97 depends on ARCH_EXYNOS5 90 depends on ARCH_EXYNOS5
98 select PM_GENERIC_DOMAINS if PM 91 select PM_GENERIC_DOMAINS if PM_RUNTIME
99 select S5P_PM if PM
100 select S5P_SLEEP if PM
101 help 92 help
102 Enable EXYNOS5420 SoC support 93 Enable EXYNOS5420 SoC support
103 94
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 8930b66b4abd..a656dbe3b78c 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -12,9 +12,9 @@ obj- :=
12 12
13# Core 13# Core
14 14
15obj-$(CONFIG_ARCH_EXYNOS) += common.o 15obj-$(CONFIG_ARCH_EXYNOS) += exynos.o
16 16
17obj-$(CONFIG_S5P_PM) += pm.o 17obj-$(CONFIG_PM_SLEEP) += pm.o sleep.o
18obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o 18obj-$(CONFIG_PM_GENERIC_DOMAINS) += pm_domains.o
19obj-$(CONFIG_CPU_IDLE) += cpuidle.o 19obj-$(CONFIG_CPU_IDLE) += cpuidle.o
20 20
@@ -29,8 +29,3 @@ obj-$(CONFIG_ARCH_EXYNOS) += firmware.o
29 29
30plus_sec := $(call as-instr,.arch_extension sec,+sec) 30plus_sec := $(call as-instr,.arch_extension sec,+sec)
31AFLAGS_exynos-smc.o :=-Wa,-march=armv7-a$(plus_sec) 31AFLAGS_exynos-smc.o :=-Wa,-march=armv7-a$(plus_sec)
32
33# machine support
34
35obj-$(CONFIG_ARCH_EXYNOS4) += mach-exynos4-dt.o
36obj-$(CONFIG_ARCH_EXYNOS5) += mach-exynos5-dt.o
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index f76967b1c551..9ef3f83efaff 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -19,14 +19,27 @@ void mct_init(void __iomem *base, int irq_g0, int irq_l0, int irq_l1);
19 19
20struct map_desc; 20struct map_desc;
21void exynos_init_io(void); 21void exynos_init_io(void);
22void exynos4_restart(enum reboot_mode mode, const char *cmd); 22void exynos_restart(enum reboot_mode mode, const char *cmd);
23void exynos5_restart(enum reboot_mode mode, const char *cmd);
24void exynos_cpuidle_init(void); 23void exynos_cpuidle_init(void);
25void exynos_cpufreq_init(void); 24void exynos_cpufreq_init(void);
26void exynos_init_late(void); 25void exynos_init_late(void);
27 26
28void exynos_firmware_init(void); 27void exynos_firmware_init(void);
29 28
29#ifdef CONFIG_PINCTRL_EXYNOS
30extern u32 exynos_get_eint_wake_mask(void);
31#else
32static inline u32 exynos_get_eint_wake_mask(void) { return 0xffffffff; }
33#endif
34
35#ifdef CONFIG_PM_SLEEP
36extern void __init exynos_pm_init(void);
37#else
38static inline void exynos_pm_init(void) {}
39#endif
40
41extern void exynos_cpu_resume(void);
42
30extern struct smp_operations exynos_smp_ops; 43extern struct smp_operations exynos_smp_ops;
31 44
32extern void exynos_cpu_die(unsigned int cpu); 45extern void exynos_cpu_die(unsigned int cpu);
diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c
index f57cb91f02aa..c57cae0e8779 100644
--- a/arch/arm/mach-exynos/cpuidle.c
+++ b/arch/arm/mach-exynos/cpuidle.c
@@ -14,6 +14,7 @@
14#include <linux/cpu_pm.h> 14#include <linux/cpu_pm.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/export.h> 16#include <linux/export.h>
17#include <linux/module.h>
17#include <linux/time.h> 18#include <linux/time.h>
18#include <linux/platform_device.h> 19#include <linux/platform_device.h>
19 20
@@ -26,7 +27,6 @@
26#include <plat/cpu.h> 27#include <plat/cpu.h>
27#include <plat/pm.h> 28#include <plat/pm.h>
28 29
29#include <mach/pm-core.h>
30#include <mach/map.h> 30#include <mach/map.h>
31 31
32#include "common.h" 32#include "common.h"
@@ -127,7 +127,7 @@ static int exynos4_enter_core0_aftr(struct cpuidle_device *dev,
127 /* Set value of power down register for aftr mode */ 127 /* Set value of power down register for aftr mode */
128 exynos_sys_powerdown_conf(SYS_AFTR); 128 exynos_sys_powerdown_conf(SYS_AFTR);
129 129
130 __raw_writel(virt_to_phys(s3c_cpu_resume), REG_DIRECTGO_ADDR); 130 __raw_writel(virt_to_phys(exynos_cpu_resume), REG_DIRECTGO_ADDR);
131 __raw_writel(S5P_CHECK_AFTR, REG_DIRECTGO_FLAG); 131 __raw_writel(S5P_CHECK_AFTR, REG_DIRECTGO_FLAG);
132 132
133 save_cpu_arch_register(); 133 save_cpu_arch_register();
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/exynos.c
index f18be40e5b21..b32a907d021d 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -1,105 +1,40 @@
1/* 1/*
2 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. 2 * SAMSUNG EXYNOS Flattened Device Tree enabled machine
3 * http://www.samsung.com
4 * 3 *
5 * Common Codes for EXYNOS 4 * Copyright (c) 2010-2014 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 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 8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11 11
12#include <linux/kernel.h> 12#include <linux/init.h>
13#include <linux/bitops.h>
14#include <linux/interrupt.h>
15#include <linux/irq.h>
16#include <linux/irqchip.h>
17#include <linux/io.h> 13#include <linux/io.h>
18#include <linux/device.h> 14#include <linux/kernel.h>
19#include <linux/gpio.h> 15#include <linux/serial_s3c.h>
20#include <clocksource/samsung_pwm.h>
21#include <linux/sched.h>
22#include <linux/serial_core.h>
23#include <linux/of.h> 16#include <linux/of.h>
24#include <linux/of_fdt.h>
25#include <linux/of_irq.h>
26#include <linux/pm_domain.h>
27#include <linux/export.h>
28#include <linux/irqdomain.h>
29#include <linux/of_address.h> 17#include <linux/of_address.h>
30#include <linux/irqchip/arm-gic.h> 18#include <linux/of_fdt.h>
31#include <linux/irqchip/chained_irq.h> 19#include <linux/of_platform.h>
32#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/pm_domain.h>
33 22
34#include <asm/proc-fns.h> 23#include <asm/cacheflush.h>
35#include <asm/exception.h>
36#include <asm/hardware/cache-l2x0.h> 24#include <asm/hardware/cache-l2x0.h>
25#include <asm/mach/arch.h>
37#include <asm/mach/map.h> 26#include <asm/mach/map.h>
38#include <asm/mach/irq.h> 27#include <asm/memory.h>
39#include <asm/cacheflush.h>
40 28
41#include <plat/cpu.h> 29#include <plat/cpu.h>
42#include <plat/pm.h>
43#include <plat/regs-serial.h>
44 30
45#include "common.h" 31#include "common.h"
32#include "mfc.h"
46#include "regs-pmu.h" 33#include "regs-pmu.h"
47 34
48#define L2_AUX_VAL 0x7C470001 35#define L2_AUX_VAL 0x7C470001
49#define L2_AUX_MASK 0xC200ffff 36#define L2_AUX_MASK 0xC200ffff
50 37
51static const char name_exynos4210[] = "EXYNOS4210";
52static const char name_exynos4212[] = "EXYNOS4212";
53static const char name_exynos4412[] = "EXYNOS4412";
54static const char name_exynos5250[] = "EXYNOS5250";
55static const char name_exynos5420[] = "EXYNOS5420";
56static const char name_exynos5440[] = "EXYNOS5440";
57
58static void exynos4_map_io(void);
59static void exynos5_map_io(void);
60static int exynos_init(void);
61
62static struct cpu_table cpu_ids[] __initdata = {
63 {
64 .idcode = EXYNOS4210_CPU_ID,
65 .idmask = EXYNOS4_CPU_MASK,
66 .map_io = exynos4_map_io,
67 .init = exynos_init,
68 .name = name_exynos4210,
69 }, {
70 .idcode = EXYNOS4212_CPU_ID,
71 .idmask = EXYNOS4_CPU_MASK,
72 .map_io = exynos4_map_io,
73 .init = exynos_init,
74 .name = name_exynos4212,
75 }, {
76 .idcode = EXYNOS4412_CPU_ID,
77 .idmask = EXYNOS4_CPU_MASK,
78 .map_io = exynos4_map_io,
79 .init = exynos_init,
80 .name = name_exynos4412,
81 }, {
82 .idcode = EXYNOS5250_SOC_ID,
83 .idmask = EXYNOS5_SOC_MASK,
84 .map_io = exynos5_map_io,
85 .init = exynos_init,
86 .name = name_exynos5250,
87 }, {
88 .idcode = EXYNOS5420_SOC_ID,
89 .idmask = EXYNOS5_SOC_MASK,
90 .map_io = exynos5_map_io,
91 .init = exynos_init,
92 .name = name_exynos5420,
93 }, {
94 .idcode = EXYNOS5440_SOC_ID,
95 .idmask = EXYNOS5_SOC_MASK,
96 .init = exynos_init,
97 .name = name_exynos5440,
98 },
99};
100
101/* Initial IO mappings */
102
103static struct map_desc exynos4_iodesc[] __initdata = { 38static struct map_desc exynos4_iodesc[] __initdata = {
104 { 39 {
105 .virtual = (unsigned long)S3C_VA_SYS, 40 .virtual = (unsigned long)S3C_VA_SYS,
@@ -263,19 +198,11 @@ static struct map_desc exynos5_iodesc[] __initdata = {
263 }, 198 },
264}; 199};
265 200
266void exynos4_restart(enum reboot_mode mode, const char *cmd) 201void exynos_restart(enum reboot_mode mode, const char *cmd)
267{
268 __raw_writel(0x1, S5P_SWRESET);
269}
270
271void exynos5_restart(enum reboot_mode mode, const char *cmd)
272{ 202{
273 struct device_node *np; 203 struct device_node *np;
274 u32 val; 204 u32 val = 0x1;
275 void __iomem *addr; 205 void __iomem *addr = EXYNOS_SWRESET;
276
277 val = 0x1;
278 addr = EXYNOS_SWRESET;
279 206
280 if (of_machine_is_compatible("samsung,exynos5440")) { 207 if (of_machine_is_compatible("samsung,exynos5440")) {
281 u32 status; 208 u32 status;
@@ -315,6 +242,7 @@ void __init exynos_init_late(void)
315 return; 242 return;
316 243
317 pm_genpd_poweroff_unused(); 244 pm_genpd_poweroff_unused();
245 exynos_pm_init();
318} 246}
319 247
320static int __init exynos_fdt_map_chipid(unsigned long node, const char *uname, 248static int __init exynos_fdt_map_chipid(unsigned long node, const char *uname,
@@ -345,6 +273,28 @@ static int __init exynos_fdt_map_chipid(unsigned long node, const char *uname,
345 * 273 *
346 * register the standard cpu IO areas 274 * register the standard cpu IO areas
347 */ 275 */
276static void __init exynos_map_io(void)
277{
278 if (soc_is_exynos4())
279 iotable_init(exynos4_iodesc, ARRAY_SIZE(exynos4_iodesc));
280
281 if (soc_is_exynos5())
282 iotable_init(exynos5_iodesc, ARRAY_SIZE(exynos5_iodesc));
283
284 if (soc_is_exynos4210()) {
285 if (samsung_rev() == EXYNOS4210_REV_0)
286 iotable_init(exynos4_iodesc0,
287 ARRAY_SIZE(exynos4_iodesc0));
288 else
289 iotable_init(exynos4_iodesc1,
290 ARRAY_SIZE(exynos4_iodesc1));
291 iotable_init(exynos4210_iodesc, ARRAY_SIZE(exynos4210_iodesc));
292 }
293 if (soc_is_exynos4212() || soc_is_exynos4412())
294 iotable_init(exynos4x12_iodesc, ARRAY_SIZE(exynos4x12_iodesc));
295 if (soc_is_exynos5250())
296 iotable_init(exynos5250_iodesc, ARRAY_SIZE(exynos5250_iodesc));
297}
348 298
349void __init exynos_init_io(void) 299void __init exynos_init_io(void)
350{ 300{
@@ -355,30 +305,7 @@ void __init exynos_init_io(void)
355 /* detect cpu id and rev. */ 305 /* detect cpu id and rev. */
356 s5p_init_cpu(S5P_VA_CHIPID); 306 s5p_init_cpu(S5P_VA_CHIPID);
357 307
358 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); 308 exynos_map_io();
359}
360
361static void __init exynos4_map_io(void)
362{
363 iotable_init(exynos4_iodesc, ARRAY_SIZE(exynos4_iodesc));
364
365 if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_0)
366 iotable_init(exynos4_iodesc0, ARRAY_SIZE(exynos4_iodesc0));
367 else
368 iotable_init(exynos4_iodesc1, ARRAY_SIZE(exynos4_iodesc1));
369
370 if (soc_is_exynos4210())
371 iotable_init(exynos4210_iodesc, ARRAY_SIZE(exynos4210_iodesc));
372 if (soc_is_exynos4212() || soc_is_exynos4412())
373 iotable_init(exynos4x12_iodesc, ARRAY_SIZE(exynos4x12_iodesc));
374}
375
376static void __init exynos5_map_io(void)
377{
378 iotable_init(exynos5_iodesc, ARRAY_SIZE(exynos5_iodesc));
379
380 if (soc_is_exynos5250())
381 iotable_init(exynos5250_iodesc, ARRAY_SIZE(exynos5250_iodesc));
382} 309}
383 310
384struct bus_type exynos_subsys = { 311struct bus_type exynos_subsys = {
@@ -386,10 +313,6 @@ struct bus_type exynos_subsys = {
386 .dev_name = "exynos-core", 313 .dev_name = "exynos-core",
387}; 314};
388 315
389static struct device exynos4_dev = {
390 .bus = &exynos_subsys,
391};
392
393static int __init exynos_core_init(void) 316static int __init exynos_core_init(void)
394{ 317{
395 return subsys_system_register(&exynos_subsys, NULL); 318 return subsys_system_register(&exynos_subsys, NULL);
@@ -404,15 +327,85 @@ static int __init exynos4_l2x0_cache_init(void)
404 if (ret) 327 if (ret)
405 return ret; 328 return ret;
406 329
407 l2x0_regs_phys = virt_to_phys(&l2x0_saved_regs); 330 if (IS_ENABLED(CONFIG_S5P_SLEEP)) {
408 clean_dcache_area(&l2x0_regs_phys, sizeof(unsigned long)); 331 l2x0_regs_phys = virt_to_phys(&l2x0_saved_regs);
332 clean_dcache_area(&l2x0_regs_phys, sizeof(unsigned long));
333 }
409 return 0; 334 return 0;
410} 335}
411early_initcall(exynos4_l2x0_cache_init); 336early_initcall(exynos4_l2x0_cache_init);
412 337
413static int __init exynos_init(void) 338static void __init exynos_dt_machine_init(void)
414{ 339{
415 printk(KERN_INFO "EXYNOS: Initializing architecture\n"); 340 struct device_node *i2c_np;
341 const char *i2c_compat = "samsung,s3c2440-i2c";
342 unsigned int tmp;
343 int id;
344
345 /*
346 * Exynos5's legacy i2c controller and new high speed i2c
347 * controller have muxed interrupt sources. By default the
348 * interrupts for 4-channel HS-I2C controller are enabled.
349 * If node for first four channels of legacy i2c controller
350 * are available then re-configure the interrupts via the
351 * system register.
352 */
353 if (soc_is_exynos5()) {
354 for_each_compatible_node(i2c_np, NULL, i2c_compat) {
355 if (of_device_is_available(i2c_np)) {
356 id = of_alias_get_id(i2c_np, "i2c");
357 if (id < 4) {
358 tmp = readl(EXYNOS5_SYS_I2C_CFG);
359 writel(tmp & ~(0x1 << id),
360 EXYNOS5_SYS_I2C_CFG);
361 }
362 }
363 }
364 }
416 365
417 return device_register(&exynos4_dev); 366 exynos_cpuidle_init();
367 exynos_cpufreq_init();
368
369 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
418} 370}
371
372static char const *exynos_dt_compat[] __initconst = {
373 "samsung,exynos4",
374 "samsung,exynos4210",
375 "samsung,exynos4212",
376 "samsung,exynos4412",
377 "samsung,exynos5",
378 "samsung,exynos5250",
379 "samsung,exynos5420",
380 "samsung,exynos5440",
381 NULL
382};
383
384static void __init exynos_reserve(void)
385{
386#ifdef CONFIG_S5P_DEV_MFC
387 int i;
388 char *mfc_mem[] = {
389 "samsung,mfc-v5",
390 "samsung,mfc-v6",
391 "samsung,mfc-v7",
392 };
393
394 for (i = 0; i < ARRAY_SIZE(mfc_mem); i++)
395 if (of_scan_flat_dt(s5p_fdt_alloc_mfc_mem, mfc_mem[i]))
396 break;
397#endif
398}
399
400DT_MACHINE_START(EXYNOS_DT, "SAMSUNG EXYNOS (Flattened Device Tree)")
401 /* Maintainer: Thomas Abraham <thomas.abraham@linaro.org> */
402 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
403 .smp = smp_ops(exynos_smp_ops),
404 .map_io = exynos_init_io,
405 .init_early = exynos_firmware_init,
406 .init_machine = exynos_dt_machine_init,
407 .init_late = exynos_init_late,
408 .dt_compat = exynos_dt_compat,
409 .restart = exynos_restart,
410 .reserve = exynos_reserve,
411MACHINE_END
diff --git a/arch/arm/mach-exynos/include/mach/hardware.h b/arch/arm/mach-exynos/include/mach/hardware.h
deleted file mode 100644
index 5109eb232f23..000000000000
--- a/arch/arm/mach-exynos/include/mach/hardware.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/* linux/arch/arm/mach-exynos4/include/mach/hardware.h
2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * EXYNOS4 - 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-exynos/include/mach/pm-core.h b/arch/arm/mach-exynos/include/mach/pm-core.h
deleted file mode 100644
index dc0697c2fa92..000000000000
--- a/arch/arm/mach-exynos/include/mach/pm-core.h
+++ /dev/null
@@ -1,75 +0,0 @@
1/* linux/arch/arm/mach-exynos4/include/mach/pm-core.h
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Based on arch/arm/mach-s3c2410/include/mach/pm-core.h,
7 * Copyright 2008 Simtec Electronics
8 * Ben Dooks <ben@simtec.co.uk>
9 * http://armlinux.simtec.co.uk/
10 *
11 * EXYNOS4210 - PM core support for arch/arm/plat-s5p/pm.c
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_PM_CORE_H
19#define __ASM_ARCH_PM_CORE_H __FILE__
20
21#include <linux/of.h>
22#include <mach/map.h>
23
24#define S5P_EINT_WAKEUP_MASK (S5P_VA_PMU + 0x0604)
25#define S5P_WAKEUP_MASK (S5P_VA_PMU + 0x0608)
26
27#ifdef CONFIG_PINCTRL_EXYNOS
28extern u32 exynos_get_eint_wake_mask(void);
29#else
30static inline u32 exynos_get_eint_wake_mask(void) { return 0xffffffff; }
31#endif
32
33static inline void s3c_pm_debug_init_uart(void)
34{
35 /* nothing here yet */
36}
37
38static inline void s3c_pm_arch_prepare_irqs(void)
39{
40 __raw_writel(exynos_get_eint_wake_mask(), S5P_EINT_WAKEUP_MASK);
41 __raw_writel(s3c_irqwake_intmask & ~(1 << 31), S5P_WAKEUP_MASK);
42}
43
44static inline void s3c_pm_arch_stop_clocks(void)
45{
46 /* nothing here yet */
47}
48
49static inline void s3c_pm_arch_show_resume_irqs(void)
50{
51 /* nothing here yet */
52}
53
54static inline void s3c_pm_arch_update_uart(void __iomem *regs,
55 struct pm_uart_save *save)
56{
57 /* nothing here yet */
58}
59
60static inline void s3c_pm_restored_gpios(void)
61{
62 /* nothing here yet */
63}
64
65static inline void samsung_pm_saved_gpios(void)
66{
67 /* nothing here yet */
68}
69
70/* Compatibility definitions to make plat-samsung/pm.c compile */
71#define IRQ_EINT_BIT(x) 1
72#define s3c_irqwake_intallow 0
73#define s3c_irqwake_eintallow 0
74
75#endif /* __ASM_ARCH_PM_CORE_H */
diff --git a/arch/arm/mach-exynos/include/mach/timex.h b/arch/arm/mach-exynos/include/mach/timex.h
deleted file mode 100644
index 6d138750a708..000000000000
--- a/arch/arm/mach-exynos/include/mach/timex.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/* linux/arch/arm/mach-exynos4/include/mach/timex.h
2 *
3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Copyright (c) 2003-2010 Simtec Electronics
7 * Ben Dooks <ben@simtec.co.uk>
8 *
9 * Based on arch/arm/mach-s5p6442/include/mach/timex.h
10 *
11 * EXYNOS4 - 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-exynos/include/mach/uncompress.h b/arch/arm/mach-exynos/include/mach/uncompress.h
deleted file mode 100644
index 5d7ce36be46f..000000000000
--- a/arch/arm/mach-exynos/include/mach/uncompress.h
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * Copyright (c) 2010-2012 Samsung Electronics Co., Ltd.
3 * http://www.samsung.com
4 *
5 * EXYNOS - uncompress code
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 __ASM_ARCH_UNCOMPRESS_H
13#define __ASM_ARCH_UNCOMPRESS_H __FILE__
14
15#include <asm/mach-types.h>
16
17#include <mach/map.h>
18#include <plat/uncompress.h>
19
20static unsigned int __raw_readl(unsigned int ptr)
21{
22 return *((volatile unsigned int *)ptr);
23}
24
25static void arch_detect_cpu(void)
26{
27 u32 chip_id = __raw_readl(EXYNOS_PA_CHIPID);
28
29 /*
30 * product_id is bits 31:12
31 * bits 23:20 describe the exynosX family
32 * bits 27:24 describe the exynosX family in exynos5420
33 */
34 chip_id >>= 20;
35
36 if ((chip_id & 0x0f) == 0x5 || (chip_id & 0xf0) == 0x50)
37 uart_base = (volatile u8 *)EXYNOS5_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT);
38 else
39 uart_base = (volatile u8 *)EXYNOS4_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT);
40
41 /*
42 * For preventing FIFO overrun or infinite loop of UART console,
43 * fifo_max should be the minimum fifo size of all of the UART channels
44 */
45 fifo_mask = S5PV210_UFSTAT_TXMASK;
46 fifo_max = 15 << S5PV210_UFSTAT_TXSHIFT;
47}
48#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c
deleted file mode 100644
index d3e54b7644d7..000000000000
--- a/arch/arm/mach-exynos/mach-exynos4-dt.c
+++ /dev/null
@@ -1,59 +0,0 @@
1/*
2 * Samsung's EXYNOS4 flattened device tree enabled machine
3 *
4 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com
6 * Copyright (c) 2010-2011 Linaro Ltd.
7 * www.linaro.org
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/of_platform.h>
15#include <linux/of_fdt.h>
16
17#include <asm/mach/arch.h>
18#include <plat/mfc.h>
19
20#include "common.h"
21
22static void __init exynos4_dt_machine_init(void)
23{
24 exynos_cpuidle_init();
25 exynos_cpufreq_init();
26
27 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
28}
29
30static char const *exynos4_dt_compat[] __initdata = {
31 "samsung,exynos4210",
32 "samsung,exynos4212",
33 "samsung,exynos4412",
34 NULL
35};
36
37static void __init exynos4_reserve(void)
38{
39#ifdef CONFIG_S5P_DEV_MFC
40 struct s5p_mfc_dt_meminfo mfc_mem;
41
42 /* Reserve memory for MFC only if it's available */
43 mfc_mem.compatible = "samsung,mfc-v5";
44 if (of_scan_flat_dt(s5p_fdt_find_mfc_mem, &mfc_mem))
45 s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize, mfc_mem.loff,
46 mfc_mem.lsize);
47#endif
48}
49DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
50 /* Maintainer: Thomas Abraham <thomas.abraham@linaro.org> */
51 .smp = smp_ops(exynos_smp_ops),
52 .map_io = exynos_init_io,
53 .init_early = exynos_firmware_init,
54 .init_machine = exynos4_dt_machine_init,
55 .init_late = exynos_init_late,
56 .dt_compat = exynos4_dt_compat,
57 .restart = exynos4_restart,
58 .reserve = exynos4_reserve,
59MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c
deleted file mode 100644
index 37ea261f0f6c..000000000000
--- a/arch/arm/mach-exynos/mach-exynos5-dt.c
+++ /dev/null
@@ -1,81 +0,0 @@
1/*
2 * SAMSUNG EXYNOS5250 Flattened Device Tree enabled machine
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com
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/of_platform.h>
13#include <linux/of_fdt.h>
14#include <linux/io.h>
15
16#include <asm/mach/arch.h>
17#include <plat/mfc.h>
18
19#include "common.h"
20#include "regs-pmu.h"
21
22static void __init exynos5_dt_machine_init(void)
23{
24 struct device_node *i2c_np;
25 const char *i2c_compat = "samsung,s3c2440-i2c";
26 unsigned int tmp;
27
28 /*
29 * Exynos5's legacy i2c controller and new high speed i2c
30 * controller have muxed interrupt sources. By default the
31 * interrupts for 4-channel HS-I2C controller are enabled.
32 * If node for first four channels of legacy i2c controller
33 * are available then re-configure the interrupts via the
34 * system register.
35 */
36 for_each_compatible_node(i2c_np, NULL, i2c_compat) {
37 if (of_device_is_available(i2c_np)) {
38 if (of_alias_get_id(i2c_np, "i2c") < 4) {
39 tmp = readl(EXYNOS5_SYS_I2C_CFG);
40 writel(tmp & ~(0x1 << of_alias_get_id(i2c_np, "i2c")),
41 EXYNOS5_SYS_I2C_CFG);
42 }
43 }
44 }
45
46 exynos_cpuidle_init();
47 exynos_cpufreq_init();
48
49 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
50}
51
52static char const *exynos5_dt_compat[] __initdata = {
53 "samsung,exynos5250",
54 "samsung,exynos5420",
55 "samsung,exynos5440",
56 NULL
57};
58
59static void __init exynos5_reserve(void)
60{
61#ifdef CONFIG_S5P_DEV_MFC
62 struct s5p_mfc_dt_meminfo mfc_mem;
63
64 /* Reserve memory for MFC only if it's available */
65 mfc_mem.compatible = "samsung,mfc-v6";
66 if (of_scan_flat_dt(s5p_fdt_find_mfc_mem, &mfc_mem))
67 s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize, mfc_mem.loff,
68 mfc_mem.lsize);
69#endif
70}
71
72DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
73 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
74 .smp = smp_ops(exynos_smp_ops),
75 .map_io = exynos_init_io,
76 .init_machine = exynos5_dt_machine_init,
77 .init_late = exynos_init_late,
78 .dt_compat = exynos5_dt_compat,
79 .restart = exynos5_restart,
80 .reserve = exynos5_reserve,
81MACHINE_END
diff --git a/arch/arm/mach-exynos/mfc.h b/arch/arm/mach-exynos/mfc.h
new file mode 100644
index 000000000000..dec93cd5b3c6
--- /dev/null
+++ b/arch/arm/mach-exynos/mfc.h
@@ -0,0 +1,16 @@
1/*
2 * Copyright (C) 2013 Samsung Electronics Co.Ltd
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 */
9
10#ifndef __MACH_EXYNOS_MFC_H
11#define __MACH_EXYNOS_MFC_H __FILE__
12
13int __init s5p_fdt_alloc_mfc_mem(unsigned long node, const char *uname,
14 int depth, void *data);
15
16#endif /* __MACH_EXYNOS_MFC_H */
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index 8ea02f63fed9..03e5e9f94705 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -26,8 +26,6 @@
26#include <asm/smp_scu.h> 26#include <asm/smp_scu.h>
27#include <asm/firmware.h> 27#include <asm/firmware.h>
28 28
29#include <mach/hardware.h>
30
31#include <plat/cpu.h> 29#include <plat/cpu.h>
32 30
33#include "common.h" 31#include "common.h"
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index e00025bbbe89..15af0ceb0a66 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -17,72 +17,33 @@
17#include <linux/suspend.h> 17#include <linux/suspend.h>
18#include <linux/syscore_ops.h> 18#include <linux/syscore_ops.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/irqchip/arm-gic.h>
20#include <linux/err.h> 21#include <linux/err.h>
21#include <linux/clk.h> 22#include <linux/clk.h>
22 23
23#include <asm/cacheflush.h> 24#include <asm/cacheflush.h>
24#include <asm/hardware/cache-l2x0.h> 25#include <asm/hardware/cache-l2x0.h>
25#include <asm/smp_scu.h> 26#include <asm/smp_scu.h>
27#include <asm/suspend.h>
26 28
27#include <plat/cpu.h> 29#include <plat/cpu.h>
28#include <plat/pm.h> 30#include <plat/pm-common.h>
29#include <plat/pll.h> 31#include <plat/pll.h>
30#include <plat/regs-srom.h> 32#include <plat/regs-srom.h>
31 33
32#include <mach/map.h> 34#include <mach/map.h>
33#include <mach/pm-core.h>
34 35
35#include "common.h" 36#include "common.h"
36#include "regs-pmu.h" 37#include "regs-pmu.h"
37 38
38#define EXYNOS4_EPLL_LOCK (S5P_VA_CMU + 0x0C010) 39/**
39#define EXYNOS4_VPLL_LOCK (S5P_VA_CMU + 0x0C020) 40 * struct exynos_wkup_irq - Exynos GIC to PMU IRQ mapping
40 41 * @hwirq: Hardware IRQ signal of the GIC
41#define EXYNOS4_EPLL_CON0 (S5P_VA_CMU + 0x0C110) 42 * @mask: Mask in PMU wake-up mask register
42#define EXYNOS4_EPLL_CON1 (S5P_VA_CMU + 0x0C114) 43 */
43#define EXYNOS4_VPLL_CON0 (S5P_VA_CMU + 0x0C120) 44struct exynos_wkup_irq {
44#define EXYNOS4_VPLL_CON1 (S5P_VA_CMU + 0x0C124) 45 unsigned int hwirq;
45 46 u32 mask;
46#define EXYNOS4_CLKSRC_MASK_TOP (S5P_VA_CMU + 0x0C310)
47#define EXYNOS4_CLKSRC_MASK_CAM (S5P_VA_CMU + 0x0C320)
48#define EXYNOS4_CLKSRC_MASK_TV (S5P_VA_CMU + 0x0C324)
49#define EXYNOS4_CLKSRC_MASK_LCD0 (S5P_VA_CMU + 0x0C334)
50#define EXYNOS4_CLKSRC_MASK_MAUDIO (S5P_VA_CMU + 0x0C33C)
51#define EXYNOS4_CLKSRC_MASK_FSYS (S5P_VA_CMU + 0x0C340)
52#define EXYNOS4_CLKSRC_MASK_PERIL0 (S5P_VA_CMU + 0x0C350)
53#define EXYNOS4_CLKSRC_MASK_PERIL1 (S5P_VA_CMU + 0x0C354)
54
55#define EXYNOS4_CLKSRC_MASK_DMC (S5P_VA_CMU + 0x10300)
56
57#define EXYNOS4_EPLLCON0_LOCKED_SHIFT (29)
58#define EXYNOS4_VPLLCON0_LOCKED_SHIFT (29)
59
60#define EXYNOS4210_CLKSRC_MASK_LCD1 (S5P_VA_CMU + 0x0C338)
61
62static const struct sleep_save exynos4_set_clksrc[] = {
63 { .reg = EXYNOS4_CLKSRC_MASK_TOP , .val = 0x00000001, },
64 { .reg = EXYNOS4_CLKSRC_MASK_CAM , .val = 0x11111111, },
65 { .reg = EXYNOS4_CLKSRC_MASK_TV , .val = 0x00000111, },
66 { .reg = EXYNOS4_CLKSRC_MASK_LCD0 , .val = 0x00001111, },
67 { .reg = EXYNOS4_CLKSRC_MASK_MAUDIO , .val = 0x00000001, },
68 { .reg = EXYNOS4_CLKSRC_MASK_FSYS , .val = 0x01011111, },
69 { .reg = EXYNOS4_CLKSRC_MASK_PERIL0 , .val = 0x01111111, },
70 { .reg = EXYNOS4_CLKSRC_MASK_PERIL1 , .val = 0x01110111, },
71 { .reg = EXYNOS4_CLKSRC_MASK_DMC , .val = 0x00010000, },
72};
73
74static const struct sleep_save exynos4210_set_clksrc[] = {
75 { .reg = EXYNOS4210_CLKSRC_MASK_LCD1 , .val = 0x00001111, },
76};
77
78static struct sleep_save exynos4_epll_save[] = {
79 SAVE_ITEM(EXYNOS4_EPLL_CON0),
80 SAVE_ITEM(EXYNOS4_EPLL_CON1),
81};
82
83static struct sleep_save exynos4_vpll_save[] = {
84 SAVE_ITEM(EXYNOS4_VPLL_CON0),
85 SAVE_ITEM(EXYNOS4_VPLL_CON1),
86}; 47};
87 48
88static struct sleep_save exynos5_sys_save[] = { 49static struct sleep_save exynos5_sys_save[] = {
@@ -98,6 +59,46 @@ static struct sleep_save exynos_core_save[] = {
98 SAVE_ITEM(S5P_SROM_BC3), 59 SAVE_ITEM(S5P_SROM_BC3),
99}; 60};
100 61
62/*
63 * GIC wake-up support
64 */
65
66static u32 exynos_irqwake_intmask = 0xffffffff;
67
68static const struct exynos_wkup_irq exynos4_wkup_irq[] = {
69 { 76, BIT(1) }, /* RTC alarm */
70 { 77, BIT(2) }, /* RTC tick */
71 { /* sentinel */ },
72};
73
74static const struct exynos_wkup_irq exynos5250_wkup_irq[] = {
75 { 75, BIT(1) }, /* RTC alarm */
76 { 76, BIT(2) }, /* RTC tick */
77 { /* sentinel */ },
78};
79
80static int exynos_irq_set_wake(struct irq_data *data, unsigned int state)
81{
82 const struct exynos_wkup_irq *wkup_irq;
83
84 if (soc_is_exynos5250())
85 wkup_irq = exynos5250_wkup_irq;
86 else
87 wkup_irq = exynos4_wkup_irq;
88
89 while (wkup_irq->mask) {
90 if (wkup_irq->hwirq == data->hwirq) {
91 if (!state)
92 exynos_irqwake_intmask |= wkup_irq->mask;
93 else
94 exynos_irqwake_intmask &= ~wkup_irq->mask;
95 return 0;
96 }
97 ++wkup_irq;
98 }
99
100 return -ENOENT;
101}
101 102
102/* For Cortex-A9 Diagnostic and Power control register */ 103/* For Cortex-A9 Diagnostic and Power control register */
103static unsigned int save_arm_register[2]; 104static unsigned int save_arm_register[2];
@@ -122,12 +123,13 @@ static void exynos_pm_prepare(void)
122{ 123{
123 unsigned int tmp; 124 unsigned int tmp;
124 125
126 /* Set wake-up mask registers */
127 __raw_writel(exynos_get_eint_wake_mask(), S5P_EINT_WAKEUP_MASK);
128 __raw_writel(exynos_irqwake_intmask & ~(1 << 31), S5P_WAKEUP_MASK);
129
125 s3c_pm_do_save(exynos_core_save, ARRAY_SIZE(exynos_core_save)); 130 s3c_pm_do_save(exynos_core_save, ARRAY_SIZE(exynos_core_save));
126 131
127 if (!soc_is_exynos5250()) { 132 if (soc_is_exynos5250()) {
128 s3c_pm_do_save(exynos4_epll_save, ARRAY_SIZE(exynos4_epll_save));
129 s3c_pm_do_save(exynos4_vpll_save, ARRAY_SIZE(exynos4_vpll_save));
130 } else {
131 s3c_pm_do_save(exynos5_sys_save, ARRAY_SIZE(exynos5_sys_save)); 133 s3c_pm_do_save(exynos5_sys_save, ARRAY_SIZE(exynos5_sys_save));
132 /* Disable USE_RETENTION of JPEG_MEM_OPTION */ 134 /* Disable USE_RETENTION of JPEG_MEM_OPTION */
133 tmp = __raw_readl(EXYNOS5_JPEG_MEM_OPTION); 135 tmp = __raw_readl(EXYNOS5_JPEG_MEM_OPTION);
@@ -142,127 +144,8 @@ static void exynos_pm_prepare(void)
142 144
143 /* ensure at least INFORM0 has the resume address */ 145 /* ensure at least INFORM0 has the resume address */
144 146
145 __raw_writel(virt_to_phys(s3c_cpu_resume), S5P_INFORM0); 147 __raw_writel(virt_to_phys(exynos_cpu_resume), S5P_INFORM0);
146
147 /* Before enter central sequence mode, clock src register have to set */
148
149 if (!soc_is_exynos5250())
150 s3c_pm_do_restore_core(exynos4_set_clksrc, ARRAY_SIZE(exynos4_set_clksrc));
151
152 if (soc_is_exynos4210())
153 s3c_pm_do_restore_core(exynos4210_set_clksrc, ARRAY_SIZE(exynos4210_set_clksrc));
154
155}
156
157static int exynos_pm_add(struct device *dev, struct subsys_interface *sif)
158{
159 pm_cpu_prep = exynos_pm_prepare;
160 pm_cpu_sleep = exynos_cpu_suspend;
161
162 return 0;
163}
164
165static unsigned long pll_base_rate;
166
167static void exynos4_restore_pll(void)
168{
169 unsigned long pll_con, locktime, lockcnt;
170 unsigned long pll_in_rate;
171 unsigned int p_div, epll_wait = 0, vpll_wait = 0;
172
173 if (pll_base_rate == 0)
174 return;
175
176 pll_in_rate = pll_base_rate;
177
178 /* EPLL */
179 pll_con = exynos4_epll_save[0].val;
180
181 if (pll_con & (1 << 31)) {
182 pll_con &= (PLL46XX_PDIV_MASK << PLL46XX_PDIV_SHIFT);
183 p_div = (pll_con >> PLL46XX_PDIV_SHIFT);
184
185 pll_in_rate /= 1000000;
186
187 locktime = (3000 / pll_in_rate) * p_div;
188 lockcnt = locktime * 10000 / (10000 / pll_in_rate);
189
190 __raw_writel(lockcnt, EXYNOS4_EPLL_LOCK);
191
192 s3c_pm_do_restore_core(exynos4_epll_save,
193 ARRAY_SIZE(exynos4_epll_save));
194 epll_wait = 1;
195 }
196
197 pll_in_rate = pll_base_rate;
198
199 /* VPLL */
200 pll_con = exynos4_vpll_save[0].val;
201
202 if (pll_con & (1 << 31)) {
203 pll_in_rate /= 1000000;
204 /* 750us */
205 locktime = 750;
206 lockcnt = locktime * 10000 / (10000 / pll_in_rate);
207
208 __raw_writel(lockcnt, EXYNOS4_VPLL_LOCK);
209
210 s3c_pm_do_restore_core(exynos4_vpll_save,
211 ARRAY_SIZE(exynos4_vpll_save));
212 vpll_wait = 1;
213 }
214
215 /* Wait PLL locking */
216
217 do {
218 if (epll_wait) {
219 pll_con = __raw_readl(EXYNOS4_EPLL_CON0);
220 if (pll_con & (1 << EXYNOS4_EPLLCON0_LOCKED_SHIFT))
221 epll_wait = 0;
222 }
223
224 if (vpll_wait) {
225 pll_con = __raw_readl(EXYNOS4_VPLL_CON0);
226 if (pll_con & (1 << EXYNOS4_VPLLCON0_LOCKED_SHIFT))
227 vpll_wait = 0;
228 }
229 } while (epll_wait || vpll_wait);
230}
231
232static struct subsys_interface exynos_pm_interface = {
233 .name = "exynos_pm",
234 .subsys = &exynos_subsys,
235 .add_dev = exynos_pm_add,
236};
237
238static __init int exynos_pm_drvinit(void)
239{
240 struct clk *pll_base;
241 unsigned int tmp;
242
243 if (soc_is_exynos5440())
244 return 0;
245
246 s3c_pm_init();
247
248 /* All wakeup disable */
249
250 tmp = __raw_readl(S5P_WAKEUP_MASK);
251 tmp |= ((0xFF << 8) | (0x1F << 1));
252 __raw_writel(tmp, S5P_WAKEUP_MASK);
253
254 if (!soc_is_exynos5250()) {
255 pll_base = clk_get(NULL, "xtal");
256
257 if (!IS_ERR(pll_base)) {
258 pll_base_rate = clk_get_rate(pll_base);
259 clk_put(pll_base);
260 }
261 }
262
263 return subsys_interface_register(&exynos_pm_interface);
264} 148}
265arch_initcall(exynos_pm_drvinit);
266 149
267static int exynos_pm_suspend(void) 150static int exynos_pm_suspend(void)
268{ 151{
@@ -343,13 +226,8 @@ static void exynos_pm_resume(void)
343 226
344 s3c_pm_do_restore_core(exynos_core_save, ARRAY_SIZE(exynos_core_save)); 227 s3c_pm_do_restore_core(exynos_core_save, ARRAY_SIZE(exynos_core_save));
345 228
346 if (!soc_is_exynos5250()) { 229 if (IS_ENABLED(CONFIG_SMP) && !soc_is_exynos5250())
347 exynos4_restore_pll();
348
349#ifdef CONFIG_SMP
350 scu_enable(S5P_VA_SCU); 230 scu_enable(S5P_VA_SCU);
351#endif
352 }
353 231
354early_wakeup: 232early_wakeup:
355 233
@@ -364,12 +242,80 @@ static struct syscore_ops exynos_pm_syscore_ops = {
364 .resume = exynos_pm_resume, 242 .resume = exynos_pm_resume,
365}; 243};
366 244
367static __init int exynos_pm_syscore_init(void) 245/*
246 * Suspend Ops
247 */
248
249static int exynos_suspend_enter(suspend_state_t state)
368{ 250{
369 if (soc_is_exynos5440()) 251 int ret;
370 return 0; 252
253 s3c_pm_debug_init();
254
255 S3C_PMDBG("%s: suspending the system...\n", __func__);
256
257 S3C_PMDBG("%s: wakeup masks: %08x,%08x\n", __func__,
258 exynos_irqwake_intmask, exynos_get_eint_wake_mask());
259
260 if (exynos_irqwake_intmask == -1U
261 && exynos_get_eint_wake_mask() == -1U) {
262 pr_err("%s: No wake-up sources!\n", __func__);
263 pr_err("%s: Aborting sleep\n", __func__);
264 return -EINVAL;
265 }
266
267 s3c_pm_save_uarts();
268 exynos_pm_prepare();
269 flush_cache_all();
270 s3c_pm_check_store();
271
272 ret = cpu_suspend(0, exynos_cpu_suspend);
273 if (ret)
274 return ret;
275
276 s3c_pm_restore_uarts();
277
278 S3C_PMDBG("%s: wakeup stat: %08x\n", __func__,
279 __raw_readl(S5P_WAKEUP_STAT));
280
281 s3c_pm_check_restore();
282
283 S3C_PMDBG("%s: resuming the system...\n", __func__);
371 284
372 register_syscore_ops(&exynos_pm_syscore_ops);
373 return 0; 285 return 0;
374} 286}
375arch_initcall(exynos_pm_syscore_init); 287
288static int exynos_suspend_prepare(void)
289{
290 s3c_pm_check_prepare();
291
292 return 0;
293}
294
295static void exynos_suspend_finish(void)
296{
297 s3c_pm_check_cleanup();
298}
299
300static const struct platform_suspend_ops exynos_suspend_ops = {
301 .enter = exynos_suspend_enter,
302 .prepare = exynos_suspend_prepare,
303 .finish = exynos_suspend_finish,
304 .valid = suspend_valid_only_mem,
305};
306
307void __init exynos_pm_init(void)
308{
309 u32 tmp;
310
311 /* Platform-specific GIC callback */
312 gic_arch_extn.irq_set_wake = exynos_irq_set_wake;
313
314 /* All wakeup disable */
315 tmp = __raw_readl(S5P_WAKEUP_MASK);
316 tmp |= ((0xFF << 8) | (0x1F << 1));
317 __raw_writel(tmp, S5P_WAKEUP_MASK);
318
319 register_syscore_ops(&exynos_pm_syscore_ops);
320 suspend_set_ops(&exynos_suspend_ops);
321}
diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c
index 8fd24882f0b1..fe6570ebbdde 100644
--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -22,8 +22,6 @@
22#include <linux/of_platform.h> 22#include <linux/of_platform.h>
23#include <linux/sched.h> 23#include <linux/sched.h>
24 24
25#include <plat/devs.h>
26
27#include "regs-pmu.h" 25#include "regs-pmu.h"
28 26
29/* 27/*
diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h
index 7c029ce27711..4f6a2560d022 100644
--- a/arch/arm/mach-exynos/regs-pmu.h
+++ b/arch/arm/mach-exynos/regs-pmu.h
@@ -26,11 +26,12 @@
26#define S5P_USE_STANDBY_WFI0 (1 << 16) 26#define S5P_USE_STANDBY_WFI0 (1 << 16)
27#define S5P_USE_STANDBY_WFE0 (1 << 24) 27#define S5P_USE_STANDBY_WFE0 (1 << 24)
28 28
29#define S5P_SWRESET S5P_PMUREG(0x0400)
30#define EXYNOS_SWRESET S5P_PMUREG(0x0400) 29#define EXYNOS_SWRESET S5P_PMUREG(0x0400)
31#define EXYNOS5440_SWRESET S5P_PMUREG(0x00C4) 30#define EXYNOS5440_SWRESET S5P_PMUREG(0x00C4)
32 31
33#define S5P_WAKEUP_STAT S5P_PMUREG(0x0600) 32#define S5P_WAKEUP_STAT S5P_PMUREG(0x0600)
33#define S5P_EINT_WAKEUP_MASK S5P_PMUREG(0x0604)
34#define S5P_WAKEUP_MASK S5P_PMUREG(0x0608)
34 35
35#define S5P_INFORM0 S5P_PMUREG(0x0800) 36#define S5P_INFORM0 S5P_PMUREG(0x0800)
36#define S5P_INFORM1 S5P_PMUREG(0x0804) 37#define S5P_INFORM1 S5P_PMUREG(0x0804)
diff --git a/arch/arm/mach-exynos/sleep.S b/arch/arm/mach-exynos/sleep.S
new file mode 100644
index 000000000000..a2613e944e10
--- /dev/null
+++ b/arch/arm/mach-exynos/sleep.S
@@ -0,0 +1,85 @@
1/*
2 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
3 * http://www.samsung.com
4 *
5 * Exynos low-level resume code
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
18#include <linux/linkage.h>
19#include <asm/asm-offsets.h>
20#include <asm/hardware/cache-l2x0.h>
21
22#define CPU_MASK 0xff0ffff0
23#define CPU_CORTEX_A9 0x410fc090
24
25 /*
26 * The following code is located into the .data section. This is to
27 * allow l2x0_regs_phys to be accessed with a relative load while we
28 * can't rely on any MMU translation. We could have put l2x0_regs_phys
29 * in the .text section as well, but some setups might insist on it to
30 * be truly read-only. (Reference from: arch/arm/kernel/sleep.S)
31 */
32 .data
33 .align
34
35 /*
36 * sleep magic, to allow the bootloader to check for an valid
37 * image to resume to. Must be the first word before the
38 * exynos_cpu_resume entry.
39 */
40
41 .word 0x2bedf00d
42
43 /*
44 * exynos_cpu_resume
45 *
46 * resume code entry for bootloader to call
47 */
48
49ENTRY(exynos_cpu_resume)
50#ifdef CONFIG_CACHE_L2X0
51 mrc p15, 0, r0, c0, c0, 0
52 ldr r1, =CPU_MASK
53 and r0, r0, r1
54 ldr r1, =CPU_CORTEX_A9
55 cmp r0, r1
56 bne skip_l2_resume
57 adr r0, l2x0_regs_phys
58 ldr r0, [r0]
59 cmp r0, #0
60 beq skip_l2_resume
61 ldr r1, [r0, #L2X0_R_PHY_BASE]
62 ldr r2, [r1, #L2X0_CTRL]
63 tst r2, #0x1
64 bne skip_l2_resume
65 ldr r2, [r0, #L2X0_R_AUX_CTRL]
66 str r2, [r1, #L2X0_AUX_CTRL]
67 ldr r2, [r0, #L2X0_R_TAG_LATENCY]
68 str r2, [r1, #L2X0_TAG_LATENCY_CTRL]
69 ldr r2, [r0, #L2X0_R_DATA_LATENCY]
70 str r2, [r1, #L2X0_DATA_LATENCY_CTRL]
71 ldr r2, [r0, #L2X0_R_PREFETCH_CTRL]
72 str r2, [r1, #L2X0_PREFETCH_CTRL]
73 ldr r2, [r0, #L2X0_R_PWR_CTRL]
74 str r2, [r1, #L2X0_POWER_CTRL]
75 mov r2, #1
76 str r2, [r1, #L2X0_CTRL]
77skip_l2_resume:
78#endif
79 b cpu_resume
80ENDPROC(exynos_cpu_resume)
81#ifdef CONFIG_CACHE_L2X0
82 .globl l2x0_regs_phys
83l2x0_regs_phys:
84 .long 0
85#endif
diff --git a/arch/arm/mach-footbridge/Kconfig b/arch/arm/mach-footbridge/Kconfig
index fba55fb9f47d..07152d00fc50 100644
--- a/arch/arm/mach-footbridge/Kconfig
+++ b/arch/arm/mach-footbridge/Kconfig
@@ -52,6 +52,7 @@ config ARCH_EBSA285_HOST
52 select FOOTBRIDGE_HOST 52 select FOOTBRIDGE_HOST
53 select ISA 53 select ISA
54 select ISA_DMA 54 select ISA_DMA
55 select ARCH_MAY_HAVE_PC_FDC
55 select PCI 56 select PCI
56 help 57 help
57 Say Y here if you intend to run this kernel on the EBSA285 card 58 Say Y here if you intend to run this kernel on the EBSA285 card
@@ -94,6 +95,5 @@ config FOOTBRIDGE_ADDIN
94# EBSA285 board in either host or addin mode 95# EBSA285 board in either host or addin mode
95config ARCH_EBSA285 96config ARCH_EBSA285
96 bool 97 bool
97 select ARCH_MAY_HAVE_PC_FDC
98 98
99endif 99endif
diff --git a/arch/arm/mach-footbridge/Makefile b/arch/arm/mach-footbridge/Makefile
index 0b64dd430d61..c3faa3bc84dd 100644
--- a/arch/arm/mach-footbridge/Makefile
+++ b/arch/arm/mach-footbridge/Makefile
@@ -4,11 +4,12 @@
4 4
5# Object file lists. 5# Object file lists.
6 6
7obj-y := common.o dc21285.o dma.o isa-irq.o 7obj-y := common.o dma.o isa-irq.o
8obj-m := 8obj-m :=
9obj-n := 9obj-n :=
10obj- := 10obj- :=
11 11
12pci-y += dc21285.o
12pci-$(CONFIG_ARCH_CATS) += cats-pci.o 13pci-$(CONFIG_ARCH_CATS) += cats-pci.o
13pci-$(CONFIG_ARCH_EBSA285_HOST) += ebsa285-pci.o 14pci-$(CONFIG_ARCH_EBSA285_HOST) += ebsa285-pci.o
14pci-$(CONFIG_ARCH_NETWINDER) += netwinder-pci.o 15pci-$(CONFIG_ARCH_NETWINDER) += netwinder-pci.o
diff --git a/arch/arm/mach-footbridge/cats-hw.c b/arch/arm/mach-footbridge/cats-hw.c
index 9669cc0b6318..da0415094856 100644
--- a/arch/arm/mach-footbridge/cats-hw.c
+++ b/arch/arm/mach-footbridge/cats-hw.c
@@ -78,9 +78,11 @@ __initcall(cats_hw_init);
78static void __init 78static void __init
79fixup_cats(struct tag *tags, char **cmdline, struct meminfo *mi) 79fixup_cats(struct tag *tags, char **cmdline, struct meminfo *mi)
80{ 80{
81#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
81 screen_info.orig_video_lines = 25; 82 screen_info.orig_video_lines = 25;
82 screen_info.orig_video_points = 16; 83 screen_info.orig_video_points = 16;
83 screen_info.orig_y = 24; 84 screen_info.orig_y = 24;
85#endif
84} 86}
85 87
86MACHINE_START(CATS, "Chalice-CATS") 88MACHINE_START(CATS, "Chalice-CATS")
diff --git a/arch/arm/mach-footbridge/dc21285-timer.c b/arch/arm/mach-footbridge/dc21285-timer.c
index 3971104d32d4..bf7aa7d298e7 100644
--- a/arch/arm/mach-footbridge/dc21285-timer.c
+++ b/arch/arm/mach-footbridge/dc21285-timer.c
@@ -105,7 +105,7 @@ static irqreturn_t timer1_interrupt(int irq, void *dev_id)
105static struct irqaction footbridge_timer_irq = { 105static struct irqaction footbridge_timer_irq = {
106 .name = "dc21285_timer1", 106 .name = "dc21285_timer1",
107 .handler = timer1_interrupt, 107 .handler = timer1_interrupt,
108 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 108 .flags = IRQF_TIMER | IRQF_IRQPOLL,
109 .dev_id = &ckevt_dc21285, 109 .dev_id = &ckevt_dc21285,
110}; 110};
111 111
@@ -125,7 +125,7 @@ void __init footbridge_timer_init(void)
125 clockevents_config_and_register(ce, rate, 0x4, 0xffffff); 125 clockevents_config_and_register(ce, rate, 0x4, 0xffffff);
126} 126}
127 127
128static u32 notrace footbridge_read_sched_clock(void) 128static u64 notrace footbridge_read_sched_clock(void)
129{ 129{
130 return ~*CSR_TIMER3_VALUE; 130 return ~*CSR_TIMER3_VALUE;
131} 131}
@@ -138,5 +138,5 @@ void __init footbridge_sched_clock(void)
138 *CSR_TIMER3_CLR = 0; 138 *CSR_TIMER3_CLR = 0;
139 *CSR_TIMER3_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_DIV16; 139 *CSR_TIMER3_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_DIV16;
140 140
141 setup_sched_clock(footbridge_read_sched_clock, 24, rate); 141 sched_clock_register(footbridge_read_sched_clock, 24, rate);
142} 142}
diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c
index 7c2fdae9a38b..96a3d73ef4bf 100644
--- a/arch/arm/mach-footbridge/dc21285.c
+++ b/arch/arm/mach-footbridge/dc21285.c
@@ -334,15 +334,15 @@ void __init dc21285_preinit(void)
334 /* 334 /*
335 * We don't care if these fail. 335 * We don't care if these fail.
336 */ 336 */
337 dc21285_request_irq(IRQ_PCI_SERR, dc21285_serr_irq, IRQF_DISABLED, 337 dc21285_request_irq(IRQ_PCI_SERR, dc21285_serr_irq, 0,
338 "PCI system error", &serr_timer); 338 "PCI system error", &serr_timer);
339 dc21285_request_irq(IRQ_PCI_PERR, dc21285_parity_irq, IRQF_DISABLED, 339 dc21285_request_irq(IRQ_PCI_PERR, dc21285_parity_irq, 0,
340 "PCI parity error", &perr_timer); 340 "PCI parity error", &perr_timer);
341 dc21285_request_irq(IRQ_PCI_ABORT, dc21285_abort_irq, IRQF_DISABLED, 341 dc21285_request_irq(IRQ_PCI_ABORT, dc21285_abort_irq, 0,
342 "PCI abort", NULL); 342 "PCI abort", NULL);
343 dc21285_request_irq(IRQ_DISCARD_TIMER, dc21285_discard_irq, IRQF_DISABLED, 343 dc21285_request_irq(IRQ_DISCARD_TIMER, dc21285_discard_irq, 0,
344 "Discard timer", NULL); 344 "Discard timer", NULL);
345 dc21285_request_irq(IRQ_PCI_DPERR, dc21285_dparity_irq, IRQF_DISABLED, 345 dc21285_request_irq(IRQ_PCI_DPERR, dc21285_dparity_irq, 0,
346 "PCI data parity", NULL); 346 "PCI data parity", NULL);
347 347
348 if (cfn_mode) { 348 if (cfn_mode) {
diff --git a/arch/arm/mach-footbridge/include/mach/timex.h b/arch/arm/mach-footbridge/include/mach/timex.h
deleted file mode 100644
index d0fea9d6d4ab..000000000000
--- a/arch/arm/mach-footbridge/include/mach/timex.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/*
2 * arch/arm/mach-footbridge/include/mach/timex.h
3 *
4 * Copyright (C) 1998 Russell King
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 * EBSA285 architecture timex specifications
11 */
12
13/*
14 * We assume a constant here; this satisfies the maths in linux/timex.h
15 * and linux/time.h. CLOCK_TICK_RATE is actually system dependent, but
16 * this must be a constant.
17 */
18#define CLOCK_TICK_RATE (50000000/16)
diff --git a/arch/arm/mach-footbridge/isa-timer.c b/arch/arm/mach-footbridge/isa-timer.c
index d9301dd56354..b73f52e196b9 100644
--- a/arch/arm/mach-footbridge/isa-timer.c
+++ b/arch/arm/mach-footbridge/isa-timer.c
@@ -27,7 +27,7 @@ static irqreturn_t pit_timer_interrupt(int irq, void *dev_id)
27static struct irqaction pit_timer_irq = { 27static struct irqaction pit_timer_irq = {
28 .name = "pit", 28 .name = "pit",
29 .handler = pit_timer_interrupt, 29 .handler = pit_timer_interrupt,
30 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 30 .flags = IRQF_TIMER | IRQF_IRQPOLL,
31 .dev_id = &i8253_clockevent, 31 .dev_id = &i8253_clockevent,
32}; 32};
33 33
diff --git a/arch/arm/mach-gemini/idle.c b/arch/arm/mach-gemini/idle.c
index 87dff4f5059e..ddf8ec9d203b 100644
--- a/arch/arm/mach-gemini/idle.c
+++ b/arch/arm/mach-gemini/idle.c
@@ -3,7 +3,7 @@
3 */ 3 */
4 4
5#include <linux/init.h> 5#include <linux/init.h>
6#include <asm/system.h> 6#include <asm/system_misc.h>
7#include <asm/proc-fns.h> 7#include <asm/proc-fns.h>
8 8
9static void gemini_idle(void) 9static void gemini_idle(void)
diff --git a/arch/arm/mach-gemini/include/mach/timex.h b/arch/arm/mach-gemini/include/mach/timex.h
deleted file mode 100644
index dc5690ba975c..000000000000
--- a/arch/arm/mach-gemini/include/mach/timex.h
+++ /dev/null
@@ -1,13 +0,0 @@
1/*
2 * Gemini timex specifications
3 *
4 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
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
12/* When AHB bus frequency is 150MHz */
13#define CLOCK_TICK_RATE 38000000
diff --git a/arch/arm/mach-highbank/Kconfig b/arch/arm/mach-highbank/Kconfig
index 0aded64a9ebc..830b76e70250 100644
--- a/arch/arm/mach-highbank/Kconfig
+++ b/arch/arm/mach-highbank/Kconfig
@@ -5,7 +5,6 @@ config ARCH_HIGHBANK
5 select ARCH_HAS_HOLES_MEMORYMODEL 5 select ARCH_HAS_HOLES_MEMORYMODEL
6 select ARCH_HAS_OPP 6 select ARCH_HAS_OPP
7 select ARCH_SUPPORTS_BIG_ENDIAN 7 select ARCH_SUPPORTS_BIG_ENDIAN
8 select ARCH_WANT_OPTIONAL_GPIOLIB
9 select ARM_AMBA 8 select ARM_AMBA
10 select ARM_ERRATA_764369 if SMP 9 select ARM_ERRATA_764369 if SMP
11 select ARM_ERRATA_775420 10 select ARM_ERRATA_775420
@@ -14,14 +13,8 @@ config ARCH_HIGHBANK
14 select ARM_PSCI 13 select ARM_PSCI
15 select ARM_TIMER_SP804 14 select ARM_TIMER_SP804
16 select CACHE_L2X0 15 select CACHE_L2X0
17 select COMMON_CLK
18 select CPU_V7
19 select GENERIC_CLOCKEVENTS
20 select HAVE_ARM_SCU 16 select HAVE_ARM_SCU
21 select HAVE_ARM_TWD if SMP 17 select HAVE_ARM_TWD if SMP
22 select HAVE_SMP
23 select MAILBOX 18 select MAILBOX
24 select PL320_MBOX 19 select PL320_MBOX
25 select SPARSE_IRQ
26 select USE_OF
27 select ZONE_DMA if ARM_LPAE 20 select ZONE_DMA if ARM_LPAE
diff --git a/arch/arm/mach-hisi/Kconfig b/arch/arm/mach-hisi/Kconfig
index 1abae5f6a418..feee4dbb0760 100644
--- a/arch/arm/mach-hisi/Kconfig
+++ b/arch/arm/mach-hisi/Kconfig
@@ -3,13 +3,9 @@ config ARCH_HI3xxx
3 select ARM_AMBA 3 select ARM_AMBA
4 select ARM_GIC 4 select ARM_GIC
5 select ARM_TIMER_SP804 5 select ARM_TIMER_SP804
6 select ARCH_WANT_OPTIONAL_GPIOLIB
7 select CACHE_L2X0 6 select CACHE_L2X0
8 select CLKSRC_OF 7 select HAVE_ARM_SCU if SMP
9 select GENERIC_CLOCKEVENTS
10 select HAVE_ARM_SCU
11 select HAVE_ARM_TWD if SMP 8 select HAVE_ARM_TWD if SMP
12 select HAVE_SMP
13 select PINCTRL 9 select PINCTRL
14 select PINCTRL_SINGLE 10 select PINCTRL_SINGLE
15 help 11 help
diff --git a/arch/arm/mach-hisi/Makefile b/arch/arm/mach-hisi/Makefile
index 6870058d0a48..2ae1b59267c2 100644
--- a/arch/arm/mach-hisi/Makefile
+++ b/arch/arm/mach-hisi/Makefile
@@ -3,5 +3,4 @@
3# 3#
4 4
5obj-y += hisilicon.o 5obj-y += hisilicon.o
6obj-$(CONFIG_SMP) += platsmp.o 6obj-$(CONFIG_SMP) += platsmp.o hotplug.o
7obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
diff --git a/arch/arm/mach-hisi/hotplug.c b/arch/arm/mach-hisi/hotplug.c
index b909854eee7f..abd441b0c604 100644
--- a/arch/arm/mach-hisi/hotplug.c
+++ b/arch/arm/mach-hisi/hotplug.c
@@ -178,6 +178,7 @@ static inline void cpu_enter_lowpower(void)
178 : "cc"); 178 : "cc");
179} 179}
180 180
181#ifdef CONFIG_HOTPLUG_CPU
181void hi3xxx_cpu_die(unsigned int cpu) 182void hi3xxx_cpu_die(unsigned int cpu)
182{ 183{
183 cpu_enter_lowpower(); 184 cpu_enter_lowpower();
@@ -198,3 +199,4 @@ int hi3xxx_cpu_kill(unsigned int cpu)
198 hi3xxx_set_cpu(cpu, false); 199 hi3xxx_set_cpu(cpu, false);
199 return 1; 200 return 1;
200} 201}
202#endif
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 33567aa5880f..5740296dc429 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -1,19 +1,15 @@
1config ARCH_MXC 1config ARCH_MXC
2 bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7 2 bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7
3 select ARCH_HAS_CPUFREQ
4 select ARCH_HAS_OPP
3 select ARCH_REQUIRE_GPIOLIB 5 select ARCH_REQUIRE_GPIOLIB
4 select ARM_CPU_SUSPEND if PM 6 select ARM_CPU_SUSPEND if PM
5 select ARM_PATCH_PHYS_VIRT
6 select CLKSRC_MMIO 7 select CLKSRC_MMIO
7 select COMMON_CLK
8 select GENERIC_ALLOCATOR
9 select GENERIC_CLOCKEVENTS
10 select GENERIC_IRQ_CHIP 8 select GENERIC_IRQ_CHIP
11 select MIGHT_HAVE_CACHE_L2X0 if ARCH_MULTI_V6_V7
12 select MULTI_IRQ_HANDLER
13 select PINCTRL 9 select PINCTRL
10 select PM_OPP if PM
14 select SOC_BUS 11 select SOC_BUS
15 select SPARSE_IRQ 12 select SRAM
16 select USE_OF
17 help 13 help
18 Support for Freescale MXC/iMX-based family of processors 14 Support for Freescale MXC/iMX-based family of processors
19 15
@@ -121,18 +117,16 @@ config SOC_IMX31
121config SOC_IMX35 117config SOC_IMX35
122 bool 118 bool
123 select ARCH_MXC_IOMUX_V3 119 select ARCH_MXC_IOMUX_V3
124 select CPU_V6K
125 select HAVE_EPIT 120 select HAVE_EPIT
126 select MXC_AVIC 121 select MXC_AVIC
122 select PINCTRL_IMX35
127 select SMP_ON_UP if SMP 123 select SMP_ON_UP if SMP
128 select PINCTRL
129 124
130config SOC_IMX5 125config SOC_IMX5
131 bool 126 bool
132 select ARCH_HAS_CPUFREQ 127 select ARCH_HAS_CPUFREQ
133 select ARCH_HAS_OPP 128 select ARCH_HAS_OPP
134 select ARCH_MXC_IOMUX_V3 129 select ARCH_MXC_IOMUX_V3
135 select CPU_V7
136 select MXC_TZIC 130 select MXC_TZIC
137 131
138config SOC_IMX51 132config SOC_IMX51
@@ -777,65 +771,50 @@ config SOC_IMX50
777config SOC_IMX53 771config SOC_IMX53
778 bool "i.MX53 support" 772 bool "i.MX53 support"
779 select HAVE_IMX_SRC 773 select HAVE_IMX_SRC
780 select IMX_HAVE_PLATFORM_IMX2_WDT
781 select PINCTRL_IMX53 774 select PINCTRL_IMX53
782 select SOC_IMX5 775 select SOC_IMX5
783 776
784 help 777 help
785 This enables support for Freescale i.MX53 processor. 778 This enables support for Freescale i.MX53 processor.
786 779
787config SOC_IMX6Q 780config SOC_IMX6
788 bool "i.MX6 Quad/DualLite support" 781 bool
789 select ARCH_HAS_CPUFREQ
790 select ARCH_HAS_OPP
791 select ARM_ERRATA_754322 782 select ARM_ERRATA_754322
792 select ARM_ERRATA_764369 if SMP
793 select ARM_ERRATA_775420 783 select ARM_ERRATA_775420
794 select ARM_GIC 784 select ARM_GIC
795 select CPU_V7
796 select HAVE_ARM_SCU if SMP
797 select HAVE_ARM_TWD if SMP
798 select HAVE_IMX_ANATOP 785 select HAVE_IMX_ANATOP
799 select HAVE_IMX_GPC 786 select HAVE_IMX_GPC
800 select HAVE_IMX_MMDC 787 select HAVE_IMX_MMDC
801 select HAVE_IMX_SRC 788 select HAVE_IMX_SRC
802 select HAVE_SMP
803 select MFD_SYSCON 789 select MFD_SYSCON
804 select MIGHT_HAVE_PCI
805 select PCI_DOMAINS if PCI
806 select PINCTRL_IMX6Q
807 select PL310_ERRATA_588369 if CACHE_PL310 790 select PL310_ERRATA_588369 if CACHE_PL310
808 select PL310_ERRATA_727915 if CACHE_PL310 791 select PL310_ERRATA_727915 if CACHE_PL310
809 select PL310_ERRATA_769419 if CACHE_PL310 792 select PL310_ERRATA_769419 if CACHE_PL310
810 select PM_OPP if PM 793
794config SOC_IMX6Q
795 bool "i.MX6 Quad/DualLite support"
796 select ARM_ERRATA_764369 if SMP
797 select HAVE_ARM_SCU if SMP
798 select HAVE_ARM_TWD if SMP
799 select MIGHT_HAVE_PCI
800 select PCI_DOMAINS if PCI
801 select PINCTRL_IMX6Q
802 select SOC_IMX6
811 803
812 help 804 help
813 This enables support for Freescale i.MX6 Quad processor. 805 This enables support for Freescale i.MX6 Quad processor.
814 806
815config SOC_IMX6SL 807config SOC_IMX6SL
816 bool "i.MX6 SoloLite support" 808 bool "i.MX6 SoloLite support"
817 select ARM_ERRATA_754322
818 select ARM_ERRATA_775420
819 select ARM_GIC
820 select CPU_V7
821 select HAVE_IMX_ANATOP
822 select HAVE_IMX_GPC
823 select HAVE_IMX_MMDC
824 select HAVE_IMX_SRC
825 select MFD_SYSCON
826 select PINCTRL_IMX6SL 809 select PINCTRL_IMX6SL
827 select PL310_ERRATA_588369 if CACHE_PL310 810 select SOC_IMX6
828 select PL310_ERRATA_727915 if CACHE_PL310
829 select PL310_ERRATA_769419 if CACHE_PL310
830 811
831 help 812 help
832 This enables support for Freescale i.MX6 SoloLite processor. 813 This enables support for Freescale i.MX6 SoloLite processor.
833 814
834config SOC_VF610 815config SOC_VF610
835 bool "Vybrid Family VF610 support" 816 bool "Vybrid Family VF610 support"
836 select CPU_V7
837 select ARM_GIC 817 select ARM_GIC
838 select CLKSRC_OF
839 select PINCTRL_VF610 818 select PINCTRL_VF610
840 select VF_PIT_TIMER 819 select VF_PIT_TIMER
841 select PL310_ERRATA_588369 if CACHE_PL310 820 select PL310_ERRATA_588369 if CACHE_PL310
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index ec419649320f..f4ed83032dd0 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -30,6 +30,7 @@ obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o
30ifeq ($(CONFIG_CPU_IDLE),y) 30ifeq ($(CONFIG_CPU_IDLE),y)
31obj-$(CONFIG_SOC_IMX5) += cpuidle-imx5.o 31obj-$(CONFIG_SOC_IMX5) += cpuidle-imx5.o
32obj-$(CONFIG_SOC_IMX6Q) += cpuidle-imx6q.o 32obj-$(CONFIG_SOC_IMX6Q) += cpuidle-imx6q.o
33obj-$(CONFIG_SOC_IMX6SL) += cpuidle-imx6sl.o
33endif 34endif
34 35
35ifdef CONFIG_SND_IMX_SOC 36ifdef CONFIG_SND_IMX_SOC
@@ -101,9 +102,11 @@ obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
101obj-$(CONFIG_SOC_IMX6Q) += clk-imx6q.o mach-imx6q.o 102obj-$(CONFIG_SOC_IMX6Q) += clk-imx6q.o mach-imx6q.o
102obj-$(CONFIG_SOC_IMX6SL) += clk-imx6sl.o mach-imx6sl.o 103obj-$(CONFIG_SOC_IMX6SL) += clk-imx6sl.o mach-imx6sl.o
103 104
104obj-$(CONFIG_SOC_IMX6Q) += pm-imx6q.o headsmp.o 105ifeq ($(CONFIG_SUSPEND),y)
105# i.MX6SL reuses i.MX6Q code 106AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a
106obj-$(CONFIG_SOC_IMX6SL) += pm-imx6q.o headsmp.o 107obj-$(CONFIG_SOC_IMX6) += suspend-imx6.o
108endif
109obj-$(CONFIG_SOC_IMX6) += pm-imx6.o
107 110
108# i.MX5 based machines 111# i.MX5 based machines
109obj-$(CONFIG_MACH_MX51_BABBAGE) += mach-mx51_babbage.o 112obj-$(CONFIG_MACH_MX51_BABBAGE) += mach-mx51_babbage.o
diff --git a/arch/arm/mach-imx/clk-imx21.c b/arch/arm/mach-imx/clk-imx21.c
index d7ed66091a2a..bdc2e4630a08 100644
--- a/arch/arm/mach-imx/clk-imx21.c
+++ b/arch/arm/mach-imx/clk-imx21.c
@@ -149,7 +149,6 @@ int __init mx21_clocks_init(unsigned long lref, unsigned long href)
149 clk_register_clkdev(clk[per1], "per", "imx-gpt.1"); 149 clk_register_clkdev(clk[per1], "per", "imx-gpt.1");
150 clk_register_clkdev(clk[gpt3_ipg_gate], "ipg", "imx-gpt.2"); 150 clk_register_clkdev(clk[gpt3_ipg_gate], "ipg", "imx-gpt.2");
151 clk_register_clkdev(clk[per1], "per", "imx-gpt.2"); 151 clk_register_clkdev(clk[per1], "per", "imx-gpt.2");
152 clk_register_clkdev(clk[pwm_ipg_gate], "pwm", "mxc_pwm.0");
153 clk_register_clkdev(clk[per2], "per", "imx21-cspi.0"); 152 clk_register_clkdev(clk[per2], "per", "imx21-cspi.0");
154 clk_register_clkdev(clk[cspi1_ipg_gate], "ipg", "imx21-cspi.0"); 153 clk_register_clkdev(clk[cspi1_ipg_gate], "ipg", "imx21-cspi.0");
155 clk_register_clkdev(clk[per2], "per", "imx21-cspi.1"); 154 clk_register_clkdev(clk[per2], "per", "imx21-cspi.1");
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
index 69858c78f40d..dc36e6c2f1da 100644
--- a/arch/arm/mach-imx/clk-imx25.c
+++ b/arch/arm/mach-imx/clk-imx25.c
@@ -265,14 +265,6 @@ int __init mx25_clocks_init(void)
265 clk_register_clkdev(clk[cspi1_ipg], NULL, "imx35-cspi.0"); 265 clk_register_clkdev(clk[cspi1_ipg], NULL, "imx35-cspi.0");
266 clk_register_clkdev(clk[cspi2_ipg], NULL, "imx35-cspi.1"); 266 clk_register_clkdev(clk[cspi2_ipg], NULL, "imx35-cspi.1");
267 clk_register_clkdev(clk[cspi3_ipg], NULL, "imx35-cspi.2"); 267 clk_register_clkdev(clk[cspi3_ipg], NULL, "imx35-cspi.2");
268 clk_register_clkdev(clk[pwm1_ipg], "ipg", "mxc_pwm.0");
269 clk_register_clkdev(clk[per10], "per", "mxc_pwm.0");
270 clk_register_clkdev(clk[pwm1_ipg], "ipg", "mxc_pwm.1");
271 clk_register_clkdev(clk[per10], "per", "mxc_pwm.1");
272 clk_register_clkdev(clk[pwm1_ipg], "ipg", "mxc_pwm.2");
273 clk_register_clkdev(clk[per10], "per", "mxc_pwm.2");
274 clk_register_clkdev(clk[pwm1_ipg], "ipg", "mxc_pwm.3");
275 clk_register_clkdev(clk[per10], "per", "mxc_pwm.3");
276 clk_register_clkdev(clk[kpp_ipg], NULL, "imx-keypad"); 268 clk_register_clkdev(clk[kpp_ipg], NULL, "imx-keypad");
277 clk_register_clkdev(clk[tsc_ipg], NULL, "mx25-adc"); 269 clk_register_clkdev(clk[tsc_ipg], NULL, "mx25-adc");
278 clk_register_clkdev(clk[i2c_ipg_per], NULL, "imx21-i2c.0"); 270 clk_register_clkdev(clk[i2c_ipg_per], NULL, "imx21-i2c.0");
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index c6b40f386786..d2da8908b268 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -231,7 +231,6 @@ int __init mx27_clocks_init(unsigned long fref)
231 clk_register_clkdev(clk[per1_gate], "per", "imx-gpt.4"); 231 clk_register_clkdev(clk[per1_gate], "per", "imx-gpt.4");
232 clk_register_clkdev(clk[gpt6_ipg_gate], "ipg", "imx-gpt.5"); 232 clk_register_clkdev(clk[gpt6_ipg_gate], "ipg", "imx-gpt.5");
233 clk_register_clkdev(clk[per1_gate], "per", "imx-gpt.5"); 233 clk_register_clkdev(clk[per1_gate], "per", "imx-gpt.5");
234 clk_register_clkdev(clk[pwm_ipg_gate], NULL, "mxc_pwm.0");
235 clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.0"); 234 clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.0");
236 clk_register_clkdev(clk[sdhc1_ipg_gate], "ipg", "imx21-mmc.0"); 235 clk_register_clkdev(clk[sdhc1_ipg_gate], "ipg", "imx21-mmc.0");
237 clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.1"); 236 clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.1");
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c
index 19fca1fdc6fe..568ef0a4de84 100644
--- a/arch/arm/mach-imx/clk-imx51-imx53.c
+++ b/arch/arm/mach-imx/clk-imx51-imx53.c
@@ -266,8 +266,6 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil,
266 clk_register_clkdev(clk[IMX5_CLK_ECSPI2_PER_GATE], "per", "imx51-ecspi.1"); 266 clk_register_clkdev(clk[IMX5_CLK_ECSPI2_PER_GATE], "per", "imx51-ecspi.1");
267 clk_register_clkdev(clk[IMX5_CLK_ECSPI2_IPG_GATE], "ipg", "imx51-ecspi.1"); 267 clk_register_clkdev(clk[IMX5_CLK_ECSPI2_IPG_GATE], "ipg", "imx51-ecspi.1");
268 clk_register_clkdev(clk[IMX5_CLK_CSPI_IPG_GATE], NULL, "imx35-cspi.2"); 268 clk_register_clkdev(clk[IMX5_CLK_CSPI_IPG_GATE], NULL, "imx35-cspi.2");
269 clk_register_clkdev(clk[IMX5_CLK_PWM1_IPG_GATE], "pwm", "mxc_pwm.0");
270 clk_register_clkdev(clk[IMX5_CLK_PWM2_IPG_GATE], "pwm", "mxc_pwm.1");
271 clk_register_clkdev(clk[IMX5_CLK_I2C1_GATE], NULL, "imx21-i2c.0"); 269 clk_register_clkdev(clk[IMX5_CLK_I2C1_GATE], NULL, "imx21-i2c.0");
272 clk_register_clkdev(clk[IMX5_CLK_I2C2_GATE], NULL, "imx21-i2c.1"); 270 clk_register_clkdev(clk[IMX5_CLK_I2C2_GATE], NULL, "imx21-i2c.1");
273 clk_register_clkdev(clk[IMX5_CLK_USBOH3_PER_GATE], "per", "mxc-ehci.0"); 271 clk_register_clkdev(clk[IMX5_CLK_USBOH3_PER_GATE], "per", "mxc-ehci.0");
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
index 4d677f442539..b0e7f9d2c245 100644
--- a/arch/arm/mach-imx/clk-imx6q.c
+++ b/arch/arm/mach-imx/clk-imx6q.c
@@ -437,12 +437,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
437 437
438 clk_register_clkdev(clk[gpt_ipg], "ipg", "imx-gpt.0"); 438 clk_register_clkdev(clk[gpt_ipg], "ipg", "imx-gpt.0");
439 clk_register_clkdev(clk[gpt_ipg_per], "per", "imx-gpt.0"); 439 clk_register_clkdev(clk[gpt_ipg_per], "per", "imx-gpt.0");
440 clk_register_clkdev(clk[cko1_sel], "cko1_sel", NULL); 440 clk_register_clkdev(clk[enet_ref], "enet_ref", NULL);
441 clk_register_clkdev(clk[ahb], "ahb", NULL);
442 clk_register_clkdev(clk[cko1], "cko1", NULL);
443 clk_register_clkdev(clk[arm], NULL, "cpu0");
444 clk_register_clkdev(clk[pll4_post_div], "pll4_post_div", NULL);
445 clk_register_clkdev(clk[pll4_audio], "pll4_audio", NULL);
446 441
447 if ((imx_get_soc_revision() != IMX_CHIP_REVISION_1_0) || 442 if ((imx_get_soc_revision() != IMX_CHIP_REVISION_1_0) ||
448 cpu_is_imx6dl()) { 443 cpu_is_imx6dl()) {
diff --git a/arch/arm/mach-imx/clk-imx6sl.c b/arch/arm/mach-imx/clk-imx6sl.c
index 4c86f3035205..f7073c0782fb 100644
--- a/arch/arm/mach-imx/clk-imx6sl.c
+++ b/arch/arm/mach-imx/clk-imx6sl.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright 2013 Freescale Semiconductor, Inc. 2 * Copyright 2013-2014 Freescale Semiconductor, Inc.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
@@ -18,27 +18,43 @@
18#include "clk.h" 18#include "clk.h"
19#include "common.h" 19#include "common.h"
20 20
21static const char const *step_sels[] = { "osc", "pll2_pfd2", }; 21#define CCSR 0xc
22static const char const *pll1_sw_sels[] = { "pll1_sys", "step", }; 22#define BM_CCSR_PLL1_SW_CLK_SEL (1 << 2)
23static const char const *ocram_alt_sels[] = { "pll2_pfd2", "pll3_pfd1", }; 23#define CACRR 0x10
24static const char const *ocram_sels[] = { "periph", "ocram_alt_sels", }; 24#define CDHIPR 0x48
25static const char const *pre_periph_sels[] = { "pll2_bus", "pll2_pfd2", "pll2_pfd0", "pll2_198m", }; 25#define BM_CDHIPR_ARM_PODF_BUSY (1 << 16)
26static const char const *periph_clk2_sels[] = { "pll3_usb_otg", "osc", "osc", "dummy", }; 26#define ARM_WAIT_DIV_396M 2
27static const char const *periph2_clk2_sels[] = { "pll3_usb_otg", "pll2_bus", }; 27#define ARM_WAIT_DIV_792M 4
28static const char const *periph_sels[] = { "pre_periph_sel", "periph_clk2_podf", }; 28#define ARM_WAIT_DIV_996M 6
29static const char const *periph2_sels[] = { "pre_periph2_sel", "periph2_clk2_podf", }; 29
30static const char const *csi_lcdif_sels[] = { "mmdc", "pll2_pfd2", "pll3_120m", "pll3_pfd1", }; 30#define PLL_ARM 0x0
31static const char const *usdhc_sels[] = { "pll2_pfd2", "pll2_pfd0", }; 31#define BM_PLL_ARM_DIV_SELECT (0x7f << 0)
32static const char const *ssi_sels[] = { "pll3_pfd2", "pll3_pfd3", "pll4_audio_div", "dummy", }; 32#define BM_PLL_ARM_POWERDOWN (1 << 12)
33static const char const *perclk_sels[] = { "ipg", "osc", }; 33#define BM_PLL_ARM_ENABLE (1 << 13)
34static const char const *epdc_pxp_sels[] = { "mmdc", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll2_pfd2", "pll3_pfd1", }; 34#define BM_PLL_ARM_LOCK (1 << 31)
35static const char const *gpu2d_ovg_sels[] = { "pll3_pfd1", "pll3_usb_otg", "pll2_bus", "pll2_pfd2", }; 35#define PLL_ARM_DIV_792M 66
36static const char const *gpu2d_sels[] = { "pll2_pfd2", "pll3_usb_otg", "pll3_pfd1", "pll2_bus", }; 36
37static const char const *lcdif_pix_sels[] = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll3_pfd0", "pll3_pfd1", }; 37static const char *step_sels[] = { "osc", "pll2_pfd2", };
38static const char const *epdc_pix_sels[] = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll2_pfd1", "pll3_pfd1", }; 38static const char *pll1_sw_sels[] = { "pll1_sys", "step", };
39static const char const *audio_sels[] = { "pll4_audio_div", "pll3_pfd2", "pll3_pfd3", "pll3_usb_otg", }; 39static const char *ocram_alt_sels[] = { "pll2_pfd2", "pll3_pfd1", };
40static const char const *ecspi_sels[] = { "pll3_60m", "osc", }; 40static const char *ocram_sels[] = { "periph", "ocram_alt_sels", };
41static const char const *uart_sels[] = { "pll3_80m", "osc", }; 41static const char *pre_periph_sels[] = { "pll2_bus", "pll2_pfd2", "pll2_pfd0", "pll2_198m", };
42static const char *periph_clk2_sels[] = { "pll3_usb_otg", "osc", "osc", "dummy", };
43static const char *periph2_clk2_sels[] = { "pll3_usb_otg", "pll2_bus", };
44static const char *periph_sels[] = { "pre_periph_sel", "periph_clk2_podf", };
45static const char *periph2_sels[] = { "pre_periph2_sel", "periph2_clk2_podf", };
46static const char *csi_lcdif_sels[] = { "mmdc", "pll2_pfd2", "pll3_120m", "pll3_pfd1", };
47static const char *usdhc_sels[] = { "pll2_pfd2", "pll2_pfd0", };
48static const char *ssi_sels[] = { "pll3_pfd2", "pll3_pfd3", "pll4_audio_div", "dummy", };
49static const char *perclk_sels[] = { "ipg", "osc", };
50static const char *epdc_pxp_sels[] = { "mmdc", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll2_pfd2", "pll3_pfd1", };
51static const char *gpu2d_ovg_sels[] = { "pll3_pfd1", "pll3_usb_otg", "pll2_bus", "pll2_pfd2", };
52static const char *gpu2d_sels[] = { "pll2_pfd2", "pll3_usb_otg", "pll3_pfd1", "pll2_bus", };
53static const char *lcdif_pix_sels[] = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll3_pfd0", "pll3_pfd1", };
54static const char *epdc_pix_sels[] = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll2_pfd1", "pll3_pfd1", };
55static const char *audio_sels[] = { "pll4_audio_div", "pll3_pfd2", "pll3_pfd3", "pll3_usb_otg", };
56static const char *ecspi_sels[] = { "pll3_60m", "osc", };
57static const char *uart_sels[] = { "pll3_80m", "osc", };
42 58
43static struct clk_div_table clk_enet_ref_table[] = { 59static struct clk_div_table clk_enet_ref_table[] = {
44 { .val = 0, .div = 20, }, 60 { .val = 0, .div = 20, },
@@ -65,6 +81,89 @@ static struct clk_div_table video_div_table[] = {
65 81
66static struct clk *clks[IMX6SL_CLK_END]; 82static struct clk *clks[IMX6SL_CLK_END];
67static struct clk_onecell_data clk_data; 83static struct clk_onecell_data clk_data;
84static void __iomem *ccm_base;
85static void __iomem *anatop_base;
86
87static const u32 clks_init_on[] __initconst = {
88 IMX6SL_CLK_IPG, IMX6SL_CLK_ARM, IMX6SL_CLK_MMDC_ROOT,
89};
90
91/*
92 * ERR005311 CCM: After exit from WAIT mode, unwanted interrupt(s) taken
93 * during WAIT mode entry process could cause cache memory
94 * corruption.
95 *
96 * Software workaround:
97 * To prevent this issue from occurring, software should ensure that the
98 * ARM to IPG clock ratio is less than 12:5 (that is < 2.4x), before
99 * entering WAIT mode.
100 *
101 * This function will set the ARM clk to max value within the 12:5 limit.
102 * As IPG clock is fixed at 66MHz(so ARM freq must not exceed 158.4MHz),
103 * ARM freq are one of below setpoints: 396MHz, 792MHz and 996MHz, since
104 * the clk APIs can NOT be called in idle thread(may cause kernel schedule
105 * as there is sleep function in PLL wait function), so here we just slow
106 * down ARM to below freq according to previous freq:
107 *
108 * run mode wait mode
109 * 396MHz -> 132MHz;
110 * 792MHz -> 158.4MHz;
111 * 996MHz -> 142.3MHz;
112 */
113static int imx6sl_get_arm_divider_for_wait(void)
114{
115 if (readl_relaxed(ccm_base + CCSR) & BM_CCSR_PLL1_SW_CLK_SEL) {
116 return ARM_WAIT_DIV_396M;
117 } else {
118 if ((readl_relaxed(anatop_base + PLL_ARM) &
119 BM_PLL_ARM_DIV_SELECT) == PLL_ARM_DIV_792M)
120 return ARM_WAIT_DIV_792M;
121 else
122 return ARM_WAIT_DIV_996M;
123 }
124}
125
126static void imx6sl_enable_pll_arm(bool enable)
127{
128 static u32 saved_pll_arm;
129 u32 val;
130
131 if (enable) {
132 saved_pll_arm = val = readl_relaxed(anatop_base + PLL_ARM);
133 val |= BM_PLL_ARM_ENABLE;
134 val &= ~BM_PLL_ARM_POWERDOWN;
135 writel_relaxed(val, anatop_base + PLL_ARM);
136 while (!(__raw_readl(anatop_base + PLL_ARM) & BM_PLL_ARM_LOCK))
137 ;
138 } else {
139 writel_relaxed(saved_pll_arm, anatop_base + PLL_ARM);
140 }
141}
142
143void imx6sl_set_wait_clk(bool enter)
144{
145 static unsigned long saved_arm_div;
146 int arm_div_for_wait = imx6sl_get_arm_divider_for_wait();
147
148 /*
149 * According to hardware design, arm podf change need
150 * PLL1 clock enabled.
151 */
152 if (arm_div_for_wait == ARM_WAIT_DIV_396M)
153 imx6sl_enable_pll_arm(true);
154
155 if (enter) {
156 saved_arm_div = readl_relaxed(ccm_base + CACRR);
157 writel_relaxed(arm_div_for_wait, ccm_base + CACRR);
158 } else {
159 writel_relaxed(saved_arm_div, ccm_base + CACRR);
160 }
161 while (__raw_readl(ccm_base + CDHIPR) & BM_CDHIPR_ARM_PODF_BUSY)
162 ;
163
164 if (arm_div_for_wait == ARM_WAIT_DIV_396M)
165 imx6sl_enable_pll_arm(false);
166}
68 167
69static void __init imx6sl_clocks_init(struct device_node *ccm_node) 168static void __init imx6sl_clocks_init(struct device_node *ccm_node)
70{ 169{
@@ -72,6 +171,7 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
72 void __iomem *base; 171 void __iomem *base;
73 int irq; 172 int irq;
74 int i; 173 int i;
174 int ret;
75 175
76 clks[IMX6SL_CLK_DUMMY] = imx_clk_fixed("dummy", 0); 176 clks[IMX6SL_CLK_DUMMY] = imx_clk_fixed("dummy", 0);
77 clks[IMX6SL_CLK_CKIL] = imx_obtain_fixed_clock("ckil", 0); 177 clks[IMX6SL_CLK_CKIL] = imx_obtain_fixed_clock("ckil", 0);
@@ -80,6 +180,7 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
80 np = of_find_compatible_node(NULL, NULL, "fsl,imx6sl-anatop"); 180 np = of_find_compatible_node(NULL, NULL, "fsl,imx6sl-anatop");
81 base = of_iomap(np, 0); 181 base = of_iomap(np, 0);
82 WARN_ON(!base); 182 WARN_ON(!base);
183 anatop_base = base;
83 184
84 /* type name parent base div_mask */ 185 /* type name parent base div_mask */
85 clks[IMX6SL_CLK_PLL1_SYS] = imx_clk_pllv3(IMX_PLLV3_SYS, "pll1_sys", "osc", base, 0x7f); 186 clks[IMX6SL_CLK_PLL1_SYS] = imx_clk_pllv3(IMX_PLLV3_SYS, "pll1_sys", "osc", base, 0x7f);
@@ -127,6 +228,7 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
127 np = ccm_node; 228 np = ccm_node;
128 base = of_iomap(np, 0); 229 base = of_iomap(np, 0);
129 WARN_ON(!base); 230 WARN_ON(!base);
231 ccm_base = base;
130 232
131 /* Reuse imx6q pm code */ 233 /* Reuse imx6q pm code */
132 imx6q_pm_set_ccm_base(base); 234 imx6q_pm_set_ccm_base(base);
@@ -258,6 +360,19 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
258 clk_register_clkdev(clks[IMX6SL_CLK_GPT], "ipg", "imx-gpt.0"); 360 clk_register_clkdev(clks[IMX6SL_CLK_GPT], "ipg", "imx-gpt.0");
259 clk_register_clkdev(clks[IMX6SL_CLK_GPT_SERIAL], "per", "imx-gpt.0"); 361 clk_register_clkdev(clks[IMX6SL_CLK_GPT_SERIAL], "per", "imx-gpt.0");
260 362
363 /* Ensure the AHB clk is at 132MHz. */
364 ret = clk_set_rate(clks[IMX6SL_CLK_AHB], 132000000);
365 if (ret)
366 pr_warn("%s: failed to set AHB clock rate %d!\n",
367 __func__, ret);
368
369 /*
370 * Make sure those always on clocks are enabled to maintain the correct
371 * usecount and enabling/disabling of parent PLLs.
372 */
373 for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
374 clk_prepare_enable(clks[clks_init_on[i]]);
375
261 if (IS_ENABLED(CONFIG_USB_MXS_PHY)) { 376 if (IS_ENABLED(CONFIG_USB_MXS_PHY)) {
262 clk_prepare_enable(clks[IMX6SL_CLK_USBPHY1_GATE]); 377 clk_prepare_enable(clks[IMX6SL_CLK_USBPHY1_GATE]);
263 clk_prepare_enable(clks[IMX6SL_CLK_USBPHY2_GATE]); 378 clk_prepare_enable(clks[IMX6SL_CLK_USBPHY2_GATE]);
diff --git a/arch/arm/mach-imx/clk-vf610.c b/arch/arm/mach-imx/clk-vf610.c
index ecd66d8e20b6..22dc3ee21fd4 100644
--- a/arch/arm/mach-imx/clk-vf610.c
+++ b/arch/arm/mach-imx/clk-vf610.c
@@ -63,25 +63,25 @@ static void __iomem *anatop_base;
63static void __iomem *ccm_base; 63static void __iomem *ccm_base;
64 64
65/* sources for multiplexer clocks, this is used multiple times */ 65/* sources for multiplexer clocks, this is used multiple times */
66static const char const *fast_sels[] = { "firc", "fxosc", }; 66static const char *fast_sels[] = { "firc", "fxosc", };
67static const char const *slow_sels[] = { "sirc_32k", "sxosc", }; 67static const char *slow_sels[] = { "sirc_32k", "sxosc", };
68static const char const *pll1_sels[] = { "pll1_main", "pll1_pfd1", "pll1_pfd2", "pll1_pfd3", "pll1_pfd4", }; 68static const char *pll1_sels[] = { "pll1_main", "pll1_pfd1", "pll1_pfd2", "pll1_pfd3", "pll1_pfd4", };
69static const char const *pll2_sels[] = { "pll2_main", "pll2_pfd1", "pll2_pfd2", "pll2_pfd3", "pll2_pfd4", }; 69static const char *pll2_sels[] = { "pll2_main", "pll2_pfd1", "pll2_pfd2", "pll2_pfd3", "pll2_pfd4", };
70static const char const *sys_sels[] = { "fast_clk_sel", "slow_clk_sel", "pll2_pfd_sel", "pll2_main", "pll1_pfd_sel", "pll3_main", }; 70static const char *sys_sels[] = { "fast_clk_sel", "slow_clk_sel", "pll2_pfd_sel", "pll2_main", "pll1_pfd_sel", "pll3_main", };
71static const char const *ddr_sels[] = { "pll2_pfd2", "sys_sel", }; 71static const char *ddr_sels[] = { "pll2_pfd2", "sys_sel", };
72static const char const *rmii_sels[] = { "enet_ext", "audio_ext", "enet_50m", "enet_25m", }; 72static const char *rmii_sels[] = { "enet_ext", "audio_ext", "enet_50m", "enet_25m", };
73static const char const *enet_ts_sels[] = { "enet_ext", "fxosc", "audio_ext", "usb", "enet_ts", "enet_25m", "enet_50m", }; 73static const char *enet_ts_sels[] = { "enet_ext", "fxosc", "audio_ext", "usb", "enet_ts", "enet_25m", "enet_50m", };
74static const char const *esai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_main_div", }; 74static const char *esai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_main_div", };
75static const char const *sai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_main_div", }; 75static const char *sai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_main_div", };
76static const char const *nfc_sels[] = { "platform_bus", "pll1_pfd1", "pll3_pfd1", "pll3_pfd3", }; 76static const char *nfc_sels[] = { "platform_bus", "pll1_pfd1", "pll3_pfd1", "pll3_pfd3", };
77static const char const *qspi_sels[] = { "pll3_main", "pll3_pfd4", "pll2_pfd4", "pll1_pfd4", }; 77static const char *qspi_sels[] = { "pll3_main", "pll3_pfd4", "pll2_pfd4", "pll1_pfd4", };
78static const char const *esdhc_sels[] = { "pll3_main", "pll3_pfd3", "pll1_pfd3", "platform_bus", }; 78static const char *esdhc_sels[] = { "pll3_main", "pll3_pfd3", "pll1_pfd3", "platform_bus", };
79static const char const *dcu_sels[] = { "pll1_pfd2", "pll3_main", }; 79static const char *dcu_sels[] = { "pll1_pfd2", "pll3_main", };
80static const char const *gpu_sels[] = { "pll2_pfd2", "pll3_pfd2", }; 80static const char *gpu_sels[] = { "pll2_pfd2", "pll3_pfd2", };
81static const char const *vadc_sels[] = { "pll6_main_div", "pll3_main_div", "pll3_main", }; 81static const char *vadc_sels[] = { "pll6_main_div", "pll3_main_div", "pll3_main", };
82/* FTM counter clock source, not module clock */ 82/* FTM counter clock source, not module clock */
83static const char const *ftm_ext_sels[] = {"sirc_128k", "sxosc", "fxosc_half", "audio_ext", }; 83static const char *ftm_ext_sels[] = {"sirc_128k", "sxosc", "fxosc_half", "audio_ext", };
84static const char const *ftm_fix_sels[] = { "sxosc", "ipg_bus", }; 84static const char *ftm_fix_sels[] = { "sxosc", "ipg_bus", };
85 85
86static struct clk_div_table pll4_main_div_table[] = { 86static struct clk_div_table pll4_main_div_table[] = {
87 { .val = 0, .div = 1 }, 87 { .val = 0, .div = 1 },
diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h
index baf439dc22d8..b5241ea76706 100644
--- a/arch/arm/mach-imx/common.h
+++ b/arch/arm/mach-imx/common.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright 2004-2013 Freescale Semiconductor, Inc. All Rights Reserved. 2 * Copyright 2004-2014 Freescale Semiconductor, Inc. All Rights Reserved.
3 */ 3 */
4 4
5/* 5/*
@@ -116,7 +116,6 @@ void imx_enable_cpu(int cpu, bool enable);
116void imx_set_cpu_jump(int cpu, void *jump_addr); 116void imx_set_cpu_jump(int cpu, void *jump_addr);
117u32 imx_get_cpu_arg(int cpu); 117u32 imx_get_cpu_arg(int cpu);
118void imx_set_cpu_arg(int cpu, u32 arg); 118void imx_set_cpu_arg(int cpu, u32 arg);
119void v7_cpu_resume(void);
120#ifdef CONFIG_SMP 119#ifdef CONFIG_SMP
121void v7_secondary_startup(void); 120void v7_secondary_startup(void);
122void imx_scu_map_io(void); 121void imx_scu_map_io(void);
@@ -139,13 +138,25 @@ void imx_anatop_init(void);
139void imx_anatop_pre_suspend(void); 138void imx_anatop_pre_suspend(void);
140void imx_anatop_post_resume(void); 139void imx_anatop_post_resume(void);
141int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode); 140int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode);
142void imx6q_set_chicken_bit(void); 141void imx6q_set_int_mem_clk_lpm(void);
142void imx6sl_set_wait_clk(bool enter);
143 143
144void imx_cpu_die(unsigned int cpu); 144void imx_cpu_die(unsigned int cpu);
145int imx_cpu_kill(unsigned int cpu); 145int imx_cpu_kill(unsigned int cpu);
146 146
147#ifdef CONFIG_SUSPEND
148void v7_cpu_resume(void);
149void imx6_suspend(void __iomem *ocram_vbase);
150#else
151static inline void v7_cpu_resume(void) {}
152static inline void imx6_suspend(void __iomem *ocram_vbase) {}
153#endif
154
147void imx6q_pm_init(void); 155void imx6q_pm_init(void);
156void imx6dl_pm_init(void);
157void imx6sl_pm_init(void);
148void imx6q_pm_set_ccm_base(void __iomem *base); 158void imx6q_pm_set_ccm_base(void __iomem *base);
159
149#ifdef CONFIG_PM 160#ifdef CONFIG_PM
150void imx5_pm_init(void); 161void imx5_pm_init(void);
151#else 162#else
diff --git a/arch/arm/mach-imx/cpuidle-imx6q.c b/arch/arm/mach-imx/cpuidle-imx6q.c
index 23ddfb693b2d..6bcae0479049 100644
--- a/arch/arm/mach-imx/cpuidle-imx6q.c
+++ b/arch/arm/mach-imx/cpuidle-imx6q.c
@@ -68,8 +68,8 @@ int __init imx6q_cpuidle_init(void)
68 /* Need to enable SCU standby for entering WAIT modes */ 68 /* Need to enable SCU standby for entering WAIT modes */
69 imx_scu_standby_enable(); 69 imx_scu_standby_enable();
70 70
71 /* Set chicken bit to get a reliable WAIT mode support */ 71 /* Set INT_MEM_CLK_LPM bit to get a reliable WAIT mode support */
72 imx6q_set_chicken_bit(); 72 imx6q_set_int_mem_clk_lpm();
73 73
74 return cpuidle_register(&imx6q_cpuidle_driver, NULL); 74 return cpuidle_register(&imx6q_cpuidle_driver, NULL);
75} 75}
diff --git a/arch/arm/mach-imx/cpuidle-imx6sl.c b/arch/arm/mach-imx/cpuidle-imx6sl.c
new file mode 100644
index 000000000000..d4b6b8171fa9
--- /dev/null
+++ b/arch/arm/mach-imx/cpuidle-imx6sl.c
@@ -0,0 +1,57 @@
1/*
2 * Copyright (C) 2014 Freescale Semiconductor, Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#include <linux/cpuidle.h>
10#include <linux/module.h>
11#include <asm/cpuidle.h>
12#include <asm/proc-fns.h>
13
14#include "common.h"
15#include "cpuidle.h"
16
17static int imx6sl_enter_wait(struct cpuidle_device *dev,
18 struct cpuidle_driver *drv, int index)
19{
20 imx6q_set_lpm(WAIT_UNCLOCKED);
21 /*
22 * Software workaround for ERR005311, see function
23 * description for details.
24 */
25 imx6sl_set_wait_clk(true);
26 cpu_do_idle();
27 imx6sl_set_wait_clk(false);
28 imx6q_set_lpm(WAIT_CLOCKED);
29
30 return index;
31}
32
33static struct cpuidle_driver imx6sl_cpuidle_driver = {
34 .name = "imx6sl_cpuidle",
35 .owner = THIS_MODULE,
36 .states = {
37 /* WFI */
38 ARM_CPUIDLE_WFI_STATE,
39 /* WAIT */
40 {
41 .exit_latency = 50,
42 .target_residency = 75,
43 .flags = CPUIDLE_FLAG_TIME_VALID |
44 CPUIDLE_FLAG_TIMER_STOP,
45 .enter = imx6sl_enter_wait,
46 .name = "WAIT",
47 .desc = "Clock off",
48 },
49 },
50 .state_count = 2,
51 .safe_state_index = 0,
52};
53
54int __init imx6sl_cpuidle_init(void)
55{
56 return cpuidle_register(&imx6sl_cpuidle_driver, NULL);
57}
diff --git a/arch/arm/mach-imx/cpuidle.h b/arch/arm/mach-imx/cpuidle.h
index 786f98ecc145..24e33670417c 100644
--- a/arch/arm/mach-imx/cpuidle.h
+++ b/arch/arm/mach-imx/cpuidle.h
@@ -13,6 +13,7 @@
13#ifdef CONFIG_CPU_IDLE 13#ifdef CONFIG_CPU_IDLE
14extern int imx5_cpuidle_init(void); 14extern int imx5_cpuidle_init(void);
15extern int imx6q_cpuidle_init(void); 15extern int imx6q_cpuidle_init(void);
16extern int imx6sl_cpuidle_init(void);
16#else 17#else
17static inline int imx5_cpuidle_init(void) 18static inline int imx5_cpuidle_init(void)
18{ 19{
@@ -22,4 +23,8 @@ static inline int imx6q_cpuidle_init(void)
22{ 23{
23 return 0; 24 return 0;
24} 25}
26static inline int imx6sl_cpuidle_init(void)
27{
28 return 0;
29}
25#endif 30#endif
diff --git a/arch/arm/mach-imx/devices-imx25.h b/arch/arm/mach-imx/devices-imx25.h
index 769563fdeaa0..61a114cddc39 100644
--- a/arch/arm/mach-imx/devices-imx25.h
+++ b/arch/arm/mach-imx/devices-imx25.h
@@ -83,7 +83,3 @@ extern const struct imx_spi_imx_data imx25_cspi_data[];
83#define imx25_add_spi_imx0(pdata) imx25_add_spi_imx(0, pdata) 83#define imx25_add_spi_imx0(pdata) imx25_add_spi_imx(0, pdata)
84#define imx25_add_spi_imx1(pdata) imx25_add_spi_imx(1, pdata) 84#define imx25_add_spi_imx1(pdata) imx25_add_spi_imx(1, pdata)
85#define imx25_add_spi_imx2(pdata) imx25_add_spi_imx(2, pdata) 85#define imx25_add_spi_imx2(pdata) imx25_add_spi_imx(2, pdata)
86
87extern struct imx_mxc_pwm_data imx25_mxc_pwm_data[];
88#define imx25_add_mxc_pwm(id) \
89 imx_add_mxc_pwm(&imx25_mxc_pwm_data[id])
diff --git a/arch/arm/mach-imx/devices-imx51.h b/arch/arm/mach-imx/devices-imx51.h
index deee5baee88c..26389f35a2b2 100644
--- a/arch/arm/mach-imx/devices-imx51.h
+++ b/arch/arm/mach-imx/devices-imx51.h
@@ -57,10 +57,6 @@ extern const struct imx_imx2_wdt_data imx51_imx2_wdt_data[];
57#define imx51_add_imx2_wdt(id) \ 57#define imx51_add_imx2_wdt(id) \
58 imx_add_imx2_wdt(&imx51_imx2_wdt_data[id]) 58 imx_add_imx2_wdt(&imx51_imx2_wdt_data[id])
59 59
60extern const struct imx_mxc_pwm_data imx51_mxc_pwm_data[];
61#define imx51_add_mxc_pwm(id) \
62 imx_add_mxc_pwm(&imx51_mxc_pwm_data[id])
63
64extern const struct imx_imx_keypad_data imx51_imx_keypad_data; 60extern const struct imx_imx_keypad_data imx51_imx_keypad_data;
65#define imx51_add_imx_keypad(pdata) \ 61#define imx51_add_imx_keypad(pdata) \
66 imx_add_imx_keypad(&imx51_imx_keypad_data, pdata) 62 imx_add_imx_keypad(&imx51_imx_keypad_data, pdata)
diff --git a/arch/arm/mach-imx/devices/Kconfig b/arch/arm/mach-imx/devices/Kconfig
index 68c74fb0373c..2d260a5a307c 100644
--- a/arch/arm/mach-imx/devices/Kconfig
+++ b/arch/arm/mach-imx/devices/Kconfig
@@ -67,9 +67,6 @@ config IMX_HAVE_PLATFORM_MXC_MMC
67config IMX_HAVE_PLATFORM_MXC_NAND 67config IMX_HAVE_PLATFORM_MXC_NAND
68 bool 68 bool
69 69
70config IMX_HAVE_PLATFORM_MXC_PWM
71 bool
72
73config IMX_HAVE_PLATFORM_MXC_RNGA 70config IMX_HAVE_PLATFORM_MXC_RNGA
74 bool 71 bool
75 select ARCH_HAS_RNGA 72 select ARCH_HAS_RNGA
diff --git a/arch/arm/mach-imx/devices/Makefile b/arch/arm/mach-imx/devices/Makefile
index 67416fb1dc69..1cbc14cd80d1 100644
--- a/arch/arm/mach-imx/devices/Makefile
+++ b/arch/arm/mach-imx/devices/Makefile
@@ -23,7 +23,6 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_CAMERA) += platform-mx2-camera.o
23obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_EHCI) += platform-mxc-ehci.o 23obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_EHCI) += platform-mxc-ehci.o
24obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_MMC) += platform-mxc-mmc.o 24obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_MMC) += platform-mxc-mmc.o
25obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o 25obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o
26obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_PWM) += platform-mxc_pwm.o
27obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RNGA) += platform-mxc_rnga.o 26obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RNGA) += platform-mxc_rnga.o
28obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RTC) += platform-mxc_rtc.o 27obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RTC) += platform-mxc_rtc.o
29obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o 28obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o
diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h
index c13b76b9f6b3..61352a80bb59 100644
--- a/arch/arm/mach-imx/devices/devices-common.h
+++ b/arch/arm/mach-imx/devices/devices-common.h
@@ -290,15 +290,6 @@ struct imx_pata_imx_data {
290struct platform_device *__init imx_add_pata_imx( 290struct platform_device *__init imx_add_pata_imx(
291 const struct imx_pata_imx_data *data); 291 const struct imx_pata_imx_data *data);
292 292
293struct imx_mxc_pwm_data {
294 int id;
295 resource_size_t iobase;
296 resource_size_t iosize;
297 resource_size_t irq;
298};
299struct platform_device *__init imx_add_mxc_pwm(
300 const struct imx_mxc_pwm_data *data);
301
302/* mxc_rtc */ 293/* mxc_rtc */
303struct imx_mxc_rtc_data { 294struct imx_mxc_rtc_data {
304 const char *devid; 295 const char *devid;
diff --git a/arch/arm/mach-imx/devices/platform-mxc_pwm.c b/arch/arm/mach-imx/devices/platform-mxc_pwm.c
deleted file mode 100644
index dcd289777687..000000000000
--- a/arch/arm/mach-imx/devices/platform-mxc_pwm.c
+++ /dev/null
@@ -1,69 +0,0 @@
1/*
2 * Copyright (C) 2009-2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
9#include "../hardware.h"
10#include "devices-common.h"
11
12#define imx_mxc_pwm_data_entry_single(soc, _id, _hwid, _size) \
13 { \
14 .id = _id, \
15 .iobase = soc ## _PWM ## _hwid ## _BASE_ADDR, \
16 .iosize = _size, \
17 .irq = soc ## _INT_PWM ## _hwid, \
18 }
19#define imx_mxc_pwm_data_entry(soc, _id, _hwid, _size) \
20 [_id] = imx_mxc_pwm_data_entry_single(soc, _id, _hwid, _size)
21
22#ifdef CONFIG_SOC_IMX21
23const struct imx_mxc_pwm_data imx21_mxc_pwm_data __initconst =
24 imx_mxc_pwm_data_entry_single(MX21, 0, , SZ_4K);
25#endif /* ifdef CONFIG_SOC_IMX21 */
26
27#ifdef CONFIG_SOC_IMX25
28const struct imx_mxc_pwm_data imx25_mxc_pwm_data[] __initconst = {
29#define imx25_mxc_pwm_data_entry(_id, _hwid) \
30 imx_mxc_pwm_data_entry(MX25, _id, _hwid, SZ_16K)
31 imx25_mxc_pwm_data_entry(0, 1),
32 imx25_mxc_pwm_data_entry(1, 2),
33 imx25_mxc_pwm_data_entry(2, 3),
34 imx25_mxc_pwm_data_entry(3, 4),
35};
36#endif /* ifdef CONFIG_SOC_IMX25 */
37
38#ifdef CONFIG_SOC_IMX27
39const struct imx_mxc_pwm_data imx27_mxc_pwm_data __initconst =
40 imx_mxc_pwm_data_entry_single(MX27, 0, , SZ_4K);
41#endif /* ifdef CONFIG_SOC_IMX27 */
42
43#ifdef CONFIG_SOC_IMX51
44const struct imx_mxc_pwm_data imx51_mxc_pwm_data[] __initconst = {
45#define imx51_mxc_pwm_data_entry(_id, _hwid) \
46 imx_mxc_pwm_data_entry(MX51, _id, _hwid, SZ_16K)
47 imx51_mxc_pwm_data_entry(0, 1),
48 imx51_mxc_pwm_data_entry(1, 2),
49};
50#endif /* ifdef CONFIG_SOC_IMX51 */
51
52struct platform_device *__init imx_add_mxc_pwm(
53 const struct imx_mxc_pwm_data *data)
54{
55 struct resource res[] = {
56 {
57 .start = data->iobase,
58 .end = data->iobase + data->iosize - 1,
59 .flags = IORESOURCE_MEM,
60 }, {
61 .start = data->irq,
62 .end = data->irq,
63 .flags = IORESOURCE_IRQ,
64 },
65 };
66
67 return imx_add_platform_device("mxc_pwm", data->id,
68 res, ARRAY_SIZE(res), NULL, 0);
69}
diff --git a/arch/arm/mach-imx/hardware.h b/arch/arm/mach-imx/hardware.h
index a3b0b04b45c9..abf43bb47eca 100644
--- a/arch/arm/mach-imx/hardware.h
+++ b/arch/arm/mach-imx/hardware.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. 2 * Copyright 2004-2007, 2014 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de 3 * Copyright 2008 Juergen Beisert, kernel@pengutronix.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
@@ -20,7 +20,9 @@
20#ifndef __ASM_ARCH_MXC_HARDWARE_H__ 20#ifndef __ASM_ARCH_MXC_HARDWARE_H__
21#define __ASM_ARCH_MXC_HARDWARE_H__ 21#define __ASM_ARCH_MXC_HARDWARE_H__
22 22
23#ifndef __ASSEMBLY__
23#include <asm/io.h> 24#include <asm/io.h>
25#endif
24#include <asm/sizes.h> 26#include <asm/sizes.h>
25 27
26#define addr_in_module(addr, mod) \ 28#define addr_in_module(addr, mod) \
diff --git a/arch/arm/mach-imx/headsmp.S b/arch/arm/mach-imx/headsmp.S
index 627f16f0e9d1..de5047c8a6c8 100644
--- a/arch/arm/mach-imx/headsmp.S
+++ b/arch/arm/mach-imx/headsmp.S
@@ -12,12 +12,7 @@
12 12
13#include <linux/linkage.h> 13#include <linux/linkage.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <asm/asm-offsets.h>
16#include <asm/hardware/cache-l2x0.h>
17 15
18 .section ".text.head", "ax"
19
20#ifdef CONFIG_SMP
21diag_reg_offset: 16diag_reg_offset:
22 .word g_diag_reg - . 17 .word g_diag_reg - .
23 18
@@ -34,38 +29,3 @@ ENTRY(v7_secondary_startup)
34 set_diag_reg 29 set_diag_reg
35 b secondary_startup 30 b secondary_startup
36ENDPROC(v7_secondary_startup) 31ENDPROC(v7_secondary_startup)
37#endif
38
39#ifdef CONFIG_ARM_CPU_SUSPEND
40/*
41 * The following code must assume it is running from physical address
42 * where absolute virtual addresses to the data section have to be
43 * turned into relative ones.
44 */
45
46#ifdef CONFIG_CACHE_L2X0
47 .macro pl310_resume
48 adr r0, l2x0_saved_regs_offset
49 ldr r2, [r0]
50 add r2, r2, r0
51 ldr r0, [r2, #L2X0_R_PHY_BASE] @ get physical base of l2x0
52 ldr r1, [r2, #L2X0_R_AUX_CTRL] @ get aux_ctrl value
53 str r1, [r0, #L2X0_AUX_CTRL] @ restore aux_ctrl
54 mov r1, #0x1
55 str r1, [r0, #L2X0_CTRL] @ re-enable L2
56 .endm
57
58l2x0_saved_regs_offset:
59 .word l2x0_saved_regs - .
60
61#else
62 .macro pl310_resume
63 .endm
64#endif
65
66ENTRY(v7_cpu_resume)
67 bl v7_invalidate_l1
68 pl310_resume
69 b cpu_resume
70ENDPROC(v7_cpu_resume)
71#endif
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 76e5db4fce35..e60456d85c9d 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -182,16 +182,83 @@ static void __init imx6q_enet_phy_init(void)
182 182
183static void __init imx6q_1588_init(void) 183static void __init imx6q_1588_init(void)
184{ 184{
185 struct device_node *np;
186 struct clk *ptp_clk;
187 struct clk *enet_ref;
185 struct regmap *gpr; 188 struct regmap *gpr;
189 u32 clksel;
186 190
191 np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-fec");
192 if (!np) {
193 pr_warn("%s: failed to find fec node\n", __func__);
194 return;
195 }
196
197 ptp_clk = of_clk_get(np, 2);
198 if (IS_ERR(ptp_clk)) {
199 pr_warn("%s: failed to get ptp clock\n", __func__);
200 goto put_node;
201 }
202
203 enet_ref = clk_get_sys(NULL, "enet_ref");
204 if (IS_ERR(enet_ref)) {
205 pr_warn("%s: failed to get enet clock\n", __func__);
206 goto put_ptp_clk;
207 }
208
209 /*
210 * If enet_ref from ANATOP/CCM is the PTP clock source, we need to
211 * set bit IOMUXC_GPR1[21]. Or the PTP clock must be from pad
212 * (external OSC), and we need to clear the bit.
213 */
214 clksel = ptp_clk == enet_ref ? IMX6Q_GPR1_ENET_CLK_SEL_ANATOP :
215 IMX6Q_GPR1_ENET_CLK_SEL_PAD;
187 gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr"); 216 gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
188 if (!IS_ERR(gpr)) 217 if (!IS_ERR(gpr))
189 regmap_update_bits(gpr, IOMUXC_GPR1, 218 regmap_update_bits(gpr, IOMUXC_GPR1,
190 IMX6Q_GPR1_ENET_CLK_SEL_MASK, 219 IMX6Q_GPR1_ENET_CLK_SEL_MASK,
191 IMX6Q_GPR1_ENET_CLK_SEL_ANATOP); 220 clksel);
192 else 221 else
193 pr_err("failed to find fsl,imx6q-iomux-gpr regmap\n"); 222 pr_err("failed to find fsl,imx6q-iomux-gpr regmap\n");
194 223
224 clk_put(enet_ref);
225put_ptp_clk:
226 clk_put(ptp_clk);
227put_node:
228 of_node_put(np);
229}
230
231static void __init imx6q_axi_init(void)
232{
233 struct regmap *gpr;
234 unsigned int mask;
235
236 gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
237 if (!IS_ERR(gpr)) {
238 /*
239 * Enable the cacheable attribute of VPU and IPU
240 * AXI transactions.
241 */
242 mask = IMX6Q_GPR4_VPU_WR_CACHE_SEL |
243 IMX6Q_GPR4_VPU_RD_CACHE_SEL |
244 IMX6Q_GPR4_VPU_P_WR_CACHE_VAL |
245 IMX6Q_GPR4_VPU_P_RD_CACHE_VAL_MASK |
246 IMX6Q_GPR4_IPU_WR_CACHE_CTL |
247 IMX6Q_GPR4_IPU_RD_CACHE_CTL;
248 regmap_update_bits(gpr, IOMUXC_GPR4, mask, mask);
249
250 /* Increase IPU read QoS priority */
251 regmap_update_bits(gpr, IOMUXC_GPR6,
252 IMX6Q_GPR6_IPU1_ID00_RD_QOS_MASK |
253 IMX6Q_GPR6_IPU1_ID01_RD_QOS_MASK,
254 (0xf << 16) | (0x7 << 20));
255 regmap_update_bits(gpr, IOMUXC_GPR7,
256 IMX6Q_GPR7_IPU2_ID00_RD_QOS_MASK |
257 IMX6Q_GPR7_IPU2_ID01_RD_QOS_MASK,
258 (0xf << 16) | (0x7 << 20));
259 } else {
260 pr_warn("failed to find fsl,imx6q-iomuxc-gpr regmap\n");
261 }
195} 262}
196 263
197static void __init imx6q_init_machine(void) 264static void __init imx6q_init_machine(void)
@@ -212,15 +279,18 @@ static void __init imx6q_init_machine(void)
212 of_platform_populate(NULL, of_default_bus_match_table, NULL, parent); 279 of_platform_populate(NULL, of_default_bus_match_table, NULL, parent);
213 280
214 imx_anatop_init(); 281 imx_anatop_init();
215 imx6q_pm_init(); 282 cpu_is_imx6q() ? imx6q_pm_init() : imx6dl_pm_init();
216 imx6q_1588_init(); 283 imx6q_1588_init();
284 imx6q_axi_init();
217} 285}
218 286
219#define OCOTP_CFG3 0x440 287#define OCOTP_CFG3 0x440
220#define OCOTP_CFG3_SPEED_SHIFT 16 288#define OCOTP_CFG3_SPEED_SHIFT 16
221#define OCOTP_CFG3_SPEED_1P2GHZ 0x3 289#define OCOTP_CFG3_SPEED_1P2GHZ 0x3
290#define OCOTP_CFG3_SPEED_996MHZ 0x2
291#define OCOTP_CFG3_SPEED_852MHZ 0x1
222 292
223static void __init imx6q_opp_check_1p2ghz(struct device *cpu_dev) 293static void __init imx6q_opp_check_speed_grading(struct device *cpu_dev)
224{ 294{
225 struct device_node *np; 295 struct device_node *np;
226 void __iomem *base; 296 void __iomem *base;
@@ -238,11 +308,29 @@ static void __init imx6q_opp_check_1p2ghz(struct device *cpu_dev)
238 goto put_node; 308 goto put_node;
239 } 309 }
240 310
311 /*
312 * SPEED_GRADING[1:0] defines the max speed of ARM:
313 * 2b'11: 1200000000Hz;
314 * 2b'10: 996000000Hz;
315 * 2b'01: 852000000Hz; -- i.MX6Q Only, exclusive with 996MHz.
316 * 2b'00: 792000000Hz;
317 * We need to set the max speed of ARM according to fuse map.
318 */
241 val = readl_relaxed(base + OCOTP_CFG3); 319 val = readl_relaxed(base + OCOTP_CFG3);
242 val >>= OCOTP_CFG3_SPEED_SHIFT; 320 val >>= OCOTP_CFG3_SPEED_SHIFT;
243 if ((val & 0x3) != OCOTP_CFG3_SPEED_1P2GHZ) 321 val &= 0x3;
322
323 if (val != OCOTP_CFG3_SPEED_1P2GHZ)
244 if (dev_pm_opp_disable(cpu_dev, 1200000000)) 324 if (dev_pm_opp_disable(cpu_dev, 1200000000))
245 pr_warn("failed to disable 1.2 GHz OPP\n"); 325 pr_warn("failed to disable 1.2 GHz OPP\n");
326 if (val < OCOTP_CFG3_SPEED_996MHZ)
327 if (dev_pm_opp_disable(cpu_dev, 996000000))
328 pr_warn("failed to disable 996 MHz OPP\n");
329 if (cpu_is_imx6q()) {
330 if (val != OCOTP_CFG3_SPEED_852MHZ)
331 if (dev_pm_opp_disable(cpu_dev, 852000000))
332 pr_warn("failed to disable 852 MHz OPP\n");
333 }
246 334
247put_node: 335put_node:
248 of_node_put(np); 336 of_node_put(np);
@@ -268,7 +356,7 @@ static void __init imx6q_opp_init(void)
268 goto put_node; 356 goto put_node;
269 } 357 }
270 358
271 imx6q_opp_check_1p2ghz(cpu_dev); 359 imx6q_opp_check_speed_grading(cpu_dev);
272 360
273put_node: 361put_node:
274 of_node_put(np); 362 of_node_put(np);
diff --git a/arch/arm/mach-imx/mach-imx6sl.c b/arch/arm/mach-imx/mach-imx6sl.c
index 0f4fd4c0ab8e..ad323385115c 100644
--- a/arch/arm/mach-imx/mach-imx6sl.c
+++ b/arch/arm/mach-imx/mach-imx6sl.c
@@ -17,6 +17,7 @@
17#include <asm/mach/map.h> 17#include <asm/mach/map.h>
18 18
19#include "common.h" 19#include "common.h"
20#include "cpuidle.h"
20 21
21static void __init imx6sl_fec_init(void) 22static void __init imx6sl_fec_init(void)
22{ 23{
@@ -39,6 +40,8 @@ static void __init imx6sl_init_late(void)
39 /* imx6sl reuses imx6q cpufreq driver */ 40 /* imx6sl reuses imx6q cpufreq driver */
40 if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) 41 if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ))
41 platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0); 42 platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0);
43
44 imx6sl_cpuidle_init();
42} 45}
43 46
44static void __init imx6sl_init_machine(void) 47static void __init imx6sl_init_machine(void)
@@ -55,8 +58,7 @@ static void __init imx6sl_init_machine(void)
55 58
56 imx6sl_fec_init(); 59 imx6sl_fec_init();
57 imx_anatop_init(); 60 imx_anatop_init();
58 /* Reuse imx6q pm code */ 61 imx6sl_pm_init();
59 imx6q_pm_init();
60} 62}
61 63
62static void __init imx6sl_init_irq(void) 64static void __init imx6sl_init_irq(void)
diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c
index 9821b824dcaf..a7a4a9c67615 100644
--- a/arch/arm/mach-imx/mach-mx27ads.c
+++ b/arch/arm/mach-imx/mach-mx27ads.c
@@ -21,6 +21,10 @@
21#include <linux/mtd/physmap.h> 21#include <linux/mtd/physmap.h>
22#include <linux/i2c.h> 22#include <linux/i2c.h>
23#include <linux/irq.h> 23#include <linux/irq.h>
24
25#include <linux/regulator/fixed.h>
26#include <linux/regulator/machine.h>
27
24#include <asm/mach-types.h> 28#include <asm/mach-types.h>
25#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
26#include <asm/mach/time.h> 30#include <asm/mach/time.h>
@@ -195,14 +199,58 @@ static const struct imxi2c_platform_data mx27ads_i2c1_data __initconst = {
195static struct i2c_board_info mx27ads_i2c_devices[] = { 199static struct i2c_board_info mx27ads_i2c_devices[] = {
196}; 200};
197 201
198void lcd_power(int on) 202static void vgpio_set(struct gpio_chip *chip, unsigned offset, int value)
199{ 203{
200 if (on) 204 if (value)
201 __raw_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_SET_REG); 205 __raw_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_SET_REG);
202 else 206 else
203 __raw_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_CLEAR_REG); 207 __raw_writew(PBC_BCTRL1_LCDON, PBC_BCTRL1_CLEAR_REG);
204} 208}
205 209
210static int vgpio_dir_out(struct gpio_chip *chip, unsigned offset, int value)
211{
212 return 0;
213}
214
215#define MX27ADS_LCD_GPIO (6 * 32)
216
217static struct regulator_consumer_supply mx27ads_lcd_regulator_consumer =
218 REGULATOR_SUPPLY("lcd", "imx-fb.0");
219
220static struct regulator_init_data mx27ads_lcd_regulator_init_data = {
221 .constraints = {
222 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
223},
224 .consumer_supplies = &mx27ads_lcd_regulator_consumer,
225 .num_consumer_supplies = 1,
226};
227
228static struct fixed_voltage_config mx27ads_lcd_regulator_pdata = {
229 .supply_name = "LCD",
230 .microvolts = 3300000,
231 .gpio = MX27ADS_LCD_GPIO,
232 .init_data = &mx27ads_lcd_regulator_init_data,
233};
234
235static void __init mx27ads_regulator_init(void)
236{
237 struct gpio_chip *vchip;
238
239 vchip = kzalloc(sizeof(*vchip), GFP_KERNEL);
240 vchip->owner = THIS_MODULE;
241 vchip->label = "LCD";
242 vchip->base = MX27ADS_LCD_GPIO;
243 vchip->ngpio = 1;
244 vchip->direction_output = vgpio_dir_out;
245 vchip->set = vgpio_set;
246 gpiochip_add(vchip);
247
248 platform_device_register_data(&platform_bus, "reg-fixed-voltage",
249 PLATFORM_DEVID_AUTO,
250 &mx27ads_lcd_regulator_pdata,
251 sizeof(mx27ads_lcd_regulator_pdata));
252}
253
206static struct imx_fb_videomode mx27ads_modes[] = { 254static struct imx_fb_videomode mx27ads_modes[] = {
207 { 255 {
208 .mode = { 256 .mode = {
@@ -239,8 +287,6 @@ static const struct imx_fb_platform_data mx27ads_fb_data __initconst = {
239 .pwmr = 0x00A903FF, 287 .pwmr = 0x00A903FF,
240 .lscr1 = 0x00120300, 288 .lscr1 = 0x00120300,
241 .dmacr = 0x00020010, 289 .dmacr = 0x00020010,
242
243 .lcd_power = lcd_power,
244}; 290};
245 291
246static int mx27ads_sdhc1_init(struct device *dev, irq_handler_t detect_irq, 292static int mx27ads_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
@@ -304,6 +350,7 @@ static void __init mx27ads_board_init(void)
304 i2c_register_board_info(1, mx27ads_i2c_devices, 350 i2c_register_board_info(1, mx27ads_i2c_devices,
305 ARRAY_SIZE(mx27ads_i2c_devices)); 351 ARRAY_SIZE(mx27ads_i2c_devices));
306 imx27_add_imx_i2c(1, &mx27ads_i2c1_data); 352 imx27_add_imx_i2c(1, &mx27ads_i2c1_data);
353 mx27ads_regulator_init();
307 imx27_add_imx_fb(&mx27ads_fb_data); 354 imx27_add_imx_fb(&mx27ads_fb_data);
308 imx27_add_mxc_mmc(0, &sdhc1_pdata); 355 imx27_add_mxc_mmc(0, &sdhc1_pdata);
309 imx27_add_mxc_mmc(1, &sdhc2_pdata); 356 imx27_add_mxc_mmc(1, &sdhc2_pdata);
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c
index b3738e616f19..8f45afe785f8 100644
--- a/arch/arm/mach-imx/mach-mx31moboard.c
+++ b/arch/arm/mach-imx/mach-mx31moboard.c
@@ -128,27 +128,15 @@ static struct platform_device mx31moboard_flash = {
128 .num_resources = 1, 128 .num_resources = 1,
129}; 129};
130 130
131static int moboard_uart0_init(struct platform_device *pdev) 131static void __init moboard_uart0_init(void)
132{ 132{
133 int ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_CTS1), "uart0-cts-hack"); 133 if (!gpio_request(IOMUX_TO_GPIO(MX31_PIN_CTS1), "uart0-cts-hack")) {
134 if (ret) 134 gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CTS1), 0);
135 return ret;
136
137 ret = gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_CTS1), 0);
138 if (ret)
139 gpio_free(IOMUX_TO_GPIO(MX31_PIN_CTS1)); 135 gpio_free(IOMUX_TO_GPIO(MX31_PIN_CTS1));
140 136 }
141 return ret;
142}
143
144static void moboard_uart0_exit(struct platform_device *pdev)
145{
146 gpio_free(IOMUX_TO_GPIO(MX31_PIN_CTS1));
147} 137}
148 138
149static const struct imxuart_platform_data uart0_pdata __initconst = { 139static const struct imxuart_platform_data uart0_pdata __initconst = {
150 .init = moboard_uart0_init,
151 .exit = moboard_uart0_exit,
152}; 140};
153 141
154static const struct imxuart_platform_data uart4_pdata __initconst = { 142static const struct imxuart_platform_data uart4_pdata __initconst = {
@@ -543,6 +531,7 @@ static void __init mx31moboard_init(void)
543 531
544 imx31_add_imx2_wdt(); 532 imx31_add_imx2_wdt();
545 533
534 moboard_uart0_init();
546 imx31_add_imx_uart0(&uart0_pdata); 535 imx31_add_imx_uart0(&uart0_pdata);
547 imx31_add_imx_uart4(&uart4_pdata); 536 imx31_add_imx_uart4(&uart4_pdata);
548 537
diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c
new file mode 100644
index 000000000000..9392a8f4ef24
--- /dev/null
+++ b/arch/arm/mach-imx/pm-imx6.c
@@ -0,0 +1,551 @@
1/*
2 * Copyright 2011-2014 Freescale Semiconductor, Inc.
3 * Copyright 2011 Linaro Ltd.
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/delay.h>
14#include <linux/init.h>
15#include <linux/io.h>
16#include <linux/irq.h>
17#include <linux/genalloc.h>
18#include <linux/mfd/syscon.h>
19#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
20#include <linux/of.h>
21#include <linux/of_address.h>
22#include <linux/of_platform.h>
23#include <linux/regmap.h>
24#include <linux/suspend.h>
25#include <asm/cacheflush.h>
26#include <asm/fncpy.h>
27#include <asm/proc-fns.h>
28#include <asm/suspend.h>
29#include <asm/tlb.h>
30
31#include "common.h"
32#include "hardware.h"
33
34#define CCR 0x0
35#define BM_CCR_WB_COUNT (0x7 << 16)
36#define BM_CCR_RBC_BYPASS_COUNT (0x3f << 21)
37#define BM_CCR_RBC_EN (0x1 << 27)
38
39#define CLPCR 0x54
40#define BP_CLPCR_LPM 0
41#define BM_CLPCR_LPM (0x3 << 0)
42#define BM_CLPCR_BYPASS_PMIC_READY (0x1 << 2)
43#define BM_CLPCR_ARM_CLK_DIS_ON_LPM (0x1 << 5)
44#define BM_CLPCR_SBYOS (0x1 << 6)
45#define BM_CLPCR_DIS_REF_OSC (0x1 << 7)
46#define BM_CLPCR_VSTBY (0x1 << 8)
47#define BP_CLPCR_STBY_COUNT 9
48#define BM_CLPCR_STBY_COUNT (0x3 << 9)
49#define BM_CLPCR_COSC_PWRDOWN (0x1 << 11)
50#define BM_CLPCR_WB_PER_AT_LPM (0x1 << 16)
51#define BM_CLPCR_WB_CORE_AT_LPM (0x1 << 17)
52#define BM_CLPCR_BYP_MMDC_CH0_LPM_HS (0x1 << 19)
53#define BM_CLPCR_BYP_MMDC_CH1_LPM_HS (0x1 << 21)
54#define BM_CLPCR_MASK_CORE0_WFI (0x1 << 22)
55#define BM_CLPCR_MASK_CORE1_WFI (0x1 << 23)
56#define BM_CLPCR_MASK_CORE2_WFI (0x1 << 24)
57#define BM_CLPCR_MASK_CORE3_WFI (0x1 << 25)
58#define BM_CLPCR_MASK_SCU_IDLE (0x1 << 26)
59#define BM_CLPCR_MASK_L2CC_IDLE (0x1 << 27)
60
61#define CGPR 0x64
62#define BM_CGPR_INT_MEM_CLK_LPM (0x1 << 17)
63
64#define MX6Q_SUSPEND_OCRAM_SIZE 0x1000
65#define MX6_MAX_MMDC_IO_NUM 33
66
67static void __iomem *ccm_base;
68static void __iomem *suspend_ocram_base;
69static void (*imx6_suspend_in_ocram_fn)(void __iomem *ocram_vbase);
70
71/*
72 * suspend ocram space layout:
73 * ======================== high address ======================
74 * .
75 * .
76 * .
77 * ^
78 * ^
79 * ^
80 * imx6_suspend code
81 * PM_INFO structure(imx6_cpu_pm_info)
82 * ======================== low address =======================
83 */
84
85struct imx6_pm_base {
86 phys_addr_t pbase;
87 void __iomem *vbase;
88};
89
90struct imx6_pm_socdata {
91 u32 cpu_type;
92 const char *mmdc_compat;
93 const char *src_compat;
94 const char *iomuxc_compat;
95 const char *gpc_compat;
96 const u32 mmdc_io_num;
97 const u32 *mmdc_io_offset;
98};
99
100static const u32 imx6q_mmdc_io_offset[] __initconst = {
101 0x5ac, 0x5b4, 0x528, 0x520, /* DQM0 ~ DQM3 */
102 0x514, 0x510, 0x5bc, 0x5c4, /* DQM4 ~ DQM7 */
103 0x56c, 0x578, 0x588, 0x594, /* CAS, RAS, SDCLK_0, SDCLK_1 */
104 0x5a8, 0x5b0, 0x524, 0x51c, /* SDQS0 ~ SDQS3 */
105 0x518, 0x50c, 0x5b8, 0x5c0, /* SDQS4 ~ SDQS7 */
106 0x784, 0x788, 0x794, 0x79c, /* GPR_B0DS ~ GPR_B3DS */
107 0x7a0, 0x7a4, 0x7a8, 0x748, /* GPR_B4DS ~ GPR_B7DS */
108 0x59c, 0x5a0, 0x750, 0x774, /* SODT0, SODT1, MODE_CTL, MODE */
109 0x74c, /* GPR_ADDS */
110};
111
112static const u32 imx6dl_mmdc_io_offset[] __initconst = {
113 0x470, 0x474, 0x478, 0x47c, /* DQM0 ~ DQM3 */
114 0x480, 0x484, 0x488, 0x48c, /* DQM4 ~ DQM7 */
115 0x464, 0x490, 0x4ac, 0x4b0, /* CAS, RAS, SDCLK_0, SDCLK_1 */
116 0x4bc, 0x4c0, 0x4c4, 0x4c8, /* DRAM_SDQS0 ~ DRAM_SDQS3 */
117 0x4cc, 0x4d0, 0x4d4, 0x4d8, /* DRAM_SDQS4 ~ DRAM_SDQS7 */
118 0x764, 0x770, 0x778, 0x77c, /* GPR_B0DS ~ GPR_B3DS */
119 0x780, 0x784, 0x78c, 0x748, /* GPR_B4DS ~ GPR_B7DS */
120 0x4b4, 0x4b8, 0x750, 0x760, /* SODT0, SODT1, MODE_CTL, MODE */
121 0x74c, /* GPR_ADDS */
122};
123
124static const u32 imx6sl_mmdc_io_offset[] __initconst = {
125 0x30c, 0x310, 0x314, 0x318, /* DQM0 ~ DQM3 */
126 0x5c4, 0x5cc, 0x5d4, 0x5d8, /* GPR_B0DS ~ GPR_B3DS */
127 0x300, 0x31c, 0x338, 0x5ac, /* CAS, RAS, SDCLK_0, GPR_ADDS */
128 0x33c, 0x340, 0x5b0, 0x5c0, /* SODT0, SODT1, MODE_CTL, MODE */
129 0x330, 0x334, 0x320, /* SDCKE0, SDCKE1, RESET */
130};
131
132static const struct imx6_pm_socdata imx6q_pm_data __initconst = {
133 .cpu_type = MXC_CPU_IMX6Q,
134 .mmdc_compat = "fsl,imx6q-mmdc",
135 .src_compat = "fsl,imx6q-src",
136 .iomuxc_compat = "fsl,imx6q-iomuxc",
137 .gpc_compat = "fsl,imx6q-gpc",
138 .mmdc_io_num = ARRAY_SIZE(imx6q_mmdc_io_offset),
139 .mmdc_io_offset = imx6q_mmdc_io_offset,
140};
141
142static const struct imx6_pm_socdata imx6dl_pm_data __initconst = {
143 .cpu_type = MXC_CPU_IMX6DL,
144 .mmdc_compat = "fsl,imx6q-mmdc",
145 .src_compat = "fsl,imx6q-src",
146 .iomuxc_compat = "fsl,imx6dl-iomuxc",
147 .gpc_compat = "fsl,imx6q-gpc",
148 .mmdc_io_num = ARRAY_SIZE(imx6dl_mmdc_io_offset),
149 .mmdc_io_offset = imx6dl_mmdc_io_offset,
150};
151
152static const struct imx6_pm_socdata imx6sl_pm_data __initconst = {
153 .cpu_type = MXC_CPU_IMX6SL,
154 .mmdc_compat = "fsl,imx6sl-mmdc",
155 .src_compat = "fsl,imx6sl-src",
156 .iomuxc_compat = "fsl,imx6sl-iomuxc",
157 .gpc_compat = "fsl,imx6sl-gpc",
158 .mmdc_io_num = ARRAY_SIZE(imx6sl_mmdc_io_offset),
159 .mmdc_io_offset = imx6sl_mmdc_io_offset,
160};
161
162/*
163 * This structure is for passing necessary data for low level ocram
164 * suspend code(arch/arm/mach-imx/suspend-imx6.S), if this struct
165 * definition is changed, the offset definition in
166 * arch/arm/mach-imx/suspend-imx6.S must be also changed accordingly,
167 * otherwise, the suspend to ocram function will be broken!
168 */
169struct imx6_cpu_pm_info {
170 phys_addr_t pbase; /* The physical address of pm_info. */
171 phys_addr_t resume_addr; /* The physical resume address for asm code */
172 u32 cpu_type;
173 u32 pm_info_size; /* Size of pm_info. */
174 struct imx6_pm_base mmdc_base;
175 struct imx6_pm_base src_base;
176 struct imx6_pm_base iomuxc_base;
177 struct imx6_pm_base ccm_base;
178 struct imx6_pm_base gpc_base;
179 struct imx6_pm_base l2_base;
180 u32 mmdc_io_num; /* Number of MMDC IOs which need saved/restored. */
181 u32 mmdc_io_val[MX6_MAX_MMDC_IO_NUM][2]; /* To save offset and value */
182} __aligned(8);
183
184void imx6q_set_int_mem_clk_lpm(void)
185{
186 u32 val = readl_relaxed(ccm_base + CGPR);
187
188 val |= BM_CGPR_INT_MEM_CLK_LPM;
189 writel_relaxed(val, ccm_base + CGPR);
190}
191
192static void imx6q_enable_rbc(bool enable)
193{
194 u32 val;
195
196 /*
197 * need to mask all interrupts in GPC before
198 * operating RBC configurations
199 */
200 imx_gpc_mask_all();
201
202 /* configure RBC enable bit */
203 val = readl_relaxed(ccm_base + CCR);
204 val &= ~BM_CCR_RBC_EN;
205 val |= enable ? BM_CCR_RBC_EN : 0;
206 writel_relaxed(val, ccm_base + CCR);
207
208 /* configure RBC count */
209 val = readl_relaxed(ccm_base + CCR);
210 val &= ~BM_CCR_RBC_BYPASS_COUNT;
211 val |= enable ? BM_CCR_RBC_BYPASS_COUNT : 0;
212 writel(val, ccm_base + CCR);
213
214 /*
215 * need to delay at least 2 cycles of CKIL(32K)
216 * due to hardware design requirement, which is
217 * ~61us, here we use 65us for safe
218 */
219 udelay(65);
220
221 /* restore GPC interrupt mask settings */
222 imx_gpc_restore_all();
223}
224
225static void imx6q_enable_wb(bool enable)
226{
227 u32 val;
228
229 /* configure well bias enable bit */
230 val = readl_relaxed(ccm_base + CLPCR);
231 val &= ~BM_CLPCR_WB_PER_AT_LPM;
232 val |= enable ? BM_CLPCR_WB_PER_AT_LPM : 0;
233 writel_relaxed(val, ccm_base + CLPCR);
234
235 /* configure well bias count */
236 val = readl_relaxed(ccm_base + CCR);
237 val &= ~BM_CCR_WB_COUNT;
238 val |= enable ? BM_CCR_WB_COUNT : 0;
239 writel_relaxed(val, ccm_base + CCR);
240}
241
242int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode)
243{
244 struct irq_data *iomuxc_irq_data = irq_get_irq_data(32);
245 u32 val = readl_relaxed(ccm_base + CLPCR);
246
247 val &= ~BM_CLPCR_LPM;
248 switch (mode) {
249 case WAIT_CLOCKED:
250 break;
251 case WAIT_UNCLOCKED:
252 val |= 0x1 << BP_CLPCR_LPM;
253 val |= BM_CLPCR_ARM_CLK_DIS_ON_LPM;
254 break;
255 case STOP_POWER_ON:
256 val |= 0x2 << BP_CLPCR_LPM;
257 break;
258 case WAIT_UNCLOCKED_POWER_OFF:
259 val |= 0x1 << BP_CLPCR_LPM;
260 val &= ~BM_CLPCR_VSTBY;
261 val &= ~BM_CLPCR_SBYOS;
262 break;
263 case STOP_POWER_OFF:
264 val |= 0x2 << BP_CLPCR_LPM;
265 val |= 0x3 << BP_CLPCR_STBY_COUNT;
266 val |= BM_CLPCR_VSTBY;
267 val |= BM_CLPCR_SBYOS;
268 if (cpu_is_imx6sl()) {
269 val |= BM_CLPCR_BYPASS_PMIC_READY;
270 val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS;
271 } else {
272 val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS;
273 }
274 break;
275 default:
276 return -EINVAL;
277 }
278
279 /*
280 * ERR007265: CCM: When improper low-power sequence is used,
281 * the SoC enters low power mode before the ARM core executes WFI.
282 *
283 * Software workaround:
284 * 1) Software should trigger IRQ #32 (IOMUX) to be always pending
285 * by setting IOMUX_GPR1_GINT.
286 * 2) Software should then unmask IRQ #32 in GPC before setting CCM
287 * Low-Power mode.
288 * 3) Software should mask IRQ #32 right after CCM Low-Power mode
289 * is set (set bits 0-1 of CCM_CLPCR).
290 */
291 imx_gpc_irq_unmask(iomuxc_irq_data);
292 writel_relaxed(val, ccm_base + CLPCR);
293 imx_gpc_irq_mask(iomuxc_irq_data);
294
295 return 0;
296}
297
298static int imx6q_suspend_finish(unsigned long val)
299{
300 if (!imx6_suspend_in_ocram_fn) {
301 cpu_do_idle();
302 } else {
303 /*
304 * call low level suspend function in ocram,
305 * as we need to float DDR IO.
306 */
307 local_flush_tlb_all();
308 imx6_suspend_in_ocram_fn(suspend_ocram_base);
309 }
310
311 return 0;
312}
313
314static int imx6q_pm_enter(suspend_state_t state)
315{
316 switch (state) {
317 case PM_SUSPEND_MEM:
318 imx6q_set_lpm(STOP_POWER_OFF);
319 imx6q_enable_wb(true);
320 /*
321 * For suspend into ocram, asm code already take care of
322 * RBC setting, so we do NOT need to do that here.
323 */
324 if (!imx6_suspend_in_ocram_fn)
325 imx6q_enable_rbc(true);
326 imx_gpc_pre_suspend();
327 imx_anatop_pre_suspend();
328 imx_set_cpu_jump(0, v7_cpu_resume);
329 /* Zzz ... */
330 cpu_suspend(0, imx6q_suspend_finish);
331 if (cpu_is_imx6q() || cpu_is_imx6dl())
332 imx_smp_prepare();
333 imx_anatop_post_resume();
334 imx_gpc_post_resume();
335 imx6q_enable_rbc(false);
336 imx6q_enable_wb(false);
337 imx6q_set_lpm(WAIT_CLOCKED);
338 break;
339 default:
340 return -EINVAL;
341 }
342
343 return 0;
344}
345
346static const struct platform_suspend_ops imx6q_pm_ops = {
347 .enter = imx6q_pm_enter,
348 .valid = suspend_valid_only_mem,
349};
350
351void __init imx6q_pm_set_ccm_base(void __iomem *base)
352{
353 ccm_base = base;
354}
355
356static int __init imx6_pm_get_base(struct imx6_pm_base *base,
357 const char *compat)
358{
359 struct device_node *node;
360 struct resource res;
361 int ret = 0;
362
363 node = of_find_compatible_node(NULL, NULL, compat);
364 if (!node) {
365 ret = -ENODEV;
366 goto out;
367 }
368
369 ret = of_address_to_resource(node, 0, &res);
370 if (ret)
371 goto put_node;
372
373 base->pbase = res.start;
374 base->vbase = ioremap(res.start, resource_size(&res));
375 if (!base->vbase)
376 ret = -ENOMEM;
377
378put_node:
379 of_node_put(node);
380out:
381 return ret;
382}
383
384static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
385{
386 phys_addr_t ocram_pbase;
387 struct device_node *node;
388 struct platform_device *pdev;
389 struct imx6_cpu_pm_info *pm_info;
390 struct gen_pool *ocram_pool;
391 unsigned long ocram_base;
392 int i, ret = 0;
393 const u32 *mmdc_offset_array;
394
395 suspend_set_ops(&imx6q_pm_ops);
396
397 if (!socdata) {
398 pr_warn("%s: invalid argument!\n", __func__);
399 return -EINVAL;
400 }
401
402 node = of_find_compatible_node(NULL, NULL, "mmio-sram");
403 if (!node) {
404 pr_warn("%s: failed to find ocram node!\n", __func__);
405 return -ENODEV;
406 }
407
408 pdev = of_find_device_by_node(node);
409 if (!pdev) {
410 pr_warn("%s: failed to find ocram device!\n", __func__);
411 ret = -ENODEV;
412 goto put_node;
413 }
414
415 ocram_pool = dev_get_gen_pool(&pdev->dev);
416 if (!ocram_pool) {
417 pr_warn("%s: ocram pool unavailable!\n", __func__);
418 ret = -ENODEV;
419 goto put_node;
420 }
421
422 ocram_base = gen_pool_alloc(ocram_pool, MX6Q_SUSPEND_OCRAM_SIZE);
423 if (!ocram_base) {
424 pr_warn("%s: unable to alloc ocram!\n", __func__);
425 ret = -ENOMEM;
426 goto put_node;
427 }
428
429 ocram_pbase = gen_pool_virt_to_phys(ocram_pool, ocram_base);
430
431 suspend_ocram_base = __arm_ioremap_exec(ocram_pbase,
432 MX6Q_SUSPEND_OCRAM_SIZE, false);
433
434 pm_info = suspend_ocram_base;
435 pm_info->pbase = ocram_pbase;
436 pm_info->resume_addr = virt_to_phys(v7_cpu_resume);
437 pm_info->pm_info_size = sizeof(*pm_info);
438
439 /*
440 * ccm physical address is not used by asm code currently,
441 * so get ccm virtual address directly, as we already have
442 * it from ccm driver.
443 */
444 pm_info->ccm_base.vbase = ccm_base;
445
446 ret = imx6_pm_get_base(&pm_info->mmdc_base, socdata->mmdc_compat);
447 if (ret) {
448 pr_warn("%s: failed to get mmdc base %d!\n", __func__, ret);
449 goto put_node;
450 }
451
452 ret = imx6_pm_get_base(&pm_info->src_base, socdata->src_compat);
453 if (ret) {
454 pr_warn("%s: failed to get src base %d!\n", __func__, ret);
455 goto src_map_failed;
456 }
457
458 ret = imx6_pm_get_base(&pm_info->iomuxc_base, socdata->iomuxc_compat);
459 if (ret) {
460 pr_warn("%s: failed to get iomuxc base %d!\n", __func__, ret);
461 goto iomuxc_map_failed;
462 }
463
464 ret = imx6_pm_get_base(&pm_info->gpc_base, socdata->gpc_compat);
465 if (ret) {
466 pr_warn("%s: failed to get gpc base %d!\n", __func__, ret);
467 goto gpc_map_failed;
468 }
469
470 ret = imx6_pm_get_base(&pm_info->l2_base, "arm,pl310-cache");
471 if (ret) {
472 pr_warn("%s: failed to get pl310-cache base %d!\n",
473 __func__, ret);
474 goto pl310_cache_map_failed;
475 }
476
477 pm_info->cpu_type = socdata->cpu_type;
478 pm_info->mmdc_io_num = socdata->mmdc_io_num;
479 mmdc_offset_array = socdata->mmdc_io_offset;
480
481 for (i = 0; i < pm_info->mmdc_io_num; i++) {
482 pm_info->mmdc_io_val[i][0] =
483 mmdc_offset_array[i];
484 pm_info->mmdc_io_val[i][1] =
485 readl_relaxed(pm_info->iomuxc_base.vbase +
486 mmdc_offset_array[i]);
487 }
488
489 imx6_suspend_in_ocram_fn = fncpy(
490 suspend_ocram_base + sizeof(*pm_info),
491 &imx6_suspend,
492 MX6Q_SUSPEND_OCRAM_SIZE - sizeof(*pm_info));
493
494 goto put_node;
495
496pl310_cache_map_failed:
497 iounmap(&pm_info->gpc_base.vbase);
498gpc_map_failed:
499 iounmap(&pm_info->iomuxc_base.vbase);
500iomuxc_map_failed:
501 iounmap(&pm_info->src_base.vbase);
502src_map_failed:
503 iounmap(&pm_info->mmdc_base.vbase);
504put_node:
505 of_node_put(node);
506
507 return ret;
508}
509
510static void __init imx6_pm_common_init(const struct imx6_pm_socdata
511 *socdata)
512{
513 struct regmap *gpr;
514 int ret;
515
516 WARN_ON(!ccm_base);
517
518 if (IS_ENABLED(CONFIG_SUSPEND)) {
519 ret = imx6q_suspend_init(socdata);
520 if (ret)
521 pr_warn("%s: No DDR LPM support with suspend %d!\n",
522 __func__, ret);
523 }
524
525 /*
526 * This is for SW workaround step #1 of ERR007265, see comments
527 * in imx6q_set_lpm for details of this errata.
528 * Force IOMUXC irq pending, so that the interrupt to GPC can be
529 * used to deassert dsm_request signal when the signal gets
530 * asserted unexpectedly.
531 */
532 gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
533 if (!IS_ERR(gpr))
534 regmap_update_bits(gpr, IOMUXC_GPR1, IMX6Q_GPR1_GINT,
535 IMX6Q_GPR1_GINT);
536}
537
538void __init imx6q_pm_init(void)
539{
540 imx6_pm_common_init(&imx6q_pm_data);
541}
542
543void __init imx6dl_pm_init(void)
544{
545 imx6_pm_common_init(&imx6dl_pm_data);
546}
547
548void __init imx6sl_pm_init(void)
549{
550 imx6_pm_common_init(&imx6sl_pm_data);
551}
diff --git a/arch/arm/mach-imx/pm-imx6q.c b/arch/arm/mach-imx/pm-imx6q.c
deleted file mode 100644
index 29e3fe6a6669..000000000000
--- a/arch/arm/mach-imx/pm-imx6q.c
+++ /dev/null
@@ -1,240 +0,0 @@
1/*
2 * Copyright 2011-2013 Freescale Semiconductor, Inc.
3 * Copyright 2011 Linaro Ltd.
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/delay.h>
14#include <linux/init.h>
15#include <linux/io.h>
16#include <linux/irq.h>
17#include <linux/mfd/syscon.h>
18#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
19#include <linux/of.h>
20#include <linux/of_address.h>
21#include <linux/regmap.h>
22#include <linux/suspend.h>
23#include <asm/cacheflush.h>
24#include <asm/proc-fns.h>
25#include <asm/suspend.h>
26#include <asm/hardware/cache-l2x0.h>
27
28#include "common.h"
29#include "hardware.h"
30
31#define CCR 0x0
32#define BM_CCR_WB_COUNT (0x7 << 16)
33#define BM_CCR_RBC_BYPASS_COUNT (0x3f << 21)
34#define BM_CCR_RBC_EN (0x1 << 27)
35
36#define CLPCR 0x54
37#define BP_CLPCR_LPM 0
38#define BM_CLPCR_LPM (0x3 << 0)
39#define BM_CLPCR_BYPASS_PMIC_READY (0x1 << 2)
40#define BM_CLPCR_ARM_CLK_DIS_ON_LPM (0x1 << 5)
41#define BM_CLPCR_SBYOS (0x1 << 6)
42#define BM_CLPCR_DIS_REF_OSC (0x1 << 7)
43#define BM_CLPCR_VSTBY (0x1 << 8)
44#define BP_CLPCR_STBY_COUNT 9
45#define BM_CLPCR_STBY_COUNT (0x3 << 9)
46#define BM_CLPCR_COSC_PWRDOWN (0x1 << 11)
47#define BM_CLPCR_WB_PER_AT_LPM (0x1 << 16)
48#define BM_CLPCR_WB_CORE_AT_LPM (0x1 << 17)
49#define BM_CLPCR_BYP_MMDC_CH0_LPM_HS (0x1 << 19)
50#define BM_CLPCR_BYP_MMDC_CH1_LPM_HS (0x1 << 21)
51#define BM_CLPCR_MASK_CORE0_WFI (0x1 << 22)
52#define BM_CLPCR_MASK_CORE1_WFI (0x1 << 23)
53#define BM_CLPCR_MASK_CORE2_WFI (0x1 << 24)
54#define BM_CLPCR_MASK_CORE3_WFI (0x1 << 25)
55#define BM_CLPCR_MASK_SCU_IDLE (0x1 << 26)
56#define BM_CLPCR_MASK_L2CC_IDLE (0x1 << 27)
57
58#define CGPR 0x64
59#define BM_CGPR_CHICKEN_BIT (0x1 << 17)
60
61static void __iomem *ccm_base;
62
63void imx6q_set_chicken_bit(void)
64{
65 u32 val = readl_relaxed(ccm_base + CGPR);
66
67 val |= BM_CGPR_CHICKEN_BIT;
68 writel_relaxed(val, ccm_base + CGPR);
69}
70
71static void imx6q_enable_rbc(bool enable)
72{
73 u32 val;
74
75 /*
76 * need to mask all interrupts in GPC before
77 * operating RBC configurations
78 */
79 imx_gpc_mask_all();
80
81 /* configure RBC enable bit */
82 val = readl_relaxed(ccm_base + CCR);
83 val &= ~BM_CCR_RBC_EN;
84 val |= enable ? BM_CCR_RBC_EN : 0;
85 writel_relaxed(val, ccm_base + CCR);
86
87 /* configure RBC count */
88 val = readl_relaxed(ccm_base + CCR);
89 val &= ~BM_CCR_RBC_BYPASS_COUNT;
90 val |= enable ? BM_CCR_RBC_BYPASS_COUNT : 0;
91 writel(val, ccm_base + CCR);
92
93 /*
94 * need to delay at least 2 cycles of CKIL(32K)
95 * due to hardware design requirement, which is
96 * ~61us, here we use 65us for safe
97 */
98 udelay(65);
99
100 /* restore GPC interrupt mask settings */
101 imx_gpc_restore_all();
102}
103
104static void imx6q_enable_wb(bool enable)
105{
106 u32 val;
107
108 /* configure well bias enable bit */
109 val = readl_relaxed(ccm_base + CLPCR);
110 val &= ~BM_CLPCR_WB_PER_AT_LPM;
111 val |= enable ? BM_CLPCR_WB_PER_AT_LPM : 0;
112 writel_relaxed(val, ccm_base + CLPCR);
113
114 /* configure well bias count */
115 val = readl_relaxed(ccm_base + CCR);
116 val &= ~BM_CCR_WB_COUNT;
117 val |= enable ? BM_CCR_WB_COUNT : 0;
118 writel_relaxed(val, ccm_base + CCR);
119}
120
121int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode)
122{
123 struct irq_data *iomuxc_irq_data = irq_get_irq_data(32);
124 u32 val = readl_relaxed(ccm_base + CLPCR);
125
126 val &= ~BM_CLPCR_LPM;
127 switch (mode) {
128 case WAIT_CLOCKED:
129 break;
130 case WAIT_UNCLOCKED:
131 val |= 0x1 << BP_CLPCR_LPM;
132 val |= BM_CLPCR_ARM_CLK_DIS_ON_LPM;
133 break;
134 case STOP_POWER_ON:
135 val |= 0x2 << BP_CLPCR_LPM;
136 break;
137 case WAIT_UNCLOCKED_POWER_OFF:
138 val |= 0x1 << BP_CLPCR_LPM;
139 val &= ~BM_CLPCR_VSTBY;
140 val &= ~BM_CLPCR_SBYOS;
141 break;
142 case STOP_POWER_OFF:
143 val |= 0x2 << BP_CLPCR_LPM;
144 val |= 0x3 << BP_CLPCR_STBY_COUNT;
145 val |= BM_CLPCR_VSTBY;
146 val |= BM_CLPCR_SBYOS;
147 if (cpu_is_imx6sl()) {
148 val |= BM_CLPCR_BYPASS_PMIC_READY;
149 val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS;
150 } else {
151 val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS;
152 }
153 break;
154 default:
155 return -EINVAL;
156 }
157
158 /*
159 * ERR007265: CCM: When improper low-power sequence is used,
160 * the SoC enters low power mode before the ARM core executes WFI.
161 *
162 * Software workaround:
163 * 1) Software should trigger IRQ #32 (IOMUX) to be always pending
164 * by setting IOMUX_GPR1_GINT.
165 * 2) Software should then unmask IRQ #32 in GPC before setting CCM
166 * Low-Power mode.
167 * 3) Software should mask IRQ #32 right after CCM Low-Power mode
168 * is set (set bits 0-1 of CCM_CLPCR).
169 */
170 imx_gpc_irq_unmask(iomuxc_irq_data);
171 writel_relaxed(val, ccm_base + CLPCR);
172 imx_gpc_irq_mask(iomuxc_irq_data);
173
174 return 0;
175}
176
177static int imx6q_suspend_finish(unsigned long val)
178{
179 cpu_do_idle();
180 return 0;
181}
182
183static int imx6q_pm_enter(suspend_state_t state)
184{
185 switch (state) {
186 case PM_SUSPEND_MEM:
187 imx6q_set_lpm(STOP_POWER_OFF);
188 imx6q_enable_wb(true);
189 imx6q_enable_rbc(true);
190 imx_gpc_pre_suspend();
191 imx_anatop_pre_suspend();
192 imx_set_cpu_jump(0, v7_cpu_resume);
193 /* Zzz ... */
194 cpu_suspend(0, imx6q_suspend_finish);
195 if (cpu_is_imx6q() || cpu_is_imx6dl())
196 imx_smp_prepare();
197 imx_anatop_post_resume();
198 imx_gpc_post_resume();
199 imx6q_enable_rbc(false);
200 imx6q_enable_wb(false);
201 imx6q_set_lpm(WAIT_CLOCKED);
202 break;
203 default:
204 return -EINVAL;
205 }
206
207 return 0;
208}
209
210static const struct platform_suspend_ops imx6q_pm_ops = {
211 .enter = imx6q_pm_enter,
212 .valid = suspend_valid_only_mem,
213};
214
215void __init imx6q_pm_set_ccm_base(void __iomem *base)
216{
217 ccm_base = base;
218}
219
220void __init imx6q_pm_init(void)
221{
222 struct regmap *gpr;
223
224 WARN_ON(!ccm_base);
225
226 /*
227 * This is for SW workaround step #1 of ERR007265, see comments
228 * in imx6q_set_lpm for details of this errata.
229 * Force IOMUXC irq pending, so that the interrupt to GPC can be
230 * used to deassert dsm_request signal when the signal gets
231 * asserted unexpectedly.
232 */
233 gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
234 if (!IS_ERR(gpr))
235 regmap_update_bits(gpr, IOMUXC_GPR1, IMX6Q_GPR1_GINT,
236 IMX6Q_GPR1_GINT);
237
238
239 suspend_set_ops(&imx6q_pm_ops);
240}
diff --git a/arch/arm/mach-imx/suspend-imx6.S b/arch/arm/mach-imx/suspend-imx6.S
new file mode 100644
index 000000000000..20048ff05739
--- /dev/null
+++ b/arch/arm/mach-imx/suspend-imx6.S
@@ -0,0 +1,361 @@
1/*
2 * Copyright 2014 Freescale Semiconductor, Inc.
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/linkage.h>
13#include <asm/asm-offsets.h>
14#include <asm/hardware/cache-l2x0.h>
15#include "hardware.h"
16
17/*
18 * ==================== low level suspend ====================
19 *
20 * Better to follow below rules to use ARM registers:
21 * r0: pm_info structure address;
22 * r1 ~ r4: for saving pm_info members;
23 * r5 ~ r10: free registers;
24 * r11: io base address.
25 *
26 * suspend ocram space layout:
27 * ======================== high address ======================
28 * .
29 * .
30 * .
31 * ^
32 * ^
33 * ^
34 * imx6_suspend code
35 * PM_INFO structure(imx6_cpu_pm_info)
36 * ======================== low address =======================
37 */
38
39/*
40 * Below offsets are based on struct imx6_cpu_pm_info
41 * which defined in arch/arm/mach-imx/pm-imx6q.c, this
42 * structure contains necessary pm info for low level
43 * suspend related code.
44 */
45#define PM_INFO_PBASE_OFFSET 0x0
46#define PM_INFO_RESUME_ADDR_OFFSET 0x4
47#define PM_INFO_CPU_TYPE_OFFSET 0x8
48#define PM_INFO_PM_INFO_SIZE_OFFSET 0xC
49#define PM_INFO_MX6Q_MMDC_P_OFFSET 0x10
50#define PM_INFO_MX6Q_MMDC_V_OFFSET 0x14
51#define PM_INFO_MX6Q_SRC_P_OFFSET 0x18
52#define PM_INFO_MX6Q_SRC_V_OFFSET 0x1C
53#define PM_INFO_MX6Q_IOMUXC_P_OFFSET 0x20
54#define PM_INFO_MX6Q_IOMUXC_V_OFFSET 0x24
55#define PM_INFO_MX6Q_CCM_P_OFFSET 0x28
56#define PM_INFO_MX6Q_CCM_V_OFFSET 0x2C
57#define PM_INFO_MX6Q_GPC_P_OFFSET 0x30
58#define PM_INFO_MX6Q_GPC_V_OFFSET 0x34
59#define PM_INFO_MX6Q_L2_P_OFFSET 0x38
60#define PM_INFO_MX6Q_L2_V_OFFSET 0x3C
61#define PM_INFO_MMDC_IO_NUM_OFFSET 0x40
62#define PM_INFO_MMDC_IO_VAL_OFFSET 0x44
63
64#define MX6Q_SRC_GPR1 0x20
65#define MX6Q_SRC_GPR2 0x24
66#define MX6Q_MMDC_MAPSR 0x404
67#define MX6Q_MMDC_MPDGCTRL0 0x83c
68#define MX6Q_GPC_IMR1 0x08
69#define MX6Q_GPC_IMR2 0x0c
70#define MX6Q_GPC_IMR3 0x10
71#define MX6Q_GPC_IMR4 0x14
72#define MX6Q_CCM_CCR 0x0
73
74 .align 3
75
76 .macro sync_l2_cache
77
78 /* sync L2 cache to drain L2's buffers to DRAM. */
79#ifdef CONFIG_CACHE_L2X0
80 ldr r11, [r0, #PM_INFO_MX6Q_L2_V_OFFSET]
81 mov r6, #0x0
82 str r6, [r11, #L2X0_CACHE_SYNC]
831:
84 ldr r6, [r11, #L2X0_CACHE_SYNC]
85 ands r6, r6, #0x1
86 bne 1b
87#endif
88
89 .endm
90
91 .macro resume_mmdc
92
93 /* restore MMDC IO */
94 cmp r5, #0x0
95 ldreq r11, [r0, #PM_INFO_MX6Q_IOMUXC_V_OFFSET]
96 ldrne r11, [r0, #PM_INFO_MX6Q_IOMUXC_P_OFFSET]
97
98 ldr r6, [r0, #PM_INFO_MMDC_IO_NUM_OFFSET]
99 ldr r7, =PM_INFO_MMDC_IO_VAL_OFFSET
100 add r7, r7, r0
1011:
102 ldr r8, [r7], #0x4
103 ldr r9, [r7], #0x4
104 str r9, [r11, r8]
105 subs r6, r6, #0x1
106 bne 1b
107
108 cmp r5, #0x0
109 ldreq r11, [r0, #PM_INFO_MX6Q_MMDC_V_OFFSET]
110 ldrne r11, [r0, #PM_INFO_MX6Q_MMDC_P_OFFSET]
111
112 cmp r3, #MXC_CPU_IMX6SL
113 bne 4f
114
115 /* reset read FIFO, RST_RD_FIFO */
116 ldr r7, =MX6Q_MMDC_MPDGCTRL0
117 ldr r6, [r11, r7]
118 orr r6, r6, #(1 << 31)
119 str r6, [r11, r7]
1202:
121 ldr r6, [r11, r7]
122 ands r6, r6, #(1 << 31)
123 bne 2b
124
125 /* reset FIFO a second time */
126 ldr r6, [r11, r7]
127 orr r6, r6, #(1 << 31)
128 str r6, [r11, r7]
1293:
130 ldr r6, [r11, r7]
131 ands r6, r6, #(1 << 31)
132 bne 3b
1334:
134 /* let DDR out of self-refresh */
135 ldr r7, [r11, #MX6Q_MMDC_MAPSR]
136 bic r7, r7, #(1 << 21)
137 str r7, [r11, #MX6Q_MMDC_MAPSR]
1385:
139 ldr r7, [r11, #MX6Q_MMDC_MAPSR]
140 ands r7, r7, #(1 << 25)
141 bne 5b
142
143 /* enable DDR auto power saving */
144 ldr r7, [r11, #MX6Q_MMDC_MAPSR]
145 bic r7, r7, #0x1
146 str r7, [r11, #MX6Q_MMDC_MAPSR]
147
148 .endm
149
150ENTRY(imx6_suspend)
151 ldr r1, [r0, #PM_INFO_PBASE_OFFSET]
152 ldr r2, [r0, #PM_INFO_RESUME_ADDR_OFFSET]
153 ldr r3, [r0, #PM_INFO_CPU_TYPE_OFFSET]
154 ldr r4, [r0, #PM_INFO_PM_INFO_SIZE_OFFSET]
155
156 /*
157 * counting the resume address in iram
158 * to set it in SRC register.
159 */
160 ldr r6, =imx6_suspend
161 ldr r7, =resume
162 sub r7, r7, r6
163 add r8, r1, r4
164 add r9, r8, r7
165
166 /*
167 * make sure TLB contain the addr we want,
168 * as we will access them after MMDC IO floated.
169 */
170
171 ldr r11, [r0, #PM_INFO_MX6Q_CCM_V_OFFSET]
172 ldr r6, [r11, #0x0]
173 ldr r11, [r0, #PM_INFO_MX6Q_GPC_V_OFFSET]
174 ldr r6, [r11, #0x0]
175
176 /* use r11 to store the IO address */
177 ldr r11, [r0, #PM_INFO_MX6Q_SRC_V_OFFSET]
178 /* store physical resume addr and pm_info address. */
179 str r9, [r11, #MX6Q_SRC_GPR1]
180 str r1, [r11, #MX6Q_SRC_GPR2]
181
182 /* need to sync L2 cache before DSM. */
183 sync_l2_cache
184
185 ldr r11, [r0, #PM_INFO_MX6Q_MMDC_V_OFFSET]
186 /*
187 * put DDR explicitly into self-refresh and
188 * disable automatic power savings.
189 */
190 ldr r7, [r11, #MX6Q_MMDC_MAPSR]
191 orr r7, r7, #0x1
192 str r7, [r11, #MX6Q_MMDC_MAPSR]
193
194 /* make the DDR explicitly enter self-refresh. */
195 ldr r7, [r11, #MX6Q_MMDC_MAPSR]
196 orr r7, r7, #(1 << 21)
197 str r7, [r11, #MX6Q_MMDC_MAPSR]
198
199poll_dvfs_set:
200 ldr r7, [r11, #MX6Q_MMDC_MAPSR]
201 ands r7, r7, #(1 << 25)
202 beq poll_dvfs_set
203
204 ldr r11, [r0, #PM_INFO_MX6Q_IOMUXC_V_OFFSET]
205 ldr r6, =0x0
206 ldr r7, [r0, #PM_INFO_MMDC_IO_NUM_OFFSET]
207 ldr r8, =PM_INFO_MMDC_IO_VAL_OFFSET
208 add r8, r8, r0
209 /* i.MX6SL's last 3 IOs need special setting */
210 cmp r3, #MXC_CPU_IMX6SL
211 subeq r7, r7, #0x3
212set_mmdc_io_lpm:
213 ldr r9, [r8], #0x8
214 str r6, [r11, r9]
215 subs r7, r7, #0x1
216 bne set_mmdc_io_lpm
217
218 cmp r3, #MXC_CPU_IMX6SL
219 bne set_mmdc_io_lpm_done
220 ldr r6, =0x1000
221 ldr r9, [r8], #0x8
222 str r6, [r11, r9]
223 ldr r9, [r8], #0x8
224 str r6, [r11, r9]
225 ldr r6, =0x80000
226 ldr r9, [r8]
227 str r6, [r11, r9]
228set_mmdc_io_lpm_done:
229
230 /*
231 * mask all GPC interrupts before
232 * enabling the RBC counters to
233 * avoid the counter starting too
234 * early if an interupt is already
235 * pending.
236 */
237 ldr r11, [r0, #PM_INFO_MX6Q_GPC_V_OFFSET]
238 ldr r6, [r11, #MX6Q_GPC_IMR1]
239 ldr r7, [r11, #MX6Q_GPC_IMR2]
240 ldr r8, [r11, #MX6Q_GPC_IMR3]
241 ldr r9, [r11, #MX6Q_GPC_IMR4]
242
243 ldr r10, =0xffffffff
244 str r10, [r11, #MX6Q_GPC_IMR1]
245 str r10, [r11, #MX6Q_GPC_IMR2]
246 str r10, [r11, #MX6Q_GPC_IMR3]
247 str r10, [r11, #MX6Q_GPC_IMR4]
248
249 /*
250 * enable the RBC bypass counter here
251 * to hold off the interrupts. RBC counter
252 * = 32 (1ms), Minimum RBC delay should be
253 * 400us for the analog LDOs to power down.
254 */
255 ldr r11, [r0, #PM_INFO_MX6Q_CCM_V_OFFSET]
256 ldr r10, [r11, #MX6Q_CCM_CCR]
257 bic r10, r10, #(0x3f << 21)
258 orr r10, r10, #(0x20 << 21)
259 str r10, [r11, #MX6Q_CCM_CCR]
260
261 /* enable the counter. */
262 ldr r10, [r11, #MX6Q_CCM_CCR]
263 orr r10, r10, #(0x1 << 27)
264 str r10, [r11, #MX6Q_CCM_CCR]
265
266 /* unmask all the GPC interrupts. */
267 ldr r11, [r0, #PM_INFO_MX6Q_GPC_V_OFFSET]
268 str r6, [r11, #MX6Q_GPC_IMR1]
269 str r7, [r11, #MX6Q_GPC_IMR2]
270 str r8, [r11, #MX6Q_GPC_IMR3]
271 str r9, [r11, #MX6Q_GPC_IMR4]
272
273 /*
274 * now delay for a short while (3usec)
275 * ARM is at 1GHz at this point
276 * so a short loop should be enough.
277 * this delay is required to ensure that
278 * the RBC counter can start counting in
279 * case an interrupt is already pending
280 * or in case an interrupt arrives just
281 * as ARM is about to assert DSM_request.
282 */
283 ldr r6, =2000
284rbc_loop:
285 subs r6, r6, #0x1
286 bne rbc_loop
287
288 /* Zzz, enter stop mode */
289 wfi
290 nop
291 nop
292 nop
293 nop
294
295 /*
296 * run to here means there is pending
297 * wakeup source, system should auto
298 * resume, we need to restore MMDC IO first
299 */
300 mov r5, #0x0
301 resume_mmdc
302
303 /* return to suspend finish */
304 mov pc, lr
305
306resume:
307 /* invalidate L1 I-cache first */
308 mov r6, #0x0
309 mcr p15, 0, r6, c7, c5, 0
310 mcr p15, 0, r6, c7, c5, 6
311 /* enable the Icache and branch prediction */
312 mov r6, #0x1800
313 mcr p15, 0, r6, c1, c0, 0
314 isb
315
316 /* get physical resume address from pm_info. */
317 ldr lr, [r0, #PM_INFO_RESUME_ADDR_OFFSET]
318 /* clear core0's entry and parameter */
319 ldr r11, [r0, #PM_INFO_MX6Q_SRC_P_OFFSET]
320 mov r7, #0x0
321 str r7, [r11, #MX6Q_SRC_GPR1]
322 str r7, [r11, #MX6Q_SRC_GPR2]
323
324 ldr r3, [r0, #PM_INFO_CPU_TYPE_OFFSET]
325 mov r5, #0x1
326 resume_mmdc
327
328 mov pc, lr
329ENDPROC(imx6_suspend)
330
331/*
332 * The following code must assume it is running from physical address
333 * where absolute virtual addresses to the data section have to be
334 * turned into relative ones.
335 */
336
337#ifdef CONFIG_CACHE_L2X0
338 .macro pl310_resume
339 adr r0, l2x0_saved_regs_offset
340 ldr r2, [r0]
341 add r2, r2, r0
342 ldr r0, [r2, #L2X0_R_PHY_BASE] @ get physical base of l2x0
343 ldr r1, [r2, #L2X0_R_AUX_CTRL] @ get aux_ctrl value
344 str r1, [r0, #L2X0_AUX_CTRL] @ restore aux_ctrl
345 mov r1, #0x1
346 str r1, [r0, #L2X0_CTRL] @ re-enable L2
347 .endm
348
349l2x0_saved_regs_offset:
350 .word l2x0_saved_regs - .
351
352#else
353 .macro pl310_resume
354 .endm
355#endif
356
357ENTRY(v7_cpu_resume)
358 bl v7_invalidate_l1
359 pl310_resume
360 b cpu_resume
361ENDPROC(v7_cpu_resume)
diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
index 1a3a5f615770..65222ea0df6d 100644
--- a/arch/arm/mach-imx/time.c
+++ b/arch/arm/mach-imx/time.c
@@ -25,6 +25,7 @@
25#include <linux/irq.h> 25#include <linux/irq.h>
26#include <linux/clockchips.h> 26#include <linux/clockchips.h>
27#include <linux/clk.h> 27#include <linux/clk.h>
28#include <linux/delay.h>
28#include <linux/err.h> 29#include <linux/err.h>
29#include <linux/sched_clock.h> 30#include <linux/sched_clock.h>
30 31
@@ -116,11 +117,22 @@ static u64 notrace mxc_read_sched_clock(void)
116 return sched_clock_reg ? __raw_readl(sched_clock_reg) : 0; 117 return sched_clock_reg ? __raw_readl(sched_clock_reg) : 0;
117} 118}
118 119
120static struct delay_timer imx_delay_timer;
121
122static unsigned long imx_read_current_timer(void)
123{
124 return __raw_readl(sched_clock_reg);
125}
126
119static int __init mxc_clocksource_init(struct clk *timer_clk) 127static int __init mxc_clocksource_init(struct clk *timer_clk)
120{ 128{
121 unsigned int c = clk_get_rate(timer_clk); 129 unsigned int c = clk_get_rate(timer_clk);
122 void __iomem *reg = timer_base + (timer_is_v2() ? V2_TCN : MX1_2_TCN); 130 void __iomem *reg = timer_base + (timer_is_v2() ? V2_TCN : MX1_2_TCN);
123 131
132 imx_delay_timer.read_current_timer = &imx_read_current_timer;
133 imx_delay_timer.freq = c;
134 register_current_timer_delay(&imx_delay_timer);
135
124 sched_clock_reg = reg; 136 sched_clock_reg = reg;
125 137
126 sched_clock_register(mxc_read_sched_clock, 32, c); 138 sched_clock_register(mxc_read_sched_clock, 32, c);
diff --git a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig
index abeff25532ab..ba43321001d8 100644
--- a/arch/arm/mach-integrator/Kconfig
+++ b/arch/arm/mach-integrator/Kconfig
@@ -6,8 +6,8 @@ config ARCH_INTEGRATOR_AP
6 bool "Support Integrator/AP and Integrator/PP2 platforms" 6 bool "Support Integrator/AP and Integrator/PP2 platforms"
7 select CLKSRC_MMIO 7 select CLKSRC_MMIO
8 select MIGHT_HAVE_PCI 8 select MIGHT_HAVE_PCI
9 select SERIAL_AMBA_PL010 9 select SERIAL_AMBA_PL010 if TTY
10 select SERIAL_AMBA_PL010_CONSOLE 10 select SERIAL_AMBA_PL010_CONSOLE if TTY
11 select SOC_BUS 11 select SOC_BUS
12 help 12 help
13 Include support for the ARM(R) Integrator/AP and 13 Include support for the ARM(R) Integrator/AP and
@@ -18,8 +18,8 @@ config ARCH_INTEGRATOR_CP
18 select ARCH_CINTEGRATOR 18 select ARCH_CINTEGRATOR
19 select ARM_TIMER_SP804 19 select ARM_TIMER_SP804
20 select PLAT_VERSATILE_CLCD 20 select PLAT_VERSATILE_CLCD
21 select SERIAL_AMBA_PL011 21 select SERIAL_AMBA_PL011 if TTY
22 select SERIAL_AMBA_PL011_CONSOLE 22 select SERIAL_AMBA_PL011_CONSOLE if TTY
23 select SOC_BUS 23 select SOC_BUS
24 help 24 help
25 Include support for the ARM(R) Integrator CP platform. 25 Include support for the ARM(R) Integrator CP platform.
@@ -30,6 +30,9 @@ config ARCH_CINTEGRATOR
30config INTEGRATOR_IMPD1 30config INTEGRATOR_IMPD1
31 tristate "Include support for Integrator/IM-PD1" 31 tristate "Include support for Integrator/IM-PD1"
32 depends on ARCH_INTEGRATOR_AP 32 depends on ARCH_INTEGRATOR_AP
33 select ARCH_REQUIRE_GPIOLIB
34 select ARM_VIC
35 select GPIO_PL061 if GPIOLIB
33 help 36 help
34 The IM-PD1 is an add-on logic module for the Integrator which 37 The IM-PD1 is an add-on logic module for the Integrator which
35 allows ARM(R) Ltd PrimeCells to be developed and evaluated. 38 allows ARM(R) Ltd PrimeCells to be developed and evaluated.
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index 00ddf20ed91b..e3f3aca43efb 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -25,13 +25,11 @@
25#include <linux/of.h> 25#include <linux/of.h>
26#include <linux/of_address.h> 26#include <linux/of_address.h>
27 27
28#include <mach/hardware.h>
29#include <mach/platform.h>
30
31#include <asm/mach-types.h> 28#include <asm/mach-types.h>
32#include <asm/mach/time.h> 29#include <asm/mach/time.h>
33#include <asm/pgtable.h> 30#include <asm/pgtable.h>
34 31
32#include "hardware.h"
35#include "cm.h" 33#include "cm.h"
36#include "common.h" 34#include "common.h"
37 35
diff --git a/arch/arm/mach-integrator/include/mach/platform.h b/arch/arm/mach-integrator/hardware.h
index 306d025d9730..857ca5f8b9a6 100644
--- a/arch/arm/mach-integrator/include/mach/platform.h
+++ b/arch/arm/mach-integrator/hardware.h
@@ -1,4 +1,8 @@
1/* 1/*
2 * This file contains the hardware definitions of the Integrator.
3 *
4 * Copyright (C) 1998-1999 ARM Limited.
5 *
2 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or 8 * the Free Software Foundation; either version 2 of the License, or
@@ -13,26 +17,28 @@
13 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15 */ 19 */
16/************************************************************************** 20#ifndef INTEGRATOR_HARDWARE_H
17 * * Copyright © ARM Limited 1998. All rights reserved. 21#define INTEGRATOR_HARDWARE_H
18 * ***********************************************************************/
19/* ************************************************************************
20 *
21 * Integrator address map
22 *
23 * ***********************************************************************/
24 22
25#ifndef __address_h 23/*
26#define __address_h 1 24 * Where in virtual memory the IO devices (timers, system controllers
25 * and so on)
26 */
27#define IO_BASE 0xF0000000 // VA of IO
28#define IO_SIZE 0x0B000000 // How much?
29#define IO_START INTEGRATOR_HDR_BASE // PA of IO
30
31/* macro to get at IO space when running virtually */
32#ifdef CONFIG_MMU
33#define IO_ADDRESS(x) (((x) & 0x000fffff) | (((x) >> 4) & 0x0ff00000) | IO_BASE)
34#else
35#define IO_ADDRESS(x) (x)
36#endif
27 37
28/* ======================================================================== 38#define __io_address(n) ((void __iomem *)IO_ADDRESS(n))
29 * Integrator definitions 39
30 * ======================================================================== 40/*
31 * ------------------------------------------------------------------------
32 * Memory definitions
33 * ------------------------------------------------------------------------
34 * Integrator memory map 41 * Integrator memory map
35 *
36 */ 42 */
37#define INTEGRATOR_BOOT_ROM_LO 0x00000000 43#define INTEGRATOR_BOOT_ROM_LO 0x00000000
38#define INTEGRATOR_BOOT_ROM_HI 0x20000000 44#define INTEGRATOR_BOOT_ROM_HI 0x20000000
@@ -40,13 +46,13 @@
40#define INTEGRATOR_BOOT_ROM_SIZE SZ_512K 46#define INTEGRATOR_BOOT_ROM_SIZE SZ_512K
41 47
42/* 48/*
43 * New Core Modules have different amounts of SSRAM, the amount of SSRAM 49 * New Core Modules have different amounts of SSRAM, the amount of SSRAM
44 * fitted can be found in HDR_STAT. 50 * fitted can be found in HDR_STAT.
45 * 51 *
46 * The symbol INTEGRATOR_SSRAM_SIZE is kept, however this now refers to 52 * The symbol INTEGRATOR_SSRAM_SIZE is kept, however this now refers to
47 * the minimum amount of SSRAM fitted on any core module. 53 * the minimum amount of SSRAM fitted on any core module.
48 * 54 *
49 * New Core Modules also alias the SSRAM. 55 * New Core Modules also alias the SSRAM.
50 * 56 *
51 */ 57 */
52#define INTEGRATOR_SSRAM_BASE 0x00000000 58#define INTEGRATOR_SSRAM_BASE 0x00000000
@@ -61,7 +67,6 @@
61 67
62/* 68/*
63 * SDRAM is a SIMM therefore the size is not known. 69 * SDRAM is a SIMM therefore the size is not known.
64 *
65 */ 70 */
66#define INTEGRATOR_SDRAM_BASE 0x00040000 71#define INTEGRATOR_SDRAM_BASE 0x00040000
67 72
@@ -81,10 +86,8 @@
81#define INTEGRATOR_LOGIC_MODULE2_BASE 0xE0000000 86#define INTEGRATOR_LOGIC_MODULE2_BASE 0xE0000000
82#define INTEGRATOR_LOGIC_MODULE3_BASE 0xF0000000 87#define INTEGRATOR_LOGIC_MODULE3_BASE 0xF0000000
83 88
84/* ------------------------------------------------------------------------ 89/*
85 * Integrator header card registers 90 * Integrator header card registers
86 * ------------------------------------------------------------------------
87 *
88 */ 91 */
89#define INTEGRATOR_HDR_ID_OFFSET 0x00 92#define INTEGRATOR_HDR_ID_OFFSET 0x00
90#define INTEGRATOR_HDR_PROC_OFFSET 0x04 93#define INTEGRATOR_HDR_PROC_OFFSET 0x04
@@ -173,16 +176,12 @@
173 176
174#define INTEGRATOR_HDR_SDRAM_SPD_OK (1 << 5) 177#define INTEGRATOR_HDR_SDRAM_SPD_OK (1 << 5)
175 178
176 179/*
177/* ------------------------------------------------------------------------ 180 * Integrator system registers
178 * Integrator system registers
179 * ------------------------------------------------------------------------
180 *
181 */ 181 */
182 182
183/* 183/*
184 * System Controller 184 * System Controller
185 *
186 */ 185 */
187#define INTEGRATOR_SC_ID_OFFSET 0x00 186#define INTEGRATOR_SC_ID_OFFSET 0x00
188#define INTEGRATOR_SC_OSC_OFFSET 0x04 187#define INTEGRATOR_SC_OSC_OFFSET 0x04
@@ -223,7 +222,6 @@
223 222
224/* 223/*
225 * External Bus Interface 224 * External Bus Interface
226 *
227 */ 225 */
228#define INTEGRATOR_EBI_BASE 0x12000000 226#define INTEGRATOR_EBI_BASE 0x12000000
229 227
@@ -272,7 +270,6 @@
272 270
273/* 271/*
274 * LED's & Switches 272 * LED's & Switches
275 *
276 */ 273 */
277#define INTEGRATOR_DBG_ALPHA_OFFSET 0x00 274#define INTEGRATOR_DBG_ALPHA_OFFSET 0x00
278#define INTEGRATOR_DBG_LEDS_OFFSET 0x04 275#define INTEGRATOR_DBG_LEDS_OFFSET 0x04
@@ -292,32 +289,25 @@
292#define INTEGRATOR_CP_SIC_BASE 0xCA000000 /* SIC */ 289#define INTEGRATOR_CP_SIC_BASE 0xCA000000 /* SIC */
293#define INTEGRATOR_CP_CTL_BASE 0xCB000000 /* CP system control */ 290#define INTEGRATOR_CP_CTL_BASE 0xCB000000 /* CP system control */
294 291
295/* ------------------------------------------------------------------------
296 * KMI keyboard/mouse definitions
297 * ------------------------------------------------------------------------
298 */
299/* PS2 Keyboard interface */ 292/* PS2 Keyboard interface */
300#define KMI0_BASE INTEGRATOR_KBD_BASE 293#define KMI0_BASE INTEGRATOR_KBD_BASE
301 294
302/* PS2 Mouse interface */ 295/* PS2 Mouse interface */
303#define KMI1_BASE INTEGRATOR_MOUSE_BASE 296#define KMI1_BASE INTEGRATOR_MOUSE_BASE
304 297
305/* KMI definitions are now in include/asm-arm/hardware/amba_kmi.h -- rmk */ 298/*
306 299 * Integrator Interrupt Controllers
307/* ------------------------------------------------------------------------
308 * Integrator Interrupt Controllers
309 * ------------------------------------------------------------------------
310 * 300 *
311 * Offsets from interrupt controller base
312 * 301 *
313 * System Controller interrupt controller base is 302 * Offsets from interrupt controller base
303 *
304 * System Controller interrupt controller base is
314 * 305 *
315 * INTEGRATOR_IC_BASE + (header_number << 6) 306 * INTEGRATOR_IC_BASE + (header_number << 6)
316 * 307 *
317 * Core Module interrupt controller base is 308 * Core Module interrupt controller base is
318 * 309 *
319 * INTEGRATOR_HDR_IC 310 * INTEGRATOR_HDR_IC
320 *
321 */ 311 */
322#define IRQ_STATUS 0 312#define IRQ_STATUS 0
323#define IRQ_RAW_STATUS 0x04 313#define IRQ_RAW_STATUS 0x04
@@ -335,25 +325,8 @@
335#define FIQ_ENABLE_CLEAR 0x2C 325#define FIQ_ENABLE_CLEAR 0x2C
336 326
337 327
338/* ------------------------------------------------------------------------ 328/*
339 * Interrupts 329 * LED's
340 * ------------------------------------------------------------------------
341 *
342 *
343 * Each Core Module has two interrupts controllers, one on the core module
344 * itself and one in the system controller on the motherboard. The
345 * READ_INT macro in target.s reads both interrupt controllers and returns
346 * a 32 bit bitmask, bits 0 to 23 are interrupts from the system controller
347 * and bits 24 to 31 are from the core module.
348 *
349 * The following definitions relate to the bitmask returned by READ_INT.
350 *
351 */
352
353/* ------------------------------------------------------------------------
354 * LED's
355 * ------------------------------------------------------------------------
356 *
357 */ 330 */
358#define GREEN_LED 0x01 331#define GREEN_LED 0x01
359#define YELLOW_LED 0x02 332#define YELLOW_LED 0x02
@@ -371,7 +344,6 @@
371 * 344 *
372 * Timer 0 runs at bus frequency 345 * Timer 0 runs at bus frequency
373 */ 346 */
374
375#define INTEGRATOR_TIMER0_BASE INTEGRATOR_CT_BASE 347#define INTEGRATOR_TIMER0_BASE INTEGRATOR_CT_BASE
376#define INTEGRATOR_TIMER1_BASE (INTEGRATOR_CT_BASE + 0x100) 348#define INTEGRATOR_TIMER1_BASE (INTEGRATOR_CT_BASE + 0x100)
377#define INTEGRATOR_TIMER2_BASE (INTEGRATOR_CT_BASE + 0x200) 349#define INTEGRATOR_TIMER2_BASE (INTEGRATOR_CT_BASE + 0x200)
@@ -379,4 +351,4 @@
379#define INTEGRATOR_CSR_BASE 0x10000000 351#define INTEGRATOR_CSR_BASE 0x10000000
380#define INTEGRATOR_CSR_SIZE 0x10000000 352#define INTEGRATOR_CSR_SIZE 0x10000000
381 353
382#endif 354#endif /* INTEGRATOR_HARDWARE_H */
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c
index 9f82f9dcbb98..0e870ea818c4 100644
--- a/arch/arm/mach-integrator/impd1.c
+++ b/arch/arm/mach-integrator/impd1.c
@@ -23,10 +23,11 @@
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/platform_data/clk-integrator.h> 24#include <linux/platform_data/clk-integrator.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/irqchip/arm-vic.h>
26 27
27#include <mach/lm.h>
28#include <mach/impd1.h>
29#include <asm/sizes.h> 28#include <asm/sizes.h>
29#include "lm.h"
30#include "impd1.h"
30 31
31static int module_id; 32static int module_id;
32 33
@@ -35,6 +36,7 @@ MODULE_PARM_DESC(lmid, "logic module stack position");
35 36
36struct impd1_module { 37struct impd1_module {
37 void __iomem *base; 38 void __iomem *base;
39 void __iomem *vic_base;
38}; 40};
39 41
40void impd1_tweak_control(struct device *dev, u32 mask, u32 val) 42void impd1_tweak_control(struct device *dev, u32 mask, u32 val)
@@ -262,9 +264,6 @@ struct impd1_device {
262 264
263static struct impd1_device impd1_devs[] = { 265static struct impd1_device impd1_devs[] = {
264 { 266 {
265 .offset = 0x03000000,
266 .id = 0x00041190,
267 }, {
268 .offset = 0x00100000, 267 .offset = 0x00100000,
269 .irq = { 1 }, 268 .irq = { 1 },
270 .id = 0x00141011, 269 .id = 0x00141011,
@@ -304,46 +303,72 @@ static struct impd1_device impd1_devs[] = {
304 } 303 }
305}; 304};
306 305
307static int impd1_probe(struct lm_device *dev) 306/*
307 * Valid IRQs: 0 thru 9 and 11, 10 unused.
308 */
309#define IMPD1_VALID_IRQS 0x00000bffU
310
311static int __init impd1_probe(struct lm_device *dev)
308{ 312{
309 struct impd1_module *impd1; 313 struct impd1_module *impd1;
310 int i, ret; 314 int irq_base;
315 int i;
311 316
312 if (dev->id != module_id) 317 if (dev->id != module_id)
313 return -EINVAL; 318 return -EINVAL;
314 319
315 if (!request_mem_region(dev->resource.start, SZ_4K, "LM registers")) 320 if (!devm_request_mem_region(&dev->dev, dev->resource.start,
321 SZ_4K, "LM registers"))
316 return -EBUSY; 322 return -EBUSY;
317 323
318 impd1 = kzalloc(sizeof(struct impd1_module), GFP_KERNEL); 324 impd1 = devm_kzalloc(&dev->dev, sizeof(struct impd1_module),
319 if (!impd1) { 325 GFP_KERNEL);
320 ret = -ENOMEM; 326 if (!impd1)
321 goto release_lm; 327 return -ENOMEM;
322 }
323 328
324 impd1->base = ioremap(dev->resource.start, SZ_4K); 329 impd1->base = devm_ioremap(&dev->dev, dev->resource.start, SZ_4K);
325 if (!impd1->base) { 330 if (!impd1->base)
326 ret = -ENOMEM; 331 return -ENOMEM;
327 goto free_impd1;
328 }
329 332
330 lm_set_drvdata(dev, impd1); 333 integrator_impd1_clk_init(impd1->base, dev->id);
331 334
332 printk("IM-PD1 found at 0x%08lx\n", 335 if (!devm_request_mem_region(&dev->dev,
333 (unsigned long)dev->resource.start); 336 dev->resource.start + 0x03000000,
337 SZ_4K, "VIC"))
338 return -EBUSY;
334 339
335 integrator_impd1_clk_init(impd1->base, dev->id); 340 impd1->vic_base = devm_ioremap(&dev->dev,
341 dev->resource.start + 0x03000000,
342 SZ_4K);
343 if (!impd1->vic_base)
344 return -ENOMEM;
345
346 irq_base = vic_init_cascaded(impd1->vic_base, dev->irq,
347 IMPD1_VALID_IRQS, 0);
348
349 lm_set_drvdata(dev, impd1);
350
351 dev_info(&dev->dev, "IM-PD1 found at 0x%08lx\n",
352 (unsigned long)dev->resource.start);
336 353
337 for (i = 0; i < ARRAY_SIZE(impd1_devs); i++) { 354 for (i = 0; i < ARRAY_SIZE(impd1_devs); i++) {
338 struct impd1_device *idev = impd1_devs + i; 355 struct impd1_device *idev = impd1_devs + i;
339 struct amba_device *d; 356 struct amba_device *d;
340 unsigned long pc_base; 357 unsigned long pc_base;
341 char devname[32]; 358 char devname[32];
359 int irq1 = idev->irq[0];
360 int irq2 = idev->irq[1];
361
362 /* Translate IRQs to IM-PD1 local numberspace */
363 if (irq1)
364 irq1 += irq_base;
365 if (irq2)
366 irq2 += irq_base;
342 367
343 pc_base = dev->resource.start + idev->offset; 368 pc_base = dev->resource.start + idev->offset;
344 snprintf(devname, 32, "lm%x:%5.5lx", dev->id, idev->offset >> 12); 369 snprintf(devname, 32, "lm%x:%5.5lx", dev->id, idev->offset >> 12);
345 d = amba_ahb_device_add_res(&dev->dev, devname, pc_base, SZ_4K, 370 d = amba_ahb_device_add_res(&dev->dev, devname, pc_base, SZ_4K,
346 dev->irq, dev->irq, 371 irq1, irq2,
347 idev->platform_data, idev->id, 372 idev->platform_data, idev->id,
348 &dev->resource); 373 &dev->resource);
349 if (IS_ERR(d)) { 374 if (IS_ERR(d)) {
@@ -353,14 +378,6 @@ static int impd1_probe(struct lm_device *dev)
353 } 378 }
354 379
355 return 0; 380 return 0;
356
357 free_impd1:
358 if (impd1 && impd1->base)
359 iounmap(impd1->base);
360 kfree(impd1);
361 release_lm:
362 release_mem_region(dev->resource.start, SZ_4K);
363 return ret;
364} 381}
365 382
366static int impd1_remove_one(struct device *dev, void *data) 383static int impd1_remove_one(struct device *dev, void *data)
@@ -371,16 +388,10 @@ static int impd1_remove_one(struct device *dev, void *data)
371 388
372static void impd1_remove(struct lm_device *dev) 389static void impd1_remove(struct lm_device *dev)
373{ 390{
374 struct impd1_module *impd1 = lm_get_drvdata(dev);
375
376 device_for_each_child(&dev->dev, NULL, impd1_remove_one); 391 device_for_each_child(&dev->dev, NULL, impd1_remove_one);
377 integrator_impd1_clk_exit(dev->id); 392 integrator_impd1_clk_exit(dev->id);
378 393
379 lm_set_drvdata(dev, NULL); 394 lm_set_drvdata(dev, NULL);
380
381 iounmap(impd1->base);
382 kfree(impd1);
383 release_mem_region(dev->resource.start, SZ_4K);
384} 395}
385 396
386static struct lm_driver impd1_driver = { 397static struct lm_driver impd1_driver = {
diff --git a/arch/arm/mach-integrator/include/mach/impd1.h b/arch/arm/mach-integrator/impd1.h
index d75de4b14237..76de4dc9bee4 100644
--- a/arch/arm/mach-integrator/include/mach/impd1.h
+++ b/arch/arm/mach-integrator/impd1.h
@@ -1,6 +1,3 @@
1#define IMPD1_OSC1 0x00
2#define IMPD1_OSC2 0x04
3#define IMPD1_LOCK 0x08
4#define IMPD1_LEDS 0x0c 1#define IMPD1_LEDS 0x0c
5#define IMPD1_INT 0x10 2#define IMPD1_INT 0x10
6#define IMPD1_SW 0x14 3#define IMPD1_SW 0x14
@@ -15,4 +12,3 @@
15struct device; 12struct device;
16 13
17void impd1_tweak_control(struct device *dev, u32 mask, u32 val); 14void impd1_tweak_control(struct device *dev, u32 mask, u32 val);
18
diff --git a/arch/arm/mach-integrator/include/mach/hardware.h b/arch/arm/mach-integrator/include/mach/hardware.h
deleted file mode 100644
index 65fed7c0eb84..000000000000
--- a/arch/arm/mach-integrator/include/mach/hardware.h
+++ /dev/null
@@ -1,45 +0,0 @@
1/*
2 * arch/arm/mach-integrator/include/mach/hardware.h
3 *
4 * This file contains the hardware definitions of the Integrator.
5 *
6 * Copyright (C) 1999 ARM Limited.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22#ifndef __ASM_ARCH_HARDWARE_H
23#define __ASM_ARCH_HARDWARE_H
24
25#include <asm/sizes.h>
26
27/*
28 * Where in virtual memory the IO devices (timers, system controllers
29 * and so on)
30 */
31#define IO_BASE 0xF0000000 // VA of IO
32#define IO_SIZE 0x0B000000 // How much?
33#define IO_START INTEGRATOR_HDR_BASE // PA of IO
34
35/* macro to get at IO space when running virtually */
36#ifdef CONFIG_MMU
37#define IO_ADDRESS(x) (((x) & 0x000fffff) | (((x) >> 4) & 0x0ff00000) | IO_BASE)
38#else
39#define IO_ADDRESS(x) (x)
40#endif
41
42#define __io_address(n) ((void __iomem *)IO_ADDRESS(n))
43
44#endif
45
diff --git a/arch/arm/mach-integrator/include/mach/timex.h b/arch/arm/mach-integrator/include/mach/timex.h
deleted file mode 100644
index 1dcb42028c82..000000000000
--- a/arch/arm/mach-integrator/include/mach/timex.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * arch/arm/mach-integrator/include/mach/timex.h
3 *
4 * Integrator architecture timex specifications
5 *
6 * Copyright (C) 1999 ARM Limited
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23/*
24 * ??
25 */
26#define CLOCK_TICK_RATE (50000000 / 16)
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index 17c0fe627435..dd0cc677d596 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -42,24 +42,23 @@
42#include <linux/sys_soc.h> 42#include <linux/sys_soc.h>
43#include <linux/termios.h> 43#include <linux/termios.h>
44#include <linux/sched_clock.h> 44#include <linux/sched_clock.h>
45#include <linux/clk-provider.h>
45 46
46#include <mach/hardware.h>
47#include <mach/platform.h>
48#include <asm/hardware/arm_timer.h> 47#include <asm/hardware/arm_timer.h>
49#include <asm/setup.h> 48#include <asm/setup.h>
50#include <asm/param.h> /* HZ */ 49#include <asm/param.h> /* HZ */
51#include <asm/mach-types.h> 50#include <asm/mach-types.h>
52 51
53#include <mach/lm.h>
54
55#include <asm/mach/arch.h> 52#include <asm/mach/arch.h>
56#include <asm/mach/irq.h> 53#include <asm/mach/irq.h>
57#include <asm/mach/map.h> 54#include <asm/mach/map.h>
58#include <asm/mach/time.h> 55#include <asm/mach/time.h>
59 56
57#include "hardware.h"
60#include "cm.h" 58#include "cm.h"
61#include "common.h" 59#include "common.h"
62#include "pci_v3.h" 60#include "pci_v3.h"
61#include "lm.h"
63 62
64/* Base address to the AP system controller */ 63/* Base address to the AP system controller */
65void __iomem *ap_syscon_base; 64void __iomem *ap_syscon_base;
@@ -358,7 +357,7 @@ static struct clock_event_device integrator_clockevent = {
358 357
359static struct irqaction integrator_timer_irq = { 358static struct irqaction integrator_timer_irq = {
360 .name = "timer", 359 .name = "timer",
361 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 360 .flags = IRQF_TIMER | IRQF_IRQPOLL,
362 .handler = integrator_timer_interrupt, 361 .handler = integrator_timer_interrupt,
363 .dev_id = &integrator_clockevent, 362 .dev_id = &integrator_clockevent,
364}; 363};
@@ -402,10 +401,7 @@ static void __init ap_of_timer_init(void)
402 struct clk *clk; 401 struct clk *clk;
403 unsigned long rate; 402 unsigned long rate;
404 403
405 clk = clk_get_sys("ap_timer", NULL); 404 of_clk_init(NULL);
406 BUG_ON(IS_ERR(clk));
407 clk_prepare_enable(clk);
408 rate = clk_get_rate(clk);
409 405
410 err = of_property_read_string(of_aliases, 406 err = of_property_read_string(of_aliases,
411 "arm,timer-primary", &path); 407 "arm,timer-primary", &path);
@@ -415,6 +411,12 @@ static void __init ap_of_timer_init(void)
415 base = of_iomap(node, 0); 411 base = of_iomap(node, 0);
416 if (WARN_ON(!base)) 412 if (WARN_ON(!base))
417 return; 413 return;
414
415 clk = of_clk_get(node, 0);
416 BUG_ON(IS_ERR(clk));
417 clk_prepare_enable(clk);
418 rate = clk_get_rate(clk);
419
418 writel(0, base + TIMER_CTRL); 420 writel(0, base + TIMER_CTRL);
419 integrator_clocksource_init(rate, base); 421 integrator_clocksource_init(rate, base);
420 422
@@ -427,6 +429,12 @@ static void __init ap_of_timer_init(void)
427 if (WARN_ON(!base)) 429 if (WARN_ON(!base))
428 return; 430 return;
429 irq = irq_of_parse_and_map(node, 0); 431 irq = irq_of_parse_and_map(node, 0);
432
433 clk = of_clk_get(node, 0);
434 BUG_ON(IS_ERR(clk));
435 clk_prepare_enable(clk);
436 rate = clk_get_rate(clk);
437
430 writel(0, base + TIMER_CTRL); 438 writel(0, base + TIMER_CTRL);
431 integrator_clockevent_init(rate, base, irq); 439 integrator_clockevent_init(rate, base, irq);
432} 440}
@@ -440,7 +448,6 @@ static void __init ap_init_irq_of(void)
440{ 448{
441 cm_init(); 449 cm_init();
442 of_irq_init(fpga_irq_of_match); 450 of_irq_init(fpga_irq_of_match);
443 integrator_clk_init(false);
444} 451}
445 452
446/* For the Device Tree, add in the UART callbacks as AUXDATA */ 453/* For the Device Tree, add in the UART callbacks as AUXDATA */
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index a3ef961e4a93..a938242b0c95 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -23,31 +23,22 @@
23#include <linux/irqchip/versatile-fpga.h> 23#include <linux/irqchip/versatile-fpga.h>
24#include <linux/gfp.h> 24#include <linux/gfp.h>
25#include <linux/mtd/physmap.h> 25#include <linux/mtd/physmap.h>
26#include <linux/platform_data/clk-integrator.h>
27#include <linux/of_irq.h> 26#include <linux/of_irq.h>
28#include <linux/of_address.h> 27#include <linux/of_address.h>
29#include <linux/of_platform.h> 28#include <linux/of_platform.h>
30#include <linux/sys_soc.h> 29#include <linux/sys_soc.h>
30#include <linux/sched_clock.h>
31 31
32#include <mach/hardware.h>
33#include <mach/platform.h>
34#include <asm/setup.h> 32#include <asm/setup.h>
35#include <asm/mach-types.h> 33#include <asm/mach-types.h>
36#include <asm/hardware/arm_timer.h>
37#include <asm/hardware/icst.h>
38
39#include <mach/lm.h>
40
41#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
42#include <asm/mach/irq.h> 35#include <asm/mach/irq.h>
43#include <asm/mach/map.h> 36#include <asm/mach/map.h>
44#include <asm/mach/time.h> 37#include <asm/mach/time.h>
45 38
46#include <asm/hardware/timer-sp.h>
47
48#include <plat/clcd.h> 39#include <plat/clcd.h>
49#include <plat/sched_clock.h>
50 40
41#include "hardware.h"
51#include "cm.h" 42#include "cm.h"
52#include "common.h" 43#include "common.h"
53 44
@@ -234,11 +225,14 @@ static struct clcd_board clcd_data = {
234 225
235#define REFCOUNTER (__io_address(INTEGRATOR_HDR_BASE) + 0x28) 226#define REFCOUNTER (__io_address(INTEGRATOR_HDR_BASE) + 0x28)
236 227
228static u64 notrace intcp_read_sched_clock(void)
229{
230 return readl(REFCOUNTER);
231}
232
237static void __init intcp_init_early(void) 233static void __init intcp_init_early(void)
238{ 234{
239#ifdef CONFIG_PLAT_VERSATILE_SCHED_CLOCK 235 sched_clock_register(intcp_read_sched_clock, 32, 24000000);
240 versatile_sched_clock_init(REFCOUNTER, 24000000);
241#endif
242} 236}
243 237
244static const struct of_device_id fpga_irq_of_match[] __initconst = { 238static const struct of_device_id fpga_irq_of_match[] __initconst = {
@@ -250,7 +244,6 @@ static void __init intcp_init_irq_of(void)
250{ 244{
251 cm_init(); 245 cm_init();
252 of_irq_init(fpga_irq_of_match); 246 of_irq_init(fpga_irq_of_match);
253 integrator_clk_init(true);
254} 247}
255 248
256/* 249/*
diff --git a/arch/arm/mach-integrator/leds.c b/arch/arm/mach-integrator/leds.c
index cb6ac58f5e07..f1dcb57a59e2 100644
--- a/arch/arm/mach-integrator/leds.c
+++ b/arch/arm/mach-integrator/leds.c
@@ -11,9 +11,7 @@
11#include <linux/slab.h> 11#include <linux/slab.h>
12#include <linux/leds.h> 12#include <linux/leds.h>
13 13
14#include <mach/hardware.h> 14#include "hardware.h"
15#include <mach/platform.h>
16
17#include "cm.h" 15#include "cm.h"
18 16
19#if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS) 17#if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS)
diff --git a/arch/arm/mach-integrator/lm.c b/arch/arm/mach-integrator/lm.c
index f52c7af31eaa..3f9e9f043168 100644
--- a/arch/arm/mach-integrator/lm.c
+++ b/arch/arm/mach-integrator/lm.c
@@ -12,7 +12,7 @@
12#include <linux/device.h> 12#include <linux/device.h>
13#include <linux/slab.h> 13#include <linux/slab.h>
14 14
15#include <mach/lm.h> 15#include "lm.h"
16 16
17#define to_lm_device(d) container_of(d, struct lm_device, dev) 17#define to_lm_device(d) container_of(d, struct lm_device, dev)
18#define to_lm_driver(d) container_of(d, struct lm_driver, drv) 18#define to_lm_driver(d) container_of(d, struct lm_driver, drv)
diff --git a/arch/arm/mach-integrator/include/mach/lm.h b/arch/arm/mach-integrator/lm.h
index 28186b6f2c09..28186b6f2c09 100644
--- a/arch/arm/mach-integrator/include/mach/lm.h
+++ b/arch/arm/mach-integrator/lm.h
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c
index c5e01b24d9fb..05e1f73a1e8d 100644
--- a/arch/arm/mach-integrator/pci_v3.c
+++ b/arch/arm/mach-integrator/pci_v3.c
@@ -34,15 +34,13 @@
34#include <linux/of_pci.h> 34#include <linux/of_pci.h>
35#include <video/vga.h> 35#include <video/vga.h>
36 36
37#include <mach/hardware.h>
38#include <mach/platform.h>
39
40#include <asm/mach/map.h> 37#include <asm/mach/map.h>
41#include <asm/signal.h> 38#include <asm/signal.h>
42#include <asm/mach/pci.h> 39#include <asm/mach/pci.h>
43#include <asm/irq_regs.h> 40#include <asm/irq_regs.h>
44 41
45#include "pci_v3.h" 42#include "pci_v3.h"
43#include "hardware.h"
46 44
47/* 45/*
48 * Where in the memory map does PCI live? 46 * Where in the memory map does PCI live?
diff --git a/arch/arm/mach-iop13xx/include/mach/timex.h b/arch/arm/mach-iop13xx/include/mach/timex.h
deleted file mode 100644
index 45fb2745bb54..000000000000
--- a/arch/arm/mach-iop13xx/include/mach/timex.h
+++ /dev/null
@@ -1 +0,0 @@
1#define CLOCK_TICK_RATE (100 * HZ)
diff --git a/arch/arm/mach-iop32x/include/mach/timex.h b/arch/arm/mach-iop32x/include/mach/timex.h
deleted file mode 100644
index 7262ab81419d..000000000000
--- a/arch/arm/mach-iop32x/include/mach/timex.h
+++ /dev/null
@@ -1,6 +0,0 @@
1/*
2 * arch/arm/mach-iop32x/include/mach/timex.h
3 *
4 * IOP32x architecture timex specifications
5 */
6#define CLOCK_TICK_RATE (100 * HZ)
diff --git a/arch/arm/mach-iop33x/include/mach/timex.h b/arch/arm/mach-iop33x/include/mach/timex.h
deleted file mode 100644
index 54c589091d6e..000000000000
--- a/arch/arm/mach-iop33x/include/mach/timex.h
+++ /dev/null
@@ -1,6 +0,0 @@
1/*
2 * arch/arm/mach-iop33x/include/mach/timex.h
3 *
4 * IOP3xx architecture timex specifications
5 */
6#define CLOCK_TICK_RATE (100 * HZ)
diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c
index 200970d56f6d..4977296f0c78 100644
--- a/arch/arm/mach-ixp4xx/common-pci.c
+++ b/arch/arm/mach-ixp4xx/common-pci.c
@@ -315,33 +315,6 @@ static int abort_handler(unsigned long addr, unsigned int fsr, struct pt_regs *r
315 return 0; 315 return 0;
316} 316}
317 317
318
319static int ixp4xx_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
320{
321 return (dma_addr + size) >= SZ_64M;
322}
323
324/*
325 * Setup DMA mask to 64MB on PCI devices. Ignore all other devices.
326 */
327static int ixp4xx_pci_platform_notify(struct device *dev)
328{
329 if (dev_is_pci(dev)) {
330 *dev->dma_mask = SZ_64M - 1;
331 dev->coherent_dma_mask = SZ_64M - 1;
332 dmabounce_register_dev(dev, 2048, 4096, ixp4xx_needs_bounce);
333 }
334 return 0;
335}
336
337static int ixp4xx_pci_platform_notify_remove(struct device *dev)
338{
339 if (dev_is_pci(dev))
340 dmabounce_unregister_dev(dev);
341
342 return 0;
343}
344
345void __init ixp4xx_pci_preinit(void) 318void __init ixp4xx_pci_preinit(void)
346{ 319{
347 unsigned long cpuid = read_cpuid_id(); 320 unsigned long cpuid = read_cpuid_id();
@@ -475,20 +448,8 @@ int ixp4xx_setup(int nr, struct pci_sys_data *sys)
475 pci_add_resource_offset(&sys->resources, &res[0], sys->io_offset); 448 pci_add_resource_offset(&sys->resources, &res[0], sys->io_offset);
476 pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset); 449 pci_add_resource_offset(&sys->resources, &res[1], sys->mem_offset);
477 450
478 platform_notify = ixp4xx_pci_platform_notify;
479 platform_notify_remove = ixp4xx_pci_platform_notify_remove;
480
481 return 1; 451 return 1;
482} 452}
483 453
484int dma_set_coherent_mask(struct device *dev, u64 mask)
485{
486 if (mask >= SZ_64M - 1)
487 return 0;
488
489 return -EIO;
490}
491
492EXPORT_SYMBOL(ixp4xx_pci_read); 454EXPORT_SYMBOL(ixp4xx_pci_read);
493EXPORT_SYMBOL(ixp4xx_pci_write); 455EXPORT_SYMBOL(ixp4xx_pci_write);
494EXPORT_SYMBOL(dma_set_coherent_mask);
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 6d68aed6548a..fc4b7b24265e 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -23,15 +23,14 @@
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/bitops.h> 24#include <linux/bitops.h>
25#include <linux/time.h> 25#include <linux/time.h>
26#include <linux/timex.h>
27#include <linux/clocksource.h> 26#include <linux/clocksource.h>
28#include <linux/clockchips.h> 27#include <linux/clockchips.h>
29#include <linux/io.h> 28#include <linux/io.h>
30#include <linux/export.h> 29#include <linux/export.h>
31#include <linux/gpio.h> 30#include <linux/gpio.h>
32#include <linux/cpu.h> 31#include <linux/cpu.h>
32#include <linux/pci.h>
33#include <linux/sched_clock.h> 33#include <linux/sched_clock.h>
34
35#include <mach/udc.h> 34#include <mach/udc.h>
36#include <mach/hardware.h> 35#include <mach/hardware.h>
37#include <mach/io.h> 36#include <mach/io.h>
@@ -40,11 +39,21 @@
40#include <asm/page.h> 39#include <asm/page.h>
41#include <asm/irq.h> 40#include <asm/irq.h>
42#include <asm/system_misc.h> 41#include <asm/system_misc.h>
43
44#include <asm/mach/map.h> 42#include <asm/mach/map.h>
45#include <asm/mach/irq.h> 43#include <asm/mach/irq.h>
46#include <asm/mach/time.h> 44#include <asm/mach/time.h>
47 45
46#define IXP4XX_TIMER_FREQ 66666000
47
48/*
49 * The timer register doesn't allow to specify the two least significant bits of
50 * the timeout value and assumes them being zero. So make sure IXP4XX_LATCH is
51 * the best value with the two least significant bits unset.
52 */
53#define IXP4XX_LATCH DIV_ROUND_CLOSEST(IXP4XX_TIMER_FREQ, \
54 (IXP4XX_OST_RELOAD_MASK + 1) * HZ) * \
55 (IXP4XX_OST_RELOAD_MASK + 1)
56
48static void __init ixp4xx_clocksource_init(void); 57static void __init ixp4xx_clocksource_init(void);
49static void __init ixp4xx_clockevent_init(void); 58static void __init ixp4xx_clockevent_init(void);
50static struct clock_event_device clockevent_ixp4xx; 59static struct clock_event_device clockevent_ixp4xx;
@@ -312,7 +321,7 @@ static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id)
312 321
313static struct irqaction ixp4xx_timer_irq = { 322static struct irqaction ixp4xx_timer_irq = {
314 .name = "timer1", 323 .name = "timer1",
315 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 324 .flags = IRQF_TIMER | IRQF_IRQPOLL,
316 .handler = ixp4xx_timer_interrupt, 325 .handler = ixp4xx_timer_interrupt,
317 .dev_id = &clockevent_ixp4xx, 326 .dev_id = &clockevent_ixp4xx,
318}; 327};
@@ -520,7 +529,7 @@ static void ixp4xx_set_mode(enum clock_event_mode mode,
520 529
521 switch (mode) { 530 switch (mode) {
522 case CLOCK_EVT_MODE_PERIODIC: 531 case CLOCK_EVT_MODE_PERIODIC:
523 osrt = LATCH & ~IXP4XX_OST_RELOAD_MASK; 532 osrt = IXP4XX_LATCH & ~IXP4XX_OST_RELOAD_MASK;
524 opts = IXP4XX_OST_ENABLE; 533 opts = IXP4XX_OST_ENABLE;
525 break; 534 break;
526 case CLOCK_EVT_MODE_ONESHOT: 535 case CLOCK_EVT_MODE_ONESHOT:
@@ -578,6 +587,54 @@ void ixp4xx_restart(enum reboot_mode mode, const char *cmd)
578 } 587 }
579} 588}
580 589
590#ifdef CONFIG_PCI
591static int ixp4xx_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
592{
593 return (dma_addr + size) > SZ_64M;
594}
595
596static int ixp4xx_platform_notify_remove(struct device *dev)
597{
598 if (dev_is_pci(dev))
599 dmabounce_unregister_dev(dev);
600
601 return 0;
602}
603#endif
604
605/*
606 * Setup DMA mask to 64MB on PCI devices and 4 GB on all other things.
607 */
608static int ixp4xx_platform_notify(struct device *dev)
609{
610 dev->dma_mask = &dev->coherent_dma_mask;
611
612#ifdef CONFIG_PCI
613 if (dev_is_pci(dev)) {
614 dev->coherent_dma_mask = DMA_BIT_MASK(28); /* 64 MB */
615 dmabounce_register_dev(dev, 2048, 4096, ixp4xx_needs_bounce);
616 return 0;
617 }
618#endif
619
620 dev->coherent_dma_mask = DMA_BIT_MASK(32);
621 return 0;
622}
623
624int dma_set_coherent_mask(struct device *dev, u64 mask)
625{
626 if (dev_is_pci(dev))
627 mask &= DMA_BIT_MASK(28); /* 64 MB */
628
629 if ((mask & DMA_BIT_MASK(28)) == DMA_BIT_MASK(28)) {
630 dev->coherent_dma_mask = mask;
631 return 0;
632 }
633
634 return -EIO; /* device wanted sub-64MB mask */
635}
636EXPORT_SYMBOL(dma_set_coherent_mask);
637
581#ifdef CONFIG_IXP4XX_INDIRECT_PCI 638#ifdef CONFIG_IXP4XX_INDIRECT_PCI
582/* 639/*
583 * In the case of using indirect PCI, we simply return the actual PCI 640 * In the case of using indirect PCI, we simply return the actual PCI
@@ -600,12 +657,16 @@ static void ixp4xx_iounmap(void __iomem *addr)
600 if (!is_pci_memory((__force u32)addr)) 657 if (!is_pci_memory((__force u32)addr))
601 __iounmap(addr); 658 __iounmap(addr);
602} 659}
660#endif
603 661
604void __init ixp4xx_init_early(void) 662void __init ixp4xx_init_early(void)
605{ 663{
664 platform_notify = ixp4xx_platform_notify;
665#ifdef CONFIG_PCI
666 platform_notify_remove = ixp4xx_platform_notify_remove;
667#endif
668#ifdef CONFIG_IXP4XX_INDIRECT_PCI
606 arch_ioremap_caller = ixp4xx_ioremap_caller; 669 arch_ioremap_caller = ixp4xx_ioremap_caller;
607 arch_iounmap = ixp4xx_iounmap; 670 arch_iounmap = ixp4xx_iounmap;
608}
609#else
610void __init ixp4xx_init_early(void) {}
611#endif 671#endif
672}
diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c b/arch/arm/mach-ixp4xx/dsmg600-setup.c
index 736dc692d540..43ee06d3abe5 100644
--- a/arch/arm/mach-ixp4xx/dsmg600-setup.c
+++ b/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -233,8 +233,7 @@ static int __init dsmg600_gpio_init(void)
233 233
234 gpio_request(DSMG600_RB_GPIO, "reset button"); 234 gpio_request(DSMG600_RB_GPIO, "reset button");
235 if (request_irq(gpio_to_irq(DSMG600_RB_GPIO), &dsmg600_reset_handler, 235 if (request_irq(gpio_to_irq(DSMG600_RB_GPIO), &dsmg600_reset_handler,
236 IRQF_DISABLED | IRQF_TRIGGER_LOW, 236 IRQF_TRIGGER_LOW, "DSM-G600 reset button", NULL) < 0) {
237 "DSM-G600 reset button", NULL) < 0) {
238 237
239 printk(KERN_DEBUG "Reset Button IRQ %d not available\n", 238 printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
240 gpio_to_irq(DSMG600_RB_GPIO)); 239 gpio_to_irq(DSMG600_RB_GPIO));
diff --git a/arch/arm/mach-ixp4xx/fsg-setup.c b/arch/arm/mach-ixp4xx/fsg-setup.c
index 429966b756ed..5c4b0c4a1b37 100644
--- a/arch/arm/mach-ixp4xx/fsg-setup.c
+++ b/arch/arm/mach-ixp4xx/fsg-setup.c
@@ -208,16 +208,14 @@ static void __init fsg_init(void)
208 platform_add_devices(fsg_devices, ARRAY_SIZE(fsg_devices)); 208 platform_add_devices(fsg_devices, ARRAY_SIZE(fsg_devices));
209 209
210 if (request_irq(gpio_to_irq(FSG_RB_GPIO), &fsg_reset_handler, 210 if (request_irq(gpio_to_irq(FSG_RB_GPIO), &fsg_reset_handler,
211 IRQF_DISABLED | IRQF_TRIGGER_LOW, 211 IRQF_TRIGGER_LOW, "FSG reset button", NULL) < 0) {
212 "FSG reset button", NULL) < 0) {
213 212
214 printk(KERN_DEBUG "Reset Button IRQ %d not available\n", 213 printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
215 gpio_to_irq(FSG_RB_GPIO)); 214 gpio_to_irq(FSG_RB_GPIO));
216 } 215 }
217 216
218 if (request_irq(gpio_to_irq(FSG_SB_GPIO), &fsg_power_handler, 217 if (request_irq(gpio_to_irq(FSG_SB_GPIO), &fsg_power_handler,
219 IRQF_DISABLED | IRQF_TRIGGER_LOW, 218 IRQF_TRIGGER_LOW, "FSG power button", NULL) < 0) {
220 "FSG power button", NULL) < 0) {
221 219
222 printk(KERN_DEBUG "Power Button IRQ %d not available\n", 220 printk(KERN_DEBUG "Power Button IRQ %d not available\n",
223 gpio_to_irq(FSG_SB_GPIO)); 221 gpio_to_irq(FSG_SB_GPIO));
diff --git a/arch/arm/mach-ixp4xx/goramo_mlr.c b/arch/arm/mach-ixp4xx/goramo_mlr.c
index e54ff491c105..80bd9d6d04de 100644
--- a/arch/arm/mach-ixp4xx/goramo_mlr.c
+++ b/arch/arm/mach-ixp4xx/goramo_mlr.c
@@ -4,6 +4,7 @@
4 */ 4 */
5 5
6#include <linux/delay.h> 6#include <linux/delay.h>
7#include <linux/gpio.h>
7#include <linux/hdlc.h> 8#include <linux/hdlc.h>
8#include <linux/i2c-gpio.h> 9#include <linux/i2c-gpio.h>
9#include <linux/io.h> 10#include <linux/io.h>
@@ -79,19 +80,19 @@ static u8 control_value;
79 80
80static void set_scl(u8 value) 81static void set_scl(u8 value)
81{ 82{
82 gpio_line_set(GPIO_SCL, !!value); 83 gpio_set_value(GPIO_SCL, !!value);
83 udelay(3); 84 udelay(3);
84} 85}
85 86
86static void set_sda(u8 value) 87static void set_sda(u8 value)
87{ 88{
88 gpio_line_set(GPIO_SDA, !!value); 89 gpio_set_value(GPIO_SDA, !!value);
89 udelay(3); 90 udelay(3);
90} 91}
91 92
92static void set_str(u8 value) 93static void set_str(u8 value)
93{ 94{
94 gpio_line_set(GPIO_STR, !!value); 95 gpio_set_value(GPIO_STR, !!value);
95 udelay(3); 96 udelay(3);
96} 97}
97 98
@@ -108,8 +109,8 @@ static void output_control(void)
108{ 109{
109 int i; 110 int i;
110 111
111 gpio_line_config(GPIO_SCL, IXP4XX_GPIO_OUT); 112 gpio_direction_output(GPIO_SCL, 1);
112 gpio_line_config(GPIO_SDA, IXP4XX_GPIO_OUT); 113 gpio_direction_output(GPIO_SDA, 1);
113 114
114 for (i = 0; i < 8; i++) { 115 for (i = 0; i < 8; i++) {
115 set_scl(0); 116 set_scl(0);
@@ -151,8 +152,8 @@ static int hss_set_clock(int port, unsigned int clock_type)
151 152
152static irqreturn_t hss_dcd_irq(int irq, void *pdev) 153static irqreturn_t hss_dcd_irq(int irq, void *pdev)
153{ 154{
154 int i, port = (irq == IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N)); 155 int port = (irq == IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N));
155 gpio_line_get(port ? GPIO_HSS1_DCD_N : GPIO_HSS0_DCD_N, &i); 156 int i = gpio_get_value(port ? GPIO_HSS1_DCD_N : GPIO_HSS0_DCD_N);
156 set_carrier_cb_tab[port](pdev, !i); 157 set_carrier_cb_tab[port](pdev, !i);
157 return IRQ_HANDLED; 158 return IRQ_HANDLED;
158} 159}
@@ -168,7 +169,7 @@ static int hss_open(int port, void *pdev,
168 else 169 else
169 irq = IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N); 170 irq = IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N);
170 171
171 gpio_line_get(port ? GPIO_HSS1_DCD_N : GPIO_HSS0_DCD_N, &i); 172 i = gpio_get_value(port ? GPIO_HSS1_DCD_N : GPIO_HSS0_DCD_N);
172 set_carrier_cb(pdev, !i); 173 set_carrier_cb(pdev, !i);
173 174
174 set_carrier_cb_tab[!!port] = set_carrier_cb; 175 set_carrier_cb_tab[!!port] = set_carrier_cb;
@@ -181,7 +182,7 @@ static int hss_open(int port, void *pdev,
181 182
182 set_control(port ? CONTROL_HSS1_DTR_N : CONTROL_HSS0_DTR_N, 0); 183 set_control(port ? CONTROL_HSS1_DTR_N : CONTROL_HSS0_DTR_N, 0);
183 output_control(); 184 output_control();
184 gpio_line_set(port ? GPIO_HSS1_RTS_N : GPIO_HSS0_RTS_N, 0); 185 gpio_set_value(port ? GPIO_HSS1_RTS_N : GPIO_HSS0_RTS_N, 0);
185 return 0; 186 return 0;
186} 187}
187 188
@@ -193,7 +194,7 @@ static void hss_close(int port, void *pdev)
193 194
194 set_control(port ? CONTROL_HSS1_DTR_N : CONTROL_HSS0_DTR_N, 1); 195 set_control(port ? CONTROL_HSS1_DTR_N : CONTROL_HSS0_DTR_N, 1);
195 output_control(); 196 output_control();
196 gpio_line_set(port ? GPIO_HSS1_RTS_N : GPIO_HSS0_RTS_N, 1); 197 gpio_set_value(port ? GPIO_HSS1_RTS_N : GPIO_HSS0_RTS_N, 1);
197} 198}
198 199
199 200
@@ -413,13 +414,21 @@ static void __init gmlr_init(void)
413 if (hw_bits & CFG_HW_HAS_EEPROM) 414 if (hw_bits & CFG_HW_HAS_EEPROM)
414 device_tab[devices++] = &device_i2c; /* max index 6 */ 415 device_tab[devices++] = &device_i2c; /* max index 6 */
415 416
416 gpio_line_config(GPIO_SCL, IXP4XX_GPIO_OUT); 417 gpio_request(GPIO_SCL, "SCL/clock");
417 gpio_line_config(GPIO_SDA, IXP4XX_GPIO_OUT); 418 gpio_request(GPIO_SDA, "SDA/data");
418 gpio_line_config(GPIO_STR, IXP4XX_GPIO_OUT); 419 gpio_request(GPIO_STR, "strobe");
419 gpio_line_config(GPIO_HSS0_RTS_N, IXP4XX_GPIO_OUT); 420 gpio_request(GPIO_HSS0_RTS_N, "HSS0 RTS");
420 gpio_line_config(GPIO_HSS1_RTS_N, IXP4XX_GPIO_OUT); 421 gpio_request(GPIO_HSS1_RTS_N, "HSS1 RTS");
421 gpio_line_config(GPIO_HSS0_DCD_N, IXP4XX_GPIO_IN); 422 gpio_request(GPIO_HSS0_DCD_N, "HSS0 DCD");
422 gpio_line_config(GPIO_HSS1_DCD_N, IXP4XX_GPIO_IN); 423 gpio_request(GPIO_HSS1_DCD_N, "HSS1 DCD");
424
425 gpio_direction_output(GPIO_SCL, 1);
426 gpio_direction_output(GPIO_SDA, 1);
427 gpio_direction_output(GPIO_STR, 0);
428 gpio_direction_output(GPIO_HSS0_RTS_N, 1);
429 gpio_direction_output(GPIO_HSS1_RTS_N, 1);
430 gpio_direction_input(GPIO_HSS0_DCD_N);
431 gpio_direction_input(GPIO_HSS1_DCD_N);
423 irq_set_irq_type(IXP4XX_GPIO_IRQ(GPIO_HSS0_DCD_N), IRQ_TYPE_EDGE_BOTH); 432 irq_set_irq_type(IXP4XX_GPIO_IRQ(GPIO_HSS0_DCD_N), IRQ_TYPE_EDGE_BOTH);
424 irq_set_irq_type(IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N), IRQ_TYPE_EDGE_BOTH); 433 irq_set_irq_type(IXP4XX_GPIO_IRQ(GPIO_HSS1_DCD_N), IRQ_TYPE_EDGE_BOTH);
425 434
diff --git a/arch/arm/mach-ixp4xx/include/mach/io.h b/arch/arm/mach-ixp4xx/include/mach/io.h
index 5cf30d1b78d2..559c69a47731 100644
--- a/arch/arm/mach-ixp4xx/include/mach/io.h
+++ b/arch/arm/mach-ixp4xx/include/mach/io.h
@@ -48,9 +48,10 @@ extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data);
48 * fallback to the default. 48 * fallback to the default.
49 */ 49 */
50 50
51extern unsigned long pcibios_min_mem;
51static inline int is_pci_memory(u32 addr) 52static inline int is_pci_memory(u32 addr)
52{ 53{
53 return (addr >= PCIBIOS_MIN_MEM) && (addr <= 0x4FFFFFFF); 54 return (addr >= pcibios_min_mem) && (addr <= 0x4FFFFFFF);
54} 55}
55 56
56#define writeb(v, p) __indirect_writeb(v, p) 57#define writeb(v, p) __indirect_writeb(v, p)
diff --git a/arch/arm/mach-ixp4xx/include/mach/timex.h b/arch/arm/mach-ixp4xx/include/mach/timex.h
deleted file mode 100644
index 0396d89f947c..000000000000
--- a/arch/arm/mach-ixp4xx/include/mach/timex.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/*
2 * arch/arm/mach-ixp4xx/include/mach/timex.h
3 *
4 */
5
6#include <mach/ixp4xx-regs.h>
7
8/*
9 * We use IXP425 General purpose timer for our timer needs, it runs at
10 * 66.66... MHz. We do a convulted calculation of CLOCK_TICK_RATE b/c the
11 * timer register ignores the bottom 2 bits of the LATCH value.
12 */
13#define IXP4XX_TIMER_FREQ 66666000
14#define CLOCK_TICK_RATE \
15 (((IXP4XX_TIMER_FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ)
16
diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c
index 507cb5233537..4e0f762bc651 100644
--- a/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ b/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -295,8 +295,7 @@ static void __init nas100d_init(void)
295 pm_power_off = nas100d_power_off; 295 pm_power_off = nas100d_power_off;
296 296
297 if (request_irq(gpio_to_irq(NAS100D_RB_GPIO), &nas100d_reset_handler, 297 if (request_irq(gpio_to_irq(NAS100D_RB_GPIO), &nas100d_reset_handler,
298 IRQF_DISABLED | IRQF_TRIGGER_LOW, 298 IRQF_TRIGGER_LOW, "NAS100D reset button", NULL) < 0) {
299 "NAS100D reset button", NULL) < 0) {
300 299
301 printk(KERN_DEBUG "Reset Button IRQ %d not available\n", 300 printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
302 gpio_to_irq(NAS100D_RB_GPIO)); 301 gpio_to_irq(NAS100D_RB_GPIO));
diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c
index ba5f1cda2a9d..88c025f52d8d 100644
--- a/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ b/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -265,16 +265,14 @@ static void __init nslu2_init(void)
265 pm_power_off = nslu2_power_off; 265 pm_power_off = nslu2_power_off;
266 266
267 if (request_irq(gpio_to_irq(NSLU2_RB_GPIO), &nslu2_reset_handler, 267 if (request_irq(gpio_to_irq(NSLU2_RB_GPIO), &nslu2_reset_handler,
268 IRQF_DISABLED | IRQF_TRIGGER_LOW, 268 IRQF_TRIGGER_LOW, "NSLU2 reset button", NULL) < 0) {
269 "NSLU2 reset button", NULL) < 0) {
270 269
271 printk(KERN_DEBUG "Reset Button IRQ %d not available\n", 270 printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
272 gpio_to_irq(NSLU2_RB_GPIO)); 271 gpio_to_irq(NSLU2_RB_GPIO));
273 } 272 }
274 273
275 if (request_irq(gpio_to_irq(NSLU2_PB_GPIO), &nslu2_power_handler, 274 if (request_irq(gpio_to_irq(NSLU2_PB_GPIO), &nslu2_power_handler,
276 IRQF_DISABLED | IRQF_TRIGGER_HIGH, 275 IRQF_TRIGGER_HIGH, "NSLU2 power button", NULL) < 0) {
277 "NSLU2 power button", NULL) < 0) {
278 276
279 printk(KERN_DEBUG "Power Button IRQ %d not available\n", 277 printk(KERN_DEBUG "Power Button IRQ %d not available\n",
280 gpio_to_irq(NSLU2_PB_GPIO)); 278 gpio_to_irq(NSLU2_PB_GPIO));
diff --git a/arch/arm/mach-ixp4xx/omixp-setup.c b/arch/arm/mach-ixp4xx/omixp-setup.c
index 75ef03dc9964..2d494b454376 100644
--- a/arch/arm/mach-ixp4xx/omixp-setup.c
+++ b/arch/arm/mach-ixp4xx/omixp-setup.c
@@ -17,9 +17,7 @@
17#include <linux/serial_8250.h> 17#include <linux/serial_8250.h>
18#include <linux/mtd/mtd.h> 18#include <linux/mtd/mtd.h>
19#include <linux/mtd/partitions.h> 19#include <linux/mtd/partitions.h>
20#ifdef CONFIG_LEDS_CLASS
21#include <linux/leds.h> 20#include <linux/leds.h>
22#endif
23 21
24#include <asm/setup.h> 22#include <asm/setup.h>
25#include <asm/memory.h> 23#include <asm/memory.h>
diff --git a/arch/arm/mach-keystone/Kconfig b/arch/arm/mach-keystone/Kconfig
index 90a708fef541..f50bc936cb84 100644
--- a/arch/arm/mach-keystone/Kconfig
+++ b/arch/arm/mach-keystone/Kconfig
@@ -1,13 +1,9 @@
1config ARCH_KEYSTONE 1config ARCH_KEYSTONE
2 bool "Texas Instruments Keystone Devices" 2 bool "Texas Instruments Keystone Devices"
3 depends on ARCH_MULTI_V7 3 depends on ARCH_MULTI_V7
4 select CPU_V7
5 select ARM_GIC 4 select ARM_GIC
6 select HAVE_ARM_ARCH_TIMER 5 select HAVE_ARM_ARCH_TIMER
7 select HAVE_SMP
8 select CLKSRC_MMIO 6 select CLKSRC_MMIO
9 select GENERIC_CLOCKEVENTS
10 select ARCH_WANT_OPTIONAL_GPIOLIB
11 select ARM_ERRATA_798181 if SMP 7 select ARM_ERRATA_798181 if SMP
12 select COMMON_CLK_KEYSTONE 8 select COMMON_CLK_KEYSTONE
13 select ARCH_SUPPORTS_BIG_ENDIAN 9 select ARCH_SUPPORTS_BIG_ENDIAN
diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c
index 6e6bb7d5ea30..e0b9e1b9cf30 100644
--- a/arch/arm/mach-keystone/keystone.c
+++ b/arch/arm/mach-keystone/keystone.c
@@ -46,7 +46,7 @@ static void __init keystone_init(void)
46} 46}
47 47
48static const char *keystone_match[] __initconst = { 48static const char *keystone_match[] __initconst = {
49 "ti,keystone-evm", 49 "ti,keystone",
50 NULL, 50 NULL,
51}; 51};
52 52
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index fe8319ad3158..df4b26340ae4 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -106,13 +106,6 @@ config ARCH_KIRKWOOD_DT
106 Say 'Y' here if you want your kernel to support the 106 Say 'Y' here if you want your kernel to support the
107 Marvell Kirkwood using flattened device tree. 107 Marvell Kirkwood using flattened device tree.
108 108
109config MACH_MV88F6281GTW_GE_DT
110 bool "Marvell 88F6281 GTW GE Board (Flattened Device Tree)"
111 depends on ARCH_KIRKWOOD_DT
112 help
113 Say 'Y' here if you want your kernel to support the
114 Marvell 88F6281 GTW GE Board (Flattened Device Tree).
115
116endmenu 109endmenu
117 110
118endif 111endif
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 144b51102939..3a72c5c6e747 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -1,5 +1,4 @@
1obj-y += common.o pcie.o 1obj-$(CONFIG_KIRKWOOD_LEGACY) += irq.o mpp.o common.o pcie.o
2obj-$(CONFIG_KIRKWOOD_LEGACY) += irq.o mpp.o
3obj-$(CONFIG_PM) += pm.o 2obj-$(CONFIG_PM) += pm.o
4 3
5obj-$(CONFIG_MACH_D2NET_V2) += d2net_v2-setup.o lacie_v2-common.o 4obj-$(CONFIG_MACH_D2NET_V2) += d2net_v2-setup.o lacie_v2-common.o
@@ -13,4 +12,3 @@ obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o
13obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o 12obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o
14 13
15obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o 14obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o
16obj-$(CONFIG_MACH_MV88F6281GTW_GE_DT) += board-mv88f6281gtw_ge.o
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 78188159484d..2801da49e2a3 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -19,11 +19,84 @@
19#include <linux/of_platform.h> 19#include <linux/of_platform.h>
20#include <linux/dma-mapping.h> 20#include <linux/dma-mapping.h>
21#include <linux/irqchip.h> 21#include <linux/irqchip.h>
22#include <linux/kexec.h> 22#include <asm/hardware/cache-feroceon-l2.h>
23#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24#include <asm/mach/map.h>
24#include <mach/bridge-regs.h> 25#include <mach/bridge-regs.h>
25#include <plat/common.h> 26#include <plat/common.h>
26#include "common.h" 27#include <plat/pcie.h>
28#include "pm.h"
29
30static struct map_desc kirkwood_io_desc[] __initdata = {
31 {
32 .virtual = (unsigned long) KIRKWOOD_REGS_VIRT_BASE,
33 .pfn = __phys_to_pfn(KIRKWOOD_REGS_PHYS_BASE),
34 .length = KIRKWOOD_REGS_SIZE,
35 .type = MT_DEVICE,
36 },
37};
38
39static void __init kirkwood_map_io(void)
40{
41 iotable_init(kirkwood_io_desc, ARRAY_SIZE(kirkwood_io_desc));
42}
43
44static struct resource kirkwood_cpufreq_resources[] = {
45 [0] = {
46 .start = CPU_CONTROL_PHYS,
47 .end = CPU_CONTROL_PHYS + 3,
48 .flags = IORESOURCE_MEM,
49 },
50};
51
52static struct platform_device kirkwood_cpufreq_device = {
53 .name = "kirkwood-cpufreq",
54 .id = -1,
55 .num_resources = ARRAY_SIZE(kirkwood_cpufreq_resources),
56 .resource = kirkwood_cpufreq_resources,
57};
58
59static void __init kirkwood_cpufreq_init(void)
60{
61 platform_device_register(&kirkwood_cpufreq_device);
62}
63
64static struct resource kirkwood_cpuidle_resource[] = {
65 {
66 .flags = IORESOURCE_MEM,
67 .start = DDR_OPERATION_BASE,
68 .end = DDR_OPERATION_BASE + 3,
69 },
70};
71
72static struct platform_device kirkwood_cpuidle = {
73 .name = "kirkwood_cpuidle",
74 .id = -1,
75 .resource = kirkwood_cpuidle_resource,
76 .num_resources = 1,
77};
78
79static void __init kirkwood_cpuidle_init(void)
80{
81 platform_device_register(&kirkwood_cpuidle);
82}
83
84/* Temporary here since mach-mvebu has a function we can use */
85static void kirkwood_restart(enum reboot_mode mode, const char *cmd)
86{
87 /*
88 * Enable soft reset to assert RSTOUTn.
89 */
90 writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
91
92 /*
93 * Assert soft reset.
94 */
95 writel(SOFT_RESET, SYSTEM_SOFT_RESET);
96
97 while (1)
98 ;
99}
27 100
28#define MV643XX_ETH_MAC_ADDR_LOW 0x0414 101#define MV643XX_ETH_MAC_ADDR_LOW 0x0414
29#define MV643XX_ETH_MAC_ADDR_HIGH 0x0418 102#define MV643XX_ETH_MAC_ADDR_HIGH 0x0418
@@ -104,35 +177,35 @@ eth_fixup_skip:
104 } 177 }
105} 178}
106 179
107static void __init kirkwood_dt_init(void) 180/*
181 * Disable propagation of mbus errors to the CPU local bus, as this
182 * causes mbus errors (which can occur for example for PCI aborts) to
183 * throw CPU aborts, which we're not set up to deal with.
184 */
185static void __init kirkwood_disable_mbus_error_propagation(void)
108{ 186{
109 pr_info("Kirkwood: %s.\n", kirkwood_id()); 187 void __iomem *cpu_config;
110 188
111 /* 189 cpu_config = ioremap(CPU_CONFIG_PHYS, 4);
112 * Disable propagation of mbus errors to the CPU local bus, 190 writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config);
113 * as this causes mbus errors (which can occur for example 191 iounmap(cpu_config);
114 * for PCI aborts) to throw CPU aborts, which we're not set 192}
115 * up to deal with.
116 */
117 writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
118 193
119 BUG_ON(mvebu_mbus_dt_init()); 194static void __init kirkwood_dt_init(void)
195{
196 kirkwood_disable_mbus_error_propagation();
120 197
121 kirkwood_l2_init(); 198 BUG_ON(mvebu_mbus_dt_init());
122 199
200#ifdef CONFIG_CACHE_FEROCEON_L2
201 feroceon_of_init();
202#endif
123 kirkwood_cpufreq_init(); 203 kirkwood_cpufreq_init();
124 kirkwood_cpuidle_init(); 204 kirkwood_cpuidle_init();
125 205
126 kirkwood_pm_init(); 206 kirkwood_pm_init();
127 kirkwood_dt_eth_fixup(); 207 kirkwood_dt_eth_fixup();
128 208
129#ifdef CONFIG_KEXEC
130 kexec_reinit = kirkwood_enable_pcie;
131#endif
132
133 if (of_machine_is_compatible("marvell,mv88f6281gtw-ge"))
134 mv88f6281gtw_ge_init();
135
136 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 209 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
137} 210}
138 211
diff --git a/arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c b/arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c
deleted file mode 100644
index ee5eea678c11..000000000000
--- a/arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 * arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c
3 *
4 * Marvell 88F6281 GTW GE 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/irq.h>
15#include <linux/timer.h>
16#include <linux/mv643xx_eth.h>
17#include <linux/ethtool.h>
18#include <linux/gpio.h>
19#include <net/dsa.h>
20#include <asm/mach-types.h>
21#include <asm/mach/arch.h>
22#include <asm/mach/pci.h>
23#include <mach/kirkwood.h>
24#include "common.h"
25
26static struct mv643xx_eth_platform_data mv88f6281gtw_ge_ge00_data = {
27 .phy_addr = MV643XX_ETH_PHY_NONE,
28 .speed = SPEED_1000,
29 .duplex = DUPLEX_FULL,
30};
31
32static struct dsa_chip_data mv88f6281gtw_ge_switch_chip_data = {
33 .port_names[0] = "lan1",
34 .port_names[1] = "lan2",
35 .port_names[2] = "lan3",
36 .port_names[3] = "lan4",
37 .port_names[4] = "wan",
38 .port_names[5] = "cpu",
39};
40
41static struct dsa_platform_data mv88f6281gtw_ge_switch_plat_data = {
42 .nr_chips = 1,
43 .chip = &mv88f6281gtw_ge_switch_chip_data,
44};
45
46void __init mv88f6281gtw_ge_init(void)
47{
48 kirkwood_ge00_init(&mv88f6281gtw_ge_ge00_data);
49 kirkwood_ge00_switch_init(&mv88f6281gtw_ge_switch_plat_data, NO_IRQ);
50}
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index f3407a5db216..255f33a3903c 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -25,10 +25,10 @@
25#include <asm/page.h> 25#include <asm/page.h>
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27#include <asm/mach/time.h> 27#include <asm/mach/time.h>
28#include <asm/hardware/cache-feroceon-l2.h>
28#include <mach/kirkwood.h> 29#include <mach/kirkwood.h>
29#include <mach/bridge-regs.h> 30#include <mach/bridge-regs.h>
30#include <linux/platform_data/asoc-kirkwood.h> 31#include <linux/platform_data/asoc-kirkwood.h>
31#include <plat/cache-feroceon-l2.h>
32#include <linux/platform_data/mmc-mvsdio.h> 32#include <linux/platform_data/mmc-mvsdio.h>
33#include <linux/platform_data/mtd-orion_nand.h> 33#include <linux/platform_data/mtd-orion_nand.h>
34#include <linux/platform_data/usb-ehci-orion.h> 34#include <linux/platform_data/usb-ehci-orion.h>
@@ -36,6 +36,7 @@
36#include <plat/time.h> 36#include <plat/time.h>
37#include <linux/platform_data/dma-mv_xor.h> 37#include <linux/platform_data/dma-mv_xor.h>
38#include "common.h" 38#include "common.h"
39#include "pm.h"
39 40
40/* These can go away once Kirkwood uses the mvebu-mbus DT binding */ 41/* These can go away once Kirkwood uses the mvebu-mbus DT binding */
41#define KIRKWOOD_MBUS_NAND_TARGET 0x01 42#define KIRKWOOD_MBUS_NAND_TARGET 0x01
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 05fd648df543..832a4e2ab8d7 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -58,19 +58,6 @@ void kirkwood_cpufreq_init(void);
58void kirkwood_restart(enum reboot_mode, const char *); 58void kirkwood_restart(enum reboot_mode, const char *);
59void kirkwood_clk_init(void); 59void kirkwood_clk_init(void);
60 60
61#ifdef CONFIG_PM
62void kirkwood_pm_init(void);
63#else
64static inline void kirkwood_pm_init(void) {};
65#endif
66
67/* board init functions for boards not fully converted to fdt */
68#ifdef CONFIG_MACH_MV88F6281GTW_GE_DT
69void mv88f6281gtw_ge_init(void);
70#else
71static inline void mv88f6281gtw_ge_init(void) {};
72#endif
73
74/* early init functions not converted to fdt yet */ 61/* early init functions not converted to fdt yet */
75char *kirkwood_id(void); 62char *kirkwood_id(void);
76void kirkwood_l2_init(void); 63void kirkwood_l2_init(void);
diff --git a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
index 8b9d1c9ff199..1c37082c8b39 100644
--- a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
+++ b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h
@@ -14,6 +14,7 @@
14#include <mach/kirkwood.h> 14#include <mach/kirkwood.h>
15 15
16#define CPU_CONFIG (BRIDGE_VIRT_BASE + 0x0100) 16#define CPU_CONFIG (BRIDGE_VIRT_BASE + 0x0100)
17#define CPU_CONFIG_PHYS (BRIDGE_PHYS_BASE + 0x0100)
17#define CPU_CONFIG_ERROR_PROP 0x00000004 18#define CPU_CONFIG_ERROR_PROP 0x00000004
18 19
19#define CPU_CONTROL (BRIDGE_VIRT_BASE + 0x0104) 20#define CPU_CONTROL (BRIDGE_VIRT_BASE + 0x0104)
@@ -21,6 +22,7 @@
21#define CPU_RESET 0x00000002 22#define CPU_RESET 0x00000002
22 23
23#define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108) 24#define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108)
25#define RSTOUTn_MASK_PHYS (BRIDGE_PHYS_BASE + 0x0108)
24#define SOFT_RESET_OUT_EN 0x00000004 26#define SOFT_RESET_OUT_EN 0x00000004
25 27
26#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c) 28#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c)
@@ -79,5 +81,6 @@
79#define CGC_RESERVED (0x6 << 21) 81#define CGC_RESERVED (0x6 << 21)
80 82
81#define MEMORY_PM_CTRL (BRIDGE_VIRT_BASE + 0x118) 83#define MEMORY_PM_CTRL (BRIDGE_VIRT_BASE + 0x118)
84#define MEMORY_PM_CTRL_PHYS (BRIDGE_PHYS_BASE + 0x118)
82 85
83#endif 86#endif
diff --git a/arch/arm/mach-kirkwood/include/mach/timex.h b/arch/arm/mach-kirkwood/include/mach/timex.h
deleted file mode 100644
index c923cd169b9c..000000000000
--- a/arch/arm/mach-kirkwood/include/mach/timex.h
+++ /dev/null
@@ -1,10 +0,0 @@
1/*
2 * arch/arm/mach-kirkwood/include/mach/timex.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#define CLOCK_TICK_RATE (100 * HZ)
10
diff --git a/arch/arm/mach-kirkwood/pm.c b/arch/arm/mach-kirkwood/pm.c
index c6ab8d9303a5..8e5e0329d04c 100644
--- a/arch/arm/mach-kirkwood/pm.c
+++ b/arch/arm/mach-kirkwood/pm.c
@@ -21,15 +21,16 @@
21#include "common.h" 21#include "common.h"
22 22
23static void __iomem *ddr_operation_base; 23static void __iomem *ddr_operation_base;
24static void __iomem *memory_pm_ctrl;
24 25
25static void kirkwood_low_power(void) 26static void kirkwood_low_power(void)
26{ 27{
27 u32 mem_pm_ctrl; 28 u32 mem_pm_ctrl;
28 29
29 mem_pm_ctrl = readl(MEMORY_PM_CTRL); 30 mem_pm_ctrl = readl(memory_pm_ctrl);
30 31
31 /* Set peripherals to low-power mode */ 32 /* Set peripherals to low-power mode */
32 writel_relaxed(~0, MEMORY_PM_CTRL); 33 writel_relaxed(~0, memory_pm_ctrl);
33 34
34 /* Set DDR in self-refresh */ 35 /* Set DDR in self-refresh */
35 writel_relaxed(0x7, ddr_operation_base); 36 writel_relaxed(0x7, ddr_operation_base);
@@ -41,7 +42,7 @@ static void kirkwood_low_power(void)
41 */ 42 */
42 cpu_do_idle(); 43 cpu_do_idle();
43 44
44 writel_relaxed(mem_pm_ctrl, MEMORY_PM_CTRL); 45 writel_relaxed(mem_pm_ctrl, memory_pm_ctrl);
45} 46}
46 47
47static int kirkwood_suspend_enter(suspend_state_t state) 48static int kirkwood_suspend_enter(suspend_state_t state)
@@ -69,5 +70,7 @@ static const struct platform_suspend_ops kirkwood_suspend_ops = {
69void __init kirkwood_pm_init(void) 70void __init kirkwood_pm_init(void)
70{ 71{
71 ddr_operation_base = ioremap(DDR_OPERATION_BASE, 4); 72 ddr_operation_base = ioremap(DDR_OPERATION_BASE, 4);
73 memory_pm_ctrl = ioremap(MEMORY_PM_CTRL_PHYS, 4);
74
72 suspend_set_ops(&kirkwood_suspend_ops); 75 suspend_set_ops(&kirkwood_suspend_ops);
73} 76}
diff --git a/arch/arm/mach-kirkwood/pm.h b/arch/arm/mach-kirkwood/pm.h
new file mode 100644
index 000000000000..21e7530f368b
--- /dev/null
+++ b/arch/arm/mach-kirkwood/pm.h
@@ -0,0 +1,26 @@
1/*
2 * Power Management driver for Marvell Kirkwood SoCs
3 *
4 * Copyright (C) 2013 Ezequiel Garcia <ezequiel@free-electrons.com>
5 * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com>
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,
9 * 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
17#ifndef __ARCH_KIRKWOOD_PM_H
18#define __ARCH_KIRKWOOD_PM_H
19
20#ifdef CONFIG_PM
21void kirkwood_pm_init(void);
22#else
23static inline void kirkwood_pm_init(void) {};
24#endif
25
26#endif
diff --git a/arch/arm/mach-ks8695/board-og.c b/arch/arm/mach-ks8695/board-og.c
index 002bc619bb68..f2658168eeff 100644
--- a/arch/arm/mach-ks8695/board-og.c
+++ b/arch/arm/mach-ks8695/board-og.c
@@ -44,7 +44,8 @@ static void __init og_register_pci(void)
44 if (machine_is_im4004()) 44 if (machine_is_im4004())
45 ks8695_gpio_interrupt(KS8695_GPIO_1, IRQ_TYPE_LEVEL_LOW); 45 ks8695_gpio_interrupt(KS8695_GPIO_1, IRQ_TYPE_LEVEL_LOW);
46 46
47 ks8695_init_pci(&og_pci); 47 if (IS_ENABLED(CONFIG_PCI))
48 ks8695_init_pci(&og_pci);
48} 49}
49 50
50/* 51/*
diff --git a/arch/arm/mach-ks8695/include/mach/timex.h b/arch/arm/mach-ks8695/include/mach/timex.h
deleted file mode 100644
index 10f716371bd3..000000000000
--- a/arch/arm/mach-ks8695/include/mach/timex.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * arch/arm/mach-ks8695/include/mach/timex.h
3 *
4 * Copyright (C) 2006 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * KS8695 - Time Parameters
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#ifndef __ASM_ARCH_TIMEX_H
15#define __ASM_ARCH_TIMEX_H
16
17#include <mach/hardware.h>
18
19#define CLOCK_TICK_RATE KS8695_CLOCK_RATE
20
21#endif
diff --git a/arch/arm/mach-ks8695/time.c b/arch/arm/mach-ks8695/time.c
index 426c97662f5b..a197874bf382 100644
--- a/arch/arm/mach-ks8695/time.c
+++ b/arch/arm/mach-ks8695/time.c
@@ -122,7 +122,7 @@ static irqreturn_t ks8695_timer_interrupt(int irq, void *dev_id)
122 122
123static struct irqaction ks8695_timer_irq = { 123static struct irqaction ks8695_timer_irq = {
124 .name = "ks8695_tick", 124 .name = "ks8695_tick",
125 .flags = IRQF_DISABLED | IRQF_TIMER, 125 .flags = IRQF_TIMER,
126 .handler = ks8695_timer_interrupt, 126 .handler = ks8695_timer_interrupt,
127}; 127};
128 128
diff --git a/arch/arm/mach-lpc32xx/common.c b/arch/arm/mach-lpc32xx/common.c
index d7aa54c25c59..de03620d7fa7 100644
--- a/arch/arm/mach-lpc32xx/common.c
+++ b/arch/arm/mach-lpc32xx/common.c
@@ -99,6 +99,7 @@ u32 lpc32xx_return_iram_size(void)
99 99
100 return iram_size; 100 return iram_size;
101} 101}
102EXPORT_SYMBOL_GPL(lpc32xx_return_iram_size);
102 103
103/* 104/*
104 * Computes PLL rate from PLL register and input clock 105 * Computes PLL rate from PLL register and input clock
diff --git a/arch/arm/mach-lpc32xx/timer.c b/arch/arm/mach-lpc32xx/timer.c
index 20eab63d10ba..4e5837299c04 100644
--- a/arch/arm/mach-lpc32xx/timer.c
+++ b/arch/arm/mach-lpc32xx/timer.c
@@ -90,7 +90,7 @@ static irqreturn_t lpc32xx_timer_interrupt(int irq, void *dev_id)
90 90
91static struct irqaction lpc32xx_timer_irq = { 91static struct irqaction lpc32xx_timer_irq = {
92 .name = "LPC32XX Timer Tick", 92 .name = "LPC32XX Timer Tick",
93 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 93 .flags = IRQF_TIMER | IRQF_IRQPOLL,
94 .handler = lpc32xx_timer_interrupt, 94 .handler = lpc32xx_timer_interrupt,
95}; 95};
96 96
diff --git a/arch/arm/mach-mmp/aspenite.c b/arch/arm/mach-mmp/aspenite.c
index 0c002099c3a3..7e0248582efd 100644
--- a/arch/arm/mach-mmp/aspenite.c
+++ b/arch/arm/mach-mmp/aspenite.c
@@ -231,7 +231,7 @@ static struct pxa27x_keypad_platform_data aspenite_keypad_info __initdata = {
231 .debounce_interval = 30, 231 .debounce_interval = 30,
232}; 232};
233 233
234#if defined(CONFIG_USB_EHCI_MV) 234#if IS_ENABLED(CONFIG_USB_EHCI_MV)
235static struct mv_usb_platform_data pxa168_sph_pdata = { 235static struct mv_usb_platform_data pxa168_sph_pdata = {
236 .mode = MV_USB_MODE_HOST, 236 .mode = MV_USB_MODE_HOST,
237 .phy_init = pxa_usb_phy_init, 237 .phy_init = pxa_usb_phy_init,
@@ -258,7 +258,7 @@ static void __init common_init(void)
258 /* off-chip devices */ 258 /* off-chip devices */
259 platform_device_register(&smc91x_device); 259 platform_device_register(&smc91x_device);
260 260
261#if defined(CONFIG_USB_EHCI_MV) 261#if IS_ENABLED(CONFIG_USB_EHCI_MV)
262 pxa168_add_usb_host(&pxa168_sph_pdata); 262 pxa168_add_usb_host(&pxa168_sph_pdata);
263#endif 263#endif
264} 264}
diff --git a/arch/arm/mach-mmp/devices.c b/arch/arm/mach-mmp/devices.c
index dd2d8b103cc8..2bcb766af05d 100644
--- a/arch/arm/mach-mmp/devices.c
+++ b/arch/arm/mach-mmp/devices.c
@@ -72,7 +72,7 @@ int __init pxa_register_device(struct pxa_device_desc *desc,
72 return platform_device_add(pdev); 72 return platform_device_add(pdev);
73} 73}
74 74
75#if defined(CONFIG_USB) || defined(CONFIG_USB_GADGET) 75#if IS_ENABLED(CONFIG_USB) || IS_ENABLED(CONFIG_USB_GADGET)
76 76
77/***************************************************************************** 77/*****************************************************************************
78 * The registers read/write routines 78 * The registers read/write routines
@@ -112,9 +112,9 @@ static void u2o_write(void __iomem *base, unsigned int offset,
112 readl_relaxed(base + offset); 112 readl_relaxed(base + offset);
113} 113}
114 114
115#if defined(CONFIG_USB_MV_UDC) || defined(CONFIG_USB_EHCI_MV) 115#if IS_ENABLED(CONFIG_USB_MV_UDC) || IS_ENABLED(CONFIG_USB_EHCI_MV)
116 116
117#if defined(CONFIG_CPU_PXA910) || defined(CONFIG_CPU_PXA168) 117#if IS_ENABLED(CONFIG_CPU_PXA910) || IS_ENABLED(CONFIG_CPU_PXA168)
118 118
119static DEFINE_MUTEX(phy_lock); 119static DEFINE_MUTEX(phy_lock);
120static int phy_init_cnt; 120static int phy_init_cnt;
@@ -238,10 +238,10 @@ void pxa_usb_phy_deinit(void __iomem *phy_reg)
238#endif 238#endif
239#endif 239#endif
240 240
241#ifdef CONFIG_USB_SUPPORT 241#if IS_ENABLED(CONFIG_USB_SUPPORT)
242static u64 usb_dma_mask = ~(u32)0; 242static u64 usb_dma_mask = ~(u32)0;
243 243
244#ifdef CONFIG_USB_MV_UDC 244#if IS_ENABLED(CONFIG_USB_MV_UDC)
245struct resource pxa168_u2o_resources[] = { 245struct resource pxa168_u2o_resources[] = {
246 /* regbase */ 246 /* regbase */
247 [0] = { 247 [0] = {
@@ -276,7 +276,7 @@ struct platform_device pxa168_device_u2o = {
276}; 276};
277#endif /* CONFIG_USB_MV_UDC */ 277#endif /* CONFIG_USB_MV_UDC */
278 278
279#ifdef CONFIG_USB_EHCI_MV_U2O 279#if IS_ENABLED(CONFIG_USB_EHCI_MV_U2O)
280struct resource pxa168_u2oehci_resources[] = { 280struct resource pxa168_u2oehci_resources[] = {
281 /* regbase */ 281 /* regbase */
282 [0] = { 282 [0] = {
@@ -312,7 +312,7 @@ struct platform_device pxa168_device_u2oehci = {
312}; 312};
313#endif 313#endif
314 314
315#if defined(CONFIG_USB_MV_OTG) 315#if IS_ENABLED(CONFIG_USB_MV_OTG)
316struct resource pxa168_u2ootg_resources[] = { 316struct resource pxa168_u2ootg_resources[] = {
317 /* regbase */ 317 /* regbase */
318 [0] = { 318 [0] = {
diff --git a/arch/arm/mach-mmp/include/mach/timex.h b/arch/arm/mach-mmp/include/mach/timex.h
deleted file mode 100644
index 70c9f1d88c02..000000000000
--- a/arch/arm/mach-mmp/include/mach/timex.h
+++ /dev/null
@@ -1,13 +0,0 @@
1/*
2 * linux/arch/arm/mach-mmp/include/mach/timex.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifdef CONFIG_CPU_MMP2
10#define CLOCK_TICK_RATE 6500000
11#else
12#define CLOCK_TICK_RATE 3250000
13#endif
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c
index 024022d91fe3..2756351dbb35 100644
--- a/arch/arm/mach-mmp/time.c
+++ b/arch/arm/mach-mmp/time.c
@@ -39,6 +39,12 @@
39 39
40#include "clock.h" 40#include "clock.h"
41 41
42#ifdef CONFIG_CPU_MMP2
43#define MMP_CLOCK_FREQ 6500000
44#else
45#define MMP_CLOCK_FREQ 3250000
46#endif
47
42#define TIMERS_VIRT_BASE TIMERS1_VIRT_BASE 48#define TIMERS_VIRT_BASE TIMERS1_VIRT_BASE
43 49
44#define MAX_DELTA (0xfffffffe) 50#define MAX_DELTA (0xfffffffe)
@@ -186,7 +192,7 @@ static void __init timer_config(void)
186 192
187static struct irqaction timer_irq = { 193static struct irqaction timer_irq = {
188 .name = "timer", 194 .name = "timer",
189 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 195 .flags = IRQF_TIMER | IRQF_IRQPOLL,
190 .handler = timer_interrupt, 196 .handler = timer_interrupt,
191 .dev_id = &ckevt, 197 .dev_id = &ckevt,
192}; 198};
@@ -195,14 +201,14 @@ void __init timer_init(int irq)
195{ 201{
196 timer_config(); 202 timer_config();
197 203
198 sched_clock_register(mmp_read_sched_clock, 32, CLOCK_TICK_RATE); 204 sched_clock_register(mmp_read_sched_clock, 32, MMP_CLOCK_FREQ);
199 205
200 ckevt.cpumask = cpumask_of(0); 206 ckevt.cpumask = cpumask_of(0);
201 207
202 setup_irq(irq, &timer_irq); 208 setup_irq(irq, &timer_irq);
203 209
204 clocksource_register_hz(&cksrc, CLOCK_TICK_RATE); 210 clocksource_register_hz(&cksrc, MMP_CLOCK_FREQ);
205 clockevents_config_and_register(&ckevt, CLOCK_TICK_RATE, 211 clockevents_config_and_register(&ckevt, MMP_CLOCK_FREQ,
206 MIN_DELTA, MAX_DELTA); 212 MIN_DELTA, MAX_DELTA);
207} 213}
208 214
diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c
index cfadd974f5ce..ac4af81de3ea 100644
--- a/arch/arm/mach-mmp/ttc_dkb.c
+++ b/arch/arm/mach-mmp/ttc_dkb.c
@@ -164,8 +164,8 @@ static struct i2c_board_info ttc_dkb_i2c_info[] = {
164 }, 164 },
165}; 165};
166 166
167#ifdef CONFIG_USB_SUPPORT 167#if IS_ENABLED(CONFIG_USB_SUPPORT)
168#if defined(CONFIG_USB_MV_UDC) || defined(CONFIG_USB_EHCI_MV_U2O) 168#if IS_ENABLED(CONFIG_USB_MV_UDC) || IS_ENABLED(CONFIG_USB_EHCI_MV_U2O)
169 169
170static struct mv_usb_platform_data ttc_usb_pdata = { 170static struct mv_usb_platform_data ttc_usb_pdata = {
171 .vbus = NULL, 171 .vbus = NULL,
@@ -178,14 +178,14 @@ static struct mv_usb_platform_data ttc_usb_pdata = {
178#endif 178#endif
179#endif 179#endif
180 180
181#ifdef CONFIG_MTD_NAND_PXA3xx 181#if IS_ENABLED(CONFIG_MTD_NAND_PXA3xx)
182static struct pxa3xx_nand_platform_data dkb_nand_info = { 182static struct pxa3xx_nand_platform_data dkb_nand_info = {
183 .enable_arbiter = 1, 183 .enable_arbiter = 1,
184 .num_cs = 1, 184 .num_cs = 1,
185}; 185};
186#endif 186#endif
187 187
188#ifdef CONFIG_MMP_DISP 188#if IS_ENABLED(CONFIG_MMP_DISP)
189/* path config */ 189/* path config */
190#define CFG_IOPADMODE(iopad) (iopad) /* 0x0 ~ 0xd */ 190#define CFG_IOPADMODE(iopad) (iopad) /* 0x0 ~ 0xd */
191#define SCLK_SOURCE_SELECT(x) (x << 30) /* 0x0 ~ 0x3 */ 191#define SCLK_SOURCE_SELECT(x) (x << 30) /* 0x0 ~ 0x3 */
@@ -275,7 +275,7 @@ static void __init ttc_dkb_init(void)
275 275
276 /* on-chip devices */ 276 /* on-chip devices */
277 pxa910_add_uart(1); 277 pxa910_add_uart(1);
278#ifdef CONFIG_MTD_NAND_PXA3xx 278#if IS_ENABLED(CONFIG_MTD_NAND_PXA3xx)
279 pxa910_add_nand(&dkb_nand_info); 279 pxa910_add_nand(&dkb_nand_info);
280#endif 280#endif
281 281
@@ -285,22 +285,22 @@ static void __init ttc_dkb_init(void)
285 sizeof(struct pxa_gpio_platform_data)); 285 sizeof(struct pxa_gpio_platform_data));
286 platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices)); 286 platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices));
287 287
288#ifdef CONFIG_USB_MV_UDC 288#if IS_ENABLED(CONFIG_USB_MV_UDC)
289 pxa168_device_u2o.dev.platform_data = &ttc_usb_pdata; 289 pxa168_device_u2o.dev.platform_data = &ttc_usb_pdata;
290 platform_device_register(&pxa168_device_u2o); 290 platform_device_register(&pxa168_device_u2o);
291#endif 291#endif
292 292
293#ifdef CONFIG_USB_EHCI_MV_U2O 293#if IS_ENABLED(CONFIG_USB_EHCI_MV_U2O)
294 pxa168_device_u2oehci.dev.platform_data = &ttc_usb_pdata; 294 pxa168_device_u2oehci.dev.platform_data = &ttc_usb_pdata;
295 platform_device_register(&pxa168_device_u2oehci); 295 platform_device_register(&pxa168_device_u2oehci);
296#endif 296#endif
297 297
298#ifdef CONFIG_USB_MV_OTG 298#if IS_ENABLED(CONFIG_USB_MV_OTG)
299 pxa168_device_u2ootg.dev.platform_data = &ttc_usb_pdata; 299 pxa168_device_u2ootg.dev.platform_data = &ttc_usb_pdata;
300 platform_device_register(&pxa168_device_u2ootg); 300 platform_device_register(&pxa168_device_u2ootg);
301#endif 301#endif
302 302
303#ifdef CONFIG_MMP_DISP 303#if IS_ENABLED(CONFIG_MMP_DISP)
304 add_disp(); 304 add_disp();
305#endif 305#endif
306} 306}
diff --git a/arch/arm/mach-moxart/Kconfig b/arch/arm/mach-moxart/Kconfig
index 3795ae28a613..82a4ba8578a2 100644
--- a/arch/arm/mach-moxart/Kconfig
+++ b/arch/arm/mach-moxart/Kconfig
@@ -1,15 +1,10 @@
1config ARCH_MOXART 1config ARCH_MOXART
2 bool "MOXA ART SoC" if ARCH_MULTI_V4T 2 bool "MOXA ART SoC" if ARCH_MULTI_V4
3 select CPU_FA526 3 select CPU_FA526
4 select ARM_DMA_MEM_BUFFERABLE 4 select ARM_DMA_MEM_BUFFERABLE
5 select USE_OF
6 select CLKSRC_OF
7 select CLKSRC_MMIO 5 select CLKSRC_MMIO
8 select HAVE_CLK
9 select COMMON_CLK
10 select GENERIC_IRQ_CHIP 6 select GENERIC_IRQ_CHIP
11 select ARCH_REQUIRE_GPIOLIB 7 select ARCH_REQUIRE_GPIOLIB
12 select GENERIC_CLOCKEVENTS
13 select PHYLIB if NETDEVICES 8 select PHYLIB if NETDEVICES
14 help 9 help
15 Say Y here if you want to run your kernel on hardware with a 10 Say Y here if you want to run your kernel on hardware with a
diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
index 9625cf378931..a7f959e58c3d 100644
--- a/arch/arm/mach-msm/Kconfig
+++ b/arch/arm/mach-msm/Kconfig
@@ -1,50 +1,9 @@
1config ARCH_MSM
2 bool
3
4config ARCH_MSM_DT
5 bool "Qualcomm MSM DT Support" if ARCH_MULTI_V7
6 select ARCH_MSM
7 select ARCH_REQUIRE_GPIOLIB
8 select CLKSRC_OF
9 select GENERIC_CLOCKEVENTS
10 help
11 Support for Qualcomm's devicetree based MSM systems.
12
13if ARCH_MSM 1if ARCH_MSM
14 2
15menu "Qualcomm MSM SoC Selection"
16 depends on ARCH_MSM_DT
17
18config ARCH_MSM8X60
19 bool "Enable support for MSM8X60"
20 select ARM_GIC
21 select CPU_V7
22 select HAVE_SMP
23 select MSM_SCM if SMP
24 select MSM_TIMER
25
26config ARCH_MSM8960
27 bool "Enable support for MSM8960"
28 select ARM_GIC
29 select CPU_V7
30 select HAVE_SMP
31 select MSM_SCM if SMP
32 select MSM_TIMER
33
34config ARCH_MSM8974
35 bool "Enable support for MSM8974"
36 select ARM_GIC
37 select CPU_V7
38 select HAVE_ARM_ARCH_TIMER
39 select HAVE_SMP
40 select MSM_SCM if SMP
41
42endmenu
43
44choice 3choice
45 prompt "Qualcomm MSM SoC Type" 4 prompt "Qualcomm MSM SoC Type"
46 default ARCH_MSM7X00A 5 default ARCH_MSM7X00A
47 depends on ARCH_MSM_NODT 6 depends on ARCH_MSM
48 7
49config ARCH_MSM7X00A 8config ARCH_MSM7X00A
50 bool "MSM7x00A / MSM7x01A" 9 bool "MSM7x00A / MSM7x01A"
@@ -54,7 +13,7 @@ config ARCH_MSM7X00A
54 select MACH_TROUT if !MACH_HALIBUT 13 select MACH_TROUT if !MACH_HALIBUT
55 select MSM_PROC_COMM 14 select MSM_PROC_COMM
56 select MSM_SMD 15 select MSM_SMD
57 select MSM_TIMER 16 select CLKSRC_QCOM
58 select MSM_SMD_PKG3 17 select MSM_SMD_PKG3
59 18
60config ARCH_MSM7X30 19config ARCH_MSM7X30
@@ -66,7 +25,7 @@ config ARCH_MSM7X30
66 select MSM_GPIOMUX 25 select MSM_GPIOMUX
67 select MSM_PROC_COMM 26 select MSM_PROC_COMM
68 select MSM_SMD 27 select MSM_SMD
69 select MSM_TIMER 28 select CLKSRC_QCOM
70 select MSM_VIC 29 select MSM_VIC
71 30
72config ARCH_QSD8X50 31config ARCH_QSD8X50
@@ -78,7 +37,7 @@ config ARCH_QSD8X50
78 select MSM_GPIOMUX 37 select MSM_GPIOMUX
79 select MSM_PROC_COMM 38 select MSM_PROC_COMM
80 select MSM_SMD 39 select MSM_SMD
81 select MSM_TIMER 40 select CLKSRC_QCOM
82 select MSM_VIC 41 select MSM_VIC
83 42
84endchoice 43endchoice
@@ -99,7 +58,7 @@ config MSM_VIC
99 bool 58 bool
100 59
101menu "Qualcomm MSM Board Type" 60menu "Qualcomm MSM Board Type"
102 depends on ARCH_MSM_NODT 61 depends on ARCH_MSM
103 62
104config MACH_HALIBUT 63config MACH_HALIBUT
105 depends on ARCH_MSM 64 depends on ARCH_MSM
@@ -153,7 +112,4 @@ config MSM_GPIOMUX
153config MSM_SCM 112config MSM_SCM
154 bool 113 bool
155 114
156config MSM_TIMER
157 bool
158
159endif 115endif
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
index 8e307a10d3c3..27c078a568df 100644
--- a/arch/arm/mach-msm/Makefile
+++ b/arch/arm/mach-msm/Makefile
@@ -1,4 +1,3 @@
1obj-$(CONFIG_MSM_TIMER) += timer.o
2obj-$(CONFIG_MSM_PROC_COMM) += clock.o 1obj-$(CONFIG_MSM_PROC_COMM) += clock.o
3 2
4obj-$(CONFIG_MSM_VIC) += irq-vic.o 3obj-$(CONFIG_MSM_VIC) += irq-vic.o
@@ -14,18 +13,11 @@ obj-$(CONFIG_ARCH_QSD8X50) += dma.o io.o
14 13
15obj-$(CONFIG_MSM_SMD) += smd.o smd_debug.o 14obj-$(CONFIG_MSM_SMD) += smd.o smd_debug.o
16obj-$(CONFIG_MSM_SMD) += last_radio_log.o 15obj-$(CONFIG_MSM_SMD) += last_radio_log.o
17obj-$(CONFIG_MSM_SCM) += scm.o scm-boot.o
18
19CFLAGS_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1)
20
21obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
22obj-$(CONFIG_SMP) += headsmp.o platsmp.o
23 16
24obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o devices-msm7x00.o 17obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o devices-msm7x00.o
25obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o board-trout-panel.o devices-msm7x00.o 18obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o board-trout-panel.o devices-msm7x00.o
26obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o devices-msm7x00.o 19obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o devices-msm7x00.o
27obj-$(CONFIG_ARCH_MSM7X30) += board-msm7x30.o devices-msm7x30.o 20obj-$(CONFIG_ARCH_MSM7X30) += board-msm7x30.o devices-msm7x30.o
28obj-$(CONFIG_ARCH_QSD8X50) += board-qsd8x50.o devices-qsd8x50.o 21obj-$(CONFIG_ARCH_QSD8X50) += board-qsd8x50.o devices-qsd8x50.o
29obj-$(CONFIG_ARCH_MSM_DT) += board-dt.o
30obj-$(CONFIG_MSM_GPIOMUX) += gpiomux.o 22obj-$(CONFIG_MSM_GPIOMUX) += gpiomux.o
31obj-$(CONFIG_ARCH_QSD8X50) += gpiomux-8x50.o 23obj-$(CONFIG_ARCH_QSD8X50) += gpiomux-8x50.o
diff --git a/arch/arm/mach-msm/common.h b/arch/arm/mach-msm/common.h
index 33c7725adae2..572479a3c7be 100644
--- a/arch/arm/mach-msm/common.h
+++ b/arch/arm/mach-msm/common.h
@@ -23,9 +23,6 @@ extern void msm_map_qsd8x50_io(void);
23extern void __iomem *__msm_ioremap_caller(phys_addr_t phys_addr, size_t size, 23extern void __iomem *__msm_ioremap_caller(phys_addr_t phys_addr, size_t size,
24 unsigned int mtype, void *caller); 24 unsigned int mtype, void *caller);
25 25
26extern struct smp_operations msm_smp_ops;
27extern void msm_cpu_die(unsigned int cpu);
28
29struct msm_mmc_platform_data; 26struct msm_mmc_platform_data;
30 27
31extern void msm_add_devices(void); 28extern void msm_add_devices(void);
diff --git a/arch/arm/mach-msm/dma.c b/arch/arm/mach-msm/dma.c
index f8f6adfa07c6..fb9762464718 100644
--- a/arch/arm/mach-msm/dma.c
+++ b/arch/arm/mach-msm/dma.c
@@ -18,6 +18,7 @@
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/completion.h> 20#include <linux/completion.h>
21#include <linux/module.h>
21#include <mach/dma.h> 22#include <mach/dma.h>
22#include <mach/msm_iomap.h> 23#include <mach/msm_iomap.h>
23 24
@@ -77,6 +78,7 @@ void msm_dmov_stop_cmd(unsigned id, struct msm_dmov_cmd *cmd, int graceful)
77{ 78{
78 writel((graceful << 31), DMOV_FLUSH0(id)); 79 writel((graceful << 31), DMOV_FLUSH0(id));
79} 80}
81EXPORT_SYMBOL_GPL(msm_dmov_stop_cmd);
80 82
81void msm_dmov_enqueue_cmd(unsigned id, struct msm_dmov_cmd *cmd) 83void msm_dmov_enqueue_cmd(unsigned id, struct msm_dmov_cmd *cmd)
82{ 84{
@@ -115,6 +117,7 @@ void msm_dmov_enqueue_cmd(unsigned id, struct msm_dmov_cmd *cmd)
115 } 117 }
116 spin_unlock_irqrestore(&msm_dmov_lock, irq_flags); 118 spin_unlock_irqrestore(&msm_dmov_lock, irq_flags);
117} 119}
120EXPORT_SYMBOL_GPL(msm_dmov_enqueue_cmd);
118 121
119struct msm_dmov_exec_cmdptr_cmd { 122struct msm_dmov_exec_cmdptr_cmd {
120 struct msm_dmov_cmd dmov_cmd; 123 struct msm_dmov_cmd dmov_cmd;
diff --git a/arch/arm/mach-msm/headsmp.S b/arch/arm/mach-msm/headsmp.S
deleted file mode 100644
index 6c62c3f82fe6..000000000000
--- a/arch/arm/mach-msm/headsmp.S
+++ /dev/null
@@ -1,39 +0,0 @@
1/*
2 * linux/arch/arm/mach-realview/headsmp.S
3 *
4 * Copyright (c) 2003 ARM Limited
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 version 2 as
9 * published by the Free Software Foundation.
10 */
11#include <linux/linkage.h>
12#include <linux/init.h>
13
14/*
15 * MSM specific entry point for secondary CPUs. This provides
16 * a "holding pen" into which all secondary cores are held until we're
17 * ready for them to initialise.
18 */
19ENTRY(msm_secondary_startup)
20 mrc p15, 0, r0, c0, c0, 5
21 and r0, r0, #15
22 adr r4, 1f
23 ldmia r4, {r5, r6}
24 sub r4, r4, r5
25 add r6, r6, r4
26pen: ldr r7, [r6]
27 cmp r7, r0
28 bne pen
29
30 /*
31 * we've been released from the holding pen: secondary_stack
32 * should now contain the SVC stack for this core
33 */
34 b secondary_startup
35ENDPROC(msm_secondary_startup)
36
37 .align
381: .long .
39 .long pen_release
diff --git a/arch/arm/mach-msm/hotplug.c b/arch/arm/mach-msm/hotplug.c
deleted file mode 100644
index 326a87261f9a..000000000000
--- a/arch/arm/mach-msm/hotplug.c
+++ /dev/null
@@ -1,74 +0,0 @@
1/*
2 * Copyright (C) 2002 ARM Ltd.
3 * All Rights Reserved
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#include <linux/kernel.h>
10#include <linux/errno.h>
11#include <linux/smp.h>
12
13#include <asm/smp_plat.h>
14
15#include "common.h"
16
17static inline void cpu_enter_lowpower(void)
18{
19}
20
21static inline void cpu_leave_lowpower(void)
22{
23}
24
25static inline void platform_do_lowpower(unsigned int cpu)
26{
27 /* Just enter wfi for now. TODO: Properly shut off the cpu. */
28 for (;;) {
29 /*
30 * here's the WFI
31 */
32 asm("wfi"
33 :
34 :
35 : "memory", "cc");
36
37 if (pen_release == cpu_logical_map(cpu)) {
38 /*
39 * OK, proper wakeup, we're done
40 */
41 break;
42 }
43
44 /*
45 * getting here, means that we have come out of WFI without
46 * having been woken up - this shouldn't happen
47 *
48 * The trouble is, letting people know about this is not really
49 * possible, since we are currently running incoherently, and
50 * therefore cannot safely call printk() or anything else
51 */
52 pr_debug("CPU%u: spurious wakeup call\n", cpu);
53 }
54}
55
56/*
57 * platform-specific code to shutdown a CPU
58 *
59 * Called with IRQs disabled
60 */
61void __ref msm_cpu_die(unsigned int cpu)
62{
63 /*
64 * we're ready for shutdown now, so do it
65 */
66 cpu_enter_lowpower();
67 platform_do_lowpower(cpu);
68
69 /*
70 * bring this CPU back into the world of cache
71 * coherency, and then restore interrupts
72 */
73 cpu_leave_lowpower();
74}
diff --git a/arch/arm/mach-msm/include/mach/timex.h b/arch/arm/mach-msm/include/mach/timex.h
deleted file mode 100644
index a62e6b215aec..000000000000
--- a/arch/arm/mach-msm/include/mach/timex.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/* arch/arm/mach-msm/include/mach/timex.h
2 *
3 * Copyright (C) 2007 Google, Inc.
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15
16#ifndef __ASM_ARCH_MSM_TIMEX_H
17#define __ASM_ARCH_MSM_TIMEX_H
18
19#define CLOCK_TICK_RATE 1000000
20
21#endif
diff --git a/arch/arm/mach-msm/io.c b/arch/arm/mach-msm/io.c
index adc8971c7266..34e09474636d 100644
--- a/arch/arm/mach-msm/io.c
+++ b/arch/arm/mach-msm/io.c
@@ -78,8 +78,10 @@ void __init msm_map_common_io(void)
78 asm("mcr p15, 0, %0, c15, c2, 4" : : "r" (0)); 78 asm("mcr p15, 0, %0, c15, c2, 4" : : "r" (0));
79#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \ 79#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
80 defined(CONFIG_DEBUG_MSM_UART3) 80 defined(CONFIG_DEBUG_MSM_UART3)
81#ifdef CONFIG_MMU
81 debug_ll_addr(&msm_io_desc[size - 1].pfn, 82 debug_ll_addr(&msm_io_desc[size - 1].pfn,
82 &msm_io_desc[size - 1].virtual); 83 &msm_io_desc[size - 1].virtual);
84#endif
83 msm_io_desc[size - 1].pfn = __phys_to_pfn(msm_io_desc[size - 1].pfn); 85 msm_io_desc[size - 1].pfn = __phys_to_pfn(msm_io_desc[size - 1].pfn);
84#endif 86#endif
85 iotable_init(msm_io_desc, size); 87 iotable_init(msm_io_desc, size);
diff --git a/arch/arm/mach-msm/platsmp.c b/arch/arm/mach-msm/platsmp.c
deleted file mode 100644
index f10a1f58fde9..000000000000
--- a/arch/arm/mach-msm/platsmp.c
+++ /dev/null
@@ -1,161 +0,0 @@
1/*
2 * Copyright (C) 2002 ARM Ltd.
3 * All Rights Reserved
4 * Copyright (c) 2010, Code Aurora Forum. 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 version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/init.h>
12#include <linux/errno.h>
13#include <linux/delay.h>
14#include <linux/device.h>
15#include <linux/jiffies.h>
16#include <linux/smp.h>
17#include <linux/io.h>
18
19#include <asm/cacheflush.h>
20#include <asm/cputype.h>
21#include <asm/mach-types.h>
22#include <asm/smp_plat.h>
23
24#include "scm-boot.h"
25#include "common.h"
26
27#define VDD_SC1_ARRAY_CLAMP_GFS_CTL 0x15A0
28#define SCSS_CPU1CORE_RESET 0xD80
29#define SCSS_DBG_STATUS_CORE_PWRDUP 0xE64
30
31extern void msm_secondary_startup(void);
32
33static DEFINE_SPINLOCK(boot_lock);
34
35static inline int get_core_count(void)
36{
37 /* 1 + the PART[1:0] field of MIDR */
38 return ((read_cpuid_id() >> 4) & 3) + 1;
39}
40
41static void msm_secondary_init(unsigned int cpu)
42{
43 /*
44 * let the primary processor know we're out of the
45 * pen, then head off into the C entry point
46 */
47 pen_release = -1;
48 smp_wmb();
49
50 /*
51 * Synchronise with the boot thread.
52 */
53 spin_lock(&boot_lock);
54 spin_unlock(&boot_lock);
55}
56
57static void prepare_cold_cpu(unsigned int cpu)
58{
59 int ret;
60 ret = scm_set_boot_addr(virt_to_phys(msm_secondary_startup),
61 SCM_FLAG_COLDBOOT_CPU1);
62 if (ret == 0) {
63 void __iomem *sc1_base_ptr;
64 sc1_base_ptr = ioremap_nocache(0x00902000, SZ_4K*2);
65 if (sc1_base_ptr) {
66 writel(0, sc1_base_ptr + VDD_SC1_ARRAY_CLAMP_GFS_CTL);
67 writel(0, sc1_base_ptr + SCSS_CPU1CORE_RESET);
68 writel(3, sc1_base_ptr + SCSS_DBG_STATUS_CORE_PWRDUP);
69 iounmap(sc1_base_ptr);
70 }
71 } else
72 printk(KERN_DEBUG "Failed to set secondary core boot "
73 "address\n");
74}
75
76static int msm_boot_secondary(unsigned int cpu, struct task_struct *idle)
77{
78 unsigned long timeout;
79 static int cold_boot_done;
80
81 /* Only need to bring cpu out of reset this way once */
82 if (cold_boot_done == false) {
83 prepare_cold_cpu(cpu);
84 cold_boot_done = true;
85 }
86
87 /*
88 * set synchronisation state between this boot processor
89 * and the secondary one
90 */
91 spin_lock(&boot_lock);
92
93 /*
94 * The secondary processor is waiting to be released from
95 * the holding pen - release it, then wait for it to flag
96 * that it has been released by resetting pen_release.
97 *
98 * Note that "pen_release" is the hardware CPU ID, whereas
99 * "cpu" is Linux's internal ID.
100 */
101 pen_release = cpu_logical_map(cpu);
102 sync_cache_w(&pen_release);
103
104 /*
105 * Send the secondary CPU a soft interrupt, thereby causing
106 * the boot monitor to read the system wide flags register,
107 * and branch to the address found there.
108 */
109 arch_send_wakeup_ipi_mask(cpumask_of(cpu));
110
111 timeout = jiffies + (1 * HZ);
112 while (time_before(jiffies, timeout)) {
113 smp_rmb();
114 if (pen_release == -1)
115 break;
116
117 udelay(10);
118 }
119
120 /*
121 * now the secondary core is starting up let it run its
122 * calibrations, then wait for it to finish
123 */
124 spin_unlock(&boot_lock);
125
126 return pen_release != -1 ? -ENOSYS : 0;
127}
128
129/*
130 * Initialise the CPU possible map early - this describes the CPUs
131 * which may be present or become present in the system. The msm8x60
132 * does not support the ARM SCU, so just set the possible cpu mask to
133 * NR_CPUS.
134 */
135static void __init msm_smp_init_cpus(void)
136{
137 unsigned int i, ncores = get_core_count();
138
139 if (ncores > nr_cpu_ids) {
140 pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",
141 ncores, nr_cpu_ids);
142 ncores = nr_cpu_ids;
143 }
144
145 for (i = 0; i < ncores; i++)
146 set_cpu_possible(i, true);
147}
148
149static void __init msm_smp_prepare_cpus(unsigned int max_cpus)
150{
151}
152
153struct smp_operations msm_smp_ops __initdata = {
154 .smp_init_cpus = msm_smp_init_cpus,
155 .smp_prepare_cpus = msm_smp_prepare_cpus,
156 .smp_secondary_init = msm_secondary_init,
157 .smp_boot_secondary = msm_boot_secondary,
158#ifdef CONFIG_HOTPLUG_CPU
159 .cpu_die = msm_cpu_die,
160#endif
161};
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c
deleted file mode 100644
index fd1644987534..000000000000
--- a/arch/arm/mach-msm/timer.c
+++ /dev/null
@@ -1,333 +0,0 @@
1/*
2 *
3 * Copyright (C) 2007 Google, Inc.
4 * Copyright (c) 2009-2012, The Linux Foundation. All rights reserved.
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
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 */
16
17#include <linux/clocksource.h>
18#include <linux/clockchips.h>
19#include <linux/cpu.h>
20#include <linux/init.h>
21#include <linux/interrupt.h>
22#include <linux/irq.h>
23#include <linux/io.h>
24#include <linux/of.h>
25#include <linux/of_address.h>
26#include <linux/of_irq.h>
27#include <linux/sched_clock.h>
28
29#include <asm/mach/time.h>
30
31#include "common.h"
32
33#define TIMER_MATCH_VAL 0x0000
34#define TIMER_COUNT_VAL 0x0004
35#define TIMER_ENABLE 0x0008
36#define TIMER_ENABLE_CLR_ON_MATCH_EN BIT(1)
37#define TIMER_ENABLE_EN BIT(0)
38#define TIMER_CLEAR 0x000C
39#define DGT_CLK_CTL 0x10
40#define DGT_CLK_CTL_DIV_4 0x3
41#define TIMER_STS_GPT0_CLR_PEND BIT(10)
42
43#define GPT_HZ 32768
44
45#define MSM_DGT_SHIFT 5
46
47static void __iomem *event_base;
48static void __iomem *sts_base;
49
50static irqreturn_t msm_timer_interrupt(int irq, void *dev_id)
51{
52 struct clock_event_device *evt = dev_id;
53 /* Stop the timer tick */
54 if (evt->mode == CLOCK_EVT_MODE_ONESHOT) {
55 u32 ctrl = readl_relaxed(event_base + TIMER_ENABLE);
56 ctrl &= ~TIMER_ENABLE_EN;
57 writel_relaxed(ctrl, event_base + TIMER_ENABLE);
58 }
59 evt->event_handler(evt);
60 return IRQ_HANDLED;
61}
62
63static int msm_timer_set_next_event(unsigned long cycles,
64 struct clock_event_device *evt)
65{
66 u32 ctrl = readl_relaxed(event_base + TIMER_ENABLE);
67
68 ctrl &= ~TIMER_ENABLE_EN;
69 writel_relaxed(ctrl, event_base + TIMER_ENABLE);
70
71 writel_relaxed(ctrl, event_base + TIMER_CLEAR);
72 writel_relaxed(cycles, event_base + TIMER_MATCH_VAL);
73
74 if (sts_base)
75 while (readl_relaxed(sts_base) & TIMER_STS_GPT0_CLR_PEND)
76 cpu_relax();
77
78 writel_relaxed(ctrl | TIMER_ENABLE_EN, event_base + TIMER_ENABLE);
79 return 0;
80}
81
82static void msm_timer_set_mode(enum clock_event_mode mode,
83 struct clock_event_device *evt)
84{
85 u32 ctrl;
86
87 ctrl = readl_relaxed(event_base + TIMER_ENABLE);
88 ctrl &= ~(TIMER_ENABLE_EN | TIMER_ENABLE_CLR_ON_MATCH_EN);
89
90 switch (mode) {
91 case CLOCK_EVT_MODE_RESUME:
92 case CLOCK_EVT_MODE_PERIODIC:
93 break;
94 case CLOCK_EVT_MODE_ONESHOT:
95 /* Timer is enabled in set_next_event */
96 break;
97 case CLOCK_EVT_MODE_UNUSED:
98 case CLOCK_EVT_MODE_SHUTDOWN:
99 break;
100 }
101 writel_relaxed(ctrl, event_base + TIMER_ENABLE);
102}
103
104static struct clock_event_device __percpu *msm_evt;
105
106static void __iomem *source_base;
107
108static notrace cycle_t msm_read_timer_count(struct clocksource *cs)
109{
110 return readl_relaxed(source_base + TIMER_COUNT_VAL);
111}
112
113static notrace cycle_t msm_read_timer_count_shift(struct clocksource *cs)
114{
115 /*
116 * Shift timer count down by a constant due to unreliable lower bits
117 * on some targets.
118 */
119 return msm_read_timer_count(cs) >> MSM_DGT_SHIFT;
120}
121
122static struct clocksource msm_clocksource = {
123 .name = "dg_timer",
124 .rating = 300,
125 .read = msm_read_timer_count,
126 .mask = CLOCKSOURCE_MASK(32),
127 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
128};
129
130static int msm_timer_irq;
131static int msm_timer_has_ppi;
132
133static int msm_local_timer_setup(struct clock_event_device *evt)
134{
135 int cpu = smp_processor_id();
136 int err;
137
138 evt->irq = msm_timer_irq;
139 evt->name = "msm_timer";
140 evt->features = CLOCK_EVT_FEAT_ONESHOT;
141 evt->rating = 200;
142 evt->set_mode = msm_timer_set_mode;
143 evt->set_next_event = msm_timer_set_next_event;
144 evt->cpumask = cpumask_of(cpu);
145
146 clockevents_config_and_register(evt, GPT_HZ, 4, 0xffffffff);
147
148 if (msm_timer_has_ppi) {
149 enable_percpu_irq(evt->irq, IRQ_TYPE_EDGE_RISING);
150 } else {
151 err = request_irq(evt->irq, msm_timer_interrupt,
152 IRQF_TIMER | IRQF_NOBALANCING |
153 IRQF_TRIGGER_RISING, "gp_timer", evt);
154 if (err)
155 pr_err("request_irq failed\n");
156 }
157
158 return 0;
159}
160
161static void msm_local_timer_stop(struct clock_event_device *evt)
162{
163 evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt);
164 disable_percpu_irq(evt->irq);
165}
166
167static int msm_timer_cpu_notify(struct notifier_block *self,
168 unsigned long action, void *hcpu)
169{
170 /*
171 * Grab cpu pointer in each case to avoid spurious
172 * preemptible warnings
173 */
174 switch (action & ~CPU_TASKS_FROZEN) {
175 case CPU_STARTING:
176 msm_local_timer_setup(this_cpu_ptr(msm_evt));
177 break;
178 case CPU_DYING:
179 msm_local_timer_stop(this_cpu_ptr(msm_evt));
180 break;
181 }
182
183 return NOTIFY_OK;
184}
185
186static struct notifier_block msm_timer_cpu_nb = {
187 .notifier_call = msm_timer_cpu_notify,
188};
189
190static u64 notrace msm_sched_clock_read(void)
191{
192 return msm_clocksource.read(&msm_clocksource);
193}
194
195static void __init msm_timer_init(u32 dgt_hz, int sched_bits, int irq,
196 bool percpu)
197{
198 struct clocksource *cs = &msm_clocksource;
199 int res = 0;
200
201 msm_timer_irq = irq;
202 msm_timer_has_ppi = percpu;
203
204 msm_evt = alloc_percpu(struct clock_event_device);
205 if (!msm_evt) {
206 pr_err("memory allocation failed for clockevents\n");
207 goto err;
208 }
209
210 if (percpu)
211 res = request_percpu_irq(irq, msm_timer_interrupt,
212 "gp_timer", msm_evt);
213
214 if (res) {
215 pr_err("request_percpu_irq failed\n");
216 } else {
217 res = register_cpu_notifier(&msm_timer_cpu_nb);
218 if (res) {
219 free_percpu_irq(irq, msm_evt);
220 goto err;
221 }
222
223 /* Immediately configure the timer on the boot CPU */
224 msm_local_timer_setup(__this_cpu_ptr(msm_evt));
225 }
226
227err:
228 writel_relaxed(TIMER_ENABLE_EN, source_base + TIMER_ENABLE);
229 res = clocksource_register_hz(cs, dgt_hz);
230 if (res)
231 pr_err("clocksource_register failed\n");
232 sched_clock_register(msm_sched_clock_read, sched_bits, dgt_hz);
233}
234
235#ifdef CONFIG_OF
236static void __init msm_dt_timer_init(struct device_node *np)
237{
238 u32 freq;
239 int irq;
240 struct resource res;
241 u32 percpu_offset;
242 void __iomem *base;
243 void __iomem *cpu0_base;
244
245 base = of_iomap(np, 0);
246 if (!base) {
247 pr_err("Failed to map event base\n");
248 return;
249 }
250
251 /* We use GPT0 for the clockevent */
252 irq = irq_of_parse_and_map(np, 1);
253 if (irq <= 0) {
254 pr_err("Can't get irq\n");
255 return;
256 }
257
258 /* We use CPU0's DGT for the clocksource */
259 if (of_property_read_u32(np, "cpu-offset", &percpu_offset))
260 percpu_offset = 0;
261
262 if (of_address_to_resource(np, 0, &res)) {
263 pr_err("Failed to parse DGT resource\n");
264 return;
265 }
266
267 cpu0_base = ioremap(res.start + percpu_offset, resource_size(&res));
268 if (!cpu0_base) {
269 pr_err("Failed to map source base\n");
270 return;
271 }
272
273 if (of_property_read_u32(np, "clock-frequency", &freq)) {
274 pr_err("Unknown frequency\n");
275 return;
276 }
277
278 event_base = base + 0x4;
279 sts_base = base + 0x88;
280 source_base = cpu0_base + 0x24;
281 freq /= 4;
282 writel_relaxed(DGT_CLK_CTL_DIV_4, source_base + DGT_CLK_CTL);
283
284 msm_timer_init(freq, 32, irq, !!percpu_offset);
285}
286CLOCKSOURCE_OF_DECLARE(kpss_timer, "qcom,kpss-timer", msm_dt_timer_init);
287CLOCKSOURCE_OF_DECLARE(scss_timer, "qcom,scss-timer", msm_dt_timer_init);
288#endif
289
290static int __init msm_timer_map(phys_addr_t addr, u32 event, u32 source,
291 u32 sts)
292{
293 void __iomem *base;
294
295 base = ioremap(addr, SZ_256);
296 if (!base) {
297 pr_err("Failed to map timer base\n");
298 return -ENOMEM;
299 }
300 event_base = base + event;
301 source_base = base + source;
302 if (sts)
303 sts_base = base + sts;
304
305 return 0;
306}
307
308void __init msm7x01_timer_init(void)
309{
310 struct clocksource *cs = &msm_clocksource;
311
312 if (msm_timer_map(0xc0100000, 0x0, 0x10, 0x0))
313 return;
314 cs->read = msm_read_timer_count_shift;
315 cs->mask = CLOCKSOURCE_MASK((32 - MSM_DGT_SHIFT));
316 /* 600 KHz */
317 msm_timer_init(19200000 >> MSM_DGT_SHIFT, 32 - MSM_DGT_SHIFT, 7,
318 false);
319}
320
321void __init msm7x30_timer_init(void)
322{
323 if (msm_timer_map(0xc0100000, 0x4, 0x24, 0x80))
324 return;
325 msm_timer_init(24576000 / 4, 32, 1, false);
326}
327
328void __init qsd8x50_timer_init(void)
329{
330 if (msm_timer_map(0xAC100000, 0x0, 0x10, 0x34))
331 return;
332 msm_timer_init(19200000 / 4, 32, 7, false);
333}
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c
index 75062eff2494..e6ac679bece9 100644
--- a/arch/arm/mach-mv78xx0/common.c
+++ b/arch/arm/mach-mv78xx0/common.c
@@ -15,11 +15,11 @@
15#include <linux/ata_platform.h> 15#include <linux/ata_platform.h>
16#include <linux/clk-provider.h> 16#include <linux/clk-provider.h>
17#include <linux/ethtool.h> 17#include <linux/ethtool.h>
18#include <asm/hardware/cache-feroceon-l2.h>
18#include <asm/mach/map.h> 19#include <asm/mach/map.h>
19#include <asm/mach/time.h> 20#include <asm/mach/time.h>
20#include <mach/mv78xx0.h> 21#include <mach/mv78xx0.h>
21#include <mach/bridge-regs.h> 22#include <mach/bridge-regs.h>
22#include <plat/cache-feroceon-l2.h>
23#include <linux/platform_data/usb-ehci-orion.h> 23#include <linux/platform_data/usb-ehci-orion.h>
24#include <linux/platform_data/mtd-orion_nand.h> 24#include <linux/platform_data/mtd-orion_nand.h>
25#include <plat/time.h> 25#include <plat/time.h>
diff --git a/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h b/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h
index 5f03484584d4..e20d6da234a6 100644
--- a/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h
+++ b/arch/arm/mach-mv78xx0/include/mach/bridge-regs.h
@@ -15,6 +15,7 @@
15#define L2_WRITETHROUGH 0x00020000 15#define L2_WRITETHROUGH 0x00020000
16 16
17#define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108) 17#define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108)
18#define RSTOUTn_MASK_PHYS (BRIDGE_PHYS_BASE + 0x0108)
18#define SOFT_RESET_OUT_EN 0x00000004 19#define SOFT_RESET_OUT_EN 0x00000004
19 20
20#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c) 21#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c)
diff --git a/arch/arm/mach-mv78xx0/include/mach/timex.h b/arch/arm/mach-mv78xx0/include/mach/timex.h
deleted file mode 100644
index 0e8c443c723a..000000000000
--- a/arch/arm/mach-mv78xx0/include/mach/timex.h
+++ /dev/null
@@ -1,9 +0,0 @@
1/*
2 * arch/arm/mach-mv78xx0/include/mach/timex.h
3 *
4 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied.
7 */
8
9#define CLOCK_TICK_RATE (100 * HZ)
diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
index 5e269d7263ce..3f73eecbcfb0 100644
--- a/arch/arm/mach-mvebu/Kconfig
+++ b/arch/arm/mach-mvebu/Kconfig
@@ -1,51 +1,109 @@
1config ARCH_MVEBU 1config ARCH_MVEBU
2 bool "Marvell SOCs with Device Tree support" if ARCH_MULTI_V7 2 bool "Marvell Engineering Business Unit (MVEBU) SoCs" if (ARCH_MULTI_V7 || ARCH_MULTI_V5)
3 select ARCH_SUPPORTS_BIG_ENDIAN 3 select ARCH_SUPPORTS_BIG_ENDIAN
4 select CLKSRC_MMIO 4 select CLKSRC_MMIO
5 select COMMON_CLK
6 select GENERIC_CLOCKEVENTS
7 select GENERIC_IRQ_CHIP 5 select GENERIC_IRQ_CHIP
8 select IRQ_DOMAIN 6 select IRQ_DOMAIN
9 select MULTI_IRQ_HANDLER
10 select PINCTRL 7 select PINCTRL
11 select PLAT_ORION 8 select PLAT_ORION
12 select SPARSE_IRQ
13 select CLKDEV_LOOKUP
14 select MVEBU_MBUS 9 select MVEBU_MBUS
15 select ZONE_DMA if ARM_LPAE 10 select ZONE_DMA if ARM_LPAE
16 select ARCH_REQUIRE_GPIOLIB 11 select ARCH_REQUIRE_GPIOLIB
17 select MIGHT_HAVE_PCI 12 select MIGHT_HAVE_PCI
18 select PCI_QUIRKS if PCI 13 select PCI_QUIRKS if PCI
14 select OF_ADDRESS_PCI
19 15
20if ARCH_MVEBU 16if ARCH_MVEBU
21 17
22menu "Marvell SOC with device tree" 18menu "Marvell EBU SoC variants"
23 19
24config MACH_ARMADA_370_XP 20config MACH_MVEBU_V7
25 bool 21 bool
26 select ARMADA_370_XP_TIMER 22 select ARMADA_370_XP_TIMER
27 select HAVE_SMP
28 select CACHE_L2X0 23 select CACHE_L2X0
29 select CPU_PJ4B
30 24
31config MACH_ARMADA_370 25config MACH_ARMADA_370
32 bool "Marvell Armada 370 boards" 26 bool "Marvell Armada 370 boards" if ARCH_MULTI_V7
33 select ARMADA_370_CLK 27 select ARMADA_370_CLK
34 select MACH_ARMADA_370_XP 28 select CPU_PJ4B
29 select MACH_MVEBU_V7
35 select PINCTRL_ARMADA_370 30 select PINCTRL_ARMADA_370
36 help 31 help
37 Say 'Y' here if you want your kernel to support boards based 32 Say 'Y' here if you want your kernel to support boards based
38 on the Marvell Armada 370 SoC with device tree. 33 on the Marvell Armada 370 SoC with device tree.
39 34
35config MACH_ARMADA_375
36 bool "Marvell Armada 375 boards" if ARCH_MULTI_V7
37 select ARM_ERRATA_720789
38 select ARM_ERRATA_753970
39 select ARM_GIC
40 select ARMADA_375_CLK
41 select CPU_V7
42 select MACH_MVEBU_V7
43 select PINCTRL_ARMADA_375
44 help
45 Say 'Y' here if you want your kernel to support boards based
46 on the Marvell Armada 375 SoC with device tree.
47
48config MACH_ARMADA_38X
49 bool "Marvell Armada 380/385 boards" if ARCH_MULTI_V7
50 select ARM_ERRATA_720789
51 select ARM_ERRATA_753970
52 select ARM_GIC
53 select ARMADA_38X_CLK
54 select CPU_V7
55 select MACH_MVEBU_V7
56 select PINCTRL_ARMADA_38X
57 help
58 Say 'Y' here if you want your kernel to support boards based
59 on the Marvell Armada 380/385 SoC with device tree.
60
40config MACH_ARMADA_XP 61config MACH_ARMADA_XP
41 bool "Marvell Armada XP boards" 62 bool "Marvell Armada XP boards" if ARCH_MULTI_V7
42 select ARMADA_XP_CLK 63 select ARMADA_XP_CLK
43 select MACH_ARMADA_370_XP 64 select CPU_PJ4B
65 select MACH_MVEBU_V7
44 select PINCTRL_ARMADA_XP 66 select PINCTRL_ARMADA_XP
45 help 67 help
46 Say 'Y' here if you want your kernel to support boards based 68 Say 'Y' here if you want your kernel to support boards based
47 on the Marvell Armada XP SoC with device tree. 69 on the Marvell Armada XP SoC with device tree.
48 70
71config MACH_DOVE
72 bool "Marvell Dove boards" if ARCH_MULTI_V7
73 select CACHE_L2X0
74 select CPU_PJ4
75 select DOVE_CLK
76 select ORION_IRQCHIP
77 select ORION_TIMER
78 select PINCTRL_DOVE
79 help
80 Say 'Y' here if you want your kernel to support the
81 Marvell Dove using flattened device tree.
82
83config MACH_KIRKWOOD
84 bool "Marvell Kirkwood boards" if ARCH_MULTI_V5
85 select ARCH_HAS_CPUFREQ
86 select ARCH_REQUIRE_GPIOLIB
87 select CPU_FEROCEON
88 select KIRKWOOD_CLK
89 select OF_IRQ
90 select ORION_IRQCHIP
91 select ORION_TIMER
92 select PCI
93 select PCI_QUIRKS
94 select PINCTRL_KIRKWOOD
95 select USE_OF
96 help
97 Say 'Y' here if you want your kernel to support boards based
98 on the Marvell Kirkwood device tree.
99
100config MACH_T5325
101 bool "HP T5325 thin client"
102 depends on MACH_KIRKWOOD
103 help
104 Say 'Y' here if you want your kernel to support the
105 HP T5325 Thin client
106
49endmenu 107endmenu
50 108
51endif 109endif
diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile
index 878aebe98dcc..a63e43b6b451 100644
--- a/arch/arm/mach-mvebu/Makefile
+++ b/arch/arm/mach-mvebu/Makefile
@@ -4,7 +4,10 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
4AFLAGS_coherency_ll.o := -Wa,-march=armv7-a 4AFLAGS_coherency_ll.o := -Wa,-march=armv7-a
5 5
6obj-y += system-controller.o mvebu-soc-id.o 6obj-y += system-controller.o mvebu-soc-id.o
7obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o 7obj-$(CONFIG_MACH_MVEBU_V7) += board-v7.o
8obj-$(CONFIG_MACH_DOVE) += dove.o
8obj-$(CONFIG_ARCH_MVEBU) += coherency.o coherency_ll.o pmsu.o 9obj-$(CONFIG_ARCH_MVEBU) += coherency.o coherency_ll.o pmsu.o
9obj-$(CONFIG_SMP) += platsmp.o headsmp.o 10obj-$(CONFIG_SMP) += platsmp.o headsmp.o
10obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 11obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
12obj-$(CONFIG_MACH_KIRKWOOD) += kirkwood.o kirkwood-pm.o
13obj-$(CONFIG_MACH_T5325) += board-t5325.o
diff --git a/arch/arm/mach-mvebu/board-t5325.c b/arch/arm/mach-mvebu/board-t5325.c
new file mode 100644
index 000000000000..65ace6db9f28
--- /dev/null
+++ b/arch/arm/mach-mvebu/board-t5325.c
@@ -0,0 +1,41 @@
1/*
2 * HP T5325 Board Setup
3 *
4 * Copyright (C) 2014
5 *
6 * Andrew Lunn <andrew@lunn.ch>
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/i2c.h>
15#include <linux/init.h>
16#include <linux/platform_device.h>
17#include <sound/alc5623.h>
18#include "board.h"
19
20static struct platform_device hp_t5325_audio_device = {
21 .name = "t5325-audio",
22 .id = -1,
23};
24
25static struct alc5623_platform_data alc5621_data = {
26 .add_ctrl = 0x3700,
27 .jack_det_ctrl = 0x4810,
28};
29
30static struct i2c_board_info i2c_board_info[] __initdata = {
31 {
32 I2C_BOARD_INFO("alc5621", 0x1a),
33 .platform_data = &alc5621_data,
34 },
35};
36
37void __init t5325_init(void)
38{
39 i2c_register_board_info(0, i2c_board_info, ARRAY_SIZE(i2c_board_info));
40 platform_device_register(&hp_t5325_audio_device);
41}
diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/board-v7.c
index f6c9d1d85c14..333fca8fdc41 100644
--- a/arch/arm/mach-mvebu/armada-370-xp.c
+++ b/arch/arm/mach-mvebu/board-v7.c
@@ -21,6 +21,7 @@
21#include <linux/clocksource.h> 21#include <linux/clocksource.h>
22#include <linux/dma-mapping.h> 22#include <linux/dma-mapping.h>
23#include <linux/mbus.h> 23#include <linux/mbus.h>
24#include <linux/signal.h>
24#include <linux/slab.h> 25#include <linux/slab.h>
25#include <asm/hardware/cache-l2x0.h> 26#include <asm/hardware/cache-l2x0.h>
26#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
@@ -31,12 +32,28 @@
31#include "coherency.h" 32#include "coherency.h"
32#include "mvebu-soc-id.h" 33#include "mvebu-soc-id.h"
33 34
34static void __init armada_370_xp_map_io(void) 35/*
36 * Early versions of Armada 375 SoC have a bug where the BootROM
37 * leaves an external data abort pending. The kernel is hit by this
38 * data abort as soon as it enters userspace, because it unmasks the
39 * data aborts at this moment. We register a custom abort handler
40 * below to ignore the first data abort to work around this
41 * problem.
42 */
43static int armada_375_external_abort_wa(unsigned long addr, unsigned int fsr,
44 struct pt_regs *regs)
35{ 45{
36 debug_ll_io_init(); 46 static int ignore_first;
47
48 if (!ignore_first && fsr == 0x1406) {
49 ignore_first = 1;
50 return 0;
51 }
52
53 return 1;
37} 54}
38 55
39static void __init armada_370_xp_timer_and_clk_init(void) 56static void __init mvebu_timer_and_clk_init(void)
40{ 57{
41 of_clk_init(NULL); 58 of_clk_init(NULL);
42 clocksource_of_init(); 59 clocksource_of_init();
@@ -45,6 +62,10 @@ static void __init armada_370_xp_timer_and_clk_init(void)
45#ifdef CONFIG_CACHE_L2X0 62#ifdef CONFIG_CACHE_L2X0
46 l2x0_of_init(0, ~0UL); 63 l2x0_of_init(0, ~0UL);
47#endif 64#endif
65
66 if (of_machine_is_compatible("marvell,armada375"))
67 hook_fault_code(16 + 6, armada_375_external_abort_wa, SIGBUS, 0,
68 "imprecise external abort");
48} 69}
49 70
50static void __init i2c_quirk(void) 71static void __init i2c_quirk(void)
@@ -75,7 +96,7 @@ static void __init i2c_quirk(void)
75 return; 96 return;
76} 97}
77 98
78static void __init armada_370_xp_dt_init(void) 99static void __init mvebu_dt_init(void)
79{ 100{
80 if (of_machine_is_compatible("plathome,openblocks-ax3-4")) 101 if (of_machine_is_compatible("plathome,openblocks-ax3-4"))
81 i2c_quirk(); 102 i2c_quirk();
@@ -87,11 +108,33 @@ static const char * const armada_370_xp_dt_compat[] = {
87 NULL, 108 NULL,
88}; 109};
89 110
90DT_MACHINE_START(ARMADA_XP_DT, "Marvell Armada 370/XP (Device Tree)") 111DT_MACHINE_START(ARMADA_370_XP_DT, "Marvell Armada 370/XP (Device Tree)")
91 .smp = smp_ops(armada_xp_smp_ops), 112 .smp = smp_ops(armada_xp_smp_ops),
92 .init_machine = armada_370_xp_dt_init, 113 .init_machine = mvebu_dt_init,
93 .map_io = armada_370_xp_map_io, 114 .init_time = mvebu_timer_and_clk_init,
94 .init_time = armada_370_xp_timer_and_clk_init,
95 .restart = mvebu_restart, 115 .restart = mvebu_restart,
96 .dt_compat = armada_370_xp_dt_compat, 116 .dt_compat = armada_370_xp_dt_compat,
97MACHINE_END 117MACHINE_END
118
119static const char * const armada_375_dt_compat[] = {
120 "marvell,armada375",
121 NULL,
122};
123
124DT_MACHINE_START(ARMADA_375_DT, "Marvell Armada 375 (Device Tree)")
125 .init_time = mvebu_timer_and_clk_init,
126 .restart = mvebu_restart,
127 .dt_compat = armada_375_dt_compat,
128MACHINE_END
129
130static const char * const armada_38x_dt_compat[] = {
131 "marvell,armada380",
132 "marvell,armada385",
133 NULL,
134};
135
136DT_MACHINE_START(ARMADA_38X_DT, "Marvell Armada 380/385 (Device Tree)")
137 .init_time = mvebu_timer_and_clk_init,
138 .restart = mvebu_restart,
139 .dt_compat = armada_38x_dt_compat,
140MACHINE_END
diff --git a/arch/arm/mach-mvebu/board.h b/arch/arm/mach-mvebu/board.h
new file mode 100644
index 000000000000..de7f0a191394
--- /dev/null
+++ b/arch/arm/mach-mvebu/board.h
@@ -0,0 +1,22 @@
1/*
2 * Board functions for Marvell System On Chip
3 *
4 * Copyright (C) 2014
5 *
6 * Andrew Lunn <andrew@lunn.ch>
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#ifndef __ARCH_MVEBU_BOARD_H
14#define __ARCH_MVEBU_BOARD_H
15
16#ifdef CONFIG_MACH_T5325
17void t5325_init(void);
18#else
19static inline void t5325_init(void) {};
20#endif
21
22#endif
diff --git a/arch/arm/mach-dove/board-dt.c b/arch/arm/mach-mvebu/dove.c
index 49fa9abd09da..5e5a43624237 100644
--- a/arch/arm/mach-dove/board-dt.c
+++ b/arch/arm/mach-mvebu/dove.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * arch/arm/mach-dove/board-dt.c 2 * arch/arm/mach-mvebu/dove.c
3 * 3 *
4 * Marvell Dove 88AP510 System On Chip FDT Board 4 * Marvell Dove 88AP510 System On Chip FDT Board
5 * 5 *
@@ -9,17 +9,14 @@
9 */ 9 */
10 10
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/clk-provider.h> 12#include <linux/mbus.h>
13#include <linux/of.h> 13#include <linux/of.h>
14#include <linux/of_platform.h> 14#include <linux/of_platform.h>
15#include <asm/hardware/cache-tauros2.h> 15#include <asm/hardware/cache-tauros2.h>
16#include <asm/mach/arch.h> 16#include <asm/mach/arch.h>
17#include <mach/dove.h>
18#include <mach/pm.h>
19#include <plat/common.h>
20#include "common.h" 17#include "common.h"
21 18
22static void __init dove_dt_init(void) 19static void __init dove_init(void)
23{ 20{
24 pr_info("Dove 88AP510 SoC\n"); 21 pr_info("Dove 88AP510 SoC\n");
25 22
@@ -30,14 +27,13 @@ static void __init dove_dt_init(void)
30 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 27 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
31} 28}
32 29
33static const char * const dove_dt_board_compat[] = { 30static const char * const dove_dt_compat[] = {
34 "marvell,dove", 31 "marvell,dove",
35 NULL 32 NULL
36}; 33};
37 34
38DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)") 35DT_MACHINE_START(DOVE_DT, "Marvell Dove")
39 .map_io = dove_map_io, 36 .init_machine = dove_init,
40 .init_machine = dove_dt_init, 37 .restart = mvebu_restart,
41 .restart = dove_restart, 38 .dt_compat = dove_dt_compat,
42 .dt_compat = dove_dt_board_compat,
43MACHINE_END 39MACHINE_END
diff --git a/arch/arm/mach-mvebu/kirkwood-pm.c b/arch/arm/mach-mvebu/kirkwood-pm.c
new file mode 100644
index 000000000000..cbb816f2120c
--- /dev/null
+++ b/arch/arm/mach-mvebu/kirkwood-pm.c
@@ -0,0 +1,76 @@
1/*
2 * Power Management driver for Marvell Kirkwood SoCs
3 *
4 * Copyright (C) 2013 Ezequiel Garcia <ezequiel@free-electrons.com>
5 * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com>
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,
9 * 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
17#include <linux/kernel.h>
18#include <linux/suspend.h>
19#include <linux/io.h>
20#include "kirkwood.h"
21
22static void __iomem *ddr_operation_base;
23static void __iomem *memory_pm_ctrl;
24
25static void kirkwood_low_power(void)
26{
27 u32 mem_pm_ctrl;
28
29 mem_pm_ctrl = readl(memory_pm_ctrl);
30
31 /* Set peripherals to low-power mode */
32 writel_relaxed(~0, memory_pm_ctrl);
33
34 /* Set DDR in self-refresh */
35 writel_relaxed(0x7, ddr_operation_base);
36
37 /*
38 * Set CPU in wait-for-interrupt state.
39 * This disables the CPU core clocks,
40 * the array clocks, and also the L2 controller.
41 */
42 cpu_do_idle();
43
44 writel_relaxed(mem_pm_ctrl, memory_pm_ctrl);
45}
46
47static int kirkwood_suspend_enter(suspend_state_t state)
48{
49 switch (state) {
50 case PM_SUSPEND_STANDBY:
51 kirkwood_low_power();
52 break;
53 default:
54 return -EINVAL;
55 }
56 return 0;
57}
58
59static int kirkwood_pm_valid_standby(suspend_state_t state)
60{
61 return state == PM_SUSPEND_STANDBY;
62}
63
64static const struct platform_suspend_ops kirkwood_suspend_ops = {
65 .enter = kirkwood_suspend_enter,
66 .valid = kirkwood_pm_valid_standby,
67};
68
69int __init kirkwood_pm_init(void)
70{
71 ddr_operation_base = ioremap(DDR_OPERATION_BASE, 4);
72 memory_pm_ctrl = ioremap(MEMORY_PM_CTRL_PHYS, 4);
73
74 suspend_set_ops(&kirkwood_suspend_ops);
75 return 0;
76}
diff --git a/arch/arm/mach-mvebu/kirkwood-pm.h b/arch/arm/mach-mvebu/kirkwood-pm.h
new file mode 100644
index 000000000000..21e7530f368b
--- /dev/null
+++ b/arch/arm/mach-mvebu/kirkwood-pm.h
@@ -0,0 +1,26 @@
1/*
2 * Power Management driver for Marvell Kirkwood SoCs
3 *
4 * Copyright (C) 2013 Ezequiel Garcia <ezequiel@free-electrons.com>
5 * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com>
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,
9 * 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
17#ifndef __ARCH_KIRKWOOD_PM_H
18#define __ARCH_KIRKWOOD_PM_H
19
20#ifdef CONFIG_PM
21void kirkwood_pm_init(void);
22#else
23static inline void kirkwood_pm_init(void) {};
24#endif
25
26#endif
diff --git a/arch/arm/mach-mvebu/kirkwood.c b/arch/arm/mach-mvebu/kirkwood.c
new file mode 100644
index 000000000000..120207fc36f1
--- /dev/null
+++ b/arch/arm/mach-mvebu/kirkwood.c
@@ -0,0 +1,199 @@
1/*
2 * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
3 *
4 * arch/arm/mach-mvebu/kirkwood.c
5 *
6 * Flattened Device Tree board initialization
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/clk.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/mbus.h>
17#include <linux/of.h>
18#include <linux/of_address.h>
19#include <linux/of_net.h>
20#include <linux/of_platform.h>
21#include <linux/slab.h>
22#include <asm/hardware/cache-feroceon-l2.h>
23#include <asm/mach/arch.h>
24#include <asm/mach/map.h>
25#include "kirkwood.h"
26#include "kirkwood-pm.h"
27#include "common.h"
28#include "board.h"
29
30static struct resource kirkwood_cpufreq_resources[] = {
31 [0] = {
32 .start = CPU_CONTROL_PHYS,
33 .end = CPU_CONTROL_PHYS + 3,
34 .flags = IORESOURCE_MEM,
35 },
36};
37
38static struct platform_device kirkwood_cpufreq_device = {
39 .name = "kirkwood-cpufreq",
40 .id = -1,
41 .num_resources = ARRAY_SIZE(kirkwood_cpufreq_resources),
42 .resource = kirkwood_cpufreq_resources,
43};
44
45static void __init kirkwood_cpufreq_init(void)
46{
47 platform_device_register(&kirkwood_cpufreq_device);
48}
49
50static struct resource kirkwood_cpuidle_resource[] = {
51 {
52 .flags = IORESOURCE_MEM,
53 .start = DDR_OPERATION_BASE,
54 .end = DDR_OPERATION_BASE + 3,
55 },
56};
57
58static struct platform_device kirkwood_cpuidle = {
59 .name = "kirkwood_cpuidle",
60 .id = -1,
61 .resource = kirkwood_cpuidle_resource,
62 .num_resources = 1,
63};
64
65static void __init kirkwood_cpuidle_init(void)
66{
67 platform_device_register(&kirkwood_cpuidle);
68}
69
70#define MV643XX_ETH_MAC_ADDR_LOW 0x0414
71#define MV643XX_ETH_MAC_ADDR_HIGH 0x0418
72
73static void __init kirkwood_dt_eth_fixup(void)
74{
75 struct device_node *np;
76
77 /*
78 * The ethernet interfaces forget the MAC address assigned by u-boot
79 * if the clocks are turned off. Usually, u-boot on kirkwood boards
80 * has no DT support to properly set local-mac-address property.
81 * As a workaround, we get the MAC address from mv643xx_eth registers
82 * and update the port device node if no valid MAC address is set.
83 */
84 for_each_compatible_node(np, NULL, "marvell,kirkwood-eth-port") {
85 struct device_node *pnp = of_get_parent(np);
86 struct clk *clk;
87 struct property *pmac;
88 void __iomem *io;
89 u8 *macaddr;
90 u32 reg;
91
92 if (!pnp)
93 continue;
94
95 /* skip disabled nodes or nodes with valid MAC address*/
96 if (!of_device_is_available(pnp) || of_get_mac_address(np))
97 goto eth_fixup_skip;
98
99 clk = of_clk_get(pnp, 0);
100 if (IS_ERR(clk))
101 goto eth_fixup_skip;
102
103 io = of_iomap(pnp, 0);
104 if (!io)
105 goto eth_fixup_no_map;
106
107 /* ensure port clock is not gated to not hang CPU */
108 clk_prepare_enable(clk);
109
110 /* store MAC address register contents in local-mac-address */
111 pr_err(FW_INFO "%s: local-mac-address is not set\n",
112 np->full_name);
113
114 pmac = kzalloc(sizeof(*pmac) + 6, GFP_KERNEL);
115 if (!pmac)
116 goto eth_fixup_no_mem;
117
118 pmac->value = pmac + 1;
119 pmac->length = 6;
120 pmac->name = kstrdup("local-mac-address", GFP_KERNEL);
121 if (!pmac->name) {
122 kfree(pmac);
123 goto eth_fixup_no_mem;
124 }
125
126 macaddr = pmac->value;
127 reg = readl(io + MV643XX_ETH_MAC_ADDR_HIGH);
128 macaddr[0] = (reg >> 24) & 0xff;
129 macaddr[1] = (reg >> 16) & 0xff;
130 macaddr[2] = (reg >> 8) & 0xff;
131 macaddr[3] = reg & 0xff;
132
133 reg = readl(io + MV643XX_ETH_MAC_ADDR_LOW);
134 macaddr[4] = (reg >> 8) & 0xff;
135 macaddr[5] = reg & 0xff;
136
137 of_update_property(np, pmac);
138
139eth_fixup_no_mem:
140 iounmap(io);
141 clk_disable_unprepare(clk);
142eth_fixup_no_map:
143 clk_put(clk);
144eth_fixup_skip:
145 of_node_put(pnp);
146 }
147}
148
149/*
150 * Disable propagation of mbus errors to the CPU local bus, as this
151 * causes mbus errors (which can occur for example for PCI aborts) to
152 * throw CPU aborts, which we're not set up to deal with.
153 */
154void kirkwood_disable_mbus_error_propagation(void)
155{
156 void __iomem *cpu_config;
157
158 cpu_config = ioremap(CPU_CONFIG_PHYS, 4);
159 writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config);
160}
161
162static struct of_dev_auxdata auxdata[] __initdata = {
163 OF_DEV_AUXDATA("marvell,kirkwood-audio", 0xf10a0000,
164 "mvebu-audio", NULL),
165 { /* sentinel */ }
166};
167
168static void __init kirkwood_dt_init(void)
169{
170 kirkwood_disable_mbus_error_propagation();
171
172 BUG_ON(mvebu_mbus_dt_init());
173
174#ifdef CONFIG_CACHE_FEROCEON_L2
175 feroceon_of_init();
176#endif
177 kirkwood_cpufreq_init();
178 kirkwood_cpuidle_init();
179
180 kirkwood_pm_init();
181 kirkwood_dt_eth_fixup();
182
183 if (of_machine_is_compatible("hp,t5325"))
184 t5325_init();
185
186 of_platform_populate(NULL, of_default_bus_match_table, auxdata, NULL);
187}
188
189static const char * const kirkwood_dt_board_compat[] = {
190 "marvell,kirkwood",
191 NULL
192};
193
194DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
195 /* Maintainer: Jason Cooper <jason@lakedaemon.net> */
196 .init_machine = kirkwood_dt_init,
197 .restart = mvebu_restart,
198 .dt_compat = kirkwood_dt_board_compat,
199MACHINE_END
diff --git a/arch/arm/mach-mvebu/kirkwood.h b/arch/arm/mach-mvebu/kirkwood.h
new file mode 100644
index 000000000000..89f3d1f51643
--- /dev/null
+++ b/arch/arm/mach-mvebu/kirkwood.h
@@ -0,0 +1,22 @@
1/*
2 * arch/arm/mach-mvebu/kirkwood.h
3 *
4 * Generic definitions for Marvell Kirkwood SoC flavors:
5 * 88F6180, 88F6192 and 88F6281.
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#define KIRKWOOD_REGS_PHYS_BASE 0xf1000000
13#define DDR_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x00000)
14#define BRIDGE_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x20000)
15
16#define DDR_OPERATION_BASE (DDR_PHYS_BASE + 0x1418)
17
18#define CPU_CONFIG_PHYS (BRIDGE_PHYS_BASE + 0x0100)
19#define CPU_CONFIG_ERROR_PROP 0x00000004
20
21#define CPU_CONTROL_PHYS (BRIDGE_PHYS_BASE + 0x0104)
22#define MEMORY_PM_CTRL_PHYS (BRIDGE_PHYS_BASE + 0x0118)
diff --git a/arch/arm/mach-mvebu/mvebu-soc-id.c b/arch/arm/mach-mvebu/mvebu-soc-id.c
index f3b325f6cbd4..f3d4cf53f746 100644
--- a/arch/arm/mach-mvebu/mvebu-soc-id.c
+++ b/arch/arm/mach-mvebu/mvebu-soc-id.c
@@ -38,6 +38,7 @@ static bool is_id_valid;
38static const struct of_device_id mvebu_pcie_of_match_table[] = { 38static const struct of_device_id mvebu_pcie_of_match_table[] = {
39 { .compatible = "marvell,armada-xp-pcie", }, 39 { .compatible = "marvell,armada-xp-pcie", },
40 { .compatible = "marvell,armada-370-pcie", }, 40 { .compatible = "marvell,armada-370-pcie", },
41 { .compatible = "marvell,kirkwood-pcie" },
41 {}, 42 {},
42}; 43};
43 44
diff --git a/arch/arm/mach-mvebu/system-controller.c b/arch/arm/mach-mvebu/system-controller.c
index a7fb89a5b5d9..614ba6832ff3 100644
--- a/arch/arm/mach-mvebu/system-controller.c
+++ b/arch/arm/mach-mvebu/system-controller.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * System controller support for Armada 370 and XP platforms. 2 * System controller support for Armada 370, 375 and XP platforms.
3 * 3 *
4 * Copyright (C) 2012 Marvell 4 * Copyright (C) 2012 Marvell
5 * 5 *
@@ -11,7 +11,7 @@
11 * License version 2. This program is licensed "as is" without any 11 * License version 2. This program is licensed "as is" without any
12 * warranty of any kind, whether express or implied. 12 * warranty of any kind, whether express or implied.
13 * 13 *
14 * The Armada 370 and Armada XP SoCs both have a range of 14 * The Armada 370, 375 and Armada XP SoCs have a range of
15 * miscellaneous registers, that do not belong to a particular device, 15 * miscellaneous registers, that do not belong to a particular device,
16 * but rather provide system-level features. This basic 16 * but rather provide system-level features. This basic
17 * system-controller driver provides a device tree binding for those 17 * system-controller driver provides a device tree binding for those
@@ -47,6 +47,13 @@ static const struct mvebu_system_controller armada_370_xp_system_controller = {
47 .system_soft_reset = 0x1, 47 .system_soft_reset = 0x1,
48}; 48};
49 49
50static const struct mvebu_system_controller armada_375_system_controller = {
51 .rstoutn_mask_offset = 0x54,
52 .system_soft_reset_offset = 0x58,
53 .rstoutn_mask_reset_out_en = 0x1,
54 .system_soft_reset = 0x1,
55};
56
50static const struct mvebu_system_controller orion_system_controller = { 57static const struct mvebu_system_controller orion_system_controller = {
51 .rstoutn_mask_offset = 0x108, 58 .rstoutn_mask_offset = 0x108,
52 .system_soft_reset_offset = 0x10c, 59 .system_soft_reset_offset = 0x10c,
@@ -54,13 +61,16 @@ static const struct mvebu_system_controller orion_system_controller = {
54 .system_soft_reset = 0x1, 61 .system_soft_reset = 0x1,
55}; 62};
56 63
57static struct of_device_id of_system_controller_table[] = { 64static const struct of_device_id of_system_controller_table[] = {
58 { 65 {
59 .compatible = "marvell,orion-system-controller", 66 .compatible = "marvell,orion-system-controller",
60 .data = (void *) &orion_system_controller, 67 .data = (void *) &orion_system_controller,
61 }, { 68 }, {
62 .compatible = "marvell,armada-370-xp-system-controller", 69 .compatible = "marvell,armada-370-xp-system-controller",
63 .data = (void *) &armada_370_xp_system_controller, 70 .data = (void *) &armada_370_xp_system_controller,
71 }, {
72 .compatible = "marvell,armada-375-system-controller",
73 .data = (void *) &armada_375_system_controller,
64 }, 74 },
65 { /* end of list */ }, 75 { /* end of list */ },
66}; 76};
@@ -90,13 +100,12 @@ void mvebu_restart(enum reboot_mode mode, const char *cmd)
90 100
91static int __init mvebu_system_controller_init(void) 101static int __init mvebu_system_controller_init(void)
92{ 102{
103 const struct of_device_id *match;
93 struct device_node *np; 104 struct device_node *np;
94 105
95 np = of_find_matching_node(NULL, of_system_controller_table); 106 np = of_find_matching_node_and_match(NULL, of_system_controller_table,
107 &match);
96 if (np) { 108 if (np) {
97 const struct of_device_id *match =
98 of_match_node(of_system_controller_table, np);
99 BUG_ON(!match);
100 system_controller_base = of_iomap(np, 0); 109 system_controller_base = of_iomap(np, 0);
101 mvebu_sc = (struct mvebu_system_controller *)match->data; 110 mvebu_sc = (struct mvebu_system_controller *)match->data;
102 of_node_put(np); 111 of_node_put(np);
diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
index 8cde9e05b5d6..84794137b175 100644
--- a/arch/arm/mach-mxs/Kconfig
+++ b/arch/arm/mach-mxs/Kconfig
@@ -16,11 +16,7 @@ config ARCH_MXS
16 bool "Freescale MXS (i.MX23, i.MX28) support" 16 bool "Freescale MXS (i.MX23, i.MX28) support"
17 depends on ARCH_MULTI_V5 17 depends on ARCH_MULTI_V5
18 select ARCH_REQUIRE_GPIOLIB 18 select ARCH_REQUIRE_GPIOLIB
19 select CLKDEV_LOOKUP
20 select CLKSRC_MMIO 19 select CLKSRC_MMIO
21 select CLKSRC_OF
22 select GENERIC_CLOCKEVENTS
23 select HAVE_CLK_PREPARE
24 select PINCTRL 20 select PINCTRL
25 select SOC_BUS 21 select SOC_BUS
26 select SOC_IMX23 22 select SOC_IMX23
diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
index 1dc5acd4fc99..2e7cec86e50e 100644
--- a/arch/arm/mach-mxs/mach-mxs.c
+++ b/arch/arm/mach-mxs/mach-mxs.c
@@ -157,6 +157,8 @@ enum mac_oui {
157 OUI_FSL, 157 OUI_FSL,
158 OUI_DENX, 158 OUI_DENX,
159 OUI_CRYSTALFONTZ, 159 OUI_CRYSTALFONTZ,
160 OUI_I2SE,
161 OUI_ARMADEUS,
160}; 162};
161 163
162static void __init update_fec_mac_prop(enum mac_oui oui) 164static void __init update_fec_mac_prop(enum mac_oui oui)
@@ -211,6 +213,16 @@ static void __init update_fec_mac_prop(enum mac_oui oui)
211 macaddr[1] = 0xb9; 213 macaddr[1] = 0xb9;
212 macaddr[2] = 0xe1; 214 macaddr[2] = 0xe1;
213 break; 215 break;
216 case OUI_I2SE:
217 macaddr[0] = 0x00;
218 macaddr[1] = 0x01;
219 macaddr[2] = 0x87;
220 break;
221 case OUI_ARMADEUS:
222 macaddr[0] = 0x00;
223 macaddr[1] = 0x1e;
224 macaddr[2] = 0xac;
225 break;
214 } 226 }
215 val = ocotp[i]; 227 val = ocotp[i];
216 macaddr[3] = (val >> 16) & 0xff; 228 macaddr[3] = (val >> 16) & 0xff;
@@ -236,6 +248,11 @@ static void __init imx28_evk_init(void)
236 mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0); 248 mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0);
237} 249}
238 250
251static void __init imx28_apf28_init(void)
252{
253 update_fec_mac_prop(OUI_ARMADEUS);
254}
255
239static int apx4devkit_phy_fixup(struct phy_device *phy) 256static int apx4devkit_phy_fixup(struct phy_device *phy)
240{ 257{
241 phy->dev_flags |= MICREL_PHY_50MHZ_CLK; 258 phy->dev_flags |= MICREL_PHY_50MHZ_CLK;
@@ -330,6 +347,11 @@ static void __init crystalfontz_init(void)
330 update_fec_mac_prop(OUI_CRYSTALFONTZ); 347 update_fec_mac_prop(OUI_CRYSTALFONTZ);
331} 348}
332 349
350static void __init duckbill_init(void)
351{
352 update_fec_mac_prop(OUI_I2SE);
353}
354
333static void __init m28cu3_init(void) 355static void __init m28cu3_init(void)
334{ 356{
335 update_fec_mac_prop(OUI_DENX); 357 update_fec_mac_prop(OUI_DENX);
@@ -426,6 +448,11 @@ static int __init mxs_restart_init(void)
426 return 0; 448 return 0;
427} 449}
428 450
451static void __init eukrea_mbmx283lc_init(void)
452{
453 mxs_saif_clkmux_select(MXS_DIGCTL_SAIF_CLKMUX_EXTMSTR0);
454}
455
429static void __init mxs_machine_init(void) 456static void __init mxs_machine_init(void)
430{ 457{
431 struct device_node *root; 458 struct device_node *root;
@@ -458,10 +485,16 @@ static void __init mxs_machine_init(void)
458 485
459 if (of_machine_is_compatible("fsl,imx28-evk")) 486 if (of_machine_is_compatible("fsl,imx28-evk"))
460 imx28_evk_init(); 487 imx28_evk_init();
488 if (of_machine_is_compatible("armadeus,imx28-apf28"))
489 imx28_apf28_init();
461 else if (of_machine_is_compatible("bluegiga,apx4devkit")) 490 else if (of_machine_is_compatible("bluegiga,apx4devkit"))
462 apx4devkit_init(); 491 apx4devkit_init();
463 else if (of_machine_is_compatible("crystalfontz,cfa10036")) 492 else if (of_machine_is_compatible("crystalfontz,cfa10036"))
464 crystalfontz_init(); 493 crystalfontz_init();
494 else if (of_machine_is_compatible("eukrea,mbmx283lc"))
495 eukrea_mbmx283lc_init();
496 else if (of_machine_is_compatible("i2se,duckbill"))
497 duckbill_init();
465 else if (of_machine_is_compatible("msr,m28cu3")) 498 else if (of_machine_is_compatible("msr,m28cu3"))
466 m28cu3_init(); 499 m28cu3_init();
467 500
diff --git a/arch/arm/mach-netx/include/mach/timex.h b/arch/arm/mach-netx/include/mach/timex.h
deleted file mode 100644
index 1120dd0ba393..000000000000
--- a/arch/arm/mach-netx/include/mach/timex.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * arch/arm/mach-netx/include/mach/timex.h
3 *
4 * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
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
8 * as published by the Free Software Foundation.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#define CLOCK_TICK_RATE 100000000
diff --git a/arch/arm/mach-netx/time.c b/arch/arm/mach-netx/time.c
index 6df42e643031..5fb2a590ec17 100644
--- a/arch/arm/mach-netx/time.c
+++ b/arch/arm/mach-netx/time.c
@@ -28,6 +28,9 @@
28#include <asm/mach/time.h> 28#include <asm/mach/time.h>
29#include <mach/netx-regs.h> 29#include <mach/netx-regs.h>
30 30
31#define NETX_CLOCK_FREQ 100000000
32#define NETX_LATCH DIV_ROUND_CLOSEST(NETX_CLOCK_FREQ, HZ)
33
31#define TIMER_CLOCKEVENT 0 34#define TIMER_CLOCKEVENT 0
32#define TIMER_CLOCKSOURCE 1 35#define TIMER_CLOCKSOURCE 1
33 36
@@ -41,7 +44,7 @@ static void netx_set_mode(enum clock_event_mode mode,
41 44
42 switch (mode) { 45 switch (mode) {
43 case CLOCK_EVT_MODE_PERIODIC: 46 case CLOCK_EVT_MODE_PERIODIC:
44 writel(LATCH, NETX_GPIO_COUNTER_MAX(TIMER_CLOCKEVENT)); 47 writel(NETX_LATCH, NETX_GPIO_COUNTER_MAX(TIMER_CLOCKEVENT));
45 tmode = NETX_GPIO_COUNTER_CTRL_RST_EN | 48 tmode = NETX_GPIO_COUNTER_CTRL_RST_EN |
46 NETX_GPIO_COUNTER_CTRL_IRQ_EN | 49 NETX_GPIO_COUNTER_CTRL_IRQ_EN |
47 NETX_GPIO_COUNTER_CTRL_RUN; 50 NETX_GPIO_COUNTER_CTRL_RUN;
@@ -99,7 +102,7 @@ netx_timer_interrupt(int irq, void *dev_id)
99 102
100static struct irqaction netx_timer_irq = { 103static struct irqaction netx_timer_irq = {
101 .name = "NetX Timer Tick", 104 .name = "NetX Timer Tick",
102 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 105 .flags = IRQF_TIMER | IRQF_IRQPOLL,
103 .handler = netx_timer_interrupt, 106 .handler = netx_timer_interrupt,
104}; 107};
105 108
@@ -114,7 +117,7 @@ void __init netx_timer_init(void)
114 /* Reset the timer value to zero */ 117 /* Reset the timer value to zero */
115 writel(0, NETX_GPIO_COUNTER_CURRENT(0)); 118 writel(0, NETX_GPIO_COUNTER_CURRENT(0));
116 119
117 writel(LATCH, NETX_GPIO_COUNTER_MAX(0)); 120 writel(NETX_LATCH, NETX_GPIO_COUNTER_MAX(0));
118 121
119 /* acknowledge interrupt */ 122 /* acknowledge interrupt */
120 writel(COUNTER_BIT(0), NETX_GPIO_IRQ); 123 writel(COUNTER_BIT(0), NETX_GPIO_IRQ);
@@ -137,11 +140,11 @@ void __init netx_timer_init(void)
137 NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKSOURCE)); 140 NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKSOURCE));
138 141
139 clocksource_mmio_init(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE), 142 clocksource_mmio_init(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE),
140 "netx_timer", CLOCK_TICK_RATE, 200, 32, clocksource_mmio_readl_up); 143 "netx_timer", NETX_CLOCK_FREQ, 200, 32, clocksource_mmio_readl_up);
141 144
142 /* with max_delta_ns >= delta2ns(0x800) the system currently runs fine. 145 /* with max_delta_ns >= delta2ns(0x800) the system currently runs fine.
143 * Adding some safety ... */ 146 * Adding some safety ... */
144 netx_clockevent.cpumask = cpumask_of(0); 147 netx_clockevent.cpumask = cpumask_of(0);
145 clockevents_config_and_register(&netx_clockevent, CLOCK_TICK_RATE, 148 clockevents_config_and_register(&netx_clockevent, NETX_CLOCK_FREQ,
146 0xa00, 0xfffffffe); 149 0xa00, 0xfffffffe);
147} 150}
diff --git a/arch/arm/mach-nomadik/Kconfig b/arch/arm/mach-nomadik/Kconfig
index 4d42da49753c..486d301f43fd 100644
--- a/arch/arm/mach-nomadik/Kconfig
+++ b/arch/arm/mach-nomadik/Kconfig
@@ -6,16 +6,11 @@ config ARCH_NOMADIK
6 select ARM_VIC 6 select ARM_VIC
7 select CLKSRC_NOMADIK_MTU 7 select CLKSRC_NOMADIK_MTU
8 select CLKSRC_NOMADIK_MTU_SCHED_CLOCK 8 select CLKSRC_NOMADIK_MTU_SCHED_CLOCK
9 select CLKSRC_OF
10 select COMMON_CLK
11 select CPU_ARM926T 9 select CPU_ARM926T
12 select GENERIC_CLOCKEVENTS
13 select MIGHT_HAVE_CACHE_L2X0 10 select MIGHT_HAVE_CACHE_L2X0
14 select PINCTRL 11 select PINCTRL
15 select PINCTRL_NOMADIK 12 select PINCTRL_NOMADIK
16 select PINCTRL_STN8815 13 select PINCTRL_STN8815
17 select SPARSE_IRQ
18 select USE_OF
19 help 14 help
20 Support for the Nomadik platform by ST-Ericsson 15 Support for the Nomadik platform by ST-Ericsson
21 16
diff --git a/arch/arm/mach-nspire/Kconfig b/arch/arm/mach-nspire/Kconfig
index 59d8f0a70919..bc41f26c1a12 100644
--- a/arch/arm/mach-nspire/Kconfig
+++ b/arch/arm/mach-nspire/Kconfig
@@ -3,14 +3,9 @@ config ARCH_NSPIRE
3 depends on ARCH_MULTI_V4_V5 3 depends on ARCH_MULTI_V4_V5
4 depends on MMU 4 depends on MMU
5 select CPU_ARM926T 5 select CPU_ARM926T
6 select COMMON_CLK
7 select GENERIC_CLOCKEVENTS
8 select GENERIC_IRQ_CHIP 6 select GENERIC_IRQ_CHIP
9 select SPARSE_IRQ
10 select ARM_AMBA 7 select ARM_AMBA
11 select ARM_VIC 8 select ARM_VIC
12 select ARM_TIMER_SP804 9 select ARM_TIMER_SP804
13 select USE_OF
14 select CLKSRC_OF
15 help 10 help
16 This enables support for systems using the TI-NSPIRE CPU 11 This enables support for systems using the TI-NSPIRE CPU
diff --git a/arch/arm/mach-nspire/nspire.c b/arch/arm/mach-nspire/nspire.c
index 4b2ed2e8352f..3d24ebf12095 100644
--- a/arch/arm/mach-nspire/nspire.c
+++ b/arch/arm/mach-nspire/nspire.c
@@ -63,7 +63,7 @@ static void __init nspire_init(void)
63 nspire_auxdata, NULL); 63 nspire_auxdata, NULL);
64} 64}
65 65
66static void nspire_restart(char mode, const char *cmd) 66static void nspire_restart(enum reboot_mode mode, const char *cmd)
67{ 67{
68 void __iomem *base = ioremap(NSPIRE_MISC_PHYS_BASE, SZ_4K); 68 void __iomem *base = ioremap(NSPIRE_MISC_PHYS_BASE, SZ_4K);
69 if (!base) 69 if (!base)
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index fd90cafc2e36..65d2acb31498 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -318,6 +318,9 @@ static void __init h2_init_smc91x(void)
318 318
319static int tps_setup(struct i2c_client *client, void *context) 319static int tps_setup(struct i2c_client *client, void *context)
320{ 320{
321 if (!IS_BUILTIN(CONFIG_TPS65010))
322 return -ENOSYS;
323
321 tps65010_config_vregs1(TPS_LDO2_ENABLE | TPS_VLDO2_3_0V | 324 tps65010_config_vregs1(TPS_LDO2_ENABLE | TPS_VLDO2_3_0V |
322 TPS_LDO1_ENABLE | TPS_VLDO1_3_0V); 325 TPS_LDO1_ENABLE | TPS_VLDO1_3_0V);
323 326
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index d68909b095f1..3a0262156e93 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -191,6 +191,9 @@ static struct platform_device osk5912_tps_leds = {
191 191
192static int osk_tps_setup(struct i2c_client *client, void *context) 192static int osk_tps_setup(struct i2c_client *client, void *context)
193{ 193{
194 if (!IS_BUILTIN(CONFIG_TPS65010))
195 return -ENOSYS;
196
194 /* Set GPIO 1 HIGH to disable VBUS power supply; 197 /* Set GPIO 1 HIGH to disable VBUS power supply;
195 * OHCI driver powers it up/down as needed. 198 * OHCI driver powers it up/down as needed.
196 */ 199 */
diff --git a/arch/arm/mach-omap1/dma.c b/arch/arm/mach-omap1/dma.c
index 5bb8ce86d54b..4be601b638d7 100644
--- a/arch/arm/mach-omap1/dma.c
+++ b/arch/arm/mach-omap1/dma.c
@@ -32,55 +32,51 @@
32 32
33#define OMAP1_DMA_BASE (0xfffed800) 33#define OMAP1_DMA_BASE (0xfffed800)
34#define OMAP1_LOGICAL_DMA_CH_COUNT 17 34#define OMAP1_LOGICAL_DMA_CH_COUNT 17
35#define OMAP1_DMA_STRIDE 0x40
36 35
37static u32 errata;
38static u32 enable_1510_mode; 36static u32 enable_1510_mode;
39static u8 dma_stride; 37
40static enum omap_reg_offsets dma_common_ch_start, dma_common_ch_end; 38static const struct omap_dma_reg reg_map[] = {
41 39 [GCR] = { 0x0400, 0x00, OMAP_DMA_REG_16BIT },
42static u16 reg_map[] = { 40 [GSCR] = { 0x0404, 0x00, OMAP_DMA_REG_16BIT },
43 [GCR] = 0x400, 41 [GRST1] = { 0x0408, 0x00, OMAP_DMA_REG_16BIT },
44 [GSCR] = 0x404, 42 [HW_ID] = { 0x0442, 0x00, OMAP_DMA_REG_16BIT },
45 [GRST1] = 0x408, 43 [PCH2_ID] = { 0x0444, 0x00, OMAP_DMA_REG_16BIT },
46 [HW_ID] = 0x442, 44 [PCH0_ID] = { 0x0446, 0x00, OMAP_DMA_REG_16BIT },
47 [PCH2_ID] = 0x444, 45 [PCH1_ID] = { 0x0448, 0x00, OMAP_DMA_REG_16BIT },
48 [PCH0_ID] = 0x446, 46 [PCHG_ID] = { 0x044a, 0x00, OMAP_DMA_REG_16BIT },
49 [PCH1_ID] = 0x448, 47 [PCHD_ID] = { 0x044c, 0x00, OMAP_DMA_REG_16BIT },
50 [PCHG_ID] = 0x44a, 48 [CAPS_0] = { 0x044e, 0x00, OMAP_DMA_REG_2X16BIT },
51 [PCHD_ID] = 0x44c, 49 [CAPS_1] = { 0x0452, 0x00, OMAP_DMA_REG_2X16BIT },
52 [CAPS_0] = 0x44e, 50 [CAPS_2] = { 0x0456, 0x00, OMAP_DMA_REG_16BIT },
53 [CAPS_1] = 0x452, 51 [CAPS_3] = { 0x0458, 0x00, OMAP_DMA_REG_16BIT },
54 [CAPS_2] = 0x456, 52 [CAPS_4] = { 0x045a, 0x00, OMAP_DMA_REG_16BIT },
55 [CAPS_3] = 0x458, 53 [PCH2_SR] = { 0x0460, 0x00, OMAP_DMA_REG_16BIT },
56 [CAPS_4] = 0x45a, 54 [PCH0_SR] = { 0x0480, 0x00, OMAP_DMA_REG_16BIT },
57 [PCH2_SR] = 0x460, 55 [PCH1_SR] = { 0x0482, 0x00, OMAP_DMA_REG_16BIT },
58 [PCH0_SR] = 0x480, 56 [PCHD_SR] = { 0x04c0, 0x00, OMAP_DMA_REG_16BIT },
59 [PCH1_SR] = 0x482,
60 [PCHD_SR] = 0x4c0,
61 57
62 /* Common Registers */ 58 /* Common Registers */
63 [CSDP] = 0x00, 59 [CSDP] = { 0x0000, 0x40, OMAP_DMA_REG_16BIT },
64 [CCR] = 0x02, 60 [CCR] = { 0x0002, 0x40, OMAP_DMA_REG_16BIT },
65 [CICR] = 0x04, 61 [CICR] = { 0x0004, 0x40, OMAP_DMA_REG_16BIT },
66 [CSR] = 0x06, 62 [CSR] = { 0x0006, 0x40, OMAP_DMA_REG_16BIT },
67 [CEN] = 0x10, 63 [CEN] = { 0x0010, 0x40, OMAP_DMA_REG_16BIT },
68 [CFN] = 0x12, 64 [CFN] = { 0x0012, 0x40, OMAP_DMA_REG_16BIT },
69 [CSFI] = 0x14, 65 [CSFI] = { 0x0014, 0x40, OMAP_DMA_REG_16BIT },
70 [CSEI] = 0x16, 66 [CSEI] = { 0x0016, 0x40, OMAP_DMA_REG_16BIT },
71 [CPC] = 0x18, /* 15xx only */ 67 [CPC] = { 0x0018, 0x40, OMAP_DMA_REG_16BIT }, /* 15xx only */
72 [CSAC] = 0x18, 68 [CSAC] = { 0x0018, 0x40, OMAP_DMA_REG_16BIT },
73 [CDAC] = 0x1a, 69 [CDAC] = { 0x001a, 0x40, OMAP_DMA_REG_16BIT },
74 [CDEI] = 0x1c, 70 [CDEI] = { 0x001c, 0x40, OMAP_DMA_REG_16BIT },
75 [CDFI] = 0x1e, 71 [CDFI] = { 0x001e, 0x40, OMAP_DMA_REG_16BIT },
76 [CLNK_CTRL] = 0x28, 72 [CLNK_CTRL] = { 0x0028, 0x40, OMAP_DMA_REG_16BIT },
77 73
78 /* Channel specific register offsets */ 74 /* Channel specific register offsets */
79 [CSSA] = 0x08, 75 [CSSA] = { 0x0008, 0x40, OMAP_DMA_REG_2X16BIT },
80 [CDSA] = 0x0c, 76 [CDSA] = { 0x000c, 0x40, OMAP_DMA_REG_2X16BIT },
81 [COLOR] = 0x20, 77 [COLOR] = { 0x0020, 0x40, OMAP_DMA_REG_2X16BIT },
82 [CCR2] = 0x24, 78 [CCR2] = { 0x0024, 0x40, OMAP_DMA_REG_16BIT },
83 [LCH_CTRL] = 0x2a, 79 [LCH_CTRL] = { 0x002a, 0x40, OMAP_DMA_REG_16BIT },
84}; 80};
85 81
86static struct resource res[] __initdata = { 82static struct resource res[] __initdata = {
@@ -181,44 +177,36 @@ static struct resource res[] __initdata = {
181static void __iomem *dma_base; 177static void __iomem *dma_base;
182static inline void dma_write(u32 val, int reg, int lch) 178static inline void dma_write(u32 val, int reg, int lch)
183{ 179{
184 u8 stride; 180 void __iomem *addr = dma_base;
185 u32 offset;
186 181
187 stride = (reg >= dma_common_ch_start) ? dma_stride : 0; 182 addr += reg_map[reg].offset;
188 offset = reg_map[reg] + (stride * lch); 183 addr += reg_map[reg].stride * lch;
189 184
190 __raw_writew(val, dma_base + offset); 185 __raw_writew(val, addr);
191 if ((reg > CLNK_CTRL && reg < CCEN) || 186 if (reg_map[reg].type == OMAP_DMA_REG_2X16BIT)
192 (reg > PCHD_ID && reg < CAPS_2)) { 187 __raw_writew(val >> 16, addr + 2);
193 u32 offset2 = reg_map[reg] + 2 + (stride * lch);
194 __raw_writew(val >> 16, dma_base + offset2);
195 }
196} 188}
197 189
198static inline u32 dma_read(int reg, int lch) 190static inline u32 dma_read(int reg, int lch)
199{ 191{
200 u8 stride; 192 void __iomem *addr = dma_base;
201 u32 offset, val; 193 uint32_t val;
202 194
203 stride = (reg >= dma_common_ch_start) ? dma_stride : 0; 195 addr += reg_map[reg].offset;
204 offset = reg_map[reg] + (stride * lch); 196 addr += reg_map[reg].stride * lch;
205 197
206 val = __raw_readw(dma_base + offset); 198 val = __raw_readw(addr);
207 if ((reg > CLNK_CTRL && reg < CCEN) || 199 if (reg_map[reg].type == OMAP_DMA_REG_2X16BIT)
208 (reg > PCHD_ID && reg < CAPS_2)) { 200 val |= __raw_readw(addr + 2) << 16;
209 u16 upper; 201
210 u32 offset2 = reg_map[reg] + 2 + (stride * lch);
211 upper = __raw_readw(dma_base + offset2);
212 val |= (upper << 16);
213 }
214 return val; 202 return val;
215} 203}
216 204
217static void omap1_clear_lch_regs(int lch) 205static void omap1_clear_lch_regs(int lch)
218{ 206{
219 int i = dma_common_ch_start; 207 int i;
220 208
221 for (; i <= dma_common_ch_end; i += 1) 209 for (i = CPC; i <= COLOR; i += 1)
222 dma_write(0, i, lch); 210 dma_write(0, i, lch);
223} 211}
224 212
@@ -255,8 +243,9 @@ static void omap1_show_dma_caps(void)
255 return; 243 return;
256} 244}
257 245
258static u32 configure_dma_errata(void) 246static unsigned configure_dma_errata(void)
259{ 247{
248 unsigned errata = 0;
260 249
261 /* 250 /*
262 * Erratum 3.2/3.3: sometimes 0 is returned if CSAC/CDAC is 251 * Erratum 3.2/3.3: sometimes 0 is returned if CSAC/CDAC is
@@ -272,11 +261,23 @@ static const struct platform_device_info omap_dma_dev_info = {
272 .name = "omap-dma-engine", 261 .name = "omap-dma-engine",
273 .id = -1, 262 .id = -1,
274 .dma_mask = DMA_BIT_MASK(32), 263 .dma_mask = DMA_BIT_MASK(32),
264 .res = res,
265 .num_res = 1,
266};
267
268static struct omap_system_dma_plat_info dma_plat_info __initdata = {
269 .reg_map = reg_map,
270 .channel_stride = 0x40,
271 .show_dma_caps = omap1_show_dma_caps,
272 .clear_lch_regs = omap1_clear_lch_regs,
273 .clear_dma = omap1_clear_dma,
274 .dma_write = dma_write,
275 .dma_read = dma_read,
275}; 276};
276 277
277static int __init omap1_system_dma_init(void) 278static int __init omap1_system_dma_init(void)
278{ 279{
279 struct omap_system_dma_plat_info *p; 280 struct omap_system_dma_plat_info p;
280 struct omap_dma_dev_attr *d; 281 struct omap_dma_dev_attr *d;
281 struct platform_device *pdev, *dma_pdev; 282 struct platform_device *pdev, *dma_pdev;
282 int ret; 283 int ret;
@@ -302,20 +303,12 @@ static int __init omap1_system_dma_init(void)
302 goto exit_iounmap; 303 goto exit_iounmap;
303 } 304 }
304 305
305 p = kzalloc(sizeof(struct omap_system_dma_plat_info), GFP_KERNEL);
306 if (!p) {
307 dev_err(&pdev->dev, "%s: Unable to allocate 'p' for %s\n",
308 __func__, pdev->name);
309 ret = -ENOMEM;
310 goto exit_iounmap;
311 }
312
313 d = kzalloc(sizeof(struct omap_dma_dev_attr), GFP_KERNEL); 306 d = kzalloc(sizeof(struct omap_dma_dev_attr), GFP_KERNEL);
314 if (!d) { 307 if (!d) {
315 dev_err(&pdev->dev, "%s: Unable to allocate 'd' for %s\n", 308 dev_err(&pdev->dev, "%s: Unable to allocate 'd' for %s\n",
316 __func__, pdev->name); 309 __func__, pdev->name);
317 ret = -ENOMEM; 310 ret = -ENOMEM;
318 goto exit_release_p; 311 goto exit_iounmap;
319 } 312 }
320 313
321 d->lch_count = OMAP1_LOGICAL_DMA_CH_COUNT; 314 d->lch_count = OMAP1_LOGICAL_DMA_CH_COUNT;
@@ -336,17 +329,6 @@ static int __init omap1_system_dma_init(void)
336 d->dev_caps |= CLEAR_CSR_ON_READ; 329 d->dev_caps |= CLEAR_CSR_ON_READ;
337 d->dev_caps |= IS_WORD_16; 330 d->dev_caps |= IS_WORD_16;
338 331
339
340 d->chan = kzalloc(sizeof(struct omap_dma_lch) *
341 (d->lch_count), GFP_KERNEL);
342 if (!d->chan) {
343 dev_err(&pdev->dev,
344 "%s: Memory allocation failed for d->chan!\n",
345 __func__);
346 ret = -ENOMEM;
347 goto exit_release_d;
348 }
349
350 if (cpu_is_omap15xx()) 332 if (cpu_is_omap15xx())
351 d->chan_count = 9; 333 d->chan_count = 9;
352 else if (cpu_is_omap16xx() || cpu_is_omap7xx()) { 334 else if (cpu_is_omap16xx() || cpu_is_omap7xx()) {
@@ -356,35 +338,24 @@ static int __init omap1_system_dma_init(void)
356 d->chan_count = 9; 338 d->chan_count = 9;
357 } 339 }
358 340
359 p->dma_attr = d; 341 p = dma_plat_info;
360 342 p.dma_attr = d;
361 p->show_dma_caps = omap1_show_dma_caps; 343 p.errata = configure_dma_errata();
362 p->clear_lch_regs = omap1_clear_lch_regs;
363 p->clear_dma = omap1_clear_dma;
364 p->dma_write = dma_write;
365 p->dma_read = dma_read;
366 p->disable_irq_lch = NULL;
367
368 p->errata = configure_dma_errata();
369 344
370 ret = platform_device_add_data(pdev, p, sizeof(*p)); 345 ret = platform_device_add_data(pdev, &p, sizeof(p));
371 if (ret) { 346 if (ret) {
372 dev_err(&pdev->dev, "%s: Unable to add resources for %s%d\n", 347 dev_err(&pdev->dev, "%s: Unable to add resources for %s%d\n",
373 __func__, pdev->name, pdev->id); 348 __func__, pdev->name, pdev->id);
374 goto exit_release_chan; 349 goto exit_release_d;
375 } 350 }
376 351
377 ret = platform_device_add(pdev); 352 ret = platform_device_add(pdev);
378 if (ret) { 353 if (ret) {
379 dev_err(&pdev->dev, "%s: Unable to add resources for %s%d\n", 354 dev_err(&pdev->dev, "%s: Unable to add resources for %s%d\n",
380 __func__, pdev->name, pdev->id); 355 __func__, pdev->name, pdev->id);
381 goto exit_release_chan; 356 goto exit_release_d;
382 } 357 }
383 358
384 dma_stride = OMAP1_DMA_STRIDE;
385 dma_common_ch_start = CPC;
386 dma_common_ch_end = COLOR;
387
388 dma_pdev = platform_device_register_full(&omap_dma_dev_info); 359 dma_pdev = platform_device_register_full(&omap_dma_dev_info);
389 if (IS_ERR(dma_pdev)) { 360 if (IS_ERR(dma_pdev)) {
390 ret = PTR_ERR(dma_pdev); 361 ret = PTR_ERR(dma_pdev);
@@ -395,12 +366,8 @@ static int __init omap1_system_dma_init(void)
395 366
396exit_release_pdev: 367exit_release_pdev:
397 platform_device_del(pdev); 368 platform_device_del(pdev);
398exit_release_chan:
399 kfree(d->chan);
400exit_release_d: 369exit_release_d:
401 kfree(d); 370 kfree(d);
402exit_release_p:
403 kfree(p);
404exit_iounmap: 371exit_iounmap:
405 iounmap(dma_base); 372 iounmap(dma_base);
406exit_device_put: 373exit_device_put:
diff --git a/arch/arm/mach-omap1/include/mach/timex.h b/arch/arm/mach-omap1/include/mach/timex.h
deleted file mode 100644
index 4793790d53cc..000000000000
--- a/arch/arm/mach-omap1/include/mach/timex.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * arch/arm/mach-omap1/include/mach/timex.h
3 */
4
5#include <plat/timex.h>
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c
index 40a1ae319610..dbee729e3b6d 100644
--- a/arch/arm/mach-omap1/pm.c
+++ b/arch/arm/mach-omap1/pm.c
@@ -71,7 +71,11 @@ static unsigned int mpui7xx_sleep_save[MPUI7XX_SLEEP_SAVE_SIZE];
71static unsigned int mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_SIZE]; 71static unsigned int mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_SIZE];
72static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE]; 72static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE];
73 73
74#ifdef CONFIG_OMAP_32K_TIMER 74#ifndef CONFIG_OMAP_32K_TIMER
75
76static unsigned short enable_dyn_sleep = 0;
77
78#else
75 79
76static unsigned short enable_dyn_sleep = 1; 80static unsigned short enable_dyn_sleep = 1;
77 81
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 0af7ca02314d..cb31d4390d52 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -6,7 +6,6 @@ config ARCH_OMAP2
6 depends on ARCH_MULTI_V6 6 depends on ARCH_MULTI_V6
7 select ARCH_OMAP2PLUS 7 select ARCH_OMAP2PLUS
8 select CPU_V6 8 select CPU_V6
9 select MULTI_IRQ_HANDLER
10 select SOC_HAS_OMAP2_SDRC 9 select SOC_HAS_OMAP2_SDRC
11 10
12config ARCH_OMAP3 11config ARCH_OMAP3
@@ -15,13 +14,10 @@ config ARCH_OMAP3
15 select ARCH_OMAP2PLUS 14 select ARCH_OMAP2PLUS
16 select ARCH_HAS_OPP 15 select ARCH_HAS_OPP
17 select ARM_CPU_SUSPEND if PM 16 select ARM_CPU_SUSPEND if PM
18 select CPU_V7
19 select MULTI_IRQ_HANDLER
20 select OMAP_INTERCONNECT 17 select OMAP_INTERCONNECT
21 select PM_OPP if PM 18 select PM_OPP if PM
22 select PM_RUNTIME if CPU_IDLE 19 select PM_RUNTIME if CPU_IDLE
23 select SOC_HAS_OMAP2_SDRC 20 select SOC_HAS_OMAP2_SDRC
24 select USB_ARCH_HAS_EHCI if USB_SUPPORT
25 21
26config ARCH_OMAP4 22config ARCH_OMAP4
27 bool "TI OMAP4" 23 bool "TI OMAP4"
@@ -33,16 +29,13 @@ config ARCH_OMAP4
33 select ARM_ERRATA_720789 29 select ARM_ERRATA_720789
34 select ARM_GIC 30 select ARM_GIC
35 select CACHE_L2X0 31 select CACHE_L2X0
36 select CPU_V7
37 select HAVE_ARM_SCU if SMP 32 select HAVE_ARM_SCU if SMP
38 select HAVE_ARM_TWD if SMP 33 select HAVE_ARM_TWD if SMP
39 select HAVE_SMP
40 select OMAP_INTERCONNECT 34 select OMAP_INTERCONNECT
41 select PL310_ERRATA_588369 35 select PL310_ERRATA_588369
42 select PL310_ERRATA_727915 36 select PL310_ERRATA_727915
43 select PM_OPP if PM 37 select PM_OPP if PM
44 select PM_RUNTIME if CPU_IDLE 38 select PM_RUNTIME if CPU_IDLE
45 select USB_ARCH_HAS_EHCI if USB_SUPPORT
46 select ARM_ERRATA_754322 39 select ARM_ERRATA_754322
47 select ARM_ERRATA_775420 40 select ARM_ERRATA_775420
48 41
@@ -53,10 +46,8 @@ config SOC_OMAP5
53 select ARCH_HAS_OPP 46 select ARCH_HAS_OPP
54 select ARM_CPU_SUSPEND if PM 47 select ARM_CPU_SUSPEND if PM
55 select ARM_GIC 48 select ARM_GIC
56 select CPU_V7
57 select HAVE_ARM_SCU if SMP 49 select HAVE_ARM_SCU if SMP
58 select HAVE_ARM_TWD if SMP 50 select HAVE_ARM_TWD if SMP
59 select HAVE_SMP
60 select HAVE_ARM_ARCH_TIMER 51 select HAVE_ARM_ARCH_TIMER
61 select ARM_ERRATA_798181 if SMP 52 select ARM_ERRATA_798181 if SMP
62 53
@@ -66,16 +57,12 @@ config SOC_AM33XX
66 select ARCH_OMAP2PLUS 57 select ARCH_OMAP2PLUS
67 select ARCH_HAS_OPP 58 select ARCH_HAS_OPP
68 select ARM_CPU_SUSPEND if PM 59 select ARM_CPU_SUSPEND if PM
69 select CPU_V7
70 select MULTI_IRQ_HANDLER
71 60
72config SOC_AM43XX 61config SOC_AM43XX
73 bool "TI AM43x" 62 bool "TI AM43x"
74 depends on ARCH_MULTI_V7 63 depends on ARCH_MULTI_V7
75 select CPU_V7
76 select ARCH_OMAP2PLUS 64 select ARCH_OMAP2PLUS
77 select ARCH_HAS_OPP 65 select ARCH_HAS_OPP
78 select MULTI_IRQ_HANDLER
79 select ARM_GIC 66 select ARM_GIC
80 select MACH_OMAP_GENERIC 67 select MACH_OMAP_GENERIC
81 68
@@ -86,9 +73,8 @@ config SOC_DRA7XX
86 select ARCH_HAS_OPP 73 select ARCH_HAS_OPP
87 select ARM_CPU_SUSPEND if PM 74 select ARM_CPU_SUSPEND if PM
88 select ARM_GIC 75 select ARM_GIC
89 select CPU_V7
90 select HAVE_SMP
91 select HAVE_ARM_ARCH_TIMER 76 select HAVE_ARM_ARCH_TIMER
77 select IRQ_CROSSBAR
92 78
93config ARCH_OMAP2PLUS 79config ARCH_OMAP2PLUS
94 bool 80 bool
@@ -98,17 +84,12 @@ config ARCH_OMAP2PLUS
98 select ARCH_OMAP 84 select ARCH_OMAP
99 select ARCH_REQUIRE_GPIOLIB 85 select ARCH_REQUIRE_GPIOLIB
100 select CLKSRC_MMIO 86 select CLKSRC_MMIO
101 select COMMON_CLK
102 select GENERIC_CLOCKEVENTS
103 select GENERIC_IRQ_CHIP 87 select GENERIC_IRQ_CHIP
104 select MACH_OMAP_GENERIC 88 select MACH_OMAP_GENERIC
105 select OMAP_DM_TIMER 89 select OMAP_DM_TIMER
106 select PINCTRL 90 select PINCTRL
107 select PROC_DEVICETREE if PROC_FS
108 select SOC_BUS 91 select SOC_BUS
109 select SPARSE_IRQ
110 select TI_PRIV_EDMA 92 select TI_PRIV_EDMA
111 select USE_OF
112 help 93 help
113 Systems based on OMAP2, OMAP3, OMAP4 or OMAP5 94 Systems based on OMAP2, OMAP3, OMAP4 or OMAP5
114 95
@@ -169,12 +150,6 @@ config SOC_TI81XX
169 depends on ARCH_OMAP3 150 depends on ARCH_OMAP3
170 default y 151 default y
171 152
172config OMAP_PACKAGE_ZAF
173 bool
174
175config OMAP_PACKAGE_ZAC
176 bool
177
178config OMAP_PACKAGE_CBC 153config OMAP_PACKAGE_CBC
179 bool 154 bool
180 155
@@ -284,7 +259,6 @@ config MACH_NOKIA_N8X0
284 default y 259 default y
285 select MACH_NOKIA_N810 260 select MACH_NOKIA_N810
286 select MACH_NOKIA_N810_WIMAX 261 select MACH_NOKIA_N810_WIMAX
287 select OMAP_PACKAGE_ZAC
288 262
289config MACH_NOKIA_RX51 263config MACH_NOKIA_RX51
290 bool "Nokia N900 (RX-51) phone" 264 bool "Nokia N900 (RX-51) phone"
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index e6eec6f72fd3..8421f38cf445 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -60,6 +60,7 @@ AFLAGS_sram34xx.o :=-Wa,-march=armv7-a
60obj-$(CONFIG_SOC_OMAP2420) += omap2-restart.o 60obj-$(CONFIG_SOC_OMAP2420) += omap2-restart.o
61obj-$(CONFIG_SOC_OMAP2430) += omap2-restart.o 61obj-$(CONFIG_SOC_OMAP2430) += omap2-restart.o
62obj-$(CONFIG_SOC_AM33XX) += am33xx-restart.o 62obj-$(CONFIG_SOC_AM33XX) += am33xx-restart.o
63obj-$(CONFIG_SOC_AM43XX) += omap4-restart.o
63obj-$(CONFIG_ARCH_OMAP3) += omap3-restart.o 64obj-$(CONFIG_ARCH_OMAP3) += omap3-restart.o
64obj-$(CONFIG_ARCH_OMAP4) += omap4-restart.o 65obj-$(CONFIG_ARCH_OMAP4) += omap4-restart.o
65obj-$(CONFIG_SOC_OMAP5) += omap4-restart.o 66obj-$(CONFIG_SOC_OMAP5) += omap4-restart.o
diff --git a/arch/arm/mach-omap2/am35xx-emac.c b/arch/arm/mach-omap2/am35xx-emac.c
index 25b79a297365..6a6935caac1e 100644
--- a/arch/arm/mach-omap2/am35xx-emac.c
+++ b/arch/arm/mach-omap2/am35xx-emac.c
@@ -17,7 +17,6 @@
17 17
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/davinci_emac.h> 19#include <linux/davinci_emac.h>
20#include <asm/system.h>
21#include "omap_device.h" 20#include "omap_device.h"
22#include "am35xx.h" 21#include "am35xx.h"
23#include "control.h" 22#include "control.h"
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 8dd0ec858cf1..018353d88b96 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -16,6 +16,8 @@
16 * 16 *
17 */ 17 */
18 18
19#include <linux/clk-provider.h>
20#include <linux/clkdev.h>
19#include <linux/kernel.h> 21#include <linux/kernel.h>
20#include <linux/init.h> 22#include <linux/init.h>
21#include <linux/platform_device.h> 23#include <linux/platform_device.h>
@@ -542,8 +544,22 @@ static struct isp_platform_data cm_t35_isp_pdata = {
542 .subdevs = cm_t35_isp_subdevs, 544 .subdevs = cm_t35_isp_subdevs,
543}; 545};
544 546
547static struct regulator_consumer_supply cm_t35_camera_supplies[] = {
548 REGULATOR_SUPPLY("vaa", "3-005d"),
549 REGULATOR_SUPPLY("vdd", "3-005d"),
550};
551
545static void __init cm_t35_init_camera(void) 552static void __init cm_t35_init_camera(void)
546{ 553{
554 struct clk *clk;
555
556 clk = clk_register_fixed_rate(NULL, "mt9t001-clkin", NULL, CLK_IS_ROOT,
557 48000000);
558 clk_register_clkdev(clk, NULL, "3-005d");
559
560 regulator_register_fixed(2, cm_t35_camera_supplies,
561 ARRAY_SIZE(cm_t35_camera_supplies));
562
547 if (omap3_init_camera(&cm_t35_isp_pdata) < 0) 563 if (omap3_init_camera(&cm_t35_isp_pdata) < 0)
548 pr_warn("CM-T3x: Failed registering camera device!\n"); 564 pr_warn("CM-T3x: Failed registering camera device!\n");
549} 565}
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 8e3daa11602b..b8920b6bc104 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -35,7 +35,11 @@ static struct of_device_id omap_dt_match_table[] __initdata = {
35 35
36static void __init omap_generic_init(void) 36static void __init omap_generic_init(void)
37{ 37{
38 omapdss_early_init_of();
39
38 pdata_quirks_init(omap_dt_match_table); 40 pdata_quirks_init(omap_dt_match_table);
41
42 omapdss_init_of();
39} 43}
40 44
41#ifdef CONFIG_SOC_OMAP2420 45#ifdef CONFIG_SOC_OMAP2420
@@ -229,8 +233,9 @@ DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)")
229 .init_late = am43xx_init_late, 233 .init_late = am43xx_init_late,
230 .init_irq = omap_gic_of_init, 234 .init_irq = omap_gic_of_init,
231 .init_machine = omap_generic_init, 235 .init_machine = omap_generic_init,
232 .init_time = omap3_sync32k_timer_init, 236 .init_time = omap3_gptimer_timer_init,
233 .dt_compat = am43_boards_compat, 237 .dt_compat = am43_boards_compat,
238 .restart = omap44xx_restart,
234MACHINE_END 239MACHINE_END
235#endif 240#endif
236 241
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index de1bc6bbe585..cf18340eb3bb 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -536,11 +536,13 @@ static struct spi_board_info omap3pandora_spi_board_info[] __initdata = {
536 536
537static void __init pandora_wl1251_init(void) 537static void __init pandora_wl1251_init(void)
538{ 538{
539 struct wl12xx_platform_data pandora_wl1251_pdata; 539 struct wl1251_platform_data pandora_wl1251_pdata;
540 int ret; 540 int ret;
541 541
542 memset(&pandora_wl1251_pdata, 0, sizeof(pandora_wl1251_pdata)); 542 memset(&pandora_wl1251_pdata, 0, sizeof(pandora_wl1251_pdata));
543 543
544 pandora_wl1251_pdata.power_gpio = -1;
545
544 ret = gpio_request_one(PANDORA_WIFI_IRQ_GPIO, GPIOF_IN, "wl1251 irq"); 546 ret = gpio_request_one(PANDORA_WIFI_IRQ_GPIO, GPIOF_IN, "wl1251 irq");
545 if (ret < 0) 547 if (ret < 0)
546 goto fail; 548 goto fail;
@@ -550,7 +552,7 @@ static void __init pandora_wl1251_init(void)
550 goto fail_irq; 552 goto fail_irq;
551 553
552 pandora_wl1251_pdata.use_eeprom = true; 554 pandora_wl1251_pdata.use_eeprom = true;
553 ret = wl12xx_set_platform_data(&pandora_wl1251_pdata); 555 ret = wl1251_set_platform_data(&pandora_wl1251_pdata);
554 if (ret < 0) 556 if (ret < 0)
555 goto fail_irq; 557 goto fail_irq;
556 558
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index 8760bbe3baab..ddfc8df83c6a 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -84,7 +84,7 @@ enum {
84 RX51_SPI_MIPID, /* LCD panel */ 84 RX51_SPI_MIPID, /* LCD panel */
85}; 85};
86 86
87static struct wl12xx_platform_data wl1251_pdata; 87static struct wl1251_platform_data wl1251_pdata;
88static struct tsc2005_platform_data tsc2005_pdata; 88static struct tsc2005_platform_data tsc2005_pdata;
89 89
90#if defined(CONFIG_SENSORS_LIS3_I2C) || defined(CONFIG_SENSORS_LIS3_I2C_MODULE) 90#if defined(CONFIG_SENSORS_LIS3_I2C) || defined(CONFIG_SENSORS_LIS3_I2C_MODULE)
@@ -1173,13 +1173,7 @@ static inline void board_smc91x_init(void)
1173 1173
1174#endif 1174#endif
1175 1175
1176static void rx51_wl1251_set_power(bool enable)
1177{
1178 gpio_set_value(RX51_WL1251_POWER_GPIO, enable);
1179}
1180
1181static struct gpio rx51_wl1251_gpios[] __initdata = { 1176static struct gpio rx51_wl1251_gpios[] __initdata = {
1182 { RX51_WL1251_POWER_GPIO, GPIOF_OUT_INIT_LOW, "wl1251 power" },
1183 { RX51_WL1251_IRQ_GPIO, GPIOF_IN, "wl1251 irq" }, 1177 { RX51_WL1251_IRQ_GPIO, GPIOF_IN, "wl1251 irq" },
1184}; 1178};
1185 1179
@@ -1196,17 +1190,16 @@ static void __init rx51_init_wl1251(void)
1196 if (irq < 0) 1190 if (irq < 0)
1197 goto err_irq; 1191 goto err_irq;
1198 1192
1199 wl1251_pdata.set_power = rx51_wl1251_set_power; 1193 wl1251_pdata.power_gpio = RX51_WL1251_POWER_GPIO;
1200 rx51_peripherals_spi_board_info[RX51_SPI_WL1251].irq = irq; 1194 rx51_peripherals_spi_board_info[RX51_SPI_WL1251].irq = irq;
1201 1195
1202 return; 1196 return;
1203 1197
1204err_irq: 1198err_irq:
1205 gpio_free(RX51_WL1251_IRQ_GPIO); 1199 gpio_free(RX51_WL1251_IRQ_GPIO);
1206 gpio_free(RX51_WL1251_POWER_GPIO);
1207error: 1200error:
1208 printk(KERN_ERR "wl1251 board initialisation failed\n"); 1201 printk(KERN_ERR "wl1251 board initialisation failed\n");
1209 wl1251_pdata.set_power = NULL; 1202 wl1251_pdata.power_gpio = -1;
1210 1203
1211 /* 1204 /*
1212 * Now rx51_peripherals_spi_board_info[1].irq is zero and 1205 * Now rx51_peripherals_spi_board_info[1].irq is zero and
diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c
index 11ed9152e665..8f5121b89688 100644
--- a/arch/arm/mach-omap2/cclock3xxx_data.c
+++ b/arch/arm/mach-omap2/cclock3xxx_data.c
@@ -3497,10 +3497,6 @@ static struct omap_clk omap3xxx_clks[] = {
3497 CLK(NULL, "dss_tv_fck", &dss_tv_fck), 3497 CLK(NULL, "dss_tv_fck", &dss_tv_fck),
3498 CLK(NULL, "dss_96m_fck", &dss_96m_fck), 3498 CLK(NULL, "dss_96m_fck", &dss_96m_fck),
3499 CLK(NULL, "dss2_alwon_fck", &dss2_alwon_fck), 3499 CLK(NULL, "dss2_alwon_fck", &dss2_alwon_fck),
3500 CLK(NULL, "utmi_p1_gfclk", &dummy_ck),
3501 CLK(NULL, "utmi_p2_gfclk", &dummy_ck),
3502 CLK(NULL, "xclk60mhsp1_ck", &dummy_ck),
3503 CLK(NULL, "xclk60mhsp2_ck", &dummy_ck),
3504 CLK(NULL, "init_60m_fclk", &dummy_ck), 3500 CLK(NULL, "init_60m_fclk", &dummy_ck),
3505 CLK(NULL, "gpt1_fck", &gpt1_fck), 3501 CLK(NULL, "gpt1_fck", &gpt1_fck),
3506 CLK(NULL, "aes2_ick", &aes2_ick), 3502 CLK(NULL, "aes2_ick", &aes2_ick),
diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c
index 47f9562ca7aa..2649ce445845 100644
--- a/arch/arm/mach-omap2/clkt_dpll.c
+++ b/arch/arm/mach-omap2/clkt_dpll.c
@@ -306,7 +306,7 @@ long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate,
306 306
307 ref_rate = __clk_get_rate(dd->clk_ref); 307 ref_rate = __clk_get_rate(dd->clk_ref);
308 clk_name = __clk_get_name(hw->clk); 308 clk_name = __clk_get_name(hw->clk);
309 pr_debug("clock: %s: starting DPLL round_rate, target rate %ld\n", 309 pr_debug("clock: %s: starting DPLL round_rate, target rate %lu\n",
310 clk_name, target_rate); 310 clk_name, target_rate);
311 311
312 scaled_rt_rp = target_rate / (ref_rate / DPLL_SCALE_FACTOR); 312 scaled_rt_rp = target_rate / (ref_rate / DPLL_SCALE_FACTOR);
@@ -342,7 +342,7 @@ long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate,
342 if (r == DPLL_MULT_UNDERFLOW) 342 if (r == DPLL_MULT_UNDERFLOW)
343 continue; 343 continue;
344 344
345 pr_debug("clock: %s: m = %d: n = %d: new_rate = %ld\n", 345 pr_debug("clock: %s: m = %d: n = %d: new_rate = %lu\n",
346 clk_name, m, n, new_rate); 346 clk_name, m, n, new_rate);
347 347
348 if (target_rate == new_rate) { 348 if (target_rate == new_rate) {
@@ -354,7 +354,7 @@ long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate,
354 } 354 }
355 355
356 if (target_rate != new_rate) { 356 if (target_rate != new_rate) {
357 pr_debug("clock: %s: cannot round to rate %ld\n", 357 pr_debug("clock: %s: cannot round to rate %lu\n",
358 clk_name, target_rate); 358 clk_name, target_rate);
359 return ~0; 359 return ~0;
360 } 360 }
diff --git a/arch/arm/mach-omap2/clockdomains3xxx_data.c b/arch/arm/mach-omap2/clockdomains3xxx_data.c
index e6b91e552d3d..f03dc97921ad 100644
--- a/arch/arm/mach-omap2/clockdomains3xxx_data.c
+++ b/arch/arm/mach-omap2/clockdomains3xxx_data.c
@@ -247,7 +247,7 @@ static struct clockdomain neon_clkdm = {
247static struct clockdomain iva2_clkdm = { 247static struct clockdomain iva2_clkdm = {
248 .name = "iva2_clkdm", 248 .name = "iva2_clkdm",
249 .pwrdm = { .name = "iva2_pwrdm" }, 249 .pwrdm = { .name = "iva2_pwrdm" },
250 .flags = CLKDM_CAN_HWSUP_SWSUP, 250 .flags = CLKDM_CAN_SWSUP,
251 .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT, 251 .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT,
252 .wkdep_srcs = iva2_wkdeps, 252 .wkdep_srcs = iva2_wkdeps,
253 .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK, 253 .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK,
diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c
index 731ca134348c..f5c4731b6f06 100644
--- a/arch/arm/mach-omap2/cminst44xx.c
+++ b/arch/arm/mach-omap2/cminst44xx.c
@@ -254,6 +254,11 @@ void omap4_cminst_clkdm_force_wakeup(u8 part, u16 inst, u16 cdoffs)
254 * 254 *
255 */ 255 */
256 256
257void omap4_cminst_clkdm_force_sleep(u8 part, u16 inst, u16 cdoffs)
258{
259 _clktrctrl_write(OMAP34XX_CLKSTCTRL_FORCE_SLEEP, part, inst, cdoffs);
260}
261
257/** 262/**
258 * omap4_cminst_wait_module_ready - wait for a module to be in 'func' state 263 * omap4_cminst_wait_module_ready - wait for a module to be in 'func' state
259 * @part: PRCM partition ID that the CM_CLKCTRL register exists in 264 * @part: PRCM partition ID that the CM_CLKCTRL register exists in
@@ -404,8 +409,17 @@ static int omap4_clkdm_clear_all_wkup_sleep_deps(struct clockdomain *clkdm)
404 409
405static int omap4_clkdm_sleep(struct clockdomain *clkdm) 410static int omap4_clkdm_sleep(struct clockdomain *clkdm)
406{ 411{
407 omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition, 412 if (clkdm->flags & CLKDM_CAN_HWSUP)
408 clkdm->cm_inst, clkdm->clkdm_offs); 413 omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition,
414 clkdm->cm_inst,
415 clkdm->clkdm_offs);
416 else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP)
417 omap4_cminst_clkdm_force_sleep(clkdm->prcm_partition,
418 clkdm->cm_inst,
419 clkdm->clkdm_offs);
420 else
421 return -EINVAL;
422
409 return 0; 423 return 0;
410} 424}
411 425
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index a6aae300542c..d88aff7baff8 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -315,5 +315,8 @@ extern int omap_dss_reset(struct omap_hwmod *);
315/* SoC specific clock initializer */ 315/* SoC specific clock initializer */
316int omap_clk_init(void); 316int omap_clk_init(void);
317 317
318int __init omapdss_init_of(void);
319void __init omapdss_early_init_of(void);
320
318#endif /* __ASSEMBLER__ */ 321#endif /* __ASSEMBLER__ */
319#endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */ 322#endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 0dd6398bade4..e58609b312c7 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -229,6 +229,9 @@ static struct omap_iommu_arch_data omap3_isp_iommu = {
229 229
230int omap3_init_camera(struct isp_platform_data *pdata) 230int omap3_init_camera(struct isp_platform_data *pdata)
231{ 231{
232 if (of_have_populated_dt())
233 omap3_isp_iommu.name = "480bd400.mmu";
234
232 omap3isp_device.dev.platform_data = pdata; 235 omap3isp_device.dev.platform_data = pdata;
233 omap3isp_device.dev.archdata.iommu = &omap3_isp_iommu; 236 omap3isp_device.dev.archdata.iommu = &omap3_isp_iommu;
234 237
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 4cf165502b35..16d33d831287 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -23,6 +23,9 @@
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/err.h> 24#include <linux/err.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/of.h>
27#include <linux/of_platform.h>
28#include <linux/slab.h>
26 29
27#include <video/omapdss.h> 30#include <video/omapdss.h>
28#include "omap_hwmod.h" 31#include "omap_hwmod.h"
@@ -301,7 +304,6 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
301 board_data->version = ver; 304 board_data->version = ver;
302 board_data->dsi_enable_pads = omap_dsi_enable_pads; 305 board_data->dsi_enable_pads = omap_dsi_enable_pads;
303 board_data->dsi_disable_pads = omap_dsi_disable_pads; 306 board_data->dsi_disable_pads = omap_dsi_disable_pads;
304 board_data->get_context_loss_count = omap_pm_get_dev_context_loss_count;
305 board_data->set_min_bus_tput = omap_dss_set_min_bus_tput; 307 board_data->set_min_bus_tput = omap_dss_set_min_bus_tput;
306 308
307 omap_display_device.dev.platform_data = board_data; 309 omap_display_device.dev.platform_data = board_data;
@@ -552,3 +554,166 @@ int omap_dss_reset(struct omap_hwmod *oh)
552 554
553 return r; 555 return r;
554} 556}
557
558/* list of 'compatible' nodes to convert to omapdss specific */
559static const char * const dss_compat_conv_list[] __initconst = {
560 "composite-connector",
561 "dvi-connector",
562 "hdmi-connector",
563 "panel-dpi",
564 "panel-dsi-cm",
565 "sony,acx565akm",
566 "svideo-connector",
567 "ti,tfp410",
568 "ti,tpd12s015",
569};
570
571/* prepend compatible string with "omapdss," */
572static __init void omapdss_omapify_node(struct device_node *node,
573 const char *compat)
574{
575 char *new_compat;
576 struct property *prop;
577
578 new_compat = kasprintf(GFP_KERNEL, "omapdss,%s", compat);
579
580 prop = kzalloc(sizeof(*prop), GFP_KERNEL);
581
582 if (!prop) {
583 pr_err("omapdss_omapify_node: kzalloc failed\n");
584 return;
585 }
586
587 prop->name = "compatible";
588 prop->value = new_compat;
589 prop->length = strlen(new_compat) + 1;
590
591 of_update_property(node, prop);
592}
593
594/*
595 * As omapdss panel drivers are omapdss specific, but we want to define the
596 * DT-data in generic manner, we convert the compatible strings of the panel
597 * nodes from "panel-foo" to "omapdss,panel-foo". This way we can have both
598 * correct DT data and omapdss specific drivers.
599 *
600 * When we get generic panel drivers to the kernel, this will be removed.
601 */
602void __init omapdss_early_init_of(void)
603{
604 int i;
605
606 for (i = 0; i < ARRAY_SIZE(dss_compat_conv_list); ++i) {
607 const char *compat = dss_compat_conv_list[i];
608 struct device_node *node = NULL;
609
610 while ((node = of_find_compatible_node(node, NULL, compat))) {
611 if (!of_device_is_available(node))
612 continue;
613
614 omapdss_omapify_node(node, compat);
615 }
616 }
617}
618
619struct device_node * __init omapdss_find_dss_of_node(void)
620{
621 struct device_node *node;
622
623 node = of_find_compatible_node(NULL, NULL, "ti,omap2-dss");
624 if (node)
625 return node;
626
627 node = of_find_compatible_node(NULL, NULL, "ti,omap3-dss");
628 if (node)
629 return node;
630
631 node = of_find_compatible_node(NULL, NULL, "ti,omap4-dss");
632 if (node)
633 return node;
634
635 return NULL;
636}
637
638int __init omapdss_init_of(void)
639{
640 int r;
641 enum omapdss_version ver;
642 struct device_node *node;
643 struct platform_device *pdev;
644
645 static struct omap_dss_board_info board_data = {
646 .dsi_enable_pads = omap_dsi_enable_pads,
647 .dsi_disable_pads = omap_dsi_disable_pads,
648 .set_min_bus_tput = omap_dss_set_min_bus_tput,
649 };
650
651 /* only create dss helper devices if dss is enabled in the .dts */
652
653 node = omapdss_find_dss_of_node();
654 if (!node)
655 return 0;
656
657 if (!of_device_is_available(node))
658 return 0;
659
660 ver = omap_display_get_version();
661
662 if (ver == OMAPDSS_VER_UNKNOWN) {
663 pr_err("DSS not supported on this SoC\n");
664 return -ENODEV;
665 }
666
667 pdev = of_find_device_by_node(node);
668
669 if (!pdev) {
670 pr_err("Unable to find DSS platform device\n");
671 return -ENODEV;
672 }
673
674 r = of_platform_populate(node, NULL, NULL, &pdev->dev);
675 if (r) {
676 pr_err("Unable to populate DSS submodule devices\n");
677 return r;
678 }
679
680 board_data.version = ver;
681
682 omap_display_device.dev.platform_data = &board_data;
683
684 r = platform_device_register(&omap_display_device);
685 if (r < 0) {
686 pr_err("Unable to register omapdss device\n");
687 return r;
688 }
689
690 /* create DRM device */
691 r = omap_init_drm();
692 if (r < 0) {
693 pr_err("Unable to register omapdrm device\n");
694 return r;
695 }
696
697 /* create vrfb device */
698 r = omap_init_vrfb();
699 if (r < 0) {
700 pr_err("Unable to register omapvrfb device\n");
701 return r;
702 }
703
704 /* create FB device */
705 r = omap_init_fb();
706 if (r < 0) {
707 pr_err("Unable to register omapfb device\n");
708 return r;
709 }
710
711 /* create V4L2 display device */
712 r = omap_init_vout();
713 if (r < 0) {
714 pr_err("Unable to register omap_vout device\n");
715 return r;
716 }
717
718 return 0;
719}
diff --git a/arch/arm/mach-omap2/display.h b/arch/arm/mach-omap2/display.h
index f3d2ce4bc262..7375854b16c7 100644
--- a/arch/arm/mach-omap2/display.h
+++ b/arch/arm/mach-omap2/display.h
@@ -30,4 +30,7 @@ int omap_init_drm(void);
30int omap_init_vrfb(void); 30int omap_init_vrfb(void);
31int omap_init_fb(void); 31int omap_init_fb(void);
32int omap_init_vout(void); 32int omap_init_vout(void);
33
34struct device_node * __init omapdss_find_dss_of_node(void);
35
33#endif 36#endif
diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
index 49fd0d501c9b..5689c88d986d 100644
--- a/arch/arm/mach-omap2/dma.c
+++ b/arch/arm/mach-omap2/dma.c
@@ -35,97 +35,80 @@
35#include "omap_hwmod.h" 35#include "omap_hwmod.h"
36#include "omap_device.h" 36#include "omap_device.h"
37 37
38#define OMAP2_DMA_STRIDE 0x60 38static enum omap_reg_offsets dma_common_ch_end;
39 39
40static u32 errata; 40static const struct omap_dma_reg reg_map[] = {
41static u8 dma_stride; 41 [REVISION] = { 0x0000, 0x00, OMAP_DMA_REG_32BIT },
42 42 [GCR] = { 0x0078, 0x00, OMAP_DMA_REG_32BIT },
43static struct omap_dma_dev_attr *d; 43 [IRQSTATUS_L0] = { 0x0008, 0x00, OMAP_DMA_REG_32BIT },
44 44 [IRQSTATUS_L1] = { 0x000c, 0x00, OMAP_DMA_REG_32BIT },
45static enum omap_reg_offsets dma_common_ch_start, dma_common_ch_end; 45 [IRQSTATUS_L2] = { 0x0010, 0x00, OMAP_DMA_REG_32BIT },
46 46 [IRQSTATUS_L3] = { 0x0014, 0x00, OMAP_DMA_REG_32BIT },
47static u16 reg_map[] = { 47 [IRQENABLE_L0] = { 0x0018, 0x00, OMAP_DMA_REG_32BIT },
48 [REVISION] = 0x00, 48 [IRQENABLE_L1] = { 0x001c, 0x00, OMAP_DMA_REG_32BIT },
49 [GCR] = 0x78, 49 [IRQENABLE_L2] = { 0x0020, 0x00, OMAP_DMA_REG_32BIT },
50 [IRQSTATUS_L0] = 0x08, 50 [IRQENABLE_L3] = { 0x0024, 0x00, OMAP_DMA_REG_32BIT },
51 [IRQSTATUS_L1] = 0x0c, 51 [SYSSTATUS] = { 0x0028, 0x00, OMAP_DMA_REG_32BIT },
52 [IRQSTATUS_L2] = 0x10, 52 [OCP_SYSCONFIG] = { 0x002c, 0x00, OMAP_DMA_REG_32BIT },
53 [IRQSTATUS_L3] = 0x14, 53 [CAPS_0] = { 0x0064, 0x00, OMAP_DMA_REG_32BIT },
54 [IRQENABLE_L0] = 0x18, 54 [CAPS_2] = { 0x006c, 0x00, OMAP_DMA_REG_32BIT },
55 [IRQENABLE_L1] = 0x1c, 55 [CAPS_3] = { 0x0070, 0x00, OMAP_DMA_REG_32BIT },
56 [IRQENABLE_L2] = 0x20, 56 [CAPS_4] = { 0x0074, 0x00, OMAP_DMA_REG_32BIT },
57 [IRQENABLE_L3] = 0x24,
58 [SYSSTATUS] = 0x28,
59 [OCP_SYSCONFIG] = 0x2c,
60 [CAPS_0] = 0x64,
61 [CAPS_2] = 0x6c,
62 [CAPS_3] = 0x70,
63 [CAPS_4] = 0x74,
64 57
65 /* Common register offsets */ 58 /* Common register offsets */
66 [CCR] = 0x80, 59 [CCR] = { 0x0080, 0x60, OMAP_DMA_REG_32BIT },
67 [CLNK_CTRL] = 0x84, 60 [CLNK_CTRL] = { 0x0084, 0x60, OMAP_DMA_REG_32BIT },
68 [CICR] = 0x88, 61 [CICR] = { 0x0088, 0x60, OMAP_DMA_REG_32BIT },
69 [CSR] = 0x8c, 62 [CSR] = { 0x008c, 0x60, OMAP_DMA_REG_32BIT },
70 [CSDP] = 0x90, 63 [CSDP] = { 0x0090, 0x60, OMAP_DMA_REG_32BIT },
71 [CEN] = 0x94, 64 [CEN] = { 0x0094, 0x60, OMAP_DMA_REG_32BIT },
72 [CFN] = 0x98, 65 [CFN] = { 0x0098, 0x60, OMAP_DMA_REG_32BIT },
73 [CSEI] = 0xa4, 66 [CSEI] = { 0x00a4, 0x60, OMAP_DMA_REG_32BIT },
74 [CSFI] = 0xa8, 67 [CSFI] = { 0x00a8, 0x60, OMAP_DMA_REG_32BIT },
75 [CDEI] = 0xac, 68 [CDEI] = { 0x00ac, 0x60, OMAP_DMA_REG_32BIT },
76 [CDFI] = 0xb0, 69 [CDFI] = { 0x00b0, 0x60, OMAP_DMA_REG_32BIT },
77 [CSAC] = 0xb4, 70 [CSAC] = { 0x00b4, 0x60, OMAP_DMA_REG_32BIT },
78 [CDAC] = 0xb8, 71 [CDAC] = { 0x00b8, 0x60, OMAP_DMA_REG_32BIT },
79 72
80 /* Channel specific register offsets */ 73 /* Channel specific register offsets */
81 [CSSA] = 0x9c, 74 [CSSA] = { 0x009c, 0x60, OMAP_DMA_REG_32BIT },
82 [CDSA] = 0xa0, 75 [CDSA] = { 0x00a0, 0x60, OMAP_DMA_REG_32BIT },
83 [CCEN] = 0xbc, 76 [CCEN] = { 0x00bc, 0x60, OMAP_DMA_REG_32BIT },
84 [CCFN] = 0xc0, 77 [CCFN] = { 0x00c0, 0x60, OMAP_DMA_REG_32BIT },
85 [COLOR] = 0xc4, 78 [COLOR] = { 0x00c4, 0x60, OMAP_DMA_REG_32BIT },
86 79
87 /* OMAP4 specific registers */ 80 /* OMAP4 specific registers */
88 [CDP] = 0xd0, 81 [CDP] = { 0x00d0, 0x60, OMAP_DMA_REG_32BIT },
89 [CNDP] = 0xd4, 82 [CNDP] = { 0x00d4, 0x60, OMAP_DMA_REG_32BIT },
90 [CCDN] = 0xd8, 83 [CCDN] = { 0x00d8, 0x60, OMAP_DMA_REG_32BIT },
91}; 84};
92 85
93static void __iomem *dma_base; 86static void __iomem *dma_base;
94static inline void dma_write(u32 val, int reg, int lch) 87static inline void dma_write(u32 val, int reg, int lch)
95{ 88{
96 u8 stride; 89 void __iomem *addr = dma_base;
97 u32 offset;
98 90
99 stride = (reg >= dma_common_ch_start) ? dma_stride : 0; 91 addr += reg_map[reg].offset;
100 offset = reg_map[reg] + (stride * lch); 92 addr += reg_map[reg].stride * lch;
101 __raw_writel(val, dma_base + offset); 93
94 __raw_writel(val, addr);
102} 95}
103 96
104static inline u32 dma_read(int reg, int lch) 97static inline u32 dma_read(int reg, int lch)
105{ 98{
106 u8 stride; 99 void __iomem *addr = dma_base;
107 u32 offset, val;
108
109 stride = (reg >= dma_common_ch_start) ? dma_stride : 0;
110 offset = reg_map[reg] + (stride * lch);
111 val = __raw_readl(dma_base + offset);
112 return val;
113}
114 100
115static inline void omap2_disable_irq_lch(int lch) 101 addr += reg_map[reg].offset;
116{ 102 addr += reg_map[reg].stride * lch;
117 u32 val;
118 103
119 val = dma_read(IRQENABLE_L0, lch); 104 return __raw_readl(addr);
120 val &= ~(1 << lch);
121 dma_write(val, IRQENABLE_L0, lch);
122} 105}
123 106
124static void omap2_clear_dma(int lch) 107static void omap2_clear_dma(int lch)
125{ 108{
126 int i = dma_common_ch_start; 109 int i;
127 110
128 for (; i <= dma_common_ch_end; i += 1) 111 for (i = CSDP; i <= dma_common_ch_end; i += 1)
129 dma_write(0, i, lch); 112 dma_write(0, i, lch);
130} 113}
131 114
@@ -137,8 +120,9 @@ static void omap2_show_dma_caps(void)
137 return; 120 return;
138} 121}
139 122
140static u32 configure_dma_errata(void) 123static unsigned configure_dma_errata(void)
141{ 124{
125 unsigned errata = 0;
142 126
143 /* 127 /*
144 * Errata applicable for OMAP2430ES1.0 and all omap2420 128 * Errata applicable for OMAP2430ES1.0 and all omap2420
@@ -220,48 +204,50 @@ static u32 configure_dma_errata(void)
220 return errata; 204 return errata;
221} 205}
222 206
207static struct omap_system_dma_plat_info dma_plat_info __initdata = {
208 .reg_map = reg_map,
209 .channel_stride = 0x60,
210 .show_dma_caps = omap2_show_dma_caps,
211 .clear_dma = omap2_clear_dma,
212 .dma_write = dma_write,
213 .dma_read = dma_read,
214};
215
216static struct platform_device_info omap_dma_dev_info = {
217 .name = "omap-dma-engine",
218 .id = -1,
219 .dma_mask = DMA_BIT_MASK(32),
220};
221
223/* One time initializations */ 222/* One time initializations */
224static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused) 223static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)
225{ 224{
226 struct platform_device *pdev; 225 struct platform_device *pdev;
227 struct omap_system_dma_plat_info *p; 226 struct omap_system_dma_plat_info p;
227 struct omap_dma_dev_attr *d;
228 struct resource *mem; 228 struct resource *mem;
229 char *name = "omap_dma_system"; 229 char *name = "omap_dma_system";
230 230
231 dma_stride = OMAP2_DMA_STRIDE; 231 p = dma_plat_info;
232 dma_common_ch_start = CSDP; 232 p.dma_attr = (struct omap_dma_dev_attr *)oh->dev_attr;
233 233 p.errata = configure_dma_errata();
234 p = kzalloc(sizeof(struct omap_system_dma_plat_info), GFP_KERNEL);
235 if (!p) {
236 pr_err("%s: Unable to allocate pdata for %s:%s\n",
237 __func__, name, oh->name);
238 return -ENOMEM;
239 }
240
241 p->dma_attr = (struct omap_dma_dev_attr *)oh->dev_attr;
242 p->disable_irq_lch = omap2_disable_irq_lch;
243 p->show_dma_caps = omap2_show_dma_caps;
244 p->clear_dma = omap2_clear_dma;
245 p->dma_write = dma_write;
246 p->dma_read = dma_read;
247
248 p->clear_lch_regs = NULL;
249
250 p->errata = configure_dma_errata();
251 234
252 pdev = omap_device_build(name, 0, oh, p, sizeof(*p)); 235 pdev = omap_device_build(name, 0, oh, &p, sizeof(p));
253 kfree(p);
254 if (IS_ERR(pdev)) { 236 if (IS_ERR(pdev)) {
255 pr_err("%s: Can't build omap_device for %s:%s.\n", 237 pr_err("%s: Can't build omap_device for %s:%s.\n",
256 __func__, name, oh->name); 238 __func__, name, oh->name);
257 return PTR_ERR(pdev); 239 return PTR_ERR(pdev);
258 } 240 }
259 241
242 omap_dma_dev_info.res = pdev->resource;
243 omap_dma_dev_info.num_res = pdev->num_resources;
244
260 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 245 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
261 if (!mem) { 246 if (!mem) {
262 dev_err(&pdev->dev, "%s: no mem resource\n", __func__); 247 dev_err(&pdev->dev, "%s: no mem resource\n", __func__);
263 return -EINVAL; 248 return -EINVAL;
264 } 249 }
250
265 dma_base = ioremap(mem->start, resource_size(mem)); 251 dma_base = ioremap(mem->start, resource_size(mem));
266 if (!dma_base) { 252 if (!dma_base) {
267 dev_err(&pdev->dev, "%s: ioremap fail\n", __func__); 253 dev_err(&pdev->dev, "%s: ioremap fail\n", __func__);
@@ -269,13 +255,6 @@ static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)
269 } 255 }
270 256
271 d = oh->dev_attr; 257 d = oh->dev_attr;
272 d->chan = kzalloc(sizeof(struct omap_dma_lch) *
273 (d->lch_count), GFP_KERNEL);
274
275 if (!d->chan) {
276 dev_err(&pdev->dev, "%s: kzalloc fail\n", __func__);
277 return -ENOMEM;
278 }
279 258
280 if (cpu_is_omap34xx() && (omap_type() != OMAP2_DEVICE_TYPE_GP)) 259 if (cpu_is_omap34xx() && (omap_type() != OMAP2_DEVICE_TYPE_GP))
281 d->dev_caps |= HS_CHANNELS_RESERVED; 260 d->dev_caps |= HS_CHANNELS_RESERVED;
@@ -289,12 +268,6 @@ static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)
289 return 0; 268 return 0;
290} 269}
291 270
292static const struct platform_device_info omap_dma_dev_info = {
293 .name = "omap-dma-engine",
294 .id = -1,
295 .dma_mask = DMA_BIT_MASK(32),
296};
297
298static int __init omap2_system_dma_init(void) 271static int __init omap2_system_dma_init(void)
299{ 272{
300 struct platform_device *pdev; 273 struct platform_device *pdev;
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c
index 3c418ea54bbe..fcd8036af910 100644
--- a/arch/arm/mach-omap2/dpll3xxx.c
+++ b/arch/arm/mach-omap2/dpll3xxx.c
@@ -525,7 +525,7 @@ int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned long rate,
525 * stuff is inherited for free 525 * stuff is inherited for free
526 */ 526 */
527 527
528 if (!ret) 528 if (!ret && clk_get_parent(hw->clk) != new_parent)
529 __clk_reparent(hw->clk, new_parent); 529 __clk_reparent(hw->clk, new_parent);
530 530
531 return 0; 531 return 0;
diff --git a/arch/arm/mach-omap2/dss-common.c b/arch/arm/mach-omap2/dss-common.c
index dadccc91488c..ea2be0f5953b 100644
--- a/arch/arm/mach-omap2/dss-common.c
+++ b/arch/arm/mach-omap2/dss-common.c
@@ -33,227 +33,5 @@
33#include "soc.h" 33#include "soc.h"
34#include "dss-common.h" 34#include "dss-common.h"
35#include "mux.h" 35#include "mux.h"
36#include "display.h"
36 37
37#define HDMI_GPIO_CT_CP_HPD 60 /* HPD mode enable/disable */
38#define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
39#define HDMI_GPIO_HPD 63 /* Hotplug detect */
40
41#define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0
42
43/* DVI Connector */
44static struct connector_dvi_platform_data omap4_panda_dvi_connector_pdata = {
45 .name = "dvi",
46 .source = "tfp410.0",
47 .i2c_bus_num = 2,
48};
49
50static struct platform_device omap4_panda_dvi_connector_device = {
51 .name = "connector-dvi",
52 .id = 0,
53 .dev.platform_data = &omap4_panda_dvi_connector_pdata,
54};
55
56/* TFP410 DPI-to-DVI chip */
57static struct encoder_tfp410_platform_data omap4_panda_tfp410_pdata = {
58 .name = "tfp410.0",
59 .source = "dpi.0",
60 .data_lines = 24,
61 .power_down_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
62};
63
64static struct platform_device omap4_panda_tfp410_device = {
65 .name = "tfp410",
66 .id = 0,
67 .dev.platform_data = &omap4_panda_tfp410_pdata,
68};
69
70/* HDMI Connector */
71static struct connector_hdmi_platform_data omap4_panda_hdmi_connector_pdata = {
72 .name = "hdmi",
73 .source = "tpd12s015.0",
74};
75
76static struct platform_device omap4_panda_hdmi_connector_device = {
77 .name = "connector-hdmi",
78 .id = 0,
79 .dev.platform_data = &omap4_panda_hdmi_connector_pdata,
80};
81
82/* TPD12S015 HDMI ESD protection & level shifter chip */
83static struct encoder_tpd12s015_platform_data omap4_panda_tpd_pdata = {
84 .name = "tpd12s015.0",
85 .source = "hdmi.0",
86
87 .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD,
88 .ls_oe_gpio = HDMI_GPIO_LS_OE,
89 .hpd_gpio = HDMI_GPIO_HPD,
90};
91
92static struct platform_device omap4_panda_tpd_device = {
93 .name = "tpd12s015",
94 .id = 0,
95 .dev.platform_data = &omap4_panda_tpd_pdata,
96};
97
98static struct omap_dss_board_info omap4_panda_dss_data = {
99 .default_display_name = "dvi",
100};
101
102void __init omap4_panda_display_init_of(void)
103{
104 omap_display_init(&omap4_panda_dss_data);
105
106 platform_device_register(&omap4_panda_tfp410_device);
107 platform_device_register(&omap4_panda_dvi_connector_device);
108
109 platform_device_register(&omap4_panda_tpd_device);
110 platform_device_register(&omap4_panda_hdmi_connector_device);
111}
112
113
114/* OMAP4 Blaze display data */
115
116#define DISPLAY_SEL_GPIO 59 /* LCD2/PicoDLP switch */
117#define DLP_POWER_ON_GPIO 40
118
119static struct panel_dsicm_platform_data dsi1_panel = {
120 .name = "lcd",
121 .source = "dsi.0",
122 .reset_gpio = 102,
123 .use_ext_te = false,
124 .ext_te_gpio = 101,
125 .pin_config = {
126 .num_pins = 6,
127 .pins = { 0, 1, 2, 3, 4, 5 },
128 },
129};
130
131static struct platform_device sdp4430_lcd_device = {
132 .name = "panel-dsi-cm",
133 .id = 0,
134 .dev.platform_data = &dsi1_panel,
135};
136
137static struct panel_dsicm_platform_data dsi2_panel = {
138 .name = "lcd2",
139 .source = "dsi.1",
140 .reset_gpio = 104,
141 .use_ext_te = false,
142 .ext_te_gpio = 103,
143 .pin_config = {
144 .num_pins = 6,
145 .pins = { 0, 1, 2, 3, 4, 5 },
146 },
147};
148
149static struct platform_device sdp4430_lcd2_device = {
150 .name = "panel-dsi-cm",
151 .id = 1,
152 .dev.platform_data = &dsi2_panel,
153};
154
155/* HDMI Connector */
156static struct connector_hdmi_platform_data sdp4430_hdmi_connector_pdata = {
157 .name = "hdmi",
158 .source = "tpd12s015.0",
159};
160
161static struct platform_device sdp4430_hdmi_connector_device = {
162 .name = "connector-hdmi",
163 .id = 0,
164 .dev.platform_data = &sdp4430_hdmi_connector_pdata,
165};
166
167/* TPD12S015 HDMI ESD protection & level shifter chip */
168static struct encoder_tpd12s015_platform_data sdp4430_tpd_pdata = {
169 .name = "tpd12s015.0",
170 .source = "hdmi.0",
171
172 .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD,
173 .ls_oe_gpio = HDMI_GPIO_LS_OE,
174 .hpd_gpio = HDMI_GPIO_HPD,
175};
176
177static struct platform_device sdp4430_tpd_device = {
178 .name = "tpd12s015",
179 .id = 0,
180 .dev.platform_data = &sdp4430_tpd_pdata,
181};
182
183
184static struct omap_dss_board_info sdp4430_dss_data = {
185 .default_display_name = "lcd",
186};
187
188/*
189 * we select LCD2 by default (instead of Pico DLP) by setting DISPLAY_SEL_GPIO.
190 * Setting DLP_POWER_ON gpio enables the VDLP_2V5 VDLP_1V8 and VDLP_1V0 rails
191 * used by picodlp on the 4430sdp platform. Keep this gpio disabled as LCD2 is
192 * selected by default
193 */
194void __init omap_4430sdp_display_init_of(void)
195{
196 int r;
197
198 r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH,
199 "display_sel");
200 if (r)
201 pr_err("%s: Could not get display_sel GPIO\n", __func__);
202
203 r = gpio_request_one(DLP_POWER_ON_GPIO, GPIOF_OUT_INIT_LOW,
204 "DLP POWER ON");
205 if (r)
206 pr_err("%s: Could not get DLP POWER ON GPIO\n", __func__);
207
208 omap_display_init(&sdp4430_dss_data);
209
210 platform_device_register(&sdp4430_lcd_device);
211 platform_device_register(&sdp4430_lcd2_device);
212
213 platform_device_register(&sdp4430_tpd_device);
214 platform_device_register(&sdp4430_hdmi_connector_device);
215}
216
217
218/* OMAP3 IGEPv2 data */
219
220#define IGEP2_DVI_TFP410_POWER_DOWN_GPIO 170
221
222/* DVI Connector */
223static struct connector_dvi_platform_data omap3_igep2_dvi_connector_pdata = {
224 .name = "dvi",
225 .source = "tfp410.0",
226 .i2c_bus_num = 2,
227};
228
229static struct platform_device omap3_igep2_dvi_connector_device = {
230 .name = "connector-dvi",
231 .id = 0,
232 .dev.platform_data = &omap3_igep2_dvi_connector_pdata,
233};
234
235/* TFP410 DPI-to-DVI chip */
236static struct encoder_tfp410_platform_data omap3_igep2_tfp410_pdata = {
237 .name = "tfp410.0",
238 .source = "dpi.0",
239 .data_lines = 24,
240 .power_down_gpio = IGEP2_DVI_TFP410_POWER_DOWN_GPIO,
241};
242
243static struct platform_device omap3_igep2_tfp410_device = {
244 .name = "tfp410",
245 .id = 0,
246 .dev.platform_data = &omap3_igep2_tfp410_pdata,
247};
248
249static struct omap_dss_board_info igep2_dss_data = {
250 .default_display_name = "dvi",
251};
252
253void __init omap3_igep2_display_init_of(void)
254{
255 omap_display_init(&igep2_dss_data);
256
257 platform_device_register(&omap3_igep2_tfp410_device);
258 platform_device_register(&omap3_igep2_dvi_connector_device);
259}
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index 174caecc3186..4349e82debfe 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -45,24 +45,31 @@ static struct platform_device gpmc_nand_device = {
45 45
46static bool gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt) 46static bool gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt)
47{ 47{
48 /* support only OMAP3 class */ 48 /* platforms which support all ECC schemes */
49 if (!cpu_is_omap34xx() && !soc_is_am33xx()) { 49 if (soc_is_am33xx() || cpu_is_omap44xx() ||
50 pr_err("BCH ecc is not supported on this CPU\n"); 50 soc_is_omap54xx() || soc_is_dra7xx())
51 return 1;
52
53 /* OMAP3xxx do not have ELM engine, so cannot support ECC schemes
54 * which require H/W based ECC error detection */
55 if ((cpu_is_omap34xx() || cpu_is_omap3630()) &&
56 ((ecc_opt == OMAP_ECC_BCH4_CODE_HW) ||
57 (ecc_opt == OMAP_ECC_BCH8_CODE_HW)))
51 return 0; 58 return 0;
52 }
53 59
54 /* 60 /*
55 * For now, assume 4-bit mode is only supported on OMAP3630 ES1.x, x>=1 61 * For now, assume 4-bit mode is only supported on OMAP3630 ES1.x, x>=1
56 * and AM33xx derivates. Other chips may be added if confirmed to work. 62 * and AM33xx derivates. Other chips may be added if confirmed to work.
57 */ 63 */
58 if ((ecc_opt == OMAP_ECC_BCH4_CODE_HW) && 64 if ((ecc_opt == OMAP_ECC_BCH4_CODE_HW_DETECTION_SW) &&
59 (!cpu_is_omap3630() || (GET_OMAP_REVISION() == 0)) && 65 (!cpu_is_omap3630() || (GET_OMAP_REVISION() == 0)))
60 (!soc_is_am33xx())) {
61 pr_err("BCH 4-bit mode is not supported on this CPU\n");
62 return 0; 66 return 0;
63 }
64 67
65 return 1; 68 /* legacy platforms support only HAM1 (1-bit Hamming) ECC scheme */
69 if (ecc_opt == OMAP_ECC_HAM1_CODE_HW)
70 return 1;
71 else
72 return 0;
66} 73}
67 74
68/* This function will go away once the device-tree convertion is complete */ 75/* This function will go away once the device-tree convertion is complete */
@@ -133,8 +140,10 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
133 140
134 gpmc_update_nand_reg(&gpmc_nand_data->reg, gpmc_nand_data->cs); 141 gpmc_update_nand_reg(&gpmc_nand_data->reg, gpmc_nand_data->cs);
135 142
136 if (!gpmc_hwecc_bch_capable(gpmc_nand_data->ecc_opt)) 143 if (!gpmc_hwecc_bch_capable(gpmc_nand_data->ecc_opt)) {
144 dev_err(dev, "Unsupported NAND ECC scheme selected\n");
137 return -EINVAL; 145 return -EINVAL;
146 }
138 147
139 err = platform_device_register(&gpmc_nand_device); 148 err = platform_device_register(&gpmc_nand_device);
140 if (err < 0) { 149 if (err < 0) {
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 9428c5f9d4f2..157412e4273a 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -465,8 +465,18 @@ void __init omap3xxx_check_revision(void)
465 } 465 }
466 break; 466 break;
467 case 0xb98c: 467 case 0xb98c:
468 omap_revision = AM437X_REV_ES1_0; 468 switch (rev) {
469 cpu_rev = "1.0"; 469 case 0:
470 omap_revision = AM437X_REV_ES1_0;
471 cpu_rev = "1.0";
472 break;
473 case 1:
474 /* FALLTHROUGH */
475 default:
476 omap_revision = AM437X_REV_ES1_1;
477 cpu_rev = "1.1";
478 break;
479 }
470 break; 480 break;
471 case 0xb8f2: 481 case 0xb8f2:
472 switch (rev) { 482 switch (rev) {
@@ -657,6 +667,8 @@ static const char * __init omap_get_family(void)
657 return kasprintf(GFP_KERNEL, "OMAP4"); 667 return kasprintf(GFP_KERNEL, "OMAP4");
658 else if (soc_is_omap54xx()) 668 else if (soc_is_omap54xx())
659 return kasprintf(GFP_KERNEL, "OMAP5"); 669 return kasprintf(GFP_KERNEL, "OMAP5");
670 else if (soc_is_am43xx())
671 return kasprintf(GFP_KERNEL, "AM43xx");
660 else 672 else
661 return kasprintf(GFP_KERNEL, "Unknown"); 673 return kasprintf(GFP_KERNEL, "Unknown");
662} 674}
diff --git a/arch/arm/mach-omap2/include/mach/timex.h b/arch/arm/mach-omap2/include/mach/timex.h
deleted file mode 100644
index de9f8fc40e7c..000000000000
--- a/arch/arm/mach-omap2/include/mach/timex.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * arch/arm/mach-omap2/include/mach/timex.h
3 */
4
5#include <plat/timex.h>
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index af432b191255..f14f9ac2dca1 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -604,6 +604,7 @@ void __init am43xx_init_early(void)
604 omap_prm_base_init(); 604 omap_prm_base_init();
605 omap_cm_base_init(); 605 omap_cm_base_init();
606 omap3xxx_check_revision(); 606 omap3xxx_check_revision();
607 am33xx_check_features();
607 am43xx_powerdomains_init(); 608 am43xx_powerdomains_init();
608 am43xx_clockdomains_init(); 609 am43xx_clockdomains_init();
609 am43xx_hwmod_init(); 610 am43xx_hwmod_init();
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index e022a869bff2..6037a9a01ed5 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -222,6 +222,7 @@ void __init ti81xx_init_irq(void)
222static inline void omap_intc_handle_irq(void __iomem *base_addr, struct pt_regs *regs) 222static inline void omap_intc_handle_irq(void __iomem *base_addr, struct pt_regs *regs)
223{ 223{
224 u32 irqnr; 224 u32 irqnr;
225 int handled_irq = 0;
225 226
226 do { 227 do {
227 irqnr = readl_relaxed(base_addr + 0x98); 228 irqnr = readl_relaxed(base_addr + 0x98);
@@ -249,8 +250,15 @@ out:
249 if (irqnr) { 250 if (irqnr) {
250 irqnr = irq_find_mapping(domain, irqnr); 251 irqnr = irq_find_mapping(domain, irqnr);
251 handle_IRQ(irqnr, regs); 252 handle_IRQ(irqnr, regs);
253 handled_irq = 1;
252 } 254 }
253 } while (irqnr); 255 } while (irqnr);
256
257 /* If an irq is masked or deasserted while active, we will
258 * keep ending up here with no irq handled. So remove it from
259 * the INTC with an ack.*/
260 if (!handled_irq)
261 omap_ack_irq(NULL);
254} 262}
255 263
256asmlinkage void __exception_irq_entry omap2_intc_handle_irq(struct pt_regs *regs) 264asmlinkage void __exception_irq_entry omap2_intc_handle_irq(struct pt_regs *regs)
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h
index a722330d4d53..d121fb6df4e6 100644
--- a/arch/arm/mach-omap2/mux.h
+++ b/arch/arm/mach-omap2/mux.h
@@ -63,9 +63,6 @@
63#define OMAP_PACKAGE_CUS 5 /* 423-pin 0.65 */ 63#define OMAP_PACKAGE_CUS 5 /* 423-pin 0.65 */
64#define OMAP_PACKAGE_CBB 4 /* 515-pin 0.40 0.50 */ 64#define OMAP_PACKAGE_CBB 4 /* 515-pin 0.40 0.50 */
65#define OMAP_PACKAGE_CBC 3 /* 515-pin 0.50 0.65 */ 65#define OMAP_PACKAGE_CBC 3 /* 515-pin 0.50 0.65 */
66#define OMAP_PACKAGE_ZAC 2 /* 24xx 447-pin POP */
67#define OMAP_PACKAGE_ZAF 1 /* 2420 447-pin SIP */
68
69 66
70#define OMAP_MUX_NR_MODES 8 /* Available modes */ 67#define OMAP_MUX_NR_MODES 8 /* Available modes */
71#define OMAP_MUX_NR_SIDES 2 /* Bottom & top */ 68#define OMAP_MUX_NR_SIDES 2 /* Bottom & top */
diff --git a/arch/arm/mach-omap2/omap-iommu.c b/arch/arm/mach-omap2/omap-iommu.c
index f6daae821ebb..f1fab5684a24 100644
--- a/arch/arm/mach-omap2/omap-iommu.c
+++ b/arch/arm/mach-omap2/omap-iommu.c
@@ -10,6 +10,7 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 */ 11 */
12 12
13#include <linux/of.h>
13#include <linux/module.h> 14#include <linux/module.h>
14#include <linux/platform_device.h> 15#include <linux/platform_device.h>
15#include <linux/err.h> 16#include <linux/err.h>
@@ -58,6 +59,10 @@ static int __init omap_iommu_dev_init(struct omap_hwmod *oh, void *unused)
58 59
59static int __init omap_iommu_init(void) 60static int __init omap_iommu_init(void)
60{ 61{
62 /* If dtb is there, the devices will be created dynamically */
63 if (of_have_populated_dt())
64 return -ENODEV;
65
61 return omap_hwmod_for_each_by_class("mmu", omap_iommu_dev_init, NULL); 66 return omap_hwmod_for_each_by_class("mmu", omap_iommu_dev_init, NULL);
62} 67}
63/* must be ready before omap3isp is probed */ 68/* must be ready before omap3isp is probed */
diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c
index 3664562f9148..693fe486e917 100644
--- a/arch/arm/mach-omap2/omap-wakeupgen.c
+++ b/arch/arm/mach-omap2/omap-wakeupgen.c
@@ -138,7 +138,7 @@ static void wakeupgen_mask(struct irq_data *d)
138 unsigned long flags; 138 unsigned long flags;
139 139
140 raw_spin_lock_irqsave(&wakeupgen_lock, flags); 140 raw_spin_lock_irqsave(&wakeupgen_lock, flags);
141 _wakeupgen_clear(d->irq, irq_target_cpu[d->irq]); 141 _wakeupgen_clear(d->hwirq, irq_target_cpu[d->hwirq]);
142 raw_spin_unlock_irqrestore(&wakeupgen_lock, flags); 142 raw_spin_unlock_irqrestore(&wakeupgen_lock, flags);
143} 143}
144 144
@@ -150,7 +150,7 @@ static void wakeupgen_unmask(struct irq_data *d)
150 unsigned long flags; 150 unsigned long flags;
151 151
152 raw_spin_lock_irqsave(&wakeupgen_lock, flags); 152 raw_spin_lock_irqsave(&wakeupgen_lock, flags);
153 _wakeupgen_set(d->irq, irq_target_cpu[d->irq]); 153 _wakeupgen_set(d->hwirq, irq_target_cpu[d->hwirq]);
154 raw_spin_unlock_irqrestore(&wakeupgen_lock, flags); 154 raw_spin_unlock_irqrestore(&wakeupgen_lock, flags);
155} 155}
156 156
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index 6cd3f3772ecf..95e171a055f3 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -22,6 +22,7 @@
22#include <linux/of_platform.h> 22#include <linux/of_platform.h>
23#include <linux/export.h> 23#include <linux/export.h>
24#include <linux/irqchip/arm-gic.h> 24#include <linux/irqchip/arm-gic.h>
25#include <linux/irqchip/irq-crossbar.h>
25#include <linux/of_address.h> 26#include <linux/of_address.h>
26#include <linux/reboot.h> 27#include <linux/reboot.h>
27 28
@@ -288,5 +289,8 @@ void __init omap_gic_of_init(void)
288 289
289skip_errata_init: 290skip_errata_init:
290 omap_wakeupgen_init(); 291 omap_wakeupgen_init();
292#ifdef CONFIG_IRQ_CROSSBAR
293 irqcrossbar_init();
294#endif
291 irqchip_init(); 295 irqchip_init();
292} 296}
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 4c3b1e6df508..a123ff0070bd 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -1955,10 +1955,6 @@ static struct omap_hwmod_class omap3xxx_usb_host_hs_hwmod_class = {
1955 .sysc = &omap3xxx_usb_host_hs_sysc, 1955 .sysc = &omap3xxx_usb_host_hs_sysc,
1956}; 1956};
1957 1957
1958static struct omap_hwmod_opt_clk omap3xxx_usb_host_hs_opt_clks[] = {
1959 { .role = "ehci_logic_fck", .clk = "usbhost_120m_fck", },
1960};
1961
1962static struct omap_hwmod_irq_info omap3xxx_usb_host_hs_irqs[] = { 1958static struct omap_hwmod_irq_info omap3xxx_usb_host_hs_irqs[] = {
1963 { .name = "ohci-irq", .irq = 76 + OMAP_INTC_START, }, 1959 { .name = "ohci-irq", .irq = 76 + OMAP_INTC_START, },
1964 { .name = "ehci-irq", .irq = 77 + OMAP_INTC_START, }, 1960 { .name = "ehci-irq", .irq = 77 + OMAP_INTC_START, },
@@ -1981,8 +1977,6 @@ static struct omap_hwmod omap3xxx_usb_host_hs_hwmod = {
1981 .idlest_stdby_bit = OMAP3430ES2_ST_USBHOST_STDBY_SHIFT, 1977 .idlest_stdby_bit = OMAP3430ES2_ST_USBHOST_STDBY_SHIFT,
1982 }, 1978 },
1983 }, 1979 },
1984 .opt_clks = omap3xxx_usb_host_hs_opt_clks,
1985 .opt_clks_cnt = ARRAY_SIZE(omap3xxx_usb_host_hs_opt_clks),
1986 1980
1987 /* 1981 /*
1988 * Errata: USBHOST Configured In Smart-Idle Can Lead To a Deadlock 1982 * Errata: USBHOST Configured In Smart-Idle Can Lead To a Deadlock
@@ -3029,8 +3023,6 @@ static struct omap_hwmod omap3xxx_mmu_isp_hwmod = {
3029 .flags = HWMOD_NO_IDLEST, 3023 .flags = HWMOD_NO_IDLEST,
3030}; 3024};
3031 3025
3032#ifdef CONFIG_OMAP_IOMMU_IVA2
3033
3034/* mmu iva */ 3026/* mmu iva */
3035 3027
3036static struct omap_mmu_dev_attr mmu_iva_dev_attr = { 3028static struct omap_mmu_dev_attr mmu_iva_dev_attr = {
@@ -3070,20 +3062,22 @@ static struct omap_hwmod omap3xxx_mmu_iva_hwmod = {
3070 .name = "mmu_iva", 3062 .name = "mmu_iva",
3071 .class = &omap3xxx_mmu_hwmod_class, 3063 .class = &omap3xxx_mmu_hwmod_class,
3072 .mpu_irqs = omap3xxx_mmu_iva_irqs, 3064 .mpu_irqs = omap3xxx_mmu_iva_irqs,
3065 .clkdm_name = "iva2_clkdm",
3073 .rst_lines = omap3xxx_mmu_iva_resets, 3066 .rst_lines = omap3xxx_mmu_iva_resets,
3074 .rst_lines_cnt = ARRAY_SIZE(omap3xxx_mmu_iva_resets), 3067 .rst_lines_cnt = ARRAY_SIZE(omap3xxx_mmu_iva_resets),
3075 .main_clk = "iva2_ck", 3068 .main_clk = "iva2_ck",
3076 .prcm = { 3069 .prcm = {
3077 .omap2 = { 3070 .omap2 = {
3078 .module_offs = OMAP3430_IVA2_MOD, 3071 .module_offs = OMAP3430_IVA2_MOD,
3072 .module_bit = OMAP3430_CM_FCLKEN_IVA2_EN_IVA2_SHIFT,
3073 .idlest_reg_id = 1,
3074 .idlest_idle_bit = OMAP3430_ST_IVA2_SHIFT,
3079 }, 3075 },
3080 }, 3076 },
3081 .dev_attr = &mmu_iva_dev_attr, 3077 .dev_attr = &mmu_iva_dev_attr,
3082 .flags = HWMOD_NO_IDLEST, 3078 .flags = HWMOD_NO_IDLEST,
3083}; 3079};
3084 3080
3085#endif
3086
3087/* l4_per -> gpio4 */ 3081/* l4_per -> gpio4 */
3088static struct omap_hwmod_addr_space omap3xxx_gpio4_addrs[] = { 3082static struct omap_hwmod_addr_space omap3xxx_gpio4_addrs[] = {
3089 { 3083 {
@@ -3855,9 +3849,7 @@ static struct omap_hwmod_ocp_if *omap34xx_hwmod_ocp_ifs[] __initdata = {
3855 &omap3xxx_l4_core__hdq1w, 3849 &omap3xxx_l4_core__hdq1w,
3856 &omap3xxx_sad2d__l3, 3850 &omap3xxx_sad2d__l3,
3857 &omap3xxx_l4_core__mmu_isp, 3851 &omap3xxx_l4_core__mmu_isp,
3858#ifdef CONFIG_OMAP_IOMMU_IVA2
3859 &omap3xxx_l3_main__mmu_iva, 3852 &omap3xxx_l3_main__mmu_iva,
3860#endif
3861 &omap34xx_l4_core__ssi, 3853 &omap34xx_l4_core__ssi,
3862 NULL 3854 NULL
3863}; 3855};
@@ -3881,9 +3873,7 @@ static struct omap_hwmod_ocp_if *omap36xx_hwmod_ocp_ifs[] __initdata = {
3881 &omap3xxx_l4_core__hdq1w, 3873 &omap3xxx_l4_core__hdq1w,
3882 &omap3xxx_sad2d__l3, 3874 &omap3xxx_sad2d__l3,
3883 &omap3xxx_l4_core__mmu_isp, 3875 &omap3xxx_l4_core__mmu_isp,
3884#ifdef CONFIG_OMAP_IOMMU_IVA2
3885 &omap3xxx_l3_main__mmu_iva, 3876 &omap3xxx_l3_main__mmu_iva,
3886#endif
3887 NULL 3877 NULL
3888}; 3878};
3889 3879
diff --git a/arch/arm/mach-omap2/omap_hwmod_43xx_data.c b/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
index 9002fca76699..5c2cc8083fdd 100644
--- a/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
@@ -719,6 +719,7 @@ static struct omap_hwmod_ocp_if *am43xx_hwmod_ocp_ifs[] __initdata = {
719 &am33xx_l4_ls__uart4, 719 &am33xx_l4_ls__uart4,
720 &am33xx_l4_ls__uart5, 720 &am33xx_l4_ls__uart5,
721 &am33xx_l4_ls__uart6, 721 &am33xx_l4_ls__uart6,
722 &am33xx_l4_ls__spinlock,
722 &am33xx_l4_ls__elm, 723 &am33xx_l4_ls__elm,
723 &am33xx_l4_ls__epwmss0, 724 &am33xx_l4_ls__epwmss0,
724 &am33xx_epwmss0__ecap0, 725 &am33xx_epwmss0__ecap0,
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 3318cae96e7d..1219280bb976 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -2541,8 +2541,7 @@ static struct omap_hwmod_class_sysconfig omap44xx_spinlock_sysc = {
2541 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY | 2541 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
2542 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | 2542 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
2543 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS), 2543 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
2544 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 2544 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
2545 SIDLE_SMART_WKUP),
2546 .sysc_fields = &omap_hwmod_sysc_type1, 2545 .sysc_fields = &omap_hwmod_sysc_type1,
2547}; 2546};
2548 2547
diff --git a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
index e297d6231c3a..892317294fdc 100644
--- a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
@@ -1122,6 +1122,71 @@ static struct omap_hwmod omap54xx_mmc5_hwmod = {
1122}; 1122};
1123 1123
1124/* 1124/*
1125 * 'mmu' class
1126 * The memory management unit performs virtual to physical address translation
1127 * for its requestors.
1128 */
1129
1130static struct omap_hwmod_class_sysconfig omap54xx_mmu_sysc = {
1131 .rev_offs = 0x0000,
1132 .sysc_offs = 0x0010,
1133 .syss_offs = 0x0014,
1134 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
1135 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
1136 SYSS_HAS_RESET_STATUS),
1137 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1138 .sysc_fields = &omap_hwmod_sysc_type1,
1139};
1140
1141static struct omap_hwmod_class omap54xx_mmu_hwmod_class = {
1142 .name = "mmu",
1143 .sysc = &omap54xx_mmu_sysc,
1144};
1145
1146static struct omap_hwmod_rst_info omap54xx_mmu_dsp_resets[] = {
1147 { .name = "mmu_cache", .rst_shift = 1 },
1148};
1149
1150static struct omap_hwmod omap54xx_mmu_dsp_hwmod = {
1151 .name = "mmu_dsp",
1152 .class = &omap54xx_mmu_hwmod_class,
1153 .clkdm_name = "dsp_clkdm",
1154 .rst_lines = omap54xx_mmu_dsp_resets,
1155 .rst_lines_cnt = ARRAY_SIZE(omap54xx_mmu_dsp_resets),
1156 .main_clk = "dpll_iva_h11x2_ck",
1157 .prcm = {
1158 .omap4 = {
1159 .clkctrl_offs = OMAP54XX_CM_DSP_DSP_CLKCTRL_OFFSET,
1160 .rstctrl_offs = OMAP54XX_RM_DSP_RSTCTRL_OFFSET,
1161 .context_offs = OMAP54XX_RM_DSP_DSP_CONTEXT_OFFSET,
1162 .modulemode = MODULEMODE_HWCTRL,
1163 },
1164 },
1165};
1166
1167/* mmu ipu */
1168static struct omap_hwmod_rst_info omap54xx_mmu_ipu_resets[] = {
1169 { .name = "mmu_cache", .rst_shift = 2 },
1170};
1171
1172static struct omap_hwmod omap54xx_mmu_ipu_hwmod = {
1173 .name = "mmu_ipu",
1174 .class = &omap54xx_mmu_hwmod_class,
1175 .clkdm_name = "ipu_clkdm",
1176 .rst_lines = omap54xx_mmu_ipu_resets,
1177 .rst_lines_cnt = ARRAY_SIZE(omap54xx_mmu_ipu_resets),
1178 .main_clk = "dpll_core_h22x2_ck",
1179 .prcm = {
1180 .omap4 = {
1181 .clkctrl_offs = OMAP54XX_CM_IPU_IPU_CLKCTRL_OFFSET,
1182 .rstctrl_offs = OMAP54XX_RM_IPU_RSTCTRL_OFFSET,
1183 .context_offs = OMAP54XX_RM_IPU_IPU_CONTEXT_OFFSET,
1184 .modulemode = MODULEMODE_HWCTRL,
1185 },
1186 },
1187};
1188
1189/*
1125 * 'mpu' class 1190 * 'mpu' class
1126 * mpu sub-system 1191 * mpu sub-system
1127 */ 1192 */
@@ -1763,6 +1828,14 @@ static struct omap_hwmod_ocp_if omap54xx_l4_cfg__l3_main_1 = {
1763 .user = OCP_USER_MPU | OCP_USER_SDMA, 1828 .user = OCP_USER_MPU | OCP_USER_SDMA,
1764}; 1829};
1765 1830
1831/* l4_cfg -> mmu_dsp */
1832static struct omap_hwmod_ocp_if omap54xx_l4_cfg__mmu_dsp = {
1833 .master = &omap54xx_l4_cfg_hwmod,
1834 .slave = &omap54xx_mmu_dsp_hwmod,
1835 .clk = "l4_root_clk_div",
1836 .user = OCP_USER_MPU | OCP_USER_SDMA,
1837};
1838
1766/* mpu -> l3_main_1 */ 1839/* mpu -> l3_main_1 */
1767static struct omap_hwmod_ocp_if omap54xx_mpu__l3_main_1 = { 1840static struct omap_hwmod_ocp_if omap54xx_mpu__l3_main_1 = {
1768 .master = &omap54xx_mpu_hwmod, 1841 .master = &omap54xx_mpu_hwmod,
@@ -1787,6 +1860,14 @@ static struct omap_hwmod_ocp_if omap54xx_l4_cfg__l3_main_2 = {
1787 .user = OCP_USER_MPU | OCP_USER_SDMA, 1860 .user = OCP_USER_MPU | OCP_USER_SDMA,
1788}; 1861};
1789 1862
1863/* l3_main_2 -> mmu_ipu */
1864static struct omap_hwmod_ocp_if omap54xx_l3_main_2__mmu_ipu = {
1865 .master = &omap54xx_l3_main_2_hwmod,
1866 .slave = &omap54xx_mmu_ipu_hwmod,
1867 .clk = "l3_iclk_div",
1868 .user = OCP_USER_MPU | OCP_USER_SDMA,
1869};
1870
1790/* l3_main_1 -> l3_main_3 */ 1871/* l3_main_1 -> l3_main_3 */
1791static struct omap_hwmod_ocp_if omap54xx_l3_main_1__l3_main_3 = { 1872static struct omap_hwmod_ocp_if omap54xx_l3_main_1__l3_main_3 = {
1792 .master = &omap54xx_l3_main_1_hwmod, 1873 .master = &omap54xx_l3_main_1_hwmod,
@@ -2345,6 +2426,7 @@ static struct omap_hwmod_ocp_if *omap54xx_hwmod_ocp_ifs[] __initdata = {
2345 &omap54xx_l4_wkup__counter_32k, 2426 &omap54xx_l4_wkup__counter_32k,
2346 &omap54xx_l4_cfg__dma_system, 2427 &omap54xx_l4_cfg__dma_system,
2347 &omap54xx_l4_abe__dmic, 2428 &omap54xx_l4_abe__dmic,
2429 &omap54xx_l4_cfg__mmu_dsp,
2348 &omap54xx_mpu__emif1, 2430 &omap54xx_mpu__emif1,
2349 &omap54xx_mpu__emif2, 2431 &omap54xx_mpu__emif2,
2350 &omap54xx_l4_wkup__gpio1, 2432 &omap54xx_l4_wkup__gpio1,
@@ -2360,6 +2442,7 @@ static struct omap_hwmod_ocp_if *omap54xx_hwmod_ocp_ifs[] __initdata = {
2360 &omap54xx_l4_per__i2c3, 2442 &omap54xx_l4_per__i2c3,
2361 &omap54xx_l4_per__i2c4, 2443 &omap54xx_l4_per__i2c4,
2362 &omap54xx_l4_per__i2c5, 2444 &omap54xx_l4_per__i2c5,
2445 &omap54xx_l3_main_2__mmu_ipu,
2363 &omap54xx_l4_wkup__kbd, 2446 &omap54xx_l4_wkup__kbd,
2364 &omap54xx_l4_cfg__mailbox, 2447 &omap54xx_l4_cfg__mailbox,
2365 &omap54xx_l4_abe__mcbsp1, 2448 &omap54xx_l4_abe__mcbsp1,
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index c33e07e2f0d4..c3b73351cb7a 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -16,12 +16,14 @@
16#include <linux/wl12xx.h> 16#include <linux/wl12xx.h>
17 17
18#include <linux/platform_data/pinctrl-single.h> 18#include <linux/platform_data/pinctrl-single.h>
19#include <linux/platform_data/iommu-omap.h>
19 20
20#include "am35xx.h" 21#include "am35xx.h"
21#include "common.h" 22#include "common.h"
22#include "common-board-devices.h" 23#include "common-board-devices.h"
23#include "dss-common.h" 24#include "dss-common.h"
24#include "control.h" 25#include "control.h"
26#include "omap_device.h"
25#include "omap-secure.h" 27#include "omap-secure.h"
26#include "soc.h" 28#include "soc.h"
27 29
@@ -33,20 +35,6 @@ struct pdata_init {
33struct of_dev_auxdata omap_auxdata_lookup[]; 35struct of_dev_auxdata omap_auxdata_lookup[];
34static struct twl4030_gpio_platform_data twl_gpio_auxdata; 36static struct twl4030_gpio_platform_data twl_gpio_auxdata;
35 37
36/*
37 * Create alias for USB host PHY clock.
38 * Remove this when clock phandle can be provided via DT
39 */
40static void __init __used legacy_init_ehci_clk(char *clkname)
41{
42 int ret;
43
44 ret = clk_add_alias("main_clk", NULL, clkname, NULL);
45 if (ret)
46 pr_err("%s:Failed to add main_clk alias to %s :%d\n",
47 __func__, clkname, ret);
48}
49
50#if IS_ENABLED(CONFIG_WL12XX) 38#if IS_ENABLED(CONFIG_WL12XX)
51 39
52static struct wl12xx_platform_data wl12xx __initdata; 40static struct wl12xx_platform_data wl12xx __initdata;
@@ -94,6 +82,12 @@ static void __init hsmmc2_internal_input_clk(void)
94 omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1); 82 omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1);
95} 83}
96 84
85static struct iommu_platform_data omap3_iommu_pdata = {
86 .reset_name = "mmu",
87 .assert_reset = omap_device_assert_hardreset,
88 .deassert_reset = omap_device_deassert_hardreset,
89};
90
97static int omap3_sbc_t3730_twl_callback(struct device *dev, 91static int omap3_sbc_t3730_twl_callback(struct device *dev,
98 unsigned gpio, 92 unsigned gpio,
99 unsigned ngpio) 93 unsigned ngpio)
@@ -101,7 +95,7 @@ static int omap3_sbc_t3730_twl_callback(struct device *dev,
101 int res; 95 int res;
102 96
103 res = gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH, 97 res = gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH,
104 "wlan rst"); 98 "wlan pwr");
105 if (res) 99 if (res)
106 return res; 100 return res;
107 101
@@ -110,6 +104,23 @@ static int omap3_sbc_t3730_twl_callback(struct device *dev,
110 return 0; 104 return 0;
111} 105}
112 106
107static void __init omap3_sbc_t3x_usb_hub_init(int gpio, char *hub_name)
108{
109 int err = gpio_request_one(gpio, GPIOF_OUT_INIT_LOW, hub_name);
110
111 if (err) {
112 pr_err("SBC-T3x: %s reset gpio request failed: %d\n",
113 hub_name, err);
114 return;
115 }
116
117 gpio_export(gpio, 0);
118
119 udelay(10);
120 gpio_set_value(gpio, 1);
121 msleep(1);
122}
123
113static void __init omap3_sbc_t3730_twl_init(void) 124static void __init omap3_sbc_t3730_twl_init(void)
114{ 125{
115 twl_gpio_auxdata.setup = omap3_sbc_t3730_twl_callback; 126 twl_gpio_auxdata.setup = omap3_sbc_t3730_twl_callback;
@@ -117,13 +128,19 @@ static void __init omap3_sbc_t3730_twl_init(void)
117 128
118static void __init omap3_sbc_t3730_legacy_init(void) 129static void __init omap3_sbc_t3730_legacy_init(void)
119{ 130{
131 omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
120 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 136); 132 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 136);
121 omap_ads7846_init(1, 57, 0, NULL); 133 omap_ads7846_init(1, 57, 0, NULL);
122} 134}
123 135
136static void __init omap3_sbc_t3530_legacy_init(void)
137{
138 omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
139 omap_ads7846_init(1, 57, 0, NULL);
140}
141
124static void __init omap3_igep0020_legacy_init(void) 142static void __init omap3_igep0020_legacy_init(void)
125{ 143{
126 omap3_igep2_display_init_of();
127} 144}
128 145
129static void __init omap3_evm_legacy_init(void) 146static void __init omap3_evm_legacy_init(void)
@@ -162,7 +179,7 @@ static struct emac_platform_data am35xx_emac_pdata = {
162 .interrupt_disable = am35xx_disable_emac_int, 179 .interrupt_disable = am35xx_disable_emac_int,
163}; 180};
164 181
165static void __init am3517_evm_legacy_init(void) 182static void __init am35xx_emac_reset(void)
166{ 183{
167 u32 v; 184 u32 v;
168 185
@@ -172,6 +189,43 @@ static void __init am3517_evm_legacy_init(void)
172 omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */ 189 omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */
173} 190}
174 191
192static struct gpio cm_t3517_wlan_gpios[] __initdata = {
193 { 56, GPIOF_OUT_INIT_HIGH, "wlan pwr" },
194 { 4, GPIOF_OUT_INIT_HIGH, "xcvr noe" },
195};
196
197static void __init omap3_sbc_t3517_wifi_init(void)
198{
199 int err = gpio_request_array(cm_t3517_wlan_gpios,
200 ARRAY_SIZE(cm_t3517_wlan_gpios));
201 if (err) {
202 pr_err("SBC-T3517: wl12xx gpios request failed: %d\n", err);
203 return;
204 }
205
206 gpio_export(cm_t3517_wlan_gpios[0].gpio, 0);
207 gpio_export(cm_t3517_wlan_gpios[1].gpio, 0);
208
209 msleep(100);
210 gpio_set_value(cm_t3517_wlan_gpios[1].gpio, 0);
211}
212
213static void __init omap3_sbc_t3517_legacy_init(void)
214{
215 omap3_sbc_t3x_usb_hub_init(152, "cm-t3517 usb hub");
216 omap3_sbc_t3x_usb_hub_init(98, "sb-t35 usb hub");
217 am35xx_emac_reset();
218 hsmmc2_internal_input_clk();
219 omap3_sbc_t3517_wifi_init();
220 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 145);
221 omap_ads7846_init(1, 57, 0, NULL);
222}
223
224static void __init am3517_evm_legacy_init(void)
225{
226 am35xx_emac_reset();
227}
228
175static void __init nokia_n900_legacy_init(void) 229static void __init nokia_n900_legacy_init(void)
176{ 230{
177 hsmmc2_internal_input_clk(); 231 hsmmc2_internal_input_clk();
@@ -192,23 +246,34 @@ static void __init nokia_n900_legacy_init(void)
192#ifdef CONFIG_ARCH_OMAP4 246#ifdef CONFIG_ARCH_OMAP4
193static void __init omap4_sdp_legacy_init(void) 247static void __init omap4_sdp_legacy_init(void)
194{ 248{
195 omap_4430sdp_display_init_of();
196 legacy_init_wl12xx(WL12XX_REFCLOCK_26, 249 legacy_init_wl12xx(WL12XX_REFCLOCK_26,
197 WL12XX_TCXOCLOCK_26, 53); 250 WL12XX_TCXOCLOCK_26, 53);
198} 251}
199 252
200static void __init omap4_panda_legacy_init(void) 253static void __init omap4_panda_legacy_init(void)
201{ 254{
202 omap4_panda_display_init_of();
203 legacy_init_ehci_clk("auxclk3_ck");
204 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 53); 255 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 53);
205} 256}
206#endif 257#endif
207 258
259#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
260static struct iommu_platform_data omap4_iommu_pdata = {
261 .reset_name = "mmu_cache",
262 .assert_reset = omap_device_assert_hardreset,
263 .deassert_reset = omap_device_deassert_hardreset,
264};
265#endif
266
267#ifdef CONFIG_SOC_AM33XX
268static void __init am335x_evmsk_legacy_init(void)
269{
270 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 31);
271}
272#endif
273
208#ifdef CONFIG_SOC_OMAP5 274#ifdef CONFIG_SOC_OMAP5
209static void __init omap5_uevm_legacy_init(void) 275static void __init omap5_uevm_legacy_init(void)
210{ 276{
211 legacy_init_ehci_clk("auxclk1_ck");
212} 277}
213#endif 278#endif
214 279
@@ -259,6 +324,8 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
259 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata), 324 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata),
260 OF_DEV_AUXDATA("ti,omap3-padconf", 0x480025a0, "480025a0.pinmux", &pcs_pdata), 325 OF_DEV_AUXDATA("ti,omap3-padconf", 0x480025a0, "480025a0.pinmux", &pcs_pdata),
261 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata), 326 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata),
327 OF_DEV_AUXDATA("ti,omap2-iommu", 0x5d000000, "5d000000.mmu",
328 &omap3_iommu_pdata),
262 /* Only on am3517 */ 329 /* Only on am3517 */
263 OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL), 330 OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL),
264 OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0", 331 OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0",
@@ -268,6 +335,12 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
268 OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a100040, "4a100040.pinmux", &pcs_pdata), 335 OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a100040, "4a100040.pinmux", &pcs_pdata),
269 OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a31e040, "4a31e040.pinmux", &pcs_pdata), 336 OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a31e040, "4a31e040.pinmux", &pcs_pdata),
270#endif 337#endif
338#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
339 OF_DEV_AUXDATA("ti,omap4-iommu", 0x4a066000, "4a066000.mmu",
340 &omap4_iommu_pdata),
341 OF_DEV_AUXDATA("ti,omap4-iommu", 0x55082000, "55082000.mmu",
342 &omap4_iommu_pdata),
343#endif
271 { /* sentinel */ }, 344 { /* sentinel */ },
272}; 345};
273 346
@@ -277,6 +350,8 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
277 */ 350 */
278static struct pdata_init pdata_quirks[] __initdata = { 351static struct pdata_init pdata_quirks[] __initdata = {
279#ifdef CONFIG_ARCH_OMAP3 352#ifdef CONFIG_ARCH_OMAP3
353 { "compulab,omap3-sbc-t3517", omap3_sbc_t3517_legacy_init, },
354 { "compulab,omap3-sbc-t3530", omap3_sbc_t3530_legacy_init, },
280 { "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, }, 355 { "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, },
281 { "nokia,omap3-n900", nokia_n900_legacy_init, }, 356 { "nokia,omap3-n900", nokia_n900_legacy_init, },
282 { "nokia,omap3-n9", hsmmc2_internal_input_clk, }, 357 { "nokia,omap3-n9", hsmmc2_internal_input_clk, },
@@ -290,6 +365,9 @@ static struct pdata_init pdata_quirks[] __initdata = {
290 { "ti,omap4-sdp", omap4_sdp_legacy_init, }, 365 { "ti,omap4-sdp", omap4_sdp_legacy_init, },
291 { "ti,omap4-panda", omap4_panda_legacy_init, }, 366 { "ti,omap4-panda", omap4_panda_legacy_init, },
292#endif 367#endif
368#ifdef CONFIG_SOC_AM33XX
369 { "ti,am335x-evmsk", am335x_evmsk_legacy_init, },
370#endif
293#ifdef CONFIG_SOC_OMAP5 371#ifdef CONFIG_SOC_OMAP5
294 { "ti,omap5-uevm", omap5_uevm_legacy_init, }, 372 { "ti,omap5-uevm", omap5_uevm_legacy_init, },
295#endif 373#endif
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index 7bdd22afce69..d4d0fce325c7 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -103,7 +103,7 @@ static inline void enable_omap3630_toggle_l2_on_restore(void) { }
103 103
104#define PM_OMAP4_ROM_SMP_BOOT_ERRATUM_GICD (1 << 0) 104#define PM_OMAP4_ROM_SMP_BOOT_ERRATUM_GICD (1 << 0)
105 105
106#if defined(CONFIG_ARCH_OMAP4) 106#if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP4)
107extern u16 pm44xx_errata; 107extern u16 pm44xx_errata;
108#define IS_PM44XX_ERRATUM(id) (pm44xx_errata & (id)) 108#define IS_PM44XX_ERRATUM(id) (pm44xx_errata & (id))
109#else 109#else
diff --git a/arch/arm/mach-omap2/prminst44xx.c b/arch/arm/mach-omap2/prminst44xx.c
index 280f3c58abe5..05fcf6de44ee 100644
--- a/arch/arm/mach-omap2/prminst44xx.c
+++ b/arch/arm/mach-omap2/prminst44xx.c
@@ -25,6 +25,7 @@
25#include "prminst44xx.h" 25#include "prminst44xx.h"
26#include "prm-regbits-44xx.h" 26#include "prm-regbits-44xx.h"
27#include "prcm44xx.h" 27#include "prcm44xx.h"
28#include "prcm43xx.h"
28#include "prcm_mpu44xx.h" 29#include "prcm_mpu44xx.h"
29#include "soc.h" 30#include "soc.h"
30 31
@@ -176,6 +177,8 @@ void omap4_prminst_global_warm_sw_reset(void)
176 dev_inst = OMAP54XX_PRM_DEVICE_INST; 177 dev_inst = OMAP54XX_PRM_DEVICE_INST;
177 else if (soc_is_dra7xx()) 178 else if (soc_is_dra7xx())
178 dev_inst = DRA7XX_PRM_DEVICE_INST; 179 dev_inst = DRA7XX_PRM_DEVICE_INST;
180 else if (soc_is_am43xx())
181 dev_inst = AM43XX_PRM_DEVICE_INST;
179 else 182 else
180 return; 183 return;
181 184
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
index 076bd90a6ce0..30abcc8b20e0 100644
--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -438,7 +438,8 @@ IS_OMAP_TYPE(3430, 0x3430)
438#define AM335X_REV_ES2_1 (AM335X_CLASS | (0x2 << 8)) 438#define AM335X_REV_ES2_1 (AM335X_CLASS | (0x2 << 8))
439 439
440#define AM437X_CLASS 0x43700000 440#define AM437X_CLASS 0x43700000
441#define AM437X_REV_ES1_0 AM437X_CLASS 441#define AM437X_REV_ES1_0 (AM437X_CLASS | (0x10 << 8))
442#define AM437X_REV_ES1_1 (AM437X_CLASS | (0x11 << 8))
442 443
443#define OMAP443X_CLASS 0x44300044 444#define OMAP443X_CLASS 0x44300044
444#define OMAP4430_REV_ES1_0 (OMAP443X_CLASS | (0x10 << 8)) 445#define OMAP4430_REV_ES1_0 (OMAP443X_CLASS | (0x10 << 8))
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 74044aaf438b..b62de9f9d05c 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -604,7 +604,8 @@ OMAP_SYS_32K_TIMER_INIT(3_secure, 12, "secure_32k_fck", "ti,timer-secure",
604 2, "timer_sys_ck", NULL); 604 2, "timer_sys_ck", NULL);
605#endif /* CONFIG_ARCH_OMAP3 */ 605#endif /* CONFIG_ARCH_OMAP3 */
606 606
607#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX) 607#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX) || \
608 defined(CONFIG_SOC_AM43XX)
608OMAP_SYS_GP_TIMER_INIT(3, 2, "timer_sys_ck", NULL, 609OMAP_SYS_GP_TIMER_INIT(3, 2, "timer_sys_ck", NULL,
609 1, "timer_sys_ck", "ti,timer-alwon"); 610 1, "timer_sys_ck", "ti,timer-alwon");
610#endif 611#endif
diff --git a/arch/arm/mach-orion5x/Kconfig b/arch/arm/mach-orion5x/Kconfig
index 2cb2f06c20f5..14f2cae4109c 100644
--- a/arch/arm/mach-orion5x/Kconfig
+++ b/arch/arm/mach-orion5x/Kconfig
@@ -33,7 +33,6 @@ config MACH_KUROBOX_PRO
33config MACH_DNS323 33config MACH_DNS323
34 bool "D-Link DNS-323" 34 bool "D-Link DNS-323"
35 select I2C_BOARDINFO 35 select I2C_BOARDINFO
36 select PHYLIB
37 help 36 help
38 Say 'Y' here if you want your kernel to support the 37 Say 'Y' here if you want your kernel to support the
39 D-Link DNS-323 platform. 38 D-Link DNS-323 platform.
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
index 70974732cbf0..56edeab17b68 100644
--- a/arch/arm/mach-orion5x/dns323-setup.c
+++ b/arch/arm/mach-orion5x/dns323-setup.c
@@ -642,6 +642,8 @@ static void __init dns323_init(void)
642 platform_device_register_simple("dns323c-fan", 0, NULL, 0); 642 platform_device_register_simple("dns323c-fan", 0, NULL, 0);
643 643
644 /* Register fixup for the PHY LEDs */ 644 /* Register fixup for the PHY LEDs */
645 if (!IS_BUILTIN(CONFIG_PHYLIB))
646 break;
645 phy_register_fixup_for_uid(MARVELL_PHY_ID_88E1118, 647 phy_register_fixup_for_uid(MARVELL_PHY_ID_88E1118,
646 MARVELL_PHY_ID_MASK, 648 MARVELL_PHY_ID_MASK,
647 dns323c_phy_fixup); 649 dns323c_phy_fixup);
diff --git a/arch/arm/mach-orion5x/include/mach/bridge-regs.h b/arch/arm/mach-orion5x/include/mach/bridge-regs.h
index f727d03f1688..5766e3fbff69 100644
--- a/arch/arm/mach-orion5x/include/mach/bridge-regs.h
+++ b/arch/arm/mach-orion5x/include/mach/bridge-regs.h
@@ -18,6 +18,7 @@
18#define CPU_CTRL (ORION5X_BRIDGE_VIRT_BASE + 0x104) 18#define CPU_CTRL (ORION5X_BRIDGE_VIRT_BASE + 0x104)
19 19
20#define RSTOUTn_MASK (ORION5X_BRIDGE_VIRT_BASE + 0x108) 20#define RSTOUTn_MASK (ORION5X_BRIDGE_VIRT_BASE + 0x108)
21#define RSTOUTn_MASK_PHYS (ORION5X_BRIDGE_PHYS_BASE + 0x108)
21 22
22#define CPU_SOFT_RESET (ORION5X_BRIDGE_VIRT_BASE + 0x10c) 23#define CPU_SOFT_RESET (ORION5X_BRIDGE_VIRT_BASE + 0x10c)
23 24
diff --git a/arch/arm/mach-orion5x/include/mach/timex.h b/arch/arm/mach-orion5x/include/mach/timex.h
deleted file mode 100644
index 4c69820e0810..000000000000
--- a/arch/arm/mach-orion5x/include/mach/timex.h
+++ /dev/null
@@ -1,11 +0,0 @@
1/*
2 * arch/arm/mach-orion5x/include/mach/timex.h
3 *
4 * Tzachi Perelstein <tzachi@marvell.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#define CLOCK_TICK_RATE (100 * HZ)
diff --git a/arch/arm/mach-picoxcell/Kconfig b/arch/arm/mach-picoxcell/Kconfig
index b1022f4315f7..62240f69b4ee 100644
--- a/arch/arm/mach-picoxcell/Kconfig
+++ b/arch/arm/mach-picoxcell/Kconfig
@@ -1,12 +1,7 @@
1config ARCH_PICOXCELL 1config ARCH_PICOXCELL
2 bool "Picochip PicoXcell" if ARCH_MULTI_V6 2 bool "Picochip PicoXcell" if ARCH_MULTI_V6
3 select ARCH_REQUIRE_GPIOLIB 3 select ARCH_REQUIRE_GPIOLIB
4 select ARM_PATCH_PHYS_VIRT
5 select ARM_VIC 4 select ARM_VIC
6 select CPU_V6K
7 select DW_APB_TIMER_OF 5 select DW_APB_TIMER_OF
8 select GENERIC_CLOCKEVENTS
9 select HAVE_TCM 6 select HAVE_TCM
10 select NO_IOPORT 7 select NO_IOPORT_MAP
11 select SPARSE_IRQ
12 select USE_OF
diff --git a/arch/arm/mach-prima2/Kconfig b/arch/arm/mach-prima2/Kconfig
index 6988b117fc17..e4e505f52ba0 100644
--- a/arch/arm/mach-prima2/Kconfig
+++ b/arch/arm/mach-prima2/Kconfig
@@ -1,10 +1,9 @@
1config ARCH_SIRF 1config ARCH_SIRF
2 bool "CSR SiRF" if ARCH_MULTI_V7 2 bool "CSR SiRF" if ARCH_MULTI_V7
3 select ARCH_HAS_RESET_CONTROLLER
3 select ARCH_REQUIRE_GPIOLIB 4 select ARCH_REQUIRE_GPIOLIB
4 select GENERIC_CLOCKEVENTS
5 select GENERIC_IRQ_CHIP 5 select GENERIC_IRQ_CHIP
6 select MIGHT_HAVE_CACHE_L2X0 6 select NO_IOPORT_MAP
7 select NO_IOPORT
8 select PINCTRL 7 select PINCTRL
9 select PINCTRL_SIRF 8 select PINCTRL_SIRF
10 help 9 help
@@ -17,7 +16,6 @@ menu "CSR SiRF atlas6/primaII/Marco/Polo Specific Features"
17config ARCH_ATLAS6 16config ARCH_ATLAS6
18 bool "CSR SiRFSoC ATLAS6 ARM Cortex A9 Platform" 17 bool "CSR SiRFSoC ATLAS6 ARM Cortex A9 Platform"
19 default y 18 default y
20 select CPU_V7
21 select SIRF_IRQ 19 select SIRF_IRQ
22 help 20 help
23 Support for CSR SiRFSoC ARM Cortex A9 Platform 21 Support for CSR SiRFSoC ARM Cortex A9 Platform
@@ -25,7 +23,6 @@ config ARCH_ATLAS6
25config ARCH_PRIMA2 23config ARCH_PRIMA2
26 bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform" 24 bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform"
27 default y 25 default y
28 select CPU_V7
29 select SIRF_IRQ 26 select SIRF_IRQ
30 select ZONE_DMA 27 select ZONE_DMA
31 help 28 help
@@ -35,9 +32,7 @@ config ARCH_MARCO
35 bool "CSR SiRFSoC MARCO ARM Cortex A9 Platform" 32 bool "CSR SiRFSoC MARCO ARM Cortex A9 Platform"
36 default y 33 default y
37 select ARM_GIC 34 select ARM_GIC
38 select CPU_V7
39 select HAVE_ARM_SCU if SMP 35 select HAVE_ARM_SCU if SMP
40 select HAVE_SMP
41 select SMP_ON_UP if SMP 36 select SMP_ON_UP if SMP
42 help 37 help
43 Support for CSR SiRFSoC ARM Cortex A9 Platform 38 Support for CSR SiRFSoC ARM Cortex A9 Platform
diff --git a/arch/arm/mach-prima2/common.c b/arch/arm/mach-prima2/common.c
index d49aff74de98..47c7819edb9b 100644
--- a/arch/arm/mach-prima2/common.c
+++ b/arch/arm/mach-prima2/common.c
@@ -15,7 +15,7 @@
15#include <linux/of_platform.h> 15#include <linux/of_platform.h>
16#include "common.h" 16#include "common.h"
17 17
18void __init sirfsoc_init_late(void) 18static void __init sirfsoc_init_late(void)
19{ 19{
20 sirfsoc_pm_init(); 20 sirfsoc_pm_init();
21} 21}
@@ -27,7 +27,7 @@ static __init void sirfsoc_map_io(void)
27} 27}
28 28
29#ifdef CONFIG_ARCH_ATLAS6 29#ifdef CONFIG_ARCH_ATLAS6
30static const char *atlas6_dt_match[] __initdata = { 30static const char *atlas6_dt_match[] __initconst = {
31 "sirf,atlas6", 31 "sirf,atlas6",
32 NULL 32 NULL
33}; 33};
@@ -37,12 +37,11 @@ DT_MACHINE_START(ATLAS6_DT, "Generic ATLAS6 (Flattened Device Tree)")
37 .map_io = sirfsoc_map_io, 37 .map_io = sirfsoc_map_io,
38 .init_late = sirfsoc_init_late, 38 .init_late = sirfsoc_init_late,
39 .dt_compat = atlas6_dt_match, 39 .dt_compat = atlas6_dt_match,
40 .restart = sirfsoc_restart,
41MACHINE_END 40MACHINE_END
42#endif 41#endif
43 42
44#ifdef CONFIG_ARCH_PRIMA2 43#ifdef CONFIG_ARCH_PRIMA2
45static const char *prima2_dt_match[] __initdata = { 44static const char *prima2_dt_match[] __initconst = {
46 "sirf,prima2", 45 "sirf,prima2",
47 NULL 46 NULL
48}; 47};
@@ -53,12 +52,11 @@ DT_MACHINE_START(PRIMA2_DT, "Generic PRIMA2 (Flattened Device Tree)")
53 .dma_zone_size = SZ_256M, 52 .dma_zone_size = SZ_256M,
54 .init_late = sirfsoc_init_late, 53 .init_late = sirfsoc_init_late,
55 .dt_compat = prima2_dt_match, 54 .dt_compat = prima2_dt_match,
56 .restart = sirfsoc_restart,
57MACHINE_END 55MACHINE_END
58#endif 56#endif
59 57
60#ifdef CONFIG_ARCH_MARCO 58#ifdef CONFIG_ARCH_MARCO
61static const char *marco_dt_match[] __initdata = { 59static const char *marco_dt_match[] __initconst = {
62 "sirf,marco", 60 "sirf,marco",
63 NULL 61 NULL
64}; 62};
@@ -69,6 +67,5 @@ DT_MACHINE_START(MARCO_DT, "Generic MARCO (Flattened Device Tree)")
69 .map_io = sirfsoc_map_io, 67 .map_io = sirfsoc_map_io,
70 .init_late = sirfsoc_init_late, 68 .init_late = sirfsoc_init_late,
71 .dt_compat = marco_dt_match, 69 .dt_compat = marco_dt_match,
72 .restart = sirfsoc_restart,
73MACHINE_END 70MACHINE_END
74#endif 71#endif
diff --git a/arch/arm/mach-prima2/common.h b/arch/arm/mach-prima2/common.h
index 4b768060a858..07d3e5ed9264 100644
--- a/arch/arm/mach-prima2/common.h
+++ b/arch/arm/mach-prima2/common.h
@@ -23,7 +23,6 @@ extern void sirfsoc_secondary_startup(void);
23extern void sirfsoc_cpu_die(unsigned int cpu); 23extern void sirfsoc_cpu_die(unsigned int cpu);
24 24
25extern void __init sirfsoc_of_irq_init(void); 25extern void __init sirfsoc_of_irq_init(void);
26extern void sirfsoc_restart(enum reboot_mode, const char *);
27extern asmlinkage void __exception_irq_entry sirfsoc_handle_irq(struct pt_regs *regs); 26extern asmlinkage void __exception_irq_entry sirfsoc_handle_irq(struct pt_regs *regs);
28 27
29#ifndef CONFIG_DEBUG_LL 28#ifndef CONFIG_DEBUG_LL
diff --git a/arch/arm/mach-prima2/l2x0.c b/arch/arm/mach-prima2/l2x0.c
index cbcbe9cb094c..c7102539c0b0 100644
--- a/arch/arm/mach-prima2/l2x0.c
+++ b/arch/arm/mach-prima2/l2x0.c
@@ -11,24 +11,23 @@
11#include <linux/of.h> 11#include <linux/of.h>
12#include <asm/hardware/cache-l2x0.h> 12#include <asm/hardware/cache-l2x0.h>
13 13
14struct l2x0_aux 14struct l2x0_aux {
15{
16 u32 val; 15 u32 val;
17 u32 mask; 16 u32 mask;
18}; 17};
19 18
20static struct l2x0_aux prima2_l2x0_aux __initconst = { 19static const struct l2x0_aux prima2_l2x0_aux __initconst = {
21 .val = 2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT, 20 .val = 2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT,
22 .mask = 0, 21 .mask = 0,
23}; 22};
24 23
25static struct l2x0_aux marco_l2x0_aux __initconst = { 24static const struct l2x0_aux marco_l2x0_aux __initconst = {
26 .val = (2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | 25 .val = (2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) |
27 (1 << L2X0_AUX_CTRL_ASSOCIATIVITY_SHIFT), 26 (1 << L2X0_AUX_CTRL_ASSOCIATIVITY_SHIFT),
28 .mask = L2X0_AUX_CTRL_MASK, 27 .mask = L2X0_AUX_CTRL_MASK,
29}; 28};
30 29
31static struct of_device_id sirf_l2x0_ids[] __initconst = { 30static const struct of_device_id sirf_l2x0_ids[] __initconst = {
32 { .compatible = "sirf,prima2-pl310-cache", .data = &prima2_l2x0_aux, }, 31 { .compatible = "sirf,prima2-pl310-cache", .data = &prima2_l2x0_aux, },
33 { .compatible = "sirf,marco-pl310-cache", .data = &marco_l2x0_aux, }, 32 { .compatible = "sirf,marco-pl310-cache", .data = &marco_l2x0_aux, },
34 {}, 33 {},
diff --git a/arch/arm/mach-prima2/platsmp.c b/arch/arm/mach-prima2/platsmp.c
index e358b0736dea..335c12e92262 100644
--- a/arch/arm/mach-prima2/platsmp.c
+++ b/arch/arm/mach-prima2/platsmp.c
@@ -138,9 +138,9 @@ static void __init sirfsoc_smp_prepare_cpus(unsigned int max_cpus)
138} 138}
139 139
140struct smp_operations sirfsoc_smp_ops __initdata = { 140struct smp_operations sirfsoc_smp_ops __initdata = {
141 .smp_prepare_cpus = sirfsoc_smp_prepare_cpus, 141 .smp_prepare_cpus = sirfsoc_smp_prepare_cpus,
142 .smp_secondary_init = sirfsoc_secondary_init, 142 .smp_secondary_init = sirfsoc_secondary_init,
143 .smp_boot_secondary = sirfsoc_boot_secondary, 143 .smp_boot_secondary = sirfsoc_boot_secondary,
144#ifdef CONFIG_HOTPLUG_CPU 144#ifdef CONFIG_HOTPLUG_CPU
145 .cpu_die = sirfsoc_cpu_die, 145 .cpu_die = sirfsoc_cpu_die,
146#endif 146#endif
diff --git a/arch/arm/mach-prima2/rstc.c b/arch/arm/mach-prima2/rstc.c
index ccb53391147a..4887a2a4c698 100644
--- a/arch/arm/mach-prima2/rstc.c
+++ b/arch/arm/mach-prima2/rstc.c
@@ -13,57 +13,38 @@
13#include <linux/device.h> 13#include <linux/device.h>
14#include <linux/of.h> 14#include <linux/of.h>
15#include <linux/of_address.h> 15#include <linux/of_address.h>
16#include <linux/platform_device.h>
16#include <linux/reboot.h> 17#include <linux/reboot.h>
18#include <linux/reset-controller.h>
17 19
18void __iomem *sirfsoc_rstc_base; 20#include <asm/system_misc.h>
19static DEFINE_MUTEX(rstc_lock);
20
21static struct of_device_id rstc_ids[] = {
22 { .compatible = "sirf,prima2-rstc" },
23 { .compatible = "sirf,marco-rstc" },
24 {},
25};
26 21
27static int __init sirfsoc_of_rstc_init(void) 22#define SIRFSOC_RSTBIT_NUM 64
28{
29 struct device_node *np;
30 23
31 np = of_find_matching_node(NULL, rstc_ids); 24static void __iomem *sirfsoc_rstc_base;
32 if (!np) { 25static DEFINE_MUTEX(rstc_lock);
33 pr_err("unable to find compatible sirf rstc node in dtb\n");
34 return -ENOENT;
35 }
36
37 sirfsoc_rstc_base = of_iomap(np, 0);
38 if (!sirfsoc_rstc_base)
39 panic("unable to map rstc cpu registers\n");
40
41 of_node_put(np);
42
43 return 0;
44}
45early_initcall(sirfsoc_of_rstc_init);
46 26
47int sirfsoc_reset_device(struct device *dev) 27static int sirfsoc_reset_module(struct reset_controller_dev *rcdev,
28 unsigned long sw_reset_idx)
48{ 29{
49 u32 reset_bit; 30 u32 reset_bit = sw_reset_idx;
50 31
51 if (of_property_read_u32(dev->of_node, "reset-bit", &reset_bit)) 32 if (reset_bit >= SIRFSOC_RSTBIT_NUM)
52 return -EINVAL; 33 return -EINVAL;
53 34
54 mutex_lock(&rstc_lock); 35 mutex_lock(&rstc_lock);
55 36
56 if (of_device_is_compatible(dev->of_node, "sirf,prima2-rstc")) { 37 if (of_device_is_compatible(rcdev->of_node, "sirf,prima2-rstc")) {
57 /* 38 /*
58 * Writing 1 to this bit resets corresponding block. Writing 0 to this 39 * Writing 1 to this bit resets corresponding block. Writing 0 to this
59 * bit de-asserts reset signal of the corresponding block. 40 * bit de-asserts reset signal of the corresponding block.
60 * datasheet doesn't require explicit delay between the set and clear 41 * datasheet doesn't require explicit delay between the set and clear
61 * of reset bit. it could be shorter if tests pass. 42 * of reset bit. it could be shorter if tests pass.
62 */ 43 */
63 writel(readl(sirfsoc_rstc_base + (reset_bit / 32) * 4) | reset_bit, 44 writel(readl(sirfsoc_rstc_base + (reset_bit / 32) * 4) | (1 << reset_bit),
64 sirfsoc_rstc_base + (reset_bit / 32) * 4); 45 sirfsoc_rstc_base + (reset_bit / 32) * 4);
65 msleep(10); 46 msleep(10);
66 writel(readl(sirfsoc_rstc_base + (reset_bit / 32) * 4) & ~reset_bit, 47 writel(readl(sirfsoc_rstc_base + (reset_bit / 32) * 4) & ~(1 << reset_bit),
67 sirfsoc_rstc_base + (reset_bit / 32) * 4); 48 sirfsoc_rstc_base + (reset_bit / 32) * 4);
68 } else { 49 } else {
69 /* 50 /*
@@ -73,9 +54,9 @@ int sirfsoc_reset_device(struct device *dev)
73 * datasheet doesn't require explicit delay between the set and clear 54 * datasheet doesn't require explicit delay between the set and clear
74 * of reset bit. it could be shorter if tests pass. 55 * of reset bit. it could be shorter if tests pass.
75 */ 56 */
76 writel(reset_bit, sirfsoc_rstc_base + (reset_bit / 32) * 8); 57 writel(1 << reset_bit, sirfsoc_rstc_base + (reset_bit / 32) * 8);
77 msleep(10); 58 msleep(10);
78 writel(reset_bit, sirfsoc_rstc_base + (reset_bit / 32) * 8 + 4); 59 writel(1 << reset_bit, sirfsoc_rstc_base + (reset_bit / 32) * 8 + 4);
79 } 60 }
80 61
81 mutex_unlock(&rstc_lock); 62 mutex_unlock(&rstc_lock);
@@ -83,9 +64,57 @@ int sirfsoc_reset_device(struct device *dev)
83 return 0; 64 return 0;
84} 65}
85 66
67static struct reset_control_ops sirfsoc_rstc_ops = {
68 .reset = sirfsoc_reset_module,
69};
70
71static struct reset_controller_dev sirfsoc_reset_controller = {
72 .ops = &sirfsoc_rstc_ops,
73 .nr_resets = SIRFSOC_RSTBIT_NUM,
74};
75
86#define SIRFSOC_SYS_RST_BIT BIT(31) 76#define SIRFSOC_SYS_RST_BIT BIT(31)
87 77
88void sirfsoc_restart(enum reboot_mode mode, const char *cmd) 78static void sirfsoc_restart(enum reboot_mode mode, const char *cmd)
89{ 79{
90 writel(SIRFSOC_SYS_RST_BIT, sirfsoc_rstc_base); 80 writel(SIRFSOC_SYS_RST_BIT, sirfsoc_rstc_base);
91} 81}
82
83static int sirfsoc_rstc_probe(struct platform_device *pdev)
84{
85 struct device_node *np = pdev->dev.of_node;
86 sirfsoc_rstc_base = of_iomap(np, 0);
87 if (!sirfsoc_rstc_base) {
88 dev_err(&pdev->dev, "unable to map rstc cpu registers\n");
89 return -ENOMEM;
90 }
91
92 sirfsoc_reset_controller.of_node = np;
93 arm_pm_restart = sirfsoc_restart;
94
95 if (IS_ENABLED(CONFIG_RESET_CONTROLLER))
96 reset_controller_register(&sirfsoc_reset_controller);
97
98 return 0;
99}
100
101static const struct of_device_id rstc_ids[] = {
102 { .compatible = "sirf,prima2-rstc" },
103 { .compatible = "sirf,marco-rstc" },
104 {},
105};
106
107static struct platform_driver sirfsoc_rstc_driver = {
108 .probe = sirfsoc_rstc_probe,
109 .driver = {
110 .name = "sirfsoc_rstc",
111 .owner = THIS_MODULE,
112 .of_match_table = rstc_ids,
113 },
114};
115
116static int __init sirfsoc_rstc_init(void)
117{
118 return platform_driver_register(&sirfsoc_rstc_driver);
119}
120subsys_initcall(sirfsoc_rstc_init);
diff --git a/arch/arm/mach-prima2/rtciobrg.c b/arch/arm/mach-prima2/rtciobrg.c
index 9f2da2eec4dc..a17c88b74fa1 100644
--- a/arch/arm/mach-prima2/rtciobrg.c
+++ b/arch/arm/mach-prima2/rtciobrg.c
@@ -137,4 +137,4 @@ postcore_initcall(sirfsoc_rtciobrg_init);
137MODULE_AUTHOR("Zhiwu Song <zhiwu.song@csr.com>, " 137MODULE_AUTHOR("Zhiwu Song <zhiwu.song@csr.com>, "
138 "Barry Song <baohua.song@csr.com>"); 138 "Barry Song <baohua.song@csr.com>");
139MODULE_DESCRIPTION("CSR SiRFprimaII rtc io bridge"); 139MODULE_DESCRIPTION("CSR SiRFprimaII rtc io bridge");
140MODULE_LICENSE("GPL"); 140MODULE_LICENSE("GPL v2");
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 96100dbf5a2e..e6690a44917d 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -7,7 +7,6 @@ comment "Intel/Marvell Dev Platforms (sorted by hardware release time)"
7config MACH_PXA3XX_DT 7config MACH_PXA3XX_DT
8 bool "Support PXA3xx platforms from device tree" 8 bool "Support PXA3xx platforms from device tree"
9 select CPU_PXA300 9 select CPU_PXA300
10 select HAVE_PWM
11 select POWER_SUPPLY 10 select POWER_SUPPLY
12 select PXA3xx 11 select PXA3xx
13 select USE_OF 12 select USE_OF
@@ -23,12 +22,10 @@ config ARCH_LUBBOCK
23 22
24config MACH_MAINSTONE 23config MACH_MAINSTONE
25 bool "Intel HCDDBBVA0 Development Platform (aka Mainstone)" 24 bool "Intel HCDDBBVA0 Development Platform (aka Mainstone)"
26 select HAVE_PWM
27 select PXA27x 25 select PXA27x
28 26
29config MACH_ZYLONITE 27config MACH_ZYLONITE
30 bool 28 bool
31 select HAVE_PWM
32 select PXA3xx 29 select PXA3xx
33 30
34config MACH_ZYLONITE300 31config MACH_ZYLONITE300
@@ -53,12 +50,16 @@ config MACH_TAVOREVB
53 select CPU_PXA930 50 select CPU_PXA930
54 select CPU_PXA935 51 select CPU_PXA935
55 select PXA3xx 52 select PXA3xx
53 select FB
54 select FB_PXA
56 55
57config MACH_SAAR 56config MACH_SAAR
58 bool "PXA930 Handheld Platform (aka SAAR)" 57 bool "PXA930 Handheld Platform (aka SAAR)"
59 select CPU_PXA930 58 select CPU_PXA930
60 select CPU_PXA935 59 select CPU_PXA935
61 select PXA3xx 60 select PXA3xx
61 select FB
62 select FB_PXA
62 63
63comment "Third Party Dev Platforms (sorted by vendor name)" 64comment "Third Party Dev Platforms (sorted by vendor name)"
64 65
@@ -69,8 +70,7 @@ config ARCH_PXA_IDP
69config ARCH_VIPER 70config ARCH_VIPER
70 bool "Arcom/Eurotech VIPER SBC" 71 bool "Arcom/Eurotech VIPER SBC"
71 select ARCOM_PCMCIA 72 select ARCOM_PCMCIA
72 select HAVE_PWM 73 select I2C_GPIO if I2C=y
73 select I2C_GPIO
74 select ISA 74 select ISA
75 select PXA25x 75 select PXA25x
76 select PXA_HAVE_ISA_IRQS 76 select PXA_HAVE_ISA_IRQS
@@ -120,7 +120,6 @@ config MACH_CM_X300
120 bool "CompuLab CM-X300 modules" 120 bool "CompuLab CM-X300 modules"
121 select CPU_PXA300 121 select CPU_PXA300
122 select CPU_PXA310 122 select CPU_PXA310
123 select HAVE_PWM
124 select PXA3xx 123 select PXA3xx
125 124
126config MACH_CAPC7117 125config MACH_CAPC7117
@@ -164,7 +163,6 @@ config MACH_XCEP
164 select MTD_CFI_INTELEXT 163 select MTD_CFI_INTELEXT
165 select MTD_PHYSMAP 164 select MTD_PHYSMAP
166 select PXA25x 165 select PXA25x
167 select SMC91X
168 help 166 help
169 PXA255 based Single Board Computer with SMC 91C111 ethernet chip and 64 MB of flash. 167 PXA255 based Single Board Computer with SMC 91C111 ethernet chip and 64 MB of flash.
170 Tuned for usage in Libera instruments for particle accelerators. 168 Tuned for usage in Libera instruments for particle accelerators.
@@ -181,6 +179,7 @@ config MACH_TRIZEPS4
181config MACH_TRIZEPS4WL 179config MACH_TRIZEPS4WL
182 bool "Keith und Koep Trizeps4-WL DIMM-Module" 180 bool "Keith und Koep Trizeps4-WL DIMM-Module"
183 depends on TRIZEPS_PXA 181 depends on TRIZEPS_PXA
182 select MACH_TRIZEPS4
184 select PXA27x 183 select PXA27x
185 select TRIZEPS_PCMCIA 184 select TRIZEPS_PCMCIA
186 185
@@ -211,7 +210,6 @@ config TRIZEPS_PCMCIA
211 210
212config MACH_LOGICPD_PXA270 211config MACH_LOGICPD_PXA270
213 bool "LogicPD PXA270 Card Engine Development Platform" 212 bool "LogicPD PXA270 Card Engine Development Platform"
214 select HAVE_PWM
215 select PXA27x 213 select PXA27x
216 214
217config MACH_PCM027 215config MACH_PCM027
@@ -222,7 +220,6 @@ config MACH_PCM027
222config MACH_PCM990_BASEBOARD 220config MACH_PCM990_BASEBOARD
223 bool "PHYTEC PCM-990 development board" 221 bool "PHYTEC PCM-990 development board"
224 depends on MACH_PCM027 222 depends on MACH_PCM027
225 select HAVE_PWM
226 223
227choice 224choice
228 prompt "display on pcm990" 225 prompt "display on pcm990"
@@ -246,7 +243,6 @@ config MACH_COLIBRI
246config MACH_COLIBRI_PXA270_INCOME 243config MACH_COLIBRI_PXA270_INCOME
247 bool "Income s.r.o. PXA270 SBC" 244 bool "Income s.r.o. PXA270 SBC"
248 depends on MACH_COLIBRI 245 depends on MACH_COLIBRI
249 select HAVE_PWM
250 select PXA27x 246 select PXA27x
251 247
252config MACH_COLIBRI300 248config MACH_COLIBRI300
@@ -275,7 +271,6 @@ comment "End-user Products (sorted by vendor name)"
275 271
276config MACH_H4700 272config MACH_H4700
277 bool "HP iPAQ hx4700" 273 bool "HP iPAQ hx4700"
278 select HAVE_PWM
279 select IWMMXT 274 select IWMMXT
280 select PXA27x 275 select PXA27x
281 276
@@ -289,14 +284,12 @@ config MACH_HIMALAYA
289 284
290config MACH_MAGICIAN 285config MACH_MAGICIAN
291 bool "Enable HTC Magician Support" 286 bool "Enable HTC Magician Support"
292 select HAVE_PWM
293 select IWMMXT 287 select IWMMXT
294 select PXA27x 288 select PXA27x
295 289
296config MACH_MIOA701 290config MACH_MIOA701
297 bool "Mitac Mio A701 Support" 291 bool "Mitac Mio A701 Support"
298 select GPIO_SYSFS 292 select GPIO_SYSFS
299 select HAVE_PWM
300 select IWMMXT 293 select IWMMXT
301 select PXA27x 294 select PXA27x
302 help 295 help
@@ -306,7 +299,6 @@ config MACH_MIOA701
306 299
307config PXA_EZX 300config PXA_EZX
308 bool "Motorola EZX Platform" 301 bool "Motorola EZX Platform"
309 select HAVE_PWM
310 select IWMMXT 302 select IWMMXT
311 select PXA27x 303 select PXA27x
312 304
@@ -346,7 +338,6 @@ config MACH_MP900C
346 338
347config ARCH_PXA_PALM 339config ARCH_PXA_PALM
348 bool "PXA based Palm PDAs" 340 bool "PXA based Palm PDAs"
349 select HAVE_PWM
350 341
351config MACH_PALM27X 342config MACH_PALM27X
352 bool 343 bool
@@ -444,7 +435,6 @@ config MACH_TREO680
444config MACH_RAUMFELD_RC 435config MACH_RAUMFELD_RC
445 bool "Raumfeld Controller" 436 bool "Raumfeld Controller"
446 select CPU_PXA300 437 select CPU_PXA300
447 select HAVE_PWM
448 select POWER_SUPPLY 438 select POWER_SUPPLY
449 select PXA3xx 439 select PXA3xx
450 440
@@ -608,7 +598,6 @@ config MACH_E800
608 598
609config MACH_ZIPIT2 599config MACH_ZIPIT2
610 bool "Zipit Z2 Handheld" 600 bool "Zipit Z2 Handheld"
611 select HAVE_PWM
612 select PXA27x 601 select PXA27x
613endmenu 602endmenu
614 603
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
index 2f71b3fbd319..43596e0ed051 100644
--- a/arch/arm/mach-pxa/balloon3.c
+++ b/arch/arm/mach-pxa/balloon3.c
@@ -331,7 +331,6 @@ static struct pxa2xx_udc_mach_info balloon3_udc_info __initdata = {
331static void __init balloon3_udc_init(void) 331static void __init balloon3_udc_init(void)
332{ 332{
333 pxa_set_udc_info(&balloon3_udc_info); 333 pxa_set_udc_info(&balloon3_udc_info);
334 platform_device_register(&balloon3_gpio_vbus);
335} 334}
336#else 335#else
337static inline void balloon3_udc_init(void) {} 336static inline void balloon3_udc_init(void) {}
diff --git a/arch/arm/mach-pxa/colibri-evalboard.c b/arch/arm/mach-pxa/colibri-evalboard.c
index 8404b24240ea..638b0bb88426 100644
--- a/arch/arm/mach-pxa/colibri-evalboard.c
+++ b/arch/arm/mach-pxa/colibri-evalboard.c
@@ -20,6 +20,7 @@
20#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
21#include <linux/i2c.h> 21#include <linux/i2c.h>
22#include <linux/i2c/pxa-i2c.h> 22#include <linux/i2c/pxa-i2c.h>
23#include <asm/io.h>
23 24
24#include <mach/pxa27x.h> 25#include <mach/pxa27x.h>
25#include <mach/colibri.h> 26#include <mach/colibri.h>
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index f162f1b77cd2..57d60542f982 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -32,6 +32,7 @@
32#include <linux/spi/pxa2xx_spi.h> 32#include <linux/spi/pxa2xx_spi.h>
33#include <linux/mtd/sharpsl.h> 33#include <linux/mtd/sharpsl.h>
34#include <linux/input/matrix_keypad.h> 34#include <linux/input/matrix_keypad.h>
35#include <linux/gpio_keys.h>
35#include <linux/module.h> 36#include <linux/module.h>
36#include <video/w100fb.h> 37#include <video/w100fb.h>
37 38
@@ -405,6 +406,44 @@ static struct platform_device corgikbd_device = {
405 }, 406 },
406}; 407};
407 408
409static struct gpio_keys_button corgi_gpio_keys[] = {
410 {
411 .type = EV_SW,
412 .code = SW_LID,
413 .gpio = CORGI_GPIO_SWA,
414 .desc = "Lid close switch",
415 .debounce_interval = 500,
416 },
417 {
418 .type = EV_SW,
419 .code = SW_TABLET_MODE,
420 .gpio = CORGI_GPIO_SWB,
421 .desc = "Tablet mode switch",
422 .debounce_interval = 500,
423 },
424 {
425 .type = EV_SW,
426 .code = SW_HEADPHONE_INSERT,
427 .gpio = CORGI_GPIO_AK_INT,
428 .desc = "HeadPhone insert",
429 .debounce_interval = 500,
430 },
431};
432
433static struct gpio_keys_platform_data corgi_gpio_keys_platform_data = {
434 .buttons = corgi_gpio_keys,
435 .nbuttons = ARRAY_SIZE(corgi_gpio_keys),
436 .poll_interval = 250,
437};
438
439static struct platform_device corgi_gpio_keys_device = {
440 .name = "gpio-keys-polled",
441 .id = -1,
442 .dev = {
443 .platform_data = &corgi_gpio_keys_platform_data,
444 },
445};
446
408/* 447/*
409 * Corgi LEDs 448 * Corgi LEDs
410 */ 449 */
@@ -646,6 +685,7 @@ static struct platform_device sharpsl_rom_device = {
646static struct platform_device *devices[] __initdata = { 685static struct platform_device *devices[] __initdata = {
647 &corgiscoop_device, 686 &corgiscoop_device,
648 &corgifb_device, 687 &corgifb_device,
688 &corgi_gpio_keys_device,
649 &corgikbd_device, 689 &corgikbd_device,
650 &corgiled_device, 690 &corgiled_device,
651 &corgi_audio_device, 691 &corgi_audio_device,
diff --git a/arch/arm/mach-pxa/include/mach/timex.h b/arch/arm/mach-pxa/include/mach/timex.h
deleted file mode 100644
index af6760a50e1a..000000000000
--- a/arch/arm/mach-pxa/include/mach/timex.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * arch/arm/mach-pxa/include/mach/timex.h
3 *
4 * Author: Nicolas Pitre
5 * Created: Jun 15, 2001
6 * Copyright: MontaVista Software 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/* Various drivers are still using the constant of CLOCK_TICK_RATE, for
14 * those drivers to at least work, the definition is provided here.
15 *
16 * NOTE: this is no longer accurate when multiple processors and boards
17 * are selected, newer drivers should not depend on this any more. Use
18 * either the clocksource/clockevent or get this at run-time by calling
19 * get_clock_tick_rate() (as defined in generic.c).
20 */
21
22#if defined(CONFIG_PXA25x)
23/* PXA250/210 timer base */
24#define CLOCK_TICK_RATE 3686400
25#elif defined(CONFIG_PXA27x)
26/* PXA27x timer base */
27#ifdef CONFIG_MACH_MAINSTONE
28#define CLOCK_TICK_RATE 3249600
29#else
30#define CLOCK_TICK_RATE 3250000
31#endif
32#else
33#define CLOCK_TICK_RATE 3250000
34#endif
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index 29905b127ad9..41f27f667ca8 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -885,9 +885,6 @@ static int viper_cpufreq_notifier(struct notifier_block *nb,
885 viper_set_core_cpu_voltage(freq->new, 0); 885 viper_set_core_cpu_voltage(freq->new, 0);
886 } 886 }
887 break; 887 break;
888 case CPUFREQ_RESUMECHANGE:
889 viper_set_core_cpu_voltage(freq->new, 0);
890 break;
891 default: 888 default:
892 /* ignore */ 889 /* ignore */
893 break; 890 break;
diff --git a/arch/arm/mach-qcom/Kconfig b/arch/arm/mach-qcom/Kconfig
new file mode 100644
index 000000000000..a028be234334
--- /dev/null
+++ b/arch/arm/mach-qcom/Kconfig
@@ -0,0 +1,33 @@
1config ARCH_QCOM
2 bool "Qualcomm Support" if ARCH_MULTI_V7
3 select ARCH_REQUIRE_GPIOLIB
4 select ARM_GIC
5 select CLKSRC_OF
6 select GENERIC_CLOCKEVENTS
7 select HAVE_SMP
8 select QCOM_SCM if SMP
9 help
10 Support for Qualcomm's devicetree based systems.
11
12if ARCH_QCOM
13
14menu "Qualcomm SoC Selection"
15
16config ARCH_MSM8X60
17 bool "Enable support for MSM8X60"
18 select CLKSRC_QCOM
19
20config ARCH_MSM8960
21 bool "Enable support for MSM8960"
22 select CLKSRC_QCOM
23
24config ARCH_MSM8974
25 bool "Enable support for MSM8974"
26 select HAVE_ARM_ARCH_TIMER
27
28endmenu
29
30config QCOM_SCM
31 bool
32
33endif
diff --git a/arch/arm/mach-qcom/Makefile b/arch/arm/mach-qcom/Makefile
new file mode 100644
index 000000000000..8f756ae1ae31
--- /dev/null
+++ b/arch/arm/mach-qcom/Makefile
@@ -0,0 +1,5 @@
1obj-y := board.o
2obj-$(CONFIG_SMP) += platsmp.o
3obj-$(CONFIG_QCOM_SCM) += scm.o scm-boot.o
4
5CFLAGS_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1)
diff --git a/arch/arm/mach-msm/board-dt.c b/arch/arm/mach-qcom/board.c
index 1f11d93e700e..bae617ef0b31 100644
--- a/arch/arm/mach-msm/board-dt.c
+++ b/arch/arm/mach-qcom/board.c
@@ -1,4 +1,4 @@
1/* Copyright (c) 2010-2012,2013 The Linux Foundation. All rights reserved. 1/* Copyright (c) 2010-2014 The Linux Foundation. All rights reserved.
2 * 2 *
3 * This program is free software; you can redistribute it and/or modify 3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and 4 * it under the terms of the GNU General Public License version 2 and
@@ -11,31 +11,16 @@
11 */ 11 */
12 12
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/of.h>
15#include <linux/of_platform.h>
16 14
17#include <asm/mach/arch.h> 15#include <asm/mach/arch.h>
18#include <asm/mach/map.h>
19 16
20#include "common.h" 17static const char * const qcom_dt_match[] __initconst = {
21
22static const char * const msm_dt_match[] __initconst = {
23 "qcom,msm8660-fluid",
24 "qcom,msm8660-surf", 18 "qcom,msm8660-surf",
25 "qcom,msm8960-cdp", 19 "qcom,msm8960-cdp",
26 NULL
27};
28
29static const char * const apq8074_dt_match[] __initconst = {
30 "qcom,apq8074-dragonboard", 20 "qcom,apq8074-dragonboard",
31 NULL 21 NULL
32}; 22};
33 23
34DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)") 24DT_MACHINE_START(QCOM_DT, "Qualcomm (Flattened Device Tree)")
35 .smp = smp_ops(msm_smp_ops), 25 .dt_compat = qcom_dt_match,
36 .dt_compat = msm_dt_match,
37MACHINE_END
38
39DT_MACHINE_START(APQ_DT, "Qualcomm MSM (Flattened Device Tree)")
40 .dt_compat = apq8074_dt_match,
41MACHINE_END 26MACHINE_END
diff --git a/arch/arm/mach-qcom/platsmp.c b/arch/arm/mach-qcom/platsmp.c
new file mode 100644
index 000000000000..d6908569ecaf
--- /dev/null
+++ b/arch/arm/mach-qcom/platsmp.c
@@ -0,0 +1,378 @@
1/*
2 * Copyright (C) 2002 ARM Ltd.
3 * All Rights Reserved
4 * Copyright (c) 2010, Code Aurora Forum. All rights reserved.
5 * Copyright (c) 2014 The Linux Foundation. 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 version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/init.h>
13#include <linux/errno.h>
14#include <linux/delay.h>
15#include <linux/device.h>
16#include <linux/of.h>
17#include <linux/of_address.h>
18#include <linux/smp.h>
19#include <linux/io.h>
20
21#include <asm/smp_plat.h>
22
23#include "scm-boot.h"
24
25#define VDD_SC1_ARRAY_CLAMP_GFS_CTL 0x35a0
26#define SCSS_CPU1CORE_RESET 0x2d80
27#define SCSS_DBG_STATUS_CORE_PWRDUP 0x2e64
28
29#define APCS_CPU_PWR_CTL 0x04
30#define PLL_CLAMP BIT(8)
31#define CORE_PWRD_UP BIT(7)
32#define COREPOR_RST BIT(5)
33#define CORE_RST BIT(4)
34#define L2DT_SLP BIT(3)
35#define CLAMP BIT(0)
36
37#define APC_PWR_GATE_CTL 0x14
38#define BHS_CNT_SHIFT 24
39#define LDO_PWR_DWN_SHIFT 16
40#define LDO_BYP_SHIFT 8
41#define BHS_SEG_SHIFT 1
42#define BHS_EN BIT(0)
43
44#define APCS_SAW2_VCTL 0x14
45#define APCS_SAW2_2_VCTL 0x1c
46
47extern void secondary_startup(void);
48
49static DEFINE_SPINLOCK(boot_lock);
50
51#ifdef CONFIG_HOTPLUG_CPU
52static void __ref qcom_cpu_die(unsigned int cpu)
53{
54 wfi();
55}
56#endif
57
58static void qcom_secondary_init(unsigned int cpu)
59{
60 /*
61 * Synchronise with the boot thread.
62 */
63 spin_lock(&boot_lock);
64 spin_unlock(&boot_lock);
65}
66
67static int scss_release_secondary(unsigned int cpu)
68{
69 struct device_node *node;
70 void __iomem *base;
71
72 node = of_find_compatible_node(NULL, NULL, "qcom,gcc-msm8660");
73 if (!node) {
74 pr_err("%s: can't find node\n", __func__);
75 return -ENXIO;
76 }
77
78 base = of_iomap(node, 0);
79 of_node_put(node);
80 if (!base)
81 return -ENOMEM;
82
83 writel_relaxed(0, base + VDD_SC1_ARRAY_CLAMP_GFS_CTL);
84 writel_relaxed(0, base + SCSS_CPU1CORE_RESET);
85 writel_relaxed(3, base + SCSS_DBG_STATUS_CORE_PWRDUP);
86 mb();
87 iounmap(base);
88
89 return 0;
90}
91
92static int kpssv1_release_secondary(unsigned int cpu)
93{
94 int ret = 0;
95 void __iomem *reg, *saw_reg;
96 struct device_node *cpu_node, *acc_node, *saw_node;
97 u32 val;
98
99 cpu_node = of_get_cpu_node(cpu, NULL);
100 if (!cpu_node)
101 return -ENODEV;
102
103 acc_node = of_parse_phandle(cpu_node, "qcom,acc", 0);
104 if (!acc_node) {
105 ret = -ENODEV;
106 goto out_acc;
107 }
108
109 saw_node = of_parse_phandle(cpu_node, "qcom,saw", 0);
110 if (!saw_node) {
111 ret = -ENODEV;
112 goto out_saw;
113 }
114
115 reg = of_iomap(acc_node, 0);
116 if (!reg) {
117 ret = -ENOMEM;
118 goto out_acc_map;
119 }
120
121 saw_reg = of_iomap(saw_node, 0);
122 if (!saw_reg) {
123 ret = -ENOMEM;
124 goto out_saw_map;
125 }
126
127 /* Turn on CPU rail */
128 writel_relaxed(0xA4, saw_reg + APCS_SAW2_VCTL);
129 mb();
130 udelay(512);
131
132 /* Krait bring-up sequence */
133 val = PLL_CLAMP | L2DT_SLP | CLAMP;
134 writel_relaxed(val, reg + APCS_CPU_PWR_CTL);
135 val &= ~L2DT_SLP;
136 writel_relaxed(val, reg + APCS_CPU_PWR_CTL);
137 mb();
138 ndelay(300);
139
140 val |= COREPOR_RST;
141 writel_relaxed(val, reg + APCS_CPU_PWR_CTL);
142 mb();
143 udelay(2);
144
145 val &= ~CLAMP;
146 writel_relaxed(val, reg + APCS_CPU_PWR_CTL);
147 mb();
148 udelay(2);
149
150 val &= ~COREPOR_RST;
151 writel_relaxed(val, reg + APCS_CPU_PWR_CTL);
152 mb();
153 udelay(100);
154
155 val |= CORE_PWRD_UP;
156 writel_relaxed(val, reg + APCS_CPU_PWR_CTL);
157 mb();
158
159 iounmap(saw_reg);
160out_saw_map:
161 iounmap(reg);
162out_acc_map:
163 of_node_put(saw_node);
164out_saw:
165 of_node_put(acc_node);
166out_acc:
167 of_node_put(cpu_node);
168 return ret;
169}
170
171static int kpssv2_release_secondary(unsigned int cpu)
172{
173 void __iomem *reg;
174 struct device_node *cpu_node, *l2_node, *acc_node, *saw_node;
175 void __iomem *l2_saw_base;
176 unsigned reg_val;
177 int ret;
178
179 cpu_node = of_get_cpu_node(cpu, NULL);
180 if (!cpu_node)
181 return -ENODEV;
182
183 acc_node = of_parse_phandle(cpu_node, "qcom,acc", 0);
184 if (!acc_node) {
185 ret = -ENODEV;
186 goto out_acc;
187 }
188
189 l2_node = of_parse_phandle(cpu_node, "next-level-cache", 0);
190 if (!l2_node) {
191 ret = -ENODEV;
192 goto out_l2;
193 }
194
195 saw_node = of_parse_phandle(l2_node, "qcom,saw", 0);
196 if (!saw_node) {
197 ret = -ENODEV;
198 goto out_saw;
199 }
200
201 reg = of_iomap(acc_node, 0);
202 if (!reg) {
203 ret = -ENOMEM;
204 goto out_map;
205 }
206
207 l2_saw_base = of_iomap(saw_node, 0);
208 if (!l2_saw_base) {
209 ret = -ENOMEM;
210 goto out_saw_map;
211 }
212
213 /* Turn on the BHS, turn off LDO Bypass and power down LDO */
214 reg_val = (64 << BHS_CNT_SHIFT) | (0x3f << LDO_PWR_DWN_SHIFT) | BHS_EN;
215 writel_relaxed(reg_val, reg + APC_PWR_GATE_CTL);
216 mb();
217 /* wait for the BHS to settle */
218 udelay(1);
219
220 /* Turn on BHS segments */
221 reg_val |= 0x3f << BHS_SEG_SHIFT;
222 writel_relaxed(reg_val, reg + APC_PWR_GATE_CTL);
223 mb();
224 /* wait for the BHS to settle */
225 udelay(1);
226
227 /* Finally turn on the bypass so that BHS supplies power */
228 reg_val |= 0x3f << LDO_BYP_SHIFT;
229 writel_relaxed(reg_val, reg + APC_PWR_GATE_CTL);
230
231 /* enable max phases */
232 writel_relaxed(0x10003, l2_saw_base + APCS_SAW2_2_VCTL);
233 mb();
234 udelay(50);
235
236 reg_val = COREPOR_RST | CLAMP;
237 writel_relaxed(reg_val, reg + APCS_CPU_PWR_CTL);
238 mb();
239 udelay(2);
240
241 reg_val &= ~CLAMP;
242 writel_relaxed(reg_val, reg + APCS_CPU_PWR_CTL);
243 mb();
244 udelay(2);
245
246 reg_val &= ~COREPOR_RST;
247 writel_relaxed(reg_val, reg + APCS_CPU_PWR_CTL);
248 mb();
249
250 reg_val |= CORE_PWRD_UP;
251 writel_relaxed(reg_val, reg + APCS_CPU_PWR_CTL);
252 mb();
253
254 ret = 0;
255
256 iounmap(l2_saw_base);
257out_saw_map:
258 iounmap(reg);
259out_map:
260 of_node_put(saw_node);
261out_saw:
262 of_node_put(l2_node);
263out_l2:
264 of_node_put(acc_node);
265out_acc:
266 of_node_put(cpu_node);
267
268 return ret;
269}
270
271static DEFINE_PER_CPU(int, cold_boot_done);
272
273static int qcom_boot_secondary(unsigned int cpu, int (*func)(unsigned int))
274{
275 int ret = 0;
276
277 if (!per_cpu(cold_boot_done, cpu)) {
278 ret = func(cpu);
279 if (!ret)
280 per_cpu(cold_boot_done, cpu) = true;
281 }
282
283 /*
284 * set synchronisation state between this boot processor
285 * and the secondary one
286 */
287 spin_lock(&boot_lock);
288
289 /*
290 * Send the secondary CPU a soft interrupt, thereby causing
291 * the boot monitor to read the system wide flags register,
292 * and branch to the address found there.
293 */
294 arch_send_wakeup_ipi_mask(cpumask_of(cpu));
295
296 /*
297 * now the secondary core is starting up let it run its
298 * calibrations, then wait for it to finish
299 */
300 spin_unlock(&boot_lock);
301
302 return ret;
303}
304
305static int msm8660_boot_secondary(unsigned int cpu, struct task_struct *idle)
306{
307 return qcom_boot_secondary(cpu, scss_release_secondary);
308}
309
310static int kpssv1_boot_secondary(unsigned int cpu, struct task_struct *idle)
311{
312 return qcom_boot_secondary(cpu, kpssv1_release_secondary);
313}
314
315static int kpssv2_boot_secondary(unsigned int cpu, struct task_struct *idle)
316{
317 return qcom_boot_secondary(cpu, kpssv2_release_secondary);
318}
319
320static void __init qcom_smp_prepare_cpus(unsigned int max_cpus)
321{
322 int cpu, map;
323 unsigned int flags = 0;
324 static const int cold_boot_flags[] = {
325 0,
326 SCM_FLAG_COLDBOOT_CPU1,
327 SCM_FLAG_COLDBOOT_CPU2,
328 SCM_FLAG_COLDBOOT_CPU3,
329 };
330
331 for_each_present_cpu(cpu) {
332 map = cpu_logical_map(cpu);
333 if (WARN_ON(map >= ARRAY_SIZE(cold_boot_flags))) {
334 set_cpu_present(cpu, false);
335 continue;
336 }
337 flags |= cold_boot_flags[map];
338 }
339
340 if (scm_set_boot_addr(virt_to_phys(secondary_startup), flags)) {
341 for_each_present_cpu(cpu) {
342 if (cpu == smp_processor_id())
343 continue;
344 set_cpu_present(cpu, false);
345 }
346 pr_warn("Failed to set CPU boot address, disabling SMP\n");
347 }
348}
349
350static struct smp_operations smp_msm8660_ops __initdata = {
351 .smp_prepare_cpus = qcom_smp_prepare_cpus,
352 .smp_secondary_init = qcom_secondary_init,
353 .smp_boot_secondary = msm8660_boot_secondary,
354#ifdef CONFIG_HOTPLUG_CPU
355 .cpu_die = qcom_cpu_die,
356#endif
357};
358CPU_METHOD_OF_DECLARE(qcom_smp, "qcom,gcc-msm8660", &smp_msm8660_ops);
359
360static struct smp_operations qcom_smp_kpssv1_ops __initdata = {
361 .smp_prepare_cpus = qcom_smp_prepare_cpus,
362 .smp_secondary_init = qcom_secondary_init,
363 .smp_boot_secondary = kpssv1_boot_secondary,
364#ifdef CONFIG_HOTPLUG_CPU
365 .cpu_die = qcom_cpu_die,
366#endif
367};
368CPU_METHOD_OF_DECLARE(qcom_smp_kpssv1, "qcom,kpss-acc-v1", &qcom_smp_kpssv1_ops);
369
370static struct smp_operations qcom_smp_kpssv2_ops __initdata = {
371 .smp_prepare_cpus = qcom_smp_prepare_cpus,
372 .smp_secondary_init = qcom_secondary_init,
373 .smp_boot_secondary = kpssv2_boot_secondary,
374#ifdef CONFIG_HOTPLUG_CPU
375 .cpu_die = qcom_cpu_die,
376#endif
377};
378CPU_METHOD_OF_DECLARE(qcom_smp_kpssv2, "qcom,kpss-acc-v2", &qcom_smp_kpssv2_ops);
diff --git a/arch/arm/mach-msm/scm-boot.c b/arch/arm/mach-qcom/scm-boot.c
index 45cee3e469a5..45cee3e469a5 100644
--- a/arch/arm/mach-msm/scm-boot.c
+++ b/arch/arm/mach-qcom/scm-boot.c
diff --git a/arch/arm/mach-msm/scm-boot.h b/arch/arm/mach-qcom/scm-boot.h
index 7be32ff5d687..6aabb2428176 100644
--- a/arch/arm/mach-msm/scm-boot.h
+++ b/arch/arm/mach-qcom/scm-boot.h
@@ -13,9 +13,11 @@
13#define __MACH_SCM_BOOT_H 13#define __MACH_SCM_BOOT_H
14 14
15#define SCM_BOOT_ADDR 0x1 15#define SCM_BOOT_ADDR 0x1
16#define SCM_FLAG_COLDBOOT_CPU1 0x1 16#define SCM_FLAG_COLDBOOT_CPU1 0x01
17#define SCM_FLAG_WARMBOOT_CPU1 0x2 17#define SCM_FLAG_COLDBOOT_CPU2 0x08
18#define SCM_FLAG_WARMBOOT_CPU0 0x4 18#define SCM_FLAG_COLDBOOT_CPU3 0x20
19#define SCM_FLAG_WARMBOOT_CPU0 0x04
20#define SCM_FLAG_WARMBOOT_CPU1 0x02
19 21
20int scm_set_boot_addr(phys_addr_t addr, int flags); 22int scm_set_boot_addr(phys_addr_t addr, int flags);
21 23
diff --git a/arch/arm/mach-msm/scm.c b/arch/arm/mach-qcom/scm.c
index c536fd6bf827..c536fd6bf827 100644
--- a/arch/arm/mach-msm/scm.c
+++ b/arch/arm/mach-qcom/scm.c
diff --git a/arch/arm/mach-msm/scm.h b/arch/arm/mach-qcom/scm.h
index 00b31ea58f29..00b31ea58f29 100644
--- a/arch/arm/mach-msm/scm.h
+++ b/arch/arm/mach-qcom/scm.h
diff --git a/arch/arm/mach-realview/include/mach/memory.h b/arch/arm/mach-realview/include/mach/memory.h
index 2022e092f0ca..db09170e3832 100644
--- a/arch/arm/mach-realview/include/mach/memory.h
+++ b/arch/arm/mach-realview/include/mach/memory.h
@@ -56,6 +56,8 @@
56#define PAGE_OFFSET1 (PAGE_OFFSET + 0x10000000) 56#define PAGE_OFFSET1 (PAGE_OFFSET + 0x10000000)
57#define PAGE_OFFSET2 (PAGE_OFFSET + 0x30000000) 57#define PAGE_OFFSET2 (PAGE_OFFSET + 0x30000000)
58 58
59#define PHYS_OFFSET PLAT_PHYS_OFFSET
60
59#define __phys_to_virt(phys) \ 61#define __phys_to_virt(phys) \
60 ((phys) >= 0x80000000 ? (phys) - 0x80000000 + PAGE_OFFSET2 : \ 62 ((phys) >= 0x80000000 ? (phys) - 0x80000000 + PAGE_OFFSET2 : \
61 (phys) >= 0x20000000 ? (phys) - 0x20000000 + PAGE_OFFSET1 : \ 63 (phys) >= 0x20000000 ? (phys) - 0x20000000 + PAGE_OFFSET1 : \
diff --git a/arch/arm/mach-realview/include/mach/timex.h b/arch/arm/mach-realview/include/mach/timex.h
deleted file mode 100644
index 4eeb069373c2..000000000000
--- a/arch/arm/mach-realview/include/mach/timex.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * arch/arm/mach-realview/include/mach/timex.h
3 *
4 * RealView architecture timex specifications
5 *
6 * Copyright (C) 2003 ARM Limited
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#define CLOCK_TICK_RATE (50000000 / 16)
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index cf073dea5784..1caee6d548b8 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -5,10 +5,8 @@ config ARCH_ROCKCHIP
5 select ARCH_REQUIRE_GPIOLIB 5 select ARCH_REQUIRE_GPIOLIB
6 select ARM_GIC 6 select ARM_GIC
7 select CACHE_L2X0 7 select CACHE_L2X0
8 select HAVE_ARM_SCU if SMP
8 select HAVE_ARM_TWD if SMP 9 select HAVE_ARM_TWD if SMP
9 select HAVE_SMP
10 select COMMON_CLK
11 select GENERIC_CLOCKEVENTS
12 select DW_APB_TIMER_OF 10 select DW_APB_TIMER_OF
13 select ARM_GLOBAL_TIMER 11 select ARM_GLOBAL_TIMER
14 select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK 12 select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
index 1547d4fc920a..4377a1436a98 100644
--- a/arch/arm/mach-rockchip/Makefile
+++ b/arch/arm/mach-rockchip/Makefile
@@ -1 +1,2 @@
1obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip.o 1obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip.o
2obj-$(CONFIG_SMP) += headsmp.o platsmp.o
diff --git a/arch/arm/mach-lpc32xx/include/mach/timex.h b/arch/arm/mach-rockchip/core.h
index 8d4066b16b3f..e2e7c9dbb200 100644
--- a/arch/arm/mach-lpc32xx/include/mach/timex.h
+++ b/arch/arm/mach-rockchip/core.h
@@ -1,9 +1,6 @@
1/* 1/*
2 * arch/arm/mach-lpc32xx/include/mach/timex.h 2 * Copyright (c) 2013 MundoReader S.L.
3 * 3 * Author: Heiko Stuebner <heiko@sntech.de>
4 * Author: Kevin Wells <kevin.wells@nxp.com>
5 *
6 * Copyright (C) 2010 NXP Semiconductors
7 * 4 *
8 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
@@ -16,13 +13,10 @@
16 * GNU General Public License for more details. 13 * GNU General Public License for more details.
17 */ 14 */
18 15
19#ifndef __ASM_ARCH_TIMEX_H 16extern char rockchip_secondary_trampoline;
20#define __ASM_ARCH_TIMEX_H 17extern char rockchip_secondary_trampoline_end;
21 18
22/* 19extern unsigned long rockchip_boot_fn;
23 * Rate in Hz of the main system oscillator. This value should match 20extern void rockchip_secondary_startup(void);
24 * the value 'MAIN_OSC_FREQ' in platform.h
25 */
26#define CLOCK_TICK_RATE 13000000
27 21
28#endif 22extern struct smp_operations rockchip_smp_ops;
diff --git a/arch/arm/mach-versatile/include/mach/timex.h b/arch/arm/mach-rockchip/headsmp.S
index 426199b1add5..73206e360e31 100644
--- a/arch/arm/mach-versatile/include/mach/timex.h
+++ b/arch/arm/mach-rockchip/headsmp.S
@@ -1,9 +1,6 @@
1/* 1/*
2 * arch/arm/mach-versatile/include/mach/timex.h 2 * Copyright (c) 2013 MundoReader S.L.
3 * 3 * Author: Heiko Stuebner <heiko@sntech.de>
4 * Versatile architecture timex specifications
5 *
6 * Copyright (C) 2003 ARM Limited
7 * 4 *
8 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
@@ -14,10 +11,20 @@
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details. 13 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */ 14 */
15#include <linux/linkage.h>
16#include <linux/init.h>
17
18ENTRY(rockchip_secondary_startup)
19 bl v7_invalidate_l1
20 b secondary_startup
21ENDPROC(rockchip_secondary_startup)
22
23ENTRY(rockchip_secondary_trampoline)
24 ldr pc, 1f
25ENDPROC(rockchip_secondary_trampoline)
26 .globl rockchip_boot_fn
27rockchip_boot_fn:
281: .space 4
22 29
23#define CLOCK_TICK_RATE (50000000 / 16) 30ENTRY(rockchip_secondary_trampoline_end)
diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c
new file mode 100644
index 000000000000..dbfa5a26cfff
--- /dev/null
+++ b/arch/arm/mach-rockchip/platsmp.c
@@ -0,0 +1,184 @@
1/*
2 * Copyright (c) 2013 MundoReader S.L.
3 * Author: Heiko Stuebner <heiko@sntech.de>
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 as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
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
16#include <linux/delay.h>
17#include <linux/init.h>
18#include <linux/smp.h>
19#include <linux/io.h>
20#include <linux/of.h>
21#include <linux/of_address.h>
22
23#include <asm/cacheflush.h>
24#include <asm/smp_scu.h>
25#include <asm/smp_plat.h>
26#include <asm/mach/map.h>
27
28#include "core.h"
29
30static void __iomem *scu_base_addr;
31static void __iomem *sram_base_addr;
32static int ncores;
33
34#define PMU_PWRDN_CON 0x08
35#define PMU_PWRDN_ST 0x0c
36
37#define PMU_PWRDN_SCU 4
38
39static void __iomem *pmu_base_addr;
40
41static inline bool pmu_power_domain_is_on(int pd)
42{
43 return !(readl_relaxed(pmu_base_addr + PMU_PWRDN_ST) & BIT(pd));
44}
45
46static void pmu_set_power_domain(int pd, bool on)
47{
48 u32 val = readl_relaxed(pmu_base_addr + PMU_PWRDN_CON);
49 if (on)
50 val &= ~BIT(pd);
51 else
52 val |= BIT(pd);
53 writel(val, pmu_base_addr + PMU_PWRDN_CON);
54
55 while (pmu_power_domain_is_on(pd) != on) { }
56}
57
58/*
59 * Handling of CPU cores
60 */
61
62static int __cpuinit rockchip_boot_secondary(unsigned int cpu,
63 struct task_struct *idle)
64{
65 if (!sram_base_addr || !pmu_base_addr) {
66 pr_err("%s: sram or pmu missing for cpu boot\n", __func__);
67 return -ENXIO;
68 }
69
70 if (cpu >= ncores) {
71 pr_err("%s: cpu %d outside maximum number of cpus %d\n",
72 __func__, cpu, ncores);
73 return -ENXIO;
74 }
75
76 /* start the core */
77 pmu_set_power_domain(0 + cpu, true);
78
79 return 0;
80}
81
82/**
83 * rockchip_smp_prepare_sram - populate necessary sram block
84 * Starting cores execute the code residing at the start of the on-chip sram
85 * after power-on. Therefore make sure, this sram region is reserved and
86 * big enough. After this check, copy the trampoline code that directs the
87 * core to the real startup code in ram into the sram-region.
88 * @node: mmio-sram device node
89 */
90static int __init rockchip_smp_prepare_sram(struct device_node *node)
91{
92 unsigned int trampoline_sz = &rockchip_secondary_trampoline_end -
93 &rockchip_secondary_trampoline;
94 struct resource res;
95 unsigned int rsize;
96 int ret;
97
98 ret = of_address_to_resource(node, 0, &res);
99 if (ret < 0) {
100 pr_err("%s: could not get address for node %s\n",
101 __func__, node->full_name);
102 return ret;
103 }
104
105 rsize = resource_size(&res);
106 if (rsize < trampoline_sz) {
107 pr_err("%s: reserved block with size 0x%x is to small for trampoline size 0x%x\n",
108 __func__, rsize, trampoline_sz);
109 return -EINVAL;
110 }
111
112 sram_base_addr = of_iomap(node, 0);
113
114 /* set the boot function for the sram code */
115 rockchip_boot_fn = virt_to_phys(rockchip_secondary_startup);
116
117 /* copy the trampoline to sram, that runs during startup of the core */
118 memcpy(sram_base_addr, &rockchip_secondary_trampoline, trampoline_sz);
119 flush_cache_all();
120 outer_clean_range(0, trampoline_sz);
121
122 dsb_sev();
123
124 return 0;
125}
126
127static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus)
128{
129 struct device_node *node;
130 unsigned int i;
131
132 node = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
133 if (!node) {
134 pr_err("%s: missing scu\n", __func__);
135 return;
136 }
137
138 scu_base_addr = of_iomap(node, 0);
139 if (!scu_base_addr) {
140 pr_err("%s: could not map scu registers\n", __func__);
141 return;
142 }
143
144 node = of_find_compatible_node(NULL, NULL, "rockchip,rk3066-smp-sram");
145 if (!node) {
146 pr_err("%s: could not find sram dt node\n", __func__);
147 return;
148 }
149
150 if (rockchip_smp_prepare_sram(node))
151 return;
152
153 node = of_find_compatible_node(NULL, NULL, "rockchip,rk3066-pmu");
154 if (!node) {
155 pr_err("%s: could not find sram dt node\n", __func__);
156 return;
157 }
158
159 pmu_base_addr = of_iomap(node, 0);
160 if (!pmu_base_addr) {
161 pr_err("%s: could not map pmu registers\n", __func__);
162 return;
163 }
164
165 /* enable the SCU power domain */
166 pmu_set_power_domain(PMU_PWRDN_SCU, true);
167
168 /*
169 * While the number of cpus is gathered from dt, also get the number
170 * of cores from the scu to verify this value when booting the cores.
171 */
172 ncores = scu_get_core_count(scu_base_addr);
173
174 scu_enable(scu_base_addr);
175
176 /* Make sure that all cores except the first are really off */
177 for (i = 1; i < ncores; i++)
178 pmu_set_power_domain(0 + i, false);
179}
180
181struct smp_operations rockchip_smp_ops __initdata = {
182 .smp_prepare_cpus = rockchip_smp_prepare_cpus,
183 .smp_boot_secondary = rockchip_boot_secondary,
184};
diff --git a/arch/arm/mach-rockchip/rockchip.c b/arch/arm/mach-rockchip/rockchip.c
index 82c0b0709712..d211d6fa0d98 100644
--- a/arch/arm/mach-rockchip/rockchip.c
+++ b/arch/arm/mach-rockchip/rockchip.c
@@ -22,6 +22,7 @@
22#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
23#include <asm/mach/map.h> 23#include <asm/mach/map.h>
24#include <asm/hardware/cache-l2x0.h> 24#include <asm/hardware/cache-l2x0.h>
25#include "core.h"
25 26
26static void __init rockchip_dt_init(void) 27static void __init rockchip_dt_init(void)
27{ 28{
@@ -38,6 +39,7 @@ static const char * const rockchip_board_dt_compat[] = {
38}; 39};
39 40
40DT_MACHINE_START(ROCKCHIP_DT, "Rockchip Cortex-A9 (Device Tree)") 41DT_MACHINE_START(ROCKCHIP_DT, "Rockchip Cortex-A9 (Device Tree)")
42 .smp = smp_ops(rockchip_smp_ops),
41 .init_machine = rockchip_dt_init, 43 .init_machine = rockchip_dt_init,
42 .dt_compat = rockchip_board_dt_compat, 44 .dt_compat = rockchip_board_dt_compat,
43MACHINE_END 45MACHINE_END
diff --git a/arch/arm/mach-rpc/dma.c b/arch/arm/mach-rpc/dma.c
index 85883b2e0e49..6d3517dc4772 100644
--- a/arch/arm/mach-rpc/dma.c
+++ b/arch/arm/mach-rpc/dma.c
@@ -141,7 +141,7 @@ static int iomd_request_dma(unsigned int chan, dma_t *dma)
141 struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma); 141 struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma);
142 142
143 return request_irq(idma->irq, iomd_dma_handle, 143 return request_irq(idma->irq, iomd_dma_handle,
144 IRQF_DISABLED, idma->dma.device_id, idma); 144 0, idma->dma.device_id, idma);
145} 145}
146 146
147static void iomd_free_dma(unsigned int chan, dma_t *dma) 147static void iomd_free_dma(unsigned int chan, dma_t *dma)
diff --git a/arch/arm/mach-rpc/include/mach/timex.h b/arch/arm/mach-rpc/include/mach/timex.h
deleted file mode 100644
index dd75e7387bbe..000000000000
--- a/arch/arm/mach-rpc/include/mach/timex.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/*
2 * arch/arm/mach-rpc/include/mach/timex.h
3 *
4 * Copyright (C) 1997, 1998 Russell King
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 * RiscPC architecture timex specifications
11 */
12
13/*
14 * On the RiscPC, the clock ticks at 2MHz.
15 */
16#define CLOCK_TICK_RATE 2000000
17
diff --git a/arch/arm/mach-rpc/time.c b/arch/arm/mach-rpc/time.c
index 9a6def14df01..2689771c1d38 100644
--- a/arch/arm/mach-rpc/time.c
+++ b/arch/arm/mach-rpc/time.c
@@ -24,6 +24,9 @@
24 24
25#include <asm/mach/time.h> 25#include <asm/mach/time.h>
26 26
27#define RPC_CLOCK_FREQ 2000000
28#define RPC_LATCH DIV_ROUND_CLOSEST(RPC_CLOCK_FREQ, HZ)
29
27static u32 ioc_timer_gettimeoffset(void) 30static u32 ioc_timer_gettimeoffset(void)
28{ 31{
29 unsigned int count1, count2, status; 32 unsigned int count1, count2, status;
@@ -46,23 +49,23 @@ static u32 ioc_timer_gettimeoffset(void)
46 * and count2. 49 * and count2.
47 */ 50 */
48 if (status & (1 << 5)) 51 if (status & (1 << 5))
49 offset -= LATCH; 52 offset -= RPC_LATCH;
50 } else if (count2 > count1) { 53 } else if (count2 > count1) {
51 /* 54 /*
52 * We have just had another interrupt between reading 55 * We have just had another interrupt between reading
53 * count1 and count2. 56 * count1 and count2.
54 */ 57 */
55 offset -= LATCH; 58 offset -= RPC_LATCH;
56 } 59 }
57 60
58 offset = (LATCH - offset) * (tick_nsec / 1000); 61 offset = (RPC_LATCH - offset) * (tick_nsec / 1000);
59 return ((offset + LATCH/2) / LATCH) * 1000; 62 return DIV_ROUND_CLOSEST(offset, RPC_LATCH) * 1000;
60} 63}
61 64
62void __init ioctime_init(void) 65void __init ioctime_init(void)
63{ 66{
64 ioc_writeb(LATCH & 255, IOC_T0LTCHL); 67 ioc_writeb(RPC_LATCH & 255, IOC_T0LTCHL);
65 ioc_writeb(LATCH >> 8, IOC_T0LTCHH); 68 ioc_writeb(RPC_LATCH >> 8, IOC_T0LTCHH);
66 ioc_writeb(0, IOC_T0GO); 69 ioc_writeb(0, IOC_T0GO);
67} 70}
68 71
@@ -75,7 +78,6 @@ ioc_timer_interrupt(int irq, void *dev_id)
75 78
76static struct irqaction ioc_timer_irq = { 79static struct irqaction ioc_timer_irq = {
77 .name = "timer", 80 .name = "timer",
78 .flags = IRQF_DISABLED,
79 .handler = ioc_timer_interrupt 81 .handler = ioc_timer_interrupt
80}; 82};
81 83
diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig
index d876431d64c0..40cf50b9940c 100644
--- a/arch/arm/mach-s3c24xx/Kconfig
+++ b/arch/arm/mach-s3c24xx/Kconfig
@@ -12,7 +12,7 @@ if ARCH_S3C24XX
12config PLAT_S3C24XX 12config PLAT_S3C24XX
13 def_bool y 13 def_bool y
14 select ARCH_REQUIRE_GPIOLIB 14 select ARCH_REQUIRE_GPIOLIB
15 select NO_IOPORT 15 select NO_IOPORT_MAP
16 select S3C_DEV_NAND 16 select S3C_DEV_NAND
17 select IRQ_DOMAIN 17 select IRQ_DOMAIN
18 help 18 help
@@ -521,7 +521,6 @@ config MACH_ANUBIS
521 select HAVE_PATA_PLATFORM 521 select HAVE_PATA_PLATFORM
522 select S3C2440_XTAL_12000000 522 select S3C2440_XTAL_12000000
523 select S3C24XX_DCLK 523 select S3C24XX_DCLK
524 select S3C24XX_GPIO_EXTRA64
525 select S3C24XX_SIMTEC_PM if PM 524 select S3C24XX_SIMTEC_PM if PM
526 select S3C_DEV_USB_HOST 525 select S3C_DEV_USB_HOST
527 help 526 help
@@ -537,7 +536,7 @@ config MACH_AT2440EVB
537 536
538config MACH_MINI2440 537config MACH_MINI2440
539 bool "MINI2440 development board" 538 bool "MINI2440 development board"
540 select EEPROM_AT24 539 select EEPROM_AT24 if I2C
541 select LEDS_CLASS 540 select LEDS_CLASS
542 select LEDS_TRIGGERS 541 select LEDS_TRIGGERS
543 select LEDS_TRIGGER_BACKLIGHT 542 select LEDS_TRIGGER_BACKLIGHT
@@ -562,7 +561,6 @@ config MACH_OSIRIS
562 select S3C2410_IOTIMING if ARM_S3C2440_CPUFREQ 561 select S3C2410_IOTIMING if ARM_S3C2440_CPUFREQ
563 select S3C2440_XTAL_12000000 562 select S3C2440_XTAL_12000000
564 select S3C24XX_DCLK 563 select S3C24XX_DCLK
565 select S3C24XX_GPIO_EXTRA128
566 select S3C24XX_SIMTEC_PM if PM 564 select S3C24XX_SIMTEC_PM if PM
567 select S3C_DEV_NAND 565 select S3C_DEV_NAND
568 select S3C_DEV_USB_HOST 566 select S3C_DEV_USB_HOST
@@ -573,7 +571,7 @@ config MACH_OSIRIS
573config MACH_OSIRIS_DVS 571config MACH_OSIRIS_DVS
574 tristate "Simtec IM2440D20 (OSIRIS) Dynamic Voltage Scaling driver" 572 tristate "Simtec IM2440D20 (OSIRIS) Dynamic Voltage Scaling driver"
575 depends on MACH_OSIRIS 573 depends on MACH_OSIRIS
576 select TPS65010 574 depends on TPS65010
577 help 575 help
578 Say Y/M here if you want to have dynamic voltage scaling support 576 Say Y/M here if you want to have dynamic voltage scaling support
579 on the Simtec IM2440D20 (OSIRIS) module via the TPS65011. 577 on the Simtec IM2440D20 (OSIRIS) module via the TPS65011.
diff --git a/arch/arm/mach-s3c24xx/clock-s3c2410.c b/arch/arm/mach-s3c24xx/clock-s3c2410.c
index d39d3c787580..d1afcf9252d1 100644
--- a/arch/arm/mach-s3c24xx/clock-s3c2410.c
+++ b/arch/arm/mach-s3c24xx/clock-s3c2410.c
@@ -30,13 +30,12 @@
30#include <linux/mutex.h> 30#include <linux/mutex.h>
31#include <linux/delay.h> 31#include <linux/delay.h>
32#include <linux/serial_core.h> 32#include <linux/serial_core.h>
33#include <linux/serial_s3c.h>
33#include <linux/io.h> 34#include <linux/io.h>
34 35
35#include <asm/mach/map.h> 36#include <asm/mach/map.h>
36 37
37#include <mach/hardware.h> 38#include <mach/hardware.h>
38
39#include <plat/regs-serial.h>
40#include <mach/regs-clock.h> 39#include <mach/regs-clock.h>
41#include <mach/regs-gpio.h> 40#include <mach/regs-gpio.h>
42 41
diff --git a/arch/arm/mach-s3c24xx/clock-s3c2412.c b/arch/arm/mach-s3c24xx/clock-s3c2412.c
index 11b3b28457bb..192a5b2550b0 100644
--- a/arch/arm/mach-s3c24xx/clock-s3c2412.c
+++ b/arch/arm/mach-s3c24xx/clock-s3c2412.c
@@ -31,13 +31,12 @@
31#include <linux/mutex.h> 31#include <linux/mutex.h>
32#include <linux/delay.h> 32#include <linux/delay.h>
33#include <linux/serial_core.h> 33#include <linux/serial_core.h>
34#include <linux/serial_s3c.h>
34#include <linux/io.h> 35#include <linux/io.h>
35 36
36#include <asm/mach/map.h> 37#include <asm/mach/map.h>
37 38
38#include <mach/hardware.h> 39#include <mach/hardware.h>
39
40#include <plat/regs-serial.h>
41#include <mach/regs-clock.h> 40#include <mach/regs-clock.h>
42#include <mach/regs-gpio.h> 41#include <mach/regs-gpio.h>
43 42
diff --git a/arch/arm/mach-s3c24xx/clock-s3c2440.c b/arch/arm/mach-s3c24xx/clock-s3c2440.c
index aaf006d1d6dc..5527226fd61f 100644
--- a/arch/arm/mach-s3c24xx/clock-s3c2440.c
+++ b/arch/arm/mach-s3c24xx/clock-s3c2440.c
@@ -34,6 +34,7 @@
34#include <linux/clk.h> 34#include <linux/clk.h>
35#include <linux/io.h> 35#include <linux/io.h>
36#include <linux/serial_core.h> 36#include <linux/serial_core.h>
37#include <linux/serial_s3c.h>
37 38
38#include <mach/hardware.h> 39#include <mach/hardware.h>
39#include <linux/atomic.h> 40#include <linux/atomic.h>
@@ -43,7 +44,6 @@
43 44
44#include <plat/clock.h> 45#include <plat/clock.h>
45#include <plat/cpu.h> 46#include <plat/cpu.h>
46#include <plat/regs-serial.h>
47 47
48/* S3C2440 extended clock support */ 48/* S3C2440 extended clock support */
49 49
diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c
index 4adaa4b43ffe..1bc8e73c94f9 100644
--- a/arch/arm/mach-s3c24xx/common.c
+++ b/arch/arm/mach-s3c24xx/common.c
@@ -27,6 +27,7 @@
27#include <linux/interrupt.h> 27#include <linux/interrupt.h>
28#include <linux/ioport.h> 28#include <linux/ioport.h>
29#include <linux/serial_core.h> 29#include <linux/serial_core.h>
30#include <linux/serial_s3c.h>
30#include <clocksource/samsung_pwm.h> 31#include <clocksource/samsung_pwm.h>
31#include <linux/platform_device.h> 32#include <linux/platform_device.h>
32#include <linux/delay.h> 33#include <linux/delay.h>
@@ -44,7 +45,6 @@
44#include <asm/mach/map.h> 45#include <asm/mach/map.h>
45 46
46#include <mach/regs-gpio.h> 47#include <mach/regs-gpio.h>
47#include <plat/regs-serial.h>
48#include <mach/dma.h> 48#include <mach/dma.h>
49 49
50#include <plat/cpu.h> 50#include <plat/cpu.h>
@@ -240,7 +240,6 @@ void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)
240 } else { 240 } else {
241 samsung_cpu_id = s3c24xx_read_idcode_v4(); 241 samsung_cpu_id = s3c24xx_read_idcode_v4();
242 } 242 }
243 s3c24xx_init_cpu();
244 243
245 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); 244 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
246 245
@@ -484,7 +483,7 @@ struct platform_device s3c2440_device_dma = {
484}; 483};
485#endif 484#endif
486 485
487#if defined(CONFIG_CPUS_3C2443) || defined(CONFIG_CPU_S3C2416) 486#if defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2416)
488static struct resource s3c2443_dma_resource[] = { 487static struct resource s3c2443_dma_resource[] = {
489 [0] = DEFINE_RES_MEM(S3C24XX_PA_DMA, S3C24XX_SZ_DMA), 488 [0] = DEFINE_RES_MEM(S3C24XX_PA_DMA, S3C24XX_SZ_DMA),
490 [1] = DEFINE_RES_IRQ(IRQ_S3C2443_DMA0), 489 [1] = DEFINE_RES_IRQ(IRQ_S3C2443_DMA0),
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2410.c b/arch/arm/mach-s3c24xx/dma-s3c2410.c
index 30aa53ff07a6..09aa12da1789 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2410.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2410.c
@@ -16,6 +16,7 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/device.h> 17#include <linux/device.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19#include <linux/serial_s3c.h>
19 20
20#include <mach/map.h> 21#include <mach/map.h>
21#include <mach/dma.h> 22#include <mach/dma.h>
@@ -23,7 +24,6 @@
23#include <plat/cpu.h> 24#include <plat/cpu.h>
24#include <plat/dma-s3c24xx.h> 25#include <plat/dma-s3c24xx.h>
25 26
26#include <plat/regs-serial.h>
27#include <mach/regs-gpio.h> 27#include <mach/regs-gpio.h>
28#include <plat/regs-dma.h> 28#include <plat/regs-dma.h>
29#include <mach/regs-lcd.h> 29#include <mach/regs-lcd.h>
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2412.c b/arch/arm/mach-s3c24xx/dma-s3c2412.c
index b7e094671522..0c0106d1a4d1 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2412.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2412.c
@@ -16,6 +16,7 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/device.h> 17#include <linux/device.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19#include <linux/serial_s3c.h>
19#include <linux/io.h> 20#include <linux/io.h>
20 21
21#include <mach/dma.h> 22#include <mach/dma.h>
@@ -23,7 +24,6 @@
23#include <plat/dma-s3c24xx.h> 24#include <plat/dma-s3c24xx.h>
24#include <plat/cpu.h> 25#include <plat/cpu.h>
25 26
26#include <plat/regs-serial.h>
27#include <mach/regs-gpio.h> 27#include <mach/regs-gpio.h>
28#include <plat/regs-dma.h> 28#include <plat/regs-dma.h>
29#include <mach/regs-lcd.h> 29#include <mach/regs-lcd.h>
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2440.c b/arch/arm/mach-s3c24xx/dma-s3c2440.c
index cd25de28804c..2f8e8a3017df 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2440.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2440.c
@@ -16,6 +16,7 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/device.h> 17#include <linux/device.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19#include <linux/serial_s3c.h>
19 20
20#include <mach/map.h> 21#include <mach/map.h>
21#include <mach/dma.h> 22#include <mach/dma.h>
@@ -23,7 +24,6 @@
23#include <plat/dma-s3c24xx.h> 24#include <plat/dma-s3c24xx.h>
24#include <plat/cpu.h> 25#include <plat/cpu.h>
25 26
26#include <plat/regs-serial.h>
27#include <mach/regs-gpio.h> 27#include <mach/regs-gpio.h>
28#include <plat/regs-dma.h> 28#include <plat/regs-dma.h>
29#include <mach/regs-lcd.h> 29#include <mach/regs-lcd.h>
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2443.c b/arch/arm/mach-s3c24xx/dma-s3c2443.c
index 95b9f759fe97..f4096ec0700a 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2443.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2443.c
@@ -16,6 +16,7 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/device.h> 17#include <linux/device.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19#include <linux/serial_s3c.h>
19#include <linux/io.h> 20#include <linux/io.h>
20 21
21#include <mach/dma.h> 22#include <mach/dma.h>
@@ -23,7 +24,6 @@
23#include <plat/dma-s3c24xx.h> 24#include <plat/dma-s3c24xx.h>
24#include <plat/cpu.h> 25#include <plat/cpu.h>
25 26
26#include <plat/regs-serial.h>
27#include <mach/regs-gpio.h> 27#include <mach/regs-gpio.h>
28#include <plat/regs-dma.h> 28#include <plat/regs-dma.h>
29#include <mach/regs-lcd.h> 29#include <mach/regs-lcd.h>
diff --git a/arch/arm/mach-s3c24xx/include/mach/debug-macro.S b/arch/arm/mach-s3c24xx/include/mach/debug-macro.S
index 2558952e3147..2f39737544c0 100644
--- a/arch/arm/mach-s3c24xx/include/mach/debug-macro.S
+++ b/arch/arm/mach-s3c24xx/include/mach/debug-macro.S
@@ -14,7 +14,7 @@
14 14
15#include <mach/map.h> 15#include <mach/map.h>
16#include <mach/regs-gpio.h> 16#include <mach/regs-gpio.h>
17#include <plat/regs-serial.h> 17#include <linux/serial_s3c.h>
18 18
19#define S3C2410_UART1_OFF (0x4000) 19#define S3C2410_UART1_OFF (0x4000)
20#define SHIFT_2440TXF (14-9) 20#define SHIFT_2440TXF (14-9)
diff --git a/arch/arm/mach-s3c24xx/include/mach/hardware.h b/arch/arm/mach-s3c24xx/include/mach/hardware.h
index a6cc14a092fc..dedd3837c193 100644
--- a/arch/arm/mach-s3c24xx/include/mach/hardware.h
+++ b/arch/arm/mach-s3c24xx/include/mach/hardware.h
@@ -1,5 +1,4 @@
1/* arch/arm/mach-s3c2410/include/mach/hardware.h 1/*
2 *
3 * Copyright (c) 2003 Simtec Electronics 2 * Copyright (c) 2003 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 3 * Ben Dooks <ben@simtec.co.uk>
5 * 4 *
@@ -17,20 +16,9 @@
17 16
18extern unsigned int s3c2410_modify_misccr(unsigned int clr, unsigned int chg); 17extern unsigned int s3c2410_modify_misccr(unsigned int clr, unsigned int chg);
19 18
20#ifdef CONFIG_CPU_S3C2440
21
22extern int s3c2440_set_dsc(unsigned int pin, unsigned int value);
23
24#endif /* CONFIG_CPU_S3C2440 */
25
26#endif /* __ASSEMBLY__ */ 19#endif /* __ASSEMBLY__ */
27 20
28#include <asm/sizes.h> 21#include <asm/sizes.h>
29#include <mach/map.h> 22#include <mach/map.h>
30 23
31/* machine specific hardware definitions should go after this */
32
33/* currently here until moved into config (todo) */
34#define CONFIG_NO_MULTIWORD_IO
35
36#endif /* __ASM_ARCH_HARDWARE_H */ 24#endif /* __ASM_ARCH_HARDWARE_H */
diff --git a/arch/arm/plat-samsung/include/plat/rtc-core.h b/arch/arm/mach-s3c24xx/include/mach/rtc-core.h
index 7b542f7b7938..4d5f5768f700 100644
--- a/arch/arm/plat-samsung/include/plat/rtc-core.h
+++ b/arch/arm/mach-s3c24xx/include/mach/rtc-core.h
@@ -1,5 +1,4 @@
1/* linux/arch/arm/plat-samsung/include/plat/rtc-core.h 1/*
2 *
3 * Copyright (c) 2011 Heiko Stuebner <heiko@sntech.de> 2 * Copyright (c) 2011 Heiko Stuebner <heiko@sntech.de>
4 * 3 *
5 * Samsung RTC Controller core functions 4 * Samsung RTC Controller core functions
@@ -9,19 +8,19 @@
9 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
10*/ 9*/
11 10
12#ifndef __ASM_PLAT_RTC_CORE_H 11#ifndef __RTC_CORE_H
13#define __ASM_PLAT_RTC_CORE_H __FILE__ 12#define __RTC_CORE_H __FILE__
14 13
15/* These functions are only for use with the core support code, such as 14/* These functions are only for use with the core support code, such as
16 * the cpu specific initialisation code 15 * the cpu specific initialisation code
17 */ 16 */
18 17
18extern struct platform_device s3c_device_rtc;
19
19/* re-define device name depending on support. */ 20/* re-define device name depending on support. */
20static inline void s3c_rtc_setname(char *name) 21static inline void s3c_rtc_setname(char *name)
21{ 22{
22#if defined(CONFIG_S3C_DEV_RTC) || defined(CONFIG_PLAT_S3C24XX)
23 s3c_device_rtc.name = name; 23 s3c_device_rtc.name = name;
24#endif
25} 24}
26 25
27#endif /* __ASM_PLAT_RTC_CORE_H */ 26#endif /* __RTC_CORE_H */
diff --git a/arch/arm/mach-s3c24xx/include/mach/tick.h b/arch/arm/mach-s3c24xx/include/mach/tick.h
deleted file mode 100644
index 544da41979db..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/tick.h
+++ /dev/null
@@ -1,15 +0,0 @@
1/* linux/arch/arm/mach-s3c2410/include/mach/tick.h
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C2410 - timer tick support
8 */
9
10#define SRCPND_TIMER4 (1<<(IRQ_TIMER4 - IRQ_EINT0))
11
12static inline int s3c24xx_ostimer_pending(void)
13{
14 return __raw_readl(S3C2410_SRCPND) & SRCPND_TIMER4;
15}
diff --git a/arch/arm/mach-s3c24xx/include/mach/timex.h b/arch/arm/mach-s3c24xx/include/mach/timex.h
deleted file mode 100644
index fe9ca1ffd51b..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/timex.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/timex.h
2 *
3 * Copyright (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - 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-s3c24xx/include/mach/uncompress.h b/arch/arm/mach-s3c24xx/include/mach/uncompress.h
deleted file mode 100644
index 7d2ce205dce8..000000000000
--- a/arch/arm/mach-s3c24xx/include/mach/uncompress.h
+++ /dev/null
@@ -1,57 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/uncompress.h
2 *
3 * Copyright (c) 2003-2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C2410 - uncompress code
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#ifndef __ASM_ARCH_UNCOMPRESS_H
15#define __ASM_ARCH_UNCOMPRESS_H
16
17#include <mach/regs-gpio.h>
18#include <mach/map.h>
19
20/* working in physical space... */
21#undef S3C2410_GPIOREG
22#define S3C2410_GPIOREG(x) ((S3C24XX_PA_GPIO + (x)))
23
24#include <plat/uncompress.h>
25
26static inline int is_arm926(void)
27{
28 unsigned int cpuid;
29
30 asm volatile ("mrc p15, 0, %0, c1, c0, 0" : "=r" (cpuid));
31
32 return ((cpuid & 0xff0) == 0x260);
33}
34
35static void arch_detect_cpu(void)
36{
37 unsigned int cpuid;
38
39 cpuid = *((volatile unsigned int *)S3C2410_GSTATUS1);
40 cpuid &= S3C2410_GSTATUS1_IDMASK;
41
42 if (is_arm926() || cpuid == S3C2410_GSTATUS1_2440 ||
43 cpuid == S3C2410_GSTATUS1_2442 ||
44 cpuid == S3C2410_GSTATUS1_2416 ||
45 cpuid == S3C2410_GSTATUS1_2450) {
46 fifo_mask = S3C2440_UFSTAT_TXMASK;
47 fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT;
48 } else {
49 fifo_mask = S3C2410_UFSTAT_TXMASK;
50 fifo_max = 15 << S3C2410_UFSTAT_TXSHIFT;
51 }
52
53 uart_base = (volatile u8 *) S3C_PA_UART +
54 (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT);
55}
56
57#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-s3c24xx/mach-amlm5900.c b/arch/arm/mach-s3c24xx/mach-amlm5900.c
index 284ea1f44205..8ac9554aa996 100644
--- a/arch/arm/mach-s3c24xx/mach-amlm5900.c
+++ b/arch/arm/mach-s3c24xx/mach-amlm5900.c
@@ -37,6 +37,7 @@
37#include <linux/platform_device.h> 37#include <linux/platform_device.h>
38#include <linux/proc_fs.h> 38#include <linux/proc_fs.h>
39#include <linux/serial_core.h> 39#include <linux/serial_core.h>
40#include <linux/serial_s3c.h>
40#include <linux/io.h> 41#include <linux/io.h>
41 42
42#include <asm/mach/arch.h> 43#include <asm/mach/arch.h>
@@ -49,7 +50,6 @@
49#include <asm/mach-types.h> 50#include <asm/mach-types.h>
50#include <mach/fb.h> 51#include <mach/fb.h>
51 52
52#include <plat/regs-serial.h>
53#include <mach/regs-lcd.h> 53#include <mach/regs-lcd.h>
54#include <mach/regs-gpio.h> 54#include <mach/regs-gpio.h>
55#include <mach/gpio-samsung.h> 55#include <mach/gpio-samsung.h>
diff --git a/arch/arm/mach-s3c24xx/mach-anubis.c b/arch/arm/mach-s3c24xx/mach-anubis.c
index 2a16f8fb3584..81a270af2336 100644
--- a/arch/arm/mach-s3c24xx/mach-anubis.c
+++ b/arch/arm/mach-s3c24xx/mach-anubis.c
@@ -17,6 +17,7 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19#include <linux/serial_core.h> 19#include <linux/serial_core.h>
20#include <linux/serial_s3c.h>
20#include <linux/platform_device.h> 21#include <linux/platform_device.h>
21#include <linux/ata_platform.h> 22#include <linux/ata_platform.h>
22#include <linux/i2c.h> 23#include <linux/i2c.h>
@@ -32,7 +33,6 @@
32#include <asm/irq.h> 33#include <asm/irq.h>
33#include <asm/mach-types.h> 34#include <asm/mach-types.h>
34 35
35#include <plat/regs-serial.h>
36#include <mach/regs-gpio.h> 36#include <mach/regs-gpio.h>
37#include <mach/regs-lcd.h> 37#include <mach/regs-lcd.h>
38#include <mach/gpio-samsung.h> 38#include <mach/gpio-samsung.h>
diff --git a/arch/arm/mach-s3c24xx/mach-at2440evb.c b/arch/arm/mach-s3c24xx/mach-at2440evb.c
index 6beab674c147..d8f6bb1096cb 100644
--- a/arch/arm/mach-s3c24xx/mach-at2440evb.c
+++ b/arch/arm/mach-s3c24xx/mach-at2440evb.c
@@ -21,6 +21,7 @@
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/serial_core.h> 23#include <linux/serial_core.h>
24#include <linux/serial_s3c.h>
24#include <linux/dm9000.h> 25#include <linux/dm9000.h>
25#include <linux/platform_device.h> 26#include <linux/platform_device.h>
26 27
@@ -33,7 +34,6 @@
33#include <asm/irq.h> 34#include <asm/irq.h>
34#include <asm/mach-types.h> 35#include <asm/mach-types.h>
35 36
36#include <plat/regs-serial.h>
37#include <mach/regs-gpio.h> 37#include <mach/regs-gpio.h>
38#include <mach/regs-lcd.h> 38#include <mach/regs-lcd.h>
39#include <mach/gpio-samsung.h> 39#include <mach/gpio-samsung.h>
diff --git a/arch/arm/mach-s3c24xx/mach-bast.c b/arch/arm/mach-s3c24xx/mach-bast.c
index 981ba1eb9fdc..e371ff53a408 100644
--- a/arch/arm/mach-s3c24xx/mach-bast.c
+++ b/arch/arm/mach-s3c24xx/mach-bast.c
@@ -19,6 +19,7 @@
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/syscore_ops.h> 20#include <linux/syscore_ops.h>
21#include <linux/serial_core.h> 21#include <linux/serial_core.h>
22#include <linux/serial_s3c.h>
22#include <linux/platform_device.h> 23#include <linux/platform_device.h>
23#include <linux/dm9000.h> 24#include <linux/dm9000.h>
24#include <linux/ata_platform.h> 25#include <linux/ata_platform.h>
@@ -55,7 +56,6 @@
55#include <plat/cpu-freq.h> 56#include <plat/cpu-freq.h>
56#include <plat/devs.h> 57#include <plat/devs.h>
57#include <plat/gpio-cfg.h> 58#include <plat/gpio-cfg.h>
58#include <plat/regs-serial.h>
59#include <plat/samsung-time.h> 59#include <plat/samsung-time.h>
60 60
61#include "bast.h" 61#include "bast.h"
diff --git a/arch/arm/mach-s3c24xx/mach-gta02.c b/arch/arm/mach-s3c24xx/mach-gta02.c
index d9170e9f8ccd..dc4db849f0fd 100644
--- a/arch/arm/mach-s3c24xx/mach-gta02.c
+++ b/arch/arm/mach-s3c24xx/mach-gta02.c
@@ -35,6 +35,7 @@
35#include <linux/workqueue.h> 35#include <linux/workqueue.h>
36#include <linux/platform_device.h> 36#include <linux/platform_device.h>
37#include <linux/serial_core.h> 37#include <linux/serial_core.h>
38#include <linux/serial_s3c.h>
38#include <linux/input.h> 39#include <linux/input.h>
39#include <linux/io.h> 40#include <linux/io.h>
40#include <linux/i2c.h> 41#include <linux/i2c.h>
@@ -81,7 +82,6 @@
81#include <plat/devs.h> 82#include <plat/devs.h>
82#include <plat/gpio-cfg.h> 83#include <plat/gpio-cfg.h>
83#include <plat/pm.h> 84#include <plat/pm.h>
84#include <plat/regs-serial.h>
85#include <plat/samsung-time.h> 85#include <plat/samsung-time.h>
86 86
87#include "common.h" 87#include "common.h"
@@ -196,7 +196,7 @@ static void gta02_charger_worker(struct work_struct *work)
196 * If the PCF50633 ADC is disabled we fallback to a 196 * If the PCF50633 ADC is disabled we fallback to a
197 * 100mA limit for safety. 197 * 100mA limit for safety.
198 */ 198 */
199 pcf50633_mbc_usb_curlim_set(pcf, 100); 199 pcf50633_mbc_usb_curlim_set(gta02_pcf, 100);
200#endif 200#endif
201} 201}
202 202
diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c
index de0832181d8c..e453acd92cbf 100644
--- a/arch/arm/mach-s3c24xx/mach-h1940.c
+++ b/arch/arm/mach-s3c24xx/mach-h1940.c
@@ -19,6 +19,7 @@
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/device.h> 20#include <linux/device.h>
21#include <linux/serial_core.h> 21#include <linux/serial_core.h>
22#include <linux/serial_s3c.h>
22#include <linux/platform_device.h> 23#include <linux/platform_device.h>
23#include <linux/io.h> 24#include <linux/io.h>
24#include <linux/gpio.h> 25#include <linux/gpio.h>
@@ -62,7 +63,6 @@
62#include <plat/gpio-cfg.h> 63#include <plat/gpio-cfg.h>
63#include <plat/pll.h> 64#include <plat/pll.h>
64#include <plat/pm.h> 65#include <plat/pm.h>
65#include <plat/regs-serial.h>
66#include <plat/samsung-time.h> 66#include <plat/samsung-time.h>
67 67
68#include "common.h" 68#include "common.h"
diff --git a/arch/arm/mach-s3c24xx/mach-jive.c b/arch/arm/mach-s3c24xx/mach-jive.c
index 67cb8e948b7e..5faa7239e7d6 100644
--- a/arch/arm/mach-s3c24xx/mach-jive.c
+++ b/arch/arm/mach-s3c24xx/mach-jive.c
@@ -19,6 +19,7 @@
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/syscore_ops.h> 20#include <linux/syscore_ops.h>
21#include <linux/serial_core.h> 21#include <linux/serial_core.h>
22#include <linux/serial_s3c.h>
22#include <linux/platform_device.h> 23#include <linux/platform_device.h>
23#include <linux/i2c.h> 24#include <linux/i2c.h>
24 25
@@ -31,7 +32,6 @@
31#include <asm/mach/map.h> 32#include <asm/mach/map.h>
32#include <asm/mach/irq.h> 33#include <asm/mach/irq.h>
33 34
34#include <plat/regs-serial.h>
35#include <linux/platform_data/mtd-nand-s3c2410.h> 35#include <linux/platform_data/mtd-nand-s3c2410.h>
36#include <linux/platform_data/i2c-s3c2410.h> 36#include <linux/platform_data/i2c-s3c2410.h>
37 37
diff --git a/arch/arm/mach-s3c24xx/mach-mini2440.c b/arch/arm/mach-s3c24xx/mach-mini2440.c
index 1f1559713d8b..9e57fd9f4f3b 100644
--- a/arch/arm/mach-s3c24xx/mach-mini2440.c
+++ b/arch/arm/mach-s3c24xx/mach-mini2440.c
@@ -23,6 +23,7 @@
23#include <linux/input.h> 23#include <linux/input.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/serial_core.h> 25#include <linux/serial_core.h>
26#include <linux/serial_s3c.h>
26#include <linux/dm9000.h> 27#include <linux/dm9000.h>
27#include <linux/platform_data/at24.h> 28#include <linux/platform_data/at24.h>
28#include <linux/platform_device.h> 29#include <linux/platform_device.h>
@@ -37,7 +38,6 @@
37#include <mach/fb.h> 38#include <mach/fb.h>
38#include <asm/mach-types.h> 39#include <asm/mach-types.h>
39 40
40#include <plat/regs-serial.h>
41#include <mach/regs-gpio.h> 41#include <mach/regs-gpio.h>
42#include <linux/platform_data/leds-s3c24xx.h> 42#include <linux/platform_data/leds-s3c24xx.h>
43#include <mach/regs-lcd.h> 43#include <mach/regs-lcd.h>
diff --git a/arch/arm/mach-s3c24xx/mach-n30.c b/arch/arm/mach-s3c24xx/mach-n30.c
index 997684f17930..4cccaad34847 100644
--- a/arch/arm/mach-s3c24xx/mach-n30.c
+++ b/arch/arm/mach-s3c24xx/mach-n30.c
@@ -24,6 +24,7 @@
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26#include <linux/serial_core.h> 26#include <linux/serial_core.h>
27#include <linux/serial_s3c.h>
27#include <linux/timer.h> 28#include <linux/timer.h>
28#include <linux/io.h> 29#include <linux/io.h>
29#include <linux/mmc/host.h> 30#include <linux/mmc/host.h>
@@ -43,7 +44,6 @@
43#include <asm/mach/map.h> 44#include <asm/mach/map.h>
44 45
45#include <linux/platform_data/i2c-s3c2410.h> 46#include <linux/platform_data/i2c-s3c2410.h>
46#include <plat/regs-serial.h>
47 47
48#include <plat/clock.h> 48#include <plat/clock.h>
49#include <plat/cpu.h> 49#include <plat/cpu.h>
diff --git a/arch/arm/mach-s3c24xx/mach-nexcoder.c b/arch/arm/mach-s3c24xx/mach-nexcoder.c
index 575d28c9e6c6..3066851f584d 100644
--- a/arch/arm/mach-s3c24xx/mach-nexcoder.c
+++ b/arch/arm/mach-s3c24xx/mach-nexcoder.c
@@ -21,6 +21,7 @@
21#include <linux/gpio.h> 21#include <linux/gpio.h>
22#include <linux/string.h> 22#include <linux/string.h>
23#include <linux/serial_core.h> 23#include <linux/serial_core.h>
24#include <linux/serial_s3c.h>
24#include <linux/platform_device.h> 25#include <linux/platform_device.h>
25#include <linux/io.h> 26#include <linux/io.h>
26 27
@@ -38,7 +39,6 @@
38//#include <asm/debug-ll.h> 39//#include <asm/debug-ll.h>
39#include <mach/regs-gpio.h> 40#include <mach/regs-gpio.h>
40#include <mach/gpio-samsung.h> 41#include <mach/gpio-samsung.h>
41#include <plat/regs-serial.h>
42#include <linux/platform_data/i2c-s3c2410.h> 42#include <linux/platform_data/i2c-s3c2410.h>
43 43
44#include <plat/gpio-cfg.h> 44#include <plat/gpio-cfg.h>
diff --git a/arch/arm/mach-s3c24xx/mach-osiris.c b/arch/arm/mach-s3c24xx/mach-osiris.c
index f84f2a4c0c6d..a4ae4bb3666d 100644
--- a/arch/arm/mach-s3c24xx/mach-osiris.c
+++ b/arch/arm/mach-s3c24xx/mach-osiris.c
@@ -18,6 +18,7 @@
18#include <linux/device.h> 18#include <linux/device.h>
19#include <linux/syscore_ops.h> 19#include <linux/syscore_ops.h>
20#include <linux/serial_core.h> 20#include <linux/serial_core.h>
21#include <linux/serial_s3c.h>
21#include <linux/clk.h> 22#include <linux/clk.h>
22#include <linux/i2c.h> 23#include <linux/i2c.h>
23#include <linux/io.h> 24#include <linux/io.h>
@@ -44,7 +45,6 @@
44#include <plat/cpu-freq.h> 45#include <plat/cpu-freq.h>
45#include <plat/devs.h> 46#include <plat/devs.h>
46#include <plat/gpio-cfg.h> 47#include <plat/gpio-cfg.h>
47#include <plat/regs-serial.h>
48#include <plat/samsung-time.h> 48#include <plat/samsung-time.h>
49 49
50#include <mach/hardware.h> 50#include <mach/hardware.h>
diff --git a/arch/arm/mach-s3c24xx/mach-otom.c b/arch/arm/mach-s3c24xx/mach-otom.c
index 7e16b0740ec1..bdb3faac2d9b 100644
--- a/arch/arm/mach-s3c24xx/mach-otom.c
+++ b/arch/arm/mach-s3c24xx/mach-otom.c
@@ -15,6 +15,7 @@
15#include <linux/timer.h> 15#include <linux/timer.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/serial_core.h> 17#include <linux/serial_core.h>
18#include <linux/serial_s3c.h>
18#include <linux/platform_device.h> 19#include <linux/platform_device.h>
19#include <linux/io.h> 20#include <linux/io.h>
20 21
@@ -32,7 +33,6 @@
32#include <plat/clock.h> 33#include <plat/clock.h>
33#include <plat/cpu.h> 34#include <plat/cpu.h>
34#include <plat/devs.h> 35#include <plat/devs.h>
35#include <plat/regs-serial.h>
36#include <plat/samsung-time.h> 36#include <plat/samsung-time.h>
37 37
38#include "common.h" 38#include "common.h"
diff --git a/arch/arm/mach-s3c24xx/mach-qt2410.c b/arch/arm/mach-s3c24xx/mach-qt2410.c
index b534b76812e3..8c12787a8fd3 100644
--- a/arch/arm/mach-s3c24xx/mach-qt2410.c
+++ b/arch/arm/mach-s3c24xx/mach-qt2410.c
@@ -31,6 +31,7 @@
31#include <linux/device.h> 31#include <linux/device.h>
32#include <linux/platform_device.h> 32#include <linux/platform_device.h>
33#include <linux/serial_core.h> 33#include <linux/serial_core.h>
34#include <linux/serial_s3c.h>
34#include <linux/spi/spi.h> 35#include <linux/spi/spi.h>
35#include <linux/spi/spi_gpio.h> 36#include <linux/spi/spi_gpio.h>
36#include <linux/io.h> 37#include <linux/io.h>
@@ -49,7 +50,6 @@
49 50
50#include <linux/platform_data/leds-s3c24xx.h> 51#include <linux/platform_data/leds-s3c24xx.h>
51#include <mach/regs-lcd.h> 52#include <mach/regs-lcd.h>
52#include <plat/regs-serial.h>
53#include <mach/fb.h> 53#include <mach/fb.h>
54#include <linux/platform_data/mtd-nand-s3c2410.h> 54#include <linux/platform_data/mtd-nand-s3c2410.h>
55#include <linux/platform_data/usb-s3c2410_udc.h> 55#include <linux/platform_data/usb-s3c2410_udc.h>
diff --git a/arch/arm/mach-s3c24xx/mach-rx1950.c b/arch/arm/mach-s3c24xx/mach-rx1950.c
index 0a5456cda1bc..afb784e934c8 100644
--- a/arch/arm/mach-s3c24xx/mach-rx1950.c
+++ b/arch/arm/mach-s3c24xx/mach-rx1950.c
@@ -21,6 +21,7 @@
21#include <linux/gpio.h> 21#include <linux/gpio.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/serial_core.h> 23#include <linux/serial_core.h>
24#include <linux/serial_s3c.h>
24#include <linux/input.h> 25#include <linux/input.h>
25#include <linux/gpio_keys.h> 26#include <linux/gpio_keys.h>
26#include <linux/device.h> 27#include <linux/device.h>
@@ -57,7 +58,6 @@
57#include <plat/cpu.h> 58#include <plat/cpu.h>
58#include <plat/devs.h> 59#include <plat/devs.h>
59#include <plat/pm.h> 60#include <plat/pm.h>
60#include <plat/regs-serial.h>
61#include <plat/samsung-time.h> 61#include <plat/samsung-time.h>
62#include <plat/gpio-cfg.h> 62#include <plat/gpio-cfg.h>
63 63
diff --git a/arch/arm/mach-s3c24xx/mach-rx3715.c b/arch/arm/mach-s3c24xx/mach-rx3715.c
index b36edce8b2b8..e6535ce1bc5c 100644
--- a/arch/arm/mach-s3c24xx/mach-rx3715.c
+++ b/arch/arm/mach-s3c24xx/mach-rx3715.c
@@ -23,6 +23,7 @@
23#include <linux/device.h> 23#include <linux/device.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/serial_core.h> 25#include <linux/serial_core.h>
26#include <linux/serial_s3c.h>
26#include <linux/serial.h> 27#include <linux/serial.h>
27#include <linux/io.h> 28#include <linux/io.h>
28#include <linux/mtd/mtd.h> 29#include <linux/mtd/mtd.h>
@@ -49,7 +50,6 @@
49#include <plat/cpu.h> 50#include <plat/cpu.h>
50#include <plat/devs.h> 51#include <plat/devs.h>
51#include <plat/pm.h> 52#include <plat/pm.h>
52#include <plat/regs-serial.h>
53#include <plat/samsung-time.h> 53#include <plat/samsung-time.h>
54 54
55#include "common.h" 55#include "common.h"
diff --git a/arch/arm/mach-s3c24xx/mach-s3c2416-dt.c b/arch/arm/mach-s3c24xx/mach-s3c2416-dt.c
index f50454a34f72..70f0900d4bca 100644
--- a/arch/arm/mach-s3c24xx/mach-s3c2416-dt.c
+++ b/arch/arm/mach-s3c24xx/mach-s3c2416-dt.c
@@ -19,13 +19,13 @@
19#include <linux/irqchip.h> 19#include <linux/irqchip.h>
20#include <linux/of_platform.h> 20#include <linux/of_platform.h>
21#include <linux/serial_core.h> 21#include <linux/serial_core.h>
22#include <linux/serial_s3c.h>
22 23
23#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
24#include <mach/map.h> 25#include <mach/map.h>
25 26
26#include <plat/cpu.h> 27#include <plat/cpu.h>
27#include <plat/pm.h> 28#include <plat/pm.h>
28#include <plat/regs-serial.h>
29 29
30#include "common.h" 30#include "common.h"
31 31
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2410.c b/arch/arm/mach-s3c24xx/mach-smdk2410.c
index a773789e4f38..f32924ee0e9f 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2410.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2410.c
@@ -35,6 +35,7 @@
35#include <linux/timer.h> 35#include <linux/timer.h>
36#include <linux/init.h> 36#include <linux/init.h>
37#include <linux/serial_core.h> 37#include <linux/serial_core.h>
38#include <linux/serial_s3c.h>
38#include <linux/platform_device.h> 39#include <linux/platform_device.h>
39#include <linux/io.h> 40#include <linux/io.h>
40 41
@@ -46,7 +47,6 @@
46#include <asm/irq.h> 47#include <asm/irq.h>
47#include <asm/mach-types.h> 48#include <asm/mach-types.h>
48 49
49#include <plat/regs-serial.h>
50#include <linux/platform_data/i2c-s3c2410.h> 50#include <linux/platform_data/i2c-s3c2410.h>
51 51
52#include <plat/devs.h> 52#include <plat/devs.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2413.c b/arch/arm/mach-s3c24xx/mach-smdk2413.c
index f5bc721217e3..233fe52d2015 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2413.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2413.c
@@ -19,6 +19,7 @@
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/gpio.h> 20#include <linux/gpio.h>
21#include <linux/serial_core.h> 21#include <linux/serial_core.h>
22#include <linux/serial_s3c.h>
22#include <linux/platform_device.h> 23#include <linux/platform_device.h>
23#include <linux/io.h> 24#include <linux/io.h>
24 25
@@ -33,7 +34,6 @@
33#include <asm/mach-types.h> 34#include <asm/mach-types.h>
34 35
35//#include <asm/debug-ll.h> 36//#include <asm/debug-ll.h>
36#include <plat/regs-serial.h>
37#include <mach/regs-gpio.h> 37#include <mach/regs-gpio.h>
38#include <mach/regs-lcd.h> 38#include <mach/regs-lcd.h>
39 39
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2416.c b/arch/arm/mach-s3c24xx/mach-smdk2416.c
index 12023cae4378..b3b54d8e1410 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2416.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2416.c
@@ -18,6 +18,7 @@
18#include <linux/timer.h> 18#include <linux/timer.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/serial_core.h> 20#include <linux/serial_core.h>
21#include <linux/serial_s3c.h>
21#include <linux/platform_device.h> 22#include <linux/platform_device.h>
22#include <linux/io.h> 23#include <linux/io.h>
23#include <linux/mtd/partitions.h> 24#include <linux/mtd/partitions.h>
@@ -34,7 +35,6 @@
34#include <asm/irq.h> 35#include <asm/irq.h>
35#include <asm/mach-types.h> 36#include <asm/mach-types.h>
36 37
37#include <plat/regs-serial.h>
38#include <mach/regs-gpio.h> 38#include <mach/regs-gpio.h>
39#include <mach/regs-lcd.h> 39#include <mach/regs-lcd.h>
40#include <mach/regs-s3c2443-clock.h> 40#include <mach/regs-s3c2443-clock.h>
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2440.c b/arch/arm/mach-s3c24xx/mach-smdk2440.c
index de2e5d39a847..d071dcfea548 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2440.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2440.c
@@ -20,6 +20,7 @@
20#include <linux/timer.h> 20#include <linux/timer.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/serial_core.h> 22#include <linux/serial_core.h>
23#include <linux/serial_s3c.h>
23#include <linux/platform_device.h> 24#include <linux/platform_device.h>
24#include <linux/io.h> 25#include <linux/io.h>
25 26
@@ -31,7 +32,6 @@
31#include <asm/irq.h> 32#include <asm/irq.h>
32#include <asm/mach-types.h> 33#include <asm/mach-types.h>
33 34
34#include <plat/regs-serial.h>
35#include <mach/regs-gpio.h> 35#include <mach/regs-gpio.h>
36#include <mach/regs-lcd.h> 36#include <mach/regs-lcd.h>
37 37
diff --git a/arch/arm/mach-s3c24xx/mach-smdk2443.c b/arch/arm/mach-s3c24xx/mach-smdk2443.c
index d9933fcc6cc8..06c4d77de3a5 100644
--- a/arch/arm/mach-s3c24xx/mach-smdk2443.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2443.c
@@ -20,6 +20,7 @@
20#include <linux/timer.h> 20#include <linux/timer.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/serial_core.h> 22#include <linux/serial_core.h>
23#include <linux/serial_s3c.h>
23#include <linux/platform_device.h> 24#include <linux/platform_device.h>
24#include <linux/io.h> 25#include <linux/io.h>
25 26
@@ -31,7 +32,6 @@
31#include <asm/irq.h> 32#include <asm/irq.h>
32#include <asm/mach-types.h> 33#include <asm/mach-types.h>
33 34
34#include <plat/regs-serial.h>
35#include <mach/regs-gpio.h> 35#include <mach/regs-gpio.h>
36#include <mach/regs-lcd.h> 36#include <mach/regs-lcd.h>
37 37
diff --git a/arch/arm/mach-s3c24xx/mach-tct_hammer.c b/arch/arm/mach-s3c24xx/mach-tct_hammer.c
index 7fad8f055cab..4108b2f0cede 100644
--- a/arch/arm/mach-s3c24xx/mach-tct_hammer.c
+++ b/arch/arm/mach-s3c24xx/mach-tct_hammer.c
@@ -33,6 +33,7 @@
33#include <linux/device.h> 33#include <linux/device.h>
34#include <linux/platform_device.h> 34#include <linux/platform_device.h>
35#include <linux/serial_core.h> 35#include <linux/serial_core.h>
36#include <linux/serial_s3c.h>
36#include <linux/io.h> 37#include <linux/io.h>
37 38
38#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
@@ -44,7 +45,6 @@
44#include <asm/irq.h> 45#include <asm/irq.h>
45#include <asm/mach-types.h> 46#include <asm/mach-types.h>
46 47
47#include <plat/regs-serial.h>
48#include <linux/platform_data/i2c-s3c2410.h> 48#include <linux/platform_data/i2c-s3c2410.h>
49#include <plat/devs.h> 49#include <plat/devs.h>
50#include <plat/cpu.h> 50#include <plat/cpu.h>
diff --git a/arch/arm/mach-s3c24xx/mach-vr1000.c b/arch/arm/mach-s3c24xx/mach-vr1000.c
index 755df489a45f..1cc5b1bd51cd 100644
--- a/arch/arm/mach-s3c24xx/mach-vr1000.c
+++ b/arch/arm/mach-s3c24xx/mach-vr1000.c
@@ -25,6 +25,7 @@
25#include <linux/tty.h> 25#include <linux/tty.h>
26#include <linux/serial_8250.h> 26#include <linux/serial_8250.h>
27#include <linux/serial_reg.h> 27#include <linux/serial_reg.h>
28#include <linux/serial_s3c.h>
28#include <linux/io.h> 29#include <linux/io.h>
29 30
30#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
@@ -45,7 +46,6 @@
45#include <plat/clock.h> 46#include <plat/clock.h>
46#include <plat/cpu.h> 47#include <plat/cpu.h>
47#include <plat/devs.h> 48#include <plat/devs.h>
48#include <plat/regs-serial.h>
49#include <plat/samsung-time.h> 49#include <plat/samsung-time.h>
50 50
51#include "bast.h" 51#include "bast.h"
diff --git a/arch/arm/mach-s3c24xx/mach-vstms.c b/arch/arm/mach-s3c24xx/mach-vstms.c
index f7ec9c550787..40868c0e0a68 100644
--- a/arch/arm/mach-s3c24xx/mach-vstms.c
+++ b/arch/arm/mach-s3c24xx/mach-vstms.c
@@ -16,6 +16,7 @@
16#include <linux/timer.h> 16#include <linux/timer.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19#include <linux/serial_s3c.h>
19#include <linux/platform_device.h> 20#include <linux/platform_device.h>
20#include <linux/io.h> 21#include <linux/io.h>
21#include <linux/mtd/mtd.h> 22#include <linux/mtd/mtd.h>
@@ -32,7 +33,6 @@
32#include <asm/irq.h> 33#include <asm/irq.h>
33#include <asm/mach-types.h> 34#include <asm/mach-types.h>
34 35
35#include <plat/regs-serial.h>
36#include <mach/regs-gpio.h> 36#include <mach/regs-gpio.h>
37#include <mach/regs-lcd.h> 37#include <mach/regs-lcd.h>
38 38
diff --git a/arch/arm/mach-s3c24xx/pm.c b/arch/arm/mach-s3c24xx/pm.c
index 052ca23393a7..68ea5b7e5dc7 100644
--- a/arch/arm/mach-s3c24xx/pm.c
+++ b/arch/arm/mach-s3c24xx/pm.c
@@ -33,9 +33,9 @@
33#include <linux/gpio.h> 33#include <linux/gpio.h>
34#include <linux/interrupt.h> 34#include <linux/interrupt.h>
35#include <linux/serial_core.h> 35#include <linux/serial_core.h>
36#include <linux/serial_s3c.h>
36#include <linux/io.h> 37#include <linux/io.h>
37 38
38#include <plat/regs-serial.h>
39#include <mach/regs-clock.h> 39#include <mach/regs-clock.h>
40#include <mach/regs-gpio.h> 40#include <mach/regs-gpio.h>
41#include <mach/regs-irq.h> 41#include <mach/regs-irq.h>
diff --git a/arch/arm/mach-s3c24xx/s3c2410.c b/arch/arm/mach-s3c24xx/s3c2410.c
index ffb92cbca08c..04b58cb49888 100644
--- a/arch/arm/mach-s3c24xx/s3c2410.c
+++ b/arch/arm/mach-s3c24xx/s3c2410.c
@@ -21,6 +21,7 @@
21#include <linux/device.h> 21#include <linux/device.h>
22#include <linux/syscore_ops.h> 22#include <linux/syscore_ops.h>
23#include <linux/serial_core.h> 23#include <linux/serial_core.h>
24#include <linux/serial_s3c.h>
24#include <linux/platform_device.h> 25#include <linux/platform_device.h>
25#include <linux/reboot.h> 26#include <linux/reboot.h>
26#include <linux/io.h> 27#include <linux/io.h>
@@ -37,7 +38,6 @@
37#include <plat/cpu-freq.h> 38#include <plat/cpu-freq.h>
38 39
39#include <mach/regs-clock.h> 40#include <mach/regs-clock.h>
40#include <plat/regs-serial.h>
41 41
42#include <plat/cpu.h> 42#include <plat/cpu.h>
43#include <plat/devs.h> 43#include <plat/devs.h>
diff --git a/arch/arm/mach-s3c24xx/s3c2412.c b/arch/arm/mach-s3c24xx/s3c2412.c
index 0251650cbf80..657cbaca80ac 100644
--- a/arch/arm/mach-s3c24xx/s3c2412.c
+++ b/arch/arm/mach-s3c24xx/s3c2412.c
@@ -20,6 +20,7 @@
20#include <linux/device.h> 20#include <linux/device.h>
21#include <linux/syscore_ops.h> 21#include <linux/syscore_ops.h>
22#include <linux/serial_core.h> 22#include <linux/serial_core.h>
23#include <linux/serial_s3c.h>
23#include <linux/platform_device.h> 24#include <linux/platform_device.h>
24#include <linux/io.h> 25#include <linux/io.h>
25#include <linux/reboot.h> 26#include <linux/reboot.h>
@@ -43,7 +44,6 @@
43#include <plat/nand-core.h> 44#include <plat/nand-core.h>
44#include <plat/pll.h> 45#include <plat/pll.h>
45#include <plat/pm.h> 46#include <plat/pm.h>
46#include <plat/regs-serial.h>
47#include <plat/regs-spi.h> 47#include <plat/regs-spi.h>
48 48
49#include "common.h" 49#include "common.h"
diff --git a/arch/arm/mach-s3c24xx/s3c2416.c b/arch/arm/mach-s3c24xx/s3c2416.c
index 8e01b4f2df35..9fe260ae11e1 100644
--- a/arch/arm/mach-s3c24xx/s3c2416.c
+++ b/arch/arm/mach-s3c24xx/s3c2416.c
@@ -48,6 +48,7 @@
48#include <asm/system_misc.h> 48#include <asm/system_misc.h>
49 49
50#include <mach/regs-s3c2443-clock.h> 50#include <mach/regs-s3c2443-clock.h>
51#include <mach/rtc-core.h>
51 52
52#include <plat/gpio-core.h> 53#include <plat/gpio-core.h>
53#include <plat/gpio-cfg.h> 54#include <plat/gpio-cfg.h>
@@ -61,7 +62,6 @@
61#include <plat/fb-core.h> 62#include <plat/fb-core.h>
62#include <plat/nand-core.h> 63#include <plat/nand-core.h>
63#include <plat/adc-core.h> 64#include <plat/adc-core.h>
64#include <plat/rtc-core.h>
65#include <plat/spi-core.h> 65#include <plat/spi-core.h>
66 66
67#include "common.h" 67#include "common.h"
diff --git a/arch/arm/mach-s3c24xx/s3c2443.c b/arch/arm/mach-s3c24xx/s3c2443.c
index 886c2147062b..c7a804d0348e 100644
--- a/arch/arm/mach-s3c24xx/s3c2443.c
+++ b/arch/arm/mach-s3c24xx/s3c2443.c
@@ -34,6 +34,7 @@
34#include <asm/system_misc.h> 34#include <asm/system_misc.h>
35 35
36#include <mach/regs-s3c2443-clock.h> 36#include <mach/regs-s3c2443-clock.h>
37#include <mach/rtc-core.h>
37 38
38#include <plat/gpio-core.h> 39#include <plat/gpio-core.h>
39#include <plat/gpio-cfg.h> 40#include <plat/gpio-cfg.h>
@@ -43,7 +44,6 @@
43#include <plat/fb-core.h> 44#include <plat/fb-core.h>
44#include <plat/nand-core.h> 45#include <plat/nand-core.h>
45#include <plat/adc-core.h> 46#include <plat/adc-core.h>
46#include <plat/rtc-core.h>
47#include <plat/spi-core.h> 47#include <plat/spi-core.h>
48 48
49static struct map_desc s3c2443_iodesc[] __initdata = { 49static struct map_desc s3c2443_iodesc[] __initdata = {
diff --git a/arch/arm/mach-s3c24xx/s3c244x.c b/arch/arm/mach-s3c24xx/s3c244x.c
index 911b555029fc..fe30ebb234d2 100644
--- a/arch/arm/mach-s3c24xx/s3c244x.c
+++ b/arch/arm/mach-s3c24xx/s3c244x.c
@@ -17,6 +17,7 @@
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/serial_core.h> 19#include <linux/serial_core.h>
20#include <linux/serial_s3c.h>
20#include <linux/platform_device.h> 21#include <linux/platform_device.h>
21#include <linux/reboot.h> 22#include <linux/reboot.h>
22#include <linux/device.h> 23#include <linux/device.h>
@@ -35,7 +36,6 @@
35#include <plat/cpu-freq.h> 36#include <plat/cpu-freq.h>
36 37
37#include <mach/regs-clock.h> 38#include <mach/regs-clock.h>
38#include <plat/regs-serial.h>
39#include <mach/regs-gpio.h> 39#include <mach/regs-gpio.h>
40 40
41#include <plat/clock.h> 41#include <plat/clock.h>
diff --git a/arch/arm/mach-s3c24xx/sleep-s3c2410.S b/arch/arm/mach-s3c24xx/sleep-s3c2410.S
index dd47c8fa07fa..c9b91223697c 100644
--- a/arch/arm/mach-s3c24xx/sleep-s3c2410.S
+++ b/arch/arm/mach-s3c24xx/sleep-s3c2410.S
@@ -25,13 +25,13 @@
25*/ 25*/
26 26
27#include <linux/linkage.h> 27#include <linux/linkage.h>
28#include <linux/serial_s3c.h>
28#include <asm/assembler.h> 29#include <asm/assembler.h>
29#include <mach/hardware.h> 30#include <mach/hardware.h>
30#include <mach/map.h> 31#include <mach/map.h>
31 32
32#include <mach/regs-gpio.h> 33#include <mach/regs-gpio.h>
33#include <mach/regs-clock.h> 34#include <mach/regs-clock.h>
34#include <plat/regs-serial.h>
35 35
36#include "regs-mem.h" 36#include "regs-mem.h"
37 37
diff --git a/arch/arm/mach-s3c24xx/sleep.S b/arch/arm/mach-s3c24xx/sleep.S
index 7f378b662da6..d833d616bd2e 100644
--- a/arch/arm/mach-s3c24xx/sleep.S
+++ b/arch/arm/mach-s3c24xx/sleep.S
@@ -25,13 +25,13 @@
25*/ 25*/
26 26
27#include <linux/linkage.h> 27#include <linux/linkage.h>
28#include <linux/serial_s3c.h>
28#include <asm/assembler.h> 29#include <asm/assembler.h>
29#include <mach/hardware.h> 30#include <mach/hardware.h>
30#include <mach/map.h> 31#include <mach/map.h>
31 32
32#include <mach/regs-gpio.h> 33#include <mach/regs-gpio.h>
33#include <mach/regs-clock.h> 34#include <mach/regs-clock.h>
34#include <plat/regs-serial.h>
35 35
36/* CONFIG_DEBUG_RESUME is dangerous if your bootloader does not 36/* CONFIG_DEBUG_RESUME is dangerous if your bootloader does not
37 * reset the UART configuration, only enable if you really need this! 37 * reset the UART configuration, only enable if you really need this!
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index 64f04e6f9c31..3136d86b0d6e 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -86,8 +86,7 @@ config MACH_SMDK6400
86 bool "SMDK6400" 86 bool "SMDK6400"
87 select CPU_S3C6400 87 select CPU_S3C6400
88 select S3C64XX_SETUP_SDHCI 88 select S3C64XX_SETUP_SDHCI
89 select S3C_DEV_HSMMC 89 select S3C_DEV_HSMMC1
90 select S3C_DEV_NAND
91 help 90 help
92 Machine support for the Samsung SMDK6400 91 Machine support for the Samsung SMDK6400
93 92
diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c
index 76ab595d849b..5c45aae675b6 100644
--- a/arch/arm/mach-s3c64xx/common.c
+++ b/arch/arm/mach-s3c64xx/common.c
@@ -25,6 +25,7 @@
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/ioport.h> 26#include <linux/ioport.h>
27#include <linux/serial_core.h> 27#include <linux/serial_core.h>
28#include <linux/serial_s3c.h>
28#include <linux/platform_device.h> 29#include <linux/platform_device.h>
29#include <linux/reboot.h> 30#include <linux/reboot.h>
30#include <linux/io.h> 31#include <linux/io.h>
@@ -50,7 +51,6 @@
50#include <plat/irq-uart.h> 51#include <plat/irq-uart.h>
51#include <plat/pwm-core.h> 52#include <plat/pwm-core.h>
52#include <plat/regs-irqtype.h> 53#include <plat/regs-irqtype.h>
53#include <plat/regs-serial.h>
54#include <plat/watchdog-reset.h> 54#include <plat/watchdog-reset.h>
55 55
56#include "common.h" 56#include "common.h"
diff --git a/arch/arm/mach-s3c64xx/include/mach/debug-macro.S b/arch/arm/mach-s3c64xx/include/mach/debug-macro.S
index dd9ccca5de1f..c9b95325b672 100644
--- a/arch/arm/mach-s3c64xx/include/mach/debug-macro.S
+++ b/arch/arm/mach-s3c64xx/include/mach/debug-macro.S
@@ -12,8 +12,8 @@
12 12
13/* pull in the relevant register and map files. */ 13/* pull in the relevant register and map files. */
14 14
15#include <linux/serial_s3c.h>
15#include <mach/map.h> 16#include <mach/map.h>
16#include <plat/regs-serial.h>
17 17
18 /* note, for the boot process to work we have to keep the UART 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 19 * virtual address aligned to an 1MiB boundary for the L1
diff --git a/arch/arm/mach-s3c64xx/include/mach/pm-core.h b/arch/arm/mach-s3c64xx/include/mach/pm-core.h
index c0537f40a3d8..a30a1e3ffc6a 100644
--- a/arch/arm/mach-s3c64xx/include/mach/pm-core.h
+++ b/arch/arm/mach-s3c64xx/include/mach/pm-core.h
@@ -15,6 +15,8 @@
15#ifndef __MACH_S3C64XX_PM_CORE_H 15#ifndef __MACH_S3C64XX_PM_CORE_H
16#define __MACH_S3C64XX_PM_CORE_H __FILE__ 16#define __MACH_S3C64XX_PM_CORE_H __FILE__
17 17
18#include <linux/serial_s3c.h>
19
18#include <mach/regs-gpio.h> 20#include <mach/regs-gpio.h>
19 21
20static inline void s3c_pm_debug_init_uart(void) 22static inline void s3c_pm_debug_init_uart(void)
diff --git a/arch/arm/mach-s3c64xx/include/mach/tick.h b/arch/arm/mach-s3c64xx/include/mach/tick.h
deleted file mode 100644
index db9c1b1d56a4..000000000000
--- a/arch/arm/mach-s3c64xx/include/mach/tick.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/* linux/arch/arm/mach-s3c6400/include/mach/tick.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 - 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
18#include <linux/irqchip/arm-vic.h>
19
20/* note, the timer interrutps turn up in 2 places, the vic and then
21 * the timer block. We take the VIC as the base at the moment.
22 */
23static inline u32 s3c24xx_ostimer_pending(void)
24{
25 u32 pend = __raw_readl(VA_VIC0 + VIC_RAW_STATUS);
26 return pend & 1 << (IRQ_TIMER4_VIC - S3C64XX_IRQ_VIC0(0));
27}
28
29#define TICK_MAX (0xffffffff)
30
31#endif /* __ASM_ARCH_6400_TICK_H */
diff --git a/arch/arm/mach-s3c64xx/include/mach/timex.h b/arch/arm/mach-s3c64xx/include/mach/timex.h
deleted file mode 100644
index fb2e8cd40829..000000000000
--- a/arch/arm/mach-s3c64xx/include/mach/timex.h
+++ /dev/null
@@ -1,24 +0,0 @@
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-s3c64xx/include/mach/uncompress.h b/arch/arm/mach-s3c64xx/include/mach/uncompress.h
deleted file mode 100644
index 1c956738b42d..000000000000
--- a/arch/arm/mach-s3c64xx/include/mach/uncompress.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/* arch/arm/mach-s3c6400/include/mach/uncompress.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 * S3C6400 - uncompress code
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_UNCOMPRESS_H
16#define __ASM_ARCH_UNCOMPRESS_H
17
18#include <mach/map.h>
19#include <plat/uncompress.h>
20
21static void arch_detect_cpu(void)
22{
23 /* we do not need to do any cpu detection here at the moment. */
24 fifo_mask = S3C2440_UFSTAT_TXMASK;
25 fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT;
26
27 uart_base = (volatile u8 *)S3C_PA_UART +
28 (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT);
29}
30
31#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-s3c64xx/irq-pm.c b/arch/arm/mach-s3c64xx/irq-pm.c
index 1649c0d1c1b8..ae4ea7601f60 100644
--- a/arch/arm/mach-s3c64xx/irq-pm.c
+++ b/arch/arm/mach-s3c64xx/irq-pm.c
@@ -20,13 +20,13 @@
20#include <linux/syscore_ops.h> 20#include <linux/syscore_ops.h>
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/serial_core.h> 22#include <linux/serial_core.h>
23#include <linux/serial_s3c.h>
23#include <linux/irq.h> 24#include <linux/irq.h>
24#include <linux/io.h> 25#include <linux/io.h>
25#include <linux/of.h> 26#include <linux/of.h>
26 27
27#include <mach/map.h> 28#include <mach/map.h>
28 29
29#include <plat/regs-serial.h>
30#include <mach/regs-gpio.h> 30#include <mach/regs-gpio.h>
31#include <plat/cpu.h> 31#include <plat/cpu.h>
32#include <plat/pm.h> 32#include <plat/pm.h>
@@ -55,7 +55,13 @@ static struct irq_grp_save {
55 u32 mask; 55 u32 mask;
56} eint_grp_save[5]; 56} eint_grp_save[5];
57 57
58static u32 irq_uart_mask[CONFIG_SERIAL_SAMSUNG_UARTS]; 58#ifndef CONFIG_SERIAL_SAMSUNG_UARTS
59#define SERIAL_SAMSUNG_UARTS 0
60#else
61#define SERIAL_SAMSUNG_UARTS CONFIG_SERIAL_SAMSUNG_UARTS
62#endif
63
64static u32 irq_uart_mask[SERIAL_SAMSUNG_UARTS];
59 65
60static int s3c64xx_irq_pm_suspend(void) 66static int s3c64xx_irq_pm_suspend(void)
61{ 67{
@@ -66,7 +72,7 @@ static int s3c64xx_irq_pm_suspend(void)
66 72
67 s3c_pm_do_save(irq_save, ARRAY_SIZE(irq_save)); 73 s3c_pm_do_save(irq_save, ARRAY_SIZE(irq_save));
68 74
69 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++) 75 for (i = 0; i < SERIAL_SAMSUNG_UARTS; i++)
70 irq_uart_mask[i] = __raw_readl(S3C_VA_UARTx(i) + S3C64XX_UINTM); 76 irq_uart_mask[i] = __raw_readl(S3C_VA_UARTx(i) + S3C64XX_UINTM);
71 77
72 for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) { 78 for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) {
@@ -87,7 +93,7 @@ static void s3c64xx_irq_pm_resume(void)
87 93
88 s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save)); 94 s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
89 95
90 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++) 96 for (i = 0; i < SERIAL_SAMSUNG_UARTS; i++)
91 __raw_writel(irq_uart_mask[i], S3C_VA_UARTx(i) + S3C64XX_UINTM); 97 __raw_writel(irq_uart_mask[i], S3C_VA_UARTx(i) + S3C64XX_UINTM);
92 98
93 for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) { 99 for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) {
diff --git a/arch/arm/mach-s3c64xx/mach-anw6410.c b/arch/arm/mach-s3c64xx/mach-anw6410.c
index ddeb0e51a962..55eb6a69655b 100644
--- a/arch/arm/mach-s3c64xx/mach-anw6410.c
+++ b/arch/arm/mach-s3c64xx/mach-anw6410.c
@@ -20,6 +20,7 @@
20#include <linux/timer.h> 20#include <linux/timer.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/serial_core.h> 22#include <linux/serial_core.h>
23#include <linux/serial_s3c.h>
23#include <linux/platform_device.h> 24#include <linux/platform_device.h>
24#include <linux/io.h> 25#include <linux/io.h>
25#include <linux/i2c.h> 26#include <linux/i2c.h>
@@ -41,7 +42,6 @@
41#include <asm/irq.h> 42#include <asm/irq.h>
42#include <asm/mach-types.h> 43#include <asm/mach-types.h>
43 44
44#include <plat/regs-serial.h>
45#include <linux/platform_data/i2c-s3c2410.h> 45#include <linux/platform_data/i2c-s3c2410.h>
46#include <plat/fb.h> 46#include <plat/fb.h>
47 47
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410-module.c b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
index 7ccfef227c77..9c00d83f7151 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410-module.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
@@ -401,4 +401,4 @@ static int __init wlf_gf_module_register(void)
401{ 401{
402 return i2c_add_driver(&wlf_gf_module_driver); 402 return i2c_add_driver(&wlf_gf_module_driver);
403} 403}
404module_init(wlf_gf_module_register); 404device_initcall(wlf_gf_module_register);
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
index 3df3c372ee1f..4b0199fff9f5 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
@@ -14,6 +14,7 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/list.h> 15#include <linux/list.h>
16#include <linux/serial_core.h> 16#include <linux/serial_core.h>
17#include <linux/serial_s3c.h>
17#include <linux/platform_device.h> 18#include <linux/platform_device.h>
18#include <linux/fb.h> 19#include <linux/fb.h>
19#include <linux/io.h> 20#include <linux/io.h>
@@ -51,7 +52,6 @@
51#include <mach/regs-gpio.h> 52#include <mach/regs-gpio.h>
52#include <mach/gpio-samsung.h> 53#include <mach/gpio-samsung.h>
53 54
54#include <plat/regs-serial.h>
55#include <plat/fb.h> 55#include <plat/fb.h>
56#include <plat/sdhci.h> 56#include <plat/sdhci.h>
57#include <plat/gpio-cfg.h> 57#include <plat/gpio-cfg.h>
diff --git a/arch/arm/mach-s3c64xx/mach-hmt.c b/arch/arm/mach-s3c64xx/mach-hmt.c
index 0431016925b9..72cee08c8bf5 100644
--- a/arch/arm/mach-s3c64xx/mach-hmt.c
+++ b/arch/arm/mach-s3c64xx/mach-hmt.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/serial_core.h> 13#include <linux/serial_core.h>
14#include <linux/serial_s3c.h>
14#include <linux/platform_device.h> 15#include <linux/platform_device.h>
15#include <linux/io.h> 16#include <linux/io.h>
16#include <linux/i2c.h> 17#include <linux/i2c.h>
@@ -33,7 +34,6 @@
33#include <asm/irq.h> 34#include <asm/irq.h>
34#include <asm/mach-types.h> 35#include <asm/mach-types.h>
35 36
36#include <plat/regs-serial.h>
37#include <linux/platform_data/i2c-s3c2410.h> 37#include <linux/platform_data/i2c-s3c2410.h>
38#include <mach/gpio-samsung.h> 38#include <mach/gpio-samsung.h>
39#include <plat/fb.h> 39#include <plat/fb.h>
diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
index 8d553a418e1c..9cbc07602ef3 100644
--- a/arch/arm/mach-s3c64xx/mach-mini6410.c
+++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
@@ -22,6 +22,7 @@
22#include <linux/mtd/mtd.h> 22#include <linux/mtd/mtd.h>
23#include <linux/mtd/partitions.h> 23#include <linux/mtd/partitions.h>
24#include <linux/serial_core.h> 24#include <linux/serial_core.h>
25#include <linux/serial_s3c.h>
25#include <linux/types.h> 26#include <linux/types.h>
26 27
27#include <asm/mach-types.h> 28#include <asm/mach-types.h>
@@ -38,7 +39,6 @@
38#include <plat/fb.h> 39#include <plat/fb.h>
39#include <linux/platform_data/mtd-nand-s3c2410.h> 40#include <linux/platform_data/mtd-nand-s3c2410.h>
40#include <linux/platform_data/mmc-sdhci-s3c.h> 41#include <linux/platform_data/mmc-sdhci-s3c.h>
41#include <plat/regs-serial.h>
42#include <plat/sdhci.h> 42#include <plat/sdhci.h>
43#include <linux/platform_data/touchscreen-s3c2410.h> 43#include <linux/platform_data/touchscreen-s3c2410.h>
44 44
diff --git a/arch/arm/mach-s3c64xx/mach-ncp.c b/arch/arm/mach-s3c64xx/mach-ncp.c
index 2067b0bf55b4..67f06a9ae656 100644
--- a/arch/arm/mach-s3c64xx/mach-ncp.c
+++ b/arch/arm/mach-s3c64xx/mach-ncp.c
@@ -16,6 +16,7 @@
16#include <linux/timer.h> 16#include <linux/timer.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19#include <linux/serial_s3c.h>
19#include <linux/platform_device.h> 20#include <linux/platform_device.h>
20#include <linux/io.h> 21#include <linux/io.h>
21#include <linux/i2c.h> 22#include <linux/i2c.h>
@@ -36,7 +37,6 @@
36#include <asm/irq.h> 37#include <asm/irq.h>
37#include <asm/mach-types.h> 38#include <asm/mach-types.h>
38 39
39#include <plat/regs-serial.h>
40#include <linux/platform_data/i2c-s3c2410.h> 40#include <linux/platform_data/i2c-s3c2410.h>
41#include <plat/fb.h> 41#include <plat/fb.h>
42 42
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
index 5152026f0e19..fbad2af1ef16 100644
--- a/arch/arm/mach-s3c64xx/mach-real6410.c
+++ b/arch/arm/mach-s3c64xx/mach-real6410.c
@@ -23,6 +23,7 @@
23#include <linux/mtd/partitions.h> 23#include <linux/mtd/partitions.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/serial_core.h> 25#include <linux/serial_core.h>
26#include <linux/serial_s3c.h>
26#include <linux/types.h> 27#include <linux/types.h>
27 28
28#include <asm/mach-types.h> 29#include <asm/mach-types.h>
@@ -38,7 +39,6 @@
38#include <plat/devs.h> 39#include <plat/devs.h>
39#include <plat/fb.h> 40#include <plat/fb.h>
40#include <linux/platform_data/mtd-nand-s3c2410.h> 41#include <linux/platform_data/mtd-nand-s3c2410.h>
41#include <plat/regs-serial.h>
42#include <linux/platform_data/touchscreen-s3c2410.h> 42#include <linux/platform_data/touchscreen-s3c2410.h>
43 43
44#include <video/platform_lcd.h> 44#include <video/platform_lcd.h>
diff --git a/arch/arm/mach-s3c64xx/mach-smartq.c b/arch/arm/mach-s3c64xx/mach-smartq.c
index 6e72bd5c1d0c..78dd6f73c072 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq.c
@@ -16,6 +16,7 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/pwm_backlight.h> 17#include <linux/pwm_backlight.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19#include <linux/serial_s3c.h>
19#include <linux/spi/spi_gpio.h> 20#include <linux/spi/spi_gpio.h>
20#include <linux/usb/gpio_vbus.h> 21#include <linux/usb/gpio_vbus.h>
21#include <linux/platform_data/s3c-hsotg.h> 22#include <linux/platform_data/s3c-hsotg.h>
@@ -33,7 +34,6 @@
33#include <linux/platform_data/i2c-s3c2410.h> 34#include <linux/platform_data/i2c-s3c2410.h>
34#include <plat/gpio-cfg.h> 35#include <plat/gpio-cfg.h>
35#include <linux/platform_data/hwmon-s3c.h> 36#include <linux/platform_data/hwmon-s3c.h>
36#include <plat/regs-serial.h>
37#include <linux/platform_data/usb-ohci-s3c2410.h> 37#include <linux/platform_data/usb-ohci-s3c2410.h>
38#include <plat/sdhci.h> 38#include <plat/sdhci.h>
39#include <linux/platform_data/touchscreen-s3c2410.h> 39#include <linux/platform_data/touchscreen-s3c2410.h>
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6400.c b/arch/arm/mach-s3c64xx/mach-smdk6400.c
index 150f55fb9e33..c85d1cbe769f 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6400.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6400.c
@@ -16,6 +16,7 @@
16#include <linux/timer.h> 16#include <linux/timer.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19#include <linux/serial_s3c.h>
19#include <linux/platform_device.h> 20#include <linux/platform_device.h>
20#include <linux/i2c.h> 21#include <linux/i2c.h>
21#include <linux/io.h> 22#include <linux/io.h>
@@ -29,8 +30,6 @@
29#include <mach/hardware.h> 30#include <mach/hardware.h>
30#include <mach/map.h> 31#include <mach/map.h>
31 32
32#include <plat/regs-serial.h>
33
34#include <plat/clock.h> 33#include <plat/clock.h>
35#include <plat/devs.h> 34#include <plat/devs.h>
36#include <plat/cpu.h> 35#include <plat/cpu.h>
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index 43261d24a0a5..c6a8b2ab0240 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -19,6 +19,7 @@
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/input.h> 20#include <linux/input.h>
21#include <linux/serial_core.h> 21#include <linux/serial_core.h>
22#include <linux/serial_s3c.h>
22#include <linux/platform_device.h> 23#include <linux/platform_device.h>
23#include <linux/io.h> 24#include <linux/io.h>
24#include <linux/i2c.h> 25#include <linux/i2c.h>
@@ -55,7 +56,6 @@
55#include <asm/irq.h> 56#include <asm/irq.h>
56#include <asm/mach-types.h> 57#include <asm/mach-types.h>
57 58
58#include <plat/regs-serial.h>
59#include <mach/regs-gpio.h> 59#include <mach/regs-gpio.h>
60#include <mach/gpio-samsung.h> 60#include <mach/gpio-samsung.h>
61#include <linux/platform_data/ata-samsung_cf.h> 61#include <linux/platform_data/ata-samsung_cf.h>
diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
index b5a66986a529..6b37694fa335 100644
--- a/arch/arm/mach-s3c64xx/pm.c
+++ b/arch/arm/mach-s3c64xx/pm.c
@@ -332,7 +332,6 @@ static __init int s3c64xx_pm_initcall(void)
332{ 332{
333 pm_cpu_prep = s3c64xx_pm_prepare; 333 pm_cpu_prep = s3c64xx_pm_prepare;
334 pm_cpu_sleep = s3c64xx_cpu_suspend; 334 pm_cpu_sleep = s3c64xx_cpu_suspend;
335 pm_uart_udivslot = 1;
336 335
337#ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK 336#ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK
338 gpio_request(S3C64XX_GPN(12), "DEBUG_LED0"); 337 gpio_request(S3C64XX_GPN(12), "DEBUG_LED0");
diff --git a/arch/arm/mach-s3c64xx/s3c6400.c b/arch/arm/mach-s3c64xx/s3c6400.c
index 3db0c98222f7..8c42807bf579 100644
--- a/arch/arm/mach-s3c64xx/s3c6400.c
+++ b/arch/arm/mach-s3c64xx/s3c6400.c
@@ -23,6 +23,7 @@
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/device.h> 24#include <linux/device.h>
25#include <linux/serial_core.h> 25#include <linux/serial_core.h>
26#include <linux/serial_s3c.h>
26#include <linux/platform_device.h> 27#include <linux/platform_device.h>
27#include <linux/of.h> 28#include <linux/of.h>
28 29
@@ -34,7 +35,6 @@
34#include <asm/irq.h> 35#include <asm/irq.h>
35 36
36#include <plat/cpu-freq.h> 37#include <plat/cpu-freq.h>
37#include <plat/regs-serial.h>
38#include <mach/regs-clock.h> 38#include <mach/regs-clock.h>
39 39
40#include <plat/cpu.h> 40#include <plat/cpu.h>
diff --git a/arch/arm/mach-s3c64xx/s3c6410.c b/arch/arm/mach-s3c64xx/s3c6410.c
index 72b2278953a8..5be3f09bac92 100644
--- a/arch/arm/mach-s3c64xx/s3c6410.c
+++ b/arch/arm/mach-s3c64xx/s3c6410.c
@@ -24,6 +24,7 @@
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/device.h> 25#include <linux/device.h>
26#include <linux/serial_core.h> 26#include <linux/serial_core.h>
27#include <linux/serial_s3c.h>
27#include <linux/platform_device.h> 28#include <linux/platform_device.h>
28#include <linux/of.h> 29#include <linux/of.h>
29 30
@@ -35,7 +36,6 @@
35#include <asm/irq.h> 36#include <asm/irq.h>
36 37
37#include <plat/cpu-freq.h> 38#include <plat/cpu-freq.h>
38#include <plat/regs-serial.h>
39#include <mach/regs-clock.h> 39#include <mach/regs-clock.h>
40 40
41#include <plat/cpu.h> 41#include <plat/cpu.h>
diff --git a/arch/arm/mach-s5p64x0/common.c b/arch/arm/mach-s5p64x0/common.c
index 42e14f2e7ca7..9a43be002d78 100644
--- a/arch/arm/mach-s5p64x0/common.c
+++ b/arch/arm/mach-s5p64x0/common.c
@@ -19,6 +19,7 @@
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/device.h> 20#include <linux/device.h>
21#include <linux/serial_core.h> 21#include <linux/serial_core.h>
22#include <linux/serial_s3c.h>
22#include <clocksource/samsung_pwm.h> 23#include <clocksource/samsung_pwm.h>
23#include <linux/platform_device.h> 24#include <linux/platform_device.h>
24#include <linux/sched.h> 25#include <linux/sched.h>
@@ -50,7 +51,6 @@
50#include <plat/gpio-cfg.h> 51#include <plat/gpio-cfg.h>
51#include <plat/pwm-core.h> 52#include <plat/pwm-core.h>
52#include <plat/regs-irqtype.h> 53#include <plat/regs-irqtype.h>
53#include <plat/regs-serial.h>
54#include <plat/watchdog-reset.h> 54#include <plat/watchdog-reset.h>
55 55
56#include "common.h" 56#include "common.h"
@@ -205,6 +205,7 @@ void __init s5p64x0_init_io(struct map_desc *mach_desc, int size)
205 samsung_pwm_set_platdata(&s5p64x0_pwm_variant); 205 samsung_pwm_set_platdata(&s5p64x0_pwm_variant);
206} 206}
207 207
208#ifdef CONFIG_CPU_S5P6440
208void __init s5p6440_map_io(void) 209void __init s5p6440_map_io(void)
209{ 210{
210 /* initialize any device information early */ 211 /* initialize any device information early */
@@ -218,7 +219,9 @@ void __init s5p6440_map_io(void)
218 219
219 iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc)); 220 iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc));
220} 221}
222#endif
221 223
224#ifdef CONFIG_CPU_S5P6450
222void __init s5p6450_map_io(void) 225void __init s5p6450_map_io(void)
223{ 226{
224 /* initialize any device information early */ 227 /* initialize any device information early */
@@ -232,13 +235,14 @@ void __init s5p6450_map_io(void)
232 235
233 iotable_init(s5p6450_iodesc, ARRAY_SIZE(s5p6450_iodesc)); 236 iotable_init(s5p6450_iodesc, ARRAY_SIZE(s5p6450_iodesc));
234} 237}
238#endif
235 239
236/* 240/*
237 * s5p64x0_init_clocks 241 * s5p64x0_init_clocks
238 * 242 *
239 * register and setup the CPU clocks 243 * register and setup the CPU clocks
240 */ 244 */
241 245#ifdef CONFIG_CPU_S5P6440
242void __init s5p6440_init_clocks(int xtal) 246void __init s5p6440_init_clocks(int xtal)
243{ 247{
244 printk(KERN_DEBUG "%s: initializing clocks\n", __func__); 248 printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
@@ -248,7 +252,9 @@ void __init s5p6440_init_clocks(int xtal)
248 s5p6440_register_clocks(); 252 s5p6440_register_clocks();
249 s5p6440_setup_clocks(); 253 s5p6440_setup_clocks();
250} 254}
255#endif
251 256
257#ifdef CONFIG_CPU_S5P6450
252void __init s5p6450_init_clocks(int xtal) 258void __init s5p6450_init_clocks(int xtal)
253{ 259{
254 printk(KERN_DEBUG "%s: initializing clocks\n", __func__); 260 printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
@@ -258,13 +264,14 @@ void __init s5p6450_init_clocks(int xtal)
258 s5p6450_register_clocks(); 264 s5p6450_register_clocks();
259 s5p6450_setup_clocks(); 265 s5p6450_setup_clocks();
260} 266}
267#endif
261 268
262/* 269/*
263 * s5p64x0_init_irq 270 * s5p64x0_init_irq
264 * 271 *
265 * register the CPU interrupts 272 * register the CPU interrupts
266 */ 273 */
267 274#ifdef CONFIG_CPU_S5P6440
268void __init s5p6440_init_irq(void) 275void __init s5p6440_init_irq(void)
269{ 276{
270 /* S5P6440 supports 2 VIC */ 277 /* S5P6440 supports 2 VIC */
@@ -279,7 +286,9 @@ void __init s5p6440_init_irq(void)
279 286
280 s5p_init_irq(vic, ARRAY_SIZE(vic)); 287 s5p_init_irq(vic, ARRAY_SIZE(vic));
281} 288}
289#endif
282 290
291#ifdef CONFIG_CPU_S5P6450
283void __init s5p6450_init_irq(void) 292void __init s5p6450_init_irq(void)
284{ 293{
285 /* S5P6450 supports only 2 VIC */ 294 /* S5P6450 supports only 2 VIC */
@@ -294,6 +303,7 @@ void __init s5p6450_init_irq(void)
294 303
295 s5p_init_irq(vic, ARRAY_SIZE(vic)); 304 s5p_init_irq(vic, ARRAY_SIZE(vic));
296} 305}
306#endif
297 307
298struct bus_type s5p64x0_subsys = { 308struct bus_type s5p64x0_subsys = {
299 .name = "s5p64x0-core", 309 .name = "s5p64x0-core",
@@ -321,6 +331,7 @@ int __init s5p64x0_init(void)
321} 331}
322 332
323/* uart registration process */ 333/* uart registration process */
334#ifdef CONFIG_CPU_S5P6440
324void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no) 335void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no)
325{ 336{
326 int uart; 337 int uart;
@@ -332,11 +343,14 @@ void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no)
332 343
333 s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no); 344 s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no);
334} 345}
346#endif
335 347
348#ifdef CONFIG_CPU_S5P6450
336void __init s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no) 349void __init s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no)
337{ 350{
338 s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no); 351 s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no);
339} 352}
353#endif
340 354
341#define eint_offset(irq) ((irq) - IRQ_EINT(0)) 355#define eint_offset(irq) ((irq) - IRQ_EINT(0))
342 356
diff --git a/arch/arm/mach-s5p64x0/common.h b/arch/arm/mach-s5p64x0/common.h
index f3a9b43cba4a..cbe7f3d731d0 100644
--- a/arch/arm/mach-s5p64x0/common.h
+++ b/arch/arm/mach-s5p64x0/common.h
@@ -25,10 +25,10 @@ void s5p6450_register_clocks(void);
25void s5p6450_setup_clocks(void); 25void s5p6450_setup_clocks(void);
26 26
27void s5p64x0_restart(enum reboot_mode mode, const char *cmd); 27void s5p64x0_restart(enum reboot_mode mode, const char *cmd);
28extern int s5p64x0_init(void);
28 29
29#ifdef CONFIG_CPU_S5P6440 30#ifdef CONFIG_CPU_S5P6440
30 31
31extern int s5p64x0_init(void);
32extern void s5p6440_map_io(void); 32extern void s5p6440_map_io(void);
33extern void s5p6440_init_clocks(int xtal); 33extern void s5p6440_init_clocks(int xtal);
34 34
@@ -38,12 +38,10 @@ extern void s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no);
38#define s5p6440_init_clocks NULL 38#define s5p6440_init_clocks NULL
39#define s5p6440_init_uarts NULL 39#define s5p6440_init_uarts NULL
40#define s5p6440_map_io NULL 40#define s5p6440_map_io NULL
41#define s5p64x0_init NULL
42#endif 41#endif
43 42
44#ifdef CONFIG_CPU_S5P6450 43#ifdef CONFIG_CPU_S5P6450
45 44
46extern int s5p64x0_init(void);
47extern void s5p6450_map_io(void); 45extern void s5p6450_map_io(void);
48extern void s5p6450_init_clocks(int xtal); 46extern void s5p6450_init_clocks(int xtal);
49 47
@@ -53,7 +51,6 @@ extern void s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no);
53#define s5p6450_init_clocks NULL 51#define s5p6450_init_clocks NULL
54#define s5p6450_init_uarts NULL 52#define s5p6450_init_uarts NULL
55#define s5p6450_map_io NULL 53#define s5p6450_map_io NULL
56#define s5p64x0_init NULL
57#endif 54#endif
58 55
59#endif /* __ARCH_ARM_MACH_S5P64X0_COMMON_H */ 56#endif /* __ARCH_ARM_MACH_S5P64X0_COMMON_H */
diff --git a/arch/arm/mach-s5p64x0/include/mach/debug-macro.S b/arch/arm/mach-s5p64x0/include/mach/debug-macro.S
index 5e2916fb19a9..8759e7882bcb 100644
--- a/arch/arm/mach-s5p64x0/include/mach/debug-macro.S
+++ b/arch/arm/mach-s5p64x0/include/mach/debug-macro.S
@@ -10,11 +10,10 @@
10 10
11/* pull in the relevant register and map files. */ 11/* pull in the relevant register and map files. */
12 12
13#include <linux/serial_s3c.h>
13#include <plat/map-base.h> 14#include <plat/map-base.h>
14#include <plat/map-s5p.h> 15#include <plat/map-s5p.h>
15 16
16#include <plat/regs-serial.h>
17
18 .macro addruart, rp, rv, tmp 17 .macro addruart, rp, rv, tmp
19 mov \rp, #0xE0000000 18 mov \rp, #0xE0000000
20 orr \rp, \rp, #0x00100000 19 orr \rp, \rp, #0x00100000
diff --git a/arch/arm/mach-s5p64x0/include/mach/pm-core.h b/arch/arm/mach-s5p64x0/include/mach/pm-core.h
index e52f7545d3aa..1e0eb65b2b82 100644
--- a/arch/arm/mach-s5p64x0/include/mach/pm-core.h
+++ b/arch/arm/mach-s5p64x0/include/mach/pm-core.h
@@ -12,6 +12,8 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14 14
15#include <linux/serial_s3c.h>
16
15#include <mach/regs-gpio.h> 17#include <mach/regs-gpio.h>
16 18
17static inline void s3c_pm_debug_init_uart(void) 19static inline void s3c_pm_debug_init_uart(void)
diff --git a/arch/arm/mach-s5p64x0/include/mach/timex.h b/arch/arm/mach-s5p64x0/include/mach/timex.h
deleted file mode 100644
index 4b91faa195a8..000000000000
--- a/arch/arm/mach-s5p64x0/include/mach/timex.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/* linux/arch/arm/mach-s5p64x0/include/mach/timex.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * Copyright (c) 2003-2005 Simtec Electronics
7 * Ben Dooks <ben@simtec.co.uk>
8 *
9 * S5P64X0 - time parameters
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#ifndef __ASM_ARCH_TIMEX_H
17#define __ASM_ARCH_TIMEX_H
18
19/* CLOCK_TICK_RATE needs to be evaluatable by the cpp, so making it
20 * a variable is useless. It seems as long as we make our timers an
21 * exact multiple of HZ, any value that makes a 1->1 correspondence
22 * for the time conversion functions to/from jiffies is acceptable.
23*/
24
25#define CLOCK_TICK_RATE 12000000
26
27#endif /* __ASM_ARCH_TIMEX_H */
diff --git a/arch/arm/mach-s5p64x0/include/mach/uncompress.h b/arch/arm/mach-s5p64x0/include/mach/uncompress.h
deleted file mode 100644
index bbcc3f669ee3..000000000000
--- a/arch/arm/mach-s5p64x0/include/mach/uncompress.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/* linux/arch/arm/mach-s5p64x0/include/mach/uncompress.h
2 *
3 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * S5P64X0 - 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 unsigned int chipid;
22
23 chipid = *(const volatile unsigned int __force *) 0xE0100118;
24
25 if ((chipid & 0xff000) == 0x50000)
26 uart_base = (volatile u8 *)S5P6450_PA_UART(CONFIG_S3C_LOWLEVEL_UART_PORT);
27 else
28 uart_base = (volatile u8 *)S5P6440_PA_UART(CONFIG_S3C_LOWLEVEL_UART_PORT);
29
30 fifo_mask = S3C2440_UFSTAT_TXMASK;
31 fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT;
32}
33
34#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-s5p64x0/irq-pm.c b/arch/arm/mach-s5p64x0/irq-pm.c
index 3e6f2456ee9d..2ed921e095dc 100644
--- a/arch/arm/mach-s5p64x0/irq-pm.c
+++ b/arch/arm/mach-s5p64x0/irq-pm.c
@@ -14,9 +14,9 @@
14 14
15#include <linux/syscore_ops.h> 15#include <linux/syscore_ops.h>
16#include <linux/serial_core.h> 16#include <linux/serial_core.h>
17#include <linux/serial_s3c.h>
17#include <linux/io.h> 18#include <linux/io.h>
18 19
19#include <plat/regs-serial.h>
20#include <plat/pm.h> 20#include <plat/pm.h>
21 21
22#include <mach/regs-gpio.h> 22#include <mach/regs-gpio.h>
@@ -34,7 +34,9 @@ static struct irq_grp_save {
34 u32 mask; 34 u32 mask;
35} eint_grp_save[4]; 35} eint_grp_save[4];
36 36
37#ifdef CONFIG_SERIAL_SAMSUNG
37static u32 irq_uart_mask[CONFIG_SERIAL_SAMSUNG_UARTS]; 38static u32 irq_uart_mask[CONFIG_SERIAL_SAMSUNG_UARTS];
39#endif
38 40
39static int s5p64x0_irq_pm_suspend(void) 41static int s5p64x0_irq_pm_suspend(void)
40{ 42{
@@ -45,8 +47,10 @@ static int s5p64x0_irq_pm_suspend(void)
45 47
46 s3c_pm_do_save(irq_save, ARRAY_SIZE(irq_save)); 48 s3c_pm_do_save(irq_save, ARRAY_SIZE(irq_save));
47 49
50#ifdef CONFIG_SERIAL_SAMSUNG
48 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++) 51 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++)
49 irq_uart_mask[i] = __raw_readl(S3C_VA_UARTx(i) + S3C64XX_UINTM); 52 irq_uart_mask[i] = __raw_readl(S3C_VA_UARTx(i) + S3C64XX_UINTM);
53#endif
50 54
51 for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) { 55 for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) {
52 grp->con = __raw_readl(S5P64X0_EINT12CON + (i * 4)); 56 grp->con = __raw_readl(S5P64X0_EINT12CON + (i * 4));
@@ -66,8 +70,10 @@ static void s5p64x0_irq_pm_resume(void)
66 70
67 s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save)); 71 s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
68 72
73#ifdef CONFIG_SERIAL_SAMSUNG
69 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++) 74 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++)
70 __raw_writel(irq_uart_mask[i], S3C_VA_UARTx(i) + S3C64XX_UINTM); 75 __raw_writel(irq_uart_mask[i], S3C_VA_UARTx(i) + S3C64XX_UINTM);
76#endif
71 77
72 for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) { 78 for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) {
73 __raw_writel(grp->con, S5P64X0_EINT12CON + (i * 4)); 79 __raw_writel(grp->con, S5P64X0_EINT12CON + (i * 4));
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6440.c b/arch/arm/mach-s5p64x0/mach-smdk6440.c
index 9efdcc03df3b..6840e197cb2d 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6440.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6440.c
@@ -17,6 +17,7 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/i2c.h> 18#include <linux/i2c.h>
19#include <linux/serial_core.h> 19#include <linux/serial_core.h>
20#include <linux/serial_s3c.h>
20#include <linux/platform_device.h> 21#include <linux/platform_device.h>
21#include <linux/io.h> 22#include <linux/io.h>
22#include <linux/module.h> 23#include <linux/module.h>
@@ -39,7 +40,6 @@
39#include <mach/regs-clock.h> 40#include <mach/regs-clock.h>
40#include <mach/regs-gpio.h> 41#include <mach/regs-gpio.h>
41 42
42#include <plat/regs-serial.h>
43#include <plat/gpio-cfg.h> 43#include <plat/gpio-cfg.h>
44#include <plat/clock.h> 44#include <plat/clock.h>
45#include <plat/devs.h> 45#include <plat/devs.h>
diff --git a/arch/arm/mach-s5p64x0/mach-smdk6450.c b/arch/arm/mach-s5p64x0/mach-smdk6450.c
index c3cacc067efe..fa1341c074ca 100644
--- a/arch/arm/mach-s5p64x0/mach-smdk6450.c
+++ b/arch/arm/mach-s5p64x0/mach-smdk6450.c
@@ -17,6 +17,7 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/i2c.h> 18#include <linux/i2c.h>
19#include <linux/serial_core.h> 19#include <linux/serial_core.h>
20#include <linux/serial_s3c.h>
20#include <linux/platform_device.h> 21#include <linux/platform_device.h>
21#include <linux/io.h> 22#include <linux/io.h>
22#include <linux/module.h> 23#include <linux/module.h>
@@ -39,7 +40,6 @@
39#include <mach/regs-clock.h> 40#include <mach/regs-clock.h>
40#include <mach/regs-gpio.h> 41#include <mach/regs-gpio.h>
41 42
42#include <plat/regs-serial.h>
43#include <plat/gpio-cfg.h> 43#include <plat/gpio-cfg.h>
44#include <plat/clock.h> 44#include <plat/clock.h>
45#include <plat/devs.h> 45#include <plat/devs.h>
diff --git a/arch/arm/mach-s5p64x0/pm.c b/arch/arm/mach-s5p64x0/pm.c
index 861e15cea691..ec8229cee716 100644
--- a/arch/arm/mach-s5p64x0/pm.c
+++ b/arch/arm/mach-s5p64x0/pm.c
@@ -161,7 +161,6 @@ static int s5p64x0_pm_add(struct device *dev, struct subsys_interface *sif)
161{ 161{
162 pm_cpu_prep = s5p64x0_pm_prepare; 162 pm_cpu_prep = s5p64x0_pm_prepare;
163 pm_cpu_sleep = s5p64x0_cpu_suspend; 163 pm_cpu_sleep = s5p64x0_cpu_suspend;
164 pm_uart_udivslot = 1;
165 164
166 return 0; 165 return 0;
167} 166}
diff --git a/arch/arm/mach-s5pc100/common.c b/arch/arm/mach-s5pc100/common.c
index c5a8eeacf81c..6a41bf7dacf6 100644
--- a/arch/arm/mach-s5pc100/common.c
+++ b/arch/arm/mach-s5pc100/common.c
@@ -22,6 +22,7 @@
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/device.h> 23#include <linux/device.h>
24#include <linux/serial_core.h> 24#include <linux/serial_core.h>
25#include <linux/serial_s3c.h>
25#include <clocksource/samsung_pwm.h> 26#include <clocksource/samsung_pwm.h>
26#include <linux/platform_device.h> 27#include <linux/platform_device.h>
27#include <linux/sched.h> 28#include <linux/sched.h>
@@ -49,7 +50,6 @@
49#include <plat/onenand-core.h> 50#include <plat/onenand-core.h>
50#include <plat/pwm-core.h> 51#include <plat/pwm-core.h>
51#include <plat/spi-core.h> 52#include <plat/spi-core.h>
52#include <plat/regs-serial.h>
53#include <plat/watchdog-reset.h> 53#include <plat/watchdog-reset.h>
54 54
55#include "common.h" 55#include "common.h"
diff --git a/arch/arm/mach-s5pc100/include/mach/debug-macro.S b/arch/arm/mach-s5pc100/include/mach/debug-macro.S
index 66cb7f16bf2a..22c23859e45e 100644
--- a/arch/arm/mach-s5pc100/include/mach/debug-macro.S
+++ b/arch/arm/mach-s5pc100/include/mach/debug-macro.S
@@ -13,8 +13,8 @@
13 13
14/* pull in the relevant register and map files. */ 14/* pull in the relevant register and map files. */
15 15
16#include <linux/serial_s3c.h>
16#include <mach/map.h> 17#include <mach/map.h>
17#include <plat/regs-serial.h>
18 18
19 /* note, for the boot process to work we have to keep the UART 19 /* note, for the boot process to work we have to keep the UART
20 * virtual address aligned to an 1MiB boundary for the L1 20 * virtual address aligned to an 1MiB boundary for the L1
diff --git a/arch/arm/mach-s5pc100/include/mach/tick.h b/arch/arm/mach-s5pc100/include/mach/tick.h
deleted file mode 100644
index 0af8e41230ed..000000000000
--- a/arch/arm/mach-s5pc100/include/mach/tick.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/* linux/arch/arm/mach-s5pc100/include/mach/tick.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S3C64XX - Timer tick support definitions
7 *
8 * Based on mach-s3c6400/include/mach/tick.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_TICK_H
16#define __ASM_ARCH_TICK_H __FILE__
17
18#include <linux/irqchip/arm-vic.h>
19
20/* note, the timer interrutps turn up in 2 places, the vic and then
21 * the timer block. We take the VIC as the base at the moment.
22 */
23static inline u32 s3c24xx_ostimer_pending(void)
24{
25 u32 pend = __raw_readl(VA_VIC0 + VIC_RAW_STATUS);
26 return pend & (1 << (IRQ_TIMER4_VIC - S5P_IRQ_VIC0(0)));
27}
28
29#define TICK_MAX (0xffffffff)
30
31#endif /* __ASM_ARCH_TICK_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/timex.h b/arch/arm/mach-s5pc100/include/mach/timex.h
deleted file mode 100644
index 47ffb17aff96..000000000000
--- a/arch/arm/mach-s5pc100/include/mach/timex.h
+++ /dev/null
@@ -1,24 +0,0 @@
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/uncompress.h b/arch/arm/mach-s5pc100/include/mach/uncompress.h
deleted file mode 100644
index 720e1339425c..000000000000
--- a/arch/arm/mach-s5pc100/include/mach/uncompress.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/* arch/arm/mach-s5pc100/include/mach/uncompress.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC100 - uncompress code
7 *
8 * Based on mach-s3c6400/include/mach/uncompress.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_UNCOMPRESS_H
16#define __ASM_ARCH_UNCOMPRESS_H
17
18#include <mach/map.h>
19#include <plat/uncompress.h>
20
21static void arch_detect_cpu(void)
22{
23 /* we do not need to do any cpu detection here at the moment. */
24 fifo_mask = S3C2440_UFSTAT_TXMASK;
25 fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT;
26
27 uart_base = (volatile u8 *)S5P_PA_UART(CONFIG_S3C_LOWLEVEL_UART_PORT);
28}
29
30#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c
index 9e256b9fc930..668af3ac31f3 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -16,6 +16,7 @@
16#include <linux/timer.h> 16#include <linux/timer.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19#include <linux/serial_s3c.h>
19#include <linux/platform_device.h> 20#include <linux/platform_device.h>
20#include <linux/io.h> 21#include <linux/io.h>
21#include <linux/gpio.h> 22#include <linux/gpio.h>
@@ -37,7 +38,6 @@
37#include <asm/irq.h> 38#include <asm/irq.h>
38#include <asm/mach-types.h> 39#include <asm/mach-types.h>
39 40
40#include <plat/regs-serial.h>
41#include <plat/gpio-cfg.h> 41#include <plat/gpio-cfg.h>
42 42
43#include <plat/clock.h> 43#include <plat/clock.h>
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index caaedafbbf5f..8c3abe521757 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -189,6 +189,7 @@ config MACH_TORBRECK
189 select S5PV210_SETUP_I2C1 189 select S5PV210_SETUP_I2C1
190 select S5PV210_SETUP_I2C2 190 select S5PV210_SETUP_I2C2
191 select S5PV210_SETUP_SDHCI 191 select S5PV210_SETUP_SDHCI
192 select SAMSUNG_DEV_IDE
192 help 193 help
193 Machine support for aESOP Torbreck 194 Machine support for aESOP Torbreck
194 195
diff --git a/arch/arm/mach-s5pv210/common.c b/arch/arm/mach-s5pv210/common.c
index 26027a29b8a1..7024dcd0e40a 100644
--- a/arch/arm/mach-s5pv210/common.c
+++ b/arch/arm/mach-s5pv210/common.c
@@ -24,6 +24,7 @@
24#include <linux/sched.h> 24#include <linux/sched.h>
25#include <linux/dma-mapping.h> 25#include <linux/dma-mapping.h>
26#include <linux/serial_core.h> 26#include <linux/serial_core.h>
27#include <linux/serial_s3c.h>
27 28
28#include <asm/proc-fns.h> 29#include <asm/proc-fns.h>
29#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
@@ -46,7 +47,6 @@
46#include <plat/pwm-core.h> 47#include <plat/pwm-core.h>
47#include <plat/tv-core.h> 48#include <plat/tv-core.h>
48#include <plat/spi-core.h> 49#include <plat/spi-core.h>
49#include <plat/regs-serial.h>
50 50
51#include "common.h" 51#include "common.h"
52 52
diff --git a/arch/arm/mach-s5pv210/include/mach/debug-macro.S b/arch/arm/mach-s5pv210/include/mach/debug-macro.S
index 80c21996c943..30b511a580aa 100644
--- a/arch/arm/mach-s5pv210/include/mach/debug-macro.S
+++ b/arch/arm/mach-s5pv210/include/mach/debug-macro.S
@@ -12,8 +12,8 @@
12 12
13/* pull in the relevant register and map files. */ 13/* pull in the relevant register and map files. */
14 14
15#include <linux/serial_s3c.h>
15#include <mach/map.h> 16#include <mach/map.h>
16#include <plat/regs-serial.h>
17 17
18 /* note, for the boot process to work we have to keep the UART 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 19 * virtual address aligned to an 1MiB boundary for the L1
diff --git a/arch/arm/mach-s5pv210/include/mach/timex.h b/arch/arm/mach-s5pv210/include/mach/timex.h
deleted file mode 100644
index 73dc85496a83..000000000000
--- a/arch/arm/mach-s5pv210/include/mach/timex.h
+++ /dev/null
@@ -1,29 +0,0 @@
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
deleted file mode 100644
index 231cb07de058..000000000000
--- a/arch/arm/mach-s5pv210/include/mach/uncompress.h
+++ /dev/null
@@ -1,28 +0,0 @@
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 fifo_mask = S5PV210_UFSTAT_TXMASK;
23 fifo_max = 63 << S5PV210_UFSTAT_TXSHIFT;
24
25 uart_base = (volatile u8 *)S5P_PA_UART(CONFIG_S3C_LOWLEVEL_UART_PORT);
26}
27
28#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c
index ad40ab0f5dbd..cc37edacda26 100644
--- a/arch/arm/mach-s5pv210/mach-aquila.c
+++ b/arch/arm/mach-s5pv210/mach-aquila.c
@@ -12,6 +12,7 @@
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/serial_core.h> 14#include <linux/serial_core.h>
15#include <linux/serial_s3c.h>
15#include <linux/fb.h> 16#include <linux/fb.h>
16#include <linux/i2c.h> 17#include <linux/i2c.h>
17#include <linux/i2c-gpio.h> 18#include <linux/i2c-gpio.h>
@@ -32,7 +33,6 @@
32#include <mach/regs-clock.h> 33#include <mach/regs-clock.h>
33 34
34#include <plat/gpio-cfg.h> 35#include <plat/gpio-cfg.h>
35#include <plat/regs-serial.h>
36#include <plat/devs.h> 36#include <plat/devs.h>
37#include <plat/cpu.h> 37#include <plat/cpu.h>
38#include <plat/fb.h> 38#include <plat/fb.h>
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c
index e5cd9fbf19e9..b41a38a75844 100644
--- a/arch/arm/mach-s5pv210/mach-goni.c
+++ b/arch/arm/mach-s5pv210/mach-goni.c
@@ -12,6 +12,7 @@
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/serial_core.h> 14#include <linux/serial_core.h>
15#include <linux/serial_s3c.h>
15#include <linux/fb.h> 16#include <linux/fb.h>
16#include <linux/i2c.h> 17#include <linux/i2c.h>
17#include <linux/i2c-gpio.h> 18#include <linux/i2c-gpio.h>
@@ -39,7 +40,6 @@
39#include <mach/regs-clock.h> 40#include <mach/regs-clock.h>
40 41
41#include <plat/gpio-cfg.h> 42#include <plat/gpio-cfg.h>
42#include <plat/regs-serial.h>
43#include <plat/devs.h> 43#include <plat/devs.h>
44#include <plat/cpu.h> 44#include <plat/cpu.h>
45#include <plat/fb.h> 45#include <plat/fb.h>
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c b/arch/arm/mach-s5pv210/mach-smdkc110.c
index 7c0ed07a78a3..448e1d2eeed6 100644
--- a/arch/arm/mach-s5pv210/mach-smdkc110.c
+++ b/arch/arm/mach-s5pv210/mach-smdkc110.c
@@ -12,6 +12,7 @@
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/serial_core.h> 14#include <linux/serial_core.h>
15#include <linux/serial_s3c.h>
15#include <linux/i2c.h> 16#include <linux/i2c.h>
16#include <linux/device.h> 17#include <linux/device.h>
17 18
@@ -23,7 +24,6 @@
23#include <mach/map.h> 24#include <mach/map.h>
24#include <mach/regs-clock.h> 25#include <mach/regs-clock.h>
25 26
26#include <plat/regs-serial.h>
27#include <plat/devs.h> 27#include <plat/devs.h>
28#include <plat/cpu.h> 28#include <plat/cpu.h>
29#include <linux/platform_data/ata-samsung_cf.h> 29#include <linux/platform_data/ata-samsung_cf.h>
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
index f52cc15c2d85..2a6655fb63e7 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -13,6 +13,7 @@
13#include <linux/i2c.h> 13#include <linux/i2c.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/serial_core.h> 15#include <linux/serial_core.h>
16#include <linux/serial_s3c.h>
16#include <linux/device.h> 17#include <linux/device.h>
17#include <linux/dm9000.h> 18#include <linux/dm9000.h>
18#include <linux/fb.h> 19#include <linux/fb.h>
@@ -32,7 +33,6 @@
32#include <mach/map.h> 33#include <mach/map.h>
33#include <mach/regs-clock.h> 34#include <mach/regs-clock.h>
34 35
35#include <plat/regs-serial.h>
36#include <plat/regs-srom.h> 36#include <plat/regs-srom.h>
37#include <plat/gpio-cfg.h> 37#include <plat/gpio-cfg.h>
38#include <plat/devs.h> 38#include <plat/devs.h>
diff --git a/arch/arm/mach-s5pv210/mach-torbreck.c b/arch/arm/mach-s5pv210/mach-torbreck.c
index 579afe89842a..157805529f26 100644
--- a/arch/arm/mach-s5pv210/mach-torbreck.c
+++ b/arch/arm/mach-s5pv210/mach-torbreck.c
@@ -13,6 +13,7 @@
13#include <linux/i2c.h> 13#include <linux/i2c.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/serial_core.h> 15#include <linux/serial_core.h>
16#include <linux/serial_s3c.h>
16 17
17#include <asm/mach/arch.h> 18#include <asm/mach/arch.h>
18#include <asm/mach/map.h> 19#include <asm/mach/map.h>
@@ -22,7 +23,6 @@
22#include <mach/map.h> 23#include <mach/map.h>
23#include <mach/regs-clock.h> 24#include <mach/regs-clock.h>
24 25
25#include <plat/regs-serial.h>
26#include <plat/devs.h> 26#include <plat/devs.h>
27#include <plat/cpu.h> 27#include <plat/cpu.h>
28#include <linux/platform_data/i2c-s3c2410.h> 28#include <linux/platform_data/i2c-s3c2410.h>
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index 831a15824ec8..f9874ba60cc8 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -43,6 +43,7 @@
43#include <asm/mach/arch.h> 43#include <asm/mach/arch.h>
44#include <asm/mach/flash.h> 44#include <asm/mach/flash.h>
45#include <asm/mach/map.h> 45#include <asm/mach/map.h>
46#include <asm/mach/irda.h>
46 47
47#include <asm/hardware/scoop.h> 48#include <asm/hardware/scoop.h>
48#include <asm/mach/sharpsl_param.h> 49#include <asm/mach/sharpsl_param.h>
@@ -96,6 +97,37 @@ static struct mcp_plat_data collie_mcp_data = {
96 .codec_pdata = &collie_ucb1x00_data, 97 .codec_pdata = &collie_ucb1x00_data,
97}; 98};
98 99
100static int collie_ir_startup(struct device *dev)
101{
102 int rc = gpio_request(COLLIE_GPIO_IR_ON, "IrDA");
103 if (rc)
104 return rc;
105 rc = gpio_direction_output(COLLIE_GPIO_IR_ON, 1);
106
107 if (!rc)
108 return 0;
109
110 gpio_free(COLLIE_GPIO_IR_ON);
111 return rc;
112}
113
114static void collie_ir_shutdown(struct device *dev)
115{
116 gpio_free(COLLIE_GPIO_IR_ON);
117}
118
119static int collie_ir_set_power(struct device *dev, unsigned int state)
120{
121 gpio_set_value(COLLIE_GPIO_IR_ON, !state);
122 return 0;
123}
124
125static struct irda_platform_data collie_ir_data = {
126 .startup = collie_ir_startup,
127 .shutdown = collie_ir_shutdown,
128 .set_power = collie_ir_set_power,
129};
130
99/* 131/*
100 * Collie AC IN 132 * Collie AC IN
101 */ 133 */
@@ -400,6 +432,7 @@ static void __init collie_init(void)
400 sa11x0_register_mtd(&collie_flash_data, collie_flash_resources, 432 sa11x0_register_mtd(&collie_flash_data, collie_flash_resources,
401 ARRAY_SIZE(collie_flash_resources)); 433 ARRAY_SIZE(collie_flash_resources));
402 sa11x0_register_mcp(&collie_mcp_data); 434 sa11x0_register_mcp(&collie_mcp_data);
435 sa11x0_register_irda(&collie_ir_data);
403 436
404 sharpsl_save_param(); 437 sharpsl_save_param();
405} 438}
diff --git a/arch/arm/mach-sa1100/h3100.c b/arch/arm/mach-sa1100/h3100.c
index daa27c474c13..3c43219bc881 100644
--- a/arch/arm/mach-sa1100/h3100.c
+++ b/arch/arm/mach-sa1100/h3100.c
@@ -122,15 +122,8 @@ static struct irda_platform_data h3100_irda_data = {
122 .shutdown = h3100_irda_shutdown, 122 .shutdown = h3100_irda_shutdown,
123}; 123};
124 124
125static struct gpio_default_state h3100_default_gpio[] = {
126 { H3XXX_GPIO_COM_DCD, GPIO_MODE_IN, "COM DCD" },
127 { H3XXX_GPIO_COM_CTS, GPIO_MODE_IN, "COM CTS" },
128 { H3XXX_GPIO_COM_RTS, GPIO_MODE_OUT0, "COM RTS" },
129};
130
131static void __init h3100_mach_init(void) 125static void __init h3100_mach_init(void)
132{ 126{
133 h3xxx_init_gpio(h3100_default_gpio, ARRAY_SIZE(h3100_default_gpio));
134 h3xxx_mach_init(); 127 h3xxx_mach_init();
135 128
136 sa11x0_register_lcd(&h3100_lcd_info); 129 sa11x0_register_lcd(&h3100_lcd_info);
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c
index a663e7230141..5be54c214c7c 100644
--- a/arch/arm/mach-sa1100/h3600.c
+++ b/arch/arm/mach-sa1100/h3600.c
@@ -130,15 +130,8 @@ static struct irda_platform_data h3600_irda_data = {
130 .shutdown = h3600_irda_shutdown, 130 .shutdown = h3600_irda_shutdown,
131}; 131};
132 132
133static struct gpio_default_state h3600_default_gpio[] = {
134 { H3XXX_GPIO_COM_DCD, GPIO_MODE_IN, "COM DCD" },
135 { H3XXX_GPIO_COM_CTS, GPIO_MODE_IN, "COM CTS" },
136 { H3XXX_GPIO_COM_RTS, GPIO_MODE_OUT0, "COM RTS" },
137};
138
139static void __init h3600_mach_init(void) 133static void __init h3600_mach_init(void)
140{ 134{
141 h3xxx_init_gpio(h3600_default_gpio, ARRAY_SIZE(h3600_default_gpio));
142 h3xxx_mach_init(); 135 h3xxx_mach_init();
143 136
144 sa11x0_register_lcd(&h3600_lcd_info); 137 sa11x0_register_lcd(&h3600_lcd_info);
diff --git a/arch/arm/mach-sa1100/h3xxx.c b/arch/arm/mach-sa1100/h3xxx.c
index f17e7382242a..c79bf467fb7f 100644
--- a/arch/arm/mach-sa1100/h3xxx.c
+++ b/arch/arm/mach-sa1100/h3xxx.c
@@ -28,37 +28,6 @@
28 28
29#include "generic.h" 29#include "generic.h"
30 30
31void h3xxx_init_gpio(struct gpio_default_state *s, size_t n)
32{
33 while (n--) {
34 const char *name = s->name;
35 int err;
36
37 if (!name)
38 name = "[init]";
39 err = gpio_request(s->gpio, name);
40 if (err) {
41 printk(KERN_ERR "gpio%u: unable to request: %d\n",
42 s->gpio, err);
43 continue;
44 }
45 if (s->mode >= 0) {
46 err = gpio_direction_output(s->gpio, s->mode);
47 } else {
48 err = gpio_direction_input(s->gpio);
49 }
50 if (err) {
51 printk(KERN_ERR "gpio%u: unable to set direction: %d\n",
52 s->gpio, err);
53 continue;
54 }
55 if (!s->name)
56 gpio_free(s->gpio);
57 s++;
58 }
59}
60
61
62/* 31/*
63 * H3xxx flash support 32 * H3xxx flash support
64 */ 33 */
@@ -116,9 +85,34 @@ static struct resource h3xxx_flash_resource =
116/* 85/*
117 * H3xxx uart support 86 * H3xxx uart support
118 */ 87 */
88static struct gpio h3xxx_uart_gpio[] = {
89 { H3XXX_GPIO_COM_DCD, GPIOF_IN, "COM DCD" },
90 { H3XXX_GPIO_COM_CTS, GPIOF_IN, "COM CTS" },
91 { H3XXX_GPIO_COM_RTS, GPIOF_OUT_INIT_LOW, "COM RTS" },
92};
93
94static bool h3xxx_uart_request_gpios(void)
95{
96 static bool h3xxx_uart_gpio_ok;
97 int rc;
98
99 if (h3xxx_uart_gpio_ok)
100 return true;
101
102 rc = gpio_request_array(h3xxx_uart_gpio, ARRAY_SIZE(h3xxx_uart_gpio));
103 if (rc)
104 pr_err("h3xxx_uart_request_gpios: error %d\n", rc);
105 else
106 h3xxx_uart_gpio_ok = true;
107
108 return h3xxx_uart_gpio_ok;
109}
110
119static void h3xxx_uart_set_mctrl(struct uart_port *port, u_int mctrl) 111static void h3xxx_uart_set_mctrl(struct uart_port *port, u_int mctrl)
120{ 112{
121 if (port->mapbase == _Ser3UTCR0) { 113 if (port->mapbase == _Ser3UTCR0) {
114 if (!h3xxx_uart_request_gpios())
115 return;
122 gpio_set_value(H3XXX_GPIO_COM_RTS, !(mctrl & TIOCM_RTS)); 116 gpio_set_value(H3XXX_GPIO_COM_RTS, !(mctrl & TIOCM_RTS));
123 } 117 }
124} 118}
@@ -128,6 +122,8 @@ static u_int h3xxx_uart_get_mctrl(struct uart_port *port)
128 u_int ret = TIOCM_CD | TIOCM_CTS | TIOCM_DSR; 122 u_int ret = TIOCM_CD | TIOCM_CTS | TIOCM_DSR;
129 123
130 if (port->mapbase == _Ser3UTCR0) { 124 if (port->mapbase == _Ser3UTCR0) {
125 if (!h3xxx_uart_request_gpios())
126 return ret;
131 /* 127 /*
132 * DCD and CTS bits are inverted in GPLR by RS232 transceiver 128 * DCD and CTS bits are inverted in GPLR by RS232 transceiver
133 */ 129 */
diff --git a/arch/arm/mach-sa1100/include/mach/collie.h b/arch/arm/mach-sa1100/include/mach/collie.h
index 50e1d850ee2e..b478ca180c19 100644
--- a/arch/arm/mach-sa1100/include/mach/collie.h
+++ b/arch/arm/mach-sa1100/include/mach/collie.h
@@ -80,7 +80,7 @@ extern void locomolcd_power(int on);
80#define COLLIE_TC35143_GPIO_VERSION0 UCB_IO_0 80#define COLLIE_TC35143_GPIO_VERSION0 UCB_IO_0
81#define COLLIE_TC35143_GPIO_TBL_CHK UCB_IO_1 81#define COLLIE_TC35143_GPIO_TBL_CHK UCB_IO_1
82#define COLLIE_TC35143_GPIO_VPEN_ON UCB_IO_2 82#define COLLIE_TC35143_GPIO_VPEN_ON UCB_IO_2
83#define COLLIE_TC35143_GPIO_IR_ON UCB_IO_3 83#define COLLIE_GPIO_IR_ON (COLLIE_TC35143_GPIO_BASE + 3)
84#define COLLIE_TC35143_GPIO_AMP_ON UCB_IO_4 84#define COLLIE_TC35143_GPIO_AMP_ON UCB_IO_4
85#define COLLIE_TC35143_GPIO_VERSION1 UCB_IO_5 85#define COLLIE_TC35143_GPIO_VERSION1 UCB_IO_5
86#define COLLIE_TC35143_GPIO_FS8KLPF UCB_IO_5 86#define COLLIE_TC35143_GPIO_FS8KLPF UCB_IO_5
diff --git a/arch/arm/mach-sa1100/include/mach/h3xxx.h b/arch/arm/mach-sa1100/include/mach/h3xxx.h
index c810620db53d..603d4343f7f6 100644
--- a/arch/arm/mach-sa1100/include/mach/h3xxx.h
+++ b/arch/arm/mach-sa1100/include/mach/h3xxx.h
@@ -79,17 +79,6 @@
79#define H3600_EGPIO_LCD_5V_ON (H3XXX_EGPIO_BASE + 14) /* enable 5V to LCD. active high. */ 79#define H3600_EGPIO_LCD_5V_ON (H3XXX_EGPIO_BASE + 14) /* enable 5V to LCD. active high. */
80#define H3600_EGPIO_LVDD_ON (H3XXX_EGPIO_BASE + 15) /* enable 9V and -6.5V to LCD. */ 80#define H3600_EGPIO_LVDD_ON (H3XXX_EGPIO_BASE + 15) /* enable 9V and -6.5V to LCD. */
81 81
82struct gpio_default_state {
83 int gpio;
84 int mode;
85 const char *name;
86};
87
88#define GPIO_MODE_IN -1
89#define GPIO_MODE_OUT0 0
90#define GPIO_MODE_OUT1 1
91
92void h3xxx_init_gpio(struct gpio_default_state *s, size_t n);
93void __init h3xxx_map_io(void); 82void __init h3xxx_map_io(void);
94void __init h3xxx_mach_init(void); 83void __init h3xxx_mach_init(void);
95 84
diff --git a/arch/arm/mach-sa1100/include/mach/timex.h b/arch/arm/mach-sa1100/include/mach/timex.h
deleted file mode 100644
index 7a5d017b58b3..000000000000
--- a/arch/arm/mach-sa1100/include/mach/timex.h
+++ /dev/null
@@ -1,12 +0,0 @@
1/*
2 * arch/arm/mach-sa1100/include/mach/timex.h
3 *
4 * SA1100 architecture timex specifications
5 *
6 * Copyright (C) 1998
7 */
8
9/*
10 * SA1100 timer
11 */
12#define CLOCK_TICK_RATE 3686400
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
index 6fd4acb8f187..1dea6cfafb31 100644
--- a/arch/arm/mach-sa1100/time.c
+++ b/arch/arm/mach-sa1100/time.c
@@ -9,6 +9,7 @@
9 * 9 *
10 */ 10 */
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/kernel.h>
12#include <linux/errno.h> 13#include <linux/errno.h>
13#include <linux/interrupt.h> 14#include <linux/interrupt.h>
14#include <linux/irq.h> 15#include <linux/irq.h>
@@ -20,6 +21,9 @@
20#include <mach/hardware.h> 21#include <mach/hardware.h>
21#include <mach/irqs.h> 22#include <mach/irqs.h>
22 23
24#define SA1100_CLOCK_FREQ 3686400
25#define SA1100_LATCH DIV_ROUND_CLOSEST(SA1100_CLOCK_FREQ, HZ)
26
23static u64 notrace sa1100_read_sched_clock(void) 27static u64 notrace sa1100_read_sched_clock(void)
24{ 28{
25 return readl_relaxed(OSCR); 29 return readl_relaxed(OSCR);
@@ -93,7 +97,7 @@ static void sa1100_timer_resume(struct clock_event_device *cedev)
93 /* 97 /*
94 * OSMR0 is the system timer: make sure OSCR is sufficiently behind 98 * OSMR0 is the system timer: make sure OSCR is sufficiently behind
95 */ 99 */
96 writel_relaxed(OSMR0 - LATCH, OSCR); 100 writel_relaxed(OSMR0 - SA1100_LATCH, OSCR);
97} 101}
98#else 102#else
99#define sa1100_timer_suspend NULL 103#define sa1100_timer_suspend NULL
@@ -112,7 +116,7 @@ static struct clock_event_device ckevt_sa1100_osmr0 = {
112 116
113static struct irqaction sa1100_timer_irq = { 117static struct irqaction sa1100_timer_irq = {
114 .name = "ost0", 118 .name = "ost0",
115 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 119 .flags = IRQF_TIMER | IRQF_IRQPOLL,
116 .handler = sa1100_ost0_interrupt, 120 .handler = sa1100_ost0_interrupt,
117 .dev_id = &ckevt_sa1100_osmr0, 121 .dev_id = &ckevt_sa1100_osmr0,
118}; 122};
@@ -128,7 +132,7 @@ void __init sa1100_timer_init(void)
128 132
129 setup_irq(IRQ_OST0, &sa1100_timer_irq); 133 setup_irq(IRQ_OST0, &sa1100_timer_irq);
130 134
131 clocksource_mmio_init(OSCR, "oscr", CLOCK_TICK_RATE, 200, 32, 135 clocksource_mmio_init(OSCR, "oscr", SA1100_CLOCK_FREQ, 200, 32,
132 clocksource_mmio_readl_up); 136 clocksource_mmio_readl_up);
133 clockevents_config_and_register(&ckevt_sa1100_osmr0, 3686400, 137 clockevents_config_and_register(&ckevt_sa1100_osmr0, 3686400,
134 MIN_OSCR_DELTA * 2, 0x7fffffff); 138 MIN_OSCR_DELTA * 2, 0x7fffffff);
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index f6db7dcae3f4..0f92ba8e7884 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -5,18 +5,14 @@ config ARCH_SHMOBILE_MULTI
5 bool "Renesas ARM SoCs" if ARCH_MULTI_V7 5 bool "Renesas ARM SoCs" if ARCH_MULTI_V7
6 depends on MMU 6 depends on MMU
7 select ARCH_SHMOBILE 7 select ARCH_SHMOBILE
8 select CPU_V7
9 select GENERIC_CLOCKEVENTS
10 select HAVE_ARM_SCU if SMP 8 select HAVE_ARM_SCU if SMP
11 select HAVE_ARM_TWD if SMP 9 select HAVE_ARM_TWD if SMP
12 select HAVE_SMP
13 select ARM_GIC 10 select ARM_GIC
14 select MIGHT_HAVE_CACHE_L2X0
15 select MIGHT_HAVE_PCI 11 select MIGHT_HAVE_PCI
16 select NO_IOPORT 12 select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE
13 select NO_IOPORT_MAP
17 select PINCTRL 14 select PINCTRL
18 select ARCH_REQUIRE_GPIOLIB 15 select ARCH_REQUIRE_GPIOLIB
19 select CLKDEV_LOOKUP
20 16
21if ARCH_SHMOBILE_MULTI 17if ARCH_SHMOBILE_MULTI
22 18
@@ -49,15 +45,12 @@ config MACH_GENMAI
49config MACH_KOELSCH 45config MACH_KOELSCH
50 bool "Koelsch board" 46 bool "Koelsch board"
51 depends on ARCH_R8A7791 47 depends on ARCH_R8A7791
52 48 select MICREL_PHY if SH_ETH
53config MACH_KZM9D
54 bool "KZM9D board"
55 depends on ARCH_EMEV2
56 select REGULATOR_FIXED_VOLTAGE if REGULATOR
57 49
58config MACH_LAGER 50config MACH_LAGER
59 bool "Lager board" 51 bool "Lager board"
60 depends on ARCH_R8A7790 52 depends on ARCH_R8A7790
53 select MICREL_PHY if SH_ETH
61 54
62comment "Renesas ARM SoCs System Configuration" 55comment "Renesas ARM SoCs System Configuration"
63endif 56endif
@@ -114,8 +107,6 @@ config ARCH_R8A7778
114 select CPU_V7 107 select CPU_V7
115 select SH_CLK_CPG 108 select SH_CLK_CPG
116 select ARM_GIC 109 select ARM_GIC
117 select USB_ARCH_HAS_EHCI
118 select USB_ARCH_HAS_OHCI
119 select SYS_SUPPORTS_SH_TMU 110 select SYS_SUPPORTS_SH_TMU
120 111
121config ARCH_R8A7779 112config ARCH_R8A7779
@@ -124,8 +115,6 @@ config ARCH_R8A7779
124 select ARM_GIC 115 select ARM_GIC
125 select CPU_V7 116 select CPU_V7
126 select SH_CLK_CPG 117 select SH_CLK_CPG
127 select USB_ARCH_HAS_EHCI
128 select USB_ARCH_HAS_OHCI
129 select RENESAS_INTC_IRQPIN 118 select RENESAS_INTC_IRQPIN
130 select SYS_SUPPORTS_SH_TMU 119 select SYS_SUPPORTS_SH_TMU
131 120
@@ -138,6 +127,7 @@ config ARCH_R8A7790
138 select SH_CLK_CPG 127 select SH_CLK_CPG
139 select RENESAS_IRQC 128 select RENESAS_IRQC
140 select SYS_SUPPORTS_SH_CMT 129 select SYS_SUPPORTS_SH_CMT
130 select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE
141 131
142config ARCH_R8A7791 132config ARCH_R8A7791
143 bool "R-Car M2 (R8A77910)" 133 bool "R-Car M2 (R8A77910)"
@@ -148,6 +138,7 @@ config ARCH_R8A7791
148 select SH_CLK_CPG 138 select SH_CLK_CPG
149 select RENESAS_IRQC 139 select RENESAS_IRQC
150 select SYS_SUPPORTS_SH_CMT 140 select SYS_SUPPORTS_SH_CMT
141 select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE
151 142
152config ARCH_EMEV2 143config ARCH_EMEV2
153 bool "Emma Mobile EV2" 144 bool "Emma Mobile EV2"
@@ -172,11 +163,13 @@ comment "Renesas ARM SoCs Board Type"
172config MACH_APE6EVM 163config MACH_APE6EVM
173 bool "APE6EVM board" 164 bool "APE6EVM board"
174 depends on ARCH_R8A73A4 165 depends on ARCH_R8A73A4
166 select SMSC_PHY if SMSC911X
175 select USE_OF 167 select USE_OF
176 168
177config MACH_APE6EVM_REFERENCE 169config MACH_APE6EVM_REFERENCE
178 bool "APE6EVM board - Reference Device Tree Implementation" 170 bool "APE6EVM board - Reference Device Tree Implementation"
179 depends on ARCH_R8A73A4 171 depends on ARCH_R8A73A4
172 select SMSC_PHY if SMSC911X
180 select USE_OF 173 select USE_OF
181 ---help--- 174 ---help---
182 Use reference implementation of APE6EVM board support 175 Use reference implementation of APE6EVM board support
@@ -190,6 +183,7 @@ config MACH_MACKEREL
190 depends on ARCH_SH7372 183 depends on ARCH_SH7372
191 select ARCH_REQUIRE_GPIOLIB 184 select ARCH_REQUIRE_GPIOLIB
192 select REGULATOR_FIXED_VOLTAGE if REGULATOR 185 select REGULATOR_FIXED_VOLTAGE if REGULATOR
186 select SMSC_PHY if SMSC911X
193 select SND_SOC_AK4642 if SND_SIMPLE_CARD 187 select SND_SOC_AK4642 if SND_SIMPLE_CARD
194 select USE_OF 188 select USE_OF
195 189
@@ -198,6 +192,7 @@ config MACH_ARMADILLO800EVA
198 depends on ARCH_R8A7740 192 depends on ARCH_R8A7740
199 select ARCH_REQUIRE_GPIOLIB 193 select ARCH_REQUIRE_GPIOLIB
200 select REGULATOR_FIXED_VOLTAGE if REGULATOR 194 select REGULATOR_FIXED_VOLTAGE if REGULATOR
195 select SMSC_PHY if SH_ETH
201 select SND_SOC_WM8978 if SND_SIMPLE_CARD 196 select SND_SOC_WM8978 if SND_SIMPLE_CARD
202 select USE_OF 197 select USE_OF
203 198
@@ -206,6 +201,7 @@ config MACH_ARMADILLO800EVA_REFERENCE
206 depends on ARCH_R8A7740 201 depends on ARCH_R8A7740
207 select ARCH_REQUIRE_GPIOLIB 202 select ARCH_REQUIRE_GPIOLIB
208 select REGULATOR_FIXED_VOLTAGE if REGULATOR 203 select REGULATOR_FIXED_VOLTAGE if REGULATOR
204 select SMSC_PHY if SH_ETH
209 select SND_SOC_WM8978 if SND_SIMPLE_CARD 205 select SND_SOC_WM8978 if SND_SIMPLE_CARD
210 select USE_OF 206 select USE_OF
211 ---help--- 207 ---help---
@@ -219,11 +215,11 @@ config MACH_BOCKW
219 bool "BOCK-W platform" 215 bool "BOCK-W platform"
220 depends on ARCH_R8A7778 216 depends on ARCH_R8A7778
221 select ARCH_REQUIRE_GPIOLIB 217 select ARCH_REQUIRE_GPIOLIB
222 select RENESAS_INTC_IRQPIN
223 select REGULATOR_FIXED_VOLTAGE if REGULATOR 218 select REGULATOR_FIXED_VOLTAGE if REGULATOR
224 select USE_OF 219 select RENESAS_INTC_IRQPIN
225 select SND_SOC_AK4554 if SND_SIMPLE_CARD 220 select SND_SOC_AK4554 if SND_SIMPLE_CARD
226 select SND_SOC_AK4642 if SND_SIMPLE_CARD 221 select SND_SOC_AK4642 if SND_SIMPLE_CARD
222 select USE_OF
227 223
228config MACH_BOCKW_REFERENCE 224config MACH_BOCKW_REFERENCE
229 bool "BOCK-W - Reference Device Tree Implementation" 225 bool "BOCK-W - Reference Device Tree Implementation"
@@ -279,6 +275,8 @@ config MACH_LAGER
279 bool "Lager board" 275 bool "Lager board"
280 depends on ARCH_R8A7790 276 depends on ARCH_R8A7790
281 select USE_OF 277 select USE_OF
278 select MICREL_PHY if SH_ETH
279 select SND_SOC_AK4642 if SND_SIMPLE_CARD
282 280
283config MACH_KOELSCH 281config MACH_KOELSCH
284 bool "Koelsch board" 282 bool "Koelsch board"
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index fe7d4ff706e4..4caffc912a81 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -52,13 +52,13 @@ obj-$(CONFIG_CPU_IDLE) += cpuidle.o
52obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o pm-rmobile.o 52obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o pm-rmobile.o
53obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o 53obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o
54obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o pm-rmobile.o 54obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o pm-rmobile.o
55obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o 55obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o pm-rcar.o
56obj-$(CONFIG_ARCH_R8A7790) += pm-r8a7790.o pm-rcar.o
56 57
57# Board objects 58# Board objects
58ifdef CONFIG_ARCH_SHMOBILE_MULTI 59ifdef CONFIG_ARCH_SHMOBILE_MULTI
59obj-$(CONFIG_MACH_GENMAI) += board-genmai-reference.o 60obj-$(CONFIG_MACH_GENMAI) += board-genmai-reference.o
60obj-$(CONFIG_MACH_KOELSCH) += board-koelsch-reference.o 61obj-$(CONFIG_MACH_KOELSCH) += board-koelsch-reference.o
61obj-$(CONFIG_MACH_KZM9D) += board-kzm9d-reference.o
62obj-$(CONFIG_MACH_LAGER) += board-lager-reference.o 62obj-$(CONFIG_MACH_LAGER) += board-lager-reference.o
63else 63else
64obj-$(CONFIG_MACH_APE6EVM) += board-ape6evm.o 64obj-$(CONFIG_MACH_APE6EVM) += board-ape6evm.o
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index 93533e2710a8..2858f380beae 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -383,6 +383,8 @@ static struct platform_device sh_eth_device = {
383 .id = -1, 383 .id = -1,
384 .dev = { 384 .dev = {
385 .platform_data = &sh_eth_platdata, 385 .platform_data = &sh_eth_platdata,
386 .dma_mask = &sh_eth_device.dev.coherent_dma_mask,
387 .coherent_dma_mask = DMA_BIT_MASK(32),
386 }, 388 },
387 .resource = sh_eth_resources, 389 .resource = sh_eth_resources,
388 .num_resources = ARRAY_SIZE(sh_eth_resources), 390 .num_resources = ARRAY_SIZE(sh_eth_resources),
@@ -988,14 +990,12 @@ static struct asoc_simple_card_info fsi_wm8978_info = {
988 .card = "FSI2A-WM8978", 990 .card = "FSI2A-WM8978",
989 .codec = "wm8978.0-001a", 991 .codec = "wm8978.0-001a",
990 .platform = "sh_fsi2", 992 .platform = "sh_fsi2",
991 .daifmt = SND_SOC_DAIFMT_I2S, 993 .daifmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM,
992 .cpu_dai = { 994 .cpu_dai = {
993 .name = "fsia-dai", 995 .name = "fsia-dai",
994 .fmt = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_IB_NF,
995 }, 996 },
996 .codec_dai = { 997 .codec_dai = {
997 .name = "wm8978-hifi", 998 .name = "wm8978-hifi",
998 .fmt = SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_NB_NF,
999 .sysclk = 12288000, 999 .sysclk = 12288000,
1000 }, 1000 },
1001}; 1001};
diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
index c475220545f2..b4122f8cb8d9 100644
--- a/arch/arm/mach-shmobile/board-bockw.c
+++ b/arch/arm/mach-shmobile/board-bockw.c
@@ -1,9 +1,9 @@
1/* 1/*
2 * Bock-W board support 2 * Bock-W board support
3 * 3 *
4 * Copyright (C) 2013 Renesas Solutions Corp. 4 * Copyright (C) 2013-2014 Renesas Solutions Corp.
5 * Copyright (C) 2013 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> 5 * Copyright (C) 2013 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 * Copyright (C) 2013 Cogent Embedded, Inc. 6 * Copyright (C) 2013-2014 Cogent Embedded, Inc.
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 as published by 9 * it under the terms of the GNU General Public License as published by
@@ -168,6 +168,8 @@ static struct renesas_usbhs_platform_info usbhs_info __initdata = {
168 }, 168 },
169 .driver_param = { 169 .driver_param = {
170 .buswait_bwait = 4, 170 .buswait_bwait = 4,
171 .d0_tx_id = HPBDMA_SLAVE_USBFUNC_TX,
172 .d1_rx_id = HPBDMA_SLAVE_USBFUNC_RX,
171 }, 173 },
172}; 174};
173 175
@@ -233,6 +235,17 @@ static struct sh_eth_plat_data ether_platform_data __initdata = {
233 .no_ether_link = 1, 235 .no_ether_link = 1,
234}; 236};
235 237
238static struct platform_device_info ether_info __initdata = {
239 .parent = &platform_bus,
240 .name = "r8a777x-ether",
241 .id = -1,
242 .res = ether_resources,
243 .num_res = ARRAY_SIZE(ether_resources),
244 .data = &ether_platform_data,
245 .size_data = sizeof(ether_platform_data),
246 .dma_mask = DMA_BIT_MASK(32),
247};
248
236/* I2C */ 249/* I2C */
237static struct i2c_board_info i2c0_devices[] = { 250static struct i2c_board_info i2c0_devices[] = {
238 { 251 {
@@ -332,16 +345,24 @@ static struct rsnd_ssi_platform_info rsnd_ssi[] = {
332 RSND_SSI_UNUSED, /* SSI 0 */ 345 RSND_SSI_UNUSED, /* SSI 0 */
333 RSND_SSI_UNUSED, /* SSI 1 */ 346 RSND_SSI_UNUSED, /* SSI 1 */
334 RSND_SSI_UNUSED, /* SSI 2 */ 347 RSND_SSI_UNUSED, /* SSI 2 */
335 RSND_SSI_SET(1, 0, gic_iid(0x85), RSND_SSI_PLAY), 348 RSND_SSI_SET(1, HPBDMA_SLAVE_HPBIF3_TX, gic_iid(0x85), RSND_SSI_PLAY),
336 RSND_SSI_SET(2, 0, gic_iid(0x85), RSND_SSI_CLK_PIN_SHARE), 349 RSND_SSI_SET(2, HPBDMA_SLAVE_HPBIF4_RX, gic_iid(0x85), RSND_SSI_CLK_PIN_SHARE),
337 RSND_SSI_SET(0, 0, gic_iid(0x86), RSND_SSI_PLAY), 350 RSND_SSI_SET(0, HPBDMA_SLAVE_HPBIF5_TX, gic_iid(0x86), RSND_SSI_PLAY),
338 RSND_SSI_SET(0, 0, gic_iid(0x86), 0), 351 RSND_SSI_SET(0, HPBDMA_SLAVE_HPBIF6_RX, gic_iid(0x86), 0),
339 RSND_SSI_SET(3, 0, gic_iid(0x86), RSND_SSI_PLAY), 352 RSND_SSI_SET(3, HPBDMA_SLAVE_HPBIF7_TX, gic_iid(0x86), RSND_SSI_PLAY),
340 RSND_SSI_SET(4, 0, gic_iid(0x86), RSND_SSI_CLK_PIN_SHARE), 353 RSND_SSI_SET(4, HPBDMA_SLAVE_HPBIF8_RX, gic_iid(0x86), RSND_SSI_CLK_PIN_SHARE),
341}; 354};
342 355
343static struct rsnd_scu_platform_info rsnd_scu[9] = { 356static struct rsnd_scu_platform_info rsnd_scu[9] = {
344 /* no member at this point */ 357 { .flags = 0, }, /* SRU 0 */
358 { .flags = 0, }, /* SRU 1 */
359 { .flags = 0, }, /* SRU 2 */
360 { .flags = RSND_SCU_USE_HPBIF, },
361 { .flags = RSND_SCU_USE_HPBIF, },
362 { .flags = RSND_SCU_USE_HPBIF, },
363 { .flags = RSND_SCU_USE_HPBIF, },
364 { .flags = RSND_SCU_USE_HPBIF, },
365 { .flags = RSND_SCU_USE_HPBIF, },
345}; 366};
346 367
347enum { 368enum {
@@ -429,14 +450,12 @@ static struct asoc_simple_card_info rsnd_card_info[] = {
429 .card = "SSI56-AK4643", 450 .card = "SSI56-AK4643",
430 .codec = "ak4642-codec.0-0012", 451 .codec = "ak4642-codec.0-0012",
431 .platform = "rcar_sound", 452 .platform = "rcar_sound",
432 .daifmt = SND_SOC_DAIFMT_LEFT_J, 453 .daifmt = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBM_CFM,
433 .cpu_dai = { 454 .cpu_dai = {
434 .name = "rsnd-dai.0", 455 .name = "rsnd-dai.0",
435 .fmt = SND_SOC_DAIFMT_CBS_CFS,
436 }, 456 },
437 .codec_dai = { 457 .codec_dai = {
438 .name = "ak4642-hifi", 458 .name = "ak4642-hifi",
439 .fmt = SND_SOC_DAIFMT_CBM_CFM,
440 .sysclk = 11289600, 459 .sysclk = 11289600,
441 }, 460 },
442 }, 461 },
@@ -446,10 +465,9 @@ static struct asoc_simple_card_info rsnd_card_info[] = {
446 .card = "SSI3-AK4554(playback)", 465 .card = "SSI3-AK4554(playback)",
447 .codec = "ak4554-adc-dac.0", 466 .codec = "ak4554-adc-dac.0",
448 .platform = "rcar_sound", 467 .platform = "rcar_sound",
468 .daifmt = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_RIGHT_J,
449 .cpu_dai = { 469 .cpu_dai = {
450 .name = "rsnd-dai.1", 470 .name = "rsnd-dai.1",
451 .fmt = SND_SOC_DAIFMT_CBM_CFM |
452 SND_SOC_DAIFMT_RIGHT_J,
453 }, 471 },
454 .codec_dai = { 472 .codec_dai = {
455 .name = "ak4554-hifi", 473 .name = "ak4554-hifi",
@@ -461,10 +479,9 @@ static struct asoc_simple_card_info rsnd_card_info[] = {
461 .card = "SSI4-AK4554(capture)", 479 .card = "SSI4-AK4554(capture)",
462 .codec = "ak4554-adc-dac.0", 480 .codec = "ak4554-adc-dac.0",
463 .platform = "rcar_sound", 481 .platform = "rcar_sound",
482 .daifmt = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_LEFT_J,
464 .cpu_dai = { 483 .cpu_dai = {
465 .name = "rsnd-dai.2", 484 .name = "rsnd-dai.2",
466 .fmt = SND_SOC_DAIFMT_CBM_CFM |
467 SND_SOC_DAIFMT_LEFT_J,
468 }, 485 },
469 .codec_dai = { 486 .codec_dai = {
470 .name = "ak4554-hifi", 487 .name = "ak4554-hifi",
@@ -476,10 +493,9 @@ static struct asoc_simple_card_info rsnd_card_info[] = {
476 .card = "SSI7-AK4554(playback)", 493 .card = "SSI7-AK4554(playback)",
477 .codec = "ak4554-adc-dac.1", 494 .codec = "ak4554-adc-dac.1",
478 .platform = "rcar_sound", 495 .platform = "rcar_sound",
496 .daifmt = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_RIGHT_J,
479 .cpu_dai = { 497 .cpu_dai = {
480 .name = "rsnd-dai.3", 498 .name = "rsnd-dai.3",
481 .fmt = SND_SOC_DAIFMT_CBM_CFM |
482 SND_SOC_DAIFMT_RIGHT_J,
483 }, 499 },
484 .codec_dai = { 500 .codec_dai = {
485 .name = "ak4554-hifi", 501 .name = "ak4554-hifi",
@@ -491,10 +507,9 @@ static struct asoc_simple_card_info rsnd_card_info[] = {
491 .card = "SSI8-AK4554(capture)", 507 .card = "SSI8-AK4554(capture)",
492 .codec = "ak4554-adc-dac.1", 508 .codec = "ak4554-adc-dac.1",
493 .platform = "rcar_sound", 509 .platform = "rcar_sound",
510 .daifmt = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_LEFT_J,
494 .cpu_dai = { 511 .cpu_dai = {
495 .name = "rsnd-dai.4", 512 .name = "rsnd-dai.4",
496 .fmt = SND_SOC_DAIFMT_CBM_CFM |
497 SND_SOC_DAIFMT_LEFT_J,
498 }, 513 },
499 .codec_dai = { 514 .codec_dai = {
500 .name = "ak4554-hifi", 515 .name = "ak4554-hifi",
@@ -582,11 +597,7 @@ static void __init bockw_init(void)
582 r8a7778_init_irq_extpin(1); 597 r8a7778_init_irq_extpin(1);
583 r8a7778_add_standard_devices(); 598 r8a7778_add_standard_devices();
584 599
585 platform_device_register_resndata(&platform_bus, "r8a777x-ether", -1, 600 platform_device_register_full(&ether_info);
586 ether_resources,
587 ARRAY_SIZE(ether_resources),
588 &ether_platform_data,
589 sizeof(ether_platform_data));
590 601
591 platform_device_register_full(&vin0_info); 602 platform_device_register_full(&vin0_info);
592 /* VIN1 has a pin conflict with Ether */ 603 /* VIN1 has a pin conflict with Ether */
diff --git a/arch/arm/mach-shmobile/board-genmai.c b/arch/arm/mach-shmobile/board-genmai.c
index 3e92e3c62d4c..6c328d63b819 100644
--- a/arch/arm/mach-shmobile/board-genmai.c
+++ b/arch/arm/mach-shmobile/board-genmai.c
@@ -1,8 +1,9 @@
1/* 1/*
2 * Genmai board support 2 * Genmai board support
3 * 3 *
4 * Copyright (C) 2013 Renesas Solutions Corp. 4 * Copyright (C) 2013-2014 Renesas Solutions Corp.
5 * Copyright (C) 2013 Magnus Damm 5 * Copyright (C) 2013 Magnus Damm
6 * Copyright (C) 2014 Cogent Embedded, Inc.
6 * 7 *
7 * 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
8 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -20,15 +21,87 @@
20 21
21#include <linux/kernel.h> 22#include <linux/kernel.h>
22#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/sh_eth.h>
25#include <linux/spi/rspi.h>
26#include <linux/spi/spi.h>
23#include <mach/common.h> 27#include <mach/common.h>
28#include <mach/irqs.h>
24#include <mach/r7s72100.h> 29#include <mach/r7s72100.h>
25#include <asm/mach-types.h> 30#include <asm/mach-types.h>
26#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
27 32
33/* Ether */
34static const struct sh_eth_plat_data ether_pdata __initconst = {
35 .phy = 0x00, /* PD60610 */
36 .edmac_endian = EDMAC_LITTLE_ENDIAN,
37 .phy_interface = PHY_INTERFACE_MODE_MII,
38 .no_ether_link = 1
39};
40
41static const struct resource ether_resources[] __initconst = {
42 DEFINE_RES_MEM(0xe8203000, 0x800),
43 DEFINE_RES_MEM(0xe8204800, 0x200),
44 DEFINE_RES_IRQ(gic_iid(359)),
45};
46
47static const struct platform_device_info ether_info __initconst = {
48 .parent = &platform_bus,
49 .name = "r7s72100-ether",
50 .id = -1,
51 .res = ether_resources,
52 .num_res = ARRAY_SIZE(ether_resources),
53 .data = &ether_pdata,
54 .size_data = sizeof(ether_pdata),
55 .dma_mask = DMA_BIT_MASK(32),
56};
57
58/* RSPI */
59#define RSPI_RESOURCE(idx, baseaddr, irq) \
60static const struct resource rspi##idx##_resources[] __initconst = { \
61 DEFINE_RES_MEM(baseaddr, 0x24), \
62 DEFINE_RES_IRQ_NAMED(irq, "error"), \
63 DEFINE_RES_IRQ_NAMED(irq + 1, "rx"), \
64 DEFINE_RES_IRQ_NAMED(irq + 2, "tx"), \
65}
66
67RSPI_RESOURCE(0, 0xe800c800, gic_iid(270));
68RSPI_RESOURCE(1, 0xe800d000, gic_iid(273));
69RSPI_RESOURCE(2, 0xe800d800, gic_iid(276));
70RSPI_RESOURCE(3, 0xe800e000, gic_iid(279));
71RSPI_RESOURCE(4, 0xe800e800, gic_iid(282));
72
73static const struct rspi_plat_data rspi_pdata __initconst = {
74 .num_chipselect = 1,
75};
76
77#define r7s72100_register_rspi(idx) \
78 platform_device_register_resndata(&platform_bus, "rspi-rz", idx, \
79 rspi##idx##_resources, \
80 ARRAY_SIZE(rspi##idx##_resources), \
81 &rspi_pdata, sizeof(rspi_pdata))
82
83static const struct spi_board_info spi_info[] __initconst = {
84 {
85 .modalias = "wm8978",
86 .max_speed_hz = 5000000,
87 .bus_num = 4,
88 .chip_select = 0,
89 },
90};
91
28static void __init genmai_add_standard_devices(void) 92static void __init genmai_add_standard_devices(void)
29{ 93{
30 r7s72100_clock_init(); 94 r7s72100_clock_init();
31 r7s72100_add_dt_devices(); 95 r7s72100_add_dt_devices();
96
97 platform_device_register_full(&ether_info);
98
99 r7s72100_register_rspi(0);
100 r7s72100_register_rspi(1);
101 r7s72100_register_rspi(2);
102 r7s72100_register_rspi(3);
103 r7s72100_register_rspi(4);
104 spi_register_board_info(spi_info, ARRAY_SIZE(spi_info));
32} 105}
33 106
34static const char * const genmai_boards_compat_dt[] __initconst = { 107static const char * const genmai_boards_compat_dt[] __initconst = {
diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c
index 652b59268416..a3fd30242bd8 100644
--- a/arch/arm/mach-shmobile/board-koelsch-reference.c
+++ b/arch/arm/mach-shmobile/board-koelsch-reference.c
@@ -21,46 +21,114 @@
21 21
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/clkdev.h> 23#include <linux/clkdev.h>
24#include <linux/dma-mapping.h>
24#include <linux/kernel.h> 25#include <linux/kernel.h>
25#include <linux/of_platform.h> 26#include <linux/of_platform.h>
27#include <linux/platform_data/rcar-du.h>
26#include <mach/common.h> 28#include <mach/common.h>
29#include <mach/irqs.h>
27#include <mach/rcar-gen2.h> 30#include <mach/rcar-gen2.h>
28#include <mach/r8a7791.h> 31#include <mach/r8a7791.h>
29#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
30 33
34/* DU */
35static struct rcar_du_encoder_data koelsch_du_encoders[] = {
36 {
37 .type = RCAR_DU_ENCODER_NONE,
38 .output = RCAR_DU_OUTPUT_LVDS0,
39 .connector.lvds.panel = {
40 .width_mm = 210,
41 .height_mm = 158,
42 .mode = {
43 .clock = 65000,
44 .hdisplay = 1024,
45 .hsync_start = 1048,
46 .hsync_end = 1184,
47 .htotal = 1344,
48 .vdisplay = 768,
49 .vsync_start = 771,
50 .vsync_end = 777,
51 .vtotal = 806,
52 .flags = 0,
53 },
54 },
55 },
56};
57
58static struct rcar_du_platform_data koelsch_du_pdata = {
59 .encoders = koelsch_du_encoders,
60 .num_encoders = ARRAY_SIZE(koelsch_du_encoders),
61};
62
63static const struct resource du_resources[] __initconst = {
64 DEFINE_RES_MEM(0xfeb00000, 0x40000),
65 DEFINE_RES_MEM_NAMED(0xfeb90000, 0x1c, "lvds.0"),
66 DEFINE_RES_IRQ(gic_spi(256)),
67 DEFINE_RES_IRQ(gic_spi(268)),
68};
69
70static void __init koelsch_add_du_device(void)
71{
72 struct platform_device_info info = {
73 .name = "rcar-du-r8a7791",
74 .id = -1,
75 .res = du_resources,
76 .num_res = ARRAY_SIZE(du_resources),
77 .data = &koelsch_du_pdata,
78 .size_data = sizeof(koelsch_du_pdata),
79 .dma_mask = DMA_BIT_MASK(32),
80 };
81
82 platform_device_register_full(&info);
83}
84
31static void __init koelsch_add_standard_devices(void) 85static void __init koelsch_add_standard_devices(void)
32{ 86{
33#ifdef CONFIG_COMMON_CLK
34 /* 87 /*
35 * This is a really crude hack to provide clkdev support to the SCIF 88 * This is a really crude hack to provide clkdev support to the CMT and
36 * and CMT devices until they get moved to DT. 89 * DU devices until they get moved to DT.
37 */ 90 */
38 static const char * const scif_names[] = { 91 static const struct clk_name {
39 "scifa0", "scifa1", "scifb0", "scifb1", "scifb2", "scifa2", 92 const char *clk;
40 "scif0", "scif1", "scif2", "scif3", "scif4", "scif5", "scifa3", 93 const char *con_id;
41 "scifa4", "scifa5", 94 const char *dev_id;
95 } clk_names[] = {
96 { "cmt0", NULL, "sh_cmt.0" },
97 { "scifa0", NULL, "sh-sci.0" },
98 { "scifa1", NULL, "sh-sci.1" },
99 { "scifb0", NULL, "sh-sci.2" },
100 { "scifb1", NULL, "sh-sci.3" },
101 { "scifb2", NULL, "sh-sci.4" },
102 { "scifa2", NULL, "sh-sci.5" },
103 { "scif0", NULL, "sh-sci.6" },
104 { "scif1", NULL, "sh-sci.7" },
105 { "scif2", NULL, "sh-sci.8" },
106 { "scif3", NULL, "sh-sci.9" },
107 { "scif4", NULL, "sh-sci.10" },
108 { "scif5", NULL, "sh-sci.11" },
109 { "scifa3", NULL, "sh-sci.12" },
110 { "scifa4", NULL, "sh-sci.13" },
111 { "scifa5", NULL, "sh-sci.14" },
112 { "du0", "du.0", "rcar-du-r8a7791" },
113 { "du1", "du.1", "rcar-du-r8a7791" },
114 { "lvds0", "lvds.0", "rcar-du-r8a7791" },
42 }; 115 };
43 struct clk *clk; 116 struct clk *clk;
44 unsigned int i; 117 unsigned int i;
45 118
46 for (i = 0; i < ARRAY_SIZE(scif_names); ++i) { 119 for (i = 0; i < ARRAY_SIZE(clk_names); ++i) {
47 clk = clk_get(NULL, scif_names[i]); 120 clk = clk_get(NULL, clk_names[i].clk);
48 if (clk) { 121 if (!IS_ERR(clk)) {
49 clk_register_clkdev(clk, NULL, "sh-sci.%u", i); 122 clk_register_clkdev(clk, clk_names[i].con_id,
123 clk_names[i].dev_id);
50 clk_put(clk); 124 clk_put(clk);
51 } 125 }
52 } 126 }
53 127
54 clk = clk_get(NULL, "cmt0");
55 if (clk) {
56 clk_register_clkdev(clk, NULL, "sh_cmt.0");
57 clk_put(clk);
58 }
59#else
60 r8a7791_clock_init();
61#endif
62 r8a7791_add_dt_devices(); 128 r8a7791_add_dt_devices();
63 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 129 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
130
131 koelsch_add_du_device();
64} 132}
65 133
66static const char * const koelsch_boards_compat_dt[] __initconst = { 134static const char * const koelsch_boards_compat_dt[] __initconst = {
diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index de7cc64b1f37..5a034ff405d0 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -2,8 +2,9 @@
2 * Koelsch board support 2 * Koelsch board support
3 * 3 *
4 * Copyright (C) 2013 Renesas Electronics Corporation 4 * Copyright (C) 2013 Renesas Electronics Corporation
5 * Copyright (C) 2013 Renesas Solutions Corp. 5 * Copyright (C) 2013-2014 Renesas Solutions Corp.
6 * Copyright (C) 2013 Magnus Damm 6 * Copyright (C) 2013 Magnus Damm
7 * Copyright (C) 2014 Cogent Embedded, Inc.
7 * 8 *
8 * 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
9 * 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
@@ -23,14 +24,27 @@
23#include <linux/gpio.h> 24#include <linux/gpio.h>
24#include <linux/gpio_keys.h> 25#include <linux/gpio_keys.h>
25#include <linux/input.h> 26#include <linux/input.h>
27#include <linux/irq.h>
26#include <linux/kernel.h> 28#include <linux/kernel.h>
27#include <linux/leds.h> 29#include <linux/leds.h>
30#include <linux/mfd/tmio.h>
31#include <linux/mmc/host.h>
32#include <linux/mmc/sh_mobile_sdhi.h>
33#include <linux/mtd/mtd.h>
34#include <linux/mtd/partitions.h>
28#include <linux/phy.h> 35#include <linux/phy.h>
29#include <linux/pinctrl/machine.h> 36#include <linux/pinctrl/machine.h>
30#include <linux/platform_data/gpio-rcar.h> 37#include <linux/platform_data/gpio-rcar.h>
31#include <linux/platform_data/rcar-du.h> 38#include <linux/platform_data/rcar-du.h>
32#include <linux/platform_device.h> 39#include <linux/platform_device.h>
40#include <linux/regulator/driver.h>
41#include <linux/regulator/fixed.h>
42#include <linux/regulator/gpio-regulator.h>
43#include <linux/regulator/machine.h>
33#include <linux/sh_eth.h> 44#include <linux/sh_eth.h>
45#include <linux/spi/flash.h>
46#include <linux/spi/rspi.h>
47#include <linux/spi/spi.h>
34#include <mach/common.h> 48#include <mach/common.h>
35#include <mach/irqs.h> 49#include <mach/irqs.h>
36#include <mach/r8a7791.h> 50#include <mach/r8a7791.h>
@@ -92,6 +106,7 @@ static void __init koelsch_add_du_device(void)
92/* Ether */ 106/* Ether */
93static const struct sh_eth_plat_data ether_pdata __initconst = { 107static const struct sh_eth_plat_data ether_pdata __initconst = {
94 .phy = 0x1, 108 .phy = 0x1,
109 .phy_irq = irq_pin(0),
95 .edmac_endian = EDMAC_LITTLE_ENDIAN, 110 .edmac_endian = EDMAC_LITTLE_ENDIAN,
96 .phy_interface = PHY_INTERFACE_MODE_RMII, 111 .phy_interface = PHY_INTERFACE_MODE_RMII,
97 .ether_link_active_low = 1, 112 .ether_link_active_low = 1,
@@ -102,6 +117,17 @@ static const struct resource ether_resources[] __initconst = {
102 DEFINE_RES_IRQ(gic_spi(162)), 117 DEFINE_RES_IRQ(gic_spi(162)),
103}; 118};
104 119
120static const struct platform_device_info ether_info __initconst = {
121 .parent = &platform_bus,
122 .name = "r8a7791-ether",
123 .id = -1,
124 .res = ether_resources,
125 .num_res = ARRAY_SIZE(ether_resources),
126 .data = &ether_pdata,
127 .size_data = sizeof(ether_pdata),
128 .dma_mask = DMA_BIT_MASK(32),
129};
130
105/* LEDS */ 131/* LEDS */
106static struct gpio_led koelsch_leds[] = { 132static struct gpio_led koelsch_leds[] = {
107 { 133 {
@@ -148,6 +174,199 @@ static const struct gpio_keys_platform_data koelsch_keys_pdata __initconst = {
148 .nbuttons = ARRAY_SIZE(gpio_buttons), 174 .nbuttons = ARRAY_SIZE(gpio_buttons),
149}; 175};
150 176
177/* QSPI */
178static const struct resource qspi_resources[] __initconst = {
179 DEFINE_RES_MEM(0xe6b10000, 0x1000),
180 DEFINE_RES_IRQ_NAMED(gic_spi(184), "mux"),
181};
182
183static const struct rspi_plat_data qspi_pdata __initconst = {
184 .num_chipselect = 1,
185};
186
187/* SPI Flash memory (Spansion S25FL512SAGMFIG11 64 MiB) */
188static struct mtd_partition spi_flash_part[] = {
189 {
190 .name = "loader",
191 .offset = 0x00000000,
192 .size = 512 * 1024,
193 .mask_flags = MTD_WRITEABLE,
194 },
195 {
196 .name = "bootenv",
197 .offset = MTDPART_OFS_APPEND,
198 .size = 512 * 1024,
199 .mask_flags = MTD_WRITEABLE,
200 },
201 {
202 .name = "data",
203 .offset = MTDPART_OFS_APPEND,
204 .size = MTDPART_SIZ_FULL,
205 },
206};
207
208static const struct flash_platform_data spi_flash_data = {
209 .name = "m25p80",
210 .parts = spi_flash_part,
211 .nr_parts = ARRAY_SIZE(spi_flash_part),
212 .type = "s25fl512s",
213};
214
215static const struct spi_board_info spi_info[] __initconst = {
216 {
217 .modalias = "m25p80",
218 .platform_data = &spi_flash_data,
219 .mode = SPI_MODE_0,
220 .max_speed_hz = 30000000,
221 .bus_num = 0,
222 .chip_select = 0,
223 },
224};
225
226/* SATA0 */
227static const struct resource sata0_resources[] __initconst = {
228 DEFINE_RES_MEM(0xee300000, 0x2000),
229 DEFINE_RES_IRQ(gic_spi(105)),
230};
231
232static const struct platform_device_info sata0_info __initconst = {
233 .parent = &platform_bus,
234 .name = "sata-r8a7791",
235 .id = 0,
236 .res = sata0_resources,
237 .num_res = ARRAY_SIZE(sata0_resources),
238 .dma_mask = DMA_BIT_MASK(32),
239};
240
241/* I2C */
242static const struct resource i2c_resources[] __initconst = {
243 /* I2C0 */
244 DEFINE_RES_MEM(0xE6508000, 0x40),
245 DEFINE_RES_IRQ(gic_spi(287)),
246 /* I2C1 */
247 DEFINE_RES_MEM(0xE6518000, 0x40),
248 DEFINE_RES_IRQ(gic_spi(288)),
249 /* I2C2 */
250 DEFINE_RES_MEM(0xE6530000, 0x40),
251 DEFINE_RES_IRQ(gic_spi(286)),
252 /* I2C3 */
253 DEFINE_RES_MEM(0xE6540000, 0x40),
254 DEFINE_RES_IRQ(gic_spi(290)),
255 /* I2C4 */
256 DEFINE_RES_MEM(0xE6520000, 0x40),
257 DEFINE_RES_IRQ(gic_spi(19)),
258 /* I2C5 */
259 DEFINE_RES_MEM(0xE6528000, 0x40),
260 DEFINE_RES_IRQ(gic_spi(20)),
261};
262
263static void __init koelsch_add_i2c(unsigned idx)
264{
265 unsigned res_idx = idx * 2;
266
267 BUG_ON(res_idx >= ARRAY_SIZE(i2c_resources));
268
269 platform_device_register_simple("i2c-rcar_gen2", idx,
270 i2c_resources + res_idx, 2);
271}
272
273#define SDHI_REGULATOR(idx, vdd_pin, vccq_pin) \
274static struct regulator_consumer_supply vcc_sdhi##idx##_consumer = \
275 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi." #idx); \
276 \
277static struct regulator_init_data vcc_sdhi##idx##_init_data = { \
278 .constraints = { \
279 .valid_ops_mask = REGULATOR_CHANGE_STATUS, \
280 }, \
281 .consumer_supplies = &vcc_sdhi##idx##_consumer, \
282 .num_consumer_supplies = 1, \
283}; \
284 \
285static const struct fixed_voltage_config vcc_sdhi##idx##_info __initconst = {\
286 .supply_name = "SDHI" #idx "Vcc", \
287 .microvolts = 3300000, \
288 .gpio = vdd_pin, \
289 .enable_high = 1, \
290 .init_data = &vcc_sdhi##idx##_init_data, \
291}; \
292 \
293static struct regulator_consumer_supply vccq_sdhi##idx##_consumer = \
294 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi." #idx); \
295 \
296static struct regulator_init_data vccq_sdhi##idx##_init_data = { \
297 .constraints = { \
298 .input_uV = 3300000, \
299 .min_uV = 1800000, \
300 .max_uV = 3300000, \
301 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | \
302 REGULATOR_CHANGE_STATUS, \
303 }, \
304 .consumer_supplies = &vccq_sdhi##idx##_consumer, \
305 .num_consumer_supplies = 1, \
306}; \
307 \
308static struct gpio vccq_sdhi##idx##_gpio = \
309 { vccq_pin, GPIOF_OUT_INIT_HIGH, "vccq-sdhi" #idx }; \
310 \
311static struct gpio_regulator_state vccq_sdhi##idx##_states[] = { \
312 { .value = 1800000, .gpios = 0 }, \
313 { .value = 3300000, .gpios = 1 }, \
314}; \
315 \
316static const struct gpio_regulator_config vccq_sdhi##idx##_info __initconst = {\
317 .supply_name = "vqmmc", \
318 .gpios = &vccq_sdhi##idx##_gpio, \
319 .nr_gpios = 1, \
320 .states = vccq_sdhi##idx##_states, \
321 .nr_states = ARRAY_SIZE(vccq_sdhi##idx##_states), \
322 .type = REGULATOR_VOLTAGE, \
323 .init_data = &vccq_sdhi##idx##_init_data, \
324};
325
326SDHI_REGULATOR(0, RCAR_GP_PIN(7, 17), RCAR_GP_PIN(2, 12));
327SDHI_REGULATOR(1, RCAR_GP_PIN(7, 18), RCAR_GP_PIN(2, 13));
328SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26));
329
330/* SDHI0 */
331static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
332 .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
333 MMC_CAP_POWER_OFF_CARD,
334 .tmio_caps2 = MMC_CAP2_NO_MULTI_READ,
335 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
336};
337
338static struct resource sdhi0_resources[] __initdata = {
339 DEFINE_RES_MEM(0xee100000, 0x200),
340 DEFINE_RES_IRQ(gic_spi(165)),
341};
342
343/* SDHI1 */
344static struct sh_mobile_sdhi_info sdhi1_info __initdata = {
345 .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
346 MMC_CAP_POWER_OFF_CARD,
347 .tmio_caps2 = MMC_CAP2_NO_MULTI_READ,
348 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
349};
350
351static struct resource sdhi1_resources[] __initdata = {
352 DEFINE_RES_MEM(0xee140000, 0x100),
353 DEFINE_RES_IRQ(gic_spi(167)),
354};
355
356/* SDHI2 */
357static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
358 .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
359 MMC_CAP_POWER_OFF_CARD,
360 .tmio_caps2 = MMC_CAP2_NO_MULTI_READ,
361 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT |
362 TMIO_MMC_WRPROTECT_DISABLE,
363};
364
365static struct resource sdhi2_resources[] __initdata = {
366 DEFINE_RES_MEM(0xee160000, 0x100),
367 DEFINE_RES_IRQ(gic_spi(168)),
368};
369
151static const struct pinctrl_map koelsch_pinctrl_map[] = { 370static const struct pinctrl_map koelsch_pinctrl_map[] = {
152 /* DU */ 371 /* DU */
153 PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7791", "pfc-r8a7791", 372 PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7791", "pfc-r8a7791",
@@ -165,12 +384,51 @@ static const struct pinctrl_map koelsch_pinctrl_map[] = {
165 "eth_rmii", "eth"), 384 "eth_rmii", "eth"),
166 PIN_MAP_MUX_GROUP_DEFAULT("r8a7791-ether", "pfc-r8a7791", 385 PIN_MAP_MUX_GROUP_DEFAULT("r8a7791-ether", "pfc-r8a7791",
167 "intc_irq0", "intc"), 386 "intc_irq0", "intc"),
387 /* QSPI */
388 PIN_MAP_MUX_GROUP_DEFAULT("qspi.0", "pfc-r8a7791",
389 "qspi_ctrl", "qspi"),
390 PIN_MAP_MUX_GROUP_DEFAULT("qspi.0", "pfc-r8a7791",
391 "qspi_data4", "qspi"),
168 /* SCIF0 (CN19: DEBUG SERIAL0) */ 392 /* SCIF0 (CN19: DEBUG SERIAL0) */
169 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7791", 393 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7791",
170 "scif0_data_d", "scif0"), 394 "scif0_data_d", "scif0"),
171 /* SCIF1 (CN20: DEBUG SERIAL1) */ 395 /* SCIF1 (CN20: DEBUG SERIAL1) */
172 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.7", "pfc-r8a7791", 396 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.7", "pfc-r8a7791",
173 "scif1_data_d", "scif1"), 397 "scif1_data_d", "scif1"),
398 /* I2C1 */
399 PIN_MAP_MUX_GROUP_DEFAULT("i2c-rcar_gen2.1", "pfc-r8a7791",
400 "i2c1_e", "i2c1"),
401 /* I2C2 */
402 PIN_MAP_MUX_GROUP_DEFAULT("i2c-rcar_gen2.2", "pfc-r8a7791",
403 "i2c2", "i2c2"),
404 /* I2C4 */
405 PIN_MAP_MUX_GROUP_DEFAULT("i2c-rcar_gen2.4", "pfc-r8a7791",
406 "i2c4_c", "i2c4"),
407 /* SDHI0 */
408 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7791",
409 "sdhi0_data4", "sdhi0"),
410 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7791",
411 "sdhi0_ctrl", "sdhi0"),
412 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7791",
413 "sdhi0_cd", "sdhi0"),
414 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7791",
415 "sdhi0_wp", "sdhi0"),
416 /* SDHI2 */
417 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a7791",
418 "sdhi1_data4", "sdhi1"),
419 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a7791",
420 "sdhi1_ctrl", "sdhi1"),
421 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a7791",
422 "sdhi1_cd", "sdhi1"),
423 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a7791",
424 "sdhi1_wp", "sdhi1"),
425 /* SDHI2 */
426 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-r8a7791",
427 "sdhi2_data4", "sdhi2"),
428 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-r8a7791",
429 "sdhi2_ctrl", "sdhi2"),
430 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-r8a7791",
431 "sdhi2_cd", "sdhi2"),
174}; 432};
175 433
176static void __init koelsch_add_standard_devices(void) 434static void __init koelsch_add_standard_devices(void)
@@ -180,18 +438,53 @@ static void __init koelsch_add_standard_devices(void)
180 ARRAY_SIZE(koelsch_pinctrl_map)); 438 ARRAY_SIZE(koelsch_pinctrl_map));
181 r8a7791_pinmux_init(); 439 r8a7791_pinmux_init();
182 r8a7791_add_standard_devices(); 440 r8a7791_add_standard_devices();
183 platform_device_register_resndata(&platform_bus, "r8a7791-ether", -1, 441 platform_device_register_full(&ether_info);
184 ether_resources,
185 ARRAY_SIZE(ether_resources),
186 &ether_pdata, sizeof(ether_pdata));
187 platform_device_register_data(&platform_bus, "leds-gpio", -1, 442 platform_device_register_data(&platform_bus, "leds-gpio", -1,
188 &koelsch_leds_pdata, 443 &koelsch_leds_pdata,
189 sizeof(koelsch_leds_pdata)); 444 sizeof(koelsch_leds_pdata));
190 platform_device_register_data(&platform_bus, "gpio-keys", -1, 445 platform_device_register_data(&platform_bus, "gpio-keys", -1,
191 &koelsch_keys_pdata, 446 &koelsch_keys_pdata,
192 sizeof(koelsch_keys_pdata)); 447 sizeof(koelsch_keys_pdata));
448 platform_device_register_resndata(&platform_bus, "qspi", 0,
449 qspi_resources,
450 ARRAY_SIZE(qspi_resources),
451 &qspi_pdata, sizeof(qspi_pdata));
452 spi_register_board_info(spi_info, ARRAY_SIZE(spi_info));
193 453
194 koelsch_add_du_device(); 454 koelsch_add_du_device();
455
456 platform_device_register_full(&sata0_info);
457
458 koelsch_add_i2c(1);
459 koelsch_add_i2c(2);
460 koelsch_add_i2c(4);
461 koelsch_add_i2c(5);
462
463 platform_device_register_data(&platform_bus, "reg-fixed-voltage", 0,
464 &vcc_sdhi0_info, sizeof(struct fixed_voltage_config));
465 platform_device_register_data(&platform_bus, "reg-fixed-voltage", 1,
466 &vcc_sdhi1_info, sizeof(struct fixed_voltage_config));
467 platform_device_register_data(&platform_bus, "reg-fixed-voltage", 2,
468 &vcc_sdhi2_info, sizeof(struct fixed_voltage_config));
469 platform_device_register_data(&platform_bus, "gpio-regulator", 0,
470 &vccq_sdhi0_info, sizeof(struct gpio_regulator_config));
471 platform_device_register_data(&platform_bus, "gpio-regulator", 1,
472 &vccq_sdhi1_info, sizeof(struct gpio_regulator_config));
473 platform_device_register_data(&platform_bus, "gpio-regulator", 2,
474 &vccq_sdhi2_info, sizeof(struct gpio_regulator_config));
475
476 platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 0,
477 sdhi0_resources, ARRAY_SIZE(sdhi0_resources),
478 &sdhi0_info, sizeof(struct sh_mobile_sdhi_info));
479
480 platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 1,
481 sdhi1_resources, ARRAY_SIZE(sdhi1_resources),
482 &sdhi1_info, sizeof(struct sh_mobile_sdhi_info));
483
484 platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 2,
485 sdhi2_resources, ARRAY_SIZE(sdhi2_resources),
486 &sdhi2_info, sizeof(struct sh_mobile_sdhi_info));
487
195} 488}
196 489
197/* 490/*
@@ -215,6 +508,8 @@ static void __init koelsch_init(void)
215{ 508{
216 koelsch_add_standard_devices(); 509 koelsch_add_standard_devices();
217 510
511 irq_set_irq_type(irq_pin(0), IRQ_TYPE_LEVEL_LOW);
512
218 if (IS_ENABLED(CONFIG_PHYLIB)) 513 if (IS_ENABLED(CONFIG_PHYLIB))
219 phy_register_fixup_for_id("r8a7791-ether-ff:01", 514 phy_register_fixup_for_id("r8a7791-ether-ff:01",
220 koelsch_ksz8041_fixup); 515 koelsch_ksz8041_fixup);
diff --git a/arch/arm/mach-shmobile/board-kzm9d-reference.c b/arch/arm/mach-shmobile/board-kzm9d-reference.c
deleted file mode 100644
index 054d8d5c8fc1..000000000000
--- a/arch/arm/mach-shmobile/board-kzm9d-reference.c
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * kzm9d board support - Reference DT implementation
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Magnus Damm
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/init.h>
22#include <linux/of_platform.h>
23#include <mach/emev2.h>
24#include <mach/common.h>
25#include <asm/mach/arch.h>
26
27static void __init kzm9d_add_standard_devices(void)
28{
29 if (!IS_ENABLED(CONFIG_COMMON_CLK))
30 emev2_clock_init();
31
32 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
33}
34
35static const char *kzm9d_boards_compat_dt[] __initdata = {
36 "renesas,kzm9d",
37 "renesas,kzm9d-reference",
38 NULL,
39};
40
41DT_MACHINE_START(KZM9D_DT, "kzm9d")
42 .smp = smp_ops(emev2_smp_ops),
43 .map_io = emev2_map_io,
44 .init_early = emev2_init_delay,
45 .init_machine = kzm9d_add_standard_devices,
46 .init_late = shmobile_init_late,
47 .dt_compat = kzm9d_boards_compat_dt,
48MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index bc40b853ffd3..03dc3ac84502 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -589,14 +589,12 @@ static struct asoc_simple_card_info fsi2_ak4648_info = {
589 .card = "FSI2A-AK4648", 589 .card = "FSI2A-AK4648",
590 .codec = "ak4642-codec.0-0012", 590 .codec = "ak4642-codec.0-0012",
591 .platform = "sh_fsi2", 591 .platform = "sh_fsi2",
592 .daifmt = SND_SOC_DAIFMT_LEFT_J, 592 .daifmt = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBM_CFM,
593 .cpu_dai = { 593 .cpu_dai = {
594 .name = "fsia-dai", 594 .name = "fsia-dai",
595 .fmt = SND_SOC_DAIFMT_CBS_CFS,
596 }, 595 },
597 .codec_dai = { 596 .codec_dai = {
598 .name = "ak4642-hifi", 597 .name = "ak4642-hifi",
599 .fmt = SND_SOC_DAIFMT_CBM_CFM,
600 .sysclk = 11289600, 598 .sysclk = 11289600,
601 }, 599 },
602}; 600};
diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
index a6e271d92af0..440aac36d693 100644
--- a/arch/arm/mach-shmobile/board-lager-reference.c
+++ b/arch/arm/mach-shmobile/board-lager-reference.c
@@ -20,47 +20,116 @@
20 20
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/clkdev.h> 22#include <linux/clkdev.h>
23#include <linux/dma-mapping.h>
23#include <linux/init.h> 24#include <linux/init.h>
24#include <linux/of_platform.h> 25#include <linux/of_platform.h>
26#include <linux/platform_data/rcar-du.h>
25#include <mach/common.h> 27#include <mach/common.h>
28#include <mach/irqs.h>
26#include <mach/rcar-gen2.h> 29#include <mach/rcar-gen2.h>
27#include <mach/r8a7790.h> 30#include <mach/r8a7790.h>
28#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
29 32
33/* DU */
34static struct rcar_du_encoder_data lager_du_encoders[] = {
35 {
36 .type = RCAR_DU_ENCODER_VGA,
37 .output = RCAR_DU_OUTPUT_DPAD0,
38 }, {
39 .type = RCAR_DU_ENCODER_NONE,
40 .output = RCAR_DU_OUTPUT_LVDS1,
41 .connector.lvds.panel = {
42 .width_mm = 210,
43 .height_mm = 158,
44 .mode = {
45 .clock = 65000,
46 .hdisplay = 1024,
47 .hsync_start = 1048,
48 .hsync_end = 1184,
49 .htotal = 1344,
50 .vdisplay = 768,
51 .vsync_start = 771,
52 .vsync_end = 777,
53 .vtotal = 806,
54 .flags = 0,
55 },
56 },
57 },
58};
59
60static struct rcar_du_platform_data lager_du_pdata = {
61 .encoders = lager_du_encoders,
62 .num_encoders = ARRAY_SIZE(lager_du_encoders),
63};
64
65static const struct resource du_resources[] __initconst = {
66 DEFINE_RES_MEM(0xfeb00000, 0x70000),
67 DEFINE_RES_MEM_NAMED(0xfeb90000, 0x1c, "lvds.0"),
68 DEFINE_RES_MEM_NAMED(0xfeb94000, 0x1c, "lvds.1"),
69 DEFINE_RES_IRQ(gic_spi(256)),
70 DEFINE_RES_IRQ(gic_spi(268)),
71 DEFINE_RES_IRQ(gic_spi(269)),
72};
73
74static void __init lager_add_du_device(void)
75{
76 struct platform_device_info info = {
77 .name = "rcar-du-r8a7790",
78 .id = -1,
79 .res = du_resources,
80 .num_res = ARRAY_SIZE(du_resources),
81 .data = &lager_du_pdata,
82 .size_data = sizeof(lager_du_pdata),
83 .dma_mask = DMA_BIT_MASK(32),
84 };
85
86 platform_device_register_full(&info);
87}
88
30static void __init lager_add_standard_devices(void) 89static void __init lager_add_standard_devices(void)
31{ 90{
32#ifdef CONFIG_COMMON_CLK
33 /* 91 /*
34 * This is a really crude hack to provide clkdev support to the SCIF 92 * This is a really crude hack to provide clkdev support to platform
35 * and CMT devices until they get moved to DT. 93 * devices until they get moved to DT.
36 */ 94 */
37 static const char * const scif_names[] = { 95 static const struct clk_name {
38 "scifa0", "scifa1", "scifb0", "scifb1", 96 const char *clk;
39 "scifb2", "scifa2", "scif0", "scif1", 97 const char *con_id;
40 "hscif0", "hscif1", 98 const char *dev_id;
99 } clk_names[] = {
100 { "cmt0", NULL, "sh_cmt.0" },
101 { "scifa0", NULL, "sh-sci.0" },
102 { "scifa1", NULL, "sh-sci.1" },
103 { "scifb0", NULL, "sh-sci.2" },
104 { "scifb1", NULL, "sh-sci.3" },
105 { "scifb2", NULL, "sh-sci.4" },
106 { "scifa2", NULL, "sh-sci.5" },
107 { "scif0", NULL, "sh-sci.6" },
108 { "scif1", NULL, "sh-sci.7" },
109 { "hscif0", NULL, "sh-sci.8" },
110 { "hscif1", NULL, "sh-sci.9" },
111 { "du0", "du.0", "rcar-du-r8a7790" },
112 { "du1", "du.1", "rcar-du-r8a7790" },
113 { "du2", "du.2", "rcar-du-r8a7790" },
114 { "lvds0", "lvds.0", "rcar-du-r8a7790" },
115 { "lvds1", "lvds.1", "rcar-du-r8a7790" },
41 }; 116 };
42 struct clk *clk; 117 struct clk *clk;
43 unsigned int i; 118 unsigned int i;
44 119
45 for (i = 0; i < ARRAY_SIZE(scif_names); ++i) { 120 for (i = 0; i < ARRAY_SIZE(clk_names); ++i) {
46 clk = clk_get(NULL, scif_names[i]); 121 clk = clk_get(NULL, clk_names[i].clk);
47 if (clk) { 122 if (!IS_ERR(clk)) {
48 clk_register_clkdev(clk, NULL, "sh-sci.%u", i); 123 clk_register_clkdev(clk, clk_names[i].con_id,
124 clk_names[i].dev_id);
49 clk_put(clk); 125 clk_put(clk);
50 } 126 }
51 } 127 }
52 128
53 clk = clk_get(NULL, "cmt0");
54 if (clk) {
55 clk_register_clkdev(clk, NULL, "sh_cmt.0");
56 clk_put(clk);
57 }
58#else
59 r8a7790_clock_init();
60#endif
61
62 r8a7790_add_dt_devices(); 129 r8a7790_add_dt_devices();
63 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 130 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
131
132 lager_add_du_device();
64} 133}
65 134
66static const char *lager_boards_compat_dt[] __initdata = { 135static const char *lager_boards_compat_dt[] __initdata = {
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index f20c10a18543..f0104bfe544e 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -1,8 +1,9 @@
1/* 1/*
2 * Lager board support 2 * Lager board support
3 * 3 *
4 * Copyright (C) 2013 Renesas Solutions Corp. 4 * Copyright (C) 2013-2014 Renesas Solutions Corp.
5 * Copyright (C) 2013 Magnus Damm 5 * Copyright (C) 2013 Magnus Damm
6 * Copyright (C) 2014 Cogent Embedded, Inc.
6 * 7 *
7 * 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
8 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -20,15 +21,21 @@
20 21
21#include <linux/gpio.h> 22#include <linux/gpio.h>
22#include <linux/gpio_keys.h> 23#include <linux/gpio_keys.h>
24#include <linux/i2c.h>
23#include <linux/input.h> 25#include <linux/input.h>
24#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/irq.h>
25#include <linux/kernel.h> 28#include <linux/kernel.h>
26#include <linux/leds.h> 29#include <linux/leds.h>
30#include <linux/mfd/tmio.h>
27#include <linux/mmc/host.h> 31#include <linux/mmc/host.h>
28#include <linux/mmc/sh_mmcif.h> 32#include <linux/mmc/sh_mmcif.h>
33#include <linux/mmc/sh_mobile_sdhi.h>
29#include <linux/pinctrl/machine.h> 34#include <linux/pinctrl/machine.h>
35#include <linux/platform_data/camera-rcar.h>
30#include <linux/platform_data/gpio-rcar.h> 36#include <linux/platform_data/gpio-rcar.h>
31#include <linux/platform_data/rcar-du.h> 37#include <linux/platform_data/rcar-du.h>
38#include <linux/platform_data/usb-rcar-gen2-phy.h>
32#include <linux/platform_device.h> 39#include <linux/platform_device.h>
33#include <linux/phy.h> 40#include <linux/phy.h>
34#include <linux/regulator/driver.h> 41#include <linux/regulator/driver.h>
@@ -36,9 +43,12 @@
36#include <linux/regulator/gpio-regulator.h> 43#include <linux/regulator/gpio-regulator.h>
37#include <linux/regulator/machine.h> 44#include <linux/regulator/machine.h>
38#include <linux/sh_eth.h> 45#include <linux/sh_eth.h>
46#include <linux/usb/phy.h>
47#include <linux/usb/renesas_usbhs.h>
39#include <mach/common.h> 48#include <mach/common.h>
40#include <mach/irqs.h> 49#include <mach/irqs.h>
41#include <mach/r8a7790.h> 50#include <mach/r8a7790.h>
51#include <media/soc_camera.h>
42#include <asm/mach-types.h> 52#include <asm/mach-types.h>
43#include <asm/mach/arch.h> 53#include <asm/mach/arch.h>
44#include <linux/mtd/partitions.h> 54#include <linux/mtd/partitions.h>
@@ -46,6 +56,33 @@
46#include <linux/spi/flash.h> 56#include <linux/spi/flash.h>
47#include <linux/spi/rspi.h> 57#include <linux/spi/rspi.h>
48#include <linux/spi/spi.h> 58#include <linux/spi/spi.h>
59#include <sound/rcar_snd.h>
60#include <sound/simple_card.h>
61
62/*
63 * SSI-AK4643
64 *
65 * SW1: 1: AK4643
66 * 2: CN22
67 * 3: ADV7511
68 *
69 * this command is required when playback.
70 *
71 * # amixer set "LINEOUT Mixer DACL" on
72 */
73
74/*
75 * SDHI0 (CN8)
76 *
77 * JP3: pin1
78 * SW20: pin1
79
80 * GP5_24: 1: VDD 3.3V (defult)
81 * 0: VDD 0.0V
82 * GP5_29: 1: VccQ 3.3V (defult)
83 * 0: VccQ 1.8V
84 *
85 */
49 86
50/* DU */ 87/* DU */
51static struct rcar_du_encoder_data lager_du_encoders[] = { 88static struct rcar_du_encoder_data lager_du_encoders[] = {
@@ -228,6 +265,7 @@ static const struct resource mmcif1_resources[] __initconst = {
228/* Ether */ 265/* Ether */
229static const struct sh_eth_plat_data ether_pdata __initconst = { 266static const struct sh_eth_plat_data ether_pdata __initconst = {
230 .phy = 0x1, 267 .phy = 0x1,
268 .phy_irq = irq_pin(0),
231 .edmac_endian = EDMAC_LITTLE_ENDIAN, 269 .edmac_endian = EDMAC_LITTLE_ENDIAN,
232 .phy_interface = PHY_INTERFACE_MODE_RMII, 270 .phy_interface = PHY_INTERFACE_MODE_RMII,
233 .ether_link_active_low = 1, 271 .ether_link_active_low = 1,
@@ -238,6 +276,17 @@ static const struct resource ether_resources[] __initconst = {
238 DEFINE_RES_IRQ(gic_spi(162)), 276 DEFINE_RES_IRQ(gic_spi(162)),
239}; 277};
240 278
279static const struct platform_device_info ether_info __initconst = {
280 .parent = &platform_bus,
281 .name = "r8a7790-ether",
282 .id = -1,
283 .res = ether_resources,
284 .num_res = ARRAY_SIZE(ether_resources),
285 .data = &ether_pdata,
286 .size_data = sizeof(ether_pdata),
287 .dma_mask = DMA_BIT_MASK(32),
288};
289
241/* SPI Flash memory (Spansion S25FL512SAGMFIG11 64Mb) */ 290/* SPI Flash memory (Spansion S25FL512SAGMFIG11 64Mb) */
242static struct mtd_partition spi_flash_part[] = { 291static struct mtd_partition spi_flash_part[] = {
243 /* Reserved for user loader program, read-only */ 292 /* Reserved for user loader program, read-only */
@@ -263,7 +312,7 @@ static struct mtd_partition spi_flash_part[] = {
263 }, 312 },
264}; 313};
265 314
266static struct flash_platform_data spi_flash_data = { 315static const struct flash_platform_data spi_flash_data = {
267 .name = "m25p80", 316 .name = "m25p80",
268 .parts = spi_flash_part, 317 .parts = spi_flash_part,
269 .nr_parts = ARRAY_SIZE(spi_flash_part), 318 .nr_parts = ARRAY_SIZE(spi_flash_part),
@@ -288,9 +337,361 @@ static const struct spi_board_info spi_info[] __initconst = {
288/* QSPI resource */ 337/* QSPI resource */
289static const struct resource qspi_resources[] __initconst = { 338static const struct resource qspi_resources[] __initconst = {
290 DEFINE_RES_MEM(0xe6b10000, 0x1000), 339 DEFINE_RES_MEM(0xe6b10000, 0x1000),
291 DEFINE_RES_IRQ(gic_spi(184)), 340 DEFINE_RES_IRQ_NAMED(gic_spi(184), "mux"),
341};
342
343/* VIN */
344static const struct resource vin_resources[] __initconst = {
345 /* VIN0 */
346 DEFINE_RES_MEM(0xe6ef0000, 0x1000),
347 DEFINE_RES_IRQ(gic_spi(188)),
348 /* VIN1 */
349 DEFINE_RES_MEM(0xe6ef1000, 0x1000),
350 DEFINE_RES_IRQ(gic_spi(189)),
351};
352
353static void __init lager_add_vin_device(unsigned idx,
354 struct rcar_vin_platform_data *pdata)
355{
356 struct platform_device_info vin_info = {
357 .parent = &platform_bus,
358 .name = "r8a7790-vin",
359 .id = idx,
360 .res = &vin_resources[idx * 2],
361 .num_res = 2,
362 .dma_mask = DMA_BIT_MASK(32),
363 .data = pdata,
364 .size_data = sizeof(*pdata),
365 };
366
367 BUG_ON(idx > 1);
368
369 platform_device_register_full(&vin_info);
370}
371
372#define LAGER_CAMERA(idx, name, addr, pdata, flag) \
373static struct i2c_board_info i2c_cam##idx##_device = { \
374 I2C_BOARD_INFO(name, addr), \
375}; \
376 \
377static struct rcar_vin_platform_data vin##idx##_pdata = { \
378 .flags = flag, \
379}; \
380 \
381static struct soc_camera_link cam##idx##_link = { \
382 .bus_id = idx, \
383 .board_info = &i2c_cam##idx##_device, \
384 .i2c_adapter_id = 2, \
385 .module_name = name, \
386 .priv = pdata, \
387}
388
389/* Camera 0 is not currently supported due to adv7612 support missing */
390LAGER_CAMERA(1, "adv7180", 0x20, NULL, RCAR_VIN_BT656);
391
392static void __init lager_add_camera1_device(void)
393{
394 platform_device_register_data(&platform_bus, "soc-camera-pdrv", 1,
395 &cam1_link, sizeof(cam1_link));
396 lager_add_vin_device(1, &vin1_pdata);
397}
398
399/* SATA1 */
400static const struct resource sata1_resources[] __initconst = {
401 DEFINE_RES_MEM(0xee500000, 0x2000),
402 DEFINE_RES_IRQ(gic_spi(106)),
403};
404
405static const struct platform_device_info sata1_info __initconst = {
406 .parent = &platform_bus,
407 .name = "sata-r8a7790",
408 .id = 1,
409 .res = sata1_resources,
410 .num_res = ARRAY_SIZE(sata1_resources),
411 .dma_mask = DMA_BIT_MASK(32),
412};
413
414/* USBHS */
415static const struct resource usbhs_resources[] __initconst = {
416 DEFINE_RES_MEM(0xe6590000, 0x100),
417 DEFINE_RES_IRQ(gic_spi(107)),
418};
419
420struct usbhs_private {
421 struct renesas_usbhs_platform_info info;
422 struct usb_phy *phy;
423};
424
425#define usbhs_get_priv(pdev) \
426 container_of(renesas_usbhs_get_info(pdev), struct usbhs_private, info)
427
428static int usbhs_power_ctrl(struct platform_device *pdev,
429 void __iomem *base, int enable)
430{
431 struct usbhs_private *priv = usbhs_get_priv(pdev);
432
433 if (!priv->phy)
434 return -ENODEV;
435
436 if (enable) {
437 int retval = usb_phy_init(priv->phy);
438
439 if (!retval)
440 retval = usb_phy_set_suspend(priv->phy, 0);
441 return retval;
442 }
443
444 usb_phy_set_suspend(priv->phy, 1);
445 usb_phy_shutdown(priv->phy);
446 return 0;
447}
448
449static int usbhs_hardware_init(struct platform_device *pdev)
450{
451 struct usbhs_private *priv = usbhs_get_priv(pdev);
452 struct usb_phy *phy;
453 int ret;
454
455 /* USB0 Function - use PWEN as GPIO input to detect DIP Switch SW5
456 * setting to avoid VBUS short circuit due to wrong cable.
457 * PWEN should be pulled up high if USB Function is selected by SW5
458 */
459 gpio_request_one(RCAR_GP_PIN(5, 18), GPIOF_IN, NULL); /* USB0_PWEN */
460 if (!gpio_get_value(RCAR_GP_PIN(5, 18))) {
461 pr_warn("Error: USB Function not selected - check SW5 + SW6\n");
462 ret = -ENOTSUPP;
463 goto error;
464 }
465
466 phy = usb_get_phy_dev(&pdev->dev, 0);
467 if (IS_ERR(phy)) {
468 ret = PTR_ERR(phy);
469 goto error;
470 }
471
472 priv->phy = phy;
473 return 0;
474 error:
475 gpio_free(RCAR_GP_PIN(5, 18));
476 return ret;
477}
478
479static int usbhs_hardware_exit(struct platform_device *pdev)
480{
481 struct usbhs_private *priv = usbhs_get_priv(pdev);
482
483 if (!priv->phy)
484 return 0;
485
486 usb_put_phy(priv->phy);
487 priv->phy = NULL;
488
489 gpio_free(RCAR_GP_PIN(5, 18));
490 return 0;
491}
492
493static int usbhs_get_id(struct platform_device *pdev)
494{
495 return USBHS_GADGET;
496}
497
498static u32 lager_usbhs_pipe_type[] = {
499 USB_ENDPOINT_XFER_CONTROL,
500 USB_ENDPOINT_XFER_ISOC,
501 USB_ENDPOINT_XFER_ISOC,
502 USB_ENDPOINT_XFER_BULK,
503 USB_ENDPOINT_XFER_BULK,
504 USB_ENDPOINT_XFER_BULK,
505 USB_ENDPOINT_XFER_INT,
506 USB_ENDPOINT_XFER_INT,
507 USB_ENDPOINT_XFER_INT,
508 USB_ENDPOINT_XFER_BULK,
509 USB_ENDPOINT_XFER_BULK,
510 USB_ENDPOINT_XFER_BULK,
511 USB_ENDPOINT_XFER_BULK,
512 USB_ENDPOINT_XFER_BULK,
513 USB_ENDPOINT_XFER_BULK,
514 USB_ENDPOINT_XFER_BULK,
292}; 515};
293 516
517static struct usbhs_private usbhs_priv __initdata = {
518 .info = {
519 .platform_callback = {
520 .power_ctrl = usbhs_power_ctrl,
521 .hardware_init = usbhs_hardware_init,
522 .hardware_exit = usbhs_hardware_exit,
523 .get_id = usbhs_get_id,
524 },
525 .driver_param = {
526 .buswait_bwait = 4,
527 .pipe_type = lager_usbhs_pipe_type,
528 .pipe_size = ARRAY_SIZE(lager_usbhs_pipe_type),
529 },
530 }
531};
532
533static void __init lager_register_usbhs(void)
534{
535 usb_bind_phy("renesas_usbhs", 0, "usb_phy_rcar_gen2");
536 platform_device_register_resndata(&platform_bus,
537 "renesas_usbhs", -1,
538 usbhs_resources,
539 ARRAY_SIZE(usbhs_resources),
540 &usbhs_priv.info,
541 sizeof(usbhs_priv.info));
542}
543
544/* USBHS PHY */
545static const struct rcar_gen2_phy_platform_data usbhs_phy_pdata __initconst = {
546 .chan0_pci = 0, /* Channel 0 is USBHS */
547 .chan2_pci = 1, /* Channel 2 is PCI USB */
548};
549
550static const struct resource usbhs_phy_resources[] __initconst = {
551 DEFINE_RES_MEM(0xe6590100, 0x100),
552};
553
554/* I2C */
555static struct i2c_board_info i2c2_devices[] = {
556 {
557 I2C_BOARD_INFO("ak4643", 0x12),
558 }
559};
560
561/* Sound */
562static struct resource rsnd_resources[] __initdata = {
563 [RSND_GEN2_SCU] = DEFINE_RES_MEM(0xec500000, 0x1000),
564 [RSND_GEN2_ADG] = DEFINE_RES_MEM(0xec5a0000, 0x100),
565 [RSND_GEN2_SSIU] = DEFINE_RES_MEM(0xec540000, 0x1000),
566 [RSND_GEN2_SSI] = DEFINE_RES_MEM(0xec541000, 0x1280),
567};
568
569static struct rsnd_ssi_platform_info rsnd_ssi[] = {
570 RSND_SSI_SET(0, 0, gic_spi(370), RSND_SSI_PLAY),
571 RSND_SSI_SET(0, 0, gic_spi(371), RSND_SSI_CLK_PIN_SHARE),
572};
573
574static struct rsnd_scu_platform_info rsnd_scu[2] = {
575 /* no member at this point */
576};
577
578static struct rcar_snd_info rsnd_info = {
579 .flags = RSND_GEN2,
580 .ssi_info = rsnd_ssi,
581 .ssi_info_nr = ARRAY_SIZE(rsnd_ssi),
582 .scu_info = rsnd_scu,
583 .scu_info_nr = ARRAY_SIZE(rsnd_scu),
584};
585
586static struct asoc_simple_card_info rsnd_card_info = {
587 .name = "AK4643",
588 .card = "SSI01-AK4643",
589 .codec = "ak4642-codec.2-0012",
590 .platform = "rcar_sound",
591 .daifmt = SND_SOC_DAIFMT_LEFT_J,
592 .cpu_dai = {
593 .name = "rcar_sound",
594 .fmt = SND_SOC_DAIFMT_CBS_CFS,
595 },
596 .codec_dai = {
597 .name = "ak4642-hifi",
598 .fmt = SND_SOC_DAIFMT_CBM_CFM,
599 .sysclk = 11289600,
600 },
601};
602
603static void __init lager_add_rsnd_device(void)
604{
605 struct platform_device_info cardinfo = {
606 .parent = &platform_bus,
607 .name = "asoc-simple-card",
608 .id = -1,
609 .data = &rsnd_card_info,
610 .size_data = sizeof(struct asoc_simple_card_info),
611 .dma_mask = DMA_BIT_MASK(32),
612 };
613
614 i2c_register_board_info(2, i2c2_devices,
615 ARRAY_SIZE(i2c2_devices));
616
617 platform_device_register_resndata(
618 &platform_bus, "rcar_sound", -1,
619 rsnd_resources, ARRAY_SIZE(rsnd_resources),
620 &rsnd_info, sizeof(rsnd_info));
621
622 platform_device_register_full(&cardinfo);
623}
624
625/* SDHI0 */
626static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
627 .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
628 MMC_CAP_POWER_OFF_CARD,
629 .tmio_caps2 = MMC_CAP2_NO_MULTI_READ,
630 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT |
631 TMIO_MMC_WRPROTECT_DISABLE,
632};
633
634static struct resource sdhi0_resources[] __initdata = {
635 DEFINE_RES_MEM(0xee100000, 0x200),
636 DEFINE_RES_IRQ(gic_spi(165)),
637};
638
639/* SDHI2 */
640static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
641 .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
642 MMC_CAP_POWER_OFF_CARD,
643 .tmio_caps2 = MMC_CAP2_NO_MULTI_READ,
644 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT |
645 TMIO_MMC_WRPROTECT_DISABLE,
646};
647
648static struct resource sdhi2_resources[] __initdata = {
649 DEFINE_RES_MEM(0xee140000, 0x100),
650 DEFINE_RES_IRQ(gic_spi(167)),
651};
652
653/* Internal PCI1 */
654static const struct resource pci1_resources[] __initconst = {
655 DEFINE_RES_MEM(0xee0b0000, 0x10000), /* CFG */
656 DEFINE_RES_MEM(0xee0a0000, 0x10000), /* MEM */
657 DEFINE_RES_IRQ(gic_spi(112)),
658};
659
660static const struct platform_device_info pci1_info __initconst = {
661 .parent = &platform_bus,
662 .name = "pci-rcar-gen2",
663 .id = 1,
664 .res = pci1_resources,
665 .num_res = ARRAY_SIZE(pci1_resources),
666 .dma_mask = DMA_BIT_MASK(32),
667};
668
669static void __init lager_add_usb1_device(void)
670{
671 platform_device_register_full(&pci1_info);
672}
673
674/* Internal PCI2 */
675static const struct resource pci2_resources[] __initconst = {
676 DEFINE_RES_MEM(0xee0d0000, 0x10000), /* CFG */
677 DEFINE_RES_MEM(0xee0c0000, 0x10000), /* MEM */
678 DEFINE_RES_IRQ(gic_spi(113)),
679};
680
681static const struct platform_device_info pci2_info __initconst = {
682 .parent = &platform_bus,
683 .name = "pci-rcar-gen2",
684 .id = 2,
685 .res = pci2_resources,
686 .num_res = ARRAY_SIZE(pci2_resources),
687 .dma_mask = DMA_BIT_MASK(32),
688};
689
690static void __init lager_add_usb2_device(void)
691{
692 platform_device_register_full(&pci2_info);
693}
694
294static const struct pinctrl_map lager_pinctrl_map[] = { 695static const struct pinctrl_map lager_pinctrl_map[] = {
295 /* DU (CN10: ARGB0, CN13: LVDS) */ 696 /* DU (CN10: ARGB0, CN13: LVDS) */
296 PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790", 697 PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790",
@@ -299,12 +700,43 @@ static const struct pinctrl_map lager_pinctrl_map[] = {
299 "du_sync_1", "du"), 700 "du_sync_1", "du"),
300 PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790", 701 PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790",
301 "du_clk_out_0", "du"), 702 "du_clk_out_0", "du"),
703 /* I2C2 */
704 PIN_MAP_MUX_GROUP_DEFAULT("i2c-rcar.2", "pfc-r8a7790",
705 "i2c2", "i2c2"),
706 /* QSPI */
707 PIN_MAP_MUX_GROUP_DEFAULT("qspi.0", "pfc-r8a7790",
708 "qspi_ctrl", "qspi"),
709 PIN_MAP_MUX_GROUP_DEFAULT("qspi.0", "pfc-r8a7790",
710 "qspi_data4", "qspi"),
302 /* SCIF0 (CN19: DEBUG SERIAL0) */ 711 /* SCIF0 (CN19: DEBUG SERIAL0) */
303 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790", 712 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790",
304 "scif0_data", "scif0"), 713 "scif0_data", "scif0"),
305 /* SCIF1 (CN20: DEBUG SERIAL1) */ 714 /* SCIF1 (CN20: DEBUG SERIAL1) */
306 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.7", "pfc-r8a7790", 715 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.7", "pfc-r8a7790",
307 "scif1_data", "scif1"), 716 "scif1_data", "scif1"),
717 /* SDHI0 */
718 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7790",
719 "sdhi0_data4", "sdhi0"),
720 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7790",
721 "sdhi0_ctrl", "sdhi0"),
722 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7790",
723 "sdhi0_cd", "sdhi0"),
724 /* SDHI2 */
725 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-r8a7790",
726 "sdhi2_data4", "sdhi2"),
727 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-r8a7790",
728 "sdhi2_ctrl", "sdhi2"),
729 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-r8a7790",
730 "sdhi2_cd", "sdhi2"),
731 /* SSI (CN17: sound) */
732 PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7790",
733 "ssi0129_ctrl", "ssi"),
734 PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7790",
735 "ssi0_data", "ssi"),
736 PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7790",
737 "ssi1_data", "ssi"),
738 PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7790",
739 "audio_clk_a", "audio_clk"),
308 /* MMCIF1 */ 740 /* MMCIF1 */
309 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.1", "pfc-r8a7790", 741 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.1", "pfc-r8a7790",
310 "mmc1_data8", "mmc1"), 742 "mmc1_data8", "mmc1"),
@@ -319,6 +751,31 @@ static const struct pinctrl_map lager_pinctrl_map[] = {
319 "eth_rmii", "eth"), 751 "eth_rmii", "eth"),
320 PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-ether", "pfc-r8a7790", 752 PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-ether", "pfc-r8a7790",
321 "intc_irq0", "intc"), 753 "intc_irq0", "intc"),
754 /* VIN0 */
755 PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.0", "pfc-r8a7790",
756 "vin0_data24", "vin0"),
757 PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.0", "pfc-r8a7790",
758 "vin0_sync", "vin0"),
759 PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.0", "pfc-r8a7790",
760 "vin0_field", "vin0"),
761 PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.0", "pfc-r8a7790",
762 "vin0_clkenb", "vin0"),
763 PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.0", "pfc-r8a7790",
764 "vin0_clk", "vin0"),
765 /* VIN1 */
766 PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.1", "pfc-r8a7790",
767 "vin1_data8", "vin1"),
768 PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.1", "pfc-r8a7790",
769 "vin1_clk", "vin1"),
770 /* USB0 */
771 PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs", "pfc-r8a7790",
772 "usb0_ovc_vbus", "usb0"),
773 /* USB1 */
774 PIN_MAP_MUX_GROUP_DEFAULT("pci-rcar-gen2.1", "pfc-r8a7790",
775 "usb1", "usb1"),
776 /* USB2 */
777 PIN_MAP_MUX_GROUP_DEFAULT("pci-rcar-gen2.2", "pfc-r8a7790",
778 "usb2", "usb2"),
322}; 779};
323 780
324static void __init lager_add_standard_devices(void) 781static void __init lager_add_standard_devices(void)
@@ -346,10 +803,7 @@ static void __init lager_add_standard_devices(void)
346 mmcif1_resources, ARRAY_SIZE(mmcif1_resources), 803 mmcif1_resources, ARRAY_SIZE(mmcif1_resources),
347 &mmcif1_pdata, sizeof(mmcif1_pdata)); 804 &mmcif1_pdata, sizeof(mmcif1_pdata));
348 805
349 platform_device_register_resndata(&platform_bus, "r8a7790-ether", -1, 806 platform_device_register_full(&ether_info);
350 ether_resources,
351 ARRAY_SIZE(ether_resources),
352 &ether_pdata, sizeof(ether_pdata));
353 807
354 lager_add_du_device(); 808 lager_add_du_device();
355 809
@@ -368,6 +822,28 @@ static void __init lager_add_standard_devices(void)
368 &vccq_sdhi0_info, sizeof(struct gpio_regulator_config)); 822 &vccq_sdhi0_info, sizeof(struct gpio_regulator_config));
369 platform_device_register_data(&platform_bus, "gpio-regulator", gpio_regulator_idx++, 823 platform_device_register_data(&platform_bus, "gpio-regulator", gpio_regulator_idx++,
370 &vccq_sdhi2_info, sizeof(struct gpio_regulator_config)); 824 &vccq_sdhi2_info, sizeof(struct gpio_regulator_config));
825
826 lager_add_camera1_device();
827
828 platform_device_register_full(&sata1_info);
829
830 platform_device_register_resndata(&platform_bus, "usb_phy_rcar_gen2",
831 -1, usbhs_phy_resources,
832 ARRAY_SIZE(usbhs_phy_resources),
833 &usbhs_phy_pdata,
834 sizeof(usbhs_phy_pdata));
835 lager_register_usbhs();
836 lager_add_usb1_device();
837 lager_add_usb2_device();
838
839 lager_add_rsnd_device();
840
841 platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 0,
842 sdhi0_resources, ARRAY_SIZE(sdhi0_resources),
843 &sdhi0_info, sizeof(struct sh_mobile_sdhi_info));
844 platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 2,
845 sdhi2_resources, ARRAY_SIZE(sdhi2_resources),
846 &sdhi2_info, sizeof(struct sh_mobile_sdhi_info));
371} 847}
372 848
373/* 849/*
@@ -391,6 +867,8 @@ static void __init lager_init(void)
391{ 867{
392 lager_add_standard_devices(); 868 lager_add_standard_devices();
393 869
870 irq_set_irq_type(irq_pin(0), IRQ_TYPE_LEVEL_LOW);
871
394 if (IS_ENABLED(CONFIG_PHYLIB)) 872 if (IS_ENABLED(CONFIG_PHYLIB))
395 phy_register_fixup_for_id("r8a7790-ether-ff:01", 873 phy_register_fixup_for_id("r8a7790-ether-ff:01",
396 lager_ksz8041_fixup); 874 lager_ksz8041_fixup);
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 3aba0372f630..0ff4d8e45cf7 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -509,9 +509,9 @@ static struct asoc_simple_card_info fsi2_hdmi_info = {
509 .card = "FSI2B-HDMI", 509 .card = "FSI2B-HDMI",
510 .codec = "sh-mobile-hdmi", 510 .codec = "sh-mobile-hdmi",
511 .platform = "sh_fsi2", 511 .platform = "sh_fsi2",
512 .daifmt = SND_SOC_DAIFMT_CBS_CFS,
512 .cpu_dai = { 513 .cpu_dai = {
513 .name = "fsib-dai", 514 .name = "fsib-dai",
514 .fmt = SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_IB_NF,
515 }, 515 },
516 .codec_dai = { 516 .codec_dai = {
517 .name = "sh_mobile_hdmi-hifi", 517 .name = "sh_mobile_hdmi-hifi",
@@ -905,14 +905,12 @@ static struct asoc_simple_card_info fsi2_ak4643_info = {
905 .card = "FSI2A-AK4643", 905 .card = "FSI2A-AK4643",
906 .codec = "ak4642-codec.0-0013", 906 .codec = "ak4642-codec.0-0013",
907 .platform = "sh_fsi2", 907 .platform = "sh_fsi2",
908 .daifmt = SND_SOC_DAIFMT_LEFT_J, 908 .daifmt = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBM_CFM,
909 .cpu_dai = { 909 .cpu_dai = {
910 .name = "fsia-dai", 910 .name = "fsia-dai",
911 .fmt = SND_SOC_DAIFMT_CBS_CFS,
912 }, 911 },
913 .codec_dai = { 912 .codec_dai = {
914 .name = "ak4642-hifi", 913 .name = "ak4642-hifi",
915 .fmt = SND_SOC_DAIFMT_CBM_CFM,
916 .sysclk = 11289600, 914 .sysclk = 11289600,
917 }, 915 },
918}; 916};
diff --git a/arch/arm/mach-shmobile/clock-r7s72100.c b/arch/arm/mach-shmobile/clock-r7s72100.c
index e6ab0cd5b286..bee0073c9b64 100644
--- a/arch/arm/mach-shmobile/clock-r7s72100.c
+++ b/arch/arm/mach-shmobile/clock-r7s72100.c
@@ -22,12 +22,15 @@
22#include <mach/common.h> 22#include <mach/common.h>
23#include <mach/r7s72100.h> 23#include <mach/r7s72100.h>
24 24
25/* registers */ 25/* Frequency Control Registers */
26#define FRQCR 0xfcfe0010 26#define FRQCR 0xfcfe0010
27#define FRQCR2 0xfcfe0014 27#define FRQCR2 0xfcfe0014
28/* Standby Control Registers */
28#define STBCR3 0xfcfe0420 29#define STBCR3 0xfcfe0420
29#define STBCR4 0xfcfe0424 30#define STBCR4 0xfcfe0424
31#define STBCR7 0xfcfe0430
30#define STBCR9 0xfcfe0438 32#define STBCR9 0xfcfe0438
33#define STBCR10 0xfcfe043c
31 34
32#define PLL_RATE 30 35#define PLL_RATE 30
33 36
@@ -67,7 +70,7 @@ static struct clk pll_clk = {
67 70
68static unsigned long bus_recalc(struct clk *clk) 71static unsigned long bus_recalc(struct clk *clk)
69{ 72{
70 return clk->parent->rate * 2 / 3; 73 return clk->parent->rate / 3;
71} 74}
72 75
73static struct sh_clk_ops bus_clk_ops = { 76static struct sh_clk_ops bus_clk_ops = {
@@ -145,15 +148,25 @@ struct clk div4_clks[DIV4_NR] = {
145 | CLK_ENABLE_ON_INIT), 148 | CLK_ENABLE_ON_INIT),
146}; 149};
147 150
148enum { MSTP97, MSTP96, MSTP95, MSTP94, 151enum {
152 MSTP107, MSTP106, MSTP105, MSTP104, MSTP103,
153 MSTP97, MSTP96, MSTP95, MSTP94,
154 MSTP74,
149 MSTP47, MSTP46, MSTP45, MSTP44, MSTP43, MSTP42, MSTP41, MSTP40, 155 MSTP47, MSTP46, MSTP45, MSTP44, MSTP43, MSTP42, MSTP41, MSTP40,
150 MSTP33, MSTP_NR }; 156 MSTP33, MSTP_NR
157};
151 158
152static struct clk mstp_clks[MSTP_NR] = { 159static struct clk mstp_clks[MSTP_NR] = {
160 [MSTP107] = SH_CLK_MSTP8(&peripheral1_clk, STBCR10, 7, 0), /* RSPI0 */
161 [MSTP106] = SH_CLK_MSTP8(&peripheral1_clk, STBCR10, 6, 0), /* RSPI1 */
162 [MSTP105] = SH_CLK_MSTP8(&peripheral1_clk, STBCR10, 5, 0), /* RSPI2 */
163 [MSTP104] = SH_CLK_MSTP8(&peripheral1_clk, STBCR10, 4, 0), /* RSPI3 */
164 [MSTP103] = SH_CLK_MSTP8(&peripheral1_clk, STBCR10, 3, 0), /* RSPI4 */
153 [MSTP97] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 7, 0), /* RIIC0 */ 165 [MSTP97] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 7, 0), /* RIIC0 */
154 [MSTP96] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 6, 0), /* RIIC1 */ 166 [MSTP96] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 6, 0), /* RIIC1 */
155 [MSTP95] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 5, 0), /* RIIC2 */ 167 [MSTP95] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 5, 0), /* RIIC2 */
156 [MSTP94] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 4, 0), /* RIIC3 */ 168 [MSTP94] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 4, 0), /* RIIC3 */
169 [MSTP74] = SH_CLK_MSTP8(&peripheral1_clk, STBCR7, 4, 0), /* Ether */
157 [MSTP47] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 7, 0), /* SCIF0 */ 170 [MSTP47] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 7, 0), /* SCIF0 */
158 [MSTP46] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 6, 0), /* SCIF1 */ 171 [MSTP46] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 6, 0), /* SCIF1 */
159 [MSTP45] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 5, 0), /* SCIF2 */ 172 [MSTP45] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 5, 0), /* SCIF2 */
@@ -176,6 +189,21 @@ static struct clk_lookup lookups[] = {
176 CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]), 189 CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
177 190
178 /* MSTP clocks */ 191 /* MSTP clocks */
192 CLKDEV_DEV_ID("rspi-rz.0", &mstp_clks[MSTP107]),
193 CLKDEV_DEV_ID("rspi-rz.1", &mstp_clks[MSTP106]),
194 CLKDEV_DEV_ID("rspi-rz.2", &mstp_clks[MSTP105]),
195 CLKDEV_DEV_ID("rspi-rz.3", &mstp_clks[MSTP104]),
196 CLKDEV_DEV_ID("rspi-rz.4", &mstp_clks[MSTP103]),
197 CLKDEV_DEV_ID("e800c800.spi", &mstp_clks[MSTP107]),
198 CLKDEV_DEV_ID("e800d000.spi", &mstp_clks[MSTP106]),
199 CLKDEV_DEV_ID("e800d800.spi", &mstp_clks[MSTP105]),
200 CLKDEV_DEV_ID("e800e000.spi", &mstp_clks[MSTP104]),
201 CLKDEV_DEV_ID("e800e800.spi", &mstp_clks[MSTP103]),
202 CLKDEV_DEV_ID("fcfee000.i2c", &mstp_clks[MSTP97]),
203 CLKDEV_DEV_ID("fcfee400.i2c", &mstp_clks[MSTP96]),
204 CLKDEV_DEV_ID("fcfee800.i2c", &mstp_clks[MSTP95]),
205 CLKDEV_DEV_ID("fcfeec00.i2c", &mstp_clks[MSTP94]),
206 CLKDEV_DEV_ID("r7s72100-ether", &mstp_clks[MSTP74]),
179 CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP33]), 207 CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP33]),
180 208
181 /* ICK */ 209 /* ICK */
diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c
index 9783945f8bc7..2009a9bc6356 100644
--- a/arch/arm/mach-shmobile/clock-r8a7778.c
+++ b/arch/arm/mach-shmobile/clock-r8a7778.c
@@ -221,6 +221,10 @@ static struct clk_lookup lookups[] = {
221 CLKDEV_DEV_ID("fffc6000.spi", &mstp_clks[MSTP007]), /* HSPI2 */ 221 CLKDEV_DEV_ID("fffc6000.spi", &mstp_clks[MSTP007]), /* HSPI2 */
222 CLKDEV_DEV_ID("rcar_sound", &mstp_clks[MSTP008]), /* SRU */ 222 CLKDEV_DEV_ID("rcar_sound", &mstp_clks[MSTP008]), /* SRU */
223 223
224 CLKDEV_ICK_ID("clk_a", "rcar_sound", &audio_clk_a),
225 CLKDEV_ICK_ID("clk_b", "rcar_sound", &audio_clk_b),
226 CLKDEV_ICK_ID("clk_c", "rcar_sound", &audio_clk_c),
227 CLKDEV_ICK_ID("clk_i", "rcar_sound", &s1_clk),
224 CLKDEV_ICK_ID("ssi.0", "rcar_sound", &mstp_clks[MSTP012]), 228 CLKDEV_ICK_ID("ssi.0", "rcar_sound", &mstp_clks[MSTP012]),
225 CLKDEV_ICK_ID("ssi.1", "rcar_sound", &mstp_clks[MSTP011]), 229 CLKDEV_ICK_ID("ssi.1", "rcar_sound", &mstp_clks[MSTP011]),
226 CLKDEV_ICK_ID("ssi.2", "rcar_sound", &mstp_clks[MSTP010]), 230 CLKDEV_ICK_ID("ssi.2", "rcar_sound", &mstp_clks[MSTP010]),
diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
index f1fb89b76786..8e403ae0c7b2 100644
--- a/arch/arm/mach-shmobile/clock-r8a7779.c
+++ b/arch/arm/mach-shmobile/clock-r8a7779.c
@@ -47,17 +47,10 @@
47 47
48#define MD(nr) BIT(nr) 48#define MD(nr) BIT(nr)
49 49
50#define FRQMR IOMEM(0xffc80014)
51#define MSTPCR0 IOMEM(0xffc80030) 50#define MSTPCR0 IOMEM(0xffc80030)
52#define MSTPCR1 IOMEM(0xffc80034) 51#define MSTPCR1 IOMEM(0xffc80034)
53#define MSTPCR3 IOMEM(0xffc8003c) 52#define MSTPCR3 IOMEM(0xffc8003c)
54#define MSTPSR1 IOMEM(0xffc80044) 53#define MSTPSR1 IOMEM(0xffc80044)
55#define MSTPSR4 IOMEM(0xffc80048)
56#define MSTPSR6 IOMEM(0xffc8004c)
57#define MSTPCR4 IOMEM(0xffc80050)
58#define MSTPCR5 IOMEM(0xffc80054)
59#define MSTPCR6 IOMEM(0xffc80058)
60#define MSTPCR7 IOMEM(0xffc80040)
61 54
62#define MODEMR 0xffcc0020 55#define MODEMR 0xffcc0020
63 56
@@ -127,16 +120,16 @@ static struct clk mstp_clks[MSTP_NR] = {
127 [MSTP322] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 22, 0), /* SDHI1 */ 120 [MSTP322] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 22, 0), /* SDHI1 */
128 [MSTP321] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 21, 0), /* SDHI2 */ 121 [MSTP321] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 21, 0), /* SDHI2 */
129 [MSTP320] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 20, 0), /* SDHI3 */ 122 [MSTP320] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 20, 0), /* SDHI3 */
130 [MSTP120] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 20, 0), /* VIN3 */ 123 [MSTP120] = SH_CLK_MSTP32_STS(&clks_clk, MSTPCR1, 20, MSTPSR1, 0), /* VIN3 */
131 [MSTP116] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 16, 0), /* PCIe */ 124 [MSTP116] = SH_CLK_MSTP32_STS(&clkp_clk, MSTPCR1, 16, MSTPSR1, 0), /* PCIe */
132 [MSTP115] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 15, 0), /* SATA */ 125 [MSTP115] = SH_CLK_MSTP32_STS(&clkp_clk, MSTPCR1, 15, MSTPSR1, 0), /* SATA */
133 [MSTP114] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 14, 0), /* Ether */ 126 [MSTP114] = SH_CLK_MSTP32_STS(&clkp_clk, MSTPCR1, 14, MSTPSR1, 0), /* Ether */
134 [MSTP110] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 10, 0), /* VIN0 */ 127 [MSTP110] = SH_CLK_MSTP32_STS(&clks_clk, MSTPCR1, 10, MSTPSR1, 0), /* VIN0 */
135 [MSTP109] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 9, 0), /* VIN1 */ 128 [MSTP109] = SH_CLK_MSTP32_STS(&clks_clk, MSTPCR1, 9, MSTPSR1, 0), /* VIN1 */
136 [MSTP108] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 8, 0), /* VIN2 */ 129 [MSTP108] = SH_CLK_MSTP32_STS(&clks_clk, MSTPCR1, 8, MSTPSR1, 0), /* VIN2 */
137 [MSTP103] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 3, 0), /* DU */ 130 [MSTP103] = SH_CLK_MSTP32_STS(&clks_clk, MSTPCR1, 3, MSTPSR1, 0), /* DU */
138 [MSTP101] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 1, 0), /* USB2 */ 131 [MSTP101] = SH_CLK_MSTP32_STS(&clkp_clk, MSTPCR1, 1, MSTPSR1, 0), /* USB2 */
139 [MSTP100] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 0, 0), /* USB0/1 */ 132 [MSTP100] = SH_CLK_MSTP32_STS(&clkp_clk, MSTPCR1, 0, MSTPSR1, 0), /* USB0/1 */
140 [MSTP030] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 30, 0), /* I2C0 */ 133 [MSTP030] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 30, 0), /* I2C0 */
141 [MSTP029] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 29, 0), /* I2C1 */ 134 [MSTP029] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 29, 0), /* I2C1 */
142 [MSTP028] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 28, 0), /* I2C2 */ 135 [MSTP028] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 28, 0), /* I2C2 */
diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
index f44987a92ad4..3f93503f5b96 100644
--- a/arch/arm/mach-shmobile/clock-r8a7790.c
+++ b/arch/arm/mach-shmobile/clock-r8a7790.c
@@ -43,17 +43,26 @@
43 * see "p1 / 2" on R8A7790_CLOCK_ROOT() below 43 * see "p1 / 2" on R8A7790_CLOCK_ROOT() below
44 */ 44 */
45 45
46#define CPG_BASE 0xe6150000 46#define CPG_BASE 0xe6150000
47#define CPG_LEN 0x1000 47#define CPG_LEN 0x1000
48 48
49#define SMSTPCR1 0xe6150134 49#define SMSTPCR1 0xe6150134
50#define SMSTPCR2 0xe6150138 50#define SMSTPCR2 0xe6150138
51#define SMSTPCR3 0xe615013c 51#define SMSTPCR3 0xe615013c
52#define SMSTPCR5 0xe6150144 52#define SMSTPCR5 0xe6150144
53#define SMSTPCR7 0xe615014c 53#define SMSTPCR7 0xe615014c
54#define SMSTPCR8 0xe6150990 54#define SMSTPCR8 0xe6150990
55#define SMSTPCR9 0xe6150994 55#define SMSTPCR9 0xe6150994
56#define SMSTPCR10 0xe6150998 56#define SMSTPCR10 0xe6150998
57
58#define MSTPSR1 IOMEM(0xe6150038)
59#define MSTPSR2 IOMEM(0xe6150040)
60#define MSTPSR3 IOMEM(0xe6150048)
61#define MSTPSR5 IOMEM(0xe615003c)
62#define MSTPSR7 IOMEM(0xe61501c4)
63#define MSTPSR8 IOMEM(0xe61509a0)
64#define MSTPSR9 IOMEM(0xe61509a4)
65#define MSTPSR10 IOMEM(0xe61509a8)
57 66
58#define SDCKCR 0xE6150074 67#define SDCKCR 0xE6150074
59#define SD2CKCR 0xE6150078 68#define SD2CKCR 0xE6150078
@@ -82,6 +91,15 @@ static struct clk main_clk = {
82 .ops = &followparent_clk_ops, 91 .ops = &followparent_clk_ops,
83}; 92};
84 93
94static struct clk audio_clk_a = {
95};
96
97static struct clk audio_clk_b = {
98};
99
100static struct clk audio_clk_c = {
101};
102
85/* 103/*
86 * clock ratio of these clock will be updated 104 * clock ratio of these clock will be updated
87 * on r8a7790_clock_init() 105 * on r8a7790_clock_init()
@@ -115,6 +133,9 @@ SH_FIXED_RATIO_CLK_SET(ddr_clk, pll3_clk, 1, 8);
115SH_FIXED_RATIO_CLK_SET(mp_clk, pll1_div2_clk, 1, 15); 133SH_FIXED_RATIO_CLK_SET(mp_clk, pll1_div2_clk, 1, 15);
116 134
117static struct clk *main_clks[] = { 135static struct clk *main_clks[] = {
136 &audio_clk_a,
137 &audio_clk_b,
138 &audio_clk_c,
118 &extal_clk, 139 &extal_clk,
119 &extal_div2_clk, 140 &extal_div2_clk,
120 &main_clk, 141 &main_clk,
@@ -183,15 +204,22 @@ static struct clk div6_clks[DIV6_NR] = {
183 204
184/* MSTP */ 205/* MSTP */
185enum { 206enum {
207 MSTP1017, /* parent of SCU */
208
209 MSTP1031, MSTP1030,
210 MSTP1029, MSTP1028, MSTP1027, MSTP1026, MSTP1025, MSTP1024, MSTP1023, MSTP1022,
186 MSTP1015, MSTP1014, MSTP1013, MSTP1012, MSTP1011, MSTP1010, 211 MSTP1015, MSTP1014, MSTP1013, MSTP1012, MSTP1011, MSTP1010,
187 MSTP1009, MSTP1008, MSTP1007, MSTP1006, MSTP1005, 212 MSTP1009, MSTP1008, MSTP1007, MSTP1006, MSTP1005,
188 MSTP931, MSTP930, MSTP929, MSTP928, 213 MSTP931, MSTP930, MSTP929, MSTP928,
189 MSTP917, 214 MSTP917,
215 MSTP815, MSTP814,
190 MSTP813, 216 MSTP813,
217 MSTP811, MSTP810, MSTP809, MSTP808,
191 MSTP726, MSTP725, MSTP724, MSTP723, MSTP722, MSTP721, MSTP720, 218 MSTP726, MSTP725, MSTP724, MSTP723, MSTP722, MSTP721, MSTP720,
192 MSTP717, MSTP716, 219 MSTP717, MSTP716,
193 MSTP704, 220 MSTP704, MSTP703,
194 MSTP522, 221 MSTP522,
222 MSTP502, MSTP501,
195 MSTP315, MSTP314, MSTP313, MSTP312, MSTP311, MSTP305, MSTP304, 223 MSTP315, MSTP314, MSTP313, MSTP312, MSTP311, MSTP305, MSTP304,
196 MSTP216, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, 224 MSTP216, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202,
197 MSTP124, 225 MSTP124,
@@ -199,53 +227,77 @@ enum {
199}; 227};
200 228
201static struct clk mstp_clks[MSTP_NR] = { 229static struct clk mstp_clks[MSTP_NR] = {
202 [MSTP1015] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 15, 0), /* SSI0 */ 230 [MSTP1031] = SH_CLK_MSTP32_STS(&mstp_clks[MSTP1017], SMSTPCR10, 31, MSTPSR10, 0), /* SCU0 */
203 [MSTP1014] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 14, 0), /* SSI1 */ 231 [MSTP1030] = SH_CLK_MSTP32_STS(&mstp_clks[MSTP1017], SMSTPCR10, 30, MSTPSR10, 0), /* SCU1 */
204 [MSTP1013] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 13, 0), /* SSI2 */ 232 [MSTP1029] = SH_CLK_MSTP32_STS(&mstp_clks[MSTP1017], SMSTPCR10, 29, MSTPSR10, 0), /* SCU2 */
205 [MSTP1012] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 12, 0), /* SSI3 */ 233 [MSTP1028] = SH_CLK_MSTP32_STS(&mstp_clks[MSTP1017], SMSTPCR10, 28, MSTPSR10, 0), /* SCU3 */
206 [MSTP1011] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 11, 0), /* SSI4 */ 234 [MSTP1027] = SH_CLK_MSTP32_STS(&mstp_clks[MSTP1017], SMSTPCR10, 27, MSTPSR10, 0), /* SCU4 */
207 [MSTP1010] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 10, 0), /* SSI5 */ 235 [MSTP1026] = SH_CLK_MSTP32_STS(&mstp_clks[MSTP1017], SMSTPCR10, 26, MSTPSR10, 0), /* SCU5 */
208 [MSTP1009] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 9, 0), /* SSI6 */ 236 [MSTP1025] = SH_CLK_MSTP32_STS(&mstp_clks[MSTP1017], SMSTPCR10, 25, MSTPSR10, 0), /* SCU6 */
209 [MSTP1008] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 8, 0), /* SSI7 */ 237 [MSTP1024] = SH_CLK_MSTP32_STS(&mstp_clks[MSTP1017], SMSTPCR10, 24, MSTPSR10, 0), /* SCU7 */
210 [MSTP1007] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 7, 0), /* SSI8 */ 238 [MSTP1023] = SH_CLK_MSTP32_STS(&mstp_clks[MSTP1017], SMSTPCR10, 23, MSTPSR10, 0), /* SCU8 */
211 [MSTP1006] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 6, 0), /* SSI9 */ 239 [MSTP1022] = SH_CLK_MSTP32_STS(&mstp_clks[MSTP1017], SMSTPCR10, 22, MSTPSR10, 0), /* SCU9 */
212 [MSTP1005] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 5, 0), /* SSI ALL */ 240 [MSTP1017] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 17, MSTPSR10, 0), /* SCU */
213 [MSTP931] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 31, 0), /* I2C0 */ 241 [MSTP1015] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 15, MSTPSR10, 0), /* SSI0 */
214 [MSTP930] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 30, 0), /* I2C1 */ 242 [MSTP1014] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 14, MSTPSR10, 0), /* SSI1 */
215 [MSTP929] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 29, 0), /* I2C2 */ 243 [MSTP1013] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 13, MSTPSR10, 0), /* SSI2 */
216 [MSTP928] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 28, 0), /* I2C3 */ 244 [MSTP1012] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 12, MSTPSR10, 0), /* SSI3 */
217 [MSTP917] = SH_CLK_MSTP32(&qspi_clk, SMSTPCR9, 17, 0), /* QSPI */ 245 [MSTP1011] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 11, MSTPSR10, 0), /* SSI4 */
218 [MSTP813] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 13, 0), /* Ether */ 246 [MSTP1010] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 10, MSTPSR10, 0), /* SSI5 */
219 [MSTP726] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 26, 0), /* LVDS0 */ 247 [MSTP1009] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 9, MSTPSR10, 0), /* SSI6 */
220 [MSTP725] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 25, 0), /* LVDS1 */ 248 [MSTP1008] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 8, MSTPSR10, 0), /* SSI7 */
221 [MSTP724] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 24, 0), /* DU0 */ 249 [MSTP1007] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 7, MSTPSR10, 0), /* SSI8 */
222 [MSTP723] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 23, 0), /* DU1 */ 250 [MSTP1006] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 6, MSTPSR10, 0), /* SSI9 */
223 [MSTP722] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 22, 0), /* DU2 */ 251 [MSTP1005] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 5, MSTPSR10, 0), /* SSI ALL */
224 [MSTP721] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 21, 0), /* SCIF0 */ 252 [MSTP931] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 31, MSTPSR9, 0), /* I2C0 */
225 [MSTP720] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 20, 0), /* SCIF1 */ 253 [MSTP930] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 30, MSTPSR9, 0), /* I2C1 */
226 [MSTP717] = SH_CLK_MSTP32(&zs_clk, SMSTPCR7, 17, 0), /* HSCIF0 */ 254 [MSTP929] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 29, MSTPSR9, 0), /* I2C2 */
227 [MSTP716] = SH_CLK_MSTP32(&zs_clk, SMSTPCR7, 16, 0), /* HSCIF1 */ 255 [MSTP928] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 28, MSTPSR9, 0), /* I2C3 */
228 [MSTP704] = SH_CLK_MSTP32(&mp_clk, SMSTPCR7, 4, 0), /* HSUSB */ 256 [MSTP917] = SH_CLK_MSTP32_STS(&qspi_clk, SMSTPCR9, 17, MSTPSR9, 0), /* QSPI */
229 [MSTP522] = SH_CLK_MSTP32(&extal_clk, SMSTPCR5, 22, 0), /* Thermal */ 257 [MSTP815] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 15, MSTPSR8, 0), /* SATA0 */
230 [MSTP315] = SH_CLK_MSTP32(&div6_clks[DIV6_MMC0], SMSTPCR3, 15, 0), /* MMC0 */ 258 [MSTP814] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 14, MSTPSR8, 0), /* SATA1 */
231 [MSTP314] = SH_CLK_MSTP32(&div4_clks[DIV4_SD0], SMSTPCR3, 14, 0), /* SDHI0 */ 259 [MSTP813] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR8, 13, MSTPSR8, 0), /* Ether */
232 [MSTP313] = SH_CLK_MSTP32(&div4_clks[DIV4_SD1], SMSTPCR3, 13, 0), /* SDHI1 */ 260 [MSTP811] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 11, MSTPSR8, 0), /* VIN0 */
233 [MSTP312] = SH_CLK_MSTP32(&div6_clks[DIV6_SD2], SMSTPCR3, 12, 0), /* SDHI2 */ 261 [MSTP810] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 10, MSTPSR8, 0), /* VIN1 */
234 [MSTP311] = SH_CLK_MSTP32(&div6_clks[DIV6_SD3], SMSTPCR3, 11, 0), /* SDHI3 */ 262 [MSTP809] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 9, MSTPSR8, 0), /* VIN2 */
235 [MSTP305] = SH_CLK_MSTP32(&div6_clks[DIV6_MMC1], SMSTPCR3, 5, 0), /* MMC1 */ 263 [MSTP808] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 8, MSTPSR8, 0), /* VIN3 */
236 [MSTP304] = SH_CLK_MSTP32(&cp_clk, SMSTPCR3, 4, 0), /* TPU0 */ 264 [MSTP726] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 26, MSTPSR7, 0), /* LVDS0 */
237 [MSTP216] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 16, 0), /* SCIFB2 */ 265 [MSTP725] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 25, MSTPSR7, 0), /* LVDS1 */
238 [MSTP207] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 7, 0), /* SCIFB1 */ 266 [MSTP724] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 24, MSTPSR7, 0), /* DU0 */
239 [MSTP206] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 6, 0), /* SCIFB0 */ 267 [MSTP723] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 23, MSTPSR7, 0), /* DU1 */
240 [MSTP204] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 4, 0), /* SCIFA0 */ 268 [MSTP722] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 22, MSTPSR7, 0), /* DU2 */
241 [MSTP203] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 3, 0), /* SCIFA1 */ 269 [MSTP721] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 21, MSTPSR7, 0), /* SCIF0 */
242 [MSTP202] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 2, 0), /* SCIFA2 */ 270 [MSTP720] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 20, MSTPSR7, 0), /* SCIF1 */
243 [MSTP124] = SH_CLK_MSTP32(&rclk_clk, SMSTPCR1, 24, 0), /* CMT0 */ 271 [MSTP717] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR7, 17, MSTPSR7, 0), /* HSCIF0 */
272 [MSTP716] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR7, 16, MSTPSR7, 0), /* HSCIF1 */
273 [MSTP704] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR7, 4, MSTPSR7, 0), /* HSUSB */
274 [MSTP703] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR7, 3, MSTPSR7, 0), /* EHCI */
275 [MSTP522] = SH_CLK_MSTP32_STS(&extal_clk, SMSTPCR5, 22, MSTPSR5, 0), /* Thermal */
276 [MSTP502] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR5, 2, MSTPSR5, 0), /* Audio-DMAC low */
277 [MSTP501] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR5, 1, MSTPSR5, 0), /* Audio-DMAC hi */
278 [MSTP315] = SH_CLK_MSTP32_STS(&div6_clks[DIV6_MMC0], SMSTPCR3, 15, MSTPSR3, 0), /* MMC0 */
279 [MSTP314] = SH_CLK_MSTP32_STS(&div4_clks[DIV4_SD0], SMSTPCR3, 14, MSTPSR3, 0), /* SDHI0 */
280 [MSTP313] = SH_CLK_MSTP32_STS(&div4_clks[DIV4_SD1], SMSTPCR3, 13, MSTPSR3, 0), /* SDHI1 */
281 [MSTP312] = SH_CLK_MSTP32_STS(&div6_clks[DIV6_SD2], SMSTPCR3, 12, MSTPSR3, 0), /* SDHI2 */
282 [MSTP311] = SH_CLK_MSTP32_STS(&div6_clks[DIV6_SD3], SMSTPCR3, 11, MSTPSR3, 0), /* SDHI3 */
283 [MSTP305] = SH_CLK_MSTP32_STS(&div6_clks[DIV6_MMC1], SMSTPCR3, 5, MSTPSR3, 0), /* MMC1 */
284 [MSTP304] = SH_CLK_MSTP32_STS(&cp_clk, SMSTPCR3, 4, MSTPSR3, 0), /* TPU0 */
285 [MSTP216] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 16, MSTPSR2, 0), /* SCIFB2 */
286 [MSTP207] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 7, MSTPSR2, 0), /* SCIFB1 */
287 [MSTP206] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 6, MSTPSR2, 0), /* SCIFB0 */
288 [MSTP204] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 4, MSTPSR2, 0), /* SCIFA0 */
289 [MSTP203] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 3, MSTPSR2, 0), /* SCIFA1 */
290 [MSTP202] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 2, MSTPSR2, 0), /* SCIFA2 */
291 [MSTP124] = SH_CLK_MSTP32_STS(&rclk_clk, SMSTPCR1, 24, MSTPSR1, 0), /* CMT0 */
244}; 292};
245 293
246static struct clk_lookup lookups[] = { 294static struct clk_lookup lookups[] = {
247 295
248 /* main clocks */ 296 /* main clocks */
297 CLKDEV_CON_ID("audio_clk_a", &audio_clk_a),
298 CLKDEV_CON_ID("audio_clk_b", &audio_clk_b),
299 CLKDEV_CON_ID("audio_clk_c", &audio_clk_c),
300 CLKDEV_CON_ID("audio_clk_internal", &m2_clk),
249 CLKDEV_CON_ID("extal", &extal_clk), 301 CLKDEV_CON_ID("extal", &extal_clk),
250 CLKDEV_CON_ID("extal_div2", &extal_div2_clk), 302 CLKDEV_CON_ID("extal_div2", &extal_div2_clk),
251 CLKDEV_CON_ID("main", &main_clk), 303 CLKDEV_CON_ID("main", &main_clk),
@@ -291,32 +343,32 @@ static struct clk_lookup lookups[] = {
291 CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP720]), 343 CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP720]),
292 CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP717]), 344 CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP717]),
293 CLKDEV_DEV_ID("sh-sci.9", &mstp_clks[MSTP716]), 345 CLKDEV_DEV_ID("sh-sci.9", &mstp_clks[MSTP716]),
294 CLKDEV_DEV_ID("e6508000.i2c", &mstp_clks[MSTP931]),
295 CLKDEV_DEV_ID("i2c-rcar_gen2.0", &mstp_clks[MSTP931]), 346 CLKDEV_DEV_ID("i2c-rcar_gen2.0", &mstp_clks[MSTP931]),
296 CLKDEV_DEV_ID("e6518000.i2c", &mstp_clks[MSTP930]),
297 CLKDEV_DEV_ID("i2c-rcar_gen2.1", &mstp_clks[MSTP930]), 347 CLKDEV_DEV_ID("i2c-rcar_gen2.1", &mstp_clks[MSTP930]),
298 CLKDEV_DEV_ID("e6530000.i2c", &mstp_clks[MSTP929]),
299 CLKDEV_DEV_ID("i2c-rcar_gen2.2", &mstp_clks[MSTP929]), 348 CLKDEV_DEV_ID("i2c-rcar_gen2.2", &mstp_clks[MSTP929]),
300 CLKDEV_DEV_ID("e6540000.i2c", &mstp_clks[MSTP928]),
301 CLKDEV_DEV_ID("i2c-rcar_gen2.3", &mstp_clks[MSTP928]), 349 CLKDEV_DEV_ID("i2c-rcar_gen2.3", &mstp_clks[MSTP928]),
302 CLKDEV_DEV_ID("r8a7790-ether", &mstp_clks[MSTP813]), 350 CLKDEV_DEV_ID("r8a7790-ether", &mstp_clks[MSTP813]),
303 CLKDEV_DEV_ID("e61f0000.thermal", &mstp_clks[MSTP522]), 351 CLKDEV_DEV_ID("r8a7790-vin.0", &mstp_clks[MSTP811]),
352 CLKDEV_DEV_ID("r8a7790-vin.1", &mstp_clks[MSTP810]),
353 CLKDEV_DEV_ID("r8a7790-vin.2", &mstp_clks[MSTP809]),
354 CLKDEV_DEV_ID("r8a7790-vin.3", &mstp_clks[MSTP808]),
304 CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]), 355 CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]),
305 CLKDEV_DEV_ID("ee200000.mmc", &mstp_clks[MSTP315]), 356 CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP502]),
357 CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP501]),
306 CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP315]), 358 CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP315]),
307 CLKDEV_DEV_ID("ee100000.sd", &mstp_clks[MSTP314]),
308 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), 359 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]),
309 CLKDEV_DEV_ID("ee120000.sd", &mstp_clks[MSTP313]),
310 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), 360 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]),
311 CLKDEV_DEV_ID("ee140000.sd", &mstp_clks[MSTP312]),
312 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP312]), 361 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP312]),
313 CLKDEV_DEV_ID("ee160000.sd", &mstp_clks[MSTP311]),
314 CLKDEV_DEV_ID("sh_mobile_sdhi.3", &mstp_clks[MSTP311]), 362 CLKDEV_DEV_ID("sh_mobile_sdhi.3", &mstp_clks[MSTP311]),
315 CLKDEV_DEV_ID("ee220000.mmc", &mstp_clks[MSTP305]),
316 CLKDEV_DEV_ID("sh_mmcif.1", &mstp_clks[MSTP305]), 363 CLKDEV_DEV_ID("sh_mmcif.1", &mstp_clks[MSTP305]),
317 CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]), 364 CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]),
318 CLKDEV_DEV_ID("qspi.0", &mstp_clks[MSTP917]), 365 CLKDEV_DEV_ID("qspi.0", &mstp_clks[MSTP917]),
319 CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP704]), 366 CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP704]),
367 CLKDEV_DEV_ID("pci-rcar-gen2.0", &mstp_clks[MSTP703]),
368 CLKDEV_DEV_ID("pci-rcar-gen2.1", &mstp_clks[MSTP703]),
369 CLKDEV_DEV_ID("pci-rcar-gen2.2", &mstp_clks[MSTP703]),
370 CLKDEV_DEV_ID("sata-r8a7790.0", &mstp_clks[MSTP815]),
371 CLKDEV_DEV_ID("sata-r8a7790.1", &mstp_clks[MSTP814]),
320 372
321 /* ICK */ 373 /* ICK */
322 CLKDEV_ICK_ID("usbhs", "usb_phy_rcar_gen2", &mstp_clks[MSTP704]), 374 CLKDEV_ICK_ID("usbhs", "usb_phy_rcar_gen2", &mstp_clks[MSTP704]),
@@ -325,6 +377,20 @@ static struct clk_lookup lookups[] = {
325 CLKDEV_ICK_ID("du.0", "rcar-du-r8a7790", &mstp_clks[MSTP724]), 377 CLKDEV_ICK_ID("du.0", "rcar-du-r8a7790", &mstp_clks[MSTP724]),
326 CLKDEV_ICK_ID("du.1", "rcar-du-r8a7790", &mstp_clks[MSTP723]), 378 CLKDEV_ICK_ID("du.1", "rcar-du-r8a7790", &mstp_clks[MSTP723]),
327 CLKDEV_ICK_ID("du.2", "rcar-du-r8a7790", &mstp_clks[MSTP722]), 379 CLKDEV_ICK_ID("du.2", "rcar-du-r8a7790", &mstp_clks[MSTP722]),
380 CLKDEV_ICK_ID("clk_a", "rcar_sound", &audio_clk_a),
381 CLKDEV_ICK_ID("clk_b", "rcar_sound", &audio_clk_b),
382 CLKDEV_ICK_ID("clk_c", "rcar_sound", &audio_clk_c),
383 CLKDEV_ICK_ID("clk_i", "rcar_sound", &m2_clk),
384 CLKDEV_ICK_ID("scu.0", "rcar_sound", &mstp_clks[MSTP1031]),
385 CLKDEV_ICK_ID("scu.1", "rcar_sound", &mstp_clks[MSTP1030]),
386 CLKDEV_ICK_ID("scu.2", "rcar_sound", &mstp_clks[MSTP1029]),
387 CLKDEV_ICK_ID("scu.3", "rcar_sound", &mstp_clks[MSTP1028]),
388 CLKDEV_ICK_ID("scu.4", "rcar_sound", &mstp_clks[MSTP1027]),
389 CLKDEV_ICK_ID("scu.5", "rcar_sound", &mstp_clks[MSTP1026]),
390 CLKDEV_ICK_ID("scu.6", "rcar_sound", &mstp_clks[MSTP1025]),
391 CLKDEV_ICK_ID("scu.7", "rcar_sound", &mstp_clks[MSTP1024]),
392 CLKDEV_ICK_ID("scu.8", "rcar_sound", &mstp_clks[MSTP1023]),
393 CLKDEV_ICK_ID("scu.9", "rcar_sound", &mstp_clks[MSTP1022]),
328 CLKDEV_ICK_ID("ssi.0", "rcar_sound", &mstp_clks[MSTP1015]), 394 CLKDEV_ICK_ID("ssi.0", "rcar_sound", &mstp_clks[MSTP1015]),
329 CLKDEV_ICK_ID("ssi.1", "rcar_sound", &mstp_clks[MSTP1014]), 395 CLKDEV_ICK_ID("ssi.1", "rcar_sound", &mstp_clks[MSTP1014]),
330 CLKDEV_ICK_ID("ssi.2", "rcar_sound", &mstp_clks[MSTP1013]), 396 CLKDEV_ICK_ID("ssi.2", "rcar_sound", &mstp_clks[MSTP1013]),
diff --git a/arch/arm/mach-shmobile/clock-r8a7791.c b/arch/arm/mach-shmobile/clock-r8a7791.c
index f5461262ee25..701383fe3267 100644
--- a/arch/arm/mach-shmobile/clock-r8a7791.c
+++ b/arch/arm/mach-shmobile/clock-r8a7791.c
@@ -59,10 +59,19 @@
59#define SMSTPCR10 0xE6150998 59#define SMSTPCR10 0xE6150998
60#define SMSTPCR11 0xE615099C 60#define SMSTPCR11 0xE615099C
61 61
62#define MSTPSR1 IOMEM(0xe6150038)
63#define MSTPSR2 IOMEM(0xe6150040)
64#define MSTPSR3 IOMEM(0xe6150048)
65#define MSTPSR5 IOMEM(0xe615003c)
66#define MSTPSR7 IOMEM(0xe61501c4)
67#define MSTPSR8 IOMEM(0xe61509a0)
68#define MSTPSR9 IOMEM(0xe61509a4)
69#define MSTPSR11 IOMEM(0xe61509ac)
70
62#define MODEMR 0xE6160060 71#define MODEMR 0xE6160060
63#define SDCKCR 0xE6150074 72#define SDCKCR 0xE6150074
64#define SD2CKCR 0xE6150078 73#define SD1CKCR 0xE6150078
65#define SD3CKCR 0xE615007C 74#define SD2CKCR 0xE615026c
66#define MMC0CKCR 0xE6150240 75#define MMC0CKCR 0xE6150240
67#define MMC1CKCR 0xE6150244 76#define MMC1CKCR 0xE6150244
68#define SSPCKCR 0xE6150248 77#define SSPCKCR 0xE6150248
@@ -93,6 +102,7 @@ static struct clk main_clk = {
93 */ 102 */
94SH_FIXED_RATIO_CLK_SET(pll1_clk, main_clk, 1, 1); 103SH_FIXED_RATIO_CLK_SET(pll1_clk, main_clk, 1, 1);
95SH_FIXED_RATIO_CLK_SET(pll3_clk, main_clk, 1, 1); 104SH_FIXED_RATIO_CLK_SET(pll3_clk, main_clk, 1, 1);
105SH_FIXED_RATIO_CLK_SET(qspi_clk, pll1_clk, 1, 1);
96 106
97/* fixed ratio clock */ 107/* fixed ratio clock */
98SH_FIXED_RATIO_CLK_SET(extal_div2_clk, extal_clk, 1, 2); 108SH_FIXED_RATIO_CLK_SET(extal_div2_clk, extal_clk, 1, 2);
@@ -103,7 +113,9 @@ SH_FIXED_RATIO_CLK_SET(hp_clk, pll1_clk, 1, 12);
103SH_FIXED_RATIO_CLK_SET(p_clk, pll1_clk, 1, 24); 113SH_FIXED_RATIO_CLK_SET(p_clk, pll1_clk, 1, 24);
104SH_FIXED_RATIO_CLK_SET(rclk_clk, pll1_clk, 1, (48 * 1024)); 114SH_FIXED_RATIO_CLK_SET(rclk_clk, pll1_clk, 1, (48 * 1024));
105SH_FIXED_RATIO_CLK_SET(mp_clk, pll1_div2_clk, 1, 15); 115SH_FIXED_RATIO_CLK_SET(mp_clk, pll1_div2_clk, 1, 15);
116SH_FIXED_RATIO_CLK_SET(zg_clk, pll1_clk, 1, 3);
106SH_FIXED_RATIO_CLK_SET(zx_clk, pll1_clk, 1, 3); 117SH_FIXED_RATIO_CLK_SET(zx_clk, pll1_clk, 1, 3);
118SH_FIXED_RATIO_CLK_SET(zs_clk, pll1_clk, 1, 6);
107 119
108static struct clk *main_clks[] = { 120static struct clk *main_clks[] = {
109 &extal_clk, 121 &extal_clk,
@@ -114,46 +126,103 @@ static struct clk *main_clks[] = {
114 &pll3_clk, 126 &pll3_clk,
115 &hp_clk, 127 &hp_clk,
116 &p_clk, 128 &p_clk,
129 &qspi_clk,
117 &rclk_clk, 130 &rclk_clk,
118 &mp_clk, 131 &mp_clk,
119 &cp_clk, 132 &cp_clk,
133 &zg_clk,
120 &zx_clk, 134 &zx_clk,
135 &zs_clk,
136};
137
138/* SDHI (DIV4) clock */
139static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18, 24, 0, 36, 48, 10 };
140
141static struct clk_div_mult_table div4_div_mult_table = {
142 .divisors = divisors,
143 .nr_divisors = ARRAY_SIZE(divisors),
144};
145
146static struct clk_div4_table div4_table = {
147 .div_mult_table = &div4_div_mult_table,
148};
149
150enum {
151 DIV4_SDH, DIV4_SD0,
152 DIV4_NR
153};
154
155static struct clk div4_clks[DIV4_NR] = {
156 [DIV4_SDH] = SH_CLK_DIV4(&pll1_clk, SDCKCR, 8, 0x0dff, CLK_ENABLE_ON_INIT),
157 [DIV4_SD0] = SH_CLK_DIV4(&pll1_clk, SDCKCR, 4, 0x1de0, CLK_ENABLE_ON_INIT),
158};
159
160/* DIV6 clocks */
161enum {
162 DIV6_SD1, DIV6_SD2,
163 DIV6_NR
164};
165
166static struct clk div6_clks[DIV6_NR] = {
167 [DIV6_SD1] = SH_CLK_DIV6(&pll1_div2_clk, SD1CKCR, 0),
168 [DIV6_SD2] = SH_CLK_DIV6(&pll1_div2_clk, SD2CKCR, 0),
121}; 169};
122 170
123/* MSTP */ 171/* MSTP */
124enum { 172enum {
173 MSTP1108, MSTP1107, MSTP1106,
174 MSTP931, MSTP930, MSTP929, MSTP928, MSTP927, MSTP925,
175 MSTP917,
176 MSTP815, MSTP814,
125 MSTP813, 177 MSTP813,
178 MSTP811, MSTP810, MSTP809,
126 MSTP726, MSTP724, MSTP723, MSTP721, MSTP720, 179 MSTP726, MSTP724, MSTP723, MSTP721, MSTP720,
127 MSTP719, MSTP718, MSTP715, MSTP714, 180 MSTP719, MSTP718, MSTP715, MSTP714,
128 MSTP522, 181 MSTP522,
182 MSTP314, MSTP312, MSTP311,
129 MSTP216, MSTP207, MSTP206, 183 MSTP216, MSTP207, MSTP206,
130 MSTP204, MSTP203, MSTP202, MSTP1105, MSTP1106, MSTP1107, 184 MSTP204, MSTP203, MSTP202,
131 MSTP124, 185 MSTP124,
132 MSTP_NR 186 MSTP_NR
133}; 187};
134 188
135static struct clk mstp_clks[MSTP_NR] = { 189static struct clk mstp_clks[MSTP_NR] = {
136 [MSTP813] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 13, 0), /* Ether */ 190 [MSTP1108] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 8, MSTPSR11, 0), /* SCIFA5 */
137 [MSTP726] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 26, 0), /* LVDS0 */ 191 [MSTP1107] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 7, MSTPSR11, 0), /* SCIFA4 */
138 [MSTP724] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 24, 0), /* DU0 */ 192 [MSTP1106] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 6, MSTPSR11, 0), /* SCIFA3 */
139 [MSTP723] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 23, 0), /* DU1 */ 193 [MSTP931] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 31, MSTPSR9, 0), /* I2C0 */
140 [MSTP721] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 21, 0), /* SCIF0 */ 194 [MSTP930] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 30, MSTPSR9, 0), /* I2C1 */
141 [MSTP720] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 20, 0), /* SCIF1 */ 195 [MSTP929] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 29, MSTPSR9, 0), /* I2C2 */
142 [MSTP719] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 19, 0), /* SCIF2 */ 196 [MSTP928] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 28, MSTPSR9, 0), /* I2C3 */
143 [MSTP718] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 18, 0), /* SCIF3 */ 197 [MSTP927] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 27, MSTPSR9, 0), /* I2C4 */
144 [MSTP715] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 15, 0), /* SCIF4 */ 198 [MSTP925] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 25, MSTPSR9, 0), /* I2C5 */
145 [MSTP714] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 14, 0), /* SCIF5 */ 199 [MSTP917] = SH_CLK_MSTP32_STS(&qspi_clk, SMSTPCR9, 17, MSTPSR9, 0), /* QSPI */
146 [MSTP522] = SH_CLK_MSTP32(&extal_clk, SMSTPCR5, 22, 0), /* Thermal */ 200 [MSTP815] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 15, MSTPSR8, 0), /* SATA0 */
147 [MSTP216] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 16, 0), /* SCIFB2 */ 201 [MSTP814] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 14, MSTPSR8, 0), /* SATA1 */
148 [MSTP207] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 7, 0), /* SCIFB1 */ 202 [MSTP813] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR8, 13, MSTPSR8, 0), /* Ether */
149 [MSTP206] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 6, 0), /* SCIFB0 */ 203 [MSTP811] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 11, MSTPSR8, 0), /* VIN0 */
150 [MSTP204] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 4, 0), /* SCIFA0 */ 204 [MSTP810] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 10, MSTPSR8, 0), /* VIN1 */
151 [MSTP203] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 3, 0), /* SCIFA1 */ 205 [MSTP809] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 9, MSTPSR8, 0), /* VIN2 */
152 [MSTP202] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 2, 0), /* SCIFA2 */ 206 [MSTP726] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 26, MSTPSR7, 0), /* LVDS0 */
153 [MSTP1105] = SH_CLK_MSTP32(&mp_clk, SMSTPCR11, 5, 0), /* SCIFA3 */ 207 [MSTP724] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 24, MSTPSR7, 0), /* DU0 */
154 [MSTP1106] = SH_CLK_MSTP32(&mp_clk, SMSTPCR11, 6, 0), /* SCIFA4 */ 208 [MSTP723] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 23, MSTPSR7, 0), /* DU1 */
155 [MSTP1107] = SH_CLK_MSTP32(&mp_clk, SMSTPCR11, 7, 0), /* SCIFA5 */ 209 [MSTP721] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 21, MSTPSR7, 0), /* SCIF0 */
156 [MSTP124] = SH_CLK_MSTP32(&rclk_clk, SMSTPCR1, 24, 0), /* CMT0 */ 210 [MSTP720] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 20, MSTPSR7, 0), /* SCIF1 */
211 [MSTP719] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 19, MSTPSR7, 0), /* SCIF2 */
212 [MSTP718] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 18, MSTPSR7, 0), /* SCIF3 */
213 [MSTP715] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 15, MSTPSR7, 0), /* SCIF4 */
214 [MSTP714] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 14, MSTPSR7, 0), /* SCIF5 */
215 [MSTP522] = SH_CLK_MSTP32_STS(&extal_clk, SMSTPCR5, 22, MSTPSR5, 0), /* Thermal */
216 [MSTP314] = SH_CLK_MSTP32_STS(&div4_clks[DIV4_SD0], SMSTPCR3, 14, MSTPSR3, 0), /* SDHI0 */
217 [MSTP312] = SH_CLK_MSTP32_STS(&div6_clks[DIV6_SD1], SMSTPCR3, 12, MSTPSR3, 0), /* SDHI1 */
218 [MSTP311] = SH_CLK_MSTP32_STS(&div6_clks[DIV6_SD2], SMSTPCR3, 11, MSTPSR3, 0), /* SDHI2 */
219 [MSTP216] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 16, MSTPSR2, 0), /* SCIFB2 */
220 [MSTP207] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 7, MSTPSR2, 0), /* SCIFB1 */
221 [MSTP206] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 6, MSTPSR2, 0), /* SCIFB0 */
222 [MSTP204] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 4, MSTPSR2, 0), /* SCIFA0 */
223 [MSTP203] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 3, MSTPSR2, 0), /* SCIFA1 */
224 [MSTP202] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 2, MSTPSR2, 0), /* SCIFA2 */
225 [MSTP124] = SH_CLK_MSTP32_STS(&rclk_clk, SMSTPCR1, 24, MSTPSR1, 0), /* CMT0 */
157}; 226};
158 227
159static struct clk_lookup lookups[] = { 228static struct clk_lookup lookups[] = {
@@ -165,8 +234,11 @@ static struct clk_lookup lookups[] = {
165 CLKDEV_CON_ID("pll1", &pll1_clk), 234 CLKDEV_CON_ID("pll1", &pll1_clk),
166 CLKDEV_CON_ID("pll1_div2", &pll1_div2_clk), 235 CLKDEV_CON_ID("pll1_div2", &pll1_div2_clk),
167 CLKDEV_CON_ID("pll3", &pll3_clk), 236 CLKDEV_CON_ID("pll3", &pll3_clk),
237 CLKDEV_CON_ID("zg", &zg_clk),
238 CLKDEV_CON_ID("zs", &zs_clk),
168 CLKDEV_CON_ID("hp", &hp_clk), 239 CLKDEV_CON_ID("hp", &hp_clk),
169 CLKDEV_CON_ID("p", &p_clk), 240 CLKDEV_CON_ID("p", &p_clk),
241 CLKDEV_CON_ID("qspi", &qspi_clk),
170 CLKDEV_CON_ID("rclk", &rclk_clk), 242 CLKDEV_CON_ID("rclk", &rclk_clk),
171 CLKDEV_CON_ID("mp", &mp_clk), 243 CLKDEV_CON_ID("mp", &mp_clk),
172 CLKDEV_CON_ID("cp", &cp_clk), 244 CLKDEV_CON_ID("cp", &cp_clk),
@@ -188,13 +260,27 @@ static struct clk_lookup lookups[] = {
188 CLKDEV_DEV_ID("sh-sci.9", &mstp_clks[MSTP718]), /* SCIF3 */ 260 CLKDEV_DEV_ID("sh-sci.9", &mstp_clks[MSTP718]), /* SCIF3 */
189 CLKDEV_DEV_ID("sh-sci.10", &mstp_clks[MSTP715]), /* SCIF4 */ 261 CLKDEV_DEV_ID("sh-sci.10", &mstp_clks[MSTP715]), /* SCIF4 */
190 CLKDEV_DEV_ID("sh-sci.11", &mstp_clks[MSTP714]), /* SCIF5 */ 262 CLKDEV_DEV_ID("sh-sci.11", &mstp_clks[MSTP714]), /* SCIF5 */
191 CLKDEV_DEV_ID("sh-sci.12", &mstp_clks[MSTP1105]), /* SCIFA3 */ 263 CLKDEV_DEV_ID("sh-sci.12", &mstp_clks[MSTP1106]), /* SCIFA3 */
192 CLKDEV_DEV_ID("sh-sci.13", &mstp_clks[MSTP1106]), /* SCIFA4 */ 264 CLKDEV_DEV_ID("sh-sci.13", &mstp_clks[MSTP1107]), /* SCIFA4 */
193 CLKDEV_DEV_ID("sh-sci.14", &mstp_clks[MSTP1107]), /* SCIFA5 */ 265 CLKDEV_DEV_ID("sh-sci.14", &mstp_clks[MSTP1108]), /* SCIFA5 */
266 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]),
267 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP312]),
268 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP311]),
194 CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]), 269 CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]),
195 CLKDEV_DEV_ID("e61f0000.thermal", &mstp_clks[MSTP522]), 270 CLKDEV_DEV_ID("qspi.0", &mstp_clks[MSTP917]),
196 CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]), 271 CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]),
272 CLKDEV_DEV_ID("i2c-rcar_gen2.0", &mstp_clks[MSTP931]),
273 CLKDEV_DEV_ID("i2c-rcar_gen2.1", &mstp_clks[MSTP930]),
274 CLKDEV_DEV_ID("i2c-rcar_gen2.2", &mstp_clks[MSTP929]),
275 CLKDEV_DEV_ID("i2c-rcar_gen2.3", &mstp_clks[MSTP928]),
276 CLKDEV_DEV_ID("i2c-rcar_gen2.4", &mstp_clks[MSTP927]),
277 CLKDEV_DEV_ID("i2c-rcar_gen2.5", &mstp_clks[MSTP925]),
197 CLKDEV_DEV_ID("r8a7791-ether", &mstp_clks[MSTP813]), /* Ether */ 278 CLKDEV_DEV_ID("r8a7791-ether", &mstp_clks[MSTP813]), /* Ether */
279 CLKDEV_DEV_ID("r8a7791-vin.0", &mstp_clks[MSTP811]),
280 CLKDEV_DEV_ID("r8a7791-vin.1", &mstp_clks[MSTP810]),
281 CLKDEV_DEV_ID("r8a7791-vin.2", &mstp_clks[MSTP809]),
282 CLKDEV_DEV_ID("sata-r8a7791.0", &mstp_clks[MSTP815]),
283 CLKDEV_DEV_ID("sata-r8a7791.1", &mstp_clks[MSTP814]),
198}; 284};
199 285
200#define R8A7791_CLOCK_ROOT(e, m, p0, p1, p30, p31) \ 286#define R8A7791_CLOCK_ROOT(e, m, p0, p1, p30, p31) \
@@ -232,10 +318,21 @@ void __init r8a7791_clock_init(void)
232 break; 318 break;
233 } 319 }
234 320
321 if ((mode & (MD(3) | MD(2) | MD(1))) == MD(2))
322 SH_CLK_SET_RATIO(&qspi_clk_ratio, 1, 16);
323 else
324 SH_CLK_SET_RATIO(&qspi_clk_ratio, 1, 20);
325
235 for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++) 326 for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
236 ret = clk_register(main_clks[k]); 327 ret = clk_register(main_clks[k]);
237 328
238 if (!ret) 329 if (!ret)
330 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
331
332 if (!ret)
333 ret = sh_clk_div6_register(div6_clks, DIV6_NR);
334
335 if (!ret)
239 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR); 336 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
240 337
241 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 338 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
index e31980590eb4..cb8e32deb2a3 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -25,7 +25,6 @@ extern int shmobile_smp_apmu_boot_secondary(unsigned int cpu,
25 struct task_struct *idle); 25 struct task_struct *idle);
26extern void shmobile_smp_apmu_cpu_die(unsigned int cpu); 26extern void shmobile_smp_apmu_cpu_die(unsigned int cpu);
27extern int shmobile_smp_apmu_cpu_kill(unsigned int cpu); 27extern int shmobile_smp_apmu_cpu_kill(unsigned int cpu);
28extern void shmobile_invalidate_start(void);
29struct clk; 28struct clk;
30extern int shmobile_clk_init(void); 29extern int shmobile_clk_init(void);
31extern void shmobile_handle_irq_intc(struct pt_regs *); 30extern void shmobile_handle_irq_intc(struct pt_regs *);
diff --git a/arch/arm/mach-shmobile/include/mach/head-kzm9g.txt b/arch/arm/mach-shmobile/include/mach/head-kzm9g.txt
new file mode 100644
index 000000000000..9531f46a822a
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/head-kzm9g.txt
@@ -0,0 +1,410 @@
1LIST "KZM9G low-level initialization routine."
2LIST "Adapted from u-boot KZM9G support code."
3
4LIST "Copyright (C) 2013 Ulrich Hecht"
5
6LIST "This program is free software; you can redistribute it and/or modify"
7LIST "it under the terms of the GNU General Public License version 2 as"
8LIST "published by the Free Software Foundation."
9
10LIST "This program is distributed in the hope that it will be useful,"
11LIST "but WITHOUT ANY WARRANTY; without even the implied warranty of"
12LIST "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"
13LIST "GNU General Public License for more details."
14
15
16LIST "Register definitions:"
17
18LIST "Secure control register"
19#define LIFEC_SEC_SRC (0xE6110008)
20
21LIST "RWDT"
22#define RWDT_BASE (0xE6020000)
23#define RWTCSRA0 (RWDT_BASE + 0x04)
24
25LIST "HPB Semaphore Control Registers"
26#define HPBSCR_BASE (0xE6000000)
27#define HPBCTRL6 (HPBSCR_BASE + 0x1030)
28
29#define SBSC1_BASE (0xFE400000)
30#define SDCR0A (SBSC1_BASE + 0x0008)
31#define SDCR1A (SBSC1_BASE + 0x000C)
32#define SDPCRA (SBSC1_BASE + 0x0010)
33#define SDCR0SA (SBSC1_BASE + 0x0018)
34#define SDCR1SA (SBSC1_BASE + 0x001C)
35#define RTCSRA (SBSC1_BASE + 0x0020)
36#define RTCORA (SBSC1_BASE + 0x0028)
37#define RTCORHA (SBSC1_BASE + 0x002C)
38#define SDWCRC0A (SBSC1_BASE + 0x0040)
39#define SDWCRC1A (SBSC1_BASE + 0x0044)
40#define SDWCR00A (SBSC1_BASE + 0x0048)
41#define SDWCR01A (SBSC1_BASE + 0x004C)
42#define SDWCR10A (SBSC1_BASE + 0x0050)
43#define SDWCR11A (SBSC1_BASE + 0x0054)
44#define SDWCR2A (SBSC1_BASE + 0x0060)
45#define SDWCRC2A (SBSC1_BASE + 0x0064)
46#define ZQCCRA (SBSC1_BASE + 0x0068)
47#define SDMRACR0A (SBSC1_BASE + 0x0084)
48#define SDMRTMPCRA (SBSC1_BASE + 0x008C)
49#define SDMRTMPMSKA (SBSC1_BASE + 0x0094)
50#define SDGENCNTA (SBSC1_BASE + 0x009C)
51#define SDDRVCR0A (SBSC1_BASE + 0x00B4)
52#define DLLCNT0A (SBSC1_BASE + 0x0354)
53
54#define SDMRA1 (0xFE500000)
55#define SDMRA2 (0xFE5C0000)
56#define SDMRA3 (0xFE504000)
57
58#define SBSC2_BASE (0xFB400000)
59#define SDCR0B (SBSC2_BASE + 0x0008)
60#define SDCR1B (SBSC2_BASE + 0x000C)
61#define SDPCRB (SBSC2_BASE + 0x0010)
62#define SDCR0SB (SBSC2_BASE + 0x0018)
63#define SDCR1SB (SBSC2_BASE + 0x001C)
64#define RTCSRB (SBSC2_BASE + 0x0020)
65#define RTCORB (SBSC2_BASE + 0x0028)
66#define RTCORHB (SBSC2_BASE + 0x002C)
67#define SDWCRC0B (SBSC2_BASE + 0x0040)
68#define SDWCRC1B (SBSC2_BASE + 0x0044)
69#define SDWCR00B (SBSC2_BASE + 0x0048)
70#define SDWCR01B (SBSC2_BASE + 0x004C)
71#define SDWCR10B (SBSC2_BASE + 0x0050)
72#define SDWCR11B (SBSC2_BASE + 0x0054)
73#define SDPDCR0B (SBSC2_BASE + 0x0058)
74#define SDWCR2B (SBSC2_BASE + 0x0060)
75#define SDWCRC2B (SBSC2_BASE + 0x0064)
76#define ZQCCRB (SBSC2_BASE + 0x0068)
77#define SDMRACR0B (SBSC2_BASE + 0x0084)
78#define SDMRTMPCRB (SBSC2_BASE + 0x008C)
79#define SDMRTMPMSKB (SBSC2_BASE + 0x0094)
80#define SDGENCNTB (SBSC2_BASE + 0x009C)
81#define DPHYCNT0B (SBSC2_BASE + 0x00A0)
82#define DPHYCNT1B (SBSC2_BASE + 0x00A4)
83#define DPHYCNT2B (SBSC2_BASE + 0x00A8)
84#define SDDRVCR0B (SBSC2_BASE + 0x00B4)
85#define DLLCNT0B (SBSC2_BASE + 0x0354)
86
87#define SDMRB1 (0xFB500000)
88#define SDMRB2 (0xFB5C0000)
89#define SDMRB3 (0xFB504000)
90
91#define CPG_BASE (0xE6150000)
92#define FRQCRA (CPG_BASE + 0x0000)
93#define FRQCRB (CPG_BASE + 0x0004)
94#define FRQCRD (CPG_BASE + 0x00E4)
95#define VCLKCR1 (CPG_BASE + 0x0008)
96#define VCLKCR2 (CPG_BASE + 0x000C)
97#define VCLKCR3 (CPG_BASE + 0x001C)
98#define ZBCKCR (CPG_BASE + 0x0010)
99#define FLCKCR (CPG_BASE + 0x0014)
100#define SD0CKCR (CPG_BASE + 0x0074)
101#define SD1CKCR (CPG_BASE + 0x0078)
102#define SD2CKCR (CPG_BASE + 0x007C)
103#define FSIACKCR (CPG_BASE + 0x0018)
104#define SUBCKCR (CPG_BASE + 0x0080)
105#define SPUACKCR (CPG_BASE + 0x0084)
106#define SPUVCKCR (CPG_BASE + 0x0094)
107#define MSUCKCR (CPG_BASE + 0x0088)
108#define HSICKCR (CPG_BASE + 0x008C)
109#define FSIBCKCR (CPG_BASE + 0x0090)
110#define MFCK1CR (CPG_BASE + 0x0098)
111#define MFCK2CR (CPG_BASE + 0x009C)
112#define DSITCKCR (CPG_BASE + 0x0060)
113#define DSI0PCKCR (CPG_BASE + 0x0064)
114#define DSI1PCKCR (CPG_BASE + 0x0068)
115#define DSI0PHYCR (CPG_BASE + 0x006C)
116#define DVFSCR3 (CPG_BASE + 0x0174)
117#define DVFSCR4 (CPG_BASE + 0x0178)
118#define DVFSCR5 (CPG_BASE + 0x017C)
119#define MPMODE (CPG_BASE + 0x00CC)
120
121#define PLLECR (CPG_BASE + 0x00D0)
122#define PLL0CR (CPG_BASE + 0x00D8)
123#define PLL1CR (CPG_BASE + 0x0028)
124#define PLL2CR (CPG_BASE + 0x002C)
125#define PLL3CR (CPG_BASE + 0x00DC)
126#define PLL0STPCR (CPG_BASE + 0x00F0)
127#define PLL1STPCR (CPG_BASE + 0x00C8)
128#define PLL2STPCR (CPG_BASE + 0x00F8)
129#define PLL3STPCR (CPG_BASE + 0x00FC)
130#define RMSTPCR0 (CPG_BASE + 0x0110)
131#define RMSTPCR1 (CPG_BASE + 0x0114)
132#define RMSTPCR2 (CPG_BASE + 0x0118)
133#define RMSTPCR3 (CPG_BASE + 0x011C)
134#define RMSTPCR4 (CPG_BASE + 0x0120)
135#define RMSTPCR5 (CPG_BASE + 0x0124)
136#define SMSTPCR0 (CPG_BASE + 0x0130)
137#define SMSTPCR2 (CPG_BASE + 0x0138)
138#define SMSTPCR3 (CPG_BASE + 0x013C)
139#define CPGXXCR4 (CPG_BASE + 0x0150)
140#define SRCR0 (CPG_BASE + 0x80A0)
141#define SRCR2 (CPG_BASE + 0x80B0)
142#define SRCR3 (CPG_BASE + 0x80A8)
143#define VREFCR (CPG_BASE + 0x00EC)
144#define PCLKCR (CPG_BASE + 0x1020)
145
146#define PORT32CR (0xE6051020)
147#define PORT33CR (0xE6051021)
148#define PORT34CR (0xE6051022)
149#define PORT35CR (0xE6051023)
150
151LIST "DRAM initialization code:"
152
153EW RWTCSRA0, 0xA507
154
155ED_AND LIFEC_SEC_SRC, 0xFFFF7FFF
156
157ED_AND SMSTPCR3,0xFFFF7FFF
158ED_AND SRCR3, 0xFFFF7FFF
159ED_AND SMSTPCR2,0xFFFBFFFF
160ED_AND SRCR2, 0xFFFBFFFF
161ED PLLECR, 0x00000000
162
163WAIT_MASK PLLECR, 0x00000F00, 0x00000000
164WAIT_MASK FRQCRB, 0x80000000, 0x00000000
165
166ED PLL0CR, 0x2D000000
167ED PLL1CR, 0x17100000
168ED FRQCRB, 0x96235880
169WAIT_MASK FRQCRB, 0x80000000, 0x00000000
170
171ED FLCKCR, 0x0000000B
172ED_AND SMSTPCR0, 0xFFFFFFFD
173
174ED_AND SRCR0, 0xFFFFFFFD
175ED 0xE6001628, 0x514
176ED 0xE6001648, 0x514
177ED 0xE6001658, 0x514
178ED 0xE6001678, 0x514
179
180ED DVFSCR4, 0x00092000
181ED DVFSCR5, 0x000000DC
182ED PLLECR, 0x00000000
183WAIT_MASK PLLECR, 0x00000F00, 0x00000000
184
185ED FRQCRA, 0x0012453C
186ED FRQCRB, 0x80431350
187WAIT_MASK FRQCRB, 0x80000000, 0x00000000
188ED FRQCRD, 0x00000B0B
189WAIT_MASK FRQCRD, 0x80000000, 0x00000000
190
191ED PCLKCR, 0x00000003
192ED VCLKCR1, 0x0000012F
193ED VCLKCR2, 0x00000119
194ED VCLKCR3, 0x00000119
195ED ZBCKCR, 0x00000002
196ED FLCKCR, 0x00000005
197ED SD0CKCR, 0x00000080
198ED SD1CKCR, 0x00000080
199ED SD2CKCR, 0x00000080
200ED FSIACKCR, 0x0000003F
201ED FSIBCKCR, 0x0000003F
202ED SUBCKCR, 0x00000080
203ED SPUACKCR, 0x0000000B
204ED SPUVCKCR, 0x0000000B
205ED MSUCKCR, 0x0000013F
206ED HSICKCR, 0x00000080
207ED MFCK1CR, 0x0000003F
208ED MFCK2CR, 0x0000003F
209ED DSITCKCR, 0x00000107
210ED DSI0PCKCR, 0x00000313
211ED DSI1PCKCR, 0x0000130D
212ED DSI0PHYCR, 0x2A800E0E
213ED PLL0CR, 0x1E000000
214ED PLL0CR, 0x2D000000
215ED PLL1CR, 0x17100000
216ED PLL2CR, 0x27000080
217ED PLL3CR, 0x1D000000
218ED PLL0STPCR, 0x00080000
219ED PLL1STPCR, 0x000120C0
220ED PLL2STPCR, 0x00012000
221ED PLL3STPCR, 0x00000030
222ED PLLECR, 0x0000000B
223WAIT_MASK PLLECR, 0x00000B00, 0x00000B00
224
225ED DVFSCR3, 0x000120F0
226ED MPMODE, 0x00000020
227ED VREFCR, 0x0000028A
228ED RMSTPCR0, 0xE4628087
229ED RMSTPCR1, 0xFFFFFFFF
230ED RMSTPCR2, 0x53FFFFFF
231ED RMSTPCR3, 0xFFFFFFFF
232ED RMSTPCR4, 0x00800D3D
233ED RMSTPCR5, 0xFFFFF3FF
234ED SMSTPCR2, 0x00000000
235ED SRCR2, 0x00040000
236ED_AND PLLECR, 0xFFFFFFF7
237WAIT_MASK PLLECR, 0x00000800, 0x00000000
238
239LIST "set SBSC operational"
240ED HPBCTRL6, 0x00000001
241WAIT_MASK HPBCTRL6, 0x00000001, 0x00000001
242
243LIST "set SBSC operating frequency"
244ED FRQCRD, 0x00001414
245WAIT_MASK FRQCRD, 0x80000000, 0x00000000
246ED PLL3CR, 0x1D000000
247ED_OR PLLECR, 0x00000008
248WAIT_MASK PLLECR, 0x00000800, 0x00000800
249
250LIST "enable DLL oscillation in DDRPHY"
251ED_OR DLLCNT0A, 0x00000002
252
253LIST "wait >= 100 ns"
254ED SDGENCNTA, 0x00000005
255WAIT_MASK SDGENCNTA, 0xFFFFFFFF, 0x00000000
256
257LIST "target LPDDR2 device settings"
258ED SDCR0A, 0xACC90159
259ED SDCR1A, 0x00010059
260ED SDWCRC0A, 0x50874114
261ED SDWCRC1A, 0x33199B37
262ED SDWCRC2A, 0x008F2313
263ED SDWCR00A, 0x31020707
264ED SDWCR01A, 0x0017040A
265ED SDWCR10A, 0x31020707
266ED SDWCR11A, 0x0017040A
267
268ED SDDRVCR0A, 0x055557ff
269
270ED SDWCR2A, 0x30000000
271
272LIST "drive CKE high"
273ED_OR SDPCRA, 0x00000080
274WAIT_MASK SDPCRA, 0x00000080, 0x00000080
275
276LIST "wait >= 200 us"
277ED SDGENCNTA, 0x00002710
278WAIT_MASK SDGENCNTA, 0xFFFFFFFF, 0x00000000
279
280LIST "issue reset command to LPDDR2 device"
281ED SDMRACR0A, 0x0000003F
282ED SDMRA1, 0x00000000
283
284LIST "wait >= 10 (or 1) us (docs inconsistent)"
285ED SDGENCNTA, 0x000001F4
286WAIT_MASK SDGENCNTA, 0xFFFFFFFF, 0x00000000
287
288LIST "MRW ZS initialization calibration command"
289ED SDMRACR0A, 0x0000FF0A
290ED SDMRA3, 0x00000000
291
292LIST "wait >= 1 us"
293ED SDGENCNTA, 0x00000032
294WAIT_MASK SDGENCNTA, 0xFFFFFFFF, 0x00000000
295
296LIST "specify operating mode in LPDDR2"
297ED SDMRACR0A, 0x00002201
298ED SDMRA1, 0x00000000
299ED SDMRACR0A, 0x00000402
300ED SDMRA1, 0x00000000
301ED SDMRACR0A, 0x00000203
302ED SDMRA1, 0x00000000
303
304LIST "initialize DDR interface"
305ED SDMRA2, 0x00000000
306
307LIST "temperature sensor control"
308ED SDMRTMPCRA, 0x88800004
309ED SDMRTMPMSKA,0x00000004
310
311LIST "auto-refreshing control"
312ED RTCORA, 0xA55A0032
313ED RTCORHA, 0xA55A000C
314ED RTCSRA, 0xA55A2048
315
316ED_OR SDCR0A, 0x00000800
317ED_OR SDCR1A, 0x00000400
318
319LIST "auto ZQ calibration control"
320ED ZQCCRA, 0xFFF20000
321
322ED_OR DLLCNT0B, 0x00000002
323ED SDGENCNTB, 0x00000005
324WAIT_MASK SDGENCNTB, 0xFFFFFFFF, 0x00000000
325
326ED SDCR0B, 0xACC90159
327ED SDCR1B, 0x00010059
328ED SDWCRC0B, 0x50874114
329ED SDWCRC1B, 0x33199B37
330ED SDWCRC2B, 0x008F2313
331ED SDWCR00B, 0x31020707
332ED SDWCR01B, 0x0017040A
333ED SDWCR10B, 0x31020707
334ED SDWCR11B, 0x0017040A
335ED SDDRVCR0B, 0x055557ff
336ED SDWCR2B, 0x30000000
337ED_OR SDPCRB, 0x00000080
338WAIT_MASK SDPCRB, 0x00000080, 0x00000080
339
340ED SDGENCNTB, 0x00002710
341WAIT_MASK SDGENCNTB, 0xFFFFFFFF, 0x00000000
342ED SDMRACR0B, 0x0000003F
343
344LIST "upstream u-boot writes to SDMRA1A for both SBSC 1 and 2, which does"
345LIST "not seem to make a lot of sense..."
346ED SDMRB1, 0x00000000
347
348ED SDGENCNTB, 0x000001F4
349WAIT_MASK SDGENCNTB, 0xFFFFFFFF, 0x00000000
350
351ED SDMRACR0B, 0x0000FF0A
352ED SDMRB3, 0x00000000
353ED SDGENCNTB, 0x00000032
354WAIT_MASK SDGENCNTB, 0xFFFFFFFF, 0x00000000
355
356ED SDMRACR0B, 0x00002201
357ED SDMRB1, 0x00000000
358ED SDMRACR0B, 0x00000402
359ED SDMRB1, 0x00000000
360ED SDMRACR0B, 0x00000203
361ED SDMRB1, 0x00000000
362ED SDMRB2, 0x00000000
363ED SDMRTMPCRB, 0x88800004
364ED SDMRTMPMSKB, 0x00000004
365ED RTCORB, 0xA55A0032
366ED RTCORHB, 0xA55A000C
367ED RTCSRB, 0xA55A2048
368ED_OR SDCR0B, 0x00000800
369ED_OR SDCR1B, 0x00000400
370ED ZQCCRB, 0xFFF20000
371ED_OR SDPDCR0B, 0x00030000
372ED DPHYCNT1B, 0xA5390000
373ED DPHYCNT0B, 0x00001200
374ED DPHYCNT1B, 0x07CE0000
375ED DPHYCNT0B, 0x00001247
376WAIT_MASK DPHYCNT2B, 0xFFFFFFFF, 0x07CE0000
377
378ED_AND SDPDCR0B, 0xFFFCFFFF
379
380ED FRQCRD, 0x00000B0B
381WAIT_MASK FRQCRD, 0x80000000, 0x00000000
382
383ED CPGXXCR4, 0xfffffffc
384
385LIST "Setup SCIF4 / workaround"
386EB PORT32CR, 0x12
387EB PORT33CR, 0x22
388EB PORT34CR, 0x12
389EB PORT35CR, 0x22
390
391EW 0xE6C80000, 0
392EB 0xE6C80004, 0x19
393EW 0xE6C80008, 0x0030
394EW 0xE6C80018, 0
395EW 0xE6C80030, 0x0014
396
397LIST "Magic to avoid hangs and corruption on DRAM writes."
398
399LIST "It has been observed that the system would most often hang while"
400LIST "decompressing the kernel, and if it didn't it would always write"
401LIST "a corrupt image to DRAM."
402LIST "This problem does not occur in u-boot, and the reason is that"
403LIST "u-boot performs an additional cache invalidation after setting up"
404LIST "the DRAM controller. Such an invalidation should not be necessary at"
405LIST "this point, and attempts at removing parts of the routine to arrive"
406LIST "at the minimal snippet of code necessary to avoid the DRAM stability"
407LIST "problem yielded the following:"
408
409MRC p15, 0, r0, c1, c0, 0
410MCR p15, 0, r0, c1, c0, 0
diff --git a/arch/arm/mach-shmobile/include/mach/pm-rcar.h b/arch/arm/mach-shmobile/include/mach/pm-rcar.h
new file mode 100644
index 000000000000..ef3a1ef628f1
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/pm-rcar.h
@@ -0,0 +1,15 @@
1#ifndef PM_RCAR_H
2#define PM_RCAR_H
3
4struct rcar_sysc_ch {
5 unsigned long chan_offs;
6 unsigned int chan_bit;
7 unsigned int isr_bit;
8};
9
10int rcar_sysc_power_down(struct rcar_sysc_ch *sysc_ch);
11int rcar_sysc_power_up(struct rcar_sysc_ch *sysc_ch);
12bool rcar_sysc_power_is_off(struct rcar_sysc_ch *sysc_ch);
13void __iomem *rcar_sysc_init(phys_addr_t base);
14
15#endif /* PM_RCAR_H */
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h
index b40e13631f6a..88eeceaf1088 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/sh_clk.h> 4#include <linux/sh_clk.h>
5#include <linux/pm_domain.h> 5#include <linux/pm_domain.h>
6#include <mach/pm-rcar.h>
6 7
7/* HPB-DMA slave IDs */ 8/* HPB-DMA slave IDs */
8enum { 9enum {
@@ -11,18 +12,12 @@ enum {
11 HPBDMA_SLAVE_SDHI0_RX, 12 HPBDMA_SLAVE_SDHI0_RX,
12}; 13};
13 14
14struct r8a7779_pm_ch {
15 unsigned long chan_offs;
16 unsigned int chan_bit;
17 unsigned int isr_bit;
18};
19
20struct r8a7779_pm_domain { 15struct r8a7779_pm_domain {
21 struct generic_pm_domain genpd; 16 struct generic_pm_domain genpd;
22 struct r8a7779_pm_ch ch; 17 struct rcar_sysc_ch ch;
23}; 18};
24 19
25static inline struct r8a7779_pm_ch *to_r8a7779_ch(struct generic_pm_domain *d) 20static inline struct rcar_sysc_ch *to_r8a7779_ch(struct generic_pm_domain *d)
26{ 21{
27 return &container_of(d, struct r8a7779_pm_domain, genpd)->ch; 22 return &container_of(d, struct r8a7779_pm_domain, genpd)->ch;
28} 23}
@@ -41,8 +36,6 @@ extern void r8a7779_clock_init(void);
41extern void r8a7779_pinmux_init(void); 36extern void r8a7779_pinmux_init(void);
42extern void r8a7779_pm_init(void); 37extern void r8a7779_pm_init(void);
43extern void r8a7779_register_twd(void); 38extern void r8a7779_register_twd(void);
44extern int r8a7779_sysc_power_down(struct r8a7779_pm_ch *r8a7779_ch);
45extern int r8a7779_sysc_power_up(struct r8a7779_pm_ch *r8a7779_ch);
46 39
47#ifdef CONFIG_PM 40#ifdef CONFIG_PM
48extern void __init r8a7779_init_pm_domains(void); 41extern void __init r8a7779_init_pm_domains(void);
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7790.h b/arch/arm/mach-shmobile/include/mach/r8a7790.h
index 5fbfa28b40b6..0b95babe84ba 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7790.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7790.h
@@ -3,10 +3,36 @@
3 3
4#include <mach/rcar-gen2.h> 4#include <mach/rcar-gen2.h>
5 5
6/* DMA slave IDs */
7enum {
8 RCAR_DMA_SLAVE_INVALID,
9 AUDIO_DMAC_SLAVE_SSI0_TX,
10 AUDIO_DMAC_SLAVE_SSI0_RX,
11 AUDIO_DMAC_SLAVE_SSI1_TX,
12 AUDIO_DMAC_SLAVE_SSI1_RX,
13 AUDIO_DMAC_SLAVE_SSI2_TX,
14 AUDIO_DMAC_SLAVE_SSI2_RX,
15 AUDIO_DMAC_SLAVE_SSI3_TX,
16 AUDIO_DMAC_SLAVE_SSI3_RX,
17 AUDIO_DMAC_SLAVE_SSI4_TX,
18 AUDIO_DMAC_SLAVE_SSI4_RX,
19 AUDIO_DMAC_SLAVE_SSI5_TX,
20 AUDIO_DMAC_SLAVE_SSI5_RX,
21 AUDIO_DMAC_SLAVE_SSI6_TX,
22 AUDIO_DMAC_SLAVE_SSI6_RX,
23 AUDIO_DMAC_SLAVE_SSI7_TX,
24 AUDIO_DMAC_SLAVE_SSI7_RX,
25 AUDIO_DMAC_SLAVE_SSI8_TX,
26 AUDIO_DMAC_SLAVE_SSI8_RX,
27 AUDIO_DMAC_SLAVE_SSI9_TX,
28 AUDIO_DMAC_SLAVE_SSI9_RX,
29};
30
6void r8a7790_add_standard_devices(void); 31void r8a7790_add_standard_devices(void);
7void r8a7790_add_dt_devices(void); 32void r8a7790_add_dt_devices(void);
8void r8a7790_clock_init(void); 33void r8a7790_clock_init(void);
9void r8a7790_pinmux_init(void); 34void r8a7790_pinmux_init(void);
35void r8a7790_pm_init(void);
10void r8a7790_init_early(void); 36void r8a7790_init_early(void);
11extern struct smp_operations r8a7790_smp_ops; 37extern struct smp_operations r8a7790_smp_ops;
12 38
diff --git a/arch/arm/mach-shmobile/include/mach/timex.h b/arch/arm/mach-shmobile/include/mach/timex.h
deleted file mode 100644
index ae0d8d825c23..000000000000
--- a/arch/arm/mach-shmobile/include/mach/timex.h
+++ /dev/null
@@ -1,6 +0,0 @@
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/zboot.h b/arch/arm/mach-shmobile/include/mach/zboot.h
index c3c4669a2d72..727cc78ac8ec 100644
--- a/arch/arm/mach-shmobile/include/mach/zboot.h
+++ b/arch/arm/mach-shmobile/include/mach/zboot.h
@@ -12,6 +12,9 @@
12#ifdef CONFIG_MACH_MACKEREL 12#ifdef CONFIG_MACH_MACKEREL
13#define MEMORY_START 0x40000000 13#define MEMORY_START 0x40000000
14#include "mach/head-mackerel.txt" 14#include "mach/head-mackerel.txt"
15#elif defined(CONFIG_MACH_KZM9G) || defined(CONFIG_MACH_KZM9G_REFERENCE)
16#define MEMORY_START 0x43000000
17#include "mach/head-kzm9g.txt"
15#else 18#else
16#error "unsupported board." 19#error "unsupported board."
17#endif 20#endif
diff --git a/arch/arm/mach-shmobile/include/mach/zboot_macros.h b/arch/arm/mach-shmobile/include/mach/zboot_macros.h
index aa6111fbc989..14fd3d538e9a 100644
--- a/arch/arm/mach-shmobile/include/mach/zboot_macros.h
+++ b/arch/arm/mach-shmobile/include/mach/zboot_macros.h
@@ -62,4 +62,47 @@
622 : 622 :
63.endm 63.endm
64 64
65/* loop until a given value has been read (with mask) */
66.macro WAIT_MASK, addr, data, cmp
67 LDR r0, 2f
68 LDR r1, 3f
69 LDR r2, 4f
701:
71 LDR r3, [r0, #0]
72 AND r3, r1, r3
73 CMP r2, r3
74 BNE 1b
75 B 5f
762: .long \addr
773: .long \data
784: .long \cmp
795:
80.endm
81
82/* read 32-bit value from addr, "or" an immediate and write back */
83.macro ED_OR, addr, data
84 LDR r4, 1f
85 LDR r5, 2f
86 LDR r6, [r4]
87 ORR r5, r6, r5
88 STR r5, [r4]
89 B 3f
901: .long \addr
912: .long \data
923:
93.endm
94
95/* read 32-bit value from addr, "and" an immediate and write back */
96.macro ED_AND, addr, data
97 LDR r4, 1f
98 LDR r5, 2f
99 LDR r6, [r4]
100 AND r5, r6, r5
101 STR r5, [r4]
102 B 3f
1031: .long \addr
1042: .long \data
1053:
106.endm
107
65#endif /* __ZBOOT_MACRO_H */ 108#endif /* __ZBOOT_MACRO_H */
diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c
index 1da5a72d9642..8cb641c00fdb 100644
--- a/arch/arm/mach-shmobile/platsmp-apmu.c
+++ b/arch/arm/mach-shmobile/platsmp-apmu.c
@@ -75,8 +75,7 @@ static void apmu_init_cpu(struct resource *res, int cpu, int bit)
75 apmu_cpus[cpu].iomem = ioremap_nocache(res->start, resource_size(res)); 75 apmu_cpus[cpu].iomem = ioremap_nocache(res->start, resource_size(res));
76 apmu_cpus[cpu].bit = bit; 76 apmu_cpus[cpu].bit = bit;
77 77
78 pr_debug("apmu ioremap %d %d 0x%08x 0x%08x\n", cpu, bit, 78 pr_debug("apmu ioremap %d %d %pr\n", cpu, bit, res);
79 res->start, resource_size(res));
80} 79}
81 80
82static struct { 81static struct {
diff --git a/arch/arm/mach-shmobile/pm-r8a7779.c b/arch/arm/mach-shmobile/pm-r8a7779.c
index d50a8e9b94a4..d6fe189b2df6 100644
--- a/arch/arm/mach-shmobile/pm-r8a7779.c
+++ b/arch/arm/mach-shmobile/pm-r8a7779.c
@@ -20,132 +20,22 @@
20#include <linux/console.h> 20#include <linux/console.h>
21#include <asm/io.h> 21#include <asm/io.h>
22#include <mach/common.h> 22#include <mach/common.h>
23#include <mach/pm-rcar.h>
23#include <mach/r8a7779.h> 24#include <mach/r8a7779.h>
24 25
25static void __iomem *r8a7779_sysc_base;
26
27/* SYSC */ 26/* SYSC */
28#define SYSCSR 0x00
29#define SYSCISR 0x04
30#define SYSCISCR 0x08
31#define SYSCIER 0x0c 27#define SYSCIER 0x0c
32#define SYSCIMR 0x10 28#define SYSCIMR 0x10
33#define PWRSR0 0x40
34#define PWRSR1 0x80
35#define PWRSR2 0xc0
36#define PWRSR3 0x100
37#define PWRSR4 0x140
38
39#define PWRSR_OFFS 0x00
40#define PWROFFCR_OFFS 0x04
41#define PWRONCR_OFFS 0x0c
42#define PWRER_OFFS 0x14
43
44#define SYSCSR_RETRIES 100
45#define SYSCSR_DELAY_US 1
46
47#define SYSCISR_RETRIES 1000
48#define SYSCISR_DELAY_US 1
49 29
50#if defined(CONFIG_PM) || defined(CONFIG_SMP) 30#if defined(CONFIG_PM) || defined(CONFIG_SMP)
51 31
52static DEFINE_SPINLOCK(r8a7779_sysc_lock); /* SMP CPUs + I/O devices */
53
54static int r8a7779_sysc_pwr_on_off(struct r8a7779_pm_ch *r8a7779_ch,
55 int sr_bit, int reg_offs)
56{
57 int k;
58
59 for (k = 0; k < SYSCSR_RETRIES; k++) {
60 if (ioread32(r8a7779_sysc_base + SYSCSR) & (1 << sr_bit))
61 break;
62 udelay(SYSCSR_DELAY_US);
63 }
64
65 if (k == SYSCSR_RETRIES)
66 return -EAGAIN;
67
68 iowrite32(1 << r8a7779_ch->chan_bit,
69 r8a7779_sysc_base + r8a7779_ch->chan_offs + reg_offs);
70
71 return 0;
72}
73
74static int r8a7779_sysc_pwr_off(struct r8a7779_pm_ch *r8a7779_ch)
75{
76 return r8a7779_sysc_pwr_on_off(r8a7779_ch, 0, PWROFFCR_OFFS);
77}
78
79static int r8a7779_sysc_pwr_on(struct r8a7779_pm_ch *r8a7779_ch)
80{
81 return r8a7779_sysc_pwr_on_off(r8a7779_ch, 1, PWRONCR_OFFS);
82}
83
84static int r8a7779_sysc_update(struct r8a7779_pm_ch *r8a7779_ch,
85 int (*on_off_fn)(struct r8a7779_pm_ch *))
86{
87 unsigned int isr_mask = 1 << r8a7779_ch->isr_bit;
88 unsigned int chan_mask = 1 << r8a7779_ch->chan_bit;
89 unsigned int status;
90 unsigned long flags;
91 int ret = 0;
92 int k;
93
94 spin_lock_irqsave(&r8a7779_sysc_lock, flags);
95
96 iowrite32(isr_mask, r8a7779_sysc_base + SYSCISCR);
97
98 do {
99 ret = on_off_fn(r8a7779_ch);
100 if (ret)
101 goto out;
102
103 status = ioread32(r8a7779_sysc_base +
104 r8a7779_ch->chan_offs + PWRER_OFFS);
105 } while (status & chan_mask);
106
107 for (k = 0; k < SYSCISR_RETRIES; k++) {
108 if (ioread32(r8a7779_sysc_base + SYSCISR) & isr_mask)
109 break;
110 udelay(SYSCISR_DELAY_US);
111 }
112
113 if (k == SYSCISR_RETRIES)
114 ret = -EIO;
115
116 iowrite32(isr_mask, r8a7779_sysc_base + SYSCISCR);
117
118 out:
119 spin_unlock_irqrestore(&r8a7779_sysc_lock, flags);
120
121 pr_debug("r8a7779 power domain %d: %02x %02x %02x %02x %02x -> %d\n",
122 r8a7779_ch->isr_bit, ioread32(r8a7779_sysc_base + PWRSR0),
123 ioread32(r8a7779_sysc_base + PWRSR1),
124 ioread32(r8a7779_sysc_base + PWRSR2),
125 ioread32(r8a7779_sysc_base + PWRSR3),
126 ioread32(r8a7779_sysc_base + PWRSR4), ret);
127 return ret;
128}
129
130int r8a7779_sysc_power_down(struct r8a7779_pm_ch *r8a7779_ch)
131{
132 return r8a7779_sysc_update(r8a7779_ch, r8a7779_sysc_pwr_off);
133}
134
135int r8a7779_sysc_power_up(struct r8a7779_pm_ch *r8a7779_ch)
136{
137 return r8a7779_sysc_update(r8a7779_ch, r8a7779_sysc_pwr_on);
138}
139
140static void __init r8a7779_sysc_init(void) 32static void __init r8a7779_sysc_init(void)
141{ 33{
142 r8a7779_sysc_base = ioremap_nocache(0xffd85000, PAGE_SIZE); 34 void __iomem *base = rcar_sysc_init(0xffd85000);
143 if (!r8a7779_sysc_base)
144 panic("unable to ioremap r8a7779 SYSC hardware block\n");
145 35
146 /* enable all interrupt sources, but do not use interrupt handler */ 36 /* enable all interrupt sources, but do not use interrupt handler */
147 iowrite32(0x0131000e, r8a7779_sysc_base + SYSCIER); 37 iowrite32(0x0131000e, base + SYSCIER);
148 iowrite32(0, r8a7779_sysc_base + SYSCIMR); 38 iowrite32(0, base + SYSCIMR);
149} 39}
150 40
151#else /* CONFIG_PM || CONFIG_SMP */ 41#else /* CONFIG_PM || CONFIG_SMP */
@@ -158,24 +48,17 @@ static inline void r8a7779_sysc_init(void) {}
158 48
159static int pd_power_down(struct generic_pm_domain *genpd) 49static int pd_power_down(struct generic_pm_domain *genpd)
160{ 50{
161 return r8a7779_sysc_power_down(to_r8a7779_ch(genpd)); 51 return rcar_sysc_power_down(to_r8a7779_ch(genpd));
162} 52}
163 53
164static int pd_power_up(struct generic_pm_domain *genpd) 54static int pd_power_up(struct generic_pm_domain *genpd)
165{ 55{
166 return r8a7779_sysc_power_up(to_r8a7779_ch(genpd)); 56 return rcar_sysc_power_up(to_r8a7779_ch(genpd));
167} 57}
168 58
169static bool pd_is_off(struct generic_pm_domain *genpd) 59static bool pd_is_off(struct generic_pm_domain *genpd)
170{ 60{
171 struct r8a7779_pm_ch *r8a7779_ch = to_r8a7779_ch(genpd); 61 return rcar_sysc_power_is_off(to_r8a7779_ch(genpd));
172 unsigned int st;
173
174 st = ioread32(r8a7779_sysc_base + r8a7779_ch->chan_offs + PWRSR_OFFS);
175 if (st & (1 << r8a7779_ch->chan_bit))
176 return true;
177
178 return false;
179} 62}
180 63
181static bool pd_active_wakeup(struct device *dev) 64static bool pd_active_wakeup(struct device *dev)
diff --git a/arch/arm/mach-shmobile/pm-r8a7790.c b/arch/arm/mach-shmobile/pm-r8a7790.c
new file mode 100644
index 000000000000..fc82839e2c2a
--- /dev/null
+++ b/arch/arm/mach-shmobile/pm-r8a7790.c
@@ -0,0 +1,45 @@
1/*
2 * r8a7790 Power management support
3 *
4 * Copyright (C) 2013 Renesas Electronics Corporation
5 * Copyright (C) 2011 Renesas Solutions Corp.
6 * Copyright (C) 2011 Magnus Damm
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12
13#include <linux/kernel.h>
14#include <asm/io.h>
15#include <mach/pm-rcar.h>
16#include <mach/r8a7790.h>
17
18/* SYSC */
19#define SYSCIER 0x0c
20#define SYSCIMR 0x10
21
22#if defined(CONFIG_SMP)
23
24static void __init r8a7790_sysc_init(void)
25{
26 void __iomem *base = rcar_sysc_init(0xe6180000);
27
28 /* enable all interrupt sources, but do not use interrupt handler */
29 iowrite32(0x0131000e, base + SYSCIER);
30 iowrite32(0, base + SYSCIMR);
31}
32
33#else /* CONFIG_SMP */
34
35static inline void r8a7790_sysc_init(void) {}
36
37#endif /* CONFIG_SMP */
38
39void __init r8a7790_pm_init(void)
40{
41 static int once;
42
43 if (!once++)
44 r8a7790_sysc_init();
45}
diff --git a/arch/arm/mach-shmobile/pm-rcar.c b/arch/arm/mach-shmobile/pm-rcar.c
new file mode 100644
index 000000000000..1f465a12d1b1
--- /dev/null
+++ b/arch/arm/mach-shmobile/pm-rcar.c
@@ -0,0 +1,141 @@
1/*
2 * R-Car SYSC Power management support
3 *
4 * Copyright (C) 2014 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
11#include <linux/delay.h>
12#include <linux/err.h>
13#include <linux/mm.h>
14#include <linux/spinlock.h>
15#include <asm/io.h>
16#include <mach/pm-rcar.h>
17
18/* SYSC */
19#define SYSCSR 0x00
20#define SYSCISR 0x04
21#define SYSCISCR 0x08
22
23#define PWRSR_OFFS 0x00
24#define PWROFFCR_OFFS 0x04
25#define PWRONCR_OFFS 0x0c
26#define PWRER_OFFS 0x14
27
28#define SYSCSR_RETRIES 100
29#define SYSCSR_DELAY_US 1
30
31#define SYSCISR_RETRIES 1000
32#define SYSCISR_DELAY_US 1
33
34#if defined(CONFIG_PM) || defined(CONFIG_SMP)
35
36static void __iomem *rcar_sysc_base;
37static DEFINE_SPINLOCK(rcar_sysc_lock); /* SMP CPUs + I/O devices */
38
39static int rcar_sysc_pwr_on_off(struct rcar_sysc_ch *sysc_ch,
40 int sr_bit, int reg_offs)
41{
42 int k;
43
44 for (k = 0; k < SYSCSR_RETRIES; k++) {
45 if (ioread32(rcar_sysc_base + SYSCSR) & (1 << sr_bit))
46 break;
47 udelay(SYSCSR_DELAY_US);
48 }
49
50 if (k == SYSCSR_RETRIES)
51 return -EAGAIN;
52
53 iowrite32(1 << sysc_ch->chan_bit,
54 rcar_sysc_base + sysc_ch->chan_offs + reg_offs);
55
56 return 0;
57}
58
59static int rcar_sysc_pwr_off(struct rcar_sysc_ch *sysc_ch)
60{
61 return rcar_sysc_pwr_on_off(sysc_ch, 0, PWROFFCR_OFFS);
62}
63
64static int rcar_sysc_pwr_on(struct rcar_sysc_ch *sysc_ch)
65{
66 return rcar_sysc_pwr_on_off(sysc_ch, 1, PWRONCR_OFFS);
67}
68
69static int rcar_sysc_update(struct rcar_sysc_ch *sysc_ch,
70 int (*on_off_fn)(struct rcar_sysc_ch *))
71{
72 unsigned int isr_mask = 1 << sysc_ch->isr_bit;
73 unsigned int chan_mask = 1 << sysc_ch->chan_bit;
74 unsigned int status;
75 unsigned long flags;
76 int ret = 0;
77 int k;
78
79 spin_lock_irqsave(&rcar_sysc_lock, flags);
80
81 iowrite32(isr_mask, rcar_sysc_base + SYSCISCR);
82
83 do {
84 ret = on_off_fn(sysc_ch);
85 if (ret)
86 goto out;
87
88 status = ioread32(rcar_sysc_base +
89 sysc_ch->chan_offs + PWRER_OFFS);
90 } while (status & chan_mask);
91
92 for (k = 0; k < SYSCISR_RETRIES; k++) {
93 if (ioread32(rcar_sysc_base + SYSCISR) & isr_mask)
94 break;
95 udelay(SYSCISR_DELAY_US);
96 }
97
98 if (k == SYSCISR_RETRIES)
99 ret = -EIO;
100
101 iowrite32(isr_mask, rcar_sysc_base + SYSCISCR);
102
103 out:
104 spin_unlock_irqrestore(&rcar_sysc_lock, flags);
105
106 pr_debug("sysc power domain %d: %08x -> %d\n",
107 sysc_ch->isr_bit, ioread32(rcar_sysc_base + SYSCISR), ret);
108 return ret;
109}
110
111int rcar_sysc_power_down(struct rcar_sysc_ch *sysc_ch)
112{
113 return rcar_sysc_update(sysc_ch, rcar_sysc_pwr_off);
114}
115
116int rcar_sysc_power_up(struct rcar_sysc_ch *sysc_ch)
117{
118 return rcar_sysc_update(sysc_ch, rcar_sysc_pwr_on);
119}
120
121bool rcar_sysc_power_is_off(struct rcar_sysc_ch *sysc_ch)
122{
123 unsigned int st;
124
125 st = ioread32(rcar_sysc_base + sysc_ch->chan_offs + PWRSR_OFFS);
126 if (st & (1 << sysc_ch->chan_bit))
127 return true;
128
129 return false;
130}
131
132void __iomem *rcar_sysc_init(phys_addr_t base)
133{
134 rcar_sysc_base = ioremap_nocache(base, PAGE_SIZE);
135 if (!rcar_sysc_base)
136 panic("unable to ioremap R-Car SYSC hardware block\n");
137
138 return rcar_sysc_base;
139}
140
141#endif /* CONFIG_PM || CONFIG_SMP */
diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c
index c8f2a1a69a52..c71d667007b8 100644
--- a/arch/arm/mach-shmobile/setup-emev2.c
+++ b/arch/arm/mach-shmobile/setup-emev2.c
@@ -58,7 +58,7 @@ static void __init emev2_add_standard_devices_dt(void)
58 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 58 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
59} 59}
60 60
61static const char *emev2_boards_compat_dt[] __initdata = { 61static const char *emev2_boards_compat_dt[] __initconst = {
62 "renesas,emev2", 62 "renesas,emev2",
63 NULL, 63 NULL,
64}; 64};
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
index 6ab37aa1e919..c4616f0698c6 100644
--- a/arch/arm/mach-shmobile/setup-r8a7790.c
+++ b/arch/arm/mach-shmobile/setup-r8a7790.c
@@ -24,12 +24,100 @@
24#include <linux/platform_data/gpio-rcar.h> 24#include <linux/platform_data/gpio-rcar.h>
25#include <linux/platform_data/irq-renesas-irqc.h> 25#include <linux/platform_data/irq-renesas-irqc.h>
26#include <linux/serial_sci.h> 26#include <linux/serial_sci.h>
27#include <linux/sh_dma.h>
27#include <linux/sh_timer.h> 28#include <linux/sh_timer.h>
28#include <mach/common.h> 29#include <mach/common.h>
30#include <mach/dma-register.h>
29#include <mach/irqs.h> 31#include <mach/irqs.h>
30#include <mach/r8a7790.h> 32#include <mach/r8a7790.h>
31#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
32 34
35/* Audio-DMAC */
36#define AUDIO_DMAC_SLAVE(_id, _addr, t, r) \
37{ \
38 .slave_id = AUDIO_DMAC_SLAVE_## _id ##_TX, \
39 .addr = _addr + 0x8, \
40 .chcr = CHCR_TX(XMIT_SZ_32BIT), \
41 .mid_rid = t, \
42}, { \
43 .slave_id = AUDIO_DMAC_SLAVE_## _id ##_RX, \
44 .addr = _addr + 0xc, \
45 .chcr = CHCR_RX(XMIT_SZ_32BIT), \
46 .mid_rid = r, \
47}
48
49static const struct sh_dmae_slave_config r8a7790_audio_dmac_slaves[] = {
50 AUDIO_DMAC_SLAVE(SSI0, 0xec241000, 0x01, 0x02),
51 AUDIO_DMAC_SLAVE(SSI1, 0xec241040, 0x03, 0x04),
52 AUDIO_DMAC_SLAVE(SSI2, 0xec241080, 0x05, 0x06),
53 AUDIO_DMAC_SLAVE(SSI3, 0xec2410c0, 0x07, 0x08),
54 AUDIO_DMAC_SLAVE(SSI4, 0xec241100, 0x09, 0x0a),
55 AUDIO_DMAC_SLAVE(SSI5, 0xec241140, 0x0b, 0x0c),
56 AUDIO_DMAC_SLAVE(SSI6, 0xec241180, 0x0d, 0x0e),
57 AUDIO_DMAC_SLAVE(SSI7, 0xec2411c0, 0x0f, 0x10),
58 AUDIO_DMAC_SLAVE(SSI8, 0xec241200, 0x11, 0x12),
59 AUDIO_DMAC_SLAVE(SSI9, 0xec241240, 0x13, 0x14),
60};
61
62#define DMAE_CHANNEL(a, b) \
63{ \
64 .offset = (a) - 0x20, \
65 .dmars = (a) - 0x20 + 0x40, \
66 .chclr_bit = (b), \
67 .chclr_offset = 0x80 - 0x20, \
68}
69
70static const struct sh_dmae_channel r8a7790_audio_dmac_channels[] = {
71 DMAE_CHANNEL(0x8000, 0),
72 DMAE_CHANNEL(0x8080, 1),
73 DMAE_CHANNEL(0x8100, 2),
74 DMAE_CHANNEL(0x8180, 3),
75 DMAE_CHANNEL(0x8200, 4),
76 DMAE_CHANNEL(0x8280, 5),
77 DMAE_CHANNEL(0x8300, 6),
78 DMAE_CHANNEL(0x8380, 7),
79 DMAE_CHANNEL(0x8400, 8),
80 DMAE_CHANNEL(0x8480, 9),
81 DMAE_CHANNEL(0x8500, 10),
82 DMAE_CHANNEL(0x8580, 11),
83 DMAE_CHANNEL(0x8600, 12),
84};
85
86static struct sh_dmae_pdata r8a7790_audio_dmac_platform_data = {
87 .slave = r8a7790_audio_dmac_slaves,
88 .slave_num = ARRAY_SIZE(r8a7790_audio_dmac_slaves),
89 .channel = r8a7790_audio_dmac_channels,
90 .channel_num = ARRAY_SIZE(r8a7790_audio_dmac_channels),
91 .ts_low_shift = TS_LOW_SHIFT,
92 .ts_low_mask = TS_LOW_BIT << TS_LOW_SHIFT,
93 .ts_high_shift = TS_HI_SHIFT,
94 .ts_high_mask = TS_HI_BIT << TS_HI_SHIFT,
95 .ts_shift = dma_ts_shift,
96 .ts_shift_num = ARRAY_SIZE(dma_ts_shift),
97 .dmaor_init = DMAOR_DME,
98 .chclr_present = 1,
99 .chclr_bitwise = 1,
100};
101
102static struct resource r8a7790_audio_dmac_resources[] = {
103 /* Channel registers and DMAOR for low */
104 DEFINE_RES_MEM(0xec700020, 0x8663 - 0x20),
105 DEFINE_RES_IRQ(gic_spi(346)),
106 DEFINE_RES_NAMED(gic_spi(320), 13, NULL, IORESOURCE_IRQ),
107
108 /* Channel registers and DMAOR for hi */
109 DEFINE_RES_MEM(0xec720020, 0x8663 - 0x20), /* hi */
110 DEFINE_RES_IRQ(gic_spi(347)),
111 DEFINE_RES_NAMED(gic_spi(333), 13, NULL, IORESOURCE_IRQ),
112};
113
114#define r8a7790_register_audio_dmac(id) \
115 platform_device_register_resndata( \
116 &platform_bus, "sh-dma-engine", id, \
117 &r8a7790_audio_dmac_resources[id * 3], 3, \
118 &r8a7790_audio_dmac_platform_data, \
119 sizeof(r8a7790_audio_dmac_platform_data))
120
33static const struct resource pfc_resources[] __initconst = { 121static const struct resource pfc_resources[] __initconst = {
34 DEFINE_RES_MEM(0xe6060000, 0x250), 122 DEFINE_RES_MEM(0xe6060000, 0x250),
35}; 123};
@@ -101,6 +189,8 @@ void __init r8a7790_pinmux_init(void)
101 r8a7790_register_i2c(1); 189 r8a7790_register_i2c(1);
102 r8a7790_register_i2c(2); 190 r8a7790_register_i2c(2);
103 r8a7790_register_i2c(3); 191 r8a7790_register_i2c(3);
192 r8a7790_register_audio_dmac(0);
193 r8a7790_register_audio_dmac(1);
104} 194}
105 195
106#define __R8A7790_SCIF(scif_type, _scscr, index, baseaddr, irq) \ 196#define __R8A7790_SCIF(scif_type, _scscr, index, baseaddr, irq) \
diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c
index 69ccc6c6fd33..10604480f325 100644
--- a/arch/arm/mach-shmobile/setup-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c
@@ -28,7 +28,7 @@
28 28
29#define MODEMR 0xe6160060 29#define MODEMR 0xe6160060
30 30
31u32 __init rcar_gen2_read_mode_pins(void) 31u32 rcar_gen2_read_mode_pins(void)
32{ 32{
33 void __iomem *modemr = ioremap_nocache(MODEMR, 4); 33 void __iomem *modemr = ioremap_nocache(MODEMR, 4);
34 u32 mode; 34 u32 mode;
diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c
index 627c1f0d9478..e7a3201473d0 100644
--- a/arch/arm/mach-shmobile/smp-r8a7779.c
+++ b/arch/arm/mach-shmobile/smp-r8a7779.c
@@ -24,6 +24,7 @@
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <mach/common.h> 26#include <mach/common.h>
27#include <mach/pm-rcar.h>
27#include <mach/r8a7779.h> 28#include <mach/r8a7779.h>
28#include <asm/cacheflush.h> 29#include <asm/cacheflush.h>
29#include <asm/smp_plat.h> 30#include <asm/smp_plat.h>
@@ -33,25 +34,25 @@
33#define AVECR IOMEM(0xfe700040) 34#define AVECR IOMEM(0xfe700040)
34#define R8A7779_SCU_BASE 0xf0000000 35#define R8A7779_SCU_BASE 0xf0000000
35 36
36static struct r8a7779_pm_ch r8a7779_ch_cpu1 = { 37static struct rcar_sysc_ch r8a7779_ch_cpu1 = {
37 .chan_offs = 0x40, /* PWRSR0 .. PWRER0 */ 38 .chan_offs = 0x40, /* PWRSR0 .. PWRER0 */
38 .chan_bit = 1, /* ARM1 */ 39 .chan_bit = 1, /* ARM1 */
39 .isr_bit = 1, /* ARM1 */ 40 .isr_bit = 1, /* ARM1 */
40}; 41};
41 42
42static struct r8a7779_pm_ch r8a7779_ch_cpu2 = { 43static struct rcar_sysc_ch r8a7779_ch_cpu2 = {
43 .chan_offs = 0x40, /* PWRSR0 .. PWRER0 */ 44 .chan_offs = 0x40, /* PWRSR0 .. PWRER0 */
44 .chan_bit = 2, /* ARM2 */ 45 .chan_bit = 2, /* ARM2 */
45 .isr_bit = 2, /* ARM2 */ 46 .isr_bit = 2, /* ARM2 */
46}; 47};
47 48
48static struct r8a7779_pm_ch r8a7779_ch_cpu3 = { 49static struct rcar_sysc_ch r8a7779_ch_cpu3 = {
49 .chan_offs = 0x40, /* PWRSR0 .. PWRER0 */ 50 .chan_offs = 0x40, /* PWRSR0 .. PWRER0 */
50 .chan_bit = 3, /* ARM3 */ 51 .chan_bit = 3, /* ARM3 */
51 .isr_bit = 3, /* ARM3 */ 52 .isr_bit = 3, /* ARM3 */
52}; 53};
53 54
54static struct r8a7779_pm_ch *r8a7779_ch_cpu[4] = { 55static struct rcar_sysc_ch *r8a7779_ch_cpu[4] = {
55 [1] = &r8a7779_ch_cpu1, 56 [1] = &r8a7779_ch_cpu1,
56 [2] = &r8a7779_ch_cpu2, 57 [2] = &r8a7779_ch_cpu2,
57 [3] = &r8a7779_ch_cpu3, 58 [3] = &r8a7779_ch_cpu3,
@@ -67,7 +68,7 @@ void __init r8a7779_register_twd(void)
67 68
68static int r8a7779_platform_cpu_kill(unsigned int cpu) 69static int r8a7779_platform_cpu_kill(unsigned int cpu)
69{ 70{
70 struct r8a7779_pm_ch *ch = NULL; 71 struct rcar_sysc_ch *ch = NULL;
71 int ret = -EIO; 72 int ret = -EIO;
72 73
73 cpu = cpu_logical_map(cpu); 74 cpu = cpu_logical_map(cpu);
@@ -76,14 +77,14 @@ static int r8a7779_platform_cpu_kill(unsigned int cpu)
76 ch = r8a7779_ch_cpu[cpu]; 77 ch = r8a7779_ch_cpu[cpu];
77 78
78 if (ch) 79 if (ch)
79 ret = r8a7779_sysc_power_down(ch); 80 ret = rcar_sysc_power_down(ch);
80 81
81 return ret ? ret : 1; 82 return ret ? ret : 1;
82} 83}
83 84
84static int r8a7779_boot_secondary(unsigned int cpu, struct task_struct *idle) 85static int r8a7779_boot_secondary(unsigned int cpu, struct task_struct *idle)
85{ 86{
86 struct r8a7779_pm_ch *ch = NULL; 87 struct rcar_sysc_ch *ch = NULL;
87 unsigned int lcpu = cpu_logical_map(cpu); 88 unsigned int lcpu = cpu_logical_map(cpu);
88 int ret; 89 int ret;
89 90
@@ -91,7 +92,7 @@ static int r8a7779_boot_secondary(unsigned int cpu, struct task_struct *idle)
91 ch = r8a7779_ch_cpu[lcpu]; 92 ch = r8a7779_ch_cpu[lcpu];
92 93
93 if (ch) 94 if (ch)
94 ret = r8a7779_sysc_power_up(ch); 95 ret = rcar_sysc_power_up(ch);
95 else 96 else
96 ret = -EIO; 97 ret = -EIO;
97 98
diff --git a/arch/arm/mach-shmobile/smp-r8a7790.c b/arch/arm/mach-shmobile/smp-r8a7790.c
index 015e2753de1f..591052799e8f 100644
--- a/arch/arm/mach-shmobile/smp-r8a7790.c
+++ b/arch/arm/mach-shmobile/smp-r8a7790.c
@@ -19,6 +19,8 @@
19#include <linux/io.h> 19#include <linux/io.h>
20#include <asm/smp_plat.h> 20#include <asm/smp_plat.h>
21#include <mach/common.h> 21#include <mach/common.h>
22#include <mach/pm-rcar.h>
23#include <mach/r8a7790.h>
22 24
23#define RST 0xe6160000 25#define RST 0xe6160000
24#define CA15BAR 0x0020 26#define CA15BAR 0x0020
@@ -27,6 +29,16 @@
27#define CA7RESCNT 0x0044 29#define CA7RESCNT 0x0044
28#define MERAM 0xe8080000 30#define MERAM 0xe8080000
29 31
32static struct rcar_sysc_ch r8a7790_ca15_scu = {
33 .chan_offs = 0x180, /* PWRSR5 .. PWRER5 */
34 .isr_bit = 12, /* CA15-SCU */
35};
36
37static struct rcar_sysc_ch r8a7790_ca7_scu = {
38 .chan_offs = 0x100, /* PWRSR3 .. PWRER3 */
39 .isr_bit = 21, /* CA7-SCU */
40};
41
30static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus) 42static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus)
31{ 43{
32 void __iomem *p; 44 void __iomem *p;
@@ -54,6 +66,11 @@ static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus)
54 writel_relaxed((readl_relaxed(p + CA7RESCNT) & ~0x0f) | 0x5a5a0000, 66 writel_relaxed((readl_relaxed(p + CA7RESCNT) & ~0x0f) | 0x5a5a0000,
55 p + CA7RESCNT); 67 p + CA7RESCNT);
56 iounmap(p); 68 iounmap(p);
69
70 /* turn on power to SCU */
71 r8a7790_pm_init();
72 rcar_sysc_power_up(&r8a7790_ca15_scu);
73 rcar_sysc_power_up(&r8a7790_ca7_scu);
57} 74}
58 75
59struct smp_operations r8a7790_smp_ops __initdata = { 76struct smp_operations r8a7790_smp_ops __initdata = {
diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig
index aee77f06f887..b5f8d75d51a0 100644
--- a/arch/arm/mach-socfpga/Kconfig
+++ b/arch/arm/mach-socfpga/Kconfig
@@ -1,17 +1,10 @@
1config ARCH_SOCFPGA 1config ARCH_SOCFPGA
2 bool "Altera SOCFPGA family" if ARCH_MULTI_V7 2 bool "Altera SOCFPGA family" if ARCH_MULTI_V7
3 select ARCH_WANT_OPTIONAL_GPIOLIB
4 select ARM_AMBA 3 select ARM_AMBA
5 select ARM_GIC 4 select ARM_GIC
6 select CACHE_L2X0 5 select CACHE_L2X0
7 select COMMON_CLK
8 select CPU_V7
9 select DW_APB_TIMER_OF 6 select DW_APB_TIMER_OF
10 select GENERIC_CLOCKEVENTS
11 select GPIO_PL061 if GPIOLIB 7 select GPIO_PL061 if GPIOLIB
12 select HAVE_ARM_SCU 8 select HAVE_ARM_SCU
13 select HAVE_ARM_TWD if SMP 9 select HAVE_ARM_TWD if SMP
14 select HAVE_SMP
15 select MFD_SYSCON 10 select MFD_SYSCON
16 select SPARSE_IRQ
17 select USE_OF
diff --git a/arch/arm/mach-socfpga/socfpga.c b/arch/arm/mach-socfpga/socfpga.c
index dd0d49cdbe09..d86231e11b34 100644
--- a/arch/arm/mach-socfpga/socfpga.c
+++ b/arch/arm/mach-socfpga/socfpga.c
@@ -29,7 +29,6 @@
29void __iomem *socfpga_scu_base_addr = ((void __iomem *)(SOCFPGA_SCU_VIRT_BASE)); 29void __iomem *socfpga_scu_base_addr = ((void __iomem *)(SOCFPGA_SCU_VIRT_BASE));
30void __iomem *sys_manager_base_addr; 30void __iomem *sys_manager_base_addr;
31void __iomem *rst_manager_base_addr; 31void __iomem *rst_manager_base_addr;
32void __iomem *clk_mgr_base_addr;
33unsigned long cpu1start_addr; 32unsigned long cpu1start_addr;
34 33
35static struct map_desc scu_io_desc __initdata = { 34static struct map_desc scu_io_desc __initdata = {
@@ -78,9 +77,6 @@ void __init socfpga_sysmgr_init(void)
78 77
79 np = of_find_compatible_node(NULL, NULL, "altr,rst-mgr"); 78 np = of_find_compatible_node(NULL, NULL, "altr,rst-mgr");
80 rst_manager_base_addr = of_iomap(np, 0); 79 rst_manager_base_addr = of_iomap(np, 0);
81
82 np = of_find_compatible_node(NULL, NULL, "altr,clk-mgr");
83 clk_mgr_base_addr = of_iomap(np, 0);
84} 80}
85 81
86static void __init socfpga_init_irq(void) 82static void __init socfpga_init_irq(void)
@@ -106,7 +102,6 @@ static void __init socfpga_cyclone5_init(void)
106{ 102{
107 l2x0_of_init(0, ~0UL); 103 l2x0_of_init(0, ~0UL);
108 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 104 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
109 socfpga_init_clocks();
110} 105}
111 106
112static const char *altera_dt_match[] = { 107static const char *altera_dt_match[] = {
diff --git a/arch/arm/mach-spear/Kconfig b/arch/arm/mach-spear/Kconfig
index ac1710e64d9a..0786249b2832 100644
--- a/arch/arm/mach-spear/Kconfig
+++ b/arch/arm/mach-spear/Kconfig
@@ -8,8 +8,6 @@ menuconfig PLAT_SPEAR
8 select ARCH_REQUIRE_GPIOLIB 8 select ARCH_REQUIRE_GPIOLIB
9 select ARM_AMBA 9 select ARM_AMBA
10 select CLKSRC_MMIO 10 select CLKSRC_MMIO
11 select COMMON_CLK
12 select GENERIC_CLOCKEVENTS
13 11
14if PLAT_SPEAR 12if PLAT_SPEAR
15 13
@@ -18,14 +16,10 @@ config ARCH_SPEAR13XX
18 depends on ARCH_MULTI_V7 || PLAT_SPEAR_SINGLE 16 depends on ARCH_MULTI_V7 || PLAT_SPEAR_SINGLE
19 select ARCH_HAS_CPUFREQ 17 select ARCH_HAS_CPUFREQ
20 select ARM_GIC 18 select ARM_GIC
21 select CPU_V7
22 select GPIO_SPEAR_SPICS 19 select GPIO_SPEAR_SPICS
23 select HAVE_ARM_SCU if SMP 20 select HAVE_ARM_SCU if SMP
24 select HAVE_ARM_TWD if SMP 21 select HAVE_ARM_TWD if SMP
25 select HAVE_SMP
26 select MIGHT_HAVE_CACHE_L2X0
27 select PINCTRL 22 select PINCTRL
28 select USE_OF
29 help 23 help
30 Supports for ARM's SPEAR13XX family 24 Supports for ARM's SPEAR13XX family
31 25
@@ -50,9 +44,7 @@ config ARCH_SPEAR3XX
50 depends on ARCH_MULTI_V5 || PLAT_SPEAR_SINGLE 44 depends on ARCH_MULTI_V5 || PLAT_SPEAR_SINGLE
51 depends on !ARCH_SPEAR13XX 45 depends on !ARCH_SPEAR13XX
52 select ARM_VIC 46 select ARM_VIC
53 select CPU_ARM926T
54 select PINCTRL 47 select PINCTRL
55 select USE_OF
56 help 48 help
57 Supports for ARM's SPEAR3XX family 49 Supports for ARM's SPEAR3XX family
58 50
@@ -83,16 +75,14 @@ config ARCH_SPEAR6XX
83 depends on ARCH_MULTI_V5 || PLAT_SPEAR_SINGLE 75 depends on ARCH_MULTI_V5 || PLAT_SPEAR_SINGLE
84 depends on !ARCH_SPEAR13XX 76 depends on !ARCH_SPEAR13XX
85 select ARM_VIC 77 select ARM_VIC
86 select CPU_ARM926T
87 help 78 help
88 Supports for ARM's SPEAR6XX family 79 Supports for ARM's SPEAR6XX family
89 80
90config MACH_SPEAR600 81config MACH_SPEAR600
91 def_bool y 82 def_bool y
92 depends on ARCH_SPEAR6XX 83 depends on ARCH_SPEAR6XX
93 select USE_OF
94 help 84 help
95 Supports ST SPEAr600 boards configured via the device-treesource "arch/arm/mach-spear6xx/Kconfig" 85 Supports ST SPEAr600 boards configured via the device-tree
96 86
97config ARCH_SPEAR_AUTO 87config ARCH_SPEAR_AUTO
98 def_bool PLAT_SPEAR_SINGLE 88 def_bool PLAT_SPEAR_SINGLE
diff --git a/arch/arm/mach-spear/include/mach/timex.h b/arch/arm/mach-spear/include/mach/timex.h
deleted file mode 100644
index ef95e5b780bd..000000000000
--- a/arch/arm/mach-spear/include/mach/timex.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/plat-spear/include/plat/timex.h
3 *
4 * SPEAr platform specific timex definitions
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar <viresh.linux@gmail.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef __PLAT_TIMEX_H
15#define __PLAT_TIMEX_H
16
17#define CLOCK_TICK_RATE 48000000
18
19#endif /* __PLAT_TIMEX_H */
diff --git a/arch/arm/mach-spear/spear1310.c b/arch/arm/mach-spear/spear1310.c
index 7ad003001ab7..824b12a56a42 100644
--- a/arch/arm/mach-spear/spear1310.c
+++ b/arch/arm/mach-spear/spear1310.c
@@ -28,6 +28,7 @@
28static void __init spear1310_dt_init(void) 28static void __init spear1310_dt_init(void)
29{ 29{
30 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 30 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
31 platform_device_register_simple("spear-cpufreq", -1, NULL, 0);
31} 32}
32 33
33static const char * const spear1310_dt_board_compat[] = { 34static const char * const spear1310_dt_board_compat[] = {
diff --git a/arch/arm/mach-spear/spear1340.c b/arch/arm/mach-spear/spear1340.c
index 3fb683424729..7b6bff7154e1 100644
--- a/arch/arm/mach-spear/spear1340.c
+++ b/arch/arm/mach-spear/spear1340.c
@@ -143,6 +143,7 @@ static void __init spear1340_dt_init(void)
143{ 143{
144 of_platform_populate(NULL, of_default_bus_match_table, 144 of_platform_populate(NULL, of_default_bus_match_table,
145 spear1340_auxdata_lookup, NULL); 145 spear1340_auxdata_lookup, NULL);
146 platform_device_register_simple("spear-cpufreq", -1, NULL, 0);
146} 147}
147 148
148static const char * const spear1340_dt_board_compat[] = { 149static const char * const spear1340_dt_board_compat[] = {
diff --git a/arch/arm/mach-spear/time.c b/arch/arm/mach-spear/time.c
index d449673e40f7..218ba5b67d92 100644
--- a/arch/arm/mach-spear/time.c
+++ b/arch/arm/mach-spear/time.c
@@ -172,7 +172,7 @@ static irqreturn_t spear_timer_interrupt(int irq, void *dev_id)
172 172
173static struct irqaction spear_timer_irq = { 173static struct irqaction spear_timer_irq = {
174 .name = "timer", 174 .name = "timer",
175 .flags = IRQF_DISABLED | IRQF_TIMER, 175 .flags = IRQF_TIMER,
176 .handler = spear_timer_interrupt 176 .handler = spear_timer_interrupt
177}; 177};
178 178
diff --git a/arch/arm/mach-sti/Kconfig b/arch/arm/mach-sti/Kconfig
index d71654bc8d54..abf9ee9bbc3f 100644
--- a/arch/arm/mach-sti/Kconfig
+++ b/arch/arm/mach-sti/Kconfig
@@ -1,14 +1,11 @@
1menuconfig ARCH_STI 1menuconfig ARCH_STI
2 bool "STMicroelectronics Consumer Electronics SOCs with Device Trees" if ARCH_MULTI_V7 2 bool "STMicroelectronics Consumer Electronics SOCs with Device Trees" if ARCH_MULTI_V7
3 select GENERIC_CLOCKEVENTS
4 select CLKDEV_LOOKUP
5 select ARM_GIC 3 select ARM_GIC
6 select ARM_GLOBAL_TIMER 4 select ARM_GLOBAL_TIMER
7 select PINCTRL 5 select PINCTRL
8 select PINCTRL_ST 6 select PINCTRL_ST
9 select MFD_SYSCON 7 select MFD_SYSCON
10 select MIGHT_HAVE_CACHE_L2X0 8 select ARCH_HAS_RESET_CONTROLLER
11 select HAVE_SMP
12 select HAVE_ARM_SCU if SMP 9 select HAVE_ARM_SCU if SMP
13 select ARCH_REQUIRE_GPIOLIB 10 select ARCH_REQUIRE_GPIOLIB
14 select ARM_ERRATA_754322 11 select ARM_ERRATA_754322
@@ -28,6 +25,7 @@ if ARCH_STI
28config SOC_STIH415 25config SOC_STIH415
29 bool "STiH415 STMicroelectronics Consumer Electronics family" 26 bool "STiH415 STMicroelectronics Consumer Electronics family"
30 default y 27 default y
28 select STIH415_RESET
31 help 29 help
32 This enables support for STMicroelectronics Digital Consumer 30 This enables support for STMicroelectronics Digital Consumer
33 Electronics family StiH415 parts, primarily targeted at set-top-box 31 Electronics family StiH415 parts, primarily targeted at set-top-box
@@ -37,6 +35,7 @@ config SOC_STIH415
37config SOC_STIH416 35config SOC_STIH416
38 bool "STiH416 STMicroelectronics Consumer Electronics family" 36 bool "STiH416 STMicroelectronics Consumer Electronics family"
39 default y 37 default y
38 select STIH416_RESET
40 help 39 help
41 This enables support for STMicroelectronics Digital Consumer 40 This enables support for STMicroelectronics Digital Consumer
42 Electronics family StiH416 parts, primarily targeted at set-top-box 41 Electronics family StiH416 parts, primarily targeted at set-top-box
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index b9d6cad8669b..b57d7d53b9d3 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -5,14 +5,10 @@ config ARCH_SUNXI
5 select ARM_GIC 5 select ARM_GIC
6 select ARM_PSCI 6 select ARM_PSCI
7 select CLKSRC_MMIO 7 select CLKSRC_MMIO
8 select CLKSRC_OF
9 select COMMON_CLK
10 select GENERIC_CLOCKEVENTS
11 select GENERIC_IRQ_CHIP 8 select GENERIC_IRQ_CHIP
12 select HAVE_SMP 9 select HAVE_ARM_ARCH_TIMER
13 select PINCTRL 10 select PINCTRL
14 select PINCTRL_SUNXI 11 select PINCTRL_SUNXI
15 select RESET_CONTROLLER 12 select RESET_CONTROLLER
16 select SPARSE_IRQ
17 select SUN4I_TIMER 13 select SUN4I_TIMER
18 select SUN5I_HSTIMER 14 select SUN5I_HSTIMER
diff --git a/arch/arm/mach-sunxi/Makefile b/arch/arm/mach-sunxi/Makefile
index d9397202d6ec..27b168f121a1 100644
--- a/arch/arm/mach-sunxi/Makefile
+++ b/arch/arm/mach-sunxi/Makefile
@@ -1,2 +1,2 @@
1obj-$(CONFIG_ARCH_SUNXI) += sunxi.o 1obj-$(CONFIG_ARCH_SUNXI) += sunxi.o
2obj-$(CONFIG_SMP) += platsmp.o headsmp.o 2obj-$(CONFIG_SMP) += platsmp.o
diff --git a/arch/arm/mach-sunxi/headsmp.S b/arch/arm/mach-sunxi/headsmp.S
deleted file mode 100644
index a10d494fb37b..000000000000
--- a/arch/arm/mach-sunxi/headsmp.S
+++ /dev/null
@@ -1,9 +0,0 @@
1#include <linux/linkage.h>
2#include <linux/init.h>
3
4 .section ".text.head", "ax"
5
6ENTRY(sun6i_secondary_startup)
7 msr cpsr_fsxc, #0xd3
8 b secondary_startup
9ENDPROC(sun6i_secondary_startup)
diff --git a/arch/arm/mach-sunxi/platsmp.c b/arch/arm/mach-sunxi/platsmp.c
index 7b141d8342a1..0c7dbce033cc 100644
--- a/arch/arm/mach-sunxi/platsmp.c
+++ b/arch/arm/mach-sunxi/platsmp.c
@@ -82,7 +82,7 @@ static int sun6i_smp_boot_secondary(unsigned int cpu,
82 spin_lock(&cpu_lock); 82 spin_lock(&cpu_lock);
83 83
84 /* Set CPU boot address */ 84 /* Set CPU boot address */
85 writel(virt_to_phys(sun6i_secondary_startup), 85 writel(virt_to_phys(secondary_startup),
86 cpucfg_membase + CPUCFG_PRIVATE0_REG); 86 cpucfg_membase + CPUCFG_PRIVATE0_REG);
87 87
88 /* Assert the CPU core in reset */ 88 /* Assert the CPU core in reset */
diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c
index aeea6ceea725..460b5a4962ef 100644
--- a/arch/arm/mach-sunxi/sunxi.c
+++ b/arch/arm/mach-sunxi/sunxi.c
@@ -94,8 +94,8 @@ static void sun6i_restart(enum reboot_mode mode, const char *cmd)
94} 94}
95 95
96static struct of_device_id sunxi_restart_ids[] = { 96static struct of_device_id sunxi_restart_ids[] = {
97 { .compatible = "allwinner,sun4i-wdt" }, 97 { .compatible = "allwinner,sun4i-a10-wdt" },
98 { .compatible = "allwinner,sun6i-wdt" }, 98 { .compatible = "allwinner,sun6i-a31-wdt" },
99 { /*sentinel*/ } 99 { /*sentinel*/ }
100}; 100};
101 101
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index b1232d8be6f5..92d660f9610f 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -5,24 +5,15 @@ config ARCH_TEGRA
5 select ARCH_SUPPORTS_TRUSTED_FOUNDATIONS 5 select ARCH_SUPPORTS_TRUSTED_FOUNDATIONS
6 select ARM_GIC 6 select ARM_GIC
7 select CLKSRC_MMIO 7 select CLKSRC_MMIO
8 select CLKSRC_OF
9 select COMMON_CLK
10 select CPU_V7
11 select GENERIC_CLOCKEVENTS
12 select HAVE_ARM_SCU if SMP 8 select HAVE_ARM_SCU if SMP
13 select HAVE_ARM_TWD if SMP 9 select HAVE_ARM_TWD if SMP
14 select HAVE_SMP
15 select MIGHT_HAVE_CACHE_L2X0
16 select MIGHT_HAVE_PCI 10 select MIGHT_HAVE_PCI
17 select PINCTRL 11 select PINCTRL
18 select ARCH_HAS_RESET_CONTROLLER 12 select ARCH_HAS_RESET_CONTROLLER
19 select RESET_CONTROLLER 13 select RESET_CONTROLLER
20 select SOC_BUS 14 select SOC_BUS
21 select SPARSE_IRQ
22 select USB_ARCH_HAS_EHCI if USB_SUPPORT
23 select USB_ULPI if USB_PHY 15 select USB_ULPI if USB_PHY
24 select USB_ULPI_VIEWPORT if USB_PHY 16 select USB_ULPI_VIEWPORT if USB_PHY
25 select USE_OF
26 help 17 help
27 This enables support for NVIDIA Tegra based systems. 18 This enables support for NVIDIA Tegra based systems.
28 19
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index 019bb1758662..6fbfbb77dcd9 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -14,7 +14,6 @@ obj-y += sleep.o
14obj-y += tegra.o 14obj-y += tegra.o
15obj-$(CONFIG_CPU_IDLE) += cpuidle.o 15obj-$(CONFIG_CPU_IDLE) += cpuidle.o
16obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20_speedo.o 16obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra20_speedo.o
17obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_emc.o
18obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += sleep-tegra20.o 17obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += sleep-tegra20.o
19obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += pm-tegra20.o 18obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += pm-tegra20.o
20ifeq ($(CONFIG_CPU_IDLE),y) 19ifeq ($(CONFIG_CPU_IDLE),y)
diff --git a/arch/arm/mach-tegra/cpuidle-tegra114.c b/arch/arm/mach-tegra/cpuidle-tegra114.c
index e0b87300243d..b5fb7c110c64 100644
--- a/arch/arm/mach-tegra/cpuidle-tegra114.c
+++ b/arch/arm/mach-tegra/cpuidle-tegra114.c
@@ -19,6 +19,7 @@
19#include <linux/cpuidle.h> 19#include <linux/cpuidle.h>
20#include <linux/cpu_pm.h> 20#include <linux/cpu_pm.h>
21#include <linux/clockchips.h> 21#include <linux/clockchips.h>
22#include <asm/firmware.h>
22 23
23#include <asm/cpuidle.h> 24#include <asm/cpuidle.h>
24#include <asm/suspend.h> 25#include <asm/suspend.h>
@@ -45,7 +46,11 @@ static int tegra114_idle_power_down(struct cpuidle_device *dev,
45 46
46 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu); 47 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu);
47 48
48 cpu_suspend(0, tegra30_sleep_cpu_secondary_finish); 49 call_firmware_op(prepare_idle);
50
51 /* Do suspend by ourselves if the firmware does not implement it */
52 if (call_firmware_op(do_idle) == -ENOSYS)
53 cpu_suspend(0, tegra30_sleep_cpu_secondary_finish);
49 54
50 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu); 55 clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu);
51 56
diff --git a/arch/arm/mach-tegra/platsmp.c b/arch/arm/mach-tegra/platsmp.c
index eb72ae709124..929d1046e2b4 100644
--- a/arch/arm/mach-tegra/platsmp.c
+++ b/arch/arm/mach-tegra/platsmp.c
@@ -114,7 +114,7 @@ static int tegra30_boot_secondary(unsigned int cpu, struct task_struct *idle)
114 114
115 /* Wait for the power to come up. */ 115 /* Wait for the power to come up. */
116 timeout = jiffies + msecs_to_jiffies(100); 116 timeout = jiffies + msecs_to_jiffies(100);
117 while (tegra_pmc_cpu_is_powered(cpu)) { 117 while (!tegra_pmc_cpu_is_powered(cpu)) {
118 if (time_after(jiffies, timeout)) 118 if (time_after(jiffies, timeout))
119 return -ETIMEDOUT; 119 return -ETIMEDOUT;
120 udelay(10); 120 udelay(10);
diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c
index 3d0c537d9b94..4cefc5cd6bed 100644
--- a/arch/arm/mach-tegra/powergate.c
+++ b/arch/arm/mach-tegra/powergate.c
@@ -484,6 +484,7 @@ int tegra_io_rail_power_on(int id)
484 484
485 return 0; 485 return 0;
486} 486}
487EXPORT_SYMBOL(tegra_io_rail_power_on);
487 488
488int tegra_io_rail_power_off(int id) 489int tegra_io_rail_power_off(int id)
489{ 490{
@@ -511,3 +512,4 @@ int tegra_io_rail_power_off(int id)
511 512
512 return 0; 513 return 0;
513} 514}
515EXPORT_SYMBOL(tegra_io_rail_power_off);
diff --git a/arch/arm/mach-tegra/tegra2_emc.c b/arch/arm/mach-tegra/tegra2_emc.c
deleted file mode 100644
index 3ae4a7f1a2fb..000000000000
--- a/arch/arm/mach-tegra/tegra2_emc.c
+++ /dev/null
@@ -1,347 +0,0 @@
1/*
2 * Copyright (C) 2011 Google, Inc.
3 *
4 * Author:
5 * Colin Cross <ccross@android.com>
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
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 */
17
18#include <linux/kernel.h>
19#include <linux/device.h>
20#include <linux/clk.h>
21#include <linux/err.h>
22#include <linux/io.h>
23#include <linux/module.h>
24#include <linux/of.h>
25#include <linux/platform_device.h>
26#include <linux/platform_data/tegra_emc.h>
27
28#include "tegra2_emc.h"
29#include "fuse.h"
30
31#ifdef CONFIG_TEGRA_EMC_SCALING_ENABLE
32static bool emc_enable = true;
33#else
34static bool emc_enable;
35#endif
36module_param(emc_enable, bool, 0644);
37
38static struct platform_device *emc_pdev;
39static void __iomem *emc_regbase;
40
41static inline void emc_writel(u32 val, unsigned long addr)
42{
43 writel(val, emc_regbase + addr);
44}
45
46static inline u32 emc_readl(unsigned long addr)
47{
48 return readl(emc_regbase + addr);
49}
50
51static const unsigned long emc_reg_addr[TEGRA_EMC_NUM_REGS] = {
52 0x2c, /* RC */
53 0x30, /* RFC */
54 0x34, /* RAS */
55 0x38, /* RP */
56 0x3c, /* R2W */
57 0x40, /* W2R */
58 0x44, /* R2P */
59 0x48, /* W2P */
60 0x4c, /* RD_RCD */
61 0x50, /* WR_RCD */
62 0x54, /* RRD */
63 0x58, /* REXT */
64 0x5c, /* WDV */
65 0x60, /* QUSE */
66 0x64, /* QRST */
67 0x68, /* QSAFE */
68 0x6c, /* RDV */
69 0x70, /* REFRESH */
70 0x74, /* BURST_REFRESH_NUM */
71 0x78, /* PDEX2WR */
72 0x7c, /* PDEX2RD */
73 0x80, /* PCHG2PDEN */
74 0x84, /* ACT2PDEN */
75 0x88, /* AR2PDEN */
76 0x8c, /* RW2PDEN */
77 0x90, /* TXSR */
78 0x94, /* TCKE */
79 0x98, /* TFAW */
80 0x9c, /* TRPAB */
81 0xa0, /* TCLKSTABLE */
82 0xa4, /* TCLKSTOP */
83 0xa8, /* TREFBW */
84 0xac, /* QUSE_EXTRA */
85 0x114, /* FBIO_CFG6 */
86 0xb0, /* ODT_WRITE */
87 0xb4, /* ODT_READ */
88 0x104, /* FBIO_CFG5 */
89 0x2bc, /* CFG_DIG_DLL */
90 0x2c0, /* DLL_XFORM_DQS */
91 0x2c4, /* DLL_XFORM_QUSE */
92 0x2e0, /* ZCAL_REF_CNT */
93 0x2e4, /* ZCAL_WAIT_CNT */
94 0x2a8, /* AUTO_CAL_INTERVAL */
95 0x2d0, /* CFG_CLKTRIM_0 */
96 0x2d4, /* CFG_CLKTRIM_1 */
97 0x2d8, /* CFG_CLKTRIM_2 */
98};
99
100/* Select the closest EMC rate that is higher than the requested rate */
101long tegra_emc_round_rate(unsigned long rate)
102{
103 struct tegra_emc_pdata *pdata;
104 int i;
105 int best = -1;
106 unsigned long distance = ULONG_MAX;
107
108 if (!emc_pdev)
109 return -EINVAL;
110
111 pdata = emc_pdev->dev.platform_data;
112
113 pr_debug("%s: %lu\n", __func__, rate);
114
115 /*
116 * The EMC clock rate is twice the bus rate, and the bus rate is
117 * measured in kHz
118 */
119 rate = rate / 2 / 1000;
120
121 for (i = 0; i < pdata->num_tables; i++) {
122 if (pdata->tables[i].rate >= rate &&
123 (pdata->tables[i].rate - rate) < distance) {
124 distance = pdata->tables[i].rate - rate;
125 best = i;
126 }
127 }
128
129 if (best < 0)
130 return -EINVAL;
131
132 pr_debug("%s: using %lu\n", __func__, pdata->tables[best].rate);
133
134 return pdata->tables[best].rate * 2 * 1000;
135}
136
137/*
138 * The EMC registers have shadow registers. When the EMC clock is updated
139 * in the clock controller, the shadow registers are copied to the active
140 * registers, allowing glitchless memory bus frequency changes.
141 * This function updates the shadow registers for a new clock frequency,
142 * and relies on the clock lock on the emc clock to avoid races between
143 * multiple frequency changes
144 */
145int tegra_emc_set_rate(unsigned long rate)
146{
147 struct tegra_emc_pdata *pdata;
148 int i;
149 int j;
150
151 if (!emc_pdev)
152 return -EINVAL;
153
154 pdata = emc_pdev->dev.platform_data;
155
156 /*
157 * The EMC clock rate is twice the bus rate, and the bus rate is
158 * measured in kHz
159 */
160 rate = rate / 2 / 1000;
161
162 for (i = 0; i < pdata->num_tables; i++)
163 if (pdata->tables[i].rate == rate)
164 break;
165
166 if (i >= pdata->num_tables)
167 return -EINVAL;
168
169 pr_debug("%s: setting to %lu\n", __func__, rate);
170
171 for (j = 0; j < TEGRA_EMC_NUM_REGS; j++)
172 emc_writel(pdata->tables[i].regs[j], emc_reg_addr[j]);
173
174 emc_readl(pdata->tables[i].regs[TEGRA_EMC_NUM_REGS - 1]);
175
176 return 0;
177}
178
179#ifdef CONFIG_OF
180static struct device_node *tegra_emc_ramcode_devnode(struct device_node *np)
181{
182 struct device_node *iter;
183 u32 reg;
184
185 for_each_child_of_node(np, iter) {
186 if (of_property_read_u32(iter, "nvidia,ram-code", &reg))
187 continue;
188 if (reg == tegra_bct_strapping)
189 return of_node_get(iter);
190 }
191
192 return NULL;
193}
194
195static struct tegra_emc_pdata *tegra_emc_dt_parse_pdata(
196 struct platform_device *pdev)
197{
198 struct device_node *np = pdev->dev.of_node;
199 struct device_node *tnp, *iter;
200 struct tegra_emc_pdata *pdata;
201 int ret, i, num_tables;
202
203 if (!np)
204 return NULL;
205
206 if (of_find_property(np, "nvidia,use-ram-code", NULL)) {
207 tnp = tegra_emc_ramcode_devnode(np);
208 if (!tnp)
209 dev_warn(&pdev->dev,
210 "can't find emc table for ram-code 0x%02x\n",
211 tegra_bct_strapping);
212 } else
213 tnp = of_node_get(np);
214
215 if (!tnp)
216 return NULL;
217
218 num_tables = 0;
219 for_each_child_of_node(tnp, iter)
220 if (of_device_is_compatible(iter, "nvidia,tegra20-emc-table"))
221 num_tables++;
222
223 if (!num_tables) {
224 pdata = NULL;
225 goto out;
226 }
227
228 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
229 pdata->tables = devm_kzalloc(&pdev->dev,
230 sizeof(*pdata->tables) * num_tables,
231 GFP_KERNEL);
232
233 i = 0;
234 for_each_child_of_node(tnp, iter) {
235 u32 prop;
236
237 ret = of_property_read_u32(iter, "clock-frequency", &prop);
238 if (ret) {
239 dev_err(&pdev->dev, "no clock-frequency in %s\n",
240 iter->full_name);
241 continue;
242 }
243 pdata->tables[i].rate = prop;
244
245 ret = of_property_read_u32_array(iter, "nvidia,emc-registers",
246 pdata->tables[i].regs,
247 TEGRA_EMC_NUM_REGS);
248 if (ret) {
249 dev_err(&pdev->dev,
250 "malformed emc-registers property in %s\n",
251 iter->full_name);
252 continue;
253 }
254
255 i++;
256 }
257 pdata->num_tables = i;
258
259out:
260 of_node_put(tnp);
261 return pdata;
262}
263#else
264static struct tegra_emc_pdata *tegra_emc_dt_parse_pdata(
265 struct platform_device *pdev)
266{
267 return NULL;
268}
269#endif
270
271static struct tegra_emc_pdata *tegra_emc_fill_pdata(struct platform_device *pdev)
272{
273 struct clk *c = clk_get_sys(NULL, "emc");
274 struct tegra_emc_pdata *pdata;
275 unsigned long khz;
276 int i;
277
278 WARN_ON(pdev->dev.platform_data);
279 BUG_ON(IS_ERR(c));
280
281 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
282 pdata->tables = devm_kzalloc(&pdev->dev, sizeof(*pdata->tables),
283 GFP_KERNEL);
284
285 pdata->tables[0].rate = clk_get_rate(c) / 2 / 1000;
286
287 for (i = 0; i < TEGRA_EMC_NUM_REGS; i++)
288 pdata->tables[0].regs[i] = emc_readl(emc_reg_addr[i]);
289
290 pdata->num_tables = 1;
291
292 khz = pdata->tables[0].rate;
293 dev_info(&pdev->dev, "no tables provided, using %ld kHz emc, "
294 "%ld kHz mem\n", khz * 2, khz);
295
296 return pdata;
297}
298
299static int tegra_emc_probe(struct platform_device *pdev)
300{
301 struct tegra_emc_pdata *pdata;
302 struct resource *res;
303
304 if (!emc_enable) {
305 dev_err(&pdev->dev, "disabled per module parameter\n");
306 return -ENODEV;
307 }
308
309 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
310 emc_regbase = devm_ioremap_resource(&pdev->dev, res);
311 if (IS_ERR(emc_regbase))
312 return PTR_ERR(emc_regbase);
313
314 pdata = pdev->dev.platform_data;
315
316 if (!pdata)
317 pdata = tegra_emc_dt_parse_pdata(pdev);
318
319 if (!pdata)
320 pdata = tegra_emc_fill_pdata(pdev);
321
322 pdev->dev.platform_data = pdata;
323
324 emc_pdev = pdev;
325
326 return 0;
327}
328
329static struct of_device_id tegra_emc_of_match[] = {
330 { .compatible = "nvidia,tegra20-emc", },
331 { },
332};
333
334static struct platform_driver tegra_emc_driver = {
335 .driver = {
336 .name = "tegra-emc",
337 .owner = THIS_MODULE,
338 .of_match_table = tegra_emc_of_match,
339 },
340 .probe = tegra_emc_probe,
341};
342
343static int __init tegra_emc_init(void)
344{
345 return platform_driver_register(&tegra_emc_driver);
346}
347device_initcall(tegra_emc_init);
diff --git a/arch/arm/mach-tegra/tegra2_emc.h b/arch/arm/mach-tegra/tegra2_emc.h
deleted file mode 100644
index f61409b54cb7..000000000000
--- a/arch/arm/mach-tegra/tegra2_emc.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * Copyright (C) 2011 Google, Inc.
3 *
4 * Author:
5 * Colin Cross <ccross@android.com>
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
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 */
17
18#ifndef __MACH_TEGRA_TEGRA2_EMC_H_
19#define __MACH_TEGRA_TEGRA2_EMC_H
20
21int tegra_emc_set_rate(unsigned long rate);
22long tegra_emc_round_rate(unsigned long rate);
23
24#endif
diff --git a/arch/arm/mach-u300/Kconfig b/arch/arm/mach-u300/Kconfig
index 8e23071bd1b3..e3a96d7302e9 100644
--- a/arch/arm/mach-u300/Kconfig
+++ b/arch/arm/mach-u300/Kconfig
@@ -3,20 +3,14 @@ config ARCH_U300
3 depends on MMU 3 depends on MMU
4 select ARCH_REQUIRE_GPIOLIB 4 select ARCH_REQUIRE_GPIOLIB
5 select ARM_AMBA 5 select ARM_AMBA
6 select ARM_PATCH_PHYS_VIRT
7 select ARM_VIC 6 select ARM_VIC
8 select CLKSRC_MMIO 7 select CLKSRC_MMIO
9 select CLKSRC_OF
10 select COMMON_CLK
11 select CPU_ARM926T 8 select CPU_ARM926T
12 select GENERIC_CLOCKEVENTS
13 select HAVE_TCM 9 select HAVE_TCM
14 select PINCTRL 10 select PINCTRL
15 select PINCTRL_COH901 11 select PINCTRL_COH901
16 select PINCTRL_U300 12 select PINCTRL_U300
17 select SPARSE_IRQ
18 select MFD_SYSCON 13 select MFD_SYSCON
19 select USE_OF
20 help 14 help
21 Support for ST-Ericsson U300 series mobile platforms. 15 Support for ST-Ericsson U300 series mobile platforms.
22 16
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
index 0034d2cd6973..b41a42da1505 100644
--- a/arch/arm/mach-ux500/Kconfig
+++ b/arch/arm/mach-ux500/Kconfig
@@ -11,13 +11,8 @@ config ARCH_U8500
11 select ARM_GIC 11 select ARM_GIC
12 select CACHE_L2X0 12 select CACHE_L2X0
13 select CLKSRC_NOMADIK_MTU 13 select CLKSRC_NOMADIK_MTU
14 select COMMON_CLK
15 select CPU_V7
16 select GENERIC_CLOCKEVENTS
17 select HAVE_ARM_SCU if SMP 14 select HAVE_ARM_SCU if SMP
18 select HAVE_ARM_TWD if SMP 15 select HAVE_ARM_TWD if SMP
19 select HAVE_SMP
20 select MIGHT_HAVE_CACHE_L2X0
21 select PINCTRL 16 select PINCTRL
22 select PINCTRL_ABX500 17 select PINCTRL_ABX500
23 select PINCTRL_NOMADIK 18 select PINCTRL_NOMADIK
@@ -73,11 +68,6 @@ config UX500_AUTO_PLATFORM
73 a working kernel. If everything else is disabled, this 68 a working kernel. If everything else is disabled, this
74 automatically enables MACH_MOP500. 69 automatically enables MACH_MOP500.
75 70
76config MACH_UX500_DT
77 bool "Generic U8500 support using device tree"
78 depends on MACH_MOP500
79 select USE_OF
80
81endmenu 71endmenu
82 72
83config UX500_DEBUG_UART 73config UX500_DEBUG_UART
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
index d05ba759da30..de544aabf292 100644
--- a/arch/arm/mach-ux500/Makefile
+++ b/arch/arm/mach-ux500/Makefile
@@ -7,7 +7,6 @@ obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o
7obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o 7obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o
8obj-$(CONFIG_MACH_MOP500) += board-mop500-sdi.o \ 8obj-$(CONFIG_MACH_MOP500) += board-mop500-sdi.o \
9 board-mop500-regulators.o \ 9 board-mop500-regulators.o \
10 board-mop500-pins.o \
11 board-mop500-audio.o 10 board-mop500-audio.o
12obj-$(CONFIG_SMP) += platsmp.o headsmp.o 11obj-$(CONFIG_SMP) += platsmp.o headsmp.o
13obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 12obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
diff --git a/arch/arm/mach-ux500/board-mop500-audio.c b/arch/arm/mach-ux500/board-mop500-audio.c
index 9309ad4cbd09..b2a0899e7453 100644
--- a/arch/arm/mach-ux500/board-mop500-audio.c
+++ b/arch/arm/mach-ux500/board-mop500-audio.c
@@ -9,7 +9,6 @@
9#include <linux/gpio.h> 9#include <linux/gpio.h>
10#include <linux/platform_data/dma-ste-dma40.h> 10#include <linux/platform_data/dma-ste-dma40.h>
11 11
12#include "irqs.h"
13#include <linux/platform_data/asoc-ux500-msp.h> 12#include <linux/platform_data/asoc-ux500-msp.h>
14 13
15#include "ste-dma40-db8500.h" 14#include "ste-dma40-db8500.h"
diff --git a/arch/arm/mach-ux500/board-mop500-pins.c b/arch/arm/mach-ux500/board-mop500-pins.c
deleted file mode 100644
index f63619b69113..000000000000
--- a/arch/arm/mach-ux500/board-mop500-pins.c
+++ /dev/null
@@ -1,291 +0,0 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License terms: GNU General Public License (GPL) version 2
5 */
6
7#include <linux/kernel.h>
8#include <linux/init.h>
9#include <linux/bug.h>
10#include <linux/string.h>
11#include <linux/pinctrl/machine.h>
12#include <linux/pinctrl/pinconf-generic.h>
13
14#include <asm/mach-types.h>
15
16#include "board-mop500.h"
17
18/* These simply sets bias for pins */
19#define BIAS(a,b) static unsigned long a[] = { b }
20
21BIAS(abx500_out_lo, PIN_CONF_PACKED(PIN_CONFIG_OUTPUT, 0));
22BIAS(abx500_in_pd, PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_DOWN, 1));
23BIAS(abx500_in_nopull, PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_DOWN, 0));
24
25#define AB8500_MUX_HOG(group, func) \
26 PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-ab8500.0", group, func)
27#define AB8500_PIN_HOG(pin, conf) \
28 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-ab8500.0", pin, abx500_##conf)
29
30#define AB8500_MUX_STATE(group, func, dev, state) \
31 PIN_MAP_MUX_GROUP(dev, state, "pinctrl-ab8500.0", group, func)
32#define AB8500_PIN_STATE(pin, conf, dev, state) \
33 PIN_MAP_CONFIGS_PIN(dev, state, "pinctrl-ab8500.0", pin, abx500_##conf)
34
35#define AB8505_MUX_HOG(group, func) \
36 PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-ab8505.0", group, func)
37#define AB8505_PIN_HOG(pin, conf) \
38 PIN_MAP_CONFIGS_PIN_HOG_DEFAULT("pinctrl-ab8505.0", pin, abx500_##conf)
39
40#define AB8505_MUX_STATE(group, func, dev, state) \
41 PIN_MAP_MUX_GROUP(dev, state, "pinctrl-ab8505.0", group, func)
42#define AB8505_PIN_STATE(pin, conf, dev, state) \
43 PIN_MAP_CONFIGS_PIN(dev, state, "pinctrl-ab8505.0", pin, abx500_##conf)
44
45static struct pinctrl_map __initdata ab8500_pinmap[] = {
46 /* Sysclkreq2 */
47 AB8500_MUX_STATE("sysclkreq2_d_1", "sysclkreq", "regulator.35", PINCTRL_STATE_DEFAULT),
48 AB8500_PIN_STATE("GPIO1_T10", in_nopull, "regulator.35", PINCTRL_STATE_DEFAULT),
49 /* sysclkreq2 disable, mux in gpio configured in input pulldown */
50 AB8500_MUX_STATE("gpio1_a_1", "gpio", "regulator.35", PINCTRL_STATE_SLEEP),
51 AB8500_PIN_STATE("GPIO1_T10", in_pd, "regulator.35", PINCTRL_STATE_SLEEP),
52
53 /* pins 2 is muxed in GPIO, configured in INPUT PULL DOWN */
54 AB8500_MUX_HOG("gpio2_a_1", "gpio"),
55 AB8500_PIN_HOG("GPIO2_T9", in_pd),
56
57 /* Sysclkreq4 */
58 AB8500_MUX_STATE("sysclkreq4_d_1", "sysclkreq", "regulator.36", PINCTRL_STATE_DEFAULT),
59 AB8500_PIN_STATE("GPIO3_U9", in_nopull, "regulator.36", PINCTRL_STATE_DEFAULT),
60 /* sysclkreq4 disable, mux in gpio configured in input pulldown */
61 AB8500_MUX_STATE("gpio3_a_1", "gpio", "regulator.36", PINCTRL_STATE_SLEEP),
62 AB8500_PIN_STATE("GPIO3_U9", in_pd, "regulator.36", PINCTRL_STATE_SLEEP),
63
64 /* pins 4 is muxed in GPIO, configured in INPUT PULL DOWN */
65 AB8500_MUX_HOG("gpio4_a_1", "gpio"),
66 AB8500_PIN_HOG("GPIO4_W2", in_pd),
67
68 /*
69 * pins 6,7,8 and 9 are muxed in YCBCR0123
70 * configured in INPUT PULL UP
71 */
72 AB8500_MUX_HOG("ycbcr0123_d_1", "ycbcr"),
73 AB8500_PIN_HOG("GPIO6_Y18", in_nopull),
74 AB8500_PIN_HOG("GPIO7_AA20", in_nopull),
75 AB8500_PIN_HOG("GPIO8_W18", in_nopull),
76 AB8500_PIN_HOG("GPIO9_AA19", in_nopull),
77
78 /*
79 * pins 10,11,12 and 13 are muxed in GPIO
80 * configured in INPUT PULL DOWN
81 */
82 AB8500_MUX_HOG("gpio10_d_1", "gpio"),
83 AB8500_PIN_HOG("GPIO10_U17", in_pd),
84
85 AB8500_MUX_HOG("gpio11_d_1", "gpio"),
86 AB8500_PIN_HOG("GPIO11_AA18", in_pd),
87
88 AB8500_MUX_HOG("gpio12_d_1", "gpio"),
89 AB8500_PIN_HOG("GPIO12_U16", in_pd),
90
91 AB8500_MUX_HOG("gpio13_d_1", "gpio"),
92 AB8500_PIN_HOG("GPIO13_W17", in_pd),
93
94 /*
95 * pins 14,15 are muxed in PWM1 and PWM2
96 * configured in INPUT PULL DOWN
97 */
98 AB8500_MUX_HOG("pwmout1_d_1", "pwmout"),
99 AB8500_PIN_HOG("GPIO14_F14", in_pd),
100
101 AB8500_MUX_HOG("pwmout2_d_1", "pwmout"),
102 AB8500_PIN_HOG("GPIO15_B17", in_pd),
103
104 /*
105 * pins 16 is muxed in GPIO
106 * configured in INPUT PULL DOWN
107 */
108 AB8500_MUX_HOG("gpio16_a_1", "gpio"),
109 AB8500_PIN_HOG("GPIO14_F14", in_pd),
110
111 /*
112 * pins 17,18,19 and 20 are muxed in AUDIO interface 1
113 * configured in INPUT PULL DOWN
114 */
115 AB8500_MUX_HOG("adi1_d_1", "adi1"),
116 AB8500_PIN_HOG("GPIO17_P5", in_pd),
117 AB8500_PIN_HOG("GPIO18_R5", in_pd),
118 AB8500_PIN_HOG("GPIO19_U5", in_pd),
119 AB8500_PIN_HOG("GPIO20_T5", in_pd),
120
121 /*
122 * pins 21,22 and 23 are muxed in USB UICC
123 * configured in INPUT PULL DOWN
124 */
125 AB8500_MUX_HOG("usbuicc_d_1", "usbuicc"),
126 AB8500_PIN_HOG("GPIO21_H19", in_pd),
127 AB8500_PIN_HOG("GPIO22_G20", in_pd),
128 AB8500_PIN_HOG("GPIO23_G19", in_pd),
129
130 /*
131 * pins 24,25 are muxed in GPIO
132 * configured in INPUT PULL DOWN
133 */
134 AB8500_MUX_HOG("gpio24_a_1", "gpio"),
135 AB8500_PIN_HOG("GPIO24_T14", in_pd),
136
137 AB8500_MUX_HOG("gpio25_a_1", "gpio"),
138 AB8500_PIN_HOG("GPIO25_R16", in_pd),
139
140 /*
141 * pins 26 is muxed in GPIO
142 * configured in OUTPUT LOW
143 */
144 AB8500_MUX_HOG("gpio26_d_1", "gpio"),
145 AB8500_PIN_HOG("GPIO26_M16", out_lo),
146
147 /*
148 * pins 27,28 are muxed in DMIC12
149 * configured in INPUT PULL DOWN
150 */
151 AB8500_MUX_HOG("dmic12_d_1", "dmic"),
152 AB8500_PIN_HOG("GPIO27_J6", in_pd),
153 AB8500_PIN_HOG("GPIO28_K6", in_pd),
154
155 /*
156 * pins 29,30 are muxed in DMIC34
157 * configured in INPUT PULL DOWN
158 */
159 AB8500_MUX_HOG("dmic34_d_1", "dmic"),
160 AB8500_PIN_HOG("GPIO29_G6", in_pd),
161 AB8500_PIN_HOG("GPIO30_H6", in_pd),
162
163 /*
164 * pins 31,32 are muxed in DMIC56
165 * configured in INPUT PULL DOWN
166 */
167 AB8500_MUX_HOG("dmic56_d_1", "dmic"),
168 AB8500_PIN_HOG("GPIO31_F5", in_pd),
169 AB8500_PIN_HOG("GPIO32_G5", in_pd),
170
171 /*
172 * pins 34 is muxed in EXTCPENA
173 * configured INPUT PULL DOWN
174 */
175 AB8500_MUX_HOG("extcpena_d_1", "extcpena"),
176 AB8500_PIN_HOG("GPIO34_R17", in_pd),
177
178 /*
179 * pins 35 is muxed in GPIO
180 * configured in OUTPUT LOW
181 */
182 AB8500_MUX_HOG("gpio35_d_1", "gpio"),
183 AB8500_PIN_HOG("GPIO35_W15", in_pd),
184
185 /*
186 * pins 36,37,38 and 39 are muxed in GPIO
187 * configured in INPUT PULL DOWN
188 */
189 AB8500_MUX_HOG("gpio36_a_1", "gpio"),
190 AB8500_PIN_HOG("GPIO36_A17", in_pd),
191
192 AB8500_MUX_HOG("gpio37_a_1", "gpio"),
193 AB8500_PIN_HOG("GPIO37_E15", in_pd),
194
195 AB8500_MUX_HOG("gpio38_a_1", "gpio"),
196 AB8500_PIN_HOG("GPIO38_C17", in_pd),
197
198 AB8500_MUX_HOG("gpio39_a_1", "gpio"),
199 AB8500_PIN_HOG("GPIO39_E16", in_pd),
200
201 /*
202 * pins 40 and 41 are muxed in MODCSLSDA
203 * configured INPUT PULL DOWN
204 */
205 AB8500_MUX_HOG("modsclsda_d_1", "modsclsda"),
206 AB8500_PIN_HOG("GPIO40_T19", in_pd),
207 AB8500_PIN_HOG("GPIO41_U19", in_pd),
208
209 /*
210 * pins 42 is muxed in GPIO
211 * configured INPUT PULL DOWN
212 */
213 AB8500_MUX_HOG("gpio42_a_1", "gpio"),
214 AB8500_PIN_HOG("GPIO42_U2", in_pd),
215};
216
217static struct pinctrl_map __initdata ab8505_pinmap[] = {
218 /* Sysclkreq2 */
219 AB8505_MUX_STATE("sysclkreq2_d_1", "sysclkreq", "regulator.36", PINCTRL_STATE_DEFAULT),
220 AB8505_PIN_STATE("GPIO1_N4", in_nopull, "regulator.36", PINCTRL_STATE_DEFAULT),
221 /* sysclkreq2 disable, mux in gpio configured in input pulldown */
222 AB8505_MUX_STATE("gpio1_a_1", "gpio", "regulator.36", PINCTRL_STATE_SLEEP),
223 AB8505_PIN_STATE("GPIO1_N4", in_pd, "regulator.36", PINCTRL_STATE_SLEEP),
224
225 /* pins 2 is muxed in GPIO, configured in INPUT PULL DOWN */
226 AB8505_MUX_HOG("gpio2_a_1", "gpio"),
227 AB8505_PIN_HOG("GPIO2_R5", in_pd),
228
229 /* Sysclkreq4 */
230 AB8505_MUX_STATE("sysclkreq4_d_1", "sysclkreq", "regulator.37", PINCTRL_STATE_DEFAULT),
231 AB8505_PIN_STATE("GPIO3_P5", in_nopull, "regulator.37", PINCTRL_STATE_DEFAULT),
232 /* sysclkreq4 disable, mux in gpio configured in input pulldown */
233 AB8505_MUX_STATE("gpio3_a_1", "gpio", "regulator.37", PINCTRL_STATE_SLEEP),
234 AB8505_PIN_STATE("GPIO3_P5", in_pd, "regulator.37", PINCTRL_STATE_SLEEP),
235
236 AB8505_MUX_HOG("gpio10_d_1", "gpio"),
237 AB8505_PIN_HOG("GPIO10_B16", in_pd),
238
239 AB8505_MUX_HOG("gpio11_d_1", "gpio"),
240 AB8505_PIN_HOG("GPIO11_B17", in_pd),
241
242 AB8505_MUX_HOG("gpio13_d_1", "gpio"),
243 AB8505_PIN_HOG("GPIO13_D17", in_nopull),
244
245 AB8505_MUX_HOG("pwmout1_d_1", "pwmout"),
246 AB8505_PIN_HOG("GPIO14_C16", in_pd),
247
248 AB8505_MUX_HOG("adi2_d_1", "adi2"),
249 AB8505_PIN_HOG("GPIO17_P2", in_pd),
250 AB8505_PIN_HOG("GPIO18_N3", in_pd),
251 AB8505_PIN_HOG("GPIO19_T1", in_pd),
252 AB8505_PIN_HOG("GPIO20_P3", in_pd),
253
254 AB8505_MUX_HOG("gpio34_a_1", "gpio"),
255 AB8505_PIN_HOG("GPIO34_H14", in_pd),
256
257 AB8505_MUX_HOG("modsclsda_d_1", "modsclsda"),
258 AB8505_PIN_HOG("GPIO40_J15", in_pd),
259 AB8505_PIN_HOG("GPIO41_J14", in_pd),
260
261 AB8505_MUX_HOG("gpio50_d_1", "gpio"),
262 AB8505_PIN_HOG("GPIO50_L4", in_nopull),
263
264 AB8505_MUX_HOG("resethw_d_1", "resethw"),
265 AB8505_PIN_HOG("GPIO52_D16", in_pd),
266
267 AB8505_MUX_HOG("service_d_1", "service"),
268 AB8505_PIN_HOG("GPIO53_D15", in_pd),
269};
270
271void __init mop500_pinmaps_init(void)
272{
273 if (machine_is_u8520())
274 pinctrl_register_mappings(ab8505_pinmap,
275 ARRAY_SIZE(ab8505_pinmap));
276 else
277 pinctrl_register_mappings(ab8500_pinmap,
278 ARRAY_SIZE(ab8500_pinmap));
279}
280
281void __init snowball_pinmaps_init(void)
282{
283 pinctrl_register_mappings(ab8500_pinmap,
284 ARRAY_SIZE(ab8500_pinmap));
285}
286
287void __init hrefv60_pinmaps_init(void)
288{
289 pinctrl_register_mappings(ab8500_pinmap,
290 ARRAY_SIZE(ab8500_pinmap));
291}
diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h
index d48e8662c676..32cc0d8d8a0e 100644
--- a/arch/arm/mach-ux500/board-mop500.h
+++ b/arch/arm/mach-ux500/board-mop500.h
@@ -7,78 +7,9 @@
7#ifndef __BOARD_MOP500_H 7#ifndef __BOARD_MOP500_H
8#define __BOARD_MOP500_H 8#define __BOARD_MOP500_H
9 9
10/* For NOMADIK_NR_GPIO */
11#include "irqs.h"
12#include <linux/platform_data/asoc-ux500-msp.h> 10#include <linux/platform_data/asoc-ux500-msp.h>
13#include <linux/amba/mmci.h> 11#include <linux/amba/mmci.h>
14 12
15/* Snowball specific GPIO assignments, this board has no GPIO expander */
16#define SNOWBALL_ACCEL_INT1_GPIO 163
17#define SNOWBALL_ACCEL_INT2_GPIO 164
18#define SNOWBALL_MAGNET_DRDY_GPIO 165
19#define SNOWBALL_SDMMC_EN_GPIO 217
20#define SNOWBALL_SDMMC_1V8_3V_GPIO 228
21#define SNOWBALL_SDMMC_CD_GPIO 218
22
23/* HREFv60-specific GPIO assignments, this board has no GPIO expander */
24#define HREFV60_SDMMC_1V8_3V_GPIO 5
25#define HREFV60_CAMERA_FLASH_ENABLE 21
26#define HREFV60_MAGNET_DRDY_GPIO 32
27#define HREFV60_DISP1_RST_GPIO 65
28#define HREFV60_DISP2_RST_GPIO 66
29#define HREFV60_ACCEL_INT1_GPIO 82
30#define HREFV60_ACCEL_INT2_GPIO 83
31#define HREFV60_SDMMC_CD_GPIO 95
32#define HREFV60_XSHUTDOWN_SECONDARY_SENSOR 140
33#define HREFV60_TOUCH_RST_GPIO 143
34#define HREFV60_HAL_SW_GPIO 145
35#define HREFV60_SDMMC_EN_GPIO 169
36#define HREFV60_MMIO_XENON_CHARGE 170
37#define HREFV60_PROX_SENSE_GPIO 217
38
39/* MOP500 generic GPIOs */
40#define CAMERA_FLASH_INT_PIN 7
41#define CYPRESS_TOUCH_INT_PIN 84
42#define XSHUTDOWN_PRIMARY_SENSOR 141
43#define XSHUTDOWN_SECONDARY_SENSOR 142
44#define CYPRESS_TOUCH_RST_GPIO 143
45#define MOP500_HDMI_RST_GPIO 196
46#define CYPRESS_SLAVE_SELECT_GPIO 216
47
48/* GPIOs on the TC35892 expander */
49#define MOP500_EGPIO(x) (NOMADIK_NR_GPIO + (x))
50#define GPIO_MAGNET_DRDY MOP500_EGPIO(1)
51#define GPIO_SDMMC_CD MOP500_EGPIO(3)
52#define GPIO_CAMERA_FLASH_ENABLE MOP500_EGPIO(4)
53#define GPIO_MMIO_XENON_CHARGE MOP500_EGPIO(5)
54#define GPIO_PROX_SENSOR MOP500_EGPIO(7)
55#define GPIO_HAL_SENSOR MOP500_EGPIO(8)
56#define GPIO_ACCEL_INT1 MOP500_EGPIO(10)
57#define GPIO_ACCEL_INT2 MOP500_EGPIO(11)
58#define GPIO_BU21013_CS MOP500_EGPIO(13)
59#define MOP500_DISP2_RST_GPIO MOP500_EGPIO(14)
60#define MOP500_DISP1_RST_GPIO MOP500_EGPIO(15)
61#define GPIO_SDMMC_EN MOP500_EGPIO(17)
62#define GPIO_SDMMC_1V8_3V_SEL MOP500_EGPIO(18)
63#define MOP500_EGPIO_END MOP500_EGPIO(24)
64
65/*
66 * GPIOs on the AB8500 mixed-signals circuit
67 * Notice that we subtract 1 from the number passed into the macro, this is
68 * because the AB8500 GPIO pins are enumbered starting from 1, so the value in
69 * parens matches the GPIO pin number in the data sheet.
70 */
71#define MOP500_AB8500_PIN_GPIO(x) (MOP500_EGPIO_END + (x) - 1)
72/*Snowball AB8500 GPIO */
73#define SNOWBALL_VSMPS2_1V8_GPIO MOP500_AB8500_PIN_GPIO(1) /* SYSCLKREQ2/GPIO1 */
74#define SNOWBALL_PM_GPIO1_GPIO MOP500_AB8500_PIN_GPIO(2) /* SYSCLKREQ3/GPIO2 */
75#define SNOWBALL_WLAN_CLK_REQ_GPIO MOP500_AB8500_PIN_GPIO(3) /* SYSCLKREQ4/GPIO3 */
76#define SNOWBALL_PM_GPIO4_GPIO MOP500_AB8500_PIN_GPIO(4) /* SYSCLKREQ6/GPIO4 */
77#define SNOWBALL_EN_3V6_GPIO MOP500_AB8500_PIN_GPIO(16) /* PWMOUT3/GPIO16 */
78#define SNOWBALL_PME_ETH_GPIO MOP500_AB8500_PIN_GPIO(24) /* SYSCLKREQ7/GPIO24 */
79#define SNOWBALL_EN_3V3_ETH_GPIO MOP500_AB8500_PIN_GPIO(26) /* GPIO26 */
80
81struct device;
82extern struct mmci_platform_data mop500_sdi0_data; 13extern struct mmci_platform_data mop500_sdi0_data;
83extern struct mmci_platform_data mop500_sdi1_data; 14extern struct mmci_platform_data mop500_sdi1_data;
84extern struct mmci_platform_data mop500_sdi2_data; 15extern struct mmci_platform_data mop500_sdi2_data;
@@ -88,8 +19,4 @@ extern struct msp_i2s_platform_data msp1_platform_data;
88extern struct msp_i2s_platform_data msp2_platform_data; 19extern struct msp_i2s_platform_data msp2_platform_data;
89extern struct msp_i2s_platform_data msp3_platform_data; 20extern struct msp_i2s_platform_data msp3_platform_data;
90 21
91void __init mop500_pinmaps_init(void);
92void __init snowball_pinmaps_init(void);
93void __init hrefv60_pinmaps_init(void);
94
95#endif 22#endif
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index bc8a6183560d..8820f602fcd2 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -27,7 +27,6 @@
27#include <asm/mach/map.h> 27#include <asm/mach/map.h>
28 28
29#include "setup.h" 29#include "setup.h"
30#include "irqs.h"
31 30
32#include "board-mop500-regulators.h" 31#include "board-mop500-regulators.h"
33#include "board-mop500.h" 32#include "board-mop500.h"
@@ -35,14 +34,11 @@
35#include "id.h" 34#include "id.h"
36 35
37struct ab8500_platform_data ab8500_platdata = { 36struct ab8500_platform_data ab8500_platdata = {
38 .irq_base = MOP500_AB8500_IRQ_BASE,
39 .regulator = &ab8500_regulator_plat_data, 37 .regulator = &ab8500_regulator_plat_data,
40}; 38};
41 39
42struct prcmu_pdata db8500_prcmu_pdata = { 40struct prcmu_pdata db8500_prcmu_pdata = {
43 .ab_platdata = &ab8500_platdata, 41 .ab_platdata = &ab8500_platdata,
44 .ab_irq = IRQ_DB8500_AB8500,
45 .irq_base = IRQ_PRCMU_BASE,
46 .version_offset = DB8500_PRCMU_FW_VERSION_OFFSET, 42 .version_offset = DB8500_PRCMU_FW_VERSION_OFFSET,
47 .legacy_offset = DB8500_PRCMU_LEGACY_OFFSET, 43 .legacy_offset = DB8500_PRCMU_LEGACY_OFFSET,
48}; 44};
@@ -146,7 +142,6 @@ static struct device * __init db8500_soc_device_init(void)
146 return ux500_soc_device_init(soc_id); 142 return ux500_soc_device_init(soc_id);
147} 143}
148 144
149#ifdef CONFIG_MACH_UX500_DT
150static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { 145static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
151 /* Requires call-back bindings. */ 146 /* Requires call-back bindings. */
152 OF_DEV_AUXDATA("arm,cortex-a9-pmu", 0, "arm-pmu", &db8500_pmu_platdata), 147 OF_DEV_AUXDATA("arm,cortex-a9-pmu", 0, "arm-pmu", &db8500_pmu_platdata),
@@ -191,16 +186,6 @@ static void __init u8500_init_machine(void)
191{ 186{
192 struct device *parent = db8500_soc_device_init(); 187 struct device *parent = db8500_soc_device_init();
193 188
194 /* Pinmaps must be in place before devices register */
195 if (of_machine_is_compatible("st-ericsson,mop500"))
196 mop500_pinmaps_init();
197 else if (of_machine_is_compatible("calaosystems,snowball-a9500")) {
198 snowball_pinmaps_init();
199 } else if (of_machine_is_compatible("st-ericsson,hrefv60+"))
200 hrefv60_pinmaps_init();
201 else if (of_machine_is_compatible("st-ericsson,ccu9540")) {}
202 /* TODO: Add pinmaps for ccu9540 board. */
203
204 /* automatically probe child nodes of dbx5x0 devices */ 189 /* automatically probe child nodes of dbx5x0 devices */
205 if (of_machine_is_compatible("st-ericsson,u8540")) 190 if (of_machine_is_compatible("st-ericsson,u8540"))
206 of_platform_populate(NULL, u8500_local_bus_nodes, 191 of_platform_populate(NULL, u8500_local_bus_nodes,
@@ -229,5 +214,3 @@ DT_MACHINE_START(U8500_DT, "ST-Ericsson Ux5x0 platform (Device Tree Support)")
229 .dt_compat = stericsson_dt_platform_compat, 214 .dt_compat = stericsson_dt_platform_compat,
230 .restart = ux500_restart, 215 .restart = ux500_restart,
231MACHINE_END 216MACHINE_END
232
233#endif
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c
index d11ac4bf336c..db16b5a04ad5 100644
--- a/arch/arm/mach-ux500/cpu.c
+++ b/arch/arm/mach-ux500/cpu.c
@@ -52,17 +52,7 @@ void ux500_restart(enum reboot_mode mode, const char *cmd)
52*/ 52*/
53void __init ux500_init_irq(void) 53void __init ux500_init_irq(void)
54{ 54{
55 void __iomem *dist_base;
56 void __iomem *cpu_base;
57
58 gic_arch_extn.flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MASK_ON_SUSPEND; 55 gic_arch_extn.flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MASK_ON_SUSPEND;
59
60 if (cpu_is_u8500_family() || cpu_is_ux540_family()) {
61 dist_base = __io_address(U8500_GIC_DIST_BASE);
62 cpu_base = __io_address(U8500_GIC_CPU_BASE);
63 } else
64 ux500_unknown_soc();
65
66 irqchip_init(); 56 irqchip_init();
67 57
68 /* 58 /*
diff --git a/arch/arm/mach-ux500/irqs-board-mop500.h b/arch/arm/mach-ux500/irqs-board-mop500.h
deleted file mode 100644
index d526dd8e87d3..000000000000
--- a/arch/arm/mach-ux500/irqs-board-mop500.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * Author: Rabin Vincent <rabin.vincent@stericsson.com>
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#ifndef __MACH_IRQS_BOARD_MOP500_H
9#define __MACH_IRQS_BOARD_MOP500_H
10
11/* Number of AB8500 irqs is taken from header file */
12#include <linux/mfd/abx500/ab8500.h>
13
14#define MOP500_AB8500_IRQ_BASE IRQ_BOARD_START
15#define MOP500_AB8500_IRQ_END (MOP500_AB8500_IRQ_BASE \
16 + AB8500_MAX_NR_IRQS)
17
18/* TC35892 */
19#define TC35892_NR_INTERNAL_IRQS 8
20#define TC35892_INT_GPIO(x) (TC35892_NR_INTERNAL_IRQS + (x))
21#define TC35892_NR_GPIOS 24
22#define TC35892_NR_IRQS TC35892_INT_GPIO(TC35892_NR_GPIOS)
23
24#define MOP500_EGPIO_NR_IRQS TC35892_NR_IRQS
25
26#define MOP500_EGPIO_IRQ_BASE MOP500_AB8500_IRQ_END
27#define MOP500_EGPIO_IRQ_END (MOP500_EGPIO_IRQ_BASE \
28 + MOP500_EGPIO_NR_IRQS)
29/* STMPE1601 irqs */
30#define STMPE_NR_INTERNAL_IRQS 9
31#define STMPE_INT_GPIO(x) (STMPE_NR_INTERNAL_IRQS + (x))
32#define STMPE_NR_GPIOS 24
33#define STMPE_NR_IRQS STMPE_INT_GPIO(STMPE_NR_GPIOS)
34
35#define MOP500_STMPE1601_IRQBASE MOP500_EGPIO_IRQ_END
36#define MOP500_STMPE1601_IRQ(x) (MOP500_STMPE1601_IRQBASE + (x))
37
38#define MOP500_STMPE1601_IRQ_END \
39 MOP500_STMPE1601_IRQ(STMPE_NR_INTERNAL_IRQS)
40
41#define MOP500_NR_IRQS MOP500_STMPE1601_IRQ_END
42
43#define MOP500_IRQ_END MOP500_NR_IRQS
44
45/*
46 * We may have several boards, but only one will run at a
47 * time, so the one with most IRQs will bump this ahead,
48 * but the IRQ_BOARD_START remains the same for either board.
49 */
50#if MOP500_IRQ_END > IRQ_BOARD_END
51#undef IRQ_BOARD_END
52#define IRQ_BOARD_END MOP500_IRQ_END
53#endif
54
55#endif
diff --git a/arch/arm/mach-ux500/irqs-db8500.h b/arch/arm/mach-ux500/irqs-db8500.h
deleted file mode 100644
index f3a9d5947ef3..000000000000
--- a/arch/arm/mach-ux500/irqs-db8500.h
+++ /dev/null
@@ -1,125 +0,0 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * Author: Rabin Vincent <rabin.vincent@stericsson.com>
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#ifndef __MACH_IRQS_DB8500_H
9#define __MACH_IRQS_DB8500_H
10
11#define IRQ_DB8500_MTU0 (IRQ_SHPI_START + 4)
12#define IRQ_DB8500_SPI2 (IRQ_SHPI_START + 6)
13#define IRQ_DB8500_PMU (IRQ_SHPI_START + 7)
14#define IRQ_DB8500_SPI0 (IRQ_SHPI_START + 8)
15#define IRQ_DB8500_RTT (IRQ_SHPI_START + 9)
16#define IRQ_DB8500_PKA (IRQ_SHPI_START + 10)
17#define IRQ_DB8500_UART0 (IRQ_SHPI_START + 11)
18#define IRQ_DB8500_I2C3 (IRQ_SHPI_START + 12)
19#define IRQ_DB8500_L2CC (IRQ_SHPI_START + 13)
20#define IRQ_DB8500_SSP0 (IRQ_SHPI_START + 14)
21#define IRQ_DB8500_CRYP1 (IRQ_SHPI_START + 15)
22#define IRQ_DB8500_MSP1_RX (IRQ_SHPI_START + 16)
23#define IRQ_DB8500_MTU1 (IRQ_SHPI_START + 17)
24#define IRQ_DB8500_RTC (IRQ_SHPI_START + 18)
25#define IRQ_DB8500_UART1 (IRQ_SHPI_START + 19)
26#define IRQ_DB8500_USB_WAKEUP (IRQ_SHPI_START + 20)
27#define IRQ_DB8500_I2C0 (IRQ_SHPI_START + 21)
28#define IRQ_DB8500_I2C1 (IRQ_SHPI_START + 22)
29#define IRQ_DB8500_USBOTG (IRQ_SHPI_START + 23)
30#define IRQ_DB8500_DMA_SECURE (IRQ_SHPI_START + 24)
31#define IRQ_DB8500_DMA (IRQ_SHPI_START + 25)
32#define IRQ_DB8500_UART2 (IRQ_SHPI_START + 26)
33#define IRQ_DB8500_ICN_PMU1 (IRQ_SHPI_START + 27)
34#define IRQ_DB8500_ICN_PMU2 (IRQ_SHPI_START + 28)
35#define IRQ_DB8500_HSIR_EXCEP (IRQ_SHPI_START + 29)
36#define IRQ_DB8500_MSP0 (IRQ_SHPI_START + 31)
37#define IRQ_DB8500_HSIR_CH0_OVRRUN (IRQ_SHPI_START + 32)
38#define IRQ_DB8500_HSIR_CH1_OVRRUN (IRQ_SHPI_START + 33)
39#define IRQ_DB8500_HSIR_CH2_OVRRUN (IRQ_SHPI_START + 34)
40#define IRQ_DB8500_HSIR_CH3_OVRRUN (IRQ_SHPI_START + 35)
41#define IRQ_DB8500_HSIR_CH4_OVRRUN (IRQ_SHPI_START + 36)
42#define IRQ_DB8500_HSIR_CH5_OVRRUN (IRQ_SHPI_START + 37)
43#define IRQ_DB8500_HSIR_CH6_OVRRUN (IRQ_SHPI_START + 38)
44#define IRQ_DB8500_HSIR_CH7_OVRRUN (IRQ_SHPI_START + 39)
45#define IRQ_DB8500_AB8500 (IRQ_SHPI_START + 40)
46#define IRQ_DB8500_SDMMC2 (IRQ_SHPI_START + 41)
47#define IRQ_DB8500_SIA (IRQ_SHPI_START + 42)
48#define IRQ_DB8500_SIA2 (IRQ_SHPI_START + 43)
49#define IRQ_DB8500_SVA (IRQ_SHPI_START + 44)
50#define IRQ_DB8500_SVA2 (IRQ_SHPI_START + 45)
51#define IRQ_DB8500_PRCMU0 (IRQ_SHPI_START + 46)
52#define IRQ_DB8500_PRCMU1 (IRQ_SHPI_START + 47)
53#define IRQ_DB8500_DISP (IRQ_SHPI_START + 48)
54#define IRQ_DB8500_SPI3 (IRQ_SHPI_START + 49)
55#define IRQ_DB8500_SDMMC1 (IRQ_SHPI_START + 50)
56#define IRQ_DB8500_I2C4 (IRQ_SHPI_START + 51)
57#define IRQ_DB8500_SSP1 (IRQ_SHPI_START + 52)
58#define IRQ_DB8500_SKE (IRQ_SHPI_START + 53)
59#define IRQ_DB8500_KB (IRQ_SHPI_START + 54)
60#define IRQ_DB8500_I2C2 (IRQ_SHPI_START + 55)
61#define IRQ_DB8500_B2R2 (IRQ_SHPI_START + 56)
62#define IRQ_DB8500_CRYP0 (IRQ_SHPI_START + 57)
63#define IRQ_DB8500_SDMMC3 (IRQ_SHPI_START + 59)
64#define IRQ_DB8500_SDMMC0 (IRQ_SHPI_START + 60)
65#define IRQ_DB8500_HSEM (IRQ_SHPI_START + 61)
66#define IRQ_DB8500_MSP1 (IRQ_SHPI_START + 62)
67#define IRQ_DB8500_SBAG (IRQ_SHPI_START + 63)
68#define IRQ_DB8500_SPI1 (IRQ_SHPI_START + 96)
69#define IRQ_DB8500_SRPTIMER (IRQ_SHPI_START + 97)
70#define IRQ_DB8500_MSP2 (IRQ_SHPI_START + 98)
71#define IRQ_DB8500_SDMMC4 (IRQ_SHPI_START + 99)
72#define IRQ_DB8500_SDMMC5 (IRQ_SHPI_START + 100)
73#define IRQ_DB8500_HSIRD0 (IRQ_SHPI_START + 104)
74#define IRQ_DB8500_HSIRD1 (IRQ_SHPI_START + 105)
75#define IRQ_DB8500_HSITD0 (IRQ_SHPI_START + 106)
76#define IRQ_DB8500_HSITD1 (IRQ_SHPI_START + 107)
77#define IRQ_DB8500_CTI0 (IRQ_SHPI_START + 108)
78#define IRQ_DB8500_CTI1 (IRQ_SHPI_START + 109)
79#define IRQ_DB8500_ICN_ERR (IRQ_SHPI_START + 110)
80#define IRQ_DB8500_MALI_PPMMU (IRQ_SHPI_START + 112)
81#define IRQ_DB8500_MALI_PP (IRQ_SHPI_START + 113)
82#define IRQ_DB8500_MALI_GPMMU (IRQ_SHPI_START + 114)
83#define IRQ_DB8500_MALI_GP (IRQ_SHPI_START + 115)
84#define IRQ_DB8500_MALI (IRQ_SHPI_START + 116)
85#define IRQ_DB8500_PRCMU_SEM (IRQ_SHPI_START + 118)
86#define IRQ_DB8500_GPIO0 (IRQ_SHPI_START + 119)
87#define IRQ_DB8500_GPIO1 (IRQ_SHPI_START + 120)
88#define IRQ_DB8500_GPIO2 (IRQ_SHPI_START + 121)
89#define IRQ_DB8500_GPIO3 (IRQ_SHPI_START + 122)
90#define IRQ_DB8500_GPIO4 (IRQ_SHPI_START + 123)
91#define IRQ_DB8500_GPIO5 (IRQ_SHPI_START + 124)
92#define IRQ_DB8500_GPIO6 (IRQ_SHPI_START + 125)
93#define IRQ_DB8500_GPIO7 (IRQ_SHPI_START + 126)
94#define IRQ_DB8500_GPIO8 (IRQ_SHPI_START + 127)
95
96#define IRQ_CA_WAKE_REQ_ED (IRQ_SHPI_START + 71)
97#define IRQ_AC_READ_NOTIFICATION_0_ED (IRQ_SHPI_START + 66)
98#define IRQ_AC_READ_NOTIFICATION_1_ED (IRQ_SHPI_START + 64)
99#define IRQ_CA_MSG_PEND_NOTIFICATION_0_ED (IRQ_SHPI_START + 67)
100#define IRQ_CA_MSG_PEND_NOTIFICATION_1_ED (IRQ_SHPI_START + 65)
101
102#define IRQ_CA_WAKE_REQ_V1 (IRQ_SHPI_START + 83)
103#define IRQ_AC_READ_NOTIFICATION_0_V1 (IRQ_SHPI_START + 78)
104#define IRQ_AC_READ_NOTIFICATION_1_V1 (IRQ_SHPI_START + 76)
105#define IRQ_CA_MSG_PEND_NOTIFICATION_0_V1 (IRQ_SHPI_START + 79)
106#define IRQ_CA_MSG_PEND_NOTIFICATION_1_V1 (IRQ_SHPI_START + 77)
107
108#ifdef CONFIG_UX500_SOC_DB8500
109
110/* Virtual interrupts corresponding to the PRCMU wakeups. */
111#define IRQ_PRCMU_BASE IRQ_SOC_START
112#define IRQ_PRCMU_END (IRQ_PRCMU_BASE + 23)
113
114/*
115 * We may have several SoCs, but only one will run at a
116 * time, so the one with most IRQs will bump this ahead,
117 * but the IRQ_SOC_START remains the same for either SoC.
118 */
119#if IRQ_SOC_END < IRQ_PRCMU_END
120#undef IRQ_SOC_END
121#define IRQ_SOC_END IRQ_PRCMU_END
122#endif
123
124#endif /* CONFIG_UX500_SOC_DB8500 */
125#endif
diff --git a/arch/arm/mach-ux500/irqs.h b/arch/arm/mach-ux500/irqs.h
deleted file mode 100644
index 15b2af698ed7..000000000000
--- a/arch/arm/mach-ux500/irqs.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * Copyright (C) 2008 STMicroelectronics
3 * Copyright (C) 2009 ST-Ericsson.
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 as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10#ifndef ASM_ARCH_IRQS_H
11#define ASM_ARCH_IRQS_H
12
13#define IRQ_LOCALTIMER 29
14#define IRQ_LOCALWDOG 30
15
16/* Shared Peripheral Interrupt (SHPI) */
17#define IRQ_SHPI_START 32
18
19/*
20 * MTU0 preserved for now until plat-nomadik is taught not to use it. Don't
21 * add any other IRQs here, use the irqs-dbx500.h files.
22 */
23#define IRQ_MTU0 (IRQ_SHPI_START + 4)
24
25#define DBX500_NR_INTERNAL_IRQS 166
26
27/* After chip-specific IRQ numbers we have the GPIO ones */
28#define NOMADIK_NR_GPIO 288
29#define NOMADIK_GPIO_TO_IRQ(gpio) ((gpio) + DBX500_NR_INTERNAL_IRQS)
30#define NOMADIK_IRQ_TO_GPIO(irq) ((irq) - DBX500_NR_INTERNAL_IRQS)
31#define IRQ_GPIO_END NOMADIK_GPIO_TO_IRQ(NOMADIK_NR_GPIO)
32
33#define IRQ_SOC_START IRQ_GPIO_END
34/* This will be overridden by SoC-specific irq headers */
35#define IRQ_SOC_END IRQ_SOC_START
36
37#include "irqs-db8500.h"
38
39#define IRQ_BOARD_START IRQ_SOC_END
40/* This will be overridden by board-specific irq headers */
41#define IRQ_BOARD_END IRQ_BOARD_START
42
43#ifdef CONFIG_MACH_MOP500
44#include "irqs-board-mop500.h"
45#endif
46
47#define UX500_NR_IRQS IRQ_BOARD_END
48
49#endif /* ASM_ARCH_IRQS_H */
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index a335126ae18f..f2c89fb8fca9 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -108,7 +108,7 @@ void __init versatile_init_irq(void)
108 108
109 np = of_find_matching_node_by_address(NULL, vic_of_match, 109 np = of_find_matching_node_by_address(NULL, vic_of_match,
110 VERSATILE_VIC_BASE); 110 VERSATILE_VIC_BASE);
111 __vic_init(VA_VIC_BASE, IRQ_VIC_START, ~0, 0, np); 111 __vic_init(VA_VIC_BASE, 0, IRQ_VIC_START, ~0, 0, np);
112 112
113 writel(~0, VA_SIC_BASE + SIC_IRQ_ENABLE_CLEAR); 113 writel(~0, VA_SIC_BASE + SIC_IRQ_ENABLE_CLEAR);
114 114
diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
index 4a70be485ff8..657d52d0391f 100644
--- a/arch/arm/mach-vexpress/Kconfig
+++ b/arch/arm/mach-vexpress/Kconfig
@@ -5,17 +5,12 @@ config ARCH_VEXPRESS
5 select ARM_AMBA 5 select ARM_AMBA
6 select ARM_GIC 6 select ARM_GIC
7 select ARM_TIMER_SP804 7 select ARM_TIMER_SP804
8 select COMMON_CLK
9 select COMMON_CLK_VERSATILE 8 select COMMON_CLK_VERSATILE
10 select CPU_V7
11 select GENERIC_CLOCKEVENTS
12 select HAVE_ARM_SCU if SMP 9 select HAVE_ARM_SCU if SMP
13 select HAVE_ARM_TWD if SMP 10 select HAVE_ARM_TWD if SMP
14 select HAVE_PATA_PLATFORM 11 select HAVE_PATA_PLATFORM
15 select HAVE_SMP
16 select ICST 12 select ICST
17 select MIGHT_HAVE_CACHE_L2X0 13 select NO_IOPORT_MAP
18 select NO_IOPORT
19 select PLAT_VERSATILE 14 select PLAT_VERSATILE
20 select PLAT_VERSATILE_CLCD 15 select PLAT_VERSATILE_CLCD
21 select POWER_RESET 16 select POWER_RESET
diff --git a/arch/arm/mach-vexpress/Makefile b/arch/arm/mach-vexpress/Makefile
index 0997e0b7494c..fc649bc09d0c 100644
--- a/arch/arm/mach-vexpress/Makefile
+++ b/arch/arm/mach-vexpress/Makefile
@@ -8,8 +8,11 @@ obj-y := v2m.o
8obj-$(CONFIG_ARCH_VEXPRESS_CA9X4) += ct-ca9x4.o 8obj-$(CONFIG_ARCH_VEXPRESS_CA9X4) += ct-ca9x4.o
9obj-$(CONFIG_ARCH_VEXPRESS_DCSCB) += dcscb.o dcscb_setup.o 9obj-$(CONFIG_ARCH_VEXPRESS_DCSCB) += dcscb.o dcscb_setup.o
10CFLAGS_dcscb.o += -march=armv7-a 10CFLAGS_dcscb.o += -march=armv7-a
11CFLAGS_REMOVE_dcscb.o = -pg
11obj-$(CONFIG_ARCH_VEXPRESS_SPC) += spc.o 12obj-$(CONFIG_ARCH_VEXPRESS_SPC) += spc.o
13CFLAGS_REMOVE_spc.o = -pg
12obj-$(CONFIG_ARCH_VEXPRESS_TC2_PM) += tc2_pm.o 14obj-$(CONFIG_ARCH_VEXPRESS_TC2_PM) += tc2_pm.o
13CFLAGS_tc2_pm.o += -march=armv7-a 15CFLAGS_tc2_pm.o += -march=armv7-a
16CFLAGS_REMOVE_tc2_pm.o = -pg
14obj-$(CONFIG_SMP) += platsmp.o 17obj-$(CONFIG_SMP) += platsmp.o
15obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 18obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
diff --git a/arch/arm/mach-vexpress/dcscb.c b/arch/arm/mach-vexpress/dcscb.c
index 14d499688736..788495d35cf9 100644
--- a/arch/arm/mach-vexpress/dcscb.c
+++ b/arch/arm/mach-vexpress/dcscb.c
@@ -137,11 +137,16 @@ static void dcscb_power_down(void)
137 v7_exit_coherency_flush(all); 137 v7_exit_coherency_flush(all);
138 138
139 /* 139 /*
140 * This is a harmless no-op. On platforms with a real 140 * A full outer cache flush could be needed at this point
141 * outer cache this might either be needed or not, 141 * on platforms with such a cache, depending on where the
142 * depending on where the outer cache sits. 142 * outer cache sits. In some cases the notion of a "last
143 * cluster standing" would need to be implemented if the
144 * outer cache is shared across clusters. In any case, when
145 * the outer cache needs flushing, there is no concurrent
146 * access to the cache controller to worry about and no
147 * special locking besides what is already provided by the
148 * MCPM state machinery is needed.
143 */ 149 */
144 outer_flush_all();
145 150
146 /* 151 /*
147 * Disable cluster-level coherency by masking 152 * Disable cluster-level coherency by masking
diff --git a/arch/arm/mach-virt/Kconfig b/arch/arm/mach-virt/Kconfig
deleted file mode 100644
index 081d46929436..000000000000
--- a/arch/arm/mach-virt/Kconfig
+++ /dev/null
@@ -1,10 +0,0 @@
1config ARCH_VIRT
2 bool "Dummy Virtual Machine" if ARCH_MULTI_V7
3 select ARCH_WANT_OPTIONAL_GPIOLIB
4 select ARM_GIC
5 select HAVE_ARM_ARCH_TIMER
6 select ARM_PSCI
7 select HAVE_SMP
8 select CPU_V7
9 select SPARSE_IRQ
10 select USE_OF
diff --git a/arch/arm/mach-virt/Makefile b/arch/arm/mach-virt/Makefile
deleted file mode 100644
index 7ddbfa60227f..000000000000
--- a/arch/arm/mach-virt/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5obj-y := virt.o
diff --git a/arch/arm/mach-virt/virt.c b/arch/arm/mach-virt/virt.c
deleted file mode 100644
index b184e57d1854..000000000000
--- a/arch/arm/mach-virt/virt.c
+++ /dev/null
@@ -1,41 +0,0 @@
1/*
2 * Dummy Virtual Machine - does what it says on the tin.
3 *
4 * Copyright (C) 2012 ARM Ltd
5 * Authors: Will Deacon <will.deacon@arm.com>,
6 * Marc Zyngier <marc.zyngier@arm.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include <linux/of_irq.h>
22#include <linux/of_platform.h>
23#include <linux/smp.h>
24
25#include <asm/mach/arch.h>
26
27static void __init virt_init(void)
28{
29 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
30}
31
32static const char *virt_dt_match[] = {
33 "linux,dummy-virt",
34 "xen,xenvm",
35 NULL
36};
37
38DT_MACHINE_START(VIRT, "Dummy Virtual Machine")
39 .init_machine = virt_init,
40 .dt_compat = virt_dt_match,
41MACHINE_END
diff --git a/arch/arm/mach-vt8500/Kconfig b/arch/arm/mach-vt8500/Kconfig
index 927be93b692e..08f56a41cb55 100644
--- a/arch/arm/mach-vt8500/Kconfig
+++ b/arch/arm/mach-vt8500/Kconfig
@@ -3,8 +3,6 @@ config ARCH_VT8500
3 select ARCH_HAS_CPUFREQ 3 select ARCH_HAS_CPUFREQ
4 select ARCH_REQUIRE_GPIOLIB 4 select ARCH_REQUIRE_GPIOLIB
5 select CLKDEV_LOOKUP 5 select CLKDEV_LOOKUP
6 select CLKSRC_OF
7 select GENERIC_CLOCKEVENTS
8 select VT8500_TIMER 6 select VT8500_TIMER
9 select PINCTRL 7 select PINCTRL
10 help 8 help
@@ -21,7 +19,6 @@ config ARCH_WM8750
21 bool "WonderMedia WM8750" 19 bool "WonderMedia WM8750"
22 depends on ARCH_MULTI_V6 20 depends on ARCH_MULTI_V6
23 select ARCH_VT8500 21 select ARCH_VT8500
24 select CPU_V6
25 help 22 help
26 Support for WonderMedia WM8750 System-on-Chip. 23 Support for WonderMedia WM8750 System-on-Chip.
27 24
@@ -29,6 +26,5 @@ config ARCH_WM8850
29 bool "WonderMedia WM8850" 26 bool "WonderMedia WM8850"
30 depends on ARCH_MULTI_V7 27 depends on ARCH_MULTI_V7
31 select ARCH_VT8500 28 select ARCH_VT8500
32 select CPU_V7
33 help 29 help
34 Support for WonderMedia WM8850 System-on-Chip. 30 Support for WonderMedia WM8850 System-on-Chip.
diff --git a/arch/arm/mach-w90x900/include/mach/timex.h b/arch/arm/mach-w90x900/include/mach/timex.h
deleted file mode 100644
index 164dce0b64db..000000000000
--- a/arch/arm/mach-w90x900/include/mach/timex.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * arch/arm/mach-w90x900/include/mach/timex.h
3 *
4 * Copyright (c) 2008 Nuvoton technology corporation
5 * All rights reserved.
6 *
7 * Wan ZongShun <mcuos.com@gmail.com>
8 *
9 * Based on arch/arm/mach-s3c2410/include/mach/timex.h
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 as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 */
17
18#ifndef __ASM_ARCH_TIMEX_H
19#define __ASM_ARCH_TIMEX_H
20
21/* CLOCK_TICK_RATE Now, I don't use it. */
22
23#define CLOCK_TICK_RATE 15000000
24
25#endif /* __ASM_ARCH_TIMEX_H */
diff --git a/arch/arm/mach-w90x900/time.c b/arch/arm/mach-w90x900/time.c
index 30fbca844575..9230d3725599 100644
--- a/arch/arm/mach-w90x900/time.c
+++ b/arch/arm/mach-w90x900/time.c
@@ -111,7 +111,7 @@ static irqreturn_t nuc900_timer0_interrupt(int irq, void *dev_id)
111 111
112static struct irqaction nuc900_timer0_irq = { 112static struct irqaction nuc900_timer0_irq = {
113 .name = "nuc900-timer0", 113 .name = "nuc900-timer0",
114 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 114 .flags = IRQF_TIMER | IRQF_IRQPOLL,
115 .handler = nuc900_timer0_interrupt, 115 .handler = nuc900_timer0_interrupt,
116}; 116};
117 117
diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig
index f03e75bd0b2b..58c2b844e0a3 100644
--- a/arch/arm/mach-zynq/Kconfig
+++ b/arch/arm/mach-zynq/Kconfig
@@ -4,17 +4,11 @@ config ARCH_ZYNQ
4 select ARM_GIC 4 select ARM_GIC
5 select ARCH_HAS_CPUFREQ 5 select ARCH_HAS_CPUFREQ
6 select ARCH_HAS_OPP 6 select ARCH_HAS_OPP
7 select COMMON_CLK
8 select CPU_V7
9 select GENERIC_CLOCKEVENTS
10 select HAVE_ARM_SCU if SMP 7 select HAVE_ARM_SCU if SMP
11 select HAVE_ARM_TWD if SMP 8 select HAVE_ARM_TWD if SMP
12 select ICST 9 select ICST
13 select MIGHT_HAVE_CACHE_L2X0
14 select USE_OF
15 select HAVE_SMP
16 select SPARSE_IRQ
17 select CADENCE_TTC_TIMER 10 select CADENCE_TTC_TIMER
18 select ARM_GLOBAL_TIMER if !CPU_FREQ 11 select ARM_GLOBAL_TIMER if !CPU_FREQ
12 select MFD_SYSCON
19 help 13 help
20 Support for Xilinx Zynq ARM Cortex A9 Platform 14 Support for Xilinx Zynq ARM Cortex A9 Platform
diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c
index a39be8e80856..6fcc584c1a11 100644
--- a/arch/arm/mach-zynq/common.c
+++ b/arch/arm/mach-zynq/common.c
@@ -19,6 +19,7 @@
19#include <linux/cpumask.h> 19#include <linux/cpumask.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/clk-provider.h>
22#include <linux/clk/zynq.h> 23#include <linux/clk/zynq.h>
23#include <linux/clocksource.h> 24#include <linux/clocksource.h>
24#include <linux/of_address.h> 25#include <linux/of_address.h>
@@ -75,11 +76,16 @@ static void __init zynq_init_machine(void)
75 76
76 platform_device_register(&zynq_cpuidle_device); 77 platform_device_register(&zynq_cpuidle_device);
77 platform_device_register_full(&devinfo); 78 platform_device_register_full(&devinfo);
79
80 zynq_slcr_init();
78} 81}
79 82
80static void __init zynq_timer_init(void) 83static void __init zynq_timer_init(void)
81{ 84{
82 zynq_slcr_init(); 85 zynq_early_slcr_init();
86
87 zynq_clock_init();
88 of_clk_init(NULL);
83 clocksource_of_init(); 89 clocksource_of_init();
84} 90}
85 91
diff --git a/arch/arm/mach-zynq/common.h b/arch/arm/mach-zynq/common.h
index c22c92cea8cb..b097844d3175 100644
--- a/arch/arm/mach-zynq/common.h
+++ b/arch/arm/mach-zynq/common.h
@@ -20,6 +20,7 @@
20void zynq_secondary_startup(void); 20void zynq_secondary_startup(void);
21 21
22extern int zynq_slcr_init(void); 22extern int zynq_slcr_init(void);
23extern int zynq_early_slcr_init(void);
23extern void zynq_slcr_system_reset(void); 24extern void zynq_slcr_system_reset(void);
24extern void zynq_slcr_cpu_stop(int cpu); 25extern void zynq_slcr_cpu_stop(int cpu);
25extern void zynq_slcr_cpu_start(int cpu); 26extern void zynq_slcr_cpu_start(int cpu);
@@ -33,7 +34,6 @@ extern int zynq_cpun_start(u32 address, int cpu);
33extern struct smp_operations zynq_smp_ops __initdata; 34extern struct smp_operations zynq_smp_ops __initdata;
34#endif 35#endif
35 36
36extern void __iomem *zynq_slcr_base;
37extern void __iomem *zynq_scu_base; 37extern void __iomem *zynq_scu_base;
38 38
39/* Hotplug */ 39/* Hotplug */
diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
index 1836d5a34606..a37d49a6e657 100644
--- a/arch/arm/mach-zynq/slcr.c
+++ b/arch/arm/mach-zynq/slcr.c
@@ -15,7 +15,9 @@
15 */ 15 */
16 16
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/mfd/syscon.h>
18#include <linux/of_address.h> 19#include <linux/of_address.h>
20#include <linux/regmap.h>
19#include <linux/clk/zynq.h> 21#include <linux/clk/zynq.h>
20#include "common.h" 22#include "common.h"
21 23
@@ -29,7 +31,56 @@
29#define SLCR_A9_CPU_CLKSTOP 0x10 31#define SLCR_A9_CPU_CLKSTOP 0x10
30#define SLCR_A9_CPU_RST 0x1 32#define SLCR_A9_CPU_RST 0x1
31 33
32void __iomem *zynq_slcr_base; 34static void __iomem *zynq_slcr_base;
35static struct regmap *zynq_slcr_regmap;
36
37/**
38 * zynq_slcr_write - Write to a register in SLCR block
39 *
40 * @val: Value to write to the register
41 * @offset: Register offset in SLCR block
42 *
43 * Return: a negative value on error, 0 on success
44 */
45static int zynq_slcr_write(u32 val, u32 offset)
46{
47 if (!zynq_slcr_regmap) {
48 writel(val, zynq_slcr_base + offset);
49 return 0;
50 }
51
52 return regmap_write(zynq_slcr_regmap, offset, val);
53}
54
55/**
56 * zynq_slcr_read - Read a register in SLCR block
57 *
58 * @val: Pointer to value to be read from SLCR
59 * @offset: Register offset in SLCR block
60 *
61 * Return: a negative value on error, 0 on success
62 */
63static int zynq_slcr_read(u32 *val, u32 offset)
64{
65 if (zynq_slcr_regmap)
66 return regmap_read(zynq_slcr_regmap, offset, val);
67
68 *val = readl(zynq_slcr_base + offset);
69
70 return 0;
71}
72
73/**
74 * zynq_slcr_unlock - Unlock SLCR registers
75 *
76 * Return: a negative value on error, 0 on success
77 */
78static inline int zynq_slcr_unlock(void)
79{
80 zynq_slcr_write(SLCR_UNLOCK_MAGIC, SLCR_UNLOCK_OFFSET);
81
82 return 0;
83}
33 84
34/** 85/**
35 * zynq_slcr_system_reset - Reset the entire system. 86 * zynq_slcr_system_reset - Reset the entire system.
@@ -43,16 +94,16 @@ void zynq_slcr_system_reset(void)
43 * Note that this seems to require raw i/o 94 * Note that this seems to require raw i/o
44 * functions or there's a lockup? 95 * functions or there's a lockup?
45 */ 96 */
46 writel(SLCR_UNLOCK_MAGIC, zynq_slcr_base + SLCR_UNLOCK_OFFSET); 97 zynq_slcr_unlock();
47 98
48 /* 99 /*
49 * Clear 0x0F000000 bits of reboot status register to workaround 100 * Clear 0x0F000000 bits of reboot status register to workaround
50 * the FSBL not loading the bitstream after soft-reboot 101 * the FSBL not loading the bitstream after soft-reboot
51 * This is a temporary solution until we know more. 102 * This is a temporary solution until we know more.
52 */ 103 */
53 reboot = readl(zynq_slcr_base + SLCR_REBOOT_STATUS_OFFSET); 104 zynq_slcr_read(&reboot, SLCR_REBOOT_STATUS_OFFSET);
54 writel(reboot & 0xF0FFFFFF, zynq_slcr_base + SLCR_REBOOT_STATUS_OFFSET); 105 zynq_slcr_write(reboot & 0xF0FFFFFF, SLCR_REBOOT_STATUS_OFFSET);
55 writel(1, zynq_slcr_base + SLCR_PS_RST_CTRL_OFFSET); 106 zynq_slcr_write(1, SLCR_PS_RST_CTRL_OFFSET);
56} 107}
57 108
58/** 109/**
@@ -61,11 +112,13 @@ void zynq_slcr_system_reset(void)
61 */ 112 */
62void zynq_slcr_cpu_start(int cpu) 113void zynq_slcr_cpu_start(int cpu)
63{ 114{
64 u32 reg = readl(zynq_slcr_base + SLCR_A9_CPU_RST_CTRL_OFFSET); 115 u32 reg;
116
117 zynq_slcr_read(&reg, SLCR_A9_CPU_RST_CTRL_OFFSET);
65 reg &= ~(SLCR_A9_CPU_RST << cpu); 118 reg &= ~(SLCR_A9_CPU_RST << cpu);
66 writel(reg, zynq_slcr_base + SLCR_A9_CPU_RST_CTRL_OFFSET); 119 zynq_slcr_write(reg, SLCR_A9_CPU_RST_CTRL_OFFSET);
67 reg &= ~(SLCR_A9_CPU_CLKSTOP << cpu); 120 reg &= ~(SLCR_A9_CPU_CLKSTOP << cpu);
68 writel(reg, zynq_slcr_base + SLCR_A9_CPU_RST_CTRL_OFFSET); 121 zynq_slcr_write(reg, SLCR_A9_CPU_RST_CTRL_OFFSET);
69} 122}
70 123
71/** 124/**
@@ -74,19 +127,40 @@ void zynq_slcr_cpu_start(int cpu)
74 */ 127 */
75void zynq_slcr_cpu_stop(int cpu) 128void zynq_slcr_cpu_stop(int cpu)
76{ 129{
77 u32 reg = readl(zynq_slcr_base + SLCR_A9_CPU_RST_CTRL_OFFSET); 130 u32 reg;
131
132 zynq_slcr_read(&reg, SLCR_A9_CPU_RST_CTRL_OFFSET);
78 reg |= (SLCR_A9_CPU_CLKSTOP | SLCR_A9_CPU_RST) << cpu; 133 reg |= (SLCR_A9_CPU_CLKSTOP | SLCR_A9_CPU_RST) << cpu;
79 writel(reg, zynq_slcr_base + SLCR_A9_CPU_RST_CTRL_OFFSET); 134 zynq_slcr_write(reg, SLCR_A9_CPU_RST_CTRL_OFFSET);
80} 135}
81 136
82/** 137/**
83 * zynq_slcr_init 138 * zynq_slcr_init - Regular slcr driver init
84 * Returns 0 on success, negative errno otherwise. 139 *
140 * Return: 0 on success, negative errno otherwise.
85 * 141 *
86 * Called early during boot from platform code to remap SLCR area. 142 * Called early during boot from platform code to remap SLCR area.
87 */ 143 */
88int __init zynq_slcr_init(void) 144int __init zynq_slcr_init(void)
89{ 145{
146 zynq_slcr_regmap = syscon_regmap_lookup_by_compatible("xlnx,zynq-slcr");
147 if (IS_ERR(zynq_slcr_regmap)) {
148 pr_err("%s: failed to find zynq-slcr\n", __func__);
149 return -ENODEV;
150 }
151
152 return 0;
153}
154
155/**
156 * zynq_early_slcr_init - Early slcr init function
157 *
158 * Return: 0 on success, negative errno otherwise.
159 *
160 * Called very early during boot from platform code to unlock SLCR.
161 */
162int __init zynq_early_slcr_init(void)
163{
90 struct device_node *np; 164 struct device_node *np;
91 165
92 np = of_find_compatible_node(NULL, NULL, "xlnx,zynq-slcr"); 166 np = of_find_compatible_node(NULL, NULL, "xlnx,zynq-slcr");
@@ -101,13 +175,13 @@ int __init zynq_slcr_init(void)
101 BUG(); 175 BUG();
102 } 176 }
103 177
178 np->data = (__force void *)zynq_slcr_base;
179
104 /* unlock the SLCR so that registers can be changed */ 180 /* unlock the SLCR so that registers can be changed */
105 writel(SLCR_UNLOCK_MAGIC, zynq_slcr_base + SLCR_UNLOCK_OFFSET); 181 zynq_slcr_unlock();
106 182
107 pr_info("%s mapped to %p\n", np->name, zynq_slcr_base); 183 pr_info("%s mapped to %p\n", np->name, zynq_slcr_base);
108 184
109 zynq_clock_init(zynq_slcr_base);
110
111 of_node_put(np); 185 of_node_put(np);
112 186
113 return 0; 187 return 0;
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 1f8fed94c2a4..f5ad9ee70426 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -264,7 +264,7 @@ config CPU_ARM1026
264 264
265# SA110 265# SA110
266config CPU_SA110 266config CPU_SA110
267 bool "Support StrongARM(R) SA-110 processor" if ARCH_RPC 267 bool
268 select CPU_32v3 if ARCH_RPC 268 select CPU_32v3 if ARCH_RPC
269 select CPU_32v4 if !ARCH_RPC 269 select CPU_32v4 if !ARCH_RPC
270 select CPU_ABRT_EV4 270 select CPU_ABRT_EV4
@@ -446,7 +446,6 @@ config CPU_32v5
446 446
447config CPU_32v6 447config CPU_32v6
448 bool 448 bool
449 select CPU_USE_DOMAINS if CPU_V6 && MMU
450 select TLS_REG_EMUL if !CPU_32v6K && !MMU 449 select TLS_REG_EMUL if !CPU_32v6K && !MMU
451 450
452config CPU_32v6K 451config CPU_32v6K
@@ -671,7 +670,7 @@ config ARM_VIRT_EXT
671 670
672config SWP_EMULATE 671config SWP_EMULATE
673 bool "Emulate SWP/SWPB instructions" 672 bool "Emulate SWP/SWPB instructions"
674 depends on !CPU_USE_DOMAINS && CPU_V7 673 depends on CPU_V7
675 default y if SMP 674 default y if SMP
676 select HAVE_PROC_CPU if PROC_FS 675 select HAVE_PROC_CPU if PROC_FS
677 help 676 help
@@ -855,7 +854,7 @@ config OUTER_CACHE_SYNC
855 854
856config CACHE_FEROCEON_L2 855config CACHE_FEROCEON_L2
857 bool "Enable the Feroceon L2 cache controller" 856 bool "Enable the Feroceon L2 cache controller"
858 depends on ARCH_KIRKWOOD || ARCH_MV78XX0 857 depends on ARCH_KIRKWOOD || ARCH_MV78XX0 || ARCH_MVEBU
859 default y 858 default y
860 select OUTER_CACHE 859 select OUTER_CACHE
861 help 860 help
diff --git a/arch/arm/mm/cache-feroceon-l2.c b/arch/arm/mm/cache-feroceon-l2.c
index 48bc3c0a87ce..dc814a548056 100644
--- a/arch/arm/mm/cache-feroceon-l2.c
+++ b/arch/arm/mm/cache-feroceon-l2.c
@@ -13,10 +13,15 @@
13 */ 13 */
14 14
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/of.h>
17#include <linux/of_address.h>
16#include <linux/highmem.h> 18#include <linux/highmem.h>
19#include <linux/io.h>
17#include <asm/cacheflush.h> 20#include <asm/cacheflush.h>
18#include <asm/cp15.h> 21#include <asm/cp15.h>
19#include <plat/cache-feroceon-l2.h> 22#include <asm/hardware/cache-feroceon-l2.h>
23
24#define L2_WRITETHROUGH_KIRKWOOD BIT(4)
20 25
21/* 26/*
22 * Low-level cache maintenance operations. 27 * Low-level cache maintenance operations.
@@ -331,7 +336,9 @@ static void __init enable_l2(void)
331 enable_icache(); 336 enable_icache();
332 if (d) 337 if (d)
333 enable_dcache(); 338 enable_dcache();
334 } 339 } else
340 pr_err(FW_BUG
341 "Feroceon L2: bootloader left the L2 cache on!\n");
335} 342}
336 343
337void __init feroceon_l2_init(int __l2_wt_override) 344void __init feroceon_l2_init(int __l2_wt_override)
@@ -350,3 +357,41 @@ void __init feroceon_l2_init(int __l2_wt_override)
350 printk(KERN_INFO "Feroceon L2: Cache support initialised%s.\n", 357 printk(KERN_INFO "Feroceon L2: Cache support initialised%s.\n",
351 l2_wt_override ? ", in WT override mode" : ""); 358 l2_wt_override ? ", in WT override mode" : "");
352} 359}
360#ifdef CONFIG_OF
361static const struct of_device_id feroceon_ids[] __initconst = {
362 { .compatible = "marvell,kirkwood-cache"},
363 { .compatible = "marvell,feroceon-cache"},
364 {}
365};
366
367int __init feroceon_of_init(void)
368{
369 struct device_node *node;
370 void __iomem *base;
371 bool l2_wt_override = false;
372 struct resource res;
373
374#if defined(CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH)
375 l2_wt_override = true;
376#endif
377
378 node = of_find_matching_node(NULL, feroceon_ids);
379 if (node && of_device_is_compatible(node, "marvell,kirkwood-cache")) {
380 if (of_address_to_resource(node, 0, &res))
381 return -ENODEV;
382
383 base = ioremap(res.start, resource_size(&res));
384 if (!base)
385 return -ENOMEM;
386
387 if (l2_wt_override)
388 writel(readl(base) | L2_WRITETHROUGH_KIRKWOOD, base);
389 else
390 writel(readl(base) & ~L2_WRITETHROUGH_KIRKWOOD, base);
391 }
392
393 feroceon_l2_init(l2_wt_override);
394
395 return 0;
396}
397#endif
diff --git a/arch/arm/mm/cache-tauros2.c b/arch/arm/mm/cache-tauros2.c
index 1be0f4e5e6eb..b273739e6359 100644
--- a/arch/arm/mm/cache-tauros2.c
+++ b/arch/arm/mm/cache-tauros2.c
@@ -33,7 +33,7 @@
33 * outer cache operations into the kernel image if the kernel has been 33 * outer cache operations into the kernel image if the kernel has been
34 * configured to support a pre-v7 CPU. 34 * configured to support a pre-v7 CPU.
35 */ 35 */
36#if __LINUX_ARM_ARCH__ < 7 36#ifdef CONFIG_CPU_32v5
37/* 37/*
38 * Low-level cache maintenance operations. 38 * Low-level cache maintenance operations.
39 */ 39 */
@@ -229,33 +229,6 @@ static void __init tauros2_internal_init(unsigned int features)
229 } 229 }
230#endif 230#endif
231 231
232#ifdef CONFIG_CPU_32v6
233 /*
234 * Check whether this CPU lacks support for the v7 hierarchical
235 * cache ops. (PJ4 is in its v6 personality mode if the MMFR3
236 * register indicates no support for the v7 hierarchical cache
237 * ops.)
238 */
239 if (cpuid_scheme() && (read_mmfr3() & 0xf) == 0) {
240 /*
241 * When Tauros2 is used in an ARMv6 system, the L2
242 * enable bit is in the ARMv6 ARM-mandated position
243 * (bit [26] of the System Control Register).
244 */
245 if (!(get_cr() & 0x04000000)) {
246 printk(KERN_INFO "Tauros2: Enabling L2 cache.\n");
247 adjust_cr(0x04000000, 0x04000000);
248 }
249
250 mode = "ARMv6";
251 outer_cache.inv_range = tauros2_inv_range;
252 outer_cache.clean_range = tauros2_clean_range;
253 outer_cache.flush_range = tauros2_flush_range;
254 outer_cache.disable = tauros2_disable;
255 outer_cache.resume = tauros2_resume;
256 }
257#endif
258
259#ifdef CONFIG_CPU_32v7 232#ifdef CONFIG_CPU_32v7
260 /* 233 /*
261 * Check whether this CPU has support for the v7 hierarchical 234 * Check whether this CPU has support for the v7 hierarchical
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 11b3914660d2..f62aa0677e5c 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -284,9 +284,6 @@ static void __dma_free_buffer(struct page *page, size_t size)
284} 284}
285 285
286#ifdef CONFIG_MMU 286#ifdef CONFIG_MMU
287#ifdef CONFIG_HUGETLB_PAGE
288#warning ARM Coherent DMA allocator does not (yet) support huge TLB
289#endif
290 287
291static void *__alloc_from_contiguous(struct device *dev, size_t size, 288static void *__alloc_from_contiguous(struct device *dev, size_t size,
292 pgprot_t prot, struct page **ret_page, 289 pgprot_t prot, struct page **ret_page,
@@ -1069,6 +1066,8 @@ fs_initcall(dma_debug_do_init);
1069 1066
1070/* IOMMU */ 1067/* IOMMU */
1071 1068
1069static int extend_iommu_mapping(struct dma_iommu_mapping *mapping);
1070
1072static inline dma_addr_t __alloc_iova(struct dma_iommu_mapping *mapping, 1071static inline dma_addr_t __alloc_iova(struct dma_iommu_mapping *mapping,
1073 size_t size) 1072 size_t size)
1074{ 1073{
@@ -1076,41 +1075,87 @@ static inline dma_addr_t __alloc_iova(struct dma_iommu_mapping *mapping,
1076 unsigned int align = 0; 1075 unsigned int align = 0;
1077 unsigned int count, start; 1076 unsigned int count, start;
1078 unsigned long flags; 1077 unsigned long flags;
1078 dma_addr_t iova;
1079 int i;
1079 1080
1080 if (order > CONFIG_ARM_DMA_IOMMU_ALIGNMENT) 1081 if (order > CONFIG_ARM_DMA_IOMMU_ALIGNMENT)
1081 order = CONFIG_ARM_DMA_IOMMU_ALIGNMENT; 1082 order = CONFIG_ARM_DMA_IOMMU_ALIGNMENT;
1082 1083
1083 count = ((PAGE_ALIGN(size) >> PAGE_SHIFT) + 1084 count = PAGE_ALIGN(size) >> PAGE_SHIFT;
1084 (1 << mapping->order) - 1) >> mapping->order; 1085 align = (1 << order) - 1;
1085
1086 if (order > mapping->order)
1087 align = (1 << (order - mapping->order)) - 1;
1088 1086
1089 spin_lock_irqsave(&mapping->lock, flags); 1087 spin_lock_irqsave(&mapping->lock, flags);
1090 start = bitmap_find_next_zero_area(mapping->bitmap, mapping->bits, 0, 1088 for (i = 0; i < mapping->nr_bitmaps; i++) {
1091 count, align); 1089 start = bitmap_find_next_zero_area(mapping->bitmaps[i],
1092 if (start > mapping->bits) { 1090 mapping->bits, 0, count, align);
1093 spin_unlock_irqrestore(&mapping->lock, flags); 1091
1094 return DMA_ERROR_CODE; 1092 if (start > mapping->bits)
1093 continue;
1094
1095 bitmap_set(mapping->bitmaps[i], start, count);
1096 break;
1095 } 1097 }
1096 1098
1097 bitmap_set(mapping->bitmap, start, count); 1099 /*
1100 * No unused range found. Try to extend the existing mapping
1101 * and perform a second attempt to reserve an IO virtual
1102 * address range of size bytes.
1103 */
1104 if (i == mapping->nr_bitmaps) {
1105 if (extend_iommu_mapping(mapping)) {
1106 spin_unlock_irqrestore(&mapping->lock, flags);
1107 return DMA_ERROR_CODE;
1108 }
1109
1110 start = bitmap_find_next_zero_area(mapping->bitmaps[i],
1111 mapping->bits, 0, count, align);
1112
1113 if (start > mapping->bits) {
1114 spin_unlock_irqrestore(&mapping->lock, flags);
1115 return DMA_ERROR_CODE;
1116 }
1117
1118 bitmap_set(mapping->bitmaps[i], start, count);
1119 }
1098 spin_unlock_irqrestore(&mapping->lock, flags); 1120 spin_unlock_irqrestore(&mapping->lock, flags);
1099 1121
1100 return mapping->base + (start << (mapping->order + PAGE_SHIFT)); 1122 iova = mapping->base + (mapping->size * i);
1123 iova += start << PAGE_SHIFT;
1124
1125 return iova;
1101} 1126}
1102 1127
1103static inline void __free_iova(struct dma_iommu_mapping *mapping, 1128static inline void __free_iova(struct dma_iommu_mapping *mapping,
1104 dma_addr_t addr, size_t size) 1129 dma_addr_t addr, size_t size)
1105{ 1130{
1106 unsigned int start = (addr - mapping->base) >> 1131 unsigned int start, count;
1107 (mapping->order + PAGE_SHIFT);
1108 unsigned int count = ((size >> PAGE_SHIFT) +
1109 (1 << mapping->order) - 1) >> mapping->order;
1110 unsigned long flags; 1132 unsigned long flags;
1133 dma_addr_t bitmap_base;
1134 u32 bitmap_index;
1135
1136 if (!size)
1137 return;
1138
1139 bitmap_index = (u32) (addr - mapping->base) / (u32) mapping->size;
1140 BUG_ON(addr < mapping->base || bitmap_index > mapping->extensions);
1141
1142 bitmap_base = mapping->base + mapping->size * bitmap_index;
1143
1144 start = (addr - bitmap_base) >> PAGE_SHIFT;
1145
1146 if (addr + size > bitmap_base + mapping->size) {
1147 /*
1148 * The address range to be freed reaches into the iova
1149 * range of the next bitmap. This should not happen as
1150 * we don't allow this in __alloc_iova (at the
1151 * moment).
1152 */
1153 BUG();
1154 } else
1155 count = size >> PAGE_SHIFT;
1111 1156
1112 spin_lock_irqsave(&mapping->lock, flags); 1157 spin_lock_irqsave(&mapping->lock, flags);
1113 bitmap_clear(mapping->bitmap, start, count); 1158 bitmap_clear(mapping->bitmaps[bitmap_index], start, count);
1114 spin_unlock_irqrestore(&mapping->lock, flags); 1159 spin_unlock_irqrestore(&mapping->lock, flags);
1115} 1160}
1116 1161
@@ -1875,8 +1920,7 @@ struct dma_map_ops iommu_coherent_ops = {
1875 * arm_iommu_create_mapping 1920 * arm_iommu_create_mapping
1876 * @bus: pointer to the bus holding the client device (for IOMMU calls) 1921 * @bus: pointer to the bus holding the client device (for IOMMU calls)
1877 * @base: start address of the valid IO address space 1922 * @base: start address of the valid IO address space
1878 * @size: size of the valid IO address space 1923 * @size: maximum size of the valid IO address space
1879 * @order: accuracy of the IO addresses allocations
1880 * 1924 *
1881 * Creates a mapping structure which holds information about used/unused 1925 * Creates a mapping structure which holds information about used/unused
1882 * IO address ranges, which is required to perform memory allocation and 1926 * IO address ranges, which is required to perform memory allocation and
@@ -1886,38 +1930,54 @@ struct dma_map_ops iommu_coherent_ops = {
1886 * arm_iommu_attach_device function. 1930 * arm_iommu_attach_device function.
1887 */ 1931 */
1888struct dma_iommu_mapping * 1932struct dma_iommu_mapping *
1889arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size, 1933arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size)
1890 int order)
1891{ 1934{
1892 unsigned int count = size >> (PAGE_SHIFT + order); 1935 unsigned int bits = size >> PAGE_SHIFT;
1893 unsigned int bitmap_size = BITS_TO_LONGS(count) * sizeof(long); 1936 unsigned int bitmap_size = BITS_TO_LONGS(bits) * sizeof(long);
1894 struct dma_iommu_mapping *mapping; 1937 struct dma_iommu_mapping *mapping;
1938 int extensions = 1;
1895 int err = -ENOMEM; 1939 int err = -ENOMEM;
1896 1940
1897 if (!count) 1941 if (!bitmap_size)
1898 return ERR_PTR(-EINVAL); 1942 return ERR_PTR(-EINVAL);
1899 1943
1944 if (bitmap_size > PAGE_SIZE) {
1945 extensions = bitmap_size / PAGE_SIZE;
1946 bitmap_size = PAGE_SIZE;
1947 }
1948
1900 mapping = kzalloc(sizeof(struct dma_iommu_mapping), GFP_KERNEL); 1949 mapping = kzalloc(sizeof(struct dma_iommu_mapping), GFP_KERNEL);
1901 if (!mapping) 1950 if (!mapping)
1902 goto err; 1951 goto err;
1903 1952
1904 mapping->bitmap = kzalloc(bitmap_size, GFP_KERNEL); 1953 mapping->bitmap_size = bitmap_size;
1905 if (!mapping->bitmap) 1954 mapping->bitmaps = kzalloc(extensions * sizeof(unsigned long *),
1955 GFP_KERNEL);
1956 if (!mapping->bitmaps)
1906 goto err2; 1957 goto err2;
1907 1958
1959 mapping->bitmaps[0] = kzalloc(bitmap_size, GFP_KERNEL);
1960 if (!mapping->bitmaps[0])
1961 goto err3;
1962
1963 mapping->nr_bitmaps = 1;
1964 mapping->extensions = extensions;
1908 mapping->base = base; 1965 mapping->base = base;
1966 mapping->size = bitmap_size << PAGE_SHIFT;
1909 mapping->bits = BITS_PER_BYTE * bitmap_size; 1967 mapping->bits = BITS_PER_BYTE * bitmap_size;
1910 mapping->order = order; 1968
1911 spin_lock_init(&mapping->lock); 1969 spin_lock_init(&mapping->lock);
1912 1970
1913 mapping->domain = iommu_domain_alloc(bus); 1971 mapping->domain = iommu_domain_alloc(bus);
1914 if (!mapping->domain) 1972 if (!mapping->domain)
1915 goto err3; 1973 goto err4;
1916 1974
1917 kref_init(&mapping->kref); 1975 kref_init(&mapping->kref);
1918 return mapping; 1976 return mapping;
1977err4:
1978 kfree(mapping->bitmaps[0]);
1919err3: 1979err3:
1920 kfree(mapping->bitmap); 1980 kfree(mapping->bitmaps);
1921err2: 1981err2:
1922 kfree(mapping); 1982 kfree(mapping);
1923err: 1983err:
@@ -1927,14 +1987,35 @@ EXPORT_SYMBOL_GPL(arm_iommu_create_mapping);
1927 1987
1928static void release_iommu_mapping(struct kref *kref) 1988static void release_iommu_mapping(struct kref *kref)
1929{ 1989{
1990 int i;
1930 struct dma_iommu_mapping *mapping = 1991 struct dma_iommu_mapping *mapping =
1931 container_of(kref, struct dma_iommu_mapping, kref); 1992 container_of(kref, struct dma_iommu_mapping, kref);
1932 1993
1933 iommu_domain_free(mapping->domain); 1994 iommu_domain_free(mapping->domain);
1934 kfree(mapping->bitmap); 1995 for (i = 0; i < mapping->nr_bitmaps; i++)
1996 kfree(mapping->bitmaps[i]);
1997 kfree(mapping->bitmaps);
1935 kfree(mapping); 1998 kfree(mapping);
1936} 1999}
1937 2000
2001static int extend_iommu_mapping(struct dma_iommu_mapping *mapping)
2002{
2003 int next_bitmap;
2004
2005 if (mapping->nr_bitmaps > mapping->extensions)
2006 return -EINVAL;
2007
2008 next_bitmap = mapping->nr_bitmaps;
2009 mapping->bitmaps[next_bitmap] = kzalloc(mapping->bitmap_size,
2010 GFP_ATOMIC);
2011 if (!mapping->bitmaps[next_bitmap])
2012 return -ENOMEM;
2013
2014 mapping->nr_bitmaps++;
2015
2016 return 0;
2017}
2018
1938void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping) 2019void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping)
1939{ 2020{
1940 if (mapping) 2021 if (mapping)
diff --git a/arch/arm/mm/dump.c b/arch/arm/mm/dump.c
index ef69152f9b52..c508f41a43bc 100644
--- a/arch/arm/mm/dump.c
+++ b/arch/arm/mm/dump.c
@@ -120,34 +120,51 @@ static const struct prot_bits pte_bits[] = {
120}; 120};
121 121
122static const struct prot_bits section_bits[] = { 122static const struct prot_bits section_bits[] = {
123#ifndef CONFIG_ARM_LPAE 123#ifdef CONFIG_ARM_LPAE
124 /* These are approximate */ 124 {
125 .mask = PMD_SECT_USER,
126 .val = PMD_SECT_USER,
127 .set = "USR",
128 }, {
129 .mask = PMD_SECT_RDONLY,
130 .val = PMD_SECT_RDONLY,
131 .set = "ro",
132 .clear = "RW",
133#elif __LINUX_ARM_ARCH__ >= 6
125 { 134 {
126 .mask = PMD_SECT_AP_READ | PMD_SECT_AP_WRITE, 135 .mask = PMD_SECT_APX | PMD_SECT_AP_READ | PMD_SECT_AP_WRITE,
127 .val = 0, 136 .val = PMD_SECT_APX | PMD_SECT_AP_WRITE,
128 .set = " ro", 137 .set = " ro",
129 }, { 138 }, {
130 .mask = PMD_SECT_AP_READ | PMD_SECT_AP_WRITE, 139 .mask = PMD_SECT_APX | PMD_SECT_AP_READ | PMD_SECT_AP_WRITE,
131 .val = PMD_SECT_AP_WRITE, 140 .val = PMD_SECT_AP_WRITE,
132 .set = " RW", 141 .set = " RW",
133 }, { 142 }, {
134 .mask = PMD_SECT_AP_READ | PMD_SECT_AP_WRITE, 143 .mask = PMD_SECT_APX | PMD_SECT_AP_READ | PMD_SECT_AP_WRITE,
135 .val = PMD_SECT_AP_READ, 144 .val = PMD_SECT_AP_READ,
136 .set = "USR ro", 145 .set = "USR ro",
137 }, { 146 }, {
138 .mask = PMD_SECT_AP_READ | PMD_SECT_AP_WRITE, 147 .mask = PMD_SECT_APX | PMD_SECT_AP_READ | PMD_SECT_AP_WRITE,
139 .val = PMD_SECT_AP_READ | PMD_SECT_AP_WRITE, 148 .val = PMD_SECT_AP_READ | PMD_SECT_AP_WRITE,
140 .set = "USR RW", 149 .set = "USR RW",
141#else 150#else /* ARMv4/ARMv5 */
151 /* These are approximate */
142 { 152 {
143 .mask = PMD_SECT_USER, 153 .mask = PMD_SECT_AP_READ | PMD_SECT_AP_WRITE,
144 .val = PMD_SECT_USER, 154 .val = 0,
145 .set = "USR", 155 .set = " ro",
146 }, { 156 }, {
147 .mask = PMD_SECT_RDONLY, 157 .mask = PMD_SECT_AP_READ | PMD_SECT_AP_WRITE,
148 .val = PMD_SECT_RDONLY, 158 .val = PMD_SECT_AP_WRITE,
149 .set = "ro", 159 .set = " RW",
150 .clear = "RW", 160 }, {
161 .mask = PMD_SECT_AP_READ | PMD_SECT_AP_WRITE,
162 .val = PMD_SECT_AP_READ,
163 .set = "USR ro",
164 }, {
165 .mask = PMD_SECT_AP_READ | PMD_SECT_AP_WRITE,
166 .val = PMD_SECT_AP_READ | PMD_SECT_AP_WRITE,
167 .set = "USR RW",
151#endif 168#endif
152 }, { 169 }, {
153 .mask = PMD_SECT_XN, 170 .mask = PMD_SECT_XN,
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 804d61566a53..2a77ba8796ae 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -323,6 +323,8 @@ void __init arm_memblock_init(struct meminfo *mi,
323 if (mdesc->reserve) 323 if (mdesc->reserve)
324 mdesc->reserve(); 324 mdesc->reserve();
325 325
326 early_init_fdt_scan_reserved_mem();
327
326 /* 328 /*
327 * reserve memory for DMA contigouos allocations, 329 * reserve memory for DMA contigouos allocations,
328 * must come from DMA area inside low memory 330 * must come from DMA area inside low memory
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index a623cb3ad012..b68c6b22e1c8 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -516,6 +516,16 @@ static void __init build_mem_type_table(void)
516 s2_device_pgprot = mem_types[MT_DEVICE].prot_pte_s2; 516 s2_device_pgprot = mem_types[MT_DEVICE].prot_pte_s2;
517 517
518 /* 518 /*
519 * We don't use domains on ARMv6 (since this causes problems with
520 * v6/v7 kernels), so we must use a separate memory type for user
521 * r/o, kernel r/w to map the vectors page.
522 */
523#ifndef CONFIG_ARM_LPAE
524 if (cpu_arch == CPU_ARCH_ARMv6)
525 vecs_pgprot |= L_PTE_MT_VECTORS;
526#endif
527
528 /*
519 * ARMv6 and above have extended page tables. 529 * ARMv6 and above have extended page tables.
520 */ 530 */
521 if (cpu_arch >= CPU_ARCH_ARMv6 && (cr & CR_XP)) { 531 if (cpu_arch >= CPU_ARCH_ARMv6 && (cr & CR_XP)) {
diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S
index e3c48a3fe063..ee1d80593958 100644
--- a/arch/arm/mm/proc-macros.S
+++ b/arch/arm/mm/proc-macros.S
@@ -112,13 +112,9 @@
112 * 100x 1 0 1 r/o no acc 112 * 100x 1 0 1 r/o no acc
113 * 10x0 1 0 1 r/o no acc 113 * 10x0 1 0 1 r/o no acc
114 * 1011 0 0 1 r/w no acc 114 * 1011 0 0 1 r/w no acc
115 * 110x 0 1 0 r/w r/o
116 * 11x0 0 1 0 r/w r/o
117 * 1111 0 1 1 r/w r/w
118 *
119 * If !CONFIG_CPU_USE_DOMAINS, the following permissions are changed:
120 * 110x 1 1 1 r/o r/o 115 * 110x 1 1 1 r/o r/o
121 * 11x0 1 1 1 r/o r/o 116 * 11x0 1 1 1 r/o r/o
117 * 1111 0 1 1 r/w r/w
122 */ 118 */
123 .macro armv6_mt_table pfx 119 .macro armv6_mt_table pfx
124\pfx\()_mt_table: 120\pfx\()_mt_table:
@@ -137,7 +133,7 @@
137 .long PTE_EXT_TEX(2) @ L_PTE_MT_DEV_NONSHARED 133 .long PTE_EXT_TEX(2) @ L_PTE_MT_DEV_NONSHARED
138 .long 0x00 @ unused 134 .long 0x00 @ unused
139 .long 0x00 @ unused 135 .long 0x00 @ unused
140 .long 0x00 @ unused 136 .long PTE_CACHEABLE | PTE_BUFFERABLE | PTE_EXT_APX @ L_PTE_MT_VECTORS
141 .endm 137 .endm
142 138
143 .macro armv6_set_pte_ext pfx 139 .macro armv6_set_pte_ext pfx
@@ -158,24 +154,21 @@
158 154
159 tst r1, #L_PTE_USER 155 tst r1, #L_PTE_USER
160 orrne r3, r3, #PTE_EXT_AP1 156 orrne r3, r3, #PTE_EXT_AP1
161#ifdef CONFIG_CPU_USE_DOMAINS
162 @ allow kernel read/write access to read-only user pages
163 tstne r3, #PTE_EXT_APX 157 tstne r3, #PTE_EXT_APX
164 bicne r3, r3, #PTE_EXT_APX | PTE_EXT_AP0 158
165#endif 159 @ user read-only -> kernel read-only
160 bicne r3, r3, #PTE_EXT_AP0
166 161
167 tst r1, #L_PTE_XN 162 tst r1, #L_PTE_XN
168 orrne r3, r3, #PTE_EXT_XN 163 orrne r3, r3, #PTE_EXT_XN
169 164
170 orr r3, r3, r2 165 eor r3, r3, r2
171 166
172 tst r1, #L_PTE_YOUNG 167 tst r1, #L_PTE_YOUNG
173 tstne r1, #L_PTE_PRESENT 168 tstne r1, #L_PTE_PRESENT
174 moveq r3, #0 169 moveq r3, #0
175#ifndef CONFIG_CPU_USE_DOMAINS
176 tstne r1, #L_PTE_NONE 170 tstne r1, #L_PTE_NONE
177 movne r3, #0 171 movne r3, #0
178#endif
179 172
180 str r3, [r0] 173 str r3, [r0]
181 mcr p15, 0, r0, c7, c10, 1 @ flush_pte 174 mcr p15, 0, r0, c7, c10, 1 @ flush_pte
diff --git a/arch/arm/mm/proc-v7-2level.S b/arch/arm/mm/proc-v7-2level.S
index bdd3be4be77a..1f52915f2b28 100644
--- a/arch/arm/mm/proc-v7-2level.S
+++ b/arch/arm/mm/proc-v7-2level.S
@@ -90,21 +90,14 @@ ENTRY(cpu_v7_set_pte_ext)
90 90
91 tst r1, #L_PTE_USER 91 tst r1, #L_PTE_USER
92 orrne r3, r3, #PTE_EXT_AP1 92 orrne r3, r3, #PTE_EXT_AP1
93#ifdef CONFIG_CPU_USE_DOMAINS
94 @ allow kernel read/write access to read-only user pages
95 tstne r3, #PTE_EXT_APX
96 bicne r3, r3, #PTE_EXT_APX | PTE_EXT_AP0
97#endif
98 93
99 tst r1, #L_PTE_XN 94 tst r1, #L_PTE_XN
100 orrne r3, r3, #PTE_EXT_XN 95 orrne r3, r3, #PTE_EXT_XN
101 96
102 tst r1, #L_PTE_YOUNG 97 tst r1, #L_PTE_YOUNG
103 tstne r1, #L_PTE_VALID 98 tstne r1, #L_PTE_VALID
104#ifndef CONFIG_CPU_USE_DOMAINS
105 eorne r1, r1, #L_PTE_NONE 99 eorne r1, r1, #L_PTE_NONE
106 tstne r1, #L_PTE_NONE 100 tstne r1, #L_PTE_NONE
107#endif
108 moveq r3, #0 101 moveq r3, #0
109 102
110 ARM( str r3, [r0, #2048]! ) 103 ARM( str r3, [r0, #2048]! )
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 74f6033e76dd..195731d3813b 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -192,6 +192,7 @@ __v7_cr7mp_setup:
192 mov r10, #(1 << 0) @ Cache/TLB ops broadcasting 192 mov r10, #(1 << 0) @ Cache/TLB ops broadcasting
193 b 1f 193 b 1f
194__v7_ca7mp_setup: 194__v7_ca7mp_setup:
195__v7_ca12mp_setup:
195__v7_ca15mp_setup: 196__v7_ca15mp_setup:
196 mov r10, #0 197 mov r10, #0
1971: 1981:
@@ -484,6 +485,16 @@ __v7_ca7mp_proc_info:
484 .size __v7_ca7mp_proc_info, . - __v7_ca7mp_proc_info 485 .size __v7_ca7mp_proc_info, . - __v7_ca7mp_proc_info
485 486
486 /* 487 /*
488 * ARM Ltd. Cortex A12 processor.
489 */
490 .type __v7_ca12mp_proc_info, #object
491__v7_ca12mp_proc_info:
492 .long 0x410fc0d0
493 .long 0xff0ffff0
494 __v7_proc __v7_ca12mp_setup
495 .size __v7_ca12mp_proc_info, . - __v7_ca12mp_proc_info
496
497 /*
487 * ARM Ltd. Cortex A15 processor. 498 * ARM Ltd. Cortex A15 processor.
488 */ 499 */
489 .type __v7_ca15mp_proc_info, #object 500 .type __v7_ca15mp_proc_info, #object
diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c
index 271b5e971568..6f879c319a9d 100644
--- a/arch/arm/net/bpf_jit_32.c
+++ b/arch/arm/net/bpf_jit_32.c
@@ -825,8 +825,8 @@ b_epilogue:
825 break; 825 break;
826 case BPF_S_ANC_RXHASH: 826 case BPF_S_ANC_RXHASH:
827 ctx->seen |= SEEN_SKB; 827 ctx->seen |= SEEN_SKB;
828 BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, rxhash) != 4); 828 BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, hash) != 4);
829 off = offsetof(struct sk_buff, rxhash); 829 off = offsetof(struct sk_buff, hash);
830 emit(ARM_LDR_I(r_A, r_skb, off), ctx); 830 emit(ARM_LDR_I(r_A, r_skb, off), ctx);
831 break; 831 break;
832 case BPF_S_ANC_VLAN_TAG: 832 case BPF_S_ANC_VLAN_TAG:
@@ -925,6 +925,7 @@ void bpf_jit_compile(struct sk_filter *fp)
925 bpf_jit_dump(fp->len, alloc_size, 2, ctx.target); 925 bpf_jit_dump(fp->len, alloc_size, 2, ctx.target);
926 926
927 fp->bpf_func = (void *)ctx.target; 927 fp->bpf_func = (void *)ctx.target;
928 fp->jited = 1;
928out: 929out:
929 kfree(ctx.offsets); 930 kfree(ctx.offsets);
930 return; 931 return;
@@ -932,7 +933,7 @@ out:
932 933
933void bpf_jit_free(struct sk_filter *fp) 934void bpf_jit_free(struct sk_filter *fp)
934{ 935{
935 if (fp->bpf_func != sk_run_filter) 936 if (fp->jited)
936 module_free(NULL, fp->bpf_func); 937 module_free(NULL, fp->bpf_func);
937 kfree(fp); 938 kfree(fp);
938} 939}
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c
index d70b73364a3f..6ad65d8ae237 100644
--- a/arch/arm/plat-iop/time.c
+++ b/arch/arm/plat-iop/time.c
@@ -127,7 +127,7 @@ iop_timer_interrupt(int irq, void *dev_id)
127static struct irqaction iop_timer_irq = { 127static struct irqaction iop_timer_irq = {
128 .name = "IOP Timer Tick", 128 .name = "IOP Timer Tick",
129 .handler = iop_timer_interrupt, 129 .handler = iop_timer_interrupt,
130 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 130 .flags = IRQF_TIMER | IRQF_IRQPOLL,
131 .dev_id = &iop_clockevent, 131 .dev_id = &iop_clockevent,
132}; 132};
133 133
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index 436ea97074cd..02fc10d2d63b 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -86,9 +86,6 @@ config OMAP_MUX_WARNINGS
86 to change the pin multiplexing setup. When there are no warnings 86 to change the pin multiplexing setup. When there are no warnings
87 printed, it's safe to deselect OMAP_MUX for your product. 87 printed, it's safe to deselect OMAP_MUX for your product.
88 88
89config OMAP_IOMMU_IVA2
90 bool
91
92config OMAP_MPU_TIMER 89config OMAP_MPU_TIMER
93 bool "Use mpu timer" 90 bool "Use mpu timer"
94 depends on ARCH_OMAP1 91 depends on ARCH_OMAP1
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 01619c2910e3..5f5b975887fc 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -2000,6 +2000,12 @@ void omap_dma_global_context_restore(void)
2000 omap_clear_dma(ch); 2000 omap_clear_dma(ch);
2001} 2001}
2002 2002
2003struct omap_system_dma_plat_info *omap_get_plat_info(void)
2004{
2005 return p;
2006}
2007EXPORT_SYMBOL_GPL(omap_get_plat_info);
2008
2003static int omap_system_dma_probe(struct platform_device *pdev) 2009static int omap_system_dma_probe(struct platform_device *pdev)
2004{ 2010{
2005 int ch, ret = 0; 2011 int ch, ret = 0;
@@ -2024,9 +2030,16 @@ static int omap_system_dma_probe(struct platform_device *pdev)
2024 2030
2025 dma_lch_count = d->lch_count; 2031 dma_lch_count = d->lch_count;
2026 dma_chan_count = dma_lch_count; 2032 dma_chan_count = dma_lch_count;
2027 dma_chan = d->chan;
2028 enable_1510_mode = d->dev_caps & ENABLE_1510_MODE; 2033 enable_1510_mode = d->dev_caps & ENABLE_1510_MODE;
2029 2034
2035 dma_chan = devm_kcalloc(&pdev->dev, dma_lch_count,
2036 sizeof(struct omap_dma_lch), GFP_KERNEL);
2037 if (!dma_chan) {
2038 dev_err(&pdev->dev, "%s: kzalloc fail\n", __func__);
2039 return -ENOMEM;
2040 }
2041
2042
2030 if (dma_omap2plus()) { 2043 if (dma_omap2plus()) {
2031 dma_linked_lch = kzalloc(sizeof(struct dma_link_info) * 2044 dma_linked_lch = kzalloc(sizeof(struct dma_link_info) *
2032 dma_lch_count, GFP_KERNEL); 2045 dma_lch_count, GFP_KERNEL);
@@ -2111,7 +2124,6 @@ exit_dma_irq_fail:
2111 } 2124 }
2112 2125
2113exit_dma_lch_fail: 2126exit_dma_lch_fail:
2114 kfree(dma_chan);
2115 return ret; 2127 return ret;
2116} 2128}
2117 2129
@@ -2131,7 +2143,6 @@ static int omap_system_dma_remove(struct platform_device *pdev)
2131 free_irq(dma_irq, (void *)(irq_rel + 1)); 2143 free_irq(dma_irq, (void *)(irq_rel + 1));
2132 } 2144 }
2133 } 2145 }
2134 kfree(dma_chan);
2135 return 0; 2146 return 0;
2136} 2147}
2137 2148
diff --git a/arch/arm/plat-omap/include/plat/timex.h b/arch/arm/plat-omap/include/plat/timex.h
deleted file mode 100644
index e27d2daa7790..000000000000
--- a/arch/arm/plat-omap/include/plat/timex.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/timex.h
3 *
4 * Copyright (C) 2000 RidgeRun, Inc.
5 * Author: Greg Lonnon <glonnon@ridgerun.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28#if !defined(__ASM_ARCH_OMAP_TIMEX_H)
29#define __ASM_ARCH_OMAP_TIMEX_H
30
31#define CLOCK_TICK_RATE (HZ * 100000UL)
32
33#endif /* __ASM_ARCH_OMAP_TIMEX_H */
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
index 830ff07f3385..3ec6e8e8d368 100644
--- a/arch/arm/plat-orion/common.c
+++ b/arch/arm/plat-orion/common.c
@@ -595,14 +595,16 @@ void __init orion_spi_1_init(unsigned long mapbase)
595/***************************************************************************** 595/*****************************************************************************
596 * Watchdog 596 * Watchdog
597 ****************************************************************************/ 597 ****************************************************************************/
598static struct resource orion_wdt_resource = 598static struct resource orion_wdt_resource[] = {
599 DEFINE_RES_MEM(TIMER_PHYS_BASE, 0x28); 599 DEFINE_RES_MEM(TIMER_PHYS_BASE, 0x04),
600 DEFINE_RES_MEM(RSTOUTn_MASK_PHYS, 0x04),
601};
600 602
601static struct platform_device orion_wdt_device = { 603static struct platform_device orion_wdt_device = {
602 .name = "orion_wdt", 604 .name = "orion_wdt",
603 .id = -1, 605 .id = -1,
604 .num_resources = 1, 606 .num_resources = ARRAY_SIZE(orion_wdt_resource),
605 .resource = &orion_wdt_resource, 607 .resource = orion_wdt_resource,
606}; 608};
607 609
608void __init orion_wdt_init(void) 610void __init orion_wdt_init(void)
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 58645a58d0d8..243dfcb2ca0e 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -9,7 +9,7 @@ config PLAT_SAMSUNG
9 depends on PLAT_S3C24XX || ARCH_S3C64XX || PLAT_S5P || ARCH_EXYNOS 9 depends on PLAT_S3C24XX || ARCH_S3C64XX || PLAT_S5P || ARCH_EXYNOS
10 default y 10 default y
11 select GENERIC_IRQ_CHIP 11 select GENERIC_IRQ_CHIP
12 select NO_IOPORT 12 select NO_IOPORT_MAP
13 help 13 help
14 Base platform code for all Samsung SoC based systems 14 Base platform code for all Samsung SoC based systems
15 15
@@ -19,7 +19,7 @@ config PLAT_S5P
19 default y 19 default y
20 select ARCH_REQUIRE_GPIOLIB 20 select ARCH_REQUIRE_GPIOLIB
21 select ARM_VIC 21 select ARM_VIC
22 select NO_IOPORT 22 select NO_IOPORT_MAP
23 select PLAT_SAMSUNG 23 select PLAT_SAMSUNG
24 select S3C_GPIO_TRACK 24 select S3C_GPIO_TRACK
25 select S5P_GPIO_DRVSTR 25 select S5P_GPIO_DRVSTR
@@ -427,8 +427,7 @@ comment "Power management"
427 427
428config SAMSUNG_PM_DEBUG 428config SAMSUNG_PM_DEBUG
429 bool "S3C2410 PM Suspend debug" 429 bool "S3C2410 PM Suspend debug"
430 depends on PM 430 depends on PM && DEBUG_KERNEL && DEBUG_S3C_UART
431 select DEBUG_LL
432 help 431 help
433 Say Y here if you want verbose debugging from the PM Suspend and 432 Say Y here if you want verbose debugging from the PM Suspend and
434 Resume code. See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt> 433 Resume code. See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt>
@@ -445,7 +444,8 @@ config S3C_PM_DEBUG_LED_SMDK
445 444
446config SAMSUNG_PM_CHECK 445config SAMSUNG_PM_CHECK
447 bool "S3C2410 PM Suspend Memory CRC" 446 bool "S3C2410 PM Suspend Memory CRC"
448 depends on PM && CRC32 447 depends on PM
448 select CRC32
449 help 449 help
450 Enable the PM code's memory area checksum over sleep. This option 450 Enable the PM code's memory area checksum over sleep. This option
451 will generate CRCs of all blocks of memory, and store them before 451 will generate CRCs of all blocks of memory, and store them before
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
index 9267d29549b4..25c826ed3b65 100644
--- a/arch/arm/plat-samsung/Makefile
+++ b/arch/arm/plat-samsung/Makefile
@@ -47,9 +47,11 @@ obj-$(CONFIG_SAMSUNG_DMADEV) += dma-ops.o
47 47
48# PM support 48# PM support
49 49
50obj-$(CONFIG_PM_SLEEP) += pm-common.o
50obj-$(CONFIG_SAMSUNG_PM) += pm.o 51obj-$(CONFIG_SAMSUNG_PM) += pm.o
51obj-$(CONFIG_SAMSUNG_PM_GPIO) += pm-gpio.o 52obj-$(CONFIG_SAMSUNG_PM_GPIO) += pm-gpio.o
52obj-$(CONFIG_SAMSUNG_PM_CHECK) += pm-check.o 53obj-$(CONFIG_SAMSUNG_PM_CHECK) += pm-check.o
54obj-$(CONFIG_SAMSUNG_PM_DEBUG) += pm-debug.o
53 55
54obj-$(CONFIG_SAMSUNG_WAKEMASK) += wakeup-mask.o 56obj-$(CONFIG_SAMSUNG_WAKEMASK) += wakeup-mask.o
55obj-$(CONFIG_SAMSUNG_WDT_RESET) += watchdog-reset.o 57obj-$(CONFIG_SAMSUNG_WDT_RESET) += watchdog-reset.o
diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c
index 47c9fad43f00..d103ac1a52af 100644
--- a/arch/arm/plat-samsung/clock.c
+++ b/arch/arm/plat-samsung/clock.c
@@ -43,7 +43,6 @@
43#include <linux/debugfs.h> 43#include <linux/debugfs.h>
44#endif 44#endif
45 45
46#include <mach/hardware.h>
47#include <asm/irq.h> 46#include <asm/irq.h>
48 47
49#include <plat/cpu-freq.h> 48#include <plat/cpu-freq.h>
@@ -52,7 +51,7 @@
52#include <plat/cpu.h> 51#include <plat/cpu.h>
53 52
54#include <linux/serial_core.h> 53#include <linux/serial_core.h>
55#include <plat/regs-serial.h> /* for s3c24xx_uart_devs */ 54#include <linux/serial_s3c.h> /* for s3c24xx_uart_devs */
56 55
57/* clock information */ 56/* clock information */
58 57
diff --git a/arch/arm/plat-samsung/cpu.c b/arch/arm/plat-samsung/cpu.c
index 46b426e8aff5..364963a0a344 100644
--- a/arch/arm/plat-samsung/cpu.c
+++ b/arch/arm/plat-samsung/cpu.c
@@ -28,13 +28,6 @@ unsigned int samsung_rev(void)
28} 28}
29EXPORT_SYMBOL(samsung_rev); 29EXPORT_SYMBOL(samsung_rev);
30 30
31void __init s3c24xx_init_cpu(void)
32{
33 /* nothing here yet */
34
35 samsung_cpu_rev = 0;
36}
37
38void __init s3c64xx_init_cpu(void) 31void __init s3c64xx_init_cpu(void)
39{ 32{
40 samsung_cpu_id = __raw_readl(S3C_VA_SYS + 0x118); 33 samsung_cpu_id = __raw_readl(S3C_VA_SYS + 0x118);
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index ac07e871f6a7..ead4f1c94058 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -18,6 +18,7 @@
18#include <linux/timer.h> 18#include <linux/timer.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/serial_core.h> 20#include <linux/serial_core.h>
21#include <linux/serial_s3c.h>
21#include <linux/platform_device.h> 22#include <linux/platform_device.h>
22#include <linux/io.h> 23#include <linux/io.h>
23#include <linux/slab.h> 24#include <linux/slab.h>
@@ -30,6 +31,7 @@
30#include <linux/mtd/partitions.h> 31#include <linux/mtd/partitions.h>
31#include <linux/mmc/host.h> 32#include <linux/mmc/host.h>
32#include <linux/ioport.h> 33#include <linux/ioport.h>
34#include <linux/sizes.h>
33#include <linux/platform_data/s3c-hsudc.h> 35#include <linux/platform_data/s3c-hsudc.h>
34#include <linux/platform_data/s3c-hsotg.h> 36#include <linux/platform_data/s3c-hsotg.h>
35#include <linux/platform_data/dma-s3c24xx.h> 37#include <linux/platform_data/dma-s3c24xx.h>
@@ -41,7 +43,6 @@
41#include <asm/mach/map.h> 43#include <asm/mach/map.h>
42#include <asm/mach/irq.h> 44#include <asm/mach/irq.h>
43 45
44#include <mach/hardware.h>
45#include <mach/dma.h> 46#include <mach/dma.h>
46#include <mach/irqs.h> 47#include <mach/irqs.h>
47#include <mach/map.h> 48#include <mach/map.h>
@@ -64,7 +65,6 @@
64#include <linux/platform_data/usb-s3c2410_udc.h> 65#include <linux/platform_data/usb-s3c2410_udc.h>
65#include <linux/platform_data/usb-ohci-s3c2410.h> 66#include <linux/platform_data/usb-ohci-s3c2410.h>
66#include <plat/usb-phy.h> 67#include <plat/usb-phy.h>
67#include <plat/regs-serial.h>
68#include <plat/regs-spi.h> 68#include <plat/regs-spi.h>
69#include <linux/platform_data/spi-s3c64xx.h> 69#include <linux/platform_data/spi-s3c64xx.h>
70 70
@@ -744,10 +744,7 @@ void __init s5p_i2c_hdmiphy_set_platdata(struct s3c2410_platform_i2c *pd)
744 if (!pd) { 744 if (!pd) {
745 pd = &default_i2c_data; 745 pd = &default_i2c_data;
746 746
747 if (soc_is_exynos4210() || 747 if (soc_is_s5pv210())
748 soc_is_exynos4212() || soc_is_exynos4412())
749 pd->bus_num = 8;
750 else if (soc_is_s5pv210())
751 pd->bus_num = 3; 748 pd->bus_num = 3;
752 else 749 else
753 pd->bus_num = 0; 750 pd->bus_num = 0;
@@ -764,10 +761,7 @@ void __init s5p_hdmi_set_platdata(struct i2c_board_info *hdmiphy_info,
764{ 761{
765 struct s5p_hdmi_platform_data *pd = &s5p_hdmi_def_platdata; 762 struct s5p_hdmi_platform_data *pd = &s5p_hdmi_def_platdata;
766 763
767 if (soc_is_exynos4210() || 764 if (soc_is_s5pv210())
768 soc_is_exynos4212() || soc_is_exynos4412())
769 pd->hdmiphy_bus = 8;
770 else if (soc_is_s5pv210())
771 pd->hdmiphy_bus = 3; 765 pd->hdmiphy_bus = 3;
772 else 766 else
773 pd->hdmiphy_bus = 0; 767 pd->hdmiphy_bus = 0;
diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h
index 335beb341355..5992b8dd9b89 100644
--- a/arch/arm/plat-samsung/include/plat/cpu.h
+++ b/arch/arm/plat-samsung/include/plat/cpu.h
@@ -20,6 +20,9 @@
20 20
21extern unsigned long samsung_cpu_id; 21extern unsigned long samsung_cpu_id;
22 22
23#define S3C2410_CPU_ID 0x32410000
24#define S3C2410_CPU_MASK 0xFFFFFFFF
25
23#define S3C24XX_CPU_ID 0x32400000 26#define S3C24XX_CPU_ID 0x32400000
24#define S3C24XX_CPU_MASK 0xFFF00000 27#define S3C24XX_CPU_MASK 0xFFF00000
25 28
@@ -56,6 +59,7 @@ static inline int is_samsung_##name(void) \
56 return ((samsung_cpu_id & mask) == (id & mask)); \ 59 return ((samsung_cpu_id & mask) == (id & mask)); \
57} 60}
58 61
62IS_SAMSUNG_CPU(s3c2410, S3C2410_CPU_ID, S3C2410_CPU_MASK)
59IS_SAMSUNG_CPU(s3c24xx, S3C24XX_CPU_ID, S3C24XX_CPU_MASK) 63IS_SAMSUNG_CPU(s3c24xx, S3C24XX_CPU_ID, S3C24XX_CPU_MASK)
60IS_SAMSUNG_CPU(s3c2412, S3C2412_CPU_ID, S3C2412_CPU_MASK) 64IS_SAMSUNG_CPU(s3c2412, S3C2412_CPU_ID, S3C2412_CPU_MASK)
61IS_SAMSUNG_CPU(s3c6400, S3C6400_CPU_ID, S3C64XX_CPU_MASK) 65IS_SAMSUNG_CPU(s3c6400, S3C6400_CPU_ID, S3C64XX_CPU_MASK)
@@ -76,8 +80,10 @@ IS_SAMSUNG_CPU(exynos5440, EXYNOS5440_SOC_ID, EXYNOS5_SOC_MASK)
76 defined(CONFIG_CPU_S3C2442) || defined(CONFIG_CPU_S3C244X) || \ 80 defined(CONFIG_CPU_S3C2442) || defined(CONFIG_CPU_S3C244X) || \
77 defined(CONFIG_CPU_S3C2443) 81 defined(CONFIG_CPU_S3C2443)
78# define soc_is_s3c24xx() is_samsung_s3c24xx() 82# define soc_is_s3c24xx() is_samsung_s3c24xx()
83# define soc_is_s3c2410() is_samsung_s3c2410()
79#else 84#else
80# define soc_is_s3c24xx() 0 85# define soc_is_s3c24xx() 0
86# define soc_is_s3c2410() 0
81#endif 87#endif
82 88
83#if defined(CONFIG_CPU_S3C2412) 89#if defined(CONFIG_CPU_S3C2412)
@@ -160,6 +166,10 @@ IS_SAMSUNG_CPU(exynos5440, EXYNOS5440_SOC_ID, EXYNOS5_SOC_MASK)
160# define soc_is_exynos5440() 0 166# define soc_is_exynos5440() 0
161#endif 167#endif
162 168
169#define soc_is_exynos4() (soc_is_exynos4210() || soc_is_exynos4212() || \
170 soc_is_exynos4412())
171#define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5420())
172
163#define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE } 173#define IODESC_ENT(x) { (unsigned long)S3C24XX_VA_##x, __phys_to_pfn(S3C24XX_PA_##x), S3C24XX_SZ_##x, MT_DEVICE }
164 174
165#ifndef KHZ 175#ifndef KHZ
@@ -199,7 +209,6 @@ extern void s5p_init_irq(u32 *vic, u32 num_vic);
199 209
200extern void s3c24xx_init_io(struct map_desc *mach_desc, int size); 210extern void s3c24xx_init_io(struct map_desc *mach_desc, int size);
201 211
202extern void s3c24xx_init_cpu(void);
203extern void s3c64xx_init_cpu(void); 212extern void s3c64xx_init_cpu(void);
204extern void s5p_init_cpu(void __iomem *cpuid_addr); 213extern void s5p_init_cpu(void __iomem *cpuid_addr);
205 214
diff --git a/arch/arm/plat-samsung/include/plat/mfc.h b/arch/arm/plat-samsung/include/plat/mfc.h
index e6d7c42d68b6..033654e91e22 100644
--- a/arch/arm/plat-samsung/include/plat/mfc.h
+++ b/arch/arm/plat-samsung/include/plat/mfc.h
@@ -32,7 +32,4 @@ struct s5p_mfc_dt_meminfo {
32void __init s5p_mfc_reserve_mem(phys_addr_t rbase, unsigned int rsize, 32void __init s5p_mfc_reserve_mem(phys_addr_t rbase, unsigned int rsize,
33 phys_addr_t lbase, unsigned int lsize); 33 phys_addr_t lbase, unsigned int lsize);
34 34
35int __init s5p_fdt_find_mfc_mem(unsigned long node, const char *uname,
36 int depth, void *data);
37
38#endif /* __PLAT_SAMSUNG_MFC_H */ 35#endif /* __PLAT_SAMSUNG_MFC_H */
diff --git a/arch/arm/plat-samsung/include/plat/pm-common.h b/arch/arm/plat-samsung/include/plat/pm-common.h
new file mode 100644
index 000000000000..8705f9e0e288
--- /dev/null
+++ b/arch/arm/plat-samsung/include/plat/pm-common.h
@@ -0,0 +1,110 @@
1/*
2 * Copyright (C) 2013 Samsung Electronics Co., Ltd.
3 * Tomasz Figa <t.figa@samsung.com>
4 * Copyright (c) 2004 Simtec Electronics
5 * http://armlinux.simtec.co.uk/
6 * Written by Ben Dooks, <ben@simtec.co.uk>
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 __PLAT_SAMSUNG_PM_COMMON_H
14#define __PLAT_SAMSUNG_PM_COMMON_H __FILE__
15
16#include <linux/irq.h>
17
18/* sleep save info */
19
20/**
21 * struct sleep_save - save information for shared peripherals.
22 * @reg: Pointer to the register to save.
23 * @val: Holder for the value saved from reg.
24 *
25 * This describes a list of registers which is used by the pm core and
26 * other subsystem to save and restore register values over suspend.
27 */
28struct sleep_save {
29 void __iomem *reg;
30 unsigned long val;
31};
32
33#define SAVE_ITEM(x) \
34 { .reg = (x) }
35
36/* helper functions to save/restore lists of registers. */
37
38extern void s3c_pm_do_save(struct sleep_save *ptr, int count);
39extern void s3c_pm_do_restore(const struct sleep_save *ptr, int count);
40extern void s3c_pm_do_restore_core(const struct sleep_save *ptr, int count);
41
42/* PM debug functions */
43
44/**
45 * struct pm_uart_save - save block for core UART
46 * @ulcon: Save value for S3C2410_ULCON
47 * @ucon: Save value for S3C2410_UCON
48 * @ufcon: Save value for S3C2410_UFCON
49 * @umcon: Save value for S3C2410_UMCON
50 * @ubrdiv: Save value for S3C2410_UBRDIV
51 *
52 * Save block for UART registers to be held over sleep and restored if they
53 * are needed (say by debug).
54*/
55struct pm_uart_save {
56 u32 ulcon;
57 u32 ucon;
58 u32 ufcon;
59 u32 umcon;
60 u32 ubrdiv;
61 u32 udivslot;
62};
63
64#ifdef CONFIG_SAMSUNG_PM_DEBUG
65/**
66 * s3c_pm_dbg() - low level debug function for use in suspend/resume.
67 * @msg: The message to print.
68 *
69 * This function is used mainly to debug the resume process before the system
70 * can rely on printk/console output. It uses the low-level debugging output
71 * routine printascii() to do its work.
72 */
73extern void s3c_pm_dbg(const char *msg, ...);
74
75/**
76 * s3c_pm_debug_init() - suspend/resume low level debug initialization.
77 * @base: Virtual base of UART to use for suspend/resume debugging.
78 *
79 * This function needs to be called before S3C_PMDBG() can be used, to set up
80 * UART port base address and configuration.
81 */
82extern void s3c_pm_debug_init(void);
83
84#define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt)
85
86extern void s3c_pm_save_uarts(void);
87extern void s3c_pm_restore_uarts(void);
88#else
89#define S3C_PMDBG(fmt...) pr_debug(fmt)
90#define s3c_pm_debug_init() do { } while (0)
91
92static inline void s3c_pm_save_uarts(void) { }
93static inline void s3c_pm_restore_uarts(void) { }
94#endif
95
96/* suspend memory checking */
97
98#ifdef CONFIG_SAMSUNG_PM_CHECK
99extern void s3c_pm_check_prepare(void);
100extern void s3c_pm_check_restore(void);
101extern void s3c_pm_check_cleanup(void);
102extern void s3c_pm_check_store(void);
103#else
104#define s3c_pm_check_prepare() do { } while (0)
105#define s3c_pm_check_restore() do { } while (0)
106#define s3c_pm_check_cleanup() do { } while (0)
107#define s3c_pm_check_store() do { } while (0)
108#endif
109
110#endif
diff --git a/arch/arm/plat-samsung/include/plat/pm.h b/arch/arm/plat-samsung/include/plat/pm.h
index ff6063f0d5ea..e17d871b934c 100644
--- a/arch/arm/plat-samsung/include/plat/pm.h
+++ b/arch/arm/plat-samsung/include/plat/pm.h
@@ -15,7 +15,7 @@
15 * management 15 * management
16*/ 16*/
17 17
18#include <linux/irq.h> 18#include <plat/pm-common.h>
19 19
20struct device; 20struct device;
21 21
@@ -54,56 +54,10 @@ extern int (*pm_cpu_sleep)(unsigned long);
54 54
55extern unsigned long s3c_pm_flags; 55extern unsigned long s3c_pm_flags;
56 56
57extern unsigned char pm_uart_udivslot; /* true to save UART UDIVSLOT */
58
59/* from sleep.S */ 57/* from sleep.S */
60 58
61extern int s3c2410_cpu_suspend(unsigned long); 59extern int s3c2410_cpu_suspend(unsigned long);
62 60
63/* sleep save info */
64
65/**
66 * struct sleep_save - save information for shared peripherals.
67 * @reg: Pointer to the register to save.
68 * @val: Holder for the value saved from reg.
69 *
70 * This describes a list of registers which is used by the pm core and
71 * other subsystem to save and restore register values over suspend.
72 */
73struct sleep_save {
74 void __iomem *reg;
75 unsigned long val;
76};
77
78#define SAVE_ITEM(x) \
79 { .reg = (x) }
80
81/**
82 * struct pm_uart_save - save block for core UART
83 * @ulcon: Save value for S3C2410_ULCON
84 * @ucon: Save value for S3C2410_UCON
85 * @ufcon: Save value for S3C2410_UFCON
86 * @umcon: Save value for S3C2410_UMCON
87 * @ubrdiv: Save value for S3C2410_UBRDIV
88 *
89 * Save block for UART registers to be held over sleep and restored if they
90 * are needed (say by debug).
91*/
92struct pm_uart_save {
93 u32 ulcon;
94 u32 ucon;
95 u32 ufcon;
96 u32 umcon;
97 u32 ubrdiv;
98 u32 udivslot;
99};
100
101/* helper functions to save/restore lists of registers. */
102
103extern void s3c_pm_do_save(struct sleep_save *ptr, int count);
104extern void s3c_pm_do_restore(const struct sleep_save *ptr, int count);
105extern void s3c_pm_do_restore_core(const struct sleep_save *ptr, int count);
106
107#ifdef CONFIG_SAMSUNG_PM 61#ifdef CONFIG_SAMSUNG_PM
108extern int s3c_irq_wake(struct irq_data *data, unsigned int state); 62extern int s3c_irq_wake(struct irq_data *data, unsigned int state);
109extern int s3c_irqext_wake(struct irq_data *data, unsigned int state); 63extern int s3c_irqext_wake(struct irq_data *data, unsigned int state);
@@ -114,24 +68,6 @@ extern void s3c_cpu_resume(void);
114#define s3c_cpu_resume NULL 68#define s3c_cpu_resume NULL
115#endif 69#endif
116 70
117/* PM debug functions */
118
119#ifdef CONFIG_SAMSUNG_PM_DEBUG
120/**
121 * s3c_pm_dbg() - low level debug function for use in suspend/resume.
122 * @msg: The message to print.
123 *
124 * This function is used mainly to debug the resume process before the system
125 * can rely on printk/console output. It uses the low-level debugging output
126 * routine printascii() to do its work.
127 */
128extern void s3c_pm_dbg(const char *msg, ...);
129
130#define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt)
131#else
132#define S3C_PMDBG(fmt...) printk(KERN_DEBUG fmt)
133#endif
134
135#ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK 71#ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK
136/** 72/**
137 * s3c_pm_debug_smdkled() - Debug PM suspend/resume via SMDK Board LEDs 73 * s3c_pm_debug_smdkled() - Debug PM suspend/resume via SMDK Board LEDs
@@ -144,20 +80,6 @@ extern void s3c_pm_debug_smdkled(u32 set, u32 clear);
144static inline void s3c_pm_debug_smdkled(u32 set, u32 clear) { } 80static inline void s3c_pm_debug_smdkled(u32 set, u32 clear) { }
145#endif /* CONFIG_S3C_PM_DEBUG_LED_SMDK */ 81#endif /* CONFIG_S3C_PM_DEBUG_LED_SMDK */
146 82
147/* suspend memory checking */
148
149#ifdef CONFIG_SAMSUNG_PM_CHECK
150extern void s3c_pm_check_prepare(void);
151extern void s3c_pm_check_restore(void);
152extern void s3c_pm_check_cleanup(void);
153extern void s3c_pm_check_store(void);
154#else
155#define s3c_pm_check_prepare() do { } while(0)
156#define s3c_pm_check_restore() do { } while(0)
157#define s3c_pm_check_cleanup() do { } while(0)
158#define s3c_pm_check_store() do { } while(0)
159#endif
160
161/** 83/**
162 * s3c_pm_configure_extint() - ensure pins are correctly set for IRQ 84 * s3c_pm_configure_extint() - ensure pins are correctly set for IRQ
163 * 85 *
diff --git a/arch/arm/plat-samsung/include/plat/regs-serial.h b/arch/arm/plat-samsung/include/plat/regs-serial.h
deleted file mode 100644
index f05f2afa440d..000000000000
--- a/arch/arm/plat-samsung/include/plat/regs-serial.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <linux/serial_s3c.h>
diff --git a/arch/arm/plat-samsung/include/plat/uncompress.h b/arch/arm/plat-samsung/include/plat/uncompress.h
deleted file mode 100644
index f48dc0a4736c..000000000000
--- a/arch/arm/plat-samsung/include/plat/uncompress.h
+++ /dev/null
@@ -1,175 +0,0 @@
1/* arch/arm/plat-samsung/include/plat/uncompress.h
2 *
3 * Copyright 2003, 2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C - uncompress code
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#ifndef __ASM_PLAT_UNCOMPRESS_H
15#define __ASM_PLAT_UNCOMPRESS_H
16
17typedef unsigned int upf_t; /* cannot include linux/serial_core.h */
18
19/* uart setup */
20
21unsigned int fifo_mask;
22unsigned int fifo_max;
23
24volatile u8 *uart_base;
25
26/* forward declerations */
27
28static void arch_detect_cpu(void);
29
30/* defines for UART registers */
31
32#include <plat/regs-serial.h>
33
34/* working in physical space... */
35#define S3C_WDOGREG(x) ((S3C_PA_WDT + (x)))
36
37#define S3C2410_WTCON S3C_WDOGREG(0x00)
38#define S3C2410_WTDAT S3C_WDOGREG(0x04)
39#define S3C2410_WTCNT S3C_WDOGREG(0x08)
40
41#define S3C2410_WTCON_RSTEN (1 << 0)
42#define S3C2410_WTCON_ENABLE (1 << 5)
43
44#define S3C2410_WTCON_DIV128 (3 << 3)
45
46#define S3C2410_WTCON_PRESCALE(x) ((x) << 8)
47
48/* how many bytes we allow into the FIFO at a time in FIFO mode */
49#define FIFO_MAX (14)
50
51static __inline__ void
52uart_wr(unsigned int reg, unsigned int val)
53{
54 volatile unsigned int *ptr;
55
56 ptr = (volatile unsigned int *)(reg + uart_base);
57 *ptr = val;
58}
59
60static __inline__ unsigned int
61uart_rd(unsigned int reg)
62{
63 volatile unsigned int *ptr;
64
65 ptr = (volatile unsigned int *)(reg + uart_base);
66 return *ptr;
67}
68
69/* we can deal with the case the UARTs are being run
70 * in FIFO mode, so that we don't hold up our execution
71 * waiting for tx to happen...
72*/
73
74static void putc(int ch)
75{
76 if (!config_enabled(CONFIG_DEBUG_LL))
77 return;
78
79 if (uart_rd(S3C2410_UFCON) & S3C2410_UFCON_FIFOMODE) {
80 int level;
81
82 while (1) {
83 level = uart_rd(S3C2410_UFSTAT);
84 level &= fifo_mask;
85
86 if (level < fifo_max)
87 break;
88 }
89
90 } else {
91 /* not using fifos */
92
93 while ((uart_rd(S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE) != S3C2410_UTRSTAT_TXE)
94 barrier();
95 }
96
97 /* write byte to transmission register */
98 uart_wr(S3C2410_UTXH, ch);
99}
100
101static inline void flush(void)
102{
103}
104
105#define __raw_writel(d, ad) \
106 do { \
107 *((volatile unsigned int __force *)(ad)) = (d); \
108 } while (0)
109
110#ifdef CONFIG_S3C_BOOT_ERROR_RESET
111
112static void arch_decomp_error(const char *x)
113{
114 putstr("\n\n");
115 putstr(x);
116 putstr("\n\n -- System resetting\n");
117
118 __raw_writel(0x4000, S3C2410_WTDAT);
119 __raw_writel(0x4000, S3C2410_WTCNT);
120 __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x40), S3C2410_WTCON);
121
122 while(1);
123}
124
125#define arch_error arch_decomp_error
126#endif
127
128#ifdef CONFIG_S3C_BOOT_UART_FORCE_FIFO
129static inline void arch_enable_uart_fifo(void)
130{
131 u32 fifocon;
132
133 if (!config_enabled(CONFIG_DEBUG_LL))
134 return;
135
136 fifocon = uart_rd(S3C2410_UFCON);
137
138 if (!(fifocon & S3C2410_UFCON_FIFOMODE)) {
139 fifocon |= S3C2410_UFCON_RESETBOTH;
140 uart_wr(S3C2410_UFCON, fifocon);
141
142 /* wait for fifo reset to complete */
143 while (1) {
144 fifocon = uart_rd(S3C2410_UFCON);
145 if (!(fifocon & S3C2410_UFCON_RESETBOTH))
146 break;
147 }
148
149 uart_wr(S3C2410_UFCON, S3C2410_UFCON_FIFOMODE);
150 }
151}
152#else
153#define arch_enable_uart_fifo() do { } while(0)
154#endif
155
156
157static void
158arch_decomp_setup(void)
159{
160 /* we may need to setup the uart(s) here if we are not running
161 * on an BAST... the BAST will have left the uarts configured
162 * after calling linux.
163 */
164
165 arch_detect_cpu();
166
167 /* Enable the UART FIFOs if they where not enabled and our
168 * configuration says we should turn them on.
169 */
170
171 arch_enable_uart_fifo();
172}
173
174
175#endif /* __ASM_PLAT_UNCOMPRESS_H */
diff --git a/arch/arm/plat-samsung/init.c b/arch/arm/plat-samsung/init.c
index aa9511b6914a..a1f925f3121f 100644
--- a/arch/arm/plat-samsung/init.c
+++ b/arch/arm/plat-samsung/init.c
@@ -21,11 +21,10 @@
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/ioport.h> 22#include <linux/ioport.h>
23#include <linux/serial_core.h> 23#include <linux/serial_core.h>
24#include <linux/serial_s3c.h>
24#include <linux/platform_device.h> 25#include <linux/platform_device.h>
25#include <linux/of.h> 26#include <linux/of.h>
26 27
27#include <mach/hardware.h>
28
29#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
30#include <asm/mach/map.h> 29#include <asm/mach/map.h>
31 30
@@ -33,8 +32,6 @@
33#include <plat/devs.h> 32#include <plat/devs.h>
34#include <plat/clock.h> 33#include <plat/clock.h>
35 34
36#include <plat/regs-serial.h>
37
38static struct cpu_table *cpu; 35static struct cpu_table *cpu;
39 36
40static struct cpu_table * __init s3c_lookup_cpu(unsigned long idcode, 37static struct cpu_table * __init s3c_lookup_cpu(unsigned long idcode,
@@ -97,7 +94,9 @@ void __init s3c24xx_init_clocks(int xtal)
97#if IS_ENABLED(CONFIG_SAMSUNG_ATAGS) 94#if IS_ENABLED(CONFIG_SAMSUNG_ATAGS)
98static int nr_uarts __initdata = 0; 95static int nr_uarts __initdata = 0;
99 96
97#ifdef CONFIG_SERIAL_SAMSUNG_UARTS
100static struct s3c2410_uartcfg uart_cfgs[CONFIG_SERIAL_SAMSUNG_UARTS]; 98static struct s3c2410_uartcfg uart_cfgs[CONFIG_SERIAL_SAMSUNG_UARTS];
99#endif
101 100
102/* s3c24xx_init_uartdevs 101/* s3c24xx_init_uartdevs
103 * 102 *
@@ -112,6 +111,7 @@ void __init s3c24xx_init_uartdevs(char *name,
112 struct s3c24xx_uart_resources *res, 111 struct s3c24xx_uart_resources *res,
113 struct s3c2410_uartcfg *cfg, int no) 112 struct s3c2410_uartcfg *cfg, int no)
114{ 113{
114#ifdef CONFIG_SERIAL_SAMSUNG_UARTS
115 struct platform_device *platdev; 115 struct platform_device *platdev;
116 struct s3c2410_uartcfg *cfgptr = uart_cfgs; 116 struct s3c2410_uartcfg *cfgptr = uart_cfgs;
117 struct s3c24xx_uart_resources *resp; 117 struct s3c24xx_uart_resources *resp;
@@ -134,6 +134,7 @@ void __init s3c24xx_init_uartdevs(char *name,
134 } 134 }
135 135
136 nr_uarts = no; 136 nr_uarts = no;
137#endif
137} 138}
138 139
139void __init s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no) 140void __init s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no)
diff --git a/arch/arm/plat-samsung/pm-check.c b/arch/arm/plat-samsung/pm-check.c
index 3cbd62666b1e..04aff2c31b46 100644
--- a/arch/arm/plat-samsung/pm-check.c
+++ b/arch/arm/plat-samsung/pm-check.c
@@ -19,7 +19,7 @@
19#include <linux/ioport.h> 19#include <linux/ioport.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21 21
22#include <plat/pm.h> 22#include <plat/pm-common.h>
23 23
24#if CONFIG_SAMSUNG_PM_CHECK_CHUNKSIZE < 1 24#if CONFIG_SAMSUNG_PM_CHECK_CHUNKSIZE < 1
25#error CONFIG_SAMSUNG_PM_CHECK_CHUNKSIZE must be a positive non-zero value 25#error CONFIG_SAMSUNG_PM_CHECK_CHUNKSIZE must be a positive non-zero value
diff --git a/arch/arm/plat-samsung/pm-common.c b/arch/arm/plat-samsung/pm-common.c
new file mode 100644
index 000000000000..515cd53372bd
--- /dev/null
+++ b/arch/arm/plat-samsung/pm-common.c
@@ -0,0 +1,75 @@
1/*
2 * Copyright (C) 2013 Samsung Electronics Co., Ltd.
3 * Tomasz Figa <t.figa@samsung.com>
4 * Copyright (C) 2008 Openmoko, Inc.
5 * Copyright (C) 2004-2008 Simtec Electronics
6 * Ben Dooks <ben@simtec.co.uk>
7 * http://armlinux.simtec.co.uk/
8 *
9 * Samsung common power management helper functions.
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/io.h>
17#include <linux/kernel.h>
18
19#include <plat/pm-common.h>
20
21/* helper functions to save and restore register state */
22
23/**
24 * s3c_pm_do_save() - save a set of registers for restoration on resume.
25 * @ptr: Pointer to an array of registers.
26 * @count: Size of the ptr array.
27 *
28 * Run through the list of registers given, saving their contents in the
29 * array for later restoration when we wakeup.
30 */
31void s3c_pm_do_save(struct sleep_save *ptr, int count)
32{
33 for (; count > 0; count--, ptr++) {
34 ptr->val = __raw_readl(ptr->reg);
35 S3C_PMDBG("saved %p value %08lx\n", ptr->reg, ptr->val);
36 }
37}
38
39/**
40 * s3c_pm_do_restore() - restore register values from the save list.
41 * @ptr: Pointer to an array of registers.
42 * @count: Size of the ptr array.
43 *
44 * Restore the register values saved from s3c_pm_do_save().
45 *
46 * Note, we do not use S3C_PMDBG() in here, as the system may not have
47 * restore the UARTs state yet
48*/
49
50void s3c_pm_do_restore(const struct sleep_save *ptr, int count)
51{
52 for (; count > 0; count--, ptr++) {
53 pr_debug("restore %p (restore %08lx, was %08x)\n",
54 ptr->reg, ptr->val, __raw_readl(ptr->reg));
55
56 __raw_writel(ptr->val, ptr->reg);
57 }
58}
59
60/**
61 * s3c_pm_do_restore_core() - early restore register values from save list.
62 *
63 * This is similar to s3c_pm_do_restore() except we try and minimise the
64 * side effects of the function in case registers that hardware might need
65 * to work has been restored.
66 *
67 * WARNING: Do not put any debug in here that may effect memory or use
68 * peripherals, as things may be changing!
69*/
70
71void s3c_pm_do_restore_core(const struct sleep_save *ptr, int count)
72{
73 for (; count > 0; count--, ptr++)
74 __raw_writel(ptr->val, ptr->reg);
75}
diff --git a/arch/arm/plat-samsung/pm-debug.c b/arch/arm/plat-samsung/pm-debug.c
new file mode 100644
index 000000000000..8f19f66388dd
--- /dev/null
+++ b/arch/arm/plat-samsung/pm-debug.c
@@ -0,0 +1,97 @@
1/*
2 * Copyright (C) 2013 Samsung Electronics Co., Ltd.
3 * Tomasz Figa <t.figa@samsung.com>
4 * Copyright (C) 2008 Openmoko, Inc.
5 * Copyright (C) 2004-2008 Simtec Electronics
6 * Ben Dooks <ben@simtec.co.uk>
7 * http://armlinux.simtec.co.uk/
8 *
9 * Samsung common power management (suspend to RAM) debug support
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/serial_core.h>
17#include <linux/io.h>
18
19#include <asm/mach/map.h>
20
21#include <plat/cpu.h>
22#include <plat/pm-common.h>
23
24#ifdef CONFIG_SAMSUNG_ATAGS
25#include <mach/pm-core.h>
26#else
27static inline void s3c_pm_debug_init_uart(void) {}
28static inline void s3c_pm_arch_update_uart(void __iomem *regs,
29 struct pm_uart_save *save) {}
30#endif
31
32static struct pm_uart_save uart_save;
33
34extern void printascii(const char *);
35
36void s3c_pm_dbg(const char *fmt, ...)
37{
38 va_list va;
39 char buff[256];
40
41 va_start(va, fmt);
42 vsnprintf(buff, sizeof(buff), fmt, va);
43 va_end(va);
44
45 printascii(buff);
46}
47
48void s3c_pm_debug_init(void)
49{
50 /* restart uart clocks so we can use them to output */
51 s3c_pm_debug_init_uart();
52}
53
54static inline void __iomem *s3c_pm_uart_base(void)
55{
56 unsigned long paddr;
57 unsigned long vaddr;
58
59 debug_ll_addr(&paddr, &vaddr);
60
61 return (void __iomem *)vaddr;
62}
63
64void s3c_pm_save_uarts(void)
65{
66 void __iomem *regs = s3c_pm_uart_base();
67 struct pm_uart_save *save = &uart_save;
68
69 save->ulcon = __raw_readl(regs + S3C2410_ULCON);
70 save->ucon = __raw_readl(regs + S3C2410_UCON);
71 save->ufcon = __raw_readl(regs + S3C2410_UFCON);
72 save->umcon = __raw_readl(regs + S3C2410_UMCON);
73 save->ubrdiv = __raw_readl(regs + S3C2410_UBRDIV);
74
75 if (!soc_is_s3c2410())
76 save->udivslot = __raw_readl(regs + S3C2443_DIVSLOT);
77
78 S3C_PMDBG("UART[%p]: ULCON=%04x, UCON=%04x, UFCON=%04x, UBRDIV=%04x\n",
79 regs, save->ulcon, save->ucon, save->ufcon, save->ubrdiv);
80}
81
82void s3c_pm_restore_uarts(void)
83{
84 void __iomem *regs = s3c_pm_uart_base();
85 struct pm_uart_save *save = &uart_save;
86
87 s3c_pm_arch_update_uart(regs, save);
88
89 __raw_writel(save->ulcon, regs + S3C2410_ULCON);
90 __raw_writel(save->ucon, regs + S3C2410_UCON);
91 __raw_writel(save->ufcon, regs + S3C2410_UFCON);
92 __raw_writel(save->umcon, regs + S3C2410_UMCON);
93 __raw_writel(save->ubrdiv, regs + S3C2410_UBRDIV);
94
95 if (!soc_is_s3c2410())
96 __raw_writel(save->udivslot, regs + S3C2443_DIVSLOT);
97}
diff --git a/arch/arm/plat-samsung/pm-gpio.c b/arch/arm/plat-samsung/pm-gpio.c
index dd4c15d0d68f..da268813901b 100644
--- a/arch/arm/plat-samsung/pm-gpio.c
+++ b/arch/arm/plat-samsung/pm-gpio.c
@@ -196,8 +196,7 @@ struct samsung_gpio_pm samsung_gpio_pm_2bit = {
196 .resume = samsung_gpio_pm_2bit_resume, 196 .resume = samsung_gpio_pm_2bit_resume,
197}; 197};
198 198
199#if defined(CONFIG_ARCH_S3C64XX) || defined(CONFIG_PLAT_S5P) \ 199#if defined(CONFIG_ARCH_S3C64XX) || defined(CONFIG_PLAT_S5P)
200 || defined(CONFIG_ARCH_EXYNOS)
201static void samsung_gpio_pm_4bit_save(struct samsung_gpio_chip *chip) 200static void samsung_gpio_pm_4bit_save(struct samsung_gpio_chip *chip)
202{ 201{
203 chip->pm_save[1] = __raw_readl(chip->base + OFFS_CON); 202 chip->pm_save[1] = __raw_readl(chip->base + OFFS_CON);
@@ -307,7 +306,7 @@ struct samsung_gpio_pm samsung_gpio_pm_4bit = {
307 .save = samsung_gpio_pm_4bit_save, 306 .save = samsung_gpio_pm_4bit_save,
308 .resume = samsung_gpio_pm_4bit_resume, 307 .resume = samsung_gpio_pm_4bit_resume,
309}; 308};
310#endif /* CONFIG_ARCH_S3C64XX || CONFIG_PLAT_S5P || CONFIG_ARCH_EXYNOS */ 309#endif /* CONFIG_ARCH_S3C64XX || CONFIG_PLAT_S5P */
311 310
312/** 311/**
313 * samsung_pm_save_gpio() - save gpio chip data for suspend 312 * samsung_pm_save_gpio() - save gpio chip data for suspend
diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c
index e5b0f2c2d884..f8c0f9797dcf 100644
--- a/arch/arm/plat-samsung/pm.c
+++ b/arch/arm/plat-samsung/pm.c
@@ -17,16 +17,13 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/delay.h> 18#include <linux/delay.h>
19#include <linux/of.h> 19#include <linux/of.h>
20#include <linux/serial_core.h> 20#include <linux/serial_s3c.h>
21#include <linux/io.h> 21#include <linux/io.h>
22 22
23#include <asm/cacheflush.h> 23#include <asm/cacheflush.h>
24#include <asm/suspend.h> 24#include <asm/suspend.h>
25 25
26#include <plat/regs-serial.h>
27
28#ifdef CONFIG_SAMSUNG_ATAGS 26#ifdef CONFIG_SAMSUNG_ATAGS
29#include <mach/hardware.h>
30#include <mach/map.h> 27#include <mach/map.h>
31#ifndef CONFIG_ARCH_EXYNOS 28#ifndef CONFIG_ARCH_EXYNOS
32#include <mach/regs-clock.h> 29#include <mach/regs-clock.h>
@@ -44,93 +41,6 @@
44 41
45unsigned long s3c_pm_flags; 42unsigned long s3c_pm_flags;
46 43
47/* Debug code:
48 *
49 * This code supports debug output to the low level UARTs for use on
50 * resume before the console layer is available.
51*/
52
53#ifdef CONFIG_SAMSUNG_PM_DEBUG
54extern void printascii(const char *);
55
56void s3c_pm_dbg(const char *fmt, ...)
57{
58 va_list va;
59 char buff[256];
60
61 va_start(va, fmt);
62 vsnprintf(buff, sizeof(buff), fmt, va);
63 va_end(va);
64
65 printascii(buff);
66}
67
68static inline void s3c_pm_debug_init(void)
69{
70 /* restart uart clocks so we can use them to output */
71 s3c_pm_debug_init_uart();
72}
73
74#else
75#define s3c_pm_debug_init() do { } while(0)
76
77#endif /* CONFIG_SAMSUNG_PM_DEBUG */
78
79/* Save the UART configurations if we are configured for debug. */
80
81unsigned char pm_uart_udivslot;
82
83#ifdef CONFIG_SAMSUNG_PM_DEBUG
84
85static struct pm_uart_save uart_save;
86
87static void s3c_pm_save_uart(unsigned int uart, struct pm_uart_save *save)
88{
89 void __iomem *regs = S3C_VA_UARTx(uart);
90
91 save->ulcon = __raw_readl(regs + S3C2410_ULCON);
92 save->ucon = __raw_readl(regs + S3C2410_UCON);
93 save->ufcon = __raw_readl(regs + S3C2410_UFCON);
94 save->umcon = __raw_readl(regs + S3C2410_UMCON);
95 save->ubrdiv = __raw_readl(regs + S3C2410_UBRDIV);
96
97 if (pm_uart_udivslot)
98 save->udivslot = __raw_readl(regs + S3C2443_DIVSLOT);
99
100 S3C_PMDBG("UART[%d]: ULCON=%04x, UCON=%04x, UFCON=%04x, UBRDIV=%04x\n",
101 uart, save->ulcon, save->ucon, save->ufcon, save->ubrdiv);
102}
103
104static void s3c_pm_save_uarts(void)
105{
106 s3c_pm_save_uart(CONFIG_DEBUG_S3C_UART, &uart_save);
107}
108
109static void s3c_pm_restore_uart(unsigned int uart, struct pm_uart_save *save)
110{
111 void __iomem *regs = S3C_VA_UARTx(uart);
112
113 s3c_pm_arch_update_uart(regs, save);
114
115 __raw_writel(save->ulcon, regs + S3C2410_ULCON);
116 __raw_writel(save->ucon, regs + S3C2410_UCON);
117 __raw_writel(save->ufcon, regs + S3C2410_UFCON);
118 __raw_writel(save->umcon, regs + S3C2410_UMCON);
119 __raw_writel(save->ubrdiv, regs + S3C2410_UBRDIV);
120
121 if (pm_uart_udivslot)
122 __raw_writel(save->udivslot, regs + S3C2443_DIVSLOT);
123}
124
125static void s3c_pm_restore_uarts(void)
126{
127 s3c_pm_restore_uart(CONFIG_DEBUG_S3C_UART, &uart_save);
128}
129#else
130static void s3c_pm_save_uarts(void) { }
131static void s3c_pm_restore_uarts(void) { }
132#endif
133
134/* The IRQ ext-int code goes here, it is too small to currently bother 44/* The IRQ ext-int code goes here, it is too small to currently bother
135 * with its own file. */ 45 * with its own file. */
136 46
@@ -155,62 +65,6 @@ int s3c_irqext_wake(struct irq_data *data, unsigned int state)
155 return 0; 65 return 0;
156} 66}
157 67
158/* helper functions to save and restore register state */
159
160/**
161 * s3c_pm_do_save() - save a set of registers for restoration on resume.
162 * @ptr: Pointer to an array of registers.
163 * @count: Size of the ptr array.
164 *
165 * Run through the list of registers given, saving their contents in the
166 * array for later restoration when we wakeup.
167 */
168void s3c_pm_do_save(struct sleep_save *ptr, int count)
169{
170 for (; count > 0; count--, ptr++) {
171 ptr->val = __raw_readl(ptr->reg);
172 S3C_PMDBG("saved %p value %08lx\n", ptr->reg, ptr->val);
173 }
174}
175
176/**
177 * s3c_pm_do_restore() - restore register values from the save list.
178 * @ptr: Pointer to an array of registers.
179 * @count: Size of the ptr array.
180 *
181 * Restore the register values saved from s3c_pm_do_save().
182 *
183 * Note, we do not use S3C_PMDBG() in here, as the system may not have
184 * restore the UARTs state yet
185*/
186
187void s3c_pm_do_restore(const struct sleep_save *ptr, int count)
188{
189 for (; count > 0; count--, ptr++) {
190 printk(KERN_DEBUG "restore %p (restore %08lx, was %08x)\n",
191 ptr->reg, ptr->val, __raw_readl(ptr->reg));
192
193 __raw_writel(ptr->val, ptr->reg);
194 }
195}
196
197/**
198 * s3c_pm_do_restore_core() - early restore register values from save list.
199 *
200 * This is similar to s3c_pm_do_restore() except we try and minimise the
201 * side effects of the function in case registers that hardware might need
202 * to work has been restored.
203 *
204 * WARNING: Do not put any debug in here that may effect memory or use
205 * peripherals, as things may be changing!
206*/
207
208void s3c_pm_do_restore_core(const struct sleep_save *ptr, int count)
209{
210 for (; count > 0; count--, ptr++)
211 __raw_writel(ptr->val, ptr->reg);
212}
213
214/* s3c2410_pm_show_resume_irqs 68/* s3c2410_pm_show_resume_irqs
215 * 69 *
216 * print any IRQs asserted at resume time (ie, we woke from) 70 * print any IRQs asserted at resume time (ie, we woke from)
diff --git a/arch/arm/plat-samsung/s5p-dev-mfc.c b/arch/arm/plat-samsung/s5p-dev-mfc.c
index ad51f85fbd01..98087b655df0 100644
--- a/arch/arm/plat-samsung/s5p-dev-mfc.c
+++ b/arch/arm/plat-samsung/s5p-dev-mfc.c
@@ -122,32 +122,35 @@ device_initcall(s5p_mfc_memory_init);
122#endif 122#endif
123 123
124#ifdef CONFIG_OF 124#ifdef CONFIG_OF
125int __init s5p_fdt_find_mfc_mem(unsigned long node, const char *uname, 125int __init s5p_fdt_alloc_mfc_mem(unsigned long node, const char *uname,
126 int depth, void *data) 126 int depth, void *data)
127{ 127{
128 __be32 *prop; 128 __be32 *prop;
129 unsigned long len; 129 unsigned long len;
130 struct s5p_mfc_dt_meminfo *mfc_mem = data; 130 struct s5p_mfc_dt_meminfo mfc_mem;
131 131
132 if (!data) 132 if (!data)
133 return 0; 133 return 0;
134 134
135 if (!of_flat_dt_is_compatible(node, mfc_mem->compatible)) 135 if (!of_flat_dt_is_compatible(node, data))
136 return 0; 136 return 0;
137 137
138 prop = of_get_flat_dt_prop(node, "samsung,mfc-l", &len); 138 prop = of_get_flat_dt_prop(node, "samsung,mfc-l", &len);
139 if (!prop || (len != 2 * sizeof(unsigned long))) 139 if (!prop || (len != 2 * sizeof(unsigned long)))
140 return 0; 140 return 0;
141 141
142 mfc_mem->loff = be32_to_cpu(prop[0]); 142 mfc_mem.loff = be32_to_cpu(prop[0]);
143 mfc_mem->lsize = be32_to_cpu(prop[1]); 143 mfc_mem.lsize = be32_to_cpu(prop[1]);
144 144
145 prop = of_get_flat_dt_prop(node, "samsung,mfc-r", &len); 145 prop = of_get_flat_dt_prop(node, "samsung,mfc-r", &len);
146 if (!prop || (len != 2 * sizeof(unsigned long))) 146 if (!prop || (len != 2 * sizeof(unsigned long)))
147 return 0; 147 return 0;
148 148
149 mfc_mem->roff = be32_to_cpu(prop[0]); 149 mfc_mem.roff = be32_to_cpu(prop[0]);
150 mfc_mem->rsize = be32_to_cpu(prop[1]); 150 mfc_mem.rsize = be32_to_cpu(prop[1]);
151
152 s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize,
153 mfc_mem.loff, mfc_mem.lsize);
151 154
152 return 1; 155 return 1;
153} 156}
diff --git a/arch/arm/plat-samsung/s5p-dev-uart.c b/arch/arm/plat-samsung/s5p-dev-uart.c
index cafa3deddcc1..8c4487af98c8 100644
--- a/arch/arm/plat-samsung/s5p-dev-uart.c
+++ b/arch/arm/plat-samsung/s5p-dev-uart.c
@@ -18,7 +18,6 @@
18 18
19#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
20#include <asm/mach/irq.h> 20#include <asm/mach/irq.h>
21#include <mach/hardware.h>
22#include <mach/map.h> 21#include <mach/map.h>
23 22
24#include <plat/devs.h> 23#include <plat/devs.h>
diff --git a/arch/arm/plat-samsung/s5p-irq-pm.c b/arch/arm/plat-samsung/s5p-irq-pm.c
index 591498035916..52b16943617e 100644
--- a/arch/arm/plat-samsung/s5p-irq-pm.c
+++ b/arch/arm/plat-samsung/s5p-irq-pm.c
@@ -22,10 +22,7 @@
22#include <mach/map.h> 22#include <mach/map.h>
23 23
24#include <mach/regs-gpio.h> 24#include <mach/regs-gpio.h>
25
26#ifndef CONFIG_ARCH_EXYNOS
27#include <mach/regs-irq.h> 25#include <mach/regs-irq.h>
28#endif
29 26
30/* state for IRQs over sleep */ 27/* state for IRQs over sleep */
31 28
@@ -43,18 +40,8 @@ int s3c_irq_wake(struct irq_data *data, unsigned int state)
43 unsigned long irqbit; 40 unsigned long irqbit;
44 unsigned int irq_rtc_tic, irq_rtc_alarm; 41 unsigned int irq_rtc_tic, irq_rtc_alarm;
45 42
46#ifdef CONFIG_ARCH_EXYNOS
47 if (soc_is_exynos5250()) {
48 irq_rtc_tic = EXYNOS5_IRQ_RTC_TIC;
49 irq_rtc_alarm = EXYNOS5_IRQ_RTC_ALARM;
50 } else {
51 irq_rtc_tic = EXYNOS4_IRQ_RTC_TIC;
52 irq_rtc_alarm = EXYNOS4_IRQ_RTC_ALARM;
53 }
54#else
55 irq_rtc_tic = IRQ_RTC_TIC; 43 irq_rtc_tic = IRQ_RTC_TIC;
56 irq_rtc_alarm = IRQ_RTC_ALARM; 44 irq_rtc_alarm = IRQ_RTC_ALARM;
57#endif
58 45
59 if (data->irq == irq_rtc_tic || data->irq == irq_rtc_alarm) { 46 if (data->irq == irq_rtc_tic || data->irq == irq_rtc_alarm) {
60 irqbit = 1 << (data->irq + 1 - irq_rtc_alarm); 47 irqbit = 1 << (data->irq + 1 - irq_rtc_alarm);
diff --git a/arch/arm/plat-samsung/s5p-sleep.S b/arch/arm/plat-samsung/s5p-sleep.S
index a030e7301da8..c5001659bdf8 100644
--- a/arch/arm/plat-samsung/s5p-sleep.S
+++ b/arch/arm/plat-samsung/s5p-sleep.S
@@ -23,18 +23,7 @@
23 23
24#include <linux/linkage.h> 24#include <linux/linkage.h>
25#include <asm/asm-offsets.h> 25#include <asm/asm-offsets.h>
26#include <asm/hardware/cache-l2x0.h>
27 26
28#define CPU_MASK 0xff0ffff0
29#define CPU_CORTEX_A9 0x410fc090
30
31/*
32 * The following code is located into the .data section. This is to
33 * allow l2x0_regs_phys to be accessed with a relative load while we
34 * can't rely on any MMU translation. We could have put l2x0_regs_phys
35 * in the .text section as well, but some setups might insist on it to
36 * be truly read-only. (Reference from: arch/arm/kernel/sleep.S)
37 */
38 .data 27 .data
39 .align 28 .align
40 29
@@ -53,37 +42,5 @@
53 */ 42 */
54 43
55ENTRY(s3c_cpu_resume) 44ENTRY(s3c_cpu_resume)
56#ifdef CONFIG_CACHE_L2X0
57 mrc p15, 0, r0, c0, c0, 0
58 ldr r1, =CPU_MASK
59 and r0, r0, r1
60 ldr r1, =CPU_CORTEX_A9
61 cmp r0, r1
62 bne resume_l2on
63 adr r0, l2x0_regs_phys
64 ldr r0, [r0]
65 ldr r1, [r0, #L2X0_R_PHY_BASE]
66 ldr r2, [r1, #L2X0_CTRL]
67 tst r2, #0x1
68 bne resume_l2on
69 ldr r2, [r0, #L2X0_R_AUX_CTRL]
70 str r2, [r1, #L2X0_AUX_CTRL]
71 ldr r2, [r0, #L2X0_R_TAG_LATENCY]
72 str r2, [r1, #L2X0_TAG_LATENCY_CTRL]
73 ldr r2, [r0, #L2X0_R_DATA_LATENCY]
74 str r2, [r1, #L2X0_DATA_LATENCY_CTRL]
75 ldr r2, [r0, #L2X0_R_PREFETCH_CTRL]
76 str r2, [r1, #L2X0_PREFETCH_CTRL]
77 ldr r2, [r0, #L2X0_R_PWR_CTRL]
78 str r2, [r1, #L2X0_POWER_CTRL]
79 mov r2, #1
80 str r2, [r1, #L2X0_CTRL]
81resume_l2on:
82#endif
83 b cpu_resume 45 b cpu_resume
84ENDPROC(s3c_cpu_resume) 46ENDPROC(s3c_cpu_resume)
85#ifdef CONFIG_CACHE_L2X0
86 .globl l2x0_regs_phys
87l2x0_regs_phys:
88 .long 0
89#endif
diff --git a/arch/arm/vfp/entry.S b/arch/arm/vfp/entry.S
index 46e17492fd1f..f0759e70fb86 100644
--- a/arch/arm/vfp/entry.S
+++ b/arch/arm/vfp/entry.S
@@ -8,9 +8,12 @@
8 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11#include <linux/init.h>
12#include <linux/linkage.h>
11#include <asm/thread_info.h> 13#include <asm/thread_info.h>
12#include <asm/vfpmacros.h> 14#include <asm/vfpmacros.h>
13#include "../kernel/entry-header.S" 15#include <asm/assembler.h>
16#include <asm/asm-offsets.h>
14 17
15@ VFP entry point. 18@ VFP entry point.
16@ 19@
@@ -22,11 +25,7 @@
22@ IRQs disabled. 25@ IRQs disabled.
23@ 26@
24ENTRY(do_vfp) 27ENTRY(do_vfp)
25#ifdef CONFIG_PREEMPT_COUNT 28 inc_preempt_count r10, r4
26 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
27 add r11, r4, #1 @ increment it
28 str r11, [r10, #TI_PREEMPT]
29#endif
30 enable_irq 29 enable_irq
31 ldr r4, .LCvfp 30 ldr r4, .LCvfp
32 ldr r11, [r10, #TI_CPU] @ CPU number 31 ldr r11, [r10, #TI_CPU] @ CPU number
@@ -35,12 +34,7 @@ ENTRY(do_vfp)
35ENDPROC(do_vfp) 34ENDPROC(do_vfp)
36 35
37ENTRY(vfp_null_entry) 36ENTRY(vfp_null_entry)
38#ifdef CONFIG_PREEMPT_COUNT 37 dec_preempt_count_ti r10, r4
39 get_thread_info r10
40 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
41 sub r11, r4, #1 @ decrement it
42 str r11, [r10, #TI_PREEMPT]
43#endif
44 mov pc, lr 38 mov pc, lr
45ENDPROC(vfp_null_entry) 39ENDPROC(vfp_null_entry)
46 40
@@ -53,12 +47,7 @@ ENDPROC(vfp_null_entry)
53 47
54 __INIT 48 __INIT
55ENTRY(vfp_testing_entry) 49ENTRY(vfp_testing_entry)
56#ifdef CONFIG_PREEMPT_COUNT 50 dec_preempt_count_ti r10, r4
57 get_thread_info r10
58 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
59 sub r11, r4, #1 @ decrement it
60 str r11, [r10, #TI_PREEMPT]
61#endif
62 ldr r0, VFP_arch_address 51 ldr r0, VFP_arch_address
63 str r0, [r0] @ set to non-zero value 52 str r0, [r0] @ set to non-zero value
64 mov pc, r9 @ we have handled the fault 53 mov pc, r9 @ we have handled the fault
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
index 3e5d3115a2a6..be807625ed8c 100644
--- a/arch/arm/vfp/vfphw.S
+++ b/arch/arm/vfp/vfphw.S
@@ -14,10 +14,13 @@
14 * r10 points at the start of the private FP workspace in the thread structure 14 * r10 points at the start of the private FP workspace in the thread structure
15 * sp points to a struct pt_regs (as defined in include/asm/proc/ptrace.h) 15 * sp points to a struct pt_regs (as defined in include/asm/proc/ptrace.h)
16 */ 16 */
17#include <linux/init.h>
18#include <linux/linkage.h>
17#include <asm/thread_info.h> 19#include <asm/thread_info.h>
18#include <asm/vfpmacros.h> 20#include <asm/vfpmacros.h>
19#include <linux/kern_levels.h> 21#include <linux/kern_levels.h>
20#include "../kernel/entry-header.S" 22#include <asm/assembler.h>
23#include <asm/asm-offsets.h>
21 24
22 .macro DBGSTR, str 25 .macro DBGSTR, str
23#ifdef DEBUG 26#ifdef DEBUG
@@ -179,12 +182,7 @@ vfp_hw_state_valid:
179 @ else it's one 32-bit instruction, so 182 @ else it's one 32-bit instruction, so
180 @ always subtract 4 from the following 183 @ always subtract 4 from the following
181 @ instruction address. 184 @ instruction address.
182#ifdef CONFIG_PREEMPT_COUNT 185 dec_preempt_count_ti r10, r4
183 get_thread_info r10
184 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
185 sub r11, r4, #1 @ decrement it
186 str r11, [r10, #TI_PREEMPT]
187#endif
188 mov pc, r9 @ we think we have handled things 186 mov pc, r9 @ we think we have handled things
189 187
190 188
@@ -203,12 +201,7 @@ look_for_VFP_exceptions:
203 @ not recognised by VFP 201 @ not recognised by VFP
204 202
205 DBGSTR "not VFP" 203 DBGSTR "not VFP"
206#ifdef CONFIG_PREEMPT_COUNT 204 dec_preempt_count_ti r10, r4
207 get_thread_info r10
208 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
209 sub r11, r4, #1 @ decrement it
210 str r11, [r10, #TI_PREEMPT]
211#endif
212 mov pc, lr 205 mov pc, lr
213 206
214process_exception: 207process_exception:
diff --git a/arch/arm/xen/p2m.c b/arch/arm/xen/p2m.c
index b31ee1b275b0..97baf4427817 100644
--- a/arch/arm/xen/p2m.c
+++ b/arch/arm/xen/p2m.c
@@ -146,6 +146,38 @@ unsigned long __mfn_to_pfn(unsigned long mfn)
146} 146}
147EXPORT_SYMBOL_GPL(__mfn_to_pfn); 147EXPORT_SYMBOL_GPL(__mfn_to_pfn);
148 148
149int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
150 struct gnttab_map_grant_ref *kmap_ops,
151 struct page **pages, unsigned int count)
152{
153 int i;
154
155 for (i = 0; i < count; i++) {
156 if (map_ops[i].status)
157 continue;
158 set_phys_to_machine(map_ops[i].host_addr >> PAGE_SHIFT,
159 map_ops[i].dev_bus_addr >> PAGE_SHIFT);
160 }
161
162 return 0;
163}
164EXPORT_SYMBOL_GPL(set_foreign_p2m_mapping);
165
166int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops,
167 struct gnttab_map_grant_ref *kmap_ops,
168 struct page **pages, unsigned int count)
169{
170 int i;
171
172 for (i = 0; i < count; i++) {
173 set_phys_to_machine(unmap_ops[i].host_addr >> PAGE_SHIFT,
174 INVALID_P2M_ENTRY);
175 }
176
177 return 0;
178}
179EXPORT_SYMBOL_GPL(clear_foreign_p2m_mapping);
180
149bool __set_phys_to_machine_multi(unsigned long pfn, 181bool __set_phys_to_machine_multi(unsigned long pfn,
150 unsigned long mfn, unsigned long nr_pages) 182 unsigned long mfn, unsigned long nr_pages)
151{ 183{
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 516d8a7ca697..e6e4d3749a6e 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -17,6 +17,7 @@ config ARM64
17 select GENERIC_CLOCKEVENTS 17 select GENERIC_CLOCKEVENTS
18 select GENERIC_CLOCKEVENTS_BROADCAST if SMP 18 select GENERIC_CLOCKEVENTS_BROADCAST if SMP
19 select GENERIC_CPU_AUTOPROBE 19 select GENERIC_CPU_AUTOPROBE
20 select GENERIC_EARLY_IOREMAP
20 select GENERIC_IOMAP 21 select GENERIC_IOMAP
21 select GENERIC_IRQ_PROBE 22 select GENERIC_IRQ_PROBE
22 select GENERIC_IRQ_SHOW 23 select GENERIC_IRQ_SHOW
@@ -47,6 +48,7 @@ config ARM64
47 select NO_BOOTMEM 48 select NO_BOOTMEM
48 select OF 49 select OF
49 select OF_EARLY_FLATTREE 50 select OF_EARLY_FLATTREE
51 select OF_RESERVED_MEM
50 select PERF_USE_VMALLOC 52 select PERF_USE_VMALLOC
51 select POWER_RESET 53 select POWER_RESET
52 select POWER_SUPPLY 54 select POWER_SUPPLY
@@ -65,7 +67,7 @@ config ARCH_PHYS_ADDR_T_64BIT
65config MMU 67config MMU
66 def_bool y 68 def_bool y
67 69
68config NO_IOPORT 70config NO_IOPORT_MAP
69 def_bool y 71 def_bool y
70 72
71config STACKTRACE_SUPPORT 73config STACKTRACE_SUPPORT
@@ -321,6 +323,8 @@ menu "CPU Power Management"
321 323
322source "drivers/cpuidle/Kconfig" 324source "drivers/cpuidle/Kconfig"
323 325
326source "kernel/power/Kconfig"
327
324source "drivers/cpufreq/Kconfig" 328source "drivers/cpufreq/Kconfig"
325 329
326endmenu 330endmenu
diff --git a/arch/arm64/Kconfig.debug b/arch/arm64/Kconfig.debug
index 835c559786bd..d10ec334c93b 100644
--- a/arch/arm64/Kconfig.debug
+++ b/arch/arm64/Kconfig.debug
@@ -6,6 +6,20 @@ config FRAME_POINTER
6 bool 6 bool
7 default y 7 default y
8 8
9config STRICT_DEVMEM
10 bool "Filter access to /dev/mem"
11 depends on MMU
12 help
13 If this option is disabled, you allow userspace (root) access to all
14 of memory, including kernel and userspace memory. Accidental
15 access to this is obviously disastrous, but specific access can
16 be used by people debugging the kernel.
17
18 If this option is switched on, the /dev/mem file only allows
19 userspace access to memory mapped peripherals.
20
21 If in doubt, say Y.
22
9config EARLY_PRINTK 23config EARLY_PRINTK
10 bool "Early printk support" 24 bool "Early printk support"
11 default y 25 default y
diff --git a/arch/arm64/include/asm/Kbuild b/arch/arm64/include/asm/Kbuild
index 4bca4923fc0b..83f71b3004a8 100644
--- a/arch/arm64/include/asm/Kbuild
+++ b/arch/arm64/include/asm/Kbuild
@@ -10,6 +10,7 @@ generic-y += delay.h
10generic-y += div64.h 10generic-y += div64.h
11generic-y += dma.h 11generic-y += dma.h
12generic-y += emergency-restart.h 12generic-y += emergency-restart.h
13generic-y += early_ioremap.h
13generic-y += errno.h 14generic-y += errno.h
14generic-y += ftrace.h 15generic-y += ftrace.h
15generic-y += hash.h 16generic-y += hash.h
diff --git a/arch/arm64/include/asm/fixmap.h b/arch/arm64/include/asm/fixmap.h
new file mode 100644
index 000000000000..5f7bfe6df723
--- /dev/null
+++ b/arch/arm64/include/asm/fixmap.h
@@ -0,0 +1,67 @@
1/*
2 * fixmap.h: compile-time virtual memory allocation
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 1998 Ingo Molnar
9 * Copyright (C) 2013 Mark Salter <msalter@redhat.com>
10 *
11 * Adapted from arch/x86_64 version.
12 *
13 */
14
15#ifndef _ASM_ARM64_FIXMAP_H
16#define _ASM_ARM64_FIXMAP_H
17
18#ifndef __ASSEMBLY__
19#include <linux/kernel.h>
20#include <asm/page.h>
21
22/*
23 * Here we define all the compile-time 'special' virtual
24 * addresses. The point is to have a constant address at
25 * compile time, but to set the physical address only
26 * in the boot process.
27 *
28 * These 'compile-time allocated' memory buffers are
29 * page-sized. Use set_fixmap(idx,phys) to associate
30 * physical memory with fixmap indices.
31 *
32 */
33enum fixed_addresses {
34 FIX_EARLYCON_MEM_BASE,
35 __end_of_permanent_fixed_addresses,
36
37 /*
38 * Temporary boot-time mappings, used by early_ioremap(),
39 * before ioremap() is functional.
40 */
41#ifdef CONFIG_ARM64_64K_PAGES
42#define NR_FIX_BTMAPS 4
43#else
44#define NR_FIX_BTMAPS 64
45#endif
46#define FIX_BTMAPS_SLOTS 7
47#define TOTAL_FIX_BTMAPS (NR_FIX_BTMAPS * FIX_BTMAPS_SLOTS)
48
49 FIX_BTMAP_END = __end_of_permanent_fixed_addresses,
50 FIX_BTMAP_BEGIN = FIX_BTMAP_END + TOTAL_FIX_BTMAPS - 1,
51 __end_of_fixed_addresses
52};
53
54#define FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT)
55#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
56
57#define FIXMAP_PAGE_IO __pgprot(PROT_DEVICE_nGnRE)
58
59extern void __early_set_fixmap(enum fixed_addresses idx,
60 phys_addr_t phys, pgprot_t flags);
61
62#define __set_fixmap __early_set_fixmap
63
64#include <asm-generic/fixmap.h>
65
66#endif /* !__ASSEMBLY__ */
67#endif /* _ASM_ARM64_FIXMAP_H */
diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h
index 7846a6bb0833..a1bef78f0303 100644
--- a/arch/arm64/include/asm/io.h
+++ b/arch/arm64/include/asm/io.h
@@ -27,6 +27,7 @@
27#include <asm/byteorder.h> 27#include <asm/byteorder.h>
28#include <asm/barrier.h> 28#include <asm/barrier.h>
29#include <asm/pgtable.h> 29#include <asm/pgtable.h>
30#include <asm/early_ioremap.h>
30 31
31#include <xen/xen.h> 32#include <xen/xen.h>
32 33
diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h
index 21ef48d32ff2..3d6903006a8a 100644
--- a/arch/arm64/include/asm/kvm_arm.h
+++ b/arch/arm64/include/asm/kvm_arm.h
@@ -62,6 +62,7 @@
62 * RW: 64bit by default, can be overriden for 32bit VMs 62 * RW: 64bit by default, can be overriden for 32bit VMs
63 * TAC: Trap ACTLR 63 * TAC: Trap ACTLR
64 * TSC: Trap SMC 64 * TSC: Trap SMC
65 * TVM: Trap VM ops (until M+C set in SCTLR_EL1)
65 * TSW: Trap cache operations by set/way 66 * TSW: Trap cache operations by set/way
66 * TWE: Trap WFE 67 * TWE: Trap WFE
67 * TWI: Trap WFI 68 * TWI: Trap WFI
@@ -74,7 +75,7 @@
74 * SWIO: Turn set/way invalidates into set/way clean+invalidate 75 * SWIO: Turn set/way invalidates into set/way clean+invalidate
75 */ 76 */
76#define HCR_GUEST_FLAGS (HCR_TSC | HCR_TSW | HCR_TWE | HCR_TWI | HCR_VM | \ 77#define HCR_GUEST_FLAGS (HCR_TSC | HCR_TSW | HCR_TWE | HCR_TWI | HCR_VM | \
77 HCR_BSU_IS | HCR_FB | HCR_TAC | \ 78 HCR_TVM | HCR_BSU_IS | HCR_FB | HCR_TAC | \
78 HCR_AMO | HCR_IMO | HCR_FMO | \ 79 HCR_AMO | HCR_IMO | HCR_FMO | \
79 HCR_SWIO | HCR_TIDCP | HCR_RW) 80 HCR_SWIO | HCR_TIDCP | HCR_RW)
80#define HCR_VIRT_EXCP_MASK (HCR_VA | HCR_VI | HCR_VF) 81#define HCR_VIRT_EXCP_MASK (HCR_VA | HCR_VI | HCR_VF)
diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h
index b25763bc0ec4..9fcd54b1e16d 100644
--- a/arch/arm64/include/asm/kvm_asm.h
+++ b/arch/arm64/include/asm/kvm_asm.h
@@ -79,7 +79,8 @@
79#define c13_TID_URW (TPIDR_EL0 * 2) /* Thread ID, User R/W */ 79#define c13_TID_URW (TPIDR_EL0 * 2) /* Thread ID, User R/W */
80#define c13_TID_URO (TPIDRRO_EL0 * 2)/* Thread ID, User R/O */ 80#define c13_TID_URO (TPIDRRO_EL0 * 2)/* Thread ID, User R/O */
81#define c13_TID_PRIV (TPIDR_EL1 * 2) /* Thread ID, Privileged */ 81#define c13_TID_PRIV (TPIDR_EL1 * 2) /* Thread ID, Privileged */
82#define c10_AMAIR (AMAIR_EL1 * 2) /* Aux Memory Attr Indirection Reg */ 82#define c10_AMAIR0 (AMAIR_EL1 * 2) /* Aux Memory Attr Indirection Reg */
83#define c10_AMAIR1 (c10_AMAIR0 + 1)/* Aux Memory Attr Indirection Reg */
83#define c14_CNTKCTL (CNTKCTL_EL1 * 2) /* Timer Control Register (PL1) */ 84#define c14_CNTKCTL (CNTKCTL_EL1 * 2) /* Timer Control Register (PL1) */
84#define NR_CP15_REGS (NR_SYS_REGS * 2) 85#define NR_CP15_REGS (NR_SYS_REGS * 2)
85 86
diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index 7f1f9408ff66..7d29847a893b 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -106,7 +106,6 @@ static inline bool kvm_is_write_fault(unsigned long esr)
106 return true; 106 return true;
107} 107}
108 108
109static inline void kvm_clean_dcache_area(void *addr, size_t size) {}
110static inline void kvm_clean_pgd(pgd_t *pgd) {} 109static inline void kvm_clean_pgd(pgd_t *pgd) {}
111static inline void kvm_clean_pmd_entry(pmd_t *pmd) {} 110static inline void kvm_clean_pmd_entry(pmd_t *pmd) {}
112static inline void kvm_clean_pte(pte_t *pte) {} 111static inline void kvm_clean_pte(pte_t *pte) {}
@@ -122,11 +121,25 @@ static inline void kvm_set_s2pmd_writable(pmd_t *pmd)
122 pmd_val(*pmd) |= PMD_S2_RDWR; 121 pmd_val(*pmd) |= PMD_S2_RDWR;
123} 122}
124 123
124#define kvm_pgd_addr_end(addr, end) pgd_addr_end(addr, end)
125#define kvm_pud_addr_end(addr, end) pud_addr_end(addr, end)
126#define kvm_pmd_addr_end(addr, end) pmd_addr_end(addr, end)
127
125struct kvm; 128struct kvm;
126 129
127static inline void coherent_icache_guest_page(struct kvm *kvm, hva_t hva, 130#define kvm_flush_dcache_to_poc(a,l) __flush_dcache_area((a), (l))
128 unsigned long size) 131
132static inline bool vcpu_has_cache_enabled(struct kvm_vcpu *vcpu)
129{ 133{
134 return (vcpu_sys_reg(vcpu, SCTLR_EL1) & 0b101) == 0b101;
135}
136
137static inline void coherent_cache_guest_page(struct kvm_vcpu *vcpu, hva_t hva,
138 unsigned long size)
139{
140 if (!vcpu_has_cache_enabled(vcpu))
141 kvm_flush_dcache_to_poc((void *)hva, size);
142
130 if (!icache_is_aliasing()) { /* PIPT */ 143 if (!icache_is_aliasing()) { /* PIPT */
131 flush_icache_range(hva, hva + size); 144 flush_icache_range(hva, hva + size);
132 } else if (!icache_is_aivivt()) { /* non ASID-tagged VIVT */ 145 } else if (!icache_is_aivivt()) { /* non ASID-tagged VIVT */
@@ -135,8 +148,9 @@ static inline void coherent_icache_guest_page(struct kvm *kvm, hva_t hva,
135 } 148 }
136} 149}
137 150
138#define kvm_flush_dcache_to_poc(a,l) __flush_dcache_area((a), (l))
139#define kvm_virt_to_phys(x) __virt_to_phys((unsigned long)(x)) 151#define kvm_virt_to_phys(x) __virt_to_phys((unsigned long)(x))
140 152
153void stage2_flush_vm(struct kvm *kvm);
154
141#endif /* __ASSEMBLY__ */ 155#endif /* __ASSEMBLY__ */
142#endif /* __ARM64_KVM_MMU_H__ */ 156#endif /* __ARM64_KVM_MMU_H__ */
diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h
index 9dc5dc39fded..e94f9458aa6f 100644
--- a/arch/arm64/include/asm/memory.h
+++ b/arch/arm64/include/asm/memory.h
@@ -49,7 +49,7 @@
49#define PAGE_OFFSET (UL(0xffffffffffffffff) << (VA_BITS - 1)) 49#define PAGE_OFFSET (UL(0xffffffffffffffff) << (VA_BITS - 1))
50#define MODULES_END (PAGE_OFFSET) 50#define MODULES_END (PAGE_OFFSET)
51#define MODULES_VADDR (MODULES_END - SZ_64M) 51#define MODULES_VADDR (MODULES_END - SZ_64M)
52#define EARLYCON_IOBASE (MODULES_VADDR - SZ_4M) 52#define FIXADDR_TOP (MODULES_VADDR - SZ_2M - PAGE_SIZE)
53#define TASK_SIZE_64 (UL(1) << VA_BITS) 53#define TASK_SIZE_64 (UL(1) << VA_BITS)
54 54
55#ifdef CONFIG_COMPAT 55#ifdef CONFIG_COMPAT
diff --git a/arch/arm64/include/asm/mmu.h b/arch/arm64/include/asm/mmu.h
index 2494fc01896a..f600d400c07d 100644
--- a/arch/arm64/include/asm/mmu.h
+++ b/arch/arm64/include/asm/mmu.h
@@ -27,5 +27,6 @@ typedef struct {
27extern void paging_init(void); 27extern void paging_init(void);
28extern void setup_mm_for_reboot(void); 28extern void setup_mm_for_reboot(void);
29extern void __iomem *early_io_map(phys_addr_t phys, unsigned long virt); 29extern void __iomem *early_io_map(phys_addr_t phys, unsigned long virt);
30extern void init_mem_pgprot(void);
30 31
31#endif 32#endif
diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h
index f7af66b54cb2..5fc8a66c3924 100644
--- a/arch/arm64/include/asm/pgtable-hwdef.h
+++ b/arch/arm64/include/asm/pgtable-hwdef.h
@@ -120,8 +120,12 @@
120#define TCR_ORGN_WBnWA ((UL(3) << 10) | (UL(3) << 26)) 120#define TCR_ORGN_WBnWA ((UL(3) << 10) | (UL(3) << 26))
121#define TCR_ORGN_MASK ((UL(3) << 10) | (UL(3) << 26)) 121#define TCR_ORGN_MASK ((UL(3) << 10) | (UL(3) << 26))
122#define TCR_SHARED ((UL(3) << 12) | (UL(3) << 28)) 122#define TCR_SHARED ((UL(3) << 12) | (UL(3) << 28))
123#define TCR_TG0_4K (UL(0) << 14)
123#define TCR_TG0_64K (UL(1) << 14) 124#define TCR_TG0_64K (UL(1) << 14)
124#define TCR_TG1_64K (UL(1) << 30) 125#define TCR_TG0_16K (UL(2) << 14)
126#define TCR_TG1_16K (UL(1) << 30)
127#define TCR_TG1_4K (UL(2) << 30)
128#define TCR_TG1_64K (UL(3) << 30)
125#define TCR_ASID16 (UL(1) << 36) 129#define TCR_ASID16 (UL(1) << 36)
126#define TCR_TBI0 (UL(1) << 37) 130#define TCR_TBI0 (UL(1) << 37)
127 131
diff --git a/arch/arm64/include/asm/virt.h b/arch/arm64/include/asm/virt.h
index 130e2be952cf..215ad4649dd7 100644
--- a/arch/arm64/include/asm/virt.h
+++ b/arch/arm64/include/asm/virt.h
@@ -22,7 +22,6 @@
22#define BOOT_CPU_MODE_EL2 (0xe12) 22#define BOOT_CPU_MODE_EL2 (0xe12)
23 23
24#ifndef __ASSEMBLY__ 24#ifndef __ASSEMBLY__
25#include <asm/cacheflush.h>
26 25
27/* 26/*
28 * __boot_cpu_mode records what mode CPUs were booted in. 27 * __boot_cpu_mode records what mode CPUs were booted in.
@@ -38,20 +37,9 @@ extern u32 __boot_cpu_mode[2];
38void __hyp_set_vectors(phys_addr_t phys_vector_base); 37void __hyp_set_vectors(phys_addr_t phys_vector_base);
39phys_addr_t __hyp_get_vectors(void); 38phys_addr_t __hyp_get_vectors(void);
40 39
41static inline void sync_boot_mode(void)
42{
43 /*
44 * As secondaries write to __boot_cpu_mode with caches disabled, we
45 * must flush the corresponding cache entries to ensure the visibility
46 * of their writes.
47 */
48 __flush_dcache_area(__boot_cpu_mode, sizeof(__boot_cpu_mode));
49}
50
51/* Reports the availability of HYP mode */ 40/* Reports the availability of HYP mode */
52static inline bool is_hyp_mode_available(void) 41static inline bool is_hyp_mode_available(void)
53{ 42{
54 sync_boot_mode();
55 return (__boot_cpu_mode[0] == BOOT_CPU_MODE_EL2 && 43 return (__boot_cpu_mode[0] == BOOT_CPU_MODE_EL2 &&
56 __boot_cpu_mode[1] == BOOT_CPU_MODE_EL2); 44 __boot_cpu_mode[1] == BOOT_CPU_MODE_EL2);
57} 45}
@@ -59,7 +47,6 @@ static inline bool is_hyp_mode_available(void)
59/* Check if the bootloader has booted CPUs in different modes */ 47/* Check if the bootloader has booted CPUs in different modes */
60static inline bool is_hyp_mode_mismatched(void) 48static inline bool is_hyp_mode_mismatched(void)
61{ 49{
62 sync_boot_mode();
63 return __boot_cpu_mode[0] != __boot_cpu_mode[1]; 50 return __boot_cpu_mode[0] != __boot_cpu_mode[1];
64} 51}
65 52
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
index 14ba23c61153..ed3955a95747 100644
--- a/arch/arm64/kernel/debug-monitors.c
+++ b/arch/arm64/kernel/debug-monitors.c
@@ -154,13 +154,17 @@ static struct notifier_block os_lock_nb = {
154 154
155static int debug_monitors_init(void) 155static int debug_monitors_init(void)
156{ 156{
157 cpu_notifier_register_begin();
158
157 /* Clear the OS lock. */ 159 /* Clear the OS lock. */
158 on_each_cpu(clear_os_lock, NULL, 1); 160 on_each_cpu(clear_os_lock, NULL, 1);
159 isb(); 161 isb();
160 local_dbg_enable(); 162 local_dbg_enable();
161 163
162 /* Register hotplug handler. */ 164 /* Register hotplug handler. */
163 register_cpu_notifier(&os_lock_nb); 165 __register_cpu_notifier(&os_lock_nb);
166
167 cpu_notifier_register_done();
164 return 0; 168 return 0;
165} 169}
166postcore_initcall(debug_monitors_init); 170postcore_initcall(debug_monitors_init);
diff --git a/arch/arm64/kernel/early_printk.c b/arch/arm64/kernel/early_printk.c
index fbb6e1843659..ffbbdde7aba1 100644
--- a/arch/arm64/kernel/early_printk.c
+++ b/arch/arm64/kernel/early_printk.c
@@ -26,6 +26,8 @@
26#include <linux/amba/serial.h> 26#include <linux/amba/serial.h>
27#include <linux/serial_reg.h> 27#include <linux/serial_reg.h>
28 28
29#include <asm/fixmap.h>
30
29static void __iomem *early_base; 31static void __iomem *early_base;
30static void (*printch)(char ch); 32static void (*printch)(char ch);
31 33
@@ -141,8 +143,10 @@ static int __init setup_early_printk(char *buf)
141 } 143 }
142 /* no options parsing yet */ 144 /* no options parsing yet */
143 145
144 if (paddr) 146 if (paddr) {
145 early_base = early_io_map(paddr, EARLYCON_IOBASE); 147 set_fixmap_io(FIX_EARLYCON_MEM_BASE, paddr);
148 early_base = (void __iomem *)fix_to_virt(FIX_EARLYCON_MEM_BASE);
149 }
146 150
147 printch = match->printch; 151 printch = match->printch;
148 early_console = &early_console_dev; 152 early_console = &early_console_dev;
diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
index 61035d6814cb..0fd565000772 100644
--- a/arch/arm64/kernel/head.S
+++ b/arch/arm64/kernel/head.S
@@ -26,6 +26,7 @@
26#include <asm/assembler.h> 26#include <asm/assembler.h>
27#include <asm/ptrace.h> 27#include <asm/ptrace.h>
28#include <asm/asm-offsets.h> 28#include <asm/asm-offsets.h>
29#include <asm/cache.h>
29#include <asm/cputype.h> 30#include <asm/cputype.h>
30#include <asm/memory.h> 31#include <asm/memory.h>
31#include <asm/thread_info.h> 32#include <asm/thread_info.h>
@@ -229,7 +230,11 @@ ENTRY(set_cpu_boot_mode_flag)
229 cmp w20, #BOOT_CPU_MODE_EL2 230 cmp w20, #BOOT_CPU_MODE_EL2
230 b.ne 1f 231 b.ne 1f
231 add x1, x1, #4 232 add x1, x1, #4
2321: str w20, [x1] // This CPU has booted in EL1 2331: dc cvac, x1 // Clean potentially dirty cache line
234 dsb sy
235 str w20, [x1] // This CPU has booted in EL1
236 dc civac, x1 // Clean&invalidate potentially stale cache line
237 dsb sy
233 ret 238 ret
234ENDPROC(set_cpu_boot_mode_flag) 239ENDPROC(set_cpu_boot_mode_flag)
235 240
@@ -240,8 +245,9 @@ ENDPROC(set_cpu_boot_mode_flag)
240 * This is not in .bss, because we set it sufficiently early that the boot-time 245 * This is not in .bss, because we set it sufficiently early that the boot-time
241 * zeroing of .bss would clobber it. 246 * zeroing of .bss would clobber it.
242 */ 247 */
243 .pushsection .data 248 .pushsection .data..cacheline_aligned
244ENTRY(__boot_cpu_mode) 249ENTRY(__boot_cpu_mode)
250 .align L1_CACHE_SHIFT
245 .long BOOT_CPU_MODE_EL2 251 .long BOOT_CPU_MODE_EL2
246 .long 0 252 .long 0
247 .popsection 253 .popsection
@@ -404,10 +410,19 @@ ENDPROC(__calc_phys_offset)
404 * - identity mapping to enable the MMU (low address, TTBR0) 410 * - identity mapping to enable the MMU (low address, TTBR0)
405 * - first few MB of the kernel linear mapping to jump to once the MMU has 411 * - first few MB of the kernel linear mapping to jump to once the MMU has
406 * been enabled, including the FDT blob (TTBR1) 412 * been enabled, including the FDT blob (TTBR1)
407 * - UART mapping if CONFIG_EARLY_PRINTK is enabled (TTBR1) 413 * - pgd entry for fixed mappings (TTBR1)
408 */ 414 */
409__create_page_tables: 415__create_page_tables:
410 pgtbl x25, x26, x24 // idmap_pg_dir and swapper_pg_dir addresses 416 pgtbl x25, x26, x24 // idmap_pg_dir and swapper_pg_dir addresses
417 mov x27, lr
418
419 /*
420 * Invalidate the idmap and swapper page tables to avoid potential
421 * dirty cache lines being evicted.
422 */
423 mov x0, x25
424 add x1, x26, #SWAPPER_DIR_SIZE
425 bl __inval_cache_range
411 426
412 /* 427 /*
413 * Clear the idmap and swapper page tables. 428 * Clear the idmap and swapper page tables.
@@ -461,15 +476,23 @@ __create_page_tables:
461 sub x6, x6, #1 // inclusive range 476 sub x6, x6, #1 // inclusive range
462 create_block_map x0, x7, x3, x5, x6 477 create_block_map x0, x7, x3, x5, x6
4631: 4781:
464#ifdef CONFIG_EARLY_PRINTK
465 /* 479 /*
466 * Create the pgd entry for the UART mapping. The full mapping is done 480 * Create the pgd entry for the fixed mappings.
467 * later based earlyprintk kernel parameter.
468 */ 481 */
469 ldr x5, =EARLYCON_IOBASE // UART virtual address 482 ldr x5, =FIXADDR_TOP // Fixed mapping virtual address
470 add x0, x26, #2 * PAGE_SIZE // section table address 483 add x0, x26, #2 * PAGE_SIZE // section table address
471 create_pgd_entry x26, x0, x5, x6, x7 484 create_pgd_entry x26, x0, x5, x6, x7
472#endif 485
486 /*
487 * Since the page tables have been populated with non-cacheable
488 * accesses (MMU disabled), invalidate the idmap and swapper page
489 * tables again to remove any speculatively loaded cache lines.
490 */
491 mov x0, x25
492 add x1, x26, #SWAPPER_DIR_SIZE
493 bl __inval_cache_range
494
495 mov lr, x27
473 ret 496 ret
474ENDPROC(__create_page_tables) 497ENDPROC(__create_page_tables)
475 .ltorg 498 .ltorg
diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c
index f17f581116fc..bee789757806 100644
--- a/arch/arm64/kernel/hw_breakpoint.c
+++ b/arch/arm64/kernel/hw_breakpoint.c
@@ -913,6 +913,8 @@ static int __init arch_hw_breakpoint_init(void)
913 pr_info("found %d breakpoint and %d watchpoint registers.\n", 913 pr_info("found %d breakpoint and %d watchpoint registers.\n",
914 core_num_brps, core_num_wrps); 914 core_num_brps, core_num_wrps);
915 915
916 cpu_notifier_register_begin();
917
916 /* 918 /*
917 * Reset the breakpoint resources. We assume that a halting 919 * Reset the breakpoint resources. We assume that a halting
918 * debugger will leave the world in a nice state for us. 920 * debugger will leave the world in a nice state for us.
@@ -927,7 +929,10 @@ static int __init arch_hw_breakpoint_init(void)
927 TRAP_HWBKPT, "hw-watchpoint handler"); 929 TRAP_HWBKPT, "hw-watchpoint handler");
928 930
929 /* Register hotplug notifier. */ 931 /* Register hotplug notifier. */
930 register_cpu_notifier(&hw_breakpoint_reset_nb); 932 __register_cpu_notifier(&hw_breakpoint_reset_nb);
933
934 cpu_notifier_register_done();
935
931 /* Register cpu_suspend hw breakpoint restore hook */ 936 /* Register cpu_suspend hw breakpoint restore hook */
932 cpu_suspend_set_dbg_restorer(hw_breakpoint_reset); 937 cpu_suspend_set_dbg_restorer(hw_breakpoint_reset);
933 938
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
index e868c72a7938..baf5afb7e6a0 100644
--- a/arch/arm64/kernel/perf_event.c
+++ b/arch/arm64/kernel/perf_event.c
@@ -1386,6 +1386,7 @@ user_backtrace(struct frame_tail __user *tail,
1386 return buftail.fp; 1386 return buftail.fp;
1387} 1387}
1388 1388
1389#ifdef CONFIG_COMPAT
1389/* 1390/*
1390 * The registers we're interested in are at the end of the variable 1391 * The registers we're interested in are at the end of the variable
1391 * length saved register structure. The fp points at the end of this 1392 * length saved register structure. The fp points at the end of this
@@ -1430,6 +1431,7 @@ compat_user_backtrace(struct compat_frame_tail __user *tail,
1430 1431
1431 return (struct compat_frame_tail __user *)compat_ptr(buftail.fp) - 1; 1432 return (struct compat_frame_tail __user *)compat_ptr(buftail.fp) - 1;
1432} 1433}
1434#endif /* CONFIG_COMPAT */
1433 1435
1434void perf_callchain_user(struct perf_callchain_entry *entry, 1436void perf_callchain_user(struct perf_callchain_entry *entry,
1435 struct pt_regs *regs) 1437 struct pt_regs *regs)
@@ -1451,6 +1453,7 @@ void perf_callchain_user(struct perf_callchain_entry *entry,
1451 tail && !((unsigned long)tail & 0xf)) 1453 tail && !((unsigned long)tail & 0xf))
1452 tail = user_backtrace(tail, entry); 1454 tail = user_backtrace(tail, entry);
1453 } else { 1455 } else {
1456#ifdef CONFIG_COMPAT
1454 /* AARCH32 compat mode */ 1457 /* AARCH32 compat mode */
1455 struct compat_frame_tail __user *tail; 1458 struct compat_frame_tail __user *tail;
1456 1459
@@ -1459,6 +1462,7 @@ void perf_callchain_user(struct perf_callchain_entry *entry,
1459 while ((entry->nr < PERF_MAX_STACK_DEPTH) && 1462 while ((entry->nr < PERF_MAX_STACK_DEPTH) &&
1460 tail && !((unsigned long)tail & 0x3)) 1463 tail && !((unsigned long)tail & 0x3))
1461 tail = compat_user_backtrace(tail, entry); 1464 tail = compat_user_backtrace(tail, entry);
1465#endif
1462 } 1466 }
1463} 1467}
1464 1468
diff --git a/arch/arm64/kernel/perf_regs.c b/arch/arm64/kernel/perf_regs.c
index f2d6f0a36d63..422ebd63b619 100644
--- a/arch/arm64/kernel/perf_regs.c
+++ b/arch/arm64/kernel/perf_regs.c
@@ -2,6 +2,8 @@
2#include <linux/kernel.h> 2#include <linux/kernel.h>
3#include <linux/perf_event.h> 3#include <linux/perf_event.h>
4#include <linux/bug.h> 4#include <linux/bug.h>
5
6#include <asm/compat.h>
5#include <asm/perf_regs.h> 7#include <asm/perf_regs.h>
6#include <asm/ptrace.h> 8#include <asm/ptrace.h>
7 9
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index 67da30741a1b..720853f70b6b 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -42,6 +42,7 @@
42#include <linux/of_fdt.h> 42#include <linux/of_fdt.h>
43#include <linux/of_platform.h> 43#include <linux/of_platform.h>
44 44
45#include <asm/fixmap.h>
45#include <asm/cputype.h> 46#include <asm/cputype.h>
46#include <asm/elf.h> 47#include <asm/elf.h>
47#include <asm/cputable.h> 48#include <asm/cputable.h>
@@ -360,6 +361,9 @@ void __init setup_arch(char **cmdline_p)
360 361
361 *cmdline_p = boot_command_line; 362 *cmdline_p = boot_command_line;
362 363
364 init_mem_pgprot();
365 early_ioremap_init();
366
363 parse_early_param(); 367 parse_early_param();
364 368
365 arm64_memblock_init(); 369 arm64_memblock_init();
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
index 02e9d09e1d80..03244582bc55 100644
--- a/arch/arm64/kvm/sys_regs.c
+++ b/arch/arm64/kvm/sys_regs.c
@@ -27,6 +27,7 @@
27#include <asm/kvm_host.h> 27#include <asm/kvm_host.h>
28#include <asm/kvm_emulate.h> 28#include <asm/kvm_emulate.h>
29#include <asm/kvm_coproc.h> 29#include <asm/kvm_coproc.h>
30#include <asm/kvm_mmu.h>
30#include <asm/cacheflush.h> 31#include <asm/cacheflush.h>
31#include <asm/cputype.h> 32#include <asm/cputype.h>
32#include <trace/events/kvm.h> 33#include <trace/events/kvm.h>
@@ -121,6 +122,48 @@ done:
121} 122}
122 123
123/* 124/*
125 * Generic accessor for VM registers. Only called as long as HCR_TVM
126 * is set.
127 */
128static bool access_vm_reg(struct kvm_vcpu *vcpu,
129 const struct sys_reg_params *p,
130 const struct sys_reg_desc *r)
131{
132 unsigned long val;
133
134 BUG_ON(!p->is_write);
135
136 val = *vcpu_reg(vcpu, p->Rt);
137 if (!p->is_aarch32) {
138 vcpu_sys_reg(vcpu, r->reg) = val;
139 } else {
140 vcpu_cp15(vcpu, r->reg) = val & 0xffffffffUL;
141 if (!p->is_32bit)
142 vcpu_cp15(vcpu, r->reg + 1) = val >> 32;
143 }
144 return true;
145}
146
147/*
148 * SCTLR_EL1 accessor. Only called as long as HCR_TVM is set. If the
149 * guest enables the MMU, we stop trapping the VM sys_regs and leave
150 * it in complete control of the caches.
151 */
152static bool access_sctlr(struct kvm_vcpu *vcpu,
153 const struct sys_reg_params *p,
154 const struct sys_reg_desc *r)
155{
156 access_vm_reg(vcpu, p, r);
157
158 if (vcpu_has_cache_enabled(vcpu)) { /* MMU+Caches enabled? */
159 vcpu->arch.hcr_el2 &= ~HCR_TVM;
160 stage2_flush_vm(vcpu->kvm);
161 }
162
163 return true;
164}
165
166/*
124 * We could trap ID_DFR0 and tell the guest we don't support performance 167 * We could trap ID_DFR0 and tell the guest we don't support performance
125 * monitoring. Unfortunately the patch to make the kernel check ID_DFR0 was 168 * monitoring. Unfortunately the patch to make the kernel check ID_DFR0 was
126 * NAKed, so it will read the PMCR anyway. 169 * NAKed, so it will read the PMCR anyway.
@@ -185,32 +228,32 @@ static const struct sys_reg_desc sys_reg_descs[] = {
185 NULL, reset_mpidr, MPIDR_EL1 }, 228 NULL, reset_mpidr, MPIDR_EL1 },
186 /* SCTLR_EL1 */ 229 /* SCTLR_EL1 */
187 { Op0(0b11), Op1(0b000), CRn(0b0001), CRm(0b0000), Op2(0b000), 230 { Op0(0b11), Op1(0b000), CRn(0b0001), CRm(0b0000), Op2(0b000),
188 NULL, reset_val, SCTLR_EL1, 0x00C50078 }, 231 access_sctlr, reset_val, SCTLR_EL1, 0x00C50078 },
189 /* CPACR_EL1 */ 232 /* CPACR_EL1 */
190 { Op0(0b11), Op1(0b000), CRn(0b0001), CRm(0b0000), Op2(0b010), 233 { Op0(0b11), Op1(0b000), CRn(0b0001), CRm(0b0000), Op2(0b010),
191 NULL, reset_val, CPACR_EL1, 0 }, 234 NULL, reset_val, CPACR_EL1, 0 },
192 /* TTBR0_EL1 */ 235 /* TTBR0_EL1 */
193 { Op0(0b11), Op1(0b000), CRn(0b0010), CRm(0b0000), Op2(0b000), 236 { Op0(0b11), Op1(0b000), CRn(0b0010), CRm(0b0000), Op2(0b000),
194 NULL, reset_unknown, TTBR0_EL1 }, 237 access_vm_reg, reset_unknown, TTBR0_EL1 },
195 /* TTBR1_EL1 */ 238 /* TTBR1_EL1 */
196 { Op0(0b11), Op1(0b000), CRn(0b0010), CRm(0b0000), Op2(0b001), 239 { Op0(0b11), Op1(0b000), CRn(0b0010), CRm(0b0000), Op2(0b001),
197 NULL, reset_unknown, TTBR1_EL1 }, 240 access_vm_reg, reset_unknown, TTBR1_EL1 },
198 /* TCR_EL1 */ 241 /* TCR_EL1 */
199 { Op0(0b11), Op1(0b000), CRn(0b0010), CRm(0b0000), Op2(0b010), 242 { Op0(0b11), Op1(0b000), CRn(0b0010), CRm(0b0000), Op2(0b010),
200 NULL, reset_val, TCR_EL1, 0 }, 243 access_vm_reg, reset_val, TCR_EL1, 0 },
201 244
202 /* AFSR0_EL1 */ 245 /* AFSR0_EL1 */
203 { Op0(0b11), Op1(0b000), CRn(0b0101), CRm(0b0001), Op2(0b000), 246 { Op0(0b11), Op1(0b000), CRn(0b0101), CRm(0b0001), Op2(0b000),
204 NULL, reset_unknown, AFSR0_EL1 }, 247 access_vm_reg, reset_unknown, AFSR0_EL1 },
205 /* AFSR1_EL1 */ 248 /* AFSR1_EL1 */
206 { Op0(0b11), Op1(0b000), CRn(0b0101), CRm(0b0001), Op2(0b001), 249 { Op0(0b11), Op1(0b000), CRn(0b0101), CRm(0b0001), Op2(0b001),
207 NULL, reset_unknown, AFSR1_EL1 }, 250 access_vm_reg, reset_unknown, AFSR1_EL1 },
208 /* ESR_EL1 */ 251 /* ESR_EL1 */
209 { Op0(0b11), Op1(0b000), CRn(0b0101), CRm(0b0010), Op2(0b000), 252 { Op0(0b11), Op1(0b000), CRn(0b0101), CRm(0b0010), Op2(0b000),
210 NULL, reset_unknown, ESR_EL1 }, 253 access_vm_reg, reset_unknown, ESR_EL1 },
211 /* FAR_EL1 */ 254 /* FAR_EL1 */
212 { Op0(0b11), Op1(0b000), CRn(0b0110), CRm(0b0000), Op2(0b000), 255 { Op0(0b11), Op1(0b000), CRn(0b0110), CRm(0b0000), Op2(0b000),
213 NULL, reset_unknown, FAR_EL1 }, 256 access_vm_reg, reset_unknown, FAR_EL1 },
214 /* PAR_EL1 */ 257 /* PAR_EL1 */
215 { Op0(0b11), Op1(0b000), CRn(0b0111), CRm(0b0100), Op2(0b000), 258 { Op0(0b11), Op1(0b000), CRn(0b0111), CRm(0b0100), Op2(0b000),
216 NULL, reset_unknown, PAR_EL1 }, 259 NULL, reset_unknown, PAR_EL1 },
@@ -224,17 +267,17 @@ static const struct sys_reg_desc sys_reg_descs[] = {
224 267
225 /* MAIR_EL1 */ 268 /* MAIR_EL1 */
226 { Op0(0b11), Op1(0b000), CRn(0b1010), CRm(0b0010), Op2(0b000), 269 { Op0(0b11), Op1(0b000), CRn(0b1010), CRm(0b0010), Op2(0b000),
227 NULL, reset_unknown, MAIR_EL1 }, 270 access_vm_reg, reset_unknown, MAIR_EL1 },
228 /* AMAIR_EL1 */ 271 /* AMAIR_EL1 */
229 { Op0(0b11), Op1(0b000), CRn(0b1010), CRm(0b0011), Op2(0b000), 272 { Op0(0b11), Op1(0b000), CRn(0b1010), CRm(0b0011), Op2(0b000),
230 NULL, reset_amair_el1, AMAIR_EL1 }, 273 access_vm_reg, reset_amair_el1, AMAIR_EL1 },
231 274
232 /* VBAR_EL1 */ 275 /* VBAR_EL1 */
233 { Op0(0b11), Op1(0b000), CRn(0b1100), CRm(0b0000), Op2(0b000), 276 { Op0(0b11), Op1(0b000), CRn(0b1100), CRm(0b0000), Op2(0b000),
234 NULL, reset_val, VBAR_EL1, 0 }, 277 NULL, reset_val, VBAR_EL1, 0 },
235 /* CONTEXTIDR_EL1 */ 278 /* CONTEXTIDR_EL1 */
236 { Op0(0b11), Op1(0b000), CRn(0b1101), CRm(0b0000), Op2(0b001), 279 { Op0(0b11), Op1(0b000), CRn(0b1101), CRm(0b0000), Op2(0b001),
237 NULL, reset_val, CONTEXTIDR_EL1, 0 }, 280 access_vm_reg, reset_val, CONTEXTIDR_EL1, 0 },
238 /* TPIDR_EL1 */ 281 /* TPIDR_EL1 */
239 { Op0(0b11), Op1(0b000), CRn(0b1101), CRm(0b0000), Op2(0b100), 282 { Op0(0b11), Op1(0b000), CRn(0b1101), CRm(0b0000), Op2(0b100),
240 NULL, reset_unknown, TPIDR_EL1 }, 283 NULL, reset_unknown, TPIDR_EL1 },
@@ -305,14 +348,32 @@ static const struct sys_reg_desc sys_reg_descs[] = {
305 NULL, reset_val, FPEXC32_EL2, 0x70 }, 348 NULL, reset_val, FPEXC32_EL2, 0x70 },
306}; 349};
307 350
308/* Trapped cp15 registers */ 351/*
352 * Trapped cp15 registers. TTBR0/TTBR1 get a double encoding,
353 * depending on the way they are accessed (as a 32bit or a 64bit
354 * register).
355 */
309static const struct sys_reg_desc cp15_regs[] = { 356static const struct sys_reg_desc cp15_regs[] = {
357 { Op1( 0), CRn( 0), CRm( 2), Op2( 0), access_vm_reg, NULL, c2_TTBR0 },
358 { Op1( 0), CRn( 1), CRm( 0), Op2( 0), access_sctlr, NULL, c1_SCTLR },
359 { Op1( 0), CRn( 2), CRm( 0), Op2( 0), access_vm_reg, NULL, c2_TTBR0 },
360 { Op1( 0), CRn( 2), CRm( 0), Op2( 1), access_vm_reg, NULL, c2_TTBR1 },
361 { Op1( 0), CRn( 2), CRm( 0), Op2( 2), access_vm_reg, NULL, c2_TTBCR },
362 { Op1( 0), CRn( 3), CRm( 0), Op2( 0), access_vm_reg, NULL, c3_DACR },
363 { Op1( 0), CRn( 5), CRm( 0), Op2( 0), access_vm_reg, NULL, c5_DFSR },
364 { Op1( 0), CRn( 5), CRm( 0), Op2( 1), access_vm_reg, NULL, c5_IFSR },
365 { Op1( 0), CRn( 5), CRm( 1), Op2( 0), access_vm_reg, NULL, c5_ADFSR },
366 { Op1( 0), CRn( 5), CRm( 1), Op2( 1), access_vm_reg, NULL, c5_AIFSR },
367 { Op1( 0), CRn( 6), CRm( 0), Op2( 0), access_vm_reg, NULL, c6_DFAR },
368 { Op1( 0), CRn( 6), CRm( 0), Op2( 2), access_vm_reg, NULL, c6_IFAR },
369
310 /* 370 /*
311 * DC{C,I,CI}SW operations: 371 * DC{C,I,CI}SW operations:
312 */ 372 */
313 { Op1( 0), CRn( 7), CRm( 6), Op2( 2), access_dcsw }, 373 { Op1( 0), CRn( 7), CRm( 6), Op2( 2), access_dcsw },
314 { Op1( 0), CRn( 7), CRm(10), Op2( 2), access_dcsw }, 374 { Op1( 0), CRn( 7), CRm(10), Op2( 2), access_dcsw },
315 { Op1( 0), CRn( 7), CRm(14), Op2( 2), access_dcsw }, 375 { Op1( 0), CRn( 7), CRm(14), Op2( 2), access_dcsw },
376
316 { Op1( 0), CRn( 9), CRm(12), Op2( 0), pm_fake }, 377 { Op1( 0), CRn( 9), CRm(12), Op2( 0), pm_fake },
317 { Op1( 0), CRn( 9), CRm(12), Op2( 1), pm_fake }, 378 { Op1( 0), CRn( 9), CRm(12), Op2( 1), pm_fake },
318 { Op1( 0), CRn( 9), CRm(12), Op2( 2), pm_fake }, 379 { Op1( 0), CRn( 9), CRm(12), Op2( 2), pm_fake },
@@ -326,6 +387,14 @@ static const struct sys_reg_desc cp15_regs[] = {
326 { Op1( 0), CRn( 9), CRm(14), Op2( 0), pm_fake }, 387 { Op1( 0), CRn( 9), CRm(14), Op2( 0), pm_fake },
327 { Op1( 0), CRn( 9), CRm(14), Op2( 1), pm_fake }, 388 { Op1( 0), CRn( 9), CRm(14), Op2( 1), pm_fake },
328 { Op1( 0), CRn( 9), CRm(14), Op2( 2), pm_fake }, 389 { Op1( 0), CRn( 9), CRm(14), Op2( 2), pm_fake },
390
391 { Op1( 0), CRn(10), CRm( 2), Op2( 0), access_vm_reg, NULL, c10_PRRR },
392 { Op1( 0), CRn(10), CRm( 2), Op2( 1), access_vm_reg, NULL, c10_NMRR },
393 { Op1( 0), CRn(10), CRm( 3), Op2( 0), access_vm_reg, NULL, c10_AMAIR0 },
394 { Op1( 0), CRn(10), CRm( 3), Op2( 1), access_vm_reg, NULL, c10_AMAIR1 },
395 { Op1( 0), CRn(13), CRm( 0), Op2( 1), access_vm_reg, NULL, c13_CID },
396
397 { Op1( 1), CRn( 0), CRm( 2), Op2( 0), access_vm_reg, NULL, c2_TTBR1 },
329}; 398};
330 399
331/* Target specific emulation tables */ 400/* Target specific emulation tables */
@@ -437,6 +506,8 @@ int kvm_handle_cp15_64(struct kvm_vcpu *vcpu, struct kvm_run *run)
437 u32 hsr = kvm_vcpu_get_hsr(vcpu); 506 u32 hsr = kvm_vcpu_get_hsr(vcpu);
438 int Rt2 = (hsr >> 10) & 0xf; 507 int Rt2 = (hsr >> 10) & 0xf;
439 508
509 params.is_aarch32 = true;
510 params.is_32bit = false;
440 params.CRm = (hsr >> 1) & 0xf; 511 params.CRm = (hsr >> 1) & 0xf;
441 params.Rt = (hsr >> 5) & 0xf; 512 params.Rt = (hsr >> 5) & 0xf;
442 params.is_write = ((hsr & 1) == 0); 513 params.is_write = ((hsr & 1) == 0);
@@ -480,6 +551,8 @@ int kvm_handle_cp15_32(struct kvm_vcpu *vcpu, struct kvm_run *run)
480 struct sys_reg_params params; 551 struct sys_reg_params params;
481 u32 hsr = kvm_vcpu_get_hsr(vcpu); 552 u32 hsr = kvm_vcpu_get_hsr(vcpu);
482 553
554 params.is_aarch32 = true;
555 params.is_32bit = true;
483 params.CRm = (hsr >> 1) & 0xf; 556 params.CRm = (hsr >> 1) & 0xf;
484 params.Rt = (hsr >> 5) & 0xf; 557 params.Rt = (hsr >> 5) & 0xf;
485 params.is_write = ((hsr & 1) == 0); 558 params.is_write = ((hsr & 1) == 0);
@@ -549,6 +622,8 @@ int kvm_handle_sys_reg(struct kvm_vcpu *vcpu, struct kvm_run *run)
549 struct sys_reg_params params; 622 struct sys_reg_params params;
550 unsigned long esr = kvm_vcpu_get_hsr(vcpu); 623 unsigned long esr = kvm_vcpu_get_hsr(vcpu);
551 624
625 params.is_aarch32 = false;
626 params.is_32bit = false;
552 params.Op0 = (esr >> 20) & 3; 627 params.Op0 = (esr >> 20) & 3;
553 params.Op1 = (esr >> 14) & 0x7; 628 params.Op1 = (esr >> 14) & 0x7;
554 params.CRn = (esr >> 10) & 0xf; 629 params.CRn = (esr >> 10) & 0xf;
diff --git a/arch/arm64/kvm/sys_regs.h b/arch/arm64/kvm/sys_regs.h
index d50d3722998e..d411e251412c 100644
--- a/arch/arm64/kvm/sys_regs.h
+++ b/arch/arm64/kvm/sys_regs.h
@@ -30,6 +30,8 @@ struct sys_reg_params {
30 u8 Op2; 30 u8 Op2;
31 u8 Rt; 31 u8 Rt;
32 bool is_write; 32 bool is_write;
33 bool is_aarch32;
34 bool is_32bit; /* Only valid if is_aarch32 is true */
33}; 35};
34 36
35struct sys_reg_desc { 37struct sys_reg_desc {
diff --git a/arch/arm64/mm/cache.S b/arch/arm64/mm/cache.S
index c46f48b33c14..fda756875fa6 100644
--- a/arch/arm64/mm/cache.S
+++ b/arch/arm64/mm/cache.S
@@ -168,6 +168,14 @@ ENTRY(__flush_dcache_area)
168ENDPROC(__flush_dcache_area) 168ENDPROC(__flush_dcache_area)
169 169
170/* 170/*
171 * __inval_cache_range(start, end)
172 * - start - start address of region
173 * - end - end address of region
174 */
175ENTRY(__inval_cache_range)
176 /* FALLTHROUGH */
177
178/*
171 * __dma_inv_range(start, end) 179 * __dma_inv_range(start, end)
172 * - start - virtual start address of region 180 * - start - virtual start address of region
173 * - end - virtual end address of region 181 * - end - virtual end address of region
@@ -175,14 +183,22 @@ ENDPROC(__flush_dcache_area)
175__dma_inv_range: 183__dma_inv_range:
176 dcache_line_size x2, x3 184 dcache_line_size x2, x3
177 sub x3, x2, #1 185 sub x3, x2, #1
178 bic x0, x0, x3 186 tst x1, x3 // end cache line aligned?
179 bic x1, x1, x3 187 bic x1, x1, x3
1801: dc ivac, x0 // invalidate D / U line 188 b.eq 1f
181 add x0, x0, x2 189 dc civac, x1 // clean & invalidate D / U line
1901: tst x0, x3 // start cache line aligned?
191 bic x0, x0, x3
192 b.eq 2f
193 dc civac, x0 // clean & invalidate D / U line
194 b 3f
1952: dc ivac, x0 // invalidate D / U line
1963: add x0, x0, x2
182 cmp x0, x1 197 cmp x0, x1
183 b.lo 1b 198 b.lo 2b
184 dsb sy 199 dsb sy
185 ret 200 ret
201ENDPROC(__inval_cache_range)
186ENDPROC(__dma_inv_range) 202ENDPROC(__dma_inv_range)
187 203
188/* 204/*
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 88627c450a6c..51d5352e6ad5 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -161,6 +161,7 @@ void __init arm64_memblock_init(void)
161 memblock_reserve(base, size); 161 memblock_reserve(base, size);
162 } 162 }
163 163
164 early_init_fdt_scan_reserved_mem();
164 dma_contiguous_reserve(0); 165 dma_contiguous_reserve(0);
165 166
166 memblock_allow_resize(); 167 memblock_allow_resize();
diff --git a/arch/arm64/mm/ioremap.c b/arch/arm64/mm/ioremap.c
index 2bb1d586664c..7ec328392ae0 100644
--- a/arch/arm64/mm/ioremap.c
+++ b/arch/arm64/mm/ioremap.c
@@ -25,6 +25,10 @@
25#include <linux/vmalloc.h> 25#include <linux/vmalloc.h>
26#include <linux/io.h> 26#include <linux/io.h>
27 27
28#include <asm/fixmap.h>
29#include <asm/tlbflush.h>
30#include <asm/pgalloc.h>
31
28static void __iomem *__ioremap_caller(phys_addr_t phys_addr, size_t size, 32static void __iomem *__ioremap_caller(phys_addr_t phys_addr, size_t size,
29 pgprot_t prot, void *caller) 33 pgprot_t prot, void *caller)
30{ 34{
@@ -98,3 +102,84 @@ void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size)
98 __builtin_return_address(0)); 102 __builtin_return_address(0));
99} 103}
100EXPORT_SYMBOL(ioremap_cache); 104EXPORT_SYMBOL(ioremap_cache);
105
106#ifndef CONFIG_ARM64_64K_PAGES
107static pte_t bm_pte[PTRS_PER_PTE] __page_aligned_bss;
108#endif
109
110static inline pmd_t * __init early_ioremap_pmd(unsigned long addr)
111{
112 pgd_t *pgd;
113 pud_t *pud;
114
115 pgd = pgd_offset_k(addr);
116 BUG_ON(pgd_none(*pgd) || pgd_bad(*pgd));
117
118 pud = pud_offset(pgd, addr);
119 BUG_ON(pud_none(*pud) || pud_bad(*pud));
120
121 return pmd_offset(pud, addr);
122}
123
124static inline pte_t * __init early_ioremap_pte(unsigned long addr)
125{
126 pmd_t *pmd = early_ioremap_pmd(addr);
127
128 BUG_ON(pmd_none(*pmd) || pmd_bad(*pmd));
129
130 return pte_offset_kernel(pmd, addr);
131}
132
133void __init early_ioremap_init(void)
134{
135 pmd_t *pmd;
136
137 pmd = early_ioremap_pmd(fix_to_virt(FIX_BTMAP_BEGIN));
138#ifndef CONFIG_ARM64_64K_PAGES
139 /* need to populate pmd for 4k pagesize only */
140 pmd_populate_kernel(&init_mm, pmd, bm_pte);
141#endif
142 /*
143 * The boot-ioremap range spans multiple pmds, for which
144 * we are not prepared:
145 */
146 BUILD_BUG_ON((__fix_to_virt(FIX_BTMAP_BEGIN) >> PMD_SHIFT)
147 != (__fix_to_virt(FIX_BTMAP_END) >> PMD_SHIFT));
148
149 if (pmd != early_ioremap_pmd(fix_to_virt(FIX_BTMAP_END))) {
150 WARN_ON(1);
151 pr_warn("pmd %p != %p\n",
152 pmd, early_ioremap_pmd(fix_to_virt(FIX_BTMAP_END)));
153 pr_warn("fix_to_virt(FIX_BTMAP_BEGIN): %08lx\n",
154 fix_to_virt(FIX_BTMAP_BEGIN));
155 pr_warn("fix_to_virt(FIX_BTMAP_END): %08lx\n",
156 fix_to_virt(FIX_BTMAP_END));
157
158 pr_warn("FIX_BTMAP_END: %d\n", FIX_BTMAP_END);
159 pr_warn("FIX_BTMAP_BEGIN: %d\n",
160 FIX_BTMAP_BEGIN);
161 }
162
163 early_ioremap_setup();
164}
165
166void __init __early_set_fixmap(enum fixed_addresses idx,
167 phys_addr_t phys, pgprot_t flags)
168{
169 unsigned long addr = __fix_to_virt(idx);
170 pte_t *pte;
171
172 if (idx >= __end_of_fixed_addresses) {
173 BUG();
174 return;
175 }
176
177 pte = early_ioremap_pte(addr);
178
179 if (pgprot_val(flags))
180 set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, flags));
181 else {
182 pte_clear(&init_mm, addr, pte);
183 flush_tlb_kernel_range(addr, addr+PAGE_SIZE);
184 }
185}
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index f8dc7e8fce6f..6b7e89569a3a 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -125,7 +125,7 @@ early_param("cachepolicy", early_cachepolicy);
125/* 125/*
126 * Adjust the PMD section entries according to the CPU in use. 126 * Adjust the PMD section entries according to the CPU in use.
127 */ 127 */
128static void __init init_mem_pgprot(void) 128void __init init_mem_pgprot(void)
129{ 129{
130 pteval_t default_pgprot; 130 pteval_t default_pgprot;
131 int i; 131 int i;
@@ -260,47 +260,6 @@ static void __init create_mapping(phys_addr_t phys, unsigned long virt,
260 } while (pgd++, addr = next, addr != end); 260 } while (pgd++, addr = next, addr != end);
261} 261}
262 262
263#ifdef CONFIG_EARLY_PRINTK
264/*
265 * Create an early I/O mapping using the pgd/pmd entries already populated
266 * in head.S as this function is called too early to allocated any memory. The
267 * mapping size is 2MB with 4KB pages or 64KB or 64KB pages.
268 */
269void __iomem * __init early_io_map(phys_addr_t phys, unsigned long virt)
270{
271 unsigned long size, mask;
272 bool page64k = IS_ENABLED(CONFIG_ARM64_64K_PAGES);
273 pgd_t *pgd;
274 pud_t *pud;
275 pmd_t *pmd;
276 pte_t *pte;
277
278 /*
279 * No early pte entries with !ARM64_64K_PAGES configuration, so using
280 * sections (pmd).
281 */
282 size = page64k ? PAGE_SIZE : SECTION_SIZE;
283 mask = ~(size - 1);
284
285 pgd = pgd_offset_k(virt);
286 pud = pud_offset(pgd, virt);
287 if (pud_none(*pud))
288 return NULL;
289 pmd = pmd_offset(pud, virt);
290
291 if (page64k) {
292 if (pmd_none(*pmd))
293 return NULL;
294 pte = pte_offset_kernel(pmd, virt);
295 set_pte(pte, __pte((phys & mask) | PROT_DEVICE_nGnRE));
296 } else {
297 set_pmd(pmd, __pmd((phys & mask) | PROT_SECT_DEVICE_nGnRE));
298 }
299
300 return (void __iomem *)((virt & mask) + (phys & ~mask));
301}
302#endif
303
304static void __init map_mem(void) 263static void __init map_mem(void)
305{ 264{
306 struct memblock_region *reg; 265 struct memblock_region *reg;
@@ -357,7 +316,6 @@ void __init paging_init(void)
357{ 316{
358 void *zero_page; 317 void *zero_page;
359 318
360 init_mem_pgprot();
361 map_mem(); 319 map_mem();
362 320
363 /* 321 /*
diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S
index e085ee6ef4e2..9042aff5e9e3 100644
--- a/arch/arm64/mm/proc.S
+++ b/arch/arm64/mm/proc.S
@@ -28,14 +28,21 @@
28 28
29#include "proc-macros.S" 29#include "proc-macros.S"
30 30
31#ifndef CONFIG_SMP 31#ifdef CONFIG_ARM64_64K_PAGES
32/* PTWs cacheable, inner/outer WBWA not shareable */ 32#define TCR_TG_FLAGS TCR_TG0_64K | TCR_TG1_64K
33#define TCR_FLAGS TCR_IRGN_WBWA | TCR_ORGN_WBWA 33#else
34#define TCR_TG_FLAGS TCR_TG0_4K | TCR_TG1_4K
35#endif
36
37#ifdef CONFIG_SMP
38#define TCR_SMP_FLAGS TCR_SHARED
34#else 39#else
35/* PTWs cacheable, inner/outer WBWA shareable */ 40#define TCR_SMP_FLAGS 0
36#define TCR_FLAGS TCR_IRGN_WBWA | TCR_ORGN_WBWA | TCR_SHARED
37#endif 41#endif
38 42
43/* PTWs cacheable, inner/outer WBWA */
44#define TCR_CACHE_FLAGS TCR_IRGN_WBWA | TCR_ORGN_WBWA
45
39#define MAIR(attr, mt) ((attr) << ((mt) * 8)) 46#define MAIR(attr, mt) ((attr) << ((mt) * 8))
40 47
41/* 48/*
@@ -209,18 +216,14 @@ ENTRY(__cpu_setup)
209 * Set/prepare TCR and TTBR. We use 512GB (39-bit) address range for 216 * Set/prepare TCR and TTBR. We use 512GB (39-bit) address range for
210 * both user and kernel. 217 * both user and kernel.
211 */ 218 */
212 ldr x10, =TCR_TxSZ(VA_BITS) | TCR_FLAGS | \ 219 ldr x10, =TCR_TxSZ(VA_BITS) | TCR_CACHE_FLAGS | TCR_SMP_FLAGS | \
213 TCR_ASID16 | TCR_TBI0 | (1 << 31) 220 TCR_TG_FLAGS | TCR_ASID16 | TCR_TBI0
214 /* 221 /*
215 * Read the PARange bits from ID_AA64MMFR0_EL1 and set the IPS bits in 222 * Read the PARange bits from ID_AA64MMFR0_EL1 and set the IPS bits in
216 * TCR_EL1. 223 * TCR_EL1.
217 */ 224 */
218 mrs x9, ID_AA64MMFR0_EL1 225 mrs x9, ID_AA64MMFR0_EL1
219 bfi x10, x9, #32, #3 226 bfi x10, x9, #32, #3
220#ifdef CONFIG_ARM64_64K_PAGES
221 orr x10, x10, TCR_TG0_64K
222 orr x10, x10, TCR_TG1_64K
223#endif
224 msr tcr_el1, x10 227 msr tcr_el1, x10
225 ret // return to head.S 228 ret // return to head.S
226ENDPROC(__cpu_setup) 229ENDPROC(__cpu_setup)
diff --git a/arch/avr32/boards/mimc200/Makefile b/arch/avr32/boards/mimc200/Makefile
index 79c076e168a8..c740aa116755 100644
--- a/arch/avr32/boards/mimc200/Makefile
+++ b/arch/avr32/boards/mimc200/Makefile
@@ -1 +1 @@
obj-y += setup.o flash.o fram.o obj-y += setup.o flash.o
diff --git a/arch/avr32/boards/mimc200/fram.c b/arch/avr32/boards/mimc200/fram.c
deleted file mode 100644
index c1466a872b9c..000000000000
--- a/arch/avr32/boards/mimc200/fram.c
+++ /dev/null
@@ -1,82 +0,0 @@
1/*
2 * FRAM driver for MIMC200 board
3 *
4 * Copyright 2008 Mark Jackson <mpfj@mimc.co.uk>
5 *
6 * This module adds *very* simply support for the system's FRAM device.
7 * At the moment, this is hard-coded to the MIMC200 platform, and only
8 * supports mmap().
9 */
10
11#define FRAM_VERSION "1.0"
12
13#include <linux/miscdevice.h>
14#include <linux/module.h>
15#include <linux/proc_fs.h>
16#include <linux/mm.h>
17#include <linux/io.h>
18
19#define FRAM_BASE 0xac000000
20#define FRAM_SIZE 0x20000
21
22/*
23 * The are the file operation function for user access to /dev/fram
24 */
25
26static int fram_mmap(struct file *filp, struct vm_area_struct *vma)
27{
28 int ret;
29
30 ret = remap_pfn_range(vma,
31 vma->vm_start,
32 virt_to_phys((void *)((unsigned long)FRAM_BASE)) >> PAGE_SHIFT,
33 vma->vm_end-vma->vm_start,
34 PAGE_SHARED);
35
36 if (ret != 0)
37 return -EAGAIN;
38
39 return 0;
40}
41
42static const struct file_operations fram_fops = {
43 .owner = THIS_MODULE,
44 .mmap = fram_mmap,
45 .llseek = noop_llseek,
46};
47
48#define FRAM_MINOR 0
49
50static struct miscdevice fram_dev = {
51 FRAM_MINOR,
52 "fram",
53 &fram_fops
54};
55
56static int __init
57fram_init(void)
58{
59 int ret;
60
61 ret = misc_register(&fram_dev);
62 if (ret) {
63 printk(KERN_ERR "fram: can't misc_register on minor=%d\n",
64 FRAM_MINOR);
65 return ret;
66 }
67 printk(KERN_INFO "FRAM memory driver v" FRAM_VERSION "\n");
68 return 0;
69}
70
71static void __exit
72fram_cleanup_module(void)
73{
74 misc_deregister(&fram_dev);
75}
76
77module_init(fram_init);
78module_exit(fram_cleanup_module);
79
80MODULE_LICENSE("GPL");
81
82MODULE_ALIAS_MISCDEV(FRAM_MINOR);
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 9ceccef9c649..f81e7b989fff 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -34,6 +34,7 @@ config BLACKFIN
34 select ARCH_WANT_IPC_PARSE_VERSION 34 select ARCH_WANT_IPC_PARSE_VERSION
35 select GENERIC_ATOMIC64 35 select GENERIC_ATOMIC64
36 select GENERIC_IRQ_PROBE 36 select GENERIC_IRQ_PROBE
37 select GENERIC_IRQ_SHOW
37 select HAVE_NMI_WATCHDOG if NMI_WATCHDOG 38 select HAVE_NMI_WATCHDOG if NMI_WATCHDOG
38 select GENERIC_SMP_IDLE_THREAD 39 select GENERIC_SMP_IDLE_THREAD
39 select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS 40 select ARCH_USES_GETTIMEOFFSET if !GENERIC_CLOCKEVENTS
@@ -51,9 +52,6 @@ config GENERIC_BUG
51config ZONE_DMA 52config ZONE_DMA
52 def_bool y 53 def_bool y
53 54
54config GENERIC_GPIO
55 def_bool y
56
57config FORCE_MAX_ZONEORDER 55config FORCE_MAX_ZONEORDER
58 int 56 int
59 default "14" 57 default "14"
@@ -870,14 +868,6 @@ config SYS_BFIN_SPINLOCK_L1
870 If enabled, sys_bfin_spinlock function is linked 868 If enabled, sys_bfin_spinlock function is linked
871 into L1 instruction memory. (less latency) 869 into L1 instruction memory. (less latency)
872 870
873config IP_CHECKSUM_L1
874 bool "Locate IP Checksum function in L1 Memory"
875 default n
876 depends on !SMP
877 help
878 If enabled, the IP Checksum function is linked
879 into L1 instruction memory. (less latency)
880
881config CACHELINE_ALIGNED_L1 871config CACHELINE_ALIGNED_L1
882 bool "Locate cacheline_aligned data to L1 Data Memory" 872 bool "Locate cacheline_aligned data to L1 Data Memory"
883 default y if !BF54x 873 default y if !BF54x
diff --git a/arch/blackfin/include/asm/bfin_crc.h b/arch/blackfin/include/asm/bfin_crc.h
deleted file mode 100644
index 75cef4dc85a1..000000000000
--- a/arch/blackfin/include/asm/bfin_crc.h
+++ /dev/null
@@ -1,125 +0,0 @@
1/*
2 * bfin_crc.h - interface to Blackfin CRC controllers
3 *
4 * Copyright 2012 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2 or later.
7 */
8
9#ifndef __BFIN_CRC_H__
10#define __BFIN_CRC_H__
11
12/* Function driver which use hardware crc must initialize the structure */
13struct crc_info {
14 /* Input data address */
15 unsigned char *in_addr;
16 /* Output data address */
17 unsigned char *out_addr;
18 /* Input or output bytes */
19 unsigned long datasize;
20 union {
21 /* CRC to compare with that of input buffer */
22 unsigned long crc_compare;
23 /* Value to compare with input data */
24 unsigned long val_verify;
25 /* Value to fill */
26 unsigned long val_fill;
27 };
28 /* Value to program the 32b CRC Polynomial */
29 unsigned long crc_poly;
30 union {
31 /* CRC calculated from the input data */
32 unsigned long crc_result;
33 /* First failed position to verify input data */
34 unsigned long pos_verify;
35 };
36 /* CRC mirror flags */
37 unsigned int bitmirr:1;
38 unsigned int bytmirr:1;
39 unsigned int w16swp:1;
40 unsigned int fdsel:1;
41 unsigned int rsltmirr:1;
42 unsigned int polymirr:1;
43 unsigned int cmpmirr:1;
44};
45
46/* Userspace interface */
47#define CRC_IOC_MAGIC 'C'
48#define CRC_IOC_CALC_CRC _IOWR('C', 0x01, unsigned int)
49#define CRC_IOC_MEMCPY_CRC _IOWR('C', 0x02, unsigned int)
50#define CRC_IOC_VERIFY_VAL _IOWR('C', 0x03, unsigned int)
51#define CRC_IOC_FILL_VAL _IOWR('C', 0x04, unsigned int)
52
53
54#ifdef __KERNEL__
55
56#include <linux/types.h>
57#include <linux/spinlock.h>
58#include <linux/miscdevice.h>
59
60struct crc_register {
61 u32 control;
62 u32 datacnt;
63 u32 datacntrld;
64 u32 __pad_1[2];
65 u32 compare;
66 u32 fillval;
67 u32 datafifo;
68 u32 intren;
69 u32 intrenset;
70 u32 intrenclr;
71 u32 poly;
72 u32 __pad_2[4];
73 u32 status;
74 u32 datacntcap;
75 u32 __pad_3;
76 u32 result;
77 u32 curresult;
78 u32 __pad_4[3];
79 u32 revid;
80};
81
82/* CRC_STATUS Masks */
83#define CMPERR 0x00000002 /* Compare error */
84#define DCNTEXP 0x00000010 /* datacnt register expired */
85#define IBR 0x00010000 /* Input buffer ready */
86#define OBR 0x00020000 /* Output buffer ready */
87#define IRR 0x00040000 /* Immediate result readt */
88#define LUTDONE 0x00080000 /* Look-up table generation done */
89#define FSTAT 0x00700000 /* FIFO status */
90#define MAX_FIFO 4 /* Max fifo size */
91
92/* CRC_CONTROL Masks */
93#define BLKEN 0x00000001 /* Block enable */
94#define OPMODE 0x000000F0 /* Operation mode */
95#define OPMODE_OFFSET 4 /* Operation mode mask offset*/
96#define MODE_DMACPY_CRC 1 /* MTM CRC compute and compare */
97#define MODE_DATA_FILL 2 /* MTM data fill */
98#define MODE_CALC_CRC 3 /* MSM CRC compute and compare */
99#define MODE_DATA_VERIFY 4 /* MSM data verify */
100#define AUTOCLRZ 0x00000100 /* Auto clear to zero */
101#define AUTOCLRF 0x00000200 /* Auto clear to one */
102#define OBRSTALL 0x00001000 /* Stall on output buffer ready */
103#define IRRSTALL 0x00002000 /* Stall on immediate result ready */
104#define BITMIRR 0x00010000 /* Mirror bits within each byte of 32-bit input data */
105#define BITMIRR_OFFSET 16 /* Mirror bits offset */
106#define BYTMIRR 0x00020000 /* Mirror bytes of 32-bit input data */
107#define BYTMIRR_OFFSET 17 /* Mirror bytes offset */
108#define W16SWP 0x00040000 /* Mirror uppper and lower 16-bit word of 32-bit input data */
109#define W16SWP_OFFSET 18 /* Mirror 16-bit word offset */
110#define FDSEL 0x00080000 /* FIFO is written after input data is mirrored */
111#define FDSEL_OFFSET 19 /* Mirror FIFO offset */
112#define RSLTMIRR 0x00100000 /* CRC result registers are mirrored. */
113#define RSLTMIRR_OFFSET 20 /* Mirror CRC result offset. */
114#define POLYMIRR 0x00200000 /* CRC poly register is mirrored. */
115#define POLYMIRR_OFFSET 21 /* Mirror CRC poly offset. */
116#define CMPMIRR 0x00400000 /* CRC compare register is mirrored. */
117#define CMPMIRR_OFFSET 22 /* Mirror CRC compare offset. */
118
119/* CRC_INTREN Masks */
120#define CMPERRI 0x02 /* CRC_ERROR_INTR */
121#define DCNTEXPI 0x10 /* CRC_STATUS_INTR */
122
123#endif
124
125#endif
diff --git a/arch/blackfin/include/asm/bfin_twi.h b/arch/blackfin/include/asm/bfin_twi.h
index 90c3c006557d..aaa0834d34aa 100644
--- a/arch/blackfin/include/asm/bfin_twi.h
+++ b/arch/blackfin/include/asm/bfin_twi.h
@@ -9,60 +9,7 @@
9#ifndef __ASM_BFIN_TWI_H__ 9#ifndef __ASM_BFIN_TWI_H__
10#define __ASM_BFIN_TWI_H__ 10#define __ASM_BFIN_TWI_H__
11 11
12#include <linux/types.h> 12#include <asm/blackfin.h>
13#include <linux/i2c.h>
14
15/*
16 * All Blackfin system MMRs are padded to 32bits even if the register
17 * itself is only 16bits. So use a helper macro to streamline this.
18 */
19#define __BFP(m) u16 m; u16 __pad_##m
20
21/*
22 * bfin twi registers layout
23 */
24struct bfin_twi_regs {
25 __BFP(clkdiv);
26 __BFP(control);
27 __BFP(slave_ctl);
28 __BFP(slave_stat);
29 __BFP(slave_addr);
30 __BFP(master_ctl);
31 __BFP(master_stat);
32 __BFP(master_addr);
33 __BFP(int_stat);
34 __BFP(int_mask);
35 __BFP(fifo_ctl);
36 __BFP(fifo_stat);
37 u32 __pad[20];
38 __BFP(xmt_data8);
39 __BFP(xmt_data16);
40 __BFP(rcv_data8);
41 __BFP(rcv_data16);
42};
43
44#undef __BFP
45
46struct bfin_twi_iface {
47 int irq;
48 spinlock_t lock;
49 char read_write;
50 u8 command;
51 u8 *transPtr;
52 int readNum;
53 int writeNum;
54 int cur_mode;
55 int manual_stop;
56 int result;
57 struct i2c_adapter adap;
58 struct completion complete;
59 struct i2c_msg *pmsg;
60 int msg_num;
61 int cur_msg;
62 u16 saved_clkdiv;
63 u16 saved_control;
64 struct bfin_twi_regs __iomem *regs_base;
65};
66 13
67#define DEFINE_TWI_REG(reg_name, reg) \ 14#define DEFINE_TWI_REG(reg_name, reg) \
68static inline u16 read_##reg_name(struct bfin_twi_iface *iface) \ 15static inline u16 read_##reg_name(struct bfin_twi_iface *iface) \
@@ -71,7 +18,6 @@ static inline void write_##reg_name(struct bfin_twi_iface *iface, u16 v) \
71 { bfin_write16(&iface->regs_base->reg, v); } 18 { bfin_write16(&iface->regs_base->reg, v); }
72 19
73DEFINE_TWI_REG(CLKDIV, clkdiv) 20DEFINE_TWI_REG(CLKDIV, clkdiv)
74DEFINE_TWI_REG(CONTROL, control)
75DEFINE_TWI_REG(SLAVE_CTL, slave_ctl) 21DEFINE_TWI_REG(SLAVE_CTL, slave_ctl)
76DEFINE_TWI_REG(SLAVE_STAT, slave_stat) 22DEFINE_TWI_REG(SLAVE_STAT, slave_stat)
77DEFINE_TWI_REG(SLAVE_ADDR, slave_addr) 23DEFINE_TWI_REG(SLAVE_ADDR, slave_addr)
@@ -80,7 +26,6 @@ DEFINE_TWI_REG(MASTER_STAT, master_stat)
80DEFINE_TWI_REG(MASTER_ADDR, master_addr) 26DEFINE_TWI_REG(MASTER_ADDR, master_addr)
81DEFINE_TWI_REG(INT_STAT, int_stat) 27DEFINE_TWI_REG(INT_STAT, int_stat)
82DEFINE_TWI_REG(INT_MASK, int_mask) 28DEFINE_TWI_REG(INT_MASK, int_mask)
83DEFINE_TWI_REG(FIFO_CTL, fifo_ctl)
84DEFINE_TWI_REG(FIFO_STAT, fifo_stat) 29DEFINE_TWI_REG(FIFO_STAT, fifo_stat)
85DEFINE_TWI_REG(XMT_DATA8, xmt_data8) 30DEFINE_TWI_REG(XMT_DATA8, xmt_data8)
86DEFINE_TWI_REG(XMT_DATA16, xmt_data16) 31DEFINE_TWI_REG(XMT_DATA16, xmt_data16)
@@ -113,75 +58,25 @@ static inline u16 read_RCV_DATA16(struct bfin_twi_iface *iface)
113} 58}
114#endif 59#endif
115 60
61static inline u16 read_FIFO_CTL(struct bfin_twi_iface *iface)
62{
63 return bfin_read16(&iface->regs_base->fifo_ctl);
64}
116 65
117/* ******************** TWO-WIRE INTERFACE (TWI) MASKS ***********************/ 66static inline void write_FIFO_CTL(struct bfin_twi_iface *iface, u16 v)
118/* TWI_CLKDIV Macros (Use: *pTWI_CLKDIV = CLKLOW(x)|CLKHI(y); ) */ 67{
119#define CLKLOW(x) ((x) & 0xFF) /* Periods Clock Is Held Low */ 68 bfin_write16(&iface->regs_base->fifo_ctl, v);
120#define CLKHI(y) (((y)&0xFF)<<0x8) /* Periods Before New Clock Low */ 69 SSYNC();
121 70}
122/* TWI_PRESCALE Masks */
123#define PRESCALE 0x007F /* SCLKs Per Internal Time Reference (10MHz) */
124#define TWI_ENA 0x0080 /* TWI Enable */
125#define SCCB 0x0200 /* SCCB Compatibility Enable */
126
127/* TWI_SLAVE_CTL Masks */
128#define SEN 0x0001 /* Slave Enable */
129#define SADD_LEN 0x0002 /* Slave Address Length */
130#define STDVAL 0x0004 /* Slave Transmit Data Valid */
131#define NAK 0x0008 /* NAK/ACK* Generated At Conclusion Of Transfer */
132#define GEN 0x0010 /* General Call Address Matching Enabled */
133
134/* TWI_SLAVE_STAT Masks */
135#define SDIR 0x0001 /* Slave Transfer Direction (Transmit/Receive*) */
136#define GCALL 0x0002 /* General Call Indicator */
137
138/* TWI_MASTER_CTL Masks */
139#define MEN 0x0001 /* Master Mode Enable */
140#define MADD_LEN 0x0002 /* Master Address Length */
141#define MDIR 0x0004 /* Master Transmit Direction (RX/TX*) */
142#define FAST 0x0008 /* Use Fast Mode Timing Specs */
143#define STOP 0x0010 /* Issue Stop Condition */
144#define RSTART 0x0020 /* Repeat Start or Stop* At End Of Transfer */
145#define DCNT 0x3FC0 /* Data Bytes To Transfer */
146#define SDAOVR 0x4000 /* Serial Data Override */
147#define SCLOVR 0x8000 /* Serial Clock Override */
148
149/* TWI_MASTER_STAT Masks */
150#define MPROG 0x0001 /* Master Transfer In Progress */
151#define LOSTARB 0x0002 /* Lost Arbitration Indicator (Xfer Aborted) */
152#define ANAK 0x0004 /* Address Not Acknowledged */
153#define DNAK 0x0008 /* Data Not Acknowledged */
154#define BUFRDERR 0x0010 /* Buffer Read Error */
155#define BUFWRERR 0x0020 /* Buffer Write Error */
156#define SDASEN 0x0040 /* Serial Data Sense */
157#define SCLSEN 0x0080 /* Serial Clock Sense */
158#define BUSBUSY 0x0100 /* Bus Busy Indicator */
159
160/* TWI_INT_SRC and TWI_INT_ENABLE Masks */
161#define SINIT 0x0001 /* Slave Transfer Initiated */
162#define SCOMP 0x0002 /* Slave Transfer Complete */
163#define SERR 0x0004 /* Slave Transfer Error */
164#define SOVF 0x0008 /* Slave Overflow */
165#define MCOMP 0x0010 /* Master Transfer Complete */
166#define MERR 0x0020 /* Master Transfer Error */
167#define XMTSERV 0x0040 /* Transmit FIFO Service */
168#define RCVSERV 0x0080 /* Receive FIFO Service */
169
170/* TWI_FIFO_CTRL Masks */
171#define XMTFLUSH 0x0001 /* Transmit Buffer Flush */
172#define RCVFLUSH 0x0002 /* Receive Buffer Flush */
173#define XMTINTLEN 0x0004 /* Transmit Buffer Interrupt Length */
174#define RCVINTLEN 0x0008 /* Receive Buffer Interrupt Length */
175
176/* TWI_FIFO_STAT Masks */
177#define XMTSTAT 0x0003 /* Transmit FIFO Status */
178#define XMT_EMPTY 0x0000 /* Transmit FIFO Empty */
179#define XMT_HALF 0x0001 /* Transmit FIFO Has 1 Byte To Write */
180#define XMT_FULL 0x0003 /* Transmit FIFO Full (2 Bytes To Write) */
181 71
182#define RCVSTAT 0x000C /* Receive FIFO Status */ 72static inline u16 read_CONTROL(struct bfin_twi_iface *iface)
183#define RCV_EMPTY 0x0000 /* Receive FIFO Empty */ 73{
184#define RCV_HALF 0x0004 /* Receive FIFO Has 1 Byte To Read */ 74 return bfin_read16(&iface->regs_base->control);
185#define RCV_FULL 0x000C /* Receive FIFO Full (2 Bytes To Read) */ 75}
186 76
77static inline void write_CONTROL(struct bfin_twi_iface *iface, u16 v)
78{
79 SSYNC();
80 bfin_write16(&iface->regs_base->control, v);
81}
187#endif 82#endif
diff --git a/arch/blackfin/include/asm/dma.h b/arch/blackfin/include/asm/dma.h
index 40e9c2bbc6e3..8d1e4c2d2c36 100644
--- a/arch/blackfin/include/asm/dma.h
+++ b/arch/blackfin/include/asm/dma.h
@@ -316,8 +316,6 @@ static inline void disable_dma(unsigned int channel)
316} 316}
317static inline void enable_dma(unsigned int channel) 317static inline void enable_dma(unsigned int channel)
318{ 318{
319 dma_ch[channel].regs->curr_x_count = 0;
320 dma_ch[channel].regs->curr_y_count = 0;
321 dma_ch[channel].regs->cfg |= DMAEN; 319 dma_ch[channel].regs->cfg |= DMAEN;
322} 320}
323int set_dma_callback(unsigned int channel, irq_handler_t callback, void *data); 321int set_dma_callback(unsigned int channel, irq_handler_t callback, void *data);
diff --git a/arch/blackfin/include/asm/irq.h b/arch/blackfin/include/asm/irq.h
index 2fd04f10cc26..89de539ed010 100644
--- a/arch/blackfin/include/asm/irq.h
+++ b/arch/blackfin/include/asm/irq.h
@@ -20,15 +20,6 @@
20/* SYS_IRQS and NR_IRQS are defined in <mach-bf5xx/irq.h> */ 20/* SYS_IRQS and NR_IRQS are defined in <mach-bf5xx/irq.h> */
21#include <mach/irq.h> 21#include <mach/irq.h>
22 22
23/*
24 * pm save bfin pint registers
25 */
26struct adi_pm_pint_save {
27 u32 assign;
28 u32 edge_set;
29 u32 invert_set;
30};
31
32#if ANOMALY_05000244 && defined(CONFIG_BFIN_ICACHE) 23#if ANOMALY_05000244 && defined(CONFIG_BFIN_ICACHE)
33# define NOP_PAD_ANOMALY_05000244 "nop; nop;" 24# define NOP_PAD_ANOMALY_05000244 "nop; nop;"
34#else 25#else
diff --git a/arch/blackfin/include/asm/portmux.h b/arch/blackfin/include/asm/portmux.h
index 7aa20436e799..c8f0939419be 100644
--- a/arch/blackfin/include/asm/portmux.h
+++ b/arch/blackfin/include/asm/portmux.h
@@ -18,16 +18,14 @@
18#define P_DONTCARE 0x1000 18#define P_DONTCARE 0x1000
19 19
20#ifdef CONFIG_PINCTRL 20#ifdef CONFIG_PINCTRL
21#include <asm/irq_handler.h> 21int bfin_internal_set_wake(unsigned int irq, unsigned int state);
22 22
23#define gpio_pint_regs bfin_pint_regs 23#define gpio_pint_regs bfin_pint_regs
24#define adi_internal_set_wake bfin_internal_set_wake 24#define adi_internal_set_wake bfin_internal_set_wake
25 25
26#define peripheral_request(per, label) 0 26#define peripheral_request(per, label) (0)
27#define peripheral_free(per) 27#define peripheral_free(per)
28#define peripheral_request_list(per, label) \ 28#define peripheral_request_list(per, label) (0)
29 (pdev ? (IS_ERR(devm_pinctrl_get_select_default(&pdev->dev)) \
30 ? -EINVAL : 0) : 0)
31#define peripheral_free_list(per) 29#define peripheral_free_list(per)
32#else 30#else
33int peripheral_request(unsigned short per, const char *label); 31int peripheral_request(unsigned short per, const char *label);
@@ -39,7 +37,7 @@ void peripheral_free_list(const unsigned short per[]);
39#include <linux/err.h> 37#include <linux/err.h>
40#include <linux/pinctrl/pinctrl.h> 38#include <linux/pinctrl/pinctrl.h>
41#include <mach/portmux.h> 39#include <mach/portmux.h>
42#include <linux/gpio.h> 40#include <mach/gpio.h>
43 41
44#ifndef P_SPORT2_TFS 42#ifndef P_SPORT2_TFS
45#define P_SPORT2_TFS P_UNDEF 43#define P_SPORT2_TFS P_UNDEF
diff --git a/arch/blackfin/kernel/debug-mmrs.c b/arch/blackfin/kernel/debug-mmrs.c
index 01232a13470d..947ad0832338 100644
--- a/arch/blackfin/kernel/debug-mmrs.c
+++ b/arch/blackfin/kernel/debug-mmrs.c
@@ -10,6 +10,7 @@
10#include <linux/fs.h> 10#include <linux/fs.h>
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/i2c/bfin_twi.h>
13 14
14#include <asm/blackfin.h> 15#include <asm/blackfin.h>
15#include <asm/gpio.h> 16#include <asm/gpio.h>
diff --git a/arch/blackfin/kernel/ftrace.c b/arch/blackfin/kernel/ftrace.c
index 9277905b82cf..095de0fa044d 100644
--- a/arch/blackfin/kernel/ftrace.c
+++ b/arch/blackfin/kernel/ftrace.c
@@ -65,11 +65,8 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
65 return ftrace_modify_code(ip, call, sizeof(call)); 65 return ftrace_modify_code(ip, call, sizeof(call));
66} 66}
67 67
68int __init ftrace_dyn_arch_init(void *data) 68int __init ftrace_dyn_arch_init(void)
69{ 69{
70 /* return value is done indirectly via data */
71 *(unsigned long *)data = 0;
72
73 return 0; 70 return 0;
74} 71}
75 72
diff --git a/arch/blackfin/kernel/irqchip.c b/arch/blackfin/kernel/irqchip.c
index ff3d747154ac..0ba25764b8c0 100644
--- a/arch/blackfin/kernel/irqchip.c
+++ b/arch/blackfin/kernel/irqchip.c
@@ -11,6 +11,7 @@
11#include <linux/kallsyms.h> 11#include <linux/kallsyms.h>
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13#include <linux/irq.h> 13#include <linux/irq.h>
14#include <linux/seq_file.h>
14#include <asm/irq_handler.h> 15#include <asm/irq_handler.h>
15#include <asm/trace.h> 16#include <asm/trace.h>
16#include <asm/pda.h> 17#include <asm/pda.h>
@@ -33,37 +34,15 @@ static struct irq_desc bad_irq_desc = {
33#endif 34#endif
34 35
35#ifdef CONFIG_PROC_FS 36#ifdef CONFIG_PROC_FS
36int show_interrupts(struct seq_file *p, void *v) 37int arch_show_interrupts(struct seq_file *p, int prec)
37{ 38{
38 int i = *(loff_t *) v, j; 39 int j;
39 struct irqaction *action; 40
40 unsigned long flags; 41 seq_printf(p, "%*s: ", prec, "NMI");
41 42 for_each_online_cpu(j)
42 if (i < NR_IRQS) { 43 seq_printf(p, "%10u ", cpu_pda[j].__nmi_count);
43 struct irq_desc *desc = irq_to_desc(i); 44 seq_printf(p, " CORE Non Maskable Interrupt\n");
44 45 seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));
45 raw_spin_lock_irqsave(&desc->lock, flags);
46 action = desc->action;
47 if (!action)
48 goto skip;
49 seq_printf(p, "%3d: ", i);
50 for_each_online_cpu(j)
51 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
52 seq_printf(p, " %8s", irq_desc_get_chip(desc)->name);
53 seq_printf(p, " %s", action->name);
54 for (action = action->next; action; action = action->next)
55 seq_printf(p, " %s", action->name);
56
57 seq_putc(p, '\n');
58 skip:
59 raw_spin_unlock_irqrestore(&desc->lock, flags);
60 } else if (i == NR_IRQS) {
61 seq_printf(p, "NMI: ");
62 for_each_online_cpu(j)
63 seq_printf(p, "%10u ", cpu_pda[j].__nmi_count);
64 seq_printf(p, " CORE Non Maskable Interrupt\n");
65 seq_printf(p, "Err: %10u\n", atomic_read(&irq_err_count));
66 }
67 return 0; 46 return 0;
68} 47}
69#endif 48#endif
diff --git a/arch/blackfin/mach-bf518/boards/ezbrd.c b/arch/blackfin/mach-bf518/boards/ezbrd.c
index f8047ca3b339..d022112927c2 100644
--- a/arch/blackfin/mach-bf518/boards/ezbrd.c
+++ b/arch/blackfin/mach-bf518/boards/ezbrd.c
@@ -36,7 +36,7 @@ const char bfin_board_name[] = "ADI BF518F-EZBRD";
36 * Driver needs to know address, irq and flag pin. 36 * Driver needs to know address, irq and flag pin.
37 */ 37 */
38 38
39#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 39#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
40static struct mtd_partition ezbrd_partitions[] = { 40static struct mtd_partition ezbrd_partitions[] = {
41 { 41 {
42 .name = "bootloader(nor)", 42 .name = "bootloader(nor)",
@@ -61,7 +61,7 @@ static struct physmap_flash_data ezbrd_flash_data = {
61 61
62static struct resource ezbrd_flash_resource = { 62static struct resource ezbrd_flash_resource = {
63 .start = 0x20000000, 63 .start = 0x20000000,
64#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 64#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
65 .end = 0x202fffff, 65 .end = 0x202fffff,
66#else 66#else
67 .end = 0x203fffff, 67 .end = 0x203fffff,
@@ -80,14 +80,14 @@ static struct platform_device ezbrd_flash_device = {
80}; 80};
81#endif 81#endif
82 82
83#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 83#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
84static struct platform_device rtc_device = { 84static struct platform_device rtc_device = {
85 .name = "rtc-bfin", 85 .name = "rtc-bfin",
86 .id = -1, 86 .id = -1,
87}; 87};
88#endif 88#endif
89 89
90#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 90#if IS_ENABLED(CONFIG_BFIN_MAC)
91#include <linux/bfin_mac.h> 91#include <linux/bfin_mac.h>
92static const unsigned short bfin_mac_peripherals[] = { 92static const unsigned short bfin_mac_peripherals[] = {
93 P_MII0_ETxD0, 93 P_MII0_ETxD0,
@@ -105,7 +105,7 @@ static const unsigned short bfin_mac_peripherals[] = {
105 105
106static struct bfin_phydev_platform_data bfin_phydev_data[] = { 106static struct bfin_phydev_platform_data bfin_phydev_data[] = {
107 { 107 {
108#if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE) 108#if IS_ENABLED(CONFIG_NET_DSA_KSZ8893M)
109 .addr = 3, 109 .addr = 3,
110#else 110#else
111 .addr = 1, 111 .addr = 1,
@@ -119,7 +119,7 @@ static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
119 .phydev_data = bfin_phydev_data, 119 .phydev_data = bfin_phydev_data,
120 .phy_mode = PHY_INTERFACE_MODE_MII, 120 .phy_mode = PHY_INTERFACE_MODE_MII,
121 .mac_peripherals = bfin_mac_peripherals, 121 .mac_peripherals = bfin_mac_peripherals,
122#if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE) 122#if IS_ENABLED(CONFIG_NET_DSA_KSZ8893M)
123 .phy_mask = 0xfff7, /* Only probe the port phy connect to the on chip MAC */ 123 .phy_mask = 0xfff7, /* Only probe the port phy connect to the on chip MAC */
124#endif 124#endif
125 .vlan1_mask = 1, 125 .vlan1_mask = 1,
@@ -140,7 +140,7 @@ static struct platform_device bfin_mac_device = {
140 } 140 }
141}; 141};
142 142
143#if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE) 143#if IS_ENABLED(CONFIG_NET_DSA_KSZ8893M)
144static struct dsa_chip_data ksz8893m_switch_chip_data = { 144static struct dsa_chip_data ksz8893m_switch_chip_data = {
145 .mii_bus = &bfin_mii_bus.dev, 145 .mii_bus = &bfin_mii_bus.dev,
146 .port_names = { 146 .port_names = {
@@ -165,8 +165,7 @@ static struct platform_device ksz8893m_switch_device = {
165#endif 165#endif
166#endif 166#endif
167 167
168#if defined(CONFIG_MTD_M25P80) \ 168#if IS_ENABLED(CONFIG_MTD_M25P80)
169 || defined(CONFIG_MTD_M25P80_MODULE)
170static struct mtd_partition bfin_spi_flash_partitions[] = { 169static struct mtd_partition bfin_spi_flash_partitions[] = {
171 { 170 {
172 .name = "bootloader(spi)", 171 .name = "bootloader(spi)",
@@ -193,13 +192,13 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
193}; 192};
194#endif 193#endif
195 194
196#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 195#if IS_ENABLED(CONFIG_MMC_SPI)
197static struct bfin5xx_spi_chip mmc_spi_chip_info = { 196static struct bfin5xx_spi_chip mmc_spi_chip_info = {
198 .enable_dma = 0, 197 .enable_dma = 0,
199}; 198};
200#endif 199#endif
201 200
202#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 201#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
203static const struct ad7877_platform_data bfin_ad7877_ts_info = { 202static const struct ad7877_platform_data bfin_ad7877_ts_info = {
204 .model = 7877, 203 .model = 7877,
205 .vref_delay_usecs = 50, /* internal, no capacitor */ 204 .vref_delay_usecs = 50, /* internal, no capacitor */
@@ -216,8 +215,7 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = {
216#endif 215#endif
217 216
218static struct spi_board_info bfin_spi_board_info[] __initdata = { 217static struct spi_board_info bfin_spi_board_info[] __initdata = {
219#if defined(CONFIG_MTD_M25P80) \ 218#if IS_ENABLED(CONFIG_MTD_M25P80)
220 || defined(CONFIG_MTD_M25P80_MODULE)
221 { 219 {
222 /* the modalias must be the same as spi device driver name */ 220 /* the modalias must be the same as spi device driver name */
223 .modalias = "m25p80", /* Name of spi_driver for this device */ 221 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -230,9 +228,8 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
230 }, 228 },
231#endif 229#endif
232 230
233#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 231#if IS_ENABLED(CONFIG_BFIN_MAC)
234#if defined(CONFIG_NET_DSA_KSZ8893M) \ 232#if IS_ENABLED(CONFIG_NET_DSA_KSZ8893M)
235 || defined(CONFIG_NET_DSA_KSZ8893M_MODULE)
236 { 233 {
237 .modalias = "ksz8893m", 234 .modalias = "ksz8893m",
238 .max_speed_hz = 5000000, 235 .max_speed_hz = 5000000,
@@ -244,7 +241,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
244#endif 241#endif
245#endif 242#endif
246 243
247#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 244#if IS_ENABLED(CONFIG_MMC_SPI)
248 { 245 {
249 .modalias = "mmc_spi", 246 .modalias = "mmc_spi",
250 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 247 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
@@ -254,7 +251,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
254 .mode = SPI_MODE_3, 251 .mode = SPI_MODE_3,
255 }, 252 },
256#endif 253#endif
257#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 254#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
258 { 255 {
259 .modalias = "ad7877", 256 .modalias = "ad7877",
260 .platform_data = &bfin_ad7877_ts_info, 257 .platform_data = &bfin_ad7877_ts_info,
@@ -264,7 +261,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
264 .chip_select = 2, 261 .chip_select = 2,
265 }, 262 },
266#endif 263#endif
267#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \ 264#if IS_ENABLED(CONFIG_SND_SOC_WM8731) \
268 && defined(CONFIG_SND_SOC_WM8731_SPI) 265 && defined(CONFIG_SND_SOC_WM8731_SPI)
269 { 266 {
270 .modalias = "wm8731", 267 .modalias = "wm8731",
@@ -274,7 +271,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
274 .mode = SPI_MODE_0, 271 .mode = SPI_MODE_0,
275 }, 272 },
276#endif 273#endif
277#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 274#if IS_ENABLED(CONFIG_SPI_SPIDEV)
278 { 275 {
279 .modalias = "spidev", 276 .modalias = "spidev",
280 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 277 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -282,7 +279,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
282 .chip_select = 1, 279 .chip_select = 1,
283 }, 280 },
284#endif 281#endif
285#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 282#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)
286 { 283 {
287 .modalias = "bfin-lq035q1-spi", 284 .modalias = "bfin-lq035q1-spi",
288 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 285 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
@@ -294,7 +291,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
294}; 291};
295 292
296/* SPI controller data */ 293/* SPI controller data */
297#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 294#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
298/* SPI (0) */ 295/* SPI (0) */
299static struct bfin5xx_spi_master bfin_spi0_info = { 296static struct bfin5xx_spi_master bfin_spi0_info = {
300 .num_chipselect = 6, 297 .num_chipselect = 6,
@@ -366,7 +363,7 @@ static struct platform_device bfin_spi1_device = {
366}; 363};
367#endif /* spi master and devices */ 364#endif /* spi master and devices */
368 365
369#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 366#if IS_ENABLED(CONFIG_SERIAL_BFIN)
370#ifdef CONFIG_SERIAL_BFIN_UART0 367#ifdef CONFIG_SERIAL_BFIN_UART0
371static struct resource bfin_uart0_resources[] = { 368static struct resource bfin_uart0_resources[] = {
372 { 369 {
@@ -465,7 +462,7 @@ static struct platform_device bfin_uart1_device = {
465#endif 462#endif
466#endif 463#endif
467 464
468#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 465#if IS_ENABLED(CONFIG_BFIN_SIR)
469#ifdef CONFIG_BFIN_SIR0 466#ifdef CONFIG_BFIN_SIR0
470static struct resource bfin_sir0_resources[] = { 467static struct resource bfin_sir0_resources[] = {
471 { 468 {
@@ -520,7 +517,7 @@ static struct platform_device bfin_sir1_device = {
520#endif 517#endif
521#endif 518#endif
522 519
523#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 520#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
524static struct platform_device bfin_i2s = { 521static struct platform_device bfin_i2s = {
525 .name = "bfin-i2s", 522 .name = "bfin-i2s",
526 .id = CONFIG_SND_BF5XX_SPORT_NUM, 523 .id = CONFIG_SND_BF5XX_SPORT_NUM,
@@ -528,7 +525,7 @@ static struct platform_device bfin_i2s = {
528}; 525};
529#endif 526#endif
530 527
531#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 528#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
532static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; 529static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
533 530
534static struct resource bfin_twi0_resource[] = { 531static struct resource bfin_twi0_resource[] = {
@@ -556,25 +553,25 @@ static struct platform_device i2c_bfin_twi_device = {
556#endif 553#endif
557 554
558static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 555static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
559#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) 556#if IS_ENABLED(CONFIG_BFIN_TWI_LCD)
560 { 557 {
561 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 558 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
562 }, 559 },
563#endif 560#endif
564#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE) 561#if IS_ENABLED(CONFIG_INPUT_PCF8574)
565 { 562 {
566 I2C_BOARD_INFO("pcf8574_keypad", 0x27), 563 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
567 .irq = IRQ_PF8, 564 .irq = IRQ_PF8,
568 }, 565 },
569#endif 566#endif
570#if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE) 567#if IS_ENABLED(CONFIG_SND_SOC_SSM2602)
571 { 568 {
572 I2C_BOARD_INFO("ssm2602", 0x1b), 569 I2C_BOARD_INFO("ssm2602", 0x1b),
573 }, 570 },
574#endif 571#endif
575}; 572};
576 573
577#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 574#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
578#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 575#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
579static struct resource bfin_sport0_uart_resources[] = { 576static struct resource bfin_sport0_uart_resources[] = {
580 { 577 {
@@ -645,7 +642,7 @@ static struct platform_device bfin_sport1_uart_device = {
645#endif 642#endif
646#endif 643#endif
647 644
648#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 645#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
649#include <linux/input.h> 646#include <linux/input.h>
650#include <linux/gpio_keys.h> 647#include <linux/gpio_keys.h>
651 648
@@ -667,7 +664,7 @@ static struct platform_device bfin_device_gpiokeys = {
667}; 664};
668#endif 665#endif
669 666
670#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) 667#if IS_ENABLED(CONFIG_SDH_BFIN)
671 668
672static struct bfin_sd_host bfin_sdh_data = { 669static struct bfin_sd_host bfin_sdh_data = {
673 .dma_chan = CH_RSI, 670 .dma_chan = CH_RSI,
@@ -710,24 +707,24 @@ static struct platform_device *stamp_devices[] __initdata = {
710 707
711 &bfin_dpmc, 708 &bfin_dpmc,
712 709
713#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 710#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
714 &rtc_device, 711 &rtc_device,
715#endif 712#endif
716 713
717#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 714#if IS_ENABLED(CONFIG_BFIN_MAC)
718 &bfin_mii_bus, 715 &bfin_mii_bus,
719 &bfin_mac_device, 716 &bfin_mac_device,
720#if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE) 717#if IS_ENABLED(CONFIG_NET_DSA_KSZ8893M)
721 &ksz8893m_switch_device, 718 &ksz8893m_switch_device,
722#endif 719#endif
723#endif 720#endif
724 721
725#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 722#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
726 &bfin_spi0_device, 723 &bfin_spi0_device,
727 &bfin_spi1_device, 724 &bfin_spi1_device,
728#endif 725#endif
729 726
730#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 727#if IS_ENABLED(CONFIG_SERIAL_BFIN)
731#ifdef CONFIG_SERIAL_BFIN_UART0 728#ifdef CONFIG_SERIAL_BFIN_UART0
732 &bfin_uart0_device, 729 &bfin_uart0_device,
733#endif 730#endif
@@ -736,7 +733,7 @@ static struct platform_device *stamp_devices[] __initdata = {
736#endif 733#endif
737#endif 734#endif
738 735
739#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 736#if IS_ENABLED(CONFIG_BFIN_SIR)
740#ifdef CONFIG_BFIN_SIR0 737#ifdef CONFIG_BFIN_SIR0
741 &bfin_sir0_device, 738 &bfin_sir0_device,
742#endif 739#endif
@@ -745,15 +742,15 @@ static struct platform_device *stamp_devices[] __initdata = {
745#endif 742#endif
746#endif 743#endif
747 744
748#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 745#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
749 &i2c_bfin_twi_device, 746 &i2c_bfin_twi_device,
750#endif 747#endif
751 748
752#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 749#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
753 &bfin_i2s, 750 &bfin_i2s,
754#endif 751#endif
755 752
756#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 753#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
757#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 754#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
758 &bfin_sport0_uart_device, 755 &bfin_sport0_uart_device,
759#endif 756#endif
@@ -762,15 +759,15 @@ static struct platform_device *stamp_devices[] __initdata = {
762#endif 759#endif
763#endif 760#endif
764 761
765#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 762#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
766 &bfin_device_gpiokeys, 763 &bfin_device_gpiokeys,
767#endif 764#endif
768 765
769#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) 766#if IS_ENABLED(CONFIG_SDH_BFIN)
770 &bf51x_sdh_device, 767 &bf51x_sdh_device,
771#endif 768#endif
772 769
773#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 770#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
774 &ezbrd_flash_device, 771 &ezbrd_flash_device,
775#endif 772#endif
776}; 773};
@@ -784,7 +781,7 @@ static int __init ezbrd_init(void)
784 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 781 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
785 /* setup BF518-EZBRD GPIO pin PG11 to AMS2, PG15 to AMS3. */ 782 /* setup BF518-EZBRD GPIO pin PG11 to AMS2, PG15 to AMS3. */
786 peripheral_request(P_AMS2, "ParaFlash"); 783 peripheral_request(P_AMS2, "ParaFlash");
787#if !defined(CONFIG_SPI_BFIN5XX) && !defined(CONFIG_SPI_BFIN5XX_MODULE) 784#if !IS_ENABLED(CONFIG_SPI_BFIN5XX)
788 peripheral_request(P_AMS3, "ParaFlash"); 785 peripheral_request(P_AMS3, "ParaFlash");
789#endif 786#endif
790 return 0; 787 return 0;
diff --git a/arch/blackfin/mach-bf518/boards/tcm-bf518.c b/arch/blackfin/mach-bf518/boards/tcm-bf518.c
index 0bedc737566b..240d5cb1f02c 100644
--- a/arch/blackfin/mach-bf518/boards/tcm-bf518.c
+++ b/arch/blackfin/mach-bf518/boards/tcm-bf518.c
@@ -36,7 +36,7 @@ const char bfin_board_name[] = "Bluetechnix TCM-BF518";
36 * Driver needs to know address, irq and flag pin. 36 * Driver needs to know address, irq and flag pin.
37 */ 37 */
38 38
39#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 39#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
40static struct mtd_partition tcm_partitions[] = { 40static struct mtd_partition tcm_partitions[] = {
41 { 41 {
42 .name = "bootloader(nor)", 42 .name = "bootloader(nor)",
@@ -73,14 +73,14 @@ static struct platform_device tcm_flash_device = {
73}; 73};
74#endif 74#endif
75 75
76#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 76#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
77static struct platform_device rtc_device = { 77static struct platform_device rtc_device = {
78 .name = "rtc-bfin", 78 .name = "rtc-bfin",
79 .id = -1, 79 .id = -1,
80}; 80};
81#endif 81#endif
82 82
83#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 83#if IS_ENABLED(CONFIG_BFIN_MAC)
84#include <linux/bfin_mac.h> 84#include <linux/bfin_mac.h>
85static const unsigned short bfin_mac_peripherals[] = P_MII0; 85static const unsigned short bfin_mac_peripherals[] = P_MII0;
86 86
@@ -113,8 +113,7 @@ static struct platform_device bfin_mac_device = {
113}; 113};
114#endif 114#endif
115 115
116#if defined(CONFIG_MTD_M25P80) \ 116#if IS_ENABLED(CONFIG_MTD_M25P80)
117 || defined(CONFIG_MTD_M25P80_MODULE)
118static struct mtd_partition bfin_spi_flash_partitions[] = { 117static struct mtd_partition bfin_spi_flash_partitions[] = {
119 { 118 {
120 .name = "bootloader(spi)", 119 .name = "bootloader(spi)",
@@ -141,13 +140,13 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
141}; 140};
142#endif 141#endif
143 142
144#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 143#if IS_ENABLED(CONFIG_MMC_SPI)
145static struct bfin5xx_spi_chip mmc_spi_chip_info = { 144static struct bfin5xx_spi_chip mmc_spi_chip_info = {
146 .enable_dma = 0, 145 .enable_dma = 0,
147}; 146};
148#endif 147#endif
149 148
150#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 149#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
151static const struct ad7877_platform_data bfin_ad7877_ts_info = { 150static const struct ad7877_platform_data bfin_ad7877_ts_info = {
152 .model = 7877, 151 .model = 7877,
153 .vref_delay_usecs = 50, /* internal, no capacitor */ 152 .vref_delay_usecs = 50, /* internal, no capacitor */
@@ -164,8 +163,7 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = {
164#endif 163#endif
165 164
166static struct spi_board_info bfin_spi_board_info[] __initdata = { 165static struct spi_board_info bfin_spi_board_info[] __initdata = {
167#if defined(CONFIG_MTD_M25P80) \ 166#if IS_ENABLED(CONFIG_MTD_M25P80)
168 || defined(CONFIG_MTD_M25P80_MODULE)
169 { 167 {
170 /* the modalias must be the same as spi device driver name */ 168 /* the modalias must be the same as spi device driver name */
171 .modalias = "m25p80", /* Name of spi_driver for this device */ 169 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -178,7 +176,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
178 }, 176 },
179#endif 177#endif
180 178
181#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 179#if IS_ENABLED(CONFIG_MMC_SPI)
182 { 180 {
183 .modalias = "mmc_spi", 181 .modalias = "mmc_spi",
184 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 182 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
@@ -188,7 +186,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
188 .mode = SPI_MODE_3, 186 .mode = SPI_MODE_3,
189 }, 187 },
190#endif 188#endif
191#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 189#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
192 { 190 {
193 .modalias = "ad7877", 191 .modalias = "ad7877",
194 .platform_data = &bfin_ad7877_ts_info, 192 .platform_data = &bfin_ad7877_ts_info,
@@ -198,7 +196,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
198 .chip_select = 2, 196 .chip_select = 2,
199 }, 197 },
200#endif 198#endif
201#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \ 199#if IS_ENABLED(CONFIG_SND_SOC_WM8731) \
202 && defined(CONFIG_SND_SOC_WM8731_SPI) 200 && defined(CONFIG_SND_SOC_WM8731_SPI)
203 { 201 {
204 .modalias = "wm8731", 202 .modalias = "wm8731",
@@ -208,7 +206,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
208 .mode = SPI_MODE_0, 206 .mode = SPI_MODE_0,
209 }, 207 },
210#endif 208#endif
211#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 209#if IS_ENABLED(CONFIG_SPI_SPIDEV)
212 { 210 {
213 .modalias = "spidev", 211 .modalias = "spidev",
214 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 212 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -216,7 +214,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
216 .chip_select = 1, 214 .chip_select = 1,
217 }, 215 },
218#endif 216#endif
219#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 217#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)
220 { 218 {
221 .modalias = "bfin-lq035q1-spi", 219 .modalias = "bfin-lq035q1-spi",
222 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 220 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
@@ -228,7 +226,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
228}; 226};
229 227
230/* SPI controller data */ 228/* SPI controller data */
231#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 229#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
232/* SPI (0) */ 230/* SPI (0) */
233static struct bfin5xx_spi_master bfin_spi0_info = { 231static struct bfin5xx_spi_master bfin_spi0_info = {
234 .num_chipselect = 6, 232 .num_chipselect = 6,
@@ -300,7 +298,7 @@ static struct platform_device bfin_spi1_device = {
300}; 298};
301#endif /* spi master and devices */ 299#endif /* spi master and devices */
302 300
303#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 301#if IS_ENABLED(CONFIG_SERIAL_BFIN)
304#ifdef CONFIG_SERIAL_BFIN_UART0 302#ifdef CONFIG_SERIAL_BFIN_UART0
305static struct resource bfin_uart0_resources[] = { 303static struct resource bfin_uart0_resources[] = {
306 { 304 {
@@ -399,7 +397,7 @@ static struct platform_device bfin_uart1_device = {
399#endif 397#endif
400#endif 398#endif
401 399
402#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 400#if IS_ENABLED(CONFIG_BFIN_SIR)
403#ifdef CONFIG_BFIN_SIR0 401#ifdef CONFIG_BFIN_SIR0
404static struct resource bfin_sir0_resources[] = { 402static struct resource bfin_sir0_resources[] = {
405 { 403 {
@@ -454,7 +452,7 @@ static struct platform_device bfin_sir1_device = {
454#endif 452#endif
455#endif 453#endif
456 454
457#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 455#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
458static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; 456static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
459 457
460static struct resource bfin_twi0_resource[] = { 458static struct resource bfin_twi0_resource[] = {
@@ -482,12 +480,12 @@ static struct platform_device i2c_bfin_twi_device = {
482#endif 480#endif
483 481
484static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 482static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
485#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) 483#if IS_ENABLED(CONFIG_BFIN_TWI_LCD)
486 { 484 {
487 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 485 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
488 }, 486 },
489#endif 487#endif
490#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE) 488#if IS_ENABLED(CONFIG_INPUT_PCF8574)
491 { 489 {
492 I2C_BOARD_INFO("pcf8574_keypad", 0x27), 490 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
493 .irq = IRQ_PF8, 491 .irq = IRQ_PF8,
@@ -495,7 +493,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
495#endif 493#endif
496}; 494};
497 495
498#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 496#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
499#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 497#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
500static struct resource bfin_sport0_uart_resources[] = { 498static struct resource bfin_sport0_uart_resources[] = {
501 { 499 {
@@ -566,7 +564,7 @@ static struct platform_device bfin_sport1_uart_device = {
566#endif 564#endif
567#endif 565#endif
568 566
569#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 567#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
570#include <linux/input.h> 568#include <linux/input.h>
571#include <linux/gpio_keys.h> 569#include <linux/gpio_keys.h>
572 570
@@ -588,7 +586,7 @@ static struct platform_device bfin_device_gpiokeys = {
588}; 586};
589#endif 587#endif
590 588
591#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) 589#if IS_ENABLED(CONFIG_SDH_BFIN)
592 590
593static struct bfin_sd_host bfin_sdh_data = { 591static struct bfin_sd_host bfin_sdh_data = {
594 .dma_chan = CH_RSI, 592 .dma_chan = CH_RSI,
@@ -631,21 +629,21 @@ static struct platform_device *tcm_devices[] __initdata = {
631 629
632 &bfin_dpmc, 630 &bfin_dpmc,
633 631
634#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 632#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
635 &rtc_device, 633 &rtc_device,
636#endif 634#endif
637 635
638#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 636#if IS_ENABLED(CONFIG_BFIN_MAC)
639 &bfin_mii_bus, 637 &bfin_mii_bus,
640 &bfin_mac_device, 638 &bfin_mac_device,
641#endif 639#endif
642 640
643#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 641#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
644 &bfin_spi0_device, 642 &bfin_spi0_device,
645 &bfin_spi1_device, 643 &bfin_spi1_device,
646#endif 644#endif
647 645
648#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 646#if IS_ENABLED(CONFIG_SERIAL_BFIN)
649#ifdef CONFIG_SERIAL_BFIN_UART0 647#ifdef CONFIG_SERIAL_BFIN_UART0
650 &bfin_uart0_device, 648 &bfin_uart0_device,
651#endif 649#endif
@@ -654,7 +652,7 @@ static struct platform_device *tcm_devices[] __initdata = {
654#endif 652#endif
655#endif 653#endif
656 654
657#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 655#if IS_ENABLED(CONFIG_BFIN_SIR)
658#ifdef CONFIG_BFIN_SIR0 656#ifdef CONFIG_BFIN_SIR0
659 &bfin_sir0_device, 657 &bfin_sir0_device,
660#endif 658#endif
@@ -663,11 +661,11 @@ static struct platform_device *tcm_devices[] __initdata = {
663#endif 661#endif
664#endif 662#endif
665 663
666#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 664#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
667 &i2c_bfin_twi_device, 665 &i2c_bfin_twi_device,
668#endif 666#endif
669 667
670#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 668#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
671#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 669#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
672 &bfin_sport0_uart_device, 670 &bfin_sport0_uart_device,
673#endif 671#endif
@@ -676,15 +674,15 @@ static struct platform_device *tcm_devices[] __initdata = {
676#endif 674#endif
677#endif 675#endif
678 676
679#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 677#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
680 &bfin_device_gpiokeys, 678 &bfin_device_gpiokeys,
681#endif 679#endif
682 680
683#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) 681#if IS_ENABLED(CONFIG_SDH_BFIN)
684 &bf51x_sdh_device, 682 &bf51x_sdh_device,
685#endif 683#endif
686 684
687#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 685#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
688 &tcm_flash_device, 686 &tcm_flash_device,
689#endif 687#endif
690}; 688};
diff --git a/arch/blackfin/mach-bf527/boards/ad7160eval.c b/arch/blackfin/mach-bf527/boards/ad7160eval.c
index 1e7be62fccb6..9501bd8d9cd1 100644
--- a/arch/blackfin/mach-bf527/boards/ad7160eval.c
+++ b/arch/blackfin/mach-bf527/boards/ad7160eval.c
@@ -37,7 +37,7 @@ const char bfin_board_name[] = "ADI BF527-AD7160EVAL";
37 * Driver needs to know address, irq and flag pin. 37 * Driver needs to know address, irq and flag pin.
38 */ 38 */
39 39
40#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 40#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
41static struct resource musb_resources[] = { 41static struct resource musb_resources[] = {
42 [0] = { 42 [0] = {
43 .start = 0xffc03800, 43 .start = 0xffc03800,
@@ -97,7 +97,7 @@ static struct platform_device musb_device = {
97}; 97};
98#endif 98#endif
99 99
100#if defined(CONFIG_FB_BFIN_RA158Z) || defined(CONFIG_FB_BFIN_RA158Z_MODULE) 100#if IS_ENABLED(CONFIG_FB_BFIN_RA158Z)
101static struct resource bf52x_ra158z_resources[] = { 101static struct resource bf52x_ra158z_resources[] = {
102 { 102 {
103 .start = IRQ_PPI_ERROR, 103 .start = IRQ_PPI_ERROR,
@@ -114,7 +114,7 @@ static struct platform_device bf52x_ra158z_device = {
114}; 114};
115#endif 115#endif
116 116
117#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 117#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
118static struct mtd_partition ad7160eval_partitions[] = { 118static struct mtd_partition ad7160eval_partitions[] = {
119 { 119 {
120 .name = "bootloader(nor)", 120 .name = "bootloader(nor)",
@@ -154,7 +154,7 @@ static struct platform_device ad7160eval_flash_device = {
154}; 154};
155#endif 155#endif
156 156
157#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) 157#if IS_ENABLED(CONFIG_MTD_NAND_BF5XX)
158static struct mtd_partition partition_info[] = { 158static struct mtd_partition partition_info[] = {
159 { 159 {
160 .name = "linux kernel(nand)", 160 .name = "linux kernel(nand)",
@@ -200,14 +200,14 @@ static struct platform_device bf5xx_nand_device = {
200}; 200};
201#endif 201#endif
202 202
203#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 203#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
204static struct platform_device rtc_device = { 204static struct platform_device rtc_device = {
205 .name = "rtc-bfin", 205 .name = "rtc-bfin",
206 .id = -1, 206 .id = -1,
207}; 207};
208#endif 208#endif
209 209
210#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 210#if IS_ENABLED(CONFIG_BFIN_MAC)
211#include <linux/bfin_mac.h> 211#include <linux/bfin_mac.h>
212static const unsigned short bfin_mac_peripherals[] = P_RMII0; 212static const unsigned short bfin_mac_peripherals[] = P_RMII0;
213 213
@@ -241,8 +241,7 @@ static struct platform_device bfin_mac_device = {
241#endif 241#endif
242 242
243 243
244#if defined(CONFIG_MTD_M25P80) \ 244#if IS_ENABLED(CONFIG_MTD_M25P80)
245 || defined(CONFIG_MTD_M25P80_MODULE)
246static struct mtd_partition bfin_spi_flash_partitions[] = { 245static struct mtd_partition bfin_spi_flash_partitions[] = {
247 { 246 {
248 .name = "bootloader(spi)", 247 .name = "bootloader(spi)",
@@ -269,13 +268,13 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
269}; 268};
270#endif 269#endif
271 270
272#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 271#if IS_ENABLED(CONFIG_MMC_SPI)
273static struct bfin5xx_spi_chip mmc_spi_chip_info = { 272static struct bfin5xx_spi_chip mmc_spi_chip_info = {
274 .enable_dma = 0, 273 .enable_dma = 0,
275}; 274};
276#endif 275#endif
277 276
278#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 277#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
279static struct platform_device bfin_i2s = { 278static struct platform_device bfin_i2s = {
280 .name = "bfin-i2s", 279 .name = "bfin-i2s",
281 .id = CONFIG_SND_BF5XX_SPORT_NUM, 280 .id = CONFIG_SND_BF5XX_SPORT_NUM,
@@ -284,8 +283,7 @@ static struct platform_device bfin_i2s = {
284#endif 283#endif
285 284
286static struct spi_board_info bfin_spi_board_info[] __initdata = { 285static struct spi_board_info bfin_spi_board_info[] __initdata = {
287#if defined(CONFIG_MTD_M25P80) \ 286#if IS_ENABLED(CONFIG_MTD_M25P80)
288 || defined(CONFIG_MTD_M25P80_MODULE)
289 { 287 {
290 /* the modalias must be the same as spi device driver name */ 288 /* the modalias must be the same as spi device driver name */
291 .modalias = "m25p80", /* Name of spi_driver for this device */ 289 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -297,8 +295,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
297 .mode = SPI_MODE_3, 295 .mode = SPI_MODE_3,
298 }, 296 },
299#endif 297#endif
300#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \ 298#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD183X)
301 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
302 { 299 {
303 .modalias = "ad183x", 300 .modalias = "ad183x",
304 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 301 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -306,7 +303,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
306 .chip_select = 4, 303 .chip_select = 4,
307 }, 304 },
308#endif 305#endif
309#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 306#if IS_ENABLED(CONFIG_MMC_SPI)
310 { 307 {
311 .modalias = "mmc_spi", 308 .modalias = "mmc_spi",
312 .max_speed_hz = 30000000, /* max spi clock (SCK) speed in HZ */ 309 .max_speed_hz = 30000000, /* max spi clock (SCK) speed in HZ */
@@ -316,7 +313,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
316 .mode = SPI_MODE_3, 313 .mode = SPI_MODE_3,
317 }, 314 },
318#endif 315#endif
319#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 316#if IS_ENABLED(CONFIG_SPI_SPIDEV)
320 { 317 {
321 .modalias = "spidev", 318 .modalias = "spidev",
322 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 319 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -326,7 +323,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
326#endif 323#endif
327}; 324};
328 325
329#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 326#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
330/* SPI controller data */ 327/* SPI controller data */
331static struct bfin5xx_spi_master bfin_spi0_info = { 328static struct bfin5xx_spi_master bfin_spi0_info = {
332 .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS, 329 .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS,
@@ -364,7 +361,7 @@ static struct platform_device bfin_spi0_device = {
364}; 361};
365#endif /* spi master and devices */ 362#endif /* spi master and devices */
366 363
367#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 364#if IS_ENABLED(CONFIG_SERIAL_BFIN)
368#ifdef CONFIG_SERIAL_BFIN_UART0 365#ifdef CONFIG_SERIAL_BFIN_UART0
369static struct resource bfin_uart0_resources[] = { 366static struct resource bfin_uart0_resources[] = {
370 { 367 {
@@ -475,7 +472,7 @@ static struct platform_device bfin_uart1_device = {
475#endif 472#endif
476#endif 473#endif
477 474
478#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 475#if IS_ENABLED(CONFIG_BFIN_SIR)
479#ifdef CONFIG_BFIN_SIR0 476#ifdef CONFIG_BFIN_SIR0
480static struct resource bfin_sir0_resources[] = { 477static struct resource bfin_sir0_resources[] = {
481 { 478 {
@@ -530,7 +527,7 @@ static struct platform_device bfin_sir1_device = {
530#endif 527#endif
531#endif 528#endif
532 529
533#if defined(CONFIG_TOUCHSCREEN_AD7160) || defined(CONFIG_TOUCHSCREEN_AD7160_MODULE) 530#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7160)
534#include <linux/input/ad7160.h> 531#include <linux/input/ad7160.h>
535static const struct ad7160_platform_data bfin_ad7160_ts_info = { 532static const struct ad7160_platform_data bfin_ad7160_ts_info = {
536 .sensor_x_res = 854, 533 .sensor_x_res = 854,
@@ -560,7 +557,7 @@ static const struct ad7160_platform_data bfin_ad7160_ts_info = {
560}; 557};
561#endif 558#endif
562 559
563#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 560#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
564static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; 561static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
565 562
566static struct resource bfin_twi0_resource[] = { 563static struct resource bfin_twi0_resource[] = {
@@ -588,7 +585,7 @@ static struct platform_device i2c_bfin_twi_device = {
588#endif 585#endif
589 586
590static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 587static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
591#if defined(CONFIG_TOUCHSCREEN_AD7160) || defined(CONFIG_TOUCHSCREEN_AD7160_MODULE) 588#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7160)
592 { 589 {
593 I2C_BOARD_INFO("ad7160", 0x33), 590 I2C_BOARD_INFO("ad7160", 0x33),
594 .irq = IRQ_PH1, 591 .irq = IRQ_PH1,
@@ -597,7 +594,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
597#endif 594#endif
598}; 595};
599 596
600#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 597#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
601#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 598#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
602static struct resource bfin_sport0_uart_resources[] = { 599static struct resource bfin_sport0_uart_resources[] = {
603 { 600 {
@@ -668,7 +665,7 @@ static struct platform_device bfin_sport1_uart_device = {
668#endif 665#endif
669#endif 666#endif
670 667
671#if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE) 668#if IS_ENABLED(CONFIG_INPUT_BFIN_ROTARY)
672#include <asm/bfin_rotary.h> 669#include <asm/bfin_rotary.h>
673 670
674static struct bfin_rotary_platform_data bfin_rotary_data = { 671static struct bfin_rotary_platform_data bfin_rotary_data = {
@@ -725,28 +722,28 @@ static struct platform_device *stamp_devices[] __initdata = {
725 722
726 &bfin_dpmc, 723 &bfin_dpmc,
727 724
728#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) 725#if IS_ENABLED(CONFIG_MTD_NAND_BF5XX)
729 &bf5xx_nand_device, 726 &bf5xx_nand_device,
730#endif 727#endif
731 728
732#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 729#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
733 &rtc_device, 730 &rtc_device,
734#endif 731#endif
735 732
736#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 733#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
737 &musb_device, 734 &musb_device,
738#endif 735#endif
739 736
740#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 737#if IS_ENABLED(CONFIG_BFIN_MAC)
741 &bfin_mii_bus, 738 &bfin_mii_bus,
742 &bfin_mac_device, 739 &bfin_mac_device,
743#endif 740#endif
744 741
745#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 742#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
746 &bfin_spi0_device, 743 &bfin_spi0_device,
747#endif 744#endif
748 745
749#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 746#if IS_ENABLED(CONFIG_SERIAL_BFIN)
750#ifdef CONFIG_SERIAL_BFIN_UART0 747#ifdef CONFIG_SERIAL_BFIN_UART0
751 &bfin_uart0_device, 748 &bfin_uart0_device,
752#endif 749#endif
@@ -755,11 +752,11 @@ static struct platform_device *stamp_devices[] __initdata = {
755#endif 752#endif
756#endif 753#endif
757 754
758#if defined(CONFIG_FB_BFIN_RA158Z) || defined(CONFIG_FB_BFIN_RA158Z_MODULE) 755#if IS_ENABLED(CONFIG_FB_BFIN_RA158Z)
759 &bf52x_ra158z_device, 756 &bf52x_ra158z_device,
760#endif 757#endif
761 758
762#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 759#if IS_ENABLED(CONFIG_BFIN_SIR)
763#ifdef CONFIG_BFIN_SIR0 760#ifdef CONFIG_BFIN_SIR0
764 &bfin_sir0_device, 761 &bfin_sir0_device,
765#endif 762#endif
@@ -768,11 +765,11 @@ static struct platform_device *stamp_devices[] __initdata = {
768#endif 765#endif
769#endif 766#endif
770 767
771#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 768#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
772 &i2c_bfin_twi_device, 769 &i2c_bfin_twi_device,
773#endif 770#endif
774 771
775#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 772#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
776#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 773#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
777 &bfin_sport0_uart_device, 774 &bfin_sport0_uart_device,
778#endif 775#endif
@@ -781,15 +778,15 @@ static struct platform_device *stamp_devices[] __initdata = {
781#endif 778#endif
782#endif 779#endif
783 780
784#if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE) 781#if IS_ENABLED(CONFIG_INPUT_BFIN_ROTARY)
785 &bfin_rotary_device, 782 &bfin_rotary_device,
786#endif 783#endif
787 784
788#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 785#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
789 &ad7160eval_flash_device, 786 &ad7160eval_flash_device,
790#endif 787#endif
791 788
792#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 789#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
793 &bfin_i2s, 790 &bfin_i2s,
794#endif 791#endif
795}; 792};
diff --git a/arch/blackfin/mach-bf527/boards/cm_bf527.c b/arch/blackfin/mach-bf527/boards/cm_bf527.c
index 413d0132b66f..b1004b35db36 100644
--- a/arch/blackfin/mach-bf527/boards/cm_bf527.c
+++ b/arch/blackfin/mach-bf527/boards/cm_bf527.c
@@ -37,7 +37,7 @@ const char bfin_board_name[] = "Bluetechnix CM-BF527";
37 * Driver needs to know address, irq and flag pin. 37 * Driver needs to know address, irq and flag pin.
38 */ 38 */
39 39
40#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) 40#if IS_ENABLED(CONFIG_USB_ISP1760_HCD)
41#include <linux/usb/isp1760.h> 41#include <linux/usb/isp1760.h>
42static struct resource bfin_isp1760_resources[] = { 42static struct resource bfin_isp1760_resources[] = {
43 [0] = { 43 [0] = {
@@ -72,7 +72,7 @@ static struct platform_device bfin_isp1760_device = {
72}; 72};
73#endif 73#endif
74 74
75#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 75#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
76static struct resource musb_resources[] = { 76static struct resource musb_resources[] = {
77 [0] = { 77 [0] = {
78 .start = 0xffc03800, 78 .start = 0xffc03800,
@@ -134,7 +134,7 @@ static struct platform_device musb_device = {
134}; 134};
135#endif 135#endif
136 136
137#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) 137#if IS_ENABLED(CONFIG_MTD_NAND_BF5XX)
138static struct mtd_partition partition_info[] = { 138static struct mtd_partition partition_info[] = {
139 { 139 {
140 .name = "linux kernel(nand)", 140 .name = "linux kernel(nand)",
@@ -180,7 +180,7 @@ static struct platform_device bf5xx_nand_device = {
180}; 180};
181#endif 181#endif
182 182
183#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) 183#if IS_ENABLED(CONFIG_BFIN_CFPCMCIA)
184static struct resource bfin_pcmcia_cf_resources[] = { 184static struct resource bfin_pcmcia_cf_resources[] = {
185 { 185 {
186 .start = 0x20310000, /* IO PORT */ 186 .start = 0x20310000, /* IO PORT */
@@ -209,14 +209,14 @@ static struct platform_device bfin_pcmcia_cf_device = {
209}; 209};
210#endif 210#endif
211 211
212#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 212#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
213static struct platform_device rtc_device = { 213static struct platform_device rtc_device = {
214 .name = "rtc-bfin", 214 .name = "rtc-bfin",
215 .id = -1, 215 .id = -1,
216}; 216};
217#endif 217#endif
218 218
219#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 219#if IS_ENABLED(CONFIG_SMC91X)
220#include <linux/smc91x.h> 220#include <linux/smc91x.h>
221 221
222static struct smc91x_platdata smc91x_info = { 222static struct smc91x_platdata smc91x_info = {
@@ -249,7 +249,7 @@ static struct platform_device smc91x_device = {
249}; 249};
250#endif 250#endif
251 251
252#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) 252#if IS_ENABLED(CONFIG_DM9000)
253static struct resource dm9000_resources[] = { 253static struct resource dm9000_resources[] = {
254 [0] = { 254 [0] = {
255 .start = 0x203FB800, 255 .start = 0x203FB800,
@@ -276,7 +276,7 @@ static struct platform_device dm9000_device = {
276}; 276};
277#endif 277#endif
278 278
279#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 279#if IS_ENABLED(CONFIG_BFIN_MAC)
280#include <linux/bfin_mac.h> 280#include <linux/bfin_mac.h>
281static const unsigned short bfin_mac_peripherals[] = P_RMII0; 281static const unsigned short bfin_mac_peripherals[] = P_RMII0;
282 282
@@ -309,7 +309,7 @@ static struct platform_device bfin_mac_device = {
309}; 309};
310#endif 310#endif
311 311
312#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 312#if IS_ENABLED(CONFIG_USB_NET2272)
313static struct resource net2272_bfin_resources[] = { 313static struct resource net2272_bfin_resources[] = {
314 { 314 {
315 .start = 0x20300000, 315 .start = 0x20300000,
@@ -330,8 +330,7 @@ static struct platform_device net2272_bfin_device = {
330}; 330};
331#endif 331#endif
332 332
333#if defined(CONFIG_MTD_M25P80) \ 333#if IS_ENABLED(CONFIG_MTD_M25P80)
334 || defined(CONFIG_MTD_M25P80_MODULE)
335static struct mtd_partition bfin_spi_flash_partitions[] = { 334static struct mtd_partition bfin_spi_flash_partitions[] = {
336 { 335 {
337 .name = "bootloader(spi)", 336 .name = "bootloader(spi)",
@@ -358,13 +357,13 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
358}; 357};
359#endif 358#endif
360 359
361#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 360#if IS_ENABLED(CONFIG_MMC_SPI)
362static struct bfin5xx_spi_chip mmc_spi_chip_info = { 361static struct bfin5xx_spi_chip mmc_spi_chip_info = {
363 .enable_dma = 0, 362 .enable_dma = 0,
364}; 363};
365#endif 364#endif
366 365
367#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 366#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
368static const struct ad7877_platform_data bfin_ad7877_ts_info = { 367static const struct ad7877_platform_data bfin_ad7877_ts_info = {
369 .model = 7877, 368 .model = 7877,
370 .vref_delay_usecs = 50, /* internal, no capacitor */ 369 .vref_delay_usecs = 50, /* internal, no capacitor */
@@ -381,8 +380,7 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = {
381#endif 380#endif
382 381
383static struct spi_board_info bfin_spi_board_info[] __initdata = { 382static struct spi_board_info bfin_spi_board_info[] __initdata = {
384#if defined(CONFIG_MTD_M25P80) \ 383#if IS_ENABLED(CONFIG_MTD_M25P80)
385 || defined(CONFIG_MTD_M25P80_MODULE)
386 { 384 {
387 /* the modalias must be the same as spi device driver name */ 385 /* the modalias must be the same as spi device driver name */
388 .modalias = "m25p80", /* Name of spi_driver for this device */ 386 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -395,8 +393,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
395 }, 393 },
396#endif 394#endif
397 395
398#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \ 396#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD183X)
399 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
400 { 397 {
401 .modalias = "ad183x", 398 .modalias = "ad183x",
402 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 399 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -404,7 +401,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
404 .chip_select = 4, 401 .chip_select = 4,
405 }, 402 },
406#endif 403#endif
407#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 404#if IS_ENABLED(CONFIG_MMC_SPI)
408 { 405 {
409 .modalias = "mmc_spi", 406 .modalias = "mmc_spi",
410 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 407 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
@@ -414,7 +411,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
414 .mode = SPI_MODE_3, 411 .mode = SPI_MODE_3,
415 }, 412 },
416#endif 413#endif
417#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 414#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
418 { 415 {
419 .modalias = "ad7877", 416 .modalias = "ad7877",
420 .platform_data = &bfin_ad7877_ts_info, 417 .platform_data = &bfin_ad7877_ts_info,
@@ -424,7 +421,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
424 .chip_select = 2, 421 .chip_select = 2,
425 }, 422 },
426#endif 423#endif
427#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \ 424#if IS_ENABLED(CONFIG_SND_SOC_WM8731) \
428 && defined(CONFIG_SND_SOC_WM8731_SPI) 425 && defined(CONFIG_SND_SOC_WM8731_SPI)
429 { 426 {
430 .modalias = "wm8731", 427 .modalias = "wm8731",
@@ -434,7 +431,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
434 .mode = SPI_MODE_0, 431 .mode = SPI_MODE_0,
435 }, 432 },
436#endif 433#endif
437#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 434#if IS_ENABLED(CONFIG_SPI_SPIDEV)
438 { 435 {
439 .modalias = "spidev", 436 .modalias = "spidev",
440 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 437 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -444,7 +441,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
444#endif 441#endif
445}; 442};
446 443
447#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 444#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
448/* SPI controller data */ 445/* SPI controller data */
449static struct bfin5xx_spi_master bfin_spi0_info = { 446static struct bfin5xx_spi_master bfin_spi0_info = {
450 .num_chipselect = 8, 447 .num_chipselect = 8,
@@ -482,7 +479,7 @@ static struct platform_device bfin_spi0_device = {
482}; 479};
483#endif /* spi master and devices */ 480#endif /* spi master and devices */
484 481
485#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE) 482#if IS_ENABLED(CONFIG_MTD_GPIO_ADDR)
486static struct mtd_partition cm_partitions[] = { 483static struct mtd_partition cm_partitions[] = {
487 { 484 {
488 .name = "bootloader(nor)", 485 .name = "bootloader(nor)",
@@ -531,7 +528,7 @@ static struct platform_device cm_flash_device = {
531}; 528};
532#endif 529#endif
533 530
534#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 531#if IS_ENABLED(CONFIG_SERIAL_BFIN)
535#ifdef CONFIG_SERIAL_BFIN_UART0 532#ifdef CONFIG_SERIAL_BFIN_UART0
536static struct resource bfin_uart0_resources[] = { 533static struct resource bfin_uart0_resources[] = {
537 { 534 {
@@ -642,7 +639,7 @@ static struct platform_device bfin_uart1_device = {
642#endif 639#endif
643#endif 640#endif
644 641
645#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 642#if IS_ENABLED(CONFIG_BFIN_SIR)
646#ifdef CONFIG_BFIN_SIR0 643#ifdef CONFIG_BFIN_SIR0
647static struct resource bfin_sir0_resources[] = { 644static struct resource bfin_sir0_resources[] = {
648 { 645 {
@@ -697,7 +694,7 @@ static struct platform_device bfin_sir1_device = {
697#endif 694#endif
698#endif 695#endif
699 696
700#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 697#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
701static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; 698static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
702 699
703static struct resource bfin_twi0_resource[] = { 700static struct resource bfin_twi0_resource[] = {
@@ -725,25 +722,25 @@ static struct platform_device i2c_bfin_twi_device = {
725#endif 722#endif
726 723
727static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 724static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
728#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) 725#if IS_ENABLED(CONFIG_BFIN_TWI_LCD)
729 { 726 {
730 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 727 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
731 }, 728 },
732#endif 729#endif
733#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE) 730#if IS_ENABLED(CONFIG_INPUT_PCF8574)
734 { 731 {
735 I2C_BOARD_INFO("pcf8574_keypad", 0x27), 732 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
736 .irq = IRQ_PF8, 733 .irq = IRQ_PF8,
737 }, 734 },
738#endif 735#endif
739#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) 736#if IS_ENABLED(CONFIG_FB_BFIN_7393)
740 { 737 {
741 I2C_BOARD_INFO("bfin-adv7393", 0x2B), 738 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
742 }, 739 },
743#endif 740#endif
744}; 741};
745 742
746#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 743#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
747#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 744#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
748static struct resource bfin_sport0_uart_resources[] = { 745static struct resource bfin_sport0_uart_resources[] = {
749 { 746 {
@@ -814,7 +811,7 @@ static struct platform_device bfin_sport1_uart_device = {
814#endif 811#endif
815#endif 812#endif
816 813
817#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 814#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
818#include <linux/input.h> 815#include <linux/input.h>
819#include <linux/gpio_keys.h> 816#include <linux/gpio_keys.h>
820 817
@@ -861,48 +858,48 @@ static struct platform_device *cmbf527_devices[] __initdata = {
861 858
862 &bfin_dpmc, 859 &bfin_dpmc,
863 860
864#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) 861#if IS_ENABLED(CONFIG_MTD_NAND_BF5XX)
865 &bf5xx_nand_device, 862 &bf5xx_nand_device,
866#endif 863#endif
867 864
868#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) 865#if IS_ENABLED(CONFIG_BFIN_CFPCMCIA)
869 &bfin_pcmcia_cf_device, 866 &bfin_pcmcia_cf_device,
870#endif 867#endif
871 868
872#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 869#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
873 &rtc_device, 870 &rtc_device,
874#endif 871#endif
875 872
876#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) 873#if IS_ENABLED(CONFIG_USB_ISP1760_HCD)
877 &bfin_isp1760_device, 874 &bfin_isp1760_device,
878#endif 875#endif
879 876
880#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 877#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
881 &musb_device, 878 &musb_device,
882#endif 879#endif
883 880
884#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 881#if IS_ENABLED(CONFIG_SMC91X)
885 &smc91x_device, 882 &smc91x_device,
886#endif 883#endif
887 884
888#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) 885#if IS_ENABLED(CONFIG_DM9000)
889 &dm9000_device, 886 &dm9000_device,
890#endif 887#endif
891 888
892#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 889#if IS_ENABLED(CONFIG_BFIN_MAC)
893 &bfin_mii_bus, 890 &bfin_mii_bus,
894 &bfin_mac_device, 891 &bfin_mac_device,
895#endif 892#endif
896 893
897#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 894#if IS_ENABLED(CONFIG_USB_NET2272)
898 &net2272_bfin_device, 895 &net2272_bfin_device,
899#endif 896#endif
900 897
901#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 898#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
902 &bfin_spi0_device, 899 &bfin_spi0_device,
903#endif 900#endif
904 901
905#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 902#if IS_ENABLED(CONFIG_SERIAL_BFIN)
906#ifdef CONFIG_SERIAL_BFIN_UART0 903#ifdef CONFIG_SERIAL_BFIN_UART0
907 &bfin_uart0_device, 904 &bfin_uart0_device,
908#endif 905#endif
@@ -911,7 +908,7 @@ static struct platform_device *cmbf527_devices[] __initdata = {
911#endif 908#endif
912#endif 909#endif
913 910
914#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 911#if IS_ENABLED(CONFIG_BFIN_SIR)
915#ifdef CONFIG_BFIN_SIR0 912#ifdef CONFIG_BFIN_SIR0
916 &bfin_sir0_device, 913 &bfin_sir0_device,
917#endif 914#endif
@@ -920,11 +917,11 @@ static struct platform_device *cmbf527_devices[] __initdata = {
920#endif 917#endif
921#endif 918#endif
922 919
923#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 920#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
924 &i2c_bfin_twi_device, 921 &i2c_bfin_twi_device,
925#endif 922#endif
926 923
927#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 924#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
928#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 925#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
929 &bfin_sport0_uart_device, 926 &bfin_sport0_uart_device,
930#endif 927#endif
@@ -933,11 +930,11 @@ static struct platform_device *cmbf527_devices[] __initdata = {
933#endif 930#endif
934#endif 931#endif
935 932
936#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 933#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
937 &bfin_device_gpiokeys, 934 &bfin_device_gpiokeys,
938#endif 935#endif
939 936
940#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE) 937#if IS_ENABLED(CONFIG_MTD_GPIO_ADDR)
941 &cm_flash_device, 938 &cm_flash_device,
942#endif 939#endif
943}; 940};
diff --git a/arch/blackfin/mach-bf527/boards/ezbrd.c b/arch/blackfin/mach-bf527/boards/ezbrd.c
index 50bda79194e5..a3a572352769 100644
--- a/arch/blackfin/mach-bf527/boards/ezbrd.c
+++ b/arch/blackfin/mach-bf527/boards/ezbrd.c
@@ -36,7 +36,7 @@ const char bfin_board_name[] = "ADI BF526-EZBRD";
36 * Driver needs to know address, irq and flag pin. 36 * Driver needs to know address, irq and flag pin.
37 */ 37 */
38 38
39#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 39#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
40static struct resource musb_resources[] = { 40static struct resource musb_resources[] = {
41 [0] = { 41 [0] = {
42 .start = 0xffc03800, 42 .start = 0xffc03800,
@@ -98,7 +98,7 @@ static struct platform_device musb_device = {
98}; 98};
99#endif 99#endif
100 100
101#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 101#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
102static struct mtd_partition ezbrd_partitions[] = { 102static struct mtd_partition ezbrd_partitions[] = {
103 { 103 {
104 .name = "bootloader(nor)", 104 .name = "bootloader(nor)",
@@ -138,7 +138,7 @@ static struct platform_device ezbrd_flash_device = {
138}; 138};
139#endif 139#endif
140 140
141#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) 141#if IS_ENABLED(CONFIG_MTD_NAND_BF5XX)
142static struct mtd_partition partition_info[] = { 142static struct mtd_partition partition_info[] = {
143 { 143 {
144 .name = "bootloader(nand)", 144 .name = "bootloader(nand)",
@@ -188,7 +188,7 @@ static struct platform_device bf5xx_nand_device = {
188}; 188};
189#endif 189#endif
190 190
191#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 191#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
192static struct platform_device rtc_device = { 192static struct platform_device rtc_device = {
193 .name = "rtc-bfin", 193 .name = "rtc-bfin",
194 .id = -1, 194 .id = -1,
@@ -196,7 +196,7 @@ static struct platform_device rtc_device = {
196#endif 196#endif
197 197
198 198
199#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 199#if IS_ENABLED(CONFIG_BFIN_MAC)
200#include <linux/bfin_mac.h> 200#include <linux/bfin_mac.h>
201static const unsigned short bfin_mac_peripherals[] = P_RMII0; 201static const unsigned short bfin_mac_peripherals[] = P_RMII0;
202 202
@@ -229,8 +229,7 @@ static struct platform_device bfin_mac_device = {
229}; 229};
230#endif 230#endif
231 231
232#if defined(CONFIG_MTD_M25P80) \ 232#if IS_ENABLED(CONFIG_MTD_M25P80)
233 || defined(CONFIG_MTD_M25P80_MODULE)
234static struct mtd_partition bfin_spi_flash_partitions[] = { 233static struct mtd_partition bfin_spi_flash_partitions[] = {
235 { 234 {
236 .name = "bootloader(spi)", 235 .name = "bootloader(spi)",
@@ -257,13 +256,13 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
257}; 256};
258#endif 257#endif
259 258
260#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 259#if IS_ENABLED(CONFIG_MMC_SPI)
261static struct bfin5xx_spi_chip mmc_spi_chip_info = { 260static struct bfin5xx_spi_chip mmc_spi_chip_info = {
262 .enable_dma = 0, 261 .enable_dma = 0,
263}; 262};
264#endif 263#endif
265 264
266#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 265#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
267static const struct ad7877_platform_data bfin_ad7877_ts_info = { 266static const struct ad7877_platform_data bfin_ad7877_ts_info = {
268 .model = 7877, 267 .model = 7877,
269 .vref_delay_usecs = 50, /* internal, no capacitor */ 268 .vref_delay_usecs = 50, /* internal, no capacitor */
@@ -279,7 +278,7 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = {
279}; 278};
280#endif 279#endif
281 280
282#if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE) 281#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7879)
283#include <linux/spi/ad7879.h> 282#include <linux/spi/ad7879.h>
284static const struct ad7879_platform_data bfin_ad7879_ts_info = { 283static const struct ad7879_platform_data bfin_ad7879_ts_info = {
285 .model = 7879, /* Model = AD7879 */ 284 .model = 7879, /* Model = AD7879 */
@@ -297,8 +296,7 @@ static const struct ad7879_platform_data bfin_ad7879_ts_info = {
297#endif 296#endif
298 297
299static struct spi_board_info bfin_spi_board_info[] __initdata = { 298static struct spi_board_info bfin_spi_board_info[] __initdata = {
300#if defined(CONFIG_MTD_M25P80) \ 299#if IS_ENABLED(CONFIG_MTD_M25P80)
301 || defined(CONFIG_MTD_M25P80_MODULE)
302 { 300 {
303 /* the modalias must be the same as spi device driver name */ 301 /* the modalias must be the same as spi device driver name */
304 .modalias = "m25p80", /* Name of spi_driver for this device */ 302 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -311,7 +309,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
311 }, 309 },
312#endif 310#endif
313 311
314#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 312#if IS_ENABLED(CONFIG_MMC_SPI)
315 { 313 {
316 .modalias = "mmc_spi", 314 .modalias = "mmc_spi",
317 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 315 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
@@ -321,7 +319,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
321 .mode = SPI_MODE_3, 319 .mode = SPI_MODE_3,
322 }, 320 },
323#endif 321#endif
324#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 322#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
325 { 323 {
326 .modalias = "ad7877", 324 .modalias = "ad7877",
327 .platform_data = &bfin_ad7877_ts_info, 325 .platform_data = &bfin_ad7877_ts_info,
@@ -331,7 +329,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
331 .chip_select = 2, 329 .chip_select = 2,
332 }, 330 },
333#endif 331#endif
334#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE) 332#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7879_SPI)
335 { 333 {
336 .modalias = "ad7879", 334 .modalias = "ad7879",
337 .platform_data = &bfin_ad7879_ts_info, 335 .platform_data = &bfin_ad7879_ts_info,
@@ -342,7 +340,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
342 .mode = SPI_CPHA | SPI_CPOL, 340 .mode = SPI_CPHA | SPI_CPOL,
343 }, 341 },
344#endif 342#endif
345#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \ 343#if IS_ENABLED(CONFIG_SND_SOC_WM8731) \
346 && defined(CONFIG_SND_SOC_WM8731_SPI) 344 && defined(CONFIG_SND_SOC_WM8731_SPI)
347 { 345 {
348 .modalias = "wm8731", 346 .modalias = "wm8731",
@@ -352,7 +350,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
352 .mode = SPI_MODE_0, 350 .mode = SPI_MODE_0,
353 }, 351 },
354#endif 352#endif
355#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 353#if IS_ENABLED(CONFIG_SPI_SPIDEV)
356 { 354 {
357 .modalias = "spidev", 355 .modalias = "spidev",
358 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 356 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -360,7 +358,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
360 .chip_select = 1, 358 .chip_select = 1,
361 }, 359 },
362#endif 360#endif
363#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 361#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)
364 { 362 {
365 .modalias = "bfin-lq035q1-spi", 363 .modalias = "bfin-lq035q1-spi",
366 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 364 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
@@ -371,7 +369,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
371#endif 369#endif
372}; 370};
373 371
374#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 372#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
375/* SPI controller data */ 373/* SPI controller data */
376static struct bfin5xx_spi_master bfin_spi0_info = { 374static struct bfin5xx_spi_master bfin_spi0_info = {
377 .num_chipselect = 8, 375 .num_chipselect = 8,
@@ -409,7 +407,7 @@ static struct platform_device bfin_spi0_device = {
409}; 407};
410#endif /* spi master and devices */ 408#endif /* spi master and devices */
411 409
412#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 410#if IS_ENABLED(CONFIG_SERIAL_BFIN)
413#ifdef CONFIG_SERIAL_BFIN_UART0 411#ifdef CONFIG_SERIAL_BFIN_UART0
414static struct resource bfin_uart0_resources[] = { 412static struct resource bfin_uart0_resources[] = {
415 { 413 {
@@ -520,7 +518,7 @@ static struct platform_device bfin_uart1_device = {
520#endif 518#endif
521#endif 519#endif
522 520
523#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 521#if IS_ENABLED(CONFIG_BFIN_SIR)
524#ifdef CONFIG_BFIN_SIR0 522#ifdef CONFIG_BFIN_SIR0
525static struct resource bfin_sir0_resources[] = { 523static struct resource bfin_sir0_resources[] = {
526 { 524 {
@@ -575,7 +573,7 @@ static struct platform_device bfin_sir1_device = {
575#endif 573#endif
576#endif 574#endif
577 575
578#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 576#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
579static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; 577static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
580 578
581static struct resource bfin_twi0_resource[] = { 579static struct resource bfin_twi0_resource[] = {
@@ -603,12 +601,12 @@ static struct platform_device i2c_bfin_twi_device = {
603#endif 601#endif
604 602
605static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 603static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
606#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) 604#if IS_ENABLED(CONFIG_BFIN_TWI_LCD)
607 { 605 {
608 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 606 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
609 }, 607 },
610#endif 608#endif
611#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE) 609#if IS_ENABLED(CONFIG_INPUT_PCF8574)
612 { 610 {
613 I2C_BOARD_INFO("pcf8574_keypad", 0x27), 611 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
614 .irq = IRQ_PF8, 612 .irq = IRQ_PF8,
@@ -616,7 +614,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
616#endif 614#endif
617}; 615};
618 616
619#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 617#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
620#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 618#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
621static struct resource bfin_sport0_uart_resources[] = { 619static struct resource bfin_sport0_uart_resources[] = {
622 { 620 {
@@ -687,7 +685,7 @@ static struct platform_device bfin_sport1_uart_device = {
687#endif 685#endif
688#endif 686#endif
689 687
690#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 688#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
691#include <linux/input.h> 689#include <linux/input.h>
692#include <linux/gpio_keys.h> 690#include <linux/gpio_keys.h>
693 691
@@ -731,7 +729,7 @@ static struct platform_device bfin_dpmc = {
731 }, 729 },
732}; 730};
733 731
734#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 732#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)
735#include <asm/bfin-lq035q1.h> 733#include <asm/bfin-lq035q1.h>
736 734
737static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = { 735static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
@@ -764,28 +762,28 @@ static struct platform_device *stamp_devices[] __initdata = {
764 762
765 &bfin_dpmc, 763 &bfin_dpmc,
766 764
767#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) 765#if IS_ENABLED(CONFIG_MTD_NAND_BF5XX)
768 &bf5xx_nand_device, 766 &bf5xx_nand_device,
769#endif 767#endif
770 768
771#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 769#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
772 &rtc_device, 770 &rtc_device,
773#endif 771#endif
774 772
775#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 773#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
776 &musb_device, 774 &musb_device,
777#endif 775#endif
778 776
779#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 777#if IS_ENABLED(CONFIG_BFIN_MAC)
780 &bfin_mii_bus, 778 &bfin_mii_bus,
781 &bfin_mac_device, 779 &bfin_mac_device,
782#endif 780#endif
783 781
784#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 782#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
785 &bfin_spi0_device, 783 &bfin_spi0_device,
786#endif 784#endif
787 785
788#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 786#if IS_ENABLED(CONFIG_SERIAL_BFIN)
789#ifdef CONFIG_SERIAL_BFIN_UART0 787#ifdef CONFIG_SERIAL_BFIN_UART0
790 &bfin_uart0_device, 788 &bfin_uart0_device,
791#endif 789#endif
@@ -794,11 +792,11 @@ static struct platform_device *stamp_devices[] __initdata = {
794#endif 792#endif
795#endif 793#endif
796 794
797#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 795#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)
798 &bfin_lq035q1_device, 796 &bfin_lq035q1_device,
799#endif 797#endif
800 798
801#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 799#if IS_ENABLED(CONFIG_BFIN_SIR)
802#ifdef CONFIG_BFIN_SIR0 800#ifdef CONFIG_BFIN_SIR0
803 &bfin_sir0_device, 801 &bfin_sir0_device,
804#endif 802#endif
@@ -807,11 +805,11 @@ static struct platform_device *stamp_devices[] __initdata = {
807#endif 805#endif
808#endif 806#endif
809 807
810#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 808#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
811 &i2c_bfin_twi_device, 809 &i2c_bfin_twi_device,
812#endif 810#endif
813 811
814#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 812#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
815#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 813#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
816 &bfin_sport0_uart_device, 814 &bfin_sport0_uart_device,
817#endif 815#endif
@@ -820,11 +818,11 @@ static struct platform_device *stamp_devices[] __initdata = {
820#endif 818#endif
821#endif 819#endif
822 820
823#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 821#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
824 &bfin_device_gpiokeys, 822 &bfin_device_gpiokeys,
825#endif 823#endif
826 824
827#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 825#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
828 &ezbrd_flash_device, 826 &ezbrd_flash_device,
829#endif 827#endif
830}; 828};
diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c
index d0a0c5e527cd..d64f565dc2a0 100644
--- a/arch/blackfin/mach-bf527/boards/ezkit.c
+++ b/arch/blackfin/mach-bf527/boards/ezkit.c
@@ -42,7 +42,7 @@ const char bfin_board_name[] = "ADI BF527-EZKIT";
42 * Driver needs to know address, irq and flag pin. 42 * Driver needs to know address, irq and flag pin.
43 */ 43 */
44 44
45#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) 45#if IS_ENABLED(CONFIG_USB_ISP1760_HCD)
46#include <linux/usb/isp1760.h> 46#include <linux/usb/isp1760.h>
47static struct resource bfin_isp1760_resources[] = { 47static struct resource bfin_isp1760_resources[] = {
48 [0] = { 48 [0] = {
@@ -77,7 +77,7 @@ static struct platform_device bfin_isp1760_device = {
77}; 77};
78#endif 78#endif
79 79
80#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 80#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
81static struct resource musb_resources[] = { 81static struct resource musb_resources[] = {
82 [0] = { 82 [0] = {
83 .start = 0xffc03800, 83 .start = 0xffc03800,
@@ -139,7 +139,7 @@ static struct platform_device musb_device = {
139}; 139};
140#endif 140#endif
141 141
142#if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE) 142#if IS_ENABLED(CONFIG_FB_BFIN_T350MCQB)
143 143
144static struct resource bf52x_t350mcqb_resources[] = { 144static struct resource bf52x_t350mcqb_resources[] = {
145 { 145 {
@@ -157,7 +157,7 @@ static struct platform_device bf52x_t350mcqb_device = {
157}; 157};
158#endif 158#endif
159 159
160#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 160#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)
161#include <asm/bfin-lq035q1.h> 161#include <asm/bfin-lq035q1.h>
162 162
163static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = { 163static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
@@ -184,7 +184,7 @@ static struct platform_device bfin_lq035q1_device = {
184}; 184};
185#endif 185#endif
186 186
187#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 187#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
188static struct mtd_partition ezkit_partitions[] = { 188static struct mtd_partition ezkit_partitions[] = {
189 { 189 {
190 .name = "bootloader(nor)", 190 .name = "bootloader(nor)",
@@ -224,7 +224,7 @@ static struct platform_device ezkit_flash_device = {
224}; 224};
225#endif 225#endif
226 226
227#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) 227#if IS_ENABLED(CONFIG_MTD_NAND_BF5XX)
228static struct mtd_partition partition_info[] = { 228static struct mtd_partition partition_info[] = {
229 { 229 {
230 .name = "bootloader(nand)", 230 .name = "bootloader(nand)",
@@ -274,7 +274,7 @@ static struct platform_device bf5xx_nand_device = {
274}; 274};
275#endif 275#endif
276 276
277#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) 277#if IS_ENABLED(CONFIG_BFIN_CFPCMCIA)
278static struct resource bfin_pcmcia_cf_resources[] = { 278static struct resource bfin_pcmcia_cf_resources[] = {
279 { 279 {
280 .start = 0x20310000, /* IO PORT */ 280 .start = 0x20310000, /* IO PORT */
@@ -303,14 +303,14 @@ static struct platform_device bfin_pcmcia_cf_device = {
303}; 303};
304#endif 304#endif
305 305
306#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 306#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
307static struct platform_device rtc_device = { 307static struct platform_device rtc_device = {
308 .name = "rtc-bfin", 308 .name = "rtc-bfin",
309 .id = -1, 309 .id = -1,
310}; 310};
311#endif 311#endif
312 312
313#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 313#if IS_ENABLED(CONFIG_SMC91X)
314#include <linux/smc91x.h> 314#include <linux/smc91x.h>
315 315
316static struct smc91x_platdata smc91x_info = { 316static struct smc91x_platdata smc91x_info = {
@@ -343,7 +343,7 @@ static struct platform_device smc91x_device = {
343}; 343};
344#endif 344#endif
345 345
346#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) 346#if IS_ENABLED(CONFIG_DM9000)
347static struct resource dm9000_resources[] = { 347static struct resource dm9000_resources[] = {
348 [0] = { 348 [0] = {
349 .start = 0x203FB800, 349 .start = 0x203FB800,
@@ -370,7 +370,7 @@ static struct platform_device dm9000_device = {
370}; 370};
371#endif 371#endif
372 372
373#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 373#if IS_ENABLED(CONFIG_BFIN_MAC)
374#include <linux/bfin_mac.h> 374#include <linux/bfin_mac.h>
375static const unsigned short bfin_mac_peripherals[] = P_RMII0; 375static const unsigned short bfin_mac_peripherals[] = P_RMII0;
376 376
@@ -403,7 +403,7 @@ static struct platform_device bfin_mac_device = {
403}; 403};
404#endif 404#endif
405 405
406#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 406#if IS_ENABLED(CONFIG_USB_NET2272)
407static struct resource net2272_bfin_resources[] = { 407static struct resource net2272_bfin_resources[] = {
408 { 408 {
409 .start = 0x20300000, 409 .start = 0x20300000,
@@ -427,8 +427,7 @@ static struct platform_device net2272_bfin_device = {
427}; 427};
428#endif 428#endif
429 429
430#if defined(CONFIG_MTD_M25P80) \ 430#if IS_ENABLED(CONFIG_MTD_M25P80)
431 || defined(CONFIG_MTD_M25P80_MODULE)
432static struct mtd_partition bfin_spi_flash_partitions[] = { 431static struct mtd_partition bfin_spi_flash_partitions[] = {
433 { 432 {
434 .name = "bootloader(spi)", 433 .name = "bootloader(spi)",
@@ -455,13 +454,13 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
455}; 454};
456#endif 455#endif
457 456
458#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 457#if IS_ENABLED(CONFIG_MMC_SPI)
459static struct bfin5xx_spi_chip mmc_spi_chip_info = { 458static struct bfin5xx_spi_chip mmc_spi_chip_info = {
460 .enable_dma = 0, 459 .enable_dma = 0,
461}; 460};
462#endif 461#endif
463 462
464#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 463#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
465static const struct ad7877_platform_data bfin_ad7877_ts_info = { 464static const struct ad7877_platform_data bfin_ad7877_ts_info = {
466 .model = 7877, 465 .model = 7877,
467 .vref_delay_usecs = 50, /* internal, no capacitor */ 466 .vref_delay_usecs = 50, /* internal, no capacitor */
@@ -477,7 +476,7 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = {
477}; 476};
478#endif 477#endif
479 478
480#if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE) 479#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7879)
481#include <linux/spi/ad7879.h> 480#include <linux/spi/ad7879.h>
482static const struct ad7879_platform_data bfin_ad7879_ts_info = { 481static const struct ad7879_platform_data bfin_ad7879_ts_info = {
483 .model = 7879, /* Model = AD7879 */ 482 .model = 7879, /* Model = AD7879 */
@@ -493,7 +492,7 @@ static const struct ad7879_platform_data bfin_ad7879_ts_info = {
493}; 492};
494#endif 493#endif
495 494
496#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 495#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
497 496
498static const u16 bfin_snd_pin[][7] = { 497static const u16 bfin_snd_pin[][7] = {
499 {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, 498 {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
@@ -541,21 +540,21 @@ static struct resource bfin_snd_resources[][4] = {
541}; 540};
542#endif 541#endif
543 542
544#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 543#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
545static struct platform_device bfin_i2s_pcm = { 544static struct platform_device bfin_i2s_pcm = {
546 .name = "bfin-i2s-pcm-audio", 545 .name = "bfin-i2s-pcm-audio",
547 .id = -1, 546 .id = -1,
548}; 547};
549#endif 548#endif
550 549
551#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 550#if IS_ENABLED(CONFIG_SND_BF5XX_AC97)
552static struct platform_device bfin_ac97_pcm = { 551static struct platform_device bfin_ac97_pcm = {
553 .name = "bfin-ac97-pcm-audio", 552 .name = "bfin-ac97-pcm-audio",
554 .id = -1, 553 .id = -1,
555}; 554};
556#endif 555#endif
557 556
558#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 557#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
559static struct platform_device bfin_i2s = { 558static struct platform_device bfin_i2s = {
560 .name = "bfin-i2s", 559 .name = "bfin-i2s",
561 .id = CONFIG_SND_BF5XX_SPORT_NUM, 560 .id = CONFIG_SND_BF5XX_SPORT_NUM,
@@ -567,8 +566,7 @@ static struct platform_device bfin_i2s = {
567}; 566};
568#endif 567#endif
569 568
570#if defined(CONFIG_SND_BF5XX_SOC_AD1836) \ 569#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836)
571 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
572static const char * const ad1836_link[] = { 570static const char * const ad1836_link[] = {
573 "bfin-i2s.0", 571 "bfin-i2s.0",
574 "spi0.4", 572 "spi0.4",
@@ -583,8 +581,7 @@ static struct platform_device bfin_ad1836_machine = {
583#endif 581#endif
584 582
585static struct spi_board_info bfin_spi_board_info[] __initdata = { 583static struct spi_board_info bfin_spi_board_info[] __initdata = {
586#if defined(CONFIG_MTD_M25P80) \ 584#if IS_ENABLED(CONFIG_MTD_M25P80)
587 || defined(CONFIG_MTD_M25P80_MODULE)
588 { 585 {
589 /* the modalias must be the same as spi device driver name */ 586 /* the modalias must be the same as spi device driver name */
590 .modalias = "m25p80", /* Name of spi_driver for this device */ 587 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -597,8 +594,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
597 }, 594 },
598#endif 595#endif
599 596
600#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \ 597#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD183X)
601 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
602 { 598 {
603 .modalias = "ad183x", 599 .modalias = "ad183x",
604 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 600 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -608,7 +604,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
608 .mode = SPI_MODE_3, 604 .mode = SPI_MODE_3,
609 }, 605 },
610#endif 606#endif
611#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 607#if IS_ENABLED(CONFIG_MMC_SPI)
612 { 608 {
613 .modalias = "mmc_spi", 609 .modalias = "mmc_spi",
614 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 610 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
@@ -619,7 +615,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
619 }, 615 },
620#endif 616#endif
621 617
622#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 618#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
623 { 619 {
624 .modalias = "ad7877", 620 .modalias = "ad7877",
625 .platform_data = &bfin_ad7877_ts_info, 621 .platform_data = &bfin_ad7877_ts_info,
@@ -629,7 +625,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
629 .chip_select = 2, 625 .chip_select = 2,
630 }, 626 },
631#endif 627#endif
632#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE) 628#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7879_SPI)
633 { 629 {
634 .modalias = "ad7879", 630 .modalias = "ad7879",
635 .platform_data = &bfin_ad7879_ts_info, 631 .platform_data = &bfin_ad7879_ts_info,
@@ -640,7 +636,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
640 .mode = SPI_CPHA | SPI_CPOL, 636 .mode = SPI_CPHA | SPI_CPOL,
641 }, 637 },
642#endif 638#endif
643#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 639#if IS_ENABLED(CONFIG_SPI_SPIDEV)
644 { 640 {
645 .modalias = "spidev", 641 .modalias = "spidev",
646 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 642 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -648,7 +644,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
648 .chip_select = 1, 644 .chip_select = 1,
649 }, 645 },
650#endif 646#endif
651#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 647#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)
652 { 648 {
653 .modalias = "bfin-lq035q1-spi", 649 .modalias = "bfin-lq035q1-spi",
654 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 650 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
@@ -659,7 +655,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
659#endif 655#endif
660}; 656};
661 657
662#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 658#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
663/* SPI controller data */ 659/* SPI controller data */
664static struct bfin5xx_spi_master bfin_spi0_info = { 660static struct bfin5xx_spi_master bfin_spi0_info = {
665 .num_chipselect = 8, 661 .num_chipselect = 8,
@@ -697,7 +693,7 @@ static struct platform_device bfin_spi0_device = {
697}; 693};
698#endif /* spi master and devices */ 694#endif /* spi master and devices */
699 695
700#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 696#if IS_ENABLED(CONFIG_SERIAL_BFIN)
701#ifdef CONFIG_SERIAL_BFIN_UART0 697#ifdef CONFIG_SERIAL_BFIN_UART0
702static struct resource bfin_uart0_resources[] = { 698static struct resource bfin_uart0_resources[] = {
703 { 699 {
@@ -808,7 +804,7 @@ static struct platform_device bfin_uart1_device = {
808#endif 804#endif
809#endif 805#endif
810 806
811#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 807#if IS_ENABLED(CONFIG_BFIN_SIR)
812#ifdef CONFIG_BFIN_SIR0 808#ifdef CONFIG_BFIN_SIR0
813static struct resource bfin_sir0_resources[] = { 809static struct resource bfin_sir0_resources[] = {
814 { 810 {
@@ -863,7 +859,7 @@ static struct platform_device bfin_sir1_device = {
863#endif 859#endif
864#endif 860#endif
865 861
866#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 862#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
867static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; 863static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
868 864
869static struct resource bfin_twi0_resource[] = { 865static struct resource bfin_twi0_resource[] = {
@@ -890,7 +886,7 @@ static struct platform_device i2c_bfin_twi_device = {
890}; 886};
891#endif 887#endif
892 888
893#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE) 889#if IS_ENABLED(CONFIG_PMIC_ADP5520)
894#include <linux/mfd/adp5520.h> 890#include <linux/mfd/adp5520.h>
895 891
896 /* 892 /*
@@ -956,54 +952,54 @@ static struct adp5520_platform_data adp5520_pdev_data = {
956#endif 952#endif
957 953
958static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 954static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
959#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) 955#if IS_ENABLED(CONFIG_BFIN_TWI_LCD)
960 { 956 {
961 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 957 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
962 }, 958 },
963#endif 959#endif
964#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE) 960#if IS_ENABLED(CONFIG_INPUT_PCF8574)
965 { 961 {
966 I2C_BOARD_INFO("pcf8574_keypad", 0x27), 962 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
967 .irq = IRQ_PF8, 963 .irq = IRQ_PF8,
968 }, 964 },
969#endif 965#endif
970#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) 966#if IS_ENABLED(CONFIG_FB_BFIN_7393)
971 { 967 {
972 I2C_BOARD_INFO("bfin-adv7393", 0x2B), 968 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
973 }, 969 },
974#endif 970#endif
975#if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE) 971#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7879_I2C)
976 { 972 {
977 I2C_BOARD_INFO("ad7879", 0x2C), 973 I2C_BOARD_INFO("ad7879", 0x2C),
978 .irq = IRQ_PF8, 974 .irq = IRQ_PF8,
979 .platform_data = (void *)&bfin_ad7879_ts_info, 975 .platform_data = (void *)&bfin_ad7879_ts_info,
980 }, 976 },
981#endif 977#endif
982#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE) 978#if IS_ENABLED(CONFIG_PMIC_ADP5520)
983 { 979 {
984 I2C_BOARD_INFO("pmic-adp5520", 0x32), 980 I2C_BOARD_INFO("pmic-adp5520", 0x32),
985 .irq = IRQ_PF9, 981 .irq = IRQ_PF9,
986 .platform_data = (void *)&adp5520_pdev_data, 982 .platform_data = (void *)&adp5520_pdev_data,
987 }, 983 },
988#endif 984#endif
989#if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE) 985#if IS_ENABLED(CONFIG_SND_SOC_SSM2602)
990 { 986 {
991 I2C_BOARD_INFO("ssm2602", 0x1b), 987 I2C_BOARD_INFO("ssm2602", 0x1b),
992 }, 988 },
993#endif 989#endif
994#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) 990#if IS_ENABLED(CONFIG_BFIN_TWI_LCD)
995 { 991 {
996 I2C_BOARD_INFO("ad5252", 0x2f), 992 I2C_BOARD_INFO("ad5252", 0x2f),
997 }, 993 },
998#endif 994#endif
999#if defined(CONFIG_SND_SOC_ADAU1373) || defined(CONFIG_SND_SOC_ADAU1373_MODULE) 995#if IS_ENABLED(CONFIG_SND_SOC_ADAU1373)
1000 { 996 {
1001 I2C_BOARD_INFO("adau1373", 0x1A), 997 I2C_BOARD_INFO("adau1373", 0x1A),
1002 }, 998 },
1003#endif 999#endif
1004}; 1000};
1005 1001
1006#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 1002#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
1007#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 1003#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1008static struct resource bfin_sport0_uart_resources[] = { 1004static struct resource bfin_sport0_uart_resources[] = {
1009 { 1005 {
@@ -1074,7 +1070,7 @@ static struct platform_device bfin_sport1_uart_device = {
1074#endif 1070#endif
1075#endif 1071#endif
1076 1072
1077#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 1073#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
1078#include <linux/gpio_keys.h> 1074#include <linux/gpio_keys.h>
1079 1075
1080static struct gpio_keys_button bfin_gpio_keys_table[] = { 1076static struct gpio_keys_button bfin_gpio_keys_table[] = {
@@ -1095,7 +1091,7 @@ static struct platform_device bfin_device_gpiokeys = {
1095}; 1091};
1096#endif 1092#endif
1097 1093
1098#if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE) 1094#if IS_ENABLED(CONFIG_INPUT_BFIN_ROTARY)
1099#include <asm/bfin_rotary.h> 1095#include <asm/bfin_rotary.h>
1100 1096
1101static struct bfin_rotary_platform_data bfin_rotary_data = { 1097static struct bfin_rotary_platform_data bfin_rotary_data = {
@@ -1153,56 +1149,56 @@ static struct platform_device *stamp_devices[] __initdata = {
1153 1149
1154 &bfin_dpmc, 1150 &bfin_dpmc,
1155 1151
1156#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) 1152#if IS_ENABLED(CONFIG_MTD_NAND_BF5XX)
1157 &bf5xx_nand_device, 1153 &bf5xx_nand_device,
1158#endif 1154#endif
1159 1155
1160#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) 1156#if IS_ENABLED(CONFIG_BFIN_CFPCMCIA)
1161 &bfin_pcmcia_cf_device, 1157 &bfin_pcmcia_cf_device,
1162#endif 1158#endif
1163 1159
1164#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 1160#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
1165 &rtc_device, 1161 &rtc_device,
1166#endif 1162#endif
1167 1163
1168#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) 1164#if IS_ENABLED(CONFIG_USB_ISP1760_HCD)
1169 &bfin_isp1760_device, 1165 &bfin_isp1760_device,
1170#endif 1166#endif
1171 1167
1172#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 1168#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
1173 &musb_device, 1169 &musb_device,
1174#endif 1170#endif
1175 1171
1176#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 1172#if IS_ENABLED(CONFIG_SMC91X)
1177 &smc91x_device, 1173 &smc91x_device,
1178#endif 1174#endif
1179 1175
1180#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) 1176#if IS_ENABLED(CONFIG_DM9000)
1181 &dm9000_device, 1177 &dm9000_device,
1182#endif 1178#endif
1183 1179
1184#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 1180#if IS_ENABLED(CONFIG_BFIN_MAC)
1185 &bfin_mii_bus, 1181 &bfin_mii_bus,
1186 &bfin_mac_device, 1182 &bfin_mac_device,
1187#endif 1183#endif
1188 1184
1189#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 1185#if IS_ENABLED(CONFIG_USB_NET2272)
1190 &net2272_bfin_device, 1186 &net2272_bfin_device,
1191#endif 1187#endif
1192 1188
1193#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 1189#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
1194 &bfin_spi0_device, 1190 &bfin_spi0_device,
1195#endif 1191#endif
1196 1192
1197#if defined(CONFIG_FB_BFIN_T350MCQB) || defined(CONFIG_FB_BFIN_T350MCQB_MODULE) 1193#if IS_ENABLED(CONFIG_FB_BFIN_T350MCQB)
1198 &bf52x_t350mcqb_device, 1194 &bf52x_t350mcqb_device,
1199#endif 1195#endif
1200 1196
1201#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 1197#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)
1202 &bfin_lq035q1_device, 1198 &bfin_lq035q1_device,
1203#endif 1199#endif
1204 1200
1205#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 1201#if IS_ENABLED(CONFIG_SERIAL_BFIN)
1206#ifdef CONFIG_SERIAL_BFIN_UART0 1202#ifdef CONFIG_SERIAL_BFIN_UART0
1207 &bfin_uart0_device, 1203 &bfin_uart0_device,
1208#endif 1204#endif
@@ -1211,7 +1207,7 @@ static struct platform_device *stamp_devices[] __initdata = {
1211#endif 1207#endif
1212#endif 1208#endif
1213 1209
1214#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 1210#if IS_ENABLED(CONFIG_BFIN_SIR)
1215#ifdef CONFIG_BFIN_SIR0 1211#ifdef CONFIG_BFIN_SIR0
1216 &bfin_sir0_device, 1212 &bfin_sir0_device,
1217#endif 1213#endif
@@ -1220,11 +1216,11 @@ static struct platform_device *stamp_devices[] __initdata = {
1220#endif 1216#endif
1221#endif 1217#endif
1222 1218
1223#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 1219#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
1224 &i2c_bfin_twi_device, 1220 &i2c_bfin_twi_device,
1225#endif 1221#endif
1226 1222
1227#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 1223#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
1228#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 1224#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1229 &bfin_sport0_uart_device, 1225 &bfin_sport0_uart_device,
1230#endif 1226#endif
@@ -1233,32 +1229,31 @@ static struct platform_device *stamp_devices[] __initdata = {
1233#endif 1229#endif
1234#endif 1230#endif
1235 1231
1236#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 1232#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
1237 &bfin_device_gpiokeys, 1233 &bfin_device_gpiokeys,
1238#endif 1234#endif
1239 1235
1240#if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE) 1236#if IS_ENABLED(CONFIG_INPUT_BFIN_ROTARY)
1241 &bfin_rotary_device, 1237 &bfin_rotary_device,
1242#endif 1238#endif
1243 1239
1244#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 1240#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
1245 &ezkit_flash_device, 1241 &ezkit_flash_device,
1246#endif 1242#endif
1247 1243
1248#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 1244#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
1249 &bfin_i2s_pcm, 1245 &bfin_i2s_pcm,
1250#endif 1246#endif
1251 1247
1252#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 1248#if IS_ENABLED(CONFIG_SND_BF5XX_AC97)
1253 &bfin_ac97_pcm, 1249 &bfin_ac97_pcm,
1254#endif 1250#endif
1255 1251
1256#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 1252#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
1257 &bfin_i2s, 1253 &bfin_i2s,
1258#endif 1254#endif
1259 1255
1260#if defined(CONFIG_SND_BF5XX_SOC_AD1836) || \ 1256#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836)
1261 defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
1262 &bfin_ad1836_machine, 1257 &bfin_ad1836_machine,
1263#endif 1258#endif
1264}; 1259};
diff --git a/arch/blackfin/mach-bf527/boards/tll6527m.c b/arch/blackfin/mach-bf527/boards/tll6527m.c
index 1509c5a8a3ff..a0f5856a5ff8 100644
--- a/arch/blackfin/mach-bf527/boards/tll6527m.c
+++ b/arch/blackfin/mach-bf527/boards/tll6527m.c
@@ -28,8 +28,7 @@
28#include <asm/portmux.h> 28#include <asm/portmux.h>
29#include <asm/dpmc.h> 29#include <asm/dpmc.h>
30 30
31#if defined(CONFIG_TOUCHSCREEN_AD7879) \ 31#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7879)
32 || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
33#include <linux/spi/ad7879.h> 32#include <linux/spi/ad7879.h>
34#define LCD_BACKLIGHT_GPIO 0x40 33#define LCD_BACKLIGHT_GPIO 0x40
35/* TLL6527M uses TLL7UIQ35 / ADI LCD EZ Extender. AD7879 AUX GPIO is used for 34/* TLL6527M uses TLL7UIQ35 / ADI LCD EZ Extender. AD7879 AUX GPIO is used for
@@ -45,7 +44,7 @@ const char bfin_board_name[] = "TLL6527M";
45 * Driver needs to know address, irq and flag pin. 44 * Driver needs to know address, irq and flag pin.
46 */ 45 */
47 46
48#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 47#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
49static struct resource musb_resources[] = { 48static struct resource musb_resources[] = {
50 [0] = { 49 [0] = {
51 .start = 0xffc03800, 50 .start = 0xffc03800,
@@ -104,7 +103,7 @@ static struct platform_device musb_device = {
104}; 103};
105#endif 104#endif
106 105
107#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 106#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)
108#include <asm/bfin-lq035q1.h> 107#include <asm/bfin-lq035q1.h>
109 108
110static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = { 109static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
@@ -133,7 +132,7 @@ static struct platform_device bfin_lq035q1_device = {
133}; 132};
134#endif 133#endif
135 134
136#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE) 135#if IS_ENABLED(CONFIG_MTD_GPIO_ADDR)
137static struct mtd_partition tll6527m_partitions[] = { 136static struct mtd_partition tll6527m_partitions[] = {
138 { 137 {
139 .name = "bootloader(nor)", 138 .name = "bootloader(nor)",
@@ -182,7 +181,7 @@ static struct platform_device tll6527m_flash_device = {
182}; 181};
183#endif 182#endif
184 183
185#if defined(CONFIG_GPIO_DECODER) || defined(CONFIG_GPIO_DECODER_MODULE) 184#if IS_ENABLED(CONFIG_GPIO_DECODER)
186/* An SN74LVC138A 3:8 decoder chip has been used to generate 7 augmented 185/* An SN74LVC138A 3:8 decoder chip has been used to generate 7 augmented
187 * outputs used as SPI CS lines for all SPI SLAVE devices on TLL6527v1-0. 186 * outputs used as SPI CS lines for all SPI SLAVE devices on TLL6527v1-0.
188 * EXP_GPIO_SPISEL_BASE is the base number for the expanded outputs being 187 * EXP_GPIO_SPISEL_BASE is the base number for the expanded outputs being
@@ -215,7 +214,7 @@ static struct platform_device spi_decoded_gpio = {
215 214
216#endif 215#endif
217 216
218#if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE) 217#if IS_ENABLED(CONFIG_INPUT_ADXL34X)
219#include <linux/input/adxl34x.h> 218#include <linux/input/adxl34x.h>
220static const struct adxl34x_platform_data adxl345_info = { 219static const struct adxl34x_platform_data adxl345_info = {
221 .x_axis_offset = 0, 220 .x_axis_offset = 0,
@@ -250,14 +249,14 @@ static const struct adxl34x_platform_data adxl345_info = {
250}; 249};
251#endif 250#endif
252 251
253#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 252#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
254static struct platform_device rtc_device = { 253static struct platform_device rtc_device = {
255 .name = "rtc-bfin", 254 .name = "rtc-bfin",
256 .id = -1, 255 .id = -1,
257}; 256};
258#endif 257#endif
259 258
260#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 259#if IS_ENABLED(CONFIG_BFIN_MAC)
261#include <linux/bfin_mac.h> 260#include <linux/bfin_mac.h>
262static const unsigned short bfin_mac_peripherals[] = P_RMII0; 261static const unsigned short bfin_mac_peripherals[] = P_RMII0;
263 262
@@ -290,8 +289,7 @@ static struct platform_device bfin_mac_device = {
290}; 289};
291#endif 290#endif
292 291
293#if defined(CONFIG_MTD_M25P80) \ 292#if IS_ENABLED(CONFIG_MTD_M25P80)
294 || defined(CONFIG_MTD_M25P80_MODULE)
295static struct mtd_partition bfin_spi_flash_partitions[] = { 293static struct mtd_partition bfin_spi_flash_partitions[] = {
296 { 294 {
297 .name = "bootloader(spi)", 295 .name = "bootloader(spi)",
@@ -318,14 +316,13 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
318}; 316};
319#endif 317#endif
320 318
321#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 319#if IS_ENABLED(CONFIG_MMC_SPI)
322static struct bfin5xx_spi_chip mmc_spi_chip_info = { 320static struct bfin5xx_spi_chip mmc_spi_chip_info = {
323 .enable_dma = 0, 321 .enable_dma = 0,
324}; 322};
325#endif 323#endif
326 324
327#if defined(CONFIG_TOUCHSCREEN_AD7879) \ 325#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7879)
328 || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
329static const struct ad7879_platform_data bfin_ad7879_ts_info = { 326static const struct ad7879_platform_data bfin_ad7879_ts_info = {
330 .model = 7879, /* Model = AD7879 */ 327 .model = 7879, /* Model = AD7879 */
331 .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */ 328 .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */
@@ -343,7 +340,7 @@ static const struct ad7879_platform_data bfin_ad7879_ts_info = {
343}; 340};
344#endif 341#endif
345 342
346#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 343#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
347static struct platform_device bfin_i2s = { 344static struct platform_device bfin_i2s = {
348 .name = "bfin-i2s", 345 .name = "bfin-i2s",
349 .id = CONFIG_SND_BF5XX_SPORT_NUM, 346 .id = CONFIG_SND_BF5XX_SPORT_NUM,
@@ -351,7 +348,7 @@ static struct platform_device bfin_i2s = {
351}; 348};
352#endif 349#endif
353 350
354#if defined(CONFIG_GPIO_MCP23S08) || defined(CONFIG_GPIO_MCP23S08_MODULE) 351#if IS_ENABLED(CONFIG_GPIO_MCP23S08)
355#include <linux/spi/mcp23s08.h> 352#include <linux/spi/mcp23s08.h>
356static const struct mcp23s08_platform_data bfin_mcp23s08_sys_gpio_info = { 353static const struct mcp23s08_platform_data bfin_mcp23s08_sys_gpio_info = {
357 .chip[0].is_present = true, 354 .chip[0].is_present = true,
@@ -364,8 +361,7 @@ static const struct mcp23s08_platform_data bfin_mcp23s08_usr_gpio_info = {
364#endif 361#endif
365 362
366static struct spi_board_info bfin_spi_board_info[] __initdata = { 363static struct spi_board_info bfin_spi_board_info[] __initdata = {
367#if defined(CONFIG_MTD_M25P80) \ 364#if IS_ENABLED(CONFIG_MTD_M25P80)
368 || defined(CONFIG_MTD_M25P80_MODULE)
369 { 365 {
370 /* the modalias must be the same as spi device driver name */ 366 /* the modalias must be the same as spi device driver name */
371 .modalias = "m25p80", /* Name of spi_driver for this device */ 367 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -381,7 +377,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
381 }, 377 },
382#endif 378#endif
383 379
384#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 380#if IS_ENABLED(CONFIG_MMC_SPI)
385 { 381 {
386 .modalias = "mmc_spi", 382 .modalias = "mmc_spi",
387/* 383/*
@@ -396,8 +392,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
396 .mode = SPI_MODE_0, 392 .mode = SPI_MODE_0,
397 }, 393 },
398#endif 394#endif
399#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) \ 395#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7879_SPI)
400 || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
401 { 396 {
402 .modalias = "ad7879", 397 .modalias = "ad7879",
403 .platform_data = &bfin_ad7879_ts_info, 398 .platform_data = &bfin_ad7879_ts_info,
@@ -409,7 +404,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
409 .mode = SPI_CPHA | SPI_CPOL, 404 .mode = SPI_CPHA | SPI_CPOL,
410 }, 405 },
411#endif 406#endif
412#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 407#if IS_ENABLED(CONFIG_SPI_SPIDEV)
413 { 408 {
414 .modalias = "spidev", 409 .modalias = "spidev",
415 .max_speed_hz = 10000000, 410 .max_speed_hz = 10000000,
@@ -419,7 +414,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
419 .mode = SPI_CPHA | SPI_CPOL, 414 .mode = SPI_CPHA | SPI_CPOL,
420 }, 415 },
421#endif 416#endif
422#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 417#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)
423 { 418 {
424 .modalias = "bfin-lq035q1-spi", 419 .modalias = "bfin-lq035q1-spi",
425 .max_speed_hz = 20000000, 420 .max_speed_hz = 20000000,
@@ -428,7 +423,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
428 .mode = SPI_CPHA | SPI_CPOL, 423 .mode = SPI_CPHA | SPI_CPOL,
429 }, 424 },
430#endif 425#endif
431#if defined(CONFIG_GPIO_MCP23S08) || defined(CONFIG_GPIO_MCP23S08_MODULE) 426#if IS_ENABLED(CONFIG_GPIO_MCP23S08)
432 { 427 {
433 .modalias = "mcp23s08", 428 .modalias = "mcp23s08",
434 .platform_data = &bfin_mcp23s08_sys_gpio_info, 429 .platform_data = &bfin_mcp23s08_sys_gpio_info,
@@ -448,7 +443,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
448#endif 443#endif
449}; 444};
450 445
451#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 446#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
452/* SPI controller data */ 447/* SPI controller data */
453static struct bfin5xx_spi_master bfin_spi0_info = { 448static struct bfin5xx_spi_master bfin_spi0_info = {
454 .num_chipselect = EXP_GPIO_SPISEL_BASE + 8 + MAX_CTRL_CS, 449 .num_chipselect = EXP_GPIO_SPISEL_BASE + 8 + MAX_CTRL_CS,
@@ -487,7 +482,7 @@ static struct platform_device bfin_spi0_device = {
487}; 482};
488#endif /* spi master and devices */ 483#endif /* spi master and devices */
489 484
490#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 485#if IS_ENABLED(CONFIG_SERIAL_BFIN)
491#ifdef CONFIG_SERIAL_BFIN_UART0 486#ifdef CONFIG_SERIAL_BFIN_UART0
492static struct resource bfin_uart0_resources[] = { 487static struct resource bfin_uart0_resources[] = {
493 { 488 {
@@ -600,7 +595,7 @@ static struct platform_device bfin_uart1_device = {
600#endif 595#endif
601#endif 596#endif
602 597
603#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 598#if IS_ENABLED(CONFIG_BFIN_SIR)
604#ifdef CONFIG_BFIN_SIR0 599#ifdef CONFIG_BFIN_SIR0
605static struct resource bfin_sir0_resources[] = { 600static struct resource bfin_sir0_resources[] = {
606 { 601 {
@@ -655,7 +650,7 @@ static struct platform_device bfin_sir1_device = {
655#endif 650#endif
656#endif 651#endif
657 652
658#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 653#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
659static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; 654static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
660 655
661static struct resource bfin_twi0_resource[] = { 656static struct resource bfin_twi0_resource[] = {
@@ -683,26 +678,25 @@ static struct platform_device i2c_bfin_twi_device = {
683#endif 678#endif
684 679
685static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 680static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
686#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) 681#if IS_ENABLED(CONFIG_BFIN_TWI_LCD)
687 { 682 {
688 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 683 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
689 }, 684 },
690#endif 685#endif
691 686
692#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) 687#if IS_ENABLED(CONFIG_FB_BFIN_7393)
693 { 688 {
694 I2C_BOARD_INFO("bfin-adv7393", 0x2B), 689 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
695 }, 690 },
696#endif 691#endif
697#if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) \ 692#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7879_I2C)
698 || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
699 { 693 {
700 I2C_BOARD_INFO("ad7879", 0x2C), 694 I2C_BOARD_INFO("ad7879", 0x2C),
701 .irq = IRQ_PH14, 695 .irq = IRQ_PH14,
702 .platform_data = (void *)&bfin_ad7879_ts_info, 696 .platform_data = (void *)&bfin_ad7879_ts_info,
703 }, 697 },
704#endif 698#endif
705#if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE) 699#if IS_ENABLED(CONFIG_SND_SOC_SSM2602)
706 { 700 {
707 I2C_BOARD_INFO("ssm2602", 0x1b), 701 I2C_BOARD_INFO("ssm2602", 0x1b),
708 }, 702 },
@@ -714,8 +708,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
714 { 708 {
715 I2C_BOARD_INFO("ltc3576", 0x09), 709 I2C_BOARD_INFO("ltc3576", 0x09),
716 }, 710 },
717#if defined(CONFIG_INPUT_ADXL34X_I2C) \ 711#if IS_ENABLED(CONFIG_INPUT_ADXL34X_I2C)
718 || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
719 { 712 {
720 I2C_BOARD_INFO("adxl34x", 0x53), 713 I2C_BOARD_INFO("adxl34x", 0x53),
721 .irq = IRQ_PH13, 714 .irq = IRQ_PH13,
@@ -724,8 +717,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
724#endif 717#endif
725}; 718};
726 719
727#if defined(CONFIG_SERIAL_BFIN_SPORT) \ 720#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
728 || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
729#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 721#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
730static struct resource bfin_sport0_uart_resources[] = { 722static struct resource bfin_sport0_uart_resources[] = {
731 { 723 {
@@ -823,28 +815,28 @@ static struct platform_device *tll6527m_devices[] __initdata = {
823 815
824 &bfin_dpmc, 816 &bfin_dpmc,
825 817
826#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 818#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
827 &rtc_device, 819 &rtc_device,
828#endif 820#endif
829 821
830#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 822#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
831 &musb_device, 823 &musb_device,
832#endif 824#endif
833 825
834#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 826#if IS_ENABLED(CONFIG_BFIN_MAC)
835 &bfin_mii_bus, 827 &bfin_mii_bus,
836 &bfin_mac_device, 828 &bfin_mac_device,
837#endif 829#endif
838 830
839#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 831#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
840 &bfin_spi0_device, 832 &bfin_spi0_device,
841#endif 833#endif
842 834
843#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 835#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)
844 &bfin_lq035q1_device, 836 &bfin_lq035q1_device,
845#endif 837#endif
846 838
847#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 839#if IS_ENABLED(CONFIG_SERIAL_BFIN)
848#ifdef CONFIG_SERIAL_BFIN_UART0 840#ifdef CONFIG_SERIAL_BFIN_UART0
849 &bfin_uart0_device, 841 &bfin_uart0_device,
850#endif 842#endif
@@ -853,7 +845,7 @@ static struct platform_device *tll6527m_devices[] __initdata = {
853#endif 845#endif
854#endif 846#endif
855 847
856#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 848#if IS_ENABLED(CONFIG_BFIN_SIR)
857#ifdef CONFIG_BFIN_SIR0 849#ifdef CONFIG_BFIN_SIR0
858 &bfin_sir0_device, 850 &bfin_sir0_device,
859#endif 851#endif
@@ -862,12 +854,11 @@ static struct platform_device *tll6527m_devices[] __initdata = {
862#endif 854#endif
863#endif 855#endif
864 856
865#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 857#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
866 &i2c_bfin_twi_device, 858 &i2c_bfin_twi_device,
867#endif 859#endif
868 860
869#if defined(CONFIG_SERIAL_BFIN_SPORT) \ 861#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
870 || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
871#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 862#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
872 &bfin_sport0_uart_device, 863 &bfin_sport0_uart_device,
873#endif 864#endif
@@ -876,15 +867,15 @@ static struct platform_device *tll6527m_devices[] __initdata = {
876#endif 867#endif
877#endif 868#endif
878 869
879#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE) 870#if IS_ENABLED(CONFIG_MTD_GPIO_ADDR)
880 &tll6527m_flash_device, 871 &tll6527m_flash_device,
881#endif 872#endif
882 873
883#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 874#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
884 &bfin_i2s, 875 &bfin_i2s,
885#endif 876#endif
886 877
887#if defined(CONFIG_GPIO_DECODER) || defined(CONFIG_GPIO_DECODER_MODULE) 878#if IS_ENABLED(CONFIG_GPIO_DECODER)
888 &spi_decoded_gpio, 879 &spi_decoded_gpio,
889#endif 880#endif
890}; 881};
diff --git a/arch/blackfin/mach-bf533/boards/H8606.c b/arch/blackfin/mach-bf533/boards/H8606.c
index 6cb7b3ed9b3d..01300f40db15 100644
--- a/arch/blackfin/mach-bf533/boards/H8606.c
+++ b/arch/blackfin/mach-bf533/boards/H8606.c
@@ -14,7 +14,7 @@
14#include <linux/mtd/partitions.h> 14#include <linux/mtd/partitions.h>
15#include <linux/spi/spi.h> 15#include <linux/spi/spi.h>
16#include <linux/spi/flash.h> 16#include <linux/spi/flash.h>
17#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 17#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
18#include <linux/usb/isp1362.h> 18#include <linux/usb/isp1362.h>
19#endif 19#endif
20#include <linux/irq.h> 20#include <linux/irq.h>
@@ -29,7 +29,7 @@
29 */ 29 */
30const char bfin_board_name[] = "HV Sistemas H8606"; 30const char bfin_board_name[] = "HV Sistemas H8606";
31 31
32#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 32#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
33static struct platform_device rtc_device = { 33static struct platform_device rtc_device = {
34 .name = "rtc-bfin", 34 .name = "rtc-bfin",
35 .id = -1, 35 .id = -1,
@@ -39,7 +39,7 @@ static struct platform_device rtc_device = {
39/* 39/*
40* Driver needs to know address, irq and flag pin. 40* Driver needs to know address, irq and flag pin.
41 */ 41 */
42 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) 42#if IS_ENABLED(CONFIG_DM9000)
43static struct resource dm9000_resources[] = { 43static struct resource dm9000_resources[] = {
44 [0] = { 44 [0] = {
45 .start = 0x20300000, 45 .start = 0x20300000,
@@ -67,7 +67,7 @@ static struct platform_device dm9000_device = {
67}; 67};
68#endif 68#endif
69 69
70#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 70#if IS_ENABLED(CONFIG_SMC91X)
71#include <linux/smc91x.h> 71#include <linux/smc91x.h>
72 72
73static struct smc91x_platdata smc91x_info = { 73static struct smc91x_platdata smc91x_info = {
@@ -104,7 +104,7 @@ static struct platform_device smc91x_device = {
104}; 104};
105#endif 105#endif
106 106
107#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 107#if IS_ENABLED(CONFIG_USB_NET2272)
108static struct resource net2272_bfin_resources[] = { 108static struct resource net2272_bfin_resources[] = {
109 { 109 {
110 .start = 0x20300000, 110 .start = 0x20300000,
@@ -125,10 +125,10 @@ static struct platform_device net2272_bfin_device = {
125}; 125};
126#endif 126#endif
127 127
128#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 128#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
129/* all SPI peripherals info goes here */ 129/* all SPI peripherals info goes here */
130 130
131#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 131#if IS_ENABLED(CONFIG_MTD_M25P80)
132static struct mtd_partition bfin_spi_flash_partitions[] = { 132static struct mtd_partition bfin_spi_flash_partitions[] = {
133 { 133 {
134 .name = "bootloader (spi)", 134 .name = "bootloader (spi)",
@@ -166,7 +166,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
166/* Notice: for blackfin, the speed_hz is the value of register 166/* Notice: for blackfin, the speed_hz is the value of register
167 * SPI_BAUD, not the real baudrate */ 167 * SPI_BAUD, not the real baudrate */
168static struct spi_board_info bfin_spi_board_info[] __initdata = { 168static struct spi_board_info bfin_spi_board_info[] __initdata = {
169#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 169#if IS_ENABLED(CONFIG_MTD_M25P80)
170 { 170 {
171 /* the modalias must be the same as spi device driver name */ 171 /* the modalias must be the same as spi device driver name */
172 .modalias = "m25p80", /* Name of spi_driver for this device */ 172 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -180,7 +180,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
180 }, 180 },
181#endif 181#endif
182 182
183#if defined(CONFIG_SND_BF5XX_SOC_AD183X) || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) 183#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD183X)
184 { 184 {
185 .modalias = "ad183x", 185 .modalias = "ad183x",
186 .max_speed_hz = 16, 186 .max_speed_hz = 16,
@@ -229,7 +229,7 @@ static struct platform_device bfin_spi0_device = {
229}; 229};
230#endif /* spi master and devices */ 230#endif /* spi master and devices */
231 231
232#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 232#if IS_ENABLED(CONFIG_SERIAL_BFIN)
233#ifdef CONFIG_SERIAL_BFIN_UART0 233#ifdef CONFIG_SERIAL_BFIN_UART0
234static struct resource bfin_uart0_resources[] = { 234static struct resource bfin_uart0_resources[] = {
235 { 235 {
@@ -280,7 +280,7 @@ static struct platform_device bfin_uart0_device = {
280#endif 280#endif
281#endif 281#endif
282 282
283#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 283#if IS_ENABLED(CONFIG_BFIN_SIR)
284#ifdef CONFIG_BFIN_SIR0 284#ifdef CONFIG_BFIN_SIR0
285static struct resource bfin_sir0_resources[] = { 285static struct resource bfin_sir0_resources[] = {
286 { 286 {
@@ -309,7 +309,7 @@ static struct platform_device bfin_sir0_device = {
309#endif 309#endif
310#endif 310#endif
311 311
312#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) 312#if IS_ENABLED(CONFIG_SERIAL_8250)
313 313
314#include <linux/serial_8250.h> 314#include <linux/serial_8250.h>
315#include <linux/serial.h> 315#include <linux/serial.h>
@@ -353,7 +353,7 @@ static struct platform_device serial8250_device = {
353 353
354#endif 354#endif
355 355
356#if defined(CONFIG_KEYBOARD_OPENCORES) || defined(CONFIG_KEYBOARD_OPENCORES_MODULE) 356#if IS_ENABLED(CONFIG_KEYBOARD_OPENCORES)
357 357
358/* 358/*
359 * Configuration for one OpenCores keyboard controller in FPGA at address 0x20200030, 359 * Configuration for one OpenCores keyboard controller in FPGA at address 0x20200030,
@@ -382,43 +382,43 @@ static struct platform_device opencores_kbd_device = {
382#endif 382#endif
383 383
384static struct platform_device *h8606_devices[] __initdata = { 384static struct platform_device *h8606_devices[] __initdata = {
385#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 385#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
386 &rtc_device, 386 &rtc_device,
387#endif 387#endif
388 388
389#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) 389#if IS_ENABLED(CONFIG_DM9000)
390 &dm9000_device, 390 &dm9000_device,
391#endif 391#endif
392 392
393#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 393#if IS_ENABLED(CONFIG_SMC91X)
394 &smc91x_device, 394 &smc91x_device,
395#endif 395#endif
396 396
397#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 397#if IS_ENABLED(CONFIG_USB_NET2272)
398 &net2272_bfin_device, 398 &net2272_bfin_device,
399#endif 399#endif
400 400
401#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 401#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
402 &bfin_spi0_device, 402 &bfin_spi0_device,
403#endif 403#endif
404 404
405#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 405#if IS_ENABLED(CONFIG_SERIAL_BFIN)
406#ifdef CONFIG_SERIAL_BFIN_UART0 406#ifdef CONFIG_SERIAL_BFIN_UART0
407 &bfin_uart0_device, 407 &bfin_uart0_device,
408#endif 408#endif
409#endif 409#endif
410 410
411#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) 411#if IS_ENABLED(CONFIG_SERIAL_8250)
412 &serial8250_device, 412 &serial8250_device,
413#endif 413#endif
414 414
415#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 415#if IS_ENABLED(CONFIG_BFIN_SIR)
416#ifdef CONFIG_BFIN_SIR0 416#ifdef CONFIG_BFIN_SIR0
417 &bfin_sir0_device, 417 &bfin_sir0_device,
418#endif 418#endif
419#endif 419#endif
420 420
421#if defined(CONFIG_KEYBOARD_OPENCORES) || defined(CONFIG_KEYBOARD_OPENCORES_MODULE) 421#if IS_ENABLED(CONFIG_KEYBOARD_OPENCORES)
422 &opencores_kbd_device, 422 &opencores_kbd_device,
423#endif 423#endif
424}; 424};
@@ -428,7 +428,7 @@ static int __init H8606_init(void)
428 printk(KERN_INFO "HV Sistemas H8606 board support by http://www.hvsistemas.com\n"); 428 printk(KERN_INFO "HV Sistemas H8606 board support by http://www.hvsistemas.com\n");
429 printk(KERN_INFO "%s(): registering device resources\n", __func__); 429 printk(KERN_INFO "%s(): registering device resources\n", __func__);
430 platform_add_devices(h8606_devices, ARRAY_SIZE(h8606_devices)); 430 platform_add_devices(h8606_devices, ARRAY_SIZE(h8606_devices));
431#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 431#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
432 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 432 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
433#endif 433#endif
434 return 0; 434 return 0;
diff --git a/arch/blackfin/mach-bf533/boards/blackstamp.c b/arch/blackfin/mach-bf533/boards/blackstamp.c
index de44a3765e59..63b0e4fe760c 100644
--- a/arch/blackfin/mach-bf533/boards/blackstamp.c
+++ b/arch/blackfin/mach-bf533/boards/blackstamp.c
@@ -31,7 +31,7 @@
31 */ 31 */
32const char bfin_board_name[] = "BlackStamp"; 32const char bfin_board_name[] = "BlackStamp";
33 33
34#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 34#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
35static struct platform_device rtc_device = { 35static struct platform_device rtc_device = {
36 .name = "rtc-bfin", 36 .name = "rtc-bfin",
37 .id = -1, 37 .id = -1,
@@ -41,7 +41,7 @@ static struct platform_device rtc_device = {
41/* 41/*
42 * Driver needs to know address, irq and flag pin. 42 * Driver needs to know address, irq and flag pin.
43 */ 43 */
44#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 44#if IS_ENABLED(CONFIG_SMC91X)
45#include <linux/smc91x.h> 45#include <linux/smc91x.h>
46 46
47static struct smc91x_platdata smc91x_info = { 47static struct smc91x_platdata smc91x_info = {
@@ -74,7 +74,7 @@ static struct platform_device smc91x_device = {
74}; 74};
75#endif 75#endif
76 76
77#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 77#if IS_ENABLED(CONFIG_MTD_M25P80)
78static struct mtd_partition bfin_spi_flash_partitions[] = { 78static struct mtd_partition bfin_spi_flash_partitions[] = {
79 { 79 {
80 .name = "bootloader(spi)", 80 .name = "bootloader(spi)",
@@ -105,14 +105,14 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
105}; 105};
106#endif 106#endif
107 107
108#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 108#if IS_ENABLED(CONFIG_MMC_SPI)
109static struct bfin5xx_spi_chip mmc_spi_chip_info = { 109static struct bfin5xx_spi_chip mmc_spi_chip_info = {
110 .enable_dma = 0, 110 .enable_dma = 0,
111}; 111};
112#endif 112#endif
113 113
114static struct spi_board_info bfin_spi_board_info[] __initdata = { 114static struct spi_board_info bfin_spi_board_info[] __initdata = {
115#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 115#if IS_ENABLED(CONFIG_MTD_M25P80)
116 { 116 {
117 /* the modalias must be the same as spi device driver name */ 117 /* the modalias must be the same as spi device driver name */
118 .modalias = "m25p80", /* Name of spi_driver for this device */ 118 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -125,7 +125,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
125 }, 125 },
126#endif 126#endif
127 127
128#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 128#if IS_ENABLED(CONFIG_MMC_SPI)
129 { 129 {
130 .modalias = "mmc_spi", 130 .modalias = "mmc_spi",
131 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 131 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
@@ -136,7 +136,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
136 }, 136 },
137#endif 137#endif
138 138
139#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 139#if IS_ENABLED(CONFIG_SPI_SPIDEV)
140 { 140 {
141 .modalias = "spidev", 141 .modalias = "spidev",
142 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 142 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -146,7 +146,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
146#endif 146#endif
147}; 147};
148 148
149#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 149#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
150/* SPI (0) */ 150/* SPI (0) */
151static struct resource bfin_spi0_resource[] = { 151static struct resource bfin_spi0_resource[] = {
152 [0] = { 152 [0] = {
@@ -184,7 +184,7 @@ static struct platform_device bfin_spi0_device = {
184}; 184};
185#endif /* spi master and devices */ 185#endif /* spi master and devices */
186 186
187#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 187#if IS_ENABLED(CONFIG_SERIAL_BFIN)
188#ifdef CONFIG_SERIAL_BFIN_UART0 188#ifdef CONFIG_SERIAL_BFIN_UART0
189static struct resource bfin_uart0_resources[] = { 189static struct resource bfin_uart0_resources[] = {
190 { 190 {
@@ -235,7 +235,7 @@ static struct platform_device bfin_uart0_device = {
235#endif 235#endif
236#endif 236#endif
237 237
238#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 238#if IS_ENABLED(CONFIG_BFIN_SIR)
239#ifdef CONFIG_BFIN_SIR0 239#ifdef CONFIG_BFIN_SIR0
240static struct resource bfin_sir0_resources[] = { 240static struct resource bfin_sir0_resources[] = {
241 { 241 {
@@ -264,7 +264,7 @@ static struct platform_device bfin_sir0_device = {
264#endif 264#endif
265#endif 265#endif
266 266
267#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 267#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
268#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 268#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
269static struct resource bfin_sport0_uart_resources[] = { 269static struct resource bfin_sport0_uart_resources[] = {
270 { 270 {
@@ -335,7 +335,7 @@ static struct platform_device bfin_sport1_uart_device = {
335#endif 335#endif
336#endif 336#endif
337 337
338#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 338#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
339#include <linux/input.h> 339#include <linux/input.h>
340#include <linux/gpio_keys.h> 340#include <linux/gpio_keys.h>
341 341
@@ -358,7 +358,7 @@ static struct platform_device bfin_device_gpiokeys = {
358}; 358};
359#endif 359#endif
360 360
361#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) 361#if IS_ENABLED(CONFIG_I2C_GPIO)
362#include <linux/i2c-gpio.h> 362#include <linux/i2c-gpio.h>
363 363
364static struct i2c_gpio_platform_data i2c_gpio_data = { 364static struct i2c_gpio_platform_data i2c_gpio_data = {
@@ -413,32 +413,32 @@ static struct platform_device *stamp_devices[] __initdata = {
413 413
414 &bfin_dpmc, 414 &bfin_dpmc,
415 415
416#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 416#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
417 &rtc_device, 417 &rtc_device,
418#endif 418#endif
419 419
420#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 420#if IS_ENABLED(CONFIG_SMC91X)
421 &smc91x_device, 421 &smc91x_device,
422#endif 422#endif
423 423
424 424
425#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 425#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
426 &bfin_spi0_device, 426 &bfin_spi0_device,
427#endif 427#endif
428 428
429#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 429#if IS_ENABLED(CONFIG_SERIAL_BFIN)
430#ifdef CONFIG_SERIAL_BFIN_UART0 430#ifdef CONFIG_SERIAL_BFIN_UART0
431 &bfin_uart0_device, 431 &bfin_uart0_device,
432#endif 432#endif
433#endif 433#endif
434 434
435#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 435#if IS_ENABLED(CONFIG_BFIN_SIR)
436#ifdef CONFIG_BFIN_SIR0 436#ifdef CONFIG_BFIN_SIR0
437 &bfin_sir0_device, 437 &bfin_sir0_device,
438#endif 438#endif
439#endif 439#endif
440 440
441#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 441#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
442#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 442#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
443 &bfin_sport0_uart_device, 443 &bfin_sport0_uart_device,
444#endif 444#endif
@@ -447,11 +447,11 @@ static struct platform_device *stamp_devices[] __initdata = {
447#endif 447#endif
448#endif 448#endif
449 449
450#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 450#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
451 &bfin_device_gpiokeys, 451 &bfin_device_gpiokeys,
452#endif 452#endif
453 453
454#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) 454#if IS_ENABLED(CONFIG_I2C_GPIO)
455 &i2c_gpio_device, 455 &i2c_gpio_device,
456#endif 456#endif
457}; 457};
@@ -469,7 +469,7 @@ static int __init blackstamp_init(void)
469 if (ret < 0) 469 if (ret < 0)
470 return ret; 470 return ret;
471 471
472#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 472#if IS_ENABLED(CONFIG_SMC91X)
473 /* 473 /*
474 * setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC. 474 * setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC.
475 * the bfin-async-map driver takes care of flipping between 475 * the bfin-async-map driver takes care of flipping between
diff --git a/arch/blackfin/mach-bf533/boards/cm_bf533.c b/arch/blackfin/mach-bf533/boards/cm_bf533.c
index fe47e048c4e6..4ef2fb0e48d5 100644
--- a/arch/blackfin/mach-bf533/boards/cm_bf533.c
+++ b/arch/blackfin/mach-bf533/boards/cm_bf533.c
@@ -15,7 +15,7 @@
15#include <linux/spi/spi.h> 15#include <linux/spi/spi.h>
16#include <linux/spi/flash.h> 16#include <linux/spi/flash.h>
17#include <linux/spi/mmc_spi.h> 17#include <linux/spi/mmc_spi.h>
18#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 18#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
19#include <linux/usb/isp1362.h> 19#include <linux/usb/isp1362.h>
20#endif 20#endif
21#include <linux/irq.h> 21#include <linux/irq.h>
@@ -29,9 +29,9 @@
29 */ 29 */
30const char bfin_board_name[] = "Bluetechnix CM BF533"; 30const char bfin_board_name[] = "Bluetechnix CM BF533";
31 31
32#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 32#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
33/* all SPI peripherals info goes here */ 33/* all SPI peripherals info goes here */
34#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 34#if IS_ENABLED(CONFIG_MTD_M25P80)
35static struct mtd_partition bfin_spi_flash_partitions[] = { 35static struct mtd_partition bfin_spi_flash_partitions[] = {
36 { 36 {
37 .name = "bootloader(spi)", 37 .name = "bootloader(spi)",
@@ -62,14 +62,14 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
62}; 62};
63#endif 63#endif
64 64
65#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 65#if IS_ENABLED(CONFIG_MMC_SPI)
66static struct bfin5xx_spi_chip mmc_spi_chip_info = { 66static struct bfin5xx_spi_chip mmc_spi_chip_info = {
67 .enable_dma = 0, 67 .enable_dma = 0,
68}; 68};
69#endif 69#endif
70 70
71static struct spi_board_info bfin_spi_board_info[] __initdata = { 71static struct spi_board_info bfin_spi_board_info[] __initdata = {
72#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 72#if IS_ENABLED(CONFIG_MTD_M25P80)
73 { 73 {
74 /* the modalias must be the same as spi device driver name */ 74 /* the modalias must be the same as spi device driver name */
75 .modalias = "m25p80", /* Name of spi_driver for this device */ 75 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -82,7 +82,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
82 }, 82 },
83#endif 83#endif
84 84
85#if defined(CONFIG_SND_BF5XX_SOC_AD183X) || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) 85#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD183X)
86 { 86 {
87 .modalias = "ad183x", 87 .modalias = "ad183x",
88 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 88 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -91,7 +91,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
91 }, 91 },
92#endif 92#endif
93 93
94#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 94#if IS_ENABLED(CONFIG_MMC_SPI)
95 { 95 {
96 .modalias = "mmc_spi", 96 .modalias = "mmc_spi",
97 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 97 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
@@ -140,14 +140,14 @@ static struct platform_device bfin_spi0_device = {
140}; 140};
141#endif /* spi master and devices */ 141#endif /* spi master and devices */
142 142
143#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 143#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
144static struct platform_device rtc_device = { 144static struct platform_device rtc_device = {
145 .name = "rtc-bfin", 145 .name = "rtc-bfin",
146 .id = -1, 146 .id = -1,
147}; 147};
148#endif 148#endif
149 149
150#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 150#if IS_ENABLED(CONFIG_SMC91X)
151#include <linux/smc91x.h> 151#include <linux/smc91x.h>
152 152
153static struct smc91x_platdata smc91x_info = { 153static struct smc91x_platdata smc91x_info = {
@@ -178,7 +178,7 @@ static struct platform_device smc91x_device = {
178}; 178};
179#endif 179#endif
180 180
181#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 181#if IS_ENABLED(CONFIG_SMSC911X)
182#include <linux/smsc911x.h> 182#include <linux/smsc911x.h>
183 183
184static struct resource smsc911x_resources[] = { 184static struct resource smsc911x_resources[] = {
@@ -212,7 +212,7 @@ static struct platform_device smsc911x_device = {
212}; 212};
213#endif 213#endif
214 214
215#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 215#if IS_ENABLED(CONFIG_SERIAL_BFIN)
216#ifdef CONFIG_SERIAL_BFIN_UART0 216#ifdef CONFIG_SERIAL_BFIN_UART0
217static struct resource bfin_uart0_resources[] = { 217static struct resource bfin_uart0_resources[] = {
218 { 218 {
@@ -263,7 +263,7 @@ static struct platform_device bfin_uart0_device = {
263#endif 263#endif
264#endif 264#endif
265 265
266#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 266#if IS_ENABLED(CONFIG_BFIN_SIR)
267#ifdef CONFIG_BFIN_SIR0 267#ifdef CONFIG_BFIN_SIR0
268static struct resource bfin_sir0_resources[] = { 268static struct resource bfin_sir0_resources[] = {
269 { 269 {
@@ -292,7 +292,7 @@ static struct platform_device bfin_sir0_device = {
292#endif 292#endif
293#endif 293#endif
294 294
295#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 295#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
296#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 296#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
297static struct resource bfin_sport0_uart_resources[] = { 297static struct resource bfin_sport0_uart_resources[] = {
298 { 298 {
@@ -363,7 +363,7 @@ static struct platform_device bfin_sport1_uart_device = {
363#endif 363#endif
364#endif 364#endif
365 365
366#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 366#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
367static struct resource isp1362_hcd_resources[] = { 367static struct resource isp1362_hcd_resources[] = {
368 { 368 {
369 .start = 0x20308000, 369 .start = 0x20308000,
@@ -403,7 +403,7 @@ static struct platform_device isp1362_hcd_device = {
403#endif 403#endif
404 404
405 405
406#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 406#if IS_ENABLED(CONFIG_USB_NET2272)
407static struct resource net2272_bfin_resources[] = { 407static struct resource net2272_bfin_resources[] = {
408 { 408 {
409 .start = 0x20300000, 409 .start = 0x20300000,
@@ -426,7 +426,7 @@ static struct platform_device net2272_bfin_device = {
426 426
427 427
428 428
429#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 429#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
430static struct mtd_partition para_partitions[] = { 430static struct mtd_partition para_partitions[] = {
431 { 431 {
432 .name = "bootloader(nor)", 432 .name = "bootloader(nor)",
@@ -495,19 +495,19 @@ static struct platform_device *cm_bf533_devices[] __initdata = {
495 495
496 &bfin_dpmc, 496 &bfin_dpmc,
497 497
498#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 498#if IS_ENABLED(CONFIG_SERIAL_BFIN)
499#ifdef CONFIG_SERIAL_BFIN_UART0 499#ifdef CONFIG_SERIAL_BFIN_UART0
500 &bfin_uart0_device, 500 &bfin_uart0_device,
501#endif 501#endif
502#endif 502#endif
503 503
504#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 504#if IS_ENABLED(CONFIG_BFIN_SIR)
505#ifdef CONFIG_BFIN_SIR0 505#ifdef CONFIG_BFIN_SIR0
506 &bfin_sir0_device, 506 &bfin_sir0_device,
507#endif 507#endif
508#endif 508#endif
509 509
510#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 510#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
511#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 511#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
512 &bfin_sport0_uart_device, 512 &bfin_sport0_uart_device,
513#endif 513#endif
@@ -516,31 +516,31 @@ static struct platform_device *cm_bf533_devices[] __initdata = {
516#endif 516#endif
517#endif 517#endif
518 518
519#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 519#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
520 &rtc_device, 520 &rtc_device,
521#endif 521#endif
522 522
523#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 523#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
524 &isp1362_hcd_device, 524 &isp1362_hcd_device,
525#endif 525#endif
526 526
527#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 527#if IS_ENABLED(CONFIG_SMC91X)
528 &smc91x_device, 528 &smc91x_device,
529#endif 529#endif
530 530
531#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 531#if IS_ENABLED(CONFIG_SMSC911X)
532 &smsc911x_device, 532 &smsc911x_device,
533#endif 533#endif
534 534
535#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 535#if IS_ENABLED(CONFIG_USB_NET2272)
536 &net2272_bfin_device, 536 &net2272_bfin_device,
537#endif 537#endif
538 538
539#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 539#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
540 &bfin_spi0_device, 540 &bfin_spi0_device,
541#endif 541#endif
542 542
543#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 543#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
544 &para_flash_device, 544 &para_flash_device,
545#endif 545#endif
546}; 546};
@@ -549,7 +549,7 @@ static int __init cm_bf533_init(void)
549{ 549{
550 printk(KERN_INFO "%s(): registering device resources\n", __func__); 550 printk(KERN_INFO "%s(): registering device resources\n", __func__);
551 platform_add_devices(cm_bf533_devices, ARRAY_SIZE(cm_bf533_devices)); 551 platform_add_devices(cm_bf533_devices, ARRAY_SIZE(cm_bf533_devices));
552#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 552#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
553 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 553 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
554#endif 554#endif
555 return 0; 555 return 0;
diff --git a/arch/blackfin/mach-bf533/boards/ezkit.c b/arch/blackfin/mach-bf533/boards/ezkit.c
index 90fb0d14b147..3625e9eaa8a8 100644
--- a/arch/blackfin/mach-bf533/boards/ezkit.c
+++ b/arch/blackfin/mach-bf533/boards/ezkit.c
@@ -14,7 +14,7 @@
14#include <linux/mtd/physmap.h> 14#include <linux/mtd/physmap.h>
15#include <linux/spi/spi.h> 15#include <linux/spi/spi.h>
16#include <linux/spi/flash.h> 16#include <linux/spi/flash.h>
17#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 17#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
18#include <linux/usb/isp1362.h> 18#include <linux/usb/isp1362.h>
19#endif 19#endif
20#include <linux/irq.h> 20#include <linux/irq.h>
@@ -29,7 +29,7 @@
29 */ 29 */
30const char bfin_board_name[] = "ADI BF533-EZKIT"; 30const char bfin_board_name[] = "ADI BF533-EZKIT";
31 31
32#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 32#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
33static struct platform_device rtc_device = { 33static struct platform_device rtc_device = {
34 .name = "rtc-bfin", 34 .name = "rtc-bfin",
35 .id = -1, 35 .id = -1,
@@ -40,7 +40,7 @@ static struct platform_device rtc_device = {
40 * USB-LAN EzExtender board 40 * USB-LAN EzExtender board
41 * Driver needs to know address, irq and flag pin. 41 * Driver needs to know address, irq and flag pin.
42 */ 42 */
43#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 43#if IS_ENABLED(CONFIG_SMC91X)
44#include <linux/smc91x.h> 44#include <linux/smc91x.h>
45 45
46static struct smc91x_platdata smc91x_info = { 46static struct smc91x_platdata smc91x_info = {
@@ -72,7 +72,7 @@ static struct platform_device smc91x_device = {
72}; 72};
73#endif 73#endif
74 74
75#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 75#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
76static struct mtd_partition ezkit_partitions_a[] = { 76static struct mtd_partition ezkit_partitions_a[] = {
77 { 77 {
78 .name = "bootloader(nor a)", 78 .name = "bootloader(nor a)",
@@ -138,7 +138,7 @@ static struct platform_device ezkit_flash_device_b = {
138}; 138};
139#endif 139#endif
140 140
141#if defined(CONFIG_MTD_PLATRAM) || defined(CONFIG_MTD_PLATRAM_MODULE) 141#if IS_ENABLED(CONFIG_MTD_PLATRAM)
142static struct platdata_mtd_ram sram_data_a = { 142static struct platdata_mtd_ram sram_data_a = {
143 .mapname = "Flash A SRAM", 143 .mapname = "Flash A SRAM",
144 .bankwidth = 2, 144 .bankwidth = 2,
@@ -182,7 +182,7 @@ static struct platform_device sram_device_b = {
182}; 182};
183#endif 183#endif
184 184
185#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 185#if IS_ENABLED(CONFIG_MTD_M25P80)
186static struct mtd_partition bfin_spi_flash_partitions[] = { 186static struct mtd_partition bfin_spi_flash_partitions[] = {
187 { 187 {
188 .name = "bootloader(spi)", 188 .name = "bootloader(spi)",
@@ -214,7 +214,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
214#endif 214#endif
215 215
216static struct spi_board_info bfin_spi_board_info[] __initdata = { 216static struct spi_board_info bfin_spi_board_info[] __initdata = {
217#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 217#if IS_ENABLED(CONFIG_MTD_M25P80)
218 { 218 {
219 /* the modalias must be the same as spi device driver name */ 219 /* the modalias must be the same as spi device driver name */
220 .modalias = "m25p80", /* Name of spi_driver for this device */ 220 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -227,7 +227,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
227 }, 227 },
228#endif 228#endif
229 229
230#if defined(CONFIG_SND_BF5XX_SOC_AD183X) || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) 230#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD183X)
231 { 231 {
232 .modalias = "ad183x", 232 .modalias = "ad183x",
233 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 233 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -235,7 +235,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
235 .chip_select = 4, 235 .chip_select = 4,
236 }, 236 },
237#endif 237#endif
238#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 238#if IS_ENABLED(CONFIG_SPI_SPIDEV)
239 { 239 {
240 .modalias = "spidev", 240 .modalias = "spidev",
241 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 241 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -245,7 +245,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
245#endif 245#endif
246}; 246};
247 247
248#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 248#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
249/* SPI (0) */ 249/* SPI (0) */
250static struct resource bfin_spi0_resource[] = { 250static struct resource bfin_spi0_resource[] = {
251 [0] = { 251 [0] = {
@@ -283,7 +283,7 @@ static struct platform_device bfin_spi0_device = {
283}; 283};
284#endif /* spi master and devices */ 284#endif /* spi master and devices */
285 285
286#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 286#if IS_ENABLED(CONFIG_SERIAL_BFIN)
287#ifdef CONFIG_SERIAL_BFIN_UART0 287#ifdef CONFIG_SERIAL_BFIN_UART0
288static struct resource bfin_uart0_resources[] = { 288static struct resource bfin_uart0_resources[] = {
289 { 289 {
@@ -334,7 +334,7 @@ static struct platform_device bfin_uart0_device = {
334#endif 334#endif
335#endif 335#endif
336 336
337#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 337#if IS_ENABLED(CONFIG_BFIN_SIR)
338#ifdef CONFIG_BFIN_SIR0 338#ifdef CONFIG_BFIN_SIR0
339static struct resource bfin_sir0_resources[] = { 339static struct resource bfin_sir0_resources[] = {
340 { 340 {
@@ -363,7 +363,7 @@ static struct platform_device bfin_sir0_device = {
363#endif 363#endif
364#endif 364#endif
365 365
366#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 366#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
367#include <linux/input.h> 367#include <linux/input.h>
368#include <linux/gpio_keys.h> 368#include <linux/gpio_keys.h>
369 369
@@ -387,7 +387,7 @@ static struct platform_device bfin_device_gpiokeys = {
387}; 387};
388#endif 388#endif
389 389
390#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) 390#if IS_ENABLED(CONFIG_I2C_GPIO)
391#include <linux/i2c-gpio.h> 391#include <linux/i2c-gpio.h>
392 392
393static struct i2c_gpio_platform_data i2c_gpio_data = { 393static struct i2c_gpio_platform_data i2c_gpio_data = {
@@ -435,14 +435,14 @@ static struct platform_device bfin_dpmc = {
435}; 435};
436 436
437static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 437static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
438#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) 438#if IS_ENABLED(CONFIG_FB_BFIN_7393)
439 { 439 {
440 I2C_BOARD_INFO("bfin-adv7393", 0x2B), 440 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
441 }, 441 },
442#endif 442#endif
443}; 443};
444 444
445#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 445#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
446static struct platform_device bfin_i2s = { 446static struct platform_device bfin_i2s = {
447 .name = "bfin-i2s", 447 .name = "bfin-i2s",
448 .id = CONFIG_SND_BF5XX_SPORT_NUM, 448 .id = CONFIG_SND_BF5XX_SPORT_NUM,
@@ -450,7 +450,7 @@ static struct platform_device bfin_i2s = {
450}; 450};
451#endif 451#endif
452 452
453#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 453#if IS_ENABLED(CONFIG_SND_BF5XX_AC97)
454static struct platform_device bfin_ac97 = { 454static struct platform_device bfin_ac97 = {
455 .name = "bfin-ac97", 455 .name = "bfin-ac97",
456 .id = CONFIG_SND_BF5XX_SPORT_NUM, 456 .id = CONFIG_SND_BF5XX_SPORT_NUM,
@@ -462,53 +462,53 @@ static struct platform_device *ezkit_devices[] __initdata = {
462 462
463 &bfin_dpmc, 463 &bfin_dpmc,
464 464
465#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 465#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
466 &ezkit_flash_device_a, 466 &ezkit_flash_device_a,
467 &ezkit_flash_device_b, 467 &ezkit_flash_device_b,
468#endif 468#endif
469 469
470#if defined(CONFIG_MTD_PLATRAM) || defined(CONFIG_MTD_PLATRAM_MODULE) 470#if IS_ENABLED(CONFIG_MTD_PLATRAM)
471 &sram_device_a, 471 &sram_device_a,
472 &sram_device_b, 472 &sram_device_b,
473#endif 473#endif
474 474
475#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 475#if IS_ENABLED(CONFIG_SMC91X)
476 &smc91x_device, 476 &smc91x_device,
477#endif 477#endif
478 478
479#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 479#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
480 &bfin_spi0_device, 480 &bfin_spi0_device,
481#endif 481#endif
482 482
483#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 483#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
484 &rtc_device, 484 &rtc_device,
485#endif 485#endif
486 486
487#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 487#if IS_ENABLED(CONFIG_SERIAL_BFIN)
488#ifdef CONFIG_SERIAL_BFIN_UART0 488#ifdef CONFIG_SERIAL_BFIN_UART0
489 &bfin_uart0_device, 489 &bfin_uart0_device,
490#endif 490#endif
491#endif 491#endif
492 492
493#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 493#if IS_ENABLED(CONFIG_BFIN_SIR)
494#ifdef CONFIG_BFIN_SIR0 494#ifdef CONFIG_BFIN_SIR0
495 &bfin_sir0_device, 495 &bfin_sir0_device,
496#endif 496#endif
497#endif 497#endif
498 498
499#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 499#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
500 &bfin_device_gpiokeys, 500 &bfin_device_gpiokeys,
501#endif 501#endif
502 502
503#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) 503#if IS_ENABLED(CONFIG_I2C_GPIO)
504 &i2c_gpio_device, 504 &i2c_gpio_device,
505#endif 505#endif
506 506
507#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 507#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
508 &bfin_i2s, 508 &bfin_i2s,
509#endif 509#endif
510 510
511#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 511#if IS_ENABLED(CONFIG_SND_BF5XX_AC97)
512 &bfin_ac97, 512 &bfin_ac97,
513#endif 513#endif
514}; 514};
diff --git a/arch/blackfin/mach-bf533/boards/ip0x.c b/arch/blackfin/mach-bf533/boards/ip0x.c
index e303dae4e2d9..39c8e8547b82 100644
--- a/arch/blackfin/mach-bf533/boards/ip0x.c
+++ b/arch/blackfin/mach-bf533/boards/ip0x.c
@@ -15,7 +15,7 @@
15#include <linux/mtd/partitions.h> 15#include <linux/mtd/partitions.h>
16#include <linux/spi/spi.h> 16#include <linux/spi/spi.h>
17#include <linux/spi/flash.h> 17#include <linux/spi/flash.h>
18#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 18#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
19#include <linux/usb/isp1362.h> 19#include <linux/usb/isp1362.h>
20#endif 20#endif
21#include <asm/irq.h> 21#include <asm/irq.h>
@@ -32,7 +32,7 @@ const char bfin_board_name[] = "IP04/IP08";
32 * Driver needs to know address, irq and flag pin. 32 * Driver needs to know address, irq and flag pin.
33 */ 33 */
34#if defined(CONFIG_BFIN532_IP0X) 34#if defined(CONFIG_BFIN532_IP0X)
35#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) 35#if IS_ENABLED(CONFIG_DM9000)
36 36
37#include <linux/dm9000.h> 37#include <linux/dm9000.h>
38 38
@@ -104,10 +104,10 @@ static struct platform_device dm9000_device2 = {
104#endif 104#endif
105 105
106 106
107#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 107#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
108/* all SPI peripherals info goes here */ 108/* all SPI peripherals info goes here */
109 109
110#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 110#if IS_ENABLED(CONFIG_MMC_SPI)
111static struct bfin5xx_spi_chip mmc_spi_chip_info = { 111static struct bfin5xx_spi_chip mmc_spi_chip_info = {
112 .enable_dma = 0, /* if 1 - block!!! */ 112 .enable_dma = 0, /* if 1 - block!!! */
113}; 113};
@@ -116,7 +116,7 @@ static struct bfin5xx_spi_chip mmc_spi_chip_info = {
116/* Notice: for blackfin, the speed_hz is the value of register 116/* Notice: for blackfin, the speed_hz is the value of register
117 * SPI_BAUD, not the real baudrate */ 117 * SPI_BAUD, not the real baudrate */
118static struct spi_board_info bfin_spi_board_info[] __initdata = { 118static struct spi_board_info bfin_spi_board_info[] __initdata = {
119#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 119#if IS_ENABLED(CONFIG_MMC_SPI)
120 { 120 {
121 .modalias = "mmc_spi", 121 .modalias = "mmc_spi",
122 .max_speed_hz = 2, 122 .max_speed_hz = 2,
@@ -142,7 +142,7 @@ static struct platform_device spi_bfin_master_device = {
142}; 142};
143#endif /* spi master and devices */ 143#endif /* spi master and devices */
144 144
145#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 145#if IS_ENABLED(CONFIG_SERIAL_BFIN)
146#ifdef CONFIG_SERIAL_BFIN_UART0 146#ifdef CONFIG_SERIAL_BFIN_UART0
147static struct resource bfin_uart0_resources[] = { 147static struct resource bfin_uart0_resources[] = {
148 { 148 {
@@ -193,7 +193,7 @@ static struct platform_device bfin_uart0_device = {
193#endif 193#endif
194#endif 194#endif
195 195
196#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 196#if IS_ENABLED(CONFIG_BFIN_SIR)
197#ifdef CONFIG_BFIN_SIR0 197#ifdef CONFIG_BFIN_SIR0
198static struct resource bfin_sir0_resources[] = { 198static struct resource bfin_sir0_resources[] = {
199 { 199 {
@@ -222,7 +222,7 @@ static struct platform_device bfin_sir0_device = {
222#endif 222#endif
223#endif 223#endif
224 224
225#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 225#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
226static struct resource isp1362_hcd_resources[] = { 226static struct resource isp1362_hcd_resources[] = {
227 { 227 {
228 .start = 0x20300000, 228 .start = 0x20300000,
@@ -264,29 +264,29 @@ static struct platform_device isp1362_hcd_device = {
264 264
265static struct platform_device *ip0x_devices[] __initdata = { 265static struct platform_device *ip0x_devices[] __initdata = {
266#if defined(CONFIG_BFIN532_IP0X) 266#if defined(CONFIG_BFIN532_IP0X)
267#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) 267#if IS_ENABLED(CONFIG_DM9000)
268 &dm9000_device1, 268 &dm9000_device1,
269 &dm9000_device2, 269 &dm9000_device2,
270#endif 270#endif
271#endif 271#endif
272 272
273#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 273#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
274 &spi_bfin_master_device, 274 &spi_bfin_master_device,
275#endif 275#endif
276 276
277#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 277#if IS_ENABLED(CONFIG_SERIAL_BFIN)
278#ifdef CONFIG_SERIAL_BFIN_UART0 278#ifdef CONFIG_SERIAL_BFIN_UART0
279 &bfin_uart0_device, 279 &bfin_uart0_device,
280#endif 280#endif
281#endif 281#endif
282 282
283#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 283#if IS_ENABLED(CONFIG_BFIN_SIR)
284#ifdef CONFIG_BFIN_SIR0 284#ifdef CONFIG_BFIN_SIR0
285 &bfin_sir0_device, 285 &bfin_sir0_device,
286#endif 286#endif
287#endif 287#endif
288 288
289#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 289#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
290 &isp1362_hcd_device, 290 &isp1362_hcd_device,
291#endif 291#endif
292}; 292};
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
index 4da70c47cc05..d0989290f54c 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -14,7 +14,7 @@
14#include <linux/spi/spi.h> 14#include <linux/spi/spi.h>
15#include <linux/spi/flash.h> 15#include <linux/spi/flash.h>
16#include <linux/spi/mmc_spi.h> 16#include <linux/spi/mmc_spi.h>
17#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 17#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
18#include <linux/usb/isp1362.h> 18#include <linux/usb/isp1362.h>
19#endif 19#endif
20#include <linux/irq.h> 20#include <linux/irq.h>
@@ -30,7 +30,7 @@
30 */ 30 */
31const char bfin_board_name[] = "ADI BF533-STAMP"; 31const char bfin_board_name[] = "ADI BF533-STAMP";
32 32
33#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 33#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
34static struct platform_device rtc_device = { 34static struct platform_device rtc_device = {
35 .name = "rtc-bfin", 35 .name = "rtc-bfin",
36 .id = -1, 36 .id = -1,
@@ -40,7 +40,7 @@ static struct platform_device rtc_device = {
40/* 40/*
41 * Driver needs to know address, irq and flag pin. 41 * Driver needs to know address, irq and flag pin.
42 */ 42 */
43#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 43#if IS_ENABLED(CONFIG_SMC91X)
44#include <linux/smc91x.h> 44#include <linux/smc91x.h>
45 45
46static struct smc91x_platdata smc91x_info = { 46static struct smc91x_platdata smc91x_info = {
@@ -73,7 +73,7 @@ static struct platform_device smc91x_device = {
73}; 73};
74#endif 74#endif
75 75
76#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 76#if IS_ENABLED(CONFIG_USB_NET2272)
77static struct resource net2272_bfin_resources[] = { 77static struct resource net2272_bfin_resources[] = {
78 { 78 {
79 .start = 0x20300000, 79 .start = 0x20300000,
@@ -97,7 +97,7 @@ static struct platform_device net2272_bfin_device = {
97}; 97};
98#endif 98#endif
99 99
100#if defined(CONFIG_MTD_BFIN_ASYNC) || defined(CONFIG_MTD_BFIN_ASYNC_MODULE) 100#if IS_ENABLED(CONFIG_MTD_BFIN_ASYNC)
101static struct mtd_partition stamp_partitions[] = { 101static struct mtd_partition stamp_partitions[] = {
102 { 102 {
103 .name = "bootloader(nor)", 103 .name = "bootloader(nor)",
@@ -147,7 +147,7 @@ static struct platform_device stamp_flash_device = {
147}; 147};
148#endif 148#endif
149 149
150#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 150#if IS_ENABLED(CONFIG_MTD_M25P80)
151static struct mtd_partition bfin_spi_flash_partitions[] = { 151static struct mtd_partition bfin_spi_flash_partitions[] = {
152 { 152 {
153 .name = "bootloader(spi)", 153 .name = "bootloader(spi)",
@@ -178,7 +178,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
178}; 178};
179#endif 179#endif
180 180
181#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 181#if IS_ENABLED(CONFIG_MMC_SPI)
182#define MMC_SPI_CARD_DETECT_INT IRQ_PF5 182#define MMC_SPI_CARD_DETECT_INT IRQ_PF5
183static int bfin_mmc_spi_init(struct device *dev, 183static int bfin_mmc_spi_init(struct device *dev,
184 irqreturn_t (*detect_int)(int, void *), void *data) 184 irqreturn_t (*detect_int)(int, void *), void *data)
@@ -206,7 +206,7 @@ static struct bfin5xx_spi_chip mmc_spi_chip_info = {
206#endif 206#endif
207 207
208static struct spi_board_info bfin_spi_board_info[] __initdata = { 208static struct spi_board_info bfin_spi_board_info[] __initdata = {
209#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 209#if IS_ENABLED(CONFIG_MTD_M25P80)
210 { 210 {
211 /* the modalias must be the same as spi device driver name */ 211 /* the modalias must be the same as spi device driver name */
212 .modalias = "m25p80", /* Name of spi_driver for this device */ 212 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -219,8 +219,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
219 }, 219 },
220#endif 220#endif
221 221
222#if defined(CONFIG_SND_BF5XX_SOC_AD1836) || \ 222#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836)
223 defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
224 { 223 {
225 .modalias = "ad1836", 224 .modalias = "ad1836",
226 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 225 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -231,7 +230,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
231 }, 230 },
232#endif 231#endif
233 232
234#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 233#if IS_ENABLED(CONFIG_SPI_SPIDEV)
235 { 234 {
236 .modalias = "spidev", 235 .modalias = "spidev",
237 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 236 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -239,7 +238,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
239 .chip_select = 1, 238 .chip_select = 1,
240 }, 239 },
241#endif 240#endif
242#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 241#if IS_ENABLED(CONFIG_MMC_SPI)
243 { 242 {
244 .modalias = "mmc_spi", 243 .modalias = "mmc_spi",
245 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 244 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
@@ -252,7 +251,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
252#endif 251#endif
253}; 252};
254 253
255#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 254#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
256/* SPI (0) */ 255/* SPI (0) */
257static struct resource bfin_spi0_resource[] = { 256static struct resource bfin_spi0_resource[] = {
258 [0] = { 257 [0] = {
@@ -290,7 +289,7 @@ static struct platform_device bfin_spi0_device = {
290}; 289};
291#endif /* spi master and devices */ 290#endif /* spi master and devices */
292 291
293#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 292#if IS_ENABLED(CONFIG_SERIAL_BFIN)
294#ifdef CONFIG_SERIAL_BFIN_UART0 293#ifdef CONFIG_SERIAL_BFIN_UART0
295static struct resource bfin_uart0_resources[] = { 294static struct resource bfin_uart0_resources[] = {
296 { 295 {
@@ -341,7 +340,7 @@ static struct platform_device bfin_uart0_device = {
341#endif 340#endif
342#endif 341#endif
343 342
344#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 343#if IS_ENABLED(CONFIG_BFIN_SIR)
345#ifdef CONFIG_BFIN_SIR0 344#ifdef CONFIG_BFIN_SIR0
346static struct resource bfin_sir0_resources[] = { 345static struct resource bfin_sir0_resources[] = {
347 { 346 {
@@ -370,8 +369,7 @@ static struct platform_device bfin_sir0_device = {
370#endif 369#endif
371#endif 370#endif
372 371
373#if defined(CONFIG_SERIAL_BFIN_SPORT) || \ 372#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
374 defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
375#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 373#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
376static struct resource bfin_sport0_uart_resources[] = { 374static struct resource bfin_sport0_uart_resources[] = {
377 { 375 {
@@ -442,7 +440,7 @@ static struct platform_device bfin_sport1_uart_device = {
442#endif 440#endif
443#endif 441#endif
444 442
445#if defined(CONFIG_BFIN_SPORT) || defined(CONFIG_BFIN_SPORT_MODULE) 443#if IS_ENABLED(CONFIG_BFIN_SPORT)
446static struct resource bfin_sport0_resources[] = { 444static struct resource bfin_sport0_resources[] = {
447 { 445 {
448 .start = SPORT0_TCR1, 446 .start = SPORT0_TCR1,
@@ -486,7 +484,7 @@ static struct platform_device bfin_sport0_device = {
486}; 484};
487#endif 485#endif
488 486
489#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 487#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
490#include <linux/input.h> 488#include <linux/input.h>
491#include <linux/gpio_keys.h> 489#include <linux/gpio_keys.h>
492 490
@@ -509,7 +507,7 @@ static struct platform_device bfin_device_gpiokeys = {
509}; 507};
510#endif 508#endif
511 509
512#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) 510#if IS_ENABLED(CONFIG_I2C_GPIO)
513#include <linux/i2c-gpio.h> 511#include <linux/i2c-gpio.h>
514 512
515static struct i2c_gpio_platform_data i2c_gpio_data = { 513static struct i2c_gpio_platform_data i2c_gpio_data = {
@@ -530,29 +528,29 @@ static struct platform_device i2c_gpio_device = {
530#endif 528#endif
531 529
532static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 530static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
533#if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE) 531#if IS_ENABLED(CONFIG_JOYSTICK_AD7142)
534 { 532 {
535 I2C_BOARD_INFO("ad7142_joystick", 0x2C), 533 I2C_BOARD_INFO("ad7142_joystick", 0x2C),
536 .irq = 39, 534 .irq = 39,
537 }, 535 },
538#endif 536#endif
539#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) 537#if IS_ENABLED(CONFIG_BFIN_TWI_LCD)
540 { 538 {
541 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 539 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
542 }, 540 },
543#endif 541#endif
544#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE) 542#if IS_ENABLED(CONFIG_INPUT_PCF8574)
545 { 543 {
546 I2C_BOARD_INFO("pcf8574_keypad", 0x27), 544 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
547 .irq = 39, 545 .irq = 39,
548 }, 546 },
549#endif 547#endif
550#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) 548#if IS_ENABLED(CONFIG_FB_BFIN_7393)
551 { 549 {
552 I2C_BOARD_INFO("bfin-adv7393", 0x2B), 550 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
553 }, 551 },
554#endif 552#endif
555#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) 553#if IS_ENABLED(CONFIG_BFIN_TWI_LCD)
556 { 554 {
557 I2C_BOARD_INFO("ad5252", 0x2f), 555 I2C_BOARD_INFO("ad5252", 0x2f),
558 }, 556 },
@@ -586,9 +584,8 @@ static struct platform_device bfin_dpmc = {
586 }, 584 },
587}; 585};
588 586
589#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \ 587#if IS_ENABLED(CONFIG_SND_BF5XX_I2S) || \
590 defined(CONFIG_SND_BF5XX_AC97) || \ 588 IS_ENABLED(CONFIG_SND_BF5XX_AC97)
591 defined(CONFIG_SND_BF5XX_AC97_MODULE)
592 589
593#include <asm/bfin_sport.h> 590#include <asm/bfin_sport.h>
594 591
@@ -640,22 +637,21 @@ static struct resource bfin_snd_resources[][4] = {
640}; 637};
641#endif 638#endif
642 639
643#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 640#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
644static struct platform_device bfin_i2s_pcm = { 641static struct platform_device bfin_i2s_pcm = {
645 .name = "bfin-i2s-pcm-audio", 642 .name = "bfin-i2s-pcm-audio",
646 .id = -1, 643 .id = -1,
647}; 644};
648#endif 645#endif
649 646
650#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 647#if IS_ENABLED(CONFIG_SND_BF5XX_AC97)
651static struct platform_device bfin_ac97_pcm = { 648static struct platform_device bfin_ac97_pcm = {
652 .name = "bfin-ac97-pcm-audio", 649 .name = "bfin-ac97-pcm-audio",
653 .id = -1, 650 .id = -1,
654}; 651};
655#endif 652#endif
656 653
657#if defined(CONFIG_SND_BF5XX_SOC_AD1836) \ 654#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836)
658 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
659static const char * const ad1836_link[] = { 655static const char * const ad1836_link[] = {
660 "bfin-i2s.0", 656 "bfin-i2s.0",
661 "spi0.4", 657 "spi0.4",
@@ -669,8 +665,7 @@ static struct platform_device bfin_ad1836_machine = {
669}; 665};
670#endif 666#endif
671 667
672#if defined(CONFIG_SND_BF5XX_SOC_AD73311) || \ 668#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD73311)
673 defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE)
674static const unsigned ad73311_gpio[] = { 669static const unsigned ad73311_gpio[] = {
675 GPIO_PF4, 670 GPIO_PF4,
676}; 671};
@@ -684,22 +679,21 @@ static struct platform_device bfin_ad73311_machine = {
684}; 679};
685#endif 680#endif
686 681
687#if defined(CONFIG_SND_SOC_AD73311) || defined(CONFIG_SND_SOC_AD73311_MODULE) 682#if IS_ENABLED(CONFIG_SND_SOC_AD73311)
688static struct platform_device bfin_ad73311_codec_device = { 683static struct platform_device bfin_ad73311_codec_device = {
689 .name = "ad73311", 684 .name = "ad73311",
690 .id = -1, 685 .id = -1,
691}; 686};
692#endif 687#endif
693 688
694#if defined(CONFIG_SND_SOC_AD74111) || defined(CONFIG_SND_SOC_AD74111_MODULE) 689#if IS_ENABLED(CONFIG_SND_SOC_AD74111)
695static struct platform_device bfin_ad74111_codec_device = { 690static struct platform_device bfin_ad74111_codec_device = {
696 .name = "ad74111", 691 .name = "ad74111",
697 .id = -1, 692 .id = -1,
698}; 693};
699#endif 694#endif
700 695
701#if defined(CONFIG_SND_BF5XX_SOC_I2S) || \ 696#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_I2S)
702 defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE)
703static struct platform_device bfin_i2s = { 697static struct platform_device bfin_i2s = {
704 .name = "bfin-i2s", 698 .name = "bfin-i2s",
705 .id = CONFIG_SND_BF5XX_SPORT_NUM, 699 .id = CONFIG_SND_BF5XX_SPORT_NUM,
@@ -712,8 +706,7 @@ static struct platform_device bfin_i2s = {
712}; 706};
713#endif 707#endif
714 708
715#if defined(CONFIG_SND_BF5XX_SOC_AC97) || \ 709#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AC97)
716 defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE)
717static struct platform_device bfin_ac97 = { 710static struct platform_device bfin_ac97 = {
718 .name = "bfin-ac97", 711 .name = "bfin-ac97",
719 .id = CONFIG_SND_BF5XX_SPORT_NUM, 712 .id = CONFIG_SND_BF5XX_SPORT_NUM,
@@ -730,36 +723,35 @@ static struct platform_device *stamp_devices[] __initdata = {
730 723
731 &bfin_dpmc, 724 &bfin_dpmc,
732 725
733#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 726#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
734 &rtc_device, 727 &rtc_device,
735#endif 728#endif
736 729
737#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 730#if IS_ENABLED(CONFIG_SMC91X)
738 &smc91x_device, 731 &smc91x_device,
739#endif 732#endif
740 733
741#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 734#if IS_ENABLED(CONFIG_USB_NET2272)
742 &net2272_bfin_device, 735 &net2272_bfin_device,
743#endif 736#endif
744 737
745#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 738#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
746 &bfin_spi0_device, 739 &bfin_spi0_device,
747#endif 740#endif
748 741
749#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 742#if IS_ENABLED(CONFIG_SERIAL_BFIN)
750#ifdef CONFIG_SERIAL_BFIN_UART0 743#ifdef CONFIG_SERIAL_BFIN_UART0
751 &bfin_uart0_device, 744 &bfin_uart0_device,
752#endif 745#endif
753#endif 746#endif
754 747
755#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 748#if IS_ENABLED(CONFIG_BFIN_SIR)
756#ifdef CONFIG_BFIN_SIR0 749#ifdef CONFIG_BFIN_SIR0
757 &bfin_sir0_device, 750 &bfin_sir0_device,
758#endif 751#endif
759#endif 752#endif
760 753
761#if defined(CONFIG_SERIAL_BFIN_SPORT) || \ 754#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
762 defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
763#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 755#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
764 &bfin_sport0_uart_device, 756 &bfin_sport0_uart_device,
765#endif 757#endif
@@ -768,58 +760,54 @@ static struct platform_device *stamp_devices[] __initdata = {
768#endif 760#endif
769#endif 761#endif
770 762
771#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 763#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
772 &bfin_device_gpiokeys, 764 &bfin_device_gpiokeys,
773#endif 765#endif
774 766
775#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) 767#if IS_ENABLED(CONFIG_I2C_GPIO)
776 &i2c_gpio_device, 768 &i2c_gpio_device,
777#endif 769#endif
778 770
779#if defined(CONFIG_MTD_BFIN_ASYNC) || defined(CONFIG_MTD_BFIN_ASYNC_MODULE) 771#if IS_ENABLED(CONFIG_MTD_BFIN_ASYNC)
780 &stamp_flash_device, 772 &stamp_flash_device,
781#endif 773#endif
782 774
783#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 775#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
784 &bfin_i2s_pcm, 776 &bfin_i2s_pcm,
785#endif 777#endif
786 778
787#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 779#if IS_ENABLED(CONFIG_SND_BF5XX_AC97)
788 &bfin_ac97_pcm, 780 &bfin_ac97_pcm,
789#endif 781#endif
790 782
791#if defined(CONFIG_SND_BF5XX_SOC_AD1836) || \ 783#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836)
792 defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
793 &bfin_ad1836_machine, 784 &bfin_ad1836_machine,
794#endif 785#endif
795 786
796#if defined(CONFIG_SND_BF5XX_SOC_AD73311) || \ 787#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD73311)
797 defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE)
798 &bfin_ad73311_machine, 788 &bfin_ad73311_machine,
799#endif 789#endif
800 790
801#if defined(CONFIG_SND_SOC_AD73311) || defined(CONFIG_SND_SOC_AD73311_MODULE) 791#if IS_ENABLED(CONFIG_SND_SOC_AD73311)
802 &bfin_ad73311_codec_device, 792 &bfin_ad73311_codec_device,
803#endif 793#endif
804 794
805#if defined(CONFIG_SND_SOC_AD74111) || defined(CONFIG_SND_SOC_AD74111_MODULE) 795#if IS_ENABLED(CONFIG_SND_SOC_AD74111)
806 &bfin_ad74111_codec_device, 796 &bfin_ad74111_codec_device,
807#endif 797#endif
808 798
809#if defined(CONFIG_SND_BF5XX_SOC_I2S) || \ 799#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_I2S)
810 defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE)
811 &bfin_i2s, 800 &bfin_i2s,
812#endif 801#endif
813 802
814#if defined(CONFIG_SND_BF5XX_SOC_AC97) || \ 803#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AC97)
815 defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE)
816 &bfin_ac97, 804 &bfin_ac97,
817#endif 805#endif
818}; 806};
819 807
820static int __init net2272_init(void) 808static int __init net2272_init(void)
821{ 809{
822#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 810#if IS_ENABLED(CONFIG_USB_NET2272)
823 int ret; 811 int ret;
824 812
825 /* Set PF0 to 0, PF1 to 1 make /AMS3 work properly */ 813 /* Set PF0 to 0, PF1 to 1 make /AMS3 work properly */
@@ -865,7 +853,7 @@ static int __init stamp_init(void)
865 if (ret < 0) 853 if (ret < 0)
866 return ret; 854 return ret;
867 855
868#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 856#if IS_ENABLED(CONFIG_SMC91X)
869 /* 857 /*
870 * setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC. 858 * setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC.
871 * the bfin-async-map driver takes care of flipping between 859 * the bfin-async-map driver takes care of flipping between
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537e.c b/arch/blackfin/mach-bf537/boards/cm_bf537e.c
index 85e4fc9f9c22..c65c6dbda3da 100644
--- a/arch/blackfin/mach-bf537/boards/cm_bf537e.c
+++ b/arch/blackfin/mach-bf537/boards/cm_bf537e.c
@@ -16,7 +16,7 @@
16#include <linux/mtd/physmap.h> 16#include <linux/mtd/physmap.h>
17#include <linux/spi/spi.h> 17#include <linux/spi/spi.h>
18#include <linux/spi/flash.h> 18#include <linux/spi/flash.h>
19#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 19#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
20#include <linux/usb/isp1362.h> 20#include <linux/usb/isp1362.h>
21#endif 21#endif
22#include <linux/ata_platform.h> 22#include <linux/ata_platform.h>
@@ -32,10 +32,10 @@
32 */ 32 */
33const char bfin_board_name[] = "Bluetechnix CM BF537E"; 33const char bfin_board_name[] = "Bluetechnix CM BF537E";
34 34
35#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 35#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
36/* all SPI peripherals info goes here */ 36/* all SPI peripherals info goes here */
37 37
38#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 38#if IS_ENABLED(CONFIG_MTD_M25P80)
39static struct mtd_partition bfin_spi_flash_partitions[] = { 39static struct mtd_partition bfin_spi_flash_partitions[] = {
40 { 40 {
41 .name = "bootloader(spi)", 41 .name = "bootloader(spi)",
@@ -66,14 +66,14 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
66}; 66};
67#endif 67#endif
68 68
69#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 69#if IS_ENABLED(CONFIG_MMC_SPI)
70static struct bfin5xx_spi_chip mmc_spi_chip_info = { 70static struct bfin5xx_spi_chip mmc_spi_chip_info = {
71 .enable_dma = 0, 71 .enable_dma = 0,
72}; 72};
73#endif 73#endif
74 74
75static struct spi_board_info bfin_spi_board_info[] __initdata = { 75static struct spi_board_info bfin_spi_board_info[] __initdata = {
76#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 76#if IS_ENABLED(CONFIG_MTD_M25P80)
77 { 77 {
78 /* the modalias must be the same as spi device driver name */ 78 /* the modalias must be the same as spi device driver name */
79 .modalias = "m25p80", /* Name of spi_driver for this device */ 79 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -86,7 +86,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
86 }, 86 },
87#endif 87#endif
88 88
89#if defined(CONFIG_SND_BF5XX_SOC_AD183X) || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) 89#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD183X)
90 { 90 {
91 .modalias = "ad183x", 91 .modalias = "ad183x",
92 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 92 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -95,7 +95,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
95 }, 95 },
96#endif 96#endif
97 97
98#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 98#if IS_ENABLED(CONFIG_MMC_SPI)
99 { 99 {
100 .modalias = "mmc_spi", 100 .modalias = "mmc_spi",
101 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 101 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
@@ -144,7 +144,7 @@ static struct platform_device bfin_spi0_device = {
144}; 144};
145#endif /* spi master and devices */ 145#endif /* spi master and devices */
146 146
147#if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE) 147#if IS_ENABLED(CONFIG_SPI_BFIN_SPORT)
148 148
149/* SPORT SPI controller data */ 149/* SPORT SPI controller data */
150static struct bfin5xx_spi_master bfin_sport_spi0_info = { 150static struct bfin5xx_spi_master bfin_sport_spi0_info = {
@@ -209,20 +209,20 @@ static struct platform_device bfin_sport_spi1_device = {
209 209
210#endif /* sport spi master and devices */ 210#endif /* sport spi master and devices */
211 211
212#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 212#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
213static struct platform_device rtc_device = { 213static struct platform_device rtc_device = {
214 .name = "rtc-bfin", 214 .name = "rtc-bfin",
215 .id = -1, 215 .id = -1,
216}; 216};
217#endif 217#endif
218 218
219#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE) 219#if IS_ENABLED(CONFIG_FB_HITACHI_TX09)
220static struct platform_device hitachi_fb_device = { 220static struct platform_device hitachi_fb_device = {
221 .name = "hitachi-tx09", 221 .name = "hitachi-tx09",
222}; 222};
223#endif 223#endif
224 224
225#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 225#if IS_ENABLED(CONFIG_SMC91X)
226#include <linux/smc91x.h> 226#include <linux/smc91x.h>
227 227
228static struct smc91x_platdata smc91x_info = { 228static struct smc91x_platdata smc91x_info = {
@@ -254,7 +254,7 @@ static struct platform_device smc91x_device = {
254}; 254};
255#endif 255#endif
256 256
257#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 257#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
258static struct resource isp1362_hcd_resources[] = { 258static struct resource isp1362_hcd_resources[] = {
259 { 259 {
260 .start = 0x20308000, 260 .start = 0x20308000,
@@ -293,7 +293,7 @@ static struct platform_device isp1362_hcd_device = {
293}; 293};
294#endif 294#endif
295 295
296#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 296#if IS_ENABLED(CONFIG_USB_NET2272)
297static struct resource net2272_bfin_resources[] = { 297static struct resource net2272_bfin_resources[] = {
298 { 298 {
299 .start = 0x20300000, 299 .start = 0x20300000,
@@ -314,7 +314,7 @@ static struct platform_device net2272_bfin_device = {
314}; 314};
315#endif 315#endif
316 316
317#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE) 317#if IS_ENABLED(CONFIG_MTD_GPIO_ADDR)
318static struct mtd_partition cm_partitions[] = { 318static struct mtd_partition cm_partitions[] = {
319 { 319 {
320 .name = "bootloader(nor)", 320 .name = "bootloader(nor)",
@@ -363,7 +363,7 @@ static struct platform_device cm_flash_device = {
363}; 363};
364#endif 364#endif
365 365
366#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 366#if IS_ENABLED(CONFIG_SERIAL_BFIN)
367#ifdef CONFIG_SERIAL_BFIN_UART0 367#ifdef CONFIG_SERIAL_BFIN_UART0
368static struct resource bfin_uart0_resources[] = { 368static struct resource bfin_uart0_resources[] = {
369 { 369 {
@@ -498,7 +498,7 @@ static struct platform_device bfin_uart1_device = {
498#endif 498#endif
499#endif 499#endif
500 500
501#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 501#if IS_ENABLED(CONFIG_BFIN_SIR)
502#ifdef CONFIG_BFIN_SIR0 502#ifdef CONFIG_BFIN_SIR0
503static struct resource bfin_sir0_resources[] = { 503static struct resource bfin_sir0_resources[] = {
504 { 504 {
@@ -551,7 +551,7 @@ static struct platform_device bfin_sir1_device = {
551#endif 551#endif
552#endif 552#endif
553 553
554#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 554#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
555static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; 555static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
556 556
557static struct resource bfin_twi0_resource[] = { 557static struct resource bfin_twi0_resource[] = {
@@ -578,14 +578,14 @@ static struct platform_device i2c_bfin_twi_device = {
578}; 578};
579#endif 579#endif
580 580
581#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) \ 581#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT) \
582|| defined(CONFIG_BFIN_SPORT) || defined(CONFIG_BFIN_SPORT_MODULE) 582|| IS_ENABLED(CONFIG_BFIN_SPORT)
583unsigned short bfin_sport0_peripherals[] = { 583unsigned short bfin_sport0_peripherals[] = {
584 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, 584 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
585 P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0 585 P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0
586}; 586};
587#endif 587#endif
588#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 588#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
589#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 589#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
590static struct resource bfin_sport0_uart_resources[] = { 590static struct resource bfin_sport0_uart_resources[] = {
591 { 591 {
@@ -650,7 +650,7 @@ static struct platform_device bfin_sport1_uart_device = {
650}; 650};
651#endif 651#endif
652#endif 652#endif
653#if defined(CONFIG_BFIN_SPORT) || defined(CONFIG_BFIN_SPORT_MODULE) 653#if IS_ENABLED(CONFIG_BFIN_SPORT)
654static struct resource bfin_sport0_resources[] = { 654static struct resource bfin_sport0_resources[] = {
655 { 655 {
656 .start = SPORT0_TCR1, 656 .start = SPORT0_TCR1,
@@ -694,7 +694,7 @@ static struct platform_device bfin_sport0_device = {
694}; 694};
695#endif 695#endif
696 696
697#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 697#if IS_ENABLED(CONFIG_BFIN_MAC)
698#include <linux/bfin_mac.h> 698#include <linux/bfin_mac.h>
699static const unsigned short bfin_mac_peripherals[] = P_MII0; 699static const unsigned short bfin_mac_peripherals[] = P_MII0;
700 700
@@ -727,7 +727,7 @@ static struct platform_device bfin_mac_device = {
727}; 727};
728#endif 728#endif
729 729
730#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 730#if IS_ENABLED(CONFIG_PATA_PLATFORM)
731#define PATA_INT IRQ_PF14 731#define PATA_INT IRQ_PF14
732 732
733static struct pata_platform_info bfin_pata_platform_data = { 733static struct pata_platform_info bfin_pata_platform_data = {
@@ -795,19 +795,19 @@ static struct platform_device *cm_bf537e_devices[] __initdata = {
795 795
796 &bfin_dpmc, 796 &bfin_dpmc,
797 797
798#if defined(CONFIG_BFIN_SPORT) || defined(CONFIG_BFIN_SPORT_MODULE) 798#if IS_ENABLED(CONFIG_BFIN_SPORT)
799 &bfin_sport0_device, 799 &bfin_sport0_device,
800#endif 800#endif
801 801
802#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE) 802#if IS_ENABLED(CONFIG_FB_HITACHI_TX09)
803 &hitachi_fb_device, 803 &hitachi_fb_device,
804#endif 804#endif
805 805
806#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 806#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
807 &rtc_device, 807 &rtc_device,
808#endif 808#endif
809 809
810#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 810#if IS_ENABLED(CONFIG_SERIAL_BFIN)
811#ifdef CONFIG_SERIAL_BFIN_UART0 811#ifdef CONFIG_SERIAL_BFIN_UART0
812 &bfin_uart0_device, 812 &bfin_uart0_device,
813#endif 813#endif
@@ -816,7 +816,7 @@ static struct platform_device *cm_bf537e_devices[] __initdata = {
816#endif 816#endif
817#endif 817#endif
818 818
819#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 819#if IS_ENABLED(CONFIG_BFIN_SIR)
820#ifdef CONFIG_BFIN_SIR0 820#ifdef CONFIG_BFIN_SIR0
821 &bfin_sir0_device, 821 &bfin_sir0_device,
822#endif 822#endif
@@ -825,11 +825,11 @@ static struct platform_device *cm_bf537e_devices[] __initdata = {
825#endif 825#endif
826#endif 826#endif
827 827
828#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 828#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
829 &i2c_bfin_twi_device, 829 &i2c_bfin_twi_device,
830#endif 830#endif
831 831
832#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 832#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
833#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 833#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
834 &bfin_sport0_uart_device, 834 &bfin_sport0_uart_device,
835#endif 835#endif
@@ -838,44 +838,44 @@ static struct platform_device *cm_bf537e_devices[] __initdata = {
838#endif 838#endif
839#endif 839#endif
840 840
841#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 841#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
842 &isp1362_hcd_device, 842 &isp1362_hcd_device,
843#endif 843#endif
844 844
845#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 845#if IS_ENABLED(CONFIG_SMC91X)
846 &smc91x_device, 846 &smc91x_device,
847#endif 847#endif
848 848
849#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 849#if IS_ENABLED(CONFIG_BFIN_MAC)
850 &bfin_mii_bus, 850 &bfin_mii_bus,
851 &bfin_mac_device, 851 &bfin_mac_device,
852#endif 852#endif
853 853
854#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 854#if IS_ENABLED(CONFIG_USB_NET2272)
855 &net2272_bfin_device, 855 &net2272_bfin_device,
856#endif 856#endif
857 857
858#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 858#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
859 &bfin_spi0_device, 859 &bfin_spi0_device,
860#endif 860#endif
861 861
862#if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE) 862#if IS_ENABLED(CONFIG_SPI_BFIN_SPORT)
863 &bfin_sport_spi0_device, 863 &bfin_sport_spi0_device,
864 &bfin_sport_spi1_device, 864 &bfin_sport_spi1_device,
865#endif 865#endif
866 866
867#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 867#if IS_ENABLED(CONFIG_PATA_PLATFORM)
868 &bfin_pata_device, 868 &bfin_pata_device,
869#endif 869#endif
870 870
871#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE) 871#if IS_ENABLED(CONFIG_MTD_GPIO_ADDR)
872 &cm_flash_device, 872 &cm_flash_device,
873#endif 873#endif
874}; 874};
875 875
876static int __init net2272_init(void) 876static int __init net2272_init(void)
877{ 877{
878#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 878#if IS_ENABLED(CONFIG_USB_NET2272)
879 int ret; 879 int ret;
880 880
881 ret = gpio_request(GPIO_PG14, "net2272"); 881 ret = gpio_request(GPIO_PG14, "net2272");
@@ -895,11 +895,11 @@ static int __init cm_bf537e_init(void)
895{ 895{
896 printk(KERN_INFO "%s(): registering device resources\n", __func__); 896 printk(KERN_INFO "%s(): registering device resources\n", __func__);
897 platform_add_devices(cm_bf537e_devices, ARRAY_SIZE(cm_bf537e_devices)); 897 platform_add_devices(cm_bf537e_devices, ARRAY_SIZE(cm_bf537e_devices));
898#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 898#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
899 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 899 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
900#endif 900#endif
901 901
902#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 902#if IS_ENABLED(CONFIG_PATA_PLATFORM)
903 irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN); 903 irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN);
904#endif 904#endif
905 905
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537u.c b/arch/blackfin/mach-bf537/boards/cm_bf537u.c
index 0143d8bef909..af58454b4bff 100644
--- a/arch/blackfin/mach-bf537/boards/cm_bf537u.c
+++ b/arch/blackfin/mach-bf537/boards/cm_bf537u.c
@@ -16,7 +16,7 @@
16#include <linux/mtd/physmap.h> 16#include <linux/mtd/physmap.h>
17#include <linux/spi/spi.h> 17#include <linux/spi/spi.h>
18#include <linux/spi/flash.h> 18#include <linux/spi/flash.h>
19#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 19#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
20#include <linux/usb/isp1362.h> 20#include <linux/usb/isp1362.h>
21#endif 21#endif
22#include <linux/ata_platform.h> 22#include <linux/ata_platform.h>
@@ -32,10 +32,10 @@
32 */ 32 */
33const char bfin_board_name[] = "Bluetechnix CM BF537U"; 33const char bfin_board_name[] = "Bluetechnix CM BF537U";
34 34
35#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 35#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
36/* all SPI peripherals info goes here */ 36/* all SPI peripherals info goes here */
37 37
38#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 38#if IS_ENABLED(CONFIG_MTD_M25P80)
39static struct mtd_partition bfin_spi_flash_partitions[] = { 39static struct mtd_partition bfin_spi_flash_partitions[] = {
40 { 40 {
41 .name = "bootloader(spi)", 41 .name = "bootloader(spi)",
@@ -66,14 +66,14 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
66}; 66};
67#endif 67#endif
68 68
69#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 69#if IS_ENABLED(CONFIG_MMC_SPI)
70static struct bfin5xx_spi_chip mmc_spi_chip_info = { 70static struct bfin5xx_spi_chip mmc_spi_chip_info = {
71 .enable_dma = 0, 71 .enable_dma = 0,
72}; 72};
73#endif 73#endif
74 74
75static struct spi_board_info bfin_spi_board_info[] __initdata = { 75static struct spi_board_info bfin_spi_board_info[] __initdata = {
76#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 76#if IS_ENABLED(CONFIG_MTD_M25P80)
77 { 77 {
78 /* the modalias must be the same as spi device driver name */ 78 /* the modalias must be the same as spi device driver name */
79 .modalias = "m25p80", /* Name of spi_driver for this device */ 79 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -86,7 +86,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
86 }, 86 },
87#endif 87#endif
88 88
89#if defined(CONFIG_SND_BF5XX_SOC_AD183X) || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) 89#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD183X)
90 { 90 {
91 .modalias = "ad183x", 91 .modalias = "ad183x",
92 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 92 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -95,7 +95,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
95 }, 95 },
96#endif 96#endif
97 97
98#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 98#if IS_ENABLED(CONFIG_MMC_SPI)
99 { 99 {
100 .modalias = "mmc_spi", 100 .modalias = "mmc_spi",
101 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 101 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
@@ -144,20 +144,20 @@ static struct platform_device bfin_spi0_device = {
144}; 144};
145#endif /* spi master and devices */ 145#endif /* spi master and devices */
146 146
147#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 147#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
148static struct platform_device rtc_device = { 148static struct platform_device rtc_device = {
149 .name = "rtc-bfin", 149 .name = "rtc-bfin",
150 .id = -1, 150 .id = -1,
151}; 151};
152#endif 152#endif
153 153
154#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE) 154#if IS_ENABLED(CONFIG_FB_HITACHI_TX09)
155static struct platform_device hitachi_fb_device = { 155static struct platform_device hitachi_fb_device = {
156 .name = "hitachi-tx09", 156 .name = "hitachi-tx09",
157}; 157};
158#endif 158#endif
159 159
160#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 160#if IS_ENABLED(CONFIG_SMC91X)
161#include <linux/smc91x.h> 161#include <linux/smc91x.h>
162 162
163static struct smc91x_platdata smc91x_info = { 163static struct smc91x_platdata smc91x_info = {
@@ -189,7 +189,7 @@ static struct platform_device smc91x_device = {
189}; 189};
190#endif 190#endif
191 191
192#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 192#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
193static struct resource isp1362_hcd_resources[] = { 193static struct resource isp1362_hcd_resources[] = {
194 { 194 {
195 .start = 0x20308000, 195 .start = 0x20308000,
@@ -228,7 +228,7 @@ static struct platform_device isp1362_hcd_device = {
228}; 228};
229#endif 229#endif
230 230
231#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 231#if IS_ENABLED(CONFIG_USB_NET2272)
232static struct resource net2272_bfin_resources[] = { 232static struct resource net2272_bfin_resources[] = {
233 { 233 {
234 .start = 0x20200000, 234 .start = 0x20200000,
@@ -249,7 +249,7 @@ static struct platform_device net2272_bfin_device = {
249}; 249};
250#endif 250#endif
251 251
252#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE) 252#if IS_ENABLED(CONFIG_MTD_GPIO_ADDR)
253static struct mtd_partition cm_partitions[] = { 253static struct mtd_partition cm_partitions[] = {
254 { 254 {
255 .name = "bootloader(nor)", 255 .name = "bootloader(nor)",
@@ -298,7 +298,7 @@ static struct platform_device cm_flash_device = {
298}; 298};
299#endif 299#endif
300 300
301#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 301#if IS_ENABLED(CONFIG_SERIAL_BFIN)
302#ifdef CONFIG_SERIAL_BFIN_UART0 302#ifdef CONFIG_SERIAL_BFIN_UART0
303static struct resource bfin_uart0_resources[] = { 303static struct resource bfin_uart0_resources[] = {
304 { 304 {
@@ -397,7 +397,7 @@ static struct platform_device bfin_uart1_device = {
397#endif 397#endif
398#endif 398#endif
399 399
400#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 400#if IS_ENABLED(CONFIG_BFIN_SIR)
401#ifdef CONFIG_BFIN_SIR0 401#ifdef CONFIG_BFIN_SIR0
402static struct resource bfin_sir0_resources[] = { 402static struct resource bfin_sir0_resources[] = {
403 { 403 {
@@ -450,7 +450,7 @@ static struct platform_device bfin_sir1_device = {
450#endif 450#endif
451#endif 451#endif
452 452
453#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 453#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
454static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; 454static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
455 455
456static struct resource bfin_twi0_resource[] = { 456static struct resource bfin_twi0_resource[] = {
@@ -477,7 +477,7 @@ static struct platform_device i2c_bfin_twi_device = {
477}; 477};
478#endif 478#endif
479 479
480#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 480#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
481#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 481#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
482static struct resource bfin_sport0_uart_resources[] = { 482static struct resource bfin_sport0_uart_resources[] = {
483 { 483 {
@@ -548,7 +548,7 @@ static struct platform_device bfin_sport1_uart_device = {
548#endif 548#endif
549#endif 549#endif
550 550
551#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 551#if IS_ENABLED(CONFIG_BFIN_MAC)
552#include <linux/bfin_mac.h> 552#include <linux/bfin_mac.h>
553static const unsigned short bfin_mac_peripherals[] = P_MII0; 553static const unsigned short bfin_mac_peripherals[] = P_MII0;
554 554
@@ -581,7 +581,7 @@ static struct platform_device bfin_mac_device = {
581}; 581};
582#endif 582#endif
583 583
584#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 584#if IS_ENABLED(CONFIG_PATA_PLATFORM)
585#define PATA_INT IRQ_PF14 585#define PATA_INT IRQ_PF14
586 586
587static struct pata_platform_info bfin_pata_platform_data = { 587static struct pata_platform_info bfin_pata_platform_data = {
@@ -649,15 +649,15 @@ static struct platform_device *cm_bf537u_devices[] __initdata = {
649 649
650 &bfin_dpmc, 650 &bfin_dpmc,
651 651
652#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE) 652#if IS_ENABLED(CONFIG_FB_HITACHI_TX09)
653 &hitachi_fb_device, 653 &hitachi_fb_device,
654#endif 654#endif
655 655
656#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 656#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
657 &rtc_device, 657 &rtc_device,
658#endif 658#endif
659 659
660#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 660#if IS_ENABLED(CONFIG_SERIAL_BFIN)
661#ifdef CONFIG_SERIAL_BFIN_UART0 661#ifdef CONFIG_SERIAL_BFIN_UART0
662 &bfin_uart0_device, 662 &bfin_uart0_device,
663#endif 663#endif
@@ -666,7 +666,7 @@ static struct platform_device *cm_bf537u_devices[] __initdata = {
666#endif 666#endif
667#endif 667#endif
668 668
669#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 669#if IS_ENABLED(CONFIG_BFIN_SIR)
670#ifdef CONFIG_BFIN_SIR0 670#ifdef CONFIG_BFIN_SIR0
671 &bfin_sir0_device, 671 &bfin_sir0_device,
672#endif 672#endif
@@ -675,11 +675,11 @@ static struct platform_device *cm_bf537u_devices[] __initdata = {
675#endif 675#endif
676#endif 676#endif
677 677
678#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 678#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
679 &i2c_bfin_twi_device, 679 &i2c_bfin_twi_device,
680#endif 680#endif
681 681
682#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 682#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
683#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 683#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
684 &bfin_sport0_uart_device, 684 &bfin_sport0_uart_device,
685#endif 685#endif
@@ -688,39 +688,39 @@ static struct platform_device *cm_bf537u_devices[] __initdata = {
688#endif 688#endif
689#endif 689#endif
690 690
691#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 691#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
692 &isp1362_hcd_device, 692 &isp1362_hcd_device,
693#endif 693#endif
694 694
695#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 695#if IS_ENABLED(CONFIG_SMC91X)
696 &smc91x_device, 696 &smc91x_device,
697#endif 697#endif
698 698
699#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 699#if IS_ENABLED(CONFIG_BFIN_MAC)
700 &bfin_mii_bus, 700 &bfin_mii_bus,
701 &bfin_mac_device, 701 &bfin_mac_device,
702#endif 702#endif
703 703
704#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 704#if IS_ENABLED(CONFIG_USB_NET2272)
705 &net2272_bfin_device, 705 &net2272_bfin_device,
706#endif 706#endif
707 707
708#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 708#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
709 &bfin_spi0_device, 709 &bfin_spi0_device,
710#endif 710#endif
711 711
712#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 712#if IS_ENABLED(CONFIG_PATA_PLATFORM)
713 &bfin_pata_device, 713 &bfin_pata_device,
714#endif 714#endif
715 715
716#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE) 716#if IS_ENABLED(CONFIG_MTD_GPIO_ADDR)
717 &cm_flash_device, 717 &cm_flash_device,
718#endif 718#endif
719}; 719};
720 720
721static int __init net2272_init(void) 721static int __init net2272_init(void)
722{ 722{
723#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 723#if IS_ENABLED(CONFIG_USB_NET2272)
724 int ret; 724 int ret;
725 725
726 ret = gpio_request(GPIO_PH15, driver_name); 726 ret = gpio_request(GPIO_PH15, driver_name);
@@ -752,11 +752,11 @@ static int __init cm_bf537u_init(void)
752{ 752{
753 printk(KERN_INFO "%s(): registering device resources\n", __func__); 753 printk(KERN_INFO "%s(): registering device resources\n", __func__);
754 platform_add_devices(cm_bf537u_devices, ARRAY_SIZE(cm_bf537u_devices)); 754 platform_add_devices(cm_bf537u_devices, ARRAY_SIZE(cm_bf537u_devices));
755#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 755#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
756 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 756 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
757#endif 757#endif
758 758
759#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 759#if IS_ENABLED(CONFIG_PATA_PLATFORM)
760 irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN); 760 irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN);
761#endif 761#endif
762 762
diff --git a/arch/blackfin/mach-bf537/boards/dnp5370.c b/arch/blackfin/mach-bf537/boards/dnp5370.c
index 8bbf0a23fd49..e79b3b810c39 100644
--- a/arch/blackfin/mach-bf537/boards/dnp5370.c
+++ b/arch/blackfin/mach-bf537/boards/dnp5370.c
@@ -41,14 +41,14 @@ const char bfin_board_name[] = "DNP/5370";
41#define FLASH_MAC 0x202f0000 41#define FLASH_MAC 0x202f0000
42#define CONFIG_MTD_PHYSMAP_LEN 0x300000 42#define CONFIG_MTD_PHYSMAP_LEN 0x300000
43 43
44#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 44#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
45static struct platform_device rtc_device = { 45static struct platform_device rtc_device = {
46 .name = "rtc-bfin", 46 .name = "rtc-bfin",
47 .id = -1, 47 .id = -1,
48}; 48};
49#endif 49#endif
50 50
51#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 51#if IS_ENABLED(CONFIG_BFIN_MAC)
52#include <linux/bfin_mac.h> 52#include <linux/bfin_mac.h>
53static const unsigned short bfin_mac_peripherals[] = P_RMII0; 53static const unsigned short bfin_mac_peripherals[] = P_RMII0;
54 54
@@ -81,7 +81,7 @@ static struct platform_device bfin_mac_device = {
81}; 81};
82#endif 82#endif
83 83
84#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 84#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
85static struct mtd_partition asmb_flash_partitions[] = { 85static struct mtd_partition asmb_flash_partitions[] = {
86 { 86 {
87 .name = "bootloader(nor)", 87 .name = "bootloader(nor)",
@@ -125,9 +125,9 @@ static struct platform_device asmb_flash_device = {
125}; 125};
126#endif 126#endif
127 127
128#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 128#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
129 129
130#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 130#if IS_ENABLED(CONFIG_MMC_SPI)
131 131
132static struct bfin5xx_spi_chip mmc_spi_chip_info = { 132static struct bfin5xx_spi_chip mmc_spi_chip_info = {
133 .enable_dma = 0, /* use no dma transfer with this chip*/ 133 .enable_dma = 0, /* use no dma transfer with this chip*/
@@ -135,7 +135,7 @@ static struct bfin5xx_spi_chip mmc_spi_chip_info = {
135 135
136#endif 136#endif
137 137
138#if defined(CONFIG_MTD_DATAFLASH) || defined(CONFIG_MTD_DATAFLASH_MODULE) 138#if IS_ENABLED(CONFIG_MTD_DATAFLASH)
139/* This mapping is for at45db642 it has 1056 page size, 139/* This mapping is for at45db642 it has 1056 page size,
140 * partition size and offset should be page aligned 140 * partition size and offset should be page aligned
141 */ 141 */
@@ -166,7 +166,7 @@ static struct bfin5xx_spi_chip spi_dataflash_chip_info = {
166 166
167static struct spi_board_info bfin_spi_board_info[] __initdata = { 167static struct spi_board_info bfin_spi_board_info[] __initdata = {
168/* SD/MMC card reader at SPI bus */ 168/* SD/MMC card reader at SPI bus */
169#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 169#if IS_ENABLED(CONFIG_MMC_SPI)
170 { 170 {
171 .modalias = "mmc_spi", 171 .modalias = "mmc_spi",
172 .max_speed_hz = 20000000, 172 .max_speed_hz = 20000000,
@@ -178,7 +178,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
178#endif 178#endif
179 179
180/* 8 Megabyte Atmel NOR flash chip at SPI bus */ 180/* 8 Megabyte Atmel NOR flash chip at SPI bus */
181#if defined(CONFIG_MTD_DATAFLASH) || defined(CONFIG_MTD_DATAFLASH_MODULE) 181#if IS_ENABLED(CONFIG_MTD_DATAFLASH)
182 { 182 {
183 .modalias = "mtd_dataflash", 183 .modalias = "mtd_dataflash",
184 .max_speed_hz = 16700000, 184 .max_speed_hz = 16700000,
@@ -228,7 +228,7 @@ static struct platform_device spi_bfin_master_device = {
228}; 228};
229#endif 229#endif
230 230
231#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 231#if IS_ENABLED(CONFIG_SERIAL_BFIN)
232#ifdef CONFIG_SERIAL_BFIN_UART0 232#ifdef CONFIG_SERIAL_BFIN_UART0
233static struct resource bfin_uart0_resources[] = { 233static struct resource bfin_uart0_resources[] = {
234 { 234 {
@@ -328,7 +328,7 @@ static struct platform_device bfin_uart1_device = {
328#endif 328#endif
329#endif 329#endif
330 330
331#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 331#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
332static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; 332static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
333 333
334static struct resource bfin_twi0_resource[] = { 334static struct resource bfin_twi0_resource[] = {
@@ -357,7 +357,7 @@ static struct platform_device i2c_bfin_twi_device = {
357 357
358static struct platform_device *dnp5370_devices[] __initdata = { 358static struct platform_device *dnp5370_devices[] __initdata = {
359 359
360#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 360#if IS_ENABLED(CONFIG_SERIAL_BFIN)
361#ifdef CONFIG_SERIAL_BFIN_UART0 361#ifdef CONFIG_SERIAL_BFIN_UART0
362 &bfin_uart0_device, 362 &bfin_uart0_device,
363#endif 363#endif
@@ -366,24 +366,24 @@ static struct platform_device *dnp5370_devices[] __initdata = {
366#endif 366#endif
367#endif 367#endif
368 368
369#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 369#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
370 &asmb_flash_device, 370 &asmb_flash_device,
371#endif 371#endif
372 372
373#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 373#if IS_ENABLED(CONFIG_BFIN_MAC)
374 &bfin_mii_bus, 374 &bfin_mii_bus,
375 &bfin_mac_device, 375 &bfin_mac_device,
376#endif 376#endif
377 377
378#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 378#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
379 &spi_bfin_master_device, 379 &spi_bfin_master_device,
380#endif 380#endif
381 381
382#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 382#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
383 &i2c_bfin_twi_device, 383 &i2c_bfin_twi_device,
384#endif 384#endif
385 385
386#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 386#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
387 &rtc_device, 387 &rtc_device,
388#endif 388#endif
389 389
diff --git a/arch/blackfin/mach-bf537/boards/minotaur.c b/arch/blackfin/mach-bf537/boards/minotaur.c
index a10f90e444bc..dd7bda07bf90 100644
--- a/arch/blackfin/mach-bf537/boards/minotaur.c
+++ b/arch/blackfin/mach-bf537/boards/minotaur.c
@@ -13,7 +13,7 @@
13#include <linux/mtd/partitions.h> 13#include <linux/mtd/partitions.h>
14#include <linux/spi/spi.h> 14#include <linux/spi/spi.h>
15#include <linux/spi/flash.h> 15#include <linux/spi/flash.h>
16#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 16#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
17#include <linux/usb/isp1362.h> 17#include <linux/usb/isp1362.h>
18#endif 18#endif
19#include <linux/ata_platform.h> 19#include <linux/ata_platform.h>
@@ -31,7 +31,7 @@
31 */ 31 */
32const char bfin_board_name[] = "CamSig Minotaur BF537"; 32const char bfin_board_name[] = "CamSig Minotaur BF537";
33 33
34#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) 34#if IS_ENABLED(CONFIG_BFIN_CFPCMCIA)
35static struct resource bfin_pcmcia_cf_resources[] = { 35static struct resource bfin_pcmcia_cf_resources[] = {
36 { 36 {
37 .start = 0x20310000, /* IO PORT */ 37 .start = 0x20310000, /* IO PORT */
@@ -60,14 +60,14 @@ static struct platform_device bfin_pcmcia_cf_device = {
60}; 60};
61#endif 61#endif
62 62
63#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 63#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
64static struct platform_device rtc_device = { 64static struct platform_device rtc_device = {
65 .name = "rtc-bfin", 65 .name = "rtc-bfin",
66 .id = -1, 66 .id = -1,
67}; 67};
68#endif 68#endif
69 69
70#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 70#if IS_ENABLED(CONFIG_BFIN_MAC)
71#include <linux/bfin_mac.h> 71#include <linux/bfin_mac.h>
72static const unsigned short bfin_mac_peripherals[] = P_MII0; 72static const unsigned short bfin_mac_peripherals[] = P_MII0;
73 73
@@ -100,7 +100,7 @@ static struct platform_device bfin_mac_device = {
100}; 100};
101#endif 101#endif
102 102
103#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 103#if IS_ENABLED(CONFIG_USB_NET2272)
104static struct resource net2272_bfin_resources[] = { 104static struct resource net2272_bfin_resources[] = {
105 { 105 {
106 .start = 0x20300000, 106 .start = 0x20300000,
@@ -121,11 +121,10 @@ static struct platform_device net2272_bfin_device = {
121}; 121};
122#endif 122#endif
123 123
124#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 124#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
125/* all SPI peripherals info goes here */ 125/* all SPI peripherals info goes here */
126 126
127#if defined(CONFIG_MTD_M25P80) \ 127#if IS_ENABLED(CONFIG_MTD_M25P80)
128 || defined(CONFIG_MTD_M25P80_MODULE)
129 128
130/* Partition sizes */ 129/* Partition sizes */
131#define FLASH_SIZE 0x00400000 130#define FLASH_SIZE 0x00400000
@@ -162,15 +161,14 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
162}; 161};
163#endif 162#endif
164 163
165#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 164#if IS_ENABLED(CONFIG_MMC_SPI)
166static struct bfin5xx_spi_chip mmc_spi_chip_info = { 165static struct bfin5xx_spi_chip mmc_spi_chip_info = {
167 .enable_dma = 0, 166 .enable_dma = 0,
168}; 167};
169#endif 168#endif
170 169
171static struct spi_board_info bfin_spi_board_info[] __initdata = { 170static struct spi_board_info bfin_spi_board_info[] __initdata = {
172#if defined(CONFIG_MTD_M25P80) \ 171#if IS_ENABLED(CONFIG_MTD_M25P80)
173 || defined(CONFIG_MTD_M25P80_MODULE)
174 { 172 {
175 /* the modalias must be the same as spi device driver name */ 173 /* the modalias must be the same as spi device driver name */
176 .modalias = "m25p80", /* Name of spi_driver for this device */ 174 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -183,7 +181,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
183 }, 181 },
184#endif 182#endif
185 183
186#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 184#if IS_ENABLED(CONFIG_MMC_SPI)
187 { 185 {
188 .modalias = "mmc_spi", 186 .modalias = "mmc_spi",
189 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */ 187 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
@@ -231,7 +229,7 @@ static struct platform_device bfin_spi0_device = {
231}; 229};
232#endif /* spi master and devices */ 230#endif /* spi master and devices */
233 231
234#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 232#if IS_ENABLED(CONFIG_SERIAL_BFIN)
235#ifdef CONFIG_SERIAL_BFIN_UART0 233#ifdef CONFIG_SERIAL_BFIN_UART0
236static struct resource bfin_uart0_resources[] = { 234static struct resource bfin_uart0_resources[] = {
237 { 235 {
@@ -330,7 +328,7 @@ static struct platform_device bfin_uart1_device = {
330#endif 328#endif
331#endif 329#endif
332 330
333#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 331#if IS_ENABLED(CONFIG_BFIN_SIR)
334#ifdef CONFIG_BFIN_SIR0 332#ifdef CONFIG_BFIN_SIR0
335static struct resource bfin_sir0_resources[] = { 333static struct resource bfin_sir0_resources[] = {
336 { 334 {
@@ -385,7 +383,7 @@ static struct platform_device bfin_sir1_device = {
385#endif 383#endif
386#endif 384#endif
387 385
388#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 386#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
389static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; 387static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
390 388
391static struct resource bfin_twi0_resource[] = { 389static struct resource bfin_twi0_resource[] = {
@@ -412,7 +410,7 @@ static struct platform_device i2c_bfin_twi_device = {
412}; 410};
413#endif 411#endif
414 412
415#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 413#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
416#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 414#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
417static struct resource bfin_sport0_uart_resources[] = { 415static struct resource bfin_sport0_uart_resources[] = {
418 { 416 {
@@ -484,28 +482,28 @@ static struct platform_device bfin_sport1_uart_device = {
484#endif 482#endif
485 483
486static struct platform_device *minotaur_devices[] __initdata = { 484static struct platform_device *minotaur_devices[] __initdata = {
487#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) 485#if IS_ENABLED(CONFIG_BFIN_CFPCMCIA)
488 &bfin_pcmcia_cf_device, 486 &bfin_pcmcia_cf_device,
489#endif 487#endif
490 488
491#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 489#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
492 &rtc_device, 490 &rtc_device,
493#endif 491#endif
494 492
495#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 493#if IS_ENABLED(CONFIG_BFIN_MAC)
496 &bfin_mii_bus, 494 &bfin_mii_bus,
497 &bfin_mac_device, 495 &bfin_mac_device,
498#endif 496#endif
499 497
500#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 498#if IS_ENABLED(CONFIG_USB_NET2272)
501 &net2272_bfin_device, 499 &net2272_bfin_device,
502#endif 500#endif
503 501
504#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 502#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
505 &bfin_spi0_device, 503 &bfin_spi0_device,
506#endif 504#endif
507 505
508#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 506#if IS_ENABLED(CONFIG_SERIAL_BFIN)
509#ifdef CONFIG_SERIAL_BFIN_UART0 507#ifdef CONFIG_SERIAL_BFIN_UART0
510 &bfin_uart0_device, 508 &bfin_uart0_device,
511#endif 509#endif
@@ -514,7 +512,7 @@ static struct platform_device *minotaur_devices[] __initdata = {
514#endif 512#endif
515#endif 513#endif
516 514
517#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 515#if IS_ENABLED(CONFIG_BFIN_SIR)
518#ifdef CONFIG_BFIN_SIR0 516#ifdef CONFIG_BFIN_SIR0
519 &bfin_sir0_device, 517 &bfin_sir0_device,
520#endif 518#endif
@@ -523,11 +521,11 @@ static struct platform_device *minotaur_devices[] __initdata = {
523#endif 521#endif
524#endif 522#endif
525 523
526#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 524#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
527 &i2c_bfin_twi_device, 525 &i2c_bfin_twi_device,
528#endif 526#endif
529 527
530#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 528#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
531#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 529#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
532 &bfin_sport0_uart_device, 530 &bfin_sport0_uart_device,
533#endif 531#endif
@@ -542,7 +540,7 @@ static int __init minotaur_init(void)
542{ 540{
543 printk(KERN_INFO "%s(): registering device resources\n", __func__); 541 printk(KERN_INFO "%s(): registering device resources\n", __func__);
544 platform_add_devices(minotaur_devices, ARRAY_SIZE(minotaur_devices)); 542 platform_add_devices(minotaur_devices, ARRAY_SIZE(minotaur_devices));
545#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 543#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
546 spi_register_board_info(bfin_spi_board_info, 544 spi_register_board_info(bfin_spi_board_info,
547 ARRAY_SIZE(bfin_spi_board_info)); 545 ARRAY_SIZE(bfin_spi_board_info));
548#endif 546#endif
diff --git a/arch/blackfin/mach-bf537/boards/pnav10.c b/arch/blackfin/mach-bf537/boards/pnav10.c
index 6b395510405b..06a50ddb54c0 100644
--- a/arch/blackfin/mach-bf537/boards/pnav10.c
+++ b/arch/blackfin/mach-bf537/boards/pnav10.c
@@ -30,7 +30,7 @@ const char bfin_board_name[] = "ADI PNAV-1.0";
30 * Driver needs to know address, irq and flag pin. 30 * Driver needs to know address, irq and flag pin.
31 */ 31 */
32 32
33#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) 33#if IS_ENABLED(CONFIG_BFIN_CFPCMCIA)
34static struct resource bfin_pcmcia_cf_resources[] = { 34static struct resource bfin_pcmcia_cf_resources[] = {
35 { 35 {
36 .start = 0x20310000, /* IO PORT */ 36 .start = 0x20310000, /* IO PORT */
@@ -59,14 +59,14 @@ static struct platform_device bfin_pcmcia_cf_device = {
59}; 59};
60#endif 60#endif
61 61
62#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 62#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
63static struct platform_device rtc_device = { 63static struct platform_device rtc_device = {
64 .name = "rtc-bfin", 64 .name = "rtc-bfin",
65 .id = -1, 65 .id = -1,
66}; 66};
67#endif 67#endif
68 68
69#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 69#if IS_ENABLED(CONFIG_SMC91X)
70#include <linux/smc91x.h> 70#include <linux/smc91x.h>
71 71
72static struct smc91x_platdata smc91x_info = { 72static struct smc91x_platdata smc91x_info = {
@@ -99,7 +99,7 @@ static struct platform_device smc91x_device = {
99}; 99};
100#endif 100#endif
101 101
102#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 102#if IS_ENABLED(CONFIG_BFIN_MAC)
103#include <linux/bfin_mac.h> 103#include <linux/bfin_mac.h>
104static const unsigned short bfin_mac_peripherals[] = P_RMII0; 104static const unsigned short bfin_mac_peripherals[] = P_RMII0;
105 105
@@ -132,7 +132,7 @@ static struct platform_device bfin_mac_device = {
132}; 132};
133#endif 133#endif
134 134
135#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 135#if IS_ENABLED(CONFIG_USB_NET2272)
136static struct resource net2272_bfin_resources[] = { 136static struct resource net2272_bfin_resources[] = {
137 { 137 {
138 .start = 0x20300000, 138 .start = 0x20300000,
@@ -153,11 +153,10 @@ static struct platform_device net2272_bfin_device = {
153}; 153};
154#endif 154#endif
155 155
156#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 156#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
157/* all SPI peripherals info goes here */ 157/* all SPI peripherals info goes here */
158 158
159#if defined(CONFIG_MTD_M25P80) \ 159#if IS_ENABLED(CONFIG_MTD_M25P80)
160 || defined(CONFIG_MTD_M25P80_MODULE)
161static struct mtd_partition bfin_spi_flash_partitions[] = { 160static struct mtd_partition bfin_spi_flash_partitions[] = {
162 { 161 {
163 .name = "bootloader(spi)", 162 .name = "bootloader(spi)",
@@ -188,13 +187,13 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
188}; 187};
189#endif 188#endif
190 189
191#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 190#if IS_ENABLED(CONFIG_MMC_SPI)
192static struct bfin5xx_spi_chip mmc_spi_chip_info = { 191static struct bfin5xx_spi_chip mmc_spi_chip_info = {
193 .enable_dma = 0, 192 .enable_dma = 0,
194}; 193};
195#endif 194#endif
196 195
197#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 196#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
198static const struct ad7877_platform_data bfin_ad7877_ts_info = { 197static const struct ad7877_platform_data bfin_ad7877_ts_info = {
199 .model = 7877, 198 .model = 7877,
200 .vref_delay_usecs = 50, /* internal, no capacitor */ 199 .vref_delay_usecs = 50, /* internal, no capacitor */
@@ -211,8 +210,7 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = {
211#endif 210#endif
212 211
213static struct spi_board_info bfin_spi_board_info[] __initdata = { 212static struct spi_board_info bfin_spi_board_info[] __initdata = {
214#if defined(CONFIG_MTD_M25P80) \ 213#if IS_ENABLED(CONFIG_MTD_M25P80)
215 || defined(CONFIG_MTD_M25P80_MODULE)
216 { 214 {
217 /* the modalias must be the same as spi device driver name */ 215 /* the modalias must be the same as spi device driver name */
218 .modalias = "m25p80", /* Name of spi_driver for this device */ 216 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -225,8 +223,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
225 }, 223 },
226#endif 224#endif
227 225
228#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \ 226#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD183X)
229 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
230 { 227 {
231 .modalias = "ad183x", 228 .modalias = "ad183x",
232 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 229 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -234,7 +231,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
234 .chip_select = 4, 231 .chip_select = 4,
235 }, 232 },
236#endif 233#endif
237#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 234#if IS_ENABLED(CONFIG_MMC_SPI)
238 { 235 {
239 .modalias = "mmc_spi", 236 .modalias = "mmc_spi",
240 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 237 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
@@ -244,7 +241,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
244 .mode = SPI_MODE_3, 241 .mode = SPI_MODE_3,
245 }, 242 },
246#endif 243#endif
247#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 244#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
248{ 245{
249 .modalias = "ad7877", 246 .modalias = "ad7877",
250 .platform_data = &bfin_ad7877_ts_info, 247 .platform_data = &bfin_ad7877_ts_info,
@@ -294,13 +291,13 @@ static struct platform_device bfin_spi0_device = {
294}; 291};
295#endif /* spi master and devices */ 292#endif /* spi master and devices */
296 293
297#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) 294#if IS_ENABLED(CONFIG_FB_BF537_LQ035)
298static struct platform_device bfin_fb_device = { 295static struct platform_device bfin_fb_device = {
299 .name = "bf537-lq035", 296 .name = "bf537-lq035",
300}; 297};
301#endif 298#endif
302 299
303#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 300#if IS_ENABLED(CONFIG_SERIAL_BFIN)
304#ifdef CONFIG_SERIAL_BFIN_UART0 301#ifdef CONFIG_SERIAL_BFIN_UART0
305static struct resource bfin_uart0_resources[] = { 302static struct resource bfin_uart0_resources[] = {
306 { 303 {
@@ -399,7 +396,7 @@ static struct platform_device bfin_uart1_device = {
399#endif 396#endif
400#endif 397#endif
401 398
402#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 399#if IS_ENABLED(CONFIG_BFIN_SIR)
403#ifdef CONFIG_BFIN_SIR0 400#ifdef CONFIG_BFIN_SIR0
404static struct resource bfin_sir0_resources[] = { 401static struct resource bfin_sir0_resources[] = {
405 { 402 {
@@ -455,36 +452,36 @@ static struct platform_device bfin_sir1_device = {
455#endif 452#endif
456 453
457static struct platform_device *stamp_devices[] __initdata = { 454static struct platform_device *stamp_devices[] __initdata = {
458#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) 455#if IS_ENABLED(CONFIG_BFIN_CFPCMCIA)
459 &bfin_pcmcia_cf_device, 456 &bfin_pcmcia_cf_device,
460#endif 457#endif
461 458
462#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 459#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
463 &rtc_device, 460 &rtc_device,
464#endif 461#endif
465 462
466#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 463#if IS_ENABLED(CONFIG_SMC91X)
467 &smc91x_device, 464 &smc91x_device,
468#endif 465#endif
469 466
470#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 467#if IS_ENABLED(CONFIG_BFIN_MAC)
471 &bfin_mii_bus, 468 &bfin_mii_bus,
472 &bfin_mac_device, 469 &bfin_mac_device,
473#endif 470#endif
474 471
475#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 472#if IS_ENABLED(CONFIG_USB_NET2272)
476 &net2272_bfin_device, 473 &net2272_bfin_device,
477#endif 474#endif
478 475
479#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 476#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
480 &bfin_spi0_device, 477 &bfin_spi0_device,
481#endif 478#endif
482 479
483#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) 480#if IS_ENABLED(CONFIG_FB_BF537_LQ035)
484 &bfin_fb_device, 481 &bfin_fb_device,
485#endif 482#endif
486 483
487#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 484#if IS_ENABLED(CONFIG_SERIAL_BFIN)
488#ifdef CONFIG_SERIAL_BFIN_UART0 485#ifdef CONFIG_SERIAL_BFIN_UART0
489 &bfin_uart0_device, 486 &bfin_uart0_device,
490#endif 487#endif
@@ -493,7 +490,7 @@ static struct platform_device *stamp_devices[] __initdata = {
493#endif 490#endif
494#endif 491#endif
495 492
496#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 493#if IS_ENABLED(CONFIG_BFIN_SIR)
497#ifdef CONFIG_BFIN_SIR0 494#ifdef CONFIG_BFIN_SIR0
498 &bfin_sir0_device, 495 &bfin_sir0_device,
499#endif 496#endif
@@ -507,7 +504,7 @@ static int __init pnav_init(void)
507{ 504{
508 printk(KERN_INFO "%s(): registering device resources\n", __func__); 505 printk(KERN_INFO "%s(): registering device resources\n", __func__);
509 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); 506 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
510#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 507#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
511 spi_register_board_info(bfin_spi_board_info, 508 spi_register_board_info(bfin_spi_board_info,
512 ARRAY_SIZE(bfin_spi_board_info)); 509 ARRAY_SIZE(bfin_spi_board_info));
513#endif 510#endif
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index 44fd1d4682ac..de19b8a56007 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -18,7 +18,7 @@
18#include <linux/mtd/physmap.h> 18#include <linux/mtd/physmap.h>
19#include <linux/spi/spi.h> 19#include <linux/spi/spi.h>
20#include <linux/spi/flash.h> 20#include <linux/spi/flash.h>
21#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 21#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
22#include <linux/usb/isp1362.h> 22#include <linux/usb/isp1362.h>
23#endif 23#endif
24#include <linux/i2c.h> 24#include <linux/i2c.h>
@@ -53,7 +53,7 @@ const char bfin_board_name[] = "ADI BF537-STAMP";
53 * Driver needs to know address, irq and flag pin. 53 * Driver needs to know address, irq and flag pin.
54 */ 54 */
55 55
56#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) 56#if IS_ENABLED(CONFIG_USB_ISP1760_HCD)
57#include <linux/usb/isp1760.h> 57#include <linux/usb/isp1760.h>
58static struct resource bfin_isp1760_resources[] = { 58static struct resource bfin_isp1760_resources[] = {
59 [0] = { 59 [0] = {
@@ -88,7 +88,7 @@ static struct platform_device bfin_isp1760_device = {
88}; 88};
89#endif 89#endif
90 90
91#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 91#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
92#include <linux/gpio_keys.h> 92#include <linux/gpio_keys.h>
93 93
94static struct gpio_keys_button bfin_gpio_keys_table[] = { 94static struct gpio_keys_button bfin_gpio_keys_table[] = {
@@ -111,7 +111,7 @@ static struct platform_device bfin_device_gpiokeys = {
111}; 111};
112#endif 112#endif
113 113
114#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) 114#if IS_ENABLED(CONFIG_BFIN_CFPCMCIA)
115static struct resource bfin_pcmcia_cf_resources[] = { 115static struct resource bfin_pcmcia_cf_resources[] = {
116 { 116 {
117 .start = 0x20310000, /* IO PORT */ 117 .start = 0x20310000, /* IO PORT */
@@ -140,14 +140,14 @@ static struct platform_device bfin_pcmcia_cf_device = {
140}; 140};
141#endif 141#endif
142 142
143#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 143#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
144static struct platform_device rtc_device = { 144static struct platform_device rtc_device = {
145 .name = "rtc-bfin", 145 .name = "rtc-bfin",
146 .id = -1, 146 .id = -1,
147}; 147};
148#endif 148#endif
149 149
150#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 150#if IS_ENABLED(CONFIG_SMC91X)
151#include <linux/smc91x.h> 151#include <linux/smc91x.h>
152 152
153static struct smc91x_platdata smc91x_info = { 153static struct smc91x_platdata smc91x_info = {
@@ -180,7 +180,7 @@ static struct platform_device smc91x_device = {
180}; 180};
181#endif 181#endif
182 182
183#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) 183#if IS_ENABLED(CONFIG_DM9000)
184static struct resource dm9000_resources[] = { 184static struct resource dm9000_resources[] = {
185 [0] = { 185 [0] = {
186 .start = 0x203FB800, 186 .start = 0x203FB800,
@@ -207,7 +207,7 @@ static struct platform_device dm9000_device = {
207}; 207};
208#endif 208#endif
209 209
210#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) 210#if IS_ENABLED(CONFIG_USB_SL811_HCD)
211static struct resource sl811_hcd_resources[] = { 211static struct resource sl811_hcd_resources[] = {
212 { 212 {
213 .start = 0x20340000, 213 .start = 0x20340000,
@@ -251,7 +251,7 @@ static struct platform_device sl811_hcd_device = {
251}; 251};
252#endif 252#endif
253 253
254#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 254#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
255static struct resource isp1362_hcd_resources[] = { 255static struct resource isp1362_hcd_resources[] = {
256 { 256 {
257 .start = 0x20360000, 257 .start = 0x20360000,
@@ -290,7 +290,7 @@ static struct platform_device isp1362_hcd_device = {
290}; 290};
291#endif 291#endif
292 292
293#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE) 293#if IS_ENABLED(CONFIG_CAN_BFIN)
294static unsigned short bfin_can_peripherals[] = { 294static unsigned short bfin_can_peripherals[] = {
295 P_CAN0_RX, P_CAN0_TX, 0 295 P_CAN0_RX, P_CAN0_TX, 0
296}; 296};
@@ -328,7 +328,7 @@ static struct platform_device bfin_can_device = {
328}; 328};
329#endif 329#endif
330 330
331#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 331#if IS_ENABLED(CONFIG_BFIN_MAC)
332#include <linux/bfin_mac.h> 332#include <linux/bfin_mac.h>
333static const unsigned short bfin_mac_peripherals[] = P_MII0; 333static const unsigned short bfin_mac_peripherals[] = P_MII0;
334 334
@@ -361,7 +361,7 @@ static struct platform_device bfin_mac_device = {
361}; 361};
362#endif 362#endif
363 363
364#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 364#if IS_ENABLED(CONFIG_USB_NET2272)
365static struct resource net2272_bfin_resources[] = { 365static struct resource net2272_bfin_resources[] = {
366 { 366 {
367 .start = 0x20300000, 367 .start = 0x20300000,
@@ -385,7 +385,7 @@ static struct platform_device net2272_bfin_device = {
385}; 385};
386#endif 386#endif
387 387
388#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE) 388#if IS_ENABLED(CONFIG_MTD_NAND_PLATFORM)
389const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL }; 389const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
390 390
391static struct mtd_partition bfin_plat_nand_partitions[] = { 391static struct mtd_partition bfin_plat_nand_partitions[] = {
@@ -461,7 +461,7 @@ static void bfin_plat_nand_init(void)
461static void bfin_plat_nand_init(void) {} 461static void bfin_plat_nand_init(void) {}
462#endif 462#endif
463 463
464#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 464#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
465static struct mtd_partition stamp_partitions[] = { 465static struct mtd_partition stamp_partitions[] = {
466 { 466 {
467 .name = "bootloader(nor)", 467 .name = "bootloader(nor)",
@@ -509,8 +509,7 @@ static struct platform_device stamp_flash_device = {
509}; 509};
510#endif 510#endif
511 511
512#if defined(CONFIG_MTD_M25P80) \ 512#if IS_ENABLED(CONFIG_MTD_M25P80)
513 || defined(CONFIG_MTD_M25P80_MODULE)
514static struct mtd_partition bfin_spi_flash_partitions[] = { 513static struct mtd_partition bfin_spi_flash_partitions[] = {
515 { 514 {
516 .name = "bootloader(spi)", 515 .name = "bootloader(spi)",
@@ -541,7 +540,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
541}; 540};
542#endif 541#endif
543 542
544#if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE) 543#if IS_ENABLED(CONFIG_INPUT_AD714X_SPI)
545#include <linux/input/ad714x.h> 544#include <linux/input/ad714x.h>
546 545
547static struct ad714x_slider_plat ad7147_spi_slider_plat[] = { 546static struct ad714x_slider_plat ad7147_spi_slider_plat[] = {
@@ -602,7 +601,7 @@ static struct ad714x_platform_data ad7147_spi_platform_data = {
602}; 601};
603#endif 602#endif
604 603
605#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE) 604#if IS_ENABLED(CONFIG_INPUT_AD714X_I2C)
606#include <linux/input/ad714x.h> 605#include <linux/input/ad714x.h>
607static struct ad714x_button_plat ad7142_i2c_button_plat[] = { 606static struct ad714x_button_plat ad7142_i2c_button_plat[] = {
608 { 607 {
@@ -649,24 +648,24 @@ static struct ad714x_platform_data ad7142_i2c_platform_data = {
649}; 648};
650#endif 649#endif
651 650
652#if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE) 651#if IS_ENABLED(CONFIG_AD2S90)
653static struct bfin5xx_spi_chip ad2s90_spi_chip_info = { 652static struct bfin5xx_spi_chip ad2s90_spi_chip_info = {
654 .enable_dma = 0, 653 .enable_dma = 0,
655}; 654};
656#endif 655#endif
657 656
658#if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE) 657#if IS_ENABLED(CONFIG_AD2S1200)
659static unsigned short ad2s120x_platform_data[] = { 658static unsigned short ad2s1200_platform_data[] = {
660 /* used as SAMPLE and RDVEL */ 659 /* used as SAMPLE and RDVEL */
661 GPIO_PF5, GPIO_PF6, 0 660 GPIO_PF5, GPIO_PF6, 0
662}; 661};
663 662
664static struct bfin5xx_spi_chip ad2s120x_spi_chip_info = { 663static struct bfin5xx_spi_chip ad2s1200_spi_chip_info = {
665 .enable_dma = 0, 664 .enable_dma = 0,
666}; 665};
667#endif 666#endif
668 667
669#if defined(CONFIG_AD2S1210) || defined(CONFIG_AD2S1210_MODULE) 668#if IS_ENABLED(CONFIG_AD2S1210)
670static unsigned short ad2s1210_platform_data[] = { 669static unsigned short ad2s1210_platform_data[] = {
671 /* use as SAMPLE, A0, A1 */ 670 /* use as SAMPLE, A0, A1 */
672 GPIO_PF7, GPIO_PF8, GPIO_PF9, 671 GPIO_PF7, GPIO_PF8, GPIO_PF9,
@@ -682,13 +681,13 @@ static struct bfin5xx_spi_chip ad2s1210_spi_chip_info = {
682}; 681};
683#endif 682#endif
684 683
685#if defined(CONFIG_AD7314) || defined(CONFIG_AD7314_MODULE) 684#if IS_ENABLED(CONFIG_SENSORS_AD7314)
686static struct bfin5xx_spi_chip ad7314_spi_chip_info = { 685static struct bfin5xx_spi_chip ad7314_spi_chip_info = {
687 .enable_dma = 0, 686 .enable_dma = 0,
688}; 687};
689#endif 688#endif
690 689
691#if defined(CONFIG_AD7816) || defined(CONFIG_AD7816_MODULE) 690#if IS_ENABLED(CONFIG_AD7816)
692static unsigned short ad7816_platform_data[] = { 691static unsigned short ad7816_platform_data[] = {
693 GPIO_PF4, /* rdwr_pin */ 692 GPIO_PF4, /* rdwr_pin */
694 GPIO_PF5, /* convert_pin */ 693 GPIO_PF5, /* convert_pin */
@@ -701,7 +700,7 @@ static struct bfin5xx_spi_chip ad7816_spi_chip_info = {
701}; 700};
702#endif 701#endif
703 702
704#if defined(CONFIG_ADT7310) || defined(CONFIG_ADT7310_MODULE) 703#if IS_ENABLED(CONFIG_ADT7310)
705static unsigned long adt7310_platform_data[3] = { 704static unsigned long adt7310_platform_data[3] = {
706/* INT bound temperature alarm event. line 1 */ 705/* INT bound temperature alarm event. line 1 */
707 IRQ_PG4, IRQF_TRIGGER_LOW, 706 IRQ_PG4, IRQF_TRIGGER_LOW,
@@ -714,14 +713,14 @@ static struct bfin5xx_spi_chip adt7310_spi_chip_info = {
714}; 713};
715#endif 714#endif
716 715
717#if defined(CONFIG_AD7298) || defined(CONFIG_AD7298_MODULE) 716#if IS_ENABLED(CONFIG_AD7298)
718static unsigned short ad7298_platform_data[] = { 717static unsigned short ad7298_platform_data[] = {
719 GPIO_PF7, /* busy_pin */ 718 GPIO_PF7, /* busy_pin */
720 0, 719 0,
721}; 720};
722#endif 721#endif
723 722
724#if defined(CONFIG_ADT7316_SPI) || defined(CONFIG_ADT7316_SPI_MODULE) 723#if IS_ENABLED(CONFIG_ADT7316_SPI)
725static unsigned long adt7316_spi_data[2] = { 724static unsigned long adt7316_spi_data[2] = {
726 IRQF_TRIGGER_LOW, /* interrupt flags */ 725 IRQF_TRIGGER_LOW, /* interrupt flags */
727 GPIO_PF7, /* ldac_pin, 0 means DAC/LDAC registers control DAC update */ 726 GPIO_PF7, /* ldac_pin, 0 means DAC/LDAC registers control DAC update */
@@ -732,7 +731,7 @@ static struct bfin5xx_spi_chip adt7316_spi_chip_info = {
732}; 731};
733#endif 732#endif
734 733
735#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 734#if IS_ENABLED(CONFIG_MMC_SPI)
736#define MMC_SPI_CARD_DETECT_INT IRQ_PF5 735#define MMC_SPI_CARD_DETECT_INT IRQ_PF5
737 736
738static int bfin_mmc_spi_init(struct device *dev, 737static int bfin_mmc_spi_init(struct device *dev,
@@ -759,7 +758,7 @@ static struct bfin5xx_spi_chip mmc_spi_chip_info = {
759}; 758};
760#endif 759#endif
761 760
762#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 761#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
763#include <linux/spi/ad7877.h> 762#include <linux/spi/ad7877.h>
764static const struct ad7877_platform_data bfin_ad7877_ts_info = { 763static const struct ad7877_platform_data bfin_ad7877_ts_info = {
765 .model = 7877, 764 .model = 7877,
@@ -776,7 +775,7 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = {
776}; 775};
777#endif 776#endif
778 777
779#if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE) 778#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7879)
780#include <linux/spi/ad7879.h> 779#include <linux/spi/ad7879.h>
781static const struct ad7879_platform_data bfin_ad7879_ts_info = { 780static const struct ad7879_platform_data bfin_ad7879_ts_info = {
782 .model = 7879, /* Model = AD7879 */ 781 .model = 7879, /* Model = AD7879 */
@@ -793,7 +792,7 @@ static const struct ad7879_platform_data bfin_ad7879_ts_info = {
793}; 792};
794#endif 793#endif
795 794
796#if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE) 795#if IS_ENABLED(CONFIG_INPUT_ADXL34X)
797#include <linux/input/adxl34x.h> 796#include <linux/input/adxl34x.h>
798static const struct adxl34x_platform_data adxl34x_info = { 797static const struct adxl34x_platform_data adxl34x_info = {
799 .x_axis_offset = 0, 798 .x_axis_offset = 0,
@@ -832,13 +831,13 @@ static const struct adxl34x_platform_data adxl34x_info = {
832}; 831};
833#endif 832#endif
834 833
835#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE) 834#if IS_ENABLED(CONFIG_ENC28J60)
836static struct bfin5xx_spi_chip enc28j60_spi_chip_info = { 835static struct bfin5xx_spi_chip enc28j60_spi_chip_info = {
837 .enable_dma = 1, 836 .enable_dma = 1,
838}; 837};
839#endif 838#endif
840 839
841#if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE) 840#if IS_ENABLED(CONFIG_ADF702X)
842#include <linux/spi/adf702x.h> 841#include <linux/spi/adf702x.h>
843#define TXREG 0x0160A470 842#define TXREG 0x0160A470
844static const u32 adf7021_regs[] = { 843static const u32 adf7021_regs[] = {
@@ -880,7 +879,7 @@ static inline void adf702x_mac_init(void)
880static inline void adf702x_mac_init(void) {} 879static inline void adf702x_mac_init(void) {}
881#endif 880#endif
882 881
883#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) 882#if IS_ENABLED(CONFIG_TOUCHSCREEN_ADS7846)
884#include <linux/spi/ads7846.h> 883#include <linux/spi/ads7846.h>
885static int ads7873_get_pendown_state(void) 884static int ads7873_get_pendown_state(void)
886{ 885{
@@ -899,8 +898,7 @@ static struct ads7846_platform_data __initdata ad7873_pdata = {
899}; 898};
900#endif 899#endif
901 900
902#if defined(CONFIG_MTD_DATAFLASH) \ 901#if IS_ENABLED(CONFIG_MTD_DATAFLASH)
903 || defined(CONFIG_MTD_DATAFLASH_MODULE)
904 902
905static struct mtd_partition bfin_spi_dataflash_partitions[] = { 903static struct mtd_partition bfin_spi_dataflash_partitions[] = {
906 { 904 {
@@ -931,15 +929,14 @@ static struct bfin5xx_spi_chip data_flash_chip_info = {
931}; 929};
932#endif 930#endif
933 931
934#if defined(CONFIG_AD7476) || defined(CONFIG_AD7476_MODULE) 932#if IS_ENABLED(CONFIG_AD7476)
935static struct bfin5xx_spi_chip spi_ad7476_chip_info = { 933static struct bfin5xx_spi_chip spi_ad7476_chip_info = {
936 .enable_dma = 0, /* use dma transfer with this chip*/ 934 .enable_dma = 0, /* use dma transfer with this chip*/
937}; 935};
938#endif 936#endif
939 937
940static struct spi_board_info bfin_spi_board_info[] __initdata = { 938static struct spi_board_info bfin_spi_board_info[] __initdata = {
941#if defined(CONFIG_MTD_M25P80) \ 939#if IS_ENABLED(CONFIG_MTD_M25P80)
942 || defined(CONFIG_MTD_M25P80_MODULE)
943 { 940 {
944 /* the modalias must be the same as spi device driver name */ 941 /* the modalias must be the same as spi device driver name */
945 .modalias = "m25p80", /* Name of spi_driver for this device */ 942 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -951,8 +948,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
951 .mode = SPI_MODE_3, 948 .mode = SPI_MODE_3,
952 }, 949 },
953#endif 950#endif
954#if defined(CONFIG_MTD_DATAFLASH) \ 951#if IS_ENABLED(CONFIG_MTD_DATAFLASH)
955 || defined(CONFIG_MTD_DATAFLASH_MODULE)
956 { /* DataFlash chip */ 952 { /* DataFlash chip */
957 .modalias = "mtd_dataflash", 953 .modalias = "mtd_dataflash",
958 .max_speed_hz = 33250000, /* max spi clock (SCK) speed in HZ */ 954 .max_speed_hz = 33250000, /* max spi clock (SCK) speed in HZ */
@@ -964,8 +960,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
964 }, 960 },
965#endif 961#endif
966 962
967#if defined(CONFIG_SND_BF5XX_SOC_AD1836) \ 963#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836)
968 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
969 { 964 {
970 .modalias = "ad1836", 965 .modalias = "ad1836",
971 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 966 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -986,7 +981,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
986 }, 981 },
987#endif 982#endif
988 983
989#if defined(CONFIG_SND_SOC_ADAV80X) || defined(CONFIG_SND_SOC_ADV80X_MODULE) 984#if IS_ENABLED(CONFIG_SND_SOC_ADAV80X)
990 { 985 {
991 .modalias = "adav801", 986 .modalias = "adav801",
992 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 987 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -996,7 +991,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
996 }, 991 },
997#endif 992#endif
998 993
999#if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE) 994#if IS_ENABLED(CONFIG_INPUT_AD714X_SPI)
1000 { 995 {
1001 .modalias = "ad714x_captouch", 996 .modalias = "ad714x_captouch",
1002 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ 997 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
@@ -1008,7 +1003,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1008 }, 1003 },
1009#endif 1004#endif
1010 1005
1011#if defined(CONFIG_AD2S90) || defined(CONFIG_AD2S90_MODULE) 1006#if IS_ENABLED(CONFIG_AD2S90)
1012 { 1007 {
1013 .modalias = "ad2s90", 1008 .modalias = "ad2s90",
1014 .bus_num = 0, 1009 .bus_num = 0,
@@ -1019,17 +1014,17 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1019 }, 1014 },
1020#endif 1015#endif
1021 1016
1022#if defined(CONFIG_AD2S120X) || defined(CONFIG_AD2S120X_MODULE) 1017#if IS_ENABLED(CONFIG_AD2S1200)
1023 { 1018 {
1024 .modalias = "ad2s120x", 1019 .modalias = "ad2s1200",
1025 .bus_num = 0, 1020 .bus_num = 0,
1026 .chip_select = 4, /* CS, change it for your board */ 1021 .chip_select = 4, /* CS, change it for your board */
1027 .platform_data = ad2s120x_platform_data, 1022 .platform_data = ad2s1200_platform_data,
1028 .controller_data = &ad2s120x_spi_chip_info, 1023 .controller_data = &ad2s1200_spi_chip_info,
1029 }, 1024 },
1030#endif 1025#endif
1031 1026
1032#if defined(CONFIG_AD2S1210) || defined(CONFIG_AD2S1210_MODULE) 1027#if IS_ENABLED(CONFIG_AD2S1210)
1033 { 1028 {
1034 .modalias = "ad2s1210", 1029 .modalias = "ad2s1210",
1035 .max_speed_hz = 8192000, 1030 .max_speed_hz = 8192000,
@@ -1040,7 +1035,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1040 }, 1035 },
1041#endif 1036#endif
1042 1037
1043#if defined(CONFIG_AD7314) || defined(CONFIG_AD7314_MODULE) 1038#if IS_ENABLED(CONFIG_SENSORS_AD7314)
1044 { 1039 {
1045 .modalias = "ad7314", 1040 .modalias = "ad7314",
1046 .max_speed_hz = 1000000, 1041 .max_speed_hz = 1000000,
@@ -1051,7 +1046,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1051 }, 1046 },
1052#endif 1047#endif
1053 1048
1054#if defined(CONFIG_AD7816) || defined(CONFIG_AD7816_MODULE) 1049#if IS_ENABLED(CONFIG_AD7816)
1055 { 1050 {
1056 .modalias = "ad7818", 1051 .modalias = "ad7818",
1057 .max_speed_hz = 1000000, 1052 .max_speed_hz = 1000000,
@@ -1063,7 +1058,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1063 }, 1058 },
1064#endif 1059#endif
1065 1060
1066#if defined(CONFIG_ADT7310) || defined(CONFIG_ADT7310_MODULE) 1061#if IS_ENABLED(CONFIG_ADT7310)
1067 { 1062 {
1068 .modalias = "adt7310", 1063 .modalias = "adt7310",
1069 .max_speed_hz = 1000000, 1064 .max_speed_hz = 1000000,
@@ -1076,7 +1071,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1076 }, 1071 },
1077#endif 1072#endif
1078 1073
1079#if defined(CONFIG_AD7298) || defined(CONFIG_AD7298_MODULE) 1074#if IS_ENABLED(CONFIG_AD7298)
1080 { 1075 {
1081 .modalias = "ad7298", 1076 .modalias = "ad7298",
1082 .max_speed_hz = 1000000, 1077 .max_speed_hz = 1000000,
@@ -1087,7 +1082,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1087 }, 1082 },
1088#endif 1083#endif
1089 1084
1090#if defined(CONFIG_ADT7316_SPI) || defined(CONFIG_ADT7316_SPI_MODULE) 1085#if IS_ENABLED(CONFIG_ADT7316_SPI)
1091 { 1086 {
1092 .modalias = "adt7316", 1087 .modalias = "adt7316",
1093 .max_speed_hz = 1000000, 1088 .max_speed_hz = 1000000,
@@ -1100,7 +1095,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1100 }, 1095 },
1101#endif 1096#endif
1102 1097
1103#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 1098#if IS_ENABLED(CONFIG_MMC_SPI)
1104 { 1099 {
1105 .modalias = "mmc_spi", 1100 .modalias = "mmc_spi",
1106 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 1101 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
@@ -1111,7 +1106,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1111 .mode = SPI_MODE_3, 1106 .mode = SPI_MODE_3,
1112 }, 1107 },
1113#endif 1108#endif
1114#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 1109#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
1115 { 1110 {
1116 .modalias = "ad7877", 1111 .modalias = "ad7877",
1117 .platform_data = &bfin_ad7877_ts_info, 1112 .platform_data = &bfin_ad7877_ts_info,
@@ -1121,7 +1116,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1121 .chip_select = 1, 1116 .chip_select = 1,
1122 }, 1117 },
1123#endif 1118#endif
1124#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE) 1119#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7879_SPI)
1125 { 1120 {
1126 .modalias = "ad7879", 1121 .modalias = "ad7879",
1127 .platform_data = &bfin_ad7879_ts_info, 1122 .platform_data = &bfin_ad7879_ts_info,
@@ -1132,7 +1127,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1132 .mode = SPI_CPHA | SPI_CPOL, 1127 .mode = SPI_CPHA | SPI_CPOL,
1133 }, 1128 },
1134#endif 1129#endif
1135#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 1130#if IS_ENABLED(CONFIG_SPI_SPIDEV)
1136 { 1131 {
1137 .modalias = "spidev", 1132 .modalias = "spidev",
1138 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 1133 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -1140,7 +1135,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1140 .chip_select = 1, 1135 .chip_select = 1,
1141 }, 1136 },
1142#endif 1137#endif
1143#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 1138#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)
1144 { 1139 {
1145 .modalias = "bfin-lq035q1-spi", 1140 .modalias = "bfin-lq035q1-spi",
1146 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 1141 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
@@ -1149,7 +1144,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1149 .mode = SPI_CPHA | SPI_CPOL, 1144 .mode = SPI_CPHA | SPI_CPOL,
1150 }, 1145 },
1151#endif 1146#endif
1152#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE) 1147#if IS_ENABLED(CONFIG_ENC28J60)
1153 { 1148 {
1154 .modalias = "enc28j60", 1149 .modalias = "enc28j60",
1155 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 1150 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
@@ -1160,7 +1155,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1160 .mode = SPI_MODE_0, 1155 .mode = SPI_MODE_0,
1161 }, 1156 },
1162#endif 1157#endif
1163#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE) 1158#if IS_ENABLED(CONFIG_INPUT_ADXL34X_SPI)
1164 { 1159 {
1165 .modalias = "adxl34x", 1160 .modalias = "adxl34x",
1166 .platform_data = &adxl34x_info, 1161 .platform_data = &adxl34x_info,
@@ -1171,7 +1166,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1171 .mode = SPI_MODE_3, 1166 .mode = SPI_MODE_3,
1172 }, 1167 },
1173#endif 1168#endif
1174#if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE) 1169#if IS_ENABLED(CONFIG_ADF702X)
1175 { 1170 {
1176 .modalias = "adf702x", 1171 .modalias = "adf702x",
1177 .max_speed_hz = 16000000, /* max spi clock (SCK) speed in HZ */ 1172 .max_speed_hz = 16000000, /* max spi clock (SCK) speed in HZ */
@@ -1181,7 +1176,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1181 .mode = SPI_MODE_0, 1176 .mode = SPI_MODE_0,
1182 }, 1177 },
1183#endif 1178#endif
1184#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) 1179#if IS_ENABLED(CONFIG_TOUCHSCREEN_ADS7846)
1185 { 1180 {
1186 .modalias = "ads7846", 1181 .modalias = "ads7846",
1187 .max_speed_hz = 2000000, /* max spi clock (SCK) speed in HZ */ 1182 .max_speed_hz = 2000000, /* max spi clock (SCK) speed in HZ */
@@ -1192,8 +1187,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1192 .mode = SPI_MODE_0, 1187 .mode = SPI_MODE_0,
1193 }, 1188 },
1194#endif 1189#endif
1195#if defined(CONFIG_AD7476) \ 1190#if IS_ENABLED(CONFIG_AD7476)
1196 || defined(CONFIG_AD7476_MODULE)
1197 { 1191 {
1198 .modalias = "ad7476", /* Name of spi_driver for this device */ 1192 .modalias = "ad7476", /* Name of spi_driver for this device */
1199 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 1193 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
@@ -1204,8 +1198,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1204 .mode = SPI_MODE_3, 1198 .mode = SPI_MODE_3,
1205 }, 1199 },
1206#endif 1200#endif
1207#if defined(CONFIG_ADE7753) \ 1201#if IS_ENABLED(CONFIG_ADE7753)
1208 || defined(CONFIG_ADE7753_MODULE)
1209 { 1202 {
1210 .modalias = "ade7753", 1203 .modalias = "ade7753",
1211 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ 1204 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
@@ -1215,8 +1208,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1215 .mode = SPI_MODE_1, 1208 .mode = SPI_MODE_1,
1216 }, 1209 },
1217#endif 1210#endif
1218#if defined(CONFIG_ADE7754) \ 1211#if IS_ENABLED(CONFIG_ADE7754)
1219 || defined(CONFIG_ADE7754_MODULE)
1220 { 1212 {
1221 .modalias = "ade7754", 1213 .modalias = "ade7754",
1222 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ 1214 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
@@ -1226,8 +1218,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1226 .mode = SPI_MODE_1, 1218 .mode = SPI_MODE_1,
1227 }, 1219 },
1228#endif 1220#endif
1229#if defined(CONFIG_ADE7758) \ 1221#if IS_ENABLED(CONFIG_ADE7758)
1230 || defined(CONFIG_ADE7758_MODULE)
1231 { 1222 {
1232 .modalias = "ade7758", 1223 .modalias = "ade7758",
1233 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ 1224 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
@@ -1237,8 +1228,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1237 .mode = SPI_MODE_1, 1228 .mode = SPI_MODE_1,
1238 }, 1229 },
1239#endif 1230#endif
1240#if defined(CONFIG_ADE7759) \ 1231#if IS_ENABLED(CONFIG_ADE7759)
1241 || defined(CONFIG_ADE7759_MODULE)
1242 { 1232 {
1243 .modalias = "ade7759", 1233 .modalias = "ade7759",
1244 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ 1234 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
@@ -1248,8 +1238,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1248 .mode = SPI_MODE_1, 1238 .mode = SPI_MODE_1,
1249 }, 1239 },
1250#endif 1240#endif
1251#if defined(CONFIG_ADE7854_SPI) \ 1241#if IS_ENABLED(CONFIG_ADE7854_SPI)
1252 || defined(CONFIG_ADE7854_SPI_MODULE)
1253 { 1242 {
1254 .modalias = "ade7854", 1243 .modalias = "ade7854",
1255 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ 1244 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
@@ -1259,8 +1248,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1259 .mode = SPI_MODE_3, 1248 .mode = SPI_MODE_3,
1260 }, 1249 },
1261#endif 1250#endif
1262#if defined(CONFIG_ADIS16060) \ 1251#if IS_ENABLED(CONFIG_ADIS16060)
1263 || defined(CONFIG_ADIS16060_MODULE)
1264 { 1252 {
1265 .modalias = "adis16060_r", 1253 .modalias = "adis16060_r",
1266 .max_speed_hz = 2900000, /* max spi clock (SCK) speed in HZ */ 1254 .max_speed_hz = 2900000, /* max spi clock (SCK) speed in HZ */
@@ -1278,8 +1266,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1278 .mode = SPI_MODE_1, 1266 .mode = SPI_MODE_1,
1279 }, 1267 },
1280#endif 1268#endif
1281#if defined(CONFIG_ADIS16130) \ 1269#if IS_ENABLED(CONFIG_ADIS16130)
1282 || defined(CONFIG_ADIS16130_MODULE)
1283 { 1270 {
1284 .modalias = "adis16130", 1271 .modalias = "adis16130",
1285 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ 1272 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
@@ -1289,8 +1276,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1289 .mode = SPI_MODE_3, 1276 .mode = SPI_MODE_3,
1290 }, 1277 },
1291#endif 1278#endif
1292#if defined(CONFIG_ADIS16201) \ 1279#if IS_ENABLED(CONFIG_ADIS16201)
1293 || defined(CONFIG_ADIS16201_MODULE)
1294 { 1280 {
1295 .modalias = "adis16201", 1281 .modalias = "adis16201",
1296 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ 1282 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
@@ -1301,8 +1287,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1301 .irq = IRQ_PF4, 1287 .irq = IRQ_PF4,
1302 }, 1288 },
1303#endif 1289#endif
1304#if defined(CONFIG_ADIS16203) \ 1290#if IS_ENABLED(CONFIG_ADIS16203)
1305 || defined(CONFIG_ADIS16203_MODULE)
1306 { 1291 {
1307 .modalias = "adis16203", 1292 .modalias = "adis16203",
1308 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ 1293 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
@@ -1313,8 +1298,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1313 .irq = IRQ_PF4, 1298 .irq = IRQ_PF4,
1314 }, 1299 },
1315#endif 1300#endif
1316#if defined(CONFIG_ADIS16204) \ 1301#if IS_ENABLED(CONFIG_ADIS16204)
1317 || defined(CONFIG_ADIS16204_MODULE)
1318 { 1302 {
1319 .modalias = "adis16204", 1303 .modalias = "adis16204",
1320 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ 1304 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
@@ -1325,8 +1309,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1325 .irq = IRQ_PF4, 1309 .irq = IRQ_PF4,
1326 }, 1310 },
1327#endif 1311#endif
1328#if defined(CONFIG_ADIS16209) \ 1312#if IS_ENABLED(CONFIG_ADIS16209)
1329 || defined(CONFIG_ADIS16209_MODULE)
1330 { 1313 {
1331 .modalias = "adis16209", 1314 .modalias = "adis16209",
1332 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ 1315 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
@@ -1337,8 +1320,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1337 .irq = IRQ_PF4, 1320 .irq = IRQ_PF4,
1338 }, 1321 },
1339#endif 1322#endif
1340#if defined(CONFIG_ADIS16220) \ 1323#if IS_ENABLED(CONFIG_ADIS16220)
1341 || defined(CONFIG_ADIS16220_MODULE)
1342 { 1324 {
1343 .modalias = "adis16220", 1325 .modalias = "adis16220",
1344 .max_speed_hz = 2000000, /* max spi clock (SCK) speed in HZ */ 1326 .max_speed_hz = 2000000, /* max spi clock (SCK) speed in HZ */
@@ -1349,8 +1331,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1349 .irq = IRQ_PF4, 1331 .irq = IRQ_PF4,
1350 }, 1332 },
1351#endif 1333#endif
1352#if defined(CONFIG_ADIS16240) \ 1334#if IS_ENABLED(CONFIG_ADIS16240)
1353 || defined(CONFIG_ADIS16240_MODULE)
1354 { 1335 {
1355 .modalias = "adis16240", 1336 .modalias = "adis16240",
1356 .max_speed_hz = 1500000, /* max spi clock (SCK) speed in HZ */ 1337 .max_speed_hz = 1500000, /* max spi clock (SCK) speed in HZ */
@@ -1361,8 +1342,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1361 .irq = IRQ_PF4, 1342 .irq = IRQ_PF4,
1362 }, 1343 },
1363#endif 1344#endif
1364#if defined(CONFIG_ADIS16260) \ 1345#if IS_ENABLED(CONFIG_ADIS16260)
1365 || defined(CONFIG_ADIS16260_MODULE)
1366 { 1346 {
1367 .modalias = "adis16260", 1347 .modalias = "adis16260",
1368 .max_speed_hz = 1500000, /* max spi clock (SCK) speed in HZ */ 1348 .max_speed_hz = 1500000, /* max spi clock (SCK) speed in HZ */
@@ -1373,8 +1353,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1373 .irq = IRQ_PF4, 1353 .irq = IRQ_PF4,
1374 }, 1354 },
1375#endif 1355#endif
1376#if defined(CONFIG_ADIS16261) \ 1356#if IS_ENABLED(CONFIG_ADIS16261)
1377 || defined(CONFIG_ADIS16261_MODULE)
1378 { 1357 {
1379 .modalias = "adis16261", 1358 .modalias = "adis16261",
1380 .max_speed_hz = 2500000, /* max spi clock (SCK) speed in HZ */ 1359 .max_speed_hz = 2500000, /* max spi clock (SCK) speed in HZ */
@@ -1384,8 +1363,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1384 .mode = SPI_MODE_3, 1363 .mode = SPI_MODE_3,
1385 }, 1364 },
1386#endif 1365#endif
1387#if defined(CONFIG_ADIS16300) \ 1366#if IS_ENABLED(CONFIG_ADIS16300)
1388 || defined(CONFIG_ADIS16300_MODULE)
1389 { 1367 {
1390 .modalias = "adis16300", 1368 .modalias = "adis16300",
1391 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ 1369 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
@@ -1396,8 +1374,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1396 .irq = IRQ_PF4, 1374 .irq = IRQ_PF4,
1397 }, 1375 },
1398#endif 1376#endif
1399#if defined(CONFIG_ADIS16350) \ 1377#if IS_ENABLED(CONFIG_ADIS16350)
1400 || defined(CONFIG_ADIS16350_MODULE)
1401 { 1378 {
1402 .modalias = "adis16364", 1379 .modalias = "adis16364",
1403 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ 1380 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
@@ -1408,8 +1385,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1408 .irq = IRQ_PF4, 1385 .irq = IRQ_PF4,
1409 }, 1386 },
1410#endif 1387#endif
1411#if defined(CONFIG_ADIS16400) \ 1388#if IS_ENABLED(CONFIG_ADIS16400)
1412 || defined(CONFIG_ADIS16400_MODULE)
1413 { 1389 {
1414 .modalias = "adis16400", 1390 .modalias = "adis16400",
1415 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ 1391 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
@@ -1421,7 +1397,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1421#endif 1397#endif
1422}; 1398};
1423 1399
1424#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 1400#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
1425/* SPI controller data */ 1401/* SPI controller data */
1426static struct bfin5xx_spi_master bfin_spi0_info = { 1402static struct bfin5xx_spi_master bfin_spi0_info = {
1427 .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS, 1403 .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS,
@@ -1459,7 +1435,7 @@ static struct platform_device bfin_spi0_device = {
1459}; 1435};
1460#endif /* spi master and devices */ 1436#endif /* spi master and devices */
1461 1437
1462#if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE) 1438#if IS_ENABLED(CONFIG_SPI_BFIN_SPORT)
1463 1439
1464/* SPORT SPI controller data */ 1440/* SPORT SPI controller data */
1465static struct bfin5xx_spi_master bfin_sport_spi0_info = { 1441static struct bfin5xx_spi_master bfin_sport_spi0_info = {
@@ -1524,13 +1500,13 @@ static struct platform_device bfin_sport_spi1_device = {
1524 1500
1525#endif /* sport spi master and devices */ 1501#endif /* sport spi master and devices */
1526 1502
1527#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) 1503#if IS_ENABLED(CONFIG_FB_BF537_LQ035)
1528static struct platform_device bfin_fb_device = { 1504static struct platform_device bfin_fb_device = {
1529 .name = "bf537_lq035", 1505 .name = "bf537_lq035",
1530}; 1506};
1531#endif 1507#endif
1532 1508
1533#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 1509#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)
1534#include <asm/bfin-lq035q1.h> 1510#include <asm/bfin-lq035q1.h>
1535 1511
1536static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = { 1512static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
@@ -1559,8 +1535,7 @@ static struct platform_device bfin_lq035q1_device = {
1559}; 1535};
1560#endif 1536#endif
1561 1537
1562#if defined(CONFIG_VIDEO_BLACKFIN_CAPTURE) \ 1538#if IS_ENABLED(CONFIG_VIDEO_BLACKFIN_CAPTURE)
1563 || defined(CONFIG_VIDEO_BLACKFIN_CAPTURE_MODULE)
1564#include <linux/videodev2.h> 1539#include <linux/videodev2.h>
1565#include <media/blackfin/bfin_capture.h> 1540#include <media/blackfin/bfin_capture.h>
1566#include <media/blackfin/ppi.h> 1541#include <media/blackfin/ppi.h>
@@ -1580,8 +1555,7 @@ static const struct ppi_info ppi_info = {
1580 .pin_req = ppi_req, 1555 .pin_req = ppi_req,
1581}; 1556};
1582 1557
1583#if defined(CONFIG_VIDEO_VS6624) \ 1558#if IS_ENABLED(CONFIG_VIDEO_VS6624)
1584 || defined(CONFIG_VIDEO_VS6624_MODULE)
1585static struct v4l2_input vs6624_inputs[] = { 1559static struct v4l2_input vs6624_inputs[] = {
1586 { 1560 {
1587 .index = 0, 1561 .index = 0,
@@ -1624,7 +1598,7 @@ static struct platform_device bfin_capture_device = {
1624}; 1598};
1625#endif 1599#endif
1626 1600
1627#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 1601#if IS_ENABLED(CONFIG_SERIAL_BFIN)
1628#ifdef CONFIG_SERIAL_BFIN_UART0 1602#ifdef CONFIG_SERIAL_BFIN_UART0
1629static struct resource bfin_uart0_resources[] = { 1603static struct resource bfin_uart0_resources[] = {
1630 { 1604 {
@@ -1735,7 +1709,7 @@ static struct platform_device bfin_uart1_device = {
1735#endif 1709#endif
1736#endif 1710#endif
1737 1711
1738#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 1712#if IS_ENABLED(CONFIG_BFIN_SIR)
1739#ifdef CONFIG_BFIN_SIR0 1713#ifdef CONFIG_BFIN_SIR0
1740static struct resource bfin_sir0_resources[] = { 1714static struct resource bfin_sir0_resources[] = {
1741 { 1715 {
@@ -1790,7 +1764,7 @@ static struct platform_device bfin_sir1_device = {
1790#endif 1764#endif
1791#endif 1765#endif
1792 1766
1793#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 1767#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
1794static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; 1768static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
1795 1769
1796static struct resource bfin_twi0_resource[] = { 1770static struct resource bfin_twi0_resource[] = {
@@ -1817,7 +1791,7 @@ static struct platform_device i2c_bfin_twi_device = {
1817}; 1791};
1818#endif 1792#endif
1819 1793
1820#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE) 1794#if IS_ENABLED(CONFIG_KEYBOARD_ADP5588)
1821static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = { 1795static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = {
1822 [0] = KEY_GRAVE, 1796 [0] = KEY_GRAVE,
1823 [1] = KEY_1, 1797 [1] = KEY_1,
@@ -1902,7 +1876,7 @@ static struct adp5588_kpad_platform_data adp5588_kpad_data = {
1902}; 1876};
1903#endif 1877#endif
1904 1878
1905#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE) 1879#if IS_ENABLED(CONFIG_PMIC_ADP5520)
1906#include <linux/mfd/adp5520.h> 1880#include <linux/mfd/adp5520.h>
1907 1881
1908 /* 1882 /*
@@ -2013,14 +1987,14 @@ static struct adp5520_platform_data adp5520_pdev_data = {
2013 1987
2014#endif 1988#endif
2015 1989
2016#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE) 1990#if IS_ENABLED(CONFIG_GPIO_ADP5588)
2017static struct adp5588_gpio_platform_data adp5588_gpio_data = { 1991static struct adp5588_gpio_platform_data adp5588_gpio_data = {
2018 .gpio_start = 50, 1992 .gpio_start = 50,
2019 .pullup_dis_mask = 0, 1993 .pullup_dis_mask = 0,
2020}; 1994};
2021#endif 1995#endif
2022 1996
2023#if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE) 1997#if IS_ENABLED(CONFIG_BACKLIGHT_ADP8870)
2024#include <linux/i2c/adp8870.h> 1998#include <linux/i2c/adp8870.h>
2025static struct led_info adp8870_leds[] = { 1999static struct led_info adp8870_leds[] = {
2026 { 2000 {
@@ -2072,7 +2046,7 @@ static struct adp8870_backlight_platform_data adp8870_pdata = {
2072}; 2046};
2073#endif 2047#endif
2074 2048
2075#if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE) 2049#if IS_ENABLED(CONFIG_BACKLIGHT_ADP8860)
2076#include <linux/i2c/adp8860.h> 2050#include <linux/i2c/adp8860.h>
2077static struct led_info adp8860_leds[] = { 2051static struct led_info adp8860_leds[] = {
2078 { 2052 {
@@ -2114,7 +2088,7 @@ static struct adp8860_backlight_platform_data adp8860_pdata = {
2114}; 2088};
2115#endif 2089#endif
2116 2090
2117#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE) 2091#if IS_ENABLED(CONFIG_REGULATOR_AD5398)
2118static struct regulator_consumer_supply ad5398_consumer = { 2092static struct regulator_consumer_supply ad5398_consumer = {
2119 .supply = "current", 2093 .supply = "current",
2120}; 2094};
@@ -2129,8 +2103,7 @@ static struct regulator_init_data ad5398_regulator_data = {
2129 .consumer_supplies = &ad5398_consumer, 2103 .consumer_supplies = &ad5398_consumer,
2130}; 2104};
2131 2105
2132#if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \ 2106#if IS_ENABLED(CONFIG_REGULATOR_VIRTUAL_CONSUMER)
2133 defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
2134static struct platform_device ad5398_virt_consumer_device = { 2107static struct platform_device ad5398_virt_consumer_device = {
2135 .name = "reg-virt-consumer", 2108 .name = "reg-virt-consumer",
2136 .id = 0, 2109 .id = 0,
@@ -2139,8 +2112,7 @@ static struct platform_device ad5398_virt_consumer_device = {
2139 }, 2112 },
2140}; 2113};
2141#endif 2114#endif
2142#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \ 2115#if IS_ENABLED(CONFIG_REGULATOR_USERSPACE_CONSUMER)
2143 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2144static struct regulator_bulk_data ad5398_bulk_data = { 2116static struct regulator_bulk_data ad5398_bulk_data = {
2145 .supply = "current", 2117 .supply = "current",
2146}; 2118};
@@ -2161,14 +2133,14 @@ static struct platform_device ad5398_userspace_consumer_device = {
2161#endif 2133#endif
2162#endif 2134#endif
2163 2135
2164#if defined(CONFIG_ADT7410) || defined(CONFIG_ADT7410_MODULE) 2136#if IS_ENABLED(CONFIG_ADT7410)
2165/* INT bound temperature alarm event. line 1 */ 2137/* INT bound temperature alarm event. line 1 */
2166static unsigned long adt7410_platform_data[2] = { 2138static unsigned long adt7410_platform_data[2] = {
2167 IRQ_PG4, IRQF_TRIGGER_LOW, 2139 IRQ_PG4, IRQF_TRIGGER_LOW,
2168}; 2140};
2169#endif 2141#endif
2170 2142
2171#if defined(CONFIG_ADT7316_I2C) || defined(CONFIG_ADT7316_I2C_MODULE) 2143#if IS_ENABLED(CONFIG_ADT7316_I2C)
2172/* INT bound temperature alarm event. line 1 */ 2144/* INT bound temperature alarm event. line 1 */
2173static unsigned long adt7316_i2c_data[2] = { 2145static unsigned long adt7316_i2c_data[2] = {
2174 IRQF_TRIGGER_LOW, /* interrupt flags */ 2146 IRQF_TRIGGER_LOW, /* interrupt flags */
@@ -2183,13 +2155,13 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
2183 }, 2155 },
2184#endif 2156#endif
2185 2157
2186#if defined(CONFIG_SND_SOC_ADAV80X) || defined(CONFIG_SND_SOC_ADAV80X_MODULE) 2158#if IS_ENABLED(CONFIG_SND_SOC_ADAV80X)
2187 { 2159 {
2188 I2C_BOARD_INFO("adav803", 0x10), 2160 I2C_BOARD_INFO("adav803", 0x10),
2189 }, 2161 },
2190#endif 2162#endif
2191 2163
2192#if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE) 2164#if IS_ENABLED(CONFIG_INPUT_AD714X_I2C)
2193 { 2165 {
2194 I2C_BOARD_INFO("ad7142_captouch", 0x2C), 2166 I2C_BOARD_INFO("ad7142_captouch", 0x2C),
2195 .irq = IRQ_PG5, 2167 .irq = IRQ_PG5,
@@ -2197,39 +2169,39 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
2197 }, 2169 },
2198#endif 2170#endif
2199 2171
2200#if defined(CONFIG_AD7150) || defined(CONFIG_AD7150_MODULE) 2172#if IS_ENABLED(CONFIG_AD7150)
2201 { 2173 {
2202 I2C_BOARD_INFO("ad7150", 0x48), 2174 I2C_BOARD_INFO("ad7150", 0x48),
2203 .irq = IRQ_PG5, /* fixme: use real interrupt number */ 2175 .irq = IRQ_PG5, /* fixme: use real interrupt number */
2204 }, 2176 },
2205#endif 2177#endif
2206 2178
2207#if defined(CONFIG_AD7152) || defined(CONFIG_AD7152_MODULE) 2179#if IS_ENABLED(CONFIG_AD7152)
2208 { 2180 {
2209 I2C_BOARD_INFO("ad7152", 0x48), 2181 I2C_BOARD_INFO("ad7152", 0x48),
2210 }, 2182 },
2211#endif 2183#endif
2212 2184
2213#if defined(CONFIG_AD774X) || defined(CONFIG_AD774X_MODULE) 2185#if IS_ENABLED(CONFIG_AD774X)
2214 { 2186 {
2215 I2C_BOARD_INFO("ad774x", 0x48), 2187 I2C_BOARD_INFO("ad774x", 0x48),
2216 }, 2188 },
2217#endif 2189#endif
2218 2190
2219#if defined(CONFIG_ADE7854_I2C) || defined(CONFIG_ADE7854_I2C_MODULE) 2191#if IS_ENABLED(CONFIG_ADE7854_I2C)
2220 { 2192 {
2221 I2C_BOARD_INFO("ade7854", 0x38), 2193 I2C_BOARD_INFO("ade7854", 0x38),
2222 }, 2194 },
2223#endif 2195#endif
2224 2196
2225#if defined(CONFIG_ADT75) || defined(CONFIG_ADT75_MODULE) 2197#if IS_ENABLED(CONFIG_SENSORS_LM75)
2226 { 2198 {
2227 I2C_BOARD_INFO("adt75", 0x9), 2199 I2C_BOARD_INFO("adt75", 0x9),
2228 .irq = IRQ_PG5, 2200 .irq = IRQ_PG5,
2229 }, 2201 },
2230#endif 2202#endif
2231 2203
2232#if defined(CONFIG_ADT7410) || defined(CONFIG_ADT7410_MODULE) 2204#if IS_ENABLED(CONFIG_ADT7410)
2233 { 2205 {
2234 I2C_BOARD_INFO("adt7410", 0x48), 2206 I2C_BOARD_INFO("adt7410", 0x48),
2235 /* CT critical temperature event. line 0 */ 2207 /* CT critical temperature event. line 0 */
@@ -2238,14 +2210,14 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
2238 }, 2210 },
2239#endif 2211#endif
2240 2212
2241#if defined(CONFIG_AD7291) || defined(CONFIG_AD7291_MODULE) 2213#if IS_ENABLED(CONFIG_AD7291)
2242 { 2214 {
2243 I2C_BOARD_INFO("ad7291", 0x20), 2215 I2C_BOARD_INFO("ad7291", 0x20),
2244 .irq = IRQ_PG5, 2216 .irq = IRQ_PG5,
2245 }, 2217 },
2246#endif 2218#endif
2247 2219
2248#if defined(CONFIG_ADT7316_I2C) || defined(CONFIG_ADT7316_I2C_MODULE) 2220#if IS_ENABLED(CONFIG_ADT7316_I2C)
2249 { 2221 {
2250 I2C_BOARD_INFO("adt7316", 0x48), 2222 I2C_BOARD_INFO("adt7316", 0x48),
2251 .irq = IRQ_PG6, 2223 .irq = IRQ_PG6,
@@ -2253,128 +2225,128 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
2253 }, 2225 },
2254#endif 2226#endif
2255 2227
2256#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) 2228#if IS_ENABLED(CONFIG_BFIN_TWI_LCD)
2257 { 2229 {
2258 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 2230 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
2259 }, 2231 },
2260#endif 2232#endif
2261#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE) 2233#if IS_ENABLED(CONFIG_INPUT_PCF8574)
2262 { 2234 {
2263 I2C_BOARD_INFO("pcf8574_keypad", 0x27), 2235 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
2264 .irq = IRQ_PG6, 2236 .irq = IRQ_PG6,
2265 }, 2237 },
2266#endif 2238#endif
2267#if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE) 2239#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7879_I2C)
2268 { 2240 {
2269 I2C_BOARD_INFO("ad7879", 0x2F), 2241 I2C_BOARD_INFO("ad7879", 0x2F),
2270 .irq = IRQ_PG5, 2242 .irq = IRQ_PG5,
2271 .platform_data = (void *)&bfin_ad7879_ts_info, 2243 .platform_data = (void *)&bfin_ad7879_ts_info,
2272 }, 2244 },
2273#endif 2245#endif
2274#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE) 2246#if IS_ENABLED(CONFIG_KEYBOARD_ADP5588)
2275 { 2247 {
2276 I2C_BOARD_INFO("adp5588-keys", 0x34), 2248 I2C_BOARD_INFO("adp5588-keys", 0x34),
2277 .irq = IRQ_PG0, 2249 .irq = IRQ_PG0,
2278 .platform_data = (void *)&adp5588_kpad_data, 2250 .platform_data = (void *)&adp5588_kpad_data,
2279 }, 2251 },
2280#endif 2252#endif
2281#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE) 2253#if IS_ENABLED(CONFIG_PMIC_ADP5520)
2282 { 2254 {
2283 I2C_BOARD_INFO("pmic-adp5520", 0x32), 2255 I2C_BOARD_INFO("pmic-adp5520", 0x32),
2284 .irq = IRQ_PG0, 2256 .irq = IRQ_PG0,
2285 .platform_data = (void *)&adp5520_pdev_data, 2257 .platform_data = (void *)&adp5520_pdev_data,
2286 }, 2258 },
2287#endif 2259#endif
2288#if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE) 2260#if IS_ENABLED(CONFIG_INPUT_ADXL34X_I2C)
2289 { 2261 {
2290 I2C_BOARD_INFO("adxl34x", 0x53), 2262 I2C_BOARD_INFO("adxl34x", 0x53),
2291 .irq = IRQ_PG3, 2263 .irq = IRQ_PG3,
2292 .platform_data = (void *)&adxl34x_info, 2264 .platform_data = (void *)&adxl34x_info,
2293 }, 2265 },
2294#endif 2266#endif
2295#if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE) 2267#if IS_ENABLED(CONFIG_GPIO_ADP5588)
2296 { 2268 {
2297 I2C_BOARD_INFO("adp5588-gpio", 0x34), 2269 I2C_BOARD_INFO("adp5588-gpio", 0x34),
2298 .platform_data = (void *)&adp5588_gpio_data, 2270 .platform_data = (void *)&adp5588_gpio_data,
2299 }, 2271 },
2300#endif 2272#endif
2301#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) 2273#if IS_ENABLED(CONFIG_FB_BFIN_7393)
2302 { 2274 {
2303 I2C_BOARD_INFO("bfin-adv7393", 0x2B), 2275 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
2304 }, 2276 },
2305#endif 2277#endif
2306#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) 2278#if IS_ENABLED(CONFIG_FB_BF537_LQ035)
2307 { 2279 {
2308 I2C_BOARD_INFO("bf537-lq035-ad5280", 0x2F), 2280 I2C_BOARD_INFO("bf537-lq035-ad5280", 0x2F),
2309 }, 2281 },
2310#endif 2282#endif
2311#if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE) 2283#if IS_ENABLED(CONFIG_BACKLIGHT_ADP8870)
2312 { 2284 {
2313 I2C_BOARD_INFO("adp8870", 0x2B), 2285 I2C_BOARD_INFO("adp8870", 0x2B),
2314 .platform_data = (void *)&adp8870_pdata, 2286 .platform_data = (void *)&adp8870_pdata,
2315 }, 2287 },
2316#endif 2288#endif
2317#if defined(CONFIG_SND_SOC_ADAU1371) || defined(CONFIG_SND_SOC_ADAU1371_MODULE) 2289#if IS_ENABLED(CONFIG_SND_SOC_ADAU1371)
2318 { 2290 {
2319 I2C_BOARD_INFO("adau1371", 0x1A), 2291 I2C_BOARD_INFO("adau1371", 0x1A),
2320 }, 2292 },
2321#endif 2293#endif
2322#if defined(CONFIG_SND_SOC_ADAU1761) || defined(CONFIG_SND_SOC_ADAU1761_MODULE) 2294#if IS_ENABLED(CONFIG_SND_SOC_ADAU1761)
2323 { 2295 {
2324 I2C_BOARD_INFO("adau1761", 0x38), 2296 I2C_BOARD_INFO("adau1761", 0x38),
2325 }, 2297 },
2326#endif 2298#endif
2327#if defined(CONFIG_SND_SOC_ADAU1361) || defined(CONFIG_SND_SOC_ADAU1361_MODULE) 2299#if IS_ENABLED(CONFIG_SND_SOC_ADAU1361)
2328 { 2300 {
2329 I2C_BOARD_INFO("adau1361", 0x38), 2301 I2C_BOARD_INFO("adau1361", 0x38),
2330 }, 2302 },
2331#endif 2303#endif
2332#if defined(CONFIG_SND_SOC_ADAU1701) || defined(CONFIG_SND_SOC_ADAU1701_MODULE) 2304#if IS_ENABLED(CONFIG_SND_SOC_ADAU1701)
2333 { 2305 {
2334 I2C_BOARD_INFO("adau1701", 0x34), 2306 I2C_BOARD_INFO("adau1701", 0x34),
2335 }, 2307 },
2336#endif 2308#endif
2337#if defined(CONFIG_AD525X_DPOT) || defined(CONFIG_AD525X_DPOT_MODULE) 2309#if IS_ENABLED(CONFIG_AD525X_DPOT)
2338 { 2310 {
2339 I2C_BOARD_INFO("ad5258", 0x18), 2311 I2C_BOARD_INFO("ad5258", 0x18),
2340 }, 2312 },
2341#endif 2313#endif
2342#if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE) 2314#if IS_ENABLED(CONFIG_SND_SOC_SSM2602)
2343 { 2315 {
2344 I2C_BOARD_INFO("ssm2602", 0x1b), 2316 I2C_BOARD_INFO("ssm2602", 0x1b),
2345 }, 2317 },
2346#endif 2318#endif
2347#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE) 2319#if IS_ENABLED(CONFIG_REGULATOR_AD5398)
2348 { 2320 {
2349 I2C_BOARD_INFO("ad5398", 0xC), 2321 I2C_BOARD_INFO("ad5398", 0xC),
2350 .platform_data = (void *)&ad5398_regulator_data, 2322 .platform_data = (void *)&ad5398_regulator_data,
2351 }, 2323 },
2352#endif 2324#endif
2353#if defined(CONFIG_BACKLIGHT_ADP8860) || defined(CONFIG_BACKLIGHT_ADP8860_MODULE) 2325#if IS_ENABLED(CONFIG_BACKLIGHT_ADP8860)
2354 { 2326 {
2355 I2C_BOARD_INFO("adp8860", 0x2A), 2327 I2C_BOARD_INFO("adp8860", 0x2A),
2356 .platform_data = (void *)&adp8860_pdata, 2328 .platform_data = (void *)&adp8860_pdata,
2357 }, 2329 },
2358#endif 2330#endif
2359#if defined(CONFIG_SND_SOC_ADAU1373) || defined(CONFIG_SND_SOC_ADAU1373_MODULE) 2331#if IS_ENABLED(CONFIG_SND_SOC_ADAU1373)
2360 { 2332 {
2361 I2C_BOARD_INFO("adau1373", 0x1A), 2333 I2C_BOARD_INFO("adau1373", 0x1A),
2362 }, 2334 },
2363#endif 2335#endif
2364#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) 2336#if IS_ENABLED(CONFIG_BFIN_TWI_LCD)
2365 { 2337 {
2366 I2C_BOARD_INFO("ad5252", 0x2e), 2338 I2C_BOARD_INFO("ad5252", 0x2e),
2367 }, 2339 },
2368#endif 2340#endif
2369}; 2341};
2370#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) \ 2342#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT) \
2371|| defined(CONFIG_BFIN_SPORT) || defined(CONFIG_BFIN_SPORT_MODULE) 2343|| IS_ENABLED(CONFIG_BFIN_SPORT)
2372unsigned short bfin_sport0_peripherals[] = { 2344unsigned short bfin_sport0_peripherals[] = {
2373 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, 2345 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
2374 P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0 2346 P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0
2375}; 2347};
2376#endif 2348#endif
2377#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 2349#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
2378#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 2350#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2379static struct resource bfin_sport0_uart_resources[] = { 2351static struct resource bfin_sport0_uart_resources[] = {
2380 { 2352 {
@@ -2439,7 +2411,7 @@ static struct platform_device bfin_sport1_uart_device = {
2439}; 2411};
2440#endif 2412#endif
2441#endif 2413#endif
2442#if defined(CONFIG_BFIN_SPORT) || defined(CONFIG_BFIN_SPORT_MODULE) 2414#if IS_ENABLED(CONFIG_BFIN_SPORT)
2443static struct resource bfin_sport0_resources[] = { 2415static struct resource bfin_sport0_resources[] = {
2444 { 2416 {
2445 .start = SPORT0_TCR1, 2417 .start = SPORT0_TCR1,
@@ -2482,7 +2454,7 @@ static struct platform_device bfin_sport0_device = {
2482 }, 2454 },
2483}; 2455};
2484#endif 2456#endif
2485#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 2457#if IS_ENABLED(CONFIG_PATA_PLATFORM)
2486#define CF_IDE_NAND_CARD_USE_HDD_INTERFACE 2458#define CF_IDE_NAND_CARD_USE_HDD_INTERFACE
2487/* #define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE */ 2459/* #define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE */
2488 2460
@@ -2569,8 +2541,8 @@ static struct platform_device bfin_dpmc = {
2569 }, 2541 },
2570}; 2542};
2571 2543
2572#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \ 2544#if IS_ENABLED(CONFIG_SND_BF5XX_I2S) || \
2573 defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 2545 IS_ENABLED(CONFIG_SND_BF5XX_AC97)
2574 2546
2575#define SPORT_REQ(x) \ 2547#define SPORT_REQ(x) \
2576 [x] = {P_SPORT##x##_TFS, P_SPORT##x##_DTPRI, P_SPORT##x##_TSCLK, \ 2548 [x] = {P_SPORT##x##_TFS, P_SPORT##x##_DTPRI, P_SPORT##x##_TSCLK, \
@@ -2620,22 +2592,21 @@ static struct resource bfin_snd_resources[][4] = {
2620}; 2592};
2621#endif 2593#endif
2622 2594
2623#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 2595#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
2624static struct platform_device bfin_i2s_pcm = { 2596static struct platform_device bfin_i2s_pcm = {
2625 .name = "bfin-i2s-pcm-audio", 2597 .name = "bfin-i2s-pcm-audio",
2626 .id = -1, 2598 .id = -1,
2627}; 2599};
2628#endif 2600#endif
2629 2601
2630#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 2602#if IS_ENABLED(CONFIG_SND_BF5XX_AC97)
2631static struct platform_device bfin_ac97_pcm = { 2603static struct platform_device bfin_ac97_pcm = {
2632 .name = "bfin-ac97-pcm-audio", 2604 .name = "bfin-ac97-pcm-audio",
2633 .id = -1, 2605 .id = -1,
2634}; 2606};
2635#endif 2607#endif
2636 2608
2637#if defined(CONFIG_SND_BF5XX_SOC_AD1836) \ 2609#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836)
2638 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
2639static const char * const ad1836_link[] = { 2610static const char * const ad1836_link[] = {
2640 "bfin-i2s.0", 2611 "bfin-i2s.0",
2641 "spi0.4", 2612 "spi0.4",
@@ -2649,8 +2620,7 @@ static struct platform_device bfin_ad1836_machine = {
2649}; 2620};
2650#endif 2621#endif
2651 2622
2652#if defined(CONFIG_SND_BF5XX_SOC_AD73311) || \ 2623#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD73311)
2653 defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE)
2654static const unsigned ad73311_gpio[] = { 2624static const unsigned ad73311_gpio[] = {
2655 GPIO_PF4, 2625 GPIO_PF4,
2656}; 2626};
@@ -2664,22 +2634,21 @@ static struct platform_device bfin_ad73311_machine = {
2664}; 2634};
2665#endif 2635#endif
2666 2636
2667#if defined(CONFIG_SND_SOC_AD73311) || defined(CONFIG_SND_SOC_AD73311_MODULE) 2637#if IS_ENABLED(CONFIG_SND_SOC_AD73311)
2668static struct platform_device bfin_ad73311_codec_device = { 2638static struct platform_device bfin_ad73311_codec_device = {
2669 .name = "ad73311", 2639 .name = "ad73311",
2670 .id = -1, 2640 .id = -1,
2671}; 2641};
2672#endif 2642#endif
2673 2643
2674#if defined(CONFIG_SND_SOC_BFIN_EVAL_ADAV80X) || \ 2644#if IS_ENABLED(CONFIG_SND_SOC_BFIN_EVAL_ADAV80X)
2675 defined(CONFIG_SND_SOC_BFIN_EVAL_ADAV80X_MODULE)
2676static struct platform_device bfin_eval_adav801_device = { 2645static struct platform_device bfin_eval_adav801_device = {
2677 .name = "bfin-eval-adav801", 2646 .name = "bfin-eval-adav801",
2678 .id = -1, 2647 .id = -1,
2679}; 2648};
2680#endif 2649#endif
2681 2650
2682#if defined(CONFIG_SND_BF5XX_SOC_I2S) || defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE) 2651#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_I2S)
2683static struct platform_device bfin_i2s = { 2652static struct platform_device bfin_i2s = {
2684 .name = "bfin-i2s", 2653 .name = "bfin-i2s",
2685 .id = CONFIG_SND_BF5XX_SPORT_NUM, 2654 .id = CONFIG_SND_BF5XX_SPORT_NUM,
@@ -2691,7 +2660,7 @@ static struct platform_device bfin_i2s = {
2691}; 2660};
2692#endif 2661#endif
2693 2662
2694#if defined(CONFIG_SND_BF5XX_SOC_AC97) || defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE) 2663#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AC97)
2695static struct platform_device bfin_ac97 = { 2664static struct platform_device bfin_ac97 = {
2696 .name = "bfin-ac97", 2665 .name = "bfin-ac97",
2697 .id = CONFIG_SND_BF5XX_SPORT_NUM, 2666 .id = CONFIG_SND_BF5XX_SPORT_NUM,
@@ -2703,7 +2672,7 @@ static struct platform_device bfin_ac97 = {
2703}; 2672};
2704#endif 2673#endif
2705 2674
2706#if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE) 2675#if IS_ENABLED(CONFIG_REGULATOR_FIXED_VOLTAGE)
2707#define REGULATOR_ADP122 "adp122" 2676#define REGULATOR_ADP122 "adp122"
2708#define REGULATOR_ADP122_UV 2500000 2677#define REGULATOR_ADP122_UV 2500000
2709 2678
@@ -2741,8 +2710,7 @@ static struct platform_device adp_switch_device = {
2741 }, 2710 },
2742}; 2711};
2743 2712
2744#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \ 2713#if IS_ENABLED(CONFIG_REGULATOR_USERSPACE_CONSUMER)
2745 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2746static struct regulator_bulk_data adp122_bulk_data = { 2714static struct regulator_bulk_data adp122_bulk_data = {
2747 .supply = REGULATOR_ADP122, 2715 .supply = REGULATOR_ADP122,
2748}; 2716};
@@ -2763,8 +2731,7 @@ static struct platform_device adp122_userspace_consumer_device = {
2763#endif 2731#endif
2764#endif 2732#endif
2765 2733
2766#if defined(CONFIG_IIO_GPIO_TRIGGER) || \ 2734#if IS_ENABLED(CONFIG_IIO_GPIO_TRIGGER)
2767 defined(CONFIG_IIO_GPIO_TRIGGER_MODULE)
2768 2735
2769static struct resource iio_gpio_trigger_resources[] = { 2736static struct resource iio_gpio_trigger_resources[] = {
2770 [0] = { 2737 [0] = {
@@ -2781,15 +2748,13 @@ static struct platform_device iio_gpio_trigger = {
2781}; 2748};
2782#endif 2749#endif
2783 2750
2784#if defined(CONFIG_SND_SOC_BFIN_EVAL_ADAU1373) || \ 2751#if IS_ENABLED(CONFIG_SND_SOC_BFIN_EVAL_ADAU1373)
2785 defined(CONFIG_SND_SOC_BFIN_EVAL_ADAU1373_MODULE)
2786static struct platform_device bf5xx_adau1373_device = { 2752static struct platform_device bf5xx_adau1373_device = {
2787 .name = "bfin-eval-adau1373", 2753 .name = "bfin-eval-adau1373",
2788}; 2754};
2789#endif 2755#endif
2790 2756
2791#if defined(CONFIG_SND_SOC_BFIN_EVAL_ADAU1701) || \ 2757#if IS_ENABLED(CONFIG_SND_SOC_BFIN_EVAL_ADAU1701)
2792 defined(CONFIG_SND_SOC_BFIN_EVAL_ADAU1701_MODULE)
2793static struct platform_device bf5xx_adau1701_device = { 2758static struct platform_device bf5xx_adau1701_device = {
2794 .name = "bfin-eval-adau1701", 2759 .name = "bfin-eval-adau1701",
2795}; 2760};
@@ -2798,73 +2763,72 @@ static struct platform_device bf5xx_adau1701_device = {
2798static struct platform_device *stamp_devices[] __initdata = { 2763static struct platform_device *stamp_devices[] __initdata = {
2799 2764
2800 &bfin_dpmc, 2765 &bfin_dpmc,
2801#if defined(CONFIG_BFIN_SPORT) || defined(CONFIG_BFIN_SPORT_MODULE) 2766#if IS_ENABLED(CONFIG_BFIN_SPORT)
2802 &bfin_sport0_device, 2767 &bfin_sport0_device,
2803#endif 2768#endif
2804#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) 2769#if IS_ENABLED(CONFIG_BFIN_CFPCMCIA)
2805 &bfin_pcmcia_cf_device, 2770 &bfin_pcmcia_cf_device,
2806#endif 2771#endif
2807 2772
2808#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 2773#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
2809 &rtc_device, 2774 &rtc_device,
2810#endif 2775#endif
2811 2776
2812#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) 2777#if IS_ENABLED(CONFIG_USB_SL811_HCD)
2813 &sl811_hcd_device, 2778 &sl811_hcd_device,
2814#endif 2779#endif
2815 2780
2816#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 2781#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
2817 &isp1362_hcd_device, 2782 &isp1362_hcd_device,
2818#endif 2783#endif
2819 2784
2820#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) 2785#if IS_ENABLED(CONFIG_USB_ISP1760_HCD)
2821 &bfin_isp1760_device, 2786 &bfin_isp1760_device,
2822#endif 2787#endif
2823 2788
2824#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 2789#if IS_ENABLED(CONFIG_SMC91X)
2825 &smc91x_device, 2790 &smc91x_device,
2826#endif 2791#endif
2827 2792
2828#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) 2793#if IS_ENABLED(CONFIG_DM9000)
2829 &dm9000_device, 2794 &dm9000_device,
2830#endif 2795#endif
2831 2796
2832#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE) 2797#if IS_ENABLED(CONFIG_CAN_BFIN)
2833 &bfin_can_device, 2798 &bfin_can_device,
2834#endif 2799#endif
2835 2800
2836#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 2801#if IS_ENABLED(CONFIG_BFIN_MAC)
2837 &bfin_mii_bus, 2802 &bfin_mii_bus,
2838 &bfin_mac_device, 2803 &bfin_mac_device,
2839#endif 2804#endif
2840 2805
2841#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 2806#if IS_ENABLED(CONFIG_USB_NET2272)
2842 &net2272_bfin_device, 2807 &net2272_bfin_device,
2843#endif 2808#endif
2844 2809
2845#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 2810#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
2846 &bfin_spi0_device, 2811 &bfin_spi0_device,
2847#endif 2812#endif
2848 2813
2849#if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE) 2814#if IS_ENABLED(CONFIG_SPI_BFIN_SPORT)
2850 &bfin_sport_spi0_device, 2815 &bfin_sport_spi0_device,
2851 &bfin_sport_spi1_device, 2816 &bfin_sport_spi1_device,
2852#endif 2817#endif
2853 2818
2854#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) 2819#if IS_ENABLED(CONFIG_FB_BF537_LQ035)
2855 &bfin_fb_device, 2820 &bfin_fb_device,
2856#endif 2821#endif
2857 2822
2858#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 2823#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)
2859 &bfin_lq035q1_device, 2824 &bfin_lq035q1_device,
2860#endif 2825#endif
2861 2826
2862#if defined(CONFIG_VIDEO_BLACKFIN_CAPTURE) \ 2827#if IS_ENABLED(CONFIG_VIDEO_BLACKFIN_CAPTURE)
2863 || defined(CONFIG_VIDEO_BLACKFIN_CAPTURE_MODULE)
2864 &bfin_capture_device, 2828 &bfin_capture_device,
2865#endif 2829#endif
2866 2830
2867#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 2831#if IS_ENABLED(CONFIG_SERIAL_BFIN)
2868#ifdef CONFIG_SERIAL_BFIN_UART0 2832#ifdef CONFIG_SERIAL_BFIN_UART0
2869 &bfin_uart0_device, 2833 &bfin_uart0_device,
2870#endif 2834#endif
@@ -2873,7 +2837,7 @@ static struct platform_device *stamp_devices[] __initdata = {
2873#endif 2837#endif
2874#endif 2838#endif
2875 2839
2876#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 2840#if IS_ENABLED(CONFIG_BFIN_SIR)
2877#ifdef CONFIG_BFIN_SIR0 2841#ifdef CONFIG_BFIN_SIR0
2878 &bfin_sir0_device, 2842 &bfin_sir0_device,
2879#endif 2843#endif
@@ -2882,11 +2846,11 @@ static struct platform_device *stamp_devices[] __initdata = {
2882#endif 2846#endif
2883#endif 2847#endif
2884 2848
2885#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 2849#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
2886 &i2c_bfin_twi_device, 2850 &i2c_bfin_twi_device,
2887#endif 2851#endif
2888 2852
2889#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 2853#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
2890#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 2854#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2891 &bfin_sport0_uart_device, 2855 &bfin_sport0_uart_device,
2892#endif 2856#endif
@@ -2895,95 +2859,86 @@ static struct platform_device *stamp_devices[] __initdata = {
2895#endif 2859#endif
2896#endif 2860#endif
2897 2861
2898#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 2862#if IS_ENABLED(CONFIG_PATA_PLATFORM)
2899 &bfin_pata_device, 2863 &bfin_pata_device,
2900#endif 2864#endif
2901 2865
2902#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 2866#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
2903 &bfin_device_gpiokeys, 2867 &bfin_device_gpiokeys,
2904#endif 2868#endif
2905 2869
2906#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE) 2870#if IS_ENABLED(CONFIG_MTD_NAND_PLATFORM)
2907 &bfin_async_nand_device, 2871 &bfin_async_nand_device,
2908#endif 2872#endif
2909 2873
2910#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 2874#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
2911 &stamp_flash_device, 2875 &stamp_flash_device,
2912#endif 2876#endif
2913 2877
2914#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 2878#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
2915 &bfin_i2s_pcm, 2879 &bfin_i2s_pcm,
2916#endif 2880#endif
2917 2881
2918#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 2882#if IS_ENABLED(CONFIG_SND_BF5XX_AC97)
2919 &bfin_ac97_pcm, 2883 &bfin_ac97_pcm,
2920#endif 2884#endif
2921 2885
2922#if defined(CONFIG_SND_BF5XX_SOC_AD1836) || \ 2886#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836)
2923 defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
2924 &bfin_ad1836_machine, 2887 &bfin_ad1836_machine,
2925#endif 2888#endif
2926 2889
2927#if defined(CONFIG_SND_BF5XX_SOC_AD73311) || \ 2890#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD73311)
2928 defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE)
2929 &bfin_ad73311_machine, 2891 &bfin_ad73311_machine,
2930#endif 2892#endif
2931 2893
2932#if defined(CONFIG_SND_SOC_AD73311) || defined(CONFIG_SND_SOC_AD73311_MODULE) 2894#if IS_ENABLED(CONFIG_SND_SOC_AD73311)
2933 &bfin_ad73311_codec_device, 2895 &bfin_ad73311_codec_device,
2934#endif 2896#endif
2935 2897
2936#if defined(CONFIG_SND_BF5XX_SOC_I2S) || defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE) 2898#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_I2S)
2937 &bfin_i2s, 2899 &bfin_i2s,
2938#endif 2900#endif
2939 2901
2940#if defined(CONFIG_SND_BF5XX_SOC_AC97) || defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE) 2902#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AC97)
2941 &bfin_ac97, 2903 &bfin_ac97,
2942#endif 2904#endif
2943 2905
2944#if defined(CONFIG_REGULATOR_AD5398) || defined(CONFIG_REGULATOR_AD5398_MODULE) 2906#if IS_ENABLED(CONFIG_REGULATOR_AD5398)
2945#if defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER) || \ 2907#if IS_ENABLED(CONFIG_REGULATOR_VIRTUAL_CONSUMER)
2946 defined(CONFIG_REGULATOR_VIRTUAL_CONSUMER_MODULE)
2947 &ad5398_virt_consumer_device, 2908 &ad5398_virt_consumer_device,
2948#endif 2909#endif
2949#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \ 2910#if IS_ENABLED(CONFIG_REGULATOR_USERSPACE_CONSUMER)
2950 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2951 &ad5398_userspace_consumer_device, 2911 &ad5398_userspace_consumer_device,
2952#endif 2912#endif
2953#endif 2913#endif
2954 2914
2955#if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE) 2915#if IS_ENABLED(CONFIG_REGULATOR_FIXED_VOLTAGE)
2956 &adp_switch_device, 2916 &adp_switch_device,
2957#if defined(CONFIG_REGULATOR_USERSPACE_CONSUMER) || \ 2917#if IS_ENABLED(CONFIG_REGULATOR_USERSPACE_CONSUMER)
2958 defined(CONFIG_REGULATOR_USERSPACE_CONSUMER_MODULE)
2959 &adp122_userspace_consumer_device, 2918 &adp122_userspace_consumer_device,
2960#endif 2919#endif
2961#endif 2920#endif
2962 2921
2963#if defined(CONFIG_IIO_GPIO_TRIGGER) || \ 2922#if IS_ENABLED(CONFIG_IIO_GPIO_TRIGGER)
2964 defined(CONFIG_IIO_GPIO_TRIGGER_MODULE)
2965 &iio_gpio_trigger, 2923 &iio_gpio_trigger,
2966#endif 2924#endif
2967 2925
2968#if defined(CONFIG_SND_SOC_BFIN_EVAL_ADAU1373) || \ 2926#if IS_ENABLED(CONFIG_SND_SOC_BFIN_EVAL_ADAU1373)
2969 defined(CONFIG_SND_SOC_BFIN_EVAL_ADAU1373_MODULE)
2970 &bf5xx_adau1373_device, 2927 &bf5xx_adau1373_device,
2971#endif 2928#endif
2972 2929
2973#if defined(CONFIG_SND_SOC_BFIN_EVAL_ADAU1701) || \ 2930#if IS_ENABLED(CONFIG_SND_SOC_BFIN_EVAL_ADAU1701)
2974 defined(CONFIG_SND_SOC_BFIN_EVAL_ADAU1701_MODULE)
2975 &bf5xx_adau1701_device, 2931 &bf5xx_adau1701_device,
2976#endif 2932#endif
2977 2933
2978#if defined(CONFIG_SND_SOC_BFIN_EVAL_ADAV80X) || \ 2934#if IS_ENABLED(CONFIG_SND_SOC_BFIN_EVAL_ADAV80X)
2979 defined(CONFIG_SND_SOC_BFIN_EVAL_ADAV80X_MODULE)
2980 &bfin_eval_adav801_device, 2935 &bfin_eval_adav801_device,
2981#endif 2936#endif
2982}; 2937};
2983 2938
2984static int __init net2272_init(void) 2939static int __init net2272_init(void)
2985{ 2940{
2986#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 2941#if IS_ENABLED(CONFIG_USB_NET2272)
2987 int ret; 2942 int ret;
2988 2943
2989 ret = gpio_request(GPIO_PF6, "net2272"); 2944 ret = gpio_request(GPIO_PF6, "net2272");
diff --git a/arch/blackfin/mach-bf537/boards/tcm_bf537.c b/arch/blackfin/mach-bf537/boards/tcm_bf537.c
index e285c3675286..a0211225748d 100644
--- a/arch/blackfin/mach-bf537/boards/tcm_bf537.c
+++ b/arch/blackfin/mach-bf537/boards/tcm_bf537.c
@@ -16,7 +16,7 @@
16#include <linux/mtd/physmap.h> 16#include <linux/mtd/physmap.h>
17#include <linux/spi/spi.h> 17#include <linux/spi/spi.h>
18#include <linux/spi/flash.h> 18#include <linux/spi/flash.h>
19#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 19#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
20#include <linux/usb/isp1362.h> 20#include <linux/usb/isp1362.h>
21#endif 21#endif
22#include <linux/ata_platform.h> 22#include <linux/ata_platform.h>
@@ -32,10 +32,10 @@
32 */ 32 */
33const char bfin_board_name[] = "Bluetechnix TCM BF537"; 33const char bfin_board_name[] = "Bluetechnix TCM BF537";
34 34
35#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 35#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
36/* all SPI peripherals info goes here */ 36/* all SPI peripherals info goes here */
37 37
38#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 38#if IS_ENABLED(CONFIG_MTD_M25P80)
39static struct mtd_partition bfin_spi_flash_partitions[] = { 39static struct mtd_partition bfin_spi_flash_partitions[] = {
40 { 40 {
41 .name = "bootloader(spi)", 41 .name = "bootloader(spi)",
@@ -66,14 +66,14 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
66}; 66};
67#endif 67#endif
68 68
69#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 69#if IS_ENABLED(CONFIG_MMC_SPI)
70static struct bfin5xx_spi_chip mmc_spi_chip_info = { 70static struct bfin5xx_spi_chip mmc_spi_chip_info = {
71 .enable_dma = 0, 71 .enable_dma = 0,
72}; 72};
73#endif 73#endif
74 74
75static struct spi_board_info bfin_spi_board_info[] __initdata = { 75static struct spi_board_info bfin_spi_board_info[] __initdata = {
76#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 76#if IS_ENABLED(CONFIG_MTD_M25P80)
77 { 77 {
78 /* the modalias must be the same as spi device driver name */ 78 /* the modalias must be the same as spi device driver name */
79 .modalias = "m25p80", /* Name of spi_driver for this device */ 79 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -86,7 +86,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
86 }, 86 },
87#endif 87#endif
88 88
89#if defined(CONFIG_SND_BF5XX_SOC_AD183X) || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) 89#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD183X)
90 { 90 {
91 .modalias = "ad183x", 91 .modalias = "ad183x",
92 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 92 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -95,7 +95,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
95 }, 95 },
96#endif 96#endif
97 97
98#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 98#if IS_ENABLED(CONFIG_MMC_SPI)
99 { 99 {
100 .modalias = "mmc_spi", 100 .modalias = "mmc_spi",
101 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 101 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
@@ -144,20 +144,20 @@ static struct platform_device bfin_spi0_device = {
144}; 144};
145#endif /* spi master and devices */ 145#endif /* spi master and devices */
146 146
147#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 147#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
148static struct platform_device rtc_device = { 148static struct platform_device rtc_device = {
149 .name = "rtc-bfin", 149 .name = "rtc-bfin",
150 .id = -1, 150 .id = -1,
151}; 151};
152#endif 152#endif
153 153
154#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE) 154#if IS_ENABLED(CONFIG_FB_HITACHI_TX09)
155static struct platform_device hitachi_fb_device = { 155static struct platform_device hitachi_fb_device = {
156 .name = "hitachi-tx09", 156 .name = "hitachi-tx09",
157}; 157};
158#endif 158#endif
159 159
160#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 160#if IS_ENABLED(CONFIG_SMC91X)
161#include <linux/smc91x.h> 161#include <linux/smc91x.h>
162 162
163static struct smc91x_platdata smc91x_info = { 163static struct smc91x_platdata smc91x_info = {
@@ -189,7 +189,7 @@ static struct platform_device smc91x_device = {
189}; 189};
190#endif 190#endif
191 191
192#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 192#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
193static struct resource isp1362_hcd_resources[] = { 193static struct resource isp1362_hcd_resources[] = {
194 { 194 {
195 .start = 0x20308000, 195 .start = 0x20308000,
@@ -228,7 +228,7 @@ static struct platform_device isp1362_hcd_device = {
228}; 228};
229#endif 229#endif
230 230
231#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 231#if IS_ENABLED(CONFIG_USB_NET2272)
232static struct resource net2272_bfin_resources[] = { 232static struct resource net2272_bfin_resources[] = {
233 { 233 {
234 .start = 0x20300000, 234 .start = 0x20300000,
@@ -249,7 +249,7 @@ static struct platform_device net2272_bfin_device = {
249}; 249};
250#endif 250#endif
251 251
252#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE) 252#if IS_ENABLED(CONFIG_MTD_GPIO_ADDR)
253static struct mtd_partition cm_partitions[] = { 253static struct mtd_partition cm_partitions[] = {
254 { 254 {
255 .name = "bootloader(nor)", 255 .name = "bootloader(nor)",
@@ -298,7 +298,7 @@ static struct platform_device cm_flash_device = {
298}; 298};
299#endif 299#endif
300 300
301#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 301#if IS_ENABLED(CONFIG_SERIAL_BFIN)
302#ifdef CONFIG_SERIAL_BFIN_UART0 302#ifdef CONFIG_SERIAL_BFIN_UART0
303static struct resource bfin_uart0_resources[] = { 303static struct resource bfin_uart0_resources[] = {
304 { 304 {
@@ -397,7 +397,7 @@ static struct platform_device bfin_uart1_device = {
397#endif 397#endif
398#endif 398#endif
399 399
400#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 400#if IS_ENABLED(CONFIG_BFIN_SIR)
401#ifdef CONFIG_BFIN_SIR0 401#ifdef CONFIG_BFIN_SIR0
402static struct resource bfin_sir0_resources[] = { 402static struct resource bfin_sir0_resources[] = {
403 { 403 {
@@ -452,7 +452,7 @@ static struct platform_device bfin_sir1_device = {
452#endif 452#endif
453#endif 453#endif
454 454
455#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 455#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
456static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; 456static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
457 457
458static struct resource bfin_twi0_resource[] = { 458static struct resource bfin_twi0_resource[] = {
@@ -479,7 +479,7 @@ static struct platform_device i2c_bfin_twi_device = {
479}; 479};
480#endif 480#endif
481 481
482#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 482#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
483#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 483#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
484static struct resource bfin_sport0_uart_resources[] = { 484static struct resource bfin_sport0_uart_resources[] = {
485 { 485 {
@@ -550,7 +550,7 @@ static struct platform_device bfin_sport1_uart_device = {
550#endif 550#endif
551#endif 551#endif
552 552
553#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 553#if IS_ENABLED(CONFIG_BFIN_MAC)
554#include <linux/bfin_mac.h> 554#include <linux/bfin_mac.h>
555static const unsigned short bfin_mac_peripherals[] = P_MII0; 555static const unsigned short bfin_mac_peripherals[] = P_MII0;
556 556
@@ -583,7 +583,7 @@ static struct platform_device bfin_mac_device = {
583}; 583};
584#endif 584#endif
585 585
586#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 586#if IS_ENABLED(CONFIG_PATA_PLATFORM)
587#define PATA_INT IRQ_PF14 587#define PATA_INT IRQ_PF14
588 588
589static struct pata_platform_info bfin_pata_platform_data = { 589static struct pata_platform_info bfin_pata_platform_data = {
@@ -651,15 +651,15 @@ static struct platform_device *cm_bf537_devices[] __initdata = {
651 651
652 &bfin_dpmc, 652 &bfin_dpmc,
653 653
654#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE) 654#if IS_ENABLED(CONFIG_FB_HITACHI_TX09)
655 &hitachi_fb_device, 655 &hitachi_fb_device,
656#endif 656#endif
657 657
658#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 658#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
659 &rtc_device, 659 &rtc_device,
660#endif 660#endif
661 661
662#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 662#if IS_ENABLED(CONFIG_SERIAL_BFIN)
663#ifdef CONFIG_SERIAL_BFIN_UART0 663#ifdef CONFIG_SERIAL_BFIN_UART0
664 &bfin_uart0_device, 664 &bfin_uart0_device,
665#endif 665#endif
@@ -668,7 +668,7 @@ static struct platform_device *cm_bf537_devices[] __initdata = {
668#endif 668#endif
669#endif 669#endif
670 670
671#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 671#if IS_ENABLED(CONFIG_BFIN_SIR)
672#ifdef CONFIG_BFIN_SIR0 672#ifdef CONFIG_BFIN_SIR0
673 &bfin_sir0_device, 673 &bfin_sir0_device,
674#endif 674#endif
@@ -677,11 +677,11 @@ static struct platform_device *cm_bf537_devices[] __initdata = {
677#endif 677#endif
678#endif 678#endif
679 679
680#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 680#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
681 &i2c_bfin_twi_device, 681 &i2c_bfin_twi_device,
682#endif 682#endif
683 683
684#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 684#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
685#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 685#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
686 &bfin_sport0_uart_device, 686 &bfin_sport0_uart_device,
687#endif 687#endif
@@ -690,39 +690,39 @@ static struct platform_device *cm_bf537_devices[] __initdata = {
690#endif 690#endif
691#endif 691#endif
692 692
693#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 693#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
694 &isp1362_hcd_device, 694 &isp1362_hcd_device,
695#endif 695#endif
696 696
697#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 697#if IS_ENABLED(CONFIG_SMC91X)
698 &smc91x_device, 698 &smc91x_device,
699#endif 699#endif
700 700
701#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 701#if IS_ENABLED(CONFIG_BFIN_MAC)
702 &bfin_mii_bus, 702 &bfin_mii_bus,
703 &bfin_mac_device, 703 &bfin_mac_device,
704#endif 704#endif
705 705
706#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 706#if IS_ENABLED(CONFIG_USB_NET2272)
707 &net2272_bfin_device, 707 &net2272_bfin_device,
708#endif 708#endif
709 709
710#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 710#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
711 &bfin_spi0_device, 711 &bfin_spi0_device,
712#endif 712#endif
713 713
714#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 714#if IS_ENABLED(CONFIG_PATA_PLATFORM)
715 &bfin_pata_device, 715 &bfin_pata_device,
716#endif 716#endif
717 717
718#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE) 718#if IS_ENABLED(CONFIG_MTD_GPIO_ADDR)
719 &cm_flash_device, 719 &cm_flash_device,
720#endif 720#endif
721}; 721};
722 722
723static int __init net2272_init(void) 723static int __init net2272_init(void)
724{ 724{
725#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 725#if IS_ENABLED(CONFIG_USB_NET2272)
726 int ret; 726 int ret;
727 727
728 ret = gpio_request(GPIO_PG14, "net2272"); 728 ret = gpio_request(GPIO_PG14, "net2272");
@@ -742,11 +742,11 @@ static int __init tcm_bf537_init(void)
742{ 742{
743 printk(KERN_INFO "%s(): registering device resources\n", __func__); 743 printk(KERN_INFO "%s(): registering device resources\n", __func__);
744 platform_add_devices(cm_bf537_devices, ARRAY_SIZE(cm_bf537_devices)); 744 platform_add_devices(cm_bf537_devices, ARRAY_SIZE(cm_bf537_devices));
745#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 745#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
746 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 746 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
747#endif 747#endif
748 748
749#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 749#if IS_ENABLED(CONFIG_PATA_PLATFORM)
750 irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN); 750 irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN);
751#endif 751#endif
752 752
diff --git a/arch/blackfin/mach-bf538/boards/ezkit.c b/arch/blackfin/mach-bf538/boards/ezkit.c
index 755f0dc12010..ae2fcbb00119 100644
--- a/arch/blackfin/mach-bf538/boards/ezkit.c
+++ b/arch/blackfin/mach-bf538/boards/ezkit.c
@@ -33,14 +33,14 @@ const char bfin_board_name[] = "ADI BF538-EZKIT";
33 */ 33 */
34 34
35 35
36#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 36#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
37static struct platform_device rtc_device = { 37static struct platform_device rtc_device = {
38 .name = "rtc-bfin", 38 .name = "rtc-bfin",
39 .id = -1, 39 .id = -1,
40}; 40};
41#endif /* CONFIG_RTC_DRV_BFIN */ 41#endif /* CONFIG_RTC_DRV_BFIN */
42 42
43#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 43#if IS_ENABLED(CONFIG_SERIAL_BFIN)
44#ifdef CONFIG_SERIAL_BFIN_UART0 44#ifdef CONFIG_SERIAL_BFIN_UART0
45static struct resource bfin_uart0_resources[] = { 45static struct resource bfin_uart0_resources[] = {
46 { 46 {
@@ -199,7 +199,7 @@ static struct platform_device bfin_uart2_device = {
199#endif /* CONFIG_SERIAL_BFIN_UART2 */ 199#endif /* CONFIG_SERIAL_BFIN_UART2 */
200#endif /* CONFIG_SERIAL_BFIN */ 200#endif /* CONFIG_SERIAL_BFIN */
201 201
202#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 202#if IS_ENABLED(CONFIG_BFIN_SIR)
203#ifdef CONFIG_BFIN_SIR0 203#ifdef CONFIG_BFIN_SIR0
204static struct resource bfin_sir0_resources[] = { 204static struct resource bfin_sir0_resources[] = {
205 { 205 {
@@ -277,7 +277,7 @@ static struct platform_device bfin_sir2_device = {
277#endif /* CONFIG_BFIN_SIR2 */ 277#endif /* CONFIG_BFIN_SIR2 */
278#endif /* CONFIG_BFIN_SIR */ 278#endif /* CONFIG_BFIN_SIR */
279 279
280#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 280#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
281#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 281#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
282static struct resource bfin_sport0_uart_resources[] = { 282static struct resource bfin_sport0_uart_resources[] = {
283 { 283 {
@@ -416,7 +416,7 @@ static struct platform_device bfin_sport3_uart_device = {
416#endif /* CONFIG_SERIAL_BFIN_SPORT3_UART */ 416#endif /* CONFIG_SERIAL_BFIN_SPORT3_UART */
417#endif /* CONFIG_SERIAL_BFIN_SPORT */ 417#endif /* CONFIG_SERIAL_BFIN_SPORT */
418 418
419#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE) 419#if IS_ENABLED(CONFIG_CAN_BFIN)
420static unsigned short bfin_can_peripherals[] = { 420static unsigned short bfin_can_peripherals[] = {
421 P_CAN0_RX, P_CAN0_TX, 0 421 P_CAN0_RX, P_CAN0_TX, 0
422}; 422};
@@ -458,7 +458,7 @@ static struct platform_device bfin_can_device = {
458 * USB-LAN EzExtender board 458 * USB-LAN EzExtender board
459 * Driver needs to know address, irq and flag pin. 459 * Driver needs to know address, irq and flag pin.
460 */ 460 */
461#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 461#if IS_ENABLED(CONFIG_SMC91X)
462#include <linux/smc91x.h> 462#include <linux/smc91x.h>
463 463
464static struct smc91x_platdata smc91x_info = { 464static struct smc91x_platdata smc91x_info = {
@@ -490,10 +490,9 @@ static struct platform_device smc91x_device = {
490}; 490};
491#endif /* CONFIG_SMC91X */ 491#endif /* CONFIG_SMC91X */
492 492
493#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 493#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
494/* all SPI peripherals info goes here */ 494/* all SPI peripherals info goes here */
495#if defined(CONFIG_MTD_M25P80) \ 495#if IS_ENABLED(CONFIG_MTD_M25P80)
496 || defined(CONFIG_MTD_M25P80_MODULE)
497/* SPI flash chip (m25p16) */ 496/* SPI flash chip (m25p16) */
498static struct mtd_partition bfin_spi_flash_partitions[] = { 497static struct mtd_partition bfin_spi_flash_partitions[] = {
499 { 498 {
@@ -521,7 +520,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
521#endif /* CONFIG_MTD_M25P80 */ 520#endif /* CONFIG_MTD_M25P80 */
522#endif /* CONFIG_SPI_BFIN5XX */ 521#endif /* CONFIG_SPI_BFIN5XX */
523 522
524#if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE) 523#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7879)
525#include <linux/spi/ad7879.h> 524#include <linux/spi/ad7879.h>
526static const struct ad7879_platform_data bfin_ad7879_ts_info = { 525static const struct ad7879_platform_data bfin_ad7879_ts_info = {
527 .model = 7879, /* Model = AD7879 */ 526 .model = 7879, /* Model = AD7879 */
@@ -538,7 +537,7 @@ static const struct ad7879_platform_data bfin_ad7879_ts_info = {
538}; 537};
539#endif /* CONFIG_TOUCHSCREEN_AD7879 */ 538#endif /* CONFIG_TOUCHSCREEN_AD7879 */
540 539
541#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 540#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)
542#include <asm/bfin-lq035q1.h> 541#include <asm/bfin-lq035q1.h>
543 542
544static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = { 543static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
@@ -568,8 +567,7 @@ static struct platform_device bfin_lq035q1_device = {
568#endif /* CONFIG_FB_BFIN_LQ035Q1 */ 567#endif /* CONFIG_FB_BFIN_LQ035Q1 */
569 568
570static struct spi_board_info bf538_spi_board_info[] __initdata = { 569static struct spi_board_info bf538_spi_board_info[] __initdata = {
571#if defined(CONFIG_MTD_M25P80) \ 570#if IS_ENABLED(CONFIG_MTD_M25P80)
572 || defined(CONFIG_MTD_M25P80_MODULE)
573 { 571 {
574 /* the modalias must be the same as spi device driver name */ 572 /* the modalias must be the same as spi device driver name */
575 .modalias = "m25p80", /* Name of spi_driver for this device */ 573 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -581,7 +579,7 @@ static struct spi_board_info bf538_spi_board_info[] __initdata = {
581 .mode = SPI_MODE_3, 579 .mode = SPI_MODE_3,
582 }, 580 },
583#endif /* CONFIG_MTD_M25P80 */ 581#endif /* CONFIG_MTD_M25P80 */
584#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE) 582#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7879_SPI)
585 { 583 {
586 .modalias = "ad7879", 584 .modalias = "ad7879",
587 .platform_data = &bfin_ad7879_ts_info, 585 .platform_data = &bfin_ad7879_ts_info,
@@ -592,7 +590,7 @@ static struct spi_board_info bf538_spi_board_info[] __initdata = {
592 .mode = SPI_CPHA | SPI_CPOL, 590 .mode = SPI_CPHA | SPI_CPOL,
593 }, 591 },
594#endif /* CONFIG_TOUCHSCREEN_AD7879_SPI */ 592#endif /* CONFIG_TOUCHSCREEN_AD7879_SPI */
595#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 593#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)
596 { 594 {
597 .modalias = "bfin-lq035q1-spi", 595 .modalias = "bfin-lq035q1-spi",
598 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 596 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
@@ -601,7 +599,7 @@ static struct spi_board_info bf538_spi_board_info[] __initdata = {
601 .mode = SPI_CPHA | SPI_CPOL, 599 .mode = SPI_CPHA | SPI_CPOL,
602 }, 600 },
603#endif /* CONFIG_FB_BFIN_LQ035Q1 */ 601#endif /* CONFIG_FB_BFIN_LQ035Q1 */
604#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 602#if IS_ENABLED(CONFIG_SPI_SPIDEV)
605 { 603 {
606 .modalias = "spidev", 604 .modalias = "spidev",
607 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 605 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -717,7 +715,7 @@ static struct platform_device bf538_spi_master2 = {
717 }, 715 },
718}; 716};
719 717
720#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 718#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
721static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; 719static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
722 720
723static struct resource bfin_twi0_resource[] = { 721static struct resource bfin_twi0_resource[] = {
@@ -766,7 +764,7 @@ static struct platform_device i2c_bfin_twi1_device = {
766}; 764};
767#endif /* CONFIG_I2C_BLACKFIN_TWI */ 765#endif /* CONFIG_I2C_BLACKFIN_TWI */
768 766
769#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 767#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
770#include <linux/gpio_keys.h> 768#include <linux/gpio_keys.h>
771 769
772static struct gpio_keys_button bfin_gpio_keys_table[] = { 770static struct gpio_keys_button bfin_gpio_keys_table[] = {
@@ -814,7 +812,7 @@ static struct platform_device bfin_dpmc = {
814 }, 812 },
815}; 813};
816 814
817#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 815#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
818static struct mtd_partition ezkit_partitions[] = { 816static struct mtd_partition ezkit_partitions[] = {
819 { 817 {
820 .name = "bootloader(nor)", 818 .name = "bootloader(nor)",
@@ -839,7 +837,7 @@ static struct physmap_flash_data ezkit_flash_data = {
839 837
840static struct resource ezkit_flash_resource = { 838static struct resource ezkit_flash_resource = {
841 .start = 0x20000000, 839 .start = 0x20000000,
842#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 840#if IS_ENABLED(CONFIG_SMC91X)
843 .end = 0x202fffff, 841 .end = 0x202fffff,
844#else 842#else
845 .end = 0x203fffff, 843 .end = 0x203fffff,
@@ -862,11 +860,11 @@ static struct platform_device *cm_bf538_devices[] __initdata = {
862 860
863 &bfin_dpmc, 861 &bfin_dpmc,
864 862
865#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 863#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
866 &rtc_device, 864 &rtc_device,
867#endif 865#endif
868 866
869#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 867#if IS_ENABLED(CONFIG_SERIAL_BFIN)
870#ifdef CONFIG_SERIAL_BFIN_UART0 868#ifdef CONFIG_SERIAL_BFIN_UART0
871 &bfin_uart0_device, 869 &bfin_uart0_device,
872#endif 870#endif
@@ -878,18 +876,18 @@ static struct platform_device *cm_bf538_devices[] __initdata = {
878#endif 876#endif
879#endif 877#endif
880 878
881#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 879#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
882 &bf538_spi_master0, 880 &bf538_spi_master0,
883 &bf538_spi_master1, 881 &bf538_spi_master1,
884 &bf538_spi_master2, 882 &bf538_spi_master2,
885#endif 883#endif
886 884
887#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 885#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
888 &i2c_bfin_twi0_device, 886 &i2c_bfin_twi0_device,
889 &i2c_bfin_twi1_device, 887 &i2c_bfin_twi1_device,
890#endif 888#endif
891 889
892#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 890#if IS_ENABLED(CONFIG_BFIN_SIR)
893#ifdef CONFIG_BFIN_SIR0 891#ifdef CONFIG_BFIN_SIR0
894 &bfin_sir0_device, 892 &bfin_sir0_device,
895#endif 893#endif
@@ -901,7 +899,7 @@ static struct platform_device *cm_bf538_devices[] __initdata = {
901#endif 899#endif
902#endif 900#endif
903 901
904#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 902#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
905#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 903#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
906 &bfin_sport0_uart_device, 904 &bfin_sport0_uart_device,
907#endif 905#endif
@@ -916,23 +914,23 @@ static struct platform_device *cm_bf538_devices[] __initdata = {
916#endif 914#endif
917#endif 915#endif
918 916
919#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE) 917#if IS_ENABLED(CONFIG_CAN_BFIN)
920 &bfin_can_device, 918 &bfin_can_device,
921#endif 919#endif
922 920
923#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 921#if IS_ENABLED(CONFIG_SMC91X)
924 &smc91x_device, 922 &smc91x_device,
925#endif 923#endif
926 924
927#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 925#if IS_ENABLED(CONFIG_FB_BFIN_LQ035Q1)
928 &bfin_lq035q1_device, 926 &bfin_lq035q1_device,
929#endif 927#endif
930 928
931#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 929#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
932 &bfin_device_gpiokeys, 930 &bfin_device_gpiokeys,
933#endif 931#endif
934 932
935#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 933#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
936 &ezkit_flash_device, 934 &ezkit_flash_device,
937#endif 935#endif
938}; 936};
@@ -942,7 +940,7 @@ static int __init ezkit_init(void)
942 printk(KERN_INFO "%s(): registering device resources\n", __func__); 940 printk(KERN_INFO "%s(): registering device resources\n", __func__);
943 platform_add_devices(cm_bf538_devices, ARRAY_SIZE(cm_bf538_devices)); 941 platform_add_devices(cm_bf538_devices, ARRAY_SIZE(cm_bf538_devices));
944 942
945#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 943#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
946 spi_register_board_info(bf538_spi_board_info, 944 spi_register_board_info(bf538_spi_board_info,
947 ARRAY_SIZE(bf538_spi_board_info)); 945 ARRAY_SIZE(bf538_spi_board_info));
948#endif 946#endif
diff --git a/arch/blackfin/mach-bf548/boards/cm_bf548.c b/arch/blackfin/mach-bf548/boards/cm_bf548.c
index e92543362f35..6d5ffdead067 100644
--- a/arch/blackfin/mach-bf548/boards/cm_bf548.c
+++ b/arch/blackfin/mach-bf548/boards/cm_bf548.c
@@ -37,7 +37,7 @@ const char bfin_board_name[] = "Bluetechnix CM-BF548";
37 * Driver needs to know address, irq and flag pin. 37 * Driver needs to know address, irq and flag pin.
38 */ 38 */
39 39
40#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE) 40#if IS_ENABLED(CONFIG_FB_BF54X_LQ043)
41 41
42#include <mach/bf54x-lq043.h> 42#include <mach/bf54x-lq043.h>
43 43
@@ -69,7 +69,7 @@ static struct platform_device bf54x_lq043_device = {
69}; 69};
70#endif 70#endif
71 71
72#if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE) 72#if IS_ENABLED(CONFIG_KEYBOARD_BFIN)
73static unsigned int bf548_keymap[] = { 73static unsigned int bf548_keymap[] = {
74 KEYVAL(0, 0, KEY_ENTER), 74 KEYVAL(0, 0, KEY_ENTER),
75 KEYVAL(0, 1, KEY_HELP), 75 KEYVAL(0, 1, KEY_HELP),
@@ -119,14 +119,14 @@ static struct platform_device bf54x_kpad_device = {
119}; 119};
120#endif 120#endif
121 121
122#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 122#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
123static struct platform_device rtc_device = { 123static struct platform_device rtc_device = {
124 .name = "rtc-bfin", 124 .name = "rtc-bfin",
125 .id = -1, 125 .id = -1,
126}; 126};
127#endif 127#endif
128 128
129#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 129#if IS_ENABLED(CONFIG_SERIAL_BFIN)
130#ifdef CONFIG_SERIAL_BFIN_UART0 130#ifdef CONFIG_SERIAL_BFIN_UART0
131static struct resource bfin_uart0_resources[] = { 131static struct resource bfin_uart0_resources[] = {
132 { 132 {
@@ -353,7 +353,7 @@ static struct platform_device bfin_uart3_device = {
353#endif 353#endif
354#endif 354#endif
355 355
356#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 356#if IS_ENABLED(CONFIG_BFIN_SIR)
357#ifdef CONFIG_BFIN_SIR0 357#ifdef CONFIG_BFIN_SIR0
358static struct resource bfin_sir0_resources[] = { 358static struct resource bfin_sir0_resources[] = {
359 { 359 {
@@ -456,7 +456,7 @@ static struct platform_device bfin_sir3_device = {
456#endif 456#endif
457#endif 457#endif
458 458
459#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 459#if IS_ENABLED(CONFIG_SMSC911X)
460#include <linux/smsc911x.h> 460#include <linux/smsc911x.h>
461 461
462static struct resource smsc911x_resources[] = { 462static struct resource smsc911x_resources[] = {
@@ -491,7 +491,7 @@ static struct platform_device smsc911x_device = {
491}; 491};
492#endif 492#endif
493 493
494#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 494#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
495static struct resource musb_resources[] = { 495static struct resource musb_resources[] = {
496 [0] = { 496 [0] = {
497 .start = 0xFFC03C00, 497 .start = 0xFFC03C00,
@@ -553,7 +553,7 @@ static struct platform_device musb_device = {
553}; 553};
554#endif 554#endif
555 555
556#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 556#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
557#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 557#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
558static struct resource bfin_sport0_uart_resources[] = { 558static struct resource bfin_sport0_uart_resources[] = {
559 { 559 {
@@ -692,7 +692,7 @@ static struct platform_device bfin_sport3_uart_device = {
692#endif 692#endif
693#endif 693#endif
694 694
695#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE) 695#if IS_ENABLED(CONFIG_PATA_BF54X)
696static struct resource bfin_atapi_resources[] = { 696static struct resource bfin_atapi_resources[] = {
697 { 697 {
698 .start = 0xFFC03800, 698 .start = 0xFFC03800,
@@ -714,7 +714,7 @@ static struct platform_device bfin_atapi_device = {
714}; 714};
715#endif 715#endif
716 716
717#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) 717#if IS_ENABLED(CONFIG_MTD_NAND_BF5XX)
718static struct mtd_partition partition_info[] = { 718static struct mtd_partition partition_info[] = {
719 { 719 {
720 .name = "linux kernel(nand)", 720 .name = "linux kernel(nand)",
@@ -760,7 +760,7 @@ static struct platform_device bf5xx_nand_device = {
760}; 760};
761#endif 761#endif
762 762
763#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) 763#if IS_ENABLED(CONFIG_SDH_BFIN)
764static struct bfin_sd_host bfin_sdh_data = { 764static struct bfin_sd_host bfin_sdh_data = {
765 .dma_chan = CH_SDH, 765 .dma_chan = CH_SDH,
766 .irq_int0 = IRQ_SDH_MASK0, 766 .irq_int0 = IRQ_SDH_MASK0,
@@ -776,7 +776,7 @@ static struct platform_device bf54x_sdh_device = {
776}; 776};
777#endif 777#endif
778 778
779#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE) 779#if IS_ENABLED(CONFIG_CAN_BFIN)
780static unsigned short bfin_can_peripherals[] = { 780static unsigned short bfin_can_peripherals[] = {
781 P_CAN0_RX, P_CAN0_TX, 0 781 P_CAN0_RX, P_CAN0_TX, 0
782}; 782};
@@ -814,7 +814,7 @@ static struct platform_device bfin_can_device = {
814}; 814};
815#endif 815#endif
816 816
817#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 817#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
818static struct mtd_partition para_partitions[] = { 818static struct mtd_partition para_partitions[] = {
819 { 819 {
820 .name = "bootloader(nor)", 820 .name = "bootloader(nor)",
@@ -854,10 +854,9 @@ static struct platform_device para_flash_device = {
854}; 854};
855#endif 855#endif
856 856
857#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 857#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
858/* all SPI peripherals info goes here */ 858/* all SPI peripherals info goes here */
859#if defined(CONFIG_MTD_M25P80) \ 859#if IS_ENABLED(CONFIG_MTD_M25P80)
860 || defined(CONFIG_MTD_M25P80_MODULE)
861/* SPI flash chip (m25p16) */ 860/* SPI flash chip (m25p16) */
862static struct mtd_partition bfin_spi_flash_partitions[] = { 861static struct mtd_partition bfin_spi_flash_partitions[] = {
863 { 862 {
@@ -884,7 +883,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
884}; 883};
885#endif 884#endif
886 885
887#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 886#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
888static const struct ad7877_platform_data bfin_ad7877_ts_info = { 887static const struct ad7877_platform_data bfin_ad7877_ts_info = {
889 .model = 7877, 888 .model = 7877,
890 .vref_delay_usecs = 50, /* internal, no capacitor */ 889 .vref_delay_usecs = 50, /* internal, no capacitor */
@@ -901,8 +900,7 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = {
901#endif 900#endif
902 901
903static struct spi_board_info bf54x_spi_board_info[] __initdata = { 902static struct spi_board_info bf54x_spi_board_info[] __initdata = {
904#if defined(CONFIG_MTD_M25P80) \ 903#if IS_ENABLED(CONFIG_MTD_M25P80)
905 || defined(CONFIG_MTD_M25P80_MODULE)
906 { 904 {
907 /* the modalias must be the same as spi device driver name */ 905 /* the modalias must be the same as spi device driver name */
908 .modalias = "m25p80", /* Name of spi_driver for this device */ 906 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -914,7 +912,7 @@ static struct spi_board_info bf54x_spi_board_info[] __initdata = {
914 .mode = SPI_MODE_3, 912 .mode = SPI_MODE_3,
915 }, 913 },
916#endif 914#endif
917#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 915#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
918{ 916{
919 .modalias = "ad7877", 917 .modalias = "ad7877",
920 .platform_data = &bfin_ad7877_ts_info, 918 .platform_data = &bfin_ad7877_ts_info,
@@ -924,7 +922,7 @@ static struct spi_board_info bf54x_spi_board_info[] __initdata = {
924 .chip_select = 2, 922 .chip_select = 2,
925}, 923},
926#endif 924#endif
927#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 925#if IS_ENABLED(CONFIG_SPI_SPIDEV)
928 { 926 {
929 .modalias = "spidev", 927 .modalias = "spidev",
930 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 928 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -1006,7 +1004,7 @@ static struct platform_device bf54x_spi_master1 = {
1006}; 1004};
1007#endif /* spi master and devices */ 1005#endif /* spi master and devices */
1008 1006
1009#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 1007#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
1010static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; 1008static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
1011 1009
1012static struct resource bfin_twi0_resource[] = { 1010static struct resource bfin_twi0_resource[] = {
@@ -1060,7 +1058,7 @@ static struct platform_device i2c_bfin_twi1_device = {
1060#endif 1058#endif
1061#endif 1059#endif
1062 1060
1063#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 1061#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
1064#include <linux/gpio_keys.h> 1062#include <linux/gpio_keys.h>
1065 1063
1066static struct gpio_keys_button bfin_gpio_keys_table[] = { 1064static struct gpio_keys_button bfin_gpio_keys_table[] = {
@@ -1112,11 +1110,11 @@ static struct platform_device *cm_bf548_devices[] __initdata = {
1112 1110
1113 &bfin_dpmc, 1111 &bfin_dpmc,
1114 1112
1115#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 1113#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
1116 &rtc_device, 1114 &rtc_device,
1117#endif 1115#endif
1118 1116
1119#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 1117#if IS_ENABLED(CONFIG_SERIAL_BFIN)
1120#ifdef CONFIG_SERIAL_BFIN_UART0 1118#ifdef CONFIG_SERIAL_BFIN_UART0
1121 &bfin_uart0_device, 1119 &bfin_uart0_device,
1122#endif 1120#endif
@@ -1131,7 +1129,7 @@ static struct platform_device *cm_bf548_devices[] __initdata = {
1131#endif 1129#endif
1132#endif 1130#endif
1133 1131
1134#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 1132#if IS_ENABLED(CONFIG_BFIN_SIR)
1135#ifdef CONFIG_BFIN_SIR0 1133#ifdef CONFIG_BFIN_SIR0
1136 &bfin_sir0_device, 1134 &bfin_sir0_device,
1137#endif 1135#endif
@@ -1146,19 +1144,19 @@ static struct platform_device *cm_bf548_devices[] __initdata = {
1146#endif 1144#endif
1147#endif 1145#endif
1148 1146
1149#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE) 1147#if IS_ENABLED(CONFIG_FB_BF54X_LQ043)
1150 &bf54x_lq043_device, 1148 &bf54x_lq043_device,
1151#endif 1149#endif
1152 1150
1153#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 1151#if IS_ENABLED(CONFIG_SMSC911X)
1154 &smsc911x_device, 1152 &smsc911x_device,
1155#endif 1153#endif
1156 1154
1157#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 1155#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
1158 &musb_device, 1156 &musb_device,
1159#endif 1157#endif
1160 1158
1161#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 1159#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
1162#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 1160#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1163 &bfin_sport0_uart_device, 1161 &bfin_sport0_uart_device,
1164#endif 1162#endif
@@ -1173,43 +1171,43 @@ static struct platform_device *cm_bf548_devices[] __initdata = {
1173#endif 1171#endif
1174#endif 1172#endif
1175 1173
1176#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE) 1174#if IS_ENABLED(CONFIG_PATA_BF54X)
1177 &bfin_atapi_device, 1175 &bfin_atapi_device,
1178#endif 1176#endif
1179 1177
1180#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) 1178#if IS_ENABLED(CONFIG_MTD_NAND_BF5XX)
1181 &bf5xx_nand_device, 1179 &bf5xx_nand_device,
1182#endif 1180#endif
1183 1181
1184#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) 1182#if IS_ENABLED(CONFIG_SDH_BFIN)
1185 &bf54x_sdh_device, 1183 &bf54x_sdh_device,
1186#endif 1184#endif
1187 1185
1188#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 1186#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
1189 &bf54x_spi_master0, 1187 &bf54x_spi_master0,
1190 &bf54x_spi_master1, 1188 &bf54x_spi_master1,
1191#endif 1189#endif
1192 1190
1193#if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE) 1191#if IS_ENABLED(CONFIG_KEYBOARD_BFIN)
1194 &bf54x_kpad_device, 1192 &bf54x_kpad_device,
1195#endif 1193#endif
1196 1194
1197#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 1195#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
1198 &i2c_bfin_twi0_device, 1196 &i2c_bfin_twi0_device,
1199#if !defined(CONFIG_BF542) 1197#if !defined(CONFIG_BF542)
1200 &i2c_bfin_twi1_device, 1198 &i2c_bfin_twi1_device,
1201#endif 1199#endif
1202#endif 1200#endif
1203 1201
1204#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 1202#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
1205 &bfin_device_gpiokeys, 1203 &bfin_device_gpiokeys,
1206#endif 1204#endif
1207 1205
1208#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 1206#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
1209 &para_flash_device, 1207 &para_flash_device,
1210#endif 1208#endif
1211 1209
1212#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE) 1210#if IS_ENABLED(CONFIG_CAN_BFIN)
1213 &bfin_can_device, 1211 &bfin_can_device,
1214#endif 1212#endif
1215 1213
@@ -1220,7 +1218,7 @@ static int __init cm_bf548_init(void)
1220 printk(KERN_INFO "%s(): registering device resources\n", __func__); 1218 printk(KERN_INFO "%s(): registering device resources\n", __func__);
1221 platform_add_devices(cm_bf548_devices, ARRAY_SIZE(cm_bf548_devices)); 1219 platform_add_devices(cm_bf548_devices, ARRAY_SIZE(cm_bf548_devices));
1222 1220
1223#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 1221#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
1224 spi_register_board_info(bf54x_spi_board_info, 1222 spi_register_board_info(bf54x_spi_board_info,
1225 ARRAY_SIZE(bf54x_spi_board_info)); 1223 ARRAY_SIZE(bf54x_spi_board_info));
1226#endif 1224#endif
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c
index d495000b81a0..90138e6112c1 100644
--- a/arch/blackfin/mach-bf548/boards/ezkit.c
+++ b/arch/blackfin/mach-bf548/boards/ezkit.c
@@ -41,7 +41,7 @@ const char bfin_board_name[] = "ADI BF548-EZKIT";
41 * Driver needs to know address, irq and flag pin. 41 * Driver needs to know address, irq and flag pin.
42 */ 42 */
43 43
44#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) 44#if IS_ENABLED(CONFIG_USB_ISP1760_HCD)
45#include <linux/usb/isp1760.h> 45#include <linux/usb/isp1760.h>
46static struct resource bfin_isp1760_resources[] = { 46static struct resource bfin_isp1760_resources[] = {
47 [0] = { 47 [0] = {
@@ -76,7 +76,7 @@ static struct platform_device bfin_isp1760_device = {
76}; 76};
77#endif 77#endif
78 78
79#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE) 79#if IS_ENABLED(CONFIG_FB_BF54X_LQ043)
80 80
81#include <mach/bf54x-lq043.h> 81#include <mach/bf54x-lq043.h>
82 82
@@ -108,7 +108,7 @@ static struct platform_device bf54x_lq043_device = {
108}; 108};
109#endif 109#endif
110 110
111#if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE) 111#if IS_ENABLED(CONFIG_KEYBOARD_BFIN)
112static const unsigned int bf548_keymap[] = { 112static const unsigned int bf548_keymap[] = {
113 KEYVAL(0, 0, KEY_ENTER), 113 KEYVAL(0, 0, KEY_ENTER),
114 KEYVAL(0, 1, KEY_HELP), 114 KEYVAL(0, 1, KEY_HELP),
@@ -158,7 +158,7 @@ static struct platform_device bf54x_kpad_device = {
158}; 158};
159#endif 159#endif
160 160
161#if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE) 161#if IS_ENABLED(CONFIG_INPUT_BFIN_ROTARY)
162#include <asm/bfin_rotary.h> 162#include <asm/bfin_rotary.h>
163 163
164static struct bfin_rotary_platform_data bfin_rotary_data = { 164static struct bfin_rotary_platform_data bfin_rotary_data = {
@@ -190,7 +190,7 @@ static struct platform_device bfin_rotary_device = {
190}; 190};
191#endif 191#endif
192 192
193#if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE) 193#if IS_ENABLED(CONFIG_INPUT_ADXL34X)
194#include <linux/input/adxl34x.h> 194#include <linux/input/adxl34x.h>
195static const struct adxl34x_platform_data adxl34x_info = { 195static const struct adxl34x_platform_data adxl34x_info = {
196 .x_axis_offset = 0, 196 .x_axis_offset = 0,
@@ -229,14 +229,14 @@ static const struct adxl34x_platform_data adxl34x_info = {
229}; 229};
230#endif 230#endif
231 231
232#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 232#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
233static struct platform_device rtc_device = { 233static struct platform_device rtc_device = {
234 .name = "rtc-bfin", 234 .name = "rtc-bfin",
235 .id = -1, 235 .id = -1,
236}; 236};
237#endif 237#endif
238 238
239#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 239#if IS_ENABLED(CONFIG_SERIAL_BFIN)
240#ifdef CONFIG_SERIAL_BFIN_UART0 240#ifdef CONFIG_SERIAL_BFIN_UART0
241static struct resource bfin_uart0_resources[] = { 241static struct resource bfin_uart0_resources[] = {
242 { 242 {
@@ -491,7 +491,7 @@ static struct platform_device bfin_uart3_device = {
491#endif 491#endif
492#endif 492#endif
493 493
494#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 494#if IS_ENABLED(CONFIG_BFIN_SIR)
495#ifdef CONFIG_BFIN_SIR0 495#ifdef CONFIG_BFIN_SIR0
496static struct resource bfin_sir0_resources[] = { 496static struct resource bfin_sir0_resources[] = {
497 { 497 {
@@ -594,7 +594,7 @@ static struct platform_device bfin_sir3_device = {
594#endif 594#endif
595#endif 595#endif
596 596
597#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 597#if IS_ENABLED(CONFIG_SMSC911X)
598#include <linux/smsc911x.h> 598#include <linux/smsc911x.h>
599 599
600static struct resource smsc911x_resources[] = { 600static struct resource smsc911x_resources[] = {
@@ -629,7 +629,7 @@ static struct platform_device smsc911x_device = {
629}; 629};
630#endif 630#endif
631 631
632#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 632#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
633static struct resource musb_resources[] = { 633static struct resource musb_resources[] = {
634 [0] = { 634 [0] = {
635 .start = 0xFFC03C00, 635 .start = 0xFFC03C00,
@@ -691,7 +691,7 @@ static struct platform_device musb_device = {
691}; 691};
692#endif 692#endif
693 693
694#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 694#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
695#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 695#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
696static struct resource bfin_sport0_uart_resources[] = { 696static struct resource bfin_sport0_uart_resources[] = {
697 { 697 {
@@ -830,7 +830,7 @@ static struct platform_device bfin_sport3_uart_device = {
830#endif 830#endif
831#endif 831#endif
832 832
833#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE) 833#if IS_ENABLED(CONFIG_CAN_BFIN)
834 834
835static unsigned short bfin_can0_peripherals[] = { 835static unsigned short bfin_can0_peripherals[] = {
836 P_CAN0_RX, P_CAN0_TX, 0 836 P_CAN0_RX, P_CAN0_TX, 0
@@ -908,7 +908,7 @@ static struct platform_device bfin_can1_device = {
908 908
909#endif 909#endif
910 910
911#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE) 911#if IS_ENABLED(CONFIG_PATA_BF54X)
912static struct resource bfin_atapi_resources[] = { 912static struct resource bfin_atapi_resources[] = {
913 { 913 {
914 .start = 0xFFC03800, 914 .start = 0xFFC03800,
@@ -930,7 +930,7 @@ static struct platform_device bfin_atapi_device = {
930}; 930};
931#endif 931#endif
932 932
933#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) 933#if IS_ENABLED(CONFIG_MTD_NAND_BF5XX)
934static struct mtd_partition partition_info[] = { 934static struct mtd_partition partition_info[] = {
935 { 935 {
936 .name = "bootloader(nand)", 936 .name = "bootloader(nand)",
@@ -980,7 +980,7 @@ static struct platform_device bf5xx_nand_device = {
980}; 980};
981#endif 981#endif
982 982
983#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) 983#if IS_ENABLED(CONFIG_SDH_BFIN)
984 984
985static struct bfin_sd_host bfin_sdh_data = { 985static struct bfin_sd_host bfin_sdh_data = {
986 .dma_chan = CH_SDH, 986 .dma_chan = CH_SDH,
@@ -997,7 +997,7 @@ static struct platform_device bf54x_sdh_device = {
997}; 997};
998#endif 998#endif
999 999
1000#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 1000#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
1001static struct mtd_partition ezkit_partitions[] = { 1001static struct mtd_partition ezkit_partitions[] = {
1002 { 1002 {
1003 .name = "bootloader(nor)", 1003 .name = "bootloader(nor)",
@@ -1045,8 +1045,7 @@ static struct platform_device ezkit_flash_device = {
1045}; 1045};
1046#endif 1046#endif
1047 1047
1048#if defined(CONFIG_MTD_M25P80) \ 1048#if IS_ENABLED(CONFIG_MTD_M25P80)
1049 || defined(CONFIG_MTD_M25P80_MODULE)
1050/* SPI flash chip (m25p16) */ 1049/* SPI flash chip (m25p16) */
1051static struct mtd_partition bfin_spi_flash_partitions[] = { 1050static struct mtd_partition bfin_spi_flash_partitions[] = {
1052 { 1051 {
@@ -1073,7 +1072,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
1073}; 1072};
1074#endif 1073#endif
1075 1074
1076#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 1075#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
1077static const struct ad7877_platform_data bfin_ad7877_ts_info = { 1076static const struct ad7877_platform_data bfin_ad7877_ts_info = {
1078 .model = 7877, 1077 .model = 7877,
1079 .vref_delay_usecs = 50, /* internal, no capacitor */ 1078 .vref_delay_usecs = 50, /* internal, no capacitor */
@@ -1495,8 +1494,7 @@ static struct platform_device bfin_gpj_device = {
1495#endif 1494#endif
1496 1495
1497static struct spi_board_info bfin_spi_board_info[] __initdata = { 1496static struct spi_board_info bfin_spi_board_info[] __initdata = {
1498#if defined(CONFIG_MTD_M25P80) \ 1497#if IS_ENABLED(CONFIG_MTD_M25P80)
1499 || defined(CONFIG_MTD_M25P80_MODULE)
1500 { 1498 {
1501 /* the modalias must be the same as spi device driver name */ 1499 /* the modalias must be the same as spi device driver name */
1502 .modalias = "m25p80", /* Name of spi_driver for this device */ 1500 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -1508,8 +1506,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1508 .mode = SPI_MODE_3, 1506 .mode = SPI_MODE_3,
1509 }, 1507 },
1510#endif 1508#endif
1511#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \ 1509#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD183X)
1512 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
1513 { 1510 {
1514 .modalias = "ad183x", 1511 .modalias = "ad183x",
1515 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 1512 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -1517,7 +1514,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1517 .chip_select = MAX_CTRL_CS + GPIO_PG6, /* SPI_SSEL2 */ 1514 .chip_select = MAX_CTRL_CS + GPIO_PG6, /* SPI_SSEL2 */
1518 }, 1515 },
1519#endif 1516#endif
1520#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 1517#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
1521 { 1518 {
1522 .modalias = "ad7877", 1519 .modalias = "ad7877",
1523 .platform_data = &bfin_ad7877_ts_info, 1520 .platform_data = &bfin_ad7877_ts_info,
@@ -1527,7 +1524,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1527 .chip_select = MAX_CTRL_CS + GPIO_PE5, /* SPI_SSEL2 */ 1524 .chip_select = MAX_CTRL_CS + GPIO_PE5, /* SPI_SSEL2 */
1528 }, 1525 },
1529#endif 1526#endif
1530#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 1527#if IS_ENABLED(CONFIG_SPI_SPIDEV)
1531 { 1528 {
1532 .modalias = "spidev", 1529 .modalias = "spidev",
1533 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 1530 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -1535,7 +1532,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1535 .chip_select = MAX_CTRL_CS + GPIO_PE4, /* SPI_SSEL1 */ 1532 .chip_select = MAX_CTRL_CS + GPIO_PE4, /* SPI_SSEL1 */
1536 }, 1533 },
1537#endif 1534#endif
1538#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE) 1535#if IS_ENABLED(CONFIG_INPUT_ADXL34X_SPI)
1539 { 1536 {
1540 .modalias = "adxl34x", 1537 .modalias = "adxl34x",
1541 .platform_data = &adxl34x_info, 1538 .platform_data = &adxl34x_info,
@@ -1547,7 +1544,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1547 }, 1544 },
1548#endif 1545#endif
1549}; 1546};
1550#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 1547#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
1551/* SPI (0) */ 1548/* SPI (0) */
1552static struct resource bfin_spi0_resource[] = { 1549static struct resource bfin_spi0_resource[] = {
1553 [0] = { 1550 [0] = {
@@ -1620,8 +1617,7 @@ static struct platform_device bf54x_spi_master1 = {
1620}; 1617};
1621#endif /* spi master and devices */ 1618#endif /* spi master and devices */
1622 1619
1623#if defined(CONFIG_VIDEO_BLACKFIN_CAPTURE) \ 1620#if IS_ENABLED(CONFIG_VIDEO_BLACKFIN_CAPTURE)
1624 || defined(CONFIG_VIDEO_BLACKFIN_CAPTURE_MODULE)
1625#include <linux/videodev2.h> 1621#include <linux/videodev2.h>
1626#include <media/blackfin/bfin_capture.h> 1622#include <media/blackfin/bfin_capture.h>
1627#include <media/blackfin/ppi.h> 1623#include <media/blackfin/ppi.h>
@@ -1641,8 +1637,7 @@ static const struct ppi_info ppi_info = {
1641 .pin_req = ppi_req, 1637 .pin_req = ppi_req,
1642}; 1638};
1643 1639
1644#if defined(CONFIG_VIDEO_VS6624) \ 1640#if IS_ENABLED(CONFIG_VIDEO_VS6624)
1645 || defined(CONFIG_VIDEO_VS6624_MODULE)
1646static struct v4l2_input vs6624_inputs[] = { 1641static struct v4l2_input vs6624_inputs[] = {
1647 { 1642 {
1648 .index = 0, 1643 .index = 0,
@@ -1687,7 +1682,7 @@ static struct platform_device bfin_capture_device = {
1687}; 1682};
1688#endif 1683#endif
1689 1684
1690#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 1685#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
1691static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; 1686static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
1692 1687
1693static struct resource bfin_twi0_resource[] = { 1688static struct resource bfin_twi0_resource[] = {
@@ -1742,7 +1737,7 @@ static struct platform_device i2c_bfin_twi1_device = {
1742#endif 1737#endif
1743 1738
1744static struct i2c_board_info __initdata bfin_i2c_board_info0[] = { 1739static struct i2c_board_info __initdata bfin_i2c_board_info0[] = {
1745#if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE) 1740#if IS_ENABLED(CONFIG_SND_SOC_SSM2602)
1746 { 1741 {
1747 I2C_BOARD_INFO("ssm2602", 0x1b), 1742 I2C_BOARD_INFO("ssm2602", 0x1b),
1748 }, 1743 },
@@ -1751,25 +1746,25 @@ static struct i2c_board_info __initdata bfin_i2c_board_info0[] = {
1751 1746
1752#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */ 1747#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
1753static struct i2c_board_info __initdata bfin_i2c_board_info1[] = { 1748static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {
1754#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) 1749#if IS_ENABLED(CONFIG_BFIN_TWI_LCD)
1755 { 1750 {
1756 I2C_BOARD_INFO("pcf8574_lcd", 0x22), 1751 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
1757 }, 1752 },
1758#endif 1753#endif
1759#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE) 1754#if IS_ENABLED(CONFIG_INPUT_PCF8574)
1760 { 1755 {
1761 I2C_BOARD_INFO("pcf8574_keypad", 0x27), 1756 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
1762 .irq = 212, 1757 .irq = 212,
1763 }, 1758 },
1764#endif 1759#endif
1765#if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE) 1760#if IS_ENABLED(CONFIG_INPUT_ADXL34X_I2C)
1766 { 1761 {
1767 I2C_BOARD_INFO("adxl34x", 0x53), 1762 I2C_BOARD_INFO("adxl34x", 0x53),
1768 .irq = IRQ_PC5, 1763 .irq = IRQ_PC5,
1769 .platform_data = (void *)&adxl34x_info, 1764 .platform_data = (void *)&adxl34x_info,
1770 }, 1765 },
1771#endif 1766#endif
1772#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE) 1767#if IS_ENABLED(CONFIG_BFIN_TWI_LCD)
1773 { 1768 {
1774 I2C_BOARD_INFO("ad5252", 0x2f), 1769 I2C_BOARD_INFO("ad5252", 0x2f),
1775 }, 1770 },
@@ -1777,7 +1772,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {
1777}; 1772};
1778#endif 1773#endif
1779 1774
1780#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 1775#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
1781#include <linux/gpio_keys.h> 1776#include <linux/gpio_keys.h>
1782 1777
1783static struct gpio_keys_button bfin_gpio_keys_table[] = { 1778static struct gpio_keys_button bfin_gpio_keys_table[] = {
@@ -1828,8 +1823,8 @@ static struct platform_device bfin_dpmc = {
1828 }, 1823 },
1829}; 1824};
1830 1825
1831#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \ 1826#if IS_ENABLED(CONFIG_SND_BF5XX_I2S) || \
1832 defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 1827 IS_ENABLED(CONFIG_SND_BF5XX_AC97)
1833 1828
1834#define SPORT_REQ(x) \ 1829#define SPORT_REQ(x) \
1835 [x] = {P_SPORT##x##_TFS, P_SPORT##x##_DTPRI, P_SPORT##x##_TSCLK, \ 1830 [x] = {P_SPORT##x##_TFS, P_SPORT##x##_DTPRI, P_SPORT##x##_TSCLK, \
@@ -1889,35 +1884,35 @@ static struct resource bfin_snd_resources[][4] = {
1889}; 1884};
1890#endif 1885#endif
1891 1886
1892#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 1887#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
1893static struct platform_device bfin_i2s_pcm = { 1888static struct platform_device bfin_i2s_pcm = {
1894 .name = "bfin-i2s-pcm-audio", 1889 .name = "bfin-i2s-pcm-audio",
1895 .id = -1, 1890 .id = -1,
1896}; 1891};
1897#endif 1892#endif
1898 1893
1899#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 1894#if IS_ENABLED(CONFIG_SND_BF5XX_AC97)
1900static struct platform_device bfin_ac97_pcm = { 1895static struct platform_device bfin_ac97_pcm = {
1901 .name = "bfin-ac97-pcm-audio", 1896 .name = "bfin-ac97-pcm-audio",
1902 .id = -1, 1897 .id = -1,
1903}; 1898};
1904#endif 1899#endif
1905 1900
1906#if defined(CONFIG_SND_BF5XX_SOC_AD73311) || defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE) 1901#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD73311)
1907static struct platform_device bfin_ad73311_codec_device = { 1902static struct platform_device bfin_ad73311_codec_device = {
1908 .name = "ad73311", 1903 .name = "ad73311",
1909 .id = -1, 1904 .id = -1,
1910}; 1905};
1911#endif 1906#endif
1912 1907
1913#if defined(CONFIG_SND_BF5XX_SOC_AD1980) || defined(CONFIG_SND_BF5XX_SOC_AD1980_MODULE) 1908#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1980)
1914static struct platform_device bfin_ad1980_codec_device = { 1909static struct platform_device bfin_ad1980_codec_device = {
1915 .name = "ad1980", 1910 .name = "ad1980",
1916 .id = -1, 1911 .id = -1,
1917}; 1912};
1918#endif 1913#endif
1919 1914
1920#if defined(CONFIG_SND_BF5XX_SOC_I2S) || defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE) 1915#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_I2S)
1921static struct platform_device bfin_i2s = { 1916static struct platform_device bfin_i2s = {
1922 .name = "bfin-i2s", 1917 .name = "bfin-i2s",
1923 .id = CONFIG_SND_BF5XX_SPORT_NUM, 1918 .id = CONFIG_SND_BF5XX_SPORT_NUM,
@@ -1929,7 +1924,7 @@ static struct platform_device bfin_i2s = {
1929}; 1924};
1930#endif 1925#endif
1931 1926
1932#if defined(CONFIG_SND_BF5XX_SOC_AC97) || defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE) 1927#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AC97)
1933static struct platform_device bfin_ac97 = { 1928static struct platform_device bfin_ac97 = {
1934 .name = "bfin-ac97", 1929 .name = "bfin-ac97",
1935 .id = CONFIG_SND_BF5XX_SPORT_NUM, 1930 .id = CONFIG_SND_BF5XX_SPORT_NUM,
@@ -1962,11 +1957,11 @@ static struct platform_device *ezkit_devices[] __initdata = {
1962 &bfin_gpj_device, 1957 &bfin_gpj_device,
1963#endif 1958#endif
1964 1959
1965#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 1960#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
1966 &rtc_device, 1961 &rtc_device,
1967#endif 1962#endif
1968 1963
1969#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 1964#if IS_ENABLED(CONFIG_SERIAL_BFIN)
1970#ifdef CONFIG_SERIAL_BFIN_UART0 1965#ifdef CONFIG_SERIAL_BFIN_UART0
1971 &bfin_uart0_device, 1966 &bfin_uart0_device,
1972#endif 1967#endif
@@ -1981,7 +1976,7 @@ static struct platform_device *ezkit_devices[] __initdata = {
1981#endif 1976#endif
1982#endif 1977#endif
1983 1978
1984#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 1979#if IS_ENABLED(CONFIG_BFIN_SIR)
1985#ifdef CONFIG_BFIN_SIR0 1980#ifdef CONFIG_BFIN_SIR0
1986 &bfin_sir0_device, 1981 &bfin_sir0_device,
1987#endif 1982#endif
@@ -1996,23 +1991,23 @@ static struct platform_device *ezkit_devices[] __initdata = {
1996#endif 1991#endif
1997#endif 1992#endif
1998 1993
1999#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE) 1994#if IS_ENABLED(CONFIG_FB_BF54X_LQ043)
2000 &bf54x_lq043_device, 1995 &bf54x_lq043_device,
2001#endif 1996#endif
2002 1997
2003#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 1998#if IS_ENABLED(CONFIG_SMSC911X)
2004 &smsc911x_device, 1999 &smsc911x_device,
2005#endif 2000#endif
2006 2001
2007#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 2002#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
2008 &musb_device, 2003 &musb_device,
2009#endif 2004#endif
2010 2005
2011#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) 2006#if IS_ENABLED(CONFIG_USB_ISP1760_HCD)
2012 &bfin_isp1760_device, 2007 &bfin_isp1760_device,
2013#endif 2008#endif
2014 2009
2015#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 2010#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
2016#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 2011#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2017 &bfin_sport0_uart_device, 2012 &bfin_sport0_uart_device,
2018#endif 2013#endif
@@ -2027,72 +2022,71 @@ static struct platform_device *ezkit_devices[] __initdata = {
2027#endif 2022#endif
2028#endif 2023#endif
2029 2024
2030#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE) 2025#if IS_ENABLED(CONFIG_CAN_BFIN)
2031 &bfin_can0_device, 2026 &bfin_can0_device,
2032 &bfin_can1_device, 2027 &bfin_can1_device,
2033#endif 2028#endif
2034 2029
2035#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE) 2030#if IS_ENABLED(CONFIG_PATA_BF54X)
2036 &bfin_atapi_device, 2031 &bfin_atapi_device,
2037#endif 2032#endif
2038 2033
2039#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) 2034#if IS_ENABLED(CONFIG_MTD_NAND_BF5XX)
2040 &bf5xx_nand_device, 2035 &bf5xx_nand_device,
2041#endif 2036#endif
2042 2037
2043#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) 2038#if IS_ENABLED(CONFIG_SDH_BFIN)
2044 &bf54x_sdh_device, 2039 &bf54x_sdh_device,
2045#endif 2040#endif
2046 2041
2047#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 2042#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
2048 &bf54x_spi_master0, 2043 &bf54x_spi_master0,
2049 &bf54x_spi_master1, 2044 &bf54x_spi_master1,
2050#endif 2045#endif
2051#if defined(CONFIG_VIDEO_BLACKFIN_CAPTURE) \ 2046#if IS_ENABLED(CONFIG_VIDEO_BLACKFIN_CAPTURE)
2052 || defined(CONFIG_VIDEO_BLACKFIN_CAPTURE_MODULE)
2053 &bfin_capture_device, 2047 &bfin_capture_device,
2054#endif 2048#endif
2055 2049
2056#if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE) 2050#if IS_ENABLED(CONFIG_KEYBOARD_BFIN)
2057 &bf54x_kpad_device, 2051 &bf54x_kpad_device,
2058#endif 2052#endif
2059 2053
2060#if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE) 2054#if IS_ENABLED(CONFIG_INPUT_BFIN_ROTARY)
2061 &bfin_rotary_device, 2055 &bfin_rotary_device,
2062#endif 2056#endif
2063 2057
2064#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 2058#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
2065 &i2c_bfin_twi0_device, 2059 &i2c_bfin_twi0_device,
2066#if !defined(CONFIG_BF542) 2060#if !defined(CONFIG_BF542)
2067 &i2c_bfin_twi1_device, 2061 &i2c_bfin_twi1_device,
2068#endif 2062#endif
2069#endif 2063#endif
2070 2064
2071#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 2065#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
2072 &bfin_device_gpiokeys, 2066 &bfin_device_gpiokeys,
2073#endif 2067#endif
2074 2068
2075#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 2069#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
2076 &ezkit_flash_device, 2070 &ezkit_flash_device,
2077#endif 2071#endif
2078 2072
2079#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 2073#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
2080 &bfin_i2s_pcm, 2074 &bfin_i2s_pcm,
2081#endif 2075#endif
2082 2076
2083#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 2077#if IS_ENABLED(CONFIG_SND_BF5XX_AC97)
2084 &bfin_ac97_pcm, 2078 &bfin_ac97_pcm,
2085#endif 2079#endif
2086 2080
2087#if defined(CONFIG_SND_BF5XX_SOC_AD1980) || defined(CONFIG_SND_BF5XX_SOC_AD1980_MODULE) 2081#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1980)
2088 &bfin_ad1980_codec_device, 2082 &bfin_ad1980_codec_device,
2089#endif 2083#endif
2090 2084
2091#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 2085#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
2092 &bfin_i2s, 2086 &bfin_i2s,
2093#endif 2087#endif
2094 2088
2095#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 2089#if IS_ENABLED(CONFIG_SND_BF5XX_AC97)
2096 &bfin_ac97, 2090 &bfin_ac97,
2097#endif 2091#endif
2098}; 2092};
diff --git a/arch/blackfin/mach-bf548/include/mach/defBF544.h b/arch/blackfin/mach-bf548/include/mach/defBF544.h
index 329b2c58228b..018ebfc27f5a 100644
--- a/arch/blackfin/mach-bf548/include/mach/defBF544.h
+++ b/arch/blackfin/mach-bf548/include/mach/defBF544.h
@@ -601,36 +601,6 @@
601#define GU_TRANS 0xff00 /* Transparent Color - G/U Component */ 601#define GU_TRANS 0xff00 /* Transparent Color - G/U Component */
602#define BV_TRANS 0xff0000 /* Transparent Color - B/V Component */ 602#define BV_TRANS 0xff0000 /* Transparent Color - B/V Component */
603 603
604/* Bit masks for HOST_CONTROL */
605
606#define HOST_EN 0x1 /* Host Enable */
607#define HOST_END 0x2 /* Host Endianess */
608#define DATA_SIZE 0x4 /* Data Size */
609#define HOST_RST 0x8 /* Host Reset */
610#define HRDY_OVR 0x20 /* Host Ready Override */
611#define INT_MODE 0x40 /* Interrupt Mode */
612#define BT_EN 0x80 /* Bus Timeout Enable */
613#define EHW 0x100 /* Enable Host Write */
614#define EHR 0x200 /* Enable Host Read */
615#define BDR 0x400 /* Burst DMA Requests */
616
617/* Bit masks for HOST_STATUS */
618
619#define DMA_READY 0x1 /* DMA Ready */
620#define FIFOFULL 0x2 /* FIFO Full */
621#define FIFOEMPTY 0x4 /* FIFO Empty */
622#define DMA_COMPLETE 0x8 /* DMA Complete */
623#define HSHK 0x10 /* Host Handshake */
624#define HSTIMEOUT 0x20 /* Host Timeout */
625#define HIRQ 0x40 /* Host Interrupt Request */
626#define ALLOW_CNFG 0x80 /* Allow New Configuration */
627#define DMA_DIR 0x100 /* DMA Direction */
628#define BTE 0x200 /* Bus Timeout Enabled */
629
630/* Bit masks for HOST_TIMEOUT */
631
632#define COUNT_TIMEOUT 0x7ff /* Host Timeout count */
633
634/* Bit masks for TIMER_ENABLE1 */ 604/* Bit masks for TIMER_ENABLE1 */
635 605
636#define TIMEN8 0x1 /* Timer 8 Enable */ 606#define TIMEN8 0x1 /* Timer 8 Enable */
diff --git a/arch/blackfin/mach-bf548/include/mach/defBF547.h b/arch/blackfin/mach-bf548/include/mach/defBF547.h
index e18de212ba1a..d55dcc0f5324 100644
--- a/arch/blackfin/mach-bf548/include/mach/defBF547.h
+++ b/arch/blackfin/mach-bf548/include/mach/defBF547.h
@@ -581,36 +581,6 @@
581#define GU_TRANS 0xff00 /* Transparent Color - G/U Component */ 581#define GU_TRANS 0xff00 /* Transparent Color - G/U Component */
582#define BV_TRANS 0xff0000 /* Transparent Color - B/V Component */ 582#define BV_TRANS 0xff0000 /* Transparent Color - B/V Component */
583 583
584/* Bit masks for HOST_CONTROL */
585
586#define HOST_EN 0x1 /* Host Enable */
587#define HOST_END 0x2 /* Host Endianess */
588#define DATA_SIZE 0x4 /* Data Size */
589#define HOST_RST 0x8 /* Host Reset */
590#define HRDY_OVR 0x20 /* Host Ready Override */
591#define INT_MODE 0x40 /* Interrupt Mode */
592#define BT_EN 0x80 /* Bus Timeout Enable */
593#define EHW 0x100 /* Enable Host Write */
594#define EHR 0x200 /* Enable Host Read */
595#define BDR 0x400 /* Burst DMA Requests */
596
597/* Bit masks for HOST_STATUS */
598
599#define DMA_READY 0x1 /* DMA Ready */
600#define FIFOFULL 0x2 /* FIFO Full */
601#define FIFOEMPTY 0x4 /* FIFO Empty */
602#define DMA_COMPLETE 0x8 /* DMA Complete */
603#define HSHK 0x10 /* Host Handshake */
604#define HSTIMEOUT 0x20 /* Host Timeout */
605#define HIRQ 0x40 /* Host Interrupt Request */
606#define ALLOW_CNFG 0x80 /* Allow New Configuration */
607#define DMA_DIR 0x100 /* DMA Direction */
608#define BTE 0x200 /* Bus Timeout Enabled */
609
610/* Bit masks for HOST_TIMEOUT */
611
612#define COUNT_TIMEOUT 0x7ff /* Host Timeout count */
613
614/* Bit masks for KPAD_CTL */ 584/* Bit masks for KPAD_CTL */
615 585
616#define KPAD_EN 0x1 /* Keypad Enable */ 586#define KPAD_EN 0x1 /* Keypad Enable */
diff --git a/arch/blackfin/mach-bf561/boards/acvilon.c b/arch/blackfin/mach-bf561/boards/acvilon.c
index 0b74218fdd3a..430b16d5ccb1 100644
--- a/arch/blackfin/mach-bf561/boards/acvilon.c
+++ b/arch/blackfin/mach-bf561/boards/acvilon.c
@@ -60,7 +60,7 @@
60 */ 60 */
61const char bfin_board_name[] = "Acvilon board"; 61const char bfin_board_name[] = "Acvilon board";
62 62
63#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) 63#if IS_ENABLED(CONFIG_USB_ISP1760_HCD)
64#include <linux/usb/isp1760.h> 64#include <linux/usb/isp1760.h>
65static struct resource bfin_isp1760_resources[] = { 65static struct resource bfin_isp1760_resources[] = {
66 [0] = { 66 [0] = {
@@ -137,7 +137,7 @@ static struct i2c_board_info acvilon_i2c_devs[] __initdata = {
137 }, 137 },
138}; 138};
139 139
140#if defined(CONFIG_MTD_PLATRAM) || defined(CONFIG_MTD_PLATRAM_MODULE) 140#if IS_ENABLED(CONFIG_MTD_PLATRAM)
141static struct platdata_mtd_ram mtd_ram_data = { 141static struct platdata_mtd_ram mtd_ram_data = {
142 .mapname = "rootfs(RAM)", 142 .mapname = "rootfs(RAM)",
143 .bankwidth = 4, 143 .bankwidth = 4,
@@ -160,7 +160,7 @@ static struct platform_device mtd_ram_device = {
160}; 160};
161#endif 161#endif
162 162
163#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 163#if IS_ENABLED(CONFIG_SMSC911X)
164#include <linux/smsc911x.h> 164#include <linux/smsc911x.h>
165static struct resource smsc911x_resources[] = { 165static struct resource smsc911x_resources[] = {
166 { 166 {
@@ -194,7 +194,7 @@ static struct platform_device smsc911x_device = {
194}; 194};
195#endif 195#endif
196 196
197#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 197#if IS_ENABLED(CONFIG_SERIAL_BFIN)
198#ifdef CONFIG_SERIAL_BFIN_UART0 198#ifdef CONFIG_SERIAL_BFIN_UART0
199static struct resource bfin_uart0_resources[] = { 199static struct resource bfin_uart0_resources[] = {
200 { 200 {
@@ -246,7 +246,7 @@ static struct platform_device bfin_uart0_device = {
246#endif 246#endif
247#endif 247#endif
248 248
249#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE) 249#if IS_ENABLED(CONFIG_MTD_NAND_PLATFORM)
250 250
251static struct mtd_partition bfin_plat_nand_partitions[] = { 251static struct mtd_partition bfin_plat_nand_partitions[] = {
252 { 252 {
@@ -323,7 +323,7 @@ static void bfin_plat_nand_init(void)
323} 323}
324#endif 324#endif
325 325
326#if defined(CONFIG_MTD_DATAFLASH) || defined(CONFIG_MTD_DATAFLASH_MODULE) 326#if IS_ENABLED(CONFIG_MTD_DATAFLASH)
327static struct mtd_partition bfin_spi_dataflash_partitions[] = { 327static struct mtd_partition bfin_spi_dataflash_partitions[] = {
328 { 328 {
329 .name = "bootloader", 329 .name = "bootloader",
@@ -369,7 +369,7 @@ static struct bfin5xx_spi_chip data_flash_chip_info = {
369}; 369};
370#endif 370#endif
371 371
372#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 372#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
373/* SPI (0) */ 373/* SPI (0) */
374static struct resource bfin_spi0_resource[] = { 374static struct resource bfin_spi0_resource[] = {
375 [0] = { 375 [0] = {
@@ -408,7 +408,7 @@ static struct platform_device bfin_spi0_device = {
408#endif 408#endif
409 409
410static struct spi_board_info bfin_spi_board_info[] __initdata = { 410static struct spi_board_info bfin_spi_board_info[] __initdata = {
411#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 411#if IS_ENABLED(CONFIG_SPI_SPIDEV)
412 { 412 {
413 .modalias = "spidev", 413 .modalias = "spidev",
414 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 414 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -416,7 +416,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
416 .chip_select = 3, 416 .chip_select = 3,
417 }, 417 },
418#endif 418#endif
419#if defined(CONFIG_MTD_DATAFLASH) || defined(CONFIG_MTD_DATAFLASH_MODULE) 419#if IS_ENABLED(CONFIG_MTD_DATAFLASH)
420 { /* DataFlash chip */ 420 { /* DataFlash chip */
421 .modalias = "mtd_dataflash", 421 .modalias = "mtd_dataflash",
422 .max_speed_hz = 33250000, /* max spi clock (SCK) speed in HZ */ 422 .max_speed_hz = 33250000, /* max spi clock (SCK) speed in HZ */
@@ -472,11 +472,11 @@ static struct platform_device bfin_dpmc = {
472static struct platform_device *acvilon_devices[] __initdata = { 472static struct platform_device *acvilon_devices[] __initdata = {
473 &bfin_dpmc, 473 &bfin_dpmc,
474 474
475#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 475#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
476 &bfin_spi0_device, 476 &bfin_spi0_device,
477#endif 477#endif
478 478
479#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 479#if IS_ENABLED(CONFIG_SERIAL_BFIN)
480#ifdef CONFIG_SERIAL_BFIN_UART0 480#ifdef CONFIG_SERIAL_BFIN_UART0
481 &bfin_uart0_device, 481 &bfin_uart0_device,
482#endif 482#endif
@@ -484,17 +484,17 @@ static struct platform_device *acvilon_devices[] __initdata = {
484 484
485 &bfin_gpios_device, 485 &bfin_gpios_device,
486 486
487#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 487#if IS_ENABLED(CONFIG_SMSC911X)
488 &smsc911x_device, 488 &smsc911x_device,
489#endif 489#endif
490 490
491 &bfin_i2c_pca_device, 491 &bfin_i2c_pca_device,
492 492
493#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE) 493#if IS_ENABLED(CONFIG_MTD_NAND_PLATFORM)
494 &bfin_async_nand_device, 494 &bfin_async_nand_device,
495#endif 495#endif
496 496
497#if defined(CONFIG_MTD_PLATRAM) || defined(CONFIG_MTD_PLATRAM_MODULE) 497#if IS_ENABLED(CONFIG_MTD_PLATRAM)
498 &mtd_ram_device, 498 &mtd_ram_device,
499#endif 499#endif
500 500
diff --git a/arch/blackfin/mach-bf561/boards/cm_bf561.c b/arch/blackfin/mach-bf561/boards/cm_bf561.c
index d81450f635df..9f777df4cacc 100644
--- a/arch/blackfin/mach-bf561/boards/cm_bf561.c
+++ b/arch/blackfin/mach-bf561/boards/cm_bf561.c
@@ -13,7 +13,7 @@
13#include <linux/mtd/partitions.h> 13#include <linux/mtd/partitions.h>
14#include <linux/spi/spi.h> 14#include <linux/spi/spi.h>
15#include <linux/spi/flash.h> 15#include <linux/spi/flash.h>
16#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 16#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
17#include <linux/usb/isp1362.h> 17#include <linux/usb/isp1362.h>
18#endif 18#endif
19#include <linux/ata_platform.h> 19#include <linux/ata_platform.h>
@@ -29,10 +29,10 @@
29 */ 29 */
30const char bfin_board_name[] = "Bluetechnix CM BF561"; 30const char bfin_board_name[] = "Bluetechnix CM BF561";
31 31
32#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 32#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
33/* all SPI peripherals info goes here */ 33/* all SPI peripherals info goes here */
34 34
35#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 35#if IS_ENABLED(CONFIG_MTD_M25P80)
36static struct mtd_partition bfin_spi_flash_partitions[] = { 36static struct mtd_partition bfin_spi_flash_partitions[] = {
37 { 37 {
38 .name = "bootloader(spi)", 38 .name = "bootloader(spi)",
@@ -64,7 +64,7 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
64#endif 64#endif
65 65
66static struct spi_board_info bfin_spi_board_info[] __initdata = { 66static struct spi_board_info bfin_spi_board_info[] __initdata = {
67#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 67#if IS_ENABLED(CONFIG_MTD_M25P80)
68 { 68 {
69 /* the modalias must be the same as spi device driver name */ 69 /* the modalias must be the same as spi device driver name */
70 .modalias = "m25p80", /* Name of spi_driver for this device */ 70 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -77,7 +77,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
77 }, 77 },
78#endif 78#endif
79 79
80#if defined(CONFIG_SND_BF5XX_SOC_AD183X) || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) 80#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD183X)
81 { 81 {
82 .modalias = "ad183x", 82 .modalias = "ad183x",
83 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 83 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -85,7 +85,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
85 .chip_select = 4, 85 .chip_select = 4,
86 }, 86 },
87#endif 87#endif
88#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE) 88#if IS_ENABLED(CONFIG_MMC_SPI)
89 { 89 {
90 .modalias = "mmc_spi", 90 .modalias = "mmc_spi",
91 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 91 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
@@ -134,14 +134,14 @@ static struct platform_device bfin_spi0_device = {
134#endif /* spi master and devices */ 134#endif /* spi master and devices */
135 135
136 136
137#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE) 137#if IS_ENABLED(CONFIG_FB_HITACHI_TX09)
138static struct platform_device hitachi_fb_device = { 138static struct platform_device hitachi_fb_device = {
139 .name = "hitachi-tx09", 139 .name = "hitachi-tx09",
140}; 140};
141#endif 141#endif
142 142
143 143
144#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 144#if IS_ENABLED(CONFIG_SMC91X)
145#include <linux/smc91x.h> 145#include <linux/smc91x.h>
146 146
147static struct smc91x_platdata smc91x_info = { 147static struct smc91x_platdata smc91x_info = {
@@ -173,7 +173,7 @@ static struct platform_device smc91x_device = {
173}; 173};
174#endif 174#endif
175 175
176#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 176#if IS_ENABLED(CONFIG_SMSC911X)
177#include <linux/smsc911x.h> 177#include <linux/smsc911x.h>
178 178
179static struct resource smsc911x_resources[] = { 179static struct resource smsc911x_resources[] = {
@@ -208,7 +208,7 @@ static struct platform_device smsc911x_device = {
208}; 208};
209#endif 209#endif
210 210
211#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 211#if IS_ENABLED(CONFIG_USB_NET2272)
212static struct resource net2272_bfin_resources[] = { 212static struct resource net2272_bfin_resources[] = {
213 { 213 {
214 .start = 0x24000000, 214 .start = 0x24000000,
@@ -229,7 +229,7 @@ static struct platform_device net2272_bfin_device = {
229}; 229};
230#endif 230#endif
231 231
232#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 232#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
233static struct resource isp1362_hcd_resources[] = { 233static struct resource isp1362_hcd_resources[] = {
234 { 234 {
235 .start = 0x24008000, 235 .start = 0x24008000,
@@ -268,7 +268,7 @@ static struct platform_device isp1362_hcd_device = {
268}; 268};
269#endif 269#endif
270 270
271#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 271#if IS_ENABLED(CONFIG_SERIAL_BFIN)
272#ifdef CONFIG_SERIAL_BFIN_UART0 272#ifdef CONFIG_SERIAL_BFIN_UART0
273static struct resource bfin_uart0_resources[] = { 273static struct resource bfin_uart0_resources[] = {
274 { 274 {
@@ -319,7 +319,7 @@ static struct platform_device bfin_uart0_device = {
319#endif 319#endif
320#endif 320#endif
321 321
322#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 322#if IS_ENABLED(CONFIG_BFIN_SIR)
323#ifdef CONFIG_BFIN_SIR0 323#ifdef CONFIG_BFIN_SIR0
324static struct resource bfin_sir0_resources[] = { 324static struct resource bfin_sir0_resources[] = {
325 { 325 {
@@ -348,7 +348,7 @@ static struct platform_device bfin_sir0_device = {
348#endif 348#endif
349#endif 349#endif
350 350
351#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 351#if IS_ENABLED(CONFIG_PATA_PLATFORM)
352#define PATA_INT IRQ_PF46 352#define PATA_INT IRQ_PF46
353 353
354static struct pata_platform_info bfin_pata_platform_data = { 354static struct pata_platform_info bfin_pata_platform_data = {
@@ -385,7 +385,7 @@ static struct platform_device bfin_pata_device = {
385}; 385};
386#endif 386#endif
387 387
388#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 388#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
389static struct mtd_partition para_partitions[] = { 389static struct mtd_partition para_partitions[] = {
390 { 390 {
391 .name = "bootloader(nor)", 391 .name = "bootloader(nor)",
@@ -456,54 +456,54 @@ static struct platform_device *cm_bf561_devices[] __initdata = {
456 456
457 &bfin_dpmc, 457 &bfin_dpmc,
458 458
459#if defined(CONFIG_FB_HITACHI_TX09) || defined(CONFIG_FB_HITACHI_TX09_MODULE) 459#if IS_ENABLED(CONFIG_FB_HITACHI_TX09)
460 &hitachi_fb_device, 460 &hitachi_fb_device,
461#endif 461#endif
462 462
463#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 463#if IS_ENABLED(CONFIG_SERIAL_BFIN)
464#ifdef CONFIG_SERIAL_BFIN_UART0 464#ifdef CONFIG_SERIAL_BFIN_UART0
465 &bfin_uart0_device, 465 &bfin_uart0_device,
466#endif 466#endif
467#endif 467#endif
468 468
469#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 469#if IS_ENABLED(CONFIG_BFIN_SIR)
470#ifdef CONFIG_BFIN_SIR0 470#ifdef CONFIG_BFIN_SIR0
471 &bfin_sir0_device, 471 &bfin_sir0_device,
472#endif 472#endif
473#endif 473#endif
474 474
475#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 475#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
476 &isp1362_hcd_device, 476 &isp1362_hcd_device,
477#endif 477#endif
478 478
479#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 479#if IS_ENABLED(CONFIG_SMC91X)
480 &smc91x_device, 480 &smc91x_device,
481#endif 481#endif
482 482
483#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 483#if IS_ENABLED(CONFIG_SMSC911X)
484 &smsc911x_device, 484 &smsc911x_device,
485#endif 485#endif
486 486
487#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 487#if IS_ENABLED(CONFIG_USB_NET2272)
488 &net2272_bfin_device, 488 &net2272_bfin_device,
489#endif 489#endif
490 490
491#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 491#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
492 &bfin_spi0_device, 492 &bfin_spi0_device,
493#endif 493#endif
494 494
495#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 495#if IS_ENABLED(CONFIG_PATA_PLATFORM)
496 &bfin_pata_device, 496 &bfin_pata_device,
497#endif 497#endif
498 498
499#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 499#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
500 &para_flash_device, 500 &para_flash_device,
501#endif 501#endif
502}; 502};
503 503
504static int __init net2272_init(void) 504static int __init net2272_init(void)
505{ 505{
506#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 506#if IS_ENABLED(CONFIG_USB_NET2272)
507 int ret; 507 int ret;
508 508
509 ret = gpio_request(GPIO_PF46, "net2272"); 509 ret = gpio_request(GPIO_PF46, "net2272");
@@ -523,11 +523,11 @@ static int __init cm_bf561_init(void)
523{ 523{
524 printk(KERN_INFO "%s(): registering device resources\n", __func__); 524 printk(KERN_INFO "%s(): registering device resources\n", __func__);
525 platform_add_devices(cm_bf561_devices, ARRAY_SIZE(cm_bf561_devices)); 525 platform_add_devices(cm_bf561_devices, ARRAY_SIZE(cm_bf561_devices));
526#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 526#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
527 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 527 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
528#endif 528#endif
529 529
530#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 530#if IS_ENABLED(CONFIG_PATA_PLATFORM)
531 irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN); 531 irq_set_status_flags(PATA_INT, IRQ_NOAUTOEN);
532#endif 532#endif
533 533
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c
index 92938e79b9e3..88dee43e7abe 100644
--- a/arch/blackfin/mach-bf561/boards/ezkit.c
+++ b/arch/blackfin/mach-bf561/boards/ezkit.c
@@ -25,7 +25,7 @@
25 */ 25 */
26const char bfin_board_name[] = "ADI BF561-EZKIT"; 26const char bfin_board_name[] = "ADI BF561-EZKIT";
27 27
28#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) 28#if IS_ENABLED(CONFIG_USB_ISP1760_HCD)
29#include <linux/usb/isp1760.h> 29#include <linux/usb/isp1760.h>
30static struct resource bfin_isp1760_resources[] = { 30static struct resource bfin_isp1760_resources[] = {
31 [0] = { 31 [0] = {
@@ -60,7 +60,7 @@ static struct platform_device bfin_isp1760_device = {
60}; 60};
61#endif 61#endif
62 62
63#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 63#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
64#include <linux/usb/isp1362.h> 64#include <linux/usb/isp1362.h>
65 65
66static struct resource isp1362_hcd_resources[] = { 66static struct resource isp1362_hcd_resources[] = {
@@ -101,7 +101,7 @@ static struct platform_device isp1362_hcd_device = {
101}; 101};
102#endif 102#endif
103 103
104#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 104#if IS_ENABLED(CONFIG_USB_NET2272)
105static struct resource net2272_bfin_resources[] = { 105static struct resource net2272_bfin_resources[] = {
106 { 106 {
107 .start = 0x2C000000, 107 .start = 0x2C000000,
@@ -129,7 +129,7 @@ static struct platform_device net2272_bfin_device = {
129 * USB-LAN EzExtender board 129 * USB-LAN EzExtender board
130 * Driver needs to know address, irq and flag pin. 130 * Driver needs to know address, irq and flag pin.
131 */ 131 */
132#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 132#if IS_ENABLED(CONFIG_SMC91X)
133#include <linux/smc91x.h> 133#include <linux/smc91x.h>
134 134
135static struct smc91x_platdata smc91x_info = { 135static struct smc91x_platdata smc91x_info = {
@@ -163,7 +163,7 @@ static struct platform_device smc91x_device = {
163}; 163};
164#endif 164#endif
165 165
166#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 166#if IS_ENABLED(CONFIG_SERIAL_BFIN)
167#ifdef CONFIG_SERIAL_BFIN_UART0 167#ifdef CONFIG_SERIAL_BFIN_UART0
168static struct resource bfin_uart0_resources[] = { 168static struct resource bfin_uart0_resources[] = {
169 { 169 {
@@ -214,7 +214,7 @@ static struct platform_device bfin_uart0_device = {
214#endif 214#endif
215#endif 215#endif
216 216
217#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 217#if IS_ENABLED(CONFIG_BFIN_SIR)
218#ifdef CONFIG_BFIN_SIR0 218#ifdef CONFIG_BFIN_SIR0
219static struct resource bfin_sir0_resources[] = { 219static struct resource bfin_sir0_resources[] = {
220 { 220 {
@@ -243,7 +243,7 @@ static struct platform_device bfin_sir0_device = {
243#endif 243#endif
244#endif 244#endif
245 245
246#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 246#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
247static struct mtd_partition ezkit_partitions[] = { 247static struct mtd_partition ezkit_partitions[] = {
248 { 248 {
249 .name = "bootloader(nor)", 249 .name = "bootloader(nor)",
@@ -291,7 +291,7 @@ static struct platform_device ezkit_flash_device = {
291}; 291};
292#endif 292#endif
293 293
294#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 294#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
295/* SPI (0) */ 295/* SPI (0) */
296static struct resource bfin_spi0_resource[] = { 296static struct resource bfin_spi0_resource[] = {
297 [0] = { 297 [0] = {
@@ -330,8 +330,7 @@ static struct platform_device bfin_spi0_device = {
330#endif 330#endif
331 331
332static struct spi_board_info bfin_spi_board_info[] __initdata = { 332static struct spi_board_info bfin_spi_board_info[] __initdata = {
333#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \ 333#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD183X)
334 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
335 { 334 {
336 .modalias = "ad183x", 335 .modalias = "ad183x",
337 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 336 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -341,7 +340,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
341 .mode = SPI_MODE_3, 340 .mode = SPI_MODE_3,
342 }, 341 },
343#endif 342#endif
344#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 343#if IS_ENABLED(CONFIG_SPI_SPIDEV)
345 { 344 {
346 .modalias = "spidev", 345 .modalias = "spidev",
347 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 346 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -351,7 +350,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
351#endif 350#endif
352}; 351};
353 352
354#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 353#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
355#include <linux/input.h> 354#include <linux/input.h>
356#include <linux/gpio_keys.h> 355#include <linux/gpio_keys.h>
357 356
@@ -375,7 +374,7 @@ static struct platform_device bfin_device_gpiokeys = {
375}; 374};
376#endif 375#endif
377 376
378#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) 377#if IS_ENABLED(CONFIG_I2C_GPIO)
379#include <linux/i2c-gpio.h> 378#include <linux/i2c-gpio.h>
380 379
381static struct i2c_gpio_platform_data i2c_gpio_data = { 380static struct i2c_gpio_platform_data i2c_gpio_data = {
@@ -422,8 +421,7 @@ static struct platform_device bfin_dpmc = {
422 }, 421 },
423}; 422};
424 423
425#if defined(CONFIG_VIDEO_BLACKFIN_CAPTURE) \ 424#if IS_ENABLED(CONFIG_VIDEO_BLACKFIN_CAPTURE)
426 || defined(CONFIG_VIDEO_BLACKFIN_CAPTURE_MODULE)
427#include <linux/videodev2.h> 425#include <linux/videodev2.h>
428#include <media/blackfin/bfin_capture.h> 426#include <media/blackfin/bfin_capture.h>
429#include <media/blackfin/ppi.h> 427#include <media/blackfin/ppi.h>
@@ -443,8 +441,7 @@ static const struct ppi_info ppi_info = {
443 .pin_req = ppi_req, 441 .pin_req = ppi_req,
444}; 442};
445 443
446#if defined(CONFIG_VIDEO_ADV7183) \ 444#if IS_ENABLED(CONFIG_VIDEO_ADV7183)
447 || defined(CONFIG_VIDEO_ADV7183_MODULE)
448#include <media/adv7183.h> 445#include <media/adv7183.h>
449static struct v4l2_input adv7183_inputs[] = { 446static struct v4l2_input adv7183_inputs[] = {
450 { 447 {
@@ -515,7 +512,7 @@ static struct platform_device bfin_capture_device = {
515}; 512};
516#endif 513#endif
517 514
518#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 515#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
519static struct platform_device bfin_i2s = { 516static struct platform_device bfin_i2s = {
520 .name = "bfin-i2s", 517 .name = "bfin-i2s",
521 .id = CONFIG_SND_BF5XX_SPORT_NUM, 518 .id = CONFIG_SND_BF5XX_SPORT_NUM,
@@ -523,7 +520,7 @@ static struct platform_device bfin_i2s = {
523}; 520};
524#endif 521#endif
525 522
526#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 523#if IS_ENABLED(CONFIG_SND_BF5XX_AC97)
527static struct platform_device bfin_ac97 = { 524static struct platform_device bfin_ac97 = {
528 .name = "bfin-ac97", 525 .name = "bfin-ac97",
529 .id = CONFIG_SND_BF5XX_SPORT_NUM, 526 .id = CONFIG_SND_BF5XX_SPORT_NUM,
@@ -531,8 +528,7 @@ static struct platform_device bfin_ac97 = {
531}; 528};
532#endif 529#endif
533 530
534#if defined(CONFIG_SND_BF5XX_SOC_AD1836) \ 531#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836)
535 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
536static const char * const ad1836_link[] = { 532static const char * const ad1836_link[] = {
537 "bfin-i2s.0", 533 "bfin-i2s.0",
538 "spi0.4", 534 "spi0.4",
@@ -550,72 +546,70 @@ static struct platform_device *ezkit_devices[] __initdata = {
550 546
551 &bfin_dpmc, 547 &bfin_dpmc,
552 548
553#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 549#if IS_ENABLED(CONFIG_SMC91X)
554 &smc91x_device, 550 &smc91x_device,
555#endif 551#endif
556 552
557#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 553#if IS_ENABLED(CONFIG_USB_NET2272)
558 &net2272_bfin_device, 554 &net2272_bfin_device,
559#endif 555#endif
560 556
561#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) 557#if IS_ENABLED(CONFIG_USB_ISP1760_HCD)
562 &bfin_isp1760_device, 558 &bfin_isp1760_device,
563#endif 559#endif
564 560
565#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 561#if IS_ENABLED(CONFIG_SPI_BFIN5XX)
566 &bfin_spi0_device, 562 &bfin_spi0_device,
567#endif 563#endif
568 564
569#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 565#if IS_ENABLED(CONFIG_SERIAL_BFIN)
570#ifdef CONFIG_SERIAL_BFIN_UART0 566#ifdef CONFIG_SERIAL_BFIN_UART0
571 &bfin_uart0_device, 567 &bfin_uart0_device,
572#endif 568#endif
573#endif 569#endif
574 570
575#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 571#if IS_ENABLED(CONFIG_BFIN_SIR)
576#ifdef CONFIG_BFIN_SIR0 572#ifdef CONFIG_BFIN_SIR0
577 &bfin_sir0_device, 573 &bfin_sir0_device,
578#endif 574#endif
579#endif 575#endif
580 576
581#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 577#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
582 &bfin_device_gpiokeys, 578 &bfin_device_gpiokeys,
583#endif 579#endif
584 580
585#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) 581#if IS_ENABLED(CONFIG_I2C_GPIO)
586 &i2c_gpio_device, 582 &i2c_gpio_device,
587#endif 583#endif
588 584
589#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 585#if IS_ENABLED(CONFIG_USB_ISP1362_HCD)
590 &isp1362_hcd_device, 586 &isp1362_hcd_device,
591#endif 587#endif
592 588
593#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 589#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
594 &ezkit_flash_device, 590 &ezkit_flash_device,
595#endif 591#endif
596 592
597#if defined(CONFIG_VIDEO_BLACKFIN_CAPTURE) \ 593#if IS_ENABLED(CONFIG_VIDEO_BLACKFIN_CAPTURE)
598 || defined(CONFIG_VIDEO_BLACKFIN_CAPTURE_MODULE)
599 &bfin_capture_device, 594 &bfin_capture_device,
600#endif 595#endif
601 596
602#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 597#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
603 &bfin_i2s, 598 &bfin_i2s,
604#endif 599#endif
605 600
606#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE) 601#if IS_ENABLED(CONFIG_SND_BF5XX_AC97)
607 &bfin_ac97, 602 &bfin_ac97,
608#endif 603#endif
609 604
610#if defined(CONFIG_SND_BF5XX_SOC_AD1836) || \ 605#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836)
611 defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
612 &bfin_ad1836_machine, 606 &bfin_ad1836_machine,
613#endif 607#endif
614}; 608};
615 609
616static int __init net2272_init(void) 610static int __init net2272_init(void)
617{ 611{
618#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 612#if IS_ENABLED(CONFIG_USB_NET2272)
619 int ret; 613 int ret;
620 614
621 ret = gpio_request(GPIO_PF11, "net2272"); 615 ret = gpio_request(GPIO_PF11, "net2272");
@@ -641,12 +635,12 @@ static int __init ezkit_init(void)
641 if (ret < 0) 635 if (ret < 0)
642 return ret; 636 return ret;
643 637
644#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 638#if IS_ENABLED(CONFIG_SMC91X)
645 bfin_write_FIO0_DIR(bfin_read_FIO0_DIR() | (1 << 12)); 639 bfin_write_FIO0_DIR(bfin_read_FIO0_DIR() | (1 << 12));
646 SSYNC(); 640 SSYNC();
647#endif 641#endif
648 642
649#if defined(CONFIG_SND_BF5XX_SOC_AD183X) || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE) 643#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD183X)
650 bfin_write_FIO0_DIR(bfin_read_FIO0_DIR() | (1 << 15)); 644 bfin_write_FIO0_DIR(bfin_read_FIO0_DIR() | (1 << 15));
651 bfin_write_FIO0_FLAG_S(1 << 15); 645 bfin_write_FIO0_FLAG_S(1 << 15);
652 SSYNC(); 646 SSYNC();
diff --git a/arch/blackfin/mach-bf561/boards/tepla.c b/arch/blackfin/mach-bf561/boards/tepla.c
index 1a57bc986aad..f87b8cc0cd4c 100644
--- a/arch/blackfin/mach-bf561/boards/tepla.c
+++ b/arch/blackfin/mach-bf561/boards/tepla.c
@@ -42,7 +42,7 @@ static struct platform_device smc91x_device = {
42 .resource = smc91x_resources, 42 .resource = smc91x_resources,
43}; 43};
44 44
45#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 45#if IS_ENABLED(CONFIG_SERIAL_BFIN)
46#ifdef CONFIG_SERIAL_BFIN_UART0 46#ifdef CONFIG_SERIAL_BFIN_UART0
47static struct resource bfin_uart0_resources[] = { 47static struct resource bfin_uart0_resources[] = {
48 { 48 {
@@ -93,7 +93,7 @@ static struct platform_device bfin_uart0_device = {
93#endif 93#endif
94#endif 94#endif
95 95
96#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 96#if IS_ENABLED(CONFIG_BFIN_SIR)
97#ifdef CONFIG_BFIN_SIR0 97#ifdef CONFIG_BFIN_SIR0
98static struct resource bfin_sir0_resources[] = { 98static struct resource bfin_sir0_resources[] = {
99 { 99 {
@@ -125,13 +125,13 @@ static struct platform_device bfin_sir0_device = {
125static struct platform_device *tepla_devices[] __initdata = { 125static struct platform_device *tepla_devices[] __initdata = {
126 &smc91x_device, 126 &smc91x_device,
127 127
128#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 128#if IS_ENABLED(CONFIG_SERIAL_BFIN)
129#ifdef CONFIG_SERIAL_BFIN_UART0 129#ifdef CONFIG_SERIAL_BFIN_UART0
130 &bfin_uart0_device, 130 &bfin_uart0_device,
131#endif 131#endif
132#endif 132#endif
133 133
134#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 134#if IS_ENABLED(CONFIG_BFIN_SIR)
135#ifdef CONFIG_BFIN_SIR0 135#ifdef CONFIG_BFIN_SIR0
136 &bfin_sir0_device, 136 &bfin_sir0_device,
137#endif 137#endif
diff --git a/arch/blackfin/mach-bf609/boards/ezkit.c b/arch/blackfin/mach-bf609/boards/ezkit.c
index 8de8bc690b36..943f7e95ec15 100644
--- a/arch/blackfin/mach-bf609/boards/ezkit.c
+++ b/arch/blackfin/mach-bf609/boards/ezkit.c
@@ -39,7 +39,7 @@ const char bfin_board_name[] = "ADI BF609-EZKIT";
39 * Driver needs to know address, irq and flag pin. 39 * Driver needs to know address, irq and flag pin.
40 */ 40 */
41 41
42#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) 42#if IS_ENABLED(CONFIG_USB_ISP1760_HCD)
43#include <linux/usb/isp1760.h> 43#include <linux/usb/isp1760.h>
44static struct resource bfin_isp1760_resources[] = { 44static struct resource bfin_isp1760_resources[] = {
45 [0] = { 45 [0] = {
@@ -74,7 +74,7 @@ static struct platform_device bfin_isp1760_device = {
74}; 74};
75#endif 75#endif
76 76
77#if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE) 77#if IS_ENABLED(CONFIG_INPUT_BFIN_ROTARY)
78#include <asm/bfin_rotary.h> 78#include <asm/bfin_rotary.h>
79 79
80static struct bfin_rotary_platform_data bfin_rotary_data = { 80static struct bfin_rotary_platform_data bfin_rotary_data = {
@@ -105,7 +105,7 @@ static struct platform_device bfin_rotary_device = {
105}; 105};
106#endif 106#endif
107 107
108#if defined(CONFIG_STMMAC_ETH) || defined(CONFIG_STMMAC_ETH_MODULE) 108#if IS_ENABLED(CONFIG_STMMAC_ETH)
109#include <linux/stmmac.h> 109#include <linux/stmmac.h>
110#include <linux/phy.h> 110#include <linux/phy.h>
111 111
@@ -159,7 +159,7 @@ static struct platform_device bfin_eth_device = {
159}; 159};
160#endif 160#endif
161 161
162#if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE) 162#if IS_ENABLED(CONFIG_INPUT_ADXL34X)
163#include <linux/input/adxl34x.h> 163#include <linux/input/adxl34x.h>
164static const struct adxl34x_platform_data adxl34x_info = { 164static const struct adxl34x_platform_data adxl34x_info = {
165 .x_axis_offset = 0, 165 .x_axis_offset = 0,
@@ -198,14 +198,14 @@ static const struct adxl34x_platform_data adxl34x_info = {
198}; 198};
199#endif 199#endif
200 200
201#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 201#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
202static struct platform_device rtc_device = { 202static struct platform_device rtc_device = {
203 .name = "rtc-bfin", 203 .name = "rtc-bfin",
204 .id = -1, 204 .id = -1,
205}; 205};
206#endif 206#endif
207 207
208#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 208#if IS_ENABLED(CONFIG_SERIAL_BFIN)
209#ifdef CONFIG_SERIAL_BFIN_UART0 209#ifdef CONFIG_SERIAL_BFIN_UART0
210static struct resource bfin_uart0_resources[] = { 210static struct resource bfin_uart0_resources[] = {
211 { 211 {
@@ -355,7 +355,7 @@ static struct platform_device bfin_uart1_device = {
355#endif 355#endif
356#endif 356#endif
357 357
358#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 358#if IS_ENABLED(CONFIG_BFIN_SIR)
359#ifdef CONFIG_BFIN_SIR0 359#ifdef CONFIG_BFIN_SIR0
360static struct resource bfin_sir0_resources[] = { 360static struct resource bfin_sir0_resources[] = {
361 { 361 {
@@ -408,7 +408,7 @@ static struct platform_device bfin_sir1_device = {
408#endif 408#endif
409#endif 409#endif
410 410
411#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 411#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
412static struct resource musb_resources[] = { 412static struct resource musb_resources[] = {
413 [0] = { 413 [0] = {
414 .start = 0xFFCC1000, 414 .start = 0xFFCC1000,
@@ -464,7 +464,7 @@ static struct platform_device musb_device = {
464}; 464};
465#endif 465#endif
466 466
467#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 467#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
468#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 468#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
469static struct resource bfin_sport0_uart_resources[] = { 469static struct resource bfin_sport0_uart_resources[] = {
470 { 470 {
@@ -569,7 +569,7 @@ static struct platform_device bfin_sport2_uart_device = {
569#endif 569#endif
570#endif 570#endif
571 571
572#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE) 572#if IS_ENABLED(CONFIG_CAN_BFIN)
573 573
574static unsigned short bfin_can0_peripherals[] = { 574static unsigned short bfin_can0_peripherals[] = {
575 P_CAN0_RX, P_CAN0_TX, 0 575 P_CAN0_RX, P_CAN0_TX, 0
@@ -610,7 +610,7 @@ static struct platform_device bfin_can0_device = {
610 610
611#endif 611#endif
612 612
613#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) 613#if IS_ENABLED(CONFIG_MTD_NAND_BF5XX)
614static struct mtd_partition partition_info[] = { 614static struct mtd_partition partition_info[] = {
615 { 615 {
616 .name = "bootloader(nand)", 616 .name = "bootloader(nand)",
@@ -660,7 +660,7 @@ static struct platform_device bfin_nand_device = {
660}; 660};
661#endif 661#endif
662 662
663#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) 663#if IS_ENABLED(CONFIG_SDH_BFIN)
664 664
665static struct bfin_sd_host bfin_sdh_data = { 665static struct bfin_sd_host bfin_sdh_data = {
666 .dma_chan = CH_RSI, 666 .dma_chan = CH_RSI,
@@ -677,7 +677,7 @@ static struct platform_device bfin_sdh_device = {
677}; 677};
678#endif 678#endif
679 679
680#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 680#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
681static struct mtd_partition ezkit_partitions[] = { 681static struct mtd_partition ezkit_partitions[] = {
682 { 682 {
683 .name = "bootloader(nor)", 683 .name = "bootloader(nor)",
@@ -741,8 +741,7 @@ static struct platform_device ezkit_flash_device = {
741}; 741};
742#endif 742#endif
743 743
744#if defined(CONFIG_MTD_M25P80) \ 744#if IS_ENABLED(CONFIG_MTD_M25P80)
745 || defined(CONFIG_MTD_M25P80_MODULE)
746/* SPI flash chip (w25q32) */ 745/* SPI flash chip (w25q32) */
747static struct mtd_partition bfin_spi_flash_partitions[] = { 746static struct mtd_partition bfin_spi_flash_partitions[] = {
748 { 747 {
@@ -773,21 +772,20 @@ static struct bfin_spi3_chip spi_flash_chip_info = {
773}; 772};
774#endif 773#endif
775 774
776#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 775#if IS_ENABLED(CONFIG_SPI_SPIDEV)
777static struct bfin_spi3_chip spidev_chip_info = { 776static struct bfin_spi3_chip spidev_chip_info = {
778 .enable_dma = true, 777 .enable_dma = true,
779}; 778};
780#endif 779#endif
781 780
782#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 781#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
783static struct platform_device bfin_i2s_pcm = { 782static struct platform_device bfin_i2s_pcm = {
784 .name = "bfin-i2s-pcm-audio", 783 .name = "bfin-i2s-pcm-audio",
785 .id = -1, 784 .id = -1,
786}; 785};
787#endif 786#endif
788 787
789#if defined(CONFIG_SND_BF6XX_SOC_I2S) || \ 788#if IS_ENABLED(CONFIG_SND_BF6XX_SOC_I2S)
790 defined(CONFIG_SND_BF6XX_SOC_I2S_MODULE)
791#include <asm/bfin_sport3.h> 789#include <asm/bfin_sport3.h>
792static struct resource bfin_snd_resources[] = { 790static struct resource bfin_snd_resources[] = {
793 { 791 {
@@ -841,8 +839,7 @@ static struct platform_device bfin_i2s = {
841}; 839};
842#endif 840#endif
843 841
844#if defined(CONFIG_SND_BF5XX_SOC_AD1836) \ 842#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836)
845 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
846static const char * const ad1836_link[] = { 843static const char * const ad1836_link[] = {
847 "bfin-i2s.0", 844 "bfin-i2s.0",
848 "spi0.76", 845 "spi0.76",
@@ -856,14 +853,13 @@ static struct platform_device bfin_ad1836_machine = {
856}; 853};
857#endif 854#endif
858 855
859#if defined(CONFIG_SND_SOC_BFIN_EVAL_ADAU1X61) || \ 856#if IS_ENABLED(CONFIG_SND_SOC_BFIN_EVAL_ADAU1X61)
860 defined(CONFIG_SND_SOC_BFIN_EVAL_ADAU1X61_MODULE)
861static struct platform_device adau1761_device = { 857static struct platform_device adau1761_device = {
862 .name = "bfin-eval-adau1x61", 858 .name = "bfin-eval-adau1x61",
863}; 859};
864#endif 860#endif
865 861
866#if defined(CONFIG_SND_SOC_ADAU1761) || defined(CONFIG_SND_SOC_ADAU1761_MODULE) 862#if IS_ENABLED(CONFIG_SND_SOC_ADAU1761)
867#include <sound/adau17x1.h> 863#include <sound/adau17x1.h>
868static struct adau1761_platform_data adau1761_info = { 864static struct adau1761_platform_data adau1761_info = {
869 .lineout_mode = ADAU1761_OUTPUT_MODE_LINE, 865 .lineout_mode = ADAU1761_OUTPUT_MODE_LINE,
@@ -871,8 +867,7 @@ static struct adau1761_platform_data adau1761_info = {
871}; 867};
872#endif 868#endif
873 869
874#if defined(CONFIG_VIDEO_BLACKFIN_CAPTURE) \ 870#if IS_ENABLED(CONFIG_VIDEO_BLACKFIN_CAPTURE)
875 || defined(CONFIG_VIDEO_BLACKFIN_CAPTURE_MODULE)
876#include <linux/videodev2.h> 871#include <linux/videodev2.h>
877#include <media/blackfin/bfin_capture.h> 872#include <media/blackfin/bfin_capture.h>
878#include <media/blackfin/ppi.h> 873#include <media/blackfin/ppi.h>
@@ -882,7 +877,7 @@ static const unsigned short ppi_req[] = {
882 P_PPI0_D4, P_PPI0_D5, P_PPI0_D6, P_PPI0_D7, 877 P_PPI0_D4, P_PPI0_D5, P_PPI0_D6, P_PPI0_D7,
883 P_PPI0_D8, P_PPI0_D9, P_PPI0_D10, P_PPI0_D11, 878 P_PPI0_D8, P_PPI0_D9, P_PPI0_D10, P_PPI0_D11,
884 P_PPI0_D12, P_PPI0_D13, P_PPI0_D14, P_PPI0_D15, 879 P_PPI0_D12, P_PPI0_D13, P_PPI0_D14, P_PPI0_D15,
885#if !defined(CONFIG_VIDEO_VS6624) && !defined(CONFIG_VIDEO_VS6624_MODULE) 880#if !IS_ENABLED(CONFIG_VIDEO_VS6624)
886 P_PPI0_D16, P_PPI0_D17, P_PPI0_D18, P_PPI0_D19, 881 P_PPI0_D16, P_PPI0_D17, P_PPI0_D18, P_PPI0_D19,
887 P_PPI0_D20, P_PPI0_D21, P_PPI0_D22, P_PPI0_D23, 882 P_PPI0_D20, P_PPI0_D21, P_PPI0_D22, P_PPI0_D23,
888#endif 883#endif
@@ -898,8 +893,7 @@ static const struct ppi_info ppi_info = {
898 .pin_req = ppi_req, 893 .pin_req = ppi_req,
899}; 894};
900 895
901#if defined(CONFIG_VIDEO_VS6624) \ 896#if IS_ENABLED(CONFIG_VIDEO_VS6624)
902 || defined(CONFIG_VIDEO_VS6624_MODULE)
903static struct v4l2_input vs6624_inputs[] = { 897static struct v4l2_input vs6624_inputs[] = {
904 { 898 {
905 .index = 0, 899 .index = 0,
@@ -936,8 +930,7 @@ static struct bfin_capture_config bfin_capture_data = {
936}; 930};
937#endif 931#endif
938 932
939#if defined(CONFIG_VIDEO_ADV7842) \ 933#if IS_ENABLED(CONFIG_VIDEO_ADV7842)
940 || defined(CONFIG_VIDEO_ADV7842_MODULE)
941#include <media/adv7842.h> 934#include <media/adv7842.h>
942 935
943static struct v4l2_input adv7842_inputs[] = { 936static struct v4l2_input adv7842_inputs[] = {
@@ -1067,8 +1060,7 @@ static struct platform_device bfin_capture_device = {
1067}; 1060};
1068#endif 1061#endif
1069 1062
1070#if defined(CONFIG_VIDEO_BLACKFIN_DISPLAY) \ 1063#if IS_ENABLED(CONFIG_VIDEO_BLACKFIN_DISPLAY)
1071 || defined(CONFIG_VIDEO_BLACKFIN_DISPLAY_MODULE)
1072#include <linux/videodev2.h> 1064#include <linux/videodev2.h>
1073#include <media/blackfin/bfin_display.h> 1065#include <media/blackfin/bfin_display.h>
1074#include <media/blackfin/ppi.h> 1066#include <media/blackfin/ppi.h>
@@ -1090,8 +1082,7 @@ static const struct ppi_info ppi_info = {
1090 .pin_req = ppi_req_disp, 1082 .pin_req = ppi_req_disp,
1091}; 1083};
1092 1084
1093#if defined(CONFIG_VIDEO_ADV7511) \ 1085#if IS_ENABLED(CONFIG_VIDEO_ADV7511)
1094 || defined(CONFIG_VIDEO_ADV7511_MODULE)
1095#include <media/adv7511.h> 1086#include <media/adv7511.h>
1096 1087
1097static struct v4l2_output adv7511_outputs[] = { 1088static struct v4l2_output adv7511_outputs[] = {
@@ -1313,7 +1304,7 @@ static struct platform_device bfin_crypto_crc_device = {
1313}; 1304};
1314#endif 1305#endif
1315 1306
1316#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 1307#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
1317static const struct ad7877_platform_data bfin_ad7877_ts_info = { 1308static const struct ad7877_platform_data bfin_ad7877_ts_info = {
1318 .model = 7877, 1309 .model = 7877,
1319 .vref_delay_usecs = 50, /* internal, no capacitor */ 1310 .vref_delay_usecs = 50, /* internal, no capacitor */
@@ -1679,7 +1670,7 @@ static struct platform_device bfin_gpg_device = {
1679 1670
1680#endif 1671#endif
1681 1672
1682#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 1673#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
1683#include <linux/input.h> 1674#include <linux/input.h>
1684#include <linux/gpio_keys.h> 1675#include <linux/gpio_keys.h>
1685 1676
@@ -1702,8 +1693,7 @@ static struct platform_device bfin_device_gpiokeys = {
1702#endif 1693#endif
1703 1694
1704static struct spi_board_info bfin_spi_board_info[] __initdata = { 1695static struct spi_board_info bfin_spi_board_info[] __initdata = {
1705#if defined(CONFIG_MTD_M25P80) \ 1696#if IS_ENABLED(CONFIG_MTD_M25P80)
1706 || defined(CONFIG_MTD_M25P80_MODULE)
1707 { 1697 {
1708 /* the modalias must be the same as spi device driver name */ 1698 /* the modalias must be the same as spi device driver name */
1709 .modalias = "m25p80", /* Name of spi_driver for this device */ 1699 .modalias = "m25p80", /* Name of spi_driver for this device */
@@ -1715,7 +1705,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1715 .mode = SPI_MODE_3, 1705 .mode = SPI_MODE_3,
1716 }, 1706 },
1717#endif 1707#endif
1718#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE) 1708#if IS_ENABLED(CONFIG_TOUCHSCREEN_AD7877)
1719 { 1709 {
1720 .modalias = "ad7877", 1710 .modalias = "ad7877",
1721 .platform_data = &bfin_ad7877_ts_info, 1711 .platform_data = &bfin_ad7877_ts_info,
@@ -1725,7 +1715,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1725 .chip_select = MAX_CTRL_CS + GPIO_PC15, /* SPI_SSEL4 */ 1715 .chip_select = MAX_CTRL_CS + GPIO_PC15, /* SPI_SSEL4 */
1726 }, 1716 },
1727#endif 1717#endif
1728#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 1718#if IS_ENABLED(CONFIG_SPI_SPIDEV)
1729 { 1719 {
1730 .modalias = "spidev", 1720 .modalias = "spidev",
1731 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 1721 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
@@ -1734,7 +1724,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
1734 .controller_data = &spidev_chip_info, 1724 .controller_data = &spidev_chip_info,
1735 }, 1725 },
1736#endif 1726#endif
1737#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE) 1727#if IS_ENABLED(CONFIG_INPUT_ADXL34X_SPI)
1738 { 1728 {
1739 .modalias = "adxl34x", 1729 .modalias = "adxl34x",
1740 .platform_data = &adxl34x_info, 1730 .platform_data = &adxl34x_info,
@@ -1818,7 +1808,7 @@ static struct platform_device bf60x_spi_master1 = {
1818}; 1808};
1819#endif /* spi master and devices */ 1809#endif /* spi master and devices */
1820 1810
1821#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 1811#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
1822static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0}; 1812static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
1823 1813
1824static struct resource bfin_twi0_resource[] = { 1814static struct resource bfin_twi0_resource[] = {
@@ -1871,20 +1861,20 @@ static struct platform_device i2c_bfin_twi1_device = {
1871#endif 1861#endif
1872 1862
1873static struct i2c_board_info __initdata bfin_i2c_board_info0[] = { 1863static struct i2c_board_info __initdata bfin_i2c_board_info0[] = {
1874#if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE) 1864#if IS_ENABLED(CONFIG_INPUT_ADXL34X_I2C)
1875 { 1865 {
1876 I2C_BOARD_INFO("adxl34x", 0x53), 1866 I2C_BOARD_INFO("adxl34x", 0x53),
1877 .irq = IRQ_PC5, 1867 .irq = IRQ_PC5,
1878 .platform_data = (void *)&adxl34x_info, 1868 .platform_data = (void *)&adxl34x_info,
1879 }, 1869 },
1880#endif 1870#endif
1881#if defined(CONFIG_SND_SOC_ADAU1761) || defined(CONFIG_SND_SOC_ADAU1761_MODULE) 1871#if IS_ENABLED(CONFIG_SND_SOC_ADAU1761)
1882 { 1872 {
1883 I2C_BOARD_INFO("adau1761", 0x38), 1873 I2C_BOARD_INFO("adau1761", 0x38),
1884 .platform_data = (void *)&adau1761_info 1874 .platform_data = (void *)&adau1761_info
1885 }, 1875 },
1886#endif 1876#endif
1887#if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE) 1877#if IS_ENABLED(CONFIG_SND_SOC_SSM2602)
1888 { 1878 {
1889 I2C_BOARD_INFO("ssm2602", 0x1b), 1879 I2C_BOARD_INFO("ssm2602", 0x1b),
1890 }, 1880 },
@@ -1942,11 +1932,11 @@ static struct platform_device *ezkit_devices[] __initdata = {
1942 &bfin_gpg_device, 1932 &bfin_gpg_device,
1943#endif 1933#endif
1944 1934
1945#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 1935#if IS_ENABLED(CONFIG_RTC_DRV_BFIN)
1946 &rtc_device, 1936 &rtc_device,
1947#endif 1937#endif
1948 1938
1949#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 1939#if IS_ENABLED(CONFIG_SERIAL_BFIN)
1950#ifdef CONFIG_SERIAL_BFIN_UART0 1940#ifdef CONFIG_SERIAL_BFIN_UART0
1951 &bfin_uart0_device, 1941 &bfin_uart0_device,
1952#endif 1942#endif
@@ -1955,7 +1945,7 @@ static struct platform_device *ezkit_devices[] __initdata = {
1955#endif 1945#endif
1956#endif 1946#endif
1957 1947
1958#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 1948#if IS_ENABLED(CONFIG_BFIN_SIR)
1959#ifdef CONFIG_BFIN_SIR0 1949#ifdef CONFIG_BFIN_SIR0
1960 &bfin_sir0_device, 1950 &bfin_sir0_device,
1961#endif 1951#endif
@@ -1964,19 +1954,19 @@ static struct platform_device *ezkit_devices[] __initdata = {
1964#endif 1954#endif
1965#endif 1955#endif
1966 1956
1967#if defined(CONFIG_STMMAC_ETH) || defined(CONFIG_STMMAC_ETH_MODULE) 1957#if IS_ENABLED(CONFIG_STMMAC_ETH)
1968 &bfin_eth_device, 1958 &bfin_eth_device,
1969#endif 1959#endif
1970 1960
1971#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 1961#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
1972 &musb_device, 1962 &musb_device,
1973#endif 1963#endif
1974 1964
1975#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) 1965#if IS_ENABLED(CONFIG_USB_ISP1760_HCD)
1976 &bfin_isp1760_device, 1966 &bfin_isp1760_device,
1977#endif 1967#endif
1978 1968
1979#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 1969#if IS_ENABLED(CONFIG_SERIAL_BFIN_SPORT)
1980#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 1970#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1981 &bfin_sport0_uart_device, 1971 &bfin_sport0_uart_device,
1982#endif 1972#endif
@@ -1988,15 +1978,15 @@ static struct platform_device *ezkit_devices[] __initdata = {
1988#endif 1978#endif
1989#endif 1979#endif
1990 1980
1991#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE) 1981#if IS_ENABLED(CONFIG_CAN_BFIN)
1992 &bfin_can0_device, 1982 &bfin_can0_device,
1993#endif 1983#endif
1994 1984
1995#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE) 1985#if IS_ENABLED(CONFIG_MTD_NAND_BF5XX)
1996 &bfin_nand_device, 1986 &bfin_nand_device,
1997#endif 1987#endif
1998 1988
1999#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) 1989#if IS_ENABLED(CONFIG_SDH_BFIN)
2000 &bfin_sdh_device, 1990 &bfin_sdh_device,
2001#endif 1991#endif
2002 1992
@@ -2005,11 +1995,11 @@ static struct platform_device *ezkit_devices[] __initdata = {
2005 &bf60x_spi_master1, 1995 &bf60x_spi_master1,
2006#endif 1996#endif
2007 1997
2008#if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE) 1998#if IS_ENABLED(CONFIG_INPUT_BFIN_ROTARY)
2009 &bfin_rotary_device, 1999 &bfin_rotary_device,
2010#endif 2000#endif
2011 2001
2012#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 2002#if IS_ENABLED(CONFIG_I2C_BLACKFIN_TWI)
2013 &i2c_bfin_twi0_device, 2003 &i2c_bfin_twi0_device,
2014#if !defined(CONFIG_BF542) 2004#if !defined(CONFIG_BF542)
2015 &i2c_bfin_twi1_device, 2005 &i2c_bfin_twi1_device,
@@ -2024,34 +2014,29 @@ static struct platform_device *ezkit_devices[] __initdata = {
2024 &bfin_crypto_crc_device, 2014 &bfin_crypto_crc_device,
2025#endif 2015#endif
2026 2016
2027#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 2017#if IS_ENABLED(CONFIG_KEYBOARD_GPIO)
2028 &bfin_device_gpiokeys, 2018 &bfin_device_gpiokeys,
2029#endif 2019#endif
2030 2020
2031#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 2021#if IS_ENABLED(CONFIG_MTD_PHYSMAP)
2032 &ezkit_flash_device, 2022 &ezkit_flash_device,
2033#endif 2023#endif
2034#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) 2024#if IS_ENABLED(CONFIG_SND_BF5XX_I2S)
2035 &bfin_i2s_pcm, 2025 &bfin_i2s_pcm,
2036#endif 2026#endif
2037#if defined(CONFIG_SND_BF6XX_SOC_I2S) || \ 2027#if IS_ENABLED(CONFIG_SND_BF6XX_SOC_I2S)
2038 defined(CONFIG_SND_BF6XX_SOC_I2S_MODULE)
2039 &bfin_i2s, 2028 &bfin_i2s,
2040#endif 2029#endif
2041#if defined(CONFIG_SND_BF5XX_SOC_AD1836) || \ 2030#if IS_ENABLED(CONFIG_SND_BF5XX_SOC_AD1836)
2042 defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
2043 &bfin_ad1836_machine, 2031 &bfin_ad1836_machine,
2044#endif 2032#endif
2045#if defined(CONFIG_SND_SOC_BFIN_EVAL_ADAU1X61) || \ 2033#if IS_ENABLED(CONFIG_SND_SOC_BFIN_EVAL_ADAU1X61)
2046 defined(CONFIG_SND_SOC_BFIN_EVAL_ADAU1X61_MODULE)
2047 &adau1761_device, 2034 &adau1761_device,
2048#endif 2035#endif
2049#if defined(CONFIG_VIDEO_BLACKFIN_CAPTURE) \ 2036#if IS_ENABLED(CONFIG_VIDEO_BLACKFIN_CAPTURE)
2050 || defined(CONFIG_VIDEO_BLACKFIN_CAPTURE_MODULE)
2051 &bfin_capture_device, 2037 &bfin_capture_device,
2052#endif 2038#endif
2053#if defined(CONFIG_VIDEO_BLACKFIN_DISPLAY) \ 2039#if IS_ENABLED(CONFIG_VIDEO_BLACKFIN_DISPLAY)
2054 || defined(CONFIG_VIDEO_BLACKFIN_DISPLAY_MODULE)
2055 &bfin_display_device, 2040 &bfin_display_device,
2056#endif 2041#endif
2057 2042
@@ -2075,9 +2060,9 @@ static struct pinctrl_map __initdata bfin_pinmux_map[] = {
2075 PIN_MAP_MUX_GROUP_DEFAULT("physmap-flash.0", "pinctrl-adi2.0", NULL, "smc0"), 2060 PIN_MAP_MUX_GROUP_DEFAULT("physmap-flash.0", "pinctrl-adi2.0", NULL, "smc0"),
2076 PIN_MAP_MUX_GROUP_DEFAULT("bf609_nl8048.2", "pinctrl-adi2.0", NULL, "ppi2_16b"), 2061 PIN_MAP_MUX_GROUP_DEFAULT("bf609_nl8048.2", "pinctrl-adi2.0", NULL, "ppi2_16b"),
2077 PIN_MAP_MUX_GROUP_DEFAULT("bfin_display.0", "pinctrl-adi2.0", NULL, "ppi0_16b"), 2062 PIN_MAP_MUX_GROUP_DEFAULT("bfin_display.0", "pinctrl-adi2.0", NULL, "ppi0_16b"),
2078#if defined(CONFIG_VIDEO_MT9M114) || defined(CONFIG_VIDEO_MT9M114_MODULE) 2063#if IS_ENABLED(CONFIG_VIDEO_MT9M114)
2079 PIN_MAP_MUX_GROUP_DEFAULT("bfin_capture.0", "pinctrl-adi2.0", NULL, "ppi0_8b"), 2064 PIN_MAP_MUX_GROUP_DEFAULT("bfin_capture.0", "pinctrl-adi2.0", NULL, "ppi0_8b"),
2080#elif defined(CONFIG_VIDEO_VS6624) || defined(CONFIG_VIDEO_VS6624_MODULE) 2065#elif IS_ENABLED(CONFIG_VIDEO_VS6624)
2081 PIN_MAP_MUX_GROUP_DEFAULT("bfin_capture.0", "pinctrl-adi2.0", NULL, "ppi0_16b"), 2066 PIN_MAP_MUX_GROUP_DEFAULT("bfin_capture.0", "pinctrl-adi2.0", NULL, "ppi0_16b"),
2082#else 2067#else
2083 PIN_MAP_MUX_GROUP_DEFAULT("bfin_capture.0", "pinctrl-adi2.0", NULL, "ppi0_24b"), 2068 PIN_MAP_MUX_GROUP_DEFAULT("bfin_capture.0", "pinctrl-adi2.0", NULL, "ppi0_24b"),
diff --git a/arch/blackfin/mach-bf609/clock.c b/arch/blackfin/mach-bf609/clock.c
index 13644ed25489..56200f37cfc8 100644
--- a/arch/blackfin/mach-bf609/clock.c
+++ b/arch/blackfin/mach-bf609/clock.c
@@ -73,24 +73,6 @@ static void clk_reg_write_mask(u32 reg, uint32_t val, uint32_t mask)
73 bfin_write32(reg, val2); 73 bfin_write32(reg, val2);
74} 74}
75 75
76static void clk_reg_set_bits(u32 reg, uint32_t mask)
77{
78 u32 val;
79
80 val = bfin_read32(reg);
81 val |= mask;
82 bfin_write32(reg, val);
83}
84
85static void clk_reg_clear_bits(u32 reg, uint32_t mask)
86{
87 u32 val;
88
89 val = bfin_read32(reg);
90 val &= ~mask;
91 bfin_write32(reg, val);
92}
93
94int wait_for_pll_align(void) 76int wait_for_pll_align(void)
95{ 77{
96 int i = 10000; 78 int i = 10000;
diff --git a/arch/blackfin/mach-bf609/pm.c b/arch/blackfin/mach-bf609/pm.c
index ad505d9db4a8..0cdd6955c7be 100644
--- a/arch/blackfin/mach-bf609/pm.c
+++ b/arch/blackfin/mach-bf609/pm.c
@@ -210,7 +210,7 @@ void bf609_cpu_pm_enter(suspend_state_t state)
210 210
211#ifdef CONFIG_PM_BFIN_WAKE_PB15 211#ifdef CONFIG_PM_BFIN_WAKE_PB15
212 wakeup |= PB15WE; 212 wakeup |= PB15WE;
213# if CONFIG_PM_BFIN_WAKE_PA15_POL 213# if CONFIG_PM_BFIN_WAKE_PB15_POL
214 wakeup_pol |= PB15WE; 214 wakeup_pol |= PB15WE;
215# endif 215# endif
216#endif 216#endif
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index ed0fcdf7e990..52731e221851 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -29,7 +29,7 @@ config GENERIC_CALIBRATE_DELAY
29 bool 29 bool
30 default y 30 default y
31 31
32config NO_IOPORT 32config NO_IOPORT_MAP
33 def_bool y 33 def_bool y
34 34
35config FORCE_MAX_ZONEORDER 35config FORCE_MAX_ZONEORDER
@@ -138,6 +138,7 @@ config ETRAX_ARCH_V10
138 bool 138 bool
139 default y if ETRAX100LX || ETRAX100LX_V2 139 default y if ETRAX100LX || ETRAX100LX_V2
140 default n if !(ETRAX100LX || ETRAX100LX_V2) 140 default n if !(ETRAX100LX || ETRAX100LX_V2)
141 select TTY
141 142
142config ETRAX_ARCH_V32 143config ETRAX_ARCH_V32
143 bool 144 bool
diff --git a/arch/cris/arch-v32/drivers/Kconfig b/arch/cris/arch-v32/drivers/Kconfig
index 6792503aaf79..15a9ed1d579c 100644
--- a/arch/cris/arch-v32/drivers/Kconfig
+++ b/arch/cris/arch-v32/drivers/Kconfig
@@ -11,7 +11,6 @@ config ETRAX_ETHERNET
11config ETRAX_NO_PHY 11config ETRAX_NO_PHY
12 bool "PHY not present" 12 bool "PHY not present"
13 depends on ETRAX_ETHERNET 13 depends on ETRAX_ETHERNET
14 default N
15 help 14 help
16 This option disables all MDIO communication with an ethernet 15 This option disables all MDIO communication with an ethernet
17 transceiver connected to the MII interface. This option shall 16 transceiver connected to the MII interface. This option shall
@@ -116,7 +115,6 @@ config ETRAX_AXISFLASHMAP
116config ETRAX_AXISFLASHMAP_MTD0WHOLE 115config ETRAX_AXISFLASHMAP_MTD0WHOLE
117 bool "MTD0 is whole boot flash device" 116 bool "MTD0 is whole boot flash device"
118 depends on ETRAX_AXISFLASHMAP 117 depends on ETRAX_AXISFLASHMAP
119 default N
120 help 118 help
121 When this option is not set, mtd0 refers to the first partition 119 When this option is not set, mtd0 refers to the first partition
122 on the boot flash device. When set, mtd0 refers to the whole 120 on the boot flash device. When set, mtd0 refers to the whole
diff --git a/arch/cris/kernel/setup.c b/arch/cris/kernel/setup.c
index 32c3d248868e..905b70ea9939 100644
--- a/arch/cris/kernel/setup.c
+++ b/arch/cris/kernel/setup.c
@@ -165,6 +165,7 @@ void __init setup_arch(char **cmdline_p)
165 strcpy(init_utsname()->machine, cris_machine_name); 165 strcpy(init_utsname()->machine, cris_machine_name);
166} 166}
167 167
168#ifdef CONFIG_PROC_FS
168static void *c_start(struct seq_file *m, loff_t *pos) 169static void *c_start(struct seq_file *m, loff_t *pos)
169{ 170{
170 return *pos < nr_cpu_ids ? (void *)(int)(*pos + 1) : NULL; 171 return *pos < nr_cpu_ids ? (void *)(int)(*pos + 1) : NULL;
@@ -188,6 +189,7 @@ const struct seq_operations cpuinfo_op = {
188 .stop = c_stop, 189 .stop = c_stop,
189 .show = show_cpuinfo, 190 .show = show_cpuinfo,
190}; 191};
192#endif /* CONFIG_PROC_FS */
191 193
192static int __init topology_init(void) 194static int __init topology_init(void)
193{ 195{
diff --git a/arch/frv/mb93090-mb00/pci-frv.c b/arch/frv/mb93090-mb00/pci-frv.c
index c28121765448..67b1d1685759 100644
--- a/arch/frv/mb93090-mb00/pci-frv.c
+++ b/arch/frv/mb93090-mb00/pci-frv.c
@@ -88,7 +88,7 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
88 88
89 /* Depth-First Search on bus tree */ 89 /* Depth-First Search on bus tree */
90 for (ln=bus_list->next; ln != bus_list; ln=ln->next) { 90 for (ln=bus_list->next; ln != bus_list; ln=ln->next) {
91 bus = pci_bus_b(ln); 91 bus = list_entry(ln, struct pci_bus, node);
92 if ((dev = bus->self)) { 92 if ((dev = bus->self)) {
93 for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) { 93 for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) {
94 r = &dev->resource[idx]; 94 r = &dev->resource[idx];
diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig
index 09df2608f40a..0fd6138f6203 100644
--- a/arch/hexagon/Kconfig
+++ b/arch/hexagon/Kconfig
@@ -19,7 +19,7 @@ config HEXAGON
19 select GENERIC_IRQ_SHOW 19 select GENERIC_IRQ_SHOW
20 select HAVE_ARCH_KGDB 20 select HAVE_ARCH_KGDB
21 select HAVE_ARCH_TRACEHOOK 21 select HAVE_ARCH_TRACEHOOK
22 select NO_IOPORT 22 select NO_IOPORT_MAP
23 select GENERIC_IOMAP 23 select GENERIC_IOMAP
24 select GENERIC_SMP_IDLE_THREAD 24 select GENERIC_SMP_IDLE_THREAD
25 select STACKTRACE_SUPPORT 25 select STACKTRACE_SUPPORT
@@ -28,6 +28,7 @@ config HEXAGON
28 select GENERIC_CLOCKEVENTS_BROADCAST 28 select GENERIC_CLOCKEVENTS_BROADCAST
29 select MODULES_USE_ELF_RELA 29 select MODULES_USE_ELF_RELA
30 select GENERIC_CPU_DEVICES 30 select GENERIC_CPU_DEVICES
31 select HAVE_DMA_ATTRS
31 ---help--- 32 ---help---
32 Qualcomm Hexagon is a processor architecture designed for high 33 Qualcomm Hexagon is a processor architecture designed for high
33 performance and low power across a wide variety of applications. 34 performance and low power across a wide variety of applications.
diff --git a/arch/hexagon/include/asm/Kbuild b/arch/hexagon/include/asm/Kbuild
index eadcc118f950..0e69796b58c7 100644
--- a/arch/hexagon/include/asm/Kbuild
+++ b/arch/hexagon/include/asm/Kbuild
@@ -41,6 +41,7 @@ generic-y += scatterlist.h
41generic-y += sections.h 41generic-y += sections.h
42generic-y += segment.h 42generic-y += segment.h
43generic-y += sembuf.h 43generic-y += sembuf.h
44generic-y += serial.h
44generic-y += shmbuf.h 45generic-y += shmbuf.h
45generic-y += shmparam.h 46generic-y += shmparam.h
46generic-y += siginfo.h 47generic-y += siginfo.h
@@ -56,4 +57,5 @@ generic-y += trace_clock.h
56generic-y += types.h 57generic-y += types.h
57generic-y += ucontext.h 58generic-y += ucontext.h
58generic-y += unaligned.h 59generic-y += unaligned.h
60generic-y += vga.h
59generic-y += xor.h 61generic-y += xor.h
diff --git a/arch/hexagon/include/asm/atomic.h b/arch/hexagon/include/asm/atomic.h
index 7aae4cb2a29a..17dc63780c06 100644
--- a/arch/hexagon/include/asm/atomic.h
+++ b/arch/hexagon/include/asm/atomic.h
@@ -26,7 +26,20 @@
26#include <asm/cmpxchg.h> 26#include <asm/cmpxchg.h>
27 27
28#define ATOMIC_INIT(i) { (i) } 28#define ATOMIC_INIT(i) { (i) }
29#define atomic_set(v, i) ((v)->counter = (i)) 29
30/* Normal writes in our arch don't clear lock reservations */
31
32static inline void atomic_set(atomic_t *v, int new)
33{
34 asm volatile(
35 "1: r6 = memw_locked(%0);\n"
36 " memw_locked(%0,p0) = %1;\n"
37 " if (!P0) jump 1b;\n"
38 :
39 : "r" (&v->counter), "r" (new)
40 : "memory", "p0", "r6"
41 );
42}
30 43
31/** 44/**
32 * atomic_read - reads a word, atomically 45 * atomic_read - reads a word, atomically
diff --git a/arch/hexagon/include/asm/delay.h b/arch/hexagon/include/asm/delay.h
index 53079719d667..8933b9b1a3bf 100644
--- a/arch/hexagon/include/asm/delay.h
+++ b/arch/hexagon/include/asm/delay.h
@@ -21,6 +21,7 @@
21 21
22#include <asm/param.h> 22#include <asm/param.h>
23 23
24extern void __delay(unsigned long cycles);
24extern void __udelay(unsigned long usecs); 25extern void __udelay(unsigned long usecs);
25 26
26#define udelay(usecs) __udelay((usecs)) 27#define udelay(usecs) __udelay((usecs))
diff --git a/arch/hexagon/include/asm/dma-mapping.h b/arch/hexagon/include/asm/dma-mapping.h
index 85e9935660cb..16965427f6b4 100644
--- a/arch/hexagon/include/asm/dma-mapping.h
+++ b/arch/hexagon/include/asm/dma-mapping.h
@@ -25,7 +25,6 @@
25#include <linux/cache.h> 25#include <linux/cache.h>
26#include <linux/mm.h> 26#include <linux/mm.h>
27#include <linux/scatterlist.h> 27#include <linux/scatterlist.h>
28#include <linux/dma-mapping.h>
29#include <linux/dma-debug.h> 28#include <linux/dma-debug.h>
30#include <linux/dma-attrs.h> 29#include <linux/dma-attrs.h>
31#include <asm/io.h> 30#include <asm/io.h>
diff --git a/arch/hexagon/include/asm/elf.h b/arch/hexagon/include/asm/elf.h
index e1b933a0e121..80311e7b8ca6 100644
--- a/arch/hexagon/include/asm/elf.h
+++ b/arch/hexagon/include/asm/elf.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * ELF definitions for the Hexagon architecture 2 * ELF definitions for the Hexagon architecture
3 * 3 *
4 * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved. 4 * Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 and 7 * it under the terms of the GNU General Public License version 2 and
@@ -202,7 +202,7 @@ do { \
202#define CORE_DUMP_USE_REGSET 202#define CORE_DUMP_USE_REGSET
203 203
204/* Hrm is this going to cause problems for changing PAGE_SIZE? */ 204/* Hrm is this going to cause problems for changing PAGE_SIZE? */
205#define ELF_EXEC_PAGESIZE 4096 205#define ELF_EXEC_PAGESIZE PAGE_SIZE
206 206
207/* 207/*
208 * This is the location that an ET_DYN program is loaded if exec'ed. Typical 208 * This is the location that an ET_DYN program is loaded if exec'ed. Typical
diff --git a/arch/hexagon/include/asm/hexagon_vm.h b/arch/hexagon/include/asm/hexagon_vm.h
index 67bb6d6f3337..1f6918b428de 100644
--- a/arch/hexagon/include/asm/hexagon_vm.h
+++ b/arch/hexagon/include/asm/hexagon_vm.h
@@ -55,27 +55,27 @@
55#ifndef __ASSEMBLY__ 55#ifndef __ASSEMBLY__
56 56
57enum VM_CACHE_OPS { 57enum VM_CACHE_OPS {
58 ickill, 58 hvmc_ickill,
59 dckill, 59 hvmc_dckill,
60 l2kill, 60 hvmc_l2kill,
61 dccleaninva, 61 hvmc_dccleaninva,
62 icinva, 62 hvmc_icinva,
63 idsync, 63 hvmc_idsync,
64 fetch_cfg 64 hvmc_fetch_cfg
65}; 65};
66 66
67enum VM_INT_OPS { 67enum VM_INT_OPS {
68 nop, 68 hvmi_nop,
69 globen, 69 hvmi_globen,
70 globdis, 70 hvmi_globdis,
71 locen, 71 hvmi_locen,
72 locdis, 72 hvmi_locdis,
73 affinity, 73 hvmi_affinity,
74 get, 74 hvmi_get,
75 peek, 75 hvmi_peek,
76 status, 76 hvmi_status,
77 post, 77 hvmi_post,
78 clear 78 hvmi_clear
79}; 79};
80 80
81extern void _K_VM_event_vector(void); 81extern void _K_VM_event_vector(void);
@@ -98,95 +98,95 @@ long __vmvpid(void);
98 98
99static inline long __vmcache_ickill(void) 99static inline long __vmcache_ickill(void)
100{ 100{
101 return __vmcache(ickill, 0, 0); 101 return __vmcache(hvmc_ickill, 0, 0);
102} 102}
103 103
104static inline long __vmcache_dckill(void) 104static inline long __vmcache_dckill(void)
105{ 105{
106 return __vmcache(dckill, 0, 0); 106 return __vmcache(hvmc_dckill, 0, 0);
107} 107}
108 108
109static inline long __vmcache_l2kill(void) 109static inline long __vmcache_l2kill(void)
110{ 110{
111 return __vmcache(l2kill, 0, 0); 111 return __vmcache(hvmc_l2kill, 0, 0);
112} 112}
113 113
114static inline long __vmcache_dccleaninva(unsigned long addr, unsigned long len) 114static inline long __vmcache_dccleaninva(unsigned long addr, unsigned long len)
115{ 115{
116 return __vmcache(dccleaninva, addr, len); 116 return __vmcache(hvmc_dccleaninva, addr, len);
117} 117}
118 118
119static inline long __vmcache_icinva(unsigned long addr, unsigned long len) 119static inline long __vmcache_icinva(unsigned long addr, unsigned long len)
120{ 120{
121 return __vmcache(icinva, addr, len); 121 return __vmcache(hvmc_icinva, addr, len);
122} 122}
123 123
124static inline long __vmcache_idsync(unsigned long addr, 124static inline long __vmcache_idsync(unsigned long addr,
125 unsigned long len) 125 unsigned long len)
126{ 126{
127 return __vmcache(idsync, addr, len); 127 return __vmcache(hvmc_idsync, addr, len);
128} 128}
129 129
130static inline long __vmcache_fetch_cfg(unsigned long val) 130static inline long __vmcache_fetch_cfg(unsigned long val)
131{ 131{
132 return __vmcache(fetch_cfg, val, 0); 132 return __vmcache(hvmc_fetch_cfg, val, 0);
133} 133}
134 134
135/* interrupt operations */ 135/* interrupt operations */
136 136
137static inline long __vmintop_nop(void) 137static inline long __vmintop_nop(void)
138{ 138{
139 return __vmintop(nop, 0, 0, 0, 0); 139 return __vmintop(hvmi_nop, 0, 0, 0, 0);
140} 140}
141 141
142static inline long __vmintop_globen(long i) 142static inline long __vmintop_globen(long i)
143{ 143{
144 return __vmintop(globen, i, 0, 0, 0); 144 return __vmintop(hvmi_globen, i, 0, 0, 0);
145} 145}
146 146
147static inline long __vmintop_globdis(long i) 147static inline long __vmintop_globdis(long i)
148{ 148{
149 return __vmintop(globdis, i, 0, 0, 0); 149 return __vmintop(hvmi_globdis, i, 0, 0, 0);
150} 150}
151 151
152static inline long __vmintop_locen(long i) 152static inline long __vmintop_locen(long i)
153{ 153{
154 return __vmintop(locen, i, 0, 0, 0); 154 return __vmintop(hvmi_locen, i, 0, 0, 0);
155} 155}
156 156
157static inline long __vmintop_locdis(long i) 157static inline long __vmintop_locdis(long i)
158{ 158{
159 return __vmintop(locdis, i, 0, 0, 0); 159 return __vmintop(hvmi_locdis, i, 0, 0, 0);
160} 160}
161 161
162static inline long __vmintop_affinity(long i, long cpu) 162static inline long __vmintop_affinity(long i, long cpu)
163{ 163{
164 return __vmintop(locdis, i, cpu, 0, 0); 164 return __vmintop(hvmi_affinity, i, cpu, 0, 0);
165} 165}
166 166
167static inline long __vmintop_get(void) 167static inline long __vmintop_get(void)
168{ 168{
169 return __vmintop(get, 0, 0, 0, 0); 169 return __vmintop(hvmi_get, 0, 0, 0, 0);
170} 170}
171 171
172static inline long __vmintop_peek(void) 172static inline long __vmintop_peek(void)
173{ 173{
174 return __vmintop(peek, 0, 0, 0, 0); 174 return __vmintop(hvmi_peek, 0, 0, 0, 0);
175} 175}
176 176
177static inline long __vmintop_status(long i) 177static inline long __vmintop_status(long i)
178{ 178{
179 return __vmintop(status, i, 0, 0, 0); 179 return __vmintop(hvmi_status, i, 0, 0, 0);
180} 180}
181 181
182static inline long __vmintop_post(long i) 182static inline long __vmintop_post(long i)
183{ 183{
184 return __vmintop(post, i, 0, 0, 0); 184 return __vmintop(hvmi_post, i, 0, 0, 0);
185} 185}
186 186
187static inline long __vmintop_clear(long i) 187static inline long __vmintop_clear(long i)
188{ 188{
189 return __vmintop(clear, i, 0, 0, 0); 189 return __vmintop(hvmi_clear, i, 0, 0, 0);
190} 190}
191 191
192#else /* Only assembly code should reference these */ 192#else /* Only assembly code should reference these */
diff --git a/arch/hexagon/include/asm/io.h b/arch/hexagon/include/asm/io.h
index 1b7698e19139..70298996e9b2 100644
--- a/arch/hexagon/include/asm/io.h
+++ b/arch/hexagon/include/asm/io.h
@@ -189,6 +189,8 @@ static inline void writel(u32 data, volatile void __iomem *addr)
189#define writew_relaxed __raw_writew 189#define writew_relaxed __raw_writew
190#define writel_relaxed __raw_writel 190#define writel_relaxed __raw_writel
191 191
192#define mmiowb()
193
192/* 194/*
193 * Need an mtype somewhere in here, for cache type deals? 195 * Need an mtype somewhere in here, for cache type deals?
194 * This is probably too long for an inline. 196 * This is probably too long for an inline.
diff --git a/arch/hexagon/include/asm/kgdb.h b/arch/hexagon/include/asm/kgdb.h
index 32a6fb66944a..ccd3ac336b24 100644
--- a/arch/hexagon/include/asm/kgdb.h
+++ b/arch/hexagon/include/asm/kgdb.h
@@ -34,10 +34,11 @@ static inline void arch_kgdb_breakpoint(void)
34 * 32 gpr + sa0/1 + lc0/1 + m0/1 + gp + ugp + pred + pc = 42 total. 34 * 32 gpr + sa0/1 + lc0/1 + m0/1 + gp + ugp + pred + pc = 42 total.
35 * vm regs = psp+elr+est+badva = 4 35 * vm regs = psp+elr+est+badva = 4
36 * syscall+restart = 2 more 36 * syscall+restart = 2 more
37 * so 48 = 42 +4 + 2 37 * also add cs0/1 = 2
38 * so 48 = 42 + 4 + 2 + 2
38 */ 39 */
39#define DBG_USER_REGS 42 40#define DBG_USER_REGS 42
40#define DBG_MAX_REG_NUM (DBG_USER_REGS + 6) 41#define DBG_MAX_REG_NUM (DBG_USER_REGS + 8)
41#define NUMREGBYTES (DBG_MAX_REG_NUM*4) 42#define NUMREGBYTES (DBG_MAX_REG_NUM*4)
42 43
43#endif /* __HEXAGON_KGDB_H__ */ 44#endif /* __HEXAGON_KGDB_H__ */
diff --git a/arch/hexagon/include/asm/pgalloc.h b/arch/hexagon/include/asm/pgalloc.h
index 4c9d382d7798..77da3b0ae3c2 100644
--- a/arch/hexagon/include/asm/pgalloc.h
+++ b/arch/hexagon/include/asm/pgalloc.h
@@ -45,7 +45,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
45 * map with a copy of the kernel's persistent map. 45 * map with a copy of the kernel's persistent map.
46 */ 46 */
47 47
48 memcpy(pgd, swapper_pg_dir, PTRS_PER_PGD*sizeof(pgd_t *)); 48 memcpy(pgd, swapper_pg_dir, PTRS_PER_PGD*sizeof(pgd_t));
49 mm->context.generation = kmap_generation; 49 mm->context.generation = kmap_generation;
50 50
51 /* Physical version is what is passed to virtual machine on switch */ 51 /* Physical version is what is passed to virtual machine on switch */
diff --git a/arch/hexagon/include/asm/smp.h b/arch/hexagon/include/asm/smp.h
index 2b9b974e0952..ca171c13891d 100644
--- a/arch/hexagon/include/asm/smp.h
+++ b/arch/hexagon/include/asm/smp.h
@@ -29,7 +29,6 @@ enum ipi_message_type {
29 IPI_NOP = 0, 29 IPI_NOP = 0,
30 IPI_RESCHEDULE = 1, 30 IPI_RESCHEDULE = 1,
31 IPI_CALL_FUNC, 31 IPI_CALL_FUNC,
32 IPI_CALL_FUNC_SINGLE,
33 IPI_CPU_STOP, 32 IPI_CPU_STOP,
34 IPI_TIMER, 33 IPI_TIMER,
35}; 34};
diff --git a/arch/hexagon/include/uapi/asm/registers.h b/arch/hexagon/include/uapi/asm/registers.h
index 487d6ceca5e7..e7be31840a90 100644
--- a/arch/hexagon/include/uapi/asm/registers.h
+++ b/arch/hexagon/include/uapi/asm/registers.h
@@ -6,8 +6,6 @@
6#ifndef _ASM_REGISTERS_H 6#ifndef _ASM_REGISTERS_H
7#define _ASM_REGISTERS_H 7#define _ASM_REGISTERS_H
8 8
9#define SP r29
10
11#ifndef __ASSEMBLY__ 9#ifndef __ASSEMBLY__
12 10
13/* See kernel/entry.S for further documentation. */ 11/* See kernel/entry.S for further documentation. */
@@ -215,7 +213,7 @@ struct pt_regs {
215#define pt_clr_singlestep(regs) ((regs)->hvmer.vmest &= ~(1<<HVM_VMEST_SS_SFT)) 213#define pt_clr_singlestep(regs) ((regs)->hvmer.vmest &= ~(1<<HVM_VMEST_SS_SFT))
216 214
217#define pt_set_rte_sp(regs, sp) do {\ 215#define pt_set_rte_sp(regs, sp) do {\
218 pt_psp(regs) = (regs)->SP = (sp);\ 216 pt_psp(regs) = (regs)->r29 = (sp);\
219 } while (0) 217 } while (0)
220 218
221#define pt_set_kmode(regs) \ 219#define pt_set_kmode(regs) \
diff --git a/arch/hexagon/include/uapi/asm/setup.h b/arch/hexagon/include/uapi/asm/setup.h
index e48285e4af96..7e3952d6221c 100644
--- a/arch/hexagon/include/uapi/asm/setup.h
+++ b/arch/hexagon/include/uapi/asm/setup.h
@@ -19,7 +19,12 @@
19#ifndef _ASM_SETUP_H 19#ifndef _ASM_SETUP_H
20#define _ASM_SETUP_H 20#define _ASM_SETUP_H
21 21
22#ifdef __KERNEL__
22#include <linux/init.h> 23#include <linux/init.h>
24#else
25#define __init
26#endif
27
23#include <asm-generic/setup.h> 28#include <asm-generic/setup.h>
24 29
25extern char external_cmdline_buffer; 30extern char external_cmdline_buffer;
diff --git a/arch/hexagon/kernel/Makefile b/arch/hexagon/kernel/Makefile
index 29fc933a7722..009228b8611c 100644
--- a/arch/hexagon/kernel/Makefile
+++ b/arch/hexagon/kernel/Makefile
@@ -15,3 +15,5 @@ obj-y += vm_vectors.o
15obj-$(CONFIG_HAS_DMA) += dma.o 15obj-$(CONFIG_HAS_DMA) += dma.o
16 16
17obj-$(CONFIG_STACKTRACE) += stacktrace.o 17obj-$(CONFIG_STACKTRACE) += stacktrace.o
18
19obj-$(CONFIG_VGA_CONSOLE) += screen_info.o
diff --git a/arch/hexagon/kernel/hexagon_ksyms.c b/arch/hexagon/kernel/hexagon_ksyms.c
index 32b1379d6877..c041d8ecb1e2 100644
--- a/arch/hexagon/kernel/hexagon_ksyms.c
+++ b/arch/hexagon/kernel/hexagon_ksyms.c
@@ -18,23 +18,39 @@
18 * 02110-1301, USA. 18 * 02110-1301, USA.
19 */ 19 */
20 20
21#include <linux/dma-mapping.h>
21#include <asm/hexagon_vm.h> 22#include <asm/hexagon_vm.h>
23#include <asm/io.h>
22#include <asm/uaccess.h> 24#include <asm/uaccess.h>
23 25
26/* Additional functions */
27EXPORT_SYMBOL(__clear_user_hexagon);
24EXPORT_SYMBOL(__copy_from_user_hexagon); 28EXPORT_SYMBOL(__copy_from_user_hexagon);
25EXPORT_SYMBOL(__copy_to_user_hexagon); 29EXPORT_SYMBOL(__copy_to_user_hexagon);
30EXPORT_SYMBOL(__iounmap);
31EXPORT_SYMBOL(__strnlen_user);
26EXPORT_SYMBOL(__vmgetie); 32EXPORT_SYMBOL(__vmgetie);
27EXPORT_SYMBOL(__vmsetie); 33EXPORT_SYMBOL(__vmsetie);
34EXPORT_SYMBOL(__vmyield);
35EXPORT_SYMBOL(empty_zero_page);
36EXPORT_SYMBOL(ioremap_nocache);
28EXPORT_SYMBOL(memcpy); 37EXPORT_SYMBOL(memcpy);
29EXPORT_SYMBOL(memset); 38EXPORT_SYMBOL(memset);
30 39
40/* Additional variables */
41EXPORT_SYMBOL(__phys_offset);
42EXPORT_SYMBOL(_dflt_cache_att);
43EXPORT_SYMBOL(bad_dma_address);
44
31#define DECLARE_EXPORT(name) \ 45#define DECLARE_EXPORT(name) \
32 extern void name(void); EXPORT_SYMBOL(name) 46 extern void name(void); EXPORT_SYMBOL(name)
33 47
34/* Symbols found in libgcc that assorted kernel modules need */ 48/* Symbols found in libgcc that assorted kernel modules need */
35DECLARE_EXPORT(__hexagon_memcpy_likely_aligned_min32bytes_mult8bytes); 49DECLARE_EXPORT(__hexagon_memcpy_likely_aligned_min32bytes_mult8bytes);
36 50
37DECLARE_EXPORT(__hexagon_divsi3); 51/* Additional functions */
38DECLARE_EXPORT(__hexagon_modsi3); 52DECLARE_EXPORT(__divsi3);
39DECLARE_EXPORT(__hexagon_udivsi3); 53DECLARE_EXPORT(__modsi3);
40DECLARE_EXPORT(__hexagon_umodsi3); 54DECLARE_EXPORT(__udivsi3);
55DECLARE_EXPORT(__umodsi3);
56DECLARE_EXPORT(csum_tcpudp_magic);
diff --git a/arch/hexagon/kernel/kgdb.c b/arch/hexagon/kernel/kgdb.c
index 82d5c2593323..038580cc5abf 100644
--- a/arch/hexagon/kernel/kgdb.c
+++ b/arch/hexagon/kernel/kgdb.c
@@ -18,6 +18,8 @@
18 * 02110-1301, USA. 18 * 02110-1301, USA.
19 */ 19 */
20 20
21#include <linux/irq.h>
22#include <linux/sched.h>
21#include <linux/kdebug.h> 23#include <linux/kdebug.h>
22#include <linux/kgdb.h> 24#include <linux/kgdb.h>
23 25
diff --git a/arch/hexagon/kernel/ptrace.c b/arch/hexagon/kernel/ptrace.c
index de829eb7f185..390a9ad14ca1 100644
--- a/arch/hexagon/kernel/ptrace.c
+++ b/arch/hexagon/kernel/ptrace.c
@@ -183,6 +183,7 @@ static const struct user_regset_view hexagon_user_view = {
183 .e_machine = ELF_ARCH, 183 .e_machine = ELF_ARCH,
184 .ei_osabi = ELF_OSABI, 184 .ei_osabi = ELF_OSABI,
185 .regsets = hexagon_regsets, 185 .regsets = hexagon_regsets,
186 .e_flags = ELF_CORE_EFLAGS,
186 .n = ARRAY_SIZE(hexagon_regsets) 187 .n = ARRAY_SIZE(hexagon_regsets)
187}; 188};
188 189
diff --git a/arch/hexagon/kernel/reset.c b/arch/hexagon/kernel/reset.c
index 6aeabc962b3b..76483c10130d 100644
--- a/arch/hexagon/kernel/reset.c
+++ b/arch/hexagon/kernel/reset.c
@@ -33,6 +33,5 @@ void machine_restart(char *cmd)
33{ 33{
34} 34}
35 35
36void pm_power_off(void) 36void (*pm_power_off)(void) = NULL;
37{ 37EXPORT_SYMBOL(pm_power_off);
38}
diff --git a/arch/hexagon/kernel/screen_info.c b/arch/hexagon/kernel/screen_info.c
new file mode 100644
index 000000000000..1e1ceb18bafe
--- /dev/null
+++ b/arch/hexagon/kernel/screen_info.c
@@ -0,0 +1,3 @@
1#include <linux/screen_info.h>
2
3struct screen_info screen_info;
diff --git a/arch/hexagon/kernel/smp.c b/arch/hexagon/kernel/smp.c
index 9faaa940452b..ff759f26b96a 100644
--- a/arch/hexagon/kernel/smp.c
+++ b/arch/hexagon/kernel/smp.c
@@ -64,10 +64,6 @@ static inline void __handle_ipi(unsigned long *ops, struct ipi_data *ipi,
64 generic_smp_call_function_interrupt(); 64 generic_smp_call_function_interrupt();
65 break; 65 break;
66 66
67 case IPI_CALL_FUNC_SINGLE:
68 generic_smp_call_function_single_interrupt();
69 break;
70
71 case IPI_CPU_STOP: 67 case IPI_CPU_STOP:
72 /* 68 /*
73 * call vmstop() 69 * call vmstop()
@@ -248,7 +244,7 @@ void smp_send_stop(void)
248 244
249void arch_send_call_function_single_ipi(int cpu) 245void arch_send_call_function_single_ipi(int cpu)
250{ 246{
251 send_ipi(cpumask_of(cpu), IPI_CALL_FUNC_SINGLE); 247 send_ipi(cpumask_of(cpu), IPI_CALL_FUNC);
252} 248}
253 249
254void arch_send_call_function_ipi_mask(const struct cpumask *mask) 250void arch_send_call_function_ipi_mask(const struct cpumask *mask)
diff --git a/arch/hexagon/kernel/time.c b/arch/hexagon/kernel/time.c
index 9903fad997f3..17fbf45bf150 100644
--- a/arch/hexagon/kernel/time.c
+++ b/arch/hexagon/kernel/time.c
@@ -191,9 +191,6 @@ void __init time_init_deferred(void)
191{ 191{
192 struct resource *resource = NULL; 192 struct resource *resource = NULL;
193 struct clock_event_device *ce_dev = &hexagon_clockevent_dev; 193 struct clock_event_device *ce_dev = &hexagon_clockevent_dev;
194 struct device_node *dn;
195 struct resource r;
196 int err;
197 194
198 ce_dev->cpumask = cpu_all_mask; 195 ce_dev->cpumask = cpu_all_mask;
199 196
@@ -232,6 +229,15 @@ void __init time_init(void)
232 late_time_init = time_init_deferred; 229 late_time_init = time_init_deferred;
233} 230}
234 231
232void __delay(unsigned long cycles)
233{
234 unsigned long long start = __vmgettime();
235
236 while ((__vmgettime() - start) < cycles)
237 cpu_relax();
238}
239EXPORT_SYMBOL(__delay);
240
235/* 241/*
236 * This could become parametric or perhaps even computed at run-time, 242 * This could become parametric or perhaps even computed at run-time,
237 * but for now we take the observed simulator jitter. 243 * but for now we take the observed simulator jitter.
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 0c8e553e0b9f..12c3afee0f6f 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -21,6 +21,7 @@ config IA64
21 select HAVE_FUNCTION_TRACER 21 select HAVE_FUNCTION_TRACER
22 select HAVE_DMA_ATTRS 22 select HAVE_DMA_ATTRS
23 select HAVE_KVM 23 select HAVE_KVM
24 select TTY
24 select HAVE_ARCH_TRACEHOOK 25 select HAVE_ARCH_TRACEHOOK
25 select HAVE_DMA_API_DEBUG 26 select HAVE_DMA_API_DEBUG
26 select HAVE_MEMBLOCK 27 select HAVE_MEMBLOCK
@@ -44,6 +45,7 @@ config IA64
44 select HAVE_MOD_ARCH_SPECIFIC 45 select HAVE_MOD_ARCH_SPECIFIC
45 select MODULES_USE_ELF_RELA 46 select MODULES_USE_ELF_RELA
46 select ARCH_USE_CMPXCHG_LOCKREF 47 select ARCH_USE_CMPXCHG_LOCKREF
48 select HAVE_ARCH_AUDITSYSCALL
47 default y 49 default y
48 help 50 help
49 The Itanium Processor Family is Intel's 64-bit successor to 51 The Itanium Processor Family is Intel's 64-bit successor to
diff --git a/arch/ia64/configs/generic_defconfig b/arch/ia64/configs/generic_defconfig
index 6404acbb84b2..b4efaf2bc13e 100644
--- a/arch/ia64/configs/generic_defconfig
+++ b/arch/ia64/configs/generic_defconfig
@@ -25,7 +25,6 @@ CONFIG_KEXEC=y
25CONFIG_CRASH_DUMP=y 25CONFIG_CRASH_DUMP=y
26CONFIG_EFI_VARS=y 26CONFIG_EFI_VARS=y
27CONFIG_BINFMT_MISC=m 27CONFIG_BINFMT_MISC=m
28CONFIG_ACPI_PROCFS=y
29CONFIG_ACPI_BUTTON=m 28CONFIG_ACPI_BUTTON=m
30CONFIG_ACPI_FAN=m 29CONFIG_ACPI_FAN=m
31CONFIG_ACPI_DOCK=y 30CONFIG_ACPI_DOCK=y
diff --git a/arch/ia64/configs/tiger_defconfig b/arch/ia64/configs/tiger_defconfig
index 0f4e9e41f130..0fed9ae5a42a 100644
--- a/arch/ia64/configs/tiger_defconfig
+++ b/arch/ia64/configs/tiger_defconfig
@@ -26,7 +26,6 @@ CONFIG_IA64_PALINFO=y
26CONFIG_KEXEC=y 26CONFIG_KEXEC=y
27CONFIG_EFI_VARS=y 27CONFIG_EFI_VARS=y
28CONFIG_BINFMT_MISC=m 28CONFIG_BINFMT_MISC=m
29CONFIG_ACPI_PROCFS=y
30CONFIG_ACPI_BUTTON=m 29CONFIG_ACPI_BUTTON=m
31CONFIG_ACPI_FAN=m 30CONFIG_ACPI_FAN=m
32CONFIG_ACPI_PROCESSOR=m 31CONFIG_ACPI_PROCESSOR=m
diff --git a/arch/ia64/configs/zx1_defconfig b/arch/ia64/configs/zx1_defconfig
index fc7aba07c2b4..54bc72eda30d 100644
--- a/arch/ia64/configs/zx1_defconfig
+++ b/arch/ia64/configs/zx1_defconfig
@@ -16,7 +16,6 @@ CONFIG_IA64_PALINFO=y
16CONFIG_CRASH_DUMP=y 16CONFIG_CRASH_DUMP=y
17CONFIG_EFI_VARS=y 17CONFIG_EFI_VARS=y
18CONFIG_BINFMT_MISC=y 18CONFIG_BINFMT_MISC=y
19CONFIG_ACPI_PROCFS=y
20CONFIG_HOTPLUG_PCI=y 19CONFIG_HOTPLUG_PCI=y
21CONFIG_HOTPLUG_PCI_ACPI=y 20CONFIG_HOTPLUG_PCI_ACPI=y
22CONFIG_PACKET=y 21CONFIG_PACKET=y
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index 30c43d39dede..1a871b78e570 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -1140,11 +1140,13 @@ sba_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
1140 1140
1141#ifdef CONFIG_NUMA 1141#ifdef CONFIG_NUMA
1142 { 1142 {
1143 int node = ioc->node;
1143 struct page *page; 1144 struct page *page;
1144 page = alloc_pages_exact_node(ioc->node == MAX_NUMNODES ?
1145 numa_node_id() : ioc->node, flags,
1146 get_order(size));
1147 1145
1146 if (node == NUMA_NO_NODE)
1147 node = numa_node_id();
1148
1149 page = alloc_pages_exact_node(node, flags, get_order(size));
1148 if (unlikely(!page)) 1150 if (unlikely(!page))
1149 return NULL; 1151 return NULL;
1150 1152
@@ -1914,7 +1916,7 @@ ioc_show(struct seq_file *s, void *v)
1914 seq_printf(s, "Hewlett Packard %s IOC rev %d.%d\n", 1916 seq_printf(s, "Hewlett Packard %s IOC rev %d.%d\n",
1915 ioc->name, ((ioc->rev >> 4) & 0xF), (ioc->rev & 0xF)); 1917 ioc->name, ((ioc->rev >> 4) & 0xF), (ioc->rev & 0xF));
1916#ifdef CONFIG_NUMA 1918#ifdef CONFIG_NUMA
1917 if (ioc->node != MAX_NUMNODES) 1919 if (ioc->node != NUMA_NO_NODE)
1918 seq_printf(s, "NUMA node : %d\n", ioc->node); 1920 seq_printf(s, "NUMA node : %d\n", ioc->node);
1919#endif 1921#endif
1920 seq_printf(s, "IOVA size : %ld MB\n", ((ioc->pdir_size >> 3) * iovp_size)/(1024*1024)); 1922 seq_printf(s, "IOVA size : %ld MB\n", ((ioc->pdir_size >> 3) * iovp_size)/(1024*1024));
@@ -2015,31 +2017,19 @@ sba_connect_bus(struct pci_bus *bus)
2015 printk(KERN_WARNING "No IOC for PCI Bus %04x:%02x in ACPI\n", pci_domain_nr(bus), bus->number); 2017 printk(KERN_WARNING "No IOC for PCI Bus %04x:%02x in ACPI\n", pci_domain_nr(bus), bus->number);
2016} 2018}
2017 2019
2018#ifdef CONFIG_NUMA
2019static void __init 2020static void __init
2020sba_map_ioc_to_node(struct ioc *ioc, acpi_handle handle) 2021sba_map_ioc_to_node(struct ioc *ioc, acpi_handle handle)
2021{ 2022{
2023#ifdef CONFIG_NUMA
2022 unsigned int node; 2024 unsigned int node;
2023 int pxm;
2024
2025 ioc->node = MAX_NUMNODES;
2026
2027 pxm = acpi_get_pxm(handle);
2028
2029 if (pxm < 0)
2030 return;
2031
2032 node = pxm_to_node(pxm);
2033 2025
2034 if (node >= MAX_NUMNODES || !node_online(node)) 2026 node = acpi_get_node(handle);
2035 return; 2027 if (node != NUMA_NO_NODE && !node_online(node))
2028 node = NUMA_NO_NODE;
2036 2029
2037 ioc->node = node; 2030 ioc->node = node;
2038 return;
2039}
2040#else
2041#define sba_map_ioc_to_node(ioc, handle)
2042#endif 2031#endif
2032}
2043 2033
2044static int 2034static int
2045acpi_sba_ioc_add(struct acpi_device *device, 2035acpi_sba_ioc_add(struct acpi_device *device,
diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h
index 71fbaaa495cc..7d41cc089822 100644
--- a/arch/ia64/include/asm/pci.h
+++ b/arch/ia64/include/asm/pci.h
@@ -98,7 +98,7 @@ struct pci_controller {
98 struct acpi_device *companion; 98 struct acpi_device *companion;
99 void *iommu; 99 void *iommu;
100 int segment; 100 int segment;
101 int node; /* nearest node with memory or -1 for global allocation */ 101 int node; /* nearest node with memory or NUMA_NO_NODE for global allocation */
102 102
103 void *platform_data; 103 void *platform_data;
104}; 104};
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 07d209c9507f..0d407b300762 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -54,10 +54,6 @@
54#include <asm/sal.h> 54#include <asm/sal.h>
55#include <asm/cyclone.h> 55#include <asm/cyclone.h>
56 56
57#define BAD_MADT_ENTRY(entry, end) ( \
58 (!entry) || (unsigned long)entry + sizeof(*entry) > end || \
59 ((struct acpi_subtable_header *)entry)->length < sizeof(*entry))
60
61#define PREFIX "ACPI: " 57#define PREFIX "ACPI: "
62 58
63unsigned int acpi_cpei_override; 59unsigned int acpi_cpei_override;
@@ -803,14 +799,9 @@ int acpi_isa_irq_to_gsi(unsigned isa_irq, u32 *gsi)
803 * ACPI based hotplug CPU support 799 * ACPI based hotplug CPU support
804 */ 800 */
805#ifdef CONFIG_ACPI_HOTPLUG_CPU 801#ifdef CONFIG_ACPI_HOTPLUG_CPU
806static 802static int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
807int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
808{ 803{
809#ifdef CONFIG_ACPI_NUMA 804#ifdef CONFIG_ACPI_NUMA
810 int pxm_id;
811 int nid;
812
813 pxm_id = acpi_get_pxm(handle);
814 /* 805 /*
815 * We don't have cpu-only-node hotadd. But if the system equips 806 * We don't have cpu-only-node hotadd. But if the system equips
816 * SRAT table, pxm is already found and node is ready. 807 * SRAT table, pxm is already found and node is ready.
@@ -818,11 +809,10 @@ int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
818 * This code here is for the system which doesn't have full SRAT 809 * This code here is for the system which doesn't have full SRAT
819 * table for possible cpus. 810 * table for possible cpus.
820 */ 811 */
821 nid = acpi_map_pxm_to_node(pxm_id);
822 node_cpuid[cpu].phys_id = physid; 812 node_cpuid[cpu].phys_id = physid;
823 node_cpuid[cpu].nid = nid; 813 node_cpuid[cpu].nid = acpi_get_node(handle);
824#endif 814#endif
825 return (0); 815 return 0;
826} 816}
827 817
828int additional_cpus __initdata = -1; 818int additional_cpus __initdata = -1;
@@ -929,7 +919,7 @@ static acpi_status acpi_map_iosapic(acpi_handle handle, u32 depth,
929 union acpi_object *obj; 919 union acpi_object *obj;
930 struct acpi_madt_io_sapic *iosapic; 920 struct acpi_madt_io_sapic *iosapic;
931 unsigned int gsi_base; 921 unsigned int gsi_base;
932 int pxm, node; 922 int node;
933 923
934 /* Only care about objects w/ a method that returns the MADT */ 924 /* Only care about objects w/ a method that returns the MADT */
935 if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer))) 925 if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer)))
@@ -956,17 +946,9 @@ static acpi_status acpi_map_iosapic(acpi_handle handle, u32 depth,
956 946
957 kfree(buffer.pointer); 947 kfree(buffer.pointer);
958 948
959 /* 949 /* OK, it's an IOSAPIC MADT entry; associate it with a node */
960 * OK, it's an IOSAPIC MADT entry, look for a _PXM value to tell 950 node = acpi_get_node(handle);
961 * us which node to associate this with. 951 if (node == NUMA_NO_NODE || !node_online(node) ||
962 */
963 pxm = acpi_get_pxm(handle);
964 if (pxm < 0)
965 return AE_OK;
966
967 node = pxm_to_node(pxm);
968
969 if (node >= MAX_NUMNODES || !node_online(node) ||
970 cpumask_empty(cpumask_of_node(node))) 952 cpumask_empty(cpumask_of_node(node)))
971 return AE_OK; 953 return AE_OK;
972 954
diff --git a/arch/ia64/kernel/err_inject.c b/arch/ia64/kernel/err_inject.c
index f59c0b844e88..0c161ed6d18e 100644
--- a/arch/ia64/kernel/err_inject.c
+++ b/arch/ia64/kernel/err_inject.c
@@ -269,12 +269,17 @@ err_inject_init(void)
269#ifdef ERR_INJ_DEBUG 269#ifdef ERR_INJ_DEBUG
270 printk(KERN_INFO "Enter error injection driver.\n"); 270 printk(KERN_INFO "Enter error injection driver.\n");
271#endif 271#endif
272
273 cpu_notifier_register_begin();
274
272 for_each_online_cpu(i) { 275 for_each_online_cpu(i) {
273 err_inject_cpu_callback(&err_inject_cpu_notifier, CPU_ONLINE, 276 err_inject_cpu_callback(&err_inject_cpu_notifier, CPU_ONLINE,
274 (void *)(long)i); 277 (void *)(long)i);
275 } 278 }
276 279
277 register_hotcpu_notifier(&err_inject_cpu_notifier); 280 __register_hotcpu_notifier(&err_inject_cpu_notifier);
281
282 cpu_notifier_register_done();
278 283
279 return 0; 284 return 0;
280} 285}
@@ -288,11 +293,17 @@ err_inject_exit(void)
288#ifdef ERR_INJ_DEBUG 293#ifdef ERR_INJ_DEBUG
289 printk(KERN_INFO "Exit error injection driver.\n"); 294 printk(KERN_INFO "Exit error injection driver.\n");
290#endif 295#endif
296
297 cpu_notifier_register_begin();
298
291 for_each_online_cpu(i) { 299 for_each_online_cpu(i) {
292 sys_dev = get_cpu_device(i); 300 sys_dev = get_cpu_device(i);
293 sysfs_remove_group(&sys_dev->kobj, &err_inject_attr_group); 301 sysfs_remove_group(&sys_dev->kobj, &err_inject_attr_group);
294 } 302 }
295 unregister_hotcpu_notifier(&err_inject_cpu_notifier); 303
304 __unregister_hotcpu_notifier(&err_inject_cpu_notifier);
305
306 cpu_notifier_register_done();
296} 307}
297 308
298module_init(err_inject_init); 309module_init(err_inject_init);
diff --git a/arch/ia64/kernel/ftrace.c b/arch/ia64/kernel/ftrace.c
index 7fc8c961b1f7..3b0c2aa07857 100644
--- a/arch/ia64/kernel/ftrace.c
+++ b/arch/ia64/kernel/ftrace.c
@@ -198,9 +198,7 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
198} 198}
199 199
200/* run from kstop_machine */ 200/* run from kstop_machine */
201int __init ftrace_dyn_arch_init(void *data) 201int __init ftrace_dyn_arch_init(void)
202{ 202{
203 *(unsigned long *)data = 0;
204
205 return 0; 203 return 0;
206} 204}
diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c
index ab333284f4b2..c39c3cd3ac34 100644
--- a/arch/ia64/kernel/palinfo.c
+++ b/arch/ia64/kernel/palinfo.c
@@ -996,13 +996,17 @@ palinfo_init(void)
996 if (!palinfo_dir) 996 if (!palinfo_dir)
997 return -ENOMEM; 997 return -ENOMEM;
998 998
999 cpu_notifier_register_begin();
1000
999 /* Create palinfo dirs in /proc for all online cpus */ 1001 /* Create palinfo dirs in /proc for all online cpus */
1000 for_each_online_cpu(i) { 1002 for_each_online_cpu(i) {
1001 create_palinfo_proc_entries(i); 1003 create_palinfo_proc_entries(i);
1002 } 1004 }
1003 1005
1004 /* Register for future delivery via notify registration */ 1006 /* Register for future delivery via notify registration */
1005 register_hotcpu_notifier(&palinfo_cpu_notifier); 1007 __register_hotcpu_notifier(&palinfo_cpu_notifier);
1008
1009 cpu_notifier_register_done();
1006 1010
1007 return 0; 1011 return 0;
1008} 1012}
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c
index 960a396f5929..ee9719eebb1e 100644
--- a/arch/ia64/kernel/salinfo.c
+++ b/arch/ia64/kernel/salinfo.c
@@ -635,6 +635,8 @@ salinfo_init(void)
635 (void *)salinfo_entries[i].feature); 635 (void *)salinfo_entries[i].feature);
636 } 636 }
637 637
638 cpu_notifier_register_begin();
639
638 for (i = 0; i < ARRAY_SIZE(salinfo_log_name); i++) { 640 for (i = 0; i < ARRAY_SIZE(salinfo_log_name); i++) {
639 data = salinfo_data + i; 641 data = salinfo_data + i;
640 data->type = i; 642 data->type = i;
@@ -669,7 +671,9 @@ salinfo_init(void)
669 salinfo_timer.function = &salinfo_timeout; 671 salinfo_timer.function = &salinfo_timeout;
670 add_timer(&salinfo_timer); 672 add_timer(&salinfo_timer);
671 673
672 register_hotcpu_notifier(&salinfo_cpu_notifier); 674 __register_hotcpu_notifier(&salinfo_cpu_notifier);
675
676 cpu_notifier_register_done();
673 677
674 return 0; 678 return 0;
675} 679}
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index ca69a5a96dcc..f295f9abba4b 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -454,12 +454,16 @@ static int __init cache_sysfs_init(void)
454{ 454{
455 int i; 455 int i;
456 456
457 cpu_notifier_register_begin();
458
457 for_each_online_cpu(i) { 459 for_each_online_cpu(i) {
458 struct device *sys_dev = get_cpu_device((unsigned int)i); 460 struct device *sys_dev = get_cpu_device((unsigned int)i);
459 cache_add_dev(sys_dev); 461 cache_add_dev(sys_dev);
460 } 462 }
461 463
462 register_hotcpu_notifier(&cache_cpu_notifier); 464 __register_hotcpu_notifier(&cache_cpu_notifier);
465
466 cpu_notifier_register_done();
463 467
464 return 0; 468 return 0;
465} 469}
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c
index 53f44bee9ebb..6a4309bb821a 100644
--- a/arch/ia64/kvm/kvm-ia64.c
+++ b/arch/ia64/kvm/kvm-ia64.c
@@ -199,6 +199,7 @@ int kvm_dev_ioctl_check_extension(long ext)
199 case KVM_CAP_IRQCHIP: 199 case KVM_CAP_IRQCHIP:
200 case KVM_CAP_MP_STATE: 200 case KVM_CAP_MP_STATE:
201 case KVM_CAP_IRQ_INJECT_STATUS: 201 case KVM_CAP_IRQ_INJECT_STATUS:
202 case KVM_CAP_IOAPIC_POLARITY_IGNORED:
202 r = 1; 203 r = 1;
203 break; 204 break;
204 case KVM_CAP_COALESCED_MMIO: 205 case KVM_CAP_COALESCED_MMIO:
diff --git a/arch/ia64/pci/fixup.c b/arch/ia64/pci/fixup.c
index 5dc969dd4ac0..eee069a0b539 100644
--- a/arch/ia64/pci/fixup.c
+++ b/arch/ia64/pci/fixup.c
@@ -5,6 +5,7 @@
5 5
6#include <linux/pci.h> 6#include <linux/pci.h>
7#include <linux/init.h> 7#include <linux/init.h>
8#include <linux/vgaarb.h>
8 9
9#include <asm/machvec.h> 10#include <asm/machvec.h>
10 11
@@ -19,9 +20,10 @@
19 * IORESOURCE_ROM_SHADOW is used to associate the boot video 20 * IORESOURCE_ROM_SHADOW is used to associate the boot video
20 * card with this copy. On laptops this copy has to be used since 21 * card with this copy. On laptops this copy has to be used since
21 * the main ROM may be compressed or combined with another image. 22 * the main ROM may be compressed or combined with another image.
22 * See pci_map_rom() for use of this flag. IORESOURCE_ROM_SHADOW 23 * See pci_map_rom() for use of this flag. Before marking the device
23 * is marked here since the boot video device will be the only enabled 24 * with IORESOURCE_ROM_SHADOW check if a vga_default_device is already set
24 * video device at this point. 25 * by either arch cde or vga-arbitration, if so only apply the fixup to this
26 * already determined primary video card.
25 */ 27 */
26 28
27static void pci_fixup_video(struct pci_dev *pdev) 29static void pci_fixup_video(struct pci_dev *pdev)
@@ -35,9 +37,6 @@ static void pci_fixup_video(struct pci_dev *pdev)
35 return; 37 return;
36 /* Maybe, this machine supports legacy memory map. */ 38 /* Maybe, this machine supports legacy memory map. */
37 39
38 if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
39 return;
40
41 /* Is VGA routed to us? */ 40 /* Is VGA routed to us? */
42 bus = pdev->bus; 41 bus = pdev->bus;
43 while (bus) { 42 while (bus) {
@@ -60,10 +59,14 @@ static void pci_fixup_video(struct pci_dev *pdev)
60 } 59 }
61 bus = bus->parent; 60 bus = bus->parent;
62 } 61 }
63 pci_read_config_word(pdev, PCI_COMMAND, &config); 62 if (!vga_default_device() || pdev == vga_default_device()) {
64 if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { 63 pci_read_config_word(pdev, PCI_COMMAND, &config);
65 pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; 64 if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
66 dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n"); 65 pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
66 dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n");
67 vga_set_default_device(pdev);
68 }
67 } 69 }
68} 70}
69DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video); 71DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID,
72 PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_video);
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 9e4938d8ca4d..291a582777cf 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -126,7 +126,6 @@ static struct pci_controller *alloc_pci_controller(int seg)
126 return NULL; 126 return NULL;
127 127
128 controller->segment = seg; 128 controller->segment = seg;
129 controller->node = -1;
130 return controller; 129 return controller;
131} 130}
132 131
@@ -430,19 +429,14 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
430 struct pci_root_info *info = NULL; 429 struct pci_root_info *info = NULL;
431 int busnum = root->secondary.start; 430 int busnum = root->secondary.start;
432 struct pci_bus *pbus; 431 struct pci_bus *pbus;
433 int pxm, ret; 432 int ret;
434 433
435 controller = alloc_pci_controller(domain); 434 controller = alloc_pci_controller(domain);
436 if (!controller) 435 if (!controller)
437 return NULL; 436 return NULL;
438 437
439 controller->companion = device; 438 controller->companion = device;
440 439 controller->node = acpi_get_node(device->handle);
441 pxm = acpi_get_pxm(device->handle);
442#ifdef CONFIG_NUMA
443 if (pxm >= 0)
444 controller->node = pxm_to_node(pxm);
445#endif
446 440
447 info = kzalloc(sizeof(*info), GFP_KERNEL); 441 info = kzalloc(sizeof(*info), GFP_KERNEL);
448 if (!info) { 442 if (!info) {
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index ca4504424dae..9e44bbd8051e 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -28,7 +28,7 @@ config ZONE_DMA
28 bool 28 bool
29 default y 29 default y
30 30
31config NO_IOPORT 31config NO_IOPORT_MAP
32 def_bool y 32 def_bool y
33 33
34config NO_DMA 34config NO_DMA
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index b2e322939256..87b7c7581b1d 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -52,7 +52,7 @@ config TIME_LOW_RES
52 bool 52 bool
53 default y 53 default y
54 54
55config NO_IOPORT 55config NO_IOPORT_MAP
56 def_bool y 56 def_bool y
57 57
58config NO_DMA 58config NO_DMA
diff --git a/arch/m68k/configs/m5208evb_defconfig b/arch/m68k/configs/m5208evb_defconfig
index c1616824e201..e7292f460af4 100644
--- a/arch/m68k/configs/m5208evb_defconfig
+++ b/arch/m68k/configs/m5208evb_defconfig
@@ -40,7 +40,6 @@ CONFIG_INET=y
40# CONFIG_IPV6 is not set 40# CONFIG_IPV6 is not set
41# CONFIG_FW_LOADER is not set 41# CONFIG_FW_LOADER is not set
42CONFIG_MTD=y 42CONFIG_MTD=y
43CONFIG_MTD_PARTITIONS=y
44CONFIG_MTD_CHAR=y 43CONFIG_MTD_CHAR=y
45CONFIG_MTD_BLOCK=y 44CONFIG_MTD_BLOCK=y
46CONFIG_MTD_RAM=y 45CONFIG_MTD_RAM=y
diff --git a/arch/m68k/configs/m5249evb_defconfig b/arch/m68k/configs/m5249evb_defconfig
index a6599e42facf..0cd4b39f325b 100644
--- a/arch/m68k/configs/m5249evb_defconfig
+++ b/arch/m68k/configs/m5249evb_defconfig
@@ -38,7 +38,6 @@ CONFIG_INET=y
38# CONFIG_IPV6 is not set 38# CONFIG_IPV6 is not set
39# CONFIG_FW_LOADER is not set 39# CONFIG_FW_LOADER is not set
40CONFIG_MTD=y 40CONFIG_MTD=y
41CONFIG_MTD_PARTITIONS=y
42CONFIG_MTD_CHAR=y 41CONFIG_MTD_CHAR=y
43CONFIG_MTD_BLOCK=y 42CONFIG_MTD_BLOCK=y
44CONFIG_MTD_RAM=y 43CONFIG_MTD_RAM=y
diff --git a/arch/m68k/configs/m5272c3_defconfig b/arch/m68k/configs/m5272c3_defconfig
index 3fa60a57a0f9..a60cb3509135 100644
--- a/arch/m68k/configs/m5272c3_defconfig
+++ b/arch/m68k/configs/m5272c3_defconfig
@@ -36,7 +36,6 @@ CONFIG_INET=y
36# CONFIG_IPV6 is not set 36# CONFIG_IPV6 is not set
37# CONFIG_FW_LOADER is not set 37# CONFIG_FW_LOADER is not set
38CONFIG_MTD=y 38CONFIG_MTD=y
39CONFIG_MTD_PARTITIONS=y
40CONFIG_MTD_CHAR=y 39CONFIG_MTD_CHAR=y
41CONFIG_MTD_BLOCK=y 40CONFIG_MTD_BLOCK=y
42CONFIG_MTD_RAM=y 41CONFIG_MTD_RAM=y
diff --git a/arch/m68k/configs/m5275evb_defconfig b/arch/m68k/configs/m5275evb_defconfig
index a1230e82bb1e..e6502ab7cb2f 100644
--- a/arch/m68k/configs/m5275evb_defconfig
+++ b/arch/m68k/configs/m5275evb_defconfig
@@ -39,7 +39,6 @@ CONFIG_INET=y
39# CONFIG_IPV6 is not set 39# CONFIG_IPV6 is not set
40# CONFIG_FW_LOADER is not set 40# CONFIG_FW_LOADER is not set
41CONFIG_MTD=y 41CONFIG_MTD=y
42CONFIG_MTD_PARTITIONS=y
43CONFIG_MTD_CHAR=y 42CONFIG_MTD_CHAR=y
44CONFIG_MTD_BLOCK=y 43CONFIG_MTD_BLOCK=y
45CONFIG_MTD_RAM=y 44CONFIG_MTD_RAM=y
diff --git a/arch/m68k/configs/m5307c3_defconfig b/arch/m68k/configs/m5307c3_defconfig
index 43795f41f7c7..023812abd2e6 100644
--- a/arch/m68k/configs/m5307c3_defconfig
+++ b/arch/m68k/configs/m5307c3_defconfig
@@ -38,7 +38,6 @@ CONFIG_INET=y
38# CONFIG_IPV6 is not set 38# CONFIG_IPV6 is not set
39# CONFIG_FW_LOADER is not set 39# CONFIG_FW_LOADER is not set
40CONFIG_MTD=y 40CONFIG_MTD=y
41CONFIG_MTD_PARTITIONS=y
42CONFIG_MTD_CHAR=y 41CONFIG_MTD_CHAR=y
43CONFIG_MTD_BLOCK=y 42CONFIG_MTD_BLOCK=y
44CONFIG_MTD_RAM=y 43CONFIG_MTD_RAM=y
diff --git a/arch/m68k/configs/m5407c3_defconfig b/arch/m68k/configs/m5407c3_defconfig
index 72746c57a571..557b39f3be90 100644
--- a/arch/m68k/configs/m5407c3_defconfig
+++ b/arch/m68k/configs/m5407c3_defconfig
@@ -38,7 +38,6 @@ CONFIG_INET=y
38# CONFIG_IPV6 is not set 38# CONFIG_IPV6 is not set
39# CONFIG_FW_LOADER is not set 39# CONFIG_FW_LOADER is not set
40CONFIG_MTD=y 40CONFIG_MTD=y
41CONFIG_MTD_PARTITIONS=y
42CONFIG_MTD_CHAR=y 41CONFIG_MTD_CHAR=y
43CONFIG_MTD_BLOCK=y 42CONFIG_MTD_BLOCK=y
44CONFIG_MTD_RAM=y 43CONFIG_MTD_RAM=y
diff --git a/arch/m68k/include/asm/io_no.h b/arch/m68k/include/asm/io_no.h
index e1534783e94e..52f7e8499172 100644
--- a/arch/m68k/include/asm/io_no.h
+++ b/arch/m68k/include/asm/io_no.h
@@ -55,7 +55,7 @@ static inline unsigned int _swapl(volatile unsigned long v)
55#define __raw_writew writew 55#define __raw_writew writew
56#define __raw_writel writel 56#define __raw_writel writel
57 57
58static inline void io_outsb(unsigned int addr, void *buf, int len) 58static inline void io_outsb(unsigned int addr, const void *buf, int len)
59{ 59{
60 volatile unsigned char *ap = (volatile unsigned char *) addr; 60 volatile unsigned char *ap = (volatile unsigned char *) addr;
61 unsigned char *bp = (unsigned char *) buf; 61 unsigned char *bp = (unsigned char *) buf;
@@ -63,7 +63,7 @@ static inline void io_outsb(unsigned int addr, void *buf, int len)
63 *ap = *bp++; 63 *ap = *bp++;
64} 64}
65 65
66static inline void io_outsw(unsigned int addr, void *buf, int len) 66static inline void io_outsw(unsigned int addr, const void *buf, int len)
67{ 67{
68 volatile unsigned short *ap = (volatile unsigned short *) addr; 68 volatile unsigned short *ap = (volatile unsigned short *) addr;
69 unsigned short *bp = (unsigned short *) buf; 69 unsigned short *bp = (unsigned short *) buf;
@@ -71,7 +71,7 @@ static inline void io_outsw(unsigned int addr, void *buf, int len)
71 *ap = _swapw(*bp++); 71 *ap = _swapw(*bp++);
72} 72}
73 73
74static inline void io_outsl(unsigned int addr, void *buf, int len) 74static inline void io_outsl(unsigned int addr, const void *buf, int len)
75{ 75{
76 volatile unsigned int *ap = (volatile unsigned int *) addr; 76 volatile unsigned int *ap = (volatile unsigned int *) addr;
77 unsigned int *bp = (unsigned int *) buf; 77 unsigned int *bp = (unsigned int *) buf;
diff --git a/arch/metag/Kconfig b/arch/metag/Kconfig
index e56abd2c1b4f..499b7610eaaf 100644
--- a/arch/metag/Kconfig
+++ b/arch/metag/Kconfig
@@ -9,6 +9,7 @@ config METAG
9 select HAVE_ARCH_TRACEHOOK 9 select HAVE_ARCH_TRACEHOOK
10 select HAVE_C_RECORDMCOUNT 10 select HAVE_C_RECORDMCOUNT
11 select HAVE_DEBUG_KMEMLEAK 11 select HAVE_DEBUG_KMEMLEAK
12 select HAVE_DEBUG_STACKOVERFLOW
12 select HAVE_DYNAMIC_FTRACE 13 select HAVE_DYNAMIC_FTRACE
13 select HAVE_FTRACE_MCOUNT_RECORD 14 select HAVE_FTRACE_MCOUNT_RECORD
14 select HAVE_FUNCTION_TRACER 15 select HAVE_FUNCTION_TRACER
@@ -29,7 +30,6 @@ config METAG
29 select OF 30 select OF
30 select OF_EARLY_FLATTREE 31 select OF_EARLY_FLATTREE
31 select SPARSE_IRQ 32 select SPARSE_IRQ
32 select HAVE_DEBUG_STACKOVERFLOW
33 33
34config STACKTRACE_SUPPORT 34config STACKTRACE_SUPPORT
35 def_bool y 35 def_bool y
@@ -52,7 +52,7 @@ config GENERIC_HWEIGHT
52config GENERIC_CALIBRATE_DELAY 52config GENERIC_CALIBRATE_DELAY
53 def_bool y 53 def_bool y
54 54
55config NO_IOPORT 55config NO_IOPORT_MAP
56 def_bool y 56 def_bool y
57 57
58source "init/Kconfig" 58source "init/Kconfig"
diff --git a/arch/metag/include/asm/topology.h b/arch/metag/include/asm/topology.h
index 8e9c0b3b9691..e95f874ded1b 100644
--- a/arch/metag/include/asm/topology.h
+++ b/arch/metag/include/asm/topology.h
@@ -3,33 +3,6 @@
3 3
4#ifdef CONFIG_NUMA 4#ifdef CONFIG_NUMA
5 5
6/* sched_domains SD_NODE_INIT for Meta machines */
7#define SD_NODE_INIT (struct sched_domain) { \
8 .parent = NULL, \
9 .child = NULL, \
10 .groups = NULL, \
11 .min_interval = 8, \
12 .max_interval = 32, \
13 .busy_factor = 32, \
14 .imbalance_pct = 125, \
15 .cache_nice_tries = 2, \
16 .busy_idx = 3, \
17 .idle_idx = 2, \
18 .newidle_idx = 0, \
19 .wake_idx = 0, \
20 .forkexec_idx = 0, \
21 .flags = SD_LOAD_BALANCE \
22 | SD_BALANCE_FORK \
23 | SD_BALANCE_EXEC \
24 | SD_BALANCE_NEWIDLE \
25 | SD_SERIALIZE, \
26 .last_balance = jiffies, \
27 .balance_interval = 1, \
28 .nr_balance_failed = 0, \
29 .max_newidle_lb_cost = 0, \
30 .next_decay_max_lb_cost = jiffies, \
31}
32
33#define cpu_to_node(cpu) ((void)(cpu), 0) 6#define cpu_to_node(cpu) ((void)(cpu), 0)
34#define parent_node(node) ((void)(node), 0) 7#define parent_node(node) ((void)(node), 0)
35 8
diff --git a/arch/metag/kernel/ftrace.c b/arch/metag/kernel/ftrace.c
index a774f321643f..ed1d685157c2 100644
--- a/arch/metag/kernel/ftrace.c
+++ b/arch/metag/kernel/ftrace.c
@@ -117,10 +117,7 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
117} 117}
118 118
119/* run from kstop_machine */ 119/* run from kstop_machine */
120int __init ftrace_dyn_arch_init(void *data) 120int __init ftrace_dyn_arch_init(void)
121{ 121{
122 /* The return code is returned via data */
123 writel(0, data);
124
125 return 0; 122 return 0;
126} 123}
diff --git a/arch/metag/kernel/irq.c b/arch/metag/kernel/irq.c
index 3b4b7f6c0950..5385dd1216b7 100644
--- a/arch/metag/kernel/irq.c
+++ b/arch/metag/kernel/irq.c
@@ -261,18 +261,6 @@ int __init arch_probe_nr_irqs(void)
261} 261}
262 262
263#ifdef CONFIG_HOTPLUG_CPU 263#ifdef CONFIG_HOTPLUG_CPU
264static void route_irq(struct irq_data *data, unsigned int irq, unsigned int cpu)
265{
266 struct irq_desc *desc = irq_to_desc(irq);
267 struct irq_chip *chip = irq_data_get_irq_chip(data);
268 unsigned long flags;
269
270 raw_spin_lock_irqsave(&desc->lock, flags);
271 if (chip->irq_set_affinity)
272 chip->irq_set_affinity(data, cpumask_of(cpu), false);
273 raw_spin_unlock_irqrestore(&desc->lock, flags);
274}
275
276/* 264/*
277 * The CPU has been marked offline. Migrate IRQs off this CPU. If 265 * The CPU has been marked offline. Migrate IRQs off this CPU. If
278 * the affinity settings do not allow other CPUs, force them onto any 266 * the affinity settings do not allow other CPUs, force them onto any
@@ -281,10 +269,9 @@ static void route_irq(struct irq_data *data, unsigned int irq, unsigned int cpu)
281void migrate_irqs(void) 269void migrate_irqs(void)
282{ 270{
283 unsigned int i, cpu = smp_processor_id(); 271 unsigned int i, cpu = smp_processor_id();
284 struct irq_desc *desc;
285 272
286 for_each_irq_desc(i, desc) { 273 for_each_active_irq(i) {
287 struct irq_data *data = irq_desc_get_irq_data(desc); 274 struct irq_data *data = irq_get_irq_data(i);
288 unsigned int newcpu; 275 unsigned int newcpu;
289 276
290 if (irqd_is_per_cpu(data)) 277 if (irqd_is_per_cpu(data))
@@ -300,11 +287,8 @@ void migrate_irqs(void)
300 i, cpu); 287 i, cpu);
301 288
302 cpumask_setall(data->affinity); 289 cpumask_setall(data->affinity);
303 newcpu = cpumask_any_and(data->affinity,
304 cpu_online_mask);
305 } 290 }
306 291 irq_set_affinity(i, data->affinity);
307 route_irq(data, i, newcpu);
308 } 292 }
309} 293}
310#endif /* CONFIG_HOTPLUG_CPU */ 294#endif /* CONFIG_HOTPLUG_CPU */
diff --git a/arch/metag/kernel/signal.c b/arch/metag/kernel/signal.c
index 3be61cf0b147..b9e4a82d2bd4 100644
--- a/arch/metag/kernel/signal.c
+++ b/arch/metag/kernel/signal.c
@@ -152,18 +152,18 @@ static void __user *get_sigframe(struct k_sigaction *ka, unsigned long sp,
152 return (void __user *)sp; 152 return (void __user *)sp;
153} 153}
154 154
155static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, 155static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
156 sigset_t *set, struct pt_regs *regs) 156 struct pt_regs *regs)
157{ 157{
158 struct rt_sigframe __user *frame; 158 struct rt_sigframe __user *frame;
159 int err = -EFAULT; 159 int err;
160 unsigned long code; 160 unsigned long code;
161 161
162 frame = get_sigframe(ka, regs->REG_SP, sizeof(*frame)); 162 frame = get_sigframe(&ksig->ka, regs->REG_SP, sizeof(*frame));
163 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 163 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
164 goto out; 164 return -EFAULT;
165 165
166 err = copy_siginfo_to_user(&frame->info, info); 166 err = copy_siginfo_to_user(&frame->info, &ksig->info);
167 167
168 /* Create the ucontext. */ 168 /* Create the ucontext. */
169 err |= __put_user(0, &frame->uc.uc_flags); 169 err |= __put_user(0, &frame->uc.uc_flags);
@@ -174,7 +174,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
174 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); 174 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
175 175
176 if (err) 176 if (err)
177 goto out; 177 return -EFAULT;
178 178
179 /* Set up to return from userspace. */ 179 /* Set up to return from userspace. */
180 180
@@ -187,15 +187,15 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
187 err |= __put_user(code, (unsigned long __user *)(&frame->retcode[1])); 187 err |= __put_user(code, (unsigned long __user *)(&frame->retcode[1]));
188 188
189 if (err) 189 if (err)
190 goto out; 190 return -EFAULT;
191 191
192 /* Set up registers for signal handler */ 192 /* Set up registers for signal handler */
193 regs->REG_RTP = (unsigned long) frame->retcode; 193 regs->REG_RTP = (unsigned long) frame->retcode;
194 regs->REG_SP = (unsigned long) frame + sizeof(*frame); 194 regs->REG_SP = (unsigned long) frame + sizeof(*frame);
195 regs->REG_ARG1 = sig; 195 regs->REG_ARG1 = ksig->sig;
196 regs->REG_ARG2 = (unsigned long) &frame->info; 196 regs->REG_ARG2 = (unsigned long) &frame->info;
197 regs->REG_ARG3 = (unsigned long) &frame->uc; 197 regs->REG_ARG3 = (unsigned long) &frame->uc;
198 regs->REG_PC = (unsigned long) ka->sa.sa_handler; 198 regs->REG_PC = (unsigned long) ksig->ka.sa.sa_handler;
199 199
200 pr_debug("SIG deliver (%s:%d): sp=%p pc=%08x pr=%08x\n", 200 pr_debug("SIG deliver (%s:%d): sp=%p pc=%08x pr=%08x\n",
201 current->comm, current->pid, frame, regs->REG_PC, 201 current->comm, current->pid, frame, regs->REG_PC,
@@ -205,24 +205,19 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
205 * effective cache flush - directed rather than 'full flush'. 205 * effective cache flush - directed rather than 'full flush'.
206 */ 206 */
207 flush_cache_sigtramp(regs->REG_RTP, sizeof(frame->retcode)); 207 flush_cache_sigtramp(regs->REG_RTP, sizeof(frame->retcode));
208out: 208
209 if (err) {
210 force_sigsegv(sig, current);
211 return -EFAULT;
212 }
213 return 0; 209 return 0;
214} 210}
215 211
216static void handle_signal(unsigned long sig, siginfo_t *info, 212static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
217 struct k_sigaction *ka, struct pt_regs *regs)
218{ 213{
219 sigset_t *oldset = sigmask_to_save(); 214 sigset_t *oldset = sigmask_to_save();
215 int ret;
220 216
221 /* Set up the stack frame */ 217 /* Set up the stack frame */
222 if (setup_rt_frame(sig, ka, info, oldset, regs)) 218 ret = setup_rt_frame(ksig, oldset, regs);
223 return;
224 219
225 signal_delivered(sig, info, ka, regs, test_thread_flag(TIF_SINGLESTEP)); 220 signal_setup_done(ret, ksig, test_thread_flag(TIF_SINGLESTEP));
226} 221}
227 222
228 /* 223 /*
@@ -235,10 +230,8 @@ static void handle_signal(unsigned long sig, siginfo_t *info,
235static int do_signal(struct pt_regs *regs, int syscall) 230static int do_signal(struct pt_regs *regs, int syscall)
236{ 231{
237 unsigned int retval = 0, continue_addr = 0, restart_addr = 0; 232 unsigned int retval = 0, continue_addr = 0, restart_addr = 0;
238 struct k_sigaction ka;
239 siginfo_t info;
240 int signr;
241 int restart = 0; 233 int restart = 0;
234 struct ksignal ksig;
242 235
243 /* 236 /*
244 * By the end of rt_sigreturn the context describes the point that the 237 * By the end of rt_sigreturn the context describes the point that the
@@ -275,7 +268,8 @@ static int do_signal(struct pt_regs *regs, int syscall)
275 * Get the signal to deliver. When running under ptrace, at this point 268 * Get the signal to deliver. When running under ptrace, at this point
276 * the debugger may change all our registers ... 269 * the debugger may change all our registers ...
277 */ 270 */
278 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 271 get_signal(&ksig);
272
279 /* 273 /*
280 * Depending on the signal settings we may need to revert the decision 274 * Depending on the signal settings we may need to revert the decision
281 * to restart the system call. But skip this if a debugger has chosen to 275 * to restart the system call. But skip this if a debugger has chosen to
@@ -283,19 +277,19 @@ static int do_signal(struct pt_regs *regs, int syscall)
283 */ 277 */
284 if (regs->REG_PC != restart_addr) 278 if (regs->REG_PC != restart_addr)
285 restart = 0; 279 restart = 0;
286 if (signr > 0) { 280 if (ksig.sig > 0) {
287 if (unlikely(restart)) { 281 if (unlikely(restart)) {
288 if (retval == -ERESTARTNOHAND 282 if (retval == -ERESTARTNOHAND
289 || retval == -ERESTART_RESTARTBLOCK 283 || retval == -ERESTART_RESTARTBLOCK
290 || (retval == -ERESTARTSYS 284 || (retval == -ERESTARTSYS
291 && !(ka.sa.sa_flags & SA_RESTART))) { 285 && !(ksig.ka.sa.sa_flags & SA_RESTART))) {
292 regs->REG_RETVAL = -EINTR; 286 regs->REG_RETVAL = -EINTR;
293 regs->REG_PC = continue_addr; 287 regs->REG_PC = continue_addr;
294 } 288 }
295 } 289 }
296 290
297 /* Whee! Actually deliver the signal. */ 291 /* Whee! Actually deliver the signal. */
298 handle_signal(signr, &info, &ka, regs); 292 handle_signal(&ksig, regs);
299 return 0; 293 return 0;
300 } 294 }
301 295
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index 79b9bcdfe498..9ae08541e30d 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -1,38 +1,38 @@
1config MICROBLAZE 1config MICROBLAZE
2 def_bool y 2 def_bool y
3 select ARCH_MIGHT_HAVE_PC_PARPORT 3 select ARCH_MIGHT_HAVE_PC_PARPORT
4 select HAVE_MEMBLOCK
5 select HAVE_MEMBLOCK_NODE_MAP
6 select HAVE_FUNCTION_TRACER
7 select HAVE_FUNCTION_TRACE_MCOUNT_TEST
8 select HAVE_FUNCTION_GRAPH_TRACER
9 select HAVE_DYNAMIC_FTRACE
10 select HAVE_FTRACE_MCOUNT_RECORD
11 select ARCH_WANT_OPTIONAL_GPIOLIB
12 select HAVE_OPROFILE
13 select HAVE_ARCH_KGDB
14 select HAVE_DMA_ATTRS
15 select HAVE_DMA_API_DEBUG
16 select TRACING_SUPPORT
17 select OF
18 select OF_EARLY_FLATTREE
19 select ARCH_WANT_IPC_PARSE_VERSION 4 select ARCH_WANT_IPC_PARSE_VERSION
20 select HAVE_DEBUG_KMEMLEAK 5 select ARCH_WANT_OPTIONAL_GPIOLIB
21 select IRQ_DOMAIN 6 select BUILDTIME_EXTABLE_SORT
22 select VIRT_TO_BUS 7 select CLKSRC_OF
8 select CLONE_BACKWARDS3
9 select COMMON_CLK
10 select GENERIC_ATOMIC64
11 select GENERIC_CLOCKEVENTS
12 select GENERIC_CPU_DEVICES
13 select GENERIC_IDLE_POLL_SETUP
23 select GENERIC_IRQ_PROBE 14 select GENERIC_IRQ_PROBE
24 select GENERIC_IRQ_SHOW 15 select GENERIC_IRQ_SHOW
25 select GENERIC_PCI_IOMAP 16 select GENERIC_PCI_IOMAP
26 select GENERIC_CPU_DEVICES
27 select GENERIC_ATOMIC64
28 select GENERIC_CLOCKEVENTS
29 select COMMON_CLK
30 select GENERIC_SCHED_CLOCK 17 select GENERIC_SCHED_CLOCK
31 select GENERIC_IDLE_POLL_SETUP 18 select HAVE_ARCH_KGDB
19 select HAVE_DEBUG_KMEMLEAK
20 select HAVE_DMA_API_DEBUG
21 select HAVE_DMA_ATTRS
22 select HAVE_DYNAMIC_FTRACE
23 select HAVE_FTRACE_MCOUNT_RECORD
24 select HAVE_FUNCTION_GRAPH_TRACER
25 select HAVE_FUNCTION_TRACE_MCOUNT_TEST
26 select HAVE_FUNCTION_TRACER
27 select HAVE_MEMBLOCK
28 select HAVE_MEMBLOCK_NODE_MAP
29 select HAVE_OPROFILE
30 select IRQ_DOMAIN
32 select MODULES_USE_ELF_RELA 31 select MODULES_USE_ELF_RELA
33 select CLONE_BACKWARDS3 32 select OF
34 select CLKSRC_OF 33 select OF_EARLY_FLATTREE
35 select BUILDTIME_EXTABLE_SORT 34 select TRACING_SUPPORT
35 select VIRT_TO_BUS
36 36
37config SWAP 37config SWAP
38 def_bool n 38 def_bool n
@@ -74,7 +74,7 @@ source "init/Kconfig"
74 74
75source "kernel/Kconfig.freezer" 75source "kernel/Kconfig.freezer"
76 76
77source "arch/microblaze/platform/Kconfig.platform" 77source "arch/microblaze/Kconfig.platform"
78 78
79menu "Processor type and features" 79menu "Processor type and features"
80 80
diff --git a/arch/microblaze/platform/Kconfig.platform b/arch/microblaze/Kconfig.platform
index db1aa5c22cea..1b3d8c849101 100644
--- a/arch/microblaze/platform/Kconfig.platform
+++ b/arch/microblaze/Kconfig.platform
@@ -5,18 +5,6 @@
5# 5#
6 6
7menu "Platform options" 7menu "Platform options"
8choice
9 prompt "Platform"
10 default PLATFORM_MICROBLAZE_AUTO
11 help
12 Choose which hardware board/platform you are targeting.
13
14config PLATFORM_GENERIC
15 bool "Generic"
16 help
17 Choose this option for the Generic platform.
18
19endchoice
20 8
21config OPT_LIB_FUNCTION 9config OPT_LIB_FUNCTION
22 bool "Optimalized lib function" 10 bool "Optimalized lib function"
@@ -37,8 +25,45 @@ config OPT_LIB_ASM
37 Allows turn on optimalized library function (memcpy and memmove). 25 Allows turn on optimalized library function (memcpy and memmove).
38 Function are written in asm code. 26 Function are written in asm code.
39 27
40if PLATFORM_GENERIC=y 28# Definitions for MICROBLAZE0
41 source "arch/microblaze/platform/generic/Kconfig.auto" 29comment "Definitions for MICROBLAZE0"
42endif 30
31config KERNEL_BASE_ADDR
32 hex "Physical address where Linux Kernel is"
33 default "0x90000000"
34 help
35 BASE Address for kernel
36
37config XILINX_MICROBLAZE0_FAMILY
38 string "Targeted FPGA family"
39 default "virtex5"
40
41config XILINX_MICROBLAZE0_USE_MSR_INSTR
42 int "USE_MSR_INSTR range (0:1)"
43 default 0
44
45config XILINX_MICROBLAZE0_USE_PCMP_INSTR
46 int "USE_PCMP_INSTR range (0:1)"
47 default 0
48
49config XILINX_MICROBLAZE0_USE_BARREL
50 int "USE_BARREL range (0:1)"
51 default 0
52
53config XILINX_MICROBLAZE0_USE_DIV
54 int "USE_DIV range (0:1)"
55 default 0
56
57config XILINX_MICROBLAZE0_USE_HW_MUL
58 int "USE_HW_MUL values (0=NONE, 1=MUL32, 2=MUL64)"
59 default 0
60
61config XILINX_MICROBLAZE0_USE_FPU
62 int "USE_FPU values (0=NONE, 1=BASIC, 2=EXTENDED)"
63 default 0
64
65config XILINX_MICROBLAZE0_HW_VER
66 string "Core version number"
67 default 7.10.d
43 68
44endmenu 69endmenu
diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile
index a69eaf2ab130..740f2b82a182 100644
--- a/arch/microblaze/Makefile
+++ b/arch/microblaze/Makefile
@@ -48,7 +48,6 @@ head-y := arch/microblaze/kernel/head.o
48libs-y += arch/microblaze/lib/ 48libs-y += arch/microblaze/lib/
49core-y += arch/microblaze/kernel/ 49core-y += arch/microblaze/kernel/
50core-y += arch/microblaze/mm/ 50core-y += arch/microblaze/mm/
51core-y += arch/microblaze/platform/
52core-$(CONFIG_PCI) += arch/microblaze/pci/ 51core-$(CONFIG_PCI) += arch/microblaze/pci/
53 52
54drivers-$(CONFIG_OPROFILE) += arch/microblaze/oprofile/ 53drivers-$(CONFIG_OPROFILE) += arch/microblaze/oprofile/
diff --git a/arch/microblaze/boot/dts/system.dts b/arch/microblaze/boot/dts/system.dts
index 7cb657892f21..b620da23febb 120000..100644
--- a/arch/microblaze/boot/dts/system.dts
+++ b/arch/microblaze/boot/dts/system.dts
@@ -1 +1,366 @@
1../../platform/generic/system.dts \ No newline at end of file 1/*
2 * Device Tree Generator version: 1.1
3 *
4 * (C) Copyright 2007-2008 Xilinx, Inc.
5 * (C) Copyright 2007-2009 Michal Simek
6 *
7 * Michal SIMEK <monstr@monstr.eu>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (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
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22 * MA 02111-1307 USA
23 *
24 * CAUTION: This file is automatically generated by libgen.
25 * Version: Xilinx EDK 10.1.03 EDK_K_SP3.6
26 *
27 * XPS project directory: Xilinx-ML505-ll_temac-sgdma-MMU-FDT-edk101
28 */
29
30/dts-v1/;
31/ {
32 #address-cells = <1>;
33 #size-cells = <1>;
34 compatible = "xlnx,microblaze";
35 hard-reset-gpios = <&LEDs_8Bit 2 1>;
36 model = "testing";
37 DDR2_SDRAM: memory@90000000 {
38 device_type = "memory";
39 reg = < 0x90000000 0x10000000 >;
40 } ;
41 aliases {
42 ethernet0 = &Hard_Ethernet_MAC;
43 serial0 = &RS232_Uart_1;
44 } ;
45 chosen {
46 bootargs = "console=ttyUL0,115200 highres=on";
47 linux,stdout-path = "/plb@0/serial@84000000";
48 } ;
49 cpus {
50 #address-cells = <1>;
51 #cpus = <0x1>;
52 #size-cells = <0>;
53 microblaze_0: cpu@0 {
54 clock-frequency = <125000000>;
55 compatible = "xlnx,microblaze-7.10.d";
56 d-cache-baseaddr = <0x90000000>;
57 d-cache-highaddr = <0x9fffffff>;
58 d-cache-line-size = <0x10>;
59 d-cache-size = <0x2000>;
60 device_type = "cpu";
61 i-cache-baseaddr = <0x90000000>;
62 i-cache-highaddr = <0x9fffffff>;
63 i-cache-line-size = <0x10>;
64 i-cache-size = <0x2000>;
65 model = "microblaze,7.10.d";
66 reg = <0>;
67 timebase-frequency = <125000000>;
68 xlnx,addr-tag-bits = <0xf>;
69 xlnx,allow-dcache-wr = <0x1>;
70 xlnx,allow-icache-wr = <0x1>;
71 xlnx,area-optimized = <0x0>;
72 xlnx,cache-byte-size = <0x2000>;
73 xlnx,d-lmb = <0x1>;
74 xlnx,d-opb = <0x0>;
75 xlnx,d-plb = <0x1>;
76 xlnx,data-size = <0x20>;
77 xlnx,dcache-addr-tag = <0xf>;
78 xlnx,dcache-always-used = <0x1>;
79 xlnx,dcache-byte-size = <0x2000>;
80 xlnx,dcache-line-len = <0x4>;
81 xlnx,dcache-use-fsl = <0x1>;
82 xlnx,debug-enabled = <0x1>;
83 xlnx,div-zero-exception = <0x1>;
84 xlnx,dopb-bus-exception = <0x0>;
85 xlnx,dynamic-bus-sizing = <0x1>;
86 xlnx,edge-is-positive = <0x1>;
87 xlnx,family = "virtex5";
88 xlnx,endianness = <0x1>;
89 xlnx,fpu-exception = <0x1>;
90 xlnx,fsl-data-size = <0x20>;
91 xlnx,fsl-exception = <0x0>;
92 xlnx,fsl-links = <0x0>;
93 xlnx,i-lmb = <0x1>;
94 xlnx,i-opb = <0x0>;
95 xlnx,i-plb = <0x1>;
96 xlnx,icache-always-used = <0x1>;
97 xlnx,icache-line-len = <0x4>;
98 xlnx,icache-use-fsl = <0x1>;
99 xlnx,ill-opcode-exception = <0x1>;
100 xlnx,instance = "microblaze_0";
101 xlnx,interconnect = <0x1>;
102 xlnx,interrupt-is-edge = <0x0>;
103 xlnx,iopb-bus-exception = <0x0>;
104 xlnx,mmu-dtlb-size = <0x4>;
105 xlnx,mmu-itlb-size = <0x2>;
106 xlnx,mmu-tlb-access = <0x3>;
107 xlnx,mmu-zones = <0x10>;
108 xlnx,number-of-pc-brk = <0x1>;
109 xlnx,number-of-rd-addr-brk = <0x0>;
110 xlnx,number-of-wr-addr-brk = <0x0>;
111 xlnx,opcode-0x0-illegal = <0x1>;
112 xlnx,pvr = <0x2>;
113 xlnx,pvr-user1 = <0x0>;
114 xlnx,pvr-user2 = <0x0>;
115 xlnx,reset-msr = <0x0>;
116 xlnx,sco = <0x0>;
117 xlnx,unaligned-exceptions = <0x1>;
118 xlnx,use-barrel = <0x1>;
119 xlnx,use-dcache = <0x1>;
120 xlnx,use-div = <0x1>;
121 xlnx,use-ext-brk = <0x1>;
122 xlnx,use-ext-nm-brk = <0x1>;
123 xlnx,use-extended-fsl-instr = <0x0>;
124 xlnx,use-fpu = <0x2>;
125 xlnx,use-hw-mul = <0x2>;
126 xlnx,use-icache = <0x1>;
127 xlnx,use-interrupt = <0x1>;
128 xlnx,use-mmu = <0x3>;
129 xlnx,use-msr-instr = <0x1>;
130 xlnx,use-pcmp-instr = <0x1>;
131 } ;
132 } ;
133 mb_plb: plb@0 {
134 #address-cells = <1>;
135 #size-cells = <1>;
136 compatible = "xlnx,plb-v46-1.03.a", "xlnx,plb-v46-1.00.a", "simple-bus";
137 ranges ;
138 FLASH: flash@a0000000 {
139 bank-width = <2>;
140 compatible = "xlnx,xps-mch-emc-2.00.a", "cfi-flash";
141 reg = < 0xa0000000 0x2000000 >;
142 xlnx,family = "virtex5";
143 xlnx,include-datawidth-matching-0 = <0x1>;
144 xlnx,include-datawidth-matching-1 = <0x0>;
145 xlnx,include-datawidth-matching-2 = <0x0>;
146 xlnx,include-datawidth-matching-3 = <0x0>;
147 xlnx,include-negedge-ioregs = <0x0>;
148 xlnx,include-plb-ipif = <0x1>;
149 xlnx,include-wrbuf = <0x1>;
150 xlnx,max-mem-width = <0x10>;
151 xlnx,mch-native-dwidth = <0x20>;
152 xlnx,mch-plb-clk-period-ps = <0x1f40>;
153 xlnx,mch-splb-awidth = <0x20>;
154 xlnx,mch0-accessbuf-depth = <0x10>;
155 xlnx,mch0-protocol = <0x0>;
156 xlnx,mch0-rddatabuf-depth = <0x10>;
157 xlnx,mch1-accessbuf-depth = <0x10>;
158 xlnx,mch1-protocol = <0x0>;
159 xlnx,mch1-rddatabuf-depth = <0x10>;
160 xlnx,mch2-accessbuf-depth = <0x10>;
161 xlnx,mch2-protocol = <0x0>;
162 xlnx,mch2-rddatabuf-depth = <0x10>;
163 xlnx,mch3-accessbuf-depth = <0x10>;
164 xlnx,mch3-protocol = <0x0>;
165 xlnx,mch3-rddatabuf-depth = <0x10>;
166 xlnx,mem0-width = <0x10>;
167 xlnx,mem1-width = <0x20>;
168 xlnx,mem2-width = <0x20>;
169 xlnx,mem3-width = <0x20>;
170 xlnx,num-banks-mem = <0x1>;
171 xlnx,num-channels = <0x0>;
172 xlnx,priority-mode = <0x0>;
173 xlnx,synch-mem-0 = <0x0>;
174 xlnx,synch-mem-1 = <0x0>;
175 xlnx,synch-mem-2 = <0x0>;
176 xlnx,synch-mem-3 = <0x0>;
177 xlnx,synch-pipedelay-0 = <0x2>;
178 xlnx,synch-pipedelay-1 = <0x2>;
179 xlnx,synch-pipedelay-2 = <0x2>;
180 xlnx,synch-pipedelay-3 = <0x2>;
181 xlnx,tavdv-ps-mem-0 = <0x1adb0>;
182 xlnx,tavdv-ps-mem-1 = <0x3a98>;
183 xlnx,tavdv-ps-mem-2 = <0x3a98>;
184 xlnx,tavdv-ps-mem-3 = <0x3a98>;
185 xlnx,tcedv-ps-mem-0 = <0x1adb0>;
186 xlnx,tcedv-ps-mem-1 = <0x3a98>;
187 xlnx,tcedv-ps-mem-2 = <0x3a98>;
188 xlnx,tcedv-ps-mem-3 = <0x3a98>;
189 xlnx,thzce-ps-mem-0 = <0x88b8>;
190 xlnx,thzce-ps-mem-1 = <0x1b58>;
191 xlnx,thzce-ps-mem-2 = <0x1b58>;
192 xlnx,thzce-ps-mem-3 = <0x1b58>;
193 xlnx,thzoe-ps-mem-0 = <0x1b58>;
194 xlnx,thzoe-ps-mem-1 = <0x1b58>;
195 xlnx,thzoe-ps-mem-2 = <0x1b58>;
196 xlnx,thzoe-ps-mem-3 = <0x1b58>;
197 xlnx,tlzwe-ps-mem-0 = <0x88b8>;
198 xlnx,tlzwe-ps-mem-1 = <0x0>;
199 xlnx,tlzwe-ps-mem-2 = <0x0>;
200 xlnx,tlzwe-ps-mem-3 = <0x0>;
201 xlnx,twc-ps-mem-0 = <0x2af8>;
202 xlnx,twc-ps-mem-1 = <0x3a98>;
203 xlnx,twc-ps-mem-2 = <0x3a98>;
204 xlnx,twc-ps-mem-3 = <0x3a98>;
205 xlnx,twp-ps-mem-0 = <0x11170>;
206 xlnx,twp-ps-mem-1 = <0x2ee0>;
207 xlnx,twp-ps-mem-2 = <0x2ee0>;
208 xlnx,twp-ps-mem-3 = <0x2ee0>;
209 xlnx,xcl0-linesize = <0x4>;
210 xlnx,xcl0-writexfer = <0x1>;
211 xlnx,xcl1-linesize = <0x4>;
212 xlnx,xcl1-writexfer = <0x1>;
213 xlnx,xcl2-linesize = <0x4>;
214 xlnx,xcl2-writexfer = <0x1>;
215 xlnx,xcl3-linesize = <0x4>;
216 xlnx,xcl3-writexfer = <0x1>;
217 } ;
218 Hard_Ethernet_MAC: xps-ll-temac@81c00000 {
219 #address-cells = <1>;
220 #size-cells = <1>;
221 compatible = "xlnx,compound";
222 ranges ;
223 ethernet@81c00000 {
224 compatible = "xlnx,xps-ll-temac-1.01.b", "xlnx,xps-ll-temac-1.00.a";
225 interrupt-parent = <&xps_intc_0>;
226 interrupts = < 5 2 >;
227 llink-connected = <&PIM3>;
228 local-mac-address = [ 00 0a 35 00 00 00 ];
229 reg = < 0x81c00000 0x40 >;
230 xlnx,bus2core-clk-ratio = <0x1>;
231 xlnx,phy-type = <0x1>;
232 xlnx,phyaddr = <0x1>;
233 xlnx,rxcsum = <0x0>;
234 xlnx,rxfifo = <0x1000>;
235 xlnx,temac-type = <0x0>;
236 xlnx,txcsum = <0x0>;
237 xlnx,txfifo = <0x1000>;
238 } ;
239 } ;
240 IIC_EEPROM: i2c@81600000 {
241 compatible = "xlnx,xps-iic-2.00.a";
242 interrupt-parent = <&xps_intc_0>;
243 interrupts = < 6 2 >;
244 reg = < 0x81600000 0x10000 >;
245 xlnx,clk-freq = <0x7735940>;
246 xlnx,family = "virtex5";
247 xlnx,gpo-width = <0x1>;
248 xlnx,iic-freq = <0x186a0>;
249 xlnx,scl-inertial-delay = <0x0>;
250 xlnx,sda-inertial-delay = <0x0>;
251 xlnx,ten-bit-adr = <0x0>;
252 } ;
253 LEDs_8Bit: gpio@81400000 {
254 compatible = "xlnx,xps-gpio-1.00.a";
255 interrupt-parent = <&xps_intc_0>;
256 interrupts = < 7 2 >;
257 reg = < 0x81400000 0x10000 >;
258 xlnx,all-inputs = <0x0>;
259 xlnx,all-inputs-2 = <0x0>;
260 xlnx,dout-default = <0x0>;
261 xlnx,dout-default-2 = <0x0>;
262 xlnx,family = "virtex5";
263 xlnx,gpio-width = <0x8>;
264 xlnx,interrupt-present = <0x1>;
265 xlnx,is-bidir = <0x1>;
266 xlnx,is-bidir-2 = <0x1>;
267 xlnx,is-dual = <0x0>;
268 xlnx,tri-default = <0xffffffff>;
269 xlnx,tri-default-2 = <0xffffffff>;
270 #gpio-cells = <2>;
271 gpio-controller;
272 } ;
273
274 gpio-leds {
275 compatible = "gpio-leds";
276
277 heartbeat {
278 label = "Heartbeat";
279 gpios = <&LEDs_8Bit 4 1>;
280 linux,default-trigger = "heartbeat";
281 };
282
283 yellow {
284 label = "Yellow";
285 gpios = <&LEDs_8Bit 5 1>;
286 };
287
288 red {
289 label = "Red";
290 gpios = <&LEDs_8Bit 6 1>;
291 };
292
293 green {
294 label = "Green";
295 gpios = <&LEDs_8Bit 7 1>;
296 };
297 } ;
298 RS232_Uart_1: serial@84000000 {
299 clock-frequency = <125000000>;
300 compatible = "xlnx,xps-uartlite-1.00.a";
301 current-speed = <115200>;
302 device_type = "serial";
303 interrupt-parent = <&xps_intc_0>;
304 interrupts = < 8 0 >;
305 port-number = <0>;
306 reg = < 0x84000000 0x10000 >;
307 xlnx,baudrate = <0x1c200>;
308 xlnx,data-bits = <0x8>;
309 xlnx,family = "virtex5";
310 xlnx,odd-parity = <0x0>;
311 xlnx,use-parity = <0x0>;
312 } ;
313 SysACE_CompactFlash: sysace@83600000 {
314 compatible = "xlnx,xps-sysace-1.00.a";
315 interrupt-parent = <&xps_intc_0>;
316 interrupts = < 4 2 >;
317 reg = < 0x83600000 0x10000 >;
318 xlnx,family = "virtex5";
319 xlnx,mem-width = <0x10>;
320 } ;
321 debug_module: debug@84400000 {
322 compatible = "xlnx,mdm-1.00.d";
323 reg = < 0x84400000 0x10000 >;
324 xlnx,family = "virtex5";
325 xlnx,interconnect = <0x1>;
326 xlnx,jtag-chain = <0x2>;
327 xlnx,mb-dbg-ports = <0x1>;
328 xlnx,uart-width = <0x8>;
329 xlnx,use-uart = <0x1>;
330 xlnx,write-fsl-ports = <0x0>;
331 } ;
332 mpmc@90000000 {
333 #address-cells = <1>;
334 #size-cells = <1>;
335 compatible = "xlnx,mpmc-4.02.a";
336 ranges ;
337 PIM3: sdma@84600180 {
338 compatible = "xlnx,ll-dma-1.00.a";
339 interrupt-parent = <&xps_intc_0>;
340 interrupts = < 2 2 1 2 >;
341 reg = < 0x84600180 0x80 >;
342 } ;
343 } ;
344 xps_intc_0: interrupt-controller@81800000 {
345 #interrupt-cells = <0x2>;
346 compatible = "xlnx,xps-intc-1.00.a";
347 interrupt-controller ;
348 reg = < 0x81800000 0x10000 >;
349 xlnx,kind-of-intr = <0x100>;
350 xlnx,num-intr-inputs = <0x9>;
351 } ;
352 xps_timer_1: timer@83c00000 {
353 compatible = "xlnx,xps-timer-1.00.a";
354 interrupt-parent = <&xps_intc_0>;
355 interrupts = < 3 2 >;
356 reg = < 0x83c00000 0x10000 >;
357 xlnx,count-width = <0x20>;
358 xlnx,family = "virtex5";
359 xlnx,gen0-assert = <0x1>;
360 xlnx,gen1-assert = <0x1>;
361 xlnx,one-timer-only = <0x0>;
362 xlnx,trig0-assert = <0x1>;
363 xlnx,trig1-assert = <0x1>;
364 } ;
365 } ;
366} ;
diff --git a/arch/microblaze/include/asm/io.h b/arch/microblaze/include/asm/io.h
index 3fbb7f1db3bc..1e4c3329f62e 100644
--- a/arch/microblaze/include/asm/io.h
+++ b/arch/microblaze/include/asm/io.h
@@ -15,7 +15,6 @@
15#include <asm/page.h> 15#include <asm/page.h>
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/mm.h> /* Get struct page {...} */ 17#include <linux/mm.h> /* Get struct page {...} */
18#include <asm-generic/iomap.h>
19 18
20#ifndef CONFIG_PCI 19#ifndef CONFIG_PCI
21#define _IO_BASE 0 20#define _IO_BASE 0
@@ -25,211 +24,32 @@
25#define _IO_BASE isa_io_base 24#define _IO_BASE isa_io_base
26#define _ISA_MEM_BASE isa_mem_base 25#define _ISA_MEM_BASE isa_mem_base
27#define PCI_DRAM_OFFSET pci_dram_offset 26#define PCI_DRAM_OFFSET pci_dram_offset
28#endif 27struct pci_dev;
28extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
29#define pci_iounmap pci_iounmap
29 30
30extern unsigned long isa_io_base; 31extern unsigned long isa_io_base;
31extern unsigned long pci_io_base;
32extern unsigned long pci_dram_offset; 32extern unsigned long pci_dram_offset;
33
34extern resource_size_t isa_mem_base; 33extern resource_size_t isa_mem_base;
34#endif
35 35
36#define PCI_IOBASE ((void __iomem *)_IO_BASE)
36#define IO_SPACE_LIMIT (0xFFFFFFFF) 37#define IO_SPACE_LIMIT (0xFFFFFFFF)
37 38
38/* the following is needed to support PCI with some drivers */
39
40#define mmiowb()
41
42static inline unsigned char __raw_readb(const volatile void __iomem *addr)
43{
44 return *(volatile unsigned char __force *)addr;
45}
46static inline unsigned short __raw_readw(const volatile void __iomem *addr)
47{
48 return *(volatile unsigned short __force *)addr;
49}
50static inline unsigned int __raw_readl(const volatile void __iomem *addr)
51{
52 return *(volatile unsigned int __force *)addr;
53}
54static inline unsigned long __raw_readq(const volatile void __iomem *addr)
55{
56 return *(volatile unsigned long __force *)addr;
57}
58static inline void __raw_writeb(unsigned char v, volatile void __iomem *addr)
59{
60 *(volatile unsigned char __force *)addr = v;
61}
62static inline void __raw_writew(unsigned short v, volatile void __iomem *addr)
63{
64 *(volatile unsigned short __force *)addr = v;
65}
66static inline void __raw_writel(unsigned int v, volatile void __iomem *addr)
67{
68 *(volatile unsigned int __force *)addr = v;
69}
70static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr)
71{
72 *(volatile unsigned long __force *)addr = v;
73}
74
75/*
76 * read (readb, readw, readl, readq) and write (writeb, writew,
77 * writel, writeq) accessors are for PCI and thus little endian.
78 * Linux 2.4 for Microblaze had this wrong.
79 */
80static inline unsigned char readb(const volatile void __iomem *addr)
81{
82 return *(volatile unsigned char __force *)addr;
83}
84static inline unsigned short readw(const volatile void __iomem *addr)
85{
86 return le16_to_cpu(*(volatile unsigned short __force *)addr);
87}
88static inline unsigned int readl(const volatile void __iomem *addr)
89{
90 return le32_to_cpu(*(volatile unsigned int __force *)addr);
91}
92#define readq readq
93static inline u64 readq(const volatile void __iomem *addr)
94{
95 return le64_to_cpu(__raw_readq(addr));
96}
97static inline void writeb(unsigned char v, volatile void __iomem *addr)
98{
99 *(volatile unsigned char __force *)addr = v;
100}
101static inline void writew(unsigned short v, volatile void __iomem *addr)
102{
103 *(volatile unsigned short __force *)addr = cpu_to_le16(v);
104}
105static inline void writel(unsigned int v, volatile void __iomem *addr)
106{
107 *(volatile unsigned int __force *)addr = cpu_to_le32(v);
108}
109#define writeq(b, addr) __raw_writeq(cpu_to_le64(b), addr)
110
111/* ioread and iowrite variants. thease are for now same as __raw_
112 * variants of accessors. we might check for endianess in the feature
113 */
114#define ioread8(addr) __raw_readb((u8 *)(addr))
115#define ioread16(addr) __raw_readw((u16 *)(addr))
116#define ioread32(addr) __raw_readl((u32 *)(addr))
117#define iowrite8(v, addr) __raw_writeb((u8)(v), (u8 *)(addr))
118#define iowrite16(v, addr) __raw_writew((u16)(v), (u16 *)(addr))
119#define iowrite32(v, addr) __raw_writel((u32)(v), (u32 *)(addr))
120
121#define ioread16be(addr) __raw_readw((u16 *)(addr))
122#define ioread32be(addr) __raw_readl((u32 *)(addr))
123#define iowrite16be(v, addr) __raw_writew((u16)(v), (u16 *)(addr))
124#define iowrite32be(v, addr) __raw_writel((u32)(v), (u32 *)(addr))
125
126/* These are the definitions for the x86 IO instructions
127 * inb/inw/inl/outb/outw/outl, the "string" versions
128 * insb/insw/insl/outsb/outsw/outsl, and the "pausing" versions
129 * inb_p/inw_p/...
130 * The macros don't do byte-swapping.
131 */
132#define inb(port) readb((u8 *)((unsigned long)(port)))
133#define outb(val, port) writeb((val), (u8 *)((unsigned long)(port)))
134#define inw(port) readw((u16 *)((unsigned long)(port)))
135#define outw(val, port) writew((val), (u16 *)((unsigned long)(port)))
136#define inl(port) readl((u32 *)((unsigned long)(port)))
137#define outl(val, port) writel((val), (u32 *)((unsigned long)(port)))
138
139#define inb_p(port) inb((port))
140#define outb_p(val, port) outb((val), (port))
141#define inw_p(port) inw((port))
142#define outw_p(val, port) outw((val), (port))
143#define inl_p(port) inl((port))
144#define outl_p(val, port) outl((val), (port))
145
146#define memset_io(a, b, c) memset((void *)(a), (b), (c))
147#define memcpy_fromio(a, b, c) memcpy((a), (void *)(b), (c))
148#define memcpy_toio(a, b, c) memcpy((void *)(a), (b), (c))
149
150#ifdef CONFIG_MMU 39#ifdef CONFIG_MMU
151
152#define phys_to_virt(addr) ((void *)__phys_to_virt(addr))
153#define virt_to_phys(addr) ((unsigned long)__virt_to_phys(addr))
154#define virt_to_bus(addr) ((unsigned long)__virt_to_phys(addr))
155
156#define page_to_bus(page) (page_to_phys(page)) 40#define page_to_bus(page) (page_to_phys(page))
157#define bus_to_virt(addr) (phys_to_virt(addr))
158 41
159extern void iounmap(void __iomem *addr); 42extern void iounmap(void __iomem *addr);
160/*extern void *__ioremap(phys_addr_t address, unsigned long size,
161 unsigned long flags);*/
162extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
163#define ioremap_writethrough(addr, size) ioremap((addr), (size))
164#define ioremap_nocache(addr, size) ioremap((addr), (size))
165#define ioremap_fullcache(addr, size) ioremap((addr), (size))
166
167#else /* CONFIG_MMU */
168
169/**
170 * virt_to_phys - map virtual addresses to physical
171 * @address: address to remap
172 *
173 * The returned physical address is the physical (CPU) mapping for
174 * the memory address given. It is only valid to use this function on
175 * addresses directly mapped or allocated via kmalloc.
176 *
177 * This function does not give bus mappings for DMA transfers. In
178 * almost all conceivable cases a device driver should not be using
179 * this function
180 */
181static inline unsigned long __iomem virt_to_phys(volatile void *address)
182{
183 return __pa((unsigned long)address);
184}
185
186#define virt_to_bus virt_to_phys
187
188/**
189 * phys_to_virt - map physical address to virtual
190 * @address: address to remap
191 *
192 * The returned virtual address is a current CPU mapping for
193 * the memory address given. It is only valid to use this function on
194 * addresses that have a kernel mapping
195 *
196 * This function does not handle bus mappings for DMA transfers. In
197 * almost all conceivable cases a device driver should not be using
198 * this function
199 */
200static inline void *phys_to_virt(unsigned long address)
201{
202 return (void *)__va(address);
203}
204 43
205#define bus_to_virt(a) phys_to_virt(a) 44extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
206 45#define ioremap_writethrough(addr, size) ioremap((addr), (size))
207static inline void __iomem *__ioremap(phys_addr_t address, unsigned long size, 46#define ioremap_nocache(addr, size) ioremap((addr), (size))
208 unsigned long flags) 47#define ioremap_fullcache(addr, size) ioremap((addr), (size))
209{ 48#define ioremap_wc(addr, size) ioremap((addr), (size))
210 return (void *)address;
211}
212
213#define ioremap(physaddr, size) ((void __iomem *)(unsigned long)(physaddr))
214#define iounmap(addr) ((void)0)
215#define ioremap_nocache(physaddr, size) ioremap(physaddr, size)
216 49
217#endif /* CONFIG_MMU */ 50#endif /* CONFIG_MMU */
218 51
219/* 52/* Big Endian */
220 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
221 * access
222 */
223#define xlate_dev_mem_ptr(p) __va(p)
224
225/*
226 * Convert a virtual cached pointer to an uncached pointer
227 */
228#define xlate_dev_kmem_ptr(p) p
229
230/*
231 * Big Endian
232 */
233#define out_be32(a, v) __raw_writel((v), (void __iomem __force *)(a)) 53#define out_be32(a, v) __raw_writel((v), (void __iomem __force *)(a))
234#define out_be16(a, v) __raw_writew((v), (a)) 54#define out_be16(a, v) __raw_writew((v), (a))
235 55
@@ -239,10 +59,7 @@ static inline void __iomem *__ioremap(phys_addr_t address, unsigned long size,
239#define writel_be(v, a) out_be32((__force unsigned *)a, v) 59#define writel_be(v, a) out_be32((__force unsigned *)a, v)
240#define readl_be(a) in_be32((__force unsigned *)a) 60#define readl_be(a) in_be32((__force unsigned *)a)
241 61
242/* 62/* Little endian */
243 * Little endian
244 */
245
246#define out_le32(a, v) __raw_writel(__cpu_to_le32(v), (a)) 63#define out_le32(a, v) __raw_writel(__cpu_to_le32(v), (a))
247#define out_le16(a, v) __raw_writew(__cpu_to_le16(v), (a)) 64#define out_le16(a, v) __raw_writew(__cpu_to_le16(v), (a))
248 65
@@ -253,100 +70,7 @@ static inline void __iomem *__ioremap(phys_addr_t address, unsigned long size,
253#define out_8(a, v) __raw_writeb((v), (a)) 70#define out_8(a, v) __raw_writeb((v), (a))
254#define in_8(a) __raw_readb(a) 71#define in_8(a) __raw_readb(a)
255 72
256#define mmiowb() 73#include <asm-generic/io.h>
257
258#define ioport_map(port, nr) ((void __iomem *)(port))
259#define ioport_unmap(addr)
260
261/* from asm-generic/io.h */
262#ifndef insb
263static inline void insb(unsigned long addr, void *buffer, int count)
264{
265 if (count) {
266 u8 *buf = buffer;
267 do {
268 u8 x = inb(addr);
269 *buf++ = x;
270 } while (--count);
271 }
272}
273#endif
274
275#ifndef insw
276static inline void insw(unsigned long addr, void *buffer, int count)
277{
278 if (count) {
279 u16 *buf = buffer;
280 do {
281 u16 x = inw(addr);
282 *buf++ = x;
283 } while (--count);
284 }
285}
286#endif
287
288#ifndef insl
289static inline void insl(unsigned long addr, void *buffer, int count)
290{
291 if (count) {
292 u32 *buf = buffer;
293 do {
294 u32 x = inl(addr);
295 *buf++ = x;
296 } while (--count);
297 }
298}
299#endif
300
301#ifndef outsb
302static inline void outsb(unsigned long addr, const void *buffer, int count)
303{
304 if (count) {
305 const u8 *buf = buffer;
306 do {
307 outb(*buf++, addr);
308 } while (--count);
309 }
310}
311#endif
312
313#ifndef outsw
314static inline void outsw(unsigned long addr, const void *buffer, int count)
315{
316 if (count) {
317 const u16 *buf = buffer;
318 do {
319 outw(*buf++, addr);
320 } while (--count);
321 }
322}
323#endif
324
325#ifndef outsl
326static inline void outsl(unsigned long addr, const void *buffer, int count)
327{
328 if (count) {
329 const u32 *buf = buffer;
330 do {
331 outl(*buf++, addr);
332 } while (--count);
333 }
334}
335#endif
336
337#define ioread8_rep(p, dst, count) \
338 insb((unsigned long) (p), (dst), (count))
339#define ioread16_rep(p, dst, count) \
340 insw((unsigned long) (p), (dst), (count))
341#define ioread32_rep(p, dst, count) \
342 insl((unsigned long) (p), (dst), (count))
343
344#define iowrite8_rep(p, src, count) \
345 outsb((unsigned long) (p), (src), (count))
346#define iowrite16_rep(p, src, count) \
347 outsw((unsigned long) (p), (src), (count))
348#define iowrite32_rep(p, src, count) \
349 outsl((unsigned long) (p), (src), (count))
350 74
351#define readb_relaxed readb 75#define readb_relaxed readb
352#define readw_relaxed readw 76#define readw_relaxed readw
diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h
index d6e0ffea28b6..9d31b057c355 100644
--- a/arch/microblaze/include/asm/processor.h
+++ b/arch/microblaze/include/asm/processor.h
@@ -122,7 +122,7 @@ struct thread_struct {
122} 122}
123 123
124/* Free all resources held by a thread. */ 124/* Free all resources held by a thread. */
125extern inline void release_thread(struct task_struct *dead_task) 125static inline void release_thread(struct task_struct *dead_task)
126{ 126{
127} 127}
128 128
diff --git a/arch/microblaze/include/asm/setup.h b/arch/microblaze/include/asm/setup.h
index f05df5630c84..be84a4d3917f 100644
--- a/arch/microblaze/include/asm/setup.h
+++ b/arch/microblaze/include/asm/setup.h
@@ -19,14 +19,12 @@ extern char cmd_line[COMMAND_LINE_SIZE];
19 19
20extern char *klimit; 20extern char *klimit;
21 21
22void early_printk(const char *fmt, ...);
23
24int setup_early_printk(char *opt); 22int setup_early_printk(char *opt);
25void remap_early_printk(void); 23void remap_early_printk(void);
26void disable_early_printk(void); 24void disable_early_printk(void);
27 25
28void heartbeat(void); 26void microblaze_heartbeat(void);
29void setup_heartbeat(void); 27void microblaze_setup_heartbeat(void);
30 28
31# ifdef CONFIG_MMU 29# ifdef CONFIG_MMU
32extern void mmu_reset(void); 30extern void mmu_reset(void);
diff --git a/arch/microblaze/include/uapi/asm/unistd.h b/arch/microblaze/include/uapi/asm/unistd.h
index 20043b67d158..8d0791b49b31 100644
--- a/arch/microblaze/include/uapi/asm/unistd.h
+++ b/arch/microblaze/include/uapi/asm/unistd.h
@@ -93,7 +93,7 @@
93#define __NR_settimeofday 79 /* ok */ 93#define __NR_settimeofday 79 /* ok */
94#define __NR_getgroups 80 /* ok */ 94#define __NR_getgroups 80 /* ok */
95#define __NR_setgroups 81 /* ok */ 95#define __NR_setgroups 81 /* ok */
96#define __NR_select 82 /* obsolete -> sys_pselect7 */ 96#define __NR_select 82 /* obsolete -> sys_pselect6 */
97#define __NR_symlink 83 /* symlinkat */ 97#define __NR_symlink 83 /* symlinkat */
98#define __NR_oldlstat 84 /* remove */ 98#define __NR_oldlstat 84 /* remove */
99#define __NR_readlink 85 /* obsolete -> sys_readlinkat */ 99#define __NR_readlink 85 /* obsolete -> sys_readlinkat */
@@ -320,7 +320,7 @@
320#define __NR_readlinkat 305 /* ok */ 320#define __NR_readlinkat 305 /* ok */
321#define __NR_fchmodat 306 /* ok */ 321#define __NR_fchmodat 306 /* ok */
322#define __NR_faccessat 307 /* ok */ 322#define __NR_faccessat 307 /* ok */
323#define __NR_pselect6 308 /* obsolete -> sys_pselect7 */ 323#define __NR_pselect6 308 /* ok */
324#define __NR_ppoll 309 /* ok */ 324#define __NR_ppoll 309 /* ok */
325#define __NR_unshare 310 /* ok */ 325#define __NR_unshare 310 /* ok */
326#define __NR_set_robust_list 311 /* ok */ 326#define __NR_set_robust_list 311 /* ok */
@@ -396,5 +396,7 @@
396#define __NR_process_vm_writev 378 396#define __NR_process_vm_writev 378
397#define __NR_kcmp 379 397#define __NR_kcmp 379
398#define __NR_finit_module 380 398#define __NR_finit_module 380
399#define __NR_sched_setattr 381
400#define __NR_sched_getattr 382
399 401
400#endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */ 402#endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */
diff --git a/arch/microblaze/kernel/Makefile b/arch/microblaze/kernel/Makefile
index 5b0e512c78e5..08d50cc55e7d 100644
--- a/arch/microblaze/kernel/Makefile
+++ b/arch/microblaze/kernel/Makefile
@@ -16,7 +16,7 @@ extra-y := head.o vmlinux.lds
16 16
17obj-y += dma.o exceptions.o \ 17obj-y += dma.o exceptions.o \
18 hw_exception_handler.o intc.o irq.o \ 18 hw_exception_handler.o intc.o irq.o \
19 process.o prom.o prom_parse.o ptrace.o \ 19 platform.o process.o prom.o prom_parse.o ptrace.o \
20 reset.o setup.o signal.o sys_microblaze.o timer.o traps.o unwind.o 20 reset.o setup.o signal.o sys_microblaze.o timer.o traps.o unwind.o
21 21
22obj-y += cpu/ 22obj-y += cpu/
diff --git a/arch/microblaze/kernel/ftrace.c b/arch/microblaze/kernel/ftrace.c
index e8a5e9cf4ed1..bbcd2533766c 100644
--- a/arch/microblaze/kernel/ftrace.c
+++ b/arch/microblaze/kernel/ftrace.c
@@ -171,11 +171,8 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
171 return ret; 171 return ret;
172} 172}
173 173
174int __init ftrace_dyn_arch_init(void *data) 174int __init ftrace_dyn_arch_init(void)
175{ 175{
176 /* The return code is retured via data */
177 *(unsigned long *)data = 0;
178
179 return 0; 176 return 0;
180} 177}
181 178
diff --git a/arch/microblaze/kernel/heartbeat.c b/arch/microblaze/kernel/heartbeat.c
index 1879a0527776..4643e3ab9414 100644
--- a/arch/microblaze/kernel/heartbeat.c
+++ b/arch/microblaze/kernel/heartbeat.c
@@ -17,7 +17,7 @@
17 17
18static unsigned int base_addr; 18static unsigned int base_addr;
19 19
20void heartbeat(void) 20void microblaze_heartbeat(void)
21{ 21{
22 static unsigned int cnt, period, dist; 22 static unsigned int cnt, period, dist;
23 23
@@ -42,7 +42,7 @@ void heartbeat(void)
42 } 42 }
43} 43}
44 44
45void setup_heartbeat(void) 45void microblaze_setup_heartbeat(void)
46{ 46{
47 struct device_node *gpio = NULL; 47 struct device_node *gpio = NULL;
48 int *prop; 48 int *prop;
diff --git a/arch/microblaze/kernel/intc.c b/arch/microblaze/kernel/intc.c
index 581451ad4687..15c7c12ea0e7 100644
--- a/arch/microblaze/kernel/intc.c
+++ b/arch/microblaze/kernel/intc.c
@@ -32,6 +32,29 @@ static void __iomem *intc_baseaddr;
32#define MER_ME (1<<0) 32#define MER_ME (1<<0)
33#define MER_HIE (1<<1) 33#define MER_HIE (1<<1)
34 34
35static unsigned int (*read_fn)(void __iomem *);
36static void (*write_fn)(u32, void __iomem *);
37
38static void intc_write32(u32 val, void __iomem *addr)
39{
40 iowrite32(val, addr);
41}
42
43static unsigned int intc_read32(void __iomem *addr)
44{
45 return ioread32(addr);
46}
47
48static void intc_write32_be(u32 val, void __iomem *addr)
49{
50 iowrite32be(val, addr);
51}
52
53static unsigned int intc_read32_be(void __iomem *addr)
54{
55 return ioread32be(addr);
56}
57
35static void intc_enable_or_unmask(struct irq_data *d) 58static void intc_enable_or_unmask(struct irq_data *d)
36{ 59{
37 unsigned long mask = 1 << d->hwirq; 60 unsigned long mask = 1 << d->hwirq;
@@ -43,21 +66,21 @@ static void intc_enable_or_unmask(struct irq_data *d)
43 * acks the irq before calling the interrupt handler 66 * acks the irq before calling the interrupt handler
44 */ 67 */
45 if (irqd_is_level_type(d)) 68 if (irqd_is_level_type(d))
46 out_be32(intc_baseaddr + IAR, mask); 69 write_fn(mask, intc_baseaddr + IAR);
47 70
48 out_be32(intc_baseaddr + SIE, mask); 71 write_fn(mask, intc_baseaddr + SIE);
49} 72}
50 73
51static void intc_disable_or_mask(struct irq_data *d) 74static void intc_disable_or_mask(struct irq_data *d)
52{ 75{
53 pr_debug("disable: %ld\n", d->hwirq); 76 pr_debug("disable: %ld\n", d->hwirq);
54 out_be32(intc_baseaddr + CIE, 1 << d->hwirq); 77 write_fn(1 << d->hwirq, intc_baseaddr + CIE);
55} 78}
56 79
57static void intc_ack(struct irq_data *d) 80static void intc_ack(struct irq_data *d)
58{ 81{
59 pr_debug("ack: %ld\n", d->hwirq); 82 pr_debug("ack: %ld\n", d->hwirq);
60 out_be32(intc_baseaddr + IAR, 1 << d->hwirq); 83 write_fn(1 << d->hwirq, intc_baseaddr + IAR);
61} 84}
62 85
63static void intc_mask_ack(struct irq_data *d) 86static void intc_mask_ack(struct irq_data *d)
@@ -65,8 +88,8 @@ static void intc_mask_ack(struct irq_data *d)
65 unsigned long mask = 1 << d->hwirq; 88 unsigned long mask = 1 << d->hwirq;
66 89
67 pr_debug("disable_and_ack: %ld\n", d->hwirq); 90 pr_debug("disable_and_ack: %ld\n", d->hwirq);
68 out_be32(intc_baseaddr + CIE, mask); 91 write_fn(mask, intc_baseaddr + CIE);
69 out_be32(intc_baseaddr + IAR, mask); 92 write_fn(mask, intc_baseaddr + IAR);
70} 93}
71 94
72static struct irq_chip intc_dev = { 95static struct irq_chip intc_dev = {
@@ -83,7 +106,7 @@ unsigned int get_irq(void)
83{ 106{
84 unsigned int hwirq, irq = -1; 107 unsigned int hwirq, irq = -1;
85 108
86 hwirq = in_be32(intc_baseaddr + IVR); 109 hwirq = read_fn(intc_baseaddr + IVR);
87 if (hwirq != -1U) 110 if (hwirq != -1U)
88 irq = irq_find_mapping(root_domain, hwirq); 111 irq = irq_find_mapping(root_domain, hwirq);
89 112
@@ -140,17 +163,25 @@ static int __init xilinx_intc_of_init(struct device_node *intc,
140 pr_info("%s: num_irq=%d, edge=0x%x\n", 163 pr_info("%s: num_irq=%d, edge=0x%x\n",
141 intc->full_name, nr_irq, intr_mask); 164 intc->full_name, nr_irq, intr_mask);
142 165
166 write_fn = intc_write32;
167 read_fn = intc_read32;
168
143 /* 169 /*
144 * Disable all external interrupts until they are 170 * Disable all external interrupts until they are
145 * explicity requested. 171 * explicity requested.
146 */ 172 */
147 out_be32(intc_baseaddr + IER, 0); 173 write_fn(0, intc_baseaddr + IER);
148 174
149 /* Acknowledge any pending interrupts just in case. */ 175 /* Acknowledge any pending interrupts just in case. */
150 out_be32(intc_baseaddr + IAR, 0xffffffff); 176 write_fn(0xffffffff, intc_baseaddr + IAR);
151 177
152 /* Turn on the Master Enable. */ 178 /* Turn on the Master Enable. */
153 out_be32(intc_baseaddr + MER, MER_HIE | MER_ME); 179 write_fn(MER_HIE | MER_ME, intc_baseaddr + MER);
180 if (!(read_fn(intc_baseaddr + MER) & (MER_HIE | MER_ME))) {
181 write_fn = intc_write32_be;
182 read_fn = intc_read32_be;
183 write_fn(MER_HIE | MER_ME, intc_baseaddr + MER);
184 }
154 185
155 /* Yeah, okay, casting the intr_mask to a void* is butt-ugly, but I'm 186 /* Yeah, okay, casting the intr_mask to a void* is butt-ugly, but I'm
156 * lazy and Michal can clean it up to something nicer when he tests 187 * lazy and Michal can clean it up to something nicer when he tests
diff --git a/arch/microblaze/platform/platform.c b/arch/microblaze/kernel/platform.c
index b9529caa507a..b9529caa507a 100644
--- a/arch/microblaze/platform/platform.c
+++ b/arch/microblaze/kernel/platform.c
diff --git a/arch/microblaze/kernel/process.c b/arch/microblaze/kernel/process.c
index 7d1a9c8b1f3d..b2dd37196b3b 100644
--- a/arch/microblaze/kernel/process.c
+++ b/arch/microblaze/kernel/process.c
@@ -8,6 +8,7 @@
8 * for more details. 8 * for more details.
9 */ 9 */
10 10
11#include <linux/cpu.h>
11#include <linux/export.h> 12#include <linux/export.h>
12#include <linux/sched.h> 13#include <linux/sched.h>
13#include <linux/pm.h> 14#include <linux/pm.h>
diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c
index d26d7e7a6913..49a07a4d76d0 100644
--- a/arch/microblaze/kernel/signal.c
+++ b/arch/microblaze/kernel/signal.c
@@ -216,7 +216,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
216 /* MS: I need add offset in page */ 216 /* MS: I need add offset in page */
217 address += ((unsigned long)frame->tramp) & ~PAGE_MASK; 217 address += ((unsigned long)frame->tramp) & ~PAGE_MASK;
218 /* MS address is virtual */ 218 /* MS address is virtual */
219 address = virt_to_phys(address); 219 address = __virt_to_phys(address);
220 invalidate_icache_range(address, address + 8); 220 invalidate_icache_range(address, address + 8);
221 flush_dcache_range(address, address + 8); 221 flush_dcache_range(address, address + 8);
222 } 222 }
diff --git a/arch/microblaze/kernel/syscall_table.S b/arch/microblaze/kernel/syscall_table.S
index b882ad50535b..329dfbad810b 100644
--- a/arch/microblaze/kernel/syscall_table.S
+++ b/arch/microblaze/kernel/syscall_table.S
@@ -308,7 +308,7 @@ ENTRY(sys_call_table)
308 .long sys_readlinkat /* 305 */ 308 .long sys_readlinkat /* 305 */
309 .long sys_fchmodat 309 .long sys_fchmodat
310 .long sys_faccessat 310 .long sys_faccessat
311 .long sys_ni_syscall /* pselect6 */ 311 .long sys_pselect6
312 .long sys_ppoll 312 .long sys_ppoll
313 .long sys_unshare /* 310 */ 313 .long sys_unshare /* 310 */
314 .long sys_set_robust_list 314 .long sys_set_robust_list
@@ -363,8 +363,8 @@ ENTRY(sys_call_table)
363 .long sys_sendmsg /* 360 */ 363 .long sys_sendmsg /* 360 */
364 .long sys_recvmsg 364 .long sys_recvmsg
365 .long sys_accept4 365 .long sys_accept4
366 .long sys_ni_syscall 366 .long sys_preadv
367 .long sys_ni_syscall 367 .long sys_pwritev
368 .long sys_rt_tgsigqueueinfo /* 365 */ 368 .long sys_rt_tgsigqueueinfo /* 365 */
369 .long sys_perf_event_open 369 .long sys_perf_event_open
370 .long sys_recvmmsg 370 .long sys_recvmmsg
@@ -381,3 +381,5 @@ ENTRY(sys_call_table)
381 .long sys_process_vm_writev 381 .long sys_process_vm_writev
382 .long sys_kcmp 382 .long sys_kcmp
383 .long sys_finit_module 383 .long sys_finit_module
384 .long sys_sched_setattr
385 .long sys_sched_getattr
diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c
index fb0c61443f19..dd96f0e4bfa2 100644
--- a/arch/microblaze/kernel/timer.c
+++ b/arch/microblaze/kernel/timer.c
@@ -43,10 +43,33 @@ static unsigned int timer_clock_freq;
43#define TCSR_PWMA (1<<9) 43#define TCSR_PWMA (1<<9)
44#define TCSR_ENALL (1<<10) 44#define TCSR_ENALL (1<<10)
45 45
46static unsigned int (*read_fn)(void __iomem *);
47static void (*write_fn)(u32, void __iomem *);
48
49static void timer_write32(u32 val, void __iomem *addr)
50{
51 iowrite32(val, addr);
52}
53
54static unsigned int timer_read32(void __iomem *addr)
55{
56 return ioread32(addr);
57}
58
59static void timer_write32_be(u32 val, void __iomem *addr)
60{
61 iowrite32be(val, addr);
62}
63
64static unsigned int timer_read32_be(void __iomem *addr)
65{
66 return ioread32be(addr);
67}
68
46static inline void xilinx_timer0_stop(void) 69static inline void xilinx_timer0_stop(void)
47{ 70{
48 out_be32(timer_baseaddr + TCSR0, 71 write_fn(read_fn(timer_baseaddr + TCSR0) & ~TCSR_ENT,
49 in_be32(timer_baseaddr + TCSR0) & ~TCSR_ENT); 72 timer_baseaddr + TCSR0);
50} 73}
51 74
52static inline void xilinx_timer0_start_periodic(unsigned long load_val) 75static inline void xilinx_timer0_start_periodic(unsigned long load_val)
@@ -54,10 +77,10 @@ static inline void xilinx_timer0_start_periodic(unsigned long load_val)
54 if (!load_val) 77 if (!load_val)
55 load_val = 1; 78 load_val = 1;
56 /* loading value to timer reg */ 79 /* loading value to timer reg */
57 out_be32(timer_baseaddr + TLR0, load_val); 80 write_fn(load_val, timer_baseaddr + TLR0);
58 81
59 /* load the initial value */ 82 /* load the initial value */
60 out_be32(timer_baseaddr + TCSR0, TCSR_LOAD); 83 write_fn(TCSR_LOAD, timer_baseaddr + TCSR0);
61 84
62 /* see timer data sheet for detail 85 /* see timer data sheet for detail
63 * !ENALL - don't enable 'em all 86 * !ENALL - don't enable 'em all
@@ -72,8 +95,8 @@ static inline void xilinx_timer0_start_periodic(unsigned long load_val)
72 * UDT - set the timer as down counter 95 * UDT - set the timer as down counter
73 * !MDT0 - generate mode 96 * !MDT0 - generate mode
74 */ 97 */
75 out_be32(timer_baseaddr + TCSR0, 98 write_fn(TCSR_TINT|TCSR_ENIT|TCSR_ENT|TCSR_ARHT|TCSR_UDT,
76 TCSR_TINT|TCSR_ENIT|TCSR_ENT|TCSR_ARHT|TCSR_UDT); 99 timer_baseaddr + TCSR0);
77} 100}
78 101
79static inline void xilinx_timer0_start_oneshot(unsigned long load_val) 102static inline void xilinx_timer0_start_oneshot(unsigned long load_val)
@@ -81,13 +104,13 @@ static inline void xilinx_timer0_start_oneshot(unsigned long load_val)
81 if (!load_val) 104 if (!load_val)
82 load_val = 1; 105 load_val = 1;
83 /* loading value to timer reg */ 106 /* loading value to timer reg */
84 out_be32(timer_baseaddr + TLR0, load_val); 107 write_fn(load_val, timer_baseaddr + TLR0);
85 108
86 /* load the initial value */ 109 /* load the initial value */
87 out_be32(timer_baseaddr + TCSR0, TCSR_LOAD); 110 write_fn(TCSR_LOAD, timer_baseaddr + TCSR0);
88 111
89 out_be32(timer_baseaddr + TCSR0, 112 write_fn(TCSR_TINT|TCSR_ENIT|TCSR_ENT|TCSR_ARHT|TCSR_UDT,
90 TCSR_TINT|TCSR_ENIT|TCSR_ENT|TCSR_ARHT|TCSR_UDT); 113 timer_baseaddr + TCSR0);
91} 114}
92 115
93static int xilinx_timer_set_next_event(unsigned long delta, 116static int xilinx_timer_set_next_event(unsigned long delta,
@@ -133,14 +156,14 @@ static struct clock_event_device clockevent_xilinx_timer = {
133 156
134static inline void timer_ack(void) 157static inline void timer_ack(void)
135{ 158{
136 out_be32(timer_baseaddr + TCSR0, in_be32(timer_baseaddr + TCSR0)); 159 write_fn(read_fn(timer_baseaddr + TCSR0), timer_baseaddr + TCSR0);
137} 160}
138 161
139static irqreturn_t timer_interrupt(int irq, void *dev_id) 162static irqreturn_t timer_interrupt(int irq, void *dev_id)
140{ 163{
141 struct clock_event_device *evt = &clockevent_xilinx_timer; 164 struct clock_event_device *evt = &clockevent_xilinx_timer;
142#ifdef CONFIG_HEART_BEAT 165#ifdef CONFIG_HEART_BEAT
143 heartbeat(); 166 microblaze_heartbeat();
144#endif 167#endif
145 timer_ack(); 168 timer_ack();
146 evt->event_handler(evt); 169 evt->event_handler(evt);
@@ -169,7 +192,7 @@ static __init void xilinx_clockevent_init(void)
169 192
170static u64 xilinx_clock_read(void) 193static u64 xilinx_clock_read(void)
171{ 194{
172 return in_be32(timer_baseaddr + TCR1); 195 return read_fn(timer_baseaddr + TCR1);
173} 196}
174 197
175static cycle_t xilinx_read(struct clocksource *cs) 198static cycle_t xilinx_read(struct clocksource *cs)
@@ -217,10 +240,10 @@ static int __init xilinx_clocksource_init(void)
217 panic("failed to register clocksource"); 240 panic("failed to register clocksource");
218 241
219 /* stop timer1 */ 242 /* stop timer1 */
220 out_be32(timer_baseaddr + TCSR1, 243 write_fn(read_fn(timer_baseaddr + TCSR1) & ~TCSR_ENT,
221 in_be32(timer_baseaddr + TCSR1) & ~TCSR_ENT); 244 timer_baseaddr + TCSR1);
222 /* start timer1 - up counting without interrupt */ 245 /* start timer1 - up counting without interrupt */
223 out_be32(timer_baseaddr + TCSR1, TCSR_TINT|TCSR_ENT|TCSR_ARHT); 246 write_fn(TCSR_TINT|TCSR_ENT|TCSR_ARHT, timer_baseaddr + TCSR1);
224 247
225 /* register timecounter - for ftrace support */ 248 /* register timecounter - for ftrace support */
226 init_xilinx_timecounter(); 249 init_xilinx_timecounter();
@@ -245,6 +268,15 @@ static void __init xilinx_timer_init(struct device_node *timer)
245 BUG(); 268 BUG();
246 } 269 }
247 270
271 write_fn = timer_write32;
272 read_fn = timer_read32;
273
274 write_fn(TCSR_MDT, timer_baseaddr + TCSR0);
275 if (!(read_fn(timer_baseaddr + TCSR0) & TCSR_MDT)) {
276 write_fn = timer_write32_be;
277 read_fn = timer_read32_be;
278 }
279
248 irq = irq_of_parse_and_map(timer, 0); 280 irq = irq_of_parse_and_map(timer, 0);
249 281
250 of_property_read_u32(timer, "xlnx,one-timer-only", &timer_num); 282 of_property_read_u32(timer, "xlnx,one-timer-only", &timer_num);
@@ -274,7 +306,7 @@ static void __init xilinx_timer_init(struct device_node *timer)
274 306
275 setup_irq(irq, &timer_irqaction); 307 setup_irq(irq, &timer_irqaction);
276#ifdef CONFIG_HEART_BEAT 308#ifdef CONFIG_HEART_BEAT
277 setup_heartbeat(); 309 microblaze_setup_heartbeat();
278#endif 310#endif
279 xilinx_clocksource_init(); 311 xilinx_clocksource_init();
280 xilinx_clockevent_init(); 312 xilinx_clockevent_init();
diff --git a/arch/microblaze/mm/consistent.c b/arch/microblaze/mm/consistent.c
index dbbf2246a260..e10ad930895e 100644
--- a/arch/microblaze/mm/consistent.c
+++ b/arch/microblaze/mm/consistent.c
@@ -117,7 +117,7 @@ void *consistent_alloc(gfp_t gfp, size_t size, dma_addr_t *dma_handle)
117 ret = (void *)va; 117 ret = (void *)va;
118 118
119 /* This gives us the real physical address of the first page. */ 119 /* This gives us the real physical address of the first page. */
120 *dma_handle = pa = virt_to_bus((void *)vaddr); 120 *dma_handle = pa = __virt_to_phys(vaddr);
121#endif 121#endif
122 122
123 /* 123 /*
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index 89077d346714..77bc7c7e6522 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -369,7 +369,7 @@ asmlinkage void __init mmu_init(void)
369 if (initrd_start) { 369 if (initrd_start) {
370 unsigned long size; 370 unsigned long size;
371 size = initrd_end - initrd_start; 371 size = initrd_end - initrd_start;
372 memblock_reserve(virt_to_phys(initrd_start), size); 372 memblock_reserve(__virt_to_phys(initrd_start), size);
373 } 373 }
374#endif /* CONFIG_BLK_DEV_INITRD */ 374#endif /* CONFIG_BLK_DEV_INITRD */
375 375
diff --git a/arch/microblaze/mm/pgtable.c b/arch/microblaze/mm/pgtable.c
index 10b3bd0a980d..4f4520e779a5 100644
--- a/arch/microblaze/mm/pgtable.c
+++ b/arch/microblaze/mm/pgtable.c
@@ -69,10 +69,11 @@ static void __iomem *__ioremap(phys_addr_t addr, unsigned long size,
69 * 69 *
70 * However, allow remap of rootfs: TBD 70 * However, allow remap of rootfs: TBD
71 */ 71 */
72
72 if (mem_init_done && 73 if (mem_init_done &&
73 p >= memory_start && p < virt_to_phys(high_memory) && 74 p >= memory_start && p < virt_to_phys(high_memory) &&
74 !(p >= virt_to_phys((unsigned long)&__bss_stop) && 75 !(p >= __virt_to_phys((phys_addr_t)__bss_stop) &&
75 p < virt_to_phys((unsigned long)__bss_stop))) { 76 p < __virt_to_phys((phys_addr_t)__bss_stop))) {
76 pr_warn("__ioremap(): phys addr "PTE_FMT" is RAM lr %pf\n", 77 pr_warn("__ioremap(): phys addr "PTE_FMT" is RAM lr %pf\n",
77 (unsigned long)p, __builtin_return_address(0)); 78 (unsigned long)p, __builtin_return_address(0));
78 return NULL; 79 return NULL;
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c
index 66804adcacf0..70996cc66aa2 100644
--- a/arch/microblaze/pci/pci-common.c
+++ b/arch/microblaze/pci/pci-common.c
@@ -1294,11 +1294,6 @@ void pcibios_finish_adding_to_bus(struct pci_bus *bus)
1294} 1294}
1295EXPORT_SYMBOL_GPL(pcibios_finish_adding_to_bus); 1295EXPORT_SYMBOL_GPL(pcibios_finish_adding_to_bus);
1296 1296
1297int pcibios_enable_device(struct pci_dev *dev, int mask)
1298{
1299 return pci_enable_resources(dev, mask);
1300}
1301
1302static void pcibios_setup_phb_resources(struct pci_controller *hose, 1297static void pcibios_setup_phb_resources(struct pci_controller *hose,
1303 struct list_head *resources) 1298 struct list_head *resources)
1304{ 1299{
diff --git a/arch/microblaze/platform/Makefile b/arch/microblaze/platform/Makefile
deleted file mode 100644
index ea1b75cc5775..000000000000
--- a/arch/microblaze/platform/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
1#
2# Makefile for arch/microblaze/platform directory
3#
4#obj-$(CONFIG_PLATFORM_GENERIC) += generic/
5
6obj-y += platform.o
diff --git a/arch/microblaze/platform/generic/Kconfig.auto b/arch/microblaze/platform/generic/Kconfig.auto
deleted file mode 100644
index 25a6f019e94d..000000000000
--- a/arch/microblaze/platform/generic/Kconfig.auto
+++ /dev/null
@@ -1,61 +0,0 @@
1#
2# (C) Copyright 2007 Michal Simek
3#
4# Michal SIMEK <monstr@monstr.eu>
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; either version 2 of
9# the License, or (at your option) any later version.
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., 59 Temple Place, Suite 330, Boston,
19# MA 02111-1307 USA
20#
21
22# Definitions for MICROBLAZE0
23comment "Definitions for MICROBLAZE0"
24
25config KERNEL_BASE_ADDR
26 hex "Physical address where Linux Kernel is"
27 default "0x90000000"
28 help
29 BASE Address for kernel
30
31config XILINX_MICROBLAZE0_FAMILY
32 string "Targeted FPGA family"
33 default "virtex5"
34
35config XILINX_MICROBLAZE0_USE_MSR_INSTR
36 int "USE_MSR_INSTR range (0:1)"
37 default 0
38
39config XILINX_MICROBLAZE0_USE_PCMP_INSTR
40 int "USE_PCMP_INSTR range (0:1)"
41 default 0
42
43config XILINX_MICROBLAZE0_USE_BARREL
44 int "USE_BARREL range (0:1)"
45 default 0
46
47config XILINX_MICROBLAZE0_USE_DIV
48 int "USE_DIV range (0:1)"
49 default 0
50
51config XILINX_MICROBLAZE0_USE_HW_MUL
52 int "USE_HW_MUL values (0=NONE, 1=MUL32, 2=MUL64)"
53 default 0
54
55config XILINX_MICROBLAZE0_USE_FPU
56 int "USE_FPU values (0=NONE, 1=BASIC, 2=EXTENDED)"
57 default 0
58
59config XILINX_MICROBLAZE0_HW_VER
60 string "Core version number"
61 default 7.10.d
diff --git a/arch/microblaze/platform/generic/Makefile b/arch/microblaze/platform/generic/Makefile
deleted file mode 100644
index 9a8b1bd3fa6d..000000000000
--- a/arch/microblaze/platform/generic/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
1#
2# Empty Makefile to keep make clean happy
3#
diff --git a/arch/microblaze/platform/generic/system.dts b/arch/microblaze/platform/generic/system.dts
deleted file mode 100644
index b620da23febb..000000000000
--- a/arch/microblaze/platform/generic/system.dts
+++ /dev/null
@@ -1,366 +0,0 @@
1/*
2 * Device Tree Generator version: 1.1
3 *
4 * (C) Copyright 2007-2008 Xilinx, Inc.
5 * (C) Copyright 2007-2009 Michal Simek
6 *
7 * Michal SIMEK <monstr@monstr.eu>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (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
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
22 * MA 02111-1307 USA
23 *
24 * CAUTION: This file is automatically generated by libgen.
25 * Version: Xilinx EDK 10.1.03 EDK_K_SP3.6
26 *
27 * XPS project directory: Xilinx-ML505-ll_temac-sgdma-MMU-FDT-edk101
28 */
29
30/dts-v1/;
31/ {
32 #address-cells = <1>;
33 #size-cells = <1>;
34 compatible = "xlnx,microblaze";
35 hard-reset-gpios = <&LEDs_8Bit 2 1>;
36 model = "testing";
37 DDR2_SDRAM: memory@90000000 {
38 device_type = "memory";
39 reg = < 0x90000000 0x10000000 >;
40 } ;
41 aliases {
42 ethernet0 = &Hard_Ethernet_MAC;
43 serial0 = &RS232_Uart_1;
44 } ;
45 chosen {
46 bootargs = "console=ttyUL0,115200 highres=on";
47 linux,stdout-path = "/plb@0/serial@84000000";
48 } ;
49 cpus {
50 #address-cells = <1>;
51 #cpus = <0x1>;
52 #size-cells = <0>;
53 microblaze_0: cpu@0 {
54 clock-frequency = <125000000>;
55 compatible = "xlnx,microblaze-7.10.d";
56 d-cache-baseaddr = <0x90000000>;
57 d-cache-highaddr = <0x9fffffff>;
58 d-cache-line-size = <0x10>;
59 d-cache-size = <0x2000>;
60 device_type = "cpu";
61 i-cache-baseaddr = <0x90000000>;
62 i-cache-highaddr = <0x9fffffff>;
63 i-cache-line-size = <0x10>;
64 i-cache-size = <0x2000>;
65 model = "microblaze,7.10.d";
66 reg = <0>;
67 timebase-frequency = <125000000>;
68 xlnx,addr-tag-bits = <0xf>;
69 xlnx,allow-dcache-wr = <0x1>;
70 xlnx,allow-icache-wr = <0x1>;
71 xlnx,area-optimized = <0x0>;
72 xlnx,cache-byte-size = <0x2000>;
73 xlnx,d-lmb = <0x1>;
74 xlnx,d-opb = <0x0>;
75 xlnx,d-plb = <0x1>;
76 xlnx,data-size = <0x20>;
77 xlnx,dcache-addr-tag = <0xf>;
78 xlnx,dcache-always-used = <0x1>;
79 xlnx,dcache-byte-size = <0x2000>;
80 xlnx,dcache-line-len = <0x4>;
81 xlnx,dcache-use-fsl = <0x1>;
82 xlnx,debug-enabled = <0x1>;
83 xlnx,div-zero-exception = <0x1>;
84 xlnx,dopb-bus-exception = <0x0>;
85 xlnx,dynamic-bus-sizing = <0x1>;
86 xlnx,edge-is-positive = <0x1>;
87 xlnx,family = "virtex5";
88 xlnx,endianness = <0x1>;
89 xlnx,fpu-exception = <0x1>;
90 xlnx,fsl-data-size = <0x20>;
91 xlnx,fsl-exception = <0x0>;
92 xlnx,fsl-links = <0x0>;
93 xlnx,i-lmb = <0x1>;
94 xlnx,i-opb = <0x0>;
95 xlnx,i-plb = <0x1>;
96 xlnx,icache-always-used = <0x1>;
97 xlnx,icache-line-len = <0x4>;
98 xlnx,icache-use-fsl = <0x1>;
99 xlnx,ill-opcode-exception = <0x1>;
100 xlnx,instance = "microblaze_0";
101 xlnx,interconnect = <0x1>;
102 xlnx,interrupt-is-edge = <0x0>;
103 xlnx,iopb-bus-exception = <0x0>;
104 xlnx,mmu-dtlb-size = <0x4>;
105 xlnx,mmu-itlb-size = <0x2>;
106 xlnx,mmu-tlb-access = <0x3>;
107 xlnx,mmu-zones = <0x10>;
108 xlnx,number-of-pc-brk = <0x1>;
109 xlnx,number-of-rd-addr-brk = <0x0>;
110 xlnx,number-of-wr-addr-brk = <0x0>;
111 xlnx,opcode-0x0-illegal = <0x1>;
112 xlnx,pvr = <0x2>;
113 xlnx,pvr-user1 = <0x0>;
114 xlnx,pvr-user2 = <0x0>;
115 xlnx,reset-msr = <0x0>;
116 xlnx,sco = <0x0>;
117 xlnx,unaligned-exceptions = <0x1>;
118 xlnx,use-barrel = <0x1>;
119 xlnx,use-dcache = <0x1>;
120 xlnx,use-div = <0x1>;
121 xlnx,use-ext-brk = <0x1>;
122 xlnx,use-ext-nm-brk = <0x1>;
123 xlnx,use-extended-fsl-instr = <0x0>;
124 xlnx,use-fpu = <0x2>;
125 xlnx,use-hw-mul = <0x2>;
126 xlnx,use-icache = <0x1>;
127 xlnx,use-interrupt = <0x1>;
128 xlnx,use-mmu = <0x3>;
129 xlnx,use-msr-instr = <0x1>;
130 xlnx,use-pcmp-instr = <0x1>;
131 } ;
132 } ;
133 mb_plb: plb@0 {
134 #address-cells = <1>;
135 #size-cells = <1>;
136 compatible = "xlnx,plb-v46-1.03.a", "xlnx,plb-v46-1.00.a", "simple-bus";
137 ranges ;
138 FLASH: flash@a0000000 {
139 bank-width = <2>;
140 compatible = "xlnx,xps-mch-emc-2.00.a", "cfi-flash";
141 reg = < 0xa0000000 0x2000000 >;
142 xlnx,family = "virtex5";
143 xlnx,include-datawidth-matching-0 = <0x1>;
144 xlnx,include-datawidth-matching-1 = <0x0>;
145 xlnx,include-datawidth-matching-2 = <0x0>;
146 xlnx,include-datawidth-matching-3 = <0x0>;
147 xlnx,include-negedge-ioregs = <0x0>;
148 xlnx,include-plb-ipif = <0x1>;
149 xlnx,include-wrbuf = <0x1>;
150 xlnx,max-mem-width = <0x10>;
151 xlnx,mch-native-dwidth = <0x20>;
152 xlnx,mch-plb-clk-period-ps = <0x1f40>;
153 xlnx,mch-splb-awidth = <0x20>;
154 xlnx,mch0-accessbuf-depth = <0x10>;
155 xlnx,mch0-protocol = <0x0>;
156 xlnx,mch0-rddatabuf-depth = <0x10>;
157 xlnx,mch1-accessbuf-depth = <0x10>;
158 xlnx,mch1-protocol = <0x0>;
159 xlnx,mch1-rddatabuf-depth = <0x10>;
160 xlnx,mch2-accessbuf-depth = <0x10>;
161 xlnx,mch2-protocol = <0x0>;
162 xlnx,mch2-rddatabuf-depth = <0x10>;
163 xlnx,mch3-accessbuf-depth = <0x10>;
164 xlnx,mch3-protocol = <0x0>;
165 xlnx,mch3-rddatabuf-depth = <0x10>;
166 xlnx,mem0-width = <0x10>;
167 xlnx,mem1-width = <0x20>;
168 xlnx,mem2-width = <0x20>;
169 xlnx,mem3-width = <0x20>;
170 xlnx,num-banks-mem = <0x1>;
171 xlnx,num-channels = <0x0>;
172 xlnx,priority-mode = <0x0>;
173 xlnx,synch-mem-0 = <0x0>;
174 xlnx,synch-mem-1 = <0x0>;
175 xlnx,synch-mem-2 = <0x0>;
176 xlnx,synch-mem-3 = <0x0>;
177 xlnx,synch-pipedelay-0 = <0x2>;
178 xlnx,synch-pipedelay-1 = <0x2>;
179 xlnx,synch-pipedelay-2 = <0x2>;
180 xlnx,synch-pipedelay-3 = <0x2>;
181 xlnx,tavdv-ps-mem-0 = <0x1adb0>;
182 xlnx,tavdv-ps-mem-1 = <0x3a98>;
183 xlnx,tavdv-ps-mem-2 = <0x3a98>;
184 xlnx,tavdv-ps-mem-3 = <0x3a98>;
185 xlnx,tcedv-ps-mem-0 = <0x1adb0>;
186 xlnx,tcedv-ps-mem-1 = <0x3a98>;
187 xlnx,tcedv-ps-mem-2 = <0x3a98>;
188 xlnx,tcedv-ps-mem-3 = <0x3a98>;
189 xlnx,thzce-ps-mem-0 = <0x88b8>;
190 xlnx,thzce-ps-mem-1 = <0x1b58>;
191 xlnx,thzce-ps-mem-2 = <0x1b58>;
192 xlnx,thzce-ps-mem-3 = <0x1b58>;
193 xlnx,thzoe-ps-mem-0 = <0x1b58>;
194 xlnx,thzoe-ps-mem-1 = <0x1b58>;
195 xlnx,thzoe-ps-mem-2 = <0x1b58>;
196 xlnx,thzoe-ps-mem-3 = <0x1b58>;
197 xlnx,tlzwe-ps-mem-0 = <0x88b8>;
198 xlnx,tlzwe-ps-mem-1 = <0x0>;
199 xlnx,tlzwe-ps-mem-2 = <0x0>;
200 xlnx,tlzwe-ps-mem-3 = <0x0>;
201 xlnx,twc-ps-mem-0 = <0x2af8>;
202 xlnx,twc-ps-mem-1 = <0x3a98>;
203 xlnx,twc-ps-mem-2 = <0x3a98>;
204 xlnx,twc-ps-mem-3 = <0x3a98>;
205 xlnx,twp-ps-mem-0 = <0x11170>;
206 xlnx,twp-ps-mem-1 = <0x2ee0>;
207 xlnx,twp-ps-mem-2 = <0x2ee0>;
208 xlnx,twp-ps-mem-3 = <0x2ee0>;
209 xlnx,xcl0-linesize = <0x4>;
210 xlnx,xcl0-writexfer = <0x1>;
211 xlnx,xcl1-linesize = <0x4>;
212 xlnx,xcl1-writexfer = <0x1>;
213 xlnx,xcl2-linesize = <0x4>;
214 xlnx,xcl2-writexfer = <0x1>;
215 xlnx,xcl3-linesize = <0x4>;
216 xlnx,xcl3-writexfer = <0x1>;
217 } ;
218 Hard_Ethernet_MAC: xps-ll-temac@81c00000 {
219 #address-cells = <1>;
220 #size-cells = <1>;
221 compatible = "xlnx,compound";
222 ranges ;
223 ethernet@81c00000 {
224 compatible = "xlnx,xps-ll-temac-1.01.b", "xlnx,xps-ll-temac-1.00.a";
225 interrupt-parent = <&xps_intc_0>;
226 interrupts = < 5 2 >;
227 llink-connected = <&PIM3>;
228 local-mac-address = [ 00 0a 35 00 00 00 ];
229 reg = < 0x81c00000 0x40 >;
230 xlnx,bus2core-clk-ratio = <0x1>;
231 xlnx,phy-type = <0x1>;
232 xlnx,phyaddr = <0x1>;
233 xlnx,rxcsum = <0x0>;
234 xlnx,rxfifo = <0x1000>;
235 xlnx,temac-type = <0x0>;
236 xlnx,txcsum = <0x0>;
237 xlnx,txfifo = <0x1000>;
238 } ;
239 } ;
240 IIC_EEPROM: i2c@81600000 {
241 compatible = "xlnx,xps-iic-2.00.a";
242 interrupt-parent = <&xps_intc_0>;
243 interrupts = < 6 2 >;
244 reg = < 0x81600000 0x10000 >;
245 xlnx,clk-freq = <0x7735940>;
246 xlnx,family = "virtex5";
247 xlnx,gpo-width = <0x1>;
248 xlnx,iic-freq = <0x186a0>;
249 xlnx,scl-inertial-delay = <0x0>;
250 xlnx,sda-inertial-delay = <0x0>;
251 xlnx,ten-bit-adr = <0x0>;
252 } ;
253 LEDs_8Bit: gpio@81400000 {
254 compatible = "xlnx,xps-gpio-1.00.a";
255 interrupt-parent = <&xps_intc_0>;
256 interrupts = < 7 2 >;
257 reg = < 0x81400000 0x10000 >;
258 xlnx,all-inputs = <0x0>;
259 xlnx,all-inputs-2 = <0x0>;
260 xlnx,dout-default = <0x0>;
261 xlnx,dout-default-2 = <0x0>;
262 xlnx,family = "virtex5";
263 xlnx,gpio-width = <0x8>;
264 xlnx,interrupt-present = <0x1>;
265 xlnx,is-bidir = <0x1>;
266 xlnx,is-bidir-2 = <0x1>;
267 xlnx,is-dual = <0x0>;
268 xlnx,tri-default = <0xffffffff>;
269 xlnx,tri-default-2 = <0xffffffff>;
270 #gpio-cells = <2>;
271 gpio-controller;
272 } ;
273
274 gpio-leds {
275 compatible = "gpio-leds";
276
277 heartbeat {
278 label = "Heartbeat";
279 gpios = <&LEDs_8Bit 4 1>;
280 linux,default-trigger = "heartbeat";
281 };
282
283 yellow {
284 label = "Yellow";
285 gpios = <&LEDs_8Bit 5 1>;
286 };
287
288 red {
289 label = "Red";
290 gpios = <&LEDs_8Bit 6 1>;
291 };
292
293 green {
294 label = "Green";
295 gpios = <&LEDs_8Bit 7 1>;
296 };
297 } ;
298 RS232_Uart_1: serial@84000000 {
299 clock-frequency = <125000000>;
300 compatible = "xlnx,xps-uartlite-1.00.a";
301 current-speed = <115200>;
302 device_type = "serial";
303 interrupt-parent = <&xps_intc_0>;
304 interrupts = < 8 0 >;
305 port-number = <0>;
306 reg = < 0x84000000 0x10000 >;
307 xlnx,baudrate = <0x1c200>;
308 xlnx,data-bits = <0x8>;
309 xlnx,family = "virtex5";
310 xlnx,odd-parity = <0x0>;
311 xlnx,use-parity = <0x0>;
312 } ;
313 SysACE_CompactFlash: sysace@83600000 {
314 compatible = "xlnx,xps-sysace-1.00.a";
315 interrupt-parent = <&xps_intc_0>;
316 interrupts = < 4 2 >;
317 reg = < 0x83600000 0x10000 >;
318 xlnx,family = "virtex5";
319 xlnx,mem-width = <0x10>;
320 } ;
321 debug_module: debug@84400000 {
322 compatible = "xlnx,mdm-1.00.d";
323 reg = < 0x84400000 0x10000 >;
324 xlnx,family = "virtex5";
325 xlnx,interconnect = <0x1>;
326 xlnx,jtag-chain = <0x2>;
327 xlnx,mb-dbg-ports = <0x1>;
328 xlnx,uart-width = <0x8>;
329 xlnx,use-uart = <0x1>;
330 xlnx,write-fsl-ports = <0x0>;
331 } ;
332 mpmc@90000000 {
333 #address-cells = <1>;
334 #size-cells = <1>;
335 compatible = "xlnx,mpmc-4.02.a";
336 ranges ;
337 PIM3: sdma@84600180 {
338 compatible = "xlnx,ll-dma-1.00.a";
339 interrupt-parent = <&xps_intc_0>;
340 interrupts = < 2 2 1 2 >;
341 reg = < 0x84600180 0x80 >;
342 } ;
343 } ;
344 xps_intc_0: interrupt-controller@81800000 {
345 #interrupt-cells = <0x2>;
346 compatible = "xlnx,xps-intc-1.00.a";
347 interrupt-controller ;
348 reg = < 0x81800000 0x10000 >;
349 xlnx,kind-of-intr = <0x100>;
350 xlnx,num-intr-inputs = <0x9>;
351 } ;
352 xps_timer_1: timer@83c00000 {
353 compatible = "xlnx,xps-timer-1.00.a";
354 interrupt-parent = <&xps_intc_0>;
355 interrupts = < 3 2 >;
356 reg = < 0x83c00000 0x10000 >;
357 xlnx,count-width = <0x20>;
358 xlnx,family = "virtex5";
359 xlnx,gen0-assert = <0x1>;
360 xlnx,gen1-assert = <0x1>;
361 xlnx,one-timer-only = <0x0>;
362 xlnx,trig0-assert = <0x1>;
363 xlnx,trig1-assert = <0x1>;
364 } ;
365 } ;
366} ;
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 95fa1f1d5c8b..5cd695f905a1 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -10,6 +10,7 @@ config MIPS
10 select HAVE_PERF_EVENTS 10 select HAVE_PERF_EVENTS
11 select PERF_USE_VMALLOC 11 select PERF_USE_VMALLOC
12 select HAVE_ARCH_KGDB 12 select HAVE_ARCH_KGDB
13 select HAVE_ARCH_SECCOMP_FILTER
13 select HAVE_ARCH_TRACEHOOK 14 select HAVE_ARCH_TRACEHOOK
14 select ARCH_HAVE_CUSTOM_GPIO_H 15 select ARCH_HAVE_CUSTOM_GPIO_H
15 select HAVE_FUNCTION_TRACER 16 select HAVE_FUNCTION_TRACER
@@ -62,13 +63,12 @@ config MIPS_ALCHEMY
62 select CEVT_R4K 63 select CEVT_R4K
63 select CSRC_R4K 64 select CSRC_R4K
64 select IRQ_CPU 65 select IRQ_CPU
66 select DMA_MAYBE_COHERENT # Au1000,1500,1100 aren't, rest is
65 select SYS_HAS_CPU_MIPS32_R1 67 select SYS_HAS_CPU_MIPS32_R1
66 select SYS_SUPPORTS_32BIT_KERNEL 68 select SYS_SUPPORTS_32BIT_KERNEL
67 select SYS_SUPPORTS_APM_EMULATION 69 select SYS_SUPPORTS_APM_EMULATION
68 select ARCH_REQUIRE_GPIOLIB 70 select ARCH_REQUIRE_GPIOLIB
69 select SYS_SUPPORTS_ZBOOT 71 select SYS_SUPPORTS_ZBOOT
70 select USB_ARCH_HAS_OHCI
71 select USB_ARCH_HAS_EHCI
72 72
73config AR7 73config AR7
74 bool "Texas Instruments AR7" 74 bool "Texas Instruments AR7"
@@ -123,7 +123,7 @@ config BCM47XX
123 select SYS_SUPPORTS_32BIT_KERNEL 123 select SYS_SUPPORTS_32BIT_KERNEL
124 select SYS_SUPPORTS_LITTLE_ENDIAN 124 select SYS_SUPPORTS_LITTLE_ENDIAN
125 select SYS_HAS_EARLY_PRINTK 125 select SYS_HAS_EARLY_PRINTK
126 select EARLY_PRINTK_8250 if EARLY_PRINTK 126 select USE_GENERIC_EARLY_PRINTK_8250
127 help 127 help
128 Support for BCM47XX based boards 128 Support for BCM47XX based boards
129 129
@@ -150,7 +150,6 @@ config MIPS_COBALT
150 select CSRC_R4K 150 select CSRC_R4K
151 select CEVT_GT641XX 151 select CEVT_GT641XX
152 select DMA_NONCOHERENT 152 select DMA_NONCOHERENT
153 select EARLY_PRINTK_8250 if EARLY_PRINTK
154 select HW_HAS_PCI 153 select HW_HAS_PCI
155 select I8253 154 select I8253
156 select I8259 155 select I8259
@@ -163,6 +162,7 @@ config MIPS_COBALT
163 select SYS_SUPPORTS_32BIT_KERNEL 162 select SYS_SUPPORTS_32BIT_KERNEL
164 select SYS_SUPPORTS_64BIT_KERNEL 163 select SYS_SUPPORTS_64BIT_KERNEL
165 select SYS_SUPPORTS_LITTLE_ENDIAN 164 select SYS_SUPPORTS_LITTLE_ENDIAN
165 select USE_GENERIC_EARLY_PRINTK_8250
166 166
167config MACH_DECSTATION 167config MACH_DECSTATION
168 bool "DECstations" 168 bool "DECstations"
@@ -175,7 +175,7 @@ config MACH_DECSTATION
175 select CPU_R4000_WORKAROUNDS if 64BIT 175 select CPU_R4000_WORKAROUNDS if 64BIT
176 select CPU_R4400_WORKAROUNDS if 64BIT 176 select CPU_R4400_WORKAROUNDS if 64BIT
177 select DMA_NONCOHERENT 177 select DMA_NONCOHERENT
178 select NO_IOPORT 178 select NO_IOPORT_MAP
179 select IRQ_CPU 179 select IRQ_CPU
180 select SYS_HAS_CPU_R3000 180 select SYS_HAS_CPU_R3000
181 select SYS_HAS_CPU_R4X00 181 select SYS_HAS_CPU_R4X00
@@ -235,7 +235,6 @@ config MACH_JZ4740
235 select IRQ_CPU 235 select IRQ_CPU
236 select ARCH_REQUIRE_GPIOLIB 236 select ARCH_REQUIRE_GPIOLIB
237 select SYS_HAS_EARLY_PRINTK 237 select SYS_HAS_EARLY_PRINTK
238 select HAVE_PWM
239 select HAVE_CLK 238 select HAVE_CLK
240 select GENERIC_IRQ_CHIP 239 select GENERIC_IRQ_CHIP
241 240
@@ -320,6 +319,7 @@ config MIPS_MALTA
320 select SWAP_IO_SPACE 319 select SWAP_IO_SPACE
321 select SYS_HAS_CPU_MIPS32_R1 320 select SYS_HAS_CPU_MIPS32_R1
322 select SYS_HAS_CPU_MIPS32_R2 321 select SYS_HAS_CPU_MIPS32_R2
322 select SYS_HAS_CPU_MIPS32_R3_5
323 select SYS_HAS_CPU_MIPS64_R1 323 select SYS_HAS_CPU_MIPS64_R1
324 select SYS_HAS_CPU_MIPS64_R2 324 select SYS_HAS_CPU_MIPS64_R2
325 select SYS_HAS_CPU_NEVADA 325 select SYS_HAS_CPU_NEVADA
@@ -329,6 +329,7 @@ config MIPS_MALTA
329 select SYS_SUPPORTS_BIG_ENDIAN 329 select SYS_SUPPORTS_BIG_ENDIAN
330 select SYS_SUPPORTS_LITTLE_ENDIAN 330 select SYS_SUPPORTS_LITTLE_ENDIAN
331 select SYS_SUPPORTS_MIPS_CMP 331 select SYS_SUPPORTS_MIPS_CMP
332 select SYS_SUPPORTS_MIPS_CPS
332 select SYS_SUPPORTS_MULTITHREADING 333 select SYS_SUPPORTS_MULTITHREADING
333 select SYS_SUPPORTS_SMARTMIPS 334 select SYS_SUPPORTS_SMARTMIPS
334 select SYS_SUPPORTS_ZBOOT 335 select SYS_SUPPORTS_ZBOOT
@@ -360,7 +361,6 @@ config MIPS_SEAD3
360 select SYS_SUPPORTS_LITTLE_ENDIAN 361 select SYS_SUPPORTS_LITTLE_ENDIAN
361 select SYS_SUPPORTS_SMARTMIPS 362 select SYS_SUPPORTS_SMARTMIPS
362 select SYS_SUPPORTS_MICROMIPS 363 select SYS_SUPPORTS_MICROMIPS
363 select USB_ARCH_HAS_EHCI
364 select USB_EHCI_BIG_ENDIAN_DESC 364 select USB_EHCI_BIG_ENDIAN_DESC
365 select USB_EHCI_BIG_ENDIAN_MMIO 365 select USB_EHCI_BIG_ENDIAN_MMIO
366 select USE_OF 366 select USE_OF
@@ -674,6 +674,7 @@ config SNI_RM
674 select SYS_SUPPORTS_BIG_ENDIAN 674 select SYS_SUPPORTS_BIG_ENDIAN
675 select SYS_SUPPORTS_HIGHMEM 675 select SYS_SUPPORTS_HIGHMEM
676 select SYS_SUPPORTS_LITTLE_ENDIAN 676 select SYS_SUPPORTS_LITTLE_ENDIAN
677 select USE_GENERIC_EARLY_PRINTK_8250
677 help 678 help
678 The SNI RM200/300/400 are MIPS-based machines manufactured by 679 The SNI RM200/300/400 are MIPS-based machines manufactured by
679 Siemens Nixdorf Informationssysteme (SNI), parent company of Pyramid 680 Siemens Nixdorf Informationssysteme (SNI), parent company of Pyramid
@@ -718,8 +719,6 @@ config CAVIUM_OCTEON_SOC
718 select SWAP_IO_SPACE 719 select SWAP_IO_SPACE
719 select HW_HAS_PCI 720 select HW_HAS_PCI
720 select ZONE_DMA32 721 select ZONE_DMA32
721 select USB_ARCH_HAS_OHCI
722 select USB_ARCH_HAS_EHCI
723 select HOLES_IN_ZONE 722 select HOLES_IN_ZONE
724 select ARCH_REQUIRE_GPIOLIB 723 select ARCH_REQUIRE_GPIOLIB
725 help 724 help
@@ -756,8 +755,6 @@ config NLM_XLR_BOARD
756 select ZONE_DMA32 if 64BIT 755 select ZONE_DMA32 if 64BIT
757 select SYNC_R4K 756 select SYNC_R4K
758 select SYS_HAS_EARLY_PRINTK 757 select SYS_HAS_EARLY_PRINTK
759 select USB_ARCH_HAS_OHCI if USB_SUPPORT
760 select USB_ARCH_HAS_EHCI if USB_SUPPORT
761 select SYS_SUPPORTS_ZBOOT 758 select SYS_SUPPORTS_ZBOOT
762 select SYS_SUPPORTS_ZBOOT_UART16550 759 select SYS_SUPPORTS_ZBOOT_UART16550
763 help 760 help
@@ -782,7 +779,6 @@ config NLM_XLP_BOARD
782 select CEVT_R4K 779 select CEVT_R4K
783 select CSRC_R4K 780 select CSRC_R4K
784 select IRQ_CPU 781 select IRQ_CPU
785 select ARCH_SUPPORTS_MSI
786 select ZONE_DMA32 if 64BIT 782 select ZONE_DMA32 if 64BIT
787 select SYNC_R4K 783 select SYNC_R4K
788 select SYS_HAS_EARLY_PRINTK 784 select SYS_HAS_EARLY_PRINTK
@@ -868,6 +864,7 @@ config CEVT_R4K
868 bool 864 bool
869 865
870config CEVT_GIC 866config CEVT_GIC
867 select MIPS_CM
871 bool 868 bool
872 869
873config CEVT_SB1250 870config CEVT_SB1250
@@ -886,6 +883,7 @@ config CSRC_R4K
886 bool 883 bool
887 884
888config CSRC_GIC 885config CSRC_GIC
886 select MIPS_CM
889 bool 887 bool
890 888
891config CSRC_SB1250 889config CSRC_SB1250
@@ -949,7 +947,7 @@ config SYNC_R4K
949config MIPS_MACHINE 947config MIPS_MACHINE
950 def_bool n 948 def_bool n
951 949
952config NO_IOPORT 950config NO_IOPORT_MAP
953 def_bool n 951 def_bool n
954 952
955config GENERIC_ISA_DMA 953config GENERIC_ISA_DMA
@@ -1030,6 +1028,7 @@ config IRQ_GT641XX
1030 bool 1028 bool
1031 1029
1032config IRQ_GIC 1030config IRQ_GIC
1031 select MIPS_CM
1033 bool 1032 bool
1034 1033
1035config PCI_GT64XXX_PCI0 1034config PCI_GT64XXX_PCI0
@@ -1148,6 +1147,18 @@ choice
1148 prompt "CPU type" 1147 prompt "CPU type"
1149 default CPU_R4X00 1148 default CPU_R4X00
1150 1149
1150config CPU_LOONGSON3
1151 bool "Loongson 3 CPU"
1152 depends on SYS_HAS_CPU_LOONGSON3
1153 select CPU_SUPPORTS_64BIT_KERNEL
1154 select CPU_SUPPORTS_HIGHMEM
1155 select CPU_SUPPORTS_HUGEPAGES
1156 select WEAK_ORDERING
1157 select WEAK_REORDERING_BEYOND_LLSC
1158 help
1159 The Loongson 3 processor implements the MIPS64R2 instruction
1160 set with many extensions.
1161
1151config CPU_LOONGSON2E 1162config CPU_LOONGSON2E
1152 bool "Loongson 2E" 1163 bool "Loongson 2E"
1153 depends on SYS_HAS_CPU_LOONGSON2E 1164 depends on SYS_HAS_CPU_LOONGSON2E
@@ -1203,6 +1214,7 @@ config CPU_MIPS32_R2
1203 select CPU_HAS_PREFETCH 1214 select CPU_HAS_PREFETCH
1204 select CPU_SUPPORTS_32BIT_KERNEL 1215 select CPU_SUPPORTS_32BIT_KERNEL
1205 select CPU_SUPPORTS_HIGHMEM 1216 select CPU_SUPPORTS_HIGHMEM
1217 select CPU_SUPPORTS_MSA
1206 select HAVE_KVM 1218 select HAVE_KVM
1207 help 1219 help
1208 Choose this option to build a kernel for release 2 or later of the 1220 Choose this option to build a kernel for release 2 or later of the
@@ -1238,6 +1250,7 @@ config CPU_MIPS64_R2
1238 select CPU_SUPPORTS_64BIT_KERNEL 1250 select CPU_SUPPORTS_64BIT_KERNEL
1239 select CPU_SUPPORTS_HIGHMEM 1251 select CPU_SUPPORTS_HIGHMEM
1240 select CPU_SUPPORTS_HUGEPAGES 1252 select CPU_SUPPORTS_HUGEPAGES
1253 select CPU_SUPPORTS_MSA
1241 help 1254 help
1242 Choose this option to build a kernel for release 2 or later of the 1255 Choose this option to build a kernel for release 2 or later of the
1243 MIPS64 architecture. Many modern embedded systems with a 64-bit 1256 MIPS64 architecture. Many modern embedded systems with a 64-bit
@@ -1396,7 +1409,6 @@ config CPU_CAVIUM_OCTEON
1396 select LIBFDT 1409 select LIBFDT
1397 select USE_OF 1410 select USE_OF
1398 select USB_EHCI_BIG_ENDIAN_MMIO 1411 select USB_EHCI_BIG_ENDIAN_MMIO
1399 select SYS_HAS_DMA_OPS
1400 select MIPS_L1_CACHE_SHIFT_7 1412 select MIPS_L1_CACHE_SHIFT_7
1401 help 1413 help
1402 The Cavium Octeon processor is a highly integrated chip containing 1414 The Cavium Octeon processor is a highly integrated chip containing
@@ -1448,6 +1460,26 @@ config CPU_XLP
1448 Netlogic Microsystems XLP processors. 1460 Netlogic Microsystems XLP processors.
1449endchoice 1461endchoice
1450 1462
1463config CPU_MIPS32_3_5_FEATURES
1464 bool "MIPS32 Release 3.5 Features"
1465 depends on SYS_HAS_CPU_MIPS32_R3_5
1466 depends on CPU_MIPS32_R2
1467 help
1468 Choose this option to build a kernel for release 2 or later of the
1469 MIPS32 architecture including features from the 3.5 release such as
1470 support for Enhanced Virtual Addressing (EVA).
1471
1472config CPU_MIPS32_3_5_EVA
1473 bool "Enhanced Virtual Addressing (EVA)"
1474 depends on CPU_MIPS32_3_5_FEATURES
1475 select EVA
1476 default y
1477 help
1478 Choose this option if you want to enable the Enhanced Virtual
1479 Addressing (EVA) on your MIPS32 core (such as proAptiv).
1480 One of its primary benefits is an increase in the maximum size
1481 of lowmem (up to 3GB). If unsure, say 'N' here.
1482
1451if CPU_LOONGSON2F 1483if CPU_LOONGSON2F
1452config CPU_NOP_WORKAROUNDS 1484config CPU_NOP_WORKAROUNDS
1453 bool 1485 bool
@@ -1523,6 +1555,10 @@ config CPU_BMIPS5000
1523 select SYS_SUPPORTS_SMP 1555 select SYS_SUPPORTS_SMP
1524 select SYS_SUPPORTS_HOTPLUG_CPU 1556 select SYS_SUPPORTS_HOTPLUG_CPU
1525 1557
1558config SYS_HAS_CPU_LOONGSON3
1559 bool
1560 select CPU_SUPPORTS_CPUFREQ
1561
1526config SYS_HAS_CPU_LOONGSON2E 1562config SYS_HAS_CPU_LOONGSON2E
1527 bool 1563 bool
1528 1564
@@ -1541,6 +1577,9 @@ config SYS_HAS_CPU_MIPS32_R1
1541config SYS_HAS_CPU_MIPS32_R2 1577config SYS_HAS_CPU_MIPS32_R2
1542 bool 1578 bool
1543 1579
1580config SYS_HAS_CPU_MIPS32_R3_5
1581 bool
1582
1544config SYS_HAS_CPU_MIPS64_R1 1583config SYS_HAS_CPU_MIPS64_R1
1545 bool 1584 bool
1546 1585
@@ -1657,6 +1696,9 @@ config CPU_MIPSR2
1657 bool 1696 bool
1658 default y if CPU_MIPS32_R2 || CPU_MIPS64_R2 || CPU_CAVIUM_OCTEON 1697 default y if CPU_MIPS32_R2 || CPU_MIPS64_R2 || CPU_CAVIUM_OCTEON
1659 1698
1699config EVA
1700 bool
1701
1660config SYS_SUPPORTS_32BIT_KERNEL 1702config SYS_SUPPORTS_32BIT_KERNEL
1661 bool 1703 bool
1662config SYS_SUPPORTS_64BIT_KERNEL 1704config SYS_SUPPORTS_64BIT_KERNEL
@@ -1729,7 +1771,7 @@ choice
1729 1771
1730config PAGE_SIZE_4KB 1772config PAGE_SIZE_4KB
1731 bool "4kB" 1773 bool "4kB"
1732 depends on !CPU_LOONGSON2 1774 depends on !CPU_LOONGSON2 && !CPU_LOONGSON3
1733 help 1775 help
1734 This option select the standard 4kB Linux page size. On some 1776 This option select the standard 4kB Linux page size. On some
1735 R3000-family processors this is the only available page size. Using 1777 R3000-family processors this is the only available page size. Using
@@ -1870,6 +1912,7 @@ config MIPS_MT_SMP
1870 select CPU_MIPSR2_IRQ_VI 1912 select CPU_MIPSR2_IRQ_VI
1871 select CPU_MIPSR2_IRQ_EI 1913 select CPU_MIPSR2_IRQ_EI
1872 select SYNC_R4K 1914 select SYNC_R4K
1915 select MIPS_GIC_IPI
1873 select MIPS_MT 1916 select MIPS_MT
1874 select SMP 1917 select SMP
1875 select SMP_UP 1918 select SMP_UP
@@ -1887,6 +1930,7 @@ config MIPS_MT_SMTC
1887 bool "Use all TCs on all VPEs for SMP (DEPRECATED)" 1930 bool "Use all TCs on all VPEs for SMP (DEPRECATED)"
1888 depends on CPU_MIPS32_R2 1931 depends on CPU_MIPS32_R2
1889 depends on SYS_SUPPORTS_MULTITHREADING 1932 depends on SYS_SUPPORTS_MULTITHREADING
1933 depends on !MIPS_CPS
1890 select CPU_MIPSR2_IRQ_VI 1934 select CPU_MIPSR2_IRQ_VI
1891 select CPU_MIPSR2_IRQ_EI 1935 select CPU_MIPSR2_IRQ_EI
1892 select MIPS_MT 1936 select MIPS_MT
@@ -1994,13 +2038,45 @@ config MIPS_VPE_APSP_API_MT
1994 depends on MIPS_VPE_APSP_API && !MIPS_CMP 2038 depends on MIPS_VPE_APSP_API && !MIPS_CMP
1995 2039
1996config MIPS_CMP 2040config MIPS_CMP
1997 bool "MIPS CMP support" 2041 bool "MIPS CMP framework support (DEPRECATED)"
1998 depends on SYS_SUPPORTS_MIPS_CMP && MIPS_MT_SMP 2042 depends on SYS_SUPPORTS_MIPS_CMP && !MIPS_MT_SMTC
2043 select MIPS_GIC_IPI
1999 select SYNC_R4K 2044 select SYNC_R4K
2000 select WEAK_ORDERING 2045 select WEAK_ORDERING
2001 default n 2046 default n
2002 help 2047 help
2003 Enable Coherency Manager processor (CMP) support. 2048 Select this if you are using a bootloader which implements the "CMP
2049 framework" protocol (ie. YAMON) and want your kernel to make use of
2050 its ability to start secondary CPUs.
2051
2052 Unless you have a specific need, you should use CONFIG_MIPS_CPS
2053 instead of this.
2054
2055config MIPS_CPS
2056 bool "MIPS Coherent Processing System support"
2057 depends on SYS_SUPPORTS_MIPS_CPS
2058 select MIPS_CM
2059 select MIPS_CPC
2060 select MIPS_GIC_IPI
2061 select SMP
2062 select SYNC_R4K if (CEVT_R4K || CSRC_R4K)
2063 select SYS_SUPPORTS_SMP
2064 select WEAK_ORDERING
2065 help
2066 Select this if you wish to run an SMP kernel across multiple cores
2067 within a MIPS Coherent Processing System. When this option is
2068 enabled the kernel will probe for other cores and boot them with
2069 no external assistance. It is safe to enable this when hardware
2070 support is unavailable.
2071
2072config MIPS_GIC_IPI
2073 bool
2074
2075config MIPS_CM
2076 bool
2077
2078config MIPS_CPC
2079 bool
2004 2080
2005config SB1_PASS_1_WORKAROUNDS 2081config SB1_PASS_1_WORKAROUNDS
2006 bool 2082 bool
@@ -2043,6 +2119,21 @@ config CPU_MICROMIPS
2043 When this option is enabled the kernel will be built using the 2119 When this option is enabled the kernel will be built using the
2044 microMIPS ISA 2120 microMIPS ISA
2045 2121
2122config CPU_HAS_MSA
2123 bool "Support for the MIPS SIMD Architecture"
2124 depends on CPU_SUPPORTS_MSA
2125 default y
2126 help
2127 MIPS SIMD Architecture (MSA) introduces 128 bit wide vector registers
2128 and a set of SIMD instructions to operate on them. When this option
2129 is enabled the kernel will support allocating & switching MSA
2130 vector register contexts. If you know that your kernel will only be
2131 running on CPUs which do not support MSA or that your userland will
2132 not be making use of it then you may wish to say N here to reduce
2133 the size & complexity of your kernel.
2134
2135 If unsure, say Y.
2136
2046config CPU_HAS_WB 2137config CPU_HAS_WB
2047 bool 2138 bool
2048 2139
@@ -2094,7 +2185,7 @@ config CPU_R4400_WORKAROUNDS
2094# 2185#
2095config HIGHMEM 2186config HIGHMEM
2096 bool "High Memory Support" 2187 bool "High Memory Support"
2097 depends on 32BIT && CPU_SUPPORTS_HIGHMEM && SYS_SUPPORTS_HIGHMEM 2188 depends on 32BIT && CPU_SUPPORTS_HIGHMEM && SYS_SUPPORTS_HIGHMEM && !CPU_MIPS32_3_5_EVA
2098 2189
2099config CPU_SUPPORTS_HIGHMEM 2190config CPU_SUPPORTS_HIGHMEM
2100 bool 2191 bool
@@ -2108,6 +2199,9 @@ config SYS_SUPPORTS_SMARTMIPS
2108config SYS_SUPPORTS_MICROMIPS 2199config SYS_SUPPORTS_MICROMIPS
2109 bool 2200 bool
2110 2201
2202config CPU_SUPPORTS_MSA
2203 bool
2204
2111config ARCH_FLATMEM_ENABLE 2205config ARCH_FLATMEM_ENABLE
2112 def_bool y 2206 def_bool y
2113 depends on !NUMA && !CPU_LOONGSON2 2207 depends on !NUMA && !CPU_LOONGSON2
@@ -2181,6 +2275,9 @@ config SMP_UP
2181config SYS_SUPPORTS_MIPS_CMP 2275config SYS_SUPPORTS_MIPS_CMP
2182 bool 2276 bool
2183 2277
2278config SYS_SUPPORTS_MIPS_CPS
2279 bool
2280
2184config SYS_SUPPORTS_SMP 2281config SYS_SUPPORTS_SMP
2185 bool 2282 bool
2186 2283
@@ -2413,6 +2510,17 @@ config PCI
2413 your box. Other bus systems are ISA, EISA, or VESA. If you have PCI, 2510 your box. Other bus systems are ISA, EISA, or VESA. If you have PCI,
2414 say Y, otherwise N. 2511 say Y, otherwise N.
2415 2512
2513config HT_PCI
2514 bool "Support for HT-linked PCI"
2515 default y
2516 depends on CPU_LOONGSON3
2517 select PCI
2518 select PCI_DOMAINS
2519 help
2520 Loongson family machines use Hyper-Transport bus for inter-core
2521 connection and device connection. The PCI bus is a subordinate
2522 linked at HT. Choose Y for Loongson-3 based machines.
2523
2416config PCI_DOMAINS 2524config PCI_DOMAINS
2417 bool 2525 bool
2418 2526
diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug
index b147e7038ff0..25de29211d76 100644
--- a/arch/mips/Kconfig.debug
+++ b/arch/mips/Kconfig.debug
@@ -21,13 +21,17 @@ config EARLY_PRINTK
21 unless you want to debug such a crash. 21 unless you want to debug such a crash.
22 22
23config EARLY_PRINTK_8250 23config EARLY_PRINTK_8250
24 bool "8250/16550 and compatible serial early printk driver" 24 bool
25 depends on EARLY_PRINTK 25 depends on EARLY_PRINTK && USE_GENERIC_EARLY_PRINTK_8250
26 default n 26 default y
27 help 27 help
28 "8250/16550 and compatible serial early printk driver"
28 If you say Y here, it will be possible to use a 8250/16550 serial 29 If you say Y here, it will be possible to use a 8250/16550 serial
29 port as the boot console. 30 port as the boot console.
30 31
32config USE_GENERIC_EARLY_PRINTK_8250
33 bool
34
31config CMDLINE_BOOL 35config CMDLINE_BOOL
32 bool "Built-in kernel command line" 36 bool "Built-in kernel command line"
33 default n 37 default n
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 9b8556de9993..1a5b4032cb66 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -119,6 +119,11 @@ cflags-$(CONFIG_CPU_MICROMIPS) += $(call cc-option,-mmicromips)
119cflags-$(CONFIG_SB1XXX_CORELIS) += $(call cc-option,-mno-sched-prolog) \ 119cflags-$(CONFIG_SB1XXX_CORELIS) += $(call cc-option,-mno-sched-prolog) \
120 -fno-omit-frame-pointer 120 -fno-omit-frame-pointer
121 121
122ifeq ($(CONFIG_CPU_HAS_MSA),y)
123toolchain-msa := $(call cc-option-yn,-mhard-float -mfp64 -mmsa)
124cflags-$(toolchain-msa) += -DTOOLCHAIN_SUPPORTS_MSA
125endif
126
122# 127#
123# CPU-dependent compiler/assembler options for optimization. 128# CPU-dependent compiler/assembler options for optimization.
124# 129#
diff --git a/arch/mips/alchemy/Kconfig b/arch/mips/alchemy/Kconfig
index 7032ac7ecd1b..b9628983d620 100644
--- a/arch/mips/alchemy/Kconfig
+++ b/arch/mips/alchemy/Kconfig
@@ -16,36 +16,29 @@ config ALCHEMY_GPIO_INDIRECT
16choice 16choice
17 prompt "Machine type" 17 prompt "Machine type"
18 depends on MIPS_ALCHEMY 18 depends on MIPS_ALCHEMY
19 default MIPS_DB1000 19 default MIPS_DB1XXX
20 20
21config MIPS_MTX1 21config MIPS_MTX1
22 bool "4G Systems MTX-1 board" 22 bool "4G Systems MTX-1 board"
23 select DMA_NONCOHERENT
24 select HW_HAS_PCI 23 select HW_HAS_PCI
25 select ALCHEMY_GPIOINT_AU1000 24 select ALCHEMY_GPIOINT_AU1000
26 select SYS_SUPPORTS_LITTLE_ENDIAN 25 select SYS_SUPPORTS_LITTLE_ENDIAN
27 select SYS_HAS_EARLY_PRINTK 26 select SYS_HAS_EARLY_PRINTK
28 27
29config MIPS_DB1000 28config MIPS_DB1XXX
30 bool "Alchemy DB1000/DB1500/DB1100 PB1500/1100 boards" 29 bool "Alchemy DB1XXX / PB1XXX boards"
31 select ALCHEMY_GPIOINT_AU1000
32 select DMA_NONCOHERENT
33 select HW_HAS_PCI
34 select SYS_SUPPORTS_BIG_ENDIAN
35 select SYS_SUPPORTS_LITTLE_ENDIAN
36 select SYS_HAS_EARLY_PRINTK
37
38config MIPS_DB1235
39 bool "Alchemy DB1200/PB1200/DB1300/DB1550/PB1550 boards"
40 select ARCH_REQUIRE_GPIOLIB 30 select ARCH_REQUIRE_GPIOLIB
41 select HW_HAS_PCI 31 select HW_HAS_PCI
42 select DMA_COHERENT
43 select SYS_SUPPORTS_LITTLE_ENDIAN 32 select SYS_SUPPORTS_LITTLE_ENDIAN
44 select SYS_HAS_EARLY_PRINTK 33 select SYS_HAS_EARLY_PRINTK
34 help
35 Select this option if you have one of the following Alchemy
36 development boards: DB1000 DB1500 DB1100 DB1550 DB1200 DB1300
37 PB1500 PB1100 PB1550 PB1200
38 Board type is autodetected during boot.
45 39
46config MIPS_XXS1500 40config MIPS_XXS1500
47 bool "MyCable XXS1500 board" 41 bool "MyCable XXS1500 board"
48 select DMA_NONCOHERENT
49 select ALCHEMY_GPIOINT_AU1000 42 select ALCHEMY_GPIOINT_AU1000
50 select SYS_SUPPORTS_LITTLE_ENDIAN 43 select SYS_SUPPORTS_LITTLE_ENDIAN
51 select SYS_HAS_EARLY_PRINTK 44 select SYS_HAS_EARLY_PRINTK
@@ -54,7 +47,6 @@ config MIPS_GPR
54 bool "Trapeze ITS GPR board" 47 bool "Trapeze ITS GPR board"
55 select ALCHEMY_GPIOINT_AU1000 48 select ALCHEMY_GPIOINT_AU1000
56 select HW_HAS_PCI 49 select HW_HAS_PCI
57 select DMA_NONCOHERENT
58 select SYS_SUPPORTS_LITTLE_ENDIAN 50 select SYS_SUPPORTS_LITTLE_ENDIAN
59 select SYS_HAS_EARLY_PRINTK 51 select SYS_HAS_EARLY_PRINTK
60 52
diff --git a/arch/mips/alchemy/Platform b/arch/mips/alchemy/Platform
index b3afcdd8d77a..33c9da3b077b 100644
--- a/arch/mips/alchemy/Platform
+++ b/arch/mips/alchemy/Platform
@@ -5,18 +5,12 @@ platform-$(CONFIG_MIPS_ALCHEMY) += alchemy/common/
5 5
6 6
7# 7#
8# AMD Alchemy Db1000/Db1500/Pb1500/Db1100/Pb1100 eval boards 8# AMD Alchemy Db1000/Db1500/Pb1500/Db1100/Pb1100
9# Db1550/Pb1550/Db1200/Pb1200/Db1300
9# 10#
10platform-$(CONFIG_MIPS_DB1000) += alchemy/devboards/ 11platform-$(CONFIG_MIPS_DB1XXX) += alchemy/devboards/
11cflags-$(CONFIG_MIPS_DB1000) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 12cflags-$(CONFIG_MIPS_DB1XXX) += -I$(srctree)/arch/mips/include/asm/mach-db1x00
12load-$(CONFIG_MIPS_DB1000) += 0xffffffff80100000 13load-$(CONFIG_MIPS_DB1XXX) += 0xffffffff80100000
13
14#
15# AMD Alchemy Db1200/Pb1200/Db1550/Pb1550/Db1300 eval boards
16#
17platform-$(CONFIG_MIPS_DB1235) += alchemy/devboards/
18cflags-$(CONFIG_MIPS_DB1235) += -I$(srctree)/arch/mips/include/asm/mach-db1x00
19load-$(CONFIG_MIPS_DB1235) += 0xffffffff80100000
20 14
21# 15#
22# 4G-Systems MTX-1 "MeshCube" wireless router 16# 4G-Systems MTX-1 "MeshCube" wireless router
diff --git a/arch/mips/alchemy/common/setup.c b/arch/mips/alchemy/common/setup.c
index 62b4e7bbeab9..566a1743f685 100644
--- a/arch/mips/alchemy/common/setup.c
+++ b/arch/mips/alchemy/common/setup.c
@@ -30,6 +30,7 @@
30#include <linux/jiffies.h> 30#include <linux/jiffies.h>
31#include <linux/module.h> 31#include <linux/module.h>
32 32
33#include <asm/dma-coherence.h>
33#include <asm/mipsregs.h> 34#include <asm/mipsregs.h>
34#include <asm/time.h> 35#include <asm/time.h>
35 36
@@ -59,6 +60,15 @@ void __init plat_mem_setup(void)
59 /* Clear to obtain best system bus performance */ 60 /* Clear to obtain best system bus performance */
60 clear_c0_config(1 << 19); /* Clear Config[OD] */ 61 clear_c0_config(1 << 19); /* Clear Config[OD] */
61 62
63 hw_coherentio = 0;
64 coherentio = 1;
65 switch (alchemy_get_cputype()) {
66 case ALCHEMY_CPU_AU1000:
67 case ALCHEMY_CPU_AU1500:
68 case ALCHEMY_CPU_AU1100:
69 coherentio = 0;
70 }
71
62 board_setup(); /* board specific setup */ 72 board_setup(); /* board specific setup */
63 73
64 /* IO/MEM resources. */ 74 /* IO/MEM resources. */
diff --git a/arch/mips/alchemy/common/sleeper.S b/arch/mips/alchemy/common/sleeper.S
index 706d933e0085..c73d81270b42 100644
--- a/arch/mips/alchemy/common/sleeper.S
+++ b/arch/mips/alchemy/common/sleeper.S
@@ -95,7 +95,7 @@ LEAF(alchemy_sleep_au1000)
95 95
96 /* cache following instructions, as memory gets put to sleep */ 96 /* cache following instructions, as memory gets put to sleep */
97 la t0, 1f 97 la t0, 1f
98 .set mips3 98 .set arch=r4000
99 cache 0x14, 0(t0) 99 cache 0x14, 0(t0)
100 cache 0x14, 32(t0) 100 cache 0x14, 32(t0)
101 cache 0x14, 64(t0) 101 cache 0x14, 64(t0)
@@ -121,7 +121,7 @@ LEAF(alchemy_sleep_au1550)
121 121
122 /* cache following instructions, as memory gets put to sleep */ 122 /* cache following instructions, as memory gets put to sleep */
123 la t0, 1f 123 la t0, 1f
124 .set mips3 124 .set arch=r4000
125 cache 0x14, 0(t0) 125 cache 0x14, 0(t0)
126 cache 0x14, 32(t0) 126 cache 0x14, 32(t0)
127 cache 0x14, 64(t0) 127 cache 0x14, 64(t0)
@@ -163,7 +163,7 @@ LEAF(alchemy_sleep_au1300)
163 la t1, 4f 163 la t1, 4f
164 subu t2, t1, t0 164 subu t2, t1, t0
165 165
166 .set mips3 166 .set arch=r4000
167 167
1681: cache 0x14, 0(t0) 1681: cache 0x14, 0(t0)
169 subu t2, t2, 32 169 subu t2, t2, 32
diff --git a/arch/mips/alchemy/devboards/Makefile b/arch/mips/alchemy/devboards/Makefile
index 15bf7306648b..9da3659a9d1c 100644
--- a/arch/mips/alchemy/devboards/Makefile
+++ b/arch/mips/alchemy/devboards/Makefile
@@ -2,7 +2,5 @@
2# Alchemy Develboards 2# Alchemy Develboards
3# 3#
4 4
5obj-y += bcsr.o platform.o 5obj-y += bcsr.o platform.o db1000.o db1200.o db1300.o db1550.o db1xxx.o
6obj-$(CONFIG_PM) += pm.o 6obj-$(CONFIG_PM) += pm.o
7obj-$(CONFIG_MIPS_DB1000) += db1000.o
8obj-$(CONFIG_MIPS_DB1235) += db1235.o db1200.o db1300.o db1550.o
diff --git a/arch/mips/alchemy/devboards/db1000.c b/arch/mips/alchemy/devboards/db1000.c
index 5483906e0f86..92dd929d4057 100644
--- a/arch/mips/alchemy/devboards/db1000.c
+++ b/arch/mips/alchemy/devboards/db1000.c
@@ -41,42 +41,27 @@
41 41
42#define F_SWAPPED (bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1000_SWAPBOOT) 42#define F_SWAPPED (bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1000_SWAPBOOT)
43 43
44struct pci_dev; 44const char *get_system_type(void);
45 45
46static const char *board_type_str(void) 46int __init db1000_board_setup(void)
47{ 47{
48 /* initialize board register space */
49 bcsr_init(DB1000_BCSR_PHYS_ADDR,
50 DB1000_BCSR_PHYS_ADDR + DB1000_BCSR_HEXLED_OFS);
51
48 switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) { 52 switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) {
49 case BCSR_WHOAMI_DB1000: 53 case BCSR_WHOAMI_DB1000:
50 return "DB1000";
51 case BCSR_WHOAMI_DB1500: 54 case BCSR_WHOAMI_DB1500:
52 return "DB1500";
53 case BCSR_WHOAMI_DB1100: 55 case BCSR_WHOAMI_DB1100:
54 return "DB1100";
55 case BCSR_WHOAMI_PB1500: 56 case BCSR_WHOAMI_PB1500:
56 case BCSR_WHOAMI_PB1500R2: 57 case BCSR_WHOAMI_PB1500R2:
57 return "PB1500";
58 case BCSR_WHOAMI_PB1100: 58 case BCSR_WHOAMI_PB1100:
59 return "PB1100"; 59 pr_info("AMD Alchemy %s Board\n", get_system_type());
60 default: 60 return 0;
61 return "(unknown)";
62 } 61 }
62 return -ENODEV;
63} 63}
64 64
65const char *get_system_type(void)
66{
67 return board_type_str();
68}
69
70void __init board_setup(void)
71{
72 /* initialize board register space */
73 bcsr_init(DB1000_BCSR_PHYS_ADDR,
74 DB1000_BCSR_PHYS_ADDR + DB1000_BCSR_HEXLED_OFS);
75
76 printk(KERN_INFO "AMD Alchemy %s Board\n", board_type_str());
77}
78
79
80static int db1500_map_pci_irq(const struct pci_dev *d, u8 slot, u8 pin) 65static int db1500_map_pci_irq(const struct pci_dev *d, u8 slot, u8 pin)
81{ 66{
82 if ((slot < 12) || (slot > 13) || pin == 0) 67 if ((slot < 12) || (slot > 13) || pin == 0)
@@ -114,17 +99,10 @@ static struct platform_device db1500_pci_host_dev = {
114 .resource = alchemy_pci_host_res, 99 .resource = alchemy_pci_host_res,
115}; 100};
116 101
117static int __init db1500_pci_init(void) 102int __init db1500_pci_setup(void)
118{ 103{
119 int id = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)); 104 return platform_device_register(&db1500_pci_host_dev);
120 if ((id == BCSR_WHOAMI_DB1500) || (id == BCSR_WHOAMI_PB1500) ||
121 (id == BCSR_WHOAMI_PB1500R2))
122 return platform_device_register(&db1500_pci_host_dev);
123 return 0;
124} 105}
125/* must be arch_initcall; MIPS PCI scans busses in a subsys_initcall */
126arch_initcall(db1500_pci_init);
127
128 106
129static struct resource au1100_lcd_resources[] = { 107static struct resource au1100_lcd_resources[] = {
130 [0] = { 108 [0] = {
@@ -513,7 +491,7 @@ static struct platform_device *db1100_devs[] = {
513 &db1000_irda_dev, 491 &db1000_irda_dev,
514}; 492};
515 493
516static int __init db1000_dev_init(void) 494int __init db1000_dev_setup(void)
517{ 495{
518 int board = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)); 496 int board = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI));
519 int c0, c1, d0, d1, s0, s1, flashsize = 32, twosocks = 1; 497 int c0, c1, d0, d1, s0, s1, flashsize = 32, twosocks = 1;
@@ -623,4 +601,3 @@ static int __init db1000_dev_init(void)
623 db1x_register_norflash(flashsize << 20, 4 /* 32bit */, F_SWAPPED); 601 db1x_register_norflash(flashsize << 20, 4 /* 32bit */, F_SWAPPED);
624 return 0; 602 return 0;
625} 603}
626device_initcall(db1000_dev_init);
diff --git a/arch/mips/alchemy/devboards/db1200.c b/arch/mips/alchemy/devboards/db1200.c
index a84d98b8f96e..9e46667f2597 100644
--- a/arch/mips/alchemy/devboards/db1200.c
+++ b/arch/mips/alchemy/devboards/db1200.c
@@ -35,16 +35,63 @@
35#include <linux/spi/spi.h> 35#include <linux/spi/spi.h>
36#include <linux/spi/flash.h> 36#include <linux/spi/flash.h>
37#include <linux/smc91x.h> 37#include <linux/smc91x.h>
38#include <linux/ata_platform.h>
38#include <asm/mach-au1x00/au1000.h> 39#include <asm/mach-au1x00/au1000.h>
39#include <asm/mach-au1x00/au1100_mmc.h> 40#include <asm/mach-au1x00/au1100_mmc.h>
40#include <asm/mach-au1x00/au1xxx_dbdma.h> 41#include <asm/mach-au1x00/au1xxx_dbdma.h>
42#include <asm/mach-au1x00/au1xxx_psc.h>
41#include <asm/mach-au1x00/au1200fb.h> 43#include <asm/mach-au1x00/au1200fb.h>
42#include <asm/mach-au1x00/au1550_spi.h> 44#include <asm/mach-au1x00/au1550_spi.h>
43#include <asm/mach-db1x00/bcsr.h> 45#include <asm/mach-db1x00/bcsr.h>
44#include <asm/mach-db1x00/db1200.h>
45 46
46#include "platform.h" 47#include "platform.h"
47 48
49#define BCSR_INT_IDE 0x0001
50#define BCSR_INT_ETH 0x0002
51#define BCSR_INT_PC0 0x0004
52#define BCSR_INT_PC0STSCHG 0x0008
53#define BCSR_INT_PC1 0x0010
54#define BCSR_INT_PC1STSCHG 0x0020
55#define BCSR_INT_DC 0x0040
56#define BCSR_INT_FLASHBUSY 0x0080
57#define BCSR_INT_PC0INSERT 0x0100
58#define BCSR_INT_PC0EJECT 0x0200
59#define BCSR_INT_PC1INSERT 0x0400
60#define BCSR_INT_PC1EJECT 0x0800
61#define BCSR_INT_SD0INSERT 0x1000
62#define BCSR_INT_SD0EJECT 0x2000
63#define BCSR_INT_SD1INSERT 0x4000
64#define BCSR_INT_SD1EJECT 0x8000
65
66#define DB1200_IDE_PHYS_ADDR 0x18800000
67#define DB1200_IDE_REG_SHIFT 5
68#define DB1200_IDE_PHYS_LEN (16 << DB1200_IDE_REG_SHIFT)
69#define DB1200_ETH_PHYS_ADDR 0x19000300
70#define DB1200_NAND_PHYS_ADDR 0x20000000
71
72#define PB1200_IDE_PHYS_ADDR 0x0C800000
73#define PB1200_ETH_PHYS_ADDR 0x0D000300
74#define PB1200_NAND_PHYS_ADDR 0x1C000000
75
76#define DB1200_INT_BEGIN (AU1000_MAX_INTR + 1)
77#define DB1200_IDE_INT (DB1200_INT_BEGIN + 0)
78#define DB1200_ETH_INT (DB1200_INT_BEGIN + 1)
79#define DB1200_PC0_INT (DB1200_INT_BEGIN + 2)
80#define DB1200_PC0_STSCHG_INT (DB1200_INT_BEGIN + 3)
81#define DB1200_PC1_INT (DB1200_INT_BEGIN + 4)
82#define DB1200_PC1_STSCHG_INT (DB1200_INT_BEGIN + 5)
83#define DB1200_DC_INT (DB1200_INT_BEGIN + 6)
84#define DB1200_FLASHBUSY_INT (DB1200_INT_BEGIN + 7)
85#define DB1200_PC0_INSERT_INT (DB1200_INT_BEGIN + 8)
86#define DB1200_PC0_EJECT_INT (DB1200_INT_BEGIN + 9)
87#define DB1200_PC1_INSERT_INT (DB1200_INT_BEGIN + 10)
88#define DB1200_PC1_EJECT_INT (DB1200_INT_BEGIN + 11)
89#define DB1200_SD0_INSERT_INT (DB1200_INT_BEGIN + 12)
90#define DB1200_SD0_EJECT_INT (DB1200_INT_BEGIN + 13)
91#define PB1200_SD1_INSERT_INT (DB1200_INT_BEGIN + 14)
92#define PB1200_SD1_EJECT_INT (DB1200_INT_BEGIN + 15)
93#define DB1200_INT_END (DB1200_INT_BEGIN + 15)
94
48const char *get_system_type(void); 95const char *get_system_type(void);
49 96
50static int __init db1200_detect_board(void) 97static int __init db1200_detect_board(void)
@@ -89,6 +136,15 @@ int __init db1200_board_setup(void)
89 return -ENODEV; 136 return -ENODEV;
90 137
91 whoami = bcsr_read(BCSR_WHOAMI); 138 whoami = bcsr_read(BCSR_WHOAMI);
139 switch (BCSR_WHOAMI_BOARD(whoami)) {
140 case BCSR_WHOAMI_PB1200_DDR1:
141 case BCSR_WHOAMI_PB1200_DDR2:
142 case BCSR_WHOAMI_DB1200:
143 break;
144 default:
145 return -ENODEV;
146 }
147
92 printk(KERN_INFO "Alchemy/AMD/RMI %s Board, CPLD Rev %d" 148 printk(KERN_INFO "Alchemy/AMD/RMI %s Board, CPLD Rev %d"
93 " Board-ID %d Daughtercard ID %d\n", get_system_type(), 149 " Board-ID %d Daughtercard ID %d\n", get_system_type(),
94 (whoami >> 4) & 0xf, (whoami >> 8) & 0xf, whoami & 0xf); 150 (whoami >> 4) & 0xf, (whoami >> 8) & 0xf, whoami & 0xf);
@@ -275,32 +331,38 @@ static struct platform_device db1200_eth_dev = {
275 331
276/**********************************************************************/ 332/**********************************************************************/
277 333
334static struct pata_platform_info db1200_ide_info = {
335 .ioport_shift = DB1200_IDE_REG_SHIFT,
336};
337
338#define IDE_ALT_START (14 << DB1200_IDE_REG_SHIFT)
278static struct resource db1200_ide_res[] = { 339static struct resource db1200_ide_res[] = {
279 [0] = { 340 [0] = {
280 .start = DB1200_IDE_PHYS_ADDR, 341 .start = DB1200_IDE_PHYS_ADDR,
281 .end = DB1200_IDE_PHYS_ADDR + DB1200_IDE_PHYS_LEN - 1, 342 .end = DB1200_IDE_PHYS_ADDR + IDE_ALT_START - 1,
282 .flags = IORESOURCE_MEM, 343 .flags = IORESOURCE_MEM,
283 }, 344 },
284 [1] = { 345 [1] = {
346 .start = DB1200_IDE_PHYS_ADDR + IDE_ALT_START,
347 .end = DB1200_IDE_PHYS_ADDR + DB1200_IDE_PHYS_LEN - 1,
348 .flags = IORESOURCE_MEM,
349 },
350 [2] = {
285 .start = DB1200_IDE_INT, 351 .start = DB1200_IDE_INT,
286 .end = DB1200_IDE_INT, 352 .end = DB1200_IDE_INT,
287 .flags = IORESOURCE_IRQ, 353 .flags = IORESOURCE_IRQ,
288 }, 354 },
289 [2] = {
290 .start = AU1200_DSCR_CMD0_DMA_REQ1,
291 .end = AU1200_DSCR_CMD0_DMA_REQ1,
292 .flags = IORESOURCE_DMA,
293 },
294}; 355};
295 356
296static u64 au1200_ide_dmamask = DMA_BIT_MASK(32); 357static u64 au1200_ide_dmamask = DMA_BIT_MASK(32);
297 358
298static struct platform_device db1200_ide_dev = { 359static struct platform_device db1200_ide_dev = {
299 .name = "au1200-ide", 360 .name = "pata_platform",
300 .id = 0, 361 .id = 0,
301 .dev = { 362 .dev = {
302 .dma_mask = &au1200_ide_dmamask, 363 .dma_mask = &au1200_ide_dmamask,
303 .coherent_dma_mask = DMA_BIT_MASK(32), 364 .coherent_dma_mask = DMA_BIT_MASK(32),
365 .platform_data = &db1200_ide_info,
304 }, 366 },
305 .num_resources = ARRAY_SIZE(db1200_ide_res), 367 .num_resources = ARRAY_SIZE(db1200_ide_res),
306 .resource = db1200_ide_res, 368 .resource = db1200_ide_res,
diff --git a/arch/mips/alchemy/devboards/db1300.c b/arch/mips/alchemy/devboards/db1300.c
index 6167e73eef9c..1aed6be4de10 100644
--- a/arch/mips/alchemy/devboards/db1300.c
+++ b/arch/mips/alchemy/devboards/db1300.c
@@ -26,12 +26,44 @@
26#include <asm/mach-au1x00/au1200fb.h> 26#include <asm/mach-au1x00/au1200fb.h>
27#include <asm/mach-au1x00/au1xxx_dbdma.h> 27#include <asm/mach-au1x00/au1xxx_dbdma.h>
28#include <asm/mach-au1x00/au1xxx_psc.h> 28#include <asm/mach-au1x00/au1xxx_psc.h>
29#include <asm/mach-db1x00/db1300.h>
30#include <asm/mach-db1x00/bcsr.h> 29#include <asm/mach-db1x00/bcsr.h>
31#include <asm/mach-au1x00/prom.h> 30#include <asm/mach-au1x00/prom.h>
32 31
33#include "platform.h" 32#include "platform.h"
34 33
34/* FPGA (external mux) interrupt sources */
35#define DB1300_FIRST_INT (ALCHEMY_GPIC_INT_LAST + 1)
36#define DB1300_IDE_INT (DB1300_FIRST_INT + 0)
37#define DB1300_ETH_INT (DB1300_FIRST_INT + 1)
38#define DB1300_CF_INT (DB1300_FIRST_INT + 2)
39#define DB1300_VIDEO_INT (DB1300_FIRST_INT + 4)
40#define DB1300_HDMI_INT (DB1300_FIRST_INT + 5)
41#define DB1300_DC_INT (DB1300_FIRST_INT + 6)
42#define DB1300_FLASH_INT (DB1300_FIRST_INT + 7)
43#define DB1300_CF_INSERT_INT (DB1300_FIRST_INT + 8)
44#define DB1300_CF_EJECT_INT (DB1300_FIRST_INT + 9)
45#define DB1300_AC97_INT (DB1300_FIRST_INT + 10)
46#define DB1300_AC97_PEN_INT (DB1300_FIRST_INT + 11)
47#define DB1300_SD1_INSERT_INT (DB1300_FIRST_INT + 12)
48#define DB1300_SD1_EJECT_INT (DB1300_FIRST_INT + 13)
49#define DB1300_OTG_VBUS_OC_INT (DB1300_FIRST_INT + 14)
50#define DB1300_HOST_VBUS_OC_INT (DB1300_FIRST_INT + 15)
51#define DB1300_LAST_INT (DB1300_FIRST_INT + 15)
52
53/* SMSC9210 CS */
54#define DB1300_ETH_PHYS_ADDR 0x19000000
55#define DB1300_ETH_PHYS_END 0x197fffff
56
57/* ATA CS */
58#define DB1300_IDE_PHYS_ADDR 0x18800000
59#define DB1300_IDE_REG_SHIFT 5
60#define DB1300_IDE_PHYS_LEN (16 << DB1300_IDE_REG_SHIFT)
61
62/* NAND CS */
63#define DB1300_NAND_PHYS_ADDR 0x20000000
64#define DB1300_NAND_PHYS_END 0x20000fff
65
66
35static struct i2c_board_info db1300_i2c_devs[] __initdata = { 67static struct i2c_board_info db1300_i2c_devs[] __initdata = {
36 { I2C_BOARD_INFO("wm8731", 0x1b), }, /* I2S audio codec */ 68 { I2C_BOARD_INFO("wm8731", 0x1b), }, /* I2S audio codec */
37 { I2C_BOARD_INFO("ne1619", 0x2d), }, /* adm1025-compat hwmon */ 69 { I2C_BOARD_INFO("ne1619", 0x2d), }, /* adm1025-compat hwmon */
@@ -759,11 +791,15 @@ int __init db1300_board_setup(void)
759{ 791{
760 unsigned short whoami; 792 unsigned short whoami;
761 793
762 db1300_gpio_config();
763 bcsr_init(DB1300_BCSR_PHYS_ADDR, 794 bcsr_init(DB1300_BCSR_PHYS_ADDR,
764 DB1300_BCSR_PHYS_ADDR + DB1300_BCSR_HEXLED_OFS); 795 DB1300_BCSR_PHYS_ADDR + DB1300_BCSR_HEXLED_OFS);
765 796
766 whoami = bcsr_read(BCSR_WHOAMI); 797 whoami = bcsr_read(BCSR_WHOAMI);
798 if (BCSR_WHOAMI_BOARD(whoami) != BCSR_WHOAMI_DB1300)
799 return -ENODEV;
800
801 db1300_gpio_config();
802
767 printk(KERN_INFO "NetLogic DBAu1300 Development Platform.\n\t" 803 printk(KERN_INFO "NetLogic DBAu1300 Development Platform.\n\t"
768 "BoardID %d CPLD Rev %d DaughtercardID %d\n", 804 "BoardID %d CPLD Rev %d DaughtercardID %d\n",
769 BCSR_WHOAMI_BOARD(whoami), BCSR_WHOAMI_CPLD(whoami), 805 BCSR_WHOAMI_BOARD(whoami), BCSR_WHOAMI_CPLD(whoami),
diff --git a/arch/mips/alchemy/devboards/db1550.c b/arch/mips/alchemy/devboards/db1550.c
index 016cddacd7ea..bbd8d9884702 100644
--- a/arch/mips/alchemy/devboards/db1550.c
+++ b/arch/mips/alchemy/devboards/db1550.c
@@ -62,10 +62,16 @@ int __init db1550_board_setup(void)
62 DB1550_BCSR_PHYS_ADDR + DB1550_BCSR_HEXLED_OFS); 62 DB1550_BCSR_PHYS_ADDR + DB1550_BCSR_HEXLED_OFS);
63 63
64 whoami = bcsr_read(BCSR_WHOAMI); /* PB1550 hexled offset differs */ 64 whoami = bcsr_read(BCSR_WHOAMI); /* PB1550 hexled offset differs */
65 if ((BCSR_WHOAMI_BOARD(whoami) == BCSR_WHOAMI_PB1550_SDR) || 65 switch (BCSR_WHOAMI_BOARD(whoami)) {
66 (BCSR_WHOAMI_BOARD(whoami) == BCSR_WHOAMI_PB1550_DDR)) 66 case BCSR_WHOAMI_PB1550_SDR:
67 case BCSR_WHOAMI_PB1550_DDR:
67 bcsr_init(PB1550_BCSR_PHYS_ADDR, 68 bcsr_init(PB1550_BCSR_PHYS_ADDR,
68 PB1550_BCSR_PHYS_ADDR + PB1550_BCSR_HEXLED_OFS); 69 PB1550_BCSR_PHYS_ADDR + PB1550_BCSR_HEXLED_OFS);
70 case BCSR_WHOAMI_DB1550:
71 break;
72 default:
73 return -ENODEV;
74 }
69 75
70 pr_info("Alchemy/AMD %s Board, CPLD Rev %d Board-ID %d " \ 76 pr_info("Alchemy/AMD %s Board, CPLD Rev %d Board-ID %d " \
71 "Daughtercard ID %d\n", get_system_type(), 77 "Daughtercard ID %d\n", get_system_type(),
diff --git a/arch/mips/alchemy/devboards/db1235.c b/arch/mips/alchemy/devboards/db1xxx.c
index bac19dc43d1d..2d47f951121a 100644
--- a/arch/mips/alchemy/devboards/db1235.c
+++ b/arch/mips/alchemy/devboards/db1xxx.c
@@ -1,12 +1,13 @@
1/* 1/*
2 * DB1200/PB1200 / DB1550 / DB1300 board support. 2 * Alchemy DB/PB1xxx board support.
3 *
4 * These 4 boards can reliably be supported in a single kernel image.
5 */ 3 */
6 4
7#include <asm/mach-au1x00/au1000.h> 5#include <asm/mach-au1x00/au1000.h>
8#include <asm/mach-db1x00/bcsr.h> 6#include <asm/mach-db1x00/bcsr.h>
9 7
8int __init db1000_board_setup(void);
9int __init db1000_dev_setup(void);
10int __init db1500_pci_setup(void);
10int __init db1200_board_setup(void); 11int __init db1200_board_setup(void);
11int __init db1200_dev_setup(void); 12int __init db1200_dev_setup(void);
12int __init db1300_board_setup(void); 13int __init db1300_board_setup(void);
@@ -18,6 +19,17 @@ int __init db1550_pci_setup(int);
18static const char *board_type_str(void) 19static const char *board_type_str(void)
19{ 20{
20 switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) { 21 switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) {
22 case BCSR_WHOAMI_DB1000:
23 return "DB1000";
24 case BCSR_WHOAMI_DB1500:
25 return "DB1500";
26 case BCSR_WHOAMI_DB1100:
27 return "DB1100";
28 case BCSR_WHOAMI_PB1500:
29 case BCSR_WHOAMI_PB1500R2:
30 return "PB1500";
31 case BCSR_WHOAMI_PB1100:
32 return "PB1100";
21 case BCSR_WHOAMI_PB1200_DDR1: 33 case BCSR_WHOAMI_PB1200_DDR1:
22 case BCSR_WHOAMI_PB1200_DDR2: 34 case BCSR_WHOAMI_PB1200_DDR2:
23 return "PB1200"; 35 return "PB1200";
@@ -45,6 +57,11 @@ void __init board_setup(void)
45 int ret; 57 int ret;
46 58
47 switch (alchemy_get_cputype()) { 59 switch (alchemy_get_cputype()) {
60 case ALCHEMY_CPU_AU1000:
61 case ALCHEMY_CPU_AU1500:
62 case ALCHEMY_CPU_AU1100:
63 ret = db1000_board_setup();
64 break;
48 case ALCHEMY_CPU_AU1550: 65 case ALCHEMY_CPU_AU1550:
49 ret = db1550_board_setup(); 66 ret = db1550_board_setup();
50 break; 67 break;
@@ -62,7 +79,7 @@ void __init board_setup(void)
62 panic("cannot initialize board support"); 79 panic("cannot initialize board support");
63} 80}
64 81
65int __init db1235_arch_init(void) 82static int __init db1xxx_arch_init(void)
66{ 83{
67 int id = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)); 84 int id = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI));
68 if (id == BCSR_WHOAMI_DB1550) 85 if (id == BCSR_WHOAMI_DB1550)
@@ -70,14 +87,24 @@ int __init db1235_arch_init(void)
70 else if ((id == BCSR_WHOAMI_PB1550_SDR) || 87 else if ((id == BCSR_WHOAMI_PB1550_SDR) ||
71 (id == BCSR_WHOAMI_PB1550_DDR)) 88 (id == BCSR_WHOAMI_PB1550_DDR))
72 return db1550_pci_setup(1); 89 return db1550_pci_setup(1);
90 else if ((id == BCSR_WHOAMI_DB1500) || (id == BCSR_WHOAMI_PB1500) ||
91 (id == BCSR_WHOAMI_PB1500R2))
92 return db1500_pci_setup();
73 93
74 return 0; 94 return 0;
75} 95}
76arch_initcall(db1235_arch_init); 96arch_initcall(db1xxx_arch_init);
77 97
78int __init db1235_dev_init(void) 98static int __init db1xxx_dev_init(void)
79{ 99{
80 switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) { 100 switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) {
101 case BCSR_WHOAMI_DB1000:
102 case BCSR_WHOAMI_DB1500:
103 case BCSR_WHOAMI_DB1100:
104 case BCSR_WHOAMI_PB1500:
105 case BCSR_WHOAMI_PB1500R2:
106 case BCSR_WHOAMI_PB1100:
107 return db1000_dev_setup();
81 case BCSR_WHOAMI_PB1200_DDR1: 108 case BCSR_WHOAMI_PB1200_DDR1:
82 case BCSR_WHOAMI_PB1200_DDR2: 109 case BCSR_WHOAMI_PB1200_DDR2:
83 case BCSR_WHOAMI_DB1200: 110 case BCSR_WHOAMI_DB1200:
@@ -91,4 +118,4 @@ int __init db1235_dev_init(void)
91 } 118 }
92 return 0; 119 return 0;
93} 120}
94device_initcall(db1235_dev_init); 121device_initcall(db1xxx_dev_init);
diff --git a/arch/mips/ar7/time.c b/arch/mips/ar7/time.c
index 1dc6c3b37f91..22c93213b233 100644
--- a/arch/mips/ar7/time.c
+++ b/arch/mips/ar7/time.c
@@ -18,6 +18,7 @@
18 * Setting up the clock on the MIPS boards. 18 * Setting up the clock on the MIPS boards.
19 */ 19 */
20 20
21#include <linux/init.h>
21#include <linux/time.h> 22#include <linux/time.h>
22#include <linux/err.h> 23#include <linux/err.h>
23#include <linux/clk.h> 24#include <linux/clk.h>
diff --git a/arch/mips/ath79/Kconfig b/arch/mips/ath79/Kconfig
index 3995e31a73e2..dfc60209dc63 100644
--- a/arch/mips/ath79/Kconfig
+++ b/arch/mips/ath79/Kconfig
@@ -74,34 +74,26 @@ config ATH79_MACH_UBNT_XM
74endmenu 74endmenu
75 75
76config SOC_AR71XX 76config SOC_AR71XX
77 select USB_ARCH_HAS_EHCI
78 select USB_ARCH_HAS_OHCI
79 select HW_HAS_PCI 77 select HW_HAS_PCI
80 def_bool n 78 def_bool n
81 79
82config SOC_AR724X 80config SOC_AR724X
83 select USB_ARCH_HAS_EHCI
84 select USB_ARCH_HAS_OHCI
85 select HW_HAS_PCI 81 select HW_HAS_PCI
86 select PCI_AR724X if PCI 82 select PCI_AR724X if PCI
87 def_bool n 83 def_bool n
88 84
89config SOC_AR913X 85config SOC_AR913X
90 select USB_ARCH_HAS_EHCI
91 def_bool n 86 def_bool n
92 87
93config SOC_AR933X 88config SOC_AR933X
94 select USB_ARCH_HAS_EHCI
95 def_bool n 89 def_bool n
96 90
97config SOC_AR934X 91config SOC_AR934X
98 select USB_ARCH_HAS_EHCI
99 select HW_HAS_PCI 92 select HW_HAS_PCI
100 select PCI_AR724X if PCI 93 select PCI_AR724X if PCI
101 def_bool n 94 def_bool n
102 95
103config SOC_QCA955X 96config SOC_QCA955X
104 select USB_ARCH_HAS_EHCI
105 select HW_HAS_PCI 97 select HW_HAS_PCI
106 select PCI_AR724X if PCI 98 select PCI_AR724X if PCI
107 def_bool n 99 def_bool n
diff --git a/arch/mips/bcm47xx/Makefile b/arch/mips/bcm47xx/Makefile
index 4688b6a6211b..d58c51b5e501 100644
--- a/arch/mips/bcm47xx/Makefile
+++ b/arch/mips/bcm47xx/Makefile
@@ -4,4 +4,4 @@
4# 4#
5 5
6obj-y += irq.o nvram.o prom.o serial.o setup.o time.o sprom.o 6obj-y += irq.o nvram.o prom.o serial.o setup.o time.o sprom.o
7obj-y += board.o buttons.o leds.o 7obj-y += board.o buttons.o leds.o workarounds.o
diff --git a/arch/mips/bcm47xx/bcm47xx_private.h b/arch/mips/bcm47xx/bcm47xx_private.h
index 5c94acebf76a..0194c3b9a729 100644
--- a/arch/mips/bcm47xx/bcm47xx_private.h
+++ b/arch/mips/bcm47xx/bcm47xx_private.h
@@ -9,4 +9,7 @@ int __init bcm47xx_buttons_register(void);
9/* leds.c */ 9/* leds.c */
10void __init bcm47xx_leds_register(void); 10void __init bcm47xx_leds_register(void);
11 11
12/* workarounds.c */
13void __init bcm47xx_workarounds(void);
14
12#endif 15#endif
diff --git a/arch/mips/bcm47xx/board.c b/arch/mips/bcm47xx/board.c
index cdd8246f92b3..44ab1be68c3c 100644
--- a/arch/mips/bcm47xx/board.c
+++ b/arch/mips/bcm47xx/board.c
@@ -72,7 +72,11 @@ struct bcm47xx_board_type_list1 bcm47xx_board_list_hardware_version[] __initcons
72 {{BCM47XX_BOARD_ASUS_WL500W, "Asus WL500W"}, "WL500gW-"}, 72 {{BCM47XX_BOARD_ASUS_WL500W, "Asus WL500W"}, "WL500gW-"},
73 {{BCM47XX_BOARD_ASUS_WL520GC, "Asus WL520GC"}, "WL520GC-"}, 73 {{BCM47XX_BOARD_ASUS_WL520GC, "Asus WL520GC"}, "WL520GC-"},
74 {{BCM47XX_BOARD_ASUS_WL520GU, "Asus WL520GU"}, "WL520GU-"}, 74 {{BCM47XX_BOARD_ASUS_WL520GU, "Asus WL520GU"}, "WL520GU-"},
75 {{BCM47XX_BOARD_BELKIN_F7D3301, "Belkin F7D3301"}, "F7D3301"},
76 {{BCM47XX_BOARD_BELKIN_F7D3302, "Belkin F7D3302"}, "F7D3302"},
75 {{BCM47XX_BOARD_BELKIN_F7D4301, "Belkin F7D4301"}, "F7D4301"}, 77 {{BCM47XX_BOARD_BELKIN_F7D4301, "Belkin F7D4301"}, "F7D4301"},
78 {{BCM47XX_BOARD_BELKIN_F7D4302, "Belkin F7D4302"}, "F7D4302"},
79 {{BCM47XX_BOARD_BELKIN_F7D4401, "Belkin F7D4401"}, "F7D4401"},
76 { {0}, NULL}, 80 { {0}, NULL},
77}; 81};
78 82
@@ -176,7 +180,16 @@ struct bcm47xx_board_type_list3 bcm47xx_board_list_board[] __initconst = {
176 {{BCM47XX_BOARD_PHICOMM_M1, "Phicomm M1"}, "0x0590", "80", "0x1104"}, 180 {{BCM47XX_BOARD_PHICOMM_M1, "Phicomm M1"}, "0x0590", "80", "0x1104"},
177 {{BCM47XX_BOARD_ZTE_H218N, "ZTE H218N"}, "0x053d", "1234", "0x1305"}, 181 {{BCM47XX_BOARD_ZTE_H218N, "ZTE H218N"}, "0x053d", "1234", "0x1305"},
178 {{BCM47XX_BOARD_NETGEAR_WNR3500L, "Netgear WNR3500L"}, "0x04CF", "3500", "02"}, 182 {{BCM47XX_BOARD_NETGEAR_WNR3500L, "Netgear WNR3500L"}, "0x04CF", "3500", "02"},
179 {{BCM47XX_BOARD_LINKSYS_WRT54GSV1, "Linksys WRT54GS V1"}, "0x0101", "42", "0x10"}, 183 {{BCM47XX_BOARD_LINKSYS_WRT54G, "Linksys WRT54G/GS/GL"}, "0x0101", "42", "0x10"},
184 {{BCM47XX_BOARD_LINKSYS_WRT54G, "Linksys WRT54G/GS/GL"}, "0x0467", "42", "0x10"},
185 {{BCM47XX_BOARD_LINKSYS_WRT54G, "Linksys WRT54G/GS/GL"}, "0x0708", "42", "0x10"},
186 { {0}, NULL},
187};
188
189/* boardtype, boardrev */
190static const
191struct bcm47xx_board_type_list2 bcm47xx_board_list_board_type_rev[] __initconst = {
192 {{BCM47XX_BOARD_SIEMENS_SE505V2, "Siemens SE505 V2"}, "0x0101", "0x10"},
180 { {0}, NULL}, 193 { {0}, NULL},
181}; 194};
182 195
@@ -273,6 +286,16 @@ static __init const struct bcm47xx_board_type *bcm47xx_board_get_nvram(void)
273 return &e3->board; 286 return &e3->board;
274 } 287 }
275 } 288 }
289
290 if (bcm47xx_nvram_getenv("boardtype", buf1, sizeof(buf1)) >= 0 &&
291 bcm47xx_nvram_getenv("boardrev", buf2, sizeof(buf2)) >= 0 &&
292 bcm47xx_nvram_getenv("boardnum", buf3, sizeof(buf3)) == -ENOENT) {
293 for (e2 = bcm47xx_board_list_board_type_rev; e2->value1; e2++) {
294 if (!strcmp(buf1, e2->value1) &&
295 !strcmp(buf2, e2->value2))
296 return &e2->board;
297 }
298 }
276 return bcm47xx_board_unknown; 299 return bcm47xx_board_unknown;
277} 300}
278 301
diff --git a/arch/mips/bcm47xx/buttons.c b/arch/mips/bcm47xx/buttons.c
index 872c62e93e0e..49a1ce06844b 100644
--- a/arch/mips/bcm47xx/buttons.c
+++ b/arch/mips/bcm47xx/buttons.c
@@ -259,6 +259,18 @@ bcm47xx_buttons_linksys_wrt310nv1[] __initconst = {
259}; 259};
260 260
261static const struct gpio_keys_button 261static const struct gpio_keys_button
262bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
263 BCM47XX_GPIO_KEY(5, KEY_WIMAX),
264 BCM47XX_GPIO_KEY(6, KEY_RESTART),
265};
266
267static const struct gpio_keys_button
268bcm47xx_buttons_linksys_wrt54gsv1[] __initconst = {
269 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
270 BCM47XX_GPIO_KEY(6, KEY_RESTART),
271};
272
273static const struct gpio_keys_button
262bcm47xx_buttons_linksys_wrt610nv1[] __initconst = { 274bcm47xx_buttons_linksys_wrt610nv1[] __initconst = {
263 BCM47XX_GPIO_KEY(6, KEY_RESTART), 275 BCM47XX_GPIO_KEY(6, KEY_RESTART),
264 BCM47XX_GPIO_KEY(8, KEY_WPS_BUTTON), 276 BCM47XX_GPIO_KEY(8, KEY_WPS_BUTTON),
@@ -270,6 +282,12 @@ bcm47xx_buttons_linksys_wrt610nv2[] __initconst = {
270 BCM47XX_GPIO_KEY(6, KEY_RESTART), 282 BCM47XX_GPIO_KEY(6, KEY_RESTART),
271}; 283};
272 284
285static const struct gpio_keys_button
286bcm47xx_buttons_linksys_wrtsl54gs[] __initconst = {
287 BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
288 BCM47XX_GPIO_KEY(6, KEY_RESTART),
289};
290
273/* Motorola */ 291/* Motorola */
274 292
275static const struct gpio_keys_button 293static const struct gpio_keys_button
@@ -402,7 +420,11 @@ int __init bcm47xx_buttons_register(void)
402 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wlhdd); 420 err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wlhdd);
403 break; 421 break;
404 422
423 case BCM47XX_BOARD_BELKIN_F7D3301:
424 case BCM47XX_BOARD_BELKIN_F7D3302:
405 case BCM47XX_BOARD_BELKIN_F7D4301: 425 case BCM47XX_BOARD_BELKIN_F7D4301:
426 case BCM47XX_BOARD_BELKIN_F7D4302:
427 case BCM47XX_BOARD_BELKIN_F7D4401:
406 err = bcm47xx_copy_bdata(bcm47xx_buttons_belkin_f7d4301); 428 err = bcm47xx_copy_bdata(bcm47xx_buttons_belkin_f7d4301);
407 break; 429 break;
408 430
@@ -479,12 +501,21 @@ int __init bcm47xx_buttons_register(void)
479 case BCM47XX_BOARD_LINKSYS_WRT310NV1: 501 case BCM47XX_BOARD_LINKSYS_WRT310NV1:
480 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1); 502 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1);
481 break; 503 break;
504 case BCM47XX_BOARD_LINKSYS_WRT54G:
505 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54gsv1);
506 break;
507 case BCM47XX_BOARD_LINKSYS_WRT54G3GV2:
508 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54g3gv2);
509 break;
482 case BCM47XX_BOARD_LINKSYS_WRT610NV1: 510 case BCM47XX_BOARD_LINKSYS_WRT610NV1:
483 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt610nv1); 511 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt610nv1);
484 break; 512 break;
485 case BCM47XX_BOARD_LINKSYS_WRT610NV2: 513 case BCM47XX_BOARD_LINKSYS_WRT610NV2:
486 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt610nv2); 514 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt610nv2);
487 break; 515 break;
516 case BCM47XX_BOARD_LINKSYS_WRTSL54GS:
517 err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrtsl54gs);
518 break;
488 519
489 case BCM47XX_BOARD_MOTOROLA_WE800G: 520 case BCM47XX_BOARD_MOTOROLA_WE800G:
490 err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_we800g); 521 err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_we800g);
diff --git a/arch/mips/bcm47xx/leds.c b/arch/mips/bcm47xx/leds.c
index 647d15527066..adcb547a91c3 100644
--- a/arch/mips/bcm47xx/leds.c
+++ b/arch/mips/bcm47xx/leds.c
@@ -292,6 +292,21 @@ bcm47xx_leds_linksys_wrt310nv1[] __initconst = {
292}; 292};
293 293
294static const struct gpio_led 294static const struct gpio_led
295bcm47xx_leds_linksys_wrt54gsv1[] __initconst = {
296 BCM47XX_GPIO_LED(0, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF),
297 BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
298 BCM47XX_GPIO_LED(5, "white", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
299 BCM47XX_GPIO_LED(7, "orange", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
300};
301
302static const struct gpio_led
303bcm47xx_leds_linksys_wrt54g3gv2[] __initconst = {
304 BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
305 BCM47XX_GPIO_LED(2, "green", "3g", 0, LEDS_GPIO_DEFSTATE_OFF),
306 BCM47XX_GPIO_LED(3, "blue", "3g", 0, LEDS_GPIO_DEFSTATE_OFF),
307};
308
309static const struct gpio_led
295bcm47xx_leds_linksys_wrt610nv1[] __initconst = { 310bcm47xx_leds_linksys_wrt610nv1[] __initconst = {
296 BCM47XX_GPIO_LED(0, "unk", "usb", 1, LEDS_GPIO_DEFSTATE_OFF), 311 BCM47XX_GPIO_LED(0, "unk", "usb", 1, LEDS_GPIO_DEFSTATE_OFF),
297 BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_OFF), 312 BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_OFF),
@@ -308,6 +323,15 @@ bcm47xx_leds_linksys_wrt610nv2[] __initconst = {
308 BCM47XX_GPIO_LED(7, "unk", "usb", 0, LEDS_GPIO_DEFSTATE_OFF), 323 BCM47XX_GPIO_LED(7, "unk", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
309}; 324};
310 325
326static const struct gpio_led
327bcm47xx_leds_linksys_wrtsl54gs[] __initconst = {
328 BCM47XX_GPIO_LED(0, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
329 BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
330 BCM47XX_GPIO_LED(2, "white", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
331 BCM47XX_GPIO_LED(3, "orange", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
332 BCM47XX_GPIO_LED(7, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF),
333};
334
311/* Motorola */ 335/* Motorola */
312 336
313static const struct gpio_led 337static const struct gpio_led
@@ -359,6 +383,14 @@ bcm47xx_leds_netgear_wnr834bv2[] __initconst = {
359 BCM47XX_GPIO_LED(7, "unk", "connected", 0, LEDS_GPIO_DEFSTATE_OFF), 383 BCM47XX_GPIO_LED(7, "unk", "connected", 0, LEDS_GPIO_DEFSTATE_OFF),
360}; 384};
361 385
386/* Siemens */
387static const struct gpio_led
388bcm47xx_leds_siemens_se505v2[] __initconst = {
389 BCM47XX_GPIO_LED(0, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF),
390 BCM47XX_GPIO_LED(3, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
391 BCM47XX_GPIO_LED(5, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
392};
393
362/* SimpleTech */ 394/* SimpleTech */
363 395
364static const struct gpio_led 396static const struct gpio_led
@@ -425,7 +457,11 @@ void __init bcm47xx_leds_register(void)
425 bcm47xx_set_pdata(bcm47xx_leds_asus_wlhdd); 457 bcm47xx_set_pdata(bcm47xx_leds_asus_wlhdd);
426 break; 458 break;
427 459
460 case BCM47XX_BOARD_BELKIN_F7D3301:
461 case BCM47XX_BOARD_BELKIN_F7D3302:
428 case BCM47XX_BOARD_BELKIN_F7D4301: 462 case BCM47XX_BOARD_BELKIN_F7D4301:
463 case BCM47XX_BOARD_BELKIN_F7D4302:
464 case BCM47XX_BOARD_BELKIN_F7D4401:
429 bcm47xx_set_pdata(bcm47xx_leds_belkin_f7d4301); 465 bcm47xx_set_pdata(bcm47xx_leds_belkin_f7d4301);
430 break; 466 break;
431 467
@@ -502,12 +538,21 @@ void __init bcm47xx_leds_register(void)
502 case BCM47XX_BOARD_LINKSYS_WRT310NV1: 538 case BCM47XX_BOARD_LINKSYS_WRT310NV1:
503 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt310nv1); 539 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt310nv1);
504 break; 540 break;
541 case BCM47XX_BOARD_LINKSYS_WRT54G:
542 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54gsv1);
543 break;
544 case BCM47XX_BOARD_LINKSYS_WRT54G3GV2:
545 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54g3gv2);
546 break;
505 case BCM47XX_BOARD_LINKSYS_WRT610NV1: 547 case BCM47XX_BOARD_LINKSYS_WRT610NV1:
506 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt610nv1); 548 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt610nv1);
507 break; 549 break;
508 case BCM47XX_BOARD_LINKSYS_WRT610NV2: 550 case BCM47XX_BOARD_LINKSYS_WRT610NV2:
509 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt610nv2); 551 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt610nv2);
510 break; 552 break;
553 case BCM47XX_BOARD_LINKSYS_WRTSL54GS:
554 bcm47xx_set_pdata(bcm47xx_leds_linksys_wrtsl54gs);
555 break;
511 556
512 case BCM47XX_BOARD_MOTOROLA_WE800G: 557 case BCM47XX_BOARD_MOTOROLA_WE800G:
513 bcm47xx_set_pdata(bcm47xx_leds_motorola_we800g); 558 bcm47xx_set_pdata(bcm47xx_leds_motorola_we800g);
@@ -529,6 +574,10 @@ void __init bcm47xx_leds_register(void)
529 bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr834bv2); 574 bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr834bv2);
530 break; 575 break;
531 576
577 case BCM47XX_BOARD_SIEMENS_SE505V2:
578 bcm47xx_set_pdata(bcm47xx_leds_siemens_se505v2);
579 break;
580
532 case BCM47XX_BOARD_SIMPLETECH_SIMPLESHARE: 581 case BCM47XX_BOARD_SIMPLETECH_SIMPLESHARE:
533 bcm47xx_set_pdata(bcm47xx_leds_simpletech_simpleshare); 582 bcm47xx_set_pdata(bcm47xx_leds_simpletech_simpleshare);
534 break; 583 break;
diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
index 025be218ea15..63a4b0e915dc 100644
--- a/arch/mips/bcm47xx/setup.c
+++ b/arch/mips/bcm47xx/setup.c
@@ -212,7 +212,7 @@ void __init plat_mem_setup(void)
212{ 212{
213 struct cpuinfo_mips *c = &current_cpu_data; 213 struct cpuinfo_mips *c = &current_cpu_data;
214 214
215 if (c->cputype == CPU_74K) { 215 if ((c->cputype == CPU_74K) || (c->cputype == CPU_1074K)) {
216 printk(KERN_INFO "bcm47xx: using bcma bus\n"); 216 printk(KERN_INFO "bcm47xx: using bcma bus\n");
217#ifdef CONFIG_BCM47XX_BCMA 217#ifdef CONFIG_BCM47XX_BCMA
218 bcm47xx_bus_type = BCM47XX_BUS_TYPE_BCMA; 218 bcm47xx_bus_type = BCM47XX_BUS_TYPE_BCMA;
@@ -282,6 +282,7 @@ static int __init bcm47xx_register_bus_complete(void)
282 } 282 }
283 bcm47xx_buttons_register(); 283 bcm47xx_buttons_register();
284 bcm47xx_leds_register(); 284 bcm47xx_leds_register();
285 bcm47xx_workarounds();
285 286
286 fixed_phy_add(PHY_POLL, 0, &bcm47xx_fixed_phy_status); 287 fixed_phy_add(PHY_POLL, 0, &bcm47xx_fixed_phy_status);
287 return 0; 288 return 0;
diff --git a/arch/mips/bcm47xx/workarounds.c b/arch/mips/bcm47xx/workarounds.c
new file mode 100644
index 000000000000..e81ce4623070
--- /dev/null
+++ b/arch/mips/bcm47xx/workarounds.c
@@ -0,0 +1,31 @@
1#include "bcm47xx_private.h"
2
3#include <linux/gpio.h>
4#include <bcm47xx_board.h>
5#include <bcm47xx.h>
6
7static void __init bcm47xx_workarounds_netgear_wnr3500l(void)
8{
9 const int usb_power = 12;
10 int err;
11
12 err = gpio_request_one(usb_power, GPIOF_OUT_INIT_HIGH, "usb_power");
13 if (err)
14 pr_err("Failed to request USB power gpio: %d\n", err);
15 else
16 gpio_free(usb_power);
17}
18
19void __init bcm47xx_workarounds(void)
20{
21 enum bcm47xx_board board = bcm47xx_board_get();
22
23 switch (board) {
24 case BCM47XX_BOARD_NETGEAR_WNR3500L:
25 bcm47xx_workarounds_netgear_wnr3500l();
26 break;
27 default:
28 /* No workaround(s) needed */
29 break;
30 }
31}
diff --git a/arch/mips/bcm63xx/cpu.c b/arch/mips/bcm63xx/cpu.c
index 1b1b8a89959b..fd4e76c00a42 100644
--- a/arch/mips/bcm63xx/cpu.c
+++ b/arch/mips/bcm63xx/cpu.c
@@ -299,14 +299,13 @@ static unsigned int detect_memory_size(void)
299void __init bcm63xx_cpu_init(void) 299void __init bcm63xx_cpu_init(void)
300{ 300{
301 unsigned int tmp; 301 unsigned int tmp;
302 struct cpuinfo_mips *c = &current_cpu_data;
303 unsigned int cpu = smp_processor_id(); 302 unsigned int cpu = smp_processor_id();
304 u32 chipid_reg; 303 u32 chipid_reg;
305 304
306 /* soc registers location depends on cpu type */ 305 /* soc registers location depends on cpu type */
307 chipid_reg = 0; 306 chipid_reg = 0;
308 307
309 switch (c->cputype) { 308 switch (current_cpu_type()) {
310 case CPU_BMIPS3300: 309 case CPU_BMIPS3300:
311 if ((read_c0_prid() & PRID_IMP_MASK) != PRID_IMP_BMIPS3300_ALT) 310 if ((read_c0_prid() & PRID_IMP_MASK) != PRID_IMP_BMIPS3300_ALT)
312 __cpu_name[cpu] = "Broadcom BCM6338"; 311 __cpu_name[cpu] = "Broadcom BCM6338";
diff --git a/arch/mips/configs/db1000_defconfig b/arch/mips/configs/db1000_defconfig
deleted file mode 100644
index bac26b971c5e..000000000000
--- a/arch/mips/configs/db1000_defconfig
+++ /dev/null
@@ -1,359 +0,0 @@
1CONFIG_MIPS=y
2CONFIG_MIPS_ALCHEMY=y
3CONFIG_MIPS_DB1000=y
4CONFIG_SCHED_OMIT_FRAME_POINTER=y
5CONFIG_TICK_ONESHOT=y
6CONFIG_NO_HZ=y
7CONFIG_HIGH_RES_TIMERS=y
8CONFIG_HZ_100=y
9CONFIG_HZ=100
10CONFIG_PREEMPT_NONE=y
11CONFIG_EXPERIMENTAL=y
12CONFIG_BROKEN_ON_SMP=y
13CONFIG_INIT_ENV_ARG_LIMIT=32
14CONFIG_CROSS_COMPILE=""
15CONFIG_LOCALVERSION="-db1x00"
16CONFIG_LOCALVERSION_AUTO=y
17CONFIG_KERNEL_LZMA=y
18CONFIG_DEFAULT_HOSTNAME="db1x00"
19CONFIG_SWAP=y
20CONFIG_SYSVIPC=y
21CONFIG_SYSVIPC_SYSCTL=y
22CONFIG_FHANDLE=y
23CONFIG_AUDIT=y
24CONFIG_TINY_RCU=y
25CONFIG_LOG_BUF_SHIFT=18
26CONFIG_NAMESPACES=y
27CONFIG_UTS_NS=y
28CONFIG_IPC_NS=y
29CONFIG_USER_NS=y
30CONFIG_PID_NS=y
31CONFIG_NET_NS=y
32CONFIG_SYSCTL=y
33CONFIG_EXPERT=y
34CONFIG_KALLSYMS=y
35CONFIG_KALLSYMS_ALL=y
36CONFIG_HOTPLUG=y
37CONFIG_PRINTK=y
38CONFIG_BUG=y
39CONFIG_ELF_CORE=y
40CONFIG_BASE_FULL=y
41CONFIG_FUTEX=y
42CONFIG_EPOLL=y
43CONFIG_SIGNALFD=y
44CONFIG_TIMERFD=y
45CONFIG_EVENTFD=y
46CONFIG_SHMEM=y
47CONFIG_AIO=y
48CONFIG_EMBEDDED=y
49CONFIG_HAVE_PERF_EVENTS=y
50CONFIG_PERF_USE_VMALLOC=y
51CONFIG_PCI_QUIRKS=y
52CONFIG_SLAB=y
53CONFIG_SLABINFO=y
54CONFIG_BLOCK=y
55CONFIG_LBDAF=y
56CONFIG_BLK_DEV_BSG=y
57CONFIG_BLK_DEV_BSGLIB=y
58CONFIG_IOSCHED_NOOP=y
59CONFIG_DEFAULT_NOOP=y
60CONFIG_DEFAULT_IOSCHED="noop"
61CONFIG_FREEZER=y
62CONFIG_PCI=y
63CONFIG_PCI_DOMAINS=y
64CONFIG_PCCARD=y
65CONFIG_PCMCIA=y
66CONFIG_PCMCIA_LOAD_CIS=y
67CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
68CONFIG_BINFMT_ELF=y
69CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
70CONFIG_SUSPEND=y
71CONFIG_SUSPEND_FREEZER=y
72CONFIG_PM_SLEEP=y
73CONFIG_PM_RUNTIME=y
74CONFIG_PM=y
75CONFIG_NET=y
76CONFIG_PACKET=y
77CONFIG_UNIX=y
78CONFIG_XFRM=y
79CONFIG_INET=y
80CONFIG_IP_MULTICAST=y
81CONFIG_IP_PNP=y
82CONFIG_IP_PNP_DHCP=y
83CONFIG_IP_PNP_BOOTP=y
84CONFIG_IP_PNP_RARP=y
85CONFIG_NET_IPIP=y
86CONFIG_INET_TUNNEL=y
87CONFIG_INET_LRO=y
88CONFIG_TCP_CONG_CUBIC=y
89CONFIG_DEFAULT_TCP_CONG="cubic"
90CONFIG_IPV6=y
91CONFIG_INET6_XFRM_MODE_TRANSPORT=y
92CONFIG_INET6_XFRM_MODE_TUNNEL=y
93CONFIG_INET6_XFRM_MODE_BEET=y
94CONFIG_IPV6_SIT=y
95CONFIG_IPV6_NDISC_NODETYPE=y
96CONFIG_STP=y
97CONFIG_GARP=y
98CONFIG_BRIDGE=y
99CONFIG_BRIDGE_IGMP_SNOOPING=y
100CONFIG_VLAN_8021Q=y
101CONFIG_VLAN_8021Q_GVRP=y
102CONFIG_LLC=y
103CONFIG_LLC2=y
104CONFIG_DNS_RESOLVER=y
105CONFIG_BT=y
106CONFIG_BT_L2CAP=y
107CONFIG_BT_SCO=y
108CONFIG_BT_RFCOMM=y
109CONFIG_BT_RFCOMM_TTY=y
110CONFIG_BT_BNEP=y
111CONFIG_BT_BNEP_MC_FILTER=y
112CONFIG_BT_BNEP_PROTO_FILTER=y
113CONFIG_BT_HIDP=y
114CONFIG_BT_HCIBTUSB=y
115CONFIG_UEVENT_HELPER_PATH=""
116CONFIG_STANDALONE=y
117CONFIG_PREVENT_FIRMWARE_BUILD=y
118CONFIG_FW_LOADER=y
119CONFIG_MTD=y
120CONFIG_MTD_CMDLINE_PARTS=y
121CONFIG_MTD_CHAR=y
122CONFIG_MTD_BLKDEVS=y
123CONFIG_MTD_BLOCK=y
124CONFIG_MTD_CFI=y
125CONFIG_MTD_GEN_PROBE=y
126CONFIG_MTD_CFI_ADV_OPTIONS=y
127CONFIG_MTD_CFI_NOSWAP=y
128CONFIG_MTD_CFI_GEOMETRY=y
129CONFIG_MTD_MAP_BANK_WIDTH_1=y
130CONFIG_MTD_MAP_BANK_WIDTH_2=y
131CONFIG_MTD_MAP_BANK_WIDTH_4=y
132CONFIG_MTD_CFI_I1=y
133CONFIG_MTD_CFI_I2=y
134CONFIG_MTD_CFI_I4=y
135CONFIG_MTD_CFI_I8=y
136CONFIG_MTD_CFI_INTELEXT=y
137CONFIG_MTD_CFI_AMDSTD=y
138CONFIG_MTD_CFI_UTIL=y
139CONFIG_MTD_PHYSMAP=y
140CONFIG_SCSI_MOD=y
141CONFIG_SCSI=y
142CONFIG_SCSI_DMA=y
143CONFIG_SCSI_PROC_FS=y
144CONFIG_BLK_DEV_SD=y
145CONFIG_CHR_DEV_SG=y
146CONFIG_SCSI_MULTI_LUN=y
147CONFIG_SCSI_CONSTANTS=y
148CONFIG_ATA=y
149CONFIG_ATA_VERBOSE_ERROR=y
150CONFIG_ATA_SFF=y
151CONFIG_ATA_BMDMA=y
152CONFIG_PATA_HPT37X=y
153CONFIG_PATA_PCMCIA=y
154CONFIG_MD=y
155CONFIG_BLK_DEV_DM=y
156CONFIG_FIREWIRE=y
157CONFIG_FIREWIRE_OHCI=y
158CONFIG_FIREWIRE_OHCI_DEBUG=y
159CONFIG_FIREWIRE_NET=y
160CONFIG_NETDEVICES=y
161CONFIG_MII=y
162CONFIG_PHYLIB=y
163CONFIG_NET_ETHERNET=y
164CONFIG_MIPS_AU1X00_ENET=y
165CONFIG_NET_PCMCIA=y
166CONFIG_PCMCIA_3C589=y
167CONFIG_PCMCIA_PCNET=y
168CONFIG_PPP=y
169CONFIG_PPP_MULTILINK=y
170CONFIG_PPP_FILTER=y
171CONFIG_PPP_ASYNC=y
172CONFIG_PPP_SYNC_TTY=y
173CONFIG_PPP_DEFLATE=y
174CONFIG_PPP_BSDCOMP=y
175CONFIG_PPP_MPPE=y
176CONFIG_PPPOE=y
177CONFIG_INPUT=y
178CONFIG_INPUT_EVDEV=y
179CONFIG_INPUT_MISC=y
180CONFIG_INPUT_UINPUT=y
181CONFIG_VT=y
182CONFIG_CONSOLE_TRANSLATIONS=y
183CONFIG_VT_CONSOLE=y
184CONFIG_HW_CONSOLE=y
185CONFIG_UNIX98_PTYS=y
186CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
187CONFIG_DEVKMEM=y
188CONFIG_SERIAL_8250=y
189CONFIG_SERIAL_8250_CONSOLE=y
190CONFIG_SERIAL_8250_NR_UARTS=4
191CONFIG_SERIAL_8250_RUNTIME_UARTS=4
192CONFIG_SERIAL_CORE=y
193CONFIG_SERIAL_CORE_CONSOLE=y
194CONFIG_TTY_PRINTK=y
195CONFIG_DEVPORT=y
196CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
197CONFIG_FB=y
198CONFIG_FB_CFB_FILLRECT=y
199CONFIG_FB_CFB_COPYAREA=y
200CONFIG_FB_CFB_IMAGEBLIT=y
201CONFIG_FB_AU1100=y
202CONFIG_DUMMY_CONSOLE=y
203CONFIG_FRAMEBUFFER_CONSOLE=y
204CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
205CONFIG_FONTS=y
206CONFIG_FONT_8x16=y
207CONFIG_SOUND=y
208CONFIG_SND=y
209CONFIG_SND_TIMER=y
210CONFIG_SND_PCM=y
211CONFIG_SND_JACK=y
212CONFIG_SND_SEQUENCER=y
213CONFIG_SND_HRTIMER=y
214CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
215CONFIG_SND_DYNAMIC_MINORS=y
216CONFIG_SND_VMASTER=y
217CONFIG_SND_AC97_CODEC=y
218CONFIG_SND_SOC=y
219CONFIG_SND_SOC_AC97_BUS=y
220CONFIG_SND_SOC_AU1XAUDIO=y
221CONFIG_SND_SOC_AU1XAC97C=y
222CONFIG_SND_SOC_DB1000=y
223CONFIG_SND_SOC_AC97_CODEC=y
224CONFIG_AC97_BUS=y
225CONFIG_HID_SUPPORT=y
226CONFIG_HID=y
227CONFIG_HIDRAW=y
228CONFIG_USB_HID=y
229CONFIG_USB_SUPPORT=y
230CONFIG_USB=y
231CONFIG_USB_EHCI_HCD=y
232CONFIG_USB_EHCI_ROOT_HUB_TT=y
233CONFIG_USB_EHCI_TT_NEWSCHED=y
234CONFIG_USB_OHCI_HCD=y
235CONFIG_USB_OHCI_HCD_PLATFORM=y
236CONFIG_USB_UHCI_HCD=y
237CONFIG_USB_STORAGE=y
238CONFIG_NEW_LEDS=y
239CONFIG_LEDS_CLASS=y
240CONFIG_LEDS_TRIGGERS=y
241CONFIG_RTC_LIB=y
242CONFIG_RTC_CLASS=y
243CONFIG_RTC_HCTOSYS=y
244CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
245CONFIG_RTC_INTF_SYSFS=y
246CONFIG_RTC_INTF_PROC=y
247CONFIG_RTC_INTF_DEV=y
248CONFIG_RTC_DRV_AU1XXX=y
249CONFIG_EXT4_FS=y
250CONFIG_EXT4_USE_FOR_EXT23=y
251CONFIG_EXT4_FS_XATTR=y
252CONFIG_EXT4_FS_POSIX_ACL=y
253CONFIG_EXT4_FS_SECURITY=y
254CONFIG_JBD2=y
255CONFIG_FS_MBCACHE=y
256CONFIG_FS_POSIX_ACL=y
257CONFIG_EXPORTFS=y
258CONFIG_FILE_LOCKING=y
259CONFIG_FSNOTIFY=y
260CONFIG_DNOTIFY=y
261CONFIG_INOTIFY_USER=y
262CONFIG_GENERIC_ACL=y
263CONFIG_PROC_FS=y
264CONFIG_PROC_KCORE=y
265CONFIG_PROC_SYSCTL=y
266CONFIG_SYSFS=y
267CONFIG_TMPFS=y
268CONFIG_TMPFS_POSIX_ACL=y
269CONFIG_TMPFS_XATTR=y
270CONFIG_MISC_FILESYSTEMS=y
271CONFIG_JFFS2_FS=y
272CONFIG_JFFS2_FS_DEBUG=0
273CONFIG_JFFS2_FS_WRITEBUFFER=y
274CONFIG_JFFS2_SUMMARY=y
275CONFIG_JFFS2_FS_XATTR=y
276CONFIG_JFFS2_FS_POSIX_ACL=y
277CONFIG_JFFS2_FS_SECURITY=y
278CONFIG_JFFS2_COMPRESSION_OPTIONS=y
279CONFIG_JFFS2_ZLIB=y
280CONFIG_JFFS2_LZO=y
281CONFIG_JFFS2_RTIME=y
282CONFIG_JFFS2_RUBIN=y
283CONFIG_JFFS2_CMODE_PRIORITY=y
284CONFIG_SQUASHFS=y
285CONFIG_SQUASHFS_ZLIB=y
286CONFIG_SQUASHFS_LZO=y
287CONFIG_SQUASHFS_XZ=y
288CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
289CONFIG_NETWORK_FILESYSTEMS=y
290CONFIG_NFS_FS=y
291CONFIG_NFS_V3=y
292CONFIG_NFS_V4=y
293CONFIG_NFS_V4_1=y
294CONFIG_PNFS_FILE_LAYOUT=y
295CONFIG_PNFS_BLOCK=y
296CONFIG_ROOT_NFS=y
297CONFIG_NFS_USE_KERNEL_DNS=y
298CONFIG_NFS_USE_NEW_IDMAPPER=y
299CONFIG_NFSD=y
300CONFIG_NFSD_V2_ACL=y
301CONFIG_NFSD_V3=y
302CONFIG_NFSD_V3_ACL=y
303CONFIG_NFSD_V4=y
304CONFIG_LOCKD=y
305CONFIG_LOCKD_V4=y
306CONFIG_NFS_ACL_SUPPORT=y
307CONFIG_NFS_COMMON=y
308CONFIG_SUNRPC=y
309CONFIG_SUNRPC_GSS=y
310CONFIG_SUNRPC_BACKCHANNEL=y
311CONFIG_MSDOS_PARTITION=y
312CONFIG_NLS=y
313CONFIG_NLS_DEFAULT="iso8859-1"
314CONFIG_NLS_CODEPAGE_437=y
315CONFIG_NLS_CODEPAGE_850=y
316CONFIG_NLS_CODEPAGE_1250=y
317CONFIG_NLS_ASCII=y
318CONFIG_NLS_ISO8859_1=y
319CONFIG_NLS_ISO8859_15=y
320CONFIG_NLS_UTF8=y
321CONFIG_HAVE_ARCH_KGDB=y
322CONFIG_EARLY_PRINTK=y
323CONFIG_CMDLINE_BOOL=y
324CONFIG_CMDLINE="noirqdebug rootwait root=/dev/sda1 rootfstype=ext4 console=ttyS0,115200 video=au1100fb:panel:CRT_800x600_16"
325CONFIG_DEBUG_ZBOOT=y
326CONFIG_KEYS=y
327CONFIG_KEYS_DEBUG_PROC_KEYS=y
328CONFIG_SECURITYFS=y
329CONFIG_DEFAULT_SECURITY_DAC=y
330CONFIG_DEFAULT_SECURITY=""
331CONFIG_CRYPTO=y
332CONFIG_CRYPTO_ALGAPI=y
333CONFIG_CRYPTO_ALGAPI2=y
334CONFIG_CRYPTO_AEAD2=y
335CONFIG_CRYPTO_BLKCIPHER=y
336CONFIG_CRYPTO_BLKCIPHER2=y
337CONFIG_CRYPTO_HASH=y
338CONFIG_CRYPTO_HASH2=y
339CONFIG_CRYPTO_RNG=y
340CONFIG_CRYPTO_RNG2=y
341CONFIG_CRYPTO_PCOMP2=y
342CONFIG_CRYPTO_MANAGER=y
343CONFIG_CRYPTO_MANAGER2=y
344CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
345CONFIG_CRYPTO_WORKQUEUE=y
346CONFIG_CRYPTO_ECB=y
347CONFIG_CRYPTO_SHA1=y
348CONFIG_CRYPTO_AES=y
349CONFIG_CRYPTO_ANSI_CPRNG=y
350CONFIG_BITREVERSE=y
351CONFIG_CRC_CCITT=y
352CONFIG_CRC16=y
353CONFIG_CRC_ITU_T=y
354CONFIG_CRC32=y
355CONFIG_ZLIB_INFLATE=y
356CONFIG_ZLIB_DEFLATE=y
357CONFIG_LZO_COMPRESS=y
358CONFIG_LZO_DECOMPRESS=y
359CONFIG_XZ_DEC=y
diff --git a/arch/mips/configs/db1235_defconfig b/arch/mips/configs/db1235_defconfig
deleted file mode 100644
index 28e49f226dc0..000000000000
--- a/arch/mips/configs/db1235_defconfig
+++ /dev/null
@@ -1,434 +0,0 @@
1CONFIG_MIPS_ALCHEMY=y
2CONFIG_MIPS_DB1235=y
3CONFIG_COMPACTION=y
4CONFIG_KSM=y
5CONFIG_HZ_100=y
6CONFIG_EXPERIMENTAL=y
7CONFIG_LOCALVERSION="-db1235"
8CONFIG_KERNEL_LZMA=y
9CONFIG_DEFAULT_HOSTNAME="db1235"
10CONFIG_SYSVIPC=y
11CONFIG_POSIX_MQUEUE=y
12CONFIG_BSD_PROCESS_ACCT=y
13CONFIG_BSD_PROCESS_ACCT_V3=y
14CONFIG_FHANDLE=y
15CONFIG_TASKSTATS=y
16CONFIG_TASK_DELAY_ACCT=y
17CONFIG_AUDIT=y
18CONFIG_AUDIT_LOGINUID_IMMUTABLE=y
19CONFIG_NO_HZ=y
20CONFIG_HIGH_RES_TIMERS=y
21CONFIG_LOG_BUF_SHIFT=16
22CONFIG_NAMESPACES=y
23CONFIG_EMBEDDED=y
24CONFIG_SLAB=y
25CONFIG_JUMP_LABEL=y
26CONFIG_PARTITION_ADVANCED=y
27CONFIG_LDM_PARTITION=y
28CONFIG_EFI_PARTITION=y
29CONFIG_PCI=y
30CONFIG_PCCARD=y
31CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
32CONFIG_PM_RUNTIME=y
33CONFIG_NET=y
34CONFIG_PACKET=y
35CONFIG_UNIX=y
36CONFIG_UNIX_DIAG=y
37CONFIG_XFRM_USER=y
38CONFIG_INET=y
39CONFIG_IP_MULTICAST=y
40CONFIG_IP_ADVANCED_ROUTER=y
41CONFIG_IP_MULTIPLE_TABLES=y
42CONFIG_IP_ROUTE_MULTIPATH=y
43CONFIG_IP_ROUTE_VERBOSE=y
44CONFIG_IP_PNP=y
45CONFIG_IP_PNP_DHCP=y
46CONFIG_IP_PNP_BOOTP=y
47CONFIG_IP_PNP_RARP=y
48CONFIG_NET_IPIP=y
49CONFIG_NET_IPGRE_DEMUX=y
50CONFIG_NET_IPGRE=y
51CONFIG_NET_IPGRE_BROADCAST=y
52CONFIG_IP_MROUTE=y
53CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
54CONFIG_IP_PIMSM_V1=y
55CONFIG_IP_PIMSM_V2=y
56CONFIG_ARPD=y
57CONFIG_SYN_COOKIES=y
58CONFIG_NET_IPVTI=y
59CONFIG_INET_AH=y
60CONFIG_INET_ESP=y
61CONFIG_INET_IPCOMP=y
62CONFIG_INET_UDP_DIAG=y
63CONFIG_TCP_CONG_ADVANCED=y
64CONFIG_TCP_CONG_HSTCP=y
65CONFIG_TCP_CONG_HYBLA=y
66CONFIG_TCP_CONG_SCALABLE=y
67CONFIG_TCP_CONG_LP=y
68CONFIG_TCP_CONG_VENO=y
69CONFIG_TCP_CONG_YEAH=y
70CONFIG_TCP_CONG_ILLINOIS=y
71CONFIG_DEFAULT_HYBLA=y
72CONFIG_TCP_MD5SIG=y
73CONFIG_IPV6_PRIVACY=y
74CONFIG_IPV6_ROUTER_PREF=y
75CONFIG_IPV6_ROUTE_INFO=y
76CONFIG_IPV6_OPTIMISTIC_DAD=y
77CONFIG_INET6_AH=y
78CONFIG_INET6_ESP=y
79CONFIG_INET6_IPCOMP=y
80CONFIG_IPV6_MIP6=y
81CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=y
82CONFIG_IPV6_SIT_6RD=y
83CONFIG_IPV6_TUNNEL=y
84CONFIG_IPV6_MULTIPLE_TABLES=y
85CONFIG_IPV6_SUBTREES=y
86CONFIG_IPV6_MROUTE=y
87CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
88CONFIG_IPV6_PIMSM_V2=y
89CONFIG_NETFILTER=y
90CONFIG_NF_CONNTRACK=y
91CONFIG_NF_CONNTRACK_EVENTS=y
92CONFIG_NF_CONNTRACK_TIMEOUT=y
93CONFIG_NF_CONNTRACK_TIMESTAMP=y
94CONFIG_NF_CT_PROTO_DCCP=y
95CONFIG_NF_CT_PROTO_SCTP=y
96CONFIG_NF_CT_PROTO_UDPLITE=y
97CONFIG_NF_CONNTRACK_AMANDA=y
98CONFIG_NF_CONNTRACK_FTP=y
99CONFIG_NF_CONNTRACK_H323=y
100CONFIG_NF_CONNTRACK_IRC=y
101CONFIG_NF_CONNTRACK_NETBIOS_NS=y
102CONFIG_NF_CONNTRACK_SNMP=y
103CONFIG_NF_CONNTRACK_PPTP=y
104CONFIG_NF_CONNTRACK_SANE=y
105CONFIG_NF_CONNTRACK_SIP=y
106CONFIG_NF_CONNTRACK_TFTP=y
107CONFIG_NF_CT_NETLINK=y
108CONFIG_NF_CT_NETLINK_TIMEOUT=y
109CONFIG_NF_CT_NETLINK_HELPER=y
110CONFIG_NETFILTER_NETLINK_QUEUE_CT=y
111CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
112CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
113CONFIG_NETFILTER_XT_TARGET_HMARK=y
114CONFIG_NETFILTER_XT_TARGET_IDLETIMER=y
115CONFIG_NETFILTER_XT_TARGET_LED=y
116CONFIG_NETFILTER_XT_TARGET_LOG=y
117CONFIG_NETFILTER_XT_TARGET_MARK=y
118CONFIG_NETFILTER_XT_TARGET_NFLOG=y
119CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y
120CONFIG_NETFILTER_XT_TARGET_TEE=y
121CONFIG_NETFILTER_XT_TARGET_TCPMSS=y
122CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=y
123CONFIG_NETFILTER_XT_MATCH_CLUSTER=y
124CONFIG_NETFILTER_XT_MATCH_COMMENT=y
125CONFIG_NETFILTER_XT_MATCH_CONNBYTES=y
126CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=y
127CONFIG_NETFILTER_XT_MATCH_CONNMARK=y
128CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
129CONFIG_NETFILTER_XT_MATCH_CPU=y
130CONFIG_NETFILTER_XT_MATCH_DCCP=y
131CONFIG_NETFILTER_XT_MATCH_DEVGROUP=y
132CONFIG_NETFILTER_XT_MATCH_DSCP=y
133CONFIG_NETFILTER_XT_MATCH_ESP=y
134CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=y
135CONFIG_NETFILTER_XT_MATCH_HELPER=y
136CONFIG_NETFILTER_XT_MATCH_IPRANGE=y
137CONFIG_NETFILTER_XT_MATCH_LENGTH=y
138CONFIG_NETFILTER_XT_MATCH_LIMIT=y
139CONFIG_NETFILTER_XT_MATCH_MAC=y
140CONFIG_NETFILTER_XT_MATCH_MARK=y
141CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y
142CONFIG_NETFILTER_XT_MATCH_NFACCT=y
143CONFIG_NETFILTER_XT_MATCH_OSF=y
144CONFIG_NETFILTER_XT_MATCH_OWNER=y
145CONFIG_NETFILTER_XT_MATCH_POLICY=y
146CONFIG_NETFILTER_XT_MATCH_PHYSDEV=y
147CONFIG_NETFILTER_XT_MATCH_PKTTYPE=y
148CONFIG_NETFILTER_XT_MATCH_QUOTA=y
149CONFIG_NETFILTER_XT_MATCH_RATEEST=y
150CONFIG_NETFILTER_XT_MATCH_REALM=y
151CONFIG_NETFILTER_XT_MATCH_RECENT=y
152CONFIG_NETFILTER_XT_MATCH_SCTP=y
153CONFIG_NETFILTER_XT_MATCH_STATE=y
154CONFIG_NETFILTER_XT_MATCH_STATISTIC=y
155CONFIG_NETFILTER_XT_MATCH_STRING=y
156CONFIG_NETFILTER_XT_MATCH_TCPMSS=y
157CONFIG_NETFILTER_XT_MATCH_TIME=y
158CONFIG_NETFILTER_XT_MATCH_U32=y
159CONFIG_NF_CONNTRACK_IPV4=y
160CONFIG_IP_NF_IPTABLES=y
161CONFIG_IP_NF_MATCH_AH=y
162CONFIG_IP_NF_MATCH_ECN=y
163CONFIG_IP_NF_MATCH_RPFILTER=y
164CONFIG_IP_NF_MATCH_TTL=y
165CONFIG_IP_NF_FILTER=y
166CONFIG_IP_NF_TARGET_REJECT=y
167CONFIG_IP_NF_TARGET_ULOG=y
168CONFIG_NF_NAT=y
169CONFIG_IP_NF_TARGET_MASQUERADE=y
170CONFIG_IP_NF_TARGET_NETMAP=y
171CONFIG_IP_NF_TARGET_REDIRECT=y
172CONFIG_IP_NF_MANGLE=y
173CONFIG_IP_NF_TARGET_CLUSTERIP=y
174CONFIG_IP_NF_TARGET_ECN=y
175CONFIG_IP_NF_TARGET_TTL=y
176CONFIG_IP_NF_RAW=y
177CONFIG_IP_NF_ARPTABLES=y
178CONFIG_IP_NF_ARPFILTER=y
179CONFIG_IP_NF_ARP_MANGLE=y
180CONFIG_NF_CONNTRACK_IPV6=y
181CONFIG_IP6_NF_IPTABLES=y
182CONFIG_IP6_NF_MATCH_AH=y
183CONFIG_IP6_NF_MATCH_EUI64=y
184CONFIG_IP6_NF_MATCH_FRAG=y
185CONFIG_IP6_NF_MATCH_OPTS=y
186CONFIG_IP6_NF_MATCH_HL=y
187CONFIG_IP6_NF_MATCH_IPV6HEADER=y
188CONFIG_IP6_NF_MATCH_MH=y
189CONFIG_IP6_NF_MATCH_RPFILTER=y
190CONFIG_IP6_NF_MATCH_RT=y
191CONFIG_IP6_NF_TARGET_HL=y
192CONFIG_IP6_NF_FILTER=y
193CONFIG_IP6_NF_TARGET_REJECT=y
194CONFIG_IP6_NF_MANGLE=y
195CONFIG_IP6_NF_RAW=y
196CONFIG_BRIDGE_NF_EBTABLES=y
197CONFIG_BRIDGE_EBT_BROUTE=y
198CONFIG_BRIDGE_EBT_T_FILTER=y
199CONFIG_BRIDGE_EBT_T_NAT=y
200CONFIG_BRIDGE_EBT_802_3=y
201CONFIG_BRIDGE_EBT_AMONG=y
202CONFIG_BRIDGE_EBT_ARP=y
203CONFIG_BRIDGE_EBT_IP=y
204CONFIG_BRIDGE_EBT_IP6=y
205CONFIG_BRIDGE_EBT_LIMIT=y
206CONFIG_BRIDGE_EBT_MARK=y
207CONFIG_BRIDGE_EBT_PKTTYPE=y
208CONFIG_BRIDGE_EBT_STP=y
209CONFIG_BRIDGE_EBT_VLAN=y
210CONFIG_BRIDGE_EBT_ARPREPLY=y
211CONFIG_BRIDGE_EBT_DNAT=y
212CONFIG_BRIDGE_EBT_MARK_T=y
213CONFIG_BRIDGE_EBT_REDIRECT=y
214CONFIG_BRIDGE_EBT_SNAT=y
215CONFIG_BRIDGE_EBT_LOG=y
216CONFIG_BRIDGE_EBT_NFLOG=y
217CONFIG_L2TP=y
218CONFIG_L2TP_V3=y
219CONFIG_L2TP_IP=y
220CONFIG_L2TP_ETH=y
221CONFIG_BRIDGE=y
222CONFIG_VLAN_8021Q=y
223CONFIG_VLAN_8021Q_GVRP=y
224CONFIG_LLC2=y
225CONFIG_NET_SCHED=y
226CONFIG_NET_SCH_CBQ=y
227CONFIG_NET_SCH_HTB=y
228CONFIG_NET_SCH_HFSC=y
229CONFIG_NET_SCH_PRIO=y
230CONFIG_NET_SCH_MULTIQ=y
231CONFIG_NET_SCH_RED=y
232CONFIG_NET_SCH_SFB=y
233CONFIG_NET_SCH_SFQ=y
234CONFIG_NET_SCH_TEQL=y
235CONFIG_NET_SCH_TBF=y
236CONFIG_NET_SCH_GRED=y
237CONFIG_NET_SCH_DSMARK=y
238CONFIG_NET_SCH_NETEM=y
239CONFIG_NET_SCH_DRR=y
240CONFIG_NET_SCH_MQPRIO=y
241CONFIG_NET_SCH_CHOKE=y
242CONFIG_NET_SCH_QFQ=y
243CONFIG_NET_SCH_CODEL=y
244CONFIG_NET_SCH_FQ_CODEL=y
245CONFIG_NET_SCH_INGRESS=y
246CONFIG_NET_SCH_PLUG=y
247CONFIG_NET_CLS_BASIC=y
248CONFIG_NET_CLS_TCINDEX=y
249CONFIG_NET_CLS_ROUTE4=y
250CONFIG_NET_CLS_FW=y
251CONFIG_NET_CLS_U32=y
252CONFIG_CLS_U32_PERF=y
253CONFIG_CLS_U32_MARK=y
254CONFIG_NET_CLS_RSVP=y
255CONFIG_NET_CLS_RSVP6=y
256CONFIG_NET_CLS_FLOW=y
257CONFIG_NET_EMATCH=y
258CONFIG_NET_EMATCH_CMP=y
259CONFIG_NET_EMATCH_NBYTE=y
260CONFIG_NET_EMATCH_U32=y
261CONFIG_NET_EMATCH_META=y
262CONFIG_NET_EMATCH_TEXT=y
263CONFIG_NET_CLS_ACT=y
264CONFIG_NET_ACT_POLICE=y
265CONFIG_NET_ACT_GACT=y
266CONFIG_GACT_PROB=y
267CONFIG_NET_ACT_MIRRED=y
268CONFIG_NET_ACT_NAT=y
269CONFIG_NET_ACT_PEDIT=y
270CONFIG_NET_ACT_SIMP=y
271CONFIG_NET_ACT_SKBEDIT=y
272CONFIG_NET_ACT_CSUM=y
273CONFIG_NET_CLS_IND=y
274CONFIG_BT=y
275CONFIG_BT_RFCOMM=y
276CONFIG_BT_RFCOMM_TTY=y
277CONFIG_BT_BNEP=y
278CONFIG_BT_BNEP_MC_FILTER=y
279CONFIG_BT_BNEP_PROTO_FILTER=y
280CONFIG_BT_HIDP=y
281CONFIG_BT_HCIBTUSB=y
282CONFIG_CFG80211=y
283CONFIG_CFG80211_CERTIFICATION_ONUS=y
284CONFIG_CFG80211_WEXT=y
285CONFIG_MAC80211=y
286CONFIG_MAC80211_LEDS=y
287CONFIG_RFKILL=y
288CONFIG_RFKILL_INPUT=y
289CONFIG_DEVTMPFS=y
290CONFIG_DEVTMPFS_MOUNT=y
291CONFIG_MTD=y
292CONFIG_MTD_CHAR=y
293CONFIG_MTD_BLOCK=y
294CONFIG_MTD_CFI=y
295CONFIG_MTD_CFI_AMDSTD=y
296CONFIG_MTD_PHYSMAP=y
297CONFIG_MTD_M25P80=y
298CONFIG_MTD_NAND=y
299CONFIG_MTD_NAND_PLATFORM=y
300CONFIG_EEPROM_AT24=y
301CONFIG_EEPROM_AT25=y
302CONFIG_IDE=y
303CONFIG_BLK_DEV_IDE_AU1XXX=y
304CONFIG_BLK_DEV_SD=y
305CONFIG_CHR_DEV_SG=y
306CONFIG_SCSI_MULTI_LUN=y
307CONFIG_ATA=y
308CONFIG_PATA_HPT37X=y
309CONFIG_PATA_PCMCIA=y
310CONFIG_PATA_PLATFORM=y
311CONFIG_NETDEVICES=y
312CONFIG_MIPS_AU1X00_ENET=y
313CONFIG_SMC91X=y
314CONFIG_SMSC911X=y
315CONFIG_AMD_PHY=y
316CONFIG_SMSC_PHY=y
317CONFIG_RT2X00=y
318CONFIG_RT73USB=y
319CONFIG_INPUT_EVDEV=y
320CONFIG_INPUT_TOUCHSCREEN=y
321CONFIG_TOUCHSCREEN_WM97XX=y
322CONFIG_INPUT_MISC=y
323CONFIG_INPUT_UINPUT=y
324CONFIG_SERIAL_8250=y
325CONFIG_SERIAL_8250_CONSOLE=y
326CONFIG_TTY_PRINTK=y
327CONFIG_I2C=y
328CONFIG_I2C_CHARDEV=y
329CONFIG_I2C_AU1550=y
330CONFIG_SPI=y
331CONFIG_SPI_AU1550=y
332CONFIG_GPIO_SYSFS=y
333CONFIG_SENSORS_ADM1025=y
334CONFIG_SENSORS_LM70=y
335CONFIG_SOUND=y
336CONFIG_SND=y
337CONFIG_SND_HRTIMER=y
338CONFIG_SND_DYNAMIC_MINORS=y
339CONFIG_SND_SOC=y
340CONFIG_SND_SOC_AU1XPSC=y
341CONFIG_SND_SOC_DB1200=y
342CONFIG_HIDRAW=y
343CONFIG_UHID=y
344CONFIG_USB_HIDDEV=y
345CONFIG_USB=y
346CONFIG_USB_DYNAMIC_MINORS=y
347CONFIG_USB_EHCI_HCD=y
348CONFIG_USB_EHCI_HCD_PLATFORM=y
349CONFIG_USB_EHCI_ROOT_HUB_TT=y
350CONFIG_USB_OHCI_HCD=y
351CONFIG_USB_OHCI_HCD_PLATFORM=y
352CONFIG_USB_STORAGE=y
353CONFIG_MMC=y
354CONFIG_MMC_AU1X=y
355CONFIG_NEW_LEDS=y
356CONFIG_LEDS_CLASS=y
357CONFIG_RTC_CLASS=y
358CONFIG_RTC_DRV_AU1XXX=y
359CONFIG_EXT4_FS=y
360CONFIG_EXT4_FS_POSIX_ACL=y
361CONFIG_EXT4_FS_SECURITY=y
362CONFIG_XFS_FS=y
363CONFIG_XFS_POSIX_ACL=y
364CONFIG_VFAT_FS=y
365CONFIG_TMPFS=y
366CONFIG_TMPFS_POSIX_ACL=y
367CONFIG_CONFIGFS_FS=y
368CONFIG_JFFS2_FS=y
369CONFIG_JFFS2_SUMMARY=y
370CONFIG_JFFS2_FS_XATTR=y
371CONFIG_JFFS2_COMPRESSION_OPTIONS=y
372CONFIG_JFFS2_LZO=y
373CONFIG_JFFS2_CMODE_FAVOURLZO=y
374CONFIG_SQUASHFS=y
375CONFIG_SQUASHFS_LZO=y
376CONFIG_SQUASHFS_XZ=y
377CONFIG_NFS_FS=y
378CONFIG_NFS_V3_ACL=y
379CONFIG_NFS_V4=y
380CONFIG_NFS_V4_1=y
381CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org"
382CONFIG_ROOT_NFS=y
383CONFIG_NFSD=y
384CONFIG_NFSD_V3_ACL=y
385CONFIG_NFSD_V4=y
386CONFIG_NLS_CODEPAGE_437=y
387CONFIG_NLS_CODEPAGE_850=y
388CONFIG_NLS_CODEPAGE_852=y
389CONFIG_NLS_CODEPAGE_1250=y
390CONFIG_NLS_ASCII=y
391CONFIG_NLS_ISO8859_1=y
392CONFIG_NLS_ISO8859_2=y
393CONFIG_NLS_ISO8859_15=y
394CONFIG_NLS_UTF8=y
395CONFIG_MAGIC_SYSRQ=y
396CONFIG_STRIP_ASM_SYMS=y
397CONFIG_SECURITYFS=y
398CONFIG_CRYPTO_USER=y
399CONFIG_CRYPTO_NULL=y
400CONFIG_CRYPTO_CRYPTD=y
401CONFIG_CRYPTO_CCM=y
402CONFIG_CRYPTO_GCM=y
403CONFIG_CRYPTO_CTS=y
404CONFIG_CRYPTO_LRW=y
405CONFIG_CRYPTO_PCBC=y
406CONFIG_CRYPTO_XTS=y
407CONFIG_CRYPTO_XCBC=y
408CONFIG_CRYPTO_VMAC=y
409CONFIG_CRYPTO_MD4=y
410CONFIG_CRYPTO_MICHAEL_MIC=y
411CONFIG_CRYPTO_RMD128=y
412CONFIG_CRYPTO_RMD160=y
413CONFIG_CRYPTO_RMD256=y
414CONFIG_CRYPTO_RMD320=y
415CONFIG_CRYPTO_SHA256=y
416CONFIG_CRYPTO_SHA512=y
417CONFIG_CRYPTO_TGR192=y
418CONFIG_CRYPTO_WP512=y
419CONFIG_CRYPTO_ANUBIS=y
420CONFIG_CRYPTO_BLOWFISH=y
421CONFIG_CRYPTO_CAMELLIA=y
422CONFIG_CRYPTO_CAST5=y
423CONFIG_CRYPTO_CAST6=y
424CONFIG_CRYPTO_FCRYPT=y
425CONFIG_CRYPTO_KHAZAD=y
426CONFIG_CRYPTO_SALSA20=y
427CONFIG_CRYPTO_SEED=y
428CONFIG_CRYPTO_SERPENT=y
429CONFIG_CRYPTO_TEA=y
430CONFIG_CRYPTO_TWOFISH=y
431CONFIG_CRYPTO_ZLIB=y
432CONFIG_CRYPTO_LZO=y
433CONFIG_CRYPTO_USER_API_HASH=y
434CONFIG_CRYPTO_USER_API_SKCIPHER=y
diff --git a/arch/mips/configs/db1xxx_defconfig b/arch/mips/configs/db1xxx_defconfig
new file mode 100644
index 000000000000..c99b6eeda90b
--- /dev/null
+++ b/arch/mips/configs/db1xxx_defconfig
@@ -0,0 +1,245 @@
1CONFIG_MIPS_ALCHEMY=y
2CONFIG_MIPS_DB1XXX=y
3CONFIG_CMA=y
4CONFIG_CMA_DEBUG=y
5CONFIG_HZ_100=y
6CONFIG_LOCALVERSION="-db1xxx"
7CONFIG_KERNEL_XZ=y
8CONFIG_DEFAULT_HOSTNAME="db1xxx"
9CONFIG_SYSVIPC=y
10CONFIG_POSIX_MQUEUE=y
11CONFIG_FHANDLE=y
12CONFIG_AUDIT=y
13CONFIG_NO_HZ=y
14CONFIG_HIGH_RES_TIMERS=y
15CONFIG_LOG_BUF_SHIFT=16
16CONFIG_CGROUPS=y
17CONFIG_CGROUP_FREEZER=y
18CONFIG_CGROUP_DEVICE=y
19CONFIG_CPUSETS=y
20CONFIG_CGROUP_CPUACCT=y
21CONFIG_RESOURCE_COUNTERS=y
22CONFIG_MEMCG=y
23CONFIG_MEMCG_SWAP=y
24CONFIG_MEMCG_KMEM=y
25CONFIG_CGROUP_SCHED=y
26CONFIG_CFS_BANDWIDTH=y
27CONFIG_RT_GROUP_SCHED=y
28CONFIG_BLK_CGROUP=y
29CONFIG_KALLSYMS_ALL=y
30CONFIG_EMBEDDED=y
31CONFIG_SLAB=y
32CONFIG_BLK_DEV_BSGLIB=y
33CONFIG_PARTITION_ADVANCED=y
34CONFIG_DEFAULT_NOOP=y
35CONFIG_PCI=y
36CONFIG_PCI_REALLOC_ENABLE_AUTO=y
37CONFIG_PCCARD=y
38CONFIG_PCMCIA_ALCHEMY_DEVBOARD=y
39CONFIG_PM_RUNTIME=y
40CONFIG_NET=y
41CONFIG_PACKET=y
42CONFIG_PACKET_DIAG=y
43CONFIG_UNIX=y
44CONFIG_UNIX_DIAG=y
45CONFIG_XFRM_USER=y
46CONFIG_XFRM_SUB_POLICY=y
47CONFIG_XFRM_MIGRATE=y
48CONFIG_INET=y
49CONFIG_IP_MULTICAST=y
50CONFIG_IP_ADVANCED_ROUTER=y
51CONFIG_IP_FIB_TRIE_STATS=y
52CONFIG_NET_IPIP=y
53CONFIG_NET_IPGRE_DEMUX=y
54CONFIG_NET_IPGRE=y
55CONFIG_NET_IPGRE_BROADCAST=y
56CONFIG_SYN_COOKIES=y
57CONFIG_INET_AH=y
58CONFIG_INET_ESP=y
59CONFIG_INET_IPCOMP=y
60CONFIG_INET_UDP_DIAG=y
61CONFIG_TCP_CONG_ADVANCED=y
62CONFIG_TCP_CONG_VENO=y
63CONFIG_DEFAULT_VENO=y
64CONFIG_IPV6_ROUTER_PREF=y
65CONFIG_IPV6_ROUTE_INFO=y
66CONFIG_IPV6_OPTIMISTIC_DAD=y
67CONFIG_INET6_AH=y
68CONFIG_INET6_ESP=y
69CONFIG_INET6_IPCOMP=y
70CONFIG_IPV6_MIP6=y
71CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=y
72CONFIG_IPV6_VTI=y
73CONFIG_IPV6_SIT_6RD=y
74CONFIG_IPV6_GRE=y
75CONFIG_IPV6_MULTIPLE_TABLES=y
76CONFIG_IPV6_SUBTREES=y
77CONFIG_IPV6_MROUTE=y
78CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
79CONFIG_IPV6_PIMSM_V2=y
80CONFIG_BRIDGE=y
81CONFIG_NETLINK_MMAP=y
82CONFIG_NETLINK_DIAG=y
83CONFIG_IRDA=y
84CONFIG_IRLAN=y
85CONFIG_IRCOMM=y
86CONFIG_IRDA_ULTRA=y
87CONFIG_IRDA_CACHE_LAST_LSAP=y
88CONFIG_IRDA_FAST_RR=y
89CONFIG_AU1000_FIR=y
90CONFIG_BT=y
91CONFIG_BT_RFCOMM=y
92CONFIG_BT_RFCOMM_TTY=y
93CONFIG_BT_BNEP=y
94CONFIG_BT_BNEP_MC_FILTER=y
95CONFIG_BT_BNEP_PROTO_FILTER=y
96CONFIG_BT_HIDP=y
97CONFIG_BT_HCIBTUSB=y
98CONFIG_CFG80211=y
99CONFIG_CFG80211_WEXT=y
100CONFIG_MAC80211=y
101CONFIG_DEVTMPFS=y
102CONFIG_DEVTMPFS_MOUNT=y
103CONFIG_MTD=y
104CONFIG_MTD_CMDLINE_PARTS=y
105CONFIG_MTD_BLOCK=y
106CONFIG_MTD_CFI=y
107CONFIG_MTD_CFI_ADV_OPTIONS=y
108CONFIG_MTD_CFI_AMDSTD=y
109CONFIG_MTD_PHYSMAP=y
110CONFIG_MTD_M25P80=y
111CONFIG_MTD_SST25L=y
112CONFIG_MTD_NAND=y
113CONFIG_MTD_NAND_ECC_BCH=y
114CONFIG_MTD_NAND_AU1550=y
115CONFIG_MTD_NAND_PLATFORM=y
116CONFIG_EEPROM_AT24=y
117CONFIG_EEPROM_AT25=y
118CONFIG_SCSI_TGT=y
119CONFIG_BLK_DEV_SD=y
120CONFIG_CHR_DEV_SG=y
121CONFIG_SCSI_MULTI_LUN=y
122CONFIG_ATA=y
123CONFIG_PATA_HPT37X=y
124CONFIG_PATA_HPT3X2N=y
125CONFIG_PATA_PCMCIA=y
126CONFIG_PATA_PLATFORM=y
127CONFIG_NETDEVICES=y
128CONFIG_NLMON=y
129CONFIG_PCMCIA_3C589=y
130CONFIG_MIPS_AU1X00_ENET=y
131CONFIG_SMC91X=y
132CONFIG_SMSC911X=y
133CONFIG_AMD_PHY=y
134CONFIG_SMSC_PHY=y
135CONFIG_INPUT_EVDEV=y
136CONFIG_KEYBOARD_GPIO=y
137CONFIG_INPUT_TOUCHSCREEN=y
138CONFIG_TOUCHSCREEN_ADS7846=y
139CONFIG_TOUCHSCREEN_WM97XX=y
140CONFIG_INPUT_MISC=y
141CONFIG_INPUT_UINPUT=y
142CONFIG_SERIAL_8250=y
143CONFIG_SERIAL_8250_CONSOLE=y
144CONFIG_TTY_PRINTK=y
145CONFIG_I2C=y
146CONFIG_I2C_CHARDEV=y
147CONFIG_I2C_AU1550=y
148CONFIG_SPI=y
149CONFIG_SPI_AU1550=y
150CONFIG_SPI_GPIO=y
151CONFIG_SENSORS_ADM1025=y
152CONFIG_SENSORS_LM70=y
153CONFIG_FB=y
154CONFIG_FB_AU1100=y
155CONFIG_FB_AU1200=y
156CONFIG_FRAMEBUFFER_CONSOLE=y
157CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
158CONFIG_SOUND=y
159CONFIG_SND=y
160CONFIG_SND_SEQUENCER=y
161CONFIG_SND_HRTIMER=y
162CONFIG_SND_DYNAMIC_MINORS=y
163CONFIG_SND_AC97_POWER_SAVE=y
164CONFIG_SND_AC97_POWER_SAVE_DEFAULT=1
165CONFIG_SND_SOC=y
166CONFIG_SND_SOC_AU1XPSC=y
167CONFIG_SND_SOC_AU1XAUDIO=y
168CONFIG_SND_SOC_DB1000=y
169CONFIG_SND_SOC_DB1200=y
170CONFIG_HIDRAW=y
171CONFIG_UHID=y
172CONFIG_HID_LOGITECH=y
173CONFIG_HID_LOGITECH_DJ=y
174CONFIG_USB_HIDDEV=y
175CONFIG_USB=y
176CONFIG_USB_DYNAMIC_MINORS=y
177CONFIG_USB_OTG=y
178CONFIG_USB_EHCI_HCD=y
179CONFIG_USB_EHCI_ROOT_HUB_TT=y
180CONFIG_USB_EHCI_HCD_PLATFORM=y
181CONFIG_USB_OHCI_HCD=y
182CONFIG_USB_OHCI_HCD_PLATFORM=y
183CONFIG_USB_STORAGE=y
184CONFIG_MMC=y
185CONFIG_MMC_CLKGATE=y
186CONFIG_SDIO_UART=y
187CONFIG_MMC_AU1X=y
188CONFIG_NEW_LEDS=y
189CONFIG_LEDS_CLASS=y
190CONFIG_LEDS_TRIGGERS=y
191CONFIG_RTC_CLASS=y
192CONFIG_RTC_DRV_AU1XXX=y
193CONFIG_FIRMWARE_MEMMAP=y
194CONFIG_EXT4_FS=y
195CONFIG_EXT4_FS_POSIX_ACL=y
196CONFIG_EXT4_FS_SECURITY=y
197CONFIG_XFS_FS=y
198CONFIG_XFS_POSIX_ACL=y
199CONFIG_FANOTIFY=y
200CONFIG_FUSE_FS=y
201CONFIG_CUSE=y
202CONFIG_VFAT_FS=y
203CONFIG_TMPFS=y
204CONFIG_TMPFS_POSIX_ACL=y
205CONFIG_CONFIGFS_FS=y
206CONFIG_JFFS2_FS=y
207CONFIG_JFFS2_SUMMARY=y
208CONFIG_JFFS2_COMPRESSION_OPTIONS=y
209CONFIG_JFFS2_LZO=y
210CONFIG_JFFS2_RUBIN=y
211CONFIG_SQUASHFS=y
212CONFIG_SQUASHFS_FILE_DIRECT=y
213CONFIG_SQUASHFS_XATTR=y
214CONFIG_SQUASHFS_LZO=y
215CONFIG_SQUASHFS_XZ=y
216CONFIG_F2FS_FS=y
217CONFIG_F2FS_FS_SECURITY=y
218CONFIG_NFS_FS=y
219CONFIG_NFS_V3_ACL=y
220CONFIG_NFS_V4=y
221CONFIG_NFS_V4_1=y
222CONFIG_NFS_V4_2=y
223CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="local"
224CONFIG_NFS_V4_1_MIGRATION=y
225CONFIG_NFSD=y
226CONFIG_NFSD_V3_ACL=y
227CONFIG_NFSD_V4=y
228CONFIG_NLS_CODEPAGE_437=y
229CONFIG_NLS_CODEPAGE_850=y
230CONFIG_NLS_CODEPAGE_852=y
231CONFIG_NLS_CODEPAGE_1250=y
232CONFIG_NLS_ASCII=y
233CONFIG_NLS_ISO8859_1=y
234CONFIG_NLS_ISO8859_2=y
235CONFIG_NLS_ISO8859_15=y
236CONFIG_NLS_UTF8=y
237CONFIG_MAGIC_SYSRQ=y
238CONFIG_SECURITYFS=y
239CONFIG_CRYPTO_USER=y
240CONFIG_CRYPTO_CRYPTD=y
241CONFIG_CRYPTO_USER_API_HASH=y
242CONFIG_CRYPTO_USER_API_SKCIPHER=y
243CONFIG_CRC32_SLICEBY4=y
244CONFIG_FONTS=y
245CONFIG_FONT_8x8=y
diff --git a/arch/mips/configs/loongson3_defconfig b/arch/mips/configs/loongson3_defconfig
new file mode 100644
index 000000000000..ea1761f0f917
--- /dev/null
+++ b/arch/mips/configs/loongson3_defconfig
@@ -0,0 +1,362 @@
1CONFIG_MACH_LOONGSON=y
2CONFIG_SWIOTLB=y
3CONFIG_LEMOTE_MACH3A=y
4CONFIG_CPU_LOONGSON3=y
5CONFIG_64BIT=y
6CONFIG_PAGE_SIZE_16KB=y
7CONFIG_KSM=y
8CONFIG_SMP=y
9CONFIG_NR_CPUS=4
10CONFIG_HZ_256=y
11CONFIG_PREEMPT=y
12CONFIG_KEXEC=y
13# CONFIG_LOCALVERSION_AUTO is not set
14CONFIG_KERNEL_LZMA=y
15CONFIG_SYSVIPC=y
16CONFIG_POSIX_MQUEUE=y
17CONFIG_AUDIT=y
18CONFIG_NO_HZ=y
19CONFIG_HIGH_RES_TIMERS=y
20CONFIG_BSD_PROCESS_ACCT=y
21CONFIG_BSD_PROCESS_ACCT_V3=y
22CONFIG_TASKSTATS=y
23CONFIG_TASK_DELAY_ACCT=y
24CONFIG_TASK_XACCT=y
25CONFIG_TASK_IO_ACCOUNTING=y
26CONFIG_LOG_BUF_SHIFT=14
27CONFIG_CPUSETS=y
28CONFIG_RESOURCE_COUNTERS=y
29CONFIG_MEMCG=y
30CONFIG_MEMCG_SWAP=y
31CONFIG_BLK_CGROUP=y
32CONFIG_SCHED_AUTOGROUP=y
33CONFIG_SYSFS_DEPRECATED=y
34CONFIG_RELAY=y
35CONFIG_BLK_DEV_INITRD=y
36CONFIG_RD_BZIP2=y
37CONFIG_RD_LZMA=y
38CONFIG_SYSCTL_SYSCALL=y
39CONFIG_EMBEDDED=y
40CONFIG_MODULES=y
41CONFIG_MODULE_FORCE_LOAD=y
42CONFIG_MODULE_UNLOAD=y
43CONFIG_MODULE_FORCE_UNLOAD=y
44CONFIG_MODVERSIONS=y
45CONFIG_BLK_DEV_INTEGRITY=y
46CONFIG_PARTITION_ADVANCED=y
47CONFIG_IOSCHED_DEADLINE=m
48CONFIG_CFQ_GROUP_IOSCHED=y
49CONFIG_PCI=y
50CONFIG_HT_PCI=y
51CONFIG_PCIEPORTBUS=y
52CONFIG_HOTPLUG_PCI_PCIE=y
53# CONFIG_PCIEAER is not set
54CONFIG_PCIEASPM_PERFORMANCE=y
55CONFIG_HOTPLUG_PCI=y
56CONFIG_HOTPLUG_PCI_SHPC=m
57CONFIG_BINFMT_MISC=m
58CONFIG_MIPS32_COMPAT=y
59CONFIG_MIPS32_O32=y
60CONFIG_MIPS32_N32=y
61CONFIG_PM_RUNTIME=y
62CONFIG_PACKET=y
63CONFIG_UNIX=y
64CONFIG_XFRM_USER=y
65CONFIG_NET_KEY=y
66CONFIG_INET=y
67CONFIG_IP_MULTICAST=y
68CONFIG_IP_ADVANCED_ROUTER=y
69CONFIG_IP_MULTIPLE_TABLES=y
70CONFIG_IP_ROUTE_MULTIPATH=y
71CONFIG_IP_ROUTE_VERBOSE=y
72CONFIG_NETFILTER=y
73CONFIG_NETFILTER_NETLINK_LOG=m
74CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
75CONFIG_NETFILTER_XT_TARGET_MARK=m
76CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
77CONFIG_NETFILTER_XT_MATCH_COMMENT=m
78CONFIG_NETFILTER_XT_MATCH_DCCP=m
79CONFIG_NETFILTER_XT_MATCH_ESP=m
80CONFIG_NETFILTER_XT_MATCH_LENGTH=m
81CONFIG_NETFILTER_XT_MATCH_LIMIT=m
82CONFIG_NETFILTER_XT_MATCH_MAC=m
83CONFIG_NETFILTER_XT_MATCH_MARK=m
84CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
85CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
86CONFIG_NETFILTER_XT_MATCH_QUOTA=m
87CONFIG_NETFILTER_XT_MATCH_REALM=m
88CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
89CONFIG_NETFILTER_XT_MATCH_STRING=m
90CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
91CONFIG_IP_VS=m
92CONFIG_IP_NF_IPTABLES=m
93CONFIG_IP_NF_MATCH_AH=m
94CONFIG_IP_NF_MATCH_ECN=m
95CONFIG_IP_NF_MATCH_TTL=m
96CONFIG_IP_NF_FILTER=m
97CONFIG_IP_NF_TARGET_REJECT=m
98CONFIG_IP_NF_TARGET_ULOG=m
99CONFIG_IP_NF_MANGLE=m
100CONFIG_IP_NF_TARGET_ECN=m
101CONFIG_IP_NF_TARGET_TTL=m
102CONFIG_IP_NF_RAW=m
103CONFIG_IP_NF_ARPTABLES=m
104CONFIG_IP_NF_ARPFILTER=m
105CONFIG_IP_NF_ARP_MANGLE=m
106CONFIG_IP_SCTP=m
107CONFIG_L2TP=m
108CONFIG_BRIDGE=m
109CONFIG_CFG80211=m
110CONFIG_CFG80211_WEXT=y
111CONFIG_MAC80211=m
112CONFIG_RFKILL=m
113CONFIG_RFKILL_INPUT=y
114CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
115CONFIG_DEVTMPFS=y
116CONFIG_DEVTMPFS_MOUNT=y
117CONFIG_MTD=m
118CONFIG_BLK_DEV_LOOP=y
119CONFIG_BLK_DEV_CRYPTOLOOP=y
120CONFIG_BLK_DEV_RAM=y
121CONFIG_BLK_DEV_RAM_SIZE=8192
122CONFIG_RAID_ATTRS=m
123CONFIG_SCSI_TGT=y
124CONFIG_BLK_DEV_SD=y
125CONFIG_BLK_DEV_SR=y
126CONFIG_CHR_DEV_SG=y
127CONFIG_CHR_DEV_SCH=m
128CONFIG_SCSI_MULTI_LUN=y
129CONFIG_SCSI_CONSTANTS=y
130CONFIG_SCSI_LOGGING=y
131CONFIG_SCSI_SPI_ATTRS=m
132CONFIG_SCSI_FC_ATTRS=m
133CONFIG_ISCSI_TCP=m
134CONFIG_MEGARAID_NEWGEN=y
135CONFIG_MEGARAID_MM=y
136CONFIG_MEGARAID_MAILBOX=y
137CONFIG_MEGARAID_LEGACY=y
138CONFIG_MEGARAID_SAS=y
139CONFIG_ATA=y
140CONFIG_SATA_AHCI=y
141CONFIG_PATA_ATIIXP=y
142CONFIG_MD=y
143CONFIG_BLK_DEV_MD=m
144CONFIG_MD_LINEAR=m
145CONFIG_MD_RAID0=m
146CONFIG_MD_RAID1=m
147CONFIG_MD_RAID10=m
148CONFIG_MD_RAID456=m
149CONFIG_MD_MULTIPATH=m
150CONFIG_BLK_DEV_DM=m
151CONFIG_DM_CRYPT=m
152CONFIG_DM_SNAPSHOT=m
153CONFIG_DM_MIRROR=m
154CONFIG_DM_ZERO=m
155CONFIG_TARGET_CORE=m
156CONFIG_TCM_IBLOCK=m
157CONFIG_TCM_FILEIO=m
158CONFIG_TCM_PSCSI=m
159CONFIG_LOOPBACK_TARGET=m
160CONFIG_ISCSI_TARGET=m
161CONFIG_NETDEVICES=y
162CONFIG_TUN=m
163# CONFIG_NET_VENDOR_3COM is not set
164# CONFIG_NET_VENDOR_ADAPTEC is not set
165# CONFIG_NET_VENDOR_ALTEON is not set
166# CONFIG_NET_VENDOR_AMD is not set
167# CONFIG_NET_VENDOR_ARC is not set
168# CONFIG_NET_VENDOR_ATHEROS is not set
169# CONFIG_NET_CADENCE is not set
170# CONFIG_NET_VENDOR_BROADCOM is not set
171# CONFIG_NET_VENDOR_BROCADE is not set
172# CONFIG_NET_VENDOR_CHELSIO is not set
173# CONFIG_NET_VENDOR_CIRRUS is not set
174# CONFIG_NET_VENDOR_CISCO is not set
175# CONFIG_NET_VENDOR_DEC is not set
176# CONFIG_NET_VENDOR_DLINK is not set
177# CONFIG_NET_VENDOR_EMULEX is not set
178# CONFIG_NET_VENDOR_EXAR is not set
179# CONFIG_NET_VENDOR_HP is not set
180CONFIG_E1000=y
181CONFIG_E1000E=y
182CONFIG_IGB=y
183CONFIG_IXGB=y
184CONFIG_IXGBE=y
185# CONFIG_NET_VENDOR_I825XX is not set
186# CONFIG_NET_VENDOR_MARVELL is not set
187# CONFIG_NET_VENDOR_MELLANOX is not set
188# CONFIG_NET_VENDOR_MICREL is not set
189# CONFIG_NET_VENDOR_MYRI is not set
190# CONFIG_NET_VENDOR_NATSEMI is not set
191# CONFIG_NET_VENDOR_NVIDIA is not set
192# CONFIG_NET_VENDOR_OKI is not set
193# CONFIG_NET_PACKET_ENGINE is not set
194# CONFIG_NET_VENDOR_QLOGIC is not set
195CONFIG_8139CP=m
196CONFIG_8139TOO=m
197CONFIG_R8169=y
198# CONFIG_NET_VENDOR_RDC is not set
199# CONFIG_NET_VENDOR_SEEQ is not set
200# CONFIG_NET_VENDOR_SILAN is not set
201# CONFIG_NET_VENDOR_SIS is not set
202# CONFIG_NET_VENDOR_SMSC is not set
203# CONFIG_NET_VENDOR_STMICRO is not set
204# CONFIG_NET_VENDOR_SUN is not set
205# CONFIG_NET_VENDOR_TEHUTI is not set
206# CONFIG_NET_VENDOR_TI is not set
207# CONFIG_NET_VENDOR_TOSHIBA is not set
208# CONFIG_NET_VENDOR_VIA is not set
209# CONFIG_NET_VENDOR_WIZNET is not set
210CONFIG_PPP=m
211CONFIG_PPP_BSDCOMP=m
212CONFIG_PPP_DEFLATE=m
213CONFIG_PPP_FILTER=y
214CONFIG_PPP_MPPE=m
215CONFIG_PPP_MULTILINK=y
216CONFIG_PPPOE=m
217CONFIG_PPPOL2TP=m
218CONFIG_PPP_ASYNC=m
219CONFIG_PPP_SYNC_TTY=m
220CONFIG_ATH_CARDS=m
221CONFIG_ATH9K=m
222CONFIG_HOSTAP=m
223CONFIG_INPUT_POLLDEV=m
224CONFIG_INPUT_SPARSEKMAP=y
225CONFIG_INPUT_EVDEV=y
226CONFIG_KEYBOARD_XTKBD=m
227CONFIG_MOUSE_PS2_SENTELIC=y
228CONFIG_MOUSE_SERIAL=m
229CONFIG_INPUT_MISC=y
230CONFIG_INPUT_UINPUT=m
231CONFIG_SERIO_SERPORT=m
232CONFIG_SERIO_RAW=m
233CONFIG_LEGACY_PTY_COUNT=16
234CONFIG_SERIAL_NONSTANDARD=y
235CONFIG_SERIAL_8250=y
236CONFIG_SERIAL_8250_CONSOLE=y
237CONFIG_SERIAL_8250_NR_UARTS=16
238CONFIG_SERIAL_8250_EXTENDED=y
239CONFIG_SERIAL_8250_MANY_PORTS=y
240CONFIG_SERIAL_8250_SHARE_IRQ=y
241CONFIG_SERIAL_8250_RSA=y
242CONFIG_HW_RANDOM=y
243CONFIG_RAW_DRIVER=m
244CONFIG_I2C_CHARDEV=y
245CONFIG_I2C_PIIX4=y
246CONFIG_SENSORS_LM75=m
247CONFIG_SENSORS_LM93=m
248CONFIG_SENSORS_W83627HF=m
249CONFIG_MEDIA_SUPPORT=m
250CONFIG_MEDIA_CAMERA_SUPPORT=y
251CONFIG_MEDIA_USB_SUPPORT=y
252CONFIG_USB_VIDEO_CLASS=m
253CONFIG_DRM=y
254CONFIG_DRM_RADEON=y
255CONFIG_VIDEO_OUTPUT_CONTROL=y
256CONFIG_FB_RADEON=y
257CONFIG_LCD_CLASS_DEVICE=y
258CONFIG_LCD_PLATFORM=m
259CONFIG_BACKLIGHT_GENERIC=m
260# CONFIG_VGA_CONSOLE is not set
261CONFIG_FRAMEBUFFER_CONSOLE=y
262CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
263CONFIG_LOGO=y
264CONFIG_SOUND=y
265CONFIG_SND=m
266CONFIG_SND_SEQUENCER=m
267CONFIG_SND_SEQ_DUMMY=m
268# CONFIG_SND_ISA is not set
269CONFIG_SND_HDA_INTEL=m
270CONFIG_SND_HDA_PATCH_LOADER=y
271CONFIG_SND_HDA_CODEC_REALTEK=m
272CONFIG_SND_HDA_CODEC_CONEXANT=m
273# CONFIG_SND_USB is not set
274CONFIG_HID_A4TECH=m
275CONFIG_HID_SUNPLUS=m
276CONFIG_USB=y
277CONFIG_USB_MON=y
278CONFIG_USB_XHCI_HCD=m
279CONFIG_USB_EHCI_HCD=y
280CONFIG_USB_EHCI_ROOT_HUB_TT=y
281CONFIG_USB_OHCI_HCD=y
282CONFIG_USB_UHCI_HCD=m
283CONFIG_USB_STORAGE=m
284CONFIG_USB_SERIAL=m
285CONFIG_USB_SERIAL_OPTION=m
286CONFIG_RTC_CLASS=y
287CONFIG_RTC_DRV_CMOS=y
288CONFIG_DMADEVICES=y
289CONFIG_PM_DEVFREQ=y
290CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y
291CONFIG_DEVFREQ_GOV_PERFORMANCE=y
292CONFIG_DEVFREQ_GOV_POWERSAVE=y
293CONFIG_DEVFREQ_GOV_USERSPACE=y
294CONFIG_EXT2_FS=y
295CONFIG_EXT2_FS_XATTR=y
296CONFIG_EXT2_FS_POSIX_ACL=y
297CONFIG_EXT2_FS_SECURITY=y
298CONFIG_EXT3_FS=y
299CONFIG_EXT3_FS_POSIX_ACL=y
300CONFIG_EXT3_FS_SECURITY=y
301CONFIG_EXT4_FS=y
302CONFIG_EXT4_FS_POSIX_ACL=y
303CONFIG_EXT4_FS_SECURITY=y
304CONFIG_QUOTA=y
305# CONFIG_PRINT_QUOTA_WARNING is not set
306CONFIG_AUTOFS4_FS=y
307CONFIG_FUSE_FS=m
308CONFIG_ISO9660_FS=m
309CONFIG_JOLIET=y
310CONFIG_MSDOS_FS=m
311CONFIG_VFAT_FS=m
312CONFIG_FAT_DEFAULT_CODEPAGE=936
313CONFIG_FAT_DEFAULT_IOCHARSET="gb2312"
314CONFIG_PROC_KCORE=y
315CONFIG_TMPFS=y
316CONFIG_TMPFS_POSIX_ACL=y
317CONFIG_CONFIGFS_FS=y
318CONFIG_CRAMFS=m
319CONFIG_SQUASHFS=y
320CONFIG_SQUASHFS_XATTR=y
321CONFIG_NFS_FS=m
322CONFIG_NFS_V3_ACL=y
323CONFIG_NFS_V4=m
324CONFIG_NFSD=m
325CONFIG_NFSD_V3_ACL=y
326CONFIG_NFSD_V4=y
327CONFIG_CIFS=m
328CONFIG_NLS_CODEPAGE_437=y
329CONFIG_NLS_CODEPAGE_936=y
330CONFIG_NLS_ASCII=y
331CONFIG_NLS_UTF8=y
332CONFIG_PRINTK_TIME=y
333CONFIG_FRAME_WARN=1024
334CONFIG_STRIP_ASM_SYMS=y
335CONFIG_MAGIC_SYSRQ=y
336# CONFIG_SCHED_DEBUG is not set
337# CONFIG_DEBUG_PREEMPT is not set
338# CONFIG_RCU_CPU_STALL_VERBOSE is not set
339# CONFIG_FTRACE is not set
340CONFIG_SECURITY=y
341CONFIG_SECURITYFS=y
342CONFIG_SECURITY_NETWORK=y
343CONFIG_SECURITY_PATH=y
344CONFIG_SECURITY_SELINUX=y
345CONFIG_SECURITY_SELINUX_BOOTPARAM=y
346CONFIG_SECURITY_SELINUX_DISABLE=y
347CONFIG_DEFAULT_SECURITY_DAC=y
348CONFIG_CRYPTO_AUTHENC=m
349CONFIG_CRYPTO_HMAC=y
350CONFIG_CRYPTO_MD5=y
351CONFIG_CRYPTO_SHA512=m
352CONFIG_CRYPTO_TGR192=m
353CONFIG_CRYPTO_WP512=m
354CONFIG_CRYPTO_ANUBIS=m
355CONFIG_CRYPTO_BLOWFISH=m
356CONFIG_CRYPTO_CAST5=m
357CONFIG_CRYPTO_CAST6=m
358CONFIG_CRYPTO_KHAZAD=m
359CONFIG_CRYPTO_SERPENT=m
360CONFIG_CRYPTO_TEA=m
361CONFIG_CRYPTO_TWOFISH=m
362CONFIG_CRYPTO_DEFLATE=m
diff --git a/arch/mips/configs/malta_defconfig b/arch/mips/configs/malta_defconfig
index ce1d3eeeb737..b745b6a9f322 100644
--- a/arch/mips/configs/malta_defconfig
+++ b/arch/mips/configs/malta_defconfig
@@ -1,7 +1,9 @@
1CONFIG_MIPS_MALTA=y 1CONFIG_MIPS_MALTA=y
2CONFIG_CPU_LITTLE_ENDIAN=y 2CONFIG_CPU_LITTLE_ENDIAN=y
3CONFIG_CPU_MIPS32_R2=y 3CONFIG_CPU_MIPS32_R2=y
4CONFIG_PAGE_SIZE_16KB=y
4CONFIG_MIPS_MT_SMP=y 5CONFIG_MIPS_MT_SMP=y
6CONFIG_NR_CPUS=8
5CONFIG_HZ_100=y 7CONFIG_HZ_100=y
6CONFIG_SYSVIPC=y 8CONFIG_SYSVIPC=y
7CONFIG_NO_HZ=y 9CONFIG_NO_HZ=y
@@ -42,7 +44,6 @@ CONFIG_INET_IPCOMP=m
42CONFIG_INET_XFRM_MODE_TRANSPORT=m 44CONFIG_INET_XFRM_MODE_TRANSPORT=m
43CONFIG_INET_XFRM_MODE_TUNNEL=m 45CONFIG_INET_XFRM_MODE_TUNNEL=m
44CONFIG_TCP_MD5SIG=y 46CONFIG_TCP_MD5SIG=y
45CONFIG_IPV6_PRIVACY=y
46CONFIG_IPV6_ROUTER_PREF=y 47CONFIG_IPV6_ROUTER_PREF=y
47CONFIG_IPV6_ROUTE_INFO=y 48CONFIG_IPV6_ROUTE_INFO=y
48CONFIG_IPV6_OPTIMISTIC_DAD=y 49CONFIG_IPV6_OPTIMISTIC_DAD=y
@@ -68,7 +69,6 @@ CONFIG_NF_CONNTRACK_SANE=m
68CONFIG_NF_CONNTRACK_SIP=m 69CONFIG_NF_CONNTRACK_SIP=m
69CONFIG_NF_CONNTRACK_TFTP=m 70CONFIG_NF_CONNTRACK_TFTP=m
70CONFIG_NF_CT_NETLINK=m 71CONFIG_NF_CT_NETLINK=m
71CONFIG_NETFILTER_TPROXY=m
72CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m 72CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
73CONFIG_NETFILTER_XT_TARGET_CONNMARK=m 73CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
74CONFIG_NETFILTER_XT_TARGET_MARK=m 74CONFIG_NETFILTER_XT_TARGET_MARK=m
@@ -125,7 +125,6 @@ CONFIG_IP_VS_SH=m
125CONFIG_IP_VS_SED=m 125CONFIG_IP_VS_SED=m
126CONFIG_IP_VS_NQ=m 126CONFIG_IP_VS_NQ=m
127CONFIG_NF_CONNTRACK_IPV4=m 127CONFIG_NF_CONNTRACK_IPV4=m
128CONFIG_IP_NF_QUEUE=m
129CONFIG_IP_NF_IPTABLES=m 128CONFIG_IP_NF_IPTABLES=m
130CONFIG_IP_NF_MATCH_AH=m 129CONFIG_IP_NF_MATCH_AH=m
131CONFIG_IP_NF_MATCH_ECN=m 130CONFIG_IP_NF_MATCH_ECN=m
@@ -185,7 +184,6 @@ CONFIG_ATALK=m
185CONFIG_DEV_APPLETALK=m 184CONFIG_DEV_APPLETALK=m
186CONFIG_IPDDP=m 185CONFIG_IPDDP=m
187CONFIG_IPDDP_ENCAP=y 186CONFIG_IPDDP_ENCAP=y
188CONFIG_IPDDP_DECAP=y
189CONFIG_PHONET=m 187CONFIG_PHONET=m
190CONFIG_NET_SCHED=y 188CONFIG_NET_SCHED=y
191CONFIG_NET_SCH_CBQ=m 189CONFIG_NET_SCH_CBQ=m
@@ -226,9 +224,9 @@ CONFIG_MAC80211_RC_DEFAULT_PID=y
226CONFIG_MAC80211_MESH=y 224CONFIG_MAC80211_MESH=y
227CONFIG_RFKILL=m 225CONFIG_RFKILL=m
228CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 226CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
227CONFIG_DEVTMPFS=y
229CONFIG_CONNECTOR=m 228CONFIG_CONNECTOR=m
230CONFIG_MTD=y 229CONFIG_MTD=y
231CONFIG_MTD_CHAR=y
232CONFIG_MTD_BLOCK=y 230CONFIG_MTD_BLOCK=y
233CONFIG_MTD_OOPS=m 231CONFIG_MTD_OOPS=m
234CONFIG_MTD_CFI=y 232CONFIG_MTD_CFI=y
@@ -328,7 +326,6 @@ CONFIG_LIBERTAS=m
328# CONFIG_INPUT_KEYBOARD is not set 326# CONFIG_INPUT_KEYBOARD is not set
329# CONFIG_INPUT_MOUSE is not set 327# CONFIG_INPUT_MOUSE is not set
330# CONFIG_SERIO_I8042 is not set 328# CONFIG_SERIO_I8042 is not set
331CONFIG_VT_HW_CONSOLE_BINDING=y
332CONFIG_SERIAL_8250=y 329CONFIG_SERIAL_8250=y
333CONFIG_SERIAL_8250_CONSOLE=y 330CONFIG_SERIAL_8250_CONSOLE=y
334# CONFIG_HWMON is not set 331# CONFIG_HWMON is not set
diff --git a/arch/mips/configs/malta_kvm_defconfig b/arch/mips/configs/malta_kvm_defconfig
index 341bb47204d6..4f7d952d8517 100644
--- a/arch/mips/configs/malta_kvm_defconfig
+++ b/arch/mips/configs/malta_kvm_defconfig
@@ -3,6 +3,7 @@ CONFIG_CPU_LITTLE_ENDIAN=y
3CONFIG_CPU_MIPS32_R2=y 3CONFIG_CPU_MIPS32_R2=y
4CONFIG_PAGE_SIZE_16KB=y 4CONFIG_PAGE_SIZE_16KB=y
5CONFIG_MIPS_MT_SMP=y 5CONFIG_MIPS_MT_SMP=y
6CONFIG_NR_CPUS=8
6CONFIG_HZ_100=y 7CONFIG_HZ_100=y
7CONFIG_SYSVIPC=y 8CONFIG_SYSVIPC=y
8CONFIG_NO_HZ=y 9CONFIG_NO_HZ=y
@@ -44,7 +45,6 @@ CONFIG_INET_IPCOMP=m
44CONFIG_INET_XFRM_MODE_TRANSPORT=m 45CONFIG_INET_XFRM_MODE_TRANSPORT=m
45CONFIG_INET_XFRM_MODE_TUNNEL=m 46CONFIG_INET_XFRM_MODE_TUNNEL=m
46CONFIG_TCP_MD5SIG=y 47CONFIG_TCP_MD5SIG=y
47CONFIG_IPV6_PRIVACY=y
48CONFIG_IPV6_ROUTER_PREF=y 48CONFIG_IPV6_ROUTER_PREF=y
49CONFIG_IPV6_ROUTE_INFO=y 49CONFIG_IPV6_ROUTE_INFO=y
50CONFIG_IPV6_OPTIMISTIC_DAD=y 50CONFIG_IPV6_OPTIMISTIC_DAD=y
@@ -70,7 +70,6 @@ CONFIG_NF_CONNTRACK_SANE=m
70CONFIG_NF_CONNTRACK_SIP=m 70CONFIG_NF_CONNTRACK_SIP=m
71CONFIG_NF_CONNTRACK_TFTP=m 71CONFIG_NF_CONNTRACK_TFTP=m
72CONFIG_NF_CT_NETLINK=m 72CONFIG_NF_CT_NETLINK=m
73CONFIG_NETFILTER_TPROXY=m
74CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m 73CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
75CONFIG_NETFILTER_XT_TARGET_CONNMARK=m 74CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
76CONFIG_NETFILTER_XT_TARGET_MARK=m 75CONFIG_NETFILTER_XT_TARGET_MARK=m
@@ -127,7 +126,6 @@ CONFIG_IP_VS_SH=m
127CONFIG_IP_VS_SED=m 126CONFIG_IP_VS_SED=m
128CONFIG_IP_VS_NQ=m 127CONFIG_IP_VS_NQ=m
129CONFIG_NF_CONNTRACK_IPV4=m 128CONFIG_NF_CONNTRACK_IPV4=m
130CONFIG_IP_NF_QUEUE=m
131CONFIG_IP_NF_IPTABLES=m 129CONFIG_IP_NF_IPTABLES=m
132CONFIG_IP_NF_MATCH_AH=m 130CONFIG_IP_NF_MATCH_AH=m
133CONFIG_IP_NF_MATCH_ECN=m 131CONFIG_IP_NF_MATCH_ECN=m
@@ -187,7 +185,6 @@ CONFIG_ATALK=m
187CONFIG_DEV_APPLETALK=m 185CONFIG_DEV_APPLETALK=m
188CONFIG_IPDDP=m 186CONFIG_IPDDP=m
189CONFIG_IPDDP_ENCAP=y 187CONFIG_IPDDP_ENCAP=y
190CONFIG_IPDDP_DECAP=y
191CONFIG_PHONET=m 188CONFIG_PHONET=m
192CONFIG_NET_SCHED=y 189CONFIG_NET_SCHED=y
193CONFIG_NET_SCH_CBQ=m 190CONFIG_NET_SCH_CBQ=m
@@ -228,9 +225,9 @@ CONFIG_MAC80211_RC_DEFAULT_PID=y
228CONFIG_MAC80211_MESH=y 225CONFIG_MAC80211_MESH=y
229CONFIG_RFKILL=m 226CONFIG_RFKILL=m
230CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 227CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
228CONFIG_DEVTMPFS=y
231CONFIG_CONNECTOR=m 229CONFIG_CONNECTOR=m
232CONFIG_MTD=y 230CONFIG_MTD=y
233CONFIG_MTD_CHAR=y
234CONFIG_MTD_BLOCK=y 231CONFIG_MTD_BLOCK=y
235CONFIG_MTD_OOPS=m 232CONFIG_MTD_OOPS=m
236CONFIG_MTD_CFI=y 233CONFIG_MTD_CFI=y
@@ -300,6 +297,7 @@ CONFIG_IFB=m
300CONFIG_MACVLAN=m 297CONFIG_MACVLAN=m
301CONFIG_TUN=m 298CONFIG_TUN=m
302CONFIG_VETH=m 299CONFIG_VETH=m
300CONFIG_VHOST_NET=m
303CONFIG_PCNET32=y 301CONFIG_PCNET32=y
304CONFIG_CHELSIO_T3=m 302CONFIG_CHELSIO_T3=m
305CONFIG_AX88796=m 303CONFIG_AX88796=m
@@ -329,7 +327,6 @@ CONFIG_LIBERTAS=m
329# CONFIG_INPUT_KEYBOARD is not set 327# CONFIG_INPUT_KEYBOARD is not set
330# CONFIG_INPUT_MOUSE is not set 328# CONFIG_INPUT_MOUSE is not set
331# CONFIG_SERIO_I8042 is not set 329# CONFIG_SERIO_I8042 is not set
332CONFIG_VT_HW_CONSOLE_BINDING=y
333CONFIG_SERIAL_8250=y 330CONFIG_SERIAL_8250=y
334CONFIG_SERIAL_8250_CONSOLE=y 331CONFIG_SERIAL_8250_CONSOLE=y
335# CONFIG_HWMON is not set 332# CONFIG_HWMON is not set
@@ -453,4 +450,3 @@ CONFIG_VIRTUALIZATION=y
453CONFIG_KVM=m 450CONFIG_KVM=m
454CONFIG_KVM_MIPS_DYN_TRANS=y 451CONFIG_KVM_MIPS_DYN_TRANS=y
455CONFIG_KVM_MIPS_DEBUG_COP0_COUNTERS=y 452CONFIG_KVM_MIPS_DEBUG_COP0_COUNTERS=y
456CONFIG_VHOST_NET=m
diff --git a/arch/mips/configs/malta_kvm_guest_defconfig b/arch/mips/configs/malta_kvm_guest_defconfig
index 2b8558b71080..e36681c24ddc 100644
--- a/arch/mips/configs/malta_kvm_guest_defconfig
+++ b/arch/mips/configs/malta_kvm_guest_defconfig
@@ -44,7 +44,6 @@ CONFIG_INET_IPCOMP=m
44CONFIG_INET_XFRM_MODE_TRANSPORT=m 44CONFIG_INET_XFRM_MODE_TRANSPORT=m
45CONFIG_INET_XFRM_MODE_TUNNEL=m 45CONFIG_INET_XFRM_MODE_TUNNEL=m
46CONFIG_TCP_MD5SIG=y 46CONFIG_TCP_MD5SIG=y
47CONFIG_IPV6_PRIVACY=y
48CONFIG_IPV6_ROUTER_PREF=y 47CONFIG_IPV6_ROUTER_PREF=y
49CONFIG_IPV6_ROUTE_INFO=y 48CONFIG_IPV6_ROUTE_INFO=y
50CONFIG_IPV6_OPTIMISTIC_DAD=y 49CONFIG_IPV6_OPTIMISTIC_DAD=y
@@ -70,7 +69,6 @@ CONFIG_NF_CONNTRACK_SANE=m
70CONFIG_NF_CONNTRACK_SIP=m 69CONFIG_NF_CONNTRACK_SIP=m
71CONFIG_NF_CONNTRACK_TFTP=m 70CONFIG_NF_CONNTRACK_TFTP=m
72CONFIG_NF_CT_NETLINK=m 71CONFIG_NF_CT_NETLINK=m
73CONFIG_NETFILTER_TPROXY=m
74CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m 72CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
75CONFIG_NETFILTER_XT_TARGET_CONNMARK=m 73CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
76CONFIG_NETFILTER_XT_TARGET_MARK=m 74CONFIG_NETFILTER_XT_TARGET_MARK=m
@@ -127,7 +125,6 @@ CONFIG_IP_VS_SH=m
127CONFIG_IP_VS_SED=m 125CONFIG_IP_VS_SED=m
128CONFIG_IP_VS_NQ=m 126CONFIG_IP_VS_NQ=m
129CONFIG_NF_CONNTRACK_IPV4=m 127CONFIG_NF_CONNTRACK_IPV4=m
130CONFIG_IP_NF_QUEUE=m
131CONFIG_IP_NF_IPTABLES=m 128CONFIG_IP_NF_IPTABLES=m
132CONFIG_IP_NF_MATCH_AH=m 129CONFIG_IP_NF_MATCH_AH=m
133CONFIG_IP_NF_MATCH_ECN=m 130CONFIG_IP_NF_MATCH_ECN=m
@@ -187,7 +184,6 @@ CONFIG_ATALK=m
187CONFIG_DEV_APPLETALK=m 184CONFIG_DEV_APPLETALK=m
188CONFIG_IPDDP=m 185CONFIG_IPDDP=m
189CONFIG_IPDDP_ENCAP=y 186CONFIG_IPDDP_ENCAP=y
190CONFIG_IPDDP_DECAP=y
191CONFIG_PHONET=m 187CONFIG_PHONET=m
192CONFIG_NET_SCHED=y 188CONFIG_NET_SCHED=y
193CONFIG_NET_SCH_CBQ=m 189CONFIG_NET_SCH_CBQ=m
@@ -228,9 +224,9 @@ CONFIG_MAC80211_RC_DEFAULT_PID=y
228CONFIG_MAC80211_MESH=y 224CONFIG_MAC80211_MESH=y
229CONFIG_RFKILL=m 225CONFIG_RFKILL=m
230CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 226CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
227CONFIG_DEVTMPFS=y
231CONFIG_CONNECTOR=m 228CONFIG_CONNECTOR=m
232CONFIG_MTD=y 229CONFIG_MTD=y
233CONFIG_MTD_CHAR=y
234CONFIG_MTD_BLOCK=y 230CONFIG_MTD_BLOCK=y
235CONFIG_MTD_OOPS=m 231CONFIG_MTD_OOPS=m
236CONFIG_MTD_CFI=y 232CONFIG_MTD_CFI=y
@@ -331,7 +327,6 @@ CONFIG_LIBERTAS=m
331# CONFIG_INPUT_KEYBOARD is not set 327# CONFIG_INPUT_KEYBOARD is not set
332# CONFIG_INPUT_MOUSE is not set 328# CONFIG_INPUT_MOUSE is not set
333# CONFIG_SERIO_I8042 is not set 329# CONFIG_SERIO_I8042 is not set
334CONFIG_VT_HW_CONSOLE_BINDING=y
335CONFIG_SERIAL_8250=y 330CONFIG_SERIAL_8250=y
336CONFIG_SERIAL_8250_CONSOLE=y 331CONFIG_SERIAL_8250_CONSOLE=y
337# CONFIG_HWMON is not set 332# CONFIG_HWMON is not set
diff --git a/arch/mips/configs/maltaaprp_defconfig b/arch/mips/configs/maltaaprp_defconfig
index 93057a760dfa..fb042ce86b4b 100644
--- a/arch/mips/configs/maltaaprp_defconfig
+++ b/arch/mips/configs/maltaaprp_defconfig
@@ -44,7 +44,6 @@ CONFIG_INET_AH=m
44CONFIG_INET_ESP=m 44CONFIG_INET_ESP=m
45CONFIG_INET_IPCOMP=m 45CONFIG_INET_IPCOMP=m
46# CONFIG_INET_LRO is not set 46# CONFIG_INET_LRO is not set
47CONFIG_IPV6_PRIVACY=y
48CONFIG_INET6_AH=m 47CONFIG_INET6_AH=m
49CONFIG_INET6_ESP=m 48CONFIG_INET6_ESP=m
50CONFIG_INET6_IPCOMP=m 49CONFIG_INET6_IPCOMP=m
@@ -55,7 +54,6 @@ CONFIG_ATALK=m
55CONFIG_DEV_APPLETALK=m 54CONFIG_DEV_APPLETALK=m
56CONFIG_IPDDP=m 55CONFIG_IPDDP=m
57CONFIG_IPDDP_ENCAP=y 56CONFIG_IPDDP_ENCAP=y
58CONFIG_IPDDP_DECAP=y
59CONFIG_NET_SCHED=y 57CONFIG_NET_SCHED=y
60CONFIG_NET_SCH_CBQ=m 58CONFIG_NET_SCH_CBQ=m
61CONFIG_NET_SCH_HTB=m 59CONFIG_NET_SCH_HTB=m
@@ -80,6 +78,7 @@ CONFIG_NET_CLS_ACT=y
80CONFIG_NET_ACT_POLICE=y 78CONFIG_NET_ACT_POLICE=y
81CONFIG_NET_CLS_IND=y 79CONFIG_NET_CLS_IND=y
82# CONFIG_WIRELESS is not set 80# CONFIG_WIRELESS is not set
81CONFIG_DEVTMPFS=y
83CONFIG_BLK_DEV_LOOP=y 82CONFIG_BLK_DEV_LOOP=y
84CONFIG_BLK_DEV_CRYPTOLOOP=m 83CONFIG_BLK_DEV_CRYPTOLOOP=m
85CONFIG_IDE=y 84CONFIG_IDE=y
diff --git a/arch/mips/configs/maltasmtc_defconfig b/arch/mips/configs/maltasmtc_defconfig
index 4e54b75d89be..eb316447588c 100644
--- a/arch/mips/configs/maltasmtc_defconfig
+++ b/arch/mips/configs/maltasmtc_defconfig
@@ -1,6 +1,7 @@
1CONFIG_MIPS_MALTA=y 1CONFIG_MIPS_MALTA=y
2CONFIG_CPU_LITTLE_ENDIAN=y 2CONFIG_CPU_LITTLE_ENDIAN=y
3CONFIG_CPU_MIPS32_R2=y 3CONFIG_CPU_MIPS32_R2=y
4CONFIG_PAGE_SIZE_16KB=y
4CONFIG_MIPS_MT_SMTC=y 5CONFIG_MIPS_MT_SMTC=y
5# CONFIG_MIPS_MT_FPAFF is not set 6# CONFIG_MIPS_MT_FPAFF is not set
6CONFIG_NR_CPUS=9 7CONFIG_NR_CPUS=9
@@ -45,7 +46,6 @@ CONFIG_INET_AH=m
45CONFIG_INET_ESP=m 46CONFIG_INET_ESP=m
46CONFIG_INET_IPCOMP=m 47CONFIG_INET_IPCOMP=m
47# CONFIG_INET_LRO is not set 48# CONFIG_INET_LRO is not set
48CONFIG_IPV6_PRIVACY=y
49CONFIG_INET6_AH=m 49CONFIG_INET6_AH=m
50CONFIG_INET6_ESP=m 50CONFIG_INET6_ESP=m
51CONFIG_INET6_IPCOMP=m 51CONFIG_INET6_IPCOMP=m
@@ -56,7 +56,6 @@ CONFIG_ATALK=m
56CONFIG_DEV_APPLETALK=m 56CONFIG_DEV_APPLETALK=m
57CONFIG_IPDDP=m 57CONFIG_IPDDP=m
58CONFIG_IPDDP_ENCAP=y 58CONFIG_IPDDP_ENCAP=y
59CONFIG_IPDDP_DECAP=y
60CONFIG_NET_SCHED=y 59CONFIG_NET_SCHED=y
61CONFIG_NET_SCH_CBQ=m 60CONFIG_NET_SCH_CBQ=m
62CONFIG_NET_SCH_HTB=m 61CONFIG_NET_SCH_HTB=m
@@ -81,6 +80,7 @@ CONFIG_NET_CLS_ACT=y
81CONFIG_NET_ACT_POLICE=y 80CONFIG_NET_ACT_POLICE=y
82CONFIG_NET_CLS_IND=y 81CONFIG_NET_CLS_IND=y
83# CONFIG_WIRELESS is not set 82# CONFIG_WIRELESS is not set
83CONFIG_DEVTMPFS=y
84CONFIG_BLK_DEV_LOOP=y 84CONFIG_BLK_DEV_LOOP=y
85CONFIG_BLK_DEV_CRYPTOLOOP=m 85CONFIG_BLK_DEV_CRYPTOLOOP=m
86CONFIG_IDE=y 86CONFIG_IDE=y
diff --git a/arch/mips/configs/maltasmvp_defconfig b/arch/mips/configs/maltasmvp_defconfig
index d75931850392..10ef3bed5f43 100644
--- a/arch/mips/configs/maltasmvp_defconfig
+++ b/arch/mips/configs/maltasmvp_defconfig
@@ -1,10 +1,11 @@
1CONFIG_MIPS_MALTA=y 1CONFIG_MIPS_MALTA=y
2CONFIG_CPU_LITTLE_ENDIAN=y 2CONFIG_CPU_LITTLE_ENDIAN=y
3CONFIG_CPU_MIPS32_R2=y 3CONFIG_CPU_MIPS32_R2=y
4CONFIG_PAGE_SIZE_16KB=y
4CONFIG_MIPS_MT_SMP=y 5CONFIG_MIPS_MT_SMP=y
5CONFIG_SCHED_SMT=y 6CONFIG_SCHED_SMT=y
6CONFIG_MIPS_CMP=y 7CONFIG_MIPS_CMP=y
7CONFIG_NR_CPUS=2 8CONFIG_NR_CPUS=8
8CONFIG_HZ_100=y 9CONFIG_HZ_100=y
9CONFIG_LOCALVERSION="cmp" 10CONFIG_LOCALVERSION="cmp"
10CONFIG_SYSVIPC=y 11CONFIG_SYSVIPC=y
@@ -47,7 +48,6 @@ CONFIG_INET_AH=m
47CONFIG_INET_ESP=m 48CONFIG_INET_ESP=m
48CONFIG_INET_IPCOMP=m 49CONFIG_INET_IPCOMP=m
49# CONFIG_INET_LRO is not set 50# CONFIG_INET_LRO is not set
50CONFIG_IPV6_PRIVACY=y
51CONFIG_INET6_AH=m 51CONFIG_INET6_AH=m
52CONFIG_INET6_ESP=m 52CONFIG_INET6_ESP=m
53CONFIG_INET6_IPCOMP=m 53CONFIG_INET6_IPCOMP=m
@@ -82,6 +82,7 @@ CONFIG_NET_CLS_ACT=y
82CONFIG_NET_ACT_POLICE=y 82CONFIG_NET_ACT_POLICE=y
83CONFIG_NET_CLS_IND=y 83CONFIG_NET_CLS_IND=y
84# CONFIG_WIRELESS is not set 84# CONFIG_WIRELESS is not set
85CONFIG_DEVTMPFS=y
85CONFIG_BLK_DEV_LOOP=y 86CONFIG_BLK_DEV_LOOP=y
86CONFIG_BLK_DEV_CRYPTOLOOP=m 87CONFIG_BLK_DEV_CRYPTOLOOP=m
87CONFIG_IDE=y 88CONFIG_IDE=y
diff --git a/arch/mips/configs/maltasmvp_eva_defconfig b/arch/mips/configs/maltasmvp_eva_defconfig
new file mode 100644
index 000000000000..2d3002cba102
--- /dev/null
+++ b/arch/mips/configs/maltasmvp_eva_defconfig
@@ -0,0 +1,200 @@
1CONFIG_MIPS_MALTA=y
2CONFIG_CPU_LITTLE_ENDIAN=y
3CONFIG_CPU_MIPS32_R2=y
4CONFIG_CPU_MIPS32_3_5_FEATURES=y
5CONFIG_PAGE_SIZE_16KB=y
6CONFIG_MIPS_MT_SMP=y
7CONFIG_SCHED_SMT=y
8CONFIG_MIPS_CMP=y
9CONFIG_NR_CPUS=8
10CONFIG_HZ_100=y
11CONFIG_LOCALVERSION="cmp"
12CONFIG_SYSVIPC=y
13CONFIG_POSIX_MQUEUE=y
14CONFIG_AUDIT=y
15CONFIG_NO_HZ=y
16CONFIG_IKCONFIG=y
17CONFIG_IKCONFIG_PROC=y
18CONFIG_LOG_BUF_SHIFT=15
19CONFIG_SYSCTL_SYSCALL=y
20CONFIG_EMBEDDED=y
21CONFIG_SLAB=y
22CONFIG_MODULES=y
23CONFIG_MODULE_UNLOAD=y
24CONFIG_MODVERSIONS=y
25CONFIG_MODULE_SRCVERSION_ALL=y
26# CONFIG_BLK_DEV_BSG is not set
27CONFIG_PCI=y
28# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
29CONFIG_NET=y
30CONFIG_PACKET=y
31CONFIG_UNIX=y
32CONFIG_XFRM_USER=m
33CONFIG_NET_KEY=y
34CONFIG_INET=y
35CONFIG_IP_MULTICAST=y
36CONFIG_IP_ADVANCED_ROUTER=y
37CONFIG_IP_MULTIPLE_TABLES=y
38CONFIG_IP_ROUTE_MULTIPATH=y
39CONFIG_IP_ROUTE_VERBOSE=y
40CONFIG_IP_PNP=y
41CONFIG_IP_PNP_DHCP=y
42CONFIG_IP_PNP_BOOTP=y
43CONFIG_NET_IPIP=m
44CONFIG_IP_MROUTE=y
45CONFIG_IP_PIMSM_V1=y
46CONFIG_IP_PIMSM_V2=y
47CONFIG_SYN_COOKIES=y
48CONFIG_INET_AH=m
49CONFIG_INET_ESP=m
50CONFIG_INET_IPCOMP=m
51# CONFIG_INET_LRO is not set
52CONFIG_INET6_AH=m
53CONFIG_INET6_ESP=m
54CONFIG_INET6_IPCOMP=m
55CONFIG_IPV6_TUNNEL=m
56CONFIG_BRIDGE=m
57CONFIG_VLAN_8021Q=m
58CONFIG_ATALK=m
59CONFIG_DEV_APPLETALK=m
60CONFIG_IPDDP=m
61CONFIG_IPDDP_ENCAP=y
62CONFIG_NET_SCHED=y
63CONFIG_NET_SCH_CBQ=m
64CONFIG_NET_SCH_HTB=m
65CONFIG_NET_SCH_HFSC=m
66CONFIG_NET_SCH_PRIO=m
67CONFIG_NET_SCH_RED=m
68CONFIG_NET_SCH_SFQ=m
69CONFIG_NET_SCH_TEQL=m
70CONFIG_NET_SCH_TBF=m
71CONFIG_NET_SCH_GRED=m
72CONFIG_NET_SCH_DSMARK=m
73CONFIG_NET_SCH_NETEM=m
74CONFIG_NET_SCH_INGRESS=m
75CONFIG_NET_CLS_BASIC=m
76CONFIG_NET_CLS_TCINDEX=m
77CONFIG_NET_CLS_ROUTE4=m
78CONFIG_NET_CLS_FW=m
79CONFIG_NET_CLS_U32=m
80CONFIG_NET_CLS_RSVP=m
81CONFIG_NET_CLS_RSVP6=m
82CONFIG_NET_CLS_ACT=y
83CONFIG_NET_ACT_POLICE=y
84CONFIG_NET_CLS_IND=y
85# CONFIG_WIRELESS is not set
86CONFIG_DEVTMPFS=y
87CONFIG_BLK_DEV_LOOP=y
88CONFIG_BLK_DEV_CRYPTOLOOP=m
89CONFIG_IDE=y
90# CONFIG_IDE_PROC_FS is not set
91# CONFIG_IDEPCI_PCIBUS_ORDER is not set
92CONFIG_BLK_DEV_GENERIC=y
93CONFIG_BLK_DEV_PIIX=y
94CONFIG_SCSI=y
95CONFIG_BLK_DEV_SD=y
96CONFIG_CHR_DEV_SG=y
97# CONFIG_SCSI_LOWLEVEL is not set
98CONFIG_NETDEVICES=y
99# CONFIG_NET_VENDOR_3COM is not set
100# CONFIG_NET_VENDOR_ADAPTEC is not set
101# CONFIG_NET_VENDOR_ALTEON is not set
102CONFIG_PCNET32=y
103# CONFIG_NET_VENDOR_ATHEROS is not set
104# CONFIG_NET_VENDOR_BROADCOM is not set
105# CONFIG_NET_VENDOR_BROCADE is not set
106# CONFIG_NET_VENDOR_CHELSIO is not set
107# CONFIG_NET_VENDOR_CISCO is not set
108# CONFIG_NET_VENDOR_DEC is not set
109# CONFIG_NET_VENDOR_DLINK is not set
110# CONFIG_NET_VENDOR_EMULEX is not set
111# CONFIG_NET_VENDOR_EXAR is not set
112# CONFIG_NET_VENDOR_HP is not set
113# CONFIG_NET_VENDOR_INTEL is not set
114# CONFIG_NET_VENDOR_MARVELL is not set
115# CONFIG_NET_VENDOR_MELLANOX is not set
116# CONFIG_NET_VENDOR_MICREL is not set
117# CONFIG_NET_VENDOR_MYRI is not set
118# CONFIG_NET_VENDOR_NATSEMI is not set
119# CONFIG_NET_VENDOR_NVIDIA is not set
120# CONFIG_NET_VENDOR_OKI is not set
121# CONFIG_NET_PACKET_ENGINE is not set
122# CONFIG_NET_VENDOR_QLOGIC is not set
123# CONFIG_NET_VENDOR_REALTEK is not set
124# CONFIG_NET_VENDOR_RDC is not set
125# CONFIG_NET_VENDOR_SEEQ is not set
126# CONFIG_NET_VENDOR_SILAN is not set
127# CONFIG_NET_VENDOR_SIS is not set
128# CONFIG_NET_VENDOR_SMSC is not set
129# CONFIG_NET_VENDOR_STMICRO is not set
130# CONFIG_NET_VENDOR_SUN is not set
131# CONFIG_NET_VENDOR_TEHUTI is not set
132# CONFIG_NET_VENDOR_TI is not set
133# CONFIG_NET_VENDOR_TOSHIBA is not set
134# CONFIG_NET_VENDOR_VIA is not set
135# CONFIG_NET_VENDOR_WIZNET is not set
136# CONFIG_WLAN is not set
137# CONFIG_VT is not set
138CONFIG_LEGACY_PTY_COUNT=4
139CONFIG_SERIAL_8250=y
140CONFIG_SERIAL_8250_CONSOLE=y
141CONFIG_HW_RANDOM=y
142# CONFIG_HWMON is not set
143CONFIG_VIDEO_OUTPUT_CONTROL=m
144CONFIG_FB=y
145CONFIG_FIRMWARE_EDID=y
146CONFIG_FB_MATROX=y
147CONFIG_FB_MATROX_G=y
148CONFIG_USB=y
149CONFIG_USB_EHCI_HCD=y
150# CONFIG_USB_EHCI_TT_NEWSCHED is not set
151CONFIG_USB_UHCI_HCD=y
152CONFIG_USB_STORAGE=y
153CONFIG_NEW_LEDS=y
154CONFIG_LEDS_CLASS=y
155CONFIG_LEDS_TRIGGERS=y
156CONFIG_LEDS_TRIGGER_TIMER=y
157CONFIG_LEDS_TRIGGER_IDE_DISK=y
158CONFIG_LEDS_TRIGGER_HEARTBEAT=y
159CONFIG_LEDS_TRIGGER_BACKLIGHT=y
160CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
161CONFIG_RTC_CLASS=y
162CONFIG_RTC_DRV_CMOS=y
163CONFIG_EXT2_FS=y
164CONFIG_EXT3_FS=y
165# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
166CONFIG_XFS_FS=y
167CONFIG_XFS_QUOTA=y
168CONFIG_XFS_POSIX_ACL=y
169CONFIG_QUOTA=y
170CONFIG_QFMT_V2=y
171CONFIG_MSDOS_FS=m
172CONFIG_VFAT_FS=m
173CONFIG_PROC_KCORE=y
174CONFIG_TMPFS=y
175CONFIG_NFS_FS=y
176CONFIG_ROOT_NFS=y
177CONFIG_CIFS=m
178CONFIG_CIFS_WEAK_PW_HASH=y
179CONFIG_CIFS_XATTR=y
180CONFIG_CIFS_POSIX=y
181CONFIG_NLS_CODEPAGE_437=m
182CONFIG_NLS_ISO8859_1=m
183# CONFIG_FTRACE is not set
184CONFIG_CRYPTO_NULL=m
185CONFIG_CRYPTO_PCBC=m
186CONFIG_CRYPTO_HMAC=y
187CONFIG_CRYPTO_MICHAEL_MIC=m
188CONFIG_CRYPTO_SHA512=m
189CONFIG_CRYPTO_TGR192=m
190CONFIG_CRYPTO_WP512=m
191CONFIG_CRYPTO_ANUBIS=m
192CONFIG_CRYPTO_BLOWFISH=m
193CONFIG_CRYPTO_CAST5=m
194CONFIG_CRYPTO_CAST6=m
195CONFIG_CRYPTO_KHAZAD=m
196CONFIG_CRYPTO_SERPENT=m
197CONFIG_CRYPTO_TEA=m
198CONFIG_CRYPTO_TWOFISH=m
199# CONFIG_CRYPTO_ANSI_CPRNG is not set
200# CONFIG_CRYPTO_HW is not set
diff --git a/arch/mips/configs/maltaup_defconfig b/arch/mips/configs/maltaup_defconfig
index 9868fc9c1133..62344648eb7a 100644
--- a/arch/mips/configs/maltaup_defconfig
+++ b/arch/mips/configs/maltaup_defconfig
@@ -43,7 +43,6 @@ CONFIG_INET_AH=m
43CONFIG_INET_ESP=m 43CONFIG_INET_ESP=m
44CONFIG_INET_IPCOMP=m 44CONFIG_INET_IPCOMP=m
45# CONFIG_INET_LRO is not set 45# CONFIG_INET_LRO is not set
46CONFIG_IPV6_PRIVACY=y
47CONFIG_INET6_AH=m 46CONFIG_INET6_AH=m
48CONFIG_INET6_ESP=m 47CONFIG_INET6_ESP=m
49CONFIG_INET6_IPCOMP=m 48CONFIG_INET6_IPCOMP=m
@@ -54,7 +53,6 @@ CONFIG_ATALK=m
54CONFIG_DEV_APPLETALK=m 53CONFIG_DEV_APPLETALK=m
55CONFIG_IPDDP=m 54CONFIG_IPDDP=m
56CONFIG_IPDDP_ENCAP=y 55CONFIG_IPDDP_ENCAP=y
57CONFIG_IPDDP_DECAP=y
58CONFIG_NET_SCHED=y 56CONFIG_NET_SCHED=y
59CONFIG_NET_SCH_CBQ=m 57CONFIG_NET_SCH_CBQ=m
60CONFIG_NET_SCH_HTB=m 58CONFIG_NET_SCH_HTB=m
@@ -79,6 +77,7 @@ CONFIG_NET_CLS_ACT=y
79CONFIG_NET_ACT_POLICE=y 77CONFIG_NET_ACT_POLICE=y
80CONFIG_NET_CLS_IND=y 78CONFIG_NET_CLS_IND=y
81# CONFIG_WIRELESS is not set 79# CONFIG_WIRELESS is not set
80CONFIG_DEVTMPFS=y
82CONFIG_BLK_DEV_LOOP=y 81CONFIG_BLK_DEV_LOOP=y
83CONFIG_BLK_DEV_CRYPTOLOOP=m 82CONFIG_BLK_DEV_CRYPTOLOOP=m
84CONFIG_IDE=y 83CONFIG_IDE=y
diff --git a/arch/mips/include/asm/asm-eva.h b/arch/mips/include/asm/asm-eva.h
new file mode 100644
index 000000000000..e41c56e375b1
--- /dev/null
+++ b/arch/mips/include/asm/asm-eva.h
@@ -0,0 +1,135 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2014 Imagination Technologies Ltd.
7 *
8 */
9
10#ifndef __ASM_ASM_EVA_H
11#define __ASM_ASM_EVA_H
12
13#ifndef __ASSEMBLY__
14#ifdef CONFIG_EVA
15
16#define __BUILD_EVA_INSN(insn, reg, addr) \
17 " .set push\n" \
18 " .set mips0\n" \
19 " .set eva\n" \
20 " "insn" "reg", "addr "\n" \
21 " .set pop\n"
22
23#define user_cache(op, base) __BUILD_EVA_INSN("cachee", op, base)
24#define user_ll(reg, addr) __BUILD_EVA_INSN("lle", reg, addr)
25#define user_sc(reg, addr) __BUILD_EVA_INSN("sce", reg, addr)
26#define user_lw(reg, addr) __BUILD_EVA_INSN("lwe", reg, addr)
27#define user_lwl(reg, addr) __BUILD_EVA_INSN("lwle", reg, addr)
28#define user_lwr(reg, addr) __BUILD_EVA_INSN("lwre", reg, addr)
29#define user_lh(reg, addr) __BUILD_EVA_INSN("lhe", reg, addr)
30#define user_lb(reg, addr) __BUILD_EVA_INSN("lbe", reg, addr)
31#define user_lbu(reg, addr) __BUILD_EVA_INSN("lbue", reg, addr)
32/* No 64-bit EVA instruction for loading double words */
33#define user_ld(reg, addr) user_lw(reg, addr)
34#define user_sw(reg, addr) __BUILD_EVA_INSN("swe", reg, addr)
35#define user_swl(reg, addr) __BUILD_EVA_INSN("swle", reg, addr)
36#define user_swr(reg, addr) __BUILD_EVA_INSN("swre", reg, addr)
37#define user_sh(reg, addr) __BUILD_EVA_INSN("she", reg, addr)
38#define user_sb(reg, addr) __BUILD_EVA_INSN("sbe", reg, addr)
39/* No 64-bit EVA instruction for storing double words */
40#define user_sd(reg, addr) user_sw(reg, addr)
41
42#else
43
44#define user_cache(op, base) "cache " op ", " base "\n"
45#define user_ll(reg, addr) "ll " reg ", " addr "\n"
46#define user_sc(reg, addr) "sc " reg ", " addr "\n"
47#define user_lw(reg, addr) "lw " reg ", " addr "\n"
48#define user_lwl(reg, addr) "lwl " reg ", " addr "\n"
49#define user_lwr(reg, addr) "lwr " reg ", " addr "\n"
50#define user_lh(reg, addr) "lh " reg ", " addr "\n"
51#define user_lb(reg, addr) "lb " reg ", " addr "\n"
52#define user_lbu(reg, addr) "lbu " reg ", " addr "\n"
53#define user_sw(reg, addr) "sw " reg ", " addr "\n"
54#define user_swl(reg, addr) "swl " reg ", " addr "\n"
55#define user_swr(reg, addr) "swr " reg ", " addr "\n"
56#define user_sh(reg, addr) "sh " reg ", " addr "\n"
57#define user_sb(reg, addr) "sb " reg ", " addr "\n"
58
59#ifdef CONFIG_32BIT
60/*
61 * No 'sd' or 'ld' instructions in 32-bit but the code will
62 * do the correct thing
63 */
64#define user_sd(reg, addr) user_sw(reg, addr)
65#define user_ld(reg, addr) user_lw(reg, addr)
66#else
67#define user_sd(reg, addr) "sd " reg", " addr "\n"
68#define user_ld(reg, addr) "ld " reg", " addr "\n"
69#endif /* CONFIG_32BIT */
70
71#endif /* CONFIG_EVA */
72
73#else /* __ASSEMBLY__ */
74
75#ifdef CONFIG_EVA
76
77#define __BUILD_EVA_INSN(insn, reg, addr) \
78 .set push; \
79 .set mips0; \
80 .set eva; \
81 insn reg, addr; \
82 .set pop;
83
84#define user_cache(op, base) __BUILD_EVA_INSN(cachee, op, base)
85#define user_ll(reg, addr) __BUILD_EVA_INSN(lle, reg, addr)
86#define user_sc(reg, addr) __BUILD_EVA_INSN(sce, reg, addr)
87#define user_lw(reg, addr) __BUILD_EVA_INSN(lwe, reg, addr)
88#define user_lwl(reg, addr) __BUILD_EVA_INSN(lwle, reg, addr)
89#define user_lwr(reg, addr) __BUILD_EVA_INSN(lwre, reg, addr)
90#define user_lh(reg, addr) __BUILD_EVA_INSN(lhe, reg, addr)
91#define user_lb(reg, addr) __BUILD_EVA_INSN(lbe, reg, addr)
92#define user_lbu(reg, addr) __BUILD_EVA_INSN(lbue, reg, addr)
93/* No 64-bit EVA instruction for loading double words */
94#define user_ld(reg, addr) user_lw(reg, addr)
95#define user_sw(reg, addr) __BUILD_EVA_INSN(swe, reg, addr)
96#define user_swl(reg, addr) __BUILD_EVA_INSN(swle, reg, addr)
97#define user_swr(reg, addr) __BUILD_EVA_INSN(swre, reg, addr)
98#define user_sh(reg, addr) __BUILD_EVA_INSN(she, reg, addr)
99#define user_sb(reg, addr) __BUILD_EVA_INSN(sbe, reg, addr)
100/* No 64-bit EVA instruction for loading double words */
101#define user_sd(reg, addr) user_sw(reg, addr)
102#else
103
104#define user_cache(op, base) cache op, base
105#define user_ll(reg, addr) ll reg, addr
106#define user_sc(reg, addr) sc reg, addr
107#define user_lw(reg, addr) lw reg, addr
108#define user_lwl(reg, addr) lwl reg, addr
109#define user_lwr(reg, addr) lwr reg, addr
110#define user_lh(reg, addr) lh reg, addr
111#define user_lb(reg, addr) lb reg, addr
112#define user_lbu(reg, addr) lbu reg, addr
113#define user_sw(reg, addr) sw reg, addr
114#define user_swl(reg, addr) swl reg, addr
115#define user_swr(reg, addr) swr reg, addr
116#define user_sh(reg, addr) sh reg, addr
117#define user_sb(reg, addr) sb reg, addr
118
119#ifdef CONFIG_32BIT
120/*
121 * No 'sd' or 'ld' instructions in 32-bit but the code will
122 * do the correct thing
123 */
124#define user_sd(reg, addr) user_sw(reg, addr)
125#define user_ld(reg, addr) user_lw(reg, addr)
126#else
127#define user_sd(reg, addr) sd reg, addr
128#define user_ld(reg, addr) ld reg, addr
129#endif /* CONFIG_32BIT */
130
131#endif /* CONFIG_EVA */
132
133#endif /* __ASSEMBLY__ */
134
135#endif /* __ASM_ASM_EVA_H */
diff --git a/arch/mips/include/asm/asm.h b/arch/mips/include/asm/asm.h
index 879691d194af..7c26b28bf252 100644
--- a/arch/mips/include/asm/asm.h
+++ b/arch/mips/include/asm/asm.h
@@ -18,6 +18,7 @@
18#define __ASM_ASM_H 18#define __ASM_ASM_H
19 19
20#include <asm/sgidefs.h> 20#include <asm/sgidefs.h>
21#include <asm/asm-eva.h>
21 22
22#ifndef CAT 23#ifndef CAT
23#ifdef __STDC__ 24#ifdef __STDC__
@@ -145,19 +146,27 @@ symbol = value
145 146
146#define PREF(hint,addr) \ 147#define PREF(hint,addr) \
147 .set push; \ 148 .set push; \
148 .set mips4; \ 149 .set arch=r5000; \
149 pref hint, addr; \ 150 pref hint, addr; \
150 .set pop 151 .set pop
151 152
153#define PREFE(hint, addr) \
154 .set push; \
155 .set mips0; \
156 .set eva; \
157 prefe hint, addr; \
158 .set pop
159
152#define PREFX(hint,addr) \ 160#define PREFX(hint,addr) \
153 .set push; \ 161 .set push; \
154 .set mips4; \ 162 .set arch=r5000; \
155 prefx hint, addr; \ 163 prefx hint, addr; \
156 .set pop 164 .set pop
157 165
158#else /* !CONFIG_CPU_HAS_PREFETCH */ 166#else /* !CONFIG_CPU_HAS_PREFETCH */
159 167
160#define PREF(hint, addr) 168#define PREF(hint, addr)
169#define PREFE(hint, addr)
161#define PREFX(hint, addr) 170#define PREFX(hint, addr)
162 171
163#endif /* !CONFIG_CPU_HAS_PREFETCH */ 172#endif /* !CONFIG_CPU_HAS_PREFETCH */
diff --git a/arch/mips/include/asm/asmmacro-32.h b/arch/mips/include/asm/asmmacro-32.h
index 70e1f176f123..e38c2811d4e2 100644
--- a/arch/mips/include/asm/asmmacro-32.h
+++ b/arch/mips/include/asm/asmmacro-32.h
@@ -14,75 +14,75 @@
14 14
15 .macro fpu_save_single thread tmp=t0 15 .macro fpu_save_single thread tmp=t0
16 cfc1 \tmp, fcr31 16 cfc1 \tmp, fcr31
17 swc1 $f0, THREAD_FPR0(\thread) 17 swc1 $f0, THREAD_FPR0_LS64(\thread)
18 swc1 $f1, THREAD_FPR1(\thread) 18 swc1 $f1, THREAD_FPR1_LS64(\thread)
19 swc1 $f2, THREAD_FPR2(\thread) 19 swc1 $f2, THREAD_FPR2_LS64(\thread)
20 swc1 $f3, THREAD_FPR3(\thread) 20 swc1 $f3, THREAD_FPR3_LS64(\thread)
21 swc1 $f4, THREAD_FPR4(\thread) 21 swc1 $f4, THREAD_FPR4_LS64(\thread)
22 swc1 $f5, THREAD_FPR5(\thread) 22 swc1 $f5, THREAD_FPR5_LS64(\thread)
23 swc1 $f6, THREAD_FPR6(\thread) 23 swc1 $f6, THREAD_FPR6_LS64(\thread)
24 swc1 $f7, THREAD_FPR7(\thread) 24 swc1 $f7, THREAD_FPR7_LS64(\thread)
25 swc1 $f8, THREAD_FPR8(\thread) 25 swc1 $f8, THREAD_FPR8_LS64(\thread)
26 swc1 $f9, THREAD_FPR9(\thread) 26 swc1 $f9, THREAD_FPR9_LS64(\thread)
27 swc1 $f10, THREAD_FPR10(\thread) 27 swc1 $f10, THREAD_FPR10_LS64(\thread)
28 swc1 $f11, THREAD_FPR11(\thread) 28 swc1 $f11, THREAD_FPR11_LS64(\thread)
29 swc1 $f12, THREAD_FPR12(\thread) 29 swc1 $f12, THREAD_FPR12_LS64(\thread)
30 swc1 $f13, THREAD_FPR13(\thread) 30 swc1 $f13, THREAD_FPR13_LS64(\thread)
31 swc1 $f14, THREAD_FPR14(\thread) 31 swc1 $f14, THREAD_FPR14_LS64(\thread)
32 swc1 $f15, THREAD_FPR15(\thread) 32 swc1 $f15, THREAD_FPR15_LS64(\thread)
33 swc1 $f16, THREAD_FPR16(\thread) 33 swc1 $f16, THREAD_FPR16_LS64(\thread)
34 swc1 $f17, THREAD_FPR17(\thread) 34 swc1 $f17, THREAD_FPR17_LS64(\thread)
35 swc1 $f18, THREAD_FPR18(\thread) 35 swc1 $f18, THREAD_FPR18_LS64(\thread)
36 swc1 $f19, THREAD_FPR19(\thread) 36 swc1 $f19, THREAD_FPR19_LS64(\thread)
37 swc1 $f20, THREAD_FPR20(\thread) 37 swc1 $f20, THREAD_FPR20_LS64(\thread)
38 swc1 $f21, THREAD_FPR21(\thread) 38 swc1 $f21, THREAD_FPR21_LS64(\thread)
39 swc1 $f22, THREAD_FPR22(\thread) 39 swc1 $f22, THREAD_FPR22_LS64(\thread)
40 swc1 $f23, THREAD_FPR23(\thread) 40 swc1 $f23, THREAD_FPR23_LS64(\thread)
41 swc1 $f24, THREAD_FPR24(\thread) 41 swc1 $f24, THREAD_FPR24_LS64(\thread)
42 swc1 $f25, THREAD_FPR25(\thread) 42 swc1 $f25, THREAD_FPR25_LS64(\thread)
43 swc1 $f26, THREAD_FPR26(\thread) 43 swc1 $f26, THREAD_FPR26_LS64(\thread)
44 swc1 $f27, THREAD_FPR27(\thread) 44 swc1 $f27, THREAD_FPR27_LS64(\thread)
45 swc1 $f28, THREAD_FPR28(\thread) 45 swc1 $f28, THREAD_FPR28_LS64(\thread)
46 swc1 $f29, THREAD_FPR29(\thread) 46 swc1 $f29, THREAD_FPR29_LS64(\thread)
47 swc1 $f30, THREAD_FPR30(\thread) 47 swc1 $f30, THREAD_FPR30_LS64(\thread)
48 swc1 $f31, THREAD_FPR31(\thread) 48 swc1 $f31, THREAD_FPR31_LS64(\thread)
49 sw \tmp, THREAD_FCR31(\thread) 49 sw \tmp, THREAD_FCR31(\thread)
50 .endm 50 .endm
51 51
52 .macro fpu_restore_single thread tmp=t0 52 .macro fpu_restore_single thread tmp=t0
53 lw \tmp, THREAD_FCR31(\thread) 53 lw \tmp, THREAD_FCR31(\thread)
54 lwc1 $f0, THREAD_FPR0(\thread) 54 lwc1 $f0, THREAD_FPR0_LS64(\thread)
55 lwc1 $f1, THREAD_FPR1(\thread) 55 lwc1 $f1, THREAD_FPR1_LS64(\thread)
56 lwc1 $f2, THREAD_FPR2(\thread) 56 lwc1 $f2, THREAD_FPR2_LS64(\thread)
57 lwc1 $f3, THREAD_FPR3(\thread) 57 lwc1 $f3, THREAD_FPR3_LS64(\thread)
58 lwc1 $f4, THREAD_FPR4(\thread) 58 lwc1 $f4, THREAD_FPR4_LS64(\thread)
59 lwc1 $f5, THREAD_FPR5(\thread) 59 lwc1 $f5, THREAD_FPR5_LS64(\thread)
60 lwc1 $f6, THREAD_FPR6(\thread) 60 lwc1 $f6, THREAD_FPR6_LS64(\thread)
61 lwc1 $f7, THREAD_FPR7(\thread) 61 lwc1 $f7, THREAD_FPR7_LS64(\thread)
62 lwc1 $f8, THREAD_FPR8(\thread) 62 lwc1 $f8, THREAD_FPR8_LS64(\thread)
63 lwc1 $f9, THREAD_FPR9(\thread) 63 lwc1 $f9, THREAD_FPR9_LS64(\thread)
64 lwc1 $f10, THREAD_FPR10(\thread) 64 lwc1 $f10, THREAD_FPR10_LS64(\thread)
65 lwc1 $f11, THREAD_FPR11(\thread) 65 lwc1 $f11, THREAD_FPR11_LS64(\thread)
66 lwc1 $f12, THREAD_FPR12(\thread) 66 lwc1 $f12, THREAD_FPR12_LS64(\thread)
67 lwc1 $f13, THREAD_FPR13(\thread) 67 lwc1 $f13, THREAD_FPR13_LS64(\thread)
68 lwc1 $f14, THREAD_FPR14(\thread) 68 lwc1 $f14, THREAD_FPR14_LS64(\thread)
69 lwc1 $f15, THREAD_FPR15(\thread) 69 lwc1 $f15, THREAD_FPR15_LS64(\thread)
70 lwc1 $f16, THREAD_FPR16(\thread) 70 lwc1 $f16, THREAD_FPR16_LS64(\thread)
71 lwc1 $f17, THREAD_FPR17(\thread) 71 lwc1 $f17, THREAD_FPR17_LS64(\thread)
72 lwc1 $f18, THREAD_FPR18(\thread) 72 lwc1 $f18, THREAD_FPR18_LS64(\thread)
73 lwc1 $f19, THREAD_FPR19(\thread) 73 lwc1 $f19, THREAD_FPR19_LS64(\thread)
74 lwc1 $f20, THREAD_FPR20(\thread) 74 lwc1 $f20, THREAD_FPR20_LS64(\thread)
75 lwc1 $f21, THREAD_FPR21(\thread) 75 lwc1 $f21, THREAD_FPR21_LS64(\thread)
76 lwc1 $f22, THREAD_FPR22(\thread) 76 lwc1 $f22, THREAD_FPR22_LS64(\thread)
77 lwc1 $f23, THREAD_FPR23(\thread) 77 lwc1 $f23, THREAD_FPR23_LS64(\thread)
78 lwc1 $f24, THREAD_FPR24(\thread) 78 lwc1 $f24, THREAD_FPR24_LS64(\thread)
79 lwc1 $f25, THREAD_FPR25(\thread) 79 lwc1 $f25, THREAD_FPR25_LS64(\thread)
80 lwc1 $f26, THREAD_FPR26(\thread) 80 lwc1 $f26, THREAD_FPR26_LS64(\thread)
81 lwc1 $f27, THREAD_FPR27(\thread) 81 lwc1 $f27, THREAD_FPR27_LS64(\thread)
82 lwc1 $f28, THREAD_FPR28(\thread) 82 lwc1 $f28, THREAD_FPR28_LS64(\thread)
83 lwc1 $f29, THREAD_FPR29(\thread) 83 lwc1 $f29, THREAD_FPR29_LS64(\thread)
84 lwc1 $f30, THREAD_FPR30(\thread) 84 lwc1 $f30, THREAD_FPR30_LS64(\thread)
85 lwc1 $f31, THREAD_FPR31(\thread) 85 lwc1 $f31, THREAD_FPR31_LS64(\thread)
86 ctc1 \tmp, fcr31 86 ctc1 \tmp, fcr31
87 .endm 87 .endm
88 88
diff --git a/arch/mips/include/asm/asmmacro.h b/arch/mips/include/asm/asmmacro.h
index 4225e99bd7bf..b464b8b1147a 100644
--- a/arch/mips/include/asm/asmmacro.h
+++ b/arch/mips/include/asm/asmmacro.h
@@ -75,44 +75,44 @@
75 75
76 .macro fpu_save_16even thread tmp=t0 76 .macro fpu_save_16even thread tmp=t0
77 cfc1 \tmp, fcr31 77 cfc1 \tmp, fcr31
78 sdc1 $f0, THREAD_FPR0(\thread) 78 sdc1 $f0, THREAD_FPR0_LS64(\thread)
79 sdc1 $f2, THREAD_FPR2(\thread) 79 sdc1 $f2, THREAD_FPR2_LS64(\thread)
80 sdc1 $f4, THREAD_FPR4(\thread) 80 sdc1 $f4, THREAD_FPR4_LS64(\thread)
81 sdc1 $f6, THREAD_FPR6(\thread) 81 sdc1 $f6, THREAD_FPR6_LS64(\thread)
82 sdc1 $f8, THREAD_FPR8(\thread) 82 sdc1 $f8, THREAD_FPR8_LS64(\thread)
83 sdc1 $f10, THREAD_FPR10(\thread) 83 sdc1 $f10, THREAD_FPR10_LS64(\thread)
84 sdc1 $f12, THREAD_FPR12(\thread) 84 sdc1 $f12, THREAD_FPR12_LS64(\thread)
85 sdc1 $f14, THREAD_FPR14(\thread) 85 sdc1 $f14, THREAD_FPR14_LS64(\thread)
86 sdc1 $f16, THREAD_FPR16(\thread) 86 sdc1 $f16, THREAD_FPR16_LS64(\thread)
87 sdc1 $f18, THREAD_FPR18(\thread) 87 sdc1 $f18, THREAD_FPR18_LS64(\thread)
88 sdc1 $f20, THREAD_FPR20(\thread) 88 sdc1 $f20, THREAD_FPR20_LS64(\thread)
89 sdc1 $f22, THREAD_FPR22(\thread) 89 sdc1 $f22, THREAD_FPR22_LS64(\thread)
90 sdc1 $f24, THREAD_FPR24(\thread) 90 sdc1 $f24, THREAD_FPR24_LS64(\thread)
91 sdc1 $f26, THREAD_FPR26(\thread) 91 sdc1 $f26, THREAD_FPR26_LS64(\thread)
92 sdc1 $f28, THREAD_FPR28(\thread) 92 sdc1 $f28, THREAD_FPR28_LS64(\thread)
93 sdc1 $f30, THREAD_FPR30(\thread) 93 sdc1 $f30, THREAD_FPR30_LS64(\thread)
94 sw \tmp, THREAD_FCR31(\thread) 94 sw \tmp, THREAD_FCR31(\thread)
95 .endm 95 .endm
96 96
97 .macro fpu_save_16odd thread 97 .macro fpu_save_16odd thread
98 .set push 98 .set push
99 .set mips64r2 99 .set mips64r2
100 sdc1 $f1, THREAD_FPR1(\thread) 100 sdc1 $f1, THREAD_FPR1_LS64(\thread)
101 sdc1 $f3, THREAD_FPR3(\thread) 101 sdc1 $f3, THREAD_FPR3_LS64(\thread)
102 sdc1 $f5, THREAD_FPR5(\thread) 102 sdc1 $f5, THREAD_FPR5_LS64(\thread)
103 sdc1 $f7, THREAD_FPR7(\thread) 103 sdc1 $f7, THREAD_FPR7_LS64(\thread)
104 sdc1 $f9, THREAD_FPR9(\thread) 104 sdc1 $f9, THREAD_FPR9_LS64(\thread)
105 sdc1 $f11, THREAD_FPR11(\thread) 105 sdc1 $f11, THREAD_FPR11_LS64(\thread)
106 sdc1 $f13, THREAD_FPR13(\thread) 106 sdc1 $f13, THREAD_FPR13_LS64(\thread)
107 sdc1 $f15, THREAD_FPR15(\thread) 107 sdc1 $f15, THREAD_FPR15_LS64(\thread)
108 sdc1 $f17, THREAD_FPR17(\thread) 108 sdc1 $f17, THREAD_FPR17_LS64(\thread)
109 sdc1 $f19, THREAD_FPR19(\thread) 109 sdc1 $f19, THREAD_FPR19_LS64(\thread)
110 sdc1 $f21, THREAD_FPR21(\thread) 110 sdc1 $f21, THREAD_FPR21_LS64(\thread)
111 sdc1 $f23, THREAD_FPR23(\thread) 111 sdc1 $f23, THREAD_FPR23_LS64(\thread)
112 sdc1 $f25, THREAD_FPR25(\thread) 112 sdc1 $f25, THREAD_FPR25_LS64(\thread)
113 sdc1 $f27, THREAD_FPR27(\thread) 113 sdc1 $f27, THREAD_FPR27_LS64(\thread)
114 sdc1 $f29, THREAD_FPR29(\thread) 114 sdc1 $f29, THREAD_FPR29_LS64(\thread)
115 sdc1 $f31, THREAD_FPR31(\thread) 115 sdc1 $f31, THREAD_FPR31_LS64(\thread)
116 .set pop 116 .set pop
117 .endm 117 .endm
118 118
@@ -128,44 +128,44 @@
128 128
129 .macro fpu_restore_16even thread tmp=t0 129 .macro fpu_restore_16even thread tmp=t0
130 lw \tmp, THREAD_FCR31(\thread) 130 lw \tmp, THREAD_FCR31(\thread)
131 ldc1 $f0, THREAD_FPR0(\thread) 131 ldc1 $f0, THREAD_FPR0_LS64(\thread)
132 ldc1 $f2, THREAD_FPR2(\thread) 132 ldc1 $f2, THREAD_FPR2_LS64(\thread)
133 ldc1 $f4, THREAD_FPR4(\thread) 133 ldc1 $f4, THREAD_FPR4_LS64(\thread)
134 ldc1 $f6, THREAD_FPR6(\thread) 134 ldc1 $f6, THREAD_FPR6_LS64(\thread)
135 ldc1 $f8, THREAD_FPR8(\thread) 135 ldc1 $f8, THREAD_FPR8_LS64(\thread)
136 ldc1 $f10, THREAD_FPR10(\thread) 136 ldc1 $f10, THREAD_FPR10_LS64(\thread)
137 ldc1 $f12, THREAD_FPR12(\thread) 137 ldc1 $f12, THREAD_FPR12_LS64(\thread)
138 ldc1 $f14, THREAD_FPR14(\thread) 138 ldc1 $f14, THREAD_FPR14_LS64(\thread)
139 ldc1 $f16, THREAD_FPR16(\thread) 139 ldc1 $f16, THREAD_FPR16_LS64(\thread)
140 ldc1 $f18, THREAD_FPR18(\thread) 140 ldc1 $f18, THREAD_FPR18_LS64(\thread)
141 ldc1 $f20, THREAD_FPR20(\thread) 141 ldc1 $f20, THREAD_FPR20_LS64(\thread)
142 ldc1 $f22, THREAD_FPR22(\thread) 142 ldc1 $f22, THREAD_FPR22_LS64(\thread)
143 ldc1 $f24, THREAD_FPR24(\thread) 143 ldc1 $f24, THREAD_FPR24_LS64(\thread)
144 ldc1 $f26, THREAD_FPR26(\thread) 144 ldc1 $f26, THREAD_FPR26_LS64(\thread)
145 ldc1 $f28, THREAD_FPR28(\thread) 145 ldc1 $f28, THREAD_FPR28_LS64(\thread)
146 ldc1 $f30, THREAD_FPR30(\thread) 146 ldc1 $f30, THREAD_FPR30_LS64(\thread)
147 ctc1 \tmp, fcr31 147 ctc1 \tmp, fcr31
148 .endm 148 .endm
149 149
150 .macro fpu_restore_16odd thread 150 .macro fpu_restore_16odd thread
151 .set push 151 .set push
152 .set mips64r2 152 .set mips64r2
153 ldc1 $f1, THREAD_FPR1(\thread) 153 ldc1 $f1, THREAD_FPR1_LS64(\thread)
154 ldc1 $f3, THREAD_FPR3(\thread) 154 ldc1 $f3, THREAD_FPR3_LS64(\thread)
155 ldc1 $f5, THREAD_FPR5(\thread) 155 ldc1 $f5, THREAD_FPR5_LS64(\thread)
156 ldc1 $f7, THREAD_FPR7(\thread) 156 ldc1 $f7, THREAD_FPR7_LS64(\thread)
157 ldc1 $f9, THREAD_FPR9(\thread) 157 ldc1 $f9, THREAD_FPR9_LS64(\thread)
158 ldc1 $f11, THREAD_FPR11(\thread) 158 ldc1 $f11, THREAD_FPR11_LS64(\thread)
159 ldc1 $f13, THREAD_FPR13(\thread) 159 ldc1 $f13, THREAD_FPR13_LS64(\thread)
160 ldc1 $f15, THREAD_FPR15(\thread) 160 ldc1 $f15, THREAD_FPR15_LS64(\thread)
161 ldc1 $f17, THREAD_FPR17(\thread) 161 ldc1 $f17, THREAD_FPR17_LS64(\thread)
162 ldc1 $f19, THREAD_FPR19(\thread) 162 ldc1 $f19, THREAD_FPR19_LS64(\thread)
163 ldc1 $f21, THREAD_FPR21(\thread) 163 ldc1 $f21, THREAD_FPR21_LS64(\thread)
164 ldc1 $f23, THREAD_FPR23(\thread) 164 ldc1 $f23, THREAD_FPR23_LS64(\thread)
165 ldc1 $f25, THREAD_FPR25(\thread) 165 ldc1 $f25, THREAD_FPR25_LS64(\thread)
166 ldc1 $f27, THREAD_FPR27(\thread) 166 ldc1 $f27, THREAD_FPR27_LS64(\thread)
167 ldc1 $f29, THREAD_FPR29(\thread) 167 ldc1 $f29, THREAD_FPR29_LS64(\thread)
168 ldc1 $f31, THREAD_FPR31(\thread) 168 ldc1 $f31, THREAD_FPR31_LS64(\thread)
169 .set pop 169 .set pop
170 .endm 170 .endm
171 171
@@ -180,6 +180,17 @@
180 fpu_restore_16even \thread \tmp 180 fpu_restore_16even \thread \tmp
181 .endm 181 .endm
182 182
183#ifdef CONFIG_CPU_MIPSR2
184 .macro _EXT rd, rs, p, s
185 ext \rd, \rs, \p, \s
186 .endm
187#else /* !CONFIG_CPU_MIPSR2 */
188 .macro _EXT rd, rs, p, s
189 srl \rd, \rs, \p
190 andi \rd, \rd, (1 << \s) - 1
191 .endm
192#endif /* !CONFIG_CPU_MIPSR2 */
193
183/* 194/*
184 * Temporary until all gas have MT ASE support 195 * Temporary until all gas have MT ASE support
185 */ 196 */
@@ -207,4 +218,195 @@
207 .word 0x41800000 | (\rt << 16) | (\rd << 11) | (\u << 5) | (\sel) 218 .word 0x41800000 | (\rt << 16) | (\rd << 11) | (\u << 5) | (\sel)
208 .endm 219 .endm
209 220
221#ifdef TOOLCHAIN_SUPPORTS_MSA
222 .macro ld_d wd, off, base
223 .set push
224 .set mips32r2
225 .set msa
226 ld.d $w\wd, \off(\base)
227 .set pop
228 .endm
229
230 .macro st_d wd, off, base
231 .set push
232 .set mips32r2
233 .set msa
234 st.d $w\wd, \off(\base)
235 .set pop
236 .endm
237
238 .macro copy_u_w rd, ws, n
239 .set push
240 .set mips32r2
241 .set msa
242 copy_u.w \rd, $w\ws[\n]
243 .set pop
244 .endm
245
246 .macro copy_u_d rd, ws, n
247 .set push
248 .set mips64r2
249 .set msa
250 copy_u.d \rd, $w\ws[\n]
251 .set pop
252 .endm
253
254 .macro insert_w wd, n, rs
255 .set push
256 .set mips32r2
257 .set msa
258 insert.w $w\wd[\n], \rs
259 .set pop
260 .endm
261
262 .macro insert_d wd, n, rs
263 .set push
264 .set mips64r2
265 .set msa
266 insert.d $w\wd[\n], \rs
267 .set pop
268 .endm
269#else
270 /*
271 * Temporary until all toolchains in use include MSA support.
272 */
273 .macro cfcmsa rd, cs
274 .set push
275 .set noat
276 .word 0x787e0059 | (\cs << 11)
277 move \rd, $1
278 .set pop
279 .endm
280
281 .macro ctcmsa cd, rs
282 .set push
283 .set noat
284 move $1, \rs
285 .word 0x783e0819 | (\cd << 6)
286 .set pop
287 .endm
288
289 .macro ld_d wd, off, base
290 .set push
291 .set noat
292 add $1, \base, \off
293 .word 0x78000823 | (\wd << 6)
294 .set pop
295 .endm
296
297 .macro st_d wd, off, base
298 .set push
299 .set noat
300 add $1, \base, \off
301 .word 0x78000827 | (\wd << 6)
302 .set pop
303 .endm
304
305 .macro copy_u_w rd, ws, n
306 .set push
307 .set noat
308 .word 0x78f00059 | (\n << 16) | (\ws << 11)
309 /* move triggers an assembler bug... */
310 or \rd, $1, zero
311 .set pop
312 .endm
313
314 .macro copy_u_d rd, ws, n
315 .set push
316 .set noat
317 .word 0x78f80059 | (\n << 16) | (\ws << 11)
318 /* move triggers an assembler bug... */
319 or \rd, $1, zero
320 .set pop
321 .endm
322
323 .macro insert_w wd, n, rs
324 .set push
325 .set noat
326 /* move triggers an assembler bug... */
327 or $1, \rs, zero
328 .word 0x79300819 | (\n << 16) | (\wd << 6)
329 .set pop
330 .endm
331
332 .macro insert_d wd, n, rs
333 .set push
334 .set noat
335 /* move triggers an assembler bug... */
336 or $1, \rs, zero
337 .word 0x79380819 | (\n << 16) | (\wd << 6)
338 .set pop
339 .endm
340#endif
341
342 .macro msa_save_all thread
343 st_d 0, THREAD_FPR0, \thread
344 st_d 1, THREAD_FPR1, \thread
345 st_d 2, THREAD_FPR2, \thread
346 st_d 3, THREAD_FPR3, \thread
347 st_d 4, THREAD_FPR4, \thread
348 st_d 5, THREAD_FPR5, \thread
349 st_d 6, THREAD_FPR6, \thread
350 st_d 7, THREAD_FPR7, \thread
351 st_d 8, THREAD_FPR8, \thread
352 st_d 9, THREAD_FPR9, \thread
353 st_d 10, THREAD_FPR10, \thread
354 st_d 11, THREAD_FPR11, \thread
355 st_d 12, THREAD_FPR12, \thread
356 st_d 13, THREAD_FPR13, \thread
357 st_d 14, THREAD_FPR14, \thread
358 st_d 15, THREAD_FPR15, \thread
359 st_d 16, THREAD_FPR16, \thread
360 st_d 17, THREAD_FPR17, \thread
361 st_d 18, THREAD_FPR18, \thread
362 st_d 19, THREAD_FPR19, \thread
363 st_d 20, THREAD_FPR20, \thread
364 st_d 21, THREAD_FPR21, \thread
365 st_d 22, THREAD_FPR22, \thread
366 st_d 23, THREAD_FPR23, \thread
367 st_d 24, THREAD_FPR24, \thread
368 st_d 25, THREAD_FPR25, \thread
369 st_d 26, THREAD_FPR26, \thread
370 st_d 27, THREAD_FPR27, \thread
371 st_d 28, THREAD_FPR28, \thread
372 st_d 29, THREAD_FPR29, \thread
373 st_d 30, THREAD_FPR30, \thread
374 st_d 31, THREAD_FPR31, \thread
375 .endm
376
377 .macro msa_restore_all thread
378 ld_d 0, THREAD_FPR0, \thread
379 ld_d 1, THREAD_FPR1, \thread
380 ld_d 2, THREAD_FPR2, \thread
381 ld_d 3, THREAD_FPR3, \thread
382 ld_d 4, THREAD_FPR4, \thread
383 ld_d 5, THREAD_FPR5, \thread
384 ld_d 6, THREAD_FPR6, \thread
385 ld_d 7, THREAD_FPR7, \thread
386 ld_d 8, THREAD_FPR8, \thread
387 ld_d 9, THREAD_FPR9, \thread
388 ld_d 10, THREAD_FPR10, \thread
389 ld_d 11, THREAD_FPR11, \thread
390 ld_d 12, THREAD_FPR12, \thread
391 ld_d 13, THREAD_FPR13, \thread
392 ld_d 14, THREAD_FPR14, \thread
393 ld_d 15, THREAD_FPR15, \thread
394 ld_d 16, THREAD_FPR16, \thread
395 ld_d 17, THREAD_FPR17, \thread
396 ld_d 18, THREAD_FPR18, \thread
397 ld_d 19, THREAD_FPR19, \thread
398 ld_d 20, THREAD_FPR20, \thread
399 ld_d 21, THREAD_FPR21, \thread
400 ld_d 22, THREAD_FPR22, \thread
401 ld_d 23, THREAD_FPR23, \thread
402 ld_d 24, THREAD_FPR24, \thread
403 ld_d 25, THREAD_FPR25, \thread
404 ld_d 26, THREAD_FPR26, \thread
405 ld_d 27, THREAD_FPR27, \thread
406 ld_d 28, THREAD_FPR28, \thread
407 ld_d 29, THREAD_FPR29, \thread
408 ld_d 30, THREAD_FPR30, \thread
409 ld_d 31, THREAD_FPR31, \thread
410 .endm
411
210#endif /* _ASM_ASMMACRO_H */ 412#endif /* _ASM_ASMMACRO_H */
diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h
index 7eed2f261710..e8eb3d53a241 100644
--- a/arch/mips/include/asm/atomic.h
+++ b/arch/mips/include/asm/atomic.h
@@ -53,7 +53,7 @@ static __inline__ void atomic_add(int i, atomic_t * v)
53 int temp; 53 int temp;
54 54
55 __asm__ __volatile__( 55 __asm__ __volatile__(
56 " .set mips3 \n" 56 " .set arch=r4000 \n"
57 "1: ll %0, %1 # atomic_add \n" 57 "1: ll %0, %1 # atomic_add \n"
58 " addu %0, %2 \n" 58 " addu %0, %2 \n"
59 " sc %0, %1 \n" 59 " sc %0, %1 \n"
@@ -66,7 +66,7 @@ static __inline__ void atomic_add(int i, atomic_t * v)
66 66
67 do { 67 do {
68 __asm__ __volatile__( 68 __asm__ __volatile__(
69 " .set mips3 \n" 69 " .set arch=r4000 \n"
70 " ll %0, %1 # atomic_add \n" 70 " ll %0, %1 # atomic_add \n"
71 " addu %0, %2 \n" 71 " addu %0, %2 \n"
72 " sc %0, %1 \n" 72 " sc %0, %1 \n"
@@ -96,7 +96,7 @@ static __inline__ void atomic_sub(int i, atomic_t * v)
96 int temp; 96 int temp;
97 97
98 __asm__ __volatile__( 98 __asm__ __volatile__(
99 " .set mips3 \n" 99 " .set arch=r4000 \n"
100 "1: ll %0, %1 # atomic_sub \n" 100 "1: ll %0, %1 # atomic_sub \n"
101 " subu %0, %2 \n" 101 " subu %0, %2 \n"
102 " sc %0, %1 \n" 102 " sc %0, %1 \n"
@@ -109,7 +109,7 @@ static __inline__ void atomic_sub(int i, atomic_t * v)
109 109
110 do { 110 do {
111 __asm__ __volatile__( 111 __asm__ __volatile__(
112 " .set mips3 \n" 112 " .set arch=r4000 \n"
113 " ll %0, %1 # atomic_sub \n" 113 " ll %0, %1 # atomic_sub \n"
114 " subu %0, %2 \n" 114 " subu %0, %2 \n"
115 " sc %0, %1 \n" 115 " sc %0, %1 \n"
@@ -139,7 +139,7 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
139 int temp; 139 int temp;
140 140
141 __asm__ __volatile__( 141 __asm__ __volatile__(
142 " .set mips3 \n" 142 " .set arch=r4000 \n"
143 "1: ll %1, %2 # atomic_add_return \n" 143 "1: ll %1, %2 # atomic_add_return \n"
144 " addu %0, %1, %3 \n" 144 " addu %0, %1, %3 \n"
145 " sc %0, %2 \n" 145 " sc %0, %2 \n"
@@ -153,7 +153,7 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
153 153
154 do { 154 do {
155 __asm__ __volatile__( 155 __asm__ __volatile__(
156 " .set mips3 \n" 156 " .set arch=r4000 \n"
157 " ll %1, %2 # atomic_add_return \n" 157 " ll %1, %2 # atomic_add_return \n"
158 " addu %0, %1, %3 \n" 158 " addu %0, %1, %3 \n"
159 " sc %0, %2 \n" 159 " sc %0, %2 \n"
@@ -188,7 +188,7 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
188 int temp; 188 int temp;
189 189
190 __asm__ __volatile__( 190 __asm__ __volatile__(
191 " .set mips3 \n" 191 " .set arch=r4000 \n"
192 "1: ll %1, %2 # atomic_sub_return \n" 192 "1: ll %1, %2 # atomic_sub_return \n"
193 " subu %0, %1, %3 \n" 193 " subu %0, %1, %3 \n"
194 " sc %0, %2 \n" 194 " sc %0, %2 \n"
@@ -205,7 +205,7 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
205 205
206 do { 206 do {
207 __asm__ __volatile__( 207 __asm__ __volatile__(
208 " .set mips3 \n" 208 " .set arch=r4000 \n"
209 " ll %1, %2 # atomic_sub_return \n" 209 " ll %1, %2 # atomic_sub_return \n"
210 " subu %0, %1, %3 \n" 210 " subu %0, %1, %3 \n"
211 " sc %0, %2 \n" 211 " sc %0, %2 \n"
@@ -248,7 +248,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
248 int temp; 248 int temp;
249 249
250 __asm__ __volatile__( 250 __asm__ __volatile__(
251 " .set mips3 \n" 251 " .set arch=r4000 \n"
252 "1: ll %1, %2 # atomic_sub_if_positive\n" 252 "1: ll %1, %2 # atomic_sub_if_positive\n"
253 " subu %0, %1, %3 \n" 253 " subu %0, %1, %3 \n"
254 " bltz %0, 1f \n" 254 " bltz %0, 1f \n"
@@ -266,7 +266,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
266 int temp; 266 int temp;
267 267
268 __asm__ __volatile__( 268 __asm__ __volatile__(
269 " .set mips3 \n" 269 " .set arch=r4000 \n"
270 "1: ll %1, %2 # atomic_sub_if_positive\n" 270 "1: ll %1, %2 # atomic_sub_if_positive\n"
271 " subu %0, %1, %3 \n" 271 " subu %0, %1, %3 \n"
272 " bltz %0, 1f \n" 272 " bltz %0, 1f \n"
@@ -420,7 +420,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
420 long temp; 420 long temp;
421 421
422 __asm__ __volatile__( 422 __asm__ __volatile__(
423 " .set mips3 \n" 423 " .set arch=r4000 \n"
424 "1: lld %0, %1 # atomic64_add \n" 424 "1: lld %0, %1 # atomic64_add \n"
425 " daddu %0, %2 \n" 425 " daddu %0, %2 \n"
426 " scd %0, %1 \n" 426 " scd %0, %1 \n"
@@ -433,7 +433,7 @@ static __inline__ void atomic64_add(long i, atomic64_t * v)
433 433
434 do { 434 do {
435 __asm__ __volatile__( 435 __asm__ __volatile__(
436 " .set mips3 \n" 436 " .set arch=r4000 \n"
437 " lld %0, %1 # atomic64_add \n" 437 " lld %0, %1 # atomic64_add \n"
438 " daddu %0, %2 \n" 438 " daddu %0, %2 \n"
439 " scd %0, %1 \n" 439 " scd %0, %1 \n"
@@ -463,7 +463,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
463 long temp; 463 long temp;
464 464
465 __asm__ __volatile__( 465 __asm__ __volatile__(
466 " .set mips3 \n" 466 " .set arch=r4000 \n"
467 "1: lld %0, %1 # atomic64_sub \n" 467 "1: lld %0, %1 # atomic64_sub \n"
468 " dsubu %0, %2 \n" 468 " dsubu %0, %2 \n"
469 " scd %0, %1 \n" 469 " scd %0, %1 \n"
@@ -476,7 +476,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
476 476
477 do { 477 do {
478 __asm__ __volatile__( 478 __asm__ __volatile__(
479 " .set mips3 \n" 479 " .set arch=r4000 \n"
480 " lld %0, %1 # atomic64_sub \n" 480 " lld %0, %1 # atomic64_sub \n"
481 " dsubu %0, %2 \n" 481 " dsubu %0, %2 \n"
482 " scd %0, %1 \n" 482 " scd %0, %1 \n"
@@ -506,7 +506,7 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
506 long temp; 506 long temp;
507 507
508 __asm__ __volatile__( 508 __asm__ __volatile__(
509 " .set mips3 \n" 509 " .set arch=r4000 \n"
510 "1: lld %1, %2 # atomic64_add_return \n" 510 "1: lld %1, %2 # atomic64_add_return \n"
511 " daddu %0, %1, %3 \n" 511 " daddu %0, %1, %3 \n"
512 " scd %0, %2 \n" 512 " scd %0, %2 \n"
@@ -520,7 +520,7 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
520 520
521 do { 521 do {
522 __asm__ __volatile__( 522 __asm__ __volatile__(
523 " .set mips3 \n" 523 " .set arch=r4000 \n"
524 " lld %1, %2 # atomic64_add_return \n" 524 " lld %1, %2 # atomic64_add_return \n"
525 " daddu %0, %1, %3 \n" 525 " daddu %0, %1, %3 \n"
526 " scd %0, %2 \n" 526 " scd %0, %2 \n"
@@ -556,7 +556,7 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
556 long temp; 556 long temp;
557 557
558 __asm__ __volatile__( 558 __asm__ __volatile__(
559 " .set mips3 \n" 559 " .set arch=r4000 \n"
560 "1: lld %1, %2 # atomic64_sub_return \n" 560 "1: lld %1, %2 # atomic64_sub_return \n"
561 " dsubu %0, %1, %3 \n" 561 " dsubu %0, %1, %3 \n"
562 " scd %0, %2 \n" 562 " scd %0, %2 \n"
@@ -571,7 +571,7 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
571 571
572 do { 572 do {
573 __asm__ __volatile__( 573 __asm__ __volatile__(
574 " .set mips3 \n" 574 " .set arch=r4000 \n"
575 " lld %1, %2 # atomic64_sub_return \n" 575 " lld %1, %2 # atomic64_sub_return \n"
576 " dsubu %0, %1, %3 \n" 576 " dsubu %0, %1, %3 \n"
577 " scd %0, %2 \n" 577 " scd %0, %2 \n"
@@ -615,7 +615,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
615 long temp; 615 long temp;
616 616
617 __asm__ __volatile__( 617 __asm__ __volatile__(
618 " .set mips3 \n" 618 " .set arch=r4000 \n"
619 "1: lld %1, %2 # atomic64_sub_if_positive\n" 619 "1: lld %1, %2 # atomic64_sub_if_positive\n"
620 " dsubu %0, %1, %3 \n" 620 " dsubu %0, %1, %3 \n"
621 " bltz %0, 1f \n" 621 " bltz %0, 1f \n"
@@ -633,7 +633,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
633 long temp; 633 long temp;
634 634
635 __asm__ __volatile__( 635 __asm__ __volatile__(
636 " .set mips3 \n" 636 " .set arch=r4000 \n"
637 "1: lld %1, %2 # atomic64_sub_if_positive\n" 637 "1: lld %1, %2 # atomic64_sub_if_positive\n"
638 " dsubu %0, %1, %3 \n" 638 " dsubu %0, %1, %3 \n"
639 " bltz %0, 1f \n" 639 " bltz %0, 1f \n"
diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h
index 71305a8b3d78..6a65d49e2c0d 100644
--- a/arch/mips/include/asm/bitops.h
+++ b/arch/mips/include/asm/bitops.h
@@ -79,7 +79,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
79 79
80 if (kernel_uses_llsc && R10000_LLSC_WAR) { 80 if (kernel_uses_llsc && R10000_LLSC_WAR) {
81 __asm__ __volatile__( 81 __asm__ __volatile__(
82 " .set mips3 \n" 82 " .set arch=r4000 \n"
83 "1: " __LL "%0, %1 # set_bit \n" 83 "1: " __LL "%0, %1 # set_bit \n"
84 " or %0, %2 \n" 84 " or %0, %2 \n"
85 " " __SC "%0, %1 \n" 85 " " __SC "%0, %1 \n"
@@ -101,7 +101,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
101 } else if (kernel_uses_llsc) { 101 } else if (kernel_uses_llsc) {
102 do { 102 do {
103 __asm__ __volatile__( 103 __asm__ __volatile__(
104 " .set mips3 \n" 104 " .set arch=r4000 \n"
105 " " __LL "%0, %1 # set_bit \n" 105 " " __LL "%0, %1 # set_bit \n"
106 " or %0, %2 \n" 106 " or %0, %2 \n"
107 " " __SC "%0, %1 \n" 107 " " __SC "%0, %1 \n"
@@ -131,7 +131,7 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
131 131
132 if (kernel_uses_llsc && R10000_LLSC_WAR) { 132 if (kernel_uses_llsc && R10000_LLSC_WAR) {
133 __asm__ __volatile__( 133 __asm__ __volatile__(
134 " .set mips3 \n" 134 " .set arch=r4000 \n"
135 "1: " __LL "%0, %1 # clear_bit \n" 135 "1: " __LL "%0, %1 # clear_bit \n"
136 " and %0, %2 \n" 136 " and %0, %2 \n"
137 " " __SC "%0, %1 \n" 137 " " __SC "%0, %1 \n"
@@ -153,7 +153,7 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
153 } else if (kernel_uses_llsc) { 153 } else if (kernel_uses_llsc) {
154 do { 154 do {
155 __asm__ __volatile__( 155 __asm__ __volatile__(
156 " .set mips3 \n" 156 " .set arch=r4000 \n"
157 " " __LL "%0, %1 # clear_bit \n" 157 " " __LL "%0, %1 # clear_bit \n"
158 " and %0, %2 \n" 158 " and %0, %2 \n"
159 " " __SC "%0, %1 \n" 159 " " __SC "%0, %1 \n"
@@ -197,7 +197,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
197 unsigned long temp; 197 unsigned long temp;
198 198
199 __asm__ __volatile__( 199 __asm__ __volatile__(
200 " .set mips3 \n" 200 " .set arch=r4000 \n"
201 "1: " __LL "%0, %1 # change_bit \n" 201 "1: " __LL "%0, %1 # change_bit \n"
202 " xor %0, %2 \n" 202 " xor %0, %2 \n"
203 " " __SC "%0, %1 \n" 203 " " __SC "%0, %1 \n"
@@ -211,7 +211,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
211 211
212 do { 212 do {
213 __asm__ __volatile__( 213 __asm__ __volatile__(
214 " .set mips3 \n" 214 " .set arch=r4000 \n"
215 " " __LL "%0, %1 # change_bit \n" 215 " " __LL "%0, %1 # change_bit \n"
216 " xor %0, %2 \n" 216 " xor %0, %2 \n"
217 " " __SC "%0, %1 \n" 217 " " __SC "%0, %1 \n"
@@ -244,7 +244,7 @@ static inline int test_and_set_bit(unsigned long nr,
244 unsigned long temp; 244 unsigned long temp;
245 245
246 __asm__ __volatile__( 246 __asm__ __volatile__(
247 " .set mips3 \n" 247 " .set arch=r4000 \n"
248 "1: " __LL "%0, %1 # test_and_set_bit \n" 248 "1: " __LL "%0, %1 # test_and_set_bit \n"
249 " or %2, %0, %3 \n" 249 " or %2, %0, %3 \n"
250 " " __SC "%2, %1 \n" 250 " " __SC "%2, %1 \n"
@@ -260,7 +260,7 @@ static inline int test_and_set_bit(unsigned long nr,
260 260
261 do { 261 do {
262 __asm__ __volatile__( 262 __asm__ __volatile__(
263 " .set mips3 \n" 263 " .set arch=r4000 \n"
264 " " __LL "%0, %1 # test_and_set_bit \n" 264 " " __LL "%0, %1 # test_and_set_bit \n"
265 " or %2, %0, %3 \n" 265 " or %2, %0, %3 \n"
266 " " __SC "%2, %1 \n" 266 " " __SC "%2, %1 \n"
@@ -298,7 +298,7 @@ static inline int test_and_set_bit_lock(unsigned long nr,
298 unsigned long temp; 298 unsigned long temp;
299 299
300 __asm__ __volatile__( 300 __asm__ __volatile__(
301 " .set mips3 \n" 301 " .set arch=r4000 \n"
302 "1: " __LL "%0, %1 # test_and_set_bit \n" 302 "1: " __LL "%0, %1 # test_and_set_bit \n"
303 " or %2, %0, %3 \n" 303 " or %2, %0, %3 \n"
304 " " __SC "%2, %1 \n" 304 " " __SC "%2, %1 \n"
@@ -314,7 +314,7 @@ static inline int test_and_set_bit_lock(unsigned long nr,
314 314
315 do { 315 do {
316 __asm__ __volatile__( 316 __asm__ __volatile__(
317 " .set mips3 \n" 317 " .set arch=r4000 \n"
318 " " __LL "%0, %1 # test_and_set_bit \n" 318 " " __LL "%0, %1 # test_and_set_bit \n"
319 " or %2, %0, %3 \n" 319 " or %2, %0, %3 \n"
320 " " __SC "%2, %1 \n" 320 " " __SC "%2, %1 \n"
@@ -353,7 +353,7 @@ static inline int test_and_clear_bit(unsigned long nr,
353 unsigned long temp; 353 unsigned long temp;
354 354
355 __asm__ __volatile__( 355 __asm__ __volatile__(
356 " .set mips3 \n" 356 " .set arch=r4000 \n"
357 "1: " __LL "%0, %1 # test_and_clear_bit \n" 357 "1: " __LL "%0, %1 # test_and_clear_bit \n"
358 " or %2, %0, %3 \n" 358 " or %2, %0, %3 \n"
359 " xor %2, %3 \n" 359 " xor %2, %3 \n"
@@ -386,7 +386,7 @@ static inline int test_and_clear_bit(unsigned long nr,
386 386
387 do { 387 do {
388 __asm__ __volatile__( 388 __asm__ __volatile__(
389 " .set mips3 \n" 389 " .set arch=r4000 \n"
390 " " __LL "%0, %1 # test_and_clear_bit \n" 390 " " __LL "%0, %1 # test_and_clear_bit \n"
391 " or %2, %0, %3 \n" 391 " or %2, %0, %3 \n"
392 " xor %2, %3 \n" 392 " xor %2, %3 \n"
@@ -427,7 +427,7 @@ static inline int test_and_change_bit(unsigned long nr,
427 unsigned long temp; 427 unsigned long temp;
428 428
429 __asm__ __volatile__( 429 __asm__ __volatile__(
430 " .set mips3 \n" 430 " .set arch=r4000 \n"
431 "1: " __LL "%0, %1 # test_and_change_bit \n" 431 "1: " __LL "%0, %1 # test_and_change_bit \n"
432 " xor %2, %0, %3 \n" 432 " xor %2, %0, %3 \n"
433 " " __SC "%2, %1 \n" 433 " " __SC "%2, %1 \n"
@@ -443,7 +443,7 @@ static inline int test_and_change_bit(unsigned long nr,
443 443
444 do { 444 do {
445 __asm__ __volatile__( 445 __asm__ __volatile__(
446 " .set mips3 \n" 446 " .set arch=r4000 \n"
447 " " __LL "%0, %1 # test_and_change_bit \n" 447 " " __LL "%0, %1 # test_and_change_bit \n"
448 " xor %2, %0, %3 \n" 448 " xor %2, %0, %3 \n"
449 " " __SC "\t%2, %1 \n" 449 " " __SC "\t%2, %1 \n"
diff --git a/arch/mips/include/asm/bootinfo.h b/arch/mips/include/asm/bootinfo.h
index 4d2cdea5aa37..1f7ca8b00404 100644
--- a/arch/mips/include/asm/bootinfo.h
+++ b/arch/mips/include/asm/bootinfo.h
@@ -61,15 +61,21 @@
61/* 61/*
62 * Valid machtype for Loongson family 62 * Valid machtype for Loongson family
63 */ 63 */
64#define MACH_LOONGSON_UNKNOWN 0 64enum loongson_machine_type {
65#define MACH_LEMOTE_FL2E 1 65 MACH_LOONGSON_UNKNOWN,
66#define MACH_LEMOTE_FL2F 2 66 MACH_LEMOTE_FL2E,
67#define MACH_LEMOTE_ML2F7 3 67 MACH_LEMOTE_FL2F,
68#define MACH_LEMOTE_YL2F89 4 68 MACH_LEMOTE_ML2F7,
69#define MACH_DEXXON_GDIUM2F10 5 69 MACH_LEMOTE_YL2F89,
70#define MACH_LEMOTE_NAS 6 70 MACH_DEXXON_GDIUM2F10,
71#define MACH_LEMOTE_LL2F 7 71 MACH_LEMOTE_NAS,
72#define MACH_LOONGSON_END 8 72 MACH_LEMOTE_LL2F,
73 MACH_LEMOTE_A1004,
74 MACH_LEMOTE_A1101,
75 MACH_LEMOTE_A1201,
76 MACH_LEMOTE_A1205,
77 MACH_LOONGSON_END
78};
73 79
74/* 80/*
75 * Valid machtype for group INGENIC 81 * Valid machtype for group INGENIC
@@ -112,6 +118,8 @@ extern void prom_free_prom_memory(void);
112extern void free_init_pages(const char *what, 118extern void free_init_pages(const char *what,
113 unsigned long begin, unsigned long end); 119 unsigned long begin, unsigned long end);
114 120
121extern void (*free_init_pages_eva)(void *begin, void *end);
122
115/* 123/*
116 * Initial kernel command line, usually setup by prom_init() 124 * Initial kernel command line, usually setup by prom_init()
117 */ 125 */
diff --git a/arch/mips/include/asm/checksum.h b/arch/mips/include/asm/checksum.h
index ac3d2b8a20d4..3418c51e1151 100644
--- a/arch/mips/include/asm/checksum.h
+++ b/arch/mips/include/asm/checksum.h
@@ -7,6 +7,7 @@
7 * Copyright (C) 1999 Silicon Graphics, Inc. 7 * Copyright (C) 1999 Silicon Graphics, Inc.
8 * Copyright (C) 2001 Thiemo Seufer. 8 * Copyright (C) 2001 Thiemo Seufer.
9 * Copyright (C) 2002 Maciej W. Rozycki 9 * Copyright (C) 2002 Maciej W. Rozycki
10 * Copyright (C) 2014 Imagination Technologies Ltd.
10 */ 11 */
11#ifndef _ASM_CHECKSUM_H 12#ifndef _ASM_CHECKSUM_H
12#define _ASM_CHECKSUM_H 13#define _ASM_CHECKSUM_H
@@ -29,9 +30,13 @@
29 */ 30 */
30__wsum csum_partial(const void *buff, int len, __wsum sum); 31__wsum csum_partial(const void *buff, int len, __wsum sum);
31 32
32__wsum __csum_partial_copy_user(const void *src, void *dst, 33__wsum __csum_partial_copy_kernel(const void *src, void *dst,
33 int len, __wsum sum, int *err_ptr); 34 int len, __wsum sum, int *err_ptr);
34 35
36__wsum __csum_partial_copy_from_user(const void *src, void *dst,
37 int len, __wsum sum, int *err_ptr);
38__wsum __csum_partial_copy_to_user(const void *src, void *dst,
39 int len, __wsum sum, int *err_ptr);
35/* 40/*
36 * this is a new version of the above that records errors it finds in *errp, 41 * this is a new version of the above that records errors it finds in *errp,
37 * but continues and zeros the rest of the buffer. 42 * but continues and zeros the rest of the buffer.
@@ -41,8 +46,26 @@ __wsum csum_partial_copy_from_user(const void __user *src, void *dst, int len,
41 __wsum sum, int *err_ptr) 46 __wsum sum, int *err_ptr)
42{ 47{
43 might_fault(); 48 might_fault();
44 return __csum_partial_copy_user((__force void *)src, dst, 49 if (segment_eq(get_fs(), get_ds()))
45 len, sum, err_ptr); 50 return __csum_partial_copy_kernel((__force void *)src, dst,
51 len, sum, err_ptr);
52 else
53 return __csum_partial_copy_from_user((__force void *)src, dst,
54 len, sum, err_ptr);
55}
56
57#define _HAVE_ARCH_COPY_AND_CSUM_FROM_USER
58static inline
59__wsum csum_and_copy_from_user(const void __user *src, void *dst,
60 int len, __wsum sum, int *err_ptr)
61{
62 if (access_ok(VERIFY_READ, src, len))
63 return csum_partial_copy_from_user(src, dst, len, sum,
64 err_ptr);
65 if (len)
66 *err_ptr = -EFAULT;
67
68 return sum;
46} 69}
47 70
48/* 71/*
@@ -54,9 +77,16 @@ __wsum csum_and_copy_to_user(const void *src, void __user *dst, int len,
54 __wsum sum, int *err_ptr) 77 __wsum sum, int *err_ptr)
55{ 78{
56 might_fault(); 79 might_fault();
57 if (access_ok(VERIFY_WRITE, dst, len)) 80 if (access_ok(VERIFY_WRITE, dst, len)) {
58 return __csum_partial_copy_user(src, (__force void *)dst, 81 if (segment_eq(get_fs(), get_ds()))
59 len, sum, err_ptr); 82 return __csum_partial_copy_kernel(src,
83 (__force void *)dst,
84 len, sum, err_ptr);
85 else
86 return __csum_partial_copy_to_user(src,
87 (__force void *)dst,
88 len, sum, err_ptr);
89 }
60 if (len) 90 if (len)
61 *err_ptr = -EFAULT; 91 *err_ptr = -EFAULT;
62 92
diff --git a/arch/mips/include/asm/cmpxchg.h b/arch/mips/include/asm/cmpxchg.h
index 466069bd8465..eefcaa363a87 100644
--- a/arch/mips/include/asm/cmpxchg.h
+++ b/arch/mips/include/asm/cmpxchg.h
@@ -22,11 +22,11 @@ static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
22 unsigned long dummy; 22 unsigned long dummy;
23 23
24 __asm__ __volatile__( 24 __asm__ __volatile__(
25 " .set mips3 \n" 25 " .set arch=r4000 \n"
26 "1: ll %0, %3 # xchg_u32 \n" 26 "1: ll %0, %3 # xchg_u32 \n"
27 " .set mips0 \n" 27 " .set mips0 \n"
28 " move %2, %z4 \n" 28 " move %2, %z4 \n"
29 " .set mips3 \n" 29 " .set arch=r4000 \n"
30 " sc %2, %1 \n" 30 " sc %2, %1 \n"
31 " beqzl %2, 1b \n" 31 " beqzl %2, 1b \n"
32 " .set mips0 \n" 32 " .set mips0 \n"
@@ -38,11 +38,11 @@ static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
38 38
39 do { 39 do {
40 __asm__ __volatile__( 40 __asm__ __volatile__(
41 " .set mips3 \n" 41 " .set arch=r4000 \n"
42 " ll %0, %3 # xchg_u32 \n" 42 " ll %0, %3 # xchg_u32 \n"
43 " .set mips0 \n" 43 " .set mips0 \n"
44 " move %2, %z4 \n" 44 " move %2, %z4 \n"
45 " .set mips3 \n" 45 " .set arch=r4000 \n"
46 " sc %2, %1 \n" 46 " sc %2, %1 \n"
47 " .set mips0 \n" 47 " .set mips0 \n"
48 : "=&r" (retval), "=m" (*m), "=&r" (dummy) 48 : "=&r" (retval), "=m" (*m), "=&r" (dummy)
@@ -74,7 +74,7 @@ static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val)
74 unsigned long dummy; 74 unsigned long dummy;
75 75
76 __asm__ __volatile__( 76 __asm__ __volatile__(
77 " .set mips3 \n" 77 " .set arch=r4000 \n"
78 "1: lld %0, %3 # xchg_u64 \n" 78 "1: lld %0, %3 # xchg_u64 \n"
79 " move %2, %z4 \n" 79 " move %2, %z4 \n"
80 " scd %2, %1 \n" 80 " scd %2, %1 \n"
@@ -88,7 +88,7 @@ static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val)
88 88
89 do { 89 do {
90 __asm__ __volatile__( 90 __asm__ __volatile__(
91 " .set mips3 \n" 91 " .set arch=r4000 \n"
92 " lld %0, %3 # xchg_u64 \n" 92 " lld %0, %3 # xchg_u64 \n"
93 " move %2, %z4 \n" 93 " move %2, %z4 \n"
94 " scd %2, %1 \n" 94 " scd %2, %1 \n"
@@ -145,12 +145,12 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
145 __asm__ __volatile__( \ 145 __asm__ __volatile__( \
146 " .set push \n" \ 146 " .set push \n" \
147 " .set noat \n" \ 147 " .set noat \n" \
148 " .set mips3 \n" \ 148 " .set arch=r4000 \n" \
149 "1: " ld " %0, %2 # __cmpxchg_asm \n" \ 149 "1: " ld " %0, %2 # __cmpxchg_asm \n" \
150 " bne %0, %z3, 2f \n" \ 150 " bne %0, %z3, 2f \n" \
151 " .set mips0 \n" \ 151 " .set mips0 \n" \
152 " move $1, %z4 \n" \ 152 " move $1, %z4 \n" \
153 " .set mips3 \n" \ 153 " .set arch=r4000 \n" \
154 " " st " $1, %1 \n" \ 154 " " st " $1, %1 \n" \
155 " beqzl $1, 1b \n" \ 155 " beqzl $1, 1b \n" \
156 "2: \n" \ 156 "2: \n" \
@@ -162,12 +162,12 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz
162 __asm__ __volatile__( \ 162 __asm__ __volatile__( \
163 " .set push \n" \ 163 " .set push \n" \
164 " .set noat \n" \ 164 " .set noat \n" \
165 " .set mips3 \n" \ 165 " .set arch=r4000 \n" \
166 "1: " ld " %0, %2 # __cmpxchg_asm \n" \ 166 "1: " ld " %0, %2 # __cmpxchg_asm \n" \
167 " bne %0, %z3, 2f \n" \ 167 " bne %0, %z3, 2f \n" \
168 " .set mips0 \n" \ 168 " .set mips0 \n" \
169 " move $1, %z4 \n" \ 169 " move $1, %z4 \n" \
170 " .set mips3 \n" \ 170 " .set arch=r4000 \n" \
171 " " st " $1, %1 \n" \ 171 " " st " $1, %1 \n" \
172 " beqz $1, 1b \n" \ 172 " beqz $1, 1b \n" \
173 " .set pop \n" \ 173 " .set pop \n" \
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h
index 6e70b03b6aab..f56cc975b92f 100644
--- a/arch/mips/include/asm/cpu-features.h
+++ b/arch/mips/include/asm/cpu-features.h
@@ -26,7 +26,9 @@
26#ifndef cpu_has_segments 26#ifndef cpu_has_segments
27#define cpu_has_segments (cpu_data[0].options & MIPS_CPU_SEGMENTS) 27#define cpu_has_segments (cpu_data[0].options & MIPS_CPU_SEGMENTS)
28#endif 28#endif
29 29#ifndef cpu_has_eva
30#define cpu_has_eva (cpu_data[0].options & MIPS_CPU_EVA)
31#endif
30 32
31/* 33/*
32 * For the moment we don't consider R6000 and R8000 so we can assume that 34 * For the moment we don't consider R6000 and R8000 so we can assume that
@@ -299,4 +301,10 @@
299#define cpu_has_vz (cpu_data[0].ases & MIPS_ASE_VZ) 301#define cpu_has_vz (cpu_data[0].ases & MIPS_ASE_VZ)
300#endif 302#endif
301 303
304#if defined(CONFIG_CPU_HAS_MSA) && !defined(cpu_has_msa)
305# define cpu_has_msa (cpu_data[0].ases & MIPS_ASE_MSA)
306#elif !defined(cpu_has_msa)
307# define cpu_has_msa 0
308#endif
309
302#endif /* __ASM_CPU_FEATURES_H */ 310#endif /* __ASM_CPU_FEATURES_H */
diff --git a/arch/mips/include/asm/cpu-info.h b/arch/mips/include/asm/cpu-info.h
index 8f7adf0ac1e3..dc2135be2a3a 100644
--- a/arch/mips/include/asm/cpu-info.h
+++ b/arch/mips/include/asm/cpu-info.h
@@ -49,6 +49,7 @@ struct cpuinfo_mips {
49 unsigned long ases; 49 unsigned long ases;
50 unsigned int processor_id; 50 unsigned int processor_id;
51 unsigned int fpu_id; 51 unsigned int fpu_id;
52 unsigned int msa_id;
52 unsigned int cputype; 53 unsigned int cputype;
53 int isa_level; 54 int isa_level;
54 int tlbsize; 55 int tlbsize;
@@ -95,4 +96,31 @@ extern void cpu_report(void);
95extern const char *__cpu_name[]; 96extern const char *__cpu_name[];
96#define cpu_name_string() __cpu_name[smp_processor_id()] 97#define cpu_name_string() __cpu_name[smp_processor_id()]
97 98
99struct seq_file;
100struct notifier_block;
101
102extern int register_proc_cpuinfo_notifier(struct notifier_block *nb);
103extern int proc_cpuinfo_notifier_call_chain(unsigned long val, void *v);
104
105#define proc_cpuinfo_notifier(fn, pri) \
106({ \
107 static struct notifier_block fn##_nb = { \
108 .notifier_call = fn, \
109 .priority = pri \
110 }; \
111 \
112 register_proc_cpuinfo_notifier(&fn##_nb); \
113})
114
115struct proc_cpuinfo_notifier_args {
116 struct seq_file *m;
117 unsigned long n;
118};
119
120#if defined(CONFIG_MIPS_MT_SMP) || defined(CONFIG_MIPS_MT_SMTC)
121# define cpu_vpe_id(cpuinfo) ((cpuinfo)->vpe_id)
122#else
123# define cpu_vpe_id(cpuinfo) 0
124#endif
125
98#endif /* __ASM_CPU_INFO_H */ 126#endif /* __ASM_CPU_INFO_H */
diff --git a/arch/mips/include/asm/cpu-type.h b/arch/mips/include/asm/cpu-type.h
index 02f591bd95ca..721906130a57 100644
--- a/arch/mips/include/asm/cpu-type.h
+++ b/arch/mips/include/asm/cpu-type.h
@@ -20,6 +20,10 @@ static inline int __pure __get_cpu_type(const int cpu_type)
20 case CPU_LOONGSON2: 20 case CPU_LOONGSON2:
21#endif 21#endif
22 22
23#ifdef CONFIG_SYS_HAS_CPU_LOONGSON3
24 case CPU_LOONGSON3:
25#endif
26
23#ifdef CONFIG_SYS_HAS_CPU_LOONGSON1B 27#ifdef CONFIG_SYS_HAS_CPU_LOONGSON1B
24 case CPU_LOONGSON1: 28 case CPU_LOONGSON1:
25#endif 29#endif
@@ -46,6 +50,8 @@ static inline int __pure __get_cpu_type(const int cpu_type)
46 case CPU_M14KEC: 50 case CPU_M14KEC:
47 case CPU_INTERAPTIV: 51 case CPU_INTERAPTIV:
48 case CPU_PROAPTIV: 52 case CPU_PROAPTIV:
53 case CPU_P5600:
54 case CPU_M5150:
49#endif 55#endif
50 56
51#ifdef CONFIG_SYS_HAS_CPU_MIPS64_R1 57#ifdef CONFIG_SYS_HAS_CPU_MIPS64_R1
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
index 76411df3d971..530eb8b3a68e 100644
--- a/arch/mips/include/asm/cpu.h
+++ b/arch/mips/include/asm/cpu.h
@@ -82,10 +82,10 @@
82#define PRID_IMP_RM7000 0x2700 82#define PRID_IMP_RM7000 0x2700
83#define PRID_IMP_NEVADA 0x2800 /* RM5260 ??? */ 83#define PRID_IMP_NEVADA 0x2800 /* RM5260 ??? */
84#define PRID_IMP_RM9000 0x3400 84#define PRID_IMP_RM9000 0x3400
85#define PRID_IMP_LOONGSON1 0x4200 85#define PRID_IMP_LOONGSON_32 0x4200 /* Loongson-1 */
86#define PRID_IMP_R5432 0x5400 86#define PRID_IMP_R5432 0x5400
87#define PRID_IMP_R5500 0x5500 87#define PRID_IMP_R5500 0x5500
88#define PRID_IMP_LOONGSON2 0x6300 88#define PRID_IMP_LOONGSON_64 0x6300 /* Loongson-2/3 */
89 89
90#define PRID_IMP_UNKNOWN 0xff00 90#define PRID_IMP_UNKNOWN 0xff00
91 91
@@ -115,6 +115,8 @@
115#define PRID_IMP_INTERAPTIV_MP 0xa100 115#define PRID_IMP_INTERAPTIV_MP 0xa100
116#define PRID_IMP_PROAPTIV_UP 0xa200 116#define PRID_IMP_PROAPTIV_UP 0xa200
117#define PRID_IMP_PROAPTIV_MP 0xa300 117#define PRID_IMP_PROAPTIV_MP 0xa300
118#define PRID_IMP_M5150 0xa700
119#define PRID_IMP_P5600 0xa800
118 120
119/* 121/*
120 * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE 122 * These are the PRID's for when 23:16 == PRID_COMP_SIBYTE
@@ -229,6 +231,7 @@
229#define PRID_REV_LOONGSON1B 0x0020 231#define PRID_REV_LOONGSON1B 0x0020
230#define PRID_REV_LOONGSON2E 0x0002 232#define PRID_REV_LOONGSON2E 0x0002
231#define PRID_REV_LOONGSON2F 0x0003 233#define PRID_REV_LOONGSON2F 0x0003
234#define PRID_REV_LOONGSON3A 0x0005
232 235
233/* 236/*
234 * Older processors used to encode processor version and revision in two 237 * Older processors used to encode processor version and revision in two
@@ -296,14 +299,14 @@ enum cpu_type_enum {
296 CPU_4KC, CPU_4KEC, CPU_4KSC, CPU_24K, CPU_34K, CPU_1004K, CPU_74K, 299 CPU_4KC, CPU_4KEC, CPU_4KSC, CPU_24K, CPU_34K, CPU_1004K, CPU_74K,
297 CPU_ALCHEMY, CPU_PR4450, CPU_BMIPS32, CPU_BMIPS3300, CPU_BMIPS4350, 300 CPU_ALCHEMY, CPU_PR4450, CPU_BMIPS32, CPU_BMIPS3300, CPU_BMIPS4350,
298 CPU_BMIPS4380, CPU_BMIPS5000, CPU_JZRISC, CPU_LOONGSON1, CPU_M14KC, 301 CPU_BMIPS4380, CPU_BMIPS5000, CPU_JZRISC, CPU_LOONGSON1, CPU_M14KC,
299 CPU_M14KEC, CPU_INTERAPTIV, CPU_PROAPTIV, 302 CPU_M14KEC, CPU_INTERAPTIV, CPU_P5600, CPU_PROAPTIV, CPU_1074K, CPU_M5150,
300 303
301 /* 304 /*
302 * MIPS64 class processors 305 * MIPS64 class processors
303 */ 306 */
304 CPU_5KC, CPU_5KE, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2, 307 CPU_5KC, CPU_5KE, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2,
305 CPU_CAVIUM_OCTEON, CPU_CAVIUM_OCTEON_PLUS, CPU_CAVIUM_OCTEON2, 308 CPU_LOONGSON3, CPU_CAVIUM_OCTEON, CPU_CAVIUM_OCTEON_PLUS,
306 CPU_CAVIUM_OCTEON3, CPU_XLR, CPU_XLP, 309 CPU_CAVIUM_OCTEON2, CPU_CAVIUM_OCTEON3, CPU_XLR, CPU_XLP,
307 310
308 CPU_LAST 311 CPU_LAST
309}; 312};
@@ -358,6 +361,7 @@ enum cpu_type_enum {
358#define MIPS_CPU_MICROMIPS 0x01000000 /* CPU has microMIPS capability */ 361#define MIPS_CPU_MICROMIPS 0x01000000 /* CPU has microMIPS capability */
359#define MIPS_CPU_TLBINV 0x02000000 /* CPU supports TLBINV/F */ 362#define MIPS_CPU_TLBINV 0x02000000 /* CPU supports TLBINV/F */
360#define MIPS_CPU_SEGMENTS 0x04000000 /* CPU supports Segmentation Control registers */ 363#define MIPS_CPU_SEGMENTS 0x04000000 /* CPU supports Segmentation Control registers */
364#define MIPS_CPU_EVA 0x80000000 /* CPU supports Enhanced Virtual Addressing */
361 365
362/* 366/*
363 * CPU ASE encodings 367 * CPU ASE encodings
@@ -370,5 +374,6 @@ enum cpu_type_enum {
370#define MIPS_ASE_MIPSMT 0x00000020 /* CPU supports MIPS MT */ 374#define MIPS_ASE_MIPSMT 0x00000020 /* CPU supports MIPS MT */
371#define MIPS_ASE_DSP2P 0x00000040 /* Signal Processing ASE Rev 2 */ 375#define MIPS_ASE_DSP2P 0x00000040 /* Signal Processing ASE Rev 2 */
372#define MIPS_ASE_VZ 0x00000080 /* Virtualization ASE */ 376#define MIPS_ASE_VZ 0x00000080 /* Virtualization ASE */
377#define MIPS_ASE_MSA 0x00000100 /* MIPS SIMD Architecture */
373 378
374#endif /* _ASM_CPU_H */ 379#endif /* _ASM_CPU_H */
diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h
index 84238c574d5e..06412aa9e3fb 100644
--- a/arch/mips/include/asm/dma-mapping.h
+++ b/arch/mips/include/asm/dma-mapping.h
@@ -49,9 +49,14 @@ static inline int dma_mapping_error(struct device *dev, u64 mask)
49static inline int 49static inline int
50dma_set_mask(struct device *dev, u64 mask) 50dma_set_mask(struct device *dev, u64 mask)
51{ 51{
52 struct dma_map_ops *ops = get_dma_ops(dev);
53
52 if(!dev->dma_mask || !dma_supported(dev, mask)) 54 if(!dev->dma_mask || !dma_supported(dev, mask))
53 return -EIO; 55 return -EIO;
54 56
57 if (ops->set_dma_mask)
58 return ops->set_dma_mask(dev, mask);
59
55 *dev->dma_mask = mask; 60 *dev->dma_mask = mask;
56 61
57 return 0; 62 return 0;
diff --git a/arch/mips/include/asm/fpu.h b/arch/mips/include/asm/fpu.h
index 58e50cbdb1a6..4d86b72750c7 100644
--- a/arch/mips/include/asm/fpu.h
+++ b/arch/mips/include/asm/fpu.h
@@ -180,7 +180,7 @@ static inline void restore_fp(struct task_struct *tsk)
180 _restore_fp(tsk); 180 _restore_fp(tsk);
181} 181}
182 182
183static inline fpureg_t *get_fpu_regs(struct task_struct *tsk) 183static inline union fpureg *get_fpu_regs(struct task_struct *tsk)
184{ 184{
185 if (tsk == current) { 185 if (tsk == current) {
186 preempt_disable(); 186 preempt_disable();
diff --git a/arch/mips/include/asm/futex.h b/arch/mips/include/asm/futex.h
index 6ea15815d3ee..194cda0396a3 100644
--- a/arch/mips/include/asm/futex.h
+++ b/arch/mips/include/asm/futex.h
@@ -12,6 +12,7 @@
12 12
13#include <linux/futex.h> 13#include <linux/futex.h>
14#include <linux/uaccess.h> 14#include <linux/uaccess.h>
15#include <asm/asm-eva.h>
15#include <asm/barrier.h> 16#include <asm/barrier.h>
16#include <asm/errno.h> 17#include <asm/errno.h>
17#include <asm/war.h> 18#include <asm/war.h>
@@ -22,11 +23,11 @@
22 __asm__ __volatile__( \ 23 __asm__ __volatile__( \
23 " .set push \n" \ 24 " .set push \n" \
24 " .set noat \n" \ 25 " .set noat \n" \
25 " .set mips3 \n" \ 26 " .set arch=r4000 \n" \
26 "1: ll %1, %4 # __futex_atomic_op \n" \ 27 "1: ll %1, %4 # __futex_atomic_op \n" \
27 " .set mips0 \n" \ 28 " .set mips0 \n" \
28 " " insn " \n" \ 29 " " insn " \n" \
29 " .set mips3 \n" \ 30 " .set arch=r4000 \n" \
30 "2: sc $1, %2 \n" \ 31 "2: sc $1, %2 \n" \
31 " beqzl $1, 1b \n" \ 32 " beqzl $1, 1b \n" \
32 __WEAK_LLSC_MB \ 33 __WEAK_LLSC_MB \
@@ -48,12 +49,12 @@
48 __asm__ __volatile__( \ 49 __asm__ __volatile__( \
49 " .set push \n" \ 50 " .set push \n" \
50 " .set noat \n" \ 51 " .set noat \n" \
51 " .set mips3 \n" \ 52 " .set arch=r4000 \n" \
52 "1: ll %1, %4 # __futex_atomic_op \n" \ 53 "1: "user_ll("%1", "%4")" # __futex_atomic_op\n" \
53 " .set mips0 \n" \ 54 " .set mips0 \n" \
54 " " insn " \n" \ 55 " " insn " \n" \
55 " .set mips3 \n" \ 56 " .set arch=r4000 \n" \
56 "2: sc $1, %2 \n" \ 57 "2: "user_sc("$1", "%2")" \n" \
57 " beqz $1, 1b \n" \ 58 " beqz $1, 1b \n" \
58 __WEAK_LLSC_MB \ 59 __WEAK_LLSC_MB \
59 "3: \n" \ 60 "3: \n" \
@@ -146,12 +147,12 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
146 "# futex_atomic_cmpxchg_inatomic \n" 147 "# futex_atomic_cmpxchg_inatomic \n"
147 " .set push \n" 148 " .set push \n"
148 " .set noat \n" 149 " .set noat \n"
149 " .set mips3 \n" 150 " .set arch=r4000 \n"
150 "1: ll %1, %3 \n" 151 "1: ll %1, %3 \n"
151 " bne %1, %z4, 3f \n" 152 " bne %1, %z4, 3f \n"
152 " .set mips0 \n" 153 " .set mips0 \n"
153 " move $1, %z5 \n" 154 " move $1, %z5 \n"
154 " .set mips3 \n" 155 " .set arch=r4000 \n"
155 "2: sc $1, %2 \n" 156 "2: sc $1, %2 \n"
156 " beqzl $1, 1b \n" 157 " beqzl $1, 1b \n"
157 __WEAK_LLSC_MB 158 __WEAK_LLSC_MB
@@ -173,13 +174,13 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
173 "# futex_atomic_cmpxchg_inatomic \n" 174 "# futex_atomic_cmpxchg_inatomic \n"
174 " .set push \n" 175 " .set push \n"
175 " .set noat \n" 176 " .set noat \n"
176 " .set mips3 \n" 177 " .set arch=r4000 \n"
177 "1: ll %1, %3 \n" 178 "1: "user_ll("%1", "%3")" \n"
178 " bne %1, %z4, 3f \n" 179 " bne %1, %z4, 3f \n"
179 " .set mips0 \n" 180 " .set mips0 \n"
180 " move $1, %z5 \n" 181 " move $1, %z5 \n"
181 " .set mips3 \n" 182 " .set arch=r4000 \n"
182 "2: sc $1, %2 \n" 183 "2: "user_sc("$1", "%2")" \n"
183 " beqz $1, 1b \n" 184 " beqz $1, 1b \n"
184 __WEAK_LLSC_MB 185 __WEAK_LLSC_MB
185 "3: \n" 186 "3: \n"
diff --git a/arch/mips/include/asm/fw/fw.h b/arch/mips/include/asm/fw/fw.h
index d6c50a7e9ede..f3e6978aad70 100644
--- a/arch/mips/include/asm/fw/fw.h
+++ b/arch/mips/include/asm/fw/fw.h
@@ -38,7 +38,7 @@ extern int *_fw_envp;
38 38
39extern void fw_init_cmdline(void); 39extern void fw_init_cmdline(void);
40extern char *fw_getcmdline(void); 40extern char *fw_getcmdline(void);
41extern fw_memblock_t *fw_getmdesc(void); 41extern fw_memblock_t *fw_getmdesc(int);
42extern void fw_meminit(void); 42extern void fw_meminit(void);
43extern char *fw_getenv(char *name); 43extern char *fw_getenv(char *name);
44extern unsigned long fw_getenvl(char *name); 44extern unsigned long fw_getenvl(char *name);
diff --git a/arch/mips/include/asm/gcmpregs.h b/arch/mips/include/asm/gcmpregs.h
deleted file mode 100644
index a7359f77a48e..000000000000
--- a/arch/mips/include/asm/gcmpregs.h
+++ /dev/null
@@ -1,125 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2000, 07 MIPS Technologies, Inc.
7 *
8 * Multiprocessor Subsystem Register Definitions
9 *
10 */
11#ifndef _ASM_GCMPREGS_H
12#define _ASM_GCMPREGS_H
13
14
15/* Offsets to major blocks within GCMP from GCMP base */
16#define GCMP_GCB_OFS 0x0000 /* Global Control Block */
17#define GCMP_CLCB_OFS 0x2000 /* Core Local Control Block */
18#define GCMP_COCB_OFS 0x4000 /* Core Other Control Block */
19#define GCMP_GDB_OFS 0x8000 /* Global Debug Block */
20
21/* Offsets to individual GCMP registers from GCMP base */
22#define GCMPOFS(block, tag, reg) \
23 (GCMP_##block##_OFS + GCMP_##tag##_##reg##_OFS)
24#define GCMPOFSn(block, tag, reg, n) \
25 (GCMP_##block##_OFS + GCMP_##tag##_##reg##_OFS(n))
26
27#define GCMPGCBOFS(reg) GCMPOFS(GCB, GCB, reg)
28#define GCMPGCBOFSn(reg, n) GCMPOFSn(GCB, GCB, reg, n)
29#define GCMPCLCBOFS(reg) GCMPOFS(CLCB, CCB, reg)
30#define GCMPCOCBOFS(reg) GCMPOFS(COCB, CCB, reg)
31#define GCMPGDBOFS(reg) GCMPOFS(GDB, GDB, reg)
32
33/* GCMP register access */
34#define GCMPGCB(reg) REGP(_gcmp_base, GCMPGCBOFS(reg))
35#define GCMPGCBn(reg, n) REGP(_gcmp_base, GCMPGCBOFSn(reg, n))
36#define GCMPCLCB(reg) REGP(_gcmp_base, GCMPCLCBOFS(reg))
37#define GCMPCOCB(reg) REGP(_gcmp_base, GCMPCOCBOFS(reg))
38#define GCMPGDB(reg) REGP(_gcmp_base, GCMPGDBOFS(reg))
39
40/* Mask generation */
41#define GCMPMSK(block, reg, bits) (MSK(bits)<<GCMP_##block##_##reg##_SHF)
42#define GCMPGCBMSK(reg, bits) GCMPMSK(GCB, reg, bits)
43#define GCMPCCBMSK(reg, bits) GCMPMSK(CCB, reg, bits)
44#define GCMPGDBMSK(reg, bits) GCMPMSK(GDB, reg, bits)
45
46/* GCB registers */
47#define GCMP_GCB_GC_OFS 0x0000 /* Global Config Register */
48#define GCMP_GCB_GC_NUMIOCU_SHF 8
49#define GCMP_GCB_GC_NUMIOCU_MSK GCMPGCBMSK(GC_NUMIOCU, 4)
50#define GCMP_GCB_GC_NUMCORES_SHF 0
51#define GCMP_GCB_GC_NUMCORES_MSK GCMPGCBMSK(GC_NUMCORES, 8)
52#define GCMP_GCB_GCMPB_OFS 0x0008 /* Global GCMP Base */
53#define GCMP_GCB_GCMPB_GCMPBASE_SHF 15
54#define GCMP_GCB_GCMPB_GCMPBASE_MSK GCMPGCBMSK(GCMPB_GCMPBASE, 17)
55#define GCMP_GCB_GCMPB_CMDEFTGT_SHF 0
56#define GCMP_GCB_GCMPB_CMDEFTGT_MSK GCMPGCBMSK(GCMPB_CMDEFTGT, 2)
57#define GCMP_GCB_GCMPB_CMDEFTGT_DISABLED 0
58#define GCMP_GCB_GCMPB_CMDEFTGT_MEM 1
59#define GCMP_GCB_GCMPB_CMDEFTGT_IOCU1 2
60#define GCMP_GCB_GCMPB_CMDEFTGT_IOCU2 3
61#define GCMP_GCB_CCMC_OFS 0x0010 /* Global CM Control */
62#define GCMP_GCB_GCSRAP_OFS 0x0020 /* Global CSR Access Privilege */
63#define GCMP_GCB_GCSRAP_CMACCESS_SHF 0
64#define GCMP_GCB_GCSRAP_CMACCESS_MSK GCMPGCBMSK(GCSRAP_CMACCESS, 8)
65#define GCMP_GCB_GCMPREV_OFS 0x0030 /* GCMP Revision Register */
66#define GCMP_GCB_GCMEM_OFS 0x0040 /* Global CM Error Mask */
67#define GCMP_GCB_GCMEC_OFS 0x0048 /* Global CM Error Cause */
68#define GCMP_GCB_GMEC_ERROR_TYPE_SHF 27
69#define GCMP_GCB_GMEC_ERROR_TYPE_MSK GCMPGCBMSK(GMEC_ERROR_TYPE, 5)
70#define GCMP_GCB_GMEC_ERROR_INFO_SHF 0
71#define GCMP_GCB_GMEC_ERROR_INFO_MSK GCMPGCBMSK(GMEC_ERROR_INFO, 27)
72#define GCMP_GCB_GCMEA_OFS 0x0050 /* Global CM Error Address */
73#define GCMP_GCB_GCMEO_OFS 0x0058 /* Global CM Error Multiple */
74#define GCMP_GCB_GMEO_ERROR_2ND_SHF 0
75#define GCMP_GCB_GMEO_ERROR_2ND_MSK GCMPGCBMSK(GMEO_ERROR_2ND, 5)
76#define GCMP_GCB_GICBA_OFS 0x0080 /* Global Interrupt Controller Base Address */
77#define GCMP_GCB_GICBA_BASE_SHF 17
78#define GCMP_GCB_GICBA_BASE_MSK GCMPGCBMSK(GICBA_BASE, 15)
79#define GCMP_GCB_GICBA_EN_SHF 0
80#define GCMP_GCB_GICBA_EN_MSK GCMPGCBMSK(GICBA_EN, 1)
81
82/* GCB Regions */
83#define GCMP_GCB_CMxBASE_OFS(n) (0x0090+16*(n)) /* Global Region[0-3] Base Address */
84#define GCMP_GCB_CMxBASE_BASE_SHF 16
85#define GCMP_GCB_CMxBASE_BASE_MSK GCMPGCBMSK(CMxBASE_BASE, 16)
86#define GCMP_GCB_CMxMASK_OFS(n) (0x0098+16*(n)) /* Global Region[0-3] Address Mask */
87#define GCMP_GCB_CMxMASK_MASK_SHF 16
88#define GCMP_GCB_CMxMASK_MASK_MSK GCMPGCBMSK(CMxMASK_MASK, 16)
89#define GCMP_GCB_CMxMASK_CMREGTGT_SHF 0
90#define GCMP_GCB_CMxMASK_CMREGTGT_MSK GCMPGCBMSK(CMxMASK_CMREGTGT, 2)
91#define GCMP_GCB_CMxMASK_CMREGTGT_MEM 0
92#define GCMP_GCB_CMxMASK_CMREGTGT_MEM1 1
93#define GCMP_GCB_CMxMASK_CMREGTGT_IOCU1 2
94#define GCMP_GCB_CMxMASK_CMREGTGT_IOCU2 3
95
96
97/* Core local/Core other control block registers */
98#define GCMP_CCB_RESETR_OFS 0x0000 /* Reset Release */
99#define GCMP_CCB_RESETR_INRESET_SHF 0
100#define GCMP_CCB_RESETR_INRESET_MSK GCMPCCBMSK(RESETR_INRESET, 16)
101#define GCMP_CCB_COHCTL_OFS 0x0008 /* Coherence Control */
102#define GCMP_CCB_COHCTL_DOMAIN_SHF 0
103#define GCMP_CCB_COHCTL_DOMAIN_MSK GCMPCCBMSK(COHCTL_DOMAIN, 8)
104#define GCMP_CCB_CFG_OFS 0x0010 /* Config */
105#define GCMP_CCB_CFG_IOCUTYPE_SHF 10
106#define GCMP_CCB_CFG_IOCUTYPE_MSK GCMPCCBMSK(CFG_IOCUTYPE, 2)
107#define GCMP_CCB_CFG_IOCUTYPE_CPU 0
108#define GCMP_CCB_CFG_IOCUTYPE_NCIOCU 1
109#define GCMP_CCB_CFG_IOCUTYPE_CIOCU 2
110#define GCMP_CCB_CFG_NUMVPE_SHF 0
111#define GCMP_CCB_CFG_NUMVPE_MSK GCMPCCBMSK(CFG_NUMVPE, 10)
112#define GCMP_CCB_OTHER_OFS 0x0018 /* Other Address */
113#define GCMP_CCB_OTHER_CORENUM_SHF 16
114#define GCMP_CCB_OTHER_CORENUM_MSK GCMPCCBMSK(OTHER_CORENUM, 16)
115#define GCMP_CCB_RESETBASE_OFS 0x0020 /* Reset Exception Base */
116#define GCMP_CCB_RESETBASE_BEV_SHF 12
117#define GCMP_CCB_RESETBASE_BEV_MSK GCMPCCBMSK(RESETBASE_BEV, 20)
118#define GCMP_CCB_ID_OFS 0x0028 /* Identification */
119#define GCMP_CCB_DINTGROUP_OFS 0x0030 /* DINT Group Participate */
120#define GCMP_CCB_DBGGROUP_OFS 0x0100 /* DebugBreak Group */
121
122extern int __init gcmp_probe(unsigned long, unsigned long);
123extern int __init gcmp_niocu(void);
124extern void __init gcmp_setregion(int, unsigned long, unsigned long, int);
125#endif /* _ASM_GCMPREGS_H */
diff --git a/arch/mips/include/asm/gic.h b/arch/mips/include/asm/gic.h
index b2e3e93dd7d8..082716690589 100644
--- a/arch/mips/include/asm/gic.h
+++ b/arch/mips/include/asm/gic.h
@@ -11,6 +11,9 @@
11#ifndef _ASM_GICREGS_H 11#ifndef _ASM_GICREGS_H
12#define _ASM_GICREGS_H 12#define _ASM_GICREGS_H
13 13
14#include <linux/bitmap.h>
15#include <linux/threads.h>
16
14#undef GICISBYTELITTLEENDIAN 17#undef GICISBYTELITTLEENDIAN
15 18
16/* Constants */ 19/* Constants */
diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h
index 3321dd5a8872..933b50e125a0 100644
--- a/arch/mips/include/asm/io.h
+++ b/arch/mips/include/asm/io.h
@@ -331,7 +331,7 @@ static inline void pfx##write##bwlq(type val, \
331 if (irq) \ 331 if (irq) \
332 local_irq_save(__flags); \ 332 local_irq_save(__flags); \
333 __asm__ __volatile__( \ 333 __asm__ __volatile__( \
334 ".set mips3" "\t\t# __writeq""\n\t" \ 334 ".set arch=r4000" "\t\t# __writeq""\n\t" \
335 "dsll32 %L0, %L0, 0" "\n\t" \ 335 "dsll32 %L0, %L0, 0" "\n\t" \
336 "dsrl32 %L0, %L0, 0" "\n\t" \ 336 "dsrl32 %L0, %L0, 0" "\n\t" \
337 "dsll32 %M0, %M0, 0" "\n\t" \ 337 "dsll32 %M0, %M0, 0" "\n\t" \
@@ -361,7 +361,7 @@ static inline type pfx##read##bwlq(const volatile void __iomem *mem) \
361 if (irq) \ 361 if (irq) \
362 local_irq_save(__flags); \ 362 local_irq_save(__flags); \
363 __asm__ __volatile__( \ 363 __asm__ __volatile__( \
364 ".set mips3" "\t\t# __readq" "\n\t" \ 364 ".set arch=r4000" "\t\t# __readq" "\n\t" \
365 "ld %L0, %1" "\n\t" \ 365 "ld %L0, %1" "\n\t" \
366 "dsra32 %M0, %L0, 0" "\n\t" \ 366 "dsra32 %M0, %L0, 0" "\n\t" \
367 "sll %L0, %L0, 0" "\n\t" \ 367 "sll %L0, %L0, 0" "\n\t" \
@@ -584,7 +584,7 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int
584 * 584 *
585 * This API used to be exported; it now is for arch code internal use only. 585 * This API used to be exported; it now is for arch code internal use only.
586 */ 586 */
587#ifdef CONFIG_DMA_NONCOHERENT 587#if defined(CONFIG_DMA_NONCOHERENT) || defined(CONFIG_DMA_MAYBE_COHERENT)
588 588
589extern void (*_dma_cache_wback_inv)(unsigned long start, unsigned long size); 589extern void (*_dma_cache_wback_inv)(unsigned long start, unsigned long size);
590extern void (*_dma_cache_wback)(unsigned long start, unsigned long size); 590extern void (*_dma_cache_wback)(unsigned long start, unsigned long size);
@@ -603,7 +603,7 @@ extern void (*_dma_cache_inv)(unsigned long start, unsigned long size);
603#define dma_cache_inv(start,size) \ 603#define dma_cache_inv(start,size) \
604 do { (void) (start); (void) (size); } while (0) 604 do { (void) (start); (void) (size); } while (0)
605 605
606#endif /* CONFIG_DMA_NONCOHERENT */ 606#endif /* CONFIG_DMA_NONCOHERENT || CONFIG_DMA_MAYBE_COHERENT */
607 607
608/* 608/*
609 * Read a 32-bit register that requires a 64-bit read cycle on the bus. 609 * Read a 32-bit register that requires a 64-bit read cycle on the bus.
diff --git a/arch/mips/include/asm/kvm_host.h b/arch/mips/include/asm/kvm_host.h
index a995fce87791..060aaa6348d7 100644
--- a/arch/mips/include/asm/kvm_host.h
+++ b/arch/mips/include/asm/kvm_host.h
@@ -30,16 +30,16 @@
30 30
31 31
32/* Special address that contains the comm page, used for reducing # of traps */ 32/* Special address that contains the comm page, used for reducing # of traps */
33#define KVM_GUEST_COMMPAGE_ADDR 0x0 33#define KVM_GUEST_COMMPAGE_ADDR 0x0
34 34
35#define KVM_GUEST_KERNEL_MODE(vcpu) ((kvm_read_c0_guest_status(vcpu->arch.cop0) & (ST0_EXL | ST0_ERL)) || \ 35#define KVM_GUEST_KERNEL_MODE(vcpu) ((kvm_read_c0_guest_status(vcpu->arch.cop0) & (ST0_EXL | ST0_ERL)) || \
36 ((kvm_read_c0_guest_status(vcpu->arch.cop0) & KSU_USER) == 0)) 36 ((kvm_read_c0_guest_status(vcpu->arch.cop0) & KSU_USER) == 0))
37 37
38#define KVM_GUEST_KUSEG 0x00000000UL 38#define KVM_GUEST_KUSEG 0x00000000UL
39#define KVM_GUEST_KSEG0 0x40000000UL 39#define KVM_GUEST_KSEG0 0x40000000UL
40#define KVM_GUEST_KSEG23 0x60000000UL 40#define KVM_GUEST_KSEG23 0x60000000UL
41#define KVM_GUEST_KSEGX(a) ((_ACAST32_(a)) & 0x60000000) 41#define KVM_GUEST_KSEGX(a) ((_ACAST32_(a)) & 0x60000000)
42#define KVM_GUEST_CPHYSADDR(a) ((_ACAST32_(a)) & 0x1fffffff) 42#define KVM_GUEST_CPHYSADDR(a) ((_ACAST32_(a)) & 0x1fffffff)
43 43
44#define KVM_GUEST_CKSEG0ADDR(a) (KVM_GUEST_CPHYSADDR(a) | KVM_GUEST_KSEG0) 44#define KVM_GUEST_CKSEG0ADDR(a) (KVM_GUEST_CPHYSADDR(a) | KVM_GUEST_KSEG0)
45#define KVM_GUEST_CKSEG1ADDR(a) (KVM_GUEST_CPHYSADDR(a) | KVM_GUEST_KSEG1) 45#define KVM_GUEST_CKSEG1ADDR(a) (KVM_GUEST_CPHYSADDR(a) | KVM_GUEST_KSEG1)
@@ -52,17 +52,17 @@
52#define KVM_GUEST_KSEG1ADDR(a) (KVM_GUEST_CPHYSADDR(a) | KVM_GUEST_KSEG1) 52#define KVM_GUEST_KSEG1ADDR(a) (KVM_GUEST_CPHYSADDR(a) | KVM_GUEST_KSEG1)
53#define KVM_GUEST_KSEG23ADDR(a) (KVM_GUEST_CPHYSADDR(a) | KVM_GUEST_KSEG23) 53#define KVM_GUEST_KSEG23ADDR(a) (KVM_GUEST_CPHYSADDR(a) | KVM_GUEST_KSEG23)
54 54
55#define KVM_INVALID_PAGE 0xdeadbeef 55#define KVM_INVALID_PAGE 0xdeadbeef
56#define KVM_INVALID_INST 0xdeadbeef 56#define KVM_INVALID_INST 0xdeadbeef
57#define KVM_INVALID_ADDR 0xdeadbeef 57#define KVM_INVALID_ADDR 0xdeadbeef
58 58
59#define KVM_MALTA_GUEST_RTC_ADDR 0xb8000070UL 59#define KVM_MALTA_GUEST_RTC_ADDR 0xb8000070UL
60 60
61#define GUEST_TICKS_PER_JIFFY (40000000/HZ) 61#define GUEST_TICKS_PER_JIFFY (40000000/HZ)
62#define MS_TO_NS(x) (x * 1E6L) 62#define MS_TO_NS(x) (x * 1E6L)
63 63
64#define CAUSEB_DC 27 64#define CAUSEB_DC 27
65#define CAUSEF_DC (_ULCAST_(1) << 27) 65#define CAUSEF_DC (_ULCAST_(1) << 27)
66 66
67struct kvm; 67struct kvm;
68struct kvm_run; 68struct kvm_run;
@@ -126,8 +126,8 @@ struct kvm_arch {
126 int commpage_tlb; 126 int commpage_tlb;
127}; 127};
128 128
129#define N_MIPS_COPROC_REGS 32 129#define N_MIPS_COPROC_REGS 32
130#define N_MIPS_COPROC_SEL 8 130#define N_MIPS_COPROC_SEL 8
131 131
132struct mips_coproc { 132struct mips_coproc {
133 unsigned long reg[N_MIPS_COPROC_REGS][N_MIPS_COPROC_SEL]; 133 unsigned long reg[N_MIPS_COPROC_REGS][N_MIPS_COPROC_SEL];
@@ -139,124 +139,124 @@ struct mips_coproc {
139/* 139/*
140 * Coprocessor 0 register names 140 * Coprocessor 0 register names
141 */ 141 */
142#define MIPS_CP0_TLB_INDEX 0 142#define MIPS_CP0_TLB_INDEX 0
143#define MIPS_CP0_TLB_RANDOM 1 143#define MIPS_CP0_TLB_RANDOM 1
144#define MIPS_CP0_TLB_LOW 2 144#define MIPS_CP0_TLB_LOW 2
145#define MIPS_CP0_TLB_LO0 2 145#define MIPS_CP0_TLB_LO0 2
146#define MIPS_CP0_TLB_LO1 3 146#define MIPS_CP0_TLB_LO1 3
147#define MIPS_CP0_TLB_CONTEXT 4 147#define MIPS_CP0_TLB_CONTEXT 4
148#define MIPS_CP0_TLB_PG_MASK 5 148#define MIPS_CP0_TLB_PG_MASK 5
149#define MIPS_CP0_TLB_WIRED 6 149#define MIPS_CP0_TLB_WIRED 6
150#define MIPS_CP0_HWRENA 7 150#define MIPS_CP0_HWRENA 7
151#define MIPS_CP0_BAD_VADDR 8 151#define MIPS_CP0_BAD_VADDR 8
152#define MIPS_CP0_COUNT 9 152#define MIPS_CP0_COUNT 9
153#define MIPS_CP0_TLB_HI 10 153#define MIPS_CP0_TLB_HI 10
154#define MIPS_CP0_COMPARE 11 154#define MIPS_CP0_COMPARE 11
155#define MIPS_CP0_STATUS 12 155#define MIPS_CP0_STATUS 12
156#define MIPS_CP0_CAUSE 13 156#define MIPS_CP0_CAUSE 13
157#define MIPS_CP0_EXC_PC 14 157#define MIPS_CP0_EXC_PC 14
158#define MIPS_CP0_PRID 15 158#define MIPS_CP0_PRID 15
159#define MIPS_CP0_CONFIG 16 159#define MIPS_CP0_CONFIG 16
160#define MIPS_CP0_LLADDR 17 160#define MIPS_CP0_LLADDR 17
161#define MIPS_CP0_WATCH_LO 18 161#define MIPS_CP0_WATCH_LO 18
162#define MIPS_CP0_WATCH_HI 19 162#define MIPS_CP0_WATCH_HI 19
163#define MIPS_CP0_TLB_XCONTEXT 20 163#define MIPS_CP0_TLB_XCONTEXT 20
164#define MIPS_CP0_ECC 26 164#define MIPS_CP0_ECC 26
165#define MIPS_CP0_CACHE_ERR 27 165#define MIPS_CP0_CACHE_ERR 27
166#define MIPS_CP0_TAG_LO 28 166#define MIPS_CP0_TAG_LO 28
167#define MIPS_CP0_TAG_HI 29 167#define MIPS_CP0_TAG_HI 29
168#define MIPS_CP0_ERROR_PC 30 168#define MIPS_CP0_ERROR_PC 30
169#define MIPS_CP0_DEBUG 23 169#define MIPS_CP0_DEBUG 23
170#define MIPS_CP0_DEPC 24 170#define MIPS_CP0_DEPC 24
171#define MIPS_CP0_PERFCNT 25 171#define MIPS_CP0_PERFCNT 25
172#define MIPS_CP0_ERRCTL 26 172#define MIPS_CP0_ERRCTL 26
173#define MIPS_CP0_DATA_LO 28 173#define MIPS_CP0_DATA_LO 28
174#define MIPS_CP0_DATA_HI 29 174#define MIPS_CP0_DATA_HI 29
175#define MIPS_CP0_DESAVE 31 175#define MIPS_CP0_DESAVE 31
176 176
177#define MIPS_CP0_CONFIG_SEL 0 177#define MIPS_CP0_CONFIG_SEL 0
178#define MIPS_CP0_CONFIG1_SEL 1 178#define MIPS_CP0_CONFIG1_SEL 1
179#define MIPS_CP0_CONFIG2_SEL 2 179#define MIPS_CP0_CONFIG2_SEL 2
180#define MIPS_CP0_CONFIG3_SEL 3 180#define MIPS_CP0_CONFIG3_SEL 3
181 181
182/* Config0 register bits */ 182/* Config0 register bits */
183#define CP0C0_M 31 183#define CP0C0_M 31
184#define CP0C0_K23 28 184#define CP0C0_K23 28
185#define CP0C0_KU 25 185#define CP0C0_KU 25
186#define CP0C0_MDU 20 186#define CP0C0_MDU 20
187#define CP0C0_MM 17 187#define CP0C0_MM 17
188#define CP0C0_BM 16 188#define CP0C0_BM 16
189#define CP0C0_BE 15 189#define CP0C0_BE 15
190#define CP0C0_AT 13 190#define CP0C0_AT 13
191#define CP0C0_AR 10 191#define CP0C0_AR 10
192#define CP0C0_MT 7 192#define CP0C0_MT 7
193#define CP0C0_VI 3 193#define CP0C0_VI 3
194#define CP0C0_K0 0 194#define CP0C0_K0 0
195 195
196/* Config1 register bits */ 196/* Config1 register bits */
197#define CP0C1_M 31 197#define CP0C1_M 31
198#define CP0C1_MMU 25 198#define CP0C1_MMU 25
199#define CP0C1_IS 22 199#define CP0C1_IS 22
200#define CP0C1_IL 19 200#define CP0C1_IL 19
201#define CP0C1_IA 16 201#define CP0C1_IA 16
202#define CP0C1_DS 13 202#define CP0C1_DS 13
203#define CP0C1_DL 10 203#define CP0C1_DL 10
204#define CP0C1_DA 7 204#define CP0C1_DA 7
205#define CP0C1_C2 6 205#define CP0C1_C2 6
206#define CP0C1_MD 5 206#define CP0C1_MD 5
207#define CP0C1_PC 4 207#define CP0C1_PC 4
208#define CP0C1_WR 3 208#define CP0C1_WR 3
209#define CP0C1_CA 2 209#define CP0C1_CA 2
210#define CP0C1_EP 1 210#define CP0C1_EP 1
211#define CP0C1_FP 0 211#define CP0C1_FP 0
212 212
213/* Config2 Register bits */ 213/* Config2 Register bits */
214#define CP0C2_M 31 214#define CP0C2_M 31
215#define CP0C2_TU 28 215#define CP0C2_TU 28
216#define CP0C2_TS 24 216#define CP0C2_TS 24
217#define CP0C2_TL 20 217#define CP0C2_TL 20
218#define CP0C2_TA 16 218#define CP0C2_TA 16
219#define CP0C2_SU 12 219#define CP0C2_SU 12
220#define CP0C2_SS 8 220#define CP0C2_SS 8
221#define CP0C2_SL 4 221#define CP0C2_SL 4
222#define CP0C2_SA 0 222#define CP0C2_SA 0
223 223
224/* Config3 Register bits */ 224/* Config3 Register bits */
225#define CP0C3_M 31 225#define CP0C3_M 31
226#define CP0C3_ISA_ON_EXC 16 226#define CP0C3_ISA_ON_EXC 16
227#define CP0C3_ULRI 13 227#define CP0C3_ULRI 13
228#define CP0C3_DSPP 10 228#define CP0C3_DSPP 10
229#define CP0C3_LPA 7 229#define CP0C3_LPA 7
230#define CP0C3_VEIC 6 230#define CP0C3_VEIC 6
231#define CP0C3_VInt 5 231#define CP0C3_VInt 5
232#define CP0C3_SP 4 232#define CP0C3_SP 4
233#define CP0C3_MT 2 233#define CP0C3_MT 2
234#define CP0C3_SM 1 234#define CP0C3_SM 1
235#define CP0C3_TL 0 235#define CP0C3_TL 0
236 236
237/* Have config1, Cacheable, noncoherent, write-back, write allocate*/ 237/* Have config1, Cacheable, noncoherent, write-back, write allocate*/
238#define MIPS_CONFIG0 \ 238#define MIPS_CONFIG0 \
239 ((1 << CP0C0_M) | (0x3 << CP0C0_K0)) 239 ((1 << CP0C0_M) | (0x3 << CP0C0_K0))
240 240
241/* Have config2, no coprocessor2 attached, no MDMX support attached, 241/* Have config2, no coprocessor2 attached, no MDMX support attached,
242 no performance counters, watch registers present, 242 no performance counters, watch registers present,
243 no code compression, EJTAG present, no FPU, no watch registers */ 243 no code compression, EJTAG present, no FPU, no watch registers */
244#define MIPS_CONFIG1 \ 244#define MIPS_CONFIG1 \
245((1 << CP0C1_M) | \ 245((1 << CP0C1_M) | \
246 (0 << CP0C1_C2) | (0 << CP0C1_MD) | (0 << CP0C1_PC) | \ 246 (0 << CP0C1_C2) | (0 << CP0C1_MD) | (0 << CP0C1_PC) | \
247 (0 << CP0C1_WR) | (0 << CP0C1_CA) | (1 << CP0C1_EP) | \ 247 (0 << CP0C1_WR) | (0 << CP0C1_CA) | (1 << CP0C1_EP) | \
248 (0 << CP0C1_FP)) 248 (0 << CP0C1_FP))
249 249
250/* Have config3, no tertiary/secondary caches implemented */ 250/* Have config3, no tertiary/secondary caches implemented */
251#define MIPS_CONFIG2 \ 251#define MIPS_CONFIG2 \
252((1 << CP0C2_M)) 252((1 << CP0C2_M))
253 253
254/* No config4, no DSP ASE, no large physaddr (PABITS), 254/* No config4, no DSP ASE, no large physaddr (PABITS),
255 no external interrupt controller, no vectored interrupts, 255 no external interrupt controller, no vectored interrupts,
256 no 1kb pages, no SmartMIPS ASE, no trace logic */ 256 no 1kb pages, no SmartMIPS ASE, no trace logic */
257#define MIPS_CONFIG3 \ 257#define MIPS_CONFIG3 \
258((0 << CP0C3_M) | (0 << CP0C3_DSPP) | (0 << CP0C3_LPA) | \ 258((0 << CP0C3_M) | (0 << CP0C3_DSPP) | (0 << CP0C3_LPA) | \
259 (0 << CP0C3_VEIC) | (0 << CP0C3_VInt) | (0 << CP0C3_SP) | \ 259 (0 << CP0C3_VEIC) | (0 << CP0C3_VInt) | (0 << CP0C3_SP) | \
260 (0 << CP0C3_SM) | (0 << CP0C3_TL)) 260 (0 << CP0C3_SM) | (0 << CP0C3_TL))
261 261
262/* MMU types, the first four entries have the same layout as the 262/* MMU types, the first four entries have the same layout as the
@@ -274,36 +274,36 @@ enum mips_mmu_types {
274/* 274/*
275 * Trap codes 275 * Trap codes
276 */ 276 */
277#define T_INT 0 /* Interrupt pending */ 277#define T_INT 0 /* Interrupt pending */
278#define T_TLB_MOD 1 /* TLB modified fault */ 278#define T_TLB_MOD 1 /* TLB modified fault */
279#define T_TLB_LD_MISS 2 /* TLB miss on load or ifetch */ 279#define T_TLB_LD_MISS 2 /* TLB miss on load or ifetch */
280#define T_TLB_ST_MISS 3 /* TLB miss on a store */ 280#define T_TLB_ST_MISS 3 /* TLB miss on a store */
281#define T_ADDR_ERR_LD 4 /* Address error on a load or ifetch */ 281#define T_ADDR_ERR_LD 4 /* Address error on a load or ifetch */
282#define T_ADDR_ERR_ST 5 /* Address error on a store */ 282#define T_ADDR_ERR_ST 5 /* Address error on a store */
283#define T_BUS_ERR_IFETCH 6 /* Bus error on an ifetch */ 283#define T_BUS_ERR_IFETCH 6 /* Bus error on an ifetch */
284#define T_BUS_ERR_LD_ST 7 /* Bus error on a load or store */ 284#define T_BUS_ERR_LD_ST 7 /* Bus error on a load or store */
285#define T_SYSCALL 8 /* System call */ 285#define T_SYSCALL 8 /* System call */
286#define T_BREAK 9 /* Breakpoint */ 286#define T_BREAK 9 /* Breakpoint */
287#define T_RES_INST 10 /* Reserved instruction exception */ 287#define T_RES_INST 10 /* Reserved instruction exception */
288#define T_COP_UNUSABLE 11 /* Coprocessor unusable */ 288#define T_COP_UNUSABLE 11 /* Coprocessor unusable */
289#define T_OVFLOW 12 /* Arithmetic overflow */ 289#define T_OVFLOW 12 /* Arithmetic overflow */
290 290
291/* 291/*
292 * Trap definitions added for r4000 port. 292 * Trap definitions added for r4000 port.
293 */ 293 */
294#define T_TRAP 13 /* Trap instruction */ 294#define T_TRAP 13 /* Trap instruction */
295#define T_VCEI 14 /* Virtual coherency exception */ 295#define T_VCEI 14 /* Virtual coherency exception */
296#define T_FPE 15 /* Floating point exception */ 296#define T_FPE 15 /* Floating point exception */
297#define T_WATCH 23 /* Watch address reference */ 297#define T_WATCH 23 /* Watch address reference */
298#define T_VCED 31 /* Virtual coherency data */ 298#define T_VCED 31 /* Virtual coherency data */
299 299
300/* Resume Flags */ 300/* Resume Flags */
301#define RESUME_FLAG_DR (1<<0) /* Reload guest nonvolatile state? */ 301#define RESUME_FLAG_DR (1<<0) /* Reload guest nonvolatile state? */
302#define RESUME_FLAG_HOST (1<<1) /* Resume host? */ 302#define RESUME_FLAG_HOST (1<<1) /* Resume host? */
303 303
304#define RESUME_GUEST 0 304#define RESUME_GUEST 0
305#define RESUME_GUEST_DR RESUME_FLAG_DR 305#define RESUME_GUEST_DR RESUME_FLAG_DR
306#define RESUME_HOST RESUME_FLAG_HOST 306#define RESUME_HOST RESUME_FLAG_HOST
307 307
308enum emulation_result { 308enum emulation_result {
309 EMULATE_DONE, /* no further processing */ 309 EMULATE_DONE, /* no further processing */
@@ -313,24 +313,27 @@ enum emulation_result {
313 EMULATE_PRIV_FAIL, 313 EMULATE_PRIV_FAIL,
314}; 314};
315 315
316#define MIPS3_PG_G 0x00000001 /* Global; ignore ASID if in lo0 & lo1 */ 316#define MIPS3_PG_G 0x00000001 /* Global; ignore ASID if in lo0 & lo1 */
317#define MIPS3_PG_V 0x00000002 /* Valid */ 317#define MIPS3_PG_V 0x00000002 /* Valid */
318#define MIPS3_PG_NV 0x00000000 318#define MIPS3_PG_NV 0x00000000
319#define MIPS3_PG_D 0x00000004 /* Dirty */ 319#define MIPS3_PG_D 0x00000004 /* Dirty */
320 320
321#define mips3_paddr_to_tlbpfn(x) \ 321#define mips3_paddr_to_tlbpfn(x) \
322 (((unsigned long)(x) >> MIPS3_PG_SHIFT) & MIPS3_PG_FRAME) 322 (((unsigned long)(x) >> MIPS3_PG_SHIFT) & MIPS3_PG_FRAME)
323#define mips3_tlbpfn_to_paddr(x) \ 323#define mips3_tlbpfn_to_paddr(x) \
324 ((unsigned long)((x) & MIPS3_PG_FRAME) << MIPS3_PG_SHIFT) 324 ((unsigned long)((x) & MIPS3_PG_FRAME) << MIPS3_PG_SHIFT)
325 325
326#define MIPS3_PG_SHIFT 6 326#define MIPS3_PG_SHIFT 6
327#define MIPS3_PG_FRAME 0x3fffffc0 327#define MIPS3_PG_FRAME 0x3fffffc0
328 328
329#define VPN2_MASK 0xffffe000 329#define VPN2_MASK 0xffffe000
330#define TLB_IS_GLOBAL(x) (((x).tlb_lo0 & MIPS3_PG_G) && ((x).tlb_lo1 & MIPS3_PG_G)) 330#define TLB_IS_GLOBAL(x) (((x).tlb_lo0 & MIPS3_PG_G) && \
331#define TLB_VPN2(x) ((x).tlb_hi & VPN2_MASK) 331 ((x).tlb_lo1 & MIPS3_PG_G))
332#define TLB_ASID(x) ((x).tlb_hi & ASID_MASK) 332#define TLB_VPN2(x) ((x).tlb_hi & VPN2_MASK)
333#define TLB_IS_VALID(x, va) (((va) & (1 << PAGE_SHIFT)) ? ((x).tlb_lo1 & MIPS3_PG_V) : ((x).tlb_lo0 & MIPS3_PG_V)) 333#define TLB_ASID(x) ((x).tlb_hi & ASID_MASK)
334#define TLB_IS_VALID(x, va) (((va) & (1 << PAGE_SHIFT)) \
335 ? ((x).tlb_lo1 & MIPS3_PG_V) \
336 : ((x).tlb_lo0 & MIPS3_PG_V))
334 337
335struct kvm_mips_tlb { 338struct kvm_mips_tlb {
336 long tlb_mask; 339 long tlb_mask;
@@ -339,7 +342,7 @@ struct kvm_mips_tlb {
339 long tlb_lo1; 342 long tlb_lo1;
340}; 343};
341 344
342#define KVM_MIPS_GUEST_TLB_SIZE 64 345#define KVM_MIPS_GUEST_TLB_SIZE 64
343struct kvm_vcpu_arch { 346struct kvm_vcpu_arch {
344 void *host_ebase, *guest_ebase; 347 void *host_ebase, *guest_ebase;
345 unsigned long host_stack; 348 unsigned long host_stack;
@@ -400,65 +403,67 @@ struct kvm_vcpu_arch {
400}; 403};
401 404
402 405
403#define kvm_read_c0_guest_index(cop0) (cop0->reg[MIPS_CP0_TLB_INDEX][0]) 406#define kvm_read_c0_guest_index(cop0) (cop0->reg[MIPS_CP0_TLB_INDEX][0])
404#define kvm_write_c0_guest_index(cop0, val) (cop0->reg[MIPS_CP0_TLB_INDEX][0] = val) 407#define kvm_write_c0_guest_index(cop0, val) (cop0->reg[MIPS_CP0_TLB_INDEX][0] = val)
405#define kvm_read_c0_guest_entrylo0(cop0) (cop0->reg[MIPS_CP0_TLB_LO0][0]) 408#define kvm_read_c0_guest_entrylo0(cop0) (cop0->reg[MIPS_CP0_TLB_LO0][0])
406#define kvm_read_c0_guest_entrylo1(cop0) (cop0->reg[MIPS_CP0_TLB_LO1][0]) 409#define kvm_read_c0_guest_entrylo1(cop0) (cop0->reg[MIPS_CP0_TLB_LO1][0])
407#define kvm_read_c0_guest_context(cop0) (cop0->reg[MIPS_CP0_TLB_CONTEXT][0]) 410#define kvm_read_c0_guest_context(cop0) (cop0->reg[MIPS_CP0_TLB_CONTEXT][0])
408#define kvm_write_c0_guest_context(cop0, val) (cop0->reg[MIPS_CP0_TLB_CONTEXT][0] = (val)) 411#define kvm_write_c0_guest_context(cop0, val) (cop0->reg[MIPS_CP0_TLB_CONTEXT][0] = (val))
409#define kvm_read_c0_guest_userlocal(cop0) (cop0->reg[MIPS_CP0_TLB_CONTEXT][2]) 412#define kvm_read_c0_guest_userlocal(cop0) (cop0->reg[MIPS_CP0_TLB_CONTEXT][2])
410#define kvm_read_c0_guest_pagemask(cop0) (cop0->reg[MIPS_CP0_TLB_PG_MASK][0]) 413#define kvm_read_c0_guest_pagemask(cop0) (cop0->reg[MIPS_CP0_TLB_PG_MASK][0])
411#define kvm_write_c0_guest_pagemask(cop0, val) (cop0->reg[MIPS_CP0_TLB_PG_MASK][0] = (val)) 414#define kvm_write_c0_guest_pagemask(cop0, val) (cop0->reg[MIPS_CP0_TLB_PG_MASK][0] = (val))
412#define kvm_read_c0_guest_wired(cop0) (cop0->reg[MIPS_CP0_TLB_WIRED][0]) 415#define kvm_read_c0_guest_wired(cop0) (cop0->reg[MIPS_CP0_TLB_WIRED][0])
413#define kvm_write_c0_guest_wired(cop0, val) (cop0->reg[MIPS_CP0_TLB_WIRED][0] = (val)) 416#define kvm_write_c0_guest_wired(cop0, val) (cop0->reg[MIPS_CP0_TLB_WIRED][0] = (val))
414#define kvm_read_c0_guest_badvaddr(cop0) (cop0->reg[MIPS_CP0_BAD_VADDR][0]) 417#define kvm_read_c0_guest_hwrena(cop0) (cop0->reg[MIPS_CP0_HWRENA][0])
415#define kvm_write_c0_guest_badvaddr(cop0, val) (cop0->reg[MIPS_CP0_BAD_VADDR][0] = (val)) 418#define kvm_write_c0_guest_hwrena(cop0, val) (cop0->reg[MIPS_CP0_HWRENA][0] = (val))
416#define kvm_read_c0_guest_count(cop0) (cop0->reg[MIPS_CP0_COUNT][0]) 419#define kvm_read_c0_guest_badvaddr(cop0) (cop0->reg[MIPS_CP0_BAD_VADDR][0])
417#define kvm_write_c0_guest_count(cop0, val) (cop0->reg[MIPS_CP0_COUNT][0] = (val)) 420#define kvm_write_c0_guest_badvaddr(cop0, val) (cop0->reg[MIPS_CP0_BAD_VADDR][0] = (val))
418#define kvm_read_c0_guest_entryhi(cop0) (cop0->reg[MIPS_CP0_TLB_HI][0]) 421#define kvm_read_c0_guest_count(cop0) (cop0->reg[MIPS_CP0_COUNT][0])
419#define kvm_write_c0_guest_entryhi(cop0, val) (cop0->reg[MIPS_CP0_TLB_HI][0] = (val)) 422#define kvm_write_c0_guest_count(cop0, val) (cop0->reg[MIPS_CP0_COUNT][0] = (val))
420#define kvm_read_c0_guest_compare(cop0) (cop0->reg[MIPS_CP0_COMPARE][0]) 423#define kvm_read_c0_guest_entryhi(cop0) (cop0->reg[MIPS_CP0_TLB_HI][0])
421#define kvm_write_c0_guest_compare(cop0, val) (cop0->reg[MIPS_CP0_COMPARE][0] = (val)) 424#define kvm_write_c0_guest_entryhi(cop0, val) (cop0->reg[MIPS_CP0_TLB_HI][0] = (val))
422#define kvm_read_c0_guest_status(cop0) (cop0->reg[MIPS_CP0_STATUS][0]) 425#define kvm_read_c0_guest_compare(cop0) (cop0->reg[MIPS_CP0_COMPARE][0])
423#define kvm_write_c0_guest_status(cop0, val) (cop0->reg[MIPS_CP0_STATUS][0] = (val)) 426#define kvm_write_c0_guest_compare(cop0, val) (cop0->reg[MIPS_CP0_COMPARE][0] = (val))
424#define kvm_read_c0_guest_intctl(cop0) (cop0->reg[MIPS_CP0_STATUS][1]) 427#define kvm_read_c0_guest_status(cop0) (cop0->reg[MIPS_CP0_STATUS][0])
425#define kvm_write_c0_guest_intctl(cop0, val) (cop0->reg[MIPS_CP0_STATUS][1] = (val)) 428#define kvm_write_c0_guest_status(cop0, val) (cop0->reg[MIPS_CP0_STATUS][0] = (val))
426#define kvm_read_c0_guest_cause(cop0) (cop0->reg[MIPS_CP0_CAUSE][0]) 429#define kvm_read_c0_guest_intctl(cop0) (cop0->reg[MIPS_CP0_STATUS][1])
427#define kvm_write_c0_guest_cause(cop0, val) (cop0->reg[MIPS_CP0_CAUSE][0] = (val)) 430#define kvm_write_c0_guest_intctl(cop0, val) (cop0->reg[MIPS_CP0_STATUS][1] = (val))
428#define kvm_read_c0_guest_epc(cop0) (cop0->reg[MIPS_CP0_EXC_PC][0]) 431#define kvm_read_c0_guest_cause(cop0) (cop0->reg[MIPS_CP0_CAUSE][0])
429#define kvm_write_c0_guest_epc(cop0, val) (cop0->reg[MIPS_CP0_EXC_PC][0] = (val)) 432#define kvm_write_c0_guest_cause(cop0, val) (cop0->reg[MIPS_CP0_CAUSE][0] = (val))
430#define kvm_read_c0_guest_prid(cop0) (cop0->reg[MIPS_CP0_PRID][0]) 433#define kvm_read_c0_guest_epc(cop0) (cop0->reg[MIPS_CP0_EXC_PC][0])
431#define kvm_write_c0_guest_prid(cop0, val) (cop0->reg[MIPS_CP0_PRID][0] = (val)) 434#define kvm_write_c0_guest_epc(cop0, val) (cop0->reg[MIPS_CP0_EXC_PC][0] = (val))
432#define kvm_read_c0_guest_ebase(cop0) (cop0->reg[MIPS_CP0_PRID][1]) 435#define kvm_read_c0_guest_prid(cop0) (cop0->reg[MIPS_CP0_PRID][0])
433#define kvm_write_c0_guest_ebase(cop0, val) (cop0->reg[MIPS_CP0_PRID][1] = (val)) 436#define kvm_write_c0_guest_prid(cop0, val) (cop0->reg[MIPS_CP0_PRID][0] = (val))
434#define kvm_read_c0_guest_config(cop0) (cop0->reg[MIPS_CP0_CONFIG][0]) 437#define kvm_read_c0_guest_ebase(cop0) (cop0->reg[MIPS_CP0_PRID][1])
435#define kvm_read_c0_guest_config1(cop0) (cop0->reg[MIPS_CP0_CONFIG][1]) 438#define kvm_write_c0_guest_ebase(cop0, val) (cop0->reg[MIPS_CP0_PRID][1] = (val))
436#define kvm_read_c0_guest_config2(cop0) (cop0->reg[MIPS_CP0_CONFIG][2]) 439#define kvm_read_c0_guest_config(cop0) (cop0->reg[MIPS_CP0_CONFIG][0])
437#define kvm_read_c0_guest_config3(cop0) (cop0->reg[MIPS_CP0_CONFIG][3]) 440#define kvm_read_c0_guest_config1(cop0) (cop0->reg[MIPS_CP0_CONFIG][1])
438#define kvm_read_c0_guest_config7(cop0) (cop0->reg[MIPS_CP0_CONFIG][7]) 441#define kvm_read_c0_guest_config2(cop0) (cop0->reg[MIPS_CP0_CONFIG][2])
439#define kvm_write_c0_guest_config(cop0, val) (cop0->reg[MIPS_CP0_CONFIG][0] = (val)) 442#define kvm_read_c0_guest_config3(cop0) (cop0->reg[MIPS_CP0_CONFIG][3])
440#define kvm_write_c0_guest_config1(cop0, val) (cop0->reg[MIPS_CP0_CONFIG][1] = (val)) 443#define kvm_read_c0_guest_config7(cop0) (cop0->reg[MIPS_CP0_CONFIG][7])
441#define kvm_write_c0_guest_config2(cop0, val) (cop0->reg[MIPS_CP0_CONFIG][2] = (val)) 444#define kvm_write_c0_guest_config(cop0, val) (cop0->reg[MIPS_CP0_CONFIG][0] = (val))
442#define kvm_write_c0_guest_config3(cop0, val) (cop0->reg[MIPS_CP0_CONFIG][3] = (val)) 445#define kvm_write_c0_guest_config1(cop0, val) (cop0->reg[MIPS_CP0_CONFIG][1] = (val))
443#define kvm_write_c0_guest_config7(cop0, val) (cop0->reg[MIPS_CP0_CONFIG][7] = (val)) 446#define kvm_write_c0_guest_config2(cop0, val) (cop0->reg[MIPS_CP0_CONFIG][2] = (val))
444#define kvm_read_c0_guest_errorepc(cop0) (cop0->reg[MIPS_CP0_ERROR_PC][0]) 447#define kvm_write_c0_guest_config3(cop0, val) (cop0->reg[MIPS_CP0_CONFIG][3] = (val))
445#define kvm_write_c0_guest_errorepc(cop0, val) (cop0->reg[MIPS_CP0_ERROR_PC][0] = (val)) 448#define kvm_write_c0_guest_config7(cop0, val) (cop0->reg[MIPS_CP0_CONFIG][7] = (val))
446 449#define kvm_read_c0_guest_errorepc(cop0) (cop0->reg[MIPS_CP0_ERROR_PC][0])
447#define kvm_set_c0_guest_status(cop0, val) (cop0->reg[MIPS_CP0_STATUS][0] |= (val)) 450#define kvm_write_c0_guest_errorepc(cop0, val) (cop0->reg[MIPS_CP0_ERROR_PC][0] = (val))
448#define kvm_clear_c0_guest_status(cop0, val) (cop0->reg[MIPS_CP0_STATUS][0] &= ~(val)) 451
449#define kvm_set_c0_guest_cause(cop0, val) (cop0->reg[MIPS_CP0_CAUSE][0] |= (val)) 452#define kvm_set_c0_guest_status(cop0, val) (cop0->reg[MIPS_CP0_STATUS][0] |= (val))
450#define kvm_clear_c0_guest_cause(cop0, val) (cop0->reg[MIPS_CP0_CAUSE][0] &= ~(val)) 453#define kvm_clear_c0_guest_status(cop0, val) (cop0->reg[MIPS_CP0_STATUS][0] &= ~(val))
451#define kvm_change_c0_guest_cause(cop0, change, val) \ 454#define kvm_set_c0_guest_cause(cop0, val) (cop0->reg[MIPS_CP0_CAUSE][0] |= (val))
452{ \ 455#define kvm_clear_c0_guest_cause(cop0, val) (cop0->reg[MIPS_CP0_CAUSE][0] &= ~(val))
453 kvm_clear_c0_guest_cause(cop0, change); \ 456#define kvm_change_c0_guest_cause(cop0, change, val) \
454 kvm_set_c0_guest_cause(cop0, ((val) & (change))); \ 457{ \
458 kvm_clear_c0_guest_cause(cop0, change); \
459 kvm_set_c0_guest_cause(cop0, ((val) & (change))); \
455} 460}
456#define kvm_set_c0_guest_ebase(cop0, val) (cop0->reg[MIPS_CP0_PRID][1] |= (val)) 461#define kvm_set_c0_guest_ebase(cop0, val) (cop0->reg[MIPS_CP0_PRID][1] |= (val))
457#define kvm_clear_c0_guest_ebase(cop0, val) (cop0->reg[MIPS_CP0_PRID][1] &= ~(val)) 462#define kvm_clear_c0_guest_ebase(cop0, val) (cop0->reg[MIPS_CP0_PRID][1] &= ~(val))
458#define kvm_change_c0_guest_ebase(cop0, change, val) \ 463#define kvm_change_c0_guest_ebase(cop0, change, val) \
459{ \ 464{ \
460 kvm_clear_c0_guest_ebase(cop0, change); \ 465 kvm_clear_c0_guest_ebase(cop0, change); \
461 kvm_set_c0_guest_ebase(cop0, ((val) & (change))); \ 466 kvm_set_c0_guest_ebase(cop0, ((val) & (change))); \
462} 467}
463 468
464 469
diff --git a/arch/mips/include/asm/local.h b/arch/mips/include/asm/local.h
index d44622cd74be..46dfc3c1fd49 100644
--- a/arch/mips/include/asm/local.h
+++ b/arch/mips/include/asm/local.h
@@ -33,7 +33,7 @@ static __inline__ long local_add_return(long i, local_t * l)
33 unsigned long temp; 33 unsigned long temp;
34 34
35 __asm__ __volatile__( 35 __asm__ __volatile__(
36 " .set mips3 \n" 36 " .set arch=r4000 \n"
37 "1:" __LL "%1, %2 # local_add_return \n" 37 "1:" __LL "%1, %2 # local_add_return \n"
38 " addu %0, %1, %3 \n" 38 " addu %0, %1, %3 \n"
39 __SC "%0, %2 \n" 39 __SC "%0, %2 \n"
@@ -47,7 +47,7 @@ static __inline__ long local_add_return(long i, local_t * l)
47 unsigned long temp; 47 unsigned long temp;
48 48
49 __asm__ __volatile__( 49 __asm__ __volatile__(
50 " .set mips3 \n" 50 " .set arch=r4000 \n"
51 "1:" __LL "%1, %2 # local_add_return \n" 51 "1:" __LL "%1, %2 # local_add_return \n"
52 " addu %0, %1, %3 \n" 52 " addu %0, %1, %3 \n"
53 __SC "%0, %2 \n" 53 __SC "%0, %2 \n"
@@ -78,7 +78,7 @@ static __inline__ long local_sub_return(long i, local_t * l)
78 unsigned long temp; 78 unsigned long temp;
79 79
80 __asm__ __volatile__( 80 __asm__ __volatile__(
81 " .set mips3 \n" 81 " .set arch=r4000 \n"
82 "1:" __LL "%1, %2 # local_sub_return \n" 82 "1:" __LL "%1, %2 # local_sub_return \n"
83 " subu %0, %1, %3 \n" 83 " subu %0, %1, %3 \n"
84 __SC "%0, %2 \n" 84 __SC "%0, %2 \n"
@@ -92,7 +92,7 @@ static __inline__ long local_sub_return(long i, local_t * l)
92 unsigned long temp; 92 unsigned long temp;
93 93
94 __asm__ __volatile__( 94 __asm__ __volatile__(
95 " .set mips3 \n" 95 " .set arch=r4000 \n"
96 "1:" __LL "%1, %2 # local_sub_return \n" 96 "1:" __LL "%1, %2 # local_sub_return \n"
97 " subu %0, %1, %3 \n" 97 " subu %0, %1, %3 \n"
98 __SC "%0, %2 \n" 98 __SC "%0, %2 \n"
diff --git a/arch/mips/include/asm/mach-au1x00/au1000.h b/arch/mips/include/asm/mach-au1x00/au1000.h
index 54f9e84db8ac..b4c3ecb17d48 100644
--- a/arch/mips/include/asm/mach-au1x00/au1000.h
+++ b/arch/mips/include/asm/mach-au1x00/au1000.h
@@ -1161,18 +1161,6 @@ enum soc_au1200_ints {
1161#define MAC_RX_BUFF3_STATUS 0x30 1161#define MAC_RX_BUFF3_STATUS 0x30
1162#define MAC_RX_BUFF3_ADDR 0x34 1162#define MAC_RX_BUFF3_ADDR 0x34
1163 1163
1164#define UART_RX 0 /* Receive buffer */
1165#define UART_TX 4 /* Transmit buffer */
1166#define UART_IER 8 /* Interrupt Enable Register */
1167#define UART_IIR 0xC /* Interrupt ID Register */
1168#define UART_FCR 0x10 /* FIFO Control Register */
1169#define UART_LCR 0x14 /* Line Control Register */
1170#define UART_MCR 0x18 /* Modem Control Register */
1171#define UART_LSR 0x1C /* Line Status Register */
1172#define UART_MSR 0x20 /* Modem Status Register */
1173#define UART_CLK 0x28 /* Baud Rate Clock Divider */
1174#define UART_MOD_CNTRL 0x100 /* Module Control */
1175
1176/* SSIO */ 1164/* SSIO */
1177#define SSI0_STATUS 0xB1600000 1165#define SSI0_STATUS 0xB1600000
1178# define SSI_STATUS_BF (1 << 4) 1166# define SSI_STATUS_BF (1 << 4)
diff --git a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
index 40005fb39618..bba7399a49a3 100644
--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
+++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
@@ -27,7 +27,11 @@ enum bcm47xx_board {
27 BCM47XX_BOARD_ASUS_WL700GE, 27 BCM47XX_BOARD_ASUS_WL700GE,
28 BCM47XX_BOARD_ASUS_WLHDD, 28 BCM47XX_BOARD_ASUS_WLHDD,
29 29
30 BCM47XX_BOARD_BELKIN_F7D3301,
31 BCM47XX_BOARD_BELKIN_F7D3302,
30 BCM47XX_BOARD_BELKIN_F7D4301, 32 BCM47XX_BOARD_BELKIN_F7D4301,
33 BCM47XX_BOARD_BELKIN_F7D4302,
34 BCM47XX_BOARD_BELKIN_F7D4401,
31 35
32 BCM47XX_BOARD_BUFFALO_WBR2_G54, 36 BCM47XX_BOARD_BUFFALO_WBR2_G54,
33 BCM47XX_BOARD_BUFFALO_WHR2_A54G54, 37 BCM47XX_BOARD_BUFFALO_WHR2_A54G54,
@@ -66,7 +70,7 @@ enum bcm47xx_board {
66 BCM47XX_BOARD_LINKSYS_WRT310NV1, 70 BCM47XX_BOARD_LINKSYS_WRT310NV1,
67 BCM47XX_BOARD_LINKSYS_WRT310NV2, 71 BCM47XX_BOARD_LINKSYS_WRT310NV2,
68 BCM47XX_BOARD_LINKSYS_WRT54G3GV2, 72 BCM47XX_BOARD_LINKSYS_WRT54G3GV2,
69 BCM47XX_BOARD_LINKSYS_WRT54GSV1, 73 BCM47XX_BOARD_LINKSYS_WRT54G,
70 BCM47XX_BOARD_LINKSYS_WRT610NV1, 74 BCM47XX_BOARD_LINKSYS_WRT610NV1,
71 BCM47XX_BOARD_LINKSYS_WRT610NV2, 75 BCM47XX_BOARD_LINKSYS_WRT610NV2,
72 BCM47XX_BOARD_LINKSYS_WRTSL54GS, 76 BCM47XX_BOARD_LINKSYS_WRTSL54GS,
@@ -94,6 +98,8 @@ enum bcm47xx_board {
94 98
95 BCM47XX_BOARD_PHICOMM_M1, 99 BCM47XX_BOARD_PHICOMM_M1,
96 100
101 BCM47XX_BOARD_SIEMENS_SE505V2,
102
97 BCM47XX_BOARD_SIMPLETECH_SIMPLESHARE, 103 BCM47XX_BOARD_SIMPLETECH_SIMPLESHARE,
98 104
99 BCM47XX_BOARD_ZTE_H218N, 105 BCM47XX_BOARD_ZTE_H218N,
diff --git a/arch/mips/include/asm/mach-db1x00/db1200.h b/arch/mips/include/asm/mach-db1x00/db1200.h
deleted file mode 100644
index d3cce7326dd4..000000000000
--- a/arch/mips/include/asm/mach-db1x00/db1200.h
+++ /dev/null
@@ -1,91 +0,0 @@
1/*
2 * AMD Alchemy DBAu1200 Reference Board
3 * Board register defines.
4 *
5 * ########################################################################
6 *
7 * This program is free software; you can distribute it and/or modify it
8 * under the terms of the GNU General Public License (Version 2) as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR 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 along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
19 *
20 * ########################################################################
21 *
22 *
23 */
24#ifndef __ASM_DB1200_H
25#define __ASM_DB1200_H
26
27#include <linux/types.h>
28#include <asm/mach-au1x00/au1000.h>
29#include <asm/mach-au1x00/au1xxx_psc.h>
30
31/* Bit positions for the different interrupt sources */
32#define BCSR_INT_IDE 0x0001
33#define BCSR_INT_ETH 0x0002
34#define BCSR_INT_PC0 0x0004
35#define BCSR_INT_PC0STSCHG 0x0008
36#define BCSR_INT_PC1 0x0010
37#define BCSR_INT_PC1STSCHG 0x0020
38#define BCSR_INT_DC 0x0040
39#define BCSR_INT_FLASHBUSY 0x0080
40#define BCSR_INT_PC0INSERT 0x0100
41#define BCSR_INT_PC0EJECT 0x0200
42#define BCSR_INT_PC1INSERT 0x0400
43#define BCSR_INT_PC1EJECT 0x0800
44#define BCSR_INT_SD0INSERT 0x1000
45#define BCSR_INT_SD0EJECT 0x2000
46#define BCSR_INT_SD1INSERT 0x4000
47#define BCSR_INT_SD1EJECT 0x8000
48
49#define IDE_REG_SHIFT 5
50
51#define DB1200_IDE_PHYS_ADDR 0x18800000
52#define DB1200_IDE_PHYS_LEN (16 << IDE_REG_SHIFT)
53#define DB1200_ETH_PHYS_ADDR 0x19000300
54#define DB1200_NAND_PHYS_ADDR 0x20000000
55
56#define PB1200_IDE_PHYS_ADDR 0x0C800000
57#define PB1200_ETH_PHYS_ADDR 0x0D000300
58#define PB1200_NAND_PHYS_ADDR 0x1C000000
59
60/*
61 * External Interrupts for DBAu1200 as of 8/6/2004.
62 * Bit positions in the CPLD registers can be calculated by taking
63 * the interrupt define and subtracting the DB1200_INT_BEGIN value.
64 *
65 * Example: IDE bis pos is = 64 - 64
66 * ETH bit pos is = 65 - 64
67 */
68enum external_db1200_ints {
69 DB1200_INT_BEGIN = AU1000_MAX_INTR + 1,
70
71 DB1200_IDE_INT = DB1200_INT_BEGIN,
72 DB1200_ETH_INT,
73 DB1200_PC0_INT,
74 DB1200_PC0_STSCHG_INT,
75 DB1200_PC1_INT,
76 DB1200_PC1_STSCHG_INT,
77 DB1200_DC_INT,
78 DB1200_FLASHBUSY_INT,
79 DB1200_PC0_INSERT_INT,
80 DB1200_PC0_EJECT_INT,
81 DB1200_PC1_INSERT_INT,
82 DB1200_PC1_EJECT_INT,
83 DB1200_SD0_INSERT_INT,
84 DB1200_SD0_EJECT_INT,
85 PB1200_SD1_INSERT_INT,
86 PB1200_SD1_EJECT_INT,
87
88 DB1200_INT_END = DB1200_INT_BEGIN + 15,
89};
90
91#endif /* __ASM_DB1200_H */
diff --git a/arch/mips/include/asm/mach-db1x00/db1300.h b/arch/mips/include/asm/mach-db1x00/db1300.h
deleted file mode 100644
index 3d1ede46f059..000000000000
--- a/arch/mips/include/asm/mach-db1x00/db1300.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * NetLogic DB1300 board constants
3 */
4
5#ifndef _DB1300_H_
6#define _DB1300_H_
7
8/* FPGA (external mux) interrupt sources */
9#define DB1300_FIRST_INT (ALCHEMY_GPIC_INT_LAST + 1)
10#define DB1300_IDE_INT (DB1300_FIRST_INT + 0)
11#define DB1300_ETH_INT (DB1300_FIRST_INT + 1)
12#define DB1300_CF_INT (DB1300_FIRST_INT + 2)
13#define DB1300_VIDEO_INT (DB1300_FIRST_INT + 4)
14#define DB1300_HDMI_INT (DB1300_FIRST_INT + 5)
15#define DB1300_DC_INT (DB1300_FIRST_INT + 6)
16#define DB1300_FLASH_INT (DB1300_FIRST_INT + 7)
17#define DB1300_CF_INSERT_INT (DB1300_FIRST_INT + 8)
18#define DB1300_CF_EJECT_INT (DB1300_FIRST_INT + 9)
19#define DB1300_AC97_INT (DB1300_FIRST_INT + 10)
20#define DB1300_AC97_PEN_INT (DB1300_FIRST_INT + 11)
21#define DB1300_SD1_INSERT_INT (DB1300_FIRST_INT + 12)
22#define DB1300_SD1_EJECT_INT (DB1300_FIRST_INT + 13)
23#define DB1300_OTG_VBUS_OC_INT (DB1300_FIRST_INT + 14)
24#define DB1300_HOST_VBUS_OC_INT (DB1300_FIRST_INT + 15)
25#define DB1300_LAST_INT (DB1300_FIRST_INT + 15)
26
27/* SMSC9210 CS */
28#define DB1300_ETH_PHYS_ADDR 0x19000000
29#define DB1300_ETH_PHYS_END 0x197fffff
30
31/* ATA CS */
32#define DB1300_IDE_PHYS_ADDR 0x18800000
33#define DB1300_IDE_REG_SHIFT 5
34#define DB1300_IDE_PHYS_LEN (16 << DB1300_IDE_REG_SHIFT)
35
36/* NAND CS */
37#define DB1300_NAND_PHYS_ADDR 0x20000000
38#define DB1300_NAND_PHYS_END 0x20000fff
39
40#endif /* _DB1300_H_ */
diff --git a/arch/mips/include/asm/mach-loongson/boot_param.h b/arch/mips/include/asm/mach-loongson/boot_param.h
new file mode 100644
index 000000000000..829a7ec185fb
--- /dev/null
+++ b/arch/mips/include/asm/mach-loongson/boot_param.h
@@ -0,0 +1,163 @@
1#ifndef __ASM_MACH_LOONGSON_BOOT_PARAM_H_
2#define __ASM_MACH_LOONGSON_BOOT_PARAM_H_
3
4#define SYSTEM_RAM_LOW 1
5#define SYSTEM_RAM_HIGH 2
6#define MEM_RESERVED 3
7#define PCI_IO 4
8#define PCI_MEM 5
9#define LOONGSON_CFG_REG 6
10#define VIDEO_ROM 7
11#define ADAPTER_ROM 8
12#define ACPI_TABLE 9
13#define MAX_MEMORY_TYPE 10
14
15#define LOONGSON3_BOOT_MEM_MAP_MAX 128
16struct efi_memory_map_loongson {
17 u16 vers; /* version of efi_memory_map */
18 u32 nr_map; /* number of memory_maps */
19 u32 mem_freq; /* memory frequence */
20 struct mem_map {
21 u32 node_id; /* node_id which memory attached to */
22 u32 mem_type; /* system memory, pci memory, pci io, etc. */
23 u64 mem_start; /* memory map start address */
24 u32 mem_size; /* each memory_map size, not the total size */
25 } map[LOONGSON3_BOOT_MEM_MAP_MAX];
26} __packed;
27
28enum loongson_cpu_type {
29 Loongson_2E = 0,
30 Loongson_2F = 1,
31 Loongson_3A = 2,
32 Loongson_3B = 3,
33 Loongson_1A = 4,
34 Loongson_1B = 5
35};
36
37/*
38 * Capability and feature descriptor structure for MIPS CPU
39 */
40struct efi_cpuinfo_loongson {
41 u16 vers; /* version of efi_cpuinfo_loongson */
42 u32 processor_id; /* PRID, e.g. 6305, 6306 */
43 u32 cputype; /* Loongson_3A/3B, etc. */
44 u32 total_node; /* num of total numa nodes */
45 u32 cpu_startup_core_id; /* Core id */
46 u32 cpu_clock_freq; /* cpu_clock */
47 u32 nr_cpus;
48} __packed;
49
50struct system_loongson {
51 u16 vers; /* version of system_loongson */
52 u32 ccnuma_smp; /* 0: no numa; 1: has numa */
53 u32 sing_double_channel; /* 1:single; 2:double */
54} __packed;
55
56struct irq_source_routing_table {
57 u16 vers;
58 u16 size;
59 u16 rtr_bus;
60 u16 rtr_devfn;
61 u32 vendor;
62 u32 device;
63 u32 PIC_type; /* conform use HT or PCI to route to CPU-PIC */
64 u64 ht_int_bit; /* 3A: 1<<24; 3B: 1<<16 */
65 u64 ht_enable; /* irqs used in this PIC */
66 u32 node_id; /* node id: 0x0-0; 0x1-1; 0x10-2; 0x11-3 */
67 u64 pci_mem_start_addr;
68 u64 pci_mem_end_addr;
69 u64 pci_io_start_addr;
70 u64 pci_io_end_addr;
71 u64 pci_config_addr;
72 u32 dma_mask_bits;
73} __packed;
74
75struct interface_info {
76 u16 vers; /* version of the specificition */
77 u16 size;
78 u8 flag;
79 char description[64];
80} __packed;
81
82#define MAX_RESOURCE_NUMBER 128
83struct resource_loongson {
84 u64 start; /* resource start address */
85 u64 end; /* resource end address */
86 char name[64];
87 u32 flags;
88};
89
90struct archdev_data {}; /* arch specific additions */
91
92struct board_devices {
93 char name[64]; /* hold the device name */
94 u32 num_resources; /* number of device_resource */
95 /* for each device's resource */
96 struct resource_loongson resource[MAX_RESOURCE_NUMBER];
97 /* arch specific additions */
98 struct archdev_data archdata;
99};
100
101struct loongson_special_attribute {
102 u16 vers; /* version of this special */
103 char special_name[64]; /* special_atribute_name */
104 u32 loongson_special_type; /* type of special device */
105 /* for each device's resource */
106 struct resource_loongson resource[MAX_RESOURCE_NUMBER];
107};
108
109struct loongson_params {
110 u64 memory_offset; /* efi_memory_map_loongson struct offset */
111 u64 cpu_offset; /* efi_cpuinfo_loongson struct offset */
112 u64 system_offset; /* system_loongson struct offset */
113 u64 irq_offset; /* irq_source_routing_table struct offset */
114 u64 interface_offset; /* interface_info struct offset */
115 u64 special_offset; /* loongson_special_attribute struct offset */
116 u64 boarddev_table_offset; /* board_devices offset */
117};
118
119struct smbios_tables {
120 u16 vers; /* version of smbios */
121 u64 vga_bios; /* vga_bios address */
122 struct loongson_params lp;
123};
124
125struct efi_reset_system_t {
126 u64 ResetCold;
127 u64 ResetWarm;
128 u64 ResetType;
129 u64 Shutdown;
130 u64 DoSuspend; /* NULL if not support */
131};
132
133struct efi_loongson {
134 u64 mps; /* MPS table */
135 u64 acpi; /* ACPI table (IA64 ext 0.71) */
136 u64 acpi20; /* ACPI table (ACPI 2.0) */
137 struct smbios_tables smbios; /* SM BIOS table */
138 u64 sal_systab; /* SAL system table */
139 u64 boot_info; /* boot info table */
140};
141
142struct boot_params {
143 struct efi_loongson efi;
144 struct efi_reset_system_t reset_system;
145};
146
147struct loongson_system_configuration {
148 u32 nr_cpus;
149 enum loongson_cpu_type cputype;
150 u64 ht_control_base;
151 u64 pci_mem_start_addr;
152 u64 pci_mem_end_addr;
153 u64 pci_io_base;
154 u64 restart_addr;
155 u64 poweroff_addr;
156 u64 suspend_addr;
157 u64 vgabios_addr;
158 u32 dma_mask_bits;
159};
160
161extern struct efi_memory_map_loongson *loongson_memmap;
162extern struct loongson_system_configuration loongson_sysconf;
163#endif
diff --git a/arch/mips/include/asm/mach-loongson/dma-coherence.h b/arch/mips/include/asm/mach-loongson/dma-coherence.h
index aeb2c05d6145..6a902751cc7f 100644
--- a/arch/mips/include/asm/mach-loongson/dma-coherence.h
+++ b/arch/mips/include/asm/mach-loongson/dma-coherence.h
@@ -11,24 +11,40 @@
11#ifndef __ASM_MACH_LOONGSON_DMA_COHERENCE_H 11#ifndef __ASM_MACH_LOONGSON_DMA_COHERENCE_H
12#define __ASM_MACH_LOONGSON_DMA_COHERENCE_H 12#define __ASM_MACH_LOONGSON_DMA_COHERENCE_H
13 13
14#ifdef CONFIG_SWIOTLB
15#include <linux/swiotlb.h>
16#endif
17
14struct device; 18struct device;
15 19
20extern dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr);
21extern phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr);
16static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, 22static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr,
17 size_t size) 23 size_t size)
18{ 24{
25#ifdef CONFIG_CPU_LOONGSON3
26 return virt_to_phys(addr);
27#else
19 return virt_to_phys(addr) | 0x80000000; 28 return virt_to_phys(addr) | 0x80000000;
29#endif
20} 30}
21 31
22static inline dma_addr_t plat_map_dma_mem_page(struct device *dev, 32static inline dma_addr_t plat_map_dma_mem_page(struct device *dev,
23 struct page *page) 33 struct page *page)
24{ 34{
35#ifdef CONFIG_CPU_LOONGSON3
36 return page_to_phys(page);
37#else
25 return page_to_phys(page) | 0x80000000; 38 return page_to_phys(page) | 0x80000000;
39#endif
26} 40}
27 41
28static inline unsigned long plat_dma_addr_to_phys(struct device *dev, 42static inline unsigned long plat_dma_addr_to_phys(struct device *dev,
29 dma_addr_t dma_addr) 43 dma_addr_t dma_addr)
30{ 44{
31#if defined(CONFIG_CPU_LOONGSON2F) && defined(CONFIG_64BIT) 45#if defined(CONFIG_CPU_LOONGSON3) && defined(CONFIG_64BIT)
46 return dma_addr;
47#elif defined(CONFIG_CPU_LOONGSON2F) && defined(CONFIG_64BIT)
32 return (dma_addr > 0x8fffffff) ? dma_addr : (dma_addr & 0x0fffffff); 48 return (dma_addr > 0x8fffffff) ? dma_addr : (dma_addr & 0x0fffffff);
33#else 49#else
34 return dma_addr & 0x7fffffff; 50 return dma_addr & 0x7fffffff;
@@ -55,7 +71,11 @@ static inline int plat_dma_supported(struct device *dev, u64 mask)
55 71
56static inline int plat_device_is_coherent(struct device *dev) 72static inline int plat_device_is_coherent(struct device *dev)
57{ 73{
74#ifdef CONFIG_DMA_NONCOHERENT
58 return 0; 75 return 0;
76#else
77 return 1;
78#endif /* CONFIG_DMA_NONCOHERENT */
59} 79}
60 80
61#endif /* __ASM_MACH_LOONGSON_DMA_COHERENCE_H */ 81#endif /* __ASM_MACH_LOONGSON_DMA_COHERENCE_H */
diff --git a/arch/mips/include/asm/mach-loongson/irq.h b/arch/mips/include/asm/mach-loongson/irq.h
new file mode 100644
index 000000000000..34560bda6626
--- /dev/null
+++ b/arch/mips/include/asm/mach-loongson/irq.h
@@ -0,0 +1,44 @@
1#ifndef __ASM_MACH_LOONGSON_IRQ_H_
2#define __ASM_MACH_LOONGSON_IRQ_H_
3
4#include <boot_param.h>
5
6#ifdef CONFIG_CPU_LOONGSON3
7
8/* cpu core interrupt numbers */
9#define MIPS_CPU_IRQ_BASE 56
10
11#define LOONGSON_UART_IRQ (MIPS_CPU_IRQ_BASE + 2) /* UART */
12#define LOONGSON_HT1_IRQ (MIPS_CPU_IRQ_BASE + 3) /* HT1 */
13#define LOONGSON_TIMER_IRQ (MIPS_CPU_IRQ_BASE + 7) /* CPU Timer */
14
15#define LOONGSON_HT1_CFG_BASE loongson_sysconf.ht_control_base
16#define LOONGSON_HT1_INT_VECTOR_BASE (LOONGSON_HT1_CFG_BASE + 0x80)
17#define LOONGSON_HT1_INT_EN_BASE (LOONGSON_HT1_CFG_BASE + 0xa0)
18#define LOONGSON_HT1_INT_VECTOR(n) \
19 LOONGSON3_REG32(LOONGSON_HT1_INT_VECTOR_BASE, 4 * (n))
20#define LOONGSON_HT1_INTN_EN(n) \
21 LOONGSON3_REG32(LOONGSON_HT1_INT_EN_BASE, 4 * (n))
22
23#define LOONGSON_INT_ROUTER_OFFSET 0x1400
24#define LOONGSON_INT_ROUTER_INTEN \
25 LOONGSON3_REG32(LOONGSON3_REG_BASE, LOONGSON_INT_ROUTER_OFFSET + 0x24)
26#define LOONGSON_INT_ROUTER_INTENSET \
27 LOONGSON3_REG32(LOONGSON3_REG_BASE, LOONGSON_INT_ROUTER_OFFSET + 0x28)
28#define LOONGSON_INT_ROUTER_INTENCLR \
29 LOONGSON3_REG32(LOONGSON3_REG_BASE, LOONGSON_INT_ROUTER_OFFSET + 0x2c)
30#define LOONGSON_INT_ROUTER_ENTRY(n) \
31 LOONGSON3_REG8(LOONGSON3_REG_BASE, LOONGSON_INT_ROUTER_OFFSET + n)
32#define LOONGSON_INT_ROUTER_LPC LOONGSON_INT_ROUTER_ENTRY(0x0a)
33#define LOONGSON_INT_ROUTER_HT1(n) LOONGSON_INT_ROUTER_ENTRY(n + 0x18)
34
35#define LOONGSON_INT_CORE0_INT0 0x11 /* route to int 0 of core 0 */
36#define LOONGSON_INT_CORE0_INT1 0x21 /* route to int 1 of core 0 */
37
38#endif
39
40extern void fixup_irqs(void);
41extern void loongson3_ipi_interrupt(struct pt_regs *regs);
42
43#include_next <irq.h>
44#endif /* __ASM_MACH_LOONGSON_IRQ_H_ */
diff --git a/arch/mips/include/asm/mach-loongson/loongson.h b/arch/mips/include/asm/mach-loongson/loongson.h
index b286534fef08..f3fd1eb8e3dd 100644
--- a/arch/mips/include/asm/mach-loongson/loongson.h
+++ b/arch/mips/include/asm/mach-loongson/loongson.h
@@ -15,6 +15,7 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/irq.h> 16#include <linux/irq.h>
17#include <linux/kconfig.h> 17#include <linux/kconfig.h>
18#include <boot_param.h>
18 19
19/* loongson internal northbridge initialization */ 20/* loongson internal northbridge initialization */
20extern void bonito_irq_init(void); 21extern void bonito_irq_init(void);
@@ -24,8 +25,9 @@ extern void mach_prepare_reboot(void);
24extern void mach_prepare_shutdown(void); 25extern void mach_prepare_shutdown(void);
25 26
26/* environment arguments from bootloader */ 27/* environment arguments from bootloader */
27extern unsigned long cpu_clock_freq; 28extern u32 cpu_clock_freq;
28extern unsigned long memsize, highmemsize; 29extern u32 memsize, highmemsize;
30extern struct plat_smp_ops loongson3_smp_ops;
29 31
30/* loongson-specific command line, env and memory initialization */ 32/* loongson-specific command line, env and memory initialization */
31extern void __init prom_init_memory(void); 33extern void __init prom_init_memory(void);
@@ -61,6 +63,12 @@ extern int mach_i8259_irq(void);
61#define LOONGSON_REG(x) \ 63#define LOONGSON_REG(x) \
62 (*(volatile u32 *)((char *)CKSEG1ADDR(LOONGSON_REG_BASE) + (x))) 64 (*(volatile u32 *)((char *)CKSEG1ADDR(LOONGSON_REG_BASE) + (x)))
63 65
66#define LOONGSON3_REG8(base, x) \
67 (*(volatile u8 *)((char *)TO_UNCAC(base) + (x)))
68
69#define LOONGSON3_REG32(base, x) \
70 (*(volatile u32 *)((char *)TO_UNCAC(base) + (x)))
71
64#define LOONGSON_IRQ_BASE 32 72#define LOONGSON_IRQ_BASE 32
65#define LOONGSON2_PERFCNT_IRQ (MIPS_CPU_IRQ_BASE + 6) /* cpu perf counter */ 73#define LOONGSON2_PERFCNT_IRQ (MIPS_CPU_IRQ_BASE + 6) /* cpu perf counter */
66 74
@@ -86,6 +94,10 @@ static inline void do_perfcnt_IRQ(void)
86#define LOONGSON_REG_BASE 0x1fe00000 94#define LOONGSON_REG_BASE 0x1fe00000
87#define LOONGSON_REG_SIZE 0x00100000 /* 256Bytes + 256Bytes + ??? */ 95#define LOONGSON_REG_SIZE 0x00100000 /* 256Bytes + 256Bytes + ??? */
88#define LOONGSON_REG_TOP (LOONGSON_REG_BASE+LOONGSON_REG_SIZE-1) 96#define LOONGSON_REG_TOP (LOONGSON_REG_BASE+LOONGSON_REG_SIZE-1)
97/* Loongson-3 specific registers */
98#define LOONGSON3_REG_BASE 0x3ff00000
99#define LOONGSON3_REG_SIZE 0x00100000 /* 256Bytes + 256Bytes + ??? */
100#define LOONGSON3_REG_TOP (LOONGSON3_REG_BASE+LOONGSON3_REG_SIZE-1)
89 101
90#define LOONGSON_LIO1_BASE 0x1ff00000 102#define LOONGSON_LIO1_BASE 0x1ff00000
91#define LOONGSON_LIO1_SIZE 0x00100000 /* 1M */ 103#define LOONGSON_LIO1_SIZE 0x00100000 /* 1M */
@@ -101,7 +113,13 @@ static inline void do_perfcnt_IRQ(void)
101#define LOONGSON_PCICFG_BASE 0x1fe80000 113#define LOONGSON_PCICFG_BASE 0x1fe80000
102#define LOONGSON_PCICFG_SIZE 0x00000800 /* 2K */ 114#define LOONGSON_PCICFG_SIZE 0x00000800 /* 2K */
103#define LOONGSON_PCICFG_TOP (LOONGSON_PCICFG_BASE+LOONGSON_PCICFG_SIZE-1) 115#define LOONGSON_PCICFG_TOP (LOONGSON_PCICFG_BASE+LOONGSON_PCICFG_SIZE-1)
116
117#if defined(CONFIG_HT_PCI)
118#define LOONGSON_PCIIO_BASE loongson_sysconf.pci_io_base
119#else
104#define LOONGSON_PCIIO_BASE 0x1fd00000 120#define LOONGSON_PCIIO_BASE 0x1fd00000
121#endif
122
105#define LOONGSON_PCIIO_SIZE 0x00100000 /* 1M */ 123#define LOONGSON_PCIIO_SIZE 0x00100000 /* 1M */
106#define LOONGSON_PCIIO_TOP (LOONGSON_PCIIO_BASE+LOONGSON_PCIIO_SIZE-1) 124#define LOONGSON_PCIIO_TOP (LOONGSON_PCIIO_BASE+LOONGSON_PCIIO_SIZE-1)
107 125
@@ -231,6 +249,9 @@ static inline void do_perfcnt_IRQ(void)
231#define LOONGSON_PXARB_CFG LOONGSON_REG(LOONGSON_REGBASE + 0x68) 249#define LOONGSON_PXARB_CFG LOONGSON_REG(LOONGSON_REGBASE + 0x68)
232#define LOONGSON_PXARB_STATUS LOONGSON_REG(LOONGSON_REGBASE + 0x6c) 250#define LOONGSON_PXARB_STATUS LOONGSON_REG(LOONGSON_REGBASE + 0x6c)
233 251
252/* Chip Config */
253#define LOONGSON_CHIPCFG0 LOONGSON_REG(LOONGSON_REGBASE + 0x80)
254
234/* pcimap */ 255/* pcimap */
235 256
236#define LOONGSON_PCIMAP_PCIMAP_LO0 0x0000003f 257#define LOONGSON_PCIMAP_PCIMAP_LO0 0x0000003f
@@ -246,9 +267,6 @@ static inline void do_perfcnt_IRQ(void)
246#ifdef CONFIG_CPU_SUPPORTS_CPUFREQ 267#ifdef CONFIG_CPU_SUPPORTS_CPUFREQ
247#include <linux/cpufreq.h> 268#include <linux/cpufreq.h>
248extern struct cpufreq_frequency_table loongson2_clockmod_table[]; 269extern struct cpufreq_frequency_table loongson2_clockmod_table[];
249
250/* Chip Config */
251#define LOONGSON_CHIPCFG0 LOONGSON_REG(LOONGSON_REGBASE + 0x80)
252#endif 270#endif
253 271
254/* 272/*
diff --git a/arch/mips/include/asm/mach-loongson/machine.h b/arch/mips/include/asm/mach-loongson/machine.h
index 3810d5ca84ac..1b1f592fa2be 100644
--- a/arch/mips/include/asm/mach-loongson/machine.h
+++ b/arch/mips/include/asm/mach-loongson/machine.h
@@ -24,4 +24,10 @@
24 24
25#endif 25#endif
26 26
27#ifdef CONFIG_LEMOTE_MACH3A
28
29#define LOONGSON_MACHTYPE MACH_LEMOTE_A1101
30
31#endif /* CONFIG_LEMOTE_MACH3A */
32
27#endif /* __ASM_MACH_LOONGSON_MACHINE_H */ 33#endif /* __ASM_MACH_LOONGSON_MACHINE_H */
diff --git a/arch/mips/include/asm/mach-loongson/pci.h b/arch/mips/include/asm/mach-loongson/pci.h
index bc99dab4ef63..1212774f66ef 100644
--- a/arch/mips/include/asm/mach-loongson/pci.h
+++ b/arch/mips/include/asm/mach-loongson/pci.h
@@ -40,8 +40,13 @@ extern struct pci_ops loongson_pci_ops;
40#else /* loongson2f/32bit & loongson2e */ 40#else /* loongson2f/32bit & loongson2e */
41 41
42/* this pci memory space is mapped by pcimap in pci.c */ 42/* this pci memory space is mapped by pcimap in pci.c */
43#ifdef CONFIG_CPU_LOONGSON3
44#define LOONGSON_PCI_MEM_START 0x40000000UL
45#define LOONGSON_PCI_MEM_END 0x7effffffUL
46#else
43#define LOONGSON_PCI_MEM_START LOONGSON_PCILO1_BASE 47#define LOONGSON_PCI_MEM_START LOONGSON_PCILO1_BASE
44#define LOONGSON_PCI_MEM_END (LOONGSON_PCILO1_BASE + 0x04000000 * 2) 48#define LOONGSON_PCI_MEM_END (LOONGSON_PCILO1_BASE + 0x04000000 * 2)
49#endif
45/* this is an offset from mips_io_port_base */ 50/* this is an offset from mips_io_port_base */
46#define LOONGSON_PCI_IO_START 0x00004000UL 51#define LOONGSON_PCI_IO_START 0x00004000UL
47 52
diff --git a/arch/mips/include/asm/mach-loongson/spaces.h b/arch/mips/include/asm/mach-loongson/spaces.h
new file mode 100644
index 000000000000..e2506ee90044
--- /dev/null
+++ b/arch/mips/include/asm/mach-loongson/spaces.h
@@ -0,0 +1,9 @@
1#ifndef __ASM_MACH_LOONGSON_SPACES_H_
2#define __ASM_MACH_LOONGSON_SPACES_H_
3
4#if defined(CONFIG_64BIT)
5#define CAC_BASE _AC(0x9800000000000000, UL)
6#endif /* CONFIG_64BIT */
7
8#include <asm/mach-generic/spaces.h>
9#endif
diff --git a/arch/mips/include/asm/mach-malta/kernel-entry-init.h b/arch/mips/include/asm/mach-malta/kernel-entry-init.h
index 0b793e7bf67e..7c5e17a17849 100644
--- a/arch/mips/include/asm/mach-malta/kernel-entry-init.h
+++ b/arch/mips/include/asm/mach-malta/kernel-entry-init.h
@@ -5,10 +5,80 @@
5 * 5 *
6 * Chris Dearman (chris@mips.com) 6 * Chris Dearman (chris@mips.com)
7 * Copyright (C) 2007 Mips Technologies, Inc. 7 * Copyright (C) 2007 Mips Technologies, Inc.
8 * Copyright (C) 2014 Imagination Technologies Ltd.
8 */ 9 */
9#ifndef __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H 10#ifndef __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H
10#define __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H 11#define __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H
11 12
13 /*
14 * Prepare segments for EVA boot:
15 *
16 * This is in case the processor boots in legacy configuration
17 * (SI_EVAReset is de-asserted and CONFIG5.K == 0)
18 *
19 * On entry, t1 is loaded with CP0_CONFIG
20 *
21 * ========================= Mappings =============================
22 * Virtual memory Physical memory Mapping
23 * 0x00000000 - 0x7fffffff 0x80000000 - 0xfffffffff MUSUK (kuseg)
24 * Flat 2GB physical memory
25 *
26 * 0x80000000 - 0x9fffffff 0x00000000 - 0x1ffffffff MUSUK (kseg0)
27 * 0xa0000000 - 0xbf000000 0x00000000 - 0x1ffffffff MUSUK (kseg1)
28 * 0xc0000000 - 0xdfffffff - MK (kseg2)
29 * 0xe0000000 - 0xffffffff - MK (kseg3)
30 *
31 *
32 * Lowmem is expanded to 2GB
33 */
34 .macro eva_entry
35 /*
36 * Get Config.K0 value and use it to program
37 * the segmentation registers
38 */
39 andi t1, 0x7 /* CCA */
40 move t2, t1
41 ins t2, t1, 16, 3
42 /* SegCtl0 */
43 li t0, ((MIPS_SEGCFG_MK << MIPS_SEGCFG_AM_SHIFT) | \
44 (0 << MIPS_SEGCFG_PA_SHIFT) | \
45 (1 << MIPS_SEGCFG_EU_SHIFT)) | \
46 (((MIPS_SEGCFG_MK << MIPS_SEGCFG_AM_SHIFT) | \
47 (0 << MIPS_SEGCFG_PA_SHIFT) | \
48 (1 << MIPS_SEGCFG_EU_SHIFT)) << 16)
49 or t0, t2
50 mtc0 t0, $5, 2
51
52 /* SegCtl1 */
53 li t0, ((MIPS_SEGCFG_MUSUK << MIPS_SEGCFG_AM_SHIFT) | \
54 (0 << MIPS_SEGCFG_PA_SHIFT) | \
55 (2 << MIPS_SEGCFG_C_SHIFT) | \
56 (1 << MIPS_SEGCFG_EU_SHIFT)) | \
57 (((MIPS_SEGCFG_MUSUK << MIPS_SEGCFG_AM_SHIFT) | \
58 (0 << MIPS_SEGCFG_PA_SHIFT) | \
59 (1 << MIPS_SEGCFG_EU_SHIFT)) << 16)
60 ins t0, t1, 16, 3
61 mtc0 t0, $5, 3
62
63 /* SegCtl2 */
64 li t0, ((MIPS_SEGCFG_MUSUK << MIPS_SEGCFG_AM_SHIFT) | \
65 (6 << MIPS_SEGCFG_PA_SHIFT) | \
66 (1 << MIPS_SEGCFG_EU_SHIFT)) | \
67 (((MIPS_SEGCFG_MUSUK << MIPS_SEGCFG_AM_SHIFT) | \
68 (4 << MIPS_SEGCFG_PA_SHIFT) | \
69 (1 << MIPS_SEGCFG_EU_SHIFT)) << 16)
70 or t0, t2
71 mtc0 t0, $5, 4
72
73 jal mips_ihb
74 mfc0 t0, $16, 5
75 li t2, 0x40000000 /* K bit */
76 or t0, t0, t2
77 mtc0 t0, $16, 5
78 sync
79 jal mips_ihb
80 .endm
81
12 .macro kernel_entry_setup 82 .macro kernel_entry_setup
13#ifdef CONFIG_MIPS_MT_SMTC 83#ifdef CONFIG_MIPS_MT_SMTC
14 mfc0 t0, CP0_CONFIG 84 mfc0 t0, CP0_CONFIG
@@ -39,14 +109,57 @@
39nonmt_processor: 109nonmt_processor:
40 .asciz "SMTC kernel requires the MT ASE to run\n" 110 .asciz "SMTC kernel requires the MT ASE to run\n"
41 __FINIT 111 __FINIT
420:
43#endif 112#endif
113
114#ifdef CONFIG_EVA
115 sync
116 ehb
117
118 mfc0 t1, CP0_CONFIG
119 bgez t1, 9f
120 mfc0 t0, CP0_CONFIG, 1
121 bgez t0, 9f
122 mfc0 t0, CP0_CONFIG, 2
123 bgez t0, 9f
124 mfc0 t0, CP0_CONFIG, 3
125 sll t0, t0, 6 /* SC bit */
126 bgez t0, 9f
127
128 eva_entry
129 b 0f
1309:
131 /* Assume we came from YAMON... */
132 PTR_LA v0, 0x9fc00534 /* YAMON print */
133 lw v0, (v0)
134 move a0, zero
135 PTR_LA a1, nonsc_processor
136 jal v0
137
138 PTR_LA v0, 0x9fc00520 /* YAMON exit */
139 lw v0, (v0)
140 li a0, 1
141 jal v0
142
1431: b 1b
144 nop
145 __INITDATA
146nonsc_processor:
147 .asciz "EVA kernel requires a MIPS core with Segment Control implemented\n"
148 __FINIT
149#endif /* CONFIG_EVA */
1500:
44 .endm 151 .endm
45 152
46/* 153/*
47 * Do SMP slave processor setup necessary before we can safely execute C code. 154 * Do SMP slave processor setup necessary before we can safely execute C code.
48 */ 155 */
49 .macro smp_slave_setup 156 .macro smp_slave_setup
157#ifdef CONFIG_EVA
158 sync
159 ehb
160 mfc0 t1, CP0_CONFIG
161 eva_entry
162#endif
50 .endm 163 .endm
51 164
52#endif /* __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H */ 165#endif /* __ASM_MACH_MIPS_KERNEL_ENTRY_INIT_H */
diff --git a/arch/mips/include/asm/mach-malta/spaces.h b/arch/mips/include/asm/mach-malta/spaces.h
new file mode 100644
index 000000000000..d7e54971ec66
--- /dev/null
+++ b/arch/mips/include/asm/mach-malta/spaces.h
@@ -0,0 +1,46 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2014 Imagination Technologies Ltd.
7 */
8
9#ifndef _ASM_MALTA_SPACES_H
10#define _ASM_MALTA_SPACES_H
11
12#ifdef CONFIG_EVA
13
14/*
15 * Traditional Malta Board Memory Map for EVA
16 *
17 * 0x00000000 - 0x0fffffff: 1st RAM region, 256MB
18 * 0x10000000 - 0x1bffffff: GIC and CPC Control Registers
19 * 0x1c000000 - 0x1fffffff: I/O And Flash
20 * 0x20000000 - 0x7fffffff: 2nd RAM region, 1.5GB
21 * 0x80000000 - 0xffffffff: Physical memory aliases to 0x0 (2GB)
22 *
23 * The kernel is still located in 0x80000000(kseg0). However,
24 * the physical mask has been shifted to 0x80000000 which exploits the alias
25 * on the Malta board. As a result of which, we override the __pa_symbol
26 * to peform direct mapping from virtual to physical addresses. In other
27 * words, the 0x80000000 virtual address maps to 0x80000000 physical address
28 * which in turn aliases to 0x0. We do this in order to be able to use a flat
29 * 2GB of memory (0x80000000 - 0xffffffff) so we can avoid the I/O hole in
30 * 0x10000000 - 0x1fffffff.
31 * The last 64KB of physical memory are reserved for correct HIGHMEM
32 * macros arithmetics.
33 *
34 */
35
36#define PAGE_OFFSET _AC(0x0, UL)
37#define PHYS_OFFSET _AC(0x80000000, UL)
38#define HIGHMEM_START _AC(0xffff0000, UL)
39
40#define __pa_symbol(x) (RELOC_HIDE((unsigned long)(x), 0))
41
42#endif /* CONFIG_EVA */
43
44#include <asm/mach-generic/spaces.h>
45
46#endif /* _ASM_MALTA_SPACES_H */
diff --git a/arch/mips/include/asm/mach-pmcs-msp71xx/msp_regops.h b/arch/mips/include/asm/mach-pmcs-msp71xx/msp_regops.h
index 2dbc7a8cec1a..fc946c835995 100644
--- a/arch/mips/include/asm/mach-pmcs-msp71xx/msp_regops.h
+++ b/arch/mips/include/asm/mach-pmcs-msp71xx/msp_regops.h
@@ -76,7 +76,7 @@ static inline void set_value_reg32(volatile u32 *const addr,
76 76
77 __asm__ __volatile__( 77 __asm__ __volatile__(
78 " .set push \n" 78 " .set push \n"
79 " .set mips3 \n" 79 " .set arch=r4000 \n"
80 "1: ll %0, %1 # set_value_reg32 \n" 80 "1: ll %0, %1 # set_value_reg32 \n"
81 " and %0, %2 \n" 81 " and %0, %2 \n"
82 " or %0, %3 \n" 82 " or %0, %3 \n"
@@ -98,7 +98,7 @@ static inline void set_reg32(volatile u32 *const addr,
98 98
99 __asm__ __volatile__( 99 __asm__ __volatile__(
100 " .set push \n" 100 " .set push \n"
101 " .set mips3 \n" 101 " .set arch=r4000 \n"
102 "1: ll %0, %1 # set_reg32 \n" 102 "1: ll %0, %1 # set_reg32 \n"
103 " or %0, %2 \n" 103 " or %0, %2 \n"
104 " sc %0, %1 \n" 104 " sc %0, %1 \n"
@@ -119,7 +119,7 @@ static inline void clear_reg32(volatile u32 *const addr,
119 119
120 __asm__ __volatile__( 120 __asm__ __volatile__(
121 " .set push \n" 121 " .set push \n"
122 " .set mips3 \n" 122 " .set arch=r4000 \n"
123 "1: ll %0, %1 # clear_reg32 \n" 123 "1: ll %0, %1 # clear_reg32 \n"
124 " and %0, %2 \n" 124 " and %0, %2 \n"
125 " sc %0, %1 \n" 125 " sc %0, %1 \n"
@@ -140,7 +140,7 @@ static inline void toggle_reg32(volatile u32 *const addr,
140 140
141 __asm__ __volatile__( 141 __asm__ __volatile__(
142 " .set push \n" 142 " .set push \n"
143 " .set mips3 \n" 143 " .set arch=r4000 \n"
144 "1: ll %0, %1 # toggle_reg32 \n" 144 "1: ll %0, %1 # toggle_reg32 \n"
145 " xor %0, %2 \n" 145 " xor %0, %2 \n"
146 " sc %0, %1 \n" 146 " sc %0, %1 \n"
@@ -216,7 +216,7 @@ static inline u32 blocking_read_reg32(volatile u32 *const addr)
216#define custom_read_reg32(address, tmp) \ 216#define custom_read_reg32(address, tmp) \
217 __asm__ __volatile__( \ 217 __asm__ __volatile__( \
218 " .set push \n" \ 218 " .set push \n" \
219 " .set mips3 \n" \ 219 " .set arch=r4000 \n" \
220 "1: ll %0, %1 #custom_read_reg32 \n" \ 220 "1: ll %0, %1 #custom_read_reg32 \n" \
221 " .set pop \n" \ 221 " .set pop \n" \
222 : "=r" (tmp), "=m" (*address) \ 222 : "=r" (tmp), "=m" (*address) \
@@ -225,7 +225,7 @@ static inline u32 blocking_read_reg32(volatile u32 *const addr)
225#define custom_write_reg32(address, tmp) \ 225#define custom_write_reg32(address, tmp) \
226 __asm__ __volatile__( \ 226 __asm__ __volatile__( \
227 " .set push \n" \ 227 " .set push \n" \
228 " .set mips3 \n" \ 228 " .set arch=r4000 \n" \
229 " sc %0, %1 #custom_write_reg32 \n" \ 229 " sc %0, %1 #custom_write_reg32 \n" \
230 " "__beqz"%0, 1b \n" \ 230 " "__beqz"%0, 1b \n" \
231 " nop \n" \ 231 " nop \n" \
diff --git a/arch/mips/include/asm/mips-boards/malta.h b/arch/mips/include/asm/mips-boards/malta.h
index 722bc889eab5..fd9774269a5e 100644
--- a/arch/mips/include/asm/mips-boards/malta.h
+++ b/arch/mips/include/asm/mips-boards/malta.h
@@ -64,6 +64,11 @@ static inline unsigned long get_msc_port_base(unsigned long reg)
64#define GIC_ADDRSPACE_SZ (128 * 1024) 64#define GIC_ADDRSPACE_SZ (128 * 1024)
65 65
66/* 66/*
67 * CPC Specific definitions
68 */
69#define CPC_BASE_ADDR 0x1bde0000
70
71/*
67 * MSC01 BIU Specific definitions 72 * MSC01 BIU Specific definitions
68 * FIXME : These should be elsewhere ? 73 * FIXME : These should be elsewhere ?
69 */ 74 */
diff --git a/arch/mips/include/asm/mips-boards/piix4.h b/arch/mips/include/asm/mips-boards/piix4.h
index 836e2ede24de..9cf54041d416 100644
--- a/arch/mips/include/asm/mips-boards/piix4.h
+++ b/arch/mips/include/asm/mips-boards/piix4.h
@@ -50,4 +50,9 @@
50#define PIIX4_FUNC1_IDETIM_SECONDARY_HI 0x43 50#define PIIX4_FUNC1_IDETIM_SECONDARY_HI 0x43
51#define PIIX4_FUNC1_IDETIM_SECONDARY_HI_IDE_DECODE_EN (1 << 7) 51#define PIIX4_FUNC1_IDETIM_SECONDARY_HI_IDE_DECODE_EN (1 << 7)
52 52
53/* Power Management Configuration Space */
54#define PIIX4_FUNC3_PMBA 0x40
55#define PIIX4_FUNC3_PMREGMISC 0x80
56#define PIIX4_FUNC3_PMREGMISC_EN (1 << 0)
57
53#endif /* __ASM_MIPS_BOARDS_PIIX4_H */ 58#endif /* __ASM_MIPS_BOARDS_PIIX4_H */
diff --git a/arch/mips/include/asm/mips-cm.h b/arch/mips/include/asm/mips-cm.h
new file mode 100644
index 000000000000..6a9d2dd005ca
--- /dev/null
+++ b/arch/mips/include/asm/mips-cm.h
@@ -0,0 +1,322 @@
1/*
2 * Copyright (C) 2013 Imagination Technologies
3 * Author: Paul Burton <paul.burton@imgtec.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#ifndef __MIPS_ASM_MIPS_CM_H__
12#define __MIPS_ASM_MIPS_CM_H__
13
14#include <linux/io.h>
15#include <linux/types.h>
16
17/* The base address of the CM GCR block */
18extern void __iomem *mips_cm_base;
19
20/* The base address of the CM L2-only sync region */
21extern void __iomem *mips_cm_l2sync_base;
22
23/**
24 * __mips_cm_phys_base - retrieve the physical base address of the CM
25 *
26 * This function returns the physical base address of the Coherence Manager
27 * global control block, or 0 if no Coherence Manager is present. It provides
28 * a default implementation which reads the CMGCRBase register where available,
29 * and may be overriden by platforms which determine this address in a
30 * different way by defining a function with the same prototype except for the
31 * name mips_cm_phys_base (without underscores).
32 */
33extern phys_t __mips_cm_phys_base(void);
34
35/**
36 * mips_cm_probe - probe for a Coherence Manager
37 *
38 * Attempt to detect the presence of a Coherence Manager. Returns 0 if a CM
39 * is successfully detected, else -errno.
40 */
41#ifdef CONFIG_MIPS_CM
42extern int mips_cm_probe(void);
43#else
44static inline int mips_cm_probe(void)
45{
46 return -ENODEV;
47}
48#endif
49
50/**
51 * mips_cm_present - determine whether a Coherence Manager is present
52 *
53 * Returns true if a CM is present in the system, else false.
54 */
55static inline bool mips_cm_present(void)
56{
57#ifdef CONFIG_MIPS_CM
58 return mips_cm_base != NULL;
59#else
60 return false;
61#endif
62}
63
64/**
65 * mips_cm_has_l2sync - determine whether an L2-only sync region is present
66 *
67 * Returns true if the system implements an L2-only sync region, else false.
68 */
69static inline bool mips_cm_has_l2sync(void)
70{
71#ifdef CONFIG_MIPS_CM
72 return mips_cm_l2sync_base != NULL;
73#else
74 return false;
75#endif
76}
77
78/* Offsets to register blocks from the CM base address */
79#define MIPS_CM_GCB_OFS 0x0000 /* Global Control Block */
80#define MIPS_CM_CLCB_OFS 0x2000 /* Core Local Control Block */
81#define MIPS_CM_COCB_OFS 0x4000 /* Core Other Control Block */
82#define MIPS_CM_GDB_OFS 0x6000 /* Global Debug Block */
83
84/* Total size of the CM memory mapped registers */
85#define MIPS_CM_GCR_SIZE 0x8000
86
87/* Size of the L2-only sync region */
88#define MIPS_CM_L2SYNC_SIZE 0x1000
89
90/* Macros to ease the creation of register access functions */
91#define BUILD_CM_R_(name, off) \
92static inline u32 *addr_gcr_##name(void) \
93{ \
94 return (u32 *)(mips_cm_base + (off)); \
95} \
96 \
97static inline u32 read_gcr_##name(void) \
98{ \
99 return __raw_readl(addr_gcr_##name()); \
100}
101
102#define BUILD_CM__W(name, off) \
103static inline void write_gcr_##name(u32 value) \
104{ \
105 __raw_writel(value, addr_gcr_##name()); \
106}
107
108#define BUILD_CM_RW(name, off) \
109 BUILD_CM_R_(name, off) \
110 BUILD_CM__W(name, off)
111
112#define BUILD_CM_Cx_R_(name, off) \
113 BUILD_CM_R_(cl_##name, MIPS_CM_CLCB_OFS + (off)) \
114 BUILD_CM_R_(co_##name, MIPS_CM_COCB_OFS + (off))
115
116#define BUILD_CM_Cx__W(name, off) \
117 BUILD_CM__W(cl_##name, MIPS_CM_CLCB_OFS + (off)) \
118 BUILD_CM__W(co_##name, MIPS_CM_COCB_OFS + (off))
119
120#define BUILD_CM_Cx_RW(name, off) \
121 BUILD_CM_Cx_R_(name, off) \
122 BUILD_CM_Cx__W(name, off)
123
124/* GCB register accessor functions */
125BUILD_CM_R_(config, MIPS_CM_GCB_OFS + 0x00)
126BUILD_CM_RW(base, MIPS_CM_GCB_OFS + 0x08)
127BUILD_CM_RW(access, MIPS_CM_GCB_OFS + 0x20)
128BUILD_CM_R_(rev, MIPS_CM_GCB_OFS + 0x30)
129BUILD_CM_RW(error_mask, MIPS_CM_GCB_OFS + 0x40)
130BUILD_CM_RW(error_cause, MIPS_CM_GCB_OFS + 0x48)
131BUILD_CM_RW(error_addr, MIPS_CM_GCB_OFS + 0x50)
132BUILD_CM_RW(error_mult, MIPS_CM_GCB_OFS + 0x58)
133BUILD_CM_RW(l2_only_sync_base, MIPS_CM_GCB_OFS + 0x70)
134BUILD_CM_RW(gic_base, MIPS_CM_GCB_OFS + 0x80)
135BUILD_CM_RW(cpc_base, MIPS_CM_GCB_OFS + 0x88)
136BUILD_CM_RW(reg0_base, MIPS_CM_GCB_OFS + 0x90)
137BUILD_CM_RW(reg0_mask, MIPS_CM_GCB_OFS + 0x98)
138BUILD_CM_RW(reg1_base, MIPS_CM_GCB_OFS + 0xa0)
139BUILD_CM_RW(reg1_mask, MIPS_CM_GCB_OFS + 0xa8)
140BUILD_CM_RW(reg2_base, MIPS_CM_GCB_OFS + 0xb0)
141BUILD_CM_RW(reg2_mask, MIPS_CM_GCB_OFS + 0xb8)
142BUILD_CM_RW(reg3_base, MIPS_CM_GCB_OFS + 0xc0)
143BUILD_CM_RW(reg3_mask, MIPS_CM_GCB_OFS + 0xc8)
144BUILD_CM_R_(gic_status, MIPS_CM_GCB_OFS + 0xd0)
145BUILD_CM_R_(cpc_status, MIPS_CM_GCB_OFS + 0xf0)
146
147/* Core Local & Core Other register accessor functions */
148BUILD_CM_Cx_RW(reset_release, 0x00)
149BUILD_CM_Cx_RW(coherence, 0x08)
150BUILD_CM_Cx_R_(config, 0x10)
151BUILD_CM_Cx_RW(other, 0x18)
152BUILD_CM_Cx_RW(reset_base, 0x20)
153BUILD_CM_Cx_R_(id, 0x28)
154BUILD_CM_Cx_RW(reset_ext_base, 0x30)
155BUILD_CM_Cx_R_(tcid_0_priority, 0x40)
156BUILD_CM_Cx_R_(tcid_1_priority, 0x48)
157BUILD_CM_Cx_R_(tcid_2_priority, 0x50)
158BUILD_CM_Cx_R_(tcid_3_priority, 0x58)
159BUILD_CM_Cx_R_(tcid_4_priority, 0x60)
160BUILD_CM_Cx_R_(tcid_5_priority, 0x68)
161BUILD_CM_Cx_R_(tcid_6_priority, 0x70)
162BUILD_CM_Cx_R_(tcid_7_priority, 0x78)
163BUILD_CM_Cx_R_(tcid_8_priority, 0x80)
164
165/* GCR_CONFIG register fields */
166#define CM_GCR_CONFIG_NUMIOCU_SHF 8
167#define CM_GCR_CONFIG_NUMIOCU_MSK (_ULCAST_(0xf) << 8)
168#define CM_GCR_CONFIG_PCORES_SHF 0
169#define CM_GCR_CONFIG_PCORES_MSK (_ULCAST_(0xff) << 0)
170
171/* GCR_BASE register fields */
172#define CM_GCR_BASE_GCRBASE_SHF 15
173#define CM_GCR_BASE_GCRBASE_MSK (_ULCAST_(0x1ffff) << 15)
174#define CM_GCR_BASE_CMDEFTGT_SHF 0
175#define CM_GCR_BASE_CMDEFTGT_MSK (_ULCAST_(0x3) << 0)
176#define CM_GCR_BASE_CMDEFTGT_DISABLED 0
177#define CM_GCR_BASE_CMDEFTGT_MEM 1
178#define CM_GCR_BASE_CMDEFTGT_IOCU0 2
179#define CM_GCR_BASE_CMDEFTGT_IOCU1 3
180
181/* GCR_ACCESS register fields */
182#define CM_GCR_ACCESS_ACCESSEN_SHF 0
183#define CM_GCR_ACCESS_ACCESSEN_MSK (_ULCAST_(0xff) << 0)
184
185/* GCR_REV register fields */
186#define CM_GCR_REV_MAJOR_SHF 8
187#define CM_GCR_REV_MAJOR_MSK (_ULCAST_(0xff) << 8)
188#define CM_GCR_REV_MINOR_SHF 0
189#define CM_GCR_REV_MINOR_MSK (_ULCAST_(0xff) << 0)
190
191/* GCR_ERROR_CAUSE register fields */
192#define CM_GCR_ERROR_CAUSE_ERRTYPE_SHF 27
193#define CM_GCR_ERROR_CAUSE_ERRTYPE_MSK (_ULCAST_(0x1f) << 27)
194#define CM_GCR_ERROR_CAUSE_ERRINFO_SHF 0
195#define CM_GCR_ERROR_CAUSE_ERRINGO_MSK (_ULCAST_(0x7ffffff) << 0)
196
197/* GCR_ERROR_MULT register fields */
198#define CM_GCR_ERROR_MULT_ERR2ND_SHF 0
199#define CM_GCR_ERROR_MULT_ERR2ND_MSK (_ULCAST_(0x1f) << 0)
200
201/* GCR_L2_ONLY_SYNC_BASE register fields */
202#define CM_GCR_L2_ONLY_SYNC_BASE_SYNCBASE_SHF 12
203#define CM_GCR_L2_ONLY_SYNC_BASE_SYNCBASE_MSK (_ULCAST_(0xfffff) << 12)
204#define CM_GCR_L2_ONLY_SYNC_BASE_SYNCEN_SHF 0
205#define CM_GCR_L2_ONLY_SYNC_BASE_SYNCEN_MSK (_ULCAST_(0x1) << 0)
206
207/* GCR_GIC_BASE register fields */
208#define CM_GCR_GIC_BASE_GICBASE_SHF 17
209#define CM_GCR_GIC_BASE_GICBASE_MSK (_ULCAST_(0x7fff) << 17)
210#define CM_GCR_GIC_BASE_GICEN_SHF 0
211#define CM_GCR_GIC_BASE_GICEN_MSK (_ULCAST_(0x1) << 0)
212
213/* GCR_CPC_BASE register fields */
214#define CM_GCR_CPC_BASE_CPCBASE_SHF 17
215#define CM_GCR_CPC_BASE_CPCBASE_MSK (_ULCAST_(0x7fff) << 17)
216#define CM_GCR_CPC_BASE_CPCEN_SHF 0
217#define CM_GCR_CPC_BASE_CPCEN_MSK (_ULCAST_(0x1) << 0)
218
219/* GCR_REGn_BASE register fields */
220#define CM_GCR_REGn_BASE_BASEADDR_SHF 16
221#define CM_GCR_REGn_BASE_BASEADDR_MSK (_ULCAST_(0xffff) << 16)
222
223/* GCR_REGn_MASK register fields */
224#define CM_GCR_REGn_MASK_ADDRMASK_SHF 16
225#define CM_GCR_REGn_MASK_ADDRMASK_MSK (_ULCAST_(0xffff) << 16)
226#define CM_GCR_REGn_MASK_CCAOVR_SHF 5
227#define CM_GCR_REGn_MASK_CCAOVR_MSK (_ULCAST_(0x3) << 5)
228#define CM_GCR_REGn_MASK_CCAOVREN_SHF 4
229#define CM_GCR_REGn_MASK_CCAOVREN_MSK (_ULCAST_(0x1) << 4)
230#define CM_GCR_REGn_MASK_DROPL2_SHF 2
231#define CM_GCR_REGn_MASK_DROPL2_MSK (_ULCAST_(0x1) << 2)
232#define CM_GCR_REGn_MASK_CMTGT_SHF 0
233#define CM_GCR_REGn_MASK_CMTGT_MSK (_ULCAST_(0x3) << 0)
234#define CM_GCR_REGn_MASK_CMTGT_DISABLED (_ULCAST_(0x0) << 0)
235#define CM_GCR_REGn_MASK_CMTGT_MEM (_ULCAST_(0x1) << 0)
236#define CM_GCR_REGn_MASK_CMTGT_IOCU0 (_ULCAST_(0x2) << 0)
237#define CM_GCR_REGn_MASK_CMTGT_IOCU1 (_ULCAST_(0x3) << 0)
238
239/* GCR_GIC_STATUS register fields */
240#define CM_GCR_GIC_STATUS_EX_SHF 0
241#define CM_GCR_GIC_STATUS_EX_MSK (_ULCAST_(0x1) << 0)
242
243/* GCR_CPC_STATUS register fields */
244#define CM_GCR_CPC_STATUS_EX_SHF 0
245#define CM_GCR_CPC_STATUS_EX_MSK (_ULCAST_(0x1) << 0)
246
247/* GCR_Cx_COHERENCE register fields */
248#define CM_GCR_Cx_COHERENCE_COHDOMAINEN_SHF 0
249#define CM_GCR_Cx_COHERENCE_COHDOMAINEN_MSK (_ULCAST_(0xff) << 0)
250
251/* GCR_Cx_CONFIG register fields */
252#define CM_GCR_Cx_CONFIG_IOCUTYPE_SHF 10
253#define CM_GCR_Cx_CONFIG_IOCUTYPE_MSK (_ULCAST_(0x3) << 10)
254#define CM_GCR_Cx_CONFIG_PVPE_SHF 0
255#define CM_GCR_Cx_CONFIG_PVPE_MSK (_ULCAST_(0x1ff) << 0)
256
257/* GCR_Cx_OTHER register fields */
258#define CM_GCR_Cx_OTHER_CORENUM_SHF 16
259#define CM_GCR_Cx_OTHER_CORENUM_MSK (_ULCAST_(0xffff) << 16)
260
261/* GCR_Cx_RESET_BASE register fields */
262#define CM_GCR_Cx_RESET_BASE_BEVEXCBASE_SHF 12
263#define CM_GCR_Cx_RESET_BASE_BEVEXCBASE_MSK (_ULCAST_(0xfffff) << 12)
264
265/* GCR_Cx_RESET_EXT_BASE register fields */
266#define CM_GCR_Cx_RESET_EXT_BASE_EVARESET_SHF 31
267#define CM_GCR_Cx_RESET_EXT_BASE_EVARESET_MSK (_ULCAST_(0x1) << 31)
268#define CM_GCR_Cx_RESET_EXT_BASE_UEB_SHF 30
269#define CM_GCR_Cx_RESET_EXT_BASE_UEB_MSK (_ULCAST_(0x1) << 30)
270#define CM_GCR_Cx_RESET_EXT_BASE_BEVEXCMASK_SHF 20
271#define CM_GCR_Cx_RESET_EXT_BASE_BEVEXCMASK_MSK (_ULCAST_(0xff) << 20)
272#define CM_GCR_Cx_RESET_EXT_BASE_BEVEXCPA_SHF 1
273#define CM_GCR_Cx_RESET_EXT_BASE_BEVEXCPA_MSK (_ULCAST_(0x7f) << 1)
274#define CM_GCR_Cx_RESET_EXT_BASE_PRESENT_SHF 0
275#define CM_GCR_Cx_RESET_EXT_BASE_PRESENT_MSK (_ULCAST_(0x1) << 0)
276
277/**
278 * mips_cm_numcores - return the number of cores present in the system
279 *
280 * Returns the value of the PCORES field of the GCR_CONFIG register plus 1, or
281 * zero if no Coherence Manager is present.
282 */
283static inline unsigned mips_cm_numcores(void)
284{
285 if (!mips_cm_present())
286 return 0;
287
288 return ((read_gcr_config() & CM_GCR_CONFIG_PCORES_MSK)
289 >> CM_GCR_CONFIG_PCORES_SHF) + 1;
290}
291
292/**
293 * mips_cm_numiocu - return the number of IOCUs present in the system
294 *
295 * Returns the value of the NUMIOCU field of the GCR_CONFIG register, or zero
296 * if no Coherence Manager is present.
297 */
298static inline unsigned mips_cm_numiocu(void)
299{
300 if (!mips_cm_present())
301 return 0;
302
303 return (read_gcr_config() & CM_GCR_CONFIG_NUMIOCU_MSK)
304 >> CM_GCR_CONFIG_NUMIOCU_SHF;
305}
306
307/**
308 * mips_cm_l2sync - perform an L2-only sync operation
309 *
310 * If an L2-only sync region is present in the system then this function
311 * performs and L2-only sync and returns zero. Otherwise it returns -ENODEV.
312 */
313static inline int mips_cm_l2sync(void)
314{
315 if (!mips_cm_has_l2sync())
316 return -ENODEV;
317
318 writel(0, mips_cm_l2sync_base);
319 return 0;
320}
321
322#endif /* __MIPS_ASM_MIPS_CM_H__ */
diff --git a/arch/mips/include/asm/mips-cpc.h b/arch/mips/include/asm/mips-cpc.h
new file mode 100644
index 000000000000..988507e46d42
--- /dev/null
+++ b/arch/mips/include/asm/mips-cpc.h
@@ -0,0 +1,150 @@
1/*
2 * Copyright (C) 2013 Imagination Technologies
3 * Author: Paul Burton <paul.burton@imgtec.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#ifndef __MIPS_ASM_MIPS_CPC_H__
12#define __MIPS_ASM_MIPS_CPC_H__
13
14#include <linux/io.h>
15#include <linux/types.h>
16
17/* The base address of the CPC registers */
18extern void __iomem *mips_cpc_base;
19
20/**
21 * mips_cpc_default_phys_base - retrieve the default physical base address of
22 * the CPC
23 *
24 * Returns the default physical base address of the Cluster Power Controller
25 * memory mapped registers. This is platform dependant & must therefore be
26 * implemented per-platform.
27 */
28extern phys_t mips_cpc_default_phys_base(void);
29
30/**
31 * mips_cpc_phys_base - retrieve the physical base address of the CPC
32 *
33 * This function returns the physical base address of the Cluster Power
34 * Controller memory mapped registers, or 0 if no Cluster Power Controller
35 * is present. It may be overriden by individual platforms which determine
36 * this address in a different way.
37 */
38extern phys_t __weak mips_cpc_phys_base(void);
39
40/**
41 * mips_cpc_probe - probe for a Cluster Power Controller
42 *
43 * Attempt to detect the presence of a Cluster Power Controller. Returns 0 if
44 * a CPC is successfully detected, else -errno.
45 */
46#ifdef CONFIG_MIPS_CPC
47extern int mips_cpc_probe(void);
48#else
49static inline int mips_cpc_probe(void)
50{
51 return -ENODEV;
52}
53#endif
54
55/**
56 * mips_cpc_present - determine whether a Cluster Power Controller is present
57 *
58 * Returns true if a CPC is present in the system, else false.
59 */
60static inline bool mips_cpc_present(void)
61{
62#ifdef CONFIG_MIPS_CPC
63 return mips_cpc_base != NULL;
64#else
65 return false;
66#endif
67}
68
69/* Offsets from the CPC base address to various control blocks */
70#define MIPS_CPC_GCB_OFS 0x0000
71#define MIPS_CPC_CLCB_OFS 0x2000
72#define MIPS_CPC_COCB_OFS 0x4000
73
74/* Macros to ease the creation of register access functions */
75#define BUILD_CPC_R_(name, off) \
76static inline u32 read_cpc_##name(void) \
77{ \
78 return __raw_readl(mips_cpc_base + (off)); \
79}
80
81#define BUILD_CPC__W(name, off) \
82static inline void write_cpc_##name(u32 value) \
83{ \
84 __raw_writel(value, mips_cpc_base + (off)); \
85}
86
87#define BUILD_CPC_RW(name, off) \
88 BUILD_CPC_R_(name, off) \
89 BUILD_CPC__W(name, off)
90
91#define BUILD_CPC_Cx_R_(name, off) \
92 BUILD_CPC_R_(cl_##name, MIPS_CPC_CLCB_OFS + (off)) \
93 BUILD_CPC_R_(co_##name, MIPS_CPC_COCB_OFS + (off))
94
95#define BUILD_CPC_Cx__W(name, off) \
96 BUILD_CPC__W(cl_##name, MIPS_CPC_CLCB_OFS + (off)) \
97 BUILD_CPC__W(co_##name, MIPS_CPC_COCB_OFS + (off))
98
99#define BUILD_CPC_Cx_RW(name, off) \
100 BUILD_CPC_Cx_R_(name, off) \
101 BUILD_CPC_Cx__W(name, off)
102
103/* GCB register accessor functions */
104BUILD_CPC_RW(access, MIPS_CPC_GCB_OFS + 0x00)
105BUILD_CPC_RW(seqdel, MIPS_CPC_GCB_OFS + 0x08)
106BUILD_CPC_RW(rail, MIPS_CPC_GCB_OFS + 0x10)
107BUILD_CPC_RW(resetlen, MIPS_CPC_GCB_OFS + 0x18)
108BUILD_CPC_R_(revision, MIPS_CPC_GCB_OFS + 0x20)
109
110/* Core Local & Core Other accessor functions */
111BUILD_CPC_Cx_RW(cmd, 0x00)
112BUILD_CPC_Cx_RW(stat_conf, 0x08)
113BUILD_CPC_Cx_RW(other, 0x10)
114
115/* CPC_Cx_CMD register fields */
116#define CPC_Cx_CMD_SHF 0
117#define CPC_Cx_CMD_MSK (_ULCAST_(0xf) << 0)
118#define CPC_Cx_CMD_CLOCKOFF (_ULCAST_(0x1) << 0)
119#define CPC_Cx_CMD_PWRDOWN (_ULCAST_(0x2) << 0)
120#define CPC_Cx_CMD_PWRUP (_ULCAST_(0x3) << 0)
121#define CPC_Cx_CMD_RESET (_ULCAST_(0x4) << 0)
122
123/* CPC_Cx_STAT_CONF register fields */
124#define CPC_Cx_STAT_CONF_PWRUPE_SHF 23
125#define CPC_Cx_STAT_CONF_PWRUPE_MSK (_ULCAST_(0x1) << 23)
126#define CPC_Cx_STAT_CONF_SEQSTATE_SHF 19
127#define CPC_Cx_STAT_CONF_SEQSTATE_MSK (_ULCAST_(0xf) << 19)
128#define CPC_Cx_STAT_CONF_SEQSTATE_D0 (_ULCAST_(0x0) << 19)
129#define CPC_Cx_STAT_CONF_SEQSTATE_U0 (_ULCAST_(0x1) << 19)
130#define CPC_Cx_STAT_CONF_SEQSTATE_U1 (_ULCAST_(0x2) << 19)
131#define CPC_Cx_STAT_CONF_SEQSTATE_U2 (_ULCAST_(0x3) << 19)
132#define CPC_Cx_STAT_CONF_SEQSTATE_U3 (_ULCAST_(0x4) << 19)
133#define CPC_Cx_STAT_CONF_SEQSTATE_U4 (_ULCAST_(0x5) << 19)
134#define CPC_Cx_STAT_CONF_SEQSTATE_U5 (_ULCAST_(0x6) << 19)
135#define CPC_Cx_STAT_CONF_SEQSTATE_U6 (_ULCAST_(0x7) << 19)
136#define CPC_Cx_STAT_CONF_SEQSTATE_D1 (_ULCAST_(0x8) << 19)
137#define CPC_Cx_STAT_CONF_SEQSTATE_D3 (_ULCAST_(0x9) << 19)
138#define CPC_Cx_STAT_CONF_SEQSTATE_D2 (_ULCAST_(0xa) << 19)
139#define CPC_Cx_STAT_CONF_CLKGAT_IMPL_SHF 17
140#define CPC_Cx_STAT_CONF_CLKGAT_IMPL_MSK (_ULCAST_(0x1) << 17)
141#define CPC_Cx_STAT_CONF_PWRDN_IMPL_SHF 16
142#define CPC_Cx_STAT_CONF_PWRDN_IMPL_MSK (_ULCAST_(0x1) << 16)
143#define CPC_Cx_STAT_CONF_EJTAG_PROBE_SHF 15
144#define CPC_Cx_STAT_CONF_EJTAG_PROBE_MSK (_ULCAST_(0x1) << 15)
145
146/* CPC_Cx_OTHER register fields */
147#define CPC_Cx_OTHER_CORENUM_SHF 16
148#define CPC_Cx_OTHER_CORENUM_MSK (_ULCAST_(0xff) << 16)
149
150#endif /* __MIPS_ASM_MIPS_CPC_H__ */
diff --git a/arch/mips/include/asm/mips_mt.h b/arch/mips/include/asm/mips_mt.h
index ac7935203f89..a3df0c3faa0e 100644
--- a/arch/mips/include/asm/mips_mt.h
+++ b/arch/mips/include/asm/mips_mt.h
@@ -18,7 +18,12 @@ extern cpumask_t mt_fpu_cpumask;
18extern unsigned long mt_fpemul_threshold; 18extern unsigned long mt_fpemul_threshold;
19 19
20extern void mips_mt_regdump(unsigned long previous_mvpcontrol_value); 20extern void mips_mt_regdump(unsigned long previous_mvpcontrol_value);
21
22#ifdef CONFIG_MIPS_MT
21extern void mips_mt_set_cpuoptions(void); 23extern void mips_mt_set_cpuoptions(void);
24#else
25static inline void mips_mt_set_cpuoptions(void) { }
26#endif
22 27
23struct class; 28struct class;
24extern struct class *mt_class; 29extern struct class *mt_class;
diff --git a/arch/mips/include/asm/mipsmtregs.h b/arch/mips/include/asm/mipsmtregs.h
index 38b7704ee376..6efa79a27b6a 100644
--- a/arch/mips/include/asm/mipsmtregs.h
+++ b/arch/mips/include/asm/mipsmtregs.h
@@ -176,6 +176,17 @@
176 176
177#ifndef __ASSEMBLY__ 177#ifndef __ASSEMBLY__
178 178
179static inline unsigned core_nvpes(void)
180{
181 unsigned conf0;
182
183 if (!cpu_has_mipsmt)
184 return 1;
185
186 conf0 = read_c0_mvpconf0();
187 return ((conf0 & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT) + 1;
188}
189
179static inline unsigned int dvpe(void) 190static inline unsigned int dvpe(void)
180{ 191{
181 int res = 0; 192 int res = 0;
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index bbc3dd4294bc..3e025b5311db 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -568,11 +568,23 @@
568#define MIPS_CONF1_PC (_ULCAST_(1) << 4) 568#define MIPS_CONF1_PC (_ULCAST_(1) << 4)
569#define MIPS_CONF1_MD (_ULCAST_(1) << 5) 569#define MIPS_CONF1_MD (_ULCAST_(1) << 5)
570#define MIPS_CONF1_C2 (_ULCAST_(1) << 6) 570#define MIPS_CONF1_C2 (_ULCAST_(1) << 6)
571#define MIPS_CONF1_DA_SHF 7
572#define MIPS_CONF1_DA_SZ 3
571#define MIPS_CONF1_DA (_ULCAST_(7) << 7) 573#define MIPS_CONF1_DA (_ULCAST_(7) << 7)
574#define MIPS_CONF1_DL_SHF 10
575#define MIPS_CONF1_DL_SZ 3
572#define MIPS_CONF1_DL (_ULCAST_(7) << 10) 576#define MIPS_CONF1_DL (_ULCAST_(7) << 10)
577#define MIPS_CONF1_DS_SHF 13
578#define MIPS_CONF1_DS_SZ 3
573#define MIPS_CONF1_DS (_ULCAST_(7) << 13) 579#define MIPS_CONF1_DS (_ULCAST_(7) << 13)
580#define MIPS_CONF1_IA_SHF 16
581#define MIPS_CONF1_IA_SZ 3
574#define MIPS_CONF1_IA (_ULCAST_(7) << 16) 582#define MIPS_CONF1_IA (_ULCAST_(7) << 16)
583#define MIPS_CONF1_IL_SHF 19
584#define MIPS_CONF1_IL_SZ 3
575#define MIPS_CONF1_IL (_ULCAST_(7) << 19) 585#define MIPS_CONF1_IL (_ULCAST_(7) << 19)
586#define MIPS_CONF1_IS_SHF 22
587#define MIPS_CONF1_IS_SZ 3
576#define MIPS_CONF1_IS (_ULCAST_(7) << 22) 588#define MIPS_CONF1_IS (_ULCAST_(7) << 22)
577#define MIPS_CONF1_TLBS_SHIFT (25) 589#define MIPS_CONF1_TLBS_SHIFT (25)
578#define MIPS_CONF1_TLBS_SIZE (6) 590#define MIPS_CONF1_TLBS_SIZE (6)
@@ -653,9 +665,16 @@
653 665
654#define MIPS_CONF7_RPS (_ULCAST_(1) << 2) 666#define MIPS_CONF7_RPS (_ULCAST_(1) << 2)
655 667
668#define MIPS_CONF7_IAR (_ULCAST_(1) << 10)
669#define MIPS_CONF7_AR (_ULCAST_(1) << 16)
670
656/* EntryHI bit definition */ 671/* EntryHI bit definition */
657#define MIPS_ENTRYHI_EHINV (_ULCAST_(1) << 10) 672#define MIPS_ENTRYHI_EHINV (_ULCAST_(1) << 10)
658 673
674/* CMGCRBase bit definitions */
675#define MIPS_CMGCRB_BASE 11
676#define MIPS_CMGCRF_BASE (~_ULCAST_((1 << MIPS_CMGCRB_BASE) - 1))
677
659/* 678/*
660 * Bits in the MIPS32/64 coprocessor 1 (FPU) revision register. 679 * Bits in the MIPS32/64 coprocessor 1 (FPU) revision register.
661 */ 680 */
@@ -1010,6 +1029,8 @@ do { \
1010 1029
1011#define read_c0_prid() __read_32bit_c0_register($15, 0) 1030#define read_c0_prid() __read_32bit_c0_register($15, 0)
1012 1031
1032#define read_c0_cmgcrbase() __read_ulong_c0_register($15, 3)
1033
1013#define read_c0_config() __read_32bit_c0_register($16, 0) 1034#define read_c0_config() __read_32bit_c0_register($16, 0)
1014#define read_c0_config1() __read_32bit_c0_register($16, 1) 1035#define read_c0_config1() __read_32bit_c0_register($16, 1)
1015#define read_c0_config2() __read_32bit_c0_register($16, 2) 1036#define read_c0_config2() __read_32bit_c0_register($16, 2)
@@ -1883,6 +1904,7 @@ change_c0_##name(unsigned int change, unsigned int newbits) \
1883__BUILD_SET_C0(status) 1904__BUILD_SET_C0(status)
1884__BUILD_SET_C0(cause) 1905__BUILD_SET_C0(cause)
1885__BUILD_SET_C0(config) 1906__BUILD_SET_C0(config)
1907__BUILD_SET_C0(config5)
1886__BUILD_SET_C0(intcontrol) 1908__BUILD_SET_C0(intcontrol)
1887__BUILD_SET_C0(intctl) 1909__BUILD_SET_C0(intctl)
1888__BUILD_SET_C0(srsmap) 1910__BUILD_SET_C0(srsmap)
diff --git a/arch/mips/include/asm/module.h b/arch/mips/include/asm/module.h
index 44b705d08262..c2edae382d5d 100644
--- a/arch/mips/include/asm/module.h
+++ b/arch/mips/include/asm/module.h
@@ -126,6 +126,8 @@ search_module_dbetables(unsigned long addr)
126#define MODULE_PROC_FAMILY "LOONGSON1 " 126#define MODULE_PROC_FAMILY "LOONGSON1 "
127#elif defined CONFIG_CPU_LOONGSON2 127#elif defined CONFIG_CPU_LOONGSON2
128#define MODULE_PROC_FAMILY "LOONGSON2 " 128#define MODULE_PROC_FAMILY "LOONGSON2 "
129#elif defined CONFIG_CPU_LOONGSON3
130#define MODULE_PROC_FAMILY "LOONGSON3 "
129#elif defined CONFIG_CPU_CAVIUM_OCTEON 131#elif defined CONFIG_CPU_CAVIUM_OCTEON
130#define MODULE_PROC_FAMILY "OCTEON " 132#define MODULE_PROC_FAMILY "OCTEON "
131#elif defined CONFIG_CPU_XLR 133#elif defined CONFIG_CPU_XLR
diff --git a/arch/mips/include/asm/msa.h b/arch/mips/include/asm/msa.h
new file mode 100644
index 000000000000..a2aba6c3ec05
--- /dev/null
+++ b/arch/mips/include/asm/msa.h
@@ -0,0 +1,203 @@
1/*
2 * Copyright (C) 2013 Imagination Technologies
3 * Author: Paul Burton <paul.burton@imgtec.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10#ifndef _ASM_MSA_H
11#define _ASM_MSA_H
12
13#include <asm/mipsregs.h>
14
15extern void _save_msa(struct task_struct *);
16extern void _restore_msa(struct task_struct *);
17
18static inline void enable_msa(void)
19{
20 if (cpu_has_msa) {
21 set_c0_config5(MIPS_CONF5_MSAEN);
22 enable_fpu_hazard();
23 }
24}
25
26static inline void disable_msa(void)
27{
28 if (cpu_has_msa) {
29 clear_c0_config5(MIPS_CONF5_MSAEN);
30 disable_fpu_hazard();
31 }
32}
33
34static inline int is_msa_enabled(void)
35{
36 if (!cpu_has_msa)
37 return 0;
38
39 return read_c0_config5() & MIPS_CONF5_MSAEN;
40}
41
42static inline int thread_msa_context_live(void)
43{
44 /*
45 * Check cpu_has_msa only if it's a constant. This will allow the
46 * compiler to optimise out code for CPUs without MSA without adding
47 * an extra redundant check for CPUs with MSA.
48 */
49 if (__builtin_constant_p(cpu_has_msa) && !cpu_has_msa)
50 return 0;
51
52 return test_thread_flag(TIF_MSA_CTX_LIVE);
53}
54
55static inline void save_msa(struct task_struct *t)
56{
57 if (cpu_has_msa)
58 _save_msa(t);
59}
60
61static inline void restore_msa(struct task_struct *t)
62{
63 if (cpu_has_msa)
64 _restore_msa(t);
65}
66
67#ifdef TOOLCHAIN_SUPPORTS_MSA
68
69#define __BUILD_MSA_CTL_REG(name, cs) \
70static inline unsigned int read_msa_##name(void) \
71{ \
72 unsigned int reg; \
73 __asm__ __volatile__( \
74 " .set push\n" \
75 " .set msa\n" \
76 " cfcmsa %0, $" #cs "\n" \
77 " .set pop\n" \
78 : "=r"(reg)); \
79 return reg; \
80} \
81 \
82static inline void write_msa_##name(unsigned int val) \
83{ \
84 __asm__ __volatile__( \
85 " .set push\n" \
86 " .set msa\n" \
87 " cfcmsa $" #cs ", %0\n" \
88 " .set pop\n" \
89 : : "r"(val)); \
90}
91
92#else /* !TOOLCHAIN_SUPPORTS_MSA */
93
94/*
95 * Define functions using .word for the c[ft]cmsa instructions in order to
96 * allow compilation with toolchains that do not support MSA. Once all
97 * toolchains in use support MSA these can be removed.
98 */
99
100#define __BUILD_MSA_CTL_REG(name, cs) \
101static inline unsigned int read_msa_##name(void) \
102{ \
103 unsigned int reg; \
104 __asm__ __volatile__( \
105 " .set push\n" \
106 " .set noat\n" \
107 " .word 0x787e0059 | (" #cs " << 11)\n" \
108 " move %0, $1\n" \
109 " .set pop\n" \
110 : "=r"(reg)); \
111 return reg; \
112} \
113 \
114static inline void write_msa_##name(unsigned int val) \
115{ \
116 __asm__ __volatile__( \
117 " .set push\n" \
118 " .set noat\n" \
119 " move $1, %0\n" \
120 " .word 0x783e0819 | (" #cs " << 6)\n" \
121 " .set pop\n" \
122 : : "r"(val)); \
123}
124
125#endif /* !TOOLCHAIN_SUPPORTS_MSA */
126
127#define MSA_IR 0
128#define MSA_CSR 1
129#define MSA_ACCESS 2
130#define MSA_SAVE 3
131#define MSA_MODIFY 4
132#define MSA_REQUEST 5
133#define MSA_MAP 6
134#define MSA_UNMAP 7
135
136__BUILD_MSA_CTL_REG(ir, 0)
137__BUILD_MSA_CTL_REG(csr, 1)
138__BUILD_MSA_CTL_REG(access, 2)
139__BUILD_MSA_CTL_REG(save, 3)
140__BUILD_MSA_CTL_REG(modify, 4)
141__BUILD_MSA_CTL_REG(request, 5)
142__BUILD_MSA_CTL_REG(map, 6)
143__BUILD_MSA_CTL_REG(unmap, 7)
144
145/* MSA Implementation Register (MSAIR) */
146#define MSA_IR_REVB 0
147#define MSA_IR_REVF (_ULCAST_(0xff) << MSA_IR_REVB)
148#define MSA_IR_PROCB 8
149#define MSA_IR_PROCF (_ULCAST_(0xff) << MSA_IR_PROCB)
150#define MSA_IR_WRPB 16
151#define MSA_IR_WRPF (_ULCAST_(0x1) << MSA_IR_WRPB)
152
153/* MSA Control & Status Register (MSACSR) */
154#define MSA_CSR_RMB 0
155#define MSA_CSR_RMF (_ULCAST_(0x3) << MSA_CSR_RMB)
156#define MSA_CSR_RM_NEAREST 0
157#define MSA_CSR_RM_TO_ZERO 1
158#define MSA_CSR_RM_TO_POS 2
159#define MSA_CSR_RM_TO_NEG 3
160#define MSA_CSR_FLAGSB 2
161#define MSA_CSR_FLAGSF (_ULCAST_(0x1f) << MSA_CSR_FLAGSB)
162#define MSA_CSR_FLAGS_IB 2
163#define MSA_CSR_FLAGS_IF (_ULCAST_(0x1) << MSA_CSR_FLAGS_IB)
164#define MSA_CSR_FLAGS_UB 3
165#define MSA_CSR_FLAGS_UF (_ULCAST_(0x1) << MSA_CSR_FLAGS_UB)
166#define MSA_CSR_FLAGS_OB 4
167#define MSA_CSR_FLAGS_OF (_ULCAST_(0x1) << MSA_CSR_FLAGS_OB)
168#define MSA_CSR_FLAGS_ZB 5
169#define MSA_CSR_FLAGS_ZF (_ULCAST_(0x1) << MSA_CSR_FLAGS_ZB)
170#define MSA_CSR_FLAGS_VB 6
171#define MSA_CSR_FLAGS_VF (_ULCAST_(0x1) << MSA_CSR_FLAGS_VB)
172#define MSA_CSR_ENABLESB 7
173#define MSA_CSR_ENABLESF (_ULCAST_(0x1f) << MSA_CSR_ENABLESB)
174#define MSA_CSR_ENABLES_IB 7
175#define MSA_CSR_ENABLES_IF (_ULCAST_(0x1) << MSA_CSR_ENABLES_IB)
176#define MSA_CSR_ENABLES_UB 8
177#define MSA_CSR_ENABLES_UF (_ULCAST_(0x1) << MSA_CSR_ENABLES_UB)
178#define MSA_CSR_ENABLES_OB 9
179#define MSA_CSR_ENABLES_OF (_ULCAST_(0x1) << MSA_CSR_ENABLES_OB)
180#define MSA_CSR_ENABLES_ZB 10
181#define MSA_CSR_ENABLES_ZF (_ULCAST_(0x1) << MSA_CSR_ENABLES_ZB)
182#define MSA_CSR_ENABLES_VB 11
183#define MSA_CSR_ENABLES_VF (_ULCAST_(0x1) << MSA_CSR_ENABLES_VB)
184#define MSA_CSR_CAUSEB 12
185#define MSA_CSR_CAUSEF (_ULCAST_(0x3f) << MSA_CSR_CAUSEB)
186#define MSA_CSR_CAUSE_IB 12
187#define MSA_CSR_CAUSE_IF (_ULCAST_(0x1) << MSA_CSR_CAUSE_IB)
188#define MSA_CSR_CAUSE_UB 13
189#define MSA_CSR_CAUSE_UF (_ULCAST_(0x1) << MSA_CSR_CAUSE_UB)
190#define MSA_CSR_CAUSE_OB 14
191#define MSA_CSR_CAUSE_OF (_ULCAST_(0x1) << MSA_CSR_CAUSE_OB)
192#define MSA_CSR_CAUSE_ZB 15
193#define MSA_CSR_CAUSE_ZF (_ULCAST_(0x1) << MSA_CSR_CAUSE_ZB)
194#define MSA_CSR_CAUSE_VB 16
195#define MSA_CSR_CAUSE_VF (_ULCAST_(0x1) << MSA_CSR_CAUSE_VB)
196#define MSA_CSR_CAUSE_EB 17
197#define MSA_CSR_CAUSE_EF (_ULCAST_(0x1) << MSA_CSR_CAUSE_EB)
198#define MSA_CSR_NXB 18
199#define MSA_CSR_NXF (_ULCAST_(0x1) << MSA_CSR_NXB)
200#define MSA_CSR_FSB 24
201#define MSA_CSR_FSF (_ULCAST_(0x1) << MSA_CSR_FSB)
202
203#endif /* _ASM_MSA_H */
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index 5e08bcc74897..5699ec3a71af 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -190,7 +190,9 @@ typedef struct { unsigned long pgprot; } pgprot_t;
190 * https://patchwork.linux-mips.org/patch/1541/ 190 * https://patchwork.linux-mips.org/patch/1541/
191 */ 191 */
192 192
193#ifndef __pa_symbol
193#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0)) 194#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x), 0))
195#endif
194 196
195#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) 197#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
196 198
diff --git a/arch/mips/include/asm/pgtable-bits.h b/arch/mips/include/asm/pgtable-bits.h
index 32aea4852fb0..e592f3687d6f 100644
--- a/arch/mips/include/asm/pgtable-bits.h
+++ b/arch/mips/include/asm/pgtable-bits.h
@@ -235,6 +235,15 @@ static inline uint64_t pte_to_entrylo(unsigned long pte_val)
235#define _CACHE_CACHABLE_NONCOHERENT (5<<_CACHE_SHIFT) 235#define _CACHE_CACHABLE_NONCOHERENT (5<<_CACHE_SHIFT)
236#define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT) 236#define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT)
237 237
238#elif defined(CONFIG_CPU_LOONGSON3)
239
240/* Using COHERENT flag for NONCOHERENT doesn't hurt. */
241
242#define _CACHE_UNCACHED (2<<_CACHE_SHIFT) /* LOONGSON */
243#define _CACHE_CACHABLE_NONCOHERENT (3<<_CACHE_SHIFT) /* LOONGSON */
244#define _CACHE_CACHABLE_COHERENT (3<<_CACHE_SHIFT) /* LOONGSON-3 */
245#define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT) /* LOONGSON */
246
238#else 247#else
239 248
240#define _CACHE_CACHABLE_NO_WA (0<<_CACHE_SHIFT) /* R4600 only */ 249#define _CACHE_CACHABLE_NO_WA (0<<_CACHE_SHIFT) /* R4600 only */
diff --git a/arch/mips/include/asm/processor.h b/arch/mips/include/asm/processor.h
index 3605b844ad87..ad70cba8daff 100644
--- a/arch/mips/include/asm/processor.h
+++ b/arch/mips/include/asm/processor.h
@@ -97,18 +97,48 @@ extern unsigned int vced_count, vcei_count;
97 97
98#define NUM_FPU_REGS 32 98#define NUM_FPU_REGS 32
99 99
100typedef __u64 fpureg_t; 100#ifdef CONFIG_CPU_HAS_MSA
101# define FPU_REG_WIDTH 128
102#else
103# define FPU_REG_WIDTH 64
104#endif
105
106union fpureg {
107 __u32 val32[FPU_REG_WIDTH / 32];
108 __u64 val64[FPU_REG_WIDTH / 64];
109};
110
111#ifdef CONFIG_CPU_LITTLE_ENDIAN
112# define FPR_IDX(width, idx) (idx)
113#else
114# define FPR_IDX(width, idx) ((FPU_REG_WIDTH / (width)) - 1 - (idx))
115#endif
116
117#define BUILD_FPR_ACCESS(width) \
118static inline u##width get_fpr##width(union fpureg *fpr, unsigned idx) \
119{ \
120 return fpr->val##width[FPR_IDX(width, idx)]; \
121} \
122 \
123static inline void set_fpr##width(union fpureg *fpr, unsigned idx, \
124 u##width val) \
125{ \
126 fpr->val##width[FPR_IDX(width, idx)] = val; \
127}
128
129BUILD_FPR_ACCESS(32)
130BUILD_FPR_ACCESS(64)
101 131
102/* 132/*
103 * It would be nice to add some more fields for emulator statistics, but there 133 * It would be nice to add some more fields for emulator statistics,
104 * are a number of fixed offsets in offset.h and elsewhere that would have to 134 * the additional information is private to the FPU emulator for now.
105 * be recalculated by hand. So the additional information will be private to 135 * See arch/mips/include/asm/fpu_emulator.h.
106 * the FPU emulator for now. See asm-mips/fpu_emulator.h.
107 */ 136 */
108 137
109struct mips_fpu_struct { 138struct mips_fpu_struct {
110 fpureg_t fpr[NUM_FPU_REGS]; 139 union fpureg fpr[NUM_FPU_REGS];
111 unsigned int fcr31; 140 unsigned int fcr31;
141 unsigned int msacsr;
112}; 142};
113 143
114#define NUM_DSP_REGS 6 144#define NUM_DSP_REGS 6
@@ -284,8 +314,9 @@ struct thread_struct {
284 * Saved FPU/FPU emulator stuff \ 314 * Saved FPU/FPU emulator stuff \
285 */ \ 315 */ \
286 .fpu = { \ 316 .fpu = { \
287 .fpr = {0,}, \ 317 .fpr = {{{0,},},}, \
288 .fcr31 = 0, \ 318 .fcr31 = 0, \
319 .msacsr = 0, \
289 }, \ 320 }, \
290 /* \ 321 /* \
291 * FPU affinity state (null if not FPAFF) \ 322 * FPU affinity state (null if not FPAFF) \
diff --git a/arch/mips/include/asm/ptrace.h b/arch/mips/include/asm/ptrace.h
index 7bba9da110af..bf1ac8d35783 100644
--- a/arch/mips/include/asm/ptrace.h
+++ b/arch/mips/include/asm/ptrace.h
@@ -82,7 +82,7 @@ static inline long regs_return_value(struct pt_regs *regs)
82#define instruction_pointer(regs) ((regs)->cp0_epc) 82#define instruction_pointer(regs) ((regs)->cp0_epc)
83#define profile_pc(regs) instruction_pointer(regs) 83#define profile_pc(regs) instruction_pointer(regs)
84 84
85extern asmlinkage void syscall_trace_enter(struct pt_regs *regs); 85extern asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall);
86extern asmlinkage void syscall_trace_leave(struct pt_regs *regs); 86extern asmlinkage void syscall_trace_leave(struct pt_regs *regs);
87 87
88extern void die(const char *, struct pt_regs *) __noreturn; 88extern void die(const char *, struct pt_regs *) __noreturn;
diff --git a/arch/mips/include/asm/r4kcache.h b/arch/mips/include/asm/r4kcache.h
index c84caddb8bde..ca64cbe44493 100644
--- a/arch/mips/include/asm/r4kcache.h
+++ b/arch/mips/include/asm/r4kcache.h
@@ -17,6 +17,7 @@
17#include <asm/cpu-features.h> 17#include <asm/cpu-features.h>
18#include <asm/cpu-type.h> 18#include <asm/cpu-type.h>
19#include <asm/mipsmtregs.h> 19#include <asm/mipsmtregs.h>
20#include <asm/uaccess.h> /* for segment_eq() */
20 21
21/* 22/*
22 * This macro return a properly sign-extended address suitable as base address 23 * This macro return a properly sign-extended address suitable as base address
@@ -35,7 +36,7 @@
35 __asm__ __volatile__( \ 36 __asm__ __volatile__( \
36 " .set push \n" \ 37 " .set push \n" \
37 " .set noreorder \n" \ 38 " .set noreorder \n" \
38 " .set mips3\n\t \n" \ 39 " .set arch=r4000 \n" \
39 " cache %0, %1 \n" \ 40 " cache %0, %1 \n" \
40 " .set pop \n" \ 41 " .set pop \n" \
41 : \ 42 : \
@@ -203,7 +204,7 @@ static inline void flush_scache_line(unsigned long addr)
203 __asm__ __volatile__( \ 204 __asm__ __volatile__( \
204 " .set push \n" \ 205 " .set push \n" \
205 " .set noreorder \n" \ 206 " .set noreorder \n" \
206 " .set mips3 \n" \ 207 " .set arch=r4000 \n" \
207 "1: cache %0, (%1) \n" \ 208 "1: cache %0, (%1) \n" \
208 "2: .set pop \n" \ 209 "2: .set pop \n" \
209 " .section __ex_table,\"a\" \n" \ 210 " .section __ex_table,\"a\" \n" \
@@ -212,6 +213,20 @@ static inline void flush_scache_line(unsigned long addr)
212 : \ 213 : \
213 : "i" (op), "r" (addr)) 214 : "i" (op), "r" (addr))
214 215
216#define protected_cachee_op(op,addr) \
217 __asm__ __volatile__( \
218 " .set push \n" \
219 " .set noreorder \n" \
220 " .set mips0 \n" \
221 " .set eva \n" \
222 "1: cachee %0, (%1) \n" \
223 "2: .set pop \n" \
224 " .section __ex_table,\"a\" \n" \
225 " "STR(PTR)" 1b, 2b \n" \
226 " .previous" \
227 : \
228 : "i" (op), "r" (addr))
229
215/* 230/*
216 * The next two are for badland addresses like signal trampolines. 231 * The next two are for badland addresses like signal trampolines.
217 */ 232 */
@@ -223,7 +238,11 @@ static inline void protected_flush_icache_line(unsigned long addr)
223 break; 238 break;
224 239
225 default: 240 default:
241#ifdef CONFIG_EVA
242 protected_cachee_op(Hit_Invalidate_I, addr);
243#else
226 protected_cache_op(Hit_Invalidate_I, addr); 244 protected_cache_op(Hit_Invalidate_I, addr);
245#endif
227 break; 246 break;
228 } 247 }
229} 248}
@@ -356,6 +375,91 @@ static inline void invalidate_tcache_page(unsigned long addr)
356 : "r" (base), \ 375 : "r" (base), \
357 "i" (op)); 376 "i" (op));
358 377
378/*
379 * Perform the cache operation specified by op using a user mode virtual
380 * address while in kernel mode.
381 */
382#define cache16_unroll32_user(base,op) \
383 __asm__ __volatile__( \
384 " .set push \n" \
385 " .set noreorder \n" \
386 " .set mips0 \n" \
387 " .set eva \n" \
388 " cachee %1, 0x000(%0); cachee %1, 0x010(%0) \n" \
389 " cachee %1, 0x020(%0); cachee %1, 0x030(%0) \n" \
390 " cachee %1, 0x040(%0); cachee %1, 0x050(%0) \n" \
391 " cachee %1, 0x060(%0); cachee %1, 0x070(%0) \n" \
392 " cachee %1, 0x080(%0); cachee %1, 0x090(%0) \n" \
393 " cachee %1, 0x0a0(%0); cachee %1, 0x0b0(%0) \n" \
394 " cachee %1, 0x0c0(%0); cachee %1, 0x0d0(%0) \n" \
395 " cachee %1, 0x0e0(%0); cachee %1, 0x0f0(%0) \n" \
396 " cachee %1, 0x100(%0); cachee %1, 0x110(%0) \n" \
397 " cachee %1, 0x120(%0); cachee %1, 0x130(%0) \n" \
398 " cachee %1, 0x140(%0); cachee %1, 0x150(%0) \n" \
399 " cachee %1, 0x160(%0); cachee %1, 0x170(%0) \n" \
400 " cachee %1, 0x180(%0); cachee %1, 0x190(%0) \n" \
401 " cachee %1, 0x1a0(%0); cachee %1, 0x1b0(%0) \n" \
402 " cachee %1, 0x1c0(%0); cachee %1, 0x1d0(%0) \n" \
403 " cachee %1, 0x1e0(%0); cachee %1, 0x1f0(%0) \n" \
404 " .set pop \n" \
405 : \
406 : "r" (base), \
407 "i" (op));
408
409#define cache32_unroll32_user(base, op) \
410 __asm__ __volatile__( \
411 " .set push \n" \
412 " .set noreorder \n" \
413 " .set mips0 \n" \
414 " .set eva \n" \
415 " cachee %1, 0x000(%0); cachee %1, 0x020(%0) \n" \
416 " cachee %1, 0x040(%0); cachee %1, 0x060(%0) \n" \
417 " cachee %1, 0x080(%0); cachee %1, 0x0a0(%0) \n" \
418 " cachee %1, 0x0c0(%0); cachee %1, 0x0e0(%0) \n" \
419 " cachee %1, 0x100(%0); cachee %1, 0x120(%0) \n" \
420 " cachee %1, 0x140(%0); cachee %1, 0x160(%0) \n" \
421 " cachee %1, 0x180(%0); cachee %1, 0x1a0(%0) \n" \
422 " cachee %1, 0x1c0(%0); cachee %1, 0x1e0(%0) \n" \
423 " cachee %1, 0x200(%0); cachee %1, 0x220(%0) \n" \
424 " cachee %1, 0x240(%0); cachee %1, 0x260(%0) \n" \
425 " cachee %1, 0x280(%0); cachee %1, 0x2a0(%0) \n" \
426 " cachee %1, 0x2c0(%0); cachee %1, 0x2e0(%0) \n" \
427 " cachee %1, 0x300(%0); cachee %1, 0x320(%0) \n" \
428 " cachee %1, 0x340(%0); cachee %1, 0x360(%0) \n" \
429 " cachee %1, 0x380(%0); cachee %1, 0x3a0(%0) \n" \
430 " cachee %1, 0x3c0(%0); cachee %1, 0x3e0(%0) \n" \
431 " .set pop \n" \
432 : \
433 : "r" (base), \
434 "i" (op));
435
436#define cache64_unroll32_user(base, op) \
437 __asm__ __volatile__( \
438 " .set push \n" \
439 " .set noreorder \n" \
440 " .set mips0 \n" \
441 " .set eva \n" \
442 " cachee %1, 0x000(%0); cachee %1, 0x040(%0) \n" \
443 " cachee %1, 0x080(%0); cachee %1, 0x0c0(%0) \n" \
444 " cachee %1, 0x100(%0); cachee %1, 0x140(%0) \n" \
445 " cachee %1, 0x180(%0); cachee %1, 0x1c0(%0) \n" \
446 " cachee %1, 0x200(%0); cachee %1, 0x240(%0) \n" \
447 " cachee %1, 0x280(%0); cachee %1, 0x2c0(%0) \n" \
448 " cachee %1, 0x300(%0); cachee %1, 0x340(%0) \n" \
449 " cachee %1, 0x380(%0); cachee %1, 0x3c0(%0) \n" \
450 " cachee %1, 0x400(%0); cachee %1, 0x440(%0) \n" \
451 " cachee %1, 0x480(%0); cachee %1, 0x4c0(%0) \n" \
452 " cachee %1, 0x500(%0); cachee %1, 0x540(%0) \n" \
453 " cachee %1, 0x580(%0); cachee %1, 0x5c0(%0) \n" \
454 " cachee %1, 0x600(%0); cachee %1, 0x640(%0) \n" \
455 " cachee %1, 0x680(%0); cachee %1, 0x6c0(%0) \n" \
456 " cachee %1, 0x700(%0); cachee %1, 0x740(%0) \n" \
457 " cachee %1, 0x780(%0); cachee %1, 0x7c0(%0) \n" \
458 " .set pop \n" \
459 : \
460 : "r" (base), \
461 "i" (op));
462
359/* build blast_xxx, blast_xxx_page, blast_xxx_page_indexed */ 463/* build blast_xxx, blast_xxx_page, blast_xxx_page_indexed */
360#define __BUILD_BLAST_CACHE(pfx, desc, indexop, hitop, lsize, extra) \ 464#define __BUILD_BLAST_CACHE(pfx, desc, indexop, hitop, lsize, extra) \
361static inline void extra##blast_##pfx##cache##lsize(void) \ 465static inline void extra##blast_##pfx##cache##lsize(void) \
@@ -429,6 +533,32 @@ __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 32
429__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64, ) 533__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64, )
430__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128, ) 534__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128, )
431 535
536#define __BUILD_BLAST_USER_CACHE(pfx, desc, indexop, hitop, lsize) \
537static inline void blast_##pfx##cache##lsize##_user_page(unsigned long page) \
538{ \
539 unsigned long start = page; \
540 unsigned long end = page + PAGE_SIZE; \
541 \
542 __##pfx##flush_prologue \
543 \
544 do { \
545 cache##lsize##_unroll32_user(start, hitop); \
546 start += lsize * 32; \
547 } while (start < end); \
548 \
549 __##pfx##flush_epilogue \
550}
551
552__BUILD_BLAST_USER_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D,
553 16)
554__BUILD_BLAST_USER_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 16)
555__BUILD_BLAST_USER_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D,
556 32)
557__BUILD_BLAST_USER_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32)
558__BUILD_BLAST_USER_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D,
559 64)
560__BUILD_BLAST_USER_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64)
561
432/* build blast_xxx_range, protected_blast_xxx_range */ 562/* build blast_xxx_range, protected_blast_xxx_range */
433#define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot, extra) \ 563#define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot, extra) \
434static inline void prot##extra##blast_##pfx##cache##_range(unsigned long start, \ 564static inline void prot##extra##blast_##pfx##cache##_range(unsigned long start, \
@@ -450,12 +580,51 @@ static inline void prot##extra##blast_##pfx##cache##_range(unsigned long start,
450 __##pfx##flush_epilogue \ 580 __##pfx##flush_epilogue \
451} 581}
452 582
583#ifndef CONFIG_EVA
584
453__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_, ) 585__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_, )
454__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_, )
455__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_, ) 586__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_, )
587
588#else
589
590#define __BUILD_PROT_BLAST_CACHE_RANGE(pfx, desc, hitop) \
591static inline void protected_blast_##pfx##cache##_range(unsigned long start,\
592 unsigned long end) \
593{ \
594 unsigned long lsize = cpu_##desc##_line_size(); \
595 unsigned long addr = start & ~(lsize - 1); \
596 unsigned long aend = (end - 1) & ~(lsize - 1); \
597 \
598 __##pfx##flush_prologue \
599 \
600 if (segment_eq(get_fs(), USER_DS)) { \
601 while (1) { \
602 protected_cachee_op(hitop, addr); \
603 if (addr == aend) \
604 break; \
605 addr += lsize; \
606 } \
607 } else { \
608 while (1) { \
609 protected_cache_op(hitop, addr); \
610 if (addr == aend) \
611 break; \
612 addr += lsize; \
613 } \
614 \
615 } \
616 __##pfx##flush_epilogue \
617}
618
619__BUILD_PROT_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D)
620__BUILD_PROT_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I)
621
622#endif
623__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_, )
456__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I_Loongson2, \ 624__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I_Loongson2, \
457 protected_, loongson2_) 625 protected_, loongson2_)
458__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, , ) 626__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, , )
627__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, , )
459__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, , ) 628__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, , )
460/* blast_inv_dcache_range */ 629/* blast_inv_dcache_range */
461__BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, , ) 630__BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, , )
diff --git a/arch/mips/include/asm/sigcontext.h b/arch/mips/include/asm/sigcontext.h
index eeeb0f48c767..f54bdbe85c0d 100644
--- a/arch/mips/include/asm/sigcontext.h
+++ b/arch/mips/include/asm/sigcontext.h
@@ -32,6 +32,8 @@ struct sigcontext32 {
32 __u32 sc_lo2; 32 __u32 sc_lo2;
33 __u32 sc_hi3; 33 __u32 sc_hi3;
34 __u32 sc_lo3; 34 __u32 sc_lo3;
35 __u64 sc_msaregs[32]; /* Most significant 64 bits */
36 __u32 sc_msa_csr;
35}; 37};
36#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */ 38#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 */
37#endif /* _ASM_SIGCONTEXT_H */ 39#endif /* _ASM_SIGCONTEXT_H */
diff --git a/arch/mips/include/asm/smp-cps.h b/arch/mips/include/asm/smp-cps.h
new file mode 100644
index 000000000000..d60d1a2180d1
--- /dev/null
+++ b/arch/mips/include/asm/smp-cps.h
@@ -0,0 +1,33 @@
1/*
2 * Copyright (C) 2013 Imagination Technologies
3 * Author: Paul Burton <paul.burton@imgtec.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#ifndef __MIPS_ASM_SMP_CPS_H__
12#define __MIPS_ASM_SMP_CPS_H__
13
14#ifndef __ASSEMBLY__
15
16struct boot_config {
17 unsigned int core;
18 unsigned int vpe;
19 unsigned long pc;
20 unsigned long sp;
21 unsigned long gp;
22};
23
24extern struct boot_config mips_cps_bootcfg;
25
26extern void mips_cps_core_entry(void);
27
28#else /* __ASSEMBLY__ */
29
30.extern mips_cps_bootcfg;
31
32#endif /* __ASSEMBLY__ */
33#endif /* __MIPS_ASM_SMP_CPS_H__ */
diff --git a/arch/mips/include/asm/smp-ops.h b/arch/mips/include/asm/smp-ops.h
index ef2a8041e78b..73d35b18fb64 100644
--- a/arch/mips/include/asm/smp-ops.h
+++ b/arch/mips/include/asm/smp-ops.h
@@ -13,6 +13,8 @@
13 13
14#include <linux/errno.h> 14#include <linux/errno.h>
15 15
16#include <asm/mips-cm.h>
17
16#ifdef CONFIG_SMP 18#ifdef CONFIG_SMP
17 19
18#include <linux/cpumask.h> 20#include <linux/cpumask.h>
@@ -43,6 +45,9 @@ static inline void plat_smp_setup(void)
43 mp_ops->smp_setup(); 45 mp_ops->smp_setup();
44} 46}
45 47
48extern void gic_send_ipi_single(int cpu, unsigned int action);
49extern void gic_send_ipi_mask(const struct cpumask *mask, unsigned int action);
50
46#else /* !CONFIG_SMP */ 51#else /* !CONFIG_SMP */
47 52
48struct plat_smp_ops; 53struct plat_smp_ops;
@@ -76,6 +81,9 @@ static inline int register_cmp_smp_ops(void)
76#ifdef CONFIG_MIPS_CMP 81#ifdef CONFIG_MIPS_CMP
77 extern struct plat_smp_ops cmp_smp_ops; 82 extern struct plat_smp_ops cmp_smp_ops;
78 83
84 if (!mips_cm_present())
85 return -ENODEV;
86
79 register_smp_ops(&cmp_smp_ops); 87 register_smp_ops(&cmp_smp_ops);
80 88
81 return 0; 89 return 0;
@@ -97,4 +105,13 @@ static inline int register_vsmp_smp_ops(void)
97#endif 105#endif
98} 106}
99 107
108#ifdef CONFIG_MIPS_CPS
109extern int register_cps_smp_ops(void);
110#else
111static inline int register_cps_smp_ops(void)
112{
113 return -ENODEV;
114}
115#endif
116
100#endif /* __ASM_SMP_OPS_H */ 117#endif /* __ASM_SMP_OPS_H */
diff --git a/arch/mips/include/asm/smp.h b/arch/mips/include/asm/smp.h
index eb6008758484..efa02acd3dd5 100644
--- a/arch/mips/include/asm/smp.h
+++ b/arch/mips/include/asm/smp.h
@@ -42,6 +42,7 @@ extern int __cpu_logical_map[NR_CPUS];
42#define SMP_ICACHE_FLUSH 0x4 42#define SMP_ICACHE_FLUSH 0x4
43/* Used by kexec crashdump to save all cpu's state */ 43/* Used by kexec crashdump to save all cpu's state */
44#define SMP_DUMP 0x8 44#define SMP_DUMP 0x8
45#define SMP_ASK_C0COUNT 0x10
45 46
46extern volatile cpumask_t cpu_callin_map; 47extern volatile cpumask_t cpu_callin_map;
47 48
diff --git a/arch/mips/include/asm/stackframe.h b/arch/mips/include/asm/stackframe.h
index 4857e2c8df5a..d301e108d5b8 100644
--- a/arch/mips/include/asm/stackframe.h
+++ b/arch/mips/include/asm/stackframe.h
@@ -435,7 +435,7 @@
435 435
436 .macro RESTORE_SP_AND_RET 436 .macro RESTORE_SP_AND_RET
437 LONG_L sp, PT_R29(sp) 437 LONG_L sp, PT_R29(sp)
438 .set mips3 438 .set arch=r4000
439 eret 439 eret
440 .set mips0 440 .set mips0
441 .endm 441 .endm
diff --git a/arch/mips/include/asm/switch_to.h b/arch/mips/include/asm/switch_to.h
index 278d45a09728..495c1041a2cc 100644
--- a/arch/mips/include/asm/switch_to.h
+++ b/arch/mips/include/asm/switch_to.h
@@ -16,22 +16,29 @@
16#include <asm/watch.h> 16#include <asm/watch.h>
17#include <asm/dsp.h> 17#include <asm/dsp.h>
18#include <asm/cop2.h> 18#include <asm/cop2.h>
19#include <asm/msa.h>
19 20
20struct task_struct; 21struct task_struct;
21 22
23enum {
24 FP_SAVE_NONE = 0,
25 FP_SAVE_VECTOR = -1,
26 FP_SAVE_SCALAR = 1,
27};
28
22/** 29/**
23 * resume - resume execution of a task 30 * resume - resume execution of a task
24 * @prev: The task previously executed. 31 * @prev: The task previously executed.
25 * @next: The task to begin executing. 32 * @next: The task to begin executing.
26 * @next_ti: task_thread_info(next). 33 * @next_ti: task_thread_info(next).
27 * @usedfpu: Non-zero if prev's FP context should be saved. 34 * @fp_save: Which, if any, FP context to save for prev.
28 * 35 *
29 * This function is used whilst scheduling to save the context of prev & load 36 * This function is used whilst scheduling to save the context of prev & load
30 * the context of next. Returns prev. 37 * the context of next. Returns prev.
31 */ 38 */
32extern asmlinkage struct task_struct *resume(struct task_struct *prev, 39extern asmlinkage struct task_struct *resume(struct task_struct *prev,
33 struct task_struct *next, struct thread_info *next_ti, 40 struct task_struct *next, struct thread_info *next_ti,
34 u32 usedfpu); 41 s32 fp_save);
35 42
36extern unsigned int ll_bit; 43extern unsigned int ll_bit;
37extern struct task_struct *ll_task; 44extern struct task_struct *ll_task;
@@ -75,7 +82,8 @@ do { \
75 82
76#define switch_to(prev, next, last) \ 83#define switch_to(prev, next, last) \
77do { \ 84do { \
78 u32 __usedfpu, __c0_stat; \ 85 u32 __c0_stat; \
86 s32 __fpsave = FP_SAVE_NONE; \
79 __mips_mt_fpaff_switch_to(prev); \ 87 __mips_mt_fpaff_switch_to(prev); \
80 if (cpu_has_dsp) \ 88 if (cpu_has_dsp) \
81 __save_dsp(prev); \ 89 __save_dsp(prev); \
@@ -88,8 +96,12 @@ do { \
88 write_c0_status(__c0_stat & ~ST0_CU2); \ 96 write_c0_status(__c0_stat & ~ST0_CU2); \
89 } \ 97 } \
90 __clear_software_ll_bit(); \ 98 __clear_software_ll_bit(); \
91 __usedfpu = test_and_clear_tsk_thread_flag(prev, TIF_USEDFPU); \ 99 if (test_and_clear_tsk_thread_flag(prev, TIF_USEDFPU)) \
92 (last) = resume(prev, next, task_thread_info(next), __usedfpu); \ 100 __fpsave = FP_SAVE_SCALAR; \
101 if (test_and_clear_tsk_thread_flag(prev, TIF_USEDMSA)) \
102 __fpsave = FP_SAVE_VECTOR; \
103 (last) = resume(prev, next, task_thread_info(next), __fpsave); \
104 disable_msa(); \
93} while (0) 105} while (0)
94 106
95#define finish_arch_switch(prev) \ 107#define finish_arch_switch(prev) \
diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h
index f35b131977e6..c6e9cd2bca8d 100644
--- a/arch/mips/include/asm/syscall.h
+++ b/arch/mips/include/asm/syscall.h
@@ -14,17 +14,28 @@
14#define __ASM_MIPS_SYSCALL_H 14#define __ASM_MIPS_SYSCALL_H
15 15
16#include <linux/compiler.h> 16#include <linux/compiler.h>
17#include <linux/audit.h> 17#include <uapi/linux/audit.h>
18#include <linux/elf-em.h> 18#include <linux/elf-em.h>
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/sched.h> 20#include <linux/sched.h>
21#include <linux/uaccess.h> 21#include <linux/uaccess.h>
22#include <asm/ptrace.h> 22#include <asm/ptrace.h>
23#include <asm/unistd.h>
24
25#ifndef __NR_syscall /* Only defined if _MIPS_SIM == _MIPS_SIM_ABI32 */
26#define __NR_syscall 4000
27#endif
23 28
24static inline long syscall_get_nr(struct task_struct *task, 29static inline long syscall_get_nr(struct task_struct *task,
25 struct pt_regs *regs) 30 struct pt_regs *regs)
26{ 31{
27 return regs->regs[2]; 32 /* O32 ABI syscall() - Either 64-bit with O32 or 32-bit */
33 if ((config_enabled(CONFIG_32BIT) ||
34 test_tsk_thread_flag(task, TIF_32BIT_REGS)) &&
35 (regs->regs[2] == __NR_syscall))
36 return regs->regs[4];
37 else
38 return regs->regs[2];
28} 39}
29 40
30static inline unsigned long mips_get_syscall_arg(unsigned long *arg, 41static inline unsigned long mips_get_syscall_arg(unsigned long *arg,
@@ -68,6 +79,12 @@ static inline long syscall_get_return_value(struct task_struct *task,
68 return regs->regs[2]; 79 return regs->regs[2];
69} 80}
70 81
82static inline void syscall_rollback(struct task_struct *task,
83 struct pt_regs *regs)
84{
85 /* Do nothing */
86}
87
71static inline void syscall_set_return_value(struct task_struct *task, 88static inline void syscall_set_return_value(struct task_struct *task,
72 struct pt_regs *regs, 89 struct pt_regs *regs,
73 int error, long val) 90 int error, long val)
@@ -87,6 +104,13 @@ static inline void syscall_get_arguments(struct task_struct *task,
87 unsigned long *args) 104 unsigned long *args)
88{ 105{
89 int ret; 106 int ret;
107 /* O32 ABI syscall() - Either 64-bit with O32 or 32-bit */
108 if ((config_enabled(CONFIG_32BIT) ||
109 test_tsk_thread_flag(task, TIF_32BIT_REGS)) &&
110 (regs->regs[2] == __NR_syscall)) {
111 i++;
112 n++;
113 }
90 114
91 while (n--) 115 while (n--)
92 ret |= mips_get_syscall_arg(args++, task, regs, i++); 116 ret |= mips_get_syscall_arg(args++, task, regs, i++);
@@ -103,11 +127,12 @@ extern const unsigned long sys_call_table[];
103extern const unsigned long sys32_call_table[]; 127extern const unsigned long sys32_call_table[];
104extern const unsigned long sysn32_call_table[]; 128extern const unsigned long sysn32_call_table[];
105 129
106static inline int __syscall_get_arch(void) 130static inline int syscall_get_arch(void)
107{ 131{
108 int arch = EM_MIPS; 132 int arch = EM_MIPS;
109#ifdef CONFIG_64BIT 133#ifdef CONFIG_64BIT
110 arch |= __AUDIT_ARCH_64BIT; 134 if (!test_thread_flag(TIF_32BIT_REGS))
135 arch |= __AUDIT_ARCH_64BIT;
111#endif 136#endif
112#if defined(__LITTLE_ENDIAN) 137#if defined(__LITTLE_ENDIAN)
113 arch |= __AUDIT_ARCH_LE; 138 arch |= __AUDIT_ARCH_LE;
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h
index 24846f9053fe..d2d961d6cb86 100644
--- a/arch/mips/include/asm/thread_info.h
+++ b/arch/mips/include/asm/thread_info.h
@@ -116,6 +116,8 @@ static inline struct thread_info *current_thread_info(void)
116#define TIF_LOAD_WATCH 25 /* If set, load watch registers */ 116#define TIF_LOAD_WATCH 25 /* If set, load watch registers */
117#define TIF_SYSCALL_TRACEPOINT 26 /* syscall tracepoint instrumentation */ 117#define TIF_SYSCALL_TRACEPOINT 26 /* syscall tracepoint instrumentation */
118#define TIF_32BIT_FPREGS 27 /* 32-bit floating point registers */ 118#define TIF_32BIT_FPREGS 27 /* 32-bit floating point registers */
119#define TIF_USEDMSA 29 /* MSA has been used this quantum */
120#define TIF_MSA_CTX_LIVE 30 /* MSA context must be preserved */
119#define TIF_SYSCALL_TRACE 31 /* syscall trace active */ 121#define TIF_SYSCALL_TRACE 31 /* syscall trace active */
120 122
121#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 123#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
@@ -133,10 +135,13 @@ static inline struct thread_info *current_thread_info(void)
133#define _TIF_FPUBOUND (1<<TIF_FPUBOUND) 135#define _TIF_FPUBOUND (1<<TIF_FPUBOUND)
134#define _TIF_LOAD_WATCH (1<<TIF_LOAD_WATCH) 136#define _TIF_LOAD_WATCH (1<<TIF_LOAD_WATCH)
135#define _TIF_32BIT_FPREGS (1<<TIF_32BIT_FPREGS) 137#define _TIF_32BIT_FPREGS (1<<TIF_32BIT_FPREGS)
138#define _TIF_USEDMSA (1<<TIF_USEDMSA)
139#define _TIF_MSA_CTX_LIVE (1<<TIF_MSA_CTX_LIVE)
136#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT) 140#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT)
137 141
138#define _TIF_WORK_SYSCALL_ENTRY (_TIF_NOHZ | _TIF_SYSCALL_TRACE | \ 142#define _TIF_WORK_SYSCALL_ENTRY (_TIF_NOHZ | _TIF_SYSCALL_TRACE | \
139 _TIF_SYSCALL_AUDIT | _TIF_SYSCALL_TRACEPOINT) 143 _TIF_SYSCALL_AUDIT | \
144 _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP)
140 145
141/* work to do in syscall_trace_leave() */ 146/* work to do in syscall_trace_leave() */
142#define _TIF_WORK_SYSCALL_EXIT (_TIF_NOHZ | _TIF_SYSCALL_TRACE | \ 147#define _TIF_WORK_SYSCALL_EXIT (_TIF_NOHZ | _TIF_SYSCALL_TRACE | \
diff --git a/arch/mips/include/asm/uaccess.h b/arch/mips/include/asm/uaccess.h
index f3fa3750f577..a10951090234 100644
--- a/arch/mips/include/asm/uaccess.h
+++ b/arch/mips/include/asm/uaccess.h
@@ -6,6 +6,7 @@
6 * Copyright (C) 1996, 1997, 1998, 1999, 2000, 03, 04 by Ralf Baechle 6 * Copyright (C) 1996, 1997, 1998, 1999, 2000, 03, 04 by Ralf Baechle
7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc. 7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
8 * Copyright (C) 2007 Maciej W. Rozycki 8 * Copyright (C) 2007 Maciej W. Rozycki
9 * Copyright (C) 2014, Imagination Technologies Ltd.
9 */ 10 */
10#ifndef _ASM_UACCESS_H 11#ifndef _ASM_UACCESS_H
11#define _ASM_UACCESS_H 12#define _ASM_UACCESS_H
@@ -13,6 +14,7 @@
13#include <linux/kernel.h> 14#include <linux/kernel.h>
14#include <linux/errno.h> 15#include <linux/errno.h>
15#include <linux/thread_info.h> 16#include <linux/thread_info.h>
17#include <asm/asm-eva.h>
16 18
17/* 19/*
18 * The fs value determines whether argument validity checking should be 20 * The fs value determines whether argument validity checking should be
@@ -222,11 +224,44 @@ struct __large_struct { unsigned long buf[100]; };
222 * Yuck. We need two variants, one for 64bit operation and one 224 * Yuck. We need two variants, one for 64bit operation and one
223 * for 32 bit mode and old iron. 225 * for 32 bit mode and old iron.
224 */ 226 */
227#ifndef CONFIG_EVA
228#define __get_kernel_common(val, size, ptr) __get_user_common(val, size, ptr)
229#else
230/*
231 * Kernel specific functions for EVA. We need to use normal load instructions
232 * to read data from kernel when operating in EVA mode. We use these macros to
233 * avoid redefining __get_user_asm for EVA.
234 */
235#undef _loadd
236#undef _loadw
237#undef _loadh
238#undef _loadb
225#ifdef CONFIG_32BIT 239#ifdef CONFIG_32BIT
226#define __GET_USER_DW(val, ptr) __get_user_asm_ll32(val, ptr) 240#define _loadd _loadw
241#else
242#define _loadd(reg, addr) "ld " reg ", " addr
243#endif
244#define _loadw(reg, addr) "lw " reg ", " addr
245#define _loadh(reg, addr) "lh " reg ", " addr
246#define _loadb(reg, addr) "lb " reg ", " addr
247
248#define __get_kernel_common(val, size, ptr) \
249do { \
250 switch (size) { \
251 case 1: __get_data_asm(val, _loadb, ptr); break; \
252 case 2: __get_data_asm(val, _loadh, ptr); break; \
253 case 4: __get_data_asm(val, _loadw, ptr); break; \
254 case 8: __GET_DW(val, _loadd, ptr); break; \
255 default: __get_user_unknown(); break; \
256 } \
257} while (0)
258#endif
259
260#ifdef CONFIG_32BIT
261#define __GET_DW(val, insn, ptr) __get_data_asm_ll32(val, insn, ptr)
227#endif 262#endif
228#ifdef CONFIG_64BIT 263#ifdef CONFIG_64BIT
229#define __GET_USER_DW(val, ptr) __get_user_asm(val, "ld", ptr) 264#define __GET_DW(val, insn, ptr) __get_data_asm(val, insn, ptr)
230#endif 265#endif
231 266
232extern void __get_user_unknown(void); 267extern void __get_user_unknown(void);
@@ -234,10 +269,10 @@ extern void __get_user_unknown(void);
234#define __get_user_common(val, size, ptr) \ 269#define __get_user_common(val, size, ptr) \
235do { \ 270do { \
236 switch (size) { \ 271 switch (size) { \
237 case 1: __get_user_asm(val, "lb", ptr); break; \ 272 case 1: __get_data_asm(val, user_lb, ptr); break; \
238 case 2: __get_user_asm(val, "lh", ptr); break; \ 273 case 2: __get_data_asm(val, user_lh, ptr); break; \
239 case 4: __get_user_asm(val, "lw", ptr); break; \ 274 case 4: __get_data_asm(val, user_lw, ptr); break; \
240 case 8: __GET_USER_DW(val, ptr); break; \ 275 case 8: __GET_DW(val, user_ld, ptr); break; \
241 default: __get_user_unknown(); break; \ 276 default: __get_user_unknown(); break; \
242 } \ 277 } \
243} while (0) 278} while (0)
@@ -246,8 +281,12 @@ do { \
246({ \ 281({ \
247 int __gu_err; \ 282 int __gu_err; \
248 \ 283 \
249 __chk_user_ptr(ptr); \ 284 if (segment_eq(get_fs(), get_ds())) { \
250 __get_user_common((x), size, ptr); \ 285 __get_kernel_common((x), size, ptr); \
286 } else { \
287 __chk_user_ptr(ptr); \
288 __get_user_common((x), size, ptr); \
289 } \
251 __gu_err; \ 290 __gu_err; \
252}) 291})
253 292
@@ -257,18 +296,22 @@ do { \
257 const __typeof__(*(ptr)) __user * __gu_ptr = (ptr); \ 296 const __typeof__(*(ptr)) __user * __gu_ptr = (ptr); \
258 \ 297 \
259 might_fault(); \ 298 might_fault(); \
260 if (likely(access_ok(VERIFY_READ, __gu_ptr, size))) \ 299 if (likely(access_ok(VERIFY_READ, __gu_ptr, size))) { \
261 __get_user_common((x), size, __gu_ptr); \ 300 if (segment_eq(get_fs(), get_ds())) \
301 __get_kernel_common((x), size, __gu_ptr); \
302 else \
303 __get_user_common((x), size, __gu_ptr); \
304 } \
262 \ 305 \
263 __gu_err; \ 306 __gu_err; \
264}) 307})
265 308
266#define __get_user_asm(val, insn, addr) \ 309#define __get_data_asm(val, insn, addr) \
267{ \ 310{ \
268 long __gu_tmp; \ 311 long __gu_tmp; \
269 \ 312 \
270 __asm__ __volatile__( \ 313 __asm__ __volatile__( \
271 "1: " insn " %1, %3 \n" \ 314 "1: "insn("%1", "%3")" \n" \
272 "2: \n" \ 315 "2: \n" \
273 " .insn \n" \ 316 " .insn \n" \
274 " .section .fixup,\"ax\" \n" \ 317 " .section .fixup,\"ax\" \n" \
@@ -287,7 +330,7 @@ do { \
287/* 330/*
288 * Get a long long 64 using 32 bit registers. 331 * Get a long long 64 using 32 bit registers.
289 */ 332 */
290#define __get_user_asm_ll32(val, addr) \ 333#define __get_data_asm_ll32(val, insn, addr) \
291{ \ 334{ \
292 union { \ 335 union { \
293 unsigned long long l; \ 336 unsigned long long l; \
@@ -295,8 +338,8 @@ do { \
295 } __gu_tmp; \ 338 } __gu_tmp; \
296 \ 339 \
297 __asm__ __volatile__( \ 340 __asm__ __volatile__( \
298 "1: lw %1, (%3) \n" \ 341 "1: " insn("%1", "(%3)")" \n" \
299 "2: lw %D1, 4(%3) \n" \ 342 "2: " insn("%D1", "4(%3)")" \n" \
300 "3: \n" \ 343 "3: \n" \
301 " .insn \n" \ 344 " .insn \n" \
302 " .section .fixup,\"ax\" \n" \ 345 " .section .fixup,\"ax\" \n" \
@@ -315,30 +358,73 @@ do { \
315 (val) = __gu_tmp.t; \ 358 (val) = __gu_tmp.t; \
316} 359}
317 360
361#ifndef CONFIG_EVA
362#define __put_kernel_common(ptr, size) __put_user_common(ptr, size)
363#else
364/*
365 * Kernel specific functions for EVA. We need to use normal load instructions
366 * to read data from kernel when operating in EVA mode. We use these macros to
367 * avoid redefining __get_data_asm for EVA.
368 */
369#undef _stored
370#undef _storew
371#undef _storeh
372#undef _storeb
373#ifdef CONFIG_32BIT
374#define _stored _storew
375#else
376#define _stored(reg, addr) "ld " reg ", " addr
377#endif
378
379#define _storew(reg, addr) "sw " reg ", " addr
380#define _storeh(reg, addr) "sh " reg ", " addr
381#define _storeb(reg, addr) "sb " reg ", " addr
382
383#define __put_kernel_common(ptr, size) \
384do { \
385 switch (size) { \
386 case 1: __put_data_asm(_storeb, ptr); break; \
387 case 2: __put_data_asm(_storeh, ptr); break; \
388 case 4: __put_data_asm(_storew, ptr); break; \
389 case 8: __PUT_DW(_stored, ptr); break; \
390 default: __put_user_unknown(); break; \
391 } \
392} while(0)
393#endif
394
318/* 395/*
319 * Yuck. We need two variants, one for 64bit operation and one 396 * Yuck. We need two variants, one for 64bit operation and one
320 * for 32 bit mode and old iron. 397 * for 32 bit mode and old iron.
321 */ 398 */
322#ifdef CONFIG_32BIT 399#ifdef CONFIG_32BIT
323#define __PUT_USER_DW(ptr) __put_user_asm_ll32(ptr) 400#define __PUT_DW(insn, ptr) __put_data_asm_ll32(insn, ptr)
324#endif 401#endif
325#ifdef CONFIG_64BIT 402#ifdef CONFIG_64BIT
326#define __PUT_USER_DW(ptr) __put_user_asm("sd", ptr) 403#define __PUT_DW(insn, ptr) __put_data_asm(insn, ptr)
327#endif 404#endif
328 405
406#define __put_user_common(ptr, size) \
407do { \
408 switch (size) { \
409 case 1: __put_data_asm(user_sb, ptr); break; \
410 case 2: __put_data_asm(user_sh, ptr); break; \
411 case 4: __put_data_asm(user_sw, ptr); break; \
412 case 8: __PUT_DW(user_sd, ptr); break; \
413 default: __put_user_unknown(); break; \
414 } \
415} while (0)
416
329#define __put_user_nocheck(x, ptr, size) \ 417#define __put_user_nocheck(x, ptr, size) \
330({ \ 418({ \
331 __typeof__(*(ptr)) __pu_val; \ 419 __typeof__(*(ptr)) __pu_val; \
332 int __pu_err = 0; \ 420 int __pu_err = 0; \
333 \ 421 \
334 __chk_user_ptr(ptr); \
335 __pu_val = (x); \ 422 __pu_val = (x); \
336 switch (size) { \ 423 if (segment_eq(get_fs(), get_ds())) { \
337 case 1: __put_user_asm("sb", ptr); break; \ 424 __put_kernel_common(ptr, size); \
338 case 2: __put_user_asm("sh", ptr); break; \ 425 } else { \
339 case 4: __put_user_asm("sw", ptr); break; \ 426 __chk_user_ptr(ptr); \
340 case 8: __PUT_USER_DW(ptr); break; \ 427 __put_user_common(ptr, size); \
341 default: __put_user_unknown(); break; \
342 } \ 428 } \
343 __pu_err; \ 429 __pu_err; \
344}) 430})
@@ -351,21 +437,19 @@ do { \
351 \ 437 \
352 might_fault(); \ 438 might_fault(); \
353 if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) { \ 439 if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) { \
354 switch (size) { \ 440 if (segment_eq(get_fs(), get_ds())) \
355 case 1: __put_user_asm("sb", __pu_addr); break; \ 441 __put_kernel_common(__pu_addr, size); \
356 case 2: __put_user_asm("sh", __pu_addr); break; \ 442 else \
357 case 4: __put_user_asm("sw", __pu_addr); break; \ 443 __put_user_common(__pu_addr, size); \
358 case 8: __PUT_USER_DW(__pu_addr); break; \
359 default: __put_user_unknown(); break; \
360 } \
361 } \ 444 } \
445 \
362 __pu_err; \ 446 __pu_err; \
363}) 447})
364 448
365#define __put_user_asm(insn, ptr) \ 449#define __put_data_asm(insn, ptr) \
366{ \ 450{ \
367 __asm__ __volatile__( \ 451 __asm__ __volatile__( \
368 "1: " insn " %z2, %3 # __put_user_asm\n" \ 452 "1: "insn("%z2", "%3")" # __put_data_asm \n" \
369 "2: \n" \ 453 "2: \n" \
370 " .insn \n" \ 454 " .insn \n" \
371 " .section .fixup,\"ax\" \n" \ 455 " .section .fixup,\"ax\" \n" \
@@ -380,11 +464,11 @@ do { \
380 "i" (-EFAULT)); \ 464 "i" (-EFAULT)); \
381} 465}
382 466
383#define __put_user_asm_ll32(ptr) \ 467#define __put_data_asm_ll32(insn, ptr) \
384{ \ 468{ \
385 __asm__ __volatile__( \ 469 __asm__ __volatile__( \
386 "1: sw %2, (%3) # __put_user_asm_ll32 \n" \ 470 "1: "insn("%2", "(%3)")" # __put_data_asm_ll32 \n" \
387 "2: sw %D2, 4(%3) \n" \ 471 "2: "insn("%D2", "4(%3)")" \n" \
388 "3: \n" \ 472 "3: \n" \
389 " .insn \n" \ 473 " .insn \n" \
390 " .section .fixup,\"ax\" \n" \ 474 " .section .fixup,\"ax\" \n" \
@@ -403,6 +487,11 @@ do { \
403extern void __put_user_unknown(void); 487extern void __put_user_unknown(void);
404 488
405/* 489/*
490 * ul{b,h,w} are macros and there are no equivalent macros for EVA.
491 * EVA unaligned access is handled in the ADE exception handler.
492 */
493#ifndef CONFIG_EVA
494/*
406 * put_user_unaligned: - Write a simple value into user space. 495 * put_user_unaligned: - Write a simple value into user space.
407 * @x: Value to copy to user space. 496 * @x: Value to copy to user space.
408 * @ptr: Destination address, in user space. 497 * @ptr: Destination address, in user space.
@@ -504,7 +593,7 @@ extern void __get_user_unaligned_unknown(void);
504#define __get_user_unaligned_common(val, size, ptr) \ 593#define __get_user_unaligned_common(val, size, ptr) \
505do { \ 594do { \
506 switch (size) { \ 595 switch (size) { \
507 case 1: __get_user_asm(val, "lb", ptr); break; \ 596 case 1: __get_data_asm(val, "lb", ptr); break; \
508 case 2: __get_user_unaligned_asm(val, "ulh", ptr); break; \ 597 case 2: __get_user_unaligned_asm(val, "ulh", ptr); break; \
509 case 4: __get_user_unaligned_asm(val, "ulw", ptr); break; \ 598 case 4: __get_user_unaligned_asm(val, "ulw", ptr); break; \
510 case 8: __GET_USER_UNALIGNED_DW(val, ptr); break; \ 599 case 8: __GET_USER_UNALIGNED_DW(val, ptr); break; \
@@ -531,7 +620,7 @@ do { \
531 __gu_err; \ 620 __gu_err; \
532}) 621})
533 622
534#define __get_user_unaligned_asm(val, insn, addr) \ 623#define __get_data_unaligned_asm(val, insn, addr) \
535{ \ 624{ \
536 long __gu_tmp; \ 625 long __gu_tmp; \
537 \ 626 \
@@ -594,19 +683,23 @@ do { \
594#define __PUT_USER_UNALIGNED_DW(ptr) __put_user_unaligned_asm("usd", ptr) 683#define __PUT_USER_UNALIGNED_DW(ptr) __put_user_unaligned_asm("usd", ptr)
595#endif 684#endif
596 685
686#define __put_user_unaligned_common(ptr, size) \
687do { \
688 switch (size) { \
689 case 1: __put_data_asm("sb", ptr); break; \
690 case 2: __put_user_unaligned_asm("ush", ptr); break; \
691 case 4: __put_user_unaligned_asm("usw", ptr); break; \
692 case 8: __PUT_USER_UNALIGNED_DW(ptr); break; \
693 default: __put_user_unaligned_unknown(); break; \
694} while (0)
695
597#define __put_user_unaligned_nocheck(x,ptr,size) \ 696#define __put_user_unaligned_nocheck(x,ptr,size) \
598({ \ 697({ \
599 __typeof__(*(ptr)) __pu_val; \ 698 __typeof__(*(ptr)) __pu_val; \
600 int __pu_err = 0; \ 699 int __pu_err = 0; \
601 \ 700 \
602 __pu_val = (x); \ 701 __pu_val = (x); \
603 switch (size) { \ 702 __put_user_unaligned_common(ptr, size); \
604 case 1: __put_user_asm("sb", ptr); break; \
605 case 2: __put_user_unaligned_asm("ush", ptr); break; \
606 case 4: __put_user_unaligned_asm("usw", ptr); break; \
607 case 8: __PUT_USER_UNALIGNED_DW(ptr); break; \
608 default: __put_user_unaligned_unknown(); break; \
609 } \
610 __pu_err; \ 703 __pu_err; \
611}) 704})
612 705
@@ -616,15 +709,9 @@ do { \
616 __typeof__(*(ptr)) __pu_val = (x); \ 709 __typeof__(*(ptr)) __pu_val = (x); \
617 int __pu_err = -EFAULT; \ 710 int __pu_err = -EFAULT; \
618 \ 711 \
619 if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) { \ 712 if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) \
620 switch (size) { \ 713 __put_user_unaligned_common(__pu_addr, size); \
621 case 1: __put_user_asm("sb", __pu_addr); break; \ 714 \
622 case 2: __put_user_unaligned_asm("ush", __pu_addr); break; \
623 case 4: __put_user_unaligned_asm("usw", __pu_addr); break; \
624 case 8: __PUT_USER_UNALGINED_DW(__pu_addr); break; \
625 default: __put_user_unaligned_unknown(); break; \
626 } \
627 } \
628 __pu_err; \ 715 __pu_err; \
629}) 716})
630 717
@@ -669,6 +756,7 @@ do { \
669} 756}
670 757
671extern void __put_user_unaligned_unknown(void); 758extern void __put_user_unaligned_unknown(void);
759#endif
672 760
673/* 761/*
674 * We're generating jump to subroutines which will be outside the range of 762 * We're generating jump to subroutines which will be outside the range of
@@ -693,6 +781,7 @@ extern void __put_user_unaligned_unknown(void);
693 781
694extern size_t __copy_user(void *__to, const void *__from, size_t __n); 782extern size_t __copy_user(void *__to, const void *__from, size_t __n);
695 783
784#ifndef CONFIG_EVA
696#define __invoke_copy_to_user(to, from, n) \ 785#define __invoke_copy_to_user(to, from, n) \
697({ \ 786({ \
698 register void __user *__cu_to_r __asm__("$4"); \ 787 register void __user *__cu_to_r __asm__("$4"); \
@@ -711,6 +800,11 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n);
711 __cu_len_r; \ 800 __cu_len_r; \
712}) 801})
713 802
803#define __invoke_copy_to_kernel(to, from, n) \
804 __invoke_copy_to_user(to, from, n)
805
806#endif
807
714/* 808/*
715 * __copy_to_user: - Copy a block of data into user space, with less checking. 809 * __copy_to_user: - Copy a block of data into user space, with less checking.
716 * @to: Destination address, in user space. 810 * @to: Destination address, in user space.
@@ -735,7 +829,12 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n);
735 __cu_from = (from); \ 829 __cu_from = (from); \
736 __cu_len = (n); \ 830 __cu_len = (n); \
737 might_fault(); \ 831 might_fault(); \
738 __cu_len = __invoke_copy_to_user(__cu_to, __cu_from, __cu_len); \ 832 if (segment_eq(get_fs(), get_ds())) \
833 __cu_len = __invoke_copy_to_kernel(__cu_to, __cu_from, \
834 __cu_len); \
835 else \
836 __cu_len = __invoke_copy_to_user(__cu_to, __cu_from, \
837 __cu_len); \
739 __cu_len; \ 838 __cu_len; \
740}) 839})
741 840
@@ -750,7 +849,12 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n);
750 __cu_to = (to); \ 849 __cu_to = (to); \
751 __cu_from = (from); \ 850 __cu_from = (from); \
752 __cu_len = (n); \ 851 __cu_len = (n); \
753 __cu_len = __invoke_copy_to_user(__cu_to, __cu_from, __cu_len); \ 852 if (segment_eq(get_fs(), get_ds())) \
853 __cu_len = __invoke_copy_to_kernel(__cu_to, __cu_from, \
854 __cu_len); \
855 else \
856 __cu_len = __invoke_copy_to_user(__cu_to, __cu_from, \
857 __cu_len); \
754 __cu_len; \ 858 __cu_len; \
755}) 859})
756 860
@@ -763,8 +867,14 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n);
763 __cu_to = (to); \ 867 __cu_to = (to); \
764 __cu_from = (from); \ 868 __cu_from = (from); \
765 __cu_len = (n); \ 869 __cu_len = (n); \
766 __cu_len = __invoke_copy_from_user_inatomic(__cu_to, __cu_from, \ 870 if (segment_eq(get_fs(), get_ds())) \
767 __cu_len); \ 871 __cu_len = __invoke_copy_from_kernel_inatomic(__cu_to, \
872 __cu_from,\
873 __cu_len);\
874 else \
875 __cu_len = __invoke_copy_from_user_inatomic(__cu_to, \
876 __cu_from, \
877 __cu_len); \
768 __cu_len; \ 878 __cu_len; \
769}) 879})
770 880
@@ -790,14 +900,23 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n);
790 __cu_to = (to); \ 900 __cu_to = (to); \
791 __cu_from = (from); \ 901 __cu_from = (from); \
792 __cu_len = (n); \ 902 __cu_len = (n); \
793 if (access_ok(VERIFY_WRITE, __cu_to, __cu_len)) { \ 903 if (segment_eq(get_fs(), get_ds())) { \
794 might_fault(); \ 904 __cu_len = __invoke_copy_to_kernel(__cu_to, \
795 __cu_len = __invoke_copy_to_user(__cu_to, __cu_from, \ 905 __cu_from, \
796 __cu_len); \ 906 __cu_len); \
907 } else { \
908 if (access_ok(VERIFY_WRITE, __cu_to, __cu_len)) { \
909 might_fault(); \
910 __cu_len = __invoke_copy_to_user(__cu_to, \
911 __cu_from, \
912 __cu_len); \
913 } \
797 } \ 914 } \
798 __cu_len; \ 915 __cu_len; \
799}) 916})
800 917
918#ifndef CONFIG_EVA
919
801#define __invoke_copy_from_user(to, from, n) \ 920#define __invoke_copy_from_user(to, from, n) \
802({ \ 921({ \
803 register void *__cu_to_r __asm__("$4"); \ 922 register void *__cu_to_r __asm__("$4"); \
@@ -821,6 +940,17 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n);
821 __cu_len_r; \ 940 __cu_len_r; \
822}) 941})
823 942
943#define __invoke_copy_from_kernel(to, from, n) \
944 __invoke_copy_from_user(to, from, n)
945
946/* For userland <-> userland operations */
947#define ___invoke_copy_in_user(to, from, n) \
948 __invoke_copy_from_user(to, from, n)
949
950/* For kernel <-> kernel operations */
951#define ___invoke_copy_in_kernel(to, from, n) \
952 __invoke_copy_from_user(to, from, n)
953
824#define __invoke_copy_from_user_inatomic(to, from, n) \ 954#define __invoke_copy_from_user_inatomic(to, from, n) \
825({ \ 955({ \
826 register void *__cu_to_r __asm__("$4"); \ 956 register void *__cu_to_r __asm__("$4"); \
@@ -844,6 +974,97 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n);
844 __cu_len_r; \ 974 __cu_len_r; \
845}) 975})
846 976
977#define __invoke_copy_from_kernel_inatomic(to, from, n) \
978 __invoke_copy_from_user_inatomic(to, from, n) \
979
980#else
981
982/* EVA specific functions */
983
984extern size_t __copy_user_inatomic_eva(void *__to, const void *__from,
985 size_t __n);
986extern size_t __copy_from_user_eva(void *__to, const void *__from,
987 size_t __n);
988extern size_t __copy_to_user_eva(void *__to, const void *__from,
989 size_t __n);
990extern size_t __copy_in_user_eva(void *__to, const void *__from, size_t __n);
991
992#define __invoke_copy_from_user_eva_generic(to, from, n, func_ptr) \
993({ \
994 register void *__cu_to_r __asm__("$4"); \
995 register const void __user *__cu_from_r __asm__("$5"); \
996 register long __cu_len_r __asm__("$6"); \
997 \
998 __cu_to_r = (to); \
999 __cu_from_r = (from); \
1000 __cu_len_r = (n); \
1001 __asm__ __volatile__( \
1002 ".set\tnoreorder\n\t" \
1003 __MODULE_JAL(func_ptr) \
1004 ".set\tnoat\n\t" \
1005 __UA_ADDU "\t$1, %1, %2\n\t" \
1006 ".set\tat\n\t" \
1007 ".set\treorder" \
1008 : "+r" (__cu_to_r), "+r" (__cu_from_r), "+r" (__cu_len_r) \
1009 : \
1010 : "$8", "$9", "$10", "$11", "$12", "$14", "$15", "$24", "$31", \
1011 DADDI_SCRATCH, "memory"); \
1012 __cu_len_r; \
1013})
1014
1015#define __invoke_copy_to_user_eva_generic(to, from, n, func_ptr) \
1016({ \
1017 register void *__cu_to_r __asm__("$4"); \
1018 register const void __user *__cu_from_r __asm__("$5"); \
1019 register long __cu_len_r __asm__("$6"); \
1020 \
1021 __cu_to_r = (to); \
1022 __cu_from_r = (from); \
1023 __cu_len_r = (n); \
1024 __asm__ __volatile__( \
1025 __MODULE_JAL(func_ptr) \
1026 : "+r" (__cu_to_r), "+r" (__cu_from_r), "+r" (__cu_len_r) \
1027 : \
1028 : "$8", "$9", "$10", "$11", "$12", "$14", "$15", "$24", "$31", \
1029 DADDI_SCRATCH, "memory"); \
1030 __cu_len_r; \
1031})
1032
1033/*
1034 * Source or destination address is in userland. We need to go through
1035 * the TLB
1036 */
1037#define __invoke_copy_from_user(to, from, n) \
1038 __invoke_copy_from_user_eva_generic(to, from, n, __copy_from_user_eva)
1039
1040#define __invoke_copy_from_user_inatomic(to, from, n) \
1041 __invoke_copy_from_user_eva_generic(to, from, n, \
1042 __copy_user_inatomic_eva)
1043
1044#define __invoke_copy_to_user(to, from, n) \
1045 __invoke_copy_to_user_eva_generic(to, from, n, __copy_to_user_eva)
1046
1047#define ___invoke_copy_in_user(to, from, n) \
1048 __invoke_copy_from_user_eva_generic(to, from, n, __copy_in_user_eva)
1049
1050/*
1051 * Source or destination address in the kernel. We are not going through
1052 * the TLB
1053 */
1054#define __invoke_copy_from_kernel(to, from, n) \
1055 __invoke_copy_from_user_eva_generic(to, from, n, __copy_user)
1056
1057#define __invoke_copy_from_kernel_inatomic(to, from, n) \
1058 __invoke_copy_from_user_eva_generic(to, from, n, __copy_user_inatomic)
1059
1060#define __invoke_copy_to_kernel(to, from, n) \
1061 __invoke_copy_to_user_eva_generic(to, from, n, __copy_user)
1062
1063#define ___invoke_copy_in_kernel(to, from, n) \
1064 __invoke_copy_from_user_eva_generic(to, from, n, __copy_user)
1065
1066#endif /* CONFIG_EVA */
1067
847/* 1068/*
848 * __copy_from_user: - Copy a block of data from user space, with less checking. 1069 * __copy_from_user: - Copy a block of data from user space, with less checking.
849 * @to: Destination address, in kernel space. 1070 * @to: Destination address, in kernel space.
@@ -901,10 +1122,17 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n);
901 __cu_to = (to); \ 1122 __cu_to = (to); \
902 __cu_from = (from); \ 1123 __cu_from = (from); \
903 __cu_len = (n); \ 1124 __cu_len = (n); \
904 if (access_ok(VERIFY_READ, __cu_from, __cu_len)) { \ 1125 if (segment_eq(get_fs(), get_ds())) { \
905 might_fault(); \ 1126 __cu_len = __invoke_copy_from_kernel(__cu_to, \
906 __cu_len = __invoke_copy_from_user(__cu_to, __cu_from, \ 1127 __cu_from, \
907 __cu_len); \ 1128 __cu_len); \
1129 } else { \
1130 if (access_ok(VERIFY_READ, __cu_from, __cu_len)) { \
1131 might_fault(); \
1132 __cu_len = __invoke_copy_from_user(__cu_to, \
1133 __cu_from, \
1134 __cu_len); \
1135 } \
908 } \ 1136 } \
909 __cu_len; \ 1137 __cu_len; \
910}) 1138})
@@ -918,9 +1146,14 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n);
918 __cu_to = (to); \ 1146 __cu_to = (to); \
919 __cu_from = (from); \ 1147 __cu_from = (from); \
920 __cu_len = (n); \ 1148 __cu_len = (n); \
921 might_fault(); \ 1149 if (segment_eq(get_fs(), get_ds())) { \
922 __cu_len = __invoke_copy_from_user(__cu_to, __cu_from, \ 1150 __cu_len = ___invoke_copy_in_kernel(__cu_to, __cu_from, \
923 __cu_len); \ 1151 __cu_len); \
1152 } else { \
1153 might_fault(); \
1154 __cu_len = ___invoke_copy_in_user(__cu_to, __cu_from, \
1155 __cu_len); \
1156 } \
924 __cu_len; \ 1157 __cu_len; \
925}) 1158})
926 1159
@@ -933,11 +1166,17 @@ extern size_t __copy_user_inatomic(void *__to, const void *__from, size_t __n);
933 __cu_to = (to); \ 1166 __cu_to = (to); \
934 __cu_from = (from); \ 1167 __cu_from = (from); \
935 __cu_len = (n); \ 1168 __cu_len = (n); \
936 if (likely(access_ok(VERIFY_READ, __cu_from, __cu_len) && \ 1169 if (segment_eq(get_fs(), get_ds())) { \
937 access_ok(VERIFY_WRITE, __cu_to, __cu_len))) { \ 1170 __cu_len = ___invoke_copy_in_kernel(__cu_to,__cu_from, \
938 might_fault(); \ 1171 __cu_len); \
939 __cu_len = __invoke_copy_from_user(__cu_to, __cu_from, \ 1172 } else { \
940 __cu_len); \ 1173 if (likely(access_ok(VERIFY_READ, __cu_from, __cu_len) &&\
1174 access_ok(VERIFY_WRITE, __cu_to, __cu_len))) {\
1175 might_fault(); \
1176 __cu_len = ___invoke_copy_in_user(__cu_to, \
1177 __cu_from, \
1178 __cu_len); \
1179 } \
941 } \ 1180 } \
942 __cu_len; \ 1181 __cu_len; \
943}) 1182})
@@ -1007,16 +1246,28 @@ __strncpy_from_user(char *__to, const char __user *__from, long __len)
1007{ 1246{
1008 long res; 1247 long res;
1009 1248
1010 might_fault(); 1249 if (segment_eq(get_fs(), get_ds())) {
1011 __asm__ __volatile__( 1250 __asm__ __volatile__(
1012 "move\t$4, %1\n\t" 1251 "move\t$4, %1\n\t"
1013 "move\t$5, %2\n\t" 1252 "move\t$5, %2\n\t"
1014 "move\t$6, %3\n\t" 1253 "move\t$6, %3\n\t"
1015 __MODULE_JAL(__strncpy_from_user_nocheck_asm) 1254 __MODULE_JAL(__strncpy_from_kernel_nocheck_asm)
1016 "move\t%0, $2" 1255 "move\t%0, $2"
1017 : "=r" (res) 1256 : "=r" (res)
1018 : "r" (__to), "r" (__from), "r" (__len) 1257 : "r" (__to), "r" (__from), "r" (__len)
1019 : "$2", "$3", "$4", "$5", "$6", __UA_t0, "$31", "memory"); 1258 : "$2", "$3", "$4", "$5", "$6", __UA_t0, "$31", "memory");
1259 } else {
1260 might_fault();
1261 __asm__ __volatile__(
1262 "move\t$4, %1\n\t"
1263 "move\t$5, %2\n\t"
1264 "move\t$6, %3\n\t"
1265 __MODULE_JAL(__strncpy_from_user_nocheck_asm)
1266 "move\t%0, $2"
1267 : "=r" (res)
1268 : "r" (__to), "r" (__from), "r" (__len)
1269 : "$2", "$3", "$4", "$5", "$6", __UA_t0, "$31", "memory");
1270 }
1020 1271
1021 return res; 1272 return res;
1022} 1273}
@@ -1044,16 +1295,28 @@ strncpy_from_user(char *__to, const char __user *__from, long __len)
1044{ 1295{
1045 long res; 1296 long res;
1046 1297
1047 might_fault(); 1298 if (segment_eq(get_fs(), get_ds())) {
1048 __asm__ __volatile__( 1299 __asm__ __volatile__(
1049 "move\t$4, %1\n\t" 1300 "move\t$4, %1\n\t"
1050 "move\t$5, %2\n\t" 1301 "move\t$5, %2\n\t"
1051 "move\t$6, %3\n\t" 1302 "move\t$6, %3\n\t"
1052 __MODULE_JAL(__strncpy_from_user_asm) 1303 __MODULE_JAL(__strncpy_from_kernel_asm)
1053 "move\t%0, $2" 1304 "move\t%0, $2"
1054 : "=r" (res) 1305 : "=r" (res)
1055 : "r" (__to), "r" (__from), "r" (__len) 1306 : "r" (__to), "r" (__from), "r" (__len)
1056 : "$2", "$3", "$4", "$5", "$6", __UA_t0, "$31", "memory"); 1307 : "$2", "$3", "$4", "$5", "$6", __UA_t0, "$31", "memory");
1308 } else {
1309 might_fault();
1310 __asm__ __volatile__(
1311 "move\t$4, %1\n\t"
1312 "move\t$5, %2\n\t"
1313 "move\t$6, %3\n\t"
1314 __MODULE_JAL(__strncpy_from_user_asm)
1315 "move\t%0, $2"
1316 : "=r" (res)
1317 : "r" (__to), "r" (__from), "r" (__len)
1318 : "$2", "$3", "$4", "$5", "$6", __UA_t0, "$31", "memory");
1319 }
1057 1320
1058 return res; 1321 return res;
1059} 1322}
@@ -1063,14 +1326,24 @@ static inline long __strlen_user(const char __user *s)
1063{ 1326{
1064 long res; 1327 long res;
1065 1328
1066 might_fault(); 1329 if (segment_eq(get_fs(), get_ds())) {
1067 __asm__ __volatile__( 1330 __asm__ __volatile__(
1068 "move\t$4, %1\n\t" 1331 "move\t$4, %1\n\t"
1069 __MODULE_JAL(__strlen_user_nocheck_asm) 1332 __MODULE_JAL(__strlen_kernel_nocheck_asm)
1070 "move\t%0, $2" 1333 "move\t%0, $2"
1071 : "=r" (res) 1334 : "=r" (res)
1072 : "r" (s) 1335 : "r" (s)
1073 : "$2", "$4", __UA_t0, "$31"); 1336 : "$2", "$4", __UA_t0, "$31");
1337 } else {
1338 might_fault();
1339 __asm__ __volatile__(
1340 "move\t$4, %1\n\t"
1341 __MODULE_JAL(__strlen_user_nocheck_asm)
1342 "move\t%0, $2"
1343 : "=r" (res)
1344 : "r" (s)
1345 : "$2", "$4", __UA_t0, "$31");
1346 }
1074 1347
1075 return res; 1348 return res;
1076} 1349}
@@ -1093,14 +1366,24 @@ static inline long strlen_user(const char __user *s)
1093{ 1366{
1094 long res; 1367 long res;
1095 1368
1096 might_fault(); 1369 if (segment_eq(get_fs(), get_ds())) {
1097 __asm__ __volatile__( 1370 __asm__ __volatile__(
1098 "move\t$4, %1\n\t" 1371 "move\t$4, %1\n\t"
1099 __MODULE_JAL(__strlen_user_asm) 1372 __MODULE_JAL(__strlen_kernel_asm)
1100 "move\t%0, $2" 1373 "move\t%0, $2"
1101 : "=r" (res) 1374 : "=r" (res)
1102 : "r" (s) 1375 : "r" (s)
1103 : "$2", "$4", __UA_t0, "$31"); 1376 : "$2", "$4", __UA_t0, "$31");
1377 } else {
1378 might_fault();
1379 __asm__ __volatile__(
1380 "move\t$4, %1\n\t"
1381 __MODULE_JAL(__strlen_kernel_asm)
1382 "move\t%0, $2"
1383 : "=r" (res)
1384 : "r" (s)
1385 : "$2", "$4", __UA_t0, "$31");
1386 }
1104 1387
1105 return res; 1388 return res;
1106} 1389}
@@ -1110,15 +1393,26 @@ static inline long __strnlen_user(const char __user *s, long n)
1110{ 1393{
1111 long res; 1394 long res;
1112 1395
1113 might_fault(); 1396 if (segment_eq(get_fs(), get_ds())) {
1114 __asm__ __volatile__( 1397 __asm__ __volatile__(
1115 "move\t$4, %1\n\t" 1398 "move\t$4, %1\n\t"
1116 "move\t$5, %2\n\t" 1399 "move\t$5, %2\n\t"
1117 __MODULE_JAL(__strnlen_user_nocheck_asm) 1400 __MODULE_JAL(__strnlen_kernel_nocheck_asm)
1118 "move\t%0, $2" 1401 "move\t%0, $2"
1119 : "=r" (res) 1402 : "=r" (res)
1120 : "r" (s), "r" (n) 1403 : "r" (s), "r" (n)
1121 : "$2", "$4", "$5", __UA_t0, "$31"); 1404 : "$2", "$4", "$5", __UA_t0, "$31");
1405 } else {
1406 might_fault();
1407 __asm__ __volatile__(
1408 "move\t$4, %1\n\t"
1409 "move\t$5, %2\n\t"
1410 __MODULE_JAL(__strnlen_user_nocheck_asm)
1411 "move\t%0, $2"
1412 : "=r" (res)
1413 : "r" (s), "r" (n)
1414 : "$2", "$4", "$5", __UA_t0, "$31");
1415 }
1122 1416
1123 return res; 1417 return res;
1124} 1418}
@@ -1142,14 +1436,25 @@ static inline long strnlen_user(const char __user *s, long n)
1142 long res; 1436 long res;
1143 1437
1144 might_fault(); 1438 might_fault();
1145 __asm__ __volatile__( 1439 if (segment_eq(get_fs(), get_ds())) {
1146 "move\t$4, %1\n\t" 1440 __asm__ __volatile__(
1147 "move\t$5, %2\n\t" 1441 "move\t$4, %1\n\t"
1148 __MODULE_JAL(__strnlen_user_asm) 1442 "move\t$5, %2\n\t"
1149 "move\t%0, $2" 1443 __MODULE_JAL(__strnlen_kernel_asm)
1150 : "=r" (res) 1444 "move\t%0, $2"
1151 : "r" (s), "r" (n) 1445 : "=r" (res)
1152 : "$2", "$4", "$5", __UA_t0, "$31"); 1446 : "r" (s), "r" (n)
1447 : "$2", "$4", "$5", __UA_t0, "$31");
1448 } else {
1449 __asm__ __volatile__(
1450 "move\t$4, %1\n\t"
1451 "move\t$5, %2\n\t"
1452 __MODULE_JAL(__strnlen_user_asm)
1453 "move\t%0, $2"
1454 : "=r" (res)
1455 : "r" (s), "r" (n)
1456 : "$2", "$4", "$5", __UA_t0, "$31");
1457 }
1153 1458
1154 return res; 1459 return res;
1155} 1460}
diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h
index f25181b19941..df6e775f3fef 100644
--- a/arch/mips/include/uapi/asm/inst.h
+++ b/arch/mips/include/uapi/asm/inst.h
@@ -8,6 +8,7 @@
8 * Copyright (C) 1996, 2000 by Ralf Baechle 8 * Copyright (C) 1996, 2000 by Ralf Baechle
9 * Copyright (C) 2006 by Thiemo Seufer 9 * Copyright (C) 2006 by Thiemo Seufer
10 * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. 10 * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
11 * Copyright (C) 2014 Imagination Technologies Ltd.
11 */ 12 */
12#ifndef _UAPI_ASM_INST_H 13#ifndef _UAPI_ASM_INST_H
13#define _UAPI_ASM_INST_H 14#define _UAPI_ASM_INST_H
@@ -73,10 +74,16 @@ enum spec2_op {
73enum spec3_op { 74enum spec3_op {
74 ext_op, dextm_op, dextu_op, dext_op, 75 ext_op, dextm_op, dextu_op, dext_op,
75 ins_op, dinsm_op, dinsu_op, dins_op, 76 ins_op, dinsm_op, dinsu_op, dins_op,
76 lx_op = 0x0a, 77 lx_op = 0x0a, lwle_op = 0x19,
77 bshfl_op = 0x20, 78 lwre_op = 0x1a, cachee_op = 0x1b,
78 dbshfl_op = 0x24, 79 sbe_op = 0x1c, she_op = 0x1d,
79 rdhwr_op = 0x3b 80 sce_op = 0x1e, swe_op = 0x1f,
81 bshfl_op = 0x20, swle_op = 0x21,
82 swre_op = 0x22, prefe_op = 0x23,
83 dbshfl_op = 0x24, lbue_op = 0x28,
84 lhue_op = 0x29, lbe_op = 0x2c,
85 lhe_op = 0x2d, lle_op = 0x2e,
86 lwe_op = 0x2f, rdhwr_op = 0x3b
80}; 87};
81 88
82/* 89/*
@@ -592,6 +599,15 @@ struct v_format { /* MDMX vector format */
592 ;))))))) 599 ;)))))))
593}; 600};
594 601
602struct spec3_format { /* SPEC3 */
603 BITFIELD_FIELD(unsigned int opcode:6,
604 BITFIELD_FIELD(unsigned int rs:5,
605 BITFIELD_FIELD(unsigned int rt:5,
606 BITFIELD_FIELD(signed int simmediate:9,
607 BITFIELD_FIELD(unsigned int func:7,
608 ;)))))
609};
610
595/* 611/*
596 * microMIPS instruction formats (32-bit length) 612 * microMIPS instruction formats (32-bit length)
597 * 613 *
@@ -863,6 +879,7 @@ union mips_instruction {
863 struct b_format b_format; 879 struct b_format b_format;
864 struct ps_format ps_format; 880 struct ps_format ps_format;
865 struct v_format v_format; 881 struct v_format v_format;
882 struct spec3_format spec3_format;
866 struct fb_format fb_format; 883 struct fb_format fb_format;
867 struct fp0_format fp0_format; 884 struct fp0_format fp0_format;
868 struct mm_fp0_format mm_fp0_format; 885 struct mm_fp0_format mm_fp0_format;
diff --git a/arch/mips/include/uapi/asm/sigcontext.h b/arch/mips/include/uapi/asm/sigcontext.h
index 6c9906f59c6e..681c17603a48 100644
--- a/arch/mips/include/uapi/asm/sigcontext.h
+++ b/arch/mips/include/uapi/asm/sigcontext.h
@@ -12,6 +12,10 @@
12#include <linux/types.h> 12#include <linux/types.h>
13#include <asm/sgidefs.h> 13#include <asm/sgidefs.h>
14 14
15/* Bits which may be set in sc_used_math */
16#define USEDMATH_FP (1 << 0)
17#define USEDMATH_MSA (1 << 1)
18
15#if _MIPS_SIM == _MIPS_SIM_ABI32 19#if _MIPS_SIM == _MIPS_SIM_ABI32
16 20
17/* 21/*
@@ -37,6 +41,8 @@ struct sigcontext {
37 unsigned long sc_lo2; 41 unsigned long sc_lo2;
38 unsigned long sc_hi3; 42 unsigned long sc_hi3;
39 unsigned long sc_lo3; 43 unsigned long sc_lo3;
44 unsigned long long sc_msaregs[32]; /* Most significant 64 bits */
45 unsigned long sc_msa_csr;
40}; 46};
41 47
42#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 48#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
@@ -70,6 +76,8 @@ struct sigcontext {
70 __u32 sc_used_math; 76 __u32 sc_used_math;
71 __u32 sc_dsp; 77 __u32 sc_dsp;
72 __u32 sc_reserved; 78 __u32 sc_reserved;
79 __u64 sc_msaregs[32];
80 __u32 sc_msa_csr;
73}; 81};
74 82
75 83
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index 26c6175e1379..277dab301cea 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -53,6 +53,8 @@ obj-$(CONFIG_MIPS_MT_FPAFF) += mips-mt-fpaff.o
53obj-$(CONFIG_MIPS_MT_SMTC) += smtc.o smtc-asm.o smtc-proc.o 53obj-$(CONFIG_MIPS_MT_SMTC) += smtc.o smtc-asm.o smtc-proc.o
54obj-$(CONFIG_MIPS_MT_SMP) += smp-mt.o 54obj-$(CONFIG_MIPS_MT_SMP) += smp-mt.o
55obj-$(CONFIG_MIPS_CMP) += smp-cmp.o 55obj-$(CONFIG_MIPS_CMP) += smp-cmp.o
56obj-$(CONFIG_MIPS_CPS) += smp-cps.o cps-vec.o
57obj-$(CONFIG_MIPS_GIC_IPI) += smp-gic.o
56obj-$(CONFIG_CPU_MIPSR2) += spram.o 58obj-$(CONFIG_CPU_MIPSR2) += spram.o
57 59
58obj-$(CONFIG_MIPS_VPE_LOADER) += vpe.o 60obj-$(CONFIG_MIPS_VPE_LOADER) += vpe.o
@@ -102,6 +104,9 @@ obj-$(CONFIG_HW_PERF_EVENTS) += perf_event_mipsxx.o
102 104
103obj-$(CONFIG_JUMP_LABEL) += jump_label.o 105obj-$(CONFIG_JUMP_LABEL) += jump_label.o
104 106
107obj-$(CONFIG_MIPS_CM) += mips-cm.o
108obj-$(CONFIG_MIPS_CPC) += mips-cpc.o
109
105# 110#
106# DSP ASE supported for MIPS32 or MIPS64 Release 2 cores only. It is not 111# DSP ASE supported for MIPS32 or MIPS64 Release 2 cores only. It is not
107# safe to unconditionnaly use the assembler -mdsp / -mdspr2 switches 112# safe to unconditionnaly use the assembler -mdsp / -mdspr2 switches
diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c
index 0c2e853c3db4..0ea75c244b48 100644
--- a/arch/mips/kernel/asm-offsets.c
+++ b/arch/mips/kernel/asm-offsets.c
@@ -16,6 +16,7 @@
16#include <linux/suspend.h> 16#include <linux/suspend.h>
17#include <asm/ptrace.h> 17#include <asm/ptrace.h>
18#include <asm/processor.h> 18#include <asm/processor.h>
19#include <asm/smp-cps.h>
19 20
20#include <linux/kvm_host.h> 21#include <linux/kvm_host.h>
21 22
@@ -168,6 +169,72 @@ void output_thread_fpu_defines(void)
168 OFFSET(THREAD_FPR30, task_struct, thread.fpu.fpr[30]); 169 OFFSET(THREAD_FPR30, task_struct, thread.fpu.fpr[30]);
169 OFFSET(THREAD_FPR31, task_struct, thread.fpu.fpr[31]); 170 OFFSET(THREAD_FPR31, task_struct, thread.fpu.fpr[31]);
170 171
172 /* the least significant 64 bits of each FP register */
173 OFFSET(THREAD_FPR0_LS64, task_struct,
174 thread.fpu.fpr[0].val64[FPR_IDX(64, 0)]);
175 OFFSET(THREAD_FPR1_LS64, task_struct,
176 thread.fpu.fpr[1].val64[FPR_IDX(64, 0)]);
177 OFFSET(THREAD_FPR2_LS64, task_struct,
178 thread.fpu.fpr[2].val64[FPR_IDX(64, 0)]);
179 OFFSET(THREAD_FPR3_LS64, task_struct,
180 thread.fpu.fpr[3].val64[FPR_IDX(64, 0)]);
181 OFFSET(THREAD_FPR4_LS64, task_struct,
182 thread.fpu.fpr[4].val64[FPR_IDX(64, 0)]);
183 OFFSET(THREAD_FPR5_LS64, task_struct,
184 thread.fpu.fpr[5].val64[FPR_IDX(64, 0)]);
185 OFFSET(THREAD_FPR6_LS64, task_struct,
186 thread.fpu.fpr[6].val64[FPR_IDX(64, 0)]);
187 OFFSET(THREAD_FPR7_LS64, task_struct,
188 thread.fpu.fpr[7].val64[FPR_IDX(64, 0)]);
189 OFFSET(THREAD_FPR8_LS64, task_struct,
190 thread.fpu.fpr[8].val64[FPR_IDX(64, 0)]);
191 OFFSET(THREAD_FPR9_LS64, task_struct,
192 thread.fpu.fpr[9].val64[FPR_IDX(64, 0)]);
193 OFFSET(THREAD_FPR10_LS64, task_struct,
194 thread.fpu.fpr[10].val64[FPR_IDX(64, 0)]);
195 OFFSET(THREAD_FPR11_LS64, task_struct,
196 thread.fpu.fpr[11].val64[FPR_IDX(64, 0)]);
197 OFFSET(THREAD_FPR12_LS64, task_struct,
198 thread.fpu.fpr[12].val64[FPR_IDX(64, 0)]);
199 OFFSET(THREAD_FPR13_LS64, task_struct,
200 thread.fpu.fpr[13].val64[FPR_IDX(64, 0)]);
201 OFFSET(THREAD_FPR14_LS64, task_struct,
202 thread.fpu.fpr[14].val64[FPR_IDX(64, 0)]);
203 OFFSET(THREAD_FPR15_LS64, task_struct,
204 thread.fpu.fpr[15].val64[FPR_IDX(64, 0)]);
205 OFFSET(THREAD_FPR16_LS64, task_struct,
206 thread.fpu.fpr[16].val64[FPR_IDX(64, 0)]);
207 OFFSET(THREAD_FPR17_LS64, task_struct,
208 thread.fpu.fpr[17].val64[FPR_IDX(64, 0)]);
209 OFFSET(THREAD_FPR18_LS64, task_struct,
210 thread.fpu.fpr[18].val64[FPR_IDX(64, 0)]);
211 OFFSET(THREAD_FPR19_LS64, task_struct,
212 thread.fpu.fpr[19].val64[FPR_IDX(64, 0)]);
213 OFFSET(THREAD_FPR20_LS64, task_struct,
214 thread.fpu.fpr[20].val64[FPR_IDX(64, 0)]);
215 OFFSET(THREAD_FPR21_LS64, task_struct,
216 thread.fpu.fpr[21].val64[FPR_IDX(64, 0)]);
217 OFFSET(THREAD_FPR22_LS64, task_struct,
218 thread.fpu.fpr[22].val64[FPR_IDX(64, 0)]);
219 OFFSET(THREAD_FPR23_LS64, task_struct,
220 thread.fpu.fpr[23].val64[FPR_IDX(64, 0)]);
221 OFFSET(THREAD_FPR24_LS64, task_struct,
222 thread.fpu.fpr[24].val64[FPR_IDX(64, 0)]);
223 OFFSET(THREAD_FPR25_LS64, task_struct,
224 thread.fpu.fpr[25].val64[FPR_IDX(64, 0)]);
225 OFFSET(THREAD_FPR26_LS64, task_struct,
226 thread.fpu.fpr[26].val64[FPR_IDX(64, 0)]);
227 OFFSET(THREAD_FPR27_LS64, task_struct,
228 thread.fpu.fpr[27].val64[FPR_IDX(64, 0)]);
229 OFFSET(THREAD_FPR28_LS64, task_struct,
230 thread.fpu.fpr[28].val64[FPR_IDX(64, 0)]);
231 OFFSET(THREAD_FPR29_LS64, task_struct,
232 thread.fpu.fpr[29].val64[FPR_IDX(64, 0)]);
233 OFFSET(THREAD_FPR30_LS64, task_struct,
234 thread.fpu.fpr[30].val64[FPR_IDX(64, 0)]);
235 OFFSET(THREAD_FPR31_LS64, task_struct,
236 thread.fpu.fpr[31].val64[FPR_IDX(64, 0)]);
237
171 OFFSET(THREAD_FCR31, task_struct, thread.fpu.fcr31); 238 OFFSET(THREAD_FCR31, task_struct, thread.fpu.fcr31);
172 BLANK(); 239 BLANK();
173} 240}
@@ -228,6 +295,7 @@ void output_sc_defines(void)
228 OFFSET(SC_LO2, sigcontext, sc_lo2); 295 OFFSET(SC_LO2, sigcontext, sc_lo2);
229 OFFSET(SC_HI3, sigcontext, sc_hi3); 296 OFFSET(SC_HI3, sigcontext, sc_hi3);
230 OFFSET(SC_LO3, sigcontext, sc_lo3); 297 OFFSET(SC_LO3, sigcontext, sc_lo3);
298 OFFSET(SC_MSAREGS, sigcontext, sc_msaregs);
231 BLANK(); 299 BLANK();
232} 300}
233#endif 301#endif
@@ -242,6 +310,7 @@ void output_sc_defines(void)
242 OFFSET(SC_MDLO, sigcontext, sc_mdlo); 310 OFFSET(SC_MDLO, sigcontext, sc_mdlo);
243 OFFSET(SC_PC, sigcontext, sc_pc); 311 OFFSET(SC_PC, sigcontext, sc_pc);
244 OFFSET(SC_FPC_CSR, sigcontext, sc_fpc_csr); 312 OFFSET(SC_FPC_CSR, sigcontext, sc_fpc_csr);
313 OFFSET(SC_MSAREGS, sigcontext, sc_msaregs);
245 BLANK(); 314 BLANK();
246} 315}
247#endif 316#endif
@@ -253,6 +322,7 @@ void output_sc32_defines(void)
253 OFFSET(SC32_FPREGS, sigcontext32, sc_fpregs); 322 OFFSET(SC32_FPREGS, sigcontext32, sc_fpregs);
254 OFFSET(SC32_FPC_CSR, sigcontext32, sc_fpc_csr); 323 OFFSET(SC32_FPC_CSR, sigcontext32, sc_fpc_csr);
255 OFFSET(SC32_FPC_EIR, sigcontext32, sc_fpc_eir); 324 OFFSET(SC32_FPC_EIR, sigcontext32, sc_fpc_eir);
325 OFFSET(SC32_MSAREGS, sigcontext32, sc_msaregs);
256 BLANK(); 326 BLANK();
257} 327}
258#endif 328#endif
@@ -397,3 +467,15 @@ void output_kvm_defines(void)
397 OFFSET(COP0_STATUS, mips_coproc, reg[MIPS_CP0_STATUS][0]); 467 OFFSET(COP0_STATUS, mips_coproc, reg[MIPS_CP0_STATUS][0]);
398 BLANK(); 468 BLANK();
399} 469}
470
471#ifdef CONFIG_MIPS_CPS
472void output_cps_defines(void)
473{
474 COMMENT(" MIPS CPS offsets. ");
475 OFFSET(BOOTCFG_CORE, boot_config, core);
476 OFFSET(BOOTCFG_VPE, boot_config, vpe);
477 OFFSET(BOOTCFG_PC, boot_config, pc);
478 OFFSET(BOOTCFG_SP, boot_config, sp);
479 OFFSET(BOOTCFG_GP, boot_config, gp);
480}
481#endif
diff --git a/arch/mips/kernel/bmips_vec.S b/arch/mips/kernel/bmips_vec.S
index a5bf73d22fcc..290c23b51678 100644
--- a/arch/mips/kernel/bmips_vec.S
+++ b/arch/mips/kernel/bmips_vec.S
@@ -122,7 +122,7 @@ NESTED(bmips_reset_nmi_vec, PT_SIZE, sp)
122 jr k0 122 jr k0
123 123
124 RESTORE_ALL 124 RESTORE_ALL
125 .set mips3 125 .set arch=r4000
126 eret 126 eret
127 127
128/*********************************************************************** 128/***********************************************************************
diff --git a/arch/mips/kernel/cps-vec.S b/arch/mips/kernel/cps-vec.S
new file mode 100644
index 000000000000..f7a46db4b161
--- /dev/null
+++ b/arch/mips/kernel/cps-vec.S
@@ -0,0 +1,191 @@
1/*
2 * Copyright (C) 2013 Imagination Technologies
3 * Author: Paul Burton <paul.burton@imgtec.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#include <asm/addrspace.h>
12#include <asm/asm.h>
13#include <asm/asm-offsets.h>
14#include <asm/asmmacro.h>
15#include <asm/cacheops.h>
16#include <asm/mipsregs.h>
17
18#define GCR_CL_COHERENCE_OFS 0x2008
19
20.section .text.cps-vec
21.balign 0x1000
22.set noreorder
23
24LEAF(mips_cps_core_entry)
25 /*
26 * These first 8 bytes will be patched by cps_smp_setup to load the
27 * base address of the CM GCRs into register v1.
28 */
29 .quad 0
30
31 /* Check whether we're here due to an NMI */
32 mfc0 k0, CP0_STATUS
33 and k0, k0, ST0_NMI
34 beqz k0, not_nmi
35 nop
36
37 /* This is an NMI */
38 la k0, nmi_handler
39 jr k0
40 nop
41
42not_nmi:
43 /* Setup Cause */
44 li t0, CAUSEF_IV
45 mtc0 t0, CP0_CAUSE
46
47 /* Setup Status */
48 li t0, ST0_CU1 | ST0_CU0
49 mtc0 t0, CP0_STATUS
50
51 /*
52 * Clear the bits used to index the caches. Note that the architecture
53 * dictates that writing to any of TagLo or TagHi selects 0 or 2 should
54 * be valid for all MIPS32 CPUs, even those for which said writes are
55 * unnecessary.
56 */
57 mtc0 zero, CP0_TAGLO, 0
58 mtc0 zero, CP0_TAGHI, 0
59 mtc0 zero, CP0_TAGLO, 2
60 mtc0 zero, CP0_TAGHI, 2
61 ehb
62
63 /* Primary cache configuration is indicated by Config1 */
64 mfc0 v0, CP0_CONFIG, 1
65
66 /* Detect I-cache line size */
67 _EXT t0, v0, MIPS_CONF1_IL_SHF, MIPS_CONF1_IL_SZ
68 beqz t0, icache_done
69 li t1, 2
70 sllv t0, t1, t0
71
72 /* Detect I-cache size */
73 _EXT t1, v0, MIPS_CONF1_IS_SHF, MIPS_CONF1_IS_SZ
74 xori t2, t1, 0x7
75 beqz t2, 1f
76 li t3, 32
77 addi t1, t1, 1
78 sllv t1, t3, t1
791: /* At this point t1 == I-cache sets per way */
80 _EXT t2, v0, MIPS_CONF1_IA_SHF, MIPS_CONF1_IA_SZ
81 addi t2, t2, 1
82 mul t1, t1, t0
83 mul t1, t1, t2
84
85 li a0, KSEG0
86 add a1, a0, t1
871: cache Index_Store_Tag_I, 0(a0)
88 add a0, a0, t0
89 bne a0, a1, 1b
90 nop
91icache_done:
92
93 /* Detect D-cache line size */
94 _EXT t0, v0, MIPS_CONF1_DL_SHF, MIPS_CONF1_DL_SZ
95 beqz t0, dcache_done
96 li t1, 2
97 sllv t0, t1, t0
98
99 /* Detect D-cache size */
100 _EXT t1, v0, MIPS_CONF1_DS_SHF, MIPS_CONF1_DS_SZ
101 xori t2, t1, 0x7
102 beqz t2, 1f
103 li t3, 32
104 addi t1, t1, 1
105 sllv t1, t3, t1
1061: /* At this point t1 == D-cache sets per way */
107 _EXT t2, v0, MIPS_CONF1_DA_SHF, MIPS_CONF1_DA_SZ
108 addi t2, t2, 1
109 mul t1, t1, t0
110 mul t1, t1, t2
111
112 li a0, KSEG0
113 addu a1, a0, t1
114 subu a1, a1, t0
1151: cache Index_Store_Tag_D, 0(a0)
116 bne a0, a1, 1b
117 add a0, a0, t0
118dcache_done:
119
120 /* Set Kseg0 cacheable, coherent, write-back, write-allocate */
121 mfc0 t0, CP0_CONFIG
122 ori t0, 0x7
123 xori t0, 0x2
124 mtc0 t0, CP0_CONFIG
125 ehb
126
127 /* Enter the coherent domain */
128 li t0, 0xff
129 sw t0, GCR_CL_COHERENCE_OFS(v1)
130 ehb
131
132 /* Jump to kseg0 */
133 la t0, 1f
134 jr t0
135 nop
136
1371: /* We're up, cached & coherent */
138
139 /*
140 * TODO: We should check the VPE number we intended to boot here, and
141 * if non-zero we should start that VPE and stop this one. For
142 * the moment this doesn't matter since CPUs are brought up
143 * sequentially and in order, but once hotplug is implemented
144 * this will need revisiting.
145 */
146
147 /* Off we go! */
148 la t0, mips_cps_bootcfg
149 lw t1, BOOTCFG_PC(t0)
150 lw gp, BOOTCFG_GP(t0)
151 lw sp, BOOTCFG_SP(t0)
152 jr t1
153 nop
154 END(mips_cps_core_entry)
155
156.org 0x200
157LEAF(excep_tlbfill)
158 b .
159 nop
160 END(excep_tlbfill)
161
162.org 0x280
163LEAF(excep_xtlbfill)
164 b .
165 nop
166 END(excep_xtlbfill)
167
168.org 0x300
169LEAF(excep_cache)
170 b .
171 nop
172 END(excep_cache)
173
174.org 0x380
175LEAF(excep_genex)
176 b .
177 nop
178 END(excep_genex)
179
180.org 0x400
181LEAF(excep_intex)
182 b .
183 nop
184 END(excep_intex)
185
186.org 0x480
187LEAF(excep_ejtag)
188 la k0, ejtag_debug_handler
189 jr k0
190 nop
191 END(excep_ejtag)
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 530f832de02c..6e8fb85ce7c3 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -23,6 +23,8 @@
23#include <asm/cpu-type.h> 23#include <asm/cpu-type.h>
24#include <asm/fpu.h> 24#include <asm/fpu.h>
25#include <asm/mipsregs.h> 25#include <asm/mipsregs.h>
26#include <asm/mipsmtregs.h>
27#include <asm/msa.h>
26#include <asm/watch.h> 28#include <asm/watch.h>
27#include <asm/elf.h> 29#include <asm/elf.h>
28#include <asm/spram.h> 30#include <asm/spram.h>
@@ -126,6 +128,20 @@ static inline int __cpu_has_fpu(void)
126 return ((cpu_get_fpu_id() & FPIR_IMP_MASK) != FPIR_IMP_NONE); 128 return ((cpu_get_fpu_id() & FPIR_IMP_MASK) != FPIR_IMP_NONE);
127} 129}
128 130
131static inline unsigned long cpu_get_msa_id(void)
132{
133 unsigned long status, conf5, msa_id;
134
135 status = read_c0_status();
136 __enable_fpu(FPU_64BIT);
137 conf5 = read_c0_config5();
138 enable_msa();
139 msa_id = read_msa_ir();
140 write_c0_config5(conf5);
141 write_c0_status(status);
142 return msa_id;
143}
144
129static inline void cpu_probe_vmbits(struct cpuinfo_mips *c) 145static inline void cpu_probe_vmbits(struct cpuinfo_mips *c)
130{ 146{
131#ifdef __NEED_VMBITS_PROBE 147#ifdef __NEED_VMBITS_PROBE
@@ -166,11 +182,12 @@ static char unknown_isa[] = KERN_ERR \
166static void set_ftlb_enable(struct cpuinfo_mips *c, int enable) 182static void set_ftlb_enable(struct cpuinfo_mips *c, int enable)
167{ 183{
168 unsigned int config6; 184 unsigned int config6;
169 /* 185
170 * Config6 is implementation dependent and it's currently only 186 /* It's implementation dependent how the FTLB can be enabled */
171 * used by proAptiv 187 switch (c->cputype) {
172 */ 188 case CPU_PROAPTIV:
173 if (c->cputype == CPU_PROAPTIV) { 189 case CPU_P5600:
190 /* proAptiv & related cores use Config6 to enable the FTLB */
174 config6 = read_c0_config6(); 191 config6 = read_c0_config6();
175 if (enable) 192 if (enable)
176 /* Enable FTLB */ 193 /* Enable FTLB */
@@ -179,6 +196,7 @@ static void set_ftlb_enable(struct cpuinfo_mips *c, int enable)
179 /* Disable FTLB */ 196 /* Disable FTLB */
180 write_c0_config6(config6 & ~MIPS_CONF6_FTLBEN); 197 write_c0_config6(config6 & ~MIPS_CONF6_FTLBEN);
181 back_to_back_c0_hazard(); 198 back_to_back_c0_hazard();
199 break;
182 } 200 }
183} 201}
184 202
@@ -301,6 +319,8 @@ static inline unsigned int decode_config3(struct cpuinfo_mips *c)
301 c->ases |= MIPS_ASE_VZ; 319 c->ases |= MIPS_ASE_VZ;
302 if (config3 & MIPS_CONF3_SC) 320 if (config3 & MIPS_CONF3_SC)
303 c->options |= MIPS_CPU_SEGMENTS; 321 c->options |= MIPS_CPU_SEGMENTS;
322 if (config3 & MIPS_CONF3_MSA)
323 c->ases |= MIPS_ASE_MSA;
304 324
305 return config3 & MIPS_CONF_M; 325 return config3 & MIPS_CONF_M;
306} 326}
@@ -367,6 +387,9 @@ static inline unsigned int decode_config5(struct cpuinfo_mips *c)
367 config5 &= ~MIPS_CONF5_UFR; 387 config5 &= ~MIPS_CONF5_UFR;
368 write_c0_config5(config5); 388 write_c0_config5(config5);
369 389
390 if (config5 & MIPS_CONF5_EVA)
391 c->options |= MIPS_CPU_EVA;
392
370 return config5 & MIPS_CONF_M; 393 return config5 & MIPS_CONF_M;
371} 394}
372 395
@@ -398,8 +421,13 @@ static void decode_configs(struct cpuinfo_mips *c)
398 421
399 mips_probe_watch_registers(c); 422 mips_probe_watch_registers(c);
400 423
401 if (cpu_has_mips_r2) 424#ifndef CONFIG_MIPS_CPS
425 if (cpu_has_mips_r2) {
402 c->core = read_c0_ebase() & 0x3ff; 426 c->core = read_c0_ebase() & 0x3ff;
427 if (cpu_has_mipsmt)
428 c->core >>= fls(core_nvpes()) - 1;
429 }
430#endif
403} 431}
404 432
405#define R4K_OPTS (MIPS_CPU_TLB | MIPS_CPU_4KEX | MIPS_CPU_4K_CACHE \ 433#define R4K_OPTS (MIPS_CPU_TLB | MIPS_CPU_4KEX | MIPS_CPU_4K_CACHE \
@@ -710,17 +738,23 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
710 MIPS_CPU_LLSC; 738 MIPS_CPU_LLSC;
711 c->tlbsize = 64; 739 c->tlbsize = 64;
712 break; 740 break;
713 case PRID_IMP_LOONGSON2: 741 case PRID_IMP_LOONGSON_64: /* Loongson-2/3 */
714 c->cputype = CPU_LOONGSON2;
715 __cpu_name[cpu] = "ICT Loongson-2";
716
717 switch (c->processor_id & PRID_REV_MASK) { 742 switch (c->processor_id & PRID_REV_MASK) {
718 case PRID_REV_LOONGSON2E: 743 case PRID_REV_LOONGSON2E:
744 c->cputype = CPU_LOONGSON2;
745 __cpu_name[cpu] = "ICT Loongson-2";
719 set_elf_platform(cpu, "loongson2e"); 746 set_elf_platform(cpu, "loongson2e");
720 break; 747 break;
721 case PRID_REV_LOONGSON2F: 748 case PRID_REV_LOONGSON2F:
749 c->cputype = CPU_LOONGSON2;
750 __cpu_name[cpu] = "ICT Loongson-2";
722 set_elf_platform(cpu, "loongson2f"); 751 set_elf_platform(cpu, "loongson2f");
723 break; 752 break;
753 case PRID_REV_LOONGSON3A:
754 c->cputype = CPU_LOONGSON3;
755 __cpu_name[cpu] = "ICT Loongson-3";
756 set_elf_platform(cpu, "loongson3a");
757 break;
724 } 758 }
725 759
726 set_isa(c, MIPS_CPU_ISA_III); 760 set_isa(c, MIPS_CPU_ISA_III);
@@ -729,7 +763,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
729 MIPS_CPU_32FPR; 763 MIPS_CPU_32FPR;
730 c->tlbsize = 64; 764 c->tlbsize = 64;
731 break; 765 break;
732 case PRID_IMP_LOONGSON1: 766 case PRID_IMP_LOONGSON_32: /* Loongson-1 */
733 decode_configs(c); 767 decode_configs(c);
734 768
735 c->cputype = CPU_LOONGSON1; 769 c->cputype = CPU_LOONGSON1;
@@ -806,7 +840,7 @@ static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu)
806 __cpu_name[cpu] = "MIPS 1004Kc"; 840 __cpu_name[cpu] = "MIPS 1004Kc";
807 break; 841 break;
808 case PRID_IMP_1074K: 842 case PRID_IMP_1074K:
809 c->cputype = CPU_74K; 843 c->cputype = CPU_1074K;
810 __cpu_name[cpu] = "MIPS 1074Kc"; 844 __cpu_name[cpu] = "MIPS 1074Kc";
811 break; 845 break;
812 case PRID_IMP_INTERAPTIV_UP: 846 case PRID_IMP_INTERAPTIV_UP:
@@ -825,6 +859,14 @@ static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu)
825 c->cputype = CPU_PROAPTIV; 859 c->cputype = CPU_PROAPTIV;
826 __cpu_name[cpu] = "MIPS proAptiv (multi)"; 860 __cpu_name[cpu] = "MIPS proAptiv (multi)";
827 break; 861 break;
862 case PRID_IMP_P5600:
863 c->cputype = CPU_P5600;
864 __cpu_name[cpu] = "MIPS P5600";
865 break;
866 case PRID_IMP_M5150:
867 c->cputype = CPU_M5150;
868 __cpu_name[cpu] = "MIPS M5150";
869 break;
828 } 870 }
829 871
830 decode_configs(c); 872 decode_configs(c);
@@ -1176,6 +1218,12 @@ void cpu_probe(void)
1176 else 1218 else
1177 c->srsets = 1; 1219 c->srsets = 1;
1178 1220
1221 if (cpu_has_msa) {
1222 c->msa_id = cpu_get_msa_id();
1223 WARN(c->msa_id & MSA_IR_WRPF,
1224 "Vector register partitioning unimplemented!");
1225 }
1226
1179 cpu_probe_vmbits(c); 1227 cpu_probe_vmbits(c);
1180 1228
1181#ifdef CONFIG_64BIT 1229#ifdef CONFIG_64BIT
@@ -1192,4 +1240,6 @@ void cpu_report(void)
1192 smp_processor_id(), c->processor_id, cpu_name_string()); 1240 smp_processor_id(), c->processor_id, cpu_name_string());
1193 if (c->options & MIPS_CPU_FPU) 1241 if (c->options & MIPS_CPU_FPU)
1194 printk(KERN_INFO "FPU revision is: %08x\n", c->fpu_id); 1242 printk(KERN_INFO "FPU revision is: %08x\n", c->fpu_id);
1243 if (cpu_has_msa)
1244 pr_info("MSA revision is: %08x\n", c->msa_id);
1195} 1245}
diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c
index 374ed74cd516..60e7e5e45af1 100644
--- a/arch/mips/kernel/ftrace.c
+++ b/arch/mips/kernel/ftrace.c
@@ -90,6 +90,7 @@ static inline void ftrace_dyn_arch_init_insns(void)
90static int ftrace_modify_code(unsigned long ip, unsigned int new_code) 90static int ftrace_modify_code(unsigned long ip, unsigned int new_code)
91{ 91{
92 int faulted; 92 int faulted;
93 mm_segment_t old_fs;
93 94
94 /* *(unsigned int *)ip = new_code; */ 95 /* *(unsigned int *)ip = new_code; */
95 safe_store_code(new_code, ip, faulted); 96 safe_store_code(new_code, ip, faulted);
@@ -97,7 +98,10 @@ static int ftrace_modify_code(unsigned long ip, unsigned int new_code)
97 if (unlikely(faulted)) 98 if (unlikely(faulted))
98 return -EFAULT; 99 return -EFAULT;
99 100
101 old_fs = get_fs();
102 set_fs(get_ds());
100 flush_icache_range(ip, ip + 8); 103 flush_icache_range(ip, ip + 8);
104 set_fs(old_fs);
101 105
102 return 0; 106 return 0;
103} 107}
@@ -197,7 +201,7 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
197 return ftrace_modify_code(FTRACE_CALL_IP, new); 201 return ftrace_modify_code(FTRACE_CALL_IP, new);
198} 202}
199 203
200int __init ftrace_dyn_arch_init(void *data) 204int __init ftrace_dyn_arch_init(void)
201{ 205{
202 /* Encode the instructions when booting */ 206 /* Encode the instructions when booting */
203 ftrace_dyn_arch_init_insns(); 207 ftrace_dyn_arch_init_insns();
@@ -205,9 +209,6 @@ int __init ftrace_dyn_arch_init(void *data)
205 /* Remove "b ftrace_stub" to ensure ftrace_caller() is executed */ 209 /* Remove "b ftrace_stub" to ensure ftrace_caller() is executed */
206 ftrace_modify_code(MCOUNT_ADDR, INSN_NOP); 210 ftrace_modify_code(MCOUNT_ADDR, INSN_NOP);
207 211
208 /* The return code is retured via data */
209 *(unsigned long *)data = 0;
210
211 return 0; 212 return 0;
212} 213}
213#endif /* CONFIG_DYNAMIC_FTRACE */ 214#endif /* CONFIG_DYNAMIC_FTRACE */
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index d84f6a509502..a9ce3408be25 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -67,7 +67,7 @@ NESTED(except_vec3_generic, 0, sp)
67 */ 67 */
68NESTED(except_vec3_r4000, 0, sp) 68NESTED(except_vec3_r4000, 0, sp)
69 .set push 69 .set push
70 .set mips3 70 .set arch=r4000
71 .set noat 71 .set noat
72 mfc0 k1, CP0_CAUSE 72 mfc0 k1, CP0_CAUSE
73 li k0, 31<<2 73 li k0, 31<<2
@@ -139,7 +139,7 @@ LEAF(__r4k_wait)
139 nop 139 nop
140 nop 140 nop
141#endif 141#endif
142 .set mips3 142 .set arch=r4000
143 wait 143 wait
144 /* end of rollback region (the region size must be power of two) */ 144 /* end of rollback region (the region size must be power of two) */
1451: 1451:
@@ -475,8 +475,10 @@ NESTED(nmi_handler, PT_SIZE, sp)
475 BUILD_HANDLER cpu cpu sti silent /* #11 */ 475 BUILD_HANDLER cpu cpu sti silent /* #11 */
476 BUILD_HANDLER ov ov sti silent /* #12 */ 476 BUILD_HANDLER ov ov sti silent /* #12 */
477 BUILD_HANDLER tr tr sti silent /* #13 */ 477 BUILD_HANDLER tr tr sti silent /* #13 */
478 BUILD_HANDLER msa_fpe msa_fpe sti silent /* #14 */
478 BUILD_HANDLER fpe fpe fpe silent /* #15 */ 479 BUILD_HANDLER fpe fpe fpe silent /* #15 */
479 BUILD_HANDLER ftlb ftlb none silent /* #16 */ 480 BUILD_HANDLER ftlb ftlb none silent /* #16 */
481 BUILD_HANDLER msa msa sti silent /* #21 */
480 BUILD_HANDLER mdmx mdmx sti silent /* #22 */ 482 BUILD_HANDLER mdmx mdmx sti silent /* #22 */
481#ifdef CONFIG_HARDWARE_WATCHPOINTS 483#ifdef CONFIG_HARDWARE_WATCHPOINTS
482 /* 484 /*
@@ -575,7 +577,7 @@ isrdhwr:
575 ori k1, _THREAD_MASK 577 ori k1, _THREAD_MASK
576 xori k1, _THREAD_MASK 578 xori k1, _THREAD_MASK
577 LONG_L v1, TI_TP_VALUE(k1) 579 LONG_L v1, TI_TP_VALUE(k1)
578 .set mips3 580 .set arch=r4000
579 eret 581 eret
580 .set mips0 582 .set mips0
581#endif 583#endif
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
index 7b6a5b3e3acf..e712dcf18b2d 100644
--- a/arch/mips/kernel/head.S
+++ b/arch/mips/kernel/head.S
@@ -175,8 +175,8 @@ NESTED(smp_bootstrap, 16, sp)
175 DMT 10 # dmt t2 /* t0, t1 are used by CLI and setup_c0_status() */ 175 DMT 10 # dmt t2 /* t0, t1 are used by CLI and setup_c0_status() */
176 jal mips_ihb 176 jal mips_ihb
177#endif /* CONFIG_MIPS_MT_SMTC */ 177#endif /* CONFIG_MIPS_MT_SMTC */
178 setup_c0_status_sec
179 smp_slave_setup 178 smp_slave_setup
179 setup_c0_status_sec
180#ifdef CONFIG_MIPS_MT_SMTC 180#ifdef CONFIG_MIPS_MT_SMTC
181 andi t2, t2, VPECONTROL_TE 181 andi t2, t2, VPECONTROL_TE
182 beqz t2, 2f 182 beqz t2, 2f
diff --git a/arch/mips/kernel/idle.c b/arch/mips/kernel/idle.c
index 3553243bf9d6..837ff27950bc 100644
--- a/arch/mips/kernel/idle.c
+++ b/arch/mips/kernel/idle.c
@@ -64,7 +64,7 @@ void r4k_wait_irqoff(void)
64 if (!need_resched()) 64 if (!need_resched())
65 __asm__( 65 __asm__(
66 " .set push \n" 66 " .set push \n"
67 " .set mips3 \n" 67 " .set arch=r4000 \n"
68 " wait \n" 68 " wait \n"
69 " .set pop \n"); 69 " .set pop \n");
70 local_irq_enable(); 70 local_irq_enable();
@@ -82,7 +82,7 @@ static void rm7k_wait_irqoff(void)
82 if (!need_resched()) 82 if (!need_resched())
83 __asm__( 83 __asm__(
84 " .set push \n" 84 " .set push \n"
85 " .set mips3 \n" 85 " .set arch=r4000 \n"
86 " .set noat \n" 86 " .set noat \n"
87 " mfc0 $1, $12 \n" 87 " mfc0 $1, $12 \n"
88 " sync \n" 88 " sync \n"
@@ -103,7 +103,7 @@ static void au1k_wait(void)
103 unsigned long c0status = read_c0_status() | 1; /* irqs on */ 103 unsigned long c0status = read_c0_status() | 1; /* irqs on */
104 104
105 __asm__( 105 __asm__(
106 " .set mips3 \n" 106 " .set arch=r4000 \n"
107 " cache 0x14, 0(%0) \n" 107 " cache 0x14, 0(%0) \n"
108 " cache 0x14, 32(%0) \n" 108 " cache 0x14, 32(%0) \n"
109 " sync \n" 109 " sync \n"
@@ -184,8 +184,11 @@ void __init check_wait(void)
184 case CPU_24K: 184 case CPU_24K:
185 case CPU_34K: 185 case CPU_34K:
186 case CPU_1004K: 186 case CPU_1004K:
187 case CPU_1074K:
187 case CPU_INTERAPTIV: 188 case CPU_INTERAPTIV:
188 case CPU_PROAPTIV: 189 case CPU_PROAPTIV:
190 case CPU_P5600:
191 case CPU_M5150:
189 cpu_wait = r4k_wait; 192 cpu_wait = r4k_wait;
190 if (read_c0_config7() & MIPS_CONF7_WII) 193 if (read_c0_config7() & MIPS_CONF7_WII)
191 cpu_wait = r4k_wait_irqoff; 194 cpu_wait = r4k_wait_irqoff;
diff --git a/arch/mips/kernel/irq-gic.c b/arch/mips/kernel/irq-gic.c
index 5b5ddb231f26..8520dad6d4e3 100644
--- a/arch/mips/kernel/irq-gic.c
+++ b/arch/mips/kernel/irq-gic.c
@@ -16,7 +16,6 @@
16#include <asm/gic.h> 16#include <asm/gic.h>
17#include <asm/setup.h> 17#include <asm/setup.h>
18#include <asm/traps.h> 18#include <asm/traps.h>
19#include <asm/gcmpregs.h>
20#include <linux/hardirq.h> 19#include <linux/hardirq.h>
21#include <asm-generic/bitops/find.h> 20#include <asm-generic/bitops/find.h>
22 21
diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c
index fcaac2f132f0..7afcc2f22c0d 100644
--- a/arch/mips/kernel/kgdb.c
+++ b/arch/mips/kernel/kgdb.c
@@ -32,6 +32,7 @@
32#include <asm/cacheflush.h> 32#include <asm/cacheflush.h>
33#include <asm/processor.h> 33#include <asm/processor.h>
34#include <asm/sigcontext.h> 34#include <asm/sigcontext.h>
35#include <asm/uaccess.h>
35 36
36static struct hard_trap_info { 37static struct hard_trap_info {
37 unsigned char tt; /* Trap type code for MIPS R3xxx and R4xxx */ 38 unsigned char tt; /* Trap type code for MIPS R3xxx and R4xxx */
@@ -208,7 +209,14 @@ void arch_kgdb_breakpoint(void)
208 209
209static void kgdb_call_nmi_hook(void *ignored) 210static void kgdb_call_nmi_hook(void *ignored)
210{ 211{
212 mm_segment_t old_fs;
213
214 old_fs = get_fs();
215 set_fs(get_ds());
216
211 kgdb_nmicallback(raw_smp_processor_id(), NULL); 217 kgdb_nmicallback(raw_smp_processor_id(), NULL);
218
219 set_fs(old_fs);
212} 220}
213 221
214void kgdb_roundup_cpus(unsigned long flags) 222void kgdb_roundup_cpus(unsigned long flags)
@@ -282,6 +290,7 @@ static int kgdb_mips_notify(struct notifier_block *self, unsigned long cmd,
282 struct die_args *args = (struct die_args *)ptr; 290 struct die_args *args = (struct die_args *)ptr;
283 struct pt_regs *regs = args->regs; 291 struct pt_regs *regs = args->regs;
284 int trap = (regs->cp0_cause & 0x7c) >> 2; 292 int trap = (regs->cp0_cause & 0x7c) >> 2;
293 mm_segment_t old_fs;
285 294
286#ifdef CONFIG_KPROBES 295#ifdef CONFIG_KPROBES
287 /* 296 /*
@@ -296,11 +305,17 @@ static int kgdb_mips_notify(struct notifier_block *self, unsigned long cmd,
296 if (user_mode(regs)) 305 if (user_mode(regs))
297 return NOTIFY_DONE; 306 return NOTIFY_DONE;
298 307
308 /* Kernel mode. Set correct address limit */
309 old_fs = get_fs();
310 set_fs(get_ds());
311
299 if (atomic_read(&kgdb_active) != -1) 312 if (atomic_read(&kgdb_active) != -1)
300 kgdb_nmicallback(smp_processor_id(), regs); 313 kgdb_nmicallback(smp_processor_id(), regs);
301 314
302 if (kgdb_handle_exception(trap, compute_signal(trap), cmd, regs)) 315 if (kgdb_handle_exception(trap, compute_signal(trap), cmd, regs)) {
316 set_fs(old_fs);
303 return NOTIFY_DONE; 317 return NOTIFY_DONE;
318 }
304 319
305 if (atomic_read(&kgdb_setting_breakpoint)) 320 if (atomic_read(&kgdb_setting_breakpoint))
306 if ((trap == 9) && (regs->cp0_epc == (unsigned long)breakinst)) 321 if ((trap == 9) && (regs->cp0_epc == (unsigned long)breakinst))
@@ -310,6 +325,7 @@ static int kgdb_mips_notify(struct notifier_block *self, unsigned long cmd,
310 local_irq_enable(); 325 local_irq_enable();
311 __flush_cache_all(); 326 __flush_cache_all();
312 327
328 set_fs(old_fs);
313 return NOTIFY_STOP; 329 return NOTIFY_STOP;
314} 330}
315 331
diff --git a/arch/mips/kernel/mips-cm.c b/arch/mips/kernel/mips-cm.c
new file mode 100644
index 000000000000..f76f7a08412d
--- /dev/null
+++ b/arch/mips/kernel/mips-cm.c
@@ -0,0 +1,121 @@
1/*
2 * Copyright (C) 2013 Imagination Technologies
3 * Author: Paul Burton <paul.burton@imgtec.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#include <linux/errno.h>
12
13#include <asm/mips-cm.h>
14#include <asm/mipsregs.h>
15
16void __iomem *mips_cm_base;
17void __iomem *mips_cm_l2sync_base;
18
19phys_t __mips_cm_phys_base(void)
20{
21 u32 config3 = read_c0_config3();
22 u32 cmgcr;
23
24 /* Check the CMGCRBase register is implemented */
25 if (!(config3 & MIPS_CONF3_CMGCR))
26 return 0;
27
28 /* Read the address from CMGCRBase */
29 cmgcr = read_c0_cmgcrbase();
30 return (cmgcr & MIPS_CMGCRF_BASE) << (36 - 32);
31}
32
33phys_t mips_cm_phys_base(void)
34 __attribute__((weak, alias("__mips_cm_phys_base")));
35
36phys_t __mips_cm_l2sync_phys_base(void)
37{
38 u32 base_reg;
39
40 /*
41 * If the L2-only sync region is already enabled then leave it at it's
42 * current location.
43 */
44 base_reg = read_gcr_l2_only_sync_base();
45 if (base_reg & CM_GCR_L2_ONLY_SYNC_BASE_SYNCEN_MSK)
46 return base_reg & CM_GCR_L2_ONLY_SYNC_BASE_SYNCBASE_MSK;
47
48 /* Default to following the CM */
49 return mips_cm_phys_base() + MIPS_CM_GCR_SIZE;
50}
51
52phys_t mips_cm_l2sync_phys_base(void)
53 __attribute__((weak, alias("__mips_cm_l2sync_phys_base")));
54
55static void mips_cm_probe_l2sync(void)
56{
57 unsigned major_rev;
58 phys_t addr;
59
60 /* L2-only sync was introduced with CM major revision 6 */
61 major_rev = (read_gcr_rev() & CM_GCR_REV_MAJOR_MSK) >>
62 CM_GCR_REV_MAJOR_SHF;
63 if (major_rev < 6)
64 return;
65
66 /* Find a location for the L2 sync region */
67 addr = mips_cm_l2sync_phys_base();
68 BUG_ON((addr & CM_GCR_L2_ONLY_SYNC_BASE_SYNCBASE_MSK) != addr);
69 if (!addr)
70 return;
71
72 /* Set the region base address & enable it */
73 write_gcr_l2_only_sync_base(addr | CM_GCR_L2_ONLY_SYNC_BASE_SYNCEN_MSK);
74
75 /* Map the region */
76 mips_cm_l2sync_base = ioremap_nocache(addr, MIPS_CM_L2SYNC_SIZE);
77}
78
79int mips_cm_probe(void)
80{
81 phys_t addr;
82 u32 base_reg;
83
84 addr = mips_cm_phys_base();
85 BUG_ON((addr & CM_GCR_BASE_GCRBASE_MSK) != addr);
86 if (!addr)
87 return -ENODEV;
88
89 mips_cm_base = ioremap_nocache(addr, MIPS_CM_GCR_SIZE);
90 if (!mips_cm_base)
91 return -ENXIO;
92
93 /* sanity check that we're looking at a CM */
94 base_reg = read_gcr_base();
95 if ((base_reg & CM_GCR_BASE_GCRBASE_MSK) != addr) {
96 pr_err("GCRs appear to have been moved (expected them at 0x%08lx)!\n",
97 (unsigned long)addr);
98 mips_cm_base = NULL;
99 return -ENODEV;
100 }
101
102 /* set default target to memory */
103 base_reg &= ~CM_GCR_BASE_CMDEFTGT_MSK;
104 base_reg |= CM_GCR_BASE_CMDEFTGT_MEM;
105 write_gcr_base(base_reg);
106
107 /* disable CM regions */
108 write_gcr_reg0_base(CM_GCR_REGn_BASE_BASEADDR_MSK);
109 write_gcr_reg0_mask(CM_GCR_REGn_MASK_ADDRMASK_MSK);
110 write_gcr_reg1_base(CM_GCR_REGn_BASE_BASEADDR_MSK);
111 write_gcr_reg1_mask(CM_GCR_REGn_MASK_ADDRMASK_MSK);
112 write_gcr_reg2_base(CM_GCR_REGn_BASE_BASEADDR_MSK);
113 write_gcr_reg2_mask(CM_GCR_REGn_MASK_ADDRMASK_MSK);
114 write_gcr_reg3_base(CM_GCR_REGn_BASE_BASEADDR_MSK);
115 write_gcr_reg3_mask(CM_GCR_REGn_MASK_ADDRMASK_MSK);
116
117 /* probe for an L2-only sync region */
118 mips_cm_probe_l2sync();
119
120 return 0;
121}
diff --git a/arch/mips/kernel/mips-cpc.c b/arch/mips/kernel/mips-cpc.c
new file mode 100644
index 000000000000..c9dc67402969
--- /dev/null
+++ b/arch/mips/kernel/mips-cpc.c
@@ -0,0 +1,52 @@
1/*
2 * Copyright (C) 2013 Imagination Technologies
3 * Author: Paul Burton <paul.burton@imgtec.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#include <linux/errno.h>
12
13#include <asm/mips-cm.h>
14#include <asm/mips-cpc.h>
15
16void __iomem *mips_cpc_base;
17
18phys_t __weak mips_cpc_phys_base(void)
19{
20 u32 cpc_base;
21
22 if (!mips_cm_present())
23 return 0;
24
25 if (!(read_gcr_cpc_status() & CM_GCR_CPC_STATUS_EX_MSK))
26 return 0;
27
28 /* If the CPC is already enabled, leave it so */
29 cpc_base = read_gcr_cpc_base();
30 if (cpc_base & CM_GCR_CPC_BASE_CPCEN_MSK)
31 return cpc_base & CM_GCR_CPC_BASE_CPCBASE_MSK;
32
33 /* Otherwise, give it the default address & enable it */
34 cpc_base = mips_cpc_default_phys_base();
35 write_gcr_cpc_base(cpc_base | CM_GCR_CPC_BASE_CPCEN_MSK);
36 return cpc_base;
37}
38
39int mips_cpc_probe(void)
40{
41 phys_t addr;
42
43 addr = mips_cpc_phys_base();
44 if (!addr)
45 return -ENODEV;
46
47 mips_cpc_base = ioremap_nocache(addr, 0x8000);
48 if (!mips_cpc_base)
49 return -ENXIO;
50
51 return 0;
52}
diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c
index 6e58e97fcd39..2607c3a4ff7e 100644
--- a/arch/mips/kernel/mips_ksyms.c
+++ b/arch/mips/kernel/mips_ksyms.c
@@ -16,12 +16,20 @@
16#include <asm/ftrace.h> 16#include <asm/ftrace.h>
17 17
18extern void *__bzero(void *__s, size_t __count); 18extern void *__bzero(void *__s, size_t __count);
19extern long __strncpy_from_kernel_nocheck_asm(char *__to,
20 const char *__from, long __len);
21extern long __strncpy_from_kernel_asm(char *__to, const char *__from,
22 long __len);
19extern long __strncpy_from_user_nocheck_asm(char *__to, 23extern long __strncpy_from_user_nocheck_asm(char *__to,
20 const char *__from, long __len); 24 const char *__from, long __len);
21extern long __strncpy_from_user_asm(char *__to, const char *__from, 25extern long __strncpy_from_user_asm(char *__to, const char *__from,
22 long __len); 26 long __len);
27extern long __strlen_kernel_nocheck_asm(const char *s);
28extern long __strlen_kernel_asm(const char *s);
23extern long __strlen_user_nocheck_asm(const char *s); 29extern long __strlen_user_nocheck_asm(const char *s);
24extern long __strlen_user_asm(const char *s); 30extern long __strlen_user_asm(const char *s);
31extern long __strnlen_kernel_nocheck_asm(const char *s);
32extern long __strnlen_kernel_asm(const char *s);
25extern long __strnlen_user_nocheck_asm(const char *s); 33extern long __strnlen_user_nocheck_asm(const char *s);
26extern long __strnlen_user_asm(const char *s); 34extern long __strnlen_user_asm(const char *s);
27 35
@@ -43,17 +51,31 @@ EXPORT_SYMBOL(copy_page);
43 */ 51 */
44EXPORT_SYMBOL(__copy_user); 52EXPORT_SYMBOL(__copy_user);
45EXPORT_SYMBOL(__copy_user_inatomic); 53EXPORT_SYMBOL(__copy_user_inatomic);
54#ifdef CONFIG_EVA
55EXPORT_SYMBOL(__copy_from_user_eva);
56EXPORT_SYMBOL(__copy_in_user_eva);
57EXPORT_SYMBOL(__copy_to_user_eva);
58EXPORT_SYMBOL(__copy_user_inatomic_eva);
59#endif
46EXPORT_SYMBOL(__bzero); 60EXPORT_SYMBOL(__bzero);
61EXPORT_SYMBOL(__strncpy_from_kernel_nocheck_asm);
62EXPORT_SYMBOL(__strncpy_from_kernel_asm);
47EXPORT_SYMBOL(__strncpy_from_user_nocheck_asm); 63EXPORT_SYMBOL(__strncpy_from_user_nocheck_asm);
48EXPORT_SYMBOL(__strncpy_from_user_asm); 64EXPORT_SYMBOL(__strncpy_from_user_asm);
65EXPORT_SYMBOL(__strlen_kernel_nocheck_asm);
66EXPORT_SYMBOL(__strlen_kernel_asm);
49EXPORT_SYMBOL(__strlen_user_nocheck_asm); 67EXPORT_SYMBOL(__strlen_user_nocheck_asm);
50EXPORT_SYMBOL(__strlen_user_asm); 68EXPORT_SYMBOL(__strlen_user_asm);
69EXPORT_SYMBOL(__strnlen_kernel_nocheck_asm);
70EXPORT_SYMBOL(__strnlen_kernel_asm);
51EXPORT_SYMBOL(__strnlen_user_nocheck_asm); 71EXPORT_SYMBOL(__strnlen_user_nocheck_asm);
52EXPORT_SYMBOL(__strnlen_user_asm); 72EXPORT_SYMBOL(__strnlen_user_asm);
53 73
54EXPORT_SYMBOL(csum_partial); 74EXPORT_SYMBOL(csum_partial);
55EXPORT_SYMBOL(csum_partial_copy_nocheck); 75EXPORT_SYMBOL(csum_partial_copy_nocheck);
56EXPORT_SYMBOL(__csum_partial_copy_user); 76EXPORT_SYMBOL(__csum_partial_copy_kernel);
77EXPORT_SYMBOL(__csum_partial_copy_to_user);
78EXPORT_SYMBOL(__csum_partial_copy_from_user);
57 79
58EXPORT_SYMBOL(invalid_pte_table); 80EXPORT_SYMBOL(invalid_pte_table);
59#ifdef CONFIG_FUNCTION_TRACER 81#ifdef CONFIG_FUNCTION_TRACER
diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c
index 24cdf64789c3..4f2d9dece7ab 100644
--- a/arch/mips/kernel/perf_event_mipsxx.c
+++ b/arch/mips/kernel/perf_event_mipsxx.c
@@ -805,7 +805,7 @@ static void reset_counters(void *arg)
805 } 805 }
806} 806}
807 807
808/* 24K/34K/1004K cores can share the same event map. */ 808/* 24K/34K/1004K/interAptiv/loongson1 cores share the same event map. */
809static const struct mips_perf_event mipsxxcore_event_map 809static const struct mips_perf_event mipsxxcore_event_map
810 [PERF_COUNT_HW_MAX] = { 810 [PERF_COUNT_HW_MAX] = {
811 [PERF_COUNT_HW_CPU_CYCLES] = { 0x00, CNTR_EVEN | CNTR_ODD, P }, 811 [PERF_COUNT_HW_CPU_CYCLES] = { 0x00, CNTR_EVEN | CNTR_ODD, P },
@@ -814,8 +814,8 @@ static const struct mips_perf_event mipsxxcore_event_map
814 [PERF_COUNT_HW_BRANCH_MISSES] = { 0x02, CNTR_ODD, T }, 814 [PERF_COUNT_HW_BRANCH_MISSES] = { 0x02, CNTR_ODD, T },
815}; 815};
816 816
817/* 74K core has different branch event code. */ 817/* 74K/proAptiv core has different branch event code. */
818static const struct mips_perf_event mipsxx74Kcore_event_map 818static const struct mips_perf_event mipsxxcore_event_map2
819 [PERF_COUNT_HW_MAX] = { 819 [PERF_COUNT_HW_MAX] = {
820 [PERF_COUNT_HW_CPU_CYCLES] = { 0x00, CNTR_EVEN | CNTR_ODD, P }, 820 [PERF_COUNT_HW_CPU_CYCLES] = { 0x00, CNTR_EVEN | CNTR_ODD, P },
821 [PERF_COUNT_HW_INSTRUCTIONS] = { 0x01, CNTR_EVEN | CNTR_ODD, T }, 821 [PERF_COUNT_HW_INSTRUCTIONS] = { 0x01, CNTR_EVEN | CNTR_ODD, T },
@@ -849,7 +849,7 @@ static const struct mips_perf_event xlp_event_map[PERF_COUNT_HW_MAX] = {
849 [PERF_COUNT_HW_BRANCH_MISSES] = { 0x1c, CNTR_ALL }, /* PAPI_BR_MSP */ 849 [PERF_COUNT_HW_BRANCH_MISSES] = { 0x1c, CNTR_ALL }, /* PAPI_BR_MSP */
850}; 850};
851 851
852/* 24K/34K/1004K cores can share the same cache event map. */ 852/* 24K/34K/1004K/interAptiv/loongson1 cores share the same cache event map. */
853static const struct mips_perf_event mipsxxcore_cache_map 853static const struct mips_perf_event mipsxxcore_cache_map
854 [PERF_COUNT_HW_CACHE_MAX] 854 [PERF_COUNT_HW_CACHE_MAX]
855 [PERF_COUNT_HW_CACHE_OP_MAX] 855 [PERF_COUNT_HW_CACHE_OP_MAX]
@@ -930,8 +930,8 @@ static const struct mips_perf_event mipsxxcore_cache_map
930}, 930},
931}; 931};
932 932
933/* 74K core has completely different cache event map. */ 933/* 74K/proAptiv core has completely different cache event map. */
934static const struct mips_perf_event mipsxx74Kcore_cache_map 934static const struct mips_perf_event mipsxxcore_cache_map2
935 [PERF_COUNT_HW_CACHE_MAX] 935 [PERF_COUNT_HW_CACHE_MAX]
936 [PERF_COUNT_HW_CACHE_OP_MAX] 936 [PERF_COUNT_HW_CACHE_OP_MAX]
937 [PERF_COUNT_HW_CACHE_RESULT_MAX] = { 937 [PERF_COUNT_HW_CACHE_RESULT_MAX] = {
@@ -978,6 +978,11 @@ static const struct mips_perf_event mipsxx74Kcore_cache_map
978 [C(RESULT_MISS)] = { 0x1d, CNTR_EVEN, P }, 978 [C(RESULT_MISS)] = { 0x1d, CNTR_EVEN, P },
979 }, 979 },
980}, 980},
981/*
982 * 74K core does not have specific DTLB events. proAptiv core has
983 * "speculative" DTLB events which are numbered 0x63 (even/odd) and
984 * not included here. One can use raw events if really needed.
985 */
981[C(ITLB)] = { 986[C(ITLB)] = {
982 [C(OP_READ)] = { 987 [C(OP_READ)] = {
983 [C(RESULT_ACCESS)] = { 0x04, CNTR_EVEN, T }, 988 [C(RESULT_ACCESS)] = { 0x04, CNTR_EVEN, T },
@@ -1378,6 +1383,10 @@ static irqreturn_t mipsxx_pmu_handle_irq(int irq, void *dev)
1378#define IS_BOTH_COUNTERS_74K_EVENT(b) \ 1383#define IS_BOTH_COUNTERS_74K_EVENT(b) \
1379 ((b) == 0 || (b) == 1) 1384 ((b) == 0 || (b) == 1)
1380 1385
1386/* proAptiv */
1387#define IS_BOTH_COUNTERS_PROAPTIV_EVENT(b) \
1388 ((b) == 0 || (b) == 1)
1389
1381/* 1004K */ 1390/* 1004K */
1382#define IS_BOTH_COUNTERS_1004K_EVENT(b) \ 1391#define IS_BOTH_COUNTERS_1004K_EVENT(b) \
1383 ((b) == 0 || (b) == 1 || (b) == 11) 1392 ((b) == 0 || (b) == 1 || (b) == 11)
@@ -1391,6 +1400,20 @@ static irqreturn_t mipsxx_pmu_handle_irq(int irq, void *dev)
1391#define IS_RANGE_V_1004K_EVENT(r) ((r) == 47) 1400#define IS_RANGE_V_1004K_EVENT(r) ((r) == 47)
1392#endif 1401#endif
1393 1402
1403/* interAptiv */
1404#define IS_BOTH_COUNTERS_INTERAPTIV_EVENT(b) \
1405 ((b) == 0 || (b) == 1 || (b) == 11)
1406#ifdef CONFIG_MIPS_MT_SMP
1407/* The P/V/T info is not provided for "(b) == 38" in SUM, assume P. */
1408#define IS_RANGE_P_INTERAPTIV_EVENT(r, b) \
1409 ((b) == 0 || (r) == 18 || (b) == 21 || (b) == 22 || \
1410 (b) == 25 || (b) == 36 || (b) == 38 || (b) == 39 || \
1411 (r) == 44 || (r) == 174 || (r) == 176 || ((b) >= 50 && \
1412 (b) <= 59) || (r) == 188 || (b) == 61 || (b) == 62 || \
1413 ((b) >= 64 && (b) <= 67))
1414#define IS_RANGE_V_INTERAPTIV_EVENT(r) ((r) == 47 || (r) == 175)
1415#endif
1416
1394/* BMIPS5000 */ 1417/* BMIPS5000 */
1395#define IS_BOTH_COUNTERS_BMIPS5000_EVENT(b) \ 1418#define IS_BOTH_COUNTERS_BMIPS5000_EVENT(b) \
1396 ((b) == 0 || (b) == 1) 1419 ((b) == 0 || (b) == 1)
@@ -1442,6 +1465,7 @@ static const struct mips_perf_event *mipsxx_pmu_map_raw_event(u64 config)
1442#endif 1465#endif
1443 break; 1466 break;
1444 case CPU_74K: 1467 case CPU_74K:
1468 case CPU_1074K:
1445 if (IS_BOTH_COUNTERS_74K_EVENT(base_id)) 1469 if (IS_BOTH_COUNTERS_74K_EVENT(base_id))
1446 raw_event.cntr_mask = CNTR_EVEN | CNTR_ODD; 1470 raw_event.cntr_mask = CNTR_EVEN | CNTR_ODD;
1447 else 1471 else
@@ -1451,6 +1475,16 @@ static const struct mips_perf_event *mipsxx_pmu_map_raw_event(u64 config)
1451 raw_event.range = P; 1475 raw_event.range = P;
1452#endif 1476#endif
1453 break; 1477 break;
1478 case CPU_PROAPTIV:
1479 if (IS_BOTH_COUNTERS_PROAPTIV_EVENT(base_id))
1480 raw_event.cntr_mask = CNTR_EVEN | CNTR_ODD;
1481 else
1482 raw_event.cntr_mask =
1483 raw_id > 127 ? CNTR_ODD : CNTR_EVEN;
1484#ifdef CONFIG_MIPS_MT_SMP
1485 raw_event.range = P;
1486#endif
1487 break;
1454 case CPU_1004K: 1488 case CPU_1004K:
1455 if (IS_BOTH_COUNTERS_1004K_EVENT(base_id)) 1489 if (IS_BOTH_COUNTERS_1004K_EVENT(base_id))
1456 raw_event.cntr_mask = CNTR_EVEN | CNTR_ODD; 1490 raw_event.cntr_mask = CNTR_EVEN | CNTR_ODD;
@@ -1466,6 +1500,21 @@ static const struct mips_perf_event *mipsxx_pmu_map_raw_event(u64 config)
1466 raw_event.range = T; 1500 raw_event.range = T;
1467#endif 1501#endif
1468 break; 1502 break;
1503 case CPU_INTERAPTIV:
1504 if (IS_BOTH_COUNTERS_INTERAPTIV_EVENT(base_id))
1505 raw_event.cntr_mask = CNTR_EVEN | CNTR_ODD;
1506 else
1507 raw_event.cntr_mask =
1508 raw_id > 127 ? CNTR_ODD : CNTR_EVEN;
1509#ifdef CONFIG_MIPS_MT_SMP
1510 if (IS_RANGE_P_INTERAPTIV_EVENT(raw_id, base_id))
1511 raw_event.range = P;
1512 else if (unlikely(IS_RANGE_V_INTERAPTIV_EVENT(raw_id)))
1513 raw_event.range = V;
1514 else
1515 raw_event.range = T;
1516#endif
1517 break;
1469 case CPU_BMIPS5000: 1518 case CPU_BMIPS5000:
1470 if (IS_BOTH_COUNTERS_BMIPS5000_EVENT(base_id)) 1519 if (IS_BOTH_COUNTERS_BMIPS5000_EVENT(base_id))
1471 raw_event.cntr_mask = CNTR_EVEN | CNTR_ODD; 1520 raw_event.cntr_mask = CNTR_EVEN | CNTR_ODD;
@@ -1576,14 +1625,29 @@ init_hw_perf_events(void)
1576 break; 1625 break;
1577 case CPU_74K: 1626 case CPU_74K:
1578 mipspmu.name = "mips/74K"; 1627 mipspmu.name = "mips/74K";
1579 mipspmu.general_event_map = &mipsxx74Kcore_event_map; 1628 mipspmu.general_event_map = &mipsxxcore_event_map2;
1580 mipspmu.cache_event_map = &mipsxx74Kcore_cache_map; 1629 mipspmu.cache_event_map = &mipsxxcore_cache_map2;
1630 break;
1631 case CPU_PROAPTIV:
1632 mipspmu.name = "mips/proAptiv";
1633 mipspmu.general_event_map = &mipsxxcore_event_map2;
1634 mipspmu.cache_event_map = &mipsxxcore_cache_map2;
1581 break; 1635 break;
1582 case CPU_1004K: 1636 case CPU_1004K:
1583 mipspmu.name = "mips/1004K"; 1637 mipspmu.name = "mips/1004K";
1584 mipspmu.general_event_map = &mipsxxcore_event_map; 1638 mipspmu.general_event_map = &mipsxxcore_event_map;
1585 mipspmu.cache_event_map = &mipsxxcore_cache_map; 1639 mipspmu.cache_event_map = &mipsxxcore_cache_map;
1586 break; 1640 break;
1641 case CPU_1074K:
1642 mipspmu.name = "mips/1074K";
1643 mipspmu.general_event_map = &mipsxxcore_event_map;
1644 mipspmu.cache_event_map = &mipsxxcore_cache_map;
1645 break;
1646 case CPU_INTERAPTIV:
1647 mipspmu.name = "mips/interAptiv";
1648 mipspmu.general_event_map = &mipsxxcore_event_map;
1649 mipspmu.cache_event_map = &mipsxxcore_cache_map;
1650 break;
1587 case CPU_LOONGSON1: 1651 case CPU_LOONGSON1:
1588 mipspmu.name = "mips/loongson1"; 1652 mipspmu.name = "mips/loongson1";
1589 mipspmu.general_event_map = &mipsxxcore_event_map; 1653 mipspmu.general_event_map = &mipsxxcore_event_map;
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c
index 00d20974b3e7..e40971b51d2f 100644
--- a/arch/mips/kernel/proc.c
+++ b/arch/mips/kernel/proc.c
@@ -17,8 +17,24 @@
17 17
18unsigned int vced_count, vcei_count; 18unsigned int vced_count, vcei_count;
19 19
20/*
21 * * No lock; only written during early bootup by CPU 0.
22 * */
23static RAW_NOTIFIER_HEAD(proc_cpuinfo_chain);
24
25int __ref register_proc_cpuinfo_notifier(struct notifier_block *nb)
26{
27 return raw_notifier_chain_register(&proc_cpuinfo_chain, nb);
28}
29
30int proc_cpuinfo_notifier_call_chain(unsigned long val, void *v)
31{
32 return raw_notifier_call_chain(&proc_cpuinfo_chain, val, v);
33}
34
20static int show_cpuinfo(struct seq_file *m, void *v) 35static int show_cpuinfo(struct seq_file *m, void *v)
21{ 36{
37 struct proc_cpuinfo_notifier_args proc_cpuinfo_notifier_args;
22 unsigned long n = (unsigned long) v - 1; 38 unsigned long n = (unsigned long) v - 1;
23 unsigned int version = cpu_data[n].processor_id; 39 unsigned int version = cpu_data[n].processor_id;
24 unsigned int fp_vers = cpu_data[n].fpu_id; 40 unsigned int fp_vers = cpu_data[n].fpu_id;
@@ -95,6 +111,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
95 if (cpu_has_mipsmt) seq_printf(m, "%s", " mt"); 111 if (cpu_has_mipsmt) seq_printf(m, "%s", " mt");
96 if (cpu_has_mmips) seq_printf(m, "%s", " micromips"); 112 if (cpu_has_mmips) seq_printf(m, "%s", " micromips");
97 if (cpu_has_vz) seq_printf(m, "%s", " vz"); 113 if (cpu_has_vz) seq_printf(m, "%s", " vz");
114 if (cpu_has_msa) seq_printf(m, "%s", " msa");
115 if (cpu_has_eva) seq_printf(m, "%s", " eva");
98 seq_printf(m, "\n"); 116 seq_printf(m, "\n");
99 117
100 if (cpu_has_mmips) { 118 if (cpu_has_mmips) {
@@ -118,6 +136,13 @@ static int show_cpuinfo(struct seq_file *m, void *v)
118 cpu_has_vce ? "%u" : "not available"); 136 cpu_has_vce ? "%u" : "not available");
119 seq_printf(m, fmt, 'D', vced_count); 137 seq_printf(m, fmt, 'D', vced_count);
120 seq_printf(m, fmt, 'I', vcei_count); 138 seq_printf(m, fmt, 'I', vcei_count);
139
140 proc_cpuinfo_notifier_args.m = m;
141 proc_cpuinfo_notifier_args.n = n;
142
143 raw_notifier_call_chain(&proc_cpuinfo_chain, 0,
144 &proc_cpuinfo_notifier_args);
145
121 seq_printf(m, "\n"); 146 seq_printf(m, "\n");
122 147
123 return 0; 148 return 0;
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 6ae540e133b2..60e39dc7f1eb 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -32,6 +32,7 @@
32#include <asm/cpu.h> 32#include <asm/cpu.h>
33#include <asm/dsp.h> 33#include <asm/dsp.h>
34#include <asm/fpu.h> 34#include <asm/fpu.h>
35#include <asm/msa.h>
35#include <asm/pgtable.h> 36#include <asm/pgtable.h>
36#include <asm/mipsregs.h> 37#include <asm/mipsregs.h>
37#include <asm/processor.h> 38#include <asm/processor.h>
@@ -65,6 +66,8 @@ void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp)
65 clear_used_math(); 66 clear_used_math();
66 clear_fpu_owner(); 67 clear_fpu_owner();
67 init_dsp(); 68 init_dsp();
69 clear_thread_flag(TIF_MSA_CTX_LIVE);
70 disable_msa();
68 regs->cp0_epc = pc; 71 regs->cp0_epc = pc;
69 regs->regs[29] = sp; 72 regs->regs[29] = sp;
70} 73}
@@ -89,7 +92,9 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
89 92
90 preempt_disable(); 93 preempt_disable();
91 94
92 if (is_fpu_owner()) 95 if (is_msa_enabled())
96 save_msa(p);
97 else if (is_fpu_owner())
93 save_fp(p); 98 save_fp(p);
94 99
95 if (cpu_has_dsp) 100 if (cpu_has_dsp)
@@ -157,7 +162,13 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
157/* Fill in the fpu structure for a core dump.. */ 162/* Fill in the fpu structure for a core dump.. */
158int dump_fpu(struct pt_regs *regs, elf_fpregset_t *r) 163int dump_fpu(struct pt_regs *regs, elf_fpregset_t *r)
159{ 164{
160 memcpy(r, &current->thread.fpu, sizeof(current->thread.fpu)); 165 int i;
166
167 for (i = 0; i < NUM_FPU_REGS; i++)
168 memcpy(&r[i], &current->thread.fpu.fpr[i], sizeof(*r));
169
170 memcpy(&r[NUM_FPU_REGS], &current->thread.fpu.fcr31,
171 sizeof(current->thread.fpu.fcr31));
161 172
162 return 1; 173 return 1;
163} 174}
@@ -192,7 +203,13 @@ int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs)
192 203
193int dump_task_fpu(struct task_struct *t, elf_fpregset_t *fpr) 204int dump_task_fpu(struct task_struct *t, elf_fpregset_t *fpr)
194{ 205{
195 memcpy(fpr, &t->thread.fpu, sizeof(current->thread.fpu)); 206 int i;
207
208 for (i = 0; i < NUM_FPU_REGS; i++)
209 memcpy(&fpr[i], &t->thread.fpu.fpr[i], sizeof(*fpr));
210
211 memcpy(&fpr[NUM_FPU_REGS], &t->thread.fpu.fcr31,
212 sizeof(t->thread.fpu.fcr31));
196 213
197 return 1; 214 return 1;
198} 215}
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
index 7da9b76db4d9..71f85f427034 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
@@ -114,51 +114,30 @@ int ptrace_setregs(struct task_struct *child, __s64 __user *data)
114int ptrace_getfpregs(struct task_struct *child, __u32 __user *data) 114int ptrace_getfpregs(struct task_struct *child, __u32 __user *data)
115{ 115{
116 int i; 116 int i;
117 unsigned int tmp;
118 117
119 if (!access_ok(VERIFY_WRITE, data, 33 * 8)) 118 if (!access_ok(VERIFY_WRITE, data, 33 * 8))
120 return -EIO; 119 return -EIO;
121 120
122 if (tsk_used_math(child)) { 121 if (tsk_used_math(child)) {
123 fpureg_t *fregs = get_fpu_regs(child); 122 union fpureg *fregs = get_fpu_regs(child);
124 for (i = 0; i < 32; i++) 123 for (i = 0; i < 32; i++)
125 __put_user(fregs[i], i + (__u64 __user *) data); 124 __put_user(get_fpr64(&fregs[i], 0),
125 i + (__u64 __user *)data);
126 } else { 126 } else {
127 for (i = 0; i < 32; i++) 127 for (i = 0; i < 32; i++)
128 __put_user((__u64) -1, i + (__u64 __user *) data); 128 __put_user((__u64) -1, i + (__u64 __user *) data);
129 } 129 }
130 130
131 __put_user(child->thread.fpu.fcr31, data + 64); 131 __put_user(child->thread.fpu.fcr31, data + 64);
132 132 __put_user(current_cpu_data.fpu_id, data + 65);
133 preempt_disable();
134 if (cpu_has_fpu) {
135 unsigned int flags;
136
137 if (cpu_has_mipsmt) {
138 unsigned int vpflags = dvpe();
139 flags = read_c0_status();
140 __enable_fpu(FPU_AS_IS);
141 __asm__ __volatile__("cfc1\t%0,$0" : "=r" (tmp));
142 write_c0_status(flags);
143 evpe(vpflags);
144 } else {
145 flags = read_c0_status();
146 __enable_fpu(FPU_AS_IS);
147 __asm__ __volatile__("cfc1\t%0,$0" : "=r" (tmp));
148 write_c0_status(flags);
149 }
150 } else {
151 tmp = 0;
152 }
153 preempt_enable();
154 __put_user(tmp, data + 65);
155 133
156 return 0; 134 return 0;
157} 135}
158 136
159int ptrace_setfpregs(struct task_struct *child, __u32 __user *data) 137int ptrace_setfpregs(struct task_struct *child, __u32 __user *data)
160{ 138{
161 fpureg_t *fregs; 139 union fpureg *fregs;
140 u64 fpr_val;
162 int i; 141 int i;
163 142
164 if (!access_ok(VERIFY_READ, data, 33 * 8)) 143 if (!access_ok(VERIFY_READ, data, 33 * 8))
@@ -166,8 +145,10 @@ int ptrace_setfpregs(struct task_struct *child, __u32 __user *data)
166 145
167 fregs = get_fpu_regs(child); 146 fregs = get_fpu_regs(child);
168 147
169 for (i = 0; i < 32; i++) 148 for (i = 0; i < 32; i++) {
170 __get_user(fregs[i], i + (__u64 __user *) data); 149 __get_user(fpr_val, i + (__u64 __user *)data);
150 set_fpr64(&fregs[i], 0, fpr_val);
151 }
171 152
172 __get_user(child->thread.fpu.fcr31, data + 64); 153 __get_user(child->thread.fpu.fcr31, data + 64);
173 154
@@ -300,10 +281,27 @@ static int fpr_get(struct task_struct *target,
300 unsigned int pos, unsigned int count, 281 unsigned int pos, unsigned int count,
301 void *kbuf, void __user *ubuf) 282 void *kbuf, void __user *ubuf)
302{ 283{
303 return user_regset_copyout(&pos, &count, &kbuf, &ubuf, 284 unsigned i;
304 &target->thread.fpu, 285 int err;
305 0, sizeof(elf_fpregset_t)); 286 u64 fpr_val;
287
306 /* XXX fcr31 */ 288 /* XXX fcr31 */
289
290 if (sizeof(target->thread.fpu.fpr[i]) == sizeof(elf_fpreg_t))
291 return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
292 &target->thread.fpu,
293 0, sizeof(elf_fpregset_t));
294
295 for (i = 0; i < NUM_FPU_REGS; i++) {
296 fpr_val = get_fpr64(&target->thread.fpu.fpr[i], 0);
297 err = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
298 &fpr_val, i * sizeof(elf_fpreg_t),
299 (i + 1) * sizeof(elf_fpreg_t));
300 if (err)
301 return err;
302 }
303
304 return 0;
307} 305}
308 306
309static int fpr_set(struct task_struct *target, 307static int fpr_set(struct task_struct *target,
@@ -311,10 +309,27 @@ static int fpr_set(struct task_struct *target,
311 unsigned int pos, unsigned int count, 309 unsigned int pos, unsigned int count,
312 const void *kbuf, const void __user *ubuf) 310 const void *kbuf, const void __user *ubuf)
313{ 311{
314 return user_regset_copyin(&pos, &count, &kbuf, &ubuf, 312 unsigned i;
315 &target->thread.fpu, 313 int err;
316 0, sizeof(elf_fpregset_t)); 314 u64 fpr_val;
315
317 /* XXX fcr31 */ 316 /* XXX fcr31 */
317
318 if (sizeof(target->thread.fpu.fpr[i]) == sizeof(elf_fpreg_t))
319 return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
320 &target->thread.fpu,
321 0, sizeof(elf_fpregset_t));
322
323 for (i = 0; i < NUM_FPU_REGS; i++) {
324 err = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
325 &fpr_val, i * sizeof(elf_fpreg_t),
326 (i + 1) * sizeof(elf_fpreg_t));
327 if (err)
328 return err;
329 set_fpr64(&target->thread.fpu.fpr[i], 0, fpr_val);
330 }
331
332 return 0;
318} 333}
319 334
320enum mips_regset { 335enum mips_regset {
@@ -408,7 +423,7 @@ long arch_ptrace(struct task_struct *child, long request,
408 /* Read the word at location addr in the USER area. */ 423 /* Read the word at location addr in the USER area. */
409 case PTRACE_PEEKUSR: { 424 case PTRACE_PEEKUSR: {
410 struct pt_regs *regs; 425 struct pt_regs *regs;
411 fpureg_t *fregs; 426 union fpureg *fregs;
412 unsigned long tmp = 0; 427 unsigned long tmp = 0;
413 428
414 regs = task_pt_regs(child); 429 regs = task_pt_regs(child);
@@ -433,14 +448,12 @@ long arch_ptrace(struct task_struct *child, long request,
433 * order bits of the values stored in the even 448 * order bits of the values stored in the even
434 * registers - unless we're using r2k_switch.S. 449 * registers - unless we're using r2k_switch.S.
435 */ 450 */
436 if (addr & 1) 451 tmp = get_fpr32(&fregs[(addr & ~1) - FPR_BASE],
437 tmp = fregs[(addr & ~1) - 32] >> 32; 452 addr & 1);
438 else
439 tmp = fregs[addr - 32];
440 break; 453 break;
441 } 454 }
442#endif 455#endif
443 tmp = fregs[addr - FPR_BASE]; 456 tmp = get_fpr32(&fregs[addr - FPR_BASE], 0);
444 break; 457 break;
445 case PC: 458 case PC:
446 tmp = regs->cp0_epc; 459 tmp = regs->cp0_epc;
@@ -465,44 +478,10 @@ long arch_ptrace(struct task_struct *child, long request,
465 case FPC_CSR: 478 case FPC_CSR:
466 tmp = child->thread.fpu.fcr31; 479 tmp = child->thread.fpu.fcr31;
467 break; 480 break;
468 case FPC_EIR: { /* implementation / version register */ 481 case FPC_EIR:
469 unsigned int flags; 482 /* implementation / version register */
470#ifdef CONFIG_MIPS_MT_SMTC 483 tmp = current_cpu_data.fpu_id;
471 unsigned long irqflags;
472 unsigned int mtflags;
473#endif /* CONFIG_MIPS_MT_SMTC */
474
475 preempt_disable();
476 if (!cpu_has_fpu) {
477 preempt_enable();
478 break;
479 }
480
481#ifdef CONFIG_MIPS_MT_SMTC
482 /* Read-modify-write of Status must be atomic */
483 local_irq_save(irqflags);
484 mtflags = dmt();
485#endif /* CONFIG_MIPS_MT_SMTC */
486 if (cpu_has_mipsmt) {
487 unsigned int vpflags = dvpe();
488 flags = read_c0_status();
489 __enable_fpu(FPU_AS_IS);
490 __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp));
491 write_c0_status(flags);
492 evpe(vpflags);
493 } else {
494 flags = read_c0_status();
495 __enable_fpu(FPU_AS_IS);
496 __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp));
497 write_c0_status(flags);
498 }
499#ifdef CONFIG_MIPS_MT_SMTC
500 emt(mtflags);
501 local_irq_restore(irqflags);
502#endif /* CONFIG_MIPS_MT_SMTC */
503 preempt_enable();
504 break; 484 break;
505 }
506 case DSP_BASE ... DSP_BASE + 5: { 485 case DSP_BASE ... DSP_BASE + 5: {
507 dspreg_t *dregs; 486 dspreg_t *dregs;
508 487
@@ -548,7 +527,7 @@ long arch_ptrace(struct task_struct *child, long request,
548 regs->regs[addr] = data; 527 regs->regs[addr] = data;
549 break; 528 break;
550 case FPR_BASE ... FPR_BASE + 31: { 529 case FPR_BASE ... FPR_BASE + 31: {
551 fpureg_t *fregs = get_fpu_regs(child); 530 union fpureg *fregs = get_fpu_regs(child);
552 531
553 if (!tsk_used_math(child)) { 532 if (!tsk_used_math(child)) {
554 /* FP not yet used */ 533 /* FP not yet used */
@@ -563,19 +542,12 @@ long arch_ptrace(struct task_struct *child, long request,
563 * order bits of the values stored in the even 542 * order bits of the values stored in the even
564 * registers - unless we're using r2k_switch.S. 543 * registers - unless we're using r2k_switch.S.
565 */ 544 */
566 if (addr & 1) { 545 set_fpr32(&fregs[(addr & ~1) - FPR_BASE],
567 fregs[(addr & ~1) - FPR_BASE] &= 546 addr & 1, data);
568 0xffffffff;
569 fregs[(addr & ~1) - FPR_BASE] |=
570 ((u64)data) << 32;
571 } else {
572 fregs[addr - FPR_BASE] &= ~0xffffffffLL;
573 fregs[addr - FPR_BASE] |= data;
574 }
575 break; 547 break;
576 } 548 }
577#endif 549#endif
578 fregs[addr - FPR_BASE] = data; 550 set_fpr64(&fregs[addr - FPR_BASE], 0, data);
579 break; 551 break;
580 } 552 }
581 case PC: 553 case PC:
@@ -662,13 +634,13 @@ long arch_ptrace(struct task_struct *child, long request,
662 * Notification of system call entry/exit 634 * Notification of system call entry/exit
663 * - triggered by current->work.syscall_trace 635 * - triggered by current->work.syscall_trace
664 */ 636 */
665asmlinkage void syscall_trace_enter(struct pt_regs *regs) 637asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)
666{ 638{
667 long ret = 0; 639 long ret = 0;
668 user_exit(); 640 user_exit();
669 641
670 /* do the secure computing check first */ 642 if (secure_computing(syscall) == -1)
671 secure_computing_strict(regs->regs[2]); 643 return -1;
672 644
673 if (test_thread_flag(TIF_SYSCALL_TRACE) && 645 if (test_thread_flag(TIF_SYSCALL_TRACE) &&
674 tracehook_report_syscall_entry(regs)) 646 tracehook_report_syscall_entry(regs))
@@ -677,10 +649,11 @@ asmlinkage void syscall_trace_enter(struct pt_regs *regs)
677 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) 649 if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
678 trace_sys_enter(regs, regs->regs[2]); 650 trace_sys_enter(regs, regs->regs[2]);
679 651
680 audit_syscall_entry(__syscall_get_arch(), 652 audit_syscall_entry(syscall_get_arch(),
681 regs->regs[2], 653 syscall,
682 regs->regs[4], regs->regs[5], 654 regs->regs[4], regs->regs[5],
683 regs->regs[6], regs->regs[7]); 655 regs->regs[6], regs->regs[7]);
656 return syscall;
684} 657}
685 658
686/* 659/*
diff --git a/arch/mips/kernel/ptrace32.c b/arch/mips/kernel/ptrace32.c
index b8aa2dd5b00b..b40c3ca60ee5 100644
--- a/arch/mips/kernel/ptrace32.c
+++ b/arch/mips/kernel/ptrace32.c
@@ -80,7 +80,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
80 /* Read the word at location addr in the USER area. */ 80 /* Read the word at location addr in the USER area. */
81 case PTRACE_PEEKUSR: { 81 case PTRACE_PEEKUSR: {
82 struct pt_regs *regs; 82 struct pt_regs *regs;
83 fpureg_t *fregs; 83 union fpureg *fregs;
84 unsigned int tmp; 84 unsigned int tmp;
85 85
86 regs = task_pt_regs(child); 86 regs = task_pt_regs(child);
@@ -103,13 +103,11 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
103 * order bits of the values stored in the even 103 * order bits of the values stored in the even
104 * registers - unless we're using r2k_switch.S. 104 * registers - unless we're using r2k_switch.S.
105 */ 105 */
106 if (addr & 1) 106 tmp = get_fpr32(&fregs[(addr & ~1) - FPR_BASE],
107 tmp = fregs[(addr & ~1) - 32] >> 32; 107 addr & 1);
108 else
109 tmp = fregs[addr - 32];
110 break; 108 break;
111 } 109 }
112 tmp = fregs[addr - FPR_BASE]; 110 tmp = get_fpr32(&fregs[addr - FPR_BASE], 0);
113 break; 111 break;
114 case PC: 112 case PC:
115 tmp = regs->cp0_epc; 113 tmp = regs->cp0_epc;
@@ -129,46 +127,10 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
129 case FPC_CSR: 127 case FPC_CSR:
130 tmp = child->thread.fpu.fcr31; 128 tmp = child->thread.fpu.fcr31;
131 break; 129 break;
132 case FPC_EIR: { /* implementation / version register */ 130 case FPC_EIR:
133 unsigned int flags; 131 /* implementation / version register */
134#ifdef CONFIG_MIPS_MT_SMTC 132 tmp = current_cpu_data.fpu_id;
135 unsigned int irqflags;
136 unsigned int mtflags;
137#endif /* CONFIG_MIPS_MT_SMTC */
138
139 preempt_disable();
140 if (!cpu_has_fpu) {
141 preempt_enable();
142 tmp = 0;
143 break;
144 }
145
146#ifdef CONFIG_MIPS_MT_SMTC
147 /* Read-modify-write of Status must be atomic */
148 local_irq_save(irqflags);
149 mtflags = dmt();
150#endif /* CONFIG_MIPS_MT_SMTC */
151
152 if (cpu_has_mipsmt) {
153 unsigned int vpflags = dvpe();
154 flags = read_c0_status();
155 __enable_fpu(FPU_AS_IS);
156 __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp));
157 write_c0_status(flags);
158 evpe(vpflags);
159 } else {
160 flags = read_c0_status();
161 __enable_fpu(FPU_AS_IS);
162 __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp));
163 write_c0_status(flags);
164 }
165#ifdef CONFIG_MIPS_MT_SMTC
166 emt(mtflags);
167 local_irq_restore(irqflags);
168#endif /* CONFIG_MIPS_MT_SMTC */
169 preempt_enable();
170 break; 133 break;
171 }
172 case DSP_BASE ... DSP_BASE + 5: { 134 case DSP_BASE ... DSP_BASE + 5: {
173 dspreg_t *dregs; 135 dspreg_t *dregs;
174 136
@@ -233,7 +195,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
233 regs->regs[addr] = data; 195 regs->regs[addr] = data;
234 break; 196 break;
235 case FPR_BASE ... FPR_BASE + 31: { 197 case FPR_BASE ... FPR_BASE + 31: {
236 fpureg_t *fregs = get_fpu_regs(child); 198 union fpureg *fregs = get_fpu_regs(child);
237 199
238 if (!tsk_used_math(child)) { 200 if (!tsk_used_math(child)) {
239 /* FP not yet used */ 201 /* FP not yet used */
@@ -247,18 +209,11 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
247 * order bits of the values stored in the even 209 * order bits of the values stored in the even
248 * registers - unless we're using r2k_switch.S. 210 * registers - unless we're using r2k_switch.S.
249 */ 211 */
250 if (addr & 1) { 212 set_fpr32(&fregs[(addr & ~1) - FPR_BASE],
251 fregs[(addr & ~1) - FPR_BASE] &= 213 addr & 1, data);
252 0xffffffff;
253 fregs[(addr & ~1) - FPR_BASE] |=
254 ((u64)data) << 32;
255 } else {
256 fregs[addr - FPR_BASE] &= ~0xffffffffLL;
257 fregs[addr - FPR_BASE] |= data;
258 }
259 break; 214 break;
260 } 215 }
261 fregs[addr - FPR_BASE] = data; 216 set_fpr64(&fregs[addr - FPR_BASE], 0, data);
262 break; 217 break;
263 } 218 }
264 case PC: 219 case PC:
diff --git a/arch/mips/kernel/r4k_fpu.S b/arch/mips/kernel/r4k_fpu.S
index 73b0ddf910d4..71814272d148 100644
--- a/arch/mips/kernel/r4k_fpu.S
+++ b/arch/mips/kernel/r4k_fpu.S
@@ -13,6 +13,7 @@
13 * Copyright (C) 1999, 2001 Silicon Graphics, Inc. 13 * Copyright (C) 1999, 2001 Silicon Graphics, Inc.
14 */ 14 */
15#include <asm/asm.h> 15#include <asm/asm.h>
16#include <asm/asmmacro.h>
16#include <asm/errno.h> 17#include <asm/errno.h>
17#include <asm/fpregdef.h> 18#include <asm/fpregdef.h>
18#include <asm/mipsregs.h> 19#include <asm/mipsregs.h>
@@ -30,7 +31,7 @@
30 .endm 31 .endm
31 32
32 .set noreorder 33 .set noreorder
33 .set mips3 34 .set arch=r4000
34 35
35LEAF(_save_fp_context) 36LEAF(_save_fp_context)
36 cfc1 t1, fcr31 37 cfc1 t1, fcr31
@@ -245,6 +246,218 @@ LEAF(_restore_fp_context32)
245 END(_restore_fp_context32) 246 END(_restore_fp_context32)
246#endif 247#endif
247 248
249#ifdef CONFIG_CPU_HAS_MSA
250
251 .macro save_sc_msareg wr, off, sc, tmp
252#ifdef CONFIG_64BIT
253 copy_u_d \tmp, \wr, 1
254 EX sd \tmp, (\off+(\wr*8))(\sc)
255#elif defined(CONFIG_CPU_LITTLE_ENDIAN)
256 copy_u_w \tmp, \wr, 2
257 EX sw \tmp, (\off+(\wr*8)+0)(\sc)
258 copy_u_w \tmp, \wr, 3
259 EX sw \tmp, (\off+(\wr*8)+4)(\sc)
260#else /* CONFIG_CPU_BIG_ENDIAN */
261 copy_u_w \tmp, \wr, 2
262 EX sw \tmp, (\off+(\wr*8)+4)(\sc)
263 copy_u_w \tmp, \wr, 3
264 EX sw \tmp, (\off+(\wr*8)+0)(\sc)
265#endif
266 .endm
267
268/*
269 * int _save_msa_context(struct sigcontext *sc)
270 *
271 * Save the upper 64 bits of each vector register along with the MSA_CSR
272 * register into sc. Returns zero on success, else non-zero.
273 */
274LEAF(_save_msa_context)
275 save_sc_msareg 0, SC_MSAREGS, a0, t0
276 save_sc_msareg 1, SC_MSAREGS, a0, t0
277 save_sc_msareg 2, SC_MSAREGS, a0, t0
278 save_sc_msareg 3, SC_MSAREGS, a0, t0
279 save_sc_msareg 4, SC_MSAREGS, a0, t0
280 save_sc_msareg 5, SC_MSAREGS, a0, t0
281 save_sc_msareg 6, SC_MSAREGS, a0, t0
282 save_sc_msareg 7, SC_MSAREGS, a0, t0
283 save_sc_msareg 8, SC_MSAREGS, a0, t0
284 save_sc_msareg 9, SC_MSAREGS, a0, t0
285 save_sc_msareg 10, SC_MSAREGS, a0, t0
286 save_sc_msareg 11, SC_MSAREGS, a0, t0
287 save_sc_msareg 12, SC_MSAREGS, a0, t0
288 save_sc_msareg 13, SC_MSAREGS, a0, t0
289 save_sc_msareg 14, SC_MSAREGS, a0, t0
290 save_sc_msareg 15, SC_MSAREGS, a0, t0
291 save_sc_msareg 16, SC_MSAREGS, a0, t0
292 save_sc_msareg 17, SC_MSAREGS, a0, t0
293 save_sc_msareg 18, SC_MSAREGS, a0, t0
294 save_sc_msareg 19, SC_MSAREGS, a0, t0
295 save_sc_msareg 20, SC_MSAREGS, a0, t0
296 save_sc_msareg 21, SC_MSAREGS, a0, t0
297 save_sc_msareg 22, SC_MSAREGS, a0, t0
298 save_sc_msareg 23, SC_MSAREGS, a0, t0
299 save_sc_msareg 24, SC_MSAREGS, a0, t0
300 save_sc_msareg 25, SC_MSAREGS, a0, t0
301 save_sc_msareg 26, SC_MSAREGS, a0, t0
302 save_sc_msareg 27, SC_MSAREGS, a0, t0
303 save_sc_msareg 28, SC_MSAREGS, a0, t0
304 save_sc_msareg 29, SC_MSAREGS, a0, t0
305 save_sc_msareg 30, SC_MSAREGS, a0, t0
306 save_sc_msareg 31, SC_MSAREGS, a0, t0
307 jr ra
308 li v0, 0
309 END(_save_msa_context)
310
311#ifdef CONFIG_MIPS32_COMPAT
312
313/*
314 * int _save_msa_context32(struct sigcontext32 *sc)
315 *
316 * Save the upper 64 bits of each vector register along with the MSA_CSR
317 * register into sc. Returns zero on success, else non-zero.
318 */
319LEAF(_save_msa_context32)
320 save_sc_msareg 0, SC32_MSAREGS, a0, t0
321 save_sc_msareg 1, SC32_MSAREGS, a0, t0
322 save_sc_msareg 2, SC32_MSAREGS, a0, t0
323 save_sc_msareg 3, SC32_MSAREGS, a0, t0
324 save_sc_msareg 4, SC32_MSAREGS, a0, t0
325 save_sc_msareg 5, SC32_MSAREGS, a0, t0
326 save_sc_msareg 6, SC32_MSAREGS, a0, t0
327 save_sc_msareg 7, SC32_MSAREGS, a0, t0
328 save_sc_msareg 8, SC32_MSAREGS, a0, t0
329 save_sc_msareg 9, SC32_MSAREGS, a0, t0
330 save_sc_msareg 10, SC32_MSAREGS, a0, t0
331 save_sc_msareg 11, SC32_MSAREGS, a0, t0
332 save_sc_msareg 12, SC32_MSAREGS, a0, t0
333 save_sc_msareg 13, SC32_MSAREGS, a0, t0
334 save_sc_msareg 14, SC32_MSAREGS, a0, t0
335 save_sc_msareg 15, SC32_MSAREGS, a0, t0
336 save_sc_msareg 16, SC32_MSAREGS, a0, t0
337 save_sc_msareg 17, SC32_MSAREGS, a0, t0
338 save_sc_msareg 18, SC32_MSAREGS, a0, t0
339 save_sc_msareg 19, SC32_MSAREGS, a0, t0
340 save_sc_msareg 20, SC32_MSAREGS, a0, t0
341 save_sc_msareg 21, SC32_MSAREGS, a0, t0
342 save_sc_msareg 22, SC32_MSAREGS, a0, t0
343 save_sc_msareg 23, SC32_MSAREGS, a0, t0
344 save_sc_msareg 24, SC32_MSAREGS, a0, t0
345 save_sc_msareg 25, SC32_MSAREGS, a0, t0
346 save_sc_msareg 26, SC32_MSAREGS, a0, t0
347 save_sc_msareg 27, SC32_MSAREGS, a0, t0
348 save_sc_msareg 28, SC32_MSAREGS, a0, t0
349 save_sc_msareg 29, SC32_MSAREGS, a0, t0
350 save_sc_msareg 30, SC32_MSAREGS, a0, t0
351 save_sc_msareg 31, SC32_MSAREGS, a0, t0
352 jr ra
353 li v0, 0
354 END(_save_msa_context32)
355
356#endif /* CONFIG_MIPS32_COMPAT */
357
358 .macro restore_sc_msareg wr, off, sc, tmp
359#ifdef CONFIG_64BIT
360 EX ld \tmp, (\off+(\wr*8))(\sc)
361 insert_d \wr, 1, \tmp
362#elif defined(CONFIG_CPU_LITTLE_ENDIAN)
363 EX lw \tmp, (\off+(\wr*8)+0)(\sc)
364 insert_w \wr, 2, \tmp
365 EX lw \tmp, (\off+(\wr*8)+4)(\sc)
366 insert_w \wr, 3, \tmp
367#else /* CONFIG_CPU_BIG_ENDIAN */
368 EX lw \tmp, (\off+(\wr*8)+4)(\sc)
369 insert_w \wr, 2, \tmp
370 EX lw \tmp, (\off+(\wr*8)+0)(\sc)
371 insert_w \wr, 3, \tmp
372#endif
373 .endm
374
375/*
376 * int _restore_msa_context(struct sigcontext *sc)
377 */
378LEAF(_restore_msa_context)
379 restore_sc_msareg 0, SC_MSAREGS, a0, t0
380 restore_sc_msareg 1, SC_MSAREGS, a0, t0
381 restore_sc_msareg 2, SC_MSAREGS, a0, t0
382 restore_sc_msareg 3, SC_MSAREGS, a0, t0
383 restore_sc_msareg 4, SC_MSAREGS, a0, t0
384 restore_sc_msareg 5, SC_MSAREGS, a0, t0
385 restore_sc_msareg 6, SC_MSAREGS, a0, t0
386 restore_sc_msareg 7, SC_MSAREGS, a0, t0
387 restore_sc_msareg 8, SC_MSAREGS, a0, t0
388 restore_sc_msareg 9, SC_MSAREGS, a0, t0
389 restore_sc_msareg 10, SC_MSAREGS, a0, t0
390 restore_sc_msareg 11, SC_MSAREGS, a0, t0
391 restore_sc_msareg 12, SC_MSAREGS, a0, t0
392 restore_sc_msareg 13, SC_MSAREGS, a0, t0
393 restore_sc_msareg 14, SC_MSAREGS, a0, t0
394 restore_sc_msareg 15, SC_MSAREGS, a0, t0
395 restore_sc_msareg 16, SC_MSAREGS, a0, t0
396 restore_sc_msareg 17, SC_MSAREGS, a0, t0
397 restore_sc_msareg 18, SC_MSAREGS, a0, t0
398 restore_sc_msareg 19, SC_MSAREGS, a0, t0
399 restore_sc_msareg 20, SC_MSAREGS, a0, t0
400 restore_sc_msareg 21, SC_MSAREGS, a0, t0
401 restore_sc_msareg 22, SC_MSAREGS, a0, t0
402 restore_sc_msareg 23, SC_MSAREGS, a0, t0
403 restore_sc_msareg 24, SC_MSAREGS, a0, t0
404 restore_sc_msareg 25, SC_MSAREGS, a0, t0
405 restore_sc_msareg 26, SC_MSAREGS, a0, t0
406 restore_sc_msareg 27, SC_MSAREGS, a0, t0
407 restore_sc_msareg 28, SC_MSAREGS, a0, t0
408 restore_sc_msareg 29, SC_MSAREGS, a0, t0
409 restore_sc_msareg 30, SC_MSAREGS, a0, t0
410 restore_sc_msareg 31, SC_MSAREGS, a0, t0
411 jr ra
412 li v0, 0
413 END(_restore_msa_context)
414
415#ifdef CONFIG_MIPS32_COMPAT
416
417/*
418 * int _restore_msa_context32(struct sigcontext32 *sc)
419 */
420LEAF(_restore_msa_context32)
421 restore_sc_msareg 0, SC32_MSAREGS, a0, t0
422 restore_sc_msareg 1, SC32_MSAREGS, a0, t0
423 restore_sc_msareg 2, SC32_MSAREGS, a0, t0
424 restore_sc_msareg 3, SC32_MSAREGS, a0, t0
425 restore_sc_msareg 4, SC32_MSAREGS, a0, t0
426 restore_sc_msareg 5, SC32_MSAREGS, a0, t0
427 restore_sc_msareg 6, SC32_MSAREGS, a0, t0
428 restore_sc_msareg 7, SC32_MSAREGS, a0, t0
429 restore_sc_msareg 8, SC32_MSAREGS, a0, t0
430 restore_sc_msareg 9, SC32_MSAREGS, a0, t0
431 restore_sc_msareg 10, SC32_MSAREGS, a0, t0
432 restore_sc_msareg 11, SC32_MSAREGS, a0, t0
433 restore_sc_msareg 12, SC32_MSAREGS, a0, t0
434 restore_sc_msareg 13, SC32_MSAREGS, a0, t0
435 restore_sc_msareg 14, SC32_MSAREGS, a0, t0
436 restore_sc_msareg 15, SC32_MSAREGS, a0, t0
437 restore_sc_msareg 16, SC32_MSAREGS, a0, t0
438 restore_sc_msareg 17, SC32_MSAREGS, a0, t0
439 restore_sc_msareg 18, SC32_MSAREGS, a0, t0
440 restore_sc_msareg 19, SC32_MSAREGS, a0, t0
441 restore_sc_msareg 20, SC32_MSAREGS, a0, t0
442 restore_sc_msareg 21, SC32_MSAREGS, a0, t0
443 restore_sc_msareg 22, SC32_MSAREGS, a0, t0
444 restore_sc_msareg 23, SC32_MSAREGS, a0, t0
445 restore_sc_msareg 24, SC32_MSAREGS, a0, t0
446 restore_sc_msareg 25, SC32_MSAREGS, a0, t0
447 restore_sc_msareg 26, SC32_MSAREGS, a0, t0
448 restore_sc_msareg 27, SC32_MSAREGS, a0, t0
449 restore_sc_msareg 28, SC32_MSAREGS, a0, t0
450 restore_sc_msareg 29, SC32_MSAREGS, a0, t0
451 restore_sc_msareg 30, SC32_MSAREGS, a0, t0
452 restore_sc_msareg 31, SC32_MSAREGS, a0, t0
453 jr ra
454 li v0, 0
455 END(_restore_msa_context32)
456
457#endif /* CONFIG_MIPS32_COMPAT */
458
459#endif /* CONFIG_CPU_HAS_MSA */
460
248 .set reorder 461 .set reorder
249 462
250 .type fault@function 463 .type fault@function
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S
index cc78dd9a17c7..abacac7c33ef 100644
--- a/arch/mips/kernel/r4k_switch.S
+++ b/arch/mips/kernel/r4k_switch.S
@@ -29,18 +29,8 @@
29#define ST_OFF (_THREAD_SIZE - 32 - PT_SIZE + PT_STATUS) 29#define ST_OFF (_THREAD_SIZE - 32 - PT_SIZE + PT_STATUS)
30 30
31/* 31/*
32 * FPU context is saved iff the process has used it's FPU in the current
33 * time slice as indicated by _TIF_USEDFPU. In any case, the CU1 bit for user
34 * space STATUS register should be 0, so that a process *always* starts its
35 * userland with FPU disabled after each context switch.
36 *
37 * FPU will be enabled as soon as the process accesses FPU again, through
38 * do_cpu() trap.
39 */
40
41/*
42 * task_struct *resume(task_struct *prev, task_struct *next, 32 * task_struct *resume(task_struct *prev, task_struct *next,
43 * struct thread_info *next_ti, int usedfpu) 33 * struct thread_info *next_ti, s32 fp_save)
44 */ 34 */
45 .align 5 35 .align 5
46 LEAF(resume) 36 LEAF(resume)
@@ -50,23 +40,37 @@
50 LONG_S ra, THREAD_REG31(a0) 40 LONG_S ra, THREAD_REG31(a0)
51 41
52 /* 42 /*
53 * check if we need to save FPU registers 43 * Check whether we need to save any FP context. FP context is saved
44 * iff the process has used the context with the scalar FPU or the MSA
45 * ASE in the current time slice, as indicated by _TIF_USEDFPU and
46 * _TIF_USEDMSA respectively. switch_to will have set fp_save
47 * accordingly to an FP_SAVE_ enum value.
54 */ 48 */
49 beqz a3, 2f
55 50
56 beqz a3, 1f
57
58 PTR_L t3, TASK_THREAD_INFO(a0)
59 /* 51 /*
60 * clear saved user stack CU1 bit 52 * We do. Clear the saved CU1 bit for prev, such that next time it is
53 * scheduled it will start in userland with the FPU disabled. If the
54 * task uses the FPU then it will be enabled again via the do_cpu trap.
55 * This allows us to lazily restore the FP context.
61 */ 56 */
57 PTR_L t3, TASK_THREAD_INFO(a0)
62 LONG_L t0, ST_OFF(t3) 58 LONG_L t0, ST_OFF(t3)
63 li t1, ~ST0_CU1 59 li t1, ~ST0_CU1
64 and t0, t0, t1 60 and t0, t0, t1
65 LONG_S t0, ST_OFF(t3) 61 LONG_S t0, ST_OFF(t3)
66 62
63 /* Check whether we're saving scalar or vector context. */
64 bgtz a3, 1f
65
66 /* Save 128b MSA vector context. */
67 msa_save_all a0
68 b 2f
69
701: /* Save 32b/64b scalar FP context. */
67 fpu_save_double a0 t0 t1 # c0_status passed in t0 71 fpu_save_double a0 t0 t1 # c0_status passed in t0
68 # clobbers t1 72 # clobbers t1
691: 732:
70 74
71#if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP) 75#if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP)
72 PTR_LA t8, __stack_chk_guard 76 PTR_LA t8, __stack_chk_guard
@@ -141,6 +145,26 @@ LEAF(_restore_fp)
141 jr ra 145 jr ra
142 END(_restore_fp) 146 END(_restore_fp)
143 147
148#ifdef CONFIG_CPU_HAS_MSA
149
150/*
151 * Save a thread's MSA vector context.
152 */
153LEAF(_save_msa)
154 msa_save_all a0
155 jr ra
156 END(_save_msa)
157
158/*
159 * Restore a thread's MSA vector context.
160 */
161LEAF(_restore_msa)
162 msa_restore_all a0
163 jr ra
164 END(_restore_msa)
165
166#endif
167
144/* 168/*
145 * Load the FPU with signalling NANS. This bit pattern we're using has 169 * Load the FPU with signalling NANS. This bit pattern we're using has
146 * the property that no matter whether considered as single or as double 170 * the property that no matter whether considered as single or as double
@@ -270,7 +294,7 @@ LEAF(_init_fpu)
2701: .set pop 2941: .set pop
271#endif /* CONFIG_CPU_MIPS32_R2 */ 295#endif /* CONFIG_CPU_MIPS32_R2 */
272#else 296#else
273 .set mips3 297 .set arch=r4000
274 dmtc1 t1, $f0 298 dmtc1 t1, $f0
275 dmtc1 t1, $f2 299 dmtc1 t1, $f2
276 dmtc1 t1, $f4 300 dmtc1 t1, $f4
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index a5b14f48e1af..fdc70b400442 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -6,6 +6,7 @@
6 * Copyright (C) 1995-99, 2000- 02, 06 Ralf Baechle <ralf@linux-mips.org> 6 * Copyright (C) 1995-99, 2000- 02, 06 Ralf Baechle <ralf@linux-mips.org>
7 * Copyright (C) 2001 MIPS Technologies, Inc. 7 * Copyright (C) 2001 MIPS Technologies, Inc.
8 * Copyright (C) 2004 Thiemo Seufer 8 * Copyright (C) 2004 Thiemo Seufer
9 * Copyright (C) 2014 Imagination Technologies Ltd.
9 */ 10 */
10#include <linux/errno.h> 11#include <linux/errno.h>
11#include <asm/asm.h> 12#include <asm/asm.h>
@@ -74,10 +75,10 @@ NESTED(handle_sys, PT_SIZE, sp)
74 .set noreorder 75 .set noreorder
75 .set nomacro 76 .set nomacro
76 77
771: lw t5, 16(t0) # argument #5 from usp 781: user_lw(t5, 16(t0)) # argument #5 from usp
784: lw t6, 20(t0) # argument #6 from usp 794: user_lw(t6, 20(t0)) # argument #6 from usp
793: lw t7, 24(t0) # argument #7 from usp 803: user_lw(t7, 24(t0)) # argument #7 from usp
802: lw t8, 28(t0) # argument #8 from usp 812: user_lw(t8, 28(t0)) # argument #8 from usp
81 82
82 sw t5, 16(sp) # argument #5 to ksp 83 sw t5, 16(sp) # argument #5 to ksp
83 sw t6, 20(sp) # argument #6 to ksp 84 sw t6, 20(sp) # argument #6 to ksp
@@ -118,7 +119,18 @@ syscall_trace_entry:
118 SAVE_STATIC 119 SAVE_STATIC
119 move s0, t2 120 move s0, t2
120 move a0, sp 121 move a0, sp
121 jal syscall_trace_enter 122
123 /*
124 * syscall number is in v0 unless we called syscall(__NR_###)
125 * where the real syscall number is in a0
126 */
127 addiu a1, v0, __NR_O32_Linux
128 bnez v0, 1f /* __NR_syscall at offset 0 */
129 lw a1, PT_R4(sp)
130
1311: jal syscall_trace_enter
132
133 bltz v0, 2f # seccomp failed? Skip syscall
122 134
123 move t0, s0 135 move t0, s0
124 RESTORE_STATIC 136 RESTORE_STATIC
@@ -138,7 +150,7 @@ syscall_trace_entry:
138 sw t1, PT_R0(sp) # save it for syscall restarting 150 sw t1, PT_R0(sp) # save it for syscall restarting
1391: sw v0, PT_R2(sp) # result 1511: sw v0, PT_R2(sp) # result
140 152
141 j syscall_exit 1532: j syscall_exit
142 154
143/* ------------------------------------------------------------------------ */ 155/* ------------------------------------------------------------------------ */
144 156
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
index b56e254beb15..dd99c3285aea 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -80,8 +80,11 @@ syscall_trace_entry:
80 SAVE_STATIC 80 SAVE_STATIC
81 move s0, t2 81 move s0, t2
82 move a0, sp 82 move a0, sp
83 daddiu a1, v0, __NR_64_Linux
83 jal syscall_trace_enter 84 jal syscall_trace_enter
84 85
86 bltz v0, 2f # seccomp failed? Skip syscall
87
85 move t0, s0 88 move t0, s0
86 RESTORE_STATIC 89 RESTORE_STATIC
87 ld a0, PT_R4(sp) # Restore argument registers 90 ld a0, PT_R4(sp) # Restore argument registers
@@ -102,7 +105,7 @@ syscall_trace_entry:
102 sd t1, PT_R0(sp) # save it for syscall restarting 105 sd t1, PT_R0(sp) # save it for syscall restarting
1031: sd v0, PT_R2(sp) # result 1061: sd v0, PT_R2(sp) # result
104 107
105 j syscall_exit 1082: j syscall_exit
106 109
107illegal_syscall: 110illegal_syscall:
108 /* This also isn't a 64-bit syscall, throw an error. */ 111 /* This also isn't a 64-bit syscall, throw an error. */
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index f7e5b72cf481..f68d2f4f0090 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -72,8 +72,11 @@ n32_syscall_trace_entry:
72 SAVE_STATIC 72 SAVE_STATIC
73 move s0, t2 73 move s0, t2
74 move a0, sp 74 move a0, sp
75 daddiu a1, v0, __NR_N32_Linux
75 jal syscall_trace_enter 76 jal syscall_trace_enter
76 77
78 bltz v0, 2f # seccomp failed? Skip syscall
79
77 move t0, s0 80 move t0, s0
78 RESTORE_STATIC 81 RESTORE_STATIC
79 ld a0, PT_R4(sp) # Restore argument registers 82 ld a0, PT_R4(sp) # Restore argument registers
@@ -94,7 +97,7 @@ n32_syscall_trace_entry:
94 sd t1, PT_R0(sp) # save it for syscall restarting 97 sd t1, PT_R0(sp) # save it for syscall restarting
951: sd v0, PT_R2(sp) # result 981: sd v0, PT_R2(sp) # result
96 99
97 j syscall_exit 1002: j syscall_exit
98 101
99not_n32_scall: 102not_n32_scall:
100 /* This is not an n32 compatibility syscall, pass it on to 103 /* This is not an n32 compatibility syscall, pass it on to
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 6788727d91af..70f6acecd928 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -112,7 +112,20 @@ trace_a_syscall:
112 112
113 move s0, t2 # Save syscall pointer 113 move s0, t2 # Save syscall pointer
114 move a0, sp 114 move a0, sp
115 jal syscall_trace_enter 115 /*
116 * syscall number is in v0 unless we called syscall(__NR_###)
117 * where the real syscall number is in a0
118 * note: NR_syscall is the first O32 syscall but the macro is
119 * only defined when compiling with -mabi=32 (CONFIG_32BIT)
120 * therefore __NR_O32_Linux is used (4000)
121 */
122 addiu a1, v0, __NR_O32_Linux
123 bnez v0, 1f /* __NR_syscall at offset 0 */
124 lw a1, PT_R4(sp)
125
1261: jal syscall_trace_enter
127
128 bltz v0, 2f # seccomp failed? Skip syscall
116 129
117 move t0, s0 130 move t0, s0
118 RESTORE_STATIC 131 RESTORE_STATIC
@@ -136,7 +149,7 @@ trace_a_syscall:
136 sd t1, PT_R0(sp) # save it for syscall restarting 149 sd t1, PT_R0(sp) # save it for syscall restarting
1371: sd v0, PT_R2(sp) # result 1501: sd v0, PT_R2(sp) # result
138 151
139 j syscall_exit 1522: j syscall_exit
140 153
141/* ------------------------------------------------------------------------ */ 154/* ------------------------------------------------------------------------ */
142 155
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c
index 5199563c4403..33133d3df3e5 100644
--- a/arch/mips/kernel/signal.c
+++ b/arch/mips/kernel/signal.c
@@ -6,6 +6,7 @@
6 * Copyright (C) 1991, 1992 Linus Torvalds 6 * Copyright (C) 1991, 1992 Linus Torvalds
7 * Copyright (C) 1994 - 2000 Ralf Baechle 7 * Copyright (C) 1994 - 2000 Ralf Baechle
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc. 8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 * Copyright (C) 2014, Imagination Technologies Ltd.
9 */ 10 */
10#include <linux/cache.h> 11#include <linux/cache.h>
11#include <linux/context_tracking.h> 12#include <linux/context_tracking.h>
@@ -30,6 +31,7 @@
30#include <linux/bitops.h> 31#include <linux/bitops.h>
31#include <asm/cacheflush.h> 32#include <asm/cacheflush.h>
32#include <asm/fpu.h> 33#include <asm/fpu.h>
34#include <asm/msa.h>
33#include <asm/sim.h> 35#include <asm/sim.h>
34#include <asm/ucontext.h> 36#include <asm/ucontext.h>
35#include <asm/cpu-features.h> 37#include <asm/cpu-features.h>
@@ -46,8 +48,8 @@ static int (*restore_fp_context)(struct sigcontext __user *sc);
46extern asmlinkage int _save_fp_context(struct sigcontext __user *sc); 48extern asmlinkage int _save_fp_context(struct sigcontext __user *sc);
47extern asmlinkage int _restore_fp_context(struct sigcontext __user *sc); 49extern asmlinkage int _restore_fp_context(struct sigcontext __user *sc);
48 50
49extern asmlinkage int fpu_emulator_save_context(struct sigcontext __user *sc); 51extern asmlinkage int _save_msa_context(struct sigcontext __user *sc);
50extern asmlinkage int fpu_emulator_restore_context(struct sigcontext __user *sc); 52extern asmlinkage int _restore_msa_context(struct sigcontext __user *sc);
51 53
52struct sigframe { 54struct sigframe {
53 u32 sf_ass[4]; /* argument save space for o32 */ 55 u32 sf_ass[4]; /* argument save space for o32 */
@@ -64,17 +66,95 @@ struct rt_sigframe {
64}; 66};
65 67
66/* 68/*
69 * Thread saved context copy to/from a signal context presumed to be on the
70 * user stack, and therefore accessed with appropriate macros from uaccess.h.
71 */
72static int copy_fp_to_sigcontext(struct sigcontext __user *sc)
73{
74 int i;
75 int err = 0;
76
77 for (i = 0; i < NUM_FPU_REGS; i++) {
78 err |=
79 __put_user(get_fpr64(&current->thread.fpu.fpr[i], 0),
80 &sc->sc_fpregs[i]);
81 }
82 err |= __put_user(current->thread.fpu.fcr31, &sc->sc_fpc_csr);
83
84 return err;
85}
86
87static int copy_fp_from_sigcontext(struct sigcontext __user *sc)
88{
89 int i;
90 int err = 0;
91 u64 fpr_val;
92
93 for (i = 0; i < NUM_FPU_REGS; i++) {
94 err |= __get_user(fpr_val, &sc->sc_fpregs[i]);
95 set_fpr64(&current->thread.fpu.fpr[i], 0, fpr_val);
96 }
97 err |= __get_user(current->thread.fpu.fcr31, &sc->sc_fpc_csr);
98
99 return err;
100}
101
102/*
103 * These functions will save only the upper 64 bits of the vector registers,
104 * since the lower 64 bits have already been saved as the scalar FP context.
105 */
106static int copy_msa_to_sigcontext(struct sigcontext __user *sc)
107{
108 int i;
109 int err = 0;
110
111 for (i = 0; i < NUM_FPU_REGS; i++) {
112 err |=
113 __put_user(get_fpr64(&current->thread.fpu.fpr[i], 1),
114 &sc->sc_msaregs[i]);
115 }
116 err |= __put_user(current->thread.fpu.msacsr, &sc->sc_msa_csr);
117
118 return err;
119}
120
121static int copy_msa_from_sigcontext(struct sigcontext __user *sc)
122{
123 int i;
124 int err = 0;
125 u64 val;
126
127 for (i = 0; i < NUM_FPU_REGS; i++) {
128 err |= __get_user(val, &sc->sc_msaregs[i]);
129 set_fpr64(&current->thread.fpu.fpr[i], 1, val);
130 }
131 err |= __get_user(current->thread.fpu.msacsr, &sc->sc_msa_csr);
132
133 return err;
134}
135
136/*
67 * Helper routines 137 * Helper routines
68 */ 138 */
69static int protected_save_fp_context(struct sigcontext __user *sc) 139static int protected_save_fp_context(struct sigcontext __user *sc,
140 unsigned used_math)
70{ 141{
71 int err; 142 int err;
143 bool save_msa = cpu_has_msa && (used_math & USEDMATH_MSA);
144#ifndef CONFIG_EVA
72 while (1) { 145 while (1) {
73 lock_fpu_owner(); 146 lock_fpu_owner();
74 err = own_fpu_inatomic(1); 147 if (is_fpu_owner()) {
75 if (!err) 148 err = save_fp_context(sc);
76 err = save_fp_context(sc); /* this might fail */ 149 if (save_msa && !err)
77 unlock_fpu_owner(); 150 err = _save_msa_context(sc);
151 unlock_fpu_owner();
152 } else {
153 unlock_fpu_owner();
154 err = copy_fp_to_sigcontext(sc);
155 if (save_msa && !err)
156 err = copy_msa_to_sigcontext(sc);
157 }
78 if (likely(!err)) 158 if (likely(!err))
79 break; 159 break;
80 /* touch the sigcontext and try again */ 160 /* touch the sigcontext and try again */
@@ -84,18 +164,44 @@ static int protected_save_fp_context(struct sigcontext __user *sc)
84 if (err) 164 if (err)
85 break; /* really bad sigcontext */ 165 break; /* really bad sigcontext */
86 } 166 }
167#else
168 /*
169 * EVA does not have FPU EVA instructions so saving fpu context directly
170 * does not work.
171 */
172 disable_msa();
173 lose_fpu(1);
174 err = save_fp_context(sc); /* this might fail */
175 if (save_msa && !err)
176 err = copy_msa_to_sigcontext(sc);
177#endif
87 return err; 178 return err;
88} 179}
89 180
90static int protected_restore_fp_context(struct sigcontext __user *sc) 181static int protected_restore_fp_context(struct sigcontext __user *sc,
182 unsigned used_math)
91{ 183{
92 int err, tmp __maybe_unused; 184 int err, tmp __maybe_unused;
185 bool restore_msa = cpu_has_msa && (used_math & USEDMATH_MSA);
186#ifndef CONFIG_EVA
93 while (1) { 187 while (1) {
94 lock_fpu_owner(); 188 lock_fpu_owner();
95 err = own_fpu_inatomic(0); 189 if (is_fpu_owner()) {
96 if (!err) 190 err = restore_fp_context(sc);
97 err = restore_fp_context(sc); /* this might fail */ 191 if (restore_msa && !err) {
98 unlock_fpu_owner(); 192 enable_msa();
193 err = _restore_msa_context(sc);
194 } else {
195 /* signal handler may have used MSA */
196 disable_msa();
197 }
198 unlock_fpu_owner();
199 } else {
200 unlock_fpu_owner();
201 err = copy_fp_from_sigcontext(sc);
202 if (!err && (used_math & USEDMATH_MSA))
203 err = copy_msa_from_sigcontext(sc);
204 }
99 if (likely(!err)) 205 if (likely(!err))
100 break; 206 break;
101 /* touch the sigcontext and try again */ 207 /* touch the sigcontext and try again */
@@ -105,6 +211,17 @@ static int protected_restore_fp_context(struct sigcontext __user *sc)
105 if (err) 211 if (err)
106 break; /* really bad sigcontext */ 212 break; /* really bad sigcontext */
107 } 213 }
214#else
215 /*
216 * EVA does not have FPU EVA instructions so restoring fpu context
217 * directly does not work.
218 */
219 enable_msa();
220 lose_fpu(0);
221 err = restore_fp_context(sc); /* this might fail */
222 if (restore_msa && !err)
223 err = copy_msa_from_sigcontext(sc);
224#endif
108 return err; 225 return err;
109} 226}
110 227
@@ -135,7 +252,8 @@ int setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
135 err |= __put_user(rddsp(DSP_MASK), &sc->sc_dsp); 252 err |= __put_user(rddsp(DSP_MASK), &sc->sc_dsp);
136 } 253 }
137 254
138 used_math = !!used_math(); 255 used_math = used_math() ? USEDMATH_FP : 0;
256 used_math |= thread_msa_context_live() ? USEDMATH_MSA : 0;
139 err |= __put_user(used_math, &sc->sc_used_math); 257 err |= __put_user(used_math, &sc->sc_used_math);
140 258
141 if (used_math) { 259 if (used_math) {
@@ -143,7 +261,7 @@ int setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
143 * Save FPU state to signal context. Signal handler 261 * Save FPU state to signal context. Signal handler
144 * will "inherit" current FPU state. 262 * will "inherit" current FPU state.
145 */ 263 */
146 err |= protected_save_fp_context(sc); 264 err |= protected_save_fp_context(sc, used_math);
147 } 265 }
148 return err; 266 return err;
149} 267}
@@ -168,14 +286,14 @@ int fpcsr_pending(unsigned int __user *fpcsr)
168} 286}
169 287
170static int 288static int
171check_and_restore_fp_context(struct sigcontext __user *sc) 289check_and_restore_fp_context(struct sigcontext __user *sc, unsigned used_math)
172{ 290{
173 int err, sig; 291 int err, sig;
174 292
175 err = sig = fpcsr_pending(&sc->sc_fpc_csr); 293 err = sig = fpcsr_pending(&sc->sc_fpc_csr);
176 if (err > 0) 294 if (err > 0)
177 err = 0; 295 err = 0;
178 err |= protected_restore_fp_context(sc); 296 err |= protected_restore_fp_context(sc, used_math);
179 return err ?: sig; 297 return err ?: sig;
180} 298}
181 299
@@ -215,9 +333,10 @@ int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
215 if (used_math) { 333 if (used_math) {
216 /* restore fpu context if we have used it before */ 334 /* restore fpu context if we have used it before */
217 if (!err) 335 if (!err)
218 err = check_and_restore_fp_context(sc); 336 err = check_and_restore_fp_context(sc, used_math);
219 } else { 337 } else {
220 /* signal handler may have used FPU. Give it up. */ 338 /* signal handler may have used FPU or MSA. Disable them. */
339 disable_msa();
221 lose_fpu(0); 340 lose_fpu(0);
222 } 341 }
223 342
@@ -591,23 +710,26 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, void *unused,
591} 710}
592 711
593#ifdef CONFIG_SMP 712#ifdef CONFIG_SMP
713#ifndef CONFIG_EVA
594static int smp_save_fp_context(struct sigcontext __user *sc) 714static int smp_save_fp_context(struct sigcontext __user *sc)
595{ 715{
596 return raw_cpu_has_fpu 716 return raw_cpu_has_fpu
597 ? _save_fp_context(sc) 717 ? _save_fp_context(sc)
598 : fpu_emulator_save_context(sc); 718 : copy_fp_to_sigcontext(sc);
599} 719}
600 720
601static int smp_restore_fp_context(struct sigcontext __user *sc) 721static int smp_restore_fp_context(struct sigcontext __user *sc)
602{ 722{
603 return raw_cpu_has_fpu 723 return raw_cpu_has_fpu
604 ? _restore_fp_context(sc) 724 ? _restore_fp_context(sc)
605 : fpu_emulator_restore_context(sc); 725 : copy_fp_from_sigcontext(sc);
606} 726}
727#endif /* CONFIG_EVA */
607#endif 728#endif
608 729
609static int signal_setup(void) 730static int signal_setup(void)
610{ 731{
732#ifndef CONFIG_EVA
611#ifdef CONFIG_SMP 733#ifdef CONFIG_SMP
612 /* For now just do the cpu_has_fpu check when the functions are invoked */ 734 /* For now just do the cpu_has_fpu check when the functions are invoked */
613 save_fp_context = smp_save_fp_context; 735 save_fp_context = smp_save_fp_context;
@@ -617,9 +739,13 @@ static int signal_setup(void)
617 save_fp_context = _save_fp_context; 739 save_fp_context = _save_fp_context;
618 restore_fp_context = _restore_fp_context; 740 restore_fp_context = _restore_fp_context;
619 } else { 741 } else {
620 save_fp_context = fpu_emulator_save_context; 742 save_fp_context = copy_fp_from_sigcontext;
621 restore_fp_context = fpu_emulator_restore_context; 743 restore_fp_context = copy_fp_to_sigcontext;
622 } 744 }
745#endif /* CONFIG_SMP */
746#else
747 save_fp_context = copy_fp_from_sigcontext;;
748 restore_fp_context = copy_fp_to_sigcontext;
623#endif 749#endif
624 750
625 return 0; 751 return 0;
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c
index 3d60f7750fa8..299f956e4db3 100644
--- a/arch/mips/kernel/signal32.c
+++ b/arch/mips/kernel/signal32.c
@@ -30,6 +30,7 @@
30#include <asm/sim.h> 30#include <asm/sim.h>
31#include <asm/ucontext.h> 31#include <asm/ucontext.h>
32#include <asm/fpu.h> 32#include <asm/fpu.h>
33#include <asm/msa.h>
33#include <asm/war.h> 34#include <asm/war.h>
34#include <asm/vdso.h> 35#include <asm/vdso.h>
35#include <asm/dsp.h> 36#include <asm/dsp.h>
@@ -42,8 +43,8 @@ static int (*restore_fp_context32)(struct sigcontext32 __user *sc);
42extern asmlinkage int _save_fp_context32(struct sigcontext32 __user *sc); 43extern asmlinkage int _save_fp_context32(struct sigcontext32 __user *sc);
43extern asmlinkage int _restore_fp_context32(struct sigcontext32 __user *sc); 44extern asmlinkage int _restore_fp_context32(struct sigcontext32 __user *sc);
44 45
45extern asmlinkage int fpu_emulator_save_context32(struct sigcontext32 __user *sc); 46extern asmlinkage int _save_msa_context32(struct sigcontext32 __user *sc);
46extern asmlinkage int fpu_emulator_restore_context32(struct sigcontext32 __user *sc); 47extern asmlinkage int _restore_msa_context32(struct sigcontext32 __user *sc);
47 48
48/* 49/*
49 * Including <asm/unistd.h> would give use the 64-bit syscall numbers ... 50 * Including <asm/unistd.h> would give use the 64-bit syscall numbers ...
@@ -78,17 +79,96 @@ struct rt_sigframe32 {
78}; 79};
79 80
80/* 81/*
82 * Thread saved context copy to/from a signal context presumed to be on the
83 * user stack, and therefore accessed with appropriate macros from uaccess.h.
84 */
85static int copy_fp_to_sigcontext32(struct sigcontext32 __user *sc)
86{
87 int i;
88 int err = 0;
89 int inc = test_thread_flag(TIF_32BIT_FPREGS) ? 2 : 1;
90
91 for (i = 0; i < NUM_FPU_REGS; i += inc) {
92 err |=
93 __put_user(get_fpr64(&current->thread.fpu.fpr[i], 0),
94 &sc->sc_fpregs[i]);
95 }
96 err |= __put_user(current->thread.fpu.fcr31, &sc->sc_fpc_csr);
97
98 return err;
99}
100
101static int copy_fp_from_sigcontext32(struct sigcontext32 __user *sc)
102{
103 int i;
104 int err = 0;
105 int inc = test_thread_flag(TIF_32BIT_FPREGS) ? 2 : 1;
106 u64 fpr_val;
107
108 for (i = 0; i < NUM_FPU_REGS; i += inc) {
109 err |= __get_user(fpr_val, &sc->sc_fpregs[i]);
110 set_fpr64(&current->thread.fpu.fpr[i], 0, fpr_val);
111 }
112 err |= __get_user(current->thread.fpu.fcr31, &sc->sc_fpc_csr);
113
114 return err;
115}
116
117/*
118 * These functions will save only the upper 64 bits of the vector registers,
119 * since the lower 64 bits have already been saved as the scalar FP context.
120 */
121static int copy_msa_to_sigcontext32(struct sigcontext32 __user *sc)
122{
123 int i;
124 int err = 0;
125
126 for (i = 0; i < NUM_FPU_REGS; i++) {
127 err |=
128 __put_user(get_fpr64(&current->thread.fpu.fpr[i], 1),
129 &sc->sc_msaregs[i]);
130 }
131 err |= __put_user(current->thread.fpu.msacsr, &sc->sc_msa_csr);
132
133 return err;
134}
135
136static int copy_msa_from_sigcontext32(struct sigcontext32 __user *sc)
137{
138 int i;
139 int err = 0;
140 u64 val;
141
142 for (i = 0; i < NUM_FPU_REGS; i++) {
143 err |= __get_user(val, &sc->sc_msaregs[i]);
144 set_fpr64(&current->thread.fpu.fpr[i], 1, val);
145 }
146 err |= __get_user(current->thread.fpu.msacsr, &sc->sc_msa_csr);
147
148 return err;
149}
150
151/*
81 * sigcontext handlers 152 * sigcontext handlers
82 */ 153 */
83static int protected_save_fp_context32(struct sigcontext32 __user *sc) 154static int protected_save_fp_context32(struct sigcontext32 __user *sc,
155 unsigned used_math)
84{ 156{
85 int err; 157 int err;
158 bool save_msa = cpu_has_msa && (used_math & USEDMATH_MSA);
86 while (1) { 159 while (1) {
87 lock_fpu_owner(); 160 lock_fpu_owner();
88 err = own_fpu_inatomic(1); 161 if (is_fpu_owner()) {
89 if (!err) 162 err = save_fp_context32(sc);
90 err = save_fp_context32(sc); /* this might fail */ 163 if (save_msa && !err)
91 unlock_fpu_owner(); 164 err = _save_msa_context32(sc);
165 unlock_fpu_owner();
166 } else {
167 unlock_fpu_owner();
168 err = copy_fp_to_sigcontext32(sc);
169 if (save_msa && !err)
170 err = copy_msa_to_sigcontext32(sc);
171 }
92 if (likely(!err)) 172 if (likely(!err))
93 break; 173 break;
94 /* touch the sigcontext and try again */ 174 /* touch the sigcontext and try again */
@@ -101,15 +181,29 @@ static int protected_save_fp_context32(struct sigcontext32 __user *sc)
101 return err; 181 return err;
102} 182}
103 183
104static int protected_restore_fp_context32(struct sigcontext32 __user *sc) 184static int protected_restore_fp_context32(struct sigcontext32 __user *sc,
185 unsigned used_math)
105{ 186{
106 int err, tmp __maybe_unused; 187 int err, tmp __maybe_unused;
188 bool restore_msa = cpu_has_msa && (used_math & USEDMATH_MSA);
107 while (1) { 189 while (1) {
108 lock_fpu_owner(); 190 lock_fpu_owner();
109 err = own_fpu_inatomic(0); 191 if (is_fpu_owner()) {
110 if (!err) 192 err = restore_fp_context32(sc);
111 err = restore_fp_context32(sc); /* this might fail */ 193 if (restore_msa && !err) {
112 unlock_fpu_owner(); 194 enable_msa();
195 err = _restore_msa_context32(sc);
196 } else {
197 /* signal handler may have used MSA */
198 disable_msa();
199 }
200 unlock_fpu_owner();
201 } else {
202 unlock_fpu_owner();
203 err = copy_fp_from_sigcontext32(sc);
204 if (restore_msa && !err)
205 err = copy_msa_from_sigcontext32(sc);
206 }
113 if (likely(!err)) 207 if (likely(!err))
114 break; 208 break;
115 /* touch the sigcontext and try again */ 209 /* touch the sigcontext and try again */
@@ -147,7 +241,8 @@ static int setup_sigcontext32(struct pt_regs *regs,
147 err |= __put_user(mflo3(), &sc->sc_lo3); 241 err |= __put_user(mflo3(), &sc->sc_lo3);
148 } 242 }
149 243
150 used_math = !!used_math(); 244 used_math = used_math() ? USEDMATH_FP : 0;
245 used_math |= thread_msa_context_live() ? USEDMATH_MSA : 0;
151 err |= __put_user(used_math, &sc->sc_used_math); 246 err |= __put_user(used_math, &sc->sc_used_math);
152 247
153 if (used_math) { 248 if (used_math) {
@@ -155,20 +250,21 @@ static int setup_sigcontext32(struct pt_regs *regs,
155 * Save FPU state to signal context. Signal handler 250 * Save FPU state to signal context. Signal handler
156 * will "inherit" current FPU state. 251 * will "inherit" current FPU state.
157 */ 252 */
158 err |= protected_save_fp_context32(sc); 253 err |= protected_save_fp_context32(sc, used_math);
159 } 254 }
160 return err; 255 return err;
161} 256}
162 257
163static int 258static int
164check_and_restore_fp_context32(struct sigcontext32 __user *sc) 259check_and_restore_fp_context32(struct sigcontext32 __user *sc,
260 unsigned used_math)
165{ 261{
166 int err, sig; 262 int err, sig;
167 263
168 err = sig = fpcsr_pending(&sc->sc_fpc_csr); 264 err = sig = fpcsr_pending(&sc->sc_fpc_csr);
169 if (err > 0) 265 if (err > 0)
170 err = 0; 266 err = 0;
171 err |= protected_restore_fp_context32(sc); 267 err |= protected_restore_fp_context32(sc, used_math);
172 return err ?: sig; 268 return err ?: sig;
173} 269}
174 270
@@ -205,9 +301,10 @@ static int restore_sigcontext32(struct pt_regs *regs,
205 if (used_math) { 301 if (used_math) {
206 /* restore fpu context if we have used it before */ 302 /* restore fpu context if we have used it before */
207 if (!err) 303 if (!err)
208 err = check_and_restore_fp_context32(sc); 304 err = check_and_restore_fp_context32(sc, used_math);
209 } else { 305 } else {
210 /* signal handler may have used FPU. Give it up. */ 306 /* signal handler may have used FPU or MSA. Disable them. */
307 disable_msa();
211 lose_fpu(0); 308 lose_fpu(0);
212 } 309 }
213 310
@@ -566,8 +663,8 @@ static int signal32_init(void)
566 save_fp_context32 = _save_fp_context32; 663 save_fp_context32 = _save_fp_context32;
567 restore_fp_context32 = _restore_fp_context32; 664 restore_fp_context32 = _restore_fp_context32;
568 } else { 665 } else {
569 save_fp_context32 = fpu_emulator_save_context32; 666 save_fp_context32 = copy_fp_to_sigcontext32;
570 restore_fp_context32 = fpu_emulator_restore_context32; 667 restore_fp_context32 = copy_fp_from_sigcontext32;
571 } 668 }
572 669
573 return 0; 670 return 0;
diff --git a/arch/mips/kernel/smp-cmp.c b/arch/mips/kernel/smp-cmp.c
index 1b925d8a610c..3ef55fb7ac03 100644
--- a/arch/mips/kernel/smp-cmp.c
+++ b/arch/mips/kernel/smp-cmp.c
@@ -39,57 +39,9 @@
39#include <asm/amon.h> 39#include <asm/amon.h>
40#include <asm/gic.h> 40#include <asm/gic.h>
41 41
42static void ipi_call_function(unsigned int cpu)
43{
44 pr_debug("CPU%d: %s cpu %d status %08x\n",
45 smp_processor_id(), __func__, cpu, read_c0_status());
46
47 gic_send_ipi(plat_ipi_call_int_xlate(cpu));
48}
49
50
51static void ipi_resched(unsigned int cpu)
52{
53 pr_debug("CPU%d: %s cpu %d status %08x\n",
54 smp_processor_id(), __func__, cpu, read_c0_status());
55
56 gic_send_ipi(plat_ipi_resched_int_xlate(cpu));
57}
58
59/*
60 * FIXME: This isn't restricted to CMP
61 * The SMVP kernel could use GIC interrupts if available
62 */
63void cmp_send_ipi_single(int cpu, unsigned int action)
64{
65 unsigned long flags;
66
67 local_irq_save(flags);
68
69 switch (action) {
70 case SMP_CALL_FUNCTION:
71 ipi_call_function(cpu);
72 break;
73
74 case SMP_RESCHEDULE_YOURSELF:
75 ipi_resched(cpu);
76 break;
77 }
78
79 local_irq_restore(flags);
80}
81
82static void cmp_send_ipi_mask(const struct cpumask *mask, unsigned int action)
83{
84 unsigned int i;
85
86 for_each_cpu(i, mask)
87 cmp_send_ipi_single(i, action);
88}
89
90static void cmp_init_secondary(void) 42static void cmp_init_secondary(void)
91{ 43{
92 struct cpuinfo_mips *c = &current_cpu_data; 44 struct cpuinfo_mips *c __maybe_unused = &current_cpu_data;
93 45
94 /* Assume GIC is present */ 46 /* Assume GIC is present */
95 change_c0_status(ST0_IM, STATUSF_IP3 | STATUSF_IP4 | STATUSF_IP6 | 47 change_c0_status(ST0_IM, STATUSF_IP3 | STATUSF_IP4 | STATUSF_IP6 |
@@ -97,7 +49,6 @@ static void cmp_init_secondary(void)
97 49
98 /* Enable per-cpu interrupts: platform specific */ 50 /* Enable per-cpu interrupts: platform specific */
99 51
100 c->core = (read_c0_ebase() >> 1) & 0x1ff;
101#if defined(CONFIG_MIPS_MT_SMP) || defined(CONFIG_MIPS_MT_SMTC) 52#if defined(CONFIG_MIPS_MT_SMP) || defined(CONFIG_MIPS_MT_SMTC)
102 if (cpu_has_mipsmt) 53 if (cpu_has_mipsmt)
103 c->vpe_id = (read_c0_tcbind() >> TCBIND_CURVPE_SHIFT) & 54 c->vpe_id = (read_c0_tcbind() >> TCBIND_CURVPE_SHIFT) &
@@ -210,8 +161,8 @@ void __init cmp_prepare_cpus(unsigned int max_cpus)
210} 161}
211 162
212struct plat_smp_ops cmp_smp_ops = { 163struct plat_smp_ops cmp_smp_ops = {
213 .send_ipi_single = cmp_send_ipi_single, 164 .send_ipi_single = gic_send_ipi_single,
214 .send_ipi_mask = cmp_send_ipi_mask, 165 .send_ipi_mask = gic_send_ipi_mask,
215 .init_secondary = cmp_init_secondary, 166 .init_secondary = cmp_init_secondary,
216 .smp_finish = cmp_smp_finish, 167 .smp_finish = cmp_smp_finish,
217 .cpus_done = cmp_cpus_done, 168 .cpus_done = cmp_cpus_done,
diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
new file mode 100644
index 000000000000..536eec0d21b6
--- /dev/null
+++ b/arch/mips/kernel/smp-cps.c
@@ -0,0 +1,335 @@
1/*
2 * Copyright (C) 2013 Imagination Technologies
3 * Author: Paul Burton <paul.burton@imgtec.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 */
10
11#include <linux/io.h>
12#include <linux/sched.h>
13#include <linux/slab.h>
14#include <linux/smp.h>
15#include <linux/types.h>
16
17#include <asm/cacheflush.h>
18#include <asm/gic.h>
19#include <asm/mips-cm.h>
20#include <asm/mips-cpc.h>
21#include <asm/mips_mt.h>
22#include <asm/mipsregs.h>
23#include <asm/smp-cps.h>
24#include <asm/time.h>
25#include <asm/uasm.h>
26
27static DECLARE_BITMAP(core_power, NR_CPUS);
28
29struct boot_config mips_cps_bootcfg;
30
31static void init_core(void)
32{
33 unsigned int nvpes, t;
34 u32 mvpconf0, vpeconf0, vpecontrol, tcstatus, tcbind, status;
35
36 if (!cpu_has_mipsmt)
37 return;
38
39 /* Enter VPE configuration state */
40 dvpe();
41 set_c0_mvpcontrol(MVPCONTROL_VPC);
42
43 /* Retrieve the count of VPEs in this core */
44 mvpconf0 = read_c0_mvpconf0();
45 nvpes = ((mvpconf0 & MVPCONF0_PVPE) >> MVPCONF0_PVPE_SHIFT) + 1;
46 smp_num_siblings = nvpes;
47
48 for (t = 1; t < nvpes; t++) {
49 /* Use a 1:1 mapping of TC index to VPE index */
50 settc(t);
51
52 /* Bind 1 TC to this VPE */
53 tcbind = read_tc_c0_tcbind();
54 tcbind &= ~TCBIND_CURVPE;
55 tcbind |= t << TCBIND_CURVPE_SHIFT;
56 write_tc_c0_tcbind(tcbind);
57
58 /* Set exclusive TC, non-active, master */
59 vpeconf0 = read_vpe_c0_vpeconf0();
60 vpeconf0 &= ~(VPECONF0_XTC | VPECONF0_VPA);
61 vpeconf0 |= t << VPECONF0_XTC_SHIFT;
62 vpeconf0 |= VPECONF0_MVP;
63 write_vpe_c0_vpeconf0(vpeconf0);
64
65 /* Declare TC non-active, non-allocatable & interrupt exempt */
66 tcstatus = read_tc_c0_tcstatus();
67 tcstatus &= ~(TCSTATUS_A | TCSTATUS_DA);
68 tcstatus |= TCSTATUS_IXMT;
69 write_tc_c0_tcstatus(tcstatus);
70
71 /* Halt the TC */
72 write_tc_c0_tchalt(TCHALT_H);
73
74 /* Allow only 1 TC to execute */
75 vpecontrol = read_vpe_c0_vpecontrol();
76 vpecontrol &= ~VPECONTROL_TE;
77 write_vpe_c0_vpecontrol(vpecontrol);
78
79 /* Copy (most of) Status from VPE 0 */
80 status = read_c0_status();
81 status &= ~(ST0_IM | ST0_IE | ST0_KSU);
82 status |= ST0_CU0;
83 write_vpe_c0_status(status);
84
85 /* Copy Config from VPE 0 */
86 write_vpe_c0_config(read_c0_config());
87 write_vpe_c0_config7(read_c0_config7());
88
89 /* Ensure no software interrupts are pending */
90 write_vpe_c0_cause(0);
91
92 /* Sync Count */
93 write_vpe_c0_count(read_c0_count());
94 }
95
96 /* Leave VPE configuration state */
97 clear_c0_mvpcontrol(MVPCONTROL_VPC);
98}
99
100static void __init cps_smp_setup(void)
101{
102 unsigned int ncores, nvpes, core_vpes;
103 int c, v;
104 u32 core_cfg, *entry_code;
105
106 /* Detect & record VPE topology */
107 ncores = mips_cm_numcores();
108 pr_info("VPE topology ");
109 for (c = nvpes = 0; c < ncores; c++) {
110 if (cpu_has_mipsmt && config_enabled(CONFIG_MIPS_MT_SMP)) {
111 write_gcr_cl_other(c << CM_GCR_Cx_OTHER_CORENUM_SHF);
112 core_cfg = read_gcr_co_config();
113 core_vpes = ((core_cfg & CM_GCR_Cx_CONFIG_PVPE_MSK) >>
114 CM_GCR_Cx_CONFIG_PVPE_SHF) + 1;
115 } else {
116 core_vpes = 1;
117 }
118
119 pr_cont("%c%u", c ? ',' : '{', core_vpes);
120
121 for (v = 0; v < min_t(int, core_vpes, NR_CPUS - nvpes); v++) {
122 cpu_data[nvpes + v].core = c;
123#ifdef CONFIG_MIPS_MT_SMP
124 cpu_data[nvpes + v].vpe_id = v;
125#endif
126 }
127
128 nvpes += core_vpes;
129 }
130 pr_cont("} total %u\n", nvpes);
131
132 /* Indicate present CPUs (CPU being synonymous with VPE) */
133 for (v = 0; v < min_t(unsigned, nvpes, NR_CPUS); v++) {
134 set_cpu_possible(v, true);
135 set_cpu_present(v, true);
136 __cpu_number_map[v] = v;
137 __cpu_logical_map[v] = v;
138 }
139
140 /* Core 0 is powered up (we're running on it) */
141 bitmap_set(core_power, 0, 1);
142
143 /* Disable MT - we only want to run 1 TC per VPE */
144 if (cpu_has_mipsmt)
145 dmt();
146
147 /* Initialise core 0 */
148 init_core();
149
150 /* Patch the start of mips_cps_core_entry to provide the CM base */
151 entry_code = (u32 *)&mips_cps_core_entry;
152 UASM_i_LA(&entry_code, 3, (long)mips_cm_base);
153
154 /* Make core 0 coherent with everything */
155 write_gcr_cl_coherence(0xff);
156}
157
158static void __init cps_prepare_cpus(unsigned int max_cpus)
159{
160 mips_mt_set_cpuoptions();
161}
162
163static void boot_core(struct boot_config *cfg)
164{
165 u32 access;
166
167 /* Select the appropriate core */
168 write_gcr_cl_other(cfg->core << CM_GCR_Cx_OTHER_CORENUM_SHF);
169
170 /* Set its reset vector */
171 write_gcr_co_reset_base(CKSEG1ADDR((unsigned long)mips_cps_core_entry));
172
173 /* Ensure its coherency is disabled */
174 write_gcr_co_coherence(0);
175
176 /* Ensure the core can access the GCRs */
177 access = read_gcr_access();
178 access |= 1 << (CM_GCR_ACCESS_ACCESSEN_SHF + cfg->core);
179 write_gcr_access(access);
180
181 /* Copy cfg */
182 mips_cps_bootcfg = *cfg;
183
184 if (mips_cpc_present()) {
185 /* Select the appropriate core */
186 write_cpc_cl_other(cfg->core << CPC_Cx_OTHER_CORENUM_SHF);
187
188 /* Reset the core */
189 write_cpc_co_cmd(CPC_Cx_CMD_RESET);
190 } else {
191 /* Take the core out of reset */
192 write_gcr_co_reset_release(0);
193 }
194
195 /* The core is now powered up */
196 bitmap_set(core_power, cfg->core, 1);
197}
198
199static void boot_vpe(void *info)
200{
201 struct boot_config *cfg = info;
202 u32 tcstatus, vpeconf0;
203
204 /* Enter VPE configuration state */
205 dvpe();
206 set_c0_mvpcontrol(MVPCONTROL_VPC);
207
208 settc(cfg->vpe);
209
210 /* Set the TC restart PC */
211 write_tc_c0_tcrestart((unsigned long)&smp_bootstrap);
212
213 /* Activate the TC, allow interrupts */
214 tcstatus = read_tc_c0_tcstatus();
215 tcstatus &= ~TCSTATUS_IXMT;
216 tcstatus |= TCSTATUS_A;
217 write_tc_c0_tcstatus(tcstatus);
218
219 /* Clear the TC halt bit */
220 write_tc_c0_tchalt(0);
221
222 /* Activate the VPE */
223 vpeconf0 = read_vpe_c0_vpeconf0();
224 vpeconf0 |= VPECONF0_VPA;
225 write_vpe_c0_vpeconf0(vpeconf0);
226
227 /* Set the stack & global pointer registers */
228 write_tc_gpr_sp(cfg->sp);
229 write_tc_gpr_gp(cfg->gp);
230
231 /* Leave VPE configuration state */
232 clear_c0_mvpcontrol(MVPCONTROL_VPC);
233
234 /* Enable other VPEs to execute */
235 evpe(EVPE_ENABLE);
236}
237
238static void cps_boot_secondary(int cpu, struct task_struct *idle)
239{
240 struct boot_config cfg;
241 unsigned int remote;
242 int err;
243
244 cfg.core = cpu_data[cpu].core;
245 cfg.vpe = cpu_vpe_id(&cpu_data[cpu]);
246 cfg.pc = (unsigned long)&smp_bootstrap;
247 cfg.sp = __KSTK_TOS(idle);
248 cfg.gp = (unsigned long)task_thread_info(idle);
249
250 if (!test_bit(cfg.core, core_power)) {
251 /* Boot a VPE on a powered down core */
252 boot_core(&cfg);
253 return;
254 }
255
256 if (cfg.core != current_cpu_data.core) {
257 /* Boot a VPE on another powered up core */
258 for (remote = 0; remote < NR_CPUS; remote++) {
259 if (cpu_data[remote].core != cfg.core)
260 continue;
261 if (cpu_online(remote))
262 break;
263 }
264 BUG_ON(remote >= NR_CPUS);
265
266 err = smp_call_function_single(remote, boot_vpe, &cfg, 1);
267 if (err)
268 panic("Failed to call remote CPU\n");
269 return;
270 }
271
272 BUG_ON(!cpu_has_mipsmt);
273
274 /* Boot a VPE on this core */
275 boot_vpe(&cfg);
276}
277
278static void cps_init_secondary(void)
279{
280 /* Disable MT - we only want to run 1 TC per VPE */
281 if (cpu_has_mipsmt)
282 dmt();
283
284 /* TODO: revisit this assumption once hotplug is implemented */
285 if (cpu_vpe_id(&current_cpu_data) == 0)
286 init_core();
287
288 change_c0_status(ST0_IM, STATUSF_IP3 | STATUSF_IP4 |
289 STATUSF_IP6 | STATUSF_IP7);
290}
291
292static void cps_smp_finish(void)
293{
294 write_c0_compare(read_c0_count() + (8 * mips_hpt_frequency / HZ));
295
296#ifdef CONFIG_MIPS_MT_FPAFF
297 /* If we have an FPU, enroll ourselves in the FPU-full mask */
298 if (cpu_has_fpu)
299 cpu_set(smp_processor_id(), mt_fpu_cpumask);
300#endif /* CONFIG_MIPS_MT_FPAFF */
301
302 local_irq_enable();
303}
304
305static void cps_cpus_done(void)
306{
307}
308
309static struct plat_smp_ops cps_smp_ops = {
310 .smp_setup = cps_smp_setup,
311 .prepare_cpus = cps_prepare_cpus,
312 .boot_secondary = cps_boot_secondary,
313 .init_secondary = cps_init_secondary,
314 .smp_finish = cps_smp_finish,
315 .send_ipi_single = gic_send_ipi_single,
316 .send_ipi_mask = gic_send_ipi_mask,
317 .cpus_done = cps_cpus_done,
318};
319
320int register_cps_smp_ops(void)
321{
322 if (!mips_cm_present()) {
323 pr_warn("MIPS CPS SMP unable to proceed without a CM\n");
324 return -ENODEV;
325 }
326
327 /* check we have a GIC - we need one for IPIs */
328 if (!(read_gcr_gic_status() & CM_GCR_GIC_STATUS_EX_MSK)) {
329 pr_warn("MIPS CPS SMP unable to proceed without a GIC\n");
330 return -ENODEV;
331 }
332
333 register_smp_ops(&cps_smp_ops);
334 return 0;
335}
diff --git a/arch/mips/kernel/smp-gic.c b/arch/mips/kernel/smp-gic.c
new file mode 100644
index 000000000000..3bb1f92ab525
--- /dev/null
+++ b/arch/mips/kernel/smp-gic.c
@@ -0,0 +1,53 @@
1/*
2 * Copyright (C) 2013 Imagination Technologies
3 * Author: Paul Burton <paul.burton@imgtec.com>
4 *
5 * Based on smp-cmp.c:
6 * Copyright (C) 2007 MIPS Technologies, Inc.
7 * Author: Chris Dearman (chris@mips.com)
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 */
14
15#include <linux/printk.h>
16
17#include <asm/gic.h>
18#include <asm/smp-ops.h>
19
20void gic_send_ipi_single(int cpu, unsigned int action)
21{
22 unsigned long flags;
23 unsigned int intr;
24
25 pr_debug("CPU%d: %s cpu %d action %u status %08x\n",
26 smp_processor_id(), __func__, cpu, action, read_c0_status());
27
28 local_irq_save(flags);
29
30 switch (action) {
31 case SMP_CALL_FUNCTION:
32 intr = plat_ipi_call_int_xlate(cpu);
33 break;
34
35 case SMP_RESCHEDULE_YOURSELF:
36 intr = plat_ipi_resched_int_xlate(cpu);
37 break;
38
39 default:
40 BUG();
41 }
42
43 gic_send_ipi(intr);
44 local_irq_restore(flags);
45}
46
47void gic_send_ipi_mask(const struct cpumask *mask, unsigned int action)
48{
49 unsigned int i;
50
51 for_each_cpu(i, mask)
52 gic_send_ipi_single(i, action);
53}
diff --git a/arch/mips/kernel/smp-mt.c b/arch/mips/kernel/smp-mt.c
index 0fb8cefc9114..f8e13149604d 100644
--- a/arch/mips/kernel/smp-mt.c
+++ b/arch/mips/kernel/smp-mt.c
@@ -113,27 +113,6 @@ static void __init smvp_tc_init(unsigned int tc, unsigned int mvpconf0)
113 write_tc_c0_tchalt(TCHALT_H); 113 write_tc_c0_tchalt(TCHALT_H);
114} 114}
115 115
116#ifdef CONFIG_IRQ_GIC
117static void mp_send_ipi_single(int cpu, unsigned int action)
118{
119 unsigned long flags;
120
121 local_irq_save(flags);
122
123 switch (action) {
124 case SMP_CALL_FUNCTION:
125 gic_send_ipi(plat_ipi_call_int_xlate(cpu));
126 break;
127
128 case SMP_RESCHEDULE_YOURSELF:
129 gic_send_ipi(plat_ipi_resched_int_xlate(cpu));
130 break;
131 }
132
133 local_irq_restore(flags);
134}
135#endif
136
137static void vsmp_send_ipi_single(int cpu, unsigned int action) 116static void vsmp_send_ipi_single(int cpu, unsigned int action)
138{ 117{
139 int i; 118 int i;
@@ -142,7 +121,7 @@ static void vsmp_send_ipi_single(int cpu, unsigned int action)
142 121
143#ifdef CONFIG_IRQ_GIC 122#ifdef CONFIG_IRQ_GIC
144 if (gic_present) { 123 if (gic_present) {
145 mp_send_ipi_single(cpu, action); 124 gic_send_ipi_single(cpu, action);
146 return; 125 return;
147 } 126 }
148#endif 127#endif
@@ -313,3 +292,25 @@ struct plat_smp_ops vsmp_smp_ops = {
313 .smp_setup = vsmp_smp_setup, 292 .smp_setup = vsmp_smp_setup,
314 .prepare_cpus = vsmp_prepare_cpus, 293 .prepare_cpus = vsmp_prepare_cpus,
315}; 294};
295
296static int proc_cpuinfo_chain_call(struct notifier_block *nfb,
297 unsigned long action_unused, void *data)
298{
299 struct proc_cpuinfo_notifier_args *pcn = data;
300 struct seq_file *m = pcn->m;
301 unsigned long n = pcn->n;
302
303 if (!cpu_has_mipsmt)
304 return NOTIFY_OK;
305
306 seq_printf(m, "VPE\t\t\t: %d\n", cpu_data[n].vpe_id);
307
308 return NOTIFY_OK;
309}
310
311static int __init proc_cpuinfo_notifier_init(void)
312{
313 return proc_cpuinfo_notifier(proc_cpuinfo_chain_call, 0);
314}
315
316subsys_initcall(proc_cpuinfo_notifier_init);
diff --git a/arch/mips/kernel/smtc-proc.c b/arch/mips/kernel/smtc-proc.c
index c10aa84c9fa9..38635a996cbf 100644
--- a/arch/mips/kernel/smtc-proc.c
+++ b/arch/mips/kernel/smtc-proc.c
@@ -77,3 +77,26 @@ void init_smtc_stats(void)
77 77
78 proc_create("smtc", 0444, NULL, &smtc_proc_fops); 78 proc_create("smtc", 0444, NULL, &smtc_proc_fops);
79} 79}
80
81static int proc_cpuinfo_chain_call(struct notifier_block *nfb,
82 unsigned long action_unused, void *data)
83{
84 struct proc_cpuinfo_notifier_args *pcn = data;
85 struct seq_file *m = pcn->m;
86 unsigned long n = pcn->n;
87
88 if (!cpu_has_mipsmt)
89 return NOTIFY_OK;
90
91 seq_printf(m, "VPE\t\t\t: %d\n", cpu_data[n].vpe_id);
92 seq_printf(m, "TC\t\t\t: %d\n", cpu_data[n].tc_id);
93
94 return NOTIFY_OK;
95}
96
97static int __init proc_cpuinfo_notifier_init(void)
98{
99 return proc_cpuinfo_notifier(proc_cpuinfo_chain_call, 0);
100}
101
102subsys_initcall(proc_cpuinfo_notifier_init);
diff --git a/arch/mips/kernel/spram.c b/arch/mips/kernel/spram.c
index b242e2c10ea0..67f2495def1c 100644
--- a/arch/mips/kernel/spram.c
+++ b/arch/mips/kernel/spram.c
@@ -197,16 +197,17 @@ static void probe_spram(char *type,
197} 197}
198void spram_config(void) 198void spram_config(void)
199{ 199{
200 struct cpuinfo_mips *c = &current_cpu_data;
201 unsigned int config0; 200 unsigned int config0;
202 201
203 switch (c->cputype) { 202 switch (current_cpu_type()) {
204 case CPU_24K: 203 case CPU_24K:
205 case CPU_34K: 204 case CPU_34K:
206 case CPU_74K: 205 case CPU_74K:
207 case CPU_1004K: 206 case CPU_1004K:
207 case CPU_1074K:
208 case CPU_INTERAPTIV: 208 case CPU_INTERAPTIV:
209 case CPU_PROAPTIV: 209 case CPU_PROAPTIV:
210 case CPU_P5600:
210 config0 = read_c0_config(); 211 config0 = read_c0_config();
211 /* FIXME: addresses are Malta specific */ 212 /* FIXME: addresses are Malta specific */
212 if (config0 & (1<<24)) { 213 if (config0 & (1<<24)) {
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index b79d13f95bf0..4a4f9dda5658 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -110,7 +110,7 @@ static inline int mips_atomic_set(unsigned long addr, unsigned long new)
110 110
111 if (cpu_has_llsc && R10000_LLSC_WAR) { 111 if (cpu_has_llsc && R10000_LLSC_WAR) {
112 __asm__ __volatile__ ( 112 __asm__ __volatile__ (
113 " .set mips3 \n" 113 " .set arch=r4000 \n"
114 " li %[err], 0 \n" 114 " li %[err], 0 \n"
115 "1: ll %[old], (%[addr]) \n" 115 "1: ll %[old], (%[addr]) \n"
116 " move %[tmp], %[new] \n" 116 " move %[tmp], %[new] \n"
@@ -135,7 +135,7 @@ static inline int mips_atomic_set(unsigned long addr, unsigned long new)
135 : "memory"); 135 : "memory");
136 } else if (cpu_has_llsc) { 136 } else if (cpu_has_llsc) {
137 __asm__ __volatile__ ( 137 __asm__ __volatile__ (
138 " .set mips3 \n" 138 " .set arch=r4000 \n"
139 " li %[err], 0 \n" 139 " li %[err], 0 \n"
140 "1: ll %[old], (%[addr]) \n" 140 "1: ll %[old], (%[addr]) \n"
141 " move %[tmp], %[new] \n" 141 " move %[tmp], %[new] \n"
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index e0b499694d18..074e857ced28 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -10,6 +10,7 @@
10 * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com 10 * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
11 * Copyright (C) 2002, 2003, 2004, 2005, 2007 Maciej W. Rozycki 11 * Copyright (C) 2002, 2003, 2004, 2005, 2007 Maciej W. Rozycki
12 * Copyright (C) 2000, 2001, 2012 MIPS Technologies, Inc. All rights reserved. 12 * Copyright (C) 2000, 2001, 2012 MIPS Technologies, Inc. All rights reserved.
13 * Copyright (C) 2014, Imagination Technologies Ltd.
13 */ 14 */
14#include <linux/bug.h> 15#include <linux/bug.h>
15#include <linux/compiler.h> 16#include <linux/compiler.h>
@@ -47,6 +48,7 @@
47#include <asm/mipsregs.h> 48#include <asm/mipsregs.h>
48#include <asm/mipsmtregs.h> 49#include <asm/mipsmtregs.h>
49#include <asm/module.h> 50#include <asm/module.h>
51#include <asm/msa.h>
50#include <asm/pgtable.h> 52#include <asm/pgtable.h>
51#include <asm/ptrace.h> 53#include <asm/ptrace.h>
52#include <asm/sections.h> 54#include <asm/sections.h>
@@ -77,8 +79,10 @@ extern asmlinkage void handle_ri_rdhwr(void);
77extern asmlinkage void handle_cpu(void); 79extern asmlinkage void handle_cpu(void);
78extern asmlinkage void handle_ov(void); 80extern asmlinkage void handle_ov(void);
79extern asmlinkage void handle_tr(void); 81extern asmlinkage void handle_tr(void);
82extern asmlinkage void handle_msa_fpe(void);
80extern asmlinkage void handle_fpe(void); 83extern asmlinkage void handle_fpe(void);
81extern asmlinkage void handle_ftlb(void); 84extern asmlinkage void handle_ftlb(void);
85extern asmlinkage void handle_msa(void);
82extern asmlinkage void handle_mdmx(void); 86extern asmlinkage void handle_mdmx(void);
83extern asmlinkage void handle_watch(void); 87extern asmlinkage void handle_watch(void);
84extern asmlinkage void handle_mt(void); 88extern asmlinkage void handle_mt(void);
@@ -861,6 +865,11 @@ asmlinkage void do_bp(struct pt_regs *regs)
861 enum ctx_state prev_state; 865 enum ctx_state prev_state;
862 unsigned long epc; 866 unsigned long epc;
863 u16 instr[2]; 867 u16 instr[2];
868 mm_segment_t seg;
869
870 seg = get_fs();
871 if (!user_mode(regs))
872 set_fs(KERNEL_DS);
864 873
865 prev_state = exception_enter(); 874 prev_state = exception_enter();
866 if (get_isa16_mode(regs->cp0_epc)) { 875 if (get_isa16_mode(regs->cp0_epc)) {
@@ -870,17 +879,19 @@ asmlinkage void do_bp(struct pt_regs *regs)
870 if ((__get_user(instr[0], (u16 __user *)msk_isa16_mode(epc)) || 879 if ((__get_user(instr[0], (u16 __user *)msk_isa16_mode(epc)) ||
871 (__get_user(instr[1], (u16 __user *)msk_isa16_mode(epc + 2))))) 880 (__get_user(instr[1], (u16 __user *)msk_isa16_mode(epc + 2)))))
872 goto out_sigsegv; 881 goto out_sigsegv;
873 opcode = (instr[0] << 16) | instr[1]; 882 opcode = (instr[0] << 16) | instr[1];
874 } else { 883 } else {
875 /* MIPS16e mode */ 884 /* MIPS16e mode */
876 if (__get_user(instr[0], (u16 __user *)msk_isa16_mode(epc))) 885 if (__get_user(instr[0],
886 (u16 __user *)msk_isa16_mode(epc)))
877 goto out_sigsegv; 887 goto out_sigsegv;
878 bcode = (instr[0] >> 6) & 0x3f; 888 bcode = (instr[0] >> 6) & 0x3f;
879 do_trap_or_bp(regs, bcode, "Break"); 889 do_trap_or_bp(regs, bcode, "Break");
880 goto out; 890 goto out;
881 } 891 }
882 } else { 892 } else {
883 if (__get_user(opcode, (unsigned int __user *) exception_epc(regs))) 893 if (__get_user(opcode,
894 (unsigned int __user *) exception_epc(regs)))
884 goto out_sigsegv; 895 goto out_sigsegv;
885 } 896 }
886 897
@@ -918,6 +929,7 @@ asmlinkage void do_bp(struct pt_regs *regs)
918 do_trap_or_bp(regs, bcode, "Break"); 929 do_trap_or_bp(regs, bcode, "Break");
919 930
920out: 931out:
932 set_fs(seg);
921 exception_exit(prev_state); 933 exception_exit(prev_state);
922 return; 934 return;
923 935
@@ -931,8 +943,13 @@ asmlinkage void do_tr(struct pt_regs *regs)
931 u32 opcode, tcode = 0; 943 u32 opcode, tcode = 0;
932 enum ctx_state prev_state; 944 enum ctx_state prev_state;
933 u16 instr[2]; 945 u16 instr[2];
946 mm_segment_t seg;
934 unsigned long epc = msk_isa16_mode(exception_epc(regs)); 947 unsigned long epc = msk_isa16_mode(exception_epc(regs));
935 948
949 seg = get_fs();
950 if (!user_mode(regs))
951 set_fs(get_ds());
952
936 prev_state = exception_enter(); 953 prev_state = exception_enter();
937 if (get_isa16_mode(regs->cp0_epc)) { 954 if (get_isa16_mode(regs->cp0_epc)) {
938 if (__get_user(instr[0], (u16 __user *)(epc + 0)) || 955 if (__get_user(instr[0], (u16 __user *)(epc + 0)) ||
@@ -953,6 +970,7 @@ asmlinkage void do_tr(struct pt_regs *regs)
953 do_trap_or_bp(regs, tcode, "Trap"); 970 do_trap_or_bp(regs, tcode, "Trap");
954 971
955out: 972out:
973 set_fs(seg);
956 exception_exit(prev_state); 974 exception_exit(prev_state);
957 return; 975 return;
958 976
@@ -1074,6 +1092,76 @@ static int default_cu2_call(struct notifier_block *nfb, unsigned long action,
1074 return NOTIFY_OK; 1092 return NOTIFY_OK;
1075} 1093}
1076 1094
1095static int enable_restore_fp_context(int msa)
1096{
1097 int err, was_fpu_owner;
1098
1099 if (!used_math()) {
1100 /* First time FP context user. */
1101 err = init_fpu();
1102 if (msa && !err)
1103 enable_msa();
1104 if (!err)
1105 set_used_math();
1106 return err;
1107 }
1108
1109 /*
1110 * This task has formerly used the FP context.
1111 *
1112 * If this thread has no live MSA vector context then we can simply
1113 * restore the scalar FP context. If it has live MSA vector context
1114 * (that is, it has or may have used MSA since last performing a
1115 * function call) then we'll need to restore the vector context. This
1116 * applies even if we're currently only executing a scalar FP
1117 * instruction. This is because if we were to later execute an MSA
1118 * instruction then we'd either have to:
1119 *
1120 * - Restore the vector context & clobber any registers modified by
1121 * scalar FP instructions between now & then.
1122 *
1123 * or
1124 *
1125 * - Not restore the vector context & lose the most significant bits
1126 * of all vector registers.
1127 *
1128 * Neither of those options is acceptable. We cannot restore the least
1129 * significant bits of the registers now & only restore the most
1130 * significant bits later because the most significant bits of any
1131 * vector registers whose aliased FP register is modified now will have
1132 * been zeroed. We'd have no way to know that when restoring the vector
1133 * context & thus may load an outdated value for the most significant
1134 * bits of a vector register.
1135 */
1136 if (!msa && !thread_msa_context_live())
1137 return own_fpu(1);
1138
1139 /*
1140 * This task is using or has previously used MSA. Thus we require
1141 * that Status.FR == 1.
1142 */
1143 was_fpu_owner = is_fpu_owner();
1144 err = own_fpu(0);
1145 if (err)
1146 return err;
1147
1148 enable_msa();
1149 write_msa_csr(current->thread.fpu.msacsr);
1150 set_thread_flag(TIF_USEDMSA);
1151
1152 /*
1153 * If this is the first time that the task is using MSA and it has
1154 * previously used scalar FP in this time slice then we already nave
1155 * FP context which we shouldn't clobber.
1156 */
1157 if (!test_and_set_thread_flag(TIF_MSA_CTX_LIVE) && was_fpu_owner)
1158 return 0;
1159
1160 /* We need to restore the vector context. */
1161 restore_msa(current);
1162 return 0;
1163}
1164
1077asmlinkage void do_cpu(struct pt_regs *regs) 1165asmlinkage void do_cpu(struct pt_regs *regs)
1078{ 1166{
1079 enum ctx_state prev_state; 1167 enum ctx_state prev_state;
@@ -1153,12 +1241,7 @@ asmlinkage void do_cpu(struct pt_regs *regs)
1153 /* Fall through. */ 1241 /* Fall through. */
1154 1242
1155 case 1: 1243 case 1:
1156 if (used_math()) /* Using the FPU again. */ 1244 err = enable_restore_fp_context(0);
1157 err = own_fpu(1);
1158 else { /* First time FPU user. */
1159 err = init_fpu();
1160 set_used_math();
1161 }
1162 1245
1163 if (!raw_cpu_has_fpu || err) { 1246 if (!raw_cpu_has_fpu || err) {
1164 int sig; 1247 int sig;
@@ -1183,6 +1266,37 @@ out:
1183 exception_exit(prev_state); 1266 exception_exit(prev_state);
1184} 1267}
1185 1268
1269asmlinkage void do_msa_fpe(struct pt_regs *regs)
1270{
1271 enum ctx_state prev_state;
1272
1273 prev_state = exception_enter();
1274 die_if_kernel("do_msa_fpe invoked from kernel context!", regs);
1275 force_sig(SIGFPE, current);
1276 exception_exit(prev_state);
1277}
1278
1279asmlinkage void do_msa(struct pt_regs *regs)
1280{
1281 enum ctx_state prev_state;
1282 int err;
1283
1284 prev_state = exception_enter();
1285
1286 if (!cpu_has_msa || test_thread_flag(TIF_32BIT_FPREGS)) {
1287 force_sig(SIGILL, current);
1288 goto out;
1289 }
1290
1291 die_if_kernel("do_msa invoked from kernel context!", regs);
1292
1293 err = enable_restore_fp_context(1);
1294 if (err)
1295 force_sig(SIGILL, current);
1296out:
1297 exception_exit(prev_state);
1298}
1299
1186asmlinkage void do_mdmx(struct pt_regs *regs) 1300asmlinkage void do_mdmx(struct pt_regs *regs)
1187{ 1301{
1188 enum ctx_state prev_state; 1302 enum ctx_state prev_state;
@@ -1337,8 +1451,10 @@ static inline void parity_protection_init(void)
1337 case CPU_34K: 1451 case CPU_34K:
1338 case CPU_74K: 1452 case CPU_74K:
1339 case CPU_1004K: 1453 case CPU_1004K:
1454 case CPU_1074K:
1340 case CPU_INTERAPTIV: 1455 case CPU_INTERAPTIV:
1341 case CPU_PROAPTIV: 1456 case CPU_PROAPTIV:
1457 case CPU_P5600:
1342 { 1458 {
1343#define ERRCTL_PE 0x80000000 1459#define ERRCTL_PE 0x80000000
1344#define ERRCTL_L2P 0x00800000 1460#define ERRCTL_L2P 0x00800000
@@ -2017,6 +2133,7 @@ void __init trap_init(void)
2017 set_except_vector(11, handle_cpu); 2133 set_except_vector(11, handle_cpu);
2018 set_except_vector(12, handle_ov); 2134 set_except_vector(12, handle_ov);
2019 set_except_vector(13, handle_tr); 2135 set_except_vector(13, handle_tr);
2136 set_except_vector(14, handle_msa_fpe);
2020 2137
2021 if (current_cpu_type() == CPU_R6000 || 2138 if (current_cpu_type() == CPU_R6000 ||
2022 current_cpu_type() == CPU_R6000A) { 2139 current_cpu_type() == CPU_R6000A) {
@@ -2040,6 +2157,7 @@ void __init trap_init(void)
2040 set_except_vector(15, handle_fpe); 2157 set_except_vector(15, handle_fpe);
2041 2158
2042 set_except_vector(16, handle_ftlb); 2159 set_except_vector(16, handle_ftlb);
2160 set_except_vector(21, handle_msa);
2043 set_except_vector(22, handle_mdmx); 2161 set_except_vector(22, handle_mdmx);
2044 2162
2045 if (cpu_has_mcheck) 2163 if (cpu_has_mcheck)
diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c
index c369a5d35527..2b3517214d6d 100644
--- a/arch/mips/kernel/unaligned.c
+++ b/arch/mips/kernel/unaligned.c
@@ -7,6 +7,7 @@
7 * 7 *
8 * Copyright (C) 1996, 1998, 1999, 2002 by Ralf Baechle 8 * Copyright (C) 1996, 1998, 1999, 2002 by Ralf Baechle
9 * Copyright (C) 1999 Silicon Graphics, Inc. 9 * Copyright (C) 1999 Silicon Graphics, Inc.
10 * Copyright (C) 2014 Imagination Technologies Ltd.
10 * 11 *
11 * This file contains exception handler for address error exception with the 12 * This file contains exception handler for address error exception with the
12 * special capability to execute faulting instructions in software. The 13 * special capability to execute faulting instructions in software. The
@@ -110,8 +111,8 @@ extern void show_registers(struct pt_regs *regs);
110#ifdef __BIG_ENDIAN 111#ifdef __BIG_ENDIAN
111#define LoadHW(addr, value, res) \ 112#define LoadHW(addr, value, res) \
112 __asm__ __volatile__ (".set\tnoat\n" \ 113 __asm__ __volatile__ (".set\tnoat\n" \
113 "1:\tlb\t%0, 0(%2)\n" \ 114 "1:\t"user_lb("%0", "0(%2)")"\n" \
114 "2:\tlbu\t$1, 1(%2)\n\t" \ 115 "2:\t"user_lbu("$1", "1(%2)")"\n\t" \
115 "sll\t%0, 0x8\n\t" \ 116 "sll\t%0, 0x8\n\t" \
116 "or\t%0, $1\n\t" \ 117 "or\t%0, $1\n\t" \
117 "li\t%1, 0\n" \ 118 "li\t%1, 0\n" \
@@ -130,8 +131,8 @@ extern void show_registers(struct pt_regs *regs);
130 131
131#define LoadW(addr, value, res) \ 132#define LoadW(addr, value, res) \
132 __asm__ __volatile__ ( \ 133 __asm__ __volatile__ ( \
133 "1:\tlwl\t%0, (%2)\n" \ 134 "1:\t"user_lwl("%0", "(%2)")"\n" \
134 "2:\tlwr\t%0, 3(%2)\n\t" \ 135 "2:\t"user_lwr("%0", "3(%2)")"\n\t" \
135 "li\t%1, 0\n" \ 136 "li\t%1, 0\n" \
136 "3:\n\t" \ 137 "3:\n\t" \
137 ".insn\n\t" \ 138 ".insn\n\t" \
@@ -149,8 +150,8 @@ extern void show_registers(struct pt_regs *regs);
149#define LoadHWU(addr, value, res) \ 150#define LoadHWU(addr, value, res) \
150 __asm__ __volatile__ ( \ 151 __asm__ __volatile__ ( \
151 ".set\tnoat\n" \ 152 ".set\tnoat\n" \
152 "1:\tlbu\t%0, 0(%2)\n" \ 153 "1:\t"user_lbu("%0", "0(%2)")"\n" \
153 "2:\tlbu\t$1, 1(%2)\n\t" \ 154 "2:\t"user_lbu("$1", "1(%2)")"\n\t" \
154 "sll\t%0, 0x8\n\t" \ 155 "sll\t%0, 0x8\n\t" \
155 "or\t%0, $1\n\t" \ 156 "or\t%0, $1\n\t" \
156 "li\t%1, 0\n" \ 157 "li\t%1, 0\n" \
@@ -170,8 +171,8 @@ extern void show_registers(struct pt_regs *regs);
170 171
171#define LoadWU(addr, value, res) \ 172#define LoadWU(addr, value, res) \
172 __asm__ __volatile__ ( \ 173 __asm__ __volatile__ ( \
173 "1:\tlwl\t%0, (%2)\n" \ 174 "1:\t"user_lwl("%0", "(%2)")"\n" \
174 "2:\tlwr\t%0, 3(%2)\n\t" \ 175 "2:\t"user_lwr("%0", "3(%2)")"\n\t" \
175 "dsll\t%0, %0, 32\n\t" \ 176 "dsll\t%0, %0, 32\n\t" \
176 "dsrl\t%0, %0, 32\n\t" \ 177 "dsrl\t%0, %0, 32\n\t" \
177 "li\t%1, 0\n" \ 178 "li\t%1, 0\n" \
@@ -209,9 +210,9 @@ extern void show_registers(struct pt_regs *regs);
209#define StoreHW(addr, value, res) \ 210#define StoreHW(addr, value, res) \
210 __asm__ __volatile__ ( \ 211 __asm__ __volatile__ ( \
211 ".set\tnoat\n" \ 212 ".set\tnoat\n" \
212 "1:\tsb\t%1, 1(%2)\n\t" \ 213 "1:\t"user_sb("%1", "1(%2)")"\n" \
213 "srl\t$1, %1, 0x8\n" \ 214 "srl\t$1, %1, 0x8\n" \
214 "2:\tsb\t$1, 0(%2)\n\t" \ 215 "2:\t"user_sb("$1", "0(%2)")"\n" \
215 ".set\tat\n\t" \ 216 ".set\tat\n\t" \
216 "li\t%0, 0\n" \ 217 "li\t%0, 0\n" \
217 "3:\n\t" \ 218 "3:\n\t" \
@@ -229,8 +230,8 @@ extern void show_registers(struct pt_regs *regs);
229 230
230#define StoreW(addr, value, res) \ 231#define StoreW(addr, value, res) \
231 __asm__ __volatile__ ( \ 232 __asm__ __volatile__ ( \
232 "1:\tswl\t%1,(%2)\n" \ 233 "1:\t"user_swl("%1", "(%2)")"\n" \
233 "2:\tswr\t%1, 3(%2)\n\t" \ 234 "2:\t"user_swr("%1", "3(%2)")"\n\t" \
234 "li\t%0, 0\n" \ 235 "li\t%0, 0\n" \
235 "3:\n\t" \ 236 "3:\n\t" \
236 ".insn\n\t" \ 237 ".insn\n\t" \
@@ -267,8 +268,8 @@ extern void show_registers(struct pt_regs *regs);
267#ifdef __LITTLE_ENDIAN 268#ifdef __LITTLE_ENDIAN
268#define LoadHW(addr, value, res) \ 269#define LoadHW(addr, value, res) \
269 __asm__ __volatile__ (".set\tnoat\n" \ 270 __asm__ __volatile__ (".set\tnoat\n" \
270 "1:\tlb\t%0, 1(%2)\n" \ 271 "1:\t"user_lb("%0", "1(%2)")"\n" \
271 "2:\tlbu\t$1, 0(%2)\n\t" \ 272 "2:\t"user_lbu("$1", "0(%2)")"\n\t" \
272 "sll\t%0, 0x8\n\t" \ 273 "sll\t%0, 0x8\n\t" \
273 "or\t%0, $1\n\t" \ 274 "or\t%0, $1\n\t" \
274 "li\t%1, 0\n" \ 275 "li\t%1, 0\n" \
@@ -287,8 +288,8 @@ extern void show_registers(struct pt_regs *regs);
287 288
288#define LoadW(addr, value, res) \ 289#define LoadW(addr, value, res) \
289 __asm__ __volatile__ ( \ 290 __asm__ __volatile__ ( \
290 "1:\tlwl\t%0, 3(%2)\n" \ 291 "1:\t"user_lwl("%0", "3(%2)")"\n" \
291 "2:\tlwr\t%0, (%2)\n\t" \ 292 "2:\t"user_lwr("%0", "(%2)")"\n\t" \
292 "li\t%1, 0\n" \ 293 "li\t%1, 0\n" \
293 "3:\n\t" \ 294 "3:\n\t" \
294 ".insn\n\t" \ 295 ".insn\n\t" \
@@ -306,8 +307,8 @@ extern void show_registers(struct pt_regs *regs);
306#define LoadHWU(addr, value, res) \ 307#define LoadHWU(addr, value, res) \
307 __asm__ __volatile__ ( \ 308 __asm__ __volatile__ ( \
308 ".set\tnoat\n" \ 309 ".set\tnoat\n" \
309 "1:\tlbu\t%0, 1(%2)\n" \ 310 "1:\t"user_lbu("%0", "1(%2)")"\n" \
310 "2:\tlbu\t$1, 0(%2)\n\t" \ 311 "2:\t"user_lbu("$1", "0(%2)")"\n\t" \
311 "sll\t%0, 0x8\n\t" \ 312 "sll\t%0, 0x8\n\t" \
312 "or\t%0, $1\n\t" \ 313 "or\t%0, $1\n\t" \
313 "li\t%1, 0\n" \ 314 "li\t%1, 0\n" \
@@ -327,8 +328,8 @@ extern void show_registers(struct pt_regs *regs);
327 328
328#define LoadWU(addr, value, res) \ 329#define LoadWU(addr, value, res) \
329 __asm__ __volatile__ ( \ 330 __asm__ __volatile__ ( \
330 "1:\tlwl\t%0, 3(%2)\n" \ 331 "1:\t"user_lwl("%0", "3(%2)")"\n" \
331 "2:\tlwr\t%0, (%2)\n\t" \ 332 "2:\t"user_lwr("%0", "(%2)")"\n\t" \
332 "dsll\t%0, %0, 32\n\t" \ 333 "dsll\t%0, %0, 32\n\t" \
333 "dsrl\t%0, %0, 32\n\t" \ 334 "dsrl\t%0, %0, 32\n\t" \
334 "li\t%1, 0\n" \ 335 "li\t%1, 0\n" \
@@ -366,9 +367,9 @@ extern void show_registers(struct pt_regs *regs);
366#define StoreHW(addr, value, res) \ 367#define StoreHW(addr, value, res) \
367 __asm__ __volatile__ ( \ 368 __asm__ __volatile__ ( \
368 ".set\tnoat\n" \ 369 ".set\tnoat\n" \
369 "1:\tsb\t%1, 0(%2)\n\t" \ 370 "1:\t"user_sb("%1", "0(%2)")"\n" \
370 "srl\t$1,%1, 0x8\n" \ 371 "srl\t$1,%1, 0x8\n" \
371 "2:\tsb\t$1, 1(%2)\n\t" \ 372 "2:\t"user_sb("$1", "1(%2)")"\n" \
372 ".set\tat\n\t" \ 373 ".set\tat\n\t" \
373 "li\t%0, 0\n" \ 374 "li\t%0, 0\n" \
374 "3:\n\t" \ 375 "3:\n\t" \
@@ -386,8 +387,8 @@ extern void show_registers(struct pt_regs *regs);
386 387
387#define StoreW(addr, value, res) \ 388#define StoreW(addr, value, res) \
388 __asm__ __volatile__ ( \ 389 __asm__ __volatile__ ( \
389 "1:\tswl\t%1, 3(%2)\n" \ 390 "1:\t"user_swl("%1", "3(%2)")"\n" \
390 "2:\tswr\t%1, (%2)\n\t" \ 391 "2:\t"user_swr("%1", "(%2)")"\n\t" \
391 "li\t%0, 0\n" \ 392 "li\t%0, 0\n" \
392 "3:\n\t" \ 393 "3:\n\t" \
393 ".insn\n\t" \ 394 ".insn\n\t" \
@@ -430,7 +431,9 @@ static void emulate_load_store_insn(struct pt_regs *regs,
430 unsigned long origpc; 431 unsigned long origpc;
431 unsigned long orig31; 432 unsigned long orig31;
432 void __user *fault_addr = NULL; 433 void __user *fault_addr = NULL;
433 434#ifdef CONFIG_EVA
435 mm_segment_t seg;
436#endif
434 origpc = (unsigned long)pc; 437 origpc = (unsigned long)pc;
435 orig31 = regs->regs[31]; 438 orig31 = regs->regs[31];
436 439
@@ -475,6 +478,88 @@ static void emulate_load_store_insn(struct pt_regs *regs,
475 * The remaining opcodes are the ones that are really of 478 * The remaining opcodes are the ones that are really of
476 * interest. 479 * interest.
477 */ 480 */
481#ifdef CONFIG_EVA
482 case spec3_op:
483 /*
484 * we can land here only from kernel accessing user memory,
485 * so we need to "switch" the address limit to user space, so
486 * address check can work properly.
487 */
488 seg = get_fs();
489 set_fs(USER_DS);
490 switch (insn.spec3_format.func) {
491 case lhe_op:
492 if (!access_ok(VERIFY_READ, addr, 2)) {
493 set_fs(seg);
494 goto sigbus;
495 }
496 LoadHW(addr, value, res);
497 if (res) {
498 set_fs(seg);
499 goto fault;
500 }
501 compute_return_epc(regs);
502 regs->regs[insn.spec3_format.rt] = value;
503 break;
504 case lwe_op:
505 if (!access_ok(VERIFY_READ, addr, 4)) {
506 set_fs(seg);
507 goto sigbus;
508 }
509 LoadW(addr, value, res);
510 if (res) {
511 set_fs(seg);
512 goto fault;
513 }
514 compute_return_epc(regs);
515 regs->regs[insn.spec3_format.rt] = value;
516 break;
517 case lhue_op:
518 if (!access_ok(VERIFY_READ, addr, 2)) {
519 set_fs(seg);
520 goto sigbus;
521 }
522 LoadHWU(addr, value, res);
523 if (res) {
524 set_fs(seg);
525 goto fault;
526 }
527 compute_return_epc(regs);
528 regs->regs[insn.spec3_format.rt] = value;
529 break;
530 case she_op:
531 if (!access_ok(VERIFY_WRITE, addr, 2)) {
532 set_fs(seg);
533 goto sigbus;
534 }
535 compute_return_epc(regs);
536 value = regs->regs[insn.spec3_format.rt];
537 StoreHW(addr, value, res);
538 if (res) {
539 set_fs(seg);
540 goto fault;
541 }
542 break;
543 case swe_op:
544 if (!access_ok(VERIFY_WRITE, addr, 4)) {
545 set_fs(seg);
546 goto sigbus;
547 }
548 compute_return_epc(regs);
549 value = regs->regs[insn.spec3_format.rt];
550 StoreW(addr, value, res);
551 if (res) {
552 set_fs(seg);
553 goto fault;
554 }
555 break;
556 default:
557 set_fs(seg);
558 goto sigill;
559 }
560 set_fs(seg);
561 break;
562#endif
478 case lh_op: 563 case lh_op:
479 if (!access_ok(VERIFY_READ, addr, 2)) 564 if (!access_ok(VERIFY_READ, addr, 2))
480 goto sigbus; 565 goto sigbus;
diff --git a/arch/mips/kvm/kvm_mips_emul.c b/arch/mips/kvm/kvm_mips_emul.c
index 4b6274b47f33..e3fec99941a7 100644
--- a/arch/mips/kvm/kvm_mips_emul.c
+++ b/arch/mips/kvm/kvm_mips_emul.c
@@ -436,13 +436,6 @@ kvm_mips_emulate_CP0(uint32_t inst, uint32_t *opc, uint32_t cause,
436 sel = inst & 0x7; 436 sel = inst & 0x7;
437 co_bit = (inst >> 25) & 1; 437 co_bit = (inst >> 25) & 1;
438 438
439 /* Verify that the register is valid */
440 if (rd > MIPS_CP0_DESAVE) {
441 printk("Invalid rd: %d\n", rd);
442 er = EMULATE_FAIL;
443 goto done;
444 }
445
446 if (co_bit) { 439 if (co_bit) {
447 op = (inst) & 0xff; 440 op = (inst) & 0xff;
448 441
@@ -1542,8 +1535,15 @@ kvm_mips_handle_ri(unsigned long cause, uint32_t *opc,
1542 } 1535 }
1543 1536
1544 if ((inst & OPCODE) == SPEC3 && (inst & FUNC) == RDHWR) { 1537 if ((inst & OPCODE) == SPEC3 && (inst & FUNC) == RDHWR) {
1538 int usermode = !KVM_GUEST_KERNEL_MODE(vcpu);
1545 int rd = (inst & RD) >> 11; 1539 int rd = (inst & RD) >> 11;
1546 int rt = (inst & RT) >> 16; 1540 int rt = (inst & RT) >> 16;
1541 /* If usermode, check RDHWR rd is allowed by guest HWREna */
1542 if (usermode && !(kvm_read_c0_guest_hwrena(cop0) & BIT(rd))) {
1543 kvm_debug("RDHWR %#x disallowed by HWREna @ %p\n",
1544 rd, opc);
1545 goto emulate_ri;
1546 }
1547 switch (rd) { 1547 switch (rd) {
1548 case 0: /* CPU number */ 1548 case 0: /* CPU number */
1549 arch->gprs[rt] = 0; 1549 arch->gprs[rt] = 0;
@@ -1567,31 +1567,27 @@ kvm_mips_handle_ri(unsigned long cause, uint32_t *opc,
1567 } 1567 }
1568 break; 1568 break;
1569 case 29: 1569 case 29:
1570#if 1
1571 arch->gprs[rt] = kvm_read_c0_guest_userlocal(cop0); 1570 arch->gprs[rt] = kvm_read_c0_guest_userlocal(cop0);
1572#else
1573 /* UserLocal not implemented */
1574 er = kvm_mips_emulate_ri_exc(cause, opc, run, vcpu);
1575#endif
1576 break; 1571 break;
1577 1572
1578 default: 1573 default:
1579 printk("RDHWR not supported\n"); 1574 kvm_debug("RDHWR %#x not supported @ %p\n", rd, opc);
1580 er = EMULATE_FAIL; 1575 goto emulate_ri;
1581 break;
1582 } 1576 }
1583 } else { 1577 } else {
1584 printk("Emulate RI not supported @ %p: %#x\n", opc, inst); 1578 kvm_debug("Emulate RI not supported @ %p: %#x\n", opc, inst);
1585 er = EMULATE_FAIL; 1579 goto emulate_ri;
1586 } 1580 }
1587 1581
1582 return EMULATE_DONE;
1583
1584emulate_ri:
1588 /* 1585 /*
1589 * Rollback PC only if emulation was unsuccessful 1586 * Rollback PC (if in branch delay slot then the PC already points to
1587 * branch target), and pass the RI exception to the guest OS.
1590 */ 1588 */
1591 if (er == EMULATE_FAIL) { 1589 vcpu->arch.pc = curr_pc;
1592 vcpu->arch.pc = curr_pc; 1590 return kvm_mips_emulate_ri_exc(cause, opc, run, vcpu);
1593 }
1594 return er;
1595} 1591}
1596 1592
1597enum emulation_result 1593enum emulation_result
diff --git a/arch/mips/lasat/picvue_proc.c b/arch/mips/lasat/picvue_proc.c
index 638c5db122c9..2bcd8391bc93 100644
--- a/arch/mips/lasat/picvue_proc.c
+++ b/arch/mips/lasat/picvue_proc.c
@@ -175,7 +175,7 @@ static void pvc_proc_cleanup(void)
175 remove_proc_entry("scroll", pvc_display_dir); 175 remove_proc_entry("scroll", pvc_display_dir);
176 remove_proc_entry(DISPLAY_DIR_NAME, NULL); 176 remove_proc_entry(DISPLAY_DIR_NAME, NULL);
177 177
178 del_timer(&timer); 178 del_timer_sync(&timer);
179} 179}
180 180
181static int __init pvc_proc_init(void) 181static int __init pvc_proc_init(void)
diff --git a/arch/mips/lib/csum_partial.S b/arch/mips/lib/csum_partial.S
index a6adffbb4e5f..2e4825e48388 100644
--- a/arch/mips/lib/csum_partial.S
+++ b/arch/mips/lib/csum_partial.S
@@ -8,6 +8,7 @@
8 * Copyright (C) 1998, 1999 Ralf Baechle 8 * Copyright (C) 1998, 1999 Ralf Baechle
9 * Copyright (C) 1999 Silicon Graphics, Inc. 9 * Copyright (C) 1999 Silicon Graphics, Inc.
10 * Copyright (C) 2007 Maciej W. Rozycki 10 * Copyright (C) 2007 Maciej W. Rozycki
11 * Copyright (C) 2014 Imagination Technologies Ltd.
11 */ 12 */
12#include <linux/errno.h> 13#include <linux/errno.h>
13#include <asm/asm.h> 14#include <asm/asm.h>
@@ -296,7 +297,7 @@ LEAF(csum_partial)
296 * checksum and copy routines based on memcpy.S 297 * checksum and copy routines based on memcpy.S
297 * 298 *
298 * csum_partial_copy_nocheck(src, dst, len, sum) 299 * csum_partial_copy_nocheck(src, dst, len, sum)
299 * __csum_partial_copy_user(src, dst, len, sum, errp) 300 * __csum_partial_copy_kernel(src, dst, len, sum, errp)
300 * 301 *
301 * See "Spec" in memcpy.S for details. Unlike __copy_user, all 302 * See "Spec" in memcpy.S for details. Unlike __copy_user, all
302 * function in this file use the standard calling convention. 303 * function in this file use the standard calling convention.
@@ -327,20 +328,58 @@ LEAF(csum_partial)
327 * These handlers do not need to overwrite any data. 328 * These handlers do not need to overwrite any data.
328 */ 329 */
329 330
330#define EXC(inst_reg,addr,handler) \ 331/* Instruction type */
3319: inst_reg, addr; \ 332#define LD_INSN 1
332 .section __ex_table,"a"; \ 333#define ST_INSN 2
333 PTR 9b, handler; \ 334#define LEGACY_MODE 1
334 .previous 335#define EVA_MODE 2
336#define USEROP 1
337#define KERNELOP 2
338
339/*
340 * Wrapper to add an entry in the exception table
341 * in case the insn causes a memory exception.
342 * Arguments:
343 * insn : Load/store instruction
344 * type : Instruction type
345 * reg : Register
346 * addr : Address
347 * handler : Exception handler
348 */
349#define EXC(insn, type, reg, addr, handler) \
350 .if \mode == LEGACY_MODE; \
3519: insn reg, addr; \
352 .section __ex_table,"a"; \
353 PTR 9b, handler; \
354 .previous; \
355 /* This is enabled in EVA mode */ \
356 .else; \
357 /* If loading from user or storing to user */ \
358 .if ((\from == USEROP) && (type == LD_INSN)) || \
359 ((\to == USEROP) && (type == ST_INSN)); \
3609: __BUILD_EVA_INSN(insn##e, reg, addr); \
361 .section __ex_table,"a"; \
362 PTR 9b, handler; \
363 .previous; \
364 .else; \
365 /* EVA without exception */ \
366 insn reg, addr; \
367 .endif; \
368 .endif
369
370#undef LOAD
335 371
336#ifdef USE_DOUBLE 372#ifdef USE_DOUBLE
337 373
338#define LOAD ld 374#define LOADK ld /* No exception */
339#define LOADL ldl 375#define LOAD(reg, addr, handler) EXC(ld, LD_INSN, reg, addr, handler)
340#define LOADR ldr 376#define LOADBU(reg, addr, handler) EXC(lbu, LD_INSN, reg, addr, handler)
341#define STOREL sdl 377#define LOADL(reg, addr, handler) EXC(ldl, LD_INSN, reg, addr, handler)
342#define STORER sdr 378#define LOADR(reg, addr, handler) EXC(ldr, LD_INSN, reg, addr, handler)
343#define STORE sd 379#define STOREB(reg, addr, handler) EXC(sb, ST_INSN, reg, addr, handler)
380#define STOREL(reg, addr, handler) EXC(sdl, ST_INSN, reg, addr, handler)
381#define STORER(reg, addr, handler) EXC(sdr, ST_INSN, reg, addr, handler)
382#define STORE(reg, addr, handler) EXC(sd, ST_INSN, reg, addr, handler)
344#define ADD daddu 383#define ADD daddu
345#define SUB dsubu 384#define SUB dsubu
346#define SRL dsrl 385#define SRL dsrl
@@ -352,12 +391,15 @@ LEAF(csum_partial)
352 391
353#else 392#else
354 393
355#define LOAD lw 394#define LOADK lw /* No exception */
356#define LOADL lwl 395#define LOAD(reg, addr, handler) EXC(lw, LD_INSN, reg, addr, handler)
357#define LOADR lwr 396#define LOADBU(reg, addr, handler) EXC(lbu, LD_INSN, reg, addr, handler)
358#define STOREL swl 397#define LOADL(reg, addr, handler) EXC(lwl, LD_INSN, reg, addr, handler)
359#define STORER swr 398#define LOADR(reg, addr, handler) EXC(lwr, LD_INSN, reg, addr, handler)
360#define STORE sw 399#define STOREB(reg, addr, handler) EXC(sb, ST_INSN, reg, addr, handler)
400#define STOREL(reg, addr, handler) EXC(swl, ST_INSN, reg, addr, handler)
401#define STORER(reg, addr, handler) EXC(swr, ST_INSN, reg, addr, handler)
402#define STORE(reg, addr, handler) EXC(sw, ST_INSN, reg, addr, handler)
361#define ADD addu 403#define ADD addu
362#define SUB subu 404#define SUB subu
363#define SRL srl 405#define SRL srl
@@ -396,14 +438,20 @@ LEAF(csum_partial)
396 .set at=v1 438 .set at=v1
397#endif 439#endif
398 440
399LEAF(__csum_partial_copy_user) 441 .macro __BUILD_CSUM_PARTIAL_COPY_USER mode, from, to, __nocheck
442
400 PTR_ADDU AT, src, len /* See (1) above. */ 443 PTR_ADDU AT, src, len /* See (1) above. */
444 /* initialize __nocheck if this the first time we execute this
445 * macro
446 */
401#ifdef CONFIG_64BIT 447#ifdef CONFIG_64BIT
402 move errptr, a4 448 move errptr, a4
403#else 449#else
404 lw errptr, 16(sp) 450 lw errptr, 16(sp)
405#endif 451#endif
406FEXPORT(csum_partial_copy_nocheck) 452 .if \__nocheck == 1
453 FEXPORT(csum_partial_copy_nocheck)
454 .endif
407 move sum, zero 455 move sum, zero
408 move odd, zero 456 move odd, zero
409 /* 457 /*
@@ -419,48 +467,48 @@ FEXPORT(csum_partial_copy_nocheck)
419 */ 467 */
420 sltu t2, len, NBYTES 468 sltu t2, len, NBYTES
421 and t1, dst, ADDRMASK 469 and t1, dst, ADDRMASK
422 bnez t2, .Lcopy_bytes_checklen 470 bnez t2, .Lcopy_bytes_checklen\@
423 and t0, src, ADDRMASK 471 and t0, src, ADDRMASK
424 andi odd, dst, 0x1 /* odd buffer? */ 472 andi odd, dst, 0x1 /* odd buffer? */
425 bnez t1, .Ldst_unaligned 473 bnez t1, .Ldst_unaligned\@
426 nop 474 nop
427 bnez t0, .Lsrc_unaligned_dst_aligned 475 bnez t0, .Lsrc_unaligned_dst_aligned\@
428 /* 476 /*
429 * use delay slot for fall-through 477 * use delay slot for fall-through
430 * src and dst are aligned; need to compute rem 478 * src and dst are aligned; need to compute rem
431 */ 479 */
432.Lboth_aligned: 480.Lboth_aligned\@:
433 SRL t0, len, LOG_NBYTES+3 # +3 for 8 units/iter 481 SRL t0, len, LOG_NBYTES+3 # +3 for 8 units/iter
434 beqz t0, .Lcleanup_both_aligned # len < 8*NBYTES 482 beqz t0, .Lcleanup_both_aligned\@ # len < 8*NBYTES
435 nop 483 nop
436 SUB len, 8*NBYTES # subtract here for bgez loop 484 SUB len, 8*NBYTES # subtract here for bgez loop
437 .align 4 485 .align 4
4381: 4861:
439EXC( LOAD t0, UNIT(0)(src), .Ll_exc) 487 LOAD(t0, UNIT(0)(src), .Ll_exc\@)
440EXC( LOAD t1, UNIT(1)(src), .Ll_exc_copy) 488 LOAD(t1, UNIT(1)(src), .Ll_exc_copy\@)
441EXC( LOAD t2, UNIT(2)(src), .Ll_exc_copy) 489 LOAD(t2, UNIT(2)(src), .Ll_exc_copy\@)
442EXC( LOAD t3, UNIT(3)(src), .Ll_exc_copy) 490 LOAD(t3, UNIT(3)(src), .Ll_exc_copy\@)
443EXC( LOAD t4, UNIT(4)(src), .Ll_exc_copy) 491 LOAD(t4, UNIT(4)(src), .Ll_exc_copy\@)
444EXC( LOAD t5, UNIT(5)(src), .Ll_exc_copy) 492 LOAD(t5, UNIT(5)(src), .Ll_exc_copy\@)
445EXC( LOAD t6, UNIT(6)(src), .Ll_exc_copy) 493 LOAD(t6, UNIT(6)(src), .Ll_exc_copy\@)
446EXC( LOAD t7, UNIT(7)(src), .Ll_exc_copy) 494 LOAD(t7, UNIT(7)(src), .Ll_exc_copy\@)
447 SUB len, len, 8*NBYTES 495 SUB len, len, 8*NBYTES
448 ADD src, src, 8*NBYTES 496 ADD src, src, 8*NBYTES
449EXC( STORE t0, UNIT(0)(dst), .Ls_exc) 497 STORE(t0, UNIT(0)(dst), .Ls_exc\@)
450 ADDC(sum, t0) 498 ADDC(sum, t0)
451EXC( STORE t1, UNIT(1)(dst), .Ls_exc) 499 STORE(t1, UNIT(1)(dst), .Ls_exc\@)
452 ADDC(sum, t1) 500 ADDC(sum, t1)
453EXC( STORE t2, UNIT(2)(dst), .Ls_exc) 501 STORE(t2, UNIT(2)(dst), .Ls_exc\@)
454 ADDC(sum, t2) 502 ADDC(sum, t2)
455EXC( STORE t3, UNIT(3)(dst), .Ls_exc) 503 STORE(t3, UNIT(3)(dst), .Ls_exc\@)
456 ADDC(sum, t3) 504 ADDC(sum, t3)
457EXC( STORE t4, UNIT(4)(dst), .Ls_exc) 505 STORE(t4, UNIT(4)(dst), .Ls_exc\@)
458 ADDC(sum, t4) 506 ADDC(sum, t4)
459EXC( STORE t5, UNIT(5)(dst), .Ls_exc) 507 STORE(t5, UNIT(5)(dst), .Ls_exc\@)
460 ADDC(sum, t5) 508 ADDC(sum, t5)
461EXC( STORE t6, UNIT(6)(dst), .Ls_exc) 509 STORE(t6, UNIT(6)(dst), .Ls_exc\@)
462 ADDC(sum, t6) 510 ADDC(sum, t6)
463EXC( STORE t7, UNIT(7)(dst), .Ls_exc) 511 STORE(t7, UNIT(7)(dst), .Ls_exc\@)
464 ADDC(sum, t7) 512 ADDC(sum, t7)
465 .set reorder /* DADDI_WAR */ 513 .set reorder /* DADDI_WAR */
466 ADD dst, dst, 8*NBYTES 514 ADD dst, dst, 8*NBYTES
@@ -471,44 +519,44 @@ EXC( STORE t7, UNIT(7)(dst), .Ls_exc)
471 /* 519 /*
472 * len == the number of bytes left to copy < 8*NBYTES 520 * len == the number of bytes left to copy < 8*NBYTES
473 */ 521 */
474.Lcleanup_both_aligned: 522.Lcleanup_both_aligned\@:
475#define rem t7 523#define rem t7
476 beqz len, .Ldone 524 beqz len, .Ldone\@
477 sltu t0, len, 4*NBYTES 525 sltu t0, len, 4*NBYTES
478 bnez t0, .Lless_than_4units 526 bnez t0, .Lless_than_4units\@
479 and rem, len, (NBYTES-1) # rem = len % NBYTES 527 and rem, len, (NBYTES-1) # rem = len % NBYTES
480 /* 528 /*
481 * len >= 4*NBYTES 529 * len >= 4*NBYTES
482 */ 530 */
483EXC( LOAD t0, UNIT(0)(src), .Ll_exc) 531 LOAD(t0, UNIT(0)(src), .Ll_exc\@)
484EXC( LOAD t1, UNIT(1)(src), .Ll_exc_copy) 532 LOAD(t1, UNIT(1)(src), .Ll_exc_copy\@)
485EXC( LOAD t2, UNIT(2)(src), .Ll_exc_copy) 533 LOAD(t2, UNIT(2)(src), .Ll_exc_copy\@)
486EXC( LOAD t3, UNIT(3)(src), .Ll_exc_copy) 534 LOAD(t3, UNIT(3)(src), .Ll_exc_copy\@)
487 SUB len, len, 4*NBYTES 535 SUB len, len, 4*NBYTES
488 ADD src, src, 4*NBYTES 536 ADD src, src, 4*NBYTES
489EXC( STORE t0, UNIT(0)(dst), .Ls_exc) 537 STORE(t0, UNIT(0)(dst), .Ls_exc\@)
490 ADDC(sum, t0) 538 ADDC(sum, t0)
491EXC( STORE t1, UNIT(1)(dst), .Ls_exc) 539 STORE(t1, UNIT(1)(dst), .Ls_exc\@)
492 ADDC(sum, t1) 540 ADDC(sum, t1)
493EXC( STORE t2, UNIT(2)(dst), .Ls_exc) 541 STORE(t2, UNIT(2)(dst), .Ls_exc\@)
494 ADDC(sum, t2) 542 ADDC(sum, t2)
495EXC( STORE t3, UNIT(3)(dst), .Ls_exc) 543 STORE(t3, UNIT(3)(dst), .Ls_exc\@)
496 ADDC(sum, t3) 544 ADDC(sum, t3)
497 .set reorder /* DADDI_WAR */ 545 .set reorder /* DADDI_WAR */
498 ADD dst, dst, 4*NBYTES 546 ADD dst, dst, 4*NBYTES
499 beqz len, .Ldone 547 beqz len, .Ldone\@
500 .set noreorder 548 .set noreorder
501.Lless_than_4units: 549.Lless_than_4units\@:
502 /* 550 /*
503 * rem = len % NBYTES 551 * rem = len % NBYTES
504 */ 552 */
505 beq rem, len, .Lcopy_bytes 553 beq rem, len, .Lcopy_bytes\@
506 nop 554 nop
5071: 5551:
508EXC( LOAD t0, 0(src), .Ll_exc) 556 LOAD(t0, 0(src), .Ll_exc\@)
509 ADD src, src, NBYTES 557 ADD src, src, NBYTES
510 SUB len, len, NBYTES 558 SUB len, len, NBYTES
511EXC( STORE t0, 0(dst), .Ls_exc) 559 STORE(t0, 0(dst), .Ls_exc\@)
512 ADDC(sum, t0) 560 ADDC(sum, t0)
513 .set reorder /* DADDI_WAR */ 561 .set reorder /* DADDI_WAR */
514 ADD dst, dst, NBYTES 562 ADD dst, dst, NBYTES
@@ -527,20 +575,20 @@ EXC( STORE t0, 0(dst), .Ls_exc)
527 * more instruction-level parallelism. 575 * more instruction-level parallelism.
528 */ 576 */
529#define bits t2 577#define bits t2
530 beqz len, .Ldone 578 beqz len, .Ldone\@
531 ADD t1, dst, len # t1 is just past last byte of dst 579 ADD t1, dst, len # t1 is just past last byte of dst
532 li bits, 8*NBYTES 580 li bits, 8*NBYTES
533 SLL rem, len, 3 # rem = number of bits to keep 581 SLL rem, len, 3 # rem = number of bits to keep
534EXC( LOAD t0, 0(src), .Ll_exc) 582 LOAD(t0, 0(src), .Ll_exc\@)
535 SUB bits, bits, rem # bits = number of bits to discard 583 SUB bits, bits, rem # bits = number of bits to discard
536 SHIFT_DISCARD t0, t0, bits 584 SHIFT_DISCARD t0, t0, bits
537EXC( STREST t0, -1(t1), .Ls_exc) 585 STREST(t0, -1(t1), .Ls_exc\@)
538 SHIFT_DISCARD_REVERT t0, t0, bits 586 SHIFT_DISCARD_REVERT t0, t0, bits
539 .set reorder 587 .set reorder
540 ADDC(sum, t0) 588 ADDC(sum, t0)
541 b .Ldone 589 b .Ldone\@
542 .set noreorder 590 .set noreorder
543.Ldst_unaligned: 591.Ldst_unaligned\@:
544 /* 592 /*
545 * dst is unaligned 593 * dst is unaligned
546 * t0 = src & ADDRMASK 594 * t0 = src & ADDRMASK
@@ -551,25 +599,25 @@ EXC( STREST t0, -1(t1), .Ls_exc)
551 * Set match = (src and dst have same alignment) 599 * Set match = (src and dst have same alignment)
552 */ 600 */
553#define match rem 601#define match rem
554EXC( LDFIRST t3, FIRST(0)(src), .Ll_exc) 602 LDFIRST(t3, FIRST(0)(src), .Ll_exc\@)
555 ADD t2, zero, NBYTES 603 ADD t2, zero, NBYTES
556EXC( LDREST t3, REST(0)(src), .Ll_exc_copy) 604 LDREST(t3, REST(0)(src), .Ll_exc_copy\@)
557 SUB t2, t2, t1 # t2 = number of bytes copied 605 SUB t2, t2, t1 # t2 = number of bytes copied
558 xor match, t0, t1 606 xor match, t0, t1
559EXC( STFIRST t3, FIRST(0)(dst), .Ls_exc) 607 STFIRST(t3, FIRST(0)(dst), .Ls_exc\@)
560 SLL t4, t1, 3 # t4 = number of bits to discard 608 SLL t4, t1, 3 # t4 = number of bits to discard
561 SHIFT_DISCARD t3, t3, t4 609 SHIFT_DISCARD t3, t3, t4
562 /* no SHIFT_DISCARD_REVERT to handle odd buffer properly */ 610 /* no SHIFT_DISCARD_REVERT to handle odd buffer properly */
563 ADDC(sum, t3) 611 ADDC(sum, t3)
564 beq len, t2, .Ldone 612 beq len, t2, .Ldone\@
565 SUB len, len, t2 613 SUB len, len, t2
566 ADD dst, dst, t2 614 ADD dst, dst, t2
567 beqz match, .Lboth_aligned 615 beqz match, .Lboth_aligned\@
568 ADD src, src, t2 616 ADD src, src, t2
569 617
570.Lsrc_unaligned_dst_aligned: 618.Lsrc_unaligned_dst_aligned\@:
571 SRL t0, len, LOG_NBYTES+2 # +2 for 4 units/iter 619 SRL t0, len, LOG_NBYTES+2 # +2 for 4 units/iter
572 beqz t0, .Lcleanup_src_unaligned 620 beqz t0, .Lcleanup_src_unaligned\@
573 and rem, len, (4*NBYTES-1) # rem = len % 4*NBYTES 621 and rem, len, (4*NBYTES-1) # rem = len % 4*NBYTES
5741: 6221:
575/* 623/*
@@ -578,53 +626,53 @@ EXC( STFIRST t3, FIRST(0)(dst), .Ls_exc)
578 * It's OK to load FIRST(N+1) before REST(N) because the two addresses 626 * It's OK to load FIRST(N+1) before REST(N) because the two addresses
579 * are to the same unit (unless src is aligned, but it's not). 627 * are to the same unit (unless src is aligned, but it's not).
580 */ 628 */
581EXC( LDFIRST t0, FIRST(0)(src), .Ll_exc) 629 LDFIRST(t0, FIRST(0)(src), .Ll_exc\@)
582EXC( LDFIRST t1, FIRST(1)(src), .Ll_exc_copy) 630 LDFIRST(t1, FIRST(1)(src), .Ll_exc_copy\@)
583 SUB len, len, 4*NBYTES 631 SUB len, len, 4*NBYTES
584EXC( LDREST t0, REST(0)(src), .Ll_exc_copy) 632 LDREST(t0, REST(0)(src), .Ll_exc_copy\@)
585EXC( LDREST t1, REST(1)(src), .Ll_exc_copy) 633 LDREST(t1, REST(1)(src), .Ll_exc_copy\@)
586EXC( LDFIRST t2, FIRST(2)(src), .Ll_exc_copy) 634 LDFIRST(t2, FIRST(2)(src), .Ll_exc_copy\@)
587EXC( LDFIRST t3, FIRST(3)(src), .Ll_exc_copy) 635 LDFIRST(t3, FIRST(3)(src), .Ll_exc_copy\@)
588EXC( LDREST t2, REST(2)(src), .Ll_exc_copy) 636 LDREST(t2, REST(2)(src), .Ll_exc_copy\@)
589EXC( LDREST t3, REST(3)(src), .Ll_exc_copy) 637 LDREST(t3, REST(3)(src), .Ll_exc_copy\@)
590 ADD src, src, 4*NBYTES 638 ADD src, src, 4*NBYTES
591#ifdef CONFIG_CPU_SB1 639#ifdef CONFIG_CPU_SB1
592 nop # improves slotting 640 nop # improves slotting
593#endif 641#endif
594EXC( STORE t0, UNIT(0)(dst), .Ls_exc) 642 STORE(t0, UNIT(0)(dst), .Ls_exc\@)
595 ADDC(sum, t0) 643 ADDC(sum, t0)
596EXC( STORE t1, UNIT(1)(dst), .Ls_exc) 644 STORE(t1, UNIT(1)(dst), .Ls_exc\@)
597 ADDC(sum, t1) 645 ADDC(sum, t1)
598EXC( STORE t2, UNIT(2)(dst), .Ls_exc) 646 STORE(t2, UNIT(2)(dst), .Ls_exc\@)
599 ADDC(sum, t2) 647 ADDC(sum, t2)
600EXC( STORE t3, UNIT(3)(dst), .Ls_exc) 648 STORE(t3, UNIT(3)(dst), .Ls_exc\@)
601 ADDC(sum, t3) 649 ADDC(sum, t3)
602 .set reorder /* DADDI_WAR */ 650 .set reorder /* DADDI_WAR */
603 ADD dst, dst, 4*NBYTES 651 ADD dst, dst, 4*NBYTES
604 bne len, rem, 1b 652 bne len, rem, 1b
605 .set noreorder 653 .set noreorder
606 654
607.Lcleanup_src_unaligned: 655.Lcleanup_src_unaligned\@:
608 beqz len, .Ldone 656 beqz len, .Ldone\@
609 and rem, len, NBYTES-1 # rem = len % NBYTES 657 and rem, len, NBYTES-1 # rem = len % NBYTES
610 beq rem, len, .Lcopy_bytes 658 beq rem, len, .Lcopy_bytes\@
611 nop 659 nop
6121: 6601:
613EXC( LDFIRST t0, FIRST(0)(src), .Ll_exc) 661 LDFIRST(t0, FIRST(0)(src), .Ll_exc\@)
614EXC( LDREST t0, REST(0)(src), .Ll_exc_copy) 662 LDREST(t0, REST(0)(src), .Ll_exc_copy\@)
615 ADD src, src, NBYTES 663 ADD src, src, NBYTES
616 SUB len, len, NBYTES 664 SUB len, len, NBYTES
617EXC( STORE t0, 0(dst), .Ls_exc) 665 STORE(t0, 0(dst), .Ls_exc\@)
618 ADDC(sum, t0) 666 ADDC(sum, t0)
619 .set reorder /* DADDI_WAR */ 667 .set reorder /* DADDI_WAR */
620 ADD dst, dst, NBYTES 668 ADD dst, dst, NBYTES
621 bne len, rem, 1b 669 bne len, rem, 1b
622 .set noreorder 670 .set noreorder
623 671
624.Lcopy_bytes_checklen: 672.Lcopy_bytes_checklen\@:
625 beqz len, .Ldone 673 beqz len, .Ldone\@
626 nop 674 nop
627.Lcopy_bytes: 675.Lcopy_bytes\@:
628 /* 0 < len < NBYTES */ 676 /* 0 < len < NBYTES */
629#ifdef CONFIG_CPU_LITTLE_ENDIAN 677#ifdef CONFIG_CPU_LITTLE_ENDIAN
630#define SHIFT_START 0 678#define SHIFT_START 0
@@ -637,12 +685,12 @@ EXC( STORE t0, 0(dst), .Ls_exc)
637 li t3, SHIFT_START # shift 685 li t3, SHIFT_START # shift
638/* use .Ll_exc_copy here to return correct sum on fault */ 686/* use .Ll_exc_copy here to return correct sum on fault */
639#define COPY_BYTE(N) \ 687#define COPY_BYTE(N) \
640EXC( lbu t0, N(src), .Ll_exc_copy); \ 688 LOADBU(t0, N(src), .Ll_exc_copy\@); \
641 SUB len, len, 1; \ 689 SUB len, len, 1; \
642EXC( sb t0, N(dst), .Ls_exc); \ 690 STOREB(t0, N(dst), .Ls_exc\@); \
643 SLLV t0, t0, t3; \ 691 SLLV t0, t0, t3; \
644 addu t3, SHIFT_INC; \ 692 addu t3, SHIFT_INC; \
645 beqz len, .Lcopy_bytes_done; \ 693 beqz len, .Lcopy_bytes_done\@; \
646 or t2, t0 694 or t2, t0
647 695
648 COPY_BYTE(0) 696 COPY_BYTE(0)
@@ -653,14 +701,14 @@ EXC( sb t0, N(dst), .Ls_exc); \
653 COPY_BYTE(4) 701 COPY_BYTE(4)
654 COPY_BYTE(5) 702 COPY_BYTE(5)
655#endif 703#endif
656EXC( lbu t0, NBYTES-2(src), .Ll_exc_copy) 704 LOADBU(t0, NBYTES-2(src), .Ll_exc_copy\@)
657 SUB len, len, 1 705 SUB len, len, 1
658EXC( sb t0, NBYTES-2(dst), .Ls_exc) 706 STOREB(t0, NBYTES-2(dst), .Ls_exc\@)
659 SLLV t0, t0, t3 707 SLLV t0, t0, t3
660 or t2, t0 708 or t2, t0
661.Lcopy_bytes_done: 709.Lcopy_bytes_done\@:
662 ADDC(sum, t2) 710 ADDC(sum, t2)
663.Ldone: 711.Ldone\@:
664 /* fold checksum */ 712 /* fold checksum */
665#ifdef USE_DOUBLE 713#ifdef USE_DOUBLE
666 dsll32 v1, sum, 0 714 dsll32 v1, sum, 0
@@ -689,7 +737,7 @@ EXC( sb t0, NBYTES-2(dst), .Ls_exc)
689 jr ra 737 jr ra
690 .set noreorder 738 .set noreorder
691 739
692.Ll_exc_copy: 740.Ll_exc_copy\@:
693 /* 741 /*
694 * Copy bytes from src until faulting load address (or until a 742 * Copy bytes from src until faulting load address (or until a
695 * lb faults) 743 * lb faults)
@@ -700,11 +748,11 @@ EXC( sb t0, NBYTES-2(dst), .Ls_exc)
700 * 748 *
701 * Assumes src < THREAD_BUADDR($28) 749 * Assumes src < THREAD_BUADDR($28)
702 */ 750 */
703 LOAD t0, TI_TASK($28) 751 LOADK t0, TI_TASK($28)
704 li t2, SHIFT_START 752 li t2, SHIFT_START
705 LOAD t0, THREAD_BUADDR(t0) 753 LOADK t0, THREAD_BUADDR(t0)
7061: 7541:
707EXC( lbu t1, 0(src), .Ll_exc) 755 LOADBU(t1, 0(src), .Ll_exc\@)
708 ADD src, src, 1 756 ADD src, src, 1
709 sb t1, 0(dst) # can't fault -- we're copy_from_user 757 sb t1, 0(dst) # can't fault -- we're copy_from_user
710 SLLV t1, t1, t2 758 SLLV t1, t1, t2
@@ -714,10 +762,10 @@ EXC( lbu t1, 0(src), .Ll_exc)
714 ADD dst, dst, 1 762 ADD dst, dst, 1
715 bne src, t0, 1b 763 bne src, t0, 1b
716 .set noreorder 764 .set noreorder
717.Ll_exc: 765.Ll_exc\@:
718 LOAD t0, TI_TASK($28) 766 LOADK t0, TI_TASK($28)
719 nop 767 nop
720 LOAD t0, THREAD_BUADDR(t0) # t0 is just past last good address 768 LOADK t0, THREAD_BUADDR(t0) # t0 is just past last good address
721 nop 769 nop
722 SUB len, AT, t0 # len number of uncopied bytes 770 SUB len, AT, t0 # len number of uncopied bytes
723 /* 771 /*
@@ -733,7 +781,7 @@ EXC( lbu t1, 0(src), .Ll_exc)
733 */ 781 */
734 .set reorder /* DADDI_WAR */ 782 .set reorder /* DADDI_WAR */
735 SUB src, len, 1 783 SUB src, len, 1
736 beqz len, .Ldone 784 beqz len, .Ldone\@
737 .set noreorder 785 .set noreorder
7381: sb zero, 0(dst) 7861: sb zero, 0(dst)
739 ADD dst, dst, 1 787 ADD dst, dst, 1
@@ -748,13 +796,31 @@ EXC( lbu t1, 0(src), .Ll_exc)
748 SUB src, src, v1 796 SUB src, src, v1
749#endif 797#endif
750 li v1, -EFAULT 798 li v1, -EFAULT
751 b .Ldone 799 b .Ldone\@
752 sw v1, (errptr) 800 sw v1, (errptr)
753 801
754.Ls_exc: 802.Ls_exc\@:
755 li v0, -1 /* invalid checksum */ 803 li v0, -1 /* invalid checksum */
756 li v1, -EFAULT 804 li v1, -EFAULT
757 jr ra 805 jr ra
758 sw v1, (errptr) 806 sw v1, (errptr)
759 .set pop 807 .set pop
760 END(__csum_partial_copy_user) 808 .endm
809
810LEAF(__csum_partial_copy_kernel)
811#ifndef CONFIG_EVA
812FEXPORT(__csum_partial_copy_to_user)
813FEXPORT(__csum_partial_copy_from_user)
814#endif
815__BUILD_CSUM_PARTIAL_COPY_USER LEGACY_MODE USEROP USEROP 1
816END(__csum_partial_copy_kernel)
817
818#ifdef CONFIG_EVA
819LEAF(__csum_partial_copy_to_user)
820__BUILD_CSUM_PARTIAL_COPY_USER EVA_MODE KERNELOP USEROP 0
821END(__csum_partial_copy_to_user)
822
823LEAF(__csum_partial_copy_from_user)
824__BUILD_CSUM_PARTIAL_COPY_USER EVA_MODE USEROP KERNELOP 0
825END(__csum_partial_copy_from_user)
826#endif
diff --git a/arch/mips/lib/memcpy.S b/arch/mips/lib/memcpy.S
index c5c40dad0bbf..c17ef80cf65a 100644
--- a/arch/mips/lib/memcpy.S
+++ b/arch/mips/lib/memcpy.S
@@ -10,6 +10,7 @@
10 * Copyright (C) 2002 Broadcom, Inc. 10 * Copyright (C) 2002 Broadcom, Inc.
11 * memcpy/copy_user author: Mark Vandevoorde 11 * memcpy/copy_user author: Mark Vandevoorde
12 * Copyright (C) 2007 Maciej W. Rozycki 12 * Copyright (C) 2007 Maciej W. Rozycki
13 * Copyright (C) 2014 Imagination Technologies Ltd.
13 * 14 *
14 * Mnemonic names for arguments to memcpy/__copy_user 15 * Mnemonic names for arguments to memcpy/__copy_user
15 */ 16 */
@@ -85,11 +86,51 @@
85 * they're not protected. 86 * they're not protected.
86 */ 87 */
87 88
88#define EXC(inst_reg,addr,handler) \ 89/* Instruction type */
899: inst_reg, addr; \ 90#define LD_INSN 1
90 .section __ex_table,"a"; \ 91#define ST_INSN 2
91 PTR 9b, handler; \ 92/* Pretech type */
92 .previous 93#define SRC_PREFETCH 1
94#define DST_PREFETCH 2
95#define LEGACY_MODE 1
96#define EVA_MODE 2
97#define USEROP 1
98#define KERNELOP 2
99
100/*
101 * Wrapper to add an entry in the exception table
102 * in case the insn causes a memory exception.
103 * Arguments:
104 * insn : Load/store instruction
105 * type : Instruction type
106 * reg : Register
107 * addr : Address
108 * handler : Exception handler
109 */
110
111#define EXC(insn, type, reg, addr, handler) \
112 .if \mode == LEGACY_MODE; \
1139: insn reg, addr; \
114 .section __ex_table,"a"; \
115 PTR 9b, handler; \
116 .previous; \
117 /* This is assembled in EVA mode */ \
118 .else; \
119 /* If loading from user or storing to user */ \
120 .if ((\from == USEROP) && (type == LD_INSN)) || \
121 ((\to == USEROP) && (type == ST_INSN)); \
1229: __BUILD_EVA_INSN(insn##e, reg, addr); \
123 .section __ex_table,"a"; \
124 PTR 9b, handler; \
125 .previous; \
126 .else; \
127 /* \
128 * Still in EVA, but no need for \
129 * exception handler or EVA insn \
130 */ \
131 insn reg, addr; \
132 .endif; \
133 .endif
93 134
94/* 135/*
95 * Only on the 64-bit kernel we can made use of 64-bit registers. 136 * Only on the 64-bit kernel we can made use of 64-bit registers.
@@ -100,12 +141,13 @@
100 141
101#ifdef USE_DOUBLE 142#ifdef USE_DOUBLE
102 143
103#define LOAD ld 144#define LOADK ld /* No exception */
104#define LOADL ldl 145#define LOAD(reg, addr, handler) EXC(ld, LD_INSN, reg, addr, handler)
105#define LOADR ldr 146#define LOADL(reg, addr, handler) EXC(ldl, LD_INSN, reg, addr, handler)
106#define STOREL sdl 147#define LOADR(reg, addr, handler) EXC(ldr, LD_INSN, reg, addr, handler)
107#define STORER sdr 148#define STOREL(reg, addr, handler) EXC(sdl, ST_INSN, reg, addr, handler)
108#define STORE sd 149#define STORER(reg, addr, handler) EXC(sdr, ST_INSN, reg, addr, handler)
150#define STORE(reg, addr, handler) EXC(sd, ST_INSN, reg, addr, handler)
109#define ADD daddu 151#define ADD daddu
110#define SUB dsubu 152#define SUB dsubu
111#define SRL dsrl 153#define SRL dsrl
@@ -136,12 +178,13 @@
136 178
137#else 179#else
138 180
139#define LOAD lw 181#define LOADK lw /* No exception */
140#define LOADL lwl 182#define LOAD(reg, addr, handler) EXC(lw, LD_INSN, reg, addr, handler)
141#define LOADR lwr 183#define LOADL(reg, addr, handler) EXC(lwl, LD_INSN, reg, addr, handler)
142#define STOREL swl 184#define LOADR(reg, addr, handler) EXC(lwr, LD_INSN, reg, addr, handler)
143#define STORER swr 185#define STOREL(reg, addr, handler) EXC(swl, ST_INSN, reg, addr, handler)
144#define STORE sw 186#define STORER(reg, addr, handler) EXC(swr, ST_INSN, reg, addr, handler)
187#define STORE(reg, addr, handler) EXC(sw, ST_INSN, reg, addr, handler)
145#define ADD addu 188#define ADD addu
146#define SUB subu 189#define SUB subu
147#define SRL srl 190#define SRL srl
@@ -154,6 +197,33 @@
154 197
155#endif /* USE_DOUBLE */ 198#endif /* USE_DOUBLE */
156 199
200#define LOADB(reg, addr, handler) EXC(lb, LD_INSN, reg, addr, handler)
201#define STOREB(reg, addr, handler) EXC(sb, ST_INSN, reg, addr, handler)
202
203#define _PREF(hint, addr, type) \
204 .if \mode == LEGACY_MODE; \
205 PREF(hint, addr); \
206 .else; \
207 .if ((\from == USEROP) && (type == SRC_PREFETCH)) || \
208 ((\to == USEROP) && (type == DST_PREFETCH)); \
209 /* \
210 * PREFE has only 9 bits for the offset \
211 * compared to PREF which has 16, so it may \
212 * need to use the $at register but this \
213 * register should remain intact because it's \
214 * used later on. Therefore use $v1. \
215 */ \
216 .set at=v1; \
217 PREFE(hint, addr); \
218 .set noat; \
219 .else; \
220 PREF(hint, addr); \
221 .endif; \
222 .endif
223
224#define PREFS(hint, addr) _PREF(hint, addr, SRC_PREFETCH)
225#define PREFD(hint, addr) _PREF(hint, addr, DST_PREFETCH)
226
157#ifdef CONFIG_CPU_LITTLE_ENDIAN 227#ifdef CONFIG_CPU_LITTLE_ENDIAN
158#define LDFIRST LOADR 228#define LDFIRST LOADR
159#define LDREST LOADL 229#define LDREST LOADL
@@ -182,27 +252,23 @@
182 .set at=v1 252 .set at=v1
183#endif 253#endif
184 254
185/*
186 * t6 is used as a flag to note inatomic mode.
187 */
188LEAF(__copy_user_inatomic)
189 b __copy_user_common
190 li t6, 1
191 END(__copy_user_inatomic)
192
193/*
194 * A combined memcpy/__copy_user
195 * __copy_user sets len to 0 for success; else to an upper bound of
196 * the number of uncopied bytes.
197 * memcpy sets v0 to dst.
198 */
199 .align 5 255 .align 5
200LEAF(memcpy) /* a0=dst a1=src a2=len */ 256
201 move v0, dst /* return value */ 257 /*
202.L__memcpy: 258 * Macro to build the __copy_user common code
203FEXPORT(__copy_user) 259 * Arguements:
204 li t6, 0 /* not inatomic */ 260 * mode : LEGACY_MODE or EVA_MODE
205__copy_user_common: 261 * from : Source operand. USEROP or KERNELOP
262 * to : Destination operand. USEROP or KERNELOP
263 */
264 .macro __BUILD_COPY_USER mode, from, to
265
266 /* initialize __memcpy if this the first time we execute this macro */
267 .ifnotdef __memcpy
268 .set __memcpy, 1
269 .hidden __memcpy /* make sure it does not leak */
270 .endif
271
206 /* 272 /*
207 * Note: dst & src may be unaligned, len may be 0 273 * Note: dst & src may be unaligned, len may be 0
208 * Temps 274 * Temps
@@ -217,94 +283,94 @@ __copy_user_common:
217 * 283 *
218 * If len < NBYTES use byte operations. 284 * If len < NBYTES use byte operations.
219 */ 285 */
220 PREF( 0, 0(src) ) 286 PREFS( 0, 0(src) )
221 PREF( 1, 0(dst) ) 287 PREFD( 1, 0(dst) )
222 sltu t2, len, NBYTES 288 sltu t2, len, NBYTES
223 and t1, dst, ADDRMASK 289 and t1, dst, ADDRMASK
224 PREF( 0, 1*32(src) ) 290 PREFS( 0, 1*32(src) )
225 PREF( 1, 1*32(dst) ) 291 PREFD( 1, 1*32(dst) )
226 bnez t2, .Lcopy_bytes_checklen 292 bnez t2, .Lcopy_bytes_checklen\@
227 and t0, src, ADDRMASK 293 and t0, src, ADDRMASK
228 PREF( 0, 2*32(src) ) 294 PREFS( 0, 2*32(src) )
229 PREF( 1, 2*32(dst) ) 295 PREFD( 1, 2*32(dst) )
230 bnez t1, .Ldst_unaligned 296 bnez t1, .Ldst_unaligned\@
231 nop 297 nop
232 bnez t0, .Lsrc_unaligned_dst_aligned 298 bnez t0, .Lsrc_unaligned_dst_aligned\@
233 /* 299 /*
234 * use delay slot for fall-through 300 * use delay slot for fall-through
235 * src and dst are aligned; need to compute rem 301 * src and dst are aligned; need to compute rem
236 */ 302 */
237.Lboth_aligned: 303.Lboth_aligned\@:
238 SRL t0, len, LOG_NBYTES+3 # +3 for 8 units/iter 304 SRL t0, len, LOG_NBYTES+3 # +3 for 8 units/iter
239 beqz t0, .Lcleanup_both_aligned # len < 8*NBYTES 305 beqz t0, .Lcleanup_both_aligned\@ # len < 8*NBYTES
240 and rem, len, (8*NBYTES-1) # rem = len % (8*NBYTES) 306 and rem, len, (8*NBYTES-1) # rem = len % (8*NBYTES)
241 PREF( 0, 3*32(src) ) 307 PREFS( 0, 3*32(src) )
242 PREF( 1, 3*32(dst) ) 308 PREFD( 1, 3*32(dst) )
243 .align 4 309 .align 4
2441: 3101:
245 R10KCBARRIER(0(ra)) 311 R10KCBARRIER(0(ra))
246EXC( LOAD t0, UNIT(0)(src), .Ll_exc) 312 LOAD(t0, UNIT(0)(src), .Ll_exc\@)
247EXC( LOAD t1, UNIT(1)(src), .Ll_exc_copy) 313 LOAD(t1, UNIT(1)(src), .Ll_exc_copy\@)
248EXC( LOAD t2, UNIT(2)(src), .Ll_exc_copy) 314 LOAD(t2, UNIT(2)(src), .Ll_exc_copy\@)
249EXC( LOAD t3, UNIT(3)(src), .Ll_exc_copy) 315 LOAD(t3, UNIT(3)(src), .Ll_exc_copy\@)
250 SUB len, len, 8*NBYTES 316 SUB len, len, 8*NBYTES
251EXC( LOAD t4, UNIT(4)(src), .Ll_exc_copy) 317 LOAD(t4, UNIT(4)(src), .Ll_exc_copy\@)
252EXC( LOAD t7, UNIT(5)(src), .Ll_exc_copy) 318 LOAD(t7, UNIT(5)(src), .Ll_exc_copy\@)
253EXC( STORE t0, UNIT(0)(dst), .Ls_exc_p8u) 319 STORE(t0, UNIT(0)(dst), .Ls_exc_p8u\@)
254EXC( STORE t1, UNIT(1)(dst), .Ls_exc_p7u) 320 STORE(t1, UNIT(1)(dst), .Ls_exc_p7u\@)
255EXC( LOAD t0, UNIT(6)(src), .Ll_exc_copy) 321 LOAD(t0, UNIT(6)(src), .Ll_exc_copy\@)
256EXC( LOAD t1, UNIT(7)(src), .Ll_exc_copy) 322 LOAD(t1, UNIT(7)(src), .Ll_exc_copy\@)
257 ADD src, src, 8*NBYTES 323 ADD src, src, 8*NBYTES
258 ADD dst, dst, 8*NBYTES 324 ADD dst, dst, 8*NBYTES
259EXC( STORE t2, UNIT(-6)(dst), .Ls_exc_p6u) 325 STORE(t2, UNIT(-6)(dst), .Ls_exc_p6u\@)
260EXC( STORE t3, UNIT(-5)(dst), .Ls_exc_p5u) 326 STORE(t3, UNIT(-5)(dst), .Ls_exc_p5u\@)
261EXC( STORE t4, UNIT(-4)(dst), .Ls_exc_p4u) 327 STORE(t4, UNIT(-4)(dst), .Ls_exc_p4u\@)
262EXC( STORE t7, UNIT(-3)(dst), .Ls_exc_p3u) 328 STORE(t7, UNIT(-3)(dst), .Ls_exc_p3u\@)
263EXC( STORE t0, UNIT(-2)(dst), .Ls_exc_p2u) 329 STORE(t0, UNIT(-2)(dst), .Ls_exc_p2u\@)
264EXC( STORE t1, UNIT(-1)(dst), .Ls_exc_p1u) 330 STORE(t1, UNIT(-1)(dst), .Ls_exc_p1u\@)
265 PREF( 0, 8*32(src) ) 331 PREFS( 0, 8*32(src) )
266 PREF( 1, 8*32(dst) ) 332 PREFD( 1, 8*32(dst) )
267 bne len, rem, 1b 333 bne len, rem, 1b
268 nop 334 nop
269 335
270 /* 336 /*
271 * len == rem == the number of bytes left to copy < 8*NBYTES 337 * len == rem == the number of bytes left to copy < 8*NBYTES
272 */ 338 */
273.Lcleanup_both_aligned: 339.Lcleanup_both_aligned\@:
274 beqz len, .Ldone 340 beqz len, .Ldone\@
275 sltu t0, len, 4*NBYTES 341 sltu t0, len, 4*NBYTES
276 bnez t0, .Lless_than_4units 342 bnez t0, .Lless_than_4units\@
277 and rem, len, (NBYTES-1) # rem = len % NBYTES 343 and rem, len, (NBYTES-1) # rem = len % NBYTES
278 /* 344 /*
279 * len >= 4*NBYTES 345 * len >= 4*NBYTES
280 */ 346 */
281EXC( LOAD t0, UNIT(0)(src), .Ll_exc) 347 LOAD( t0, UNIT(0)(src), .Ll_exc\@)
282EXC( LOAD t1, UNIT(1)(src), .Ll_exc_copy) 348 LOAD( t1, UNIT(1)(src), .Ll_exc_copy\@)
283EXC( LOAD t2, UNIT(2)(src), .Ll_exc_copy) 349 LOAD( t2, UNIT(2)(src), .Ll_exc_copy\@)
284EXC( LOAD t3, UNIT(3)(src), .Ll_exc_copy) 350 LOAD( t3, UNIT(3)(src), .Ll_exc_copy\@)
285 SUB len, len, 4*NBYTES 351 SUB len, len, 4*NBYTES
286 ADD src, src, 4*NBYTES 352 ADD src, src, 4*NBYTES
287 R10KCBARRIER(0(ra)) 353 R10KCBARRIER(0(ra))
288EXC( STORE t0, UNIT(0)(dst), .Ls_exc_p4u) 354 STORE(t0, UNIT(0)(dst), .Ls_exc_p4u\@)
289EXC( STORE t1, UNIT(1)(dst), .Ls_exc_p3u) 355 STORE(t1, UNIT(1)(dst), .Ls_exc_p3u\@)
290EXC( STORE t2, UNIT(2)(dst), .Ls_exc_p2u) 356 STORE(t2, UNIT(2)(dst), .Ls_exc_p2u\@)
291EXC( STORE t3, UNIT(3)(dst), .Ls_exc_p1u) 357 STORE(t3, UNIT(3)(dst), .Ls_exc_p1u\@)
292 .set reorder /* DADDI_WAR */ 358 .set reorder /* DADDI_WAR */
293 ADD dst, dst, 4*NBYTES 359 ADD dst, dst, 4*NBYTES
294 beqz len, .Ldone 360 beqz len, .Ldone\@
295 .set noreorder 361 .set noreorder
296.Lless_than_4units: 362.Lless_than_4units\@:
297 /* 363 /*
298 * rem = len % NBYTES 364 * rem = len % NBYTES
299 */ 365 */
300 beq rem, len, .Lcopy_bytes 366 beq rem, len, .Lcopy_bytes\@
301 nop 367 nop
3021: 3681:
303 R10KCBARRIER(0(ra)) 369 R10KCBARRIER(0(ra))
304EXC( LOAD t0, 0(src), .Ll_exc) 370 LOAD(t0, 0(src), .Ll_exc\@)
305 ADD src, src, NBYTES 371 ADD src, src, NBYTES
306 SUB len, len, NBYTES 372 SUB len, len, NBYTES
307EXC( STORE t0, 0(dst), .Ls_exc_p1u) 373 STORE(t0, 0(dst), .Ls_exc_p1u\@)
308 .set reorder /* DADDI_WAR */ 374 .set reorder /* DADDI_WAR */
309 ADD dst, dst, NBYTES 375 ADD dst, dst, NBYTES
310 bne rem, len, 1b 376 bne rem, len, 1b
@@ -322,17 +388,17 @@ EXC( STORE t0, 0(dst), .Ls_exc_p1u)
322 * more instruction-level parallelism. 388 * more instruction-level parallelism.
323 */ 389 */
324#define bits t2 390#define bits t2
325 beqz len, .Ldone 391 beqz len, .Ldone\@
326 ADD t1, dst, len # t1 is just past last byte of dst 392 ADD t1, dst, len # t1 is just past last byte of dst
327 li bits, 8*NBYTES 393 li bits, 8*NBYTES
328 SLL rem, len, 3 # rem = number of bits to keep 394 SLL rem, len, 3 # rem = number of bits to keep
329EXC( LOAD t0, 0(src), .Ll_exc) 395 LOAD(t0, 0(src), .Ll_exc\@)
330 SUB bits, bits, rem # bits = number of bits to discard 396 SUB bits, bits, rem # bits = number of bits to discard
331 SHIFT_DISCARD t0, t0, bits 397 SHIFT_DISCARD t0, t0, bits
332EXC( STREST t0, -1(t1), .Ls_exc) 398 STREST(t0, -1(t1), .Ls_exc\@)
333 jr ra 399 jr ra
334 move len, zero 400 move len, zero
335.Ldst_unaligned: 401.Ldst_unaligned\@:
336 /* 402 /*
337 * dst is unaligned 403 * dst is unaligned
338 * t0 = src & ADDRMASK 404 * t0 = src & ADDRMASK
@@ -343,25 +409,25 @@ EXC( STREST t0, -1(t1), .Ls_exc)
343 * Set match = (src and dst have same alignment) 409 * Set match = (src and dst have same alignment)
344 */ 410 */
345#define match rem 411#define match rem
346EXC( LDFIRST t3, FIRST(0)(src), .Ll_exc) 412 LDFIRST(t3, FIRST(0)(src), .Ll_exc\@)
347 ADD t2, zero, NBYTES 413 ADD t2, zero, NBYTES
348EXC( LDREST t3, REST(0)(src), .Ll_exc_copy) 414 LDREST(t3, REST(0)(src), .Ll_exc_copy\@)
349 SUB t2, t2, t1 # t2 = number of bytes copied 415 SUB t2, t2, t1 # t2 = number of bytes copied
350 xor match, t0, t1 416 xor match, t0, t1
351 R10KCBARRIER(0(ra)) 417 R10KCBARRIER(0(ra))
352EXC( STFIRST t3, FIRST(0)(dst), .Ls_exc) 418 STFIRST(t3, FIRST(0)(dst), .Ls_exc\@)
353 beq len, t2, .Ldone 419 beq len, t2, .Ldone\@
354 SUB len, len, t2 420 SUB len, len, t2
355 ADD dst, dst, t2 421 ADD dst, dst, t2
356 beqz match, .Lboth_aligned 422 beqz match, .Lboth_aligned\@
357 ADD src, src, t2 423 ADD src, src, t2
358 424
359.Lsrc_unaligned_dst_aligned: 425.Lsrc_unaligned_dst_aligned\@:
360 SRL t0, len, LOG_NBYTES+2 # +2 for 4 units/iter 426 SRL t0, len, LOG_NBYTES+2 # +2 for 4 units/iter
361 PREF( 0, 3*32(src) ) 427 PREFS( 0, 3*32(src) )
362 beqz t0, .Lcleanup_src_unaligned 428 beqz t0, .Lcleanup_src_unaligned\@
363 and rem, len, (4*NBYTES-1) # rem = len % 4*NBYTES 429 and rem, len, (4*NBYTES-1) # rem = len % 4*NBYTES
364 PREF( 1, 3*32(dst) ) 430 PREFD( 1, 3*32(dst) )
3651: 4311:
366/* 432/*
367 * Avoid consecutive LD*'s to the same register since some mips 433 * Avoid consecutive LD*'s to the same register since some mips
@@ -370,58 +436,58 @@ EXC( STFIRST t3, FIRST(0)(dst), .Ls_exc)
370 * are to the same unit (unless src is aligned, but it's not). 436 * are to the same unit (unless src is aligned, but it's not).
371 */ 437 */
372 R10KCBARRIER(0(ra)) 438 R10KCBARRIER(0(ra))
373EXC( LDFIRST t0, FIRST(0)(src), .Ll_exc) 439 LDFIRST(t0, FIRST(0)(src), .Ll_exc\@)
374EXC( LDFIRST t1, FIRST(1)(src), .Ll_exc_copy) 440 LDFIRST(t1, FIRST(1)(src), .Ll_exc_copy\@)
375 SUB len, len, 4*NBYTES 441 SUB len, len, 4*NBYTES
376EXC( LDREST t0, REST(0)(src), .Ll_exc_copy) 442 LDREST(t0, REST(0)(src), .Ll_exc_copy\@)
377EXC( LDREST t1, REST(1)(src), .Ll_exc_copy) 443 LDREST(t1, REST(1)(src), .Ll_exc_copy\@)
378EXC( LDFIRST t2, FIRST(2)(src), .Ll_exc_copy) 444 LDFIRST(t2, FIRST(2)(src), .Ll_exc_copy\@)
379EXC( LDFIRST t3, FIRST(3)(src), .Ll_exc_copy) 445 LDFIRST(t3, FIRST(3)(src), .Ll_exc_copy\@)
380EXC( LDREST t2, REST(2)(src), .Ll_exc_copy) 446 LDREST(t2, REST(2)(src), .Ll_exc_copy\@)
381EXC( LDREST t3, REST(3)(src), .Ll_exc_copy) 447 LDREST(t3, REST(3)(src), .Ll_exc_copy\@)
382 PREF( 0, 9*32(src) ) # 0 is PREF_LOAD (not streamed) 448 PREFS( 0, 9*32(src) ) # 0 is PREF_LOAD (not streamed)
383 ADD src, src, 4*NBYTES 449 ADD src, src, 4*NBYTES
384#ifdef CONFIG_CPU_SB1 450#ifdef CONFIG_CPU_SB1
385 nop # improves slotting 451 nop # improves slotting
386#endif 452#endif
387EXC( STORE t0, UNIT(0)(dst), .Ls_exc_p4u) 453 STORE(t0, UNIT(0)(dst), .Ls_exc_p4u\@)
388EXC( STORE t1, UNIT(1)(dst), .Ls_exc_p3u) 454 STORE(t1, UNIT(1)(dst), .Ls_exc_p3u\@)
389EXC( STORE t2, UNIT(2)(dst), .Ls_exc_p2u) 455 STORE(t2, UNIT(2)(dst), .Ls_exc_p2u\@)
390EXC( STORE t3, UNIT(3)(dst), .Ls_exc_p1u) 456 STORE(t3, UNIT(3)(dst), .Ls_exc_p1u\@)
391 PREF( 1, 9*32(dst) ) # 1 is PREF_STORE (not streamed) 457 PREFD( 1, 9*32(dst) ) # 1 is PREF_STORE (not streamed)
392 .set reorder /* DADDI_WAR */ 458 .set reorder /* DADDI_WAR */
393 ADD dst, dst, 4*NBYTES 459 ADD dst, dst, 4*NBYTES
394 bne len, rem, 1b 460 bne len, rem, 1b
395 .set noreorder 461 .set noreorder
396 462
397.Lcleanup_src_unaligned: 463.Lcleanup_src_unaligned\@:
398 beqz len, .Ldone 464 beqz len, .Ldone\@
399 and rem, len, NBYTES-1 # rem = len % NBYTES 465 and rem, len, NBYTES-1 # rem = len % NBYTES
400 beq rem, len, .Lcopy_bytes 466 beq rem, len, .Lcopy_bytes\@
401 nop 467 nop
4021: 4681:
403 R10KCBARRIER(0(ra)) 469 R10KCBARRIER(0(ra))
404EXC( LDFIRST t0, FIRST(0)(src), .Ll_exc) 470 LDFIRST(t0, FIRST(0)(src), .Ll_exc\@)
405EXC( LDREST t0, REST(0)(src), .Ll_exc_copy) 471 LDREST(t0, REST(0)(src), .Ll_exc_copy\@)
406 ADD src, src, NBYTES 472 ADD src, src, NBYTES
407 SUB len, len, NBYTES 473 SUB len, len, NBYTES
408EXC( STORE t0, 0(dst), .Ls_exc_p1u) 474 STORE(t0, 0(dst), .Ls_exc_p1u\@)
409 .set reorder /* DADDI_WAR */ 475 .set reorder /* DADDI_WAR */
410 ADD dst, dst, NBYTES 476 ADD dst, dst, NBYTES
411 bne len, rem, 1b 477 bne len, rem, 1b
412 .set noreorder 478 .set noreorder
413 479
414.Lcopy_bytes_checklen: 480.Lcopy_bytes_checklen\@:
415 beqz len, .Ldone 481 beqz len, .Ldone\@
416 nop 482 nop
417.Lcopy_bytes: 483.Lcopy_bytes\@:
418 /* 0 < len < NBYTES */ 484 /* 0 < len < NBYTES */
419 R10KCBARRIER(0(ra)) 485 R10KCBARRIER(0(ra))
420#define COPY_BYTE(N) \ 486#define COPY_BYTE(N) \
421EXC( lb t0, N(src), .Ll_exc); \ 487 LOADB(t0, N(src), .Ll_exc\@); \
422 SUB len, len, 1; \ 488 SUB len, len, 1; \
423 beqz len, .Ldone; \ 489 beqz len, .Ldone\@; \
424EXC( sb t0, N(dst), .Ls_exc_p1) 490 STOREB(t0, N(dst), .Ls_exc_p1\@)
425 491
426 COPY_BYTE(0) 492 COPY_BYTE(0)
427 COPY_BYTE(1) 493 COPY_BYTE(1)
@@ -431,16 +497,19 @@ EXC( sb t0, N(dst), .Ls_exc_p1)
431 COPY_BYTE(4) 497 COPY_BYTE(4)
432 COPY_BYTE(5) 498 COPY_BYTE(5)
433#endif 499#endif
434EXC( lb t0, NBYTES-2(src), .Ll_exc) 500 LOADB(t0, NBYTES-2(src), .Ll_exc\@)
435 SUB len, len, 1 501 SUB len, len, 1
436 jr ra 502 jr ra
437EXC( sb t0, NBYTES-2(dst), .Ls_exc_p1) 503 STOREB(t0, NBYTES-2(dst), .Ls_exc_p1\@)
438.Ldone: 504.Ldone\@:
439 jr ra 505 jr ra
440 nop 506 .if __memcpy == 1
441 END(memcpy) 507 END(memcpy)
508 .set __memcpy, 0
509 .hidden __memcpy
510 .endif
442 511
443.Ll_exc_copy: 512.Ll_exc_copy\@:
444 /* 513 /*
445 * Copy bytes from src until faulting load address (or until a 514 * Copy bytes from src until faulting load address (or until a
446 * lb faults) 515 * lb faults)
@@ -451,24 +520,24 @@ EXC( sb t0, NBYTES-2(dst), .Ls_exc_p1)
451 * 520 *
452 * Assumes src < THREAD_BUADDR($28) 521 * Assumes src < THREAD_BUADDR($28)
453 */ 522 */
454 LOAD t0, TI_TASK($28) 523 LOADK t0, TI_TASK($28)
455 nop 524 nop
456 LOAD t0, THREAD_BUADDR(t0) 525 LOADK t0, THREAD_BUADDR(t0)
4571: 5261:
458EXC( lb t1, 0(src), .Ll_exc) 527 LOADB(t1, 0(src), .Ll_exc\@)
459 ADD src, src, 1 528 ADD src, src, 1
460 sb t1, 0(dst) # can't fault -- we're copy_from_user 529 sb t1, 0(dst) # can't fault -- we're copy_from_user
461 .set reorder /* DADDI_WAR */ 530 .set reorder /* DADDI_WAR */
462 ADD dst, dst, 1 531 ADD dst, dst, 1
463 bne src, t0, 1b 532 bne src, t0, 1b
464 .set noreorder 533 .set noreorder
465.Ll_exc: 534.Ll_exc\@:
466 LOAD t0, TI_TASK($28) 535 LOADK t0, TI_TASK($28)
467 nop 536 nop
468 LOAD t0, THREAD_BUADDR(t0) # t0 is just past last good address 537 LOADK t0, THREAD_BUADDR(t0) # t0 is just past last good address
469 nop 538 nop
470 SUB len, AT, t0 # len number of uncopied bytes 539 SUB len, AT, t0 # len number of uncopied bytes
471 bnez t6, .Ldone /* Skip the zeroing part if inatomic */ 540 bnez t6, .Ldone\@ /* Skip the zeroing part if inatomic */
472 /* 541 /*
473 * Here's where we rely on src and dst being incremented in tandem, 542 * Here's where we rely on src and dst being incremented in tandem,
474 * See (3) above. 543 * See (3) above.
@@ -482,7 +551,7 @@ EXC( lb t1, 0(src), .Ll_exc)
482 */ 551 */
483 .set reorder /* DADDI_WAR */ 552 .set reorder /* DADDI_WAR */
484 SUB src, len, 1 553 SUB src, len, 1
485 beqz len, .Ldone 554 beqz len, .Ldone\@
486 .set noreorder 555 .set noreorder
4871: sb zero, 0(dst) 5561: sb zero, 0(dst)
488 ADD dst, dst, 1 557 ADD dst, dst, 1
@@ -503,7 +572,7 @@ EXC( lb t1, 0(src), .Ll_exc)
503 572
504#define SEXC(n) \ 573#define SEXC(n) \
505 .set reorder; /* DADDI_WAR */ \ 574 .set reorder; /* DADDI_WAR */ \
506.Ls_exc_p ## n ## u: \ 575.Ls_exc_p ## n ## u\@: \
507 ADD len, len, n*NBYTES; \ 576 ADD len, len, n*NBYTES; \
508 jr ra; \ 577 jr ra; \
509 .set noreorder 578 .set noreorder
@@ -517,14 +586,15 @@ SEXC(3)
517SEXC(2) 586SEXC(2)
518SEXC(1) 587SEXC(1)
519 588
520.Ls_exc_p1: 589.Ls_exc_p1\@:
521 .set reorder /* DADDI_WAR */ 590 .set reorder /* DADDI_WAR */
522 ADD len, len, 1 591 ADD len, len, 1
523 jr ra 592 jr ra
524 .set noreorder 593 .set noreorder
525.Ls_exc: 594.Ls_exc\@:
526 jr ra 595 jr ra
527 nop 596 nop
597 .endm
528 598
529 .align 5 599 .align 5
530LEAF(memmove) 600LEAF(memmove)
@@ -575,3 +645,71 @@ LEAF(__rmemcpy) /* a0=dst a1=src a2=len */
575 jr ra 645 jr ra
576 move a2, zero 646 move a2, zero
577 END(__rmemcpy) 647 END(__rmemcpy)
648
649/*
650 * t6 is used as a flag to note inatomic mode.
651 */
652LEAF(__copy_user_inatomic)
653 b __copy_user_common
654 li t6, 1
655 END(__copy_user_inatomic)
656
657/*
658 * A combined memcpy/__copy_user
659 * __copy_user sets len to 0 for success; else to an upper bound of
660 * the number of uncopied bytes.
661 * memcpy sets v0 to dst.
662 */
663 .align 5
664LEAF(memcpy) /* a0=dst a1=src a2=len */
665 move v0, dst /* return value */
666.L__memcpy:
667FEXPORT(__copy_user)
668 li t6, 0 /* not inatomic */
669__copy_user_common:
670 /* Legacy Mode, user <-> user */
671 __BUILD_COPY_USER LEGACY_MODE USEROP USEROP
672
673#ifdef CONFIG_EVA
674
675/*
676 * For EVA we need distinct symbols for reading and writing to user space.
677 * This is because we need to use specific EVA instructions to perform the
678 * virtual <-> physical translation when a virtual address is actually in user
679 * space
680 */
681
682LEAF(__copy_user_inatomic_eva)
683 b __copy_from_user_common
684 li t6, 1
685 END(__copy_user_inatomic_eva)
686
687/*
688 * __copy_from_user (EVA)
689 */
690
691LEAF(__copy_from_user_eva)
692 li t6, 0 /* not inatomic */
693__copy_from_user_common:
694 __BUILD_COPY_USER EVA_MODE USEROP KERNELOP
695END(__copy_from_user_eva)
696
697
698
699/*
700 * __copy_to_user (EVA)
701 */
702
703LEAF(__copy_to_user_eva)
704__BUILD_COPY_USER EVA_MODE KERNELOP USEROP
705END(__copy_to_user_eva)
706
707/*
708 * __copy_in_user (EVA)
709 */
710
711LEAF(__copy_in_user_eva)
712__BUILD_COPY_USER EVA_MODE USEROP USEROP
713END(__copy_in_user_eva)
714
715#endif
diff --git a/arch/mips/lib/memset.S b/arch/mips/lib/memset.S
index 0580194e7402..7b0e5462ca51 100644
--- a/arch/mips/lib/memset.S
+++ b/arch/mips/lib/memset.S
@@ -34,13 +34,27 @@
34#define FILLPTRG t0 34#define FILLPTRG t0
35#endif 35#endif
36 36
37#define LEGACY_MODE 1
38#define EVA_MODE 2
39
40/*
41 * No need to protect it with EVA #ifdefery. The generated block of code
42 * will never be assembled if EVA is not enabled.
43 */
44#define __EVAFY(insn, reg, addr) __BUILD_EVA_INSN(insn##e, reg, addr)
45#define ___BUILD_EVA_INSN(insn, reg, addr) __EVAFY(insn, reg, addr)
46
37#define EX(insn,reg,addr,handler) \ 47#define EX(insn,reg,addr,handler) \
389: insn reg, addr; \ 48 .if \mode == LEGACY_MODE; \
499: insn reg, addr; \
50 .else; \
519: ___BUILD_EVA_INSN(insn, reg, addr); \
52 .endif; \
39 .section __ex_table,"a"; \ 53 .section __ex_table,"a"; \
40 PTR 9b, handler; \ 54 PTR 9b, handler; \
41 .previous 55 .previous
42 56
43 .macro f_fill64 dst, offset, val, fixup 57 .macro f_fill64 dst, offset, val, fixup, mode
44 EX(LONG_S, \val, (\offset + 0 * STORSIZE)(\dst), \fixup) 58 EX(LONG_S, \val, (\offset + 0 * STORSIZE)(\dst), \fixup)
45 EX(LONG_S, \val, (\offset + 1 * STORSIZE)(\dst), \fixup) 59 EX(LONG_S, \val, (\offset + 1 * STORSIZE)(\dst), \fixup)
46 EX(LONG_S, \val, (\offset + 2 * STORSIZE)(\dst), \fixup) 60 EX(LONG_S, \val, (\offset + 2 * STORSIZE)(\dst), \fixup)
@@ -63,34 +77,24 @@
63#endif 77#endif
64 .endm 78 .endm
65 79
66/*
67 * memset(void *s, int c, size_t n)
68 *
69 * a0: start of area to clear
70 * a1: char to fill with
71 * a2: size of area to clear
72 */
73 .set noreorder 80 .set noreorder
74 .align 5 81 .align 5
75LEAF(memset)
76 beqz a1, 1f
77 move v0, a0 /* result */
78 82
79 andi a1, 0xff /* spread fillword */ 83 /*
80 LONG_SLL t1, a1, 8 84 * Macro to generate the __bzero{,_user} symbol
81 or a1, t1 85 * Arguments:
82 LONG_SLL t1, a1, 16 86 * mode: LEGACY_MODE or EVA_MODE
83#if LONGSIZE == 8 87 */
84 or a1, t1 88 .macro __BUILD_BZERO mode
85 LONG_SLL t1, a1, 32 89 /* Initialize __memset if this is the first time we call this macro */
86#endif 90 .ifnotdef __memset
87 or a1, t1 91 .set __memset, 1
881: 92 .hidden __memset /* Make sure it does not leak */
93 .endif
89 94
90FEXPORT(__bzero)
91 sltiu t0, a2, STORSIZE /* very small region? */ 95 sltiu t0, a2, STORSIZE /* very small region? */
92 bnez t0, .Lsmall_memset 96 bnez t0, .Lsmall_memset\@
93 andi t0, a0, STORMASK /* aligned? */ 97 andi t0, a0, STORMASK /* aligned? */
94 98
95#ifdef CONFIG_CPU_MICROMIPS 99#ifdef CONFIG_CPU_MICROMIPS
96 move t8, a1 /* used by 'swp' instruction */ 100 move t8, a1 /* used by 'swp' instruction */
@@ -98,39 +102,39 @@ FEXPORT(__bzero)
98#endif 102#endif
99#ifndef CONFIG_CPU_DADDI_WORKAROUNDS 103#ifndef CONFIG_CPU_DADDI_WORKAROUNDS
100 beqz t0, 1f 104 beqz t0, 1f
101 PTR_SUBU t0, STORSIZE /* alignment in bytes */ 105 PTR_SUBU t0, STORSIZE /* alignment in bytes */
102#else 106#else
103 .set noat 107 .set noat
104 li AT, STORSIZE 108 li AT, STORSIZE
105 beqz t0, 1f 109 beqz t0, 1f
106 PTR_SUBU t0, AT /* alignment in bytes */ 110 PTR_SUBU t0, AT /* alignment in bytes */
107 .set at 111 .set at
108#endif 112#endif
109 113
110 R10KCBARRIER(0(ra)) 114 R10KCBARRIER(0(ra))
111#ifdef __MIPSEB__ 115#ifdef __MIPSEB__
112 EX(LONG_S_L, a1, (a0), .Lfirst_fixup) /* make word/dword aligned */ 116 EX(LONG_S_L, a1, (a0), .Lfirst_fixup\@) /* make word/dword aligned */
113#endif 117#endif
114#ifdef __MIPSEL__ 118#ifdef __MIPSEL__
115 EX(LONG_S_R, a1, (a0), .Lfirst_fixup) /* make word/dword aligned */ 119 EX(LONG_S_R, a1, (a0), .Lfirst_fixup\@) /* make word/dword aligned */
116#endif 120#endif
117 PTR_SUBU a0, t0 /* long align ptr */ 121 PTR_SUBU a0, t0 /* long align ptr */
118 PTR_ADDU a2, t0 /* correct size */ 122 PTR_ADDU a2, t0 /* correct size */
119 123
1201: ori t1, a2, 0x3f /* # of full blocks */ 1241: ori t1, a2, 0x3f /* # of full blocks */
121 xori t1, 0x3f 125 xori t1, 0x3f
122 beqz t1, .Lmemset_partial /* no block to fill */ 126 beqz t1, .Lmemset_partial\@ /* no block to fill */
123 andi t0, a2, 0x40-STORSIZE 127 andi t0, a2, 0x40-STORSIZE
124 128
125 PTR_ADDU t1, a0 /* end address */ 129 PTR_ADDU t1, a0 /* end address */
126 .set reorder 130 .set reorder
1271: PTR_ADDIU a0, 64 1311: PTR_ADDIU a0, 64
128 R10KCBARRIER(0(ra)) 132 R10KCBARRIER(0(ra))
129 f_fill64 a0, -64, FILL64RG, .Lfwd_fixup 133 f_fill64 a0, -64, FILL64RG, .Lfwd_fixup\@, \mode
130 bne t1, a0, 1b 134 bne t1, a0, 1b
131 .set noreorder 135 .set noreorder
132 136
133.Lmemset_partial: 137.Lmemset_partial\@:
134 R10KCBARRIER(0(ra)) 138 R10KCBARRIER(0(ra))
135 PTR_LA t1, 2f /* where to start */ 139 PTR_LA t1, 2f /* where to start */
136#ifdef CONFIG_CPU_MICROMIPS 140#ifdef CONFIG_CPU_MICROMIPS
@@ -145,60 +149,100 @@ FEXPORT(__bzero)
145 .set at 149 .set at
146#endif 150#endif
147 jr t1 151 jr t1
148 PTR_ADDU a0, t0 /* dest ptr */ 152 PTR_ADDU a0, t0 /* dest ptr */
149 153
150 .set push 154 .set push
151 .set noreorder 155 .set noreorder
152 .set nomacro 156 .set nomacro
153 f_fill64 a0, -64, FILL64RG, .Lpartial_fixup /* ... but first do longs ... */ 157 /* ... but first do longs ... */
158 f_fill64 a0, -64, FILL64RG, .Lpartial_fixup\@, \mode
1542: .set pop 1592: .set pop
155 andi a2, STORMASK /* At most one long to go */ 160 andi a2, STORMASK /* At most one long to go */
156 161
157 beqz a2, 1f 162 beqz a2, 1f
158 PTR_ADDU a0, a2 /* What's left */ 163 PTR_ADDU a0, a2 /* What's left */
159 R10KCBARRIER(0(ra)) 164 R10KCBARRIER(0(ra))
160#ifdef __MIPSEB__ 165#ifdef __MIPSEB__
161 EX(LONG_S_R, a1, -1(a0), .Llast_fixup) 166 EX(LONG_S_R, a1, -1(a0), .Llast_fixup\@)
162#endif 167#endif
163#ifdef __MIPSEL__ 168#ifdef __MIPSEL__
164 EX(LONG_S_L, a1, -1(a0), .Llast_fixup) 169 EX(LONG_S_L, a1, -1(a0), .Llast_fixup\@)
165#endif 170#endif
1661: jr ra 1711: jr ra
167 move a2, zero 172 move a2, zero
168 173
169.Lsmall_memset: 174.Lsmall_memset\@:
170 beqz a2, 2f 175 beqz a2, 2f
171 PTR_ADDU t1, a0, a2 176 PTR_ADDU t1, a0, a2
172 177
1731: PTR_ADDIU a0, 1 /* fill bytewise */ 1781: PTR_ADDIU a0, 1 /* fill bytewise */
174 R10KCBARRIER(0(ra)) 179 R10KCBARRIER(0(ra))
175 bne t1, a0, 1b 180 bne t1, a0, 1b
176 sb a1, -1(a0) 181 sb a1, -1(a0)
177 182
1782: jr ra /* done */ 1832: jr ra /* done */
179 move a2, zero 184 move a2, zero
185 .if __memset == 1
180 END(memset) 186 END(memset)
187 .set __memset, 0
188 .hidden __memset
189 .endif
181 190
182.Lfirst_fixup: 191.Lfirst_fixup\@:
183 jr ra 192 jr ra
184 nop 193 nop
185 194
186.Lfwd_fixup: 195.Lfwd_fixup\@:
187 PTR_L t0, TI_TASK($28) 196 PTR_L t0, TI_TASK($28)
188 andi a2, 0x3f 197 andi a2, 0x3f
189 LONG_L t0, THREAD_BUADDR(t0) 198 LONG_L t0, THREAD_BUADDR(t0)
190 LONG_ADDU a2, t1 199 LONG_ADDU a2, t1
191 jr ra 200 jr ra
192 LONG_SUBU a2, t0 201 LONG_SUBU a2, t0
193 202
194.Lpartial_fixup: 203.Lpartial_fixup\@:
195 PTR_L t0, TI_TASK($28) 204 PTR_L t0, TI_TASK($28)
196 andi a2, STORMASK 205 andi a2, STORMASK
197 LONG_L t0, THREAD_BUADDR(t0) 206 LONG_L t0, THREAD_BUADDR(t0)
198 LONG_ADDU a2, t1 207 LONG_ADDU a2, t1
199 jr ra 208 jr ra
200 LONG_SUBU a2, t0 209 LONG_SUBU a2, t0
201 210
202.Llast_fixup: 211.Llast_fixup\@:
203 jr ra 212 jr ra
204 andi v1, a2, STORMASK 213 andi v1, a2, STORMASK
214
215 .endm
216
217/*
218 * memset(void *s, int c, size_t n)
219 *
220 * a0: start of area to clear
221 * a1: char to fill with
222 * a2: size of area to clear
223 */
224
225LEAF(memset)
226 beqz a1, 1f
227 move v0, a0 /* result */
228
229 andi a1, 0xff /* spread fillword */
230 LONG_SLL t1, a1, 8
231 or a1, t1
232 LONG_SLL t1, a1, 16
233#if LONGSIZE == 8
234 or a1, t1
235 LONG_SLL t1, a1, 32
236#endif
237 or a1, t1
2381:
239#ifndef CONFIG_EVA
240FEXPORT(__bzero)
241#endif
242 __BUILD_BZERO LEGACY_MODE
243
244#ifdef CONFIG_EVA
245LEAF(__bzero)
246 __BUILD_BZERO EVA_MODE
247END(__bzero)
248#endif
diff --git a/arch/mips/lib/strlen_user.S b/arch/mips/lib/strlen_user.S
index e362dcdc69d1..bef65c98df59 100644
--- a/arch/mips/lib/strlen_user.S
+++ b/arch/mips/lib/strlen_user.S
@@ -22,19 +22,43 @@
22 * 22 *
23 * Return 0 for error 23 * Return 0 for error
24 */ 24 */
25LEAF(__strlen_user_asm) 25 .macro __BUILD_STRLEN_ASM func
26LEAF(__strlen_\func\()_asm)
26 LONG_L v0, TI_ADDR_LIMIT($28) # pointer ok? 27 LONG_L v0, TI_ADDR_LIMIT($28) # pointer ok?
27 and v0, a0 28 and v0, a0
28 bnez v0, .Lfault 29 bnez v0, .Lfault\@
29 30
30FEXPORT(__strlen_user_nocheck_asm) 31FEXPORT(__strlen_\func\()_nocheck_asm)
31 move v0, a0 32 move v0, a0
321: EX(lbu, v1, (v0), .Lfault) 33.ifeqs "\func", "kernel"
341: EX(lbu, v1, (v0), .Lfault\@)
35.else
361: EX(lbue, v1, (v0), .Lfault\@)
37.endif
33 PTR_ADDIU v0, 1 38 PTR_ADDIU v0, 1
34 bnez v1, 1b 39 bnez v1, 1b
35 PTR_SUBU v0, a0 40 PTR_SUBU v0, a0
36 jr ra 41 jr ra
37 END(__strlen_user_asm) 42 END(__strlen_\func\()_asm)
38 43
39.Lfault: move v0, zero 44.Lfault\@: move v0, zero
40 jr ra 45 jr ra
46 .endm
47
48#ifndef CONFIG_EVA
49 /* Set aliases */
50 .global __strlen_user_asm
51 .global __strlen_user_nocheck_asm
52 .set __strlen_user_asm, __strlen_kernel_asm
53 .set __strlen_user_nocheck_asm, __strlen_kernel_nocheck_asm
54#endif
55
56__BUILD_STRLEN_ASM kernel
57
58#ifdef CONFIG_EVA
59
60 .set push
61 .set eva
62__BUILD_STRLEN_ASM user
63 .set pop
64#endif
diff --git a/arch/mips/lib/strncpy_user.S b/arch/mips/lib/strncpy_user.S
index 92870b6b53ea..d3301cd1e9a5 100644
--- a/arch/mips/lib/strncpy_user.S
+++ b/arch/mips/lib/strncpy_user.S
@@ -28,16 +28,21 @@
28 * it happens at most some bytes of the exceptions handlers will be copied. 28 * it happens at most some bytes of the exceptions handlers will be copied.
29 */ 29 */
30 30
31LEAF(__strncpy_from_user_asm) 31 .macro __BUILD_STRNCPY_ASM func
32LEAF(__strncpy_from_\func\()_asm)
32 LONG_L v0, TI_ADDR_LIMIT($28) # pointer ok? 33 LONG_L v0, TI_ADDR_LIMIT($28) # pointer ok?
33 and v0, a1 34 and v0, a1
34 bnez v0, .Lfault 35 bnez v0, .Lfault\@
35 36
36FEXPORT(__strncpy_from_user_nocheck_asm) 37FEXPORT(__strncpy_from_\func\()_nocheck_asm)
37 .set noreorder 38 .set noreorder
38 move t0, zero 39 move t0, zero
39 move v1, a1 40 move v1, a1
401: EX(lbu, v0, (v1), .Lfault) 41.ifeqs "\func","kernel"
421: EX(lbu, v0, (v1), .Lfault\@)
43.else
441: EX(lbue, v0, (v1), .Lfault\@)
45.endif
41 PTR_ADDIU v1, 1 46 PTR_ADDIU v1, 1
42 R10KCBARRIER(0(ra)) 47 R10KCBARRIER(0(ra))
43 beqz v0, 2f 48 beqz v0, 2f
@@ -47,15 +52,34 @@ FEXPORT(__strncpy_from_user_nocheck_asm)
47 PTR_ADDIU a0, 1 52 PTR_ADDIU a0, 1
482: PTR_ADDU v0, a1, t0 532: PTR_ADDU v0, a1, t0
49 xor v0, a1 54 xor v0, a1
50 bltz v0, .Lfault 55 bltz v0, .Lfault\@
51 nop 56 nop
52 jr ra # return n 57 jr ra # return n
53 move v0, t0 58 move v0, t0
54 END(__strncpy_from_user_asm) 59 END(__strncpy_from_\func\()_asm)
55 60
56.Lfault: jr ra 61.Lfault\@: jr ra
57 li v0, -EFAULT 62 li v0, -EFAULT
58 63
59 .section __ex_table,"a" 64 .section __ex_table,"a"
60 PTR 1b, .Lfault 65 PTR 1b, .Lfault\@
61 .previous 66 .previous
67
68 .endm
69
70#ifndef CONFIG_EVA
71 /* Set aliases */
72 .global __strncpy_from_user_asm
73 .global __strncpy_from_user_nocheck_asm
74 .set __strncpy_from_user_asm, __strncpy_from_kernel_asm
75 .set __strncpy_from_user_nocheck_asm, __strncpy_from_kernel_nocheck_asm
76#endif
77
78__BUILD_STRNCPY_ASM kernel
79
80#ifdef CONFIG_EVA
81 .set push
82 .set eva
83__BUILD_STRNCPY_ASM user
84 .set pop
85#endif
diff --git a/arch/mips/lib/strnlen_user.S b/arch/mips/lib/strnlen_user.S
index fcacea5e61f1..f3af6995e2a6 100644
--- a/arch/mips/lib/strnlen_user.S
+++ b/arch/mips/lib/strnlen_user.S
@@ -25,22 +25,46 @@
25 * bytes. There's nothing secret there. On 64-bit accessing beyond 25 * bytes. There's nothing secret there. On 64-bit accessing beyond
26 * the maximum is a tad hairier ... 26 * the maximum is a tad hairier ...
27 */ 27 */
28LEAF(__strnlen_user_asm) 28 .macro __BUILD_STRNLEN_ASM func
29LEAF(__strnlen_\func\()_asm)
29 LONG_L v0, TI_ADDR_LIMIT($28) # pointer ok? 30 LONG_L v0, TI_ADDR_LIMIT($28) # pointer ok?
30 and v0, a0 31 and v0, a0
31 bnez v0, .Lfault 32 bnez v0, .Lfault\@
32 33
33FEXPORT(__strnlen_user_nocheck_asm) 34FEXPORT(__strnlen_\func\()_nocheck_asm)
34 move v0, a0 35 move v0, a0
35 PTR_ADDU a1, a0 # stop pointer 36 PTR_ADDU a1, a0 # stop pointer
361: beq v0, a1, 1f # limit reached? 371: beq v0, a1, 1f # limit reached?
37 EX(lb, t0, (v0), .Lfault) 38.ifeqs "\func", "kernel"
39 EX(lb, t0, (v0), .Lfault\@)
40.else
41 EX(lbe, t0, (v0), .Lfault\@)
42.endif
38 PTR_ADDIU v0, 1 43 PTR_ADDIU v0, 1
39 bnez t0, 1b 44 bnez t0, 1b
401: PTR_SUBU v0, a0 451: PTR_SUBU v0, a0
41 jr ra 46 jr ra
42 END(__strnlen_user_asm) 47 END(__strnlen_\func\()_asm)
43 48
44.Lfault: 49.Lfault\@:
45 move v0, zero 50 move v0, zero
46 jr ra 51 jr ra
52 .endm
53
54#ifndef CONFIG_EVA
55 /* Set aliases */
56 .global __strnlen_user_asm
57 .global __strnlen_user_nocheck_asm
58 .set __strnlen_user_asm, __strnlen_kernel_asm
59 .set __strnlen_user_nocheck_asm, __strnlen_kernel_nocheck_asm
60#endif
61
62__BUILD_STRNLEN_ASM kernel
63
64#ifdef CONFIG_EVA
65
66 .set push
67 .set eva
68__BUILD_STRNLEN_ASM user
69 .set pop
70#endif
diff --git a/arch/mips/loongson/Kconfig b/arch/mips/loongson/Kconfig
index 263beb9322a8..7397be226a06 100644
--- a/arch/mips/loongson/Kconfig
+++ b/arch/mips/loongson/Kconfig
@@ -59,6 +59,36 @@ config LEMOTE_MACH2F
59 59
60 These family machines include fuloong2f mini PC, yeeloong2f notebook, 60 These family machines include fuloong2f mini PC, yeeloong2f notebook,
61 LingLoong allinone PC and so forth. 61 LingLoong allinone PC and so forth.
62
63config LEMOTE_MACH3A
64 bool "Lemote Loongson 3A family machines"
65 select ARCH_SPARSEMEM_ENABLE
66 select GENERIC_ISA_DMA_SUPPORT_BROKEN
67 select GENERIC_HARDIRQS_NO__DO_IRQ
68 select BOOT_ELF32
69 select BOARD_SCACHE
70 select CSRC_R4K
71 select CEVT_R4K
72 select CPU_HAS_WB
73 select HW_HAS_PCI
74 select ISA
75 select HT_PCI
76 select I8259
77 select IRQ_CPU
78 select NR_CPUS_DEFAULT_4
79 select SYS_HAS_CPU_LOONGSON3
80 select SYS_HAS_EARLY_PRINTK
81 select SYS_SUPPORTS_SMP
82 select SYS_SUPPORTS_HOTPLUG_CPU
83 select SYS_SUPPORTS_64BIT_KERNEL
84 select SYS_SUPPORTS_HIGHMEM
85 select SYS_SUPPORTS_LITTLE_ENDIAN
86 select LOONGSON_MC146818
87 select ZONE_DMA32
88 select LEFI_FIRMWARE_INTERFACE
89 help
90 Lemote Loongson 3A family machines utilize the 3A revision of
91 Loongson processor and RS780/SBX00 chipset.
62endchoice 92endchoice
63 93
64config CS5536 94config CS5536
@@ -86,8 +116,25 @@ config LOONGSON_UART_BASE
86 default y 116 default y
87 depends on EARLY_PRINTK || SERIAL_8250 117 depends on EARLY_PRINTK || SERIAL_8250
88 118
119config IOMMU_HELPER
120 bool
121
122config NEED_SG_DMA_LENGTH
123 bool
124
125config SWIOTLB
126 bool "Soft IOMMU Support for All-Memory DMA"
127 default y
128 depends on CPU_LOONGSON3
129 select IOMMU_HELPER
130 select NEED_SG_DMA_LENGTH
131 select NEED_DMA_MAP_STATE
132
89config LOONGSON_MC146818 133config LOONGSON_MC146818
90 bool 134 bool
91 default n 135 default n
92 136
137config LEFI_FIRMWARE_INTERFACE
138 bool
139
93endif # MACH_LOONGSON 140endif # MACH_LOONGSON
diff --git a/arch/mips/loongson/Makefile b/arch/mips/loongson/Makefile
index 0dc0055754cd..7429994e7604 100644
--- a/arch/mips/loongson/Makefile
+++ b/arch/mips/loongson/Makefile
@@ -15,3 +15,9 @@ obj-$(CONFIG_LEMOTE_FULOONG2E) += fuloong-2e/
15# 15#
16 16
17obj-$(CONFIG_LEMOTE_MACH2F) += lemote-2f/ 17obj-$(CONFIG_LEMOTE_MACH2F) += lemote-2f/
18
19#
20# All Loongson-3 family machines
21#
22
23obj-$(CONFIG_CPU_LOONGSON3) += loongson-3/
diff --git a/arch/mips/loongson/Platform b/arch/mips/loongson/Platform
index 29692e5433b1..6205372b6c2d 100644
--- a/arch/mips/loongson/Platform
+++ b/arch/mips/loongson/Platform
@@ -30,3 +30,4 @@ platform-$(CONFIG_MACH_LOONGSON) += loongson/
30cflags-$(CONFIG_MACH_LOONGSON) += -I$(srctree)/arch/mips/include/asm/mach-loongson -mno-branch-likely 30cflags-$(CONFIG_MACH_LOONGSON) += -I$(srctree)/arch/mips/include/asm/mach-loongson -mno-branch-likely
31load-$(CONFIG_LEMOTE_FULOONG2E) += 0xffffffff80100000 31load-$(CONFIG_LEMOTE_FULOONG2E) += 0xffffffff80100000
32load-$(CONFIG_LEMOTE_MACH2F) += 0xffffffff80200000 32load-$(CONFIG_LEMOTE_MACH2F) += 0xffffffff80200000
33load-$(CONFIG_CPU_LOONGSON3) += 0xffffffff80200000
diff --git a/arch/mips/loongson/common/Makefile b/arch/mips/loongson/common/Makefile
index 9e4484ccbb03..0bb9cc9dc621 100644
--- a/arch/mips/loongson/common/Makefile
+++ b/arch/mips/loongson/common/Makefile
@@ -26,3 +26,8 @@ obj-$(CONFIG_CS5536) += cs5536/
26# 26#
27 27
28obj-$(CONFIG_LOONGSON_SUSPEND) += pm.o 28obj-$(CONFIG_LOONGSON_SUSPEND) += pm.o
29
30#
31# Big Memory (SWIOTLB) Support
32#
33obj-$(CONFIG_SWIOTLB) += dma-swiotlb.o
diff --git a/arch/mips/loongson/common/dma-swiotlb.c b/arch/mips/loongson/common/dma-swiotlb.c
new file mode 100644
index 000000000000..c2be01f91575
--- /dev/null
+++ b/arch/mips/loongson/common/dma-swiotlb.c
@@ -0,0 +1,136 @@
1#include <linux/mm.h>
2#include <linux/init.h>
3#include <linux/dma-mapping.h>
4#include <linux/scatterlist.h>
5#include <linux/swiotlb.h>
6#include <linux/bootmem.h>
7
8#include <asm/bootinfo.h>
9#include <boot_param.h>
10#include <dma-coherence.h>
11
12static void *loongson_dma_alloc_coherent(struct device *dev, size_t size,
13 dma_addr_t *dma_handle, gfp_t gfp, struct dma_attrs *attrs)
14{
15 void *ret;
16
17 if (dma_alloc_from_coherent(dev, size, dma_handle, &ret))
18 return ret;
19
20 /* ignore region specifiers */
21 gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM);
22
23#ifdef CONFIG_ISA
24 if (dev == NULL)
25 gfp |= __GFP_DMA;
26 else
27#endif
28#ifdef CONFIG_ZONE_DMA
29 if (dev->coherent_dma_mask < DMA_BIT_MASK(32))
30 gfp |= __GFP_DMA;
31 else
32#endif
33#ifdef CONFIG_ZONE_DMA32
34 if (dev->coherent_dma_mask < DMA_BIT_MASK(40))
35 gfp |= __GFP_DMA32;
36 else
37#endif
38 ;
39 gfp |= __GFP_NORETRY;
40
41 ret = swiotlb_alloc_coherent(dev, size, dma_handle, gfp);
42 mb();
43 return ret;
44}
45
46static void loongson_dma_free_coherent(struct device *dev, size_t size,
47 void *vaddr, dma_addr_t dma_handle, struct dma_attrs *attrs)
48{
49 int order = get_order(size);
50
51 if (dma_release_from_coherent(dev, order, vaddr))
52 return;
53
54 swiotlb_free_coherent(dev, size, vaddr, dma_handle);
55}
56
57static dma_addr_t loongson_dma_map_page(struct device *dev, struct page *page,
58 unsigned long offset, size_t size,
59 enum dma_data_direction dir,
60 struct dma_attrs *attrs)
61{
62 dma_addr_t daddr = swiotlb_map_page(dev, page, offset, size,
63 dir, attrs);
64 mb();
65 return daddr;
66}
67
68static int loongson_dma_map_sg(struct device *dev, struct scatterlist *sg,
69 int nents, enum dma_data_direction dir,
70 struct dma_attrs *attrs)
71{
72 int r = swiotlb_map_sg_attrs(dev, sg, nents, dir, NULL);
73 mb();
74
75 return r;
76}
77
78static void loongson_dma_sync_single_for_device(struct device *dev,
79 dma_addr_t dma_handle, size_t size,
80 enum dma_data_direction dir)
81{
82 swiotlb_sync_single_for_device(dev, dma_handle, size, dir);
83 mb();
84}
85
86static void loongson_dma_sync_sg_for_device(struct device *dev,
87 struct scatterlist *sg, int nents,
88 enum dma_data_direction dir)
89{
90 swiotlb_sync_sg_for_device(dev, sg, nents, dir);
91 mb();
92}
93
94static int loongson_dma_set_mask(struct device *dev, u64 mask)
95{
96 if (mask > DMA_BIT_MASK(loongson_sysconf.dma_mask_bits)) {
97 *dev->dma_mask = DMA_BIT_MASK(loongson_sysconf.dma_mask_bits);
98 return -EIO;
99 }
100
101 *dev->dma_mask = mask;
102
103 return 0;
104}
105
106dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)
107{
108 return paddr;
109}
110
111phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr)
112{
113 return daddr;
114}
115
116static struct dma_map_ops loongson_dma_map_ops = {
117 .alloc = loongson_dma_alloc_coherent,
118 .free = loongson_dma_free_coherent,
119 .map_page = loongson_dma_map_page,
120 .unmap_page = swiotlb_unmap_page,
121 .map_sg = loongson_dma_map_sg,
122 .unmap_sg = swiotlb_unmap_sg_attrs,
123 .sync_single_for_cpu = swiotlb_sync_single_for_cpu,
124 .sync_single_for_device = loongson_dma_sync_single_for_device,
125 .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu,
126 .sync_sg_for_device = loongson_dma_sync_sg_for_device,
127 .mapping_error = swiotlb_dma_mapping_error,
128 .dma_supported = swiotlb_dma_supported,
129 .set_dma_mask = loongson_dma_set_mask
130};
131
132void __init plat_swiotlb_setup(void)
133{
134 swiotlb_init(1);
135 mips_dma_map_ops = &loongson_dma_map_ops;
136}
diff --git a/arch/mips/loongson/common/env.c b/arch/mips/loongson/common/env.c
index 0a18fcf2d372..0c543eae49bf 100644
--- a/arch/mips/loongson/common/env.c
+++ b/arch/mips/loongson/common/env.c
@@ -18,29 +18,30 @@
18 * option) any later version. 18 * option) any later version.
19 */ 19 */
20#include <linux/module.h> 20#include <linux/module.h>
21
22#include <asm/bootinfo.h> 21#include <asm/bootinfo.h>
23
24#include <loongson.h> 22#include <loongson.h>
23#include <boot_param.h>
25 24
26unsigned long cpu_clock_freq; 25u32 cpu_clock_freq;
27EXPORT_SYMBOL(cpu_clock_freq); 26EXPORT_SYMBOL(cpu_clock_freq);
28unsigned long memsize, highmemsize; 27struct efi_memory_map_loongson *loongson_memmap;
28struct loongson_system_configuration loongson_sysconf;
29 29
30#define parse_even_earlier(res, option, p) \ 30#define parse_even_earlier(res, option, p) \
31do { \ 31do { \
32 unsigned int tmp __maybe_unused; \ 32 unsigned int tmp __maybe_unused; \
33 \ 33 \
34 if (strncmp(option, (char *)p, strlen(option)) == 0) \ 34 if (strncmp(option, (char *)p, strlen(option)) == 0) \
35 tmp = strict_strtol((char *)p + strlen(option"="), 10, &res); \ 35 tmp = kstrtou32((char *)p + strlen(option"="), 10, &res); \
36} while (0) 36} while (0)
37 37
38void __init prom_init_env(void) 38void __init prom_init_env(void)
39{ 39{
40 /* pmon passes arguments in 32bit pointers */ 40 /* pmon passes arguments in 32bit pointers */
41 int *_prom_envp;
42 unsigned long bus_clock;
43 unsigned int processor_id; 41 unsigned int processor_id;
42
43#ifndef CONFIG_LEFI_FIRMWARE_INTERFACE
44 int *_prom_envp;
44 long l; 45 long l;
45 46
46 /* firmware arguments are initialized in head.S */ 47 /* firmware arguments are initialized in head.S */
@@ -48,7 +49,6 @@ void __init prom_init_env(void)
48 49
49 l = (long)*_prom_envp; 50 l = (long)*_prom_envp;
50 while (l != 0) { 51 while (l != 0) {
51 parse_even_earlier(bus_clock, "busclock", l);
52 parse_even_earlier(cpu_clock_freq, "cpuclock", l); 52 parse_even_earlier(cpu_clock_freq, "cpuclock", l);
53 parse_even_earlier(memsize, "memsize", l); 53 parse_even_earlier(memsize, "memsize", l);
54 parse_even_earlier(highmemsize, "highmemsize", l); 54 parse_even_earlier(highmemsize, "highmemsize", l);
@@ -57,8 +57,48 @@ void __init prom_init_env(void)
57 } 57 }
58 if (memsize == 0) 58 if (memsize == 0)
59 memsize = 256; 59 memsize = 256;
60 if (bus_clock == 0) 60 pr_info("memsize=%u, highmemsize=%u\n", memsize, highmemsize);
61 bus_clock = 66000000; 61#else
62 struct boot_params *boot_p;
63 struct loongson_params *loongson_p;
64 struct efi_cpuinfo_loongson *ecpu;
65 struct irq_source_routing_table *eirq_source;
66
67 /* firmware arguments are initialized in head.S */
68 boot_p = (struct boot_params *)fw_arg2;
69 loongson_p = &(boot_p->efi.smbios.lp);
70
71 ecpu = (struct efi_cpuinfo_loongson *)
72 ((u64)loongson_p + loongson_p->cpu_offset);
73 eirq_source = (struct irq_source_routing_table *)
74 ((u64)loongson_p + loongson_p->irq_offset);
75 loongson_memmap = (struct efi_memory_map_loongson *)
76 ((u64)loongson_p + loongson_p->memory_offset);
77
78 cpu_clock_freq = ecpu->cpu_clock_freq;
79 loongson_sysconf.cputype = ecpu->cputype;
80 loongson_sysconf.nr_cpus = ecpu->nr_cpus;
81 if (ecpu->nr_cpus > NR_CPUS || ecpu->nr_cpus == 0)
82 loongson_sysconf.nr_cpus = NR_CPUS;
83
84 loongson_sysconf.pci_mem_start_addr = eirq_source->pci_mem_start_addr;
85 loongson_sysconf.pci_mem_end_addr = eirq_source->pci_mem_end_addr;
86 loongson_sysconf.pci_io_base = eirq_source->pci_io_start_addr;
87 loongson_sysconf.dma_mask_bits = eirq_source->dma_mask_bits;
88 if (loongson_sysconf.dma_mask_bits < 32 ||
89 loongson_sysconf.dma_mask_bits > 64)
90 loongson_sysconf.dma_mask_bits = 32;
91
92 loongson_sysconf.restart_addr = boot_p->reset_system.ResetWarm;
93 loongson_sysconf.poweroff_addr = boot_p->reset_system.Shutdown;
94 loongson_sysconf.suspend_addr = boot_p->reset_system.DoSuspend;
95
96 loongson_sysconf.ht_control_base = 0x90000EFDFB000000;
97 loongson_sysconf.vgabios_addr = boot_p->efi.smbios.vga_bios;
98 pr_debug("Shutdown Addr: %llx, Restart Addr: %llx, VBIOS Addr: %llx\n",
99 loongson_sysconf.poweroff_addr, loongson_sysconf.restart_addr,
100 loongson_sysconf.vgabios_addr);
101#endif
62 if (cpu_clock_freq == 0) { 102 if (cpu_clock_freq == 0) {
63 processor_id = (&current_cpu_data)->processor_id; 103 processor_id = (&current_cpu_data)->processor_id;
64 switch (processor_id & PRID_REV_MASK) { 104 switch (processor_id & PRID_REV_MASK) {
@@ -68,12 +108,13 @@ void __init prom_init_env(void)
68 case PRID_REV_LOONGSON2F: 108 case PRID_REV_LOONGSON2F:
69 cpu_clock_freq = 797000000; 109 cpu_clock_freq = 797000000;
70 break; 110 break;
111 case PRID_REV_LOONGSON3A:
112 cpu_clock_freq = 900000000;
113 break;
71 default: 114 default:
72 cpu_clock_freq = 100000000; 115 cpu_clock_freq = 100000000;
73 break; 116 break;
74 } 117 }
75 } 118 }
76 119 pr_info("CpuClock = %u\n", cpu_clock_freq);
77 pr_info("busclock=%ld, cpuclock=%ld, memsize=%ld, highmemsize=%ld\n",
78 bus_clock, cpu_clock_freq, memsize, highmemsize);
79} 120}
diff --git a/arch/mips/loongson/common/init.c b/arch/mips/loongson/common/init.c
index ae7af1fd5d59..f37fe5413b73 100644
--- a/arch/mips/loongson/common/init.c
+++ b/arch/mips/loongson/common/init.c
@@ -9,6 +9,7 @@
9 */ 9 */
10 10
11#include <linux/bootmem.h> 11#include <linux/bootmem.h>
12#include <asm/smp-ops.h>
12 13
13#include <loongson.h> 14#include <loongson.h>
14 15
@@ -17,10 +18,6 @@ unsigned long __maybe_unused _loongson_addrwincfg_base;
17 18
18void __init prom_init(void) 19void __init prom_init(void)
19{ 20{
20 /* init base address of io space */
21 set_io_port_base((unsigned long)
22 ioremap(LOONGSON_PCIIO_BASE, LOONGSON_PCIIO_SIZE));
23
24#ifdef CONFIG_CPU_SUPPORTS_ADDRWINCFG 21#ifdef CONFIG_CPU_SUPPORTS_ADDRWINCFG
25 _loongson_addrwincfg_base = (unsigned long) 22 _loongson_addrwincfg_base = (unsigned long)
26 ioremap(LOONGSON_ADDRWINCFG_BASE, LOONGSON_ADDRWINCFG_SIZE); 23 ioremap(LOONGSON_ADDRWINCFG_BASE, LOONGSON_ADDRWINCFG_SIZE);
@@ -28,10 +25,16 @@ void __init prom_init(void)
28 25
29 prom_init_cmdline(); 26 prom_init_cmdline();
30 prom_init_env(); 27 prom_init_env();
28
29 /* init base address of io space */
30 set_io_port_base((unsigned long)
31 ioremap(LOONGSON_PCIIO_BASE, LOONGSON_PCIIO_SIZE));
32
31 prom_init_memory(); 33 prom_init_memory();
32 34
33 /*init the uart base address */ 35 /*init the uart base address */
34 prom_init_uart_base(); 36 prom_init_uart_base();
37 register_smp_ops(&loongson3_smp_ops);
35} 38}
36 39
37void __init prom_free_prom_memory(void) 40void __init prom_free_prom_memory(void)
diff --git a/arch/mips/loongson/common/machtype.c b/arch/mips/loongson/common/machtype.c
index 4becd4f9ef2e..1a4797984b8d 100644
--- a/arch/mips/loongson/common/machtype.c
+++ b/arch/mips/loongson/common/machtype.c
@@ -27,6 +27,10 @@ static const char *system_types[] = {
27 [MACH_DEXXON_GDIUM2F10] "dexxon-gdium-2f", 27 [MACH_DEXXON_GDIUM2F10] "dexxon-gdium-2f",
28 [MACH_LEMOTE_NAS] "lemote-nas-2f", 28 [MACH_LEMOTE_NAS] "lemote-nas-2f",
29 [MACH_LEMOTE_LL2F] "lemote-lynloong-2f", 29 [MACH_LEMOTE_LL2F] "lemote-lynloong-2f",
30 [MACH_LEMOTE_A1004] "lemote-3a-notebook-a1004",
31 [MACH_LEMOTE_A1101] "lemote-3a-itx-a1101",
32 [MACH_LEMOTE_A1201] "lemote-2gq-notebook-a1201",
33 [MACH_LEMOTE_A1205] "lemote-2gq-aio-a1205",
30 [MACH_LOONGSON_END] NULL, 34 [MACH_LOONGSON_END] NULL,
31}; 35};
32 36
diff --git a/arch/mips/loongson/common/mem.c b/arch/mips/loongson/common/mem.c
index 8626a42f5b94..b01d52473da8 100644
--- a/arch/mips/loongson/common/mem.c
+++ b/arch/mips/loongson/common/mem.c
@@ -11,9 +11,14 @@
11#include <asm/bootinfo.h> 11#include <asm/bootinfo.h>
12 12
13#include <loongson.h> 13#include <loongson.h>
14#include <boot_param.h>
14#include <mem.h> 15#include <mem.h>
15#include <pci.h> 16#include <pci.h>
16 17
18#ifndef CONFIG_LEFI_FIRMWARE_INTERFACE
19
20u32 memsize, highmemsize;
21
17void __init prom_init_memory(void) 22void __init prom_init_memory(void)
18{ 23{
19 add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM); 24 add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM);
@@ -49,6 +54,43 @@ void __init prom_init_memory(void)
49#endif /* !CONFIG_64BIT */ 54#endif /* !CONFIG_64BIT */
50} 55}
51 56
57#else /* CONFIG_LEFI_FIRMWARE_INTERFACE */
58
59void __init prom_init_memory(void)
60{
61 int i;
62 u32 node_id;
63 u32 mem_type;
64
65 /* parse memory information */
66 for (i = 0; i < loongson_memmap->nr_map; i++) {
67 node_id = loongson_memmap->map[i].node_id;
68 mem_type = loongson_memmap->map[i].mem_type;
69
70 if (node_id == 0) {
71 switch (mem_type) {
72 case SYSTEM_RAM_LOW:
73 add_memory_region(loongson_memmap->map[i].mem_start,
74 (u64)loongson_memmap->map[i].mem_size << 20,
75 BOOT_MEM_RAM);
76 break;
77 case SYSTEM_RAM_HIGH:
78 add_memory_region(loongson_memmap->map[i].mem_start,
79 (u64)loongson_memmap->map[i].mem_size << 20,
80 BOOT_MEM_RAM);
81 break;
82 case MEM_RESERVED:
83 add_memory_region(loongson_memmap->map[i].mem_start,
84 (u64)loongson_memmap->map[i].mem_size << 20,
85 BOOT_MEM_RESERVED);
86 break;
87 }
88 }
89 }
90}
91
92#endif /* CONFIG_LEFI_FIRMWARE_INTERFACE */
93
52/* override of arch/mips/mm/cache.c: __uncached_access */ 94/* override of arch/mips/mm/cache.c: __uncached_access */
53int __uncached_access(struct file *file, unsigned long addr) 95int __uncached_access(struct file *file, unsigned long addr)
54{ 96{
diff --git a/arch/mips/loongson/common/pci.c b/arch/mips/loongson/common/pci.c
index fa7784459721..003ab4e618b3 100644
--- a/arch/mips/loongson/common/pci.c
+++ b/arch/mips/loongson/common/pci.c
@@ -11,6 +11,7 @@
11 11
12#include <pci.h> 12#include <pci.h>
13#include <loongson.h> 13#include <loongson.h>
14#include <boot_param.h>
14 15
15static struct resource loongson_pci_mem_resource = { 16static struct resource loongson_pci_mem_resource = {
16 .name = "pci memory space", 17 .name = "pci memory space",
@@ -82,7 +83,10 @@ static int __init pcibios_init(void)
82 setup_pcimap(); 83 setup_pcimap();
83 84
84 loongson_pci_controller.io_map_base = mips_io_port_base; 85 loongson_pci_controller.io_map_base = mips_io_port_base;
85 86#ifdef CONFIG_LEFI_FIRMWARE_INTERFACE
87 loongson_pci_mem_resource.start = loongson_sysconf.pci_mem_start_addr;
88 loongson_pci_mem_resource.end = loongson_sysconf.pci_mem_end_addr;
89#endif
86 register_pci_controller(&loongson_pci_controller); 90 register_pci_controller(&loongson_pci_controller);
87 91
88 return 0; 92 return 0;
diff --git a/arch/mips/loongson/common/reset.c b/arch/mips/loongson/common/reset.c
index 65bfbb5d06f4..a60715e11306 100644
--- a/arch/mips/loongson/common/reset.c
+++ b/arch/mips/loongson/common/reset.c
@@ -16,6 +16,7 @@
16#include <asm/reboot.h> 16#include <asm/reboot.h>
17 17
18#include <loongson.h> 18#include <loongson.h>
19#include <boot_param.h>
19 20
20static inline void loongson_reboot(void) 21static inline void loongson_reboot(void)
21{ 22{
@@ -37,17 +38,37 @@ static inline void loongson_reboot(void)
37 38
38static void loongson_restart(char *command) 39static void loongson_restart(char *command)
39{ 40{
41#ifndef CONFIG_LEFI_FIRMWARE_INTERFACE
40 /* do preparation for reboot */ 42 /* do preparation for reboot */
41 mach_prepare_reboot(); 43 mach_prepare_reboot();
42 44
43 /* reboot via jumping to boot base address */ 45 /* reboot via jumping to boot base address */
44 loongson_reboot(); 46 loongson_reboot();
47#else
48 void (*fw_restart)(void) = (void *)loongson_sysconf.restart_addr;
49
50 fw_restart();
51 while (1) {
52 if (cpu_wait)
53 cpu_wait();
54 }
55#endif
45} 56}
46 57
47static void loongson_poweroff(void) 58static void loongson_poweroff(void)
48{ 59{
60#ifndef CONFIG_LEFI_FIRMWARE_INTERFACE
49 mach_prepare_shutdown(); 61 mach_prepare_shutdown();
50 unreachable(); 62 unreachable();
63#else
64 void (*fw_poweroff)(void) = (void *)loongson_sysconf.poweroff_addr;
65
66 fw_poweroff();
67 while (1) {
68 if (cpu_wait)
69 cpu_wait();
70 }
71#endif
51} 72}
52 73
53static void loongson_halt(void) 74static void loongson_halt(void)
diff --git a/arch/mips/loongson/common/serial.c b/arch/mips/loongson/common/serial.c
index 5f2b78ae97cc..bd2b7095b6dc 100644
--- a/arch/mips/loongson/common/serial.c
+++ b/arch/mips/loongson/common/serial.c
@@ -19,19 +19,19 @@
19#include <loongson.h> 19#include <loongson.h>
20#include <machine.h> 20#include <machine.h>
21 21
22#define PORT(int) \ 22#define PORT(int, clk) \
23{ \ 23{ \
24 .irq = int, \ 24 .irq = int, \
25 .uartclk = 1843200, \ 25 .uartclk = clk, \
26 .iotype = UPIO_PORT, \ 26 .iotype = UPIO_PORT, \
27 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, \ 27 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, \
28 .regshift = 0, \ 28 .regshift = 0, \
29} 29}
30 30
31#define PORT_M(int) \ 31#define PORT_M(int, clk) \
32{ \ 32{ \
33 .irq = MIPS_CPU_IRQ_BASE + (int), \ 33 .irq = MIPS_CPU_IRQ_BASE + (int), \
34 .uartclk = 3686400, \ 34 .uartclk = clk, \
35 .iotype = UPIO_MEM, \ 35 .iotype = UPIO_MEM, \
36 .membase = (void __iomem *)NULL, \ 36 .membase = (void __iomem *)NULL, \
37 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, \ 37 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, \
@@ -40,13 +40,17 @@
40 40
41static struct plat_serial8250_port uart8250_data[][2] = { 41static struct plat_serial8250_port uart8250_data[][2] = {
42 [MACH_LOONGSON_UNKNOWN] {}, 42 [MACH_LOONGSON_UNKNOWN] {},
43 [MACH_LEMOTE_FL2E] {PORT(4), {} }, 43 [MACH_LEMOTE_FL2E] {PORT(4, 1843200), {} },
44 [MACH_LEMOTE_FL2F] {PORT(3), {} }, 44 [MACH_LEMOTE_FL2F] {PORT(3, 1843200), {} },
45 [MACH_LEMOTE_ML2F7] {PORT_M(3), {} }, 45 [MACH_LEMOTE_ML2F7] {PORT_M(3, 3686400), {} },
46 [MACH_LEMOTE_YL2F89] {PORT_M(3), {} }, 46 [MACH_LEMOTE_YL2F89] {PORT_M(3, 3686400), {} },
47 [MACH_DEXXON_GDIUM2F10] {PORT_M(3), {} }, 47 [MACH_DEXXON_GDIUM2F10] {PORT_M(3, 3686400), {} },
48 [MACH_LEMOTE_NAS] {PORT_M(3), {} }, 48 [MACH_LEMOTE_NAS] {PORT_M(3, 3686400), {} },
49 [MACH_LEMOTE_LL2F] {PORT(3), {} }, 49 [MACH_LEMOTE_LL2F] {PORT(3, 1843200), {} },
50 [MACH_LEMOTE_A1004] {PORT_M(2, 33177600), {} },
51 [MACH_LEMOTE_A1101] {PORT_M(2, 25000000), {} },
52 [MACH_LEMOTE_A1201] {PORT_M(2, 25000000), {} },
53 [MACH_LEMOTE_A1205] {PORT_M(2, 25000000), {} },
50 [MACH_LOONGSON_END] {}, 54 [MACH_LOONGSON_END] {},
51}; 55};
52 56
diff --git a/arch/mips/loongson/common/setup.c b/arch/mips/loongson/common/setup.c
index 8223f8acfd59..bb4ac922e47a 100644
--- a/arch/mips/loongson/common/setup.c
+++ b/arch/mips/loongson/common/setup.c
@@ -18,9 +18,6 @@
18#include <linux/screen_info.h> 18#include <linux/screen_info.h>
19#endif 19#endif
20 20
21void (*__wbflush)(void);
22EXPORT_SYMBOL(__wbflush);
23
24static void wbflush_loongson(void) 21static void wbflush_loongson(void)
25{ 22{
26 asm(".set\tpush\n\t" 23 asm(".set\tpush\n\t"
@@ -32,10 +29,11 @@ static void wbflush_loongson(void)
32 ".set mips0\n\t"); 29 ".set mips0\n\t");
33} 30}
34 31
32void (*__wbflush)(void) = wbflush_loongson;
33EXPORT_SYMBOL(__wbflush);
34
35void __init plat_mem_setup(void) 35void __init plat_mem_setup(void)
36{ 36{
37 __wbflush = wbflush_loongson;
38
39#ifdef CONFIG_VT 37#ifdef CONFIG_VT
40#if defined(CONFIG_VGA_CONSOLE) 38#if defined(CONFIG_VGA_CONSOLE)
41 conswitchp = &vga_con; 39 conswitchp = &vga_con;
diff --git a/arch/mips/loongson/common/uart_base.c b/arch/mips/loongson/common/uart_base.c
index e192ad021edc..1e1eeea73fde 100644
--- a/arch/mips/loongson/common/uart_base.c
+++ b/arch/mips/loongson/common/uart_base.c
@@ -35,9 +35,16 @@ void prom_init_loongson_uart_base(void)
35 case MACH_DEXXON_GDIUM2F10: 35 case MACH_DEXXON_GDIUM2F10:
36 case MACH_LEMOTE_NAS: 36 case MACH_LEMOTE_NAS:
37 default: 37 default:
38 /* The CPU provided serial port */ 38 /* The CPU provided serial port (LPC) */
39 loongson_uart_base = LOONGSON_LIO1_BASE + 0x3f8; 39 loongson_uart_base = LOONGSON_LIO1_BASE + 0x3f8;
40 break; 40 break;
41 case MACH_LEMOTE_A1004:
42 case MACH_LEMOTE_A1101:
43 case MACH_LEMOTE_A1201:
44 case MACH_LEMOTE_A1205:
45 /* The CPU provided serial port (CPU) */
46 loongson_uart_base = LOONGSON_REG_BASE + 0x1e0;
47 break;
41 } 48 }
42 49
43 _loongson_uart_base = 50 _loongson_uart_base =
diff --git a/arch/mips/loongson/lemote-2f/clock.c b/arch/mips/loongson/lemote-2f/clock.c
index aed32b88576c..e1f427f4f5f3 100644
--- a/arch/mips/loongson/lemote-2f/clock.c
+++ b/arch/mips/loongson/lemote-2f/clock.c
@@ -28,16 +28,16 @@ enum {
28}; 28};
29 29
30struct cpufreq_frequency_table loongson2_clockmod_table[] = { 30struct cpufreq_frequency_table loongson2_clockmod_table[] = {
31 {DC_RESV, CPUFREQ_ENTRY_INVALID}, 31 {0, DC_RESV, CPUFREQ_ENTRY_INVALID},
32 {DC_ZERO, CPUFREQ_ENTRY_INVALID}, 32 {0, DC_ZERO, CPUFREQ_ENTRY_INVALID},
33 {DC_25PT, 0}, 33 {0, DC_25PT, 0},
34 {DC_37PT, 0}, 34 {0, DC_37PT, 0},
35 {DC_50PT, 0}, 35 {0, DC_50PT, 0},
36 {DC_62PT, 0}, 36 {0, DC_62PT, 0},
37 {DC_75PT, 0}, 37 {0, DC_75PT, 0},
38 {DC_87PT, 0}, 38 {0, DC_87PT, 0},
39 {DC_DISABLE, 0}, 39 {0, DC_DISABLE, 0},
40 {DC_RESV, CPUFREQ_TABLE_END}, 40 {0, DC_RESV, CPUFREQ_TABLE_END},
41}; 41};
42EXPORT_SYMBOL_GPL(loongson2_clockmod_table); 42EXPORT_SYMBOL_GPL(loongson2_clockmod_table);
43 43
diff --git a/arch/mips/loongson/loongson-3/Makefile b/arch/mips/loongson/loongson-3/Makefile
new file mode 100644
index 000000000000..70152b252ddc
--- /dev/null
+++ b/arch/mips/loongson/loongson-3/Makefile
@@ -0,0 +1,6 @@
1#
2# Makefile for Loongson-3 family machines
3#
4obj-y += irq.o
5
6obj-$(CONFIG_SMP) += smp.o
diff --git a/arch/mips/loongson/loongson-3/irq.c b/arch/mips/loongson/loongson-3/irq.c
new file mode 100644
index 000000000000..f240828181ff
--- /dev/null
+++ b/arch/mips/loongson/loongson-3/irq.c
@@ -0,0 +1,126 @@
1#include <loongson.h>
2#include <irq.h>
3#include <linux/interrupt.h>
4#include <linux/module.h>
5
6#include <asm/irq_cpu.h>
7#include <asm/i8259.h>
8#include <asm/mipsregs.h>
9
10unsigned int ht_irq[] = {1, 3, 4, 5, 6, 7, 8, 12, 14, 15};
11
12static void ht_irqdispatch(void)
13{
14 unsigned int i, irq;
15
16 irq = LOONGSON_HT1_INT_VECTOR(0);
17 LOONGSON_HT1_INT_VECTOR(0) = irq; /* Acknowledge the IRQs */
18
19 for (i = 0; i < ARRAY_SIZE(ht_irq); i++) {
20 if (irq & (0x1 << ht_irq[i]))
21 do_IRQ(ht_irq[i]);
22 }
23}
24
25void mach_irq_dispatch(unsigned int pending)
26{
27 if (pending & CAUSEF_IP7)
28 do_IRQ(LOONGSON_TIMER_IRQ);
29#if defined(CONFIG_SMP)
30 else if (pending & CAUSEF_IP6)
31 loongson3_ipi_interrupt(NULL);
32#endif
33 else if (pending & CAUSEF_IP3)
34 ht_irqdispatch();
35 else if (pending & CAUSEF_IP2)
36 do_IRQ(LOONGSON_UART_IRQ);
37 else {
38 pr_err("%s : spurious interrupt\n", __func__);
39 spurious_interrupt();
40 }
41}
42
43static struct irqaction cascade_irqaction = {
44 .handler = no_action,
45 .name = "cascade",
46};
47
48static inline void mask_loongson_irq(struct irq_data *d)
49{
50 clear_c0_status(0x100 << (d->irq - MIPS_CPU_IRQ_BASE));
51 irq_disable_hazard();
52
53 /* Workaround: UART IRQ may deliver to any core */
54 if (d->irq == LOONGSON_UART_IRQ) {
55 int cpu = smp_processor_id();
56
57 LOONGSON_INT_ROUTER_INTENCLR = 1 << 10;
58 LOONGSON_INT_ROUTER_LPC = 0x10 + (1<<cpu);
59 }
60}
61
62static inline void unmask_loongson_irq(struct irq_data *d)
63{
64 /* Workaround: UART IRQ may deliver to any core */
65 if (d->irq == LOONGSON_UART_IRQ) {
66 int cpu = smp_processor_id();
67
68 LOONGSON_INT_ROUTER_INTENSET = 1 << 10;
69 LOONGSON_INT_ROUTER_LPC = 0x10 + (1<<cpu);
70 }
71
72 set_c0_status(0x100 << (d->irq - MIPS_CPU_IRQ_BASE));
73 irq_enable_hazard();
74}
75
76 /* For MIPS IRQs which shared by all cores */
77static struct irq_chip loongson_irq_chip = {
78 .name = "Loongson",
79 .irq_ack = mask_loongson_irq,
80 .irq_mask = mask_loongson_irq,
81 .irq_mask_ack = mask_loongson_irq,
82 .irq_unmask = unmask_loongson_irq,
83 .irq_eoi = unmask_loongson_irq,
84};
85
86void irq_router_init(void)
87{
88 int i;
89
90 /* route LPC int to cpu core0 int 0 */
91 LOONGSON_INT_ROUTER_LPC = LOONGSON_INT_CORE0_INT0;
92 /* route HT1 int0 ~ int7 to cpu core0 INT1*/
93 for (i = 0; i < 8; i++)
94 LOONGSON_INT_ROUTER_HT1(i) = LOONGSON_INT_CORE0_INT1;
95 /* enable HT1 interrupt */
96 LOONGSON_HT1_INTN_EN(0) = 0xffffffff;
97 /* enable router interrupt intenset */
98 LOONGSON_INT_ROUTER_INTENSET =
99 LOONGSON_INT_ROUTER_INTEN | (0xffff << 16) | 0x1 << 10;
100}
101
102void __init mach_init_irq(void)
103{
104 clear_c0_status(ST0_IM | ST0_BEV);
105
106 irq_router_init();
107 mips_cpu_irq_init();
108 init_i8259_irqs();
109 irq_set_chip_and_handler(LOONGSON_UART_IRQ,
110 &loongson_irq_chip, handle_level_irq);
111
112 /* setup HT1 irq */
113 setup_irq(LOONGSON_HT1_IRQ, &cascade_irqaction);
114
115 set_c0_status(STATUSF_IP2 | STATUSF_IP6);
116}
117
118#ifdef CONFIG_HOTPLUG_CPU
119
120void fixup_irqs(void)
121{
122 irq_cpu_offline();
123 clear_c0_status(ST0_IM);
124}
125
126#endif
diff --git a/arch/mips/loongson/loongson-3/smp.c b/arch/mips/loongson/loongson-3/smp.c
new file mode 100644
index 000000000000..c665fe16d4c9
--- /dev/null
+++ b/arch/mips/loongson/loongson-3/smp.c
@@ -0,0 +1,443 @@
1/*
2 * Copyright (C) 2010, 2011, 2012, Lemote, Inc.
3 * Author: Chen Huacai, chenhc@lemote.com
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 *
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 */
16
17#include <linux/init.h>
18#include <linux/cpu.h>
19#include <linux/sched.h>
20#include <linux/smp.h>
21#include <linux/cpufreq.h>
22#include <asm/processor.h>
23#include <asm/time.h>
24#include <asm/clock.h>
25#include <asm/tlbflush.h>
26#include <asm/cacheflush.h>
27#include <loongson.h>
28
29#include "smp.h"
30
31DEFINE_PER_CPU(int, cpu_state);
32DEFINE_PER_CPU(uint32_t, core0_c0count);
33
34/* read a 32bit value from ipi register */
35#define loongson3_ipi_read32(addr) readl(addr)
36/* read a 64bit value from ipi register */
37#define loongson3_ipi_read64(addr) readq(addr)
38/* write a 32bit value to ipi register */
39#define loongson3_ipi_write32(action, addr) \
40 do { \
41 writel(action, addr); \
42 __wbflush(); \
43 } while (0)
44/* write a 64bit value to ipi register */
45#define loongson3_ipi_write64(action, addr) \
46 do { \
47 writeq(action, addr); \
48 __wbflush(); \
49 } while (0)
50
51static void *ipi_set0_regs[] = {
52 (void *)(SMP_CORE_GROUP0_BASE + SMP_CORE0_OFFSET + SET0),
53 (void *)(SMP_CORE_GROUP0_BASE + SMP_CORE1_OFFSET + SET0),
54 (void *)(SMP_CORE_GROUP0_BASE + SMP_CORE2_OFFSET + SET0),
55 (void *)(SMP_CORE_GROUP0_BASE + SMP_CORE3_OFFSET + SET0),
56 (void *)(SMP_CORE_GROUP1_BASE + SMP_CORE0_OFFSET + SET0),
57 (void *)(SMP_CORE_GROUP1_BASE + SMP_CORE1_OFFSET + SET0),
58 (void *)(SMP_CORE_GROUP1_BASE + SMP_CORE2_OFFSET + SET0),
59 (void *)(SMP_CORE_GROUP1_BASE + SMP_CORE3_OFFSET + SET0),
60 (void *)(SMP_CORE_GROUP2_BASE + SMP_CORE0_OFFSET + SET0),
61 (void *)(SMP_CORE_GROUP2_BASE + SMP_CORE1_OFFSET + SET0),
62 (void *)(SMP_CORE_GROUP2_BASE + SMP_CORE2_OFFSET + SET0),
63 (void *)(SMP_CORE_GROUP2_BASE + SMP_CORE3_OFFSET + SET0),
64 (void *)(SMP_CORE_GROUP3_BASE + SMP_CORE0_OFFSET + SET0),
65 (void *)(SMP_CORE_GROUP3_BASE + SMP_CORE1_OFFSET + SET0),
66 (void *)(SMP_CORE_GROUP3_BASE + SMP_CORE2_OFFSET + SET0),
67 (void *)(SMP_CORE_GROUP3_BASE + SMP_CORE3_OFFSET + SET0),
68};
69
70static void *ipi_clear0_regs[] = {
71 (void *)(SMP_CORE_GROUP0_BASE + SMP_CORE0_OFFSET + CLEAR0),
72 (void *)(SMP_CORE_GROUP0_BASE + SMP_CORE1_OFFSET + CLEAR0),
73 (void *)(SMP_CORE_GROUP0_BASE + SMP_CORE2_OFFSET + CLEAR0),
74 (void *)(SMP_CORE_GROUP0_BASE + SMP_CORE3_OFFSET + CLEAR0),
75 (void *)(SMP_CORE_GROUP1_BASE + SMP_CORE0_OFFSET + CLEAR0),
76 (void *)(SMP_CORE_GROUP1_BASE + SMP_CORE1_OFFSET + CLEAR0),
77 (void *)(SMP_CORE_GROUP1_BASE + SMP_CORE2_OFFSET + CLEAR0),
78 (void *)(SMP_CORE_GROUP1_BASE + SMP_CORE3_OFFSET + CLEAR0),
79 (void *)(SMP_CORE_GROUP2_BASE + SMP_CORE0_OFFSET + CLEAR0),
80 (void *)(SMP_CORE_GROUP2_BASE + SMP_CORE1_OFFSET + CLEAR0),
81 (void *)(SMP_CORE_GROUP2_BASE + SMP_CORE2_OFFSET + CLEAR0),
82 (void *)(SMP_CORE_GROUP2_BASE + SMP_CORE3_OFFSET + CLEAR0),
83 (void *)(SMP_CORE_GROUP3_BASE + SMP_CORE0_OFFSET + CLEAR0),
84 (void *)(SMP_CORE_GROUP3_BASE + SMP_CORE1_OFFSET + CLEAR0),
85 (void *)(SMP_CORE_GROUP3_BASE + SMP_CORE2_OFFSET + CLEAR0),
86 (void *)(SMP_CORE_GROUP3_BASE + SMP_CORE3_OFFSET + CLEAR0),
87};
88
89static void *ipi_status0_regs[] = {
90 (void *)(SMP_CORE_GROUP0_BASE + SMP_CORE0_OFFSET + STATUS0),
91 (void *)(SMP_CORE_GROUP0_BASE + SMP_CORE1_OFFSET + STATUS0),
92 (void *)(SMP_CORE_GROUP0_BASE + SMP_CORE2_OFFSET + STATUS0),
93 (void *)(SMP_CORE_GROUP0_BASE + SMP_CORE3_OFFSET + STATUS0),
94 (void *)(SMP_CORE_GROUP1_BASE + SMP_CORE0_OFFSET + STATUS0),
95 (void *)(SMP_CORE_GROUP1_BASE + SMP_CORE1_OFFSET + STATUS0),
96 (void *)(SMP_CORE_GROUP1_BASE + SMP_CORE2_OFFSET + STATUS0),
97 (void *)(SMP_CORE_GROUP1_BASE + SMP_CORE3_OFFSET + STATUS0),
98 (void *)(SMP_CORE_GROUP2_BASE + SMP_CORE0_OFFSET + STATUS0),
99 (void *)(SMP_CORE_GROUP2_BASE + SMP_CORE1_OFFSET + STATUS0),
100 (void *)(SMP_CORE_GROUP2_BASE + SMP_CORE2_OFFSET + STATUS0),
101 (void *)(SMP_CORE_GROUP2_BASE + SMP_CORE3_OFFSET + STATUS0),
102 (void *)(SMP_CORE_GROUP3_BASE + SMP_CORE0_OFFSET + STATUS0),
103 (void *)(SMP_CORE_GROUP3_BASE + SMP_CORE1_OFFSET + STATUS0),
104 (void *)(SMP_CORE_GROUP3_BASE + SMP_CORE2_OFFSET + STATUS0),
105 (void *)(SMP_CORE_GROUP3_BASE + SMP_CORE3_OFFSET + STATUS0),
106};
107
108static void *ipi_en0_regs[] = {
109 (void *)(SMP_CORE_GROUP0_BASE + SMP_CORE0_OFFSET + EN0),
110 (void *)(SMP_CORE_GROUP0_BASE + SMP_CORE1_OFFSET + EN0),
111 (void *)(SMP_CORE_GROUP0_BASE + SMP_CORE2_OFFSET + EN0),
112 (void *)(SMP_CORE_GROUP0_BASE + SMP_CORE3_OFFSET + EN0),
113 (void *)(SMP_CORE_GROUP1_BASE + SMP_CORE0_OFFSET + EN0),
114 (void *)(SMP_CORE_GROUP1_BASE + SMP_CORE1_OFFSET + EN0),
115 (void *)(SMP_CORE_GROUP1_BASE + SMP_CORE2_OFFSET + EN0),
116 (void *)(SMP_CORE_GROUP1_BASE + SMP_CORE3_OFFSET + EN0),
117 (void *)(SMP_CORE_GROUP2_BASE + SMP_CORE0_OFFSET + EN0),
118 (void *)(SMP_CORE_GROUP2_BASE + SMP_CORE1_OFFSET + EN0),
119 (void *)(SMP_CORE_GROUP2_BASE + SMP_CORE2_OFFSET + EN0),
120 (void *)(SMP_CORE_GROUP2_BASE + SMP_CORE3_OFFSET + EN0),
121 (void *)(SMP_CORE_GROUP3_BASE + SMP_CORE0_OFFSET + EN0),
122 (void *)(SMP_CORE_GROUP3_BASE + SMP_CORE1_OFFSET + EN0),
123 (void *)(SMP_CORE_GROUP3_BASE + SMP_CORE2_OFFSET + EN0),
124 (void *)(SMP_CORE_GROUP3_BASE + SMP_CORE3_OFFSET + EN0),
125};
126
127static void *ipi_mailbox_buf[] = {
128 (void *)(SMP_CORE_GROUP0_BASE + SMP_CORE0_OFFSET + BUF),
129 (void *)(SMP_CORE_GROUP0_BASE + SMP_CORE1_OFFSET + BUF),
130 (void *)(SMP_CORE_GROUP0_BASE + SMP_CORE2_OFFSET + BUF),
131 (void *)(SMP_CORE_GROUP0_BASE + SMP_CORE3_OFFSET + BUF),
132 (void *)(SMP_CORE_GROUP1_BASE + SMP_CORE0_OFFSET + BUF),
133 (void *)(SMP_CORE_GROUP1_BASE + SMP_CORE1_OFFSET + BUF),
134 (void *)(SMP_CORE_GROUP1_BASE + SMP_CORE2_OFFSET + BUF),
135 (void *)(SMP_CORE_GROUP1_BASE + SMP_CORE3_OFFSET + BUF),
136 (void *)(SMP_CORE_GROUP2_BASE + SMP_CORE0_OFFSET + BUF),
137 (void *)(SMP_CORE_GROUP2_BASE + SMP_CORE1_OFFSET + BUF),
138 (void *)(SMP_CORE_GROUP2_BASE + SMP_CORE2_OFFSET + BUF),
139 (void *)(SMP_CORE_GROUP2_BASE + SMP_CORE3_OFFSET + BUF),
140 (void *)(SMP_CORE_GROUP3_BASE + SMP_CORE0_OFFSET + BUF),
141 (void *)(SMP_CORE_GROUP3_BASE + SMP_CORE1_OFFSET + BUF),
142 (void *)(SMP_CORE_GROUP3_BASE + SMP_CORE2_OFFSET + BUF),
143 (void *)(SMP_CORE_GROUP3_BASE + SMP_CORE3_OFFSET + BUF),
144};
145
146/*
147 * Simple enough, just poke the appropriate ipi register
148 */
149static void loongson3_send_ipi_single(int cpu, unsigned int action)
150{
151 loongson3_ipi_write32((u32)action, ipi_set0_regs[cpu]);
152}
153
154static void
155loongson3_send_ipi_mask(const struct cpumask *mask, unsigned int action)
156{
157 unsigned int i;
158
159 for_each_cpu(i, mask)
160 loongson3_ipi_write32((u32)action, ipi_set0_regs[i]);
161}
162
163void loongson3_ipi_interrupt(struct pt_regs *regs)
164{
165 int i, cpu = smp_processor_id();
166 unsigned int action, c0count;
167
168 /* Load the ipi register to figure out what we're supposed to do */
169 action = loongson3_ipi_read32(ipi_status0_regs[cpu]);
170
171 /* Clear the ipi register to clear the interrupt */
172 loongson3_ipi_write32((u32)action, ipi_clear0_regs[cpu]);
173
174 if (action & SMP_RESCHEDULE_YOURSELF)
175 scheduler_ipi();
176
177 if (action & SMP_CALL_FUNCTION)
178 smp_call_function_interrupt();
179
180 if (action & SMP_ASK_C0COUNT) {
181 BUG_ON(cpu != 0);
182 c0count = read_c0_count();
183 for (i = 1; i < loongson_sysconf.nr_cpus; i++)
184 per_cpu(core0_c0count, i) = c0count;
185 }
186}
187
188#define MAX_LOOPS 1111
189/*
190 * SMP init and finish on secondary CPUs
191 */
192static void loongson3_init_secondary(void)
193{
194 int i;
195 uint32_t initcount;
196 unsigned int cpu = smp_processor_id();
197 unsigned int imask = STATUSF_IP7 | STATUSF_IP6 |
198 STATUSF_IP3 | STATUSF_IP2;
199
200 /* Set interrupt mask, but don't enable */
201 change_c0_status(ST0_IM, imask);
202
203 for (i = 0; i < loongson_sysconf.nr_cpus; i++)
204 loongson3_ipi_write32(0xffffffff, ipi_en0_regs[i]);
205
206 per_cpu(cpu_state, cpu) = CPU_ONLINE;
207
208 i = 0;
209 __get_cpu_var(core0_c0count) = 0;
210 loongson3_send_ipi_single(0, SMP_ASK_C0COUNT);
211 while (!__get_cpu_var(core0_c0count)) {
212 i++;
213 cpu_relax();
214 }
215
216 if (i > MAX_LOOPS)
217 i = MAX_LOOPS;
218 initcount = __get_cpu_var(core0_c0count) + i;
219 write_c0_count(initcount);
220}
221
222static void loongson3_smp_finish(void)
223{
224 write_c0_compare(read_c0_count() + mips_hpt_frequency/HZ);
225 local_irq_enable();
226 loongson3_ipi_write64(0,
227 (void *)(ipi_mailbox_buf[smp_processor_id()]+0x0));
228 pr_info("CPU#%d finished, CP0_ST=%x\n",
229 smp_processor_id(), read_c0_status());
230}
231
232static void __init loongson3_smp_setup(void)
233{
234 int i, num;
235
236 init_cpu_possible(cpu_none_mask);
237 set_cpu_possible(0, true);
238
239 __cpu_number_map[0] = 0;
240 __cpu_logical_map[0] = 0;
241
242 /* For unified kernel, NR_CPUS is the maximum possible value,
243 * loongson_sysconf.nr_cpus is the really present value */
244 for (i = 1, num = 0; i < loongson_sysconf.nr_cpus; i++) {
245 set_cpu_possible(i, true);
246 __cpu_number_map[i] = ++num;
247 __cpu_logical_map[num] = i;
248 }
249 pr_info("Detected %i available secondary CPU(s)\n", num);
250}
251
252static void __init loongson3_prepare_cpus(unsigned int max_cpus)
253{
254 init_cpu_present(cpu_possible_mask);
255 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
256}
257
258/*
259 * Setup the PC, SP, and GP of a secondary processor and start it runing!
260 */
261static void loongson3_boot_secondary(int cpu, struct task_struct *idle)
262{
263 unsigned long startargs[4];
264
265 pr_info("Booting CPU#%d...\n", cpu);
266
267 /* startargs[] are initial PC, SP and GP for secondary CPU */
268 startargs[0] = (unsigned long)&smp_bootstrap;
269 startargs[1] = (unsigned long)__KSTK_TOS(idle);
270 startargs[2] = (unsigned long)task_thread_info(idle);
271 startargs[3] = 0;
272
273 pr_debug("CPU#%d, func_pc=%lx, sp=%lx, gp=%lx\n",
274 cpu, startargs[0], startargs[1], startargs[2]);
275
276 loongson3_ipi_write64(startargs[3], (void *)(ipi_mailbox_buf[cpu]+0x18));
277 loongson3_ipi_write64(startargs[2], (void *)(ipi_mailbox_buf[cpu]+0x10));
278 loongson3_ipi_write64(startargs[1], (void *)(ipi_mailbox_buf[cpu]+0x8));
279 loongson3_ipi_write64(startargs[0], (void *)(ipi_mailbox_buf[cpu]+0x0));
280}
281
282/*
283 * Final cleanup after all secondaries booted
284 */
285static void __init loongson3_cpus_done(void)
286{
287}
288
289#ifdef CONFIG_HOTPLUG_CPU
290
291static int loongson3_cpu_disable(void)
292{
293 unsigned long flags;
294 unsigned int cpu = smp_processor_id();
295
296 if (cpu == 0)
297 return -EBUSY;
298
299 set_cpu_online(cpu, false);
300 cpu_clear(cpu, cpu_callin_map);
301 local_irq_save(flags);
302 fixup_irqs();
303 local_irq_restore(flags);
304 flush_cache_all();
305 local_flush_tlb_all();
306
307 return 0;
308}
309
310
311static void loongson3_cpu_die(unsigned int cpu)
312{
313 while (per_cpu(cpu_state, cpu) != CPU_DEAD)
314 cpu_relax();
315
316 mb();
317}
318
319/* To shutdown a core in Loongson 3, the target core should go to CKSEG1 and
320 * flush all L1 entries at first. Then, another core (usually Core 0) can
321 * safely disable the clock of the target core. loongson3_play_dead() is
322 * called via CKSEG1 (uncached and unmmaped) */
323static void loongson3_play_dead(int *state_addr)
324{
325 register int val;
326 register long cpuid, core, node, count;
327 register void *addr, *base, *initfunc;
328
329 __asm__ __volatile__(
330 " .set push \n"
331 " .set noreorder \n"
332 " li %[addr], 0x80000000 \n" /* KSEG0 */
333 "1: cache 0, 0(%[addr]) \n" /* flush L1 ICache */
334 " cache 0, 1(%[addr]) \n"
335 " cache 0, 2(%[addr]) \n"
336 " cache 0, 3(%[addr]) \n"
337 " cache 1, 0(%[addr]) \n" /* flush L1 DCache */
338 " cache 1, 1(%[addr]) \n"
339 " cache 1, 2(%[addr]) \n"
340 " cache 1, 3(%[addr]) \n"
341 " addiu %[sets], %[sets], -1 \n"
342 " bnez %[sets], 1b \n"
343 " addiu %[addr], %[addr], 0x20 \n"
344 " li %[val], 0x7 \n" /* *state_addr = CPU_DEAD; */
345 " sw %[val], (%[state_addr]) \n"
346 " sync \n"
347 " cache 21, (%[state_addr]) \n" /* flush entry of *state_addr */
348 " .set pop \n"
349 : [addr] "=&r" (addr), [val] "=&r" (val)
350 : [state_addr] "r" (state_addr),
351 [sets] "r" (cpu_data[smp_processor_id()].dcache.sets));
352
353 __asm__ __volatile__(
354 " .set push \n"
355 " .set noreorder \n"
356 " .set mips64 \n"
357 " mfc0 %[cpuid], $15, 1 \n"
358 " andi %[cpuid], 0x3ff \n"
359 " dli %[base], 0x900000003ff01000 \n"
360 " andi %[core], %[cpuid], 0x3 \n"
361 " sll %[core], 8 \n" /* get core id */
362 " or %[base], %[base], %[core] \n"
363 " andi %[node], %[cpuid], 0xc \n"
364 " dsll %[node], 42 \n" /* get node id */
365 " or %[base], %[base], %[node] \n"
366 "1: li %[count], 0x100 \n" /* wait for init loop */
367 "2: bnez %[count], 2b \n" /* limit mailbox access */
368 " addiu %[count], -1 \n"
369 " ld %[initfunc], 0x20(%[base]) \n" /* get PC via mailbox */
370 " beqz %[initfunc], 1b \n"
371 " nop \n"
372 " ld $sp, 0x28(%[base]) \n" /* get SP via mailbox */
373 " ld $gp, 0x30(%[base]) \n" /* get GP via mailbox */
374 " ld $a1, 0x38(%[base]) \n"
375 " jr %[initfunc] \n" /* jump to initial PC */
376 " nop \n"
377 " .set pop \n"
378 : [core] "=&r" (core), [node] "=&r" (node),
379 [base] "=&r" (base), [cpuid] "=&r" (cpuid),
380 [count] "=&r" (count), [initfunc] "=&r" (initfunc)
381 : /* No Input */
382 : "a1");
383}
384
385void play_dead(void)
386{
387 int *state_addr;
388 unsigned int cpu = smp_processor_id();
389 void (*play_dead_at_ckseg1)(int *);
390
391 idle_task_exit();
392 play_dead_at_ckseg1 =
393 (void *)CKSEG1ADDR((unsigned long)loongson3_play_dead);
394 state_addr = &per_cpu(cpu_state, cpu);
395 mb();
396 play_dead_at_ckseg1(state_addr);
397}
398
399#define CPU_POST_DEAD_FROZEN (CPU_POST_DEAD | CPU_TASKS_FROZEN)
400static int loongson3_cpu_callback(struct notifier_block *nfb,
401 unsigned long action, void *hcpu)
402{
403 unsigned int cpu = (unsigned long)hcpu;
404
405 switch (action) {
406 case CPU_POST_DEAD:
407 case CPU_POST_DEAD_FROZEN:
408 pr_info("Disable clock for CPU#%d\n", cpu);
409 LOONGSON_CHIPCFG0 &= ~(1 << (12 + cpu));
410 break;
411 case CPU_UP_PREPARE:
412 case CPU_UP_PREPARE_FROZEN:
413 pr_info("Enable clock for CPU#%d\n", cpu);
414 LOONGSON_CHIPCFG0 |= 1 << (12 + cpu);
415 break;
416 }
417
418 return NOTIFY_OK;
419}
420
421static int register_loongson3_notifier(void)
422{
423 hotcpu_notifier(loongson3_cpu_callback, 0);
424 return 0;
425}
426early_initcall(register_loongson3_notifier);
427
428#endif
429
430struct plat_smp_ops loongson3_smp_ops = {
431 .send_ipi_single = loongson3_send_ipi_single,
432 .send_ipi_mask = loongson3_send_ipi_mask,
433 .init_secondary = loongson3_init_secondary,
434 .smp_finish = loongson3_smp_finish,
435 .cpus_done = loongson3_cpus_done,
436 .boot_secondary = loongson3_boot_secondary,
437 .smp_setup = loongson3_smp_setup,
438 .prepare_cpus = loongson3_prepare_cpus,
439#ifdef CONFIG_HOTPLUG_CPU
440 .cpu_disable = loongson3_cpu_disable,
441 .cpu_die = loongson3_cpu_die,
442#endif
443};
diff --git a/arch/mips/loongson/loongson-3/smp.h b/arch/mips/loongson/loongson-3/smp.h
new file mode 100644
index 000000000000..3453e8c4f2f0
--- /dev/null
+++ b/arch/mips/loongson/loongson-3/smp.h
@@ -0,0 +1,29 @@
1#ifndef __LOONGSON_SMP_H_
2#define __LOONGSON_SMP_H_
3
4/* for Loongson-3A smp support */
5
6/* 4 groups(nodes) in maximum in numa case */
7#define SMP_CORE_GROUP0_BASE 0x900000003ff01000
8#define SMP_CORE_GROUP1_BASE 0x900010003ff01000
9#define SMP_CORE_GROUP2_BASE 0x900020003ff01000
10#define SMP_CORE_GROUP3_BASE 0x900030003ff01000
11
12/* 4 cores in each group(node) */
13#define SMP_CORE0_OFFSET 0x000
14#define SMP_CORE1_OFFSET 0x100
15#define SMP_CORE2_OFFSET 0x200
16#define SMP_CORE3_OFFSET 0x300
17
18/* ipi registers offsets */
19#define STATUS0 0x00
20#define EN0 0x04
21#define SET0 0x08
22#define CLEAR0 0x0c
23#define STATUS1 0x10
24#define MASK1 0x14
25#define SET1 0x18
26#define CLEAR1 0x1c
27#define BUF 0x20
28
29#endif
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
index 0b4e2e38294b..7b3c9acae689 100644
--- a/arch/mips/math-emu/cp1emu.c
+++ b/arch/mips/math-emu/cp1emu.c
@@ -876,20 +876,43 @@ static inline int cop1_64bit(struct pt_regs *xcp)
876#endif 876#endif
877} 877}
878 878
879#define SIFROMREG(si, x) ((si) = cop1_64bit(xcp) || !(x & 1) ? \ 879#define SIFROMREG(si, x) do { \
880 (int)ctx->fpr[x] : (int)(ctx->fpr[x & ~1] >> 32)) 880 if (cop1_64bit(xcp)) \
881 881 (si) = get_fpr32(&ctx->fpr[x], 0); \
882#define SITOREG(si, x) (ctx->fpr[x & ~(cop1_64bit(xcp) == 0)] = \ 882 else \
883 cop1_64bit(xcp) || !(x & 1) ? \ 883 (si) = get_fpr32(&ctx->fpr[(x) & ~1], (x) & 1); \
884 ctx->fpr[x & ~1] >> 32 << 32 | (u32)(si) : \ 884} while (0)
885 ctx->fpr[x & ~1] << 32 >> 32 | (u64)(si) << 32) 885
886 886#define SITOREG(si, x) do { \
887#define SIFROMHREG(si, x) ((si) = (int)(ctx->fpr[x] >> 32)) 887 if (cop1_64bit(xcp)) { \
888#define SITOHREG(si, x) (ctx->fpr[x] = \ 888 unsigned i; \
889 ctx->fpr[x] << 32 >> 32 | (u64)(si) << 32) 889 set_fpr32(&ctx->fpr[x], 0, si); \
890 890 for (i = 1; i < ARRAY_SIZE(ctx->fpr[x].val32); i++) \
891#define DIFROMREG(di, x) ((di) = ctx->fpr[x & ~(cop1_64bit(xcp) == 0)]) 891 set_fpr32(&ctx->fpr[x], i, 0); \
892#define DITOREG(di, x) (ctx->fpr[x & ~(cop1_64bit(xcp) == 0)] = (di)) 892 } else { \
893 set_fpr32(&ctx->fpr[(x) & ~1], (x) & 1, si); \
894 } \
895} while (0)
896
897#define SIFROMHREG(si, x) ((si) = get_fpr32(&ctx->fpr[x], 1))
898
899#define SITOHREG(si, x) do { \
900 unsigned i; \
901 set_fpr32(&ctx->fpr[x], 1, si); \
902 for (i = 2; i < ARRAY_SIZE(ctx->fpr[x].val32); i++) \
903 set_fpr32(&ctx->fpr[x], i, 0); \
904} while (0)
905
906#define DIFROMREG(di, x) \
907 ((di) = get_fpr64(&ctx->fpr[(x) & ~(cop1_64bit(xcp) == 0)], 0))
908
909#define DITOREG(di, x) do { \
910 unsigned fpr, i; \
911 fpr = (x) & ~(cop1_64bit(xcp) == 0); \
912 set_fpr64(&ctx->fpr[fpr], 0, di); \
913 for (i = 1; i < ARRAY_SIZE(ctx->fpr[x].val64); i++) \
914 set_fpr64(&ctx->fpr[fpr], i, 0); \
915} while (0)
893 916
894#define SPFROMREG(sp, x) SIFROMREG((sp).bits, x) 917#define SPFROMREG(sp, x) SIFROMREG((sp).bits, x)
895#define SPTOREG(sp, x) SITOREG((sp).bits, x) 918#define SPTOREG(sp, x) SITOREG((sp).bits, x)
@@ -1960,15 +1983,18 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
1960 1983
1961#if defined(__mips64) 1984#if defined(__mips64)
1962 case l_fmt:{ 1985 case l_fmt:{
1986 u64 bits;
1987 DIFROMREG(bits, MIPSInst_FS(ir));
1988
1963 switch (MIPSInst_FUNC(ir)) { 1989 switch (MIPSInst_FUNC(ir)) {
1964 case fcvts_op: 1990 case fcvts_op:
1965 /* convert long to single precision real */ 1991 /* convert long to single precision real */
1966 rv.s = ieee754sp_flong(ctx->fpr[MIPSInst_FS(ir)]); 1992 rv.s = ieee754sp_flong(bits);
1967 rfmt = s_fmt; 1993 rfmt = s_fmt;
1968 goto copcsr; 1994 goto copcsr;
1969 case fcvtd_op: 1995 case fcvtd_op:
1970 /* convert long to double precision real */ 1996 /* convert long to double precision real */
1971 rv.d = ieee754dp_flong(ctx->fpr[MIPSInst_FS(ir)]); 1997 rv.d = ieee754dp_flong(bits);
1972 rfmt = d_fmt; 1998 rfmt = d_fmt;
1973 goto copcsr; 1999 goto copcsr;
1974 default: 2000 default:
diff --git a/arch/mips/math-emu/kernel_linkage.c b/arch/mips/math-emu/kernel_linkage.c
index 3aeae07ed5b8..eb58a85b3157 100644
--- a/arch/mips/math-emu/kernel_linkage.c
+++ b/arch/mips/math-emu/kernel_linkage.c
@@ -40,78 +40,6 @@ void fpu_emulator_init_fpu(void)
40 } 40 }
41 41
42 current->thread.fpu.fcr31 = 0; 42 current->thread.fpu.fcr31 = 0;
43 for (i = 0; i < 32; i++) { 43 for (i = 0; i < 32; i++)
44 current->thread.fpu.fpr[i] = SIGNALLING_NAN; 44 set_fpr64(&current->thread.fpu.fpr[i], 0, SIGNALLING_NAN);
45 }
46}
47
48
49/*
50 * Emulator context save/restore to/from a signal context
51 * presumed to be on the user stack, and therefore accessed
52 * with appropriate macros from uaccess.h
53 */
54
55int fpu_emulator_save_context(struct sigcontext __user *sc)
56{
57 int i;
58 int err = 0;
59
60 for (i = 0; i < 32; i++) {
61 err |=
62 __put_user(current->thread.fpu.fpr[i], &sc->sc_fpregs[i]);
63 }
64 err |= __put_user(current->thread.fpu.fcr31, &sc->sc_fpc_csr);
65
66 return err;
67}
68
69int fpu_emulator_restore_context(struct sigcontext __user *sc)
70{
71 int i;
72 int err = 0;
73
74 for (i = 0; i < 32; i++) {
75 err |=
76 __get_user(current->thread.fpu.fpr[i], &sc->sc_fpregs[i]);
77 }
78 err |= __get_user(current->thread.fpu.fcr31, &sc->sc_fpc_csr);
79
80 return err;
81}
82
83#ifdef CONFIG_64BIT
84/*
85 * This is the o32 version
86 */
87
88int fpu_emulator_save_context32(struct sigcontext32 __user *sc)
89{
90 int i;
91 int err = 0;
92 int inc = test_thread_flag(TIF_32BIT_FPREGS) ? 2 : 1;
93
94 for (i = 0; i < 32; i += inc) {
95 err |=
96 __put_user(current->thread.fpu.fpr[i], &sc->sc_fpregs[i]);
97 }
98 err |= __put_user(current->thread.fpu.fcr31, &sc->sc_fpc_csr);
99
100 return err;
101}
102
103int fpu_emulator_restore_context32(struct sigcontext32 __user *sc)
104{
105 int i;
106 int err = 0;
107 int inc = test_thread_flag(TIF_32BIT_FPREGS) ? 2 : 1;
108
109 for (i = 0; i < 32; i += inc) {
110 err |=
111 __get_user(current->thread.fpu.fpr[i], &sc->sc_fpregs[i]);
112 }
113 err |= __get_user(current->thread.fpu.fcr31, &sc->sc_fpc_csr);
114
115 return err;
116} 45}
117#endif
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index c14259edd53f..1c74a6ad072a 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -57,7 +57,7 @@ static inline void r4k_on_each_cpu(void (*func) (void *info), void *info)
57 preempt_enable(); 57 preempt_enable();
58} 58}
59 59
60#if defined(CONFIG_MIPS_CMP) 60#if defined(CONFIG_MIPS_CMP) || defined(CONFIG_MIPS_CPS)
61#define cpu_has_safe_index_cacheops 0 61#define cpu_has_safe_index_cacheops 0
62#else 62#else
63#define cpu_has_safe_index_cacheops 1 63#define cpu_has_safe_index_cacheops 1
@@ -123,6 +123,28 @@ static void r4k_blast_dcache_page_setup(void)
123 r4k_blast_dcache_page = r4k_blast_dcache_page_dc64; 123 r4k_blast_dcache_page = r4k_blast_dcache_page_dc64;
124} 124}
125 125
126#ifndef CONFIG_EVA
127#define r4k_blast_dcache_user_page r4k_blast_dcache_page
128#else
129
130static void (*r4k_blast_dcache_user_page)(unsigned long addr);
131
132static void r4k_blast_dcache_user_page_setup(void)
133{
134 unsigned long dc_lsize = cpu_dcache_line_size();
135
136 if (dc_lsize == 0)
137 r4k_blast_dcache_user_page = (void *)cache_noop;
138 else if (dc_lsize == 16)
139 r4k_blast_dcache_user_page = blast_dcache16_user_page;
140 else if (dc_lsize == 32)
141 r4k_blast_dcache_user_page = blast_dcache32_user_page;
142 else if (dc_lsize == 64)
143 r4k_blast_dcache_user_page = blast_dcache64_user_page;
144}
145
146#endif
147
126static void (* r4k_blast_dcache_page_indexed)(unsigned long addr); 148static void (* r4k_blast_dcache_page_indexed)(unsigned long addr);
127 149
128static void r4k_blast_dcache_page_indexed_setup(void) 150static void r4k_blast_dcache_page_indexed_setup(void)
@@ -245,6 +267,27 @@ static void r4k_blast_icache_page_setup(void)
245 r4k_blast_icache_page = blast_icache64_page; 267 r4k_blast_icache_page = blast_icache64_page;
246} 268}
247 269
270#ifndef CONFIG_EVA
271#define r4k_blast_icache_user_page r4k_blast_icache_page
272#else
273
274static void (*r4k_blast_icache_user_page)(unsigned long addr);
275
276static void __cpuinit r4k_blast_icache_user_page_setup(void)
277{
278 unsigned long ic_lsize = cpu_icache_line_size();
279
280 if (ic_lsize == 0)
281 r4k_blast_icache_user_page = (void *)cache_noop;
282 else if (ic_lsize == 16)
283 r4k_blast_icache_user_page = blast_icache16_user_page;
284 else if (ic_lsize == 32)
285 r4k_blast_icache_user_page = blast_icache32_user_page;
286 else if (ic_lsize == 64)
287 r4k_blast_icache_user_page = blast_icache64_user_page;
288}
289
290#endif
248 291
249static void (* r4k_blast_icache_page_indexed)(unsigned long addr); 292static void (* r4k_blast_icache_page_indexed)(unsigned long addr);
250 293
@@ -355,6 +398,7 @@ static inline void local_r4k___flush_cache_all(void * args)
355{ 398{
356 switch (current_cpu_type()) { 399 switch (current_cpu_type()) {
357 case CPU_LOONGSON2: 400 case CPU_LOONGSON2:
401 case CPU_LOONGSON3:
358 case CPU_R4000SC: 402 case CPU_R4000SC:
359 case CPU_R4000MC: 403 case CPU_R4000MC:
360 case CPU_R4400SC: 404 case CPU_R4400SC:
@@ -519,7 +563,8 @@ static inline void local_r4k_flush_cache_page(void *args)
519 } 563 }
520 564
521 if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) { 565 if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) {
522 r4k_blast_dcache_page(addr); 566 vaddr ? r4k_blast_dcache_page(addr) :
567 r4k_blast_dcache_user_page(addr);
523 if (exec && !cpu_icache_snoops_remote_store) 568 if (exec && !cpu_icache_snoops_remote_store)
524 r4k_blast_scache_page(addr); 569 r4k_blast_scache_page(addr);
525 } 570 }
@@ -530,7 +575,8 @@ static inline void local_r4k_flush_cache_page(void *args)
530 if (cpu_context(cpu, mm) != 0) 575 if (cpu_context(cpu, mm) != 0)
531 drop_mmu_context(mm, cpu); 576 drop_mmu_context(mm, cpu);
532 } else 577 } else
533 r4k_blast_icache_page(addr); 578 vaddr ? r4k_blast_icache_page(addr) :
579 r4k_blast_icache_user_page(addr);
534 } 580 }
535 581
536 if (vaddr) { 582 if (vaddr) {
@@ -595,6 +641,17 @@ static inline void local_r4k_flush_icache_range(unsigned long start, unsigned lo
595 break; 641 break;
596 } 642 }
597 } 643 }
644#ifdef CONFIG_EVA
645 /*
646 * Due to all possible segment mappings, there might cache aliases
647 * caused by the bootloader being in non-EVA mode, and the CPU switching
648 * to EVA during early kernel init. It's best to flush the scache
649 * to avoid having secondary cores fetching stale data and lead to
650 * kernel crashes.
651 */
652 bc_wback_inv(start, (end - start));
653 __sync();
654#endif
598} 655}
599 656
600static inline void local_r4k_flush_icache_range_ipi(void *args) 657static inline void local_r4k_flush_icache_range_ipi(void *args)
@@ -617,7 +674,7 @@ static void r4k_flush_icache_range(unsigned long start, unsigned long end)
617 instruction_hazard(); 674 instruction_hazard();
618} 675}
619 676
620#ifdef CONFIG_DMA_NONCOHERENT 677#if defined(CONFIG_DMA_NONCOHERENT) || defined(CONFIG_DMA_MAYBE_COHERENT)
621 678
622static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size) 679static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size)
623{ 680{
@@ -688,7 +745,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size)
688 bc_inv(addr, size); 745 bc_inv(addr, size);
689 __sync(); 746 __sync();
690} 747}
691#endif /* CONFIG_DMA_NONCOHERENT */ 748#endif /* CONFIG_DMA_NONCOHERENT || CONFIG_DMA_MAYBE_COHERENT */
692 749
693/* 750/*
694 * While we're protected against bad userland addresses we don't care 751 * While we're protected against bad userland addresses we don't care
@@ -1010,6 +1067,33 @@ static void probe_pcache(void)
1010 c->dcache.waybit = 0; 1067 c->dcache.waybit = 0;
1011 break; 1068 break;
1012 1069
1070 case CPU_LOONGSON3:
1071 config1 = read_c0_config1();
1072 lsize = (config1 >> 19) & 7;
1073 if (lsize)
1074 c->icache.linesz = 2 << lsize;
1075 else
1076 c->icache.linesz = 0;
1077 c->icache.sets = 64 << ((config1 >> 22) & 7);
1078 c->icache.ways = 1 + ((config1 >> 16) & 7);
1079 icache_size = c->icache.sets *
1080 c->icache.ways *
1081 c->icache.linesz;
1082 c->icache.waybit = 0;
1083
1084 lsize = (config1 >> 10) & 7;
1085 if (lsize)
1086 c->dcache.linesz = 2 << lsize;
1087 else
1088 c->dcache.linesz = 0;
1089 c->dcache.sets = 64 << ((config1 >> 13) & 7);
1090 c->dcache.ways = 1 + ((config1 >> 7) & 7);
1091 dcache_size = c->dcache.sets *
1092 c->dcache.ways *
1093 c->dcache.linesz;
1094 c->dcache.waybit = 0;
1095 break;
1096
1013 default: 1097 default:
1014 if (!(config & MIPS_CONF_M)) 1098 if (!(config & MIPS_CONF_M))
1015 panic("Don't know how to probe P-caches on this cpu."); 1099 panic("Don't know how to probe P-caches on this cpu.");
@@ -1113,13 +1197,21 @@ static void probe_pcache(void)
1113 case CPU_34K: 1197 case CPU_34K:
1114 case CPU_74K: 1198 case CPU_74K:
1115 case CPU_1004K: 1199 case CPU_1004K:
1200 case CPU_1074K:
1116 case CPU_INTERAPTIV: 1201 case CPU_INTERAPTIV:
1202 case CPU_P5600:
1117 case CPU_PROAPTIV: 1203 case CPU_PROAPTIV:
1118 if (current_cpu_type() == CPU_74K) 1204 case CPU_M5150:
1205 if ((c->cputype == CPU_74K) || (c->cputype == CPU_1074K))
1119 alias_74k_erratum(c); 1206 alias_74k_erratum(c);
1120 if ((read_c0_config7() & (1 << 16))) { 1207 if (!(read_c0_config7() & MIPS_CONF7_IAR) &&
1121 /* effectively physically indexed dcache, 1208 (c->icache.waysize > PAGE_SIZE))
1122 thus no virtual aliases. */ 1209 c->icache.flags |= MIPS_CACHE_ALIASES;
1210 if (read_c0_config7() & MIPS_CONF7_AR) {
1211 /*
1212 * Effectively physically indexed dcache,
1213 * thus no virtual aliases.
1214 */
1123 c->dcache.flags |= MIPS_CACHE_PINDEX; 1215 c->dcache.flags |= MIPS_CACHE_PINDEX;
1124 break; 1216 break;
1125 } 1217 }
@@ -1239,6 +1331,33 @@ static void __init loongson2_sc_init(void)
1239 c->options |= MIPS_CPU_INCLUSIVE_CACHES; 1331 c->options |= MIPS_CPU_INCLUSIVE_CACHES;
1240} 1332}
1241 1333
1334static void __init loongson3_sc_init(void)
1335{
1336 struct cpuinfo_mips *c = &current_cpu_data;
1337 unsigned int config2, lsize;
1338
1339 config2 = read_c0_config2();
1340 lsize = (config2 >> 4) & 15;
1341 if (lsize)
1342 c->scache.linesz = 2 << lsize;
1343 else
1344 c->scache.linesz = 0;
1345 c->scache.sets = 64 << ((config2 >> 8) & 15);
1346 c->scache.ways = 1 + (config2 & 15);
1347
1348 scache_size = c->scache.sets *
1349 c->scache.ways *
1350 c->scache.linesz;
1351 /* Loongson-3 has 4 cores, 1MB scache for each. scaches are shared */
1352 scache_size *= 4;
1353 c->scache.waybit = 0;
1354 pr_info("Unified secondary cache %ldkB %s, linesize %d bytes.\n",
1355 scache_size >> 10, way_string[c->scache.ways], c->scache.linesz);
1356 if (scache_size)
1357 c->options |= MIPS_CPU_INCLUSIVE_CACHES;
1358 return;
1359}
1360
1242extern int r5k_sc_init(void); 1361extern int r5k_sc_init(void);
1243extern int rm7k_sc_init(void); 1362extern int rm7k_sc_init(void);
1244extern int mips_sc_init(void); 1363extern int mips_sc_init(void);
@@ -1291,6 +1410,10 @@ static void setup_scache(void)
1291 loongson2_sc_init(); 1410 loongson2_sc_init();
1292 return; 1411 return;
1293 1412
1413 case CPU_LOONGSON3:
1414 loongson3_sc_init();
1415 return;
1416
1294 case CPU_XLP: 1417 case CPU_XLP:
1295 /* don't need to worry about L2, fully coherent */ 1418 /* don't need to worry about L2, fully coherent */
1296 return; 1419 return;
@@ -1461,6 +1584,10 @@ void r4k_cache_init(void)
1461 r4k_blast_scache_page_setup(); 1584 r4k_blast_scache_page_setup();
1462 r4k_blast_scache_page_indexed_setup(); 1585 r4k_blast_scache_page_indexed_setup();
1463 r4k_blast_scache_setup(); 1586 r4k_blast_scache_setup();
1587#ifdef CONFIG_EVA
1588 r4k_blast_dcache_user_page_setup();
1589 r4k_blast_icache_user_page_setup();
1590#endif
1464 1591
1465 /* 1592 /*
1466 * Some MIPS32 and MIPS64 processors have physically indexed caches. 1593 * Some MIPS32 and MIPS64 processors have physically indexed caches.
@@ -1492,7 +1619,7 @@ void r4k_cache_init(void)
1492 flush_icache_range = r4k_flush_icache_range; 1619 flush_icache_range = r4k_flush_icache_range;
1493 local_flush_icache_range = local_r4k_flush_icache_range; 1620 local_flush_icache_range = local_r4k_flush_icache_range;
1494 1621
1495#if defined(CONFIG_DMA_NONCOHERENT) 1622#if defined(CONFIG_DMA_NONCOHERENT) || defined(CONFIG_DMA_MAYBE_COHERENT)
1496 if (coherentio) { 1623 if (coherentio) {
1497 _dma_cache_wback_inv = (void *)cache_noop; 1624 _dma_cache_wback_inv = (void *)cache_noop;
1498 _dma_cache_wback = (void *)cache_noop; 1625 _dma_cache_wback = (void *)cache_noop;
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
index fde7e56d13fe..e422b38d3113 100644
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
@@ -49,7 +49,7 @@ EXPORT_SYMBOL_GPL(local_flush_data_cache_page);
49EXPORT_SYMBOL(flush_data_cache_page); 49EXPORT_SYMBOL(flush_data_cache_page);
50EXPORT_SYMBOL(flush_icache_all); 50EXPORT_SYMBOL(flush_icache_all);
51 51
52#ifdef CONFIG_DMA_NONCOHERENT 52#if defined(CONFIG_DMA_NONCOHERENT) || defined(CONFIG_DMA_MAYBE_COHERENT)
53 53
54/* DMA cache operations. */ 54/* DMA cache operations. */
55void (*_dma_cache_wback_inv)(unsigned long start, unsigned long size); 55void (*_dma_cache_wback_inv)(unsigned long start, unsigned long size);
@@ -58,7 +58,7 @@ void (*_dma_cache_inv)(unsigned long start, unsigned long size);
58 58
59EXPORT_SYMBOL(_dma_cache_wback_inv); 59EXPORT_SYMBOL(_dma_cache_wback_inv);
60 60
61#endif /* CONFIG_DMA_NONCOHERENT */ 61#endif /* CONFIG_DMA_NONCOHERENT || CONFIG_DMA_MAYBE_COHERENT */
62 62
63/* 63/*
64 * We could optimize the case where the cache argument is not BCACHE but 64 * We could optimize the case where the cache argument is not BCACHE but
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 6b59617760c1..4fc74c78265a 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -422,10 +422,20 @@ void free_initrd_mem(unsigned long start, unsigned long end)
422} 422}
423#endif 423#endif
424 424
425void (*free_init_pages_eva)(void *begin, void *end) = NULL;
426
425void __init_refok free_initmem(void) 427void __init_refok free_initmem(void)
426{ 428{
427 prom_free_prom_memory(); 429 prom_free_prom_memory();
428 free_initmem_default(POISON_FREE_INITMEM); 430 /*
431 * Let the platform define a specific function to free the
432 * init section since EVA may have used any possible mapping
433 * between virtual and physical addresses.
434 */
435 if (free_init_pages_eva)
436 free_init_pages_eva((void *)&__init_begin, (void *)&__init_end);
437 else
438 free_initmem_default(POISON_FREE_INITMEM);
429} 439}
430 440
431#ifndef CONFIG_MIPS_PGD_C0_CONTEXT 441#ifndef CONFIG_MIPS_PGD_C0_CONTEXT
diff --git a/arch/mips/mm/sc-mips.c b/arch/mips/mm/sc-mips.c
index 7a56aee5fce7..99eb8fabab60 100644
--- a/arch/mips/mm/sc-mips.c
+++ b/arch/mips/mm/sc-mips.c
@@ -76,8 +76,10 @@ static inline int mips_sc_is_activated(struct cpuinfo_mips *c)
76 case CPU_34K: 76 case CPU_34K:
77 case CPU_74K: 77 case CPU_74K:
78 case CPU_1004K: 78 case CPU_1004K:
79 case CPU_1074K:
79 case CPU_INTERAPTIV: 80 case CPU_INTERAPTIV:
80 case CPU_PROAPTIV: 81 case CPU_PROAPTIV:
82 case CPU_P5600:
81 case CPU_BMIPS5000: 83 case CPU_BMIPS5000:
82 if (config2 & (1 << 12)) 84 if (config2 & (1 << 12))
83 return 0; 85 return 0;
diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c
index ae4ca2450707..eeaf50f5df2b 100644
--- a/arch/mips/mm/tlb-r4k.c
+++ b/arch/mips/mm/tlb-r4k.c
@@ -48,13 +48,14 @@ extern void build_tlb_refill_handler(void);
48#endif /* CONFIG_MIPS_MT_SMTC */ 48#endif /* CONFIG_MIPS_MT_SMTC */
49 49
50/* 50/*
51 * LOONGSON2 has a 4 entry itlb which is a subset of dtlb, 51 * LOONGSON2/3 has a 4 entry itlb which is a subset of dtlb,
52 * unfortrunately, itlb is not totally transparent to software. 52 * unfortunately, itlb is not totally transparent to software.
53 */ 53 */
54static inline void flush_itlb(void) 54static inline void flush_itlb(void)
55{ 55{
56 switch (current_cpu_type()) { 56 switch (current_cpu_type()) {
57 case CPU_LOONGSON2: 57 case CPU_LOONGSON2:
58 case CPU_LOONGSON3:
58 write_c0_diag(4); 59 write_c0_diag(4);
59 break; 60 break;
60 default: 61 default:
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index b234b1b5ccad..ee88367ab3ad 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -509,7 +509,10 @@ static void build_tlb_write_entry(u32 **p, struct uasm_label **l,
509 switch (current_cpu_type()) { 509 switch (current_cpu_type()) {
510 case CPU_M14KC: 510 case CPU_M14KC:
511 case CPU_74K: 511 case CPU_74K:
512 case CPU_1074K:
512 case CPU_PROAPTIV: 513 case CPU_PROAPTIV:
514 case CPU_P5600:
515 case CPU_M5150:
513 break; 516 break;
514 517
515 default: 518 default:
@@ -579,6 +582,7 @@ static void build_tlb_write_entry(u32 **p, struct uasm_label **l,
579 case CPU_BMIPS4380: 582 case CPU_BMIPS4380:
580 case CPU_BMIPS5000: 583 case CPU_BMIPS5000:
581 case CPU_LOONGSON2: 584 case CPU_LOONGSON2:
585 case CPU_LOONGSON3:
582 case CPU_R5500: 586 case CPU_R5500:
583 if (m4kc_tlbp_war()) 587 if (m4kc_tlbp_war())
584 uasm_i_nop(p); 588 uasm_i_nop(p);
@@ -621,7 +625,7 @@ static void build_tlb_write_entry(u32 **p, struct uasm_label **l,
621 625
622 default: 626 default:
623 panic("No TLB refill handler yet (CPU type: %d)", 627 panic("No TLB refill handler yet (CPU type: %d)",
624 current_cpu_data.cputype); 628 current_cpu_type());
625 break; 629 break;
626 } 630 }
627} 631}
diff --git a/arch/mips/mti-malta/malta-init.c b/arch/mips/mti-malta/malta-init.c
index fcebfced26d0..4f9e44d358b7 100644
--- a/arch/mips/mti-malta/malta-init.c
+++ b/arch/mips/mti-malta/malta-init.c
@@ -20,7 +20,8 @@
20#include <asm/smp-ops.h> 20#include <asm/smp-ops.h>
21#include <asm/traps.h> 21#include <asm/traps.h>
22#include <asm/fw/fw.h> 22#include <asm/fw/fw.h>
23#include <asm/gcmpregs.h> 23#include <asm/mips-cm.h>
24#include <asm/mips-cpc.h>
24#include <asm/mips-boards/generic.h> 25#include <asm/mips-boards/generic.h>
25#include <asm/mips-boards/malta.h> 26#include <asm/mips-boards/malta.h>
26 27
@@ -110,6 +111,11 @@ static void __init mips_ejtag_setup(void)
110 flush_icache_range((unsigned long)base, (unsigned long)base + 0x80); 111 flush_icache_range((unsigned long)base, (unsigned long)base + 0x80);
111} 112}
112 113
114phys_t mips_cpc_default_phys_base(void)
115{
116 return CPC_BASE_ADDR;
117}
118
113extern struct plat_smp_ops msmtc_smp_ops; 119extern struct plat_smp_ops msmtc_smp_ops;
114 120
115void __init prom_init(void) 121void __init prom_init(void)
@@ -238,10 +244,23 @@ mips_pci_controller:
238 MSC01_PCI_SWAP_BYTESWAP << MSC01_PCI_SWAP_MEM_SHF | 244 MSC01_PCI_SWAP_BYTESWAP << MSC01_PCI_SWAP_MEM_SHF |
239 MSC01_PCI_SWAP_BYTESWAP << MSC01_PCI_SWAP_BAR0_SHF); 245 MSC01_PCI_SWAP_BYTESWAP << MSC01_PCI_SWAP_BAR0_SHF);
240#endif 246#endif
247#ifndef CONFIG_EVA
241 /* Fix up target memory mapping. */ 248 /* Fix up target memory mapping. */
242 MSC_READ(MSC01_PCI_BAR0, mask); 249 MSC_READ(MSC01_PCI_BAR0, mask);
243 MSC_WRITE(MSC01_PCI_P2SCMSKL, mask & MSC01_PCI_BAR0_SIZE_MSK); 250 MSC_WRITE(MSC01_PCI_P2SCMSKL, mask & MSC01_PCI_BAR0_SIZE_MSK);
251#else
252 /*
253 * Setup the Malta max (2GB) memory for PCI DMA in host bridge
254 * in transparent addressing mode, starting from 0x80000000.
255 */
256 mask = PHYS_OFFSET | (1<<3);
257 MSC_WRITE(MSC01_PCI_BAR0, mask);
244 258
259 mask = PHYS_OFFSET;
260 MSC_WRITE(MSC01_PCI_HEAD4, mask);
261 MSC_WRITE(MSC01_PCI_P2SCMSKL, mask);
262 MSC_WRITE(MSC01_PCI_P2SCMAPL, mask);
263#endif
245 /* Don't handle target retries indefinitely. */ 264 /* Don't handle target retries indefinitely. */
246 if ((data & MSC01_PCI_CFG_MAXRTRY_MSK) == 265 if ((data & MSC01_PCI_CFG_MAXRTRY_MSK) ==
247 MSC01_PCI_CFG_MAXRTRY_MSK) 266 MSC01_PCI_CFG_MAXRTRY_MSK)
@@ -276,10 +295,13 @@ mips_pci_controller:
276 console_config(); 295 console_config();
277#endif 296#endif
278 /* Early detection of CMP support */ 297 /* Early detection of CMP support */
279 if (gcmp_probe(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ)) 298 mips_cm_probe();
280 if (!register_cmp_smp_ops()) 299 mips_cpc_probe();
281 return;
282 300
301 if (!register_cps_smp_ops())
302 return;
303 if (!register_cmp_smp_ops())
304 return;
283 if (!register_vsmp_smp_ops()) 305 if (!register_vsmp_smp_ops())
284 return; 306 return;
285 307
diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c
index 2242181a6284..b71ee809191a 100644
--- a/arch/mips/mti-malta/malta-int.c
+++ b/arch/mips/mti-malta/malta-int.c
@@ -26,6 +26,7 @@
26#include <asm/i8259.h> 26#include <asm/i8259.h>
27#include <asm/irq_cpu.h> 27#include <asm/irq_cpu.h>
28#include <asm/irq_regs.h> 28#include <asm/irq_regs.h>
29#include <asm/mips-cm.h>
29#include <asm/mips-boards/malta.h> 30#include <asm/mips-boards/malta.h>
30#include <asm/mips-boards/maltaint.h> 31#include <asm/mips-boards/maltaint.h>
31#include <asm/gt64120.h> 32#include <asm/gt64120.h>
@@ -33,13 +34,10 @@
33#include <asm/mips-boards/msc01_pci.h> 34#include <asm/mips-boards/msc01_pci.h>
34#include <asm/msc01_ic.h> 35#include <asm/msc01_ic.h>
35#include <asm/gic.h> 36#include <asm/gic.h>
36#include <asm/gcmpregs.h>
37#include <asm/setup.h> 37#include <asm/setup.h>
38#include <asm/rtlx.h> 38#include <asm/rtlx.h>
39 39
40int gcmp_present = -1;
41static unsigned long _msc01_biu_base; 40static unsigned long _msc01_biu_base;
42static unsigned long _gcmp_base;
43static unsigned int ipi_map[NR_CPUS]; 41static unsigned int ipi_map[NR_CPUS];
44 42
45static DEFINE_RAW_SPINLOCK(mips_irq_lock); 43static DEFINE_RAW_SPINLOCK(mips_irq_lock);
@@ -288,10 +286,6 @@ asmlinkage void plat_irq_dispatch(void)
288 286
289#ifdef CONFIG_MIPS_MT_SMP 287#ifdef CONFIG_MIPS_MT_SMP
290 288
291
292#define GIC_MIPS_CPU_IPI_RESCHED_IRQ 3
293#define GIC_MIPS_CPU_IPI_CALL_IRQ 4
294
295#define MIPS_CPU_IPI_RESCHED_IRQ 0 /* SW int 0 for resched */ 289#define MIPS_CPU_IPI_RESCHED_IRQ 0 /* SW int 0 for resched */
296#define C_RESCHED C_SW0 290#define C_RESCHED C_SW0
297#define MIPS_CPU_IPI_CALL_IRQ 1 /* SW int 1 for resched */ 291#define MIPS_CPU_IPI_CALL_IRQ 1 /* SW int 1 for resched */
@@ -308,6 +302,13 @@ static void ipi_call_dispatch(void)
308 do_IRQ(MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_CALL_IRQ); 302 do_IRQ(MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_CALL_IRQ);
309} 303}
310 304
305#endif /* CONFIG_MIPS_MT_SMP */
306
307#ifdef CONFIG_MIPS_GIC_IPI
308
309#define GIC_MIPS_CPU_IPI_RESCHED_IRQ 3
310#define GIC_MIPS_CPU_IPI_CALL_IRQ 4
311
311static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id) 312static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id)
312{ 313{
313#ifdef CONFIG_MIPS_VPE_APSP_API_CMP 314#ifdef CONFIG_MIPS_VPE_APSP_API_CMP
@@ -338,7 +339,7 @@ static struct irqaction irq_call = {
338 .flags = IRQF_PERCPU, 339 .flags = IRQF_PERCPU,
339 .name = "IPI_call" 340 .name = "IPI_call"
340}; 341};
341#endif /* CONFIG_MIPS_MT_SMP */ 342#endif /* CONFIG_MIPS_GIC_IPI */
342 343
343static int gic_resched_int_base; 344static int gic_resched_int_base;
344static int gic_call_int_base; 345static int gic_call_int_base;
@@ -418,49 +419,7 @@ static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = {
418}; 419};
419#undef X 420#undef X
420 421
421/* 422#ifdef CONFIG_MIPS_GIC_IPI
422 * GCMP needs to be detected before any SMP initialisation
423 */
424int __init gcmp_probe(unsigned long addr, unsigned long size)
425{
426 if ((mips_revision_sconid != MIPS_REVISION_SCON_ROCIT) &&
427 (mips_revision_sconid != MIPS_REVISION_SCON_GT64120)) {
428 gcmp_present = 0;
429 pr_debug("GCMP NOT present\n");
430 return gcmp_present;
431 }
432
433 if (gcmp_present >= 0)
434 return gcmp_present;
435
436 _gcmp_base = (unsigned long) ioremap_nocache(GCMP_BASE_ADDR,
437 GCMP_ADDRSPACE_SZ);
438 _msc01_biu_base = (unsigned long) ioremap_nocache(MSC01_BIU_REG_BASE,
439 MSC01_BIU_ADDRSPACE_SZ);
440 gcmp_present = ((GCMPGCB(GCMPB) & GCMP_GCB_GCMPB_GCMPBASE_MSK) ==
441 GCMP_BASE_ADDR);
442
443 if (gcmp_present)
444 pr_debug("GCMP present\n");
445 return gcmp_present;
446}
447
448/* Return the number of IOCU's present */
449int __init gcmp_niocu(void)
450{
451 return gcmp_present ? ((GCMPGCB(GC) & GCMP_GCB_GC_NUMIOCU_MSK) >>
452 GCMP_GCB_GC_NUMIOCU_SHF) : 0;
453}
454
455/* Set GCMP region attributes */
456void __init gcmp_setregion(int region, unsigned long base,
457 unsigned long mask, int type)
458{
459 GCMPGCBn(CMxBASE, region) = base;
460 GCMPGCBn(CMxMASK, region) = mask | type;
461}
462
463#if defined(CONFIG_MIPS_MT_SMP)
464static void __init fill_ipi_map1(int baseintr, int cpu, int cpupin) 423static void __init fill_ipi_map1(int baseintr, int cpu, int cpupin)
465{ 424{
466 int intr = baseintr + cpu; 425 int intr = baseintr + cpu;
@@ -496,8 +455,8 @@ void __init arch_init_irq(void)
496 if (!cpu_has_veic) 455 if (!cpu_has_veic)
497 mips_cpu_irq_init(); 456 mips_cpu_irq_init();
498 457
499 if (gcmp_present) { 458 if (mips_cm_present()) {
500 GCMPGCB(GICBA) = GIC_BASE_ADDR | GCMP_GCB_GICBA_EN_MSK; 459 write_gcr_gic_base(GIC_BASE_ADDR | CM_GCR_GIC_BASE_GICEN_MSK);
501 gic_present = 1; 460 gic_present = 1;
502 } else { 461 } else {
503 if (mips_revision_sconid == MIPS_REVISION_SCON_ROCIT) { 462 if (mips_revision_sconid == MIPS_REVISION_SCON_ROCIT) {
@@ -576,7 +535,7 @@ void __init arch_init_irq(void)
576 if (gic_present) { 535 if (gic_present) {
577 /* FIXME */ 536 /* FIXME */
578 int i; 537 int i;
579#if defined(CONFIG_MIPS_MT_SMP) 538#if defined(CONFIG_MIPS_GIC_IPI)
580 gic_call_int_base = GIC_NUM_INTRS - 539 gic_call_int_base = GIC_NUM_INTRS -
581 (NR_CPUS - nr_cpu_ids) * 2 - nr_cpu_ids; 540 (NR_CPUS - nr_cpu_ids) * 2 - nr_cpu_ids;
582 gic_resched_int_base = gic_call_int_base - nr_cpu_ids; 541 gic_resched_int_base = gic_call_int_base - nr_cpu_ids;
@@ -584,14 +543,14 @@ void __init arch_init_irq(void)
584#endif 543#endif
585 gic_init(GIC_BASE_ADDR, GIC_ADDRSPACE_SZ, gic_intr_map, 544 gic_init(GIC_BASE_ADDR, GIC_ADDRSPACE_SZ, gic_intr_map,
586 ARRAY_SIZE(gic_intr_map), MIPS_GIC_IRQ_BASE); 545 ARRAY_SIZE(gic_intr_map), MIPS_GIC_IRQ_BASE);
587 if (!gcmp_present) { 546 if (!mips_cm_present()) {
588 /* Enable the GIC */ 547 /* Enable the GIC */
589 i = REG(_msc01_biu_base, MSC01_SC_CFG); 548 i = REG(_msc01_biu_base, MSC01_SC_CFG);
590 REG(_msc01_biu_base, MSC01_SC_CFG) = 549 REG(_msc01_biu_base, MSC01_SC_CFG) =
591 (i | (0x1 << MSC01_SC_CFG_GICENA_SHF)); 550 (i | (0x1 << MSC01_SC_CFG_GICENA_SHF));
592 pr_debug("GIC Enabled\n"); 551 pr_debug("GIC Enabled\n");
593 } 552 }
594#if defined(CONFIG_MIPS_MT_SMP) 553#if defined(CONFIG_MIPS_GIC_IPI)
595 /* set up ipi interrupts */ 554 /* set up ipi interrupts */
596 if (cpu_has_vint) { 555 if (cpu_has_vint) {
597 set_vi_handler(MIPSCPU_INT_IPI0, malta_ipi_irqdispatch); 556 set_vi_handler(MIPSCPU_INT_IPI0, malta_ipi_irqdispatch);
@@ -708,16 +667,16 @@ int malta_be_handler(struct pt_regs *regs, int is_fixup)
708 /* This duplicates the handling in do_be which seems wrong */ 667 /* This duplicates the handling in do_be which seems wrong */
709 int retval = is_fixup ? MIPS_BE_FIXUP : MIPS_BE_FATAL; 668 int retval = is_fixup ? MIPS_BE_FIXUP : MIPS_BE_FATAL;
710 669
711 if (gcmp_present) { 670 if (mips_cm_present()) {
712 unsigned long cm_error = GCMPGCB(GCMEC); 671 unsigned long cm_error = read_gcr_error_cause();
713 unsigned long cm_addr = GCMPGCB(GCMEA); 672 unsigned long cm_addr = read_gcr_error_addr();
714 unsigned long cm_other = GCMPGCB(GCMEO); 673 unsigned long cm_other = read_gcr_error_mult();
715 unsigned long cause, ocause; 674 unsigned long cause, ocause;
716 char buf[256]; 675 char buf[256];
717 676
718 cause = (cm_error & GCMP_GCB_GMEC_ERROR_TYPE_MSK); 677 cause = cm_error & CM_GCR_ERROR_CAUSE_ERRTYPE_MSK;
719 if (cause != 0) { 678 if (cause != 0) {
720 cause >>= GCMP_GCB_GMEC_ERROR_TYPE_SHF; 679 cause >>= CM_GCR_ERROR_CAUSE_ERRTYPE_SHF;
721 if (cause < 16) { 680 if (cause < 16) {
722 unsigned long cca_bits = (cm_error >> 15) & 7; 681 unsigned long cca_bits = (cm_error >> 15) & 7;
723 unsigned long tr_bits = (cm_error >> 12) & 7; 682 unsigned long tr_bits = (cm_error >> 12) & 7;
@@ -748,8 +707,8 @@ int malta_be_handler(struct pt_regs *regs, int is_fixup)
748 mcmd[cmd_bits], sport_bits); 707 mcmd[cmd_bits], sport_bits);
749 } 708 }
750 709
751 ocause = (cm_other & GCMP_GCB_GMEO_ERROR_2ND_MSK) >> 710 ocause = (cm_other & CM_GCR_ERROR_MULT_ERR2ND_MSK) >>
752 GCMP_GCB_GMEO_ERROR_2ND_SHF; 711 CM_GCR_ERROR_MULT_ERR2ND_SHF;
753 712
754 pr_err("CM_ERROR=%08lx %s <%s>\n", cm_error, 713 pr_err("CM_ERROR=%08lx %s <%s>\n", cm_error,
755 causes[cause], buf); 714 causes[cause], buf);
@@ -757,7 +716,7 @@ int malta_be_handler(struct pt_regs *regs, int is_fixup)
757 pr_err("CM_OTHER=%08lx %s\n", cm_other, causes[ocause]); 716 pr_err("CM_OTHER=%08lx %s\n", cm_other, causes[ocause]);
758 717
759 /* reprime cause register */ 718 /* reprime cause register */
760 GCMPGCB(GCMEC) = 0; 719 write_gcr_error_cause(0);
761 } 720 }
762 } 721 }
763 722
diff --git a/arch/mips/mti-malta/malta-memory.c b/arch/mips/mti-malta/malta-memory.c
index 1f73d63e92a7..6d0f4ab3632d 100644
--- a/arch/mips/mti-malta/malta-memory.c
+++ b/arch/mips/mti-malta/malta-memory.c
@@ -24,22 +24,30 @@ static fw_memblock_t mdesc[FW_MAX_MEMBLOCKS];
24/* determined physical memory size, not overridden by command line args */ 24/* determined physical memory size, not overridden by command line args */
25unsigned long physical_memsize = 0L; 25unsigned long physical_memsize = 0L;
26 26
27fw_memblock_t * __init fw_getmdesc(void) 27fw_memblock_t * __init fw_getmdesc(int eva)
28{ 28{
29 char *memsize_str, *ptr; 29 char *memsize_str, *ememsize_str __maybe_unused = NULL, *ptr;
30 unsigned int memsize; 30 unsigned long memsize, ememsize __maybe_unused = 0;
31 static char cmdline[COMMAND_LINE_SIZE] __initdata; 31 static char cmdline[COMMAND_LINE_SIZE] __initdata;
32 long val;
33 int tmp; 32 int tmp;
34 33
35 /* otherwise look in the environment */ 34 /* otherwise look in the environment */
35
36 memsize_str = fw_getenv("memsize"); 36 memsize_str = fw_getenv("memsize");
37 if (!memsize_str) { 37 if (memsize_str)
38 tmp = kstrtol(memsize_str, 0, &memsize);
39 if (eva) {
40 /* Look for ememsize for EVA */
41 ememsize_str = fw_getenv("ememsize");
42 if (ememsize_str)
43 tmp = kstrtol(ememsize_str, 0, &ememsize);
44 }
45 if (!memsize && !ememsize) {
38 pr_warn("memsize not set in YAMON, set to default (32Mb)\n"); 46 pr_warn("memsize not set in YAMON, set to default (32Mb)\n");
39 physical_memsize = 0x02000000; 47 physical_memsize = 0x02000000;
40 } else { 48 } else {
41 tmp = kstrtol(memsize_str, 0, &val); 49 /* If ememsize is set, then set physical_memsize to that */
42 physical_memsize = (unsigned long)val; 50 physical_memsize = ememsize ? : memsize;
43 } 51 }
44 52
45#ifdef CONFIG_CPU_BIG_ENDIAN 53#ifdef CONFIG_CPU_BIG_ENDIAN
@@ -54,20 +62,30 @@ fw_memblock_t * __init fw_getmdesc(void)
54 ptr = strstr(cmdline, "memsize="); 62 ptr = strstr(cmdline, "memsize=");
55 if (ptr && (ptr != cmdline) && (*(ptr - 1) != ' ')) 63 if (ptr && (ptr != cmdline) && (*(ptr - 1) != ' '))
56 ptr = strstr(ptr, " memsize="); 64 ptr = strstr(ptr, " memsize=");
65 /* And now look for ememsize */
66 if (eva) {
67 ptr = strstr(cmdline, "ememsize=");
68 if (ptr && (ptr != cmdline) && (*(ptr - 1) != ' '))
69 ptr = strstr(ptr, " ememsize=");
70 }
57 71
58 if (ptr) 72 if (ptr)
59 memsize = memparse(ptr + 8, &ptr); 73 memsize = memparse(ptr + 8 + (eva ? 1 : 0), &ptr);
60 else 74 else
61 memsize = physical_memsize; 75 memsize = physical_memsize;
62 76
77 /* Last 64K for HIGHMEM arithmetics */
78 if (memsize > 0x7fff0000)
79 memsize = 0x7fff0000;
80
63 memset(mdesc, 0, sizeof(mdesc)); 81 memset(mdesc, 0, sizeof(mdesc));
64 82
65 mdesc[0].type = fw_dontuse; 83 mdesc[0].type = fw_dontuse;
66 mdesc[0].base = 0x00000000; 84 mdesc[0].base = PHYS_OFFSET;
67 mdesc[0].size = 0x00001000; 85 mdesc[0].size = 0x00001000;
68 86
69 mdesc[1].type = fw_code; 87 mdesc[1].type = fw_code;
70 mdesc[1].base = 0x00001000; 88 mdesc[1].base = mdesc[0].base + 0x00001000UL;
71 mdesc[1].size = 0x000ef000; 89 mdesc[1].size = 0x000ef000;
72 90
73 /* 91 /*
@@ -78,21 +96,27 @@ fw_memblock_t * __init fw_getmdesc(void)
78 * devices. 96 * devices.
79 */ 97 */
80 mdesc[2].type = fw_dontuse; 98 mdesc[2].type = fw_dontuse;
81 mdesc[2].base = 0x000f0000; 99 mdesc[2].base = mdesc[0].base + 0x000f0000UL;
82 mdesc[2].size = 0x00010000; 100 mdesc[2].size = 0x00010000;
83 101
84 mdesc[3].type = fw_dontuse; 102 mdesc[3].type = fw_dontuse;
85 mdesc[3].base = 0x00100000; 103 mdesc[3].base = mdesc[0].base + 0x00100000UL;
86 mdesc[3].size = CPHYSADDR(PFN_ALIGN((unsigned long)&_end)) - 104 mdesc[3].size = CPHYSADDR(PFN_ALIGN((unsigned long)&_end)) -
87 mdesc[3].base; 105 0x00100000UL;
88 106
89 mdesc[4].type = fw_free; 107 mdesc[4].type = fw_free;
90 mdesc[4].base = CPHYSADDR(PFN_ALIGN(&_end)); 108 mdesc[4].base = mdesc[0].base + CPHYSADDR(PFN_ALIGN(&_end));
91 mdesc[4].size = memsize - mdesc[4].base; 109 mdesc[4].size = memsize - CPHYSADDR(mdesc[4].base);
92 110
93 return &mdesc[0]; 111 return &mdesc[0];
94} 112}
95 113
114static void free_init_pages_eva_malta(void *begin, void *end)
115{
116 free_init_pages("unused kernel", __pa_symbol((unsigned long *)begin),
117 __pa_symbol((unsigned long *)end));
118}
119
96static int __init fw_memtype_classify(unsigned int type) 120static int __init fw_memtype_classify(unsigned int type)
97{ 121{
98 switch (type) { 122 switch (type) {
@@ -109,7 +133,9 @@ void __init fw_meminit(void)
109{ 133{
110 fw_memblock_t *p; 134 fw_memblock_t *p;
111 135
112 p = fw_getmdesc(); 136 p = fw_getmdesc(config_enabled(CONFIG_EVA));
137 free_init_pages_eva = (config_enabled(CONFIG_EVA) ?
138 free_init_pages_eva_malta : NULL);
113 139
114 while (p->size) { 140 while (p->size) {
115 long type; 141 long type;
diff --git a/arch/mips/mti-malta/malta-setup.c b/arch/mips/mti-malta/malta-setup.c
index c72a06936781..bf621516afff 100644
--- a/arch/mips/mti-malta/malta-setup.c
+++ b/arch/mips/mti-malta/malta-setup.c
@@ -26,12 +26,12 @@
26#include <linux/time.h> 26#include <linux/time.h>
27 27
28#include <asm/fw/fw.h> 28#include <asm/fw/fw.h>
29#include <asm/mips-cm.h>
29#include <asm/mips-boards/generic.h> 30#include <asm/mips-boards/generic.h>
30#include <asm/mips-boards/malta.h> 31#include <asm/mips-boards/malta.h>
31#include <asm/mips-boards/maltaint.h> 32#include <asm/mips-boards/maltaint.h>
32#include <asm/dma.h> 33#include <asm/dma.h>
33#include <asm/traps.h> 34#include <asm/traps.h>
34#include <asm/gcmpregs.h>
35#ifdef CONFIG_VT 35#ifdef CONFIG_VT
36#include <linux/console.h> 36#include <linux/console.h>
37#endif 37#endif
@@ -127,7 +127,7 @@ static int __init plat_enable_iocoherency(void)
127 BONITO_PCIMEMBASECFG_MEMBASE1_CACHED); 127 BONITO_PCIMEMBASECFG_MEMBASE1_CACHED);
128 pr_info("Enabled Bonito IOBC coherency\n"); 128 pr_info("Enabled Bonito IOBC coherency\n");
129 } 129 }
130 } else if (gcmp_niocu() != 0) { 130 } else if (mips_cm_numiocu() != 0) {
131 /* Nothing special needs to be done to enable coherency */ 131 /* Nothing special needs to be done to enable coherency */
132 pr_info("CMP IOCU detected\n"); 132 pr_info("CMP IOCU detected\n");
133 if ((*(unsigned int *)0xbf403000 & 0x81) != 0x81) { 133 if ((*(unsigned int *)0xbf403000 & 0x81) != 0x81) {
@@ -165,7 +165,6 @@ static void __init plat_setup_iocoherency(void)
165#endif 165#endif
166} 166}
167 167
168#ifdef CONFIG_BLK_DEV_IDE
169static void __init pci_clock_check(void) 168static void __init pci_clock_check(void)
170{ 169{
171 unsigned int __iomem *jmpr_p = 170 unsigned int __iomem *jmpr_p =
@@ -175,18 +174,25 @@ static void __init pci_clock_check(void)
175 33, 20, 25, 30, 12, 16, 37, 10 174 33, 20, 25, 30, 12, 16, 37, 10
176 }; 175 };
177 int pciclock = pciclocks[jmpr]; 176 int pciclock = pciclocks[jmpr];
178 char *argptr = fw_getcmdline(); 177 char *optptr, *argptr = fw_getcmdline();
179 178
180 if (pciclock != 33 && !strstr(argptr, "idebus=")) { 179 /*
181 pr_warn("WARNING: PCI clock is %dMHz, setting idebus\n", 180 * If user passed a pci_clock= option, don't tack on another one
181 */
182 optptr = strstr(argptr, "pci_clock=");
183 if (optptr && (optptr == argptr || optptr[-1] == ' '))
184 return;
185
186 if (pciclock != 33) {
187 pr_warn("WARNING: PCI clock is %dMHz, setting pci_clock\n",
182 pciclock); 188 pciclock);
183 argptr += strlen(argptr); 189 argptr += strlen(argptr);
184 sprintf(argptr, " idebus=%d", pciclock); 190 sprintf(argptr, " pci_clock=%d", pciclock);
185 if (pciclock < 20 || pciclock > 66) 191 if (pciclock < 20 || pciclock > 66)
186 pr_warn("WARNING: IDE timing calculations will be incorrect\n"); 192 pr_warn("WARNING: IDE timing calculations will be "
193 "incorrect\n");
187 } 194 }
188} 195}
189#endif
190 196
191#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) 197#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE)
192static void __init screen_info_setup(void) 198static void __init screen_info_setup(void)
@@ -247,6 +253,10 @@ void __init plat_mem_setup(void)
247{ 253{
248 unsigned int i; 254 unsigned int i;
249 255
256 if (config_enabled(CONFIG_EVA))
257 /* EVA has already been configured in mach-malta/kernel-init.h */
258 pr_info("Enhanced Virtual Addressing (EVA) activated\n");
259
250 mips_pcibios_init(); 260 mips_pcibios_init();
251 261
252 /* Request I/O space for devices used on the Malta board. */ 262 /* Request I/O space for devices used on the Malta board. */
@@ -268,9 +278,7 @@ void __init plat_mem_setup(void)
268 278
269 plat_setup_iocoherency(); 279 plat_setup_iocoherency();
270 280
271#ifdef CONFIG_BLK_DEV_IDE
272 pci_clock_check(); 281 pci_clock_check();
273#endif
274 282
275#ifdef CONFIG_BLK_DEV_FD 283#ifdef CONFIG_BLK_DEV_FD
276 fd_activate(); 284 fd_activate();
diff --git a/arch/mips/mti-sead3/sead3-mtd.c b/arch/mips/mti-sead3/sead3-mtd.c
index ffa35f509789..f9c890d72677 100644
--- a/arch/mips/mti-sead3/sead3-mtd.c
+++ b/arch/mips/mti-sead3/sead3-mtd.c
@@ -50,5 +50,4 @@ static int __init sead3_mtd_init(void)
50 50
51 return 0; 51 return 0;
52} 52}
53 53device_initcall(sead3_mtd_init);
54module_init(sead3_mtd_init)
diff --git a/arch/mips/oprofile/common.c b/arch/mips/oprofile/common.c
index 2a86e38872a7..e74732449478 100644
--- a/arch/mips/oprofile/common.c
+++ b/arch/mips/oprofile/common.c
@@ -86,8 +86,11 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
86 case CPU_34K: 86 case CPU_34K:
87 case CPU_1004K: 87 case CPU_1004K:
88 case CPU_74K: 88 case CPU_74K:
89 case CPU_1074K:
89 case CPU_INTERAPTIV: 90 case CPU_INTERAPTIV:
90 case CPU_PROAPTIV: 91 case CPU_PROAPTIV:
92 case CPU_P5600:
93 case CPU_M5150:
91 case CPU_LOONGSON1: 94 case CPU_LOONGSON1:
92 case CPU_SB1: 95 case CPU_SB1:
93 case CPU_SB1A: 96 case CPU_SB1A:
diff --git a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c
index 4d94d75ec6f9..42821ae2d77e 100644
--- a/arch/mips/oprofile/op_model_mipsxx.c
+++ b/arch/mips/oprofile/op_model_mipsxx.c
@@ -372,6 +372,7 @@ static int __init mipsxx_init(void)
372 op_model_mipsxx_ops.cpu_type = "mips/34K"; 372 op_model_mipsxx_ops.cpu_type = "mips/34K";
373 break; 373 break;
374 374
375 case CPU_1074K:
375 case CPU_74K: 376 case CPU_74K:
376 op_model_mipsxx_ops.cpu_type = "mips/74K"; 377 op_model_mipsxx_ops.cpu_type = "mips/74K";
377 break; 378 break;
@@ -384,6 +385,14 @@ static int __init mipsxx_init(void)
384 op_model_mipsxx_ops.cpu_type = "mips/proAptiv"; 385 op_model_mipsxx_ops.cpu_type = "mips/proAptiv";
385 break; 386 break;
386 387
388 case CPU_P5600:
389 op_model_mipsxx_ops.cpu_type = "mips/P5600";
390 break;
391
392 case CPU_M5150:
393 op_model_mipsxx_ops.cpu_type = "mips/M5150";
394 break;
395
387 case CPU_5KC: 396 case CPU_5KC:
388 op_model_mipsxx_ops.cpu_type = "mips/5K"; 397 op_model_mipsxx_ops.cpu_type = "mips/5K";
389 break; 398 break;
diff --git a/arch/mips/pci/Makefile b/arch/mips/pci/Makefile
index 137f2a6feb25..d61138a177cc 100644
--- a/arch/mips/pci/Makefile
+++ b/arch/mips/pci/Makefile
@@ -29,6 +29,7 @@ obj-$(CONFIG_LASAT) += pci-lasat.o
29obj-$(CONFIG_MIPS_COBALT) += fixup-cobalt.o 29obj-$(CONFIG_MIPS_COBALT) += fixup-cobalt.o
30obj-$(CONFIG_LEMOTE_FULOONG2E) += fixup-fuloong2e.o ops-loongson2.o 30obj-$(CONFIG_LEMOTE_FULOONG2E) += fixup-fuloong2e.o ops-loongson2.o
31obj-$(CONFIG_LEMOTE_MACH2F) += fixup-lemote2f.o ops-loongson2.o 31obj-$(CONFIG_LEMOTE_MACH2F) += fixup-lemote2f.o ops-loongson2.o
32obj-$(CONFIG_LEMOTE_MACH3A) += fixup-loongson3.o ops-loongson3.o
32obj-$(CONFIG_MIPS_MALTA) += fixup-malta.o pci-malta.o 33obj-$(CONFIG_MIPS_MALTA) += fixup-malta.o pci-malta.o
33obj-$(CONFIG_PMC_MSP7120_GW) += fixup-pmcmsp.o ops-pmcmsp.o 34obj-$(CONFIG_PMC_MSP7120_GW) += fixup-pmcmsp.o ops-pmcmsp.o
34obj-$(CONFIG_PMC_MSP7120_EVAL) += fixup-pmcmsp.o ops-pmcmsp.o 35obj-$(CONFIG_PMC_MSP7120_EVAL) += fixup-pmcmsp.o ops-pmcmsp.o
diff --git a/arch/mips/pci/fixup-loongson3.c b/arch/mips/pci/fixup-loongson3.c
new file mode 100644
index 000000000000..d708ae46d325
--- /dev/null
+++ b/arch/mips/pci/fixup-loongson3.c
@@ -0,0 +1,66 @@
1/*
2 * fixup-loongson3.c
3 *
4 * Copyright (C) 2012 Lemote, Inc.
5 * Author: Xiang Yu, xiangy@lemote.com
6 * Chen Huacai, chenhc@lemote.com
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 */
25
26#include <linux/pci.h>
27#include <boot_param.h>
28
29static void print_fixup_info(const struct pci_dev *pdev)
30{
31 dev_info(&pdev->dev, "Device %x:%x, irq %d\n",
32 pdev->vendor, pdev->device, pdev->irq);
33}
34
35int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
36{
37 print_fixup_info(dev);
38 return dev->irq;
39}
40
41static void pci_fixup_radeon(struct pci_dev *pdev)
42{
43 if (pdev->resource[PCI_ROM_RESOURCE].start)
44 return;
45
46 if (!loongson_sysconf.vgabios_addr)
47 return;
48
49 pdev->resource[PCI_ROM_RESOURCE].start =
50 loongson_sysconf.vgabios_addr;
51 pdev->resource[PCI_ROM_RESOURCE].end =
52 loongson_sysconf.vgabios_addr + 256*1024 - 1;
53 pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_COPY;
54
55 dev_info(&pdev->dev, "BAR %d: assigned %pR for Radeon ROM\n",
56 PCI_ROM_RESOURCE, &pdev->resource[PCI_ROM_RESOURCE]);
57}
58
59DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_ATI, PCI_ANY_ID,
60 PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_radeon);
61
62/* Do platform specific device initialization at pci_enable_device() time */
63int pcibios_plat_dev_init(struct pci_dev *dev)
64{
65 return 0;
66}
diff --git a/arch/mips/pci/fixup-malta.c b/arch/mips/pci/fixup-malta.c
index 7a0eda782e35..2f9e52a1a750 100644
--- a/arch/mips/pci/fixup-malta.c
+++ b/arch/mips/pci/fixup-malta.c
@@ -51,6 +51,19 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
51 return 0; 51 return 0;
52} 52}
53 53
54static void malta_piix_func3_base_fixup(struct pci_dev *dev)
55{
56 /* Set a sane PM I/O base address */
57 pci_write_config_word(dev, PIIX4_FUNC3_PMBA, 0x1000);
58
59 /* Enable access to the PM I/O region */
60 pci_write_config_byte(dev, PIIX4_FUNC3_PMREGMISC,
61 PIIX4_FUNC3_PMREGMISC_EN);
62}
63
64DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3,
65 malta_piix_func3_base_fixup);
66
54static void malta_piix_func0_fixup(struct pci_dev *pdev) 67static void malta_piix_func0_fixup(struct pci_dev *pdev)
55{ 68{
56 unsigned char reg_val; 69 unsigned char reg_val;
diff --git a/arch/mips/pci/ops-loongson3.c b/arch/mips/pci/ops-loongson3.c
new file mode 100644
index 000000000000..46ed541a3ec7
--- /dev/null
+++ b/arch/mips/pci/ops-loongson3.c
@@ -0,0 +1,101 @@
1#include <linux/types.h>
2#include <linux/pci.h>
3#include <linux/kernel.h>
4
5#include <asm/mips-boards/bonito64.h>
6
7#include <loongson.h>
8
9#define PCI_ACCESS_READ 0
10#define PCI_ACCESS_WRITE 1
11
12#define HT1LO_PCICFG_BASE 0x1a000000
13#define HT1LO_PCICFG_BASE_TP1 0x1b000000
14
15static int loongson3_pci_config_access(unsigned char access_type,
16 struct pci_bus *bus, unsigned int devfn,
17 int where, u32 *data)
18{
19 unsigned char busnum = bus->number;
20 u_int64_t addr, type;
21 void *addrp;
22 int device = PCI_SLOT(devfn);
23 int function = PCI_FUNC(devfn);
24 int reg = where & ~3;
25
26 addr = (busnum << 16) | (device << 11) | (function << 8) | reg;
27 if (busnum == 0) {
28 if (device > 31)
29 return PCIBIOS_DEVICE_NOT_FOUND;
30 addrp = (void *)(TO_UNCAC(HT1LO_PCICFG_BASE) | (addr & 0xffff));
31 type = 0;
32
33 } else {
34 addrp = (void *)(TO_UNCAC(HT1LO_PCICFG_BASE_TP1) | (addr));
35 type = 0x10000;
36 }
37
38 if (access_type == PCI_ACCESS_WRITE)
39 writel(*data, addrp);
40 else {
41 *data = readl(addrp);
42 if (*data == 0xffffffff) {
43 *data = -1;
44 return PCIBIOS_DEVICE_NOT_FOUND;
45 }
46 }
47 return PCIBIOS_SUCCESSFUL;
48}
49
50static int loongson3_pci_pcibios_read(struct pci_bus *bus, unsigned int devfn,
51 int where, int size, u32 *val)
52{
53 u32 data = 0;
54 int ret = loongson3_pci_config_access(PCI_ACCESS_READ,
55 bus, devfn, where, &data);
56
57 if (ret != PCIBIOS_SUCCESSFUL)
58 return ret;
59
60 if (size == 1)
61 *val = (data >> ((where & 3) << 3)) & 0xff;
62 else if (size == 2)
63 *val = (data >> ((where & 3) << 3)) & 0xffff;
64 else
65 *val = data;
66
67 return PCIBIOS_SUCCESSFUL;
68}
69
70static int loongson3_pci_pcibios_write(struct pci_bus *bus, unsigned int devfn,
71 int where, int size, u32 val)
72{
73 u32 data = 0;
74 int ret;
75
76 if (size == 4)
77 data = val;
78 else {
79 ret = loongson3_pci_config_access(PCI_ACCESS_READ,
80 bus, devfn, where, &data);
81 if (ret != PCIBIOS_SUCCESSFUL)
82 return ret;
83
84 if (size == 1)
85 data = (data & ~(0xff << ((where & 3) << 3))) |
86 (val << ((where & 3) << 3));
87 else if (size == 2)
88 data = (data & ~(0xffff << ((where & 3) << 3))) |
89 (val << ((where & 3) << 3));
90 }
91
92 ret = loongson3_pci_config_access(PCI_ACCESS_WRITE,
93 bus, devfn, where, &data);
94
95 return ret;
96}
97
98struct pci_ops loongson_pci_ops = {
99 .read = loongson3_pci_pcibios_read,
100 .write = loongson3_pci_pcibios_write
101};
diff --git a/arch/mips/pci/pci-alchemy.c b/arch/mips/pci/pci-alchemy.c
index d1faece21b6a..563d1f61d6ee 100644
--- a/arch/mips/pci/pci-alchemy.c
+++ b/arch/mips/pci/pci-alchemy.c
@@ -16,6 +16,7 @@
16#include <linux/syscore_ops.h> 16#include <linux/syscore_ops.h>
17#include <linux/vmalloc.h> 17#include <linux/vmalloc.h>
18 18
19#include <asm/dma-coherence.h>
19#include <asm/mach-au1x00/au1000.h> 20#include <asm/mach-au1x00/au1000.h>
20#include <asm/tlbmisc.h> 21#include <asm/tlbmisc.h>
21 22
@@ -411,17 +412,15 @@ static int alchemy_pci_probe(struct platform_device *pdev)
411 } 412 }
412 ctx->alchemy_pci_ctrl.io_map_base = (unsigned long)virt_io; 413 ctx->alchemy_pci_ctrl.io_map_base = (unsigned long)virt_io;
413 414
414#ifdef CONFIG_DMA_NONCOHERENT
415 /* Au1500 revisions older than AD have borked coherent PCI */ 415 /* Au1500 revisions older than AD have borked coherent PCI */
416 if ((alchemy_get_cputype() == ALCHEMY_CPU_AU1500) && 416 if ((alchemy_get_cputype() == ALCHEMY_CPU_AU1500) &&
417 (read_c0_prid() < 0x01030202)) { 417 (read_c0_prid() < 0x01030202) && !coherentio) {
418 val = __raw_readl(ctx->regs + PCI_REG_CONFIG); 418 val = __raw_readl(ctx->regs + PCI_REG_CONFIG);
419 val |= PCI_CONFIG_NC; 419 val |= PCI_CONFIG_NC;
420 __raw_writel(val, ctx->regs + PCI_REG_CONFIG); 420 __raw_writel(val, ctx->regs + PCI_REG_CONFIG);
421 wmb(); 421 wmb();
422 dev_info(&pdev->dev, "non-coherent PCI on Au1500 AA/AB/AC\n"); 422 dev_info(&pdev->dev, "non-coherent PCI on Au1500 AA/AB/AC\n");
423 } 423 }
424#endif
425 424
426 if (pd->board_map_irq) 425 if (pd->board_map_irq)
427 ctx->board_map_irq = pd->board_map_irq; 426 ctx->board_map_irq = pd->board_map_irq;
diff --git a/arch/mips/pci/pci-malta.c b/arch/mips/pci/pci-malta.c
index f1a73890dd4f..cfbbc3e3e914 100644
--- a/arch/mips/pci/pci-malta.c
+++ b/arch/mips/pci/pci-malta.c
@@ -27,7 +27,7 @@
27#include <linux/init.h> 27#include <linux/init.h>
28 28
29#include <asm/gt64120.h> 29#include <asm/gt64120.h>
30#include <asm/gcmpregs.h> 30#include <asm/mips-cm.h>
31#include <asm/mips-boards/generic.h> 31#include <asm/mips-boards/generic.h>
32#include <asm/mips-boards/bonito64.h> 32#include <asm/mips-boards/bonito64.h>
33#include <asm/mips-boards/msc01_pci.h> 33#include <asm/mips-boards/msc01_pci.h>
@@ -201,11 +201,11 @@ void __init mips_pcibios_init(void)
201 msc_mem_resource.start = start & mask; 201 msc_mem_resource.start = start & mask;
202 msc_mem_resource.end = (start & mask) | ~mask; 202 msc_mem_resource.end = (start & mask) | ~mask;
203 msc_controller.mem_offset = (start & mask) - (map & mask); 203 msc_controller.mem_offset = (start & mask) - (map & mask);
204#ifdef CONFIG_MIPS_CMP 204 if (mips_cm_numiocu()) {
205 if (gcmp_niocu()) 205 write_gcr_reg0_base(start);
206 gcmp_setregion(0, start, mask, 206 write_gcr_reg0_mask(mask |
207 GCMP_GCB_GCMPB_CMDEFTGT_IOCU1); 207 CM_GCR_REGn_MASK_CMTGT_IOCU0);
208#endif 208 }
209 MSC_READ(MSC01_PCI_SC2PIOBASL, start); 209 MSC_READ(MSC01_PCI_SC2PIOBASL, start);
210 MSC_READ(MSC01_PCI_SC2PIOMSKL, mask); 210 MSC_READ(MSC01_PCI_SC2PIOMSKL, mask);
211 MSC_READ(MSC01_PCI_SC2PIOMAPL, map); 211 MSC_READ(MSC01_PCI_SC2PIOMAPL, map);
@@ -213,11 +213,11 @@ void __init mips_pcibios_init(void)
213 msc_io_resource.end = (map & mask) | ~mask; 213 msc_io_resource.end = (map & mask) | ~mask;
214 msc_controller.io_offset = 0; 214 msc_controller.io_offset = 0;
215 ioport_resource.end = ~mask; 215 ioport_resource.end = ~mask;
216#ifdef CONFIG_MIPS_CMP 216 if (mips_cm_numiocu()) {
217 if (gcmp_niocu()) 217 write_gcr_reg1_base(start);
218 gcmp_setregion(1, start, mask, 218 write_gcr_reg1_mask(mask |
219 GCMP_GCB_GCMPB_CMDEFTGT_IOCU1); 219 CM_GCR_REGn_MASK_CMTGT_IOCU0);
220#endif 220 }
221 /* If ranges overlap I/O takes precedence. */ 221 /* If ranges overlap I/O takes precedence. */
222 start = start & mask; 222 start = start & mask;
223 end = start | ~mask; 223 end = start | ~mask;
diff --git a/arch/mips/pmcs-msp71xx/msp_setup.c b/arch/mips/pmcs-msp71xx/msp_setup.c
index 396b2967ad85..7e980767679c 100644
--- a/arch/mips/pmcs-msp71xx/msp_setup.c
+++ b/arch/mips/pmcs-msp71xx/msp_setup.c
@@ -49,7 +49,7 @@ void msp7120_reset(void)
49 /* Cache the reset code of this function */ 49 /* Cache the reset code of this function */
50 __asm__ __volatile__ ( 50 __asm__ __volatile__ (
51 " .set push \n" 51 " .set push \n"
52 " .set mips3 \n" 52 " .set arch=r4000 \n"
53 " la %0,startpoint \n" 53 " la %0,startpoint \n"
54 " la %1,endpoint \n" 54 " la %1,endpoint \n"
55 " .set pop \n" 55 " .set pop \n"
diff --git a/arch/mips/power/hibernate.S b/arch/mips/power/hibernate.S
index 7e0277a1048f..32a7c828f073 100644
--- a/arch/mips/power/hibernate.S
+++ b/arch/mips/power/hibernate.S
@@ -43,6 +43,7 @@ LEAF(swsusp_arch_resume)
43 bne t1, t3, 1b 43 bne t1, t3, 1b
44 PTR_L t0, PBE_NEXT(t0) 44 PTR_L t0, PBE_NEXT(t0)
45 bnez t0, 0b 45 bnez t0, 0b
46 jal local_flush_tlb_all /* Avoid TLB mismatch after kernel resume */
46 PTR_LA t0, saved_regs 47 PTR_LA t0, saved_regs
47 PTR_L ra, PT_R31(t0) 48 PTR_L ra, PT_R31(t0)
48 PTR_L sp, PT_R29(t0) 49 PTR_L sp, PT_R29(t0)
diff --git a/arch/mips/ralink/Kconfig b/arch/mips/ralink/Kconfig
index 1bfd1c17b3c2..4a296655f446 100644
--- a/arch/mips/ralink/Kconfig
+++ b/arch/mips/ralink/Kconfig
@@ -20,19 +20,13 @@ choice
20 config SOC_RT305X 20 config SOC_RT305X
21 bool "RT305x" 21 bool "RT305x"
22 select USB_ARCH_HAS_HCD 22 select USB_ARCH_HAS_HCD
23 select USB_ARCH_HAS_OHCI
24 select USB_ARCH_HAS_EHCI
25 23
26 config SOC_RT3883 24 config SOC_RT3883
27 bool "RT3883" 25 bool "RT3883"
28 select USB_ARCH_HAS_OHCI
29 select USB_ARCH_HAS_EHCI
30 select HW_HAS_PCI 26 select HW_HAS_PCI
31 27
32 config SOC_MT7620 28 config SOC_MT7620
33 bool "MT7620" 29 bool "MT7620"
34 select USB_ARCH_HAS_OHCI
35 select USB_ARCH_HAS_EHCI
36 30
37endchoice 31endchoice
38 32
diff --git a/arch/mn10300/include/asm/highmem.h b/arch/mn10300/include/asm/highmem.h
index 7c137cd8aa37..2fbbe4d920aa 100644
--- a/arch/mn10300/include/asm/highmem.h
+++ b/arch/mn10300/include/asm/highmem.h
@@ -70,7 +70,7 @@ static inline void kunmap(struct page *page)
70 * be used in IRQ contexts, so in some (very limited) cases we need 70 * be used in IRQ contexts, so in some (very limited) cases we need
71 * it. 71 * it.
72 */ 72 */
73static inline unsigned long kmap_atomic(struct page *page) 73static inline void *kmap_atomic(struct page *page)
74{ 74{
75 unsigned long vaddr; 75 unsigned long vaddr;
76 int idx, type; 76 int idx, type;
@@ -89,7 +89,7 @@ static inline unsigned long kmap_atomic(struct page *page)
89 set_pte(kmap_pte - idx, mk_pte(page, kmap_prot)); 89 set_pte(kmap_pte - idx, mk_pte(page, kmap_prot));
90 local_flush_tlb_one(vaddr); 90 local_flush_tlb_one(vaddr);
91 91
92 return vaddr; 92 return (void *)vaddr;
93} 93}
94 94
95static inline void __kunmap_atomic(unsigned long vaddr) 95static inline void __kunmap_atomic(unsigned long vaddr)
diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig
index 9488209a5253..e71d712afb79 100644
--- a/arch/openrisc/Kconfig
+++ b/arch/openrisc/Kconfig
@@ -41,7 +41,7 @@ config RWSEM_XCHGADD_ALGORITHM
41config GENERIC_HWEIGHT 41config GENERIC_HWEIGHT
42 def_bool y 42 def_bool y
43 43
44config NO_IOPORT 44config NO_IOPORT_MAP
45 def_bool y 45 def_bool y
46 46
47config TRACE_IRQFLAGS_SUPPORT 47config TRACE_IRQFLAGS_SUPPORT
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index bb2a8ec440e7..1faefed32749 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -28,6 +28,7 @@ config PARISC
28 select CLONE_BACKWARDS 28 select CLONE_BACKWARDS
29 select TTY # Needed for pdc_cons.c 29 select TTY # Needed for pdc_cons.c
30 select HAVE_DEBUG_STACKOVERFLOW 30 select HAVE_DEBUG_STACKOVERFLOW
31 select HAVE_ARCH_AUDITSYSCALL
31 32
32 help 33 help
33 The PA-RISC microprocessor is designed by Hewlett-Packard and used 34 The PA-RISC microprocessor is designed by Hewlett-Packard and used
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 957bf344c0f5..e0998997943b 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -90,6 +90,7 @@ config PPC
90 select BINFMT_ELF 90 select BINFMT_ELF
91 select OF 91 select OF
92 select OF_EARLY_FLATTREE 92 select OF_EARLY_FLATTREE
93 select OF_RESERVED_MEM
93 select HAVE_FTRACE_MCOUNT_RECORD 94 select HAVE_FTRACE_MCOUNT_RECORD
94 select HAVE_DYNAMIC_FTRACE 95 select HAVE_DYNAMIC_FTRACE
95 select HAVE_FUNCTION_TRACER 96 select HAVE_FUNCTION_TRACER
@@ -130,6 +131,8 @@ config PPC
130 select GENERIC_CMOS_UPDATE 131 select GENERIC_CMOS_UPDATE
131 select GENERIC_TIME_VSYSCALL_OLD 132 select GENERIC_TIME_VSYSCALL_OLD
132 select GENERIC_CLOCKEVENTS 133 select GENERIC_CLOCKEVENTS
134 select GENERIC_CLOCKEVENTS_BROADCAST if SMP
135 select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
133 select GENERIC_STRNCPY_FROM_USER 136 select GENERIC_STRNCPY_FROM_USER
134 select GENERIC_STRNLEN_USER 137 select GENERIC_STRNLEN_USER
135 select HAVE_MOD_ARCH_SPECIFIC 138 select HAVE_MOD_ARCH_SPECIFIC
@@ -141,6 +144,7 @@ config PPC
141 select HAVE_DEBUG_STACKOVERFLOW 144 select HAVE_DEBUG_STACKOVERFLOW
142 select HAVE_IRQ_EXIT_ON_IRQ_STACK 145 select HAVE_IRQ_EXIT_ON_IRQ_STACK
143 select ARCH_USE_CMPXCHG_LOCKREF if PPC64 146 select ARCH_USE_CMPXCHG_LOCKREF if PPC64
147 select HAVE_ARCH_AUDITSYSCALL
144 148
145config GENERIC_CSUM 149config GENERIC_CSUM
146 def_bool CPU_LITTLE_ENDIAN 150 def_bool CPU_LITTLE_ENDIAN
@@ -618,6 +622,15 @@ config CMDLINE
618 some command-line options at build time by entering them here. In 622 some command-line options at build time by entering them here. In
619 most cases you will need to specify the root device here. 623 most cases you will need to specify the root device here.
620 624
625config CMDLINE_FORCE
626 bool "Always use the default kernel command string"
627 depends on CMDLINE_BOOL
628 help
629 Always use the default kernel command string, even if the boot
630 loader passes other arguments to the kernel.
631 This is useful if you cannot or don't want to change the
632 command-line options your boot loader passes to the kernel.
633
621config EXTRA_TARGETS 634config EXTRA_TARGETS
622 string "Additional default image types" 635 string "Additional default image types"
623 help 636 help
@@ -736,10 +749,6 @@ config FSL_LBC
736 controller. Also contains some common code used by 749 controller. Also contains some common code used by
737 drivers for specific local bus peripherals. 750 drivers for specific local bus peripherals.
738 751
739config FSL_IFC
740 bool
741 depends on FSL_SOC
742
743config FSL_GTM 752config FSL_GTM
744 bool 753 bool
745 depends on PPC_83xx || QUICC_ENGINE || CPM2 754 depends on PPC_83xx || QUICC_ENGINE || CPM2
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 0f4344e6fbca..4c0cedf4e2c7 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -74,6 +74,7 @@ override CROSS32AS += -mlittle-endian
74LDEMULATION := lppc 74LDEMULATION := lppc
75GNUTARGET := powerpcle 75GNUTARGET := powerpcle
76MULTIPLEWORD := -mno-multiple 76MULTIPLEWORD := -mno-multiple
77KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-save-toc-indirect)
77else 78else
78ifeq ($(call cc-option-yn,-mbig-endian),y) 79ifeq ($(call cc-option-yn,-mbig-endian),y)
79override CC += -mbig-endian 80override CC += -mbig-endian
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 90e9d9548660..a1f8c7f1ec60 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -54,7 +54,7 @@ zlib := inffast.c inflate.c inftrees.c
54zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h 54zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h
55zliblinuxheader := zlib.h zconf.h zutil.h 55zliblinuxheader := zlib.h zconf.h zutil.h
56 56
57$(addprefix $(obj)/,$(zlib) cuboot-c2k.o gunzip_util.o main.o prpmc2800.o): \ 57$(addprefix $(obj)/,$(zlib) cuboot-c2k.o gunzip_util.o main.o): \
58 $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader)) 58 $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader))
59 59
60libfdt := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c 60libfdt := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
@@ -95,7 +95,7 @@ src-plat-$(CONFIG_FSL_SOC_BOOKE) += cuboot-85xx.c cuboot-85xx-cpm2.c
95src-plat-$(CONFIG_EMBEDDED6xx) += cuboot-pq2.c cuboot-mpc7448hpc2.c \ 95src-plat-$(CONFIG_EMBEDDED6xx) += cuboot-pq2.c cuboot-mpc7448hpc2.c \
96 cuboot-c2k.c gamecube-head.S \ 96 cuboot-c2k.c gamecube-head.S \
97 gamecube.c wii-head.S wii.c holly.c \ 97 gamecube.c wii-head.S wii.c holly.c \
98 prpmc2800.c fixed-head.S mvme5100.c 98 fixed-head.S mvme5100.c
99src-plat-$(CONFIG_AMIGAONE) += cuboot-amigaone.c 99src-plat-$(CONFIG_AMIGAONE) += cuboot-amigaone.c
100src-plat-$(CONFIG_PPC_PS3) += ps3-head.S ps3-hvcall.S ps3.c 100src-plat-$(CONFIG_PPC_PS3) += ps3-head.S ps3-hvcall.S ps3.c
101src-plat-$(CONFIG_EPAPR_BOOT) += epapr.c epapr-wrapper.c 101src-plat-$(CONFIG_EPAPR_BOOT) += epapr.c epapr-wrapper.c
@@ -204,7 +204,6 @@ image-$(CONFIG_PPC_CHRP) += zImage.chrp
204image-$(CONFIG_PPC_EFIKA) += zImage.chrp 204image-$(CONFIG_PPC_EFIKA) += zImage.chrp
205image-$(CONFIG_PPC_PMAC) += zImage.pmac 205image-$(CONFIG_PPC_PMAC) += zImage.pmac
206image-$(CONFIG_PPC_HOLLY) += dtbImage.holly 206image-$(CONFIG_PPC_HOLLY) += dtbImage.holly
207image-$(CONFIG_PPC_PRPMC2800) += dtbImage.prpmc2800
208image-$(CONFIG_DEFAULT_UIMAGE) += uImage 207image-$(CONFIG_DEFAULT_UIMAGE) += uImage
209image-$(CONFIG_EPAPR_BOOT) += zImage.epapr 208image-$(CONFIG_EPAPR_BOOT) += zImage.epapr
210 209
diff --git a/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi b/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi
index 5a6615d0ade2..60566f9927be 100644
--- a/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi
@@ -86,6 +86,42 @@
86 86
87 clockgen: global-utilities@e1000 { 87 clockgen: global-utilities@e1000 {
88 compatible = "fsl,b4420-clockgen", "fsl,qoriq-clockgen-2.0"; 88 compatible = "fsl,b4420-clockgen", "fsl,qoriq-clockgen-2.0";
89 ranges = <0x0 0xe1000 0x1000>;
90 #address-cells = <1>;
91 #size-cells = <1>;
92
93 sysclk: sysclk {
94 #clock-cells = <0>;
95 compatible = "fsl,qoriq-sysclk-2.0";
96 clock-output-names = "sysclk";
97 };
98
99 pll0: pll0@800 {
100 #clock-cells = <1>;
101 reg = <0x800 0x4>;
102 compatible = "fsl,qoriq-core-pll-2.0";
103 clocks = <&sysclk>;
104 clock-output-names = "pll0", "pll0-div2", "pll0-div4";
105 };
106
107 pll1: pll1@820 {
108 #clock-cells = <1>;
109 reg = <0x820 0x4>;
110 compatible = "fsl,qoriq-core-pll-2.0";
111 clocks = <&sysclk>;
112 clock-output-names = "pll1", "pll1-div2", "pll1-div4";
113 };
114
115 mux0: mux0@0 {
116 #clock-cells = <0>;
117 reg = <0x0 0x4>;
118 compatible = "fsl,qoriq-core-mux-2.0";
119 clocks = <&pll0 0>, <&pll0 1>, <&pll0 2>,
120 <&pll1 0>, <&pll1 1>, <&pll1 2>;
121 clock-names = "pll0", "pll0-div2", "pll0-div4",
122 "pll1", "pll1-div2", "pll1-div4";
123 clock-output-names = "cmux0";
124 };
89 }; 125 };
90 126
91 rcpm: global-utilities@e2000 { 127 rcpm: global-utilities@e2000 {
diff --git a/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi b/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi
index c6e451affb05..2419731c2c54 100644
--- a/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi
@@ -64,11 +64,13 @@
64 cpu0: PowerPC,e6500@0 { 64 cpu0: PowerPC,e6500@0 {
65 device_type = "cpu"; 65 device_type = "cpu";
66 reg = <0 1>; 66 reg = <0 1>;
67 clocks = <&mux0>;
67 next-level-cache = <&L2>; 68 next-level-cache = <&L2>;
68 }; 69 };
69 cpu1: PowerPC,e6500@2 { 70 cpu1: PowerPC,e6500@2 {
70 device_type = "cpu"; 71 device_type = "cpu";
71 reg = <2 3>; 72 reg = <2 3>;
73 clocks = <&mux0>;
72 next-level-cache = <&L2>; 74 next-level-cache = <&L2>;
73 }; 75 };
74 }; 76 };
diff --git a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
index 981397518fc6..cbc354b05117 100644
--- a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
@@ -130,6 +130,42 @@
130 130
131 clockgen: global-utilities@e1000 { 131 clockgen: global-utilities@e1000 {
132 compatible = "fsl,b4860-clockgen", "fsl,qoriq-clockgen-2.0"; 132 compatible = "fsl,b4860-clockgen", "fsl,qoriq-clockgen-2.0";
133 ranges = <0x0 0xe1000 0x1000>;
134 #address-cells = <1>;
135 #size-cells = <1>;
136
137 sysclk: sysclk {
138 #clock-cells = <0>;
139 compatible = "fsl,qoriq-sysclk-2.0";
140 clock-output-names = "sysclk";
141 };
142
143 pll0: pll0@800 {
144 #clock-cells = <1>;
145 reg = <0x800 0x4>;
146 compatible = "fsl,qoriq-core-pll-2.0";
147 clocks = <&sysclk>;
148 clock-output-names = "pll0", "pll0-div2", "pll0-div4";
149 };
150
151 pll1: pll1@820 {
152 #clock-cells = <1>;
153 reg = <0x820 0x4>;
154 compatible = "fsl,qoriq-core-pll-2.0";
155 clocks = <&sysclk>;
156 clock-output-names = "pll1", "pll1-div2", "pll1-div4";
157 };
158
159 mux0: mux0@0 {
160 #clock-cells = <0>;
161 reg = <0x0 0x4>;
162 compatible = "fsl,qoriq-core-mux-2.0";
163 clocks = <&pll0 0>, <&pll0 1>, <&pll0 2>,
164 <&pll1 0>, <&pll1 1>, <&pll1 2>;
165 clock-names = "pll0", "pll0-div2", "pll0-div4",
166 "pll1", "pll1-div2", "pll1-div4";
167 clock-output-names = "cmux0";
168 };
133 }; 169 };
134 170
135 rcpm: global-utilities@e2000 { 171 rcpm: global-utilities@e2000 {
diff --git a/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi b/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi
index 9bc26b147900..142ac862cacf 100644
--- a/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi
@@ -64,21 +64,25 @@
64 cpu0: PowerPC,e6500@0 { 64 cpu0: PowerPC,e6500@0 {
65 device_type = "cpu"; 65 device_type = "cpu";
66 reg = <0 1>; 66 reg = <0 1>;
67 clocks = <&mux0>;
67 next-level-cache = <&L2>; 68 next-level-cache = <&L2>;
68 }; 69 };
69 cpu1: PowerPC,e6500@2 { 70 cpu1: PowerPC,e6500@2 {
70 device_type = "cpu"; 71 device_type = "cpu";
71 reg = <2 3>; 72 reg = <2 3>;
73 clocks = <&mux0>;
72 next-level-cache = <&L2>; 74 next-level-cache = <&L2>;
73 }; 75 };
74 cpu2: PowerPC,e6500@4 { 76 cpu2: PowerPC,e6500@4 {
75 device_type = "cpu"; 77 device_type = "cpu";
76 reg = <4 5>; 78 reg = <4 5>;
79 clocks = <&mux0>;
77 next-level-cache = <&L2>; 80 next-level-cache = <&L2>;
78 }; 81 };
79 cpu3: PowerPC,e6500@6 { 82 cpu3: PowerPC,e6500@6 {
80 device_type = "cpu"; 83 device_type = "cpu";
81 reg = <6 7>; 84 reg = <6 7>;
85 clocks = <&mux0>;
82 next-level-cache = <&L2>; 86 next-level-cache = <&L2>;
83 }; 87 };
84 }; 88 };
diff --git a/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi b/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
index dc6cc5afd189..e2987a33083c 100644
--- a/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p2041si-post.dtsi
@@ -306,8 +306,68 @@
306 306
307 clockgen: global-utilities@e1000 { 307 clockgen: global-utilities@e1000 {
308 compatible = "fsl,p2041-clockgen", "fsl,qoriq-clockgen-1.0"; 308 compatible = "fsl,p2041-clockgen", "fsl,qoriq-clockgen-1.0";
309 ranges = <0x0 0xe1000 0x1000>;
309 reg = <0xe1000 0x1000>; 310 reg = <0xe1000 0x1000>;
310 clock-frequency = <0>; 311 clock-frequency = <0>;
312 #address-cells = <1>;
313 #size-cells = <1>;
314
315 sysclk: sysclk {
316 #clock-cells = <0>;
317 compatible = "fsl,qoriq-sysclk-1.0";
318 clock-output-names = "sysclk";
319 };
320
321 pll0: pll0@800 {
322 #clock-cells = <1>;
323 reg = <0x800 0x4>;
324 compatible = "fsl,qoriq-core-pll-1.0";
325 clocks = <&sysclk>;
326 clock-output-names = "pll0", "pll0-div2";
327 };
328
329 pll1: pll1@820 {
330 #clock-cells = <1>;
331 reg = <0x820 0x4>;
332 compatible = "fsl,qoriq-core-pll-1.0";
333 clocks = <&sysclk>;
334 clock-output-names = "pll1", "pll1-div2";
335 };
336
337 mux0: mux0@0 {
338 #clock-cells = <0>;
339 reg = <0x0 0x4>;
340 compatible = "fsl,qoriq-core-mux-1.0";
341 clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
342 clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
343 clock-output-names = "cmux0";
344 };
345
346 mux1: mux1@20 {
347 #clock-cells = <0>;
348 reg = <0x20 0x4>;
349 compatible = "fsl,qoriq-core-mux-1.0";
350 clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
351 clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
352 clock-output-names = "cmux1";
353 };
354
355 mux2: mux2@40 {
356 #clock-cells = <0>;
357 reg = <0x40 0x4>;
358 compatible = "fsl,qoriq-core-mux-1.0";
359 clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
360 clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
361 };
362
363 mux3: mux3@60 {
364 #clock-cells = <0>;
365 reg = <0x60 0x4>;
366 compatible = "fsl,qoriq-core-mux-1.0";
367 clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
368 clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
369 clock-output-names = "cmux3";
370 };
311 }; 371 };
312 372
313 rcpm: global-utilities@e2000 { 373 rcpm: global-utilities@e2000 {
diff --git a/arch/powerpc/boot/dts/fsl/p2041si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p2041si-pre.dtsi
index 7a2697d04549..22f3b14517de 100644
--- a/arch/powerpc/boot/dts/fsl/p2041si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p2041si-pre.dtsi
@@ -81,6 +81,7 @@
81 cpu0: PowerPC,e500mc@0 { 81 cpu0: PowerPC,e500mc@0 {
82 device_type = "cpu"; 82 device_type = "cpu";
83 reg = <0>; 83 reg = <0>;
84 clocks = <&mux0>;
84 next-level-cache = <&L2_0>; 85 next-level-cache = <&L2_0>;
85 L2_0: l2-cache { 86 L2_0: l2-cache {
86 next-level-cache = <&cpc>; 87 next-level-cache = <&cpc>;
@@ -89,6 +90,7 @@
89 cpu1: PowerPC,e500mc@1 { 90 cpu1: PowerPC,e500mc@1 {
90 device_type = "cpu"; 91 device_type = "cpu";
91 reg = <1>; 92 reg = <1>;
93 clocks = <&mux1>;
92 next-level-cache = <&L2_1>; 94 next-level-cache = <&L2_1>;
93 L2_1: l2-cache { 95 L2_1: l2-cache {
94 next-level-cache = <&cpc>; 96 next-level-cache = <&cpc>;
@@ -97,6 +99,7 @@
97 cpu2: PowerPC,e500mc@2 { 99 cpu2: PowerPC,e500mc@2 {
98 device_type = "cpu"; 100 device_type = "cpu";
99 reg = <2>; 101 reg = <2>;
102 clocks = <&mux2>;
100 next-level-cache = <&L2_2>; 103 next-level-cache = <&L2_2>;
101 L2_2: l2-cache { 104 L2_2: l2-cache {
102 next-level-cache = <&cpc>; 105 next-level-cache = <&cpc>;
@@ -105,6 +108,7 @@
105 cpu3: PowerPC,e500mc@3 { 108 cpu3: PowerPC,e500mc@3 {
106 device_type = "cpu"; 109 device_type = "cpu";
107 reg = <3>; 110 reg = <3>;
111 clocks = <&mux3>;
108 next-level-cache = <&L2_3>; 112 next-level-cache = <&L2_3>;
109 L2_3: l2-cache { 113 L2_3: l2-cache {
110 next-level-cache = <&cpc>; 114 next-level-cache = <&cpc>;
diff --git a/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi b/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
index 3fa1e22d544a..7af6d45fd998 100644
--- a/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p3041si-post.dtsi
@@ -333,8 +333,69 @@
333 333
334 clockgen: global-utilities@e1000 { 334 clockgen: global-utilities@e1000 {
335 compatible = "fsl,p3041-clockgen", "fsl,qoriq-clockgen-1.0"; 335 compatible = "fsl,p3041-clockgen", "fsl,qoriq-clockgen-1.0";
336 ranges = <0x0 0xe1000 0x1000>;
336 reg = <0xe1000 0x1000>; 337 reg = <0xe1000 0x1000>;
337 clock-frequency = <0>; 338 clock-frequency = <0>;
339 #address-cells = <1>;
340 #size-cells = <1>;
341
342 sysclk: sysclk {
343 #clock-cells = <0>;
344 compatible = "fsl,qoriq-sysclk-1.0";
345 clock-output-names = "sysclk";
346 };
347
348 pll0: pll0@800 {
349 #clock-cells = <1>;
350 reg = <0x800 0x4>;
351 compatible = "fsl,qoriq-core-pll-1.0";
352 clocks = <&sysclk>;
353 clock-output-names = "pll0", "pll0-div2";
354 };
355
356 pll1: pll1@820 {
357 #clock-cells = <1>;
358 reg = <0x820 0x4>;
359 compatible = "fsl,qoriq-core-pll-1.0";
360 clocks = <&sysclk>;
361 clock-output-names = "pll1", "pll1-div2";
362 };
363
364 mux0: mux0@0 {
365 #clock-cells = <0>;
366 reg = <0x0 0x4>;
367 compatible = "fsl,qoriq-core-mux-1.0";
368 clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
369 clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
370 clock-output-names = "cmux0";
371 };
372
373 mux1: mux1@20 {
374 #clock-cells = <0>;
375 reg = <0x20 0x4>;
376 compatible = "fsl,qoriq-core-mux-1.0";
377 clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
378 clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
379 clock-output-names = "cmux1";
380 };
381
382 mux2: mux2@40 {
383 #clock-cells = <0>;
384 reg = <0x40 0x4>;
385 compatible = "fsl,qoriq-core-mux-1.0";
386 clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
387 clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
388 clock-output-names = "cmux2";
389 };
390
391 mux3: mux3@60 {
392 #clock-cells = <0>;
393 reg = <0x60 0x4>;
394 compatible = "fsl,qoriq-core-mux-1.0";
395 clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
396 clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
397 clock-output-names = "cmux3";
398 };
338 }; 399 };
339 400
340 rcpm: global-utilities@e2000 { 401 rcpm: global-utilities@e2000 {
diff --git a/arch/powerpc/boot/dts/fsl/p3041si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p3041si-pre.dtsi
index c9ca2c305cfe..468e8be8ac6f 100644
--- a/arch/powerpc/boot/dts/fsl/p3041si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p3041si-pre.dtsi
@@ -82,6 +82,7 @@
82 cpu0: PowerPC,e500mc@0 { 82 cpu0: PowerPC,e500mc@0 {
83 device_type = "cpu"; 83 device_type = "cpu";
84 reg = <0>; 84 reg = <0>;
85 clocks = <&mux0>;
85 next-level-cache = <&L2_0>; 86 next-level-cache = <&L2_0>;
86 L2_0: l2-cache { 87 L2_0: l2-cache {
87 next-level-cache = <&cpc>; 88 next-level-cache = <&cpc>;
@@ -90,6 +91,7 @@
90 cpu1: PowerPC,e500mc@1 { 91 cpu1: PowerPC,e500mc@1 {
91 device_type = "cpu"; 92 device_type = "cpu";
92 reg = <1>; 93 reg = <1>;
94 clocks = <&mux1>;
93 next-level-cache = <&L2_1>; 95 next-level-cache = <&L2_1>;
94 L2_1: l2-cache { 96 L2_1: l2-cache {
95 next-level-cache = <&cpc>; 97 next-level-cache = <&cpc>;
@@ -98,6 +100,7 @@
98 cpu2: PowerPC,e500mc@2 { 100 cpu2: PowerPC,e500mc@2 {
99 device_type = "cpu"; 101 device_type = "cpu";
100 reg = <2>; 102 reg = <2>;
103 clocks = <&mux2>;
101 next-level-cache = <&L2_2>; 104 next-level-cache = <&L2_2>;
102 L2_2: l2-cache { 105 L2_2: l2-cache {
103 next-level-cache = <&cpc>; 106 next-level-cache = <&cpc>;
@@ -106,6 +109,7 @@
106 cpu3: PowerPC,e500mc@3 { 109 cpu3: PowerPC,e500mc@3 {
107 device_type = "cpu"; 110 device_type = "cpu";
108 reg = <3>; 111 reg = <3>;
112 clocks = <&mux3>;
109 next-level-cache = <&L2_3>; 113 next-level-cache = <&L2_3>;
110 L2_3: l2-cache { 114 L2_3: l2-cache {
111 next-level-cache = <&cpc>; 115 next-level-cache = <&cpc>;
diff --git a/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi b/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
index 34769a7eafea..2415e1f1d3fa 100644
--- a/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p4080si-post.dtsi
@@ -353,8 +353,121 @@
353 353
354 clockgen: global-utilities@e1000 { 354 clockgen: global-utilities@e1000 {
355 compatible = "fsl,p4080-clockgen", "fsl,qoriq-clockgen-1.0"; 355 compatible = "fsl,p4080-clockgen", "fsl,qoriq-clockgen-1.0";
356 ranges = <0x0 0xe1000 0x1000>;
356 reg = <0xe1000 0x1000>; 357 reg = <0xe1000 0x1000>;
357 clock-frequency = <0>; 358 clock-frequency = <0>;
359 #address-cells = <1>;
360 #size-cells = <1>;
361
362 sysclk: sysclk {
363 #clock-cells = <0>;
364 compatible = "fsl,qoriq-sysclk-1.0";
365 clock-output-names = "sysclk";
366 };
367
368 pll0: pll0@800 {
369 #clock-cells = <1>;
370 reg = <0x800 0x4>;
371 compatible = "fsl,qoriq-core-pll-1.0";
372 clocks = <&sysclk>;
373 clock-output-names = "pll0", "pll0-div2";
374 };
375
376 pll1: pll1@820 {
377 #clock-cells = <1>;
378 reg = <0x820 0x4>;
379 compatible = "fsl,qoriq-core-pll-1.0";
380 clocks = <&sysclk>;
381 clock-output-names = "pll1", "pll1-div2";
382 };
383
384 pll2: pll2@840 {
385 #clock-cells = <1>;
386 reg = <0x840 0x4>;
387 compatible = "fsl,qoriq-core-pll-1.0";
388 clocks = <&sysclk>;
389 clock-output-names = "pll2", "pll2-div2";
390 };
391
392 pll3: pll3@860 {
393 #clock-cells = <1>;
394 reg = <0x860 0x4>;
395 compatible = "fsl,qoriq-core-pll-1.0";
396 clocks = <&sysclk>;
397 clock-output-names = "pll3", "pll3-div2";
398 };
399
400 mux0: mux0@0 {
401 #clock-cells = <0>;
402 reg = <0x0 0x4>;
403 compatible = "fsl,qoriq-core-mux-1.0";
404 clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
405 clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
406 clock-output-names = "cmux0";
407 };
408
409 mux1: mux1@20 {
410 #clock-cells = <0>;
411 reg = <0x20 0x4>;
412 compatible = "fsl,qoriq-core-mux-1.0";
413 clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
414 clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
415 clock-output-names = "cmux1";
416 };
417
418 mux2: mux2@40 {
419 #clock-cells = <0>;
420 reg = <0x40 0x4>;
421 compatible = "fsl,qoriq-core-mux-1.0";
422 clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
423 clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
424 clock-output-names = "cmux2";
425 };
426
427 mux3: mux3@60 {
428 #clock-cells = <0>;
429 reg = <0x60 0x4>;
430 compatible = "fsl,qoriq-core-mux-1.0";
431 clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
432 clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
433 clock-output-names = "cmux3";
434 };
435
436 mux4: mux4@80 {
437 #clock-cells = <0>;
438 reg = <0x80 0x4>;
439 compatible = "fsl,qoriq-core-mux-1.0";
440 clocks = <&pll2 0>, <&pll2 1>, <&pll3 0>, <&pll3 1>;
441 clock-names = "pll2", "pll2-div2", "pll3", "pll3-div2";
442 clock-output-names = "cmux4";
443 };
444
445 mux5: mux5@a0 {
446 #clock-cells = <0>;
447 reg = <0xa0 0x4>;
448 compatible = "fsl,qoriq-core-mux-1.0";
449 clocks = <&pll2 0>, <&pll2 1>, <&pll3 0>, <&pll3 1>;
450 clock-names = "pll2", "pll2-div2", "pll3", "pll3-div2";
451 clock-output-names = "cmux5";
452 };
453
454 mux6: mux6@c0 {
455 #clock-cells = <0>;
456 reg = <0xc0 0x4>;
457 compatible = "fsl,qoriq-core-mux-1.0";
458 clocks = <&pll2 0>, <&pll2 1>, <&pll3 0>, <&pll3 1>;
459 clock-names = "pll2", "pll2-div2", "pll3", "pll3-div2";
460 clock-output-names = "cmux6";
461 };
462
463 mux7: mux7@e0 {
464 #clock-cells = <0>;
465 reg = <0xe0 0x4>;
466 compatible = "fsl,qoriq-core-mux-1.0";
467 clocks = <&pll2 0>, <&pll2 1>, <&pll3 0>, <&pll3 1>;
468 clock-names = "pll2", "pll2-div2", "pll3", "pll3-div2";
469 clock-output-names = "cmux7";
470 };
358 }; 471 };
359 472
360 rcpm: global-utilities@e2000 { 473 rcpm: global-utilities@e2000 {
diff --git a/arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi
index 493d9a056b5c..0040b5a5379e 100644
--- a/arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi
@@ -81,6 +81,7 @@
81 cpu0: PowerPC,e500mc@0 { 81 cpu0: PowerPC,e500mc@0 {
82 device_type = "cpu"; 82 device_type = "cpu";
83 reg = <0>; 83 reg = <0>;
84 clocks = <&mux0>;
84 next-level-cache = <&L2_0>; 85 next-level-cache = <&L2_0>;
85 L2_0: l2-cache { 86 L2_0: l2-cache {
86 next-level-cache = <&cpc>; 87 next-level-cache = <&cpc>;
@@ -89,6 +90,7 @@
89 cpu1: PowerPC,e500mc@1 { 90 cpu1: PowerPC,e500mc@1 {
90 device_type = "cpu"; 91 device_type = "cpu";
91 reg = <1>; 92 reg = <1>;
93 clocks = <&mux1>;
92 next-level-cache = <&L2_1>; 94 next-level-cache = <&L2_1>;
93 L2_1: l2-cache { 95 L2_1: l2-cache {
94 next-level-cache = <&cpc>; 96 next-level-cache = <&cpc>;
@@ -97,6 +99,7 @@
97 cpu2: PowerPC,e500mc@2 { 99 cpu2: PowerPC,e500mc@2 {
98 device_type = "cpu"; 100 device_type = "cpu";
99 reg = <2>; 101 reg = <2>;
102 clocks = <&mux2>;
100 next-level-cache = <&L2_2>; 103 next-level-cache = <&L2_2>;
101 L2_2: l2-cache { 104 L2_2: l2-cache {
102 next-level-cache = <&cpc>; 105 next-level-cache = <&cpc>;
@@ -105,6 +108,7 @@
105 cpu3: PowerPC,e500mc@3 { 108 cpu3: PowerPC,e500mc@3 {
106 device_type = "cpu"; 109 device_type = "cpu";
107 reg = <3>; 110 reg = <3>;
111 clocks = <&mux3>;
108 next-level-cache = <&L2_3>; 112 next-level-cache = <&L2_3>;
109 L2_3: l2-cache { 113 L2_3: l2-cache {
110 next-level-cache = <&cpc>; 114 next-level-cache = <&cpc>;
@@ -113,6 +117,7 @@
113 cpu4: PowerPC,e500mc@4 { 117 cpu4: PowerPC,e500mc@4 {
114 device_type = "cpu"; 118 device_type = "cpu";
115 reg = <4>; 119 reg = <4>;
120 clocks = <&mux4>;
116 next-level-cache = <&L2_4>; 121 next-level-cache = <&L2_4>;
117 L2_4: l2-cache { 122 L2_4: l2-cache {
118 next-level-cache = <&cpc>; 123 next-level-cache = <&cpc>;
@@ -121,6 +126,7 @@
121 cpu5: PowerPC,e500mc@5 { 126 cpu5: PowerPC,e500mc@5 {
122 device_type = "cpu"; 127 device_type = "cpu";
123 reg = <5>; 128 reg = <5>;
129 clocks = <&mux5>;
124 next-level-cache = <&L2_5>; 130 next-level-cache = <&L2_5>;
125 L2_5: l2-cache { 131 L2_5: l2-cache {
126 next-level-cache = <&cpc>; 132 next-level-cache = <&cpc>;
@@ -129,6 +135,7 @@
129 cpu6: PowerPC,e500mc@6 { 135 cpu6: PowerPC,e500mc@6 {
130 device_type = "cpu"; 136 device_type = "cpu";
131 reg = <6>; 137 reg = <6>;
138 clocks = <&mux6>;
132 next-level-cache = <&L2_6>; 139 next-level-cache = <&L2_6>;
133 L2_6: l2-cache { 140 L2_6: l2-cache {
134 next-level-cache = <&cpc>; 141 next-level-cache = <&cpc>;
@@ -137,6 +144,7 @@
137 cpu7: PowerPC,e500mc@7 { 144 cpu7: PowerPC,e500mc@7 {
138 device_type = "cpu"; 145 device_type = "cpu";
139 reg = <7>; 146 reg = <7>;
147 clocks = <&mux7>;
140 next-level-cache = <&L2_7>; 148 next-level-cache = <&L2_7>;
141 L2_7: l2-cache { 149 L2_7: l2-cache {
142 next-level-cache = <&cpc>; 150 next-level-cache = <&cpc>;
diff --git a/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi b/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
index bc3ae5a2252f..2985de4ad6be 100644
--- a/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
@@ -338,8 +338,51 @@
338 338
339 clockgen: global-utilities@e1000 { 339 clockgen: global-utilities@e1000 {
340 compatible = "fsl,p5020-clockgen", "fsl,qoriq-clockgen-1.0"; 340 compatible = "fsl,p5020-clockgen", "fsl,qoriq-clockgen-1.0";
341 ranges = <0x0 0xe1000 0x1000>;
341 reg = <0xe1000 0x1000>; 342 reg = <0xe1000 0x1000>;
342 clock-frequency = <0>; 343 clock-frequency = <0>;
344 #address-cells = <1>;
345 #size-cells = <1>;
346
347 sysclk: sysclk {
348 #clock-cells = <0>;
349 compatible = "fsl,qoriq-sysclk-1.0";
350 clock-output-names = "sysclk";
351 };
352
353 pll0: pll0@800 {
354 #clock-cells = <1>;
355 reg = <0x800 0x4>;
356 compatible = "fsl,qoriq-core-pll-1.0";
357 clocks = <&sysclk>;
358 clock-output-names = "pll0", "pll0-div2";
359 };
360
361 pll1: pll1@820 {
362 #clock-cells = <1>;
363 reg = <0x820 0x4>;
364 compatible = "fsl,qoriq-core-pll-1.0";
365 clocks = <&sysclk>;
366 clock-output-names = "pll1", "pll1-div2";
367 };
368
369 mux0: mux0@0 {
370 #clock-cells = <0>;
371 reg = <0x0 0x4>;
372 compatible = "fsl,qoriq-core-mux-1.0";
373 clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
374 clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
375 clock-output-names = "cmux0";
376 };
377
378 mux1: mux1@20 {
379 #clock-cells = <0>;
380 reg = <0x20 0x4>;
381 compatible = "fsl,qoriq-core-mux-1.0";
382 clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
383 clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
384 clock-output-names = "cmux1";
385 };
343 }; 386 };
344 387
345 rcpm: global-utilities@e2000 { 388 rcpm: global-utilities@e2000 {
diff --git a/arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi
index 8df47fc45ab5..fe1a2e6613b4 100644
--- a/arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi
@@ -88,6 +88,7 @@
88 cpu0: PowerPC,e5500@0 { 88 cpu0: PowerPC,e5500@0 {
89 device_type = "cpu"; 89 device_type = "cpu";
90 reg = <0>; 90 reg = <0>;
91 clocks = <&mux0>;
91 next-level-cache = <&L2_0>; 92 next-level-cache = <&L2_0>;
92 L2_0: l2-cache { 93 L2_0: l2-cache {
93 next-level-cache = <&cpc>; 94 next-level-cache = <&cpc>;
@@ -96,6 +97,7 @@
96 cpu1: PowerPC,e5500@1 { 97 cpu1: PowerPC,e5500@1 {
97 device_type = "cpu"; 98 device_type = "cpu";
98 reg = <1>; 99 reg = <1>;
100 clocks = <&mux1>;
99 next-level-cache = <&L2_1>; 101 next-level-cache = <&L2_1>;
100 L2_1: l2-cache { 102 L2_1: l2-cache {
101 next-level-cache = <&cpc>; 103 next-level-cache = <&cpc>;
diff --git a/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi b/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
index a91897f6af09..546a899efe20 100644
--- a/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
@@ -298,8 +298,69 @@
298 298
299 clockgen: global-utilities@e1000 { 299 clockgen: global-utilities@e1000 {
300 compatible = "fsl,p5040-clockgen", "fsl,qoriq-clockgen-1.0"; 300 compatible = "fsl,p5040-clockgen", "fsl,qoriq-clockgen-1.0";
301 ranges = <0x0 0xe1000 0x1000>;
301 reg = <0xe1000 0x1000>; 302 reg = <0xe1000 0x1000>;
302 clock-frequency = <0>; 303 clock-frequency = <0>;
304 #address-cells = <1>;
305 #size-cells = <1>;
306
307 sysclk: sysclk {
308 #clock-cells = <0>;
309 compatible = "fsl,qoriq-sysclk-1.0";
310 clock-output-names = "sysclk";
311 };
312
313 pll0: pll0@800 {
314 #clock-cells = <1>;
315 reg = <0x800 0x4>;
316 compatible = "fsl,qoriq-core-pll-1.0";
317 clocks = <&sysclk>;
318 clock-output-names = "pll0", "pll0-div2";
319 };
320
321 pll1: pll1@820 {
322 #clock-cells = <1>;
323 reg = <0x820 0x4>;
324 compatible = "fsl,qoriq-core-pll-1.0";
325 clocks = <&sysclk>;
326 clock-output-names = "pll1", "pll1-div2";
327 };
328
329 mux0: mux0@0 {
330 #clock-cells = <0>;
331 reg = <0x0 0x4>;
332 compatible = "fsl,qoriq-core-mux-1.0";
333 clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
334 clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
335 clock-output-names = "cmux0";
336 };
337
338 mux1: mux1@20 {
339 #clock-cells = <0>;
340 reg = <0x20 0x4>;
341 compatible = "fsl,qoriq-core-mux-1.0";
342 clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
343 clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
344 clock-output-names = "cmux1";
345 };
346
347 mux2: mux2@40 {
348 #clock-cells = <0>;
349 reg = <0x40 0x4>;
350 compatible = "fsl,qoriq-core-mux-1.0";
351 clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
352 clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
353 clock-output-names = "cmux2";
354 };
355
356 mux3: mux3@60 {
357 #clock-cells = <0>;
358 reg = <0x60 0x4>;
359 compatible = "fsl,qoriq-core-mux-1.0";
360 clocks = <&pll0 0>, <&pll0 1>, <&pll1 0>, <&pll1 1>;
361 clock-names = "pll0", "pll0-div2", "pll1", "pll1-div2";
362 clock-output-names = "cmux3";
363 };
303 }; 364 };
304 365
305 rcpm: global-utilities@e2000 { 366 rcpm: global-utilities@e2000 {
diff --git a/arch/powerpc/boot/dts/fsl/p5040si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p5040si-pre.dtsi
index 40ca943f5d1c..3674686687cb 100644
--- a/arch/powerpc/boot/dts/fsl/p5040si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/p5040si-pre.dtsi
@@ -81,6 +81,7 @@
81 cpu0: PowerPC,e5500@0 { 81 cpu0: PowerPC,e5500@0 {
82 device_type = "cpu"; 82 device_type = "cpu";
83 reg = <0>; 83 reg = <0>;
84 clocks = <&mux0>;
84 next-level-cache = <&L2_0>; 85 next-level-cache = <&L2_0>;
85 L2_0: l2-cache { 86 L2_0: l2-cache {
86 next-level-cache = <&cpc>; 87 next-level-cache = <&cpc>;
@@ -89,6 +90,7 @@
89 cpu1: PowerPC,e5500@1 { 90 cpu1: PowerPC,e5500@1 {
90 device_type = "cpu"; 91 device_type = "cpu";
91 reg = <1>; 92 reg = <1>;
93 clocks = <&mux1>;
92 next-level-cache = <&L2_1>; 94 next-level-cache = <&L2_1>;
93 L2_1: l2-cache { 95 L2_1: l2-cache {
94 next-level-cache = <&cpc>; 96 next-level-cache = <&cpc>;
@@ -97,6 +99,7 @@
97 cpu2: PowerPC,e5500@2 { 99 cpu2: PowerPC,e5500@2 {
98 device_type = "cpu"; 100 device_type = "cpu";
99 reg = <2>; 101 reg = <2>;
102 clocks = <&mux2>;
100 next-level-cache = <&L2_2>; 103 next-level-cache = <&L2_2>;
101 L2_2: l2-cache { 104 L2_2: l2-cache {
102 next-level-cache = <&cpc>; 105 next-level-cache = <&cpc>;
@@ -105,6 +108,7 @@
105 cpu3: PowerPC,e5500@3 { 108 cpu3: PowerPC,e5500@3 {
106 device_type = "cpu"; 109 device_type = "cpu";
107 reg = <3>; 110 reg = <3>;
111 clocks = <&mux3>;
108 next-level-cache = <&L2_3>; 112 next-level-cache = <&L2_3>;
109 L2_3: l2-cache { 113 L2_3: l2-cache {
110 next-level-cache = <&cpc>; 114 next-level-cache = <&cpc>;
diff --git a/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi b/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
index 4143a9733cd0..f99d74ff11b4 100644
--- a/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
@@ -369,7 +369,93 @@
369 369
370 clockgen: global-utilities@e1000 { 370 clockgen: global-utilities@e1000 {
371 compatible = "fsl,t4240-clockgen", "fsl,qoriq-clockgen-2.0"; 371 compatible = "fsl,t4240-clockgen", "fsl,qoriq-clockgen-2.0";
372 ranges = <0x0 0xe1000 0x1000>;
372 reg = <0xe1000 0x1000>; 373 reg = <0xe1000 0x1000>;
374 #address-cells = <1>;
375 #size-cells = <1>;
376
377 sysclk: sysclk {
378 #clock-cells = <0>;
379 compatible = "fsl,qoriq-sysclk-2.0";
380 clock-output-names = "sysclk";
381 };
382
383 pll0: pll0@800 {
384 #clock-cells = <1>;
385 reg = <0x800 0x4>;
386 compatible = "fsl,qoriq-core-pll-2.0";
387 clocks = <&sysclk>;
388 clock-output-names = "pll0", "pll0-div2", "pll0-div4";
389 };
390
391 pll1: pll1@820 {
392 #clock-cells = <1>;
393 reg = <0x820 0x4>;
394 compatible = "fsl,qoriq-core-pll-2.0";
395 clocks = <&sysclk>;
396 clock-output-names = "pll1", "pll1-div2", "pll1-div4";
397 };
398
399 pll2: pll2@840 {
400 #clock-cells = <1>;
401 reg = <0x840 0x4>;
402 compatible = "fsl,qoriq-core-pll-2.0";
403 clocks = <&sysclk>;
404 clock-output-names = "pll2", "pll2-div2", "pll2-div4";
405 };
406
407 pll3: pll3@860 {
408 #clock-cells = <1>;
409 reg = <0x860 0x4>;
410 compatible = "fsl,qoriq-core-pll-2.0";
411 clocks = <&sysclk>;
412 clock-output-names = "pll3", "pll3-div2", "pll3-div4";
413 };
414
415 pll4: pll4@880 {
416 #clock-cells = <1>;
417 reg = <0x880 0x4>;
418 compatible = "fsl,qoriq-core-pll-2.0";
419 clocks = <&sysclk>;
420 clock-output-names = "pll4", "pll4-div2", "pll4-div4";
421 };
422
423 mux0: mux0@0 {
424 #clock-cells = <0>;
425 reg = <0x0 0x4>;
426 compatible = "fsl,qoriq-core-mux-2.0";
427 clocks = <&pll0 0>, <&pll0 1>, <&pll0 2>,
428 <&pll1 0>, <&pll1 1>, <&pll1 2>,
429 <&pll2 0>, <&pll2 1>, <&pll2 2>;
430 clock-names = "pll0", "pll0-div2", "pll0-div4",
431 "pll1", "pll1-div2", "pll1-div4",
432 "pll2", "pll2-div2", "pll2-div4";
433 clock-output-names = "cmux0";
434 };
435
436 mux1: mux1@20 {
437 #clock-cells = <0>;
438 reg = <0x20 0x4>;
439 compatible = "fsl,qoriq-core-mux-2.0";
440 clocks = <&pll0 0>, <&pll0 1>, <&pll0 2>,
441 <&pll1 0>, <&pll1 1>, <&pll1 2>,
442 <&pll2 0>, <&pll2 1>, <&pll2 2>;
443 clock-names = "pll0", "pll0-div2", "pll0-div4",
444 "pll1", "pll1-div2", "pll1-div4",
445 "pll2", "pll2-div2", "pll2-div4";
446 clock-output-names = "cmux1";
447 };
448
449 mux2: mux2@40 {
450 #clock-cells = <0>;
451 reg = <0x40 0x4>;
452 compatible = "fsl,qoriq-core-mux-2.0";
453 clocks = <&pll3 0>, <&pll3 1>, <&pll3 2>,
454 <&pll4 0>, <&pll4 1>, <&pll4 2>;
455 clock-names = "pll3", "pll3-div2", "pll3-div4",
456 "pll4", "pll4-div2", "pll4-div4";
457 clock-output-names = "cmux2";
458 };
373 }; 459 };
374 460
375 rcpm: global-utilities@e2000 { 461 rcpm: global-utilities@e2000 {
diff --git a/arch/powerpc/boot/dts/fsl/t4240si-pre.dtsi b/arch/powerpc/boot/dts/fsl/t4240si-pre.dtsi
index a93c55a88560..0b8ccc5b4a46 100644
--- a/arch/powerpc/boot/dts/fsl/t4240si-pre.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t4240si-pre.dtsi
@@ -67,61 +67,73 @@
67 cpu0: PowerPC,e6500@0 { 67 cpu0: PowerPC,e6500@0 {
68 device_type = "cpu"; 68 device_type = "cpu";
69 reg = <0 1>; 69 reg = <0 1>;
70 clocks = <&mux0>;
70 next-level-cache = <&L2_1>; 71 next-level-cache = <&L2_1>;
71 }; 72 };
72 cpu1: PowerPC,e6500@2 { 73 cpu1: PowerPC,e6500@2 {
73 device_type = "cpu"; 74 device_type = "cpu";
74 reg = <2 3>; 75 reg = <2 3>;
76 clocks = <&mux0>;
75 next-level-cache = <&L2_1>; 77 next-level-cache = <&L2_1>;
76 }; 78 };
77 cpu2: PowerPC,e6500@4 { 79 cpu2: PowerPC,e6500@4 {
78 device_type = "cpu"; 80 device_type = "cpu";
79 reg = <4 5>; 81 reg = <4 5>;
82 clocks = <&mux0>;
80 next-level-cache = <&L2_1>; 83 next-level-cache = <&L2_1>;
81 }; 84 };
82 cpu3: PowerPC,e6500@6 { 85 cpu3: PowerPC,e6500@6 {
83 device_type = "cpu"; 86 device_type = "cpu";
84 reg = <6 7>; 87 reg = <6 7>;
88 clocks = <&mux0>;
85 next-level-cache = <&L2_1>; 89 next-level-cache = <&L2_1>;
86 }; 90 };
87 cpu4: PowerPC,e6500@8 { 91 cpu4: PowerPC,e6500@8 {
88 device_type = "cpu"; 92 device_type = "cpu";
89 reg = <8 9>; 93 reg = <8 9>;
94 clocks = <&mux1>;
90 next-level-cache = <&L2_2>; 95 next-level-cache = <&L2_2>;
91 }; 96 };
92 cpu5: PowerPC,e6500@10 { 97 cpu5: PowerPC,e6500@10 {
93 device_type = "cpu"; 98 device_type = "cpu";
94 reg = <10 11>; 99 reg = <10 11>;
100 clocks = <&mux1>;
95 next-level-cache = <&L2_2>; 101 next-level-cache = <&L2_2>;
96 }; 102 };
97 cpu6: PowerPC,e6500@12 { 103 cpu6: PowerPC,e6500@12 {
98 device_type = "cpu"; 104 device_type = "cpu";
99 reg = <12 13>; 105 reg = <12 13>;
106 clocks = <&mux1>;
100 next-level-cache = <&L2_2>; 107 next-level-cache = <&L2_2>;
101 }; 108 };
102 cpu7: PowerPC,e6500@14 { 109 cpu7: PowerPC,e6500@14 {
103 device_type = "cpu"; 110 device_type = "cpu";
104 reg = <14 15>; 111 reg = <14 15>;
112 clocks = <&mux1>;
105 next-level-cache = <&L2_2>; 113 next-level-cache = <&L2_2>;
106 }; 114 };
107 cpu8: PowerPC,e6500@16 { 115 cpu8: PowerPC,e6500@16 {
108 device_type = "cpu"; 116 device_type = "cpu";
109 reg = <16 17>; 117 reg = <16 17>;
118 clocks = <&mux2>;
110 next-level-cache = <&L2_3>; 119 next-level-cache = <&L2_3>;
111 }; 120 };
112 cpu9: PowerPC,e6500@18 { 121 cpu9: PowerPC,e6500@18 {
113 device_type = "cpu"; 122 device_type = "cpu";
114 reg = <18 19>; 123 reg = <18 19>;
124 clocks = <&mux2>;
115 next-level-cache = <&L2_3>; 125 next-level-cache = <&L2_3>;
116 }; 126 };
117 cpu10: PowerPC,e6500@20 { 127 cpu10: PowerPC,e6500@20 {
118 device_type = "cpu"; 128 device_type = "cpu";
119 reg = <20 21>; 129 reg = <20 21>;
130 clocks = <&mux2>;
120 next-level-cache = <&L2_3>; 131 next-level-cache = <&L2_3>;
121 }; 132 };
122 cpu11: PowerPC,e6500@22 { 133 cpu11: PowerPC,e6500@22 {
123 device_type = "cpu"; 134 device_type = "cpu";
124 reg = <22 23>; 135 reg = <22 23>;
136 clocks = <&mux2>;
125 next-level-cache = <&L2_3>; 137 next-level-cache = <&L2_3>;
126 }; 138 };
127 }; 139 };
diff --git a/arch/powerpc/boot/dts/t4240qds.dts b/arch/powerpc/boot/dts/t4240qds.dts
index 63e81b010804..97683f6a2936 100644
--- a/arch/powerpc/boot/dts/t4240qds.dts
+++ b/arch/powerpc/boot/dts/t4240qds.dts
@@ -159,6 +159,48 @@
159 interrupts = <0x1 0x1 0 0>; 159 interrupts = <0x1 0x1 0 0>;
160 }; 160 };
161 }; 161 };
162
163 i2c@2 {
164 #address-cells = <1>;
165 #size-cells = <0>;
166 reg = <0x2>;
167
168 ina220@40 {
169 compatible = "ti,ina220";
170 reg = <0x40>;
171 shunt-resistor = <1000>;
172 };
173
174 ina220@41 {
175 compatible = "ti,ina220";
176 reg = <0x41>;
177 shunt-resistor = <1000>;
178 };
179
180 ina220@44 {
181 compatible = "ti,ina220";
182 reg = <0x44>;
183 shunt-resistor = <1000>;
184 };
185
186 ina220@45 {
187 compatible = "ti,ina220";
188 reg = <0x45>;
189 shunt-resistor = <1000>;
190 };
191
192 ina220@46 {
193 compatible = "ti,ina220";
194 reg = <0x46>;
195 shunt-resistor = <1000>;
196 };
197
198 ina220@47 {
199 compatible = "ti,ina220";
200 reg = <0x47>;
201 shunt-resistor = <1000>;
202 };
203 };
162 }; 204 };
163 }; 205 };
164 206
diff --git a/arch/powerpc/configs/40x/acadia_defconfig b/arch/powerpc/configs/40x/acadia_defconfig
index ed3bab72a834..69e06eeae6a6 100644
--- a/arch/powerpc/configs/40x/acadia_defconfig
+++ b/arch/powerpc/configs/40x/acadia_defconfig
@@ -30,7 +30,6 @@ CONFIG_IP_PNP_BOOTP=y
30CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 30CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
31CONFIG_CONNECTOR=y 31CONFIG_CONNECTOR=y
32CONFIG_MTD=y 32CONFIG_MTD=y
33CONFIG_MTD_PARTITIONS=y
34CONFIG_MTD_CMDLINE_PARTS=y 33CONFIG_MTD_CMDLINE_PARTS=y
35CONFIG_MTD_OF_PARTS=y 34CONFIG_MTD_OF_PARTS=y
36CONFIG_MTD_CHAR=y 35CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/40x/ep405_defconfig b/arch/powerpc/configs/40x/ep405_defconfig
index 17582a3420fb..cf06d42f2c03 100644
--- a/arch/powerpc/configs/40x/ep405_defconfig
+++ b/arch/powerpc/configs/40x/ep405_defconfig
@@ -29,7 +29,6 @@ CONFIG_IP_PNP_BOOTP=y
29CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 29CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
30CONFIG_CONNECTOR=y 30CONFIG_CONNECTOR=y
31CONFIG_MTD=y 31CONFIG_MTD=y
32CONFIG_MTD_PARTITIONS=y
33CONFIG_MTD_CMDLINE_PARTS=y 32CONFIG_MTD_CMDLINE_PARTS=y
34CONFIG_MTD_OF_PARTS=y 33CONFIG_MTD_OF_PARTS=y
35CONFIG_MTD_CHAR=y 34CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/40x/kilauea_defconfig b/arch/powerpc/configs/40x/kilauea_defconfig
index f2d4be936e08..5ff338f6443f 100644
--- a/arch/powerpc/configs/40x/kilauea_defconfig
+++ b/arch/powerpc/configs/40x/kilauea_defconfig
@@ -32,7 +32,6 @@ CONFIG_IP_PNP_BOOTP=y
32CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 32CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
33CONFIG_CONNECTOR=y 33CONFIG_CONNECTOR=y
34CONFIG_MTD=y 34CONFIG_MTD=y
35CONFIG_MTD_PARTITIONS=y
36CONFIG_MTD_CMDLINE_PARTS=y 35CONFIG_MTD_CMDLINE_PARTS=y
37CONFIG_MTD_OF_PARTS=y 36CONFIG_MTD_OF_PARTS=y
38CONFIG_MTD_CHAR=y 37CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/40x/makalu_defconfig b/arch/powerpc/configs/40x/makalu_defconfig
index 42b979355f9b..84505e3aa0fb 100644
--- a/arch/powerpc/configs/40x/makalu_defconfig
+++ b/arch/powerpc/configs/40x/makalu_defconfig
@@ -29,7 +29,6 @@ CONFIG_IP_PNP_BOOTP=y
29CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 29CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
30CONFIG_CONNECTOR=y 30CONFIG_CONNECTOR=y
31CONFIG_MTD=y 31CONFIG_MTD=y
32CONFIG_MTD_PARTITIONS=y
33CONFIG_MTD_CMDLINE_PARTS=y 32CONFIG_MTD_CMDLINE_PARTS=y
34CONFIG_MTD_OF_PARTS=y 33CONFIG_MTD_OF_PARTS=y
35CONFIG_MTD_CHAR=y 34CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/40x/walnut_defconfig b/arch/powerpc/configs/40x/walnut_defconfig
index aa1a4cac3708..0a19f4386ee9 100644
--- a/arch/powerpc/configs/40x/walnut_defconfig
+++ b/arch/powerpc/configs/40x/walnut_defconfig
@@ -27,7 +27,6 @@ CONFIG_IP_PNP_BOOTP=y
27CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 27CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
28CONFIG_CONNECTOR=y 28CONFIG_CONNECTOR=y
29CONFIG_MTD=y 29CONFIG_MTD=y
30CONFIG_MTD_PARTITIONS=y
31CONFIG_MTD_CMDLINE_PARTS=y 30CONFIG_MTD_CMDLINE_PARTS=y
32CONFIG_MTD_OF_PARTS=y 31CONFIG_MTD_OF_PARTS=y
33CONFIG_MTD_CHAR=y 32CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/44x/arches_defconfig b/arch/powerpc/configs/44x/arches_defconfig
index 329f9a3b892e..44355c53cd30 100644
--- a/arch/powerpc/configs/44x/arches_defconfig
+++ b/arch/powerpc/configs/44x/arches_defconfig
@@ -31,7 +31,6 @@ CONFIG_IP_PNP_BOOTP=y
31CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 31CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
32CONFIG_CONNECTOR=y 32CONFIG_CONNECTOR=y
33CONFIG_MTD=y 33CONFIG_MTD=y
34CONFIG_MTD_PARTITIONS=y
35CONFIG_MTD_CMDLINE_PARTS=y 34CONFIG_MTD_CMDLINE_PARTS=y
36CONFIG_MTD_OF_PARTS=y 35CONFIG_MTD_OF_PARTS=y
37CONFIG_MTD_CHAR=y 36CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/44x/bluestone_defconfig b/arch/powerpc/configs/44x/bluestone_defconfig
index 20c8d26d7fc0..ca7f1f32f2b2 100644
--- a/arch/powerpc/configs/44x/bluestone_defconfig
+++ b/arch/powerpc/configs/44x/bluestone_defconfig
@@ -26,7 +26,6 @@ CONFIG_IP_PNP_BOOTP=y
26CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 26CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
27CONFIG_CONNECTOR=y 27CONFIG_CONNECTOR=y
28CONFIG_MTD=y 28CONFIG_MTD=y
29CONFIG_MTD_PARTITIONS=y
30CONFIG_MTD_CMDLINE_PARTS=y 29CONFIG_MTD_CMDLINE_PARTS=y
31CONFIG_MTD_OF_PARTS=y 30CONFIG_MTD_OF_PARTS=y
32CONFIG_MTD_CHAR=y 31CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/44x/canyonlands_defconfig b/arch/powerpc/configs/44x/canyonlands_defconfig
index d5be93e6e92d..7b8abd1b88b0 100644
--- a/arch/powerpc/configs/44x/canyonlands_defconfig
+++ b/arch/powerpc/configs/44x/canyonlands_defconfig
@@ -31,7 +31,6 @@ CONFIG_IP_PNP_BOOTP=y
31CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 31CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
32CONFIG_CONNECTOR=y 32CONFIG_CONNECTOR=y
33CONFIG_MTD=y 33CONFIG_MTD=y
34CONFIG_MTD_PARTITIONS=y
35CONFIG_MTD_CMDLINE_PARTS=y 34CONFIG_MTD_CMDLINE_PARTS=y
36CONFIG_MTD_OF_PARTS=y 35CONFIG_MTD_OF_PARTS=y
37CONFIG_MTD_CHAR=y 36CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/44x/ebony_defconfig b/arch/powerpc/configs/44x/ebony_defconfig
index f9269fc4ffcc..31b58b0d52e2 100644
--- a/arch/powerpc/configs/44x/ebony_defconfig
+++ b/arch/powerpc/configs/44x/ebony_defconfig
@@ -28,7 +28,6 @@ CONFIG_IP_PNP_BOOTP=y
28CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 28CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
29CONFIG_CONNECTOR=y 29CONFIG_CONNECTOR=y
30CONFIG_MTD=y 30CONFIG_MTD=y
31CONFIG_MTD_PARTITIONS=y
32CONFIG_MTD_OF_PARTS=y 31CONFIG_MTD_OF_PARTS=y
33CONFIG_MTD_CHAR=y 32CONFIG_MTD_CHAR=y
34CONFIG_MTD_BLOCK=y 33CONFIG_MTD_BLOCK=y
diff --git a/arch/powerpc/configs/44x/eiger_defconfig b/arch/powerpc/configs/44x/eiger_defconfig
index 9be089038fd7..faccaf65f394 100644
--- a/arch/powerpc/configs/44x/eiger_defconfig
+++ b/arch/powerpc/configs/44x/eiger_defconfig
@@ -34,7 +34,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
34CONFIG_CONNECTOR=y 34CONFIG_CONNECTOR=y
35CONFIG_MTD=y 35CONFIG_MTD=y
36CONFIG_MTD_CONCAT=y 36CONFIG_MTD_CONCAT=y
37CONFIG_MTD_PARTITIONS=y
38CONFIG_MTD_CMDLINE_PARTS=y 37CONFIG_MTD_CMDLINE_PARTS=y
39CONFIG_MTD_OF_PARTS=y 38CONFIG_MTD_OF_PARTS=y
40CONFIG_MTD_CHAR=y 39CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/44x/icon_defconfig b/arch/powerpc/configs/44x/icon_defconfig
index 82f73035a7ce..05782c145141 100644
--- a/arch/powerpc/configs/44x/icon_defconfig
+++ b/arch/powerpc/configs/44x/icon_defconfig
@@ -33,7 +33,6 @@ CONFIG_IP_PNP_BOOTP=y
33CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 33CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
34CONFIG_CONNECTOR=y 34CONFIG_CONNECTOR=y
35CONFIG_MTD=y 35CONFIG_MTD=y
36CONFIG_MTD_PARTITIONS=y
37CONFIG_MTD_CMDLINE_PARTS=y 36CONFIG_MTD_CMDLINE_PARTS=y
38CONFIG_MTD_OF_PARTS=y 37CONFIG_MTD_OF_PARTS=y
39CONFIG_MTD_CHAR=y 38CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/44x/iss476-smp_defconfig b/arch/powerpc/configs/44x/iss476-smp_defconfig
index ca00cf750d3e..49a1518a4e69 100644
--- a/arch/powerpc/configs/44x/iss476-smp_defconfig
+++ b/arch/powerpc/configs/44x/iss476-smp_defconfig
@@ -42,7 +42,6 @@ CONFIG_IP_PNP_BOOTP=y
42CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 42CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
43CONFIG_CONNECTOR=y 43CONFIG_CONNECTOR=y
44CONFIG_MTD=y 44CONFIG_MTD=y
45CONFIG_MTD_PARTITIONS=y
46CONFIG_MTD_OF_PARTS=y 45CONFIG_MTD_OF_PARTS=y
47CONFIG_MTD_CHAR=y 46CONFIG_MTD_CHAR=y
48CONFIG_MTD_BLOCK=y 47CONFIG_MTD_BLOCK=y
diff --git a/arch/powerpc/configs/44x/katmai_defconfig b/arch/powerpc/configs/44x/katmai_defconfig
index 109562c3c6be..f1137972ed41 100644
--- a/arch/powerpc/configs/44x/katmai_defconfig
+++ b/arch/powerpc/configs/44x/katmai_defconfig
@@ -29,7 +29,6 @@ CONFIG_IP_PNP_BOOTP=y
29CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 29CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
30CONFIG_CONNECTOR=y 30CONFIG_CONNECTOR=y
31CONFIG_MTD=y 31CONFIG_MTD=y
32CONFIG_MTD_PARTITIONS=y
33CONFIG_MTD_CMDLINE_PARTS=y 32CONFIG_MTD_CMDLINE_PARTS=y
34CONFIG_MTD_OF_PARTS=y 33CONFIG_MTD_OF_PARTS=y
35CONFIG_MTD_CHAR=y 34CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/44x/rainier_defconfig b/arch/powerpc/configs/44x/rainier_defconfig
index 21c33faf61a2..4b91a44c4c32 100644
--- a/arch/powerpc/configs/44x/rainier_defconfig
+++ b/arch/powerpc/configs/44x/rainier_defconfig
@@ -30,7 +30,6 @@ CONFIG_IP_PNP_BOOTP=y
30CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 30CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
31CONFIG_CONNECTOR=y 31CONFIG_CONNECTOR=y
32CONFIG_MTD=y 32CONFIG_MTD=y
33CONFIG_MTD_PARTITIONS=y
34CONFIG_MTD_CMDLINE_PARTS=y 33CONFIG_MTD_CMDLINE_PARTS=y
35CONFIG_MTD_OF_PARTS=y 34CONFIG_MTD_OF_PARTS=y
36CONFIG_MTD_CHAR=y 35CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/44x/redwood_defconfig b/arch/powerpc/configs/44x/redwood_defconfig
index 48802811da76..b7113e114a14 100644
--- a/arch/powerpc/configs/44x/redwood_defconfig
+++ b/arch/powerpc/configs/44x/redwood_defconfig
@@ -34,7 +34,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
34CONFIG_CONNECTOR=y 34CONFIG_CONNECTOR=y
35CONFIG_MTD=y 35CONFIG_MTD=y
36CONFIG_MTD_CONCAT=y 36CONFIG_MTD_CONCAT=y
37CONFIG_MTD_PARTITIONS=y
38CONFIG_MTD_CMDLINE_PARTS=y 37CONFIG_MTD_CMDLINE_PARTS=y
39CONFIG_MTD_OF_PARTS=y 38CONFIG_MTD_OF_PARTS=y
40CONFIG_MTD_CHAR=y 39CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/44x/sequoia_defconfig b/arch/powerpc/configs/44x/sequoia_defconfig
index b7a653b626db..9642d99b47f1 100644
--- a/arch/powerpc/configs/44x/sequoia_defconfig
+++ b/arch/powerpc/configs/44x/sequoia_defconfig
@@ -31,7 +31,6 @@ CONFIG_IP_PNP_BOOTP=y
31CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 31CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
32CONFIG_CONNECTOR=y 32CONFIG_CONNECTOR=y
33CONFIG_MTD=y 33CONFIG_MTD=y
34CONFIG_MTD_PARTITIONS=y
35CONFIG_MTD_CMDLINE_PARTS=y 34CONFIG_MTD_CMDLINE_PARTS=y
36CONFIG_MTD_OF_PARTS=y 35CONFIG_MTD_OF_PARTS=y
37CONFIG_MTD_CHAR=y 36CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/44x/taishan_defconfig b/arch/powerpc/configs/44x/taishan_defconfig
index 30de97f158a4..09e3075030bf 100644
--- a/arch/powerpc/configs/44x/taishan_defconfig
+++ b/arch/powerpc/configs/44x/taishan_defconfig
@@ -29,7 +29,6 @@ CONFIG_IP_PNP_BOOTP=y
29CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 29CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
30CONFIG_CONNECTOR=y 30CONFIG_CONNECTOR=y
31CONFIG_MTD=y 31CONFIG_MTD=y
32CONFIG_MTD_PARTITIONS=y
33CONFIG_MTD_CMDLINE_PARTS=y 32CONFIG_MTD_CMDLINE_PARTS=y
34CONFIG_MTD_CHAR=y 33CONFIG_MTD_CHAR=y
35CONFIG_MTD_CFI=y 34CONFIG_MTD_CFI=y
diff --git a/arch/powerpc/configs/44x/warp_defconfig b/arch/powerpc/configs/44x/warp_defconfig
index 105bc56f4b2b..551e50a0be5e 100644
--- a/arch/powerpc/configs/44x/warp_defconfig
+++ b/arch/powerpc/configs/44x/warp_defconfig
@@ -34,7 +34,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
34# CONFIG_STANDALONE is not set 34# CONFIG_STANDALONE is not set
35# CONFIG_FIRMWARE_IN_KERNEL is not set 35# CONFIG_FIRMWARE_IN_KERNEL is not set
36CONFIG_MTD=y 36CONFIG_MTD=y
37CONFIG_MTD_PARTITIONS=y
38CONFIG_MTD_CMDLINE_PARTS=y 37CONFIG_MTD_CMDLINE_PARTS=y
39CONFIG_MTD_OF_PARTS=y 38CONFIG_MTD_OF_PARTS=y
40CONFIG_MTD_CHAR=y 39CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/52xx/cm5200_defconfig b/arch/powerpc/configs/52xx/cm5200_defconfig
index 0b88c7b30bb9..4f84a0b2fbf3 100644
--- a/arch/powerpc/configs/52xx/cm5200_defconfig
+++ b/arch/powerpc/configs/52xx/cm5200_defconfig
@@ -30,7 +30,6 @@ CONFIG_SYN_COOKIES=y
30CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 30CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
31# CONFIG_FW_LOADER is not set 31# CONFIG_FW_LOADER is not set
32CONFIG_MTD=y 32CONFIG_MTD=y
33CONFIG_MTD_PARTITIONS=y
34CONFIG_MTD_CMDLINE_PARTS=y 33CONFIG_MTD_CMDLINE_PARTS=y
35CONFIG_MTD_CHAR=y 34CONFIG_MTD_CHAR=y
36CONFIG_MTD_BLOCK=y 35CONFIG_MTD_BLOCK=y
diff --git a/arch/powerpc/configs/52xx/motionpro_defconfig b/arch/powerpc/configs/52xx/motionpro_defconfig
index 0d13ad7e4478..c05310a913be 100644
--- a/arch/powerpc/configs/52xx/motionpro_defconfig
+++ b/arch/powerpc/configs/52xx/motionpro_defconfig
@@ -31,7 +31,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
31# CONFIG_FW_LOADER is not set 31# CONFIG_FW_LOADER is not set
32CONFIG_MTD=y 32CONFIG_MTD=y
33CONFIG_MTD_CONCAT=y 33CONFIG_MTD_CONCAT=y
34CONFIG_MTD_PARTITIONS=y
35CONFIG_MTD_CMDLINE_PARTS=y 34CONFIG_MTD_CMDLINE_PARTS=y
36CONFIG_MTD_CHAR=y 35CONFIG_MTD_CHAR=y
37CONFIG_MTD_BLOCK=y 36CONFIG_MTD_BLOCK=y
diff --git a/arch/powerpc/configs/52xx/pcm030_defconfig b/arch/powerpc/configs/52xx/pcm030_defconfig
index 430aa182fa1c..2401e2554329 100644
--- a/arch/powerpc/configs/52xx/pcm030_defconfig
+++ b/arch/powerpc/configs/52xx/pcm030_defconfig
@@ -44,7 +44,6 @@ CONFIG_IP_PNP_BOOTP=y
44CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 44CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
45# CONFIG_FW_LOADER is not set 45# CONFIG_FW_LOADER is not set
46CONFIG_MTD=y 46CONFIG_MTD=y
47CONFIG_MTD_PARTITIONS=y
48CONFIG_MTD_CMDLINE_PARTS=y 47CONFIG_MTD_CMDLINE_PARTS=y
49CONFIG_MTD_CHAR=y 48CONFIG_MTD_CHAR=y
50CONFIG_MTD_BLOCK=y 49CONFIG_MTD_BLOCK=y
diff --git a/arch/powerpc/configs/52xx/tqm5200_defconfig b/arch/powerpc/configs/52xx/tqm5200_defconfig
index 7af4c5bb7c63..21c841e0f482 100644
--- a/arch/powerpc/configs/52xx/tqm5200_defconfig
+++ b/arch/powerpc/configs/52xx/tqm5200_defconfig
@@ -35,7 +35,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
35# CONFIG_FW_LOADER is not set 35# CONFIG_FW_LOADER is not set
36CONFIG_MTD=y 36CONFIG_MTD=y
37CONFIG_MTD_CONCAT=y 37CONFIG_MTD_CONCAT=y
38CONFIG_MTD_PARTITIONS=y
39CONFIG_MTD_CMDLINE_PARTS=y 38CONFIG_MTD_CMDLINE_PARTS=y
40CONFIG_MTD_OF_PARTS=y 39CONFIG_MTD_OF_PARTS=y
41CONFIG_MTD_CHAR=y 40CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/83xx/asp8347_defconfig b/arch/powerpc/configs/83xx/asp8347_defconfig
index d2762d9dcb8e..985f95c7280a 100644
--- a/arch/powerpc/configs/83xx/asp8347_defconfig
+++ b/arch/powerpc/configs/83xx/asp8347_defconfig
@@ -32,7 +32,6 @@ CONFIG_SYN_COOKIES=y
32CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 32CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
33# CONFIG_FW_LOADER is not set 33# CONFIG_FW_LOADER is not set
34CONFIG_MTD=y 34CONFIG_MTD=y
35CONFIG_MTD_PARTITIONS=y
36CONFIG_MTD_REDBOOT_PARTS=y 35CONFIG_MTD_REDBOOT_PARTS=y
37CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y 36CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
38CONFIG_MTD_OF_PARTS=y 37CONFIG_MTD_OF_PARTS=y
diff --git a/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig b/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
index e4ad2e27551a..0b73b7f9d112 100644
--- a/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
+++ b/arch/powerpc/configs/83xx/mpc8313_rdb_defconfig
@@ -30,7 +30,6 @@ CONFIG_SYN_COOKIES=y
30CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 30CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
31# CONFIG_FW_LOADER is not set 31# CONFIG_FW_LOADER is not set
32CONFIG_MTD=y 32CONFIG_MTD=y
33CONFIG_MTD_PARTITIONS=y
34CONFIG_MTD_OF_PARTS=y 33CONFIG_MTD_OF_PARTS=y
35CONFIG_MTD_CHAR=y 34CONFIG_MTD_CHAR=y
36CONFIG_MTD_BLOCK=y 35CONFIG_MTD_BLOCK=y
diff --git a/arch/powerpc/configs/83xx/mpc8315_rdb_defconfig b/arch/powerpc/configs/83xx/mpc8315_rdb_defconfig
index 34ff5686be08..97ac3b993cb6 100644
--- a/arch/powerpc/configs/83xx/mpc8315_rdb_defconfig
+++ b/arch/powerpc/configs/83xx/mpc8315_rdb_defconfig
@@ -30,7 +30,6 @@ CONFIG_SYN_COOKIES=y
30CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 30CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
31# CONFIG_FW_LOADER is not set 31# CONFIG_FW_LOADER is not set
32CONFIG_MTD=y 32CONFIG_MTD=y
33CONFIG_MTD_PARTITIONS=y
34CONFIG_MTD_CHAR=y 33CONFIG_MTD_CHAR=y
35CONFIG_MTD_BLOCK=y 34CONFIG_MTD_BLOCK=y
36CONFIG_MTD_CFI=y 35CONFIG_MTD_CFI=y
diff --git a/arch/powerpc/configs/83xx/mpc836x_mds_defconfig b/arch/powerpc/configs/83xx/mpc836x_mds_defconfig
index 10b5c4cd0e72..05710bbfd2ef 100644
--- a/arch/powerpc/configs/83xx/mpc836x_mds_defconfig
+++ b/arch/powerpc/configs/83xx/mpc836x_mds_defconfig
@@ -31,7 +31,6 @@ CONFIG_SYN_COOKIES=y
31CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 31CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
32# CONFIG_FW_LOADER is not set 32# CONFIG_FW_LOADER is not set
33CONFIG_MTD=y 33CONFIG_MTD=y
34CONFIG_MTD_PARTITIONS=y
35CONFIG_MTD_CMDLINE_PARTS=y 34CONFIG_MTD_CMDLINE_PARTS=y
36CONFIG_MTD_CHAR=y 35CONFIG_MTD_CHAR=y
37CONFIG_MTD_BLOCK=y 36CONFIG_MTD_BLOCK=y
diff --git a/arch/powerpc/configs/83xx/mpc836x_rdk_defconfig b/arch/powerpc/configs/83xx/mpc836x_rdk_defconfig
index 45925d701d2a..0540d673a052 100644
--- a/arch/powerpc/configs/83xx/mpc836x_rdk_defconfig
+++ b/arch/powerpc/configs/83xx/mpc836x_rdk_defconfig
@@ -29,7 +29,6 @@ CONFIG_SYN_COOKIES=y
29# CONFIG_IPV6 is not set 29# CONFIG_IPV6 is not set
30CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 30CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
31CONFIG_MTD=y 31CONFIG_MTD=y
32CONFIG_MTD_PARTITIONS=y
33CONFIG_MTD_CMDLINE_PARTS=y 32CONFIG_MTD_CMDLINE_PARTS=y
34CONFIG_MTD_CHAR=y 33CONFIG_MTD_CHAR=y
35CONFIG_MTD_BLOCK=y 34CONFIG_MTD_BLOCK=y
diff --git a/arch/powerpc/configs/83xx/sbc834x_defconfig b/arch/powerpc/configs/83xx/sbc834x_defconfig
index 6d6463fe06fc..a3bcda67d2d9 100644
--- a/arch/powerpc/configs/83xx/sbc834x_defconfig
+++ b/arch/powerpc/configs/83xx/sbc834x_defconfig
@@ -31,7 +31,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
31# CONFIG_FW_LOADER is not set 31# CONFIG_FW_LOADER is not set
32CONFIG_MTD=y 32CONFIG_MTD=y
33CONFIG_MTD_CONCAT=y 33CONFIG_MTD_CONCAT=y
34CONFIG_MTD_PARTITIONS=y
35CONFIG_MTD_CMDLINE_PARTS=y 34CONFIG_MTD_CMDLINE_PARTS=y
36CONFIG_MTD_OF_PARTS=y 35CONFIG_MTD_OF_PARTS=y
37CONFIG_MTD_CHAR=y 36CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/85xx/ksi8560_defconfig b/arch/powerpc/configs/85xx/ksi8560_defconfig
index 8f7c1061891a..aee0d17a9551 100644
--- a/arch/powerpc/configs/85xx/ksi8560_defconfig
+++ b/arch/powerpc/configs/85xx/ksi8560_defconfig
@@ -28,7 +28,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
28# CONFIG_FW_LOADER is not set 28# CONFIG_FW_LOADER is not set
29CONFIG_MTD=y 29CONFIG_MTD=y
30CONFIG_MTD_CONCAT=y 30CONFIG_MTD_CONCAT=y
31CONFIG_MTD_PARTITIONS=y
32CONFIG_MTD_CHAR=y 31CONFIG_MTD_CHAR=y
33CONFIG_MTD_BLOCK=y 32CONFIG_MTD_BLOCK=y
34CONFIG_MTD_CFI=y 33CONFIG_MTD_CFI=y
diff --git a/arch/powerpc/configs/85xx/ppa8548_defconfig b/arch/powerpc/configs/85xx/ppa8548_defconfig
index a11337de8aa2..e80bb9b21eac 100644
--- a/arch/powerpc/configs/85xx/ppa8548_defconfig
+++ b/arch/powerpc/configs/85xx/ppa8548_defconfig
@@ -44,7 +44,6 @@ CONFIG_MTD_CFI_INTELEXT=y
44CONFIG_MTD_CHAR=y 44CONFIG_MTD_CHAR=y
45CONFIG_MTD_CMDLINE_PARTS=y 45CONFIG_MTD_CMDLINE_PARTS=y
46CONFIG_MTD_CONCAT=y 46CONFIG_MTD_CONCAT=y
47CONFIG_MTD_PARTITIONS=y
48CONFIG_MTD_PHYSMAP_OF=y 47CONFIG_MTD_PHYSMAP_OF=y
49 48
50CONFIG_I2C=y 49CONFIG_I2C=y
diff --git a/arch/powerpc/configs/85xx/socrates_defconfig b/arch/powerpc/configs/85xx/socrates_defconfig
index 77506b5d5a41..e5147488c000 100644
--- a/arch/powerpc/configs/85xx/socrates_defconfig
+++ b/arch/powerpc/configs/85xx/socrates_defconfig
@@ -32,7 +32,6 @@ CONFIG_CAN_RAW=y
32CONFIG_CAN_BCM=y 32CONFIG_CAN_BCM=y
33CONFIG_MTD=y 33CONFIG_MTD=y
34CONFIG_MTD_CONCAT=y 34CONFIG_MTD_CONCAT=y
35CONFIG_MTD_PARTITIONS=y
36CONFIG_MTD_CMDLINE_PARTS=y 35CONFIG_MTD_CMDLINE_PARTS=y
37CONFIG_MTD_OF_PARTS=y 36CONFIG_MTD_OF_PARTS=y
38CONFIG_MTD_CHAR=y 37CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/85xx/tqm8540_defconfig b/arch/powerpc/configs/85xx/tqm8540_defconfig
index ddcb9f37fa1f..5a800e6e38e3 100644
--- a/arch/powerpc/configs/85xx/tqm8540_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8540_defconfig
@@ -26,7 +26,6 @@ CONFIG_SYN_COOKIES=y
26# CONFIG_IPV6 is not set 26# CONFIG_IPV6 is not set
27CONFIG_MTD=y 27CONFIG_MTD=y
28CONFIG_MTD_CONCAT=y 28CONFIG_MTD_CONCAT=y
29CONFIG_MTD_PARTITIONS=y
30CONFIG_MTD_CMDLINE_PARTS=y 29CONFIG_MTD_CMDLINE_PARTS=y
31CONFIG_MTD_CHAR=y 30CONFIG_MTD_CHAR=y
32CONFIG_MTD_BLOCK=y 31CONFIG_MTD_BLOCK=y
diff --git a/arch/powerpc/configs/85xx/tqm8541_defconfig b/arch/powerpc/configs/85xx/tqm8541_defconfig
index 981abd6d4b57..2d936697d69e 100644
--- a/arch/powerpc/configs/85xx/tqm8541_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8541_defconfig
@@ -26,7 +26,6 @@ CONFIG_SYN_COOKIES=y
26# CONFIG_IPV6 is not set 26# CONFIG_IPV6 is not set
27CONFIG_MTD=y 27CONFIG_MTD=y
28CONFIG_MTD_CONCAT=y 28CONFIG_MTD_CONCAT=y
29CONFIG_MTD_PARTITIONS=y
30CONFIG_MTD_CMDLINE_PARTS=y 29CONFIG_MTD_CMDLINE_PARTS=y
31CONFIG_MTD_CHAR=y 30CONFIG_MTD_CHAR=y
32CONFIG_MTD_BLOCK=y 31CONFIG_MTD_BLOCK=y
diff --git a/arch/powerpc/configs/85xx/tqm8548_defconfig b/arch/powerpc/configs/85xx/tqm8548_defconfig
index 37b3d7227cdd..ce8a67e89473 100644
--- a/arch/powerpc/configs/85xx/tqm8548_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8548_defconfig
@@ -34,7 +34,6 @@ CONFIG_SYN_COOKIES=y
34CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 34CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
35# CONFIG_FW_LOADER is not set 35# CONFIG_FW_LOADER is not set
36CONFIG_MTD=y 36CONFIG_MTD=y
37CONFIG_MTD_PARTITIONS=y
38CONFIG_MTD_OF_PARTS=y 37CONFIG_MTD_OF_PARTS=y
39CONFIG_MTD_CHAR=y 38CONFIG_MTD_CHAR=y
40CONFIG_MTD_BLKDEVS=y 39CONFIG_MTD_BLKDEVS=y
diff --git a/arch/powerpc/configs/85xx/tqm8555_defconfig b/arch/powerpc/configs/85xx/tqm8555_defconfig
index 3593b320c97c..a4e12971ccac 100644
--- a/arch/powerpc/configs/85xx/tqm8555_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8555_defconfig
@@ -26,7 +26,6 @@ CONFIG_SYN_COOKIES=y
26# CONFIG_IPV6 is not set 26# CONFIG_IPV6 is not set
27CONFIG_MTD=y 27CONFIG_MTD=y
28CONFIG_MTD_CONCAT=y 28CONFIG_MTD_CONCAT=y
29CONFIG_MTD_PARTITIONS=y
30CONFIG_MTD_CMDLINE_PARTS=y 29CONFIG_MTD_CMDLINE_PARTS=y
31CONFIG_MTD_CHAR=y 30CONFIG_MTD_CHAR=y
32CONFIG_MTD_BLOCK=y 31CONFIG_MTD_BLOCK=y
diff --git a/arch/powerpc/configs/85xx/tqm8560_defconfig b/arch/powerpc/configs/85xx/tqm8560_defconfig
index de413acc34d6..341abe18a74d 100644
--- a/arch/powerpc/configs/85xx/tqm8560_defconfig
+++ b/arch/powerpc/configs/85xx/tqm8560_defconfig
@@ -26,7 +26,6 @@ CONFIG_SYN_COOKIES=y
26# CONFIG_IPV6 is not set 26# CONFIG_IPV6 is not set
27CONFIG_MTD=y 27CONFIG_MTD=y
28CONFIG_MTD_CONCAT=y 28CONFIG_MTD_CONCAT=y
29CONFIG_MTD_PARTITIONS=y
30CONFIG_MTD_CMDLINE_PARTS=y 29CONFIG_MTD_CMDLINE_PARTS=y
31CONFIG_MTD_CHAR=y 30CONFIG_MTD_CHAR=y
32CONFIG_MTD_BLOCK=y 31CONFIG_MTD_BLOCK=y
diff --git a/arch/powerpc/configs/85xx/xes_mpc85xx_defconfig b/arch/powerpc/configs/85xx/xes_mpc85xx_defconfig
index 1cd6fcb368e9..07bb81df27e0 100644
--- a/arch/powerpc/configs/85xx/xes_mpc85xx_defconfig
+++ b/arch/powerpc/configs/85xx/xes_mpc85xx_defconfig
@@ -65,7 +65,6 @@ CONFIG_ARPD=y
65CONFIG_IPV6=y 65CONFIG_IPV6=y
66CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 66CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
67CONFIG_MTD=y 67CONFIG_MTD=y
68CONFIG_MTD_PARTITIONS=y
69CONFIG_MTD_REDBOOT_PARTS=y 68CONFIG_MTD_REDBOOT_PARTS=y
70CONFIG_MTD_CMDLINE_PARTS=y 69CONFIG_MTD_CMDLINE_PARTS=y
71CONFIG_MTD_OF_PARTS=y 70CONFIG_MTD_OF_PARTS=y
diff --git a/arch/powerpc/configs/86xx/gef_ppc9a_defconfig b/arch/powerpc/configs/86xx/gef_ppc9a_defconfig
index f2f6734d5f76..e5a648115ada 100644
--- a/arch/powerpc/configs/86xx/gef_ppc9a_defconfig
+++ b/arch/powerpc/configs/86xx/gef_ppc9a_defconfig
@@ -70,7 +70,6 @@ CONFIG_NET_PKTGEN=m
70CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 70CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
71CONFIG_MTD=y 71CONFIG_MTD=y
72CONFIG_MTD_CONCAT=y 72CONFIG_MTD_CONCAT=y
73CONFIG_MTD_PARTITIONS=y
74CONFIG_MTD_OF_PARTS=y 73CONFIG_MTD_OF_PARTS=y
75CONFIG_MTD_CHAR=y 74CONFIG_MTD_CHAR=y
76CONFIG_MTD_BLOCK=y 75CONFIG_MTD_BLOCK=y
diff --git a/arch/powerpc/configs/86xx/gef_sbc310_defconfig b/arch/powerpc/configs/86xx/gef_sbc310_defconfig
index be73219212b7..8317b6010ba6 100644
--- a/arch/powerpc/configs/86xx/gef_sbc310_defconfig
+++ b/arch/powerpc/configs/86xx/gef_sbc310_defconfig
@@ -70,7 +70,6 @@ CONFIG_NET_PKTGEN=m
70CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 70CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
71CONFIG_MTD=y 71CONFIG_MTD=y
72CONFIG_MTD_CONCAT=y 72CONFIG_MTD_CONCAT=y
73CONFIG_MTD_PARTITIONS=y
74CONFIG_MTD_OF_PARTS=y 73CONFIG_MTD_OF_PARTS=y
75CONFIG_MTD_CHAR=y 74CONFIG_MTD_CHAR=y
76CONFIG_MTD_BLOCK=y 75CONFIG_MTD_BLOCK=y
diff --git a/arch/powerpc/configs/86xx/gef_sbc610_defconfig b/arch/powerpc/configs/86xx/gef_sbc610_defconfig
index b3e2b1058f27..124d66f0282c 100644
--- a/arch/powerpc/configs/86xx/gef_sbc610_defconfig
+++ b/arch/powerpc/configs/86xx/gef_sbc610_defconfig
@@ -123,7 +123,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
123# CONFIG_FW_LOADER is not set 123# CONFIG_FW_LOADER is not set
124CONFIG_MTD=y 124CONFIG_MTD=y
125CONFIG_MTD_CONCAT=y 125CONFIG_MTD_CONCAT=y
126CONFIG_MTD_PARTITIONS=y
127CONFIG_MTD_OF_PARTS=y 126CONFIG_MTD_OF_PARTS=y
128CONFIG_MTD_CHAR=y 127CONFIG_MTD_CHAR=y
129CONFIG_MTD_BLOCK=y 128CONFIG_MTD_BLOCK=y
diff --git a/arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig b/arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig
index c09598b31de1..bcbe74716689 100644
--- a/arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig
+++ b/arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig
@@ -41,7 +41,6 @@ CONFIG_IP_PNP_RARP=y
41CONFIG_IPV6=y 41CONFIG_IPV6=y
42CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 42CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
43CONFIG_MTD=y 43CONFIG_MTD=y
44CONFIG_MTD_PARTITIONS=y
45CONFIG_MTD_CMDLINE_PARTS=y 44CONFIG_MTD_CMDLINE_PARTS=y
46CONFIG_MTD_CHAR=y 45CONFIG_MTD_CHAR=y
47CONFIG_MTD_BLOCK=y 46CONFIG_MTD_BLOCK=y
diff --git a/arch/powerpc/configs/86xx/sbc8641d_defconfig b/arch/powerpc/configs/86xx/sbc8641d_defconfig
index 1a62baf855e9..1e151594c691 100644
--- a/arch/powerpc/configs/86xx/sbc8641d_defconfig
+++ b/arch/powerpc/configs/86xx/sbc8641d_defconfig
@@ -120,7 +120,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
120# CONFIG_FW_LOADER is not set 120# CONFIG_FW_LOADER is not set
121CONFIG_MTD=y 121CONFIG_MTD=y
122CONFIG_MTD_CONCAT=y 122CONFIG_MTD_CONCAT=y
123CONFIG_MTD_PARTITIONS=y
124CONFIG_MTD_CHAR=y 123CONFIG_MTD_CHAR=y
125CONFIG_MTD_BLOCK=y 124CONFIG_MTD_BLOCK=y
126CONFIG_MTD_CFI=y 125CONFIG_MTD_CFI=y
diff --git a/arch/powerpc/configs/c2k_defconfig b/arch/powerpc/configs/c2k_defconfig
index 671a8f960afa..c69f61620908 100644
--- a/arch/powerpc/configs/c2k_defconfig
+++ b/arch/powerpc/configs/c2k_defconfig
@@ -149,7 +149,6 @@ CONFIG_BT_HCIVHCI=m
149CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 149CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
150CONFIG_MTD=y 150CONFIG_MTD=y
151CONFIG_MTD_CONCAT=m 151CONFIG_MTD_CONCAT=m
152CONFIG_MTD_PARTITIONS=y
153CONFIG_MTD_OF_PARTS=y 152CONFIG_MTD_OF_PARTS=y
154CONFIG_MTD_CHAR=m 153CONFIG_MTD_CHAR=m
155CONFIG_MTD_BLOCK=y 154CONFIG_MTD_BLOCK=y
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig b/arch/powerpc/configs/corenet64_smp_defconfig
index 63508ddee11c..5c7fa19ae4ef 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -26,7 +26,6 @@ CONFIG_CORENET_GENERIC=y
26CONFIG_BINFMT_MISC=m 26CONFIG_BINFMT_MISC=m
27CONFIG_MATH_EMULATION=y 27CONFIG_MATH_EMULATION=y
28CONFIG_MATH_EMULATION_HW_UNIMPLEMENTED=y 28CONFIG_MATH_EMULATION_HW_UNIMPLEMENTED=y
29CONFIG_FSL_IFC=y
30CONFIG_PCIEPORTBUS=y 29CONFIG_PCIEPORTBUS=y
31CONFIG_PCI_MSI=y 30CONFIG_PCI_MSI=y
32CONFIG_RAPIDIO=y 31CONFIG_RAPIDIO=y
@@ -60,7 +59,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
60CONFIG_DEVTMPFS=y 59CONFIG_DEVTMPFS=y
61CONFIG_DEVTMPFS_MOUNT=y 60CONFIG_DEVTMPFS_MOUNT=y
62CONFIG_MTD=y 61CONFIG_MTD=y
63CONFIG_MTD_PARTITIONS=y
64CONFIG_MTD_OF_PARTS=y 62CONFIG_MTD_OF_PARTS=y
65CONFIG_MTD_CMDLINE_PARTS=y 63CONFIG_MTD_CMDLINE_PARTS=y
66CONFIG_MTD_CHAR=y 64CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/linkstation_defconfig b/arch/powerpc/configs/linkstation_defconfig
index 8a874b999867..353435256f4c 100644
--- a/arch/powerpc/configs/linkstation_defconfig
+++ b/arch/powerpc/configs/linkstation_defconfig
@@ -59,7 +59,6 @@ CONFIG_IP_NF_ARP_MANGLE=m
59CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 59CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
60CONFIG_MTD=y 60CONFIG_MTD=y
61CONFIG_MTD_CONCAT=y 61CONFIG_MTD_CONCAT=y
62CONFIG_MTD_PARTITIONS=y
63CONFIG_MTD_CMDLINE_PARTS=y 62CONFIG_MTD_CMDLINE_PARTS=y
64CONFIG_MTD_OF_PARTS=y 63CONFIG_MTD_OF_PARTS=y
65CONFIG_MTD_CHAR=y 64CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/mpc85xx_defconfig b/arch/powerpc/configs/mpc85xx_defconfig
index 83d3550fdb54..19f0fbe5ba4b 100644
--- a/arch/powerpc/configs/mpc85xx_defconfig
+++ b/arch/powerpc/configs/mpc85xx_defconfig
@@ -49,7 +49,6 @@ CONFIG_HIGHMEM=y
49CONFIG_BINFMT_MISC=m 49CONFIG_BINFMT_MISC=m
50CONFIG_MATH_EMULATION=y 50CONFIG_MATH_EMULATION=y
51CONFIG_FORCE_MAX_ZONEORDER=12 51CONFIG_FORCE_MAX_ZONEORDER=12
52CONFIG_FSL_IFC=y
53CONFIG_PCI=y 52CONFIG_PCI=y
54CONFIG_PCI_MSI=y 53CONFIG_PCI_MSI=y
55CONFIG_RAPIDIO=y 54CONFIG_RAPIDIO=y
@@ -82,7 +81,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
82CONFIG_DEVTMPFS=y 81CONFIG_DEVTMPFS=y
83CONFIG_DEVTMPFS_MOUNT=y 82CONFIG_DEVTMPFS_MOUNT=y
84CONFIG_MTD=y 83CONFIG_MTD=y
85CONFIG_MTD_PARTITIONS=y
86CONFIG_MTD_OF_PARTS=y 84CONFIG_MTD_OF_PARTS=y
87CONFIG_MTD_CMDLINE_PARTS=y 85CONFIG_MTD_CMDLINE_PARTS=y
88CONFIG_MTD_CHAR=y 86CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/mpc85xx_smp_defconfig b/arch/powerpc/configs/mpc85xx_smp_defconfig
index 4b686294feb4..062312e1fe1a 100644
--- a/arch/powerpc/configs/mpc85xx_smp_defconfig
+++ b/arch/powerpc/configs/mpc85xx_smp_defconfig
@@ -52,7 +52,6 @@ CONFIG_HIGHMEM=y
52CONFIG_BINFMT_MISC=m 52CONFIG_BINFMT_MISC=m
53CONFIG_MATH_EMULATION=y 53CONFIG_MATH_EMULATION=y
54CONFIG_FORCE_MAX_ZONEORDER=12 54CONFIG_FORCE_MAX_ZONEORDER=12
55CONFIG_FSL_IFC=y
56CONFIG_PCI=y 55CONFIG_PCI=y
57CONFIG_PCI_MSI=y 56CONFIG_PCI_MSI=y
58CONFIG_RAPIDIO=y 57CONFIG_RAPIDIO=y
@@ -85,7 +84,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
85CONFIG_DEVTMPFS=y 84CONFIG_DEVTMPFS=y
86CONFIG_DEVTMPFS_MOUNT=y 85CONFIG_DEVTMPFS_MOUNT=y
87CONFIG_MTD=y 86CONFIG_MTD=y
88CONFIG_MTD_PARTITIONS=y
89CONFIG_MTD_OF_PARTS=y 87CONFIG_MTD_OF_PARTS=y
90CONFIG_MTD_CMDLINE_PARTS=y 88CONFIG_MTD_CMDLINE_PARTS=y
91CONFIG_MTD_CHAR=y 89CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/ppc40x_defconfig b/arch/powerpc/configs/ppc40x_defconfig
index 1eb19ac45d09..52908c7897d9 100644
--- a/arch/powerpc/configs/ppc40x_defconfig
+++ b/arch/powerpc/configs/ppc40x_defconfig
@@ -33,7 +33,6 @@ CONFIG_IP_PNP_BOOTP=y
33CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 33CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
34CONFIG_CONNECTOR=y 34CONFIG_CONNECTOR=y
35CONFIG_MTD=y 35CONFIG_MTD=y
36CONFIG_MTD_PARTITIONS=y
37CONFIG_MTD_CMDLINE_PARTS=y 36CONFIG_MTD_CMDLINE_PARTS=y
38CONFIG_MTD_OF_PARTS=y 37CONFIG_MTD_OF_PARTS=y
39CONFIG_MTD_CHAR=y 38CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/ppc44x_defconfig b/arch/powerpc/configs/ppc44x_defconfig
index 3b98d7354341..ccf66b9060a6 100644
--- a/arch/powerpc/configs/ppc44x_defconfig
+++ b/arch/powerpc/configs/ppc44x_defconfig
@@ -44,7 +44,6 @@ CONFIG_BRIDGE=m
44CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 44CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
45CONFIG_CONNECTOR=y 45CONFIG_CONNECTOR=y
46CONFIG_MTD=y 46CONFIG_MTD=y
47CONFIG_MTD_PARTITIONS=y
48CONFIG_MTD_OF_PARTS=y 47CONFIG_MTD_OF_PARTS=y
49CONFIG_MTD_CHAR=y 48CONFIG_MTD_CHAR=y
50CONFIG_MTD_BLOCK=y 49CONFIG_MTD_BLOCK=y
diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig
index e015896b7e5c..f26b267eb71f 100644
--- a/arch/powerpc/configs/ppc64_defconfig
+++ b/arch/powerpc/configs/ppc64_defconfig
@@ -73,74 +73,8 @@ CONFIG_INET_ESP=m
73CONFIG_INET_IPCOMP=m 73CONFIG_INET_IPCOMP=m
74# CONFIG_IPV6 is not set 74# CONFIG_IPV6 is not set
75CONFIG_NETFILTER=y 75CONFIG_NETFILTER=y
76CONFIG_NF_CONNTRACK=m 76# CONFIG_NETFILTER_ADVANCED is not set
77CONFIG_NF_CONNTRACK_EVENTS=y 77CONFIG_BRIDGE=m
78CONFIG_NF_CT_PROTO_SCTP=m
79CONFIG_NF_CONNTRACK_AMANDA=m
80CONFIG_NF_CONNTRACK_FTP=m
81CONFIG_NF_CONNTRACK_H323=m
82CONFIG_NF_CONNTRACK_IRC=m
83CONFIG_NF_CONNTRACK_NETBIOS_NS=m
84CONFIG_NF_CONNTRACK_PPTP=m
85CONFIG_NF_CONNTRACK_SIP=m
86CONFIG_NF_CONNTRACK_TFTP=m
87CONFIG_NF_CT_NETLINK=m
88CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
89CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
90CONFIG_NETFILTER_XT_TARGET_DSCP=m
91CONFIG_NETFILTER_XT_TARGET_MARK=m
92CONFIG_NETFILTER_XT_TARGET_NFLOG=m
93CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
94CONFIG_NETFILTER_XT_TARGET_TPROXY=m
95CONFIG_NETFILTER_XT_TARGET_TRACE=m
96CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
97CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m
98CONFIG_NETFILTER_XT_MATCH_COMMENT=m
99CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
100CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
101CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
102CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
103CONFIG_NETFILTER_XT_MATCH_DCCP=m
104CONFIG_NETFILTER_XT_MATCH_DSCP=m
105CONFIG_NETFILTER_XT_MATCH_ESP=m
106CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
107CONFIG_NETFILTER_XT_MATCH_HELPER=m
108CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
109CONFIG_NETFILTER_XT_MATCH_LENGTH=m
110CONFIG_NETFILTER_XT_MATCH_LIMIT=m
111CONFIG_NETFILTER_XT_MATCH_MAC=m
112CONFIG_NETFILTER_XT_MATCH_MARK=m
113CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
114CONFIG_NETFILTER_XT_MATCH_OWNER=m
115CONFIG_NETFILTER_XT_MATCH_POLICY=m
116CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
117CONFIG_NETFILTER_XT_MATCH_QUOTA=m
118CONFIG_NETFILTER_XT_MATCH_RATEEST=m
119CONFIG_NETFILTER_XT_MATCH_REALM=m
120CONFIG_NETFILTER_XT_MATCH_RECENT=m
121CONFIG_NETFILTER_XT_MATCH_SCTP=m
122CONFIG_NETFILTER_XT_MATCH_SOCKET=m
123CONFIG_NETFILTER_XT_MATCH_STATE=m
124CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
125CONFIG_NETFILTER_XT_MATCH_STRING=m
126CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
127CONFIG_NETFILTER_XT_MATCH_U32=m
128CONFIG_NF_CONNTRACK_IPV4=m
129CONFIG_IP_NF_IPTABLES=m
130CONFIG_IP_NF_MATCH_AH=m
131CONFIG_IP_NF_MATCH_ECN=m
132CONFIG_IP_NF_MATCH_TTL=m
133CONFIG_IP_NF_FILTER=m
134CONFIG_IP_NF_TARGET_REJECT=m
135CONFIG_IP_NF_TARGET_ULOG=m
136CONFIG_IP_NF_MANGLE=m
137CONFIG_IP_NF_TARGET_CLUSTERIP=m
138CONFIG_IP_NF_TARGET_ECN=m
139CONFIG_IP_NF_TARGET_TTL=m
140CONFIG_IP_NF_RAW=m
141CONFIG_IP_NF_ARPTABLES=m
142CONFIG_IP_NF_ARPFILTER=m
143CONFIG_IP_NF_ARP_MANGLE=m
144CONFIG_BPF_JIT=y 78CONFIG_BPF_JIT=y
145CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 79CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
146CONFIG_DEVTMPFS=y 80CONFIG_DEVTMPFS=y
diff --git a/arch/powerpc/configs/ppc64e_defconfig b/arch/powerpc/configs/ppc64e_defconfig
index f627fda08953..438e813dc9cb 100644
--- a/arch/powerpc/configs/ppc64e_defconfig
+++ b/arch/powerpc/configs/ppc64e_defconfig
@@ -48,74 +48,8 @@ CONFIG_INET_ESP=m
48CONFIG_INET_IPCOMP=m 48CONFIG_INET_IPCOMP=m
49# CONFIG_IPV6 is not set 49# CONFIG_IPV6 is not set
50CONFIG_NETFILTER=y 50CONFIG_NETFILTER=y
51CONFIG_NF_CONNTRACK=m 51# CONFIG_NETFILTER_ADVANCED is not set
52CONFIG_NF_CONNTRACK_EVENTS=y 52CONFIG_BRIDGE=m
53CONFIG_NF_CT_PROTO_SCTP=m
54CONFIG_NF_CONNTRACK_AMANDA=m
55CONFIG_NF_CONNTRACK_FTP=m
56CONFIG_NF_CONNTRACK_H323=m
57CONFIG_NF_CONNTRACK_IRC=m
58CONFIG_NF_CONNTRACK_NETBIOS_NS=m
59CONFIG_NF_CONNTRACK_PPTP=m
60CONFIG_NF_CONNTRACK_SIP=m
61CONFIG_NF_CONNTRACK_TFTP=m
62CONFIG_NF_CT_NETLINK=m
63CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
64CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
65CONFIG_NETFILTER_XT_TARGET_DSCP=m
66CONFIG_NETFILTER_XT_TARGET_MARK=m
67CONFIG_NETFILTER_XT_TARGET_NFLOG=m
68CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
69CONFIG_NETFILTER_XT_TARGET_TPROXY=m
70CONFIG_NETFILTER_XT_TARGET_TRACE=m
71CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
72CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m
73CONFIG_NETFILTER_XT_MATCH_COMMENT=m
74CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
75CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
76CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
77CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
78CONFIG_NETFILTER_XT_MATCH_DCCP=m
79CONFIG_NETFILTER_XT_MATCH_DSCP=m
80CONFIG_NETFILTER_XT_MATCH_ESP=m
81CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
82CONFIG_NETFILTER_XT_MATCH_HELPER=m
83CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
84CONFIG_NETFILTER_XT_MATCH_LENGTH=m
85CONFIG_NETFILTER_XT_MATCH_LIMIT=m
86CONFIG_NETFILTER_XT_MATCH_MAC=m
87CONFIG_NETFILTER_XT_MATCH_MARK=m
88CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
89CONFIG_NETFILTER_XT_MATCH_OWNER=m
90CONFIG_NETFILTER_XT_MATCH_POLICY=m
91CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
92CONFIG_NETFILTER_XT_MATCH_QUOTA=m
93CONFIG_NETFILTER_XT_MATCH_RATEEST=m
94CONFIG_NETFILTER_XT_MATCH_REALM=m
95CONFIG_NETFILTER_XT_MATCH_RECENT=m
96CONFIG_NETFILTER_XT_MATCH_SCTP=m
97CONFIG_NETFILTER_XT_MATCH_SOCKET=m
98CONFIG_NETFILTER_XT_MATCH_STATE=m
99CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
100CONFIG_NETFILTER_XT_MATCH_STRING=m
101CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
102CONFIG_NETFILTER_XT_MATCH_U32=m
103CONFIG_NF_CONNTRACK_IPV4=m
104CONFIG_IP_NF_IPTABLES=m
105CONFIG_IP_NF_MATCH_AH=m
106CONFIG_IP_NF_MATCH_ECN=m
107CONFIG_IP_NF_MATCH_TTL=m
108CONFIG_IP_NF_FILTER=m
109CONFIG_IP_NF_TARGET_REJECT=m
110CONFIG_IP_NF_TARGET_ULOG=m
111CONFIG_IP_NF_MANGLE=m
112CONFIG_IP_NF_TARGET_CLUSTERIP=m
113CONFIG_IP_NF_TARGET_ECN=m
114CONFIG_IP_NF_TARGET_TTL=m
115CONFIG_IP_NF_RAW=m
116CONFIG_IP_NF_ARPTABLES=m
117CONFIG_IP_NF_ARPFILTER=m
118CONFIG_IP_NF_ARP_MANGLE=m
119CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 53CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
120CONFIG_DEVTMPFS=y 54CONFIG_DEVTMPFS=y
121CONFIG_DEVTMPFS_MOUNT=y 55CONFIG_DEVTMPFS_MOUNT=y
diff --git a/arch/powerpc/configs/ppc6xx_defconfig b/arch/powerpc/configs/ppc6xx_defconfig
index c2353bf059fd..175a8b99c196 100644
--- a/arch/powerpc/configs/ppc6xx_defconfig
+++ b/arch/powerpc/configs/ppc6xx_defconfig
@@ -1244,7 +1244,6 @@ CONFIG_DEBUG_SPINLOCK_SLEEP=y
1244CONFIG_DEBUG_HIGHMEM=y 1244CONFIG_DEBUG_HIGHMEM=y
1245CONFIG_DEBUG_INFO=y 1245CONFIG_DEBUG_INFO=y
1246CONFIG_DEBUG_VM=y 1246CONFIG_DEBUG_VM=y
1247CONFIG_DEBUG_WRITECOUNT=y
1248CONFIG_DEBUG_LIST=y 1247CONFIG_DEBUG_LIST=y
1249CONFIG_DEBUG_SG=y 1248CONFIG_DEBUG_SG=y
1250# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1249# CONFIG_RCU_CPU_STALL_DETECTOR is not set
diff --git a/arch/powerpc/configs/prpmc2800_defconfig b/arch/powerpc/configs/prpmc2800_defconfig
deleted file mode 100644
index cd80fb615d34..000000000000
--- a/arch/powerpc/configs/prpmc2800_defconfig
+++ /dev/null
@@ -1,108 +0,0 @@
1CONFIG_ALTIVEC=y
2CONFIG_EXPERIMENTAL=y
3CONFIG_SYSVIPC=y
4CONFIG_POSIX_MQUEUE=y
5CONFIG_LOG_BUF_SHIFT=14
6CONFIG_BLK_DEV_INITRD=y
7# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
8# CONFIG_BLK_DEV_BSG is not set
9# CONFIG_IOSCHED_DEADLINE is not set
10# CONFIG_IOSCHED_CFQ is not set
11# CONFIG_PPC_CHRP is not set
12# CONFIG_PPC_PMAC is not set
13CONFIG_EMBEDDED6xx=y
14CONFIG_PPC_PRPMC2800=y
15CONFIG_HIGHMEM=y
16CONFIG_NO_HZ=y
17CONFIG_HIGH_RES_TIMERS=y
18CONFIG_BINFMT_MISC=y
19CONFIG_SPARSE_IRQ=y
20# CONFIG_SECCOMP is not set
21CONFIG_NET=y
22CONFIG_PACKET=y
23CONFIG_UNIX=y
24CONFIG_XFRM_USER=y
25CONFIG_INET=y
26CONFIG_IP_MULTICAST=y
27CONFIG_IP_PNP=y
28CONFIG_IP_PNP_DHCP=y
29CONFIG_IP_PNP_BOOTP=y
30CONFIG_SYN_COOKIES=y
31# CONFIG_IPV6 is not set
32CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
33CONFIG_MTD=y
34CONFIG_MTD_CONCAT=y
35CONFIG_MTD_PARTITIONS=y
36CONFIG_MTD_CHAR=y
37CONFIG_MTD_BLOCK=y
38CONFIG_MTD_CFI=y
39CONFIG_MTD_JEDECPROBE=y
40CONFIG_MTD_CFI_INTELEXT=y
41CONFIG_MTD_PHYSMAP_OF=y
42CONFIG_PROC_DEVICETREE=y
43CONFIG_BLK_DEV_LOOP=y
44CONFIG_BLK_DEV_RAM=y
45CONFIG_BLK_DEV_RAM_SIZE=131072
46CONFIG_IDE=y
47CONFIG_BLK_DEV_GENERIC=y
48CONFIG_BLK_DEV_PDC202XX_NEW=y
49CONFIG_BLK_DEV_SD=y
50CONFIG_ATA=y
51CONFIG_SATA_MV=y
52CONFIG_MACINTOSH_DRIVERS=y
53CONFIG_NETDEVICES=y
54CONFIG_NET_ETHERNET=y
55CONFIG_NET_PCI=y
56CONFIG_E100=y
57CONFIG_8139TOO=y
58# CONFIG_8139TOO_PIO is not set
59CONFIG_E1000=y
60CONFIG_MV643XX_ETH=y
61# CONFIG_INPUT_KEYBOARD is not set
62# CONFIG_INPUT_MOUSE is not set
63# CONFIG_SERIO is not set
64CONFIG_SERIAL_MPSC=y
65CONFIG_SERIAL_MPSC_CONSOLE=y
66# CONFIG_HW_RANDOM is not set
67CONFIG_I2C=y
68CONFIG_I2C_CHARDEV=y
69CONFIG_I2C_MV64XXX=y
70CONFIG_VIDEO_OUTPUT_CONTROL=y
71CONFIG_HID_DRAGONRISE=y
72CONFIG_HID_GYRATION=y
73CONFIG_HID_TWINHAN=y
74CONFIG_HID_NTRIG=y
75CONFIG_HID_ORTEK=y
76CONFIG_HID_PANTHERLORD=y
77CONFIG_HID_PETALYNX=y
78CONFIG_HID_SAMSUNG=y
79CONFIG_HID_SONY=y
80CONFIG_HID_SUNPLUS=y
81CONFIG_HID_GREENASIA=y
82CONFIG_HID_SMARTJOYPLUS=y
83CONFIG_HID_TOPSEED=y
84CONFIG_HID_THRUSTMASTER=y
85CONFIG_THRUSTMASTER_FF=y
86CONFIG_HID_ZEROPLUS=y
87CONFIG_ZEROPLUS_FF=y
88CONFIG_USB=y
89CONFIG_USB_DEVICEFS=y
90# CONFIG_USB_DEVICE_CLASS is not set
91CONFIG_USB_MON=y
92CONFIG_USB_EHCI_HCD=y
93CONFIG_USB_OHCI_HCD=y
94CONFIG_RTC_CLASS=y
95CONFIG_RTC_DRV_MAX6900=y
96CONFIG_EXT2_FS=y
97CONFIG_EXT3_FS=y
98# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
99CONFIG_INOTIFY=y
100CONFIG_PROC_KCORE=y
101CONFIG_TMPFS=y
102CONFIG_NFS_FS=y
103CONFIG_ROOT_NFS=y
104CONFIG_PARTITION_ADVANCED=y
105CONFIG_CRC_T10DIF=y
106# CONFIG_RCU_CPU_STALL_DETECTOR is not set
107CONFIG_SYSCTL_SYSCALL_CHECK=y
108# CONFIG_CRYPTO_ANSI_CPRNG is not set
diff --git a/arch/powerpc/configs/ps3_defconfig b/arch/powerpc/configs/ps3_defconfig
index 139a8308070c..fdee37fab81c 100644
--- a/arch/powerpc/configs/ps3_defconfig
+++ b/arch/powerpc/configs/ps3_defconfig
@@ -174,7 +174,6 @@ CONFIG_DETECT_HUNG_TASK=y
174CONFIG_PROVE_LOCKING=y 174CONFIG_PROVE_LOCKING=y
175CONFIG_DEBUG_LOCKDEP=y 175CONFIG_DEBUG_LOCKDEP=y
176CONFIG_DEBUG_INFO=y 176CONFIG_DEBUG_INFO=y
177CONFIG_DEBUG_WRITECOUNT=y
178CONFIG_DEBUG_MEMORY_INIT=y 177CONFIG_DEBUG_MEMORY_INIT=y
179CONFIG_DEBUG_LIST=y 178CONFIG_DEBUG_LIST=y
180CONFIG_RCU_CPU_STALL_TIMEOUT=60 179CONFIG_RCU_CPU_STALL_TIMEOUT=60
diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig
index e9a8b4e0a0f6..a905063281cc 100644
--- a/arch/powerpc/configs/pseries_defconfig
+++ b/arch/powerpc/configs/pseries_defconfig
@@ -65,57 +65,8 @@ CONFIG_INET_ESP=m
65CONFIG_INET_IPCOMP=m 65CONFIG_INET_IPCOMP=m
66# CONFIG_IPV6 is not set 66# CONFIG_IPV6 is not set
67CONFIG_NETFILTER=y 67CONFIG_NETFILTER=y
68CONFIG_NF_CONNTRACK=m 68# CONFIG_NETFILTER_ADVANCED is not set
69CONFIG_NF_CONNTRACK_EVENTS=y 69CONFIG_BRIDGE=m
70CONFIG_NF_CT_PROTO_UDPLITE=m
71CONFIG_NF_CONNTRACK_FTP=m
72CONFIG_NF_CONNTRACK_IRC=m
73CONFIG_NF_CONNTRACK_TFTP=m
74CONFIG_NF_CT_NETLINK=m
75CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
76CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
77CONFIG_NETFILTER_XT_TARGET_MARK=m
78CONFIG_NETFILTER_XT_TARGET_NFLOG=m
79CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
80CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
81CONFIG_NETFILTER_XT_MATCH_COMMENT=m
82CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
83CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
84CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
85CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
86CONFIG_NETFILTER_XT_MATCH_DCCP=m
87CONFIG_NETFILTER_XT_MATCH_DSCP=m
88CONFIG_NETFILTER_XT_MATCH_ESP=m
89CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
90CONFIG_NETFILTER_XT_MATCH_HELPER=m
91CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
92CONFIG_NETFILTER_XT_MATCH_LENGTH=m
93CONFIG_NETFILTER_XT_MATCH_LIMIT=m
94CONFIG_NETFILTER_XT_MATCH_MAC=m
95CONFIG_NETFILTER_XT_MATCH_MARK=m
96CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
97CONFIG_NETFILTER_XT_MATCH_OWNER=m
98CONFIG_NETFILTER_XT_MATCH_POLICY=m
99CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
100CONFIG_NETFILTER_XT_MATCH_QUOTA=m
101CONFIG_NETFILTER_XT_MATCH_RATEEST=m
102CONFIG_NETFILTER_XT_MATCH_REALM=m
103CONFIG_NETFILTER_XT_MATCH_RECENT=m
104CONFIG_NETFILTER_XT_MATCH_SCTP=m
105CONFIG_NETFILTER_XT_MATCH_STATE=m
106CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
107CONFIG_NETFILTER_XT_MATCH_STRING=m
108CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
109CONFIG_NETFILTER_XT_MATCH_TIME=m
110CONFIG_NETFILTER_XT_MATCH_U32=m
111CONFIG_NF_CONNTRACK_IPV4=m
112CONFIG_IP_NF_IPTABLES=m
113CONFIG_IP_NF_MATCH_AH=m
114CONFIG_IP_NF_MATCH_ECN=m
115CONFIG_IP_NF_MATCH_TTL=m
116CONFIG_IP_NF_FILTER=m
117CONFIG_IP_NF_TARGET_REJECT=m
118CONFIG_IP_NF_TARGET_ULOG=m
119CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 70CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
120CONFIG_DEVTMPFS=y 71CONFIG_DEVTMPFS=y
121CONFIG_DEVTMPFS_MOUNT=y 72CONFIG_DEVTMPFS_MOUNT=y
@@ -353,3 +304,6 @@ CONFIG_CRYPTO_DEV_NX_ENCRYPT=m
353CONFIG_VIRTUALIZATION=y 304CONFIG_VIRTUALIZATION=y
354CONFIG_KVM_BOOK3S_64=m 305CONFIG_KVM_BOOK3S_64=m
355CONFIG_KVM_BOOK3S_64_HV=y 306CONFIG_KVM_BOOK3S_64_HV=y
307CONFIG_TRANSPARENT_HUGEPAGE=y
308CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
309CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
diff --git a/arch/powerpc/configs/pseries_le_defconfig b/arch/powerpc/configs/pseries_le_defconfig
index 62771e0adb7c..58e3dbf43ca4 100644
--- a/arch/powerpc/configs/pseries_le_defconfig
+++ b/arch/powerpc/configs/pseries_le_defconfig
@@ -67,57 +67,8 @@ CONFIG_INET_ESP=m
67CONFIG_INET_IPCOMP=m 67CONFIG_INET_IPCOMP=m
68# CONFIG_IPV6 is not set 68# CONFIG_IPV6 is not set
69CONFIG_NETFILTER=y 69CONFIG_NETFILTER=y
70CONFIG_NF_CONNTRACK=m 70# CONFIG_NETFILTER_ADVANCED is not set
71CONFIG_NF_CONNTRACK_EVENTS=y 71CONFIG_BRIDGE=m
72CONFIG_NF_CT_PROTO_UDPLITE=m
73CONFIG_NF_CONNTRACK_FTP=m
74CONFIG_NF_CONNTRACK_IRC=m
75CONFIG_NF_CONNTRACK_TFTP=m
76CONFIG_NF_CT_NETLINK=m
77CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
78CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
79CONFIG_NETFILTER_XT_TARGET_MARK=m
80CONFIG_NETFILTER_XT_TARGET_NFLOG=m
81CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
82CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
83CONFIG_NETFILTER_XT_MATCH_COMMENT=m
84CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
85CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
86CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
87CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
88CONFIG_NETFILTER_XT_MATCH_DCCP=m
89CONFIG_NETFILTER_XT_MATCH_DSCP=m
90CONFIG_NETFILTER_XT_MATCH_ESP=m
91CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
92CONFIG_NETFILTER_XT_MATCH_HELPER=m
93CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
94CONFIG_NETFILTER_XT_MATCH_LENGTH=m
95CONFIG_NETFILTER_XT_MATCH_LIMIT=m
96CONFIG_NETFILTER_XT_MATCH_MAC=m
97CONFIG_NETFILTER_XT_MATCH_MARK=m
98CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
99CONFIG_NETFILTER_XT_MATCH_OWNER=m
100CONFIG_NETFILTER_XT_MATCH_POLICY=m
101CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
102CONFIG_NETFILTER_XT_MATCH_QUOTA=m
103CONFIG_NETFILTER_XT_MATCH_RATEEST=m
104CONFIG_NETFILTER_XT_MATCH_REALM=m
105CONFIG_NETFILTER_XT_MATCH_RECENT=m
106CONFIG_NETFILTER_XT_MATCH_SCTP=m
107CONFIG_NETFILTER_XT_MATCH_STATE=m
108CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
109CONFIG_NETFILTER_XT_MATCH_STRING=m
110CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
111CONFIG_NETFILTER_XT_MATCH_TIME=m
112CONFIG_NETFILTER_XT_MATCH_U32=m
113CONFIG_NF_CONNTRACK_IPV4=m
114CONFIG_IP_NF_IPTABLES=m
115CONFIG_IP_NF_MATCH_AH=m
116CONFIG_IP_NF_MATCH_ECN=m
117CONFIG_IP_NF_MATCH_TTL=m
118CONFIG_IP_NF_FILTER=m
119CONFIG_IP_NF_TARGET_REJECT=m
120CONFIG_IP_NF_TARGET_ULOG=m
121CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 72CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
122CONFIG_DEVTMPFS=y 73CONFIG_DEVTMPFS=y
123CONFIG_DEVTMPFS_MOUNT=y 74CONFIG_DEVTMPFS_MOUNT=y
@@ -350,3 +301,4 @@ CONFIG_CRYPTO_LZO=m
350# CONFIG_CRYPTO_ANSI_CPRNG is not set 301# CONFIG_CRYPTO_ANSI_CPRNG is not set
351CONFIG_CRYPTO_DEV_NX=y 302CONFIG_CRYPTO_DEV_NX=y
352CONFIG_CRYPTO_DEV_NX_ENCRYPT=m 303CONFIG_CRYPTO_DEV_NX_ENCRYPT=m
304CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
diff --git a/arch/powerpc/configs/storcenter_defconfig b/arch/powerpc/configs/storcenter_defconfig
index ebb2a66c99d3..ba39c785445d 100644
--- a/arch/powerpc/configs/storcenter_defconfig
+++ b/arch/powerpc/configs/storcenter_defconfig
@@ -31,7 +31,6 @@ CONFIG_IP_PNP_DHCP=y
31CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 31CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
32# CONFIG_FW_LOADER is not set 32# CONFIG_FW_LOADER is not set
33CONFIG_MTD=y 33CONFIG_MTD=y
34CONFIG_MTD_PARTITIONS=y
35CONFIG_MTD_CMDLINE_PARTS=y 34CONFIG_MTD_CMDLINE_PARTS=y
36CONFIG_MTD_OF_PARTS=y 35CONFIG_MTD_OF_PARTS=y
37CONFIG_MTD_CHAR=y 36CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/configs/tqm8xx_defconfig b/arch/powerpc/configs/tqm8xx_defconfig
index 4b6f8bf104e0..7fe277a7b422 100644
--- a/arch/powerpc/configs/tqm8xx_defconfig
+++ b/arch/powerpc/configs/tqm8xx_defconfig
@@ -41,7 +41,6 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
41# CONFIG_FW_LOADER is not set 41# CONFIG_FW_LOADER is not set
42CONFIG_MTD=y 42CONFIG_MTD=y
43CONFIG_MTD_CONCAT=y 43CONFIG_MTD_CONCAT=y
44CONFIG_MTD_PARTITIONS=y
45CONFIG_MTD_CMDLINE_PARTS=y 44CONFIG_MTD_CMDLINE_PARTS=y
46CONFIG_MTD_OF_PARTS=y 45CONFIG_MTD_OF_PARTS=y
47CONFIG_MTD_CHAR=y 46CONFIG_MTD_CHAR=y
diff --git a/arch/powerpc/include/asm/archrandom.h b/arch/powerpc/include/asm/archrandom.h
index d853d163ba47..bde531103638 100644
--- a/arch/powerpc/include/asm/archrandom.h
+++ b/arch/powerpc/include/asm/archrandom.h
@@ -25,8 +25,26 @@ static inline int arch_get_random_int(unsigned int *v)
25 return rc; 25 return rc;
26} 26}
27 27
28static inline int arch_has_random(void)
29{
30 return !!ppc_md.get_random_long;
31}
32
28int powernv_get_random_long(unsigned long *v); 33int powernv_get_random_long(unsigned long *v);
29 34
35static inline int arch_get_random_seed_long(unsigned long *v)
36{
37 return 0;
38}
39static inline int arch_get_random_seed_int(unsigned int *v)
40{
41 return 0;
42}
43static inline int arch_has_random_seed(void)
44{
45 return 0;
46}
47
30#endif /* CONFIG_ARCH_RANDOM */ 48#endif /* CONFIG_ARCH_RANDOM */
31 49
32#endif /* _ASM_POWERPC_ARCHRANDOM_H */ 50#endif /* _ASM_POWERPC_ARCHRANDOM_H */
diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h
index a613d2c82fd9..b142b8e0ed9e 100644
--- a/arch/powerpc/include/asm/compat.h
+++ b/arch/powerpc/include/asm/compat.h
@@ -8,7 +8,11 @@
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#ifdef __BIG_ENDIAN__
11#define COMPAT_UTS_MACHINE "ppc\0\0" 12#define COMPAT_UTS_MACHINE "ppc\0\0"
13#else
14#define COMPAT_UTS_MACHINE "ppcle\0\0"
15#endif
12 16
13typedef u32 compat_size_t; 17typedef u32 compat_size_t;
14typedef s32 compat_ssize_t; 18typedef s32 compat_ssize_t;
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index 617cc767c076..bc2347774f0a 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -189,6 +189,7 @@ extern const char *powerpc_base_platform;
189#define CPU_FTR_HAS_PPR LONG_ASM_CONST(0x0200000000000000) 189#define CPU_FTR_HAS_PPR LONG_ASM_CONST(0x0200000000000000)
190#define CPU_FTR_DAWR LONG_ASM_CONST(0x0400000000000000) 190#define CPU_FTR_DAWR LONG_ASM_CONST(0x0400000000000000)
191#define CPU_FTR_DABRX LONG_ASM_CONST(0x0800000000000000) 191#define CPU_FTR_DABRX LONG_ASM_CONST(0x0800000000000000)
192#define CPU_FTR_PMAO_BUG LONG_ASM_CONST(0x1000000000000000)
192 193
193#ifndef __ASSEMBLY__ 194#ifndef __ASSEMBLY__
194 195
@@ -445,6 +446,7 @@ extern const char *powerpc_base_platform;
445 CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY | \ 446 CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY | \
446 CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_DAWR | \ 447 CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_DAWR | \
447 CPU_FTR_ARCH_207S | CPU_FTR_TM_COMP) 448 CPU_FTR_ARCH_207S | CPU_FTR_TM_COMP)
449#define CPU_FTRS_POWER8E (CPU_FTRS_POWER8 | CPU_FTR_PMAO_BUG)
448#define CPU_FTRS_CELL (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ 450#define CPU_FTRS_CELL (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
449 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 451 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
450 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ 452 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
@@ -466,8 +468,8 @@ extern const char *powerpc_base_platform;
466#define CPU_FTRS_POSSIBLE \ 468#define CPU_FTRS_POSSIBLE \
467 (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \ 469 (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \
468 CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 | \ 470 CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 | \
469 CPU_FTRS_POWER7 | CPU_FTRS_POWER8 | CPU_FTRS_CELL | \ 471 CPU_FTRS_POWER7 | CPU_FTRS_POWER8E | CPU_FTRS_POWER8 | \
470 CPU_FTRS_PA6T | CPU_FTR_VSX) 472 CPU_FTRS_CELL | CPU_FTRS_PA6T | CPU_FTR_VSX)
471#endif 473#endif
472#else 474#else
473enum { 475enum {
diff --git a/arch/powerpc/include/asm/emulated_ops.h b/arch/powerpc/include/asm/emulated_ops.h
index 4358e3002f35..f00e10e2a335 100644
--- a/arch/powerpc/include/asm/emulated_ops.h
+++ b/arch/powerpc/include/asm/emulated_ops.h
@@ -54,6 +54,7 @@ extern struct ppc_emulated {
54#ifdef CONFIG_PPC64 54#ifdef CONFIG_PPC64
55 struct ppc_emulated_entry mfdscr; 55 struct ppc_emulated_entry mfdscr;
56 struct ppc_emulated_entry mtdscr; 56 struct ppc_emulated_entry mtdscr;
57 struct ppc_emulated_entry lq_stq;
57#endif 58#endif
58} ppc_emulated; 59} ppc_emulated;
59 60
diff --git a/arch/powerpc/include/asm/exception-64e.h b/arch/powerpc/include/asm/exception-64e.h
index 51fa43e536b9..a563d9afd179 100644
--- a/arch/powerpc/include/asm/exception-64e.h
+++ b/arch/powerpc/include/asm/exception-64e.h
@@ -46,9 +46,8 @@
46#define EX_CR (1 * 8) 46#define EX_CR (1 * 8)
47#define EX_R10 (2 * 8) 47#define EX_R10 (2 * 8)
48#define EX_R11 (3 * 8) 48#define EX_R11 (3 * 8)
49#define EX_R13 (4 * 8) 49#define EX_R14 (4 * 8)
50#define EX_R14 (5 * 8) 50#define EX_R15 (5 * 8)
51#define EX_R15 (6 * 8)
52 51
53/* 52/*
54 * The TLB miss exception uses different slots. 53 * The TLB miss exception uses different slots.
@@ -173,16 +172,6 @@ exc_##label##_book3e:
173 ld r9,EX_TLB_R9(r12); \ 172 ld r9,EX_TLB_R9(r12); \
174 ld r8,EX_TLB_R8(r12); \ 173 ld r8,EX_TLB_R8(r12); \
175 mtlr r16; 174 mtlr r16;
176#define TLB_MISS_PROLOG_STATS_BOLTED \
177 mflr r10; \
178 std r8,PACA_EXTLB+EX_TLB_R8(r13); \
179 std r9,PACA_EXTLB+EX_TLB_R9(r13); \
180 std r10,PACA_EXTLB+EX_TLB_LR(r13);
181#define TLB_MISS_RESTORE_STATS_BOLTED \
182 ld r16,PACA_EXTLB+EX_TLB_LR(r13); \
183 ld r9,PACA_EXTLB+EX_TLB_R9(r13); \
184 ld r8,PACA_EXTLB+EX_TLB_R8(r13); \
185 mtlr r16;
186#define TLB_MISS_STATS_D(name) \ 175#define TLB_MISS_STATS_D(name) \
187 addi r9,r13,MMSTAT_DSTATS+name; \ 176 addi r9,r13,MMSTAT_DSTATS+name; \
188 bl .tlb_stat_inc; 177 bl .tlb_stat_inc;
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index 66830618cc19..aeaa56cd9b54 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -147,6 +147,14 @@ BEGIN_FTR_SECTION_NESTED(943) \
147END_FTR_SECTION_NESTED(ftr,ftr,943) 147END_FTR_SECTION_NESTED(ftr,ftr,943)
148 148
149/* 149/*
150 * Set an SPR from a register if the CPU has the given feature
151 */
152#define OPT_SET_SPR(ra, spr, ftr) \
153BEGIN_FTR_SECTION_NESTED(943) \
154 mtspr spr,ra; \
155END_FTR_SECTION_NESTED(ftr,ftr,943)
156
157/*
150 * Save a register to the PACA if the CPU has the given feature 158 * Save a register to the PACA if the CPU has the given feature
151 */ 159 */
152#define OPT_SAVE_REG_TO_PACA(offset, ra, ftr) \ 160#define OPT_SAVE_REG_TO_PACA(offset, ra, ftr) \
diff --git a/arch/powerpc/include/asm/fadump.h b/arch/powerpc/include/asm/fadump.h
index 88dbf9659185..a6774560afe3 100644
--- a/arch/powerpc/include/asm/fadump.h
+++ b/arch/powerpc/include/asm/fadump.h
@@ -210,7 +210,6 @@ extern int is_fadump_active(void);
210extern void crash_fadump(struct pt_regs *, const char *); 210extern void crash_fadump(struct pt_regs *, const char *);
211extern void fadump_cleanup(void); 211extern void fadump_cleanup(void);
212 212
213extern void vmcore_cleanup(void);
214#else /* CONFIG_FA_DUMP */ 213#else /* CONFIG_FA_DUMP */
215static inline int is_fadump_active(void) { return 0; } 214static inline int is_fadump_active(void) { return 0; }
216static inline void crash_fadump(struct pt_regs *regs, const char *str) { } 215static inline void crash_fadump(struct pt_regs *regs, const char *str) { }
diff --git a/arch/powerpc/include/asm/fsl_ifc.h b/arch/powerpc/include/asm/fsl_ifc.h
deleted file mode 100644
index f49ddb1b2273..000000000000
--- a/arch/powerpc/include/asm/fsl_ifc.h
+++ /dev/null
@@ -1,838 +0,0 @@
1/* Freescale Integrated Flash Controller
2 *
3 * Copyright 2011 Freescale Semiconductor, Inc
4 *
5 * Author: Dipen Dudhat <dipen.dudhat@freescale.com>
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22#ifndef __ASM_FSL_IFC_H
23#define __ASM_FSL_IFC_H
24
25#include <linux/compiler.h>
26#include <linux/types.h>
27#include <linux/io.h>
28
29#include <linux/of_platform.h>
30#include <linux/interrupt.h>
31
32#define FSL_IFC_BANK_COUNT 4
33
34/*
35 * CSPR - Chip Select Property Register
36 */
37#define CSPR_BA 0xFFFF0000
38#define CSPR_BA_SHIFT 16
39#define CSPR_PORT_SIZE 0x00000180
40#define CSPR_PORT_SIZE_SHIFT 7
41/* Port Size 8 bit */
42#define CSPR_PORT_SIZE_8 0x00000080
43/* Port Size 16 bit */
44#define CSPR_PORT_SIZE_16 0x00000100
45/* Port Size 32 bit */
46#define CSPR_PORT_SIZE_32 0x00000180
47/* Write Protect */
48#define CSPR_WP 0x00000040
49#define CSPR_WP_SHIFT 6
50/* Machine Select */
51#define CSPR_MSEL 0x00000006
52#define CSPR_MSEL_SHIFT 1
53/* NOR */
54#define CSPR_MSEL_NOR 0x00000000
55/* NAND */
56#define CSPR_MSEL_NAND 0x00000002
57/* GPCM */
58#define CSPR_MSEL_GPCM 0x00000004
59/* Bank Valid */
60#define CSPR_V 0x00000001
61#define CSPR_V_SHIFT 0
62
63/*
64 * Address Mask Register
65 */
66#define IFC_AMASK_MASK 0xFFFF0000
67#define IFC_AMASK_SHIFT 16
68#define IFC_AMASK(n) (IFC_AMASK_MASK << \
69 (__ilog2(n) - IFC_AMASK_SHIFT))
70
71/*
72 * Chip Select Option Register IFC_NAND Machine
73 */
74/* Enable ECC Encoder */
75#define CSOR_NAND_ECC_ENC_EN 0x80000000
76#define CSOR_NAND_ECC_MODE_MASK 0x30000000
77/* 4 bit correction per 520 Byte sector */
78#define CSOR_NAND_ECC_MODE_4 0x00000000
79/* 8 bit correction per 528 Byte sector */
80#define CSOR_NAND_ECC_MODE_8 0x10000000
81/* Enable ECC Decoder */
82#define CSOR_NAND_ECC_DEC_EN 0x04000000
83/* Row Address Length */
84#define CSOR_NAND_RAL_MASK 0x01800000
85#define CSOR_NAND_RAL_SHIFT 20
86#define CSOR_NAND_RAL_1 0x00000000
87#define CSOR_NAND_RAL_2 0x00800000
88#define CSOR_NAND_RAL_3 0x01000000
89#define CSOR_NAND_RAL_4 0x01800000
90/* Page Size 512b, 2k, 4k */
91#define CSOR_NAND_PGS_MASK 0x00180000
92#define CSOR_NAND_PGS_SHIFT 16
93#define CSOR_NAND_PGS_512 0x00000000
94#define CSOR_NAND_PGS_2K 0x00080000
95#define CSOR_NAND_PGS_4K 0x00100000
96#define CSOR_NAND_PGS_8K 0x00180000
97/* Spare region Size */
98#define CSOR_NAND_SPRZ_MASK 0x0000E000
99#define CSOR_NAND_SPRZ_SHIFT 13
100#define CSOR_NAND_SPRZ_16 0x00000000
101#define CSOR_NAND_SPRZ_64 0x00002000
102#define CSOR_NAND_SPRZ_128 0x00004000
103#define CSOR_NAND_SPRZ_210 0x00006000
104#define CSOR_NAND_SPRZ_218 0x00008000
105#define CSOR_NAND_SPRZ_224 0x0000A000
106#define CSOR_NAND_SPRZ_CSOR_EXT 0x0000C000
107/* Pages Per Block */
108#define CSOR_NAND_PB_MASK 0x00000700
109#define CSOR_NAND_PB_SHIFT 8
110#define CSOR_NAND_PB(n) ((__ilog2(n) - 5) << CSOR_NAND_PB_SHIFT)
111/* Time for Read Enable High to Output High Impedance */
112#define CSOR_NAND_TRHZ_MASK 0x0000001C
113#define CSOR_NAND_TRHZ_SHIFT 2
114#define CSOR_NAND_TRHZ_20 0x00000000
115#define CSOR_NAND_TRHZ_40 0x00000004
116#define CSOR_NAND_TRHZ_60 0x00000008
117#define CSOR_NAND_TRHZ_80 0x0000000C
118#define CSOR_NAND_TRHZ_100 0x00000010
119/* Buffer control disable */
120#define CSOR_NAND_BCTLD 0x00000001
121
122/*
123 * Chip Select Option Register - NOR Flash Mode
124 */
125/* Enable Address shift Mode */
126#define CSOR_NOR_ADM_SHFT_MODE_EN 0x80000000
127/* Page Read Enable from NOR device */
128#define CSOR_NOR_PGRD_EN 0x10000000
129/* AVD Toggle Enable during Burst Program */
130#define CSOR_NOR_AVD_TGL_PGM_EN 0x01000000
131/* Address Data Multiplexing Shift */
132#define CSOR_NOR_ADM_MASK 0x0003E000
133#define CSOR_NOR_ADM_SHIFT_SHIFT 13
134#define CSOR_NOR_ADM_SHIFT(n) ((n) << CSOR_NOR_ADM_SHIFT_SHIFT)
135/* Type of the NOR device hooked */
136#define CSOR_NOR_NOR_MODE_AYSNC_NOR 0x00000000
137#define CSOR_NOR_NOR_MODE_AVD_NOR 0x00000020
138/* Time for Read Enable High to Output High Impedance */
139#define CSOR_NOR_TRHZ_MASK 0x0000001C
140#define CSOR_NOR_TRHZ_SHIFT 2
141#define CSOR_NOR_TRHZ_20 0x00000000
142#define CSOR_NOR_TRHZ_40 0x00000004
143#define CSOR_NOR_TRHZ_60 0x00000008
144#define CSOR_NOR_TRHZ_80 0x0000000C
145#define CSOR_NOR_TRHZ_100 0x00000010
146/* Buffer control disable */
147#define CSOR_NOR_BCTLD 0x00000001
148
149/*
150 * Chip Select Option Register - GPCM Mode
151 */
152/* GPCM Mode - Normal */
153#define CSOR_GPCM_GPMODE_NORMAL 0x00000000
154/* GPCM Mode - GenericASIC */
155#define CSOR_GPCM_GPMODE_ASIC 0x80000000
156/* Parity Mode odd/even */
157#define CSOR_GPCM_PARITY_EVEN 0x40000000
158/* Parity Checking enable/disable */
159#define CSOR_GPCM_PAR_EN 0x20000000
160/* GPCM Timeout Count */
161#define CSOR_GPCM_GPTO_MASK 0x0F000000
162#define CSOR_GPCM_GPTO_SHIFT 24
163#define CSOR_GPCM_GPTO(n) ((__ilog2(n) - 8) << CSOR_GPCM_GPTO_SHIFT)
164/* GPCM External Access Termination mode for read access */
165#define CSOR_GPCM_RGETA_EXT 0x00080000
166/* GPCM External Access Termination mode for write access */
167#define CSOR_GPCM_WGETA_EXT 0x00040000
168/* Address Data Multiplexing Shift */
169#define CSOR_GPCM_ADM_MASK 0x0003E000
170#define CSOR_GPCM_ADM_SHIFT_SHIFT 13
171#define CSOR_GPCM_ADM_SHIFT(n) ((n) << CSOR_GPCM_ADM_SHIFT_SHIFT)
172/* Generic ASIC Parity error indication delay */
173#define CSOR_GPCM_GAPERRD_MASK 0x00000180
174#define CSOR_GPCM_GAPERRD_SHIFT 7
175#define CSOR_GPCM_GAPERRD(n) (((n) - 1) << CSOR_GPCM_GAPERRD_SHIFT)
176/* Time for Read Enable High to Output High Impedance */
177#define CSOR_GPCM_TRHZ_MASK 0x0000001C
178#define CSOR_GPCM_TRHZ_20 0x00000000
179#define CSOR_GPCM_TRHZ_40 0x00000004
180#define CSOR_GPCM_TRHZ_60 0x00000008
181#define CSOR_GPCM_TRHZ_80 0x0000000C
182#define CSOR_GPCM_TRHZ_100 0x00000010
183/* Buffer control disable */
184#define CSOR_GPCM_BCTLD 0x00000001
185
186/*
187 * Ready Busy Status Register (RB_STAT)
188 */
189/* CSn is READY */
190#define IFC_RB_STAT_READY_CS0 0x80000000
191#define IFC_RB_STAT_READY_CS1 0x40000000
192#define IFC_RB_STAT_READY_CS2 0x20000000
193#define IFC_RB_STAT_READY_CS3 0x10000000
194
195/*
196 * General Control Register (GCR)
197 */
198#define IFC_GCR_MASK 0x8000F800
199/* reset all IFC hardware */
200#define IFC_GCR_SOFT_RST_ALL 0x80000000
201/* Turnaroud Time of external buffer */
202#define IFC_GCR_TBCTL_TRN_TIME 0x0000F800
203#define IFC_GCR_TBCTL_TRN_TIME_SHIFT 11
204
205/*
206 * Common Event and Error Status Register (CM_EVTER_STAT)
207 */
208/* Chip select error */
209#define IFC_CM_EVTER_STAT_CSER 0x80000000
210
211/*
212 * Common Event and Error Enable Register (CM_EVTER_EN)
213 */
214/* Chip select error checking enable */
215#define IFC_CM_EVTER_EN_CSEREN 0x80000000
216
217/*
218 * Common Event and Error Interrupt Enable Register (CM_EVTER_INTR_EN)
219 */
220/* Chip select error interrupt enable */
221#define IFC_CM_EVTER_INTR_EN_CSERIREN 0x80000000
222
223/*
224 * Common Transfer Error Attribute Register-0 (CM_ERATTR0)
225 */
226/* transaction type of error Read/Write */
227#define IFC_CM_ERATTR0_ERTYP_READ 0x80000000
228#define IFC_CM_ERATTR0_ERAID 0x0FF00000
229#define IFC_CM_ERATTR0_ERAID_SHIFT 20
230#define IFC_CM_ERATTR0_ESRCID 0x0000FF00
231#define IFC_CM_ERATTR0_ESRCID_SHIFT 8
232
233/*
234 * Clock Control Register (CCR)
235 */
236#define IFC_CCR_MASK 0x0F0F8800
237/* Clock division ratio */
238#define IFC_CCR_CLK_DIV_MASK 0x0F000000
239#define IFC_CCR_CLK_DIV_SHIFT 24
240#define IFC_CCR_CLK_DIV(n) ((n-1) << IFC_CCR_CLK_DIV_SHIFT)
241/* IFC Clock Delay */
242#define IFC_CCR_CLK_DLY_MASK 0x000F0000
243#define IFC_CCR_CLK_DLY_SHIFT 16
244#define IFC_CCR_CLK_DLY(n) ((n) << IFC_CCR_CLK_DLY_SHIFT)
245/* Invert IFC clock before sending out */
246#define IFC_CCR_INV_CLK_EN 0x00008000
247/* Fedback IFC Clock */
248#define IFC_CCR_FB_IFC_CLK_SEL 0x00000800
249
250/*
251 * Clock Status Register (CSR)
252 */
253/* Clk is stable */
254#define IFC_CSR_CLK_STAT_STABLE 0x80000000
255
256/*
257 * IFC_NAND Machine Specific Registers
258 */
259/*
260 * NAND Configuration Register (NCFGR)
261 */
262/* Auto Boot Mode */
263#define IFC_NAND_NCFGR_BOOT 0x80000000
264/* Addressing Mode-ROW0+n/COL0 */
265#define IFC_NAND_NCFGR_ADDR_MODE_RC0 0x00000000
266/* Addressing Mode-ROW0+n/COL0+n */
267#define IFC_NAND_NCFGR_ADDR_MODE_RC1 0x00400000
268/* Number of loop iterations of FIR sequences for multi page operations */
269#define IFC_NAND_NCFGR_NUM_LOOP_MASK 0x0000F000
270#define IFC_NAND_NCFGR_NUM_LOOP_SHIFT 12
271#define IFC_NAND_NCFGR_NUM_LOOP(n) ((n) << IFC_NAND_NCFGR_NUM_LOOP_SHIFT)
272/* Number of wait cycles */
273#define IFC_NAND_NCFGR_NUM_WAIT_MASK 0x000000FF
274#define IFC_NAND_NCFGR_NUM_WAIT_SHIFT 0
275
276/*
277 * NAND Flash Command Registers (NAND_FCR0/NAND_FCR1)
278 */
279/* General purpose FCM flash command bytes CMD0-CMD7 */
280#define IFC_NAND_FCR0_CMD0 0xFF000000
281#define IFC_NAND_FCR0_CMD0_SHIFT 24
282#define IFC_NAND_FCR0_CMD1 0x00FF0000
283#define IFC_NAND_FCR0_CMD1_SHIFT 16
284#define IFC_NAND_FCR0_CMD2 0x0000FF00
285#define IFC_NAND_FCR0_CMD2_SHIFT 8
286#define IFC_NAND_FCR0_CMD3 0x000000FF
287#define IFC_NAND_FCR0_CMD3_SHIFT 0
288#define IFC_NAND_FCR1_CMD4 0xFF000000
289#define IFC_NAND_FCR1_CMD4_SHIFT 24
290#define IFC_NAND_FCR1_CMD5 0x00FF0000
291#define IFC_NAND_FCR1_CMD5_SHIFT 16
292#define IFC_NAND_FCR1_CMD6 0x0000FF00
293#define IFC_NAND_FCR1_CMD6_SHIFT 8
294#define IFC_NAND_FCR1_CMD7 0x000000FF
295#define IFC_NAND_FCR1_CMD7_SHIFT 0
296
297/*
298 * Flash ROW and COL Address Register (ROWn, COLn)
299 */
300/* Main/spare region locator */
301#define IFC_NAND_COL_MS 0x80000000
302/* Column Address */
303#define IFC_NAND_COL_CA_MASK 0x00000FFF
304
305/*
306 * NAND Flash Byte Count Register (NAND_BC)
307 */
308/* Byte Count for read/Write */
309#define IFC_NAND_BC 0x000001FF
310
311/*
312 * NAND Flash Instruction Registers (NAND_FIR0/NAND_FIR1/NAND_FIR2)
313 */
314/* NAND Machine specific opcodes OP0-OP14*/
315#define IFC_NAND_FIR0_OP0 0xFC000000
316#define IFC_NAND_FIR0_OP0_SHIFT 26
317#define IFC_NAND_FIR0_OP1 0x03F00000
318#define IFC_NAND_FIR0_OP1_SHIFT 20
319#define IFC_NAND_FIR0_OP2 0x000FC000
320#define IFC_NAND_FIR0_OP2_SHIFT 14
321#define IFC_NAND_FIR0_OP3 0x00003F00
322#define IFC_NAND_FIR0_OP3_SHIFT 8
323#define IFC_NAND_FIR0_OP4 0x000000FC
324#define IFC_NAND_FIR0_OP4_SHIFT 2
325#define IFC_NAND_FIR1_OP5 0xFC000000
326#define IFC_NAND_FIR1_OP5_SHIFT 26
327#define IFC_NAND_FIR1_OP6 0x03F00000
328#define IFC_NAND_FIR1_OP6_SHIFT 20
329#define IFC_NAND_FIR1_OP7 0x000FC000
330#define IFC_NAND_FIR1_OP7_SHIFT 14
331#define IFC_NAND_FIR1_OP8 0x00003F00
332#define IFC_NAND_FIR1_OP8_SHIFT 8
333#define IFC_NAND_FIR1_OP9 0x000000FC
334#define IFC_NAND_FIR1_OP9_SHIFT 2
335#define IFC_NAND_FIR2_OP10 0xFC000000
336#define IFC_NAND_FIR2_OP10_SHIFT 26
337#define IFC_NAND_FIR2_OP11 0x03F00000
338#define IFC_NAND_FIR2_OP11_SHIFT 20
339#define IFC_NAND_FIR2_OP12 0x000FC000
340#define IFC_NAND_FIR2_OP12_SHIFT 14
341#define IFC_NAND_FIR2_OP13 0x00003F00
342#define IFC_NAND_FIR2_OP13_SHIFT 8
343#define IFC_NAND_FIR2_OP14 0x000000FC
344#define IFC_NAND_FIR2_OP14_SHIFT 2
345
346/*
347 * Instruction opcodes to be programmed
348 * in FIR registers- 6bits
349 */
350enum ifc_nand_fir_opcodes {
351 IFC_FIR_OP_NOP,
352 IFC_FIR_OP_CA0,
353 IFC_FIR_OP_CA1,
354 IFC_FIR_OP_CA2,
355 IFC_FIR_OP_CA3,
356 IFC_FIR_OP_RA0,
357 IFC_FIR_OP_RA1,
358 IFC_FIR_OP_RA2,
359 IFC_FIR_OP_RA3,
360 IFC_FIR_OP_CMD0,
361 IFC_FIR_OP_CMD1,
362 IFC_FIR_OP_CMD2,
363 IFC_FIR_OP_CMD3,
364 IFC_FIR_OP_CMD4,
365 IFC_FIR_OP_CMD5,
366 IFC_FIR_OP_CMD6,
367 IFC_FIR_OP_CMD7,
368 IFC_FIR_OP_CW0,
369 IFC_FIR_OP_CW1,
370 IFC_FIR_OP_CW2,
371 IFC_FIR_OP_CW3,
372 IFC_FIR_OP_CW4,
373 IFC_FIR_OP_CW5,
374 IFC_FIR_OP_CW6,
375 IFC_FIR_OP_CW7,
376 IFC_FIR_OP_WBCD,
377 IFC_FIR_OP_RBCD,
378 IFC_FIR_OP_BTRD,
379 IFC_FIR_OP_RDSTAT,
380 IFC_FIR_OP_NWAIT,
381 IFC_FIR_OP_WFR,
382 IFC_FIR_OP_SBRD,
383 IFC_FIR_OP_UA,
384 IFC_FIR_OP_RB,
385};
386
387/*
388 * NAND Chip Select Register (NAND_CSEL)
389 */
390#define IFC_NAND_CSEL 0x0C000000
391#define IFC_NAND_CSEL_SHIFT 26
392#define IFC_NAND_CSEL_CS0 0x00000000
393#define IFC_NAND_CSEL_CS1 0x04000000
394#define IFC_NAND_CSEL_CS2 0x08000000
395#define IFC_NAND_CSEL_CS3 0x0C000000
396
397/*
398 * NAND Operation Sequence Start (NANDSEQ_STRT)
399 */
400/* NAND Flash Operation Start */
401#define IFC_NAND_SEQ_STRT_FIR_STRT 0x80000000
402/* Automatic Erase */
403#define IFC_NAND_SEQ_STRT_AUTO_ERS 0x00800000
404/* Automatic Program */
405#define IFC_NAND_SEQ_STRT_AUTO_PGM 0x00100000
406/* Automatic Copyback */
407#define IFC_NAND_SEQ_STRT_AUTO_CPB 0x00020000
408/* Automatic Read Operation */
409#define IFC_NAND_SEQ_STRT_AUTO_RD 0x00004000
410/* Automatic Status Read */
411#define IFC_NAND_SEQ_STRT_AUTO_STAT_RD 0x00000800
412
413/*
414 * NAND Event and Error Status Register (NAND_EVTER_STAT)
415 */
416/* Operation Complete */
417#define IFC_NAND_EVTER_STAT_OPC 0x80000000
418/* Flash Timeout Error */
419#define IFC_NAND_EVTER_STAT_FTOER 0x08000000
420/* Write Protect Error */
421#define IFC_NAND_EVTER_STAT_WPER 0x04000000
422/* ECC Error */
423#define IFC_NAND_EVTER_STAT_ECCER 0x02000000
424/* RCW Load Done */
425#define IFC_NAND_EVTER_STAT_RCW_DN 0x00008000
426/* Boot Loadr Done */
427#define IFC_NAND_EVTER_STAT_BOOT_DN 0x00004000
428/* Bad Block Indicator search select */
429#define IFC_NAND_EVTER_STAT_BBI_SRCH_SE 0x00000800
430
431/*
432 * NAND Flash Page Read Completion Event Status Register
433 * (PGRDCMPL_EVT_STAT)
434 */
435#define PGRDCMPL_EVT_STAT_MASK 0xFFFF0000
436/* Small Page 0-15 Done */
437#define PGRDCMPL_EVT_STAT_SECTION_SP(n) (1 << (31 - (n)))
438/* Large Page(2K) 0-3 Done */
439#define PGRDCMPL_EVT_STAT_LP_2K(n) (0xF << (28 - (n)*4))
440/* Large Page(4K) 0-1 Done */
441#define PGRDCMPL_EVT_STAT_LP_4K(n) (0xFF << (24 - (n)*8))
442
443/*
444 * NAND Event and Error Enable Register (NAND_EVTER_EN)
445 */
446/* Operation complete event enable */
447#define IFC_NAND_EVTER_EN_OPC_EN 0x80000000
448/* Page read complete event enable */
449#define IFC_NAND_EVTER_EN_PGRDCMPL_EN 0x20000000
450/* Flash Timeout error enable */
451#define IFC_NAND_EVTER_EN_FTOER_EN 0x08000000
452/* Write Protect error enable */
453#define IFC_NAND_EVTER_EN_WPER_EN 0x04000000
454/* ECC error logging enable */
455#define IFC_NAND_EVTER_EN_ECCER_EN 0x02000000
456
457/*
458 * NAND Event and Error Interrupt Enable Register (NAND_EVTER_INTR_EN)
459 */
460/* Enable interrupt for operation complete */
461#define IFC_NAND_EVTER_INTR_OPCIR_EN 0x80000000
462/* Enable interrupt for Page read complete */
463#define IFC_NAND_EVTER_INTR_PGRDCMPLIR_EN 0x20000000
464/* Enable interrupt for Flash timeout error */
465#define IFC_NAND_EVTER_INTR_FTOERIR_EN 0x08000000
466/* Enable interrupt for Write protect error */
467#define IFC_NAND_EVTER_INTR_WPERIR_EN 0x04000000
468/* Enable interrupt for ECC error*/
469#define IFC_NAND_EVTER_INTR_ECCERIR_EN 0x02000000
470
471/*
472 * NAND Transfer Error Attribute Register-0 (NAND_ERATTR0)
473 */
474#define IFC_NAND_ERATTR0_MASK 0x0C080000
475/* Error on CS0-3 for NAND */
476#define IFC_NAND_ERATTR0_ERCS_CS0 0x00000000
477#define IFC_NAND_ERATTR0_ERCS_CS1 0x04000000
478#define IFC_NAND_ERATTR0_ERCS_CS2 0x08000000
479#define IFC_NAND_ERATTR0_ERCS_CS3 0x0C000000
480/* Transaction type of error Read/Write */
481#define IFC_NAND_ERATTR0_ERTTYPE_READ 0x00080000
482
483/*
484 * NAND Flash Status Register (NAND_FSR)
485 */
486/* First byte of data read from read status op */
487#define IFC_NAND_NFSR_RS0 0xFF000000
488/* Second byte of data read from read status op */
489#define IFC_NAND_NFSR_RS1 0x00FF0000
490
491/*
492 * ECC Error Status Registers (ECCSTAT0-ECCSTAT3)
493 */
494/* Number of ECC errors on sector n (n = 0-15) */
495#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR0_MASK 0x0F000000
496#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR0_SHIFT 24
497#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR1_MASK 0x000F0000
498#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR1_SHIFT 16
499#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR2_MASK 0x00000F00
500#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR2_SHIFT 8
501#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR3_MASK 0x0000000F
502#define IFC_NAND_ECCSTAT0_ERRCNT_SECTOR3_SHIFT 0
503#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR4_MASK 0x0F000000
504#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR4_SHIFT 24
505#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR5_MASK 0x000F0000
506#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR5_SHIFT 16
507#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR6_MASK 0x00000F00
508#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR6_SHIFT 8
509#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR7_MASK 0x0000000F
510#define IFC_NAND_ECCSTAT1_ERRCNT_SECTOR7_SHIFT 0
511#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR8_MASK 0x0F000000
512#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR8_SHIFT 24
513#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR9_MASK 0x000F0000
514#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR9_SHIFT 16
515#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR10_MASK 0x00000F00
516#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR10_SHIFT 8
517#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR11_MASK 0x0000000F
518#define IFC_NAND_ECCSTAT2_ERRCNT_SECTOR11_SHIFT 0
519#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR12_MASK 0x0F000000
520#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR12_SHIFT 24
521#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR13_MASK 0x000F0000
522#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR13_SHIFT 16
523#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR14_MASK 0x00000F00
524#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR14_SHIFT 8
525#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR15_MASK 0x0000000F
526#define IFC_NAND_ECCSTAT3_ERRCNT_SECTOR15_SHIFT 0
527
528/*
529 * NAND Control Register (NANDCR)
530 */
531#define IFC_NAND_NCR_FTOCNT_MASK 0x1E000000
532#define IFC_NAND_NCR_FTOCNT_SHIFT 25
533#define IFC_NAND_NCR_FTOCNT(n) ((_ilog2(n) - 8) << IFC_NAND_NCR_FTOCNT_SHIFT)
534
535/*
536 * NAND_AUTOBOOT_TRGR
537 */
538/* Trigger RCW load */
539#define IFC_NAND_AUTOBOOT_TRGR_RCW_LD 0x80000000
540/* Trigget Auto Boot */
541#define IFC_NAND_AUTOBOOT_TRGR_BOOT_LD 0x20000000
542
543/*
544 * NAND_MDR
545 */
546/* 1st read data byte when opcode SBRD */
547#define IFC_NAND_MDR_RDATA0 0xFF000000
548/* 2nd read data byte when opcode SBRD */
549#define IFC_NAND_MDR_RDATA1 0x00FF0000
550
551/*
552 * NOR Machine Specific Registers
553 */
554/*
555 * NOR Event and Error Status Register (NOR_EVTER_STAT)
556 */
557/* NOR Command Sequence Operation Complete */
558#define IFC_NOR_EVTER_STAT_OPC_NOR 0x80000000
559/* Write Protect Error */
560#define IFC_NOR_EVTER_STAT_WPER 0x04000000
561/* Command Sequence Timeout Error */
562#define IFC_NOR_EVTER_STAT_STOER 0x01000000
563
564/*
565 * NOR Event and Error Enable Register (NOR_EVTER_EN)
566 */
567/* NOR Command Seq complete event enable */
568#define IFC_NOR_EVTER_EN_OPCEN_NOR 0x80000000
569/* Write Protect Error Checking Enable */
570#define IFC_NOR_EVTER_EN_WPEREN 0x04000000
571/* Timeout Error Enable */
572#define IFC_NOR_EVTER_EN_STOEREN 0x01000000
573
574/*
575 * NOR Event and Error Interrupt Enable Register (NOR_EVTER_INTR_EN)
576 */
577/* Enable interrupt for OPC complete */
578#define IFC_NOR_EVTER_INTR_OPCEN_NOR 0x80000000
579/* Enable interrupt for write protect error */
580#define IFC_NOR_EVTER_INTR_WPEREN 0x04000000
581/* Enable interrupt for timeout error */
582#define IFC_NOR_EVTER_INTR_STOEREN 0x01000000
583
584/*
585 * NOR Transfer Error Attribute Register-0 (NOR_ERATTR0)
586 */
587/* Source ID for error transaction */
588#define IFC_NOR_ERATTR0_ERSRCID 0xFF000000
589/* AXI ID for error transation */
590#define IFC_NOR_ERATTR0_ERAID 0x000FF000
591/* Chip select corresponds to NOR error */
592#define IFC_NOR_ERATTR0_ERCS_CS0 0x00000000
593#define IFC_NOR_ERATTR0_ERCS_CS1 0x00000010
594#define IFC_NOR_ERATTR0_ERCS_CS2 0x00000020
595#define IFC_NOR_ERATTR0_ERCS_CS3 0x00000030
596/* Type of transaction read/write */
597#define IFC_NOR_ERATTR0_ERTYPE_READ 0x00000001
598
599/*
600 * NOR Transfer Error Attribute Register-2 (NOR_ERATTR2)
601 */
602#define IFC_NOR_ERATTR2_ER_NUM_PHASE_EXP 0x000F0000
603#define IFC_NOR_ERATTR2_ER_NUM_PHASE_PER 0x00000F00
604
605/*
606 * NOR Control Register (NORCR)
607 */
608#define IFC_NORCR_MASK 0x0F0F0000
609/* No. of Address/Data Phase */
610#define IFC_NORCR_NUM_PHASE_MASK 0x0F000000
611#define IFC_NORCR_NUM_PHASE_SHIFT 24
612#define IFC_NORCR_NUM_PHASE(n) ((n-1) << IFC_NORCR_NUM_PHASE_SHIFT)
613/* Sequence Timeout Count */
614#define IFC_NORCR_STOCNT_MASK 0x000F0000
615#define IFC_NORCR_STOCNT_SHIFT 16
616#define IFC_NORCR_STOCNT(n) ((__ilog2(n) - 8) << IFC_NORCR_STOCNT_SHIFT)
617
618/*
619 * GPCM Machine specific registers
620 */
621/*
622 * GPCM Event and Error Status Register (GPCM_EVTER_STAT)
623 */
624/* Timeout error */
625#define IFC_GPCM_EVTER_STAT_TOER 0x04000000
626/* Parity error */
627#define IFC_GPCM_EVTER_STAT_PER 0x01000000
628
629/*
630 * GPCM Event and Error Enable Register (GPCM_EVTER_EN)
631 */
632/* Timeout error enable */
633#define IFC_GPCM_EVTER_EN_TOER_EN 0x04000000
634/* Parity error enable */
635#define IFC_GPCM_EVTER_EN_PER_EN 0x01000000
636
637/*
638 * GPCM Event and Error Interrupt Enable Register (GPCM_EVTER_INTR_EN)
639 */
640/* Enable Interrupt for timeout error */
641#define IFC_GPCM_EEIER_TOERIR_EN 0x04000000
642/* Enable Interrupt for Parity error */
643#define IFC_GPCM_EEIER_PERIR_EN 0x01000000
644
645/*
646 * GPCM Transfer Error Attribute Register-0 (GPCM_ERATTR0)
647 */
648/* Source ID for error transaction */
649#define IFC_GPCM_ERATTR0_ERSRCID 0xFF000000
650/* AXI ID for error transaction */
651#define IFC_GPCM_ERATTR0_ERAID 0x000FF000
652/* Chip select corresponds to GPCM error */
653#define IFC_GPCM_ERATTR0_ERCS_CS0 0x00000000
654#define IFC_GPCM_ERATTR0_ERCS_CS1 0x00000040
655#define IFC_GPCM_ERATTR0_ERCS_CS2 0x00000080
656#define IFC_GPCM_ERATTR0_ERCS_CS3 0x000000C0
657/* Type of transaction read/Write */
658#define IFC_GPCM_ERATTR0_ERTYPE_READ 0x00000001
659
660/*
661 * GPCM Transfer Error Attribute Register-2 (GPCM_ERATTR2)
662 */
663/* On which beat of address/data parity error is observed */
664#define IFC_GPCM_ERATTR2_PERR_BEAT 0x00000C00
665/* Parity Error on byte */
666#define IFC_GPCM_ERATTR2_PERR_BYTE 0x000000F0
667/* Parity Error reported in addr or data phase */
668#define IFC_GPCM_ERATTR2_PERR_DATA_PHASE 0x00000001
669
670/*
671 * GPCM Status Register (GPCM_STAT)
672 */
673#define IFC_GPCM_STAT_BSY 0x80000000 /* GPCM is busy */
674
675/*
676 * IFC Controller NAND Machine registers
677 */
678struct fsl_ifc_nand {
679 __be32 ncfgr;
680 u32 res1[0x4];
681 __be32 nand_fcr0;
682 __be32 nand_fcr1;
683 u32 res2[0x8];
684 __be32 row0;
685 u32 res3;
686 __be32 col0;
687 u32 res4;
688 __be32 row1;
689 u32 res5;
690 __be32 col1;
691 u32 res6;
692 __be32 row2;
693 u32 res7;
694 __be32 col2;
695 u32 res8;
696 __be32 row3;
697 u32 res9;
698 __be32 col3;
699 u32 res10[0x24];
700 __be32 nand_fbcr;
701 u32 res11;
702 __be32 nand_fir0;
703 __be32 nand_fir1;
704 __be32 nand_fir2;
705 u32 res12[0x10];
706 __be32 nand_csel;
707 u32 res13;
708 __be32 nandseq_strt;
709 u32 res14;
710 __be32 nand_evter_stat;
711 u32 res15;
712 __be32 pgrdcmpl_evt_stat;
713 u32 res16[0x2];
714 __be32 nand_evter_en;
715 u32 res17[0x2];
716 __be32 nand_evter_intr_en;
717 u32 res18[0x2];
718 __be32 nand_erattr0;
719 __be32 nand_erattr1;
720 u32 res19[0x10];
721 __be32 nand_fsr;
722 u32 res20;
723 __be32 nand_eccstat[4];
724 u32 res21[0x20];
725 __be32 nanndcr;
726 u32 res22[0x2];
727 __be32 nand_autoboot_trgr;
728 u32 res23;
729 __be32 nand_mdr;
730 u32 res24[0x5C];
731};
732
733/*
734 * IFC controller NOR Machine registers
735 */
736struct fsl_ifc_nor {
737 __be32 nor_evter_stat;
738 u32 res1[0x2];
739 __be32 nor_evter_en;
740 u32 res2[0x2];
741 __be32 nor_evter_intr_en;
742 u32 res3[0x2];
743 __be32 nor_erattr0;
744 __be32 nor_erattr1;
745 __be32 nor_erattr2;
746 u32 res4[0x4];
747 __be32 norcr;
748 u32 res5[0xEF];
749};
750
751/*
752 * IFC controller GPCM Machine registers
753 */
754struct fsl_ifc_gpcm {
755 __be32 gpcm_evter_stat;
756 u32 res1[0x2];
757 __be32 gpcm_evter_en;
758 u32 res2[0x2];
759 __be32 gpcm_evter_intr_en;
760 u32 res3[0x2];
761 __be32 gpcm_erattr0;
762 __be32 gpcm_erattr1;
763 __be32 gpcm_erattr2;
764 __be32 gpcm_stat;
765 u32 res4[0x1F3];
766};
767
768/*
769 * IFC Controller Registers
770 */
771struct fsl_ifc_regs {
772 __be32 ifc_rev;
773 u32 res1[0x2];
774 struct {
775 __be32 cspr_ext;
776 __be32 cspr;
777 u32 res2;
778 } cspr_cs[FSL_IFC_BANK_COUNT];
779 u32 res3[0x19];
780 struct {
781 __be32 amask;
782 u32 res4[0x2];
783 } amask_cs[FSL_IFC_BANK_COUNT];
784 u32 res5[0x17];
785 struct {
786 __be32 csor_ext;
787 __be32 csor;
788 u32 res6;
789 } csor_cs[FSL_IFC_BANK_COUNT];
790 u32 res7[0x19];
791 struct {
792 __be32 ftim[4];
793 u32 res8[0x8];
794 } ftim_cs[FSL_IFC_BANK_COUNT];
795 u32 res9[0x60];
796 __be32 rb_stat;
797 u32 res10[0x2];
798 __be32 ifc_gcr;
799 u32 res11[0x2];
800 __be32 cm_evter_stat;
801 u32 res12[0x2];
802 __be32 cm_evter_en;
803 u32 res13[0x2];
804 __be32 cm_evter_intr_en;
805 u32 res14[0x2];
806 __be32 cm_erattr0;
807 __be32 cm_erattr1;
808 u32 res15[0x2];
809 __be32 ifc_ccr;
810 __be32 ifc_csr;
811 u32 res16[0x2EB];
812 struct fsl_ifc_nand ifc_nand;
813 struct fsl_ifc_nor ifc_nor;
814 struct fsl_ifc_gpcm ifc_gpcm;
815};
816
817extern unsigned int convert_ifc_address(phys_addr_t addr_base);
818extern int fsl_ifc_find(phys_addr_t addr_base);
819
820/* overview of the fsl ifc controller */
821
822struct fsl_ifc_ctrl {
823 /* device info */
824 struct device *dev;
825 struct fsl_ifc_regs __iomem *regs;
826 int irq;
827 int nand_irq;
828 spinlock_t lock;
829 void *nand;
830
831 u32 nand_stat;
832 wait_queue_head_t nand_wait;
833};
834
835extern struct fsl_ifc_ctrl *fsl_ifc_ctrl_dev;
836
837
838#endif /* __ASM_FSL_IFC_H */
diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h
index d8b600b3f058..5dbbb29f5c3e 100644
--- a/arch/powerpc/include/asm/hvcall.h
+++ b/arch/powerpc/include/asm/hvcall.h
@@ -274,6 +274,11 @@
274/* Platform specific hcalls, used by KVM */ 274/* Platform specific hcalls, used by KVM */
275#define H_RTAS 0xf000 275#define H_RTAS 0xf000
276 276
277/* "Platform specific hcalls", provided by PHYP */
278#define H_GET_24X7_CATALOG_PAGE 0xF078
279#define H_GET_24X7_DATA 0xF07C
280#define H_GET_PERF_COUNTER_INFO 0xF080
281
277#ifndef __ASSEMBLY__ 282#ifndef __ASSEMBLY__
278 283
279/** 284/**
diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h
index 83851aabfdc8..bb1e38a23ac7 100644
--- a/arch/powerpc/include/asm/kvm_book3s.h
+++ b/arch/powerpc/include/asm/kvm_book3s.h
@@ -304,6 +304,11 @@ static inline ulong kvmppc_get_fault_dar(struct kvm_vcpu *vcpu)
304 return vcpu->arch.fault_dar; 304 return vcpu->arch.fault_dar;
305} 305}
306 306
307static inline bool is_kvmppc_resume_guest(int r)
308{
309 return (r == RESUME_GUEST || r == RESUME_GUEST_NV);
310}
311
307/* Magic register values loaded into r3 and r4 before the 'sc' assembly 312/* Magic register values loaded into r3 and r4 before the 'sc' assembly
308 * instruction for the OSI hypercalls */ 313 * instruction for the OSI hypercalls */
309#define OSI_SC_MAGIC_R3 0x113724FA 314#define OSI_SC_MAGIC_R3 0x113724FA
diff --git a/arch/powerpc/include/asm/kvm_book3s_64.h b/arch/powerpc/include/asm/kvm_book3s_64.h
index bf0fa8b0a883..51388befeddb 100644
--- a/arch/powerpc/include/asm/kvm_book3s_64.h
+++ b/arch/powerpc/include/asm/kvm_book3s_64.h
@@ -289,6 +289,18 @@ static inline void note_hpte_modification(struct kvm *kvm,
289 if (atomic_read(&kvm->arch.hpte_mod_interest)) 289 if (atomic_read(&kvm->arch.hpte_mod_interest))
290 rev->guest_rpte |= HPTE_GR_MODIFIED; 290 rev->guest_rpte |= HPTE_GR_MODIFIED;
291} 291}
292
293/*
294 * Like kvm_memslots(), but for use in real mode when we can't do
295 * any RCU stuff (since the secondary threads are offline from the
296 * kernel's point of view), and we can't print anything.
297 * Thus we use rcu_dereference_raw() rather than rcu_dereference_check().
298 */
299static inline struct kvm_memslots *kvm_memslots_raw(struct kvm *kvm)
300{
301 return rcu_dereference_raw_notrace(kvm->memslots);
302}
303
292#endif /* CONFIG_KVM_BOOK3S_HV_POSSIBLE */ 304#endif /* CONFIG_KVM_BOOK3S_HV_POSSIBLE */
293 305
294#endif /* __ASM_KVM_BOOK3S_64_H__ */ 306#endif /* __ASM_KVM_BOOK3S_64_H__ */
diff --git a/arch/powerpc/include/asm/kvm_book3s_asm.h b/arch/powerpc/include/asm/kvm_book3s_asm.h
index f3a91dc02c98..821725c1bf46 100644
--- a/arch/powerpc/include/asm/kvm_book3s_asm.h
+++ b/arch/powerpc/include/asm/kvm_book3s_asm.h
@@ -94,7 +94,7 @@ struct kvmppc_host_state {
94 unsigned long xics_phys; 94 unsigned long xics_phys;
95 u32 saved_xirr; 95 u32 saved_xirr;
96 u64 dabr; 96 u64 dabr;
97 u64 host_mmcr[3]; 97 u64 host_mmcr[7]; /* MMCR 0,1,A, SIAR, SDAR, MMCR2, SIER */
98 u32 host_pmc[8]; 98 u32 host_pmc[8];
99 u64 host_purr; 99 u64 host_purr;
100 u64 host_spurr; 100 u64 host_spurr;
diff --git a/arch/powerpc/include/asm/kvm_booke_hv_asm.h b/arch/powerpc/include/asm/kvm_booke_hv_asm.h
index 3a79f5325712..e5f048bbcb7c 100644
--- a/arch/powerpc/include/asm/kvm_booke_hv_asm.h
+++ b/arch/powerpc/include/asm/kvm_booke_hv_asm.h
@@ -36,26 +36,21 @@
36 * *(r8 + GPR11) = saved r11 36 * *(r8 + GPR11) = saved r11
37 * 37 *
38 * 64-bit host 38 * 64-bit host
39 * Expected inputs (GEN/GDBELL/DBG/MC exception types): 39 * Expected inputs (GEN/GDBELL/DBG/CRIT/MC exception types):
40 * r10 = saved CR 40 * r10 = saved CR
41 * r13 = PACA_POINTER 41 * r13 = PACA_POINTER
42 * *(r13 + PACA_EX##type + EX_R10) = saved r10 42 * *(r13 + PACA_EX##type + EX_R10) = saved r10
43 * *(r13 + PACA_EX##type + EX_R11) = saved r11 43 * *(r13 + PACA_EX##type + EX_R11) = saved r11
44 * SPRN_SPRG_##type##_SCRATCH = saved r13 44 * SPRN_SPRG_##type##_SCRATCH = saved r13
45 * 45 *
46 * Expected inputs (CRIT exception type):
47 * r10 = saved CR
48 * r13 = PACA_POINTER
49 * *(r13 + PACA_EX##type + EX_R10) = saved r10
50 * *(r13 + PACA_EX##type + EX_R11) = saved r11
51 * *(r13 + PACA_EX##type + EX_R13) = saved r13
52 *
53 * Expected inputs (TLB exception type): 46 * Expected inputs (TLB exception type):
54 * r10 = saved CR 47 * r10 = saved CR
48 * r12 = extlb pointer
55 * r13 = PACA_POINTER 49 * r13 = PACA_POINTER
56 * *(r13 + PACA_EX##type + EX_TLB_R10) = saved r10 50 * *(r12 + EX_TLB_R10) = saved r10
57 * *(r13 + PACA_EX##type + EX_TLB_R11) = saved r11 51 * *(r12 + EX_TLB_R11) = saved r11
58 * SPRN_SPRG_GEN_SCRATCH = saved r13 52 * *(r12 + EX_TLB_R13) = saved r13
53 * SPRN_SPRG_GEN_SCRATCH = saved r12
59 * 54 *
60 * Only the bolted version of TLB miss exception handlers is supported now. 55 * Only the bolted version of TLB miss exception handlers is supported now.
61 */ 56 */
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
index fcd53f0d34ba..4096f16502a9 100644
--- a/arch/powerpc/include/asm/kvm_ppc.h
+++ b/arch/powerpc/include/asm/kvm_ppc.h
@@ -129,6 +129,8 @@ extern long kvm_vm_ioctl_create_spapr_tce(struct kvm *kvm,
129 struct kvm_create_spapr_tce *args); 129 struct kvm_create_spapr_tce *args);
130extern long kvmppc_h_put_tce(struct kvm_vcpu *vcpu, unsigned long liobn, 130extern long kvmppc_h_put_tce(struct kvm_vcpu *vcpu, unsigned long liobn,
131 unsigned long ioba, unsigned long tce); 131 unsigned long ioba, unsigned long tce);
132extern long kvmppc_h_get_tce(struct kvm_vcpu *vcpu, unsigned long liobn,
133 unsigned long ioba);
132extern struct kvm_rma_info *kvm_alloc_rma(void); 134extern struct kvm_rma_info *kvm_alloc_rma(void);
133extern void kvm_release_rma(struct kvm_rma_info *ri); 135extern void kvm_release_rma(struct kvm_rma_info *ri);
134extern struct page *kvm_alloc_hpt(unsigned long nr_pages); 136extern struct page *kvm_alloc_hpt(unsigned long nr_pages);
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index ad3025d0880b..5b6c03f1058f 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -170,6 +170,9 @@ struct machdep_calls {
170 int (*system_reset_exception)(struct pt_regs *regs); 170 int (*system_reset_exception)(struct pt_regs *regs);
171 int (*machine_check_exception)(struct pt_regs *regs); 171 int (*machine_check_exception)(struct pt_regs *regs);
172 172
173 /* Called during machine check exception to retrive fixup address. */
174 bool (*mce_check_early_recovery)(struct pt_regs *regs);
175
173 /* Motherboard/chipset features. This is a kind of general purpose 176 /* Motherboard/chipset features. This is a kind of general purpose
174 * hook used to control some machine specific features (like reset 177 * hook used to control some machine specific features (like reset
175 * lines, chip power control, etc...). 178 * lines, chip power control, etc...).
@@ -279,6 +282,10 @@ struct machdep_calls {
279#ifdef CONFIG_ARCH_RANDOM 282#ifdef CONFIG_ARCH_RANDOM
280 int (*get_random_long)(unsigned long *v); 283 int (*get_random_long)(unsigned long *v);
281#endif 284#endif
285
286#ifdef CONFIG_MEMORY_HOTREMOVE
287 int (*remove_memory)(u64, u64);
288#endif
282}; 289};
283 290
284extern void e500_idle(void); 291extern void e500_idle(void);
diff --git a/arch/powerpc/include/asm/mce.h b/arch/powerpc/include/asm/mce.h
index 8e99edf6d966..f97d8cb6bdf6 100644
--- a/arch/powerpc/include/asm/mce.h
+++ b/arch/powerpc/include/asm/mce.h
@@ -187,7 +187,8 @@ struct mce_error_info {
187#define MCE_EVENT_DONTRELEASE false 187#define MCE_EVENT_DONTRELEASE false
188 188
189extern void save_mce_event(struct pt_regs *regs, long handled, 189extern void save_mce_event(struct pt_regs *regs, long handled,
190 struct mce_error_info *mce_err, uint64_t addr); 190 struct mce_error_info *mce_err, uint64_t nip,
191 uint64_t addr);
191extern int get_mce_event(struct machine_check_event *mce, bool release); 192extern int get_mce_event(struct machine_check_event *mce, bool release);
192extern void release_mce_event(void); 193extern void release_mce_event(void);
193extern void machine_check_queue_event(void); 194extern void machine_check_queue_event(void);
diff --git a/arch/powerpc/include/asm/mmu-book3e.h b/arch/powerpc/include/asm/mmu-book3e.h
index 89b785d16846..901dac6b6cb7 100644
--- a/arch/powerpc/include/asm/mmu-book3e.h
+++ b/arch/powerpc/include/asm/mmu-book3e.h
@@ -287,11 +287,14 @@ extern int mmu_linear_psize;
287extern int mmu_vmemmap_psize; 287extern int mmu_vmemmap_psize;
288 288
289struct tlb_core_data { 289struct tlb_core_data {
290 /*
291 * Per-core spinlock for e6500 TLB handlers (no tlbsrx.)
292 * Must be the first struct element.
293 */
294 u8 lock;
295
290 /* For software way selection, as on Freescale TLB1 */ 296 /* For software way selection, as on Freescale TLB1 */
291 u8 esel_next, esel_max, esel_first; 297 u8 esel_next, esel_max, esel_first;
292
293 /* Per-core spinlock for e6500 TLB handlers (no tlbsrx.) */
294 u8 lock;
295}; 298};
296 299
297#ifdef CONFIG_PPC64 300#ifdef CONFIG_PPC64
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index ed82142a3251..a2efdaa020b0 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -83,8 +83,11 @@ extern int opal_enter_rtas(struct rtas_args *args,
83#define OPAL_INTERNAL_ERROR -11 83#define OPAL_INTERNAL_ERROR -11
84#define OPAL_BUSY_EVENT -12 84#define OPAL_BUSY_EVENT -12
85#define OPAL_HARDWARE_FROZEN -13 85#define OPAL_HARDWARE_FROZEN -13
86#define OPAL_WRONG_STATE -14
87#define OPAL_ASYNC_COMPLETION -15
86 88
87/* API Tokens (in r0) */ 89/* API Tokens (in r0) */
90#define OPAL_INVALID_CALL -1
88#define OPAL_CONSOLE_WRITE 1 91#define OPAL_CONSOLE_WRITE 1
89#define OPAL_CONSOLE_READ 2 92#define OPAL_CONSOLE_READ 2
90#define OPAL_RTC_READ 3 93#define OPAL_RTC_READ 3
@@ -151,15 +154,32 @@ extern int opal_enter_rtas(struct rtas_args *args,
151#define OPAL_LPC_READ 67 154#define OPAL_LPC_READ 67
152#define OPAL_LPC_WRITE 68 155#define OPAL_LPC_WRITE 68
153#define OPAL_RETURN_CPU 69 156#define OPAL_RETURN_CPU 69
157#define OPAL_ELOG_READ 71
158#define OPAL_ELOG_WRITE 72
159#define OPAL_ELOG_ACK 73
160#define OPAL_ELOG_RESEND 74
161#define OPAL_ELOG_SIZE 75
154#define OPAL_FLASH_VALIDATE 76 162#define OPAL_FLASH_VALIDATE 76
155#define OPAL_FLASH_MANAGE 77 163#define OPAL_FLASH_MANAGE 77
156#define OPAL_FLASH_UPDATE 78 164#define OPAL_FLASH_UPDATE 78
165#define OPAL_RESYNC_TIMEBASE 79
166#define OPAL_DUMP_INIT 81
167#define OPAL_DUMP_INFO 82
168#define OPAL_DUMP_READ 83
169#define OPAL_DUMP_ACK 84
157#define OPAL_GET_MSG 85 170#define OPAL_GET_MSG 85
158#define OPAL_CHECK_ASYNC_COMPLETION 86 171#define OPAL_CHECK_ASYNC_COMPLETION 86
159#define OPAL_SYNC_HOST_REBOOT 87 172#define OPAL_SYNC_HOST_REBOOT 87
173#define OPAL_SENSOR_READ 88
174#define OPAL_GET_PARAM 89
175#define OPAL_SET_PARAM 90
176#define OPAL_DUMP_RESEND 91
177#define OPAL_DUMP_INFO2 94
160 178
161#ifndef __ASSEMBLY__ 179#ifndef __ASSEMBLY__
162 180
181#include <linux/notifier.h>
182
163/* Other enums */ 183/* Other enums */
164enum OpalVendorApiTokens { 184enum OpalVendorApiTokens {
165 OPAL_START_VENDOR_API_RANGE = 1000, OPAL_END_VENDOR_API_RANGE = 1999 185 OPAL_START_VENDOR_API_RANGE = 1000, OPAL_END_VENDOR_API_RANGE = 1999
@@ -237,11 +257,14 @@ enum OpalPendingState {
237 OPAL_EVENT_EPOW = 0x80, 257 OPAL_EVENT_EPOW = 0x80,
238 OPAL_EVENT_LED_STATUS = 0x100, 258 OPAL_EVENT_LED_STATUS = 0x100,
239 OPAL_EVENT_PCI_ERROR = 0x200, 259 OPAL_EVENT_PCI_ERROR = 0x200,
260 OPAL_EVENT_DUMP_AVAIL = 0x400,
240 OPAL_EVENT_MSG_PENDING = 0x800, 261 OPAL_EVENT_MSG_PENDING = 0x800,
241}; 262};
242 263
243enum OpalMessageType { 264enum OpalMessageType {
244 OPAL_MSG_ASYNC_COMP = 0, 265 OPAL_MSG_ASYNC_COMP = 0, /* params[0] = token, params[1] = rc,
266 * additional params function-specific
267 */
245 OPAL_MSG_MEM_ERR, 268 OPAL_MSG_MEM_ERR,
246 OPAL_MSG_EPOW, 269 OPAL_MSG_EPOW,
247 OPAL_MSG_SHUTDOWN, 270 OPAL_MSG_SHUTDOWN,
@@ -394,10 +417,17 @@ enum OpalLPCAddressType {
394 OPAL_LPC_FW = 2, 417 OPAL_LPC_FW = 2,
395}; 418};
396 419
420/* System parameter permission */
421enum OpalSysparamPerm {
422 OPAL_SYSPARAM_READ = 0x1,
423 OPAL_SYSPARAM_WRITE = 0x2,
424 OPAL_SYSPARAM_RW = (OPAL_SYSPARAM_READ | OPAL_SYSPARAM_WRITE),
425};
426
397struct opal_msg { 427struct opal_msg {
398 uint32_t msg_type; 428 __be32 msg_type;
399 uint32_t reserved; 429 __be32 reserved;
400 uint64_t params[8]; 430 __be64 params[8];
401}; 431};
402 432
403struct opal_machine_check_event { 433struct opal_machine_check_event {
@@ -703,7 +733,11 @@ typedef struct oppanel_line {
703/* /sys/firmware/opal */ 733/* /sys/firmware/opal */
704extern struct kobject *opal_kobj; 734extern struct kobject *opal_kobj;
705 735
736/* /ibm,opal */
737extern struct device_node *opal_node;
738
706/* API functions */ 739/* API functions */
740int64_t opal_invalid_call(void);
707int64_t opal_console_write(int64_t term_number, __be64 *length, 741int64_t opal_console_write(int64_t term_number, __be64 *length,
708 const uint8_t *buffer); 742 const uint8_t *buffer);
709int64_t opal_console_read(int64_t term_number, __be64 *length, 743int64_t opal_console_read(int64_t term_number, __be64 *length,
@@ -823,16 +857,36 @@ int64_t opal_lpc_write(uint32_t chip_id, enum OpalLPCAddressType addr_type,
823 uint32_t addr, uint32_t data, uint32_t sz); 857 uint32_t addr, uint32_t data, uint32_t sz);
824int64_t opal_lpc_read(uint32_t chip_id, enum OpalLPCAddressType addr_type, 858int64_t opal_lpc_read(uint32_t chip_id, enum OpalLPCAddressType addr_type,
825 uint32_t addr, __be32 *data, uint32_t sz); 859 uint32_t addr, __be32 *data, uint32_t sz);
860
861int64_t opal_read_elog(uint64_t buffer, size_t size, uint64_t log_id);
862int64_t opal_get_elog_size(uint64_t *log_id, size_t *size, uint64_t *elog_type);
863int64_t opal_write_elog(uint64_t buffer, uint64_t size, uint64_t offset);
864int64_t opal_send_ack_elog(uint64_t log_id);
865void opal_resend_pending_logs(void);
866
826int64_t opal_validate_flash(uint64_t buffer, uint32_t *size, uint32_t *result); 867int64_t opal_validate_flash(uint64_t buffer, uint32_t *size, uint32_t *result);
827int64_t opal_manage_flash(uint8_t op); 868int64_t opal_manage_flash(uint8_t op);
828int64_t opal_update_flash(uint64_t blk_list); 869int64_t opal_update_flash(uint64_t blk_list);
870int64_t opal_dump_init(uint8_t dump_type);
871int64_t opal_dump_info(uint32_t *dump_id, uint32_t *dump_size);
872int64_t opal_dump_info2(uint32_t *dump_id, uint32_t *dump_size, uint32_t *dump_type);
873int64_t opal_dump_read(uint32_t dump_id, uint64_t buffer);
874int64_t opal_dump_ack(uint32_t dump_id);
875int64_t opal_dump_resend_notification(void);
829 876
830int64_t opal_get_msg(uint64_t buffer, size_t size); 877int64_t opal_get_msg(uint64_t buffer, size_t size);
831int64_t opal_check_completion(uint64_t buffer, size_t size, uint64_t token); 878int64_t opal_check_completion(uint64_t buffer, size_t size, uint64_t token);
832int64_t opal_sync_host_reboot(void); 879int64_t opal_sync_host_reboot(void);
880int64_t opal_get_param(uint64_t token, uint32_t param_id, uint64_t buffer,
881 size_t length);
882int64_t opal_set_param(uint64_t token, uint32_t param_id, uint64_t buffer,
883 size_t length);
884int64_t opal_sensor_read(uint32_t sensor_hndl, int token, __be32 *sensor_data);
833 885
834/* Internal functions */ 886/* Internal functions */
835extern int early_init_dt_scan_opal(unsigned long node, const char *uname, int depth, void *data); 887extern int early_init_dt_scan_opal(unsigned long node, const char *uname, int depth, void *data);
888extern int early_init_dt_scan_recoverable_ranges(unsigned long node,
889 const char *uname, int depth, void *data);
836 890
837extern int opal_get_chars(uint32_t vtermno, char *buf, int count); 891extern int opal_get_chars(uint32_t vtermno, char *buf, int count);
838extern int opal_put_chars(uint32_t vtermno, const char *buf, int total_len); 892extern int opal_put_chars(uint32_t vtermno, const char *buf, int total_len);
@@ -844,6 +898,8 @@ extern int early_init_dt_scan_opal(unsigned long node, const char *uname,
844 int depth, void *data); 898 int depth, void *data);
845 899
846extern int opal_notifier_register(struct notifier_block *nb); 900extern int opal_notifier_register(struct notifier_block *nb);
901extern int opal_notifier_unregister(struct notifier_block *nb);
902
847extern int opal_message_notifier_register(enum OpalMessageType msg_type, 903extern int opal_message_notifier_register(enum OpalMessageType msg_type,
848 struct notifier_block *nb); 904 struct notifier_block *nb);
849extern void opal_notifier_enable(void); 905extern void opal_notifier_enable(void);
@@ -853,6 +909,13 @@ extern void opal_notifier_update_evt(uint64_t evt_mask, uint64_t evt_val);
853extern int opal_get_chars(uint32_t vtermno, char *buf, int count); 909extern int opal_get_chars(uint32_t vtermno, char *buf, int count);
854extern int opal_put_chars(uint32_t vtermno, const char *buf, int total_len); 910extern int opal_put_chars(uint32_t vtermno, const char *buf, int total_len);
855 911
912extern int __opal_async_get_token(void);
913extern int opal_async_get_token_interruptible(void);
914extern int __opal_async_release_token(int token);
915extern int opal_async_release_token(int token);
916extern int opal_async_wait_response(uint64_t token, struct opal_msg *msg);
917extern int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data);
918
856extern void hvc_opal_init_early(void); 919extern void hvc_opal_init_early(void);
857 920
858struct rtc_time; 921struct rtc_time;
@@ -861,10 +924,16 @@ extern void opal_get_rtc_time(struct rtc_time *tm);
861extern unsigned long opal_get_boot_time(void); 924extern unsigned long opal_get_boot_time(void);
862extern void opal_nvram_init(void); 925extern void opal_nvram_init(void);
863extern void opal_flash_init(void); 926extern void opal_flash_init(void);
927extern int opal_elog_init(void);
928extern void opal_platform_dump_init(void);
929extern void opal_sys_param_init(void);
930extern void opal_msglog_init(void);
864 931
865extern int opal_machine_check(struct pt_regs *regs); 932extern int opal_machine_check(struct pt_regs *regs);
933extern bool opal_mce_check_early_recovery(struct pt_regs *regs);
866 934
867extern void opal_shutdown(void); 935extern void opal_shutdown(void);
936extern int opal_resync_timebase(void);
868 937
869extern void opal_lpc_init(void); 938extern void opal_lpc_init(void);
870 939
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index 9c5dbc3833fb..8e956a0b6e85 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -116,8 +116,11 @@ struct paca_struct {
116 /* Shared by all threads of a core -- points to tcd of first thread */ 116 /* Shared by all threads of a core -- points to tcd of first thread */
117 struct tlb_core_data *tcd_ptr; 117 struct tlb_core_data *tcd_ptr;
118 118
119 /* We can have up to 3 levels of reentrancy in the TLB miss handler */ 119 /*
120 u64 extlb[3][EX_TLB_SIZE / sizeof(u64)]; 120 * We can have up to 3 levels of reentrancy in the TLB miss handler,
121 * in each of four exception levels (normal, crit, mcheck, debug).
122 */
123 u64 extlb[12][EX_TLB_SIZE / sizeof(u64)];
121 u64 exmc[8]; /* used for machine checks */ 124 u64 exmc[8]; /* used for machine checks */
122 u64 excrit[8]; /* used for crit interrupts */ 125 u64 excrit[8]; /* used for crit interrupts */
123 u64 exdbg[8]; /* used for debug interrupts */ 126 u64 exdbg[8]; /* used for debug interrupts */
@@ -146,7 +149,7 @@ struct paca_struct {
146 u8 io_sync; /* writel() needs spin_unlock sync */ 149 u8 io_sync; /* writel() needs spin_unlock sync */
147 u8 irq_work_pending; /* IRQ_WORK interrupt while soft-disable */ 150 u8 irq_work_pending; /* IRQ_WORK interrupt while soft-disable */
148 u8 nap_state_lost; /* NV GPR values lost in power7_idle */ 151 u8 nap_state_lost; /* NV GPR values lost in power7_idle */
149 u64 sprg3; /* Saved user-visible sprg */ 152 u64 sprg_vdso; /* Saved user-visible sprg */
150#ifdef CONFIG_PPC_TRANSACTIONAL_MEM 153#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
151 u64 tm_scratch; /* TM scratch area for reclaim */ 154 u64 tm_scratch; /* TM scratch area for reclaim */
152#endif 155#endif
diff --git a/arch/powerpc/include/asm/perf_event_server.h b/arch/powerpc/include/asm/perf_event_server.h
index 3fd2f1b6f906..9ed737146dbb 100644
--- a/arch/powerpc/include/asm/perf_event_server.h
+++ b/arch/powerpc/include/asm/perf_event_server.h
@@ -14,6 +14,7 @@
14#include <linux/device.h> 14#include <linux/device.h>
15#include <uapi/asm/perf_event.h> 15#include <uapi/asm/perf_event.h>
16 16
17/* Update perf_event_print_debug() if this changes */
17#define MAX_HWEVENTS 8 18#define MAX_HWEVENTS 8
18#define MAX_EVENT_ALTERNATIVES 8 19#define MAX_EVENT_ALTERNATIVES 8
19#define MAX_LIMITED_HWCOUNTERS 2 20#define MAX_LIMITED_HWCOUNTERS 2
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index b62de43ae5f3..d660dc36831a 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -450,6 +450,7 @@ enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF};
450 450
451extern int powersave_nap; /* set if nap mode can be used in idle loop */ 451extern int powersave_nap; /* set if nap mode can be used in idle loop */
452extern void power7_nap(void); 452extern void power7_nap(void);
453extern void power7_sleep(void);
453extern void flush_instruction_cache(void); 454extern void flush_instruction_cache(void);
454extern void hard_reset_now(void); 455extern void hard_reset_now(void);
455extern void poweroff_now(void); 456extern void poweroff_now(void);
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 90c06ec6eff5..e5d2e0bc7e03 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -213,6 +213,7 @@
213#define SPRN_ACOP 0x1F /* Available Coprocessor Register */ 213#define SPRN_ACOP 0x1F /* Available Coprocessor Register */
214#define SPRN_TFIAR 0x81 /* Transaction Failure Inst Addr */ 214#define SPRN_TFIAR 0x81 /* Transaction Failure Inst Addr */
215#define SPRN_TEXASR 0x82 /* Transaction EXception & Summary */ 215#define SPRN_TEXASR 0x82 /* Transaction EXception & Summary */
216#define TEXASR_FS __MASK(63-36) /* Transaction Failure Summary */
216#define SPRN_TEXASRU 0x83 /* '' '' '' Upper 32 */ 217#define SPRN_TEXASRU 0x83 /* '' '' '' Upper 32 */
217#define SPRN_TFHAR 0x80 /* Transaction Failure Handler Addr */ 218#define SPRN_TFHAR 0x80 /* Transaction Failure Handler Addr */
218#define SPRN_CTRLF 0x088 219#define SPRN_CTRLF 0x088
@@ -271,6 +272,10 @@
271#define SPRN_HSRR1 0x13B /* Hypervisor Save/Restore 1 */ 272#define SPRN_HSRR1 0x13B /* Hypervisor Save/Restore 1 */
272#define SPRN_IC 0x350 /* Virtual Instruction Count */ 273#define SPRN_IC 0x350 /* Virtual Instruction Count */
273#define SPRN_VTB 0x351 /* Virtual Time Base */ 274#define SPRN_VTB 0x351 /* Virtual Time Base */
275#define SPRN_PMICR 0x354 /* Power Management Idle Control Reg */
276#define SPRN_PMSR 0x355 /* Power Management Status Reg */
277#define SPRN_PMCR 0x374 /* Power Management Control Register */
278
274/* HFSCR and FSCR bit numbers are the same */ 279/* HFSCR and FSCR bit numbers are the same */
275#define FSCR_TAR_LG 8 /* Enable Target Address Register */ 280#define FSCR_TAR_LG 8 /* Enable Target Address Register */
276#define FSCR_EBB_LG 7 /* Enable Event Based Branching */ 281#define FSCR_EBB_LG 7 /* Enable Event Based Branching */
@@ -577,9 +582,13 @@
577#define SPRN_SPRG3 0x113 /* Special Purpose Register General 3 */ 582#define SPRN_SPRG3 0x113 /* Special Purpose Register General 3 */
578#define SPRN_USPRG3 0x103 /* SPRG3 userspace read */ 583#define SPRN_USPRG3 0x103 /* SPRG3 userspace read */
579#define SPRN_SPRG4 0x114 /* Special Purpose Register General 4 */ 584#define SPRN_SPRG4 0x114 /* Special Purpose Register General 4 */
585#define SPRN_USPRG4 0x104 /* SPRG4 userspace read */
580#define SPRN_SPRG5 0x115 /* Special Purpose Register General 5 */ 586#define SPRN_SPRG5 0x115 /* Special Purpose Register General 5 */
587#define SPRN_USPRG5 0x105 /* SPRG5 userspace read */
581#define SPRN_SPRG6 0x116 /* Special Purpose Register General 6 */ 588#define SPRN_SPRG6 0x116 /* Special Purpose Register General 6 */
589#define SPRN_USPRG6 0x106 /* SPRG6 userspace read */
582#define SPRN_SPRG7 0x117 /* Special Purpose Register General 7 */ 590#define SPRN_SPRG7 0x117 /* Special Purpose Register General 7 */
591#define SPRN_USPRG7 0x107 /* SPRG7 userspace read */
583#define SPRN_SRR0 0x01A /* Save/Restore Register 0 */ 592#define SPRN_SRR0 0x01A /* Save/Restore Register 0 */
584#define SPRN_SRR1 0x01B /* Save/Restore Register 1 */ 593#define SPRN_SRR1 0x01B /* Save/Restore Register 1 */
585#define SRR1_ISI_NOPT 0x40000000 /* ISI: Not found in hash */ 594#define SRR1_ISI_NOPT 0x40000000 /* ISI: Not found in hash */
@@ -664,12 +673,14 @@
664#define MMCR0_PMXE 0x04000000UL /* performance monitor exception enable */ 673#define MMCR0_PMXE 0x04000000UL /* performance monitor exception enable */
665#define MMCR0_FCECE 0x02000000UL /* freeze ctrs on enabled cond or event */ 674#define MMCR0_FCECE 0x02000000UL /* freeze ctrs on enabled cond or event */
666#define MMCR0_TBEE 0x00400000UL /* time base exception enable */ 675#define MMCR0_TBEE 0x00400000UL /* time base exception enable */
676#define MMCR0_BHRBA 0x00200000UL /* BHRB Access allowed in userspace */
667#define MMCR0_EBE 0x00100000UL /* Event based branch enable */ 677#define MMCR0_EBE 0x00100000UL /* Event based branch enable */
668#define MMCR0_PMCC 0x000c0000UL /* PMC control */ 678#define MMCR0_PMCC 0x000c0000UL /* PMC control */
669#define MMCR0_PMCC_U6 0x00080000UL /* PMC1-6 are R/W by user (PR) */ 679#define MMCR0_PMCC_U6 0x00080000UL /* PMC1-6 are R/W by user (PR) */
670#define MMCR0_PMC1CE 0x00008000UL /* PMC1 count enable*/ 680#define MMCR0_PMC1CE 0x00008000UL /* PMC1 count enable*/
671#define MMCR0_PMCjCE 0x00004000UL /* PMCj count enable*/ 681#define MMCR0_PMCjCE 0x00004000UL /* PMCj count enable*/
672#define MMCR0_TRIGGER 0x00002000UL /* TRIGGER enable */ 682#define MMCR0_TRIGGER 0x00002000UL /* TRIGGER enable */
683#define MMCR0_PMAO_SYNC 0x00000800UL /* PMU interrupt is synchronous */
673#define MMCR0_PMAO 0x00000080UL /* performance monitor alert has occurred, set to 0 after handling exception */ 684#define MMCR0_PMAO 0x00000080UL /* performance monitor alert has occurred, set to 0 after handling exception */
674#define MMCR0_SHRFC 0x00000040UL /* SHRre freeze conditions between threads */ 685#define MMCR0_SHRFC 0x00000040UL /* SHRre freeze conditions between threads */
675#define MMCR0_FC56 0x00000010UL /* freeze counters 5 and 6 */ 686#define MMCR0_FC56 0x00000010UL /* freeze counters 5 and 6 */
@@ -703,6 +714,7 @@
703#define SPRN_EBBHR 804 /* Event based branch handler register */ 714#define SPRN_EBBHR 804 /* Event based branch handler register */
704#define SPRN_EBBRR 805 /* Event based branch return register */ 715#define SPRN_EBBRR 805 /* Event based branch return register */
705#define SPRN_BESCR 806 /* Branch event status and control register */ 716#define SPRN_BESCR 806 /* Branch event status and control register */
717#define BESCR_GE 0x8000000000000000ULL /* Global Enable */
706#define SPRN_WORT 895 /* Workload optimization register - thread */ 718#define SPRN_WORT 895 /* Workload optimization register - thread */
707 719
708#define SPRN_PMC1 787 720#define SPRN_PMC1 787
@@ -879,11 +891,10 @@
879 * 64-bit embedded 891 * 64-bit embedded
880 * - SPRG0 generic exception scratch 892 * - SPRG0 generic exception scratch
881 * - SPRG2 TLB exception stack 893 * - SPRG2 TLB exception stack
882 * - SPRG3 critical exception scratch and 894 * - SPRG3 critical exception scratch (user visible, sorry!)
883 * CPU and NUMA node for VDSO getcpu (user visible)
884 * - SPRG4 unused (user visible) 895 * - SPRG4 unused (user visible)
885 * - SPRG6 TLB miss scratch (user visible, sorry !) 896 * - SPRG6 TLB miss scratch (user visible, sorry !)
886 * - SPRG7 critical exception scratch 897 * - SPRG7 CPU and NUMA node for VDSO getcpu (user visible)
887 * - SPRG8 machine check exception scratch 898 * - SPRG8 machine check exception scratch
888 * - SPRG9 debug exception scratch 899 * - SPRG9 debug exception scratch
889 * 900 *
@@ -940,6 +951,8 @@
940#define SPRN_SPRG_SCRATCH0 SPRN_SPRG2 951#define SPRN_SPRG_SCRATCH0 SPRN_SPRG2
941#define SPRN_SPRG_HPACA SPRN_HSPRG0 952#define SPRN_SPRG_HPACA SPRN_HSPRG0
942#define SPRN_SPRG_HSCRATCH0 SPRN_HSPRG1 953#define SPRN_SPRG_HSCRATCH0 SPRN_HSPRG1
954#define SPRN_SPRG_VDSO_READ SPRN_USPRG3
955#define SPRN_SPRG_VDSO_WRITE SPRN_SPRG3
943 956
944#define GET_PACA(rX) \ 957#define GET_PACA(rX) \
945 BEGIN_FTR_SECTION_NESTED(66); \ 958 BEGIN_FTR_SECTION_NESTED(66); \
@@ -983,6 +996,8 @@
983#define SPRN_SPRG_TLB_SCRATCH SPRN_SPRG6 996#define SPRN_SPRG_TLB_SCRATCH SPRN_SPRG6
984#define SPRN_SPRG_GEN_SCRATCH SPRN_SPRG0 997#define SPRN_SPRG_GEN_SCRATCH SPRN_SPRG0
985#define SPRN_SPRG_GDBELL_SCRATCH SPRN_SPRG_GEN_SCRATCH 998#define SPRN_SPRG_GDBELL_SCRATCH SPRN_SPRG_GEN_SCRATCH
999#define SPRN_SPRG_VDSO_READ SPRN_USPRG7
1000#define SPRN_SPRG_VDSO_WRITE SPRN_SPRG7
986 1001
987#define SET_PACA(rX) mtspr SPRN_SPRG_PACA,rX 1002#define SET_PACA(rX) mtspr SPRN_SPRG_PACA,rX
988#define GET_PACA(rX) mfspr rX,SPRN_SPRG_PACA 1003#define GET_PACA(rX) mfspr rX,SPRN_SPRG_PACA
@@ -1102,6 +1117,8 @@
1102#define PVR_8560 0x80200000 1117#define PVR_8560 0x80200000
1103#define PVR_VER_E500V1 0x8020 1118#define PVR_VER_E500V1 0x8020
1104#define PVR_VER_E500V2 0x8021 1119#define PVR_VER_E500V2 0x8021
1120#define PVR_VER_E500MC 0x8023
1121#define PVR_VER_E5500 0x8024
1105#define PVR_VER_E6500 0x8040 1122#define PVR_VER_E6500 0x8040
1106 1123
1107/* 1124/*
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 9bd52c65e66f..b390f55b0df1 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -150,19 +150,53 @@ struct rtas_suspend_me_data {
150#define RTAS_VECTOR_EXTERNAL_INTERRUPT 0x500 150#define RTAS_VECTOR_EXTERNAL_INTERRUPT 0x500
151 151
152struct rtas_error_log { 152struct rtas_error_log {
153 unsigned long version:8; /* Architectural version */ 153 /* Byte 0 */
154 unsigned long severity:3; /* Severity level of error */ 154 uint8_t byte0; /* Architectural version */
155 unsigned long disposition:2; /* Degree of recovery */ 155
156 unsigned long extended:1; /* extended log present? */ 156 /* Byte 1 */
157 unsigned long /* reserved */ :2; /* Reserved for future use */ 157 uint8_t byte1;
158 unsigned long initiator:4; /* Initiator of event */ 158 /* XXXXXXXX
159 unsigned long target:4; /* Target of failed operation */ 159 * XXX 3: Severity level of error
160 unsigned long type:8; /* General event or error*/ 160 * XX 2: Degree of recovery
161 unsigned long extended_log_length:32; /* length in bytes */ 161 * X 1: Extended log present?
162 unsigned char buffer[1]; /* Start of extended log */ 162 * XX 2: Reserved
163 */
164
165 /* Byte 2 */
166 uint8_t byte2;
167 /* XXXXXXXX
168 * XXXX 4: Initiator of event
169 * XXXX 4: Target of failed operation
170 */
171 uint8_t byte3; /* General event or error*/
172 __be32 extended_log_length; /* length in bytes */
173 unsigned char buffer[1]; /* Start of extended log */
163 /* Variable length. */ 174 /* Variable length. */
164}; 175};
165 176
177static inline uint8_t rtas_error_severity(const struct rtas_error_log *elog)
178{
179 return (elog->byte1 & 0xE0) >> 5;
180}
181
182static inline uint8_t rtas_error_disposition(const struct rtas_error_log *elog)
183{
184 return (elog->byte1 & 0x18) >> 3;
185}
186
187static inline uint8_t rtas_error_extended(const struct rtas_error_log *elog)
188{
189 return (elog->byte1 & 0x04) >> 2;
190}
191
192#define rtas_error_type(x) ((x)->byte3)
193
194static inline
195uint32_t rtas_error_extended_log_length(const struct rtas_error_log *elog)
196{
197 return be32_to_cpu(elog->extended_log_length);
198}
199
166#define RTAS_V6EXT_LOG_FORMAT_EVENT_LOG 14 200#define RTAS_V6EXT_LOG_FORMAT_EVENT_LOG 14
167 201
168#define RTAS_V6EXT_COMPANY_ID_IBM (('I' << 24) | ('B' << 16) | ('M' << 8)) 202#define RTAS_V6EXT_COMPANY_ID_IBM (('I' << 24) | ('B' << 16) | ('M' << 8))
@@ -172,32 +206,35 @@ struct rtas_error_log {
172 */ 206 */
173struct rtas_ext_event_log_v6 { 207struct rtas_ext_event_log_v6 {
174 /* Byte 0 */ 208 /* Byte 0 */
175 uint32_t log_valid:1; /* 1:Log valid */ 209 uint8_t byte0;
176 uint32_t unrecoverable_error:1; /* 1:Unrecoverable error */ 210 /* XXXXXXXX
177 uint32_t recoverable_error:1; /* 1:recoverable (correctable */ 211 * X 1: Log valid
178 /* or successfully retried) */ 212 * X 1: Unrecoverable error
179 uint32_t degraded_operation:1; /* 1:Unrecoverable err, bypassed*/ 213 * X 1: Recoverable (correctable or successfully retried)
180 /* - degraded operation (e.g. */ 214 * X 1: Bypassed unrecoverable error (degraded operation)
181 /* CPU or mem taken off-line) */ 215 * X 1: Predictive error
182 uint32_t predictive_error:1; 216 * X 1: "New" log (always 1 for data returned from RTAS)
183 uint32_t new_log:1; /* 1:"New" log (Always 1 for */ 217 * X 1: Big Endian
184 /* data returned from RTAS */ 218 * X 1: Reserved
185 uint32_t big_endian:1; /* 1: Big endian */ 219 */
186 uint32_t :1; /* reserved */ 220
187 /* Byte 1 */ 221 /* Byte 1 */
188 uint32_t :8; /* reserved */ 222 uint8_t byte1; /* reserved */
223
189 /* Byte 2 */ 224 /* Byte 2 */
190 uint32_t powerpc_format:1; /* Set to 1 (indicating log is */ 225 uint8_t byte2;
191 /* in PowerPC format */ 226 /* XXXXXXXX
192 uint32_t :3; /* reserved */ 227 * X 1: Set to 1 (indicating log is in PowerPC format)
193 uint32_t log_format:4; /* Log format indicator. Define */ 228 * XXX 3: Reserved
194 /* format used for byte 12-2047 */ 229 * XXXX 4: Log format used for bytes 12-2047
230 */
231
195 /* Byte 3 */ 232 /* Byte 3 */
196 uint32_t :8; /* reserved */ 233 uint8_t byte3; /* reserved */
197 /* Byte 4-11 */ 234 /* Byte 4-11 */
198 uint8_t reserved[8]; /* reserved */ 235 uint8_t reserved[8]; /* reserved */
199 /* Byte 12-15 */ 236 /* Byte 12-15 */
200 uint32_t company_id; /* Company ID of the company */ 237 __be32 company_id; /* Company ID of the company */
201 /* that defines the format for */ 238 /* that defines the format for */
202 /* the vendor specific log type */ 239 /* the vendor specific log type */
203 /* Byte 16-end of log */ 240 /* Byte 16-end of log */
@@ -205,6 +242,18 @@ struct rtas_ext_event_log_v6 {
205 /* Variable length. */ 242 /* Variable length. */
206}; 243};
207 244
245static
246inline uint8_t rtas_ext_event_log_format(struct rtas_ext_event_log_v6 *ext_log)
247{
248 return ext_log->byte2 & 0x0F;
249}
250
251static
252inline uint32_t rtas_ext_event_company_id(struct rtas_ext_event_log_v6 *ext_log)
253{
254 return be32_to_cpu(ext_log->company_id);
255}
256
208/* pSeries event log format */ 257/* pSeries event log format */
209 258
210/* Two bytes ASCII section IDs */ 259/* Two bytes ASCII section IDs */
@@ -227,14 +276,26 @@ struct rtas_ext_event_log_v6 {
227 276
228/* Vendor specific Platform Event Log Format, Version 6, section header */ 277/* Vendor specific Platform Event Log Format, Version 6, section header */
229struct pseries_errorlog { 278struct pseries_errorlog {
230 uint16_t id; /* 0x00 2-byte ASCII section ID */ 279 __be16 id; /* 0x00 2-byte ASCII section ID */
231 uint16_t length; /* 0x02 Section length in bytes */ 280 __be16 length; /* 0x02 Section length in bytes */
232 uint8_t version; /* 0x04 Section version */ 281 uint8_t version; /* 0x04 Section version */
233 uint8_t subtype; /* 0x05 Section subtype */ 282 uint8_t subtype; /* 0x05 Section subtype */
234 uint16_t creator_component; /* 0x06 Creator component ID */ 283 __be16 creator_component; /* 0x06 Creator component ID */
235 uint8_t data[]; /* 0x08 Start of section data */ 284 uint8_t data[]; /* 0x08 Start of section data */
236}; 285};
237 286
287static
288inline uint16_t pseries_errorlog_id(struct pseries_errorlog *sect)
289{
290 return be16_to_cpu(sect->id);
291}
292
293static
294inline uint16_t pseries_errorlog_length(struct pseries_errorlog *sect)
295{
296 return be16_to_cpu(sect->length);
297}
298
238struct pseries_errorlog *get_pseries_errorlog(struct rtas_error_log *log, 299struct pseries_errorlog *get_pseries_errorlog(struct rtas_error_log *log,
239 uint16_t section_id); 300 uint16_t section_id);
240 301
@@ -283,6 +344,7 @@ extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal);
283 344
284#ifdef CONFIG_PPC_PSERIES 345#ifdef CONFIG_PPC_PSERIES
285extern int pseries_devicetree_update(s32 scope); 346extern int pseries_devicetree_update(s32 scope);
347extern void post_mobility_fixup(void);
286#endif 348#endif
287 349
288#ifdef CONFIG_PPC_RTAS_DAEMON 350#ifdef CONFIG_PPC_RTAS_DAEMON
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index 084e0807db98..ff51046b6466 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -120,7 +120,7 @@ extern int cpu_to_core_id(int cpu);
120 * in /proc/interrupts will be wrong!!! --Troy */ 120 * in /proc/interrupts will be wrong!!! --Troy */
121#define PPC_MSG_CALL_FUNCTION 0 121#define PPC_MSG_CALL_FUNCTION 0
122#define PPC_MSG_RESCHEDULE 1 122#define PPC_MSG_RESCHEDULE 1
123#define PPC_MSG_CALL_FUNC_SINGLE 2 123#define PPC_MSG_TICK_BROADCAST 2
124#define PPC_MSG_DEBUGGER_BREAK 3 124#define PPC_MSG_DEBUGGER_BREAK 3
125 125
126/* for irq controllers that have dedicated ipis per message (4) */ 126/* for irq controllers that have dedicated ipis per message (4) */
diff --git a/arch/powerpc/include/asm/time.h b/arch/powerpc/include/asm/time.h
index c1f267694acb..1d428e6007ca 100644
--- a/arch/powerpc/include/asm/time.h
+++ b/arch/powerpc/include/asm/time.h
@@ -28,6 +28,7 @@ extern struct clock_event_device decrementer_clockevent;
28struct rtc_time; 28struct rtc_time;
29extern void to_tm(int tim, struct rtc_time * tm); 29extern void to_tm(int tim, struct rtc_time * tm);
30extern void GregorianDay(struct rtc_time *tm); 30extern void GregorianDay(struct rtc_time *tm);
31extern void tick_broadcast_ipi_handler(void);
31 32
32extern void generic_calibrate_decr(void); 33extern void generic_calibrate_decr(void);
33 34
diff --git a/arch/powerpc/include/asm/tm.h b/arch/powerpc/include/asm/tm.h
index 0c9f8b74dd97..c22d704b6d41 100644
--- a/arch/powerpc/include/asm/tm.h
+++ b/arch/powerpc/include/asm/tm.h
@@ -7,6 +7,8 @@
7 7
8#include <uapi/asm/tm.h> 8#include <uapi/asm/tm.h>
9 9
10#ifndef __ASSEMBLY__
11
10#ifdef CONFIG_PPC_TRANSACTIONAL_MEM 12#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
11extern void do_load_up_transact_fpu(struct thread_struct *thread); 13extern void do_load_up_transact_fpu(struct thread_struct *thread);
12extern void do_load_up_transact_altivec(struct thread_struct *thread); 14extern void do_load_up_transact_altivec(struct thread_struct *thread);
@@ -21,3 +23,5 @@ extern void tm_recheckpoint(struct thread_struct *thread,
21extern void tm_abort(uint8_t cause); 23extern void tm_abort(uint8_t cause);
22extern void tm_save_sprs(struct thread_struct *thread); 24extern void tm_save_sprs(struct thread_struct *thread);
23extern void tm_restore_sprs(struct thread_struct *thread); 25extern void tm_restore_sprs(struct thread_struct *thread);
26
27#endif /* __ASSEMBLY__ */
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c
index de91f3ae631e..94908af308d8 100644
--- a/arch/powerpc/kernel/align.c
+++ b/arch/powerpc/kernel/align.c
@@ -73,7 +73,7 @@ static struct aligninfo aligninfo[128] = {
73 { 8, LD+F }, /* 00 0 1001: lfd */ 73 { 8, LD+F }, /* 00 0 1001: lfd */
74 { 4, ST+F+S }, /* 00 0 1010: stfs */ 74 { 4, ST+F+S }, /* 00 0 1010: stfs */
75 { 8, ST+F }, /* 00 0 1011: stfd */ 75 { 8, ST+F }, /* 00 0 1011: stfd */
76 INVALID, /* 00 0 1100 */ 76 { 16, LD }, /* 00 0 1100: lq */
77 { 8, LD }, /* 00 0 1101: ld/ldu/lwa */ 77 { 8, LD }, /* 00 0 1101: ld/ldu/lwa */
78 INVALID, /* 00 0 1110 */ 78 INVALID, /* 00 0 1110 */
79 { 8, ST }, /* 00 0 1111: std/stdu */ 79 { 8, ST }, /* 00 0 1111: std/stdu */
@@ -140,7 +140,7 @@ static struct aligninfo aligninfo[128] = {
140 { 2, LD+SW }, /* 10 0 1100: lhbrx */ 140 { 2, LD+SW }, /* 10 0 1100: lhbrx */
141 { 4, LD+SE }, /* 10 0 1101 lwa */ 141 { 4, LD+SE }, /* 10 0 1101 lwa */
142 { 2, ST+SW }, /* 10 0 1110: sthbrx */ 142 { 2, ST+SW }, /* 10 0 1110: sthbrx */
143 INVALID, /* 10 0 1111 */ 143 { 16, ST }, /* 10 0 1111: stq */
144 INVALID, /* 10 1 0000 */ 144 INVALID, /* 10 1 0000 */
145 INVALID, /* 10 1 0001 */ 145 INVALID, /* 10 1 0001 */
146 INVALID, /* 10 1 0010 */ 146 INVALID, /* 10 1 0010 */
@@ -385,8 +385,6 @@ static int emulate_fp_pair(unsigned char __user *addr, unsigned int reg,
385 char *ptr1 = (char *) &current->thread.TS_FPR(reg+1); 385 char *ptr1 = (char *) &current->thread.TS_FPR(reg+1);
386 int i, ret, sw = 0; 386 int i, ret, sw = 0;
387 387
388 if (!(flags & F))
389 return 0;
390 if (reg & 1) 388 if (reg & 1)
391 return 0; /* invalid form: FRS/FRT must be even */ 389 return 0; /* invalid form: FRS/FRT must be even */
392 if (flags & SW) 390 if (flags & SW)
@@ -406,6 +404,34 @@ static int emulate_fp_pair(unsigned char __user *addr, unsigned int reg,
406 return 1; /* exception handled and fixed up */ 404 return 1; /* exception handled and fixed up */
407} 405}
408 406
407#ifdef CONFIG_PPC64
408static int emulate_lq_stq(struct pt_regs *regs, unsigned char __user *addr,
409 unsigned int reg, unsigned int flags)
410{
411 char *ptr0 = (char *)&regs->gpr[reg];
412 char *ptr1 = (char *)&regs->gpr[reg+1];
413 int i, ret, sw = 0;
414
415 if (reg & 1)
416 return 0; /* invalid form: GPR must be even */
417 if (flags & SW)
418 sw = 7;
419 ret = 0;
420 for (i = 0; i < 8; ++i) {
421 if (!(flags & ST)) {
422 ret |= __get_user(ptr0[i^sw], addr + i);
423 ret |= __get_user(ptr1[i^sw], addr + i + 8);
424 } else {
425 ret |= __put_user(ptr0[i^sw], addr + i);
426 ret |= __put_user(ptr1[i^sw], addr + i + 8);
427 }
428 }
429 if (ret)
430 return -EFAULT;
431 return 1; /* exception handled and fixed up */
432}
433#endif /* CONFIG_PPC64 */
434
409#ifdef CONFIG_SPE 435#ifdef CONFIG_SPE
410 436
411static struct aligninfo spe_aligninfo[32] = { 437static struct aligninfo spe_aligninfo[32] = {
@@ -914,10 +940,20 @@ int fix_alignment(struct pt_regs *regs)
914 flush_fp_to_thread(current); 940 flush_fp_to_thread(current);
915 } 941 }
916 942
917 /* Special case for 16-byte FP loads and stores */ 943 if ((nb == 16)) {
918 if (nb == 16) { 944 if (flags & F) {
919 PPC_WARN_ALIGNMENT(fp_pair, regs); 945 /* Special case for 16-byte FP loads and stores */
920 return emulate_fp_pair(addr, reg, flags); 946 PPC_WARN_ALIGNMENT(fp_pair, regs);
947 return emulate_fp_pair(addr, reg, flags);
948 } else {
949#ifdef CONFIG_PPC64
950 /* Special case for 16-byte loads and stores */
951 PPC_WARN_ALIGNMENT(lq_stq, regs);
952 return emulate_lq_stq(regs, addr, reg, flags);
953#else
954 return 0;
955#endif
956 }
921 } 957 }
922 958
923 PPC_WARN_ALIGNMENT(unaligned, regs); 959 PPC_WARN_ALIGNMENT(unaligned, regs);
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index b5aacf72ae6f..dba8140ebc20 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -253,7 +253,7 @@ int main(void)
253 DEFINE(PACA_SYSTEM_TIME, offsetof(struct paca_struct, system_time)); 253 DEFINE(PACA_SYSTEM_TIME, offsetof(struct paca_struct, system_time));
254 DEFINE(PACA_TRAP_SAVE, offsetof(struct paca_struct, trap_save)); 254 DEFINE(PACA_TRAP_SAVE, offsetof(struct paca_struct, trap_save));
255 DEFINE(PACA_NAPSTATELOST, offsetof(struct paca_struct, nap_state_lost)); 255 DEFINE(PACA_NAPSTATELOST, offsetof(struct paca_struct, nap_state_lost));
256 DEFINE(PACA_SPRG3, offsetof(struct paca_struct, sprg3)); 256 DEFINE(PACA_SPRG_VDSO, offsetof(struct paca_struct, sprg_vdso));
257#endif /* CONFIG_PPC64 */ 257#endif /* CONFIG_PPC64 */
258 258
259 /* RTAS */ 259 /* RTAS */
diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c
index 2912b8787aa4..40198d50b4c2 100644
--- a/arch/powerpc/kernel/cacheinfo.c
+++ b/arch/powerpc/kernel/cacheinfo.c
@@ -756,7 +756,10 @@ void cacheinfo_cpu_online(unsigned int cpu_id)
756 cacheinfo_sysfs_populate(cpu_id, cache); 756 cacheinfo_sysfs_populate(cpu_id, cache);
757} 757}
758 758
759#ifdef CONFIG_HOTPLUG_CPU /* functions needed for cpu offline */ 759/* functions needed to remove cache entry for cpu offline or suspend/resume */
760
761#if (defined(CONFIG_PPC_PSERIES) && defined(CONFIG_SUSPEND)) || \
762 defined(CONFIG_HOTPLUG_CPU)
760 763
761static struct cache *cache_lookup_by_cpu(unsigned int cpu_id) 764static struct cache *cache_lookup_by_cpu(unsigned int cpu_id)
762{ 765{
@@ -843,4 +846,4 @@ void cacheinfo_cpu_offline(unsigned int cpu_id)
843 if (cache) 846 if (cache)
844 cache_cpu_clear(cache, cpu_id); 847 cache_cpu_clear(cache, cpu_id);
845} 848}
846#endif /* CONFIG_HOTPLUG_CPU */ 849#endif /* (CONFIG_PPC_PSERIES && CONFIG_SUSPEND) || CONFIG_HOTPLUG_CPU */
diff --git a/arch/powerpc/kernel/cpu_setup_power.S b/arch/powerpc/kernel/cpu_setup_power.S
index 37d1bb002aa9..1557e7c2c7e1 100644
--- a/arch/powerpc/kernel/cpu_setup_power.S
+++ b/arch/powerpc/kernel/cpu_setup_power.S
@@ -56,7 +56,6 @@ _GLOBAL(__setup_cpu_power8)
56 li r0,0 56 li r0,0
57 mtspr SPRN_LPID,r0 57 mtspr SPRN_LPID,r0
58 mfspr r3,SPRN_LPCR 58 mfspr r3,SPRN_LPCR
59 oris r3, r3, LPCR_AIL_3@h
60 bl __init_LPCR 59 bl __init_LPCR
61 bl __init_HFSCR 60 bl __init_HFSCR
62 bl __init_tlb_power8 61 bl __init_tlb_power8
@@ -75,7 +74,6 @@ _GLOBAL(__restore_cpu_power8)
75 li r0,0 74 li r0,0
76 mtspr SPRN_LPID,r0 75 mtspr SPRN_LPID,r0
77 mfspr r3,SPRN_LPCR 76 mfspr r3,SPRN_LPCR
78 oris r3, r3, LPCR_AIL_3@h
79 bl __init_LPCR 77 bl __init_LPCR
80 bl __init_HFSCR 78 bl __init_HFSCR
81 bl __init_tlb_power8 79 bl __init_tlb_power8
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 6c8dd5da4de5..c1faade6506d 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -510,7 +510,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
510 .pvr_mask = 0xffff0000, 510 .pvr_mask = 0xffff0000,
511 .pvr_value = 0x004b0000, 511 .pvr_value = 0x004b0000,
512 .cpu_name = "POWER8E (raw)", 512 .cpu_name = "POWER8E (raw)",
513 .cpu_features = CPU_FTRS_POWER8, 513 .cpu_features = CPU_FTRS_POWER8E,
514 .cpu_user_features = COMMON_USER_POWER8, 514 .cpu_user_features = COMMON_USER_POWER8,
515 .cpu_user_features2 = COMMON_USER2_POWER8, 515 .cpu_user_features2 = COMMON_USER2_POWER8,
516 .mmu_features = MMU_FTRS_POWER8, 516 .mmu_features = MMU_FTRS_POWER8,
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S
index 063b65dd4f27..c1bee3ce9d1f 100644
--- a/arch/powerpc/kernel/exceptions-64e.S
+++ b/arch/powerpc/kernel/exceptions-64e.S
@@ -34,7 +34,250 @@
34 * special interrupts from within a non-standard level will probably 34 * special interrupts from within a non-standard level will probably
35 * blow you up 35 * blow you up
36 */ 36 */
37#define SPECIAL_EXC_FRAME_SIZE INT_FRAME_SIZE 37#define SPECIAL_EXC_SRR0 0
38#define SPECIAL_EXC_SRR1 1
39#define SPECIAL_EXC_SPRG_GEN 2
40#define SPECIAL_EXC_SPRG_TLB 3
41#define SPECIAL_EXC_MAS0 4
42#define SPECIAL_EXC_MAS1 5
43#define SPECIAL_EXC_MAS2 6
44#define SPECIAL_EXC_MAS3 7
45#define SPECIAL_EXC_MAS6 8
46#define SPECIAL_EXC_MAS7 9
47#define SPECIAL_EXC_MAS5 10 /* E.HV only */
48#define SPECIAL_EXC_MAS8 11 /* E.HV only */
49#define SPECIAL_EXC_IRQHAPPENED 12
50#define SPECIAL_EXC_DEAR 13
51#define SPECIAL_EXC_ESR 14
52#define SPECIAL_EXC_SOFTE 15
53#define SPECIAL_EXC_CSRR0 16
54#define SPECIAL_EXC_CSRR1 17
55/* must be even to keep 16-byte stack alignment */
56#define SPECIAL_EXC_END 18
57
58#define SPECIAL_EXC_FRAME_SIZE (INT_FRAME_SIZE + SPECIAL_EXC_END * 8)
59#define SPECIAL_EXC_FRAME_OFFS (INT_FRAME_SIZE - 288)
60
61#define SPECIAL_EXC_STORE(reg, name) \
62 std reg, (SPECIAL_EXC_##name * 8 + SPECIAL_EXC_FRAME_OFFS)(r1)
63
64#define SPECIAL_EXC_LOAD(reg, name) \
65 ld reg, (SPECIAL_EXC_##name * 8 + SPECIAL_EXC_FRAME_OFFS)(r1)
66
67special_reg_save:
68 lbz r9,PACAIRQHAPPENED(r13)
69 RECONCILE_IRQ_STATE(r3,r4)
70
71 /*
72 * We only need (or have stack space) to save this stuff if
73 * we interrupted the kernel.
74 */
75 ld r3,_MSR(r1)
76 andi. r3,r3,MSR_PR
77 bnelr
78
79 /* Copy info into temporary exception thread info */
80 ld r11,PACAKSAVE(r13)
81 CURRENT_THREAD_INFO(r11, r11)
82 CURRENT_THREAD_INFO(r12, r1)
83 ld r10,TI_FLAGS(r11)
84 std r10,TI_FLAGS(r12)
85 ld r10,TI_PREEMPT(r11)
86 std r10,TI_PREEMPT(r12)
87 ld r10,TI_TASK(r11)
88 std r10,TI_TASK(r12)
89
90 /*
91 * Advance to the next TLB exception frame for handler
92 * types that don't do it automatically.
93 */
94 LOAD_REG_ADDR(r11,extlb_level_exc)
95 lwz r12,0(r11)
96 mfspr r10,SPRN_SPRG_TLB_EXFRAME
97 add r10,r10,r12
98 mtspr SPRN_SPRG_TLB_EXFRAME,r10
99
100 /*
101 * Save registers needed to allow nesting of certain exceptions
102 * (such as TLB misses) inside special exception levels
103 */
104 mfspr r10,SPRN_SRR0
105 SPECIAL_EXC_STORE(r10,SRR0)
106 mfspr r10,SPRN_SRR1
107 SPECIAL_EXC_STORE(r10,SRR1)
108 mfspr r10,SPRN_SPRG_GEN_SCRATCH
109 SPECIAL_EXC_STORE(r10,SPRG_GEN)
110 mfspr r10,SPRN_SPRG_TLB_SCRATCH
111 SPECIAL_EXC_STORE(r10,SPRG_TLB)
112 mfspr r10,SPRN_MAS0
113 SPECIAL_EXC_STORE(r10,MAS0)
114 mfspr r10,SPRN_MAS1
115 SPECIAL_EXC_STORE(r10,MAS1)
116 mfspr r10,SPRN_MAS2
117 SPECIAL_EXC_STORE(r10,MAS2)
118 mfspr r10,SPRN_MAS3
119 SPECIAL_EXC_STORE(r10,MAS3)
120 mfspr r10,SPRN_MAS6
121 SPECIAL_EXC_STORE(r10,MAS6)
122 mfspr r10,SPRN_MAS7
123 SPECIAL_EXC_STORE(r10,MAS7)
124BEGIN_FTR_SECTION
125 mfspr r10,SPRN_MAS5
126 SPECIAL_EXC_STORE(r10,MAS5)
127 mfspr r10,SPRN_MAS8
128 SPECIAL_EXC_STORE(r10,MAS8)
129
130 /* MAS5/8 could have inappropriate values if we interrupted KVM code */
131 li r10,0
132 mtspr SPRN_MAS5,r10
133 mtspr SPRN_MAS8,r10
134END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
135 SPECIAL_EXC_STORE(r9,IRQHAPPENED)
136
137 mfspr r10,SPRN_DEAR
138 SPECIAL_EXC_STORE(r10,DEAR)
139 mfspr r10,SPRN_ESR
140 SPECIAL_EXC_STORE(r10,ESR)
141
142 lbz r10,PACASOFTIRQEN(r13)
143 SPECIAL_EXC_STORE(r10,SOFTE)
144 ld r10,_NIP(r1)
145 SPECIAL_EXC_STORE(r10,CSRR0)
146 ld r10,_MSR(r1)
147 SPECIAL_EXC_STORE(r10,CSRR1)
148
149 blr
150
151ret_from_level_except:
152 ld r3,_MSR(r1)
153 andi. r3,r3,MSR_PR
154 beq 1f
155 b ret_from_except
1561:
157
158 LOAD_REG_ADDR(r11,extlb_level_exc)
159 lwz r12,0(r11)
160 mfspr r10,SPRN_SPRG_TLB_EXFRAME
161 sub r10,r10,r12
162 mtspr SPRN_SPRG_TLB_EXFRAME,r10
163
164 /*
165 * It's possible that the special level exception interrupted a
166 * TLB miss handler, and inserted the same entry that the
167 * interrupted handler was about to insert. On CPUs without TLB
168 * write conditional, this can result in a duplicate TLB entry.
169 * Wipe all non-bolted entries to be safe.
170 *
171 * Note that this doesn't protect against any TLB misses
172 * we may take accessing the stack from here to the end of
173 * the special level exception. It's not clear how we can
174 * reasonably protect against that, but only CPUs with
175 * neither TLB write conditional nor bolted kernel memory
176 * are affected. Do any such CPUs even exist?
177 */
178 PPC_TLBILX_ALL(0,R0)
179
180 REST_NVGPRS(r1)
181
182 SPECIAL_EXC_LOAD(r10,SRR0)
183 mtspr SPRN_SRR0,r10
184 SPECIAL_EXC_LOAD(r10,SRR1)
185 mtspr SPRN_SRR1,r10
186 SPECIAL_EXC_LOAD(r10,SPRG_GEN)
187 mtspr SPRN_SPRG_GEN_SCRATCH,r10
188 SPECIAL_EXC_LOAD(r10,SPRG_TLB)
189 mtspr SPRN_SPRG_TLB_SCRATCH,r10
190 SPECIAL_EXC_LOAD(r10,MAS0)
191 mtspr SPRN_MAS0,r10
192 SPECIAL_EXC_LOAD(r10,MAS1)
193 mtspr SPRN_MAS1,r10
194 SPECIAL_EXC_LOAD(r10,MAS2)
195 mtspr SPRN_MAS2,r10
196 SPECIAL_EXC_LOAD(r10,MAS3)
197 mtspr SPRN_MAS3,r10
198 SPECIAL_EXC_LOAD(r10,MAS6)
199 mtspr SPRN_MAS6,r10
200 SPECIAL_EXC_LOAD(r10,MAS7)
201 mtspr SPRN_MAS7,r10
202BEGIN_FTR_SECTION
203 SPECIAL_EXC_LOAD(r10,MAS5)
204 mtspr SPRN_MAS5,r10
205 SPECIAL_EXC_LOAD(r10,MAS8)
206 mtspr SPRN_MAS8,r10
207END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
208
209 lbz r6,PACASOFTIRQEN(r13)
210 ld r5,SOFTE(r1)
211
212 /* Interrupts had better not already be enabled... */
213 twnei r6,0
214
215 cmpwi cr0,r5,0
216 beq 1f
217
218 TRACE_ENABLE_INTS
219 stb r5,PACASOFTIRQEN(r13)
2201:
221 /*
222 * Restore PACAIRQHAPPENED rather than setting it based on
223 * the return MSR[EE], since we could have interrupted
224 * __check_irq_replay() or other inconsistent transitory
225 * states that must remain that way.
226 */
227 SPECIAL_EXC_LOAD(r10,IRQHAPPENED)
228 stb r10,PACAIRQHAPPENED(r13)
229
230 SPECIAL_EXC_LOAD(r10,DEAR)
231 mtspr SPRN_DEAR,r10
232 SPECIAL_EXC_LOAD(r10,ESR)
233 mtspr SPRN_ESR,r10
234
235 stdcx. r0,0,r1 /* to clear the reservation */
236
237 REST_4GPRS(2, r1)
238 REST_4GPRS(6, r1)
239
240 ld r10,_CTR(r1)
241 ld r11,_XER(r1)
242 mtctr r10
243 mtxer r11
244
245 blr
246
247.macro ret_from_level srr0 srr1 paca_ex scratch
248 bl ret_from_level_except
249
250 ld r10,_LINK(r1)
251 ld r11,_CCR(r1)
252 ld r0,GPR13(r1)
253 mtlr r10
254 mtcr r11
255
256 ld r10,GPR10(r1)
257 ld r11,GPR11(r1)
258 ld r12,GPR12(r1)
259 mtspr \scratch,r0
260
261 std r10,\paca_ex+EX_R10(r13);
262 std r11,\paca_ex+EX_R11(r13);
263 ld r10,_NIP(r1)
264 ld r11,_MSR(r1)
265 ld r0,GPR0(r1)
266 ld r1,GPR1(r1)
267 mtspr \srr0,r10
268 mtspr \srr1,r11
269 ld r10,\paca_ex+EX_R10(r13)
270 ld r11,\paca_ex+EX_R11(r13)
271 mfspr r13,\scratch
272.endm
273
274ret_from_crit_except:
275 ret_from_level SPRN_CSRR0 SPRN_CSRR1 PACA_EXCRIT SPRN_SPRG_CRIT_SCRATCH
276 rfci
277
278ret_from_mc_except:
279 ret_from_level SPRN_MCSRR0 SPRN_MCSRR1 PACA_EXMC SPRN_SPRG_MC_SCRATCH
280 rfmci
38 281
39/* Exception prolog code for all exceptions */ 282/* Exception prolog code for all exceptions */
40#define EXCEPTION_PROLOG(n, intnum, type, addition) \ 283#define EXCEPTION_PROLOG(n, intnum, type, addition) \
@@ -42,7 +285,6 @@
42 mfspr r13,SPRN_SPRG_PACA; /* get PACA */ \ 285 mfspr r13,SPRN_SPRG_PACA; /* get PACA */ \
43 std r10,PACA_EX##type+EX_R10(r13); \ 286 std r10,PACA_EX##type+EX_R10(r13); \
44 std r11,PACA_EX##type+EX_R11(r13); \ 287 std r11,PACA_EX##type+EX_R11(r13); \
45 PROLOG_STORE_RESTORE_SCRATCH_##type; \
46 mfcr r10; /* save CR */ \ 288 mfcr r10; /* save CR */ \
47 mfspr r11,SPRN_##type##_SRR1;/* what are we coming from */ \ 289 mfspr r11,SPRN_##type##_SRR1;/* what are we coming from */ \
48 DO_KVM intnum,SPRN_##type##_SRR1; /* KVM hook */ \ 290 DO_KVM intnum,SPRN_##type##_SRR1; /* KVM hook */ \
@@ -69,19 +311,19 @@
69 311
70#define CRIT_SET_KSTACK \ 312#define CRIT_SET_KSTACK \
71 ld r1,PACA_CRIT_STACK(r13); \ 313 ld r1,PACA_CRIT_STACK(r13); \
72 subi r1,r1,SPECIAL_EXC_FRAME_SIZE; 314 subi r1,r1,SPECIAL_EXC_FRAME_SIZE
73#define SPRN_CRIT_SRR0 SPRN_CSRR0 315#define SPRN_CRIT_SRR0 SPRN_CSRR0
74#define SPRN_CRIT_SRR1 SPRN_CSRR1 316#define SPRN_CRIT_SRR1 SPRN_CSRR1
75 317
76#define DBG_SET_KSTACK \ 318#define DBG_SET_KSTACK \
77 ld r1,PACA_DBG_STACK(r13); \ 319 ld r1,PACA_DBG_STACK(r13); \
78 subi r1,r1,SPECIAL_EXC_FRAME_SIZE; 320 subi r1,r1,SPECIAL_EXC_FRAME_SIZE
79#define SPRN_DBG_SRR0 SPRN_DSRR0 321#define SPRN_DBG_SRR0 SPRN_DSRR0
80#define SPRN_DBG_SRR1 SPRN_DSRR1 322#define SPRN_DBG_SRR1 SPRN_DSRR1
81 323
82#define MC_SET_KSTACK \ 324#define MC_SET_KSTACK \
83 ld r1,PACA_MC_STACK(r13); \ 325 ld r1,PACA_MC_STACK(r13); \
84 subi r1,r1,SPECIAL_EXC_FRAME_SIZE; 326 subi r1,r1,SPECIAL_EXC_FRAME_SIZE
85#define SPRN_MC_SRR0 SPRN_MCSRR0 327#define SPRN_MC_SRR0 SPRN_MCSRR0
86#define SPRN_MC_SRR1 SPRN_MCSRR1 328#define SPRN_MC_SRR1 SPRN_MCSRR1
87 329
@@ -100,20 +342,6 @@
100#define GDBELL_EXCEPTION_PROLOG(n, intnum, addition) \ 342#define GDBELL_EXCEPTION_PROLOG(n, intnum, addition) \
101 EXCEPTION_PROLOG(n, intnum, GDBELL, addition##_GDBELL(n)) 343 EXCEPTION_PROLOG(n, intnum, GDBELL, addition##_GDBELL(n))
102 344
103/*
104 * Store user-visible scratch in PACA exception slots and restore proper value
105 */
106#define PROLOG_STORE_RESTORE_SCRATCH_GEN
107#define PROLOG_STORE_RESTORE_SCRATCH_GDBELL
108#define PROLOG_STORE_RESTORE_SCRATCH_DBG
109#define PROLOG_STORE_RESTORE_SCRATCH_MC
110
111#define PROLOG_STORE_RESTORE_SCRATCH_CRIT \
112 mfspr r10,SPRN_SPRG_CRIT_SCRATCH; /* get r13 */ \
113 std r10,PACA_EXCRIT+EX_R13(r13); \
114 ld r11,PACA_SPRG3(r13); \
115 mtspr SPRN_SPRG_CRIT_SCRATCH,r11;
116
117/* Variants of the "addition" argument for the prolog 345/* Variants of the "addition" argument for the prolog
118 */ 346 */
119#define PROLOG_ADDITION_NONE_GEN(n) 347#define PROLOG_ADDITION_NONE_GEN(n)
@@ -147,10 +375,8 @@
147 std r15,PACA_EXMC+EX_R15(r13) 375 std r15,PACA_EXMC+EX_R15(r13)
148 376
149 377
150/* Core exception code for all exceptions except TLB misses. 378/* Core exception code for all exceptions except TLB misses. */
151 * XXX: Needs to make SPRN_SPRG_GEN depend on exception type 379#define EXCEPTION_COMMON_LVL(n, scratch, excf) \
152 */
153#define EXCEPTION_COMMON(n, excf, ints) \
154exc_##n##_common: \ 380exc_##n##_common: \
155 std r0,GPR0(r1); /* save r0 in stackframe */ \ 381 std r0,GPR0(r1); /* save r0 in stackframe */ \
156 std r2,GPR2(r1); /* save r2 in stackframe */ \ 382 std r2,GPR2(r1); /* save r2 in stackframe */ \
@@ -163,7 +389,7 @@ exc_##n##_common: \
163 ACCOUNT_CPU_USER_ENTRY(r10,r11);/* accounting (uses cr0+eq) */ \ 389 ACCOUNT_CPU_USER_ENTRY(r10,r11);/* accounting (uses cr0+eq) */ \
1642: ld r3,excf+EX_R10(r13); /* get back r10 */ \ 3902: ld r3,excf+EX_R10(r13); /* get back r10 */ \
165 ld r4,excf+EX_R11(r13); /* get back r11 */ \ 391 ld r4,excf+EX_R11(r13); /* get back r11 */ \
166 mfspr r5,SPRN_SPRG_GEN_SCRATCH;/* get back r13 */ \ 392 mfspr r5,scratch; /* get back r13 */ \
167 std r12,GPR12(r1); /* save r12 in stackframe */ \ 393 std r12,GPR12(r1); /* save r12 in stackframe */ \
168 ld r2,PACATOC(r13); /* get kernel TOC into r2 */ \ 394 ld r2,PACATOC(r13); /* get kernel TOC into r2 */ \
169 mflr r6; /* save LR in stackframe */ \ 395 mflr r6; /* save LR in stackframe */ \
@@ -187,24 +413,29 @@ exc_##n##_common: \
187 std r11,SOFTE(r1); /* and save it to stackframe */ \ 413 std r11,SOFTE(r1); /* and save it to stackframe */ \
188 std r12,STACK_FRAME_OVERHEAD-16(r1); /* mark the frame */ \ 414 std r12,STACK_FRAME_OVERHEAD-16(r1); /* mark the frame */ \
189 std r3,_TRAP(r1); /* set trap number */ \ 415 std r3,_TRAP(r1); /* set trap number */ \
190 std r0,RESULT(r1); /* clear regs->result */ \ 416 std r0,RESULT(r1); /* clear regs->result */
191 ints;
192 417
193/* Variants for the "ints" argument. This one does nothing when we want 418#define EXCEPTION_COMMON(n) \
194 * to keep interrupts in their original state 419 EXCEPTION_COMMON_LVL(n, SPRN_SPRG_GEN_SCRATCH, PACA_EXGEN)
195 */ 420#define EXCEPTION_COMMON_CRIT(n) \
196#define INTS_KEEP 421 EXCEPTION_COMMON_LVL(n, SPRN_SPRG_CRIT_SCRATCH, PACA_EXCRIT)
422#define EXCEPTION_COMMON_MC(n) \
423 EXCEPTION_COMMON_LVL(n, SPRN_SPRG_MC_SCRATCH, PACA_EXMC)
424#define EXCEPTION_COMMON_DBG(n) \
425 EXCEPTION_COMMON_LVL(n, SPRN_SPRG_DBG_SCRATCH, PACA_EXDBG)
197 426
198/* This second version is meant for exceptions that don't immediately 427/*
199 * hard-enable. We set a bit in paca->irq_happened to ensure that 428 * This is meant for exceptions that don't immediately hard-enable. We
200 * a subsequent call to arch_local_irq_restore() will properly 429 * set a bit in paca->irq_happened to ensure that a subsequent call to
201 * hard-enable and avoid the fast-path, and then reconcile irq state. 430 * arch_local_irq_restore() will properly hard-enable and avoid the
431 * fast-path, and then reconcile irq state.
202 */ 432 */
203#define INTS_DISABLE RECONCILE_IRQ_STATE(r3,r4) 433#define INTS_DISABLE RECONCILE_IRQ_STATE(r3,r4)
204 434
205/* This is called by exceptions that used INTS_KEEP (that did not touch 435/*
206 * irq indicators in the PACA). This will restore MSR:EE to it's previous 436 * This is called by exceptions that don't use INTS_DISABLE (that did not
207 * value 437 * touch irq indicators in the PACA). This will restore MSR:EE to it's
438 * previous value
208 * 439 *
209 * XXX In the long run, we may want to open-code it in order to separate the 440 * XXX In the long run, we may want to open-code it in order to separate the
210 * load from the wrtee, thus limiting the latency caused by the dependency 441 * load from the wrtee, thus limiting the latency caused by the dependency
@@ -262,7 +493,8 @@ exc_##n##_bad_stack: \
262#define MASKABLE_EXCEPTION(trapnum, intnum, label, hdlr, ack) \ 493#define MASKABLE_EXCEPTION(trapnum, intnum, label, hdlr, ack) \
263 START_EXCEPTION(label); \ 494 START_EXCEPTION(label); \
264 NORMAL_EXCEPTION_PROLOG(trapnum, intnum, PROLOG_ADDITION_MASKABLE)\ 495 NORMAL_EXCEPTION_PROLOG(trapnum, intnum, PROLOG_ADDITION_MASKABLE)\
265 EXCEPTION_COMMON(trapnum, PACA_EXGEN, INTS_DISABLE) \ 496 EXCEPTION_COMMON(trapnum) \
497 INTS_DISABLE; \
266 ack(r8); \ 498 ack(r8); \
267 CHECK_NAPPING(); \ 499 CHECK_NAPPING(); \
268 addi r3,r1,STACK_FRAME_OVERHEAD; \ 500 addi r3,r1,STACK_FRAME_OVERHEAD; \
@@ -283,8 +515,8 @@ exception_marker:
283 .balign 0x1000 515 .balign 0x1000
284 .globl interrupt_base_book3e 516 .globl interrupt_base_book3e
285interrupt_base_book3e: /* fake trap */ 517interrupt_base_book3e: /* fake trap */
286 EXCEPTION_STUB(0x000, machine_check) /* 0x0200 */ 518 EXCEPTION_STUB(0x000, machine_check)
287 EXCEPTION_STUB(0x020, critical_input) /* 0x0580 */ 519 EXCEPTION_STUB(0x020, critical_input) /* 0x0100 */
288 EXCEPTION_STUB(0x040, debug_crit) /* 0x0d00 */ 520 EXCEPTION_STUB(0x040, debug_crit) /* 0x0d00 */
289 EXCEPTION_STUB(0x060, data_storage) /* 0x0300 */ 521 EXCEPTION_STUB(0x060, data_storage) /* 0x0300 */
290 EXCEPTION_STUB(0x080, instruction_storage) /* 0x0400 */ 522 EXCEPTION_STUB(0x080, instruction_storage) /* 0x0400 */
@@ -299,8 +531,8 @@ interrupt_base_book3e: /* fake trap */
299 EXCEPTION_STUB(0x1a0, watchdog) /* 0x09f0 */ 531 EXCEPTION_STUB(0x1a0, watchdog) /* 0x09f0 */
300 EXCEPTION_STUB(0x1c0, data_tlb_miss) 532 EXCEPTION_STUB(0x1c0, data_tlb_miss)
301 EXCEPTION_STUB(0x1e0, instruction_tlb_miss) 533 EXCEPTION_STUB(0x1e0, instruction_tlb_miss)
302 EXCEPTION_STUB(0x200, altivec_unavailable) /* 0x0f20 */ 534 EXCEPTION_STUB(0x200, altivec_unavailable)
303 EXCEPTION_STUB(0x220, altivec_assist) /* 0x1700 */ 535 EXCEPTION_STUB(0x220, altivec_assist)
304 EXCEPTION_STUB(0x260, perfmon) 536 EXCEPTION_STUB(0x260, perfmon)
305 EXCEPTION_STUB(0x280, doorbell) 537 EXCEPTION_STUB(0x280, doorbell)
306 EXCEPTION_STUB(0x2a0, doorbell_crit) 538 EXCEPTION_STUB(0x2a0, doorbell_crit)
@@ -317,25 +549,25 @@ interrupt_end_book3e:
317 START_EXCEPTION(critical_input); 549 START_EXCEPTION(critical_input);
318 CRIT_EXCEPTION_PROLOG(0x100, BOOKE_INTERRUPT_CRITICAL, 550 CRIT_EXCEPTION_PROLOG(0x100, BOOKE_INTERRUPT_CRITICAL,
319 PROLOG_ADDITION_NONE) 551 PROLOG_ADDITION_NONE)
320// EXCEPTION_COMMON(0x100, PACA_EXCRIT, INTS_DISABLE) 552 EXCEPTION_COMMON_CRIT(0x100)
321// bl special_reg_save_crit 553 bl .save_nvgprs
322// CHECK_NAPPING(); 554 bl special_reg_save
323// addi r3,r1,STACK_FRAME_OVERHEAD 555 CHECK_NAPPING();
324// bl .critical_exception 556 addi r3,r1,STACK_FRAME_OVERHEAD
325// b ret_from_crit_except 557 bl .unknown_exception
326 b . 558 b ret_from_crit_except
327 559
328/* Machine Check Interrupt */ 560/* Machine Check Interrupt */
329 START_EXCEPTION(machine_check); 561 START_EXCEPTION(machine_check);
330 MC_EXCEPTION_PROLOG(0x200, BOOKE_INTERRUPT_MACHINE_CHECK, 562 MC_EXCEPTION_PROLOG(0x000, BOOKE_INTERRUPT_MACHINE_CHECK,
331 PROLOG_ADDITION_NONE) 563 PROLOG_ADDITION_NONE)
332// EXCEPTION_COMMON(0x200, PACA_EXMC, INTS_DISABLE) 564 EXCEPTION_COMMON_MC(0x000)
333// bl special_reg_save_mc 565 bl .save_nvgprs
334// addi r3,r1,STACK_FRAME_OVERHEAD 566 bl special_reg_save
335// CHECK_NAPPING(); 567 CHECK_NAPPING();
336// bl .machine_check_exception 568 addi r3,r1,STACK_FRAME_OVERHEAD
337// b ret_from_mc_except 569 bl .machine_check_exception
338 b . 570 b ret_from_mc_except
339 571
340/* Data Storage Interrupt */ 572/* Data Storage Interrupt */
341 START_EXCEPTION(data_storage) 573 START_EXCEPTION(data_storage)
@@ -343,7 +575,8 @@ interrupt_end_book3e:
343 PROLOG_ADDITION_2REGS) 575 PROLOG_ADDITION_2REGS)
344 mfspr r14,SPRN_DEAR 576 mfspr r14,SPRN_DEAR
345 mfspr r15,SPRN_ESR 577 mfspr r15,SPRN_ESR
346 EXCEPTION_COMMON(0x300, PACA_EXGEN, INTS_DISABLE) 578 EXCEPTION_COMMON(0x300)
579 INTS_DISABLE
347 b storage_fault_common 580 b storage_fault_common
348 581
349/* Instruction Storage Interrupt */ 582/* Instruction Storage Interrupt */
@@ -352,7 +585,8 @@ interrupt_end_book3e:
352 PROLOG_ADDITION_2REGS) 585 PROLOG_ADDITION_2REGS)
353 li r15,0 586 li r15,0
354 mr r14,r10 587 mr r14,r10
355 EXCEPTION_COMMON(0x400, PACA_EXGEN, INTS_DISABLE) 588 EXCEPTION_COMMON(0x400)
589 INTS_DISABLE
356 b storage_fault_common 590 b storage_fault_common
357 591
358/* External Input Interrupt */ 592/* External Input Interrupt */
@@ -365,7 +599,7 @@ interrupt_end_book3e:
365 PROLOG_ADDITION_2REGS) 599 PROLOG_ADDITION_2REGS)
366 mfspr r14,SPRN_DEAR 600 mfspr r14,SPRN_DEAR
367 mfspr r15,SPRN_ESR 601 mfspr r15,SPRN_ESR
368 EXCEPTION_COMMON(0x600, PACA_EXGEN, INTS_KEEP) 602 EXCEPTION_COMMON(0x600)
369 b alignment_more /* no room, go out of line */ 603 b alignment_more /* no room, go out of line */
370 604
371/* Program Interrupt */ 605/* Program Interrupt */
@@ -373,7 +607,8 @@ interrupt_end_book3e:
373 NORMAL_EXCEPTION_PROLOG(0x700, BOOKE_INTERRUPT_PROGRAM, 607 NORMAL_EXCEPTION_PROLOG(0x700, BOOKE_INTERRUPT_PROGRAM,
374 PROLOG_ADDITION_1REG) 608 PROLOG_ADDITION_1REG)
375 mfspr r14,SPRN_ESR 609 mfspr r14,SPRN_ESR
376 EXCEPTION_COMMON(0x700, PACA_EXGEN, INTS_DISABLE) 610 EXCEPTION_COMMON(0x700)
611 INTS_DISABLE
377 std r14,_DSISR(r1) 612 std r14,_DSISR(r1)
378 addi r3,r1,STACK_FRAME_OVERHEAD 613 addi r3,r1,STACK_FRAME_OVERHEAD
379 ld r14,PACA_EXGEN+EX_R14(r13) 614 ld r14,PACA_EXGEN+EX_R14(r13)
@@ -386,7 +621,7 @@ interrupt_end_book3e:
386 NORMAL_EXCEPTION_PROLOG(0x800, BOOKE_INTERRUPT_FP_UNAVAIL, 621 NORMAL_EXCEPTION_PROLOG(0x800, BOOKE_INTERRUPT_FP_UNAVAIL,
387 PROLOG_ADDITION_NONE) 622 PROLOG_ADDITION_NONE)
388 /* we can probably do a shorter exception entry for that one... */ 623 /* we can probably do a shorter exception entry for that one... */
389 EXCEPTION_COMMON(0x800, PACA_EXGEN, INTS_KEEP) 624 EXCEPTION_COMMON(0x800)
390 ld r12,_MSR(r1) 625 ld r12,_MSR(r1)
391 andi. r0,r12,MSR_PR; 626 andi. r0,r12,MSR_PR;
392 beq- 1f 627 beq- 1f
@@ -403,7 +638,7 @@ interrupt_end_book3e:
403 NORMAL_EXCEPTION_PROLOG(0x200, BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL, 638 NORMAL_EXCEPTION_PROLOG(0x200, BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL,
404 PROLOG_ADDITION_NONE) 639 PROLOG_ADDITION_NONE)
405 /* we can probably do a shorter exception entry for that one... */ 640 /* we can probably do a shorter exception entry for that one... */
406 EXCEPTION_COMMON(0x200, PACA_EXGEN, INTS_KEEP) 641 EXCEPTION_COMMON(0x200)
407#ifdef CONFIG_ALTIVEC 642#ifdef CONFIG_ALTIVEC
408BEGIN_FTR_SECTION 643BEGIN_FTR_SECTION
409 ld r12,_MSR(r1) 644 ld r12,_MSR(r1)
@@ -425,7 +660,8 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
425 NORMAL_EXCEPTION_PROLOG(0x220, 660 NORMAL_EXCEPTION_PROLOG(0x220,
426 BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST, 661 BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST,
427 PROLOG_ADDITION_NONE) 662 PROLOG_ADDITION_NONE)
428 EXCEPTION_COMMON(0x220, PACA_EXGEN, INTS_DISABLE) 663 EXCEPTION_COMMON(0x220)
664 INTS_DISABLE
429 bl .save_nvgprs 665 bl .save_nvgprs
430 addi r3,r1,STACK_FRAME_OVERHEAD 666 addi r3,r1,STACK_FRAME_OVERHEAD
431#ifdef CONFIG_ALTIVEC 667#ifdef CONFIG_ALTIVEC
@@ -450,13 +686,17 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
450 START_EXCEPTION(watchdog); 686 START_EXCEPTION(watchdog);
451 CRIT_EXCEPTION_PROLOG(0x9f0, BOOKE_INTERRUPT_WATCHDOG, 687 CRIT_EXCEPTION_PROLOG(0x9f0, BOOKE_INTERRUPT_WATCHDOG,
452 PROLOG_ADDITION_NONE) 688 PROLOG_ADDITION_NONE)
453// EXCEPTION_COMMON(0x9f0, PACA_EXCRIT, INTS_DISABLE) 689 EXCEPTION_COMMON_CRIT(0x9f0)
454// bl special_reg_save_crit 690 bl .save_nvgprs
455// CHECK_NAPPING(); 691 bl special_reg_save
456// addi r3,r1,STACK_FRAME_OVERHEAD 692 CHECK_NAPPING();
457// bl .unknown_exception 693 addi r3,r1,STACK_FRAME_OVERHEAD
458// b ret_from_crit_except 694#ifdef CONFIG_BOOKE_WDT
459 b . 695 bl .WatchdogException
696#else
697 bl .unknown_exception
698#endif
699 b ret_from_crit_except
460 700
461/* System Call Interrupt */ 701/* System Call Interrupt */
462 START_EXCEPTION(system_call) 702 START_EXCEPTION(system_call)
@@ -470,7 +710,8 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
470 START_EXCEPTION(ap_unavailable); 710 START_EXCEPTION(ap_unavailable);
471 NORMAL_EXCEPTION_PROLOG(0xf20, BOOKE_INTERRUPT_AP_UNAVAIL, 711 NORMAL_EXCEPTION_PROLOG(0xf20, BOOKE_INTERRUPT_AP_UNAVAIL,
472 PROLOG_ADDITION_NONE) 712 PROLOG_ADDITION_NONE)
473 EXCEPTION_COMMON(0xf20, PACA_EXGEN, INTS_DISABLE) 713 EXCEPTION_COMMON(0xf20)
714 INTS_DISABLE
474 bl .save_nvgprs 715 bl .save_nvgprs
475 addi r3,r1,STACK_FRAME_OVERHEAD 716 addi r3,r1,STACK_FRAME_OVERHEAD
476 bl .unknown_exception 717 bl .unknown_exception
@@ -513,7 +754,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
513 mtcr r10 754 mtcr r10
514 ld r10,PACA_EXCRIT+EX_R10(r13) /* restore registers */ 755 ld r10,PACA_EXCRIT+EX_R10(r13) /* restore registers */
515 ld r11,PACA_EXCRIT+EX_R11(r13) 756 ld r11,PACA_EXCRIT+EX_R11(r13)
516 ld r13,PACA_EXCRIT+EX_R13(r13) 757 mfspr r13,SPRN_SPRG_CRIT_SCRATCH
517 rfci 758 rfci
518 759
519 /* Normal debug exception */ 760 /* Normal debug exception */
@@ -526,10 +767,8 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
526 /* Now we mash up things to make it look like we are coming on a 767 /* Now we mash up things to make it look like we are coming on a
527 * normal exception 768 * normal exception
528 */ 769 */
529 ld r15,PACA_EXCRIT+EX_R13(r13)
530 mtspr SPRN_SPRG_GEN_SCRATCH,r15
531 mfspr r14,SPRN_DBSR 770 mfspr r14,SPRN_DBSR
532 EXCEPTION_COMMON(0xd00, PACA_EXCRIT, INTS_DISABLE) 771 EXCEPTION_COMMON_CRIT(0xd00)
533 std r14,_DSISR(r1) 772 std r14,_DSISR(r1)
534 addi r3,r1,STACK_FRAME_OVERHEAD 773 addi r3,r1,STACK_FRAME_OVERHEAD
535 mr r4,r14 774 mr r4,r14
@@ -592,10 +831,9 @@ kernel_dbg_exc:
592 /* Now we mash up things to make it look like we are coming on a 831 /* Now we mash up things to make it look like we are coming on a
593 * normal exception 832 * normal exception
594 */ 833 */
595 mfspr r15,SPRN_SPRG_DBG_SCRATCH
596 mtspr SPRN_SPRG_GEN_SCRATCH,r15
597 mfspr r14,SPRN_DBSR 834 mfspr r14,SPRN_DBSR
598 EXCEPTION_COMMON(0xd08, PACA_EXDBG, INTS_DISABLE) 835 EXCEPTION_COMMON_DBG(0xd08)
836 INTS_DISABLE
599 std r14,_DSISR(r1) 837 std r14,_DSISR(r1)
600 addi r3,r1,STACK_FRAME_OVERHEAD 838 addi r3,r1,STACK_FRAME_OVERHEAD
601 mr r4,r14 839 mr r4,r14
@@ -608,7 +846,8 @@ kernel_dbg_exc:
608 START_EXCEPTION(perfmon); 846 START_EXCEPTION(perfmon);
609 NORMAL_EXCEPTION_PROLOG(0x260, BOOKE_INTERRUPT_PERFORMANCE_MONITOR, 847 NORMAL_EXCEPTION_PROLOG(0x260, BOOKE_INTERRUPT_PERFORMANCE_MONITOR,
610 PROLOG_ADDITION_NONE) 848 PROLOG_ADDITION_NONE)
611 EXCEPTION_COMMON(0x260, PACA_EXGEN, INTS_DISABLE) 849 EXCEPTION_COMMON(0x260)
850 INTS_DISABLE
612 CHECK_NAPPING() 851 CHECK_NAPPING()
613 addi r3,r1,STACK_FRAME_OVERHEAD 852 addi r3,r1,STACK_FRAME_OVERHEAD
614 bl .performance_monitor_exception 853 bl .performance_monitor_exception
@@ -622,13 +861,13 @@ kernel_dbg_exc:
622 START_EXCEPTION(doorbell_crit); 861 START_EXCEPTION(doorbell_crit);
623 CRIT_EXCEPTION_PROLOG(0x2a0, BOOKE_INTERRUPT_DOORBELL_CRITICAL, 862 CRIT_EXCEPTION_PROLOG(0x2a0, BOOKE_INTERRUPT_DOORBELL_CRITICAL,
624 PROLOG_ADDITION_NONE) 863 PROLOG_ADDITION_NONE)
625// EXCEPTION_COMMON(0x2a0, PACA_EXCRIT, INTS_DISABLE) 864 EXCEPTION_COMMON_CRIT(0x2a0)
626// bl special_reg_save_crit 865 bl .save_nvgprs
627// CHECK_NAPPING(); 866 bl special_reg_save
628// addi r3,r1,STACK_FRAME_OVERHEAD 867 CHECK_NAPPING();
629// bl .doorbell_critical_exception 868 addi r3,r1,STACK_FRAME_OVERHEAD
630// b ret_from_crit_except 869 bl .unknown_exception
631 b . 870 b ret_from_crit_except
632 871
633/* 872/*
634 * Guest doorbell interrupt 873 * Guest doorbell interrupt
@@ -637,7 +876,7 @@ kernel_dbg_exc:
637 START_EXCEPTION(guest_doorbell); 876 START_EXCEPTION(guest_doorbell);
638 GDBELL_EXCEPTION_PROLOG(0x2c0, BOOKE_INTERRUPT_GUEST_DBELL, 877 GDBELL_EXCEPTION_PROLOG(0x2c0, BOOKE_INTERRUPT_GUEST_DBELL,
639 PROLOG_ADDITION_NONE) 878 PROLOG_ADDITION_NONE)
640 EXCEPTION_COMMON(0x2c0, PACA_EXGEN, INTS_KEEP) 879 EXCEPTION_COMMON(0x2c0)
641 addi r3,r1,STACK_FRAME_OVERHEAD 880 addi r3,r1,STACK_FRAME_OVERHEAD
642 bl .save_nvgprs 881 bl .save_nvgprs
643 INTS_RESTORE_HARD 882 INTS_RESTORE_HARD
@@ -648,19 +887,19 @@ kernel_dbg_exc:
648 START_EXCEPTION(guest_doorbell_crit); 887 START_EXCEPTION(guest_doorbell_crit);
649 CRIT_EXCEPTION_PROLOG(0x2e0, BOOKE_INTERRUPT_GUEST_DBELL_CRIT, 888 CRIT_EXCEPTION_PROLOG(0x2e0, BOOKE_INTERRUPT_GUEST_DBELL_CRIT,
650 PROLOG_ADDITION_NONE) 889 PROLOG_ADDITION_NONE)
651// EXCEPTION_COMMON(0x2e0, PACA_EXCRIT, INTS_DISABLE) 890 EXCEPTION_COMMON_CRIT(0x2e0)
652// bl special_reg_save_crit 891 bl .save_nvgprs
653// CHECK_NAPPING(); 892 bl special_reg_save
654// addi r3,r1,STACK_FRAME_OVERHEAD 893 CHECK_NAPPING();
655// bl .guest_doorbell_critical_exception 894 addi r3,r1,STACK_FRAME_OVERHEAD
656// b ret_from_crit_except 895 bl .unknown_exception
657 b . 896 b ret_from_crit_except
658 897
659/* Hypervisor call */ 898/* Hypervisor call */
660 START_EXCEPTION(hypercall); 899 START_EXCEPTION(hypercall);
661 NORMAL_EXCEPTION_PROLOG(0x310, BOOKE_INTERRUPT_HV_SYSCALL, 900 NORMAL_EXCEPTION_PROLOG(0x310, BOOKE_INTERRUPT_HV_SYSCALL,
662 PROLOG_ADDITION_NONE) 901 PROLOG_ADDITION_NONE)
663 EXCEPTION_COMMON(0x310, PACA_EXGEN, INTS_KEEP) 902 EXCEPTION_COMMON(0x310)
664 addi r3,r1,STACK_FRAME_OVERHEAD 903 addi r3,r1,STACK_FRAME_OVERHEAD
665 bl .save_nvgprs 904 bl .save_nvgprs
666 INTS_RESTORE_HARD 905 INTS_RESTORE_HARD
@@ -671,7 +910,7 @@ kernel_dbg_exc:
671 START_EXCEPTION(ehpriv); 910 START_EXCEPTION(ehpriv);
672 NORMAL_EXCEPTION_PROLOG(0x320, BOOKE_INTERRUPT_HV_PRIV, 911 NORMAL_EXCEPTION_PROLOG(0x320, BOOKE_INTERRUPT_HV_PRIV,
673 PROLOG_ADDITION_NONE) 912 PROLOG_ADDITION_NONE)
674 EXCEPTION_COMMON(0x320, PACA_EXGEN, INTS_KEEP) 913 EXCEPTION_COMMON(0x320)
675 addi r3,r1,STACK_FRAME_OVERHEAD 914 addi r3,r1,STACK_FRAME_OVERHEAD
676 bl .save_nvgprs 915 bl .save_nvgprs
677 INTS_RESTORE_HARD 916 INTS_RESTORE_HARD
@@ -682,7 +921,7 @@ kernel_dbg_exc:
682 START_EXCEPTION(lrat_error); 921 START_EXCEPTION(lrat_error);
683 NORMAL_EXCEPTION_PROLOG(0x340, BOOKE_INTERRUPT_LRAT_ERROR, 922 NORMAL_EXCEPTION_PROLOG(0x340, BOOKE_INTERRUPT_LRAT_ERROR,
684 PROLOG_ADDITION_NONE) 923 PROLOG_ADDITION_NONE)
685 EXCEPTION_COMMON(0x340, PACA_EXGEN, INTS_KEEP) 924 EXCEPTION_COMMON(0x340)
686 addi r3,r1,STACK_FRAME_OVERHEAD 925 addi r3,r1,STACK_FRAME_OVERHEAD
687 bl .save_nvgprs 926 bl .save_nvgprs
688 INTS_RESTORE_HARD 927 INTS_RESTORE_HARD
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 38d507306a11..3afd3915921a 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -54,14 +54,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE) \
54 xori r12,r12,MSR_LE ; \ 54 xori r12,r12,MSR_LE ; \
55 mtspr SPRN_SRR1,r12 ; \ 55 mtspr SPRN_SRR1,r12 ; \
56 rfid ; /* return to userspace */ \ 56 rfid ; /* return to userspace */ \
57 b . ; \
582: mfspr r12,SPRN_SRR1 ; \
59 andi. r12,r12,MSR_PR ; \
60 bne 0b ; \
61 mtspr SPRN_SRR0,r3 ; \
62 mtspr SPRN_SRR1,r4 ; \
63 mtspr SPRN_SDR1,r5 ; \
64 rfid ; \
65 b . ; /* prevent speculative execution */ 57 b . ; /* prevent speculative execution */
66 58
67#if defined(CONFIG_RELOCATABLE) 59#if defined(CONFIG_RELOCATABLE)
@@ -121,9 +113,10 @@ BEGIN_FTR_SECTION
121 cmpwi cr1,r13,2 113 cmpwi cr1,r13,2
122 /* Total loss of HV state is fatal, we could try to use the 114 /* Total loss of HV state is fatal, we could try to use the
123 * PIR to locate a PACA, then use an emergency stack etc... 115 * PIR to locate a PACA, then use an emergency stack etc...
124 * but for now, let's just stay stuck here 116 * OPAL v3 based powernv platforms have new idle states
117 * which fall in this catagory.
125 */ 118 */
126 bgt cr1,. 119 bgt cr1,8f
127 GET_PACA(r13) 120 GET_PACA(r13)
128 121
129#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE 122#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
@@ -141,6 +134,11 @@ BEGIN_FTR_SECTION
141 beq cr1,2f 134 beq cr1,2f
142 b .power7_wakeup_noloss 135 b .power7_wakeup_noloss
1432: b .power7_wakeup_loss 1362: b .power7_wakeup_loss
137
138 /* Fast Sleep wakeup on PowerNV */
1398: GET_PACA(r13)
140 b .power7_wakeup_tb_loss
141
1449: 1429:
145END_FTR_SECTION_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_206) 143END_FTR_SECTION_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_206)
146#endif /* CONFIG_PPC_P7_NAP */ 144#endif /* CONFIG_PPC_P7_NAP */
@@ -164,13 +162,18 @@ BEGIN_FTR_SECTION
164 */ 162 */
165 mfspr r13,SPRN_SRR1 163 mfspr r13,SPRN_SRR1
166 rlwinm. r13,r13,47-31,30,31 164 rlwinm. r13,r13,47-31,30,31
165 OPT_GET_SPR(r13, SPRN_CFAR, CPU_FTR_CFAR)
167 beq 9f 166 beq 9f
168 167
168 mfspr r13,SPRN_SRR1
169 rlwinm. r13,r13,47-31,30,31
169 /* waking up from powersave (nap) state */ 170 /* waking up from powersave (nap) state */
170 cmpwi cr1,r13,2 171 cmpwi cr1,r13,2
171 /* Total loss of HV state is fatal. let's just stay stuck here */ 172 /* Total loss of HV state is fatal. let's just stay stuck here */
173 OPT_GET_SPR(r13, SPRN_CFAR, CPU_FTR_CFAR)
172 bgt cr1,. 174 bgt cr1,.
1739: 1759:
176 OPT_SET_SPR(r13, SPRN_CFAR, CPU_FTR_CFAR)
174END_FTR_SECTION_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_206) 177END_FTR_SECTION_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_206)
175#endif /* CONFIG_PPC_P7_NAP */ 178#endif /* CONFIG_PPC_P7_NAP */
176 EXCEPTION_PROLOG_0(PACA_EXMC) 179 EXCEPTION_PROLOG_0(PACA_EXMC)
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
index b0ded97ee4e1..6a014c763cc7 100644
--- a/arch/powerpc/kernel/ftrace.c
+++ b/arch/powerpc/kernel/ftrace.c
@@ -532,13 +532,8 @@ void arch_ftrace_update_code(int command)
532 ftrace_disable_ftrace_graph_caller(); 532 ftrace_disable_ftrace_graph_caller();
533} 533}
534 534
535int __init ftrace_dyn_arch_init(void *data) 535int __init ftrace_dyn_arch_init(void)
536{ 536{
537 /* caller expects data to be zero */
538 unsigned long *p = data;
539
540 *p = 0;
541
542 return 0; 537 return 0;
543} 538}
544#endif /* CONFIG_DYNAMIC_FTRACE */ 539#endif /* CONFIG_DYNAMIC_FTRACE */
diff --git a/arch/powerpc/kernel/idle_power7.S b/arch/powerpc/kernel/idle_power7.S
index 3fdef0f0c67f..c3ab86975614 100644
--- a/arch/powerpc/kernel/idle_power7.S
+++ b/arch/powerpc/kernel/idle_power7.S
@@ -17,20 +17,31 @@
17#include <asm/ppc-opcode.h> 17#include <asm/ppc-opcode.h>
18#include <asm/hw_irq.h> 18#include <asm/hw_irq.h>
19#include <asm/kvm_book3s_asm.h> 19#include <asm/kvm_book3s_asm.h>
20#include <asm/opal.h>
20 21
21#undef DEBUG 22#undef DEBUG
22 23
23 .text 24/* Idle state entry routines */
24 25
25_GLOBAL(power7_idle) 26#define IDLE_STATE_ENTER_SEQ(IDLE_INST) \
26 /* Now check if user or arch enabled NAP mode */ 27 /* Magic NAP/SLEEP/WINKLE mode enter sequence */ \
27 LOAD_REG_ADDRBASE(r3,powersave_nap) 28 std r0,0(r1); \
28 lwz r4,ADDROFF(powersave_nap)(r3) 29 ptesync; \
29 cmpwi 0,r4,0 30 ld r0,0(r1); \
30 beqlr 311: cmp cr0,r0,r0; \
31 /* fall through */ 32 bne 1b; \
33 IDLE_INST; \
34 b .
32 35
33_GLOBAL(power7_nap) 36 .text
37
38/*
39 * Pass requested state in r3:
40 * 0 - nap
41 * 1 - sleep
42 */
43_GLOBAL(power7_powersave_common)
44 /* Use r3 to pass state nap/sleep/winkle */
34 /* NAP is a state loss, we create a regs frame on the 45 /* NAP is a state loss, we create a regs frame on the
35 * stack, fill it up with the state we care about and 46 * stack, fill it up with the state we care about and
36 * stick a pointer to it in PACAR1. We really only 47 * stick a pointer to it in PACAR1. We really only
@@ -79,8 +90,8 @@ _GLOBAL(power7_nap)
79 /* Continue saving state */ 90 /* Continue saving state */
80 SAVE_GPR(2, r1) 91 SAVE_GPR(2, r1)
81 SAVE_NVGPRS(r1) 92 SAVE_NVGPRS(r1)
82 mfcr r3 93 mfcr r4
83 std r3,_CCR(r1) 94 std r4,_CCR(r1)
84 std r9,_MSR(r1) 95 std r9,_MSR(r1)
85 std r1,PACAR1(r13) 96 std r1,PACAR1(r13)
86 97
@@ -90,15 +101,56 @@ _GLOBAL(power7_enter_nap_mode)
90 li r4,KVM_HWTHREAD_IN_NAP 101 li r4,KVM_HWTHREAD_IN_NAP
91 stb r4,HSTATE_HWTHREAD_STATE(r13) 102 stb r4,HSTATE_HWTHREAD_STATE(r13)
92#endif 103#endif
104 cmpwi cr0,r3,1
105 beq 2f
106 IDLE_STATE_ENTER_SEQ(PPC_NAP)
107 /* No return */
1082: IDLE_STATE_ENTER_SEQ(PPC_SLEEP)
109 /* No return */
93 110
94 /* Magic NAP mode enter sequence */ 111_GLOBAL(power7_idle)
95 std r0,0(r1) 112 /* Now check if user or arch enabled NAP mode */
96 ptesync 113 LOAD_REG_ADDRBASE(r3,powersave_nap)
97 ld r0,0(r1) 114 lwz r4,ADDROFF(powersave_nap)(r3)
981: cmp cr0,r0,r0 115 cmpwi 0,r4,0
99 bne 1b 116 beqlr
100 PPC_NAP 117 /* fall through */
101 b . 118
119_GLOBAL(power7_nap)
120 li r3,0
121 b power7_powersave_common
122 /* No return */
123
124_GLOBAL(power7_sleep)
125 li r3,1
126 b power7_powersave_common
127 /* No return */
128
129_GLOBAL(power7_wakeup_tb_loss)
130 ld r2,PACATOC(r13);
131 ld r1,PACAR1(r13)
132
133 /* Time base re-sync */
134 li r0,OPAL_RESYNC_TIMEBASE
135 LOAD_REG_ADDR(r11,opal);
136 ld r12,8(r11);
137 ld r2,0(r11);
138 mtctr r12
139 bctrl
140
141 /* TODO: Check r3 for failure */
142
143 REST_NVGPRS(r1)
144 REST_GPR(2, r1)
145 ld r3,_CCR(r1)
146 ld r4,_MSR(r1)
147 ld r5,_NIP(r1)
148 addi r1,r1,INT_FRAME_SIZE
149 mtcr r3
150 mfspr r3,SPRN_SRR1 /* Return SRR1 */
151 mtspr SPRN_SRR1,r4
152 mtspr SPRN_SRR0,r5
153 rfid
102 154
103_GLOBAL(power7_wakeup_loss) 155_GLOBAL(power7_wakeup_loss)
104 ld r1,PACAR1(r13) 156 ld r1,PACAR1(r13)
diff --git a/arch/powerpc/kernel/mce.c b/arch/powerpc/kernel/mce.c
index cadef7e64e42..a7fd4cb78b78 100644
--- a/arch/powerpc/kernel/mce.c
+++ b/arch/powerpc/kernel/mce.c
@@ -70,7 +70,7 @@ static void mce_set_error_info(struct machine_check_event *mce,
70 */ 70 */
71void save_mce_event(struct pt_regs *regs, long handled, 71void save_mce_event(struct pt_regs *regs, long handled,
72 struct mce_error_info *mce_err, 72 struct mce_error_info *mce_err,
73 uint64_t addr) 73 uint64_t nip, uint64_t addr)
74{ 74{
75 uint64_t srr1; 75 uint64_t srr1;
76 int index = __get_cpu_var(mce_nest_count)++; 76 int index = __get_cpu_var(mce_nest_count)++;
@@ -86,7 +86,7 @@ void save_mce_event(struct pt_regs *regs, long handled,
86 86
87 /* Populate generic machine check info */ 87 /* Populate generic machine check info */
88 mce->version = MCE_V1; 88 mce->version = MCE_V1;
89 mce->srr0 = regs->nip; 89 mce->srr0 = nip;
90 mce->srr1 = regs->msr; 90 mce->srr1 = regs->msr;
91 mce->gpr3 = regs->gpr[3]; 91 mce->gpr3 = regs->gpr[3];
92 mce->in_use = 1; 92 mce->in_use = 1;
diff --git a/arch/powerpc/kernel/mce_power.c b/arch/powerpc/kernel/mce_power.c
index 27c93f41166f..aa9aff3d6ad3 100644
--- a/arch/powerpc/kernel/mce_power.c
+++ b/arch/powerpc/kernel/mce_power.c
@@ -26,6 +26,7 @@
26#include <linux/ptrace.h> 26#include <linux/ptrace.h>
27#include <asm/mmu.h> 27#include <asm/mmu.h>
28#include <asm/mce.h> 28#include <asm/mce.h>
29#include <asm/machdep.h>
29 30
30/* flush SLBs and reload */ 31/* flush SLBs and reload */
31static void flush_and_reload_slb(void) 32static void flush_and_reload_slb(void)
@@ -197,13 +198,32 @@ static void mce_get_derror_p7(struct mce_error_info *mce_err, uint64_t dsisr)
197 } 198 }
198} 199}
199 200
201static long mce_handle_ue_error(struct pt_regs *regs)
202{
203 long handled = 0;
204
205 /*
206 * On specific SCOM read via MMIO we may get a machine check
207 * exception with SRR0 pointing inside opal. If that is the
208 * case OPAL may have recovery address to re-read SCOM data in
209 * different way and hence we can recover from this MC.
210 */
211
212 if (ppc_md.mce_check_early_recovery) {
213 if (ppc_md.mce_check_early_recovery(regs))
214 handled = 1;
215 }
216 return handled;
217}
218
200long __machine_check_early_realmode_p7(struct pt_regs *regs) 219long __machine_check_early_realmode_p7(struct pt_regs *regs)
201{ 220{
202 uint64_t srr1, addr; 221 uint64_t srr1, nip, addr;
203 long handled = 1; 222 long handled = 1;
204 struct mce_error_info mce_error_info = { 0 }; 223 struct mce_error_info mce_error_info = { 0 };
205 224
206 srr1 = regs->msr; 225 srr1 = regs->msr;
226 nip = regs->nip;
207 227
208 /* 228 /*
209 * Handle memory errors depending whether this was a load/store or 229 * Handle memory errors depending whether this was a load/store or
@@ -221,7 +241,11 @@ long __machine_check_early_realmode_p7(struct pt_regs *regs)
221 addr = regs->nip; 241 addr = regs->nip;
222 } 242 }
223 243
224 save_mce_event(regs, handled, &mce_error_info, addr); 244 /* Handle UE error. */
245 if (mce_error_info.error_type == MCE_ERROR_TYPE_UE)
246 handled = mce_handle_ue_error(regs);
247
248 save_mce_event(regs, handled, &mce_error_info, nip, addr);
225 return handled; 249 return handled;
226} 250}
227 251
@@ -263,11 +287,12 @@ static long mce_handle_derror_p8(uint64_t dsisr)
263 287
264long __machine_check_early_realmode_p8(struct pt_regs *regs) 288long __machine_check_early_realmode_p8(struct pt_regs *regs)
265{ 289{
266 uint64_t srr1, addr; 290 uint64_t srr1, nip, addr;
267 long handled = 1; 291 long handled = 1;
268 struct mce_error_info mce_error_info = { 0 }; 292 struct mce_error_info mce_error_info = { 0 };
269 293
270 srr1 = regs->msr; 294 srr1 = regs->msr;
295 nip = regs->nip;
271 296
272 if (P7_SRR1_MC_LOADSTORE(srr1)) { 297 if (P7_SRR1_MC_LOADSTORE(srr1)) {
273 handled = mce_handle_derror_p8(regs->dsisr); 298 handled = mce_handle_derror_p8(regs->dsisr);
@@ -279,6 +304,10 @@ long __machine_check_early_realmode_p8(struct pt_regs *regs)
279 addr = regs->nip; 304 addr = regs->nip;
280 } 305 }
281 306
282 save_mce_event(regs, handled, &mce_error_info, addr); 307 /* Handle UE error. */
308 if (mce_error_info.error_type == MCE_ERROR_TYPE_UE)
309 handled = mce_handle_ue_error(regs);
310
311 save_mce_event(regs, handled, &mce_error_info, nip, addr);
283 return handled; 312 return handled;
284} 313}
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c
index bf0aada02fe4..ad302f845e5d 100644
--- a/arch/powerpc/kernel/paca.c
+++ b/arch/powerpc/kernel/paca.c
@@ -152,7 +152,8 @@ void __init initialise_paca(struct paca_struct *new_paca, int cpu)
152 new_paca->paca_index = cpu; 152 new_paca->paca_index = cpu;
153 new_paca->kernel_toc = kernel_toc; 153 new_paca->kernel_toc = kernel_toc;
154 new_paca->kernelbase = (unsigned long) _stext; 154 new_paca->kernelbase = (unsigned long) _stext;
155 new_paca->kernel_msr = MSR_KERNEL; 155 /* Only set MSR:IR/DR when MMU is initialized */
156 new_paca->kernel_msr = MSR_KERNEL & ~(MSR_IR | MSR_DR);
156 new_paca->hw_cpu_id = 0xffff; 157 new_paca->hw_cpu_id = 0xffff;
157 new_paca->kexec_state = KEXEC_STATE_NONE; 158 new_paca->kexec_state = KEXEC_STATE_NONE;
158 new_paca->__current = &init_task; 159 new_paca->__current = &init_task;
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index a9e311f7a9dd..2a4779091a58 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -208,7 +208,6 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
208 unsigned long in_devfn) 208 unsigned long in_devfn)
209{ 209{
210 struct pci_controller* hose; 210 struct pci_controller* hose;
211 struct list_head *ln;
212 struct pci_bus *bus = NULL; 211 struct pci_bus *bus = NULL;
213 struct device_node *hose_node; 212 struct device_node *hose_node;
214 213
@@ -230,8 +229,7 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
230 * used on pre-domains setup. We return the first match 229 * used on pre-domains setup. We return the first match
231 */ 230 */
232 231
233 for (ln = pci_root_buses.next; ln != &pci_root_buses; ln = ln->next) { 232 list_for_each_entry(bus, &pci_root_buses, node) {
234 bus = pci_bus_b(ln);
235 if (in_bus >= bus->number && in_bus <= bus->busn_res.end) 233 if (in_bus >= bus->number && in_bus <= bus->busn_res.end)
236 break; 234 break;
237 bus = NULL; 235 bus = NULL;
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index af064d28b365..31d021506d21 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -610,6 +610,31 @@ out_and_saveregs:
610 tm_save_sprs(thr); 610 tm_save_sprs(thr);
611} 611}
612 612
613extern void __tm_recheckpoint(struct thread_struct *thread,
614 unsigned long orig_msr);
615
616void tm_recheckpoint(struct thread_struct *thread,
617 unsigned long orig_msr)
618{
619 unsigned long flags;
620
621 /* We really can't be interrupted here as the TEXASR registers can't
622 * change and later in the trecheckpoint code, we have a userspace R1.
623 * So let's hard disable over this region.
624 */
625 local_irq_save(flags);
626 hard_irq_disable();
627
628 /* The TM SPRs are restored here, so that TEXASR.FS can be set
629 * before the trecheckpoint and no explosion occurs.
630 */
631 tm_restore_sprs(thread);
632
633 __tm_recheckpoint(thread, orig_msr);
634
635 local_irq_restore(flags);
636}
637
613static inline void tm_recheckpoint_new_task(struct task_struct *new) 638static inline void tm_recheckpoint_new_task(struct task_struct *new)
614{ 639{
615 unsigned long msr; 640 unsigned long msr;
@@ -628,13 +653,10 @@ static inline void tm_recheckpoint_new_task(struct task_struct *new)
628 if (!new->thread.regs) 653 if (!new->thread.regs)
629 return; 654 return;
630 655
631 /* The TM SPRs are restored here, so that TEXASR.FS can be set 656 if (!MSR_TM_ACTIVE(new->thread.regs->msr)){
632 * before the trecheckpoint and no explosion occurs. 657 tm_restore_sprs(&new->thread);
633 */
634 tm_restore_sprs(&new->thread);
635
636 if (!MSR_TM_ACTIVE(new->thread.regs->msr))
637 return; 658 return;
659 }
638 msr = new->thread.tm_orig_msr; 660 msr = new->thread.tm_orig_msr;
639 /* Recheckpoint to restore original checkpointed register state. */ 661 /* Recheckpoint to restore original checkpointed register state. */
640 TM_DEBUG("*** tm_recheckpoint of pid %d " 662 TM_DEBUG("*** tm_recheckpoint of pid %d "
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index f58c0d3aaeb4..668aa4791fd7 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -33,6 +33,7 @@
33#include <linux/irq.h> 33#include <linux/irq.h>
34#include <linux/memblock.h> 34#include <linux/memblock.h>
35#include <linux/of.h> 35#include <linux/of.h>
36#include <linux/of_fdt.h>
36 37
37#include <asm/prom.h> 38#include <asm/prom.h>
38#include <asm/rtas.h> 39#include <asm/rtas.h>
@@ -346,45 +347,45 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
346#endif 347#endif
347 } 348 }
348 349
349 if (found >= 0) { 350 /* Not the boot CPU */
350 DBG("boot cpu: logical %d physical %d\n", found, 351 if (found < 0)
351 be32_to_cpu(intserv[found_thread])); 352 return 0;
352 boot_cpuid = found;
353 set_hard_smp_processor_id(found,
354 be32_to_cpu(intserv[found_thread]));
355 353
356 /* 354 DBG("boot cpu: logical %d physical %d\n", found,
357 * PAPR defines "logical" PVR values for cpus that 355 be32_to_cpu(intserv[found_thread]));
358 * meet various levels of the architecture: 356 boot_cpuid = found;
359 * 0x0f000001 Architecture version 2.04 357 set_hard_smp_processor_id(found, be32_to_cpu(intserv[found_thread]));
360 * 0x0f000002 Architecture version 2.05
361 * If the cpu-version property in the cpu node contains
362 * such a value, we call identify_cpu again with the
363 * logical PVR value in order to use the cpu feature
364 * bits appropriate for the architecture level.
365 *
366 * A POWER6 partition in "POWER6 architected" mode
367 * uses the 0x0f000002 PVR value; in POWER5+ mode
368 * it uses 0x0f000001.
369 */
370 prop = of_get_flat_dt_prop(node, "cpu-version", NULL);
371 if (prop && (be32_to_cpup(prop) & 0xff000000) == 0x0f000000)
372 identify_cpu(0, be32_to_cpup(prop));
373 358
374 identical_pvr_fixup(node); 359 /*
375 } 360 * PAPR defines "logical" PVR values for cpus that
361 * meet various levels of the architecture:
362 * 0x0f000001 Architecture version 2.04
363 * 0x0f000002 Architecture version 2.05
364 * If the cpu-version property in the cpu node contains
365 * such a value, we call identify_cpu again with the
366 * logical PVR value in order to use the cpu feature
367 * bits appropriate for the architecture level.
368 *
369 * A POWER6 partition in "POWER6 architected" mode
370 * uses the 0x0f000002 PVR value; in POWER5+ mode
371 * it uses 0x0f000001.
372 */
373 prop = of_get_flat_dt_prop(node, "cpu-version", NULL);
374 if (prop && (be32_to_cpup(prop) & 0xff000000) == 0x0f000000)
375 identify_cpu(0, be32_to_cpup(prop));
376
377 identical_pvr_fixup(node);
376 378
377 check_cpu_feature_properties(node); 379 check_cpu_feature_properties(node);
378 check_cpu_pa_features(node); 380 check_cpu_pa_features(node);
379 check_cpu_slb_size(node); 381 check_cpu_slb_size(node);
380 382
381#ifdef CONFIG_PPC_PSERIES 383#ifdef CONFIG_PPC64
382 if (nthreads > 1) 384 if (nthreads > 1)
383 cur_cpu_spec->cpu_features |= CPU_FTR_SMT; 385 cur_cpu_spec->cpu_features |= CPU_FTR_SMT;
384 else 386 else
385 cur_cpu_spec->cpu_features &= ~CPU_FTR_SMT; 387 cur_cpu_spec->cpu_features &= ~CPU_FTR_SMT;
386#endif 388#endif
387
388 return 0; 389 return 0;
389} 390}
390 391
@@ -588,6 +589,8 @@ static void __init early_reserve_mem_dt(void)
588 memblock_reserve(base, size); 589 memblock_reserve(base, size);
589 } 590 }
590 } 591 }
592
593 early_init_fdt_scan_reserved_mem();
591} 594}
592 595
593static void __init early_reserve_mem(void) 596static void __init early_reserve_mem(void)
@@ -744,6 +747,10 @@ void __init early_init_devtree(void *params)
744 * (altivec support, boot CPU ID, ...) 747 * (altivec support, boot CPU ID, ...)
745 */ 748 */
746 of_scan_flat_dt(early_init_dt_scan_cpus, NULL); 749 of_scan_flat_dt(early_init_dt_scan_cpus, NULL);
750 if (boot_cpuid < 0) {
751 printk("Failed to indentify boot CPU !\n");
752 BUG();
753 }
747 754
748#if defined(CONFIG_SMP) && defined(CONFIG_PPC64) 755#if defined(CONFIG_SMP) && defined(CONFIG_PPC64)
749 /* We'll later wait for secondaries to check in; there are 756 /* We'll later wait for secondaries to check in; there are
@@ -752,6 +759,11 @@ void __init early_init_devtree(void *params)
752 spinning_secondaries = boot_cpu_count - 1; 759 spinning_secondaries = boot_cpu_count - 1;
753#endif 760#endif
754 761
762#ifdef CONFIG_PPC_POWERNV
763 /* Scan and build the list of machine check recoverable ranges */
764 of_scan_flat_dt(early_init_dt_scan_recoverable_ranges, NULL);
765#endif
766
755 DBG(" <- early_init_devtree()\n"); 767 DBG(" <- early_init_devtree()\n");
756} 768}
757 769
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 4cf674d7d5ae..8cd5ed049b5d 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -993,32 +993,36 @@ struct pseries_errorlog *get_pseries_errorlog(struct rtas_error_log *log,
993 (struct rtas_ext_event_log_v6 *)log->buffer; 993 (struct rtas_ext_event_log_v6 *)log->buffer;
994 struct pseries_errorlog *sect; 994 struct pseries_errorlog *sect;
995 unsigned char *p, *log_end; 995 unsigned char *p, *log_end;
996 uint32_t ext_log_length = rtas_error_extended_log_length(log);
997 uint8_t log_format = rtas_ext_event_log_format(ext_log);
998 uint32_t company_id = rtas_ext_event_company_id(ext_log);
996 999
997 /* Check that we understand the format */ 1000 /* Check that we understand the format */
998 if (log->extended_log_length < sizeof(struct rtas_ext_event_log_v6) || 1001 if (ext_log_length < sizeof(struct rtas_ext_event_log_v6) ||
999 ext_log->log_format != RTAS_V6EXT_LOG_FORMAT_EVENT_LOG || 1002 log_format != RTAS_V6EXT_LOG_FORMAT_EVENT_LOG ||
1000 ext_log->company_id != RTAS_V6EXT_COMPANY_ID_IBM) 1003 company_id != RTAS_V6EXT_COMPANY_ID_IBM)
1001 return NULL; 1004 return NULL;
1002 1005
1003 log_end = log->buffer + log->extended_log_length; 1006 log_end = log->buffer + ext_log_length;
1004 p = ext_log->vendor_log; 1007 p = ext_log->vendor_log;
1005 1008
1006 while (p < log_end) { 1009 while (p < log_end) {
1007 sect = (struct pseries_errorlog *)p; 1010 sect = (struct pseries_errorlog *)p;
1008 if (sect->id == section_id) 1011 if (pseries_errorlog_id(sect) == section_id)
1009 return sect; 1012 return sect;
1010 p += sect->length; 1013 p += pseries_errorlog_length(sect);
1011 } 1014 }
1012 1015
1013 return NULL; 1016 return NULL;
1014} 1017}
1015 1018
1019/* We assume to be passed big endian arguments */
1016asmlinkage int ppc_rtas(struct rtas_args __user *uargs) 1020asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
1017{ 1021{
1018 struct rtas_args args; 1022 struct rtas_args args;
1019 unsigned long flags; 1023 unsigned long flags;
1020 char *buff_copy, *errbuf = NULL; 1024 char *buff_copy, *errbuf = NULL;
1021 int nargs; 1025 int nargs, nret, token;
1022 int rc; 1026 int rc;
1023 1027
1024 if (!capable(CAP_SYS_ADMIN)) 1028 if (!capable(CAP_SYS_ADMIN))
@@ -1027,10 +1031,13 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
1027 if (copy_from_user(&args, uargs, 3 * sizeof(u32)) != 0) 1031 if (copy_from_user(&args, uargs, 3 * sizeof(u32)) != 0)
1028 return -EFAULT; 1032 return -EFAULT;
1029 1033
1030 nargs = args.nargs; 1034 nargs = be32_to_cpu(args.nargs);
1035 nret = be32_to_cpu(args.nret);
1036 token = be32_to_cpu(args.token);
1037
1031 if (nargs > ARRAY_SIZE(args.args) 1038 if (nargs > ARRAY_SIZE(args.args)
1032 || args.nret > ARRAY_SIZE(args.args) 1039 || nret > ARRAY_SIZE(args.args)
1033 || nargs + args.nret > ARRAY_SIZE(args.args)) 1040 || nargs + nret > ARRAY_SIZE(args.args))
1034 return -EINVAL; 1041 return -EINVAL;
1035 1042
1036 /* Copy in args. */ 1043 /* Copy in args. */
@@ -1038,14 +1045,14 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
1038 nargs * sizeof(rtas_arg_t)) != 0) 1045 nargs * sizeof(rtas_arg_t)) != 0)
1039 return -EFAULT; 1046 return -EFAULT;
1040 1047
1041 if (args.token == RTAS_UNKNOWN_SERVICE) 1048 if (token == RTAS_UNKNOWN_SERVICE)
1042 return -EINVAL; 1049 return -EINVAL;
1043 1050
1044 args.rets = &args.args[nargs]; 1051 args.rets = &args.args[nargs];
1045 memset(args.rets, 0, args.nret * sizeof(rtas_arg_t)); 1052 memset(args.rets, 0, nret * sizeof(rtas_arg_t));
1046 1053
1047 /* Need to handle ibm,suspend_me call specially */ 1054 /* Need to handle ibm,suspend_me call specially */
1048 if (args.token == ibm_suspend_me_token) { 1055 if (token == ibm_suspend_me_token) {
1049 rc = rtas_ibm_suspend_me(&args); 1056 rc = rtas_ibm_suspend_me(&args);
1050 if (rc) 1057 if (rc)
1051 return rc; 1058 return rc;
@@ -1062,7 +1069,7 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
1062 1069
1063 /* A -1 return code indicates that the last command couldn't 1070 /* A -1 return code indicates that the last command couldn't
1064 be completed due to a hardware error. */ 1071 be completed due to a hardware error. */
1065 if (args.rets[0] == -1) 1072 if (be32_to_cpu(args.rets[0]) == -1)
1066 errbuf = __fetch_rtas_last_error(buff_copy); 1073 errbuf = __fetch_rtas_last_error(buff_copy);
1067 1074
1068 unlock_rtas(flags); 1075 unlock_rtas(flags);
@@ -1077,7 +1084,7 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
1077 /* Copy out args. */ 1084 /* Copy out args. */
1078 if (copy_to_user(uargs->args + nargs, 1085 if (copy_to_user(uargs->args + nargs,
1079 args.args + nargs, 1086 args.args + nargs,
1080 args.nret * sizeof(rtas_arg_t)) != 0) 1087 nret * sizeof(rtas_arg_t)) != 0)
1081 return -EFAULT; 1088 return -EFAULT;
1082 1089
1083 return 0; 1090 return 0;
diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c
index 1130c53ad652..e736387fee6a 100644
--- a/arch/powerpc/kernel/rtasd.c
+++ b/arch/powerpc/kernel/rtasd.c
@@ -150,8 +150,8 @@ static void printk_log_rtas(char *buf, int len)
150 struct rtas_error_log *errlog = (struct rtas_error_log *)buf; 150 struct rtas_error_log *errlog = (struct rtas_error_log *)buf;
151 151
152 printk(RTAS_DEBUG "event: %d, Type: %s, Severity: %d\n", 152 printk(RTAS_DEBUG "event: %d, Type: %s, Severity: %d\n",
153 error_log_cnt, rtas_event_type(errlog->type), 153 error_log_cnt, rtas_event_type(rtas_error_type(errlog)),
154 errlog->severity); 154 rtas_error_severity(errlog));
155 } 155 }
156} 156}
157 157
@@ -159,14 +159,16 @@ static int log_rtas_len(char * buf)
159{ 159{
160 int len; 160 int len;
161 struct rtas_error_log *err; 161 struct rtas_error_log *err;
162 uint32_t extended_log_length;
162 163
163 /* rtas fixed header */ 164 /* rtas fixed header */
164 len = 8; 165 len = 8;
165 err = (struct rtas_error_log *)buf; 166 err = (struct rtas_error_log *)buf;
166 if (err->extended && err->extended_log_length) { 167 extended_log_length = rtas_error_extended_log_length(err);
168 if (rtas_error_extended(err) && extended_log_length) {
167 169
168 /* extended header */ 170 /* extended header */
169 len += err->extended_log_length; 171 len += extended_log_length;
170 } 172 }
171 173
172 if (rtas_error_log_max == 0) 174 if (rtas_error_log_max == 0)
@@ -293,15 +295,13 @@ void prrn_schedule_update(u32 scope)
293 295
294static void handle_rtas_event(const struct rtas_error_log *log) 296static void handle_rtas_event(const struct rtas_error_log *log)
295{ 297{
296 if (log->type == RTAS_TYPE_PRRN) { 298 if (rtas_error_type(log) != RTAS_TYPE_PRRN || !prrn_is_enabled())
297 /* For PRRN Events the extended log length is used to denote 299 return;
298 * the scope for calling rtas update-nodes.
299 */
300 if (prrn_is_enabled())
301 prrn_schedule_update(log->extended_log_length);
302 }
303 300
304 return; 301 /* For PRRN Events the extended log length is used to denote
302 * the scope for calling rtas update-nodes.
303 */
304 prrn_schedule_update(rtas_error_extended_log_length(log));
305} 305}
306 306
307#else 307#else
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index bc76cc6b419c..79b7612ac6fa 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -76,6 +76,9 @@ EXPORT_SYMBOL(ppc_md);
76struct machdep_calls *machine_id; 76struct machdep_calls *machine_id;
77EXPORT_SYMBOL(machine_id); 77EXPORT_SYMBOL(machine_id);
78 78
79int boot_cpuid = -1;
80EXPORT_SYMBOL_GPL(boot_cpuid);
81
79unsigned long klimit = (unsigned long) _end; 82unsigned long klimit = (unsigned long) _end;
80 83
81char cmd_line[COMMAND_LINE_SIZE]; 84char cmd_line[COMMAND_LINE_SIZE];
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 04cc4fcca78b..ea4fda60e57b 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -44,8 +44,6 @@
44 44
45extern void bootx_init(unsigned long r4, unsigned long phys); 45extern void bootx_init(unsigned long r4, unsigned long phys);
46 46
47int boot_cpuid = -1;
48EXPORT_SYMBOL_GPL(boot_cpuid);
49int boot_cpuid_phys; 47int boot_cpuid_phys;
50EXPORT_SYMBOL_GPL(boot_cpuid_phys); 48EXPORT_SYMBOL_GPL(boot_cpuid_phys);
51 49
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index f5f11a7d30e5..fbe24377eda3 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -74,7 +74,6 @@
74#define DBG(fmt...) 74#define DBG(fmt...)
75#endif 75#endif
76 76
77int boot_cpuid = 0;
78int spinning_secondaries; 77int spinning_secondaries;
79u64 ppc64_pft_size; 78u64 ppc64_pft_size;
80 79
@@ -102,6 +101,8 @@ static void setup_tlb_core_data(void)
102{ 101{
103 int cpu; 102 int cpu;
104 103
104 BUILD_BUG_ON(offsetof(struct tlb_core_data, lock) != 0);
105
105 for_each_possible_cpu(cpu) { 106 for_each_possible_cpu(cpu) {
106 int first = cpu_first_thread_sibling(cpu); 107 int first = cpu_first_thread_sibling(cpu);
107 108
@@ -194,6 +195,19 @@ static void fixup_boot_paca(void)
194 get_paca()->data_offset = 0; 195 get_paca()->data_offset = 0;
195} 196}
196 197
198static void cpu_ready_for_interrupts(void)
199{
200 /* Set IR and DR in PACA MSR */
201 get_paca()->kernel_msr = MSR_KERNEL;
202
203 /* Enable AIL if supported */
204 if (cpu_has_feature(CPU_FTR_HVMODE) &&
205 cpu_has_feature(CPU_FTR_ARCH_207S)) {
206 unsigned long lpcr = mfspr(SPRN_LPCR);
207 mtspr(SPRN_LPCR, lpcr | LPCR_AIL_3);
208 }
209}
210
197/* 211/*
198 * Early initialization entry point. This is called by head.S 212 * Early initialization entry point. This is called by head.S
199 * with MMU translation disabled. We rely on the "feature" of 213 * with MMU translation disabled. We rely on the "feature" of
@@ -260,6 +274,14 @@ void __init early_setup(unsigned long dt_ptr)
260 /* Initialize the hash table or TLB handling */ 274 /* Initialize the hash table or TLB handling */
261 early_init_mmu(); 275 early_init_mmu();
262 276
277 /*
278 * At this point, we can let interrupts switch to virtual mode
279 * (the MMU has been setup), so adjust the MSR in the PACA to
280 * have IR and DR set and enable AIL if it exists
281 */
282 cpu_ready_for_interrupts();
283
284 /* Reserve large chunks of memory for use by CMA for KVM */
263 kvm_cma_reserve(); 285 kvm_cma_reserve();
264 286
265 /* 287 /*
@@ -292,6 +314,13 @@ void early_setup_secondary(void)
292 314
293 /* Initialize the hash table or TLB handling */ 315 /* Initialize the hash table or TLB handling */
294 early_init_mmu_secondary(); 316 early_init_mmu_secondary();
317
318 /*
319 * At this point, we can let interrupts switch to virtual mode
320 * (the MMU has been setup), so adjust the MSR in the PACA to
321 * have IR and DR set.
322 */
323 cpu_ready_for_interrupts();
295} 324}
296 325
297#endif /* CONFIG_SMP */ 326#endif /* CONFIG_SMP */
@@ -552,14 +581,20 @@ static void __init irqstack_early_init(void)
552static void __init exc_lvl_early_init(void) 581static void __init exc_lvl_early_init(void)
553{ 582{
554 unsigned int i; 583 unsigned int i;
584 unsigned long sp;
555 585
556 for_each_possible_cpu(i) { 586 for_each_possible_cpu(i) {
557 critirq_ctx[i] = (struct thread_info *) 587 sp = memblock_alloc(THREAD_SIZE, THREAD_SIZE);
558 __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); 588 critirq_ctx[i] = (struct thread_info *)__va(sp);
559 dbgirq_ctx[i] = (struct thread_info *) 589 paca[i].crit_kstack = __va(sp + THREAD_SIZE);
560 __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); 590
561 mcheckirq_ctx[i] = (struct thread_info *) 591 sp = memblock_alloc(THREAD_SIZE, THREAD_SIZE);
562 __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); 592 dbgirq_ctx[i] = (struct thread_info *)__va(sp);
593 paca[i].dbg_kstack = __va(sp + THREAD_SIZE);
594
595 sp = memblock_alloc(THREAD_SIZE, THREAD_SIZE);
596 mcheckirq_ctx[i] = (struct thread_info *)__va(sp);
597 paca[i].mc_kstack = __va(sp + THREAD_SIZE);
563 } 598 }
564 599
565 if (cpu_has_feature(CPU_FTR_DEBUG_LVL_EXC)) 600 if (cpu_has_feature(CPU_FTR_DEBUG_LVL_EXC))
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index a67e00aa3caa..4e47db686b5d 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -881,6 +881,8 @@ static long restore_tm_user_regs(struct pt_regs *regs,
881 * transactional versions should be loaded. 881 * transactional versions should be loaded.
882 */ 882 */
883 tm_enable(); 883 tm_enable();
884 /* Make sure the transaction is marked as failed */
885 current->thread.tm_texasr |= TEXASR_FS;
884 /* This loads the checkpointed FP/VEC state, if used */ 886 /* This loads the checkpointed FP/VEC state, if used */
885 tm_recheckpoint(&current->thread, msr); 887 tm_recheckpoint(&current->thread, msr);
886 /* Get the top half of the MSR */ 888 /* Get the top half of the MSR */
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index 8d253c29649b..d501dc4dc3e6 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -527,6 +527,8 @@ static long restore_tm_sigcontexts(struct pt_regs *regs,
527 } 527 }
528#endif 528#endif
529 tm_enable(); 529 tm_enable();
530 /* Make sure the transaction is marked as failed */
531 current->thread.tm_texasr |= TEXASR_FS;
530 /* This loads the checkpointed FP/VEC state, if used */ 532 /* This loads the checkpointed FP/VEC state, if used */
531 tm_recheckpoint(&current->thread, msr); 533 tm_recheckpoint(&current->thread, msr);
532 534
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index ac2621af3154..e2a4232c5871 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -35,6 +35,7 @@
35#include <asm/ptrace.h> 35#include <asm/ptrace.h>
36#include <linux/atomic.h> 36#include <linux/atomic.h>
37#include <asm/irq.h> 37#include <asm/irq.h>
38#include <asm/hw_irq.h>
38#include <asm/page.h> 39#include <asm/page.h>
39#include <asm/pgtable.h> 40#include <asm/pgtable.h>
40#include <asm/prom.h> 41#include <asm/prom.h>
@@ -145,9 +146,9 @@ static irqreturn_t reschedule_action(int irq, void *data)
145 return IRQ_HANDLED; 146 return IRQ_HANDLED;
146} 147}
147 148
148static irqreturn_t call_function_single_action(int irq, void *data) 149static irqreturn_t tick_broadcast_ipi_action(int irq, void *data)
149{ 150{
150 generic_smp_call_function_single_interrupt(); 151 tick_broadcast_ipi_handler();
151 return IRQ_HANDLED; 152 return IRQ_HANDLED;
152} 153}
153 154
@@ -168,14 +169,14 @@ static irqreturn_t debug_ipi_action(int irq, void *data)
168static irq_handler_t smp_ipi_action[] = { 169static irq_handler_t smp_ipi_action[] = {
169 [PPC_MSG_CALL_FUNCTION] = call_function_action, 170 [PPC_MSG_CALL_FUNCTION] = call_function_action,
170 [PPC_MSG_RESCHEDULE] = reschedule_action, 171 [PPC_MSG_RESCHEDULE] = reschedule_action,
171 [PPC_MSG_CALL_FUNC_SINGLE] = call_function_single_action, 172 [PPC_MSG_TICK_BROADCAST] = tick_broadcast_ipi_action,
172 [PPC_MSG_DEBUGGER_BREAK] = debug_ipi_action, 173 [PPC_MSG_DEBUGGER_BREAK] = debug_ipi_action,
173}; 174};
174 175
175const char *smp_ipi_name[] = { 176const char *smp_ipi_name[] = {
176 [PPC_MSG_CALL_FUNCTION] = "ipi call function", 177 [PPC_MSG_CALL_FUNCTION] = "ipi call function",
177 [PPC_MSG_RESCHEDULE] = "ipi reschedule", 178 [PPC_MSG_RESCHEDULE] = "ipi reschedule",
178 [PPC_MSG_CALL_FUNC_SINGLE] = "ipi call function single", 179 [PPC_MSG_TICK_BROADCAST] = "ipi tick-broadcast",
179 [PPC_MSG_DEBUGGER_BREAK] = "ipi debugger", 180 [PPC_MSG_DEBUGGER_BREAK] = "ipi debugger",
180}; 181};
181 182
@@ -251,8 +252,8 @@ irqreturn_t smp_ipi_demux(void)
251 generic_smp_call_function_interrupt(); 252 generic_smp_call_function_interrupt();
252 if (all & IPI_MESSAGE(PPC_MSG_RESCHEDULE)) 253 if (all & IPI_MESSAGE(PPC_MSG_RESCHEDULE))
253 scheduler_ipi(); 254 scheduler_ipi();
254 if (all & IPI_MESSAGE(PPC_MSG_CALL_FUNC_SINGLE)) 255 if (all & IPI_MESSAGE(PPC_MSG_TICK_BROADCAST))
255 generic_smp_call_function_single_interrupt(); 256 tick_broadcast_ipi_handler();
256 if (all & IPI_MESSAGE(PPC_MSG_DEBUGGER_BREAK)) 257 if (all & IPI_MESSAGE(PPC_MSG_DEBUGGER_BREAK))
257 debug_ipi_action(0, NULL); 258 debug_ipi_action(0, NULL);
258 } while (info->messages); 259 } while (info->messages);
@@ -280,7 +281,7 @@ EXPORT_SYMBOL_GPL(smp_send_reschedule);
280 281
281void arch_send_call_function_single_ipi(int cpu) 282void arch_send_call_function_single_ipi(int cpu)
282{ 283{
283 do_message_pass(cpu, PPC_MSG_CALL_FUNC_SINGLE); 284 do_message_pass(cpu, PPC_MSG_CALL_FUNCTION);
284} 285}
285 286
286void arch_send_call_function_ipi_mask(const struct cpumask *mask) 287void arch_send_call_function_ipi_mask(const struct cpumask *mask)
@@ -291,6 +292,16 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask)
291 do_message_pass(cpu, PPC_MSG_CALL_FUNCTION); 292 do_message_pass(cpu, PPC_MSG_CALL_FUNCTION);
292} 293}
293 294
295#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
296void tick_broadcast(const struct cpumask *mask)
297{
298 unsigned int cpu;
299
300 for_each_cpu(cpu, mask)
301 do_message_pass(cpu, PPC_MSG_TICK_BROADCAST);
302}
303#endif
304
294#if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC) 305#if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)
295void smp_send_debugger_break(void) 306void smp_send_debugger_break(void)
296{ 307{
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index 97e1dc917683..d90d4b7810d6 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -975,7 +975,8 @@ static int __init topology_init(void)
975 int cpu; 975 int cpu;
976 976
977 register_nodes(); 977 register_nodes();
978 register_cpu_notifier(&sysfs_cpu_nb); 978
979 cpu_notifier_register_begin();
979 980
980 for_each_possible_cpu(cpu) { 981 for_each_possible_cpu(cpu) {
981 struct cpu *c = &per_cpu(cpu_devices, cpu); 982 struct cpu *c = &per_cpu(cpu_devices, cpu);
@@ -999,6 +1000,11 @@ static int __init topology_init(void)
999 if (cpu_online(cpu)) 1000 if (cpu_online(cpu))
1000 register_cpu_online(cpu); 1001 register_cpu_online(cpu);
1001 } 1002 }
1003
1004 __register_cpu_notifier(&sysfs_cpu_nb);
1005
1006 cpu_notifier_register_done();
1007
1002#ifdef CONFIG_PPC64 1008#ifdef CONFIG_PPC64
1003 sysfs_create_dscr_default(); 1009 sysfs_create_dscr_default();
1004#endif /* CONFIG_PPC64 */ 1010#endif /* CONFIG_PPC64 */
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index b3dab20acf34..122a580f7322 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -42,6 +42,7 @@
42#include <linux/timex.h> 42#include <linux/timex.h>
43#include <linux/kernel_stat.h> 43#include <linux/kernel_stat.h>
44#include <linux/time.h> 44#include <linux/time.h>
45#include <linux/clockchips.h>
45#include <linux/init.h> 46#include <linux/init.h>
46#include <linux/profile.h> 47#include <linux/profile.h>
47#include <linux/cpu.h> 48#include <linux/cpu.h>
@@ -106,7 +107,7 @@ struct clock_event_device decrementer_clockevent = {
106 .irq = 0, 107 .irq = 0,
107 .set_next_event = decrementer_set_next_event, 108 .set_next_event = decrementer_set_next_event,
108 .set_mode = decrementer_set_mode, 109 .set_mode = decrementer_set_mode,
109 .features = CLOCK_EVT_FEAT_ONESHOT, 110 .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_C3STOP,
110}; 111};
111EXPORT_SYMBOL(decrementer_clockevent); 112EXPORT_SYMBOL(decrementer_clockevent);
112 113
@@ -478,6 +479,47 @@ void arch_irq_work_raise(void)
478 479
479#endif /* CONFIG_IRQ_WORK */ 480#endif /* CONFIG_IRQ_WORK */
480 481
482void __timer_interrupt(void)
483{
484 struct pt_regs *regs = get_irq_regs();
485 u64 *next_tb = &__get_cpu_var(decrementers_next_tb);
486 struct clock_event_device *evt = &__get_cpu_var(decrementers);
487 u64 now;
488
489 trace_timer_interrupt_entry(regs);
490
491 if (test_irq_work_pending()) {
492 clear_irq_work_pending();
493 irq_work_run();
494 }
495
496 now = get_tb_or_rtc();
497 if (now >= *next_tb) {
498 *next_tb = ~(u64)0;
499 if (evt->event_handler)
500 evt->event_handler(evt);
501 __get_cpu_var(irq_stat).timer_irqs_event++;
502 } else {
503 now = *next_tb - now;
504 if (now <= DECREMENTER_MAX)
505 set_dec((int)now);
506 /* We may have raced with new irq work */
507 if (test_irq_work_pending())
508 set_dec(1);
509 __get_cpu_var(irq_stat).timer_irqs_others++;
510 }
511
512#ifdef CONFIG_PPC64
513 /* collect purr register values often, for accurate calculations */
514 if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
515 struct cpu_usage *cu = &__get_cpu_var(cpu_usage_array);
516 cu->current_tb = mfspr(SPRN_PURR);
517 }
518#endif
519
520 trace_timer_interrupt_exit(regs);
521}
522
481/* 523/*
482 * timer_interrupt - gets called when the decrementer overflows, 524 * timer_interrupt - gets called when the decrementer overflows,
483 * with interrupts disabled. 525 * with interrupts disabled.
@@ -486,8 +528,6 @@ void timer_interrupt(struct pt_regs * regs)
486{ 528{
487 struct pt_regs *old_regs; 529 struct pt_regs *old_regs;
488 u64 *next_tb = &__get_cpu_var(decrementers_next_tb); 530 u64 *next_tb = &__get_cpu_var(decrementers_next_tb);
489 struct clock_event_device *evt = &__get_cpu_var(decrementers);
490 u64 now;
491 531
492 /* Ensure a positive value is written to the decrementer, or else 532 /* Ensure a positive value is written to the decrementer, or else
493 * some CPUs will continue to take decrementer exceptions. 533 * some CPUs will continue to take decrementer exceptions.
@@ -519,39 +559,7 @@ void timer_interrupt(struct pt_regs * regs)
519 old_regs = set_irq_regs(regs); 559 old_regs = set_irq_regs(regs);
520 irq_enter(); 560 irq_enter();
521 561
522 trace_timer_interrupt_entry(regs); 562 __timer_interrupt();
523
524 if (test_irq_work_pending()) {
525 clear_irq_work_pending();
526 irq_work_run();
527 }
528
529 now = get_tb_or_rtc();
530 if (now >= *next_tb) {
531 *next_tb = ~(u64)0;
532 if (evt->event_handler)
533 evt->event_handler(evt);
534 __get_cpu_var(irq_stat).timer_irqs_event++;
535 } else {
536 now = *next_tb - now;
537 if (now <= DECREMENTER_MAX)
538 set_dec((int)now);
539 /* We may have raced with new irq work */
540 if (test_irq_work_pending())
541 set_dec(1);
542 __get_cpu_var(irq_stat).timer_irqs_others++;
543 }
544
545#ifdef CONFIG_PPC64
546 /* collect purr register values often, for accurate calculations */
547 if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
548 struct cpu_usage *cu = &__get_cpu_var(cpu_usage_array);
549 cu->current_tb = mfspr(SPRN_PURR);
550 }
551#endif
552
553 trace_timer_interrupt_exit(regs);
554
555 irq_exit(); 563 irq_exit();
556 set_irq_regs(old_regs); 564 set_irq_regs(old_regs);
557} 565}
@@ -825,6 +833,15 @@ static void decrementer_set_mode(enum clock_event_mode mode,
825 decrementer_set_next_event(DECREMENTER_MAX, dev); 833 decrementer_set_next_event(DECREMENTER_MAX, dev);
826} 834}
827 835
836/* Interrupt handler for the timer broadcast IPI */
837void tick_broadcast_ipi_handler(void)
838{
839 u64 *next_tb = &__get_cpu_var(decrementers_next_tb);
840
841 *next_tb = get_tb_or_rtc();
842 __timer_interrupt();
843}
844
828static void register_decrementer_clockevent(int cpu) 845static void register_decrementer_clockevent(int cpu)
829{ 846{
830 struct clock_event_device *dec = &per_cpu(decrementers, cpu); 847 struct clock_event_device *dec = &per_cpu(decrementers, cpu);
@@ -928,6 +945,7 @@ void __init time_init(void)
928 clocksource_init(); 945 clocksource_init();
929 946
930 init_decrementer_clockevent(); 947 init_decrementer_clockevent();
948 tick_setup_hrtimer_broadcast();
931} 949}
932 950
933 951
diff --git a/arch/powerpc/kernel/tm.S b/arch/powerpc/kernel/tm.S
index ef47bcbd4352..03567c05950a 100644
--- a/arch/powerpc/kernel/tm.S
+++ b/arch/powerpc/kernel/tm.S
@@ -307,7 +307,7 @@ dont_backup_fp:
307 * Call with IRQs off, stacks get all out of sync for 307 * Call with IRQs off, stacks get all out of sync for
308 * some periods in here! 308 * some periods in here!
309 */ 309 */
310_GLOBAL(tm_recheckpoint) 310_GLOBAL(__tm_recheckpoint)
311 mfcr r5 311 mfcr r5
312 mflr r0 312 mflr r0
313 stw r5, 8(r1) 313 stw r5, 8(r1)
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 33cd7a0b8e73..1bd7ca298fa1 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -1379,8 +1379,9 @@ void facility_unavailable_exception(struct pt_regs *regs)
1379 if (!arch_irq_disabled_regs(regs)) 1379 if (!arch_irq_disabled_regs(regs))
1380 local_irq_enable(); 1380 local_irq_enable();
1381 1381
1382 pr_err("%sFacility '%s' unavailable, exception at 0x%lx, MSR=%lx\n", 1382 pr_err_ratelimited(
1383 hv ? "Hypervisor " : "", facility, regs->nip, regs->msr); 1383 "%sFacility '%s' unavailable, exception at 0x%lx, MSR=%lx\n",
1384 hv ? "Hypervisor " : "", facility, regs->nip, regs->msr);
1384 1385
1385 if (user_mode(regs)) { 1386 if (user_mode(regs)) {
1386 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); 1387 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
@@ -1867,6 +1868,7 @@ struct ppc_emulated ppc_emulated = {
1867#ifdef CONFIG_PPC64 1868#ifdef CONFIG_PPC64
1868 WARN_EMULATED_SETUP(mfdscr), 1869 WARN_EMULATED_SETUP(mfdscr),
1869 WARN_EMULATED_SETUP(mtdscr), 1870 WARN_EMULATED_SETUP(mtdscr),
1871 WARN_EMULATED_SETUP(lq_stq),
1870#endif 1872#endif
1871}; 1873};
1872 1874
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
index 094e45c16a17..ce74c335a6a4 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -715,8 +715,8 @@ int vdso_getcpu_init(void)
715 unsigned long cpu, node, val; 715 unsigned long cpu, node, val;
716 716
717 /* 717 /*
718 * SPRG3 contains the CPU in the bottom 16 bits and the NUMA node in 718 * SPRG_VDSO contains the CPU in the bottom 16 bits and the NUMA node
719 * the next 16 bits. The VDSO uses this to implement getcpu(). 719 * in the next 16 bits. The VDSO uses this to implement getcpu().
720 */ 720 */
721 cpu = get_cpu(); 721 cpu = get_cpu();
722 WARN_ON_ONCE(cpu > 0xffff); 722 WARN_ON_ONCE(cpu > 0xffff);
@@ -725,8 +725,8 @@ int vdso_getcpu_init(void)
725 WARN_ON_ONCE(node > 0xffff); 725 WARN_ON_ONCE(node > 0xffff);
726 726
727 val = (cpu & 0xfff) | ((node & 0xffff) << 16); 727 val = (cpu & 0xfff) | ((node & 0xffff) << 16);
728 mtspr(SPRN_SPRG3, val); 728 mtspr(SPRN_SPRG_VDSO_WRITE, val);
729 get_paca()->sprg3 = val; 729 get_paca()->sprg_vdso = val;
730 730
731 put_cpu(); 731 put_cpu();
732 732
diff --git a/arch/powerpc/kernel/vdso32/getcpu.S b/arch/powerpc/kernel/vdso32/getcpu.S
index 47afd08c90f7..23eb9a9441bd 100644
--- a/arch/powerpc/kernel/vdso32/getcpu.S
+++ b/arch/powerpc/kernel/vdso32/getcpu.S
@@ -29,7 +29,7 @@
29 */ 29 */
30V_FUNCTION_BEGIN(__kernel_getcpu) 30V_FUNCTION_BEGIN(__kernel_getcpu)
31 .cfi_startproc 31 .cfi_startproc
32 mfspr r5,SPRN_USPRG3 32 mfspr r5,SPRN_SPRG_VDSO_READ
33 cmpdi cr0,r3,0 33 cmpdi cr0,r3,0
34 cmpdi cr1,r4,0 34 cmpdi cr1,r4,0
35 clrlwi r6,r5,16 35 clrlwi r6,r5,16
diff --git a/arch/powerpc/kernel/vdso64/getcpu.S b/arch/powerpc/kernel/vdso64/getcpu.S
index 47afd08c90f7..23eb9a9441bd 100644
--- a/arch/powerpc/kernel/vdso64/getcpu.S
+++ b/arch/powerpc/kernel/vdso64/getcpu.S
@@ -29,7 +29,7 @@
29 */ 29 */
30V_FUNCTION_BEGIN(__kernel_getcpu) 30V_FUNCTION_BEGIN(__kernel_getcpu)
31 .cfi_startproc 31 .cfi_startproc
32 mfspr r5,SPRN_USPRG3 32 mfspr r5,SPRN_SPRG_VDSO_READ
33 cmpdi cr0,r3,0 33 cmpdi cr0,r3,0
34 cmpdi cr1,r4,0 34 cmpdi cr1,r4,0
35 clrlwi r6,r5,16 35 clrlwi r6,r5,16
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 826d8bd9e522..904c66128fae 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -1432,7 +1432,8 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
1432 1432
1433 /* needed to ensure proper operation of coherent allocations 1433 /* needed to ensure proper operation of coherent allocations
1434 * later, in case driver doesn't set it explicitly */ 1434 * later, in case driver doesn't set it explicitly */
1435 dma_coerce_mask_and_coherent(&viodev->dev, DMA_BIT_MASK(64)); 1435 viodev->dev.coherent_dma_mask = DMA_BIT_MASK(64);
1436 viodev->dev.dma_mask = &viodev->dev.coherent_dma_mask;
1436 } 1437 }
1437 1438
1438 /* register with generic device framework */ 1439 /* register with generic device framework */
diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c
index 303ece75b8e4..fb25ebc0af0c 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
@@ -262,7 +262,14 @@ int kvmppc_mmu_hv_init(void)
262 262
263static void kvmppc_mmu_book3s_64_hv_reset_msr(struct kvm_vcpu *vcpu) 263static void kvmppc_mmu_book3s_64_hv_reset_msr(struct kvm_vcpu *vcpu)
264{ 264{
265 kvmppc_set_msr(vcpu, vcpu->arch.intr_msr); 265 unsigned long msr = vcpu->arch.intr_msr;
266
267 /* If transactional, change to suspend mode on IRQ delivery */
268 if (MSR_TM_TRANSACTIONAL(vcpu->arch.shregs.msr))
269 msr |= MSR_TS_S;
270 else
271 msr |= vcpu->arch.shregs.msr & MSR_TS_MASK;
272 kvmppc_set_msr(vcpu, msr);
266} 273}
267 274
268/* 275/*
diff --git a/arch/powerpc/kvm/book3s_64_vio_hv.c b/arch/powerpc/kvm/book3s_64_vio_hv.c
index 2c25f5412bdb..89e96b3e0039 100644
--- a/arch/powerpc/kvm/book3s_64_vio_hv.c
+++ b/arch/powerpc/kvm/book3s_64_vio_hv.c
@@ -75,3 +75,31 @@ long kvmppc_h_put_tce(struct kvm_vcpu *vcpu, unsigned long liobn,
75 return H_TOO_HARD; 75 return H_TOO_HARD;
76} 76}
77EXPORT_SYMBOL_GPL(kvmppc_h_put_tce); 77EXPORT_SYMBOL_GPL(kvmppc_h_put_tce);
78
79long kvmppc_h_get_tce(struct kvm_vcpu *vcpu, unsigned long liobn,
80 unsigned long ioba)
81{
82 struct kvm *kvm = vcpu->kvm;
83 struct kvmppc_spapr_tce_table *stt;
84
85 list_for_each_entry(stt, &kvm->arch.spapr_tce_tables, list) {
86 if (stt->liobn == liobn) {
87 unsigned long idx = ioba >> SPAPR_TCE_SHIFT;
88 struct page *page;
89 u64 *tbl;
90
91 if (ioba >= stt->window_size)
92 return H_PARAMETER;
93
94 page = stt->pages[idx / TCES_PER_PAGE];
95 tbl = (u64 *)page_address(page);
96
97 vcpu->arch.gpr[4] = tbl[idx % TCES_PER_PAGE];
98 return H_SUCCESS;
99 }
100 }
101
102 /* Didn't find the liobn, punt it to userspace */
103 return H_TOO_HARD;
104}
105EXPORT_SYMBOL_GPL(kvmppc_h_get_tce);
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 17fc9496b6ac..8227dba5af0f 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -86,7 +86,7 @@ static void kvmppc_fast_vcpu_kick_hv(struct kvm_vcpu *vcpu)
86 86
87 /* CPU points to the first thread of the core */ 87 /* CPU points to the first thread of the core */
88 if (cpu != me && cpu >= 0 && cpu < nr_cpu_ids) { 88 if (cpu != me && cpu >= 0 && cpu < nr_cpu_ids) {
89#ifdef CONFIG_KVM_XICS 89#ifdef CONFIG_PPC_ICP_NATIVE
90 int real_cpu = cpu + vcpu->arch.ptid; 90 int real_cpu = cpu + vcpu->arch.ptid;
91 if (paca[real_cpu].kvm_hstate.xics_phys) 91 if (paca[real_cpu].kvm_hstate.xics_phys)
92 xics_wake_cpu(real_cpu); 92 xics_wake_cpu(real_cpu);
@@ -879,17 +879,6 @@ static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
879 case KVM_REG_PPC_IAMR: 879 case KVM_REG_PPC_IAMR:
880 *val = get_reg_val(id, vcpu->arch.iamr); 880 *val = get_reg_val(id, vcpu->arch.iamr);
881 break; 881 break;
882#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
883 case KVM_REG_PPC_TFHAR:
884 *val = get_reg_val(id, vcpu->arch.tfhar);
885 break;
886 case KVM_REG_PPC_TFIAR:
887 *val = get_reg_val(id, vcpu->arch.tfiar);
888 break;
889 case KVM_REG_PPC_TEXASR:
890 *val = get_reg_val(id, vcpu->arch.texasr);
891 break;
892#endif
893 case KVM_REG_PPC_FSCR: 882 case KVM_REG_PPC_FSCR:
894 *val = get_reg_val(id, vcpu->arch.fscr); 883 *val = get_reg_val(id, vcpu->arch.fscr);
895 break; 884 break;
@@ -970,6 +959,69 @@ static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
970 case KVM_REG_PPC_PPR: 959 case KVM_REG_PPC_PPR:
971 *val = get_reg_val(id, vcpu->arch.ppr); 960 *val = get_reg_val(id, vcpu->arch.ppr);
972 break; 961 break;
962#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
963 case KVM_REG_PPC_TFHAR:
964 *val = get_reg_val(id, vcpu->arch.tfhar);
965 break;
966 case KVM_REG_PPC_TFIAR:
967 *val = get_reg_val(id, vcpu->arch.tfiar);
968 break;
969 case KVM_REG_PPC_TEXASR:
970 *val = get_reg_val(id, vcpu->arch.texasr);
971 break;
972 case KVM_REG_PPC_TM_GPR0 ... KVM_REG_PPC_TM_GPR31:
973 i = id - KVM_REG_PPC_TM_GPR0;
974 *val = get_reg_val(id, vcpu->arch.gpr_tm[i]);
975 break;
976 case KVM_REG_PPC_TM_VSR0 ... KVM_REG_PPC_TM_VSR63:
977 {
978 int j;
979 i = id - KVM_REG_PPC_TM_VSR0;
980 if (i < 32)
981 for (j = 0; j < TS_FPRWIDTH; j++)
982 val->vsxval[j] = vcpu->arch.fp_tm.fpr[i][j];
983 else {
984 if (cpu_has_feature(CPU_FTR_ALTIVEC))
985 val->vval = vcpu->arch.vr_tm.vr[i-32];
986 else
987 r = -ENXIO;
988 }
989 break;
990 }
991 case KVM_REG_PPC_TM_CR:
992 *val = get_reg_val(id, vcpu->arch.cr_tm);
993 break;
994 case KVM_REG_PPC_TM_LR:
995 *val = get_reg_val(id, vcpu->arch.lr_tm);
996 break;
997 case KVM_REG_PPC_TM_CTR:
998 *val = get_reg_val(id, vcpu->arch.ctr_tm);
999 break;
1000 case KVM_REG_PPC_TM_FPSCR:
1001 *val = get_reg_val(id, vcpu->arch.fp_tm.fpscr);
1002 break;
1003 case KVM_REG_PPC_TM_AMR:
1004 *val = get_reg_val(id, vcpu->arch.amr_tm);
1005 break;
1006 case KVM_REG_PPC_TM_PPR:
1007 *val = get_reg_val(id, vcpu->arch.ppr_tm);
1008 break;
1009 case KVM_REG_PPC_TM_VRSAVE:
1010 *val = get_reg_val(id, vcpu->arch.vrsave_tm);
1011 break;
1012 case KVM_REG_PPC_TM_VSCR:
1013 if (cpu_has_feature(CPU_FTR_ALTIVEC))
1014 *val = get_reg_val(id, vcpu->arch.vr_tm.vscr.u[3]);
1015 else
1016 r = -ENXIO;
1017 break;
1018 case KVM_REG_PPC_TM_DSCR:
1019 *val = get_reg_val(id, vcpu->arch.dscr_tm);
1020 break;
1021 case KVM_REG_PPC_TM_TAR:
1022 *val = get_reg_val(id, vcpu->arch.tar_tm);
1023 break;
1024#endif
973 case KVM_REG_PPC_ARCH_COMPAT: 1025 case KVM_REG_PPC_ARCH_COMPAT:
974 *val = get_reg_val(id, vcpu->arch.vcore->arch_compat); 1026 *val = get_reg_val(id, vcpu->arch.vcore->arch_compat);
975 break; 1027 break;
@@ -1039,17 +1091,6 @@ static int kvmppc_set_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
1039 case KVM_REG_PPC_IAMR: 1091 case KVM_REG_PPC_IAMR:
1040 vcpu->arch.iamr = set_reg_val(id, *val); 1092 vcpu->arch.iamr = set_reg_val(id, *val);
1041 break; 1093 break;
1042#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
1043 case KVM_REG_PPC_TFHAR:
1044 vcpu->arch.tfhar = set_reg_val(id, *val);
1045 break;
1046 case KVM_REG_PPC_TFIAR:
1047 vcpu->arch.tfiar = set_reg_val(id, *val);
1048 break;
1049 case KVM_REG_PPC_TEXASR:
1050 vcpu->arch.texasr = set_reg_val(id, *val);
1051 break;
1052#endif
1053 case KVM_REG_PPC_FSCR: 1094 case KVM_REG_PPC_FSCR:
1054 vcpu->arch.fscr = set_reg_val(id, *val); 1095 vcpu->arch.fscr = set_reg_val(id, *val);
1055 break; 1096 break;
@@ -1144,6 +1185,68 @@ static int kvmppc_set_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
1144 case KVM_REG_PPC_PPR: 1185 case KVM_REG_PPC_PPR:
1145 vcpu->arch.ppr = set_reg_val(id, *val); 1186 vcpu->arch.ppr = set_reg_val(id, *val);
1146 break; 1187 break;
1188#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
1189 case KVM_REG_PPC_TFHAR:
1190 vcpu->arch.tfhar = set_reg_val(id, *val);
1191 break;
1192 case KVM_REG_PPC_TFIAR:
1193 vcpu->arch.tfiar = set_reg_val(id, *val);
1194 break;
1195 case KVM_REG_PPC_TEXASR:
1196 vcpu->arch.texasr = set_reg_val(id, *val);
1197 break;
1198 case KVM_REG_PPC_TM_GPR0 ... KVM_REG_PPC_TM_GPR31:
1199 i = id - KVM_REG_PPC_TM_GPR0;
1200 vcpu->arch.gpr_tm[i] = set_reg_val(id, *val);
1201 break;
1202 case KVM_REG_PPC_TM_VSR0 ... KVM_REG_PPC_TM_VSR63:
1203 {
1204 int j;
1205 i = id - KVM_REG_PPC_TM_VSR0;
1206 if (i < 32)
1207 for (j = 0; j < TS_FPRWIDTH; j++)
1208 vcpu->arch.fp_tm.fpr[i][j] = val->vsxval[j];
1209 else
1210 if (cpu_has_feature(CPU_FTR_ALTIVEC))
1211 vcpu->arch.vr_tm.vr[i-32] = val->vval;
1212 else
1213 r = -ENXIO;
1214 break;
1215 }
1216 case KVM_REG_PPC_TM_CR:
1217 vcpu->arch.cr_tm = set_reg_val(id, *val);
1218 break;
1219 case KVM_REG_PPC_TM_LR:
1220 vcpu->arch.lr_tm = set_reg_val(id, *val);
1221 break;
1222 case KVM_REG_PPC_TM_CTR:
1223 vcpu->arch.ctr_tm = set_reg_val(id, *val);
1224 break;
1225 case KVM_REG_PPC_TM_FPSCR:
1226 vcpu->arch.fp_tm.fpscr = set_reg_val(id, *val);
1227 break;
1228 case KVM_REG_PPC_TM_AMR:
1229 vcpu->arch.amr_tm = set_reg_val(id, *val);
1230 break;
1231 case KVM_REG_PPC_TM_PPR:
1232 vcpu->arch.ppr_tm = set_reg_val(id, *val);
1233 break;
1234 case KVM_REG_PPC_TM_VRSAVE:
1235 vcpu->arch.vrsave_tm = set_reg_val(id, *val);
1236 break;
1237 case KVM_REG_PPC_TM_VSCR:
1238 if (cpu_has_feature(CPU_FTR_ALTIVEC))
1239 vcpu->arch.vr.vscr.u[3] = set_reg_val(id, *val);
1240 else
1241 r = - ENXIO;
1242 break;
1243 case KVM_REG_PPC_TM_DSCR:
1244 vcpu->arch.dscr_tm = set_reg_val(id, *val);
1245 break;
1246 case KVM_REG_PPC_TM_TAR:
1247 vcpu->arch.tar_tm = set_reg_val(id, *val);
1248 break;
1249#endif
1147 case KVM_REG_PPC_ARCH_COMPAT: 1250 case KVM_REG_PPC_ARCH_COMPAT:
1148 r = kvmppc_set_arch_compat(vcpu, set_reg_val(id, *val)); 1251 r = kvmppc_set_arch_compat(vcpu, set_reg_val(id, *val));
1149 break; 1252 break;
@@ -1360,9 +1463,7 @@ static void kvmppc_start_thread(struct kvm_vcpu *vcpu)
1360 smp_wmb(); 1463 smp_wmb();
1361#if defined(CONFIG_PPC_ICP_NATIVE) && defined(CONFIG_SMP) 1464#if defined(CONFIG_PPC_ICP_NATIVE) && defined(CONFIG_SMP)
1362 if (cpu != smp_processor_id()) { 1465 if (cpu != smp_processor_id()) {
1363#ifdef CONFIG_KVM_XICS
1364 xics_wake_cpu(cpu); 1466 xics_wake_cpu(cpu);
1365#endif
1366 if (vcpu->arch.ptid) 1467 if (vcpu->arch.ptid)
1367 ++vc->n_woken; 1468 ++vc->n_woken;
1368 } 1469 }
@@ -1530,7 +1631,7 @@ static void kvmppc_run_core(struct kvmppc_vcore *vc)
1530 vcpu->arch.trap = 0; 1631 vcpu->arch.trap = 0;
1531 1632
1532 if (vcpu->arch.ceded) { 1633 if (vcpu->arch.ceded) {
1533 if (ret != RESUME_GUEST) 1634 if (!is_kvmppc_resume_guest(ret))
1534 kvmppc_end_cede(vcpu); 1635 kvmppc_end_cede(vcpu);
1535 else 1636 else
1536 kvmppc_set_timer(vcpu); 1637 kvmppc_set_timer(vcpu);
@@ -1541,7 +1642,7 @@ static void kvmppc_run_core(struct kvmppc_vcore *vc)
1541 vc->vcore_state = VCORE_INACTIVE; 1642 vc->vcore_state = VCORE_INACTIVE;
1542 list_for_each_entry_safe(vcpu, vnext, &vc->runnable_threads, 1643 list_for_each_entry_safe(vcpu, vnext, &vc->runnable_threads,
1543 arch.run_list) { 1644 arch.run_list) {
1544 if (vcpu->arch.ret != RESUME_GUEST) { 1645 if (!is_kvmppc_resume_guest(vcpu->arch.ret)) {
1545 kvmppc_remove_runnable(vc, vcpu); 1646 kvmppc_remove_runnable(vc, vcpu);
1546 wake_up(&vcpu->arch.cpu_run); 1647 wake_up(&vcpu->arch.cpu_run);
1547 } 1648 }
@@ -1731,7 +1832,7 @@ static int kvmppc_vcpu_run_hv(struct kvm_run *run, struct kvm_vcpu *vcpu)
1731 vcpu->arch.fault_dar, vcpu->arch.fault_dsisr); 1832 vcpu->arch.fault_dar, vcpu->arch.fault_dsisr);
1732 srcu_read_unlock(&vcpu->kvm->srcu, srcu_idx); 1833 srcu_read_unlock(&vcpu->kvm->srcu, srcu_idx);
1733 } 1834 }
1734 } while (r == RESUME_GUEST); 1835 } while (is_kvmppc_resume_guest(r));
1735 1836
1736 out: 1837 out:
1737 vcpu->arch.state = KVMPPC_VCPU_NOTREADY; 1838 vcpu->arch.state = KVMPPC_VCPU_NOTREADY;
@@ -2366,7 +2467,7 @@ static int kvmppc_book3s_init_hv(void)
2366 */ 2467 */
2367 r = kvmppc_core_check_processor_compat_hv(); 2468 r = kvmppc_core_check_processor_compat_hv();
2368 if (r < 0) 2469 if (r < 0)
2369 return r; 2470 return -ENODEV;
2370 2471
2371 kvm_ops_hv.owner = THIS_MODULE; 2472 kvm_ops_hv.owner = THIS_MODULE;
2372 kvmppc_hv_ops = &kvm_ops_hv; 2473 kvmppc_hv_ops = &kvm_ops_hv;
diff --git a/arch/powerpc/kvm/book3s_hv_interrupts.S b/arch/powerpc/kvm/book3s_hv_interrupts.S
index e873796b1a29..e18e3cfc32de 100644
--- a/arch/powerpc/kvm/book3s_hv_interrupts.S
+++ b/arch/powerpc/kvm/book3s_hv_interrupts.S
@@ -71,6 +71,14 @@ END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S)
71 mtmsrd r10,1 71 mtmsrd r10,1
72 72
73 /* Save host PMU registers */ 73 /* Save host PMU registers */
74BEGIN_FTR_SECTION
75 /* Work around P8 PMAE bug */
76 li r3, -1
77 clrrdi r3, r3, 10
78 mfspr r8, SPRN_MMCR2
79 mtspr SPRN_MMCR2, r3 /* freeze all counters using MMCR2 */
80 isync
81END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
74 li r3, 1 82 li r3, 1
75 sldi r3, r3, 31 /* MMCR0_FC (freeze counters) bit */ 83 sldi r3, r3, 31 /* MMCR0_FC (freeze counters) bit */
76 mfspr r7, SPRN_MMCR0 /* save MMCR0 */ 84 mfspr r7, SPRN_MMCR0 /* save MMCR0 */
@@ -87,9 +95,18 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_206)
87 cmpwi r5, 0 95 cmpwi r5, 0
88 beq 31f /* skip if not */ 96 beq 31f /* skip if not */
89 mfspr r5, SPRN_MMCR1 97 mfspr r5, SPRN_MMCR1
98 mfspr r9, SPRN_SIAR
99 mfspr r10, SPRN_SDAR
90 std r7, HSTATE_MMCR(r13) 100 std r7, HSTATE_MMCR(r13)
91 std r5, HSTATE_MMCR + 8(r13) 101 std r5, HSTATE_MMCR + 8(r13)
92 std r6, HSTATE_MMCR + 16(r13) 102 std r6, HSTATE_MMCR + 16(r13)
103 std r9, HSTATE_MMCR + 24(r13)
104 std r10, HSTATE_MMCR + 32(r13)
105BEGIN_FTR_SECTION
106 mfspr r9, SPRN_SIER
107 std r8, HSTATE_MMCR + 40(r13)
108 std r9, HSTATE_MMCR + 48(r13)
109END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
93 mfspr r3, SPRN_PMC1 110 mfspr r3, SPRN_PMC1
94 mfspr r5, SPRN_PMC2 111 mfspr r5, SPRN_PMC2
95 mfspr r6, SPRN_PMC3 112 mfspr r6, SPRN_PMC3
@@ -110,6 +127,11 @@ BEGIN_FTR_SECTION
110 stw r10, HSTATE_PMC + 24(r13) 127 stw r10, HSTATE_PMC + 24(r13)
111 stw r11, HSTATE_PMC + 28(r13) 128 stw r11, HSTATE_PMC + 28(r13)
112END_FTR_SECTION_IFSET(CPU_FTR_ARCH_201) 129END_FTR_SECTION_IFSET(CPU_FTR_ARCH_201)
130BEGIN_FTR_SECTION
131 mfspr r9, SPRN_SIER
132 std r8, HSTATE_MMCR + 40(r13)
133 std r9, HSTATE_MMCR + 48(r13)
134END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
11331: 13531:
114 136
115 /* 137 /*
diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm/book3s_hv_rm_mmu.c
index 37fb3caa4c80..1d6c56ad5b60 100644
--- a/arch/powerpc/kvm/book3s_hv_rm_mmu.c
+++ b/arch/powerpc/kvm/book3s_hv_rm_mmu.c
@@ -111,7 +111,7 @@ static void remove_revmap_chain(struct kvm *kvm, long pte_index,
111 rcbits = hpte_r & (HPTE_R_R | HPTE_R_C); 111 rcbits = hpte_r & (HPTE_R_R | HPTE_R_C);
112 ptel = rev->guest_rpte |= rcbits; 112 ptel = rev->guest_rpte |= rcbits;
113 gfn = hpte_rpn(ptel, hpte_page_size(hpte_v, ptel)); 113 gfn = hpte_rpn(ptel, hpte_page_size(hpte_v, ptel));
114 memslot = __gfn_to_memslot(kvm_memslots(kvm), gfn); 114 memslot = __gfn_to_memslot(kvm_memslots_raw(kvm), gfn);
115 if (!memslot) 115 if (!memslot)
116 return; 116 return;
117 117
@@ -192,7 +192,7 @@ long kvmppc_do_h_enter(struct kvm *kvm, unsigned long flags,
192 /* Find the memslot (if any) for this address */ 192 /* Find the memslot (if any) for this address */
193 gpa = (ptel & HPTE_R_RPN) & ~(psize - 1); 193 gpa = (ptel & HPTE_R_RPN) & ~(psize - 1);
194 gfn = gpa >> PAGE_SHIFT; 194 gfn = gpa >> PAGE_SHIFT;
195 memslot = __gfn_to_memslot(kvm_memslots(kvm), gfn); 195 memslot = __gfn_to_memslot(kvm_memslots_raw(kvm), gfn);
196 pa = 0; 196 pa = 0;
197 is_io = ~0ul; 197 is_io = ~0ul;
198 rmap = NULL; 198 rmap = NULL;
@@ -670,7 +670,7 @@ long kvmppc_h_protect(struct kvm_vcpu *vcpu, unsigned long flags,
670 670
671 psize = hpte_page_size(v, r); 671 psize = hpte_page_size(v, r);
672 gfn = ((r & HPTE_R_RPN) & ~(psize - 1)) >> PAGE_SHIFT; 672 gfn = ((r & HPTE_R_RPN) & ~(psize - 1)) >> PAGE_SHIFT;
673 memslot = __gfn_to_memslot(kvm_memslots(kvm), gfn); 673 memslot = __gfn_to_memslot(kvm_memslots_raw(kvm), gfn);
674 if (memslot) { 674 if (memslot) {
675 hva = __gfn_to_hva_memslot(memslot, gfn); 675 hva = __gfn_to_hva_memslot(memslot, gfn);
676 pte = lookup_linux_pte_and_update(pgdir, hva, 676 pte = lookup_linux_pte_and_update(pgdir, hva,
diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
index 818dce344e82..ffbb871c2bd8 100644
--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
@@ -28,6 +28,9 @@
28#include <asm/exception-64s.h> 28#include <asm/exception-64s.h>
29#include <asm/kvm_book3s_asm.h> 29#include <asm/kvm_book3s_asm.h>
30#include <asm/mmu-hash64.h> 30#include <asm/mmu-hash64.h>
31#include <asm/tm.h>
32
33#define VCPU_GPRS_TM(reg) (((reg) * ULONG_SIZE) + VCPU_GPR_TM)
31 34
32#ifdef __LITTLE_ENDIAN__ 35#ifdef __LITTLE_ENDIAN__
33#error Need to fix lppaca and SLB shadow accesses in little endian mode 36#error Need to fix lppaca and SLB shadow accesses in little endian mode
@@ -75,8 +78,8 @@ BEGIN_FTR_SECTION
75END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S) 78END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S)
76 79
77 /* Restore SPRG3 */ 80 /* Restore SPRG3 */
78 ld r3,PACA_SPRG3(r13) 81 ld r3,PACA_SPRG_VDSO(r13)
79 mtspr SPRN_SPRG3,r3 82 mtspr SPRN_SPRG_VDSO_WRITE,r3
80 83
81 /* Reload the host's PMU registers */ 84 /* Reload the host's PMU registers */
82 ld r3, PACALPPACAPTR(r13) /* is the host using the PMU? */ 85 ld r3, PACALPPACAPTR(r13) /* is the host using the PMU? */
@@ -106,8 +109,18 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_201)
106 ld r3, HSTATE_MMCR(r13) 109 ld r3, HSTATE_MMCR(r13)
107 ld r4, HSTATE_MMCR + 8(r13) 110 ld r4, HSTATE_MMCR + 8(r13)
108 ld r5, HSTATE_MMCR + 16(r13) 111 ld r5, HSTATE_MMCR + 16(r13)
112 ld r6, HSTATE_MMCR + 24(r13)
113 ld r7, HSTATE_MMCR + 32(r13)
109 mtspr SPRN_MMCR1, r4 114 mtspr SPRN_MMCR1, r4
110 mtspr SPRN_MMCRA, r5 115 mtspr SPRN_MMCRA, r5
116 mtspr SPRN_SIAR, r6
117 mtspr SPRN_SDAR, r7
118BEGIN_FTR_SECTION
119 ld r8, HSTATE_MMCR + 40(r13)
120 ld r9, HSTATE_MMCR + 48(r13)
121 mtspr SPRN_MMCR2, r8
122 mtspr SPRN_SIER, r9
123END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
111 mtspr SPRN_MMCR0, r3 124 mtspr SPRN_MMCR0, r3
112 isync 125 isync
11323: 12623:
@@ -597,6 +610,116 @@ BEGIN_FTR_SECTION
597 END_FTR_SECTION_NESTED(CPU_FTR_ARCH_206, CPU_FTR_ARCH_206, 89) 610 END_FTR_SECTION_NESTED(CPU_FTR_ARCH_206, CPU_FTR_ARCH_206, 89)
598END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S) 611END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S)
599 612
613#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
614BEGIN_FTR_SECTION
615 b skip_tm
616END_FTR_SECTION_IFCLR(CPU_FTR_TM)
617
618 /* Turn on TM/FP/VSX/VMX so we can restore them. */
619 mfmsr r5
620 li r6, MSR_TM >> 32
621 sldi r6, r6, 32
622 or r5, r5, r6
623 ori r5, r5, MSR_FP
624 oris r5, r5, (MSR_VEC | MSR_VSX)@h
625 mtmsrd r5
626
627 /*
628 * The user may change these outside of a transaction, so they must
629 * always be context switched.
630 */
631 ld r5, VCPU_TFHAR(r4)
632 ld r6, VCPU_TFIAR(r4)
633 ld r7, VCPU_TEXASR(r4)
634 mtspr SPRN_TFHAR, r5
635 mtspr SPRN_TFIAR, r6
636 mtspr SPRN_TEXASR, r7
637
638 ld r5, VCPU_MSR(r4)
639 rldicl. r5, r5, 64 - MSR_TS_S_LG, 62
640 beq skip_tm /* TM not active in guest */
641
642 /* Make sure the failure summary is set, otherwise we'll program check
643 * when we trechkpt. It's possible that this might have been not set
644 * on a kvmppc_set_one_reg() call but we shouldn't let this crash the
645 * host.
646 */
647 oris r7, r7, (TEXASR_FS)@h
648 mtspr SPRN_TEXASR, r7
649
650 /*
651 * We need to load up the checkpointed state for the guest.
652 * We need to do this early as it will blow away any GPRs, VSRs and
653 * some SPRs.
654 */
655
656 mr r31, r4
657 addi r3, r31, VCPU_FPRS_TM
658 bl .load_fp_state
659 addi r3, r31, VCPU_VRS_TM
660 bl .load_vr_state
661 mr r4, r31
662 lwz r7, VCPU_VRSAVE_TM(r4)
663 mtspr SPRN_VRSAVE, r7
664
665 ld r5, VCPU_LR_TM(r4)
666 lwz r6, VCPU_CR_TM(r4)
667 ld r7, VCPU_CTR_TM(r4)
668 ld r8, VCPU_AMR_TM(r4)
669 ld r9, VCPU_TAR_TM(r4)
670 mtlr r5
671 mtcr r6
672 mtctr r7
673 mtspr SPRN_AMR, r8
674 mtspr SPRN_TAR, r9
675
676 /*
677 * Load up PPR and DSCR values but don't put them in the actual SPRs
678 * till the last moment to avoid running with userspace PPR and DSCR for
679 * too long.
680 */
681 ld r29, VCPU_DSCR_TM(r4)
682 ld r30, VCPU_PPR_TM(r4)
683
684 std r2, PACATMSCRATCH(r13) /* Save TOC */
685
686 /* Clear the MSR RI since r1, r13 are all going to be foobar. */
687 li r5, 0
688 mtmsrd r5, 1
689
690 /* Load GPRs r0-r28 */
691 reg = 0
692 .rept 29
693 ld reg, VCPU_GPRS_TM(reg)(r31)
694 reg = reg + 1
695 .endr
696
697 mtspr SPRN_DSCR, r29
698 mtspr SPRN_PPR, r30
699
700 /* Load final GPRs */
701 ld 29, VCPU_GPRS_TM(29)(r31)
702 ld 30, VCPU_GPRS_TM(30)(r31)
703 ld 31, VCPU_GPRS_TM(31)(r31)
704
705 /* TM checkpointed state is now setup. All GPRs are now volatile. */
706 TRECHKPT
707
708 /* Now let's get back the state we need. */
709 HMT_MEDIUM
710 GET_PACA(r13)
711 ld r29, HSTATE_DSCR(r13)
712 mtspr SPRN_DSCR, r29
713 ld r4, HSTATE_KVM_VCPU(r13)
714 ld r1, HSTATE_HOST_R1(r13)
715 ld r2, PACATMSCRATCH(r13)
716
717 /* Set the MSR RI since we have our registers back. */
718 li r5, MSR_RI
719 mtmsrd r5, 1
720skip_tm:
721#endif
722
600 /* Load guest PMU registers */ 723 /* Load guest PMU registers */
601 /* R4 is live here (vcpu pointer) */ 724 /* R4 is live here (vcpu pointer) */
602 li r3, 1 725 li r3, 1
@@ -704,14 +827,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S)
704 ld r6, VCPU_VTB(r4) 827 ld r6, VCPU_VTB(r4)
705 mtspr SPRN_IC, r5 828 mtspr SPRN_IC, r5
706 mtspr SPRN_VTB, r6 829 mtspr SPRN_VTB, r6
707#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
708 ld r5, VCPU_TFHAR(r4)
709 ld r6, VCPU_TFIAR(r4)
710 ld r7, VCPU_TEXASR(r4)
711 mtspr SPRN_TFHAR, r5
712 mtspr SPRN_TFIAR, r6
713 mtspr SPRN_TEXASR, r7
714#endif
715 ld r8, VCPU_EBBHR(r4) 830 ld r8, VCPU_EBBHR(r4)
716 mtspr SPRN_EBBHR, r8 831 mtspr SPRN_EBBHR, r8
717 ld r5, VCPU_EBBRR(r4) 832 ld r5, VCPU_EBBRR(r4)
@@ -736,6 +851,10 @@ END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S)
736 * Set the decrementer to the guest decrementer. 851 * Set the decrementer to the guest decrementer.
737 */ 852 */
738 ld r8,VCPU_DEC_EXPIRES(r4) 853 ld r8,VCPU_DEC_EXPIRES(r4)
854 /* r8 is a host timebase value here, convert to guest TB */
855 ld r5,HSTATE_KVM_VCORE(r13)
856 ld r6,VCORE_TB_OFFSET(r5)
857 add r8,r8,r6
739 mftb r7 858 mftb r7
740 subf r3,r7,r8 859 subf r3,r7,r8
741 mtspr SPRN_DEC,r3 860 mtspr SPRN_DEC,r3
@@ -817,7 +936,8 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_206)
81712: mtspr SPRN_SRR0, r10 93612: mtspr SPRN_SRR0, r10
818 mr r10,r0 937 mr r10,r0
819 mtspr SPRN_SRR1, r11 938 mtspr SPRN_SRR1, r11
820 ld r11, VCPU_INTR_MSR(r4) 939 mr r9, r4
940 bl kvmppc_msr_interrupt
8215: 9415:
822 942
823/* 943/*
@@ -1098,17 +1218,15 @@ END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_201)
1098 mftb r6 1218 mftb r6
1099 extsw r5,r5 1219 extsw r5,r5
1100 add r5,r5,r6 1220 add r5,r5,r6
1221 /* r5 is a guest timebase value here, convert to host TB */
1222 ld r3,HSTATE_KVM_VCORE(r13)
1223 ld r4,VCORE_TB_OFFSET(r3)
1224 subf r5,r4,r5
1101 std r5,VCPU_DEC_EXPIRES(r9) 1225 std r5,VCPU_DEC_EXPIRES(r9)
1102 1226
1103BEGIN_FTR_SECTION 1227BEGIN_FTR_SECTION
1104 b 8f 1228 b 8f
1105END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S) 1229END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S)
1106 /* Turn on TM so we can access TFHAR/TFIAR/TEXASR */
1107 mfmsr r8
1108 li r0, 1
1109 rldimi r8, r0, MSR_TM_LG, 63-MSR_TM_LG
1110 mtmsrd r8
1111
1112 /* Save POWER8-specific registers */ 1230 /* Save POWER8-specific registers */
1113 mfspr r5, SPRN_IAMR 1231 mfspr r5, SPRN_IAMR
1114 mfspr r6, SPRN_PSPB 1232 mfspr r6, SPRN_PSPB
@@ -1122,14 +1240,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S)
1122 std r5, VCPU_IC(r9) 1240 std r5, VCPU_IC(r9)
1123 std r6, VCPU_VTB(r9) 1241 std r6, VCPU_VTB(r9)
1124 std r7, VCPU_TAR(r9) 1242 std r7, VCPU_TAR(r9)
1125#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
1126 mfspr r5, SPRN_TFHAR
1127 mfspr r6, SPRN_TFIAR
1128 mfspr r7, SPRN_TEXASR
1129 std r5, VCPU_TFHAR(r9)
1130 std r6, VCPU_TFIAR(r9)
1131 std r7, VCPU_TEXASR(r9)
1132#endif
1133 mfspr r8, SPRN_EBBHR 1243 mfspr r8, SPRN_EBBHR
1134 std r8, VCPU_EBBHR(r9) 1244 std r8, VCPU_EBBHR(r9)
1135 mfspr r5, SPRN_EBBRR 1245 mfspr r5, SPRN_EBBRR
@@ -1387,7 +1497,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
1387 ld r8,VCORE_TB_OFFSET(r5) 1497 ld r8,VCORE_TB_OFFSET(r5)
1388 cmpdi r8,0 1498 cmpdi r8,0
1389 beq 17f 1499 beq 17f
1390 mftb r6 /* current host timebase */ 1500 mftb r6 /* current guest timebase */
1391 subf r8,r8,r6 1501 subf r8,r8,r6
1392 mtspr SPRN_TBU40,r8 /* update upper 40 bits */ 1502 mtspr SPRN_TBU40,r8 /* update upper 40 bits */
1393 mftb r7 /* check if lower 24 bits overflowed */ 1503 mftb r7 /* check if lower 24 bits overflowed */
@@ -1557,7 +1667,7 @@ kvmppc_hdsi:
1557 mtspr SPRN_SRR0, r10 1667 mtspr SPRN_SRR0, r10
1558 mtspr SPRN_SRR1, r11 1668 mtspr SPRN_SRR1, r11
1559 li r10, BOOK3S_INTERRUPT_DATA_STORAGE 1669 li r10, BOOK3S_INTERRUPT_DATA_STORAGE
1560 ld r11, VCPU_INTR_MSR(r9) 1670 bl kvmppc_msr_interrupt
1561fast_interrupt_c_return: 1671fast_interrupt_c_return:
15626: ld r7, VCPU_CTR(r9) 16726: ld r7, VCPU_CTR(r9)
1563 lwz r8, VCPU_XER(r9) 1673 lwz r8, VCPU_XER(r9)
@@ -1626,7 +1736,7 @@ kvmppc_hisi:
16261: mtspr SPRN_SRR0, r10 17361: mtspr SPRN_SRR0, r10
1627 mtspr SPRN_SRR1, r11 1737 mtspr SPRN_SRR1, r11
1628 li r10, BOOK3S_INTERRUPT_INST_STORAGE 1738 li r10, BOOK3S_INTERRUPT_INST_STORAGE
1629 ld r11, VCPU_INTR_MSR(r9) 1739 bl kvmppc_msr_interrupt
1630 b fast_interrupt_c_return 1740 b fast_interrupt_c_return
1631 1741
16323: ld r6, VCPU_KVM(r9) /* not relocated, use VRMA */ 17423: ld r6, VCPU_KVM(r9) /* not relocated, use VRMA */
@@ -1669,7 +1779,7 @@ sc_1_fast_return:
1669 mtspr SPRN_SRR0,r10 1779 mtspr SPRN_SRR0,r10
1670 mtspr SPRN_SRR1,r11 1780 mtspr SPRN_SRR1,r11
1671 li r10, BOOK3S_INTERRUPT_SYSCALL 1781 li r10, BOOK3S_INTERRUPT_SYSCALL
1672 ld r11, VCPU_INTR_MSR(r9) 1782 bl kvmppc_msr_interrupt
1673 mr r4,r9 1783 mr r4,r9
1674 b fast_guest_return 1784 b fast_guest_return
1675 1785
@@ -1691,7 +1801,7 @@ hcall_real_table:
1691 .long 0 /* 0x10 - H_CLEAR_MOD */ 1801 .long 0 /* 0x10 - H_CLEAR_MOD */
1692 .long 0 /* 0x14 - H_CLEAR_REF */ 1802 .long 0 /* 0x14 - H_CLEAR_REF */
1693 .long .kvmppc_h_protect - hcall_real_table 1803 .long .kvmppc_h_protect - hcall_real_table
1694 .long 0 /* 0x1c - H_GET_TCE */ 1804 .long .kvmppc_h_get_tce - hcall_real_table
1695 .long .kvmppc_h_put_tce - hcall_real_table 1805 .long .kvmppc_h_put_tce - hcall_real_table
1696 .long 0 /* 0x24 - H_SET_SPRG0 */ 1806 .long 0 /* 0x24 - H_SET_SPRG0 */
1697 .long .kvmppc_h_set_dabr - hcall_real_table 1807 .long .kvmppc_h_set_dabr - hcall_real_table
@@ -1997,7 +2107,7 @@ machine_check_realmode:
1997 beq mc_cont 2107 beq mc_cont
1998 /* If not, deliver a machine check. SRR0/1 are already set */ 2108 /* If not, deliver a machine check. SRR0/1 are already set */
1999 li r10, BOOK3S_INTERRUPT_MACHINE_CHECK 2109 li r10, BOOK3S_INTERRUPT_MACHINE_CHECK
2000 ld r11, VCPU_INTR_MSR(r9) 2110 bl kvmppc_msr_interrupt
2001 b fast_interrupt_c_return 2111 b fast_interrupt_c_return
2002 2112
2003/* 2113/*
@@ -2138,8 +2248,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
2138 mfspr r6,SPRN_VRSAVE 2248 mfspr r6,SPRN_VRSAVE
2139 stw r6,VCPU_VRSAVE(r31) 2249 stw r6,VCPU_VRSAVE(r31)
2140 mtlr r30 2250 mtlr r30
2141 mtmsrd r5
2142 isync
2143 blr 2251 blr
2144 2252
2145/* 2253/*
@@ -2186,3 +2294,20 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
2186 */ 2294 */
2187kvmppc_bad_host_intr: 2295kvmppc_bad_host_intr:
2188 b . 2296 b .
2297
2298/*
2299 * This mimics the MSR transition on IRQ delivery. The new guest MSR is taken
2300 * from VCPU_INTR_MSR and is modified based on the required TM state changes.
2301 * r11 has the guest MSR value (in/out)
2302 * r9 has a vcpu pointer (in)
2303 * r0 is used as a scratch register
2304 */
2305kvmppc_msr_interrupt:
2306 rldicl r0, r11, 64 - MSR_TS_S_LG, 62
2307 cmpwi r0, 2 /* Check if we are in transactional state.. */
2308 ld r11, VCPU_INTR_MSR(r9)
2309 bne 1f
2310 /* ... if transactional, change to suspended */
2311 li r0, 1
23121: rldimi r11, r0, MSR_TS_S_LG, 63 - MSR_TS_T_LG
2313 blr
diff --git a/arch/powerpc/kvm/book3s_interrupts.S b/arch/powerpc/kvm/book3s_interrupts.S
index f779450cb07c..3533c999194a 100644
--- a/arch/powerpc/kvm/book3s_interrupts.S
+++ b/arch/powerpc/kvm/book3s_interrupts.S
@@ -153,8 +153,8 @@ kvm_start_lightweight:
153 * Reload kernel SPRG3 value. 153 * Reload kernel SPRG3 value.
154 * No need to save guest value as usermode can't modify SPRG3. 154 * No need to save guest value as usermode can't modify SPRG3.
155 */ 155 */
156 ld r3, PACA_SPRG3(r13) 156 ld r3, PACA_SPRG_VDSO(r13)
157 mtspr SPRN_SPRG3, r3 157 mtspr SPRN_SPRG_VDSO_WRITE, r3
158#endif /* CONFIG_PPC_BOOK3S_64 */ 158#endif /* CONFIG_PPC_BOOK3S_64 */
159 159
160 /* R7 = vcpu */ 160 /* R7 = vcpu */
diff --git a/arch/powerpc/kvm/book3s_rtas.c b/arch/powerpc/kvm/book3s_rtas.c
index cf95cdef73c9..7a053157483b 100644
--- a/arch/powerpc/kvm/book3s_rtas.c
+++ b/arch/powerpc/kvm/book3s_rtas.c
@@ -213,8 +213,11 @@ int kvmppc_rtas_hcall(struct kvm_vcpu *vcpu)
213 gpa_t args_phys; 213 gpa_t args_phys;
214 int rc; 214 int rc;
215 215
216 /* r4 contains the guest physical address of the RTAS args */ 216 /*
217 args_phys = kvmppc_get_gpr(vcpu, 4); 217 * r4 contains the guest physical address of the RTAS args
218 * Mask off the top 4 bits since this is a guest real address
219 */
220 args_phys = kvmppc_get_gpr(vcpu, 4) & KVM_PAM;
218 221
219 rc = kvm_read_guest(vcpu->kvm, args_phys, &args, sizeof(args)); 222 rc = kvm_read_guest(vcpu->kvm, args_phys, &args, sizeof(args));
220 if (rc) 223 if (rc)
diff --git a/arch/powerpc/kvm/bookehv_interrupts.S b/arch/powerpc/kvm/bookehv_interrupts.S
index e4185f6b3309..a1712b818a5f 100644
--- a/arch/powerpc/kvm/bookehv_interrupts.S
+++ b/arch/powerpc/kvm/bookehv_interrupts.S
@@ -229,17 +229,20 @@
229 stw r10, VCPU_CR(r4) 229 stw r10, VCPU_CR(r4)
230 PPC_STL r11, VCPU_GPR(R4)(r4) 230 PPC_STL r11, VCPU_GPR(R4)(r4)
231 PPC_STL r5, VCPU_GPR(R5)(r4) 231 PPC_STL r5, VCPU_GPR(R5)(r4)
232 .if \type == EX_CRIT
233 PPC_LL r5, (\paca_ex + EX_R13)(r13)
234 .else
235 mfspr r5, \scratch
236 .endif
237 PPC_STL r6, VCPU_GPR(R6)(r4) 232 PPC_STL r6, VCPU_GPR(R6)(r4)
238 PPC_STL r8, VCPU_GPR(R8)(r4) 233 PPC_STL r8, VCPU_GPR(R8)(r4)
239 PPC_STL r9, VCPU_GPR(R9)(r4) 234 PPC_STL r9, VCPU_GPR(R9)(r4)
240 PPC_STL r5, VCPU_GPR(R13)(r4) 235 .if \type == EX_TLB
236 PPC_LL r5, EX_TLB_R13(r12)
237 PPC_LL r6, EX_TLB_R10(r12)
238 PPC_LL r8, EX_TLB_R11(r12)
239 mfspr r12, \scratch
240 .else
241 mfspr r5, \scratch
241 PPC_LL r6, (\paca_ex + \ex_r10)(r13) 242 PPC_LL r6, (\paca_ex + \ex_r10)(r13)
242 PPC_LL r8, (\paca_ex + \ex_r11)(r13) 243 PPC_LL r8, (\paca_ex + \ex_r11)(r13)
244 .endif
245 PPC_STL r5, VCPU_GPR(R13)(r4)
243 PPC_STL r3, VCPU_GPR(R3)(r4) 246 PPC_STL r3, VCPU_GPR(R3)(r4)
244 PPC_STL r7, VCPU_GPR(R7)(r4) 247 PPC_STL r7, VCPU_GPR(R7)(r4)
245 PPC_STL r12, VCPU_GPR(R12)(r4) 248 PPC_STL r12, VCPU_GPR(R12)(r4)
@@ -435,10 +438,16 @@ _GLOBAL(kvmppc_resume_host)
435 PPC_STL r5, VCPU_LR(r4) 438 PPC_STL r5, VCPU_LR(r4)
436 mfspr r7, SPRN_SPRG5 439 mfspr r7, SPRN_SPRG5
437 stw r3, VCPU_VRSAVE(r4) 440 stw r3, VCPU_VRSAVE(r4)
441#ifdef CONFIG_64BIT
442 PPC_LL r3, PACA_SPRG_VDSO(r13)
443#endif
438 PPC_STD(r6, VCPU_SHARED_SPRG4, r11) 444 PPC_STD(r6, VCPU_SHARED_SPRG4, r11)
439 mfspr r8, SPRN_SPRG6 445 mfspr r8, SPRN_SPRG6
440 PPC_STD(r7, VCPU_SHARED_SPRG5, r11) 446 PPC_STD(r7, VCPU_SHARED_SPRG5, r11)
441 mfspr r9, SPRN_SPRG7 447 mfspr r9, SPRN_SPRG7
448#ifdef CONFIG_64BIT
449 mtspr SPRN_SPRG_VDSO_WRITE, r3
450#endif
442 PPC_STD(r8, VCPU_SHARED_SPRG6, r11) 451 PPC_STD(r8, VCPU_SHARED_SPRG6, r11)
443 mfxer r3 452 mfxer r3
444 PPC_STD(r9, VCPU_SHARED_SPRG7, r11) 453 PPC_STD(r9, VCPU_SHARED_SPRG7, r11)
diff --git a/arch/powerpc/lib/memcpy_64.S b/arch/powerpc/lib/memcpy_64.S
index d2bbbc8d7dc0..72ad055168a3 100644
--- a/arch/powerpc/lib/memcpy_64.S
+++ b/arch/powerpc/lib/memcpy_64.S
@@ -14,7 +14,9 @@ _GLOBAL(memcpy)
14BEGIN_FTR_SECTION 14BEGIN_FTR_SECTION
15 std r3,48(r1) /* save destination pointer for return value */ 15 std r3,48(r1) /* save destination pointer for return value */
16FTR_SECTION_ELSE 16FTR_SECTION_ELSE
17#ifndef SELFTEST
17 b memcpy_power7 18 b memcpy_power7
19#endif
18ALT_FTR_SECTION_END_IFCLR(CPU_FTR_VMX_COPY) 20ALT_FTR_SECTION_END_IFCLR(CPU_FTR_VMX_COPY)
19 PPC_MTOCRF(0x01,r5) 21 PPC_MTOCRF(0x01,r5)
20 cmpldi cr1,r5,16 22 cmpldi cr1,r5,16
diff --git a/arch/powerpc/math-emu/mtfsf.c b/arch/powerpc/math-emu/mtfsf.c
index dbce92e4f046..44b0fc8214f4 100644
--- a/arch/powerpc/math-emu/mtfsf.c
+++ b/arch/powerpc/math-emu/mtfsf.c
@@ -11,48 +11,36 @@ mtfsf(unsigned int FM, u32 *frB)
11 u32 mask; 11 u32 mask;
12 u32 fpscr; 12 u32 fpscr;
13 13
14 if (FM == 0) 14 if (likely(FM == 1))
15 return 0; 15 mask = 0x0f;
16 16 else if (likely(FM == 0xff))
17 if (FM == 0xff) 17 mask = ~0;
18 mask = 0x9fffffff;
19 else { 18 else {
20 mask = 0; 19 mask = ((FM & 1) |
21 if (FM & (1 << 0)) 20 ((FM << 3) & 0x10) |
22 mask |= 0x90000000; 21 ((FM << 6) & 0x100) |
23 if (FM & (1 << 1)) 22 ((FM << 9) & 0x1000) |
24 mask |= 0x0f000000; 23 ((FM << 12) & 0x10000) |
25 if (FM & (1 << 2)) 24 ((FM << 15) & 0x100000) |
26 mask |= 0x00f00000; 25 ((FM << 18) & 0x1000000) |
27 if (FM & (1 << 3)) 26 ((FM << 21) & 0x10000000)) * 15;
28 mask |= 0x000f0000;
29 if (FM & (1 << 4))
30 mask |= 0x0000f000;
31 if (FM & (1 << 5))
32 mask |= 0x00000f00;
33 if (FM & (1 << 6))
34 mask |= 0x000000f0;
35 if (FM & (1 << 7))
36 mask |= 0x0000000f;
37 } 27 }
38 28
39 __FPU_FPSCR &= ~(mask); 29 fpscr = ((__FPU_FPSCR & ~mask) | (frB[1] & mask)) &
40 __FPU_FPSCR |= (frB[1] & mask); 30 ~(FPSCR_VX | FPSCR_FEX | 0x800);
41 31
42 __FPU_FPSCR &= ~(FPSCR_VX); 32 if (fpscr & (FPSCR_VXSNAN | FPSCR_VXISI | FPSCR_VXIDI |
43 if (__FPU_FPSCR & (FPSCR_VXSNAN | FPSCR_VXISI | FPSCR_VXIDI |
44 FPSCR_VXZDZ | FPSCR_VXIMZ | FPSCR_VXVC | 33 FPSCR_VXZDZ | FPSCR_VXIMZ | FPSCR_VXVC |
45 FPSCR_VXSOFT | FPSCR_VXSQRT | FPSCR_VXCVI)) 34 FPSCR_VXSOFT | FPSCR_VXSQRT | FPSCR_VXCVI))
46 __FPU_FPSCR |= FPSCR_VX; 35 fpscr |= FPSCR_VX;
47 36
48 fpscr = __FPU_FPSCR; 37 /* The bit order of exception enables and exception status
49 fpscr &= ~(FPSCR_FEX); 38 * is the same. Simply shift and mask to check for enabled
50 if (((fpscr & FPSCR_VX) && (fpscr & FPSCR_VE)) || 39 * exceptions.
51 ((fpscr & FPSCR_OX) && (fpscr & FPSCR_OE)) || 40 */
52 ((fpscr & FPSCR_UX) && (fpscr & FPSCR_UE)) || 41 if (fpscr & (fpscr >> 22) & 0xf8)
53 ((fpscr & FPSCR_ZX) && (fpscr & FPSCR_ZE)) ||
54 ((fpscr & FPSCR_XX) && (fpscr & FPSCR_XE)))
55 fpscr |= FPSCR_FEX; 42 fpscr |= FPSCR_FEX;
43
56 __FPU_FPSCR = fpscr; 44 __FPU_FPSCR = fpscr;
57 45
58#ifdef DEBUG 46#ifdef DEBUG
diff --git a/arch/powerpc/mm/gup.c b/arch/powerpc/mm/gup.c
index c5f734e20b0f..d8746684f606 100644
--- a/arch/powerpc/mm/gup.c
+++ b/arch/powerpc/mm/gup.c
@@ -36,6 +36,11 @@ static noinline int gup_pte_range(pmd_t pmd, unsigned long addr,
36 do { 36 do {
37 pte_t pte = ACCESS_ONCE(*ptep); 37 pte_t pte = ACCESS_ONCE(*ptep);
38 struct page *page; 38 struct page *page;
39 /*
40 * Similar to the PMD case, NUMA hinting must take slow path
41 */
42 if (pte_numa(pte))
43 return 0;
39 44
40 if ((pte_val(pte) & mask) != result) 45 if ((pte_val(pte) & mask) != result)
41 return 0; 46 return 0;
@@ -75,6 +80,14 @@ static int gup_pmd_range(pud_t pud, unsigned long addr, unsigned long end,
75 if (pmd_none(pmd) || pmd_trans_splitting(pmd)) 80 if (pmd_none(pmd) || pmd_trans_splitting(pmd))
76 return 0; 81 return 0;
77 if (pmd_huge(pmd) || pmd_large(pmd)) { 82 if (pmd_huge(pmd) || pmd_large(pmd)) {
83 /*
84 * NUMA hinting faults need to be handled in the GUP
85 * slowpath for accounting purposes and so that they
86 * can be serialised against THP migration.
87 */
88 if (pmd_numa(pmd))
89 return 0;
90
78 if (!gup_hugepte((pte_t *)pmdp, PMD_SIZE, addr, next, 91 if (!gup_hugepte((pte_t *)pmdp, PMD_SIZE, addr, next,
79 write, pages, nr)) 92 write, pages, nr))
80 return 0; 93 return 0;
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 4b5cd5c2594d..2c8e90f5789e 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -139,9 +139,14 @@ int arch_remove_memory(u64 start, u64 size)
139 unsigned long start_pfn = start >> PAGE_SHIFT; 139 unsigned long start_pfn = start >> PAGE_SHIFT;
140 unsigned long nr_pages = size >> PAGE_SHIFT; 140 unsigned long nr_pages = size >> PAGE_SHIFT;
141 struct zone *zone; 141 struct zone *zone;
142 int ret;
142 143
143 zone = page_zone(pfn_to_page(start_pfn)); 144 zone = page_zone(pfn_to_page(start_pfn));
144 return __remove_pages(zone, start_pfn, nr_pages); 145 ret = __remove_pages(zone, start_pfn, nr_pages);
146 if (!ret && (ppc_md.remove_memory))
147 ret = ppc_md.remove_memory(start, size);
148
149 return ret;
145} 150}
146#endif 151#endif
147#endif /* CONFIG_MEMORY_HOTPLUG */ 152#endif /* CONFIG_MEMORY_HOTPLUG */
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 30a42e24bf14..4ebbb9e99286 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1591,6 +1591,20 @@ int arch_update_cpu_topology(void)
1591 cpu = cpu_last_thread_sibling(cpu); 1591 cpu = cpu_last_thread_sibling(cpu);
1592 } 1592 }
1593 1593
1594 /*
1595 * In cases where we have nothing to update (because the updates list
1596 * is too short or because the new topology is same as the old one),
1597 * skip invoking update_cpu_topology() via stop-machine(). This is
1598 * necessary (and not just a fast-path optimization) since stop-machine
1599 * can end up electing a random CPU to run update_cpu_topology(), and
1600 * thus trick us into setting up incorrect cpu-node mappings (since
1601 * 'updates' is kzalloc()'ed).
1602 *
1603 * And for the similar reason, we will skip all the following updating.
1604 */
1605 if (!cpumask_weight(&updated_cpus))
1606 goto out;
1607
1594 stop_machine(update_cpu_topology, &updates[0], &updated_cpus); 1608 stop_machine(update_cpu_topology, &updates[0], &updated_cpus);
1595 1609
1596 /* 1610 /*
@@ -1612,6 +1626,7 @@ int arch_update_cpu_topology(void)
1612 changed = 1; 1626 changed = 1;
1613 } 1627 }
1614 1628
1629out:
1615 kfree(updates); 1630 kfree(updates);
1616 return changed; 1631 return changed;
1617} 1632}
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index 62bf5e8e78da..f6ce1f111f5b 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -647,6 +647,11 @@ void pmdp_splitting_flush(struct vm_area_struct *vma,
647 if (old & _PAGE_HASHPTE) 647 if (old & _PAGE_HASHPTE)
648 hpte_do_hugepage_flush(vma->vm_mm, address, pmdp); 648 hpte_do_hugepage_flush(vma->vm_mm, address, pmdp);
649 } 649 }
650 /*
651 * This ensures that generic code that rely on IRQ disabling
652 * to prevent a parallel THP split work as expected.
653 */
654 kick_all_cpus_sync();
650} 655}
651 656
652/* 657/*
diff --git a/arch/powerpc/mm/tlb_low_64e.S b/arch/powerpc/mm/tlb_low_64e.S
index c95eb323e9ae..356e8b41fb09 100644
--- a/arch/powerpc/mm/tlb_low_64e.S
+++ b/arch/powerpc/mm/tlb_low_64e.S
@@ -39,37 +39,49 @@
39 * * 39 * *
40 **********************************************************************/ 40 **********************************************************************/
41 41
42/*
43 * Note that, unlike non-bolted handlers, TLB_EXFRAME is not
44 * modified by the TLB miss handlers themselves, since the TLB miss
45 * handler code will not itself cause a recursive TLB miss.
46 *
47 * TLB_EXFRAME will be modified when crit/mc/debug exceptions are
48 * entered/exited.
49 */
42.macro tlb_prolog_bolted intnum addr 50.macro tlb_prolog_bolted intnum addr
43 mtspr SPRN_SPRG_GEN_SCRATCH,r13 51 mtspr SPRN_SPRG_GEN_SCRATCH,r12
52 mfspr r12,SPRN_SPRG_TLB_EXFRAME
53 std r13,EX_TLB_R13(r12)
54 std r10,EX_TLB_R10(r12)
44 mfspr r13,SPRN_SPRG_PACA 55 mfspr r13,SPRN_SPRG_PACA
45 std r10,PACA_EXTLB+EX_TLB_R10(r13) 56
46 mfcr r10 57 mfcr r10
47 std r11,PACA_EXTLB+EX_TLB_R11(r13) 58 std r11,EX_TLB_R11(r12)
48#ifdef CONFIG_KVM_BOOKE_HV 59#ifdef CONFIG_KVM_BOOKE_HV
49BEGIN_FTR_SECTION 60BEGIN_FTR_SECTION
50 mfspr r11, SPRN_SRR1 61 mfspr r11, SPRN_SRR1
51END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV) 62END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
52#endif 63#endif
53 DO_KVM \intnum, SPRN_SRR1 64 DO_KVM \intnum, SPRN_SRR1
54 std r16,PACA_EXTLB+EX_TLB_R16(r13) 65 std r16,EX_TLB_R16(r12)
55 mfspr r16,\addr /* get faulting address */ 66 mfspr r16,\addr /* get faulting address */
56 std r14,PACA_EXTLB+EX_TLB_R14(r13) 67 std r14,EX_TLB_R14(r12)
57 ld r14,PACAPGD(r13) 68 ld r14,PACAPGD(r13)
58 std r15,PACA_EXTLB+EX_TLB_R15(r13) 69 std r15,EX_TLB_R15(r12)
59 std r10,PACA_EXTLB+EX_TLB_CR(r13) 70 std r10,EX_TLB_CR(r12)
60 TLB_MISS_PROLOG_STATS_BOLTED 71 TLB_MISS_PROLOG_STATS
61.endm 72.endm
62 73
63.macro tlb_epilog_bolted 74.macro tlb_epilog_bolted
64 ld r14,PACA_EXTLB+EX_TLB_CR(r13) 75 ld r14,EX_TLB_CR(r12)
65 ld r10,PACA_EXTLB+EX_TLB_R10(r13) 76 ld r10,EX_TLB_R10(r12)
66 ld r11,PACA_EXTLB+EX_TLB_R11(r13) 77 ld r11,EX_TLB_R11(r12)
78 ld r13,EX_TLB_R13(r12)
67 mtcr r14 79 mtcr r14
68 ld r14,PACA_EXTLB+EX_TLB_R14(r13) 80 ld r14,EX_TLB_R14(r12)
69 ld r15,PACA_EXTLB+EX_TLB_R15(r13) 81 ld r15,EX_TLB_R15(r12)
70 TLB_MISS_RESTORE_STATS_BOLTED 82 TLB_MISS_RESTORE_STATS
71 ld r16,PACA_EXTLB+EX_TLB_R16(r13) 83 ld r16,EX_TLB_R16(r12)
72 mfspr r13,SPRN_SPRG_GEN_SCRATCH 84 mfspr r12,SPRN_SPRG_GEN_SCRATCH
73.endm 85.endm
74 86
75/* Data TLB miss */ 87/* Data TLB miss */
@@ -284,7 +296,7 @@ itlb_miss_fault_bolted:
284 * r14 = page table base 296 * r14 = page table base
285 * r13 = PACA 297 * r13 = PACA
286 * r11 = tlb_per_core ptr 298 * r11 = tlb_per_core ptr
287 * r10 = crap (free to use) 299 * r10 = cpu number
288 */ 300 */
289tlb_miss_common_e6500: 301tlb_miss_common_e6500:
290 /* 302 /*
@@ -293,15 +305,18 @@ tlb_miss_common_e6500:
293 * 305 *
294 * MAS6:IND should be already set based on MAS4 306 * MAS6:IND should be already set based on MAS4
295 */ 307 */
296 addi r10,r11,TCD_LOCK 3081: lbarx r15,0,r11
2971: lbarx r15,0,r10 309 lhz r10,PACAPACAINDEX(r13)
298 cmpdi r15,0 310 cmpdi r15,0
311 cmpdi cr1,r15,1 /* set cr1.eq = 0 for non-recursive */
299 bne 2f 312 bne 2f
300 li r15,1 313 stbcx. r10,0,r11
301 stbcx. r15,0,r10
302 bne 1b 314 bne 1b
3153:
303 .subsection 1 316 .subsection 1
3042: lbz r15,0(r10) 3172: cmpd cr1,r15,r10 /* recursive lock due to mcheck/crit/etc? */
318 beq cr1,3b /* unlock will happen if cr1.eq = 0 */
319 lbz r15,0(r11)
305 cmpdi r15,0 320 cmpdi r15,0
306 bne 2b 321 bne 2b
307 b 1b 322 b 1b
@@ -379,9 +394,11 @@ tlb_miss_common_e6500:
379 394
380tlb_miss_done_e6500: 395tlb_miss_done_e6500:
381 .macro tlb_unlock_e6500 396 .macro tlb_unlock_e6500
397 beq cr1,1f /* no unlock if lock was recursively grabbed */
382 li r15,0 398 li r15,0
383 isync 399 isync
384 stb r15,TCD_LOCK(r11) 400 stb r15,0(r11)
4011:
385 .endm 402 .endm
386 403
387 tlb_unlock_e6500 404 tlb_unlock_e6500
@@ -1091,7 +1108,8 @@ tlb_load_linear:
1091 ld r11,PACATOC(r13) 1108 ld r11,PACATOC(r13)
1092 ld r11,linear_map_top@got(r11) 1109 ld r11,linear_map_top@got(r11)
1093 ld r10,0(r11) 1110 ld r10,0(r11)
1094 cmpld cr0,r10,r16 1111 tovirt(10,10)
1112 cmpld cr0,r16,r10
1095 bge tlb_load_linear_fault 1113 bge tlb_load_linear_fault
1096 1114
1097 /* MAS1 need whole new setup. */ 1115 /* MAS1 need whole new setup. */
diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c
index b37a58e1c92d..ae3d5b799b90 100644
--- a/arch/powerpc/mm/tlb_nohash.c
+++ b/arch/powerpc/mm/tlb_nohash.c
@@ -144,6 +144,15 @@ int mmu_vmemmap_psize; /* Page size used for the virtual mem map */
144int book3e_htw_mode; /* HW tablewalk? Value is PPC_HTW_* */ 144int book3e_htw_mode; /* HW tablewalk? Value is PPC_HTW_* */
145unsigned long linear_map_top; /* Top of linear mapping */ 145unsigned long linear_map_top; /* Top of linear mapping */
146 146
147
148/*
149 * Number of bytes to add to SPRN_SPRG_TLB_EXFRAME on crit/mcheck/debug
150 * exceptions. This is used for bolted and e6500 TLB miss handlers which
151 * do not modify this SPRG in the TLB miss code; for other TLB miss handlers,
152 * this is set to zero.
153 */
154int extlb_level_exc;
155
147#endif /* CONFIG_PPC64 */ 156#endif /* CONFIG_PPC64 */
148 157
149#ifdef CONFIG_PPC_FSL_BOOK3E 158#ifdef CONFIG_PPC_FSL_BOOK3E
@@ -559,6 +568,7 @@ static void setup_mmu_htw(void)
559 break; 568 break;
560#ifdef CONFIG_PPC_FSL_BOOK3E 569#ifdef CONFIG_PPC_FSL_BOOK3E
561 case PPC_HTW_E6500: 570 case PPC_HTW_E6500:
571 extlb_level_exc = EX_TLB_SIZE;
562 patch_exception(0x1c0, exc_data_tlb_miss_e6500_book3e); 572 patch_exception(0x1c0, exc_data_tlb_miss_e6500_book3e);
563 patch_exception(0x1e0, exc_instruction_tlb_miss_e6500_book3e); 573 patch_exception(0x1e0, exc_instruction_tlb_miss_e6500_book3e);
564 break; 574 break;
@@ -652,6 +662,7 @@ static void __early_init_mmu(int boot_cpu)
652 memblock_enforce_memory_limit(linear_map_top); 662 memblock_enforce_memory_limit(linear_map_top);
653 663
654 if (book3e_htw_mode == PPC_HTW_NONE) { 664 if (book3e_htw_mode == PPC_HTW_NONE) {
665 extlb_level_exc = EX_TLB_SIZE;
655 patch_exception(0x1c0, exc_data_tlb_miss_bolted_book3e); 666 patch_exception(0x1c0, exc_data_tlb_miss_bolted_book3e);
656 patch_exception(0x1e0, 667 patch_exception(0x1e0,
657 exc_instruction_tlb_miss_bolted_book3e); 668 exc_instruction_tlb_miss_bolted_book3e);
diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c
index 555034f8505e..808ce1cae21a 100644
--- a/arch/powerpc/net/bpf_jit_comp.c
+++ b/arch/powerpc/net/bpf_jit_comp.c
@@ -390,9 +390,9 @@ static int bpf_jit_build_body(struct sk_filter *fp, u32 *image,
390 mark)); 390 mark));
391 break; 391 break;
392 case BPF_S_ANC_RXHASH: 392 case BPF_S_ANC_RXHASH:
393 BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, rxhash) != 4); 393 BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, hash) != 4);
394 PPC_LWZ_OFFS(r_A, r_skb, offsetof(struct sk_buff, 394 PPC_LWZ_OFFS(r_A, r_skb, offsetof(struct sk_buff,
395 rxhash)); 395 hash));
396 break; 396 break;
397 case BPF_S_ANC_VLAN_TAG: 397 case BPF_S_ANC_VLAN_TAG:
398 case BPF_S_ANC_VLAN_TAG_PRESENT: 398 case BPF_S_ANC_VLAN_TAG_PRESENT:
@@ -689,6 +689,7 @@ void bpf_jit_compile(struct sk_filter *fp)
689 ((u64 *)image)[0] = (u64)code_base; 689 ((u64 *)image)[0] = (u64)code_base;
690 ((u64 *)image)[1] = local_paca->kernel_toc; 690 ((u64 *)image)[1] = local_paca->kernel_toc;
691 fp->bpf_func = (void *)image; 691 fp->bpf_func = (void *)image;
692 fp->jited = 1;
692 } 693 }
693out: 694out:
694 kfree(addrs); 695 kfree(addrs);
@@ -697,7 +698,7 @@ out:
697 698
698void bpf_jit_free(struct sk_filter *fp) 699void bpf_jit_free(struct sk_filter *fp)
699{ 700{
700 if (fp->bpf_func != sk_run_filter) 701 if (fp->jited)
701 module_free(NULL, fp->bpf_func); 702 module_free(NULL, fp->bpf_func);
702 kfree(fp); 703 kfree(fp);
703} 704}
diff --git a/arch/powerpc/oprofile/op_model_cell.c b/arch/powerpc/oprofile/op_model_cell.c
index 1f0ebdeea5f7..863d89386f60 100644
--- a/arch/powerpc/oprofile/op_model_cell.c
+++ b/arch/powerpc/oprofile/op_model_cell.c
@@ -1121,8 +1121,7 @@ oprof_cpufreq_notify(struct notifier_block *nb, unsigned long val, void *data)
1121 int ret = 0; 1121 int ret = 0;
1122 struct cpufreq_freqs *frq = data; 1122 struct cpufreq_freqs *frq = data;
1123 if ((val == CPUFREQ_PRECHANGE && frq->old < frq->new) || 1123 if ((val == CPUFREQ_PRECHANGE && frq->old < frq->new) ||
1124 (val == CPUFREQ_POSTCHANGE && frq->old > frq->new) || 1124 (val == CPUFREQ_POSTCHANGE && frq->old > frq->new))
1125 (val == CPUFREQ_RESUMECHANGE || val == CPUFREQ_SUSPENDCHANGE))
1126 set_spu_profiling_frequency(frq->new, spu_cycle_reset); 1125 set_spu_profiling_frequency(frq->new, spu_cycle_reset);
1127 return ret; 1126 return ret;
1128} 1127}
diff --git a/arch/powerpc/perf/Makefile b/arch/powerpc/perf/Makefile
index 60d71eea919c..f9c083a5652a 100644
--- a/arch/powerpc/perf/Makefile
+++ b/arch/powerpc/perf/Makefile
@@ -11,5 +11,7 @@ obj32-$(CONFIG_PPC_PERF_CTRS) += mpc7450-pmu.o
11obj-$(CONFIG_FSL_EMB_PERF_EVENT) += core-fsl-emb.o 11obj-$(CONFIG_FSL_EMB_PERF_EVENT) += core-fsl-emb.o
12obj-$(CONFIG_FSL_EMB_PERF_EVENT_E500) += e500-pmu.o e6500-pmu.o 12obj-$(CONFIG_FSL_EMB_PERF_EVENT_E500) += e500-pmu.o e6500-pmu.o
13 13
14obj-$(CONFIG_HV_PERF_CTRS) += hv-24x7.o hv-gpci.o hv-common.o
15
14obj-$(CONFIG_PPC64) += $(obj64-y) 16obj-$(CONFIG_PPC64) += $(obj64-y)
15obj-$(CONFIG_PPC32) += $(obj32-y) 17obj-$(CONFIG_PPC32) += $(obj32-y)
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 67cf22083f4c..4520c9356b54 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -78,6 +78,7 @@ static unsigned int freeze_events_kernel = MMCR0_FCS;
78#define MMCR0_FC56 0 78#define MMCR0_FC56 0
79#define MMCR0_PMAO 0 79#define MMCR0_PMAO 0
80#define MMCR0_EBE 0 80#define MMCR0_EBE 0
81#define MMCR0_BHRBA 0
81#define MMCR0_PMCC 0 82#define MMCR0_PMCC 0
82#define MMCR0_PMCC_U6 0 83#define MMCR0_PMCC_U6 0
83 84
@@ -120,6 +121,7 @@ static inline void power_pmu_bhrb_enable(struct perf_event *event) {}
120static inline void power_pmu_bhrb_disable(struct perf_event *event) {} 121static inline void power_pmu_bhrb_disable(struct perf_event *event) {}
121void power_pmu_flush_branch_stack(void) {} 122void power_pmu_flush_branch_stack(void) {}
122static inline void power_pmu_bhrb_read(struct cpu_hw_events *cpuhw) {} 123static inline void power_pmu_bhrb_read(struct cpu_hw_events *cpuhw) {}
124static void pmao_restore_workaround(bool ebb) { }
123#endif /* CONFIG_PPC32 */ 125#endif /* CONFIG_PPC32 */
124 126
125static bool regs_use_siar(struct pt_regs *regs) 127static bool regs_use_siar(struct pt_regs *regs)
@@ -502,8 +504,11 @@ static int ebb_event_check(struct perf_event *event)
502 if (!leader->attr.pinned || !leader->attr.exclusive) 504 if (!leader->attr.pinned || !leader->attr.exclusive)
503 return -EINVAL; 505 return -EINVAL;
504 506
505 if (event->attr.inherit || event->attr.sample_period || 507 if (event->attr.freq ||
506 event->attr.enable_on_exec || event->attr.freq) 508 event->attr.inherit ||
509 event->attr.sample_type ||
510 event->attr.sample_period ||
511 event->attr.enable_on_exec)
507 return -EINVAL; 512 return -EINVAL;
508 } 513 }
509 514
@@ -542,13 +547,21 @@ static unsigned long ebb_switch_in(bool ebb, unsigned long mmcr0)
542 if (!ebb) 547 if (!ebb)
543 goto out; 548 goto out;
544 549
545 /* Enable EBB and read/write to all 6 PMCs for userspace */ 550 /* Enable EBB and read/write to all 6 PMCs and BHRB for userspace */
546 mmcr0 |= MMCR0_EBE | MMCR0_PMCC_U6; 551 mmcr0 |= MMCR0_EBE | MMCR0_BHRBA | MMCR0_PMCC_U6;
547 552
548 /* Add any bits from the user reg, FC or PMAO */ 553 /*
554 * Add any bits from the user MMCR0, FC or PMAO. This is compatible
555 * with pmao_restore_workaround() because we may add PMAO but we never
556 * clear it here.
557 */
549 mmcr0 |= current->thread.mmcr0; 558 mmcr0 |= current->thread.mmcr0;
550 559
551 /* Be careful not to set PMXE if userspace had it cleared */ 560 /*
561 * Be careful not to set PMXE if userspace had it cleared. This is also
562 * compatible with pmao_restore_workaround() because it has already
563 * cleared PMXE and we leave PMAO alone.
564 */
552 if (!(current->thread.mmcr0 & MMCR0_PMXE)) 565 if (!(current->thread.mmcr0 & MMCR0_PMXE))
553 mmcr0 &= ~MMCR0_PMXE; 566 mmcr0 &= ~MMCR0_PMXE;
554 567
@@ -559,13 +572,94 @@ static unsigned long ebb_switch_in(bool ebb, unsigned long mmcr0)
559out: 572out:
560 return mmcr0; 573 return mmcr0;
561} 574}
562#endif /* CONFIG_PPC64 */
563
564static void perf_event_interrupt(struct pt_regs *regs);
565 575
566void perf_event_print_debug(void) 576static void pmao_restore_workaround(bool ebb)
567{ 577{
578 unsigned pmcs[6];
579
580 if (!cpu_has_feature(CPU_FTR_PMAO_BUG))
581 return;
582
583 /*
584 * On POWER8E there is a hardware defect which affects the PMU context
585 * switch logic, ie. power_pmu_disable/enable().
586 *
587 * When a counter overflows PMXE is cleared and FC/PMAO is set in MMCR0
588 * by the hardware. Sometime later the actual PMU exception is
589 * delivered.
590 *
591 * If we context switch, or simply disable/enable, the PMU prior to the
592 * exception arriving, the exception will be lost when we clear PMAO.
593 *
594 * When we reenable the PMU, we will write the saved MMCR0 with PMAO
595 * set, and this _should_ generate an exception. However because of the
596 * defect no exception is generated when we write PMAO, and we get
597 * stuck with no counters counting but no exception delivered.
598 *
599 * The workaround is to detect this case and tweak the hardware to
600 * create another pending PMU exception.
601 *
602 * We do that by setting up PMC6 (cycles) for an imminent overflow and
603 * enabling the PMU. That causes a new exception to be generated in the
604 * chip, but we don't take it yet because we have interrupts hard
605 * disabled. We then write back the PMU state as we want it to be seen
606 * by the exception handler. When we reenable interrupts the exception
607 * handler will be called and see the correct state.
608 *
609 * The logic is the same for EBB, except that the exception is gated by
610 * us having interrupts hard disabled as well as the fact that we are
611 * not in userspace. The exception is finally delivered when we return
612 * to userspace.
613 */
614
615 /* Only if PMAO is set and PMAO_SYNC is clear */
616 if ((current->thread.mmcr0 & (MMCR0_PMAO | MMCR0_PMAO_SYNC)) != MMCR0_PMAO)
617 return;
618
619 /* If we're doing EBB, only if BESCR[GE] is set */
620 if (ebb && !(current->thread.bescr & BESCR_GE))
621 return;
622
623 /*
624 * We are already soft-disabled in power_pmu_enable(). We need to hard
625 * enable to actually prevent the PMU exception from firing.
626 */
627 hard_irq_disable();
628
629 /*
630 * This is a bit gross, but we know we're on POWER8E and have 6 PMCs.
631 * Using read/write_pmc() in a for loop adds 12 function calls and
632 * almost doubles our code size.
633 */
634 pmcs[0] = mfspr(SPRN_PMC1);
635 pmcs[1] = mfspr(SPRN_PMC2);
636 pmcs[2] = mfspr(SPRN_PMC3);
637 pmcs[3] = mfspr(SPRN_PMC4);
638 pmcs[4] = mfspr(SPRN_PMC5);
639 pmcs[5] = mfspr(SPRN_PMC6);
640
641 /* Ensure all freeze bits are unset */
642 mtspr(SPRN_MMCR2, 0);
643
644 /* Set up PMC6 to overflow in one cycle */
645 mtspr(SPRN_PMC6, 0x7FFFFFFE);
646
647 /* Enable exceptions and unfreeze PMC6 */
648 mtspr(SPRN_MMCR0, MMCR0_PMXE | MMCR0_PMCjCE | MMCR0_PMAO);
649
650 /* Now we need to refreeze and restore the PMCs */
651 mtspr(SPRN_MMCR0, MMCR0_FC | MMCR0_PMAO);
652
653 mtspr(SPRN_PMC1, pmcs[0]);
654 mtspr(SPRN_PMC2, pmcs[1]);
655 mtspr(SPRN_PMC3, pmcs[2]);
656 mtspr(SPRN_PMC4, pmcs[3]);
657 mtspr(SPRN_PMC5, pmcs[4]);
658 mtspr(SPRN_PMC6, pmcs[5]);
568} 659}
660#endif /* CONFIG_PPC64 */
661
662static void perf_event_interrupt(struct pt_regs *regs);
569 663
570/* 664/*
571 * Read one performance monitor counter (PMC). 665 * Read one performance monitor counter (PMC).
@@ -645,6 +739,57 @@ static void write_pmc(int idx, unsigned long val)
645 } 739 }
646} 740}
647 741
742/* Called from sysrq_handle_showregs() */
743void perf_event_print_debug(void)
744{
745 unsigned long sdar, sier, flags;
746 u32 pmcs[MAX_HWEVENTS];
747 int i;
748
749 if (!ppmu->n_counter)
750 return;
751
752 local_irq_save(flags);
753
754 pr_info("CPU: %d PMU registers, ppmu = %s n_counters = %d",
755 smp_processor_id(), ppmu->name, ppmu->n_counter);
756
757 for (i = 0; i < ppmu->n_counter; i++)
758 pmcs[i] = read_pmc(i + 1);
759
760 for (; i < MAX_HWEVENTS; i++)
761 pmcs[i] = 0xdeadbeef;
762
763 pr_info("PMC1: %08x PMC2: %08x PMC3: %08x PMC4: %08x\n",
764 pmcs[0], pmcs[1], pmcs[2], pmcs[3]);
765
766 if (ppmu->n_counter > 4)
767 pr_info("PMC5: %08x PMC6: %08x PMC7: %08x PMC8: %08x\n",
768 pmcs[4], pmcs[5], pmcs[6], pmcs[7]);
769
770 pr_info("MMCR0: %016lx MMCR1: %016lx MMCRA: %016lx\n",
771 mfspr(SPRN_MMCR0), mfspr(SPRN_MMCR1), mfspr(SPRN_MMCRA));
772
773 sdar = sier = 0;
774#ifdef CONFIG_PPC64
775 sdar = mfspr(SPRN_SDAR);
776
777 if (ppmu->flags & PPMU_HAS_SIER)
778 sier = mfspr(SPRN_SIER);
779
780 if (ppmu->flags & PPMU_EBB) {
781 pr_info("MMCR2: %016lx EBBHR: %016lx\n",
782 mfspr(SPRN_MMCR2), mfspr(SPRN_EBBHR));
783 pr_info("EBBRR: %016lx BESCR: %016lx\n",
784 mfspr(SPRN_EBBRR), mfspr(SPRN_BESCR));
785 }
786#endif
787 pr_info("SIAR: %016lx SDAR: %016lx SIER: %016lx\n",
788 mfspr(SPRN_SIAR), sdar, sier);
789
790 local_irq_restore(flags);
791}
792
648/* 793/*
649 * Check if a set of events can all go on the PMU at once. 794 * Check if a set of events can all go on the PMU at once.
650 * If they can't, this will look at alternative codes for the events 795 * If they can't, this will look at alternative codes for the events
@@ -973,11 +1118,12 @@ static void power_pmu_disable(struct pmu *pmu)
973 } 1118 }
974 1119
975 /* 1120 /*
976 * Set the 'freeze counters' bit, clear EBE/PMCC/PMAO/FC56. 1121 * Set the 'freeze counters' bit, clear EBE/BHRBA/PMCC/PMAO/FC56
977 */ 1122 */
978 val = mmcr0 = mfspr(SPRN_MMCR0); 1123 val = mmcr0 = mfspr(SPRN_MMCR0);
979 val |= MMCR0_FC; 1124 val |= MMCR0_FC;
980 val &= ~(MMCR0_EBE | MMCR0_PMCC | MMCR0_PMAO | MMCR0_FC56); 1125 val &= ~(MMCR0_EBE | MMCR0_BHRBA | MMCR0_PMCC | MMCR0_PMAO |
1126 MMCR0_FC56);
981 1127
982 /* 1128 /*
983 * The barrier is to make sure the mtspr has been 1129 * The barrier is to make sure the mtspr has been
@@ -1144,6 +1290,8 @@ static void power_pmu_enable(struct pmu *pmu)
1144 cpuhw->mmcr[0] |= MMCR0_PMXE | MMCR0_FCECE; 1290 cpuhw->mmcr[0] |= MMCR0_PMXE | MMCR0_FCECE;
1145 1291
1146 out_enable: 1292 out_enable:
1293 pmao_restore_workaround(ebb);
1294
1147 mmcr0 = ebb_switch_in(ebb, cpuhw->mmcr[0]); 1295 mmcr0 = ebb_switch_in(ebb, cpuhw->mmcr[0]);
1148 1296
1149 mb(); 1297 mb();
diff --git a/arch/powerpc/perf/hv-24x7-catalog.h b/arch/powerpc/perf/hv-24x7-catalog.h
new file mode 100644
index 000000000000..21b19dd86d9c
--- /dev/null
+++ b/arch/powerpc/perf/hv-24x7-catalog.h
@@ -0,0 +1,33 @@
1#ifndef LINUX_POWERPC_PERF_HV_24X7_CATALOG_H_
2#define LINUX_POWERPC_PERF_HV_24X7_CATALOG_H_
3
4#include <linux/types.h>
5
6/* From document "24x7 Event and Group Catalog Formats Proposal" v0.15 */
7
8struct hv_24x7_catalog_page_0 {
9#define HV_24X7_CATALOG_MAGIC 0x32347837 /* "24x7" in ASCII */
10 __be32 magic;
11 __be32 length; /* In 4096 byte pages */
12 __be64 version; /* XXX: arbitrary? what's the meaning/useage/purpose? */
13 __u8 build_time_stamp[16]; /* "YYYYMMDDHHMMSS\0\0" */
14 __u8 reserved2[32];
15 __be16 schema_data_offs; /* in 4096 byte pages */
16 __be16 schema_data_len; /* in 4096 byte pages */
17 __be16 schema_entry_count;
18 __u8 reserved3[2];
19 __be16 event_data_offs;
20 __be16 event_data_len;
21 __be16 event_entry_count;
22 __u8 reserved4[2];
23 __be16 group_data_offs; /* in 4096 byte pages */
24 __be16 group_data_len; /* in 4096 byte pages */
25 __be16 group_entry_count;
26 __u8 reserved5[2];
27 __be16 formula_data_offs; /* in 4096 byte pages */
28 __be16 formula_data_len; /* in 4096 byte pages */
29 __be16 formula_entry_count;
30 __u8 reserved6[2];
31} __packed;
32
33#endif
diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c
new file mode 100644
index 000000000000..297c91051413
--- /dev/null
+++ b/arch/powerpc/perf/hv-24x7.c
@@ -0,0 +1,510 @@
1/*
2 * Hypervisor supplied "24x7" performance counter support
3 *
4 * Author: Cody P Schafer <cody@linux.vnet.ibm.com>
5 * Copyright 2014 IBM Corporation.
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#define pr_fmt(fmt) "hv-24x7: " fmt
14
15#include <linux/perf_event.h>
16#include <linux/module.h>
17#include <linux/slab.h>
18#include <asm/firmware.h>
19#include <asm/hvcall.h>
20#include <asm/io.h>
21
22#include "hv-24x7.h"
23#include "hv-24x7-catalog.h"
24#include "hv-common.h"
25
26/*
27 * TODO: Merging events:
28 * - Think of the hcall as an interface to a 4d array of counters:
29 * - x = domains
30 * - y = indexes in the domain (core, chip, vcpu, node, etc)
31 * - z = offset into the counter space
32 * - w = lpars (guest vms, "logical partitions")
33 * - A single request is: x,y,y_last,z,z_last,w,w_last
34 * - this means we can retrieve a rectangle of counters in y,z for a single x.
35 *
36 * - Things to consider (ignoring w):
37 * - input cost_per_request = 16
38 * - output cost_per_result(ys,zs) = 8 + 8 * ys + ys * zs
39 * - limited number of requests per hcall (must fit into 4K bytes)
40 * - 4k = 16 [buffer header] - 16 [request size] * request_count
41 * - 255 requests per hcall
42 * - sometimes it will be more efficient to read extra data and discard
43 */
44
45/*
46 * Example usage:
47 * perf stat -e 'hv_24x7/domain=2,offset=8,starting_index=0,lpar=0xffffffff/'
48 */
49
50/* u3 0-6, one of HV_24X7_PERF_DOMAIN */
51EVENT_DEFINE_RANGE_FORMAT(domain, config, 0, 3);
52/* u16 */
53EVENT_DEFINE_RANGE_FORMAT(starting_index, config, 16, 31);
54/* u32, see "data_offset" */
55EVENT_DEFINE_RANGE_FORMAT(offset, config, 32, 63);
56/* u16 */
57EVENT_DEFINE_RANGE_FORMAT(lpar, config1, 0, 15);
58
59EVENT_DEFINE_RANGE(reserved1, config, 4, 15);
60EVENT_DEFINE_RANGE(reserved2, config1, 16, 63);
61EVENT_DEFINE_RANGE(reserved3, config2, 0, 63);
62
63static struct attribute *format_attrs[] = {
64 &format_attr_domain.attr,
65 &format_attr_offset.attr,
66 &format_attr_starting_index.attr,
67 &format_attr_lpar.attr,
68 NULL,
69};
70
71static struct attribute_group format_group = {
72 .name = "format",
73 .attrs = format_attrs,
74};
75
76static struct kmem_cache *hv_page_cache;
77
78/*
79 * read_offset_data - copy data from one buffer to another while treating the
80 * source buffer as a small view on the total avaliable
81 * source data.
82 *
83 * @dest: buffer to copy into
84 * @dest_len: length of @dest in bytes
85 * @requested_offset: the offset within the source data we want. Must be > 0
86 * @src: buffer to copy data from
87 * @src_len: length of @src in bytes
88 * @source_offset: the offset in the sorce data that (src,src_len) refers to.
89 * Must be > 0
90 *
91 * returns the number of bytes copied.
92 *
93 * The following ascii art shows the various buffer possitioning we need to
94 * handle, assigns some arbitrary varibles to points on the buffer, and then
95 * shows how we fiddle with those values to get things we care about (copy
96 * start in src and copy len)
97 *
98 * s = @src buffer
99 * d = @dest buffer
100 * '.' areas in d are written to.
101 *
102 * u
103 * x w v z
104 * d |.........|
105 * s |----------------------|
106 *
107 * u
108 * x w z v
109 * d |........------|
110 * s |------------------|
111 *
112 * x w u,z,v
113 * d |........|
114 * s |------------------|
115 *
116 * x,w u,v,z
117 * d |..................|
118 * s |------------------|
119 *
120 * x u
121 * w v z
122 * d |........|
123 * s |------------------|
124 *
125 * x z w v
126 * d |------|
127 * s |------|
128 *
129 * x = source_offset
130 * w = requested_offset
131 * z = source_offset + src_len
132 * v = requested_offset + dest_len
133 *
134 * w_offset_in_s = w - x = requested_offset - source_offset
135 * z_offset_in_s = z - x = src_len
136 * v_offset_in_s = v - x = request_offset + dest_len - src_len
137 */
138static ssize_t read_offset_data(void *dest, size_t dest_len,
139 loff_t requested_offset, void *src,
140 size_t src_len, loff_t source_offset)
141{
142 size_t w_offset_in_s = requested_offset - source_offset;
143 size_t z_offset_in_s = src_len;
144 size_t v_offset_in_s = requested_offset + dest_len - src_len;
145 size_t u_offset_in_s = min(z_offset_in_s, v_offset_in_s);
146 size_t copy_len = u_offset_in_s - w_offset_in_s;
147
148 if (requested_offset < 0 || source_offset < 0)
149 return -EINVAL;
150
151 if (z_offset_in_s <= w_offset_in_s)
152 return 0;
153
154 memcpy(dest, src + w_offset_in_s, copy_len);
155 return copy_len;
156}
157
158static unsigned long h_get_24x7_catalog_page(char page[static 4096],
159 u32 version, u32 index)
160{
161 WARN_ON(!IS_ALIGNED((unsigned long)page, 4096));
162 return plpar_hcall_norets(H_GET_24X7_CATALOG_PAGE,
163 virt_to_phys(page),
164 version,
165 index);
166}
167
168static ssize_t catalog_read(struct file *filp, struct kobject *kobj,
169 struct bin_attribute *bin_attr, char *buf,
170 loff_t offset, size_t count)
171{
172 unsigned long hret;
173 ssize_t ret = 0;
174 size_t catalog_len = 0, catalog_page_len = 0, page_count = 0;
175 loff_t page_offset = 0;
176 uint32_t catalog_version_num = 0;
177 void *page = kmem_cache_alloc(hv_page_cache, GFP_USER);
178 struct hv_24x7_catalog_page_0 *page_0 = page;
179 if (!page)
180 return -ENOMEM;
181
182 hret = h_get_24x7_catalog_page(page, 0, 0);
183 if (hret) {
184 ret = -EIO;
185 goto e_free;
186 }
187
188 catalog_version_num = be32_to_cpu(page_0->version);
189 catalog_page_len = be32_to_cpu(page_0->length);
190 catalog_len = catalog_page_len * 4096;
191
192 page_offset = offset / 4096;
193 page_count = count / 4096;
194
195 if (page_offset >= catalog_page_len)
196 goto e_free;
197
198 if (page_offset != 0) {
199 hret = h_get_24x7_catalog_page(page, catalog_version_num,
200 page_offset);
201 if (hret) {
202 ret = -EIO;
203 goto e_free;
204 }
205 }
206
207 ret = read_offset_data(buf, count, offset,
208 page, 4096, page_offset * 4096);
209e_free:
210 if (hret)
211 pr_err("h_get_24x7_catalog_page(ver=%d, page=%lld) failed: rc=%ld\n",
212 catalog_version_num, page_offset, hret);
213 kfree(page);
214
215 pr_devel("catalog_read: offset=%lld(%lld) count=%zu(%zu) catalog_len=%zu(%zu) => %zd\n",
216 offset, page_offset, count, page_count, catalog_len,
217 catalog_page_len, ret);
218
219 return ret;
220}
221
222#define PAGE_0_ATTR(_name, _fmt, _expr) \
223static ssize_t _name##_show(struct device *dev, \
224 struct device_attribute *dev_attr, \
225 char *buf) \
226{ \
227 unsigned long hret; \
228 ssize_t ret = 0; \
229 void *page = kmem_cache_alloc(hv_page_cache, GFP_USER); \
230 struct hv_24x7_catalog_page_0 *page_0 = page; \
231 if (!page) \
232 return -ENOMEM; \
233 hret = h_get_24x7_catalog_page(page, 0, 0); \
234 if (hret) { \
235 ret = -EIO; \
236 goto e_free; \
237 } \
238 ret = sprintf(buf, _fmt, _expr); \
239e_free: \
240 kfree(page); \
241 return ret; \
242} \
243static DEVICE_ATTR_RO(_name)
244
245PAGE_0_ATTR(catalog_version, "%lld\n",
246 (unsigned long long)be32_to_cpu(page_0->version));
247PAGE_0_ATTR(catalog_len, "%lld\n",
248 (unsigned long long)be32_to_cpu(page_0->length) * 4096);
249static BIN_ATTR_RO(catalog, 0/* real length varies */);
250
251static struct bin_attribute *if_bin_attrs[] = {
252 &bin_attr_catalog,
253 NULL,
254};
255
256static struct attribute *if_attrs[] = {
257 &dev_attr_catalog_len.attr,
258 &dev_attr_catalog_version.attr,
259 NULL,
260};
261
262static struct attribute_group if_group = {
263 .name = "interface",
264 .bin_attrs = if_bin_attrs,
265 .attrs = if_attrs,
266};
267
268static const struct attribute_group *attr_groups[] = {
269 &format_group,
270 &if_group,
271 NULL,
272};
273
274static bool is_physical_domain(int domain)
275{
276 return domain == HV_24X7_PERF_DOMAIN_PHYSICAL_CHIP ||
277 domain == HV_24X7_PERF_DOMAIN_PHYSICAL_CORE;
278}
279
280static unsigned long single_24x7_request(u8 domain, u32 offset, u16 ix,
281 u16 lpar, u64 *res,
282 bool success_expected)
283{
284 unsigned long ret;
285
286 /*
287 * request_buffer and result_buffer are not required to be 4k aligned,
288 * but are not allowed to cross any 4k boundary. Aligning them to 4k is
289 * the simplest way to ensure that.
290 */
291 struct reqb {
292 struct hv_24x7_request_buffer buf;
293 struct hv_24x7_request req;
294 } __packed __aligned(4096) request_buffer = {
295 .buf = {
296 .interface_version = HV_24X7_IF_VERSION_CURRENT,
297 .num_requests = 1,
298 },
299 .req = {
300 .performance_domain = domain,
301 .data_size = cpu_to_be16(8),
302 .data_offset = cpu_to_be32(offset),
303 .starting_lpar_ix = cpu_to_be16(lpar),
304 .max_num_lpars = cpu_to_be16(1),
305 .starting_ix = cpu_to_be16(ix),
306 .max_ix = cpu_to_be16(1),
307 }
308 };
309
310 struct resb {
311 struct hv_24x7_data_result_buffer buf;
312 struct hv_24x7_result res;
313 struct hv_24x7_result_element elem;
314 __be64 result;
315 } __packed __aligned(4096) result_buffer = {};
316
317 ret = plpar_hcall_norets(H_GET_24X7_DATA,
318 virt_to_phys(&request_buffer), sizeof(request_buffer),
319 virt_to_phys(&result_buffer), sizeof(result_buffer));
320
321 if (ret) {
322 if (success_expected)
323 pr_err_ratelimited("hcall failed: %d %#x %#x %d => 0x%lx (%ld) detail=0x%x failing ix=%x\n",
324 domain, offset, ix, lpar,
325 ret, ret,
326 result_buffer.buf.detailed_rc,
327 result_buffer.buf.failing_request_ix);
328 return ret;
329 }
330
331 *res = be64_to_cpu(result_buffer.result);
332 return ret;
333}
334
335static unsigned long event_24x7_request(struct perf_event *event, u64 *res,
336 bool success_expected)
337{
338 return single_24x7_request(event_get_domain(event),
339 event_get_offset(event),
340 event_get_starting_index(event),
341 event_get_lpar(event),
342 res,
343 success_expected);
344}
345
346static int h_24x7_event_init(struct perf_event *event)
347{
348 struct hv_perf_caps caps;
349 unsigned domain;
350 unsigned long hret;
351 u64 ct;
352
353 /* Not our event */
354 if (event->attr.type != event->pmu->type)
355 return -ENOENT;
356
357 /* Unused areas must be 0 */
358 if (event_get_reserved1(event) ||
359 event_get_reserved2(event) ||
360 event_get_reserved3(event)) {
361 pr_devel("reserved set when forbidden 0x%llx(0x%llx) 0x%llx(0x%llx) 0x%llx(0x%llx)\n",
362 event->attr.config,
363 event_get_reserved1(event),
364 event->attr.config1,
365 event_get_reserved2(event),
366 event->attr.config2,
367 event_get_reserved3(event));
368 return -EINVAL;
369 }
370
371 /* unsupported modes and filters */
372 if (event->attr.exclude_user ||
373 event->attr.exclude_kernel ||
374 event->attr.exclude_hv ||
375 event->attr.exclude_idle ||
376 event->attr.exclude_host ||
377 event->attr.exclude_guest ||
378 is_sampling_event(event)) /* no sampling */
379 return -EINVAL;
380
381 /* no branch sampling */
382 if (has_branch_stack(event))
383 return -EOPNOTSUPP;
384
385 /* offset must be 8 byte aligned */
386 if (event_get_offset(event) % 8) {
387 pr_devel("bad alignment\n");
388 return -EINVAL;
389 }
390
391 /* Domains above 6 are invalid */
392 domain = event_get_domain(event);
393 if (domain > 6) {
394 pr_devel("invalid domain %d\n", domain);
395 return -EINVAL;
396 }
397
398 hret = hv_perf_caps_get(&caps);
399 if (hret) {
400 pr_devel("could not get capabilities: rc=%ld\n", hret);
401 return -EIO;
402 }
403
404 /* PHYSICAL domains & other lpars require extra capabilities */
405 if (!caps.collect_privileged && (is_physical_domain(domain) ||
406 (event_get_lpar(event) != event_get_lpar_max()))) {
407 pr_devel("hv permisions disallow: is_physical_domain:%d, lpar=0x%llx\n",
408 is_physical_domain(domain),
409 event_get_lpar(event));
410 return -EACCES;
411 }
412
413 /* see if the event complains */
414 if (event_24x7_request(event, &ct, false)) {
415 pr_devel("test hcall failed\n");
416 return -EIO;
417 }
418
419 return 0;
420}
421
422static u64 h_24x7_get_value(struct perf_event *event)
423{
424 unsigned long ret;
425 u64 ct;
426 ret = event_24x7_request(event, &ct, true);
427 if (ret)
428 /* We checked this in event init, shouldn't fail here... */
429 return 0;
430
431 return ct;
432}
433
434static void h_24x7_event_update(struct perf_event *event)
435{
436 s64 prev;
437 u64 now;
438 now = h_24x7_get_value(event);
439 prev = local64_xchg(&event->hw.prev_count, now);
440 local64_add(now - prev, &event->count);
441}
442
443static void h_24x7_event_start(struct perf_event *event, int flags)
444{
445 if (flags & PERF_EF_RELOAD)
446 local64_set(&event->hw.prev_count, h_24x7_get_value(event));
447}
448
449static void h_24x7_event_stop(struct perf_event *event, int flags)
450{
451 h_24x7_event_update(event);
452}
453
454static int h_24x7_event_add(struct perf_event *event, int flags)
455{
456 if (flags & PERF_EF_START)
457 h_24x7_event_start(event, flags);
458
459 return 0;
460}
461
462static int h_24x7_event_idx(struct perf_event *event)
463{
464 return 0;
465}
466
467static struct pmu h_24x7_pmu = {
468 .task_ctx_nr = perf_invalid_context,
469
470 .name = "hv_24x7",
471 .attr_groups = attr_groups,
472 .event_init = h_24x7_event_init,
473 .add = h_24x7_event_add,
474 .del = h_24x7_event_stop,
475 .start = h_24x7_event_start,
476 .stop = h_24x7_event_stop,
477 .read = h_24x7_event_update,
478 .event_idx = h_24x7_event_idx,
479};
480
481static int hv_24x7_init(void)
482{
483 int r;
484 unsigned long hret;
485 struct hv_perf_caps caps;
486
487 if (!firmware_has_feature(FW_FEATURE_LPAR)) {
488 pr_info("not a virtualized system, not enabling\n");
489 return -ENODEV;
490 }
491
492 hret = hv_perf_caps_get(&caps);
493 if (hret) {
494 pr_info("could not obtain capabilities, error 0x%80lx, not enabling\n",
495 hret);
496 return -ENODEV;
497 }
498
499 hv_page_cache = kmem_cache_create("hv-page-4096", 4096, 4096, 0, NULL);
500 if (!hv_page_cache)
501 return -ENOMEM;
502
503 r = perf_pmu_register(&h_24x7_pmu, h_24x7_pmu.name, -1);
504 if (r)
505 return r;
506
507 return 0;
508}
509
510device_initcall(hv_24x7_init);
diff --git a/arch/powerpc/perf/hv-24x7.h b/arch/powerpc/perf/hv-24x7.h
new file mode 100644
index 000000000000..720ebce4b435
--- /dev/null
+++ b/arch/powerpc/perf/hv-24x7.h
@@ -0,0 +1,109 @@
1#ifndef LINUX_POWERPC_PERF_HV_24X7_H_
2#define LINUX_POWERPC_PERF_HV_24X7_H_
3
4#include <linux/types.h>
5
6struct hv_24x7_request {
7 /* PHYSICAL domains require enabling via phyp/hmc. */
8#define HV_24X7_PERF_DOMAIN_PHYSICAL_CHIP 0x01
9#define HV_24X7_PERF_DOMAIN_PHYSICAL_CORE 0x02
10#define HV_24X7_PERF_DOMAIN_VIRTUAL_PROCESSOR_HOME_CORE 0x03
11#define HV_24X7_PERF_DOMAIN_VIRTUAL_PROCESSOR_HOME_CHIP 0x04
12#define HV_24X7_PERF_DOMAIN_VIRTUAL_PROCESSOR_HOME_NODE 0x05
13#define HV_24X7_PERF_DOMAIN_VIRTUAL_PROCESSOR_REMOTE_NODE 0x06
14 __u8 performance_domain;
15 __u8 reserved[0x1];
16
17 /* bytes to read starting at @data_offset. must be a multiple of 8 */
18 __be16 data_size;
19
20 /*
21 * byte offset within the perf domain to read from. must be 8 byte
22 * aligned
23 */
24 __be32 data_offset;
25
26 /*
27 * only valid for VIRTUAL_PROCESSOR domains, ignored for others.
28 * -1 means "current partition only"
29 * Enabling via phyp/hmc required for non-"-1" values. 0 forbidden
30 * unless requestor is 0.
31 */
32 __be16 starting_lpar_ix;
33
34 /*
35 * Ignored when @starting_lpar_ix == -1
36 * Ignored when @performance_domain is not VIRTUAL_PROCESSOR_*
37 * -1 means "infinite" or all
38 */
39 __be16 max_num_lpars;
40
41 /* chip, core, or virtual processor based on @performance_domain */
42 __be16 starting_ix;
43 __be16 max_ix;
44} __packed;
45
46struct hv_24x7_request_buffer {
47 /* 0 - ? */
48 /* 1 - ? */
49#define HV_24X7_IF_VERSION_CURRENT 0x01
50 __u8 interface_version;
51 __u8 num_requests;
52 __u8 reserved[0xE];
53 struct hv_24x7_request requests[];
54} __packed;
55
56struct hv_24x7_result_element {
57 __be16 lpar_ix;
58
59 /*
60 * represents the core, chip, or virtual processor based on the
61 * request's @performance_domain
62 */
63 __be16 domain_ix;
64
65 /* -1 if @performance_domain does not refer to a virtual processor */
66 __be32 lpar_cfg_instance_id;
67
68 /* size = @result_element_data_size of cointaining result. */
69 __u8 element_data[];
70} __packed;
71
72struct hv_24x7_result {
73 __u8 result_ix;
74
75 /*
76 * 0 = not all result elements fit into the buffer, additional requests
77 * required
78 * 1 = all result elements were returned
79 */
80 __u8 results_complete;
81 __be16 num_elements_returned;
82
83 /* This is a copy of @data_size from the coresponding hv_24x7_request */
84 __be16 result_element_data_size;
85 __u8 reserved[0x2];
86
87 /* WARNING: only valid for first result element due to variable sizes
88 * of result elements */
89 /* struct hv_24x7_result_element[@num_elements_returned] */
90 struct hv_24x7_result_element elements[];
91} __packed;
92
93struct hv_24x7_data_result_buffer {
94 /* See versioning for request buffer */
95 __u8 interface_version;
96
97 __u8 num_results;
98 __u8 reserved[0x1];
99 __u8 failing_request_ix;
100 __be32 detailed_rc;
101 __be64 cec_cfg_instance_id;
102 __be64 catalog_version_num;
103 __u8 reserved2[0x8];
104 /* WARNING: only valid for the first result due to variable sizes of
105 * results */
106 struct hv_24x7_result results[]; /* [@num_results] */
107} __packed;
108
109#endif
diff --git a/arch/powerpc/perf/hv-common.c b/arch/powerpc/perf/hv-common.c
new file mode 100644
index 000000000000..47e02b366f58
--- /dev/null
+++ b/arch/powerpc/perf/hv-common.c
@@ -0,0 +1,39 @@
1#include <asm/io.h>
2#include <asm/hvcall.h>
3
4#include "hv-gpci.h"
5#include "hv-common.h"
6
7unsigned long hv_perf_caps_get(struct hv_perf_caps *caps)
8{
9 unsigned long r;
10 struct p {
11 struct hv_get_perf_counter_info_params params;
12 struct cv_system_performance_capabilities caps;
13 } __packed __aligned(sizeof(uint64_t));
14
15 struct p arg = {
16 .params = {
17 .counter_request = cpu_to_be32(
18 CIR_SYSTEM_PERFORMANCE_CAPABILITIES),
19 .starting_index = cpu_to_be32(-1),
20 .counter_info_version_in = 0,
21 }
22 };
23
24 r = plpar_hcall_norets(H_GET_PERF_COUNTER_INFO,
25 virt_to_phys(&arg), sizeof(arg));
26
27 if (r)
28 return r;
29
30 pr_devel("capability_mask: 0x%x\n", arg.caps.capability_mask);
31
32 caps->version = arg.params.counter_info_version_out;
33 caps->collect_privileged = !!arg.caps.perf_collect_privileged;
34 caps->ga = !!(arg.caps.capability_mask & CV_CM_GA);
35 caps->expanded = !!(arg.caps.capability_mask & CV_CM_EXPANDED);
36 caps->lab = !!(arg.caps.capability_mask & CV_CM_LAB);
37
38 return r;
39}
diff --git a/arch/powerpc/perf/hv-common.h b/arch/powerpc/perf/hv-common.h
new file mode 100644
index 000000000000..5d79cecbd73d
--- /dev/null
+++ b/arch/powerpc/perf/hv-common.h
@@ -0,0 +1,36 @@
1#ifndef LINUX_POWERPC_PERF_HV_COMMON_H_
2#define LINUX_POWERPC_PERF_HV_COMMON_H_
3
4#include <linux/perf_event.h>
5#include <linux/types.h>
6
7struct hv_perf_caps {
8 u16 version;
9 u16 collect_privileged:1,
10 ga:1,
11 expanded:1,
12 lab:1,
13 unused:12;
14};
15
16unsigned long hv_perf_caps_get(struct hv_perf_caps *caps);
17
18
19#define EVENT_DEFINE_RANGE_FORMAT(name, attr_var, bit_start, bit_end) \
20PMU_FORMAT_ATTR(name, #attr_var ":" #bit_start "-" #bit_end); \
21EVENT_DEFINE_RANGE(name, attr_var, bit_start, bit_end)
22
23#define EVENT_DEFINE_RANGE(name, attr_var, bit_start, bit_end) \
24static u64 event_get_##name##_max(void) \
25{ \
26 BUILD_BUG_ON((bit_start > bit_end) \
27 || (bit_end >= (sizeof(1ull) * 8))); \
28 return (((1ull << (bit_end - bit_start)) - 1) << 1) + 1; \
29} \
30static u64 event_get_##name(struct perf_event *event) \
31{ \
32 return (event->attr.attr_var >> (bit_start)) & \
33 event_get_##name##_max(); \
34}
35
36#endif
diff --git a/arch/powerpc/perf/hv-gpci.c b/arch/powerpc/perf/hv-gpci.c
new file mode 100644
index 000000000000..278ba7b9c2b5
--- /dev/null
+++ b/arch/powerpc/perf/hv-gpci.c
@@ -0,0 +1,294 @@
1/*
2 * Hypervisor supplied "gpci" ("get performance counter info") performance
3 * counter support
4 *
5 * Author: Cody P Schafer <cody@linux.vnet.ibm.com>
6 * Copyright 2014 IBM Corporation.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13
14#define pr_fmt(fmt) "hv-gpci: " fmt
15
16#include <linux/init.h>
17#include <linux/perf_event.h>
18#include <asm/firmware.h>
19#include <asm/hvcall.h>
20#include <asm/io.h>
21
22#include "hv-gpci.h"
23#include "hv-common.h"
24
25/*
26 * Example usage:
27 * perf stat -e 'hv_gpci/counter_info_version=3,offset=0,length=8,
28 * secondary_index=0,starting_index=0xffffffff,request=0x10/' ...
29 */
30
31/* u32 */
32EVENT_DEFINE_RANGE_FORMAT(request, config, 0, 31);
33/* u32 */
34EVENT_DEFINE_RANGE_FORMAT(starting_index, config, 32, 63);
35/* u16 */
36EVENT_DEFINE_RANGE_FORMAT(secondary_index, config1, 0, 15);
37/* u8 */
38EVENT_DEFINE_RANGE_FORMAT(counter_info_version, config1, 16, 23);
39/* u8, bytes of data (1-8) */
40EVENT_DEFINE_RANGE_FORMAT(length, config1, 24, 31);
41/* u32, byte offset */
42EVENT_DEFINE_RANGE_FORMAT(offset, config1, 32, 63);
43
44static struct attribute *format_attrs[] = {
45 &format_attr_request.attr,
46 &format_attr_starting_index.attr,
47 &format_attr_secondary_index.attr,
48 &format_attr_counter_info_version.attr,
49
50 &format_attr_offset.attr,
51 &format_attr_length.attr,
52 NULL,
53};
54
55static struct attribute_group format_group = {
56 .name = "format",
57 .attrs = format_attrs,
58};
59
60#define HV_CAPS_ATTR(_name, _format) \
61static ssize_t _name##_show(struct device *dev, \
62 struct device_attribute *attr, \
63 char *page) \
64{ \
65 struct hv_perf_caps caps; \
66 unsigned long hret = hv_perf_caps_get(&caps); \
67 if (hret) \
68 return -EIO; \
69 \
70 return sprintf(page, _format, caps._name); \
71} \
72static struct device_attribute hv_caps_attr_##_name = __ATTR_RO(_name)
73
74static ssize_t kernel_version_show(struct device *dev,
75 struct device_attribute *attr,
76 char *page)
77{
78 return sprintf(page, "0x%x\n", COUNTER_INFO_VERSION_CURRENT);
79}
80
81DEVICE_ATTR_RO(kernel_version);
82HV_CAPS_ATTR(version, "0x%x\n");
83HV_CAPS_ATTR(ga, "%d\n");
84HV_CAPS_ATTR(expanded, "%d\n");
85HV_CAPS_ATTR(lab, "%d\n");
86HV_CAPS_ATTR(collect_privileged, "%d\n");
87
88static struct attribute *interface_attrs[] = {
89 &dev_attr_kernel_version.attr,
90 &hv_caps_attr_version.attr,
91 &hv_caps_attr_ga.attr,
92 &hv_caps_attr_expanded.attr,
93 &hv_caps_attr_lab.attr,
94 &hv_caps_attr_collect_privileged.attr,
95 NULL,
96};
97
98static struct attribute_group interface_group = {
99 .name = "interface",
100 .attrs = interface_attrs,
101};
102
103static const struct attribute_group *attr_groups[] = {
104 &format_group,
105 &interface_group,
106 NULL,
107};
108
109#define GPCI_MAX_DATA_BYTES \
110 (1024 - sizeof(struct hv_get_perf_counter_info_params))
111
112static unsigned long single_gpci_request(u32 req, u32 starting_index,
113 u16 secondary_index, u8 version_in, u32 offset, u8 length,
114 u64 *value)
115{
116 unsigned long ret;
117 size_t i;
118 u64 count;
119
120 struct {
121 struct hv_get_perf_counter_info_params params;
122 uint8_t bytes[GPCI_MAX_DATA_BYTES];
123 } __packed __aligned(sizeof(uint64_t)) arg = {
124 .params = {
125 .counter_request = cpu_to_be32(req),
126 .starting_index = cpu_to_be32(starting_index),
127 .secondary_index = cpu_to_be16(secondary_index),
128 .counter_info_version_in = version_in,
129 }
130 };
131
132 ret = plpar_hcall_norets(H_GET_PERF_COUNTER_INFO,
133 virt_to_phys(&arg), sizeof(arg));
134 if (ret) {
135 pr_devel("hcall failed: 0x%lx\n", ret);
136 return ret;
137 }
138
139 /*
140 * we verify offset and length are within the zeroed buffer at event
141 * init.
142 */
143 count = 0;
144 for (i = offset; i < offset + length; i++)
145 count |= arg.bytes[i] << (i - offset);
146
147 *value = count;
148 return ret;
149}
150
151static u64 h_gpci_get_value(struct perf_event *event)
152{
153 u64 count;
154 unsigned long ret = single_gpci_request(event_get_request(event),
155 event_get_starting_index(event),
156 event_get_secondary_index(event),
157 event_get_counter_info_version(event),
158 event_get_offset(event),
159 event_get_length(event),
160 &count);
161 if (ret)
162 return 0;
163 return count;
164}
165
166static void h_gpci_event_update(struct perf_event *event)
167{
168 s64 prev;
169 u64 now = h_gpci_get_value(event);
170 prev = local64_xchg(&event->hw.prev_count, now);
171 local64_add(now - prev, &event->count);
172}
173
174static void h_gpci_event_start(struct perf_event *event, int flags)
175{
176 local64_set(&event->hw.prev_count, h_gpci_get_value(event));
177}
178
179static void h_gpci_event_stop(struct perf_event *event, int flags)
180{
181 h_gpci_event_update(event);
182}
183
184static int h_gpci_event_add(struct perf_event *event, int flags)
185{
186 if (flags & PERF_EF_START)
187 h_gpci_event_start(event, flags);
188
189 return 0;
190}
191
192static int h_gpci_event_init(struct perf_event *event)
193{
194 u64 count;
195 u8 length;
196
197 /* Not our event */
198 if (event->attr.type != event->pmu->type)
199 return -ENOENT;
200
201 /* config2 is unused */
202 if (event->attr.config2) {
203 pr_devel("config2 set when reserved\n");
204 return -EINVAL;
205 }
206
207 /* unsupported modes and filters */
208 if (event->attr.exclude_user ||
209 event->attr.exclude_kernel ||
210 event->attr.exclude_hv ||
211 event->attr.exclude_idle ||
212 event->attr.exclude_host ||
213 event->attr.exclude_guest ||
214 is_sampling_event(event)) /* no sampling */
215 return -EINVAL;
216
217 /* no branch sampling */
218 if (has_branch_stack(event))
219 return -EOPNOTSUPP;
220
221 length = event_get_length(event);
222 if (length < 1 || length > 8) {
223 pr_devel("length invalid\n");
224 return -EINVAL;
225 }
226
227 /* last byte within the buffer? */
228 if ((event_get_offset(event) + length) > GPCI_MAX_DATA_BYTES) {
229 pr_devel("request outside of buffer: %zu > %zu\n",
230 (size_t)event_get_offset(event) + length,
231 GPCI_MAX_DATA_BYTES);
232 return -EINVAL;
233 }
234
235 /* check if the request works... */
236 if (single_gpci_request(event_get_request(event),
237 event_get_starting_index(event),
238 event_get_secondary_index(event),
239 event_get_counter_info_version(event),
240 event_get_offset(event),
241 length,
242 &count)) {
243 pr_devel("gpci hcall failed\n");
244 return -EINVAL;
245 }
246
247 return 0;
248}
249
250static int h_gpci_event_idx(struct perf_event *event)
251{
252 return 0;
253}
254
255static struct pmu h_gpci_pmu = {
256 .task_ctx_nr = perf_invalid_context,
257
258 .name = "hv_gpci",
259 .attr_groups = attr_groups,
260 .event_init = h_gpci_event_init,
261 .add = h_gpci_event_add,
262 .del = h_gpci_event_stop,
263 .start = h_gpci_event_start,
264 .stop = h_gpci_event_stop,
265 .read = h_gpci_event_update,
266 .event_idx = h_gpci_event_idx,
267};
268
269static int hv_gpci_init(void)
270{
271 int r;
272 unsigned long hret;
273 struct hv_perf_caps caps;
274
275 if (!firmware_has_feature(FW_FEATURE_LPAR)) {
276 pr_info("not a virtualized system, not enabling\n");
277 return -ENODEV;
278 }
279
280 hret = hv_perf_caps_get(&caps);
281 if (hret) {
282 pr_info("could not obtain capabilities, error 0x%80lx, not enabling\n",
283 hret);
284 return -ENODEV;
285 }
286
287 r = perf_pmu_register(&h_gpci_pmu, h_gpci_pmu.name, -1);
288 if (r)
289 return r;
290
291 return 0;
292}
293
294device_initcall(hv_gpci_init);
diff --git a/arch/powerpc/perf/hv-gpci.h b/arch/powerpc/perf/hv-gpci.h
new file mode 100644
index 000000000000..b25f460c9cce
--- /dev/null
+++ b/arch/powerpc/perf/hv-gpci.h
@@ -0,0 +1,73 @@
1#ifndef LINUX_POWERPC_PERF_HV_GPCI_H_
2#define LINUX_POWERPC_PERF_HV_GPCI_H_
3
4#include <linux/types.h>
5
6/* From the document "H_GetPerformanceCounterInfo Interface" v1.07 */
7
8/* H_GET_PERF_COUNTER_INFO argument */
9struct hv_get_perf_counter_info_params {
10 __be32 counter_request; /* I */
11 __be32 starting_index; /* IO */
12 __be16 secondary_index; /* IO */
13 __be16 returned_values; /* O */
14 __be32 detail_rc; /* O, only needed when called via *_norets() */
15
16 /*
17 * O, size each of counter_value element in bytes, only set for version
18 * >= 0x3
19 */
20 __be16 cv_element_size;
21
22 /* I, 0 (zero) for versions < 0x3 */
23 __u8 counter_info_version_in;
24
25 /* O, 0 (zero) if version < 0x3. Must be set to 0 when making hcall */
26 __u8 counter_info_version_out;
27 __u8 reserved[0xC];
28 __u8 counter_value[];
29} __packed;
30
31/*
32 * counter info version => fw version/reference (spec version)
33 *
34 * 8 => power8 (1.07)
35 * [7 is skipped by spec 1.07]
36 * 6 => TLBIE (1.07)
37 * 5 => v7r7m0.phyp (1.05)
38 * [4 skipped]
39 * 3 => v7r6m0.phyp (?)
40 * [1,2 skipped]
41 * 0 => v7r{2,3,4}m0.phyp (?)
42 */
43#define COUNTER_INFO_VERSION_CURRENT 0x8
44
45/*
46 * These determine the counter_value[] layout and the meaning of starting_index
47 * and secondary_index.
48 *
49 * Unless otherwise noted, @secondary_index is unused and ignored.
50 */
51enum counter_info_requests {
52
53 /* GENERAL */
54
55 /* @starting_index: must be -1 (to refer to the current partition)
56 */
57 CIR_SYSTEM_PERFORMANCE_CAPABILITIES = 0X40,
58};
59
60struct cv_system_performance_capabilities {
61 /* If != 0, allowed to collect data from other partitions */
62 __u8 perf_collect_privileged;
63
64 /* These following are only valid if counter_info_version >= 0x3 */
65#define CV_CM_GA (1 << 7)
66#define CV_CM_EXPANDED (1 << 6)
67#define CV_CM_LAB (1 << 5)
68 /* remaining bits are reserved */
69 __u8 capability_mask;
70 __u8 reserved[0xE];
71} __packed;
72
73#endif
diff --git a/arch/powerpc/perf/power7-events-list.h b/arch/powerpc/perf/power7-events-list.h
index 687790a2c0b8..64f13d9260a6 100644
--- a/arch/powerpc/perf/power7-events-list.h
+++ b/arch/powerpc/perf/power7-events-list.h
@@ -546,3 +546,13 @@ EVENT(PM_MRK_DATA_FROM_RL2L3_SHR, 0x1d04c)
546EVENT(PM_DTLB_MISS_16M, 0x4c05e) 546EVENT(PM_DTLB_MISS_16M, 0x4c05e)
547EVENT(PM_LSU1_LMQ_LHR_MERGE, 0x0d09a) 547EVENT(PM_LSU1_LMQ_LHR_MERGE, 0x0d09a)
548EVENT(PM_IFU_FIN, 0x40066) 548EVENT(PM_IFU_FIN, 0x40066)
549EVENT(PM_1THRD_CON_RUN_INSTR, 0x30062)
550EVENT(PM_CMPLU_STALL_COUNT, 0x4000B)
551EVENT(PM_MEM0_PB_RD_CL, 0x30083)
552EVENT(PM_THRD_1_RUN_CYC, 0x10060)
553EVENT(PM_THRD_2_CONC_RUN_INSTR, 0x40062)
554EVENT(PM_THRD_2_RUN_CYC, 0x20060)
555EVENT(PM_THRD_3_CONC_RUN_INST, 0x10062)
556EVENT(PM_THRD_3_RUN_CYC, 0x30060)
557EVENT(PM_THRD_4_CONC_RUN_INST, 0x20062)
558EVENT(PM_THRD_4_RUN_CYC, 0x40060)
diff --git a/arch/powerpc/perf/power8-pmu.c b/arch/powerpc/perf/power8-pmu.c
index 96cee20dcd34..fe2763b6e039 100644
--- a/arch/powerpc/perf/power8-pmu.c
+++ b/arch/powerpc/perf/power8-pmu.c
@@ -10,6 +10,8 @@
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 */ 11 */
12 12
13#define pr_fmt(fmt) "power8-pmu: " fmt
14
13#include <linux/kernel.h> 15#include <linux/kernel.h>
14#include <linux/perf_event.h> 16#include <linux/perf_event.h>
15#include <asm/firmware.h> 17#include <asm/firmware.h>
@@ -62,9 +64,11 @@
62 * 64 *
63 * 60 56 52 48 44 40 36 32 65 * 60 56 52 48 44 40 36 32
64 * | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | 66 * | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - |
65 * | [ thresh_cmp ] [ thresh_ctl ] 67 * | | [ ] [ thresh_cmp ] [ thresh_ctl ]
66 * | | 68 * | | | |
67 * *- EBB (Linux) thresh start/stop OR FAB match -* 69 * | | *- IFM (Linux) thresh start/stop OR FAB match -*
70 * | *- BHRB (Linux)
71 * *- EBB (Linux)
68 * 72 *
69 * 28 24 20 16 12 8 4 0 73 * 28 24 20 16 12 8 4 0
70 * | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | 74 * | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - |
@@ -114,9 +118,18 @@
114 * MMCRA[57:59] = sample[0:2] (RAND_SAMP_ELIG) 118 * MMCRA[57:59] = sample[0:2] (RAND_SAMP_ELIG)
115 * MMCRA[61:62] = sample[3:4] (RAND_SAMP_MODE) 119 * MMCRA[61:62] = sample[3:4] (RAND_SAMP_MODE)
116 * 120 *
121 * if EBB and BHRB:
122 * MMCRA[32:33] = IFM
123 *
117 */ 124 */
118 125
119#define EVENT_EBB_MASK 1ull 126#define EVENT_EBB_MASK 1ull
127#define EVENT_EBB_SHIFT PERF_EVENT_CONFIG_EBB_SHIFT
128#define EVENT_BHRB_MASK 1ull
129#define EVENT_BHRB_SHIFT 62
130#define EVENT_WANTS_BHRB (EVENT_BHRB_MASK << EVENT_BHRB_SHIFT)
131#define EVENT_IFM_MASK 3ull
132#define EVENT_IFM_SHIFT 60
120#define EVENT_THR_CMP_SHIFT 40 /* Threshold CMP value */ 133#define EVENT_THR_CMP_SHIFT 40 /* Threshold CMP value */
121#define EVENT_THR_CMP_MASK 0x3ff 134#define EVENT_THR_CMP_MASK 0x3ff
122#define EVENT_THR_CTL_SHIFT 32 /* Threshold control value (start/stop) */ 135#define EVENT_THR_CTL_SHIFT 32 /* Threshold control value (start/stop) */
@@ -141,6 +154,12 @@
141#define EVENT_IS_MARKED (EVENT_MARKED_MASK << EVENT_MARKED_SHIFT) 154#define EVENT_IS_MARKED (EVENT_MARKED_MASK << EVENT_MARKED_SHIFT)
142#define EVENT_PSEL_MASK 0xff /* PMCxSEL value */ 155#define EVENT_PSEL_MASK 0xff /* PMCxSEL value */
143 156
157/* Bits defined by Linux */
158#define EVENT_LINUX_MASK \
159 ((EVENT_EBB_MASK << EVENT_EBB_SHIFT) | \
160 (EVENT_BHRB_MASK << EVENT_BHRB_SHIFT) | \
161 (EVENT_IFM_MASK << EVENT_IFM_SHIFT))
162
144#define EVENT_VALID_MASK \ 163#define EVENT_VALID_MASK \
145 ((EVENT_THRESH_MASK << EVENT_THRESH_SHIFT) | \ 164 ((EVENT_THRESH_MASK << EVENT_THRESH_SHIFT) | \
146 (EVENT_SAMPLE_MASK << EVENT_SAMPLE_SHIFT) | \ 165 (EVENT_SAMPLE_MASK << EVENT_SAMPLE_SHIFT) | \
@@ -149,7 +168,7 @@
149 (EVENT_UNIT_MASK << EVENT_UNIT_SHIFT) | \ 168 (EVENT_UNIT_MASK << EVENT_UNIT_SHIFT) | \
150 (EVENT_COMBINE_MASK << EVENT_COMBINE_SHIFT) | \ 169 (EVENT_COMBINE_MASK << EVENT_COMBINE_SHIFT) | \
151 (EVENT_MARKED_MASK << EVENT_MARKED_SHIFT) | \ 170 (EVENT_MARKED_MASK << EVENT_MARKED_SHIFT) | \
152 (EVENT_EBB_MASK << PERF_EVENT_CONFIG_EBB_SHIFT) | \ 171 EVENT_LINUX_MASK | \
153 EVENT_PSEL_MASK) 172 EVENT_PSEL_MASK)
154 173
155/* MMCRA IFM bits - POWER8 */ 174/* MMCRA IFM bits - POWER8 */
@@ -173,10 +192,11 @@
173 * 192 *
174 * 28 24 20 16 12 8 4 0 193 * 28 24 20 16 12 8 4 0
175 * | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | 194 * | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - |
176 * | [ ] [ sample ] [ ] [6] [5] [4] [3] [2] [1] 195 * [ ] | [ ] [ sample ] [ ] [6] [5] [4] [3] [2] [1]
177 * EBB -* | | 196 * | | | |
178 * | | Count of events for each PMC. 197 * BHRB IFM -* | | | Count of events for each PMC.
179 * L1 I/D qualifier -* | p1, p2, p3, p4, p5, p6. 198 * EBB -* | | p1, p2, p3, p4, p5, p6.
199 * L1 I/D qualifier -* |
180 * nc - number of counters -* 200 * nc - number of counters -*
181 * 201 *
182 * The PMC fields P1..P6, and NC, are adder fields. As we accumulate constraints 202 * The PMC fields P1..P6, and NC, are adder fields. As we accumulate constraints
@@ -195,6 +215,9 @@
195#define CNST_EBB_VAL(v) (((v) & EVENT_EBB_MASK) << 24) 215#define CNST_EBB_VAL(v) (((v) & EVENT_EBB_MASK) << 24)
196#define CNST_EBB_MASK CNST_EBB_VAL(EVENT_EBB_MASK) 216#define CNST_EBB_MASK CNST_EBB_VAL(EVENT_EBB_MASK)
197 217
218#define CNST_IFM_VAL(v) (((v) & EVENT_IFM_MASK) << 25)
219#define CNST_IFM_MASK CNST_IFM_VAL(EVENT_IFM_MASK)
220
198#define CNST_L1_QUAL_VAL(v) (((v) & 3) << 22) 221#define CNST_L1_QUAL_VAL(v) (((v) & 3) << 22)
199#define CNST_L1_QUAL_MASK CNST_L1_QUAL_VAL(3) 222#define CNST_L1_QUAL_MASK CNST_L1_QUAL_VAL(3)
200 223
@@ -241,6 +264,7 @@
241#define MMCRA_THR_SEL_SHIFT 16 264#define MMCRA_THR_SEL_SHIFT 16
242#define MMCRA_THR_CMP_SHIFT 32 265#define MMCRA_THR_CMP_SHIFT 32
243#define MMCRA_SDAR_MODE_TLB (1ull << 42) 266#define MMCRA_SDAR_MODE_TLB (1ull << 42)
267#define MMCRA_IFM_SHIFT 30
244 268
245 269
246static inline bool event_is_fab_match(u64 event) 270static inline bool event_is_fab_match(u64 event)
@@ -265,20 +289,22 @@ static int power8_get_constraint(u64 event, unsigned long *maskp, unsigned long
265 pmc = (event >> EVENT_PMC_SHIFT) & EVENT_PMC_MASK; 289 pmc = (event >> EVENT_PMC_SHIFT) & EVENT_PMC_MASK;
266 unit = (event >> EVENT_UNIT_SHIFT) & EVENT_UNIT_MASK; 290 unit = (event >> EVENT_UNIT_SHIFT) & EVENT_UNIT_MASK;
267 cache = (event >> EVENT_CACHE_SEL_SHIFT) & EVENT_CACHE_SEL_MASK; 291 cache = (event >> EVENT_CACHE_SEL_SHIFT) & EVENT_CACHE_SEL_MASK;
268 ebb = (event >> PERF_EVENT_CONFIG_EBB_SHIFT) & EVENT_EBB_MASK; 292 ebb = (event >> EVENT_EBB_SHIFT) & EVENT_EBB_MASK;
269
270 /* Clear the EBB bit in the event, so event checks work below */
271 event &= ~(EVENT_EBB_MASK << PERF_EVENT_CONFIG_EBB_SHIFT);
272 293
273 if (pmc) { 294 if (pmc) {
295 u64 base_event;
296
274 if (pmc > 6) 297 if (pmc > 6)
275 return -1; 298 return -1;
276 299
277 mask |= CNST_PMC_MASK(pmc); 300 /* Ignore Linux defined bits when checking event below */
278 value |= CNST_PMC_VAL(pmc); 301 base_event = event & ~EVENT_LINUX_MASK;
279 302
280 if (pmc >= 5 && event != 0x500fa && event != 0x600f4) 303 if (pmc >= 5 && base_event != 0x500fa && base_event != 0x600f4)
281 return -1; 304 return -1;
305
306 mask |= CNST_PMC_MASK(pmc);
307 value |= CNST_PMC_VAL(pmc);
282 } 308 }
283 309
284 if (pmc <= 4) { 310 if (pmc <= 4) {
@@ -299,9 +325,10 @@ static int power8_get_constraint(u64 event, unsigned long *maskp, unsigned long
299 * HV writable, and there is no API for guest kernels to modify 325 * HV writable, and there is no API for guest kernels to modify
300 * it. The solution is for the hypervisor to initialise the 326 * it. The solution is for the hypervisor to initialise the
301 * field to zeroes, and for us to only ever allow events that 327 * field to zeroes, and for us to only ever allow events that
302 * have a cache selector of zero. 328 * have a cache selector of zero. The bank selector (bit 3) is
329 * irrelevant, as long as the rest of the value is 0.
303 */ 330 */
304 if (cache) 331 if (cache & 0x7)
305 return -1; 332 return -1;
306 333
307 } else if (event & EVENT_IS_L1) { 334 } else if (event & EVENT_IS_L1) {
@@ -342,6 +369,15 @@ static int power8_get_constraint(u64 event, unsigned long *maskp, unsigned long
342 /* EBB events must specify the PMC */ 369 /* EBB events must specify the PMC */
343 return -1; 370 return -1;
344 371
372 if (event & EVENT_WANTS_BHRB) {
373 if (!ebb)
374 /* Only EBB events can request BHRB */
375 return -1;
376
377 mask |= CNST_IFM_MASK;
378 value |= CNST_IFM_VAL(event >> EVENT_IFM_SHIFT);
379 }
380
345 /* 381 /*
346 * All events must agree on EBB, either all request it or none. 382 * All events must agree on EBB, either all request it or none.
347 * EBB events are pinned & exclusive, so this should never actually 383 * EBB events are pinned & exclusive, so this should never actually
@@ -431,6 +467,11 @@ static int power8_compute_mmcr(u64 event[], int n_ev,
431 mmcra |= val << MMCRA_THR_CMP_SHIFT; 467 mmcra |= val << MMCRA_THR_CMP_SHIFT;
432 } 468 }
433 469
470 if (event[i] & EVENT_WANTS_BHRB) {
471 val = (event[i] >> EVENT_IFM_SHIFT) & EVENT_IFM_MASK;
472 mmcra |= val << MMCRA_IFM_SHIFT;
473 }
474
434 hwc[i] = pmc - 1; 475 hwc[i] = pmc - 1;
435 } 476 }
436 477
@@ -774,6 +815,9 @@ static int __init init_power8_pmu(void)
774 /* Tell userspace that EBB is supported */ 815 /* Tell userspace that EBB is supported */
775 cur_cpu_spec->cpu_user_features2 |= PPC_FEATURE2_EBB; 816 cur_cpu_spec->cpu_user_features2 |= PPC_FEATURE2_EBB;
776 817
818 if (cpu_has_feature(CPU_FTR_PMAO_BUG))
819 pr_info("PMAO restore workaround active.\n");
820
777 return 0; 821 return 0;
778} 822}
779early_initcall(init_power8_pmu); 823early_initcall(init_power8_pmu);
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index d6c7506ec7d9..dc1a264ec6e6 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -265,7 +265,6 @@ config 440EP
265 select PPC_FPU 265 select PPC_FPU
266 select IBM440EP_ERR42 266 select IBM440EP_ERR42
267 select IBM_EMAC_ZMII 267 select IBM_EMAC_ZMII
268 select USB_ARCH_HAS_OHCI
269 268
270config 440EPX 269config 440EPX
271 bool 270 bool
diff --git a/arch/powerpc/platforms/85xx/c293pcie.c b/arch/powerpc/platforms/85xx/c293pcie.c
index 213d5b815827..84476b646005 100644
--- a/arch/powerpc/platforms/85xx/c293pcie.c
+++ b/arch/powerpc/platforms/85xx/c293pcie.c
@@ -68,6 +68,7 @@ define_machine(c293_pcie) {
68 .init_IRQ = c293_pcie_pic_init, 68 .init_IRQ = c293_pcie_pic_init,
69#ifdef CONFIG_PCI 69#ifdef CONFIG_PCI
70 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 70 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
71 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
71#endif 72#endif
72 .get_irq = mpic_get_irq, 73 .get_irq = mpic_get_irq,
73 .restart = fsl_rstcr_restart, 74 .restart = fsl_rstcr_restart,
diff --git a/arch/powerpc/platforms/85xx/common.c b/arch/powerpc/platforms/85xx/common.c
index 3b085c7ee539..b564b5e23f7c 100644
--- a/arch/powerpc/platforms/85xx/common.c
+++ b/arch/powerpc/platforms/85xx/common.c
@@ -107,6 +107,12 @@ void __init mpc85xx_qe_init(void)
107 qe_reset(); 107 qe_reset();
108 of_node_put(np); 108 of_node_put(np);
109 109
110}
111
112void __init mpc85xx_qe_par_io_init(void)
113{
114 struct device_node *np;
115
110 np = of_find_node_by_name(NULL, "par_io"); 116 np = of_find_node_by_name(NULL, "par_io");
111 if (np) { 117 if (np) {
112 struct device_node *ucc; 118 struct device_node *ucc;
diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c b/arch/powerpc/platforms/85xx/corenet_generic.c
index fbd871e69754..8e4b1e1a4911 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -26,11 +26,13 @@
26#include <asm/udbg.h> 26#include <asm/udbg.h>
27#include <asm/mpic.h> 27#include <asm/mpic.h>
28#include <asm/ehv_pic.h> 28#include <asm/ehv_pic.h>
29#include <asm/qe_ic.h>
29 30
30#include <linux/of_platform.h> 31#include <linux/of_platform.h>
31#include <sysdev/fsl_soc.h> 32#include <sysdev/fsl_soc.h>
32#include <sysdev/fsl_pci.h> 33#include <sysdev/fsl_pci.h>
33#include "smp.h" 34#include "smp.h"
35#include "mpc85xx.h"
34 36
35void __init corenet_gen_pic_init(void) 37void __init corenet_gen_pic_init(void)
36{ 38{
@@ -38,6 +40,8 @@ void __init corenet_gen_pic_init(void)
38 unsigned int flags = MPIC_BIG_ENDIAN | MPIC_SINGLE_DEST_CPU | 40 unsigned int flags = MPIC_BIG_ENDIAN | MPIC_SINGLE_DEST_CPU |
39 MPIC_NO_RESET; 41 MPIC_NO_RESET;
40 42
43 struct device_node *np;
44
41 if (ppc_md.get_irq == mpic_get_coreint_irq) 45 if (ppc_md.get_irq == mpic_get_coreint_irq)
42 flags |= MPIC_ENABLE_COREINT; 46 flags |= MPIC_ENABLE_COREINT;
43 47
@@ -45,6 +49,13 @@ void __init corenet_gen_pic_init(void)
45 BUG_ON(mpic == NULL); 49 BUG_ON(mpic == NULL);
46 50
47 mpic_init(mpic); 51 mpic_init(mpic);
52
53 np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
54 if (np) {
55 qe_ic_init(np, 0, qe_ic_cascade_low_mpic,
56 qe_ic_cascade_high_mpic);
57 of_node_put(np);
58 }
48} 59}
49 60
50/* 61/*
@@ -57,6 +68,8 @@ void __init corenet_gen_setup_arch(void)
57 swiotlb_detect_4g(); 68 swiotlb_detect_4g();
58 69
59 pr_info("%s board from Freescale Semiconductor\n", ppc_md.name); 70 pr_info("%s board from Freescale Semiconductor\n", ppc_md.name);
71
72 mpc85xx_qe_init();
60} 73}
61 74
62static const struct of_device_id of_device_ids[] = { 75static const struct of_device_id of_device_ids[] = {
@@ -81,6 +94,9 @@ static const struct of_device_id of_device_ids[] = {
81 { 94 {
82 .compatible = "fsl,qoriq-pcie-v3.0", 95 .compatible = "fsl,qoriq-pcie-v3.0",
83 }, 96 },
97 {
98 .compatible = "fsl,qe",
99 },
84 /* The following two are for the Freescale hypervisor */ 100 /* The following two are for the Freescale hypervisor */
85 { 101 {
86 .name = "hypervisor", 102 .name = "hypervisor",
@@ -163,6 +179,7 @@ define_machine(corenet_generic) {
163 .init_IRQ = corenet_gen_pic_init, 179 .init_IRQ = corenet_gen_pic_init,
164#ifdef CONFIG_PCI 180#ifdef CONFIG_PCI
165 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 181 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
182 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
166#endif 183#endif
167 .get_irq = mpic_get_coreint_irq, 184 .get_irq = mpic_get_coreint_irq,
168 .restart = fsl_rstcr_restart, 185 .restart = fsl_rstcr_restart,
diff --git a/arch/powerpc/platforms/85xx/ge_imp3a.c b/arch/powerpc/platforms/85xx/ge_imp3a.c
index e6285ae6f423..11790e074c8a 100644
--- a/arch/powerpc/platforms/85xx/ge_imp3a.c
+++ b/arch/powerpc/platforms/85xx/ge_imp3a.c
@@ -215,6 +215,7 @@ define_machine(ge_imp3a) {
215 .show_cpuinfo = ge_imp3a_show_cpuinfo, 215 .show_cpuinfo = ge_imp3a_show_cpuinfo,
216#ifdef CONFIG_PCI 216#ifdef CONFIG_PCI
217 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 217 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
218 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
218#endif 219#endif
219 .get_irq = mpic_get_irq, 220 .get_irq = mpic_get_irq,
220 .restart = fsl_rstcr_restart, 221 .restart = fsl_rstcr_restart,
diff --git a/arch/powerpc/platforms/85xx/mpc8536_ds.c b/arch/powerpc/platforms/85xx/mpc8536_ds.c
index 15ce4b55f117..a378ba3519e9 100644
--- a/arch/powerpc/platforms/85xx/mpc8536_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc8536_ds.c
@@ -76,6 +76,7 @@ define_machine(mpc8536_ds) {
76 .init_IRQ = mpc8536_ds_pic_init, 76 .init_IRQ = mpc8536_ds_pic_init,
77#ifdef CONFIG_PCI 77#ifdef CONFIG_PCI
78 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 78 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
79 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
79#endif 80#endif
80 .get_irq = mpic_get_irq, 81 .get_irq = mpic_get_irq,
81 .restart = fsl_rstcr_restart, 82 .restart = fsl_rstcr_restart,
diff --git a/arch/powerpc/platforms/85xx/mpc85xx.h b/arch/powerpc/platforms/85xx/mpc85xx.h
index fc51dd4092e5..39056f6befeb 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx.h
+++ b/arch/powerpc/platforms/85xx/mpc85xx.h
@@ -10,8 +10,10 @@ static inline void __init mpc85xx_cpm2_pic_init(void) {}
10 10
11#ifdef CONFIG_QUICC_ENGINE 11#ifdef CONFIG_QUICC_ENGINE
12extern void mpc85xx_qe_init(void); 12extern void mpc85xx_qe_init(void);
13extern void mpc85xx_qe_par_io_init(void);
13#else 14#else
14static inline void __init mpc85xx_qe_init(void) {} 15static inline void __init mpc85xx_qe_init(void) {}
16static inline void __init mpc85xx_qe_par_io_init(void) {}
15#endif 17#endif
16 18
17#endif 19#endif
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 7a31a0e1df29..b0753e222086 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -385,6 +385,7 @@ define_machine(mpc85xx_cds) {
385#ifdef CONFIG_PCI 385#ifdef CONFIG_PCI
386 .restart = mpc85xx_cds_restart, 386 .restart = mpc85xx_cds_restart,
387 .pcibios_fixup_bus = mpc85xx_cds_fixup_bus, 387 .pcibios_fixup_bus = mpc85xx_cds_fixup_bus,
388 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
388#else 389#else
389 .restart = fsl_rstcr_restart, 390 .restart = fsl_rstcr_restart,
390#endif 391#endif
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index 9ebb91ed96a3..ffdf02121a7c 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -209,6 +209,7 @@ define_machine(mpc8544_ds) {
209 .init_IRQ = mpc85xx_ds_pic_init, 209 .init_IRQ = mpc85xx_ds_pic_init,
210#ifdef CONFIG_PCI 210#ifdef CONFIG_PCI
211 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 211 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
212 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
212#endif 213#endif
213 .get_irq = mpic_get_irq, 214 .get_irq = mpic_get_irq,
214 .restart = fsl_rstcr_restart, 215 .restart = fsl_rstcr_restart,
@@ -223,6 +224,7 @@ define_machine(mpc8572_ds) {
223 .init_IRQ = mpc85xx_ds_pic_init, 224 .init_IRQ = mpc85xx_ds_pic_init,
224#ifdef CONFIG_PCI 225#ifdef CONFIG_PCI
225 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 226 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
227 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
226#endif 228#endif
227 .get_irq = mpic_get_irq, 229 .get_irq = mpic_get_irq,
228 .restart = fsl_rstcr_restart, 230 .restart = fsl_rstcr_restart,
@@ -237,6 +239,7 @@ define_machine(p2020_ds) {
237 .init_IRQ = mpc85xx_ds_pic_init, 239 .init_IRQ = mpc85xx_ds_pic_init,
238#ifdef CONFIG_PCI 240#ifdef CONFIG_PCI
239 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 241 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
242 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
240#endif 243#endif
241 .get_irq = mpic_get_irq, 244 .get_irq = mpic_get_irq,
242 .restart = fsl_rstcr_restart, 245 .restart = fsl_rstcr_restart,
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 34f3c5eb3bee..a392e94a07fa 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -239,6 +239,7 @@ static void __init mpc85xx_mds_qe_init(void)
239 struct device_node *np; 239 struct device_node *np;
240 240
241 mpc85xx_qe_init(); 241 mpc85xx_qe_init();
242 mpc85xx_qe_par_io_init();
242 mpc85xx_mds_reset_ucc_phys(); 243 mpc85xx_mds_reset_ucc_phys();
243 244
244 if (machine_is(p1021_mds)) { 245 if (machine_is(p1021_mds)) {
@@ -391,6 +392,7 @@ define_machine(mpc8568_mds) {
391 .progress = udbg_progress, 392 .progress = udbg_progress,
392#ifdef CONFIG_PCI 393#ifdef CONFIG_PCI
393 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 394 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
395 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
394#endif 396#endif
395}; 397};
396 398
@@ -412,6 +414,7 @@ define_machine(mpc8569_mds) {
412 .progress = udbg_progress, 414 .progress = udbg_progress,
413#ifdef CONFIG_PCI 415#ifdef CONFIG_PCI
414 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 416 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
417 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
415#endif 418#endif
416}; 419};
417 420
@@ -434,6 +437,7 @@ define_machine(p1021_mds) {
434 .progress = udbg_progress, 437 .progress = udbg_progress,
435#ifdef CONFIG_PCI 438#ifdef CONFIG_PCI
436 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 439 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
440 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
437#endif 441#endif
438}; 442};
439 443
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
index e15bdd18fdb2..e358bed66d01 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
@@ -86,10 +86,6 @@ void __init mpc85xx_rdb_pic_init(void)
86 */ 86 */
87static void __init mpc85xx_rdb_setup_arch(void) 87static void __init mpc85xx_rdb_setup_arch(void)
88{ 88{
89#ifdef CONFIG_QUICC_ENGINE
90 struct device_node *np;
91#endif
92
93 if (ppc_md.progress) 89 if (ppc_md.progress)
94 ppc_md.progress("mpc85xx_rdb_setup_arch()", 0); 90 ppc_md.progress("mpc85xx_rdb_setup_arch()", 0);
95 91
@@ -99,8 +95,10 @@ static void __init mpc85xx_rdb_setup_arch(void)
99 95
100#ifdef CONFIG_QUICC_ENGINE 96#ifdef CONFIG_QUICC_ENGINE
101 mpc85xx_qe_init(); 97 mpc85xx_qe_init();
98 mpc85xx_qe_par_io_init();
102#if defined(CONFIG_UCC_GETH) || defined(CONFIG_SERIAL_QE) 99#if defined(CONFIG_UCC_GETH) || defined(CONFIG_SERIAL_QE)
103 if (machine_is(p1025_rdb)) { 100 if (machine_is(p1025_rdb)) {
101 struct device_node *np;
104 102
105 struct ccsr_guts __iomem *guts; 103 struct ccsr_guts __iomem *guts;
106 104
@@ -233,6 +231,7 @@ define_machine(p2020_rdb) {
233 .init_IRQ = mpc85xx_rdb_pic_init, 231 .init_IRQ = mpc85xx_rdb_pic_init,
234#ifdef CONFIG_PCI 232#ifdef CONFIG_PCI
235 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 233 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
234 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
236#endif 235#endif
237 .get_irq = mpic_get_irq, 236 .get_irq = mpic_get_irq,
238 .restart = fsl_rstcr_restart, 237 .restart = fsl_rstcr_restart,
@@ -247,6 +246,7 @@ define_machine(p1020_rdb) {
247 .init_IRQ = mpc85xx_rdb_pic_init, 246 .init_IRQ = mpc85xx_rdb_pic_init,
248#ifdef CONFIG_PCI 247#ifdef CONFIG_PCI
249 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 248 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
249 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
250#endif 250#endif
251 .get_irq = mpic_get_irq, 251 .get_irq = mpic_get_irq,
252 .restart = fsl_rstcr_restart, 252 .restart = fsl_rstcr_restart,
@@ -261,6 +261,7 @@ define_machine(p1021_rdb_pc) {
261 .init_IRQ = mpc85xx_rdb_pic_init, 261 .init_IRQ = mpc85xx_rdb_pic_init,
262#ifdef CONFIG_PCI 262#ifdef CONFIG_PCI
263 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 263 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
264 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
264#endif 265#endif
265 .get_irq = mpic_get_irq, 266 .get_irq = mpic_get_irq,
266 .restart = fsl_rstcr_restart, 267 .restart = fsl_rstcr_restart,
@@ -275,6 +276,7 @@ define_machine(p2020_rdb_pc) {
275 .init_IRQ = mpc85xx_rdb_pic_init, 276 .init_IRQ = mpc85xx_rdb_pic_init,
276#ifdef CONFIG_PCI 277#ifdef CONFIG_PCI
277 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 278 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
279 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
278#endif 280#endif
279 .get_irq = mpic_get_irq, 281 .get_irq = mpic_get_irq,
280 .restart = fsl_rstcr_restart, 282 .restart = fsl_rstcr_restart,
@@ -289,6 +291,7 @@ define_machine(p1025_rdb) {
289 .init_IRQ = mpc85xx_rdb_pic_init, 291 .init_IRQ = mpc85xx_rdb_pic_init,
290#ifdef CONFIG_PCI 292#ifdef CONFIG_PCI
291 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 293 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
294 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
292#endif 295#endif
293 .get_irq = mpic_get_irq, 296 .get_irq = mpic_get_irq,
294 .restart = fsl_rstcr_restart, 297 .restart = fsl_rstcr_restart,
@@ -303,6 +306,7 @@ define_machine(p1020_mbg_pc) {
303 .init_IRQ = mpc85xx_rdb_pic_init, 306 .init_IRQ = mpc85xx_rdb_pic_init,
304#ifdef CONFIG_PCI 307#ifdef CONFIG_PCI
305 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 308 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
309 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
306#endif 310#endif
307 .get_irq = mpic_get_irq, 311 .get_irq = mpic_get_irq,
308 .restart = fsl_rstcr_restart, 312 .restart = fsl_rstcr_restart,
@@ -317,6 +321,7 @@ define_machine(p1020_utm_pc) {
317 .init_IRQ = mpc85xx_rdb_pic_init, 321 .init_IRQ = mpc85xx_rdb_pic_init,
318#ifdef CONFIG_PCI 322#ifdef CONFIG_PCI
319 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 323 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
324 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
320#endif 325#endif
321 .get_irq = mpic_get_irq, 326 .get_irq = mpic_get_irq,
322 .restart = fsl_rstcr_restart, 327 .restart = fsl_rstcr_restart,
@@ -331,6 +336,7 @@ define_machine(p1020_rdb_pc) {
331 .init_IRQ = mpc85xx_rdb_pic_init, 336 .init_IRQ = mpc85xx_rdb_pic_init,
332#ifdef CONFIG_PCI 337#ifdef CONFIG_PCI
333 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 338 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
339 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
334#endif 340#endif
335 .get_irq = mpic_get_irq, 341 .get_irq = mpic_get_irq,
336 .restart = fsl_rstcr_restart, 342 .restart = fsl_rstcr_restart,
@@ -345,6 +351,7 @@ define_machine(p1020_rdb_pd) {
345 .init_IRQ = mpc85xx_rdb_pic_init, 351 .init_IRQ = mpc85xx_rdb_pic_init,
346#ifdef CONFIG_PCI 352#ifdef CONFIG_PCI
347 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 353 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
354 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
348#endif 355#endif
349 .get_irq = mpic_get_irq, 356 .get_irq = mpic_get_irq,
350 .restart = fsl_rstcr_restart, 357 .restart = fsl_rstcr_restart,
@@ -359,6 +366,7 @@ define_machine(p1024_rdb) {
359 .init_IRQ = mpc85xx_rdb_pic_init, 366 .init_IRQ = mpc85xx_rdb_pic_init,
360#ifdef CONFIG_PCI 367#ifdef CONFIG_PCI
361 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 368 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
369 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
362#endif 370#endif
363 .get_irq = mpic_get_irq, 371 .get_irq = mpic_get_irq,
364 .restart = fsl_rstcr_restart, 372 .restart = fsl_rstcr_restart,
diff --git a/arch/powerpc/platforms/85xx/p1010rdb.c b/arch/powerpc/platforms/85xx/p1010rdb.c
index d6a3dd311494..ad1a3d438a9e 100644
--- a/arch/powerpc/platforms/85xx/p1010rdb.c
+++ b/arch/powerpc/platforms/85xx/p1010rdb.c
@@ -78,6 +78,7 @@ define_machine(p1010_rdb) {
78 .init_IRQ = p1010_rdb_pic_init, 78 .init_IRQ = p1010_rdb_pic_init,
79#ifdef CONFIG_PCI 79#ifdef CONFIG_PCI
80 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 80 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
81 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
81#endif 82#endif
82 .get_irq = mpic_get_irq, 83 .get_irq = mpic_get_irq,
83 .restart = fsl_rstcr_restart, 84 .restart = fsl_rstcr_restart,
diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c
index e611e79f23ce..6ac986d3f8a3 100644
--- a/arch/powerpc/platforms/85xx/p1022_ds.c
+++ b/arch/powerpc/platforms/85xx/p1022_ds.c
@@ -567,6 +567,7 @@ define_machine(p1022_ds) {
567 .init_IRQ = p1022_ds_pic_init, 567 .init_IRQ = p1022_ds_pic_init,
568#ifdef CONFIG_PCI 568#ifdef CONFIG_PCI
569 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 569 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
570 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
570#endif 571#endif
571 .get_irq = mpic_get_irq, 572 .get_irq = mpic_get_irq,
572 .restart = fsl_rstcr_restart, 573 .restart = fsl_rstcr_restart,
diff --git a/arch/powerpc/platforms/85xx/p1022_rdk.c b/arch/powerpc/platforms/85xx/p1022_rdk.c
index 8c9297112b30..7a180f0308d5 100644
--- a/arch/powerpc/platforms/85xx/p1022_rdk.c
+++ b/arch/powerpc/platforms/85xx/p1022_rdk.c
@@ -147,6 +147,7 @@ define_machine(p1022_rdk) {
147 .init_IRQ = p1022_rdk_pic_init, 147 .init_IRQ = p1022_rdk_pic_init,
148#ifdef CONFIG_PCI 148#ifdef CONFIG_PCI
149 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 149 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
150 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
150#endif 151#endif
151 .get_irq = mpic_get_irq, 152 .get_irq = mpic_get_irq,
152 .restart = fsl_rstcr_restart, 153 .restart = fsl_rstcr_restart,
diff --git a/arch/powerpc/platforms/85xx/p1023_rds.c b/arch/powerpc/platforms/85xx/p1023_rds.c
index 2ae9d490c3d9..0e614007acfb 100644
--- a/arch/powerpc/platforms/85xx/p1023_rds.c
+++ b/arch/powerpc/platforms/85xx/p1023_rds.c
@@ -126,6 +126,7 @@ define_machine(p1023_rds) {
126 .progress = udbg_progress, 126 .progress = udbg_progress,
127#ifdef CONFIG_PCI 127#ifdef CONFIG_PCI
128 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 128 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
129 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
129#endif 130#endif
130}; 131};
131 132
@@ -140,5 +141,6 @@ define_machine(p1023_rdb) {
140 .progress = udbg_progress, 141 .progress = udbg_progress,
141#ifdef CONFIG_PCI 142#ifdef CONFIG_PCI
142 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 143 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
144 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
143#endif 145#endif
144}; 146};
diff --git a/arch/powerpc/platforms/85xx/qemu_e500.c b/arch/powerpc/platforms/85xx/qemu_e500.c
index 5cefc5a9a144..7f2673293549 100644
--- a/arch/powerpc/platforms/85xx/qemu_e500.c
+++ b/arch/powerpc/platforms/85xx/qemu_e500.c
@@ -66,6 +66,7 @@ define_machine(qemu_e500) {
66 .init_IRQ = qemu_e500_pic_init, 66 .init_IRQ = qemu_e500_pic_init,
67#ifdef CONFIG_PCI 67#ifdef CONFIG_PCI
68 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 68 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
69 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
69#endif 70#endif
70 .get_irq = mpic_get_coreint_irq, 71 .get_irq = mpic_get_coreint_irq,
71 .restart = fsl_rstcr_restart, 72 .restart = fsl_rstcr_restart,
diff --git a/arch/powerpc/platforms/85xx/sbc8548.c b/arch/powerpc/platforms/85xx/sbc8548.c
index f62121825914..b07214666d65 100644
--- a/arch/powerpc/platforms/85xx/sbc8548.c
+++ b/arch/powerpc/platforms/85xx/sbc8548.c
@@ -135,6 +135,7 @@ define_machine(sbc8548) {
135 .restart = fsl_rstcr_restart, 135 .restart = fsl_rstcr_restart,
136#ifdef CONFIG_PCI 136#ifdef CONFIG_PCI
137 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 137 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
138 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
138#endif 139#endif
139 .calibrate_decr = generic_calibrate_decr, 140 .calibrate_decr = generic_calibrate_decr,
140 .progress = udbg_progress, 141 .progress = udbg_progress,
diff --git a/arch/powerpc/platforms/85xx/twr_p102x.c b/arch/powerpc/platforms/85xx/twr_p102x.c
index c25ff10f05ee..1eadb6d0dc64 100644
--- a/arch/powerpc/platforms/85xx/twr_p102x.c
+++ b/arch/powerpc/platforms/85xx/twr_p102x.c
@@ -77,6 +77,7 @@ static void __init twr_p1025_setup_arch(void)
77 77
78#ifdef CONFIG_QUICC_ENGINE 78#ifdef CONFIG_QUICC_ENGINE
79 mpc85xx_qe_init(); 79 mpc85xx_qe_init();
80 mpc85xx_qe_par_io_init();
80 81
81#if defined(CONFIG_UCC_GETH) || defined(CONFIG_SERIAL_QE) 82#if defined(CONFIG_UCC_GETH) || defined(CONFIG_SERIAL_QE)
82 if (machine_is(twr_p1025)) { 83 if (machine_is(twr_p1025)) {
diff --git a/arch/powerpc/platforms/85xx/xes_mpc85xx.c b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
index dcbf7e42dce7..1a9c1085855f 100644
--- a/arch/powerpc/platforms/85xx/xes_mpc85xx.c
+++ b/arch/powerpc/platforms/85xx/xes_mpc85xx.c
@@ -170,6 +170,7 @@ define_machine(xes_mpc8572) {
170 .init_IRQ = xes_mpc85xx_pic_init, 170 .init_IRQ = xes_mpc85xx_pic_init,
171#ifdef CONFIG_PCI 171#ifdef CONFIG_PCI
172 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 172 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
173 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
173#endif 174#endif
174 .get_irq = mpic_get_irq, 175 .get_irq = mpic_get_irq,
175 .restart = fsl_rstcr_restart, 176 .restart = fsl_rstcr_restart,
@@ -184,6 +185,7 @@ define_machine(xes_mpc8548) {
184 .init_IRQ = xes_mpc85xx_pic_init, 185 .init_IRQ = xes_mpc85xx_pic_init,
185#ifdef CONFIG_PCI 186#ifdef CONFIG_PCI
186 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 187 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
188 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
187#endif 189#endif
188 .get_irq = mpic_get_irq, 190 .get_irq = mpic_get_irq,
189 .restart = fsl_rstcr_restart, 191 .restart = fsl_rstcr_restart,
@@ -198,6 +200,7 @@ define_machine(xes_mpc8540) {
198 .init_IRQ = xes_mpc85xx_pic_init, 200 .init_IRQ = xes_mpc85xx_pic_init,
199#ifdef CONFIG_PCI 201#ifdef CONFIG_PCI
200 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 202 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
203 .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
201#endif 204#endif
202 .get_irq = mpic_get_irq, 205 .get_irq = mpic_get_irq,
203 .restart = fsl_rstcr_restart, 206 .restart = fsl_rstcr_restart,
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index 434fda39bf8b..d9e2b19b7c8d 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -73,6 +73,7 @@ config PPC_BOOK3S_64
73 select SYS_SUPPORTS_HUGETLBFS 73 select SYS_SUPPORTS_HUGETLBFS
74 select HAVE_ARCH_TRANSPARENT_HUGEPAGE if PPC_64K_PAGES 74 select HAVE_ARCH_TRANSPARENT_HUGEPAGE if PPC_64K_PAGES
75 select ARCH_SUPPORTS_NUMA_BALANCING 75 select ARCH_SUPPORTS_NUMA_BALANCING
76 select IRQ_WORK
76 77
77config PPC_BOOK3E_64 78config PPC_BOOK3E_64
78 bool "Embedded processors" 79 bool "Embedded processors"
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index 2d42f3bb66d6..8a106b4172e0 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -215,7 +215,7 @@ void iic_request_IPIs(void)
215{ 215{
216 iic_request_ipi(PPC_MSG_CALL_FUNCTION); 216 iic_request_ipi(PPC_MSG_CALL_FUNCTION);
217 iic_request_ipi(PPC_MSG_RESCHEDULE); 217 iic_request_ipi(PPC_MSG_RESCHEDULE);
218 iic_request_ipi(PPC_MSG_CALL_FUNC_SINGLE); 218 iic_request_ipi(PPC_MSG_TICK_BROADCAST);
219 iic_request_ipi(PPC_MSG_DEBUGGER_BREAK); 219 iic_request_ipi(PPC_MSG_DEBUGGER_BREAK);
220} 220}
221 221
diff --git a/arch/powerpc/platforms/cell/spu_syscalls.c b/arch/powerpc/platforms/cell/spu_syscalls.c
index 3844f1397fc3..38e0a1a5cec3 100644
--- a/arch/powerpc/platforms/cell/spu_syscalls.c
+++ b/arch/powerpc/platforms/cell/spu_syscalls.c
@@ -170,7 +170,7 @@ EXPORT_SYMBOL_GPL(register_spu_syscalls);
170void unregister_spu_syscalls(struct spufs_calls *calls) 170void unregister_spu_syscalls(struct spufs_calls *calls)
171{ 171{
172 BUG_ON(spufs_calls->owner != calls->owner); 172 BUG_ON(spufs_calls->owner != calls->owner);
173 rcu_assign_pointer(spufs_calls, NULL); 173 RCU_INIT_POINTER(spufs_calls, NULL);
174 synchronize_rcu(); 174 synchronize_rcu();
175} 175}
176EXPORT_SYMBOL_GPL(unregister_spu_syscalls); 176EXPORT_SYMBOL_GPL(unregister_spu_syscalls);
diff --git a/arch/powerpc/platforms/embedded6xx/Kconfig b/arch/powerpc/platforms/embedded6xx/Kconfig
index 6d3c7a9fd047..2a7024d8d8b1 100644
--- a/arch/powerpc/platforms/embedded6xx/Kconfig
+++ b/arch/powerpc/platforms/embedded6xx/Kconfig
@@ -34,7 +34,6 @@ config MPC7448HPC2
34 select TSI108_BRIDGE 34 select TSI108_BRIDGE
35 select DEFAULT_UIMAGE 35 select DEFAULT_UIMAGE
36 select PPC_UDBG_16550 36 select PPC_UDBG_16550
37 select TSI108_BRIDGE
38 help 37 help
39 Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga) 38 Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga)
40 platform 39 platform
@@ -44,19 +43,10 @@ config PPC_HOLLY
44 depends on EMBEDDED6xx 43 depends on EMBEDDED6xx
45 select TSI108_BRIDGE 44 select TSI108_BRIDGE
46 select PPC_UDBG_16550 45 select PPC_UDBG_16550
47 select TSI108_BRIDGE
48 help 46 help
49 Select PPC_HOLLY if configuring for an IBM 750GX/CL Eval 47 Select PPC_HOLLY if configuring for an IBM 750GX/CL Eval
50 Board with TSI108/9 bridge (Hickory/Holly) 48 Board with TSI108/9 bridge (Hickory/Holly)
51 49
52config PPC_PRPMC2800
53 bool "Motorola-PrPMC2800"
54 depends on EMBEDDED6xx
55 select MV64X60
56 select NOT_COHERENT_CACHE
57 help
58 This option enables support for the Motorola PrPMC2800 board
59
60config PPC_C2K 50config PPC_C2K
61 bool "SBS/GEFanuc C2K board" 51 bool "SBS/GEFanuc C2K board"
62 depends on EMBEDDED6xx 52 depends on EMBEDDED6xx
diff --git a/arch/powerpc/platforms/embedded6xx/Makefile b/arch/powerpc/platforms/embedded6xx/Makefile
index cdd48d402b93..f126a2a09981 100644
--- a/arch/powerpc/platforms/embedded6xx/Makefile
+++ b/arch/powerpc/platforms/embedded6xx/Makefile
@@ -5,7 +5,6 @@ obj-$(CONFIG_MPC7448HPC2) += mpc7448_hpc2.o
5obj-$(CONFIG_LINKSTATION) += linkstation.o ls_uart.o 5obj-$(CONFIG_LINKSTATION) += linkstation.o ls_uart.o
6obj-$(CONFIG_STORCENTER) += storcenter.o 6obj-$(CONFIG_STORCENTER) += storcenter.o
7obj-$(CONFIG_PPC_HOLLY) += holly.o 7obj-$(CONFIG_PPC_HOLLY) += holly.o
8obj-$(CONFIG_PPC_PRPMC2800) += prpmc2800.o
9obj-$(CONFIG_PPC_C2K) += c2k.o 8obj-$(CONFIG_PPC_C2K) += c2k.o
10obj-$(CONFIG_USBGECKO_UDBG) += usbgecko_udbg.o 9obj-$(CONFIG_USBGECKO_UDBG) += usbgecko_udbg.o
11obj-$(CONFIG_GAMECUBE_COMMON) += flipper-pic.o 10obj-$(CONFIG_GAMECUBE_COMMON) += flipper-pic.o
diff --git a/arch/powerpc/platforms/embedded6xx/prpmc2800.c b/arch/powerpc/platforms/embedded6xx/prpmc2800.c
deleted file mode 100644
index d455f08bea53..000000000000
--- a/arch/powerpc/platforms/embedded6xx/prpmc2800.c
+++ /dev/null
@@ -1,156 +0,0 @@
1/*
2 * Board setup routines for the Motorola PrPMC2800
3 *
4 * Author: Dale Farnsworth <dale@farnsworth.org>
5 *
6 * 2007 (c) MontaVista, Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#include <linux/stddef.h>
13#include <linux/kernel.h>
14#include <linux/delay.h>
15#include <linux/interrupt.h>
16#include <linux/seq_file.h>
17
18#include <asm/machdep.h>
19#include <asm/prom.h>
20#include <asm/time.h>
21
22#include <mm/mmu_decl.h>
23
24#include <sysdev/mv64x60.h>
25
26#define MV64x60_MPP_CNTL_0 0x0000
27#define MV64x60_MPP_CNTL_2 0x0008
28
29#define MV64x60_GPP_IO_CNTL 0x0000
30#define MV64x60_GPP_LEVEL_CNTL 0x0010
31#define MV64x60_GPP_VALUE_SET 0x0018
32
33#define PLATFORM_NAME_MAX 32
34
35static char prpmc2800_platform_name[PLATFORM_NAME_MAX];
36
37static void __iomem *mv64x60_mpp_reg_base;
38static void __iomem *mv64x60_gpp_reg_base;
39
40static void __init prpmc2800_setup_arch(void)
41{
42 struct device_node *np;
43 phys_addr_t paddr;
44 const unsigned int *reg;
45
46 /*
47 * ioremap mpp and gpp registers in case they are later
48 * needed by prpmc2800_reset_board().
49 */
50 np = of_find_compatible_node(NULL, NULL, "marvell,mv64360-mpp");
51 reg = of_get_property(np, "reg", NULL);
52 paddr = of_translate_address(np, reg);
53 of_node_put(np);
54 mv64x60_mpp_reg_base = ioremap(paddr, reg[1]);
55
56 np = of_find_compatible_node(NULL, NULL, "marvell,mv64360-gpp");
57 reg = of_get_property(np, "reg", NULL);
58 paddr = of_translate_address(np, reg);
59 of_node_put(np);
60 mv64x60_gpp_reg_base = ioremap(paddr, reg[1]);
61
62#ifdef CONFIG_PCI
63 mv64x60_pci_init();
64#endif
65
66 printk("Motorola %s\n", prpmc2800_platform_name);
67}
68
69static void prpmc2800_reset_board(void)
70{
71 u32 temp;
72
73 local_irq_disable();
74
75 temp = in_le32(mv64x60_mpp_reg_base + MV64x60_MPP_CNTL_0);
76 temp &= 0xFFFF0FFF;
77 out_le32(mv64x60_mpp_reg_base + MV64x60_MPP_CNTL_0, temp);
78
79 temp = in_le32(mv64x60_gpp_reg_base + MV64x60_GPP_LEVEL_CNTL);
80 temp |= 0x00000004;
81 out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_LEVEL_CNTL, temp);
82
83 temp = in_le32(mv64x60_gpp_reg_base + MV64x60_GPP_IO_CNTL);
84 temp |= 0x00000004;
85 out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_IO_CNTL, temp);
86
87 temp = in_le32(mv64x60_mpp_reg_base + MV64x60_MPP_CNTL_2);
88 temp &= 0xFFFF0FFF;
89 out_le32(mv64x60_mpp_reg_base + MV64x60_MPP_CNTL_2, temp);
90
91 temp = in_le32(mv64x60_gpp_reg_base + MV64x60_GPP_LEVEL_CNTL);
92 temp |= 0x00080000;
93 out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_LEVEL_CNTL, temp);
94
95 temp = in_le32(mv64x60_gpp_reg_base + MV64x60_GPP_IO_CNTL);
96 temp |= 0x00080000;
97 out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_IO_CNTL, temp);
98
99 out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_VALUE_SET, 0x00080004);
100}
101
102static void prpmc2800_restart(char *cmd)
103{
104 volatile ulong i = 10000000;
105
106 prpmc2800_reset_board();
107
108 while (i-- > 0);
109 panic("restart failed\n");
110}
111
112#ifdef CONFIG_NOT_COHERENT_CACHE
113#define PPRPM2800_COHERENCY_SETTING "off"
114#else
115#define PPRPM2800_COHERENCY_SETTING "on"
116#endif
117
118void prpmc2800_show_cpuinfo(struct seq_file *m)
119{
120 seq_printf(m, "Vendor\t\t: Motorola\n");
121 seq_printf(m, "coherency\t: %s\n", PPRPM2800_COHERENCY_SETTING);
122}
123
124/*
125 * Called very early, device-tree isn't unflattened
126 */
127static int __init prpmc2800_probe(void)
128{
129 unsigned long root = of_get_flat_dt_root();
130 unsigned long len = PLATFORM_NAME_MAX;
131 void *m;
132
133 if (!of_flat_dt_is_compatible(root, "motorola,PrPMC2800"))
134 return 0;
135
136 /* Update ppc_md.name with name from dt */
137 m = of_get_flat_dt_prop(root, "model", &len);
138 if (m)
139 strncpy(prpmc2800_platform_name, m,
140 min((int)len, PLATFORM_NAME_MAX - 1));
141
142 _set_L2CR(_get_L2CR() | L2CR_L2E);
143 return 1;
144}
145
146define_machine(prpmc2800){
147 .name = prpmc2800_platform_name,
148 .probe = prpmc2800_probe,
149 .setup_arch = prpmc2800_setup_arch,
150 .init_early = mv64x60_init_early,
151 .show_cpuinfo = prpmc2800_show_cpuinfo,
152 .init_IRQ = mv64x60_init_irq,
153 .get_irq = mv64x60_get_irq,
154 .restart = prpmc2800_restart,
155 .calibrate_decr = generic_calibrate_decr,
156};
diff --git a/arch/powerpc/platforms/powernv/Kconfig b/arch/powerpc/platforms/powernv/Kconfig
index 895e8a20a3fc..c252ee95bddf 100644
--- a/arch/powerpc/platforms/powernv/Kconfig
+++ b/arch/powerpc/platforms/powernv/Kconfig
@@ -11,6 +11,12 @@ config PPC_POWERNV
11 select PPC_UDBG_16550 11 select PPC_UDBG_16550
12 select PPC_SCOM 12 select PPC_SCOM
13 select ARCH_RANDOM 13 select ARCH_RANDOM
14 select CPU_FREQ
15 select CPU_FREQ_GOV_PERFORMANCE
16 select CPU_FREQ_GOV_POWERSAVE
17 select CPU_FREQ_GOV_USERSPACE
18 select CPU_FREQ_GOV_ONDEMAND
19 select CPU_FREQ_GOV_CONSERVATIVE
14 default y 20 default y
15 21
16config PPC_POWERNV_RTAS 22config PPC_POWERNV_RTAS
diff --git a/arch/powerpc/platforms/powernv/Makefile b/arch/powerpc/platforms/powernv/Makefile
index 8d767fde5a6a..63cebb9b4d45 100644
--- a/arch/powerpc/platforms/powernv/Makefile
+++ b/arch/powerpc/platforms/powernv/Makefile
@@ -1,6 +1,7 @@
1obj-y += setup.o opal-takeover.o opal-wrappers.o opal.o 1obj-y += setup.o opal-takeover.o opal-wrappers.o opal.o opal-async.o
2obj-y += opal-rtc.o opal-nvram.o opal-lpc.o opal-flash.o 2obj-y += opal-rtc.o opal-nvram.o opal-lpc.o opal-flash.o
3obj-y += rng.o 3obj-y += rng.o opal-elog.o opal-dump.o opal-sysparam.o opal-sensor.o
4obj-y += opal-msglog.o
4 5
5obj-$(CONFIG_SMP) += smp.o 6obj-$(CONFIG_SMP) += smp.o
6obj-$(CONFIG_PCI) += pci.o pci-p5ioc2.o pci-ioda.o 7obj-$(CONFIG_PCI) += pci.o pci-p5ioc2.o pci-ioda.o
diff --git a/arch/powerpc/platforms/powernv/opal-async.c b/arch/powerpc/platforms/powernv/opal-async.c
new file mode 100644
index 000000000000..32e2adfa5320
--- /dev/null
+++ b/arch/powerpc/platforms/powernv/opal-async.c
@@ -0,0 +1,204 @@
1/*
2 * PowerNV OPAL asynchronous completion interfaces
3 *
4 * Copyright 2013 IBM Corp.
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#undef DEBUG
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/slab.h>
17#include <linux/sched.h>
18#include <linux/semaphore.h>
19#include <linux/spinlock.h>
20#include <linux/wait.h>
21#include <linux/gfp.h>
22#include <linux/of.h>
23#include <asm/opal.h>
24
25#define N_ASYNC_COMPLETIONS 64
26
27static DECLARE_BITMAP(opal_async_complete_map, N_ASYNC_COMPLETIONS) = {~0UL};
28static DECLARE_BITMAP(opal_async_token_map, N_ASYNC_COMPLETIONS);
29static DECLARE_WAIT_QUEUE_HEAD(opal_async_wait);
30static DEFINE_SPINLOCK(opal_async_comp_lock);
31static struct semaphore opal_async_sem;
32static struct opal_msg *opal_async_responses;
33static unsigned int opal_max_async_tokens;
34
35int __opal_async_get_token(void)
36{
37 unsigned long flags;
38 int token;
39
40 spin_lock_irqsave(&opal_async_comp_lock, flags);
41 token = find_first_bit(opal_async_complete_map, opal_max_async_tokens);
42 if (token >= opal_max_async_tokens) {
43 token = -EBUSY;
44 goto out;
45 }
46
47 if (__test_and_set_bit(token, opal_async_token_map)) {
48 token = -EBUSY;
49 goto out;
50 }
51
52 __clear_bit(token, opal_async_complete_map);
53
54out:
55 spin_unlock_irqrestore(&opal_async_comp_lock, flags);
56 return token;
57}
58
59int opal_async_get_token_interruptible(void)
60{
61 int token;
62
63 /* Wait until a token is available */
64 if (down_interruptible(&opal_async_sem))
65 return -ERESTARTSYS;
66
67 token = __opal_async_get_token();
68 if (token < 0)
69 up(&opal_async_sem);
70
71 return token;
72}
73
74int __opal_async_release_token(int token)
75{
76 unsigned long flags;
77
78 if (token < 0 || token >= opal_max_async_tokens) {
79 pr_err("%s: Passed token is out of range, token %d\n",
80 __func__, token);
81 return -EINVAL;
82 }
83
84 spin_lock_irqsave(&opal_async_comp_lock, flags);
85 __set_bit(token, opal_async_complete_map);
86 __clear_bit(token, opal_async_token_map);
87 spin_unlock_irqrestore(&opal_async_comp_lock, flags);
88
89 return 0;
90}
91
92int opal_async_release_token(int token)
93{
94 int ret;
95
96 ret = __opal_async_release_token(token);
97 if (ret)
98 return ret;
99
100 up(&opal_async_sem);
101
102 return 0;
103}
104
105int opal_async_wait_response(uint64_t token, struct opal_msg *msg)
106{
107 if (token >= opal_max_async_tokens) {
108 pr_err("%s: Invalid token passed\n", __func__);
109 return -EINVAL;
110 }
111
112 if (!msg) {
113 pr_err("%s: Invalid message pointer passed\n", __func__);
114 return -EINVAL;
115 }
116
117 wait_event(opal_async_wait, test_bit(token, opal_async_complete_map));
118 memcpy(msg, &opal_async_responses[token], sizeof(*msg));
119
120 return 0;
121}
122
123static int opal_async_comp_event(struct notifier_block *nb,
124 unsigned long msg_type, void *msg)
125{
126 struct opal_msg *comp_msg = msg;
127 unsigned long flags;
128 uint64_t token;
129
130 if (msg_type != OPAL_MSG_ASYNC_COMP)
131 return 0;
132
133 token = be64_to_cpu(comp_msg->params[0]);
134 memcpy(&opal_async_responses[token], comp_msg, sizeof(*comp_msg));
135 spin_lock_irqsave(&opal_async_comp_lock, flags);
136 __set_bit(token, opal_async_complete_map);
137 spin_unlock_irqrestore(&opal_async_comp_lock, flags);
138
139 wake_up(&opal_async_wait);
140
141 return 0;
142}
143
144static struct notifier_block opal_async_comp_nb = {
145 .notifier_call = opal_async_comp_event,
146 .next = NULL,
147 .priority = 0,
148};
149
150static int __init opal_async_comp_init(void)
151{
152 struct device_node *opal_node;
153 const __be32 *async;
154 int err;
155
156 opal_node = of_find_node_by_path("/ibm,opal");
157 if (!opal_node) {
158 pr_err("%s: Opal node not found\n", __func__);
159 err = -ENOENT;
160 goto out;
161 }
162
163 async = of_get_property(opal_node, "opal-msg-async-num", NULL);
164 if (!async) {
165 pr_err("%s: %s has no opal-msg-async-num\n",
166 __func__, opal_node->full_name);
167 err = -ENOENT;
168 goto out_opal_node;
169 }
170
171 opal_max_async_tokens = be32_to_cpup(async);
172 if (opal_max_async_tokens > N_ASYNC_COMPLETIONS)
173 opal_max_async_tokens = N_ASYNC_COMPLETIONS;
174
175 err = opal_message_notifier_register(OPAL_MSG_ASYNC_COMP,
176 &opal_async_comp_nb);
177 if (err) {
178 pr_err("%s: Can't register OPAL event notifier (%d)\n",
179 __func__, err);
180 goto out_opal_node;
181 }
182
183 opal_async_responses = kzalloc(
184 sizeof(*opal_async_responses) * opal_max_async_tokens,
185 GFP_KERNEL);
186 if (!opal_async_responses) {
187 pr_err("%s: Out of memory, failed to do asynchronous "
188 "completion init\n", __func__);
189 err = -ENOMEM;
190 goto out_opal_node;
191 }
192
193 /* Initialize to 1 less than the maximum tokens available, as we may
194 * require to pop one during emergency through synchronous call to
195 * __opal_async_get_token()
196 */
197 sema_init(&opal_async_sem, opal_max_async_tokens - 1);
198
199out_opal_node:
200 of_node_put(opal_node);
201out:
202 return err;
203}
204subsys_initcall(opal_async_comp_init);
diff --git a/arch/powerpc/platforms/powernv/opal-dump.c b/arch/powerpc/platforms/powernv/opal-dump.c
new file mode 100644
index 000000000000..b9827b0d87e4
--- /dev/null
+++ b/arch/powerpc/platforms/powernv/opal-dump.c
@@ -0,0 +1,520 @@
1/*
2 * PowerNV OPAL Dump Interface
3 *
4 * Copyright 2013,2014 IBM Corp.
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/kobject.h>
13#include <linux/mm.h>
14#include <linux/slab.h>
15#include <linux/vmalloc.h>
16#include <linux/pagemap.h>
17#include <linux/delay.h>
18
19#include <asm/opal.h>
20
21#define DUMP_TYPE_FSP 0x01
22
23struct dump_obj {
24 struct kobject kobj;
25 struct bin_attribute dump_attr;
26 uint32_t id; /* becomes object name */
27 uint32_t type;
28 uint32_t size;
29 char *buffer;
30};
31#define to_dump_obj(x) container_of(x, struct dump_obj, kobj)
32
33struct dump_attribute {
34 struct attribute attr;
35 ssize_t (*show)(struct dump_obj *dump, struct dump_attribute *attr,
36 char *buf);
37 ssize_t (*store)(struct dump_obj *dump, struct dump_attribute *attr,
38 const char *buf, size_t count);
39};
40#define to_dump_attr(x) container_of(x, struct dump_attribute, attr)
41
42static ssize_t dump_id_show(struct dump_obj *dump_obj,
43 struct dump_attribute *attr,
44 char *buf)
45{
46 return sprintf(buf, "0x%x\n", dump_obj->id);
47}
48
49static const char* dump_type_to_string(uint32_t type)
50{
51 switch (type) {
52 case 0x01: return "SP Dump";
53 case 0x02: return "System/Platform Dump";
54 case 0x03: return "SMA Dump";
55 default: return "unknown";
56 }
57}
58
59static ssize_t dump_type_show(struct dump_obj *dump_obj,
60 struct dump_attribute *attr,
61 char *buf)
62{
63
64 return sprintf(buf, "0x%x %s\n", dump_obj->type,
65 dump_type_to_string(dump_obj->type));
66}
67
68static ssize_t dump_ack_show(struct dump_obj *dump_obj,
69 struct dump_attribute *attr,
70 char *buf)
71{
72 return sprintf(buf, "ack - acknowledge dump\n");
73}
74
75/*
76 * Send acknowledgement to OPAL
77 */
78static int64_t dump_send_ack(uint32_t dump_id)
79{
80 int rc;
81
82 rc = opal_dump_ack(dump_id);
83 if (rc)
84 pr_warn("%s: Failed to send ack to Dump ID 0x%x (%d)\n",
85 __func__, dump_id, rc);
86 return rc;
87}
88
89static ssize_t dump_ack_store(struct dump_obj *dump_obj,
90 struct dump_attribute *attr,
91 const char *buf,
92 size_t count)
93{
94 dump_send_ack(dump_obj->id);
95 sysfs_remove_file_self(&dump_obj->kobj, &attr->attr);
96 kobject_put(&dump_obj->kobj);
97 return count;
98}
99
100/* Attributes of a dump
101 * The binary attribute of the dump itself is dynamic
102 * due to the dynamic size of the dump
103 */
104static struct dump_attribute id_attribute =
105 __ATTR(id, 0666, dump_id_show, NULL);
106static struct dump_attribute type_attribute =
107 __ATTR(type, 0666, dump_type_show, NULL);
108static struct dump_attribute ack_attribute =
109 __ATTR(acknowledge, 0660, dump_ack_show, dump_ack_store);
110
111static ssize_t init_dump_show(struct dump_obj *dump_obj,
112 struct dump_attribute *attr,
113 char *buf)
114{
115 return sprintf(buf, "1 - initiate dump\n");
116}
117
118static int64_t dump_fips_init(uint8_t type)
119{
120 int rc;
121
122 rc = opal_dump_init(type);
123 if (rc)
124 pr_warn("%s: Failed to initiate FipS dump (%d)\n",
125 __func__, rc);
126 return rc;
127}
128
129static ssize_t init_dump_store(struct dump_obj *dump_obj,
130 struct dump_attribute *attr,
131 const char *buf,
132 size_t count)
133{
134 dump_fips_init(DUMP_TYPE_FSP);
135 pr_info("%s: Initiated FSP dump\n", __func__);
136 return count;
137}
138
139static struct dump_attribute initiate_attribute =
140 __ATTR(initiate_dump, 0600, init_dump_show, init_dump_store);
141
142static struct attribute *initiate_attrs[] = {
143 &initiate_attribute.attr,
144 NULL,
145};
146
147static struct attribute_group initiate_attr_group = {
148 .attrs = initiate_attrs,
149};
150
151static struct kset *dump_kset;
152
153static ssize_t dump_attr_show(struct kobject *kobj,
154 struct attribute *attr,
155 char *buf)
156{
157 struct dump_attribute *attribute;
158 struct dump_obj *dump;
159
160 attribute = to_dump_attr(attr);
161 dump = to_dump_obj(kobj);
162
163 if (!attribute->show)
164 return -EIO;
165
166 return attribute->show(dump, attribute, buf);
167}
168
169static ssize_t dump_attr_store(struct kobject *kobj,
170 struct attribute *attr,
171 const char *buf, size_t len)
172{
173 struct dump_attribute *attribute;
174 struct dump_obj *dump;
175
176 attribute = to_dump_attr(attr);
177 dump = to_dump_obj(kobj);
178
179 if (!attribute->store)
180 return -EIO;
181
182 return attribute->store(dump, attribute, buf, len);
183}
184
185static const struct sysfs_ops dump_sysfs_ops = {
186 .show = dump_attr_show,
187 .store = dump_attr_store,
188};
189
190static void dump_release(struct kobject *kobj)
191{
192 struct dump_obj *dump;
193
194 dump = to_dump_obj(kobj);
195 vfree(dump->buffer);
196 kfree(dump);
197}
198
199static struct attribute *dump_default_attrs[] = {
200 &id_attribute.attr,
201 &type_attribute.attr,
202 &ack_attribute.attr,
203 NULL,
204};
205
206static struct kobj_type dump_ktype = {
207 .sysfs_ops = &dump_sysfs_ops,
208 .release = &dump_release,
209 .default_attrs = dump_default_attrs,
210};
211
212static void free_dump_sg_list(struct opal_sg_list *list)
213{
214 struct opal_sg_list *sg1;
215 while (list) {
216 sg1 = list->next;
217 kfree(list);
218 list = sg1;
219 }
220 list = NULL;
221}
222
223static struct opal_sg_list *dump_data_to_sglist(struct dump_obj *dump)
224{
225 struct opal_sg_list *sg1, *list = NULL;
226 void *addr;
227 int64_t size;
228
229 addr = dump->buffer;
230 size = dump->size;
231
232 sg1 = kzalloc(PAGE_SIZE, GFP_KERNEL);
233 if (!sg1)
234 goto nomem;
235
236 list = sg1;
237 sg1->num_entries = 0;
238 while (size > 0) {
239 /* Translate virtual address to physical address */
240 sg1->entry[sg1->num_entries].data =
241 (void *)(vmalloc_to_pfn(addr) << PAGE_SHIFT);
242
243 if (size > PAGE_SIZE)
244 sg1->entry[sg1->num_entries].length = PAGE_SIZE;
245 else
246 sg1->entry[sg1->num_entries].length = size;
247
248 sg1->num_entries++;
249 if (sg1->num_entries >= SG_ENTRIES_PER_NODE) {
250 sg1->next = kzalloc(PAGE_SIZE, GFP_KERNEL);
251 if (!sg1->next)
252 goto nomem;
253
254 sg1 = sg1->next;
255 sg1->num_entries = 0;
256 }
257 addr += PAGE_SIZE;
258 size -= PAGE_SIZE;
259 }
260 return list;
261
262nomem:
263 pr_err("%s : Failed to allocate memory\n", __func__);
264 free_dump_sg_list(list);
265 return NULL;
266}
267
268static void sglist_to_phy_addr(struct opal_sg_list *list)
269{
270 struct opal_sg_list *sg, *next;
271
272 for (sg = list; sg; sg = next) {
273 next = sg->next;
274 /* Don't translate NULL pointer for last entry */
275 if (sg->next)
276 sg->next = (struct opal_sg_list *)__pa(sg->next);
277 else
278 sg->next = NULL;
279
280 /* Convert num_entries to length */
281 sg->num_entries =
282 sg->num_entries * sizeof(struct opal_sg_entry) + 16;
283 }
284}
285
286static int64_t dump_read_info(uint32_t *id, uint32_t *size, uint32_t *type)
287{
288 int rc;
289 *type = 0xffffffff;
290
291 rc = opal_dump_info2(id, size, type);
292
293 if (rc == OPAL_PARAMETER)
294 rc = opal_dump_info(id, size);
295
296 if (rc)
297 pr_warn("%s: Failed to get dump info (%d)\n",
298 __func__, rc);
299 return rc;
300}
301
302static int64_t dump_read_data(struct dump_obj *dump)
303{
304 struct opal_sg_list *list;
305 uint64_t addr;
306 int64_t rc;
307
308 /* Allocate memory */
309 dump->buffer = vzalloc(PAGE_ALIGN(dump->size));
310 if (!dump->buffer) {
311 pr_err("%s : Failed to allocate memory\n", __func__);
312 rc = -ENOMEM;
313 goto out;
314 }
315
316 /* Generate SG list */
317 list = dump_data_to_sglist(dump);
318 if (!list) {
319 rc = -ENOMEM;
320 goto out;
321 }
322
323 /* Translate sg list addr to real address */
324 sglist_to_phy_addr(list);
325
326 /* First entry address */
327 addr = __pa(list);
328
329 /* Fetch data */
330 rc = OPAL_BUSY_EVENT;
331 while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) {
332 rc = opal_dump_read(dump->id, addr);
333 if (rc == OPAL_BUSY_EVENT) {
334 opal_poll_events(NULL);
335 msleep(20);
336 }
337 }
338
339 if (rc != OPAL_SUCCESS && rc != OPAL_PARTIAL)
340 pr_warn("%s: Extract dump failed for ID 0x%x\n",
341 __func__, dump->id);
342
343 /* Free SG list */
344 free_dump_sg_list(list);
345
346out:
347 return rc;
348}
349
350static ssize_t dump_attr_read(struct file *filep, struct kobject *kobj,
351 struct bin_attribute *bin_attr,
352 char *buffer, loff_t pos, size_t count)
353{
354 ssize_t rc;
355
356 struct dump_obj *dump = to_dump_obj(kobj);
357
358 if (!dump->buffer) {
359 rc = dump_read_data(dump);
360
361 if (rc != OPAL_SUCCESS && rc != OPAL_PARTIAL) {
362 vfree(dump->buffer);
363 dump->buffer = NULL;
364
365 return -EIO;
366 }
367 if (rc == OPAL_PARTIAL) {
368 /* On a partial read, we just return EIO
369 * and rely on userspace to ask us to try
370 * again.
371 */
372 pr_info("%s: Platform dump partially read.ID = 0x%x\n",
373 __func__, dump->id);
374 return -EIO;
375 }
376 }
377
378 memcpy(buffer, dump->buffer + pos, count);
379
380 /* You may think we could free the dump buffer now and retrieve
381 * it again later if needed, but due to current firmware limitation,
382 * that's not the case. So, once read into userspace once,
383 * we keep the dump around until it's acknowledged by userspace.
384 */
385
386 return count;
387}
388
389static struct dump_obj *create_dump_obj(uint32_t id, size_t size,
390 uint32_t type)
391{
392 struct dump_obj *dump;
393 int rc;
394
395 dump = kzalloc(sizeof(*dump), GFP_KERNEL);
396 if (!dump)
397 return NULL;
398
399 dump->kobj.kset = dump_kset;
400
401 kobject_init(&dump->kobj, &dump_ktype);
402
403 sysfs_bin_attr_init(&dump->dump_attr);
404
405 dump->dump_attr.attr.name = "dump";
406 dump->dump_attr.attr.mode = 0400;
407 dump->dump_attr.size = size;
408 dump->dump_attr.read = dump_attr_read;
409
410 dump->id = id;
411 dump->size = size;
412 dump->type = type;
413
414 rc = kobject_add(&dump->kobj, NULL, "0x%x-0x%x", type, id);
415 if (rc) {
416 kobject_put(&dump->kobj);
417 return NULL;
418 }
419
420 rc = sysfs_create_bin_file(&dump->kobj, &dump->dump_attr);
421 if (rc) {
422 kobject_put(&dump->kobj);
423 return NULL;
424 }
425
426 pr_info("%s: New platform dump. ID = 0x%x Size %u\n",
427 __func__, dump->id, dump->size);
428
429 kobject_uevent(&dump->kobj, KOBJ_ADD);
430
431 return dump;
432}
433
434static int process_dump(void)
435{
436 int rc;
437 uint32_t dump_id, dump_size, dump_type;
438 struct dump_obj *dump;
439 char name[22];
440
441 rc = dump_read_info(&dump_id, &dump_size, &dump_type);
442 if (rc != OPAL_SUCCESS)
443 return rc;
444
445 sprintf(name, "0x%x-0x%x", dump_type, dump_id);
446
447 /* we may get notified twice, let's handle
448 * that gracefully and not create two conflicting
449 * entries.
450 */
451 if (kset_find_obj(dump_kset, name))
452 return 0;
453
454 dump = create_dump_obj(dump_id, dump_size, dump_type);
455 if (!dump)
456 return -1;
457
458 return 0;
459}
460
461static void dump_work_fn(struct work_struct *work)
462{
463 process_dump();
464}
465
466static DECLARE_WORK(dump_work, dump_work_fn);
467
468static void schedule_process_dump(void)
469{
470 schedule_work(&dump_work);
471}
472
473/*
474 * New dump available notification
475 *
476 * Once we get notification, we add sysfs entries for it.
477 * We only fetch the dump on demand, and create sysfs asynchronously.
478 */
479static int dump_event(struct notifier_block *nb,
480 unsigned long events, void *change)
481{
482 if (events & OPAL_EVENT_DUMP_AVAIL)
483 schedule_process_dump();
484
485 return 0;
486}
487
488static struct notifier_block dump_nb = {
489 .notifier_call = dump_event,
490 .next = NULL,
491 .priority = 0
492};
493
494void __init opal_platform_dump_init(void)
495{
496 int rc;
497
498 dump_kset = kset_create_and_add("dump", NULL, opal_kobj);
499 if (!dump_kset) {
500 pr_warn("%s: Failed to create dump kset\n", __func__);
501 return;
502 }
503
504 rc = sysfs_create_group(&dump_kset->kobj, &initiate_attr_group);
505 if (rc) {
506 pr_warn("%s: Failed to create initiate dump attr group\n",
507 __func__);
508 kobject_put(&dump_kset->kobj);
509 return;
510 }
511
512 rc = opal_notifier_register(&dump_nb);
513 if (rc) {
514 pr_warn("%s: Can't register OPAL event notifier (%d)\n",
515 __func__, rc);
516 return;
517 }
518
519 opal_dump_resend_notification();
520}
diff --git a/arch/powerpc/platforms/powernv/opal-elog.c b/arch/powerpc/platforms/powernv/opal-elog.c
new file mode 100644
index 000000000000..ef7bc2a97862
--- /dev/null
+++ b/arch/powerpc/platforms/powernv/opal-elog.c
@@ -0,0 +1,308 @@
1/*
2 * Error log support on PowerNV.
3 *
4 * Copyright 2013,2014 IBM Corp.
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#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/of.h>
14#include <linux/slab.h>
15#include <linux/sysfs.h>
16#include <linux/fs.h>
17#include <linux/vmalloc.h>
18#include <linux/fcntl.h>
19#include <linux/kobject.h>
20#include <asm/uaccess.h>
21#include <asm/opal.h>
22
23struct elog_obj {
24 struct kobject kobj;
25 struct bin_attribute raw_attr;
26 uint64_t id;
27 uint64_t type;
28 size_t size;
29 char *buffer;
30};
31#define to_elog_obj(x) container_of(x, struct elog_obj, kobj)
32
33struct elog_attribute {
34 struct attribute attr;
35 ssize_t (*show)(struct elog_obj *elog, struct elog_attribute *attr,
36 char *buf);
37 ssize_t (*store)(struct elog_obj *elog, struct elog_attribute *attr,
38 const char *buf, size_t count);
39};
40#define to_elog_attr(x) container_of(x, struct elog_attribute, attr)
41
42static ssize_t elog_id_show(struct elog_obj *elog_obj,
43 struct elog_attribute *attr,
44 char *buf)
45{
46 return sprintf(buf, "0x%llx\n", elog_obj->id);
47}
48
49static const char *elog_type_to_string(uint64_t type)
50{
51 switch (type) {
52 case 0: return "PEL";
53 default: return "unknown";
54 }
55}
56
57static ssize_t elog_type_show(struct elog_obj *elog_obj,
58 struct elog_attribute *attr,
59 char *buf)
60{
61 return sprintf(buf, "0x%llx %s\n",
62 elog_obj->type,
63 elog_type_to_string(elog_obj->type));
64}
65
66static ssize_t elog_ack_show(struct elog_obj *elog_obj,
67 struct elog_attribute *attr,
68 char *buf)
69{
70 return sprintf(buf, "ack - acknowledge log message\n");
71}
72
73static ssize_t elog_ack_store(struct elog_obj *elog_obj,
74 struct elog_attribute *attr,
75 const char *buf,
76 size_t count)
77{
78 opal_send_ack_elog(elog_obj->id);
79 sysfs_remove_file_self(&elog_obj->kobj, &attr->attr);
80 kobject_put(&elog_obj->kobj);
81 return count;
82}
83
84static struct elog_attribute id_attribute =
85 __ATTR(id, 0666, elog_id_show, NULL);
86static struct elog_attribute type_attribute =
87 __ATTR(type, 0666, elog_type_show, NULL);
88static struct elog_attribute ack_attribute =
89 __ATTR(acknowledge, 0660, elog_ack_show, elog_ack_store);
90
91static struct kset *elog_kset;
92
93static ssize_t elog_attr_show(struct kobject *kobj,
94 struct attribute *attr,
95 char *buf)
96{
97 struct elog_attribute *attribute;
98 struct elog_obj *elog;
99
100 attribute = to_elog_attr(attr);
101 elog = to_elog_obj(kobj);
102
103 if (!attribute->show)
104 return -EIO;
105
106 return attribute->show(elog, attribute, buf);
107}
108
109static ssize_t elog_attr_store(struct kobject *kobj,
110 struct attribute *attr,
111 const char *buf, size_t len)
112{
113 struct elog_attribute *attribute;
114 struct elog_obj *elog;
115
116 attribute = to_elog_attr(attr);
117 elog = to_elog_obj(kobj);
118
119 if (!attribute->store)
120 return -EIO;
121
122 return attribute->store(elog, attribute, buf, len);
123}
124
125static const struct sysfs_ops elog_sysfs_ops = {
126 .show = elog_attr_show,
127 .store = elog_attr_store,
128};
129
130static void elog_release(struct kobject *kobj)
131{
132 struct elog_obj *elog;
133
134 elog = to_elog_obj(kobj);
135 kfree(elog->buffer);
136 kfree(elog);
137}
138
139static struct attribute *elog_default_attrs[] = {
140 &id_attribute.attr,
141 &type_attribute.attr,
142 &ack_attribute.attr,
143 NULL,
144};
145
146static struct kobj_type elog_ktype = {
147 .sysfs_ops = &elog_sysfs_ops,
148 .release = &elog_release,
149 .default_attrs = elog_default_attrs,
150};
151
152/* Maximum size of a single log on FSP is 16KB */
153#define OPAL_MAX_ERRLOG_SIZE 16384
154
155static ssize_t raw_attr_read(struct file *filep, struct kobject *kobj,
156 struct bin_attribute *bin_attr,
157 char *buffer, loff_t pos, size_t count)
158{
159 int opal_rc;
160
161 struct elog_obj *elog = to_elog_obj(kobj);
162
163 /* We may have had an error reading before, so let's retry */
164 if (!elog->buffer) {
165 elog->buffer = kzalloc(elog->size, GFP_KERNEL);
166 if (!elog->buffer)
167 return -EIO;
168
169 opal_rc = opal_read_elog(__pa(elog->buffer),
170 elog->size, elog->id);
171 if (opal_rc != OPAL_SUCCESS) {
172 pr_err("ELOG: log read failed for log-id=%llx\n",
173 elog->id);
174 kfree(elog->buffer);
175 elog->buffer = NULL;
176 return -EIO;
177 }
178 }
179
180 memcpy(buffer, elog->buffer + pos, count);
181
182 return count;
183}
184
185static struct elog_obj *create_elog_obj(uint64_t id, size_t size, uint64_t type)
186{
187 struct elog_obj *elog;
188 int rc;
189
190 elog = kzalloc(sizeof(*elog), GFP_KERNEL);
191 if (!elog)
192 return NULL;
193
194 elog->kobj.kset = elog_kset;
195
196 kobject_init(&elog->kobj, &elog_ktype);
197
198 sysfs_bin_attr_init(&elog->raw_attr);
199
200 elog->raw_attr.attr.name = "raw";
201 elog->raw_attr.attr.mode = 0400;
202 elog->raw_attr.size = size;
203 elog->raw_attr.read = raw_attr_read;
204
205 elog->id = id;
206 elog->size = size;
207 elog->type = type;
208
209 elog->buffer = kzalloc(elog->size, GFP_KERNEL);
210
211 if (elog->buffer) {
212 rc = opal_read_elog(__pa(elog->buffer),
213 elog->size, elog->id);
214 if (rc != OPAL_SUCCESS) {
215 pr_err("ELOG: log read failed for log-id=%llx\n",
216 elog->id);
217 kfree(elog->buffer);
218 elog->buffer = NULL;
219 }
220 }
221
222 rc = kobject_add(&elog->kobj, NULL, "0x%llx", id);
223 if (rc) {
224 kobject_put(&elog->kobj);
225 return NULL;
226 }
227
228 rc = sysfs_create_bin_file(&elog->kobj, &elog->raw_attr);
229 if (rc) {
230 kobject_put(&elog->kobj);
231 return NULL;
232 }
233
234 kobject_uevent(&elog->kobj, KOBJ_ADD);
235
236 return elog;
237}
238
239static void elog_work_fn(struct work_struct *work)
240{
241 size_t elog_size;
242 uint64_t log_id;
243 uint64_t elog_type;
244 int rc;
245 char name[2+16+1];
246
247 rc = opal_get_elog_size(&log_id, &elog_size, &elog_type);
248 if (rc != OPAL_SUCCESS) {
249 pr_err("ELOG: Opal log read failed\n");
250 return;
251 }
252
253 BUG_ON(elog_size > OPAL_MAX_ERRLOG_SIZE);
254
255 if (elog_size >= OPAL_MAX_ERRLOG_SIZE)
256 elog_size = OPAL_MAX_ERRLOG_SIZE;
257
258 sprintf(name, "0x%llx", log_id);
259
260 /* we may get notified twice, let's handle
261 * that gracefully and not create two conflicting
262 * entries.
263 */
264 if (kset_find_obj(elog_kset, name))
265 return;
266
267 create_elog_obj(log_id, elog_size, elog_type);
268}
269
270static DECLARE_WORK(elog_work, elog_work_fn);
271
272static int elog_event(struct notifier_block *nb,
273 unsigned long events, void *change)
274{
275 /* check for error log event */
276 if (events & OPAL_EVENT_ERROR_LOG_AVAIL)
277 schedule_work(&elog_work);
278 return 0;
279}
280
281static struct notifier_block elog_nb = {
282 .notifier_call = elog_event,
283 .next = NULL,
284 .priority = 0
285};
286
287int __init opal_elog_init(void)
288{
289 int rc = 0;
290
291 elog_kset = kset_create_and_add("elog", NULL, opal_kobj);
292 if (!elog_kset) {
293 pr_warn("%s: failed to create elog kset\n", __func__);
294 return -1;
295 }
296
297 rc = opal_notifier_register(&elog_nb);
298 if (rc) {
299 pr_err("%s: Can't register OPAL event notifier (%d)\n",
300 __func__, rc);
301 return rc;
302 }
303
304 /* We are now ready to pull error logs from opal. */
305 opal_resend_pending_logs();
306
307 return 0;
308}
diff --git a/arch/powerpc/platforms/powernv/opal-msglog.c b/arch/powerpc/platforms/powernv/opal-msglog.c
new file mode 100644
index 000000000000..1bb25b952504
--- /dev/null
+++ b/arch/powerpc/platforms/powernv/opal-msglog.c
@@ -0,0 +1,120 @@
1/*
2 * PowerNV OPAL in-memory console interface
3 *
4 * Copyright 2014 IBM Corp.
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 <asm/io.h>
13#include <asm/opal.h>
14#include <linux/debugfs.h>
15#include <linux/of.h>
16#include <linux/types.h>
17#include <asm/barrier.h>
18
19/* OPAL in-memory console. Defined in OPAL source at core/console.c */
20struct memcons {
21 __be64 magic;
22#define MEMCONS_MAGIC 0x6630696567726173L
23 __be64 obuf_phys;
24 __be64 ibuf_phys;
25 __be32 obuf_size;
26 __be32 ibuf_size;
27 __be32 out_pos;
28#define MEMCONS_OUT_POS_WRAP 0x80000000u
29#define MEMCONS_OUT_POS_MASK 0x00ffffffu
30 __be32 in_prod;
31 __be32 in_cons;
32};
33
34static ssize_t opal_msglog_read(struct file *file, struct kobject *kobj,
35 struct bin_attribute *bin_attr, char *to,
36 loff_t pos, size_t count)
37{
38 struct memcons *mc = bin_attr->private;
39 const char *conbuf;
40 size_t ret, first_read = 0;
41 uint32_t out_pos, avail;
42
43 if (!mc)
44 return -ENODEV;
45
46 out_pos = be32_to_cpu(ACCESS_ONCE(mc->out_pos));
47
48 /* Now we've read out_pos, put a barrier in before reading the new
49 * data it points to in conbuf. */
50 smp_rmb();
51
52 conbuf = phys_to_virt(be64_to_cpu(mc->obuf_phys));
53
54 /* When the buffer has wrapped, read from the out_pos marker to the end
55 * of the buffer, and then read the remaining data as in the un-wrapped
56 * case. */
57 if (out_pos & MEMCONS_OUT_POS_WRAP) {
58
59 out_pos &= MEMCONS_OUT_POS_MASK;
60 avail = be32_to_cpu(mc->obuf_size) - out_pos;
61
62 ret = memory_read_from_buffer(to, count, &pos,
63 conbuf + out_pos, avail);
64
65 if (ret < 0)
66 goto out;
67
68 first_read = ret;
69 to += first_read;
70 count -= first_read;
71 pos -= avail;
72 }
73
74 /* Sanity check. The firmware should not do this to us. */
75 if (out_pos > be32_to_cpu(mc->obuf_size)) {
76 pr_err("OPAL: memory console corruption. Aborting read.\n");
77 return -EINVAL;
78 }
79
80 ret = memory_read_from_buffer(to, count, &pos, conbuf, out_pos);
81
82 if (ret < 0)
83 goto out;
84
85 ret += first_read;
86out:
87 return ret;
88}
89
90static struct bin_attribute opal_msglog_attr = {
91 .attr = {.name = "msglog", .mode = 0444},
92 .read = opal_msglog_read
93};
94
95void __init opal_msglog_init(void)
96{
97 u64 mcaddr;
98 struct memcons *mc;
99
100 if (of_property_read_u64(opal_node, "ibm,opal-memcons", &mcaddr)) {
101 pr_warn("OPAL: Property ibm,opal-memcons not found, no message log\n");
102 return;
103 }
104
105 mc = phys_to_virt(mcaddr);
106 if (!mc) {
107 pr_warn("OPAL: memory console address is invalid\n");
108 return;
109 }
110
111 if (be64_to_cpu(mc->magic) != MEMCONS_MAGIC) {
112 pr_warn("OPAL: memory console version is invalid\n");
113 return;
114 }
115
116 opal_msglog_attr.private = mc;
117
118 if (sysfs_create_bin_file(opal_kobj, &opal_msglog_attr) != 0)
119 pr_warn("OPAL: sysfs file creation failed\n");
120}
diff --git a/arch/powerpc/platforms/powernv/opal-sensor.c b/arch/powerpc/platforms/powernv/opal-sensor.c
new file mode 100644
index 000000000000..10271ad1fac4
--- /dev/null
+++ b/arch/powerpc/platforms/powernv/opal-sensor.c
@@ -0,0 +1,66 @@
1/*
2 * PowerNV sensor code
3 *
4 * Copyright (C) 2013 IBM
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 * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/delay.h>
22#include <linux/mutex.h>
23#include <asm/opal.h>
24
25static DEFINE_MUTEX(opal_sensor_mutex);
26
27/*
28 * This will return sensor information to driver based on the requested sensor
29 * handle. A handle is an opaque id for the powernv, read by the driver from the
30 * device tree..
31 */
32int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data)
33{
34 int ret, token;
35 struct opal_msg msg;
36 __be32 data;
37
38 token = opal_async_get_token_interruptible();
39 if (token < 0) {
40 pr_err("%s: Couldn't get the token, returning\n", __func__);
41 ret = token;
42 goto out;
43 }
44
45 mutex_lock(&opal_sensor_mutex);
46 ret = opal_sensor_read(sensor_hndl, token, &data);
47 if (ret != OPAL_ASYNC_COMPLETION)
48 goto out_token;
49
50 ret = opal_async_wait_response(token, &msg);
51 if (ret) {
52 pr_err("%s: Failed to wait for the async response, %d\n",
53 __func__, ret);
54 goto out_token;
55 }
56
57 *sensor_data = be32_to_cpu(data);
58 ret = be64_to_cpu(msg.params[1]);
59
60out_token:
61 mutex_unlock(&opal_sensor_mutex);
62 opal_async_release_token(token);
63out:
64 return ret;
65}
66EXPORT_SYMBOL_GPL(opal_get_sensor_data);
diff --git a/arch/powerpc/platforms/powernv/opal-sysparam.c b/arch/powerpc/platforms/powernv/opal-sysparam.c
new file mode 100644
index 000000000000..6b614726baf2
--- /dev/null
+++ b/arch/powerpc/platforms/powernv/opal-sysparam.c
@@ -0,0 +1,290 @@
1/*
2 * PowerNV system parameter code
3 *
4 * Copyright (C) 2013 IBM
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 * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#include <linux/kobject.h>
22#include <linux/mutex.h>
23#include <linux/slab.h>
24#include <linux/of.h>
25#include <linux/gfp.h>
26#include <linux/stat.h>
27#include <asm/opal.h>
28
29#define MAX_PARAM_DATA_LEN 64
30
31static DEFINE_MUTEX(opal_sysparam_mutex);
32static struct kobject *sysparam_kobj;
33static void *param_data_buf;
34
35struct param_attr {
36 struct list_head list;
37 u32 param_id;
38 u32 param_size;
39 struct kobj_attribute kobj_attr;
40};
41
42static int opal_get_sys_param(u32 param_id, u32 length, void *buffer)
43{
44 struct opal_msg msg;
45 int ret, token;
46
47 token = opal_async_get_token_interruptible();
48 if (token < 0) {
49 if (token != -ERESTARTSYS)
50 pr_err("%s: Couldn't get the token, returning\n",
51 __func__);
52 ret = token;
53 goto out;
54 }
55
56 ret = opal_get_param(token, param_id, (u64)buffer, length);
57 if (ret != OPAL_ASYNC_COMPLETION)
58 goto out_token;
59
60 ret = opal_async_wait_response(token, &msg);
61 if (ret) {
62 pr_err("%s: Failed to wait for the async response, %d\n",
63 __func__, ret);
64 goto out_token;
65 }
66
67 ret = be64_to_cpu(msg.params[1]);
68
69out_token:
70 opal_async_release_token(token);
71out:
72 return ret;
73}
74
75static int opal_set_sys_param(u32 param_id, u32 length, void *buffer)
76{
77 struct opal_msg msg;
78 int ret, token;
79
80 token = opal_async_get_token_interruptible();
81 if (token < 0) {
82 if (token != -ERESTARTSYS)
83 pr_err("%s: Couldn't get the token, returning\n",
84 __func__);
85 ret = token;
86 goto out;
87 }
88
89 ret = opal_set_param(token, param_id, (u64)buffer, length);
90
91 if (ret != OPAL_ASYNC_COMPLETION)
92 goto out_token;
93
94 ret = opal_async_wait_response(token, &msg);
95 if (ret) {
96 pr_err("%s: Failed to wait for the async response, %d\n",
97 __func__, ret);
98 goto out_token;
99 }
100
101 ret = be64_to_cpu(msg.params[1]);
102
103out_token:
104 opal_async_release_token(token);
105out:
106 return ret;
107}
108
109static ssize_t sys_param_show(struct kobject *kobj,
110 struct kobj_attribute *kobj_attr, char *buf)
111{
112 struct param_attr *attr = container_of(kobj_attr, struct param_attr,
113 kobj_attr);
114 int ret;
115
116 mutex_lock(&opal_sysparam_mutex);
117 ret = opal_get_sys_param(attr->param_id, attr->param_size,
118 param_data_buf);
119 if (ret)
120 goto out;
121
122 memcpy(buf, param_data_buf, attr->param_size);
123
124out:
125 mutex_unlock(&opal_sysparam_mutex);
126 return ret ? ret : attr->param_size;
127}
128
129static ssize_t sys_param_store(struct kobject *kobj,
130 struct kobj_attribute *kobj_attr, const char *buf, size_t count)
131{
132 struct param_attr *attr = container_of(kobj_attr, struct param_attr,
133 kobj_attr);
134 int ret;
135
136 mutex_lock(&opal_sysparam_mutex);
137 memcpy(param_data_buf, buf, count);
138 ret = opal_set_sys_param(attr->param_id, attr->param_size,
139 param_data_buf);
140 mutex_unlock(&opal_sysparam_mutex);
141 return ret ? ret : count;
142}
143
144void __init opal_sys_param_init(void)
145{
146 struct device_node *sysparam;
147 struct param_attr *attr;
148 u32 *id, *size;
149 int count, i;
150 u8 *perm;
151
152 if (!opal_kobj) {
153 pr_warn("SYSPARAM: opal kobject is not available\n");
154 goto out;
155 }
156
157 sysparam_kobj = kobject_create_and_add("sysparams", opal_kobj);
158 if (!sysparam_kobj) {
159 pr_err("SYSPARAM: Failed to create sysparam kobject\n");
160 goto out;
161 }
162
163 /* Allocate big enough buffer for any get/set transactions */
164 param_data_buf = kzalloc(MAX_PARAM_DATA_LEN, GFP_KERNEL);
165 if (!param_data_buf) {
166 pr_err("SYSPARAM: Failed to allocate memory for param data "
167 "buf\n");
168 goto out_kobj_put;
169 }
170
171 sysparam = of_find_node_by_path("/ibm,opal/sysparams");
172 if (!sysparam) {
173 pr_err("SYSPARAM: Opal sysparam node not found\n");
174 goto out_param_buf;
175 }
176
177 if (!of_device_is_compatible(sysparam, "ibm,opal-sysparams")) {
178 pr_err("SYSPARAM: Opal sysparam node not compatible\n");
179 goto out_node_put;
180 }
181
182 /* Number of parameters exposed through DT */
183 count = of_property_count_strings(sysparam, "param-name");
184 if (count < 0) {
185 pr_err("SYSPARAM: No string found of property param-name in "
186 "the node %s\n", sysparam->name);
187 goto out_node_put;
188 }
189
190 id = kzalloc(sizeof(*id) * count, GFP_KERNEL);
191 if (!id) {
192 pr_err("SYSPARAM: Failed to allocate memory to read parameter "
193 "id\n");
194 goto out_node_put;
195 }
196
197 size = kzalloc(sizeof(*size) * count, GFP_KERNEL);
198 if (!size) {
199 pr_err("SYSPARAM: Failed to allocate memory to read parameter "
200 "size\n");
201 goto out_free_id;
202 }
203
204 perm = kzalloc(sizeof(*perm) * count, GFP_KERNEL);
205 if (!perm) {
206 pr_err("SYSPARAM: Failed to allocate memory to read supported "
207 "action on the parameter");
208 goto out_free_size;
209 }
210
211 if (of_property_read_u32_array(sysparam, "param-id", id, count)) {
212 pr_err("SYSPARAM: Missing property param-id in the DT\n");
213 goto out_free_perm;
214 }
215
216 if (of_property_read_u32_array(sysparam, "param-len", size, count)) {
217 pr_err("SYSPARAM: Missing propery param-len in the DT\n");
218 goto out_free_perm;
219 }
220
221
222 if (of_property_read_u8_array(sysparam, "param-perm", perm, count)) {
223 pr_err("SYSPARAM: Missing propery param-perm in the DT\n");
224 goto out_free_perm;
225 }
226
227 attr = kzalloc(sizeof(*attr) * count, GFP_KERNEL);
228 if (!attr) {
229 pr_err("SYSPARAM: Failed to allocate memory for parameter "
230 "attributes\n");
231 goto out_free_perm;
232 }
233
234 /* For each of the parameters, populate the parameter attributes */
235 for (i = 0; i < count; i++) {
236 sysfs_attr_init(&attr[i].kobj_attr.attr);
237 attr[i].param_id = id[i];
238 attr[i].param_size = size[i];
239 if (of_property_read_string_index(sysparam, "param-name", i,
240 &attr[i].kobj_attr.attr.name))
241 continue;
242
243 /* If the parameter is read-only or read-write */
244 switch (perm[i] & 3) {
245 case OPAL_SYSPARAM_READ:
246 attr[i].kobj_attr.attr.mode = S_IRUGO;
247 break;
248 case OPAL_SYSPARAM_WRITE:
249 attr[i].kobj_attr.attr.mode = S_IWUGO;
250 break;
251 case OPAL_SYSPARAM_RW:
252 attr[i].kobj_attr.attr.mode = S_IRUGO | S_IWUGO;
253 break;
254 default:
255 break;
256 }
257
258 attr[i].kobj_attr.show = sys_param_show;
259 attr[i].kobj_attr.store = sys_param_store;
260
261 if (sysfs_create_file(sysparam_kobj, &attr[i].kobj_attr.attr)) {
262 pr_err("SYSPARAM: Failed to create sysfs file %s\n",
263 attr[i].kobj_attr.attr.name);
264 goto out_free_attr;
265 }
266 }
267
268 kfree(perm);
269 kfree(size);
270 kfree(id);
271 of_node_put(sysparam);
272 return;
273
274out_free_attr:
275 kfree(attr);
276out_free_perm:
277 kfree(perm);
278out_free_size:
279 kfree(size);
280out_free_id:
281 kfree(id);
282out_node_put:
283 of_node_put(sysparam);
284out_param_buf:
285 kfree(param_data_buf);
286out_kobj_put:
287 kobject_put(sysparam_kobj);
288out:
289 return;
290}
diff --git a/arch/powerpc/platforms/powernv/opal-wrappers.S b/arch/powerpc/platforms/powernv/opal-wrappers.S
index 3e8829c40fbb..f531ffe35b3e 100644
--- a/arch/powerpc/platforms/powernv/opal-wrappers.S
+++ b/arch/powerpc/platforms/powernv/opal-wrappers.S
@@ -61,6 +61,7 @@ _STATIC(opal_return)
61 mtcr r4; 61 mtcr r4;
62 rfid 62 rfid
63 63
64OPAL_CALL(opal_invalid_call, OPAL_INVALID_CALL);
64OPAL_CALL(opal_console_write, OPAL_CONSOLE_WRITE); 65OPAL_CALL(opal_console_write, OPAL_CONSOLE_WRITE);
65OPAL_CALL(opal_console_read, OPAL_CONSOLE_READ); 66OPAL_CALL(opal_console_read, OPAL_CONSOLE_READ);
66OPAL_CALL(opal_console_write_buffer_space, OPAL_CONSOLE_WRITE_BUFFER_SPACE); 67OPAL_CALL(opal_console_write_buffer_space, OPAL_CONSOLE_WRITE_BUFFER_SPACE);
@@ -123,9 +124,24 @@ OPAL_CALL(opal_xscom_write, OPAL_XSCOM_WRITE);
123OPAL_CALL(opal_lpc_read, OPAL_LPC_READ); 124OPAL_CALL(opal_lpc_read, OPAL_LPC_READ);
124OPAL_CALL(opal_lpc_write, OPAL_LPC_WRITE); 125OPAL_CALL(opal_lpc_write, OPAL_LPC_WRITE);
125OPAL_CALL(opal_return_cpu, OPAL_RETURN_CPU); 126OPAL_CALL(opal_return_cpu, OPAL_RETURN_CPU);
127OPAL_CALL(opal_read_elog, OPAL_ELOG_READ);
128OPAL_CALL(opal_send_ack_elog, OPAL_ELOG_ACK);
129OPAL_CALL(opal_get_elog_size, OPAL_ELOG_SIZE);
130OPAL_CALL(opal_resend_pending_logs, OPAL_ELOG_RESEND);
131OPAL_CALL(opal_write_elog, OPAL_ELOG_WRITE);
126OPAL_CALL(opal_validate_flash, OPAL_FLASH_VALIDATE); 132OPAL_CALL(opal_validate_flash, OPAL_FLASH_VALIDATE);
127OPAL_CALL(opal_manage_flash, OPAL_FLASH_MANAGE); 133OPAL_CALL(opal_manage_flash, OPAL_FLASH_MANAGE);
128OPAL_CALL(opal_update_flash, OPAL_FLASH_UPDATE); 134OPAL_CALL(opal_update_flash, OPAL_FLASH_UPDATE);
135OPAL_CALL(opal_resync_timebase, OPAL_RESYNC_TIMEBASE);
136OPAL_CALL(opal_dump_init, OPAL_DUMP_INIT);
137OPAL_CALL(opal_dump_info, OPAL_DUMP_INFO);
138OPAL_CALL(opal_dump_info2, OPAL_DUMP_INFO2);
139OPAL_CALL(opal_dump_read, OPAL_DUMP_READ);
140OPAL_CALL(opal_dump_ack, OPAL_DUMP_ACK);
129OPAL_CALL(opal_get_msg, OPAL_GET_MSG); 141OPAL_CALL(opal_get_msg, OPAL_GET_MSG);
130OPAL_CALL(opal_check_completion, OPAL_CHECK_ASYNC_COMPLETION); 142OPAL_CALL(opal_check_completion, OPAL_CHECK_ASYNC_COMPLETION);
143OPAL_CALL(opal_dump_resend_notification, OPAL_DUMP_RESEND);
131OPAL_CALL(opal_sync_host_reboot, OPAL_SYNC_HOST_REBOOT); 144OPAL_CALL(opal_sync_host_reboot, OPAL_SYNC_HOST_REBOOT);
145OPAL_CALL(opal_sensor_read, OPAL_SENSOR_READ);
146OPAL_CALL(opal_get_param, OPAL_GET_PARAM);
147OPAL_CALL(opal_set_param, OPAL_SET_PARAM);
diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index 65499adaecff..49d2f00019e5 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -21,6 +21,7 @@
21#include <linux/sched.h> 21#include <linux/sched.h>
22#include <linux/kobject.h> 22#include <linux/kobject.h>
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/memblock.h>
24#include <asm/opal.h> 25#include <asm/opal.h>
25#include <asm/firmware.h> 26#include <asm/firmware.h>
26#include <asm/mce.h> 27#include <asm/mce.h>
@@ -33,9 +34,19 @@ struct kobject *opal_kobj;
33struct opal { 34struct opal {
34 u64 base; 35 u64 base;
35 u64 entry; 36 u64 entry;
37 u64 size;
36} opal; 38} opal;
37 39
38static struct device_node *opal_node; 40struct mcheck_recoverable_range {
41 u64 start_addr;
42 u64 end_addr;
43 u64 recover_addr;
44};
45
46static struct mcheck_recoverable_range *mc_recoverable_range;
47static int mc_recoverable_range_len;
48
49struct device_node *opal_node;
39static DEFINE_SPINLOCK(opal_write_lock); 50static DEFINE_SPINLOCK(opal_write_lock);
40extern u64 opal_mc_secondary_handler[]; 51extern u64 opal_mc_secondary_handler[];
41static unsigned int *opal_irqs; 52static unsigned int *opal_irqs;
@@ -49,25 +60,29 @@ static atomic_t opal_notifier_hold = ATOMIC_INIT(0);
49int __init early_init_dt_scan_opal(unsigned long node, 60int __init early_init_dt_scan_opal(unsigned long node,
50 const char *uname, int depth, void *data) 61 const char *uname, int depth, void *data)
51{ 62{
52 const void *basep, *entryp; 63 const void *basep, *entryp, *sizep;
53 unsigned long basesz, entrysz; 64 unsigned long basesz, entrysz, runtimesz;
54 65
55 if (depth != 1 || strcmp(uname, "ibm,opal") != 0) 66 if (depth != 1 || strcmp(uname, "ibm,opal") != 0)
56 return 0; 67 return 0;
57 68
58 basep = of_get_flat_dt_prop(node, "opal-base-address", &basesz); 69 basep = of_get_flat_dt_prop(node, "opal-base-address", &basesz);
59 entryp = of_get_flat_dt_prop(node, "opal-entry-address", &entrysz); 70 entryp = of_get_flat_dt_prop(node, "opal-entry-address", &entrysz);
71 sizep = of_get_flat_dt_prop(node, "opal-runtime-size", &runtimesz);
60 72
61 if (!basep || !entryp) 73 if (!basep || !entryp || !sizep)
62 return 1; 74 return 1;
63 75
64 opal.base = of_read_number(basep, basesz/4); 76 opal.base = of_read_number(basep, basesz/4);
65 opal.entry = of_read_number(entryp, entrysz/4); 77 opal.entry = of_read_number(entryp, entrysz/4);
78 opal.size = of_read_number(sizep, runtimesz/4);
66 79
67 pr_debug("OPAL Base = 0x%llx (basep=%p basesz=%ld)\n", 80 pr_debug("OPAL Base = 0x%llx (basep=%p basesz=%ld)\n",
68 opal.base, basep, basesz); 81 opal.base, basep, basesz);
69 pr_debug("OPAL Entry = 0x%llx (entryp=%p basesz=%ld)\n", 82 pr_debug("OPAL Entry = 0x%llx (entryp=%p basesz=%ld)\n",
70 opal.entry, entryp, entrysz); 83 opal.entry, entryp, entrysz);
84 pr_debug("OPAL Entry = 0x%llx (sizep=%p runtimesz=%ld)\n",
85 opal.size, sizep, runtimesz);
71 86
72 powerpc_firmware_features |= FW_FEATURE_OPAL; 87 powerpc_firmware_features |= FW_FEATURE_OPAL;
73 if (of_flat_dt_is_compatible(node, "ibm,opal-v3")) { 88 if (of_flat_dt_is_compatible(node, "ibm,opal-v3")) {
@@ -84,6 +99,65 @@ int __init early_init_dt_scan_opal(unsigned long node,
84 return 1; 99 return 1;
85} 100}
86 101
102int __init early_init_dt_scan_recoverable_ranges(unsigned long node,
103 const char *uname, int depth, void *data)
104{
105 unsigned long i, psize, size;
106 const __be32 *prop;
107
108 if (depth != 1 || strcmp(uname, "ibm,opal") != 0)
109 return 0;
110
111 prop = of_get_flat_dt_prop(node, "mcheck-recoverable-ranges", &psize);
112
113 if (!prop)
114 return 1;
115
116 pr_debug("Found machine check recoverable ranges.\n");
117
118 /*
119 * Calculate number of available entries.
120 *
121 * Each recoverable address range entry is (start address, len,
122 * recovery address), 2 cells each for start and recovery address,
123 * 1 cell for len, totalling 5 cells per entry.
124 */
125 mc_recoverable_range_len = psize / (sizeof(*prop) * 5);
126
127 /* Sanity check */
128 if (!mc_recoverable_range_len)
129 return 1;
130
131 /* Size required to hold all the entries. */
132 size = mc_recoverable_range_len *
133 sizeof(struct mcheck_recoverable_range);
134
135 /*
136 * Allocate a buffer to hold the MC recoverable ranges. We would be
137 * accessing them in real mode, hence it needs to be within
138 * RMO region.
139 */
140 mc_recoverable_range =__va(memblock_alloc_base(size, __alignof__(u64),
141 ppc64_rma_size));
142 memset(mc_recoverable_range, 0, size);
143
144 for (i = 0; i < mc_recoverable_range_len; i++) {
145 mc_recoverable_range[i].start_addr =
146 of_read_number(prop + (i * 5) + 0, 2);
147 mc_recoverable_range[i].end_addr =
148 mc_recoverable_range[i].start_addr +
149 of_read_number(prop + (i * 5) + 2, 1);
150 mc_recoverable_range[i].recover_addr =
151 of_read_number(prop + (i * 5) + 3, 2);
152
153 pr_debug("Machine check recoverable range: %llx..%llx: %llx\n",
154 mc_recoverable_range[i].start_addr,
155 mc_recoverable_range[i].end_addr,
156 mc_recoverable_range[i].recover_addr);
157 }
158 return 1;
159}
160
87static int __init opal_register_exception_handlers(void) 161static int __init opal_register_exception_handlers(void)
88{ 162{
89#ifdef __BIG_ENDIAN__ 163#ifdef __BIG_ENDIAN__
@@ -118,6 +192,20 @@ int opal_notifier_register(struct notifier_block *nb)
118 atomic_notifier_chain_register(&opal_notifier_head, nb); 192 atomic_notifier_chain_register(&opal_notifier_head, nb);
119 return 0; 193 return 0;
120} 194}
195EXPORT_SYMBOL_GPL(opal_notifier_register);
196
197int opal_notifier_unregister(struct notifier_block *nb)
198{
199 if (!nb) {
200 pr_warning("%s: Invalid argument (%p)\n",
201 __func__, nb);
202 return -EINVAL;
203 }
204
205 atomic_notifier_chain_unregister(&opal_notifier_head, nb);
206 return 0;
207}
208EXPORT_SYMBOL_GPL(opal_notifier_unregister);
121 209
122static void opal_do_notifier(uint64_t events) 210static void opal_do_notifier(uint64_t events)
123{ 211{
@@ -205,6 +293,7 @@ static void opal_handle_message(void)
205 * value in /proc/device-tree. 293 * value in /proc/device-tree.
206 */ 294 */
207 static struct opal_msg msg; 295 static struct opal_msg msg;
296 u32 type;
208 297
209 ret = opal_get_msg(__pa(&msg), sizeof(msg)); 298 ret = opal_get_msg(__pa(&msg), sizeof(msg));
210 /* No opal message pending. */ 299 /* No opal message pending. */
@@ -218,13 +307,14 @@ static void opal_handle_message(void)
218 return; 307 return;
219 } 308 }
220 309
310 type = be32_to_cpu(msg.msg_type);
311
221 /* Sanity check */ 312 /* Sanity check */
222 if (msg.msg_type > OPAL_MSG_TYPE_MAX) { 313 if (type > OPAL_MSG_TYPE_MAX) {
223 pr_warning("%s: Unknown message type: %u\n", 314 pr_warning("%s: Unknown message type: %u\n", __func__, type);
224 __func__, msg.msg_type);
225 return; 315 return;
226 } 316 }
227 opal_message_do_notify(msg.msg_type, (void *)&msg); 317 opal_message_do_notify(type, (void *)&msg);
228} 318}
229 319
230static int opal_message_notify(struct notifier_block *nb, 320static int opal_message_notify(struct notifier_block *nb,
@@ -401,6 +491,38 @@ int opal_machine_check(struct pt_regs *regs)
401 return 0; 491 return 0;
402} 492}
403 493
494static uint64_t find_recovery_address(uint64_t nip)
495{
496 int i;
497
498 for (i = 0; i < mc_recoverable_range_len; i++)
499 if ((nip >= mc_recoverable_range[i].start_addr) &&
500 (nip < mc_recoverable_range[i].end_addr))
501 return mc_recoverable_range[i].recover_addr;
502 return 0;
503}
504
505bool opal_mce_check_early_recovery(struct pt_regs *regs)
506{
507 uint64_t recover_addr = 0;
508
509 if (!opal.base || !opal.size)
510 goto out;
511
512 if ((regs->nip >= opal.base) &&
513 (regs->nip <= (opal.base + opal.size)))
514 recover_addr = find_recovery_address(regs->nip);
515
516 /*
517 * Setup regs->nip to rfi into fixup address.
518 */
519 if (recover_addr)
520 regs->nip = recover_addr;
521
522out:
523 return !!recover_addr;
524}
525
404static irqreturn_t opal_interrupt(int irq, void *data) 526static irqreturn_t opal_interrupt(int irq, void *data)
405{ 527{
406 __be64 events; 528 __be64 events;
@@ -472,8 +594,16 @@ static int __init opal_init(void)
472 /* Create "opal" kobject under /sys/firmware */ 594 /* Create "opal" kobject under /sys/firmware */
473 rc = opal_sysfs_init(); 595 rc = opal_sysfs_init();
474 if (rc == 0) { 596 if (rc == 0) {
597 /* Setup error log interface */
598 rc = opal_elog_init();
475 /* Setup code update interface */ 599 /* Setup code update interface */
476 opal_flash_init(); 600 opal_flash_init();
601 /* Setup platform dump extract interface */
602 opal_platform_dump_init();
603 /* Setup system parameters interface */
604 opal_sys_param_init();
605 /* Setup message log interface. */
606 opal_msglog_init();
477 } 607 }
478 608
479 return 0; 609 return 0;
@@ -505,3 +635,6 @@ void opal_shutdown(void)
505 mdelay(10); 635 mdelay(10);
506 } 636 }
507} 637}
638
639/* Export this so that test modules can use it */
640EXPORT_SYMBOL_GPL(opal_invalid_call);
diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
index 81a7a0a79be7..61cf8fa9c61b 100644
--- a/arch/powerpc/platforms/powernv/setup.c
+++ b/arch/powerpc/platforms/powernv/setup.c
@@ -187,6 +187,7 @@ static void __init pnv_setup_machdep_opal(void)
187 ppc_md.power_off = pnv_power_off; 187 ppc_md.power_off = pnv_power_off;
188 ppc_md.halt = pnv_halt; 188 ppc_md.halt = pnv_halt;
189 ppc_md.machine_check_exception = opal_machine_check; 189 ppc_md.machine_check_exception = opal_machine_check;
190 ppc_md.mce_check_early_recovery = opal_mce_check_early_recovery;
190} 191}
191 192
192#ifdef CONFIG_PPC_POWERNV_RTAS 193#ifdef CONFIG_PPC_POWERNV_RTAS
diff --git a/arch/powerpc/platforms/ps3/Kconfig b/arch/powerpc/platforms/ps3/Kconfig
index e87c19473973..56f274064d6c 100644
--- a/arch/powerpc/platforms/ps3/Kconfig
+++ b/arch/powerpc/platforms/ps3/Kconfig
@@ -2,10 +2,8 @@ config PPC_PS3
2 bool "Sony PS3" 2 bool "Sony PS3"
3 depends on PPC64 && PPC_BOOK3S 3 depends on PPC64 && PPC_BOOK3S
4 select PPC_CELL 4 select PPC_CELL
5 select USB_ARCH_HAS_OHCI
6 select USB_OHCI_LITTLE_ENDIAN 5 select USB_OHCI_LITTLE_ENDIAN
7 select USB_OHCI_BIG_ENDIAN_MMIO 6 select USB_OHCI_BIG_ENDIAN_MMIO
8 select USB_ARCH_HAS_EHCI
9 select USB_EHCI_BIG_ENDIAN_MMIO 7 select USB_EHCI_BIG_ENDIAN_MMIO
10 select PPC_PCI_CHOICE 8 select PPC_PCI_CHOICE
11 help 9 help
diff --git a/arch/powerpc/platforms/ps3/smp.c b/arch/powerpc/platforms/ps3/smp.c
index 4b35166229fe..b358bec6c8cb 100644
--- a/arch/powerpc/platforms/ps3/smp.c
+++ b/arch/powerpc/platforms/ps3/smp.c
@@ -76,7 +76,7 @@ static int __init ps3_smp_probe(void)
76 76
77 BUILD_BUG_ON(PPC_MSG_CALL_FUNCTION != 0); 77 BUILD_BUG_ON(PPC_MSG_CALL_FUNCTION != 0);
78 BUILD_BUG_ON(PPC_MSG_RESCHEDULE != 1); 78 BUILD_BUG_ON(PPC_MSG_RESCHEDULE != 1);
79 BUILD_BUG_ON(PPC_MSG_CALL_FUNC_SINGLE != 2); 79 BUILD_BUG_ON(PPC_MSG_TICK_BROADCAST != 2);
80 BUILD_BUG_ON(PPC_MSG_DEBUGGER_BREAK != 3); 80 BUILD_BUG_ON(PPC_MSG_DEBUGGER_BREAK != 3);
81 81
82 for (i = 0; i < MSG_COUNT; i++) { 82 for (i = 0; i < MSG_COUNT; i++) {
diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig
index 80b1d57c306a..2cb8b776c84a 100644
--- a/arch/powerpc/platforms/pseries/Kconfig
+++ b/arch/powerpc/platforms/pseries/Kconfig
@@ -111,6 +111,18 @@ config CMM
111 will be reused for other LPARs. The interface allows firmware to 111 will be reused for other LPARs. The interface allows firmware to
112 balance memory across many LPARs. 112 balance memory across many LPARs.
113 113
114config HV_PERF_CTRS
115 bool "Hypervisor supplied PMU events (24x7 & GPCI)"
116 default y
117 depends on PERF_EVENTS && PPC_PSERIES
118 help
119 Enable access to hypervisor supplied counters in perf. Currently,
120 this enables code that uses the hcall GetPerfCounterInfo and 24x7
121 interfaces to retrieve counters. GPCI exists on Power 6 and later
122 systems. 24x7 is available on Power 8 systems.
123
124 If unsure, select Y.
125
114config DTL 126config DTL
115 bool "Dispatch Trace Log" 127 bool "Dispatch Trace Log"
116 depends on PPC_SPLPAR && DEBUG_FS 128 depends on PPC_SPLPAR && DEBUG_FS
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index a8fe5aa3d34f..022b38e6a80b 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -11,7 +11,6 @@
11 */ 11 */
12 12
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/kref.h>
15#include <linux/notifier.h> 14#include <linux/notifier.h>
16#include <linux/spinlock.h> 15#include <linux/spinlock.h>
17#include <linux/cpu.h> 16#include <linux/cpu.h>
@@ -87,7 +86,6 @@ static struct device_node *dlpar_parse_cc_node(struct cc_workarea *ccwa,
87 } 86 }
88 87
89 of_node_set_flag(dn, OF_DYNAMIC); 88 of_node_set_flag(dn, OF_DYNAMIC);
90 kref_init(&dn->kref);
91 89
92 return dn; 90 return dn;
93} 91}
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 0ea99e3d4815..9b8e05078a63 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -420,4 +420,4 @@ static int __init pseries_cpu_hotplug_init(void)
420 420
421 return 0; 421 return 0;
422} 422}
423arch_initcall(pseries_cpu_hotplug_init); 423machine_arch_initcall(pseries, pseries_cpu_hotplug_init);
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 9590dbb756f2..573b488fc48b 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -14,6 +14,7 @@
14#include <linux/memblock.h> 14#include <linux/memblock.h>
15#include <linux/vmalloc.h> 15#include <linux/vmalloc.h>
16#include <linux/memory.h> 16#include <linux/memory.h>
17#include <linux/memory_hotplug.h>
17 18
18#include <asm/firmware.h> 19#include <asm/firmware.h>
19#include <asm/machdep.h> 20#include <asm/machdep.h>
@@ -75,13 +76,27 @@ unsigned long memory_block_size_bytes(void)
75} 76}
76 77
77#ifdef CONFIG_MEMORY_HOTREMOVE 78#ifdef CONFIG_MEMORY_HOTREMOVE
78static int pseries_remove_memblock(unsigned long base, unsigned int memblock_size) 79static int pseries_remove_memory(u64 start, u64 size)
79{ 80{
80 unsigned long start, start_pfn;
81 struct zone *zone;
82 int ret; 81 int ret;
83 unsigned long section; 82
84 unsigned long sections_to_remove; 83 /* Remove htab bolted mappings for this section of memory */
84 start = (unsigned long)__va(start);
85 ret = remove_section_mapping(start, start + size);
86
87 /* Ensure all vmalloc mappings are flushed in case they also
88 * hit that section of memory
89 */
90 vm_unmap_aliases();
91
92 return ret;
93}
94
95static int pseries_remove_memblock(unsigned long base, unsigned int memblock_size)
96{
97 unsigned long block_sz, start_pfn;
98 int sections_per_block;
99 int i, nid;
85 100
86 start_pfn = base >> PAGE_SHIFT; 101 start_pfn = base >> PAGE_SHIFT;
87 102
@@ -90,45 +105,21 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz
90 return 0; 105 return 0;
91 } 106 }
92 107
93 zone = page_zone(pfn_to_page(start_pfn)); 108 block_sz = memory_block_size_bytes();
109 sections_per_block = block_sz / MIN_MEMORY_BLOCK_SIZE;
110 nid = memory_add_physaddr_to_nid(base);
94 111
95 /* 112 for (i = 0; i < sections_per_block; i++) {
96 * Remove section mappings and sysfs entries for the 113 remove_memory(nid, base, MIN_MEMORY_BLOCK_SIZE);
97 * section of the memory we are removing. 114 base += MIN_MEMORY_BLOCK_SIZE;
98 *
99 * NOTE: Ideally, this should be done in generic code like
100 * remove_memory(). But remove_memory() gets called by writing
101 * to sysfs "state" file and we can't remove sysfs entries
102 * while writing to it. So we have to defer it to here.
103 */
104 sections_to_remove = (memblock_size >> PAGE_SHIFT) / PAGES_PER_SECTION;
105 for (section = 0; section < sections_to_remove; section++) {
106 unsigned long pfn = start_pfn + section * PAGES_PER_SECTION;
107 ret = __remove_pages(zone, pfn, PAGES_PER_SECTION);
108 if (ret)
109 return ret;
110 } 115 }
111 116
112 /* 117 /* Update memory regions for memory remove */
113 * Update memory regions for memory remove
114 */
115 memblock_remove(base, memblock_size); 118 memblock_remove(base, memblock_size);
116 119 return 0;
117 /*
118 * Remove htab bolted mappings for this section of memory
119 */
120 start = (unsigned long)__va(base);
121 ret = remove_section_mapping(start, start + memblock_size);
122
123 /* Ensure all vmalloc mappings are flushed in case they also
124 * hit that section of memory
125 */
126 vm_unmap_aliases();
127
128 return ret;
129} 120}
130 121
131static int pseries_remove_memory(struct device_node *np) 122static int pseries_remove_mem_node(struct device_node *np)
132{ 123{
133 const char *type; 124 const char *type;
134 const unsigned int *regs; 125 const unsigned int *regs;
@@ -153,8 +144,8 @@ static int pseries_remove_memory(struct device_node *np)
153 base = *(unsigned long *)regs; 144 base = *(unsigned long *)regs;
154 lmb_size = regs[3]; 145 lmb_size = regs[3];
155 146
156 ret = pseries_remove_memblock(base, lmb_size); 147 pseries_remove_memblock(base, lmb_size);
157 return ret; 148 return 0;
158} 149}
159#else 150#else
160static inline int pseries_remove_memblock(unsigned long base, 151static inline int pseries_remove_memblock(unsigned long base,
@@ -162,13 +153,13 @@ static inline int pseries_remove_memblock(unsigned long base,
162{ 153{
163 return -EOPNOTSUPP; 154 return -EOPNOTSUPP;
164} 155}
165static inline int pseries_remove_memory(struct device_node *np) 156static inline int pseries_remove_mem_node(struct device_node *np)
166{ 157{
167 return -EOPNOTSUPP; 158 return -EOPNOTSUPP;
168} 159}
169#endif /* CONFIG_MEMORY_HOTREMOVE */ 160#endif /* CONFIG_MEMORY_HOTREMOVE */
170 161
171static int pseries_add_memory(struct device_node *np) 162static int pseries_add_mem_node(struct device_node *np)
172{ 163{
173 const char *type; 164 const char *type;
174 const unsigned int *regs; 165 const unsigned int *regs;
@@ -254,10 +245,10 @@ static int pseries_memory_notifier(struct notifier_block *nb,
254 245
255 switch (action) { 246 switch (action) {
256 case OF_RECONFIG_ATTACH_NODE: 247 case OF_RECONFIG_ATTACH_NODE:
257 err = pseries_add_memory(node); 248 err = pseries_add_mem_node(node);
258 break; 249 break;
259 case OF_RECONFIG_DETACH_NODE: 250 case OF_RECONFIG_DETACH_NODE:
260 err = pseries_remove_memory(node); 251 err = pseries_remove_mem_node(node);
261 break; 252 break;
262 case OF_RECONFIG_UPDATE_PROPERTY: 253 case OF_RECONFIG_UPDATE_PROPERTY:
263 pr = (struct of_prop_reconfig *)node; 254 pr = (struct of_prop_reconfig *)node;
@@ -277,6 +268,10 @@ static int __init pseries_memory_hotplug_init(void)
277 if (firmware_has_feature(FW_FEATURE_LPAR)) 268 if (firmware_has_feature(FW_FEATURE_LPAR))
278 of_reconfig_notifier_register(&pseries_mem_nb); 269 of_reconfig_notifier_register(&pseries_mem_nb);
279 270
271#ifdef CONFIG_MEMORY_HOTREMOVE
272 ppc_md.remove_memory = pseries_remove_memory;
273#endif
274
280 return 0; 275 return 0;
281} 276}
282machine_device_initcall(pseries, pseries_memory_hotplug_init); 277machine_device_initcall(pseries, pseries_memory_hotplug_init);
diff --git a/arch/powerpc/platforms/pseries/io_event_irq.c b/arch/powerpc/platforms/pseries/io_event_irq.c
index 5ea88d1541f7..0240c4ff878a 100644
--- a/arch/powerpc/platforms/pseries/io_event_irq.c
+++ b/arch/powerpc/platforms/pseries/io_event_irq.c
@@ -82,9 +82,9 @@ static struct pseries_io_event * ioei_find_event(struct rtas_error_log *elog)
82 * RTAS_TYPE_IO only exists in extended event log version 6 or later. 82 * RTAS_TYPE_IO only exists in extended event log version 6 or later.
83 * No need to check event log version. 83 * No need to check event log version.
84 */ 84 */
85 if (unlikely(elog->type != RTAS_TYPE_IO)) { 85 if (unlikely(rtas_error_type(elog) != RTAS_TYPE_IO)) {
86 printk_once(KERN_WARNING "io_event_irq: Unexpected event type %d", 86 printk_once(KERN_WARNING"io_event_irq: Unexpected event type %d",
87 elog->type); 87 rtas_error_type(elog));
88 return NULL; 88 return NULL;
89 } 89 }
90 90
diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index cde4e0a095ae..bde7ebad3949 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -290,13 +290,6 @@ void post_mobility_fixup(void)
290 int rc; 290 int rc;
291 int activate_fw_token; 291 int activate_fw_token;
292 292
293 rc = pseries_devicetree_update(MIGRATION_SCOPE);
294 if (rc) {
295 printk(KERN_ERR "Initial post-mobility device tree update "
296 "failed: %d\n", rc);
297 return;
298 }
299
300 activate_fw_token = rtas_token("ibm,activate-firmware"); 293 activate_fw_token = rtas_token("ibm,activate-firmware");
301 if (activate_fw_token == RTAS_UNKNOWN_SERVICE) { 294 if (activate_fw_token == RTAS_UNKNOWN_SERVICE) {
302 printk(KERN_ERR "Could not make post-mobility " 295 printk(KERN_ERR "Could not make post-mobility "
@@ -304,16 +297,17 @@ void post_mobility_fixup(void)
304 return; 297 return;
305 } 298 }
306 299
307 rc = rtas_call(activate_fw_token, 0, 1, NULL); 300 do {
308 if (!rc) { 301 rc = rtas_call(activate_fw_token, 0, 1, NULL);
309 rc = pseries_devicetree_update(MIGRATION_SCOPE); 302 } while (rtas_busy_delay(rc));
310 if (rc) 303
311 printk(KERN_ERR "Secondary post-mobility device tree " 304 if (rc)
312 "update failed: %d\n", rc);
313 } else {
314 printk(KERN_ERR "Post-mobility activate-fw failed: %d\n", rc); 305 printk(KERN_ERR "Post-mobility activate-fw failed: %d\n", rc);
315 return; 306
316 } 307 rc = pseries_devicetree_update(MIGRATION_SCOPE);
308 if (rc)
309 printk(KERN_ERR "Post-mobility device tree update "
310 "failed: %d\n", rc);
317 311
318 return; 312 return;
319} 313}
diff --git a/arch/powerpc/platforms/pseries/nvram.c b/arch/powerpc/platforms/pseries/nvram.c
index d7096f2f7751..0cc240b7f694 100644
--- a/arch/powerpc/platforms/pseries/nvram.c
+++ b/arch/powerpc/platforms/pseries/nvram.c
@@ -298,13 +298,13 @@ int nvram_write_os_partition(struct nvram_os_partition *part, char * buff,
298 298
299 rc = ppc_md.nvram_write((char *)&info, sizeof(struct err_log_info), &tmp_index); 299 rc = ppc_md.nvram_write((char *)&info, sizeof(struct err_log_info), &tmp_index);
300 if (rc <= 0) { 300 if (rc <= 0) {
301 pr_err("%s: Failed nvram_write (%d)\n", __FUNCTION__, rc); 301 pr_err("%s: Failed nvram_write (%d)\n", __func__, rc);
302 return rc; 302 return rc;
303 } 303 }
304 304
305 rc = ppc_md.nvram_write(buff, length, &tmp_index); 305 rc = ppc_md.nvram_write(buff, length, &tmp_index);
306 if (rc <= 0) { 306 if (rc <= 0) {
307 pr_err("%s: Failed nvram_write (%d)\n", __FUNCTION__, rc); 307 pr_err("%s: Failed nvram_write (%d)\n", __func__, rc);
308 return rc; 308 return rc;
309 } 309 }
310 310
@@ -351,15 +351,14 @@ int nvram_read_partition(struct nvram_os_partition *part, char *buff,
351 sizeof(struct err_log_info), 351 sizeof(struct err_log_info),
352 &tmp_index); 352 &tmp_index);
353 if (rc <= 0) { 353 if (rc <= 0) {
354 pr_err("%s: Failed nvram_read (%d)\n", __FUNCTION__, 354 pr_err("%s: Failed nvram_read (%d)\n", __func__, rc);
355 rc);
356 return rc; 355 return rc;
357 } 356 }
358 } 357 }
359 358
360 rc = ppc_md.nvram_read(buff, length, &tmp_index); 359 rc = ppc_md.nvram_read(buff, length, &tmp_index);
361 if (rc <= 0) { 360 if (rc <= 0) {
362 pr_err("%s: Failed nvram_read (%d)\n", __FUNCTION__, rc); 361 pr_err("%s: Failed nvram_read (%d)\n", __func__, rc);
363 return rc; 362 return rc;
364 } 363 }
365 364
@@ -869,7 +868,7 @@ static void oops_to_nvram(struct kmsg_dumper *dumper,
869 break; 868 break;
870 default: 869 default:
871 pr_err("%s: ignoring unrecognized KMSG_DUMP_* reason %d\n", 870 pr_err("%s: ignoring unrecognized KMSG_DUMP_* reason %d\n",
872 __FUNCTION__, (int) reason); 871 __func__, (int) reason);
873 return; 872 return;
874 } 873 }
875 874
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c
index efe61374f6ea..203cbf0dc101 100644
--- a/arch/powerpc/platforms/pseries/pci_dlpar.c
+++ b/arch/powerpc/platforms/pseries/pci_dlpar.c
@@ -37,15 +37,15 @@ find_bus_among_children(struct pci_bus *bus,
37 struct device_node *dn) 37 struct device_node *dn)
38{ 38{
39 struct pci_bus *child = NULL; 39 struct pci_bus *child = NULL;
40 struct list_head *tmp; 40 struct pci_bus *tmp;
41 struct device_node *busdn; 41 struct device_node *busdn;
42 42
43 busdn = pci_bus_to_OF_node(bus); 43 busdn = pci_bus_to_OF_node(bus);
44 if (busdn == dn) 44 if (busdn == dn)
45 return bus; 45 return bus;
46 46
47 list_for_each(tmp, &bus->children) { 47 list_for_each_entry(tmp, &bus->children, node) {
48 child = find_bus_among_children(pci_bus_b(tmp), dn); 48 child = find_bus_among_children(tmp, dn);
49 if (child) 49 if (child)
50 break; 50 break;
51 }; 51 };
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
index 721c0586b284..9c5778e6ed4b 100644
--- a/arch/powerpc/platforms/pseries/ras.c
+++ b/arch/powerpc/platforms/pseries/ras.c
@@ -236,7 +236,8 @@ static irqreturn_t ras_error_interrupt(int irq, void *dev_id)
236 236
237 rtas_elog = (struct rtas_error_log *)ras_log_buf; 237 rtas_elog = (struct rtas_error_log *)ras_log_buf;
238 238
239 if ((status == 0) && (rtas_elog->severity >= RTAS_SEVERITY_ERROR_SYNC)) 239 if (status == 0 &&
240 rtas_error_severity(rtas_elog) >= RTAS_SEVERITY_ERROR_SYNC)
240 fatal = 1; 241 fatal = 1;
241 else 242 else
242 fatal = 0; 243 fatal = 0;
@@ -300,13 +301,14 @@ static struct rtas_error_log *fwnmi_get_errinfo(struct pt_regs *regs)
300 301
301 /* If it isn't an extended log we can use the per cpu 64bit buffer */ 302 /* If it isn't an extended log we can use the per cpu 64bit buffer */
302 h = (struct rtas_error_log *)&savep[1]; 303 h = (struct rtas_error_log *)&savep[1];
303 if (!h->extended) { 304 if (!rtas_error_extended(h)) {
304 memcpy(&__get_cpu_var(mce_data_buf), h, sizeof(__u64)); 305 memcpy(&__get_cpu_var(mce_data_buf), h, sizeof(__u64));
305 errhdr = (struct rtas_error_log *)&__get_cpu_var(mce_data_buf); 306 errhdr = (struct rtas_error_log *)&__get_cpu_var(mce_data_buf);
306 } else { 307 } else {
307 int len; 308 int len, error_log_length;
308 309
309 len = max_t(int, 8+h->extended_log_length, RTAS_ERROR_LOG_MAX); 310 error_log_length = 8 + rtas_error_extended_log_length(h);
311 len = max_t(int, error_log_length, RTAS_ERROR_LOG_MAX);
310 memset(global_mce_data_buf, 0, RTAS_ERROR_LOG_MAX); 312 memset(global_mce_data_buf, 0, RTAS_ERROR_LOG_MAX);
311 memcpy(global_mce_data_buf, h, len); 313 memcpy(global_mce_data_buf, h, len);
312 errhdr = (struct rtas_error_log *)global_mce_data_buf; 314 errhdr = (struct rtas_error_log *)global_mce_data_buf;
@@ -350,23 +352,24 @@ int pSeries_system_reset_exception(struct pt_regs *regs)
350static int recover_mce(struct pt_regs *regs, struct rtas_error_log *err) 352static int recover_mce(struct pt_regs *regs, struct rtas_error_log *err)
351{ 353{
352 int recovered = 0; 354 int recovered = 0;
355 int disposition = rtas_error_disposition(err);
353 356
354 if (!(regs->msr & MSR_RI)) { 357 if (!(regs->msr & MSR_RI)) {
355 /* If MSR_RI isn't set, we cannot recover */ 358 /* If MSR_RI isn't set, we cannot recover */
356 recovered = 0; 359 recovered = 0;
357 360
358 } else if (err->disposition == RTAS_DISP_FULLY_RECOVERED) { 361 } else if (disposition == RTAS_DISP_FULLY_RECOVERED) {
359 /* Platform corrected itself */ 362 /* Platform corrected itself */
360 recovered = 1; 363 recovered = 1;
361 364
362 } else if (err->disposition == RTAS_DISP_LIMITED_RECOVERY) { 365 } else if (disposition == RTAS_DISP_LIMITED_RECOVERY) {
363 /* Platform corrected itself but could be degraded */ 366 /* Platform corrected itself but could be degraded */
364 printk(KERN_ERR "MCE: limited recovery, system may " 367 printk(KERN_ERR "MCE: limited recovery, system may "
365 "be degraded\n"); 368 "be degraded\n");
366 recovered = 1; 369 recovered = 1;
367 370
368 } else if (user_mode(regs) && !is_global_init(current) && 371 } else if (user_mode(regs) && !is_global_init(current) &&
369 err->severity == RTAS_SEVERITY_ERROR_SYNC) { 372 rtas_error_severity(err) == RTAS_SEVERITY_ERROR_SYNC) {
370 373
371 /* 374 /*
372 * If we received a synchronous error when in userspace 375 * If we received a synchronous error when in userspace
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c
index f93cdf55628c..0435bb65d0aa 100644
--- a/arch/powerpc/platforms/pseries/reconfig.c
+++ b/arch/powerpc/platforms/pseries/reconfig.c
@@ -12,7 +12,6 @@
12 */ 12 */
13 13
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/kref.h>
16#include <linux/notifier.h> 15#include <linux/notifier.h>
17#include <linux/proc_fs.h> 16#include <linux/proc_fs.h>
18#include <linux/slab.h> 17#include <linux/slab.h>
@@ -70,7 +69,6 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist
70 69
71 np->properties = proplist; 70 np->properties = proplist;
72 of_node_set_flag(np, OF_DYNAMIC); 71 of_node_set_flag(np, OF_DYNAMIC);
73 kref_init(&np->kref);
74 72
75 np->parent = derive_parent(path); 73 np->parent = derive_parent(path);
76 if (IS_ERR(np->parent)) { 74 if (IS_ERR(np->parent)) {
diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c
index 16a255255d30..b87b97849d4c 100644
--- a/arch/powerpc/platforms/pseries/suspend.c
+++ b/arch/powerpc/platforms/pseries/suspend.c
@@ -26,6 +26,7 @@
26#include <asm/mmu.h> 26#include <asm/mmu.h>
27#include <asm/rtas.h> 27#include <asm/rtas.h>
28#include <asm/topology.h> 28#include <asm/topology.h>
29#include "../../kernel/cacheinfo.h"
29 30
30static u64 stream_id; 31static u64 stream_id;
31static struct device suspend_dev; 32static struct device suspend_dev;
@@ -79,6 +80,23 @@ static int pseries_suspend_cpu(void)
79} 80}
80 81
81/** 82/**
83 * pseries_suspend_enable_irqs
84 *
85 * Post suspend configuration updates
86 *
87 **/
88static void pseries_suspend_enable_irqs(void)
89{
90 /*
91 * Update configuration which can be modified based on device tree
92 * changes during resume.
93 */
94 cacheinfo_cpu_offline(smp_processor_id());
95 post_mobility_fixup();
96 cacheinfo_cpu_online(smp_processor_id());
97}
98
99/**
82 * pseries_suspend_enter - Final phase of hibernation 100 * pseries_suspend_enter - Final phase of hibernation
83 * 101 *
84 * Return value: 102 * Return value:
@@ -174,7 +192,30 @@ out:
174 return rc; 192 return rc;
175} 193}
176 194
177static DEVICE_ATTR(hibernate, S_IWUSR, NULL, store_hibernate); 195#define USER_DT_UPDATE 0
196#define KERN_DT_UPDATE 1
197
198/**
199 * show_hibernate - Report device tree update responsibilty
200 * @dev: subsys root device
201 * @attr: device attribute struct
202 * @buf: buffer
203 *
204 * Report whether a device tree update is performed by the kernel after a
205 * resume, or if drmgr must coordinate the update from user space.
206 *
207 * Return value:
208 * 0 if drmgr is to initiate update, and 1 otherwise
209 **/
210static ssize_t show_hibernate(struct device *dev,
211 struct device_attribute *attr,
212 char *buf)
213{
214 return sprintf(buf, "%d\n", KERN_DT_UPDATE);
215}
216
217static DEVICE_ATTR(hibernate, S_IWUSR | S_IRUGO,
218 show_hibernate, store_hibernate);
178 219
179static struct bus_type suspend_subsys = { 220static struct bus_type suspend_subsys = {
180 .name = "power", 221 .name = "power",
@@ -235,6 +276,7 @@ static int __init pseries_suspend_init(void)
235 return rc; 276 return rc;
236 277
237 ppc_md.suspend_disable_cpu = pseries_suspend_cpu; 278 ppc_md.suspend_disable_cpu = pseries_suspend_cpu;
279 ppc_md.suspend_enable_irqs = pseries_suspend_enable_irqs;
238 suspend_set_ops(&pseries_suspend_ops); 280 suspend_set_ops(&pseries_suspend_ops);
239 return 0; 281 return 0;
240} 282}
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index f67ac900d870..afbcc37aa094 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -21,7 +21,6 @@ obj-$(CONFIG_FSL_SOC) += fsl_soc.o fsl_mpic_err.o
21obj-$(CONFIG_FSL_PCI) += fsl_pci.o $(fsl-msi-obj-y) 21obj-$(CONFIG_FSL_PCI) += fsl_pci.o $(fsl-msi-obj-y)
22obj-$(CONFIG_FSL_PMC) += fsl_pmc.o 22obj-$(CONFIG_FSL_PMC) += fsl_pmc.o
23obj-$(CONFIG_FSL_LBC) += fsl_lbc.o 23obj-$(CONFIG_FSL_LBC) += fsl_lbc.o
24obj-$(CONFIG_FSL_IFC) += fsl_ifc.o
25obj-$(CONFIG_FSL_GTM) += fsl_gtm.o 24obj-$(CONFIG_FSL_GTM) += fsl_gtm.o
26obj-$(CONFIG_FSL_85XX_CACHE_SRAM) += fsl_85xx_l2ctlr.o fsl_85xx_cache_sram.o 25obj-$(CONFIG_FSL_85XX_CACHE_SRAM) += fsl_85xx_l2ctlr.o fsl_85xx_cache_sram.o
27obj-$(CONFIG_SIMPLE_GPIO) += simple_gpio.o 26obj-$(CONFIG_SIMPLE_GPIO) += simple_gpio.o
diff --git a/arch/powerpc/sysdev/fsl_ifc.c b/arch/powerpc/sysdev/fsl_ifc.c
deleted file mode 100644
index fbc885b31946..000000000000
--- a/arch/powerpc/sysdev/fsl_ifc.c
+++ /dev/null
@@ -1,305 +0,0 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc
3 *
4 * Freescale Integrated Flash Controller
5 *
6 * Author: Dipen Dudhat <Dipen.Dudhat@freescale.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22#include <linux/module.h>
23#include <linux/kernel.h>
24#include <linux/compiler.h>
25#include <linux/spinlock.h>
26#include <linux/types.h>
27#include <linux/slab.h>
28#include <linux/io.h>
29#include <linux/of.h>
30#include <linux/of_device.h>
31#include <linux/platform_device.h>
32#include <asm/prom.h>
33#include <asm/fsl_ifc.h>
34
35struct fsl_ifc_ctrl *fsl_ifc_ctrl_dev;
36EXPORT_SYMBOL(fsl_ifc_ctrl_dev);
37
38/*
39 * convert_ifc_address - convert the base address
40 * @addr_base: base address of the memory bank
41 */
42unsigned int convert_ifc_address(phys_addr_t addr_base)
43{
44 return addr_base & CSPR_BA;
45}
46EXPORT_SYMBOL(convert_ifc_address);
47
48/*
49 * fsl_ifc_find - find IFC bank
50 * @addr_base: base address of the memory bank
51 *
52 * This function walks IFC banks comparing "Base address" field of the CSPR
53 * registers with the supplied addr_base argument. When bases match this
54 * function returns bank number (starting with 0), otherwise it returns
55 * appropriate errno value.
56 */
57int fsl_ifc_find(phys_addr_t addr_base)
58{
59 int i = 0;
60
61 if (!fsl_ifc_ctrl_dev || !fsl_ifc_ctrl_dev->regs)
62 return -ENODEV;
63
64 for (i = 0; i < ARRAY_SIZE(fsl_ifc_ctrl_dev->regs->cspr_cs); i++) {
65 u32 cspr = in_be32(&fsl_ifc_ctrl_dev->regs->cspr_cs[i].cspr);
66 if (cspr & CSPR_V && (cspr & CSPR_BA) ==
67 convert_ifc_address(addr_base))
68 return i;
69 }
70
71 return -ENOENT;
72}
73EXPORT_SYMBOL(fsl_ifc_find);
74
75static int fsl_ifc_ctrl_init(struct fsl_ifc_ctrl *ctrl)
76{
77 struct fsl_ifc_regs __iomem *ifc = ctrl->regs;
78
79 /*
80 * Clear all the common status and event registers
81 */
82 if (in_be32(&ifc->cm_evter_stat) & IFC_CM_EVTER_STAT_CSER)
83 out_be32(&ifc->cm_evter_stat, IFC_CM_EVTER_STAT_CSER);
84
85 /* enable all error and events */
86 out_be32(&ifc->cm_evter_en, IFC_CM_EVTER_EN_CSEREN);
87
88 /* enable all error and event interrupts */
89 out_be32(&ifc->cm_evter_intr_en, IFC_CM_EVTER_INTR_EN_CSERIREN);
90 out_be32(&ifc->cm_erattr0, 0x0);
91 out_be32(&ifc->cm_erattr1, 0x0);
92
93 return 0;
94}
95
96static int fsl_ifc_ctrl_remove(struct platform_device *dev)
97{
98 struct fsl_ifc_ctrl *ctrl = dev_get_drvdata(&dev->dev);
99
100 free_irq(ctrl->nand_irq, ctrl);
101 free_irq(ctrl->irq, ctrl);
102
103 irq_dispose_mapping(ctrl->nand_irq);
104 irq_dispose_mapping(ctrl->irq);
105
106 iounmap(ctrl->regs);
107
108 dev_set_drvdata(&dev->dev, NULL);
109 kfree(ctrl);
110
111 return 0;
112}
113
114/*
115 * NAND events are split between an operational interrupt which only
116 * receives OPC, and an error interrupt that receives everything else,
117 * including non-NAND errors. Whichever interrupt gets to it first
118 * records the status and wakes the wait queue.
119 */
120static DEFINE_SPINLOCK(nand_irq_lock);
121
122static u32 check_nand_stat(struct fsl_ifc_ctrl *ctrl)
123{
124 struct fsl_ifc_regs __iomem *ifc = ctrl->regs;
125 unsigned long flags;
126 u32 stat;
127
128 spin_lock_irqsave(&nand_irq_lock, flags);
129
130 stat = in_be32(&ifc->ifc_nand.nand_evter_stat);
131 if (stat) {
132 out_be32(&ifc->ifc_nand.nand_evter_stat, stat);
133 ctrl->nand_stat = stat;
134 wake_up(&ctrl->nand_wait);
135 }
136
137 spin_unlock_irqrestore(&nand_irq_lock, flags);
138
139 return stat;
140}
141
142static irqreturn_t fsl_ifc_nand_irq(int irqno, void *data)
143{
144 struct fsl_ifc_ctrl *ctrl = data;
145
146 if (check_nand_stat(ctrl))
147 return IRQ_HANDLED;
148
149 return IRQ_NONE;
150}
151
152/*
153 * NOTE: This interrupt is used to report ifc events of various kinds,
154 * such as transaction errors on the chipselects.
155 */
156static irqreturn_t fsl_ifc_ctrl_irq(int irqno, void *data)
157{
158 struct fsl_ifc_ctrl *ctrl = data;
159 struct fsl_ifc_regs __iomem *ifc = ctrl->regs;
160 u32 err_axiid, err_srcid, status, cs_err, err_addr;
161 irqreturn_t ret = IRQ_NONE;
162
163 /* read for chip select error */
164 cs_err = in_be32(&ifc->cm_evter_stat);
165 if (cs_err) {
166 dev_err(ctrl->dev, "transaction sent to IFC is not mapped to"
167 "any memory bank 0x%08X\n", cs_err);
168 /* clear the chip select error */
169 out_be32(&ifc->cm_evter_stat, IFC_CM_EVTER_STAT_CSER);
170
171 /* read error attribute registers print the error information */
172 status = in_be32(&ifc->cm_erattr0);
173 err_addr = in_be32(&ifc->cm_erattr1);
174
175 if (status & IFC_CM_ERATTR0_ERTYP_READ)
176 dev_err(ctrl->dev, "Read transaction error"
177 "CM_ERATTR0 0x%08X\n", status);
178 else
179 dev_err(ctrl->dev, "Write transaction error"
180 "CM_ERATTR0 0x%08X\n", status);
181
182 err_axiid = (status & IFC_CM_ERATTR0_ERAID) >>
183 IFC_CM_ERATTR0_ERAID_SHIFT;
184 dev_err(ctrl->dev, "AXI ID of the error"
185 "transaction 0x%08X\n", err_axiid);
186
187 err_srcid = (status & IFC_CM_ERATTR0_ESRCID) >>
188 IFC_CM_ERATTR0_ESRCID_SHIFT;
189 dev_err(ctrl->dev, "SRC ID of the error"
190 "transaction 0x%08X\n", err_srcid);
191
192 dev_err(ctrl->dev, "Transaction Address corresponding to error"
193 "ERADDR 0x%08X\n", err_addr);
194
195 ret = IRQ_HANDLED;
196 }
197
198 if (check_nand_stat(ctrl))
199 ret = IRQ_HANDLED;
200
201 return ret;
202}
203
204/*
205 * fsl_ifc_ctrl_probe
206 *
207 * called by device layer when it finds a device matching
208 * one our driver can handled. This code allocates all of
209 * the resources needed for the controller only. The
210 * resources for the NAND banks themselves are allocated
211 * in the chip probe function.
212*/
213static int fsl_ifc_ctrl_probe(struct platform_device *dev)
214{
215 int ret = 0;
216
217
218 dev_info(&dev->dev, "Freescale Integrated Flash Controller\n");
219
220 fsl_ifc_ctrl_dev = kzalloc(sizeof(*fsl_ifc_ctrl_dev), GFP_KERNEL);
221 if (!fsl_ifc_ctrl_dev)
222 return -ENOMEM;
223
224 dev_set_drvdata(&dev->dev, fsl_ifc_ctrl_dev);
225
226 /* IOMAP the entire IFC region */
227 fsl_ifc_ctrl_dev->regs = of_iomap(dev->dev.of_node, 0);
228 if (!fsl_ifc_ctrl_dev->regs) {
229 dev_err(&dev->dev, "failed to get memory region\n");
230 ret = -ENODEV;
231 goto err;
232 }
233
234 /* get the Controller level irq */
235 fsl_ifc_ctrl_dev->irq = irq_of_parse_and_map(dev->dev.of_node, 0);
236 if (fsl_ifc_ctrl_dev->irq == NO_IRQ) {
237 dev_err(&dev->dev, "failed to get irq resource "
238 "for IFC\n");
239 ret = -ENODEV;
240 goto err;
241 }
242
243 /* get the nand machine irq */
244 fsl_ifc_ctrl_dev->nand_irq =
245 irq_of_parse_and_map(dev->dev.of_node, 1);
246
247 fsl_ifc_ctrl_dev->dev = &dev->dev;
248
249 ret = fsl_ifc_ctrl_init(fsl_ifc_ctrl_dev);
250 if (ret < 0)
251 goto err;
252
253 init_waitqueue_head(&fsl_ifc_ctrl_dev->nand_wait);
254
255 ret = request_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_irq, IRQF_SHARED,
256 "fsl-ifc", fsl_ifc_ctrl_dev);
257 if (ret != 0) {
258 dev_err(&dev->dev, "failed to install irq (%d)\n",
259 fsl_ifc_ctrl_dev->irq);
260 goto err_irq;
261 }
262
263 if (fsl_ifc_ctrl_dev->nand_irq) {
264 ret = request_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_nand_irq,
265 0, "fsl-ifc-nand", fsl_ifc_ctrl_dev);
266 if (ret != 0) {
267 dev_err(&dev->dev, "failed to install irq (%d)\n",
268 fsl_ifc_ctrl_dev->nand_irq);
269 goto err_nandirq;
270 }
271 }
272
273 return 0;
274
275err_nandirq:
276 free_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_ctrl_dev);
277 irq_dispose_mapping(fsl_ifc_ctrl_dev->nand_irq);
278err_irq:
279 free_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_dev);
280 irq_dispose_mapping(fsl_ifc_ctrl_dev->irq);
281err:
282 return ret;
283}
284
285static const struct of_device_id fsl_ifc_match[] = {
286 {
287 .compatible = "fsl,ifc",
288 },
289 {},
290};
291
292static struct platform_driver fsl_ifc_ctrl_driver = {
293 .driver = {
294 .name = "fsl-ifc",
295 .of_match_table = fsl_ifc_match,
296 },
297 .probe = fsl_ifc_ctrl_probe,
298 .remove = fsl_ifc_ctrl_remove,
299};
300
301module_platform_driver(fsl_ifc_ctrl_driver);
302
303MODULE_LICENSE("GPL");
304MODULE_AUTHOR("Freescale Semiconductor");
305MODULE_DESCRIPTION("Freescale Integrated Flash Controller driver");
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index a625dcf26b2b..3f415e252ea5 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -22,10 +22,13 @@
22#include <linux/delay.h> 22#include <linux/delay.h>
23#include <linux/string.h> 23#include <linux/string.h>
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/interrupt.h>
25#include <linux/bootmem.h> 26#include <linux/bootmem.h>
26#include <linux/memblock.h> 27#include <linux/memblock.h>
27#include <linux/log2.h> 28#include <linux/log2.h>
28#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/suspend.h>
31#include <linux/syscore_ops.h>
29#include <linux/uaccess.h> 32#include <linux/uaccess.h>
30 33
31#include <asm/io.h> 34#include <asm/io.h>
@@ -868,6 +871,14 @@ u64 fsl_pci_immrbar_base(struct pci_controller *hose)
868 871
869 pci_bus_read_config_dword(hose->bus, 872 pci_bus_read_config_dword(hose->bus,
870 PCI_DEVFN(0, 0), PCI_BASE_ADDRESS_0, &base); 873 PCI_DEVFN(0, 0), PCI_BASE_ADDRESS_0, &base);
874
875 /*
876 * For PEXCSRBAR, bit 3-0 indicate prefetchable and
877 * address type. So when getting base address, these
878 * bits should be masked
879 */
880 base &= PCI_BASE_ADDRESS_MEM_MASK;
881
871 return base; 882 return base;
872 } 883 }
873#endif 884#endif
@@ -1086,55 +1097,171 @@ void fsl_pci_assign_primary(void)
1086 } 1097 }
1087} 1098}
1088 1099
1089static int fsl_pci_probe(struct platform_device *pdev) 1100#ifdef CONFIG_PM_SLEEP
1101static irqreturn_t fsl_pci_pme_handle(int irq, void *dev_id)
1090{ 1102{
1091 int ret; 1103 struct pci_controller *hose = dev_id;
1092 struct device_node *node; 1104 struct ccsr_pci __iomem *pci = hose->private_data;
1105 u32 dr;
1093 1106
1094 node = pdev->dev.of_node; 1107 dr = in_be32(&pci->pex_pme_mes_dr);
1095 ret = fsl_add_bridge(pdev, fsl_pci_primary == node); 1108 if (!dr)
1109 return IRQ_NONE;
1096 1110
1097 mpc85xx_pci_err_probe(pdev); 1111 out_be32(&pci->pex_pme_mes_dr, dr);
1098 1112
1099 return 0; 1113 return IRQ_HANDLED;
1100} 1114}
1101 1115
1102#ifdef CONFIG_PM 1116static int fsl_pci_pme_probe(struct pci_controller *hose)
1103static int fsl_pci_resume(struct device *dev)
1104{ 1117{
1105 struct pci_controller *hose; 1118 struct ccsr_pci __iomem *pci;
1106 struct resource pci_rsrc; 1119 struct pci_dev *dev;
1120 int pme_irq;
1121 int res;
1122 u16 pms;
1107 1123
1108 hose = pci_find_hose_for_OF_device(dev->of_node); 1124 /* Get hose's pci_dev */
1109 if (!hose) 1125 dev = list_first_entry(&hose->bus->devices, typeof(*dev), bus_list);
1110 return -ENODEV; 1126
1127 /* PME Disable */
1128 pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pms);
1129 pms &= ~PCI_PM_CTRL_PME_ENABLE;
1130 pci_write_config_word(dev, dev->pm_cap + PCI_PM_CTRL, pms);
1131
1132 pme_irq = irq_of_parse_and_map(hose->dn, 0);
1133 if (!pme_irq) {
1134 dev_err(&dev->dev, "Failed to map PME interrupt.\n");
1135
1136 return -ENXIO;
1137 }
1138
1139 res = devm_request_irq(hose->parent, pme_irq,
1140 fsl_pci_pme_handle,
1141 IRQF_SHARED,
1142 "[PCI] PME", hose);
1143 if (res < 0) {
1144 dev_err(&dev->dev, "Unable to requiest irq %d for PME\n", pme_irq);
1145 irq_dispose_mapping(pme_irq);
1111 1146
1112 if (of_address_to_resource(dev->of_node, 0, &pci_rsrc)) {
1113 dev_err(dev, "Get pci register base failed.");
1114 return -ENODEV; 1147 return -ENODEV;
1115 } 1148 }
1116 1149
1117 setup_pci_atmu(hose); 1150 pci = hose->private_data;
1151
1152 /* Enable PTOD, ENL23D & EXL23D */
1153 out_be32(&pci->pex_pme_mes_disr, 0);
1154 setbits32(&pci->pex_pme_mes_disr,
1155 PME_DISR_EN_PTOD | PME_DISR_EN_ENL23D | PME_DISR_EN_EXL23D);
1156
1157 out_be32(&pci->pex_pme_mes_ier, 0);
1158 setbits32(&pci->pex_pme_mes_ier,
1159 PME_DISR_EN_PTOD | PME_DISR_EN_ENL23D | PME_DISR_EN_EXL23D);
1160
1161 /* PME Enable */
1162 pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pms);
1163 pms |= PCI_PM_CTRL_PME_ENABLE;
1164 pci_write_config_word(dev, dev->pm_cap + PCI_PM_CTRL, pms);
1118 1165
1119 return 0; 1166 return 0;
1120} 1167}
1121 1168
1122static const struct dev_pm_ops pci_pm_ops = { 1169static void send_pme_turnoff_message(struct pci_controller *hose)
1123 .resume = fsl_pci_resume, 1170{
1124}; 1171 struct ccsr_pci __iomem *pci = hose->private_data;
1172 u32 dr;
1173 int i;
1125 1174
1126#define PCI_PM_OPS (&pci_pm_ops) 1175 /* Send PME_Turn_Off Message Request */
1176 setbits32(&pci->pex_pmcr, PEX_PMCR_PTOMR);
1127 1177
1128#else 1178 /* Wait trun off done */
1179 for (i = 0; i < 150; i++) {
1180 dr = in_be32(&pci->pex_pme_mes_dr);
1181 if (dr) {
1182 out_be32(&pci->pex_pme_mes_dr, dr);
1183 break;
1184 }
1185
1186 udelay(1000);
1187 }
1188}
1189
1190static void fsl_pci_syscore_do_suspend(struct pci_controller *hose)
1191{
1192 send_pme_turnoff_message(hose);
1193}
1194
1195static int fsl_pci_syscore_suspend(void)
1196{
1197 struct pci_controller *hose, *tmp;
1129 1198
1130#define PCI_PM_OPS NULL 1199 list_for_each_entry_safe(hose, tmp, &hose_list, list_node)
1200 fsl_pci_syscore_do_suspend(hose);
1131 1201
1202 return 0;
1203}
1204
1205static void fsl_pci_syscore_do_resume(struct pci_controller *hose)
1206{
1207 struct ccsr_pci __iomem *pci = hose->private_data;
1208 u32 dr;
1209 int i;
1210
1211 /* Send Exit L2 State Message */
1212 setbits32(&pci->pex_pmcr, PEX_PMCR_EXL2S);
1213
1214 /* Wait exit done */
1215 for (i = 0; i < 150; i++) {
1216 dr = in_be32(&pci->pex_pme_mes_dr);
1217 if (dr) {
1218 out_be32(&pci->pex_pme_mes_dr, dr);
1219 break;
1220 }
1221
1222 udelay(1000);
1223 }
1224
1225 setup_pci_atmu(hose);
1226}
1227
1228static void fsl_pci_syscore_resume(void)
1229{
1230 struct pci_controller *hose, *tmp;
1231
1232 list_for_each_entry_safe(hose, tmp, &hose_list, list_node)
1233 fsl_pci_syscore_do_resume(hose);
1234}
1235
1236static struct syscore_ops pci_syscore_pm_ops = {
1237 .suspend = fsl_pci_syscore_suspend,
1238 .resume = fsl_pci_syscore_resume,
1239};
1132#endif 1240#endif
1133 1241
1242void fsl_pcibios_fixup_phb(struct pci_controller *phb)
1243{
1244#ifdef CONFIG_PM_SLEEP
1245 fsl_pci_pme_probe(phb);
1246#endif
1247}
1248
1249static int fsl_pci_probe(struct platform_device *pdev)
1250{
1251 struct device_node *node;
1252 int ret;
1253
1254 node = pdev->dev.of_node;
1255 ret = fsl_add_bridge(pdev, fsl_pci_primary == node);
1256
1257 mpc85xx_pci_err_probe(pdev);
1258
1259 return 0;
1260}
1261
1134static struct platform_driver fsl_pci_driver = { 1262static struct platform_driver fsl_pci_driver = {
1135 .driver = { 1263 .driver = {
1136 .name = "fsl-pci", 1264 .name = "fsl-pci",
1137 .pm = PCI_PM_OPS,
1138 .of_match_table = pci_ids, 1265 .of_match_table = pci_ids,
1139 }, 1266 },
1140 .probe = fsl_pci_probe, 1267 .probe = fsl_pci_probe,
@@ -1142,6 +1269,9 @@ static struct platform_driver fsl_pci_driver = {
1142 1269
1143static int __init fsl_pci_init(void) 1270static int __init fsl_pci_init(void)
1144{ 1271{
1272#ifdef CONFIG_PM_SLEEP
1273 register_syscore_ops(&pci_syscore_pm_ops);
1274#endif
1145 return platform_driver_register(&fsl_pci_driver); 1275 return platform_driver_register(&fsl_pci_driver);
1146} 1276}
1147arch_initcall(fsl_pci_init); 1277arch_initcall(fsl_pci_init);
diff --git a/arch/powerpc/sysdev/fsl_pci.h b/arch/powerpc/sysdev/fsl_pci.h
index 8d455df58471..c1cec771d5ea 100644
--- a/arch/powerpc/sysdev/fsl_pci.h
+++ b/arch/powerpc/sysdev/fsl_pci.h
@@ -32,6 +32,13 @@ struct platform_device;
32#define PIWAR_WRITE_SNOOP 0x00005000 32#define PIWAR_WRITE_SNOOP 0x00005000
33#define PIWAR_SZ_MASK 0x0000003f 33#define PIWAR_SZ_MASK 0x0000003f
34 34
35#define PEX_PMCR_PTOMR 0x1
36#define PEX_PMCR_EXL2S 0x2
37
38#define PME_DISR_EN_PTOD 0x00008000
39#define PME_DISR_EN_ENL23D 0x00002000
40#define PME_DISR_EN_EXL23D 0x00001000
41
35/* PCI/PCI Express outbound window reg */ 42/* PCI/PCI Express outbound window reg */
36struct pci_outbound_window_regs { 43struct pci_outbound_window_regs {
37 __be32 potar; /* 0x.0 - Outbound translation address register */ 44 __be32 potar; /* 0x.0 - Outbound translation address register */
@@ -111,6 +118,7 @@ struct ccsr_pci {
111 118
112extern int fsl_add_bridge(struct platform_device *pdev, int is_primary); 119extern int fsl_add_bridge(struct platform_device *pdev, int is_primary);
113extern void fsl_pcibios_fixup_bus(struct pci_bus *bus); 120extern void fsl_pcibios_fixup_bus(struct pci_bus *bus);
121extern void fsl_pcibios_fixup_phb(struct pci_controller *phb);
114extern int mpc83xx_add_bridge(struct device_node *dev); 122extern int mpc83xx_add_bridge(struct device_node *dev);
115u64 fsl_pci_immrbar_base(struct pci_controller *hose); 123u64 fsl_pci_immrbar_base(struct pci_controller *hose);
116 124
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index 95dd892e9904..cf2b0840a672 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -531,6 +531,7 @@ int fsl_rio_setup(struct platform_device *dev)
531 sprintf(port->name, "RIO mport %d", i); 531 sprintf(port->name, "RIO mport %d", i);
532 532
533 priv->dev = &dev->dev; 533 priv->dev = &dev->dev;
534 port->dev.parent = &dev->dev;
534 port->ops = ops; 535 port->ops = ops;
535 port->priv = priv; 536 port->priv = priv;
536 port->phys_efptr = 0x100; 537 port->phys_efptr = 0x100;
diff --git a/arch/powerpc/sysdev/msi_bitmap.c b/arch/powerpc/sysdev/msi_bitmap.c
index 0968b66b4cf9..2ff630267e9e 100644
--- a/arch/powerpc/sysdev/msi_bitmap.c
+++ b/arch/powerpc/sysdev/msi_bitmap.c
@@ -202,7 +202,7 @@ void __init test_of_node(void)
202 202
203 /* There should really be a struct device_node allocator */ 203 /* There should really be a struct device_node allocator */
204 memset(&of_node, 0, sizeof(of_node)); 204 memset(&of_node, 0, sizeof(of_node));
205 kref_init(&of_node.kref); 205 of_node_init(&of_node);
206 of_node.full_name = node_name; 206 of_node.full_name = node_name;
207 207
208 check(0 == msi_bitmap_alloc(&bmp, size, &of_node)); 208 check(0 == msi_bitmap_alloc(&bmp, size, &of_node));
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index b07909850f77..08504e75b2c7 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -171,7 +171,11 @@ extern void xmon_leave(void);
171#define REG "%.8lx" 171#define REG "%.8lx"
172#endif 172#endif
173 173
174#ifdef __LITTLE_ENDIAN__
175#define GETWORD(v) (((v)[3] << 24) + ((v)[2] << 16) + ((v)[1] << 8) + (v)[0])
176#else
174#define GETWORD(v) (((v)[0] << 24) + ((v)[1] << 16) + ((v)[2] << 8) + (v)[3]) 177#define GETWORD(v) (((v)[0] << 24) + ((v)[1] << 16) + ((v)[2] << 8) + (v)[3])
178#endif
175 179
176#define isxdigit(c) (('0' <= (c) && (c) <= '9') \ 180#define isxdigit(c) (('0' <= (c) && (c) <= '9') \
177 || ('a' <= (c) && (c) <= 'f') \ 181 || ('a' <= (c) && (c) <= 'f') \
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 953f17c8d17c..d68fe34799b0 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -52,7 +52,7 @@ config KEXEC
52config AUDIT_ARCH 52config AUDIT_ARCH
53 def_bool y 53 def_bool y
54 54
55config NO_IOPORT 55config NO_IOPORT_MAP
56 def_bool y 56 def_bool y
57 57
58config PCI_QUIRKS 58config PCI_QUIRKS
@@ -103,6 +103,7 @@ config S390
103 select GENERIC_SMP_IDLE_THREAD 103 select GENERIC_SMP_IDLE_THREAD
104 select GENERIC_TIME_VSYSCALL 104 select GENERIC_TIME_VSYSCALL
105 select HAVE_ALIGNED_STRUCT_PAGE if SLUB 105 select HAVE_ALIGNED_STRUCT_PAGE if SLUB
106 select HAVE_ARCH_AUDITSYSCALL
106 select HAVE_ARCH_JUMP_LABEL if !MARCH_G5 107 select HAVE_ARCH_JUMP_LABEL if !MARCH_G5
107 select HAVE_ARCH_SECCOMP_FILTER 108 select HAVE_ARCH_SECCOMP_FILTER
108 select HAVE_ARCH_TRACEHOOK 109 select HAVE_ARCH_TRACEHOOK
diff --git a/arch/s390/configs/default_defconfig b/arch/s390/configs/default_defconfig
index ddaae2f5c913..8df022c43af7 100644
--- a/arch/s390/configs/default_defconfig
+++ b/arch/s390/configs/default_defconfig
@@ -581,7 +581,6 @@ CONFIG_LOCK_STAT=y
581CONFIG_DEBUG_LOCKDEP=y 581CONFIG_DEBUG_LOCKDEP=y
582CONFIG_DEBUG_ATOMIC_SLEEP=y 582CONFIG_DEBUG_ATOMIC_SLEEP=y
583CONFIG_DEBUG_LOCKING_API_SELFTESTS=y 583CONFIG_DEBUG_LOCKING_API_SELFTESTS=y
584CONFIG_DEBUG_WRITECOUNT=y
585CONFIG_DEBUG_LIST=y 584CONFIG_DEBUG_LIST=y
586CONFIG_DEBUG_SG=y 585CONFIG_DEBUG_SG=y
587CONFIG_DEBUG_NOTIFIERS=y 586CONFIG_DEBUG_NOTIFIERS=y
diff --git a/arch/s390/include/asm/atomic.h b/arch/s390/include/asm/atomic.h
index fa9aaf7144b7..1d4706114a45 100644
--- a/arch/s390/include/asm/atomic.h
+++ b/arch/s390/include/asm/atomic.h
@@ -15,23 +15,29 @@
15 15
16#include <linux/compiler.h> 16#include <linux/compiler.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <asm/barrier.h>
18#include <asm/cmpxchg.h> 19#include <asm/cmpxchg.h>
19 20
20#define ATOMIC_INIT(i) { (i) } 21#define ATOMIC_INIT(i) { (i) }
21 22
23#define __ATOMIC_NO_BARRIER "\n"
24
22#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES 25#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
23 26
24#define __ATOMIC_OR "lao" 27#define __ATOMIC_OR "lao"
25#define __ATOMIC_AND "lan" 28#define __ATOMIC_AND "lan"
26#define __ATOMIC_ADD "laa" 29#define __ATOMIC_ADD "laa"
30#define __ATOMIC_BARRIER "bcr 14,0\n"
27 31
28#define __ATOMIC_LOOP(ptr, op_val, op_string) \ 32#define __ATOMIC_LOOP(ptr, op_val, op_string, __barrier) \
29({ \ 33({ \
30 int old_val; \ 34 int old_val; \
31 \ 35 \
32 typecheck(atomic_t *, ptr); \ 36 typecheck(atomic_t *, ptr); \
33 asm volatile( \ 37 asm volatile( \
38 __barrier \
34 op_string " %0,%2,%1\n" \ 39 op_string " %0,%2,%1\n" \
40 __barrier \
35 : "=d" (old_val), "+Q" ((ptr)->counter) \ 41 : "=d" (old_val), "+Q" ((ptr)->counter) \
36 : "d" (op_val) \ 42 : "d" (op_val) \
37 : "cc", "memory"); \ 43 : "cc", "memory"); \
@@ -43,8 +49,9 @@
43#define __ATOMIC_OR "or" 49#define __ATOMIC_OR "or"
44#define __ATOMIC_AND "nr" 50#define __ATOMIC_AND "nr"
45#define __ATOMIC_ADD "ar" 51#define __ATOMIC_ADD "ar"
52#define __ATOMIC_BARRIER "\n"
46 53
47#define __ATOMIC_LOOP(ptr, op_val, op_string) \ 54#define __ATOMIC_LOOP(ptr, op_val, op_string, __barrier) \
48({ \ 55({ \
49 int old_val, new_val; \ 56 int old_val, new_val; \
50 \ 57 \
@@ -82,7 +89,7 @@ static inline void atomic_set(atomic_t *v, int i)
82 89
83static inline int atomic_add_return(int i, atomic_t *v) 90static inline int atomic_add_return(int i, atomic_t *v)
84{ 91{
85 return __ATOMIC_LOOP(v, i, __ATOMIC_ADD) + i; 92 return __ATOMIC_LOOP(v, i, __ATOMIC_ADD, __ATOMIC_BARRIER) + i;
86} 93}
87 94
88static inline void atomic_add(int i, atomic_t *v) 95static inline void atomic_add(int i, atomic_t *v)
@@ -94,12 +101,10 @@ static inline void atomic_add(int i, atomic_t *v)
94 : "+Q" (v->counter) 101 : "+Q" (v->counter)
95 : "i" (i) 102 : "i" (i)
96 : "cc", "memory"); 103 : "cc", "memory");
97 } else { 104 return;
98 atomic_add_return(i, v);
99 } 105 }
100#else
101 atomic_add_return(i, v);
102#endif 106#endif
107 __ATOMIC_LOOP(v, i, __ATOMIC_ADD, __ATOMIC_NO_BARRIER);
103} 108}
104 109
105#define atomic_add_negative(_i, _v) (atomic_add_return(_i, _v) < 0) 110#define atomic_add_negative(_i, _v) (atomic_add_return(_i, _v) < 0)
@@ -115,12 +120,12 @@ static inline void atomic_add(int i, atomic_t *v)
115 120
116static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) 121static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
117{ 122{
118 __ATOMIC_LOOP(v, ~mask, __ATOMIC_AND); 123 __ATOMIC_LOOP(v, ~mask, __ATOMIC_AND, __ATOMIC_NO_BARRIER);
119} 124}
120 125
121static inline void atomic_set_mask(unsigned int mask, atomic_t *v) 126static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
122{ 127{
123 __ATOMIC_LOOP(v, mask, __ATOMIC_OR); 128 __ATOMIC_LOOP(v, mask, __ATOMIC_OR, __ATOMIC_NO_BARRIER);
124} 129}
125 130
126#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) 131#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
@@ -157,19 +162,24 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
157 162
158#ifdef CONFIG_64BIT 163#ifdef CONFIG_64BIT
159 164
165#define __ATOMIC64_NO_BARRIER "\n"
166
160#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES 167#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
161 168
162#define __ATOMIC64_OR "laog" 169#define __ATOMIC64_OR "laog"
163#define __ATOMIC64_AND "lang" 170#define __ATOMIC64_AND "lang"
164#define __ATOMIC64_ADD "laag" 171#define __ATOMIC64_ADD "laag"
172#define __ATOMIC64_BARRIER "bcr 14,0\n"
165 173
166#define __ATOMIC64_LOOP(ptr, op_val, op_string) \ 174#define __ATOMIC64_LOOP(ptr, op_val, op_string, __barrier) \
167({ \ 175({ \
168 long long old_val; \ 176 long long old_val; \
169 \ 177 \
170 typecheck(atomic64_t *, ptr); \ 178 typecheck(atomic64_t *, ptr); \
171 asm volatile( \ 179 asm volatile( \
180 __barrier \
172 op_string " %0,%2,%1\n" \ 181 op_string " %0,%2,%1\n" \
182 __barrier \
173 : "=d" (old_val), "+Q" ((ptr)->counter) \ 183 : "=d" (old_val), "+Q" ((ptr)->counter) \
174 : "d" (op_val) \ 184 : "d" (op_val) \
175 : "cc", "memory"); \ 185 : "cc", "memory"); \
@@ -181,8 +191,9 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
181#define __ATOMIC64_OR "ogr" 191#define __ATOMIC64_OR "ogr"
182#define __ATOMIC64_AND "ngr" 192#define __ATOMIC64_AND "ngr"
183#define __ATOMIC64_ADD "agr" 193#define __ATOMIC64_ADD "agr"
194#define __ATOMIC64_BARRIER "\n"
184 195
185#define __ATOMIC64_LOOP(ptr, op_val, op_string) \ 196#define __ATOMIC64_LOOP(ptr, op_val, op_string, __barrier) \
186({ \ 197({ \
187 long long old_val, new_val; \ 198 long long old_val, new_val; \
188 \ 199 \
@@ -220,17 +231,32 @@ static inline void atomic64_set(atomic64_t *v, long long i)
220 231
221static inline long long atomic64_add_return(long long i, atomic64_t *v) 232static inline long long atomic64_add_return(long long i, atomic64_t *v)
222{ 233{
223 return __ATOMIC64_LOOP(v, i, __ATOMIC64_ADD) + i; 234 return __ATOMIC64_LOOP(v, i, __ATOMIC64_ADD, __ATOMIC64_BARRIER) + i;
235}
236
237static inline void atomic64_add(long long i, atomic64_t *v)
238{
239#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
240 if (__builtin_constant_p(i) && (i > -129) && (i < 128)) {
241 asm volatile(
242 "agsi %0,%1\n"
243 : "+Q" (v->counter)
244 : "i" (i)
245 : "cc", "memory");
246 return;
247 }
248#endif
249 __ATOMIC64_LOOP(v, i, __ATOMIC64_ADD, __ATOMIC64_NO_BARRIER);
224} 250}
225 251
226static inline void atomic64_clear_mask(unsigned long mask, atomic64_t *v) 252static inline void atomic64_clear_mask(unsigned long mask, atomic64_t *v)
227{ 253{
228 __ATOMIC64_LOOP(v, ~mask, __ATOMIC64_AND); 254 __ATOMIC64_LOOP(v, ~mask, __ATOMIC64_AND, __ATOMIC64_NO_BARRIER);
229} 255}
230 256
231static inline void atomic64_set_mask(unsigned long mask, atomic64_t *v) 257static inline void atomic64_set_mask(unsigned long mask, atomic64_t *v)
232{ 258{
233 __ATOMIC64_LOOP(v, mask, __ATOMIC64_OR); 259 __ATOMIC64_LOOP(v, mask, __ATOMIC64_OR, __ATOMIC64_NO_BARRIER);
234} 260}
235 261
236#define atomic64_xchg(v, new) (xchg(&((v)->counter), new)) 262#define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
@@ -334,25 +360,13 @@ static inline void atomic64_clear_mask(unsigned long long mask, atomic64_t *v)
334 } while (atomic64_cmpxchg(v, old, new) != old); 360 } while (atomic64_cmpxchg(v, old, new) != old);
335} 361}
336 362
337#endif /* CONFIG_64BIT */
338
339static inline void atomic64_add(long long i, atomic64_t *v) 363static inline void atomic64_add(long long i, atomic64_t *v)
340{ 364{
341#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
342 if (__builtin_constant_p(i) && (i > -129) && (i < 128)) {
343 asm volatile(
344 "agsi %0,%1\n"
345 : "+Q" (v->counter)
346 : "i" (i)
347 : "cc", "memory");
348 } else {
349 atomic64_add_return(i, v);
350 }
351#else
352 atomic64_add_return(i, v); 365 atomic64_add_return(i, v);
353#endif
354} 366}
355 367
368#endif /* CONFIG_64BIT */
369
356static inline int atomic64_add_unless(atomic64_t *v, long long i, long long u) 370static inline int atomic64_add_unless(atomic64_t *v, long long i, long long u)
357{ 371{
358 long long c, old; 372 long long c, old;
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h
index ec5ef891db6b..520542477678 100644
--- a/arch/s390/include/asm/bitops.h
+++ b/arch/s390/include/asm/bitops.h
@@ -47,14 +47,18 @@
47 47
48#include <linux/typecheck.h> 48#include <linux/typecheck.h>
49#include <linux/compiler.h> 49#include <linux/compiler.h>
50#include <asm/barrier.h>
51
52#define __BITOPS_NO_BARRIER "\n"
50 53
51#ifndef CONFIG_64BIT 54#ifndef CONFIG_64BIT
52 55
53#define __BITOPS_OR "or" 56#define __BITOPS_OR "or"
54#define __BITOPS_AND "nr" 57#define __BITOPS_AND "nr"
55#define __BITOPS_XOR "xr" 58#define __BITOPS_XOR "xr"
59#define __BITOPS_BARRIER "\n"
56 60
57#define __BITOPS_LOOP(__addr, __val, __op_string) \ 61#define __BITOPS_LOOP(__addr, __val, __op_string, __barrier) \
58({ \ 62({ \
59 unsigned long __old, __new; \ 63 unsigned long __old, __new; \
60 \ 64 \
@@ -67,7 +71,7 @@
67 " jl 0b" \ 71 " jl 0b" \
68 : "=&d" (__old), "=&d" (__new), "+Q" (*(__addr))\ 72 : "=&d" (__old), "=&d" (__new), "+Q" (*(__addr))\
69 : "d" (__val) \ 73 : "d" (__val) \
70 : "cc"); \ 74 : "cc", "memory"); \
71 __old; \ 75 __old; \
72}) 76})
73 77
@@ -78,17 +82,20 @@
78#define __BITOPS_OR "laog" 82#define __BITOPS_OR "laog"
79#define __BITOPS_AND "lang" 83#define __BITOPS_AND "lang"
80#define __BITOPS_XOR "laxg" 84#define __BITOPS_XOR "laxg"
85#define __BITOPS_BARRIER "bcr 14,0\n"
81 86
82#define __BITOPS_LOOP(__addr, __val, __op_string) \ 87#define __BITOPS_LOOP(__addr, __val, __op_string, __barrier) \
83({ \ 88({ \
84 unsigned long __old; \ 89 unsigned long __old; \
85 \ 90 \
86 typecheck(unsigned long *, (__addr)); \ 91 typecheck(unsigned long *, (__addr)); \
87 asm volatile( \ 92 asm volatile( \
93 __barrier \
88 __op_string " %0,%2,%1\n" \ 94 __op_string " %0,%2,%1\n" \
95 __barrier \
89 : "=d" (__old), "+Q" (*(__addr)) \ 96 : "=d" (__old), "+Q" (*(__addr)) \
90 : "d" (__val) \ 97 : "d" (__val) \
91 : "cc"); \ 98 : "cc", "memory"); \
92 __old; \ 99 __old; \
93}) 100})
94 101
@@ -97,8 +104,9 @@
97#define __BITOPS_OR "ogr" 104#define __BITOPS_OR "ogr"
98#define __BITOPS_AND "ngr" 105#define __BITOPS_AND "ngr"
99#define __BITOPS_XOR "xgr" 106#define __BITOPS_XOR "xgr"
107#define __BITOPS_BARRIER "\n"
100 108
101#define __BITOPS_LOOP(__addr, __val, __op_string) \ 109#define __BITOPS_LOOP(__addr, __val, __op_string, __barrier) \
102({ \ 110({ \
103 unsigned long __old, __new; \ 111 unsigned long __old, __new; \
104 \ 112 \
@@ -111,7 +119,7 @@
111 " jl 0b" \ 119 " jl 0b" \
112 : "=&d" (__old), "=&d" (__new), "+Q" (*(__addr))\ 120 : "=&d" (__old), "=&d" (__new), "+Q" (*(__addr))\
113 : "d" (__val) \ 121 : "d" (__val) \
114 : "cc"); \ 122 : "cc", "memory"); \
115 __old; \ 123 __old; \
116}) 124})
117 125
@@ -149,12 +157,12 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *ptr)
149 "oi %0,%b1\n" 157 "oi %0,%b1\n"
150 : "+Q" (*caddr) 158 : "+Q" (*caddr)
151 : "i" (1 << (nr & 7)) 159 : "i" (1 << (nr & 7))
152 : "cc"); 160 : "cc", "memory");
153 return; 161 return;
154 } 162 }
155#endif 163#endif
156 mask = 1UL << (nr & (BITS_PER_LONG - 1)); 164 mask = 1UL << (nr & (BITS_PER_LONG - 1));
157 __BITOPS_LOOP(addr, mask, __BITOPS_OR); 165 __BITOPS_LOOP(addr, mask, __BITOPS_OR, __BITOPS_NO_BARRIER);
158} 166}
159 167
160static inline void clear_bit(unsigned long nr, volatile unsigned long *ptr) 168static inline void clear_bit(unsigned long nr, volatile unsigned long *ptr)
@@ -170,12 +178,12 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *ptr)
170 "ni %0,%b1\n" 178 "ni %0,%b1\n"
171 : "+Q" (*caddr) 179 : "+Q" (*caddr)
172 : "i" (~(1 << (nr & 7))) 180 : "i" (~(1 << (nr & 7)))
173 : "cc"); 181 : "cc", "memory");
174 return; 182 return;
175 } 183 }
176#endif 184#endif
177 mask = ~(1UL << (nr & (BITS_PER_LONG - 1))); 185 mask = ~(1UL << (nr & (BITS_PER_LONG - 1)));
178 __BITOPS_LOOP(addr, mask, __BITOPS_AND); 186 __BITOPS_LOOP(addr, mask, __BITOPS_AND, __BITOPS_NO_BARRIER);
179} 187}
180 188
181static inline void change_bit(unsigned long nr, volatile unsigned long *ptr) 189static inline void change_bit(unsigned long nr, volatile unsigned long *ptr)
@@ -191,12 +199,12 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *ptr)
191 "xi %0,%b1\n" 199 "xi %0,%b1\n"
192 : "+Q" (*caddr) 200 : "+Q" (*caddr)
193 : "i" (1 << (nr & 7)) 201 : "i" (1 << (nr & 7))
194 : "cc"); 202 : "cc", "memory");
195 return; 203 return;
196 } 204 }
197#endif 205#endif
198 mask = 1UL << (nr & (BITS_PER_LONG - 1)); 206 mask = 1UL << (nr & (BITS_PER_LONG - 1));
199 __BITOPS_LOOP(addr, mask, __BITOPS_XOR); 207 __BITOPS_LOOP(addr, mask, __BITOPS_XOR, __BITOPS_NO_BARRIER);
200} 208}
201 209
202static inline int 210static inline int
@@ -206,8 +214,7 @@ test_and_set_bit(unsigned long nr, volatile unsigned long *ptr)
206 unsigned long old, mask; 214 unsigned long old, mask;
207 215
208 mask = 1UL << (nr & (BITS_PER_LONG - 1)); 216 mask = 1UL << (nr & (BITS_PER_LONG - 1));
209 old = __BITOPS_LOOP(addr, mask, __BITOPS_OR); 217 old = __BITOPS_LOOP(addr, mask, __BITOPS_OR, __BITOPS_BARRIER);
210 barrier();
211 return (old & mask) != 0; 218 return (old & mask) != 0;
212} 219}
213 220
@@ -218,8 +225,7 @@ test_and_clear_bit(unsigned long nr, volatile unsigned long *ptr)
218 unsigned long old, mask; 225 unsigned long old, mask;
219 226
220 mask = ~(1UL << (nr & (BITS_PER_LONG - 1))); 227 mask = ~(1UL << (nr & (BITS_PER_LONG - 1)));
221 old = __BITOPS_LOOP(addr, mask, __BITOPS_AND); 228 old = __BITOPS_LOOP(addr, mask, __BITOPS_AND, __BITOPS_BARRIER);
222 barrier();
223 return (old & ~mask) != 0; 229 return (old & ~mask) != 0;
224} 230}
225 231
@@ -230,8 +236,7 @@ test_and_change_bit(unsigned long nr, volatile unsigned long *ptr)
230 unsigned long old, mask; 236 unsigned long old, mask;
231 237
232 mask = 1UL << (nr & (BITS_PER_LONG - 1)); 238 mask = 1UL << (nr & (BITS_PER_LONG - 1));
233 old = __BITOPS_LOOP(addr, mask, __BITOPS_XOR); 239 old = __BITOPS_LOOP(addr, mask, __BITOPS_XOR, __BITOPS_BARRIER);
234 barrier();
235 return (old & mask) != 0; 240 return (old & mask) != 0;
236} 241}
237 242
diff --git a/arch/s390/include/asm/ccwgroup.h b/arch/s390/include/asm/ccwgroup.h
index 23723ce5ca7a..6e670f88d125 100644
--- a/arch/s390/include/asm/ccwgroup.h
+++ b/arch/s390/include/asm/ccwgroup.h
@@ -23,6 +23,7 @@ struct ccwgroup_device {
23 unsigned int count; 23 unsigned int count;
24 struct device dev; 24 struct device dev;
25 struct ccw_device *cdev[0]; 25 struct ccw_device *cdev[0];
26 struct work_struct ungroup_work;
26}; 27};
27 28
28/** 29/**
diff --git a/arch/s390/include/asm/cio.h b/arch/s390/include/asm/cio.h
index d42625053c37..096339207764 100644
--- a/arch/s390/include/asm/cio.h
+++ b/arch/s390/include/asm/cio.h
@@ -199,7 +199,7 @@ struct esw_eadm {
199/** 199/**
200 * struct irb - interruption response block 200 * struct irb - interruption response block
201 * @scsw: subchannel status word 201 * @scsw: subchannel status word
202 * @esw: extened status word 202 * @esw: extended status word
203 * @ecw: extended control word 203 * @ecw: extended control word
204 * 204 *
205 * The irb that is handed to the device driver when an interrupt occurs. For 205 * The irb that is handed to the device driver when an interrupt occurs. For
diff --git a/arch/s390/include/asm/futex.h b/arch/s390/include/asm/futex.h
index fda46bd38c99..69cf5b5eddc9 100644
--- a/arch/s390/include/asm/futex.h
+++ b/arch/s390/include/asm/futex.h
@@ -1,12 +1,25 @@
1#ifndef _ASM_S390_FUTEX_H 1#ifndef _ASM_S390_FUTEX_H
2#define _ASM_S390_FUTEX_H 2#define _ASM_S390_FUTEX_H
3 3
4#include <linux/futex.h>
5#include <linux/uaccess.h> 4#include <linux/uaccess.h>
5#include <linux/futex.h>
6#include <asm/mmu_context.h>
6#include <asm/errno.h> 7#include <asm/errno.h>
7 8
8int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, u32 oldval, u32 newval); 9#define __futex_atomic_op(insn, ret, oldval, newval, uaddr, oparg) \
9int __futex_atomic_op_inuser(int op, u32 __user *uaddr, int oparg, int *old); 10 asm volatile( \
11 " sacf 256\n" \
12 "0: l %1,0(%6)\n" \
13 "1:"insn \
14 "2: cs %1,%2,0(%6)\n" \
15 "3: jl 1b\n" \
16 " lhi %0,0\n" \
17 "4: sacf 768\n" \
18 EX_TABLE(0b,4b) EX_TABLE(2b,4b) EX_TABLE(3b,4b) \
19 : "=d" (ret), "=&d" (oldval), "=&d" (newval), \
20 "=m" (*uaddr) \
21 : "0" (-EFAULT), "d" (oparg), "a" (uaddr), \
22 "m" (*uaddr) : "cc");
10 23
11static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr) 24static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr)
12{ 25{
@@ -14,13 +27,37 @@ static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr)
14 int cmp = (encoded_op >> 24) & 15; 27 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20; 28 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20; 29 int cmparg = (encoded_op << 20) >> 20;
17 int oldval, ret; 30 int oldval = 0, newval, ret;
18 31
32 update_primary_asce(current);
19 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) 33 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
20 oparg = 1 << oparg; 34 oparg = 1 << oparg;
21 35
22 pagefault_disable(); 36 pagefault_disable();
23 ret = __futex_atomic_op_inuser(op, uaddr, oparg, &oldval); 37 switch (op) {
38 case FUTEX_OP_SET:
39 __futex_atomic_op("lr %2,%5\n",
40 ret, oldval, newval, uaddr, oparg);
41 break;
42 case FUTEX_OP_ADD:
43 __futex_atomic_op("lr %2,%1\nar %2,%5\n",
44 ret, oldval, newval, uaddr, oparg);
45 break;
46 case FUTEX_OP_OR:
47 __futex_atomic_op("lr %2,%1\nor %2,%5\n",
48 ret, oldval, newval, uaddr, oparg);
49 break;
50 case FUTEX_OP_ANDN:
51 __futex_atomic_op("lr %2,%1\nnr %2,%5\n",
52 ret, oldval, newval, uaddr, oparg);
53 break;
54 case FUTEX_OP_XOR:
55 __futex_atomic_op("lr %2,%1\nxr %2,%5\n",
56 ret, oldval, newval, uaddr, oparg);
57 break;
58 default:
59 ret = -ENOSYS;
60 }
24 pagefault_enable(); 61 pagefault_enable();
25 62
26 if (!ret) { 63 if (!ret) {
@@ -37,4 +74,23 @@ static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr)
37 return ret; 74 return ret;
38} 75}
39 76
77static inline int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
78 u32 oldval, u32 newval)
79{
80 int ret;
81
82 update_primary_asce(current);
83 asm volatile(
84 " sacf 256\n"
85 "0: cs %1,%4,0(%5)\n"
86 "1: la %0,0\n"
87 "2: sacf 768\n"
88 EX_TABLE(0b,2b) EX_TABLE(1b,2b)
89 : "=d" (ret), "+d" (oldval), "=m" (*uaddr)
90 : "0" (-EFAULT), "d" (newval), "a" (uaddr), "m" (*uaddr)
91 : "cc", "memory");
92 *uval = oldval;
93 return ret;
94}
95
40#endif /* _ASM_S390_FUTEX_H */ 96#endif /* _ASM_S390_FUTEX_H */
diff --git a/arch/s390/include/asm/irq.h b/arch/s390/include/asm/irq.h
index 5f8bcc5fe423..c4dd400a2791 100644
--- a/arch/s390/include/asm/irq.h
+++ b/arch/s390/include/asm/irq.h
@@ -16,6 +16,20 @@
16/* This number is used when no interrupt has been assigned */ 16/* This number is used when no interrupt has been assigned */
17#define NO_IRQ 0 17#define NO_IRQ 0
18 18
19/* External interruption codes */
20#define EXT_IRQ_INTERRUPT_KEY 0x0040
21#define EXT_IRQ_CLK_COMP 0x1004
22#define EXT_IRQ_CPU_TIMER 0x1005
23#define EXT_IRQ_WARNING_TRACK 0x1007
24#define EXT_IRQ_MALFUNC_ALERT 0x1200
25#define EXT_IRQ_EMERGENCY_SIG 0x1201
26#define EXT_IRQ_EXTERNAL_CALL 0x1202
27#define EXT_IRQ_TIMING_ALERT 0x1406
28#define EXT_IRQ_MEASURE_ALERT 0x1407
29#define EXT_IRQ_SERVICE_SIG 0x2401
30#define EXT_IRQ_CP_SERVICE 0x2603
31#define EXT_IRQ_IUCV 0x4000
32
19#ifndef __ASSEMBLY__ 33#ifndef __ASSEMBLY__
20 34
21#include <linux/hardirq.h> 35#include <linux/hardirq.h>
@@ -53,6 +67,7 @@ enum interruption_class {
53 IRQIO_PCI, 67 IRQIO_PCI,
54 IRQIO_MSI, 68 IRQIO_MSI,
55 IRQIO_VIR, 69 IRQIO_VIR,
70 IRQIO_VAI,
56 NMI_NMI, 71 NMI_NMI,
57 CPU_RST, 72 CPU_RST,
58 NR_ARCH_IRQS 73 NR_ARCH_IRQS
@@ -76,8 +91,8 @@ struct ext_code {
76 91
77typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long); 92typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long);
78 93
79int register_external_interrupt(u16 code, ext_int_handler_t handler); 94int register_external_irq(u16 code, ext_int_handler_t handler);
80int unregister_external_interrupt(u16 code, ext_int_handler_t handler); 95int unregister_external_irq(u16 code, ext_int_handler_t handler);
81 96
82enum irq_subclass { 97enum irq_subclass {
83 IRQ_SUBCLASS_MEASUREMENT_ALERT = 5, 98 IRQ_SUBCLASS_MEASUREMENT_ALERT = 5,
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
index 9bf95bb30f1a..154b60089be9 100644
--- a/arch/s390/include/asm/kvm_host.h
+++ b/arch/s390/include/asm/kvm_host.h
@@ -16,12 +16,22 @@
16#include <linux/hrtimer.h> 16#include <linux/hrtimer.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/kvm_host.h> 18#include <linux/kvm_host.h>
19#include <linux/kvm.h>
19#include <asm/debug.h> 20#include <asm/debug.h>
20#include <asm/cpu.h> 21#include <asm/cpu.h>
22#include <asm/isc.h>
21 23
22#define KVM_MAX_VCPUS 64 24#define KVM_MAX_VCPUS 64
23#define KVM_USER_MEM_SLOTS 32 25#define KVM_USER_MEM_SLOTS 32
24 26
27/*
28 * These seem to be used for allocating ->chip in the routing table,
29 * which we don't use. 4096 is an out-of-thin-air value. If we need
30 * to look at ->chip later on, we'll need to revisit this.
31 */
32#define KVM_NR_IRQCHIPS 1
33#define KVM_IRQCHIP_NUM_PINS 4096
34
25struct sca_entry { 35struct sca_entry {
26 atomic_t scn; 36 atomic_t scn;
27 __u32 reserved; 37 __u32 reserved;
@@ -108,7 +118,9 @@ struct kvm_s390_sie_block {
108 __u32 fac; /* 0x01a0 */ 118 __u32 fac; /* 0x01a0 */
109 __u8 reserved1a4[20]; /* 0x01a4 */ 119 __u8 reserved1a4[20]; /* 0x01a4 */
110 __u64 cbrlo; /* 0x01b8 */ 120 __u64 cbrlo; /* 0x01b8 */
111 __u8 reserved1c0[40]; /* 0x01c0 */ 121 __u8 reserved1c0[30]; /* 0x01c0 */
122 __u64 pp; /* 0x01de */
123 __u8 reserved1e6[2]; /* 0x01e6 */
112 __u64 itdba; /* 0x01e8 */ 124 __u64 itdba; /* 0x01e8 */
113 __u8 reserved1f0[16]; /* 0x01f0 */ 125 __u8 reserved1f0[16]; /* 0x01f0 */
114} __attribute__((packed)); 126} __attribute__((packed));
@@ -171,18 +183,6 @@ struct kvm_vcpu_stat {
171 u32 diagnose_9c; 183 u32 diagnose_9c;
172}; 184};
173 185
174struct kvm_s390_io_info {
175 __u16 subchannel_id; /* 0x0b8 */
176 __u16 subchannel_nr; /* 0x0ba */
177 __u32 io_int_parm; /* 0x0bc */
178 __u32 io_int_word; /* 0x0c0 */
179};
180
181struct kvm_s390_ext_info {
182 __u32 ext_params;
183 __u64 ext_params2;
184};
185
186#define PGM_OPERATION 0x01 186#define PGM_OPERATION 0x01
187#define PGM_PRIVILEGED_OP 0x02 187#define PGM_PRIVILEGED_OP 0x02
188#define PGM_EXECUTE 0x03 188#define PGM_EXECUTE 0x03
@@ -191,27 +191,6 @@ struct kvm_s390_ext_info {
191#define PGM_SPECIFICATION 0x06 191#define PGM_SPECIFICATION 0x06
192#define PGM_DATA 0x07 192#define PGM_DATA 0x07
193 193
194struct kvm_s390_pgm_info {
195 __u16 code;
196};
197
198struct kvm_s390_prefix_info {
199 __u32 address;
200};
201
202struct kvm_s390_extcall_info {
203 __u16 code;
204};
205
206struct kvm_s390_emerg_info {
207 __u16 code;
208};
209
210struct kvm_s390_mchk_info {
211 __u64 cr14;
212 __u64 mcic;
213};
214
215struct kvm_s390_interrupt_info { 194struct kvm_s390_interrupt_info {
216 struct list_head list; 195 struct list_head list;
217 u64 type; 196 u64 type;
@@ -246,9 +225,8 @@ struct kvm_s390_float_interrupt {
246 struct list_head list; 225 struct list_head list;
247 atomic_t active; 226 atomic_t active;
248 int next_rr_cpu; 227 int next_rr_cpu;
249 unsigned long idle_mask[(KVM_MAX_VCPUS + sizeof(long) - 1) 228 unsigned long idle_mask[BITS_TO_LONGS(KVM_MAX_VCPUS)];
250 / sizeof(long)]; 229 unsigned int irq_count;
251 struct kvm_s390_local_interrupt *local_int[KVM_MAX_VCPUS];
252}; 230};
253 231
254 232
@@ -265,6 +243,10 @@ struct kvm_vcpu_arch {
265 u64 stidp_data; 243 u64 stidp_data;
266 }; 244 };
267 struct gmap *gmap; 245 struct gmap *gmap;
246#define KVM_S390_PFAULT_TOKEN_INVALID (-1UL)
247 unsigned long pfault_token;
248 unsigned long pfault_select;
249 unsigned long pfault_compare;
268}; 250};
269 251
270struct kvm_vm_stat { 252struct kvm_vm_stat {
@@ -274,12 +256,36 @@ struct kvm_vm_stat {
274struct kvm_arch_memory_slot { 256struct kvm_arch_memory_slot {
275}; 257};
276 258
259struct s390_map_info {
260 struct list_head list;
261 __u64 guest_addr;
262 __u64 addr;
263 struct page *page;
264};
265
266struct s390_io_adapter {
267 unsigned int id;
268 int isc;
269 bool maskable;
270 bool masked;
271 bool swap;
272 struct rw_semaphore maps_lock;
273 struct list_head maps;
274 atomic_t nr_maps;
275};
276
277#define MAX_S390_IO_ADAPTERS ((MAX_ISC + 1) * 8)
278#define MAX_S390_ADAPTER_MAPS 256
279
277struct kvm_arch{ 280struct kvm_arch{
278 struct sca_block *sca; 281 struct sca_block *sca;
279 debug_info_t *dbf; 282 debug_info_t *dbf;
280 struct kvm_s390_float_interrupt float_int; 283 struct kvm_s390_float_interrupt float_int;
284 struct kvm_device *flic;
281 struct gmap *gmap; 285 struct gmap *gmap;
282 int css_support; 286 int css_support;
287 int use_irqchip;
288 struct s390_io_adapter *adapters[MAX_S390_IO_ADAPTERS];
283}; 289};
284 290
285#define KVM_HVA_ERR_BAD (-1UL) 291#define KVM_HVA_ERR_BAD (-1UL)
@@ -290,6 +296,24 @@ static inline bool kvm_is_error_hva(unsigned long addr)
290 return IS_ERR_VALUE(addr); 296 return IS_ERR_VALUE(addr);
291} 297}
292 298
299#define ASYNC_PF_PER_VCPU 64
300struct kvm_vcpu;
301struct kvm_async_pf;
302struct kvm_arch_async_pf {
303 unsigned long pfault_token;
304};
305
306bool kvm_arch_can_inject_async_page_present(struct kvm_vcpu *vcpu);
307
308void kvm_arch_async_page_ready(struct kvm_vcpu *vcpu,
309 struct kvm_async_pf *work);
310
311void kvm_arch_async_page_not_present(struct kvm_vcpu *vcpu,
312 struct kvm_async_pf *work);
313
314void kvm_arch_async_page_present(struct kvm_vcpu *vcpu,
315 struct kvm_async_pf *work);
316
293extern int sie64a(struct kvm_s390_sie_block *, u64 *); 317extern int sie64a(struct kvm_s390_sie_block *, u64 *);
294extern char sie_exit; 318extern char sie_exit;
295#endif 319#endif
diff --git a/arch/s390/include/asm/mmu.h b/arch/s390/include/asm/mmu.h
index ff132ac64ddd..f77695a82f64 100644
--- a/arch/s390/include/asm/mmu.h
+++ b/arch/s390/include/asm/mmu.h
@@ -1,9 +1,11 @@
1#ifndef __MMU_H 1#ifndef __MMU_H
2#define __MMU_H 2#define __MMU_H
3 3
4#include <linux/cpumask.h>
4#include <linux/errno.h> 5#include <linux/errno.h>
5 6
6typedef struct { 7typedef struct {
8 cpumask_t cpu_attach_mask;
7 atomic_t attach_count; 9 atomic_t attach_count;
8 unsigned int flush_mm; 10 unsigned int flush_mm;
9 spinlock_t list_lock; 11 spinlock_t list_lock;
diff --git a/arch/s390/include/asm/mmu_context.h b/arch/s390/include/asm/mmu_context.h
index 38149b63dc44..71be346d0e3c 100644
--- a/arch/s390/include/asm/mmu_context.h
+++ b/arch/s390/include/asm/mmu_context.h
@@ -15,6 +15,7 @@
15static inline int init_new_context(struct task_struct *tsk, 15static inline int init_new_context(struct task_struct *tsk,
16 struct mm_struct *mm) 16 struct mm_struct *mm)
17{ 17{
18 cpumask_clear(&mm->context.cpu_attach_mask);
18 atomic_set(&mm->context.attach_count, 0); 19 atomic_set(&mm->context.attach_count, 0);
19 mm->context.flush_mm = 0; 20 mm->context.flush_mm = 0;
20 mm->context.asce_bits = _ASCE_TABLE_LENGTH | _ASCE_USER_BITS; 21 mm->context.asce_bits = _ASCE_TABLE_LENGTH | _ASCE_USER_BITS;
@@ -29,41 +30,61 @@ static inline int init_new_context(struct task_struct *tsk,
29 30
30#define destroy_context(mm) do { } while (0) 31#define destroy_context(mm) do { } while (0)
31 32
32#ifndef CONFIG_64BIT 33static inline void update_user_asce(struct mm_struct *mm, int load_primary)
33#define LCTL_OPCODE "lctl"
34#else
35#define LCTL_OPCODE "lctlg"
36#endif
37
38static inline void update_mm(struct mm_struct *mm, struct task_struct *tsk)
39{ 34{
40 pgd_t *pgd = mm->pgd; 35 pgd_t *pgd = mm->pgd;
41 36
42 S390_lowcore.user_asce = mm->context.asce_bits | __pa(pgd); 37 S390_lowcore.user_asce = mm->context.asce_bits | __pa(pgd);
43 /* Load primary space page table origin. */ 38 if (load_primary)
44 asm volatile(LCTL_OPCODE" 1,1,%0\n" : : "m" (S390_lowcore.user_asce)); 39 __ctl_load(S390_lowcore.user_asce, 1, 1);
45 set_fs(current->thread.mm_segment); 40 set_fs(current->thread.mm_segment);
46} 41}
47 42
43static inline void clear_user_asce(struct mm_struct *mm, int load_primary)
44{
45 S390_lowcore.user_asce = S390_lowcore.kernel_asce;
46
47 if (load_primary)
48 __ctl_load(S390_lowcore.user_asce, 1, 1);
49 __ctl_load(S390_lowcore.user_asce, 7, 7);
50}
51
52static inline void update_primary_asce(struct task_struct *tsk)
53{
54 unsigned long asce;
55
56 __ctl_store(asce, 1, 1);
57 if (asce != S390_lowcore.kernel_asce)
58 __ctl_load(S390_lowcore.kernel_asce, 1, 1);
59 set_tsk_thread_flag(tsk, TIF_ASCE);
60}
61
48static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, 62static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
49 struct task_struct *tsk) 63 struct task_struct *tsk)
50{ 64{
51 int cpu = smp_processor_id(); 65 int cpu = smp_processor_id();
52 66
67 update_primary_asce(tsk);
53 if (prev == next) 68 if (prev == next)
54 return; 69 return;
70 if (MACHINE_HAS_TLB_LC)
71 cpumask_set_cpu(cpu, &next->context.cpu_attach_mask);
55 if (atomic_inc_return(&next->context.attach_count) >> 16) { 72 if (atomic_inc_return(&next->context.attach_count) >> 16) {
56 /* Delay update_mm until all TLB flushes are done. */ 73 /* Delay update_user_asce until all TLB flushes are done. */
57 set_tsk_thread_flag(tsk, TIF_TLB_WAIT); 74 set_tsk_thread_flag(tsk, TIF_TLB_WAIT);
75 /* Clear old ASCE by loading the kernel ASCE. */
76 clear_user_asce(next, 0);
58 } else { 77 } else {
59 cpumask_set_cpu(cpu, mm_cpumask(next)); 78 cpumask_set_cpu(cpu, mm_cpumask(next));
60 update_mm(next, tsk); 79 update_user_asce(next, 0);
61 if (next->context.flush_mm) 80 if (next->context.flush_mm)
62 /* Flush pending TLBs */ 81 /* Flush pending TLBs */
63 __tlb_flush_mm(next); 82 __tlb_flush_mm(next);
64 } 83 }
65 atomic_dec(&prev->context.attach_count); 84 atomic_dec(&prev->context.attach_count);
66 WARN_ON(atomic_read(&prev->context.attach_count) < 0); 85 WARN_ON(atomic_read(&prev->context.attach_count) < 0);
86 if (MACHINE_HAS_TLB_LC)
87 cpumask_clear_cpu(cpu, &prev->context.cpu_attach_mask);
67} 88}
68 89
69#define finish_arch_post_lock_switch finish_arch_post_lock_switch 90#define finish_arch_post_lock_switch finish_arch_post_lock_switch
@@ -80,7 +101,7 @@ static inline void finish_arch_post_lock_switch(void)
80 cpu_relax(); 101 cpu_relax();
81 102
82 cpumask_set_cpu(smp_processor_id(), mm_cpumask(mm)); 103 cpumask_set_cpu(smp_processor_id(), mm_cpumask(mm));
83 update_mm(mm, tsk); 104 update_user_asce(mm, 0);
84 if (mm->context.flush_mm) 105 if (mm->context.flush_mm)
85 __tlb_flush_mm(mm); 106 __tlb_flush_mm(mm);
86 preempt_enable(); 107 preempt_enable();
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index 1ab75eaacbd4..12f75313e086 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -782,6 +782,7 @@ static inline void pgste_set_pte(pte_t *ptep, pte_t entry)
782 * @table: pointer to the page directory 782 * @table: pointer to the page directory
783 * @asce: address space control element for gmap page table 783 * @asce: address space control element for gmap page table
784 * @crst_list: list of all crst tables used in the guest address space 784 * @crst_list: list of all crst tables used in the guest address space
785 * @pfault_enabled: defines if pfaults are applicable for the guest
785 */ 786 */
786struct gmap { 787struct gmap {
787 struct list_head list; 788 struct list_head list;
@@ -790,6 +791,7 @@ struct gmap {
790 unsigned long asce; 791 unsigned long asce;
791 void *private; 792 void *private;
792 struct list_head crst_list; 793 struct list_head crst_list;
794 bool pfault_enabled;
793}; 795};
794 796
795/** 797/**
@@ -1068,12 +1070,35 @@ static inline void __ptep_ipte(unsigned long address, pte_t *ptep)
1068 : "=m" (*ptep) : "m" (*ptep), "a" (pto), "a" (address)); 1070 : "=m" (*ptep) : "m" (*ptep), "a" (pto), "a" (address));
1069} 1071}
1070 1072
1073static inline void __ptep_ipte_local(unsigned long address, pte_t *ptep)
1074{
1075 unsigned long pto = (unsigned long) ptep;
1076
1077#ifndef CONFIG_64BIT
1078 /* pto in ESA mode must point to the start of the segment table */
1079 pto &= 0x7ffffc00;
1080#endif
1081 /* Invalidation + local TLB flush for the pte */
1082 asm volatile(
1083 " .insn rrf,0xb2210000,%2,%3,0,1"
1084 : "=m" (*ptep) : "m" (*ptep), "a" (pto), "a" (address));
1085}
1086
1071static inline void ptep_flush_direct(struct mm_struct *mm, 1087static inline void ptep_flush_direct(struct mm_struct *mm,
1072 unsigned long address, pte_t *ptep) 1088 unsigned long address, pte_t *ptep)
1073{ 1089{
1090 int active, count;
1091
1074 if (pte_val(*ptep) & _PAGE_INVALID) 1092 if (pte_val(*ptep) & _PAGE_INVALID)
1075 return; 1093 return;
1076 __ptep_ipte(address, ptep); 1094 active = (mm == current->active_mm) ? 1 : 0;
1095 count = atomic_add_return(0x10000, &mm->context.attach_count);
1096 if (MACHINE_HAS_TLB_LC && (count & 0xffff) <= active &&
1097 cpumask_equal(mm_cpumask(mm), cpumask_of(smp_processor_id())))
1098 __ptep_ipte_local(address, ptep);
1099 else
1100 __ptep_ipte(address, ptep);
1101 atomic_sub(0x10000, &mm->context.attach_count);
1077} 1102}
1078 1103
1079static inline void ptep_flush_lazy(struct mm_struct *mm, 1104static inline void ptep_flush_lazy(struct mm_struct *mm,
@@ -1382,35 +1407,6 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
1382#define pte_offset_map(pmd, address) pte_offset_kernel(pmd, address) 1407#define pte_offset_map(pmd, address) pte_offset_kernel(pmd, address)
1383#define pte_unmap(pte) do { } while (0) 1408#define pte_unmap(pte) do { } while (0)
1384 1409
1385static inline void __pmd_idte(unsigned long address, pmd_t *pmdp)
1386{
1387 unsigned long sto = (unsigned long) pmdp -
1388 pmd_index(address) * sizeof(pmd_t);
1389
1390 if (!(pmd_val(*pmdp) & _SEGMENT_ENTRY_INVALID)) {
1391 asm volatile(
1392 " .insn rrf,0xb98e0000,%2,%3,0,0"
1393 : "=m" (*pmdp)
1394 : "m" (*pmdp), "a" (sto),
1395 "a" ((address & HPAGE_MASK))
1396 : "cc"
1397 );
1398 }
1399}
1400
1401static inline void __pmd_csp(pmd_t *pmdp)
1402{
1403 register unsigned long reg2 asm("2") = pmd_val(*pmdp);
1404 register unsigned long reg3 asm("3") = pmd_val(*pmdp) |
1405 _SEGMENT_ENTRY_INVALID;
1406 register unsigned long reg4 asm("4") = ((unsigned long) pmdp) + 5;
1407
1408 asm volatile(
1409 " csp %1,%3"
1410 : "=m" (*pmdp)
1411 : "d" (reg2), "d" (reg3), "d" (reg4), "m" (*pmdp) : "cc");
1412}
1413
1414#if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLB_PAGE) 1410#if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLB_PAGE)
1415static inline unsigned long massage_pgprot_pmd(pgprot_t pgprot) 1411static inline unsigned long massage_pgprot_pmd(pgprot_t pgprot)
1416{ 1412{
@@ -1479,18 +1475,80 @@ static inline pmd_t pmd_mkwrite(pmd_t pmd)
1479} 1475}
1480#endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLB_PAGE */ 1476#endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_HUGETLB_PAGE */
1481 1477
1478static inline void __pmdp_csp(pmd_t *pmdp)
1479{
1480 register unsigned long reg2 asm("2") = pmd_val(*pmdp);
1481 register unsigned long reg3 asm("3") = pmd_val(*pmdp) |
1482 _SEGMENT_ENTRY_INVALID;
1483 register unsigned long reg4 asm("4") = ((unsigned long) pmdp) + 5;
1484
1485 asm volatile(
1486 " csp %1,%3"
1487 : "=m" (*pmdp)
1488 : "d" (reg2), "d" (reg3), "d" (reg4), "m" (*pmdp) : "cc");
1489}
1490
1491static inline void __pmdp_idte(unsigned long address, pmd_t *pmdp)
1492{
1493 unsigned long sto;
1494
1495 sto = (unsigned long) pmdp - pmd_index(address) * sizeof(pmd_t);
1496 asm volatile(
1497 " .insn rrf,0xb98e0000,%2,%3,0,0"
1498 : "=m" (*pmdp)
1499 : "m" (*pmdp), "a" (sto), "a" ((address & HPAGE_MASK))
1500 : "cc" );
1501}
1502
1503static inline void __pmdp_idte_local(unsigned long address, pmd_t *pmdp)
1504{
1505 unsigned long sto;
1506
1507 sto = (unsigned long) pmdp - pmd_index(address) * sizeof(pmd_t);
1508 asm volatile(
1509 " .insn rrf,0xb98e0000,%2,%3,0,1"
1510 : "=m" (*pmdp)
1511 : "m" (*pmdp), "a" (sto), "a" ((address & HPAGE_MASK))
1512 : "cc" );
1513}
1514
1515static inline void pmdp_flush_direct(struct mm_struct *mm,
1516 unsigned long address, pmd_t *pmdp)
1517{
1518 int active, count;
1519
1520 if (pmd_val(*pmdp) & _SEGMENT_ENTRY_INVALID)
1521 return;
1522 if (!MACHINE_HAS_IDTE) {
1523 __pmdp_csp(pmdp);
1524 return;
1525 }
1526 active = (mm == current->active_mm) ? 1 : 0;
1527 count = atomic_add_return(0x10000, &mm->context.attach_count);
1528 if (MACHINE_HAS_TLB_LC && (count & 0xffff) <= active &&
1529 cpumask_equal(mm_cpumask(mm), cpumask_of(smp_processor_id())))
1530 __pmdp_idte_local(address, pmdp);
1531 else
1532 __pmdp_idte(address, pmdp);
1533 atomic_sub(0x10000, &mm->context.attach_count);
1534}
1535
1482static inline void pmdp_flush_lazy(struct mm_struct *mm, 1536static inline void pmdp_flush_lazy(struct mm_struct *mm,
1483 unsigned long address, pmd_t *pmdp) 1537 unsigned long address, pmd_t *pmdp)
1484{ 1538{
1485 int active, count; 1539 int active, count;
1486 1540
1541 if (pmd_val(*pmdp) & _SEGMENT_ENTRY_INVALID)
1542 return;
1487 active = (mm == current->active_mm) ? 1 : 0; 1543 active = (mm == current->active_mm) ? 1 : 0;
1488 count = atomic_add_return(0x10000, &mm->context.attach_count); 1544 count = atomic_add_return(0x10000, &mm->context.attach_count);
1489 if ((count & 0xffff) <= active) { 1545 if ((count & 0xffff) <= active) {
1490 pmd_val(*pmdp) |= _SEGMENT_ENTRY_INVALID; 1546 pmd_val(*pmdp) |= _SEGMENT_ENTRY_INVALID;
1491 mm->context.flush_mm = 1; 1547 mm->context.flush_mm = 1;
1492 } else 1548 } else if (MACHINE_HAS_IDTE)
1493 __pmd_idte(address, pmdp); 1549 __pmdp_idte(address, pmdp);
1550 else
1551 __pmdp_csp(pmdp);
1494 atomic_sub(0x10000, &mm->context.attach_count); 1552 atomic_sub(0x10000, &mm->context.attach_count);
1495} 1553}
1496 1554
@@ -1543,7 +1601,7 @@ static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma,
1543 pmd_t pmd; 1601 pmd_t pmd;
1544 1602
1545 pmd = *pmdp; 1603 pmd = *pmdp;
1546 __pmd_idte(address, pmdp); 1604 pmdp_flush_direct(vma->vm_mm, address, pmdp);
1547 *pmdp = pmd_mkold(pmd); 1605 *pmdp = pmd_mkold(pmd);
1548 return pmd_young(pmd); 1606 return pmd_young(pmd);
1549} 1607}
@@ -1554,7 +1612,7 @@ static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm,
1554{ 1612{
1555 pmd_t pmd = *pmdp; 1613 pmd_t pmd = *pmdp;
1556 1614
1557 __pmd_idte(address, pmdp); 1615 pmdp_flush_direct(mm, address, pmdp);
1558 pmd_clear(pmdp); 1616 pmd_clear(pmdp);
1559 return pmd; 1617 return pmd;
1560} 1618}
@@ -1570,7 +1628,7 @@ static inline pmd_t pmdp_clear_flush(struct vm_area_struct *vma,
1570static inline void pmdp_invalidate(struct vm_area_struct *vma, 1628static inline void pmdp_invalidate(struct vm_area_struct *vma,
1571 unsigned long address, pmd_t *pmdp) 1629 unsigned long address, pmd_t *pmdp)
1572{ 1630{
1573 __pmd_idte(address, pmdp); 1631 pmdp_flush_direct(vma->vm_mm, address, pmdp);
1574} 1632}
1575 1633
1576#define __HAVE_ARCH_PMDP_SET_WRPROTECT 1634#define __HAVE_ARCH_PMDP_SET_WRPROTECT
@@ -1580,7 +1638,7 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm,
1580 pmd_t pmd = *pmdp; 1638 pmd_t pmd = *pmdp;
1581 1639
1582 if (pmd_write(pmd)) { 1640 if (pmd_write(pmd)) {
1583 __pmd_idte(address, pmdp); 1641 pmdp_flush_direct(mm, address, pmdp);
1584 set_pmd_at(mm, address, pmdp, pmd_wrprotect(pmd)); 1642 set_pmd_at(mm, address, pmdp, pmd_wrprotect(pmd));
1585 } 1643 }
1586} 1644}
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h
index 0a876bc543d3..dc5fc4f90e52 100644
--- a/arch/s390/include/asm/processor.h
+++ b/arch/s390/include/asm/processor.h
@@ -79,6 +79,7 @@ struct thread_struct {
79 unsigned long ksp; /* kernel stack pointer */ 79 unsigned long ksp; /* kernel stack pointer */
80 mm_segment_t mm_segment; 80 mm_segment_t mm_segment;
81 unsigned long gmap_addr; /* address of last gmap fault. */ 81 unsigned long gmap_addr; /* address of last gmap fault. */
82 unsigned int gmap_pfault; /* signal of a pending guest pfault */
82 struct per_regs per_user; /* User specified PER registers */ 83 struct per_regs per_user; /* User specified PER registers */
83 struct per_event per_event; /* Cause of the last PER trap */ 84 struct per_event per_event; /* Cause of the last PER trap */
84 unsigned long per_flags; /* Flags to control debug behavior */ 85 unsigned long per_flags; /* Flags to control debug behavior */
diff --git a/arch/s390/include/asm/setup.h b/arch/s390/include/asm/setup.h
index 406f3a1e63ef..b31b22dba948 100644
--- a/arch/s390/include/asm/setup.h
+++ b/arch/s390/include/asm/setup.h
@@ -68,6 +68,7 @@ void create_mem_hole(struct mem_chunk mem_chunk[], unsigned long addr,
68#define MACHINE_FLAG_TOPOLOGY (1UL << 14) 68#define MACHINE_FLAG_TOPOLOGY (1UL << 14)
69#define MACHINE_FLAG_TE (1UL << 15) 69#define MACHINE_FLAG_TE (1UL << 15)
70#define MACHINE_FLAG_RRBM (1UL << 16) 70#define MACHINE_FLAG_RRBM (1UL << 16)
71#define MACHINE_FLAG_TLB_LC (1UL << 17)
71 72
72#define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM) 73#define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM)
73#define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM) 74#define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
@@ -90,6 +91,7 @@ void create_mem_hole(struct mem_chunk mem_chunk[], unsigned long addr,
90#define MACHINE_HAS_TOPOLOGY (0) 91#define MACHINE_HAS_TOPOLOGY (0)
91#define MACHINE_HAS_TE (0) 92#define MACHINE_HAS_TE (0)
92#define MACHINE_HAS_RRBM (0) 93#define MACHINE_HAS_RRBM (0)
94#define MACHINE_HAS_TLB_LC (0)
93#else /* CONFIG_64BIT */ 95#else /* CONFIG_64BIT */
94#define MACHINE_HAS_IEEE (1) 96#define MACHINE_HAS_IEEE (1)
95#define MACHINE_HAS_CSP (1) 97#define MACHINE_HAS_CSP (1)
@@ -102,6 +104,7 @@ void create_mem_hole(struct mem_chunk mem_chunk[], unsigned long addr,
102#define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY) 104#define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
103#define MACHINE_HAS_TE (S390_lowcore.machine_flags & MACHINE_FLAG_TE) 105#define MACHINE_HAS_TE (S390_lowcore.machine_flags & MACHINE_FLAG_TE)
104#define MACHINE_HAS_RRBM (S390_lowcore.machine_flags & MACHINE_FLAG_RRBM) 106#define MACHINE_HAS_RRBM (S390_lowcore.machine_flags & MACHINE_FLAG_RRBM)
107#define MACHINE_HAS_TLB_LC (S390_lowcore.machine_flags & MACHINE_FLAG_TLB_LC)
105#endif /* CONFIG_64BIT */ 108#endif /* CONFIG_64BIT */
106 109
107/* 110/*
diff --git a/arch/s390/include/asm/switch_to.h b/arch/s390/include/asm/switch_to.h
index 29c81f82705e..e759181357fc 100644
--- a/arch/s390/include/asm/switch_to.h
+++ b/arch/s390/include/asm/switch_to.h
@@ -132,6 +132,7 @@ static inline void restore_access_regs(unsigned int *acrs)
132 update_cr_regs(next); \ 132 update_cr_regs(next); \
133 } \ 133 } \
134 prev = __switch_to(prev,next); \ 134 prev = __switch_to(prev,next); \
135 update_primary_asce(current); \
135} while (0) 136} while (0)
136 137
137#define finish_arch_switch(prev) do { \ 138#define finish_arch_switch(prev) do { \
diff --git a/arch/s390/include/asm/syscall.h b/arch/s390/include/asm/syscall.h
index cd29d2f4e4f3..777687055e7b 100644
--- a/arch/s390/include/asm/syscall.h
+++ b/arch/s390/include/asm/syscall.h
@@ -12,7 +12,7 @@
12#ifndef _ASM_SYSCALL_H 12#ifndef _ASM_SYSCALL_H
13#define _ASM_SYSCALL_H 1 13#define _ASM_SYSCALL_H 1
14 14
15#include <linux/audit.h> 15#include <uapi/linux/audit.h>
16#include <linux/sched.h> 16#include <linux/sched.h>
17#include <linux/err.h> 17#include <linux/err.h>
18#include <asm/ptrace.h> 18#include <asm/ptrace.h>
@@ -89,11 +89,10 @@ static inline void syscall_set_arguments(struct task_struct *task,
89 regs->orig_gpr2 = args[0]; 89 regs->orig_gpr2 = args[0];
90} 90}
91 91
92static inline int syscall_get_arch(struct task_struct *task, 92static inline int syscall_get_arch(void)
93 struct pt_regs *regs)
94{ 93{
95#ifdef CONFIG_COMPAT 94#ifdef CONFIG_COMPAT
96 if (test_tsk_thread_flag(task, TIF_31BIT)) 95 if (test_tsk_thread_flag(current, TIF_31BIT))
97 return AUDIT_ARCH_S390; 96 return AUDIT_ARCH_S390;
98#endif 97#endif
99 return sizeof(long) == 8 ? AUDIT_ARCH_S390X : AUDIT_ARCH_S390; 98 return sizeof(long) == 8 ? AUDIT_ARCH_S390X : AUDIT_ARCH_S390;
diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h
index 3ccd71b90345..50630e6a35de 100644
--- a/arch/s390/include/asm/thread_info.h
+++ b/arch/s390/include/asm/thread_info.h
@@ -82,6 +82,7 @@ static inline struct thread_info *current_thread_info(void)
82#define TIF_SIGPENDING 2 /* signal pending */ 82#define TIF_SIGPENDING 2 /* signal pending */
83#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 83#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
84#define TIF_TLB_WAIT 4 /* wait for TLB flush completion */ 84#define TIF_TLB_WAIT 4 /* wait for TLB flush completion */
85#define TIF_ASCE 5 /* primary asce needs fixup / uaccess */
85#define TIF_PER_TRAP 6 /* deliver sigtrap on return to user */ 86#define TIF_PER_TRAP 6 /* deliver sigtrap on return to user */
86#define TIF_MCCK_PENDING 7 /* machine check handling is pending */ 87#define TIF_MCCK_PENDING 7 /* machine check handling is pending */
87#define TIF_SYSCALL_TRACE 8 /* syscall trace active */ 88#define TIF_SYSCALL_TRACE 8 /* syscall trace active */
@@ -99,6 +100,7 @@ static inline struct thread_info *current_thread_info(void)
99#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 100#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
100#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 101#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
101#define _TIF_TLB_WAIT (1<<TIF_TLB_WAIT) 102#define _TIF_TLB_WAIT (1<<TIF_TLB_WAIT)
103#define _TIF_ASCE (1<<TIF_ASCE)
102#define _TIF_PER_TRAP (1<<TIF_PER_TRAP) 104#define _TIF_PER_TRAP (1<<TIF_PER_TRAP)
103#define _TIF_MCCK_PENDING (1<<TIF_MCCK_PENDING) 105#define _TIF_MCCK_PENDING (1<<TIF_MCCK_PENDING)
104#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 106#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
diff --git a/arch/s390/include/asm/tlb.h b/arch/s390/include/asm/tlb.h
index 2cb846c4b37f..c544b6f05d95 100644
--- a/arch/s390/include/asm/tlb.h
+++ b/arch/s390/include/asm/tlb.h
@@ -57,8 +57,6 @@ static inline void tlb_gather_mmu(struct mmu_gather *tlb,
57 tlb->end = end; 57 tlb->end = end;
58 tlb->fullmm = !(start | (end+1)); 58 tlb->fullmm = !(start | (end+1));
59 tlb->batch = NULL; 59 tlb->batch = NULL;
60 if (tlb->fullmm)
61 __tlb_flush_mm(mm);
62} 60}
63 61
64static inline void tlb_flush_mmu(struct mmu_gather *tlb) 62static inline void tlb_flush_mmu(struct mmu_gather *tlb)
@@ -96,9 +94,7 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
96static inline void pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte, 94static inline void pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
97 unsigned long address) 95 unsigned long address)
98{ 96{
99 if (!tlb->fullmm) 97 page_table_free_rcu(tlb, (unsigned long *) pte);
100 return page_table_free_rcu(tlb, (unsigned long *) pte);
101 page_table_free(tlb->mm, (unsigned long *) pte);
102} 98}
103 99
104/* 100/*
@@ -114,9 +110,7 @@ static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd,
114#ifdef CONFIG_64BIT 110#ifdef CONFIG_64BIT
115 if (tlb->mm->context.asce_limit <= (1UL << 31)) 111 if (tlb->mm->context.asce_limit <= (1UL << 31))
116 return; 112 return;
117 if (!tlb->fullmm) 113 tlb_remove_table(tlb, pmd);
118 return tlb_remove_table(tlb, pmd);
119 crst_table_free(tlb->mm, (unsigned long *) pmd);
120#endif 114#endif
121} 115}
122 116
@@ -133,9 +127,7 @@ static inline void pud_free_tlb(struct mmu_gather *tlb, pud_t *pud,
133#ifdef CONFIG_64BIT 127#ifdef CONFIG_64BIT
134 if (tlb->mm->context.asce_limit <= (1UL << 42)) 128 if (tlb->mm->context.asce_limit <= (1UL << 42))
135 return; 129 return;
136 if (!tlb->fullmm) 130 tlb_remove_table(tlb, pud);
137 return tlb_remove_table(tlb, pud);
138 crst_table_free(tlb->mm, (unsigned long *) pud);
139#endif 131#endif
140} 132}
141 133
diff --git a/arch/s390/include/asm/tlbflush.h b/arch/s390/include/asm/tlbflush.h
index f9fef0425fee..16c9c88658c8 100644
--- a/arch/s390/include/asm/tlbflush.h
+++ b/arch/s390/include/asm/tlbflush.h
@@ -7,19 +7,41 @@
7#include <asm/pgalloc.h> 7#include <asm/pgalloc.h>
8 8
9/* 9/*
10 * Flush all tlb entries on the local cpu. 10 * Flush all TLB entries on the local CPU.
11 */ 11 */
12static inline void __tlb_flush_local(void) 12static inline void __tlb_flush_local(void)
13{ 13{
14 asm volatile("ptlb" : : : "memory"); 14 asm volatile("ptlb" : : : "memory");
15} 15}
16 16
17#ifdef CONFIG_SMP
18/* 17/*
19 * Flush all tlb entries on all cpus. 18 * Flush TLB entries for a specific ASCE on all CPUs
20 */ 19 */
20static inline void __tlb_flush_idte(unsigned long asce)
21{
22 /* Global TLB flush for the mm */
23 asm volatile(
24 " .insn rrf,0xb98e0000,0,%0,%1,0"
25 : : "a" (2048), "a" (asce) : "cc");
26}
27
28/*
29 * Flush TLB entries for a specific ASCE on the local CPU
30 */
31static inline void __tlb_flush_idte_local(unsigned long asce)
32{
33 /* Local TLB flush for the mm */
34 asm volatile(
35 " .insn rrf,0xb98e0000,0,%0,%1,1"
36 : : "a" (2048), "a" (asce) : "cc");
37}
38
39#ifdef CONFIG_SMP
21void smp_ptlb_all(void); 40void smp_ptlb_all(void);
22 41
42/*
43 * Flush all TLB entries on all CPUs.
44 */
23static inline void __tlb_flush_global(void) 45static inline void __tlb_flush_global(void)
24{ 46{
25 register unsigned long reg2 asm("2"); 47 register unsigned long reg2 asm("2");
@@ -42,36 +64,89 @@ static inline void __tlb_flush_global(void)
42 : : "d" (reg2), "d" (reg3), "d" (reg4), "m" (dummy) : "cc" ); 64 : : "d" (reg2), "d" (reg3), "d" (reg4), "m" (dummy) : "cc" );
43} 65}
44 66
67/*
68 * Flush TLB entries for a specific mm on all CPUs (in case gmap is used
69 * this implicates multiple ASCEs!).
70 */
45static inline void __tlb_flush_full(struct mm_struct *mm) 71static inline void __tlb_flush_full(struct mm_struct *mm)
46{ 72{
47 cpumask_t local_cpumask;
48
49 preempt_disable(); 73 preempt_disable();
50 /* 74 atomic_add(0x10000, &mm->context.attach_count);
51 * If the process only ran on the local cpu, do a local flush. 75 if (cpumask_equal(mm_cpumask(mm), cpumask_of(smp_processor_id()))) {
52 */ 76 /* Local TLB flush */
53 cpumask_copy(&local_cpumask, cpumask_of(smp_processor_id()));
54 if (cpumask_equal(mm_cpumask(mm), &local_cpumask))
55 __tlb_flush_local(); 77 __tlb_flush_local();
56 else 78 } else {
79 /* Global TLB flush */
57 __tlb_flush_global(); 80 __tlb_flush_global();
81 /* Reset TLB flush mask */
82 if (MACHINE_HAS_TLB_LC)
83 cpumask_copy(mm_cpumask(mm),
84 &mm->context.cpu_attach_mask);
85 }
86 atomic_sub(0x10000, &mm->context.attach_count);
58 preempt_enable(); 87 preempt_enable();
59} 88}
89
90/*
91 * Flush TLB entries for a specific ASCE on all CPUs.
92 */
93static inline void __tlb_flush_asce(struct mm_struct *mm, unsigned long asce)
94{
95 int active, count;
96
97 preempt_disable();
98 active = (mm == current->active_mm) ? 1 : 0;
99 count = atomic_add_return(0x10000, &mm->context.attach_count);
100 if (MACHINE_HAS_TLB_LC && (count & 0xffff) <= active &&
101 cpumask_equal(mm_cpumask(mm), cpumask_of(smp_processor_id()))) {
102 __tlb_flush_idte_local(asce);
103 } else {
104 if (MACHINE_HAS_IDTE)
105 __tlb_flush_idte(asce);
106 else
107 __tlb_flush_global();
108 /* Reset TLB flush mask */
109 if (MACHINE_HAS_TLB_LC)
110 cpumask_copy(mm_cpumask(mm),
111 &mm->context.cpu_attach_mask);
112 }
113 atomic_sub(0x10000, &mm->context.attach_count);
114 preempt_enable();
115}
116
117static inline void __tlb_flush_kernel(void)
118{
119 if (MACHINE_HAS_IDTE)
120 __tlb_flush_idte((unsigned long) init_mm.pgd |
121 init_mm.context.asce_bits);
122 else
123 __tlb_flush_global();
124}
60#else 125#else
61#define __tlb_flush_full(mm) __tlb_flush_local()
62#define __tlb_flush_global() __tlb_flush_local() 126#define __tlb_flush_global() __tlb_flush_local()
63#endif 127#define __tlb_flush_full(mm) __tlb_flush_local()
64 128
65/* 129/*
66 * Flush all tlb entries of a page table on all cpus. 130 * Flush TLB entries for a specific ASCE on all CPUs.
67 */ 131 */
68static inline void __tlb_flush_idte(unsigned long asce) 132static inline void __tlb_flush_asce(struct mm_struct *mm, unsigned long asce)
69{ 133{
70 asm volatile( 134 if (MACHINE_HAS_TLB_LC)
71 " .insn rrf,0xb98e0000,0,%0,%1,0" 135 __tlb_flush_idte_local(asce);
72 : : "a" (2048), "a" (asce) : "cc" ); 136 else
137 __tlb_flush_local();
73} 138}
74 139
140static inline void __tlb_flush_kernel(void)
141{
142 if (MACHINE_HAS_TLB_LC)
143 __tlb_flush_idte_local((unsigned long) init_mm.pgd |
144 init_mm.context.asce_bits);
145 else
146 __tlb_flush_local();
147}
148#endif
149
75static inline void __tlb_flush_mm(struct mm_struct * mm) 150static inline void __tlb_flush_mm(struct mm_struct * mm)
76{ 151{
77 /* 152 /*
@@ -80,7 +155,7 @@ static inline void __tlb_flush_mm(struct mm_struct * mm)
80 * only ran on the local cpu. 155 * only ran on the local cpu.
81 */ 156 */
82 if (MACHINE_HAS_IDTE && list_empty(&mm->context.gmap_list)) 157 if (MACHINE_HAS_IDTE && list_empty(&mm->context.gmap_list))
83 __tlb_flush_idte((unsigned long) mm->pgd | 158 __tlb_flush_asce(mm, (unsigned long) mm->pgd |
84 mm->context.asce_bits); 159 mm->context.asce_bits);
85 else 160 else
86 __tlb_flush_full(mm); 161 __tlb_flush_full(mm);
@@ -130,7 +205,7 @@ static inline void flush_tlb_range(struct vm_area_struct *vma,
130static inline void flush_tlb_kernel_range(unsigned long start, 205static inline void flush_tlb_kernel_range(unsigned long start,
131 unsigned long end) 206 unsigned long end)
132{ 207{
133 __tlb_flush_mm(&init_mm); 208 __tlb_flush_kernel();
134} 209}
135 210
136#endif /* _S390_TLBFLUSH_H */ 211#endif /* _S390_TLBFLUSH_H */
diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h
index 4133b3f72fb0..1be64a1506d0 100644
--- a/arch/s390/include/asm/uaccess.h
+++ b/arch/s390/include/asm/uaccess.h
@@ -92,8 +92,6 @@ static inline unsigned long extable_fixup(const struct exception_table_entry *x)
92#define ARCH_HAS_SORT_EXTABLE 92#define ARCH_HAS_SORT_EXTABLE
93#define ARCH_HAS_SEARCH_EXTABLE 93#define ARCH_HAS_SEARCH_EXTABLE
94 94
95int __handle_fault(unsigned long, unsigned long, int);
96
97/** 95/**
98 * __copy_from_user: - Copy a block of data from user space, with less checking. 96 * __copy_from_user: - Copy a block of data from user space, with less checking.
99 * @to: Destination address, in kernel space. 97 * @to: Destination address, in kernel space.
diff --git a/arch/s390/include/uapi/asm/kvm.h b/arch/s390/include/uapi/asm/kvm.h
index d25da598ec62..c003c6a73b1e 100644
--- a/arch/s390/include/uapi/asm/kvm.h
+++ b/arch/s390/include/uapi/asm/kvm.h
@@ -16,6 +16,44 @@
16 16
17#define __KVM_S390 17#define __KVM_S390
18 18
19/* Device control API: s390-specific devices */
20#define KVM_DEV_FLIC_GET_ALL_IRQS 1
21#define KVM_DEV_FLIC_ENQUEUE 2
22#define KVM_DEV_FLIC_CLEAR_IRQS 3
23#define KVM_DEV_FLIC_APF_ENABLE 4
24#define KVM_DEV_FLIC_APF_DISABLE_WAIT 5
25#define KVM_DEV_FLIC_ADAPTER_REGISTER 6
26#define KVM_DEV_FLIC_ADAPTER_MODIFY 7
27/*
28 * We can have up to 4*64k pending subchannels + 8 adapter interrupts,
29 * as well as up to ASYNC_PF_PER_VCPU*KVM_MAX_VCPUS pfault done interrupts.
30 * There are also sclp and machine checks. This gives us
31 * sizeof(kvm_s390_irq)*(4*65536+8+64*64+1+1) = 72 * 266250 = 19170000
32 * Lets round up to 8192 pages.
33 */
34#define KVM_S390_MAX_FLOAT_IRQS 266250
35#define KVM_S390_FLIC_MAX_BUFFER 0x2000000
36
37struct kvm_s390_io_adapter {
38 __u32 id;
39 __u8 isc;
40 __u8 maskable;
41 __u8 swap;
42 __u8 pad;
43};
44
45#define KVM_S390_IO_ADAPTER_MASK 1
46#define KVM_S390_IO_ADAPTER_MAP 2
47#define KVM_S390_IO_ADAPTER_UNMAP 3
48
49struct kvm_s390_io_adapter_req {
50 __u32 id;
51 __u8 type;
52 __u8 mask;
53 __u16 pad0;
54 __u64 addr;
55};
56
19/* for KVM_GET_REGS and KVM_SET_REGS */ 57/* for KVM_GET_REGS and KVM_SET_REGS */
20struct kvm_regs { 58struct kvm_regs {
21 /* general purpose regs for s390 */ 59 /* general purpose regs for s390 */
@@ -57,4 +95,9 @@ struct kvm_sync_regs {
57#define KVM_REG_S390_EPOCHDIFF (KVM_REG_S390 | KVM_REG_SIZE_U64 | 0x2) 95#define KVM_REG_S390_EPOCHDIFF (KVM_REG_S390 | KVM_REG_SIZE_U64 | 0x2)
58#define KVM_REG_S390_CPU_TIMER (KVM_REG_S390 | KVM_REG_SIZE_U64 | 0x3) 96#define KVM_REG_S390_CPU_TIMER (KVM_REG_S390 | KVM_REG_SIZE_U64 | 0x3)
59#define KVM_REG_S390_CLOCK_COMP (KVM_REG_S390 | KVM_REG_SIZE_U64 | 0x4) 97#define KVM_REG_S390_CLOCK_COMP (KVM_REG_S390 | KVM_REG_SIZE_U64 | 0x4)
98#define KVM_REG_S390_PFTOKEN (KVM_REG_S390 | KVM_REG_SIZE_U64 | 0x5)
99#define KVM_REG_S390_PFCOMPARE (KVM_REG_S390 | KVM_REG_SIZE_U64 | 0x6)
100#define KVM_REG_S390_PFSELECT (KVM_REG_S390 | KVM_REG_SIZE_U64 | 0x7)
101#define KVM_REG_S390_PP (KVM_REG_S390 | KVM_REG_SIZE_U64 | 0x8)
102#define KVM_REG_S390_GBEA (KVM_REG_S390 | KVM_REG_SIZE_U64 | 0x9)
60#endif 103#endif
diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c
index e4c99a183651..cc10cdd4d6a2 100644
--- a/arch/s390/kernel/asm-offsets.c
+++ b/arch/s390/kernel/asm-offsets.c
@@ -136,6 +136,7 @@ int main(void)
136 DEFINE(__LC_RESTART_FN, offsetof(struct _lowcore, restart_fn)); 136 DEFINE(__LC_RESTART_FN, offsetof(struct _lowcore, restart_fn));
137 DEFINE(__LC_RESTART_DATA, offsetof(struct _lowcore, restart_data)); 137 DEFINE(__LC_RESTART_DATA, offsetof(struct _lowcore, restart_data));
138 DEFINE(__LC_RESTART_SOURCE, offsetof(struct _lowcore, restart_source)); 138 DEFINE(__LC_RESTART_SOURCE, offsetof(struct _lowcore, restart_source));
139 DEFINE(__LC_KERNEL_ASCE, offsetof(struct _lowcore, kernel_asce));
139 DEFINE(__LC_USER_ASCE, offsetof(struct _lowcore, user_asce)); 140 DEFINE(__LC_USER_ASCE, offsetof(struct _lowcore, user_asce));
140 DEFINE(__LC_INT_CLOCK, offsetof(struct _lowcore, int_clock)); 141 DEFINE(__LC_INT_CLOCK, offsetof(struct _lowcore, int_clock));
141 DEFINE(__LC_MCCK_CLOCK, offsetof(struct _lowcore, mcck_clock)); 142 DEFINE(__LC_MCCK_CLOCK, offsetof(struct _lowcore, mcck_clock));
diff --git a/arch/s390/kernel/cache.c b/arch/s390/kernel/cache.c
index 3a414c0f93ed..c0b03c28d157 100644
--- a/arch/s390/kernel/cache.c
+++ b/arch/s390/kernel/cache.c
@@ -378,9 +378,12 @@ static int __init cache_init(void)
378 if (!test_facility(34)) 378 if (!test_facility(34))
379 return 0; 379 return 0;
380 cache_build_info(); 380 cache_build_info();
381
382 cpu_notifier_register_begin();
381 for_each_online_cpu(cpu) 383 for_each_online_cpu(cpu)
382 cache_add_cpu(cpu); 384 cache_add_cpu(cpu);
383 hotcpu_notifier(cache_hotplug, 0); 385 __hotcpu_notifier(cache_hotplug, 0);
386 cpu_notifier_register_done();
384 return 0; 387 return 0;
385} 388}
386device_initcall(cache_init); 389device_initcall(cache_init);
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index 6b594439cca5..a734f3585ceb 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -386,6 +386,8 @@ static __init void detect_machine_facilities(void)
386 S390_lowcore.machine_flags |= MACHINE_FLAG_TE; 386 S390_lowcore.machine_flags |= MACHINE_FLAG_TE;
387 if (test_facility(66)) 387 if (test_facility(66))
388 S390_lowcore.machine_flags |= MACHINE_FLAG_RRBM; 388 S390_lowcore.machine_flags |= MACHINE_FLAG_RRBM;
389 if (test_facility(51))
390 S390_lowcore.machine_flags |= MACHINE_FLAG_TLB_LC;
389#endif 391#endif
390} 392}
391 393
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index 526d3735ed29..1662038516c0 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -38,9 +38,9 @@ __PT_R14 = __PT_GPRS + 56
38__PT_R15 = __PT_GPRS + 60 38__PT_R15 = __PT_GPRS + 60
39 39
40_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ 40_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \
41 _TIF_MCCK_PENDING | _TIF_PER_TRAP ) 41 _TIF_MCCK_PENDING | _TIF_PER_TRAP | _TIF_ASCE)
42_TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ 42_TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \
43 _TIF_MCCK_PENDING) 43 _TIF_MCCK_PENDING | _TIF_ASCE)
44_TIF_TRACE = (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | \ 44_TIF_TRACE = (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | \
45 _TIF_SYSCALL_TRACEPOINT) 45 _TIF_SYSCALL_TRACEPOINT)
46_TIF_TRANSFER = (_TIF_MCCK_PENDING | _TIF_TLB_WAIT) 46_TIF_TRANSFER = (_TIF_MCCK_PENDING | _TIF_TLB_WAIT)
@@ -241,6 +241,8 @@ sysc_work:
241 jo sysc_sigpending 241 jo sysc_sigpending
242 tm __TI_flags+3(%r12),_TIF_NOTIFY_RESUME 242 tm __TI_flags+3(%r12),_TIF_NOTIFY_RESUME
243 jo sysc_notify_resume 243 jo sysc_notify_resume
244 tm __TI_flags+3(%r12),_TIF_ASCE
245 jo sysc_uaccess
244 j sysc_return # beware of critical section cleanup 246 j sysc_return # beware of critical section cleanup
245 247
246# 248#
@@ -260,6 +262,14 @@ sysc_mcck_pending:
260 br %r1 # TIF bit will be cleared by handler 262 br %r1 # TIF bit will be cleared by handler
261 263
262# 264#
265# _TIF_ASCE is set, load user space asce
266#
267sysc_uaccess:
268 ni __TI_flags+3(%r12),255-_TIF_ASCE
269 lctl %c1,%c1,__LC_USER_ASCE # load primary asce
270 j sysc_return
271
272#
263# _TIF_SIGPENDING is set, call do_signal 273# _TIF_SIGPENDING is set, call do_signal
264# 274#
265sysc_sigpending: 275sysc_sigpending:
@@ -522,6 +532,8 @@ io_work_tif:
522 jo io_sigpending 532 jo io_sigpending
523 tm __TI_flags+3(%r12),_TIF_NOTIFY_RESUME 533 tm __TI_flags+3(%r12),_TIF_NOTIFY_RESUME
524 jo io_notify_resume 534 jo io_notify_resume
535 tm __TI_flags+3(%r12),_TIF_ASCE
536 jo io_uaccess
525 j io_return # beware of critical section cleanup 537 j io_return # beware of critical section cleanup
526 538
527# 539#
@@ -535,6 +547,14 @@ io_mcck_pending:
535 j io_return 547 j io_return
536 548
537# 549#
550# _TIF_ASCE is set, load user space asce
551#
552io_uaccess:
553 ni __TI_flags+3(%r12),255-_TIF_ASCE
554 lctl %c1,%c1,__LC_USER_ASCE # load primary asce
555 j io_return
556
557#
538# _TIF_NEED_RESCHED is set, call schedule 558# _TIF_NEED_RESCHED is set, call schedule
539# 559#
540io_reschedule: 560io_reschedule:
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
index e09dbe5f2901..5963e43618bb 100644
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -43,9 +43,9 @@ STACK_SIZE = 1 << STACK_SHIFT
43STACK_INIT = STACK_SIZE - STACK_FRAME_OVERHEAD - __PT_SIZE 43STACK_INIT = STACK_SIZE - STACK_FRAME_OVERHEAD - __PT_SIZE
44 44
45_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ 45_TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \
46 _TIF_MCCK_PENDING | _TIF_PER_TRAP ) 46 _TIF_MCCK_PENDING | _TIF_PER_TRAP | _TIF_ASCE)
47_TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ 47_TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \
48 _TIF_MCCK_PENDING) 48 _TIF_MCCK_PENDING | _TIF_ASCE)
49_TIF_TRACE = (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | \ 49_TIF_TRACE = (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | \
50 _TIF_SYSCALL_TRACEPOINT) 50 _TIF_SYSCALL_TRACEPOINT)
51_TIF_TRANSFER = (_TIF_MCCK_PENDING | _TIF_TLB_WAIT) 51_TIF_TRANSFER = (_TIF_MCCK_PENDING | _TIF_TLB_WAIT)
@@ -275,6 +275,8 @@ sysc_work:
275 jo sysc_sigpending 275 jo sysc_sigpending
276 tm __TI_flags+7(%r12),_TIF_NOTIFY_RESUME 276 tm __TI_flags+7(%r12),_TIF_NOTIFY_RESUME
277 jo sysc_notify_resume 277 jo sysc_notify_resume
278 tm __TI_flags+7(%r12),_TIF_ASCE
279 jo sysc_uaccess
278 j sysc_return # beware of critical section cleanup 280 j sysc_return # beware of critical section cleanup
279 281
280# 282#
@@ -292,6 +294,14 @@ sysc_mcck_pending:
292 jg s390_handle_mcck # TIF bit will be cleared by handler 294 jg s390_handle_mcck # TIF bit will be cleared by handler
293 295
294# 296#
297# _TIF_ASCE is set, load user space asce
298#
299sysc_uaccess:
300 ni __TI_flags+7(%r12),255-_TIF_ASCE
301 lctlg %c1,%c1,__LC_USER_ASCE # load primary asce
302 j sysc_return
303
304#
295# _TIF_SIGPENDING is set, call do_signal 305# _TIF_SIGPENDING is set, call do_signal
296# 306#
297sysc_sigpending: 307sysc_sigpending:
@@ -559,6 +569,8 @@ io_work_tif:
559 jo io_sigpending 569 jo io_sigpending
560 tm __TI_flags+7(%r12),_TIF_NOTIFY_RESUME 570 tm __TI_flags+7(%r12),_TIF_NOTIFY_RESUME
561 jo io_notify_resume 571 jo io_notify_resume
572 tm __TI_flags+7(%r12),_TIF_ASCE
573 jo io_uaccess
562 j io_return # beware of critical section cleanup 574 j io_return # beware of critical section cleanup
563 575
564# 576#
@@ -571,6 +583,14 @@ io_mcck_pending:
571 j io_return 583 j io_return
572 584
573# 585#
586# _TIF_ASCE is set, load user space asce
587#
588io_uaccess:
589 ni __TI_flags+7(%r12),255-_TIF_ASCE
590 lctlg %c1,%c1,__LC_USER_ASCE # load primary asce
591 j io_return
592
593#
574# _TIF_NEED_RESCHED is set, call schedule 594# _TIF_NEED_RESCHED is set, call schedule
575# 595#
576io_reschedule: 596io_reschedule:
diff --git a/arch/s390/kernel/ftrace.c b/arch/s390/kernel/ftrace.c
index 224db03e9518..54d6493c4a56 100644
--- a/arch/s390/kernel/ftrace.c
+++ b/arch/s390/kernel/ftrace.c
@@ -130,9 +130,8 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
130 return 0; 130 return 0;
131} 131}
132 132
133int __init ftrace_dyn_arch_init(void *data) 133int __init ftrace_dyn_arch_init(void)
134{ 134{
135 *(unsigned long *) data = 0;
136 return 0; 135 return 0;
137} 136}
138 137
diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c
index a770be97db4d..c7463aa0014b 100644
--- a/arch/s390/kernel/irq.c
+++ b/arch/s390/kernel/irq.c
@@ -85,6 +85,7 @@ static const struct irq_class irqclass_sub_desc[NR_ARCH_IRQS] = {
85 [IRQIO_PCI] = {.name = "PCI", .desc = "[I/O] PCI Interrupt" }, 85 [IRQIO_PCI] = {.name = "PCI", .desc = "[I/O] PCI Interrupt" },
86 [IRQIO_MSI] = {.name = "MSI", .desc = "[I/O] MSI Interrupt" }, 86 [IRQIO_MSI] = {.name = "MSI", .desc = "[I/O] MSI Interrupt" },
87 [IRQIO_VIR] = {.name = "VIR", .desc = "[I/O] Virtual I/O Devices"}, 87 [IRQIO_VIR] = {.name = "VIR", .desc = "[I/O] Virtual I/O Devices"},
88 [IRQIO_VAI] = {.name = "VAI", .desc = "[I/O] Virtual I/O Devices AI"},
88 [NMI_NMI] = {.name = "NMI", .desc = "[NMI] Machine Check"}, 89 [NMI_NMI] = {.name = "NMI", .desc = "[NMI] Machine Check"},
89 [CPU_RST] = {.name = "RST", .desc = "[CPU] CPU Restart"}, 90 [CPU_RST] = {.name = "RST", .desc = "[CPU] CPU Restart"},
90}; 91};
@@ -206,7 +207,7 @@ static inline int ext_hash(u16 code)
206 return (code + (code >> 9)) & (ARRAY_SIZE(ext_int_hash) - 1); 207 return (code + (code >> 9)) & (ARRAY_SIZE(ext_int_hash) - 1);
207} 208}
208 209
209int register_external_interrupt(u16 code, ext_int_handler_t handler) 210int register_external_irq(u16 code, ext_int_handler_t handler)
210{ 211{
211 struct ext_int_info *p; 212 struct ext_int_info *p;
212 unsigned long flags; 213 unsigned long flags;
@@ -224,9 +225,9 @@ int register_external_interrupt(u16 code, ext_int_handler_t handler)
224 spin_unlock_irqrestore(&ext_int_hash_lock, flags); 225 spin_unlock_irqrestore(&ext_int_hash_lock, flags);
225 return 0; 226 return 0;
226} 227}
227EXPORT_SYMBOL(register_external_interrupt); 228EXPORT_SYMBOL(register_external_irq);
228 229
229int unregister_external_interrupt(u16 code, ext_int_handler_t handler) 230int unregister_external_irq(u16 code, ext_int_handler_t handler)
230{ 231{
231 struct ext_int_info *p; 232 struct ext_int_info *p;
232 unsigned long flags; 233 unsigned long flags;
@@ -242,7 +243,7 @@ int unregister_external_interrupt(u16 code, ext_int_handler_t handler)
242 spin_unlock_irqrestore(&ext_int_hash_lock, flags); 243 spin_unlock_irqrestore(&ext_int_hash_lock, flags);
243 return 0; 244 return 0;
244} 245}
245EXPORT_SYMBOL(unregister_external_interrupt); 246EXPORT_SYMBOL(unregister_external_irq);
246 247
247static irqreturn_t do_ext_interrupt(int irq, void *dummy) 248static irqreturn_t do_ext_interrupt(int irq, void *dummy)
248{ 249{
@@ -252,7 +253,7 @@ static irqreturn_t do_ext_interrupt(int irq, void *dummy)
252 int index; 253 int index;
253 254
254 ext_code = *(struct ext_code *) &regs->int_code; 255 ext_code = *(struct ext_code *) &regs->int_code;
255 if (ext_code.code != 0x1004) 256 if (ext_code.code != EXT_IRQ_CLK_COMP)
256 __get_cpu_var(s390_idle).nohz_delay = 1; 257 __get_cpu_var(s390_idle).nohz_delay = 1;
257 258
258 index = ext_hash(ext_code.code); 259 index = ext_hash(ext_code.code);
diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c
index f51214c04858..ea75d011a6fc 100644
--- a/arch/s390/kernel/perf_cpum_cf.c
+++ b/arch/s390/kernel/perf_cpum_cf.c
@@ -673,7 +673,8 @@ static int __init cpumf_pmu_init(void)
673 ctl_clear_bit(0, 48); 673 ctl_clear_bit(0, 48);
674 674
675 /* register handler for measurement-alert interruptions */ 675 /* register handler for measurement-alert interruptions */
676 rc = register_external_interrupt(0x1407, cpumf_measurement_alert); 676 rc = register_external_irq(EXT_IRQ_MEASURE_ALERT,
677 cpumf_measurement_alert);
677 if (rc) { 678 if (rc) {
678 pr_err("Registering for CPU-measurement alerts " 679 pr_err("Registering for CPU-measurement alerts "
679 "failed with rc=%i\n", rc); 680 "failed with rc=%i\n", rc);
@@ -684,7 +685,8 @@ static int __init cpumf_pmu_init(void)
684 rc = perf_pmu_register(&cpumf_pmu, "cpum_cf", PERF_TYPE_RAW); 685 rc = perf_pmu_register(&cpumf_pmu, "cpum_cf", PERF_TYPE_RAW);
685 if (rc) { 686 if (rc) {
686 pr_err("Registering the cpum_cf PMU failed with rc=%i\n", rc); 687 pr_err("Registering the cpum_cf PMU failed with rc=%i\n", rc);
687 unregister_external_interrupt(0x1407, cpumf_measurement_alert); 688 unregister_external_irq(EXT_IRQ_MEASURE_ALERT,
689 cpumf_measurement_alert);
688 goto out; 690 goto out;
689 } 691 }
690 perf_cpu_notifier(cpumf_pmu_notifier); 692 perf_cpu_notifier(cpumf_pmu_notifier);
diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_sf.c
index 6c0d29827cb6..ea0c7b2ef030 100644
--- a/arch/s390/kernel/perf_cpum_sf.c
+++ b/arch/s390/kernel/perf_cpum_sf.c
@@ -1621,7 +1621,8 @@ static int __init init_cpum_sampling_pmu(void)
1621 pr_err("Registering for s390dbf failed\n"); 1621 pr_err("Registering for s390dbf failed\n");
1622 debug_register_view(sfdbg, &debug_sprintf_view); 1622 debug_register_view(sfdbg, &debug_sprintf_view);
1623 1623
1624 err = register_external_interrupt(0x1407, cpumf_measurement_alert); 1624 err = register_external_irq(EXT_IRQ_MEASURE_ALERT,
1625 cpumf_measurement_alert);
1625 if (err) { 1626 if (err) {
1626 pr_cpumsf_err(RS_INIT_FAILURE_ALRT); 1627 pr_cpumsf_err(RS_INIT_FAILURE_ALRT);
1627 goto out; 1628 goto out;
@@ -1630,7 +1631,8 @@ static int __init init_cpum_sampling_pmu(void)
1630 err = perf_pmu_register(&cpumf_sampling, "cpum_sf", PERF_TYPE_RAW); 1631 err = perf_pmu_register(&cpumf_sampling, "cpum_sf", PERF_TYPE_RAW);
1631 if (err) { 1632 if (err) {
1632 pr_cpumsf_err(RS_INIT_FAILURE_PERF); 1633 pr_cpumsf_err(RS_INIT_FAILURE_PERF);
1633 unregister_external_interrupt(0x1407, cpumf_measurement_alert); 1634 unregister_external_irq(EXT_IRQ_MEASURE_ALERT,
1635 cpumf_measurement_alert);
1634 goto out; 1636 goto out;
1635 } 1637 }
1636 perf_cpu_notifier(cpumf_pmu_notifier); 1638 perf_cpu_notifier(cpumf_pmu_notifier);
diff --git a/arch/s390/kernel/runtime_instr.c b/arch/s390/kernel/runtime_instr.c
index d817cce7e72d..26b4ae96fdd7 100644
--- a/arch/s390/kernel/runtime_instr.c
+++ b/arch/s390/kernel/runtime_instr.c
@@ -138,7 +138,8 @@ static int __init runtime_instr_init(void)
138 return 0; 138 return 0;
139 139
140 irq_subclass_register(IRQ_SUBCLASS_MEASUREMENT_ALERT); 140 irq_subclass_register(IRQ_SUBCLASS_MEASUREMENT_ALERT);
141 rc = register_external_interrupt(0x1407, runtime_instr_int_handler); 141 rc = register_external_irq(EXT_IRQ_MEASURE_ALERT,
142 runtime_instr_int_handler);
142 if (rc) 143 if (rc)
143 irq_subclass_unregister(IRQ_SUBCLASS_MEASUREMENT_ALERT); 144 irq_subclass_unregister(IRQ_SUBCLASS_MEASUREMENT_ALERT);
144 else 145 else
diff --git a/arch/s390/kernel/sclp.S b/arch/s390/kernel/sclp.S
index 29bd7bec4176..a41f2c99dcc8 100644
--- a/arch/s390/kernel/sclp.S
+++ b/arch/s390/kernel/sclp.S
@@ -9,6 +9,7 @@
9 */ 9 */
10 10
11#include <linux/linkage.h> 11#include <linux/linkage.h>
12#include <asm/irq.h>
12 13
13LC_EXT_NEW_PSW = 0x58 # addr of ext int handler 14LC_EXT_NEW_PSW = 0x58 # addr of ext int handler
14LC_EXT_NEW_PSW_64 = 0x1b0 # addr of ext int handler 64 bit 15LC_EXT_NEW_PSW_64 = 0x1b0 # addr of ext int handler 64 bit
@@ -73,9 +74,9 @@ _sclp_wait_int:
73 lpsw .LwaitpswS1-.LbaseS1(%r13) # wait until interrupt 74 lpsw .LwaitpswS1-.LbaseS1(%r13) # wait until interrupt
74.LwaitS1: 75.LwaitS1:
75 lh %r7,LC_EXT_INT_CODE 76 lh %r7,LC_EXT_INT_CODE
76 chi %r7,0x1004 # timeout? 77 chi %r7,EXT_IRQ_CLK_COMP # timeout?
77 je .LtimeoutS1 78 je .LtimeoutS1
78 chi %r7,0x2401 # service int? 79 chi %r7,EXT_IRQ_SERVICE_SIG # service int?
79 jne .LloopS1 80 jne .LloopS1
80 sr %r2,%r2 81 sr %r2,%r2
81 l %r3,LC_EXT_INT_PARAM 82 l %r3,LC_EXT_INT_PARAM
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 8827883310dd..512ce1cde2a4 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -236,6 +236,9 @@ static void pcpu_prepare_secondary(struct pcpu *pcpu, int cpu)
236{ 236{
237 struct _lowcore *lc = pcpu->lowcore; 237 struct _lowcore *lc = pcpu->lowcore;
238 238
239 if (MACHINE_HAS_TLB_LC)
240 cpumask_set_cpu(cpu, &init_mm.context.cpu_attach_mask);
241 cpumask_set_cpu(cpu, mm_cpumask(&init_mm));
239 atomic_inc(&init_mm.context.attach_count); 242 atomic_inc(&init_mm.context.attach_count);
240 lc->cpu_nr = cpu; 243 lc->cpu_nr = cpu;
241 lc->percpu_offset = __per_cpu_offset[cpu]; 244 lc->percpu_offset = __per_cpu_offset[cpu];
@@ -760,6 +763,9 @@ void __cpu_die(unsigned int cpu)
760 cpu_relax(); 763 cpu_relax();
761 pcpu_free_lowcore(pcpu); 764 pcpu_free_lowcore(pcpu);
762 atomic_dec(&init_mm.context.attach_count); 765 atomic_dec(&init_mm.context.attach_count);
766 cpumask_clear_cpu(cpu, mm_cpumask(&init_mm));
767 if (MACHINE_HAS_TLB_LC)
768 cpumask_clear_cpu(cpu, &init_mm.context.cpu_attach_mask);
763} 769}
764 770
765void __noreturn cpu_die(void) 771void __noreturn cpu_die(void)
@@ -785,10 +791,10 @@ void __init smp_fill_possible_mask(void)
785void __init smp_prepare_cpus(unsigned int max_cpus) 791void __init smp_prepare_cpus(unsigned int max_cpus)
786{ 792{
787 /* request the 0x1201 emergency signal external interrupt */ 793 /* request the 0x1201 emergency signal external interrupt */
788 if (register_external_interrupt(0x1201, do_ext_call_interrupt) != 0) 794 if (register_external_irq(EXT_IRQ_EMERGENCY_SIG, do_ext_call_interrupt))
789 panic("Couldn't request external interrupt 0x1201"); 795 panic("Couldn't request external interrupt 0x1201");
790 /* request the 0x1202 external call external interrupt */ 796 /* request the 0x1202 external call external interrupt */
791 if (register_external_interrupt(0x1202, do_ext_call_interrupt) != 0) 797 if (register_external_irq(EXT_IRQ_EXTERNAL_CALL, do_ext_call_interrupt))
792 panic("Couldn't request external interrupt 0x1202"); 798 panic("Couldn't request external interrupt 0x1202");
793 smp_detect_cpus(); 799 smp_detect_cpus();
794} 800}
@@ -1057,19 +1063,24 @@ static DEVICE_ATTR(rescan, 0200, NULL, rescan_store);
1057 1063
1058static int __init s390_smp_init(void) 1064static int __init s390_smp_init(void)
1059{ 1065{
1060 int cpu, rc; 1066 int cpu, rc = 0;
1061 1067
1062 hotcpu_notifier(smp_cpu_notify, 0);
1063#ifdef CONFIG_HOTPLUG_CPU 1068#ifdef CONFIG_HOTPLUG_CPU
1064 rc = device_create_file(cpu_subsys.dev_root, &dev_attr_rescan); 1069 rc = device_create_file(cpu_subsys.dev_root, &dev_attr_rescan);
1065 if (rc) 1070 if (rc)
1066 return rc; 1071 return rc;
1067#endif 1072#endif
1073 cpu_notifier_register_begin();
1068 for_each_present_cpu(cpu) { 1074 for_each_present_cpu(cpu) {
1069 rc = smp_add_present_cpu(cpu); 1075 rc = smp_add_present_cpu(cpu);
1070 if (rc) 1076 if (rc)
1071 return rc; 1077 goto out;
1072 } 1078 }
1073 return 0; 1079
1080 __hotcpu_notifier(smp_cpu_notify, 0);
1081
1082out:
1083 cpu_notifier_register_done();
1084 return rc;
1074} 1085}
1075subsys_initcall(s390_smp_init); 1086subsys_initcall(s390_smp_init);
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index dd95f1631621..386d37a228bb 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -262,11 +262,11 @@ void __init time_init(void)
262 stp_reset(); 262 stp_reset();
263 263
264 /* request the clock comparator external interrupt */ 264 /* request the clock comparator external interrupt */
265 if (register_external_interrupt(0x1004, clock_comparator_interrupt)) 265 if (register_external_irq(EXT_IRQ_CLK_COMP, clock_comparator_interrupt))
266 panic("Couldn't request external interrupt 0x1004"); 266 panic("Couldn't request external interrupt 0x1004");
267 267
268 /* request the timing alert external interrupt */ 268 /* request the timing alert external interrupt */
269 if (register_external_interrupt(0x1406, timing_alert_interrupt)) 269 if (register_external_irq(EXT_IRQ_TIMING_ALERT, timing_alert_interrupt))
270 panic("Couldn't request external interrupt 0x1406"); 270 panic("Couldn't request external interrupt 0x1406");
271 271
272 if (clocksource_register(&clocksource_tod) != 0) 272 if (clocksource_register(&clocksource_tod) != 0)
diff --git a/arch/s390/kvm/Kconfig b/arch/s390/kvm/Kconfig
index 70b46eacf8e1..10d529ac9821 100644
--- a/arch/s390/kvm/Kconfig
+++ b/arch/s390/kvm/Kconfig
@@ -23,6 +23,10 @@ config KVM
23 select ANON_INODES 23 select ANON_INODES
24 select HAVE_KVM_CPU_RELAX_INTERCEPT 24 select HAVE_KVM_CPU_RELAX_INTERCEPT
25 select HAVE_KVM_EVENTFD 25 select HAVE_KVM_EVENTFD
26 select KVM_ASYNC_PF
27 select KVM_ASYNC_PF_SYNC
28 select HAVE_KVM_IRQCHIP
29 select HAVE_KVM_IRQ_ROUTING
26 ---help--- 30 ---help---
27 Support hosting paravirtualized guest machines using the SIE 31 Support hosting paravirtualized guest machines using the SIE
28 virtualization capability on the mainframe. This should work 32 virtualization capability on the mainframe. This should work
diff --git a/arch/s390/kvm/Makefile b/arch/s390/kvm/Makefile
index 40b4c6470f88..d3adb37e93a4 100644
--- a/arch/s390/kvm/Makefile
+++ b/arch/s390/kvm/Makefile
@@ -7,7 +7,7 @@
7# as published by the Free Software Foundation. 7# as published by the Free Software Foundation.
8 8
9KVM := ../../../virt/kvm 9KVM := ../../../virt/kvm
10common-objs = $(KVM)/kvm_main.o $(KVM)/eventfd.o 10common-objs = $(KVM)/kvm_main.o $(KVM)/eventfd.o $(KVM)/async_pf.o $(KVM)/irqchip.o
11 11
12ccflags-y := -Ivirt/kvm -Iarch/s390/kvm 12ccflags-y := -Ivirt/kvm -Iarch/s390/kvm
13 13
diff --git a/arch/s390/kvm/diag.c b/arch/s390/kvm/diag.c
index 6f9cfa500372..08dfc839a6cf 100644
--- a/arch/s390/kvm/diag.c
+++ b/arch/s390/kvm/diag.c
@@ -18,6 +18,7 @@
18#include "kvm-s390.h" 18#include "kvm-s390.h"
19#include "trace.h" 19#include "trace.h"
20#include "trace-s390.h" 20#include "trace-s390.h"
21#include "gaccess.h"
21 22
22static int diag_release_pages(struct kvm_vcpu *vcpu) 23static int diag_release_pages(struct kvm_vcpu *vcpu)
23{ 24{
@@ -47,6 +48,87 @@ static int diag_release_pages(struct kvm_vcpu *vcpu)
47 return 0; 48 return 0;
48} 49}
49 50
51static int __diag_page_ref_service(struct kvm_vcpu *vcpu)
52{
53 struct prs_parm {
54 u16 code;
55 u16 subcode;
56 u16 parm_len;
57 u16 parm_version;
58 u64 token_addr;
59 u64 select_mask;
60 u64 compare_mask;
61 u64 zarch;
62 };
63 struct prs_parm parm;
64 int rc;
65 u16 rx = (vcpu->arch.sie_block->ipa & 0xf0) >> 4;
66 u16 ry = (vcpu->arch.sie_block->ipa & 0x0f);
67 unsigned long hva_token = KVM_HVA_ERR_BAD;
68
69 if (vcpu->run->s.regs.gprs[rx] & 7)
70 return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
71 if (copy_from_guest(vcpu, &parm, vcpu->run->s.regs.gprs[rx], sizeof(parm)))
72 return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
73 if (parm.parm_version != 2 || parm.parm_len < 5 || parm.code != 0x258)
74 return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
75
76 switch (parm.subcode) {
77 case 0: /* TOKEN */
78 if (vcpu->arch.pfault_token != KVM_S390_PFAULT_TOKEN_INVALID) {
79 /*
80 * If the pagefault handshake is already activated,
81 * the token must not be changed. We have to return
82 * decimal 8 instead, as mandated in SC24-6084.
83 */
84 vcpu->run->s.regs.gprs[ry] = 8;
85 return 0;
86 }
87
88 if ((parm.compare_mask & parm.select_mask) != parm.compare_mask ||
89 parm.token_addr & 7 || parm.zarch != 0x8000000000000000ULL)
90 return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
91
92 hva_token = gfn_to_hva(vcpu->kvm, gpa_to_gfn(parm.token_addr));
93 if (kvm_is_error_hva(hva_token))
94 return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
95
96 vcpu->arch.pfault_token = parm.token_addr;
97 vcpu->arch.pfault_select = parm.select_mask;
98 vcpu->arch.pfault_compare = parm.compare_mask;
99 vcpu->run->s.regs.gprs[ry] = 0;
100 rc = 0;
101 break;
102 case 1: /*
103 * CANCEL
104 * Specification allows to let already pending tokens survive
105 * the cancel, therefore to reduce code complexity, we assume
106 * all outstanding tokens are already pending.
107 */
108 if (parm.token_addr || parm.select_mask ||
109 parm.compare_mask || parm.zarch)
110 return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
111
112 vcpu->run->s.regs.gprs[ry] = 0;
113 /*
114 * If the pfault handling was not established or is already
115 * canceled SC24-6084 requests to return decimal 4.
116 */
117 if (vcpu->arch.pfault_token == KVM_S390_PFAULT_TOKEN_INVALID)
118 vcpu->run->s.regs.gprs[ry] = 4;
119 else
120 vcpu->arch.pfault_token = KVM_S390_PFAULT_TOKEN_INVALID;
121
122 rc = 0;
123 break;
124 default:
125 rc = -EOPNOTSUPP;
126 break;
127 }
128
129 return rc;
130}
131
50static int __diag_time_slice_end(struct kvm_vcpu *vcpu) 132static int __diag_time_slice_end(struct kvm_vcpu *vcpu)
51{ 133{
52 VCPU_EVENT(vcpu, 5, "%s", "diag time slice end"); 134 VCPU_EVENT(vcpu, 5, "%s", "diag time slice end");
@@ -85,6 +167,10 @@ static int __diag_ipl_functions(struct kvm_vcpu *vcpu)
85 167
86 VCPU_EVENT(vcpu, 5, "diag ipl functions, subcode %lx", subcode); 168 VCPU_EVENT(vcpu, 5, "diag ipl functions, subcode %lx", subcode);
87 switch (subcode) { 169 switch (subcode) {
170 case 0:
171 case 1:
172 page_table_reset_pgste(current->mm, 0, TASK_SIZE);
173 return -EOPNOTSUPP;
88 case 3: 174 case 3:
89 vcpu->run->s390_reset_flags = KVM_S390_RESET_CLEAR; 175 vcpu->run->s390_reset_flags = KVM_S390_RESET_CLEAR;
90 page_table_reset_pgste(current->mm, 0, TASK_SIZE); 176 page_table_reset_pgste(current->mm, 0, TASK_SIZE);
@@ -153,6 +239,8 @@ int kvm_s390_handle_diag(struct kvm_vcpu *vcpu)
153 return __diag_time_slice_end(vcpu); 239 return __diag_time_slice_end(vcpu);
154 case 0x9c: 240 case 0x9c:
155 return __diag_time_slice_end_directed(vcpu); 241 return __diag_time_slice_end_directed(vcpu);
242 case 0x258:
243 return __diag_page_ref_service(vcpu);
156 case 0x308: 244 case 0x308:
157 return __diag_ipl_functions(vcpu); 245 return __diag_ipl_functions(vcpu);
158 case 0x500: 246 case 0x500:
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 5f79d2d79ca7..200a8f9390b6 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * handling kvm guest interrupts 2 * handling kvm guest interrupts
3 * 3 *
4 * Copyright IBM Corp. 2008 4 * Copyright IBM Corp. 2008,2014
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 only) 7 * it under the terms of the GNU General Public License (version 2 only)
@@ -13,6 +13,7 @@
13#include <linux/interrupt.h> 13#include <linux/interrupt.h>
14#include <linux/kvm_host.h> 14#include <linux/kvm_host.h>
15#include <linux/hrtimer.h> 15#include <linux/hrtimer.h>
16#include <linux/mmu_context.h>
16#include <linux/signal.h> 17#include <linux/signal.h>
17#include <linux/slab.h> 18#include <linux/slab.h>
18#include <asm/asm-offsets.h> 19#include <asm/asm-offsets.h>
@@ -31,7 +32,7 @@ static int is_ioint(u64 type)
31 return ((type & 0xfffe0000u) != 0xfffe0000u); 32 return ((type & 0xfffe0000u) != 0xfffe0000u);
32} 33}
33 34
34static int psw_extint_disabled(struct kvm_vcpu *vcpu) 35int psw_extint_disabled(struct kvm_vcpu *vcpu)
35{ 36{
36 return !(vcpu->arch.sie_block->gpsw.mask & PSW_MASK_EXT); 37 return !(vcpu->arch.sie_block->gpsw.mask & PSW_MASK_EXT);
37} 38}
@@ -78,11 +79,8 @@ static int __interrupt_is_deliverable(struct kvm_vcpu *vcpu,
78 return 1; 79 return 1;
79 return 0; 80 return 0;
80 case KVM_S390_INT_SERVICE: 81 case KVM_S390_INT_SERVICE:
81 if (psw_extint_disabled(vcpu)) 82 case KVM_S390_INT_PFAULT_INIT:
82 return 0; 83 case KVM_S390_INT_PFAULT_DONE:
83 if (vcpu->arch.sie_block->gcr[0] & 0x200ul)
84 return 1;
85 return 0;
86 case KVM_S390_INT_VIRTIO: 84 case KVM_S390_INT_VIRTIO:
87 if (psw_extint_disabled(vcpu)) 85 if (psw_extint_disabled(vcpu))
88 return 0; 86 return 0;
@@ -117,14 +115,12 @@ static int __interrupt_is_deliverable(struct kvm_vcpu *vcpu,
117 115
118static void __set_cpu_idle(struct kvm_vcpu *vcpu) 116static void __set_cpu_idle(struct kvm_vcpu *vcpu)
119{ 117{
120 BUG_ON(vcpu->vcpu_id > KVM_MAX_VCPUS - 1);
121 atomic_set_mask(CPUSTAT_WAIT, &vcpu->arch.sie_block->cpuflags); 118 atomic_set_mask(CPUSTAT_WAIT, &vcpu->arch.sie_block->cpuflags);
122 set_bit(vcpu->vcpu_id, vcpu->arch.local_int.float_int->idle_mask); 119 set_bit(vcpu->vcpu_id, vcpu->arch.local_int.float_int->idle_mask);
123} 120}
124 121
125static void __unset_cpu_idle(struct kvm_vcpu *vcpu) 122static void __unset_cpu_idle(struct kvm_vcpu *vcpu)
126{ 123{
127 BUG_ON(vcpu->vcpu_id > KVM_MAX_VCPUS - 1);
128 atomic_clear_mask(CPUSTAT_WAIT, &vcpu->arch.sie_block->cpuflags); 124 atomic_clear_mask(CPUSTAT_WAIT, &vcpu->arch.sie_block->cpuflags);
129 clear_bit(vcpu->vcpu_id, vcpu->arch.local_int.float_int->idle_mask); 125 clear_bit(vcpu->vcpu_id, vcpu->arch.local_int.float_int->idle_mask);
130} 126}
@@ -150,6 +146,8 @@ static void __set_intercept_indicator(struct kvm_vcpu *vcpu,
150 case KVM_S390_INT_EXTERNAL_CALL: 146 case KVM_S390_INT_EXTERNAL_CALL:
151 case KVM_S390_INT_EMERGENCY: 147 case KVM_S390_INT_EMERGENCY:
152 case KVM_S390_INT_SERVICE: 148 case KVM_S390_INT_SERVICE:
149 case KVM_S390_INT_PFAULT_INIT:
150 case KVM_S390_INT_PFAULT_DONE:
153 case KVM_S390_INT_VIRTIO: 151 case KVM_S390_INT_VIRTIO:
154 if (psw_extint_disabled(vcpu)) 152 if (psw_extint_disabled(vcpu))
155 __set_cpuflag(vcpu, CPUSTAT_EXT_INT); 153 __set_cpuflag(vcpu, CPUSTAT_EXT_INT);
@@ -223,6 +221,30 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
223 rc |= put_guest(vcpu, inti->ext.ext_params, 221 rc |= put_guest(vcpu, inti->ext.ext_params,
224 (u32 __user *)__LC_EXT_PARAMS); 222 (u32 __user *)__LC_EXT_PARAMS);
225 break; 223 break;
224 case KVM_S390_INT_PFAULT_INIT:
225 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, 0,
226 inti->ext.ext_params2);
227 rc = put_guest(vcpu, 0x2603, (u16 __user *) __LC_EXT_INT_CODE);
228 rc |= put_guest(vcpu, 0x0600, (u16 __user *) __LC_EXT_CPU_ADDR);
229 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW,
230 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
231 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw,
232 __LC_EXT_NEW_PSW, sizeof(psw_t));
233 rc |= put_guest(vcpu, inti->ext.ext_params2,
234 (u64 __user *) __LC_EXT_PARAMS2);
235 break;
236 case KVM_S390_INT_PFAULT_DONE:
237 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, 0,
238 inti->ext.ext_params2);
239 rc = put_guest(vcpu, 0x2603, (u16 __user *) __LC_EXT_INT_CODE);
240 rc |= put_guest(vcpu, 0x0680, (u16 __user *) __LC_EXT_CPU_ADDR);
241 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW,
242 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
243 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw,
244 __LC_EXT_NEW_PSW, sizeof(psw_t));
245 rc |= put_guest(vcpu, inti->ext.ext_params2,
246 (u64 __user *) __LC_EXT_PARAMS2);
247 break;
226 case KVM_S390_INT_VIRTIO: 248 case KVM_S390_INT_VIRTIO:
227 VCPU_EVENT(vcpu, 4, "interrupt: virtio parm:%x,parm64:%llx", 249 VCPU_EVENT(vcpu, 4, "interrupt: virtio parm:%x,parm64:%llx",
228 inti->ext.ext_params, inti->ext.ext_params2); 250 inti->ext.ext_params, inti->ext.ext_params2);
@@ -357,7 +379,7 @@ static int __try_deliver_ckc_interrupt(struct kvm_vcpu *vcpu)
357 return 1; 379 return 1;
358} 380}
359 381
360static int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu) 382int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu)
361{ 383{
362 struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int; 384 struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
363 struct kvm_s390_float_interrupt *fi = vcpu->arch.local_int.float_int; 385 struct kvm_s390_float_interrupt *fi = vcpu->arch.local_int.float_int;
@@ -482,11 +504,26 @@ enum hrtimer_restart kvm_s390_idle_wakeup(struct hrtimer *timer)
482 struct kvm_vcpu *vcpu; 504 struct kvm_vcpu *vcpu;
483 505
484 vcpu = container_of(timer, struct kvm_vcpu, arch.ckc_timer); 506 vcpu = container_of(timer, struct kvm_vcpu, arch.ckc_timer);
507 vcpu->preempted = true;
485 tasklet_schedule(&vcpu->arch.tasklet); 508 tasklet_schedule(&vcpu->arch.tasklet);
486 509
487 return HRTIMER_NORESTART; 510 return HRTIMER_NORESTART;
488} 511}
489 512
513void kvm_s390_clear_local_irqs(struct kvm_vcpu *vcpu)
514{
515 struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
516 struct kvm_s390_interrupt_info *n, *inti = NULL;
517
518 spin_lock_bh(&li->lock);
519 list_for_each_entry_safe(inti, n, &li->list, list) {
520 list_del(&inti->list);
521 kfree(inti);
522 }
523 atomic_set(&li->active, 0);
524 spin_unlock_bh(&li->lock);
525}
526
490void kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu) 527void kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu)
491{ 528{
492 struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int; 529 struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
@@ -528,6 +565,7 @@ void kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu)
528 list_for_each_entry_safe(inti, n, &fi->list, list) { 565 list_for_each_entry_safe(inti, n, &fi->list, list) {
529 if (__interrupt_is_deliverable(vcpu, inti)) { 566 if (__interrupt_is_deliverable(vcpu, inti)) {
530 list_del(&inti->list); 567 list_del(&inti->list);
568 fi->irq_count--;
531 deliver = 1; 569 deliver = 1;
532 break; 570 break;
533 } 571 }
@@ -583,6 +621,7 @@ void kvm_s390_deliver_pending_machine_checks(struct kvm_vcpu *vcpu)
583 if ((inti->type == KVM_S390_MCHK) && 621 if ((inti->type == KVM_S390_MCHK) &&
584 __interrupt_is_deliverable(vcpu, inti)) { 622 __interrupt_is_deliverable(vcpu, inti)) {
585 list_del(&inti->list); 623 list_del(&inti->list);
624 fi->irq_count--;
586 deliver = 1; 625 deliver = 1;
587 break; 626 break;
588 } 627 }
@@ -650,8 +689,10 @@ struct kvm_s390_interrupt_info *kvm_s390_get_io_int(struct kvm *kvm,
650 inti = iter; 689 inti = iter;
651 break; 690 break;
652 } 691 }
653 if (inti) 692 if (inti) {
654 list_del_init(&inti->list); 693 list_del_init(&inti->list);
694 fi->irq_count--;
695 }
655 if (list_empty(&fi->list)) 696 if (list_empty(&fi->list))
656 atomic_set(&fi->active, 0); 697 atomic_set(&fi->active, 0);
657 spin_unlock(&fi->lock); 698 spin_unlock(&fi->lock);
@@ -659,53 +700,101 @@ struct kvm_s390_interrupt_info *kvm_s390_get_io_int(struct kvm *kvm,
659 return inti; 700 return inti;
660} 701}
661 702
662int kvm_s390_inject_vm(struct kvm *kvm, 703static int __inject_vm(struct kvm *kvm, struct kvm_s390_interrupt_info *inti)
663 struct kvm_s390_interrupt *s390int)
664{ 704{
665 struct kvm_s390_local_interrupt *li; 705 struct kvm_s390_local_interrupt *li;
666 struct kvm_s390_float_interrupt *fi; 706 struct kvm_s390_float_interrupt *fi;
667 struct kvm_s390_interrupt_info *inti, *iter; 707 struct kvm_s390_interrupt_info *iter;
708 struct kvm_vcpu *dst_vcpu = NULL;
668 int sigcpu; 709 int sigcpu;
710 int rc = 0;
711
712 mutex_lock(&kvm->lock);
713 fi = &kvm->arch.float_int;
714 spin_lock(&fi->lock);
715 if (fi->irq_count >= KVM_S390_MAX_FLOAT_IRQS) {
716 rc = -EINVAL;
717 goto unlock_fi;
718 }
719 fi->irq_count++;
720 if (!is_ioint(inti->type)) {
721 list_add_tail(&inti->list, &fi->list);
722 } else {
723 u64 isc_bits = int_word_to_isc_bits(inti->io.io_int_word);
724
725 /* Keep I/O interrupts sorted in isc order. */
726 list_for_each_entry(iter, &fi->list, list) {
727 if (!is_ioint(iter->type))
728 continue;
729 if (int_word_to_isc_bits(iter->io.io_int_word)
730 <= isc_bits)
731 continue;
732 break;
733 }
734 list_add_tail(&inti->list, &iter->list);
735 }
736 atomic_set(&fi->active, 1);
737 sigcpu = find_first_bit(fi->idle_mask, KVM_MAX_VCPUS);
738 if (sigcpu == KVM_MAX_VCPUS) {
739 do {
740 sigcpu = fi->next_rr_cpu++;
741 if (sigcpu == KVM_MAX_VCPUS)
742 sigcpu = fi->next_rr_cpu = 0;
743 } while (kvm_get_vcpu(kvm, sigcpu) == NULL);
744 }
745 dst_vcpu = kvm_get_vcpu(kvm, sigcpu);
746 li = &dst_vcpu->arch.local_int;
747 spin_lock_bh(&li->lock);
748 atomic_set_mask(CPUSTAT_EXT_INT, li->cpuflags);
749 if (waitqueue_active(li->wq))
750 wake_up_interruptible(li->wq);
751 kvm_get_vcpu(kvm, sigcpu)->preempted = true;
752 spin_unlock_bh(&li->lock);
753unlock_fi:
754 spin_unlock(&fi->lock);
755 mutex_unlock(&kvm->lock);
756 return rc;
757}
758
759int kvm_s390_inject_vm(struct kvm *kvm,
760 struct kvm_s390_interrupt *s390int)
761{
762 struct kvm_s390_interrupt_info *inti;
669 763
670 inti = kzalloc(sizeof(*inti), GFP_KERNEL); 764 inti = kzalloc(sizeof(*inti), GFP_KERNEL);
671 if (!inti) 765 if (!inti)
672 return -ENOMEM; 766 return -ENOMEM;
673 767
674 switch (s390int->type) { 768 inti->type = s390int->type;
769 switch (inti->type) {
675 case KVM_S390_INT_VIRTIO: 770 case KVM_S390_INT_VIRTIO:
676 VM_EVENT(kvm, 5, "inject: virtio parm:%x,parm64:%llx", 771 VM_EVENT(kvm, 5, "inject: virtio parm:%x,parm64:%llx",
677 s390int->parm, s390int->parm64); 772 s390int->parm, s390int->parm64);
678 inti->type = s390int->type;
679 inti->ext.ext_params = s390int->parm; 773 inti->ext.ext_params = s390int->parm;
680 inti->ext.ext_params2 = s390int->parm64; 774 inti->ext.ext_params2 = s390int->parm64;
681 break; 775 break;
682 case KVM_S390_INT_SERVICE: 776 case KVM_S390_INT_SERVICE:
683 VM_EVENT(kvm, 5, "inject: sclp parm:%x", s390int->parm); 777 VM_EVENT(kvm, 5, "inject: sclp parm:%x", s390int->parm);
684 inti->type = s390int->type;
685 inti->ext.ext_params = s390int->parm; 778 inti->ext.ext_params = s390int->parm;
686 break; 779 break;
687 case KVM_S390_PROGRAM_INT: 780 case KVM_S390_INT_PFAULT_DONE:
688 case KVM_S390_SIGP_STOP: 781 inti->type = s390int->type;
689 case KVM_S390_INT_EXTERNAL_CALL: 782 inti->ext.ext_params2 = s390int->parm64;
690 case KVM_S390_INT_EMERGENCY: 783 break;
691 kfree(inti);
692 return -EINVAL;
693 case KVM_S390_MCHK: 784 case KVM_S390_MCHK:
694 VM_EVENT(kvm, 5, "inject: machine check parm64:%llx", 785 VM_EVENT(kvm, 5, "inject: machine check parm64:%llx",
695 s390int->parm64); 786 s390int->parm64);
696 inti->type = s390int->type;
697 inti->mchk.cr14 = s390int->parm; /* upper bits are not used */ 787 inti->mchk.cr14 = s390int->parm; /* upper bits are not used */
698 inti->mchk.mcic = s390int->parm64; 788 inti->mchk.mcic = s390int->parm64;
699 break; 789 break;
700 case KVM_S390_INT_IO_MIN...KVM_S390_INT_IO_MAX: 790 case KVM_S390_INT_IO_MIN...KVM_S390_INT_IO_MAX:
701 if (s390int->type & IOINT_AI_MASK) 791 if (inti->type & IOINT_AI_MASK)
702 VM_EVENT(kvm, 5, "%s", "inject: I/O (AI)"); 792 VM_EVENT(kvm, 5, "%s", "inject: I/O (AI)");
703 else 793 else
704 VM_EVENT(kvm, 5, "inject: I/O css %x ss %x schid %04x", 794 VM_EVENT(kvm, 5, "inject: I/O css %x ss %x schid %04x",
705 s390int->type & IOINT_CSSID_MASK, 795 s390int->type & IOINT_CSSID_MASK,
706 s390int->type & IOINT_SSID_MASK, 796 s390int->type & IOINT_SSID_MASK,
707 s390int->type & IOINT_SCHID_MASK); 797 s390int->type & IOINT_SCHID_MASK);
708 inti->type = s390int->type;
709 inti->io.subchannel_id = s390int->parm >> 16; 798 inti->io.subchannel_id = s390int->parm >> 16;
710 inti->io.subchannel_nr = s390int->parm & 0x0000ffffu; 799 inti->io.subchannel_nr = s390int->parm & 0x0000ffffu;
711 inti->io.io_int_parm = s390int->parm64 >> 32; 800 inti->io.io_int_parm = s390int->parm64 >> 32;
@@ -718,43 +807,7 @@ int kvm_s390_inject_vm(struct kvm *kvm,
718 trace_kvm_s390_inject_vm(s390int->type, s390int->parm, s390int->parm64, 807 trace_kvm_s390_inject_vm(s390int->type, s390int->parm, s390int->parm64,
719 2); 808 2);
720 809
721 mutex_lock(&kvm->lock); 810 return __inject_vm(kvm, inti);
722 fi = &kvm->arch.float_int;
723 spin_lock(&fi->lock);
724 if (!is_ioint(inti->type))
725 list_add_tail(&inti->list, &fi->list);
726 else {
727 u64 isc_bits = int_word_to_isc_bits(inti->io.io_int_word);
728
729 /* Keep I/O interrupts sorted in isc order. */
730 list_for_each_entry(iter, &fi->list, list) {
731 if (!is_ioint(iter->type))
732 continue;
733 if (int_word_to_isc_bits(iter->io.io_int_word)
734 <= isc_bits)
735 continue;
736 break;
737 }
738 list_add_tail(&inti->list, &iter->list);
739 }
740 atomic_set(&fi->active, 1);
741 sigcpu = find_first_bit(fi->idle_mask, KVM_MAX_VCPUS);
742 if (sigcpu == KVM_MAX_VCPUS) {
743 do {
744 sigcpu = fi->next_rr_cpu++;
745 if (sigcpu == KVM_MAX_VCPUS)
746 sigcpu = fi->next_rr_cpu = 0;
747 } while (fi->local_int[sigcpu] == NULL);
748 }
749 li = fi->local_int[sigcpu];
750 spin_lock_bh(&li->lock);
751 atomic_set_mask(CPUSTAT_EXT_INT, li->cpuflags);
752 if (waitqueue_active(li->wq))
753 wake_up_interruptible(li->wq);
754 spin_unlock_bh(&li->lock);
755 spin_unlock(&fi->lock);
756 mutex_unlock(&kvm->lock);
757 return 0;
758} 811}
759 812
760int kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu, 813int kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu,
@@ -814,6 +867,10 @@ int kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu,
814 inti->type = s390int->type; 867 inti->type = s390int->type;
815 inti->mchk.mcic = s390int->parm64; 868 inti->mchk.mcic = s390int->parm64;
816 break; 869 break;
870 case KVM_S390_INT_PFAULT_INIT:
871 inti->type = s390int->type;
872 inti->ext.ext_params2 = s390int->parm64;
873 break;
817 case KVM_S390_INT_VIRTIO: 874 case KVM_S390_INT_VIRTIO:
818 case KVM_S390_INT_SERVICE: 875 case KVM_S390_INT_SERVICE:
819 case KVM_S390_INT_IO_MIN...KVM_S390_INT_IO_MAX: 876 case KVM_S390_INT_IO_MIN...KVM_S390_INT_IO_MAX:
@@ -837,7 +894,528 @@ int kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu,
837 atomic_set_mask(CPUSTAT_EXT_INT, li->cpuflags); 894 atomic_set_mask(CPUSTAT_EXT_INT, li->cpuflags);
838 if (waitqueue_active(&vcpu->wq)) 895 if (waitqueue_active(&vcpu->wq))
839 wake_up_interruptible(&vcpu->wq); 896 wake_up_interruptible(&vcpu->wq);
897 vcpu->preempted = true;
840 spin_unlock_bh(&li->lock); 898 spin_unlock_bh(&li->lock);
841 mutex_unlock(&vcpu->kvm->lock); 899 mutex_unlock(&vcpu->kvm->lock);
842 return 0; 900 return 0;
843} 901}
902
903static void clear_floating_interrupts(struct kvm *kvm)
904{
905 struct kvm_s390_float_interrupt *fi;
906 struct kvm_s390_interrupt_info *n, *inti = NULL;
907
908 mutex_lock(&kvm->lock);
909 fi = &kvm->arch.float_int;
910 spin_lock(&fi->lock);
911 list_for_each_entry_safe(inti, n, &fi->list, list) {
912 list_del(&inti->list);
913 kfree(inti);
914 }
915 fi->irq_count = 0;
916 atomic_set(&fi->active, 0);
917 spin_unlock(&fi->lock);
918 mutex_unlock(&kvm->lock);
919}
920
921static inline int copy_irq_to_user(struct kvm_s390_interrupt_info *inti,
922 u8 *addr)
923{
924 struct kvm_s390_irq __user *uptr = (struct kvm_s390_irq __user *) addr;
925 struct kvm_s390_irq irq = {0};
926
927 irq.type = inti->type;
928 switch (inti->type) {
929 case KVM_S390_INT_PFAULT_INIT:
930 case KVM_S390_INT_PFAULT_DONE:
931 case KVM_S390_INT_VIRTIO:
932 case KVM_S390_INT_SERVICE:
933 irq.u.ext = inti->ext;
934 break;
935 case KVM_S390_INT_IO_MIN...KVM_S390_INT_IO_MAX:
936 irq.u.io = inti->io;
937 break;
938 case KVM_S390_MCHK:
939 irq.u.mchk = inti->mchk;
940 break;
941 default:
942 return -EINVAL;
943 }
944
945 if (copy_to_user(uptr, &irq, sizeof(irq)))
946 return -EFAULT;
947
948 return 0;
949}
950
951static int get_all_floating_irqs(struct kvm *kvm, __u8 *buf, __u64 len)
952{
953 struct kvm_s390_interrupt_info *inti;
954 struct kvm_s390_float_interrupt *fi;
955 int ret = 0;
956 int n = 0;
957
958 mutex_lock(&kvm->lock);
959 fi = &kvm->arch.float_int;
960 spin_lock(&fi->lock);
961
962 list_for_each_entry(inti, &fi->list, list) {
963 if (len < sizeof(struct kvm_s390_irq)) {
964 /* signal userspace to try again */
965 ret = -ENOMEM;
966 break;
967 }
968 ret = copy_irq_to_user(inti, buf);
969 if (ret)
970 break;
971 buf += sizeof(struct kvm_s390_irq);
972 len -= sizeof(struct kvm_s390_irq);
973 n++;
974 }
975
976 spin_unlock(&fi->lock);
977 mutex_unlock(&kvm->lock);
978
979 return ret < 0 ? ret : n;
980}
981
982static int flic_get_attr(struct kvm_device *dev, struct kvm_device_attr *attr)
983{
984 int r;
985
986 switch (attr->group) {
987 case KVM_DEV_FLIC_GET_ALL_IRQS:
988 r = get_all_floating_irqs(dev->kvm, (u8 *) attr->addr,
989 attr->attr);
990 break;
991 default:
992 r = -EINVAL;
993 }
994
995 return r;
996}
997
998static inline int copy_irq_from_user(struct kvm_s390_interrupt_info *inti,
999 u64 addr)
1000{
1001 struct kvm_s390_irq __user *uptr = (struct kvm_s390_irq __user *) addr;
1002 void *target = NULL;
1003 void __user *source;
1004 u64 size;
1005
1006 if (get_user(inti->type, (u64 __user *)addr))
1007 return -EFAULT;
1008
1009 switch (inti->type) {
1010 case KVM_S390_INT_PFAULT_INIT:
1011 case KVM_S390_INT_PFAULT_DONE:
1012 case KVM_S390_INT_VIRTIO:
1013 case KVM_S390_INT_SERVICE:
1014 target = (void *) &inti->ext;
1015 source = &uptr->u.ext;
1016 size = sizeof(inti->ext);
1017 break;
1018 case KVM_S390_INT_IO_MIN...KVM_S390_INT_IO_MAX:
1019 target = (void *) &inti->io;
1020 source = &uptr->u.io;
1021 size = sizeof(inti->io);
1022 break;
1023 case KVM_S390_MCHK:
1024 target = (void *) &inti->mchk;
1025 source = &uptr->u.mchk;
1026 size = sizeof(inti->mchk);
1027 break;
1028 default:
1029 return -EINVAL;
1030 }
1031
1032 if (copy_from_user(target, source, size))
1033 return -EFAULT;
1034
1035 return 0;
1036}
1037
1038static int enqueue_floating_irq(struct kvm_device *dev,
1039 struct kvm_device_attr *attr)
1040{
1041 struct kvm_s390_interrupt_info *inti = NULL;
1042 int r = 0;
1043 int len = attr->attr;
1044
1045 if (len % sizeof(struct kvm_s390_irq) != 0)
1046 return -EINVAL;
1047 else if (len > KVM_S390_FLIC_MAX_BUFFER)
1048 return -EINVAL;
1049
1050 while (len >= sizeof(struct kvm_s390_irq)) {
1051 inti = kzalloc(sizeof(*inti), GFP_KERNEL);
1052 if (!inti)
1053 return -ENOMEM;
1054
1055 r = copy_irq_from_user(inti, attr->addr);
1056 if (r) {
1057 kfree(inti);
1058 return r;
1059 }
1060 r = __inject_vm(dev->kvm, inti);
1061 if (r) {
1062 kfree(inti);
1063 return r;
1064 }
1065 len -= sizeof(struct kvm_s390_irq);
1066 attr->addr += sizeof(struct kvm_s390_irq);
1067 }
1068
1069 return r;
1070}
1071
1072static struct s390_io_adapter *get_io_adapter(struct kvm *kvm, unsigned int id)
1073{
1074 if (id >= MAX_S390_IO_ADAPTERS)
1075 return NULL;
1076 return kvm->arch.adapters[id];
1077}
1078
1079static int register_io_adapter(struct kvm_device *dev,
1080 struct kvm_device_attr *attr)
1081{
1082 struct s390_io_adapter *adapter;
1083 struct kvm_s390_io_adapter adapter_info;
1084
1085 if (copy_from_user(&adapter_info,
1086 (void __user *)attr->addr, sizeof(adapter_info)))
1087 return -EFAULT;
1088
1089 if ((adapter_info.id >= MAX_S390_IO_ADAPTERS) ||
1090 (dev->kvm->arch.adapters[adapter_info.id] != NULL))
1091 return -EINVAL;
1092
1093 adapter = kzalloc(sizeof(*adapter), GFP_KERNEL);
1094 if (!adapter)
1095 return -ENOMEM;
1096
1097 INIT_LIST_HEAD(&adapter->maps);
1098 init_rwsem(&adapter->maps_lock);
1099 atomic_set(&adapter->nr_maps, 0);
1100 adapter->id = adapter_info.id;
1101 adapter->isc = adapter_info.isc;
1102 adapter->maskable = adapter_info.maskable;
1103 adapter->masked = false;
1104 adapter->swap = adapter_info.swap;
1105 dev->kvm->arch.adapters[adapter->id] = adapter;
1106
1107 return 0;
1108}
1109
1110int kvm_s390_mask_adapter(struct kvm *kvm, unsigned int id, bool masked)
1111{
1112 int ret;
1113 struct s390_io_adapter *adapter = get_io_adapter(kvm, id);
1114
1115 if (!adapter || !adapter->maskable)
1116 return -EINVAL;
1117 ret = adapter->masked;
1118 adapter->masked = masked;
1119 return ret;
1120}
1121
1122static int kvm_s390_adapter_map(struct kvm *kvm, unsigned int id, __u64 addr)
1123{
1124 struct s390_io_adapter *adapter = get_io_adapter(kvm, id);
1125 struct s390_map_info *map;
1126 int ret;
1127
1128 if (!adapter || !addr)
1129 return -EINVAL;
1130
1131 map = kzalloc(sizeof(*map), GFP_KERNEL);
1132 if (!map) {
1133 ret = -ENOMEM;
1134 goto out;
1135 }
1136 INIT_LIST_HEAD(&map->list);
1137 map->guest_addr = addr;
1138 map->addr = gmap_translate(addr, kvm->arch.gmap);
1139 if (map->addr == -EFAULT) {
1140 ret = -EFAULT;
1141 goto out;
1142 }
1143 ret = get_user_pages_fast(map->addr, 1, 1, &map->page);
1144 if (ret < 0)
1145 goto out;
1146 BUG_ON(ret != 1);
1147 down_write(&adapter->maps_lock);
1148 if (atomic_inc_return(&adapter->nr_maps) < MAX_S390_ADAPTER_MAPS) {
1149 list_add_tail(&map->list, &adapter->maps);
1150 ret = 0;
1151 } else {
1152 put_page(map->page);
1153 ret = -EINVAL;
1154 }
1155 up_write(&adapter->maps_lock);
1156out:
1157 if (ret)
1158 kfree(map);
1159 return ret;
1160}
1161
1162static int kvm_s390_adapter_unmap(struct kvm *kvm, unsigned int id, __u64 addr)
1163{
1164 struct s390_io_adapter *adapter = get_io_adapter(kvm, id);
1165 struct s390_map_info *map, *tmp;
1166 int found = 0;
1167
1168 if (!adapter || !addr)
1169 return -EINVAL;
1170
1171 down_write(&adapter->maps_lock);
1172 list_for_each_entry_safe(map, tmp, &adapter->maps, list) {
1173 if (map->guest_addr == addr) {
1174 found = 1;
1175 atomic_dec(&adapter->nr_maps);
1176 list_del(&map->list);
1177 put_page(map->page);
1178 kfree(map);
1179 break;
1180 }
1181 }
1182 up_write(&adapter->maps_lock);
1183
1184 return found ? 0 : -EINVAL;
1185}
1186
1187void kvm_s390_destroy_adapters(struct kvm *kvm)
1188{
1189 int i;
1190 struct s390_map_info *map, *tmp;
1191
1192 for (i = 0; i < MAX_S390_IO_ADAPTERS; i++) {
1193 if (!kvm->arch.adapters[i])
1194 continue;
1195 list_for_each_entry_safe(map, tmp,
1196 &kvm->arch.adapters[i]->maps, list) {
1197 list_del(&map->list);
1198 put_page(map->page);
1199 kfree(map);
1200 }
1201 kfree(kvm->arch.adapters[i]);
1202 }
1203}
1204
1205static int modify_io_adapter(struct kvm_device *dev,
1206 struct kvm_device_attr *attr)
1207{
1208 struct kvm_s390_io_adapter_req req;
1209 struct s390_io_adapter *adapter;
1210 int ret;
1211
1212 if (copy_from_user(&req, (void __user *)attr->addr, sizeof(req)))
1213 return -EFAULT;
1214
1215 adapter = get_io_adapter(dev->kvm, req.id);
1216 if (!adapter)
1217 return -EINVAL;
1218 switch (req.type) {
1219 case KVM_S390_IO_ADAPTER_MASK:
1220 ret = kvm_s390_mask_adapter(dev->kvm, req.id, req.mask);
1221 if (ret > 0)
1222 ret = 0;
1223 break;
1224 case KVM_S390_IO_ADAPTER_MAP:
1225 ret = kvm_s390_adapter_map(dev->kvm, req.id, req.addr);
1226 break;
1227 case KVM_S390_IO_ADAPTER_UNMAP:
1228 ret = kvm_s390_adapter_unmap(dev->kvm, req.id, req.addr);
1229 break;
1230 default:
1231 ret = -EINVAL;
1232 }
1233
1234 return ret;
1235}
1236
1237static int flic_set_attr(struct kvm_device *dev, struct kvm_device_attr *attr)
1238{
1239 int r = 0;
1240 unsigned int i;
1241 struct kvm_vcpu *vcpu;
1242
1243 switch (attr->group) {
1244 case KVM_DEV_FLIC_ENQUEUE:
1245 r = enqueue_floating_irq(dev, attr);
1246 break;
1247 case KVM_DEV_FLIC_CLEAR_IRQS:
1248 r = 0;
1249 clear_floating_interrupts(dev->kvm);
1250 break;
1251 case KVM_DEV_FLIC_APF_ENABLE:
1252 dev->kvm->arch.gmap->pfault_enabled = 1;
1253 break;
1254 case KVM_DEV_FLIC_APF_DISABLE_WAIT:
1255 dev->kvm->arch.gmap->pfault_enabled = 0;
1256 /*
1257 * Make sure no async faults are in transition when
1258 * clearing the queues. So we don't need to worry
1259 * about late coming workers.
1260 */
1261 synchronize_srcu(&dev->kvm->srcu);
1262 kvm_for_each_vcpu(i, vcpu, dev->kvm)
1263 kvm_clear_async_pf_completion_queue(vcpu);
1264 break;
1265 case KVM_DEV_FLIC_ADAPTER_REGISTER:
1266 r = register_io_adapter(dev, attr);
1267 break;
1268 case KVM_DEV_FLIC_ADAPTER_MODIFY:
1269 r = modify_io_adapter(dev, attr);
1270 break;
1271 default:
1272 r = -EINVAL;
1273 }
1274
1275 return r;
1276}
1277
1278static int flic_create(struct kvm_device *dev, u32 type)
1279{
1280 if (!dev)
1281 return -EINVAL;
1282 if (dev->kvm->arch.flic)
1283 return -EINVAL;
1284 dev->kvm->arch.flic = dev;
1285 return 0;
1286}
1287
1288static void flic_destroy(struct kvm_device *dev)
1289{
1290 dev->kvm->arch.flic = NULL;
1291 kfree(dev);
1292}
1293
1294/* s390 floating irq controller (flic) */
1295struct kvm_device_ops kvm_flic_ops = {
1296 .name = "kvm-flic",
1297 .get_attr = flic_get_attr,
1298 .set_attr = flic_set_attr,
1299 .create = flic_create,
1300 .destroy = flic_destroy,
1301};
1302
1303static unsigned long get_ind_bit(__u64 addr, unsigned long bit_nr, bool swap)
1304{
1305 unsigned long bit;
1306
1307 bit = bit_nr + (addr % PAGE_SIZE) * 8;
1308
1309 return swap ? (bit ^ (BITS_PER_LONG - 1)) : bit;
1310}
1311
1312static struct s390_map_info *get_map_info(struct s390_io_adapter *adapter,
1313 u64 addr)
1314{
1315 struct s390_map_info *map;
1316
1317 if (!adapter)
1318 return NULL;
1319
1320 list_for_each_entry(map, &adapter->maps, list) {
1321 if (map->guest_addr == addr)
1322 return map;
1323 }
1324 return NULL;
1325}
1326
1327static int adapter_indicators_set(struct kvm *kvm,
1328 struct s390_io_adapter *adapter,
1329 struct kvm_s390_adapter_int *adapter_int)
1330{
1331 unsigned long bit;
1332 int summary_set, idx;
1333 struct s390_map_info *info;
1334 void *map;
1335
1336 info = get_map_info(adapter, adapter_int->ind_addr);
1337 if (!info)
1338 return -1;
1339 map = page_address(info->page);
1340 bit = get_ind_bit(info->addr, adapter_int->ind_offset, adapter->swap);
1341 set_bit(bit, map);
1342 idx = srcu_read_lock(&kvm->srcu);
1343 mark_page_dirty(kvm, info->guest_addr >> PAGE_SHIFT);
1344 set_page_dirty_lock(info->page);
1345 info = get_map_info(adapter, adapter_int->summary_addr);
1346 if (!info) {
1347 srcu_read_unlock(&kvm->srcu, idx);
1348 return -1;
1349 }
1350 map = page_address(info->page);
1351 bit = get_ind_bit(info->addr, adapter_int->summary_offset,
1352 adapter->swap);
1353 summary_set = test_and_set_bit(bit, map);
1354 mark_page_dirty(kvm, info->guest_addr >> PAGE_SHIFT);
1355 set_page_dirty_lock(info->page);
1356 srcu_read_unlock(&kvm->srcu, idx);
1357 return summary_set ? 0 : 1;
1358}
1359
1360/*
1361 * < 0 - not injected due to error
1362 * = 0 - coalesced, summary indicator already active
1363 * > 0 - injected interrupt
1364 */
1365static int set_adapter_int(struct kvm_kernel_irq_routing_entry *e,
1366 struct kvm *kvm, int irq_source_id, int level,
1367 bool line_status)
1368{
1369 int ret;
1370 struct s390_io_adapter *adapter;
1371
1372 /* We're only interested in the 0->1 transition. */
1373 if (!level)
1374 return 0;
1375 adapter = get_io_adapter(kvm, e->adapter.adapter_id);
1376 if (!adapter)
1377 return -1;
1378 down_read(&adapter->maps_lock);
1379 ret = adapter_indicators_set(kvm, adapter, &e->adapter);
1380 up_read(&adapter->maps_lock);
1381 if ((ret > 0) && !adapter->masked) {
1382 struct kvm_s390_interrupt s390int = {
1383 .type = KVM_S390_INT_IO(1, 0, 0, 0),
1384 .parm = 0,
1385 .parm64 = (adapter->isc << 27) | 0x80000000,
1386 };
1387 ret = kvm_s390_inject_vm(kvm, &s390int);
1388 if (ret == 0)
1389 ret = 1;
1390 }
1391 return ret;
1392}
1393
1394int kvm_set_routing_entry(struct kvm_irq_routing_table *rt,
1395 struct kvm_kernel_irq_routing_entry *e,
1396 const struct kvm_irq_routing_entry *ue)
1397{
1398 int ret;
1399
1400 switch (ue->type) {
1401 case KVM_IRQ_ROUTING_S390_ADAPTER:
1402 e->set = set_adapter_int;
1403 e->adapter.summary_addr = ue->u.adapter.summary_addr;
1404 e->adapter.ind_addr = ue->u.adapter.ind_addr;
1405 e->adapter.summary_offset = ue->u.adapter.summary_offset;
1406 e->adapter.ind_offset = ue->u.adapter.ind_offset;
1407 e->adapter.adapter_id = ue->u.adapter.adapter_id;
1408 ret = 0;
1409 break;
1410 default:
1411 ret = -EINVAL;
1412 }
1413
1414 return ret;
1415}
1416
1417int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e, struct kvm *kvm,
1418 int irq_source_id, int level, bool line_status)
1419{
1420 return -EINVAL;
1421}
diff --git a/arch/s390/kvm/irq.h b/arch/s390/kvm/irq.h
new file mode 100644
index 000000000000..d98e4159643d
--- /dev/null
+++ b/arch/s390/kvm/irq.h
@@ -0,0 +1,22 @@
1/*
2 * s390 irqchip routines
3 *
4 * Copyright IBM Corp. 2014
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 only)
8 * as published by the Free Software Foundation.
9 *
10 * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
11 */
12#ifndef __KVM_IRQ_H
13#define __KVM_IRQ_H
14
15#include <linux/kvm_host.h>
16
17static inline int irqchip_in_kernel(struct kvm *kvm)
18{
19 return 1;
20}
21
22#endif
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 10b5db3c9bc4..b3ecb8f5b6ce 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -153,11 +153,14 @@ int kvm_dev_ioctl_check_extension(long ext)
153#ifdef CONFIG_KVM_S390_UCONTROL 153#ifdef CONFIG_KVM_S390_UCONTROL
154 case KVM_CAP_S390_UCONTROL: 154 case KVM_CAP_S390_UCONTROL:
155#endif 155#endif
156 case KVM_CAP_ASYNC_PF:
156 case KVM_CAP_SYNC_REGS: 157 case KVM_CAP_SYNC_REGS:
157 case KVM_CAP_ONE_REG: 158 case KVM_CAP_ONE_REG:
158 case KVM_CAP_ENABLE_CAP: 159 case KVM_CAP_ENABLE_CAP:
159 case KVM_CAP_S390_CSS_SUPPORT: 160 case KVM_CAP_S390_CSS_SUPPORT:
160 case KVM_CAP_IOEVENTFD: 161 case KVM_CAP_IOEVENTFD:
162 case KVM_CAP_DEVICE_CTRL:
163 case KVM_CAP_ENABLE_CAP_VM:
161 r = 1; 164 r = 1;
162 break; 165 break;
163 case KVM_CAP_NR_VCPUS: 166 case KVM_CAP_NR_VCPUS:
@@ -186,6 +189,25 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
186 return 0; 189 return 0;
187} 190}
188 191
192static int kvm_vm_ioctl_enable_cap(struct kvm *kvm, struct kvm_enable_cap *cap)
193{
194 int r;
195
196 if (cap->flags)
197 return -EINVAL;
198
199 switch (cap->cap) {
200 case KVM_CAP_S390_IRQCHIP:
201 kvm->arch.use_irqchip = 1;
202 r = 0;
203 break;
204 default:
205 r = -EINVAL;
206 break;
207 }
208 return r;
209}
210
189long kvm_arch_vm_ioctl(struct file *filp, 211long kvm_arch_vm_ioctl(struct file *filp,
190 unsigned int ioctl, unsigned long arg) 212 unsigned int ioctl, unsigned long arg)
191{ 213{
@@ -203,6 +225,26 @@ long kvm_arch_vm_ioctl(struct file *filp,
203 r = kvm_s390_inject_vm(kvm, &s390int); 225 r = kvm_s390_inject_vm(kvm, &s390int);
204 break; 226 break;
205 } 227 }
228 case KVM_ENABLE_CAP: {
229 struct kvm_enable_cap cap;
230 r = -EFAULT;
231 if (copy_from_user(&cap, argp, sizeof(cap)))
232 break;
233 r = kvm_vm_ioctl_enable_cap(kvm, &cap);
234 break;
235 }
236 case KVM_CREATE_IRQCHIP: {
237 struct kvm_irq_routing_entry routing;
238
239 r = -EINVAL;
240 if (kvm->arch.use_irqchip) {
241 /* Set up dummy routing. */
242 memset(&routing, 0, sizeof(routing));
243 kvm_set_irq_routing(kvm, &routing, 0, 0);
244 r = 0;
245 }
246 break;
247 }
206 default: 248 default:
207 r = -ENOTTY; 249 r = -ENOTTY;
208 } 250 }
@@ -214,6 +256,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
214{ 256{
215 int rc; 257 int rc;
216 char debug_name[16]; 258 char debug_name[16];
259 static unsigned long sca_offset;
217 260
218 rc = -EINVAL; 261 rc = -EINVAL;
219#ifdef CONFIG_KVM_S390_UCONTROL 262#ifdef CONFIG_KVM_S390_UCONTROL
@@ -235,6 +278,10 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
235 kvm->arch.sca = (struct sca_block *) get_zeroed_page(GFP_KERNEL); 278 kvm->arch.sca = (struct sca_block *) get_zeroed_page(GFP_KERNEL);
236 if (!kvm->arch.sca) 279 if (!kvm->arch.sca)
237 goto out_err; 280 goto out_err;
281 spin_lock(&kvm_lock);
282 sca_offset = (sca_offset + 16) & 0x7f0;
283 kvm->arch.sca = (struct sca_block *) ((char *) kvm->arch.sca + sca_offset);
284 spin_unlock(&kvm_lock);
238 285
239 sprintf(debug_name, "kvm-%u", current->pid); 286 sprintf(debug_name, "kvm-%u", current->pid);
240 287
@@ -255,9 +302,11 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
255 if (!kvm->arch.gmap) 302 if (!kvm->arch.gmap)
256 goto out_nogmap; 303 goto out_nogmap;
257 kvm->arch.gmap->private = kvm; 304 kvm->arch.gmap->private = kvm;
305 kvm->arch.gmap->pfault_enabled = 0;
258 } 306 }
259 307
260 kvm->arch.css_support = 0; 308 kvm->arch.css_support = 0;
309 kvm->arch.use_irqchip = 0;
261 310
262 return 0; 311 return 0;
263out_nogmap: 312out_nogmap:
@@ -272,6 +321,7 @@ void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
272{ 321{
273 VCPU_EVENT(vcpu, 3, "%s", "free cpu"); 322 VCPU_EVENT(vcpu, 3, "%s", "free cpu");
274 trace_kvm_s390_destroy_vcpu(vcpu->vcpu_id); 323 trace_kvm_s390_destroy_vcpu(vcpu->vcpu_id);
324 kvm_clear_async_pf_completion_queue(vcpu);
275 if (!kvm_is_ucontrol(vcpu->kvm)) { 325 if (!kvm_is_ucontrol(vcpu->kvm)) {
276 clear_bit(63 - vcpu->vcpu_id, 326 clear_bit(63 - vcpu->vcpu_id,
277 (unsigned long *) &vcpu->kvm->arch.sca->mcn); 327 (unsigned long *) &vcpu->kvm->arch.sca->mcn);
@@ -320,11 +370,14 @@ void kvm_arch_destroy_vm(struct kvm *kvm)
320 debug_unregister(kvm->arch.dbf); 370 debug_unregister(kvm->arch.dbf);
321 if (!kvm_is_ucontrol(kvm)) 371 if (!kvm_is_ucontrol(kvm))
322 gmap_free(kvm->arch.gmap); 372 gmap_free(kvm->arch.gmap);
373 kvm_s390_destroy_adapters(kvm);
323} 374}
324 375
325/* Section: vcpu related */ 376/* Section: vcpu related */
326int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu) 377int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
327{ 378{
379 vcpu->arch.pfault_token = KVM_S390_PFAULT_TOKEN_INVALID;
380 kvm_clear_async_pf_completion_queue(vcpu);
328 if (kvm_is_ucontrol(vcpu->kvm)) { 381 if (kvm_is_ucontrol(vcpu->kvm)) {
329 vcpu->arch.gmap = gmap_alloc(current->mm); 382 vcpu->arch.gmap = gmap_alloc(current->mm);
330 if (!vcpu->arch.gmap) 383 if (!vcpu->arch.gmap)
@@ -385,7 +438,11 @@ static void kvm_s390_vcpu_initial_reset(struct kvm_vcpu *vcpu)
385 vcpu->arch.guest_fpregs.fpc = 0; 438 vcpu->arch.guest_fpregs.fpc = 0;
386 asm volatile("lfpc %0" : : "Q" (vcpu->arch.guest_fpregs.fpc)); 439 asm volatile("lfpc %0" : : "Q" (vcpu->arch.guest_fpregs.fpc));
387 vcpu->arch.sie_block->gbea = 1; 440 vcpu->arch.sie_block->gbea = 1;
441 vcpu->arch.sie_block->pp = 0;
442 vcpu->arch.pfault_token = KVM_S390_PFAULT_TOKEN_INVALID;
443 kvm_clear_async_pf_completion_queue(vcpu);
388 atomic_set_mask(CPUSTAT_STOPPED, &vcpu->arch.sie_block->cpuflags); 444 atomic_set_mask(CPUSTAT_STOPPED, &vcpu->arch.sie_block->cpuflags);
445 kvm_s390_clear_local_irqs(vcpu);
389} 446}
390 447
391int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu) 448int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
@@ -466,11 +523,8 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm,
466 spin_lock_init(&vcpu->arch.local_int.lock); 523 spin_lock_init(&vcpu->arch.local_int.lock);
467 INIT_LIST_HEAD(&vcpu->arch.local_int.list); 524 INIT_LIST_HEAD(&vcpu->arch.local_int.list);
468 vcpu->arch.local_int.float_int = &kvm->arch.float_int; 525 vcpu->arch.local_int.float_int = &kvm->arch.float_int;
469 spin_lock(&kvm->arch.float_int.lock);
470 kvm->arch.float_int.local_int[id] = &vcpu->arch.local_int;
471 vcpu->arch.local_int.wq = &vcpu->wq; 526 vcpu->arch.local_int.wq = &vcpu->wq;
472 vcpu->arch.local_int.cpuflags = &vcpu->arch.sie_block->cpuflags; 527 vcpu->arch.local_int.cpuflags = &vcpu->arch.sie_block->cpuflags;
473 spin_unlock(&kvm->arch.float_int.lock);
474 528
475 rc = kvm_vcpu_init(vcpu, kvm, id); 529 rc = kvm_vcpu_init(vcpu, kvm, id);
476 if (rc) 530 if (rc)
@@ -490,9 +544,7 @@ out:
490 544
491int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu) 545int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
492{ 546{
493 /* kvm common code refers to this, but never calls it */ 547 return kvm_cpu_has_interrupt(vcpu);
494 BUG();
495 return 0;
496} 548}
497 549
498void s390_vcpu_block(struct kvm_vcpu *vcpu) 550void s390_vcpu_block(struct kvm_vcpu *vcpu)
@@ -568,6 +620,26 @@ static int kvm_arch_vcpu_ioctl_get_one_reg(struct kvm_vcpu *vcpu,
568 r = put_user(vcpu->arch.sie_block->ckc, 620 r = put_user(vcpu->arch.sie_block->ckc,
569 (u64 __user *)reg->addr); 621 (u64 __user *)reg->addr);
570 break; 622 break;
623 case KVM_REG_S390_PFTOKEN:
624 r = put_user(vcpu->arch.pfault_token,
625 (u64 __user *)reg->addr);
626 break;
627 case KVM_REG_S390_PFCOMPARE:
628 r = put_user(vcpu->arch.pfault_compare,
629 (u64 __user *)reg->addr);
630 break;
631 case KVM_REG_S390_PFSELECT:
632 r = put_user(vcpu->arch.pfault_select,
633 (u64 __user *)reg->addr);
634 break;
635 case KVM_REG_S390_PP:
636 r = put_user(vcpu->arch.sie_block->pp,
637 (u64 __user *)reg->addr);
638 break;
639 case KVM_REG_S390_GBEA:
640 r = put_user(vcpu->arch.sie_block->gbea,
641 (u64 __user *)reg->addr);
642 break;
571 default: 643 default:
572 break; 644 break;
573 } 645 }
@@ -597,6 +669,26 @@ static int kvm_arch_vcpu_ioctl_set_one_reg(struct kvm_vcpu *vcpu,
597 r = get_user(vcpu->arch.sie_block->ckc, 669 r = get_user(vcpu->arch.sie_block->ckc,
598 (u64 __user *)reg->addr); 670 (u64 __user *)reg->addr);
599 break; 671 break;
672 case KVM_REG_S390_PFTOKEN:
673 r = get_user(vcpu->arch.pfault_token,
674 (u64 __user *)reg->addr);
675 break;
676 case KVM_REG_S390_PFCOMPARE:
677 r = get_user(vcpu->arch.pfault_compare,
678 (u64 __user *)reg->addr);
679 break;
680 case KVM_REG_S390_PFSELECT:
681 r = get_user(vcpu->arch.pfault_select,
682 (u64 __user *)reg->addr);
683 break;
684 case KVM_REG_S390_PP:
685 r = get_user(vcpu->arch.sie_block->pp,
686 (u64 __user *)reg->addr);
687 break;
688 case KVM_REG_S390_GBEA:
689 r = get_user(vcpu->arch.sie_block->gbea,
690 (u64 __user *)reg->addr);
691 break;
600 default: 692 default:
601 break; 693 break;
602 } 694 }
@@ -715,10 +807,100 @@ static int kvm_s390_handle_requests(struct kvm_vcpu *vcpu)
715 return 0; 807 return 0;
716} 808}
717 809
810static long kvm_arch_fault_in_sync(struct kvm_vcpu *vcpu)
811{
812 long rc;
813 hva_t fault = gmap_fault(current->thread.gmap_addr, vcpu->arch.gmap);
814 struct mm_struct *mm = current->mm;
815 down_read(&mm->mmap_sem);
816 rc = get_user_pages(current, mm, fault, 1, 1, 0, NULL, NULL);
817 up_read(&mm->mmap_sem);
818 return rc;
819}
820
821static void __kvm_inject_pfault_token(struct kvm_vcpu *vcpu, bool start_token,
822 unsigned long token)
823{
824 struct kvm_s390_interrupt inti;
825 inti.parm64 = token;
826
827 if (start_token) {
828 inti.type = KVM_S390_INT_PFAULT_INIT;
829 WARN_ON_ONCE(kvm_s390_inject_vcpu(vcpu, &inti));
830 } else {
831 inti.type = KVM_S390_INT_PFAULT_DONE;
832 WARN_ON_ONCE(kvm_s390_inject_vm(vcpu->kvm, &inti));
833 }
834}
835
836void kvm_arch_async_page_not_present(struct kvm_vcpu *vcpu,
837 struct kvm_async_pf *work)
838{
839 trace_kvm_s390_pfault_init(vcpu, work->arch.pfault_token);
840 __kvm_inject_pfault_token(vcpu, true, work->arch.pfault_token);
841}
842
843void kvm_arch_async_page_present(struct kvm_vcpu *vcpu,
844 struct kvm_async_pf *work)
845{
846 trace_kvm_s390_pfault_done(vcpu, work->arch.pfault_token);
847 __kvm_inject_pfault_token(vcpu, false, work->arch.pfault_token);
848}
849
850void kvm_arch_async_page_ready(struct kvm_vcpu *vcpu,
851 struct kvm_async_pf *work)
852{
853 /* s390 will always inject the page directly */
854}
855
856bool kvm_arch_can_inject_async_page_present(struct kvm_vcpu *vcpu)
857{
858 /*
859 * s390 will always inject the page directly,
860 * but we still want check_async_completion to cleanup
861 */
862 return true;
863}
864
865static int kvm_arch_setup_async_pf(struct kvm_vcpu *vcpu)
866{
867 hva_t hva;
868 struct kvm_arch_async_pf arch;
869 int rc;
870
871 if (vcpu->arch.pfault_token == KVM_S390_PFAULT_TOKEN_INVALID)
872 return 0;
873 if ((vcpu->arch.sie_block->gpsw.mask & vcpu->arch.pfault_select) !=
874 vcpu->arch.pfault_compare)
875 return 0;
876 if (psw_extint_disabled(vcpu))
877 return 0;
878 if (kvm_cpu_has_interrupt(vcpu))
879 return 0;
880 if (!(vcpu->arch.sie_block->gcr[0] & 0x200ul))
881 return 0;
882 if (!vcpu->arch.gmap->pfault_enabled)
883 return 0;
884
885 hva = gmap_fault(current->thread.gmap_addr, vcpu->arch.gmap);
886 if (copy_from_guest(vcpu, &arch.pfault_token, vcpu->arch.pfault_token, 8))
887 return 0;
888
889 rc = kvm_setup_async_pf(vcpu, current->thread.gmap_addr, hva, &arch);
890 return rc;
891}
892
718static int vcpu_pre_run(struct kvm_vcpu *vcpu) 893static int vcpu_pre_run(struct kvm_vcpu *vcpu)
719{ 894{
720 int rc, cpuflags; 895 int rc, cpuflags;
721 896
897 /*
898 * On s390 notifications for arriving pages will be delivered directly
899 * to the guest but the house keeping for completed pfaults is
900 * handled outside the worker.
901 */
902 kvm_check_async_pf_completion(vcpu);
903
722 memcpy(&vcpu->arch.sie_block->gg14, &vcpu->run->s.regs.gprs[14], 16); 904 memcpy(&vcpu->arch.sie_block->gg14, &vcpu->run->s.regs.gprs[14], 16);
723 905
724 if (need_resched()) 906 if (need_resched())
@@ -744,7 +926,7 @@ static int vcpu_pre_run(struct kvm_vcpu *vcpu)
744 926
745static int vcpu_post_run(struct kvm_vcpu *vcpu, int exit_reason) 927static int vcpu_post_run(struct kvm_vcpu *vcpu, int exit_reason)
746{ 928{
747 int rc; 929 int rc = -1;
748 930
749 VCPU_EVENT(vcpu, 6, "exit sie icptcode %d", 931 VCPU_EVENT(vcpu, 6, "exit sie icptcode %d",
750 vcpu->arch.sie_block->icptcode); 932 vcpu->arch.sie_block->icptcode);
@@ -758,7 +940,16 @@ static int vcpu_post_run(struct kvm_vcpu *vcpu, int exit_reason)
758 current->thread.gmap_addr; 940 current->thread.gmap_addr;
759 vcpu->run->s390_ucontrol.pgm_code = 0x10; 941 vcpu->run->s390_ucontrol.pgm_code = 0x10;
760 rc = -EREMOTE; 942 rc = -EREMOTE;
761 } else { 943
944 } else if (current->thread.gmap_pfault) {
945 trace_kvm_s390_major_guest_pfault(vcpu);
946 current->thread.gmap_pfault = 0;
947 if (kvm_arch_setup_async_pf(vcpu) ||
948 (kvm_arch_fault_in_sync(vcpu) >= 0))
949 rc = 0;
950 }
951
952 if (rc == -1) {
762 VCPU_EVENT(vcpu, 3, "%s", "fault in sie instruction"); 953 VCPU_EVENT(vcpu, 3, "%s", "fault in sie instruction");
763 trace_kvm_s390_sie_fault(vcpu); 954 trace_kvm_s390_sie_fault(vcpu);
764 rc = kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING); 955 rc = kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
@@ -768,7 +959,8 @@ static int vcpu_post_run(struct kvm_vcpu *vcpu, int exit_reason)
768 959
769 if (rc == 0) { 960 if (rc == 0) {
770 if (kvm_is_ucontrol(vcpu->kvm)) 961 if (kvm_is_ucontrol(vcpu->kvm))
771 rc = -EOPNOTSUPP; 962 /* Don't exit for host interrupts. */
963 rc = vcpu->arch.sie_block->icptcode ? -EOPNOTSUPP : 0;
772 else 964 else
773 rc = kvm_handle_sie_intercept(vcpu); 965 rc = kvm_handle_sie_intercept(vcpu);
774 } 966 }
@@ -831,8 +1023,6 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
831 1023
832 atomic_clear_mask(CPUSTAT_STOPPED, &vcpu->arch.sie_block->cpuflags); 1024 atomic_clear_mask(CPUSTAT_STOPPED, &vcpu->arch.sie_block->cpuflags);
833 1025
834 BUG_ON(vcpu->kvm->arch.float_int.local_int[vcpu->vcpu_id] == NULL);
835
836 switch (kvm_run->exit_reason) { 1026 switch (kvm_run->exit_reason) {
837 case KVM_EXIT_S390_SIEIC: 1027 case KVM_EXIT_S390_SIEIC:
838 case KVM_EXIT_UNKNOWN: 1028 case KVM_EXIT_UNKNOWN:
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h
index 564514f410f4..3c1e2274d9ea 100644
--- a/arch/s390/kvm/kvm-s390.h
+++ b/arch/s390/kvm/kvm-s390.h
@@ -129,6 +129,7 @@ enum hrtimer_restart kvm_s390_idle_wakeup(struct hrtimer *timer);
129void kvm_s390_tasklet(unsigned long parm); 129void kvm_s390_tasklet(unsigned long parm);
130void kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu); 130void kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu);
131void kvm_s390_deliver_pending_machine_checks(struct kvm_vcpu *vcpu); 131void kvm_s390_deliver_pending_machine_checks(struct kvm_vcpu *vcpu);
132void kvm_s390_clear_local_irqs(struct kvm_vcpu *vcpu);
132int __must_check kvm_s390_inject_vm(struct kvm *kvm, 133int __must_check kvm_s390_inject_vm(struct kvm *kvm,
133 struct kvm_s390_interrupt *s390int); 134 struct kvm_s390_interrupt *s390int);
134int __must_check kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu, 135int __must_check kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu,
@@ -136,6 +137,7 @@ int __must_check kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu,
136int __must_check kvm_s390_inject_program_int(struct kvm_vcpu *vcpu, u16 code); 137int __must_check kvm_s390_inject_program_int(struct kvm_vcpu *vcpu, u16 code);
137struct kvm_s390_interrupt_info *kvm_s390_get_io_int(struct kvm *kvm, 138struct kvm_s390_interrupt_info *kvm_s390_get_io_int(struct kvm *kvm,
138 u64 cr6, u64 schid); 139 u64 cr6, u64 schid);
140int kvm_s390_mask_adapter(struct kvm *kvm, unsigned int id, bool masked);
139 141
140/* implemented in priv.c */ 142/* implemented in priv.c */
141int kvm_s390_handle_b2(struct kvm_vcpu *vcpu); 143int kvm_s390_handle_b2(struct kvm_vcpu *vcpu);
@@ -161,4 +163,9 @@ bool kvm_enabled_cmma(void);
161/* implemented in diag.c */ 163/* implemented in diag.c */
162int kvm_s390_handle_diag(struct kvm_vcpu *vcpu); 164int kvm_s390_handle_diag(struct kvm_vcpu *vcpu);
163 165
166/* implemented in interrupt.c */
167int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu);
168int psw_extint_disabled(struct kvm_vcpu *vcpu);
169void kvm_s390_destroy_adapters(struct kvm *kvm);
170
164#endif 171#endif
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index aacb6b129914..476e9e218f43 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -396,15 +396,10 @@ static int handle_stidp(struct kvm_vcpu *vcpu)
396 396
397static void handle_stsi_3_2_2(struct kvm_vcpu *vcpu, struct sysinfo_3_2_2 *mem) 397static void handle_stsi_3_2_2(struct kvm_vcpu *vcpu, struct sysinfo_3_2_2 *mem)
398{ 398{
399 struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int;
400 int cpus = 0; 399 int cpus = 0;
401 int n; 400 int n;
402 401
403 spin_lock(&fi->lock); 402 cpus = atomic_read(&vcpu->kvm->online_vcpus);
404 for (n = 0; n < KVM_MAX_VCPUS; n++)
405 if (fi->local_int[n])
406 cpus++;
407 spin_unlock(&fi->lock);
408 403
409 /* deal with other level 3 hypervisors */ 404 /* deal with other level 3 hypervisors */
410 if (stsi(mem, 3, 2, 2)) 405 if (stsi(mem, 3, 2, 2))
diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c
index 87c2b3a3bd3e..26caeb530a78 100644
--- a/arch/s390/kvm/sigp.c
+++ b/arch/s390/kvm/sigp.c
@@ -23,29 +23,30 @@
23static int __sigp_sense(struct kvm_vcpu *vcpu, u16 cpu_addr, 23static int __sigp_sense(struct kvm_vcpu *vcpu, u16 cpu_addr,
24 u64 *reg) 24 u64 *reg)
25{ 25{
26 struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int; 26 struct kvm_s390_local_interrupt *li;
27 struct kvm_vcpu *dst_vcpu = NULL;
28 int cpuflags;
27 int rc; 29 int rc;
28 30
29 if (cpu_addr >= KVM_MAX_VCPUS) 31 if (cpu_addr >= KVM_MAX_VCPUS)
30 return SIGP_CC_NOT_OPERATIONAL; 32 return SIGP_CC_NOT_OPERATIONAL;
31 33
32 spin_lock(&fi->lock); 34 dst_vcpu = kvm_get_vcpu(vcpu->kvm, cpu_addr);
33 if (fi->local_int[cpu_addr] == NULL) 35 if (!dst_vcpu)
34 rc = SIGP_CC_NOT_OPERATIONAL; 36 return SIGP_CC_NOT_OPERATIONAL;
35 else if (!(atomic_read(fi->local_int[cpu_addr]->cpuflags) 37 li = &dst_vcpu->arch.local_int;
36 & (CPUSTAT_ECALL_PEND | CPUSTAT_STOPPED))) 38
39 cpuflags = atomic_read(li->cpuflags);
40 if (!(cpuflags & (CPUSTAT_ECALL_PEND | CPUSTAT_STOPPED)))
37 rc = SIGP_CC_ORDER_CODE_ACCEPTED; 41 rc = SIGP_CC_ORDER_CODE_ACCEPTED;
38 else { 42 else {
39 *reg &= 0xffffffff00000000UL; 43 *reg &= 0xffffffff00000000UL;
40 if (atomic_read(fi->local_int[cpu_addr]->cpuflags) 44 if (cpuflags & CPUSTAT_ECALL_PEND)
41 & CPUSTAT_ECALL_PEND)
42 *reg |= SIGP_STATUS_EXT_CALL_PENDING; 45 *reg |= SIGP_STATUS_EXT_CALL_PENDING;
43 if (atomic_read(fi->local_int[cpu_addr]->cpuflags) 46 if (cpuflags & CPUSTAT_STOPPED)
44 & CPUSTAT_STOPPED)
45 *reg |= SIGP_STATUS_STOPPED; 47 *reg |= SIGP_STATUS_STOPPED;
46 rc = SIGP_CC_STATUS_STORED; 48 rc = SIGP_CC_STATUS_STORED;
47 } 49 }
48 spin_unlock(&fi->lock);
49 50
50 VCPU_EVENT(vcpu, 4, "sensed status of cpu %x rc %x", cpu_addr, rc); 51 VCPU_EVENT(vcpu, 4, "sensed status of cpu %x rc %x", cpu_addr, rc);
51 return rc; 52 return rc;
@@ -53,12 +54,13 @@ static int __sigp_sense(struct kvm_vcpu *vcpu, u16 cpu_addr,
53 54
54static int __sigp_emergency(struct kvm_vcpu *vcpu, u16 cpu_addr) 55static int __sigp_emergency(struct kvm_vcpu *vcpu, u16 cpu_addr)
55{ 56{
56 struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int;
57 struct kvm_s390_local_interrupt *li; 57 struct kvm_s390_local_interrupt *li;
58 struct kvm_s390_interrupt_info *inti; 58 struct kvm_s390_interrupt_info *inti;
59 int rc; 59 struct kvm_vcpu *dst_vcpu = NULL;
60 60
61 if (cpu_addr >= KVM_MAX_VCPUS) 61 if (cpu_addr < KVM_MAX_VCPUS)
62 dst_vcpu = kvm_get_vcpu(vcpu->kvm, cpu_addr);
63 if (!dst_vcpu)
62 return SIGP_CC_NOT_OPERATIONAL; 64 return SIGP_CC_NOT_OPERATIONAL;
63 65
64 inti = kzalloc(sizeof(*inti), GFP_KERNEL); 66 inti = kzalloc(sizeof(*inti), GFP_KERNEL);
@@ -68,13 +70,7 @@ static int __sigp_emergency(struct kvm_vcpu *vcpu, u16 cpu_addr)
68 inti->type = KVM_S390_INT_EMERGENCY; 70 inti->type = KVM_S390_INT_EMERGENCY;
69 inti->emerg.code = vcpu->vcpu_id; 71 inti->emerg.code = vcpu->vcpu_id;
70 72
71 spin_lock(&fi->lock); 73 li = &dst_vcpu->arch.local_int;
72 li = fi->local_int[cpu_addr];
73 if (li == NULL) {
74 rc = SIGP_CC_NOT_OPERATIONAL;
75 kfree(inti);
76 goto unlock;
77 }
78 spin_lock_bh(&li->lock); 74 spin_lock_bh(&li->lock);
79 list_add_tail(&inti->list, &li->list); 75 list_add_tail(&inti->list, &li->list);
80 atomic_set(&li->active, 1); 76 atomic_set(&li->active, 1);
@@ -82,11 +78,9 @@ static int __sigp_emergency(struct kvm_vcpu *vcpu, u16 cpu_addr)
82 if (waitqueue_active(li->wq)) 78 if (waitqueue_active(li->wq))
83 wake_up_interruptible(li->wq); 79 wake_up_interruptible(li->wq);
84 spin_unlock_bh(&li->lock); 80 spin_unlock_bh(&li->lock);
85 rc = SIGP_CC_ORDER_CODE_ACCEPTED;
86 VCPU_EVENT(vcpu, 4, "sent sigp emerg to cpu %x", cpu_addr); 81 VCPU_EVENT(vcpu, 4, "sent sigp emerg to cpu %x", cpu_addr);
87unlock: 82
88 spin_unlock(&fi->lock); 83 return SIGP_CC_ORDER_CODE_ACCEPTED;
89 return rc;
90} 84}
91 85
92static int __sigp_conditional_emergency(struct kvm_vcpu *vcpu, u16 cpu_addr, 86static int __sigp_conditional_emergency(struct kvm_vcpu *vcpu, u16 cpu_addr,
@@ -122,12 +116,13 @@ static int __sigp_conditional_emergency(struct kvm_vcpu *vcpu, u16 cpu_addr,
122 116
123static int __sigp_external_call(struct kvm_vcpu *vcpu, u16 cpu_addr) 117static int __sigp_external_call(struct kvm_vcpu *vcpu, u16 cpu_addr)
124{ 118{
125 struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int;
126 struct kvm_s390_local_interrupt *li; 119 struct kvm_s390_local_interrupt *li;
127 struct kvm_s390_interrupt_info *inti; 120 struct kvm_s390_interrupt_info *inti;
128 int rc; 121 struct kvm_vcpu *dst_vcpu = NULL;
129 122
130 if (cpu_addr >= KVM_MAX_VCPUS) 123 if (cpu_addr < KVM_MAX_VCPUS)
124 dst_vcpu = kvm_get_vcpu(vcpu->kvm, cpu_addr);
125 if (!dst_vcpu)
131 return SIGP_CC_NOT_OPERATIONAL; 126 return SIGP_CC_NOT_OPERATIONAL;
132 127
133 inti = kzalloc(sizeof(*inti), GFP_KERNEL); 128 inti = kzalloc(sizeof(*inti), GFP_KERNEL);
@@ -137,13 +132,7 @@ static int __sigp_external_call(struct kvm_vcpu *vcpu, u16 cpu_addr)
137 inti->type = KVM_S390_INT_EXTERNAL_CALL; 132 inti->type = KVM_S390_INT_EXTERNAL_CALL;
138 inti->extcall.code = vcpu->vcpu_id; 133 inti->extcall.code = vcpu->vcpu_id;
139 134
140 spin_lock(&fi->lock); 135 li = &dst_vcpu->arch.local_int;
141 li = fi->local_int[cpu_addr];
142 if (li == NULL) {
143 rc = SIGP_CC_NOT_OPERATIONAL;
144 kfree(inti);
145 goto unlock;
146 }
147 spin_lock_bh(&li->lock); 136 spin_lock_bh(&li->lock);
148 list_add_tail(&inti->list, &li->list); 137 list_add_tail(&inti->list, &li->list);
149 atomic_set(&li->active, 1); 138 atomic_set(&li->active, 1);
@@ -151,11 +140,9 @@ static int __sigp_external_call(struct kvm_vcpu *vcpu, u16 cpu_addr)
151 if (waitqueue_active(li->wq)) 140 if (waitqueue_active(li->wq))
152 wake_up_interruptible(li->wq); 141 wake_up_interruptible(li->wq);
153 spin_unlock_bh(&li->lock); 142 spin_unlock_bh(&li->lock);
154 rc = SIGP_CC_ORDER_CODE_ACCEPTED;
155 VCPU_EVENT(vcpu, 4, "sent sigp ext call to cpu %x", cpu_addr); 143 VCPU_EVENT(vcpu, 4, "sent sigp ext call to cpu %x", cpu_addr);
156unlock: 144
157 spin_unlock(&fi->lock); 145 return SIGP_CC_ORDER_CODE_ACCEPTED;
158 return rc;
159} 146}
160 147
161static int __inject_sigp_stop(struct kvm_s390_local_interrupt *li, int action) 148static int __inject_sigp_stop(struct kvm_s390_local_interrupt *li, int action)
@@ -189,31 +176,26 @@ out:
189 176
190static int __sigp_stop(struct kvm_vcpu *vcpu, u16 cpu_addr, int action) 177static int __sigp_stop(struct kvm_vcpu *vcpu, u16 cpu_addr, int action)
191{ 178{
192 struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int;
193 struct kvm_s390_local_interrupt *li; 179 struct kvm_s390_local_interrupt *li;
180 struct kvm_vcpu *dst_vcpu = NULL;
194 int rc; 181 int rc;
195 182
196 if (cpu_addr >= KVM_MAX_VCPUS) 183 if (cpu_addr >= KVM_MAX_VCPUS)
197 return SIGP_CC_NOT_OPERATIONAL; 184 return SIGP_CC_NOT_OPERATIONAL;
198 185
199 spin_lock(&fi->lock); 186 dst_vcpu = kvm_get_vcpu(vcpu->kvm, cpu_addr);
200 li = fi->local_int[cpu_addr]; 187 if (!dst_vcpu)
201 if (li == NULL) { 188 return SIGP_CC_NOT_OPERATIONAL;
202 rc = SIGP_CC_NOT_OPERATIONAL; 189 li = &dst_vcpu->arch.local_int;
203 goto unlock;
204 }
205 190
206 rc = __inject_sigp_stop(li, action); 191 rc = __inject_sigp_stop(li, action);
207 192
208unlock:
209 spin_unlock(&fi->lock);
210 VCPU_EVENT(vcpu, 4, "sent sigp stop to cpu %x", cpu_addr); 193 VCPU_EVENT(vcpu, 4, "sent sigp stop to cpu %x", cpu_addr);
211 194
212 if ((action & ACTION_STORE_ON_STOP) != 0 && rc == -ESHUTDOWN) { 195 if ((action & ACTION_STORE_ON_STOP) != 0 && rc == -ESHUTDOWN) {
213 /* If the CPU has already been stopped, we still have 196 /* If the CPU has already been stopped, we still have
214 * to save the status when doing stop-and-store. This 197 * to save the status when doing stop-and-store. This
215 * has to be done after unlocking all spinlocks. */ 198 * has to be done after unlocking all spinlocks. */
216 struct kvm_vcpu *dst_vcpu = kvm_get_vcpu(vcpu->kvm, cpu_addr);
217 rc = kvm_s390_store_status_unloaded(dst_vcpu, 199 rc = kvm_s390_store_status_unloaded(dst_vcpu,
218 KVM_S390_STORE_STATUS_NOADDR); 200 KVM_S390_STORE_STATUS_NOADDR);
219 } 201 }
@@ -224,6 +206,8 @@ unlock:
224static int __sigp_set_arch(struct kvm_vcpu *vcpu, u32 parameter) 206static int __sigp_set_arch(struct kvm_vcpu *vcpu, u32 parameter)
225{ 207{
226 int rc; 208 int rc;
209 unsigned int i;
210 struct kvm_vcpu *v;
227 211
228 switch (parameter & 0xff) { 212 switch (parameter & 0xff) {
229 case 0: 213 case 0:
@@ -231,6 +215,11 @@ static int __sigp_set_arch(struct kvm_vcpu *vcpu, u32 parameter)
231 break; 215 break;
232 case 1: 216 case 1:
233 case 2: 217 case 2:
218 kvm_for_each_vcpu(i, v, vcpu->kvm) {
219 v->arch.pfault_token = KVM_S390_PFAULT_TOKEN_INVALID;
220 kvm_clear_async_pf_completion_queue(v);
221 }
222
234 rc = SIGP_CC_ORDER_CODE_ACCEPTED; 223 rc = SIGP_CC_ORDER_CODE_ACCEPTED;
235 break; 224 break;
236 default: 225 default:
@@ -242,12 +231,18 @@ static int __sigp_set_arch(struct kvm_vcpu *vcpu, u32 parameter)
242static int __sigp_set_prefix(struct kvm_vcpu *vcpu, u16 cpu_addr, u32 address, 231static int __sigp_set_prefix(struct kvm_vcpu *vcpu, u16 cpu_addr, u32 address,
243 u64 *reg) 232 u64 *reg)
244{ 233{
245 struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int; 234 struct kvm_s390_local_interrupt *li;
246 struct kvm_s390_local_interrupt *li = NULL; 235 struct kvm_vcpu *dst_vcpu = NULL;
247 struct kvm_s390_interrupt_info *inti; 236 struct kvm_s390_interrupt_info *inti;
248 int rc; 237 int rc;
249 u8 tmp; 238 u8 tmp;
250 239
240 if (cpu_addr < KVM_MAX_VCPUS)
241 dst_vcpu = kvm_get_vcpu(vcpu->kvm, cpu_addr);
242 if (!dst_vcpu)
243 return SIGP_CC_NOT_OPERATIONAL;
244 li = &dst_vcpu->arch.local_int;
245
251 /* make sure that the new value is valid memory */ 246 /* make sure that the new value is valid memory */
252 address = address & 0x7fffe000u; 247 address = address & 0x7fffe000u;
253 if (copy_from_guest_absolute(vcpu, &tmp, address, 1) || 248 if (copy_from_guest_absolute(vcpu, &tmp, address, 1) ||
@@ -261,18 +256,6 @@ static int __sigp_set_prefix(struct kvm_vcpu *vcpu, u16 cpu_addr, u32 address,
261 if (!inti) 256 if (!inti)
262 return SIGP_CC_BUSY; 257 return SIGP_CC_BUSY;
263 258
264 spin_lock(&fi->lock);
265 if (cpu_addr < KVM_MAX_VCPUS)
266 li = fi->local_int[cpu_addr];
267
268 if (li == NULL) {
269 *reg &= 0xffffffff00000000UL;
270 *reg |= SIGP_STATUS_INCORRECT_STATE;
271 rc = SIGP_CC_STATUS_STORED;
272 kfree(inti);
273 goto out_fi;
274 }
275
276 spin_lock_bh(&li->lock); 259 spin_lock_bh(&li->lock);
277 /* cpu must be in stopped state */ 260 /* cpu must be in stopped state */
278 if (!(atomic_read(li->cpuflags) & CPUSTAT_STOPPED)) { 261 if (!(atomic_read(li->cpuflags) & CPUSTAT_STOPPED)) {
@@ -295,8 +278,6 @@ static int __sigp_set_prefix(struct kvm_vcpu *vcpu, u16 cpu_addr, u32 address,
295 VCPU_EVENT(vcpu, 4, "set prefix of cpu %02x to %x", cpu_addr, address); 278 VCPU_EVENT(vcpu, 4, "set prefix of cpu %02x to %x", cpu_addr, address);
296out_li: 279out_li:
297 spin_unlock_bh(&li->lock); 280 spin_unlock_bh(&li->lock);
298out_fi:
299 spin_unlock(&fi->lock);
300 return rc; 281 return rc;
301} 282}
302 283
@@ -334,28 +315,26 @@ static int __sigp_store_status_at_addr(struct kvm_vcpu *vcpu, u16 cpu_id,
334static int __sigp_sense_running(struct kvm_vcpu *vcpu, u16 cpu_addr, 315static int __sigp_sense_running(struct kvm_vcpu *vcpu, u16 cpu_addr,
335 u64 *reg) 316 u64 *reg)
336{ 317{
318 struct kvm_s390_local_interrupt *li;
319 struct kvm_vcpu *dst_vcpu = NULL;
337 int rc; 320 int rc;
338 struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int;
339 321
340 if (cpu_addr >= KVM_MAX_VCPUS) 322 if (cpu_addr >= KVM_MAX_VCPUS)
341 return SIGP_CC_NOT_OPERATIONAL; 323 return SIGP_CC_NOT_OPERATIONAL;
342 324
343 spin_lock(&fi->lock); 325 dst_vcpu = kvm_get_vcpu(vcpu->kvm, cpu_addr);
344 if (fi->local_int[cpu_addr] == NULL) 326 if (!dst_vcpu)
345 rc = SIGP_CC_NOT_OPERATIONAL; 327 return SIGP_CC_NOT_OPERATIONAL;
346 else { 328 li = &dst_vcpu->arch.local_int;
347 if (atomic_read(fi->local_int[cpu_addr]->cpuflags) 329 if (atomic_read(li->cpuflags) & CPUSTAT_RUNNING) {
348 & CPUSTAT_RUNNING) { 330 /* running */
349 /* running */ 331 rc = SIGP_CC_ORDER_CODE_ACCEPTED;
350 rc = SIGP_CC_ORDER_CODE_ACCEPTED; 332 } else {
351 } else { 333 /* not running */
352 /* not running */ 334 *reg &= 0xffffffff00000000UL;
353 *reg &= 0xffffffff00000000UL; 335 *reg |= SIGP_STATUS_NOT_RUNNING;
354 *reg |= SIGP_STATUS_NOT_RUNNING; 336 rc = SIGP_CC_STATUS_STORED;
355 rc = SIGP_CC_STATUS_STORED;
356 }
357 } 337 }
358 spin_unlock(&fi->lock);
359 338
360 VCPU_EVENT(vcpu, 4, "sensed running status of cpu %x rc %x", cpu_addr, 339 VCPU_EVENT(vcpu, 4, "sensed running status of cpu %x rc %x", cpu_addr,
361 rc); 340 rc);
@@ -366,26 +345,22 @@ static int __sigp_sense_running(struct kvm_vcpu *vcpu, u16 cpu_addr,
366/* Test whether the destination CPU is available and not busy */ 345/* Test whether the destination CPU is available and not busy */
367static int sigp_check_callable(struct kvm_vcpu *vcpu, u16 cpu_addr) 346static int sigp_check_callable(struct kvm_vcpu *vcpu, u16 cpu_addr)
368{ 347{
369 struct kvm_s390_float_interrupt *fi = &vcpu->kvm->arch.float_int;
370 struct kvm_s390_local_interrupt *li; 348 struct kvm_s390_local_interrupt *li;
371 int rc = SIGP_CC_ORDER_CODE_ACCEPTED; 349 int rc = SIGP_CC_ORDER_CODE_ACCEPTED;
350 struct kvm_vcpu *dst_vcpu = NULL;
372 351
373 if (cpu_addr >= KVM_MAX_VCPUS) 352 if (cpu_addr >= KVM_MAX_VCPUS)
374 return SIGP_CC_NOT_OPERATIONAL; 353 return SIGP_CC_NOT_OPERATIONAL;
375 354
376 spin_lock(&fi->lock); 355 dst_vcpu = kvm_get_vcpu(vcpu->kvm, cpu_addr);
377 li = fi->local_int[cpu_addr]; 356 if (!dst_vcpu)
378 if (li == NULL) { 357 return SIGP_CC_NOT_OPERATIONAL;
379 rc = SIGP_CC_NOT_OPERATIONAL; 358 li = &dst_vcpu->arch.local_int;
380 goto out;
381 }
382
383 spin_lock_bh(&li->lock); 359 spin_lock_bh(&li->lock);
384 if (li->action_bits & ACTION_STOP_ON_STOP) 360 if (li->action_bits & ACTION_STOP_ON_STOP)
385 rc = SIGP_CC_BUSY; 361 rc = SIGP_CC_BUSY;
386 spin_unlock_bh(&li->lock); 362 spin_unlock_bh(&li->lock);
387out: 363
388 spin_unlock(&fi->lock);
389 return rc; 364 return rc;
390} 365}
391 366
diff --git a/arch/s390/kvm/trace.h b/arch/s390/kvm/trace.h
index 3db76b2daed7..e8e7213d4cc5 100644
--- a/arch/s390/kvm/trace.h
+++ b/arch/s390/kvm/trace.h
@@ -30,6 +30,52 @@
30 TP_printk("%02d[%016lx-%016lx]: " p_str, __entry->id, \ 30 TP_printk("%02d[%016lx-%016lx]: " p_str, __entry->id, \
31 __entry->pswmask, __entry->pswaddr, p_args) 31 __entry->pswmask, __entry->pswaddr, p_args)
32 32
33TRACE_EVENT(kvm_s390_major_guest_pfault,
34 TP_PROTO(VCPU_PROTO_COMMON),
35 TP_ARGS(VCPU_ARGS_COMMON),
36
37 TP_STRUCT__entry(
38 VCPU_FIELD_COMMON
39 ),
40
41 TP_fast_assign(
42 VCPU_ASSIGN_COMMON
43 ),
44 VCPU_TP_PRINTK("%s", "major fault, maybe applicable for pfault")
45 );
46
47TRACE_EVENT(kvm_s390_pfault_init,
48 TP_PROTO(VCPU_PROTO_COMMON, long pfault_token),
49 TP_ARGS(VCPU_ARGS_COMMON, pfault_token),
50
51 TP_STRUCT__entry(
52 VCPU_FIELD_COMMON
53 __field(long, pfault_token)
54 ),
55
56 TP_fast_assign(
57 VCPU_ASSIGN_COMMON
58 __entry->pfault_token = pfault_token;
59 ),
60 VCPU_TP_PRINTK("init pfault token %ld", __entry->pfault_token)
61 );
62
63TRACE_EVENT(kvm_s390_pfault_done,
64 TP_PROTO(VCPU_PROTO_COMMON, long pfault_token),
65 TP_ARGS(VCPU_ARGS_COMMON, pfault_token),
66
67 TP_STRUCT__entry(
68 VCPU_FIELD_COMMON
69 __field(long, pfault_token)
70 ),
71
72 TP_fast_assign(
73 VCPU_ASSIGN_COMMON
74 __entry->pfault_token = pfault_token;
75 ),
76 VCPU_TP_PRINTK("done pfault token %ld", __entry->pfault_token)
77 );
78
33/* 79/*
34 * Tracepoints for SIE entry and exit. 80 * Tracepoints for SIE entry and exit.
35 */ 81 */
diff --git a/arch/s390/lib/Makefile b/arch/s390/lib/Makefile
index e3fffe1dff51..c6d752e8bf28 100644
--- a/arch/s390/lib/Makefile
+++ b/arch/s390/lib/Makefile
@@ -2,7 +2,7 @@
2# Makefile for s390-specific library files.. 2# Makefile for s390-specific library files..
3# 3#
4 4
5lib-y += delay.o string.o uaccess_pt.o uaccess_mvcos.o find.o 5lib-y += delay.o string.o uaccess.o find.o
6obj-$(CONFIG_32BIT) += div64.o qrnnd.o ucmpdi2.o mem32.o 6obj-$(CONFIG_32BIT) += div64.o qrnnd.o ucmpdi2.o mem32.o
7obj-$(CONFIG_64BIT) += mem64.o 7obj-$(CONFIG_64BIT) += mem64.o
8lib-$(CONFIG_SMP) += spinlock.o 8lib-$(CONFIG_SMP) += spinlock.o
diff --git a/arch/s390/lib/uaccess.c b/arch/s390/lib/uaccess.c
new file mode 100644
index 000000000000..23f866b4c7f1
--- /dev/null
+++ b/arch/s390/lib/uaccess.c
@@ -0,0 +1,407 @@
1/*
2 * Standard user space access functions based on mvcp/mvcs and doing
3 * interesting things in the secondary space mode.
4 *
5 * Copyright IBM Corp. 2006,2014
6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
7 * Gerald Schaefer (gerald.schaefer@de.ibm.com)
8 */
9
10#include <linux/jump_label.h>
11#include <linux/uaccess.h>
12#include <linux/export.h>
13#include <linux/errno.h>
14#include <linux/mm.h>
15#include <asm/mmu_context.h>
16#include <asm/facility.h>
17
18#ifndef CONFIG_64BIT
19#define AHI "ahi"
20#define ALR "alr"
21#define CLR "clr"
22#define LHI "lhi"
23#define SLR "slr"
24#else
25#define AHI "aghi"
26#define ALR "algr"
27#define CLR "clgr"
28#define LHI "lghi"
29#define SLR "slgr"
30#endif
31
32static struct static_key have_mvcos = STATIC_KEY_INIT_FALSE;
33
34static inline unsigned long copy_from_user_mvcos(void *x, const void __user *ptr,
35 unsigned long size)
36{
37 register unsigned long reg0 asm("0") = 0x81UL;
38 unsigned long tmp1, tmp2;
39
40 tmp1 = -4096UL;
41 asm volatile(
42 "0: .insn ss,0xc80000000000,0(%0,%2),0(%1),0\n"
43 "9: jz 7f\n"
44 "1:"ALR" %0,%3\n"
45 " "SLR" %1,%3\n"
46 " "SLR" %2,%3\n"
47 " j 0b\n"
48 "2: la %4,4095(%1)\n"/* %4 = ptr + 4095 */
49 " nr %4,%3\n" /* %4 = (ptr + 4095) & -4096 */
50 " "SLR" %4,%1\n"
51 " "CLR" %0,%4\n" /* copy crosses next page boundary? */
52 " jnh 4f\n"
53 "3: .insn ss,0xc80000000000,0(%4,%2),0(%1),0\n"
54 "10:"SLR" %0,%4\n"
55 " "ALR" %2,%4\n"
56 "4:"LHI" %4,-1\n"
57 " "ALR" %4,%0\n" /* copy remaining size, subtract 1 */
58 " bras %3,6f\n" /* memset loop */
59 " xc 0(1,%2),0(%2)\n"
60 "5: xc 0(256,%2),0(%2)\n"
61 " la %2,256(%2)\n"
62 "6:"AHI" %4,-256\n"
63 " jnm 5b\n"
64 " ex %4,0(%3)\n"
65 " j 8f\n"
66 "7:"SLR" %0,%0\n"
67 "8:\n"
68 EX_TABLE(0b,2b) EX_TABLE(3b,4b) EX_TABLE(9b,2b) EX_TABLE(10b,4b)
69 : "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2)
70 : "d" (reg0) : "cc", "memory");
71 return size;
72}
73
74static inline unsigned long copy_from_user_mvcp(void *x, const void __user *ptr,
75 unsigned long size)
76{
77 unsigned long tmp1, tmp2;
78
79 update_primary_asce(current);
80 tmp1 = -256UL;
81 asm volatile(
82 " sacf 0\n"
83 "0: mvcp 0(%0,%2),0(%1),%3\n"
84 "10:jz 8f\n"
85 "1:"ALR" %0,%3\n"
86 " la %1,256(%1)\n"
87 " la %2,256(%2)\n"
88 "2: mvcp 0(%0,%2),0(%1),%3\n"
89 "11:jnz 1b\n"
90 " j 8f\n"
91 "3: la %4,255(%1)\n" /* %4 = ptr + 255 */
92 " "LHI" %3,-4096\n"
93 " nr %4,%3\n" /* %4 = (ptr + 255) & -4096 */
94 " "SLR" %4,%1\n"
95 " "CLR" %0,%4\n" /* copy crosses next page boundary? */
96 " jnh 5f\n"
97 "4: mvcp 0(%4,%2),0(%1),%3\n"
98 "12:"SLR" %0,%4\n"
99 " "ALR" %2,%4\n"
100 "5:"LHI" %4,-1\n"
101 " "ALR" %4,%0\n" /* copy remaining size, subtract 1 */
102 " bras %3,7f\n" /* memset loop */
103 " xc 0(1,%2),0(%2)\n"
104 "6: xc 0(256,%2),0(%2)\n"
105 " la %2,256(%2)\n"
106 "7:"AHI" %4,-256\n"
107 " jnm 6b\n"
108 " ex %4,0(%3)\n"
109 " j 9f\n"
110 "8:"SLR" %0,%0\n"
111 "9: sacf 768\n"
112 EX_TABLE(0b,3b) EX_TABLE(2b,3b) EX_TABLE(4b,5b)
113 EX_TABLE(10b,3b) EX_TABLE(11b,3b) EX_TABLE(12b,5b)
114 : "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2)
115 : : "cc", "memory");
116 return size;
117}
118
119unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n)
120{
121 if (static_key_false(&have_mvcos))
122 return copy_from_user_mvcos(to, from, n);
123 return copy_from_user_mvcp(to, from, n);
124}
125EXPORT_SYMBOL(__copy_from_user);
126
127static inline unsigned long copy_to_user_mvcos(void __user *ptr, const void *x,
128 unsigned long size)
129{
130 register unsigned long reg0 asm("0") = 0x810000UL;
131 unsigned long tmp1, tmp2;
132
133 tmp1 = -4096UL;
134 asm volatile(
135 "0: .insn ss,0xc80000000000,0(%0,%1),0(%2),0\n"
136 "6: jz 4f\n"
137 "1:"ALR" %0,%3\n"
138 " "SLR" %1,%3\n"
139 " "SLR" %2,%3\n"
140 " j 0b\n"
141 "2: la %4,4095(%1)\n"/* %4 = ptr + 4095 */
142 " nr %4,%3\n" /* %4 = (ptr + 4095) & -4096 */
143 " "SLR" %4,%1\n"
144 " "CLR" %0,%4\n" /* copy crosses next page boundary? */
145 " jnh 5f\n"
146 "3: .insn ss,0xc80000000000,0(%4,%1),0(%2),0\n"
147 "7:"SLR" %0,%4\n"
148 " j 5f\n"
149 "4:"SLR" %0,%0\n"
150 "5:\n"
151 EX_TABLE(0b,2b) EX_TABLE(3b,5b) EX_TABLE(6b,2b) EX_TABLE(7b,5b)
152 : "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2)
153 : "d" (reg0) : "cc", "memory");
154 return size;
155}
156
157static inline unsigned long copy_to_user_mvcs(void __user *ptr, const void *x,
158 unsigned long size)
159{
160 unsigned long tmp1, tmp2;
161
162 update_primary_asce(current);
163 tmp1 = -256UL;
164 asm volatile(
165 " sacf 0\n"
166 "0: mvcs 0(%0,%1),0(%2),%3\n"
167 "7: jz 5f\n"
168 "1:"ALR" %0,%3\n"
169 " la %1,256(%1)\n"
170 " la %2,256(%2)\n"
171 "2: mvcs 0(%0,%1),0(%2),%3\n"
172 "8: jnz 1b\n"
173 " j 5f\n"
174 "3: la %4,255(%1)\n" /* %4 = ptr + 255 */
175 " "LHI" %3,-4096\n"
176 " nr %4,%3\n" /* %4 = (ptr + 255) & -4096 */
177 " "SLR" %4,%1\n"
178 " "CLR" %0,%4\n" /* copy crosses next page boundary? */
179 " jnh 6f\n"
180 "4: mvcs 0(%4,%1),0(%2),%3\n"
181 "9:"SLR" %0,%4\n"
182 " j 6f\n"
183 "5:"SLR" %0,%0\n"
184 "6: sacf 768\n"
185 EX_TABLE(0b,3b) EX_TABLE(2b,3b) EX_TABLE(4b,6b)
186 EX_TABLE(7b,3b) EX_TABLE(8b,3b) EX_TABLE(9b,6b)
187 : "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2)
188 : : "cc", "memory");
189 return size;
190}
191
192unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n)
193{
194 if (static_key_false(&have_mvcos))
195 return copy_to_user_mvcos(to, from, n);
196 return copy_to_user_mvcs(to, from, n);
197}
198EXPORT_SYMBOL(__copy_to_user);
199
200static inline unsigned long copy_in_user_mvcos(void __user *to, const void __user *from,
201 unsigned long size)
202{
203 register unsigned long reg0 asm("0") = 0x810081UL;
204 unsigned long tmp1, tmp2;
205
206 tmp1 = -4096UL;
207 /* FIXME: copy with reduced length. */
208 asm volatile(
209 "0: .insn ss,0xc80000000000,0(%0,%1),0(%2),0\n"
210 " jz 2f\n"
211 "1:"ALR" %0,%3\n"
212 " "SLR" %1,%3\n"
213 " "SLR" %2,%3\n"
214 " j 0b\n"
215 "2:"SLR" %0,%0\n"
216 "3: \n"
217 EX_TABLE(0b,3b)
218 : "+a" (size), "+a" (to), "+a" (from), "+a" (tmp1), "=a" (tmp2)
219 : "d" (reg0) : "cc", "memory");
220 return size;
221}
222
223static inline unsigned long copy_in_user_mvc(void __user *to, const void __user *from,
224 unsigned long size)
225{
226 unsigned long tmp1;
227
228 update_primary_asce(current);
229 asm volatile(
230 " sacf 256\n"
231 " "AHI" %0,-1\n"
232 " jo 5f\n"
233 " bras %3,3f\n"
234 "0:"AHI" %0,257\n"
235 "1: mvc 0(1,%1),0(%2)\n"
236 " la %1,1(%1)\n"
237 " la %2,1(%2)\n"
238 " "AHI" %0,-1\n"
239 " jnz 1b\n"
240 " j 5f\n"
241 "2: mvc 0(256,%1),0(%2)\n"
242 " la %1,256(%1)\n"
243 " la %2,256(%2)\n"
244 "3:"AHI" %0,-256\n"
245 " jnm 2b\n"
246 "4: ex %0,1b-0b(%3)\n"
247 "5: "SLR" %0,%0\n"
248 "6: sacf 768\n"
249 EX_TABLE(1b,6b) EX_TABLE(2b,0b) EX_TABLE(4b,0b)
250 : "+a" (size), "+a" (to), "+a" (from), "=a" (tmp1)
251 : : "cc", "memory");
252 return size;
253}
254
255unsigned long __copy_in_user(void __user *to, const void __user *from, unsigned long n)
256{
257 if (static_key_false(&have_mvcos))
258 return copy_in_user_mvcos(to, from, n);
259 return copy_in_user_mvc(to, from, n);
260}
261EXPORT_SYMBOL(__copy_in_user);
262
263static inline unsigned long clear_user_mvcos(void __user *to, unsigned long size)
264{
265 register unsigned long reg0 asm("0") = 0x810000UL;
266 unsigned long tmp1, tmp2;
267
268 tmp1 = -4096UL;
269 asm volatile(
270 "0: .insn ss,0xc80000000000,0(%0,%1),0(%4),0\n"
271 " jz 4f\n"
272 "1:"ALR" %0,%2\n"
273 " "SLR" %1,%2\n"
274 " j 0b\n"
275 "2: la %3,4095(%1)\n"/* %4 = to + 4095 */
276 " nr %3,%2\n" /* %4 = (to + 4095) & -4096 */
277 " "SLR" %3,%1\n"
278 " "CLR" %0,%3\n" /* copy crosses next page boundary? */
279 " jnh 5f\n"
280 "3: .insn ss,0xc80000000000,0(%3,%1),0(%4),0\n"
281 " "SLR" %0,%3\n"
282 " j 5f\n"
283 "4:"SLR" %0,%0\n"
284 "5:\n"
285 EX_TABLE(0b,2b) EX_TABLE(3b,5b)
286 : "+a" (size), "+a" (to), "+a" (tmp1), "=a" (tmp2)
287 : "a" (empty_zero_page), "d" (reg0) : "cc", "memory");
288 return size;
289}
290
291static inline unsigned long clear_user_xc(void __user *to, unsigned long size)
292{
293 unsigned long tmp1, tmp2;
294
295 update_primary_asce(current);
296 asm volatile(
297 " sacf 256\n"
298 " "AHI" %0,-1\n"
299 " jo 5f\n"
300 " bras %3,3f\n"
301 " xc 0(1,%1),0(%1)\n"
302 "0:"AHI" %0,257\n"
303 " la %2,255(%1)\n" /* %2 = ptr + 255 */
304 " srl %2,12\n"
305 " sll %2,12\n" /* %2 = (ptr + 255) & -4096 */
306 " "SLR" %2,%1\n"
307 " "CLR" %0,%2\n" /* clear crosses next page boundary? */
308 " jnh 5f\n"
309 " "AHI" %2,-1\n"
310 "1: ex %2,0(%3)\n"
311 " "AHI" %2,1\n"
312 " "SLR" %0,%2\n"
313 " j 5f\n"
314 "2: xc 0(256,%1),0(%1)\n"
315 " la %1,256(%1)\n"
316 "3:"AHI" %0,-256\n"
317 " jnm 2b\n"
318 "4: ex %0,0(%3)\n"
319 "5: "SLR" %0,%0\n"
320 "6: sacf 768\n"
321 EX_TABLE(1b,6b) EX_TABLE(2b,0b) EX_TABLE(4b,0b)
322 : "+a" (size), "+a" (to), "=a" (tmp1), "=a" (tmp2)
323 : : "cc", "memory");
324 return size;
325}
326
327unsigned long __clear_user(void __user *to, unsigned long size)
328{
329 if (static_key_false(&have_mvcos))
330 return clear_user_mvcos(to, size);
331 return clear_user_xc(to, size);
332}
333EXPORT_SYMBOL(__clear_user);
334
335static inline unsigned long strnlen_user_srst(const char __user *src,
336 unsigned long size)
337{
338 register unsigned long reg0 asm("0") = 0;
339 unsigned long tmp1, tmp2;
340
341 if (unlikely(!size))
342 return 0;
343 update_primary_asce(current);
344 asm volatile(
345 " la %2,0(%1)\n"
346 " la %3,0(%0,%1)\n"
347 " "SLR" %0,%0\n"
348 " sacf 256\n"
349 "0: srst %3,%2\n"
350 " jo 0b\n"
351 " la %0,1(%3)\n" /* strnlen_user results includes \0 */
352 " "SLR" %0,%1\n"
353 "1: sacf 768\n"
354 EX_TABLE(0b,1b)
355 : "+a" (size), "+a" (src), "=a" (tmp1), "=a" (tmp2)
356 : "d" (reg0) : "cc", "memory");
357 return size;
358}
359
360unsigned long __strnlen_user(const char __user *src, unsigned long size)
361{
362 update_primary_asce(current);
363 return strnlen_user_srst(src, size);
364}
365EXPORT_SYMBOL(__strnlen_user);
366
367long __strncpy_from_user(char *dst, const char __user *src, long size)
368{
369 size_t done, len, offset, len_str;
370
371 if (unlikely(size <= 0))
372 return 0;
373 done = 0;
374 do {
375 offset = (size_t)src & ~PAGE_MASK;
376 len = min(size - done, PAGE_SIZE - offset);
377 if (copy_from_user(dst, src, len))
378 return -EFAULT;
379 len_str = strnlen(dst, len);
380 done += len_str;
381 src += len_str;
382 dst += len_str;
383 } while ((len_str == len) && (done < size));
384 return done;
385}
386EXPORT_SYMBOL(__strncpy_from_user);
387
388/*
389 * The "old" uaccess variant without mvcos can be enforced with the
390 * uaccess_primary kernel parameter. This is mainly for debugging purposes.
391 */
392static int uaccess_primary __initdata;
393
394static int __init parse_uaccess_pt(char *__unused)
395{
396 uaccess_primary = 1;
397 return 0;
398}
399early_param("uaccess_primary", parse_uaccess_pt);
400
401static int __init uaccess_init(void)
402{
403 if (IS_ENABLED(CONFIG_64BIT) && !uaccess_primary && test_facility(27))
404 static_key_slow_inc(&have_mvcos);
405 return 0;
406}
407early_initcall(uaccess_init);
diff --git a/arch/s390/lib/uaccess.h b/arch/s390/lib/uaccess.h
deleted file mode 100644
index c7e0e81f4b4e..000000000000
--- a/arch/s390/lib/uaccess.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/*
2 * Copyright IBM Corp. 2007
3 *
4 */
5
6#ifndef __ARCH_S390_LIB_UACCESS_H
7#define __ARCH_S390_LIB_UACCESS_H
8
9unsigned long copy_from_user_pt(void *to, const void __user *from, unsigned long n);
10unsigned long copy_to_user_pt(void __user *to, const void *from, unsigned long n);
11unsigned long copy_in_user_pt(void __user *to, const void __user *from, unsigned long n);
12unsigned long clear_user_pt(void __user *to, unsigned long n);
13unsigned long strnlen_user_pt(const char __user *src, unsigned long count);
14long strncpy_from_user_pt(char *dst, const char __user *src, long count);
15
16#endif /* __ARCH_S390_LIB_UACCESS_H */
diff --git a/arch/s390/lib/uaccess_mvcos.c b/arch/s390/lib/uaccess_mvcos.c
deleted file mode 100644
index ae97b8df11aa..000000000000
--- a/arch/s390/lib/uaccess_mvcos.c
+++ /dev/null
@@ -1,263 +0,0 @@
1/*
2 * Optimized user space space access functions based on mvcos.
3 *
4 * Copyright IBM Corp. 2006
5 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
6 * Gerald Schaefer (gerald.schaefer@de.ibm.com)
7 */
8
9#include <linux/jump_label.h>
10#include <linux/errno.h>
11#include <linux/init.h>
12#include <linux/mm.h>
13#include <asm/facility.h>
14#include <asm/uaccess.h>
15#include <asm/futex.h>
16#include "uaccess.h"
17
18#ifndef CONFIG_64BIT
19#define AHI "ahi"
20#define ALR "alr"
21#define CLR "clr"
22#define LHI "lhi"
23#define SLR "slr"
24#else
25#define AHI "aghi"
26#define ALR "algr"
27#define CLR "clgr"
28#define LHI "lghi"
29#define SLR "slgr"
30#endif
31
32static struct static_key have_mvcos = STATIC_KEY_INIT_TRUE;
33
34static inline unsigned long copy_from_user_mvcos(void *x, const void __user *ptr,
35 unsigned long size)
36{
37 register unsigned long reg0 asm("0") = 0x81UL;
38 unsigned long tmp1, tmp2;
39
40 tmp1 = -4096UL;
41 asm volatile(
42 "0: .insn ss,0xc80000000000,0(%0,%2),0(%1),0\n"
43 "9: jz 7f\n"
44 "1:"ALR" %0,%3\n"
45 " "SLR" %1,%3\n"
46 " "SLR" %2,%3\n"
47 " j 0b\n"
48 "2: la %4,4095(%1)\n"/* %4 = ptr + 4095 */
49 " nr %4,%3\n" /* %4 = (ptr + 4095) & -4096 */
50 " "SLR" %4,%1\n"
51 " "CLR" %0,%4\n" /* copy crosses next page boundary? */
52 " jnh 4f\n"
53 "3: .insn ss,0xc80000000000,0(%4,%2),0(%1),0\n"
54 "10:"SLR" %0,%4\n"
55 " "ALR" %2,%4\n"
56 "4:"LHI" %4,-1\n"
57 " "ALR" %4,%0\n" /* copy remaining size, subtract 1 */
58 " bras %3,6f\n" /* memset loop */
59 " xc 0(1,%2),0(%2)\n"
60 "5: xc 0(256,%2),0(%2)\n"
61 " la %2,256(%2)\n"
62 "6:"AHI" %4,-256\n"
63 " jnm 5b\n"
64 " ex %4,0(%3)\n"
65 " j 8f\n"
66 "7:"SLR" %0,%0\n"
67 "8: \n"
68 EX_TABLE(0b,2b) EX_TABLE(3b,4b) EX_TABLE(9b,2b) EX_TABLE(10b,4b)
69 : "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2)
70 : "d" (reg0) : "cc", "memory");
71 return size;
72}
73
74unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n)
75{
76 if (static_key_true(&have_mvcos))
77 return copy_from_user_mvcos(to, from, n);
78 return copy_from_user_pt(to, from, n);
79}
80EXPORT_SYMBOL(__copy_from_user);
81
82static inline unsigned long copy_to_user_mvcos(void __user *ptr, const void *x,
83 unsigned long size)
84{
85 register unsigned long reg0 asm("0") = 0x810000UL;
86 unsigned long tmp1, tmp2;
87
88 tmp1 = -4096UL;
89 asm volatile(
90 "0: .insn ss,0xc80000000000,0(%0,%1),0(%2),0\n"
91 "6: jz 4f\n"
92 "1:"ALR" %0,%3\n"
93 " "SLR" %1,%3\n"
94 " "SLR" %2,%3\n"
95 " j 0b\n"
96 "2: la %4,4095(%1)\n"/* %4 = ptr + 4095 */
97 " nr %4,%3\n" /* %4 = (ptr + 4095) & -4096 */
98 " "SLR" %4,%1\n"
99 " "CLR" %0,%4\n" /* copy crosses next page boundary? */
100 " jnh 5f\n"
101 "3: .insn ss,0xc80000000000,0(%4,%1),0(%2),0\n"
102 "7:"SLR" %0,%4\n"
103 " j 5f\n"
104 "4:"SLR" %0,%0\n"
105 "5: \n"
106 EX_TABLE(0b,2b) EX_TABLE(3b,5b) EX_TABLE(6b,2b) EX_TABLE(7b,5b)
107 : "+a" (size), "+a" (ptr), "+a" (x), "+a" (tmp1), "=a" (tmp2)
108 : "d" (reg0) : "cc", "memory");
109 return size;
110}
111
112unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n)
113{
114 if (static_key_true(&have_mvcos))
115 return copy_to_user_mvcos(to, from, n);
116 return copy_to_user_pt(to, from, n);
117}
118EXPORT_SYMBOL(__copy_to_user);
119
120static inline unsigned long copy_in_user_mvcos(void __user *to, const void __user *from,
121 unsigned long size)
122{
123 register unsigned long reg0 asm("0") = 0x810081UL;
124 unsigned long tmp1, tmp2;
125
126 tmp1 = -4096UL;
127 /* FIXME: copy with reduced length. */
128 asm volatile(
129 "0: .insn ss,0xc80000000000,0(%0,%1),0(%2),0\n"
130 " jz 2f\n"
131 "1:"ALR" %0,%3\n"
132 " "SLR" %1,%3\n"
133 " "SLR" %2,%3\n"
134 " j 0b\n"
135 "2:"SLR" %0,%0\n"
136 "3: \n"
137 EX_TABLE(0b,3b)
138 : "+a" (size), "+a" (to), "+a" (from), "+a" (tmp1), "=a" (tmp2)
139 : "d" (reg0) : "cc", "memory");
140 return size;
141}
142
143unsigned long __copy_in_user(void __user *to, const void __user *from, unsigned long n)
144{
145 if (static_key_true(&have_mvcos))
146 return copy_in_user_mvcos(to, from, n);
147 return copy_in_user_pt(to, from, n);
148}
149EXPORT_SYMBOL(__copy_in_user);
150
151static inline unsigned long clear_user_mvcos(void __user *to, unsigned long size)
152{
153 register unsigned long reg0 asm("0") = 0x810000UL;
154 unsigned long tmp1, tmp2;
155
156 tmp1 = -4096UL;
157 asm volatile(
158 "0: .insn ss,0xc80000000000,0(%0,%1),0(%4),0\n"
159 " jz 4f\n"
160 "1:"ALR" %0,%2\n"
161 " "SLR" %1,%2\n"
162 " j 0b\n"
163 "2: la %3,4095(%1)\n"/* %4 = to + 4095 */
164 " nr %3,%2\n" /* %4 = (to + 4095) & -4096 */
165 " "SLR" %3,%1\n"
166 " "CLR" %0,%3\n" /* copy crosses next page boundary? */
167 " jnh 5f\n"
168 "3: .insn ss,0xc80000000000,0(%3,%1),0(%4),0\n"
169 " "SLR" %0,%3\n"
170 " j 5f\n"
171 "4:"SLR" %0,%0\n"
172 "5: \n"
173 EX_TABLE(0b,2b) EX_TABLE(3b,5b)
174 : "+a" (size), "+a" (to), "+a" (tmp1), "=a" (tmp2)
175 : "a" (empty_zero_page), "d" (reg0) : "cc", "memory");
176 return size;
177}
178
179unsigned long __clear_user(void __user *to, unsigned long size)
180{
181 if (static_key_true(&have_mvcos))
182 return clear_user_mvcos(to, size);
183 return clear_user_pt(to, size);
184}
185EXPORT_SYMBOL(__clear_user);
186
187static inline unsigned long strnlen_user_mvcos(const char __user *src,
188 unsigned long count)
189{
190 unsigned long done, len, offset, len_str;
191 char buf[256];
192
193 done = 0;
194 do {
195 offset = (unsigned long)src & ~PAGE_MASK;
196 len = min(256UL, PAGE_SIZE - offset);
197 len = min(count - done, len);
198 if (copy_from_user_mvcos(buf, src, len))
199 return 0;
200 len_str = strnlen(buf, len);
201 done += len_str;
202 src += len_str;
203 } while ((len_str == len) && (done < count));
204 return done + 1;
205}
206
207unsigned long __strnlen_user(const char __user *src, unsigned long count)
208{
209 if (static_key_true(&have_mvcos))
210 return strnlen_user_mvcos(src, count);
211 return strnlen_user_pt(src, count);
212}
213EXPORT_SYMBOL(__strnlen_user);
214
215static inline long strncpy_from_user_mvcos(char *dst, const char __user *src,
216 long count)
217{
218 unsigned long done, len, offset, len_str;
219
220 if (unlikely(count <= 0))
221 return 0;
222 done = 0;
223 do {
224 offset = (unsigned long)src & ~PAGE_MASK;
225 len = min(count - done, PAGE_SIZE - offset);
226 if (copy_from_user_mvcos(dst, src, len))
227 return -EFAULT;
228 len_str = strnlen(dst, len);
229 done += len_str;
230 src += len_str;
231 dst += len_str;
232 } while ((len_str == len) && (done < count));
233 return done;
234}
235
236long __strncpy_from_user(char *dst, const char __user *src, long count)
237{
238 if (static_key_true(&have_mvcos))
239 return strncpy_from_user_mvcos(dst, src, count);
240 return strncpy_from_user_pt(dst, src, count);
241}
242EXPORT_SYMBOL(__strncpy_from_user);
243
244/*
245 * The uaccess page tabe walk variant can be enforced with the "uaccesspt"
246 * kernel parameter. This is mainly for debugging purposes.
247 */
248static int force_uaccess_pt __initdata;
249
250static int __init parse_uaccess_pt(char *__unused)
251{
252 force_uaccess_pt = 1;
253 return 0;
254}
255early_param("uaccesspt", parse_uaccess_pt);
256
257static int __init uaccess_init(void)
258{
259 if (IS_ENABLED(CONFIG_32BIT) || force_uaccess_pt || !test_facility(27))
260 static_key_slow_dec(&have_mvcos);
261 return 0;
262}
263early_initcall(uaccess_init);
diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c
deleted file mode 100644
index 8d39760bae68..000000000000
--- a/arch/s390/lib/uaccess_pt.c
+++ /dev/null
@@ -1,471 +0,0 @@
1/*
2 * User access functions based on page table walks for enhanced
3 * system layout without hardware support.
4 *
5 * Copyright IBM Corp. 2006, 2012
6 * Author(s): Gerald Schaefer (gerald.schaefer@de.ibm.com)
7 */
8
9#include <linux/errno.h>
10#include <linux/hardirq.h>
11#include <linux/mm.h>
12#include <linux/hugetlb.h>
13#include <asm/uaccess.h>
14#include <asm/futex.h>
15#include "uaccess.h"
16
17#ifndef CONFIG_64BIT
18#define AHI "ahi"
19#define SLR "slr"
20#else
21#define AHI "aghi"
22#define SLR "slgr"
23#endif
24
25static unsigned long strnlen_kernel(const char __user *src, unsigned long count)
26{
27 register unsigned long reg0 asm("0") = 0UL;
28 unsigned long tmp1, tmp2;
29
30 asm volatile(
31 " la %2,0(%1)\n"
32 " la %3,0(%0,%1)\n"
33 " "SLR" %0,%0\n"
34 "0: srst %3,%2\n"
35 " jo 0b\n"
36 " la %0,1(%3)\n" /* strnlen_kernel results includes \0 */
37 " "SLR" %0,%1\n"
38 "1:\n"
39 EX_TABLE(0b,1b)
40 : "+a" (count), "+a" (src), "=a" (tmp1), "=a" (tmp2)
41 : "d" (reg0) : "cc", "memory");
42 return count;
43}
44
45static unsigned long copy_in_kernel(void __user *to, const void __user *from,
46 unsigned long count)
47{
48 unsigned long tmp1;
49
50 asm volatile(
51 " "AHI" %0,-1\n"
52 " jo 5f\n"
53 " bras %3,3f\n"
54 "0:"AHI" %0,257\n"
55 "1: mvc 0(1,%1),0(%2)\n"
56 " la %1,1(%1)\n"
57 " la %2,1(%2)\n"
58 " "AHI" %0,-1\n"
59 " jnz 1b\n"
60 " j 5f\n"
61 "2: mvc 0(256,%1),0(%2)\n"
62 " la %1,256(%1)\n"
63 " la %2,256(%2)\n"
64 "3:"AHI" %0,-256\n"
65 " jnm 2b\n"
66 "4: ex %0,1b-0b(%3)\n"
67 "5:"SLR" %0,%0\n"
68 "6:\n"
69 EX_TABLE(1b,6b) EX_TABLE(2b,0b) EX_TABLE(4b,0b)
70 : "+a" (count), "+a" (to), "+a" (from), "=a" (tmp1)
71 : : "cc", "memory");
72 return count;
73}
74
75/*
76 * Returns kernel address for user virtual address. If the returned address is
77 * >= -4095 (IS_ERR_VALUE(x) returns true), a fault has occurred and the
78 * address contains the (negative) exception code.
79 */
80#ifdef CONFIG_64BIT
81
82static unsigned long follow_table(struct mm_struct *mm,
83 unsigned long address, int write)
84{
85 unsigned long *table = (unsigned long *)__pa(mm->pgd);
86
87 if (unlikely(address > mm->context.asce_limit - 1))
88 return -0x38UL;
89 switch (mm->context.asce_bits & _ASCE_TYPE_MASK) {
90 case _ASCE_TYPE_REGION1:
91 table = table + ((address >> 53) & 0x7ff);
92 if (unlikely(*table & _REGION_ENTRY_INVALID))
93 return -0x39UL;
94 table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN);
95 /* fallthrough */
96 case _ASCE_TYPE_REGION2:
97 table = table + ((address >> 42) & 0x7ff);
98 if (unlikely(*table & _REGION_ENTRY_INVALID))
99 return -0x3aUL;
100 table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN);
101 /* fallthrough */
102 case _ASCE_TYPE_REGION3:
103 table = table + ((address >> 31) & 0x7ff);
104 if (unlikely(*table & _REGION_ENTRY_INVALID))
105 return -0x3bUL;
106 table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN);
107 /* fallthrough */
108 case _ASCE_TYPE_SEGMENT:
109 table = table + ((address >> 20) & 0x7ff);
110 if (unlikely(*table & _SEGMENT_ENTRY_INVALID))
111 return -0x10UL;
112 if (unlikely(*table & _SEGMENT_ENTRY_LARGE)) {
113 if (write && (*table & _SEGMENT_ENTRY_PROTECT))
114 return -0x04UL;
115 return (*table & _SEGMENT_ENTRY_ORIGIN_LARGE) +
116 (address & ~_SEGMENT_ENTRY_ORIGIN_LARGE);
117 }
118 table = (unsigned long *)(*table & _SEGMENT_ENTRY_ORIGIN);
119 }
120 table = table + ((address >> 12) & 0xff);
121 if (unlikely(*table & _PAGE_INVALID))
122 return -0x11UL;
123 if (write && (*table & _PAGE_PROTECT))
124 return -0x04UL;
125 return (*table & PAGE_MASK) + (address & ~PAGE_MASK);
126}
127
128#else /* CONFIG_64BIT */
129
130static unsigned long follow_table(struct mm_struct *mm,
131 unsigned long address, int write)
132{
133 unsigned long *table = (unsigned long *)__pa(mm->pgd);
134
135 table = table + ((address >> 20) & 0x7ff);
136 if (unlikely(*table & _SEGMENT_ENTRY_INVALID))
137 return -0x10UL;
138 table = (unsigned long *)(*table & _SEGMENT_ENTRY_ORIGIN);
139 table = table + ((address >> 12) & 0xff);
140 if (unlikely(*table & _PAGE_INVALID))
141 return -0x11UL;
142 if (write && (*table & _PAGE_PROTECT))
143 return -0x04UL;
144 return (*table & PAGE_MASK) + (address & ~PAGE_MASK);
145}
146
147#endif /* CONFIG_64BIT */
148
149static inline unsigned long __user_copy_pt(unsigned long uaddr, void *kptr,
150 unsigned long n, int write_user)
151{
152 struct mm_struct *mm = current->mm;
153 unsigned long offset, done, size, kaddr;
154 void *from, *to;
155
156 if (!mm)
157 return n;
158 done = 0;
159retry:
160 spin_lock(&mm->page_table_lock);
161 do {
162 kaddr = follow_table(mm, uaddr, write_user);
163 if (IS_ERR_VALUE(kaddr))
164 goto fault;
165
166 offset = uaddr & ~PAGE_MASK;
167 size = min(n - done, PAGE_SIZE - offset);
168 if (write_user) {
169 to = (void *) kaddr;
170 from = kptr + done;
171 } else {
172 from = (void *) kaddr;
173 to = kptr + done;
174 }
175 memcpy(to, from, size);
176 done += size;
177 uaddr += size;
178 } while (done < n);
179 spin_unlock(&mm->page_table_lock);
180 return n - done;
181fault:
182 spin_unlock(&mm->page_table_lock);
183 if (__handle_fault(uaddr, -kaddr, write_user))
184 return n - done;
185 goto retry;
186}
187
188/*
189 * Do DAT for user address by page table walk, return kernel address.
190 * This function needs to be called with current->mm->page_table_lock held.
191 */
192static inline unsigned long __dat_user_addr(unsigned long uaddr, int write)
193{
194 struct mm_struct *mm = current->mm;
195 unsigned long kaddr;
196 int rc;
197
198retry:
199 kaddr = follow_table(mm, uaddr, write);
200 if (IS_ERR_VALUE(kaddr))
201 goto fault;
202
203 return kaddr;
204fault:
205 spin_unlock(&mm->page_table_lock);
206 rc = __handle_fault(uaddr, -kaddr, write);
207 spin_lock(&mm->page_table_lock);
208 if (!rc)
209 goto retry;
210 return 0;
211}
212
213unsigned long copy_from_user_pt(void *to, const void __user *from, unsigned long n)
214{
215 unsigned long rc;
216
217 if (segment_eq(get_fs(), KERNEL_DS))
218 return copy_in_kernel((void __user *) to, from, n);
219 rc = __user_copy_pt((unsigned long) from, to, n, 0);
220 if (unlikely(rc))
221 memset(to + n - rc, 0, rc);
222 return rc;
223}
224
225unsigned long copy_to_user_pt(void __user *to, const void *from, unsigned long n)
226{
227 if (segment_eq(get_fs(), KERNEL_DS))
228 return copy_in_kernel(to, (void __user *) from, n);
229 return __user_copy_pt((unsigned long) to, (void *) from, n, 1);
230}
231
232unsigned long clear_user_pt(void __user *to, unsigned long n)
233{
234 void *zpage = (void *) empty_zero_page;
235 unsigned long done, size, ret;
236
237 done = 0;
238 do {
239 if (n - done > PAGE_SIZE)
240 size = PAGE_SIZE;
241 else
242 size = n - done;
243 if (segment_eq(get_fs(), KERNEL_DS))
244 ret = copy_in_kernel(to, (void __user *) zpage, n);
245 else
246 ret = __user_copy_pt((unsigned long) to, zpage, size, 1);
247 done += size;
248 to += size;
249 if (ret)
250 return ret + n - done;
251 } while (done < n);
252 return 0;
253}
254
255unsigned long strnlen_user_pt(const char __user *src, unsigned long count)
256{
257 unsigned long uaddr = (unsigned long) src;
258 struct mm_struct *mm = current->mm;
259 unsigned long offset, done, len, kaddr;
260 unsigned long len_str;
261
262 if (unlikely(!count))
263 return 0;
264 if (segment_eq(get_fs(), KERNEL_DS))
265 return strnlen_kernel(src, count);
266 if (!mm)
267 return 0;
268 done = 0;
269retry:
270 spin_lock(&mm->page_table_lock);
271 do {
272 kaddr = follow_table(mm, uaddr, 0);
273 if (IS_ERR_VALUE(kaddr))
274 goto fault;
275
276 offset = uaddr & ~PAGE_MASK;
277 len = min(count - done, PAGE_SIZE - offset);
278 len_str = strnlen((char *) kaddr, len);
279 done += len_str;
280 uaddr += len_str;
281 } while ((len_str == len) && (done < count));
282 spin_unlock(&mm->page_table_lock);
283 return done + 1;
284fault:
285 spin_unlock(&mm->page_table_lock);
286 if (__handle_fault(uaddr, -kaddr, 0))
287 return 0;
288 goto retry;
289}
290
291long strncpy_from_user_pt(char *dst, const char __user *src, long count)
292{
293 unsigned long done, len, offset, len_str;
294
295 if (unlikely(count <= 0))
296 return 0;
297 done = 0;
298 do {
299 offset = (unsigned long)src & ~PAGE_MASK;
300 len = min(count - done, PAGE_SIZE - offset);
301 if (segment_eq(get_fs(), KERNEL_DS)) {
302 if (copy_in_kernel((void __user *) dst, src, len))
303 return -EFAULT;
304 } else {
305 if (__user_copy_pt((unsigned long) src, dst, len, 0))
306 return -EFAULT;
307 }
308 len_str = strnlen(dst, len);
309 done += len_str;
310 src += len_str;
311 dst += len_str;
312 } while ((len_str == len) && (done < count));
313 return done;
314}
315
316unsigned long copy_in_user_pt(void __user *to, const void __user *from,
317 unsigned long n)
318{
319 struct mm_struct *mm = current->mm;
320 unsigned long offset_max, uaddr, done, size, error_code;
321 unsigned long uaddr_from = (unsigned long) from;
322 unsigned long uaddr_to = (unsigned long) to;
323 unsigned long kaddr_to, kaddr_from;
324 int write_user;
325
326 if (segment_eq(get_fs(), KERNEL_DS))
327 return copy_in_kernel(to, from, n);
328 if (!mm)
329 return n;
330 done = 0;
331retry:
332 spin_lock(&mm->page_table_lock);
333 do {
334 write_user = 0;
335 uaddr = uaddr_from;
336 kaddr_from = follow_table(mm, uaddr_from, 0);
337 error_code = kaddr_from;
338 if (IS_ERR_VALUE(error_code))
339 goto fault;
340
341 write_user = 1;
342 uaddr = uaddr_to;
343 kaddr_to = follow_table(mm, uaddr_to, 1);
344 error_code = (unsigned long) kaddr_to;
345 if (IS_ERR_VALUE(error_code))
346 goto fault;
347
348 offset_max = max(uaddr_from & ~PAGE_MASK,
349 uaddr_to & ~PAGE_MASK);
350 size = min(n - done, PAGE_SIZE - offset_max);
351
352 memcpy((void *) kaddr_to, (void *) kaddr_from, size);
353 done += size;
354 uaddr_from += size;
355 uaddr_to += size;
356 } while (done < n);
357 spin_unlock(&mm->page_table_lock);
358 return n - done;
359fault:
360 spin_unlock(&mm->page_table_lock);
361 if (__handle_fault(uaddr, -error_code, write_user))
362 return n - done;
363 goto retry;
364}
365
366#define __futex_atomic_op(insn, ret, oldval, newval, uaddr, oparg) \
367 asm volatile("0: l %1,0(%6)\n" \
368 "1: " insn \
369 "2: cs %1,%2,0(%6)\n" \
370 "3: jl 1b\n" \
371 " lhi %0,0\n" \
372 "4:\n" \
373 EX_TABLE(0b,4b) EX_TABLE(2b,4b) EX_TABLE(3b,4b) \
374 : "=d" (ret), "=&d" (oldval), "=&d" (newval), \
375 "=m" (*uaddr) \
376 : "0" (-EFAULT), "d" (oparg), "a" (uaddr), \
377 "m" (*uaddr) : "cc" );
378
379static int __futex_atomic_op_pt(int op, u32 __user *uaddr, int oparg, int *old)
380{
381 int oldval = 0, newval, ret;
382
383 switch (op) {
384 case FUTEX_OP_SET:
385 __futex_atomic_op("lr %2,%5\n",
386 ret, oldval, newval, uaddr, oparg);
387 break;
388 case FUTEX_OP_ADD:
389 __futex_atomic_op("lr %2,%1\nar %2,%5\n",
390 ret, oldval, newval, uaddr, oparg);
391 break;
392 case FUTEX_OP_OR:
393 __futex_atomic_op("lr %2,%1\nor %2,%5\n",
394 ret, oldval, newval, uaddr, oparg);
395 break;
396 case FUTEX_OP_ANDN:
397 __futex_atomic_op("lr %2,%1\nnr %2,%5\n",
398 ret, oldval, newval, uaddr, oparg);
399 break;
400 case FUTEX_OP_XOR:
401 __futex_atomic_op("lr %2,%1\nxr %2,%5\n",
402 ret, oldval, newval, uaddr, oparg);
403 break;
404 default:
405 ret = -ENOSYS;
406 }
407 if (ret == 0)
408 *old = oldval;
409 return ret;
410}
411
412int __futex_atomic_op_inuser(int op, u32 __user *uaddr, int oparg, int *old)
413{
414 int ret;
415
416 if (segment_eq(get_fs(), KERNEL_DS))
417 return __futex_atomic_op_pt(op, uaddr, oparg, old);
418 if (unlikely(!current->mm))
419 return -EFAULT;
420 spin_lock(&current->mm->page_table_lock);
421 uaddr = (u32 __force __user *)
422 __dat_user_addr((__force unsigned long) uaddr, 1);
423 if (!uaddr) {
424 spin_unlock(&current->mm->page_table_lock);
425 return -EFAULT;
426 }
427 get_page(virt_to_page(uaddr));
428 spin_unlock(&current->mm->page_table_lock);
429 ret = __futex_atomic_op_pt(op, uaddr, oparg, old);
430 put_page(virt_to_page(uaddr));
431 return ret;
432}
433
434static int __futex_atomic_cmpxchg_pt(u32 *uval, u32 __user *uaddr,
435 u32 oldval, u32 newval)
436{
437 int ret;
438
439 asm volatile("0: cs %1,%4,0(%5)\n"
440 "1: la %0,0\n"
441 "2:\n"
442 EX_TABLE(0b,2b) EX_TABLE(1b,2b)
443 : "=d" (ret), "+d" (oldval), "=m" (*uaddr)
444 : "0" (-EFAULT), "d" (newval), "a" (uaddr), "m" (*uaddr)
445 : "cc", "memory" );
446 *uval = oldval;
447 return ret;
448}
449
450int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
451 u32 oldval, u32 newval)
452{
453 int ret;
454
455 if (segment_eq(get_fs(), KERNEL_DS))
456 return __futex_atomic_cmpxchg_pt(uval, uaddr, oldval, newval);
457 if (unlikely(!current->mm))
458 return -EFAULT;
459 spin_lock(&current->mm->page_table_lock);
460 uaddr = (u32 __force __user *)
461 __dat_user_addr((__force unsigned long) uaddr, 1);
462 if (!uaddr) {
463 spin_unlock(&current->mm->page_table_lock);
464 return -EFAULT;
465 }
466 get_page(virt_to_page(uaddr));
467 spin_unlock(&current->mm->page_table_lock);
468 ret = __futex_atomic_cmpxchg_pt(uval, uaddr, oldval, newval);
469 put_page(virt_to_page(uaddr));
470 return ret;
471}
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index d95265b2719f..19f623f1f21c 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -50,6 +50,7 @@
50#define VM_FAULT_BADMAP 0x020000 50#define VM_FAULT_BADMAP 0x020000
51#define VM_FAULT_BADACCESS 0x040000 51#define VM_FAULT_BADACCESS 0x040000
52#define VM_FAULT_SIGNAL 0x080000 52#define VM_FAULT_SIGNAL 0x080000
53#define VM_FAULT_PFAULT 0x100000
53 54
54static unsigned long store_indication __read_mostly; 55static unsigned long store_indication __read_mostly;
55 56
@@ -105,21 +106,24 @@ void bust_spinlocks(int yes)
105 * Returns the address space associated with the fault. 106 * Returns the address space associated with the fault.
106 * Returns 0 for kernel space and 1 for user space. 107 * Returns 0 for kernel space and 1 for user space.
107 */ 108 */
108static inline int user_space_fault(unsigned long trans_exc_code) 109static inline int user_space_fault(struct pt_regs *regs)
109{ 110{
111 unsigned long trans_exc_code;
112
110 /* 113 /*
111 * The lowest two bits of the translation exception 114 * The lowest two bits of the translation exception
112 * identification indicate which paging table was used. 115 * identification indicate which paging table was used.
113 */ 116 */
114 trans_exc_code &= 3; 117 trans_exc_code = regs->int_parm_long & 3;
115 if (trans_exc_code == 2) 118 if (trans_exc_code == 3) /* home space -> kernel */
116 /* Access via secondary space, set_fs setting decides */ 119 return 0;
120 if (user_mode(regs))
121 return 1;
122 if (trans_exc_code == 2) /* secondary space -> set_fs */
117 return current->thread.mm_segment.ar4; 123 return current->thread.mm_segment.ar4;
118 /* 124 if (current->flags & PF_VCPU)
119 * Access via primary space or access register is from user space 125 return 1;
120 * and access via home space is from the kernel. 126 return 0;
121 */
122 return trans_exc_code != 3;
123} 127}
124 128
125static inline void report_user_fault(struct pt_regs *regs, long signr) 129static inline void report_user_fault(struct pt_regs *regs, long signr)
@@ -171,7 +175,7 @@ static noinline void do_no_context(struct pt_regs *regs)
171 * terminate things with extreme prejudice. 175 * terminate things with extreme prejudice.
172 */ 176 */
173 address = regs->int_parm_long & __FAIL_ADDR_MASK; 177 address = regs->int_parm_long & __FAIL_ADDR_MASK;
174 if (!user_space_fault(regs->int_parm_long)) 178 if (!user_space_fault(regs))
175 printk(KERN_ALERT "Unable to handle kernel pointer dereference" 179 printk(KERN_ALERT "Unable to handle kernel pointer dereference"
176 " at virtual kernel address %p\n", (void *)address); 180 " at virtual kernel address %p\n", (void *)address);
177 else 181 else
@@ -227,6 +231,7 @@ static noinline void do_fault_error(struct pt_regs *regs, int fault)
227 return; 231 return;
228 } 232 }
229 case VM_FAULT_BADCONTEXT: 233 case VM_FAULT_BADCONTEXT:
234 case VM_FAULT_PFAULT:
230 do_no_context(regs); 235 do_no_context(regs);
231 break; 236 break;
232 case VM_FAULT_SIGNAL: 237 case VM_FAULT_SIGNAL:
@@ -264,6 +269,9 @@ static noinline void do_fault_error(struct pt_regs *regs, int fault)
264 */ 269 */
265static inline int do_exception(struct pt_regs *regs, int access) 270static inline int do_exception(struct pt_regs *regs, int access)
266{ 271{
272#ifdef CONFIG_PGSTE
273 struct gmap *gmap;
274#endif
267 struct task_struct *tsk; 275 struct task_struct *tsk;
268 struct mm_struct *mm; 276 struct mm_struct *mm;
269 struct vm_area_struct *vma; 277 struct vm_area_struct *vma;
@@ -291,7 +299,7 @@ static inline int do_exception(struct pt_regs *regs, int access)
291 * user context. 299 * user context.
292 */ 300 */
293 fault = VM_FAULT_BADCONTEXT; 301 fault = VM_FAULT_BADCONTEXT;
294 if (unlikely(!user_space_fault(trans_exc_code) || in_atomic() || !mm)) 302 if (unlikely(!user_space_fault(regs) || in_atomic() || !mm))
295 goto out; 303 goto out;
296 304
297 address = trans_exc_code & __FAIL_ADDR_MASK; 305 address = trans_exc_code & __FAIL_ADDR_MASK;
@@ -304,9 +312,10 @@ static inline int do_exception(struct pt_regs *regs, int access)
304 down_read(&mm->mmap_sem); 312 down_read(&mm->mmap_sem);
305 313
306#ifdef CONFIG_PGSTE 314#ifdef CONFIG_PGSTE
307 if ((current->flags & PF_VCPU) && S390_lowcore.gmap) { 315 gmap = (struct gmap *)
308 address = __gmap_fault(address, 316 ((current->flags & PF_VCPU) ? S390_lowcore.gmap : 0);
309 (struct gmap *) S390_lowcore.gmap); 317 if (gmap) {
318 address = __gmap_fault(address, gmap);
310 if (address == -EFAULT) { 319 if (address == -EFAULT) {
311 fault = VM_FAULT_BADMAP; 320 fault = VM_FAULT_BADMAP;
312 goto out_up; 321 goto out_up;
@@ -315,6 +324,8 @@ static inline int do_exception(struct pt_regs *regs, int access)
315 fault = VM_FAULT_OOM; 324 fault = VM_FAULT_OOM;
316 goto out_up; 325 goto out_up;
317 } 326 }
327 if (gmap->pfault_enabled)
328 flags |= FAULT_FLAG_RETRY_NOWAIT;
318 } 329 }
319#endif 330#endif
320 331
@@ -371,9 +382,19 @@ retry:
371 regs, address); 382 regs, address);
372 } 383 }
373 if (fault & VM_FAULT_RETRY) { 384 if (fault & VM_FAULT_RETRY) {
385#ifdef CONFIG_PGSTE
386 if (gmap && (flags & FAULT_FLAG_RETRY_NOWAIT)) {
387 /* FAULT_FLAG_RETRY_NOWAIT has been set,
388 * mmap_sem has not been released */
389 current->thread.gmap_pfault = 1;
390 fault = VM_FAULT_PFAULT;
391 goto out_up;
392 }
393#endif
374 /* Clear FAULT_FLAG_ALLOW_RETRY to avoid any risk 394 /* Clear FAULT_FLAG_ALLOW_RETRY to avoid any risk
375 * of starvation. */ 395 * of starvation. */
376 flags &= ~FAULT_FLAG_ALLOW_RETRY; 396 flags &= ~(FAULT_FLAG_ALLOW_RETRY |
397 FAULT_FLAG_RETRY_NOWAIT);
377 flags |= FAULT_FLAG_TRIED; 398 flags |= FAULT_FLAG_TRIED;
378 down_read(&mm->mmap_sem); 399 down_read(&mm->mmap_sem);
379 goto retry; 400 goto retry;
@@ -423,30 +444,6 @@ void __kprobes do_dat_exception(struct pt_regs *regs)
423 do_fault_error(regs, fault); 444 do_fault_error(regs, fault);
424} 445}
425 446
426int __handle_fault(unsigned long uaddr, unsigned long pgm_int_code, int write)
427{
428 struct pt_regs regs;
429 int access, fault;
430
431 /* Emulate a uaccess fault from kernel mode. */
432 regs.psw.mask = PSW_KERNEL_BITS | PSW_MASK_DAT | PSW_MASK_MCHECK;
433 if (!irqs_disabled())
434 regs.psw.mask |= PSW_MASK_IO | PSW_MASK_EXT;
435 regs.psw.addr = (unsigned long) __builtin_return_address(0);
436 regs.psw.addr |= PSW_ADDR_AMODE;
437 regs.int_code = pgm_int_code;
438 regs.int_parm_long = (uaddr & PAGE_MASK) | 2;
439 access = write ? VM_WRITE : VM_READ;
440 fault = do_exception(&regs, access);
441 /*
442 * Since the fault happened in kernel mode while performing a uaccess
443 * all we need to do now is emulating a fixup in case "fault" is not
444 * zero.
445 * For the calling uaccess functions this results always in -EFAULT.
446 */
447 return fault ? -EFAULT : 0;
448}
449
450#ifdef CONFIG_PFAULT 447#ifdef CONFIG_PFAULT
451/* 448/*
452 * 'pfault' pseudo page faults routines. 449 * 'pfault' pseudo page faults routines.
@@ -627,7 +624,7 @@ static int __init pfault_irq_init(void)
627{ 624{
628 int rc; 625 int rc;
629 626
630 rc = register_external_interrupt(0x2603, pfault_interrupt); 627 rc = register_external_irq(EXT_IRQ_CP_SERVICE, pfault_interrupt);
631 if (rc) 628 if (rc)
632 goto out_extint; 629 goto out_extint;
633 rc = pfault_init() == 0 ? 0 : -EOPNOTSUPP; 630 rc = pfault_init() == 0 ? 0 : -EOPNOTSUPP;
@@ -638,7 +635,7 @@ static int __init pfault_irq_init(void)
638 return 0; 635 return 0;
639 636
640out_pfault: 637out_pfault:
641 unregister_external_interrupt(0x2603, pfault_interrupt); 638 unregister_external_irq(EXT_IRQ_CP_SERVICE, pfault_interrupt);
642out_extint: 639out_extint:
643 pfault_disable = 1; 640 pfault_disable = 1;
644 return rc; 641 return rc;
diff --git a/arch/s390/mm/hugetlbpage.c b/arch/s390/mm/hugetlbpage.c
index d261c62e40a6..0727a55d87d9 100644
--- a/arch/s390/mm/hugetlbpage.c
+++ b/arch/s390/mm/hugetlbpage.c
@@ -123,10 +123,7 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
123 pmd_t *pmdp = (pmd_t *) ptep; 123 pmd_t *pmdp = (pmd_t *) ptep;
124 pte_t pte = huge_ptep_get(ptep); 124 pte_t pte = huge_ptep_get(ptep);
125 125
126 if (MACHINE_HAS_IDTE) 126 pmdp_flush_direct(mm, addr, pmdp);
127 __pmd_idte(addr, pmdp);
128 else
129 __pmd_csp(pmdp);
130 pmd_val(*pmdp) = _SEGMENT_ENTRY_EMPTY; 127 pmd_val(*pmdp) = _SEGMENT_ENTRY_EMPTY;
131 return pte; 128 return pte;
132} 129}
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index ad446b0c55b6..0c1073ed1e84 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -124,8 +124,6 @@ void __init paging_init(void)
124 __ctl_load(S390_lowcore.kernel_asce, 13, 13); 124 __ctl_load(S390_lowcore.kernel_asce, 13, 13);
125 arch_local_irq_restore(4UL << (BITS_PER_LONG - 8)); 125 arch_local_irq_restore(4UL << (BITS_PER_LONG - 8));
126 126
127 atomic_set(&init_mm.context.attach_count, 1);
128
129 sparse_memory_present_with_active_regions(MAX_NUMNODES); 127 sparse_memory_present_with_active_regions(MAX_NUMNODES);
130 sparse_init(); 128 sparse_init();
131 memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); 129 memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
@@ -136,6 +134,11 @@ void __init paging_init(void)
136 134
137void __init mem_init(void) 135void __init mem_init(void)
138{ 136{
137 if (MACHINE_HAS_TLB_LC)
138 cpumask_set_cpu(0, &init_mm.context.cpu_attach_mask);
139 cpumask_set_cpu(0, mm_cpumask(&init_mm));
140 atomic_set(&init_mm.context.attach_count, 1);
141
139 max_mapnr = max_low_pfn; 142 max_mapnr = max_low_pfn;
140 high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); 143 high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);
141 144
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index 796c9320c709..d7cfd57815fb 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -54,7 +54,7 @@ static void __crst_table_upgrade(void *arg)
54 struct mm_struct *mm = arg; 54 struct mm_struct *mm = arg;
55 55
56 if (current->active_mm == mm) 56 if (current->active_mm == mm)
57 update_mm(mm, current); 57 update_user_asce(mm, 1);
58 __tlb_flush_local(); 58 __tlb_flush_local();
59} 59}
60 60
@@ -107,8 +107,10 @@ void crst_table_downgrade(struct mm_struct *mm, unsigned long limit)
107{ 107{
108 pgd_t *pgd; 108 pgd_t *pgd;
109 109
110 if (current->active_mm == mm) 110 if (current->active_mm == mm) {
111 clear_user_asce(mm, 1);
111 __tlb_flush_mm(mm); 112 __tlb_flush_mm(mm);
113 }
112 while (mm->context.asce_limit > limit) { 114 while (mm->context.asce_limit > limit) {
113 pgd = mm->pgd; 115 pgd = mm->pgd;
114 switch (pgd_val(*pgd) & _REGION_ENTRY_TYPE_MASK) { 116 switch (pgd_val(*pgd) & _REGION_ENTRY_TYPE_MASK) {
@@ -132,7 +134,7 @@ void crst_table_downgrade(struct mm_struct *mm, unsigned long limit)
132 crst_table_free(mm, (unsigned long *) pgd); 134 crst_table_free(mm, (unsigned long *) pgd);
133 } 135 }
134 if (current->active_mm == mm) 136 if (current->active_mm == mm)
135 update_mm(mm, current); 137 update_user_asce(mm, 1);
136} 138}
137#endif 139#endif
138 140
@@ -198,7 +200,7 @@ static int gmap_unlink_segment(struct gmap *gmap, unsigned long *table)
198static void gmap_flush_tlb(struct gmap *gmap) 200static void gmap_flush_tlb(struct gmap *gmap)
199{ 201{
200 if (MACHINE_HAS_IDTE) 202 if (MACHINE_HAS_IDTE)
201 __tlb_flush_idte((unsigned long) gmap->table | 203 __tlb_flush_asce(gmap->mm, (unsigned long) gmap->table |
202 _ASCE_TYPE_REGION1); 204 _ASCE_TYPE_REGION1);
203 else 205 else
204 __tlb_flush_global(); 206 __tlb_flush_global();
@@ -217,7 +219,7 @@ void gmap_free(struct gmap *gmap)
217 219
218 /* Flush tlb. */ 220 /* Flush tlb. */
219 if (MACHINE_HAS_IDTE) 221 if (MACHINE_HAS_IDTE)
220 __tlb_flush_idte((unsigned long) gmap->table | 222 __tlb_flush_asce(gmap->mm, (unsigned long) gmap->table |
221 _ASCE_TYPE_REGION1); 223 _ASCE_TYPE_REGION1);
222 else 224 else
223 __tlb_flush_global(); 225 __tlb_flush_global();
@@ -505,6 +507,9 @@ static int gmap_connect_pgtable(unsigned long address, unsigned long segment,
505 if (!pmd_present(*pmd) && 507 if (!pmd_present(*pmd) &&
506 __pte_alloc(mm, vma, pmd, vmaddr)) 508 __pte_alloc(mm, vma, pmd, vmaddr))
507 return -ENOMEM; 509 return -ENOMEM;
510 /* large pmds cannot yet be handled */
511 if (pmd_large(*pmd))
512 return -EFAULT;
508 /* pmd now points to a valid segment table entry. */ 513 /* pmd now points to a valid segment table entry. */
509 rmap = kmalloc(sizeof(*rmap), GFP_KERNEL|__GFP_REPEAT); 514 rmap = kmalloc(sizeof(*rmap), GFP_KERNEL|__GFP_REPEAT);
510 if (!rmap) 515 if (!rmap)
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c
index bcfb70b60be6..72b04de18283 100644
--- a/arch/s390/mm/vmem.c
+++ b/arch/s390/mm/vmem.c
@@ -138,7 +138,6 @@ static int vmem_add_mem(unsigned long start, unsigned long size, int ro)
138 } 138 }
139 ret = 0; 139 ret = 0;
140out: 140out:
141 flush_tlb_kernel_range(start, end);
142 return ret; 141 return ret;
143} 142}
144 143
@@ -265,7 +264,6 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node)
265 memset((void *)start, 0, end - start); 264 memset((void *)start, 0, end - start);
266 ret = 0; 265 ret = 0;
267out: 266out:
268 flush_tlb_kernel_range(start, end);
269 return ret; 267 return ret;
270} 268}
271 269
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
index 708d60e40066..9c36dc398f90 100644
--- a/arch/s390/net/bpf_jit_comp.c
+++ b/arch/s390/net/bpf_jit_comp.c
@@ -737,10 +737,10 @@ call_fn: /* lg %r1,<d(function)>(%r13) */
737 /* icm %r5,3,<d(type)>(%r1) */ 737 /* icm %r5,3,<d(type)>(%r1) */
738 EMIT4_DISP(0xbf531000, offsetof(struct net_device, type)); 738 EMIT4_DISP(0xbf531000, offsetof(struct net_device, type));
739 break; 739 break;
740 case BPF_S_ANC_RXHASH: /* A = skb->rxhash */ 740 case BPF_S_ANC_RXHASH: /* A = skb->hash */
741 BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, rxhash) != 4); 741 BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, hash) != 4);
742 /* l %r5,<d(rxhash)>(%r2) */ 742 /* l %r5,<d(hash)>(%r2) */
743 EMIT4_DISP(0x58502000, offsetof(struct sk_buff, rxhash)); 743 EMIT4_DISP(0x58502000, offsetof(struct sk_buff, hash));
744 break; 744 break;
745 case BPF_S_ANC_VLAN_TAG: 745 case BPF_S_ANC_VLAN_TAG:
746 case BPF_S_ANC_VLAN_TAG_PRESENT: 746 case BPF_S_ANC_VLAN_TAG_PRESENT:
@@ -877,6 +877,7 @@ void bpf_jit_compile(struct sk_filter *fp)
877 if (jit.start) { 877 if (jit.start) {
878 set_memory_ro((unsigned long)header, header->pages); 878 set_memory_ro((unsigned long)header, header->pages);
879 fp->bpf_func = (void *) jit.start; 879 fp->bpf_func = (void *) jit.start;
880 fp->jited = 1;
880 } 881 }
881out: 882out:
882 kfree(addrs); 883 kfree(addrs);
@@ -887,10 +888,12 @@ void bpf_jit_free(struct sk_filter *fp)
887 unsigned long addr = (unsigned long)fp->bpf_func & PAGE_MASK; 888 unsigned long addr = (unsigned long)fp->bpf_func & PAGE_MASK;
888 struct bpf_binary_header *header = (void *)addr; 889 struct bpf_binary_header *header = (void *)addr;
889 890
890 if (fp->bpf_func == sk_run_filter) 891 if (!fp->jited)
891 goto free_filter; 892 goto free_filter;
893
892 set_memory_rw(addr, header->pages); 894 set_memory_rw(addr, header->pages);
893 module_free(NULL, header); 895 module_free(NULL, header);
896
894free_filter: 897free_filter:
895 kfree(fp); 898 kfree(fp);
896} 899}
diff --git a/arch/s390/oprofile/hwsampler.c b/arch/s390/oprofile/hwsampler.c
index a32c96761eab..276f2e26c761 100644
--- a/arch/s390/oprofile/hwsampler.c
+++ b/arch/s390/oprofile/hwsampler.c
@@ -1033,7 +1033,7 @@ int hwsampler_setup(void)
1033 max_sampler_rate = cb->qsi.max_sampl_rate; 1033 max_sampler_rate = cb->qsi.max_sampl_rate;
1034 } 1034 }
1035 } 1035 }
1036 register_external_interrupt(0x1407, hws_ext_handler); 1036 register_external_irq(EXT_IRQ_MEASURE_ALERT, hws_ext_handler);
1037 1037
1038 hws_state = HWS_DEALLOCATED; 1038 hws_state = HWS_DEALLOCATED;
1039 rc = 0; 1039 rc = 0;
@@ -1068,7 +1068,7 @@ int hwsampler_shutdown(void)
1068 hws_wq = NULL; 1068 hws_wq = NULL;
1069 } 1069 }
1070 1070
1071 unregister_external_interrupt(0x1407, hws_ext_handler); 1071 unregister_external_irq(EXT_IRQ_MEASURE_ALERT, hws_ext_handler);
1072 hws_state = HWS_INIT; 1072 hws_state = HWS_INIT;
1073 rc = 0; 1073 rc = 0;
1074 } 1074 }
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index 66670ff262a0..1df1d29ac81d 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -686,27 +686,13 @@ int pcibios_add_device(struct pci_dev *pdev)
686int pcibios_enable_device(struct pci_dev *pdev, int mask) 686int pcibios_enable_device(struct pci_dev *pdev, int mask)
687{ 687{
688 struct zpci_dev *zdev = get_zdev(pdev); 688 struct zpci_dev *zdev = get_zdev(pdev);
689 struct resource *res;
690 u16 cmd;
691 int i;
692 689
693 zdev->pdev = pdev; 690 zdev->pdev = pdev;
694 zpci_debug_init_device(zdev); 691 zpci_debug_init_device(zdev);
695 zpci_fmb_enable_device(zdev); 692 zpci_fmb_enable_device(zdev);
696 zpci_map_resources(zdev); 693 zpci_map_resources(zdev);
697 694
698 pci_read_config_word(pdev, PCI_COMMAND, &cmd); 695 return pci_enable_resources(pdev, mask);
699 for (i = 0; i < PCI_BAR_COUNT; i++) {
700 res = &pdev->resource[i];
701
702 if (res->flags & IORESOURCE_IO)
703 return -EINVAL;
704
705 if (res->flags & IORESOURCE_MEM)
706 cmd |= PCI_COMMAND_MEMORY;
707 }
708 pci_write_config_word(pdev, PCI_COMMAND, cmd);
709 return 0;
710} 696}
711 697
712void pcibios_disable_device(struct pci_dev *pdev) 698void pcibios_disable_device(struct pci_dev *pdev)
diff --git a/arch/s390/pci/pci_sysfs.c b/arch/s390/pci/pci_sysfs.c
index cf8a12ff733b..ab4a91393005 100644
--- a/arch/s390/pci/pci_sysfs.c
+++ b/arch/s390/pci/pci_sysfs.c
@@ -48,29 +48,27 @@ static ssize_t show_pfgid(struct device *dev, struct device_attribute *attr,
48} 48}
49static DEVICE_ATTR(pfgid, S_IRUGO, show_pfgid, NULL); 49static DEVICE_ATTR(pfgid, S_IRUGO, show_pfgid, NULL);
50 50
51static void recover_callback(struct device *dev) 51static ssize_t store_recover(struct device *dev, struct device_attribute *attr,
52 const char *buf, size_t count)
52{ 53{
53 struct pci_dev *pdev = to_pci_dev(dev); 54 struct pci_dev *pdev = to_pci_dev(dev);
54 struct zpci_dev *zdev = get_zdev(pdev); 55 struct zpci_dev *zdev = get_zdev(pdev);
55 int ret; 56 int ret;
56 57
58 if (!device_remove_file_self(dev, attr))
59 return count;
60
57 pci_stop_and_remove_bus_device(pdev); 61 pci_stop_and_remove_bus_device(pdev);
58 ret = zpci_disable_device(zdev); 62 ret = zpci_disable_device(zdev);
59 if (ret) 63 if (ret)
60 return; 64 return ret;
61 65
62 ret = zpci_enable_device(zdev); 66 ret = zpci_enable_device(zdev);
63 if (ret) 67 if (ret)
64 return; 68 return ret;
65 69
66 pci_rescan_bus(zdev->bus); 70 pci_rescan_bus(zdev->bus);
67} 71 return count;
68
69static ssize_t store_recover(struct device *dev, struct device_attribute *attr,
70 const char *buf, size_t count)
71{
72 int rc = device_schedule_callback(dev, recover_callback);
73 return rc ? rc : count;
74} 72}
75static DEVICE_ATTR(recover, S_IWUSR, NULL, store_recover); 73static DEVICE_ATTR(recover, S_IWUSR, NULL, store_recover);
76 74
diff --git a/arch/score/Kconfig b/arch/score/Kconfig
index c75d06aa27c3..4ac8cae5727c 100644
--- a/arch/score/Kconfig
+++ b/arch/score/Kconfig
@@ -22,27 +22,21 @@ choice
22config ARCH_SCORE7 22config ARCH_SCORE7
23 bool "SCORE7 processor" 23 bool "SCORE7 processor"
24 select SYS_SUPPORTS_32BIT_KERNEL 24 select SYS_SUPPORTS_32BIT_KERNEL
25 select CPU_SCORE7
26 select GENERIC_HAS_IOMAP 25 select GENERIC_HAS_IOMAP
27 26
28config MACH_SPCT6600 27config MACH_SPCT6600
29 bool "SPCT6600 series based machines" 28 bool "SPCT6600 series based machines"
30 select SYS_SUPPORTS_32BIT_KERNEL 29 select SYS_SUPPORTS_32BIT_KERNEL
31 select CPU_SCORE7
32 select GENERIC_HAS_IOMAP 30 select GENERIC_HAS_IOMAP
33 31
34config SCORE_SIM 32config SCORE_SIM
35 bool "Score simulator" 33 bool "Score simulator"
36 select SYS_SUPPORTS_32BIT_KERNEL 34 select SYS_SUPPORTS_32BIT_KERNEL
37 select CPU_SCORE7
38 select GENERIC_HAS_IOMAP 35 select GENERIC_HAS_IOMAP
39endchoice 36endchoice
40 37
41endmenu 38endmenu
42 39
43config CPU_SCORE7
44 bool
45
46config NO_DMA 40config NO_DMA
47 bool 41 bool
48 default y 42 default y
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 364d204298fa..834b67c4db5a 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -3,7 +3,7 @@ config SUPERH
3 select ARCH_MIGHT_HAVE_PC_PARPORT 3 select ARCH_MIGHT_HAVE_PC_PARPORT
4 select EXPERT 4 select EXPERT
5 select CLKDEV_LOOKUP 5 select CLKDEV_LOOKUP
6 select HAVE_IDE if HAS_IOPORT 6 select HAVE_IDE if HAS_IOPORT_MAP
7 select HAVE_MEMBLOCK 7 select HAVE_MEMBLOCK
8 select HAVE_MEMBLOCK_NODE_MAP 8 select HAVE_MEMBLOCK_NODE_MAP
9 select ARCH_DISCARD_MEMBLOCK 9 select ARCH_DISCARD_MEMBLOCK
@@ -42,6 +42,7 @@ config SUPERH
42 select MODULES_USE_ELF_RELA 42 select MODULES_USE_ELF_RELA
43 select OLD_SIGSUSPEND 43 select OLD_SIGSUSPEND
44 select OLD_SIGACTION 44 select OLD_SIGACTION
45 select HAVE_ARCH_AUDITSYSCALL
45 help 46 help
46 The SuperH is a RISC processor targeted for use in embedded systems 47 The SuperH is a RISC processor targeted for use in embedded systems
47 and consumer electronics; it was also used in the Sega Dreamcast 48 and consumer electronics; it was also used in the Sega Dreamcast
@@ -138,7 +139,7 @@ config ARCH_HAS_ILOG2_U32
138config ARCH_HAS_ILOG2_U64 139config ARCH_HAS_ILOG2_U64
139 def_bool n 140 def_bool n
140 141
141config NO_IOPORT 142config NO_IOPORT_MAP
142 def_bool !PCI 143 def_bool !PCI
143 depends on !SH_CAYMAN && !SH_SH4202_MICRODEV && !SH_SHMIN && \ 144 depends on !SH_CAYMAN && !SH_SH4202_MICRODEV && !SH_SHMIN && \
144 !SH_HP6XX && !SH_SOLUTION_ENGINE 145 !SH_HP6XX && !SH_SOLUTION_ENGINE
@@ -347,7 +348,6 @@ config CPU_SUBTYPE_SH7720
347 select CPU_HAS_DSP 348 select CPU_HAS_DSP
348 select SYS_SUPPORTS_SH_CMT 349 select SYS_SUPPORTS_SH_CMT
349 select ARCH_WANT_OPTIONAL_GPIOLIB 350 select ARCH_WANT_OPTIONAL_GPIOLIB
350 select USB_ARCH_HAS_OHCI
351 select USB_OHCI_SH if USB_OHCI_HCD 351 select USB_OHCI_SH if USB_OHCI_HCD
352 select PINCTRL 352 select PINCTRL
353 help 353 help
@@ -358,7 +358,6 @@ config CPU_SUBTYPE_SH7721
358 select CPU_SH3 358 select CPU_SH3
359 select CPU_HAS_DSP 359 select CPU_HAS_DSP
360 select SYS_SUPPORTS_SH_CMT 360 select SYS_SUPPORTS_SH_CMT
361 select USB_ARCH_HAS_OHCI
362 select USB_OHCI_SH if USB_OHCI_HCD 361 select USB_OHCI_SH if USB_OHCI_HCD
363 help 362 help
364 Select SH7721 if you have a SH3-DSP SH7721 CPU. 363 Select SH7721 if you have a SH3-DSP SH7721 CPU.
@@ -436,8 +435,6 @@ config CPU_SUBTYPE_SH7734
436 select CPU_SH4A 435 select CPU_SH4A
437 select CPU_SHX2 436 select CPU_SHX2
438 select ARCH_WANT_OPTIONAL_GPIOLIB 437 select ARCH_WANT_OPTIONAL_GPIOLIB
439 select USB_ARCH_HAS_OHCI
440 select USB_ARCH_HAS_EHCI
441 select PINCTRL 438 select PINCTRL
442 help 439 help
443 Select SH7734 if you have a SH4A SH7734 CPU. 440 Select SH7734 if you have a SH4A SH7734 CPU.
@@ -447,8 +444,6 @@ config CPU_SUBTYPE_SH7757
447 select CPU_SH4A 444 select CPU_SH4A
448 select CPU_SHX2 445 select CPU_SHX2
449 select ARCH_WANT_OPTIONAL_GPIOLIB 446 select ARCH_WANT_OPTIONAL_GPIOLIB
450 select USB_ARCH_HAS_OHCI
451 select USB_ARCH_HAS_EHCI
452 select PINCTRL 447 select PINCTRL
453 help 448 help
454 Select SH7757 if you have a SH4A SH7757 CPU. 449 Select SH7757 if you have a SH4A SH7757 CPU.
@@ -456,7 +451,6 @@ config CPU_SUBTYPE_SH7757
456config CPU_SUBTYPE_SH7763 451config CPU_SUBTYPE_SH7763
457 bool "Support SH7763 processor" 452 bool "Support SH7763 processor"
458 select CPU_SH4A 453 select CPU_SH4A
459 select USB_ARCH_HAS_OHCI
460 select USB_OHCI_SH if USB_OHCI_HCD 454 select USB_OHCI_SH if USB_OHCI_HCD
461 help 455 help
462 Select SH7763 if you have a SH4A SH7763(R5S77631) CPU. 456 Select SH7763 if you have a SH4A SH7763(R5S77631) CPU.
@@ -485,9 +479,7 @@ config CPU_SUBTYPE_SH7786
485 select CPU_HAS_PTEAEX 479 select CPU_HAS_PTEAEX
486 select GENERIC_CLOCKEVENTS_BROADCAST if SMP 480 select GENERIC_CLOCKEVENTS_BROADCAST if SMP
487 select ARCH_WANT_OPTIONAL_GPIOLIB 481 select ARCH_WANT_OPTIONAL_GPIOLIB
488 select USB_ARCH_HAS_OHCI
489 select USB_OHCI_SH if USB_OHCI_HCD 482 select USB_OHCI_SH if USB_OHCI_HCD
490 select USB_ARCH_HAS_EHCI
491 select USB_EHCI_SH if USB_EHCI_HCD 483 select USB_EHCI_SH if USB_EHCI_HCD
492 select PINCTRL 484 select PINCTRL
493 485
diff --git a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig
index eb1cf84231a2..e331e5373b8e 100644
--- a/arch/sh/boards/Kconfig
+++ b/arch/sh/boards/Kconfig
@@ -158,7 +158,7 @@ config SH_SDK7786
158 bool "SDK7786" 158 bool "SDK7786"
159 depends on CPU_SUBTYPE_SH7786 159 depends on CPU_SUBTYPE_SH7786
160 select SYS_SUPPORTS_PCI 160 select SYS_SUPPORTS_PCI
161 select NO_IOPORT if !PCI 161 select NO_IOPORT_MAP if !PCI
162 select ARCH_WANT_OPTIONAL_GPIOLIB 162 select ARCH_WANT_OPTIONAL_GPIOLIB
163 select HAVE_SRAM_POOL 163 select HAVE_SRAM_POOL
164 select REGULATOR_FIXED_VOLTAGE if REGULATOR 164 select REGULATOR_FIXED_VOLTAGE if REGULATOR
@@ -204,7 +204,7 @@ config SH_URQUELL
204 depends on CPU_SUBTYPE_SH7786 204 depends on CPU_SUBTYPE_SH7786
205 select ARCH_REQUIRE_GPIOLIB 205 select ARCH_REQUIRE_GPIOLIB
206 select SYS_SUPPORTS_PCI 206 select SYS_SUPPORTS_PCI
207 select NO_IOPORT if !PCI 207 select NO_IOPORT_MAP if !PCI
208 208
209config SH_MIGOR 209config SH_MIGOR
210 bool "Migo-R" 210 bool "Migo-R"
@@ -306,7 +306,7 @@ config SH_LBOX_RE2
306config SH_X3PROTO 306config SH_X3PROTO
307 bool "SH-X3 Prototype board" 307 bool "SH-X3 Prototype board"
308 depends on CPU_SUBTYPE_SHX3 308 depends on CPU_SUBTYPE_SHX3
309 select NO_IOPORT if !PCI 309 select NO_IOPORT_MAP if !PCI
310 select IRQ_DOMAIN 310 select IRQ_DOMAIN
311 311
312config SH_MAGIC_PANEL_R2 312config SH_MAGIC_PANEL_R2
@@ -333,7 +333,7 @@ config SH_POLARIS
333 333
334config SH_SH2007 334config SH_SH2007
335 bool "SH-2007 board" 335 bool "SH-2007 board"
336 select NO_IOPORT 336 select NO_IOPORT_MAP
337 select REGULATOR_FIXED_VOLTAGE if REGULATOR 337 select REGULATOR_FIXED_VOLTAGE if REGULATOR
338 depends on CPU_SUBTYPE_SH7780 338 depends on CPU_SUBTYPE_SH7780
339 help 339 help
diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
index 25c5a932f9fe..669df51a82e3 100644
--- a/arch/sh/boards/board-sh7757lcr.c
+++ b/arch/sh/boards/board-sh7757lcr.c
@@ -252,7 +252,7 @@ static struct sh_mobile_sdhi_info sdhi_info = {
252static struct resource sdhi_resources[] = { 252static struct resource sdhi_resources[] = {
253 [0] = { 253 [0] = {
254 .start = 0xffe50000, 254 .start = 0xffe50000,
255 .end = 0xffe501ff, 255 .end = 0xffe500ff,
256 .flags = IORESOURCE_MEM, 256 .flags = IORESOURCE_MEM,
257 }, 257 },
258 [1] = { 258 [1] = {
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 5bc3a15465c7..85d5255d259f 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -861,14 +861,12 @@ static struct asoc_simple_card_info fsi_da7210_info = {
861 .card = "FSIB-DA7210", 861 .card = "FSIB-DA7210",
862 .codec = "da7210.0-001a", 862 .codec = "da7210.0-001a",
863 .platform = "sh_fsi.0", 863 .platform = "sh_fsi.0",
864 .daifmt = SND_SOC_DAIFMT_I2S, 864 .daifmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM,
865 .cpu_dai = { 865 .cpu_dai = {
866 .name = "fsib-dai", 866 .name = "fsib-dai",
867 .fmt = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_IB_NF,
868 }, 867 },
869 .codec_dai = { 868 .codec_dai = {
870 .name = "da7210-hifi", 869 .name = "da7210-hifi",
871 .fmt = SND_SOC_DAIFMT_CBM_CFM,
872 }, 870 },
873}; 871};
874 872
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index 21e4230659a5..1162bc6945a3 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -304,14 +304,12 @@ static struct asoc_simple_card_info fsi_ak4642_info = {
304 .card = "FSIA-AK4642", 304 .card = "FSIA-AK4642",
305 .codec = "ak4642-codec.0-0012", 305 .codec = "ak4642-codec.0-0012",
306 .platform = "sh_fsi.0", 306 .platform = "sh_fsi.0",
307 .daifmt = SND_SOC_DAIFMT_LEFT_J, 307 .daifmt = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBM_CFM,
308 .cpu_dai = { 308 .cpu_dai = {
309 .name = "fsia-dai", 309 .name = "fsia-dai",
310 .fmt = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_IB_NF,
311 }, 310 },
312 .codec_dai = { 311 .codec_dai = {
313 .name = "ak4642-hifi", 312 .name = "ak4642-hifi",
314 .fmt = SND_SOC_DAIFMT_CBM_CFM,
315 .sysclk = 11289600, 313 .sysclk = 11289600,
316 }, 314 },
317}; 315};
diff --git a/arch/sh/configs/rsk7203_defconfig b/arch/sh/configs/rsk7203_defconfig
index 4e5229b0c5bb..47236573db83 100644
--- a/arch/sh/configs/rsk7203_defconfig
+++ b/arch/sh/configs/rsk7203_defconfig
@@ -128,7 +128,6 @@ CONFIG_DEBUG_MUTEXES=y
128CONFIG_DEBUG_SPINLOCK_SLEEP=y 128CONFIG_DEBUG_SPINLOCK_SLEEP=y
129CONFIG_DEBUG_INFO=y 129CONFIG_DEBUG_INFO=y
130CONFIG_DEBUG_VM=y 130CONFIG_DEBUG_VM=y
131CONFIG_DEBUG_WRITECOUNT=y
132CONFIG_DEBUG_LIST=y 131CONFIG_DEBUG_LIST=y
133CONFIG_DEBUG_SG=y 132CONFIG_DEBUG_SG=y
134CONFIG_FRAME_POINTER=y 133CONFIG_FRAME_POINTER=y
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c
index 60ed3e1c4b75..1bc09ee7948f 100644
--- a/arch/sh/drivers/pci/pci.c
+++ b/arch/sh/drivers/pci/pci.c
@@ -186,11 +186,6 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res,
186 return start; 186 return start;
187} 187}
188 188
189int pcibios_enable_device(struct pci_dev *dev, int mask)
190{
191 return pci_enable_resources(dev, mask);
192}
193
194static void __init 189static void __init
195pcibios_bus_report_status_early(struct pci_channel *hose, 190pcibios_bus_report_status_early(struct pci_channel *hose,
196 int top_bus, int current_bus, 191 int top_bus, int current_bus,
diff --git a/arch/sh/drivers/pci/pcie-sh7786.h b/arch/sh/drivers/pci/pcie-sh7786.h
index 1ee054e47eae..4a6ff55f759b 100644
--- a/arch/sh/drivers/pci/pcie-sh7786.h
+++ b/arch/sh/drivers/pci/pcie-sh7786.h
@@ -145,9 +145,6 @@
145/* PCIERMSGIER */ 145/* PCIERMSGIER */
146#define SH4A_PCIERMSGIER (0x004040) /* R/W - 0x0000 0000 32 */ 146#define SH4A_PCIERMSGIER (0x004040) /* R/W - 0x0000 0000 32 */
147 147
148/* PCIEPHYCTLR */
149#define SH4A_PCIEPHYCTLR (0x010000) /* R/W - 0x0000 0000 32 */
150
151/* PCIEPHYADRR */ 148/* PCIEPHYADRR */
152#define SH4A_PCIEPHYADRR (0x010004) /* R/W - 0x0000 0000 32 */ 149#define SH4A_PCIEPHYADRR (0x010004) /* R/W - 0x0000 0000 32 */
153#define BITS_ACK (24) // Rev1.171 150#define BITS_ACK (24) // Rev1.171
diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
index 629db2ad7916..728c4c571f40 100644
--- a/arch/sh/include/asm/io.h
+++ b/arch/sh/include/asm/io.h
@@ -122,7 +122,7 @@ __BUILD_MEMORY_STRING(__raw_, l, u32)
122 122
123__BUILD_MEMORY_STRING(__raw_, q, u64) 123__BUILD_MEMORY_STRING(__raw_, q, u64)
124 124
125#ifdef CONFIG_HAS_IOPORT 125#ifdef CONFIG_HAS_IOPORT_MAP
126 126
127/* 127/*
128 * Slowdown I/O port space accesses for antique hardware. 128 * Slowdown I/O port space accesses for antique hardware.
@@ -218,7 +218,7 @@ __BUILD_IOPORT_STRING(w, u16)
218__BUILD_IOPORT_STRING(l, u32) 218__BUILD_IOPORT_STRING(l, u32)
219__BUILD_IOPORT_STRING(q, u64) 219__BUILD_IOPORT_STRING(q, u64)
220 220
221#else /* !CONFIG_HAS_IOPORT */ 221#else /* !CONFIG_HAS_IOPORT_MAP */
222 222
223#include <asm/io_noioport.h> 223#include <asm/io_noioport.h>
224 224
diff --git a/arch/sh/include/asm/io_trapped.h b/arch/sh/include/asm/io_trapped.h
index f1251d4f0ba9..4ab94ef51071 100644
--- a/arch/sh/include/asm/io_trapped.h
+++ b/arch/sh/include/asm/io_trapped.h
@@ -36,7 +36,7 @@ __ioremap_trapped(unsigned long offset, unsigned long size)
36#define __ioremap_trapped(offset, size) NULL 36#define __ioremap_trapped(offset, size) NULL
37#endif 37#endif
38 38
39#ifdef CONFIG_HAS_IOPORT 39#ifdef CONFIG_HAS_IOPORT_MAP
40extern struct list_head trapped_io; 40extern struct list_head trapped_io;
41 41
42static inline void __iomem * 42static inline void __iomem *
diff --git a/arch/sh/include/asm/machvec.h b/arch/sh/include/asm/machvec.h
index eb9c20d971dd..d3324e4f372e 100644
--- a/arch/sh/include/asm/machvec.h
+++ b/arch/sh/include/asm/machvec.h
@@ -21,7 +21,7 @@ struct sh_machine_vector {
21 int (*mv_irq_demux)(int irq); 21 int (*mv_irq_demux)(int irq);
22 void (*mv_init_irq)(void); 22 void (*mv_init_irq)(void);
23 23
24#ifdef CONFIG_HAS_IOPORT 24#ifdef CONFIG_HAS_IOPORT_MAP
25 void __iomem *(*mv_ioport_map)(unsigned long port, unsigned int size); 25 void __iomem *(*mv_ioport_map)(unsigned long port, unsigned int size);
26 void (*mv_ioport_unmap)(void __iomem *); 26 void (*mv_ioport_unmap)(void __iomem *);
27#endif 27#endif
diff --git a/arch/sh/include/asm/syscalls_32.h b/arch/sh/include/asm/syscalls_32.h
index 4f97df87d7d5..4f643aa718e3 100644
--- a/arch/sh/include/asm/syscalls_32.h
+++ b/arch/sh/include/asm/syscalls_32.h
@@ -9,15 +9,9 @@
9 9
10struct pt_regs; 10struct pt_regs;
11 11
12asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5, 12asmlinkage int sys_sigreturn(void);
13 unsigned long r6, unsigned long r7, 13asmlinkage int sys_rt_sigreturn(void);
14 struct pt_regs __regs); 14asmlinkage int sys_sh_pipe(void);
15asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5,
16 unsigned long r6, unsigned long r7,
17 struct pt_regs __regs);
18asmlinkage int sys_sh_pipe(unsigned long r4, unsigned long r5,
19 unsigned long r6, unsigned long r7,
20 struct pt_regs __regs);
21asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf, 15asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf,
22 size_t count, long dummy, loff_t pos); 16 size_t count, long dummy, loff_t pos);
23asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf, 17asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf,
diff --git a/arch/sh/include/asm/traps_32.h b/arch/sh/include/asm/traps_32.h
index cfd55ff9dff2..17e129fe459c 100644
--- a/arch/sh/include/asm/traps_32.h
+++ b/arch/sh/include/asm/traps_32.h
@@ -42,18 +42,10 @@ static inline void trigger_address_error(void)
42asmlinkage void do_address_error(struct pt_regs *regs, 42asmlinkage void do_address_error(struct pt_regs *regs,
43 unsigned long writeaccess, 43 unsigned long writeaccess,
44 unsigned long address); 44 unsigned long address);
45asmlinkage void do_divide_error(unsigned long r4, unsigned long r5, 45asmlinkage void do_divide_error(unsigned long r4);
46 unsigned long r6, unsigned long r7, 46asmlinkage void do_reserved_inst(void);
47 struct pt_regs __regs); 47asmlinkage void do_illegal_slot_inst(void);
48asmlinkage void do_reserved_inst(unsigned long r4, unsigned long r5, 48asmlinkage void do_exception_error(void);
49 unsigned long r6, unsigned long r7,
50 struct pt_regs __regs);
51asmlinkage void do_illegal_slot_inst(unsigned long r4, unsigned long r5,
52 unsigned long r6, unsigned long r7,
53 struct pt_regs __regs);
54asmlinkage void do_exception_error(unsigned long r4, unsigned long r5,
55 unsigned long r6, unsigned long r7,
56 struct pt_regs __regs);
57 49
58#define BUILD_TRAP_HANDLER(name) \ 50#define BUILD_TRAP_HANDLER(name) \
59asmlinkage void name##_trap_handler(unsigned long r4, unsigned long r5, \ 51asmlinkage void name##_trap_handler(unsigned long r4, unsigned long r5, \
diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile
index 261c8bfd75ce..2ccf36c824c6 100644
--- a/arch/sh/kernel/Makefile
+++ b/arch/sh/kernel/Makefile
@@ -22,7 +22,7 @@ obj-y := debugtraps.o dma-nommu.o dumpstack.o \
22 22
23ifndef CONFIG_GENERIC_IOMAP 23ifndef CONFIG_GENERIC_IOMAP
24obj-y += iomap.o 24obj-y += iomap.o
25obj-$(CONFIG_HAS_IOPORT) += ioport.o 25obj-$(CONFIG_HAS_IOPORT_MAP) += ioport.o
26endif 26endif
27 27
28obj-$(CONFIG_SUPERH32) += sys_sh32.o 28obj-$(CONFIG_SUPERH32) += sys_sh32.o
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
index e84a43229b9c..5c0e3c335161 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
@@ -132,7 +132,7 @@ static struct clk_lookup lookups[] = {
132 CLKDEV_CON_ID("usb_fck", &mstp_clks[MSTP103]), 132 CLKDEV_CON_ID("usb_fck", &mstp_clks[MSTP103]),
133 CLKDEV_DEV_ID("renesas_usbhs.0", &mstp_clks[MSTP102]), 133 CLKDEV_DEV_ID("renesas_usbhs.0", &mstp_clks[MSTP102]),
134 CLKDEV_CON_ID("mmc0", &mstp_clks[MSTP220]), 134 CLKDEV_CON_ID("mmc0", &mstp_clks[MSTP220]),
135 CLKDEV_CON_ID("rspi2", &mstp_clks[MSTP127]), 135 CLKDEV_DEV_ID("rspi.2", &mstp_clks[MSTP127]),
136}; 136};
137 137
138int __init arch_clk_init(void) 138int __init arch_clk_init(void)
diff --git a/arch/sh/kernel/dumpstack.c b/arch/sh/kernel/dumpstack.c
index b959f5592604..8dfe645bcc4b 100644
--- a/arch/sh/kernel/dumpstack.c
+++ b/arch/sh/kernel/dumpstack.c
@@ -115,7 +115,7 @@ static int print_trace_stack(void *data, char *name)
115 */ 115 */
116static void print_trace_address(void *data, unsigned long addr, int reliable) 116static void print_trace_address(void *data, unsigned long addr, int reliable)
117{ 117{
118 printk(data); 118 printk("%s", (char *)data);
119 printk_address(addr, reliable); 119 printk_address(addr, reliable);
120} 120}
121 121
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S
index ca46834294b7..13047a4facd2 100644
--- a/arch/sh/kernel/entry-common.S
+++ b/arch/sh/kernel/entry-common.S
@@ -193,10 +193,10 @@ syscall_trace_entry:
193 ! Reload R0-R4 from kernel stack, where the 193 ! Reload R0-R4 from kernel stack, where the
194 ! parent may have modified them using 194 ! parent may have modified them using
195 ! ptrace(POKEUSR). (Note that R0-R2 are 195 ! ptrace(POKEUSR). (Note that R0-R2 are
196 ! used by the system call handler directly 196 ! reloaded from the kernel stack by syscall_call
197 ! from the kernel stack anyway, so don't need 197 ! below, so don't need to be reloaded here.)
198 ! to be reloaded here.) This allows the parent 198 ! This allows the parent to rewrite system calls
199 ! to rewrite system calls and args on the fly. 199 ! and args on the fly.
200 mov.l @(OFF_R4,r15), r4 ! arg0 200 mov.l @(OFF_R4,r15), r4 ! arg0
201 mov.l @(OFF_R5,r15), r5 201 mov.l @(OFF_R5,r15), r5
202 mov.l @(OFF_R6,r15), r6 202 mov.l @(OFF_R6,r15), r6
@@ -357,8 +357,15 @@ syscall_call:
357 mov.l 3f, r8 ! Load the address of sys_call_table 357 mov.l 3f, r8 ! Load the address of sys_call_table
358 add r8, r3 358 add r8, r3
359 mov.l @r3, r8 359 mov.l @r3, r8
360 mov.l @(OFF_R2,r15), r2
361 mov.l @(OFF_R1,r15), r1
362 mov.l @(OFF_R0,r15), r0
363 mov.l r2, @-r15
364 mov.l r1, @-r15
365 mov.l r0, @-r15
360 jsr @r8 ! jump to specific syscall handler 366 jsr @r8 ! jump to specific syscall handler
361 nop 367 nop
368 add #12, r15
362 mov.l @(OFF_R0,r15), r12 ! save r0 369 mov.l @(OFF_R0,r15), r12 ! save r0
363 mov.l r0, @(OFF_R0,r15) ! save the return value 370 mov.l r0, @(OFF_R0,r15) ! save the return value
364 ! 371 !
diff --git a/arch/sh/kernel/ftrace.c b/arch/sh/kernel/ftrace.c
index 30e13196d35b..3c74f53db6db 100644
--- a/arch/sh/kernel/ftrace.c
+++ b/arch/sh/kernel/ftrace.c
@@ -272,11 +272,8 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
272 return ftrace_modify_code(rec->ip, old, new); 272 return ftrace_modify_code(rec->ip, old, new);
273} 273}
274 274
275int __init ftrace_dyn_arch_init(void *data) 275int __init ftrace_dyn_arch_init(void)
276{ 276{
277 /* The return code is retured via data */
278 __raw_writel(0, (unsigned long)data);
279
280 return 0; 277 return 0;
281} 278}
282#endif /* CONFIG_DYNAMIC_FTRACE */ 279#endif /* CONFIG_DYNAMIC_FTRACE */
diff --git a/arch/sh/kernel/io_trapped.c b/arch/sh/kernel/io_trapped.c
index c0a9761f2f8a..f8ce36286cea 100644
--- a/arch/sh/kernel/io_trapped.c
+++ b/arch/sh/kernel/io_trapped.c
@@ -22,7 +22,7 @@
22 22
23#define TRAPPED_PAGES_MAX 16 23#define TRAPPED_PAGES_MAX 16
24 24
25#ifdef CONFIG_HAS_IOPORT 25#ifdef CONFIG_HAS_IOPORT_MAP
26LIST_HEAD(trapped_io); 26LIST_HEAD(trapped_io);
27EXPORT_SYMBOL_GPL(trapped_io); 27EXPORT_SYMBOL_GPL(trapped_io);
28#endif 28#endif
@@ -90,7 +90,7 @@ int register_trapped_io(struct trapped_io *tiop)
90 tiop->magic = IO_TRAPPED_MAGIC; 90 tiop->magic = IO_TRAPPED_MAGIC;
91 INIT_LIST_HEAD(&tiop->list); 91 INIT_LIST_HEAD(&tiop->list);
92 spin_lock_irq(&trapped_lock); 92 spin_lock_irq(&trapped_lock);
93#ifdef CONFIG_HAS_IOPORT 93#ifdef CONFIG_HAS_IOPORT_MAP
94 if (flags & IORESOURCE_IO) 94 if (flags & IORESOURCE_IO)
95 list_add(&tiop->list, &trapped_io); 95 list_add(&tiop->list, &trapped_io);
96#endif 96#endif
diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c
index 6af6e7c5cac8..594cd371aa28 100644
--- a/arch/sh/kernel/signal_32.c
+++ b/arch/sh/kernel/signal_32.c
@@ -148,11 +148,9 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *r0_p
148 return err; 148 return err;
149} 149}
150 150
151asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5, 151asmlinkage int sys_sigreturn(void)
152 unsigned long r6, unsigned long r7,
153 struct pt_regs __regs)
154{ 152{
155 struct pt_regs *regs = RELOC_HIDE(&__regs, 0); 153 struct pt_regs *regs = current_pt_regs();
156 struct sigframe __user *frame = (struct sigframe __user *)regs->regs[15]; 154 struct sigframe __user *frame = (struct sigframe __user *)regs->regs[15];
157 sigset_t set; 155 sigset_t set;
158 int r0; 156 int r0;
@@ -180,11 +178,9 @@ badframe:
180 return 0; 178 return 0;
181} 179}
182 180
183asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, 181asmlinkage int sys_rt_sigreturn(void)
184 unsigned long r6, unsigned long r7,
185 struct pt_regs __regs)
186{ 182{
187 struct pt_regs *regs = RELOC_HIDE(&__regs, 0); 183 struct pt_regs *regs = current_pt_regs();
188 struct rt_sigframe __user *frame = (struct rt_sigframe __user *)regs->regs[15]; 184 struct rt_sigframe __user *frame = (struct rt_sigframe __user *)regs->regs[15];
189 sigset_t set; 185 sigset_t set;
190 int r0; 186 int r0;
diff --git a/arch/sh/kernel/sys_sh32.c b/arch/sh/kernel/sys_sh32.c
index 497bab3a0401..b66d1c62eb19 100644
--- a/arch/sh/kernel/sys_sh32.c
+++ b/arch/sh/kernel/sys_sh32.c
@@ -21,17 +21,14 @@
21 * sys_pipe() is the normal C calling standard for creating 21 * sys_pipe() is the normal C calling standard for creating
22 * a pipe. It's not the way Unix traditionally does this, though. 22 * a pipe. It's not the way Unix traditionally does this, though.
23 */ 23 */
24asmlinkage int sys_sh_pipe(unsigned long r4, unsigned long r5, 24asmlinkage int sys_sh_pipe(void)
25 unsigned long r6, unsigned long r7,
26 struct pt_regs __regs)
27{ 25{
28 struct pt_regs *regs = RELOC_HIDE(&__regs, 0);
29 int fd[2]; 26 int fd[2];
30 int error; 27 int error;
31 28
32 error = do_pipe_flags(fd, 0); 29 error = do_pipe_flags(fd, 0);
33 if (!error) { 30 if (!error) {
34 regs->regs[1] = fd[1]; 31 current_pt_regs()->regs[1] = fd[1];
35 return fd[0]; 32 return fd[0];
36 } 33 }
37 return error; 34 return error;
diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c
index 68e99f09171d..ff639342a8be 100644
--- a/arch/sh/kernel/traps_32.c
+++ b/arch/sh/kernel/traps_32.c
@@ -594,9 +594,7 @@ int is_dsp_inst(struct pt_regs *regs)
594#endif /* CONFIG_SH_DSP */ 594#endif /* CONFIG_SH_DSP */
595 595
596#ifdef CONFIG_CPU_SH2A 596#ifdef CONFIG_CPU_SH2A
597asmlinkage void do_divide_error(unsigned long r4, unsigned long r5, 597asmlinkage void do_divide_error(unsigned long r4)
598 unsigned long r6, unsigned long r7,
599 struct pt_regs __regs)
600{ 598{
601 siginfo_t info; 599 siginfo_t info;
602 600
@@ -613,11 +611,9 @@ asmlinkage void do_divide_error(unsigned long r4, unsigned long r5,
613} 611}
614#endif 612#endif
615 613
616asmlinkage void do_reserved_inst(unsigned long r4, unsigned long r5, 614asmlinkage void do_reserved_inst(void)
617 unsigned long r6, unsigned long r7,
618 struct pt_regs __regs)
619{ 615{
620 struct pt_regs *regs = RELOC_HIDE(&__regs, 0); 616 struct pt_regs *regs = current_pt_regs();
621 unsigned long error_code; 617 unsigned long error_code;
622 struct task_struct *tsk = current; 618 struct task_struct *tsk = current;
623 619
@@ -701,11 +697,9 @@ static int emulate_branch(unsigned short inst, struct pt_regs *regs)
701} 697}
702#endif 698#endif
703 699
704asmlinkage void do_illegal_slot_inst(unsigned long r4, unsigned long r5, 700asmlinkage void do_illegal_slot_inst(void)
705 unsigned long r6, unsigned long r7,
706 struct pt_regs __regs)
707{ 701{
708 struct pt_regs *regs = RELOC_HIDE(&__regs, 0); 702 struct pt_regs *regs = current_pt_regs();
709 unsigned long inst; 703 unsigned long inst;
710 struct task_struct *tsk = current; 704 struct task_struct *tsk = current;
711 705
@@ -730,15 +724,12 @@ asmlinkage void do_illegal_slot_inst(unsigned long r4, unsigned long r5,
730 die_if_no_fixup("illegal slot instruction", regs, inst); 724 die_if_no_fixup("illegal slot instruction", regs, inst);
731} 725}
732 726
733asmlinkage void do_exception_error(unsigned long r4, unsigned long r5, 727asmlinkage void do_exception_error(void)
734 unsigned long r6, unsigned long r7,
735 struct pt_regs __regs)
736{ 728{
737 struct pt_regs *regs = RELOC_HIDE(&__regs, 0);
738 long ex; 729 long ex;
739 730
740 ex = lookup_exception_vector(); 731 ex = lookup_exception_vector();
741 die_if_kernel("exception", regs, ex); 732 die_if_kernel("exception", current_pt_regs(), ex);
742} 733}
743 734
744void per_cpu_trap_init(void) 735void per_cpu_trap_init(void)
diff --git a/arch/sh/math-emu/math.c b/arch/sh/math-emu/math.c
index b876780c1e1c..04aa55fa8c75 100644
--- a/arch/sh/math-emu/math.c
+++ b/arch/sh/math-emu/math.c
@@ -574,24 +574,6 @@ static int ieee_fpe_handler(struct pt_regs *regs)
574 return 0; 574 return 0;
575} 575}
576 576
577asmlinkage void do_fpu_error(unsigned long r4, unsigned long r5,
578 unsigned long r6, unsigned long r7,
579 struct pt_regs regs)
580{
581 struct task_struct *tsk = current;
582 siginfo_t info;
583
584 if (ieee_fpe_handler (&regs))
585 return;
586
587 regs.pc += 2;
588 info.si_signo = SIGFPE;
589 info.si_errno = 0;
590 info.si_code = FPE_FLTINV;
591 info.si_addr = (void __user *)regs.pc;
592 force_sig_info(SIGFPE, &info, tsk);
593}
594
595/** 577/**
596 * fpu_init - Initialize FPU registers 578 * fpu_init - Initialize FPU registers
597 * @fpu: Pointer to software emulated FPU registers. 579 * @fpu: Pointer to software emulated FPU registers.
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 7d8b7e94b93b..29f2e988c56a 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -77,6 +77,7 @@ config SPARC64
77 select ARCH_HAVE_NMI_SAFE_CMPXCHG 77 select ARCH_HAVE_NMI_SAFE_CMPXCHG
78 select HAVE_C_RECORDMCOUNT 78 select HAVE_C_RECORDMCOUNT
79 select NO_BOOTMEM 79 select NO_BOOTMEM
80 select HAVE_ARCH_AUDITSYSCALL
80 81
81config ARCH_DEFCONFIG 82config ARCH_DEFCONFIG
82 string 83 string
diff --git a/arch/sparc/kernel/ftrace.c b/arch/sparc/kernel/ftrace.c
index 03ab022e51c5..0a2d2ddff543 100644
--- a/arch/sparc/kernel/ftrace.c
+++ b/arch/sparc/kernel/ftrace.c
@@ -82,12 +82,8 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
82 return ftrace_modify_code(ip, old, new); 82 return ftrace_modify_code(ip, old, new);
83} 83}
84 84
85int __init ftrace_dyn_arch_init(void *data) 85int __init ftrace_dyn_arch_init(void)
86{ 86{
87 unsigned long *p = data;
88
89 *p = 0;
90
91 return 0; 87 return 0;
92} 88}
93#endif 89#endif
diff --git a/arch/sparc/kernel/leon_pci.c b/arch/sparc/kernel/leon_pci.c
index 88aaaa57bb64..e16c4157e1ae 100644
--- a/arch/sparc/kernel/leon_pci.c
+++ b/arch/sparc/kernel/leon_pci.c
@@ -99,11 +99,6 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res,
99 return res->start; 99 return res->start;
100} 100}
101 101
102int pcibios_enable_device(struct pci_dev *dev, int mask)
103{
104 return pci_enable_resources(dev, mask);
105}
106
107/* in/out routines taken from pcic.c 102/* in/out routines taken from pcic.c
108 * 103 *
109 * This probably belongs here rather than ioport.c because 104 * This probably belongs here rather than ioport.c because
diff --git a/arch/sparc/kernel/leon_pci_grpci2.c b/arch/sparc/kernel/leon_pci_grpci2.c
index 5f0402aab7fb..24d6a4446349 100644
--- a/arch/sparc/kernel/leon_pci_grpci2.c
+++ b/arch/sparc/kernel/leon_pci_grpci2.c
@@ -8,6 +8,7 @@
8#include <linux/of_device.h> 8#include <linux/of_device.h>
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/pci.h> 10#include <linux/pci.h>
11#include <linux/slab.h>
11#include <linux/delay.h> 12#include <linux/delay.h>
12#include <linux/export.h> 13#include <linux/export.h>
13#include <asm/io.h> 14#include <asm/io.h>
diff --git a/arch/sparc/kernel/sun4m_irq.c b/arch/sparc/kernel/sun4m_irq.c
index c5ade9d27a1d..8bb3b3fddea7 100644
--- a/arch/sparc/kernel/sun4m_irq.c
+++ b/arch/sparc/kernel/sun4m_irq.c
@@ -9,6 +9,8 @@
9 * Copyright (C) 1996 Dave Redman (djhr@tadpole.co.uk) 9 * Copyright (C) 1996 Dave Redman (djhr@tadpole.co.uk)
10 */ 10 */
11 11
12#include <linux/slab.h>
13
12#include <asm/timer.h> 14#include <asm/timer.h>
13#include <asm/traps.h> 15#include <asm/traps.h>
14#include <asm/pgalloc.h> 16#include <asm/pgalloc.h>
diff --git a/arch/sparc/kernel/sysfs.c b/arch/sparc/kernel/sysfs.c
index c21c673e5f7c..a364000ca1aa 100644
--- a/arch/sparc/kernel/sysfs.c
+++ b/arch/sparc/kernel/sysfs.c
@@ -300,7 +300,7 @@ static int __init topology_init(void)
300 300
301 check_mmu_stats(); 301 check_mmu_stats();
302 302
303 register_cpu_notifier(&sysfs_cpu_nb); 303 cpu_notifier_register_begin();
304 304
305 for_each_possible_cpu(cpu) { 305 for_each_possible_cpu(cpu) {
306 struct cpu *c = &per_cpu(cpu_devices, cpu); 306 struct cpu *c = &per_cpu(cpu_devices, cpu);
@@ -310,6 +310,10 @@ static int __init topology_init(void)
310 register_cpu_online(cpu); 310 register_cpu_online(cpu);
311 } 311 }
312 312
313 __register_cpu_notifier(&sysfs_cpu_nb);
314
315 cpu_notifier_register_done();
316
313 return 0; 317 return 0;
314} 318}
315 319
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c
index 24e8b8705e7f..3fddf64c7fc6 100644
--- a/arch/sparc/kernel/time_64.c
+++ b/arch/sparc/kernel/time_64.c
@@ -659,8 +659,7 @@ static int sparc64_cpufreq_notifier(struct notifier_block *nb, unsigned long val
659 ft->clock_tick_ref = cpu_data(cpu).clock_tick; 659 ft->clock_tick_ref = cpu_data(cpu).clock_tick;
660 } 660 }
661 if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) || 661 if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) ||
662 (val == CPUFREQ_POSTCHANGE && freq->old > freq->new) || 662 (val == CPUFREQ_POSTCHANGE && freq->old > freq->new)) {
663 (val == CPUFREQ_RESUMECHANGE)) {
664 cpu_data(cpu).clock_tick = 663 cpu_data(cpu).clock_tick =
665 cpufreq_scale(ft->clock_tick_ref, 664 cpufreq_scale(ft->clock_tick_ref,
666 ft->ref_freq, 665 ft->ref_freq,
diff --git a/arch/sparc/net/bpf_jit_comp.c b/arch/sparc/net/bpf_jit_comp.c
index 01fe9946d388..a82c6b2a9780 100644
--- a/arch/sparc/net/bpf_jit_comp.c
+++ b/arch/sparc/net/bpf_jit_comp.c
@@ -618,7 +618,7 @@ void bpf_jit_compile(struct sk_filter *fp)
618 emit_load16(r_A, struct net_device, type, r_A); 618 emit_load16(r_A, struct net_device, type, r_A);
619 break; 619 break;
620 case BPF_S_ANC_RXHASH: 620 case BPF_S_ANC_RXHASH:
621 emit_skb_load32(rxhash, r_A); 621 emit_skb_load32(hash, r_A);
622 break; 622 break;
623 case BPF_S_ANC_VLAN_TAG: 623 case BPF_S_ANC_VLAN_TAG:
624 case BPF_S_ANC_VLAN_TAG_PRESENT: 624 case BPF_S_ANC_VLAN_TAG_PRESENT:
@@ -809,6 +809,7 @@ cond_branch: f_offset = addrs[i + filter[i].jf];
809 if (image) { 809 if (image) {
810 bpf_flush_icache(image, image + proglen); 810 bpf_flush_icache(image, image + proglen);
811 fp->bpf_func = (void *)image; 811 fp->bpf_func = (void *)image;
812 fp->jited = 1;
812 } 813 }
813out: 814out:
814 kfree(addrs); 815 kfree(addrs);
@@ -817,7 +818,7 @@ out:
817 818
818void bpf_jit_free(struct sk_filter *fp) 819void bpf_jit_free(struct sk_filter *fp)
819{ 820{
820 if (fp->bpf_func != sk_run_filter) 821 if (fp->jited)
821 module_free(NULL, fp->bpf_func); 822 module_free(NULL, fp->bpf_func);
822 kfree(fp); 823 kfree(fp);
823} 824}
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
index b3692ce78f90..85258ca43ff5 100644
--- a/arch/tile/Kconfig
+++ b/arch/tile/Kconfig
@@ -3,6 +3,8 @@
3 3
4config TILE 4config TILE
5 def_bool y 5 def_bool y
6 select HAVE_PERF_EVENTS
7 select USE_PMC if PERF_EVENTS
6 select HAVE_DMA_ATTRS 8 select HAVE_DMA_ATTRS
7 select HAVE_DMA_API_DEBUG 9 select HAVE_DMA_API_DEBUG
8 select HAVE_KVM if !TILEGX 10 select HAVE_KVM if !TILEGX
@@ -66,6 +68,10 @@ config HUGETLB_SUPER_PAGES
66config GENERIC_TIME_VSYSCALL 68config GENERIC_TIME_VSYSCALL
67 def_bool y 69 def_bool y
68 70
71# Enable PMC if PERF_EVENTS, OPROFILE, or WATCHPOINTS are enabled.
72config USE_PMC
73 bool
74
69# FIXME: tilegx can implement a more efficient rwsem. 75# FIXME: tilegx can implement a more efficient rwsem.
70config RWSEM_GENERIC_SPINLOCK 76config RWSEM_GENERIC_SPINLOCK
71 def_bool y 77 def_bool y
@@ -405,7 +411,7 @@ config PCI_DOMAINS
405config NO_IOMEM 411config NO_IOMEM
406 def_bool !PCI 412 def_bool !PCI
407 413
408config NO_IOPORT 414config NO_IOPORT_MAP
409 def_bool !PCI 415 def_bool !PCI
410 416
411config TILE_PCI_IO 417config TILE_PCI_IO
diff --git a/arch/tile/include/asm/perf_event.h b/arch/tile/include/asm/perf_event.h
new file mode 100644
index 000000000000..59c5b164e5b6
--- /dev/null
+++ b/arch/tile/include/asm/perf_event.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright 2014 Tilera Corporation. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details.
13 */
14
15#ifndef _ASM_TILE_PERF_EVENT_H
16#define _ASM_TILE_PERF_EVENT_H
17
18#include <linux/percpu.h>
19DECLARE_PER_CPU(u64, perf_irqs);
20
21unsigned long handle_syscall_link_address(void);
22#endif /* _ASM_TILE_PERF_EVENT_H */
diff --git a/arch/tile/include/asm/pmc.h b/arch/tile/include/asm/pmc.h
new file mode 100644
index 000000000000..7ae3956d9008
--- /dev/null
+++ b/arch/tile/include/asm/pmc.h
@@ -0,0 +1,64 @@
1/*
2 * Copyright 2014 Tilera Corporation. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details.
13 */
14
15#ifndef _ASM_TILE_PMC_H
16#define _ASM_TILE_PMC_H
17
18#include <linux/ptrace.h>
19
20#define TILE_BASE_COUNTERS 2
21
22/* Bitfields below are derived from SPR PERF_COUNT_CTL*/
23#ifndef __tilegx__
24/* PERF_COUNT_CTL on TILEPro */
25#define TILE_CTL_EXCL_USER (1 << 7) /* exclude user level */
26#define TILE_CTL_EXCL_KERNEL (1 << 8) /* exclude kernel level */
27#define TILE_CTL_EXCL_HV (1 << 9) /* exclude hypervisor level */
28
29#define TILE_SEL_MASK 0x7f /* 7 bits for event SEL,
30 COUNT_0_SEL */
31#define TILE_PLM_MASK 0x780 /* 4 bits priv level msks,
32 COUNT_0_MASK*/
33#define TILE_EVENT_MASK (TILE_SEL_MASK | TILE_PLM_MASK)
34
35#else /* __tilegx__*/
36/* PERF_COUNT_CTL on TILEGx*/
37#define TILE_CTL_EXCL_USER (1 << 10) /* exclude user level */
38#define TILE_CTL_EXCL_KERNEL (1 << 11) /* exclude kernel level */
39#define TILE_CTL_EXCL_HV (1 << 12) /* exclude hypervisor level */
40
41#define TILE_SEL_MASK 0x3f /* 6 bits for event SEL,
42 COUNT_0_SEL*/
43#define TILE_BOX_MASK 0x1c0 /* 3 bits box msks,
44 COUNT_0_BOX */
45#define TILE_PLM_MASK 0x3c00 /* 4 bits priv level msks,
46 COUNT_0_MASK */
47#define TILE_EVENT_MASK (TILE_SEL_MASK | TILE_BOX_MASK | TILE_PLM_MASK)
48#endif /* __tilegx__*/
49
50/* Takes register and fault number. Returns error to disable the interrupt. */
51typedef int (*perf_irq_t)(struct pt_regs *, int);
52
53int userspace_perf_handler(struct pt_regs *regs, int fault);
54
55perf_irq_t reserve_pmc_hardware(perf_irq_t new_perf_irq);
56void release_pmc_hardware(void);
57
58unsigned long pmc_get_overflow(void);
59void pmc_ack_overflow(unsigned long status);
60
61void unmask_pmc_interrupts(void);
62void mask_pmc_interrupts(void);
63
64#endif /* _ASM_TILE_PMC_H */
diff --git a/arch/tile/kernel/Makefile b/arch/tile/kernel/Makefile
index 27a2bf39dae8..21f77bf68c69 100644
--- a/arch/tile/kernel/Makefile
+++ b/arch/tile/kernel/Makefile
@@ -25,6 +25,8 @@ obj-$(CONFIG_PCI) += pci_gx.o
25else 25else
26obj-$(CONFIG_PCI) += pci.o 26obj-$(CONFIG_PCI) += pci.o
27endif 27endif
28obj-$(CONFIG_PERF_EVENTS) += perf_event.o
29obj-$(CONFIG_USE_PMC) += pmc.o
28obj-$(CONFIG_TILE_USB) += usb.o 30obj-$(CONFIG_TILE_USB) += usb.o
29obj-$(CONFIG_TILE_HVGLUE_TRACE) += hvglue_trace.o 31obj-$(CONFIG_TILE_HVGLUE_TRACE) += hvglue_trace.o
30obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o mcount_64.o 32obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o mcount_64.o
diff --git a/arch/tile/kernel/ftrace.c b/arch/tile/kernel/ftrace.c
index f1c452092eeb..8d52d83cc516 100644
--- a/arch/tile/kernel/ftrace.c
+++ b/arch/tile/kernel/ftrace.c
@@ -167,10 +167,8 @@ int ftrace_make_nop(struct module *mod,
167 return ret; 167 return ret;
168} 168}
169 169
170int __init ftrace_dyn_arch_init(void *data) 170int __init ftrace_dyn_arch_init(void)
171{ 171{
172 *(unsigned long *)data = 0;
173
174 return 0; 172 return 0;
175} 173}
176#endif /* CONFIG_DYNAMIC_FTRACE */ 174#endif /* CONFIG_DYNAMIC_FTRACE */
diff --git a/arch/tile/kernel/intvec_32.S b/arch/tile/kernel/intvec_32.S
index 2cbe6d5dd6b0..cdbda45a4e4b 100644
--- a/arch/tile/kernel/intvec_32.S
+++ b/arch/tile/kernel/intvec_32.S
@@ -313,13 +313,13 @@ intvec_\vecname:
313 movei r3, 0 313 movei r3, 0
314 } 314 }
315 .else 315 .else
316 .ifc \c_routine, op_handle_perf_interrupt 316 .ifc \c_routine, handle_perf_interrupt
317 { 317 {
318 mfspr r2, PERF_COUNT_STS 318 mfspr r2, PERF_COUNT_STS
319 movei r3, -1 /* not used, but set for consistency */ 319 movei r3, -1 /* not used, but set for consistency */
320 } 320 }
321 .else 321 .else
322 .ifc \c_routine, op_handle_aux_perf_interrupt 322 .ifc \c_routine, handle_perf_interrupt
323 { 323 {
324 mfspr r2, AUX_PERF_COUNT_STS 324 mfspr r2, AUX_PERF_COUNT_STS
325 movei r3, -1 /* not used, but set for consistency */ 325 movei r3, -1 /* not used, but set for consistency */
@@ -946,6 +946,13 @@ STD_ENTRY(interrupt_return)
946 bzt r30, .Lrestore_regs 946 bzt r30, .Lrestore_regs
9473: 9473:
948 948
949 /* We are relying on INT_PERF_COUNT at 33, and AUX_PERF_COUNT at 48 */
950 {
951 moveli r0, lo16(1 << (INT_PERF_COUNT - 32))
952 bz r31, .Lrestore_regs
953 }
954 auli r0, r0, ha16(1 << (INT_AUX_PERF_COUNT - 32))
955 mtspr SPR_INTERRUPT_MASK_RESET_K_1, r0
949 956
950 /* 957 /*
951 * We now commit to returning from this interrupt, since we will be 958 * We now commit to returning from this interrupt, since we will be
@@ -1171,6 +1178,10 @@ handle_nmi:
1171 PTREGS_PTR(r0, PTREGS_OFFSET_BASE) 1178 PTREGS_PTR(r0, PTREGS_OFFSET_BASE)
1172 } 1179 }
1173 FEEDBACK_REENTER(handle_nmi) 1180 FEEDBACK_REENTER(handle_nmi)
1181 {
1182 movei r30, 1
1183 seq r31, r0, zero
1184 }
1174 j interrupt_return 1185 j interrupt_return
1175 STD_ENDPROC(handle_nmi) 1186 STD_ENDPROC(handle_nmi)
1176 1187
@@ -1835,8 +1846,9 @@ int_unalign:
1835/* Include .intrpt array of interrupt vectors */ 1846/* Include .intrpt array of interrupt vectors */
1836 .section ".intrpt", "ax" 1847 .section ".intrpt", "ax"
1837 1848
1838#define op_handle_perf_interrupt bad_intr 1849#ifndef CONFIG_USE_PMC
1839#define op_handle_aux_perf_interrupt bad_intr 1850#define handle_perf_interrupt bad_intr
1851#endif
1840 1852
1841#ifndef CONFIG_HARDWALL 1853#ifndef CONFIG_HARDWALL
1842#define do_hardwall_trap bad_intr 1854#define do_hardwall_trap bad_intr
@@ -1877,7 +1889,7 @@ int_unalign:
1877 int_hand INT_IDN_AVAIL, IDN_AVAIL, bad_intr 1889 int_hand INT_IDN_AVAIL, IDN_AVAIL, bad_intr
1878 int_hand INT_UDN_AVAIL, UDN_AVAIL, bad_intr 1890 int_hand INT_UDN_AVAIL, UDN_AVAIL, bad_intr
1879 int_hand INT_PERF_COUNT, PERF_COUNT, \ 1891 int_hand INT_PERF_COUNT, PERF_COUNT, \
1880 op_handle_perf_interrupt, handle_nmi 1892 handle_perf_interrupt, handle_nmi
1881 int_hand INT_INTCTRL_3, INTCTRL_3, bad_intr 1893 int_hand INT_INTCTRL_3, INTCTRL_3, bad_intr
1882#if CONFIG_KERNEL_PL == 2 1894#if CONFIG_KERNEL_PL == 2
1883 dc_dispatch INT_INTCTRL_2, INTCTRL_2 1895 dc_dispatch INT_INTCTRL_2, INTCTRL_2
@@ -1902,7 +1914,7 @@ int_unalign:
1902 int_hand INT_SN_CPL, SN_CPL, bad_intr 1914 int_hand INT_SN_CPL, SN_CPL, bad_intr
1903 int_hand INT_DOUBLE_FAULT, DOUBLE_FAULT, do_trap 1915 int_hand INT_DOUBLE_FAULT, DOUBLE_FAULT, do_trap
1904 int_hand INT_AUX_PERF_COUNT, AUX_PERF_COUNT, \ 1916 int_hand INT_AUX_PERF_COUNT, AUX_PERF_COUNT, \
1905 op_handle_aux_perf_interrupt, handle_nmi 1917 handle_perf_interrupt, handle_nmi
1906 1918
1907 /* Synthetic interrupt delivered only by the simulator */ 1919 /* Synthetic interrupt delivered only by the simulator */
1908 int_hand INT_BREAKPOINT, BREAKPOINT, do_breakpoint 1920 int_hand INT_BREAKPOINT, BREAKPOINT, do_breakpoint
diff --git a/arch/tile/kernel/intvec_64.S b/arch/tile/kernel/intvec_64.S
index b8fc497f2437..5b67efcecabd 100644
--- a/arch/tile/kernel/intvec_64.S
+++ b/arch/tile/kernel/intvec_64.S
@@ -509,10 +509,10 @@ intvec_\vecname:
509 .ifc \c_routine, do_trap 509 .ifc \c_routine, do_trap
510 mfspr r2, GPV_REASON 510 mfspr r2, GPV_REASON
511 .else 511 .else
512 .ifc \c_routine, op_handle_perf_interrupt 512 .ifc \c_routine, handle_perf_interrupt
513 mfspr r2, PERF_COUNT_STS 513 mfspr r2, PERF_COUNT_STS
514 .else 514 .else
515 .ifc \c_routine, op_handle_aux_perf_interrupt 515 .ifc \c_routine, handle_perf_interrupt
516 mfspr r2, AUX_PERF_COUNT_STS 516 mfspr r2, AUX_PERF_COUNT_STS
517 .endif 517 .endif
518 .endif 518 .endif
@@ -971,6 +971,15 @@ STD_ENTRY(interrupt_return)
971 beqzt r30, .Lrestore_regs 971 beqzt r30, .Lrestore_regs
9723: 9723:
973 973
974#if INT_PERF_COUNT + 1 != INT_AUX_PERF_COUNT
975# error Bad interrupt assumption
976#endif
977 {
978 movei r0, 3 /* two adjacent bits for the PERF_COUNT mask */
979 beqz r31, .Lrestore_regs
980 }
981 shli r0, r0, INT_PERF_COUNT
982 mtspr SPR_INTERRUPT_MASK_RESET_K, r0
974 983
975 /* 984 /*
976 * We now commit to returning from this interrupt, since we will be 985 * We now commit to returning from this interrupt, since we will be
@@ -1187,7 +1196,7 @@ handle_nmi:
1187 FEEDBACK_REENTER(handle_nmi) 1196 FEEDBACK_REENTER(handle_nmi)
1188 { 1197 {
1189 movei r30, 1 1198 movei r30, 1
1190 move r31, r0 1199 cmpeq r31, r0, zero
1191 } 1200 }
1192 j interrupt_return 1201 j interrupt_return
1193 STD_ENDPROC(handle_nmi) 1202 STD_ENDPROC(handle_nmi)
@@ -1491,8 +1500,9 @@ STD_ENTRY(fill_ra_stack)
1491 .global intrpt_start 1500 .global intrpt_start
1492intrpt_start: 1501intrpt_start:
1493 1502
1494#define op_handle_perf_interrupt bad_intr 1503#ifndef CONFIG_USE_PMC
1495#define op_handle_aux_perf_interrupt bad_intr 1504#define handle_perf_interrupt bad_intr
1505#endif
1496 1506
1497#ifndef CONFIG_HARDWALL 1507#ifndef CONFIG_HARDWALL
1498#define do_hardwall_trap bad_intr 1508#define do_hardwall_trap bad_intr
@@ -1540,9 +1550,9 @@ intrpt_start:
1540#endif 1550#endif
1541 int_hand INT_IPI_0, IPI_0, bad_intr 1551 int_hand INT_IPI_0, IPI_0, bad_intr
1542 int_hand INT_PERF_COUNT, PERF_COUNT, \ 1552 int_hand INT_PERF_COUNT, PERF_COUNT, \
1543 op_handle_perf_interrupt, handle_nmi 1553 handle_perf_interrupt, handle_nmi
1544 int_hand INT_AUX_PERF_COUNT, AUX_PERF_COUNT, \ 1554 int_hand INT_AUX_PERF_COUNT, AUX_PERF_COUNT, \
1545 op_handle_perf_interrupt, handle_nmi 1555 handle_perf_interrupt, handle_nmi
1546 int_hand INT_INTCTRL_3, INTCTRL_3, bad_intr 1556 int_hand INT_INTCTRL_3, INTCTRL_3, bad_intr
1547#if CONFIG_KERNEL_PL == 2 1557#if CONFIG_KERNEL_PL == 2
1548 dc_dispatch INT_INTCTRL_2, INTCTRL_2 1558 dc_dispatch INT_INTCTRL_2, INTCTRL_2
diff --git a/arch/tile/kernel/irq.c b/arch/tile/kernel/irq.c
index 0586fdb9352d..906a76bdb31d 100644
--- a/arch/tile/kernel/irq.c
+++ b/arch/tile/kernel/irq.c
@@ -21,6 +21,7 @@
21#include <hv/drv_pcie_rc_intf.h> 21#include <hv/drv_pcie_rc_intf.h>
22#include <arch/spr_def.h> 22#include <arch/spr_def.h>
23#include <asm/traps.h> 23#include <asm/traps.h>
24#include <linux/perf_event.h>
24 25
25/* Bit-flag stored in irq_desc->chip_data to indicate HW-cleared irqs. */ 26/* Bit-flag stored in irq_desc->chip_data to indicate HW-cleared irqs. */
26#define IS_HW_CLEARED 1 27#define IS_HW_CLEARED 1
@@ -261,6 +262,23 @@ void ack_bad_irq(unsigned int irq)
261} 262}
262 263
263/* 264/*
265 * /proc/interrupts printing:
266 */
267int arch_show_interrupts(struct seq_file *p, int prec)
268{
269#ifdef CONFIG_PERF_EVENTS
270 int i;
271
272 seq_printf(p, "%*s: ", prec, "PMI");
273
274 for_each_online_cpu(i)
275 seq_printf(p, "%10llu ", per_cpu(perf_irqs, i));
276 seq_puts(p, " perf_events\n");
277#endif
278 return 0;
279}
280
281/*
264 * Generic, controller-independent functions: 282 * Generic, controller-independent functions:
265 */ 283 */
266 284
diff --git a/arch/tile/kernel/messaging.c b/arch/tile/kernel/messaging.c
index 00331af9525d..7867266f9716 100644
--- a/arch/tile/kernel/messaging.c
+++ b/arch/tile/kernel/messaging.c
@@ -68,8 +68,8 @@ void hv_message_intr(struct pt_regs *regs, int intnum)
68#endif 68#endif
69 69
70 while (1) { 70 while (1) {
71 rmi = hv_receive_message(__get_cpu_var(msg_state), 71 HV_MsgState *state = this_cpu_ptr(&msg_state);
72 (HV_VirtAddr) message, 72 rmi = hv_receive_message(*state, (HV_VirtAddr) message,
73 sizeof(message)); 73 sizeof(message));
74 if (rmi.msglen == 0) 74 if (rmi.msglen == 0)
75 break; 75 break;
diff --git a/arch/tile/kernel/pci.c b/arch/tile/kernel/pci.c
index c45593db7718..1f80a88c75a6 100644
--- a/arch/tile/kernel/pci.c
+++ b/arch/tile/kernel/pci.c
@@ -250,8 +250,6 @@ static void fixup_read_and_payload_sizes(void)
250 250
251 /* Scan for the smallest maximum payload size. */ 251 /* Scan for the smallest maximum payload size. */
252 for_each_pci_dev(dev) { 252 for_each_pci_dev(dev) {
253 u32 devcap;
254
255 if (!pci_is_pcie(dev)) 253 if (!pci_is_pcie(dev))
256 continue; 254 continue;
257 255
diff --git a/arch/tile/kernel/pci_gx.c b/arch/tile/kernel/pci_gx.c
index a97a6452b812..077b7bc437e5 100644
--- a/arch/tile/kernel/pci_gx.c
+++ b/arch/tile/kernel/pci_gx.c
@@ -1065,18 +1065,6 @@ char *__init pcibios_setup(char *str)
1065} 1065}
1066 1066
1067/* 1067/*
1068 * Enable memory address decoding, as appropriate, for the
1069 * device described by the 'dev' struct.
1070 *
1071 * This is called from the generic PCI layer, and can be called
1072 * for bridges or endpoints.
1073 */
1074int pcibios_enable_device(struct pci_dev *dev, int mask)
1075{
1076 return pci_enable_resources(dev, mask);
1077}
1078
1079/*
1080 * Called for each device after PCI setup is done. 1068 * Called for each device after PCI setup is done.
1081 * We initialize the PCI device capabilities conservatively, assuming that 1069 * We initialize the PCI device capabilities conservatively, assuming that
1082 * all devices can only address the 32-bit DMA space. The exception here is 1070 * all devices can only address the 32-bit DMA space. The exception here is
diff --git a/arch/tile/kernel/perf_event.c b/arch/tile/kernel/perf_event.c
new file mode 100644
index 000000000000..2bf6c9c135c1
--- /dev/null
+++ b/arch/tile/kernel/perf_event.c
@@ -0,0 +1,1005 @@
1/*
2 * Copyright 2014 Tilera Corporation. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details.
13 *
14 *
15 * Perf_events support for Tile processor.
16 *
17 * This code is based upon the x86 perf event
18 * code, which is:
19 *
20 * Copyright (C) 2008 Thomas Gleixner <tglx@linutronix.de>
21 * Copyright (C) 2008-2009 Red Hat, Inc., Ingo Molnar
22 * Copyright (C) 2009 Jaswinder Singh Rajput
23 * Copyright (C) 2009 Advanced Micro Devices, Inc., Robert Richter
24 * Copyright (C) 2008-2009 Red Hat, Inc., Peter Zijlstra <pzijlstr@redhat.com>
25 * Copyright (C) 2009 Intel Corporation, <markus.t.metzger@intel.com>
26 * Copyright (C) 2009 Google, Inc., Stephane Eranian
27 */
28
29#include <linux/kprobes.h>
30#include <linux/kernel.h>
31#include <linux/kdebug.h>
32#include <linux/mutex.h>
33#include <linux/bitmap.h>
34#include <linux/irq.h>
35#include <linux/interrupt.h>
36#include <linux/perf_event.h>
37#include <linux/atomic.h>
38#include <asm/traps.h>
39#include <asm/stack.h>
40#include <asm/pmc.h>
41#include <hv/hypervisor.h>
42
43#define TILE_MAX_COUNTERS 4
44
45#define PERF_COUNT_0_IDX 0
46#define PERF_COUNT_1_IDX 1
47#define AUX_PERF_COUNT_0_IDX 2
48#define AUX_PERF_COUNT_1_IDX 3
49
50struct cpu_hw_events {
51 int n_events;
52 struct perf_event *events[TILE_MAX_COUNTERS]; /* counter order */
53 struct perf_event *event_list[TILE_MAX_COUNTERS]; /* enabled
54 order */
55 int assign[TILE_MAX_COUNTERS];
56 unsigned long active_mask[BITS_TO_LONGS(TILE_MAX_COUNTERS)];
57 unsigned long used_mask;
58};
59
60/* TILE arch specific performance monitor unit */
61struct tile_pmu {
62 const char *name;
63 int version;
64 const int *hw_events; /* generic hw events table */
65 /* generic hw cache events table */
66 const int (*cache_events)[PERF_COUNT_HW_CACHE_MAX]
67 [PERF_COUNT_HW_CACHE_OP_MAX]
68 [PERF_COUNT_HW_CACHE_RESULT_MAX];
69 int (*map_hw_event)(u64); /*method used to map
70 hw events */
71 int (*map_cache_event)(u64); /*method used to map
72 cache events */
73
74 u64 max_period; /* max sampling period */
75 u64 cntval_mask; /* counter width mask */
76 int cntval_bits; /* counter width */
77 int max_events; /* max generic hw events
78 in map */
79 int num_counters; /* number base + aux counters */
80 int num_base_counters; /* number base counters */
81};
82
83DEFINE_PER_CPU(u64, perf_irqs);
84static DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events);
85
86#define TILE_OP_UNSUPP (-1)
87
88#ifndef __tilegx__
89/* TILEPro hardware events map */
90static const int tile_hw_event_map[] = {
91 [PERF_COUNT_HW_CPU_CYCLES] = 0x01, /* ONE */
92 [PERF_COUNT_HW_INSTRUCTIONS] = 0x06, /* MP_BUNDLE_RETIRED */
93 [PERF_COUNT_HW_CACHE_REFERENCES] = TILE_OP_UNSUPP,
94 [PERF_COUNT_HW_CACHE_MISSES] = TILE_OP_UNSUPP,
95 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x16, /*
96 MP_CONDITIONAL_BRANCH_ISSUED */
97 [PERF_COUNT_HW_BRANCH_MISSES] = 0x14, /*
98 MP_CONDITIONAL_BRANCH_MISSPREDICT */
99 [PERF_COUNT_HW_BUS_CYCLES] = TILE_OP_UNSUPP,
100};
101#else
102/* TILEGx hardware events map */
103static const int tile_hw_event_map[] = {
104 [PERF_COUNT_HW_CPU_CYCLES] = 0x181, /* ONE */
105 [PERF_COUNT_HW_INSTRUCTIONS] = 0xdb, /* INSTRUCTION_BUNDLE */
106 [PERF_COUNT_HW_CACHE_REFERENCES] = TILE_OP_UNSUPP,
107 [PERF_COUNT_HW_CACHE_MISSES] = TILE_OP_UNSUPP,
108 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0xd9, /*
109 COND_BRANCH_PRED_CORRECT */
110 [PERF_COUNT_HW_BRANCH_MISSES] = 0xda, /*
111 COND_BRANCH_PRED_INCORRECT */
112 [PERF_COUNT_HW_BUS_CYCLES] = TILE_OP_UNSUPP,
113};
114#endif
115
116#define C(x) PERF_COUNT_HW_CACHE_##x
117
118/*
119 * Generalized hw caching related hw_event table, filled
120 * in on a per model basis. A value of -1 means
121 * 'not supported', any other value means the
122 * raw hw_event ID.
123 */
124#ifndef __tilegx__
125/* TILEPro hardware cache event map */
126static const int tile_cache_event_map[PERF_COUNT_HW_CACHE_MAX]
127 [PERF_COUNT_HW_CACHE_OP_MAX]
128 [PERF_COUNT_HW_CACHE_RESULT_MAX] = {
129[C(L1D)] = {
130 [C(OP_READ)] = {
131 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
132 [C(RESULT_MISS)] = 0x21, /* RD_MISS */
133 },
134 [C(OP_WRITE)] = {
135 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
136 [C(RESULT_MISS)] = 0x22, /* WR_MISS */
137 },
138 [C(OP_PREFETCH)] = {
139 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
140 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
141 },
142},
143[C(L1I)] = {
144 [C(OP_READ)] = {
145 [C(RESULT_ACCESS)] = 0x12, /* MP_ICACHE_HIT_ISSUED */
146 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
147 },
148 [C(OP_WRITE)] = {
149 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
150 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
151 },
152 [C(OP_PREFETCH)] = {
153 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
154 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
155 },
156},
157[C(LL)] = {
158 [C(OP_READ)] = {
159 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
160 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
161 },
162 [C(OP_WRITE)] = {
163 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
164 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
165 },
166 [C(OP_PREFETCH)] = {
167 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
168 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
169 },
170},
171[C(DTLB)] = {
172 [C(OP_READ)] = {
173 [C(RESULT_ACCESS)] = 0x1d, /* TLB_CNT */
174 [C(RESULT_MISS)] = 0x20, /* TLB_EXCEPTION */
175 },
176 [C(OP_WRITE)] = {
177 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
178 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
179 },
180 [C(OP_PREFETCH)] = {
181 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
182 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
183 },
184},
185[C(ITLB)] = {
186 [C(OP_READ)] = {
187 [C(RESULT_ACCESS)] = 0x13, /* MP_ITLB_HIT_ISSUED */
188 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
189 },
190 [C(OP_WRITE)] = {
191 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
192 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
193 },
194 [C(OP_PREFETCH)] = {
195 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
196 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
197 },
198},
199[C(BPU)] = {
200 [C(OP_READ)] = {
201 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
202 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
203 },
204 [C(OP_WRITE)] = {
205 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
206 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
207 },
208 [C(OP_PREFETCH)] = {
209 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
210 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
211 },
212},
213};
214#else
215/* TILEGx hardware events map */
216static const int tile_cache_event_map[PERF_COUNT_HW_CACHE_MAX]
217 [PERF_COUNT_HW_CACHE_OP_MAX]
218 [PERF_COUNT_HW_CACHE_RESULT_MAX] = {
219[C(L1D)] = {
220 /*
221 * Like some other architectures (e.g. ARM), the performance
222 * counters don't differentiate between read and write
223 * accesses/misses, so this isn't strictly correct, but it's the
224 * best we can do. Writes and reads get combined.
225 */
226 [C(OP_READ)] = {
227 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
228 [C(RESULT_MISS)] = 0x44, /* RD_MISS */
229 },
230 [C(OP_WRITE)] = {
231 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
232 [C(RESULT_MISS)] = 0x45, /* WR_MISS */
233 },
234 [C(OP_PREFETCH)] = {
235 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
236 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
237 },
238},
239[C(L1I)] = {
240 [C(OP_READ)] = {
241 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
242 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
243 },
244 [C(OP_WRITE)] = {
245 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
246 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
247 },
248 [C(OP_PREFETCH)] = {
249 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
250 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
251 },
252},
253[C(LL)] = {
254 [C(OP_READ)] = {
255 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
256 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
257 },
258 [C(OP_WRITE)] = {
259 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
260 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
261 },
262 [C(OP_PREFETCH)] = {
263 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
264 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
265 },
266},
267[C(DTLB)] = {
268 [C(OP_READ)] = {
269 [C(RESULT_ACCESS)] = 0x40, /* TLB_CNT */
270 [C(RESULT_MISS)] = 0x43, /* TLB_EXCEPTION */
271 },
272 [C(OP_WRITE)] = {
273 [C(RESULT_ACCESS)] = 0x40, /* TLB_CNT */
274 [C(RESULT_MISS)] = 0x43, /* TLB_EXCEPTION */
275 },
276 [C(OP_PREFETCH)] = {
277 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
278 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
279 },
280},
281[C(ITLB)] = {
282 [C(OP_READ)] = {
283 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
284 [C(RESULT_MISS)] = 0xd4, /* ITLB_MISS_INT */
285 },
286 [C(OP_WRITE)] = {
287 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
288 [C(RESULT_MISS)] = 0xd4, /* ITLB_MISS_INT */
289 },
290 [C(OP_PREFETCH)] = {
291 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
292 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
293 },
294},
295[C(BPU)] = {
296 [C(OP_READ)] = {
297 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
298 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
299 },
300 [C(OP_WRITE)] = {
301 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
302 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
303 },
304 [C(OP_PREFETCH)] = {
305 [C(RESULT_ACCESS)] = TILE_OP_UNSUPP,
306 [C(RESULT_MISS)] = TILE_OP_UNSUPP,
307 },
308},
309};
310#endif
311
312static atomic_t tile_active_events;
313static DEFINE_MUTEX(perf_intr_reserve_mutex);
314
315static int tile_map_hw_event(u64 config);
316static int tile_map_cache_event(u64 config);
317
318static int tile_pmu_handle_irq(struct pt_regs *regs, int fault);
319
320/*
321 * To avoid new_raw_count getting larger then pre_raw_count
322 * in tile_perf_event_update(), we limit the value of max_period to 2^31 - 1.
323 */
324static const struct tile_pmu tilepmu = {
325#ifndef __tilegx__
326 .name = "tilepro",
327#else
328 .name = "tilegx",
329#endif
330 .max_events = ARRAY_SIZE(tile_hw_event_map),
331 .map_hw_event = tile_map_hw_event,
332 .hw_events = tile_hw_event_map,
333 .map_cache_event = tile_map_cache_event,
334 .cache_events = &tile_cache_event_map,
335 .cntval_bits = 32,
336 .cntval_mask = (1ULL << 32) - 1,
337 .max_period = (1ULL << 31) - 1,
338 .num_counters = TILE_MAX_COUNTERS,
339 .num_base_counters = TILE_BASE_COUNTERS,
340};
341
342static const struct tile_pmu *tile_pmu __read_mostly;
343
344/*
345 * Check whether perf event is enabled.
346 */
347int tile_perf_enabled(void)
348{
349 return atomic_read(&tile_active_events) != 0;
350}
351
352/*
353 * Read Performance Counters.
354 */
355static inline u64 read_counter(int idx)
356{
357 u64 val = 0;
358
359 /* __insn_mfspr() only takes an immediate argument */
360 switch (idx) {
361 case PERF_COUNT_0_IDX:
362 val = __insn_mfspr(SPR_PERF_COUNT_0);
363 break;
364 case PERF_COUNT_1_IDX:
365 val = __insn_mfspr(SPR_PERF_COUNT_1);
366 break;
367 case AUX_PERF_COUNT_0_IDX:
368 val = __insn_mfspr(SPR_AUX_PERF_COUNT_0);
369 break;
370 case AUX_PERF_COUNT_1_IDX:
371 val = __insn_mfspr(SPR_AUX_PERF_COUNT_1);
372 break;
373 default:
374 WARN_ON_ONCE(idx > AUX_PERF_COUNT_1_IDX ||
375 idx < PERF_COUNT_0_IDX);
376 }
377
378 return val;
379}
380
381/*
382 * Write Performance Counters.
383 */
384static inline void write_counter(int idx, u64 value)
385{
386 /* __insn_mtspr() only takes an immediate argument */
387 switch (idx) {
388 case PERF_COUNT_0_IDX:
389 __insn_mtspr(SPR_PERF_COUNT_0, value);
390 break;
391 case PERF_COUNT_1_IDX:
392 __insn_mtspr(SPR_PERF_COUNT_1, value);
393 break;
394 case AUX_PERF_COUNT_0_IDX:
395 __insn_mtspr(SPR_AUX_PERF_COUNT_0, value);
396 break;
397 case AUX_PERF_COUNT_1_IDX:
398 __insn_mtspr(SPR_AUX_PERF_COUNT_1, value);
399 break;
400 default:
401 WARN_ON_ONCE(idx > AUX_PERF_COUNT_1_IDX ||
402 idx < PERF_COUNT_0_IDX);
403 }
404}
405
406/*
407 * Enable performance event by setting
408 * Performance Counter Control registers.
409 */
410static inline void tile_pmu_enable_event(struct perf_event *event)
411{
412 struct hw_perf_event *hwc = &event->hw;
413 unsigned long cfg, mask;
414 int shift, idx = hwc->idx;
415
416 /*
417 * prevent early activation from tile_pmu_start() in hw_perf_enable
418 */
419
420 if (WARN_ON_ONCE(idx == -1))
421 return;
422
423 if (idx < tile_pmu->num_base_counters)
424 cfg = __insn_mfspr(SPR_PERF_COUNT_CTL);
425 else
426 cfg = __insn_mfspr(SPR_AUX_PERF_COUNT_CTL);
427
428 switch (idx) {
429 case PERF_COUNT_0_IDX:
430 case AUX_PERF_COUNT_0_IDX:
431 mask = TILE_EVENT_MASK;
432 shift = 0;
433 break;
434 case PERF_COUNT_1_IDX:
435 case AUX_PERF_COUNT_1_IDX:
436 mask = TILE_EVENT_MASK << 16;
437 shift = 16;
438 break;
439 default:
440 WARN_ON_ONCE(idx < PERF_COUNT_0_IDX ||
441 idx > AUX_PERF_COUNT_1_IDX);
442 return;
443 }
444
445 /* Clear mask bits to enable the event. */
446 cfg &= ~mask;
447 cfg |= hwc->config << shift;
448
449 if (idx < tile_pmu->num_base_counters)
450 __insn_mtspr(SPR_PERF_COUNT_CTL, cfg);
451 else
452 __insn_mtspr(SPR_AUX_PERF_COUNT_CTL, cfg);
453}
454
455/*
456 * Disable performance event by clearing
457 * Performance Counter Control registers.
458 */
459static inline void tile_pmu_disable_event(struct perf_event *event)
460{
461 struct hw_perf_event *hwc = &event->hw;
462 unsigned long cfg, mask;
463 int idx = hwc->idx;
464
465 if (idx == -1)
466 return;
467
468 if (idx < tile_pmu->num_base_counters)
469 cfg = __insn_mfspr(SPR_PERF_COUNT_CTL);
470 else
471 cfg = __insn_mfspr(SPR_AUX_PERF_COUNT_CTL);
472
473 switch (idx) {
474 case PERF_COUNT_0_IDX:
475 case AUX_PERF_COUNT_0_IDX:
476 mask = TILE_PLM_MASK;
477 break;
478 case PERF_COUNT_1_IDX:
479 case AUX_PERF_COUNT_1_IDX:
480 mask = TILE_PLM_MASK << 16;
481 break;
482 default:
483 WARN_ON_ONCE(idx < PERF_COUNT_0_IDX ||
484 idx > AUX_PERF_COUNT_1_IDX);
485 return;
486 }
487
488 /* Set mask bits to disable the event. */
489 cfg |= mask;
490
491 if (idx < tile_pmu->num_base_counters)
492 __insn_mtspr(SPR_PERF_COUNT_CTL, cfg);
493 else
494 __insn_mtspr(SPR_AUX_PERF_COUNT_CTL, cfg);
495}
496
497/*
498 * Propagate event elapsed time into the generic event.
499 * Can only be executed on the CPU where the event is active.
500 * Returns the delta events processed.
501 */
502static u64 tile_perf_event_update(struct perf_event *event)
503{
504 struct hw_perf_event *hwc = &event->hw;
505 int shift = 64 - tile_pmu->cntval_bits;
506 u64 prev_raw_count, new_raw_count;
507 u64 oldval;
508 int idx = hwc->idx;
509 u64 delta;
510
511 /*
512 * Careful: an NMI might modify the previous event value.
513 *
514 * Our tactic to handle this is to first atomically read and
515 * exchange a new raw count - then add that new-prev delta
516 * count to the generic event atomically:
517 */
518again:
519 prev_raw_count = local64_read(&hwc->prev_count);
520 new_raw_count = read_counter(idx);
521
522 oldval = local64_cmpxchg(&hwc->prev_count, prev_raw_count,
523 new_raw_count);
524 if (oldval != prev_raw_count)
525 goto again;
526
527 /*
528 * Now we have the new raw value and have updated the prev
529 * timestamp already. We can now calculate the elapsed delta
530 * (event-)time and add that to the generic event.
531 *
532 * Careful, not all hw sign-extends above the physical width
533 * of the count.
534 */
535 delta = (new_raw_count << shift) - (prev_raw_count << shift);
536 delta >>= shift;
537
538 local64_add(delta, &event->count);
539 local64_sub(delta, &hwc->period_left);
540
541 return new_raw_count;
542}
543
544/*
545 * Set the next IRQ period, based on the hwc->period_left value.
546 * To be called with the event disabled in hw:
547 */
548static int tile_event_set_period(struct perf_event *event)
549{
550 struct hw_perf_event *hwc = &event->hw;
551 int idx = hwc->idx;
552 s64 left = local64_read(&hwc->period_left);
553 s64 period = hwc->sample_period;
554 int ret = 0;
555
556 /*
557 * If we are way outside a reasonable range then just skip forward:
558 */
559 if (unlikely(left <= -period)) {
560 left = period;
561 local64_set(&hwc->period_left, left);
562 hwc->last_period = period;
563 ret = 1;
564 }
565
566 if (unlikely(left <= 0)) {
567 left += period;
568 local64_set(&hwc->period_left, left);
569 hwc->last_period = period;
570 ret = 1;
571 }
572 if (left > tile_pmu->max_period)
573 left = tile_pmu->max_period;
574
575 /*
576 * The hw event starts counting from this event offset,
577 * mark it to be able to extra future deltas:
578 */
579 local64_set(&hwc->prev_count, (u64)-left);
580
581 write_counter(idx, (u64)(-left) & tile_pmu->cntval_mask);
582
583 perf_event_update_userpage(event);
584
585 return ret;
586}
587
588/*
589 * Stop the event but do not release the PMU counter
590 */
591static void tile_pmu_stop(struct perf_event *event, int flags)
592{
593 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
594 struct hw_perf_event *hwc = &event->hw;
595 int idx = hwc->idx;
596
597 if (__test_and_clear_bit(idx, cpuc->active_mask)) {
598 tile_pmu_disable_event(event);
599 cpuc->events[hwc->idx] = NULL;
600 WARN_ON_ONCE(hwc->state & PERF_HES_STOPPED);
601 hwc->state |= PERF_HES_STOPPED;
602 }
603
604 if ((flags & PERF_EF_UPDATE) && !(hwc->state & PERF_HES_UPTODATE)) {
605 /*
606 * Drain the remaining delta count out of a event
607 * that we are disabling:
608 */
609 tile_perf_event_update(event);
610 hwc->state |= PERF_HES_UPTODATE;
611 }
612}
613
614/*
615 * Start an event (without re-assigning counter)
616 */
617static void tile_pmu_start(struct perf_event *event, int flags)
618{
619 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
620 int idx = event->hw.idx;
621
622 if (WARN_ON_ONCE(!(event->hw.state & PERF_HES_STOPPED)))
623 return;
624
625 if (WARN_ON_ONCE(idx == -1))
626 return;
627
628 if (flags & PERF_EF_RELOAD) {
629 WARN_ON_ONCE(!(event->hw.state & PERF_HES_UPTODATE));
630 tile_event_set_period(event);
631 }
632
633 event->hw.state = 0;
634
635 cpuc->events[idx] = event;
636 __set_bit(idx, cpuc->active_mask);
637
638 unmask_pmc_interrupts();
639
640 tile_pmu_enable_event(event);
641
642 perf_event_update_userpage(event);
643}
644
645/*
646 * Add a single event to the PMU.
647 *
648 * The event is added to the group of enabled events
649 * but only if it can be scehduled with existing events.
650 */
651static int tile_pmu_add(struct perf_event *event, int flags)
652{
653 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
654 struct hw_perf_event *hwc;
655 unsigned long mask;
656 int b, max_cnt;
657
658 hwc = &event->hw;
659
660 /*
661 * We are full.
662 */
663 if (cpuc->n_events == tile_pmu->num_counters)
664 return -ENOSPC;
665
666 cpuc->event_list[cpuc->n_events] = event;
667 cpuc->n_events++;
668
669 hwc->state = PERF_HES_UPTODATE | PERF_HES_STOPPED;
670 if (!(flags & PERF_EF_START))
671 hwc->state |= PERF_HES_ARCH;
672
673 /*
674 * Find first empty counter.
675 */
676 max_cnt = tile_pmu->num_counters;
677 mask = ~cpuc->used_mask;
678
679 /* Find next free counter. */
680 b = find_next_bit(&mask, max_cnt, 0);
681
682 /* Should not happen. */
683 if (WARN_ON_ONCE(b == max_cnt))
684 return -ENOSPC;
685
686 /*
687 * Assign counter to event.
688 */
689 event->hw.idx = b;
690 __set_bit(b, &cpuc->used_mask);
691
692 /*
693 * Start if requested.
694 */
695 if (flags & PERF_EF_START)
696 tile_pmu_start(event, PERF_EF_RELOAD);
697
698 return 0;
699}
700
701/*
702 * Delete a single event from the PMU.
703 *
704 * The event is deleted from the group of enabled events.
705 * If it is the last event, disable PMU interrupt.
706 */
707static void tile_pmu_del(struct perf_event *event, int flags)
708{
709 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
710 int i;
711
712 /*
713 * Remove event from list, compact list if necessary.
714 */
715 for (i = 0; i < cpuc->n_events; i++) {
716 if (cpuc->event_list[i] == event) {
717 while (++i < cpuc->n_events)
718 cpuc->event_list[i-1] = cpuc->event_list[i];
719 --cpuc->n_events;
720 cpuc->events[event->hw.idx] = NULL;
721 __clear_bit(event->hw.idx, &cpuc->used_mask);
722 tile_pmu_stop(event, PERF_EF_UPDATE);
723 break;
724 }
725 }
726 /*
727 * If there are no events left, then mask PMU interrupt.
728 */
729 if (cpuc->n_events == 0)
730 mask_pmc_interrupts();
731 perf_event_update_userpage(event);
732}
733
734/*
735 * Propagate event elapsed time into the event.
736 */
737static inline void tile_pmu_read(struct perf_event *event)
738{
739 tile_perf_event_update(event);
740}
741
742/*
743 * Map generic events to Tile PMU.
744 */
745static int tile_map_hw_event(u64 config)
746{
747 if (config >= tile_pmu->max_events)
748 return -EINVAL;
749 return tile_pmu->hw_events[config];
750}
751
752/*
753 * Map generic hardware cache events to Tile PMU.
754 */
755static int tile_map_cache_event(u64 config)
756{
757 unsigned int cache_type, cache_op, cache_result;
758 int code;
759
760 if (!tile_pmu->cache_events)
761 return -ENOENT;
762
763 cache_type = (config >> 0) & 0xff;
764 if (cache_type >= PERF_COUNT_HW_CACHE_MAX)
765 return -EINVAL;
766
767 cache_op = (config >> 8) & 0xff;
768 if (cache_op >= PERF_COUNT_HW_CACHE_OP_MAX)
769 return -EINVAL;
770
771 cache_result = (config >> 16) & 0xff;
772 if (cache_result >= PERF_COUNT_HW_CACHE_RESULT_MAX)
773 return -EINVAL;
774
775 code = (*tile_pmu->cache_events)[cache_type][cache_op][cache_result];
776 if (code == TILE_OP_UNSUPP)
777 return -EINVAL;
778
779 return code;
780}
781
782static void tile_event_destroy(struct perf_event *event)
783{
784 if (atomic_dec_return(&tile_active_events) == 0)
785 release_pmc_hardware();
786}
787
788static int __tile_event_init(struct perf_event *event)
789{
790 struct perf_event_attr *attr = &event->attr;
791 struct hw_perf_event *hwc = &event->hw;
792 int code;
793
794 switch (attr->type) {
795 case PERF_TYPE_HARDWARE:
796 code = tile_pmu->map_hw_event(attr->config);
797 break;
798 case PERF_TYPE_HW_CACHE:
799 code = tile_pmu->map_cache_event(attr->config);
800 break;
801 case PERF_TYPE_RAW:
802 code = attr->config & TILE_EVENT_MASK;
803 break;
804 default:
805 /* Should not happen. */
806 return -EOPNOTSUPP;
807 }
808
809 if (code < 0)
810 return code;
811
812 hwc->config = code;
813 hwc->idx = -1;
814
815 if (attr->exclude_user)
816 hwc->config |= TILE_CTL_EXCL_USER;
817
818 if (attr->exclude_kernel)
819 hwc->config |= TILE_CTL_EXCL_KERNEL;
820
821 if (attr->exclude_hv)
822 hwc->config |= TILE_CTL_EXCL_HV;
823
824 if (!hwc->sample_period) {
825 hwc->sample_period = tile_pmu->max_period;
826 hwc->last_period = hwc->sample_period;
827 local64_set(&hwc->period_left, hwc->sample_period);
828 }
829 event->destroy = tile_event_destroy;
830 return 0;
831}
832
833static int tile_event_init(struct perf_event *event)
834{
835 int err = 0;
836 perf_irq_t old_irq_handler = NULL;
837
838 if (atomic_inc_return(&tile_active_events) == 1)
839 old_irq_handler = reserve_pmc_hardware(tile_pmu_handle_irq);
840
841 if (old_irq_handler) {
842 pr_warn("PMC hardware busy (reserved by oprofile)\n");
843
844 atomic_dec(&tile_active_events);
845 return -EBUSY;
846 }
847
848 switch (event->attr.type) {
849 case PERF_TYPE_RAW:
850 case PERF_TYPE_HARDWARE:
851 case PERF_TYPE_HW_CACHE:
852 break;
853
854 default:
855 return -ENOENT;
856 }
857
858 err = __tile_event_init(event);
859 if (err) {
860 if (event->destroy)
861 event->destroy(event);
862 }
863 return err;
864}
865
866static struct pmu tilera_pmu = {
867 .event_init = tile_event_init,
868 .add = tile_pmu_add,
869 .del = tile_pmu_del,
870
871 .start = tile_pmu_start,
872 .stop = tile_pmu_stop,
873
874 .read = tile_pmu_read,
875};
876
877/*
878 * PMU's IRQ handler, PMU has 2 interrupts, they share the same handler.
879 */
880int tile_pmu_handle_irq(struct pt_regs *regs, int fault)
881{
882 struct perf_sample_data data;
883 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
884 struct perf_event *event;
885 struct hw_perf_event *hwc;
886 u64 val;
887 unsigned long status;
888 int bit;
889
890 __get_cpu_var(perf_irqs)++;
891
892 if (!atomic_read(&tile_active_events))
893 return 0;
894
895 status = pmc_get_overflow();
896 pmc_ack_overflow(status);
897
898 for_each_set_bit(bit, &status, tile_pmu->num_counters) {
899
900 event = cpuc->events[bit];
901
902 if (!event)
903 continue;
904
905 if (!test_bit(bit, cpuc->active_mask))
906 continue;
907
908 hwc = &event->hw;
909
910 val = tile_perf_event_update(event);
911 if (val & (1ULL << (tile_pmu->cntval_bits - 1)))
912 continue;
913
914 perf_sample_data_init(&data, 0, event->hw.last_period);
915 if (!tile_event_set_period(event))
916 continue;
917
918 if (perf_event_overflow(event, &data, regs))
919 tile_pmu_stop(event, 0);
920 }
921
922 return 0;
923}
924
925static bool __init supported_pmu(void)
926{
927 tile_pmu = &tilepmu;
928 return true;
929}
930
931int __init init_hw_perf_events(void)
932{
933 supported_pmu();
934 perf_pmu_register(&tilera_pmu, "cpu", PERF_TYPE_RAW);
935 return 0;
936}
937arch_initcall(init_hw_perf_events);
938
939/* Callchain handling code. */
940
941/*
942 * Tile specific backtracing code for perf_events.
943 */
944static inline void perf_callchain(struct perf_callchain_entry *entry,
945 struct pt_regs *regs)
946{
947 struct KBacktraceIterator kbt;
948 unsigned int i;
949
950 /*
951 * Get the address just after the "jalr" instruction that
952 * jumps to the handler for a syscall. When we find this
953 * address in a backtrace, we silently ignore it, which gives
954 * us a one-step backtrace connection from the sys_xxx()
955 * function in the kernel to the xxx() function in libc.
956 * Otherwise, we lose the ability to properly attribute time
957 * from the libc calls to the kernel implementations, since
958 * oprofile only considers PCs from backtraces a pair at a time.
959 */
960 unsigned long handle_syscall_pc = handle_syscall_link_address();
961
962 KBacktraceIterator_init(&kbt, NULL, regs);
963 kbt.profile = 1;
964
965 /*
966 * The sample for the pc is already recorded. Now we are adding the
967 * address of the callsites on the stack. Our iterator starts
968 * with the frame of the (already sampled) call site. If our
969 * iterator contained a "return address" field, we could have just
970 * used it and wouldn't have needed to skip the first
971 * frame. That's in effect what the arm and x86 versions do.
972 * Instead we peel off the first iteration to get the equivalent
973 * behavior.
974 */
975
976 if (KBacktraceIterator_end(&kbt))
977 return;
978 KBacktraceIterator_next(&kbt);
979
980 /*
981 * Set stack depth to 16 for user and kernel space respectively, that
982 * is, total 32 stack frames.
983 */
984 for (i = 0; i < 16; ++i) {
985 unsigned long pc;
986 if (KBacktraceIterator_end(&kbt))
987 break;
988 pc = kbt.it.pc;
989 if (pc != handle_syscall_pc)
990 perf_callchain_store(entry, pc);
991 KBacktraceIterator_next(&kbt);
992 }
993}
994
995void perf_callchain_user(struct perf_callchain_entry *entry,
996 struct pt_regs *regs)
997{
998 perf_callchain(entry, regs);
999}
1000
1001void perf_callchain_kernel(struct perf_callchain_entry *entry,
1002 struct pt_regs *regs)
1003{
1004 perf_callchain(entry, regs);
1005}
diff --git a/arch/tile/kernel/pmc.c b/arch/tile/kernel/pmc.c
new file mode 100644
index 000000000000..db62cc34b955
--- /dev/null
+++ b/arch/tile/kernel/pmc.c
@@ -0,0 +1,121 @@
1/*
2 * Copyright 2014 Tilera Corporation. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
12 * more details.
13 */
14
15#include <linux/errno.h>
16#include <linux/spinlock.h>
17#include <linux/module.h>
18#include <linux/atomic.h>
19#include <linux/interrupt.h>
20
21#include <asm/processor.h>
22#include <asm/pmc.h>
23
24perf_irq_t perf_irq = NULL;
25int handle_perf_interrupt(struct pt_regs *regs, int fault)
26{
27 int retval;
28
29 if (!perf_irq)
30 panic("Unexpected PERF_COUNT interrupt %d\n", fault);
31
32 nmi_enter();
33 retval = perf_irq(regs, fault);
34 nmi_exit();
35 return retval;
36}
37
38/* Reserve PMC hardware if it is available. */
39perf_irq_t reserve_pmc_hardware(perf_irq_t new_perf_irq)
40{
41 return cmpxchg(&perf_irq, NULL, new_perf_irq);
42}
43EXPORT_SYMBOL(reserve_pmc_hardware);
44
45/* Release PMC hardware. */
46void release_pmc_hardware(void)
47{
48 perf_irq = NULL;
49}
50EXPORT_SYMBOL(release_pmc_hardware);
51
52
53/*
54 * Get current overflow status of each performance counter,
55 * and auxiliary performance counter.
56 */
57unsigned long
58pmc_get_overflow(void)
59{
60 unsigned long status;
61
62 /*
63 * merge base+aux into a single vector
64 */
65 status = __insn_mfspr(SPR_PERF_COUNT_STS);
66 status |= __insn_mfspr(SPR_AUX_PERF_COUNT_STS) << TILE_BASE_COUNTERS;
67 return status;
68}
69
70/*
71 * Clear the status bit for the corresponding counter, if written
72 * with a one.
73 */
74void
75pmc_ack_overflow(unsigned long status)
76{
77 /*
78 * clear overflow status by writing ones
79 */
80 __insn_mtspr(SPR_PERF_COUNT_STS, status);
81 __insn_mtspr(SPR_AUX_PERF_COUNT_STS, status >> TILE_BASE_COUNTERS);
82}
83
84/*
85 * The perf count interrupts are masked and unmasked explicitly,
86 * and only here. The normal irq_enable() does not enable them,
87 * and irq_disable() does not disable them. That lets these
88 * routines drive the perf count interrupts orthogonally.
89 *
90 * We also mask the perf count interrupts on entry to the perf count
91 * interrupt handler in assembly code, and by default unmask them
92 * again (with interrupt critical section protection) just before
93 * returning from the interrupt. If the perf count handler returns
94 * a non-zero error code, then we don't re-enable them before returning.
95 *
96 * For Pro, we rely on both interrupts being in the same word to update
97 * them atomically so we never have one enabled and one disabled.
98 */
99
100#if CHIP_HAS_SPLIT_INTR_MASK()
101# if INT_PERF_COUNT < 32 || INT_AUX_PERF_COUNT < 32
102# error Fix assumptions about which word PERF_COUNT interrupts are in
103# endif
104#endif
105
106static inline unsigned long long pmc_mask(void)
107{
108 unsigned long long mask = 1ULL << INT_PERF_COUNT;
109 mask |= 1ULL << INT_AUX_PERF_COUNT;
110 return mask;
111}
112
113void unmask_pmc_interrupts(void)
114{
115 interrupt_mask_reset_mask(pmc_mask());
116}
117
118void mask_pmc_interrupts(void)
119{
120 interrupt_mask_set_mask(pmc_mask());
121}
diff --git a/arch/tile/kernel/time.c b/arch/tile/kernel/time.c
index 5d10642db63e..462dcd0c1700 100644
--- a/arch/tile/kernel/time.c
+++ b/arch/tile/kernel/time.c
@@ -236,7 +236,15 @@ cycles_t ns2cycles(unsigned long nsecs)
236 * clock frequency. 236 * clock frequency.
237 */ 237 */
238 struct clock_event_device *dev = &__raw_get_cpu_var(tile_timer); 238 struct clock_event_device *dev = &__raw_get_cpu_var(tile_timer);
239 return ((u64)nsecs * dev->mult) >> dev->shift; 239
240 /*
241 * as in clocksource.h and x86's timer.h, we split the calculation
242 * into 2 parts to avoid unecessary overflow of the intermediate
243 * value. This will not lead to any loss of precision.
244 */
245 u64 quot = (u64)nsecs >> dev->shift;
246 u64 rem = (u64)nsecs & ((1ULL << dev->shift) - 1);
247 return quot * dev->mult + ((rem * dev->mult) >> dev->shift);
240} 248}
241 249
242void update_vsyscall_tz(void) 250void update_vsyscall_tz(void)
diff --git a/arch/tile/kernel/vdso/Makefile b/arch/tile/kernel/vdso/Makefile
index e2b7a2f4ee41..a025f63d54cd 100644
--- a/arch/tile/kernel/vdso/Makefile
+++ b/arch/tile/kernel/vdso/Makefile
@@ -104,7 +104,7 @@ $(obj-vdso32:%=%): KBUILD_AFLAGS = $(KBUILD_AFLAGS_32)
104$(obj-vdso32:%=%): KBUILD_CFLAGS = $(KBUILD_CFLAGS_32) 104$(obj-vdso32:%=%): KBUILD_CFLAGS = $(KBUILD_CFLAGS_32)
105 105
106$(obj)/vgettimeofday32.o: $(obj)/vgettimeofday.c 106$(obj)/vgettimeofday32.o: $(obj)/vgettimeofday.c
107 $(call if_changed,cc_o_c) 107 $(call if_changed_rule,cc_o_c)
108 108
109$(obj)/vrt_sigreturn32.o: $(obj)/vrt_sigreturn.S 109$(obj)/vrt_sigreturn32.o: $(obj)/vrt_sigreturn.S
110 $(call if_changed,as_o_S) 110 $(call if_changed,as_o_S)
diff --git a/arch/um/Kconfig.common b/arch/um/Kconfig.common
index 21ca44c4f6d5..6915d28cf118 100644
--- a/arch/um/Kconfig.common
+++ b/arch/um/Kconfig.common
@@ -1,6 +1,7 @@
1config UML 1config UML
2 bool 2 bool
3 default y 3 default y
4 select HAVE_ARCH_AUDITSYSCALL
4 select HAVE_UID16 5 select HAVE_UID16
5 select GENERIC_IRQ_SHOW 6 select GENERIC_IRQ_SHOW
6 select GENERIC_CPU_DEVICES 7 select GENERIC_CPU_DEVICES
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index 39f186252e02..7d26d9c0b2fb 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -240,7 +240,7 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
240 240
241 spin_unlock_irqrestore(&lp->lock, flags); 241 spin_unlock_irqrestore(&lp->lock, flags);
242 242
243 dev_kfree_skb(skb); 243 dev_consume_skb_any(skb);
244 244
245 return NETDEV_TX_OK; 245 return NETDEV_TX_OK;
246} 246}
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
index eecc4142764c..f17bca8ed2ce 100644
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -359,7 +359,7 @@ int singlestepping(void * t)
359/* 359/*
360 * Only x86 and x86_64 have an arch_align_stack(). 360 * Only x86 and x86_64 have an arch_align_stack().
361 * All other arches have "#define arch_align_stack(x) (x)" 361 * All other arches have "#define arch_align_stack(x) (x)"
362 * in their asm/system.h 362 * in their asm/exec.h
363 * As this is included in UML from asm-um/system-generic.h, 363 * As this is included in UML from asm-um/system-generic.h,
364 * we can use it to behave as the subarch does. 364 * we can use it to behave as the subarch does.
365 */ 365 */
diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index 25c0dba508cc..aafad6fa1667 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -27,7 +27,7 @@ config UNICORE32
27config GENERIC_CSUM 27config GENERIC_CSUM
28 def_bool y 28 def_bool y
29 29
30config NO_IOPORT 30config NO_IOPORT_MAP
31 bool 31 bool
32 32
33config STACKTRACE_SUPPORT 33config STACKTRACE_SUPPORT
diff --git a/arch/unicore32/include/asm/mmu_context.h b/arch/unicore32/include/asm/mmu_context.h
index fb5e4c658f7a..ef470a7a3d0f 100644
--- a/arch/unicore32/include/asm/mmu_context.h
+++ b/arch/unicore32/include/asm/mmu_context.h
@@ -14,6 +14,8 @@
14 14
15#include <linux/compiler.h> 15#include <linux/compiler.h>
16#include <linux/sched.h> 16#include <linux/sched.h>
17#include <linux/mm.h>
18#include <linux/vmacache.h>
17#include <linux/io.h> 19#include <linux/io.h>
18 20
19#include <asm/cacheflush.h> 21#include <asm/cacheflush.h>
@@ -73,7 +75,7 @@ do { \
73 else \ 75 else \
74 mm->mmap = NULL; \ 76 mm->mmap = NULL; \
75 rb_erase(&high_vma->vm_rb, &mm->mm_rb); \ 77 rb_erase(&high_vma->vm_rb, &mm->mm_rb); \
76 mm->mmap_cache = NULL; \ 78 vmacache_invalidate(mm); \
77 mm->map_count--; \ 79 mm->map_count--; \
78 remove_vma(high_vma); \ 80 remove_vma(high_vma); \
79 } \ 81 } \
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 8453fe1342ea..25d2c6f7325e 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -43,6 +43,7 @@ config X86
43 select HAVE_DMA_ATTRS 43 select HAVE_DMA_ATTRS
44 select HAVE_DMA_CONTIGUOUS if !SWIOTLB 44 select HAVE_DMA_CONTIGUOUS if !SWIOTLB
45 select HAVE_KRETPROBES 45 select HAVE_KRETPROBES
46 select GENERIC_EARLY_IOREMAP
46 select HAVE_OPTPROBES 47 select HAVE_OPTPROBES
47 select HAVE_KPROBES_ON_FTRACE 48 select HAVE_KPROBES_ON_FTRACE
48 select HAVE_FTRACE_MCOUNT_RECORD 49 select HAVE_FTRACE_MCOUNT_RECORD
@@ -107,9 +108,9 @@ config X86
107 select HAVE_ARCH_SOFT_DIRTY 108 select HAVE_ARCH_SOFT_DIRTY
108 select CLOCKSOURCE_WATCHDOG 109 select CLOCKSOURCE_WATCHDOG
109 select GENERIC_CLOCKEVENTS 110 select GENERIC_CLOCKEVENTS
110 select ARCH_CLOCKSOURCE_DATA if X86_64 111 select ARCH_CLOCKSOURCE_DATA
111 select GENERIC_CLOCKEVENTS_BROADCAST if X86_64 || (X86_32 && X86_LOCAL_APIC) 112 select GENERIC_CLOCKEVENTS_BROADCAST if X86_64 || (X86_32 && X86_LOCAL_APIC)
112 select GENERIC_TIME_VSYSCALL if X86_64 113 select GENERIC_TIME_VSYSCALL
113 select KTIME_SCALAR if X86_32 114 select KTIME_SCALAR if X86_32
114 select GENERIC_STRNCPY_FROM_USER 115 select GENERIC_STRNCPY_FROM_USER
115 select GENERIC_STRNLEN_USER 116 select GENERIC_STRNLEN_USER
@@ -127,6 +128,8 @@ config X86
127 select HAVE_DEBUG_STACKOVERFLOW 128 select HAVE_DEBUG_STACKOVERFLOW
128 select HAVE_IRQ_EXIT_ON_IRQ_STACK if X86_64 129 select HAVE_IRQ_EXIT_ON_IRQ_STACK if X86_64
129 select HAVE_CC_STACKPROTECTOR 130 select HAVE_CC_STACKPROTECTOR
131 select GENERIC_CPU_AUTOPROBE
132 select HAVE_ARCH_AUDITSYSCALL
130 133
131config INSTRUCTION_DECODER 134config INSTRUCTION_DECODER
132 def_bool y 135 def_bool y
@@ -195,9 +198,6 @@ config ARCH_HAS_CPU_RELAX
195config ARCH_HAS_CACHE_LINE_SIZE 198config ARCH_HAS_CACHE_LINE_SIZE
196 def_bool y 199 def_bool y
197 200
198config ARCH_HAS_CPU_AUTOPROBE
199 def_bool y
200
201config HAVE_SETUP_PER_CPU_AREA 201config HAVE_SETUP_PER_CPU_AREA
202 def_bool y 202 def_bool y
203 203
@@ -346,12 +346,9 @@ config X86_EXTENDED_PLATFORM
346 for the following (non-PC) 32 bit x86 platforms: 346 for the following (non-PC) 32 bit x86 platforms:
347 Goldfish (Android emulator) 347 Goldfish (Android emulator)
348 AMD Elan 348 AMD Elan
349 NUMAQ (IBM/Sequent)
350 RDC R-321x SoC 349 RDC R-321x SoC
351 SGI 320/540 (Visual Workstation) 350 SGI 320/540 (Visual Workstation)
352 STA2X11-based (e.g. Northville) 351 STA2X11-based (e.g. Northville)
353 Summit/EXA (IBM x440)
354 Unisys ES7000 IA32 series
355 Moorestown MID devices 352 Moorestown MID devices
356 353
357 If you have one of these systems, or if you want to build a 354 If you have one of these systems, or if you want to build a
@@ -489,49 +486,22 @@ config X86_32_NON_STANDARD
489 depends on X86_32 && SMP 486 depends on X86_32 && SMP
490 depends on X86_EXTENDED_PLATFORM 487 depends on X86_EXTENDED_PLATFORM
491 ---help--- 488 ---help---
492 This option compiles in the NUMAQ, Summit, bigsmp, ES7000, 489 This option compiles in the bigsmp and STA2X11 default
493 STA2X11, default subarchitectures. It is intended for a generic 490 subarchitectures. It is intended for a generic binary
494 binary kernel. If you select them all, kernel will probe it 491 kernel. If you select them all, kernel will probe it one by
495 one by one and will fallback to default. 492 one and will fallback to default.
496 493
497# Alphabetically sorted list of Non standard 32 bit platforms 494# Alphabetically sorted list of Non standard 32 bit platforms
498 495
499config X86_NUMAQ
500 bool "NUMAQ (IBM/Sequent)"
501 depends on X86_32_NON_STANDARD
502 depends on PCI
503 select NUMA
504 select X86_MPPARSE
505 ---help---
506 This option is used for getting Linux to run on a NUMAQ (IBM/Sequent)
507 NUMA multiquad box. This changes the way that processors are
508 bootstrapped, and uses Clustered Logical APIC addressing mode instead
509 of Flat Logical. You will need a new lynxer.elf file to flash your
510 firmware with - send email to <Martin.Bligh@us.ibm.com>.
511
512config X86_SUPPORTS_MEMORY_FAILURE 496config X86_SUPPORTS_MEMORY_FAILURE
513 def_bool y 497 def_bool y
514 # MCE code calls memory_failure(): 498 # MCE code calls memory_failure():
515 depends on X86_MCE 499 depends on X86_MCE
516 # On 32-bit this adds too big of NODES_SHIFT and we run out of page flags: 500 # On 32-bit this adds too big of NODES_SHIFT and we run out of page flags:
517 depends on !X86_NUMAQ
518 # On 32-bit SPARSEMEM adds too big of SECTIONS_WIDTH: 501 # On 32-bit SPARSEMEM adds too big of SECTIONS_WIDTH:
519 depends on X86_64 || !SPARSEMEM 502 depends on X86_64 || !SPARSEMEM
520 select ARCH_SUPPORTS_MEMORY_FAILURE 503 select ARCH_SUPPORTS_MEMORY_FAILURE
521 504
522config X86_VISWS
523 bool "SGI 320/540 (Visual Workstation)"
524 depends on X86_32 && PCI && X86_MPPARSE && PCI_GODIRECT
525 depends on X86_32_NON_STANDARD
526 ---help---
527 The SGI Visual Workstation series is an IA32-based workstation
528 based on SGI systems chips with some legacy PC hardware attached.
529
530 Say Y here to create a kernel to run on the SGI 320 or 540.
531
532 A kernel compiled for the Visual Workstation will run on general
533 PCs as well. See <file:Documentation/sgi-visws.txt> for details.
534
535config STA2X11 505config STA2X11
536 bool "STA2X11 Companion Chip Support" 506 bool "STA2X11 Companion Chip Support"
537 depends on X86_32_NON_STANDARD && PCI 507 depends on X86_32_NON_STANDARD && PCI
@@ -548,20 +518,6 @@ config STA2X11
548 option is selected the kernel will still be able to boot on 518 option is selected the kernel will still be able to boot on
549 standard PC machines. 519 standard PC machines.
550 520
551config X86_SUMMIT
552 bool "Summit/EXA (IBM x440)"
553 depends on X86_32_NON_STANDARD
554 ---help---
555 This option is needed for IBM systems that use the Summit/EXA chipset.
556 In particular, it is needed for the x440.
557
558config X86_ES7000
559 bool "Unisys ES7000 IA32 series"
560 depends on X86_32_NON_STANDARD && X86_BIGSMP
561 ---help---
562 Support for Unisys ES7000 systems. Say 'Y' here if this kernel is
563 supposed to run on an IA32-based Unisys ES7000 system.
564
565config X86_32_IRIS 521config X86_32_IRIS
566 tristate "Eurobraille/Iris poweroff module" 522 tristate "Eurobraille/Iris poweroff module"
567 depends on X86_32 523 depends on X86_32
@@ -684,14 +640,6 @@ config MEMTEST
684 memtest=4, mean do 4 test patterns. 640 memtest=4, mean do 4 test patterns.
685 If you are unsure how to answer this question, answer N. 641 If you are unsure how to answer this question, answer N.
686 642
687config X86_SUMMIT_NUMA
688 def_bool y
689 depends on X86_32 && NUMA && X86_32_NON_STANDARD
690
691config X86_CYCLONE_TIMER
692 def_bool y
693 depends on X86_SUMMIT
694
695source "arch/x86/Kconfig.cpu" 643source "arch/x86/Kconfig.cpu"
696 644
697config HPET_TIMER 645config HPET_TIMER
@@ -820,7 +768,7 @@ config NR_CPUS
820 range 2 8192 if SMP && !MAXSMP && CPUMASK_OFFSTACK && X86_64 768 range 2 8192 if SMP && !MAXSMP && CPUMASK_OFFSTACK && X86_64
821 default "1" if !SMP 769 default "1" if !SMP
822 default "8192" if MAXSMP 770 default "8192" if MAXSMP
823 default "32" if SMP && (X86_NUMAQ || X86_SUMMIT || X86_BIGSMP || X86_ES7000) 771 default "32" if SMP && X86_BIGSMP
824 default "8" if SMP 772 default "8" if SMP
825 ---help--- 773 ---help---
826 This allows you to specify the maximum number of CPUs which this 774 This allows you to specify the maximum number of CPUs which this
@@ -884,10 +832,6 @@ config X86_IO_APIC
884 def_bool y 832 def_bool y
885 depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC || PCI_MSI 833 depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC || PCI_MSI
886 834
887config X86_VISWS_APIC
888 def_bool y
889 depends on X86_32 && X86_VISWS
890
891config X86_REROUTE_FOR_BROKEN_BOOT_IRQS 835config X86_REROUTE_FOR_BROKEN_BOOT_IRQS
892 bool "Reroute for broken boot IRQs" 836 bool "Reroute for broken boot IRQs"
893 depends on X86_IO_APIC 837 depends on X86_IO_APIC
@@ -1105,13 +1049,11 @@ config X86_CPUID
1105 1049
1106choice 1050choice
1107 prompt "High Memory Support" 1051 prompt "High Memory Support"
1108 default HIGHMEM64G if X86_NUMAQ
1109 default HIGHMEM4G 1052 default HIGHMEM4G
1110 depends on X86_32 1053 depends on X86_32
1111 1054
1112config NOHIGHMEM 1055config NOHIGHMEM
1113 bool "off" 1056 bool "off"
1114 depends on !X86_NUMAQ
1115 ---help--- 1057 ---help---
1116 Linux can use up to 64 Gigabytes of physical memory on x86 systems. 1058 Linux can use up to 64 Gigabytes of physical memory on x86 systems.
1117 However, the address space of 32-bit x86 processors is only 4 1059 However, the address space of 32-bit x86 processors is only 4
@@ -1148,7 +1090,6 @@ config NOHIGHMEM
1148 1090
1149config HIGHMEM4G 1091config HIGHMEM4G
1150 bool "4GB" 1092 bool "4GB"
1151 depends on !X86_NUMAQ
1152 ---help--- 1093 ---help---
1153 Select this if you have a 32-bit processor and between 1 and 4 1094 Select this if you have a 32-bit processor and between 1 and 4
1154 gigabytes of physical RAM. 1095 gigabytes of physical RAM.
@@ -1240,8 +1181,8 @@ config DIRECT_GBPAGES
1240config NUMA 1181config NUMA
1241 bool "Numa Memory Allocation and Scheduler Support" 1182 bool "Numa Memory Allocation and Scheduler Support"
1242 depends on SMP 1183 depends on SMP
1243 depends on X86_64 || (X86_32 && HIGHMEM64G && (X86_NUMAQ || X86_BIGSMP || X86_SUMMIT && ACPI)) 1184 depends on X86_64 || (X86_32 && HIGHMEM64G && X86_BIGSMP)
1244 default y if (X86_NUMAQ || X86_SUMMIT || X86_BIGSMP) 1185 default y if X86_BIGSMP
1245 ---help--- 1186 ---help---
1246 Enable NUMA (Non Uniform Memory Access) support. 1187 Enable NUMA (Non Uniform Memory Access) support.
1247 1188
@@ -1252,15 +1193,11 @@ config NUMA
1252 For 64-bit this is recommended if the system is Intel Core i7 1193 For 64-bit this is recommended if the system is Intel Core i7
1253 (or later), AMD Opteron, or EM64T NUMA. 1194 (or later), AMD Opteron, or EM64T NUMA.
1254 1195
1255 For 32-bit this is only needed on (rare) 32-bit-only platforms 1196 For 32-bit this is only needed if you boot a 32-bit
1256 that support NUMA topologies, such as NUMAQ / Summit, or if you 1197 kernel on a 64-bit NUMA platform.
1257 boot a 32-bit kernel on a 64-bit NUMA platform.
1258 1198
1259 Otherwise, you should say N. 1199 Otherwise, you should say N.
1260 1200
1261comment "NUMA (Summit) requires SMP, 64GB highmem support, ACPI"
1262 depends on X86_32 && X86_SUMMIT && (!HIGHMEM64G || !ACPI)
1263
1264config AMD_NUMA 1201config AMD_NUMA
1265 def_bool y 1202 def_bool y
1266 prompt "Old style AMD Opteron NUMA detection" 1203 prompt "Old style AMD Opteron NUMA detection"
@@ -1302,7 +1239,6 @@ config NODES_SHIFT
1302 range 1 10 1239 range 1 10
1303 default "10" if MAXSMP 1240 default "10" if MAXSMP
1304 default "6" if X86_64 1241 default "6" if X86_64
1305 default "4" if X86_NUMAQ
1306 default "3" 1242 default "3"
1307 depends on NEED_MULTIPLE_NODES 1243 depends on NEED_MULTIPLE_NODES
1308 ---help--- 1244 ---help---
@@ -1850,17 +1786,29 @@ config DEBUG_HOTPLUG_CPU0
1850 If unsure, say N. 1786 If unsure, say N.
1851 1787
1852config COMPAT_VDSO 1788config COMPAT_VDSO
1853 def_bool y 1789 def_bool n
1854 prompt "Compat VDSO support" 1790 prompt "Disable the 32-bit vDSO (needed for glibc 2.3.3)"
1855 depends on X86_32 || IA32_EMULATION 1791 depends on X86_32 || IA32_EMULATION
1856 ---help--- 1792 ---help---
1857 Map the 32-bit VDSO to the predictable old-style address too. 1793 Certain buggy versions of glibc will crash if they are
1794 presented with a 32-bit vDSO that is not mapped at the address
1795 indicated in its segment table.
1858 1796
1859 Say N here if you are running a sufficiently recent glibc 1797 The bug was introduced by f866314b89d56845f55e6f365e18b31ec978ec3a
1860 version (2.3.3 or later), to remove the high-mapped 1798 and fixed by 3b3ddb4f7db98ec9e912ccdf54d35df4aa30e04a and
1861 VDSO mapping and to exclusively use the randomized VDSO. 1799 49ad572a70b8aeb91e57483a11dd1b77e31c4468. Glibc 2.3.3 is
1800 the only released version with the bug, but OpenSUSE 9
1801 contains a buggy "glibc 2.3.2".
1862 1802
1863 If unsure, say Y. 1803 The symptom of the bug is that everything crashes on startup, saying:
1804 dl_main: Assertion `(void *) ph->p_vaddr == _rtld_local._dl_sysinfo_dso' failed!
1805
1806 Saying Y here changes the default value of the vdso32 boot
1807 option from 1 to 0, which turns off the 32-bit vDSO entirely.
1808 This works around the glibc bug but hurts performance.
1809
1810 If unsure, say N: if you are compiling your own kernel, you
1811 are unlikely to be using a buggy version of glibc.
1864 1812
1865config CMDLINE_BOOL 1813config CMDLINE_BOOL
1866 bool "Built-in kernel command line" 1814 bool "Built-in kernel command line"
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index f3aaf231b4e5..6983314c8b37 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -359,7 +359,7 @@ config X86_P6_NOP
359 359
360config X86_TSC 360config X86_TSC
361 def_bool y 361 def_bool y
362 depends on ((MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2 || MATOM) && !X86_NUMAQ) || X86_64 362 depends on (MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2 || MATOM) || X86_64
363 363
364config X86_CMPXCHG64 364config X86_CMPXCHG64
365 def_bool y 365 def_bool y
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 3b9348a0c1a4..602f57e590b5 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -108,7 +108,7 @@ else
108 108
109 # this works around some issues with generating unwind tables in older gccs 109 # this works around some issues with generating unwind tables in older gccs
110 # newer gccs do it by default 110 # newer gccs do it by default
111 KBUILD_CFLAGS += -maccumulate-outgoing-args 111 KBUILD_CFLAGS += $(call cc-option,-maccumulate-outgoing-args)
112endif 112endif
113 113
114# Make sure compiler does not have buggy stack-protector support. 114# Make sure compiler does not have buggy stack-protector support.
diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h
index 50f8c5e0f37e..bd49ec61255c 100644
--- a/arch/x86/boot/boot.h
+++ b/arch/x86/boot/boot.h
@@ -177,14 +177,6 @@ static inline void wrgs32(u32 v, addr_t addr)
177} 177}
178 178
179/* Note: these only return true/false, not a signed return value! */ 179/* Note: these only return true/false, not a signed return value! */
180static inline int memcmp(const void *s1, const void *s2, size_t len)
181{
182 u8 diff;
183 asm("repe; cmpsb; setnz %0"
184 : "=qm" (diff), "+D" (s1), "+S" (s2), "+c" (len));
185 return diff;
186}
187
188static inline int memcmp_fs(const void *s1, addr_t s2, size_t len) 180static inline int memcmp_fs(const void *s1, addr_t s2, size_t len)
189{ 181{
190 u8 diff; 182 u8 diff;
@@ -228,11 +220,6 @@ void copy_to_fs(addr_t dst, void *src, size_t len);
228void *copy_from_fs(void *dst, addr_t src, size_t len); 220void *copy_from_fs(void *dst, addr_t src, size_t len);
229void copy_to_gs(addr_t dst, void *src, size_t len); 221void copy_to_gs(addr_t dst, void *src, size_t len);
230void *copy_from_gs(void *dst, addr_t src, size_t len); 222void *copy_from_gs(void *dst, addr_t src, size_t len);
231void *memcpy(void *dst, void *src, size_t len);
232void *memset(void *dst, int c, size_t len);
233
234#define memcpy(d,s,l) __builtin_memcpy(d,s,l)
235#define memset(d,c,l) __builtin_memset(d,c,l)
236 223
237/* a20.c */ 224/* a20.c */
238int enable_a20(void); 225int enable_a20(void);
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index 1e6146137f8e..4703a6c4b8e3 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -112,7 +112,7 @@ __file_size64(void *__fh, efi_char16_t *filename_16,
112 efi_file_info_t *info; 112 efi_file_info_t *info;
113 efi_status_t status; 113 efi_status_t status;
114 efi_guid_t info_guid = EFI_FILE_INFO_ID; 114 efi_guid_t info_guid = EFI_FILE_INFO_ID;
115 u32 info_sz; 115 u64 info_sz;
116 116
117 status = efi_early->call((unsigned long)fh->open, fh, &h, filename_16, 117 status = efi_early->call((unsigned long)fh->open, fh, &h, filename_16,
118 EFI_FILE_MODE_READ, (u64)0); 118 EFI_FILE_MODE_READ, (u64)0);
@@ -167,31 +167,31 @@ efi_file_size(efi_system_table_t *sys_table, void *__fh,
167} 167}
168 168
169static inline efi_status_t 169static inline efi_status_t
170efi_file_read(void *__fh, void *handle, unsigned long *size, void *addr) 170efi_file_read(void *handle, unsigned long *size, void *addr)
171{ 171{
172 unsigned long func; 172 unsigned long func;
173 173
174 if (efi_early->is64) { 174 if (efi_early->is64) {
175 efi_file_handle_64_t *fh = __fh; 175 efi_file_handle_64_t *fh = handle;
176 176
177 func = (unsigned long)fh->read; 177 func = (unsigned long)fh->read;
178 return efi_early->call(func, handle, size, addr); 178 return efi_early->call(func, handle, size, addr);
179 } else { 179 } else {
180 efi_file_handle_32_t *fh = __fh; 180 efi_file_handle_32_t *fh = handle;
181 181
182 func = (unsigned long)fh->read; 182 func = (unsigned long)fh->read;
183 return efi_early->call(func, handle, size, addr); 183 return efi_early->call(func, handle, size, addr);
184 } 184 }
185} 185}
186 186
187static inline efi_status_t efi_file_close(void *__fh, void *handle) 187static inline efi_status_t efi_file_close(void *handle)
188{ 188{
189 if (efi_early->is64) { 189 if (efi_early->is64) {
190 efi_file_handle_64_t *fh = __fh; 190 efi_file_handle_64_t *fh = handle;
191 191
192 return efi_early->call((unsigned long)fh->close, handle); 192 return efi_early->call((unsigned long)fh->close, handle);
193 } else { 193 } else {
194 efi_file_handle_32_t *fh = __fh; 194 efi_file_handle_32_t *fh = handle;
195 195
196 return efi_early->call((unsigned long)fh->close, handle); 196 return efi_early->call((unsigned long)fh->close, handle);
197 } 197 }
@@ -1016,6 +1016,9 @@ void setup_graphics(struct boot_params *boot_params)
1016 * Because the x86 boot code expects to be passed a boot_params we 1016 * Because the x86 boot code expects to be passed a boot_params we
1017 * need to create one ourselves (usually the bootloader would create 1017 * need to create one ourselves (usually the bootloader would create
1018 * one for us). 1018 * one for us).
1019 *
1020 * The caller is responsible for filling out ->code32_start in the
1021 * returned boot_params.
1019 */ 1022 */
1020struct boot_params *make_boot_params(struct efi_config *c) 1023struct boot_params *make_boot_params(struct efi_config *c)
1021{ 1024{
@@ -1081,8 +1084,6 @@ struct boot_params *make_boot_params(struct efi_config *c)
1081 hdr->vid_mode = 0xffff; 1084 hdr->vid_mode = 0xffff;
1082 hdr->boot_flag = 0xAA55; 1085 hdr->boot_flag = 0xAA55;
1083 1086
1084 hdr->code32_start = (__u64)(unsigned long)image->image_base;
1085
1086 hdr->type_of_loader = 0x21; 1087 hdr->type_of_loader = 0x21;
1087 1088
1088 /* Convert unicode cmdline to ascii */ 1089 /* Convert unicode cmdline to ascii */
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
index de9d4200d305..cbed1407a5cd 100644
--- a/arch/x86/boot/compressed/head_32.S
+++ b/arch/x86/boot/compressed/head_32.S
@@ -59,6 +59,7 @@ ENTRY(efi_pe_entry)
59 call make_boot_params 59 call make_boot_params
60 cmpl $0, %eax 60 cmpl $0, %eax
61 je fail 61 je fail
62 movl %esi, BP_code32_start(%eax)
62 popl %ecx 63 popl %ecx
63 pushl %eax 64 pushl %eax
64 pushl %ecx 65 pushl %ecx
@@ -90,12 +91,7 @@ fail:
90 hlt 91 hlt
91 jmp fail 92 jmp fail
922: 932:
93 call 3f 94 movl BP_code32_start(%esi), %eax
943:
95 popl %eax
96 subl $3b, %eax
97 subl BP_pref_address(%esi), %eax
98 add BP_code32_start(%esi), %eax
99 leal preferred_addr(%eax), %eax 95 leal preferred_addr(%eax), %eax
100 jmp *%eax 96 jmp *%eax
101 97
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index 57e58a5fa210..0d558ee899ae 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -261,6 +261,8 @@ ENTRY(efi_pe_entry)
261 cmpq $0,%rax 261 cmpq $0,%rax
262 je fail 262 je fail
263 mov %rax, %rsi 263 mov %rax, %rsi
264 leaq startup_32(%rip), %rax
265 movl %eax, BP_code32_start(%rsi)
264 jmp 2f /* Skip the relocation */ 266 jmp 2f /* Skip the relocation */
265 267
266handover_entry: 268handover_entry:
@@ -284,12 +286,7 @@ fail:
284 hlt 286 hlt
285 jmp fail 287 jmp fail
2862: 2882:
287 call 3f 289 movl BP_code32_start(%esi), %eax
2883:
289 popq %rax
290 subq $3b, %rax
291 subq BP_pref_address(%rsi), %rax
292 add BP_code32_start(%esi), %eax
293 leaq preferred_addr(%rax), %rax 290 leaq preferred_addr(%rax), %rax
294 jmp *%rax 291 jmp *%rax
295 292
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index 196eaf373a06..17684615374b 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -10,6 +10,7 @@
10 */ 10 */
11 11
12#include "misc.h" 12#include "misc.h"
13#include "../string.h"
13 14
14/* WARNING!! 15/* WARNING!!
15 * This code is compiled with -fPIC and it is relocated dynamically 16 * This code is compiled with -fPIC and it is relocated dynamically
@@ -97,8 +98,14 @@
97 */ 98 */
98#define STATIC static 99#define STATIC static
99 100
100#undef memset
101#undef memcpy 101#undef memcpy
102
103/*
104 * Use a normal definition of memset() from string.c. There are already
105 * included header files which expect a definition of memset() and by
106 * the time we define memset macro, it is too late.
107 */
108#undef memset
102#define memzero(s, n) memset((s), 0, (n)) 109#define memzero(s, n) memset((s), 0, (n))
103 110
104 111
@@ -109,9 +116,6 @@ static void error(char *m);
109 */ 116 */
110struct boot_params *real_mode; /* Pointer to real-mode data */ 117struct boot_params *real_mode; /* Pointer to real-mode data */
111 118
112void *memset(void *s, int c, size_t n);
113void *memcpy(void *dest, const void *src, size_t n);
114
115memptr free_mem_ptr; 119memptr free_mem_ptr;
116memptr free_mem_end_ptr; 120memptr free_mem_end_ptr;
117 121
@@ -216,45 +220,6 @@ void __putstr(const char *s)
216 outb(0xff & (pos >> 1), vidport+1); 220 outb(0xff & (pos >> 1), vidport+1);
217} 221}
218 222
219void *memset(void *s, int c, size_t n)
220{
221 int i;
222 char *ss = s;
223
224 for (i = 0; i < n; i++)
225 ss[i] = c;
226 return s;
227}
228#ifdef CONFIG_X86_32
229void *memcpy(void *dest, const void *src, size_t n)
230{
231 int d0, d1, d2;
232 asm volatile(
233 "rep ; movsl\n\t"
234 "movl %4,%%ecx\n\t"
235 "rep ; movsb\n\t"
236 : "=&c" (d0), "=&D" (d1), "=&S" (d2)
237 : "0" (n >> 2), "g" (n & 3), "1" (dest), "2" (src)
238 : "memory");
239
240 return dest;
241}
242#else
243void *memcpy(void *dest, const void *src, size_t n)
244{
245 long d0, d1, d2;
246 asm volatile(
247 "rep ; movsq\n\t"
248 "movq %4,%%rcx\n\t"
249 "rep ; movsb\n\t"
250 : "=&c" (d0), "=&D" (d1), "=&S" (d2)
251 : "0" (n >> 3), "g" (n & 7), "1" (dest), "2" (src)
252 : "memory");
253
254 return dest;
255}
256#endif
257
258static void error(char *x) 223static void error(char *x)
259{ 224{
260 error_putstr("\n\n"); 225 error_putstr("\n\n");
diff --git a/arch/x86/boot/compressed/string.c b/arch/x86/boot/compressed/string.c
index ffb9c5c9d748..f3c57e341402 100644
--- a/arch/x86/boot/compressed/string.c
+++ b/arch/x86/boot/compressed/string.c
@@ -1,11 +1,45 @@
1#include "misc.h" 1#include "misc.h"
2#include "../string.c"
3
4/* misc.h might pull in string_32.h which has a macro for memcpy. undef that */
5#undef memcpy
2 6
3int memcmp(const void *s1, const void *s2, size_t len) 7#ifdef CONFIG_X86_32
8void *memcpy(void *dest, const void *src, size_t n)
4{ 9{
5 u8 diff; 10 int d0, d1, d2;
6 asm("repe; cmpsb; setnz %0" 11 asm volatile(
7 : "=qm" (diff), "+D" (s1), "+S" (s2), "+c" (len)); 12 "rep ; movsl\n\t"
8 return diff; 13 "movl %4,%%ecx\n\t"
14 "rep ; movsb\n\t"
15 : "=&c" (d0), "=&D" (d1), "=&S" (d2)
16 : "0" (n >> 2), "g" (n & 3), "1" (dest), "2" (src)
17 : "memory");
18
19 return dest;
9} 20}
21#else
22void *memcpy(void *dest, const void *src, size_t n)
23{
24 long d0, d1, d2;
25 asm volatile(
26 "rep ; movsq\n\t"
27 "movq %4,%%rcx\n\t"
28 "rep ; movsb\n\t"
29 : "=&c" (d0), "=&D" (d1), "=&S" (d2)
30 : "0" (n >> 3), "g" (n & 7), "1" (dest), "2" (src)
31 : "memory");
10 32
11#include "../string.c" 33 return dest;
34}
35#endif
36
37void *memset(void *s, int c, size_t n)
38{
39 int i;
40 char *ss = s;
41
42 for (i = 0; i < n; i++)
43 ss[i] = c;
44 return s;
45}
diff --git a/arch/x86/boot/cpucheck.c b/arch/x86/boot/cpucheck.c
index f0d0b20fe149..1fd7d575092e 100644
--- a/arch/x86/boot/cpucheck.c
+++ b/arch/x86/boot/cpucheck.c
@@ -27,6 +27,7 @@
27#include <asm/processor-flags.h> 27#include <asm/processor-flags.h>
28#include <asm/required-features.h> 28#include <asm/required-features.h>
29#include <asm/msr-index.h> 29#include <asm/msr-index.h>
30#include "string.h"
30 31
31static u32 err_flags[NCAPINTS]; 32static u32 err_flags[NCAPINTS];
32 33
diff --git a/arch/x86/boot/edd.c b/arch/x86/boot/edd.c
index c501a5b466f8..223e42527077 100644
--- a/arch/x86/boot/edd.c
+++ b/arch/x86/boot/edd.c
@@ -15,6 +15,7 @@
15 15
16#include "boot.h" 16#include "boot.h"
17#include <linux/edd.h> 17#include <linux/edd.h>
18#include "string.h"
18 19
19#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE) 20#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
20 21
diff --git a/arch/x86/boot/main.c b/arch/x86/boot/main.c
index cf6083d444f4..fd6c9f236996 100644
--- a/arch/x86/boot/main.c
+++ b/arch/x86/boot/main.c
@@ -14,6 +14,7 @@
14 */ 14 */
15 15
16#include "boot.h" 16#include "boot.h"
17#include "string.h"
17 18
18struct boot_params boot_params __attribute__((aligned(16))); 19struct boot_params boot_params __attribute__((aligned(16)));
19 20
diff --git a/arch/x86/boot/regs.c b/arch/x86/boot/regs.c
index 958019b1cfa5..c0fb356a3092 100644
--- a/arch/x86/boot/regs.c
+++ b/arch/x86/boot/regs.c
@@ -17,6 +17,7 @@
17 */ 17 */
18 18
19#include "boot.h" 19#include "boot.h"
20#include "string.h"
20 21
21void initregs(struct biosregs *reg) 22void initregs(struct biosregs *reg)
22{ 23{
diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index 574dedfe2890..5339040ef86e 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -14,6 +14,20 @@
14 14
15#include "boot.h" 15#include "boot.h"
16 16
17/*
18 * This file gets included in compressed/string.c which might pull in
19 * string_32.h and which in turn maps memcmp to __builtin_memcmp(). Undo
20 * that first.
21 */
22#undef memcmp
23int memcmp(const void *s1, const void *s2, size_t len)
24{
25 u8 diff;
26 asm("repe; cmpsb; setnz %0"
27 : "=qm" (diff), "+D" (s1), "+S" (s2), "+c" (len));
28 return diff;
29}
30
17int strcmp(const char *str1, const char *str2) 31int strcmp(const char *str1, const char *str2)
18{ 32{
19 const unsigned char *s1 = (const unsigned char *)str1; 33 const unsigned char *s1 = (const unsigned char *)str1;
diff --git a/arch/x86/boot/string.h b/arch/x86/boot/string.h
new file mode 100644
index 000000000000..725e820602b1
--- /dev/null
+++ b/arch/x86/boot/string.h
@@ -0,0 +1,21 @@
1#ifndef BOOT_STRING_H
2#define BOOT_STRING_H
3
4/* Undef any of these macros coming from string_32.h. */
5#undef memcpy
6#undef memset
7#undef memcmp
8
9void *memcpy(void *dst, const void *src, size_t len);
10void *memset(void *dst, int c, size_t len);
11int memcmp(const void *s1, const void *s2, size_t len);
12
13/*
14 * Access builtin version by default. If one needs to use optimized version,
15 * do "undef memcpy" in .c file and link against right string.c
16 */
17#define memcpy(d,s,l) __builtin_memcpy(d,s,l)
18#define memset(d,c,l) __builtin_memset(d,c,l)
19#define memcmp __builtin_memcmp
20
21#endif /* BOOT_STRING_H */
diff --git a/arch/x86/boot/video-vesa.c b/arch/x86/boot/video-vesa.c
index 11e8c6eb80a1..ba3e100654db 100644
--- a/arch/x86/boot/video-vesa.c
+++ b/arch/x86/boot/video-vesa.c
@@ -16,6 +16,7 @@
16#include "boot.h" 16#include "boot.h"
17#include "video.h" 17#include "video.h"
18#include "vesa.h" 18#include "vesa.h"
19#include "string.h"
19 20
20/* VESA information */ 21/* VESA information */
21static struct vesa_general_info vginfo; 22static struct vesa_general_info vginfo;
diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig
index a7fef2621cc9..619e7f7426c6 100644
--- a/arch/x86/configs/i386_defconfig
+++ b/arch/x86/configs/i386_defconfig
@@ -60,7 +60,6 @@ CONFIG_CRASH_DUMP=y
60CONFIG_HIBERNATION=y 60CONFIG_HIBERNATION=y
61CONFIG_PM_DEBUG=y 61CONFIG_PM_DEBUG=y
62CONFIG_PM_TRACE_RTC=y 62CONFIG_PM_TRACE_RTC=y
63CONFIG_ACPI_PROCFS=y
64CONFIG_ACPI_DOCK=y 63CONFIG_ACPI_DOCK=y
65CONFIG_CPU_FREQ=y 64CONFIG_CPU_FREQ=y
66# CONFIG_CPU_FREQ_STAT is not set 65# CONFIG_CPU_FREQ_STAT is not set
diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig
index c1119d4c1281..6181c69b786b 100644
--- a/arch/x86/configs/x86_64_defconfig
+++ b/arch/x86/configs/x86_64_defconfig
@@ -58,7 +58,6 @@ CONFIG_CRASH_DUMP=y
58CONFIG_HIBERNATION=y 58CONFIG_HIBERNATION=y
59CONFIG_PM_DEBUG=y 59CONFIG_PM_DEBUG=y
60CONFIG_PM_TRACE_RTC=y 60CONFIG_PM_TRACE_RTC=y
61CONFIG_ACPI_PROCFS=y
62CONFIG_ACPI_DOCK=y 61CONFIG_ACPI_DOCK=y
63CONFIG_CPU_FREQ=y 62CONFIG_CPU_FREQ=y
64# CONFIG_CPU_FREQ_STAT is not set 63# CONFIG_CPU_FREQ_STAT is not set
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
index 6ba54d640383..61d6e281898b 100644
--- a/arch/x86/crypto/Makefile
+++ b/arch/x86/crypto/Makefile
@@ -79,6 +79,9 @@ aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o fpu.o
79aesni-intel-$(CONFIG_64BIT) += aesni-intel_avx-x86_64.o 79aesni-intel-$(CONFIG_64BIT) += aesni-intel_avx-x86_64.o
80ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o 80ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o
81sha1-ssse3-y := sha1_ssse3_asm.o sha1_ssse3_glue.o 81sha1-ssse3-y := sha1_ssse3_asm.o sha1_ssse3_glue.o
82ifeq ($(avx2_supported),yes)
83sha1-ssse3-y += sha1_avx2_x86_64_asm.o
84endif
82crc32c-intel-y := crc32c-intel_glue.o 85crc32c-intel-y := crc32c-intel_glue.o
83crc32c-intel-$(CONFIG_64BIT) += crc32c-pcl-intel-asm_64.o 86crc32c-intel-$(CONFIG_64BIT) += crc32c-pcl-intel-asm_64.o
84crc32-pclmul-y := crc32-pclmul_asm.o crc32-pclmul_glue.o 87crc32-pclmul-y := crc32-pclmul_asm.o crc32-pclmul_glue.o
diff --git a/arch/x86/crypto/blowfish_glue.c b/arch/x86/crypto/blowfish_glue.c
index 50ec333b70e6..8af519ed73d1 100644
--- a/arch/x86/crypto/blowfish_glue.c
+++ b/arch/x86/crypto/blowfish_glue.c
@@ -223,9 +223,6 @@ static unsigned int __cbc_decrypt(struct blkcipher_desc *desc,
223 src -= 1; 223 src -= 1;
224 dst -= 1; 224 dst -= 1;
225 } while (nbytes >= bsize * 4); 225 } while (nbytes >= bsize * 4);
226
227 if (nbytes < bsize)
228 goto done;
229 } 226 }
230 227
231 /* Handle leftovers */ 228 /* Handle leftovers */
diff --git a/arch/x86/crypto/cast5_avx_glue.c b/arch/x86/crypto/cast5_avx_glue.c
index e6a3700489b9..e57e20ab5e0b 100644
--- a/arch/x86/crypto/cast5_avx_glue.c
+++ b/arch/x86/crypto/cast5_avx_glue.c
@@ -203,9 +203,6 @@ static unsigned int __cbc_decrypt(struct blkcipher_desc *desc,
203 src -= 1; 203 src -= 1;
204 dst -= 1; 204 dst -= 1;
205 } while (nbytes >= bsize * CAST5_PARALLEL_BLOCKS); 205 } while (nbytes >= bsize * CAST5_PARALLEL_BLOCKS);
206
207 if (nbytes < bsize)
208 goto done;
209 } 206 }
210 207
211 /* Handle leftovers */ 208 /* Handle leftovers */
diff --git a/arch/x86/crypto/ghash-clmulni-intel_asm.S b/arch/x86/crypto/ghash-clmulni-intel_asm.S
index 586f41aac361..185fad49d86f 100644
--- a/arch/x86/crypto/ghash-clmulni-intel_asm.S
+++ b/arch/x86/crypto/ghash-clmulni-intel_asm.S
@@ -24,10 +24,6 @@
24.align 16 24.align 16
25.Lbswap_mask: 25.Lbswap_mask:
26 .octa 0x000102030405060708090a0b0c0d0e0f 26 .octa 0x000102030405060708090a0b0c0d0e0f
27.Lpoly:
28 .octa 0xc2000000000000000000000000000001
29.Ltwo_one:
30 .octa 0x00000001000000000000000000000001
31 27
32#define DATA %xmm0 28#define DATA %xmm0
33#define SHASH %xmm1 29#define SHASH %xmm1
@@ -134,28 +130,3 @@ ENTRY(clmul_ghash_update)
134.Lupdate_just_ret: 130.Lupdate_just_ret:
135 ret 131 ret
136ENDPROC(clmul_ghash_update) 132ENDPROC(clmul_ghash_update)
137
138/*
139 * void clmul_ghash_setkey(be128 *shash, const u8 *key);
140 *
141 * Calculate hash_key << 1 mod poly
142 */
143ENTRY(clmul_ghash_setkey)
144 movaps .Lbswap_mask, BSWAP
145 movups (%rsi), %xmm0
146 PSHUFB_XMM BSWAP %xmm0
147 movaps %xmm0, %xmm1
148 psllq $1, %xmm0
149 psrlq $63, %xmm1
150 movaps %xmm1, %xmm2
151 pslldq $8, %xmm1
152 psrldq $8, %xmm2
153 por %xmm1, %xmm0
154 # reduction
155 pshufd $0b00100100, %xmm2, %xmm1
156 pcmpeqd .Ltwo_one, %xmm1
157 pand .Lpoly, %xmm1
158 pxor %xmm1, %xmm0
159 movups %xmm0, (%rdi)
160 ret
161ENDPROC(clmul_ghash_setkey)
diff --git a/arch/x86/crypto/ghash-clmulni-intel_glue.c b/arch/x86/crypto/ghash-clmulni-intel_glue.c
index 6759dd1135be..d785cf2c529c 100644
--- a/arch/x86/crypto/ghash-clmulni-intel_glue.c
+++ b/arch/x86/crypto/ghash-clmulni-intel_glue.c
@@ -30,8 +30,6 @@ void clmul_ghash_mul(char *dst, const be128 *shash);
30void clmul_ghash_update(char *dst, const char *src, unsigned int srclen, 30void clmul_ghash_update(char *dst, const char *src, unsigned int srclen,
31 const be128 *shash); 31 const be128 *shash);
32 32
33void clmul_ghash_setkey(be128 *shash, const u8 *key);
34
35struct ghash_async_ctx { 33struct ghash_async_ctx {
36 struct cryptd_ahash *cryptd_tfm; 34 struct cryptd_ahash *cryptd_tfm;
37}; 35};
@@ -58,13 +56,23 @@ static int ghash_setkey(struct crypto_shash *tfm,
58 const u8 *key, unsigned int keylen) 56 const u8 *key, unsigned int keylen)
59{ 57{
60 struct ghash_ctx *ctx = crypto_shash_ctx(tfm); 58 struct ghash_ctx *ctx = crypto_shash_ctx(tfm);
59 be128 *x = (be128 *)key;
60 u64 a, b;
61 61
62 if (keylen != GHASH_BLOCK_SIZE) { 62 if (keylen != GHASH_BLOCK_SIZE) {
63 crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); 63 crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
64 return -EINVAL; 64 return -EINVAL;
65 } 65 }
66 66
67 clmul_ghash_setkey(&ctx->shash, key); 67 /* perform multiplication by 'x' in GF(2^128) */
68 a = be64_to_cpu(x->a);
69 b = be64_to_cpu(x->b);
70
71 ctx->shash.a = (__be64)((b << 1) | (a >> 63));
72 ctx->shash.b = (__be64)((a << 1) | (b >> 63));
73
74 if (a >> 63)
75 ctx->shash.b ^= cpu_to_be64(0xc2);
68 76
69 return 0; 77 return 0;
70} 78}
diff --git a/arch/x86/crypto/sha1_avx2_x86_64_asm.S b/arch/x86/crypto/sha1_avx2_x86_64_asm.S
new file mode 100644
index 000000000000..1cd792db15ef
--- /dev/null
+++ b/arch/x86/crypto/sha1_avx2_x86_64_asm.S
@@ -0,0 +1,708 @@
1/*
2 * Implement fast SHA-1 with AVX2 instructions. (x86_64)
3 *
4 * This file is provided under a dual BSD/GPLv2 license. When using or
5 * redistributing this file, you may do so under either license.
6 *
7 * GPL LICENSE SUMMARY
8 *
9 * Copyright(c) 2014 Intel Corporation.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as
13 * published by the Free Software Foundation.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * Contact Information:
21 * Ilya Albrekht <ilya.albrekht@intel.com>
22 * Maxim Locktyukhin <maxim.locktyukhin@intel.com>
23 * Ronen Zohar <ronen.zohar@intel.com>
24 * Chandramouli Narayanan <mouli@linux.intel.com>
25 *
26 * BSD LICENSE
27 *
28 * Copyright(c) 2014 Intel Corporation.
29 *
30 * Redistribution and use in source and binary forms, with or without
31 * modification, are permitted provided that the following conditions
32 * are met:
33 *
34 * Redistributions of source code must retain the above copyright
35 * notice, this list of conditions and the following disclaimer.
36 * Redistributions in binary form must reproduce the above copyright
37 * notice, this list of conditions and the following disclaimer in
38 * the documentation and/or other materials provided with the
39 * distribution.
40 * Neither the name of Intel Corporation nor the names of its
41 * contributors may be used to endorse or promote products derived
42 * from this software without specific prior written permission.
43 *
44 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
45 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
46 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
47 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
48 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
49 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
50 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
51 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
52 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
53 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
54 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55 *
56 */
57
58/*
59 * SHA-1 implementation with Intel(R) AVX2 instruction set extensions.
60 *
61 *This implementation is based on the previous SSSE3 release:
62 *Visit http://software.intel.com/en-us/articles/
63 *and refer to improving-the-performance-of-the-secure-hash-algorithm-1/
64 *
65 *Updates 20-byte SHA-1 record in 'hash' for even number of
66 *'num_blocks' consecutive 64-byte blocks
67 *
68 *extern "C" void sha1_transform_avx2(
69 * int *hash, const char* input, size_t num_blocks );
70 */
71
72#include <linux/linkage.h>
73
74#define CTX %rdi /* arg1 */
75#define BUF %rsi /* arg2 */
76#define CNT %rdx /* arg3 */
77
78#define REG_A %ecx
79#define REG_B %esi
80#define REG_C %edi
81#define REG_D %eax
82#define REG_E %edx
83#define REG_TB %ebx
84#define REG_TA %r12d
85#define REG_RA %rcx
86#define REG_RB %rsi
87#define REG_RC %rdi
88#define REG_RD %rax
89#define REG_RE %rdx
90#define REG_RTA %r12
91#define REG_RTB %rbx
92#define REG_T1 %ebp
93#define xmm_mov vmovups
94#define avx2_zeroupper vzeroupper
95#define RND_F1 1
96#define RND_F2 2
97#define RND_F3 3
98
99.macro REGALLOC
100 .set A, REG_A
101 .set B, REG_B
102 .set C, REG_C
103 .set D, REG_D
104 .set E, REG_E
105 .set TB, REG_TB
106 .set TA, REG_TA
107
108 .set RA, REG_RA
109 .set RB, REG_RB
110 .set RC, REG_RC
111 .set RD, REG_RD
112 .set RE, REG_RE
113
114 .set RTA, REG_RTA
115 .set RTB, REG_RTB
116
117 .set T1, REG_T1
118.endm
119
120#define K_BASE %r8
121#define HASH_PTR %r9
122#define BUFFER_PTR %r10
123#define BUFFER_PTR2 %r13
124#define BUFFER_END %r11
125
126#define PRECALC_BUF %r14
127#define WK_BUF %r15
128
129#define W_TMP %xmm0
130#define WY_TMP %ymm0
131#define WY_TMP2 %ymm9
132
133# AVX2 variables
134#define WY0 %ymm3
135#define WY4 %ymm5
136#define WY08 %ymm7
137#define WY12 %ymm8
138#define WY16 %ymm12
139#define WY20 %ymm13
140#define WY24 %ymm14
141#define WY28 %ymm15
142
143#define YMM_SHUFB_BSWAP %ymm10
144
145/*
146 * Keep 2 iterations precalculated at a time:
147 * - 80 DWORDs per iteration * 2
148 */
149#define W_SIZE (80*2*2 +16)
150
151#define WK(t) ((((t) % 80) / 4)*32 + ( (t) % 4)*4 + ((t)/80)*16 )(WK_BUF)
152#define PRECALC_WK(t) ((t)*2*2)(PRECALC_BUF)
153
154
155.macro UPDATE_HASH hash, val
156 add \hash, \val
157 mov \val, \hash
158.endm
159
160.macro PRECALC_RESET_WY
161 .set WY_00, WY0
162 .set WY_04, WY4
163 .set WY_08, WY08
164 .set WY_12, WY12
165 .set WY_16, WY16
166 .set WY_20, WY20
167 .set WY_24, WY24
168 .set WY_28, WY28
169 .set WY_32, WY_00
170.endm
171
172.macro PRECALC_ROTATE_WY
173 /* Rotate macros */
174 .set WY_32, WY_28
175 .set WY_28, WY_24
176 .set WY_24, WY_20
177 .set WY_20, WY_16
178 .set WY_16, WY_12
179 .set WY_12, WY_08
180 .set WY_08, WY_04
181 .set WY_04, WY_00
182 .set WY_00, WY_32
183
184 /* Define register aliases */
185 .set WY, WY_00
186 .set WY_minus_04, WY_04
187 .set WY_minus_08, WY_08
188 .set WY_minus_12, WY_12
189 .set WY_minus_16, WY_16
190 .set WY_minus_20, WY_20
191 .set WY_minus_24, WY_24
192 .set WY_minus_28, WY_28
193 .set WY_minus_32, WY
194.endm
195
196.macro PRECALC_00_15
197 .if (i == 0) # Initialize and rotate registers
198 PRECALC_RESET_WY
199 PRECALC_ROTATE_WY
200 .endif
201
202 /* message scheduling pre-compute for rounds 0-15 */
203 .if ((i & 7) == 0)
204 /*
205 * blended AVX2 and ALU instruction scheduling
206 * 1 vector iteration per 8 rounds
207 */
208 vmovdqu ((i * 2) + PRECALC_OFFSET)(BUFFER_PTR), W_TMP
209 .elseif ((i & 7) == 1)
210 vinsertf128 $1, (((i-1) * 2)+PRECALC_OFFSET)(BUFFER_PTR2),\
211 WY_TMP, WY_TMP
212 .elseif ((i & 7) == 2)
213 vpshufb YMM_SHUFB_BSWAP, WY_TMP, WY
214 .elseif ((i & 7) == 4)
215 vpaddd K_XMM(K_BASE), WY, WY_TMP
216 .elseif ((i & 7) == 7)
217 vmovdqu WY_TMP, PRECALC_WK(i&~7)
218
219 PRECALC_ROTATE_WY
220 .endif
221.endm
222
223.macro PRECALC_16_31
224 /*
225 * message scheduling pre-compute for rounds 16-31
226 * calculating last 32 w[i] values in 8 XMM registers
227 * pre-calculate K+w[i] values and store to mem
228 * for later load by ALU add instruction
229 *
230 * "brute force" vectorization for rounds 16-31 only
231 * due to w[i]->w[i-3] dependency
232 */
233 .if ((i & 7) == 0)
234 /*
235 * blended AVX2 and ALU instruction scheduling
236 * 1 vector iteration per 8 rounds
237 */
238 /* w[i-14] */
239 vpalignr $8, WY_minus_16, WY_minus_12, WY
240 vpsrldq $4, WY_minus_04, WY_TMP /* w[i-3] */
241 .elseif ((i & 7) == 1)
242 vpxor WY_minus_08, WY, WY
243 vpxor WY_minus_16, WY_TMP, WY_TMP
244 .elseif ((i & 7) == 2)
245 vpxor WY_TMP, WY, WY
246 vpslldq $12, WY, WY_TMP2
247 .elseif ((i & 7) == 3)
248 vpslld $1, WY, WY_TMP
249 vpsrld $31, WY, WY
250 .elseif ((i & 7) == 4)
251 vpor WY, WY_TMP, WY_TMP
252 vpslld $2, WY_TMP2, WY
253 .elseif ((i & 7) == 5)
254 vpsrld $30, WY_TMP2, WY_TMP2
255 vpxor WY, WY_TMP, WY_TMP
256 .elseif ((i & 7) == 7)
257 vpxor WY_TMP2, WY_TMP, WY
258 vpaddd K_XMM(K_BASE), WY, WY_TMP
259 vmovdqu WY_TMP, PRECALC_WK(i&~7)
260
261 PRECALC_ROTATE_WY
262 .endif
263.endm
264
265.macro PRECALC_32_79
266 /*
267 * in SHA-1 specification:
268 * w[i] = (w[i-3] ^ w[i-8] ^ w[i-14] ^ w[i-16]) rol 1
269 * instead we do equal:
270 * w[i] = (w[i-6] ^ w[i-16] ^ w[i-28] ^ w[i-32]) rol 2
271 * allows more efficient vectorization
272 * since w[i]=>w[i-3] dependency is broken
273 */
274
275 .if ((i & 7) == 0)
276 /*
277 * blended AVX2 and ALU instruction scheduling
278 * 1 vector iteration per 8 rounds
279 */
280 vpalignr $8, WY_minus_08, WY_minus_04, WY_TMP
281 .elseif ((i & 7) == 1)
282 /* W is W_minus_32 before xor */
283 vpxor WY_minus_28, WY, WY
284 .elseif ((i & 7) == 2)
285 vpxor WY_minus_16, WY_TMP, WY_TMP
286 .elseif ((i & 7) == 3)
287 vpxor WY_TMP, WY, WY
288 .elseif ((i & 7) == 4)
289 vpslld $2, WY, WY_TMP
290 .elseif ((i & 7) == 5)
291 vpsrld $30, WY, WY
292 vpor WY, WY_TMP, WY
293 .elseif ((i & 7) == 7)
294 vpaddd K_XMM(K_BASE), WY, WY_TMP
295 vmovdqu WY_TMP, PRECALC_WK(i&~7)
296
297 PRECALC_ROTATE_WY
298 .endif
299.endm
300
301.macro PRECALC r, s
302 .set i, \r
303
304 .if (i < 40)
305 .set K_XMM, 32*0
306 .elseif (i < 80)
307 .set K_XMM, 32*1
308 .elseif (i < 120)
309 .set K_XMM, 32*2
310 .else
311 .set K_XMM, 32*3
312 .endif
313
314 .if (i<32)
315 PRECALC_00_15 \s
316 .elseif (i<64)
317 PRECALC_16_31 \s
318 .elseif (i < 160)
319 PRECALC_32_79 \s
320 .endif
321.endm
322
323.macro ROTATE_STATE
324 .set T_REG, E
325 .set E, D
326 .set D, C
327 .set C, B
328 .set B, TB
329 .set TB, A
330 .set A, T_REG
331
332 .set T_REG, RE
333 .set RE, RD
334 .set RD, RC
335 .set RC, RB
336 .set RB, RTB
337 .set RTB, RA
338 .set RA, T_REG
339.endm
340
341/* Macro relies on saved ROUND_Fx */
342
343.macro RND_FUN f, r
344 .if (\f == RND_F1)
345 ROUND_F1 \r
346 .elseif (\f == RND_F2)
347 ROUND_F2 \r
348 .elseif (\f == RND_F3)
349 ROUND_F3 \r
350 .endif
351.endm
352
353.macro RR r
354 .set round_id, (\r % 80)
355
356 .if (round_id == 0) /* Precalculate F for first round */
357 .set ROUND_FUNC, RND_F1
358 mov B, TB
359
360 rorx $(32-30), B, B /* b>>>2 */
361 andn D, TB, T1
362 and C, TB
363 xor T1, TB
364 .endif
365
366 RND_FUN ROUND_FUNC, \r
367 ROTATE_STATE
368
369 .if (round_id == 18)
370 .set ROUND_FUNC, RND_F2
371 .elseif (round_id == 38)
372 .set ROUND_FUNC, RND_F3
373 .elseif (round_id == 58)
374 .set ROUND_FUNC, RND_F2
375 .endif
376
377 .set round_id, ( (\r+1) % 80)
378
379 RND_FUN ROUND_FUNC, (\r+1)
380 ROTATE_STATE
381.endm
382
383.macro ROUND_F1 r
384 add WK(\r), E
385
386 andn C, A, T1 /* ~b&d */
387 lea (RE,RTB), E /* Add F from the previous round */
388
389 rorx $(32-5), A, TA /* T2 = A >>> 5 */
390 rorx $(32-30),A, TB /* b>>>2 for next round */
391
392 PRECALC (\r) /* msg scheduling for next 2 blocks */
393
394 /*
395 * Calculate F for the next round
396 * (b & c) ^ andn[b, d]
397 */
398 and B, A /* b&c */
399 xor T1, A /* F1 = (b&c) ^ (~b&d) */
400
401 lea (RE,RTA), E /* E += A >>> 5 */
402.endm
403
404.macro ROUND_F2 r
405 add WK(\r), E
406 lea (RE,RTB), E /* Add F from the previous round */
407
408 /* Calculate F for the next round */
409 rorx $(32-5), A, TA /* T2 = A >>> 5 */
410 .if ((round_id) < 79)
411 rorx $(32-30), A, TB /* b>>>2 for next round */
412 .endif
413 PRECALC (\r) /* msg scheduling for next 2 blocks */
414
415 .if ((round_id) < 79)
416 xor B, A
417 .endif
418
419 add TA, E /* E += A >>> 5 */
420
421 .if ((round_id) < 79)
422 xor C, A
423 .endif
424.endm
425
426.macro ROUND_F3 r
427 add WK(\r), E
428 PRECALC (\r) /* msg scheduling for next 2 blocks */
429
430 lea (RE,RTB), E /* Add F from the previous round */
431
432 mov B, T1
433 or A, T1
434
435 rorx $(32-5), A, TA /* T2 = A >>> 5 */
436 rorx $(32-30), A, TB /* b>>>2 for next round */
437
438 /* Calculate F for the next round
439 * (b and c) or (d and (b or c))
440 */
441 and C, T1
442 and B, A
443 or T1, A
444
445 add TA, E /* E += A >>> 5 */
446
447.endm
448
449/*
450 * macro implements 80 rounds of SHA-1, for multiple blocks with s/w pipelining
451 */
452.macro SHA1_PIPELINED_MAIN_BODY
453
454 REGALLOC
455
456 mov (HASH_PTR), A
457 mov 4(HASH_PTR), B
458 mov 8(HASH_PTR), C
459 mov 12(HASH_PTR), D
460 mov 16(HASH_PTR), E
461
462 mov %rsp, PRECALC_BUF
463 lea (2*4*80+32)(%rsp), WK_BUF
464
465 # Precalc WK for first 2 blocks
466 PRECALC_OFFSET = 0
467 .set i, 0
468 .rept 160
469 PRECALC i
470 .set i, i + 1
471 .endr
472 PRECALC_OFFSET = 128
473 xchg WK_BUF, PRECALC_BUF
474
475 .align 32
476_loop:
477 /*
478 * code loops through more than one block
479 * we use K_BASE value as a signal of a last block,
480 * it is set below by: cmovae BUFFER_PTR, K_BASE
481 */
482 cmp K_BASE, BUFFER_PTR
483 jne _begin
484 .align 32
485 jmp _end
486 .align 32
487_begin:
488
489 /*
490 * Do first block
491 * rounds: 0,2,4,6,8
492 */
493 .set j, 0
494 .rept 5
495 RR j
496 .set j, j+2
497 .endr
498
499 jmp _loop0
500_loop0:
501
502 /*
503 * rounds:
504 * 10,12,14,16,18
505 * 20,22,24,26,28
506 * 30,32,34,36,38
507 * 40,42,44,46,48
508 * 50,52,54,56,58
509 */
510 .rept 25
511 RR j
512 .set j, j+2
513 .endr
514
515 add $(2*64), BUFFER_PTR /* move to next odd-64-byte block */
516 cmp BUFFER_END, BUFFER_PTR /* is current block the last one? */
517 cmovae K_BASE, BUFFER_PTR /* signal the last iteration smartly */
518
519 /*
520 * rounds
521 * 60,62,64,66,68
522 * 70,72,74,76,78
523 */
524 .rept 10
525 RR j
526 .set j, j+2
527 .endr
528
529 UPDATE_HASH (HASH_PTR), A
530 UPDATE_HASH 4(HASH_PTR), TB
531 UPDATE_HASH 8(HASH_PTR), C
532 UPDATE_HASH 12(HASH_PTR), D
533 UPDATE_HASH 16(HASH_PTR), E
534
535 cmp K_BASE, BUFFER_PTR /* is current block the last one? */
536 je _loop
537
538 mov TB, B
539
540 /* Process second block */
541 /*
542 * rounds
543 * 0+80, 2+80, 4+80, 6+80, 8+80
544 * 10+80,12+80,14+80,16+80,18+80
545 */
546
547 .set j, 0
548 .rept 10
549 RR j+80
550 .set j, j+2
551 .endr
552
553 jmp _loop1
554_loop1:
555 /*
556 * rounds
557 * 20+80,22+80,24+80,26+80,28+80
558 * 30+80,32+80,34+80,36+80,38+80
559 */
560 .rept 10
561 RR j+80
562 .set j, j+2
563 .endr
564
565 jmp _loop2
566_loop2:
567
568 /*
569 * rounds
570 * 40+80,42+80,44+80,46+80,48+80
571 * 50+80,52+80,54+80,56+80,58+80
572 */
573 .rept 10
574 RR j+80
575 .set j, j+2
576 .endr
577
578 add $(2*64), BUFFER_PTR2 /* move to next even-64-byte block */
579
580 cmp BUFFER_END, BUFFER_PTR2 /* is current block the last one */
581 cmovae K_BASE, BUFFER_PTR /* signal the last iteration smartly */
582
583 jmp _loop3
584_loop3:
585
586 /*
587 * rounds
588 * 60+80,62+80,64+80,66+80,68+80
589 * 70+80,72+80,74+80,76+80,78+80
590 */
591 .rept 10
592 RR j+80
593 .set j, j+2
594 .endr
595
596 UPDATE_HASH (HASH_PTR), A
597 UPDATE_HASH 4(HASH_PTR), TB
598 UPDATE_HASH 8(HASH_PTR), C
599 UPDATE_HASH 12(HASH_PTR), D
600 UPDATE_HASH 16(HASH_PTR), E
601
602 /* Reset state for AVX2 reg permutation */
603 mov A, TA
604 mov TB, A
605 mov C, TB
606 mov E, C
607 mov D, B
608 mov TA, D
609
610 REGALLOC
611
612 xchg WK_BUF, PRECALC_BUF
613
614 jmp _loop
615
616 .align 32
617 _end:
618
619.endm
620/*
621 * macro implements SHA-1 function's body for several 64-byte blocks
622 * param: function's name
623 */
624.macro SHA1_VECTOR_ASM name
625 ENTRY(\name)
626
627 push %rbx
628 push %rbp
629 push %r12
630 push %r13
631 push %r14
632 push %r15
633
634 RESERVE_STACK = (W_SIZE*4 + 8+24)
635
636 /* Align stack */
637 mov %rsp, %rbx
638 and $~(0x20-1), %rsp
639 push %rbx
640 sub $RESERVE_STACK, %rsp
641
642 avx2_zeroupper
643
644 lea K_XMM_AR(%rip), K_BASE
645
646 mov CTX, HASH_PTR
647 mov BUF, BUFFER_PTR
648 lea 64(BUF), BUFFER_PTR2
649
650 shl $6, CNT /* mul by 64 */
651 add BUF, CNT
652 add $64, CNT
653 mov CNT, BUFFER_END
654
655 cmp BUFFER_END, BUFFER_PTR2
656 cmovae K_BASE, BUFFER_PTR2
657
658 xmm_mov BSWAP_SHUFB_CTL(%rip), YMM_SHUFB_BSWAP
659
660 SHA1_PIPELINED_MAIN_BODY
661
662 avx2_zeroupper
663
664 add $RESERVE_STACK, %rsp
665 pop %rsp
666
667 pop %r15
668 pop %r14
669 pop %r13
670 pop %r12
671 pop %rbp
672 pop %rbx
673
674 ret
675
676 ENDPROC(\name)
677.endm
678
679.section .rodata
680
681#define K1 0x5a827999
682#define K2 0x6ed9eba1
683#define K3 0x8f1bbcdc
684#define K4 0xca62c1d6
685
686.align 128
687K_XMM_AR:
688 .long K1, K1, K1, K1
689 .long K1, K1, K1, K1
690 .long K2, K2, K2, K2
691 .long K2, K2, K2, K2
692 .long K3, K3, K3, K3
693 .long K3, K3, K3, K3
694 .long K4, K4, K4, K4
695 .long K4, K4, K4, K4
696
697BSWAP_SHUFB_CTL:
698 .long 0x00010203
699 .long 0x04050607
700 .long 0x08090a0b
701 .long 0x0c0d0e0f
702 .long 0x00010203
703 .long 0x04050607
704 .long 0x08090a0b
705 .long 0x0c0d0e0f
706.text
707
708SHA1_VECTOR_ASM sha1_transform_avx2
diff --git a/arch/x86/crypto/sha1_ssse3_glue.c b/arch/x86/crypto/sha1_ssse3_glue.c
index 4a11a9d72451..74d16ef707c7 100644
--- a/arch/x86/crypto/sha1_ssse3_glue.c
+++ b/arch/x86/crypto/sha1_ssse3_glue.c
@@ -10,6 +10,7 @@
10 * Copyright (c) Andrew McDonald <andrew@mcdonald.org.uk> 10 * Copyright (c) Andrew McDonald <andrew@mcdonald.org.uk>
11 * Copyright (c) Jean-Francois Dive <jef@linuxbe.org> 11 * Copyright (c) Jean-Francois Dive <jef@linuxbe.org>
12 * Copyright (c) Mathias Krause <minipli@googlemail.com> 12 * Copyright (c) Mathias Krause <minipli@googlemail.com>
13 * Copyright (c) Chandramouli Narayanan <mouli@linux.intel.com>
13 * 14 *
14 * This program is free software; you can redistribute it and/or modify it 15 * This program is free software; you can redistribute it and/or modify it
15 * under the terms of the GNU General Public License as published by the Free 16 * under the terms of the GNU General Public License as published by the Free
@@ -39,6 +40,12 @@ asmlinkage void sha1_transform_ssse3(u32 *digest, const char *data,
39asmlinkage void sha1_transform_avx(u32 *digest, const char *data, 40asmlinkage void sha1_transform_avx(u32 *digest, const char *data,
40 unsigned int rounds); 41 unsigned int rounds);
41#endif 42#endif
43#ifdef CONFIG_AS_AVX2
44#define SHA1_AVX2_BLOCK_OPTSIZE 4 /* optimal 4*64 bytes of SHA1 blocks */
45
46asmlinkage void sha1_transform_avx2(u32 *digest, const char *data,
47 unsigned int rounds);
48#endif
42 49
43static asmlinkage void (*sha1_transform_asm)(u32 *, const char *, unsigned int); 50static asmlinkage void (*sha1_transform_asm)(u32 *, const char *, unsigned int);
44 51
@@ -165,6 +172,18 @@ static int sha1_ssse3_import(struct shash_desc *desc, const void *in)
165 return 0; 172 return 0;
166} 173}
167 174
175#ifdef CONFIG_AS_AVX2
176static void sha1_apply_transform_avx2(u32 *digest, const char *data,
177 unsigned int rounds)
178{
179 /* Select the optimal transform based on data block size */
180 if (rounds >= SHA1_AVX2_BLOCK_OPTSIZE)
181 sha1_transform_avx2(digest, data, rounds);
182 else
183 sha1_transform_avx(digest, data, rounds);
184}
185#endif
186
168static struct shash_alg alg = { 187static struct shash_alg alg = {
169 .digestsize = SHA1_DIGEST_SIZE, 188 .digestsize = SHA1_DIGEST_SIZE,
170 .init = sha1_ssse3_init, 189 .init = sha1_ssse3_init,
@@ -201,27 +220,49 @@ static bool __init avx_usable(void)
201 220
202 return true; 221 return true;
203} 222}
223
224#ifdef CONFIG_AS_AVX2
225static bool __init avx2_usable(void)
226{
227 if (avx_usable() && cpu_has_avx2 && boot_cpu_has(X86_FEATURE_BMI1) &&
228 boot_cpu_has(X86_FEATURE_BMI2))
229 return true;
230
231 return false;
232}
233#endif
204#endif 234#endif
205 235
206static int __init sha1_ssse3_mod_init(void) 236static int __init sha1_ssse3_mod_init(void)
207{ 237{
238 char *algo_name;
239
208 /* test for SSSE3 first */ 240 /* test for SSSE3 first */
209 if (cpu_has_ssse3) 241 if (cpu_has_ssse3) {
210 sha1_transform_asm = sha1_transform_ssse3; 242 sha1_transform_asm = sha1_transform_ssse3;
243 algo_name = "SSSE3";
244 }
211 245
212#ifdef CONFIG_AS_AVX 246#ifdef CONFIG_AS_AVX
213 /* allow AVX to override SSSE3, it's a little faster */ 247 /* allow AVX to override SSSE3, it's a little faster */
214 if (avx_usable()) 248 if (avx_usable()) {
215 sha1_transform_asm = sha1_transform_avx; 249 sha1_transform_asm = sha1_transform_avx;
250 algo_name = "AVX";
251#ifdef CONFIG_AS_AVX2
252 /* allow AVX2 to override AVX, it's a little faster */
253 if (avx2_usable()) {
254 sha1_transform_asm = sha1_apply_transform_avx2;
255 algo_name = "AVX2";
256 }
257#endif
258 }
216#endif 259#endif
217 260
218 if (sha1_transform_asm) { 261 if (sha1_transform_asm) {
219 pr_info("Using %s optimized SHA-1 implementation\n", 262 pr_info("Using %s optimized SHA-1 implementation\n", algo_name);
220 sha1_transform_asm == sha1_transform_ssse3 ? "SSSE3"
221 : "AVX");
222 return crypto_register_shash(&alg); 263 return crypto_register_shash(&alg);
223 } 264 }
224 pr_info("Neither AVX nor SSSE3 is available/usable.\n"); 265 pr_info("Neither AVX nor AVX2 nor SSSE3 is available/usable.\n");
225 266
226 return -ENODEV; 267 return -ENODEV;
227} 268}
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild
index 4acddc43ee0c..3ca9762e1649 100644
--- a/arch/x86/include/asm/Kbuild
+++ b/arch/x86/include/asm/Kbuild
@@ -5,5 +5,6 @@ genhdr-y += unistd_64.h
5genhdr-y += unistd_x32.h 5genhdr-y += unistd_x32.h
6 6
7generic-y += clkdev.h 7generic-y += clkdev.h
8generic-y += early_ioremap.h
8generic-y += cputime.h 9generic-y += cputime.h
9generic-y += mcs_spinlock.h 10generic-y += mcs_spinlock.h
diff --git a/arch/x86/include/asm/archrandom.h b/arch/x86/include/asm/archrandom.h
index e6a92455740e..69f1366f1aa3 100644
--- a/arch/x86/include/asm/archrandom.h
+++ b/arch/x86/include/asm/archrandom.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * This file is part of the Linux kernel. 2 * This file is part of the Linux kernel.
3 * 3 *
4 * Copyright (c) 2011, Intel Corporation 4 * Copyright (c) 2011-2014, Intel Corporation
5 * Authors: Fenghua Yu <fenghua.yu@intel.com>, 5 * Authors: Fenghua Yu <fenghua.yu@intel.com>,
6 * H. Peter Anvin <hpa@linux.intel.com> 6 * H. Peter Anvin <hpa@linux.intel.com>
7 * 7 *
@@ -31,10 +31,13 @@
31#define RDRAND_RETRY_LOOPS 10 31#define RDRAND_RETRY_LOOPS 10
32 32
33#define RDRAND_INT ".byte 0x0f,0xc7,0xf0" 33#define RDRAND_INT ".byte 0x0f,0xc7,0xf0"
34#define RDSEED_INT ".byte 0x0f,0xc7,0xf8"
34#ifdef CONFIG_X86_64 35#ifdef CONFIG_X86_64
35# define RDRAND_LONG ".byte 0x48,0x0f,0xc7,0xf0" 36# define RDRAND_LONG ".byte 0x48,0x0f,0xc7,0xf0"
37# define RDSEED_LONG ".byte 0x48,0x0f,0xc7,0xf8"
36#else 38#else
37# define RDRAND_LONG RDRAND_INT 39# define RDRAND_LONG RDRAND_INT
40# define RDSEED_LONG RDSEED_INT
38#endif 41#endif
39 42
40#ifdef CONFIG_ARCH_RANDOM 43#ifdef CONFIG_ARCH_RANDOM
@@ -53,6 +56,16 @@ static inline int rdrand_long(unsigned long *v)
53 return ok; 56 return ok;
54} 57}
55 58
59/* A single attempt at RDSEED */
60static inline bool rdseed_long(unsigned long *v)
61{
62 unsigned char ok;
63 asm volatile(RDSEED_LONG "\n\t"
64 "setc %0"
65 : "=qm" (ok), "=a" (*v));
66 return ok;
67}
68
56#define GET_RANDOM(name, type, rdrand, nop) \ 69#define GET_RANDOM(name, type, rdrand, nop) \
57static inline int name(type *v) \ 70static inline int name(type *v) \
58{ \ 71{ \
@@ -70,18 +83,40 @@ static inline int name(type *v) \
70 return ok; \ 83 return ok; \
71} 84}
72 85
86#define GET_SEED(name, type, rdseed, nop) \
87static inline int name(type *v) \
88{ \
89 unsigned char ok; \
90 alternative_io("movb $0, %0\n\t" \
91 nop, \
92 rdseed "\n\t" \
93 "setc %0", \
94 X86_FEATURE_RDSEED, \
95 ASM_OUTPUT2("=q" (ok), "=a" (*v))); \
96 return ok; \
97}
98
73#ifdef CONFIG_X86_64 99#ifdef CONFIG_X86_64
74 100
75GET_RANDOM(arch_get_random_long, unsigned long, RDRAND_LONG, ASM_NOP5); 101GET_RANDOM(arch_get_random_long, unsigned long, RDRAND_LONG, ASM_NOP5);
76GET_RANDOM(arch_get_random_int, unsigned int, RDRAND_INT, ASM_NOP4); 102GET_RANDOM(arch_get_random_int, unsigned int, RDRAND_INT, ASM_NOP4);
77 103
104GET_SEED(arch_get_random_seed_long, unsigned long, RDSEED_LONG, ASM_NOP5);
105GET_SEED(arch_get_random_seed_int, unsigned int, RDSEED_INT, ASM_NOP4);
106
78#else 107#else
79 108
80GET_RANDOM(arch_get_random_long, unsigned long, RDRAND_LONG, ASM_NOP3); 109GET_RANDOM(arch_get_random_long, unsigned long, RDRAND_LONG, ASM_NOP3);
81GET_RANDOM(arch_get_random_int, unsigned int, RDRAND_INT, ASM_NOP3); 110GET_RANDOM(arch_get_random_int, unsigned int, RDRAND_INT, ASM_NOP3);
82 111
112GET_SEED(arch_get_random_seed_long, unsigned long, RDSEED_LONG, ASM_NOP4);
113GET_SEED(arch_get_random_seed_int, unsigned int, RDSEED_INT, ASM_NOP4);
114
83#endif /* CONFIG_X86_64 */ 115#endif /* CONFIG_X86_64 */
84 116
117#define arch_has_random() static_cpu_has(X86_FEATURE_RDRAND)
118#define arch_has_random_seed() static_cpu_has(X86_FEATURE_RDSEED)
119
85#else 120#else
86 121
87static inline int rdrand_long(unsigned long *v) 122static inline int rdrand_long(unsigned long *v)
@@ -89,6 +124,11 @@ static inline int rdrand_long(unsigned long *v)
89 return 0; 124 return 0;
90} 125}
91 126
127static inline bool rdseed_long(unsigned long *v)
128{
129 return 0;
130}
131
92#endif /* CONFIG_ARCH_RANDOM */ 132#endif /* CONFIG_ARCH_RANDOM */
93 133
94extern void x86_init_rdrand(struct cpuinfo_x86 *c); 134extern void x86_init_rdrand(struct cpuinfo_x86 *c);
diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h
index 2f03ff018d36..ba38ebbaced3 100644
--- a/arch/x86/include/asm/bug.h
+++ b/arch/x86/include/asm/bug.h
@@ -1,7 +1,6 @@
1#ifndef _ASM_X86_BUG_H 1#ifndef _ASM_X86_BUG_H
2#define _ASM_X86_BUG_H 2#define _ASM_X86_BUG_H
3 3
4#ifdef CONFIG_BUG
5#define HAVE_ARCH_BUG 4#define HAVE_ARCH_BUG
6 5
7#ifdef CONFIG_DEBUG_BUGVERBOSE 6#ifdef CONFIG_DEBUG_BUGVERBOSE
@@ -33,8 +32,6 @@ do { \
33} while (0) 32} while (0)
34#endif 33#endif
35 34
36#endif /* !CONFIG_BUG */
37
38#include <asm-generic/bug.h> 35#include <asm-generic/bug.h>
39 36
40#endif /* _ASM_X86_BUG_H */ 37#endif /* _ASM_X86_BUG_H */
diff --git a/arch/x86/include/asm/clocksource.h b/arch/x86/include/asm/clocksource.h
index 16a57f4ed64d..eda81dc0f4ae 100644
--- a/arch/x86/include/asm/clocksource.h
+++ b/arch/x86/include/asm/clocksource.h
@@ -3,8 +3,6 @@
3#ifndef _ASM_X86_CLOCKSOURCE_H 3#ifndef _ASM_X86_CLOCKSOURCE_H
4#define _ASM_X86_CLOCKSOURCE_H 4#define _ASM_X86_CLOCKSOURCE_H
5 5
6#ifdef CONFIG_X86_64
7
8#define VCLOCK_NONE 0 /* No vDSO clock available. */ 6#define VCLOCK_NONE 0 /* No vDSO clock available. */
9#define VCLOCK_TSC 1 /* vDSO should use vread_tsc. */ 7#define VCLOCK_TSC 1 /* vDSO should use vread_tsc. */
10#define VCLOCK_HPET 2 /* vDSO should use vread_hpet. */ 8#define VCLOCK_HPET 2 /* vDSO should use vread_hpet. */
@@ -14,6 +12,4 @@ struct arch_clocksource_data {
14 int vclock_mode; 12 int vclock_mode;
15}; 13};
16 14
17#endif /* CONFIG_X86_64 */
18
19#endif /* _ASM_X86_CLOCKSOURCE_H */ 15#endif /* _ASM_X86_CLOCKSOURCE_H */
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 63211ef5046a..e265ff95d16d 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -546,6 +546,13 @@ static __always_inline __pure bool _static_cpu_has_safe(u16 bit)
546#define static_cpu_has_bug(bit) static_cpu_has((bit)) 546#define static_cpu_has_bug(bit) static_cpu_has((bit))
547#define boot_cpu_has_bug(bit) cpu_has_bug(&boot_cpu_data, (bit)) 547#define boot_cpu_has_bug(bit) cpu_has_bug(&boot_cpu_data, (bit))
548 548
549#define MAX_CPU_FEATURES (NCAPINTS * 32)
550#define cpu_have_feature boot_cpu_has
551
552#define CPU_FEATURE_TYPEFMT "x86,ven%04Xfam%04Xmod%04X"
553#define CPU_FEATURE_TYPEVAL boot_cpu_data.x86_vendor, boot_cpu_data.x86, \
554 boot_cpu_data.x86_model
555
549#endif /* defined(__KERNEL__) && !defined(__ASSEMBLY__) */ 556#endif /* defined(__KERNEL__) && !defined(__ASSEMBLY__) */
550 557
551#endif /* _ASM_X86_CPUFEATURE_H */ 558#endif /* _ASM_X86_CPUFEATURE_H */
diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h
index 9c999c1674fa..2c71182d30ef 100644
--- a/arch/x86/include/asm/elf.h
+++ b/arch/x86/include/asm/elf.h
@@ -281,16 +281,12 @@ do { \
281 281
282#define STACK_RND_MASK (0x7ff) 282#define STACK_RND_MASK (0x7ff)
283 283
284#define VDSO_HIGH_BASE (__fix_to_virt(FIX_VDSO))
285
286#define ARCH_DLINFO ARCH_DLINFO_IA32(vdso_enabled) 284#define ARCH_DLINFO ARCH_DLINFO_IA32(vdso_enabled)
287 285
288/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ 286/* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */
289 287
290#else /* CONFIG_X86_32 */ 288#else /* CONFIG_X86_32 */
291 289
292#define VDSO_HIGH_BASE 0xffffe000U /* CONFIG_COMPAT_VDSO address */
293
294/* 1GB for 64bit, 8MB for 32bit */ 290/* 1GB for 64bit, 8MB for 32bit */
295#define STACK_RND_MASK (test_thread_flag(TIF_ADDR32) ? 0x7ff : 0x3fffff) 291#define STACK_RND_MASK (test_thread_flag(TIF_ADDR32) ? 0x7ff : 0x3fffff)
296 292
diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h
index 7252cd339175..43f482a0db37 100644
--- a/arch/x86/include/asm/fixmap.h
+++ b/arch/x86/include/asm/fixmap.h
@@ -40,15 +40,8 @@
40 */ 40 */
41extern unsigned long __FIXADDR_TOP; 41extern unsigned long __FIXADDR_TOP;
42#define FIXADDR_TOP ((unsigned long)__FIXADDR_TOP) 42#define FIXADDR_TOP ((unsigned long)__FIXADDR_TOP)
43
44#define FIXADDR_USER_START __fix_to_virt(FIX_VDSO)
45#define FIXADDR_USER_END __fix_to_virt(FIX_VDSO - 1)
46#else 43#else
47#define FIXADDR_TOP (VSYSCALL_END-PAGE_SIZE) 44#define FIXADDR_TOP (VSYSCALL_END-PAGE_SIZE)
48
49/* Only covers 32bit vsyscalls currently. Need another set for 64bit. */
50#define FIXADDR_USER_START ((unsigned long)VSYSCALL32_VSYSCALL)
51#define FIXADDR_USER_END (FIXADDR_USER_START + PAGE_SIZE)
52#endif 45#endif
53 46
54 47
@@ -74,7 +67,6 @@ extern unsigned long __FIXADDR_TOP;
74enum fixed_addresses { 67enum fixed_addresses {
75#ifdef CONFIG_X86_32 68#ifdef CONFIG_X86_32
76 FIX_HOLE, 69 FIX_HOLE,
77 FIX_VDSO,
78#else 70#else
79 VSYSCALL_LAST_PAGE, 71 VSYSCALL_LAST_PAGE,
80 VSYSCALL_FIRST_PAGE = VSYSCALL_LAST_PAGE 72 VSYSCALL_FIRST_PAGE = VSYSCALL_LAST_PAGE
@@ -98,12 +90,6 @@ enum fixed_addresses {
98 FIX_IO_APIC_BASE_0, 90 FIX_IO_APIC_BASE_0,
99 FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS - 1, 91 FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS - 1,
100#endif 92#endif
101#ifdef CONFIG_X86_VISWS_APIC
102 FIX_CO_CPU, /* Cobalt timer */
103 FIX_CO_APIC, /* Cobalt APIC Redirection Table */
104 FIX_LI_PCIA, /* Lithium PCI Bridge A */
105 FIX_LI_PCIB, /* Lithium PCI Bridge B */
106#endif
107 FIX_RO_IDT, /* Virtual mapping for read-only IDT */ 93 FIX_RO_IDT, /* Virtual mapping for read-only IDT */
108#ifdef CONFIG_X86_32 94#ifdef CONFIG_X86_32
109 FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ 95 FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
@@ -177,5 +163,11 @@ static inline void __set_fixmap(enum fixed_addresses idx,
177 163
178#include <asm-generic/fixmap.h> 164#include <asm-generic/fixmap.h>
179 165
166#define __late_set_fixmap(idx, phys, flags) __set_fixmap(idx, phys, flags)
167#define __late_clear_fixmap(idx) __set_fixmap(idx, 0, __pgprot(0))
168
169void __early_set_fixmap(enum fixed_addresses idx,
170 phys_addr_t phys, pgprot_t flags);
171
180#endif /* !__ASSEMBLY__ */ 172#endif /* !__ASSEMBLY__ */
181#endif /* _ASM_X86_FIXMAP_H */ 173#endif /* _ASM_X86_FIXMAP_H */
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
index 67d69b8e2d20..a307b7530e54 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
@@ -98,7 +98,6 @@ extern void trace_call_function_single_interrupt(void);
98#define IO_APIC_IRQ(x) (((x) >= NR_IRQS_LEGACY) || ((1<<(x)) & io_apic_irqs)) 98#define IO_APIC_IRQ(x) (((x) >= NR_IRQS_LEGACY) || ((1<<(x)) & io_apic_irqs))
99extern unsigned long io_apic_irqs; 99extern unsigned long io_apic_irqs;
100 100
101extern void init_VISWS_APIC_irqs(void);
102extern void setup_IO_APIC(void); 101extern void setup_IO_APIC(void);
103extern void disable_IO_APIC(void); 102extern void disable_IO_APIC(void);
104 103
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index 91d9c69a629e..b8237d8a1e0c 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -39,6 +39,7 @@
39#include <linux/string.h> 39#include <linux/string.h>
40#include <linux/compiler.h> 40#include <linux/compiler.h>
41#include <asm/page.h> 41#include <asm/page.h>
42#include <asm/early_ioremap.h>
42 43
43#define build_mmio_read(name, size, type, reg, barrier) \ 44#define build_mmio_read(name, size, type, reg, barrier) \
44static inline type name(const volatile void __iomem *addr) \ 45static inline type name(const volatile void __iomem *addr) \
@@ -316,19 +317,6 @@ extern int ioremap_change_attr(unsigned long vaddr, unsigned long size,
316 unsigned long prot_val); 317 unsigned long prot_val);
317extern void __iomem *ioremap_wc(resource_size_t offset, unsigned long size); 318extern void __iomem *ioremap_wc(resource_size_t offset, unsigned long size);
318 319
319/*
320 * early_ioremap() and early_iounmap() are for temporary early boot-time
321 * mappings, before the real ioremap() is functional.
322 * A boot-time mapping is currently limited to at most 16 pages.
323 */
324extern void early_ioremap_init(void);
325extern void early_ioremap_reset(void);
326extern void __iomem *early_ioremap(resource_size_t phys_addr,
327 unsigned long size);
328extern void __iomem *early_memremap(resource_size_t phys_addr,
329 unsigned long size);
330extern void early_iounmap(void __iomem *addr, unsigned long size);
331extern void fixup_early_ioremap(void);
332extern bool is_early_ioremap_ptep(pte_t *ptep); 320extern bool is_early_ioremap_ptep(pte_t *ptep);
333 321
334#ifdef CONFIG_XEN 322#ifdef CONFIG_XEN
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index fdf83afbb7d9..fcaf9c961265 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -337,6 +337,11 @@ struct kvm_pmu {
337 u64 reprogram_pmi; 337 u64 reprogram_pmi;
338}; 338};
339 339
340enum {
341 KVM_DEBUGREG_BP_ENABLED = 1,
342 KVM_DEBUGREG_WONT_EXIT = 2,
343};
344
340struct kvm_vcpu_arch { 345struct kvm_vcpu_arch {
341 /* 346 /*
342 * rip and regs accesses must go through 347 * rip and regs accesses must go through
@@ -444,7 +449,6 @@ struct kvm_vcpu_arch {
444 } st; 449 } st;
445 450
446 u64 last_guest_tsc; 451 u64 last_guest_tsc;
447 u64 last_kernel_ns;
448 u64 last_host_tsc; 452 u64 last_host_tsc;
449 u64 tsc_offset_adjustment; 453 u64 tsc_offset_adjustment;
450 u64 this_tsc_nsec; 454 u64 this_tsc_nsec;
@@ -464,7 +468,7 @@ struct kvm_vcpu_arch {
464 struct mtrr_state_type mtrr_state; 468 struct mtrr_state_type mtrr_state;
465 u32 pat; 469 u32 pat;
466 470
467 int switch_db_regs; 471 unsigned switch_db_regs;
468 unsigned long db[KVM_NR_DB_REGS]; 472 unsigned long db[KVM_NR_DB_REGS];
469 unsigned long dr6; 473 unsigned long dr6;
470 unsigned long dr7; 474 unsigned long dr7;
@@ -599,6 +603,8 @@ struct kvm_arch {
599 bool use_master_clock; 603 bool use_master_clock;
600 u64 master_kernel_ns; 604 u64 master_kernel_ns;
601 cycle_t master_cycle_now; 605 cycle_t master_cycle_now;
606 struct delayed_work kvmclock_update_work;
607 struct delayed_work kvmclock_sync_work;
602 608
603 struct kvm_xen_hvm_config xen_hvm_config; 609 struct kvm_xen_hvm_config xen_hvm_config;
604 610
@@ -702,6 +708,7 @@ struct kvm_x86_ops {
702 void (*set_gdt)(struct kvm_vcpu *vcpu, struct desc_ptr *dt); 708 void (*set_gdt)(struct kvm_vcpu *vcpu, struct desc_ptr *dt);
703 u64 (*get_dr6)(struct kvm_vcpu *vcpu); 709 u64 (*get_dr6)(struct kvm_vcpu *vcpu);
704 void (*set_dr6)(struct kvm_vcpu *vcpu, unsigned long value); 710 void (*set_dr6)(struct kvm_vcpu *vcpu, unsigned long value);
711 void (*sync_dirty_debug_regs)(struct kvm_vcpu *vcpu);
705 void (*set_dr7)(struct kvm_vcpu *vcpu, unsigned long value); 712 void (*set_dr7)(struct kvm_vcpu *vcpu, unsigned long value);
706 void (*cache_reg)(struct kvm_vcpu *vcpu, enum kvm_reg reg); 713 void (*cache_reg)(struct kvm_vcpu *vcpu, enum kvm_reg reg);
707 unsigned long (*get_rflags)(struct kvm_vcpu *vcpu); 714 unsigned long (*get_rflags)(struct kvm_vcpu *vcpu);
@@ -728,8 +735,8 @@ struct kvm_x86_ops {
728 int (*nmi_allowed)(struct kvm_vcpu *vcpu); 735 int (*nmi_allowed)(struct kvm_vcpu *vcpu);
729 bool (*get_nmi_mask)(struct kvm_vcpu *vcpu); 736 bool (*get_nmi_mask)(struct kvm_vcpu *vcpu);
730 void (*set_nmi_mask)(struct kvm_vcpu *vcpu, bool masked); 737 void (*set_nmi_mask)(struct kvm_vcpu *vcpu, bool masked);
731 int (*enable_nmi_window)(struct kvm_vcpu *vcpu); 738 void (*enable_nmi_window)(struct kvm_vcpu *vcpu);
732 int (*enable_irq_window)(struct kvm_vcpu *vcpu); 739 void (*enable_irq_window)(struct kvm_vcpu *vcpu);
733 void (*update_cr8_intercept)(struct kvm_vcpu *vcpu, int tpr, int irr); 740 void (*update_cr8_intercept)(struct kvm_vcpu *vcpu, int tpr, int irr);
734 int (*vm_has_apicv)(struct kvm *kvm); 741 int (*vm_has_apicv)(struct kvm *kvm);
735 void (*hwapic_irr_update)(struct kvm_vcpu *vcpu, int max_irr); 742 void (*hwapic_irr_update)(struct kvm_vcpu *vcpu, int max_irr);
@@ -765,6 +772,9 @@ struct kvm_x86_ops {
765 struct x86_instruction_info *info, 772 struct x86_instruction_info *info,
766 enum x86_intercept_stage stage); 773 enum x86_intercept_stage stage);
767 void (*handle_external_intr)(struct kvm_vcpu *vcpu); 774 void (*handle_external_intr)(struct kvm_vcpu *vcpu);
775 bool (*mpx_supported)(void);
776
777 int (*check_nested_events)(struct kvm_vcpu *vcpu, bool external_intr);
768}; 778};
769 779
770struct kvm_arch_async_pf { 780struct kvm_arch_async_pf {
diff --git a/arch/x86/include/asm/mmzone_32.h b/arch/x86/include/asm/mmzone_32.h
index 8a9b3e288cb4..1ec990bd7dc0 100644
--- a/arch/x86/include/asm/mmzone_32.h
+++ b/arch/x86/include/asm/mmzone_32.h
@@ -11,9 +11,6 @@
11#ifdef CONFIG_NUMA 11#ifdef CONFIG_NUMA
12extern struct pglist_data *node_data[]; 12extern struct pglist_data *node_data[];
13#define NODE_DATA(nid) (node_data[nid]) 13#define NODE_DATA(nid) (node_data[nid])
14
15#include <asm/numaq.h>
16
17#endif /* CONFIG_NUMA */ 14#endif /* CONFIG_NUMA */
18 15
19#ifdef CONFIG_DISCONTIGMEM 16#ifdef CONFIG_DISCONTIGMEM
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h
index 3e6b4920ef5d..f5a617956735 100644
--- a/arch/x86/include/asm/mpspec.h
+++ b/arch/x86/include/asm/mpspec.h
@@ -25,12 +25,6 @@ extern int pic_mode;
25 25
26extern unsigned int def_to_bigsmp; 26extern unsigned int def_to_bigsmp;
27 27
28#ifdef CONFIG_X86_NUMAQ
29extern int mp_bus_id_to_node[MAX_MP_BUSSES];
30extern int mp_bus_id_to_local[MAX_MP_BUSSES];
31extern int quad_local_to_mp_bus_id [NR_CPUS/4][4];
32#endif
33
34#else /* CONFIG_X86_64: */ 28#else /* CONFIG_X86_64: */
35 29
36#define MAX_MP_BUSSES 256 30#define MAX_MP_BUSSES 256
diff --git a/arch/x86/include/asm/numaq.h b/arch/x86/include/asm/numaq.h
deleted file mode 100644
index c3b3c322fd87..000000000000
--- a/arch/x86/include/asm/numaq.h
+++ /dev/null
@@ -1,171 +0,0 @@
1/*
2 * Written by: Patricia Gaughen, IBM Corporation
3 *
4 * Copyright (C) 2002, IBM Corp.
5 *
6 * All rights reserved.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
16 * NON INFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 * Send feedback to <gone@us.ibm.com>
24 */
25
26#ifndef _ASM_X86_NUMAQ_H
27#define _ASM_X86_NUMAQ_H
28
29#ifdef CONFIG_X86_NUMAQ
30
31extern int found_numaq;
32extern int numaq_numa_init(void);
33extern int pci_numaq_init(void);
34
35extern void *xquad_portio;
36
37#define XQUAD_PORTIO_BASE 0xfe400000
38#define XQUAD_PORTIO_QUAD 0x40000 /* 256k per quad. */
39#define XQUAD_PORT_ADDR(port, quad) (xquad_portio + (XQUAD_PORTIO_QUAD*quad) + port)
40
41/*
42 * SYS_CFG_DATA_PRIV_ADDR, struct eachquadmem, and struct sys_cfg_data are the
43 */
44#define SYS_CFG_DATA_PRIV_ADDR 0x0009d000 /* place for scd in private
45 quad space */
46
47/*
48 * Communication area for each processor on lynxer-processor tests.
49 *
50 * NOTE: If you change the size of this eachproc structure you need
51 * to change the definition for EACH_QUAD_SIZE.
52 */
53struct eachquadmem {
54 unsigned int priv_mem_start; /* Starting address of this */
55 /* quad's private memory. */
56 /* This is always 0. */
57 /* In MB. */
58 unsigned int priv_mem_size; /* Size of this quad's */
59 /* private memory. */
60 /* In MB. */
61 unsigned int low_shrd_mem_strp_start;/* Starting address of this */
62 /* quad's low shared block */
63 /* (untranslated). */
64 /* In MB. */
65 unsigned int low_shrd_mem_start; /* Starting address of this */
66 /* quad's low shared memory */
67 /* (untranslated). */
68 /* In MB. */
69 unsigned int low_shrd_mem_size; /* Size of this quad's low */
70 /* shared memory. */
71 /* In MB. */
72 unsigned int lmmio_copb_start; /* Starting address of this */
73 /* quad's local memory */
74 /* mapped I/O in the */
75 /* compatibility OPB. */
76 /* In MB. */
77 unsigned int lmmio_copb_size; /* Size of this quad's local */
78 /* memory mapped I/O in the */
79 /* compatibility OPB. */
80 /* In MB. */
81 unsigned int lmmio_nopb_start; /* Starting address of this */
82 /* quad's local memory */
83 /* mapped I/O in the */
84 /* non-compatibility OPB. */
85 /* In MB. */
86 unsigned int lmmio_nopb_size; /* Size of this quad's local */
87 /* memory mapped I/O in the */
88 /* non-compatibility OPB. */
89 /* In MB. */
90 unsigned int io_apic_0_start; /* Starting address of I/O */
91 /* APIC 0. */
92 unsigned int io_apic_0_sz; /* Size I/O APIC 0. */
93 unsigned int io_apic_1_start; /* Starting address of I/O */
94 /* APIC 1. */
95 unsigned int io_apic_1_sz; /* Size I/O APIC 1. */
96 unsigned int hi_shrd_mem_start; /* Starting address of this */
97 /* quad's high shared memory.*/
98 /* In MB. */
99 unsigned int hi_shrd_mem_size; /* Size of this quad's high */
100 /* shared memory. */
101 /* In MB. */
102 unsigned int mps_table_addr; /* Address of this quad's */
103 /* MPS tables from BIOS, */
104 /* in system space.*/
105 unsigned int lcl_MDC_pio_addr; /* Port-I/O address for */
106 /* local access of MDC. */
107 unsigned int rmt_MDC_mmpio_addr; /* MM-Port-I/O address for */
108 /* remote access of MDC. */
109 unsigned int mm_port_io_start; /* Starting address of this */
110 /* quad's memory mapped Port */
111 /* I/O space. */
112 unsigned int mm_port_io_size; /* Size of this quad's memory*/
113 /* mapped Port I/O space. */
114 unsigned int mm_rmt_io_apic_start; /* Starting address of this */
115 /* quad's memory mapped */
116 /* remote I/O APIC space. */
117 unsigned int mm_rmt_io_apic_size; /* Size of this quad's memory*/
118 /* mapped remote I/O APIC */
119 /* space. */
120 unsigned int mm_isa_start; /* Starting address of this */
121 /* quad's memory mapped ISA */
122 /* space (contains MDC */
123 /* memory space). */
124 unsigned int mm_isa_size; /* Size of this quad's memory*/
125 /* mapped ISA space (contains*/
126 /* MDC memory space). */
127 unsigned int rmt_qmi_addr; /* Remote addr to access QMI.*/
128 unsigned int lcl_qmi_addr; /* Local addr to access QMI. */
129};
130
131/*
132 * Note: This structure must be NOT be changed unless the multiproc and
133 * OS are changed to reflect the new structure.
134 */
135struct sys_cfg_data {
136 unsigned int quad_id;
137 unsigned int bsp_proc_id; /* Boot Strap Processor in this quad. */
138 unsigned int scd_version; /* Version number of this table. */
139 unsigned int first_quad_id;
140 unsigned int quads_present31_0; /* 1 bit for each quad */
141 unsigned int quads_present63_32; /* 1 bit for each quad */
142 unsigned int config_flags;
143 unsigned int boot_flags;
144 unsigned int csr_start_addr; /* Absolute value (not in MB) */
145 unsigned int csr_size; /* Absolute value (not in MB) */
146 unsigned int lcl_apic_start_addr; /* Absolute value (not in MB) */
147 unsigned int lcl_apic_size; /* Absolute value (not in MB) */
148 unsigned int low_shrd_mem_base; /* 0 or 512MB or 1GB */
149 unsigned int low_shrd_mem_quad_offset; /* 0,128M,256M,512M,1G */
150 /* may not be totally populated */
151 unsigned int split_mem_enbl; /* 0 for no low shared memory */
152 unsigned int mmio_sz; /* Size of total system memory mapped I/O */
153 /* (in MB). */
154 unsigned int quad_spin_lock; /* Spare location used for quad */
155 /* bringup. */
156 unsigned int nonzero55; /* For checksumming. */
157 unsigned int nonzeroaa; /* For checksumming. */
158 unsigned int scd_magic_number;
159 unsigned int system_type;
160 unsigned int checksum;
161 /*
162 * memory configuration area for each quad
163 */
164 struct eachquadmem eq[MAX_NUMNODES]; /* indexed by quad id */
165};
166
167void numaq_tsc_disable(void);
168
169#endif /* CONFIG_X86_NUMAQ */
170#endif /* _ASM_X86_NUMAQ_H */
171
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index 1ac6114c9ea5..96ae4f4040bb 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -26,11 +26,6 @@ extern int pci_routeirq;
26extern int noioapicquirk; 26extern int noioapicquirk;
27extern int noioapicreroute; 27extern int noioapicreroute;
28 28
29/* scan a bus after allocating a pci_sysdata for it */
30extern struct pci_bus *pci_scan_bus_on_node(int busno, struct pci_ops *ops,
31 int node);
32extern struct pci_bus *pci_scan_bus_with_sysdata(int busno);
33
34#ifdef CONFIG_PCI 29#ifdef CONFIG_PCI
35 30
36#ifdef CONFIG_PCI_DOMAINS 31#ifdef CONFIG_PCI_DOMAINS
@@ -70,7 +65,7 @@ extern unsigned long pci_mem_start;
70 65
71extern int pcibios_enabled; 66extern int pcibios_enabled;
72void pcibios_config_init(void); 67void pcibios_config_init(void);
73struct pci_bus *pcibios_scan_root(int bus); 68void pcibios_scan_root(int bus);
74 69
75void pcibios_set_master(struct pci_dev *dev); 70void pcibios_set_master(struct pci_dev *dev);
76void pcibios_penalize_isa_irq(int irq, int active); 71void pcibios_penalize_isa_irq(int irq, int active);
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h
index 94220d14d5cc..851bcdc5db04 100644
--- a/arch/x86/include/asm/percpu.h
+++ b/arch/x86/include/asm/percpu.h
@@ -52,7 +52,7 @@
52 * Compared to the generic __my_cpu_offset version, the following 52 * Compared to the generic __my_cpu_offset version, the following
53 * saves one instruction and avoids clobbering a temp register. 53 * saves one instruction and avoids clobbering a temp register.
54 */ 54 */
55#define __this_cpu_ptr(ptr) \ 55#define raw_cpu_ptr(ptr) \
56({ \ 56({ \
57 unsigned long tcp_ptr__; \ 57 unsigned long tcp_ptr__; \
58 __verify_pcpu_ptr(ptr); \ 58 __verify_pcpu_ptr(ptr); \
@@ -362,25 +362,25 @@ do { \
362 */ 362 */
363#define this_cpu_read_stable(var) percpu_from_op("mov", var, "p" (&(var))) 363#define this_cpu_read_stable(var) percpu_from_op("mov", var, "p" (&(var)))
364 364
365#define __this_cpu_read_1(pcp) percpu_from_op("mov", (pcp), "m"(pcp)) 365#define raw_cpu_read_1(pcp) percpu_from_op("mov", (pcp), "m"(pcp))
366#define __this_cpu_read_2(pcp) percpu_from_op("mov", (pcp), "m"(pcp)) 366#define raw_cpu_read_2(pcp) percpu_from_op("mov", (pcp), "m"(pcp))
367#define __this_cpu_read_4(pcp) percpu_from_op("mov", (pcp), "m"(pcp)) 367#define raw_cpu_read_4(pcp) percpu_from_op("mov", (pcp), "m"(pcp))
368 368
369#define __this_cpu_write_1(pcp, val) percpu_to_op("mov", (pcp), val) 369#define raw_cpu_write_1(pcp, val) percpu_to_op("mov", (pcp), val)
370#define __this_cpu_write_2(pcp, val) percpu_to_op("mov", (pcp), val) 370#define raw_cpu_write_2(pcp, val) percpu_to_op("mov", (pcp), val)
371#define __this_cpu_write_4(pcp, val) percpu_to_op("mov", (pcp), val) 371#define raw_cpu_write_4(pcp, val) percpu_to_op("mov", (pcp), val)
372#define __this_cpu_add_1(pcp, val) percpu_add_op((pcp), val) 372#define raw_cpu_add_1(pcp, val) percpu_add_op((pcp), val)
373#define __this_cpu_add_2(pcp, val) percpu_add_op((pcp), val) 373#define raw_cpu_add_2(pcp, val) percpu_add_op((pcp), val)
374#define __this_cpu_add_4(pcp, val) percpu_add_op((pcp), val) 374#define raw_cpu_add_4(pcp, val) percpu_add_op((pcp), val)
375#define __this_cpu_and_1(pcp, val) percpu_to_op("and", (pcp), val) 375#define raw_cpu_and_1(pcp, val) percpu_to_op("and", (pcp), val)
376#define __this_cpu_and_2(pcp, val) percpu_to_op("and", (pcp), val) 376#define raw_cpu_and_2(pcp, val) percpu_to_op("and", (pcp), val)
377#define __this_cpu_and_4(pcp, val) percpu_to_op("and", (pcp), val) 377#define raw_cpu_and_4(pcp, val) percpu_to_op("and", (pcp), val)
378#define __this_cpu_or_1(pcp, val) percpu_to_op("or", (pcp), val) 378#define raw_cpu_or_1(pcp, val) percpu_to_op("or", (pcp), val)
379#define __this_cpu_or_2(pcp, val) percpu_to_op("or", (pcp), val) 379#define raw_cpu_or_2(pcp, val) percpu_to_op("or", (pcp), val)
380#define __this_cpu_or_4(pcp, val) percpu_to_op("or", (pcp), val) 380#define raw_cpu_or_4(pcp, val) percpu_to_op("or", (pcp), val)
381#define __this_cpu_xchg_1(pcp, val) percpu_xchg_op(pcp, val) 381#define raw_cpu_xchg_1(pcp, val) percpu_xchg_op(pcp, val)
382#define __this_cpu_xchg_2(pcp, val) percpu_xchg_op(pcp, val) 382#define raw_cpu_xchg_2(pcp, val) percpu_xchg_op(pcp, val)
383#define __this_cpu_xchg_4(pcp, val) percpu_xchg_op(pcp, val) 383#define raw_cpu_xchg_4(pcp, val) percpu_xchg_op(pcp, val)
384 384
385#define this_cpu_read_1(pcp) percpu_from_op("mov", (pcp), "m"(pcp)) 385#define this_cpu_read_1(pcp) percpu_from_op("mov", (pcp), "m"(pcp))
386#define this_cpu_read_2(pcp) percpu_from_op("mov", (pcp), "m"(pcp)) 386#define this_cpu_read_2(pcp) percpu_from_op("mov", (pcp), "m"(pcp))
@@ -401,16 +401,16 @@ do { \
401#define this_cpu_xchg_2(pcp, nval) percpu_xchg_op(pcp, nval) 401#define this_cpu_xchg_2(pcp, nval) percpu_xchg_op(pcp, nval)
402#define this_cpu_xchg_4(pcp, nval) percpu_xchg_op(pcp, nval) 402#define this_cpu_xchg_4(pcp, nval) percpu_xchg_op(pcp, nval)
403 403
404#define __this_cpu_add_return_1(pcp, val) percpu_add_return_op(pcp, val) 404#define raw_cpu_add_return_1(pcp, val) percpu_add_return_op(pcp, val)
405#define __this_cpu_add_return_2(pcp, val) percpu_add_return_op(pcp, val) 405#define raw_cpu_add_return_2(pcp, val) percpu_add_return_op(pcp, val)
406#define __this_cpu_add_return_4(pcp, val) percpu_add_return_op(pcp, val) 406#define raw_cpu_add_return_4(pcp, val) percpu_add_return_op(pcp, val)
407#define __this_cpu_cmpxchg_1(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval) 407#define raw_cpu_cmpxchg_1(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval)
408#define __this_cpu_cmpxchg_2(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval) 408#define raw_cpu_cmpxchg_2(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval)
409#define __this_cpu_cmpxchg_4(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval) 409#define raw_cpu_cmpxchg_4(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval)
410 410
411#define this_cpu_add_return_1(pcp, val) percpu_add_return_op(pcp, val) 411#define this_cpu_add_return_1(pcp, val) percpu_add_return_op(pcp, val)
412#define this_cpu_add_return_2(pcp, val) percpu_add_return_op(pcp, val) 412#define this_cpu_add_return_2(pcp, val) percpu_add_return_op(pcp, val)
413#define this_cpu_add_return_4(pcp, val) percpu_add_return_op(pcp, val) 413#define this_cpu_add_return_4(pcp, val) percpu_add_return_op(pcp, val)
414#define this_cpu_cmpxchg_1(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval) 414#define this_cpu_cmpxchg_1(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval)
415#define this_cpu_cmpxchg_2(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval) 415#define this_cpu_cmpxchg_2(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval)
416#define this_cpu_cmpxchg_4(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval) 416#define this_cpu_cmpxchg_4(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval)
@@ -427,7 +427,7 @@ do { \
427 __ret; \ 427 __ret; \
428}) 428})
429 429
430#define __this_cpu_cmpxchg_double_4 percpu_cmpxchg8b_double 430#define raw_cpu_cmpxchg_double_4 percpu_cmpxchg8b_double
431#define this_cpu_cmpxchg_double_4 percpu_cmpxchg8b_double 431#define this_cpu_cmpxchg_double_4 percpu_cmpxchg8b_double
432#endif /* CONFIG_X86_CMPXCHG64 */ 432#endif /* CONFIG_X86_CMPXCHG64 */
433 433
@@ -436,22 +436,22 @@ do { \
436 * 32 bit must fall back to generic operations. 436 * 32 bit must fall back to generic operations.
437 */ 437 */
438#ifdef CONFIG_X86_64 438#ifdef CONFIG_X86_64
439#define __this_cpu_read_8(pcp) percpu_from_op("mov", (pcp), "m"(pcp)) 439#define raw_cpu_read_8(pcp) percpu_from_op("mov", (pcp), "m"(pcp))
440#define __this_cpu_write_8(pcp, val) percpu_to_op("mov", (pcp), val) 440#define raw_cpu_write_8(pcp, val) percpu_to_op("mov", (pcp), val)
441#define __this_cpu_add_8(pcp, val) percpu_add_op((pcp), val) 441#define raw_cpu_add_8(pcp, val) percpu_add_op((pcp), val)
442#define __this_cpu_and_8(pcp, val) percpu_to_op("and", (pcp), val) 442#define raw_cpu_and_8(pcp, val) percpu_to_op("and", (pcp), val)
443#define __this_cpu_or_8(pcp, val) percpu_to_op("or", (pcp), val) 443#define raw_cpu_or_8(pcp, val) percpu_to_op("or", (pcp), val)
444#define __this_cpu_add_return_8(pcp, val) percpu_add_return_op(pcp, val) 444#define raw_cpu_add_return_8(pcp, val) percpu_add_return_op(pcp, val)
445#define __this_cpu_xchg_8(pcp, nval) percpu_xchg_op(pcp, nval) 445#define raw_cpu_xchg_8(pcp, nval) percpu_xchg_op(pcp, nval)
446#define __this_cpu_cmpxchg_8(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval) 446#define raw_cpu_cmpxchg_8(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval)
447 447
448#define this_cpu_read_8(pcp) percpu_from_op("mov", (pcp), "m"(pcp)) 448#define this_cpu_read_8(pcp) percpu_from_op("mov", (pcp), "m"(pcp))
449#define this_cpu_write_8(pcp, val) percpu_to_op("mov", (pcp), val) 449#define this_cpu_write_8(pcp, val) percpu_to_op("mov", (pcp), val)
450#define this_cpu_add_8(pcp, val) percpu_add_op((pcp), val) 450#define this_cpu_add_8(pcp, val) percpu_add_op((pcp), val)
451#define this_cpu_and_8(pcp, val) percpu_to_op("and", (pcp), val) 451#define this_cpu_and_8(pcp, val) percpu_to_op("and", (pcp), val)
452#define this_cpu_or_8(pcp, val) percpu_to_op("or", (pcp), val) 452#define this_cpu_or_8(pcp, val) percpu_to_op("or", (pcp), val)
453#define this_cpu_add_return_8(pcp, val) percpu_add_return_op(pcp, val) 453#define this_cpu_add_return_8(pcp, val) percpu_add_return_op(pcp, val)
454#define this_cpu_xchg_8(pcp, nval) percpu_xchg_op(pcp, nval) 454#define this_cpu_xchg_8(pcp, nval) percpu_xchg_op(pcp, nval)
455#define this_cpu_cmpxchg_8(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval) 455#define this_cpu_cmpxchg_8(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval)
456 456
457/* 457/*
@@ -474,7 +474,7 @@ do { \
474 __ret; \ 474 __ret; \
475}) 475})
476 476
477#define __this_cpu_cmpxchg_double_8 percpu_cmpxchg16b_double 477#define raw_cpu_cmpxchg_double_8 percpu_cmpxchg16b_double
478#define this_cpu_cmpxchg_double_8 percpu_cmpxchg16b_double 478#define this_cpu_cmpxchg_double_8 percpu_cmpxchg16b_double
479 479
480#endif 480#endif
@@ -495,9 +495,9 @@ static __always_inline int x86_this_cpu_constant_test_bit(unsigned int nr,
495 unsigned long __percpu *a = (unsigned long *)addr + nr / BITS_PER_LONG; 495 unsigned long __percpu *a = (unsigned long *)addr + nr / BITS_PER_LONG;
496 496
497#ifdef CONFIG_X86_64 497#ifdef CONFIG_X86_64
498 return ((1UL << (nr % BITS_PER_LONG)) & __this_cpu_read_8(*a)) != 0; 498 return ((1UL << (nr % BITS_PER_LONG)) & raw_cpu_read_8(*a)) != 0;
499#else 499#else
500 return ((1UL << (nr % BITS_PER_LONG)) & __this_cpu_read_4(*a)) != 0; 500 return ((1UL << (nr % BITS_PER_LONG)) & raw_cpu_read_4(*a)) != 0;
501#endif 501#endif
502} 502}
503 503
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
index 708f19fb4fc7..eb3d44945133 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -214,13 +214,8 @@
214#ifdef CONFIG_X86_64 214#ifdef CONFIG_X86_64
215#define __PAGE_KERNEL_IDENT_LARGE_EXEC __PAGE_KERNEL_LARGE_EXEC 215#define __PAGE_KERNEL_IDENT_LARGE_EXEC __PAGE_KERNEL_LARGE_EXEC
216#else 216#else
217/*
218 * For PDE_IDENT_ATTR include USER bit. As the PDE and PTE protection
219 * bits are combined, this will alow user to access the high address mapped
220 * VDSO in the presence of CONFIG_COMPAT_VDSO
221 */
222#define PTE_IDENT_ATTR 0x003 /* PRESENT+RW */ 217#define PTE_IDENT_ATTR 0x003 /* PRESENT+RW */
223#define PDE_IDENT_ATTR 0x067 /* PRESENT+RW+USER+DIRTY+ACCESSED */ 218#define PDE_IDENT_ATTR 0x063 /* PRESENT+RW+DIRTY+ACCESSED */
224#define PGD_IDENT_ATTR 0x001 /* PRESENT (no other attributes) */ 219#define PGD_IDENT_ATTR 0x001 /* PRESENT (no other attributes) */
225#endif 220#endif
226 221
diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h
index c8b051933b1b..7024c12f7bfe 100644
--- a/arch/x86/include/asm/preempt.h
+++ b/arch/x86/include/asm/preempt.h
@@ -19,12 +19,12 @@ DECLARE_PER_CPU(int, __preempt_count);
19 */ 19 */
20static __always_inline int preempt_count(void) 20static __always_inline int preempt_count(void)
21{ 21{
22 return __this_cpu_read_4(__preempt_count) & ~PREEMPT_NEED_RESCHED; 22 return raw_cpu_read_4(__preempt_count) & ~PREEMPT_NEED_RESCHED;
23} 23}
24 24
25static __always_inline void preempt_count_set(int pc) 25static __always_inline void preempt_count_set(int pc)
26{ 26{
27 __this_cpu_write_4(__preempt_count, pc); 27 raw_cpu_write_4(__preempt_count, pc);
28} 28}
29 29
30/* 30/*
@@ -53,17 +53,17 @@ static __always_inline void preempt_count_set(int pc)
53 53
54static __always_inline void set_preempt_need_resched(void) 54static __always_inline void set_preempt_need_resched(void)
55{ 55{
56 __this_cpu_and_4(__preempt_count, ~PREEMPT_NEED_RESCHED); 56 raw_cpu_and_4(__preempt_count, ~PREEMPT_NEED_RESCHED);
57} 57}
58 58
59static __always_inline void clear_preempt_need_resched(void) 59static __always_inline void clear_preempt_need_resched(void)
60{ 60{
61 __this_cpu_or_4(__preempt_count, PREEMPT_NEED_RESCHED); 61 raw_cpu_or_4(__preempt_count, PREEMPT_NEED_RESCHED);
62} 62}
63 63
64static __always_inline bool test_preempt_need_resched(void) 64static __always_inline bool test_preempt_need_resched(void)
65{ 65{
66 return !(__this_cpu_read_4(__preempt_count) & PREEMPT_NEED_RESCHED); 66 return !(raw_cpu_read_4(__preempt_count) & PREEMPT_NEED_RESCHED);
67} 67}
68 68
69/* 69/*
@@ -72,12 +72,12 @@ static __always_inline bool test_preempt_need_resched(void)
72 72
73static __always_inline void __preempt_count_add(int val) 73static __always_inline void __preempt_count_add(int val)
74{ 74{
75 __this_cpu_add_4(__preempt_count, val); 75 raw_cpu_add_4(__preempt_count, val);
76} 76}
77 77
78static __always_inline void __preempt_count_sub(int val) 78static __always_inline void __preempt_count_sub(int val)
79{ 79{
80 __this_cpu_add_4(__preempt_count, -val); 80 raw_cpu_add_4(__preempt_count, -val);
81} 81}
82 82
83/* 83/*
@@ -95,7 +95,7 @@ static __always_inline bool __preempt_count_dec_and_test(void)
95 */ 95 */
96static __always_inline bool should_resched(void) 96static __always_inline bool should_resched(void)
97{ 97{
98 return unlikely(!__this_cpu_read_4(__preempt_count)); 98 return unlikely(!raw_cpu_read_4(__preempt_count));
99} 99}
100 100
101#ifdef CONFIG_PREEMPT 101#ifdef CONFIG_PREEMPT
diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h
index d62c9f809bc5..9264f04a4c55 100644
--- a/arch/x86/include/asm/setup.h
+++ b/arch/x86/include/asm/setup.h
@@ -39,12 +39,6 @@ static inline void vsmp_init(void) { }
39 39
40void setup_bios_corruption_check(void); 40void setup_bios_corruption_check(void);
41 41
42#ifdef CONFIG_X86_VISWS
43extern void visws_early_detect(void);
44#else
45static inline void visws_early_detect(void) { }
46#endif
47
48extern unsigned long saved_video_mode; 42extern unsigned long saved_video_mode;
49 43
50extern void reserve_standard_io_resources(void); 44extern void reserve_standard_io_resources(void);
diff --git a/arch/x86/include/asm/syscall.h b/arch/x86/include/asm/syscall.h
index aea284b41312..d6a756ae04c8 100644
--- a/arch/x86/include/asm/syscall.h
+++ b/arch/x86/include/asm/syscall.h
@@ -13,7 +13,7 @@
13#ifndef _ASM_X86_SYSCALL_H 13#ifndef _ASM_X86_SYSCALL_H
14#define _ASM_X86_SYSCALL_H 14#define _ASM_X86_SYSCALL_H
15 15
16#include <linux/audit.h> 16#include <uapi/linux/audit.h>
17#include <linux/sched.h> 17#include <linux/sched.h>
18#include <linux/err.h> 18#include <linux/err.h>
19#include <asm/asm-offsets.h> /* For NR_syscalls */ 19#include <asm/asm-offsets.h> /* For NR_syscalls */
@@ -91,8 +91,7 @@ static inline void syscall_set_arguments(struct task_struct *task,
91 memcpy(&regs->bx + i, args, n * sizeof(args[0])); 91 memcpy(&regs->bx + i, args, n * sizeof(args[0]));
92} 92}
93 93
94static inline int syscall_get_arch(struct task_struct *task, 94static inline int syscall_get_arch(void)
95 struct pt_regs *regs)
96{ 95{
97 return AUDIT_ARCH_I386; 96 return AUDIT_ARCH_I386;
98} 97}
@@ -221,8 +220,7 @@ static inline void syscall_set_arguments(struct task_struct *task,
221 } 220 }
222} 221}
223 222
224static inline int syscall_get_arch(struct task_struct *task, 223static inline int syscall_get_arch(void)
225 struct pt_regs *regs)
226{ 224{
227#ifdef CONFIG_IA32_EMULATION 225#ifdef CONFIG_IA32_EMULATION
228 /* 226 /*
@@ -234,7 +232,7 @@ static inline int syscall_get_arch(struct task_struct *task,
234 * 232 *
235 * x32 tasks should be considered AUDIT_ARCH_X86_64. 233 * x32 tasks should be considered AUDIT_ARCH_X86_64.
236 */ 234 */
237 if (task_thread_info(task)->status & TS_COMPAT) 235 if (task_thread_info(current)->status & TS_COMPAT)
238 return AUDIT_ARCH_I386; 236 return AUDIT_ARCH_I386;
239#endif 237#endif
240 /* Both x32 and x86_64 are considered "64-bit". */ 238 /* Both x32 and x86_64 are considered "64-bit". */
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
index b28097e4c8c3..0e8f04f2c26f 100644
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -132,19 +132,7 @@ static inline void arch_fix_phys_package_id(int num, u32 slot)
132} 132}
133 133
134struct pci_bus; 134struct pci_bus;
135int x86_pci_root_bus_node(int bus);
135void x86_pci_root_bus_resources(int bus, struct list_head *resources); 136void x86_pci_root_bus_resources(int bus, struct list_head *resources);
136 137
137#ifdef CONFIG_NUMA
138extern int get_mp_bus_to_node(int busnum);
139extern void set_mp_bus_to_node(int busnum, int node);
140#else
141static inline int get_mp_bus_to_node(int busnum)
142{
143 return 0;
144}
145static inline void set_mp_bus_to_node(int busnum, int node)
146{
147}
148#endif
149
150#endif /* _ASM_X86_TOPOLOGY_H */ 138#endif /* _ASM_X86_TOPOLOGY_H */
diff --git a/arch/x86/include/asm/vdso.h b/arch/x86/include/asm/vdso.h
index fddb53d63915..d1dc55404ff1 100644
--- a/arch/x86/include/asm/vdso.h
+++ b/arch/x86/include/asm/vdso.h
@@ -1,8 +1,45 @@
1#ifndef _ASM_X86_VDSO_H 1#ifndef _ASM_X86_VDSO_H
2#define _ASM_X86_VDSO_H 2#define _ASM_X86_VDSO_H
3 3
4#include <asm/page_types.h>
5#include <linux/linkage.h>
6
7#ifdef __ASSEMBLER__
8
9#define DEFINE_VDSO_IMAGE(symname, filename) \
10__PAGE_ALIGNED_DATA ; \
11 .globl symname##_start, symname##_end ; \
12 .align PAGE_SIZE ; \
13 symname##_start: ; \
14 .incbin filename ; \
15 symname##_end: ; \
16 .align PAGE_SIZE /* extra data here leaks to userspace. */ ; \
17 \
18.previous ; \
19 \
20 .globl symname##_pages ; \
21 .bss ; \
22 .align 8 ; \
23 .type symname##_pages, @object ; \
24 symname##_pages: ; \
25 .zero (symname##_end - symname##_start + PAGE_SIZE - 1) / PAGE_SIZE * (BITS_PER_LONG / 8) ; \
26 .size symname##_pages, .-symname##_pages
27
28#else
29
30#define DECLARE_VDSO_IMAGE(symname) \
31 extern char symname##_start[], symname##_end[]; \
32 extern struct page *symname##_pages[]
33
4#if defined CONFIG_X86_32 || defined CONFIG_COMPAT 34#if defined CONFIG_X86_32 || defined CONFIG_COMPAT
5extern const char VDSO32_PRELINK[]; 35
36#include <asm/vdso32.h>
37
38DECLARE_VDSO_IMAGE(vdso32_int80);
39#ifdef CONFIG_COMPAT
40DECLARE_VDSO_IMAGE(vdso32_syscall);
41#endif
42DECLARE_VDSO_IMAGE(vdso32_sysenter);
6 43
7/* 44/*
8 * Given a pointer to the vDSO image, find the pointer to VDSO32_name 45 * Given a pointer to the vDSO image, find the pointer to VDSO32_name
@@ -11,8 +48,7 @@ extern const char VDSO32_PRELINK[];
11#define VDSO32_SYMBOL(base, name) \ 48#define VDSO32_SYMBOL(base, name) \
12({ \ 49({ \
13 extern const char VDSO32_##name[]; \ 50 extern const char VDSO32_##name[]; \
14 (void __user *)(VDSO32_##name - VDSO32_PRELINK + \ 51 (void __user *)(VDSO32_##name + (unsigned long)(base)); \
15 (unsigned long)(base)); \
16}) 52})
17#endif 53#endif
18 54
@@ -23,12 +59,8 @@ extern const char VDSO32_PRELINK[];
23extern void __user __kernel_sigreturn; 59extern void __user __kernel_sigreturn;
24extern void __user __kernel_rt_sigreturn; 60extern void __user __kernel_rt_sigreturn;
25 61
26/* 62void __init patch_vdso32(void *vdso, size_t len);
27 * These symbols are defined by vdso32.S to mark the bounds 63
28 * of the ELF DSO images included therein. 64#endif /* __ASSEMBLER__ */
29 */
30extern const char vdso32_int80_start, vdso32_int80_end;
31extern const char vdso32_syscall_start, vdso32_syscall_end;
32extern const char vdso32_sysenter_start, vdso32_sysenter_end;
33 65
34#endif /* _ASM_X86_VDSO_H */ 66#endif /* _ASM_X86_VDSO_H */
diff --git a/arch/x86/include/asm/vdso32.h b/arch/x86/include/asm/vdso32.h
new file mode 100644
index 000000000000..7efb7018406e
--- /dev/null
+++ b/arch/x86/include/asm/vdso32.h
@@ -0,0 +1,11 @@
1#ifndef _ASM_X86_VDSO32_H
2#define _ASM_X86_VDSO32_H
3
4#define VDSO_BASE_PAGE 0
5#define VDSO_VVAR_PAGE 1
6#define VDSO_HPET_PAGE 2
7#define VDSO_PAGES 3
8#define VDSO_PREV_PAGES 2
9#define VDSO_OFFSET(x) ((x) * PAGE_SIZE)
10
11#endif
diff --git a/arch/x86/include/asm/vgtod.h b/arch/x86/include/asm/vgtod.h
index 46e24d36b7da..3c3366c2e37f 100644
--- a/arch/x86/include/asm/vgtod.h
+++ b/arch/x86/include/asm/vgtod.h
@@ -1,30 +1,73 @@
1#ifndef _ASM_X86_VGTOD_H 1#ifndef _ASM_X86_VGTOD_H
2#define _ASM_X86_VGTOD_H 2#define _ASM_X86_VGTOD_H
3 3
4#include <asm/vsyscall.h> 4#include <linux/compiler.h>
5#include <linux/clocksource.h> 5#include <linux/clocksource.h>
6 6
7#ifdef BUILD_VDSO32_64
8typedef u64 gtod_long_t;
9#else
10typedef unsigned long gtod_long_t;
11#endif
12/*
13 * vsyscall_gtod_data will be accessed by 32 and 64 bit code at the same time
14 * so be carefull by modifying this structure.
15 */
7struct vsyscall_gtod_data { 16struct vsyscall_gtod_data {
8 seqcount_t seq; 17 unsigned seq;
9 18
10 struct { /* extract of a clocksource struct */ 19 int vclock_mode;
11 int vclock_mode; 20 cycle_t cycle_last;
12 cycle_t cycle_last; 21 cycle_t mask;
13 cycle_t mask; 22 u32 mult;
14 u32 mult; 23 u32 shift;
15 u32 shift;
16 } clock;
17 24
18 /* open coded 'struct timespec' */ 25 /* open coded 'struct timespec' */
19 time_t wall_time_sec;
20 u64 wall_time_snsec; 26 u64 wall_time_snsec;
27 gtod_long_t wall_time_sec;
28 gtod_long_t monotonic_time_sec;
21 u64 monotonic_time_snsec; 29 u64 monotonic_time_snsec;
22 time_t monotonic_time_sec; 30 gtod_long_t wall_time_coarse_sec;
31 gtod_long_t wall_time_coarse_nsec;
32 gtod_long_t monotonic_time_coarse_sec;
33 gtod_long_t monotonic_time_coarse_nsec;
23 34
24 struct timezone sys_tz; 35 int tz_minuteswest;
25 struct timespec wall_time_coarse; 36 int tz_dsttime;
26 struct timespec monotonic_time_coarse;
27}; 37};
28extern struct vsyscall_gtod_data vsyscall_gtod_data; 38extern struct vsyscall_gtod_data vsyscall_gtod_data;
29 39
40static inline unsigned gtod_read_begin(const struct vsyscall_gtod_data *s)
41{
42 unsigned ret;
43
44repeat:
45 ret = ACCESS_ONCE(s->seq);
46 if (unlikely(ret & 1)) {
47 cpu_relax();
48 goto repeat;
49 }
50 smp_rmb();
51 return ret;
52}
53
54static inline int gtod_read_retry(const struct vsyscall_gtod_data *s,
55 unsigned start)
56{
57 smp_rmb();
58 return unlikely(s->seq != start);
59}
60
61static inline void gtod_write_begin(struct vsyscall_gtod_data *s)
62{
63 ++s->seq;
64 smp_wmb();
65}
66
67static inline void gtod_write_end(struct vsyscall_gtod_data *s)
68{
69 smp_wmb();
70 ++s->seq;
71}
72
30#endif /* _ASM_X86_VGTOD_H */ 73#endif /* _ASM_X86_VGTOD_H */
diff --git a/arch/x86/include/asm/visws/cobalt.h b/arch/x86/include/asm/visws/cobalt.h
deleted file mode 100644
index 2edb37637ead..000000000000
--- a/arch/x86/include/asm/visws/cobalt.h
+++ /dev/null
@@ -1,127 +0,0 @@
1#ifndef _ASM_X86_VISWS_COBALT_H
2#define _ASM_X86_VISWS_COBALT_H
3
4#include <asm/fixmap.h>
5
6/*
7 * Cobalt SGI Visual Workstation system ASIC
8 */
9
10#define CO_CPU_NUM_PHYS 0x1e00
11#define CO_CPU_TAB_PHYS (CO_CPU_NUM_PHYS + 2)
12
13#define CO_CPU_MAX 4
14
15#define CO_CPU_PHYS 0xc2000000
16#define CO_APIC_PHYS 0xc4000000
17
18/* see set_fixmap() and asm/fixmap.h */
19#define CO_CPU_VADDR (fix_to_virt(FIX_CO_CPU))
20#define CO_APIC_VADDR (fix_to_virt(FIX_CO_APIC))
21
22/* Cobalt CPU registers -- relative to CO_CPU_VADDR, use co_cpu_*() */
23#define CO_CPU_REV 0x08
24#define CO_CPU_CTRL 0x10
25#define CO_CPU_STAT 0x20
26#define CO_CPU_TIMEVAL 0x30
27
28/* CO_CPU_CTRL bits */
29#define CO_CTRL_TIMERUN 0x04 /* 0 == disabled */
30#define CO_CTRL_TIMEMASK 0x08 /* 0 == unmasked */
31
32/* CO_CPU_STATUS bits */
33#define CO_STAT_TIMEINTR 0x02 /* (r) 1 == int pend, (w) 0 == clear */
34
35/* CO_CPU_TIMEVAL value */
36#define CO_TIME_HZ 100000000 /* Cobalt core rate */
37
38/* Cobalt APIC registers -- relative to CO_APIC_VADDR, use co_apic_*() */
39#define CO_APIC_HI(n) (((n) * 0x10) + 4)
40#define CO_APIC_LO(n) ((n) * 0x10)
41#define CO_APIC_ID 0x0ffc
42
43/* CO_APIC_ID bits */
44#define CO_APIC_ENABLE 0x00000100
45
46/* CO_APIC_LO bits */
47#define CO_APIC_MASK 0x00010000 /* 0 = enabled */
48#define CO_APIC_LEVEL 0x00008000 /* 0 = edge */
49
50/*
51 * Where things are physically wired to Cobalt
52 * #defines with no board _<type>_<rev>_ are common to all (thus far)
53 */
54#define CO_APIC_IDE0 4
55#define CO_APIC_IDE1 2 /* Only on 320 */
56
57#define CO_APIC_8259 12 /* serial, floppy, par-l-l */
58
59/* Lithium PCI Bridge A -- "the one with 82557 Ethernet" */
60#define CO_APIC_PCIA_BASE0 0 /* and 1 */ /* slot 0, line 0 */
61#define CO_APIC_PCIA_BASE123 5 /* and 6 */ /* slot 0, line 1 */
62
63#define CO_APIC_PIIX4_USB 7 /* this one is weird */
64
65/* Lithium PCI Bridge B -- "the one with PIIX4" */
66#define CO_APIC_PCIB_BASE0 8 /* and 9-12 *//* slot 0, line 0 */
67#define CO_APIC_PCIB_BASE123 13 /* 14.15 */ /* slot 0, line 1 */
68
69#define CO_APIC_VIDOUT0 16
70#define CO_APIC_VIDOUT1 17
71#define CO_APIC_VIDIN0 18
72#define CO_APIC_VIDIN1 19
73
74#define CO_APIC_LI_AUDIO 22
75
76#define CO_APIC_AS 24
77#define CO_APIC_RE 25
78
79#define CO_APIC_CPU 28 /* Timer and Cache interrupt */
80#define CO_APIC_NMI 29
81#define CO_APIC_LAST CO_APIC_NMI
82
83/*
84 * This is how irqs are assigned on the Visual Workstation.
85 * Legacy devices get irq's 1-15 (system clock is 0 and is CO_APIC_CPU).
86 * All other devices (including PCI) go to Cobalt and are irq's 16 on up.
87 */
88#define CO_IRQ_APIC0 16 /* irq of apic entry 0 */
89#define IS_CO_APIC(irq) ((irq) >= CO_IRQ_APIC0)
90#define CO_IRQ(apic) (CO_IRQ_APIC0 + (apic)) /* apic ent to irq */
91#define CO_APIC(irq) ((irq) - CO_IRQ_APIC0) /* irq to apic ent */
92#define CO_IRQ_IDE0 14 /* knowledge of... */
93#define CO_IRQ_IDE1 15 /* ... ide driver defaults! */
94#define CO_IRQ_8259 CO_IRQ(CO_APIC_8259)
95
96#ifdef CONFIG_X86_VISWS_APIC
97static inline void co_cpu_write(unsigned long reg, unsigned long v)
98{
99 *((volatile unsigned long *)(CO_CPU_VADDR+reg))=v;
100}
101
102static inline unsigned long co_cpu_read(unsigned long reg)
103{
104 return *((volatile unsigned long *)(CO_CPU_VADDR+reg));
105}
106
107static inline void co_apic_write(unsigned long reg, unsigned long v)
108{
109 *((volatile unsigned long *)(CO_APIC_VADDR+reg))=v;
110}
111
112static inline unsigned long co_apic_read(unsigned long reg)
113{
114 return *((volatile unsigned long *)(CO_APIC_VADDR+reg));
115}
116#endif
117
118extern char visws_board_type;
119
120#define VISWS_320 0
121#define VISWS_540 1
122
123extern char visws_board_rev;
124
125extern int pci_visws_init(void);
126
127#endif /* _ASM_X86_VISWS_COBALT_H */
diff --git a/arch/x86/include/asm/visws/lithium.h b/arch/x86/include/asm/visws/lithium.h
deleted file mode 100644
index a10d89bc1270..000000000000
--- a/arch/x86/include/asm/visws/lithium.h
+++ /dev/null
@@ -1,53 +0,0 @@
1#ifndef _ASM_X86_VISWS_LITHIUM_H
2#define _ASM_X86_VISWS_LITHIUM_H
3
4#include <asm/fixmap.h>
5
6/*
7 * Lithium is the SGI Visual Workstation I/O ASIC
8 */
9
10#define LI_PCI_A_PHYS 0xfc000000 /* Enet is dev 3 */
11#define LI_PCI_B_PHYS 0xfd000000 /* PIIX4 is here */
12
13/* see set_fixmap() and asm/fixmap.h */
14#define LI_PCIA_VADDR (fix_to_virt(FIX_LI_PCIA))
15#define LI_PCIB_VADDR (fix_to_virt(FIX_LI_PCIB))
16
17/* Not a standard PCI? (not in linux/pci.h) */
18#define LI_PCI_BUSNUM 0x44 /* lo8: primary, hi8: sub */
19#define LI_PCI_INTEN 0x46
20
21/* LI_PCI_INTENT bits */
22#define LI_INTA_0 0x0001
23#define LI_INTA_1 0x0002
24#define LI_INTA_2 0x0004
25#define LI_INTA_3 0x0008
26#define LI_INTA_4 0x0010
27#define LI_INTB 0x0020
28#define LI_INTC 0x0040
29#define LI_INTD 0x0080
30
31/* More special purpose macros... */
32static inline void li_pcia_write16(unsigned long reg, unsigned short v)
33{
34 *((volatile unsigned short *)(LI_PCIA_VADDR+reg))=v;
35}
36
37static inline unsigned short li_pcia_read16(unsigned long reg)
38{
39 return *((volatile unsigned short *)(LI_PCIA_VADDR+reg));
40}
41
42static inline void li_pcib_write16(unsigned long reg, unsigned short v)
43{
44 *((volatile unsigned short *)(LI_PCIB_VADDR+reg))=v;
45}
46
47static inline unsigned short li_pcib_read16(unsigned long reg)
48{
49 return *((volatile unsigned short *)(LI_PCIB_VADDR+reg));
50}
51
52#endif /* _ASM_X86_VISWS_LITHIUM_H */
53
diff --git a/arch/x86/include/asm/visws/piix4.h b/arch/x86/include/asm/visws/piix4.h
deleted file mode 100644
index d0af4d338e7f..000000000000
--- a/arch/x86/include/asm/visws/piix4.h
+++ /dev/null
@@ -1,107 +0,0 @@
1#ifndef _ASM_X86_VISWS_PIIX4_H
2#define _ASM_X86_VISWS_PIIX4_H
3
4/*
5 * PIIX4 as used on SGI Visual Workstations
6 */
7
8#define PIIX_PM_START 0x0F80
9
10#define SIO_GPIO_START 0x0FC0
11
12#define SIO_PM_START 0x0FC8
13
14#define PMBASE PIIX_PM_START
15#define GPIREG0 (PMBASE+0x30)
16#define GPIREG(x) (GPIREG0+((x)/8))
17#define GPIBIT(x) (1 << ((x)%8))
18
19#define PIIX_GPI_BD_ID1 18
20#define PIIX_GPI_BD_ID2 19
21#define PIIX_GPI_BD_ID3 20
22#define PIIX_GPI_BD_ID4 21
23#define PIIX_GPI_BD_REG GPIREG(PIIX_GPI_BD_ID1)
24#define PIIX_GPI_BD_MASK (GPIBIT(PIIX_GPI_BD_ID1) | \
25 GPIBIT(PIIX_GPI_BD_ID2) | \
26 GPIBIT(PIIX_GPI_BD_ID3) | \
27 GPIBIT(PIIX_GPI_BD_ID4) )
28
29#define PIIX_GPI_BD_SHIFT (PIIX_GPI_BD_ID1 % 8)
30
31#define SIO_INDEX 0x2e
32#define SIO_DATA 0x2f
33
34#define SIO_DEV_SEL 0x7
35#define SIO_DEV_ENB 0x30
36#define SIO_DEV_MSB 0x60
37#define SIO_DEV_LSB 0x61
38
39#define SIO_GP_DEV 0x7
40
41#define SIO_GP_BASE SIO_GPIO_START
42#define SIO_GP_MSB (SIO_GP_BASE>>8)
43#define SIO_GP_LSB (SIO_GP_BASE&0xff)
44
45#define SIO_GP_DATA1 (SIO_GP_BASE+0)
46
47#define SIO_PM_DEV 0x8
48
49#define SIO_PM_BASE SIO_PM_START
50#define SIO_PM_MSB (SIO_PM_BASE>>8)
51#define SIO_PM_LSB (SIO_PM_BASE&0xff)
52#define SIO_PM_INDEX (SIO_PM_BASE+0)
53#define SIO_PM_DATA (SIO_PM_BASE+1)
54
55#define SIO_PM_FER2 0x1
56
57#define SIO_PM_GP_EN 0x80
58
59
60
61/*
62 * This is the dev/reg where generating a config cycle will
63 * result in a PCI special cycle.
64 */
65#define SPECIAL_DEV 0xff
66#define SPECIAL_REG 0x00
67
68/*
69 * PIIX4 needs to see a special cycle with the following data
70 * to be convinced the processor has gone into the stop grant
71 * state. PIIX4 insists on seeing this before it will power
72 * down a system.
73 */
74#define PIIX_SPECIAL_STOP 0x00120002
75
76#define PIIX4_RESET_PORT 0xcf9
77#define PIIX4_RESET_VAL 0x6
78
79#define PMSTS_PORT 0xf80 // 2 bytes PM Status
80#define PMEN_PORT 0xf82 // 2 bytes PM Enable
81#define PMCNTRL_PORT 0xf84 // 2 bytes PM Control
82
83#define PM_SUSPEND_ENABLE 0x2000 // start sequence to suspend state
84
85/*
86 * PMSTS and PMEN I/O bit definitions.
87 * (Bits are the same in both registers)
88 */
89#define PM_STS_RSM (1<<15) // Resume Status
90#define PM_STS_PWRBTNOR (1<<11) // Power Button Override
91#define PM_STS_RTC (1<<10) // RTC status
92#define PM_STS_PWRBTN (1<<8) // Power Button Pressed?
93#define PM_STS_GBL (1<<5) // Global Status
94#define PM_STS_BM (1<<4) // Bus Master Status
95#define PM_STS_TMROF (1<<0) // Timer Overflow Status.
96
97/*
98 * Stop clock GPI register
99 */
100#define PIIX_GPIREG0 (0xf80 + 0x30)
101
102/*
103 * Stop clock GPI bit in GPIREG0
104 */
105#define PIIX_GPI_STPCLK 0x4 // STPCLK signal routed back in
106
107#endif /* _ASM_X86_VISWS_PIIX4_H */
diff --git a/arch/x86/include/asm/visws/sgivw.h b/arch/x86/include/asm/visws/sgivw.h
deleted file mode 100644
index 5fbf63e1003c..000000000000
--- a/arch/x86/include/asm/visws/sgivw.h
+++ /dev/null
@@ -1,5 +0,0 @@
1/*
2 * Frame buffer position and size:
3 */
4extern unsigned long sgivwfb_mem_phys;
5extern unsigned long sgivwfb_mem_size;
diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h
index 2067264fb7f5..7004d21e6219 100644
--- a/arch/x86/include/asm/vmx.h
+++ b/arch/x86/include/asm/vmx.h
@@ -85,6 +85,7 @@
85#define VM_EXIT_SAVE_IA32_EFER 0x00100000 85#define VM_EXIT_SAVE_IA32_EFER 0x00100000
86#define VM_EXIT_LOAD_IA32_EFER 0x00200000 86#define VM_EXIT_LOAD_IA32_EFER 0x00200000
87#define VM_EXIT_SAVE_VMX_PREEMPTION_TIMER 0x00400000 87#define VM_EXIT_SAVE_VMX_PREEMPTION_TIMER 0x00400000
88#define VM_EXIT_CLEAR_BNDCFGS 0x00800000
88 89
89#define VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR 0x00036dff 90#define VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR 0x00036dff
90 91
@@ -95,6 +96,7 @@
95#define VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL 0x00002000 96#define VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL 0x00002000
96#define VM_ENTRY_LOAD_IA32_PAT 0x00004000 97#define VM_ENTRY_LOAD_IA32_PAT 0x00004000
97#define VM_ENTRY_LOAD_IA32_EFER 0x00008000 98#define VM_ENTRY_LOAD_IA32_EFER 0x00008000
99#define VM_ENTRY_LOAD_BNDCFGS 0x00010000
98 100
99#define VM_ENTRY_ALWAYSON_WITHOUT_TRUE_MSR 0x000011ff 101#define VM_ENTRY_ALWAYSON_WITHOUT_TRUE_MSR 0x000011ff
100 102
@@ -174,6 +176,8 @@ enum vmcs_field {
174 GUEST_PDPTR2_HIGH = 0x0000280f, 176 GUEST_PDPTR2_HIGH = 0x0000280f,
175 GUEST_PDPTR3 = 0x00002810, 177 GUEST_PDPTR3 = 0x00002810,
176 GUEST_PDPTR3_HIGH = 0x00002811, 178 GUEST_PDPTR3_HIGH = 0x00002811,
179 GUEST_BNDCFGS = 0x00002812,
180 GUEST_BNDCFGS_HIGH = 0x00002813,
177 HOST_IA32_PAT = 0x00002c00, 181 HOST_IA32_PAT = 0x00002c00,
178 HOST_IA32_PAT_HIGH = 0x00002c01, 182 HOST_IA32_PAT_HIGH = 0x00002c01,
179 HOST_IA32_EFER = 0x00002c02, 183 HOST_IA32_EFER = 0x00002c02,
diff --git a/arch/x86/include/asm/vvar.h b/arch/x86/include/asm/vvar.h
index d76ac40da206..081d909bc495 100644
--- a/arch/x86/include/asm/vvar.h
+++ b/arch/x86/include/asm/vvar.h
@@ -16,8 +16,8 @@
16 * you mess up, the linker will catch it.) 16 * you mess up, the linker will catch it.)
17 */ 17 */
18 18
19/* Base address of vvars. This is not ABI. */ 19#ifndef _ASM_X86_VVAR_H
20#define VVAR_ADDRESS (-10*1024*1024 - 4096) 20#define _ASM_X86_VVAR_H
21 21
22#if defined(__VVAR_KERNEL_LDS) 22#if defined(__VVAR_KERNEL_LDS)
23 23
@@ -29,16 +29,35 @@
29 29
30#else 30#else
31 31
32#ifdef BUILD_VDSO32
33
34#define DECLARE_VVAR(offset, type, name) \
35 extern type vvar_ ## name __attribute__((visibility("hidden")));
36
37#define VVAR(name) (vvar_ ## name)
38
39#else
40
41extern char __vvar_page;
42
43/* Base address of vvars. This is not ABI. */
44#ifdef CONFIG_X86_64
45#define VVAR_ADDRESS (-10*1024*1024 - 4096)
46#else
47#define VVAR_ADDRESS (&__vvar_page)
48#endif
49
32#define DECLARE_VVAR(offset, type, name) \ 50#define DECLARE_VVAR(offset, type, name) \
33 static type const * const vvaraddr_ ## name = \ 51 static type const * const vvaraddr_ ## name = \
34 (void *)(VVAR_ADDRESS + (offset)); 52 (void *)(VVAR_ADDRESS + (offset));
35 53
54#define VVAR(name) (*vvaraddr_ ## name)
55#endif
56
36#define DEFINE_VVAR(type, name) \ 57#define DEFINE_VVAR(type, name) \
37 type name \ 58 type name \
38 __attribute__((section(".vvar_" #name), aligned(16))) __visible 59 __attribute__((section(".vvar_" #name), aligned(16))) __visible
39 60
40#define VVAR(name) (*vvaraddr_ ## name)
41
42#endif 61#endif
43 62
44/* DECLARE_VVAR(offset, type, name) */ 63/* DECLARE_VVAR(offset, type, name) */
@@ -48,3 +67,5 @@ DECLARE_VVAR(16, int, vgetcpu_mode)
48DECLARE_VVAR(128, struct vsyscall_gtod_data, vsyscall_gtod_data) 67DECLARE_VVAR(128, struct vsyscall_gtod_data, vsyscall_gtod_data)
49 68
50#undef DECLARE_VVAR 69#undef DECLARE_VVAR
70
71#endif
diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h
index 3e276eb23d1b..c949923a5668 100644
--- a/arch/x86/include/asm/xen/page.h
+++ b/arch/x86/include/asm/xen/page.h
@@ -49,10 +49,17 @@ extern bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn);
49extern unsigned long set_phys_range_identity(unsigned long pfn_s, 49extern unsigned long set_phys_range_identity(unsigned long pfn_s,
50 unsigned long pfn_e); 50 unsigned long pfn_e);
51 51
52extern int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
53 struct gnttab_map_grant_ref *kmap_ops,
54 struct page **pages, unsigned int count);
52extern int m2p_add_override(unsigned long mfn, struct page *page, 55extern int m2p_add_override(unsigned long mfn, struct page *page,
53 struct gnttab_map_grant_ref *kmap_op); 56 struct gnttab_map_grant_ref *kmap_op);
57extern int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops,
58 struct gnttab_map_grant_ref *kmap_ops,
59 struct page **pages, unsigned int count);
54extern int m2p_remove_override(struct page *page, 60extern int m2p_remove_override(struct page *page,
55 struct gnttab_map_grant_ref *kmap_op); 61 struct gnttab_map_grant_ref *kmap_op,
62 unsigned long mfn);
56extern struct page *m2p_find_override(unsigned long mfn); 63extern struct page *m2p_find_override(unsigned long mfn);
57extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn); 64extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn);
58 65
@@ -121,7 +128,7 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn)
121 pfn = m2p_find_override_pfn(mfn, ~0); 128 pfn = m2p_find_override_pfn(mfn, ~0);
122 } 129 }
123 130
124 /* 131 /*
125 * pfn is ~0 if there are no entries in the m2p for mfn or if the 132 * pfn is ~0 if there are no entries in the m2p for mfn or if the
126 * entry doesn't map back to the mfn and m2p_override doesn't have a 133 * entry doesn't map back to the mfn and m2p_override doesn't have a
127 * valid entry for it. 134 * valid entry for it.
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h
index 6c1d7411eb00..d949ef28c48b 100644
--- a/arch/x86/include/asm/xsave.h
+++ b/arch/x86/include/asm/xsave.h
@@ -16,6 +16,8 @@
16#define XSTATE_Hi16_ZMM 0x80 16#define XSTATE_Hi16_ZMM 0x80
17 17
18#define XSTATE_FPSSE (XSTATE_FP | XSTATE_SSE) 18#define XSTATE_FPSSE (XSTATE_FP | XSTATE_SSE)
19/* Bit 63 of XCR0 is reserved for future expansion */
20#define XSTATE_EXTEND_MASK (~(XSTATE_FPSSE | (1ULL << 63)))
19 21
20#define FXSAVE_SIZE 512 22#define FXSAVE_SIZE 512
21 23
diff --git a/arch/x86/include/uapi/asm/msr-index.h b/arch/x86/include/uapi/asm/msr-index.h
index 4924f4be2b99..c827ace3121b 100644
--- a/arch/x86/include/uapi/asm/msr-index.h
+++ b/arch/x86/include/uapi/asm/msr-index.h
@@ -295,6 +295,7 @@
295#define MSR_SMI_COUNT 0x00000034 295#define MSR_SMI_COUNT 0x00000034
296#define MSR_IA32_FEATURE_CONTROL 0x0000003a 296#define MSR_IA32_FEATURE_CONTROL 0x0000003a
297#define MSR_IA32_TSC_ADJUST 0x0000003b 297#define MSR_IA32_TSC_ADJUST 0x0000003b
298#define MSR_IA32_BNDCFGS 0x00000d90
298 299
299#define FEATURE_CONTROL_LOCKED (1<<0) 300#define FEATURE_CONTROL_LOCKED (1<<0)
300#define FEATURE_CONTROL_VMXON_ENABLED_INSIDE_SMX (1<<1) 301#define FEATURE_CONTROL_VMXON_ENABLED_INSIDE_SMX (1<<1)
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index cb648c84b327..f4d96000d33a 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -26,7 +26,7 @@ obj-$(CONFIG_IRQ_WORK) += irq_work.o
26obj-y += probe_roms.o 26obj-y += probe_roms.o
27obj-$(CONFIG_X86_32) += i386_ksyms_32.o 27obj-$(CONFIG_X86_32) += i386_ksyms_32.o
28obj-$(CONFIG_X86_64) += sys_x86_64.o x8664_ksyms_64.o 28obj-$(CONFIG_X86_64) += sys_x86_64.o x8664_ksyms_64.o
29obj-y += syscall_$(BITS).o 29obj-y += syscall_$(BITS).o vsyscall_gtod.o
30obj-$(CONFIG_X86_64) += vsyscall_64.o 30obj-$(CONFIG_X86_64) += vsyscall_64.o
31obj-$(CONFIG_X86_64) += vsyscall_emu_64.o 31obj-$(CONFIG_X86_64) += vsyscall_emu_64.o
32obj-$(CONFIG_SYSFS) += ksysfs.o 32obj-$(CONFIG_SYSFS) += ksysfs.o
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 9f46f2b1cfc2..86281ffb96d6 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -53,10 +53,6 @@ EXPORT_SYMBOL(acpi_disabled);
53# include <asm/proto.h> 53# include <asm/proto.h>
54#endif /* X86 */ 54#endif /* X86 */
55 55
56#define BAD_MADT_ENTRY(entry, end) ( \
57 (!entry) || (unsigned long)entry + sizeof(*entry) > end || \
58 ((struct acpi_subtable_header *)entry)->length < sizeof(*entry))
59
60#define PREFIX "ACPI: " 56#define PREFIX "ACPI: "
61 57
62int acpi_noirq; /* skip ACPI IRQ initialization */ 58int acpi_noirq; /* skip ACPI IRQ initialization */
@@ -907,10 +903,6 @@ static int __init acpi_parse_madt_lapic_entries(void)
907#ifdef CONFIG_X86_IO_APIC 903#ifdef CONFIG_X86_IO_APIC
908#define MP_ISA_BUS 0 904#define MP_ISA_BUS 0
909 905
910#ifdef CONFIG_X86_ES7000
911extern int es7000_plat;
912#endif
913
914void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi) 906void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi)
915{ 907{
916 int ioapic; 908 int ioapic;
@@ -960,14 +952,6 @@ void __init mp_config_acpi_legacy_irqs(void)
960 set_bit(MP_ISA_BUS, mp_bus_not_pci); 952 set_bit(MP_ISA_BUS, mp_bus_not_pci);
961 pr_debug("Bus #%d is ISA\n", MP_ISA_BUS); 953 pr_debug("Bus #%d is ISA\n", MP_ISA_BUS);
962 954
963#ifdef CONFIG_X86_ES7000
964 /*
965 * Older generations of ES7000 have no legacy identity mappings
966 */
967 if (es7000_plat == 1)
968 return;
969#endif
970
971 /* 955 /*
972 * Use the default configuration for the IRQs 0-15. Unless 956 * Use the default configuration for the IRQs 0-15. Unless
973 * overridden by (MADT) interrupt source override entries. 957 * overridden by (MADT) interrupt source override entries.
diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c
index e69182fd01cf..4b28159e0421 100644
--- a/arch/x86/kernel/acpi/cstate.c
+++ b/arch/x86/kernel/acpi/cstate.c
@@ -87,7 +87,9 @@ static long acpi_processor_ffh_cstate_probe_cpu(void *_cx)
87 num_cstate_subtype = edx_part & MWAIT_SUBSTATE_MASK; 87 num_cstate_subtype = edx_part & MWAIT_SUBSTATE_MASK;
88 88
89 retval = 0; 89 retval = 0;
90 if (num_cstate_subtype < (cx->address & MWAIT_SUBSTATE_MASK)) { 90 /* If the HW does not support any sub-states in this C-state */
91 if (num_cstate_subtype == 0) {
92 pr_warn(FW_BUG "ACPI MWAIT C-state 0x%x not supported by HW (0x%x)\n", cx->address, edx_part);
91 retval = -1; 93 retval = -1;
92 goto out; 94 goto out;
93 } 95 }
diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c
index dec8de4e1663..f04dbb3069b8 100644
--- a/arch/x86/kernel/amd_nb.c
+++ b/arch/x86/kernel/amd_nb.c
@@ -22,6 +22,7 @@ const struct pci_device_id amd_nb_misc_ids[] = {
22 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_M10H_F3) }, 22 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_M10H_F3) },
23 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_M30H_NB_F3) }, 23 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_M30H_NB_F3) },
24 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_NB_F3) }, 24 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_NB_F3) },
25 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F3) },
25 {} 26 {}
26}; 27};
27EXPORT_SYMBOL(amd_nb_misc_ids); 28EXPORT_SYMBOL(amd_nb_misc_ids);
@@ -30,6 +31,7 @@ static const struct pci_device_id amd_nb_link_ids[] = {
30 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) }, 31 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) },
31 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_M30H_NB_F4) }, 32 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_M30H_NB_F4) },
32 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_NB_F4) }, 33 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_NB_F4) },
34 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F4) },
33 {} 35 {}
34}; 36};
35 37
diff --git a/arch/x86/kernel/apic/Makefile b/arch/x86/kernel/apic/Makefile
index 0ae0323b1f9c..dcb5b15401ce 100644
--- a/arch/x86/kernel/apic/Makefile
+++ b/arch/x86/kernel/apic/Makefile
@@ -18,10 +18,7 @@ obj-y += apic_flat_64.o
18endif 18endif
19 19
20# APIC probe will depend on the listing order here 20# APIC probe will depend on the listing order here
21obj-$(CONFIG_X86_NUMAQ) += numaq_32.o
22obj-$(CONFIG_X86_SUMMIT) += summit_32.o
23obj-$(CONFIG_X86_BIGSMP) += bigsmp_32.o 21obj-$(CONFIG_X86_BIGSMP) += bigsmp_32.o
24obj-$(CONFIG_X86_ES7000) += es7000_32.o
25 22
26# For 32bit, probe_32 need to be listed last 23# For 32bit, probe_32 need to be listed last
27obj-$(CONFIG_X86_LOCAL_APIC) += probe_$(BITS).o 24obj-$(CONFIG_X86_LOCAL_APIC) += probe_$(BITS).o
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 53e20531470e..ad28db7e6bde 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1996,7 +1996,8 @@ static inline void __smp_error_interrupt(struct pt_regs *regs)
1996 }; 1996 };
1997 1997
1998 /* First tickle the hardware, only then report what went on. -- REW */ 1998 /* First tickle the hardware, only then report what went on. -- REW */
1999 apic_write(APIC_ESR, 0); 1999 if (lapic_get_maxlvt() > 3) /* Due to the Pentium erratum 3AP. */
2000 apic_write(APIC_ESR, 0);
2000 v = apic_read(APIC_ESR); 2001 v = apic_read(APIC_ESR);
2001 ack_APIC_irq(); 2002 ack_APIC_irq();
2002 atomic_inc(&irq_err_count); 2003 atomic_inc(&irq_err_count);
@@ -2136,7 +2137,6 @@ int generic_processor_info(int apicid, int version)
2136 * 2137 *
2137 * - arch/x86/kernel/mpparse.c: MP_processor_info() 2138 * - arch/x86/kernel/mpparse.c: MP_processor_info()
2138 * - arch/x86/mm/amdtopology.c: amd_numa_init() 2139 * - arch/x86/mm/amdtopology.c: amd_numa_init()
2139 * - arch/x86/platform/visws/visws_quirks.c: MP_processor_info()
2140 * 2140 *
2141 * This function is executed with the modified 2141 * This function is executed with the modified
2142 * boot_cpu_physical_apicid. So, disabled_cpu_apicid kernel 2142 * boot_cpu_physical_apicid. So, disabled_cpu_apicid kernel
diff --git a/arch/x86/kernel/apic/es7000_32.c b/arch/x86/kernel/apic/es7000_32.c
deleted file mode 100644
index 6f8f8b348a39..000000000000
--- a/arch/x86/kernel/apic/es7000_32.c
+++ /dev/null
@@ -1,738 +0,0 @@
1/*
2 * Written by: Garry Forsgren, Unisys Corporation
3 * Natalie Protasevich, Unisys Corporation
4 *
5 * This file contains the code to configure and interface
6 * with Unisys ES7000 series hardware system manager.
7 *
8 * Copyright (c) 2003 Unisys Corporation.
9 * Copyright (C) 2009, Red Hat, Inc., Ingo Molnar
10 *
11 * All Rights Reserved.
12 *
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of version 2 of the GNU General Public License as
15 * published by the Free Software Foundation.
16 *
17 * This program is distributed in the hope that it would be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write the Free Software Foundation, Inc., 59
23 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
24 *
25 * Contact information: Unisys Corporation, Township Line & Union Meeting
26 * Roads-A, Unisys Way, Blue Bell, Pennsylvania, 19424, or:
27 *
28 * http://www.unisys.com
29 */
30
31#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
32
33#include <linux/notifier.h>
34#include <linux/spinlock.h>
35#include <linux/cpumask.h>
36#include <linux/threads.h>
37#include <linux/kernel.h>
38#include <linux/module.h>
39#include <linux/reboot.h>
40#include <linux/string.h>
41#include <linux/types.h>
42#include <linux/errno.h>
43#include <linux/acpi.h>
44#include <linux/init.h>
45#include <linux/gfp.h>
46#include <linux/nmi.h>
47#include <linux/smp.h>
48#include <linux/io.h>
49
50#include <asm/apicdef.h>
51#include <linux/atomic.h>
52#include <asm/fixmap.h>
53#include <asm/mpspec.h>
54#include <asm/setup.h>
55#include <asm/apic.h>
56#include <asm/ipi.h>
57
58/*
59 * ES7000 chipsets
60 */
61
62#define NON_UNISYS 0
63#define ES7000_CLASSIC 1
64#define ES7000_ZORRO 2
65
66#define MIP_REG 1
67#define MIP_PSAI_REG 4
68
69#define MIP_BUSY 1
70#define MIP_SPIN 0xf0000
71#define MIP_VALID 0x0100000000000000ULL
72#define MIP_SW_APIC 0x1020b
73
74#define MIP_PORT(val) ((val >> 32) & 0xffff)
75
76#define MIP_RD_LO(val) (val & 0xffffffff)
77
78struct mip_reg {
79 unsigned long long off_0x00;
80 unsigned long long off_0x08;
81 unsigned long long off_0x10;
82 unsigned long long off_0x18;
83 unsigned long long off_0x20;
84 unsigned long long off_0x28;
85 unsigned long long off_0x30;
86 unsigned long long off_0x38;
87};
88
89struct mip_reg_info {
90 unsigned long long mip_info;
91 unsigned long long delivery_info;
92 unsigned long long host_reg;
93 unsigned long long mip_reg;
94};
95
96struct psai {
97 unsigned long long entry_type;
98 unsigned long long addr;
99 unsigned long long bep_addr;
100};
101
102#ifdef CONFIG_ACPI
103
104struct es7000_oem_table {
105 struct acpi_table_header Header;
106 u32 OEMTableAddr;
107 u32 OEMTableSize;
108};
109
110static unsigned long oem_addrX;
111static unsigned long oem_size;
112
113#endif
114
115/*
116 * ES7000 Globals
117 */
118
119static volatile unsigned long *psai;
120static struct mip_reg *mip_reg;
121static struct mip_reg *host_reg;
122static int mip_port;
123static unsigned long mip_addr;
124static unsigned long host_addr;
125
126int es7000_plat;
127
128/*
129 * GSI override for ES7000 platforms.
130 */
131
132
133static int wakeup_secondary_cpu_via_mip(int cpu, unsigned long eip)
134{
135 unsigned long vect = 0, psaival = 0;
136
137 if (psai == NULL)
138 return -1;
139
140 vect = ((unsigned long)__pa(eip)/0x1000) << 16;
141 psaival = (0x1000000 | vect | cpu);
142
143 while (*psai & 0x1000000)
144 ;
145
146 *psai = psaival;
147
148 return 0;
149}
150
151static int es7000_apic_is_cluster(void)
152{
153 /* MPENTIUMIII */
154 if (boot_cpu_data.x86 == 6 &&
155 (boot_cpu_data.x86_model >= 7 && boot_cpu_data.x86_model <= 11))
156 return 1;
157
158 return 0;
159}
160
161static void setup_unisys(void)
162{
163 /*
164 * Determine the generation of the ES7000 currently running.
165 *
166 * es7000_plat = 1 if the machine is a 5xx ES7000 box
167 * es7000_plat = 2 if the machine is a x86_64 ES7000 box
168 *
169 */
170 if (!(boot_cpu_data.x86 <= 15 && boot_cpu_data.x86_model <= 2))
171 es7000_plat = ES7000_ZORRO;
172 else
173 es7000_plat = ES7000_CLASSIC;
174}
175
176/*
177 * Parse the OEM Table:
178 */
179static int parse_unisys_oem(char *oemptr)
180{
181 int i;
182 int success = 0;
183 unsigned char type, size;
184 unsigned long val;
185 char *tp = NULL;
186 struct psai *psaip = NULL;
187 struct mip_reg_info *mi;
188 struct mip_reg *host, *mip;
189
190 tp = oemptr;
191
192 tp += 8;
193
194 for (i = 0; i <= 6; i++) {
195 type = *tp++;
196 size = *tp++;
197 tp -= 2;
198 switch (type) {
199 case MIP_REG:
200 mi = (struct mip_reg_info *)tp;
201 val = MIP_RD_LO(mi->host_reg);
202 host_addr = val;
203 host = (struct mip_reg *)val;
204 host_reg = __va(host);
205 val = MIP_RD_LO(mi->mip_reg);
206 mip_port = MIP_PORT(mi->mip_info);
207 mip_addr = val;
208 mip = (struct mip_reg *)val;
209 mip_reg = __va(mip);
210 pr_debug("host_reg = 0x%lx\n",
211 (unsigned long)host_reg);
212 pr_debug("mip_reg = 0x%lx\n",
213 (unsigned long)mip_reg);
214 success++;
215 break;
216 case MIP_PSAI_REG:
217 psaip = (struct psai *)tp;
218 if (tp != NULL) {
219 if (psaip->addr)
220 psai = __va(psaip->addr);
221 else
222 psai = NULL;
223 success++;
224 }
225 break;
226 default:
227 break;
228 }
229 tp += size;
230 }
231
232 if (success < 2)
233 es7000_plat = NON_UNISYS;
234 else
235 setup_unisys();
236
237 return es7000_plat;
238}
239
240#ifdef CONFIG_ACPI
241static int __init find_unisys_acpi_oem_table(unsigned long *oem_addr)
242{
243 struct acpi_table_header *header = NULL;
244 struct es7000_oem_table *table;
245 acpi_size tbl_size;
246 acpi_status ret;
247 int i = 0;
248
249 for (;;) {
250 ret = acpi_get_table_with_size("OEM1", i++, &header, &tbl_size);
251 if (!ACPI_SUCCESS(ret))
252 return -1;
253
254 if (!memcmp((char *) &header->oem_id, "UNISYS", 6))
255 break;
256
257 early_acpi_os_unmap_memory(header, tbl_size);
258 }
259
260 table = (void *)header;
261
262 oem_addrX = table->OEMTableAddr;
263 oem_size = table->OEMTableSize;
264
265 early_acpi_os_unmap_memory(header, tbl_size);
266
267 *oem_addr = (unsigned long)__acpi_map_table(oem_addrX, oem_size);
268
269 return 0;
270}
271
272static void __init unmap_unisys_acpi_oem_table(unsigned long oem_addr)
273{
274 if (!oem_addr)
275 return;
276
277 __acpi_unmap_table((char *)oem_addr, oem_size);
278}
279
280static int es7000_check_dsdt(void)
281{
282 struct acpi_table_header header;
283
284 if (ACPI_SUCCESS(acpi_get_table_header(ACPI_SIG_DSDT, 0, &header)) &&
285 !strncmp(header.oem_id, "UNISYS", 6))
286 return 1;
287 return 0;
288}
289
290static int es7000_acpi_ret;
291
292/* Hook from generic ACPI tables.c */
293static int __init es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
294{
295 unsigned long oem_addr = 0;
296 int check_dsdt;
297 int ret = 0;
298
299 /* check dsdt at first to avoid clear fix_map for oem_addr */
300 check_dsdt = es7000_check_dsdt();
301
302 if (!find_unisys_acpi_oem_table(&oem_addr)) {
303 if (check_dsdt) {
304 ret = parse_unisys_oem((char *)oem_addr);
305 } else {
306 setup_unisys();
307 ret = 1;
308 }
309 /*
310 * we need to unmap it
311 */
312 unmap_unisys_acpi_oem_table(oem_addr);
313 }
314
315 es7000_acpi_ret = ret;
316
317 return ret && !es7000_apic_is_cluster();
318}
319
320static int es7000_acpi_madt_oem_check_cluster(char *oem_id, char *oem_table_id)
321{
322 int ret = es7000_acpi_ret;
323
324 return ret && es7000_apic_is_cluster();
325}
326
327#else /* !CONFIG_ACPI: */
328static int es7000_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
329{
330 return 0;
331}
332
333static int es7000_acpi_madt_oem_check_cluster(char *oem_id, char *oem_table_id)
334{
335 return 0;
336}
337#endif /* !CONFIG_ACPI */
338
339static void es7000_spin(int n)
340{
341 int i = 0;
342
343 while (i++ < n)
344 rep_nop();
345}
346
347static int es7000_mip_write(struct mip_reg *mip_reg)
348{
349 int status = 0;
350 int spin;
351
352 spin = MIP_SPIN;
353 while ((host_reg->off_0x38 & MIP_VALID) != 0) {
354 if (--spin <= 0) {
355 WARN(1, "Timeout waiting for Host Valid Flag\n");
356 return -1;
357 }
358 es7000_spin(MIP_SPIN);
359 }
360
361 memcpy(host_reg, mip_reg, sizeof(struct mip_reg));
362 outb(1, mip_port);
363
364 spin = MIP_SPIN;
365
366 while ((mip_reg->off_0x38 & MIP_VALID) == 0) {
367 if (--spin <= 0) {
368 WARN(1, "Timeout waiting for MIP Valid Flag\n");
369 return -1;
370 }
371 es7000_spin(MIP_SPIN);
372 }
373
374 status = (mip_reg->off_0x00 & 0xffff0000000000ULL) >> 48;
375 mip_reg->off_0x38 &= ~MIP_VALID;
376
377 return status;
378}
379
380static void es7000_enable_apic_mode(void)
381{
382 struct mip_reg es7000_mip_reg;
383 int mip_status;
384
385 if (!es7000_plat)
386 return;
387
388 pr_info("Enabling APIC mode.\n");
389 memset(&es7000_mip_reg, 0, sizeof(struct mip_reg));
390 es7000_mip_reg.off_0x00 = MIP_SW_APIC;
391 es7000_mip_reg.off_0x38 = MIP_VALID;
392
393 while ((mip_status = es7000_mip_write(&es7000_mip_reg)) != 0)
394 WARN(1, "Command failed, status = %x\n", mip_status);
395}
396
397static unsigned int es7000_get_apic_id(unsigned long x)
398{
399 return (x >> 24) & 0xFF;
400}
401
402static void es7000_send_IPI_mask(const struct cpumask *mask, int vector)
403{
404 default_send_IPI_mask_sequence_phys(mask, vector);
405}
406
407static void es7000_send_IPI_allbutself(int vector)
408{
409 default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector);
410}
411
412static void es7000_send_IPI_all(int vector)
413{
414 es7000_send_IPI_mask(cpu_online_mask, vector);
415}
416
417static int es7000_apic_id_registered(void)
418{
419 return 1;
420}
421
422static const struct cpumask *target_cpus_cluster(void)
423{
424 return cpu_all_mask;
425}
426
427static const struct cpumask *es7000_target_cpus(void)
428{
429 return cpumask_of(smp_processor_id());
430}
431
432static unsigned long es7000_check_apicid_used(physid_mask_t *map, int apicid)
433{
434 return 0;
435}
436
437static unsigned long es7000_check_apicid_present(int bit)
438{
439 return physid_isset(bit, phys_cpu_present_map);
440}
441
442static int es7000_early_logical_apicid(int cpu)
443{
444 /* on es7000, logical apicid is the same as physical */
445 return early_per_cpu(x86_bios_cpu_apicid, cpu);
446}
447
448static unsigned long calculate_ldr(int cpu)
449{
450 unsigned long id = per_cpu(x86_bios_cpu_apicid, cpu);
451
452 return SET_APIC_LOGICAL_ID(id);
453}
454
455/*
456 * Set up the logical destination ID.
457 *
458 * Intel recommends to set DFR, LdR and TPR before enabling
459 * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
460 * document number 292116). So here it goes...
461 */
462static void es7000_init_apic_ldr_cluster(void)
463{
464 unsigned long val;
465 int cpu = smp_processor_id();
466
467 apic_write(APIC_DFR, APIC_DFR_CLUSTER);
468 val = calculate_ldr(cpu);
469 apic_write(APIC_LDR, val);
470}
471
472static void es7000_init_apic_ldr(void)
473{
474 unsigned long val;
475 int cpu = smp_processor_id();
476
477 apic_write(APIC_DFR, APIC_DFR_FLAT);
478 val = calculate_ldr(cpu);
479 apic_write(APIC_LDR, val);
480}
481
482static void es7000_setup_apic_routing(void)
483{
484 int apic = per_cpu(x86_bios_cpu_apicid, smp_processor_id());
485
486 pr_info("Enabling APIC mode: %s. Using %d I/O APICs, target cpus %lx\n",
487 (apic_version[apic] == 0x14) ?
488 "Physical Cluster" : "Logical Cluster",
489 nr_ioapics, cpumask_bits(es7000_target_cpus())[0]);
490}
491
492static int es7000_cpu_present_to_apicid(int mps_cpu)
493{
494 if (!mps_cpu)
495 return boot_cpu_physical_apicid;
496 else if (mps_cpu < nr_cpu_ids)
497 return per_cpu(x86_bios_cpu_apicid, mps_cpu);
498 else
499 return BAD_APICID;
500}
501
502static int cpu_id;
503
504static void es7000_apicid_to_cpu_present(int phys_apicid, physid_mask_t *retmap)
505{
506 physid_set_mask_of_physid(cpu_id, retmap);
507 ++cpu_id;
508}
509
510static void es7000_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap)
511{
512 /* For clustered we don't have a good way to do this yet - hack */
513 physids_promote(0xFFL, retmap);
514}
515
516static int es7000_check_phys_apicid_present(int cpu_physical_apicid)
517{
518 boot_cpu_physical_apicid = read_apic_id();
519 return 1;
520}
521
522static inline int
523es7000_cpu_mask_to_apicid(const struct cpumask *cpumask, unsigned int *dest_id)
524{
525 unsigned int round = 0;
526 unsigned int cpu, uninitialized_var(apicid);
527
528 /*
529 * The cpus in the mask must all be on the apic cluster.
530 */
531 for_each_cpu_and(cpu, cpumask, cpu_online_mask) {
532 int new_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu);
533
534 if (round && APIC_CLUSTER(apicid) != APIC_CLUSTER(new_apicid)) {
535 WARN(1, "Not a valid mask!");
536
537 return -EINVAL;
538 }
539 apicid |= new_apicid;
540 round++;
541 }
542 if (!round)
543 return -EINVAL;
544 *dest_id = apicid;
545 return 0;
546}
547
548static int
549es7000_cpu_mask_to_apicid_and(const struct cpumask *inmask,
550 const struct cpumask *andmask,
551 unsigned int *apicid)
552{
553 cpumask_var_t cpumask;
554 *apicid = early_per_cpu(x86_cpu_to_logical_apicid, 0);
555
556 if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
557 return 0;
558
559 cpumask_and(cpumask, inmask, andmask);
560 es7000_cpu_mask_to_apicid(cpumask, apicid);
561
562 free_cpumask_var(cpumask);
563
564 return 0;
565}
566
567static int es7000_phys_pkg_id(int cpuid_apic, int index_msb)
568{
569 return cpuid_apic >> index_msb;
570}
571
572static int probe_es7000(void)
573{
574 /* probed later in mptable/ACPI hooks */
575 return 0;
576}
577
578static int es7000_mps_ret;
579static int es7000_mps_oem_check(struct mpc_table *mpc, char *oem,
580 char *productid)
581{
582 int ret = 0;
583
584 if (mpc->oemptr) {
585 struct mpc_oemtable *oem_table =
586 (struct mpc_oemtable *)mpc->oemptr;
587
588 if (!strncmp(oem, "UNISYS", 6))
589 ret = parse_unisys_oem((char *)oem_table);
590 }
591
592 es7000_mps_ret = ret;
593
594 return ret && !es7000_apic_is_cluster();
595}
596
597static int es7000_mps_oem_check_cluster(struct mpc_table *mpc, char *oem,
598 char *productid)
599{
600 int ret = es7000_mps_ret;
601
602 return ret && es7000_apic_is_cluster();
603}
604
605/* We've been warned by a false positive warning.Use __refdata to keep calm. */
606static struct apic __refdata apic_es7000_cluster = {
607
608 .name = "es7000",
609 .probe = probe_es7000,
610 .acpi_madt_oem_check = es7000_acpi_madt_oem_check_cluster,
611 .apic_id_valid = default_apic_id_valid,
612 .apic_id_registered = es7000_apic_id_registered,
613
614 .irq_delivery_mode = dest_LowestPrio,
615 /* logical delivery broadcast to all procs: */
616 .irq_dest_mode = 1,
617
618 .target_cpus = target_cpus_cluster,
619 .disable_esr = 1,
620 .dest_logical = 0,
621 .check_apicid_used = es7000_check_apicid_used,
622 .check_apicid_present = es7000_check_apicid_present,
623
624 .vector_allocation_domain = flat_vector_allocation_domain,
625 .init_apic_ldr = es7000_init_apic_ldr_cluster,
626
627 .ioapic_phys_id_map = es7000_ioapic_phys_id_map,
628 .setup_apic_routing = es7000_setup_apic_routing,
629 .multi_timer_check = NULL,
630 .cpu_present_to_apicid = es7000_cpu_present_to_apicid,
631 .apicid_to_cpu_present = es7000_apicid_to_cpu_present,
632 .setup_portio_remap = NULL,
633 .check_phys_apicid_present = es7000_check_phys_apicid_present,
634 .enable_apic_mode = es7000_enable_apic_mode,
635 .phys_pkg_id = es7000_phys_pkg_id,
636 .mps_oem_check = es7000_mps_oem_check_cluster,
637
638 .get_apic_id = es7000_get_apic_id,
639 .set_apic_id = NULL,
640 .apic_id_mask = 0xFF << 24,
641
642 .cpu_mask_to_apicid_and = es7000_cpu_mask_to_apicid_and,
643
644 .send_IPI_mask = es7000_send_IPI_mask,
645 .send_IPI_mask_allbutself = NULL,
646 .send_IPI_allbutself = es7000_send_IPI_allbutself,
647 .send_IPI_all = es7000_send_IPI_all,
648 .send_IPI_self = default_send_IPI_self,
649
650 .wakeup_secondary_cpu = wakeup_secondary_cpu_via_mip,
651
652 .trampoline_phys_low = 0x467,
653 .trampoline_phys_high = 0x469,
654
655 .wait_for_init_deassert = false,
656 /* Nothing to do for most platforms, since cleared by the INIT cycle: */
657 .smp_callin_clear_local_apic = NULL,
658 .inquire_remote_apic = default_inquire_remote_apic,
659
660 .read = native_apic_mem_read,
661 .write = native_apic_mem_write,
662 .eoi_write = native_apic_mem_write,
663 .icr_read = native_apic_icr_read,
664 .icr_write = native_apic_icr_write,
665 .wait_icr_idle = native_apic_wait_icr_idle,
666 .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
667
668 .x86_32_early_logical_apicid = es7000_early_logical_apicid,
669};
670
671static struct apic __refdata apic_es7000 = {
672
673 .name = "es7000",
674 .probe = probe_es7000,
675 .acpi_madt_oem_check = es7000_acpi_madt_oem_check,
676 .apic_id_valid = default_apic_id_valid,
677 .apic_id_registered = es7000_apic_id_registered,
678
679 .irq_delivery_mode = dest_Fixed,
680 /* phys delivery to target CPUs: */
681 .irq_dest_mode = 0,
682
683 .target_cpus = es7000_target_cpus,
684 .disable_esr = 1,
685 .dest_logical = 0,
686 .check_apicid_used = es7000_check_apicid_used,
687 .check_apicid_present = es7000_check_apicid_present,
688
689 .vector_allocation_domain = flat_vector_allocation_domain,
690 .init_apic_ldr = es7000_init_apic_ldr,
691
692 .ioapic_phys_id_map = es7000_ioapic_phys_id_map,
693 .setup_apic_routing = es7000_setup_apic_routing,
694 .multi_timer_check = NULL,
695 .cpu_present_to_apicid = es7000_cpu_present_to_apicid,
696 .apicid_to_cpu_present = es7000_apicid_to_cpu_present,
697 .setup_portio_remap = NULL,
698 .check_phys_apicid_present = es7000_check_phys_apicid_present,
699 .enable_apic_mode = es7000_enable_apic_mode,
700 .phys_pkg_id = es7000_phys_pkg_id,
701 .mps_oem_check = es7000_mps_oem_check,
702
703 .get_apic_id = es7000_get_apic_id,
704 .set_apic_id = NULL,
705 .apic_id_mask = 0xFF << 24,
706
707 .cpu_mask_to_apicid_and = es7000_cpu_mask_to_apicid_and,
708
709 .send_IPI_mask = es7000_send_IPI_mask,
710 .send_IPI_mask_allbutself = NULL,
711 .send_IPI_allbutself = es7000_send_IPI_allbutself,
712 .send_IPI_all = es7000_send_IPI_all,
713 .send_IPI_self = default_send_IPI_self,
714
715 .trampoline_phys_low = 0x467,
716 .trampoline_phys_high = 0x469,
717
718 .wait_for_init_deassert = true,
719 /* Nothing to do for most platforms, since cleared by the INIT cycle: */
720 .smp_callin_clear_local_apic = NULL,
721 .inquire_remote_apic = default_inquire_remote_apic,
722
723 .read = native_apic_mem_read,
724 .write = native_apic_mem_write,
725 .eoi_write = native_apic_mem_write,
726 .icr_read = native_apic_icr_read,
727 .icr_write = native_apic_icr_write,
728 .wait_icr_idle = native_apic_wait_icr_idle,
729 .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
730
731 .x86_32_early_logical_apicid = es7000_early_logical_apicid,
732};
733
734/*
735 * Need to check for es7000 followed by es7000_cluster, so this order
736 * in apic_drivers is important.
737 */
738apic_drivers(apic_es7000, apic_es7000_cluster);
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c
deleted file mode 100644
index 030ea1c04f72..000000000000
--- a/arch/x86/kernel/apic/numaq_32.c
+++ /dev/null
@@ -1,524 +0,0 @@
1/*
2 * Written by: Patricia Gaughen, IBM Corporation
3 *
4 * Copyright (C) 2002, IBM Corp.
5 * Copyright (C) 2009, Red Hat, Inc., Ingo Molnar
6 *
7 * All rights reserved.
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, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
17 * NON INFRINGEMENT. See the GNU General Public License for more
18 * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
23 *
24 * Send feedback to <gone@us.ibm.com>
25 */
26#include <linux/nodemask.h>
27#include <linux/topology.h>
28#include <linux/bootmem.h>
29#include <linux/memblock.h>
30#include <linux/threads.h>
31#include <linux/cpumask.h>
32#include <linux/kernel.h>
33#include <linux/mmzone.h>
34#include <linux/module.h>
35#include <linux/string.h>
36#include <linux/init.h>
37#include <linux/numa.h>
38#include <linux/smp.h>
39#include <linux/io.h>
40#include <linux/mm.h>
41
42#include <asm/processor.h>
43#include <asm/fixmap.h>
44#include <asm/mpspec.h>
45#include <asm/numaq.h>
46#include <asm/setup.h>
47#include <asm/apic.h>
48#include <asm/e820.h>
49#include <asm/ipi.h>
50
51int found_numaq;
52
53/*
54 * Have to match translation table entries to main table entries by counter
55 * hence the mpc_record variable .... can't see a less disgusting way of
56 * doing this ....
57 */
58struct mpc_trans {
59 unsigned char mpc_type;
60 unsigned char trans_len;
61 unsigned char trans_type;
62 unsigned char trans_quad;
63 unsigned char trans_global;
64 unsigned char trans_local;
65 unsigned short trans_reserved;
66};
67
68static int mpc_record;
69
70static struct mpc_trans *translation_table[MAX_MPC_ENTRY];
71
72int mp_bus_id_to_node[MAX_MP_BUSSES];
73int mp_bus_id_to_local[MAX_MP_BUSSES];
74int quad_local_to_mp_bus_id[NR_CPUS/4][4];
75
76
77static inline void numaq_register_node(int node, struct sys_cfg_data *scd)
78{
79 struct eachquadmem *eq = scd->eq + node;
80 u64 start = (u64)(eq->hi_shrd_mem_start - eq->priv_mem_size) << 20;
81 u64 end = (u64)(eq->hi_shrd_mem_start + eq->hi_shrd_mem_size) << 20;
82 int ret;
83
84 node_set(node, numa_nodes_parsed);
85 ret = numa_add_memblk(node, start, end);
86 BUG_ON(ret < 0);
87}
88
89/*
90 * Function: smp_dump_qct()
91 *
92 * Description: gets memory layout from the quad config table. This
93 * function also updates numa_nodes_parsed with the nodes (quads) present.
94 */
95static void __init smp_dump_qct(void)
96{
97 struct sys_cfg_data *scd;
98 int node;
99
100 scd = (void *)__va(SYS_CFG_DATA_PRIV_ADDR);
101
102 for_each_node(node) {
103 if (scd->quads_present31_0 & (1 << node))
104 numaq_register_node(node, scd);
105 }
106}
107
108void numaq_tsc_disable(void)
109{
110 if (!found_numaq)
111 return;
112
113 if (num_online_nodes() > 1) {
114 printk(KERN_DEBUG "NUMAQ: disabling TSC\n");
115 setup_clear_cpu_cap(X86_FEATURE_TSC);
116 }
117}
118
119static void __init numaq_tsc_init(void)
120{
121 numaq_tsc_disable();
122}
123
124static inline int generate_logical_apicid(int quad, int phys_apicid)
125{
126 return (quad << 4) + (phys_apicid ? phys_apicid << 1 : 1);
127}
128
129/* x86_quirks member */
130static int mpc_apic_id(struct mpc_cpu *m)
131{
132 int quad = translation_table[mpc_record]->trans_quad;
133 int logical_apicid = generate_logical_apicid(quad, m->apicid);
134
135 printk(KERN_DEBUG
136 "Processor #%d %u:%u APIC version %d (quad %d, apic %d)\n",
137 m->apicid, (m->cpufeature & CPU_FAMILY_MASK) >> 8,
138 (m->cpufeature & CPU_MODEL_MASK) >> 4,
139 m->apicver, quad, logical_apicid);
140
141 return logical_apicid;
142}
143
144/* x86_quirks member */
145static void mpc_oem_bus_info(struct mpc_bus *m, char *name)
146{
147 int quad = translation_table[mpc_record]->trans_quad;
148 int local = translation_table[mpc_record]->trans_local;
149
150 mp_bus_id_to_node[m->busid] = quad;
151 mp_bus_id_to_local[m->busid] = local;
152
153 printk(KERN_INFO "Bus #%d is %s (node %d)\n", m->busid, name, quad);
154}
155
156/* x86_quirks member */
157static void mpc_oem_pci_bus(struct mpc_bus *m)
158{
159 int quad = translation_table[mpc_record]->trans_quad;
160 int local = translation_table[mpc_record]->trans_local;
161
162 quad_local_to_mp_bus_id[quad][local] = m->busid;
163}
164
165/*
166 * Called from mpparse code.
167 * mode = 0: prescan
168 * mode = 1: one mpc entry scanned
169 */
170static void numaq_mpc_record(unsigned int mode)
171{
172 if (!mode)
173 mpc_record = 0;
174 else
175 mpc_record++;
176}
177
178static void __init MP_translation_info(struct mpc_trans *m)
179{
180 printk(KERN_INFO
181 "Translation: record %d, type %d, quad %d, global %d, local %d\n",
182 mpc_record, m->trans_type, m->trans_quad, m->trans_global,
183 m->trans_local);
184
185 if (mpc_record >= MAX_MPC_ENTRY)
186 printk(KERN_ERR "MAX_MPC_ENTRY exceeded!\n");
187 else
188 translation_table[mpc_record] = m; /* stash this for later */
189
190 if (m->trans_quad < MAX_NUMNODES && !node_online(m->trans_quad))
191 node_set_online(m->trans_quad);
192}
193
194static int __init mpf_checksum(unsigned char *mp, int len)
195{
196 int sum = 0;
197
198 while (len--)
199 sum += *mp++;
200
201 return sum & 0xFF;
202}
203
204/*
205 * Read/parse the MPC oem tables
206 */
207static void __init smp_read_mpc_oem(struct mpc_table *mpc)
208{
209 struct mpc_oemtable *oemtable = (void *)(long)mpc->oemptr;
210 int count = sizeof(*oemtable); /* the header size */
211 unsigned char *oemptr = ((unsigned char *)oemtable) + count;
212
213 mpc_record = 0;
214 printk(KERN_INFO
215 "Found an OEM MPC table at %8p - parsing it...\n", oemtable);
216
217 if (memcmp(oemtable->signature, MPC_OEM_SIGNATURE, 4)) {
218 printk(KERN_WARNING
219 "SMP mpc oemtable: bad signature [%c%c%c%c]!\n",
220 oemtable->signature[0], oemtable->signature[1],
221 oemtable->signature[2], oemtable->signature[3]);
222 return;
223 }
224
225 if (mpf_checksum((unsigned char *)oemtable, oemtable->length)) {
226 printk(KERN_WARNING "SMP oem mptable: checksum error!\n");
227 return;
228 }
229
230 while (count < oemtable->length) {
231 switch (*oemptr) {
232 case MP_TRANSLATION:
233 {
234 struct mpc_trans *m = (void *)oemptr;
235
236 MP_translation_info(m);
237 oemptr += sizeof(*m);
238 count += sizeof(*m);
239 ++mpc_record;
240 break;
241 }
242 default:
243 printk(KERN_WARNING
244 "Unrecognised OEM table entry type! - %d\n",
245 (int)*oemptr);
246 return;
247 }
248 }
249}
250
251static __init void early_check_numaq(void)
252{
253 /*
254 * get boot-time SMP configuration:
255 */
256 if (smp_found_config)
257 early_get_smp_config();
258
259 if (found_numaq) {
260 x86_init.mpparse.mpc_record = numaq_mpc_record;
261 x86_init.mpparse.setup_ioapic_ids = x86_init_noop;
262 x86_init.mpparse.mpc_apic_id = mpc_apic_id;
263 x86_init.mpparse.smp_read_mpc_oem = smp_read_mpc_oem;
264 x86_init.mpparse.mpc_oem_pci_bus = mpc_oem_pci_bus;
265 x86_init.mpparse.mpc_oem_bus_info = mpc_oem_bus_info;
266 x86_init.timers.tsc_pre_init = numaq_tsc_init;
267 x86_init.pci.init = pci_numaq_init;
268 }
269}
270
271int __init numaq_numa_init(void)
272{
273 early_check_numaq();
274 if (!found_numaq)
275 return -ENOENT;
276 smp_dump_qct();
277
278 return 0;
279}
280
281#define NUMAQ_APIC_DFR_VALUE (APIC_DFR_CLUSTER)
282
283static inline unsigned int numaq_get_apic_id(unsigned long x)
284{
285 return (x >> 24) & 0x0F;
286}
287
288static inline void numaq_send_IPI_mask(const struct cpumask *mask, int vector)
289{
290 default_send_IPI_mask_sequence_logical(mask, vector);
291}
292
293static inline void numaq_send_IPI_allbutself(int vector)
294{
295 default_send_IPI_mask_allbutself_logical(cpu_online_mask, vector);
296}
297
298static inline void numaq_send_IPI_all(int vector)
299{
300 numaq_send_IPI_mask(cpu_online_mask, vector);
301}
302
303#define NUMAQ_TRAMPOLINE_PHYS_LOW (0x8)
304#define NUMAQ_TRAMPOLINE_PHYS_HIGH (0xa)
305
306/*
307 * Because we use NMIs rather than the INIT-STARTUP sequence to
308 * bootstrap the CPUs, the APIC may be in a weird state. Kick it:
309 */
310static inline void numaq_smp_callin_clear_local_apic(void)
311{
312 clear_local_APIC();
313}
314
315static inline const struct cpumask *numaq_target_cpus(void)
316{
317 return cpu_all_mask;
318}
319
320static unsigned long numaq_check_apicid_used(physid_mask_t *map, int apicid)
321{
322 return physid_isset(apicid, *map);
323}
324
325static inline unsigned long numaq_check_apicid_present(int bit)
326{
327 return physid_isset(bit, phys_cpu_present_map);
328}
329
330static inline int numaq_apic_id_registered(void)
331{
332 return 1;
333}
334
335static inline void numaq_init_apic_ldr(void)
336{
337 /* Already done in NUMA-Q firmware */
338}
339
340static inline void numaq_setup_apic_routing(void)
341{
342 printk(KERN_INFO
343 "Enabling APIC mode: NUMA-Q. Using %d I/O APICs\n",
344 nr_ioapics);
345}
346
347/*
348 * Skip adding the timer int on secondary nodes, which causes
349 * a small but painful rift in the time-space continuum.
350 */
351static inline int numaq_multi_timer_check(int apic, int irq)
352{
353 return apic != 0 && irq == 0;
354}
355
356static inline void numaq_ioapic_phys_id_map(physid_mask_t *phys_map, physid_mask_t *retmap)
357{
358 /* We don't have a good way to do this yet - hack */
359 return physids_promote(0xFUL, retmap);
360}
361
362/*
363 * Supporting over 60 cpus on NUMA-Q requires a locality-dependent
364 * cpu to APIC ID relation to properly interact with the intelligent
365 * mode of the cluster controller.
366 */
367static inline int numaq_cpu_present_to_apicid(int mps_cpu)
368{
369 if (mps_cpu < 60)
370 return ((mps_cpu >> 2) << 4) | (1 << (mps_cpu & 0x3));
371 else
372 return BAD_APICID;
373}
374
375static inline int numaq_apicid_to_node(int logical_apicid)
376{
377 return logical_apicid >> 4;
378}
379
380static int numaq_numa_cpu_node(int cpu)
381{
382 int logical_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu);
383
384 if (logical_apicid != BAD_APICID)
385 return numaq_apicid_to_node(logical_apicid);
386 return NUMA_NO_NODE;
387}
388
389static void numaq_apicid_to_cpu_present(int logical_apicid, physid_mask_t *retmap)
390{
391 int node = numaq_apicid_to_node(logical_apicid);
392 int cpu = __ffs(logical_apicid & 0xf);
393
394 physid_set_mask_of_physid(cpu + 4*node, retmap);
395}
396
397/* Where the IO area was mapped on multiquad, always 0 otherwise */
398void *xquad_portio;
399
400static inline int numaq_check_phys_apicid_present(int phys_apicid)
401{
402 return 1;
403}
404
405/*
406 * We use physical apicids here, not logical, so just return the default
407 * physical broadcast to stop people from breaking us
408 */
409static int
410numaq_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
411 const struct cpumask *andmask,
412 unsigned int *apicid)
413{
414 *apicid = 0x0F;
415 return 0;
416}
417
418/* No NUMA-Q box has a HT CPU, but it can't hurt to use the default code. */
419static inline int numaq_phys_pkg_id(int cpuid_apic, int index_msb)
420{
421 return cpuid_apic >> index_msb;
422}
423
424static int
425numaq_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
426{
427 if (strncmp(oem, "IBM NUMA", 8))
428 printk(KERN_ERR "Warning! Not a NUMA-Q system!\n");
429 else
430 found_numaq = 1;
431
432 return found_numaq;
433}
434
435static int probe_numaq(void)
436{
437 /* already know from get_memcfg_numaq() */
438 return found_numaq;
439}
440
441static void numaq_setup_portio_remap(void)
442{
443 int num_quads = num_online_nodes();
444
445 if (num_quads <= 1)
446 return;
447
448 printk(KERN_INFO
449 "Remapping cross-quad port I/O for %d quads\n", num_quads);
450
451 xquad_portio = ioremap(XQUAD_PORTIO_BASE, num_quads*XQUAD_PORTIO_QUAD);
452
453 printk(KERN_INFO
454 "xquad_portio vaddr 0x%08lx, len %08lx\n",
455 (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD);
456}
457
458/* Use __refdata to keep false positive warning calm. */
459static struct apic __refdata apic_numaq = {
460
461 .name = "NUMAQ",
462 .probe = probe_numaq,
463 .acpi_madt_oem_check = NULL,
464 .apic_id_valid = default_apic_id_valid,
465 .apic_id_registered = numaq_apic_id_registered,
466
467 .irq_delivery_mode = dest_LowestPrio,
468 /* physical delivery on LOCAL quad: */
469 .irq_dest_mode = 0,
470
471 .target_cpus = numaq_target_cpus,
472 .disable_esr = 1,
473 .dest_logical = APIC_DEST_LOGICAL,
474 .check_apicid_used = numaq_check_apicid_used,
475 .check_apicid_present = numaq_check_apicid_present,
476
477 .vector_allocation_domain = flat_vector_allocation_domain,
478 .init_apic_ldr = numaq_init_apic_ldr,
479
480 .ioapic_phys_id_map = numaq_ioapic_phys_id_map,
481 .setup_apic_routing = numaq_setup_apic_routing,
482 .multi_timer_check = numaq_multi_timer_check,
483 .cpu_present_to_apicid = numaq_cpu_present_to_apicid,
484 .apicid_to_cpu_present = numaq_apicid_to_cpu_present,
485 .setup_portio_remap = numaq_setup_portio_remap,
486 .check_phys_apicid_present = numaq_check_phys_apicid_present,
487 .enable_apic_mode = NULL,
488 .phys_pkg_id = numaq_phys_pkg_id,
489 .mps_oem_check = numaq_mps_oem_check,
490
491 .get_apic_id = numaq_get_apic_id,
492 .set_apic_id = NULL,
493 .apic_id_mask = 0x0F << 24,
494
495 .cpu_mask_to_apicid_and = numaq_cpu_mask_to_apicid_and,
496
497 .send_IPI_mask = numaq_send_IPI_mask,
498 .send_IPI_mask_allbutself = NULL,
499 .send_IPI_allbutself = numaq_send_IPI_allbutself,
500 .send_IPI_all = numaq_send_IPI_all,
501 .send_IPI_self = default_send_IPI_self,
502
503 .wakeup_secondary_cpu = wakeup_secondary_cpu_via_nmi,
504 .trampoline_phys_low = NUMAQ_TRAMPOLINE_PHYS_LOW,
505 .trampoline_phys_high = NUMAQ_TRAMPOLINE_PHYS_HIGH,
506
507 /* We don't do anything here because we use NMI's to boot instead */
508 .wait_for_init_deassert = false,
509 .smp_callin_clear_local_apic = numaq_smp_callin_clear_local_apic,
510 .inquire_remote_apic = NULL,
511
512 .read = native_apic_mem_read,
513 .write = native_apic_mem_write,
514 .eoi_write = native_apic_mem_write,
515 .icr_read = native_apic_icr_read,
516 .icr_write = native_apic_icr_write,
517 .wait_icr_idle = native_apic_wait_icr_idle,
518 .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
519
520 .x86_32_early_logical_apicid = noop_x86_32_early_logical_apicid,
521 .x86_32_numa_cpu_node = numaq_numa_cpu_node,
522};
523
524apic_driver(apic_numaq);
diff --git a/arch/x86/kernel/apic/summit_32.c b/arch/x86/kernel/apic/summit_32.c
deleted file mode 100644
index b656128611cd..000000000000
--- a/arch/x86/kernel/apic/summit_32.c
+++ /dev/null
@@ -1,550 +0,0 @@
1/*
2 * IBM Summit-Specific Code
3 *
4 * Written By: Matthew Dobson, IBM Corporation
5 *
6 * Copyright (c) 2003 IBM Corp.
7 *
8 * All rights reserved.
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 (at
13 * your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
18 * NON INFRINGEMENT. See the GNU General Public License for more
19 * details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 *
25 * Send feedback to <colpatch@us.ibm.com>
26 *
27 */
28
29#define pr_fmt(fmt) "summit: %s: " fmt, __func__
30
31#include <linux/mm.h>
32#include <asm/io.h>
33#include <asm/bios_ebda.h>
34
35/*
36 * APIC driver for the IBM "Summit" chipset.
37 */
38#include <linux/threads.h>
39#include <linux/cpumask.h>
40#include <asm/mpspec.h>
41#include <asm/apic.h>
42#include <asm/smp.h>
43#include <asm/fixmap.h>
44#include <asm/apicdef.h>
45#include <asm/ipi.h>
46#include <linux/kernel.h>
47#include <linux/string.h>
48#include <linux/gfp.h>
49#include <linux/smp.h>
50
51static unsigned summit_get_apic_id(unsigned long x)
52{
53 return (x >> 24) & 0xFF;
54}
55
56static inline void summit_send_IPI_mask(const struct cpumask *mask, int vector)
57{
58 default_send_IPI_mask_sequence_logical(mask, vector);
59}
60
61static void summit_send_IPI_allbutself(int vector)
62{
63 default_send_IPI_mask_allbutself_logical(cpu_online_mask, vector);
64}
65
66static void summit_send_IPI_all(int vector)
67{
68 summit_send_IPI_mask(cpu_online_mask, vector);
69}
70
71#include <asm/tsc.h>
72
73extern int use_cyclone;
74
75#ifdef CONFIG_X86_SUMMIT_NUMA
76static void setup_summit(void);
77#else
78static inline void setup_summit(void) {}
79#endif
80
81static int summit_mps_oem_check(struct mpc_table *mpc, char *oem,
82 char *productid)
83{
84 if (!strncmp(oem, "IBM ENSW", 8) &&
85 (!strncmp(productid, "VIGIL SMP", 9)
86 || !strncmp(productid, "EXA", 3)
87 || !strncmp(productid, "RUTHLESS SMP", 12))){
88 mark_tsc_unstable("Summit based system");
89 use_cyclone = 1; /*enable cyclone-timer*/
90 setup_summit();
91 return 1;
92 }
93 return 0;
94}
95
96/* Hook from generic ACPI tables.c */
97static int summit_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
98{
99 if (!strncmp(oem_id, "IBM", 3) &&
100 (!strncmp(oem_table_id, "SERVIGIL", 8)
101 || !strncmp(oem_table_id, "EXA", 3))){
102 mark_tsc_unstable("Summit based system");
103 use_cyclone = 1; /*enable cyclone-timer*/
104 setup_summit();
105 return 1;
106 }
107 return 0;
108}
109
110struct rio_table_hdr {
111 unsigned char version; /* Version number of this data structure */
112 /* Version 3 adds chassis_num & WP_index */
113 unsigned char num_scal_dev; /* # of Scalability devices (Twisters for Vigil) */
114 unsigned char num_rio_dev; /* # of RIO I/O devices (Cyclones and Winnipegs) */
115} __attribute__((packed));
116
117struct scal_detail {
118 unsigned char node_id; /* Scalability Node ID */
119 unsigned long CBAR; /* Address of 1MB register space */
120 unsigned char port0node; /* Node ID port connected to: 0xFF=None */
121 unsigned char port0port; /* Port num port connected to: 0,1,2, or 0xFF=None */
122 unsigned char port1node; /* Node ID port connected to: 0xFF = None */
123 unsigned char port1port; /* Port num port connected to: 0,1,2, or 0xFF=None */
124 unsigned char port2node; /* Node ID port connected to: 0xFF = None */
125 unsigned char port2port; /* Port num port connected to: 0,1,2, or 0xFF=None */
126 unsigned char chassis_num; /* 1 based Chassis number (1 = boot node) */
127} __attribute__((packed));
128
129struct rio_detail {
130 unsigned char node_id; /* RIO Node ID */
131 unsigned long BBAR; /* Address of 1MB register space */
132 unsigned char type; /* Type of device */
133 unsigned char owner_id; /* For WPEG: Node ID of Cyclone that owns this WPEG*/
134 /* For CYC: Node ID of Twister that owns this CYC */
135 unsigned char port0node; /* Node ID port connected to: 0xFF=None */
136 unsigned char port0port; /* Port num port connected to: 0,1,2, or 0xFF=None */
137 unsigned char port1node; /* Node ID port connected to: 0xFF=None */
138 unsigned char port1port; /* Port num port connected to: 0,1,2, or 0xFF=None */
139 unsigned char first_slot; /* For WPEG: Lowest slot number below this WPEG */
140 /* For CYC: 0 */
141 unsigned char status; /* For WPEG: Bit 0 = 1 : the XAPIC is used */
142 /* = 0 : the XAPIC is not used, ie:*/
143 /* ints fwded to another XAPIC */
144 /* Bits1:7 Reserved */
145 /* For CYC: Bits0:7 Reserved */
146 unsigned char WP_index; /* For WPEG: WPEG instance index - lower ones have */
147 /* lower slot numbers/PCI bus numbers */
148 /* For CYC: No meaning */
149 unsigned char chassis_num; /* 1 based Chassis number */
150 /* For LookOut WPEGs this field indicates the */
151 /* Expansion Chassis #, enumerated from Boot */
152 /* Node WPEG external port, then Boot Node CYC */
153 /* external port, then Next Vigil chassis WPEG */
154 /* external port, etc. */
155 /* Shared Lookouts have only 1 chassis number (the */
156 /* first one assigned) */
157} __attribute__((packed));
158
159
160typedef enum {
161 CompatTwister = 0, /* Compatibility Twister */
162 AltTwister = 1, /* Alternate Twister of internal 8-way */
163 CompatCyclone = 2, /* Compatibility Cyclone */
164 AltCyclone = 3, /* Alternate Cyclone of internal 8-way */
165 CompatWPEG = 4, /* Compatibility WPEG */
166 AltWPEG = 5, /* Second Planar WPEG */
167 LookOutAWPEG = 6, /* LookOut WPEG */
168 LookOutBWPEG = 7, /* LookOut WPEG */
169} node_type;
170
171static inline int is_WPEG(struct rio_detail *rio){
172 return (rio->type == CompatWPEG || rio->type == AltWPEG ||
173 rio->type == LookOutAWPEG || rio->type == LookOutBWPEG);
174}
175
176#define SUMMIT_APIC_DFR_VALUE (APIC_DFR_CLUSTER)
177
178static const struct cpumask *summit_target_cpus(void)
179{
180 /* CPU_MASK_ALL (0xff) has undefined behaviour with
181 * dest_LowestPrio mode logical clustered apic interrupt routing
182 * Just start on cpu 0. IRQ balancing will spread load
183 */
184 return cpumask_of(0);
185}
186
187static unsigned long summit_check_apicid_used(physid_mask_t *map, int apicid)
188{
189 return 0;
190}
191
192/* we don't use the phys_cpu_present_map to indicate apicid presence */
193static unsigned long summit_check_apicid_present(int bit)
194{
195 return 1;
196}
197
198static int summit_early_logical_apicid(int cpu)
199{
200 int count = 0;
201 u8 my_id = early_per_cpu(x86_cpu_to_apicid, cpu);
202 u8 my_cluster = APIC_CLUSTER(my_id);
203#ifdef CONFIG_SMP
204 u8 lid;
205 int i;
206
207 /* Create logical APIC IDs by counting CPUs already in cluster. */
208 for (count = 0, i = nr_cpu_ids; --i >= 0; ) {
209 lid = early_per_cpu(x86_cpu_to_logical_apicid, i);
210 if (lid != BAD_APICID && APIC_CLUSTER(lid) == my_cluster)
211 ++count;
212 }
213#endif
214 /* We only have a 4 wide bitmap in cluster mode. If a deranged
215 * BIOS puts 5 CPUs in one APIC cluster, we're hosed. */
216 BUG_ON(count >= XAPIC_DEST_CPUS_SHIFT);
217 return my_cluster | (1UL << count);
218}
219
220static void summit_init_apic_ldr(void)
221{
222 int cpu = smp_processor_id();
223 unsigned long id = early_per_cpu(x86_cpu_to_logical_apicid, cpu);
224 unsigned long val;
225
226 apic_write(APIC_DFR, SUMMIT_APIC_DFR_VALUE);
227 val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
228 val |= SET_APIC_LOGICAL_ID(id);
229 apic_write(APIC_LDR, val);
230}
231
232static int summit_apic_id_registered(void)
233{
234 return 1;
235}
236
237static void summit_setup_apic_routing(void)
238{
239 pr_info("Enabling APIC mode: Summit. Using %d I/O APICs\n",
240 nr_ioapics);
241}
242
243static int summit_cpu_present_to_apicid(int mps_cpu)
244{
245 if (mps_cpu < nr_cpu_ids)
246 return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
247 else
248 return BAD_APICID;
249}
250
251static void summit_ioapic_phys_id_map(physid_mask_t *phys_id_map, physid_mask_t *retmap)
252{
253 /* For clustered we don't have a good way to do this yet - hack */
254 physids_promote(0x0FL, retmap);
255}
256
257static void summit_apicid_to_cpu_present(int apicid, physid_mask_t *retmap)
258{
259 physid_set_mask_of_physid(0, retmap);
260}
261
262static int summit_check_phys_apicid_present(int physical_apicid)
263{
264 return 1;
265}
266
267static inline int
268summit_cpu_mask_to_apicid(const struct cpumask *cpumask, unsigned int *dest_id)
269{
270 unsigned int round = 0;
271 unsigned int cpu, apicid = 0;
272
273 /*
274 * The cpus in the mask must all be on the apic cluster.
275 */
276 for_each_cpu_and(cpu, cpumask, cpu_online_mask) {
277 int new_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu);
278
279 if (round && APIC_CLUSTER(apicid) != APIC_CLUSTER(new_apicid)) {
280 pr_err("Not a valid mask!\n");
281 return -EINVAL;
282 }
283 apicid |= new_apicid;
284 round++;
285 }
286 if (!round)
287 return -EINVAL;
288 *dest_id = apicid;
289 return 0;
290}
291
292static int
293summit_cpu_mask_to_apicid_and(const struct cpumask *inmask,
294 const struct cpumask *andmask,
295 unsigned int *apicid)
296{
297 cpumask_var_t cpumask;
298 *apicid = early_per_cpu(x86_cpu_to_logical_apicid, 0);
299
300 if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
301 return 0;
302
303 cpumask_and(cpumask, inmask, andmask);
304 summit_cpu_mask_to_apicid(cpumask, apicid);
305
306 free_cpumask_var(cpumask);
307
308 return 0;
309}
310
311/*
312 * cpuid returns the value latched in the HW at reset, not the APIC ID
313 * register's value. For any box whose BIOS changes APIC IDs, like
314 * clustered APIC systems, we must use hard_smp_processor_id.
315 *
316 * See Intel's IA-32 SW Dev's Manual Vol2 under CPUID.
317 */
318static int summit_phys_pkg_id(int cpuid_apic, int index_msb)
319{
320 return hard_smp_processor_id() >> index_msb;
321}
322
323static int probe_summit(void)
324{
325 /* probed later in mptable/ACPI hooks */
326 return 0;
327}
328
329#ifdef CONFIG_X86_SUMMIT_NUMA
330static struct rio_table_hdr *rio_table_hdr;
331static struct scal_detail *scal_devs[MAX_NUMNODES];
332static struct rio_detail *rio_devs[MAX_NUMNODES*4];
333
334#ifndef CONFIG_X86_NUMAQ
335static int mp_bus_id_to_node[MAX_MP_BUSSES];
336#endif
337
338static int setup_pci_node_map_for_wpeg(int wpeg_num, int last_bus)
339{
340 int twister = 0, node = 0;
341 int i, bus, num_buses;
342
343 for (i = 0; i < rio_table_hdr->num_rio_dev; i++) {
344 if (rio_devs[i]->node_id == rio_devs[wpeg_num]->owner_id) {
345 twister = rio_devs[i]->owner_id;
346 break;
347 }
348 }
349 if (i == rio_table_hdr->num_rio_dev) {
350 pr_err("Couldn't find owner Cyclone for Winnipeg!\n");
351 return last_bus;
352 }
353
354 for (i = 0; i < rio_table_hdr->num_scal_dev; i++) {
355 if (scal_devs[i]->node_id == twister) {
356 node = scal_devs[i]->node_id;
357 break;
358 }
359 }
360 if (i == rio_table_hdr->num_scal_dev) {
361 pr_err("Couldn't find owner Twister for Cyclone!\n");
362 return last_bus;
363 }
364
365 switch (rio_devs[wpeg_num]->type) {
366 case CompatWPEG:
367 /*
368 * The Compatibility Winnipeg controls the 2 legacy buses,
369 * the 66MHz PCI bus [2 slots] and the 2 "extra" buses in case
370 * a PCI-PCI bridge card is used in either slot: total 5 buses.
371 */
372 num_buses = 5;
373 break;
374 case AltWPEG:
375 /*
376 * The Alternate Winnipeg controls the 2 133MHz buses [1 slot
377 * each], their 2 "extra" buses, the 100MHz bus [2 slots] and
378 * the "extra" buses for each of those slots: total 7 buses.
379 */
380 num_buses = 7;
381 break;
382 case LookOutAWPEG:
383 case LookOutBWPEG:
384 /*
385 * A Lookout Winnipeg controls 3 100MHz buses [2 slots each]
386 * & the "extra" buses for each of those slots: total 9 buses.
387 */
388 num_buses = 9;
389 break;
390 default:
391 pr_info("Unsupported Winnipeg type!\n");
392 return last_bus;
393 }
394
395 for (bus = last_bus; bus < last_bus + num_buses; bus++)
396 mp_bus_id_to_node[bus] = node;
397 return bus;
398}
399
400static int build_detail_arrays(void)
401{
402 unsigned long ptr;
403 int i, scal_detail_size, rio_detail_size;
404
405 if (rio_table_hdr->num_scal_dev > MAX_NUMNODES) {
406 pr_warn("MAX_NUMNODES too low! Defined as %d, but system has %d nodes\n",
407 MAX_NUMNODES, rio_table_hdr->num_scal_dev);
408 return 0;
409 }
410
411 switch (rio_table_hdr->version) {
412 default:
413 pr_warn("Invalid Rio Grande Table Version: %d\n",
414 rio_table_hdr->version);
415 return 0;
416 case 2:
417 scal_detail_size = 11;
418 rio_detail_size = 13;
419 break;
420 case 3:
421 scal_detail_size = 12;
422 rio_detail_size = 15;
423 break;
424 }
425
426 ptr = (unsigned long)rio_table_hdr + 3;
427 for (i = 0; i < rio_table_hdr->num_scal_dev; i++, ptr += scal_detail_size)
428 scal_devs[i] = (struct scal_detail *)ptr;
429
430 for (i = 0; i < rio_table_hdr->num_rio_dev; i++, ptr += rio_detail_size)
431 rio_devs[i] = (struct rio_detail *)ptr;
432
433 return 1;
434}
435
436void setup_summit(void)
437{
438 unsigned long ptr;
439 unsigned short offset;
440 int i, next_wpeg, next_bus = 0;
441
442 /* The pointer to the EBDA is stored in the word @ phys 0x40E(40:0E) */
443 ptr = get_bios_ebda();
444 ptr = (unsigned long)phys_to_virt(ptr);
445
446 rio_table_hdr = NULL;
447 offset = 0x180;
448 while (offset) {
449 /* The block id is stored in the 2nd word */
450 if (*((unsigned short *)(ptr + offset + 2)) == 0x4752) {
451 /* set the pointer past the offset & block id */
452 rio_table_hdr = (struct rio_table_hdr *)(ptr + offset + 4);
453 break;
454 }
455 /* The next offset is stored in the 1st word. 0 means no more */
456 offset = *((unsigned short *)(ptr + offset));
457 }
458 if (!rio_table_hdr) {
459 pr_err("Unable to locate Rio Grande Table in EBDA - bailing!\n");
460 return;
461 }
462
463 if (!build_detail_arrays())
464 return;
465
466 /* The first Winnipeg we're looking for has an index of 0 */
467 next_wpeg = 0;
468 do {
469 for (i = 0; i < rio_table_hdr->num_rio_dev; i++) {
470 if (is_WPEG(rio_devs[i]) && rio_devs[i]->WP_index == next_wpeg) {
471 /* It's the Winnipeg we're looking for! */
472 next_bus = setup_pci_node_map_for_wpeg(i, next_bus);
473 next_wpeg++;
474 break;
475 }
476 }
477 /*
478 * If we go through all Rio devices and don't find one with
479 * the next index, it means we've found all the Winnipegs,
480 * and thus all the PCI buses.
481 */
482 if (i == rio_table_hdr->num_rio_dev)
483 next_wpeg = 0;
484 } while (next_wpeg != 0);
485}
486#endif
487
488static struct apic apic_summit = {
489
490 .name = "summit",
491 .probe = probe_summit,
492 .acpi_madt_oem_check = summit_acpi_madt_oem_check,
493 .apic_id_valid = default_apic_id_valid,
494 .apic_id_registered = summit_apic_id_registered,
495
496 .irq_delivery_mode = dest_LowestPrio,
497 /* logical delivery broadcast to all CPUs: */
498 .irq_dest_mode = 1,
499
500 .target_cpus = summit_target_cpus,
501 .disable_esr = 1,
502 .dest_logical = APIC_DEST_LOGICAL,
503 .check_apicid_used = summit_check_apicid_used,
504 .check_apicid_present = summit_check_apicid_present,
505
506 .vector_allocation_domain = flat_vector_allocation_domain,
507 .init_apic_ldr = summit_init_apic_ldr,
508
509 .ioapic_phys_id_map = summit_ioapic_phys_id_map,
510 .setup_apic_routing = summit_setup_apic_routing,
511 .multi_timer_check = NULL,
512 .cpu_present_to_apicid = summit_cpu_present_to_apicid,
513 .apicid_to_cpu_present = summit_apicid_to_cpu_present,
514 .setup_portio_remap = NULL,
515 .check_phys_apicid_present = summit_check_phys_apicid_present,
516 .enable_apic_mode = NULL,
517 .phys_pkg_id = summit_phys_pkg_id,
518 .mps_oem_check = summit_mps_oem_check,
519
520 .get_apic_id = summit_get_apic_id,
521 .set_apic_id = NULL,
522 .apic_id_mask = 0xFF << 24,
523
524 .cpu_mask_to_apicid_and = summit_cpu_mask_to_apicid_and,
525
526 .send_IPI_mask = summit_send_IPI_mask,
527 .send_IPI_mask_allbutself = NULL,
528 .send_IPI_allbutself = summit_send_IPI_allbutself,
529 .send_IPI_all = summit_send_IPI_all,
530 .send_IPI_self = default_send_IPI_self,
531
532 .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW,
533 .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH,
534
535 .wait_for_init_deassert = true,
536 .smp_callin_clear_local_apic = NULL,
537 .inquire_remote_apic = default_inquire_remote_apic,
538
539 .read = native_apic_mem_read,
540 .write = native_apic_mem_write,
541 .eoi_write = native_apic_mem_write,
542 .icr_read = native_apic_icr_read,
543 .icr_write = native_apic_icr_write,
544 .wait_icr_idle = native_apic_wait_icr_idle,
545 .safe_wait_icr_idle = native_safe_apic_wait_icr_idle,
546
547 .x86_32_early_logical_apicid = summit_early_logical_apicid,
548};
549
550apic_driver(apic_summit);
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 897d6201ef10..a80029035bf2 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -274,10 +274,6 @@ static void intel_workarounds(struct cpuinfo_x86 *c)
274 } 274 }
275#endif 275#endif
276 276
277#ifdef CONFIG_X86_NUMAQ
278 numaq_tsc_disable();
279#endif
280
281 intel_smp_check(c); 277 intel_smp_check(c);
282} 278}
283#else 279#else
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index 0641113e2965..a952e9c85b6f 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -1225,21 +1225,24 @@ static struct notifier_block cacheinfo_cpu_notifier = {
1225 1225
1226static int __init cache_sysfs_init(void) 1226static int __init cache_sysfs_init(void)
1227{ 1227{
1228 int i; 1228 int i, err = 0;
1229 1229
1230 if (num_cache_leaves == 0) 1230 if (num_cache_leaves == 0)
1231 return 0; 1231 return 0;
1232 1232
1233 cpu_notifier_register_begin();
1233 for_each_online_cpu(i) { 1234 for_each_online_cpu(i) {
1234 int err;
1235 struct device *dev = get_cpu_device(i); 1235 struct device *dev = get_cpu_device(i);
1236 1236
1237 err = cache_add_dev(dev); 1237 err = cache_add_dev(dev);
1238 if (err) 1238 if (err)
1239 return err; 1239 goto out;
1240 } 1240 }
1241 register_hotcpu_notifier(&cacheinfo_cpu_notifier); 1241 __register_hotcpu_notifier(&cacheinfo_cpu_notifier);
1242 return 0; 1242
1243out:
1244 cpu_notifier_register_done();
1245 return err;
1243} 1246}
1244 1247
1245device_initcall(cache_sysfs_init); 1248device_initcall(cache_sysfs_init);
diff --git a/arch/x86/kernel/cpu/match.c b/arch/x86/kernel/cpu/match.c
index 36565373af87..afa9f0d487ea 100644
--- a/arch/x86/kernel/cpu/match.c
+++ b/arch/x86/kernel/cpu/match.c
@@ -47,45 +47,3 @@ const struct x86_cpu_id *x86_match_cpu(const struct x86_cpu_id *match)
47 return NULL; 47 return NULL;
48} 48}
49EXPORT_SYMBOL(x86_match_cpu); 49EXPORT_SYMBOL(x86_match_cpu);
50
51ssize_t arch_print_cpu_modalias(struct device *dev,
52 struct device_attribute *attr,
53 char *bufptr)
54{
55 int size = PAGE_SIZE;
56 int i, n;
57 char *buf = bufptr;
58
59 n = snprintf(buf, size, "x86cpu:vendor:%04X:family:%04X:"
60 "model:%04X:feature:",
61 boot_cpu_data.x86_vendor,
62 boot_cpu_data.x86,
63 boot_cpu_data.x86_model);
64 size -= n;
65 buf += n;
66 size -= 1;
67 for (i = 0; i < NCAPINTS*32; i++) {
68 if (boot_cpu_has(i)) {
69 n = snprintf(buf, size, ",%04X", i);
70 if (n >= size) {
71 WARN(1, "x86 features overflow page\n");
72 break;
73 }
74 size -= n;
75 buf += n;
76 }
77 }
78 *buf++ = '\n';
79 return buf - bufptr;
80}
81
82int arch_cpu_uevent(struct device *dev, struct kobj_uevent_env *env)
83{
84 char *buf = kzalloc(PAGE_SIZE, GFP_KERNEL);
85 if (buf) {
86 arch_print_cpu_modalias(NULL, NULL, buf);
87 add_uevent_var(env, "MODALIAS=%s", buf);
88 kfree(buf);
89 }
90 return 0;
91}
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 4d5419b249da..eeee23ff75ef 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -89,6 +89,9 @@ static DECLARE_WAIT_QUEUE_HEAD(mce_chrdev_wait);
89static DEFINE_PER_CPU(struct mce, mces_seen); 89static DEFINE_PER_CPU(struct mce, mces_seen);
90static int cpu_missing; 90static int cpu_missing;
91 91
92/* CMCI storm detection filter */
93static DEFINE_PER_CPU(unsigned long, mce_polled_error);
94
92/* 95/*
93 * MCA banks polled by the period polling timer for corrected events. 96 * MCA banks polled by the period polling timer for corrected events.
94 * With Intel CMCI, this only has MCA banks which do not support CMCI (if any). 97 * With Intel CMCI, this only has MCA banks which do not support CMCI (if any).
@@ -595,6 +598,7 @@ void machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
595{ 598{
596 struct mce m; 599 struct mce m;
597 int i; 600 int i;
601 unsigned long *v;
598 602
599 this_cpu_inc(mce_poll_count); 603 this_cpu_inc(mce_poll_count);
600 604
@@ -614,6 +618,8 @@ void machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
614 if (!(m.status & MCI_STATUS_VAL)) 618 if (!(m.status & MCI_STATUS_VAL))
615 continue; 619 continue;
616 620
621 v = &get_cpu_var(mce_polled_error);
622 set_bit(0, v);
617 /* 623 /*
618 * Uncorrected or signalled events are handled by the exception 624 * Uncorrected or signalled events are handled by the exception
619 * handler when it is enabled, so don't process those here. 625 * handler when it is enabled, so don't process those here.
@@ -1278,10 +1284,18 @@ static unsigned long mce_adjust_timer_default(unsigned long interval)
1278static unsigned long (*mce_adjust_timer)(unsigned long interval) = 1284static unsigned long (*mce_adjust_timer)(unsigned long interval) =
1279 mce_adjust_timer_default; 1285 mce_adjust_timer_default;
1280 1286
1287static int cmc_error_seen(void)
1288{
1289 unsigned long *v = &__get_cpu_var(mce_polled_error);
1290
1291 return test_and_clear_bit(0, v);
1292}
1293
1281static void mce_timer_fn(unsigned long data) 1294static void mce_timer_fn(unsigned long data)
1282{ 1295{
1283 struct timer_list *t = &__get_cpu_var(mce_timer); 1296 struct timer_list *t = &__get_cpu_var(mce_timer);
1284 unsigned long iv; 1297 unsigned long iv;
1298 int notify;
1285 1299
1286 WARN_ON(smp_processor_id() != data); 1300 WARN_ON(smp_processor_id() != data);
1287 1301
@@ -1296,7 +1310,9 @@ static void mce_timer_fn(unsigned long data)
1296 * polling interval, otherwise increase the polling interval. 1310 * polling interval, otherwise increase the polling interval.
1297 */ 1311 */
1298 iv = __this_cpu_read(mce_next_interval); 1312 iv = __this_cpu_read(mce_next_interval);
1299 if (mce_notify_irq()) { 1313 notify = mce_notify_irq();
1314 notify |= cmc_error_seen();
1315 if (notify) {
1300 iv = max(iv / 2, (unsigned long) HZ/100); 1316 iv = max(iv / 2, (unsigned long) HZ/100);
1301 } else { 1317 } else {
1302 iv = min(iv * 2, round_jiffies_relative(check_interval * HZ)); 1318 iv = min(iv * 2, round_jiffies_relative(check_interval * HZ));
@@ -2434,14 +2450,18 @@ static __init int mcheck_init_device(void)
2434 if (err) 2450 if (err)
2435 return err; 2451 return err;
2436 2452
2453 cpu_notifier_register_begin();
2437 for_each_online_cpu(i) { 2454 for_each_online_cpu(i) {
2438 err = mce_device_create(i); 2455 err = mce_device_create(i);
2439 if (err) 2456 if (err) {
2457 cpu_notifier_register_done();
2440 return err; 2458 return err;
2459 }
2441 } 2460 }
2442 2461
2443 register_syscore_ops(&mce_syscore_ops); 2462 register_syscore_ops(&mce_syscore_ops);
2444 register_hotcpu_notifier(&mce_cpu_notifier); 2463 __register_hotcpu_notifier(&mce_cpu_notifier);
2464 cpu_notifier_register_done();
2445 2465
2446 /* register character device /dev/mcelog */ 2466 /* register character device /dev/mcelog */
2447 misc_register(&mce_chrdev_device); 2467 misc_register(&mce_chrdev_device);
diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel.c b/arch/x86/kernel/cpu/mcheck/mce_intel.c
index fb6156fee6f7..3bdb95ae8c43 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_intel.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_intel.c
@@ -9,6 +9,7 @@
9#include <linux/interrupt.h> 9#include <linux/interrupt.h>
10#include <linux/percpu.h> 10#include <linux/percpu.h>
11#include <linux/sched.h> 11#include <linux/sched.h>
12#include <linux/cpumask.h>
12#include <asm/apic.h> 13#include <asm/apic.h>
13#include <asm/processor.h> 14#include <asm/processor.h>
14#include <asm/msr.h> 15#include <asm/msr.h>
@@ -137,6 +138,22 @@ unsigned long mce_intel_adjust_timer(unsigned long interval)
137 } 138 }
138} 139}
139 140
141static void cmci_storm_disable_banks(void)
142{
143 unsigned long flags, *owned;
144 int bank;
145 u64 val;
146
147 raw_spin_lock_irqsave(&cmci_discover_lock, flags);
148 owned = __get_cpu_var(mce_banks_owned);
149 for_each_set_bit(bank, owned, MAX_NR_BANKS) {
150 rdmsrl(MSR_IA32_MCx_CTL2(bank), val);
151 val &= ~MCI_CTL2_CMCI_EN;
152 wrmsrl(MSR_IA32_MCx_CTL2(bank), val);
153 }
154 raw_spin_unlock_irqrestore(&cmci_discover_lock, flags);
155}
156
140static bool cmci_storm_detect(void) 157static bool cmci_storm_detect(void)
141{ 158{
142 unsigned int cnt = __this_cpu_read(cmci_storm_cnt); 159 unsigned int cnt = __this_cpu_read(cmci_storm_cnt);
@@ -158,7 +175,7 @@ static bool cmci_storm_detect(void)
158 if (cnt <= CMCI_STORM_THRESHOLD) 175 if (cnt <= CMCI_STORM_THRESHOLD)
159 return false; 176 return false;
160 177
161 cmci_clear(); 178 cmci_storm_disable_banks();
162 __this_cpu_write(cmci_storm_state, CMCI_STORM_ACTIVE); 179 __this_cpu_write(cmci_storm_state, CMCI_STORM_ACTIVE);
163 r = atomic_add_return(1, &cmci_storm_on_cpus); 180 r = atomic_add_return(1, &cmci_storm_on_cpus);
164 mce_timer_kick(CMCI_POLL_INTERVAL); 181 mce_timer_kick(CMCI_POLL_INTERVAL);
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
index 3eec7de76efb..d921b7ee6595 100644
--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -271,9 +271,6 @@ static void thermal_throttle_remove_dev(struct device *dev)
271 sysfs_remove_group(&dev->kobj, &thermal_attr_group); 271 sysfs_remove_group(&dev->kobj, &thermal_attr_group);
272} 272}
273 273
274/* Mutex protecting device creation against CPU hotplug: */
275static DEFINE_MUTEX(therm_cpu_lock);
276
277/* Get notified when a cpu comes on/off. Be hotplug friendly. */ 274/* Get notified when a cpu comes on/off. Be hotplug friendly. */
278static int 275static int
279thermal_throttle_cpu_callback(struct notifier_block *nfb, 276thermal_throttle_cpu_callback(struct notifier_block *nfb,
@@ -289,18 +286,14 @@ thermal_throttle_cpu_callback(struct notifier_block *nfb,
289 switch (action) { 286 switch (action) {
290 case CPU_UP_PREPARE: 287 case CPU_UP_PREPARE:
291 case CPU_UP_PREPARE_FROZEN: 288 case CPU_UP_PREPARE_FROZEN:
292 mutex_lock(&therm_cpu_lock);
293 err = thermal_throttle_add_dev(dev, cpu); 289 err = thermal_throttle_add_dev(dev, cpu);
294 mutex_unlock(&therm_cpu_lock);
295 WARN_ON(err); 290 WARN_ON(err);
296 break; 291 break;
297 case CPU_UP_CANCELED: 292 case CPU_UP_CANCELED:
298 case CPU_UP_CANCELED_FROZEN: 293 case CPU_UP_CANCELED_FROZEN:
299 case CPU_DEAD: 294 case CPU_DEAD:
300 case CPU_DEAD_FROZEN: 295 case CPU_DEAD_FROZEN:
301 mutex_lock(&therm_cpu_lock);
302 thermal_throttle_remove_dev(dev); 296 thermal_throttle_remove_dev(dev);
303 mutex_unlock(&therm_cpu_lock);
304 break; 297 break;
305 } 298 }
306 return notifier_from_errno(err); 299 return notifier_from_errno(err);
@@ -319,19 +312,16 @@ static __init int thermal_throttle_init_device(void)
319 if (!atomic_read(&therm_throt_en)) 312 if (!atomic_read(&therm_throt_en))
320 return 0; 313 return 0;
321 314
322 register_hotcpu_notifier(&thermal_throttle_cpu_notifier); 315 cpu_notifier_register_begin();
323 316
324#ifdef CONFIG_HOTPLUG_CPU
325 mutex_lock(&therm_cpu_lock);
326#endif
327 /* connect live CPUs to sysfs */ 317 /* connect live CPUs to sysfs */
328 for_each_online_cpu(cpu) { 318 for_each_online_cpu(cpu) {
329 err = thermal_throttle_add_dev(get_cpu_device(cpu), cpu); 319 err = thermal_throttle_add_dev(get_cpu_device(cpu), cpu);
330 WARN_ON(err); 320 WARN_ON(err);
331 } 321 }
332#ifdef CONFIG_HOTPLUG_CPU 322
333 mutex_unlock(&therm_cpu_lock); 323 __register_hotcpu_notifier(&thermal_throttle_cpu_notifier);
334#endif 324 cpu_notifier_register_done();
335 325
336 return 0; 326 return 0;
337} 327}
diff --git a/arch/x86/kernel/cpu/perf_event_amd_ibs.c b/arch/x86/kernel/cpu/perf_event_amd_ibs.c
index 4b8e4d3cd6ea..4c36bbe3173a 100644
--- a/arch/x86/kernel/cpu/perf_event_amd_ibs.c
+++ b/arch/x86/kernel/cpu/perf_event_amd_ibs.c
@@ -926,13 +926,13 @@ static __init int amd_ibs_init(void)
926 goto out; 926 goto out;
927 927
928 perf_ibs_pm_init(); 928 perf_ibs_pm_init();
929 get_online_cpus(); 929 cpu_notifier_register_begin();
930 ibs_caps = caps; 930 ibs_caps = caps;
931 /* make ibs_caps visible to other cpus: */ 931 /* make ibs_caps visible to other cpus: */
932 smp_mb(); 932 smp_mb();
933 perf_cpu_notifier(perf_ibs_cpu_notifier);
934 smp_call_function(setup_APIC_ibs, NULL, 1); 933 smp_call_function(setup_APIC_ibs, NULL, 1);
935 put_online_cpus(); 934 __perf_cpu_notifier(perf_ibs_cpu_notifier);
935 cpu_notifier_register_done();
936 936
937 ret = perf_event_ibs_init(); 937 ret = perf_event_ibs_init();
938out: 938out:
diff --git a/arch/x86/kernel/cpu/perf_event_amd_uncore.c b/arch/x86/kernel/cpu/perf_event_amd_uncore.c
index 754291adec33..3bbdf4cd38b9 100644
--- a/arch/x86/kernel/cpu/perf_event_amd_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_amd_uncore.c
@@ -531,15 +531,16 @@ static int __init amd_uncore_init(void)
531 if (ret) 531 if (ret)
532 return -ENODEV; 532 return -ENODEV;
533 533
534 get_online_cpus(); 534 cpu_notifier_register_begin();
535
535 /* init cpus already online before registering for hotplug notifier */ 536 /* init cpus already online before registering for hotplug notifier */
536 for_each_online_cpu(cpu) { 537 for_each_online_cpu(cpu) {
537 amd_uncore_cpu_up_prepare(cpu); 538 amd_uncore_cpu_up_prepare(cpu);
538 smp_call_function_single(cpu, init_cpu_already_online, NULL, 1); 539 smp_call_function_single(cpu, init_cpu_already_online, NULL, 1);
539 } 540 }
540 541
541 register_cpu_notifier(&amd_uncore_cpu_notifier_block); 542 __register_cpu_notifier(&amd_uncore_cpu_notifier_block);
542 put_online_cpus(); 543 cpu_notifier_register_done();
543 544
544 return 0; 545 return 0;
545} 546}
diff --git a/arch/x86/kernel/cpu/perf_event_intel_rapl.c b/arch/x86/kernel/cpu/perf_event_intel_rapl.c
index 3cec947e3b98..4b9a9e9466bd 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_rapl.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_rapl.c
@@ -673,19 +673,20 @@ static int __init rapl_pmu_init(void)
673 /* unsupported */ 673 /* unsupported */
674 return 0; 674 return 0;
675 } 675 }
676 get_online_cpus(); 676
677 cpu_notifier_register_begin();
677 678
678 for_each_online_cpu(cpu) { 679 for_each_online_cpu(cpu) {
679 rapl_cpu_prepare(cpu); 680 rapl_cpu_prepare(cpu);
680 rapl_cpu_init(cpu); 681 rapl_cpu_init(cpu);
681 } 682 }
682 683
683 perf_cpu_notifier(rapl_cpu_notifier); 684 __perf_cpu_notifier(rapl_cpu_notifier);
684 685
685 ret = perf_pmu_register(&rapl_pmu_class, "power", -1); 686 ret = perf_pmu_register(&rapl_pmu_class, "power", -1);
686 if (WARN_ON(ret)) { 687 if (WARN_ON(ret)) {
687 pr_info("RAPL PMU detected, registration failed (%d), RAPL PMU disabled\n", ret); 688 pr_info("RAPL PMU detected, registration failed (%d), RAPL PMU disabled\n", ret);
688 put_online_cpus(); 689 cpu_notifier_register_done();
689 return -1; 690 return -1;
690 } 691 }
691 692
@@ -699,7 +700,7 @@ static int __init rapl_pmu_init(void)
699 hweight32(rapl_cntr_mask), 700 hweight32(rapl_cntr_mask),
700 ktime_to_ms(pmu->timer_interval)); 701 ktime_to_ms(pmu->timer_interval));
701 702
702 put_online_cpus(); 703 cpu_notifier_register_done();
703 704
704 return 0; 705 return 0;
705} 706}
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
index bd2253d40cff..65bbbea38b9c 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
@@ -4244,7 +4244,7 @@ static void __init uncore_cpumask_init(void)
4244 if (!cpumask_empty(&uncore_cpu_mask)) 4244 if (!cpumask_empty(&uncore_cpu_mask))
4245 return; 4245 return;
4246 4246
4247 get_online_cpus(); 4247 cpu_notifier_register_begin();
4248 4248
4249 for_each_online_cpu(cpu) { 4249 for_each_online_cpu(cpu) {
4250 int i, phys_id = topology_physical_package_id(cpu); 4250 int i, phys_id = topology_physical_package_id(cpu);
@@ -4263,9 +4263,9 @@ static void __init uncore_cpumask_init(void)
4263 } 4263 }
4264 on_each_cpu(uncore_cpu_setup, NULL, 1); 4264 on_each_cpu(uncore_cpu_setup, NULL, 1);
4265 4265
4266 register_cpu_notifier(&uncore_cpu_nb); 4266 __register_cpu_notifier(&uncore_cpu_nb);
4267 4267
4268 put_online_cpus(); 4268 cpu_notifier_register_done();
4269} 4269}
4270 4270
4271 4271
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index 7d9481c743f8..3225ae6c5180 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -198,14 +198,15 @@ static int __init cpuid_init(void)
198 goto out_chrdev; 198 goto out_chrdev;
199 } 199 }
200 cpuid_class->devnode = cpuid_devnode; 200 cpuid_class->devnode = cpuid_devnode;
201 get_online_cpus(); 201
202 cpu_notifier_register_begin();
202 for_each_online_cpu(i) { 203 for_each_online_cpu(i) {
203 err = cpuid_device_create(i); 204 err = cpuid_device_create(i);
204 if (err != 0) 205 if (err != 0)
205 goto out_class; 206 goto out_class;
206 } 207 }
207 register_hotcpu_notifier(&cpuid_class_cpu_notifier); 208 __register_hotcpu_notifier(&cpuid_class_cpu_notifier);
208 put_online_cpus(); 209 cpu_notifier_register_done();
209 210
210 err = 0; 211 err = 0;
211 goto out; 212 goto out;
@@ -215,7 +216,7 @@ out_class:
215 for_each_online_cpu(i) { 216 for_each_online_cpu(i) {
216 cpuid_device_destroy(i); 217 cpuid_device_destroy(i);
217 } 218 }
218 put_online_cpus(); 219 cpu_notifier_register_done();
219 class_destroy(cpuid_class); 220 class_destroy(cpuid_class);
220out_chrdev: 221out_chrdev:
221 __unregister_chrdev(CPUID_MAJOR, 0, NR_CPUS, "cpu/cpuid"); 222 __unregister_chrdev(CPUID_MAJOR, 0, NR_CPUS, "cpu/cpuid");
@@ -227,13 +228,13 @@ static void __exit cpuid_exit(void)
227{ 228{
228 int cpu = 0; 229 int cpu = 0;
229 230
230 get_online_cpus(); 231 cpu_notifier_register_begin();
231 for_each_online_cpu(cpu) 232 for_each_online_cpu(cpu)
232 cpuid_device_destroy(cpu); 233 cpuid_device_destroy(cpu);
233 class_destroy(cpuid_class); 234 class_destroy(cpuid_class);
234 __unregister_chrdev(CPUID_MAJOR, 0, NR_CPUS, "cpu/cpuid"); 235 __unregister_chrdev(CPUID_MAJOR, 0, NR_CPUS, "cpu/cpuid");
235 unregister_hotcpu_notifier(&cpuid_class_cpu_notifier); 236 __unregister_hotcpu_notifier(&cpuid_class_cpu_notifier);
236 put_online_cpus(); 237 cpu_notifier_register_done();
237} 238}
238 239
239module_init(cpuid_init); 240module_init(cpuid_init);
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
index 346b1df2412e..1abcb50b48ae 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
@@ -115,27 +115,26 @@ enum stack_type {
115}; 115};
116 116
117static enum stack_type 117static enum stack_type
118analyze_stack(int cpu, struct task_struct *task, 118analyze_stack(int cpu, struct task_struct *task, unsigned long *stack,
119 unsigned long *stack, unsigned long **stack_end, char **id) 119 unsigned long **stack_end, unsigned long *irq_stack,
120 unsigned *used, char **id)
120{ 121{
121 unsigned long *irq_stack;
122 unsigned long addr; 122 unsigned long addr;
123 unsigned used = 0;
124 123
125 addr = ((unsigned long)stack & (~(THREAD_SIZE - 1))); 124 addr = ((unsigned long)stack & (~(THREAD_SIZE - 1)));
126 if ((unsigned long)task_stack_page(task) == addr) 125 if ((unsigned long)task_stack_page(task) == addr)
127 return STACK_IS_NORMAL; 126 return STACK_IS_NORMAL;
128 127
129 *stack_end = in_exception_stack(cpu, (unsigned long)stack, 128 *stack_end = in_exception_stack(cpu, (unsigned long)stack,
130 &used, id); 129 used, id);
131 if (*stack_end) 130 if (*stack_end)
132 return STACK_IS_EXCEPTION; 131 return STACK_IS_EXCEPTION;
133 132
134 *stack_end = (unsigned long *)per_cpu(irq_stack_ptr, cpu); 133 if (!irq_stack)
135 if (!*stack_end) 134 return STACK_IS_NORMAL;
136 return STACK_IS_UNKNOWN;
137 135
138 irq_stack = *stack_end - irq_stack_size; 136 *stack_end = irq_stack;
137 irq_stack = irq_stack - irq_stack_size;
139 138
140 if (in_irq_stack(stack, irq_stack, *stack_end)) 139 if (in_irq_stack(stack, irq_stack, *stack_end))
141 return STACK_IS_IRQ; 140 return STACK_IS_IRQ;
@@ -156,8 +155,9 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
156{ 155{
157 const unsigned cpu = get_cpu(); 156 const unsigned cpu = get_cpu();
158 struct thread_info *tinfo; 157 struct thread_info *tinfo;
159 unsigned long *irq_stack; 158 unsigned long *irq_stack = (unsigned long *)per_cpu(irq_stack_ptr, cpu);
160 unsigned long dummy; 159 unsigned long dummy;
160 unsigned used = 0;
161 int graph = 0; 161 int graph = 0;
162 int done = 0; 162 int done = 0;
163 163
@@ -186,7 +186,8 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
186 enum stack_type stype; 186 enum stack_type stype;
187 char *id; 187 char *id;
188 188
189 stype = analyze_stack(cpu, task, stack, &stack_end, &id); 189 stype = analyze_stack(cpu, task, stack, &stack_end,
190 irq_stack, &used, &id);
190 191
191 /* Default finish unless specified to continue */ 192 /* Default finish unless specified to continue */
192 done = 1; 193 done = 1;
@@ -226,7 +227,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
226 * pointer (index -1 to end) in the IRQ stack: 227 * pointer (index -1 to end) in the IRQ stack:
227 */ 228 */
228 stack = (unsigned long *) (stack_end[-1]); 229 stack = (unsigned long *) (stack_end[-1]);
229 irq_stack = stack_end - irq_stack_size; 230 irq_stack = NULL;
230 ops->stack(data, "EOI"); 231 ops->stack(data, "EOI");
231 done = 0; 232 done = 0;
232 break; 233 break;
diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index 6d7d5a1260a6..b0cc3809723d 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -225,7 +225,7 @@ static void __init intel_remapping_check(int num, int slot, int func)
225 * 225 *
226 * And yes, so far on current devices the base addr is always under 4G. 226 * And yes, so far on current devices the base addr is always under 4G.
227 */ 227 */
228static u32 __init intel_stolen_base(int num, int slot, int func) 228static u32 __init intel_stolen_base(int num, int slot, int func, size_t stolen_size)
229{ 229{
230 u32 base; 230 u32 base;
231 231
@@ -244,6 +244,114 @@ static u32 __init intel_stolen_base(int num, int slot, int func)
244#define MB(x) (KB (KB (x))) 244#define MB(x) (KB (KB (x)))
245#define GB(x) (MB (KB (x))) 245#define GB(x) (MB (KB (x)))
246 246
247static size_t __init i830_tseg_size(void)
248{
249 u8 tmp = read_pci_config_byte(0, 0, 0, I830_ESMRAMC);
250
251 if (!(tmp & TSEG_ENABLE))
252 return 0;
253
254 if (tmp & I830_TSEG_SIZE_1M)
255 return MB(1);
256 else
257 return KB(512);
258}
259
260static size_t __init i845_tseg_size(void)
261{
262 u8 tmp = read_pci_config_byte(0, 0, 0, I845_ESMRAMC);
263
264 if (!(tmp & TSEG_ENABLE))
265 return 0;
266
267 switch (tmp & I845_TSEG_SIZE_MASK) {
268 case I845_TSEG_SIZE_512K:
269 return KB(512);
270 case I845_TSEG_SIZE_1M:
271 return MB(1);
272 default:
273 WARN_ON(1);
274 return 0;
275 }
276}
277
278static size_t __init i85x_tseg_size(void)
279{
280 u8 tmp = read_pci_config_byte(0, 0, 0, I85X_ESMRAMC);
281
282 if (!(tmp & TSEG_ENABLE))
283 return 0;
284
285 return MB(1);
286}
287
288static size_t __init i830_mem_size(void)
289{
290 return read_pci_config_byte(0, 0, 0, I830_DRB3) * MB(32);
291}
292
293static size_t __init i85x_mem_size(void)
294{
295 return read_pci_config_byte(0, 0, 1, I85X_DRB3) * MB(32);
296}
297
298/*
299 * On 830/845/85x the stolen memory base isn't available in any
300 * register. We need to calculate it as TOM-TSEG_SIZE-stolen_size.
301 */
302static u32 __init i830_stolen_base(int num, int slot, int func, size_t stolen_size)
303{
304 return i830_mem_size() - i830_tseg_size() - stolen_size;
305}
306
307static u32 __init i845_stolen_base(int num, int slot, int func, size_t stolen_size)
308{
309 return i830_mem_size() - i845_tseg_size() - stolen_size;
310}
311
312static u32 __init i85x_stolen_base(int num, int slot, int func, size_t stolen_size)
313{
314 return i85x_mem_size() - i85x_tseg_size() - stolen_size;
315}
316
317static u32 __init i865_stolen_base(int num, int slot, int func, size_t stolen_size)
318{
319 /*
320 * FIXME is the graphics stolen memory region
321 * always at TOUD? Ie. is it always the last
322 * one to be allocated by the BIOS?
323 */
324 return read_pci_config_16(0, 0, 0, I865_TOUD) << 16;
325}
326
327static size_t __init i830_stolen_size(int num, int slot, int func)
328{
329 size_t stolen_size;
330 u16 gmch_ctrl;
331
332 gmch_ctrl = read_pci_config_16(0, 0, 0, I830_GMCH_CTRL);
333
334 switch (gmch_ctrl & I830_GMCH_GMS_MASK) {
335 case I830_GMCH_GMS_STOLEN_512:
336 stolen_size = KB(512);
337 break;
338 case I830_GMCH_GMS_STOLEN_1024:
339 stolen_size = MB(1);
340 break;
341 case I830_GMCH_GMS_STOLEN_8192:
342 stolen_size = MB(8);
343 break;
344 case I830_GMCH_GMS_LOCAL:
345 /* local memory isn't part of the normal address space */
346 stolen_size = 0;
347 break;
348 default:
349 return 0;
350 }
351
352 return stolen_size;
353}
354
247static size_t __init gen3_stolen_size(int num, int slot, int func) 355static size_t __init gen3_stolen_size(int num, int slot, int func)
248{ 356{
249 size_t stolen_size; 357 size_t stolen_size;
@@ -310,7 +418,7 @@ static size_t __init gen6_stolen_size(int num, int slot, int func)
310 return gmch_ctrl << 25; /* 32 MB units */ 418 return gmch_ctrl << 25; /* 32 MB units */
311} 419}
312 420
313static inline size_t gen8_stolen_size(int num, int slot, int func) 421static size_t gen8_stolen_size(int num, int slot, int func)
314{ 422{
315 u16 gmch_ctrl; 423 u16 gmch_ctrl;
316 424
@@ -320,31 +428,74 @@ static inline size_t gen8_stolen_size(int num, int slot, int func)
320 return gmch_ctrl << 25; /* 32 MB units */ 428 return gmch_ctrl << 25; /* 32 MB units */
321} 429}
322 430
323typedef size_t (*stolen_size_fn)(int num, int slot, int func); 431
432struct intel_stolen_funcs {
433 size_t (*size)(int num, int slot, int func);
434 u32 (*base)(int num, int slot, int func, size_t size);
435};
436
437static const struct intel_stolen_funcs i830_stolen_funcs = {
438 .base = i830_stolen_base,
439 .size = i830_stolen_size,
440};
441
442static const struct intel_stolen_funcs i845_stolen_funcs = {
443 .base = i845_stolen_base,
444 .size = i830_stolen_size,
445};
446
447static const struct intel_stolen_funcs i85x_stolen_funcs = {
448 .base = i85x_stolen_base,
449 .size = gen3_stolen_size,
450};
451
452static const struct intel_stolen_funcs i865_stolen_funcs = {
453 .base = i865_stolen_base,
454 .size = gen3_stolen_size,
455};
456
457static const struct intel_stolen_funcs gen3_stolen_funcs = {
458 .base = intel_stolen_base,
459 .size = gen3_stolen_size,
460};
461
462static const struct intel_stolen_funcs gen6_stolen_funcs = {
463 .base = intel_stolen_base,
464 .size = gen6_stolen_size,
465};
466
467static const struct intel_stolen_funcs gen8_stolen_funcs = {
468 .base = intel_stolen_base,
469 .size = gen8_stolen_size,
470};
324 471
325static struct pci_device_id intel_stolen_ids[] __initdata = { 472static struct pci_device_id intel_stolen_ids[] __initdata = {
326 INTEL_I915G_IDS(gen3_stolen_size), 473 INTEL_I830_IDS(&i830_stolen_funcs),
327 INTEL_I915GM_IDS(gen3_stolen_size), 474 INTEL_I845G_IDS(&i845_stolen_funcs),
328 INTEL_I945G_IDS(gen3_stolen_size), 475 INTEL_I85X_IDS(&i85x_stolen_funcs),
329 INTEL_I945GM_IDS(gen3_stolen_size), 476 INTEL_I865G_IDS(&i865_stolen_funcs),
330 INTEL_VLV_M_IDS(gen6_stolen_size), 477 INTEL_I915G_IDS(&gen3_stolen_funcs),
331 INTEL_VLV_D_IDS(gen6_stolen_size), 478 INTEL_I915GM_IDS(&gen3_stolen_funcs),
332 INTEL_PINEVIEW_IDS(gen3_stolen_size), 479 INTEL_I945G_IDS(&gen3_stolen_funcs),
333 INTEL_I965G_IDS(gen3_stolen_size), 480 INTEL_I945GM_IDS(&gen3_stolen_funcs),
334 INTEL_G33_IDS(gen3_stolen_size), 481 INTEL_VLV_M_IDS(&gen6_stolen_funcs),
335 INTEL_I965GM_IDS(gen3_stolen_size), 482 INTEL_VLV_D_IDS(&gen6_stolen_funcs),
336 INTEL_GM45_IDS(gen3_stolen_size), 483 INTEL_PINEVIEW_IDS(&gen3_stolen_funcs),
337 INTEL_G45_IDS(gen3_stolen_size), 484 INTEL_I965G_IDS(&gen3_stolen_funcs),
338 INTEL_IRONLAKE_D_IDS(gen3_stolen_size), 485 INTEL_G33_IDS(&gen3_stolen_funcs),
339 INTEL_IRONLAKE_M_IDS(gen3_stolen_size), 486 INTEL_I965GM_IDS(&gen3_stolen_funcs),
340 INTEL_SNB_D_IDS(gen6_stolen_size), 487 INTEL_GM45_IDS(&gen3_stolen_funcs),
341 INTEL_SNB_M_IDS(gen6_stolen_size), 488 INTEL_G45_IDS(&gen3_stolen_funcs),
342 INTEL_IVB_M_IDS(gen6_stolen_size), 489 INTEL_IRONLAKE_D_IDS(&gen3_stolen_funcs),
343 INTEL_IVB_D_IDS(gen6_stolen_size), 490 INTEL_IRONLAKE_M_IDS(&gen3_stolen_funcs),
344 INTEL_HSW_D_IDS(gen6_stolen_size), 491 INTEL_SNB_D_IDS(&gen6_stolen_funcs),
345 INTEL_HSW_M_IDS(gen6_stolen_size), 492 INTEL_SNB_M_IDS(&gen6_stolen_funcs),
346 INTEL_BDW_M_IDS(gen8_stolen_size), 493 INTEL_IVB_M_IDS(&gen6_stolen_funcs),
347 INTEL_BDW_D_IDS(gen8_stolen_size) 494 INTEL_IVB_D_IDS(&gen6_stolen_funcs),
495 INTEL_HSW_D_IDS(&gen6_stolen_funcs),
496 INTEL_HSW_M_IDS(&gen6_stolen_funcs),
497 INTEL_BDW_M_IDS(&gen8_stolen_funcs),
498 INTEL_BDW_D_IDS(&gen8_stolen_funcs)
348}; 499};
349 500
350static void __init intel_graphics_stolen(int num, int slot, int func) 501static void __init intel_graphics_stolen(int num, int slot, int func)
@@ -361,11 +512,13 @@ static void __init intel_graphics_stolen(int num, int slot, int func)
361 512
362 for (i = 0; i < ARRAY_SIZE(intel_stolen_ids); i++) { 513 for (i = 0; i < ARRAY_SIZE(intel_stolen_ids); i++) {
363 if (intel_stolen_ids[i].device == device) { 514 if (intel_stolen_ids[i].device == device) {
364 stolen_size_fn stolen_size = 515 const struct intel_stolen_funcs *stolen_funcs =
365 (stolen_size_fn)intel_stolen_ids[i].driver_data; 516 (const struct intel_stolen_funcs *)intel_stolen_ids[i].driver_data;
366 size = stolen_size(num, slot, func); 517 size = stolen_funcs->size(num, slot, func);
367 start = intel_stolen_base(num, slot, func); 518 start = stolen_funcs->base(num, slot, func, size);
368 if (size && start) { 519 if (size && start) {
520 printk(KERN_INFO "Reserving Intel graphics stolen memory at 0x%x-0x%x\n",
521 start, start + (u32)size - 1);
369 /* Mark this space as reserved */ 522 /* Mark this space as reserved */
370 e820_add_region(start, size, E820_RESERVED); 523 e820_add_region(start, size, E820_RESERVED);
371 sanitize_e820_map(e820.map, 524 sanitize_e820_map(e820.map,
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index e6253195a301..52819e816f87 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -308,7 +308,10 @@ static int ftrace_write(unsigned long ip, const char *val, int size)
308 if (within(ip, (unsigned long)_text, (unsigned long)_etext)) 308 if (within(ip, (unsigned long)_text, (unsigned long)_etext))
309 ip = (unsigned long)__va(__pa_symbol(ip)); 309 ip = (unsigned long)__va(__pa_symbol(ip));
310 310
311 return probe_kernel_write((void *)ip, val, size); 311 if (probe_kernel_write((void *)ip, val, size))
312 return -EPERM;
313
314 return 0;
312} 315}
313 316
314static int add_break(unsigned long ip, const char *old) 317static int add_break(unsigned long ip, const char *old)
@@ -323,10 +326,7 @@ static int add_break(unsigned long ip, const char *old)
323 if (memcmp(replaced, old, MCOUNT_INSN_SIZE) != 0) 326 if (memcmp(replaced, old, MCOUNT_INSN_SIZE) != 0)
324 return -EINVAL; 327 return -EINVAL;
325 328
326 if (ftrace_write(ip, &brk, 1)) 329 return ftrace_write(ip, &brk, 1);
327 return -EPERM;
328
329 return 0;
330} 330}
331 331
332static int add_brk_on_call(struct dyn_ftrace *rec, unsigned long addr) 332static int add_brk_on_call(struct dyn_ftrace *rec, unsigned long addr)
@@ -425,7 +425,7 @@ static int remove_breakpoint(struct dyn_ftrace *rec)
425 425
426 /* If this does not have a breakpoint, we are done */ 426 /* If this does not have a breakpoint, we are done */
427 if (ins[0] != brk) 427 if (ins[0] != brk)
428 return -1; 428 return 0;
429 429
430 nop = ftrace_nop_replace(); 430 nop = ftrace_nop_replace();
431 431
@@ -455,7 +455,7 @@ static int remove_breakpoint(struct dyn_ftrace *rec)
455 } 455 }
456 456
457 update: 457 update:
458 return probe_kernel_write((void *)ip, &nop[0], 1); 458 return ftrace_write(ip, nop, 1);
459} 459}
460 460
461static int add_update_code(unsigned long ip, unsigned const char *new) 461static int add_update_code(unsigned long ip, unsigned const char *new)
@@ -463,9 +463,7 @@ static int add_update_code(unsigned long ip, unsigned const char *new)
463 /* skip breakpoint */ 463 /* skip breakpoint */
464 ip++; 464 ip++;
465 new++; 465 new++;
466 if (ftrace_write(ip, new, MCOUNT_INSN_SIZE - 1)) 466 return ftrace_write(ip, new, MCOUNT_INSN_SIZE - 1);
467 return -EPERM;
468 return 0;
469} 467}
470 468
471static int add_update_call(struct dyn_ftrace *rec, unsigned long addr) 469static int add_update_call(struct dyn_ftrace *rec, unsigned long addr)
@@ -520,10 +518,7 @@ static int finish_update_call(struct dyn_ftrace *rec, unsigned long addr)
520 518
521 new = ftrace_call_replace(ip, addr); 519 new = ftrace_call_replace(ip, addr);
522 520
523 if (ftrace_write(ip, new, 1)) 521 return ftrace_write(ip, new, 1);
524 return -EPERM;
525
526 return 0;
527} 522}
528 523
529static int finish_update_nop(struct dyn_ftrace *rec) 524static int finish_update_nop(struct dyn_ftrace *rec)
@@ -533,9 +528,7 @@ static int finish_update_nop(struct dyn_ftrace *rec)
533 528
534 new = ftrace_nop_replace(); 529 new = ftrace_nop_replace();
535 530
536 if (ftrace_write(ip, new, 1)) 531 return ftrace_write(ip, new, 1);
537 return -EPERM;
538 return 0;
539} 532}
540 533
541static int finish_update(struct dyn_ftrace *rec, int enable) 534static int finish_update(struct dyn_ftrace *rec, int enable)
@@ -632,8 +625,14 @@ void ftrace_replace_code(int enable)
632 printk(KERN_WARNING "Failed on %s (%d):\n", report, count); 625 printk(KERN_WARNING "Failed on %s (%d):\n", report, count);
633 for_ftrace_rec_iter(iter) { 626 for_ftrace_rec_iter(iter) {
634 rec = ftrace_rec_iter_record(iter); 627 rec = ftrace_rec_iter_record(iter);
635 remove_breakpoint(rec); 628 /*
629 * Breakpoints are handled only when this function is in
630 * progress. The system could not work with them.
631 */
632 if (remove_breakpoint(rec))
633 BUG();
636 } 634 }
635 run_sync();
637} 636}
638 637
639static int 638static int
@@ -655,16 +654,19 @@ ftrace_modify_code(unsigned long ip, unsigned const char *old_code,
655 run_sync(); 654 run_sync();
656 655
657 ret = ftrace_write(ip, new_code, 1); 656 ret = ftrace_write(ip, new_code, 1);
658 if (ret) { 657 /*
659 ret = -EPERM; 658 * The breakpoint is handled only when this function is in progress.
660 goto out; 659 * The system could not work if we could not remove it.
661 } 660 */
662 run_sync(); 661 BUG_ON(ret);
663 out: 662 out:
663 run_sync();
664 return ret; 664 return ret;
665 665
666 fail_update: 666 fail_update:
667 probe_kernel_write((void *)ip, &old_code[0], 1); 667 /* Also here the system could not work with the breakpoint */
668 if (ftrace_write(ip, old_code, 1))
669 BUG();
668 goto out; 670 goto out;
669} 671}
670 672
@@ -678,11 +680,8 @@ void arch_ftrace_update_code(int command)
678 atomic_dec(&modifying_ftrace_code); 680 atomic_dec(&modifying_ftrace_code);
679} 681}
680 682
681int __init ftrace_dyn_arch_init(void *data) 683int __init ftrace_dyn_arch_init(void)
682{ 684{
683 /* The return code is retured via data */
684 *(unsigned long *)data = 0;
685
686 return 0; 685 return 0;
687} 686}
688#endif 687#endif
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 014618dbaa7b..8d80ae011603 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -752,9 +752,7 @@ static struct clocksource clocksource_hpet = {
752 .mask = HPET_MASK, 752 .mask = HPET_MASK,
753 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 753 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
754 .resume = hpet_resume_counter, 754 .resume = hpet_resume_counter,
755#ifdef CONFIG_X86_64
756 .archdata = { .vclock_mode = VCLOCK_HPET }, 755 .archdata = { .vclock_mode = VCLOCK_HPET },
757#endif
758}; 756};
759 757
760static int hpet_clocksource_register(void) 758static int hpet_clocksource_register(void)
@@ -943,12 +941,14 @@ static __init int hpet_late_init(void)
943 if (boot_cpu_has(X86_FEATURE_ARAT)) 941 if (boot_cpu_has(X86_FEATURE_ARAT))
944 return 0; 942 return 0;
945 943
944 cpu_notifier_register_begin();
946 for_each_online_cpu(cpu) { 945 for_each_online_cpu(cpu) {
947 hpet_cpuhp_notify(NULL, CPU_ONLINE, (void *)(long)cpu); 946 hpet_cpuhp_notify(NULL, CPU_ONLINE, (void *)(long)cpu);
948 } 947 }
949 948
950 /* This notifier should be called after workqueue is ready */ 949 /* This notifier should be called after workqueue is ready */
951 hotcpu_notifier(hpet_cpuhp_notify, -20); 950 __hotcpu_notifier(hpet_cpuhp_notify, -20);
951 cpu_notifier_register_done();
952 952
953 return 0; 953 return 0;
954} 954}
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index 42805fac0092..283a76a9cc40 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -125,7 +125,7 @@ int arch_show_interrupts(struct seq_file *p, int prec)
125 seq_printf(p, "%10u ", per_cpu(mce_poll_count, j)); 125 seq_printf(p, "%10u ", per_cpu(mce_poll_count, j));
126 seq_printf(p, " Machine check polls\n"); 126 seq_printf(p, " Machine check polls\n");
127#endif 127#endif
128#if defined(CONFIG_HYPERV) || defined(CONFIG_XEN) 128#if IS_ENABLED(CONFIG_HYPERV) || defined(CONFIG_XEN)
129 seq_printf(p, "%*s: ", prec, "THR"); 129 seq_printf(p, "%*s: ", prec, "THR");
130 for_each_online_cpu(j) 130 for_each_online_cpu(j)
131 seq_printf(p, "%10u ", irq_stats(j)->irq_hv_callback_count); 131 seq_printf(p, "%10u ", irq_stats(j)->irq_hv_callback_count);
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 713f1b3bad52..0331cb389d68 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -417,7 +417,6 @@ void kvm_disable_steal_time(void)
417#ifdef CONFIG_SMP 417#ifdef CONFIG_SMP
418static void __init kvm_smp_prepare_boot_cpu(void) 418static void __init kvm_smp_prepare_boot_cpu(void)
419{ 419{
420 WARN_ON(kvm_register_clock("primary cpu clock"));
421 kvm_guest_cpu_init(); 420 kvm_guest_cpu_init();
422 native_smp_prepare_boot_cpu(); 421 native_smp_prepare_boot_cpu();
423 kvm_spinlock_init(); 422 kvm_spinlock_init();
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index e6041094ff26..d9156ceecdff 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -242,7 +242,7 @@ void __init kvmclock_init(void)
242 hv_clock = __va(mem); 242 hv_clock = __va(mem);
243 memset(hv_clock, 0, size); 243 memset(hv_clock, 0, size);
244 244
245 if (kvm_register_clock("boot clock")) { 245 if (kvm_register_clock("primary cpu clock")) {
246 hv_clock = NULL; 246 hv_clock = NULL;
247 memblock_free(mem, size); 247 memblock_free(mem, size);
248 return; 248 return;
diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c
index ebc987398923..af1d14a9ebda 100644
--- a/arch/x86/kernel/ldt.c
+++ b/arch/x86/kernel/ldt.c
@@ -229,6 +229,17 @@ static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode)
229 } 229 }
230 } 230 }
231 231
232 /*
233 * On x86-64 we do not support 16-bit segments due to
234 * IRET leaking the high bits of the kernel stack address.
235 */
236#ifdef CONFIG_X86_64
237 if (!ldt_info.seg_32bit) {
238 error = -EINVAL;
239 goto out_unlock;
240 }
241#endif
242
232 fill_ldt(&ldt, &ldt_info); 243 fill_ldt(&ldt, &ldt_info);
233 if (oldmode) 244 if (oldmode)
234 ldt.avl = 0; 245 ldt.avl = 0;
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index 05266b5aae22..c9603ac80de5 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -259,14 +259,15 @@ static int __init msr_init(void)
259 goto out_chrdev; 259 goto out_chrdev;
260 } 260 }
261 msr_class->devnode = msr_devnode; 261 msr_class->devnode = msr_devnode;
262 get_online_cpus(); 262
263 cpu_notifier_register_begin();
263 for_each_online_cpu(i) { 264 for_each_online_cpu(i) {
264 err = msr_device_create(i); 265 err = msr_device_create(i);
265 if (err != 0) 266 if (err != 0)
266 goto out_class; 267 goto out_class;
267 } 268 }
268 register_hotcpu_notifier(&msr_class_cpu_notifier); 269 __register_hotcpu_notifier(&msr_class_cpu_notifier);
269 put_online_cpus(); 270 cpu_notifier_register_done();
270 271
271 err = 0; 272 err = 0;
272 goto out; 273 goto out;
@@ -275,7 +276,7 @@ out_class:
275 i = 0; 276 i = 0;
276 for_each_online_cpu(i) 277 for_each_online_cpu(i)
277 msr_device_destroy(i); 278 msr_device_destroy(i);
278 put_online_cpus(); 279 cpu_notifier_register_done();
279 class_destroy(msr_class); 280 class_destroy(msr_class);
280out_chrdev: 281out_chrdev:
281 __unregister_chrdev(MSR_MAJOR, 0, NR_CPUS, "cpu/msr"); 282 __unregister_chrdev(MSR_MAJOR, 0, NR_CPUS, "cpu/msr");
@@ -286,13 +287,14 @@ out:
286static void __exit msr_exit(void) 287static void __exit msr_exit(void)
287{ 288{
288 int cpu = 0; 289 int cpu = 0;
289 get_online_cpus(); 290
291 cpu_notifier_register_begin();
290 for_each_online_cpu(cpu) 292 for_each_online_cpu(cpu)
291 msr_device_destroy(cpu); 293 msr_device_destroy(cpu);
292 class_destroy(msr_class); 294 class_destroy(msr_class);
293 __unregister_chrdev(MSR_MAJOR, 0, NR_CPUS, "cpu/msr"); 295 __unregister_chrdev(MSR_MAJOR, 0, NR_CPUS, "cpu/msr");
294 unregister_hotcpu_notifier(&msr_class_cpu_notifier); 296 __unregister_hotcpu_notifier(&msr_class_cpu_notifier);
295 put_online_cpus(); 297 cpu_notifier_register_done();
296} 298}
297 299
298module_init(msr_init); 300module_init(msr_init);
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c
index 299d49302e7d..0497f719977d 100644
--- a/arch/x86/kernel/pci-calgary_64.c
+++ b/arch/x86/kernel/pci-calgary_64.c
@@ -1207,23 +1207,31 @@ error:
1207 return ret; 1207 return ret;
1208} 1208}
1209 1209
1210static inline int __init determine_tce_table_size(u64 ram) 1210static inline int __init determine_tce_table_size(void)
1211{ 1211{
1212 int ret; 1212 int ret;
1213 1213
1214 if (specified_table_size != TCE_TABLE_SIZE_UNSPECIFIED) 1214 if (specified_table_size != TCE_TABLE_SIZE_UNSPECIFIED)
1215 return specified_table_size; 1215 return specified_table_size;
1216 1216
1217 /* 1217 if (is_kdump_kernel() && saved_max_pfn) {
1218 * Table sizes are from 0 to 7 (TCE_TABLE_SIZE_64K to 1218 /*
1219 * TCE_TABLE_SIZE_8M). Table size 0 has 8K entries and each 1219 * Table sizes are from 0 to 7 (TCE_TABLE_SIZE_64K to
1220 * larger table size has twice as many entries, so shift the 1220 * TCE_TABLE_SIZE_8M). Table size 0 has 8K entries and each
1221 * max ram address by 13 to divide by 8K and then look at the 1221 * larger table size has twice as many entries, so shift the
1222 * order of the result to choose between 0-7. 1222 * max ram address by 13 to divide by 8K and then look at the
1223 */ 1223 * order of the result to choose between 0-7.
1224 ret = get_order(ram >> 13); 1224 */
1225 if (ret > TCE_TABLE_SIZE_8M) 1225 ret = get_order((saved_max_pfn * PAGE_SIZE) >> 13);
1226 if (ret > TCE_TABLE_SIZE_8M)
1227 ret = TCE_TABLE_SIZE_8M;
1228 } else {
1229 /*
1230 * Use 8M by default (suggested by Muli) if it's not
1231 * kdump kernel and saved_max_pfn isn't set.
1232 */
1226 ret = TCE_TABLE_SIZE_8M; 1233 ret = TCE_TABLE_SIZE_8M;
1234 }
1227 1235
1228 return ret; 1236 return ret;
1229} 1237}
@@ -1418,8 +1426,7 @@ int __init detect_calgary(void)
1418 return -ENOMEM; 1426 return -ENOMEM;
1419 } 1427 }
1420 1428
1421 specified_table_size = determine_tce_table_size((is_kdump_kernel() ? 1429 specified_table_size = determine_tce_table_size();
1422 saved_max_pfn : max_pfn) * PAGE_SIZE);
1423 1430
1424 for (bus = 0; bus < MAX_PHB_BUS_NUM; bus++) { 1431 for (bus = 0; bus < MAX_PHB_BUS_NUM; bus++) {
1425 struct calgary_bus_info *info = &bus_info[bus]; 1432 struct calgary_bus_info *info = &bus_info[bus];
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index fa511acff7e6..09c76d265550 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -869,7 +869,6 @@ void __init setup_arch(char **cmdline_p)
869 869
870#ifdef CONFIG_X86_32 870#ifdef CONFIG_X86_32
871 memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data)); 871 memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data));
872 visws_early_detect();
873 872
874 /* 873 /*
875 * copy kernel address range established so far and switch 874 * copy kernel address range established so far and switch
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index cfbe99f88830..57e5ce126d5a 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -914,8 +914,7 @@ static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
914 tsc_khz_ref = tsc_khz; 914 tsc_khz_ref = tsc_khz;
915 } 915 }
916 if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) || 916 if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) ||
917 (val == CPUFREQ_POSTCHANGE && freq->old > freq->new) || 917 (val == CPUFREQ_POSTCHANGE && freq->old > freq->new)) {
918 (val == CPUFREQ_RESUMECHANGE)) {
919 *lpj = cpufreq_scale(loops_per_jiffy_ref, ref_freq, freq->new); 918 *lpj = cpufreq_scale(loops_per_jiffy_ref, ref_freq, freq->new);
920 919
921 tsc_khz = cpufreq_scale(tsc_khz_ref, ref_freq, freq->new); 920 tsc_khz = cpufreq_scale(tsc_khz_ref, ref_freq, freq->new);
@@ -985,9 +984,7 @@ static struct clocksource clocksource_tsc = {
985 .mask = CLOCKSOURCE_MASK(64), 984 .mask = CLOCKSOURCE_MASK(64),
986 .flags = CLOCK_SOURCE_IS_CONTINUOUS | 985 .flags = CLOCK_SOURCE_IS_CONTINUOUS |
987 CLOCK_SOURCE_MUST_VERIFY, 986 CLOCK_SOURCE_MUST_VERIFY,
988#ifdef CONFIG_X86_64
989 .archdata = { .vclock_mode = VCLOCK_TSC }, 987 .archdata = { .vclock_mode = VCLOCK_TSC },
990#endif
991}; 988};
992 989
993void mark_tsc_unstable(char *reason) 990void mark_tsc_unstable(char *reason)
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index da6b35a98260..49edf2dd3613 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -147,7 +147,6 @@ SECTIONS
147 _edata = .; 147 _edata = .;
148 } :data 148 } :data
149 149
150#ifdef CONFIG_X86_64
151 150
152 . = ALIGN(PAGE_SIZE); 151 . = ALIGN(PAGE_SIZE);
153 __vvar_page = .; 152 __vvar_page = .;
@@ -165,12 +164,15 @@ SECTIONS
165#undef __VVAR_KERNEL_LDS 164#undef __VVAR_KERNEL_LDS
166#undef EMIT_VVAR 165#undef EMIT_VVAR
167 166
167 /*
168 * Pad the rest of the page with zeros. Otherwise the loader
169 * can leave garbage here.
170 */
171 . = __vvar_beginning_hack + PAGE_SIZE;
168 } :data 172 } :data
169 173
170 . = ALIGN(__vvar_page + PAGE_SIZE, PAGE_SIZE); 174 . = ALIGN(__vvar_page + PAGE_SIZE, PAGE_SIZE);
171 175
172#endif /* CONFIG_X86_64 */
173
174 /* Init code and data - will be freed after init */ 176 /* Init code and data - will be freed after init */
175 . = ALIGN(PAGE_SIZE); 177 . = ALIGN(PAGE_SIZE);
176 .init.begin : AT(ADDR(.init.begin) - LOAD_OFFSET) { 178 .init.begin : AT(ADDR(.init.begin) - LOAD_OFFSET) {
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c
index 1f96f9347ed9..8b3b3eb3cead 100644
--- a/arch/x86/kernel/vsyscall_64.c
+++ b/arch/x86/kernel/vsyscall_64.c
@@ -47,14 +47,12 @@
47#include <asm/segment.h> 47#include <asm/segment.h>
48#include <asm/desc.h> 48#include <asm/desc.h>
49#include <asm/topology.h> 49#include <asm/topology.h>
50#include <asm/vgtod.h>
51#include <asm/traps.h> 50#include <asm/traps.h>
52 51
53#define CREATE_TRACE_POINTS 52#define CREATE_TRACE_POINTS
54#include "vsyscall_trace.h" 53#include "vsyscall_trace.h"
55 54
56DEFINE_VVAR(int, vgetcpu_mode); 55DEFINE_VVAR(int, vgetcpu_mode);
57DEFINE_VVAR(struct vsyscall_gtod_data, vsyscall_gtod_data);
58 56
59static enum { EMULATE, NATIVE, NONE } vsyscall_mode = EMULATE; 57static enum { EMULATE, NATIVE, NONE } vsyscall_mode = EMULATE;
60 58
@@ -77,48 +75,6 @@ static int __init vsyscall_setup(char *str)
77} 75}
78early_param("vsyscall", vsyscall_setup); 76early_param("vsyscall", vsyscall_setup);
79 77
80void update_vsyscall_tz(void)
81{
82 vsyscall_gtod_data.sys_tz = sys_tz;
83}
84
85void update_vsyscall(struct timekeeper *tk)
86{
87 struct vsyscall_gtod_data *vdata = &vsyscall_gtod_data;
88
89 write_seqcount_begin(&vdata->seq);
90
91 /* copy vsyscall data */
92 vdata->clock.vclock_mode = tk->clock->archdata.vclock_mode;
93 vdata->clock.cycle_last = tk->clock->cycle_last;
94 vdata->clock.mask = tk->clock->mask;
95 vdata->clock.mult = tk->mult;
96 vdata->clock.shift = tk->shift;
97
98 vdata->wall_time_sec = tk->xtime_sec;
99 vdata->wall_time_snsec = tk->xtime_nsec;
100
101 vdata->monotonic_time_sec = tk->xtime_sec
102 + tk->wall_to_monotonic.tv_sec;
103 vdata->monotonic_time_snsec = tk->xtime_nsec
104 + (tk->wall_to_monotonic.tv_nsec
105 << tk->shift);
106 while (vdata->monotonic_time_snsec >=
107 (((u64)NSEC_PER_SEC) << tk->shift)) {
108 vdata->monotonic_time_snsec -=
109 ((u64)NSEC_PER_SEC) << tk->shift;
110 vdata->monotonic_time_sec++;
111 }
112
113 vdata->wall_time_coarse.tv_sec = tk->xtime_sec;
114 vdata->wall_time_coarse.tv_nsec = (long)(tk->xtime_nsec >> tk->shift);
115
116 vdata->monotonic_time_coarse = timespec_add(vdata->wall_time_coarse,
117 tk->wall_to_monotonic);
118
119 write_seqcount_end(&vdata->seq);
120}
121
122static void warn_bad_vsyscall(const char *level, struct pt_regs *regs, 78static void warn_bad_vsyscall(const char *level, struct pt_regs *regs,
123 const char *message) 79 const char *message)
124{ 80{
@@ -374,7 +330,6 @@ void __init map_vsyscall(void)
374{ 330{
375 extern char __vsyscall_page; 331 extern char __vsyscall_page;
376 unsigned long physaddr_vsyscall = __pa_symbol(&__vsyscall_page); 332 unsigned long physaddr_vsyscall = __pa_symbol(&__vsyscall_page);
377 extern char __vvar_page;
378 unsigned long physaddr_vvar_page = __pa_symbol(&__vvar_page); 333 unsigned long physaddr_vvar_page = __pa_symbol(&__vvar_page);
379 334
380 __set_fixmap(VSYSCALL_FIRST_PAGE, physaddr_vsyscall, 335 __set_fixmap(VSYSCALL_FIRST_PAGE, physaddr_vsyscall,
@@ -393,9 +348,13 @@ static int __init vsyscall_init(void)
393{ 348{
394 BUG_ON(VSYSCALL_ADDR(0) != __fix_to_virt(VSYSCALL_FIRST_PAGE)); 349 BUG_ON(VSYSCALL_ADDR(0) != __fix_to_virt(VSYSCALL_FIRST_PAGE));
395 350
351 cpu_notifier_register_begin();
352
396 on_each_cpu(cpu_vsyscall_init, NULL, 1); 353 on_each_cpu(cpu_vsyscall_init, NULL, 1);
397 /* notifier priority > KVM */ 354 /* notifier priority > KVM */
398 hotcpu_notifier(cpu_vsyscall_notifier, 30); 355 __hotcpu_notifier(cpu_vsyscall_notifier, 30);
356
357 cpu_notifier_register_done();
399 358
400 return 0; 359 return 0;
401} 360}
diff --git a/arch/x86/kernel/vsyscall_gtod.c b/arch/x86/kernel/vsyscall_gtod.c
new file mode 100644
index 000000000000..f9c6e56e14b5
--- /dev/null
+++ b/arch/x86/kernel/vsyscall_gtod.c
@@ -0,0 +1,69 @@
1/*
2 * Copyright (C) 2001 Andrea Arcangeli <andrea@suse.de> SuSE
3 * Copyright 2003 Andi Kleen, SuSE Labs.
4 *
5 * Modified for x86 32 bit architecture by
6 * Stefani Seibold <stefani@seibold.net>
7 * sponsored by Rohde & Schwarz GmbH & Co. KG Munich/Germany
8 *
9 * Thanks to hpa@transmeta.com for some useful hint.
10 * Special thanks to Ingo Molnar for his early experience with
11 * a different vsyscall implementation for Linux/IA32 and for the name.
12 *
13 */
14
15#include <linux/timekeeper_internal.h>
16#include <asm/vgtod.h>
17#include <asm/vvar.h>
18
19DEFINE_VVAR(struct vsyscall_gtod_data, vsyscall_gtod_data);
20
21void update_vsyscall_tz(void)
22{
23 vsyscall_gtod_data.tz_minuteswest = sys_tz.tz_minuteswest;
24 vsyscall_gtod_data.tz_dsttime = sys_tz.tz_dsttime;
25}
26
27void update_vsyscall(struct timekeeper *tk)
28{
29 struct vsyscall_gtod_data *vdata = &vsyscall_gtod_data;
30
31 gtod_write_begin(vdata);
32
33 /* copy vsyscall data */
34 vdata->vclock_mode = tk->clock->archdata.vclock_mode;
35 vdata->cycle_last = tk->clock->cycle_last;
36 vdata->mask = tk->clock->mask;
37 vdata->mult = tk->mult;
38 vdata->shift = tk->shift;
39
40 vdata->wall_time_sec = tk->xtime_sec;
41 vdata->wall_time_snsec = tk->xtime_nsec;
42
43 vdata->monotonic_time_sec = tk->xtime_sec
44 + tk->wall_to_monotonic.tv_sec;
45 vdata->monotonic_time_snsec = tk->xtime_nsec
46 + (tk->wall_to_monotonic.tv_nsec
47 << tk->shift);
48 while (vdata->monotonic_time_snsec >=
49 (((u64)NSEC_PER_SEC) << tk->shift)) {
50 vdata->monotonic_time_snsec -=
51 ((u64)NSEC_PER_SEC) << tk->shift;
52 vdata->monotonic_time_sec++;
53 }
54
55 vdata->wall_time_coarse_sec = tk->xtime_sec;
56 vdata->wall_time_coarse_nsec = (long)(tk->xtime_nsec >> tk->shift);
57
58 vdata->monotonic_time_coarse_sec =
59 vdata->wall_time_coarse_sec + tk->wall_to_monotonic.tv_sec;
60 vdata->monotonic_time_coarse_nsec =
61 vdata->wall_time_coarse_nsec + tk->wall_to_monotonic.tv_nsec;
62
63 while (vdata->monotonic_time_coarse_nsec >= NSEC_PER_SEC) {
64 vdata->monotonic_time_coarse_nsec -= NSEC_PER_SEC;
65 vdata->monotonic_time_coarse_sec++;
66 }
67
68 gtod_write_end(vdata);
69}
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index e5503d8aec1d..bea60671ef8a 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -28,7 +28,7 @@ static u32 xstate_required_size(u64 xstate_bv)
28 int feature_bit = 0; 28 int feature_bit = 0;
29 u32 ret = XSAVE_HDR_SIZE + XSAVE_HDR_OFFSET; 29 u32 ret = XSAVE_HDR_SIZE + XSAVE_HDR_OFFSET;
30 30
31 xstate_bv &= ~XSTATE_FPSSE; 31 xstate_bv &= XSTATE_EXTEND_MASK;
32 while (xstate_bv) { 32 while (xstate_bv) {
33 if (xstate_bv & 0x1) { 33 if (xstate_bv & 0x1) {
34 u32 eax, ebx, ecx, edx; 34 u32 eax, ebx, ecx, edx;
@@ -43,6 +43,16 @@ static u32 xstate_required_size(u64 xstate_bv)
43 return ret; 43 return ret;
44} 44}
45 45
46u64 kvm_supported_xcr0(void)
47{
48 u64 xcr0 = KVM_SUPPORTED_XCR0 & host_xcr0;
49
50 if (!kvm_x86_ops->mpx_supported())
51 xcr0 &= ~(XSTATE_BNDREGS | XSTATE_BNDCSR);
52
53 return xcr0;
54}
55
46void kvm_update_cpuid(struct kvm_vcpu *vcpu) 56void kvm_update_cpuid(struct kvm_vcpu *vcpu)
47{ 57{
48 struct kvm_cpuid_entry2 *best; 58 struct kvm_cpuid_entry2 *best;
@@ -73,9 +83,9 @@ void kvm_update_cpuid(struct kvm_vcpu *vcpu)
73 } else { 83 } else {
74 vcpu->arch.guest_supported_xcr0 = 84 vcpu->arch.guest_supported_xcr0 =
75 (best->eax | ((u64)best->edx << 32)) & 85 (best->eax | ((u64)best->edx << 32)) &
76 host_xcr0 & KVM_SUPPORTED_XCR0; 86 kvm_supported_xcr0();
77 vcpu->arch.guest_xstate_size = 87 vcpu->arch.guest_xstate_size = best->ebx =
78 xstate_required_size(vcpu->arch.guest_supported_xcr0); 88 xstate_required_size(vcpu->arch.xcr0);
79 } 89 }
80 90
81 kvm_pmu_cpuid_update(vcpu); 91 kvm_pmu_cpuid_update(vcpu);
@@ -210,13 +220,6 @@ static void do_cpuid_1_ent(struct kvm_cpuid_entry2 *entry, u32 function,
210 entry->flags = 0; 220 entry->flags = 0;
211} 221}
212 222
213static bool supported_xcr0_bit(unsigned bit)
214{
215 u64 mask = ((u64)1 << bit);
216
217 return mask & KVM_SUPPORTED_XCR0 & host_xcr0;
218}
219
220#define F(x) bit(X86_FEATURE_##x) 223#define F(x) bit(X86_FEATURE_##x)
221 224
222static int __do_cpuid_ent_emulated(struct kvm_cpuid_entry2 *entry, 225static int __do_cpuid_ent_emulated(struct kvm_cpuid_entry2 *entry,
@@ -256,6 +259,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
256#endif 259#endif
257 unsigned f_rdtscp = kvm_x86_ops->rdtscp_supported() ? F(RDTSCP) : 0; 260 unsigned f_rdtscp = kvm_x86_ops->rdtscp_supported() ? F(RDTSCP) : 0;
258 unsigned f_invpcid = kvm_x86_ops->invpcid_supported() ? F(INVPCID) : 0; 261 unsigned f_invpcid = kvm_x86_ops->invpcid_supported() ? F(INVPCID) : 0;
262 unsigned f_mpx = kvm_x86_ops->mpx_supported() ? F(MPX) : 0;
259 263
260 /* cpuid 1.edx */ 264 /* cpuid 1.edx */
261 const u32 kvm_supported_word0_x86_features = 265 const u32 kvm_supported_word0_x86_features =
@@ -303,7 +307,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
303 /* cpuid 7.0.ebx */ 307 /* cpuid 7.0.ebx */
304 const u32 kvm_supported_word9_x86_features = 308 const u32 kvm_supported_word9_x86_features =
305 F(FSGSBASE) | F(BMI1) | F(HLE) | F(AVX2) | F(SMEP) | 309 F(FSGSBASE) | F(BMI1) | F(HLE) | F(AVX2) | F(SMEP) |
306 F(BMI2) | F(ERMS) | f_invpcid | F(RTM); 310 F(BMI2) | F(ERMS) | f_invpcid | F(RTM) | f_mpx | F(RDSEED) |
311 F(ADX);
307 312
308 /* all calls to cpuid_count() should be made on the same cpu */ 313 /* all calls to cpuid_count() should be made on the same cpu */
309 get_cpu(); 314 get_cpu();
@@ -436,16 +441,18 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
436 } 441 }
437 case 0xd: { 442 case 0xd: {
438 int idx, i; 443 int idx, i;
444 u64 supported = kvm_supported_xcr0();
439 445
440 entry->eax &= host_xcr0 & KVM_SUPPORTED_XCR0; 446 entry->eax &= supported;
441 entry->edx &= (host_xcr0 & KVM_SUPPORTED_XCR0) >> 32; 447 entry->edx &= supported >> 32;
442 entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX; 448 entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
443 for (idx = 1, i = 1; idx < 64; ++idx) { 449 for (idx = 1, i = 1; idx < 64; ++idx) {
450 u64 mask = ((u64)1 << idx);
444 if (*nent >= maxnent) 451 if (*nent >= maxnent)
445 goto out; 452 goto out;
446 453
447 do_cpuid_1_ent(&entry[i], function, idx); 454 do_cpuid_1_ent(&entry[i], function, idx);
448 if (entry[i].eax == 0 || !supported_xcr0_bit(idx)) 455 if (entry[i].eax == 0 || !(supported & mask))
449 continue; 456 continue;
450 entry[i].flags |= 457 entry[i].flags |=
451 KVM_CPUID_FLAG_SIGNIFCANT_INDEX; 458 KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 07ffca0a89e9..205b17eed93c 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -3668,6 +3668,10 @@ static const struct gprefix pfx_vmovntpx = {
3668 I(0, em_mov), N, N, N, 3668 I(0, em_mov), N, N, N,
3669}; 3669};
3670 3670
3671static const struct gprefix pfx_0f_28_0f_29 = {
3672 I(Aligned, em_mov), I(Aligned, em_mov), N, N,
3673};
3674
3671static const struct escape escape_d9 = { { 3675static const struct escape escape_d9 = { {
3672 N, N, N, N, N, N, N, I(DstMem, em_fnstcw), 3676 N, N, N, N, N, N, N, I(DstMem, em_fnstcw),
3673}, { 3677}, {
@@ -3870,7 +3874,9 @@ static const struct opcode twobyte_table[256] = {
3870 IIP(ModRM | SrcMem | Priv | Op3264, em_cr_write, cr_write, check_cr_write), 3874 IIP(ModRM | SrcMem | Priv | Op3264, em_cr_write, cr_write, check_cr_write),
3871 IIP(ModRM | SrcMem | Priv | Op3264, em_dr_write, dr_write, check_dr_write), 3875 IIP(ModRM | SrcMem | Priv | Op3264, em_dr_write, dr_write, check_dr_write),
3872 N, N, N, N, 3876 N, N, N, N,
3873 N, N, N, GP(ModRM | DstMem | SrcReg | Sse | Mov | Aligned, &pfx_vmovntpx), 3877 GP(ModRM | DstReg | SrcMem | Mov | Sse, &pfx_0f_28_0f_29),
3878 GP(ModRM | DstMem | SrcReg | Mov | Sse, &pfx_0f_28_0f_29),
3879 N, GP(ModRM | DstMem | SrcReg | Sse | Mov | Aligned, &pfx_vmovntpx),
3874 N, N, N, N, 3880 N, N, N, N,
3875 /* 0x30 - 0x3F */ 3881 /* 0x30 - 0x3F */
3876 II(ImplicitOps | Priv, em_wrmsr, wrmsr), 3882 II(ImplicitOps | Priv, em_wrmsr, wrmsr),
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 9b531351a587..f5704d9e5ddc 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -3329,7 +3329,7 @@ static int kvm_arch_setup_async_pf(struct kvm_vcpu *vcpu, gva_t gva, gfn_t gfn)
3329 arch.direct_map = vcpu->arch.mmu.direct_map; 3329 arch.direct_map = vcpu->arch.mmu.direct_map;
3330 arch.cr3 = vcpu->arch.mmu.get_cr3(vcpu); 3330 arch.cr3 = vcpu->arch.mmu.get_cr3(vcpu);
3331 3331
3332 return kvm_setup_async_pf(vcpu, gva, gfn, &arch); 3332 return kvm_setup_async_pf(vcpu, gva, gfn_to_hva(vcpu->kvm, gfn), &arch);
3333} 3333}
3334 3334
3335static bool can_do_async_pf(struct kvm_vcpu *vcpu) 3335static bool can_do_async_pf(struct kvm_vcpu *vcpu)
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index cba218a2f08d..b1e6c1bf68d3 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -913,7 +913,8 @@ static gpa_t FNAME(gva_to_gpa_nested)(struct kvm_vcpu *vcpu, gva_t vaddr,
913 * and kvm_mmu_notifier_invalidate_range_start detect the mapping page isn't 913 * and kvm_mmu_notifier_invalidate_range_start detect the mapping page isn't
914 * used by guest then tlbs are not flushed, so guest is allowed to access the 914 * used by guest then tlbs are not flushed, so guest is allowed to access the
915 * freed pages. 915 * freed pages.
916 * And we increase kvm->tlbs_dirty to delay tlbs flush in this case. 916 * We set tlbs_dirty to let the notifier know this change and delay the flush
917 * until such a case actually happens.
917 */ 918 */
918static int FNAME(sync_page)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp) 919static int FNAME(sync_page)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
919{ 920{
@@ -942,7 +943,7 @@ static int FNAME(sync_page)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
942 return -EINVAL; 943 return -EINVAL;
943 944
944 if (FNAME(prefetch_invalid_gpte)(vcpu, sp, &sp->spt[i], gpte)) { 945 if (FNAME(prefetch_invalid_gpte)(vcpu, sp, &sp->spt[i], gpte)) {
945 vcpu->kvm->tlbs_dirty++; 946 vcpu->kvm->tlbs_dirty = true;
946 continue; 947 continue;
947 } 948 }
948 949
@@ -957,7 +958,7 @@ static int FNAME(sync_page)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
957 958
958 if (gfn != sp->gfns[i]) { 959 if (gfn != sp->gfns[i]) {
959 drop_spte(vcpu->kvm, &sp->spt[i]); 960 drop_spte(vcpu->kvm, &sp->spt[i]);
960 vcpu->kvm->tlbs_dirty++; 961 vcpu->kvm->tlbs_dirty = true;
961 continue; 962 continue;
962 } 963 }
963 964
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 2de1bc09a8d4..7f4f9c2badae 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -34,6 +34,7 @@
34#include <asm/perf_event.h> 34#include <asm/perf_event.h>
35#include <asm/tlbflush.h> 35#include <asm/tlbflush.h>
36#include <asm/desc.h> 36#include <asm/desc.h>
37#include <asm/debugreg.h>
37#include <asm/kvm_para.h> 38#include <asm/kvm_para.h>
38 39
39#include <asm/virtext.h> 40#include <asm/virtext.h>
@@ -303,20 +304,35 @@ static inline bool is_cr_intercept(struct vcpu_svm *svm, int bit)
303 return vmcb->control.intercept_cr & (1U << bit); 304 return vmcb->control.intercept_cr & (1U << bit);
304} 305}
305 306
306static inline void set_dr_intercept(struct vcpu_svm *svm, int bit) 307static inline void set_dr_intercepts(struct vcpu_svm *svm)
307{ 308{
308 struct vmcb *vmcb = get_host_vmcb(svm); 309 struct vmcb *vmcb = get_host_vmcb(svm);
309 310
310 vmcb->control.intercept_dr |= (1U << bit); 311 vmcb->control.intercept_dr = (1 << INTERCEPT_DR0_READ)
312 | (1 << INTERCEPT_DR1_READ)
313 | (1 << INTERCEPT_DR2_READ)
314 | (1 << INTERCEPT_DR3_READ)
315 | (1 << INTERCEPT_DR4_READ)
316 | (1 << INTERCEPT_DR5_READ)
317 | (1 << INTERCEPT_DR6_READ)
318 | (1 << INTERCEPT_DR7_READ)
319 | (1 << INTERCEPT_DR0_WRITE)
320 | (1 << INTERCEPT_DR1_WRITE)
321 | (1 << INTERCEPT_DR2_WRITE)
322 | (1 << INTERCEPT_DR3_WRITE)
323 | (1 << INTERCEPT_DR4_WRITE)
324 | (1 << INTERCEPT_DR5_WRITE)
325 | (1 << INTERCEPT_DR6_WRITE)
326 | (1 << INTERCEPT_DR7_WRITE);
311 327
312 recalc_intercepts(svm); 328 recalc_intercepts(svm);
313} 329}
314 330
315static inline void clr_dr_intercept(struct vcpu_svm *svm, int bit) 331static inline void clr_dr_intercepts(struct vcpu_svm *svm)
316{ 332{
317 struct vmcb *vmcb = get_host_vmcb(svm); 333 struct vmcb *vmcb = get_host_vmcb(svm);
318 334
319 vmcb->control.intercept_dr &= ~(1U << bit); 335 vmcb->control.intercept_dr = 0;
320 336
321 recalc_intercepts(svm); 337 recalc_intercepts(svm);
322} 338}
@@ -1080,23 +1096,7 @@ static void init_vmcb(struct vcpu_svm *svm)
1080 set_cr_intercept(svm, INTERCEPT_CR4_WRITE); 1096 set_cr_intercept(svm, INTERCEPT_CR4_WRITE);
1081 set_cr_intercept(svm, INTERCEPT_CR8_WRITE); 1097 set_cr_intercept(svm, INTERCEPT_CR8_WRITE);
1082 1098
1083 set_dr_intercept(svm, INTERCEPT_DR0_READ); 1099 set_dr_intercepts(svm);
1084 set_dr_intercept(svm, INTERCEPT_DR1_READ);
1085 set_dr_intercept(svm, INTERCEPT_DR2_READ);
1086 set_dr_intercept(svm, INTERCEPT_DR3_READ);
1087 set_dr_intercept(svm, INTERCEPT_DR4_READ);
1088 set_dr_intercept(svm, INTERCEPT_DR5_READ);
1089 set_dr_intercept(svm, INTERCEPT_DR6_READ);
1090 set_dr_intercept(svm, INTERCEPT_DR7_READ);
1091
1092 set_dr_intercept(svm, INTERCEPT_DR0_WRITE);
1093 set_dr_intercept(svm, INTERCEPT_DR1_WRITE);
1094 set_dr_intercept(svm, INTERCEPT_DR2_WRITE);
1095 set_dr_intercept(svm, INTERCEPT_DR3_WRITE);
1096 set_dr_intercept(svm, INTERCEPT_DR4_WRITE);
1097 set_dr_intercept(svm, INTERCEPT_DR5_WRITE);
1098 set_dr_intercept(svm, INTERCEPT_DR6_WRITE);
1099 set_dr_intercept(svm, INTERCEPT_DR7_WRITE);
1100 1100
1101 set_exception_intercept(svm, PF_VECTOR); 1101 set_exception_intercept(svm, PF_VECTOR);
1102 set_exception_intercept(svm, UD_VECTOR); 1102 set_exception_intercept(svm, UD_VECTOR);
@@ -1684,6 +1684,21 @@ static void svm_set_dr6(struct kvm_vcpu *vcpu, unsigned long value)
1684 mark_dirty(svm->vmcb, VMCB_DR); 1684 mark_dirty(svm->vmcb, VMCB_DR);
1685} 1685}
1686 1686
1687static void svm_sync_dirty_debug_regs(struct kvm_vcpu *vcpu)
1688{
1689 struct vcpu_svm *svm = to_svm(vcpu);
1690
1691 get_debugreg(vcpu->arch.db[0], 0);
1692 get_debugreg(vcpu->arch.db[1], 1);
1693 get_debugreg(vcpu->arch.db[2], 2);
1694 get_debugreg(vcpu->arch.db[3], 3);
1695 vcpu->arch.dr6 = svm_get_dr6(vcpu);
1696 vcpu->arch.dr7 = svm->vmcb->save.dr7;
1697
1698 vcpu->arch.switch_db_regs &= ~KVM_DEBUGREG_WONT_EXIT;
1699 set_dr_intercepts(svm);
1700}
1701
1687static void svm_set_dr7(struct kvm_vcpu *vcpu, unsigned long value) 1702static void svm_set_dr7(struct kvm_vcpu *vcpu, unsigned long value)
1688{ 1703{
1689 struct vcpu_svm *svm = to_svm(vcpu); 1704 struct vcpu_svm *svm = to_svm(vcpu);
@@ -2842,6 +2857,7 @@ static int iret_interception(struct vcpu_svm *svm)
2842 clr_intercept(svm, INTERCEPT_IRET); 2857 clr_intercept(svm, INTERCEPT_IRET);
2843 svm->vcpu.arch.hflags |= HF_IRET_MASK; 2858 svm->vcpu.arch.hflags |= HF_IRET_MASK;
2844 svm->nmi_iret_rip = kvm_rip_read(&svm->vcpu); 2859 svm->nmi_iret_rip = kvm_rip_read(&svm->vcpu);
2860 kvm_make_request(KVM_REQ_EVENT, &svm->vcpu);
2845 return 1; 2861 return 1;
2846} 2862}
2847 2863
@@ -2974,6 +2990,17 @@ static int dr_interception(struct vcpu_svm *svm)
2974 unsigned long val; 2990 unsigned long val;
2975 int err; 2991 int err;
2976 2992
2993 if (svm->vcpu.guest_debug == 0) {
2994 /*
2995 * No more DR vmexits; force a reload of the debug registers
2996 * and reenter on this instruction. The next vmexit will
2997 * retrieve the full state of the debug registers.
2998 */
2999 clr_dr_intercepts(svm);
3000 svm->vcpu.arch.switch_db_regs |= KVM_DEBUGREG_WONT_EXIT;
3001 return 1;
3002 }
3003
2977 if (!boot_cpu_has(X86_FEATURE_DECODEASSISTS)) 3004 if (!boot_cpu_has(X86_FEATURE_DECODEASSISTS))
2978 return emulate_on_interception(svm); 3005 return emulate_on_interception(svm);
2979 3006
@@ -3649,7 +3676,7 @@ static int svm_interrupt_allowed(struct kvm_vcpu *vcpu)
3649 return ret; 3676 return ret;
3650} 3677}
3651 3678
3652static int enable_irq_window(struct kvm_vcpu *vcpu) 3679static void enable_irq_window(struct kvm_vcpu *vcpu)
3653{ 3680{
3654 struct vcpu_svm *svm = to_svm(vcpu); 3681 struct vcpu_svm *svm = to_svm(vcpu);
3655 3682
@@ -3663,16 +3690,15 @@ static int enable_irq_window(struct kvm_vcpu *vcpu)
3663 svm_set_vintr(svm); 3690 svm_set_vintr(svm);
3664 svm_inject_irq(svm, 0x0); 3691 svm_inject_irq(svm, 0x0);
3665 } 3692 }
3666 return 0;
3667} 3693}
3668 3694
3669static int enable_nmi_window(struct kvm_vcpu *vcpu) 3695static void enable_nmi_window(struct kvm_vcpu *vcpu)
3670{ 3696{
3671 struct vcpu_svm *svm = to_svm(vcpu); 3697 struct vcpu_svm *svm = to_svm(vcpu);
3672 3698
3673 if ((svm->vcpu.arch.hflags & (HF_NMI_MASK | HF_IRET_MASK)) 3699 if ((svm->vcpu.arch.hflags & (HF_NMI_MASK | HF_IRET_MASK))
3674 == HF_NMI_MASK) 3700 == HF_NMI_MASK)
3675 return 0; /* IRET will cause a vm exit */ 3701 return; /* IRET will cause a vm exit */
3676 3702
3677 /* 3703 /*
3678 * Something prevents NMI from been injected. Single step over possible 3704 * Something prevents NMI from been injected. Single step over possible
@@ -3681,7 +3707,6 @@ static int enable_nmi_window(struct kvm_vcpu *vcpu)
3681 svm->nmi_singlestep = true; 3707 svm->nmi_singlestep = true;
3682 svm->vmcb->save.rflags |= (X86_EFLAGS_TF | X86_EFLAGS_RF); 3708 svm->vmcb->save.rflags |= (X86_EFLAGS_TF | X86_EFLAGS_RF);
3683 update_db_bp_intercept(vcpu); 3709 update_db_bp_intercept(vcpu);
3684 return 0;
3685} 3710}
3686 3711
3687static int svm_set_tss_addr(struct kvm *kvm, unsigned int addr) 3712static int svm_set_tss_addr(struct kvm *kvm, unsigned int addr)
@@ -4064,6 +4089,11 @@ static bool svm_invpcid_supported(void)
4064 return false; 4089 return false;
4065} 4090}
4066 4091
4092static bool svm_mpx_supported(void)
4093{
4094 return false;
4095}
4096
4067static bool svm_has_wbinvd_exit(void) 4097static bool svm_has_wbinvd_exit(void)
4068{ 4098{
4069 return true; 4099 return true;
@@ -4302,6 +4332,7 @@ static struct kvm_x86_ops svm_x86_ops = {
4302 .get_dr6 = svm_get_dr6, 4332 .get_dr6 = svm_get_dr6,
4303 .set_dr6 = svm_set_dr6, 4333 .set_dr6 = svm_set_dr6,
4304 .set_dr7 = svm_set_dr7, 4334 .set_dr7 = svm_set_dr7,
4335 .sync_dirty_debug_regs = svm_sync_dirty_debug_regs,
4305 .cache_reg = svm_cache_reg, 4336 .cache_reg = svm_cache_reg,
4306 .get_rflags = svm_get_rflags, 4337 .get_rflags = svm_get_rflags,
4307 .set_rflags = svm_set_rflags, 4338 .set_rflags = svm_set_rflags,
@@ -4345,6 +4376,7 @@ static struct kvm_x86_ops svm_x86_ops = {
4345 4376
4346 .rdtscp_supported = svm_rdtscp_supported, 4377 .rdtscp_supported = svm_rdtscp_supported,
4347 .invpcid_supported = svm_invpcid_supported, 4378 .invpcid_supported = svm_invpcid_supported,
4379 .mpx_supported = svm_mpx_supported,
4348 4380
4349 .set_supported_cpuid = svm_set_supported_cpuid, 4381 .set_supported_cpuid = svm_set_supported_cpuid,
4350 4382
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 392752834751..1320e0f8e611 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -31,6 +31,7 @@
31#include <linux/ftrace_event.h> 31#include <linux/ftrace_event.h>
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <linux/tboot.h> 33#include <linux/tboot.h>
34#include <linux/hrtimer.h>
34#include "kvm_cache_regs.h" 35#include "kvm_cache_regs.h"
35#include "x86.h" 36#include "x86.h"
36 37
@@ -42,6 +43,7 @@
42#include <asm/i387.h> 43#include <asm/i387.h>
43#include <asm/xcr.h> 44#include <asm/xcr.h>
44#include <asm/perf_event.h> 45#include <asm/perf_event.h>
46#include <asm/debugreg.h>
45#include <asm/kexec.h> 47#include <asm/kexec.h>
46 48
47#include "trace.h" 49#include "trace.h"
@@ -110,6 +112,8 @@ module_param(nested, bool, S_IRUGO);
110 112
111#define RMODE_GUEST_OWNED_EFLAGS_BITS (~(X86_EFLAGS_IOPL | X86_EFLAGS_VM)) 113#define RMODE_GUEST_OWNED_EFLAGS_BITS (~(X86_EFLAGS_IOPL | X86_EFLAGS_VM))
112 114
115#define VMX_MISC_EMULATED_PREEMPTION_TIMER_RATE 5
116
113/* 117/*
114 * These 2 parameters are used to config the controls for Pause-Loop Exiting: 118 * These 2 parameters are used to config the controls for Pause-Loop Exiting:
115 * ple_gap: upper bound on the amount of time between two successive 119 * ple_gap: upper bound on the amount of time between two successive
@@ -202,6 +206,7 @@ struct __packed vmcs12 {
202 u64 guest_pdptr1; 206 u64 guest_pdptr1;
203 u64 guest_pdptr2; 207 u64 guest_pdptr2;
204 u64 guest_pdptr3; 208 u64 guest_pdptr3;
209 u64 guest_bndcfgs;
205 u64 host_ia32_pat; 210 u64 host_ia32_pat;
206 u64 host_ia32_efer; 211 u64 host_ia32_efer;
207 u64 host_ia32_perf_global_ctrl; 212 u64 host_ia32_perf_global_ctrl;
@@ -374,6 +379,9 @@ struct nested_vmx {
374 */ 379 */
375 struct page *apic_access_page; 380 struct page *apic_access_page;
376 u64 msr_ia32_feature_control; 381 u64 msr_ia32_feature_control;
382
383 struct hrtimer preemption_timer;
384 bool preemption_timer_expired;
377}; 385};
378 386
379#define POSTED_INTR_ON 0 387#define POSTED_INTR_ON 0
@@ -441,6 +449,7 @@ struct vcpu_vmx {
441#endif 449#endif
442 int gs_ldt_reload_needed; 450 int gs_ldt_reload_needed;
443 int fs_reload_needed; 451 int fs_reload_needed;
452 u64 msr_host_bndcfgs;
444 } host_state; 453 } host_state;
445 struct { 454 struct {
446 int vm86_active; 455 int vm86_active;
@@ -533,6 +542,7 @@ static const unsigned long shadow_read_write_fields[] = {
533 GUEST_CS_LIMIT, 542 GUEST_CS_LIMIT,
534 GUEST_CS_BASE, 543 GUEST_CS_BASE,
535 GUEST_ES_BASE, 544 GUEST_ES_BASE,
545 GUEST_BNDCFGS,
536 CR0_GUEST_HOST_MASK, 546 CR0_GUEST_HOST_MASK,
537 CR0_READ_SHADOW, 547 CR0_READ_SHADOW,
538 CR4_READ_SHADOW, 548 CR4_READ_SHADOW,
@@ -588,6 +598,7 @@ static const unsigned short vmcs_field_to_offset_table[] = {
588 FIELD64(GUEST_PDPTR1, guest_pdptr1), 598 FIELD64(GUEST_PDPTR1, guest_pdptr1),
589 FIELD64(GUEST_PDPTR2, guest_pdptr2), 599 FIELD64(GUEST_PDPTR2, guest_pdptr2),
590 FIELD64(GUEST_PDPTR3, guest_pdptr3), 600 FIELD64(GUEST_PDPTR3, guest_pdptr3),
601 FIELD64(GUEST_BNDCFGS, guest_bndcfgs),
591 FIELD64(HOST_IA32_PAT, host_ia32_pat), 602 FIELD64(HOST_IA32_PAT, host_ia32_pat),
592 FIELD64(HOST_IA32_EFER, host_ia32_efer), 603 FIELD64(HOST_IA32_EFER, host_ia32_efer),
593 FIELD64(HOST_IA32_PERF_GLOBAL_CTRL, host_ia32_perf_global_ctrl), 604 FIELD64(HOST_IA32_PERF_GLOBAL_CTRL, host_ia32_perf_global_ctrl),
@@ -718,6 +729,7 @@ static unsigned long nested_ept_get_cr3(struct kvm_vcpu *vcpu);
718static u64 construct_eptp(unsigned long root_hpa); 729static u64 construct_eptp(unsigned long root_hpa);
719static void kvm_cpu_vmxon(u64 addr); 730static void kvm_cpu_vmxon(u64 addr);
720static void kvm_cpu_vmxoff(void); 731static void kvm_cpu_vmxoff(void);
732static bool vmx_mpx_supported(void);
721static int vmx_set_tss_addr(struct kvm *kvm, unsigned int addr); 733static int vmx_set_tss_addr(struct kvm *kvm, unsigned int addr);
722static void vmx_set_segment(struct kvm_vcpu *vcpu, 734static void vmx_set_segment(struct kvm_vcpu *vcpu,
723 struct kvm_segment *var, int seg); 735 struct kvm_segment *var, int seg);
@@ -728,6 +740,7 @@ static u32 vmx_segment_access_rights(struct kvm_segment *var);
728static void vmx_sync_pir_to_irr_dummy(struct kvm_vcpu *vcpu); 740static void vmx_sync_pir_to_irr_dummy(struct kvm_vcpu *vcpu);
729static void copy_vmcs12_to_shadow(struct vcpu_vmx *vmx); 741static void copy_vmcs12_to_shadow(struct vcpu_vmx *vmx);
730static void copy_shadow_to_vmcs12(struct vcpu_vmx *vmx); 742static void copy_shadow_to_vmcs12(struct vcpu_vmx *vmx);
743static bool vmx_mpx_supported(void);
731 744
732static DEFINE_PER_CPU(struct vmcs *, vmxarea); 745static DEFINE_PER_CPU(struct vmcs *, vmxarea);
733static DEFINE_PER_CPU(struct vmcs *, current_vmcs); 746static DEFINE_PER_CPU(struct vmcs *, current_vmcs);
@@ -1047,6 +1060,12 @@ static inline bool nested_cpu_has_virtual_nmis(struct vmcs12 *vmcs12)
1047 return vmcs12->pin_based_vm_exec_control & PIN_BASED_VIRTUAL_NMIS; 1060 return vmcs12->pin_based_vm_exec_control & PIN_BASED_VIRTUAL_NMIS;
1048} 1061}
1049 1062
1063static inline bool nested_cpu_has_preemption_timer(struct vmcs12 *vmcs12)
1064{
1065 return vmcs12->pin_based_vm_exec_control &
1066 PIN_BASED_VMX_PREEMPTION_TIMER;
1067}
1068
1050static inline int nested_cpu_has_ept(struct vmcs12 *vmcs12) 1069static inline int nested_cpu_has_ept(struct vmcs12 *vmcs12)
1051{ 1070{
1052 return nested_cpu_has2(vmcs12, SECONDARY_EXEC_ENABLE_EPT); 1071 return nested_cpu_has2(vmcs12, SECONDARY_EXEC_ENABLE_EPT);
@@ -1710,6 +1729,8 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu)
1710 if (is_long_mode(&vmx->vcpu)) 1729 if (is_long_mode(&vmx->vcpu))
1711 wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base); 1730 wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base);
1712#endif 1731#endif
1732 if (boot_cpu_has(X86_FEATURE_MPX))
1733 rdmsrl(MSR_IA32_BNDCFGS, vmx->host_state.msr_host_bndcfgs);
1713 for (i = 0; i < vmx->save_nmsrs; ++i) 1734 for (i = 0; i < vmx->save_nmsrs; ++i)
1714 kvm_set_shared_msr(vmx->guest_msrs[i].index, 1735 kvm_set_shared_msr(vmx->guest_msrs[i].index,
1715 vmx->guest_msrs[i].data, 1736 vmx->guest_msrs[i].data,
@@ -1747,6 +1768,8 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx)
1747#ifdef CONFIG_X86_64 1768#ifdef CONFIG_X86_64
1748 wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base); 1769 wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base);
1749#endif 1770#endif
1771 if (vmx->host_state.msr_host_bndcfgs)
1772 wrmsrl(MSR_IA32_BNDCFGS, vmx->host_state.msr_host_bndcfgs);
1750 /* 1773 /*
1751 * If the FPU is not active (through the host task or 1774 * If the FPU is not active (through the host task or
1752 * the guest vcpu), then restore the cr0.TS bit. 1775 * the guest vcpu), then restore the cr0.TS bit.
@@ -2248,9 +2271,9 @@ static __init void nested_vmx_setup_ctls_msrs(void)
2248 */ 2271 */
2249 nested_vmx_pinbased_ctls_low |= PIN_BASED_ALWAYSON_WITHOUT_TRUE_MSR; 2272 nested_vmx_pinbased_ctls_low |= PIN_BASED_ALWAYSON_WITHOUT_TRUE_MSR;
2250 nested_vmx_pinbased_ctls_high &= PIN_BASED_EXT_INTR_MASK | 2273 nested_vmx_pinbased_ctls_high &= PIN_BASED_EXT_INTR_MASK |
2251 PIN_BASED_NMI_EXITING | PIN_BASED_VIRTUAL_NMIS | 2274 PIN_BASED_NMI_EXITING | PIN_BASED_VIRTUAL_NMIS;
2275 nested_vmx_pinbased_ctls_high |= PIN_BASED_ALWAYSON_WITHOUT_TRUE_MSR |
2252 PIN_BASED_VMX_PREEMPTION_TIMER; 2276 PIN_BASED_VMX_PREEMPTION_TIMER;
2253 nested_vmx_pinbased_ctls_high |= PIN_BASED_ALWAYSON_WITHOUT_TRUE_MSR;
2254 2277
2255 /* 2278 /*
2256 * Exit controls 2279 * Exit controls
@@ -2265,15 +2288,12 @@ static __init void nested_vmx_setup_ctls_msrs(void)
2265#ifdef CONFIG_X86_64 2288#ifdef CONFIG_X86_64
2266 VM_EXIT_HOST_ADDR_SPACE_SIZE | 2289 VM_EXIT_HOST_ADDR_SPACE_SIZE |
2267#endif 2290#endif
2268 VM_EXIT_LOAD_IA32_PAT | VM_EXIT_SAVE_IA32_PAT | 2291 VM_EXIT_LOAD_IA32_PAT | VM_EXIT_SAVE_IA32_PAT;
2292 nested_vmx_exit_ctls_high |= VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR |
2293 VM_EXIT_LOAD_IA32_EFER | VM_EXIT_SAVE_IA32_EFER |
2269 VM_EXIT_SAVE_VMX_PREEMPTION_TIMER; 2294 VM_EXIT_SAVE_VMX_PREEMPTION_TIMER;
2270 if (!(nested_vmx_pinbased_ctls_high & PIN_BASED_VMX_PREEMPTION_TIMER) || 2295 if (vmx_mpx_supported())
2271 !(nested_vmx_exit_ctls_high & VM_EXIT_SAVE_VMX_PREEMPTION_TIMER)) { 2296 nested_vmx_exit_ctls_high |= VM_EXIT_CLEAR_BNDCFGS;
2272 nested_vmx_exit_ctls_high &= ~VM_EXIT_SAVE_VMX_PREEMPTION_TIMER;
2273 nested_vmx_pinbased_ctls_high &= ~PIN_BASED_VMX_PREEMPTION_TIMER;
2274 }
2275 nested_vmx_exit_ctls_high |= (VM_EXIT_ALWAYSON_WITHOUT_TRUE_MSR |
2276 VM_EXIT_LOAD_IA32_EFER | VM_EXIT_SAVE_IA32_EFER);
2277 2297
2278 /* entry controls */ 2298 /* entry controls */
2279 rdmsr(MSR_IA32_VMX_ENTRY_CTLS, 2299 rdmsr(MSR_IA32_VMX_ENTRY_CTLS,
@@ -2287,6 +2307,8 @@ static __init void nested_vmx_setup_ctls_msrs(void)
2287 VM_ENTRY_LOAD_IA32_PAT; 2307 VM_ENTRY_LOAD_IA32_PAT;
2288 nested_vmx_entry_ctls_high |= (VM_ENTRY_ALWAYSON_WITHOUT_TRUE_MSR | 2308 nested_vmx_entry_ctls_high |= (VM_ENTRY_ALWAYSON_WITHOUT_TRUE_MSR |
2289 VM_ENTRY_LOAD_IA32_EFER); 2309 VM_ENTRY_LOAD_IA32_EFER);
2310 if (vmx_mpx_supported())
2311 nested_vmx_entry_ctls_high |= VM_ENTRY_LOAD_BNDCFGS;
2290 2312
2291 /* cpu-based controls */ 2313 /* cpu-based controls */
2292 rdmsr(MSR_IA32_VMX_PROCBASED_CTLS, 2314 rdmsr(MSR_IA32_VMX_PROCBASED_CTLS,
@@ -2342,9 +2364,9 @@ static __init void nested_vmx_setup_ctls_msrs(void)
2342 2364
2343 /* miscellaneous data */ 2365 /* miscellaneous data */
2344 rdmsr(MSR_IA32_VMX_MISC, nested_vmx_misc_low, nested_vmx_misc_high); 2366 rdmsr(MSR_IA32_VMX_MISC, nested_vmx_misc_low, nested_vmx_misc_high);
2345 nested_vmx_misc_low &= VMX_MISC_PREEMPTION_TIMER_RATE_MASK | 2367 nested_vmx_misc_low &= VMX_MISC_SAVE_EFER_LMA;
2346 VMX_MISC_SAVE_EFER_LMA; 2368 nested_vmx_misc_low |= VMX_MISC_EMULATED_PREEMPTION_TIMER_RATE |
2347 nested_vmx_misc_low |= VMX_MISC_ACTIVITY_HLT; 2369 VMX_MISC_ACTIVITY_HLT;
2348 nested_vmx_misc_high = 0; 2370 nested_vmx_misc_high = 0;
2349} 2371}
2350 2372
@@ -2479,6 +2501,11 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata)
2479 case MSR_IA32_SYSENTER_ESP: 2501 case MSR_IA32_SYSENTER_ESP:
2480 data = vmcs_readl(GUEST_SYSENTER_ESP); 2502 data = vmcs_readl(GUEST_SYSENTER_ESP);
2481 break; 2503 break;
2504 case MSR_IA32_BNDCFGS:
2505 if (!vmx_mpx_supported())
2506 return 1;
2507 data = vmcs_read64(GUEST_BNDCFGS);
2508 break;
2482 case MSR_IA32_FEATURE_CONTROL: 2509 case MSR_IA32_FEATURE_CONTROL:
2483 if (!nested_vmx_allowed(vcpu)) 2510 if (!nested_vmx_allowed(vcpu))
2484 return 1; 2511 return 1;
@@ -2547,6 +2574,11 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
2547 case MSR_IA32_SYSENTER_ESP: 2574 case MSR_IA32_SYSENTER_ESP:
2548 vmcs_writel(GUEST_SYSENTER_ESP, data); 2575 vmcs_writel(GUEST_SYSENTER_ESP, data);
2549 break; 2576 break;
2577 case MSR_IA32_BNDCFGS:
2578 if (!vmx_mpx_supported())
2579 return 1;
2580 vmcs_write64(GUEST_BNDCFGS, data);
2581 break;
2550 case MSR_IA32_TSC: 2582 case MSR_IA32_TSC:
2551 kvm_write_tsc(vcpu, msr_info); 2583 kvm_write_tsc(vcpu, msr_info);
2552 break; 2584 break;
@@ -2832,12 +2864,12 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf)
2832 vmx_capability.ept, vmx_capability.vpid); 2864 vmx_capability.ept, vmx_capability.vpid);
2833 } 2865 }
2834 2866
2835 min = 0; 2867 min = VM_EXIT_SAVE_DEBUG_CONTROLS;
2836#ifdef CONFIG_X86_64 2868#ifdef CONFIG_X86_64
2837 min |= VM_EXIT_HOST_ADDR_SPACE_SIZE; 2869 min |= VM_EXIT_HOST_ADDR_SPACE_SIZE;
2838#endif 2870#endif
2839 opt = VM_EXIT_SAVE_IA32_PAT | VM_EXIT_LOAD_IA32_PAT | 2871 opt = VM_EXIT_SAVE_IA32_PAT | VM_EXIT_LOAD_IA32_PAT |
2840 VM_EXIT_ACK_INTR_ON_EXIT; 2872 VM_EXIT_ACK_INTR_ON_EXIT | VM_EXIT_CLEAR_BNDCFGS;
2841 if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_EXIT_CTLS, 2873 if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_EXIT_CTLS,
2842 &_vmexit_control) < 0) 2874 &_vmexit_control) < 0)
2843 return -EIO; 2875 return -EIO;
@@ -2853,8 +2885,8 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf)
2853 !(_vmexit_control & VM_EXIT_ACK_INTR_ON_EXIT)) 2885 !(_vmexit_control & VM_EXIT_ACK_INTR_ON_EXIT))
2854 _pin_based_exec_control &= ~PIN_BASED_POSTED_INTR; 2886 _pin_based_exec_control &= ~PIN_BASED_POSTED_INTR;
2855 2887
2856 min = 0; 2888 min = VM_ENTRY_LOAD_DEBUG_CONTROLS;
2857 opt = VM_ENTRY_LOAD_IA32_PAT; 2889 opt = VM_ENTRY_LOAD_IA32_PAT | VM_ENTRY_LOAD_BNDCFGS;
2858 if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_ENTRY_CTLS, 2890 if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_ENTRY_CTLS,
2859 &_vmentry_control) < 0) 2891 &_vmentry_control) < 0)
2860 return -EIO; 2892 return -EIO;
@@ -4223,6 +4255,10 @@ static u32 vmx_pin_based_exec_ctrl(struct vcpu_vmx *vmx)
4223static u32 vmx_exec_control(struct vcpu_vmx *vmx) 4255static u32 vmx_exec_control(struct vcpu_vmx *vmx)
4224{ 4256{
4225 u32 exec_control = vmcs_config.cpu_based_exec_ctrl; 4257 u32 exec_control = vmcs_config.cpu_based_exec_ctrl;
4258
4259 if (vmx->vcpu.arch.switch_db_regs & KVM_DEBUGREG_WONT_EXIT)
4260 exec_control &= ~CPU_BASED_MOV_DR_EXITING;
4261
4226 if (!vm_need_tpr_shadow(vmx->vcpu.kvm)) { 4262 if (!vm_need_tpr_shadow(vmx->vcpu.kvm)) {
4227 exec_control &= ~CPU_BASED_TPR_SHADOW; 4263 exec_control &= ~CPU_BASED_TPR_SHADOW;
4228#ifdef CONFIG_X86_64 4264#ifdef CONFIG_X86_64
@@ -4496,39 +4532,28 @@ static bool nested_exit_on_nmi(struct kvm_vcpu *vcpu)
4496 PIN_BASED_NMI_EXITING; 4532 PIN_BASED_NMI_EXITING;
4497} 4533}
4498 4534
4499static int enable_irq_window(struct kvm_vcpu *vcpu) 4535static void enable_irq_window(struct kvm_vcpu *vcpu)
4500{ 4536{
4501 u32 cpu_based_vm_exec_control; 4537 u32 cpu_based_vm_exec_control;
4502 4538
4503 if (is_guest_mode(vcpu) && nested_exit_on_intr(vcpu))
4504 /*
4505 * We get here if vmx_interrupt_allowed() said we can't
4506 * inject to L1 now because L2 must run. The caller will have
4507 * to make L2 exit right after entry, so we can inject to L1
4508 * more promptly.
4509 */
4510 return -EBUSY;
4511
4512 cpu_based_vm_exec_control = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL); 4539 cpu_based_vm_exec_control = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL);
4513 cpu_based_vm_exec_control |= CPU_BASED_VIRTUAL_INTR_PENDING; 4540 cpu_based_vm_exec_control |= CPU_BASED_VIRTUAL_INTR_PENDING;
4514 vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, cpu_based_vm_exec_control); 4541 vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, cpu_based_vm_exec_control);
4515 return 0;
4516} 4542}
4517 4543
4518static int enable_nmi_window(struct kvm_vcpu *vcpu) 4544static void enable_nmi_window(struct kvm_vcpu *vcpu)
4519{ 4545{
4520 u32 cpu_based_vm_exec_control; 4546 u32 cpu_based_vm_exec_control;
4521 4547
4522 if (!cpu_has_virtual_nmis()) 4548 if (!cpu_has_virtual_nmis() ||
4523 return enable_irq_window(vcpu); 4549 vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & GUEST_INTR_STATE_STI) {
4524 4550 enable_irq_window(vcpu);
4525 if (vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & GUEST_INTR_STATE_STI) 4551 return;
4526 return enable_irq_window(vcpu); 4552 }
4527 4553
4528 cpu_based_vm_exec_control = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL); 4554 cpu_based_vm_exec_control = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL);
4529 cpu_based_vm_exec_control |= CPU_BASED_VIRTUAL_NMI_PENDING; 4555 cpu_based_vm_exec_control |= CPU_BASED_VIRTUAL_NMI_PENDING;
4530 vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, cpu_based_vm_exec_control); 4556 vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, cpu_based_vm_exec_control);
4531 return 0;
4532} 4557}
4533 4558
4534static void vmx_inject_irq(struct kvm_vcpu *vcpu) 4559static void vmx_inject_irq(struct kvm_vcpu *vcpu)
@@ -4620,22 +4645,8 @@ static void vmx_set_nmi_mask(struct kvm_vcpu *vcpu, bool masked)
4620 4645
4621static int vmx_nmi_allowed(struct kvm_vcpu *vcpu) 4646static int vmx_nmi_allowed(struct kvm_vcpu *vcpu)
4622{ 4647{
4623 if (is_guest_mode(vcpu)) { 4648 if (to_vmx(vcpu)->nested.nested_run_pending)
4624 if (to_vmx(vcpu)->nested.nested_run_pending) 4649 return 0;
4625 return 0;
4626 if (nested_exit_on_nmi(vcpu)) {
4627 nested_vmx_vmexit(vcpu, EXIT_REASON_EXCEPTION_NMI,
4628 NMI_VECTOR | INTR_TYPE_NMI_INTR |
4629 INTR_INFO_VALID_MASK, 0);
4630 /*
4631 * The NMI-triggered VM exit counts as injection:
4632 * clear this one and block further NMIs.
4633 */
4634 vcpu->arch.nmi_pending = 0;
4635 vmx_set_nmi_mask(vcpu, true);
4636 return 0;
4637 }
4638 }
4639 4650
4640 if (!cpu_has_virtual_nmis() && to_vmx(vcpu)->soft_vnmi_blocked) 4651 if (!cpu_has_virtual_nmis() && to_vmx(vcpu)->soft_vnmi_blocked)
4641 return 0; 4652 return 0;
@@ -4647,19 +4658,8 @@ static int vmx_nmi_allowed(struct kvm_vcpu *vcpu)
4647 4658
4648static int vmx_interrupt_allowed(struct kvm_vcpu *vcpu) 4659static int vmx_interrupt_allowed(struct kvm_vcpu *vcpu)
4649{ 4660{
4650 if (is_guest_mode(vcpu)) { 4661 return (!to_vmx(vcpu)->nested.nested_run_pending &&
4651 if (to_vmx(vcpu)->nested.nested_run_pending) 4662 vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_IF) &&
4652 return 0;
4653 if (nested_exit_on_intr(vcpu)) {
4654 nested_vmx_vmexit(vcpu, EXIT_REASON_EXTERNAL_INTERRUPT,
4655 0, 0);
4656 /*
4657 * fall through to normal code, but now in L1, not L2
4658 */
4659 }
4660 }
4661
4662 return (vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_IF) &&
4663 !(vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & 4663 !(vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) &
4664 (GUEST_INTR_STATE_STI | GUEST_INTR_STATE_MOV_SS)); 4664 (GUEST_INTR_STATE_STI | GUEST_INTR_STATE_MOV_SS));
4665} 4665}
@@ -5102,6 +5102,22 @@ static int handle_dr(struct kvm_vcpu *vcpu)
5102 } 5102 }
5103 } 5103 }
5104 5104
5105 if (vcpu->guest_debug == 0) {
5106 u32 cpu_based_vm_exec_control;
5107
5108 cpu_based_vm_exec_control = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL);
5109 cpu_based_vm_exec_control &= ~CPU_BASED_MOV_DR_EXITING;
5110 vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, cpu_based_vm_exec_control);
5111
5112 /*
5113 * No more DR vmexits; force a reload of the debug registers
5114 * and reenter on this instruction. The next vmexit will
5115 * retrieve the full state of the debug registers.
5116 */
5117 vcpu->arch.switch_db_regs |= KVM_DEBUGREG_WONT_EXIT;
5118 return 1;
5119 }
5120
5105 exit_qualification = vmcs_readl(EXIT_QUALIFICATION); 5121 exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
5106 dr = exit_qualification & DEBUG_REG_ACCESS_NUM; 5122 dr = exit_qualification & DEBUG_REG_ACCESS_NUM;
5107 reg = DEBUG_REG_ACCESS_REG(exit_qualification); 5123 reg = DEBUG_REG_ACCESS_REG(exit_qualification);
@@ -5128,6 +5144,24 @@ static void vmx_set_dr6(struct kvm_vcpu *vcpu, unsigned long val)
5128{ 5144{
5129} 5145}
5130 5146
5147static void vmx_sync_dirty_debug_regs(struct kvm_vcpu *vcpu)
5148{
5149 u32 cpu_based_vm_exec_control;
5150
5151 get_debugreg(vcpu->arch.db[0], 0);
5152 get_debugreg(vcpu->arch.db[1], 1);
5153 get_debugreg(vcpu->arch.db[2], 2);
5154 get_debugreg(vcpu->arch.db[3], 3);
5155 get_debugreg(vcpu->arch.dr6, 6);
5156 vcpu->arch.dr7 = vmcs_readl(GUEST_DR7);
5157
5158 vcpu->arch.switch_db_regs &= ~KVM_DEBUGREG_WONT_EXIT;
5159
5160 cpu_based_vm_exec_control = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL);
5161 cpu_based_vm_exec_control |= CPU_BASED_MOV_DR_EXITING;
5162 vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, cpu_based_vm_exec_control);
5163}
5164
5131static void vmx_set_dr7(struct kvm_vcpu *vcpu, unsigned long val) 5165static void vmx_set_dr7(struct kvm_vcpu *vcpu, unsigned long val)
5132{ 5166{
5133 vmcs_writel(GUEST_DR7, val); 5167 vmcs_writel(GUEST_DR7, val);
@@ -5727,6 +5761,18 @@ static void nested_vmx_failValid(struct kvm_vcpu *vcpu,
5727 */ 5761 */
5728} 5762}
5729 5763
5764static enum hrtimer_restart vmx_preemption_timer_fn(struct hrtimer *timer)
5765{
5766 struct vcpu_vmx *vmx =
5767 container_of(timer, struct vcpu_vmx, nested.preemption_timer);
5768
5769 vmx->nested.preemption_timer_expired = true;
5770 kvm_make_request(KVM_REQ_EVENT, &vmx->vcpu);
5771 kvm_vcpu_kick(&vmx->vcpu);
5772
5773 return HRTIMER_NORESTART;
5774}
5775
5730/* 5776/*
5731 * Emulate the VMXON instruction. 5777 * Emulate the VMXON instruction.
5732 * Currently, we just remember that VMX is active, and do not save or even 5778 * Currently, we just remember that VMX is active, and do not save or even
@@ -5791,6 +5837,10 @@ static int handle_vmon(struct kvm_vcpu *vcpu)
5791 INIT_LIST_HEAD(&(vmx->nested.vmcs02_pool)); 5837 INIT_LIST_HEAD(&(vmx->nested.vmcs02_pool));
5792 vmx->nested.vmcs02_num = 0; 5838 vmx->nested.vmcs02_num = 0;
5793 5839
5840 hrtimer_init(&vmx->nested.preemption_timer, CLOCK_MONOTONIC,
5841 HRTIMER_MODE_REL);
5842 vmx->nested.preemption_timer.function = vmx_preemption_timer_fn;
5843
5794 vmx->nested.vmxon = true; 5844 vmx->nested.vmxon = true;
5795 5845
5796 skip_emulated_instruction(vcpu); 5846 skip_emulated_instruction(vcpu);
@@ -6767,9 +6817,6 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
6767 * table is L0's fault. 6817 * table is L0's fault.
6768 */ 6818 */
6769 return 0; 6819 return 0;
6770 case EXIT_REASON_PREEMPTION_TIMER:
6771 return vmcs12->pin_based_vm_exec_control &
6772 PIN_BASED_VMX_PREEMPTION_TIMER;
6773 case EXIT_REASON_WBINVD: 6820 case EXIT_REASON_WBINVD:
6774 return nested_cpu_has2(vmcs12, SECONDARY_EXEC_WBINVD_EXITING); 6821 return nested_cpu_has2(vmcs12, SECONDARY_EXEC_WBINVD_EXITING);
6775 case EXIT_REASON_XSETBV: 6822 case EXIT_REASON_XSETBV:
@@ -6785,27 +6832,6 @@ static void vmx_get_exit_info(struct kvm_vcpu *vcpu, u64 *info1, u64 *info2)
6785 *info2 = vmcs_read32(VM_EXIT_INTR_INFO); 6832 *info2 = vmcs_read32(VM_EXIT_INTR_INFO);
6786} 6833}
6787 6834
6788static void nested_adjust_preemption_timer(struct kvm_vcpu *vcpu)
6789{
6790 u64 delta_tsc_l1;
6791 u32 preempt_val_l1, preempt_val_l2, preempt_scale;
6792
6793 if (!(get_vmcs12(vcpu)->pin_based_vm_exec_control &
6794 PIN_BASED_VMX_PREEMPTION_TIMER))
6795 return;
6796 preempt_scale = native_read_msr(MSR_IA32_VMX_MISC) &
6797 MSR_IA32_VMX_MISC_PREEMPTION_TIMER_SCALE;
6798 preempt_val_l2 = vmcs_read32(VMX_PREEMPTION_TIMER_VALUE);
6799 delta_tsc_l1 = vmx_read_l1_tsc(vcpu, native_read_tsc())
6800 - vcpu->arch.last_guest_tsc;
6801 preempt_val_l1 = delta_tsc_l1 >> preempt_scale;
6802 if (preempt_val_l2 <= preempt_val_l1)
6803 preempt_val_l2 = 0;
6804 else
6805 preempt_val_l2 -= preempt_val_l1;
6806 vmcs_write32(VMX_PREEMPTION_TIMER_VALUE, preempt_val_l2);
6807}
6808
6809/* 6835/*
6810 * The guest has exited. See if we can fix it or if we need userspace 6836 * The guest has exited. See if we can fix it or if we need userspace
6811 * assistance. 6837 * assistance.
@@ -7052,6 +7078,12 @@ static void vmx_handle_external_intr(struct kvm_vcpu *vcpu)
7052 local_irq_enable(); 7078 local_irq_enable();
7053} 7079}
7054 7080
7081static bool vmx_mpx_supported(void)
7082{
7083 return (vmcs_config.vmexit_ctrl & VM_EXIT_CLEAR_BNDCFGS) &&
7084 (vmcs_config.vmentry_ctrl & VM_ENTRY_LOAD_BNDCFGS);
7085}
7086
7055static void vmx_recover_nmi_blocking(struct vcpu_vmx *vmx) 7087static void vmx_recover_nmi_blocking(struct vcpu_vmx *vmx)
7056{ 7088{
7057 u32 exit_intr_info; 7089 u32 exit_intr_info;
@@ -7218,8 +7250,6 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
7218 atomic_switch_perf_msrs(vmx); 7250 atomic_switch_perf_msrs(vmx);
7219 debugctlmsr = get_debugctlmsr(); 7251 debugctlmsr = get_debugctlmsr();
7220 7252
7221 if (is_guest_mode(vcpu) && !vmx->nested.nested_run_pending)
7222 nested_adjust_preemption_timer(vcpu);
7223 vmx->__launched = vmx->loaded_vmcs->launched; 7253 vmx->__launched = vmx->loaded_vmcs->launched;
7224 asm( 7254 asm(
7225 /* Store host registers */ 7255 /* Store host registers */
@@ -7616,6 +7646,28 @@ static void vmx_inject_page_fault_nested(struct kvm_vcpu *vcpu,
7616 kvm_inject_page_fault(vcpu, fault); 7646 kvm_inject_page_fault(vcpu, fault);
7617} 7647}
7618 7648
7649static void vmx_start_preemption_timer(struct kvm_vcpu *vcpu)
7650{
7651 u64 preemption_timeout = get_vmcs12(vcpu)->vmx_preemption_timer_value;
7652 struct vcpu_vmx *vmx = to_vmx(vcpu);
7653
7654 if (vcpu->arch.virtual_tsc_khz == 0)
7655 return;
7656
7657 /* Make sure short timeouts reliably trigger an immediate vmexit.
7658 * hrtimer_start does not guarantee this. */
7659 if (preemption_timeout <= 1) {
7660 vmx_preemption_timer_fn(&vmx->nested.preemption_timer);
7661 return;
7662 }
7663
7664 preemption_timeout <<= VMX_MISC_EMULATED_PREEMPTION_TIMER_RATE;
7665 preemption_timeout *= 1000000;
7666 do_div(preemption_timeout, vcpu->arch.virtual_tsc_khz);
7667 hrtimer_start(&vmx->nested.preemption_timer,
7668 ns_to_ktime(preemption_timeout), HRTIMER_MODE_REL);
7669}
7670
7619/* 7671/*
7620 * prepare_vmcs02 is called when the L1 guest hypervisor runs its nested 7672 * prepare_vmcs02 is called when the L1 guest hypervisor runs its nested
7621 * L2 guest. L1 has a vmcs for L2 (vmcs12), and this function "merges" it 7673 * L2 guest. L1 has a vmcs for L2 (vmcs12), and this function "merges" it
@@ -7629,7 +7681,6 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
7629{ 7681{
7630 struct vcpu_vmx *vmx = to_vmx(vcpu); 7682 struct vcpu_vmx *vmx = to_vmx(vcpu);
7631 u32 exec_control; 7683 u32 exec_control;
7632 u32 exit_control;
7633 7684
7634 vmcs_write16(GUEST_ES_SELECTOR, vmcs12->guest_es_selector); 7685 vmcs_write16(GUEST_ES_SELECTOR, vmcs12->guest_es_selector);
7635 vmcs_write16(GUEST_CS_SELECTOR, vmcs12->guest_cs_selector); 7686 vmcs_write16(GUEST_CS_SELECTOR, vmcs12->guest_cs_selector);
@@ -7687,13 +7738,14 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
7687 7738
7688 vmcs_write64(VMCS_LINK_POINTER, -1ull); 7739 vmcs_write64(VMCS_LINK_POINTER, -1ull);
7689 7740
7690 vmcs_write32(PIN_BASED_VM_EXEC_CONTROL, 7741 exec_control = vmcs12->pin_based_vm_exec_control;
7691 (vmcs_config.pin_based_exec_ctrl | 7742 exec_control |= vmcs_config.pin_based_exec_ctrl;
7692 vmcs12->pin_based_vm_exec_control)); 7743 exec_control &= ~PIN_BASED_VMX_PREEMPTION_TIMER;
7744 vmcs_write32(PIN_BASED_VM_EXEC_CONTROL, exec_control);
7693 7745
7694 if (vmcs12->pin_based_vm_exec_control & PIN_BASED_VMX_PREEMPTION_TIMER) 7746 vmx->nested.preemption_timer_expired = false;
7695 vmcs_write32(VMX_PREEMPTION_TIMER_VALUE, 7747 if (nested_cpu_has_preemption_timer(vmcs12))
7696 vmcs12->vmx_preemption_timer_value); 7748 vmx_start_preemption_timer(vcpu);
7697 7749
7698 /* 7750 /*
7699 * Whether page-faults are trapped is determined by a combination of 7751 * Whether page-faults are trapped is determined by a combination of
@@ -7721,7 +7773,7 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
7721 enable_ept ? vmcs12->page_fault_error_code_match : 0); 7773 enable_ept ? vmcs12->page_fault_error_code_match : 0);
7722 7774
7723 if (cpu_has_secondary_exec_ctrls()) { 7775 if (cpu_has_secondary_exec_ctrls()) {
7724 u32 exec_control = vmx_secondary_exec_control(vmx); 7776 exec_control = vmx_secondary_exec_control(vmx);
7725 if (!vmx->rdtscp_enabled) 7777 if (!vmx->rdtscp_enabled)
7726 exec_control &= ~SECONDARY_EXEC_RDTSCP; 7778 exec_control &= ~SECONDARY_EXEC_RDTSCP;
7727 /* Take the following fields only from vmcs12 */ 7779 /* Take the following fields only from vmcs12 */
@@ -7808,10 +7860,7 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
7808 * we should use its exit controls. Note that VM_EXIT_LOAD_IA32_EFER 7860 * we should use its exit controls. Note that VM_EXIT_LOAD_IA32_EFER
7809 * bits are further modified by vmx_set_efer() below. 7861 * bits are further modified by vmx_set_efer() below.
7810 */ 7862 */
7811 exit_control = vmcs_config.vmexit_ctrl; 7863 vmcs_write32(VM_EXIT_CONTROLS, vmcs_config.vmexit_ctrl);
7812 if (vmcs12->pin_based_vm_exec_control & PIN_BASED_VMX_PREEMPTION_TIMER)
7813 exit_control |= VM_EXIT_SAVE_VMX_PREEMPTION_TIMER;
7814 vm_exit_controls_init(vmx, exit_control);
7815 7864
7816 /* vmcs12's VM_ENTRY_LOAD_IA32_EFER and VM_ENTRY_IA32E_MODE are 7865 /* vmcs12's VM_ENTRY_LOAD_IA32_EFER and VM_ENTRY_IA32E_MODE are
7817 * emulated by vmx_set_efer(), below. 7866 * emulated by vmx_set_efer(), below.
@@ -7830,6 +7879,9 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
7830 7879
7831 set_cr4_guest_host_mask(vmx); 7880 set_cr4_guest_host_mask(vmx);
7832 7881
7882 if (vmcs12->vm_entry_controls & VM_ENTRY_LOAD_BNDCFGS)
7883 vmcs_write64(GUEST_BNDCFGS, vmcs12->guest_bndcfgs);
7884
7833 if (vmcs12->cpu_based_vm_exec_control & CPU_BASED_USE_TSC_OFFSETING) 7885 if (vmcs12->cpu_based_vm_exec_control & CPU_BASED_USE_TSC_OFFSETING)
7834 vmcs_write64(TSC_OFFSET, 7886 vmcs_write64(TSC_OFFSET,
7835 vmx->nested.vmcs01_tsc_offset + vmcs12->tsc_offset); 7887 vmx->nested.vmcs01_tsc_offset + vmcs12->tsc_offset);
@@ -8155,6 +8207,58 @@ static void vmcs12_save_pending_event(struct kvm_vcpu *vcpu,
8155 } 8207 }
8156} 8208}
8157 8209
8210static int vmx_check_nested_events(struct kvm_vcpu *vcpu, bool external_intr)
8211{
8212 struct vcpu_vmx *vmx = to_vmx(vcpu);
8213
8214 if (nested_cpu_has_preemption_timer(get_vmcs12(vcpu)) &&
8215 vmx->nested.preemption_timer_expired) {
8216 if (vmx->nested.nested_run_pending)
8217 return -EBUSY;
8218 nested_vmx_vmexit(vcpu, EXIT_REASON_PREEMPTION_TIMER, 0, 0);
8219 return 0;
8220 }
8221
8222 if (vcpu->arch.nmi_pending && nested_exit_on_nmi(vcpu)) {
8223 if (vmx->nested.nested_run_pending ||
8224 vcpu->arch.interrupt.pending)
8225 return -EBUSY;
8226 nested_vmx_vmexit(vcpu, EXIT_REASON_EXCEPTION_NMI,
8227 NMI_VECTOR | INTR_TYPE_NMI_INTR |
8228 INTR_INFO_VALID_MASK, 0);
8229 /*
8230 * The NMI-triggered VM exit counts as injection:
8231 * clear this one and block further NMIs.
8232 */
8233 vcpu->arch.nmi_pending = 0;
8234 vmx_set_nmi_mask(vcpu, true);
8235 return 0;
8236 }
8237
8238 if ((kvm_cpu_has_interrupt(vcpu) || external_intr) &&
8239 nested_exit_on_intr(vcpu)) {
8240 if (vmx->nested.nested_run_pending)
8241 return -EBUSY;
8242 nested_vmx_vmexit(vcpu, EXIT_REASON_EXTERNAL_INTERRUPT, 0, 0);
8243 }
8244
8245 return 0;
8246}
8247
8248static u32 vmx_get_preemption_timer_value(struct kvm_vcpu *vcpu)
8249{
8250 ktime_t remaining =
8251 hrtimer_get_remaining(&to_vmx(vcpu)->nested.preemption_timer);
8252 u64 value;
8253
8254 if (ktime_to_ns(remaining) <= 0)
8255 return 0;
8256
8257 value = ktime_to_ns(remaining) * vcpu->arch.virtual_tsc_khz;
8258 do_div(value, 1000000);
8259 return value >> VMX_MISC_EMULATED_PREEMPTION_TIMER_RATE;
8260}
8261
8158/* 8262/*
8159 * prepare_vmcs12 is part of what we need to do when the nested L2 guest exits 8263 * prepare_vmcs12 is part of what we need to do when the nested L2 guest exits
8160 * and we want to prepare to run its L1 parent. L1 keeps a vmcs for L2 (vmcs12), 8264 * and we want to prepare to run its L1 parent. L1 keeps a vmcs for L2 (vmcs12),
@@ -8225,10 +8329,13 @@ static void prepare_vmcs12(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12,
8225 else 8329 else
8226 vmcs12->guest_activity_state = GUEST_ACTIVITY_ACTIVE; 8330 vmcs12->guest_activity_state = GUEST_ACTIVITY_ACTIVE;
8227 8331
8228 if ((vmcs12->pin_based_vm_exec_control & PIN_BASED_VMX_PREEMPTION_TIMER) && 8332 if (nested_cpu_has_preemption_timer(vmcs12)) {
8229 (vmcs12->vm_exit_controls & VM_EXIT_SAVE_VMX_PREEMPTION_TIMER)) 8333 if (vmcs12->vm_exit_controls &
8230 vmcs12->vmx_preemption_timer_value = 8334 VM_EXIT_SAVE_VMX_PREEMPTION_TIMER)
8231 vmcs_read32(VMX_PREEMPTION_TIMER_VALUE); 8335 vmcs12->vmx_preemption_timer_value =
8336 vmx_get_preemption_timer_value(vcpu);
8337 hrtimer_cancel(&to_vmx(vcpu)->nested.preemption_timer);
8338 }
8232 8339
8233 /* 8340 /*
8234 * In some cases (usually, nested EPT), L2 is allowed to change its 8341 * In some cases (usually, nested EPT), L2 is allowed to change its
@@ -8260,6 +8367,8 @@ static void prepare_vmcs12(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12,
8260 vmcs12->guest_sysenter_cs = vmcs_read32(GUEST_SYSENTER_CS); 8367 vmcs12->guest_sysenter_cs = vmcs_read32(GUEST_SYSENTER_CS);
8261 vmcs12->guest_sysenter_esp = vmcs_readl(GUEST_SYSENTER_ESP); 8368 vmcs12->guest_sysenter_esp = vmcs_readl(GUEST_SYSENTER_ESP);
8262 vmcs12->guest_sysenter_eip = vmcs_readl(GUEST_SYSENTER_EIP); 8369 vmcs12->guest_sysenter_eip = vmcs_readl(GUEST_SYSENTER_EIP);
8370 if (vmx_mpx_supported())
8371 vmcs12->guest_bndcfgs = vmcs_read64(GUEST_BNDCFGS);
8263 8372
8264 /* update exit information fields: */ 8373 /* update exit information fields: */
8265 8374
@@ -8369,6 +8478,10 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu,
8369 vmcs_writel(GUEST_IDTR_BASE, vmcs12->host_idtr_base); 8478 vmcs_writel(GUEST_IDTR_BASE, vmcs12->host_idtr_base);
8370 vmcs_writel(GUEST_GDTR_BASE, vmcs12->host_gdtr_base); 8479 vmcs_writel(GUEST_GDTR_BASE, vmcs12->host_gdtr_base);
8371 8480
8481 /* If not VM_EXIT_CLEAR_BNDCFGS, the L2 value propagates to L1. */
8482 if (vmcs12->vm_exit_controls & VM_EXIT_CLEAR_BNDCFGS)
8483 vmcs_write64(GUEST_BNDCFGS, 0);
8484
8372 if (vmcs12->vm_exit_controls & VM_EXIT_LOAD_IA32_PAT) { 8485 if (vmcs12->vm_exit_controls & VM_EXIT_LOAD_IA32_PAT) {
8373 vmcs_write64(GUEST_IA32_PAT, vmcs12->host_ia32_pat); 8486 vmcs_write64(GUEST_IA32_PAT, vmcs12->host_ia32_pat);
8374 vcpu->arch.pat = vmcs12->host_ia32_pat; 8487 vcpu->arch.pat = vmcs12->host_ia32_pat;
@@ -8495,6 +8608,9 @@ static void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 exit_reason,
8495 nested_vmx_succeed(vcpu); 8608 nested_vmx_succeed(vcpu);
8496 if (enable_shadow_vmcs) 8609 if (enable_shadow_vmcs)
8497 vmx->nested.sync_shadow_vmcs = true; 8610 vmx->nested.sync_shadow_vmcs = true;
8611
8612 /* in case we halted in L2 */
8613 vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
8498} 8614}
8499 8615
8500/* 8616/*
@@ -8573,6 +8689,7 @@ static struct kvm_x86_ops vmx_x86_ops = {
8573 .get_dr6 = vmx_get_dr6, 8689 .get_dr6 = vmx_get_dr6,
8574 .set_dr6 = vmx_set_dr6, 8690 .set_dr6 = vmx_set_dr6,
8575 .set_dr7 = vmx_set_dr7, 8691 .set_dr7 = vmx_set_dr7,
8692 .sync_dirty_debug_regs = vmx_sync_dirty_debug_regs,
8576 .cache_reg = vmx_cache_reg, 8693 .cache_reg = vmx_cache_reg,
8577 .get_rflags = vmx_get_rflags, 8694 .get_rflags = vmx_get_rflags,
8578 .set_rflags = vmx_set_rflags, 8695 .set_rflags = vmx_set_rflags,
@@ -8634,6 +8751,9 @@ static struct kvm_x86_ops vmx_x86_ops = {
8634 8751
8635 .check_intercept = vmx_check_intercept, 8752 .check_intercept = vmx_check_intercept,
8636 .handle_external_intr = vmx_handle_external_intr, 8753 .handle_external_intr = vmx_handle_external_intr,
8754 .mpx_supported = vmx_mpx_supported,
8755
8756 .check_nested_events = vmx_check_nested_events,
8637}; 8757};
8638 8758
8639static int __init vmx_init(void) 8759static int __init vmx_init(void)
@@ -8721,6 +8841,8 @@ static int __init vmx_init(void)
8721 vmx_disable_intercept_for_msr(MSR_IA32_SYSENTER_CS, false); 8841 vmx_disable_intercept_for_msr(MSR_IA32_SYSENTER_CS, false);
8722 vmx_disable_intercept_for_msr(MSR_IA32_SYSENTER_ESP, false); 8842 vmx_disable_intercept_for_msr(MSR_IA32_SYSENTER_ESP, false);
8723 vmx_disable_intercept_for_msr(MSR_IA32_SYSENTER_EIP, false); 8843 vmx_disable_intercept_for_msr(MSR_IA32_SYSENTER_EIP, false);
8844 vmx_disable_intercept_for_msr(MSR_IA32_BNDCFGS, true);
8845
8724 memcpy(vmx_msr_bitmap_legacy_x2apic, 8846 memcpy(vmx_msr_bitmap_legacy_x2apic,
8725 vmx_msr_bitmap_legacy, PAGE_SIZE); 8847 vmx_msr_bitmap_legacy, PAGE_SIZE);
8726 memcpy(vmx_msr_bitmap_longmode_x2apic, 8848 memcpy(vmx_msr_bitmap_longmode_x2apic,
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 2b8578432d5b..9d1b5cd4d34c 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -595,13 +595,13 @@ static void kvm_put_guest_xcr0(struct kvm_vcpu *vcpu)
595 595
596int __kvm_set_xcr(struct kvm_vcpu *vcpu, u32 index, u64 xcr) 596int __kvm_set_xcr(struct kvm_vcpu *vcpu, u32 index, u64 xcr)
597{ 597{
598 u64 xcr0; 598 u64 xcr0 = xcr;
599 u64 old_xcr0 = vcpu->arch.xcr0;
599 u64 valid_bits; 600 u64 valid_bits;
600 601
601 /* Only support XCR_XFEATURE_ENABLED_MASK(xcr0) now */ 602 /* Only support XCR_XFEATURE_ENABLED_MASK(xcr0) now */
602 if (index != XCR_XFEATURE_ENABLED_MASK) 603 if (index != XCR_XFEATURE_ENABLED_MASK)
603 return 1; 604 return 1;
604 xcr0 = xcr;
605 if (!(xcr0 & XSTATE_FP)) 605 if (!(xcr0 & XSTATE_FP))
606 return 1; 606 return 1;
607 if ((xcr0 & XSTATE_YMM) && !(xcr0 & XSTATE_SSE)) 607 if ((xcr0 & XSTATE_YMM) && !(xcr0 & XSTATE_SSE))
@@ -616,8 +616,14 @@ int __kvm_set_xcr(struct kvm_vcpu *vcpu, u32 index, u64 xcr)
616 if (xcr0 & ~valid_bits) 616 if (xcr0 & ~valid_bits)
617 return 1; 617 return 1;
618 618
619 if ((!(xcr0 & XSTATE_BNDREGS)) != (!(xcr0 & XSTATE_BNDCSR)))
620 return 1;
621
619 kvm_put_guest_xcr0(vcpu); 622 kvm_put_guest_xcr0(vcpu);
620 vcpu->arch.xcr0 = xcr0; 623 vcpu->arch.xcr0 = xcr0;
624
625 if ((xcr0 ^ old_xcr0) & XSTATE_EXTEND_MASK)
626 kvm_update_cpuid(vcpu);
621 return 0; 627 return 0;
622} 628}
623 629
@@ -753,7 +759,9 @@ static void kvm_update_dr7(struct kvm_vcpu *vcpu)
753 else 759 else
754 dr7 = vcpu->arch.dr7; 760 dr7 = vcpu->arch.dr7;
755 kvm_x86_ops->set_dr7(vcpu, dr7); 761 kvm_x86_ops->set_dr7(vcpu, dr7);
756 vcpu->arch.switch_db_regs = (dr7 & DR7_BP_EN_MASK); 762 vcpu->arch.switch_db_regs &= ~KVM_DEBUGREG_BP_ENABLED;
763 if (dr7 & DR7_BP_EN_MASK)
764 vcpu->arch.switch_db_regs |= KVM_DEBUGREG_BP_ENABLED;
757} 765}
758 766
759static int __kvm_set_dr(struct kvm_vcpu *vcpu, int dr, unsigned long val) 767static int __kvm_set_dr(struct kvm_vcpu *vcpu, int dr, unsigned long val)
@@ -879,7 +887,7 @@ static u32 msrs_to_save[] = {
879 MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR, 887 MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR,
880#endif 888#endif
881 MSR_IA32_TSC, MSR_IA32_CR_PAT, MSR_VM_HSAVE_PA, 889 MSR_IA32_TSC, MSR_IA32_CR_PAT, MSR_VM_HSAVE_PA,
882 MSR_IA32_FEATURE_CONTROL 890 MSR_IA32_FEATURE_CONTROL, MSR_IA32_BNDCFGS
883}; 891};
884 892
885static unsigned num_msrs_to_save; 893static unsigned num_msrs_to_save;
@@ -1581,7 +1589,6 @@ static int kvm_guest_time_update(struct kvm_vcpu *v)
1581 /* With all the info we got, fill in the values */ 1589 /* With all the info we got, fill in the values */
1582 vcpu->hv_clock.tsc_timestamp = tsc_timestamp; 1590 vcpu->hv_clock.tsc_timestamp = tsc_timestamp;
1583 vcpu->hv_clock.system_time = kernel_ns + v->kvm->arch.kvmclock_offset; 1591 vcpu->hv_clock.system_time = kernel_ns + v->kvm->arch.kvmclock_offset;
1584 vcpu->last_kernel_ns = kernel_ns;
1585 vcpu->last_guest_tsc = tsc_timestamp; 1592 vcpu->last_guest_tsc = tsc_timestamp;
1586 1593
1587 /* 1594 /*
@@ -1623,14 +1630,21 @@ static int kvm_guest_time_update(struct kvm_vcpu *v)
1623 * the others. 1630 * the others.
1624 * 1631 *
1625 * So in those cases, request a kvmclock update for all vcpus. 1632 * So in those cases, request a kvmclock update for all vcpus.
1626 * The worst case for a remote vcpu to update its kvmclock 1633 * We need to rate-limit these requests though, as they can
1627 * is then bounded by maximum nohz sleep latency. 1634 * considerably slow guests that have a large number of vcpus.
1635 * The time for a remote vcpu to update its kvmclock is bound
1636 * by the delay we use to rate-limit the updates.
1628 */ 1637 */
1629 1638
1630static void kvm_gen_kvmclock_update(struct kvm_vcpu *v) 1639#define KVMCLOCK_UPDATE_DELAY msecs_to_jiffies(100)
1640
1641static void kvmclock_update_fn(struct work_struct *work)
1631{ 1642{
1632 int i; 1643 int i;
1633 struct kvm *kvm = v->kvm; 1644 struct delayed_work *dwork = to_delayed_work(work);
1645 struct kvm_arch *ka = container_of(dwork, struct kvm_arch,
1646 kvmclock_update_work);
1647 struct kvm *kvm = container_of(ka, struct kvm, arch);
1634 struct kvm_vcpu *vcpu; 1648 struct kvm_vcpu *vcpu;
1635 1649
1636 kvm_for_each_vcpu(i, vcpu, kvm) { 1650 kvm_for_each_vcpu(i, vcpu, kvm) {
@@ -1639,6 +1653,29 @@ static void kvm_gen_kvmclock_update(struct kvm_vcpu *v)
1639 } 1653 }
1640} 1654}
1641 1655
1656static void kvm_gen_kvmclock_update(struct kvm_vcpu *v)
1657{
1658 struct kvm *kvm = v->kvm;
1659
1660 set_bit(KVM_REQ_CLOCK_UPDATE, &v->requests);
1661 schedule_delayed_work(&kvm->arch.kvmclock_update_work,
1662 KVMCLOCK_UPDATE_DELAY);
1663}
1664
1665#define KVMCLOCK_SYNC_PERIOD (300 * HZ)
1666
1667static void kvmclock_sync_fn(struct work_struct *work)
1668{
1669 struct delayed_work *dwork = to_delayed_work(work);
1670 struct kvm_arch *ka = container_of(dwork, struct kvm_arch,
1671 kvmclock_sync_work);
1672 struct kvm *kvm = container_of(ka, struct kvm, arch);
1673
1674 schedule_delayed_work(&kvm->arch.kvmclock_update_work, 0);
1675 schedule_delayed_work(&kvm->arch.kvmclock_sync_work,
1676 KVMCLOCK_SYNC_PERIOD);
1677}
1678
1642static bool msr_mtrr_valid(unsigned msr) 1679static bool msr_mtrr_valid(unsigned msr)
1643{ 1680{
1644 switch (msr) { 1681 switch (msr) {
@@ -2323,9 +2360,12 @@ static int get_msr_hyperv(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
2323 case HV_X64_MSR_VP_INDEX: { 2360 case HV_X64_MSR_VP_INDEX: {
2324 int r; 2361 int r;
2325 struct kvm_vcpu *v; 2362 struct kvm_vcpu *v;
2326 kvm_for_each_vcpu(r, v, vcpu->kvm) 2363 kvm_for_each_vcpu(r, v, vcpu->kvm) {
2327 if (v == vcpu) 2364 if (v == vcpu) {
2328 data = r; 2365 data = r;
2366 break;
2367 }
2368 }
2329 break; 2369 break;
2330 } 2370 }
2331 case HV_X64_MSR_EOI: 2371 case HV_X64_MSR_EOI:
@@ -2617,6 +2657,7 @@ int kvm_dev_ioctl_check_extension(long ext)
2617 case KVM_CAP_KVMCLOCK_CTRL: 2657 case KVM_CAP_KVMCLOCK_CTRL:
2618 case KVM_CAP_READONLY_MEM: 2658 case KVM_CAP_READONLY_MEM:
2619 case KVM_CAP_HYPERV_TIME: 2659 case KVM_CAP_HYPERV_TIME:
2660 case KVM_CAP_IOAPIC_POLARITY_IGNORED:
2620#ifdef CONFIG_KVM_DEVICE_ASSIGNMENT 2661#ifdef CONFIG_KVM_DEVICE_ASSIGNMENT
2621 case KVM_CAP_ASSIGN_DEV_IRQ: 2662 case KVM_CAP_ASSIGN_DEV_IRQ:
2622 case KVM_CAP_PCI_2_3: 2663 case KVM_CAP_PCI_2_3:
@@ -3043,9 +3084,7 @@ static int kvm_vcpu_ioctl_x86_set_xsave(struct kvm_vcpu *vcpu,
3043 * CPUID leaf 0xD, index 0, EDX:EAX. This is for compatibility 3084 * CPUID leaf 0xD, index 0, EDX:EAX. This is for compatibility
3044 * with old userspace. 3085 * with old userspace.
3045 */ 3086 */
3046 if (xstate_bv & ~KVM_SUPPORTED_XCR0) 3087 if (xstate_bv & ~kvm_supported_xcr0())
3047 return -EINVAL;
3048 if (xstate_bv & ~host_xcr0)
3049 return -EINVAL; 3088 return -EINVAL;
3050 memcpy(&vcpu->arch.guest_fpu.state->xsave, 3089 memcpy(&vcpu->arch.guest_fpu.state->xsave,
3051 guest_xsave->region, vcpu->arch.guest_xstate_size); 3090 guest_xsave->region, vcpu->arch.guest_xstate_size);
@@ -3898,6 +3937,23 @@ static void kvm_init_msr_list(void)
3898 for (i = j = KVM_SAVE_MSRS_BEGIN; i < ARRAY_SIZE(msrs_to_save); i++) { 3937 for (i = j = KVM_SAVE_MSRS_BEGIN; i < ARRAY_SIZE(msrs_to_save); i++) {
3899 if (rdmsr_safe(msrs_to_save[i], &dummy[0], &dummy[1]) < 0) 3938 if (rdmsr_safe(msrs_to_save[i], &dummy[0], &dummy[1]) < 0)
3900 continue; 3939 continue;
3940
3941 /*
3942 * Even MSRs that are valid in the host may not be exposed
3943 * to the guests in some cases. We could work around this
3944 * in VMX with the generic MSR save/load machinery, but it
3945 * is not really worthwhile since it will really only
3946 * happen with nested virtualization.
3947 */
3948 switch (msrs_to_save[i]) {
3949 case MSR_IA32_BNDCFGS:
3950 if (!kvm_x86_ops->mpx_supported())
3951 continue;
3952 break;
3953 default:
3954 break;
3955 }
3956
3901 if (j < i) 3957 if (j < i)
3902 msrs_to_save[j] = msrs_to_save[i]; 3958 msrs_to_save[j] = msrs_to_save[i];
3903 j++; 3959 j++;
@@ -4394,6 +4450,7 @@ static int emulator_cmpxchg_emulated(struct x86_emulate_ctxt *ctxt,
4394 if (!exchanged) 4450 if (!exchanged)
4395 return X86EMUL_CMPXCHG_FAILED; 4451 return X86EMUL_CMPXCHG_FAILED;
4396 4452
4453 mark_page_dirty(vcpu->kvm, gpa >> PAGE_SHIFT);
4397 kvm_mmu_pte_write(vcpu, gpa, new, bytes); 4454 kvm_mmu_pte_write(vcpu, gpa, new, bytes);
4398 4455
4399 return X86EMUL_CONTINUE; 4456 return X86EMUL_CONTINUE;
@@ -5365,7 +5422,8 @@ static void kvm_timer_init(void)
5365 int cpu; 5422 int cpu;
5366 5423
5367 max_tsc_khz = tsc_khz; 5424 max_tsc_khz = tsc_khz;
5368 register_hotcpu_notifier(&kvmclock_cpu_notifier_block); 5425
5426 cpu_notifier_register_begin();
5369 if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) { 5427 if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) {
5370#ifdef CONFIG_CPU_FREQ 5428#ifdef CONFIG_CPU_FREQ
5371 struct cpufreq_policy policy; 5429 struct cpufreq_policy policy;
@@ -5382,6 +5440,10 @@ static void kvm_timer_init(void)
5382 pr_debug("kvm: max_tsc_khz = %ld\n", max_tsc_khz); 5440 pr_debug("kvm: max_tsc_khz = %ld\n", max_tsc_khz);
5383 for_each_online_cpu(cpu) 5441 for_each_online_cpu(cpu)
5384 smp_call_function_single(cpu, tsc_khz_changed, NULL, 1); 5442 smp_call_function_single(cpu, tsc_khz_changed, NULL, 1);
5443
5444 __register_hotcpu_notifier(&kvmclock_cpu_notifier_block);
5445 cpu_notifier_register_done();
5446
5385} 5447}
5386 5448
5387static DEFINE_PER_CPU(struct kvm_vcpu *, current_vcpu); 5449static DEFINE_PER_CPU(struct kvm_vcpu *, current_vcpu);
@@ -5537,9 +5599,10 @@ int kvm_arch_init(void *opaque)
5537 goto out_free_percpu; 5599 goto out_free_percpu;
5538 5600
5539 kvm_set_mmio_spte_mask(); 5601 kvm_set_mmio_spte_mask();
5540 kvm_init_msr_list();
5541 5602
5542 kvm_x86_ops = ops; 5603 kvm_x86_ops = ops;
5604 kvm_init_msr_list();
5605
5543 kvm_mmu_set_mask_ptes(PT_USER_MASK, PT_ACCESSED_MASK, 5606 kvm_mmu_set_mask_ptes(PT_USER_MASK, PT_ACCESSED_MASK,
5544 PT_DIRTY_MASK, PT64_NX_MASK, 0); 5607 PT_DIRTY_MASK, PT64_NX_MASK, 0);
5545 5608
@@ -5782,8 +5845,10 @@ static void update_cr8_intercept(struct kvm_vcpu *vcpu)
5782 kvm_x86_ops->update_cr8_intercept(vcpu, tpr, max_irr); 5845 kvm_x86_ops->update_cr8_intercept(vcpu, tpr, max_irr);
5783} 5846}
5784 5847
5785static void inject_pending_event(struct kvm_vcpu *vcpu) 5848static int inject_pending_event(struct kvm_vcpu *vcpu, bool req_int_win)
5786{ 5849{
5850 int r;
5851
5787 /* try to reinject previous events if any */ 5852 /* try to reinject previous events if any */
5788 if (vcpu->arch.exception.pending) { 5853 if (vcpu->arch.exception.pending) {
5789 trace_kvm_inj_exception(vcpu->arch.exception.nr, 5854 trace_kvm_inj_exception(vcpu->arch.exception.nr,
@@ -5793,17 +5858,23 @@ static void inject_pending_event(struct kvm_vcpu *vcpu)
5793 vcpu->arch.exception.has_error_code, 5858 vcpu->arch.exception.has_error_code,
5794 vcpu->arch.exception.error_code, 5859 vcpu->arch.exception.error_code,
5795 vcpu->arch.exception.reinject); 5860 vcpu->arch.exception.reinject);
5796 return; 5861 return 0;
5797 } 5862 }
5798 5863
5799 if (vcpu->arch.nmi_injected) { 5864 if (vcpu->arch.nmi_injected) {
5800 kvm_x86_ops->set_nmi(vcpu); 5865 kvm_x86_ops->set_nmi(vcpu);
5801 return; 5866 return 0;
5802 } 5867 }
5803 5868
5804 if (vcpu->arch.interrupt.pending) { 5869 if (vcpu->arch.interrupt.pending) {
5805 kvm_x86_ops->set_irq(vcpu); 5870 kvm_x86_ops->set_irq(vcpu);
5806 return; 5871 return 0;
5872 }
5873
5874 if (is_guest_mode(vcpu) && kvm_x86_ops->check_nested_events) {
5875 r = kvm_x86_ops->check_nested_events(vcpu, req_int_win);
5876 if (r != 0)
5877 return r;
5807 } 5878 }
5808 5879
5809 /* try to inject new event if pending */ 5880 /* try to inject new event if pending */
@@ -5820,6 +5891,7 @@ static void inject_pending_event(struct kvm_vcpu *vcpu)
5820 kvm_x86_ops->set_irq(vcpu); 5891 kvm_x86_ops->set_irq(vcpu);
5821 } 5892 }
5822 } 5893 }
5894 return 0;
5823} 5895}
5824 5896
5825static void process_nmi(struct kvm_vcpu *vcpu) 5897static void process_nmi(struct kvm_vcpu *vcpu)
@@ -5924,15 +5996,13 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
5924 goto out; 5996 goto out;
5925 } 5997 }
5926 5998
5927 inject_pending_event(vcpu); 5999 if (inject_pending_event(vcpu, req_int_win) != 0)
5928 6000 req_immediate_exit = true;
5929 /* enable NMI/IRQ window open exits if needed */ 6001 /* enable NMI/IRQ window open exits if needed */
5930 if (vcpu->arch.nmi_pending) 6002 else if (vcpu->arch.nmi_pending)
5931 req_immediate_exit = 6003 kvm_x86_ops->enable_nmi_window(vcpu);
5932 kvm_x86_ops->enable_nmi_window(vcpu) != 0;
5933 else if (kvm_cpu_has_injectable_intr(vcpu) || req_int_win) 6004 else if (kvm_cpu_has_injectable_intr(vcpu) || req_int_win)
5934 req_immediate_exit = 6005 kvm_x86_ops->enable_irq_window(vcpu);
5935 kvm_x86_ops->enable_irq_window(vcpu) != 0;
5936 6006
5937 if (kvm_lapic_enabled(vcpu)) { 6007 if (kvm_lapic_enabled(vcpu)) {
5938 /* 6008 /*
@@ -5992,12 +6062,28 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
5992 set_debugreg(vcpu->arch.eff_db[1], 1); 6062 set_debugreg(vcpu->arch.eff_db[1], 1);
5993 set_debugreg(vcpu->arch.eff_db[2], 2); 6063 set_debugreg(vcpu->arch.eff_db[2], 2);
5994 set_debugreg(vcpu->arch.eff_db[3], 3); 6064 set_debugreg(vcpu->arch.eff_db[3], 3);
6065 set_debugreg(vcpu->arch.dr6, 6);
5995 } 6066 }
5996 6067
5997 trace_kvm_entry(vcpu->vcpu_id); 6068 trace_kvm_entry(vcpu->vcpu_id);
5998 kvm_x86_ops->run(vcpu); 6069 kvm_x86_ops->run(vcpu);
5999 6070
6000 /* 6071 /*
6072 * Do this here before restoring debug registers on the host. And
6073 * since we do this before handling the vmexit, a DR access vmexit
6074 * can (a) read the correct value of the debug registers, (b) set
6075 * KVM_DEBUGREG_WONT_EXIT again.
6076 */
6077 if (unlikely(vcpu->arch.switch_db_regs & KVM_DEBUGREG_WONT_EXIT)) {
6078 int i;
6079
6080 WARN_ON(vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP);
6081 kvm_x86_ops->sync_dirty_debug_regs(vcpu);
6082 for (i = 0; i < KVM_NR_DB_REGS; i++)
6083 vcpu->arch.eff_db[i] = vcpu->arch.db[i];
6084 }
6085
6086 /*
6001 * If the guest has used debug registers, at least dr7 6087 * If the guest has used debug registers, at least dr7
6002 * will be disabled while returning to the host. 6088 * will be disabled while returning to the host.
6003 * If we don't have active breakpoints in the host, we don't 6089 * If we don't have active breakpoints in the host, we don't
@@ -6711,6 +6797,7 @@ int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
6711{ 6797{
6712 int r; 6798 int r;
6713 struct msr_data msr; 6799 struct msr_data msr;
6800 struct kvm *kvm = vcpu->kvm;
6714 6801
6715 r = vcpu_load(vcpu); 6802 r = vcpu_load(vcpu);
6716 if (r) 6803 if (r)
@@ -6721,6 +6808,9 @@ int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu)
6721 kvm_write_tsc(vcpu, &msr); 6808 kvm_write_tsc(vcpu, &msr);
6722 vcpu_put(vcpu); 6809 vcpu_put(vcpu);
6723 6810
6811 schedule_delayed_work(&kvm->arch.kvmclock_sync_work,
6812 KVMCLOCK_SYNC_PERIOD);
6813
6724 return r; 6814 return r;
6725} 6815}
6726 6816
@@ -7013,6 +7103,9 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
7013 7103
7014 pvclock_update_vm_gtod_copy(kvm); 7104 pvclock_update_vm_gtod_copy(kvm);
7015 7105
7106 INIT_DELAYED_WORK(&kvm->arch.kvmclock_update_work, kvmclock_update_fn);
7107 INIT_DELAYED_WORK(&kvm->arch.kvmclock_sync_work, kvmclock_sync_fn);
7108
7016 return 0; 7109 return 0;
7017} 7110}
7018 7111
@@ -7050,6 +7143,8 @@ static void kvm_free_vcpus(struct kvm *kvm)
7050 7143
7051void kvm_arch_sync_events(struct kvm *kvm) 7144void kvm_arch_sync_events(struct kvm *kvm)
7052{ 7145{
7146 cancel_delayed_work_sync(&kvm->arch.kvmclock_sync_work);
7147 cancel_delayed_work_sync(&kvm->arch.kvmclock_update_work);
7053 kvm_free_all_assigned_devices(kvm); 7148 kvm_free_all_assigned_devices(kvm);
7054 kvm_free_pit(kvm); 7149 kvm_free_pit(kvm);
7055} 7150}
@@ -7248,6 +7343,9 @@ void kvm_arch_flush_shadow_memslot(struct kvm *kvm,
7248 7343
7249int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu) 7344int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
7250{ 7345{
7346 if (is_guest_mode(vcpu) && kvm_x86_ops->check_nested_events)
7347 kvm_x86_ops->check_nested_events(vcpu, false);
7348
7251 return (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE && 7349 return (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE &&
7252 !vcpu->arch.apf.halted) 7350 !vcpu->arch.apf.halted)
7253 || !list_empty_careful(&vcpu->async_pf.done) 7351 || !list_empty_careful(&vcpu->async_pf.done)
diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h
index 8da5823bcde6..8c97bac9a895 100644
--- a/arch/x86/kvm/x86.h
+++ b/arch/x86/kvm/x86.h
@@ -122,9 +122,12 @@ int kvm_write_guest_virt_system(struct x86_emulate_ctxt *ctxt,
122 gva_t addr, void *val, unsigned int bytes, 122 gva_t addr, void *val, unsigned int bytes,
123 struct x86_exception *exception); 123 struct x86_exception *exception);
124 124
125#define KVM_SUPPORTED_XCR0 (XSTATE_FP | XSTATE_SSE | XSTATE_YMM) 125#define KVM_SUPPORTED_XCR0 (XSTATE_FP | XSTATE_SSE | XSTATE_YMM \
126 | XSTATE_BNDREGS | XSTATE_BNDCSR)
126extern u64 host_xcr0; 127extern u64 host_xcr0;
127 128
129extern u64 kvm_supported_xcr0(void);
130
128extern unsigned int min_timer_period_us; 131extern unsigned int min_timer_period_us;
129 132
130extern struct static_key kvm_no_apic_vcpu; 133extern struct static_key kvm_no_apic_vcpu;
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 799580cabc78..597ac155c91c 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -328,17 +328,6 @@ void unxlate_dev_mem_ptr(unsigned long phys, void *addr)
328 return; 328 return;
329} 329}
330 330
331static int __initdata early_ioremap_debug;
332
333static int __init early_ioremap_debug_setup(char *str)
334{
335 early_ioremap_debug = 1;
336
337 return 0;
338}
339early_param("early_ioremap_debug", early_ioremap_debug_setup);
340
341static __initdata int after_paging_init;
342static pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)] __page_aligned_bss; 331static pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)] __page_aligned_bss;
343 332
344static inline pmd_t * __init early_ioremap_pmd(unsigned long addr) 333static inline pmd_t * __init early_ioremap_pmd(unsigned long addr)
@@ -362,18 +351,11 @@ bool __init is_early_ioremap_ptep(pte_t *ptep)
362 return ptep >= &bm_pte[0] && ptep < &bm_pte[PAGE_SIZE/sizeof(pte_t)]; 351 return ptep >= &bm_pte[0] && ptep < &bm_pte[PAGE_SIZE/sizeof(pte_t)];
363} 352}
364 353
365static unsigned long slot_virt[FIX_BTMAPS_SLOTS] __initdata;
366
367void __init early_ioremap_init(void) 354void __init early_ioremap_init(void)
368{ 355{
369 pmd_t *pmd; 356 pmd_t *pmd;
370 int i;
371 357
372 if (early_ioremap_debug) 358 early_ioremap_setup();
373 printk(KERN_INFO "early_ioremap_init()\n");
374
375 for (i = 0; i < FIX_BTMAPS_SLOTS; i++)
376 slot_virt[i] = __fix_to_virt(FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*i);
377 359
378 pmd = early_ioremap_pmd(fix_to_virt(FIX_BTMAP_BEGIN)); 360 pmd = early_ioremap_pmd(fix_to_virt(FIX_BTMAP_BEGIN));
379 memset(bm_pte, 0, sizeof(bm_pte)); 361 memset(bm_pte, 0, sizeof(bm_pte));
@@ -402,13 +384,8 @@ void __init early_ioremap_init(void)
402 } 384 }
403} 385}
404 386
405void __init early_ioremap_reset(void) 387void __init __early_set_fixmap(enum fixed_addresses idx,
406{ 388 phys_addr_t phys, pgprot_t flags)
407 after_paging_init = 1;
408}
409
410static void __init __early_set_fixmap(enum fixed_addresses idx,
411 phys_addr_t phys, pgprot_t flags)
412{ 389{
413 unsigned long addr = __fix_to_virt(idx); 390 unsigned long addr = __fix_to_virt(idx);
414 pte_t *pte; 391 pte_t *pte;
@@ -425,198 +402,3 @@ static void __init __early_set_fixmap(enum fixed_addresses idx,
425 pte_clear(&init_mm, addr, pte); 402 pte_clear(&init_mm, addr, pte);
426 __flush_tlb_one(addr); 403 __flush_tlb_one(addr);
427} 404}
428
429static inline void __init early_set_fixmap(enum fixed_addresses idx,
430 phys_addr_t phys, pgprot_t prot)
431{
432 if (after_paging_init)
433 __set_fixmap(idx, phys, prot);
434 else
435 __early_set_fixmap(idx, phys, prot);
436}
437
438static inline void __init early_clear_fixmap(enum fixed_addresses idx)
439{
440 if (after_paging_init)
441 clear_fixmap(idx);
442 else
443 __early_set_fixmap(idx, 0, __pgprot(0));
444}
445
446static void __iomem *prev_map[FIX_BTMAPS_SLOTS] __initdata;
447static unsigned long prev_size[FIX_BTMAPS_SLOTS] __initdata;
448
449void __init fixup_early_ioremap(void)
450{
451 int i;
452
453 for (i = 0; i < FIX_BTMAPS_SLOTS; i++) {
454 if (prev_map[i]) {
455 WARN_ON(1);
456 break;
457 }
458 }
459
460 early_ioremap_init();
461}
462
463static int __init check_early_ioremap_leak(void)
464{
465 int count = 0;
466 int i;
467
468 for (i = 0; i < FIX_BTMAPS_SLOTS; i++)
469 if (prev_map[i])
470 count++;
471
472 if (!count)
473 return 0;
474 WARN(1, KERN_WARNING
475 "Debug warning: early ioremap leak of %d areas detected.\n",
476 count);
477 printk(KERN_WARNING
478 "please boot with early_ioremap_debug and report the dmesg.\n");
479
480 return 1;
481}
482late_initcall(check_early_ioremap_leak);
483
484static void __init __iomem *
485__early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot)
486{
487 unsigned long offset;
488 resource_size_t last_addr;
489 unsigned int nrpages;
490 enum fixed_addresses idx;
491 int i, slot;
492
493 WARN_ON(system_state != SYSTEM_BOOTING);
494
495 slot = -1;
496 for (i = 0; i < FIX_BTMAPS_SLOTS; i++) {
497 if (!prev_map[i]) {
498 slot = i;
499 break;
500 }
501 }
502
503 if (slot < 0) {
504 printk(KERN_INFO "%s(%08llx, %08lx) not found slot\n",
505 __func__, (u64)phys_addr, size);
506 WARN_ON(1);
507 return NULL;
508 }
509
510 if (early_ioremap_debug) {
511 printk(KERN_INFO "%s(%08llx, %08lx) [%d] => ",
512 __func__, (u64)phys_addr, size, slot);
513 dump_stack();
514 }
515
516 /* Don't allow wraparound or zero size */
517 last_addr = phys_addr + size - 1;
518 if (!size || last_addr < phys_addr) {
519 WARN_ON(1);
520 return NULL;
521 }
522
523 prev_size[slot] = size;
524 /*
525 * Mappings have to be page-aligned
526 */
527 offset = phys_addr & ~PAGE_MASK;
528 phys_addr &= PAGE_MASK;
529 size = PAGE_ALIGN(last_addr + 1) - phys_addr;
530
531 /*
532 * Mappings have to fit in the FIX_BTMAP area.
533 */
534 nrpages = size >> PAGE_SHIFT;
535 if (nrpages > NR_FIX_BTMAPS) {
536 WARN_ON(1);
537 return NULL;
538 }
539
540 /*
541 * Ok, go for it..
542 */
543 idx = FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*slot;
544 while (nrpages > 0) {
545 early_set_fixmap(idx, phys_addr, prot);
546 phys_addr += PAGE_SIZE;
547 --idx;
548 --nrpages;
549 }
550 if (early_ioremap_debug)
551 printk(KERN_CONT "%08lx + %08lx\n", offset, slot_virt[slot]);
552
553 prev_map[slot] = (void __iomem *)(offset + slot_virt[slot]);
554 return prev_map[slot];
555}
556
557/* Remap an IO device */
558void __init __iomem *
559early_ioremap(resource_size_t phys_addr, unsigned long size)
560{
561 return __early_ioremap(phys_addr, size, PAGE_KERNEL_IO);
562}
563
564/* Remap memory */
565void __init __iomem *
566early_memremap(resource_size_t phys_addr, unsigned long size)
567{
568 return __early_ioremap(phys_addr, size, PAGE_KERNEL);
569}
570
571void __init early_iounmap(void __iomem *addr, unsigned long size)
572{
573 unsigned long virt_addr;
574 unsigned long offset;
575 unsigned int nrpages;
576 enum fixed_addresses idx;
577 int i, slot;
578
579 slot = -1;
580 for (i = 0; i < FIX_BTMAPS_SLOTS; i++) {
581 if (prev_map[i] == addr) {
582 slot = i;
583 break;
584 }
585 }
586
587 if (slot < 0) {
588 printk(KERN_INFO "early_iounmap(%p, %08lx) not found slot\n",
589 addr, size);
590 WARN_ON(1);
591 return;
592 }
593
594 if (prev_size[slot] != size) {
595 printk(KERN_INFO "early_iounmap(%p, %08lx) [%d] size not consistent %08lx\n",
596 addr, size, slot, prev_size[slot]);
597 WARN_ON(1);
598 return;
599 }
600
601 if (early_ioremap_debug) {
602 printk(KERN_INFO "early_iounmap(%p, %08lx) [%d]\n", addr,
603 size, slot);
604 dump_stack();
605 }
606
607 virt_addr = (unsigned long)addr;
608 if (virt_addr < fix_to_virt(FIX_BTMAP_BEGIN)) {
609 WARN_ON(1);
610 return;
611 }
612 offset = virt_addr & ~PAGE_MASK;
613 nrpages = PAGE_ALIGN(offset + size) >> PAGE_SHIFT;
614
615 idx = FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*slot;
616 while (nrpages > 0) {
617 early_clear_fixmap(idx);
618 --idx;
619 --nrpages;
620 }
621 prev_map[slot] = NULL;
622}
diff --git a/arch/x86/mm/kmemcheck/kmemcheck.c b/arch/x86/mm/kmemcheck/kmemcheck.c
index d87dd6d042d6..dd89a13f1051 100644
--- a/arch/x86/mm/kmemcheck/kmemcheck.c
+++ b/arch/x86/mm/kmemcheck/kmemcheck.c
@@ -78,10 +78,16 @@ early_initcall(kmemcheck_init);
78 */ 78 */
79static int __init param_kmemcheck(char *str) 79static int __init param_kmemcheck(char *str)
80{ 80{
81 int val;
82 int ret;
83
81 if (!str) 84 if (!str)
82 return -EINVAL; 85 return -EINVAL;
83 86
84 sscanf(str, "%d", &kmemcheck_enabled); 87 ret = kstrtoint(str, 0, &val);
88 if (ret)
89 return ret;
90 kmemcheck_enabled = val;
85 return 0; 91 return 0;
86} 92}
87 93
diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
index 27aa0455fab3..1d045f9c390f 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
@@ -687,10 +687,6 @@ static int __init dummy_numa_init(void)
687void __init x86_numa_init(void) 687void __init x86_numa_init(void)
688{ 688{
689 if (!numa_off) { 689 if (!numa_off) {
690#ifdef CONFIG_X86_NUMAQ
691 if (!numa_init(numaq_numa_init))
692 return;
693#endif
694#ifdef CONFIG_ACPI_NUMA 690#ifdef CONFIG_ACPI_NUMA
695 if (!numa_init(x86_acpi_numa_init)) 691 if (!numa_init(x86_acpi_numa_init))
696 return; 692 return;
diff --git a/arch/x86/mm/pgtable_32.c b/arch/x86/mm/pgtable_32.c
index a69bcb8c7621..4dd8cf652579 100644
--- a/arch/x86/mm/pgtable_32.c
+++ b/arch/x86/mm/pgtable_32.c
@@ -127,7 +127,7 @@ static int __init parse_reservetop(char *arg)
127 127
128 address = memparse(arg, &arg); 128 address = memparse(arg, &arg);
129 reserve_top_address(address); 129 reserve_top_address(address);
130 fixup_early_ioremap(); 130 early_ioremap_init();
131 return 0; 131 return 0;
132} 132}
133early_param("reservetop", parse_reservetop); 133early_param("reservetop", parse_reservetop);
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 4ed75dd81d05..dc017735bb91 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -553,13 +553,13 @@ void bpf_jit_compile(struct sk_filter *fp)
553 } 553 }
554 break; 554 break;
555 case BPF_S_ANC_RXHASH: 555 case BPF_S_ANC_RXHASH:
556 BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, rxhash) != 4); 556 BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, hash) != 4);
557 if (is_imm8(offsetof(struct sk_buff, rxhash))) { 557 if (is_imm8(offsetof(struct sk_buff, hash))) {
558 /* mov off8(%rdi),%eax */ 558 /* mov off8(%rdi),%eax */
559 EMIT3(0x8b, 0x47, offsetof(struct sk_buff, rxhash)); 559 EMIT3(0x8b, 0x47, offsetof(struct sk_buff, hash));
560 } else { 560 } else {
561 EMIT2(0x8b, 0x87); 561 EMIT2(0x8b, 0x87);
562 EMIT(offsetof(struct sk_buff, rxhash), 4); 562 EMIT(offsetof(struct sk_buff, hash), 4);
563 } 563 }
564 break; 564 break;
565 case BPF_S_ANC_QUEUE: 565 case BPF_S_ANC_QUEUE:
@@ -772,6 +772,7 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i];
772 bpf_flush_icache(header, image + proglen); 772 bpf_flush_icache(header, image + proglen);
773 set_memory_ro((unsigned long)header, header->pages); 773 set_memory_ro((unsigned long)header, header->pages);
774 fp->bpf_func = (void *)image; 774 fp->bpf_func = (void *)image;
775 fp->jited = 1;
775 } 776 }
776out: 777out:
777 kfree(addrs); 778 kfree(addrs);
@@ -791,7 +792,7 @@ static void bpf_jit_free_deferred(struct work_struct *work)
791 792
792void bpf_jit_free(struct sk_filter *fp) 793void bpf_jit_free(struct sk_filter *fp)
793{ 794{
794 if (fp->bpf_func != sk_run_filter) { 795 if (fp->jited) {
795 INIT_WORK(&fp->work, bpf_jit_free_deferred); 796 INIT_WORK(&fp->work, bpf_jit_free_deferred);
796 schedule_work(&fp->work); 797 schedule_work(&fp->work);
797 } else { 798 } else {
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index 6890d8498e0b..379e8bd0deea 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -494,14 +494,19 @@ static int nmi_setup(void)
494 if (err) 494 if (err)
495 goto fail; 495 goto fail;
496 496
497 cpu_notifier_register_begin();
498
499 /* Use get/put_online_cpus() to protect 'nmi_enabled' */
497 get_online_cpus(); 500 get_online_cpus();
498 register_cpu_notifier(&oprofile_cpu_nb);
499 nmi_enabled = 1; 501 nmi_enabled = 1;
500 /* make nmi_enabled visible to the nmi handler: */ 502 /* make nmi_enabled visible to the nmi handler: */
501 smp_mb(); 503 smp_mb();
502 on_each_cpu(nmi_cpu_setup, NULL, 1); 504 on_each_cpu(nmi_cpu_setup, NULL, 1);
505 __register_cpu_notifier(&oprofile_cpu_nb);
503 put_online_cpus(); 506 put_online_cpus();
504 507
508 cpu_notifier_register_done();
509
505 return 0; 510 return 0;
506fail: 511fail:
507 free_msrs(); 512 free_msrs();
@@ -512,12 +517,18 @@ static void nmi_shutdown(void)
512{ 517{
513 struct op_msrs *msrs; 518 struct op_msrs *msrs;
514 519
520 cpu_notifier_register_begin();
521
522 /* Use get/put_online_cpus() to protect 'nmi_enabled' & 'ctr_running' */
515 get_online_cpus(); 523 get_online_cpus();
516 unregister_cpu_notifier(&oprofile_cpu_nb);
517 on_each_cpu(nmi_cpu_shutdown, NULL, 1); 524 on_each_cpu(nmi_cpu_shutdown, NULL, 1);
518 nmi_enabled = 0; 525 nmi_enabled = 0;
519 ctr_running = 0; 526 ctr_running = 0;
527 __unregister_cpu_notifier(&oprofile_cpu_nb);
520 put_online_cpus(); 528 put_online_cpus();
529
530 cpu_notifier_register_done();
531
521 /* make variables visible to the nmi handler: */ 532 /* make variables visible to the nmi handler: */
522 smp_mb(); 533 smp_mb();
523 unregister_nmi_handler(NMI_LOCAL, "oprofile"); 534 unregister_nmi_handler(NMI_LOCAL, "oprofile");
diff --git a/arch/x86/pci/Makefile b/arch/x86/pci/Makefile
index e063eed0f912..5c6fc3577a49 100644
--- a/arch/x86/pci/Makefile
+++ b/arch/x86/pci/Makefile
@@ -13,9 +13,6 @@ obj-y += legacy.o irq.o
13 13
14obj-$(CONFIG_STA2X11) += sta2x11-fixup.o 14obj-$(CONFIG_STA2X11) += sta2x11-fixup.o
15 15
16obj-$(CONFIG_X86_VISWS) += visws.o
17
18obj-$(CONFIG_X86_NUMAQ) += numaq_32.o
19obj-$(CONFIG_X86_NUMACHIP) += numachip.o 16obj-$(CONFIG_X86_NUMACHIP) += numachip.o
20 17
21obj-$(CONFIG_X86_INTEL_MID) += intel_mid_pci.o 18obj-$(CONFIG_X86_INTEL_MID) += intel_mid_pci.o
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 4f25ec077552..01edac6c5e18 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -218,9 +218,8 @@ static void teardown_mcfg_map(struct pci_root_info *info)
218} 218}
219#endif 219#endif
220 220
221static acpi_status 221static acpi_status resource_to_addr(struct acpi_resource *resource,
222resource_to_addr(struct acpi_resource *resource, 222 struct acpi_resource_address64 *addr)
223 struct acpi_resource_address64 *addr)
224{ 223{
225 acpi_status status; 224 acpi_status status;
226 struct acpi_resource_memory24 *memory24; 225 struct acpi_resource_memory24 *memory24;
@@ -265,8 +264,7 @@ resource_to_addr(struct acpi_resource *resource,
265 return AE_ERROR; 264 return AE_ERROR;
266} 265}
267 266
268static acpi_status 267static acpi_status count_resource(struct acpi_resource *acpi_res, void *data)
269count_resource(struct acpi_resource *acpi_res, void *data)
270{ 268{
271 struct pci_root_info *info = data; 269 struct pci_root_info *info = data;
272 struct acpi_resource_address64 addr; 270 struct acpi_resource_address64 addr;
@@ -278,8 +276,7 @@ count_resource(struct acpi_resource *acpi_res, void *data)
278 return AE_OK; 276 return AE_OK;
279} 277}
280 278
281static acpi_status 279static acpi_status setup_resource(struct acpi_resource *acpi_res, void *data)
282setup_resource(struct acpi_resource *acpi_res, void *data)
283{ 280{
284 struct pci_root_info *info = data; 281 struct pci_root_info *info = data;
285 struct resource *res; 282 struct resource *res;
@@ -435,9 +432,9 @@ static void release_pci_root_info(struct pci_host_bridge *bridge)
435 __release_pci_root_info(info); 432 __release_pci_root_info(info);
436} 433}
437 434
438static void 435static void probe_pci_root_info(struct pci_root_info *info,
439probe_pci_root_info(struct pci_root_info *info, struct acpi_device *device, 436 struct acpi_device *device,
440 int busnum, int domain) 437 int busnum, int domain)
441{ 438{
442 size_t size; 439 size_t size;
443 440
@@ -473,16 +470,13 @@ probe_pci_root_info(struct pci_root_info *info, struct acpi_device *device,
473struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) 470struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
474{ 471{
475 struct acpi_device *device = root->device; 472 struct acpi_device *device = root->device;
476 struct pci_root_info *info = NULL; 473 struct pci_root_info *info;
477 int domain = root->segment; 474 int domain = root->segment;
478 int busnum = root->secondary.start; 475 int busnum = root->secondary.start;
479 LIST_HEAD(resources); 476 LIST_HEAD(resources);
480 struct pci_bus *bus = NULL; 477 struct pci_bus *bus;
481 struct pci_sysdata *sd; 478 struct pci_sysdata *sd;
482 int node; 479 int node;
483#ifdef CONFIG_ACPI_NUMA
484 int pxm;
485#endif
486 480
487 if (pci_ignore_seg) 481 if (pci_ignore_seg)
488 domain = 0; 482 domain = 0;
@@ -494,19 +488,12 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
494 return NULL; 488 return NULL;
495 } 489 }
496 490
497 node = -1; 491 node = acpi_get_node(device->handle);
498#ifdef CONFIG_ACPI_NUMA 492 if (node == NUMA_NO_NODE)
499 pxm = acpi_get_pxm(device->handle); 493 node = x86_pci_root_bus_node(busnum);
500 if (pxm >= 0)
501 node = pxm_to_node(pxm);
502 if (node != -1)
503 set_mp_bus_to_node(busnum, node);
504 else
505#endif
506 node = get_mp_bus_to_node(busnum);
507 494
508 if (node != -1 && !node_online(node)) 495 if (node != NUMA_NO_NODE && !node_online(node))
509 node = -1; 496 node = NUMA_NO_NODE;
510 497
511 info = kzalloc(sizeof(*info), GFP_KERNEL); 498 info = kzalloc(sizeof(*info), GFP_KERNEL);
512 if (!info) { 499 if (!info) {
@@ -519,15 +506,12 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
519 sd->domain = domain; 506 sd->domain = domain;
520 sd->node = node; 507 sd->node = node;
521 sd->companion = device; 508 sd->companion = device;
522 /* 509
523 * Maybe the desired pci bus has been already scanned. In such case
524 * it is unnecessary to scan the pci bus with the given domain,busnum.
525 */
526 bus = pci_find_bus(domain, busnum); 510 bus = pci_find_bus(domain, busnum);
527 if (bus) { 511 if (bus) {
528 /* 512 /*
529 * If the desired bus exits, the content of bus->sysdata will 513 * If the desired bus has been scanned already, replace
530 * be replaced by sd. 514 * its bus->sysdata.
531 */ 515 */
532 memcpy(bus->sysdata, sd, sizeof(*sd)); 516 memcpy(bus->sysdata, sd, sizeof(*sd));
533 kfree(info); 517 kfree(info);
@@ -572,15 +556,8 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
572 pcie_bus_configure_settings(child); 556 pcie_bus_configure_settings(child);
573 } 557 }
574 558
575 if (bus && node != -1) { 559 if (bus && node != NUMA_NO_NODE)
576#ifdef CONFIG_ACPI_NUMA
577 if (pxm >= 0)
578 dev_printk(KERN_DEBUG, &bus->dev,
579 "on NUMA node %d (pxm %d)\n", node, pxm);
580#else
581 dev_printk(KERN_DEBUG, &bus->dev, "on NUMA node %d\n", node); 560 dev_printk(KERN_DEBUG, &bus->dev, "on NUMA node %d\n", node);
582#endif
583 }
584 561
585 return bus; 562 return bus;
586} 563}
diff --git a/arch/x86/pci/amd_bus.c b/arch/x86/pci/amd_bus.c
index a48be98e9ded..e88f4c53d7f6 100644
--- a/arch/x86/pci/amd_bus.c
+++ b/arch/x86/pci/amd_bus.c
@@ -44,15 +44,6 @@ static struct pci_root_info __init *find_pci_root_info(int node, int link)
44 return NULL; 44 return NULL;
45} 45}
46 46
47static void __init set_mp_bus_range_to_node(int min_bus, int max_bus, int node)
48{
49#ifdef CONFIG_NUMA
50 int j;
51
52 for (j = min_bus; j <= max_bus; j++)
53 set_mp_bus_to_node(j, node);
54#endif
55}
56/** 47/**
57 * early_fill_mp_bus_to_node() 48 * early_fill_mp_bus_to_node()
58 * called before pcibios_scan_root and pci_scan_bus 49 * called before pcibios_scan_root and pci_scan_bus
@@ -117,7 +108,6 @@ static int __init early_fill_mp_bus_info(void)
117 min_bus = (reg >> 16) & 0xff; 108 min_bus = (reg >> 16) & 0xff;
118 max_bus = (reg >> 24) & 0xff; 109 max_bus = (reg >> 24) & 0xff;
119 node = (reg >> 4) & 0x07; 110 node = (reg >> 4) & 0x07;
120 set_mp_bus_range_to_node(min_bus, max_bus, node);
121 link = (reg >> 8) & 0x03; 111 link = (reg >> 8) & 0x03;
122 112
123 info = alloc_pci_root_info(min_bus, max_bus, node, link); 113 info = alloc_pci_root_info(min_bus, max_bus, node, link);
@@ -380,10 +370,13 @@ static int __init pci_io_ecs_init(void)
380 if (early_pci_allowed()) 370 if (early_pci_allowed())
381 pci_enable_pci_io_ecs(); 371 pci_enable_pci_io_ecs();
382 372
383 register_cpu_notifier(&amd_cpu_notifier); 373 cpu_notifier_register_begin();
384 for_each_online_cpu(cpu) 374 for_each_online_cpu(cpu)
385 amd_cpu_notify(&amd_cpu_notifier, (unsigned long)CPU_ONLINE, 375 amd_cpu_notify(&amd_cpu_notifier, (unsigned long)CPU_ONLINE,
386 (void *)(long)cpu); 376 (void *)(long)cpu);
377 __register_cpu_notifier(&amd_cpu_notifier);
378 cpu_notifier_register_done();
379
387 pci_probe |= PCI_HAS_IO_ECS; 380 pci_probe |= PCI_HAS_IO_ECS;
388 381
389 return 0; 382 return 0;
diff --git a/arch/x86/pci/bus_numa.c b/arch/x86/pci/bus_numa.c
index c2735feb2508..f3a2cfc14125 100644
--- a/arch/x86/pci/bus_numa.c
+++ b/arch/x86/pci/bus_numa.c
@@ -10,9 +10,6 @@ static struct pci_root_info *x86_find_pci_root_info(int bus)
10{ 10{
11 struct pci_root_info *info; 11 struct pci_root_info *info;
12 12
13 if (list_empty(&pci_root_infos))
14 return NULL;
15
16 list_for_each_entry(info, &pci_root_infos, list) 13 list_for_each_entry(info, &pci_root_infos, list)
17 if (info->busn.start == bus) 14 if (info->busn.start == bus)
18 return info; 15 return info;
@@ -20,6 +17,16 @@ static struct pci_root_info *x86_find_pci_root_info(int bus)
20 return NULL; 17 return NULL;
21} 18}
22 19
20int x86_pci_root_bus_node(int bus)
21{
22 struct pci_root_info *info = x86_find_pci_root_info(bus);
23
24 if (!info)
25 return NUMA_NO_NODE;
26
27 return info->node;
28}
29
23void x86_pci_root_bus_resources(int bus, struct list_head *resources) 30void x86_pci_root_bus_resources(int bus, struct list_head *resources)
24{ 31{
25 struct pci_root_info *info = x86_find_pci_root_info(bus); 32 struct pci_root_info *info = x86_find_pci_root_info(bus);
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 981c2dbd72cc..059a76c29739 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -456,19 +456,25 @@ void __init dmi_check_pciprobe(void)
456 dmi_check_system(pciprobe_dmi_table); 456 dmi_check_system(pciprobe_dmi_table);
457} 457}
458 458
459struct pci_bus *pcibios_scan_root(int busnum) 459void pcibios_scan_root(int busnum)
460{ 460{
461 struct pci_bus *bus = NULL; 461 struct pci_bus *bus;
462 struct pci_sysdata *sd;
463 LIST_HEAD(resources);
462 464
463 while ((bus = pci_find_next_bus(bus)) != NULL) { 465 sd = kzalloc(sizeof(*sd), GFP_KERNEL);
464 if (bus->number == busnum) { 466 if (!sd) {
465 /* Already scanned */ 467 printk(KERN_ERR "PCI: OOM, skipping PCI bus %02x\n", busnum);
466 return bus; 468 return;
467 } 469 }
470 sd->node = x86_pci_root_bus_node(busnum);
471 x86_pci_root_bus_resources(busnum, &resources);
472 printk(KERN_DEBUG "PCI: Probing PCI hardware (bus %02x)\n", busnum);
473 bus = pci_scan_root_bus(NULL, busnum, &pci_root_ops, sd, &resources);
474 if (!bus) {
475 pci_free_resource_list(&resources);
476 kfree(sd);
468 } 477 }
469
470 return pci_scan_bus_on_node(busnum, &pci_root_ops,
471 get_mp_bus_to_node(busnum));
472} 478}
473 479
474void __init pcibios_set_cache_line_size(void) 480void __init pcibios_set_cache_line_size(void)
@@ -561,7 +567,6 @@ char * __init pcibios_setup(char *str)
561 pci_probe |= PCI_PROBE_NOEARLY; 567 pci_probe |= PCI_PROBE_NOEARLY;
562 return NULL; 568 return NULL;
563 } 569 }
564#ifndef CONFIG_X86_VISWS
565 else if (!strcmp(str, "usepirqmask")) { 570 else if (!strcmp(str, "usepirqmask")) {
566 pci_probe |= PCI_USE_PIRQ_MASK; 571 pci_probe |= PCI_USE_PIRQ_MASK;
567 return NULL; 572 return NULL;
@@ -571,9 +576,7 @@ char * __init pcibios_setup(char *str)
571 } else if (!strncmp(str, "lastbus=", 8)) { 576 } else if (!strncmp(str, "lastbus=", 8)) {
572 pcibios_last_bus = simple_strtol(str+8, NULL, 0); 577 pcibios_last_bus = simple_strtol(str+8, NULL, 0);
573 return NULL; 578 return NULL;
574 } 579 } else if (!strcmp(str, "rom")) {
575#endif
576 else if (!strcmp(str, "rom")) {
577 pci_probe |= PCI_ASSIGN_ROMS; 580 pci_probe |= PCI_ASSIGN_ROMS;
578 return NULL; 581 return NULL;
579 } else if (!strcmp(str, "norom")) { 582 } else if (!strcmp(str, "norom")) {
@@ -677,105 +680,3 @@ int pci_ext_cfg_avail(void)
677 else 680 else
678 return 0; 681 return 0;
679} 682}
680
681struct pci_bus *pci_scan_bus_on_node(int busno, struct pci_ops *ops, int node)
682{
683 LIST_HEAD(resources);
684 struct pci_bus *bus = NULL;
685 struct pci_sysdata *sd;
686
687 /*
688 * Allocate per-root-bus (not per bus) arch-specific data.
689 * TODO: leak; this memory is never freed.
690 * It's arguable whether it's worth the trouble to care.
691 */
692 sd = kzalloc(sizeof(*sd), GFP_KERNEL);
693 if (!sd) {
694 printk(KERN_ERR "PCI: OOM, skipping PCI bus %02x\n", busno);
695 return NULL;
696 }
697 sd->node = node;
698 x86_pci_root_bus_resources(busno, &resources);
699 printk(KERN_DEBUG "PCI: Probing PCI hardware (bus %02x)\n", busno);
700 bus = pci_scan_root_bus(NULL, busno, ops, sd, &resources);
701 if (!bus) {
702 pci_free_resource_list(&resources);
703 kfree(sd);
704 }
705
706 return bus;
707}
708
709struct pci_bus *pci_scan_bus_with_sysdata(int busno)
710{
711 return pci_scan_bus_on_node(busno, &pci_root_ops, -1);
712}
713
714/*
715 * NUMA info for PCI busses
716 *
717 * Early arch code is responsible for filling in reasonable values here.
718 * A node id of "-1" means "use current node". In other words, if a bus
719 * has a -1 node id, it's not tightly coupled to any particular chunk
720 * of memory (as is the case on some Nehalem systems).
721 */
722#ifdef CONFIG_NUMA
723
724#define BUS_NR 256
725
726#ifdef CONFIG_X86_64
727
728static int mp_bus_to_node[BUS_NR] = {
729 [0 ... BUS_NR - 1] = -1
730};
731
732void set_mp_bus_to_node(int busnum, int node)
733{
734 if (busnum >= 0 && busnum < BUS_NR)
735 mp_bus_to_node[busnum] = node;
736}
737
738int get_mp_bus_to_node(int busnum)
739{
740 int node = -1;
741
742 if (busnum < 0 || busnum > (BUS_NR - 1))
743 return node;
744
745 node = mp_bus_to_node[busnum];
746
747 /*
748 * let numa_node_id to decide it later in dma_alloc_pages
749 * if there is no ram on that node
750 */
751 if (node != -1 && !node_online(node))
752 node = -1;
753
754 return node;
755}
756
757#else /* CONFIG_X86_32 */
758
759static int mp_bus_to_node[BUS_NR] = {
760 [0 ... BUS_NR - 1] = -1
761};
762
763void set_mp_bus_to_node(int busnum, int node)
764{
765 if (busnum >= 0 && busnum < BUS_NR)
766 mp_bus_to_node[busnum] = (unsigned char) node;
767}
768
769int get_mp_bus_to_node(int busnum)
770{
771 int node;
772
773 if (busnum < 0 || busnum > (BUS_NR - 1))
774 return 0;
775 node = mp_bus_to_node[busnum];
776 return node;
777}
778
779#endif /* CONFIG_X86_32 */
780
781#endif /* CONFIG_NUMA */
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index bca9e85daaa5..94ae9ae9574f 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -25,9 +25,9 @@ static void pci_fixup_i450nx(struct pci_dev *d)
25 dev_dbg(&d->dev, "i450NX PXB %d: %02x/%02x/%02x\n", pxb, busno, 25 dev_dbg(&d->dev, "i450NX PXB %d: %02x/%02x/%02x\n", pxb, busno,
26 suba, subb); 26 suba, subb);
27 if (busno) 27 if (busno)
28 pci_scan_bus_with_sysdata(busno); /* Bus A */ 28 pcibios_scan_root(busno); /* Bus A */
29 if (suba < subb) 29 if (suba < subb)
30 pci_scan_bus_with_sysdata(suba+1); /* Bus B */ 30 pcibios_scan_root(suba+1); /* Bus B */
31 } 31 }
32 pcibios_last_bus = -1; 32 pcibios_last_bus = -1;
33} 33}
@@ -42,7 +42,7 @@ static void pci_fixup_i450gx(struct pci_dev *d)
42 u8 busno; 42 u8 busno;
43 pci_read_config_byte(d, 0x4a, &busno); 43 pci_read_config_byte(d, 0x4a, &busno);
44 dev_info(&d->dev, "i440KX/GX host bridge; secondary bus %02x\n", busno); 44 dev_info(&d->dev, "i440KX/GX host bridge; secondary bus %02x\n", busno);
45 pci_scan_bus_with_sysdata(busno); 45 pcibios_scan_root(busno);
46 pcibios_last_bus = -1; 46 pcibios_last_bus = -1;
47} 47}
48DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454GX, pci_fixup_i450gx); 48DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454GX, pci_fixup_i450gx);
@@ -313,9 +313,10 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PC1, pcie_r
313 * IORESOURCE_ROM_SHADOW is used to associate the boot video 313 * IORESOURCE_ROM_SHADOW is used to associate the boot video
314 * card with this copy. On laptops this copy has to be used since 314 * card with this copy. On laptops this copy has to be used since
315 * the main ROM may be compressed or combined with another image. 315 * the main ROM may be compressed or combined with another image.
316 * See pci_map_rom() for use of this flag. IORESOURCE_ROM_SHADOW 316 * See pci_map_rom() for use of this flag. Before marking the device
317 * is marked here since the boot video device will be the only enabled 317 * with IORESOURCE_ROM_SHADOW check if a vga_default_device is already set
318 * video device at this point. 318 * by either arch cde or vga-arbitration, if so only apply the fixup to this
319 * already determined primary video card.
319 */ 320 */
320 321
321static void pci_fixup_video(struct pci_dev *pdev) 322static void pci_fixup_video(struct pci_dev *pdev)
@@ -346,12 +347,13 @@ static void pci_fixup_video(struct pci_dev *pdev)
346 } 347 }
347 bus = bus->parent; 348 bus = bus->parent;
348 } 349 }
349 pci_read_config_word(pdev, PCI_COMMAND, &config); 350 if (!vga_default_device() || pdev == vga_default_device()) {
350 if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { 351 pci_read_config_word(pdev, PCI_COMMAND, &config);
351 pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; 352 if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
352 dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n"); 353 pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
353 if (!vga_default_device()) 354 dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n");
354 vga_set_default_device(pdev); 355 vga_set_default_device(pdev);
356 }
355 } 357 }
356} 358}
357DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID, 359DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID,
diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
index 372e9b8989b3..84112f55dd7a 100644
--- a/arch/x86/pci/irq.c
+++ b/arch/x86/pci/irq.c
@@ -136,13 +136,9 @@ static void __init pirq_peer_trick(void)
136 busmap[e->bus] = 1; 136 busmap[e->bus] = 1;
137 } 137 }
138 for (i = 1; i < 256; i++) { 138 for (i = 1; i < 256; i++) {
139 int node;
140 if (!busmap[i] || pci_find_bus(0, i)) 139 if (!busmap[i] || pci_find_bus(0, i))
141 continue; 140 continue;
142 node = get_mp_bus_to_node(i); 141 pcibios_scan_root(i);
143 if (pci_scan_bus_on_node(i, &pci_root_ops, node))
144 printk(KERN_INFO "PCI: Discovered primary peer "
145 "bus %02x [IRQ]\n", i);
146 } 142 }
147 pcibios_last_bus = -1; 143 pcibios_last_bus = -1;
148} 144}
diff --git a/arch/x86/pci/legacy.c b/arch/x86/pci/legacy.c
index 4db96fb1c232..5b662c0faf8c 100644
--- a/arch/x86/pci/legacy.c
+++ b/arch/x86/pci/legacy.c
@@ -37,19 +37,17 @@ int __init pci_legacy_init(void)
37void pcibios_scan_specific_bus(int busn) 37void pcibios_scan_specific_bus(int busn)
38{ 38{
39 int devfn; 39 int devfn;
40 long node;
41 u32 l; 40 u32 l;
42 41
43 if (pci_find_bus(0, busn)) 42 if (pci_find_bus(0, busn))
44 return; 43 return;
45 44
46 node = get_mp_bus_to_node(busn);
47 for (devfn = 0; devfn < 256; devfn += 8) { 45 for (devfn = 0; devfn < 256; devfn += 8) {
48 if (!raw_pci_read(0, busn, devfn, PCI_VENDOR_ID, 2, &l) && 46 if (!raw_pci_read(0, busn, devfn, PCI_VENDOR_ID, 2, &l) &&
49 l != 0x0000 && l != 0xffff) { 47 l != 0x0000 && l != 0xffff) {
50 DBG("Found device at %02x:%02x [%04x]\n", busn, devfn, l); 48 DBG("Found device at %02x:%02x [%04x]\n", busn, devfn, l);
51 printk(KERN_INFO "PCI: Discovered peer bus %02x\n", busn); 49 printk(KERN_INFO "PCI: Discovered peer bus %02x\n", busn);
52 pci_scan_bus_on_node(busn, &pci_root_ops, node); 50 pcibios_scan_root(busn);
53 return; 51 return;
54 } 52 }
55 } 53 }
diff --git a/arch/x86/pci/numaq_32.c b/arch/x86/pci/numaq_32.c
deleted file mode 100644
index 72c229f9ebcf..000000000000
--- a/arch/x86/pci/numaq_32.c
+++ /dev/null
@@ -1,165 +0,0 @@
1/*
2 * numaq_32.c - Low-level PCI access for NUMA-Q machines
3 */
4
5#include <linux/pci.h>
6#include <linux/init.h>
7#include <linux/nodemask.h>
8#include <asm/apic.h>
9#include <asm/mpspec.h>
10#include <asm/pci_x86.h>
11#include <asm/numaq.h>
12
13#define BUS2QUAD(global) (mp_bus_id_to_node[global])
14
15#define BUS2LOCAL(global) (mp_bus_id_to_local[global])
16
17#define QUADLOCAL2BUS(quad,local) (quad_local_to_mp_bus_id[quad][local])
18
19#define PCI_CONF1_MQ_ADDRESS(bus, devfn, reg) \
20 (0x80000000 | (BUS2LOCAL(bus) << 16) | (devfn << 8) | (reg & ~3))
21
22static void write_cf8(unsigned bus, unsigned devfn, unsigned reg)
23{
24 unsigned val = PCI_CONF1_MQ_ADDRESS(bus, devfn, reg);
25 if (xquad_portio)
26 writel(val, XQUAD_PORT_ADDR(0xcf8, BUS2QUAD(bus)));
27 else
28 outl(val, 0xCF8);
29}
30
31static int pci_conf1_mq_read(unsigned int seg, unsigned int bus,
32 unsigned int devfn, int reg, int len, u32 *value)
33{
34 unsigned long flags;
35 void *adr __iomem = XQUAD_PORT_ADDR(0xcfc, BUS2QUAD(bus));
36
37 WARN_ON(seg);
38 if (!value || (bus >= MAX_MP_BUSSES) || (devfn > 255) || (reg > 255))
39 return -EINVAL;
40
41 raw_spin_lock_irqsave(&pci_config_lock, flags);
42
43 write_cf8(bus, devfn, reg);
44
45 switch (len) {
46 case 1:
47 if (xquad_portio)
48 *value = readb(adr + (reg & 3));
49 else
50 *value = inb(0xCFC + (reg & 3));
51 break;
52 case 2:
53 if (xquad_portio)
54 *value = readw(adr + (reg & 2));
55 else
56 *value = inw(0xCFC + (reg & 2));
57 break;
58 case 4:
59 if (xquad_portio)
60 *value = readl(adr);
61 else
62 *value = inl(0xCFC);
63 break;
64 }
65
66 raw_spin_unlock_irqrestore(&pci_config_lock, flags);
67
68 return 0;
69}
70
71static int pci_conf1_mq_write(unsigned int seg, unsigned int bus,
72 unsigned int devfn, int reg, int len, u32 value)
73{
74 unsigned long flags;
75 void *adr __iomem = XQUAD_PORT_ADDR(0xcfc, BUS2QUAD(bus));
76
77 WARN_ON(seg);
78 if ((bus >= MAX_MP_BUSSES) || (devfn > 255) || (reg > 255))
79 return -EINVAL;
80
81 raw_spin_lock_irqsave(&pci_config_lock, flags);
82
83 write_cf8(bus, devfn, reg);
84
85 switch (len) {
86 case 1:
87 if (xquad_portio)
88 writeb(value, adr + (reg & 3));
89 else
90 outb((u8)value, 0xCFC + (reg & 3));
91 break;
92 case 2:
93 if (xquad_portio)
94 writew(value, adr + (reg & 2));
95 else
96 outw((u16)value, 0xCFC + (reg & 2));
97 break;
98 case 4:
99 if (xquad_portio)
100 writel(value, adr + reg);
101 else
102 outl((u32)value, 0xCFC);
103 break;
104 }
105
106 raw_spin_unlock_irqrestore(&pci_config_lock, flags);
107
108 return 0;
109}
110
111#undef PCI_CONF1_MQ_ADDRESS
112
113static const struct pci_raw_ops pci_direct_conf1_mq = {
114 .read = pci_conf1_mq_read,
115 .write = pci_conf1_mq_write
116};
117
118
119static void pci_fixup_i450nx(struct pci_dev *d)
120{
121 /*
122 * i450NX -- Find and scan all secondary buses on all PXB's.
123 */
124 int pxb, reg;
125 u8 busno, suba, subb;
126 int quad = BUS2QUAD(d->bus->number);
127
128 dev_info(&d->dev, "searching for i450NX host bridges\n");
129 reg = 0xd0;
130 for(pxb=0; pxb<2; pxb++) {
131 pci_read_config_byte(d, reg++, &busno);
132 pci_read_config_byte(d, reg++, &suba);
133 pci_read_config_byte(d, reg++, &subb);
134 dev_dbg(&d->dev, "i450NX PXB %d: %02x/%02x/%02x\n",
135 pxb, busno, suba, subb);
136 if (busno) {
137 /* Bus A */
138 pci_scan_bus_with_sysdata(QUADLOCAL2BUS(quad, busno));
139 }
140 if (suba < subb) {
141 /* Bus B */
142 pci_scan_bus_with_sysdata(QUADLOCAL2BUS(quad, suba+1));
143 }
144 }
145 pcibios_last_bus = -1;
146}
147DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82451NX, pci_fixup_i450nx);
148
149int __init pci_numaq_init(void)
150{
151 int quad;
152
153 raw_pci_ops = &pci_direct_conf1_mq;
154
155 pcibios_scan_root(0);
156 if (num_online_nodes() > 1)
157 for_each_online_node(quad) {
158 if (quad == 0)
159 continue;
160 printk("Scanning PCI bus %d for quad %d\n",
161 QUADLOCAL2BUS(quad,0), quad);
162 pci_scan_bus_with_sysdata(QUADLOCAL2BUS(quad, 0));
163 }
164 return 0;
165}
diff --git a/arch/x86/pci/visws.c b/arch/x86/pci/visws.c
deleted file mode 100644
index 3e6d2a6db866..000000000000
--- a/arch/x86/pci/visws.c
+++ /dev/null
@@ -1,87 +0,0 @@
1/*
2 * Low-Level PCI Support for SGI Visual Workstation
3 *
4 * (c) 1999--2000 Martin Mares <mj@ucw.cz>
5 */
6
7#include <linux/kernel.h>
8#include <linux/pci.h>
9#include <linux/init.h>
10
11#include <asm/setup.h>
12#include <asm/pci_x86.h>
13#include <asm/visws/cobalt.h>
14#include <asm/visws/lithium.h>
15
16static int pci_visws_enable_irq(struct pci_dev *dev) { return 0; }
17static void pci_visws_disable_irq(struct pci_dev *dev) { }
18
19/* int (*pcibios_enable_irq)(struct pci_dev *dev) = &pci_visws_enable_irq; */
20/* void (*pcibios_disable_irq)(struct pci_dev *dev) = &pci_visws_disable_irq; */
21
22/* void __init pcibios_penalize_isa_irq(int irq, int active) {} */
23
24
25unsigned int pci_bus0, pci_bus1;
26
27static int __init visws_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
28{
29 int irq, bus = dev->bus->number;
30
31 pin--;
32
33 /* Nothing useful at PIIX4 pin 1 */
34 if (bus == pci_bus0 && slot == 4 && pin == 0)
35 return -1;
36
37 /* PIIX4 USB is on Bus 0, Slot 4, Line 3 */
38 if (bus == pci_bus0 && slot == 4 && pin == 3) {
39 irq = CO_IRQ(CO_APIC_PIIX4_USB);
40 goto out;
41 }
42
43 /* First pin spread down 1 APIC entry per slot */
44 if (pin == 0) {
45 irq = CO_IRQ((bus == pci_bus0 ? CO_APIC_PCIB_BASE0 :
46 CO_APIC_PCIA_BASE0) + slot);
47 goto out;
48 }
49
50 /* lines 1,2,3 from any slot is shared in this twirly pattern */
51 if (bus == pci_bus1) {
52 /* lines 1-3 from devices 0 1 rotate over 2 apic entries */
53 irq = CO_IRQ(CO_APIC_PCIA_BASE123 + ((slot + (pin - 1)) % 2));
54 } else { /* bus == pci_bus0 */
55 /* lines 1-3 from devices 0-3 rotate over 3 apic entries */
56 if (slot == 0)
57 slot = 3; /* same pattern */
58 irq = CO_IRQ(CO_APIC_PCIA_BASE123 + ((3 - slot) + (pin - 1) % 3));
59 }
60out:
61 printk(KERN_DEBUG "PCI: Bus %d Slot %d Line %d -> IRQ %d\n", bus, slot, pin, irq);
62 return irq;
63}
64
65int __init pci_visws_init(void)
66{
67 pcibios_enable_irq = &pci_visws_enable_irq;
68 pcibios_disable_irq = &pci_visws_disable_irq;
69
70 /* The VISWS supports configuration access type 1 only */
71 pci_probe = (pci_probe | PCI_PROBE_CONF1) &
72 ~(PCI_PROBE_BIOS | PCI_PROBE_CONF2);
73
74 pci_bus0 = li_pcib_read16(LI_PCI_BUSNUM) & 0xff;
75 pci_bus1 = li_pcia_read16(LI_PCI_BUSNUM) & 0xff;
76
77 printk(KERN_INFO "PCI: Lithium bridge A bus: %u, "
78 "bridge B (PIIX4) bus: %u\n", pci_bus1, pci_bus0);
79
80 raw_pci_ops = &pci_direct_conf1;
81 pci_scan_bus_with_sysdata(pci_bus0);
82 pci_scan_bus_with_sysdata(pci_bus1);
83 pci_fixup_irqs(pci_common_swizzle, visws_map_irq);
84 pcibios_resource_survey();
85 /* Request bus scan */
86 return 1;
87}
diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c
index 103e702ec5a7..905956f16465 100644
--- a/arch/x86/pci/xen.c
+++ b/arch/x86/pci/xen.c
@@ -178,6 +178,7 @@ static int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
178 i = 0; 178 i = 0;
179 list_for_each_entry(msidesc, &dev->msi_list, list) { 179 list_for_each_entry(msidesc, &dev->msi_list, list) {
180 irq = xen_bind_pirq_msi_to_irq(dev, msidesc, v[i], 180 irq = xen_bind_pirq_msi_to_irq(dev, msidesc, v[i],
181 (type == PCI_CAP_ID_MSI) ? nvec : 1,
181 (type == PCI_CAP_ID_MSIX) ? 182 (type == PCI_CAP_ID_MSIX) ?
182 "pcifront-msi-x" : 183 "pcifront-msi-x" :
183 "pcifront-msi", 184 "pcifront-msi",
@@ -245,6 +246,7 @@ static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
245 "xen: msi already bound to pirq=%d\n", pirq); 246 "xen: msi already bound to pirq=%d\n", pirq);
246 } 247 }
247 irq = xen_bind_pirq_msi_to_irq(dev, msidesc, pirq, 248 irq = xen_bind_pirq_msi_to_irq(dev, msidesc, pirq,
249 (type == PCI_CAP_ID_MSI) ? nvec : 1,
248 (type == PCI_CAP_ID_MSIX) ? 250 (type == PCI_CAP_ID_MSIX) ?
249 "msi-x" : "msi", 251 "msi-x" : "msi",
250 DOMID_SELF); 252 DOMID_SELF);
@@ -269,9 +271,6 @@ static int xen_initdom_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
269 int ret = 0; 271 int ret = 0;
270 struct msi_desc *msidesc; 272 struct msi_desc *msidesc;
271 273
272 if (type == PCI_CAP_ID_MSI && nvec > 1)
273 return 1;
274
275 list_for_each_entry(msidesc, &dev->msi_list, list) { 274 list_for_each_entry(msidesc, &dev->msi_list, list) {
276 struct physdev_map_pirq map_irq; 275 struct physdev_map_pirq map_irq;
277 domid_t domid; 276 domid_t domid;
@@ -291,7 +290,10 @@ static int xen_initdom_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
291 (pci_domain_nr(dev->bus) << 16); 290 (pci_domain_nr(dev->bus) << 16);
292 map_irq.devfn = dev->devfn; 291 map_irq.devfn = dev->devfn;
293 292
294 if (type == PCI_CAP_ID_MSIX) { 293 if (type == PCI_CAP_ID_MSI && nvec > 1) {
294 map_irq.type = MAP_PIRQ_TYPE_MULTI_MSI;
295 map_irq.entry_nr = nvec;
296 } else if (type == PCI_CAP_ID_MSIX) {
295 int pos; 297 int pos;
296 u32 table_offset, bir; 298 u32 table_offset, bir;
297 299
@@ -308,6 +310,16 @@ static int xen_initdom_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
308 if (pci_seg_supported) 310 if (pci_seg_supported)
309 ret = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, 311 ret = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq,
310 &map_irq); 312 &map_irq);
313 if (type == PCI_CAP_ID_MSI && nvec > 1 && ret) {
314 /*
315 * If MAP_PIRQ_TYPE_MULTI_MSI is not available
316 * there's nothing else we can do in this case.
317 * Just set ret > 0 so driver can retry with
318 * single MSI.
319 */
320 ret = 1;
321 goto out;
322 }
311 if (ret == -EINVAL && !pci_domain_nr(dev->bus)) { 323 if (ret == -EINVAL && !pci_domain_nr(dev->bus)) {
312 map_irq.type = MAP_PIRQ_TYPE_MSI; 324 map_irq.type = MAP_PIRQ_TYPE_MSI;
313 map_irq.index = -1; 325 map_irq.index = -1;
@@ -324,11 +336,10 @@ static int xen_initdom_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
324 goto out; 336 goto out;
325 } 337 }
326 338
327 ret = xen_bind_pirq_msi_to_irq(dev, msidesc, 339 ret = xen_bind_pirq_msi_to_irq(dev, msidesc, map_irq.pirq,
328 map_irq.pirq, 340 (type == PCI_CAP_ID_MSI) ? nvec : 1,
329 (type == PCI_CAP_ID_MSIX) ? 341 (type == PCI_CAP_ID_MSIX) ? "msi-x" : "msi",
330 "msi-x" : "msi", 342 domid);
331 domid);
332 if (ret < 0) 343 if (ret < 0)
333 goto out; 344 goto out;
334 } 345 }
diff --git a/arch/x86/platform/Makefile b/arch/x86/platform/Makefile
index 20342d4c82ce..85afde1fa3e5 100644
--- a/arch/x86/platform/Makefile
+++ b/arch/x86/platform/Makefile
@@ -9,5 +9,4 @@ obj-y += olpc/
9obj-y += scx200/ 9obj-y += scx200/
10obj-y += sfi/ 10obj-y += sfi/
11obj-y += ts5500/ 11obj-y += ts5500/
12obj-y += visws/
13obj-y += uv/ 12obj-y += uv/
diff --git a/arch/x86/platform/visws/Makefile b/arch/x86/platform/visws/Makefile
deleted file mode 100644
index 91bc17ab2fd5..000000000000
--- a/arch/x86/platform/visws/Makefile
+++ /dev/null
@@ -1 +0,0 @@
1obj-$(CONFIG_X86_VISWS) += visws_quirks.o
diff --git a/arch/x86/platform/visws/visws_quirks.c b/arch/x86/platform/visws/visws_quirks.c
deleted file mode 100644
index 94d8a39332ec..000000000000
--- a/arch/x86/platform/visws/visws_quirks.c
+++ /dev/null
@@ -1,608 +0,0 @@
1/*
2 * SGI Visual Workstation support and quirks, unmaintained.
3 *
4 * Split out from setup.c by davej@suse.de
5 *
6 * Copyright (C) 1999 Bent Hagemark, Ingo Molnar
7 *
8 * SGI Visual Workstation interrupt controller
9 *
10 * The Cobalt system ASIC in the Visual Workstation contains a "Cobalt" APIC
11 * which serves as the main interrupt controller in the system. Non-legacy
12 * hardware in the system uses this controller directly. Legacy devices
13 * are connected to the PIIX4 which in turn has its 8259(s) connected to
14 * a of the Cobalt APIC entry.
15 *
16 * 09/02/2000 - Updated for 2.4 by jbarnes@sgi.com
17 *
18 * 25/11/2002 - Updated for 2.5 by Andrey Panin <pazke@orbita1.ru>
19 */
20#include <linux/interrupt.h>
21#include <linux/module.h>
22#include <linux/init.h>
23#include <linux/smp.h>
24
25#include <asm/visws/cobalt.h>
26#include <asm/visws/piix4.h>
27#include <asm/io_apic.h>
28#include <asm/fixmap.h>
29#include <asm/reboot.h>
30#include <asm/setup.h>
31#include <asm/apic.h>
32#include <asm/e820.h>
33#include <asm/time.h>
34#include <asm/io.h>
35
36#include <linux/kernel_stat.h>
37
38#include <asm/i8259.h>
39#include <asm/irq_vectors.h>
40#include <asm/visws/lithium.h>
41
42#include <linux/sched.h>
43#include <linux/kernel.h>
44#include <linux/pci.h>
45#include <linux/pci_ids.h>
46
47extern int no_broadcast;
48
49char visws_board_type = -1;
50char visws_board_rev = -1;
51
52static void __init visws_time_init(void)
53{
54 printk(KERN_INFO "Starting Cobalt Timer system clock\n");
55
56 /* Set the countdown value */
57 co_cpu_write(CO_CPU_TIMEVAL, CO_TIME_HZ/HZ);
58
59 /* Start the timer */
60 co_cpu_write(CO_CPU_CTRL, co_cpu_read(CO_CPU_CTRL) | CO_CTRL_TIMERUN);
61
62 /* Enable (unmask) the timer interrupt */
63 co_cpu_write(CO_CPU_CTRL, co_cpu_read(CO_CPU_CTRL) & ~CO_CTRL_TIMEMASK);
64
65 setup_default_timer_irq();
66}
67
68/* Replaces the default init_ISA_irqs in the generic setup */
69static void __init visws_pre_intr_init(void);
70
71/* Quirk for machine specific memory setup. */
72
73#define MB (1024 * 1024)
74
75unsigned long sgivwfb_mem_phys;
76unsigned long sgivwfb_mem_size;
77EXPORT_SYMBOL(sgivwfb_mem_phys);
78EXPORT_SYMBOL(sgivwfb_mem_size);
79
80long long mem_size __initdata = 0;
81
82static char * __init visws_memory_setup(void)
83{
84 long long gfx_mem_size = 8 * MB;
85
86 mem_size = boot_params.alt_mem_k;
87
88 if (!mem_size) {
89 printk(KERN_WARNING "Bootloader didn't set memory size, upgrade it !\n");
90 mem_size = 128 * MB;
91 }
92
93 /*
94 * this hardcodes the graphics memory to 8 MB
95 * it really should be sized dynamically (or at least
96 * set as a boot param)
97 */
98 if (!sgivwfb_mem_size) {
99 printk(KERN_WARNING "Defaulting to 8 MB framebuffer size\n");
100 sgivwfb_mem_size = 8 * MB;
101 }
102
103 /*
104 * Trim to nearest MB
105 */
106 sgivwfb_mem_size &= ~((1 << 20) - 1);
107 sgivwfb_mem_phys = mem_size - gfx_mem_size;
108
109 e820_add_region(0, LOWMEMSIZE(), E820_RAM);
110 e820_add_region(HIGH_MEMORY, mem_size - sgivwfb_mem_size - HIGH_MEMORY, E820_RAM);
111 e820_add_region(sgivwfb_mem_phys, sgivwfb_mem_size, E820_RESERVED);
112
113 return "PROM";
114}
115
116static void visws_machine_emergency_restart(void)
117{
118 /*
119 * Visual Workstations restart after this
120 * register is poked on the PIIX4
121 */
122 outb(PIIX4_RESET_VAL, PIIX4_RESET_PORT);
123}
124
125static void visws_machine_power_off(void)
126{
127 unsigned short pm_status;
128/* extern unsigned int pci_bus0; */
129
130 while ((pm_status = inw(PMSTS_PORT)) & 0x100)
131 outw(pm_status, PMSTS_PORT);
132
133 outw(PM_SUSPEND_ENABLE, PMCNTRL_PORT);
134
135 mdelay(10);
136
137#define PCI_CONF1_ADDRESS(bus, devfn, reg) \
138 (0x80000000 | (bus << 16) | (devfn << 8) | (reg & ~3))
139
140/* outl(PCI_CONF1_ADDRESS(pci_bus0, SPECIAL_DEV, SPECIAL_REG), 0xCF8); */
141 outl(PIIX_SPECIAL_STOP, 0xCFC);
142}
143
144static void __init visws_get_smp_config(unsigned int early)
145{
146}
147
148/*
149 * The Visual Workstation is Intel MP compliant in the hardware
150 * sense, but it doesn't have a BIOS(-configuration table).
151 * No problem for Linux.
152 */
153
154static void __init MP_processor_info(struct mpc_cpu *m)
155{
156 int ver, logical_apicid;
157 physid_mask_t apic_cpus;
158
159 if (!(m->cpuflag & CPU_ENABLED))
160 return;
161
162 logical_apicid = m->apicid;
163 printk(KERN_INFO "%sCPU #%d %u:%u APIC version %d\n",
164 m->cpuflag & CPU_BOOTPROCESSOR ? "Bootup " : "",
165 m->apicid, (m->cpufeature & CPU_FAMILY_MASK) >> 8,
166 (m->cpufeature & CPU_MODEL_MASK) >> 4, m->apicver);
167
168 if (m->cpuflag & CPU_BOOTPROCESSOR)
169 boot_cpu_physical_apicid = m->apicid;
170
171 ver = m->apicver;
172 if ((ver >= 0x14 && m->apicid >= 0xff) || m->apicid >= 0xf) {
173 printk(KERN_ERR "Processor #%d INVALID. (Max ID: %d).\n",
174 m->apicid, MAX_LOCAL_APIC);
175 return;
176 }
177
178 apic->apicid_to_cpu_present(m->apicid, &apic_cpus);
179 physids_or(phys_cpu_present_map, phys_cpu_present_map, apic_cpus);
180 /*
181 * Validate version
182 */
183 if (ver == 0x0) {
184 printk(KERN_ERR "BIOS bug, APIC version is 0 for CPU#%d! "
185 "fixing up to 0x10. (tell your hw vendor)\n",
186 m->apicid);
187 ver = 0x10;
188 }
189 apic_version[m->apicid] = ver;
190}
191
192static void __init visws_find_smp_config(void)
193{
194 struct mpc_cpu *mp = phys_to_virt(CO_CPU_TAB_PHYS);
195 unsigned short ncpus = readw(phys_to_virt(CO_CPU_NUM_PHYS));
196
197 if (ncpus > CO_CPU_MAX) {
198 printk(KERN_WARNING "find_visws_smp: got cpu count of %d at %p\n",
199 ncpus, mp);
200
201 ncpus = CO_CPU_MAX;
202 }
203
204 if (ncpus > setup_max_cpus)
205 ncpus = setup_max_cpus;
206
207#ifdef CONFIG_X86_LOCAL_APIC
208 smp_found_config = 1;
209#endif
210 while (ncpus--)
211 MP_processor_info(mp++);
212
213 mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
214}
215
216static void visws_trap_init(void);
217
218void __init visws_early_detect(void)
219{
220 int raw;
221
222 visws_board_type = (char)(inb_p(PIIX_GPI_BD_REG) & PIIX_GPI_BD_REG)
223 >> PIIX_GPI_BD_SHIFT;
224
225 if (visws_board_type < 0)
226 return;
227
228 /*
229 * Override the default platform setup functions
230 */
231 x86_init.resources.memory_setup = visws_memory_setup;
232 x86_init.mpparse.get_smp_config = visws_get_smp_config;
233 x86_init.mpparse.find_smp_config = visws_find_smp_config;
234 x86_init.irqs.pre_vector_init = visws_pre_intr_init;
235 x86_init.irqs.trap_init = visws_trap_init;
236 x86_init.timers.timer_init = visws_time_init;
237 x86_init.pci.init = pci_visws_init;
238 x86_init.pci.init_irq = x86_init_noop;
239
240 /*
241 * Install reboot quirks:
242 */
243 pm_power_off = visws_machine_power_off;
244 machine_ops.emergency_restart = visws_machine_emergency_restart;
245
246 /*
247 * Do not use broadcast IPIs:
248 */
249 no_broadcast = 0;
250
251#ifdef CONFIG_X86_IO_APIC
252 /*
253 * Turn off IO-APIC detection and initialization:
254 */
255 skip_ioapic_setup = 1;
256#endif
257
258 /*
259 * Get Board rev.
260 * First, we have to initialize the 307 part to allow us access
261 * to the GPIO registers. Let's map them at 0x0fc0 which is right
262 * after the PIIX4 PM section.
263 */
264 outb_p(SIO_DEV_SEL, SIO_INDEX);
265 outb_p(SIO_GP_DEV, SIO_DATA); /* Talk to GPIO regs. */
266
267 outb_p(SIO_DEV_MSB, SIO_INDEX);
268 outb_p(SIO_GP_MSB, SIO_DATA); /* MSB of GPIO base address */
269
270 outb_p(SIO_DEV_LSB, SIO_INDEX);
271 outb_p(SIO_GP_LSB, SIO_DATA); /* LSB of GPIO base address */
272
273 outb_p(SIO_DEV_ENB, SIO_INDEX);
274 outb_p(1, SIO_DATA); /* Enable GPIO registers. */
275
276 /*
277 * Now, we have to map the power management section to write
278 * a bit which enables access to the GPIO registers.
279 * What lunatic came up with this shit?
280 */
281 outb_p(SIO_DEV_SEL, SIO_INDEX);
282 outb_p(SIO_PM_DEV, SIO_DATA); /* Talk to GPIO regs. */
283
284 outb_p(SIO_DEV_MSB, SIO_INDEX);
285 outb_p(SIO_PM_MSB, SIO_DATA); /* MSB of PM base address */
286
287 outb_p(SIO_DEV_LSB, SIO_INDEX);
288 outb_p(SIO_PM_LSB, SIO_DATA); /* LSB of PM base address */
289
290 outb_p(SIO_DEV_ENB, SIO_INDEX);
291 outb_p(1, SIO_DATA); /* Enable PM registers. */
292
293 /*
294 * Now, write the PM register which enables the GPIO registers.
295 */
296 outb_p(SIO_PM_FER2, SIO_PM_INDEX);
297 outb_p(SIO_PM_GP_EN, SIO_PM_DATA);
298
299 /*
300 * Now, initialize the GPIO registers.
301 * We want them all to be inputs which is the
302 * power on default, so let's leave them alone.
303 * So, let's just read the board rev!
304 */
305 raw = inb_p(SIO_GP_DATA1);
306 raw &= 0x7f; /* 7 bits of valid board revision ID. */
307
308 if (visws_board_type == VISWS_320) {
309 if (raw < 0x6) {
310 visws_board_rev = 4;
311 } else if (raw < 0xc) {
312 visws_board_rev = 5;
313 } else {
314 visws_board_rev = 6;
315 }
316 } else if (visws_board_type == VISWS_540) {
317 visws_board_rev = 2;
318 } else {
319 visws_board_rev = raw;
320 }
321
322 printk(KERN_INFO "Silicon Graphics Visual Workstation %s (rev %d) detected\n",
323 (visws_board_type == VISWS_320 ? "320" :
324 (visws_board_type == VISWS_540 ? "540" :
325 "unknown")), visws_board_rev);
326}
327
328#define A01234 (LI_INTA_0 | LI_INTA_1 | LI_INTA_2 | LI_INTA_3 | LI_INTA_4)
329#define BCD (LI_INTB | LI_INTC | LI_INTD)
330#define ALLDEVS (A01234 | BCD)
331
332static __init void lithium_init(void)
333{
334 set_fixmap(FIX_LI_PCIA, LI_PCI_A_PHYS);
335 set_fixmap(FIX_LI_PCIB, LI_PCI_B_PHYS);
336
337 if ((li_pcia_read16(PCI_VENDOR_ID) != PCI_VENDOR_ID_SGI) ||
338 (li_pcia_read16(PCI_DEVICE_ID) != PCI_DEVICE_ID_SGI_LITHIUM)) {
339 printk(KERN_EMERG "Lithium hostbridge %c not found\n", 'A');
340/* panic("This machine is not SGI Visual Workstation 320/540"); */
341 }
342
343 if ((li_pcib_read16(PCI_VENDOR_ID) != PCI_VENDOR_ID_SGI) ||
344 (li_pcib_read16(PCI_DEVICE_ID) != PCI_DEVICE_ID_SGI_LITHIUM)) {
345 printk(KERN_EMERG "Lithium hostbridge %c not found\n", 'B');
346/* panic("This machine is not SGI Visual Workstation 320/540"); */
347 }
348
349 li_pcia_write16(LI_PCI_INTEN, ALLDEVS);
350 li_pcib_write16(LI_PCI_INTEN, ALLDEVS);
351}
352
353static __init void cobalt_init(void)
354{
355 /*
356 * On normal SMP PC this is used only with SMP, but we have to
357 * use it and set it up here to start the Cobalt clock
358 */
359 set_fixmap(FIX_APIC_BASE, APIC_DEFAULT_PHYS_BASE);
360 setup_local_APIC();
361 printk(KERN_INFO "Local APIC Version %#x, ID %#x\n",
362 (unsigned int)apic_read(APIC_LVR),
363 (unsigned int)apic_read(APIC_ID));
364
365 set_fixmap(FIX_CO_CPU, CO_CPU_PHYS);
366 set_fixmap(FIX_CO_APIC, CO_APIC_PHYS);
367 printk(KERN_INFO "Cobalt Revision %#lx, APIC ID %#lx\n",
368 co_cpu_read(CO_CPU_REV), co_apic_read(CO_APIC_ID));
369
370 /* Enable Cobalt APIC being careful to NOT change the ID! */
371 co_apic_write(CO_APIC_ID, co_apic_read(CO_APIC_ID) | CO_APIC_ENABLE);
372
373 printk(KERN_INFO "Cobalt APIC enabled: ID reg %#lx\n",
374 co_apic_read(CO_APIC_ID));
375}
376
377static void __init visws_trap_init(void)
378{
379 lithium_init();
380 cobalt_init();
381}
382
383/*
384 * IRQ controller / APIC support:
385 */
386
387static DEFINE_SPINLOCK(cobalt_lock);
388
389/*
390 * Set the given Cobalt APIC Redirection Table entry to point
391 * to the given IDT vector/index.
392 */
393static inline void co_apic_set(int entry, int irq)
394{
395 co_apic_write(CO_APIC_LO(entry), CO_APIC_LEVEL | (irq + FIRST_EXTERNAL_VECTOR));
396 co_apic_write(CO_APIC_HI(entry), 0);
397}
398
399/*
400 * Cobalt (IO)-APIC functions to handle PCI devices.
401 */
402static inline int co_apic_ide0_hack(void)
403{
404 extern char visws_board_type;
405 extern char visws_board_rev;
406
407 if (visws_board_type == VISWS_320 && visws_board_rev == 5)
408 return 5;
409 return CO_APIC_IDE0;
410}
411
412static int is_co_apic(unsigned int irq)
413{
414 if (IS_CO_APIC(irq))
415 return CO_APIC(irq);
416
417 switch (irq) {
418 case 0: return CO_APIC_CPU;
419 case CO_IRQ_IDE0: return co_apic_ide0_hack();
420 case CO_IRQ_IDE1: return CO_APIC_IDE1;
421 default: return -1;
422 }
423}
424
425
426/*
427 * This is the SGI Cobalt (IO-)APIC:
428 */
429static void enable_cobalt_irq(struct irq_data *data)
430{
431 co_apic_set(is_co_apic(data->irq), data->irq);
432}
433
434static void disable_cobalt_irq(struct irq_data *data)
435{
436 int entry = is_co_apic(data->irq);
437
438 co_apic_write(CO_APIC_LO(entry), CO_APIC_MASK);
439 co_apic_read(CO_APIC_LO(entry));
440}
441
442static void ack_cobalt_irq(struct irq_data *data)
443{
444 unsigned long flags;
445
446 spin_lock_irqsave(&cobalt_lock, flags);
447 disable_cobalt_irq(data);
448 apic_write(APIC_EOI, APIC_EOI_ACK);
449 spin_unlock_irqrestore(&cobalt_lock, flags);
450}
451
452static struct irq_chip cobalt_irq_type = {
453 .name = "Cobalt-APIC",
454 .irq_enable = enable_cobalt_irq,
455 .irq_disable = disable_cobalt_irq,
456 .irq_ack = ack_cobalt_irq,
457};
458
459
460/*
461 * This is the PIIX4-based 8259 that is wired up indirectly to Cobalt
462 * -- not the manner expected by the code in i8259.c.
463 *
464 * there is a 'master' physical interrupt source that gets sent to
465 * the CPU. But in the chipset there are various 'virtual' interrupts
466 * waiting to be handled. We represent this to Linux through a 'master'
467 * interrupt controller type, and through a special virtual interrupt-
468 * controller. Device drivers only see the virtual interrupt sources.
469 */
470static unsigned int startup_piix4_master_irq(struct irq_data *data)
471{
472 legacy_pic->init(0);
473 enable_cobalt_irq(data);
474 return 0;
475}
476
477static struct irq_chip piix4_master_irq_type = {
478 .name = "PIIX4-master",
479 .irq_startup = startup_piix4_master_irq,
480 .irq_ack = ack_cobalt_irq,
481};
482
483static void pii4_mask(struct irq_data *data) { }
484
485static struct irq_chip piix4_virtual_irq_type = {
486 .name = "PIIX4-virtual",
487 .irq_mask = pii4_mask,
488};
489
490/*
491 * PIIX4-8259 master/virtual functions to handle interrupt requests
492 * from legacy devices: floppy, parallel, serial, rtc.
493 *
494 * None of these get Cobalt APIC entries, neither do they have IDT
495 * entries. These interrupts are purely virtual and distributed from
496 * the 'master' interrupt source: CO_IRQ_8259.
497 *
498 * When the 8259 interrupts its handler figures out which of these
499 * devices is interrupting and dispatches to its handler.
500 *
501 * CAREFUL: devices see the 'virtual' interrupt only. Thus disable/
502 * enable_irq gets the right irq. This 'master' irq is never directly
503 * manipulated by any driver.
504 */
505static irqreturn_t piix4_master_intr(int irq, void *dev_id)
506{
507 unsigned long flags;
508 int realirq;
509
510 raw_spin_lock_irqsave(&i8259A_lock, flags);
511
512 /* Find out what's interrupting in the PIIX4 master 8259 */
513 outb(0x0c, 0x20); /* OCW3 Poll command */
514 realirq = inb(0x20);
515
516 /*
517 * Bit 7 == 0 means invalid/spurious
518 */
519 if (unlikely(!(realirq & 0x80)))
520 goto out_unlock;
521
522 realirq &= 7;
523
524 if (unlikely(realirq == 2)) {
525 outb(0x0c, 0xa0);
526 realirq = inb(0xa0);
527
528 if (unlikely(!(realirq & 0x80)))
529 goto out_unlock;
530
531 realirq = (realirq & 7) + 8;
532 }
533
534 /* mask and ack interrupt */
535 cached_irq_mask |= 1 << realirq;
536 if (unlikely(realirq > 7)) {
537 inb(0xa1);
538 outb(cached_slave_mask, 0xa1);
539 outb(0x60 + (realirq & 7), 0xa0);
540 outb(0x60 + 2, 0x20);
541 } else {
542 inb(0x21);
543 outb(cached_master_mask, 0x21);
544 outb(0x60 + realirq, 0x20);
545 }
546
547 raw_spin_unlock_irqrestore(&i8259A_lock, flags);
548
549 /*
550 * handle this 'virtual interrupt' as a Cobalt one now.
551 */
552 generic_handle_irq(realirq);
553
554 return IRQ_HANDLED;
555
556out_unlock:
557 raw_spin_unlock_irqrestore(&i8259A_lock, flags);
558 return IRQ_NONE;
559}
560
561static struct irqaction master_action = {
562 .handler = piix4_master_intr,
563 .name = "PIIX4-8259",
564 .flags = IRQF_NO_THREAD,
565};
566
567static struct irqaction cascade_action = {
568 .handler = no_action,
569 .name = "cascade",
570 .flags = IRQF_NO_THREAD,
571};
572
573static inline void set_piix4_virtual_irq_type(void)
574{
575 piix4_virtual_irq_type.irq_enable = i8259A_chip.irq_unmask;
576 piix4_virtual_irq_type.irq_disable = i8259A_chip.irq_mask;
577 piix4_virtual_irq_type.irq_unmask = i8259A_chip.irq_unmask;
578}
579
580static void __init visws_pre_intr_init(void)
581{
582 int i;
583
584 set_piix4_virtual_irq_type();
585
586 for (i = 0; i < CO_IRQ_APIC0 + CO_APIC_LAST + 1; i++) {
587 struct irq_chip *chip = NULL;
588
589 if (i == 0)
590 chip = &cobalt_irq_type;
591 else if (i == CO_IRQ_IDE0)
592 chip = &cobalt_irq_type;
593 else if (i == CO_IRQ_IDE1)
594 chip = &cobalt_irq_type;
595 else if (i == CO_IRQ_8259)
596 chip = &piix4_master_irq_type;
597 else if (i < CO_IRQ_APIC0)
598 chip = &piix4_virtual_irq_type;
599 else if (IS_CO_APIC(i))
600 chip = &cobalt_irq_type;
601
602 if (chip)
603 irq_set_chip(i, chip);
604 }
605
606 setup_irq(CO_IRQ_8259, &master_action);
607 setup_irq(2, &cascade_action);
608}
diff --git a/arch/x86/syscalls/syscall_64.tbl b/arch/x86/syscalls/syscall_64.tbl
index a12bddc7ccea..04376ac3d9ef 100644
--- a/arch/x86/syscalls/syscall_64.tbl
+++ b/arch/x86/syscalls/syscall_64.tbl
@@ -322,6 +322,7 @@
322313 common finit_module sys_finit_module 322313 common finit_module sys_finit_module
323314 common sched_setattr sys_sched_setattr 323314 common sched_setattr sys_sched_setattr
324315 common sched_getattr sys_sched_getattr 324315 common sched_getattr sys_sched_getattr
325316 common renameat2 sys_renameat2
325 326
326# 327#
327# x32-specific system call numbers start at 512 to avoid cache impact 328# x32-specific system call numbers start at 512 to avoid cache impact
diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
index cfbdbdb4e173..bbb1d2259ecf 100644
--- a/arch/x86/tools/relocs.c
+++ b/arch/x86/tools/relocs.c
@@ -69,8 +69,8 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = {
69 "__per_cpu_load|" 69 "__per_cpu_load|"
70 "init_per_cpu__.*|" 70 "init_per_cpu__.*|"
71 "__end_rodata_hpage_align|" 71 "__end_rodata_hpage_align|"
72 "__vvar_page|"
73#endif 72#endif
73 "__vvar_page|"
74 "_end)$" 74 "_end)$"
75}; 75};
76 76
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
index 9206ac7961a5..c580d1210ffe 100644
--- a/arch/x86/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
@@ -23,7 +23,8 @@ vobjs-$(VDSOX32-y) += $(vobjx32s-compat)
23vobj64s := $(filter-out $(vobjx32s-compat),$(vobjs-y)) 23vobj64s := $(filter-out $(vobjx32s-compat),$(vobjs-y))
24 24
25# files to link into kernel 25# files to link into kernel
26obj-$(VDSO64-y) += vma.o vdso.o 26obj-y += vma.o
27obj-$(VDSO64-y) += vdso.o
27obj-$(VDSOX32-y) += vdsox32.o 28obj-$(VDSOX32-y) += vdsox32.o
28obj-$(VDSO32-y) += vdso32.o vdso32-setup.o 29obj-$(VDSO32-y) += vdso32.o vdso32-setup.o
29 30
@@ -138,7 +139,7 @@ override obj-dirs = $(dir $(obj)) $(obj)/vdso32/
138 139
139targets += vdso32/vdso32.lds 140targets += vdso32/vdso32.lds
140targets += $(vdso32-images) $(vdso32-images:=.dbg) 141targets += $(vdso32-images) $(vdso32-images:=.dbg)
141targets += vdso32/note.o $(vdso32.so-y:%=vdso32/%.o) 142targets += vdso32/note.o vdso32/vclock_gettime.o $(vdso32.so-y:%=vdso32/%.o)
142 143
143extra-y += $(vdso32-images) 144extra-y += $(vdso32-images)
144 145
@@ -148,8 +149,19 @@ KBUILD_AFLAGS_32 := $(filter-out -m64,$(KBUILD_AFLAGS))
148$(vdso32-images:%=$(obj)/%.dbg): KBUILD_AFLAGS = $(KBUILD_AFLAGS_32) 149$(vdso32-images:%=$(obj)/%.dbg): KBUILD_AFLAGS = $(KBUILD_AFLAGS_32)
149$(vdso32-images:%=$(obj)/%.dbg): asflags-$(CONFIG_X86_64) += -m32 150$(vdso32-images:%=$(obj)/%.dbg): asflags-$(CONFIG_X86_64) += -m32
150 151
152KBUILD_CFLAGS_32 := $(filter-out -m64,$(KBUILD_CFLAGS))
153KBUILD_CFLAGS_32 := $(filter-out -mcmodel=kernel,$(KBUILD_CFLAGS_32))
154KBUILD_CFLAGS_32 := $(filter-out -fno-pic,$(KBUILD_CFLAGS_32))
155KBUILD_CFLAGS_32 := $(filter-out -mfentry,$(KBUILD_CFLAGS_32))
156KBUILD_CFLAGS_32 += -m32 -msoft-float -mregparm=0 -fpic
157KBUILD_CFLAGS_32 += $(call cc-option, -fno-stack-protector)
158KBUILD_CFLAGS_32 += $(call cc-option, -foptimize-sibling-calls)
159KBUILD_CFLAGS_32 += -fno-omit-frame-pointer
160$(vdso32-images:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_32)
161
151$(vdso32-images:%=$(obj)/%.dbg): $(obj)/vdso32-%.so.dbg: FORCE \ 162$(vdso32-images:%=$(obj)/%.dbg): $(obj)/vdso32-%.so.dbg: FORCE \
152 $(obj)/vdso32/vdso32.lds \ 163 $(obj)/vdso32/vdso32.lds \
164 $(obj)/vdso32/vclock_gettime.o \
153 $(obj)/vdso32/note.o \ 165 $(obj)/vdso32/note.o \
154 $(obj)/vdso32/%.o 166 $(obj)/vdso32/%.o
155 $(call if_changed,vdso) 167 $(call if_changed,vdso)
diff --git a/arch/x86/vdso/vclock_gettime.c b/arch/x86/vdso/vclock_gettime.c
index eb5d7a56f8d4..16d686171e9a 100644
--- a/arch/x86/vdso/vclock_gettime.c
+++ b/arch/x86/vdso/vclock_gettime.c
@@ -4,6 +4,9 @@
4 * 4 *
5 * Fast user context implementation of clock_gettime, gettimeofday, and time. 5 * Fast user context implementation of clock_gettime, gettimeofday, and time.
6 * 6 *
7 * 32 Bit compat layer by Stefani Seibold <stefani@seibold.net>
8 * sponsored by Rohde & Schwarz GmbH & Co. KG Munich/Germany
9 *
7 * The code should have no internal unresolved relocations. 10 * The code should have no internal unresolved relocations.
8 * Check with readelf after changing. 11 * Check with readelf after changing.
9 */ 12 */
@@ -11,56 +14,55 @@
11/* Disable profiling for userspace code: */ 14/* Disable profiling for userspace code: */
12#define DISABLE_BRANCH_PROFILING 15#define DISABLE_BRANCH_PROFILING
13 16
14#include <linux/kernel.h> 17#include <uapi/linux/time.h>
15#include <linux/posix-timers.h>
16#include <linux/time.h>
17#include <linux/string.h>
18#include <asm/vsyscall.h>
19#include <asm/fixmap.h>
20#include <asm/vgtod.h> 18#include <asm/vgtod.h>
21#include <asm/timex.h>
22#include <asm/hpet.h> 19#include <asm/hpet.h>
20#include <asm/vvar.h>
23#include <asm/unistd.h> 21#include <asm/unistd.h>
24#include <asm/io.h> 22#include <asm/msr.h>
25#include <asm/pvclock.h> 23#include <linux/math64.h>
24#include <linux/time.h>
26 25
27#define gtod (&VVAR(vsyscall_gtod_data)) 26#define gtod (&VVAR(vsyscall_gtod_data))
28 27
29notrace static cycle_t vread_tsc(void) 28extern int __vdso_clock_gettime(clockid_t clock, struct timespec *ts);
29extern int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz);
30extern time_t __vdso_time(time_t *t);
31
32#ifdef CONFIG_HPET_TIMER
33static inline u32 read_hpet_counter(const volatile void *addr)
30{ 34{
31 cycle_t ret; 35 return *(const volatile u32 *) (addr + HPET_COUNTER);
32 u64 last; 36}
37#endif
33 38
34 /* 39#ifndef BUILD_VDSO32
35 * Empirically, a fence (of type that depends on the CPU)
36 * before rdtsc is enough to ensure that rdtsc is ordered
37 * with respect to loads. The various CPU manuals are unclear
38 * as to whether rdtsc can be reordered with later loads,
39 * but no one has ever seen it happen.
40 */
41 rdtsc_barrier();
42 ret = (cycle_t)vget_cycles();
43 40
44 last = VVAR(vsyscall_gtod_data).clock.cycle_last; 41#include <linux/kernel.h>
42#include <asm/vsyscall.h>
43#include <asm/fixmap.h>
44#include <asm/pvclock.h>
45 45
46 if (likely(ret >= last)) 46static notrace cycle_t vread_hpet(void)
47 return ret; 47{
48 return read_hpet_counter((const void *)fix_to_virt(VSYSCALL_HPET));
49}
48 50
49 /* 51notrace static long vdso_fallback_gettime(long clock, struct timespec *ts)
50 * GCC likes to generate cmov here, but this branch is extremely 52{
51 * predictable (it's just a funciton of time and the likely is 53 long ret;
52 * very likely) and there's a data dependence, so force GCC 54 asm("syscall" : "=a" (ret) :
53 * to generate a branch instead. I don't barrier() because 55 "0" (__NR_clock_gettime), "D" (clock), "S" (ts) : "memory");
54 * we don't actually need a barrier, and if this function 56 return ret;
55 * ever gets inlined it will generate worse code.
56 */
57 asm volatile ("");
58 return last;
59} 57}
60 58
61static notrace cycle_t vread_hpet(void) 59notrace static long vdso_fallback_gtod(struct timeval *tv, struct timezone *tz)
62{ 60{
63 return readl((const void __iomem *)fix_to_virt(VSYSCALL_HPET) + HPET_COUNTER); 61 long ret;
62
63 asm("syscall" : "=a" (ret) :
64 "0" (__NR_gettimeofday), "D" (tv), "S" (tz) : "memory");
65 return ret;
64} 66}
65 67
66#ifdef CONFIG_PARAVIRT_CLOCK 68#ifdef CONFIG_PARAVIRT_CLOCK
@@ -124,7 +126,7 @@ static notrace cycle_t vread_pvclock(int *mode)
124 *mode = VCLOCK_NONE; 126 *mode = VCLOCK_NONE;
125 127
126 /* refer to tsc.c read_tsc() comment for rationale */ 128 /* refer to tsc.c read_tsc() comment for rationale */
127 last = VVAR(vsyscall_gtod_data).clock.cycle_last; 129 last = gtod->cycle_last;
128 130
129 if (likely(ret >= last)) 131 if (likely(ret >= last))
130 return ret; 132 return ret;
@@ -133,11 +135,30 @@ static notrace cycle_t vread_pvclock(int *mode)
133} 135}
134#endif 136#endif
135 137
138#else
139
140extern u8 hpet_page
141 __attribute__((visibility("hidden")));
142
143#ifdef CONFIG_HPET_TIMER
144static notrace cycle_t vread_hpet(void)
145{
146 return read_hpet_counter((const void *)(&hpet_page));
147}
148#endif
149
136notrace static long vdso_fallback_gettime(long clock, struct timespec *ts) 150notrace static long vdso_fallback_gettime(long clock, struct timespec *ts)
137{ 151{
138 long ret; 152 long ret;
139 asm("syscall" : "=a" (ret) : 153
140 "0" (__NR_clock_gettime),"D" (clock), "S" (ts) : "memory"); 154 asm(
155 "mov %%ebx, %%edx \n"
156 "mov %2, %%ebx \n"
157 "call VDSO32_vsyscall \n"
158 "mov %%edx, %%ebx \n"
159 : "=a" (ret)
160 : "0" (__NR_clock_gettime), "g" (clock), "c" (ts)
161 : "memory", "edx");
141 return ret; 162 return ret;
142} 163}
143 164
@@ -145,28 +166,79 @@ notrace static long vdso_fallback_gtod(struct timeval *tv, struct timezone *tz)
145{ 166{
146 long ret; 167 long ret;
147 168
148 asm("syscall" : "=a" (ret) : 169 asm(
149 "0" (__NR_gettimeofday), "D" (tv), "S" (tz) : "memory"); 170 "mov %%ebx, %%edx \n"
171 "mov %2, %%ebx \n"
172 "call VDSO32_vsyscall \n"
173 "mov %%edx, %%ebx \n"
174 : "=a" (ret)
175 : "0" (__NR_gettimeofday), "g" (tv), "c" (tz)
176 : "memory", "edx");
150 return ret; 177 return ret;
151} 178}
152 179
180#ifdef CONFIG_PARAVIRT_CLOCK
181
182static notrace cycle_t vread_pvclock(int *mode)
183{
184 *mode = VCLOCK_NONE;
185 return 0;
186}
187#endif
188
189#endif
190
191notrace static cycle_t vread_tsc(void)
192{
193 cycle_t ret;
194 u64 last;
195
196 /*
197 * Empirically, a fence (of type that depends on the CPU)
198 * before rdtsc is enough to ensure that rdtsc is ordered
199 * with respect to loads. The various CPU manuals are unclear
200 * as to whether rdtsc can be reordered with later loads,
201 * but no one has ever seen it happen.
202 */
203 rdtsc_barrier();
204 ret = (cycle_t)__native_read_tsc();
205
206 last = gtod->cycle_last;
207
208 if (likely(ret >= last))
209 return ret;
210
211 /*
212 * GCC likes to generate cmov here, but this branch is extremely
213 * predictable (it's just a funciton of time and the likely is
214 * very likely) and there's a data dependence, so force GCC
215 * to generate a branch instead. I don't barrier() because
216 * we don't actually need a barrier, and if this function
217 * ever gets inlined it will generate worse code.
218 */
219 asm volatile ("");
220 return last;
221}
153 222
154notrace static inline u64 vgetsns(int *mode) 223notrace static inline u64 vgetsns(int *mode)
155{ 224{
156 long v; 225 u64 v;
157 cycles_t cycles; 226 cycles_t cycles;
158 if (gtod->clock.vclock_mode == VCLOCK_TSC) 227
228 if (gtod->vclock_mode == VCLOCK_TSC)
159 cycles = vread_tsc(); 229 cycles = vread_tsc();
160 else if (gtod->clock.vclock_mode == VCLOCK_HPET) 230#ifdef CONFIG_HPET_TIMER
231 else if (gtod->vclock_mode == VCLOCK_HPET)
161 cycles = vread_hpet(); 232 cycles = vread_hpet();
233#endif
162#ifdef CONFIG_PARAVIRT_CLOCK 234#ifdef CONFIG_PARAVIRT_CLOCK
163 else if (gtod->clock.vclock_mode == VCLOCK_PVCLOCK) 235 else if (gtod->vclock_mode == VCLOCK_PVCLOCK)
164 cycles = vread_pvclock(mode); 236 cycles = vread_pvclock(mode);
165#endif 237#endif
166 else 238 else
167 return 0; 239 return 0;
168 v = (cycles - gtod->clock.cycle_last) & gtod->clock.mask; 240 v = (cycles - gtod->cycle_last) & gtod->mask;
169 return v * gtod->clock.mult; 241 return v * gtod->mult;
170} 242}
171 243
172/* Code size doesn't matter (vdso is 4k anyway) and this is faster. */ 244/* Code size doesn't matter (vdso is 4k anyway) and this is faster. */
@@ -176,106 +248,102 @@ notrace static int __always_inline do_realtime(struct timespec *ts)
176 u64 ns; 248 u64 ns;
177 int mode; 249 int mode;
178 250
179 ts->tv_nsec = 0;
180 do { 251 do {
181 seq = raw_read_seqcount_begin(&gtod->seq); 252 seq = gtod_read_begin(gtod);
182 mode = gtod->clock.vclock_mode; 253 mode = gtod->vclock_mode;
183 ts->tv_sec = gtod->wall_time_sec; 254 ts->tv_sec = gtod->wall_time_sec;
184 ns = gtod->wall_time_snsec; 255 ns = gtod->wall_time_snsec;
185 ns += vgetsns(&mode); 256 ns += vgetsns(&mode);
186 ns >>= gtod->clock.shift; 257 ns >>= gtod->shift;
187 } while (unlikely(read_seqcount_retry(&gtod->seq, seq))); 258 } while (unlikely(gtod_read_retry(gtod, seq)));
259
260 ts->tv_sec += __iter_div_u64_rem(ns, NSEC_PER_SEC, &ns);
261 ts->tv_nsec = ns;
188 262
189 timespec_add_ns(ts, ns);
190 return mode; 263 return mode;
191} 264}
192 265
193notrace static int do_monotonic(struct timespec *ts) 266notrace static int __always_inline do_monotonic(struct timespec *ts)
194{ 267{
195 unsigned long seq; 268 unsigned long seq;
196 u64 ns; 269 u64 ns;
197 int mode; 270 int mode;
198 271
199 ts->tv_nsec = 0;
200 do { 272 do {
201 seq = raw_read_seqcount_begin(&gtod->seq); 273 seq = gtod_read_begin(gtod);
202 mode = gtod->clock.vclock_mode; 274 mode = gtod->vclock_mode;
203 ts->tv_sec = gtod->monotonic_time_sec; 275 ts->tv_sec = gtod->monotonic_time_sec;
204 ns = gtod->monotonic_time_snsec; 276 ns = gtod->monotonic_time_snsec;
205 ns += vgetsns(&mode); 277 ns += vgetsns(&mode);
206 ns >>= gtod->clock.shift; 278 ns >>= gtod->shift;
207 } while (unlikely(read_seqcount_retry(&gtod->seq, seq))); 279 } while (unlikely(gtod_read_retry(gtod, seq)));
208 timespec_add_ns(ts, ns); 280
281 ts->tv_sec += __iter_div_u64_rem(ns, NSEC_PER_SEC, &ns);
282 ts->tv_nsec = ns;
209 283
210 return mode; 284 return mode;
211} 285}
212 286
213notrace static int do_realtime_coarse(struct timespec *ts) 287notrace static void do_realtime_coarse(struct timespec *ts)
214{ 288{
215 unsigned long seq; 289 unsigned long seq;
216 do { 290 do {
217 seq = raw_read_seqcount_begin(&gtod->seq); 291 seq = gtod_read_begin(gtod);
218 ts->tv_sec = gtod->wall_time_coarse.tv_sec; 292 ts->tv_sec = gtod->wall_time_coarse_sec;
219 ts->tv_nsec = gtod->wall_time_coarse.tv_nsec; 293 ts->tv_nsec = gtod->wall_time_coarse_nsec;
220 } while (unlikely(read_seqcount_retry(&gtod->seq, seq))); 294 } while (unlikely(gtod_read_retry(gtod, seq)));
221 return 0;
222} 295}
223 296
224notrace static int do_monotonic_coarse(struct timespec *ts) 297notrace static void do_monotonic_coarse(struct timespec *ts)
225{ 298{
226 unsigned long seq; 299 unsigned long seq;
227 do { 300 do {
228 seq = raw_read_seqcount_begin(&gtod->seq); 301 seq = gtod_read_begin(gtod);
229 ts->tv_sec = gtod->monotonic_time_coarse.tv_sec; 302 ts->tv_sec = gtod->monotonic_time_coarse_sec;
230 ts->tv_nsec = gtod->monotonic_time_coarse.tv_nsec; 303 ts->tv_nsec = gtod->monotonic_time_coarse_nsec;
231 } while (unlikely(read_seqcount_retry(&gtod->seq, seq))); 304 } while (unlikely(gtod_read_retry(gtod, seq)));
232
233 return 0;
234} 305}
235 306
236notrace int __vdso_clock_gettime(clockid_t clock, struct timespec *ts) 307notrace int __vdso_clock_gettime(clockid_t clock, struct timespec *ts)
237{ 308{
238 int ret = VCLOCK_NONE;
239
240 switch (clock) { 309 switch (clock) {
241 case CLOCK_REALTIME: 310 case CLOCK_REALTIME:
242 ret = do_realtime(ts); 311 if (do_realtime(ts) == VCLOCK_NONE)
312 goto fallback;
243 break; 313 break;
244 case CLOCK_MONOTONIC: 314 case CLOCK_MONOTONIC:
245 ret = do_monotonic(ts); 315 if (do_monotonic(ts) == VCLOCK_NONE)
316 goto fallback;
246 break; 317 break;
247 case CLOCK_REALTIME_COARSE: 318 case CLOCK_REALTIME_COARSE:
248 return do_realtime_coarse(ts); 319 do_realtime_coarse(ts);
320 break;
249 case CLOCK_MONOTONIC_COARSE: 321 case CLOCK_MONOTONIC_COARSE:
250 return do_monotonic_coarse(ts); 322 do_monotonic_coarse(ts);
323 break;
324 default:
325 goto fallback;
251 } 326 }
252 327
253 if (ret == VCLOCK_NONE)
254 return vdso_fallback_gettime(clock, ts);
255 return 0; 328 return 0;
329fallback:
330 return vdso_fallback_gettime(clock, ts);
256} 331}
257int clock_gettime(clockid_t, struct timespec *) 332int clock_gettime(clockid_t, struct timespec *)
258 __attribute__((weak, alias("__vdso_clock_gettime"))); 333 __attribute__((weak, alias("__vdso_clock_gettime")));
259 334
260notrace int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz) 335notrace int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz)
261{ 336{
262 long ret = VCLOCK_NONE;
263
264 if (likely(tv != NULL)) { 337 if (likely(tv != NULL)) {
265 BUILD_BUG_ON(offsetof(struct timeval, tv_usec) != 338 if (unlikely(do_realtime((struct timespec *)tv) == VCLOCK_NONE))
266 offsetof(struct timespec, tv_nsec) || 339 return vdso_fallback_gtod(tv, tz);
267 sizeof(*tv) != sizeof(struct timespec));
268 ret = do_realtime((struct timespec *)tv);
269 tv->tv_usec /= 1000; 340 tv->tv_usec /= 1000;
270 } 341 }
271 if (unlikely(tz != NULL)) { 342 if (unlikely(tz != NULL)) {
272 /* Avoid memcpy. Some old compilers fail to inline it */ 343 tz->tz_minuteswest = gtod->tz_minuteswest;
273 tz->tz_minuteswest = gtod->sys_tz.tz_minuteswest; 344 tz->tz_dsttime = gtod->tz_dsttime;
274 tz->tz_dsttime = gtod->sys_tz.tz_dsttime;
275 } 345 }
276 346
277 if (ret == VCLOCK_NONE)
278 return vdso_fallback_gtod(tv, tz);
279 return 0; 347 return 0;
280} 348}
281int gettimeofday(struct timeval *, struct timezone *) 349int gettimeofday(struct timeval *, struct timezone *)
@@ -287,8 +355,8 @@ int gettimeofday(struct timeval *, struct timezone *)
287 */ 355 */
288notrace time_t __vdso_time(time_t *t) 356notrace time_t __vdso_time(time_t *t)
289{ 357{
290 /* This is atomic on x86_64 so we don't need any locks. */ 358 /* This is atomic on x86 so we don't need any locks. */
291 time_t result = ACCESS_ONCE(VVAR(vsyscall_gtod_data).wall_time_sec); 359 time_t result = ACCESS_ONCE(gtod->wall_time_sec);
292 360
293 if (t) 361 if (t)
294 *t = result; 362 *t = result;
diff --git a/arch/x86/vdso/vdso-layout.lds.S b/arch/x86/vdso/vdso-layout.lds.S
index 634a2cf62046..2e263f367b13 100644
--- a/arch/x86/vdso/vdso-layout.lds.S
+++ b/arch/x86/vdso/vdso-layout.lds.S
@@ -6,7 +6,25 @@
6 6
7SECTIONS 7SECTIONS
8{ 8{
9 . = VDSO_PRELINK + SIZEOF_HEADERS; 9#ifdef BUILD_VDSO32
10#include <asm/vdso32.h>
11
12 .hpet_sect : {
13 hpet_page = . - VDSO_OFFSET(VDSO_HPET_PAGE);
14 } :text :hpet_sect
15
16 .vvar_sect : {
17 vvar = . - VDSO_OFFSET(VDSO_VVAR_PAGE);
18
19 /* Place all vvars at the offsets in asm/vvar.h. */
20#define EMIT_VVAR(name, offset) vvar_ ## name = vvar + offset;
21#define __VVAR_KERNEL_LDS
22#include <asm/vvar.h>
23#undef __VVAR_KERNEL_LDS
24#undef EMIT_VVAR
25 } :text :vvar_sect
26#endif
27 . = SIZEOF_HEADERS;
10 28
11 .hash : { *(.hash) } :text 29 .hash : { *(.hash) } :text
12 .gnu.hash : { *(.gnu.hash) } 30 .gnu.hash : { *(.gnu.hash) }
@@ -44,6 +62,11 @@ SECTIONS
44 . = ALIGN(0x100); 62 . = ALIGN(0x100);
45 63
46 .text : { *(.text*) } :text =0x90909090 64 .text : { *(.text*) } :text =0x90909090
65
66 /DISCARD/ : {
67 *(.discard)
68 *(.discard.*)
69 }
47} 70}
48 71
49/* 72/*
@@ -61,4 +84,8 @@ PHDRS
61 dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ 84 dynamic PT_DYNAMIC FLAGS(4); /* PF_R */
62 note PT_NOTE FLAGS(4); /* PF_R */ 85 note PT_NOTE FLAGS(4); /* PF_R */
63 eh_frame_hdr PT_GNU_EH_FRAME; 86 eh_frame_hdr PT_GNU_EH_FRAME;
87#ifdef BUILD_VDSO32
88 vvar_sect PT_NULL FLAGS(4); /* PF_R */
89 hpet_sect PT_NULL FLAGS(4); /* PF_R */
90#endif
64} 91}
diff --git a/arch/x86/vdso/vdso.S b/arch/x86/vdso/vdso.S
index 1e13eb8c9656..be3f23b09af5 100644
--- a/arch/x86/vdso/vdso.S
+++ b/arch/x86/vdso/vdso.S
@@ -1,21 +1,3 @@
1#include <asm/page_types.h> 1#include <asm/vdso.h>
2#include <linux/linkage.h>
3 2
4__PAGE_ALIGNED_DATA 3DEFINE_VDSO_IMAGE(vdso, "arch/x86/vdso/vdso.so")
5
6 .globl vdso_start, vdso_end
7 .align PAGE_SIZE
8vdso_start:
9 .incbin "arch/x86/vdso/vdso.so"
10vdso_end:
11 .align PAGE_SIZE /* extra data here leaks to userspace. */
12
13.previous
14
15 .globl vdso_pages
16 .bss
17 .align 8
18 .type vdso_pages, @object
19vdso_pages:
20 .zero (vdso_end - vdso_start + PAGE_SIZE - 1) / PAGE_SIZE * 8
21 .size vdso_pages, .-vdso_pages
diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c
index d6bfb876cfb0..00348980a3a6 100644
--- a/arch/x86/vdso/vdso32-setup.c
+++ b/arch/x86/vdso/vdso32-setup.c
@@ -16,6 +16,7 @@
16#include <linux/mm.h> 16#include <linux/mm.h>
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/slab.h>
19 20
20#include <asm/cpufeature.h> 21#include <asm/cpufeature.h>
21#include <asm/msr.h> 22#include <asm/msr.h>
@@ -25,17 +26,14 @@
25#include <asm/tlbflush.h> 26#include <asm/tlbflush.h>
26#include <asm/vdso.h> 27#include <asm/vdso.h>
27#include <asm/proto.h> 28#include <asm/proto.h>
28 29#include <asm/fixmap.h>
29enum { 30#include <asm/hpet.h>
30 VDSO_DISABLED = 0, 31#include <asm/vvar.h>
31 VDSO_ENABLED = 1,
32 VDSO_COMPAT = 2,
33};
34 32
35#ifdef CONFIG_COMPAT_VDSO 33#ifdef CONFIG_COMPAT_VDSO
36#define VDSO_DEFAULT VDSO_COMPAT 34#define VDSO_DEFAULT 0
37#else 35#else
38#define VDSO_DEFAULT VDSO_ENABLED 36#define VDSO_DEFAULT 1
39#endif 37#endif
40 38
41#ifdef CONFIG_X86_64 39#ifdef CONFIG_X86_64
@@ -44,13 +42,6 @@ enum {
44#endif 42#endif
45 43
46/* 44/*
47 * This is the difference between the prelinked addresses in the vDSO images
48 * and the VDSO_HIGH_BASE address where CONFIG_COMPAT_VDSO places the vDSO
49 * in the user address space.
50 */
51#define VDSO_ADDR_ADJUST (VDSO_HIGH_BASE - (unsigned long)VDSO32_PRELINK)
52
53/*
54 * Should the kernel map a VDSO page into processes and pass its 45 * Should the kernel map a VDSO page into processes and pass its
55 * address down to glibc upon exec()? 46 * address down to glibc upon exec()?
56 */ 47 */
@@ -60,6 +51,9 @@ static int __init vdso_setup(char *s)
60{ 51{
61 vdso_enabled = simple_strtoul(s, NULL, 0); 52 vdso_enabled = simple_strtoul(s, NULL, 0);
62 53
54 if (vdso_enabled > 1)
55 pr_warn("vdso32 values other than 0 and 1 are no longer allowed; vdso disabled\n");
56
63 return 1; 57 return 1;
64} 58}
65 59
@@ -76,124 +70,8 @@ __setup_param("vdso=", vdso32_setup, vdso_setup, 0);
76EXPORT_SYMBOL_GPL(vdso_enabled); 70EXPORT_SYMBOL_GPL(vdso_enabled);
77#endif 71#endif
78 72
79static __init void reloc_symtab(Elf32_Ehdr *ehdr, 73static struct page **vdso32_pages;
80 unsigned offset, unsigned size) 74static unsigned vdso32_size;
81{
82 Elf32_Sym *sym = (void *)ehdr + offset;
83 unsigned nsym = size / sizeof(*sym);
84 unsigned i;
85
86 for(i = 0; i < nsym; i++, sym++) {
87 if (sym->st_shndx == SHN_UNDEF ||
88 sym->st_shndx == SHN_ABS)
89 continue; /* skip */
90
91 if (sym->st_shndx > SHN_LORESERVE) {
92 printk(KERN_INFO "VDSO: unexpected st_shndx %x\n",
93 sym->st_shndx);
94 continue;
95 }
96
97 switch(ELF_ST_TYPE(sym->st_info)) {
98 case STT_OBJECT:
99 case STT_FUNC:
100 case STT_SECTION:
101 case STT_FILE:
102 sym->st_value += VDSO_ADDR_ADJUST;
103 }
104 }
105}
106
107static __init void reloc_dyn(Elf32_Ehdr *ehdr, unsigned offset)
108{
109 Elf32_Dyn *dyn = (void *)ehdr + offset;
110
111 for(; dyn->d_tag != DT_NULL; dyn++)
112 switch(dyn->d_tag) {
113 case DT_PLTGOT:
114 case DT_HASH:
115 case DT_STRTAB:
116 case DT_SYMTAB:
117 case DT_RELA:
118 case DT_INIT:
119 case DT_FINI:
120 case DT_REL:
121 case DT_DEBUG:
122 case DT_JMPREL:
123 case DT_VERSYM:
124 case DT_VERDEF:
125 case DT_VERNEED:
126 case DT_ADDRRNGLO ... DT_ADDRRNGHI:
127 /* definitely pointers needing relocation */
128 dyn->d_un.d_ptr += VDSO_ADDR_ADJUST;
129 break;
130
131 case DT_ENCODING ... OLD_DT_LOOS-1:
132 case DT_LOOS ... DT_HIOS-1:
133 /* Tags above DT_ENCODING are pointers if
134 they're even */
135 if (dyn->d_tag >= DT_ENCODING &&
136 (dyn->d_tag & 1) == 0)
137 dyn->d_un.d_ptr += VDSO_ADDR_ADJUST;
138 break;
139
140 case DT_VERDEFNUM:
141 case DT_VERNEEDNUM:
142 case DT_FLAGS_1:
143 case DT_RELACOUNT:
144 case DT_RELCOUNT:
145 case DT_VALRNGLO ... DT_VALRNGHI:
146 /* definitely not pointers */
147 break;
148
149 case OLD_DT_LOOS ... DT_LOOS-1:
150 case DT_HIOS ... DT_VALRNGLO-1:
151 default:
152 if (dyn->d_tag > DT_ENCODING)
153 printk(KERN_INFO "VDSO: unexpected DT_tag %x\n",
154 dyn->d_tag);
155 break;
156 }
157}
158
159static __init void relocate_vdso(Elf32_Ehdr *ehdr)
160{
161 Elf32_Phdr *phdr;
162 Elf32_Shdr *shdr;
163 int i;
164
165 BUG_ON(memcmp(ehdr->e_ident, ELFMAG, SELFMAG) != 0 ||
166 !elf_check_arch_ia32(ehdr) ||
167 ehdr->e_type != ET_DYN);
168
169 ehdr->e_entry += VDSO_ADDR_ADJUST;
170
171 /* rebase phdrs */
172 phdr = (void *)ehdr + ehdr->e_phoff;
173 for (i = 0; i < ehdr->e_phnum; i++) {
174 phdr[i].p_vaddr += VDSO_ADDR_ADJUST;
175
176 /* relocate dynamic stuff */
177 if (phdr[i].p_type == PT_DYNAMIC)
178 reloc_dyn(ehdr, phdr[i].p_offset);
179 }
180
181 /* rebase sections */
182 shdr = (void *)ehdr + ehdr->e_shoff;
183 for(i = 0; i < ehdr->e_shnum; i++) {
184 if (!(shdr[i].sh_flags & SHF_ALLOC))
185 continue;
186
187 shdr[i].sh_addr += VDSO_ADDR_ADJUST;
188
189 if (shdr[i].sh_type == SHT_SYMTAB ||
190 shdr[i].sh_type == SHT_DYNSYM)
191 reloc_symtab(ehdr, shdr[i].sh_offset,
192 shdr[i].sh_size);
193 }
194}
195
196static struct page *vdso32_pages[1];
197 75
198#ifdef CONFIG_X86_64 76#ifdef CONFIG_X86_64
199 77
@@ -212,12 +90,6 @@ void syscall32_cpu_init(void)
212 wrmsrl(MSR_CSTAR, ia32_cstar_target); 90 wrmsrl(MSR_CSTAR, ia32_cstar_target);
213} 91}
214 92
215#define compat_uses_vma 1
216
217static inline void map_compat_vdso(int map)
218{
219}
220
221#else /* CONFIG_X86_32 */ 93#else /* CONFIG_X86_32 */
222 94
223#define vdso32_sysenter() (boot_cpu_has(X86_FEATURE_SEP)) 95#define vdso32_sysenter() (boot_cpu_has(X86_FEATURE_SEP))
@@ -241,64 +113,36 @@ void enable_sep_cpu(void)
241 put_cpu(); 113 put_cpu();
242} 114}
243 115
244static struct vm_area_struct gate_vma;
245
246static int __init gate_vma_init(void)
247{
248 gate_vma.vm_mm = NULL;
249 gate_vma.vm_start = FIXADDR_USER_START;
250 gate_vma.vm_end = FIXADDR_USER_END;
251 gate_vma.vm_flags = VM_READ | VM_MAYREAD | VM_EXEC | VM_MAYEXEC;
252 gate_vma.vm_page_prot = __P101;
253
254 return 0;
255}
256
257#define compat_uses_vma 0
258
259static void map_compat_vdso(int map)
260{
261 static int vdso_mapped;
262
263 if (map == vdso_mapped)
264 return;
265
266 vdso_mapped = map;
267
268 __set_fixmap(FIX_VDSO, page_to_pfn(vdso32_pages[0]) << PAGE_SHIFT,
269 map ? PAGE_READONLY_EXEC : PAGE_NONE);
270
271 /* flush stray tlbs */
272 flush_tlb_all();
273}
274
275#endif /* CONFIG_X86_64 */ 116#endif /* CONFIG_X86_64 */
276 117
277int __init sysenter_setup(void) 118int __init sysenter_setup(void)
278{ 119{
279 void *syscall_page = (void *)get_zeroed_page(GFP_ATOMIC); 120 char *vdso32_start, *vdso32_end;
280 const void *vsyscall; 121 int npages, i;
281 size_t vsyscall_len;
282
283 vdso32_pages[0] = virt_to_page(syscall_page);
284
285#ifdef CONFIG_X86_32
286 gate_vma_init();
287#endif
288 122
123#ifdef CONFIG_COMPAT
289 if (vdso32_syscall()) { 124 if (vdso32_syscall()) {
290 vsyscall = &vdso32_syscall_start; 125 vdso32_start = vdso32_syscall_start;
291 vsyscall_len = &vdso32_syscall_end - &vdso32_syscall_start; 126 vdso32_end = vdso32_syscall_end;
292 } else if (vdso32_sysenter()){ 127 vdso32_pages = vdso32_syscall_pages;
293 vsyscall = &vdso32_sysenter_start; 128 } else
294 vsyscall_len = &vdso32_sysenter_end - &vdso32_sysenter_start; 129#endif
130 if (vdso32_sysenter()) {
131 vdso32_start = vdso32_sysenter_start;
132 vdso32_end = vdso32_sysenter_end;
133 vdso32_pages = vdso32_sysenter_pages;
295 } else { 134 } else {
296 vsyscall = &vdso32_int80_start; 135 vdso32_start = vdso32_int80_start;
297 vsyscall_len = &vdso32_int80_end - &vdso32_int80_start; 136 vdso32_end = vdso32_int80_end;
137 vdso32_pages = vdso32_int80_pages;
298 } 138 }
299 139
300 memcpy(syscall_page, vsyscall, vsyscall_len); 140 npages = ((vdso32_end - vdso32_start) + PAGE_SIZE - 1) / PAGE_SIZE;
301 relocate_vdso(syscall_page); 141 vdso32_size = npages << PAGE_SHIFT;
142 for (i = 0; i < npages; i++)
143 vdso32_pages[i] = virt_to_page(vdso32_start + i*PAGE_SIZE);
144
145 patch_vdso32(vdso32_start, vdso32_size);
302 146
303 return 0; 147 return 0;
304} 148}
@@ -309,48 +153,73 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
309 struct mm_struct *mm = current->mm; 153 struct mm_struct *mm = current->mm;
310 unsigned long addr; 154 unsigned long addr;
311 int ret = 0; 155 int ret = 0;
312 bool compat; 156 struct vm_area_struct *vma;
313 157
314#ifdef CONFIG_X86_X32_ABI 158#ifdef CONFIG_X86_X32_ABI
315 if (test_thread_flag(TIF_X32)) 159 if (test_thread_flag(TIF_X32))
316 return x32_setup_additional_pages(bprm, uses_interp); 160 return x32_setup_additional_pages(bprm, uses_interp);
317#endif 161#endif
318 162
319 if (vdso_enabled == VDSO_DISABLED) 163 if (vdso_enabled != 1) /* Other values all mean "disabled" */
320 return 0; 164 return 0;
321 165
322 down_write(&mm->mmap_sem); 166 down_write(&mm->mmap_sem);
323 167
324 /* Test compat mode once here, in case someone 168 addr = get_unmapped_area(NULL, 0, vdso32_size + VDSO_OFFSET(VDSO_PREV_PAGES), 0, 0);
325 changes it via sysctl */ 169 if (IS_ERR_VALUE(addr)) {
326 compat = (vdso_enabled == VDSO_COMPAT); 170 ret = addr;
171 goto up_fail;
172 }
173
174 addr += VDSO_OFFSET(VDSO_PREV_PAGES);
327 175
328 map_compat_vdso(compat); 176 current->mm->context.vdso = (void *)addr;
329 177
330 if (compat) 178 /*
331 addr = VDSO_HIGH_BASE; 179 * MAYWRITE to allow gdb to COW and set breakpoints
332 else { 180 */
333 addr = get_unmapped_area(NULL, 0, PAGE_SIZE, 0, 0); 181 ret = install_special_mapping(mm,
334 if (IS_ERR_VALUE(addr)) { 182 addr,
335 ret = addr; 183 vdso32_size,
336 goto up_fail; 184 VM_READ|VM_EXEC|
337 } 185 VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC,
186 vdso32_pages);
187
188 if (ret)
189 goto up_fail;
190
191 vma = _install_special_mapping(mm,
192 addr - VDSO_OFFSET(VDSO_PREV_PAGES),
193 VDSO_OFFSET(VDSO_PREV_PAGES),
194 VM_READ,
195 NULL);
196
197 if (IS_ERR(vma)) {
198 ret = PTR_ERR(vma);
199 goto up_fail;
338 } 200 }
339 201
340 current->mm->context.vdso = (void *)addr; 202 ret = remap_pfn_range(vma,
203 addr - VDSO_OFFSET(VDSO_VVAR_PAGE),
204 __pa_symbol(&__vvar_page) >> PAGE_SHIFT,
205 PAGE_SIZE,
206 PAGE_READONLY);
207
208 if (ret)
209 goto up_fail;
341 210
342 if (compat_uses_vma || !compat) { 211#ifdef CONFIG_HPET_TIMER
343 /* 212 if (hpet_address) {
344 * MAYWRITE to allow gdb to COW and set breakpoints 213 ret = io_remap_pfn_range(vma,
345 */ 214 addr - VDSO_OFFSET(VDSO_HPET_PAGE),
346 ret = install_special_mapping(mm, addr, PAGE_SIZE, 215 hpet_address >> PAGE_SHIFT,
347 VM_READ|VM_EXEC| 216 PAGE_SIZE,
348 VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC, 217 pgprot_noncached(PAGE_READONLY));
349 vdso32_pages);
350 218
351 if (ret) 219 if (ret)
352 goto up_fail; 220 goto up_fail;
353 } 221 }
222#endif
354 223
355 current_thread_info()->sysenter_return = 224 current_thread_info()->sysenter_return =
356 VDSO32_SYMBOL(addr, SYSENTER_RETURN); 225 VDSO32_SYMBOL(addr, SYSENTER_RETURN);
@@ -411,20 +280,12 @@ const char *arch_vma_name(struct vm_area_struct *vma)
411 280
412struct vm_area_struct *get_gate_vma(struct mm_struct *mm) 281struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
413{ 282{
414 /*
415 * Check to see if the corresponding task was created in compat vdso
416 * mode.
417 */
418 if (mm && mm->context.vdso == (void *)VDSO_HIGH_BASE)
419 return &gate_vma;
420 return NULL; 283 return NULL;
421} 284}
422 285
423int in_gate_area(struct mm_struct *mm, unsigned long addr) 286int in_gate_area(struct mm_struct *mm, unsigned long addr)
424{ 287{
425 const struct vm_area_struct *vma = get_gate_vma(mm); 288 return 0;
426
427 return vma && addr >= vma->vm_start && addr < vma->vm_end;
428} 289}
429 290
430int in_gate_area_no_mm(unsigned long addr) 291int in_gate_area_no_mm(unsigned long addr)
diff --git a/arch/x86/vdso/vdso32.S b/arch/x86/vdso/vdso32.S
index 2ce5f82c333b..018bcd9f97b4 100644
--- a/arch/x86/vdso/vdso32.S
+++ b/arch/x86/vdso/vdso32.S
@@ -1,22 +1,9 @@
1#include <linux/init.h> 1#include <asm/vdso.h>
2 2
3__INITDATA 3DEFINE_VDSO_IMAGE(vdso32_int80, "arch/x86/vdso/vdso32-int80.so")
4 4
5 .globl vdso32_int80_start, vdso32_int80_end
6vdso32_int80_start:
7 .incbin "arch/x86/vdso/vdso32-int80.so"
8vdso32_int80_end:
9
10 .globl vdso32_syscall_start, vdso32_syscall_end
11vdso32_syscall_start:
12#ifdef CONFIG_COMPAT 5#ifdef CONFIG_COMPAT
13 .incbin "arch/x86/vdso/vdso32-syscall.so" 6DEFINE_VDSO_IMAGE(vdso32_syscall, "arch/x86/vdso/vdso32-syscall.so")
14#endif 7#endif
15vdso32_syscall_end:
16
17 .globl vdso32_sysenter_start, vdso32_sysenter_end
18vdso32_sysenter_start:
19 .incbin "arch/x86/vdso/vdso32-sysenter.so"
20vdso32_sysenter_end:
21 8
22__FINIT 9DEFINE_VDSO_IMAGE(vdso32_sysenter, "arch/x86/vdso/vdso32-sysenter.so")
diff --git a/arch/x86/vdso/vdso32/vclock_gettime.c b/arch/x86/vdso/vdso32/vclock_gettime.c
new file mode 100644
index 000000000000..175cc72c0f68
--- /dev/null
+++ b/arch/x86/vdso/vdso32/vclock_gettime.c
@@ -0,0 +1,30 @@
1#define BUILD_VDSO32
2
3#ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE
4#undef CONFIG_OPTIMIZE_INLINING
5#endif
6
7#undef CONFIG_X86_PPRO_FENCE
8
9#ifdef CONFIG_X86_64
10
11/*
12 * in case of a 32 bit VDSO for a 64 bit kernel fake a 32 bit kernel
13 * configuration
14 */
15#undef CONFIG_64BIT
16#undef CONFIG_X86_64
17#undef CONFIG_ILLEGAL_POINTER_VALUE
18#undef CONFIG_SPARSEMEM_VMEMMAP
19#undef CONFIG_NR_CPUS
20
21#define CONFIG_X86_32 1
22#define CONFIG_PAGE_OFFSET 0
23#define CONFIG_ILLEGAL_POINTER_VALUE 0
24#define CONFIG_NR_CPUS 1
25
26#define BUILD_VDSO32_64
27
28#endif
29
30#include "../vclock_gettime.c"
diff --git a/arch/x86/vdso/vdso32/vdso32.lds.S b/arch/x86/vdso/vdso32/vdso32.lds.S
index 976124bb5f92..aadb8b9994cd 100644
--- a/arch/x86/vdso/vdso32/vdso32.lds.S
+++ b/arch/x86/vdso/vdso32/vdso32.lds.S
@@ -8,7 +8,11 @@
8 * values visible using the asm-x86/vdso.h macros from the kernel proper. 8 * values visible using the asm-x86/vdso.h macros from the kernel proper.
9 */ 9 */
10 10
11#include <asm/page.h>
12
13#define BUILD_VDSO32
11#define VDSO_PRELINK 0 14#define VDSO_PRELINK 0
15
12#include "../vdso-layout.lds.S" 16#include "../vdso-layout.lds.S"
13 17
14/* The ELF entry point can be used to set the AT_SYSINFO value. */ 18/* The ELF entry point can be used to set the AT_SYSINFO value. */
@@ -19,6 +23,13 @@ ENTRY(__kernel_vsyscall);
19 */ 23 */
20VERSION 24VERSION
21{ 25{
26 LINUX_2.6 {
27 global:
28 __vdso_clock_gettime;
29 __vdso_gettimeofday;
30 __vdso_time;
31 };
32
22 LINUX_2.5 { 33 LINUX_2.5 {
23 global: 34 global:
24 __kernel_vsyscall; 35 __kernel_vsyscall;
@@ -31,7 +42,9 @@ VERSION
31/* 42/*
32 * Symbols we define here called VDSO* get their values into vdso32-syms.h. 43 * Symbols we define here called VDSO* get their values into vdso32-syms.h.
33 */ 44 */
34VDSO32_PRELINK = VDSO_PRELINK;
35VDSO32_vsyscall = __kernel_vsyscall; 45VDSO32_vsyscall = __kernel_vsyscall;
36VDSO32_sigreturn = __kernel_sigreturn; 46VDSO32_sigreturn = __kernel_sigreturn;
37VDSO32_rt_sigreturn = __kernel_rt_sigreturn; 47VDSO32_rt_sigreturn = __kernel_rt_sigreturn;
48VDSO32_clock_gettime = clock_gettime;
49VDSO32_gettimeofday = gettimeofday;
50VDSO32_time = time;
diff --git a/arch/x86/vdso/vdsox32.S b/arch/x86/vdso/vdsox32.S
index 295f1c7543d8..f4aa34e7f370 100644
--- a/arch/x86/vdso/vdsox32.S
+++ b/arch/x86/vdso/vdsox32.S
@@ -1,21 +1,3 @@
1#include <asm/page_types.h> 1#include <asm/vdso.h>
2#include <linux/linkage.h>
3 2
4__PAGE_ALIGNED_DATA 3DEFINE_VDSO_IMAGE(vdsox32, "arch/x86/vdso/vdsox32.so")
5
6 .globl vdsox32_start, vdsox32_end
7 .align PAGE_SIZE
8vdsox32_start:
9 .incbin "arch/x86/vdso/vdsox32.so"
10vdsox32_end:
11 .align PAGE_SIZE /* extra data here leaks to userspace. */
12
13.previous
14
15 .globl vdsox32_pages
16 .bss
17 .align 8
18 .type vdsox32_pages, @object
19vdsox32_pages:
20 .zero (vdsox32_end - vdsox32_start + PAGE_SIZE - 1) / PAGE_SIZE * 8
21 .size vdsox32_pages, .-vdsox32_pages
diff --git a/arch/x86/vdso/vma.c b/arch/x86/vdso/vma.c
index 431e87544411..1ad102613127 100644
--- a/arch/x86/vdso/vma.c
+++ b/arch/x86/vdso/vma.c
@@ -16,20 +16,22 @@
16#include <asm/vdso.h> 16#include <asm/vdso.h>
17#include <asm/page.h> 17#include <asm/page.h>
18 18
19#if defined(CONFIG_X86_64)
19unsigned int __read_mostly vdso_enabled = 1; 20unsigned int __read_mostly vdso_enabled = 1;
20 21
21extern char vdso_start[], vdso_end[]; 22DECLARE_VDSO_IMAGE(vdso);
22extern unsigned short vdso_sync_cpuid; 23extern unsigned short vdso_sync_cpuid;
23
24extern struct page *vdso_pages[];
25static unsigned vdso_size; 24static unsigned vdso_size;
26 25
27#ifdef CONFIG_X86_X32_ABI 26#ifdef CONFIG_X86_X32_ABI
28extern char vdsox32_start[], vdsox32_end[]; 27DECLARE_VDSO_IMAGE(vdsox32);
29extern struct page *vdsox32_pages[];
30static unsigned vdsox32_size; 28static unsigned vdsox32_size;
29#endif
30#endif
31 31
32static void __init patch_vdsox32(void *vdso, size_t len) 32#if defined(CONFIG_X86_32) || defined(CONFIG_X86_X32_ABI) || \
33 defined(CONFIG_COMPAT)
34void __init patch_vdso32(void *vdso, size_t len)
33{ 35{
34 Elf32_Ehdr *hdr = vdso; 36 Elf32_Ehdr *hdr = vdso;
35 Elf32_Shdr *sechdrs, *alt_sec = 0; 37 Elf32_Shdr *sechdrs, *alt_sec = 0;
@@ -52,7 +54,7 @@ static void __init patch_vdsox32(void *vdso, size_t len)
52 } 54 }
53 55
54 /* If we get here, it's probably a bug. */ 56 /* If we get here, it's probably a bug. */
55 pr_warning("patch_vdsox32: .altinstructions not found\n"); 57 pr_warning("patch_vdso32: .altinstructions not found\n");
56 return; /* nothing to patch */ 58 return; /* nothing to patch */
57 59
58found: 60found:
@@ -61,6 +63,7 @@ found:
61} 63}
62#endif 64#endif
63 65
66#if defined(CONFIG_X86_64)
64static void __init patch_vdso64(void *vdso, size_t len) 67static void __init patch_vdso64(void *vdso, size_t len)
65{ 68{
66 Elf64_Ehdr *hdr = vdso; 69 Elf64_Ehdr *hdr = vdso;
@@ -104,7 +107,7 @@ static int __init init_vdso(void)
104 vdso_pages[i] = virt_to_page(vdso_start + i*PAGE_SIZE); 107 vdso_pages[i] = virt_to_page(vdso_start + i*PAGE_SIZE);
105 108
106#ifdef CONFIG_X86_X32_ABI 109#ifdef CONFIG_X86_X32_ABI
107 patch_vdsox32(vdsox32_start, vdsox32_end - vdsox32_start); 110 patch_vdso32(vdsox32_start, vdsox32_end - vdsox32_start);
108 npages = (vdsox32_end - vdsox32_start + PAGE_SIZE - 1) / PAGE_SIZE; 111 npages = (vdsox32_end - vdsox32_start + PAGE_SIZE - 1) / PAGE_SIZE;
109 vdsox32_size = npages << PAGE_SHIFT; 112 vdsox32_size = npages << PAGE_SHIFT;
110 for (i = 0; i < npages; i++) 113 for (i = 0; i < npages; i++)
@@ -204,3 +207,4 @@ static __init int vdso_setup(char *s)
204 return 0; 207 return 0;
205} 208}
206__setup("vdso=", vdso_setup); 209__setup("vdso=", vdso_setup);
210#endif
diff --git a/arch/x86/xen/Kconfig b/arch/x86/xen/Kconfig
index 01b90261fa38..e88fda867a33 100644
--- a/arch/x86/xen/Kconfig
+++ b/arch/x86/xen/Kconfig
@@ -7,7 +7,7 @@ config XEN
7 depends on PARAVIRT 7 depends on PARAVIRT
8 select PARAVIRT_CLOCK 8 select PARAVIRT_CLOCK
9 select XEN_HAVE_PVMMU 9 select XEN_HAVE_PVMMU
10 depends on X86_64 || (X86_32 && X86_PAE && !X86_VISWS) 10 depends on X86_64 || (X86_32 && X86_PAE)
11 depends on X86_TSC 11 depends on X86_TSC
12 help 12 help
13 This is the Linux Xen port. Enabling this will allow the 13 This is the Linux Xen port. Enabling this will allow the
@@ -19,11 +19,6 @@ config XEN_DOM0
19 depends on XEN && PCI_XEN && SWIOTLB_XEN 19 depends on XEN && PCI_XEN && SWIOTLB_XEN
20 depends on X86_LOCAL_APIC && X86_IO_APIC && ACPI && PCI 20 depends on X86_LOCAL_APIC && X86_IO_APIC && ACPI && PCI
21 21
22# Dummy symbol since people have come to rely on the PRIVILEGED_GUEST
23# name in tools.
24config XEN_PRIVILEGED_GUEST
25 def_bool XEN_DOM0
26
27config XEN_PVHVM 22config XEN_PVHVM
28 def_bool y 23 def_bool y
29 depends on XEN && PCI && X86_LOCAL_APIC 24 depends on XEN && PCI && X86_LOCAL_APIC
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 2423ef04ffea..86e02eabb640 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -2058,7 +2058,6 @@ static void xen_set_fixmap(unsigned idx, phys_addr_t phys, pgprot_t prot)
2058 case FIX_RO_IDT: 2058 case FIX_RO_IDT:
2059#ifdef CONFIG_X86_32 2059#ifdef CONFIG_X86_32
2060 case FIX_WP_TEST: 2060 case FIX_WP_TEST:
2061 case FIX_VDSO:
2062# ifdef CONFIG_HIGHMEM 2061# ifdef CONFIG_HIGHMEM
2063 case FIX_KMAP_BEGIN ... FIX_KMAP_END: 2062 case FIX_KMAP_BEGIN ... FIX_KMAP_END:
2064# endif 2063# endif
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index 696c694986d0..85e5d78c9874 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -881,6 +881,65 @@ static unsigned long mfn_hash(unsigned long mfn)
881 return hash_long(mfn, M2P_OVERRIDE_HASH_SHIFT); 881 return hash_long(mfn, M2P_OVERRIDE_HASH_SHIFT);
882} 882}
883 883
884int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
885 struct gnttab_map_grant_ref *kmap_ops,
886 struct page **pages, unsigned int count)
887{
888 int i, ret = 0;
889 bool lazy = false;
890 pte_t *pte;
891
892 if (xen_feature(XENFEAT_auto_translated_physmap))
893 return 0;
894
895 if (kmap_ops &&
896 !in_interrupt() &&
897 paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) {
898 arch_enter_lazy_mmu_mode();
899 lazy = true;
900 }
901
902 for (i = 0; i < count; i++) {
903 unsigned long mfn, pfn;
904
905 /* Do not add to override if the map failed. */
906 if (map_ops[i].status)
907 continue;
908
909 if (map_ops[i].flags & GNTMAP_contains_pte) {
910 pte = (pte_t *) (mfn_to_virt(PFN_DOWN(map_ops[i].host_addr)) +
911 (map_ops[i].host_addr & ~PAGE_MASK));
912 mfn = pte_mfn(*pte);
913 } else {
914 mfn = PFN_DOWN(map_ops[i].dev_bus_addr);
915 }
916 pfn = page_to_pfn(pages[i]);
917
918 WARN_ON(PagePrivate(pages[i]));
919 SetPagePrivate(pages[i]);
920 set_page_private(pages[i], mfn);
921 pages[i]->index = pfn_to_mfn(pfn);
922
923 if (unlikely(!set_phys_to_machine(pfn, FOREIGN_FRAME(mfn)))) {
924 ret = -ENOMEM;
925 goto out;
926 }
927
928 if (kmap_ops) {
929 ret = m2p_add_override(mfn, pages[i], &kmap_ops[i]);
930 if (ret)
931 goto out;
932 }
933 }
934
935out:
936 if (lazy)
937 arch_leave_lazy_mmu_mode();
938
939 return ret;
940}
941EXPORT_SYMBOL_GPL(set_foreign_p2m_mapping);
942
884/* Add an MFN override for a particular page */ 943/* Add an MFN override for a particular page */
885int m2p_add_override(unsigned long mfn, struct page *page, 944int m2p_add_override(unsigned long mfn, struct page *page,
886 struct gnttab_map_grant_ref *kmap_op) 945 struct gnttab_map_grant_ref *kmap_op)
@@ -899,13 +958,6 @@ int m2p_add_override(unsigned long mfn, struct page *page,
899 "m2p_add_override: pfn %lx not mapped", pfn)) 958 "m2p_add_override: pfn %lx not mapped", pfn))
900 return -EINVAL; 959 return -EINVAL;
901 } 960 }
902 WARN_ON(PagePrivate(page));
903 SetPagePrivate(page);
904 set_page_private(page, mfn);
905 page->index = pfn_to_mfn(pfn);
906
907 if (unlikely(!set_phys_to_machine(pfn, FOREIGN_FRAME(mfn))))
908 return -ENOMEM;
909 961
910 if (kmap_op != NULL) { 962 if (kmap_op != NULL) {
911 if (!PageHighMem(page)) { 963 if (!PageHighMem(page)) {
@@ -943,20 +995,62 @@ int m2p_add_override(unsigned long mfn, struct page *page,
943 return 0; 995 return 0;
944} 996}
945EXPORT_SYMBOL_GPL(m2p_add_override); 997EXPORT_SYMBOL_GPL(m2p_add_override);
998
999int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops,
1000 struct gnttab_map_grant_ref *kmap_ops,
1001 struct page **pages, unsigned int count)
1002{
1003 int i, ret = 0;
1004 bool lazy = false;
1005
1006 if (xen_feature(XENFEAT_auto_translated_physmap))
1007 return 0;
1008
1009 if (kmap_ops &&
1010 !in_interrupt() &&
1011 paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) {
1012 arch_enter_lazy_mmu_mode();
1013 lazy = true;
1014 }
1015
1016 for (i = 0; i < count; i++) {
1017 unsigned long mfn = get_phys_to_machine(page_to_pfn(pages[i]));
1018 unsigned long pfn = page_to_pfn(pages[i]);
1019
1020 if (mfn == INVALID_P2M_ENTRY || !(mfn & FOREIGN_FRAME_BIT)) {
1021 ret = -EINVAL;
1022 goto out;
1023 }
1024
1025 set_page_private(pages[i], INVALID_P2M_ENTRY);
1026 WARN_ON(!PagePrivate(pages[i]));
1027 ClearPagePrivate(pages[i]);
1028 set_phys_to_machine(pfn, pages[i]->index);
1029
1030 if (kmap_ops)
1031 ret = m2p_remove_override(pages[i], &kmap_ops[i], mfn);
1032 if (ret)
1033 goto out;
1034 }
1035
1036out:
1037 if (lazy)
1038 arch_leave_lazy_mmu_mode();
1039 return ret;
1040}
1041EXPORT_SYMBOL_GPL(clear_foreign_p2m_mapping);
1042
946int m2p_remove_override(struct page *page, 1043int m2p_remove_override(struct page *page,
947 struct gnttab_map_grant_ref *kmap_op) 1044 struct gnttab_map_grant_ref *kmap_op,
1045 unsigned long mfn)
948{ 1046{
949 unsigned long flags; 1047 unsigned long flags;
950 unsigned long mfn;
951 unsigned long pfn; 1048 unsigned long pfn;
952 unsigned long uninitialized_var(address); 1049 unsigned long uninitialized_var(address);
953 unsigned level; 1050 unsigned level;
954 pte_t *ptep = NULL; 1051 pte_t *ptep = NULL;
955 1052
956 pfn = page_to_pfn(page); 1053 pfn = page_to_pfn(page);
957 mfn = get_phys_to_machine(pfn);
958 if (mfn == INVALID_P2M_ENTRY || !(mfn & FOREIGN_FRAME_BIT))
959 return -EINVAL;
960 1054
961 if (!PageHighMem(page)) { 1055 if (!PageHighMem(page)) {
962 address = (unsigned long)__va(pfn << PAGE_SHIFT); 1056 address = (unsigned long)__va(pfn << PAGE_SHIFT);
@@ -970,10 +1064,7 @@ int m2p_remove_override(struct page *page,
970 spin_lock_irqsave(&m2p_override_lock, flags); 1064 spin_lock_irqsave(&m2p_override_lock, flags);
971 list_del(&page->lru); 1065 list_del(&page->lru);
972 spin_unlock_irqrestore(&m2p_override_lock, flags); 1066 spin_unlock_irqrestore(&m2p_override_lock, flags);
973 WARN_ON(!PagePrivate(page));
974 ClearPagePrivate(page);
975 1067
976 set_phys_to_machine(pfn, page->index);
977 if (kmap_op != NULL) { 1068 if (kmap_op != NULL) {
978 if (!PageHighMem(page)) { 1069 if (!PageHighMem(page)) {
979 struct multicall_space mcs; 1070 struct multicall_space mcs;
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index c87ae7c6e5f9..02d6d29a63c1 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -41,7 +41,7 @@ config ARCH_HAS_ILOG2_U32
41config ARCH_HAS_ILOG2_U64 41config ARCH_HAS_ILOG2_U64
42 def_bool n 42 def_bool n
43 43
44config NO_IOPORT 44config NO_IOPORT_MAP
45 def_bool n 45 def_bool n
46 46
47config HZ 47config HZ
@@ -239,7 +239,7 @@ config XTENSA_PLATFORM_XT2000
239config XTENSA_PLATFORM_S6105 239config XTENSA_PLATFORM_S6105
240 bool "S6105" 240 bool "S6105"
241 select SERIAL_CONSOLE 241 select SERIAL_CONSOLE
242 select NO_IOPORT 242 select NO_IOPORT_MAP
243 243
244config XTENSA_PLATFORM_XTFPGA 244config XTENSA_PLATFORM_XTFPGA
245 bool "XTFPGA" 245 bool "XTFPGA"
diff --git a/arch/xtensa/configs/iss_defconfig b/arch/xtensa/configs/iss_defconfig
index 4f233204faf9..1493c68352d1 100644
--- a/arch/xtensa/configs/iss_defconfig
+++ b/arch/xtensa/configs/iss_defconfig
@@ -11,7 +11,7 @@ CONFIG_GENERIC_FIND_NEXT_BIT=y
11CONFIG_GENERIC_HWEIGHT=y 11CONFIG_GENERIC_HWEIGHT=y
12# CONFIG_ARCH_HAS_ILOG2_U32 is not set 12# CONFIG_ARCH_HAS_ILOG2_U32 is not set
13# CONFIG_ARCH_HAS_ILOG2_U64 is not set 13# CONFIG_ARCH_HAS_ILOG2_U64 is not set
14CONFIG_NO_IOPORT=y 14CONFIG_NO_IOPORT_MAP=y
15CONFIG_HZ=100 15CONFIG_HZ=100
16CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 16CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
17CONFIG_CONSTRUCTORS=y 17CONFIG_CONSTRUCTORS=y
@@ -627,7 +627,6 @@ CONFIG_SCHED_DEBUG=y
627# CONFIG_DEBUG_KOBJECT is not set 627# CONFIG_DEBUG_KOBJECT is not set
628# CONFIG_DEBUG_INFO is not set 628# CONFIG_DEBUG_INFO is not set
629# CONFIG_DEBUG_VM is not set 629# CONFIG_DEBUG_VM is not set
630# CONFIG_DEBUG_WRITECOUNT is not set
631# CONFIG_DEBUG_MEMORY_INIT is not set 630# CONFIG_DEBUG_MEMORY_INIT is not set
632# CONFIG_DEBUG_LIST is not set 631# CONFIG_DEBUG_LIST is not set
633# CONFIG_DEBUG_SG is not set 632# CONFIG_DEBUG_SG is not set
diff --git a/arch/xtensa/configs/s6105_defconfig b/arch/xtensa/configs/s6105_defconfig
index d929f77a0360..12a492ab6d17 100644
--- a/arch/xtensa/configs/s6105_defconfig
+++ b/arch/xtensa/configs/s6105_defconfig
@@ -11,7 +11,7 @@ CONFIG_GENERIC_FIND_NEXT_BIT=y
11CONFIG_GENERIC_HWEIGHT=y 11CONFIG_GENERIC_HWEIGHT=y
12# CONFIG_ARCH_HAS_ILOG2_U32 is not set 12# CONFIG_ARCH_HAS_ILOG2_U32 is not set
13# CONFIG_ARCH_HAS_ILOG2_U64 is not set 13# CONFIG_ARCH_HAS_ILOG2_U64 is not set
14CONFIG_NO_IOPORT=y 14CONFIG_NO_IOPORT_MAP=y
15CONFIG_HZ=100 15CONFIG_HZ=100
16CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 16CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
17 17
@@ -569,7 +569,6 @@ CONFIG_DEBUG_SPINLOCK_SLEEP=y
569# CONFIG_DEBUG_INFO is not set 569# CONFIG_DEBUG_INFO is not set
570# CONFIG_DEBUG_VM is not set 570# CONFIG_DEBUG_VM is not set
571CONFIG_DEBUG_NOMMU_REGIONS=y 571CONFIG_DEBUG_NOMMU_REGIONS=y
572# CONFIG_DEBUG_WRITECOUNT is not set
573# CONFIG_DEBUG_MEMORY_INIT is not set 572# CONFIG_DEBUG_MEMORY_INIT is not set
574# CONFIG_DEBUG_LIST is not set 573# CONFIG_DEBUG_LIST is not set
575# CONFIG_DEBUG_SG is not set 574# CONFIG_DEBUG_SG is not set