summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSipke Vriend <sipke.vriend@xilinx.com>2013-11-08 15:25:33 +1000
committerSipke Vriend <sipke.vriend@xilinx.com>2013-11-08 15:25:33 +1000
commit788bdc90aa2487185af0f39a0ec9d56112b708bb (patch)
treeeb085a9003579de0cd7912d64fc86c815156952c
parentd1d4114ef94c54ee1d22b956d9f66c0220a575e7 (diff)
downloadmeta-xilinx-788bdc90aa2487185af0f39a0ec9d56112b708bb.tar.gz
recipes-kernel:linux-yocto: Adjust xlnx_3.8 patch file.
Adjust patch file to match new linux-xlnx_3.8 SRCREV. Also remove now redundant patch (included in adjusted patch). Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com>
-rw-r--r--recipes-kernel/linux/linux-yocto/xlnx_3.8/0001-Forward-code-to-match-xlnx_3.8-branch-on-linux_xlnx..patch1879
-rw-r--r--recipes-kernel/linux/linux-yocto/xlnx_3.8/0002-microblaze-Dont-mark-arch_kgdb_ops-as-const.patch35
-rw-r--r--recipes-kernel/linux/linux-yocto/xlnx_3.8_modifications_to_v14.5.scc1
3 files changed, 1799 insertions, 116 deletions
diff --git a/recipes-kernel/linux/linux-yocto/xlnx_3.8/0001-Forward-code-to-match-xlnx_3.8-branch-on-linux_xlnx..patch b/recipes-kernel/linux/linux-yocto/xlnx_3.8/0001-Forward-code-to-match-xlnx_3.8-branch-on-linux_xlnx..patch
index 27c237cf..3166bbb0 100644
--- a/recipes-kernel/linux/linux-yocto/xlnx_3.8/0001-Forward-code-to-match-xlnx_3.8-branch-on-linux_xlnx..patch
+++ b/recipes-kernel/linux/linux-yocto/xlnx_3.8/0001-Forward-code-to-match-xlnx_3.8-branch-on-linux_xlnx..patch
@@ -1,6 +1,6 @@
1From d4b1e64e45771480df527ff7890be14fce90a61d Mon Sep 17 00:00:00 2001 1From bcc57cd6e8484be41c996fd98702d360191c3b98 Mon Sep 17 00:00:00 2001
2From: Sipke Vriend <sipke.vriend@xilinx.com> 2From: Sipke Vriend <sipke.vriend@xilinx.com>
3Date: Fri, 25 Oct 2013 10:26:31 +1000 3Date: Fri, 8 Nov 2013 14:47:49 +1000
4Subject: [PATCH] Forward code to match xlnx_3.8 branch on linux_xlnx.git 4Subject: [PATCH] Forward code to match xlnx_3.8 branch on linux_xlnx.git
5 5
6Forward to commit id 7a65c6dd165a8fc052ba0321eb706536e6cbef71 6Forward to commit id 7a65c6dd165a8fc052ba0321eb706536e6cbef71
@@ -11,6 +11,9 @@ Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com>
11 Documentation/ABI/testing/debugfs-aufs | 37 - 11 Documentation/ABI/testing/debugfs-aufs | 37 -
12 Documentation/ABI/testing/sysfs-aufs | 24 - 12 Documentation/ABI/testing/sysfs-aufs | 24 -
13 .../devicetree/bindings/clock/zynq-7000.txt | 122 +- 13 .../devicetree/bindings/clock/zynq-7000.txt | 122 +-
14 .../devicetree/bindings/gpio/gpio-xilinx.txt | 50 +
15 .../bindings/remoteproc/mb_remoteproc.txt | 46 +
16 Documentation/driver-model/devres.txt | 3 +-
14 Documentation/filesystems/aufs/README | 333 -- 17 Documentation/filesystems/aufs/README | 333 --
15 Documentation/filesystems/aufs/design/01intro.txt | 162 - 18 Documentation/filesystems/aufs/design/01intro.txt | 162 -
16 Documentation/filesystems/aufs/design/02struct.txt | 226 - 19 Documentation/filesystems/aufs/design/02struct.txt | 226 -
@@ -45,13 +48,15 @@ Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com>
45 arch/arm/boot/dts/zynq-zc770-xm012.dts | 472 +- 48 arch/arm/boot/dts/zynq-zc770-xm012.dts | 472 +-
46 arch/arm/boot/dts/zynq-zc770-xm013.dts | 509 +- 49 arch/arm/boot/dts/zynq-zc770-xm013.dts | 509 +-
47 arch/arm/boot/dts/zynq-zed.dts | 234 +- 50 arch/arm/boot/dts/zynq-zed.dts | 234 +-
51 arch/arm/common/gic.c | 1 +
48 arch/arm/configs/at91sam9g45_defconfig | 1 + 52 arch/arm/configs/at91sam9g45_defconfig | 1 +
49 arch/arm/configs/xilinx_zynq_apf_defconfig | 2954 ++++++++++++ 53 arch/arm/configs/xilinx_zynq_apf_defconfig | 2954 ++++++++++++
50 arch/arm/configs/xilinx_zynq_base_trd_defconfig | 2843 +++++++++++ 54 arch/arm/configs/xilinx_zynq_base_trd_defconfig | 2843 +++++++++++
51 arch/arm/configs/xilinx_zynq_defconfig | 15 +- 55 arch/arm/configs/xilinx_zynq_defconfig | 15 +-
56 arch/arm/include/asm/mach/irq.h | 31 -
52 arch/arm/include/asm/pgtable.h | 9 - 57 arch/arm/include/asm/pgtable.h | 9 -
53 arch/arm/kernel/entry-common.S | 3 +- 58 arch/arm/kernel/entry-common.S | 3 +-
54 arch/arm/lib/memset.S | 33 +- 59 arch/arm/mach-at91/gpio.c | 3 +-
55 arch/arm/mach-at91/setup.c | 2 +- 60 arch/arm/mach-at91/setup.c | 2 +-
56 arch/arm/mach-imx/headsmp.S | 47 - 61 arch/arm/mach-imx/headsmp.S | 47 -
57 arch/arm/mach-omap2/cpuidle34xx.c | 5 +- 62 arch/arm/mach-omap2/cpuidle34xx.c | 5 +-
@@ -70,6 +75,8 @@ Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com>
70 arch/arm/mach-zynq/xaxipcie.c | 2 - 75 arch/arm/mach-zynq/xaxipcie.c | 2 -
71 arch/arm/mm/cache-v7.S | 46 + 76 arch/arm/mm/cache-v7.S | 46 +
72 arch/arm/mm/fault.c | 13 +- 77 arch/arm/mm/fault.c | 13 +-
78 arch/arm/plat-samsung/irq-vic-timer.c | 3 +-
79 arch/arm/plat-samsung/s5p-irq-gpioint.c | 3 +-
73 arch/arm/xen/enlighten.c | 2 +- 80 arch/arm/xen/enlighten.c | 2 +-
74 arch/arm64/mm/fault.c | 3 +- 81 arch/arm64/mm/fault.c | 3 +-
75 arch/avr32/configs/favr-32_defconfig | 1 + 82 arch/avr32/configs/favr-32_defconfig | 1 +
@@ -79,6 +86,7 @@ Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com>
79 arch/ia64/kernel/irq.c | 8 - 86 arch/ia64/kernel/irq.c | 8 -
80 arch/ia64/kernel/mca.c | 37 +- 87 arch/ia64/kernel/mca.c | 37 +-
81 arch/ia64/kvm/vtlb.c | 2 +- 88 arch/ia64/kvm/vtlb.c | 2 +-
89 arch/microblaze/Kconfig | 4 -
82 arch/microblaze/configs/mmu_defconfig | 1 - 90 arch/microblaze/configs/mmu_defconfig | 1 -
83 arch/microblaze/include/asm/io.h | 2 +- 91 arch/microblaze/include/asm/io.h | 2 +-
84 arch/microblaze/include/asm/pci.h | 2 - 92 arch/microblaze/include/asm/pci.h | 2 -
@@ -90,10 +98,9 @@ Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com>
90 arch/microblaze/kernel/early_printk.c | 17 +- 98 arch/microblaze/kernel/early_printk.c | 17 +-
91 arch/microblaze/kernel/exceptions.c | 27 +- 99 arch/microblaze/kernel/exceptions.c | 27 +-
92 arch/microblaze/kernel/ftrace.c | 44 +- 100 arch/microblaze/kernel/ftrace.c | 44 +-
93 arch/microblaze/kernel/head.S | 4 +- 101 arch/microblaze/kernel/head.S | 6 +-
94 arch/microblaze/kernel/heartbeat.c | 2 +- 102 arch/microblaze/kernel/heartbeat.c | 2 +-
95 arch/microblaze/kernel/intc.c | 4 +- 103 arch/microblaze/kernel/intc.c | 4 +-
96 arch/microblaze/kernel/kgdb.c | 2 +-
97 arch/microblaze/kernel/microblaze_ksyms.c | 2 +- 104 arch/microblaze/kernel/microblaze_ksyms.c | 2 +-
98 arch/microblaze/kernel/module.c | 5 +- 105 arch/microblaze/kernel/module.c | 5 +-
99 arch/microblaze/kernel/process.c | 24 +- 106 arch/microblaze/kernel/process.c | 24 +-
@@ -167,8 +174,16 @@ Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com>
167 drivers/clk/zynq/pll.c | 243 + 174 drivers/clk/zynq/pll.c | 243 +
168 drivers/cpufreq/zynq-cpufreq.c | 45 +- 175 drivers/cpufreq/zynq-cpufreq.c | 45 +-
169 drivers/edac/edac_mc_sysfs.c | 12 +- 176 drivers/edac/edac_mc_sysfs.c | 12 +-
177 drivers/gpio/Kconfig | 1 +
178 drivers/gpio/gpio-msm-v2.c | 3 +-
179 drivers/gpio/gpio-mxc.c | 2 +-
180 drivers/gpio/gpio-omap.c | 3 +-
181 drivers/gpio/gpio-pl061.c | 2 +-
182 drivers/gpio/gpio-pxa.c | 3 +-
170 drivers/gpio/gpio-sch.c | 37 +- 183 drivers/gpio/gpio-sch.c | 37 +-
171 drivers/gpio/gpio-xilinxps.c | 7 +- 184 drivers/gpio/gpio-tegra.c | 3 +-
185 drivers/gpio/gpio-xilinx.c | 412 +-
186 drivers/gpio/gpio-xilinxps.c | 9 +-
172 drivers/gpu/drm/ast/ast_drv.h | 2 - 187 drivers/gpu/drm/ast/ast_drv.h | 2 -
173 drivers/gpu/drm/ast/ast_fb.c | 43 +- 188 drivers/gpu/drm/ast/ast_fb.c | 43 +-
174 drivers/gpu/drm/ast/ast_ttm.c | 2 +- 189 drivers/gpu/drm/ast/ast_ttm.c | 2 +-
@@ -241,8 +256,13 @@ Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com>
241 drivers/net/wireless/rt2x00/rt2800lib.c | 8 +- 256 drivers/net/wireless/rt2x00/rt2800lib.c | 8 +-
242 drivers/pci/pci-driver.c | 4 - 257 drivers/pci/pci-driver.c | 4 -
243 drivers/pci/pci.c | 12 +- 258 drivers/pci/pci.c | 12 +-
259 drivers/pinctrl/pinctrl-at91.c | 3 +-
260 drivers/pinctrl/pinctrl-exynos.c | 3 +-
261 drivers/pinctrl/pinctrl-sirf.c | 2 +-
262 drivers/pinctrl/spear/pinctrl-plgpio.c | 2 +-
244 drivers/pwm/pwm-spear.c | 6 +- 263 drivers/pwm/pwm-spear.c | 6 +-
245 drivers/remoteproc/Kconfig | 5 +- 264 drivers/remoteproc/Kconfig | 5 +
265 drivers/remoteproc/mb_remoteproc.c | 291 +-
246 drivers/rpmsg/rpmsg_freertos_statistic.c | 1 - 266 drivers/rpmsg/rpmsg_freertos_statistic.c | 1 -
247 drivers/rtc/rtc-cmos.c | 4 +- 267 drivers/rtc/rtc-cmos.c | 4 +-
248 drivers/s390/char/sclp_cmd.c | 4 +- 268 drivers/s390/char/sclp_cmd.c | 4 +-
@@ -260,6 +280,7 @@ Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com>
260 drivers/staging/apf/xlnk-ioctl.h | 39 + 280 drivers/staging/apf/xlnk-ioctl.h | 39 +
261 drivers/staging/apf/xlnk.c | 1261 +++++ 281 drivers/staging/apf/xlnk.c | 1261 +++++
262 drivers/staging/apf/xlnk.h | 116 + 282 drivers/staging/apf/xlnk.h | 116 +
283 drivers/staging/imx-drm/ipu-v3/ipu-common.c | 2 +-
263 drivers/staging/video/axivdma/Kconfig | 16 + 284 drivers/staging/video/axivdma/Kconfig | 16 +
264 drivers/staging/video/axivdma/Makefile | 1 + 285 drivers/staging/video/axivdma/Makefile | 1 +
265 drivers/staging/video/axivdma/xvdma.c | 440 ++ 286 drivers/staging/video/axivdma/xvdma.c | 440 ++
@@ -461,9 +482,11 @@ Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com>
461 include/linux/clk-provider.h | 8 +- 482 include/linux/clk-provider.h | 8 +-
462 include/linux/clk.h | 22 +- 483 include/linux/clk.h | 22 +-
463 include/linux/clk/zynq.h | 28 +- 484 include/linux/clk/zynq.h | 28 +-
485 include/linux/device.h | 1 +
464 include/linux/fs.h | 1 - 486 include/linux/fs.h | 1 -
465 include/linux/hugetlb.h | 19 +- 487 include/linux/hugetlb.h | 19 +-
466 include/linux/ipc_namespace.h | 2 +- 488 include/linux/ipc_namespace.h | 2 +-
489 include/linux/irqchip/chained_irq.h | 52 +
467 include/linux/jbd2.h | 2 - 490 include/linux/jbd2.h | 2 -
468 include/linux/mm_types.h | 2 - 491 include/linux/mm_types.h | 2 -
469 include/linux/nfs_fs_sb.h | 3 - 492 include/linux/nfs_fs_sb.h | 3 -
@@ -494,6 +517,7 @@ Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com>
494 kernel/trace/trace_stack.c | 76 +- 517 kernel/trace/trace_stack.c | 76 +-
495 kernel/trace/trace_stat.c | 2 - 518 kernel/trace/trace_stat.c | 2 -
496 kernel/uptime_limit.c | 166 - 519 kernel/uptime_limit.c | 166 -
520 lib/devres.c | 58 +-
497 lib/oid_registry.c | 5 - 521 lib/oid_registry.c | 5 -
498 mm/memory.c | 2 - 522 mm/memory.c | 2 -
499 mm/mmap.c | 21 +- 523 mm/mmap.c | 21 +-
@@ -512,6 +536,7 @@ Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com>
512 net/netfilter/nf_conntrack_sip.c | 2 +- 536 net/netfilter/nf_conntrack_sip.c | 2 +-
513 net/netfilter/nf_nat_core.c | 40 +- 537 net/netfilter/nf_nat_core.c | 40 +-
514 net/wireless/reg.c | 2 +- 538 net/wireless/reg.c | 2 +-
539 scripts/coccinelle/api/devm_ioremap_resource.cocci | 90 +
515 scripts/kconfig/streamline_config.pl | 17 +- 540 scripts/kconfig/streamline_config.pl | 17 +-
516 scripts/mod/modpost.c | 6 +- 541 scripts/mod/modpost.c | 6 +-
517 security/commoncap.c | 2 - 542 security/commoncap.c | 2 -
@@ -541,9 +566,11 @@ Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com>
541 tools/perf/util/include/linux/compiler.h | 1 - 566 tools/perf/util/include/linux/compiler.h | 1 -
542 .../util/scripting-engines/trace-event-python.c | 4 - 567 .../util/scripting-engines/trace-event-python.c | 4 -
543 usr/Makefile | 2 +- 568 usr/Makefile | 2 +-
544 533 files changed, 15818 insertions(+), 53168 deletions(-) 569 558 files changed, 16640 insertions(+), 53392 deletions(-)
545 delete mode 100644 Documentation/ABI/testing/debugfs-aufs 570 delete mode 100644 Documentation/ABI/testing/debugfs-aufs
546 delete mode 100644 Documentation/ABI/testing/sysfs-aufs 571 delete mode 100644 Documentation/ABI/testing/sysfs-aufs
572 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-xilinx.txt
573 create mode 100644 Documentation/devicetree/bindings/remoteproc/mb_remoteproc.txt
547 delete mode 100644 Documentation/filesystems/aufs/README 574 delete mode 100644 Documentation/filesystems/aufs/README
548 delete mode 100644 Documentation/filesystems/aufs/design/01intro.txt 575 delete mode 100644 Documentation/filesystems/aufs/design/01intro.txt
549 delete mode 100644 Documentation/filesystems/aufs/design/02struct.txt 576 delete mode 100644 Documentation/filesystems/aufs/design/02struct.txt
@@ -693,8 +720,10 @@ Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com>
693 delete mode 100644 fs/yaffs2/yaffs_yaffs2.h 720 delete mode 100644 fs/yaffs2/yaffs_yaffs2.h
694 delete mode 100644 fs/yaffs2/yportenv.h 721 delete mode 100644 fs/yaffs2/yportenv.h
695 delete mode 100644 include/linux/aufs_type.h 722 delete mode 100644 include/linux/aufs_type.h
723 create mode 100644 include/linux/irqchip/chained_irq.h
696 delete mode 100644 include/uapi/linux/aufs_type.h 724 delete mode 100644 include/uapi/linux/aufs_type.h
697 delete mode 100644 kernel/uptime_limit.c 725 delete mode 100644 kernel/uptime_limit.c
726 create mode 100644 scripts/coccinelle/api/devm_ioremap_resource.cocci
698 727
699diff --git a/Documentation/ABI/testing/debugfs-aufs b/Documentation/ABI/testing/debugfs-aufs 728diff --git a/Documentation/ABI/testing/debugfs-aufs b/Documentation/ABI/testing/debugfs-aufs
700deleted file mode 100644 729deleted file mode 100644
@@ -907,6 +936,128 @@ index c282375..7f686c8 100644
907+ clocks = <&clkc 16>, <&clk_foo>; 936+ clocks = <&clkc 16>, <&clk_foo>;
908+ clock-names = "gem1_emio_clk", "can_mio_clk_23"; 937+ clock-names = "gem1_emio_clk", "can_mio_clk_23";
909+ }; 938+ };
939diff --git a/Documentation/devicetree/bindings/gpio/gpio-xilinx.txt b/Documentation/devicetree/bindings/gpio/gpio-xilinx.txt
940new file mode 100644
941index 0000000..7efb339
942--- /dev/null
943+++ b/Documentation/devicetree/bindings/gpio/gpio-xilinx.txt
944@@ -0,0 +1,50 @@
945+Xilinx plb/axi GPIO controller
946+
947+Dual channel GPIO controller with configurable number of pins
948+(from 1 to 32 per channel). Every pin can be configured as
949+input/output/tristate. Both channels share the same global IRQ but
950+local interrupts can be enabled on channel basis.
951+
952+Required properties:
953+- compatible : Should be "xlnx,xps-gpio-1.00.a"
954+- reg : Address and length of the register set for the device
955+- #gpio-cells : Should be two. The first cell is the pin number and the
956+ second cell is used to specify channel offset:
957+ 0 - first channel
958+ 8 - second channel
959+- gpio-controller : Marks the device node as a GPIO controller.
960+
961+Optional properties:
962+- interrupts : Interrupt mapping for GPIO IRQ.
963+- interrupt-parent : Phandle for the interrupt controller that
964+ services interrupts for this device.
965+- xlnx,all-inputs : if n-th bit is setup, GPIO-n is input
966+- xlnx,dout-default : if n-th bit is 1, GPIO-n default value is 1
967+- xlnx,gpio-width : gpio width
968+- xlnx,tri-default : if n-th bit is 1, GPIO-n is in tristate mode
969+- xlnx,is-dual : if 1, controller also uses the second channel
970+- xlnx,all-inputs-2 : as above but for the second channel
971+- xlnx,dout-default-2 : as above but the second channel
972+- xlnx,gpio2-width : as above but for the second channel
973+- xlnx,tri-default-2 : as above but for the second channel
974+
975+
976+Example:
977+gpio: gpio@40000000 {
978+ #gpio-cells = <2>;
979+ compatible = "xlnx,xps-gpio-1.00.a";
980+ gpio-controller ;
981+ interrupt-parent = <&microblaze_0_intc>;
982+ interrupts = < 6 2 >;
983+ reg = < 0x40000000 0x10000 >;
984+ xlnx,all-inputs = <0x0>;
985+ xlnx,all-inputs-2 = <0x0>;
986+ xlnx,dout-default = <0x0>;
987+ xlnx,dout-default-2 = <0x0>;
988+ xlnx,gpio-width = <0x2>;
989+ xlnx,gpio2-width = <0x2>;
990+ xlnx,interrupt-present = <0x1>;
991+ xlnx,is-dual = <0x1>;
992+ xlnx,tri-default = <0xffffffff>;
993+ xlnx,tri-default-2 = <0xffffffff>;
994+} ;
995diff --git a/Documentation/devicetree/bindings/remoteproc/mb_remoteproc.txt b/Documentation/devicetree/bindings/remoteproc/mb_remoteproc.txt
996new file mode 100644
997index 0000000..ebc2b35
998--- /dev/null
999+++ b/Documentation/devicetree/bindings/remoteproc/mb_remoteproc.txt
1000@@ -0,0 +1,46 @@
1001+Xilinx ARM-Microblaze remoteproc driver
1002+
1003+This driver requires specific Zynq hardware design where Microblaze is added
1004+to the programmable logic.
1005+Microblaze is connected with PS block via axi bus connected to PS HP port
1006+to ensure access to PS DDR.
1007+Communication channels are done via soft GPIO IP connected to PS block
1008+and to Microblaze. There are also 2 gpio control signals reset and debug
1009+which are used for reseting Microblaze.
1010+
1011+Required properties:
1012+- compatible : Should be "xlnx,mb_remoteproc"
1013+- reg : Address and length of the ddr address space
1014+- bram: Phandle to bram controller which can access Microblaze BRAM
1015+- bram-firmware : Microblaze BRAM bootloader name
1016+- firmware : Default firmware name which can be override by
1017+ "firmware" module parameter
1018+- reset : Gpio phandle which reset Microblaze remoteproc
1019+- debug : Gpio phandle which setup Microblaze to debug state
1020+- ipino : Gpio phandle for Microblaze to ARM communication
1021+- vring0 : Gpio phandle for ARM to Microblaze communication vring 0
1022+- vring1 : Gpio phandle for ARM to Microblaze communication vring 1
1023+
1024+Microblaze SoC can be also connected to the PS block via a axi bus.
1025+That's why there is the option to allocate interrupts for Microblaze use only.
1026+The driver will allocate interrupts to itself and Microblaze sw has to ensure
1027+that interrupts are properly enabled and handled by Microblaze interrupt
1028+controller.
1029+
1030+Optional properties:
1031+ - interrupts : Interrupt mapping for remoteproc
1032+ - interrupt-parent : Phandle for the interrupt controller
1033+
1034+Example:
1035+test_mb: mb_remoteproc-test@800000 {
1036+ compatible = "xlnx,mb_remoteproc";
1037+ reg = < 0x8000000 0x8000000 >;
1038+ bram = <&axi_bram_ctrl_0>;
1039+ bram-firmware = "mb.bin";
1040+ firmware = "image.elf";
1041+ reset = <&zynq_gpio_reset 1 0>;
1042+ debug = <&zynq_gpio_reset 0 0>;
1043+ ipino = <&zynq_gpio_vring 0 0>;
1044+ vring0 = <&zynq_gpio_vring 1 0>;
1045+ vring1 = <&zynq_gpio_vring 2 0>;
1046+} ;
1047diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt
1048index 43cff70..25240fc 100644
1049--- a/Documentation/driver-model/devres.txt
1050+++ b/Documentation/driver-model/devres.txt
1051@@ -266,7 +266,8 @@ IOMAP
1052 devm_ioremap()
1053 devm_ioremap_nocache()
1054 devm_iounmap()
1055- devm_request_and_ioremap() : checks resource, requests region, ioremaps
1056+ devm_ioremap_resource() : checks resource, requests memory region, ioremaps
1057+ devm_request_and_ioremap() : obsoleted by devm_ioremap_resource()
1058 pcim_iomap()
1059 pcim_iounmap()
1060 pcim_iomap_table() : array of mapped addresses indexed by BAR
910diff --git a/Documentation/filesystems/aufs/README b/Documentation/filesystems/aufs/README 1061diff --git a/Documentation/filesystems/aufs/README b/Documentation/filesystems/aufs/README
911deleted file mode 100644 1062deleted file mode 100644
912index 41bf3a7..0000000 1063index 41bf3a7..0000000
@@ -7897,6 +8048,18 @@ index cd0bc86..911b88a 100644
7897 } ; 8048 } ;
7898 } ; 8049 } ;
7899 } ; 8050 } ;
8051diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
8052index d4a9a45..9ec4eb3 100644
8053--- a/arch/arm/common/gic.c
8054+++ b/arch/arm/common/gic.c
8055@@ -39,6 +39,7 @@
8056 #include <linux/interrupt.h>
8057 #include <linux/percpu.h>
8058 #include <linux/slab.h>
8059+#include <linux/irqchip/chained_irq.h>
8060
8061 #include <asm/irq.h>
8062 #include <asm/exception.h>
7900diff --git a/arch/arm/configs/at91sam9g45_defconfig b/arch/arm/configs/at91sam9g45_defconfig 8063diff --git a/arch/arm/configs/at91sam9g45_defconfig b/arch/arm/configs/at91sam9g45_defconfig
7901index 8aab786..606d48f 100644 8064index 8aab786..606d48f 100644
7902--- a/arch/arm/configs/at91sam9g45_defconfig 8065--- a/arch/arm/configs/at91sam9g45_defconfig
@@ -13760,6 +13923,46 @@ index 58c226e..95d4d3e 100644
13760 # CONFIG_AUXDISPLAY is not set 13923 # CONFIG_AUXDISPLAY is not set
13761 CONFIG_UIO=y 13924 CONFIG_UIO=y
13762 # CONFIG_UIO_CIF is not set 13925 # CONFIG_UIO_CIF is not set
13926diff --git a/arch/arm/include/asm/mach/irq.h b/arch/arm/include/asm/mach/irq.h
13927index 15cb035..33e625c 100644
13928--- a/arch/arm/include/asm/mach/irq.h
13929+++ b/arch/arm/include/asm/mach/irq.h
13930@@ -34,35 +34,4 @@ do { \
13931 raw_spin_unlock(&desc->lock); \
13932 } while(0)
13933
13934-#ifndef __ASSEMBLY__
13935-/*
13936- * Entry/exit functions for chained handlers where the primary IRQ chip
13937- * may implement either fasteoi or level-trigger flow control.
13938- */
13939-static inline void chained_irq_enter(struct irq_chip *chip,
13940- struct irq_desc *desc)
13941-{
13942- /* FastEOI controllers require no action on entry. */
13943- if (chip->irq_eoi)
13944- return;
13945-
13946- if (chip->irq_mask_ack) {
13947- chip->irq_mask_ack(&desc->irq_data);
13948- } else {
13949- chip->irq_mask(&desc->irq_data);
13950- if (chip->irq_ack)
13951- chip->irq_ack(&desc->irq_data);
13952- }
13953-}
13954-
13955-static inline void chained_irq_exit(struct irq_chip *chip,
13956- struct irq_desc *desc)
13957-{
13958- if (chip->irq_eoi)
13959- chip->irq_eoi(&desc->irq_data);
13960- else
13961- chip->irq_unmask(&desc->irq_data);
13962-}
13963-#endif
13964-
13965 #endif
13763diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h 13966diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
13764index 26e9ce4..c094749 100644 13967index 26e9ce4..c094749 100644
13765--- a/arch/arm/include/asm/pgtable.h 13968--- a/arch/arm/include/asm/pgtable.h
@@ -13794,60 +13997,22 @@ index a58dd49..a6c301e 100644
13794 #define OBSOLETE(syscall) sys_ni_syscall 13997 #define OBSOLETE(syscall) sys_ni_syscall
13795 #else 13998 #else
13796 #define OBSOLETE(syscall) syscall 13999 #define OBSOLETE(syscall) syscall
13797diff --git a/arch/arm/lib/memset.S b/arch/arm/lib/memset.S 14000diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c
13798index 94b0650..d912e73 100644 14001index c5d7e1e..a5afcf7 100644
13799--- a/arch/arm/lib/memset.S 14002--- a/arch/arm/mach-at91/gpio.c
13800+++ b/arch/arm/lib/memset.S 14003+++ b/arch/arm/mach-at91/gpio.c
13801@@ -14,15 +14,31 @@ 14004@@ -22,10 +22,9 @@
13802 14005 #include <linux/module.h>
13803 .text 14006 #include <linux/io.h>
13804 .align 5 14007 #include <linux/irqdomain.h>
13805+ .word 0 14008+#include <linux/irqchip/chained_irq.h>
13806+ 14009 #include <linux/of_address.h>
13807+1: subs r2, r2, #4 @ 1 do we have enough 14010
13808+ blt 5f @ 1 bytes to align with? 14011-#include <asm/mach/irq.h>
13809+ cmp r3, #2 @ 1 14012-
13810+ strltb r1, [ip], #1 @ 1 14013 #include <mach/hardware.h>
13811+ strleb r1, [ip], #1 @ 1 14014 #include <mach/at91_pio.h>
13812+ strb r1, [ip], #1 @ 1
13813+ add r2, r2, r3 @ 1 (r2 = r2 - (4 - r3))
13814+/*
13815+ * The pointer is now aligned and the length is adjusted. Try doing the
13816+ * memset again.
13817+ */
13818 14015
13819 ENTRY(memset)
13820- ands r3, r0, #3 @ 1 unaligned?
13821- mov ip, r0 @ preserve r0 as return value
13822- bne 6f @ 1
13823+/*
13824+ * Preserve the contents of r0 for the return value.
13825+ */
13826+ mov ip, r0
13827+ ands r3, ip, #3 @ 1 unaligned?
13828+ bne 1b @ 1
13829 /*
13830 * we know that the pointer in ip is aligned to a word boundary.
13831 */
13832-1: orr r1, r1, r1, lsl #8
13833+ orr r1, r1, r1, lsl #8
13834 orr r1, r1, r1, lsl #16
13835 mov r3, r1
13836 cmp r2, #16
13837@@ -111,13 +127,4 @@ ENTRY(memset)
13838 tst r2, #1
13839 strneb r1, [ip], #1
13840 mov pc, lr
13841-
13842-6: subs r2, r2, #4 @ 1 do we have enough
13843- blt 5b @ 1 bytes to align with?
13844- cmp r3, #2 @ 1
13845- strltb r1, [ip], #1 @ 1
13846- strleb r1, [ip], #1 @ 1
13847- strb r1, [ip], #1 @ 1
13848- add r2, r2, r3 @ 1 (r2 = r2 - (4 - r3))
13849- b 1b
13850 ENDPROC(memset)
13851diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c 14016diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
13852index 6b4608d..4b67847 100644 14017index 6b4608d..4b67847 100644
13853--- a/arch/arm/mach-at91/setup.c 14018--- a/arch/arm/mach-at91/setup.c
@@ -16164,6 +16329,48 @@ index e207aa5..5dbf13f 100644
16164 return 0; 16329 return 0;
16165 16330
16166 bad_area: 16331 bad_area:
16332diff --git a/arch/arm/plat-samsung/irq-vic-timer.c b/arch/arm/plat-samsung/irq-vic-timer.c
16333index f980cf3..5d205e7 100644
16334--- a/arch/arm/plat-samsung/irq-vic-timer.c
16335+++ b/arch/arm/plat-samsung/irq-vic-timer.c
16336@@ -16,6 +16,7 @@
16337 #include <linux/kernel.h>
16338 #include <linux/interrupt.h>
16339 #include <linux/irq.h>
16340+#include <linux/irqchip/chained_irq.h>
16341 #include <linux/io.h>
16342
16343 #include <mach/map.h>
16344@@ -23,8 +24,6 @@
16345 #include <plat/irq-vic-timer.h>
16346 #include <plat/regs-timer.h>
16347
16348-#include <asm/mach/irq.h>
16349-
16350 static void s3c_irq_demux_vic_timer(unsigned int irq, struct irq_desc *desc)
16351 {
16352 struct irq_chip *chip = irq_get_chip(irq);
16353diff --git a/arch/arm/plat-samsung/s5p-irq-gpioint.c b/arch/arm/plat-samsung/s5p-irq-gpioint.c
16354index bae5613..fafdb05 100644
16355--- a/arch/arm/plat-samsung/s5p-irq-gpioint.c
16356+++ b/arch/arm/plat-samsung/s5p-irq-gpioint.c
16357@@ -14,6 +14,7 @@
16358 #include <linux/kernel.h>
16359 #include <linux/interrupt.h>
16360 #include <linux/irq.h>
16361+#include <linux/irqchip/chained_irq.h>
16362 #include <linux/io.h>
16363 #include <linux/gpio.h>
16364 #include <linux/slab.h>
16365@@ -22,8 +23,6 @@
16366 #include <plat/gpio-core.h>
16367 #include <plat/gpio-cfg.h>
16368
16369-#include <asm/mach/irq.h>
16370-
16371 #define GPIO_BASE(chip) ((void __iomem *)((unsigned long)((chip)->base) & 0xFFFFF000u))
16372
16373 #define CON_OFFSET 0x700
16167diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c 16374diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
16168index 01b20a2..7a32976 100644 16375index 01b20a2..7a32976 100644
16169--- a/arch/arm/xen/enlighten.c 16376--- a/arch/arm/xen/enlighten.c
@@ -16354,6 +16561,21 @@ index a7869f8..4332f7e 100644
16354 16561
16355 return ret; 16562 return ret;
16356 } 16563 }
16564diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
16565index aa8976e..3a1e6a2 100644
16566--- a/arch/microblaze/Kconfig
16567+++ b/arch/microblaze/Kconfig
16568@@ -254,10 +254,6 @@ config MICROBLAZE_64K_PAGES
16569
16570 endchoice
16571
16572-config KERNEL_PAD
16573- hex "Kernel PAD for unpacking" if ADVANCED_OPTIONS
16574- default "0x80000" if MMU
16575-
16576 endmenu
16577
16578 source "mm/Kconfig"
16357diff --git a/arch/microblaze/configs/mmu_defconfig b/arch/microblaze/configs/mmu_defconfig 16579diff --git a/arch/microblaze/configs/mmu_defconfig b/arch/microblaze/configs/mmu_defconfig
16358index d2b097a..3649a8b 100644 16580index d2b097a..3649a8b 100644
16359--- a/arch/microblaze/configs/mmu_defconfig 16581--- a/arch/microblaze/configs/mmu_defconfig
@@ -17010,7 +17232,7 @@ index 357d56a..e8a5e9c 100644
17010 : "r" (addr), "r" (value) 17232 : "r" (addr), "r" (value)
17011 ); 17233 );
17012diff --git a/arch/microblaze/kernel/head.S b/arch/microblaze/kernel/head.S 17234diff --git a/arch/microblaze/kernel/head.S b/arch/microblaze/kernel/head.S
17013index a8ce682..fcc797f 100644 17235index a8ce682..817b7ee 100644
17014--- a/arch/microblaze/kernel/head.S 17236--- a/arch/microblaze/kernel/head.S
17015+++ b/arch/microblaze/kernel/head.S 17237+++ b/arch/microblaze/kernel/head.S
17016@@ -120,7 +120,7 @@ _copy_command_line: 17238@@ -120,7 +120,7 @@ _copy_command_line:
@@ -17031,6 +17253,15 @@ index a8ce682..fcc797f 100644
17031 addik r11, r11, 4 /* increment counting */ 17253 addik r11, r11, 4 /* increment counting */
17032 bgtid r3, _copy_bram /* loop for all entries */ 17254 bgtid r3, _copy_bram /* loop for all entries */
17033 addik r3, r3, -4 /* descrement loop */ 17255 addik r3, r3, -4 /* descrement loop */
17256@@ -176,7 +176,7 @@ _invalidate:
17257 /* start to do TLB calculation */
17258 addik r12, r0, _end
17259 rsub r12, r3, r12
17260- addik r12, r12, CONFIG_KERNEL_PAD /* that's the pad */
17261+ addik r12, r12, CONFIG_LOWMEM_SIZE >> PTE_SHIFT /* that's the pad */
17262
17263 or r9, r0, r0 /* TLB0 = 0 */
17264 or r10, r0, r0 /* TLB1 = 0 */
17034diff --git a/arch/microblaze/kernel/heartbeat.c b/arch/microblaze/kernel/heartbeat.c 17265diff --git a/arch/microblaze/kernel/heartbeat.c b/arch/microblaze/kernel/heartbeat.c
17035index 154756f..1879a05 100644 17266index 154756f..1879a05 100644
17036--- a/arch/microblaze/kernel/heartbeat.c 17267--- a/arch/microblaze/kernel/heartbeat.c
@@ -17063,19 +17294,6 @@ index 9422699..d85fa3a 100644
17063 intc->name, intc_baseaddr, nr_irq, intr_mask); 17294 intc->name, intc_baseaddr, nr_irq, intr_mask);
17064 17295
17065 /* 17296 /*
17066diff --git a/arch/microblaze/kernel/kgdb.c b/arch/microblaze/kernel/kgdb.c
17067index 09a5e82..8adc9244 100644
17068--- a/arch/microblaze/kernel/kgdb.c
17069+++ b/arch/microblaze/kernel/kgdb.c
17070@@ -141,7 +141,7 @@ void kgdb_arch_exit(void)
17071 /*
17072 * Global data
17073 */
17074-struct kgdb_arch arch_kgdb_ops = {
17075+const struct kgdb_arch arch_kgdb_ops = {
17076 #ifdef __MICROBLAZEEL__
17077 .gdb_bpt_instr = {0x18, 0x00, 0x0c, 0xba}, /* brki r16, 0x18 */
17078 #else
17079diff --git a/arch/microblaze/kernel/microblaze_ksyms.c b/arch/microblaze/kernel/microblaze_ksyms.c 17297diff --git a/arch/microblaze/kernel/microblaze_ksyms.c b/arch/microblaze/kernel/microblaze_ksyms.c
17080index 2b25bcf..9f1d02c4 100644 17298index 2b25bcf..9f1d02c4 100644
17081--- a/arch/microblaze/kernel/microblaze_ksyms.c 17299--- a/arch/microblaze/kernel/microblaze_ksyms.c
@@ -21619,6 +21837,115 @@ index c9303ed..0ca1ca7 100644
21619 channel_ce_count_show, NULL, 5); 21837 channel_ce_count_show, NULL, 5);
21620 21838
21621 /* Total possible dynamic ce_count attribute file table */ 21839 /* Total possible dynamic ce_count attribute file table */
21840diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
21841index 5b6ccf1..4510330 100644
21842--- a/drivers/gpio/Kconfig
21843+++ b/drivers/gpio/Kconfig
21844@@ -233,6 +233,7 @@ config GPIO_VT8500
21845 config GPIO_XILINX
21846 bool "Xilinx GPIO support"
21847 depends on PPC_OF || MICROBLAZE || ARCH_ZYNQ
21848+ select GENERIC_IRQ_CHIP
21849 help
21850 Say yes here to support the Xilinx AXI/XPS GPIO device
21851
21852diff --git a/drivers/gpio/gpio-msm-v2.c b/drivers/gpio/gpio-msm-v2.c
21853index 55a7e77..dd2edde 100644
21854--- a/drivers/gpio/gpio-msm-v2.c
21855+++ b/drivers/gpio/gpio-msm-v2.c
21856@@ -23,13 +23,12 @@
21857 #include <linux/init.h>
21858 #include <linux/interrupt.h>
21859 #include <linux/io.h>
21860+#include <linux/irqchip/chained_irq.h>
21861 #include <linux/irq.h>
21862 #include <linux/module.h>
21863 #include <linux/platform_device.h>
21864 #include <linux/spinlock.h>
21865
21866-#include <asm/mach/irq.h>
21867-
21868 #include <mach/msm_gpiomux.h>
21869 #include <mach/msm_iomap.h>
21870
21871diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
21872index 7877335..7176743 100644
21873--- a/drivers/gpio/gpio-mxc.c
21874+++ b/drivers/gpio/gpio-mxc.c
21875@@ -24,6 +24,7 @@
21876 #include <linux/io.h>
21877 #include <linux/irq.h>
21878 #include <linux/irqdomain.h>
21879+#include <linux/irqchip/chained_irq.h>
21880 #include <linux/gpio.h>
21881 #include <linux/platform_device.h>
21882 #include <linux/slab.h>
21883@@ -32,7 +33,6 @@
21884 #include <linux/of_device.h>
21885 #include <linux/module.h>
21886 #include <asm-generic/bug.h>
21887-#include <asm/mach/irq.h>
21888
21889 enum mxc_gpio_hwtype {
21890 IMX1_GPIO, /* runs on i.mx1 */
21891diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
21892index f1fbedb2..6996da9 100644
21893--- a/drivers/gpio/gpio-omap.c
21894+++ b/drivers/gpio/gpio-omap.c
21895@@ -25,11 +25,10 @@
21896 #include <linux/of.h>
21897 #include <linux/of_device.h>
21898 #include <linux/irqdomain.h>
21899+#include <linux/irqchip/chained_irq.h>
21900 #include <linux/gpio.h>
21901 #include <linux/platform_data/gpio-omap.h>
21902
21903-#include <asm/mach/irq.h>
21904-
21905 #define OFF_MODE 1
21906
21907 static LIST_HEAD(omap_gpio_list);
21908diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c
21909index c1720de..175c33b 100644
21910--- a/drivers/gpio/gpio-pl061.c
21911+++ b/drivers/gpio/gpio-pl061.c
21912@@ -15,6 +15,7 @@
21913 #include <linux/io.h>
21914 #include <linux/ioport.h>
21915 #include <linux/irq.h>
21916+#include <linux/irqchip/chained_irq.h>
21917 #include <linux/bitops.h>
21918 #include <linux/workqueue.h>
21919 #include <linux/gpio.h>
21920@@ -23,7 +24,6 @@
21921 #include <linux/amba/pl061.h>
21922 #include <linux/slab.h>
21923 #include <linux/pm.h>
21924-#include <asm/mach/irq.h>
21925
21926 #define GPIODIR 0x400
21927 #define GPIOIS 0x404
21928diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
21929index 8325f58..2d3af98 100644
21930--- a/drivers/gpio/gpio-pxa.c
21931+++ b/drivers/gpio/gpio-pxa.c
21932@@ -19,6 +19,7 @@
21933 #include <linux/init.h>
21934 #include <linux/irq.h>
21935 #include <linux/irqdomain.h>
21936+#include <linux/irqchip/chained_irq.h>
21937 #include <linux/io.h>
21938 #include <linux/of.h>
21939 #include <linux/of_device.h>
21940@@ -26,8 +27,6 @@
21941 #include <linux/syscore_ops.h>
21942 #include <linux/slab.h>
21943
21944-#include <asm/mach/irq.h>
21945-
21946 #include <mach/irqs.h>
21947
21948 /*
21622diff --git a/drivers/gpio/gpio-sch.c b/drivers/gpio/gpio-sch.c 21949diff --git a/drivers/gpio/gpio-sch.c b/drivers/gpio/gpio-sch.c
21623index 529c488..edae963 100644 21950index 529c488..edae963 100644
21624--- a/drivers/gpio/gpio-sch.c 21951--- a/drivers/gpio/gpio-sch.c
@@ -21702,10 +22029,621 @@ index 529c488..edae963 100644
21702 22029
21703 spin_unlock(&gpio_lock); 22030 spin_unlock(&gpio_lock);
21704 return 0; 22031 return 0;
22032diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
22033index 63cb643..48117e6 100644
22034--- a/drivers/gpio/gpio-tegra.c
22035+++ b/drivers/gpio/gpio-tegra.c
22036@@ -26,11 +26,10 @@
22037 #include <linux/platform_device.h>
22038 #include <linux/module.h>
22039 #include <linux/irqdomain.h>
22040+#include <linux/irqchip/chained_irq.h>
22041 #include <linux/pinctrl/consumer.h>
22042 #include <linux/pm.h>
22043
22044-#include <asm/mach/irq.h>
22045-
22046 #define GPIO_BANK(x) ((x) >> 5)
22047 #define GPIO_PORT(x) (((x) >> 3) & 0x3)
22048 #define GPIO_BIT(x) ((x) & 0x7)
22049diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c
22050index 1fa1519..566a306 100644
22051--- a/drivers/gpio/gpio-xilinx.c
22052+++ b/drivers/gpio/gpio-xilinx.c
22053@@ -1,7 +1,7 @@
22054 /*
22055 * Xilinx gpio driver for xps/axi_gpio IP.
22056 *
22057- * Copyright 2008, 2011 Xilinx, Inc.
22058+ * Copyright 2008 - 2013 Xilinx, Inc.
22059 *
22060 * This program is free software; you can redistribute it and/or modify
22061 * it under the terms of the GNU General Public License version 2
22062@@ -12,32 +12,62 @@
22063 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22064 */
22065
22066+#include <linux/bitops.h>
22067 #include <linux/init.h>
22068 #include <linux/errno.h>
22069 #include <linux/module.h>
22070 #include <linux/of_device.h>
22071+#include <linux/of_irq.h>
22072 #include <linux/of_platform.h>
22073 #include <linux/of_gpio.h>
22074+#include <linux/interrupt.h>
22075 #include <linux/io.h>
22076+#include <linux/irq.h>
22077+#include <linux/irqchip/chained_irq.h>
22078+#include <linux/irqdomain.h>
22079 #include <linux/gpio.h>
22080 #include <linux/slab.h>
22081
22082 /* Register Offset Definitions */
22083-#define XGPIO_DATA_OFFSET (0x0) /* Data register */
22084-#define XGPIO_TRI_OFFSET (0x4) /* I/O direction register */
22085+#define XGPIO_DATA_OFFSET 0x0 /* Data register */
22086+#define XGPIO_TRI_OFFSET 0x4 /* I/O direction register */
22087+#define XGPIO_GIER_OFFSET 0x11c /* Global Interrupt Enable */
22088+#define XGPIO_GIER_IE BIT(31)
22089+
22090+#define XGPIO_IPISR_OFFSET 0x120 /* IP Interrupt Status */
22091+#define XGPIO_IPIER_OFFSET 0x128 /* IP Interrupt Enable */
22092
22093 #define XGPIO_CHANNEL_OFFSET 0x8
22094
22095 /* Read/Write access to the GPIO registers */
22096-#define xgpio_readreg(offset) __raw_readl(offset)
22097-#define xgpio_writereg(offset, val) __raw_writel(val, offset)
22098+#ifdef CONFIG_ARCH_ZYNQ
22099+# define xgpio_readreg(offset) readl(offset)
22100+# define xgpio_writereg(offset, val) writel(val, offset)
22101+#else
22102+# define xgpio_readreg(offset) __raw_readl(offset)
22103+# define xgpio_writereg(offset, val) __raw_writel(val, offset)
22104+#endif
22105
22106+/**
22107+ * struct xgpio_instance - Stores information about GPIO device
22108+ * @mmchip: OF GPIO chip for memory mapped banks
22109+ * @gpio_state: GPIO state shadow register
22110+ * @gpio_dir: GPIO direction shadow register
22111+ * @offset: GPIO channel offset
22112+ * @irq_base: GPIO channel irq base address
22113+ * @irq_enable: GPIO irq enable/disable bitfield
22114+ * @gpio_lock: Lock used for synchronization
22115+ * @irq_domain: irq_domain of the controller
22116+ */
22117 struct xgpio_instance {
22118 struct of_mm_gpio_chip mmchip;
22119- u32 gpio_state; /* GPIO state shadow register */
22120- u32 gpio_dir; /* GPIO direction shadow register */
22121+ u32 gpio_state;
22122+ u32 gpio_dir;
22123 u32 offset;
22124- spinlock_t gpio_lock; /* Lock used for synchronization */
22125+ int irq_base;
22126+ u32 irq_enable;
22127+ spinlock_t gpio_lock;
22128+ struct irq_domain *irq_domain;
22129 };
22130
22131 /**
22132@@ -45,8 +75,11 @@ struct xgpio_instance {
22133 * @gc: Pointer to gpio_chip device structure.
22134 * @gpio: GPIO signal number.
22135 *
22136- * This function reads the specified signal of the GPIO device. It returns 0 if
22137- * the signal clear, 1 if signal is set or negative value on error.
22138+ * This function reads the specified signal of the GPIO device.
22139+ *
22140+ * Return:
22141+ * 0 if direction of GPIO signals is set as input otherwise it
22142+ * returns negative error value.
22143 */
22144 static int xgpio_get(struct gpio_chip *gc, unsigned int gpio)
22145 {
22146@@ -56,7 +89,7 @@ static int xgpio_get(struct gpio_chip *gc, unsigned int gpio)
22147
22148 void __iomem *regs = mm_gc->regs + chip->offset;
22149
22150- return (xgpio_readreg(regs + XGPIO_DATA_OFFSET) >> gpio) & 1;
22151+ return !!(xgpio_readreg(regs + XGPIO_DATA_OFFSET) & BIT(gpio));
22152 }
22153
22154 /**
22155@@ -80,9 +113,9 @@ static void xgpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
22156
22157 /* Write to GPIO signal and set its direction to output */
22158 if (val)
22159- chip->gpio_state |= 1 << gpio;
22160+ chip->gpio_state |= BIT(gpio);
22161 else
22162- chip->gpio_state &= ~(1 << gpio);
22163+ chip->gpio_state &= ~BIT(gpio);
22164
22165 xgpio_writereg(regs + chip->offset + XGPIO_DATA_OFFSET,
22166 chip->gpio_state);
22167@@ -96,8 +129,10 @@ static void xgpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
22168 * @gpio: GPIO signal number.
22169 *
22170 * This function sets the direction of specified GPIO signal as input.
22171- * It returns 0 if direction of GPIO signals is set as input otherwise it
22172- * returns negative error value.
22173+ *
22174+ * Return:
22175+ * 0 - if direction of GPIO signals is set as input
22176+ * otherwise it returns negative error value.
22177 */
22178 static int xgpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
22179 {
22180@@ -110,7 +145,7 @@ static int xgpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
22181 spin_lock_irqsave(&chip->gpio_lock, flags);
22182
22183 /* Set the GPIO bit in shadow register and set direction as input */
22184- chip->gpio_dir |= (1 << gpio);
22185+ chip->gpio_dir |= BIT(gpio);
22186 xgpio_writereg(regs + chip->offset + XGPIO_TRI_OFFSET, chip->gpio_dir);
22187
22188 spin_unlock_irqrestore(&chip->gpio_lock, flags);
22189@@ -124,8 +159,10 @@ static int xgpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
22190 * @gpio: GPIO signal number.
22191 * @val: Value to be written to specified signal.
22192 *
22193- * This function sets the direction of specified GPIO signal as output. If all
22194- * GPIO signals of GPIO chip is configured as input then it returns
22195+ * This function sets the direction of specified GPIO signal as output.
22196+ *
22197+ * Return:
22198+ * If all GPIO signals of GPIO chip is configured as input then it returns
22199 * error otherwise it returns 0.
22200 */
22201 static int xgpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
22202@@ -140,13 +177,14 @@ static int xgpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
22203
22204 /* Write state of GPIO signal */
22205 if (val)
22206- chip->gpio_state |= 1 << gpio;
22207+ chip->gpio_state |= BIT(gpio);
22208 else
22209- chip->gpio_state &= ~(1 << gpio);
22210- xgpio_writereg(regs + chip->offset + XGPIO_DATA_OFFSET, chip->gpio_state);
22211+ chip->gpio_state &= ~BIT(gpio);
22212+ xgpio_writereg(regs + chip->offset + XGPIO_DATA_OFFSET,
22213+ chip->gpio_state);
22214
22215 /* Clear the GPIO bit in shadow register and set direction as output */
22216- chip->gpio_dir &= (~(1 << gpio));
22217+ chip->gpio_dir &= ~BIT(gpio);
22218 xgpio_writereg(regs + chip->offset + XGPIO_TRI_OFFSET, chip->gpio_dir);
22219
22220 spin_unlock_irqrestore(&chip->gpio_lock, flags);
22221@@ -156,7 +194,7 @@ static int xgpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
22222
22223 /**
22224 * xgpio_save_regs - Set initial values of GPIO pins
22225- * @mm_gc: pointer to memory mapped GPIO chip structure
22226+ * @mm_gc: Pointer to memory mapped GPIO chip structure
22227 */
22228 static void xgpio_save_regs(struct of_mm_gpio_chip *mm_gc)
22229 {
22230@@ -170,42 +208,263 @@ static void xgpio_save_regs(struct of_mm_gpio_chip *mm_gc)
22231 }
22232
22233 /**
22234+ * xgpio_xlate - Set initial values of GPIO pins
22235+ * @gc: Pointer to gpio_chip device structure.
22236+ * @gpiospec: gpio specifier as found in the device tree
22237+ * @flags: A flags pointer based on binding
22238+ *
22239+ * Return:
22240+ * irq number otherwise -EINVAL
22241+ */
22242+static int xgpio_xlate(struct gpio_chip *gc,
22243+ const struct of_phandle_args *gpiospec, u32 *flags)
22244+{
22245+ struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
22246+ struct xgpio_instance *chip = container_of(mm_gc, struct xgpio_instance,
22247+ mmchip);
22248+
22249+ if (gpiospec->args[1] == chip->offset)
22250+ return gpiospec->args[0];
22251+
22252+ return -EINVAL;
22253+}
22254+
22255+/**
22256+ * xgpio_irq_mask - Write the specified signal of the GPIO device.
22257+ * @irq_data: per irq and chip data passed down to chip functions
22258+ */
22259+static void xgpio_irq_mask(struct irq_data *irq_data)
22260+{
22261+ unsigned long flags;
22262+ struct xgpio_instance *chip = irq_data_get_irq_chip_data(irq_data);
22263+ struct of_mm_gpio_chip *mm_gc = &chip->mmchip;
22264+ u32 offset = irq_data->irq - chip->irq_base;
22265+ u32 temp;
22266+
22267+ pr_debug("%s: Disable %d irq, irq_enable_mask 0x%x\n",
22268+ __func__, offset, chip->irq_enable);
22269+
22270+ spin_lock_irqsave(&chip->gpio_lock, flags);
22271+
22272+ chip->irq_enable &= ~BIT(offset);
22273+
22274+ if (!chip->irq_enable) {
22275+ /* Enable per channel interrupt */
22276+ temp = xgpio_readreg(mm_gc->regs + XGPIO_IPIER_OFFSET);
22277+ temp &= chip->offset / XGPIO_CHANNEL_OFFSET + 1;
22278+ xgpio_writereg(mm_gc->regs + XGPIO_IPIER_OFFSET, temp);
22279+
22280+ /* Disable global interrupt if channel interrupts are unused */
22281+ temp = xgpio_readreg(mm_gc->regs + XGPIO_IPIER_OFFSET);
22282+ if (!temp)
22283+ xgpio_writereg(mm_gc->regs + XGPIO_GIER_OFFSET,
22284+ ~XGPIO_GIER_IE);
22285+
22286+ }
22287+ spin_unlock_irqrestore(&chip->gpio_lock, flags);
22288+}
22289+
22290+/**
22291+ * xgpio_irq_unmask - Write the specified signal of the GPIO device.
22292+ * @irq_data: per irq and chip data passed down to chip functions
22293+ */
22294+static void xgpio_irq_unmask(struct irq_data *irq_data)
22295+{
22296+ unsigned long flags;
22297+ struct xgpio_instance *chip = irq_data_get_irq_chip_data(irq_data);
22298+ struct of_mm_gpio_chip *mm_gc = &chip->mmchip;
22299+ u32 offset = irq_data->irq - chip->irq_base;
22300+ u32 temp;
22301+
22302+ pr_debug("%s: Enable %d irq, irq_enable_mask 0x%x\n",
22303+ __func__, offset, chip->irq_enable);
22304+
22305+ /* Setup pin as input */
22306+ xgpio_dir_in(&mm_gc->gc, offset);
22307+
22308+ spin_lock_irqsave(&chip->gpio_lock, flags);
22309+
22310+ chip->irq_enable |= BIT(offset);
22311+
22312+ if (chip->irq_enable) {
22313+
22314+ /* Enable per channel interrupt */
22315+ temp = xgpio_readreg(mm_gc->regs + XGPIO_IPIER_OFFSET);
22316+ temp |= chip->offset / XGPIO_CHANNEL_OFFSET + 1;
22317+ xgpio_writereg(mm_gc->regs + XGPIO_IPIER_OFFSET, temp);
22318+
22319+ /* Enable global interrupts */
22320+ xgpio_writereg(mm_gc->regs + XGPIO_GIER_OFFSET, XGPIO_GIER_IE);
22321+ }
22322+
22323+ spin_unlock_irqrestore(&chip->gpio_lock, flags);
22324+}
22325+
22326+/**
22327+ * xgpio_set_irq_type - Write the specified signal of the GPIO device.
22328+ * @irq_data: Per irq and chip data passed down to chip functions
22329+ * @type: Interrupt type that is to be set for the gpio pin
22330+ *
22331+ * Return:
22332+ * 0 if interrupt type is supported otherwise otherwise -EINVAL
22333+ */
22334+static int xgpio_set_irq_type(struct irq_data *irq_data, unsigned int type)
22335+{
22336+ /* Only rising edge case is supported now */
22337+ if (type == IRQ_TYPE_EDGE_RISING)
22338+ return 0;
22339+
22340+ return -EINVAL;
22341+}
22342+
22343+/* irq chip descriptor */
22344+static struct irq_chip xgpio_irqchip = {
22345+ .name = "xgpio",
22346+ .irq_mask = xgpio_irq_mask,
22347+ .irq_unmask = xgpio_irq_unmask,
22348+ .irq_set_type = xgpio_set_irq_type,
22349+};
22350+
22351+/**
22352+ * xgpio_to_irq - Find out gpio to Linux irq mapping
22353+ * @gc: Pointer to gpio_chip device structure.
22354+ * @offset: Gpio pin offset
22355+ *
22356+ * Return:
22357+ * irq number otherwise -EINVAL
22358+ */
22359+static int xgpio_to_irq(struct gpio_chip *gc, unsigned offset)
22360+{
22361+ struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
22362+ struct xgpio_instance *chip = container_of(mm_gc, struct xgpio_instance,
22363+ mmchip);
22364+
22365+ return irq_find_mapping(chip->irq_domain, offset);
22366+}
22367+
22368+/**
22369+ * xgpio_irqhandler - Gpio interrupt service routine
22370+ * @irq: gpio irq number
22371+ * @desc: Pointer to interrupt description
22372+ */
22373+static void xgpio_irqhandler(unsigned int irq, struct irq_desc *desc)
22374+{
22375+ struct xgpio_instance *chip = (struct xgpio_instance *)
22376+ irq_get_handler_data(irq);
22377+ struct of_mm_gpio_chip *mm_gc = &chip->mmchip;
22378+ struct irq_chip *irqchip = irq_desc_get_chip(desc);
22379+ int offset;
22380+ unsigned long val;
22381+
22382+ chained_irq_enter(irqchip, desc);
22383+
22384+ val = xgpio_readreg(mm_gc->regs + chip->offset);
22385+ /* Only rising edge is supported */
22386+ val &= chip->irq_enable;
22387+
22388+ for_each_set_bit(offset, &val, chip->mmchip.gc.ngpio) {
22389+ generic_handle_irq(chip->irq_base + offset);
22390+ }
22391+
22392+ xgpio_writereg(mm_gc->regs + XGPIO_IPISR_OFFSET,
22393+ chip->offset / XGPIO_CHANNEL_OFFSET + 1);
22394+
22395+ chained_irq_exit(irqchip, desc);
22396+}
22397+
22398+static struct lock_class_key gpio_lock_class;
22399+
22400+/**
22401+ * xgpio_irq_setup - Allocate irq for gpio and setup appropriate functions
22402+ * @np: Device node of the GPIO chip
22403+ * @chip: Pointer to private gpio channel structure
22404+ *
22405+ * Return:
22406+ * 0 if success, otherwise -1
22407+ */
22408+static int xgpio_irq_setup(struct device_node *np, struct xgpio_instance *chip)
22409+{
22410+ u32 pin_num;
22411+ struct resource res;
22412+
22413+ int ret = of_irq_to_resource(np, 0, &res);
22414+ if (!ret) {
22415+ pr_info("GPIO IRQ not connected\n");
22416+ return 0;
22417+ }
22418+
22419+ chip->mmchip.gc.of_xlate = xgpio_xlate;
22420+ chip->mmchip.gc.of_gpio_n_cells = 2;
22421+ chip->mmchip.gc.to_irq = xgpio_to_irq;
22422+
22423+ chip->irq_base = irq_alloc_descs(-1, 0, chip->mmchip.gc.ngpio, 0);
22424+ if (chip->irq_base < 0) {
22425+ pr_err("Couldn't allocate IRQ numbers\n");
22426+ return -1;
22427+ }
22428+ chip->irq_domain = irq_domain_add_legacy(np, chip->mmchip.gc.ngpio,
22429+ chip->irq_base, 0,
22430+ &irq_domain_simple_ops, NULL);
22431+
22432+ /*
22433+ * set the irq chip, handler and irq chip data for callbacks for
22434+ * each pin
22435+ */
22436+ for (pin_num = 0; pin_num < chip->mmchip.gc.ngpio; pin_num++) {
22437+ u32 gpio_irq = irq_find_mapping(chip->irq_domain, pin_num);
22438+ irq_set_lockdep_class(gpio_irq, &gpio_lock_class);
22439+ pr_debug("IRQ Base: %d, Pin %d = IRQ %d\n",
22440+ chip->irq_base, pin_num, gpio_irq);
22441+ irq_set_chip_and_handler(gpio_irq, &xgpio_irqchip,
22442+ handle_simple_irq);
22443+ irq_set_chip_data(gpio_irq, (void *)chip);
22444+#ifdef CONFIG_ARCH_ZYNQ
22445+ set_irq_flags(gpio_irq, IRQF_VALID);
22446+#endif
22447+ }
22448+ irq_set_handler_data(res.start, (void *)chip);
22449+ irq_set_chained_handler(res.start, xgpio_irqhandler);
22450+
22451+ return 0;
22452+}
22453+
22454+/**
22455 * xgpio_of_probe - Probe method for the GPIO device.
22456 * @np: pointer to device tree node
22457 *
22458 * This function probes the GPIO device in the device tree. It initializes the
22459- * driver data structure. It returns 0, if the driver is bound to the GPIO
22460- * device, or a negative value if there is an error.
22461+ * driver data structure.
22462+ *
22463+ * Return:
22464+ * It returns 0, if the driver is bound to the GPIO device, or
22465+ * a negative value if there is an error.
22466 */
22467-static int xgpio_of_probe(struct device_node *np)
22468+static int xgpio_of_probe(struct platform_device *pdev)
22469 {
22470+ struct device_node *np = pdev->dev.of_node;
22471 struct xgpio_instance *chip;
22472 int status = 0;
22473 const u32 *tree_info;
22474
22475- chip = kzalloc(sizeof(*chip), GFP_KERNEL);
22476+ chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
22477 if (!chip)
22478 return -ENOMEM;
22479
22480 /* Update GPIO state shadow register with default value */
22481- tree_info = of_get_property(np, "xlnx,dout-default", NULL);
22482- if (tree_info)
22483- chip->gpio_state = be32_to_cpup(tree_info);
22484+ of_property_read_u32(np, "xlnx,dout-default", &chip->gpio_state);
22485+
22486+ /* By default, all pins are inputs */
22487+ chip->gpio_dir = 0xFFFFFFFF;
22488
22489 /* Update GPIO direction shadow register with default value */
22490- chip->gpio_dir = 0xFFFFFFFF; /* By default, all pins are inputs */
22491- tree_info = of_get_property(np, "xlnx,tri-default", NULL);
22492- if (tree_info)
22493- chip->gpio_dir = be32_to_cpup(tree_info);
22494+ of_property_read_u32(np, "xlnx,tri-default", &chip->gpio_dir);
22495+
22496+ /* By default assume full GPIO controller */
22497+ chip->mmchip.gc.ngpio = 32;
22498
22499 /* Check device node and parent device node for device width */
22500- chip->mmchip.gc.ngpio = 32; /* By default assume full GPIO controller */
22501- tree_info = of_get_property(np, "xlnx,gpio-width", NULL);
22502- if (!tree_info)
22503- tree_info = of_get_property(np->parent,
22504- "xlnx,gpio-width", NULL);
22505- if (tree_info)
22506- chip->mmchip.gc.ngpio = be32_to_cpup(tree_info);
22507+ of_property_read_u32(np, "xlnx,gpio-width",
22508+ (u32 *)&chip->mmchip.gc.ngpio);
22509
22510 spin_lock_init(&chip->gpio_lock);
22511
22512@@ -219,29 +478,24 @@ static int xgpio_of_probe(struct device_node *np)
22513 /* Call the OF gpio helper to setup and register the GPIO device */
22514 status = of_mm_gpiochip_add(np, &chip->mmchip);
22515 if (status) {
22516- kfree(chip);
22517 pr_err("%s: error in probe function with status %d\n",
22518 np->full_name, status);
22519 return status;
22520 }
22521
22522+ status = xgpio_irq_setup(np, chip);
22523+ if (status) {
22524+ pr_err("%s: GPIO IRQ initialization failed %d\n",
22525+ np->full_name, status);
22526+ return status;
22527+ }
22528+
22529 pr_info("XGpio: %s: registered, base is %d\n", np->full_name,
22530 chip->mmchip.gc.base);
22531
22532 tree_info = of_get_property(np, "xlnx,is-dual", NULL);
22533 if (tree_info && be32_to_cpup(tree_info)) {
22534- /* Distinguish dual gpio chip */
22535- /* NOTE baseaddr ends with zero address XGPIO_CHANNEL_OFFSET */
22536- /*
22537- * FIXME
22538- * drivers/gpio/gpio-xilinx.c: In function 'xgpio_of_probe':
22539- * drivers/gpio/gpio-xilinx.c:235:3: error: assignment of
22540- * read-only location '*(np->full_name + ((unsigned int)strlen
22541- * (np->full_name) + 0xffffffffffffffffffffffffffffffffu))'
22542- */
22543- /* np->full_name[strlen(np->full_name) - 1] = '8'; */
22544-
22545- chip = kzalloc(sizeof(*chip), GFP_KERNEL);
22546+ chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
22547 if (!chip)
22548 return -ENOMEM;
22549
22550@@ -249,26 +503,21 @@ static int xgpio_of_probe(struct device_node *np)
22551 chip->offset = XGPIO_CHANNEL_OFFSET;
22552
22553 /* Update GPIO state shadow register with default value */
22554- tree_info = of_get_property(np, "xlnx,dout-default-2", NULL);
22555- if (tree_info)
22556- chip->gpio_state = be32_to_cpup(tree_info);
22557+ of_property_read_u32(np, "xlnx,dout-default-2",
22558+ &chip->gpio_state);
22559
22560- /* Update GPIO direction shadow register with default value */
22561 /* By default, all pins are inputs */
22562 chip->gpio_dir = 0xFFFFFFFF;
22563- tree_info = of_get_property(np, "xlnx,tri-default-2", NULL);
22564- if (tree_info)
22565- chip->gpio_dir = be32_to_cpup(tree_info);
22566
22567- /* Check device node and parent device node for device width */
22568+ /* Update GPIO direction shadow register with default value */
22569+ of_property_read_u32(np, "xlnx,tri-default-2", &chip->gpio_dir);
22570+
22571 /* By default assume full GPIO controller */
22572 chip->mmchip.gc.ngpio = 32;
22573- tree_info = of_get_property(np, "xlnx,gpio2-width", NULL);
22574- if (!tree_info)
22575- tree_info = of_get_property(np->parent,
22576- "xlnx,gpio2-width", NULL);
22577- if (tree_info)
22578- chip->mmchip.gc.ngpio = be32_to_cpup(tree_info);
22579+
22580+ /* Check device node and parent device node for device width */
22581+ of_property_read_u32(np, "xlnx,gpio2-width",
22582+ (u32 *)&chip->mmchip.gc.ngpio);
22583
22584 spin_lock_init(&chip->gpio_lock);
22585
22586@@ -279,12 +528,18 @@ static int xgpio_of_probe(struct device_node *np)
22587
22588 chip->mmchip.save_regs = xgpio_save_regs;
22589
22590+ status = xgpio_irq_setup(np, chip);
22591+ if (status) {
22592+ pr_err("%s: GPIO IRQ initialization failed %d\n",
22593+ np->full_name, status);
22594+ return status;
22595+ }
22596+
22597 /* Call the OF gpio helper to setup and register the GPIO dev */
22598 status = of_mm_gpiochip_add(np, &chip->mmchip);
22599 if (status) {
22600- kfree(chip);
22601 pr_err("%s: error in probe function with status %d\n",
22602- np->full_name, status);
22603+ np->full_name, status);
22604 return status;
22605 }
22606 pr_info("XGpio: %s: dual channel registered, base is %d\n",
22607@@ -298,15 +553,20 @@ static struct of_device_id xgpio_of_match[] = {
22608 { .compatible = "xlnx,xps-gpio-1.00.a", },
22609 { /* end of list */ },
22610 };
22611+MODULE_DEVICE_TABLE(of, xgpio_of_match);
22612+
22613+static struct platform_driver xilinx_gpio_driver = {
22614+ .probe = xgpio_of_probe,
22615+ .driver = {
22616+ .owner = THIS_MODULE,
22617+ .name = "xilinx-gpio",
22618+ .of_match_table = xgpio_of_match,
22619+ },
22620+};
22621
22622 static int __init xgpio_init(void)
22623 {
22624- struct device_node *np;
22625-
22626- for_each_matching_node(np, xgpio_of_match)
22627- xgpio_of_probe(np);
22628-
22629- return 0;
22630+ return platform_driver_register(&xilinx_gpio_driver);
22631 }
22632
22633 /* Make sure we get initialized before anyone else tries to use us */
21705diff --git a/drivers/gpio/gpio-xilinxps.c b/drivers/gpio/gpio-xilinxps.c 22634diff --git a/drivers/gpio/gpio-xilinxps.c b/drivers/gpio/gpio-xilinxps.c
21706index 8c51700..dbe0a9f 100644 22635index 8c51700..d953580 100644
21707--- a/drivers/gpio/gpio-xilinxps.c 22636--- a/drivers/gpio/gpio-xilinxps.c
21708+++ b/drivers/gpio/gpio-xilinxps.c 22637+++ b/drivers/gpio/gpio-xilinxps.c
22638@@ -26,7 +26,7 @@
22639 #include <linux/pm_runtime.h>
22640 #include <linux/pm_wakeup.h>
22641 #include <linux/slab.h>
22642-#include <asm/mach/irq.h>
22643+#include <linux/irqchip/chained_irq.h>
22644 #include <linux/irqdomain.h>
22645
22646 #define DRIVER_NAME "xgpiops"
21709@@ -426,8 +426,7 @@ static void xgpiops_irqhandler(unsigned int irq, struct irq_desc *desc) 22647@@ -426,8 +426,7 @@ static void xgpiops_irqhandler(unsigned int irq, struct irq_desc *desc)
21710 generic_handle_irq(gpio_irq); 22648 generic_handle_irq(gpio_irq);
21711 } 22649 }
@@ -25390,6 +26328,84 @@ index d1b4e00..5cb5820 100644
25390 26328
25391 return error; 26329 return error;
25392 } 26330 }
26331diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
26332index 471c71f..0b3d463 100644
26333--- a/drivers/pinctrl/pinctrl-at91.c
26334+++ b/drivers/pinctrl/pinctrl-at91.c
26335@@ -18,6 +18,7 @@
26336 #include <linux/interrupt.h>
26337 #include <linux/irq.h>
26338 #include <linux/irqdomain.h>
26339+#include <linux/irqchip/chained_irq.h>
26340 #include <linux/io.h>
26341 #include <linux/gpio.h>
26342 #include <linux/pinctrl/machine.h>
26343@@ -27,8 +28,6 @@
26344 /* Since we request GPIOs from ourself */
26345 #include <linux/pinctrl/consumer.h>
26346
26347-#include <asm/mach/irq.h>
26348-
26349 #include <mach/hardware.h>
26350 #include <mach/at91_pio.h>
26351
26352diff --git a/drivers/pinctrl/pinctrl-exynos.c b/drivers/pinctrl/pinctrl-exynos.c
26353index 538b9dd..7265e55 100644
26354--- a/drivers/pinctrl/pinctrl-exynos.c
26355+++ b/drivers/pinctrl/pinctrl-exynos.c
26356@@ -23,13 +23,12 @@
26357 #include <linux/interrupt.h>
26358 #include <linux/irqdomain.h>
26359 #include <linux/irq.h>
26360+#include <linux/irqchip/chained_irq.h>
26361 #include <linux/of_irq.h>
26362 #include <linux/io.h>
26363 #include <linux/slab.h>
26364 #include <linux/err.h>
26365
26366-#include <asm/mach/irq.h>
26367-
26368 #include "pinctrl-samsung.h"
26369 #include "pinctrl-exynos.h"
26370
26371diff --git a/drivers/pinctrl/pinctrl-sirf.c b/drivers/pinctrl/pinctrl-sirf.c
26372index d02498b..ab26b4b 100644
26373--- a/drivers/pinctrl/pinctrl-sirf.c
26374+++ b/drivers/pinctrl/pinctrl-sirf.c
26375@@ -14,6 +14,7 @@
26376 #include <linux/slab.h>
26377 #include <linux/err.h>
26378 #include <linux/irqdomain.h>
26379+#include <linux/irqchip/chained_irq.h>
26380 #include <linux/pinctrl/pinctrl.h>
26381 #include <linux/pinctrl/pinmux.h>
26382 #include <linux/pinctrl/consumer.h>
26383@@ -25,7 +26,6 @@
26384 #include <linux/bitops.h>
26385 #include <linux/gpio.h>
26386 #include <linux/of_gpio.h>
26387-#include <asm/mach/irq.h>
26388
26389 #define DRIVER_NAME "pinmux-sirf"
26390
26391diff --git a/drivers/pinctrl/spear/pinctrl-plgpio.c b/drivers/pinctrl/spear/pinctrl-plgpio.c
26392index 3cf4ecd..5c2d86e 100644
26393--- a/drivers/pinctrl/spear/pinctrl-plgpio.c
26394+++ b/drivers/pinctrl/spear/pinctrl-plgpio.c
26395@@ -15,12 +15,12 @@
26396 #include <linux/io.h>
26397 #include <linux/irq.h>
26398 #include <linux/irqdomain.h>
26399+#include <linux/irqchip/chained_irq.h>
26400 #include <linux/module.h>
26401 #include <linux/pinctrl/consumer.h>
26402 #include <linux/platform_device.h>
26403 #include <linux/pm.h>
26404 #include <linux/spinlock.h>
26405-#include <asm/mach/irq.h>
26406
26407 #define MAX_GPIO_PER_REG 32
26408 #define PIN_OFFSET(pin) (pin % MAX_GPIO_PER_REG)
25393diff --git a/drivers/pwm/pwm-spear.c b/drivers/pwm/pwm-spear.c 26409diff --git a/drivers/pwm/pwm-spear.c b/drivers/pwm/pwm-spear.c
25394index 0c644e7..83b21d9 100644 26410index 0c644e7..83b21d9 100644
25395--- a/drivers/pwm/pwm-spear.c 26411--- a/drivers/pwm/pwm-spear.c
@@ -25419,7 +26435,7 @@ index 0c644e7..83b21d9 100644
25419 return ret; 26435 return ret;
25420 } 26436 }
25421diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig 26437diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig
25422index 36d7805..c88b8c2 100644 26438index 36d7805..823df2c 100644
25423--- a/drivers/remoteproc/Kconfig 26439--- a/drivers/remoteproc/Kconfig
25424+++ b/drivers/remoteproc/Kconfig 26440+++ b/drivers/remoteproc/Kconfig
25425@@ -44,6 +44,8 @@ config STE_MODEM_RPROC 26441@@ -44,6 +44,8 @@ config STE_MODEM_RPROC
@@ -25431,16 +26447,436 @@ index 36d7805..c88b8c2 100644
25431 select REMOTEPROC 26447 select REMOTEPROC
25432 select RPMSG 26448 select RPMSG
25433 select HOTPLUG_CPU 26449 select HOTPLUG_CPU
25434@@ -55,7 +57,8 @@ config ZYNQ_REMOTEPROC 26450@@ -55,6 +57,9 @@ config ZYNQ_REMOTEPROC
25435 config MB_REMOTEPROC 26451 config MB_REMOTEPROC
25436 tristate "Support Microblaze remoteproc" 26452 tristate "Support Microblaze remoteproc"
25437 depends on ARCH_ZYNQ 26453 depends on ARCH_ZYNQ
25438- select REMOTEPROC
25439+ depends on EXPERIMENTAL 26454+ depends on EXPERIMENTAL
25440+ depends on HAS_DMA 26455+ depends on HAS_DMA
26456+ select GPIO_XILINX
26457 select REMOTEPROC
25441 select RPMSG 26458 select RPMSG
25442 default m 26459 default m
25443 help 26460diff --git a/drivers/remoteproc/mb_remoteproc.c b/drivers/remoteproc/mb_remoteproc.c
26461index 470ff9d..860847d 100644
26462--- a/drivers/remoteproc/mb_remoteproc.c
26463+++ b/drivers/remoteproc/mb_remoteproc.c
26464@@ -1,7 +1,8 @@
26465 /*
26466 * Microblaze Remote Processor driver
26467 *
26468- * Copyright (C) 2012 Michal Simek <monstr@monstr.eu>
26469+ * Copyright (C) 2012 - 2013 Michal Simek <monstr@monstr.eu>
26470+ * Copyright (C) 2013 Xilinx, Inc.
26471 * Copyright (C) 2012 PetaLogix
26472 *
26473 * Based on origin OMAP Remote Processor driver
26474@@ -21,55 +22,97 @@
26475
26476 #include <linux/kernel.h>
26477 #include <linux/module.h>
26478-#include <linux/moduleloader.h>
26479 #include <linux/err.h>
26480 #include <linux/platform_device.h>
26481 #include <linux/dma-mapping.h>
26482 #include <linux/remoteproc.h>
26483 #include <linux/interrupt.h>
26484 #include <linux/of_irq.h>
26485+#include <linux/of_gpio.h>
26486+#include <linux/of_platform.h>
26487 #include <linux/smp.h>
26488 #include <asm/hardware/gic.h>
26489 #include <asm/outercache.h>
26490 #include <asm/cacheflush.h>
26491 #include <linux/slab.h>
26492 #include <linux/cpu.h>
26493+#include <linux/gpio.h>
26494+#include <linux/io.h>
26495+#include <linux/delay.h>
26496
26497 #include "remoteproc_internal.h"
26498
26499-extern int __cpuinit zynq_cpun_start(u32 address, int cpu);
26500-
26501 /* Module parameter */
26502 static char *firmware;
26503
26504-/* Structure for storing IRQs */
26505-struct irq_list {
26506- int irq;
26507- struct list_head list;
26508-};
26509-
26510 /* Private data */
26511 struct mb_rproc_pdata {
26512- struct irq_list mylist;
26513 struct rproc *rproc;
26514 u32 mem_start;
26515 u32 mem_end;
26516- u32 *gpio_reset_addr;
26517- u32 reset_gpio_pin;
26518+ int reset_gpio;
26519+ int mb_debug_gpio;
26520+ int ipi;
26521+ int vring0;
26522+ int vring1;
26523+ void __iomem *vbase;
26524+ const unsigned char *bootloader;
26525 };
26526
26527+/* Store rproc for IPI handler */
26528+static struct platform_device *remoteprocdev;
26529+static struct work_struct workqueue;
26530+
26531+static void handle_event(struct work_struct *work)
26532+{
26533+ struct mb_rproc_pdata *local = platform_get_drvdata(remoteprocdev);
26534+
26535+ flush_cache_all();
26536+ outer_flush_range(local->mem_start, local->mem_end);
26537+
26538+ if (rproc_vq_interrupt(local->rproc, 0) == IRQ_NONE)
26539+ dev_info(&remoteprocdev->dev, "no message found in vqid 0\n");
26540+}
26541+
26542+static irqreturn_t ipi_kick(int irq, void *dev_id)
26543+{
26544+ dev_dbg(&remoteprocdev->dev, "KICK Linux because of pending message\n");
26545+ schedule_work(&workqueue);
26546+ dev_dbg(&remoteprocdev->dev, "KICK Linux handled\n");
26547+
26548+ return IRQ_HANDLED;
26549+}
26550+
26551 static int mb_rproc_start(struct rproc *rproc)
26552 {
26553 struct device *dev = rproc->dev.parent;
26554 struct platform_device *pdev = to_platform_device(dev);
26555 struct mb_rproc_pdata *local = platform_get_drvdata(pdev);
26556+ const struct firmware *fw;
26557+ int ret;
26558
26559 dev_info(dev, "%s\n", __func__);
26560+ INIT_WORK(&workqueue, handle_event);
26561
26562 flush_cache_all();
26563 outer_flush_range(local->mem_start, local->mem_end);
26564
26565- *local->gpio_reset_addr &= ~(1 << local->reset_gpio_pin);
26566+ remoteprocdev = pdev;
26567+
26568+ ret = request_firmware(&fw, local->bootloader, &pdev->dev);
26569+ if (ret < 0) {
26570+ dev_err(&pdev->dev, "request_firmware failed\n");
26571+ return ret;
26572+ }
26573+ /* Copy bootloader to memory */
26574+ memcpy(local->vbase, fw->data, fw->size);
26575+ release_firmware(fw);
26576+
26577+ /* Just for sure synchronize memories */
26578+ dsb();
26579+
26580+ /* Release Microblaze from reset */
26581+ gpio_set_value(local->reset_gpio, 0);
26582
26583 return 0;
26584 }
26585@@ -78,9 +121,28 @@ static int mb_rproc_start(struct rproc *rproc)
26586 static void mb_rproc_kick(struct rproc *rproc, int vqid)
26587 {
26588 struct device *dev = rproc->dev.parent;
26589+ struct platform_device *pdev = to_platform_device(dev);
26590+ struct mb_rproc_pdata *local = platform_get_drvdata(pdev);
26591+
26592+ dev_dbg(dev, "KICK Firmware to start send messages vqid %d\n", vqid);
26593
26594- dev_info(dev, "KICK Firmware to start send messages vqid %d\n",
26595- vqid);
26596+ flush_cache_all();
26597+ outer_flush_all();
26598+
26599+ /* Send swirq to firmware */
26600+ gpio_set_value(local->vring0, 0);
26601+ gpio_set_value(local->vring1, 0);
26602+ dsb();
26603+
26604+ if (!vqid) {
26605+ udelay(500);
26606+ gpio_set_value(local->vring0, 1);
26607+ dsb();
26608+ } else {
26609+ udelay(100);
26610+ gpio_set_value(local->vring1, 1);
26611+ dsb();
26612+ }
26613 }
26614
26615 /* power off the remote processor */
26616@@ -90,10 +152,21 @@ static int mb_rproc_stop(struct rproc *rproc)
26617 struct platform_device *pdev = to_platform_device(dev);
26618 struct mb_rproc_pdata *local = platform_get_drvdata(pdev);
26619
26620- dev_info(dev, "%s\n", __func__);
26621+ /* Setup MB to the state where all memory transactions are done */
26622+ gpio_set_value(local->mb_debug_gpio, 1);
26623+ dsb(); /* Be sure that this write has been done */
26624+ /*
26625+ * This should be enough to ensure one CLK as
26626+ * it is written in MB ref guide
26627+ */
26628+ gpio_set_value(local->mb_debug_gpio, 0);
26629+
26630+ udelay(1000); /* Wait some time to finish all mem transactions */
26631
26632- *local->gpio_reset_addr |= 1 << local->reset_gpio_pin;
26633+ /* Add Microblaze to reset state */
26634+ gpio_set_value(local->reset_gpio, 1);
26635
26636+ /* No reason to wait that operations where done */
26637 return 0;
26638 }
26639
26640@@ -113,33 +186,17 @@ static irqreturn_t mb_remoteproc_interrupt(int irq, void *dev_id)
26641 return IRQ_HANDLED;
26642 }
26643
26644-static void clear_irq(struct platform_device *pdev)
26645-{
26646- struct list_head *pos, *q;
26647- struct irq_list *tmp;
26648- struct mb_rproc_pdata *local = platform_get_drvdata(pdev);
26649-
26650- dev_info(&pdev->dev, "Deleting the irq_list\n");
26651- list_for_each_safe(pos, q, &local->mylist.list) {
26652- tmp = list_entry(pos, struct irq_list, list);
26653- free_irq(tmp->irq, &pdev->dev);
26654- list_del(pos);
26655- kfree(tmp);
26656- }
26657-}
26658-
26659 static int mb_remoteproc_probe(struct platform_device *pdev)
26660 {
26661 const unsigned char *prop;
26662- const void *of_prop;
26663+ struct platform_device *bram_pdev;
26664+ struct device_node *bram_dev;
26665 struct resource *res; /* IO mem resources */
26666 int ret = 0;
26667- struct irq_list *tmp;
26668- int count;
26669+ int count = 0;
26670 struct mb_rproc_pdata *local;
26671
26672-
26673- local = kzalloc(sizeof(struct mb_rproc_pdata), GFP_KERNEL);
26674+ local = devm_kzalloc(&pdev->dev, sizeof(*local), GFP_KERNEL);
26675 if (!local) {
26676 dev_err(&pdev->dev, "Unable to alloc private data\n");
26677 return -ENOMEM;
26678@@ -172,58 +229,123 @@ static int mb_remoteproc_probe(struct platform_device *pdev)
26679 return ret;
26680 }
26681
26682- /* Init list for IRQs - it can be long list */
26683- INIT_LIST_HEAD(&local->mylist.list);
26684-
26685- count = of_irq_count(pdev->dev.of_node);
26686 /* Alloc IRQ based on DTS to be sure that no other driver will use it */
26687- while (count--) {
26688- tmp = kzalloc(sizeof(struct irq_list), GFP_KERNEL);
26689- if (!tmp) {
26690- dev_err(&pdev->dev, "Unable to alloc irq list\n");
26691- ret = -ENOMEM;
26692- goto irq_fault;
26693- }
26694-
26695- tmp->irq = irq_of_parse_and_map(pdev->dev.of_node, count);
26696-
26697- dev_info(&pdev->dev, "%d: Alloc irq: %d\n", count, tmp->irq);
26698-
26699+ while (1) {
26700+ int irq;
26701 /* Allocating shared IRQs will ensure that any module will
26702 * use these IRQs */
26703- ret = request_irq(tmp->irq, mb_remoteproc_interrupt, 0,
26704- dev_name(&pdev->dev), &pdev->dev);
26705+ irq = platform_get_irq(pdev, count++);
26706+ if (irq == -ENXIO)
26707+ break;
26708+ ret = devm_request_irq(&pdev->dev, irq, mb_remoteproc_interrupt,
26709+ 0, dev_name(&pdev->dev), &pdev->dev);
26710 if (ret) {
26711- dev_err(&pdev->dev, "IRQ %d already allocated\n",
26712- tmp->irq);
26713- goto irq_fault;
26714+ dev_err(&pdev->dev, "IRQ %d already allocated\n", irq);
26715+ return ret;
26716 }
26717
26718- list_add(&(tmp->list), &(local->mylist.list));
26719+ dev_info(&pdev->dev, "%d: Alloc irq: %d\n", count, irq);
26720 }
26721
26722+ /* Find out reset gpio and keep microblaze in reset */
26723+ local->reset_gpio = of_get_named_gpio(pdev->dev.of_node, "reset", 0);
26724+ if (local->reset_gpio < 0) {
26725+ dev_err(&pdev->dev, "reset-gpio property not found\n");
26726+ return local->reset_gpio;
26727+ }
26728+ ret = devm_gpio_request_one(&pdev->dev, local->reset_gpio,
26729+ GPIOF_OUT_INIT_HIGH, "mb_reset");
26730+ if (ret) {
26731+ dev_err(&pdev->dev, "Please specify gpio reset addr\n");
26732+ return ret;
26733+ }
26734+
26735+ /* Find out reset gpio and keep microblaze in reset */
26736+ local->mb_debug_gpio = of_get_named_gpio(pdev->dev.of_node, "debug", 0);
26737+ if (local->mb_debug_gpio < 0) {
26738+ dev_err(&pdev->dev, "mb-debug-gpio property not found\n");
26739+ return local->mb_debug_gpio;
26740+ }
26741+ ret = devm_gpio_request_one(&pdev->dev, local->mb_debug_gpio,
26742+ GPIOF_OUT_INIT_LOW, "mb_debug");
26743+ if (ret) {
26744+ dev_err(&pdev->dev, "Please specify gpio debug pin\n");
26745+ return ret;
26746+ }
26747+
26748+ /* IPI number for getting irq from firmware */
26749+ local->ipi = of_get_named_gpio(pdev->dev.of_node, "ipino", 0);
26750+ if (local->ipi < 0) {
26751+ dev_err(&pdev->dev, "ipi-gpio property not found\n");
26752+ return local->ipi;
26753+ }
26754+ ret = devm_gpio_request_one(&pdev->dev, local->ipi, GPIOF_IN, "mb_ipi");
26755+ if (ret) {
26756+ dev_err(&pdev->dev, "Please specify gpio reset addr\n");
26757+ return ret;
26758+ }
26759+ ret = devm_request_irq(&pdev->dev, gpio_to_irq(local->ipi),
26760+ ipi_kick, IRQF_SHARED|IRQF_TRIGGER_RISING,
26761+ dev_name(&pdev->dev), local);
26762+ if (ret) {
26763+ dev_err(&pdev->dev, "IRQ %d already allocated\n", local->ipi);
26764+ return ret;
26765+ }
26766+
26767+ /* Find out vring0 pin */
26768+ local->vring0 = of_get_named_gpio(pdev->dev.of_node, "vring0", 0);
26769+ if (local->vring0 < 0) {
26770+ dev_err(&pdev->dev, "reset-gpio property not found\n");
26771+ return local->vring0;
26772+ }
26773+ ret = devm_gpio_request_one(&pdev->dev, local->vring0,
26774+ GPIOF_DIR_OUT, "mb_vring0");
26775+ if (ret) {
26776+ dev_err(&pdev->dev, "Please specify gpio reset addr\n");
26777+ return ret;
26778+ }
26779
26780- of_prop = of_get_property(pdev->dev.of_node, "reset-gpio", NULL);
26781- if (!of_prop) {
26782+ /* Find out vring1 pin */
26783+ local->vring1 = of_get_named_gpio(pdev->dev.of_node, "vring1", 0);
26784+ if (local->vring1 < 0) {
26785+ dev_err(&pdev->dev, "reset-gpio property not found\n");
26786+ return local->vring1;
26787+ }
26788+ ret = devm_gpio_request_one(&pdev->dev, local->vring1,
26789+ GPIOF_DIR_OUT, "mb_vring1");
26790+ if (ret) {
26791 dev_err(&pdev->dev, "Please specify gpio reset addr\n");
26792- goto irq_fault;
26793+ return ret;
26794 }
26795
26796- local->gpio_reset_addr = ioremap(be32_to_cpup(of_prop), 0x1000);
26797- if (!local->gpio_reset_addr) {
26798- dev_err(&pdev->dev, "Reset GPIO ioremap failed\n");
26799- goto irq_fault;
26800+ /* Allocate bram device */
26801+ bram_dev = of_parse_phandle(pdev->dev.of_node, "bram", 0);
26802+ if (!bram_dev) {
26803+ dev_err(&pdev->dev, "Please specify bram connection\n");
26804+ return -ENODEV;
26805+ }
26806+ bram_pdev = of_find_device_by_node(bram_dev);
26807+ if (!bram_pdev) {
26808+ dev_err(&pdev->dev, "BRAM device hasn't found\n");
26809+ return -ENODEV;
26810+ }
26811+ res = platform_get_resource(bram_pdev, IORESOURCE_MEM, 0);
26812+ local->vbase = devm_ioremap_resource(&pdev->dev, res);
26813+ if (!local->vbase) {
26814+ dev_err(&pdev->dev, "BRAM devm ioremap failed\n");
26815+ return -ENODEV;
26816 }
26817
26818- of_prop = of_get_property(pdev->dev.of_node, "reset-gpio-pin", NULL);
26819- if (!of_prop) {
26820- dev_err(&pdev->dev, "Please specify cpu number\n");
26821- goto irq_fault;
26822+ /* Load simple bootloader to bram */
26823+ local->bootloader = of_get_property(pdev->dev.of_node,
26824+ "bram-firmware", NULL);
26825+ if (!local->bootloader) {
26826+ dev_err(&pdev->dev, "Please specify BRAM firmware\n");
26827+ return -ENODEV;
26828 }
26829- local->reset_gpio_pin = be32_to_cpup(of_prop);
26830
26831- /* Keep mb in reset */
26832- *local->gpio_reset_addr |= 1 << local->reset_gpio_pin;
26833+ dev_info(&pdev->dev, "Using microblaze BRAM bootloader: %s\n",
26834+ local->bootloader);
26835
26836 /* Module param firmware first */
26837 if (firmware)
26838@@ -237,26 +359,19 @@ static int mb_remoteproc_probe(struct platform_device *pdev)
26839 &mb_rproc_ops, prop, sizeof(struct rproc));
26840 if (!local->rproc) {
26841 dev_err(&pdev->dev, "rproc allocation failed\n");
26842- goto rproc_fault;
26843+ return -ENOMEM;
26844 }
26845
26846 ret = rproc_add(local->rproc);
26847 if (ret) {
26848 dev_err(&pdev->dev, "rproc registration failed\n");
26849- goto rproc_fault;
26850+ rproc_put(local->rproc);
26851+ return ret;
26852 }
26853+ return 0;
26854+ }
26855
26856- return ret;
26857- } else
26858- ret = -ENODEV;
26859-
26860-rproc_fault:
26861- rproc_put(local->rproc);
26862-
26863-irq_fault:
26864- clear_irq(pdev);
26865-
26866- return ret;
26867+ return -ENODEV;
26868 }
26869
26870 static int mb_remoteproc_remove(struct platform_device *pdev)
26871@@ -267,8 +382,6 @@ static int mb_remoteproc_remove(struct platform_device *pdev)
26872
26873 dma_release_declared_memory(&pdev->dev);
26874
26875- clear_irq(pdev);
26876-
26877 rproc_del(local->rproc);
26878 rproc_put(local->rproc);
26879
25444diff --git a/drivers/rpmsg/rpmsg_freertos_statistic.c b/drivers/rpmsg/rpmsg_freertos_statistic.c 26880diff --git a/drivers/rpmsg/rpmsg_freertos_statistic.c b/drivers/rpmsg/rpmsg_freertos_statistic.c
25445index 021dd7e..c09301a 100644 26881index 021dd7e..c09301a 100644
25446--- a/drivers/rpmsg/rpmsg_freertos_statistic.c 26882--- a/drivers/rpmsg/rpmsg_freertos_statistic.c
@@ -28737,6 +30173,20 @@ index 0000000..e44fad7
28737+ 30173+
28738+ 30174+
28739+#endif 30175+#endif
30176diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-common.c b/drivers/staging/imx-drm/ipu-v3/ipu-common.c
30177index f7059cd..fabd3ed 100644
30178--- a/drivers/staging/imx-drm/ipu-v3/ipu-common.c
30179+++ b/drivers/staging/imx-drm/ipu-v3/ipu-common.c
30180@@ -25,8 +25,8 @@
30181 #include <linux/clk.h>
30182 #include <linux/list.h>
30183 #include <linux/irq.h>
30184+#include <linux/irqchip/chained_irq.h>
30185 #include <linux/of_device.h>
30186-#include <asm/mach/irq.h>
30187
30188 #include "imx-ipu-v3.h"
30189 #include "ipu-prv.h"
28740diff --git a/drivers/staging/video/axivdma/Kconfig b/drivers/staging/video/axivdma/Kconfig 30190diff --git a/drivers/staging/video/axivdma/Kconfig b/drivers/staging/video/axivdma/Kconfig
28741new file mode 100644 30191new file mode 100644
28742index 0000000..f3b401b 30192index 0000000..f3b401b
@@ -77566,6 +79016,18 @@ index a501169..d9718ee 100644
77566+ spinlock_t *lock); 79016+ spinlock_t *lock);
77567 79017
77568 #endif 79018 #endif
79019diff --git a/include/linux/device.h b/include/linux/device.h
79020index 43dcda9..251f33b 100644
79021--- a/include/linux/device.h
79022+++ b/include/linux/device.h
79023@@ -573,6 +573,7 @@ extern int devres_release_group(struct device *dev, void *id);
79024 extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp);
79025 extern void devm_kfree(struct device *dev, void *p);
79026
79027+void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res);
79028 void __iomem *devm_request_and_ioremap(struct device *dev,
79029 struct resource *res);
79030
77569diff --git a/include/linux/fs.h b/include/linux/fs.h 79031diff --git a/include/linux/fs.h b/include/linux/fs.h
77570index 1a39c33..7617ee0 100644 79032index 1a39c33..7617ee0 100644
77571--- a/include/linux/fs.h 79033--- a/include/linux/fs.h
@@ -77653,6 +79115,64 @@ index c4d870b..ae221a7 100644
77653 /* 79115 /*
77654 * Defines whether IPC_RMID is forced for _all_ shm segments regardless 79116 * Defines whether IPC_RMID is forced for _all_ shm segments regardless
77655 * of shmctl() 79117 * of shmctl()
79118diff --git a/include/linux/irqchip/chained_irq.h b/include/linux/irqchip/chained_irq.h
79119new file mode 100644
79120index 0000000..adf4c30
79121--- /dev/null
79122+++ b/include/linux/irqchip/chained_irq.h
79123@@ -0,0 +1,52 @@
79124+/*
79125+ * Chained IRQ handlers support.
79126+ *
79127+ * Copyright (C) 2011 ARM Ltd.
79128+ *
79129+ * This program is free software: you can redistribute it and/or modify
79130+ * it under the terms of the GNU General Public License version 2 as
79131+ * published by the Free Software Foundation.
79132+ *
79133+ * This program is distributed in the hope that it will be useful,
79134+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
79135+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
79136+ * GNU General Public License for more details.
79137+ *
79138+ * You should have received a copy of the GNU General Public License
79139+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
79140+ */
79141+#ifndef __IRQCHIP_CHAINED_IRQ_H
79142+#define __IRQCHIP_CHAINED_IRQ_H
79143+
79144+#include <linux/irq.h>
79145+
79146+/*
79147+ * Entry/exit functions for chained handlers where the primary IRQ chip
79148+ * may implement either fasteoi or level-trigger flow control.
79149+ */
79150+static inline void chained_irq_enter(struct irq_chip *chip,
79151+ struct irq_desc *desc)
79152+{
79153+ /* FastEOI controllers require no action on entry. */
79154+ if (chip->irq_eoi)
79155+ return;
79156+
79157+ if (chip->irq_mask_ack) {
79158+ chip->irq_mask_ack(&desc->irq_data);
79159+ } else {
79160+ chip->irq_mask(&desc->irq_data);
79161+ if (chip->irq_ack)
79162+ chip->irq_ack(&desc->irq_data);
79163+ }
79164+}
79165+
79166+static inline void chained_irq_exit(struct irq_chip *chip,
79167+ struct irq_desc *desc)
79168+{
79169+ if (chip->irq_eoi)
79170+ chip->irq_eoi(&desc->irq_data);
79171+ else
79172+ chip->irq_unmask(&desc->irq_data);
79173+}
79174+
79175+#endif /* __IRQCHIP_CHAINED_IRQ_H */
77656diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h 79176diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
77657index 383bef0..e30b663 100644 79177index 383bef0..e30b663 100644
77658--- a/include/linux/jbd2.h 79178--- a/include/linux/jbd2.h
@@ -78921,6 +80441,109 @@ index b6a1a5e..0000000
78921- return err; 80441- return err;
78922-} 80442-}
78923-device_initcall(timelimit_init); 80443-device_initcall(timelimit_init);
80444diff --git a/lib/devres.c b/lib/devres.c
80445index 80b9c76..88ad759 100644
80446--- a/lib/devres.c
80447+++ b/lib/devres.c
80448@@ -1,3 +1,4 @@
80449+#include <linux/err.h>
80450 #include <linux/pci.h>
80451 #include <linux/io.h>
80452 #include <linux/gfp.h>
80453@@ -86,22 +87,24 @@ void devm_iounmap(struct device *dev, void __iomem *addr)
80454 EXPORT_SYMBOL(devm_iounmap);
80455
80456 /**
80457- * devm_request_and_ioremap() - Check, request region, and ioremap resource
80458- * @dev: Generic device to handle the resource for
80459+ * devm_ioremap_resource() - check, request region, and ioremap resource
80460+ * @dev: generic device to handle the resource for
80461 * @res: resource to be handled
80462 *
80463- * Takes all necessary steps to ioremap a mem resource. Uses managed device, so
80464- * everything is undone on driver detach. Checks arguments, so you can feed
80465- * it the result from e.g. platform_get_resource() directly. Returns the
80466- * remapped pointer or NULL on error. Usage example:
80467+ * Checks that a resource is a valid memory region, requests the memory region
80468+ * and ioremaps it either as cacheable or as non-cacheable memory depending on
80469+ * the resource's flags. All operations are managed and will be undone on
80470+ * driver detach.
80471+ *
80472+ * Returns a pointer to the remapped memory or an ERR_PTR() encoded error code
80473+ * on failure. Usage example:
80474 *
80475 * res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
80476- * base = devm_request_and_ioremap(&pdev->dev, res);
80477- * if (!base)
80478- * return -EADDRNOTAVAIL;
80479+ * base = devm_ioremap_resource(&pdev->dev, res);
80480+ * if (IS_ERR(base))
80481+ * return PTR_ERR(base);
80482 */
80483-void __iomem *devm_request_and_ioremap(struct device *dev,
80484- struct resource *res)
80485+void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res)
80486 {
80487 resource_size_t size;
80488 const char *name;
80489@@ -111,7 +114,7 @@ void __iomem *devm_request_and_ioremap(struct device *dev,
80490
80491 if (!res || resource_type(res) != IORESOURCE_MEM) {
80492 dev_err(dev, "invalid resource\n");
80493- return NULL;
80494+ return ERR_PTR(-EINVAL);
80495 }
80496
80497 size = resource_size(res);
80498@@ -119,7 +122,7 @@ void __iomem *devm_request_and_ioremap(struct device *dev,
80499
80500 if (!devm_request_mem_region(dev, res->start, size, name)) {
80501 dev_err(dev, "can't request region for resource %pR\n", res);
80502- return NULL;
80503+ return ERR_PTR(-EBUSY);
80504 }
80505
80506 if (res->flags & IORESOURCE_CACHEABLE)
80507@@ -130,10 +133,39 @@ void __iomem *devm_request_and_ioremap(struct device *dev,
80508 if (!dest_ptr) {
80509 dev_err(dev, "ioremap failed for resource %pR\n", res);
80510 devm_release_mem_region(dev, res->start, size);
80511+ dest_ptr = ERR_PTR(-ENOMEM);
80512 }
80513
80514 return dest_ptr;
80515 }
80516+EXPORT_SYMBOL(devm_ioremap_resource);
80517+
80518+/**
80519+ * devm_request_and_ioremap() - Check, request region, and ioremap resource
80520+ * @dev: Generic device to handle the resource for
80521+ * @res: resource to be handled
80522+ *
80523+ * Takes all necessary steps to ioremap a mem resource. Uses managed device, so
80524+ * everything is undone on driver detach. Checks arguments, so you can feed
80525+ * it the result from e.g. platform_get_resource() directly. Returns the
80526+ * remapped pointer or NULL on error. Usage example:
80527+ *
80528+ * res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
80529+ * base = devm_request_and_ioremap(&pdev->dev, res);
80530+ * if (!base)
80531+ * return -EADDRNOTAVAIL;
80532+ */
80533+void __iomem *devm_request_and_ioremap(struct device *device,
80534+ struct resource *res)
80535+{
80536+ void __iomem *dest_ptr;
80537+
80538+ dest_ptr = devm_ioremap_resource(device, res);
80539+ if (IS_ERR(dest_ptr))
80540+ return NULL;
80541+
80542+ return dest_ptr;
80543+}
80544 EXPORT_SYMBOL(devm_request_and_ioremap);
80545
80546 #ifdef CONFIG_HAS_IOPORT
78924diff --git a/lib/oid_registry.c b/lib/oid_registry.c 80547diff --git a/lib/oid_registry.c b/lib/oid_registry.c
78925index 318f382..d8de11f 100644 80548index 318f382..d8de11f 100644
78926--- a/lib/oid_registry.c 80549--- a/lib/oid_registry.c
@@ -79424,6 +81047,102 @@ index 91ef82b..82c4fc7 100644
79424 return; 81047 return;
79425 } 81048 }
79426 81049
81050diff --git a/scripts/coccinelle/api/devm_ioremap_resource.cocci b/scripts/coccinelle/api/devm_ioremap_resource.cocci
81051new file mode 100644
81052index 0000000..495daa3
81053--- /dev/null
81054+++ b/scripts/coccinelle/api/devm_ioremap_resource.cocci
81055@@ -0,0 +1,90 @@
81056+virtual patch
81057+virtual report
81058+
81059+@depends on patch@
81060+expression base, dev, res;
81061+@@
81062+
81063+-base = devm_request_and_ioremap(dev, res);
81064++base = devm_ioremap_resource(dev, res);
81065+ ...
81066+ if (
81067+-base == NULL
81068++IS_ERR(base)
81069+ || ...) {
81070+<...
81071+- return ...;
81072++ return PTR_ERR(base);
81073+...>
81074+ }
81075+
81076+@depends on patch@
81077+expression e, E, ret;
81078+identifier l;
81079+@@
81080+
81081+ e = devm_ioremap_resource(...);
81082+ ...
81083+ if (IS_ERR(e) || ...) {
81084+ ... when any
81085+- ret = E;
81086++ ret = PTR_ERR(e);
81087+ ...
81088+(
81089+ return ret;
81090+|
81091+ goto l;
81092+)
81093+ }
81094+
81095+@depends on patch@
81096+expression e;
81097+@@
81098+
81099+ e = devm_ioremap_resource(...);
81100+ ...
81101+ if (IS_ERR(e) || ...) {
81102+ ...
81103+- \(dev_dbg\|dev_err\|pr_debug\|pr_err\|DRM_ERROR\)(...);
81104+ ...
81105+ }
81106+
81107+@depends on patch@
81108+expression e;
81109+identifier l;
81110+@@
81111+
81112+ e = devm_ioremap_resource(...);
81113+ ...
81114+ if (IS_ERR(e) || ...)
81115+-{
81116+(
81117+ return ...;
81118+|
81119+ goto l;
81120+)
81121+-}
81122+
81123+@r depends on report@
81124+expression e;
81125+identifier l;
81126+position p1;
81127+@@
81128+
81129+*e = devm_request_and_ioremap@p1(...);
81130+ ...
81131+ if (e == NULL || ...) {
81132+ ...
81133+(
81134+ return ...;
81135+|
81136+ goto l;
81137+)
81138+ }
81139+
81140+@script:python depends on r@
81141+p1 << r.p1;
81142+@@
81143+
81144+msg = "ERROR: deprecated devm_request_and_ioremap() API used on line %s" % (p1[0].line)
81145+coccilib.report.print_report(p1[0], msg)
79427diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl 81146diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
79428index 68b85e1..3368939 100644 81147index 68b85e1..3368939 100644
79429--- a/scripts/kconfig/streamline_config.pl 81148--- a/scripts/kconfig/streamline_config.pl
diff --git a/recipes-kernel/linux/linux-yocto/xlnx_3.8/0002-microblaze-Dont-mark-arch_kgdb_ops-as-const.patch b/recipes-kernel/linux/linux-yocto/xlnx_3.8/0002-microblaze-Dont-mark-arch_kgdb_ops-as-const.patch
deleted file mode 100644
index 53be2bf4..00000000
--- a/recipes-kernel/linux/linux-yocto/xlnx_3.8/0002-microblaze-Dont-mark-arch_kgdb_ops-as-const.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1From fd2c402c79a9a73e5b2384f0897f3f95f599afdd Mon Sep 17 00:00:00 2001
2From: Graeme Smecher <gsmecher@threespeedlogic.com>
3Date: Sat, 8 Jun 2013 09:52:08 -0700
4Subject: [PATCH] microblaze: Don't mark arch_kgdb_ops as const.
5
6Other architectures don't do it, and it conflicts with the extern'd definition
7in include/linux/kgdb.h.
8
9The patch fails checkpatch but it reflects current
10functions declaration and solved compilation error.
11
12Signed-off-by: Graeme Smecher <gsmecher@threespeedlogic.com>
13CC: Michal Simek <monstr@monstr.eu>
14CC: linux-kernel@vger.kernel.org
15Signed-off-by: Michal Simek <michal.simek@xilinx.com>
16---
17 arch/microblaze/kernel/kgdb.c | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20diff --git a/arch/microblaze/kernel/kgdb.c b/arch/microblaze/kernel/kgdb.c
21index 8adc9244..09a5e82 100644
22--- a/arch/microblaze/kernel/kgdb.c
23+++ b/arch/microblaze/kernel/kgdb.c
24@@ -141,7 +141,7 @@ void kgdb_arch_exit(void)
25 /*
26 * Global data
27 */
28-const struct kgdb_arch arch_kgdb_ops = {
29+struct kgdb_arch arch_kgdb_ops = {
30 #ifdef __MICROBLAZEEL__
31 .gdb_bpt_instr = {0x18, 0x00, 0x0c, 0xba}, /* brki r16, 0x18 */
32 #else
33--
341.8.4
35
diff --git a/recipes-kernel/linux/linux-yocto/xlnx_3.8_modifications_to_v14.5.scc b/recipes-kernel/linux/linux-yocto/xlnx_3.8_modifications_to_v14.5.scc
index 1f4a6e5b..fc1aca30 100644
--- a/recipes-kernel/linux/linux-yocto/xlnx_3.8_modifications_to_v14.5.scc
+++ b/recipes-kernel/linux/linux-yocto/xlnx_3.8_modifications_to_v14.5.scc
@@ -1,3 +1,2 @@
1patch xlnx_3.8/0001-Forward-code-to-match-xlnx_3.8-branch-on-linux_xlnx..patch 1patch xlnx_3.8/0001-Forward-code-to-match-xlnx_3.8-branch-on-linux_xlnx..patch
2patch xlnx_3.8/0002-microblaze-Dont-mark-arch_kgdb_ops-as-const.patch
3 2