summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-02 16:42:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-02 16:42:59 -0400
commit235c7b9feb8779c7c289ed614324baebf3651bf9 (patch)
tree477efafb74b56eb67f35312f2967ed8f4099d22e
parentbdfc7cbdeef8cadba0e5793079ac0130b8e2220c (diff)
parentcd427485357c0c4b99f69719251baacf25946e11 (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Pull main powerpc updates from Ben Herrenschmidt: "This time around, the powerpc merges are going to be a little bit more complicated than usual. This is the main pull request with most of the work for this merge window. I will describe it a bit more further down. There is some additional cpuidle driver work, however I haven't included it in this tree as it depends on some work in tip/timer-core which Thomas accidentally forgot to put in a topic branch. Since I didn't want to carry all of that tip timer stuff in powerpc -next, I setup a separate branch on top of Thomas tree with just that cpuidle driver in it, and Stephen has been carrying that in next separately for a while now. I'll send a separate pull request for it. Additionally, two new pieces in this tree add users for a sysfs API that Tejun and Greg have been deprecating in drivers-core-next. Thankfully Greg reverted the patch that removes the old API so this merge can happen cleanly, but once merged, I will send a patch adjusting our new code to the new API so that Greg can send you the removal patch. Now as for the content of this branch, we have a lot of perf work for power8 new counters including support for our new "nest" counters (also called 24x7) under pHyp (not natively yet). We have new functionality when running under the OPAL firmware (non-virtualized or KVM host), such as access to the firmware error logs and service processor dumps, system parameters and sensors, along with a hwmon driver for the latter. There's also a bunch of bug fixes accross the board, some LE fixes, and a nice set of selftests for validating our various types of copy loops. On the Freescale side, we see mostly new chip/board revisions, some clock updates, better support for machine checks and debug exceptions, etc..." * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (70 commits) powerpc/book3s: Fix CFAR clobbering issue in machine check handler. powerpc/compat: 32-bit little endian machine name is ppcle, not ppc powerpc/le: Big endian arguments for ppc_rtas() powerpc: Use default set of netfilter modules (CONFIG_NETFILTER_ADVANCED=n) powerpc/defconfigs: Enable THP in pseries defconfig powerpc/mm: Make sure a local_irq_disable prevent a parallel THP split powerpc: Rate-limit users spamming kernel log buffer powerpc/perf: Fix handling of L3 events with bank == 1 powerpc/perf/hv_{gpci, 24x7}: Add documentation of device attributes powerpc/perf: Add kconfig option for hypervisor provided counters powerpc/perf: Add support for the hv 24x7 interface powerpc/perf: Add support for the hv gpci (get performance counter info) interface powerpc/perf: Add macros for defining event fields & formats powerpc/perf: Add a shared interface to get gpci version and capabilities powerpc/perf: Add 24x7 interface headers powerpc/perf: Add hv_gpci interface header powerpc: Add hvcalls for 24x7 and gpci (Get Performance Counter Info) sysfs: create bin_attributes under the requested group powerpc/perf: Enable BHRB access for EBB events powerpc/perf: Add BHRB constraint and IFM MMCRA handling for EBB ...
-rw-r--r--Documentation/ABI/stable/sysfs-firmware-opal-dump41
-rw-r--r--Documentation/ABI/stable/sysfs-firmware-opal-elog60
-rw-r--r--Documentation/ABI/testing/sysfs-bus-event_source-devices-events517
-rw-r--r--Documentation/ABI/testing/sysfs-bus-event_source-devices-hv_24x723
-rw-r--r--Documentation/ABI/testing/sysfs-bus-event_source-devices-hv_gpci43
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/l2cache.txt23
-rw-r--r--Documentation/devicetree/bindings/powerpc/fsl/mem-ctrlr.txt27
-rw-r--r--Documentation/devicetree/bindings/usb/fsl-usb.txt4
-rw-r--r--MAINTAINERS3
-rw-r--r--arch/powerpc/Kconfig9
-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/prpmc2800_defconfig108
-rw-r--r--arch/powerpc/configs/pseries_defconfig55
-rw-r--r--arch/powerpc/configs/pseries_le_defconfig53
-rw-r--r--arch/powerpc/configs/storcenter_defconfig1
-rw-r--r--arch/powerpc/configs/tqm8xx_defconfig1
-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/exception-64e.h15
-rw-r--r--arch/powerpc/include/asm/exception-64s.h8
-rw-r--r--arch/powerpc/include/asm/hvcall.h5
-rw-r--r--arch/powerpc/include/asm/kvm_booke_hv_asm.h17
-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.h60
-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/reg.h18
-rw-r--r--arch/powerpc/include/asm/rtas.h1
-rw-r--r--arch/powerpc/kernel/asm-offsets.c2
-rw-r--r--arch/powerpc/kernel/cacheinfo.c7
-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.S5
-rw-r--r--arch/powerpc/kernel/mce.c4
-rw-r--r--arch/powerpc/kernel/mce_power.c37
-rw-r--r--arch/powerpc/kernel/prom.c5
-rw-r--r--arch/powerpc/kernel/rtas.c22
-rw-r--r--arch/powerpc/kernel/setup_64.c20
-rw-r--r--arch/powerpc/kernel/traps.c5
-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_hv_rmhandlers.S4
-rw-r--r--arch/powerpc/kvm/book3s_interrupts.S4
-rw-r--r--arch/powerpc/kvm/bookehv_interrupts.S21
-rw-r--r--arch/powerpc/lib/memcpy_64.S2
-rw-r--r--arch/powerpc/mm/mem.c7
-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/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/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/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/Makefile4
-rw-r--r--arch/powerpc/platforms/powernv/opal-async.c203
-rw-r--r--arch/powerpc/platforms/powernv/opal-dump.c525
-rw-r--r--arch/powerpc/platforms/powernv/opal-elog.c313
-rw-r--r--arch/powerpc/platforms/powernv/opal-sensor.c64
-rw-r--r--arch/powerpc/platforms/powernv/opal-sysparam.c290
-rw-r--r--arch/powerpc/platforms/powernv/opal-wrappers.S14
-rw-r--r--arch/powerpc/platforms/powernv/opal.c106
-rw-r--r--arch/powerpc/platforms/powernv/setup.c1
-rw-r--r--arch/powerpc/platforms/pseries/Kconfig12
-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/mobility.c26
-rw-r--r--arch/powerpc/platforms/pseries/suspend.c44
-rw-r--r--arch/powerpc/sysdev/fsl_pci.c178
-rw-r--r--arch/powerpc/sysdev/fsl_pci.h8
-rw-r--r--arch/powerpc/xmon/xmon.c4
-rw-r--r--drivers/hwmon/Kconfig8
-rw-r--r--drivers/hwmon/Makefile1
-rw-r--r--drivers/hwmon/ibmpowernv.c529
-rw-r--r--drivers/macintosh/adb.c57
-rw-r--r--drivers/watchdog/booke_wdt.c8
-rw-r--r--tools/testing/selftests/powerpc/Makefile2
-rw-r--r--tools/testing/selftests/powerpc/copyloops/Makefile29
-rw-r--r--tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h86
-rw-r--r--tools/testing/selftests/powerpc/copyloops/asm/processor.h0
l---------tools/testing/selftests/powerpc/copyloops/copyuser_64.S1
l---------tools/testing/selftests/powerpc/copyloops/copyuser_power7.S1
l---------tools/testing/selftests/powerpc/copyloops/memcpy_64.S1
l---------tools/testing/selftests/powerpc/copyloops/memcpy_power7.S1
-rw-r--r--tools/testing/selftests/powerpc/copyloops/validate.c99
-rw-r--r--tools/testing/selftests/powerpc/utils.h3
185 files changed, 5950 insertions, 924 deletions
diff --git a/Documentation/ABI/stable/sysfs-firmware-opal-dump b/Documentation/ABI/stable/sysfs-firmware-opal-dump
new file mode 100644
index 000000000000..32fe7f5c4880
--- /dev/null
+++ b/Documentation/ABI/stable/sysfs-firmware-opal-dump
@@ -0,0 +1,41 @@
1What: /sys/firmware/opal/dump
2Date: Feb 2014
3Contact: Stewart Smith <stewart@linux.vnet.ibm.com>
4Description:
5 This directory exposes interfaces for interacting with
6 the FSP and platform dumps through OPAL firmware interface.
7
8 This is only for the powerpc/powernv platform.
9
10 initiate_dump: When '1' is written to it,
11 we will initiate a dump.
12 Read this file for supported commands.
13
14 0xXX-0xYYYY: A directory for dump of type 0xXX and
15 id 0xYYYY (in hex). The name of this
16 directory should not be relied upon to
17 be in this format, only that it's unique
18 among all dumps. For determining the type
19 and ID of the dump, use the id and type files.
20 Do not rely on any particular size of dump
21 type or dump id.
22
23 Each dump has the following files:
24 id: An ASCII representation of the dump ID
25 in hex (e.g. '0x01')
26 type: An ASCII representation of the type of
27 dump in the format "0x%x %s" with the ID
28 in hex and a description of the dump type
29 (or 'unknown').
30 Type '0xffffffff unknown' is used when
31 we could not get the type from firmware.
32 e.g. '0x02 System/Platform Dump'
33 dump: A binary file containing the dump.
34 The size of the dump is the size of this file.
35 acknowledge: When 'ack' is written to this, we will
36 acknowledge that we've retrieved the
37 dump to the service processor. It will
38 then remove it, making the dump
39 inaccessible.
40 Reading this file will get a list of
41 supported actions.
diff --git a/Documentation/ABI/stable/sysfs-firmware-opal-elog b/Documentation/ABI/stable/sysfs-firmware-opal-elog
new file mode 100644
index 000000000000..e1f3058f5954
--- /dev/null
+++ b/Documentation/ABI/stable/sysfs-firmware-opal-elog
@@ -0,0 +1,60 @@
1What: /sys/firmware/opal/elog
2Date: Feb 2014
3Contact: Stewart Smith <stewart@linux.vnet.ibm.com>
4Description:
5 This directory exposes error log entries retrieved
6 through the OPAL firmware interface.
7
8 Each error log is identified by a unique ID and will
9 exist until explicitly acknowledged to firmware.
10
11 Each log entry has a directory in /sys/firmware/opal/elog.
12
13 Log entries may be purged by the service processor
14 before retrieved by firmware or retrieved/acknowledged by
15 Linux if there is no room for more log entries.
16
17 In the event that Linux has retrieved the log entries
18 but not explicitly acknowledged them to firmware and
19 the service processor needs more room for log entries,
20 the only remaining copy of a log message may be in
21 Linux.
22
23 Typically, a user space daemon will monitor for new
24 entries, read them out and acknowledge them.
25
26 The service processor may be able to store more log
27 entries than firmware can, so after you acknowledge
28 an event from Linux you may instantly get another one
29 from the queue that was generated some time in the past.
30
31 The raw log format is a binary format. We currently
32 do not parse this at all in kernel, leaving it up to
33 user space to solve the problem. In future, we may
34 do more parsing in kernel and add more files to make
35 it easier for simple user space processes to extract
36 more information.
37
38 For each log entry (directory), there are the following
39 files:
40
41 id: An ASCII representation of the ID of the
42 error log, in hex - e.g. "0x01".
43
44 type: An ASCII representation of the type id and
45 description of the type of error log.
46 Currently just "0x00 PEL" - platform error log.
47 In the future there may be additional types.
48
49 raw: A read-only binary file that can be read
50 to get the raw log entry. These are
51 <16kb, often just hundreds of bytes and
52 "average" 2kb.
53
54 acknowledge: Writing 'ack' to this file will acknowledge
55 the error log to firmware (and in turn
56 the service processor, if applicable).
57 Shortly after acknowledging it, the log
58 entry will be removed from sysfs.
59 Reading this file will list the supported
60 operations (curently just acknowledge). \ No newline at end of file
diff --git a/Documentation/ABI/testing/sysfs-bus-event_source-devices-events b/Documentation/ABI/testing/sysfs-bus-event_source-devices-events
index 3c1cc24361bd..7b40a3cbc26a 100644
--- a/Documentation/ABI/testing/sysfs-bus-event_source-devices-events
+++ b/Documentation/ABI/testing/sysfs-bus-event_source-devices-events
@@ -57,6 +57,523 @@ What: /sys/devices/cpu/events/PM_1PLUS_PPC_CMPL
57 /sys/devices/cpu/events/PM_LD_REF_L1 57 /sys/devices/cpu/events/PM_LD_REF_L1
58 /sys/devices/cpu/events/PM_RUN_CYC 58 /sys/devices/cpu/events/PM_RUN_CYC
59 /sys/devices/cpu/events/PM_RUN_INST_CMPL 59 /sys/devices/cpu/events/PM_RUN_INST_CMPL
60 /sys/devices/cpu/events/PM_IC_DEMAND_L2_BR_ALL
61 /sys/devices/cpu/events/PM_GCT_UTIL_7_TO_10_SLOTS
62 /sys/devices/cpu/events/PM_PMC2_SAVED
63 /sys/devices/cpu/events/PM_VSU0_16FLOP
64 /sys/devices/cpu/events/PM_MRK_LSU_DERAT_MISS
65 /sys/devices/cpu/events/PM_MRK_ST_CMPL
66 /sys/devices/cpu/events/PM_NEST_PAIR3_ADD
67 /sys/devices/cpu/events/PM_L2_ST_DISP
68 /sys/devices/cpu/events/PM_L2_CASTOUT_MOD
69 /sys/devices/cpu/events/PM_ISEG
70 /sys/devices/cpu/events/PM_MRK_INST_TIMEO
71 /sys/devices/cpu/events/PM_L2_RCST_DISP_FAIL_ADDR
72 /sys/devices/cpu/events/PM_LSU1_DC_PREF_STREAM_CONFIRM
73 /sys/devices/cpu/events/PM_IERAT_WR_64K
74 /sys/devices/cpu/events/PM_MRK_DTLB_MISS_16M
75 /sys/devices/cpu/events/PM_IERAT_MISS
76 /sys/devices/cpu/events/PM_MRK_PTEG_FROM_LMEM
77 /sys/devices/cpu/events/PM_FLOP
78 /sys/devices/cpu/events/PM_THRD_PRIO_4_5_CYC
79 /sys/devices/cpu/events/PM_BR_PRED_TA
80 /sys/devices/cpu/events/PM_EXT_INT
81 /sys/devices/cpu/events/PM_VSU_FSQRT_FDIV
82 /sys/devices/cpu/events/PM_MRK_LD_MISS_EXPOSED_CYC
83 /sys/devices/cpu/events/PM_LSU1_LDF
84 /sys/devices/cpu/events/PM_IC_WRITE_ALL
85 /sys/devices/cpu/events/PM_LSU0_SRQ_STFWD
86 /sys/devices/cpu/events/PM_PTEG_FROM_RL2L3_MOD
87 /sys/devices/cpu/events/PM_MRK_DATA_FROM_L31_SHR
88 /sys/devices/cpu/events/PM_DATA_FROM_L21_MOD
89 /sys/devices/cpu/events/PM_VSU1_SCAL_DOUBLE_ISSUED
90 /sys/devices/cpu/events/PM_VSU0_8FLOP
91 /sys/devices/cpu/events/PM_POWER_EVENT1
92 /sys/devices/cpu/events/PM_DISP_CLB_HELD_BAL
93 /sys/devices/cpu/events/PM_VSU1_2FLOP
94 /sys/devices/cpu/events/PM_LWSYNC_HELD
95 /sys/devices/cpu/events/PM_PTEG_FROM_DL2L3_SHR
96 /sys/devices/cpu/events/PM_INST_FROM_L21_MOD
97 /sys/devices/cpu/events/PM_IERAT_XLATE_WR_16MPLUS
98 /sys/devices/cpu/events/PM_IC_REQ_ALL
99 /sys/devices/cpu/events/PM_DSLB_MISS
100 /sys/devices/cpu/events/PM_L3_MISS
101 /sys/devices/cpu/events/PM_LSU0_L1_PREF
102 /sys/devices/cpu/events/PM_VSU_SCALAR_SINGLE_ISSUED
103 /sys/devices/cpu/events/PM_LSU1_DC_PREF_STREAM_CONFIRM_STRIDE
104 /sys/devices/cpu/events/PM_L2_INST
105 /sys/devices/cpu/events/PM_VSU0_FRSP
106 /sys/devices/cpu/events/PM_FLUSH_DISP
107 /sys/devices/cpu/events/PM_PTEG_FROM_L2MISS
108 /sys/devices/cpu/events/PM_VSU1_DQ_ISSUED
109 /sys/devices/cpu/events/PM_MRK_DATA_FROM_DMEM
110 /sys/devices/cpu/events/PM_LSU_FLUSH_ULD
111 /sys/devices/cpu/events/PM_PTEG_FROM_LMEM
112 /sys/devices/cpu/events/PM_MRK_DERAT_MISS_16M
113 /sys/devices/cpu/events/PM_THRD_ALL_RUN_CYC
114 /sys/devices/cpu/events/PM_MEM0_PREFETCH_DISP
115 /sys/devices/cpu/events/PM_MRK_STALL_CMPLU_CYC_COUNT
116 /sys/devices/cpu/events/PM_DATA_FROM_DL2L3_MOD
117 /sys/devices/cpu/events/PM_VSU_FRSP
118 /sys/devices/cpu/events/PM_MRK_DATA_FROM_L21_MOD
119 /sys/devices/cpu/events/PM_PMC1_OVERFLOW
120 /sys/devices/cpu/events/PM_VSU0_SINGLE
121 /sys/devices/cpu/events/PM_MRK_PTEG_FROM_L3MISS
122 /sys/devices/cpu/events/PM_MRK_PTEG_FROM_L31_SHR
123 /sys/devices/cpu/events/PM_VSU0_VECTOR_SP_ISSUED
124 /sys/devices/cpu/events/PM_VSU1_FEST
125 /sys/devices/cpu/events/PM_MRK_INST_DISP
126 /sys/devices/cpu/events/PM_VSU0_COMPLEX_ISSUED
127 /sys/devices/cpu/events/PM_LSU1_FLUSH_UST
128 /sys/devices/cpu/events/PM_FXU_IDLE
129 /sys/devices/cpu/events/PM_LSU0_FLUSH_ULD
130 /sys/devices/cpu/events/PM_MRK_DATA_FROM_DL2L3_MOD
131 /sys/devices/cpu/events/PM_LSU_LMQ_SRQ_EMPTY_ALL_CYC
132 /sys/devices/cpu/events/PM_LSU1_REJECT_LMQ_FULL
133 /sys/devices/cpu/events/PM_INST_PTEG_FROM_L21_MOD
134 /sys/devices/cpu/events/PM_INST_FROM_RL2L3_MOD
135 /sys/devices/cpu/events/PM_SHL_CREATED
136 /sys/devices/cpu/events/PM_L2_ST_HIT
137 /sys/devices/cpu/events/PM_DATA_FROM_DMEM
138 /sys/devices/cpu/events/PM_L3_LD_MISS
139 /sys/devices/cpu/events/PM_FXU1_BUSY_FXU0_IDLE
140 /sys/devices/cpu/events/PM_DISP_CLB_HELD_RES
141 /sys/devices/cpu/events/PM_L2_SN_SX_I_DONE
142 /sys/devices/cpu/events/PM_STCX_CMPL
143 /sys/devices/cpu/events/PM_VSU0_2FLOP
144 /sys/devices/cpu/events/PM_L3_PREF_MISS
145 /sys/devices/cpu/events/PM_LSU_SRQ_SYNC_CYC
146 /sys/devices/cpu/events/PM_LSU_REJECT_ERAT_MISS
147 /sys/devices/cpu/events/PM_L1_ICACHE_MISS
148 /sys/devices/cpu/events/PM_LSU1_FLUSH_SRQ
149 /sys/devices/cpu/events/PM_LD_REF_L1_LSU0
150 /sys/devices/cpu/events/PM_VSU0_FEST
151 /sys/devices/cpu/events/PM_VSU_VECTOR_SINGLE_ISSUED
152 /sys/devices/cpu/events/PM_FREQ_UP
153 /sys/devices/cpu/events/PM_DATA_FROM_LMEM
154 /sys/devices/cpu/events/PM_LSU1_LDX
155 /sys/devices/cpu/events/PM_PMC3_OVERFLOW
156 /sys/devices/cpu/events/PM_MRK_BR_MPRED
157 /sys/devices/cpu/events/PM_SHL_MATCH
158 /sys/devices/cpu/events/PM_MRK_BR_TAKEN
159 /sys/devices/cpu/events/PM_ISLB_MISS
160 /sys/devices/cpu/events/PM_DISP_HELD_THERMAL
161 /sys/devices/cpu/events/PM_INST_PTEG_FROM_RL2L3_SHR
162 /sys/devices/cpu/events/PM_LSU1_SRQ_STFWD
163 /sys/devices/cpu/events/PM_PTEG_FROM_DMEM
164 /sys/devices/cpu/events/PM_VSU_2FLOP
165 /sys/devices/cpu/events/PM_GCT_FULL_CYC
166 /sys/devices/cpu/events/PM_MRK_DATA_FROM_L3_CYC
167 /sys/devices/cpu/events/PM_LSU_SRQ_S0_ALLOC
168 /sys/devices/cpu/events/PM_MRK_DERAT_MISS_4K
169 /sys/devices/cpu/events/PM_BR_MPRED_TA
170 /sys/devices/cpu/events/PM_INST_PTEG_FROM_L2MISS
171 /sys/devices/cpu/events/PM_DPU_HELD_POWER
172 /sys/devices/cpu/events/PM_MRK_VSU_FIN
173 /sys/devices/cpu/events/PM_LSU_SRQ_S0_VALID
174 /sys/devices/cpu/events/PM_GCT_EMPTY_CYC
175 /sys/devices/cpu/events/PM_IOPS_DISP
176 /sys/devices/cpu/events/PM_RUN_SPURR
177 /sys/devices/cpu/events/PM_PTEG_FROM_L21_MOD
178 /sys/devices/cpu/events/PM_VSU0_1FLOP
179 /sys/devices/cpu/events/PM_SNOOP_TLBIE
180 /sys/devices/cpu/events/PM_DATA_FROM_L3MISS
181 /sys/devices/cpu/events/PM_VSU_SINGLE
182 /sys/devices/cpu/events/PM_DTLB_MISS_16G
183 /sys/devices/cpu/events/PM_FLUSH
184 /sys/devices/cpu/events/PM_L2_LD_HIT
185 /sys/devices/cpu/events/PM_NEST_PAIR2_AND
186 /sys/devices/cpu/events/PM_VSU1_1FLOP
187 /sys/devices/cpu/events/PM_IC_PREF_REQ
188 /sys/devices/cpu/events/PM_L3_LD_HIT
189 /sys/devices/cpu/events/PM_DISP_HELD
190 /sys/devices/cpu/events/PM_L2_LD
191 /sys/devices/cpu/events/PM_LSU_FLUSH_SRQ
192 /sys/devices/cpu/events/PM_BC_PLUS_8_CONV
193 /sys/devices/cpu/events/PM_MRK_DATA_FROM_L31_MOD_CYC
194 /sys/devices/cpu/events/PM_L2_RCST_BUSY_RC_FULL
195 /sys/devices/cpu/events/PM_TB_BIT_TRANS
196 /sys/devices/cpu/events/PM_THERMAL_MAX
197 /sys/devices/cpu/events/PM_LSU1_FLUSH_ULD
198 /sys/devices/cpu/events/PM_LSU1_REJECT_LHS
199 /sys/devices/cpu/events/PM_LSU_LRQ_S0_ALLOC
200 /sys/devices/cpu/events/PM_L3_CO_L31
201 /sys/devices/cpu/events/PM_POWER_EVENT4
202 /sys/devices/cpu/events/PM_DATA_FROM_L31_SHR
203 /sys/devices/cpu/events/PM_BR_UNCOND
204 /sys/devices/cpu/events/PM_LSU1_DC_PREF_STREAM_ALLOC
205 /sys/devices/cpu/events/PM_PMC4_REWIND
206 /sys/devices/cpu/events/PM_L2_RCLD_DISP
207 /sys/devices/cpu/events/PM_THRD_PRIO_2_3_CYC
208 /sys/devices/cpu/events/PM_MRK_PTEG_FROM_L2MISS
209 /sys/devices/cpu/events/PM_IC_DEMAND_L2_BHT_REDIRECT
210 /sys/devices/cpu/events/PM_DATA_FROM_L31_SHR
211 /sys/devices/cpu/events/PM_IC_PREF_CANCEL_L2
212 /sys/devices/cpu/events/PM_MRK_FIN_STALL_CYC_COUNT
213 /sys/devices/cpu/events/PM_BR_PRED_CCACHE
214 /sys/devices/cpu/events/PM_GCT_UTIL_1_TO_2_SLOTS
215 /sys/devices/cpu/events/PM_MRK_ST_CMPL_INT
216 /sys/devices/cpu/events/PM_LSU_TWO_TABLEWALK_CYC
217 /sys/devices/cpu/events/PM_MRK_DATA_FROM_L3MISS
218 /sys/devices/cpu/events/PM_LSU_SET_MPRED
219 /sys/devices/cpu/events/PM_FLUSH_DISP_TLBIE
220 /sys/devices/cpu/events/PM_VSU1_FCONV
221 /sys/devices/cpu/events/PM_DERAT_MISS_16G
222 /sys/devices/cpu/events/PM_INST_FROM_LMEM
223 /sys/devices/cpu/events/PM_IC_DEMAND_L2_BR_REDIRECT
224 /sys/devices/cpu/events/PM_INST_PTEG_FROM_L2
225 /sys/devices/cpu/events/PM_PTEG_FROM_L2
226 /sys/devices/cpu/events/PM_MRK_DATA_FROM_L21_SHR_CYC
227 /sys/devices/cpu/events/PM_MRK_DTLB_MISS_4K
228 /sys/devices/cpu/events/PM_VSU0_FPSCR
229 /sys/devices/cpu/events/PM_VSU1_VECT_DOUBLE_ISSUED
230 /sys/devices/cpu/events/PM_MRK_PTEG_FROM_RL2L3_MOD
231 /sys/devices/cpu/events/PM_MEM0_RQ_DISP
232 /sys/devices/cpu/events/PM_L2_LD_MISS
233 /sys/devices/cpu/events/PM_VMX_RESULT_SAT_1
234 /sys/devices/cpu/events/PM_L1_PREF
235 /sys/devices/cpu/events/PM_MRK_DATA_FROM_LMEM_CYC
236 /sys/devices/cpu/events/PM_GRP_IC_MISS_NONSPEC
237 /sys/devices/cpu/events/PM_PB_NODE_PUMP
238 /sys/devices/cpu/events/PM_SHL_MERGED
239 /sys/devices/cpu/events/PM_NEST_PAIR1_ADD
240 /sys/devices/cpu/events/PM_DATA_FROM_L3
241 /sys/devices/cpu/events/PM_LSU_FLUSH
242 /sys/devices/cpu/events/PM_LSU_SRQ_SYNC_COUNT
243 /sys/devices/cpu/events/PM_PMC2_OVERFLOW
244 /sys/devices/cpu/events/PM_LSU_LDF
245 /sys/devices/cpu/events/PM_POWER_EVENT3
246 /sys/devices/cpu/events/PM_DISP_WT
247 /sys/devices/cpu/events/PM_IC_BANK_CONFLICT
248 /sys/devices/cpu/events/PM_BR_MPRED_CR_TA
249 /sys/devices/cpu/events/PM_L2_INST_MISS
250 /sys/devices/cpu/events/PM_NEST_PAIR2_ADD
251 /sys/devices/cpu/events/PM_MRK_LSU_FLUSH
252 /sys/devices/cpu/events/PM_L2_LDST
253 /sys/devices/cpu/events/PM_INST_FROM_L31_SHR
254 /sys/devices/cpu/events/PM_VSU0_FIN
255 /sys/devices/cpu/events/PM_VSU1_FCONV
256 /sys/devices/cpu/events/PM_INST_FROM_RMEM
257 /sys/devices/cpu/events/PM_DISP_CLB_HELD_TLBIE
258 /sys/devices/cpu/events/PM_MRK_DATA_FROM_DMEM_CYC
259 /sys/devices/cpu/events/PM_BR_PRED_CR
260 /sys/devices/cpu/events/PM_LSU_REJECT
261 /sys/devices/cpu/events/PM_GCT_UTIL_3_TO_6_SLOTS
262 /sys/devices/cpu/events/PM_CMPLU_STALL_END_GCT_NOSLOT
263 /sys/devices/cpu/events/PM_LSU0_REJECT_LMQ_FULL
264 /sys/devices/cpu/events/PM_VSU_FEST
265 /sys/devices/cpu/events/PM_NEST_PAIR0_AND
266 /sys/devices/cpu/events/PM_PTEG_FROM_L3
267 /sys/devices/cpu/events/PM_POWER_EVENT2
268 /sys/devices/cpu/events/PM_IC_PREF_CANCEL_PAGE
269 /sys/devices/cpu/events/PM_VSU0_FSQRT_FDIV
270 /sys/devices/cpu/events/PM_MRK_GRP_CMPL
271 /sys/devices/cpu/events/PM_VSU0_SCAL_DOUBLE_ISSUED
272 /sys/devices/cpu/events/PM_GRP_DISP
273 /sys/devices/cpu/events/PM_LSU0_LDX
274 /sys/devices/cpu/events/PM_DATA_FROM_L2
275 /sys/devices/cpu/events/PM_MRK_DATA_FROM_RL2L3_MOD
276 /sys/devices/cpu/events/PM_VSU0_VECT_DOUBLE_ISSUED
277 /sys/devices/cpu/events/PM_VSU1_2FLOP_DOUBLE
278 /sys/devices/cpu/events/PM_THRD_PRIO_6_7_CYC
279 /sys/devices/cpu/events/PM_BC_PLUS_8_RSLV_TAKEN
280 /sys/devices/cpu/events/PM_BR_MPRED_CR
281 /sys/devices/cpu/events/PM_L3_CO_MEM
282 /sys/devices/cpu/events/PM_DATA_FROM_RL2L3_MOD
283 /sys/devices/cpu/events/PM_LSU_SRQ_FULL_CYC
284 /sys/devices/cpu/events/PM_TABLEWALK_CYC
285 /sys/devices/cpu/events/PM_MRK_PTEG_FROM_RMEM
286 /sys/devices/cpu/events/PM_LSU_SRQ_STFWD
287 /sys/devices/cpu/events/PM_INST_PTEG_FROM_RMEM
288 /sys/devices/cpu/events/PM_FXU0_FIN
289 /sys/devices/cpu/events/PM_LSU1_L1_SW_PREF
290 /sys/devices/cpu/events/PM_PTEG_FROM_L31_MOD
291 /sys/devices/cpu/events/PM_PMC5_OVERFLOW
292 /sys/devices/cpu/events/PM_LD_REF_L1_LSU1
293 /sys/devices/cpu/events/PM_INST_PTEG_FROM_L21_SHR
294 /sys/devices/cpu/events/PM_DATA_FROM_RMEM
295 /sys/devices/cpu/events/PM_VSU0_SCAL_SINGLE_ISSUED
296 /sys/devices/cpu/events/PM_BR_MPRED_LSTACK
297 /sys/devices/cpu/events/PM_MRK_DATA_FROM_RL2L3_MOD_CYC
298 /sys/devices/cpu/events/PM_LSU0_FLUSH_UST
299 /sys/devices/cpu/events/PM_LSU_NCST
300 /sys/devices/cpu/events/PM_BR_TAKEN
301 /sys/devices/cpu/events/PM_INST_PTEG_FROM_LMEM
302 /sys/devices/cpu/events/PM_DTLB_MISS_4K
303 /sys/devices/cpu/events/PM_PMC4_SAVED
304 /sys/devices/cpu/events/PM_VSU1_PERMUTE_ISSUED
305 /sys/devices/cpu/events/PM_SLB_MISS
306 /sys/devices/cpu/events/PM_LSU1_FLUSH_LRQ
307 /sys/devices/cpu/events/PM_DTLB_MISS
308 /sys/devices/cpu/events/PM_VSU1_FRSP
309 /sys/devices/cpu/events/PM_VSU_VECTOR_DOUBLE_ISSUED
310 /sys/devices/cpu/events/PM_L2_CASTOUT_SHR
311 /sys/devices/cpu/events/PM_DATA_FROM_DL2L3_SHR
312 /sys/devices/cpu/events/PM_VSU1_STF
313 /sys/devices/cpu/events/PM_ST_FIN
314 /sys/devices/cpu/events/PM_PTEG_FROM_L21_SHR
315 /sys/devices/cpu/events/PM_L2_LOC_GUESS_WRONG
316 /sys/devices/cpu/events/PM_MRK_STCX_FAIL
317 /sys/devices/cpu/events/PM_LSU0_REJECT_LHS
318 /sys/devices/cpu/events/PM_IC_PREF_CANCEL_HIT
319 /sys/devices/cpu/events/PM_L3_PREF_BUSY
320 /sys/devices/cpu/events/PM_MRK_BRU_FIN
321 /sys/devices/cpu/events/PM_LSU1_NCLD
322 /sys/devices/cpu/events/PM_INST_PTEG_FROM_L31_MOD
323 /sys/devices/cpu/events/PM_LSU_NCLD
324 /sys/devices/cpu/events/PM_LSU_LDX
325 /sys/devices/cpu/events/PM_L2_LOC_GUESS_CORRECT
326 /sys/devices/cpu/events/PM_THRESH_TIMEO
327 /sys/devices/cpu/events/PM_L3_PREF_ST
328 /sys/devices/cpu/events/PM_DISP_CLB_HELD_SYNC
329 /sys/devices/cpu/events/PM_VSU_SIMPLE_ISSUED
330 /sys/devices/cpu/events/PM_VSU1_SINGLE
331 /sys/devices/cpu/events/PM_DATA_TABLEWALK_CYC
332 /sys/devices/cpu/events/PM_L2_RC_ST_DONE
333 /sys/devices/cpu/events/PM_MRK_PTEG_FROM_L21_MOD
334 /sys/devices/cpu/events/PM_LARX_LSU1
335 /sys/devices/cpu/events/PM_MRK_DATA_FROM_RMEM
336 /sys/devices/cpu/events/PM_DISP_CLB_HELD
337 /sys/devices/cpu/events/PM_DERAT_MISS_4K
338 /sys/devices/cpu/events/PM_L2_RCLD_DISP_FAIL_ADDR
339 /sys/devices/cpu/events/PM_SEG_EXCEPTION
340 /sys/devices/cpu/events/PM_FLUSH_DISP_SB
341 /sys/devices/cpu/events/PM_L2_DC_INV
342 /sys/devices/cpu/events/PM_PTEG_FROM_DL2L3_MOD
343 /sys/devices/cpu/events/PM_DSEG
344 /sys/devices/cpu/events/PM_BR_PRED_LSTACK
345 /sys/devices/cpu/events/PM_VSU0_STF
346 /sys/devices/cpu/events/PM_LSU_FX_FIN
347 /sys/devices/cpu/events/PM_DERAT_MISS_16M
348 /sys/devices/cpu/events/PM_MRK_PTEG_FROM_DL2L3_MOD
349 /sys/devices/cpu/events/PM_GCT_UTIL_11_PLUS_SLOTS
350 /sys/devices/cpu/events/PM_INST_FROM_L3
351 /sys/devices/cpu/events/PM_MRK_IFU_FIN
352 /sys/devices/cpu/events/PM_ITLB_MISS
353 /sys/devices/cpu/events/PM_VSU_STF
354 /sys/devices/cpu/events/PM_LSU_FLUSH_UST
355 /sys/devices/cpu/events/PM_L2_LDST_MISS
356 /sys/devices/cpu/events/PM_FXU1_FIN
357 /sys/devices/cpu/events/PM_SHL_DEALLOCATED
358 /sys/devices/cpu/events/PM_L2_SN_M_WR_DONE
359 /sys/devices/cpu/events/PM_LSU_REJECT_SET_MPRED
360 /sys/devices/cpu/events/PM_L3_PREF_LD
361 /sys/devices/cpu/events/PM_L2_SN_M_RD_DONE
362 /sys/devices/cpu/events/PM_MRK_DERAT_MISS_16G
363 /sys/devices/cpu/events/PM_VSU_FCONV
364 /sys/devices/cpu/events/PM_ANY_THRD_RUN_CYC
365 /sys/devices/cpu/events/PM_LSU_LMQ_FULL_CYC
366 /sys/devices/cpu/events/PM_MRK_LSU_REJECT_LHS
367 /sys/devices/cpu/events/PM_MRK_LD_MISS_L1_CYC
368 /sys/devices/cpu/events/PM_MRK_DATA_FROM_L2_CYC
369 /sys/devices/cpu/events/PM_INST_IMC_MATCH_DISP
370 /sys/devices/cpu/events/PM_MRK_DATA_FROM_RMEM_CYC
371 /sys/devices/cpu/events/PM_VSU0_SIMPLE_ISSUED
372 /sys/devices/cpu/events/PM_MRK_PTEG_FROM_RL2L3_SHR
373 /sys/devices/cpu/events/PM_VSU_FMA_DOUBLE
374 /sys/devices/cpu/events/PM_VSU_4FLOP
375 /sys/devices/cpu/events/PM_VSU1_FIN
376 /sys/devices/cpu/events/PM_NEST_PAIR1_AND
377 /sys/devices/cpu/events/PM_INST_PTEG_FROM_RL2L3_MOD
378 /sys/devices/cpu/events/PM_PTEG_FROM_RMEM
379 /sys/devices/cpu/events/PM_LSU_LRQ_S0_VALID
380 /sys/devices/cpu/events/PM_LSU0_LDF
381 /sys/devices/cpu/events/PM_FLUSH_COMPLETION
382 /sys/devices/cpu/events/PM_ST_MISS_L1
383 /sys/devices/cpu/events/PM_L2_NODE_PUMP
384 /sys/devices/cpu/events/PM_INST_FROM_DL2L3_SHR
385 /sys/devices/cpu/events/PM_MRK_STALL_CMPLU_CYC
386 /sys/devices/cpu/events/PM_VSU1_DENORM
387 /sys/devices/cpu/events/PM_MRK_DATA_FROM_L31_SHR_CYC
388 /sys/devices/cpu/events/PM_NEST_PAIR0_ADD
389 /sys/devices/cpu/events/PM_INST_FROM_L3MISS
390 /sys/devices/cpu/events/PM_EE_OFF_EXT_INT
391 /sys/devices/cpu/events/PM_INST_PTEG_FROM_DMEM
392 /sys/devices/cpu/events/PM_INST_FROM_DL2L3_MOD
393 /sys/devices/cpu/events/PM_PMC6_OVERFLOW
394 /sys/devices/cpu/events/PM_VSU_2FLOP_DOUBLE
395 /sys/devices/cpu/events/PM_TLB_MISS
396 /sys/devices/cpu/events/PM_FXU_BUSY
397 /sys/devices/cpu/events/PM_L2_RCLD_DISP_FAIL_OTHER
398 /sys/devices/cpu/events/PM_LSU_REJECT_LMQ_FULL
399 /sys/devices/cpu/events/PM_IC_RELOAD_SHR
400 /sys/devices/cpu/events/PM_GRP_MRK
401 /sys/devices/cpu/events/PM_MRK_ST_NEST
402 /sys/devices/cpu/events/PM_VSU1_FSQRT_FDIV
403 /sys/devices/cpu/events/PM_LSU0_FLUSH_LRQ
404 /sys/devices/cpu/events/PM_LARX_LSU0
405 /sys/devices/cpu/events/PM_IBUF_FULL_CYC
406 /sys/devices/cpu/events/PM_MRK_DATA_FROM_DL2L3_SHR_CYC
407 /sys/devices/cpu/events/PM_LSU_DC_PREF_STREAM_ALLOC
408 /sys/devices/cpu/events/PM_GRP_MRK_CYC
409 /sys/devices/cpu/events/PM_MRK_DATA_FROM_RL2L3_SHR_CYC
410 /sys/devices/cpu/events/PM_L2_GLOB_GUESS_CORRECT
411 /sys/devices/cpu/events/PM_LSU_REJECT_LHS
412 /sys/devices/cpu/events/PM_MRK_DATA_FROM_LMEM
413 /sys/devices/cpu/events/PM_INST_PTEG_FROM_L3
414 /sys/devices/cpu/events/PM_FREQ_DOWN
415 /sys/devices/cpu/events/PM_PB_RETRY_NODE_PUMP
416 /sys/devices/cpu/events/PM_INST_FROM_RL2L3_SHR
417 /sys/devices/cpu/events/PM_MRK_INST_ISSUED
418 /sys/devices/cpu/events/PM_PTEG_FROM_L3MISS
419 /sys/devices/cpu/events/PM_RUN_PURR
420 /sys/devices/cpu/events/PM_MRK_GRP_IC_MISS
421 /sys/devices/cpu/events/PM_MRK_DATA_FROM_L3
422 /sys/devices/cpu/events/PM_PTEG_FROM_RL2L3_SHR
423 /sys/devices/cpu/events/PM_LSU_FLUSH_LRQ
424 /sys/devices/cpu/events/PM_MRK_DERAT_MISS_64K
425 /sys/devices/cpu/events/PM_INST_PTEG_FROM_DL2L3_MOD
426 /sys/devices/cpu/events/PM_L2_ST_MISS
427 /sys/devices/cpu/events/PM_MRK_PTEG_FROM_L21_SHR
428 /sys/devices/cpu/events/PM_LWSYNC
429 /sys/devices/cpu/events/PM_LSU0_DC_PREF_STREAM_CONFIRM_STRIDE
430 /sys/devices/cpu/events/PM_MRK_LSU_FLUSH_LRQ
431 /sys/devices/cpu/events/PM_INST_IMC_MATCH_CMPL
432 /sys/devices/cpu/events/PM_NEST_PAIR3_AND
433 /sys/devices/cpu/events/PM_PB_RETRY_SYS_PUMP
434 /sys/devices/cpu/events/PM_MRK_INST_FIN
435 /sys/devices/cpu/events/PM_MRK_PTEG_FROM_DL2L3_SHR
436 /sys/devices/cpu/events/PM_INST_FROM_L31_MOD
437 /sys/devices/cpu/events/PM_MRK_DTLB_MISS_64K
438 /sys/devices/cpu/events/PM_LSU_FIN
439 /sys/devices/cpu/events/PM_MRK_LSU_REJECT
440 /sys/devices/cpu/events/PM_L2_CO_FAIL_BUSY
441 /sys/devices/cpu/events/PM_MEM0_WQ_DISP
442 /sys/devices/cpu/events/PM_DATA_FROM_L31_MOD
443 /sys/devices/cpu/events/PM_THERMAL_WARN
444 /sys/devices/cpu/events/PM_VSU0_4FLOP
445 /sys/devices/cpu/events/PM_BR_MPRED_CCACHE
446 /sys/devices/cpu/events/PM_L1_DEMAND_WRITE
447 /sys/devices/cpu/events/PM_FLUSH_BR_MPRED
448 /sys/devices/cpu/events/PM_MRK_DTLB_MISS_16G
449 /sys/devices/cpu/events/PM_MRK_PTEG_FROM_DMEM
450 /sys/devices/cpu/events/PM_L2_RCST_DISP
451 /sys/devices/cpu/events/PM_LSU_PARTIAL_CDF
452 /sys/devices/cpu/events/PM_DISP_CLB_HELD_SB
453 /sys/devices/cpu/events/PM_VSU0_FMA_DOUBLE
454 /sys/devices/cpu/events/PM_FXU0_BUSY_FXU1_IDLE
455 /sys/devices/cpu/events/PM_IC_DEMAND_CYC
456 /sys/devices/cpu/events/PM_MRK_DATA_FROM_L21_SHR
457 /sys/devices/cpu/events/PM_MRK_LSU_FLUSH_UST
458 /sys/devices/cpu/events/PM_INST_PTEG_FROM_L3MISS
459 /sys/devices/cpu/events/PM_VSU_DENORM
460 /sys/devices/cpu/events/PM_MRK_LSU_PARTIAL_CDF
461 /sys/devices/cpu/events/PM_INST_FROM_L21_SHR
462 /sys/devices/cpu/events/PM_IC_PREF_WRITE
463 /sys/devices/cpu/events/PM_BR_PRED
464 /sys/devices/cpu/events/PM_INST_FROM_DMEM
465 /sys/devices/cpu/events/PM_IC_PREF_CANCEL_ALL
466 /sys/devices/cpu/events/PM_LSU_DC_PREF_STREAM_CONFIRM
467 /sys/devices/cpu/events/PM_MRK_LSU_FLUSH_SRQ
468 /sys/devices/cpu/events/PM_MRK_FIN_STALL_CYC
469 /sys/devices/cpu/events/PM_L2_RCST_DISP_FAIL_OTHER
470 /sys/devices/cpu/events/PM_VSU1_DD_ISSUED
471 /sys/devices/cpu/events/PM_PTEG_FROM_L31_SHR
472 /sys/devices/cpu/events/PM_DATA_FROM_L21_SHR
473 /sys/devices/cpu/events/PM_LSU0_NCLD
474 /sys/devices/cpu/events/PM_VSU1_4FLOP
475 /sys/devices/cpu/events/PM_VSU1_8FLOP
476 /sys/devices/cpu/events/PM_VSU_8FLOP
477 /sys/devices/cpu/events/PM_LSU_LMQ_SRQ_EMPTY_CYC
478 /sys/devices/cpu/events/PM_DTLB_MISS_64K
479 /sys/devices/cpu/events/PM_THRD_CONC_RUN_INST
480 /sys/devices/cpu/events/PM_MRK_PTEG_FROM_L2
481 /sys/devices/cpu/events/PM_PB_SYS_PUMP
482 /sys/devices/cpu/events/PM_VSU_FIN
483 /sys/devices/cpu/events/PM_MRK_DATA_FROM_L31_MOD
484 /sys/devices/cpu/events/PM_THRD_PRIO_0_1_CYC
485 /sys/devices/cpu/events/PM_DERAT_MISS_64K
486 /sys/devices/cpu/events/PM_PMC2_REWIND
487 /sys/devices/cpu/events/PM_INST_FROM_L2
488 /sys/devices/cpu/events/PM_GRP_BR_MPRED_NONSPEC
489 /sys/devices/cpu/events/PM_INST_DISP
490 /sys/devices/cpu/events/PM_MEM0_RD_CANCEL_TOTAL
491 /sys/devices/cpu/events/PM_LSU0_DC_PREF_STREAM_CONFIRM
492 /sys/devices/cpu/events/PM_L1_DCACHE_RELOAD_VALID
493 /sys/devices/cpu/events/PM_VSU_SCALAR_DOUBLE_ISSUED
494 /sys/devices/cpu/events/PM_L3_PREF_HIT
495 /sys/devices/cpu/events/PM_MRK_PTEG_FROM_L31_MOD
496 /sys/devices/cpu/events/PM_MRK_FXU_FIN
497 /sys/devices/cpu/events/PM_PMC4_OVERFLOW
498 /sys/devices/cpu/events/PM_MRK_PTEG_FROM_L3
499 /sys/devices/cpu/events/PM_LSU0_LMQ_LHR_MERGE
500 /sys/devices/cpu/events/PM_BTAC_HIT
501 /sys/devices/cpu/events/PM_L3_RD_BUSY
502 /sys/devices/cpu/events/PM_LSU0_L1_SW_PREF
503 /sys/devices/cpu/events/PM_INST_FROM_L2MISS
504 /sys/devices/cpu/events/PM_LSU0_DC_PREF_STREAM_ALLOC
505 /sys/devices/cpu/events/PM_L2_ST
506 /sys/devices/cpu/events/PM_VSU0_DENORM
507 /sys/devices/cpu/events/PM_MRK_DATA_FROM_DL2L3_SHR
508 /sys/devices/cpu/events/PM_BR_PRED_CR_TA
509 /sys/devices/cpu/events/PM_VSU0_FCONV
510 /sys/devices/cpu/events/PM_MRK_LSU_FLUSH_ULD
511 /sys/devices/cpu/events/PM_BTAC_MISS
512 /sys/devices/cpu/events/PM_MRK_LD_MISS_EXPOSED_CYC_COUNT
513 /sys/devices/cpu/events/PM_MRK_DATA_FROM_L2
514 /sys/devices/cpu/events/PM_LSU_DCACHE_RELOAD_VALID
515 /sys/devices/cpu/events/PM_VSU_FMA
516 /sys/devices/cpu/events/PM_LSU0_FLUSH_SRQ
517 /sys/devices/cpu/events/PM_LSU1_L1_PREF
518 /sys/devices/cpu/events/PM_IOPS_CMPL
519 /sys/devices/cpu/events/PM_L2_SYS_PUMP
520 /sys/devices/cpu/events/PM_L2_RCLD_BUSY_RC_FULL
521 /sys/devices/cpu/events/PM_LSU_LMQ_S0_ALLOC
522 /sys/devices/cpu/events/PM_FLUSH_DISP_SYNC
523 /sys/devices/cpu/events/PM_MRK_DATA_FROM_DL2L3_MOD_CYC
524 /sys/devices/cpu/events/PM_L2_IC_INV
525 /sys/devices/cpu/events/PM_MRK_DATA_FROM_L21_MOD_CYC
526 /sys/devices/cpu/events/PM_L3_PREF_LDST
527 /sys/devices/cpu/events/PM_LSU_SRQ_EMPTY_CYC
528 /sys/devices/cpu/events/PM_LSU_LMQ_S0_VALID
529 /sys/devices/cpu/events/PM_FLUSH_PARTIAL
530 /sys/devices/cpu/events/PM_VSU1_FMA_DOUBLE
531 /sys/devices/cpu/events/PM_1PLUS_PPC_DISP
532 /sys/devices/cpu/events/PM_DATA_FROM_L2MISS
533 /sys/devices/cpu/events/PM_SUSPENDED
534 /sys/devices/cpu/events/PM_VSU0_FMA
535 /sys/devices/cpu/events/PM_STCX_FAIL
536 /sys/devices/cpu/events/PM_VSU0_FSQRT_FDIV_DOUBLE
537 /sys/devices/cpu/events/PM_DC_PREF_DST
538 /sys/devices/cpu/events/PM_VSU1_SCAL_SINGLE_ISSUED
539 /sys/devices/cpu/events/PM_L3_HIT
540 /sys/devices/cpu/events/PM_L2_GLOB_GUESS_WRONG
541 /sys/devices/cpu/events/PM_MRK_DFU_FIN
542 /sys/devices/cpu/events/PM_INST_FROM_L1
543 /sys/devices/cpu/events/PM_IC_DEMAND_REQ
544 /sys/devices/cpu/events/PM_VSU1_FSQRT_FDIV_DOUBLE
545 /sys/devices/cpu/events/PM_VSU1_FMA
546 /sys/devices/cpu/events/PM_MRK_LD_MISS_L1
547 /sys/devices/cpu/events/PM_VSU0_2FLOP_DOUBLE
548 /sys/devices/cpu/events/PM_LSU_DC_PREF_STRIDED_STREAM_CONFIRM
549 /sys/devices/cpu/events/PM_INST_PTEG_FROM_L31_SHR
550 /sys/devices/cpu/events/PM_MRK_LSU_REJECT_ERAT_MISS
551 /sys/devices/cpu/events/PM_MRK_DATA_FROM_L2MISS
552 /sys/devices/cpu/events/PM_DATA_FROM_RL2L3_SHR
553 /sys/devices/cpu/events/PM_INST_FROM_PREF
554 /sys/devices/cpu/events/PM_VSU1_SQ
555 /sys/devices/cpu/events/PM_L2_LD_DISP
556 /sys/devices/cpu/events/PM_L2_DISP_ALL
557 /sys/devices/cpu/events/PM_THRD_GRP_CMPL_BOTH_CYC
558 /sys/devices/cpu/events/PM_VSU_FSQRT_FDIV_DOUBLE
559 /sys/devices/cpu/events/PM_INST_PTEG_FROM_DL2L3_SHR
560 /sys/devices/cpu/events/PM_VSU_1FLOP
561 /sys/devices/cpu/events/PM_HV_CYC
562 /sys/devices/cpu/events/PM_MRK_LSU_FIN
563 /sys/devices/cpu/events/PM_MRK_DATA_FROM_RL2L3_SHR
564 /sys/devices/cpu/events/PM_DTLB_MISS_16M
565 /sys/devices/cpu/events/PM_LSU1_LMQ_LHR_MERGE
566 /sys/devices/cpu/events/PM_IFU_FIN
567 /sys/devices/cpu/events/PM_1THRD_CON_RUN_INSTR
568 /sys/devices/cpu/events/PM_CMPLU_STALL_COUNT
569 /sys/devices/cpu/events/PM_MEM0_PB_RD_CL
570 /sys/devices/cpu/events/PM_THRD_1_RUN_CYC
571 /sys/devices/cpu/events/PM_THRD_2_CONC_RUN_INSTR
572 /sys/devices/cpu/events/PM_THRD_2_RUN_CYC
573 /sys/devices/cpu/events/PM_THRD_3_CONC_RUN_INST
574 /sys/devices/cpu/events/PM_THRD_3_RUN_CYC
575 /sys/devices/cpu/events/PM_THRD_4_CONC_RUN_INST
576 /sys/devices/cpu/events/PM_THRD_4_RUN_CYC
60 577
61Date: 2013/01/08 578Date: 2013/01/08
62 579
diff --git a/Documentation/ABI/testing/sysfs-bus-event_source-devices-hv_24x7 b/Documentation/ABI/testing/sysfs-bus-event_source-devices-hv_24x7
new file mode 100644
index 000000000000..e78ee798d7bd
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-event_source-devices-hv_24x7
@@ -0,0 +1,23 @@
1What: /sys/bus/event_source/devices/hv_24x7/interface/catalog
2Date: February 2014
3Contact: Cody P Schafer <cody@linux.vnet.ibm.com>
4Description:
5 Provides access to the binary "24x7 catalog" provided by the
6 hypervisor on POWER7 and 8 systems. This catalog lists events
7 avaliable from the powerpc "hv_24x7" pmu. Its format is
8 documented here:
9 https://raw.githubusercontent.com/jmesmon/catalog-24x7/master/hv-24x7-catalog.h
10
11What: /sys/bus/event_source/devices/hv_24x7/interface/catalog_length
12Date: February 2014
13Contact: Cody P Schafer <cody@linux.vnet.ibm.com>
14Description:
15 A number equal to the length in bytes of the catalog. This is
16 also extractable from the provided binary "catalog" sysfs entry.
17
18What: /sys/bus/event_source/devices/hv_24x7/interface/catalog_version
19Date: February 2014
20Contact: Cody P Schafer <cody@linux.vnet.ibm.com>
21Description:
22 Exposes the "version" field of the 24x7 catalog. This is also
23 extractable from the provided binary "catalog" sysfs entry.
diff --git a/Documentation/ABI/testing/sysfs-bus-event_source-devices-hv_gpci b/Documentation/ABI/testing/sysfs-bus-event_source-devices-hv_gpci
new file mode 100644
index 000000000000..3fa58c23f13b
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-event_source-devices-hv_gpci
@@ -0,0 +1,43 @@
1What: /sys/bus/event_source/devices/hv_gpci/interface/collect_privileged
2Date: February 2014
3Contact: Cody P Schafer <cody@linux.vnet.ibm.com>
4Description:
5 '0' if the hypervisor is configured to forbid access to event
6 counters being accumulated by other guests and to physical
7 domain event counters.
8 '1' if that access is allowed.
9
10What: /sys/bus/event_source/devices/hv_gpci/interface/ga
11Date: February 2014
12Contact: Cody P Schafer <cody@linux.vnet.ibm.com>
13Description:
14 0 or 1. Indicates whether we have access to "GA" events (listed
15 in arch/powerpc/perf/hv-gpci.h).
16
17What: /sys/bus/event_source/devices/hv_gpci/interface/expanded
18Date: February 2014
19Contact: Cody P Schafer <cody@linux.vnet.ibm.com>
20Description:
21 0 or 1. Indicates whether we have access to "EXPANDED" events (listed
22 in arch/powerpc/perf/hv-gpci.h).
23
24What: /sys/bus/event_source/devices/hv_gpci/interface/lab
25Date: February 2014
26Contact: Cody P Schafer <cody@linux.vnet.ibm.com>
27Description:
28 0 or 1. Indicates whether we have access to "LAB" events (listed
29 in arch/powerpc/perf/hv-gpci.h).
30
31What: /sys/bus/event_source/devices/hv_gpci/interface/version
32Date: February 2014
33Contact: Cody P Schafer <cody@linux.vnet.ibm.com>
34Description:
35 A number indicating the version of the gpci interface that the
36 hypervisor reports supporting.
37
38What: /sys/bus/event_source/devices/hv_gpci/interface/kernel_version
39Date: February 2014
40Contact: Cody P Schafer <cody@linux.vnet.ibm.com>
41Description:
42 A number indicating the latest version of the gpci interface
43 that the kernel is aware of.
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/l2cache.txt b/Documentation/devicetree/bindings/powerpc/fsl/l2cache.txt
new file mode 100644
index 000000000000..c41b2187eaa8
--- /dev/null
+++ b/Documentation/devicetree/bindings/powerpc/fsl/l2cache.txt
@@ -0,0 +1,23 @@
1Freescale L2 Cache Controller
2
3L2 cache is present in Freescale's QorIQ and QorIQ Qonverge platforms.
4The cache bindings explained below are ePAPR compliant
5
6Required Properties:
7
8- compatible : Should include "fsl,chip-l2-cache-controller" and "cache"
9 where chip is the processor (bsc9132, npc8572 etc.)
10- reg : Address and size of L2 cache controller registers
11- cache-size : Size of the entire L2 cache
12- interrupts : Error interrupt of L2 controller
13- cache-line-size : Size of L2 cache lines
14
15Example:
16
17 L2: l2-cache-controller@20000 {
18 compatible = "fsl,bsc9132-l2-cache-controller", "cache";
19 reg = <0x20000 0x1000>;
20 cache-line-size = <32>; // 32 bytes
21 cache-size = <0x40000>; // L2,256K
22 interrupts = <16 2 1 0>;
23 };
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/mem-ctrlr.txt b/Documentation/devicetree/bindings/powerpc/fsl/mem-ctrlr.txt
new file mode 100644
index 000000000000..f87856faf1ab
--- /dev/null
+++ b/Documentation/devicetree/bindings/powerpc/fsl/mem-ctrlr.txt
@@ -0,0 +1,27 @@
1Freescale DDR memory controller
2
3Properties:
4
5- compatible : Should include "fsl,chip-memory-controller" where
6 chip is the processor (bsc9132, mpc8572 etc.), or
7 "fsl,qoriq-memory-controller".
8- reg : Address and size of DDR controller registers
9- interrupts : Error interrupt of DDR controller
10
11Example 1:
12
13 memory-controller@2000 {
14 compatible = "fsl,bsc9132-memory-controller";
15 reg = <0x2000 0x1000>;
16 interrupts = <16 2 1 8>;
17 };
18
19
20Example 2:
21
22 ddr1: memory-controller@8000 {
23 compatible = "fsl,qoriq-memory-controller-v4.7",
24 "fsl,qoriq-memory-controller";
25 reg = <0x8000 0x1000>;
26 interrupts = <16 2 1 23>;
27 };
diff --git a/Documentation/devicetree/bindings/usb/fsl-usb.txt b/Documentation/devicetree/bindings/usb/fsl-usb.txt
index bd5723f0b67e..4779c029b675 100644
--- a/Documentation/devicetree/bindings/usb/fsl-usb.txt
+++ b/Documentation/devicetree/bindings/usb/fsl-usb.txt
@@ -8,7 +8,9 @@ and additions :
8Required properties : 8Required properties :
9 - compatible : Should be "fsl-usb2-mph" for multi port host USB 9 - compatible : Should be "fsl-usb2-mph" for multi port host USB
10 controllers, or "fsl-usb2-dr" for dual role USB controllers 10 controllers, or "fsl-usb2-dr" for dual role USB controllers
11 or "fsl,mpc5121-usb2-dr" for dual role USB controllers of MPC5121 11 or "fsl,mpc5121-usb2-dr" for dual role USB controllers of MPC5121.
12 Wherever applicable, the IP version of the USB controller should
13 also be mentioned (for eg. fsl-usb2-dr-v2.2 for bsc9132).
12 - phy_type : For multi port host USB controllers, should be one of 14 - phy_type : For multi port host USB controllers, should be one of
13 "ulpi", or "serial". For dual role USB controllers, should be 15 "ulpi", or "serial". For dual role USB controllers, should be
14 one of "ulpi", "utmi", "utmi_wide", or "serial". 16 one of "ulpi", "utmi", "utmi_wide", or "serial".
diff --git a/MAINTAINERS b/MAINTAINERS
index b99bbbc4c5dd..e2ed69f1c430 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5254,11 +5254,10 @@ F: arch/powerpc/platforms/512x/
5254F: arch/powerpc/platforms/52xx/ 5254F: arch/powerpc/platforms/52xx/
5255 5255
5256LINUX FOR POWERPC EMBEDDED PPC4XX 5256LINUX FOR POWERPC EMBEDDED PPC4XX
5257M: Josh Boyer <jwboyer@gmail.com> 5257M: Alistair Popple <alistair@popple.id.au>
5258M: Matt Porter <mporter@kernel.crashing.org> 5258M: Matt Porter <mporter@kernel.crashing.org>
5259W: http://www.penguinppc.org/ 5259W: http://www.penguinppc.org/
5260L: linuxppc-dev@lists.ozlabs.org 5260L: linuxppc-dev@lists.ozlabs.org
5261T: git git://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx.git
5262S: Maintained 5261S: Maintained
5263F: arch/powerpc/platforms/40x/ 5262F: arch/powerpc/platforms/40x/
5264F: arch/powerpc/platforms/44x/ 5263F: arch/powerpc/platforms/44x/
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index b9fcecc706ab..05e532984c13 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -618,6 +618,15 @@ config CMDLINE
618 some command-line options at build time by entering them here. In 618 some command-line options at build time by entering them here. In
619 most cases you will need to specify the root device here. 619 most cases you will need to specify the root device here.
620 620
621config CMDLINE_FORCE
622 bool "Always use the default kernel command string"
623 depends on CMDLINE_BOOL
624 help
625 Always use the default kernel command string, even if the boot
626 loader passes other arguments to the kernel.
627 This is useful if you cannot or don't want to change the
628 command-line options your boot loader passes to the kernel.
629
621config EXTRA_TARGETS 630config EXTRA_TARGETS
622 string "Additional default image types" 631 string "Additional default image types"
623 help 632 help
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/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/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig
index e9a8b4e0a0f6..9ea8342bd219 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,5 @@ 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
diff --git a/arch/powerpc/configs/pseries_le_defconfig b/arch/powerpc/configs/pseries_le_defconfig
index 62771e0adb7c..3c84f9d87980 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
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/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/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/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_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/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..ffafab037ba8 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -83,6 +83,8 @@ 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) */
88#define OPAL_CONSOLE_WRITE 1 90#define OPAL_CONSOLE_WRITE 1
@@ -151,12 +153,26 @@ extern int opal_enter_rtas(struct rtas_args *args,
151#define OPAL_LPC_READ 67 153#define OPAL_LPC_READ 67
152#define OPAL_LPC_WRITE 68 154#define OPAL_LPC_WRITE 68
153#define OPAL_RETURN_CPU 69 155#define OPAL_RETURN_CPU 69
156#define OPAL_ELOG_READ 71
157#define OPAL_ELOG_WRITE 72
158#define OPAL_ELOG_ACK 73
159#define OPAL_ELOG_RESEND 74
160#define OPAL_ELOG_SIZE 75
154#define OPAL_FLASH_VALIDATE 76 161#define OPAL_FLASH_VALIDATE 76
155#define OPAL_FLASH_MANAGE 77 162#define OPAL_FLASH_MANAGE 77
156#define OPAL_FLASH_UPDATE 78 163#define OPAL_FLASH_UPDATE 78
164#define OPAL_DUMP_INIT 81
165#define OPAL_DUMP_INFO 82
166#define OPAL_DUMP_READ 83
167#define OPAL_DUMP_ACK 84
157#define OPAL_GET_MSG 85 168#define OPAL_GET_MSG 85
158#define OPAL_CHECK_ASYNC_COMPLETION 86 169#define OPAL_CHECK_ASYNC_COMPLETION 86
159#define OPAL_SYNC_HOST_REBOOT 87 170#define OPAL_SYNC_HOST_REBOOT 87
171#define OPAL_SENSOR_READ 88
172#define OPAL_GET_PARAM 89
173#define OPAL_SET_PARAM 90
174#define OPAL_DUMP_RESEND 91
175#define OPAL_DUMP_INFO2 94
160 176
161#ifndef __ASSEMBLY__ 177#ifndef __ASSEMBLY__
162 178
@@ -237,11 +253,14 @@ enum OpalPendingState {
237 OPAL_EVENT_EPOW = 0x80, 253 OPAL_EVENT_EPOW = 0x80,
238 OPAL_EVENT_LED_STATUS = 0x100, 254 OPAL_EVENT_LED_STATUS = 0x100,
239 OPAL_EVENT_PCI_ERROR = 0x200, 255 OPAL_EVENT_PCI_ERROR = 0x200,
256 OPAL_EVENT_DUMP_AVAIL = 0x400,
240 OPAL_EVENT_MSG_PENDING = 0x800, 257 OPAL_EVENT_MSG_PENDING = 0x800,
241}; 258};
242 259
243enum OpalMessageType { 260enum OpalMessageType {
244 OPAL_MSG_ASYNC_COMP = 0, 261 OPAL_MSG_ASYNC_COMP = 0, /* params[0] = token, params[1] = rc,
262 * additional params function-specific
263 */
245 OPAL_MSG_MEM_ERR, 264 OPAL_MSG_MEM_ERR,
246 OPAL_MSG_EPOW, 265 OPAL_MSG_EPOW,
247 OPAL_MSG_SHUTDOWN, 266 OPAL_MSG_SHUTDOWN,
@@ -394,6 +413,13 @@ enum OpalLPCAddressType {
394 OPAL_LPC_FW = 2, 413 OPAL_LPC_FW = 2,
395}; 414};
396 415
416/* System parameter permission */
417enum OpalSysparamPerm {
418 OPAL_SYSPARAM_READ = 0x1,
419 OPAL_SYSPARAM_WRITE = 0x2,
420 OPAL_SYSPARAM_RW = (OPAL_SYSPARAM_READ | OPAL_SYSPARAM_WRITE),
421};
422
397struct opal_msg { 423struct opal_msg {
398 uint32_t msg_type; 424 uint32_t msg_type;
399 uint32_t reserved; 425 uint32_t reserved;
@@ -823,16 +849,37 @@ int64_t opal_lpc_write(uint32_t chip_id, enum OpalLPCAddressType addr_type,
823 uint32_t addr, uint32_t data, uint32_t sz); 849 uint32_t addr, uint32_t data, uint32_t sz);
824int64_t opal_lpc_read(uint32_t chip_id, enum OpalLPCAddressType addr_type, 850int64_t opal_lpc_read(uint32_t chip_id, enum OpalLPCAddressType addr_type,
825 uint32_t addr, __be32 *data, uint32_t sz); 851 uint32_t addr, __be32 *data, uint32_t sz);
852
853int64_t opal_read_elog(uint64_t buffer, size_t size, uint64_t log_id);
854int64_t opal_get_elog_size(uint64_t *log_id, size_t *size, uint64_t *elog_type);
855int64_t opal_write_elog(uint64_t buffer, uint64_t size, uint64_t offset);
856int64_t opal_send_ack_elog(uint64_t log_id);
857void opal_resend_pending_logs(void);
858
826int64_t opal_validate_flash(uint64_t buffer, uint32_t *size, uint32_t *result); 859int64_t opal_validate_flash(uint64_t buffer, uint32_t *size, uint32_t *result);
827int64_t opal_manage_flash(uint8_t op); 860int64_t opal_manage_flash(uint8_t op);
828int64_t opal_update_flash(uint64_t blk_list); 861int64_t opal_update_flash(uint64_t blk_list);
862int64_t opal_dump_init(uint8_t dump_type);
863int64_t opal_dump_info(uint32_t *dump_id, uint32_t *dump_size);
864int64_t opal_dump_info2(uint32_t *dump_id, uint32_t *dump_size, uint32_t *dump_type);
865int64_t opal_dump_read(uint32_t dump_id, uint64_t buffer);
866int64_t opal_dump_ack(uint32_t dump_id);
867int64_t opal_dump_resend_notification(void);
829 868
830int64_t opal_get_msg(uint64_t buffer, size_t size); 869int64_t opal_get_msg(uint64_t buffer, size_t size);
831int64_t opal_check_completion(uint64_t buffer, size_t size, uint64_t token); 870int64_t opal_check_completion(uint64_t buffer, size_t size, uint64_t token);
832int64_t opal_sync_host_reboot(void); 871int64_t opal_sync_host_reboot(void);
872int64_t opal_get_param(uint64_t token, uint32_t param_id, uint64_t buffer,
873 size_t length);
874int64_t opal_set_param(uint64_t token, uint32_t param_id, uint64_t buffer,
875 size_t length);
876int64_t opal_sensor_read(uint32_t sensor_hndl, int token,
877 uint32_t *sensor_data);
833 878
834/* Internal functions */ 879/* Internal functions */
835extern int early_init_dt_scan_opal(unsigned long node, const char *uname, int depth, void *data); 880extern int early_init_dt_scan_opal(unsigned long node, const char *uname, int depth, void *data);
881extern int early_init_dt_scan_recoverable_ranges(unsigned long node,
882 const char *uname, int depth, void *data);
836 883
837extern int opal_get_chars(uint32_t vtermno, char *buf, int count); 884extern 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); 885extern int opal_put_chars(uint32_t vtermno, const char *buf, int total_len);
@@ -853,6 +900,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); 900extern 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); 901extern int opal_put_chars(uint32_t vtermno, const char *buf, int total_len);
855 902
903extern int __opal_async_get_token(void);
904extern int opal_async_get_token_interruptible(void);
905extern int __opal_async_release_token(int token);
906extern int opal_async_release_token(int token);
907extern int opal_async_wait_response(uint64_t token, struct opal_msg *msg);
908extern int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data);
909
856extern void hvc_opal_init_early(void); 910extern void hvc_opal_init_early(void);
857 911
858struct rtc_time; 912struct rtc_time;
@@ -861,8 +915,12 @@ extern void opal_get_rtc_time(struct rtc_time *tm);
861extern unsigned long opal_get_boot_time(void); 915extern unsigned long opal_get_boot_time(void);
862extern void opal_nvram_init(void); 916extern void opal_nvram_init(void);
863extern void opal_flash_init(void); 917extern void opal_flash_init(void);
918extern int opal_elog_init(void);
919extern void opal_platform_dump_init(void);
920extern void opal_sys_param_init(void);
864 921
865extern int opal_machine_check(struct pt_regs *regs); 922extern int opal_machine_check(struct pt_regs *regs);
923extern bool opal_mce_check_early_recovery(struct pt_regs *regs);
866 924
867extern void opal_shutdown(void); 925extern void opal_shutdown(void);
868 926
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/reg.h b/arch/powerpc/include/asm/reg.h
index 90c06ec6eff5..1a36b8ede417 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -577,9 +577,13 @@
577#define SPRN_SPRG3 0x113 /* Special Purpose Register General 3 */ 577#define SPRN_SPRG3 0x113 /* Special Purpose Register General 3 */
578#define SPRN_USPRG3 0x103 /* SPRG3 userspace read */ 578#define SPRN_USPRG3 0x103 /* SPRG3 userspace read */
579#define SPRN_SPRG4 0x114 /* Special Purpose Register General 4 */ 579#define SPRN_SPRG4 0x114 /* Special Purpose Register General 4 */
580#define SPRN_USPRG4 0x104 /* SPRG4 userspace read */
580#define SPRN_SPRG5 0x115 /* Special Purpose Register General 5 */ 581#define SPRN_SPRG5 0x115 /* Special Purpose Register General 5 */
582#define SPRN_USPRG5 0x105 /* SPRG5 userspace read */
581#define SPRN_SPRG6 0x116 /* Special Purpose Register General 6 */ 583#define SPRN_SPRG6 0x116 /* Special Purpose Register General 6 */
584#define SPRN_USPRG6 0x106 /* SPRG6 userspace read */
582#define SPRN_SPRG7 0x117 /* Special Purpose Register General 7 */ 585#define SPRN_SPRG7 0x117 /* Special Purpose Register General 7 */
586#define SPRN_USPRG7 0x107 /* SPRG7 userspace read */
583#define SPRN_SRR0 0x01A /* Save/Restore Register 0 */ 587#define SPRN_SRR0 0x01A /* Save/Restore Register 0 */
584#define SPRN_SRR1 0x01B /* Save/Restore Register 1 */ 588#define SPRN_SRR1 0x01B /* Save/Restore Register 1 */
585#define SRR1_ISI_NOPT 0x40000000 /* ISI: Not found in hash */ 589#define SRR1_ISI_NOPT 0x40000000 /* ISI: Not found in hash */
@@ -664,12 +668,14 @@
664#define MMCR0_PMXE 0x04000000UL /* performance monitor exception enable */ 668#define MMCR0_PMXE 0x04000000UL /* performance monitor exception enable */
665#define MMCR0_FCECE 0x02000000UL /* freeze ctrs on enabled cond or event */ 669#define MMCR0_FCECE 0x02000000UL /* freeze ctrs on enabled cond or event */
666#define MMCR0_TBEE 0x00400000UL /* time base exception enable */ 670#define MMCR0_TBEE 0x00400000UL /* time base exception enable */
671#define MMCR0_BHRBA 0x00200000UL /* BHRB Access allowed in userspace */
667#define MMCR0_EBE 0x00100000UL /* Event based branch enable */ 672#define MMCR0_EBE 0x00100000UL /* Event based branch enable */
668#define MMCR0_PMCC 0x000c0000UL /* PMC control */ 673#define MMCR0_PMCC 0x000c0000UL /* PMC control */
669#define MMCR0_PMCC_U6 0x00080000UL /* PMC1-6 are R/W by user (PR) */ 674#define MMCR0_PMCC_U6 0x00080000UL /* PMC1-6 are R/W by user (PR) */
670#define MMCR0_PMC1CE 0x00008000UL /* PMC1 count enable*/ 675#define MMCR0_PMC1CE 0x00008000UL /* PMC1 count enable*/
671#define MMCR0_PMCjCE 0x00004000UL /* PMCj count enable*/ 676#define MMCR0_PMCjCE 0x00004000UL /* PMCj count enable*/
672#define MMCR0_TRIGGER 0x00002000UL /* TRIGGER enable */ 677#define MMCR0_TRIGGER 0x00002000UL /* TRIGGER enable */
678#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 */ 679#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 */ 680#define MMCR0_SHRFC 0x00000040UL /* SHRre freeze conditions between threads */
675#define MMCR0_FC56 0x00000010UL /* freeze counters 5 and 6 */ 681#define MMCR0_FC56 0x00000010UL /* freeze counters 5 and 6 */
@@ -703,6 +709,7 @@
703#define SPRN_EBBHR 804 /* Event based branch handler register */ 709#define SPRN_EBBHR 804 /* Event based branch handler register */
704#define SPRN_EBBRR 805 /* Event based branch return register */ 710#define SPRN_EBBRR 805 /* Event based branch return register */
705#define SPRN_BESCR 806 /* Branch event status and control register */ 711#define SPRN_BESCR 806 /* Branch event status and control register */
712#define BESCR_GE 0x8000000000000000ULL /* Global Enable */
706#define SPRN_WORT 895 /* Workload optimization register - thread */ 713#define SPRN_WORT 895 /* Workload optimization register - thread */
707 714
708#define SPRN_PMC1 787 715#define SPRN_PMC1 787
@@ -879,11 +886,10 @@
879 * 64-bit embedded 886 * 64-bit embedded
880 * - SPRG0 generic exception scratch 887 * - SPRG0 generic exception scratch
881 * - SPRG2 TLB exception stack 888 * - SPRG2 TLB exception stack
882 * - SPRG3 critical exception scratch and 889 * - SPRG3 critical exception scratch (user visible, sorry!)
883 * CPU and NUMA node for VDSO getcpu (user visible)
884 * - SPRG4 unused (user visible) 890 * - SPRG4 unused (user visible)
885 * - SPRG6 TLB miss scratch (user visible, sorry !) 891 * - SPRG6 TLB miss scratch (user visible, sorry !)
886 * - SPRG7 critical exception scratch 892 * - SPRG7 CPU and NUMA node for VDSO getcpu (user visible)
887 * - SPRG8 machine check exception scratch 893 * - SPRG8 machine check exception scratch
888 * - SPRG9 debug exception scratch 894 * - SPRG9 debug exception scratch
889 * 895 *
@@ -940,6 +946,8 @@
940#define SPRN_SPRG_SCRATCH0 SPRN_SPRG2 946#define SPRN_SPRG_SCRATCH0 SPRN_SPRG2
941#define SPRN_SPRG_HPACA SPRN_HSPRG0 947#define SPRN_SPRG_HPACA SPRN_HSPRG0
942#define SPRN_SPRG_HSCRATCH0 SPRN_HSPRG1 948#define SPRN_SPRG_HSCRATCH0 SPRN_HSPRG1
949#define SPRN_SPRG_VDSO_READ SPRN_USPRG3
950#define SPRN_SPRG_VDSO_WRITE SPRN_SPRG3
943 951
944#define GET_PACA(rX) \ 952#define GET_PACA(rX) \
945 BEGIN_FTR_SECTION_NESTED(66); \ 953 BEGIN_FTR_SECTION_NESTED(66); \
@@ -983,6 +991,8 @@
983#define SPRN_SPRG_TLB_SCRATCH SPRN_SPRG6 991#define SPRN_SPRG_TLB_SCRATCH SPRN_SPRG6
984#define SPRN_SPRG_GEN_SCRATCH SPRN_SPRG0 992#define SPRN_SPRG_GEN_SCRATCH SPRN_SPRG0
985#define SPRN_SPRG_GDBELL_SCRATCH SPRN_SPRG_GEN_SCRATCH 993#define SPRN_SPRG_GDBELL_SCRATCH SPRN_SPRG_GEN_SCRATCH
994#define SPRN_SPRG_VDSO_READ SPRN_USPRG7
995#define SPRN_SPRG_VDSO_WRITE SPRN_SPRG7
986 996
987#define SET_PACA(rX) mtspr SPRN_SPRG_PACA,rX 997#define SET_PACA(rX) mtspr SPRN_SPRG_PACA,rX
988#define GET_PACA(rX) mfspr rX,SPRN_SPRG_PACA 998#define GET_PACA(rX) mfspr rX,SPRN_SPRG_PACA
@@ -1102,6 +1112,8 @@
1102#define PVR_8560 0x80200000 1112#define PVR_8560 0x80200000
1103#define PVR_VER_E500V1 0x8020 1113#define PVR_VER_E500V1 0x8020
1104#define PVR_VER_E500V2 0x8021 1114#define PVR_VER_E500V2 0x8021
1115#define PVR_VER_E500MC 0x8023
1116#define PVR_VER_E5500 0x8024
1105#define PVR_VER_E6500 0x8040 1117#define PVR_VER_E6500 0x8040
1106 1118
1107/* 1119/*
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 9bd52c65e66f..a0e1add01ef5 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -283,6 +283,7 @@ extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal);
283 283
284#ifdef CONFIG_PPC_PSERIES 284#ifdef CONFIG_PPC_PSERIES
285extern int pseries_devicetree_update(s32 scope); 285extern int pseries_devicetree_update(s32 scope);
286extern void post_mobility_fixup(void);
286#endif 287#endif
287 288
288#ifdef CONFIG_PPC_RTAS_DAEMON 289#ifdef CONFIG_PPC_RTAS_DAEMON
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/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..4c34c3c827ad 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -164,13 +164,18 @@ BEGIN_FTR_SECTION
164 */ 164 */
165 mfspr r13,SPRN_SRR1 165 mfspr r13,SPRN_SRR1
166 rlwinm. r13,r13,47-31,30,31 166 rlwinm. r13,r13,47-31,30,31
167 OPT_GET_SPR(r13, SPRN_CFAR, CPU_FTR_CFAR)
167 beq 9f 168 beq 9f
168 169
170 mfspr r13,SPRN_SRR1
171 rlwinm. r13,r13,47-31,30,31
169 /* waking up from powersave (nap) state */ 172 /* waking up from powersave (nap) state */
170 cmpwi cr1,r13,2 173 cmpwi cr1,r13,2
171 /* Total loss of HV state is fatal. let's just stay stuck here */ 174 /* Total loss of HV state is fatal. let's just stay stuck here */
175 OPT_GET_SPR(r13, SPRN_CFAR, CPU_FTR_CFAR)
172 bgt cr1,. 176 bgt cr1,.
1739: 1779:
178 OPT_SET_SPR(r13, SPRN_CFAR, CPU_FTR_CFAR)
174END_FTR_SECTION_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_206) 179END_FTR_SECTION_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_206)
175#endif /* CONFIG_PPC_P7_NAP */ 180#endif /* CONFIG_PPC_P7_NAP */
176 EXCEPTION_PROLOG_0(PACA_EXMC) 181 EXCEPTION_PROLOG_0(PACA_EXMC)
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/prom.c b/arch/powerpc/kernel/prom.c
index f58c0d3aaeb4..d711b7eb05aa 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -752,6 +752,11 @@ void __init early_init_devtree(void *params)
752 spinning_secondaries = boot_cpu_count - 1; 752 spinning_secondaries = boot_cpu_count - 1;
753#endif 753#endif
754 754
755#ifdef CONFIG_PPC_POWERNV
756 /* Scan and build the list of machine check recoverable ranges */
757 of_scan_flat_dt(early_init_dt_scan_recoverable_ranges, NULL);
758#endif
759
755 DBG(" <- early_init_devtree()\n"); 760 DBG(" <- early_init_devtree()\n");
756} 761}
757 762
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 4cf674d7d5ae..f386296ff378 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -1013,12 +1013,13 @@ struct pseries_errorlog *get_pseries_errorlog(struct rtas_error_log *log,
1013 return NULL; 1013 return NULL;
1014} 1014}
1015 1015
1016/* We assume to be passed big endian arguments */
1016asmlinkage int ppc_rtas(struct rtas_args __user *uargs) 1017asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
1017{ 1018{
1018 struct rtas_args args; 1019 struct rtas_args args;
1019 unsigned long flags; 1020 unsigned long flags;
1020 char *buff_copy, *errbuf = NULL; 1021 char *buff_copy, *errbuf = NULL;
1021 int nargs; 1022 int nargs, nret, token;
1022 int rc; 1023 int rc;
1023 1024
1024 if (!capable(CAP_SYS_ADMIN)) 1025 if (!capable(CAP_SYS_ADMIN))
@@ -1027,10 +1028,13 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
1027 if (copy_from_user(&args, uargs, 3 * sizeof(u32)) != 0) 1028 if (copy_from_user(&args, uargs, 3 * sizeof(u32)) != 0)
1028 return -EFAULT; 1029 return -EFAULT;
1029 1030
1030 nargs = args.nargs; 1031 nargs = be32_to_cpu(args.nargs);
1032 nret = be32_to_cpu(args.nret);
1033 token = be32_to_cpu(args.token);
1034
1031 if (nargs > ARRAY_SIZE(args.args) 1035 if (nargs > ARRAY_SIZE(args.args)
1032 || args.nret > ARRAY_SIZE(args.args) 1036 || nret > ARRAY_SIZE(args.args)
1033 || nargs + args.nret > ARRAY_SIZE(args.args)) 1037 || nargs + nret > ARRAY_SIZE(args.args))
1034 return -EINVAL; 1038 return -EINVAL;
1035 1039
1036 /* Copy in args. */ 1040 /* Copy in args. */
@@ -1038,14 +1042,14 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
1038 nargs * sizeof(rtas_arg_t)) != 0) 1042 nargs * sizeof(rtas_arg_t)) != 0)
1039 return -EFAULT; 1043 return -EFAULT;
1040 1044
1041 if (args.token == RTAS_UNKNOWN_SERVICE) 1045 if (token == RTAS_UNKNOWN_SERVICE)
1042 return -EINVAL; 1046 return -EINVAL;
1043 1047
1044 args.rets = &args.args[nargs]; 1048 args.rets = &args.args[nargs];
1045 memset(args.rets, 0, args.nret * sizeof(rtas_arg_t)); 1049 memset(args.rets, 0, nret * sizeof(rtas_arg_t));
1046 1050
1047 /* Need to handle ibm,suspend_me call specially */ 1051 /* Need to handle ibm,suspend_me call specially */
1048 if (args.token == ibm_suspend_me_token) { 1052 if (token == ibm_suspend_me_token) {
1049 rc = rtas_ibm_suspend_me(&args); 1053 rc = rtas_ibm_suspend_me(&args);
1050 if (rc) 1054 if (rc)
1051 return rc; 1055 return rc;
@@ -1062,7 +1066,7 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
1062 1066
1063 /* A -1 return code indicates that the last command couldn't 1067 /* A -1 return code indicates that the last command couldn't
1064 be completed due to a hardware error. */ 1068 be completed due to a hardware error. */
1065 if (args.rets[0] == -1) 1069 if (be32_to_cpu(args.rets[0]) == -1)
1066 errbuf = __fetch_rtas_last_error(buff_copy); 1070 errbuf = __fetch_rtas_last_error(buff_copy);
1067 1071
1068 unlock_rtas(flags); 1072 unlock_rtas(flags);
@@ -1077,7 +1081,7 @@ asmlinkage int ppc_rtas(struct rtas_args __user *uargs)
1077 /* Copy out args. */ 1081 /* Copy out args. */
1078 if (copy_to_user(uargs->args + nargs, 1082 if (copy_to_user(uargs->args + nargs,
1079 args.args + nargs, 1083 args.args + nargs,
1080 args.nret * sizeof(rtas_arg_t)) != 0) 1084 nret * sizeof(rtas_arg_t)) != 0)
1081 return -EFAULT; 1085 return -EFAULT;
1082 1086
1083 return 0; 1087 return 0;
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index f5f11a7d30e5..4933909cc5c0 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -102,6 +102,8 @@ static void setup_tlb_core_data(void)
102{ 102{
103 int cpu; 103 int cpu;
104 104
105 BUILD_BUG_ON(offsetof(struct tlb_core_data, lock) != 0);
106
105 for_each_possible_cpu(cpu) { 107 for_each_possible_cpu(cpu) {
106 int first = cpu_first_thread_sibling(cpu); 108 int first = cpu_first_thread_sibling(cpu);
107 109
@@ -552,14 +554,20 @@ static void __init irqstack_early_init(void)
552static void __init exc_lvl_early_init(void) 554static void __init exc_lvl_early_init(void)
553{ 555{
554 unsigned int i; 556 unsigned int i;
557 unsigned long sp;
555 558
556 for_each_possible_cpu(i) { 559 for_each_possible_cpu(i) {
557 critirq_ctx[i] = (struct thread_info *) 560 sp = memblock_alloc(THREAD_SIZE, THREAD_SIZE);
558 __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); 561 critirq_ctx[i] = (struct thread_info *)__va(sp);
559 dbgirq_ctx[i] = (struct thread_info *) 562 paca[i].crit_kstack = __va(sp + THREAD_SIZE);
560 __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); 563
561 mcheckirq_ctx[i] = (struct thread_info *) 564 sp = memblock_alloc(THREAD_SIZE, THREAD_SIZE);
562 __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); 565 dbgirq_ctx[i] = (struct thread_info *)__va(sp);
566 paca[i].dbg_kstack = __va(sp + THREAD_SIZE);
567
568 sp = memblock_alloc(THREAD_SIZE, THREAD_SIZE);
569 mcheckirq_ctx[i] = (struct thread_info *)__va(sp);
570 paca[i].mc_kstack = __va(sp + THREAD_SIZE);
563 } 571 }
564 572
565 if (cpu_has_feature(CPU_FTR_DEBUG_LVL_EXC)) 573 if (cpu_has_feature(CPU_FTR_DEBUG_LVL_EXC))
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 33cd7a0b8e73..df86f0ce2d36 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);
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_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
index 818dce344e82..53d647f8e741 100644
--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
@@ -75,8 +75,8 @@ BEGIN_FTR_SECTION
75END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S) 75END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S)
76 76
77 /* Restore SPRG3 */ 77 /* Restore SPRG3 */
78 ld r3,PACA_SPRG3(r13) 78 ld r3,PACA_SPRG_VDSO(r13)
79 mtspr SPRN_SPRG3,r3 79 mtspr SPRN_SPRG_VDSO_WRITE,r3
80 80
81 /* Reload the host's PMU registers */ 81 /* Reload the host's PMU registers */
82 ld r3, PACALPPACAPTR(r13) /* is the host using the PMU? */ 82 ld r3, PACALPPACAPTR(r13) /* is the host using the PMU? */
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/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/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/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/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/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/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/Makefile b/arch/powerpc/platforms/powernv/Makefile
index 8d767fde5a6a..f324ea099503 100644
--- a/arch/powerpc/platforms/powernv/Makefile
+++ b/arch/powerpc/platforms/powernv/Makefile
@@ -1,6 +1,6 @@
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
4 4
5obj-$(CONFIG_SMP) += smp.o 5obj-$(CONFIG_SMP) += smp.o
6obj-$(CONFIG_PCI) += pci.o pci-p5ioc2.o pci-ioda.o 6obj-$(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..cd0c1354d404
--- /dev/null
+++ b/arch/powerpc/platforms/powernv/opal-async.c
@@ -0,0 +1,203 @@
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
129 if (msg_type != OPAL_MSG_ASYNC_COMP)
130 return 0;
131
132 memcpy(&opal_async_responses[comp_msg->params[0]], comp_msg,
133 sizeof(*comp_msg));
134 spin_lock_irqsave(&opal_async_comp_lock, flags);
135 __set_bit(comp_msg->params[0], opal_async_complete_map);
136 spin_unlock_irqrestore(&opal_async_comp_lock, flags);
137
138 wake_up(&opal_async_wait);
139
140 return 0;
141}
142
143static struct notifier_block opal_async_comp_nb = {
144 .notifier_call = opal_async_comp_event,
145 .next = NULL,
146 .priority = 0,
147};
148
149static int __init opal_async_comp_init(void)
150{
151 struct device_node *opal_node;
152 const __be32 *async;
153 int err;
154
155 opal_node = of_find_node_by_path("/ibm,opal");
156 if (!opal_node) {
157 pr_err("%s: Opal node not found\n", __func__);
158 err = -ENOENT;
159 goto out;
160 }
161
162 async = of_get_property(opal_node, "opal-msg-async-num", NULL);
163 if (!async) {
164 pr_err("%s: %s has no opal-msg-async-num\n",
165 __func__, opal_node->full_name);
166 err = -ENOENT;
167 goto out_opal_node;
168 }
169
170 opal_max_async_tokens = be32_to_cpup(async);
171 if (opal_max_async_tokens > N_ASYNC_COMPLETIONS)
172 opal_max_async_tokens = N_ASYNC_COMPLETIONS;
173
174 err = opal_message_notifier_register(OPAL_MSG_ASYNC_COMP,
175 &opal_async_comp_nb);
176 if (err) {
177 pr_err("%s: Can't register OPAL event notifier (%d)\n",
178 __func__, err);
179 goto out_opal_node;
180 }
181
182 opal_async_responses = kzalloc(
183 sizeof(*opal_async_responses) * opal_max_async_tokens,
184 GFP_KERNEL);
185 if (!opal_async_responses) {
186 pr_err("%s: Out of memory, failed to do asynchronous "
187 "completion init\n", __func__);
188 err = -ENOMEM;
189 goto out_opal_node;
190 }
191
192 /* Initialize to 1 less than the maximum tokens available, as we may
193 * require to pop one during emergency through synchronous call to
194 * __opal_async_get_token()
195 */
196 sema_init(&opal_async_sem, opal_max_async_tokens - 1);
197
198out_opal_node:
199 of_node_put(opal_node);
200out:
201 return err;
202}
203subsys_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..0c767c561dc9
--- /dev/null
+++ b/arch/powerpc/platforms/powernv/opal-dump.c
@@ -0,0 +1,525 @@
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 void delay_release_kobj(void *kobj)
90{
91 kobject_put((struct kobject *)kobj);
92}
93
94static ssize_t dump_ack_store(struct dump_obj *dump_obj,
95 struct dump_attribute *attr,
96 const char *buf,
97 size_t count)
98{
99 dump_send_ack(dump_obj->id);
100 sysfs_schedule_callback(&dump_obj->kobj, delay_release_kobj,
101 &dump_obj->kobj, THIS_MODULE);
102 return count;
103}
104
105/* Attributes of a dump
106 * The binary attribute of the dump itself is dynamic
107 * due to the dynamic size of the dump
108 */
109static struct dump_attribute id_attribute =
110 __ATTR(id, 0666, dump_id_show, NULL);
111static struct dump_attribute type_attribute =
112 __ATTR(type, 0666, dump_type_show, NULL);
113static struct dump_attribute ack_attribute =
114 __ATTR(acknowledge, 0660, dump_ack_show, dump_ack_store);
115
116static ssize_t init_dump_show(struct dump_obj *dump_obj,
117 struct dump_attribute *attr,
118 char *buf)
119{
120 return sprintf(buf, "1 - initiate dump\n");
121}
122
123static int64_t dump_fips_init(uint8_t type)
124{
125 int rc;
126
127 rc = opal_dump_init(type);
128 if (rc)
129 pr_warn("%s: Failed to initiate FipS dump (%d)\n",
130 __func__, rc);
131 return rc;
132}
133
134static ssize_t init_dump_store(struct dump_obj *dump_obj,
135 struct dump_attribute *attr,
136 const char *buf,
137 size_t count)
138{
139 dump_fips_init(DUMP_TYPE_FSP);
140 pr_info("%s: Initiated FSP dump\n", __func__);
141 return count;
142}
143
144static struct dump_attribute initiate_attribute =
145 __ATTR(initiate_dump, 0600, init_dump_show, init_dump_store);
146
147static struct attribute *initiate_attrs[] = {
148 &initiate_attribute.attr,
149 NULL,
150};
151
152static struct attribute_group initiate_attr_group = {
153 .attrs = initiate_attrs,
154};
155
156static struct kset *dump_kset;
157
158static ssize_t dump_attr_show(struct kobject *kobj,
159 struct attribute *attr,
160 char *buf)
161{
162 struct dump_attribute *attribute;
163 struct dump_obj *dump;
164
165 attribute = to_dump_attr(attr);
166 dump = to_dump_obj(kobj);
167
168 if (!attribute->show)
169 return -EIO;
170
171 return attribute->show(dump, attribute, buf);
172}
173
174static ssize_t dump_attr_store(struct kobject *kobj,
175 struct attribute *attr,
176 const char *buf, size_t len)
177{
178 struct dump_attribute *attribute;
179 struct dump_obj *dump;
180
181 attribute = to_dump_attr(attr);
182 dump = to_dump_obj(kobj);
183
184 if (!attribute->store)
185 return -EIO;
186
187 return attribute->store(dump, attribute, buf, len);
188}
189
190static const struct sysfs_ops dump_sysfs_ops = {
191 .show = dump_attr_show,
192 .store = dump_attr_store,
193};
194
195static void dump_release(struct kobject *kobj)
196{
197 struct dump_obj *dump;
198
199 dump = to_dump_obj(kobj);
200 vfree(dump->buffer);
201 kfree(dump);
202}
203
204static struct attribute *dump_default_attrs[] = {
205 &id_attribute.attr,
206 &type_attribute.attr,
207 &ack_attribute.attr,
208 NULL,
209};
210
211static struct kobj_type dump_ktype = {
212 .sysfs_ops = &dump_sysfs_ops,
213 .release = &dump_release,
214 .default_attrs = dump_default_attrs,
215};
216
217static void free_dump_sg_list(struct opal_sg_list *list)
218{
219 struct opal_sg_list *sg1;
220 while (list) {
221 sg1 = list->next;
222 kfree(list);
223 list = sg1;
224 }
225 list = NULL;
226}
227
228static struct opal_sg_list *dump_data_to_sglist(struct dump_obj *dump)
229{
230 struct opal_sg_list *sg1, *list = NULL;
231 void *addr;
232 int64_t size;
233
234 addr = dump->buffer;
235 size = dump->size;
236
237 sg1 = kzalloc(PAGE_SIZE, GFP_KERNEL);
238 if (!sg1)
239 goto nomem;
240
241 list = sg1;
242 sg1->num_entries = 0;
243 while (size > 0) {
244 /* Translate virtual address to physical address */
245 sg1->entry[sg1->num_entries].data =
246 (void *)(vmalloc_to_pfn(addr) << PAGE_SHIFT);
247
248 if (size > PAGE_SIZE)
249 sg1->entry[sg1->num_entries].length = PAGE_SIZE;
250 else
251 sg1->entry[sg1->num_entries].length = size;
252
253 sg1->num_entries++;
254 if (sg1->num_entries >= SG_ENTRIES_PER_NODE) {
255 sg1->next = kzalloc(PAGE_SIZE, GFP_KERNEL);
256 if (!sg1->next)
257 goto nomem;
258
259 sg1 = sg1->next;
260 sg1->num_entries = 0;
261 }
262 addr += PAGE_SIZE;
263 size -= PAGE_SIZE;
264 }
265 return list;
266
267nomem:
268 pr_err("%s : Failed to allocate memory\n", __func__);
269 free_dump_sg_list(list);
270 return NULL;
271}
272
273static void sglist_to_phy_addr(struct opal_sg_list *list)
274{
275 struct opal_sg_list *sg, *next;
276
277 for (sg = list; sg; sg = next) {
278 next = sg->next;
279 /* Don't translate NULL pointer for last entry */
280 if (sg->next)
281 sg->next = (struct opal_sg_list *)__pa(sg->next);
282 else
283 sg->next = NULL;
284
285 /* Convert num_entries to length */
286 sg->num_entries =
287 sg->num_entries * sizeof(struct opal_sg_entry) + 16;
288 }
289}
290
291static int64_t dump_read_info(uint32_t *id, uint32_t *size, uint32_t *type)
292{
293 int rc;
294 *type = 0xffffffff;
295
296 rc = opal_dump_info2(id, size, type);
297
298 if (rc == OPAL_PARAMETER)
299 rc = opal_dump_info(id, size);
300
301 if (rc)
302 pr_warn("%s: Failed to get dump info (%d)\n",
303 __func__, rc);
304 return rc;
305}
306
307static int64_t dump_read_data(struct dump_obj *dump)
308{
309 struct opal_sg_list *list;
310 uint64_t addr;
311 int64_t rc;
312
313 /* Allocate memory */
314 dump->buffer = vzalloc(PAGE_ALIGN(dump->size));
315 if (!dump->buffer) {
316 pr_err("%s : Failed to allocate memory\n", __func__);
317 rc = -ENOMEM;
318 goto out;
319 }
320
321 /* Generate SG list */
322 list = dump_data_to_sglist(dump);
323 if (!list) {
324 rc = -ENOMEM;
325 goto out;
326 }
327
328 /* Translate sg list addr to real address */
329 sglist_to_phy_addr(list);
330
331 /* First entry address */
332 addr = __pa(list);
333
334 /* Fetch data */
335 rc = OPAL_BUSY_EVENT;
336 while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) {
337 rc = opal_dump_read(dump->id, addr);
338 if (rc == OPAL_BUSY_EVENT) {
339 opal_poll_events(NULL);
340 msleep(20);
341 }
342 }
343
344 if (rc != OPAL_SUCCESS && rc != OPAL_PARTIAL)
345 pr_warn("%s: Extract dump failed for ID 0x%x\n",
346 __func__, dump->id);
347
348 /* Free SG list */
349 free_dump_sg_list(list);
350
351out:
352 return rc;
353}
354
355static ssize_t dump_attr_read(struct file *filep, struct kobject *kobj,
356 struct bin_attribute *bin_attr,
357 char *buffer, loff_t pos, size_t count)
358{
359 ssize_t rc;
360
361 struct dump_obj *dump = to_dump_obj(kobj);
362
363 if (!dump->buffer) {
364 rc = dump_read_data(dump);
365
366 if (rc != OPAL_SUCCESS && rc != OPAL_PARTIAL) {
367 vfree(dump->buffer);
368 dump->buffer = NULL;
369
370 return -EIO;
371 }
372 if (rc == OPAL_PARTIAL) {
373 /* On a partial read, we just return EIO
374 * and rely on userspace to ask us to try
375 * again.
376 */
377 pr_info("%s: Platform dump partially read.ID = 0x%x\n",
378 __func__, dump->id);
379 return -EIO;
380 }
381 }
382
383 memcpy(buffer, dump->buffer + pos, count);
384
385 /* You may think we could free the dump buffer now and retrieve
386 * it again later if needed, but due to current firmware limitation,
387 * that's not the case. So, once read into userspace once,
388 * we keep the dump around until it's acknowledged by userspace.
389 */
390
391 return count;
392}
393
394static struct dump_obj *create_dump_obj(uint32_t id, size_t size,
395 uint32_t type)
396{
397 struct dump_obj *dump;
398 int rc;
399
400 dump = kzalloc(sizeof(*dump), GFP_KERNEL);
401 if (!dump)
402 return NULL;
403
404 dump->kobj.kset = dump_kset;
405
406 kobject_init(&dump->kobj, &dump_ktype);
407
408 sysfs_bin_attr_init(&dump->dump_attr);
409
410 dump->dump_attr.attr.name = "dump";
411 dump->dump_attr.attr.mode = 0400;
412 dump->dump_attr.size = size;
413 dump->dump_attr.read = dump_attr_read;
414
415 dump->id = id;
416 dump->size = size;
417 dump->type = type;
418
419 rc = kobject_add(&dump->kobj, NULL, "0x%x-0x%x", type, id);
420 if (rc) {
421 kobject_put(&dump->kobj);
422 return NULL;
423 }
424
425 rc = sysfs_create_bin_file(&dump->kobj, &dump->dump_attr);
426 if (rc) {
427 kobject_put(&dump->kobj);
428 return NULL;
429 }
430
431 pr_info("%s: New platform dump. ID = 0x%x Size %u\n",
432 __func__, dump->id, dump->size);
433
434 kobject_uevent(&dump->kobj, KOBJ_ADD);
435
436 return dump;
437}
438
439static int process_dump(void)
440{
441 int rc;
442 uint32_t dump_id, dump_size, dump_type;
443 struct dump_obj *dump;
444 char name[22];
445
446 rc = dump_read_info(&dump_id, &dump_size, &dump_type);
447 if (rc != OPAL_SUCCESS)
448 return rc;
449
450 sprintf(name, "0x%x-0x%x", dump_type, dump_id);
451
452 /* we may get notified twice, let's handle
453 * that gracefully and not create two conflicting
454 * entries.
455 */
456 if (kset_find_obj(dump_kset, name))
457 return 0;
458
459 dump = create_dump_obj(dump_id, dump_size, dump_type);
460 if (!dump)
461 return -1;
462
463 return 0;
464}
465
466static void dump_work_fn(struct work_struct *work)
467{
468 process_dump();
469}
470
471static DECLARE_WORK(dump_work, dump_work_fn);
472
473static void schedule_process_dump(void)
474{
475 schedule_work(&dump_work);
476}
477
478/*
479 * New dump available notification
480 *
481 * Once we get notification, we add sysfs entries for it.
482 * We only fetch the dump on demand, and create sysfs asynchronously.
483 */
484static int dump_event(struct notifier_block *nb,
485 unsigned long events, void *change)
486{
487 if (events & OPAL_EVENT_DUMP_AVAIL)
488 schedule_process_dump();
489
490 return 0;
491}
492
493static struct notifier_block dump_nb = {
494 .notifier_call = dump_event,
495 .next = NULL,
496 .priority = 0
497};
498
499void __init opal_platform_dump_init(void)
500{
501 int rc;
502
503 dump_kset = kset_create_and_add("dump", NULL, opal_kobj);
504 if (!dump_kset) {
505 pr_warn("%s: Failed to create dump kset\n", __func__);
506 return;
507 }
508
509 rc = sysfs_create_group(&dump_kset->kobj, &initiate_attr_group);
510 if (rc) {
511 pr_warn("%s: Failed to create initiate dump attr group\n",
512 __func__);
513 kobject_put(&dump_kset->kobj);
514 return;
515 }
516
517 rc = opal_notifier_register(&dump_nb);
518 if (rc) {
519 pr_warn("%s: Can't register OPAL event notifier (%d)\n",
520 __func__, rc);
521 return;
522 }
523
524 opal_dump_resend_notification();
525}
diff --git a/arch/powerpc/platforms/powernv/opal-elog.c b/arch/powerpc/platforms/powernv/opal-elog.c
new file mode 100644
index 000000000000..1d7355bc9db0
--- /dev/null
+++ b/arch/powerpc/platforms/powernv/opal-elog.c
@@ -0,0 +1,313 @@
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 void delay_release_kobj(void *kobj)
74{
75 kobject_put((struct kobject *)kobj);
76}
77
78static ssize_t elog_ack_store(struct elog_obj *elog_obj,
79 struct elog_attribute *attr,
80 const char *buf,
81 size_t count)
82{
83 opal_send_ack_elog(elog_obj->id);
84 sysfs_schedule_callback(&elog_obj->kobj, delay_release_kobj,
85 &elog_obj->kobj, THIS_MODULE);
86 return count;
87}
88
89static struct elog_attribute id_attribute =
90 __ATTR(id, 0666, elog_id_show, NULL);
91static struct elog_attribute type_attribute =
92 __ATTR(type, 0666, elog_type_show, NULL);
93static struct elog_attribute ack_attribute =
94 __ATTR(acknowledge, 0660, elog_ack_show, elog_ack_store);
95
96static struct kset *elog_kset;
97
98static ssize_t elog_attr_show(struct kobject *kobj,
99 struct attribute *attr,
100 char *buf)
101{
102 struct elog_attribute *attribute;
103 struct elog_obj *elog;
104
105 attribute = to_elog_attr(attr);
106 elog = to_elog_obj(kobj);
107
108 if (!attribute->show)
109 return -EIO;
110
111 return attribute->show(elog, attribute, buf);
112}
113
114static ssize_t elog_attr_store(struct kobject *kobj,
115 struct attribute *attr,
116 const char *buf, size_t len)
117{
118 struct elog_attribute *attribute;
119 struct elog_obj *elog;
120
121 attribute = to_elog_attr(attr);
122 elog = to_elog_obj(kobj);
123
124 if (!attribute->store)
125 return -EIO;
126
127 return attribute->store(elog, attribute, buf, len);
128}
129
130static const struct sysfs_ops elog_sysfs_ops = {
131 .show = elog_attr_show,
132 .store = elog_attr_store,
133};
134
135static void elog_release(struct kobject *kobj)
136{
137 struct elog_obj *elog;
138
139 elog = to_elog_obj(kobj);
140 kfree(elog->buffer);
141 kfree(elog);
142}
143
144static struct attribute *elog_default_attrs[] = {
145 &id_attribute.attr,
146 &type_attribute.attr,
147 &ack_attribute.attr,
148 NULL,
149};
150
151static struct kobj_type elog_ktype = {
152 .sysfs_ops = &elog_sysfs_ops,
153 .release = &elog_release,
154 .default_attrs = elog_default_attrs,
155};
156
157/* Maximum size of a single log on FSP is 16KB */
158#define OPAL_MAX_ERRLOG_SIZE 16384
159
160static ssize_t raw_attr_read(struct file *filep, struct kobject *kobj,
161 struct bin_attribute *bin_attr,
162 char *buffer, loff_t pos, size_t count)
163{
164 int opal_rc;
165
166 struct elog_obj *elog = to_elog_obj(kobj);
167
168 /* We may have had an error reading before, so let's retry */
169 if (!elog->buffer) {
170 elog->buffer = kzalloc(elog->size, GFP_KERNEL);
171 if (!elog->buffer)
172 return -EIO;
173
174 opal_rc = opal_read_elog(__pa(elog->buffer),
175 elog->size, elog->id);
176 if (opal_rc != OPAL_SUCCESS) {
177 pr_err("ELOG: log read failed for log-id=%llx\n",
178 elog->id);
179 kfree(elog->buffer);
180 elog->buffer = NULL;
181 return -EIO;
182 }
183 }
184
185 memcpy(buffer, elog->buffer + pos, count);
186
187 return count;
188}
189
190static struct elog_obj *create_elog_obj(uint64_t id, size_t size, uint64_t type)
191{
192 struct elog_obj *elog;
193 int rc;
194
195 elog = kzalloc(sizeof(*elog), GFP_KERNEL);
196 if (!elog)
197 return NULL;
198
199 elog->kobj.kset = elog_kset;
200
201 kobject_init(&elog->kobj, &elog_ktype);
202
203 sysfs_bin_attr_init(&elog->raw_attr);
204
205 elog->raw_attr.attr.name = "raw";
206 elog->raw_attr.attr.mode = 0400;
207 elog->raw_attr.size = size;
208 elog->raw_attr.read = raw_attr_read;
209
210 elog->id = id;
211 elog->size = size;
212 elog->type = type;
213
214 elog->buffer = kzalloc(elog->size, GFP_KERNEL);
215
216 if (elog->buffer) {
217 rc = opal_read_elog(__pa(elog->buffer),
218 elog->size, elog->id);
219 if (rc != OPAL_SUCCESS) {
220 pr_err("ELOG: log read failed for log-id=%llx\n",
221 elog->id);
222 kfree(elog->buffer);
223 elog->buffer = NULL;
224 }
225 }
226
227 rc = kobject_add(&elog->kobj, NULL, "0x%llx", id);
228 if (rc) {
229 kobject_put(&elog->kobj);
230 return NULL;
231 }
232
233 rc = sysfs_create_bin_file(&elog->kobj, &elog->raw_attr);
234 if (rc) {
235 kobject_put(&elog->kobj);
236 return NULL;
237 }
238
239 kobject_uevent(&elog->kobj, KOBJ_ADD);
240
241 return elog;
242}
243
244static void elog_work_fn(struct work_struct *work)
245{
246 size_t elog_size;
247 uint64_t log_id;
248 uint64_t elog_type;
249 int rc;
250 char name[2+16+1];
251
252 rc = opal_get_elog_size(&log_id, &elog_size, &elog_type);
253 if (rc != OPAL_SUCCESS) {
254 pr_err("ELOG: Opal log read failed\n");
255 return;
256 }
257
258 BUG_ON(elog_size > OPAL_MAX_ERRLOG_SIZE);
259
260 if (elog_size >= OPAL_MAX_ERRLOG_SIZE)
261 elog_size = OPAL_MAX_ERRLOG_SIZE;
262
263 sprintf(name, "0x%llx", log_id);
264
265 /* we may get notified twice, let's handle
266 * that gracefully and not create two conflicting
267 * entries.
268 */
269 if (kset_find_obj(elog_kset, name))
270 return;
271
272 create_elog_obj(log_id, elog_size, elog_type);
273}
274
275static DECLARE_WORK(elog_work, elog_work_fn);
276
277static int elog_event(struct notifier_block *nb,
278 unsigned long events, void *change)
279{
280 /* check for error log event */
281 if (events & OPAL_EVENT_ERROR_LOG_AVAIL)
282 schedule_work(&elog_work);
283 return 0;
284}
285
286static struct notifier_block elog_nb = {
287 .notifier_call = elog_event,
288 .next = NULL,
289 .priority = 0
290};
291
292int __init opal_elog_init(void)
293{
294 int rc = 0;
295
296 elog_kset = kset_create_and_add("elog", NULL, opal_kobj);
297 if (!elog_kset) {
298 pr_warn("%s: failed to create elog kset\n", __func__);
299 return -1;
300 }
301
302 rc = opal_notifier_register(&elog_nb);
303 if (rc) {
304 pr_err("%s: Can't register OPAL event notifier (%d)\n",
305 __func__, rc);
306 return rc;
307 }
308
309 /* We are now ready to pull error logs from opal. */
310 opal_resend_pending_logs();
311
312 return 0;
313}
diff --git a/arch/powerpc/platforms/powernv/opal-sensor.c b/arch/powerpc/platforms/powernv/opal-sensor.c
new file mode 100644
index 000000000000..663cc9c65613
--- /dev/null
+++ b/arch/powerpc/platforms/powernv/opal-sensor.c
@@ -0,0 +1,64 @@
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
37 token = opal_async_get_token_interruptible();
38 if (token < 0) {
39 pr_err("%s: Couldn't get the token, returning\n", __func__);
40 ret = token;
41 goto out;
42 }
43
44 mutex_lock(&opal_sensor_mutex);
45 ret = opal_sensor_read(sensor_hndl, token, sensor_data);
46 if (ret != OPAL_ASYNC_COMPLETION)
47 goto out_token;
48
49 ret = opal_async_wait_response(token, &msg);
50 if (ret) {
51 pr_err("%s: Failed to wait for the async response, %d\n",
52 __func__, ret);
53 goto out_token;
54 }
55
56 ret = msg.params[1];
57
58out_token:
59 mutex_unlock(&opal_sensor_mutex);
60 opal_async_release_token(token);
61out:
62 return ret;
63}
64EXPORT_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..0bd249a26f30
--- /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 = 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 = 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..75c89df8d71e 100644
--- a/arch/powerpc/platforms/powernv/opal-wrappers.S
+++ b/arch/powerpc/platforms/powernv/opal-wrappers.S
@@ -123,9 +123,23 @@ OPAL_CALL(opal_xscom_write, OPAL_XSCOM_WRITE);
123OPAL_CALL(opal_lpc_read, OPAL_LPC_READ); 123OPAL_CALL(opal_lpc_read, OPAL_LPC_READ);
124OPAL_CALL(opal_lpc_write, OPAL_LPC_WRITE); 124OPAL_CALL(opal_lpc_write, OPAL_LPC_WRITE);
125OPAL_CALL(opal_return_cpu, OPAL_RETURN_CPU); 125OPAL_CALL(opal_return_cpu, OPAL_RETURN_CPU);
126OPAL_CALL(opal_read_elog, OPAL_ELOG_READ);
127OPAL_CALL(opal_send_ack_elog, OPAL_ELOG_ACK);
128OPAL_CALL(opal_get_elog_size, OPAL_ELOG_SIZE);
129OPAL_CALL(opal_resend_pending_logs, OPAL_ELOG_RESEND);
130OPAL_CALL(opal_write_elog, OPAL_ELOG_WRITE);
126OPAL_CALL(opal_validate_flash, OPAL_FLASH_VALIDATE); 131OPAL_CALL(opal_validate_flash, OPAL_FLASH_VALIDATE);
127OPAL_CALL(opal_manage_flash, OPAL_FLASH_MANAGE); 132OPAL_CALL(opal_manage_flash, OPAL_FLASH_MANAGE);
128OPAL_CALL(opal_update_flash, OPAL_FLASH_UPDATE); 133OPAL_CALL(opal_update_flash, OPAL_FLASH_UPDATE);
134OPAL_CALL(opal_dump_init, OPAL_DUMP_INIT);
135OPAL_CALL(opal_dump_info, OPAL_DUMP_INFO);
136OPAL_CALL(opal_dump_info2, OPAL_DUMP_INFO2);
137OPAL_CALL(opal_dump_read, OPAL_DUMP_READ);
138OPAL_CALL(opal_dump_ack, OPAL_DUMP_ACK);
129OPAL_CALL(opal_get_msg, OPAL_GET_MSG); 139OPAL_CALL(opal_get_msg, OPAL_GET_MSG);
130OPAL_CALL(opal_check_completion, OPAL_CHECK_ASYNC_COMPLETION); 140OPAL_CALL(opal_check_completion, OPAL_CHECK_ASYNC_COMPLETION);
141OPAL_CALL(opal_dump_resend_notification, OPAL_DUMP_RESEND);
131OPAL_CALL(opal_sync_host_reboot, OPAL_SYNC_HOST_REBOOT); 142OPAL_CALL(opal_sync_host_reboot, OPAL_SYNC_HOST_REBOOT);
143OPAL_CALL(opal_sensor_read, OPAL_SENSOR_READ);
144OPAL_CALL(opal_get_param, OPAL_GET_PARAM);
145OPAL_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..e92f2f67640f 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,8 +34,18 @@ 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
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
38static struct device_node *opal_node; 49static struct 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[];
@@ -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,53 @@ 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, 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", &size);
112
113 if (!prop)
114 return 1;
115
116 pr_debug("Found machine check recoverable ranges.\n");
117
118 /*
119 * Allocate a buffer to hold the MC recoverable ranges. We would be
120 * accessing them in real mode, hence it needs to be within
121 * RMO region.
122 */
123 mc_recoverable_range =__va(memblock_alloc_base(size, __alignof__(u64),
124 ppc64_rma_size));
125 memset(mc_recoverable_range, 0, size);
126
127 /*
128 * Each recoverable address entry is an (start address,len,
129 * recover address) pair, * 2 cells each, totalling 4 cells per entry.
130 */
131 for (i = 0; i < size / (sizeof(*prop) * 5); i++) {
132 mc_recoverable_range[i].start_addr =
133 of_read_number(prop + (i * 5) + 0, 2);
134 mc_recoverable_range[i].end_addr =
135 mc_recoverable_range[i].start_addr +
136 of_read_number(prop + (i * 5) + 2, 1);
137 mc_recoverable_range[i].recover_addr =
138 of_read_number(prop + (i * 5) + 3, 2);
139
140 pr_debug("Machine check recoverable range: %llx..%llx: %llx\n",
141 mc_recoverable_range[i].start_addr,
142 mc_recoverable_range[i].end_addr,
143 mc_recoverable_range[i].recover_addr);
144 }
145 mc_recoverable_range_len = i;
146 return 1;
147}
148
87static int __init opal_register_exception_handlers(void) 149static int __init opal_register_exception_handlers(void)
88{ 150{
89#ifdef __BIG_ENDIAN__ 151#ifdef __BIG_ENDIAN__
@@ -401,6 +463,38 @@ int opal_machine_check(struct pt_regs *regs)
401 return 0; 463 return 0;
402} 464}
403 465
466static uint64_t find_recovery_address(uint64_t nip)
467{
468 int i;
469
470 for (i = 0; i < mc_recoverable_range_len; i++)
471 if ((nip >= mc_recoverable_range[i].start_addr) &&
472 (nip < mc_recoverable_range[i].end_addr))
473 return mc_recoverable_range[i].recover_addr;
474 return 0;
475}
476
477bool opal_mce_check_early_recovery(struct pt_regs *regs)
478{
479 uint64_t recover_addr = 0;
480
481 if (!opal.base || !opal.size)
482 goto out;
483
484 if ((regs->nip >= opal.base) &&
485 (regs->nip <= (opal.base + opal.size)))
486 recover_addr = find_recovery_address(regs->nip);
487
488 /*
489 * Setup regs->nip to rfi into fixup address.
490 */
491 if (recover_addr)
492 regs->nip = recover_addr;
493
494out:
495 return !!recover_addr;
496}
497
404static irqreturn_t opal_interrupt(int irq, void *data) 498static irqreturn_t opal_interrupt(int irq, void *data)
405{ 499{
406 __be64 events; 500 __be64 events;
@@ -472,8 +566,14 @@ static int __init opal_init(void)
472 /* Create "opal" kobject under /sys/firmware */ 566 /* Create "opal" kobject under /sys/firmware */
473 rc = opal_sysfs_init(); 567 rc = opal_sysfs_init();
474 if (rc == 0) { 568 if (rc == 0) {
569 /* Setup error log interface */
570 rc = opal_elog_init();
475 /* Setup code update interface */ 571 /* Setup code update interface */
476 opal_flash_init(); 572 opal_flash_init();
573 /* Setup platform dump extract interface */
574 opal_platform_dump_init();
575 /* Setup system parameters interface */
576 opal_sys_param_init();
477 } 577 }
478 578
479 return 0; 579 return 0;
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/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/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/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/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/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/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/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index f288b60a87be..b53d87958710 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -554,6 +554,14 @@ config SENSORS_IBMPEX
554 This driver can also be built as a module. If so, the module 554 This driver can also be built as a module. If so, the module
555 will be called ibmpex. 555 will be called ibmpex.
556 556
557config SENSORS_IBMPOWERNV
558 tristate "IBM PowerNv Platform temperature/power/fan sensor"
559 depends on PPC_POWERNV
560 default y
561 help
562 If you say yes here you get support for the temperature/fan/power
563 sensors on your platform.
564
557config SENSORS_IIO_HWMON 565config SENSORS_IIO_HWMON
558 tristate "Hwmon driver that uses channels specified via iio maps" 566 tristate "Hwmon driver that uses channels specified via iio maps"
559 depends on IIO 567 depends on IIO
diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
index c48f9873ac73..199c401bf8d9 100644
--- a/drivers/hwmon/Makefile
+++ b/drivers/hwmon/Makefile
@@ -71,6 +71,7 @@ obj-$(CONFIG_SENSORS_ULTRA45) += ultra45_env.o
71obj-$(CONFIG_SENSORS_I5K_AMB) += i5k_amb.o 71obj-$(CONFIG_SENSORS_I5K_AMB) += i5k_amb.o
72obj-$(CONFIG_SENSORS_IBMAEM) += ibmaem.o 72obj-$(CONFIG_SENSORS_IBMAEM) += ibmaem.o
73obj-$(CONFIG_SENSORS_IBMPEX) += ibmpex.o 73obj-$(CONFIG_SENSORS_IBMPEX) += ibmpex.o
74obj-$(CONFIG_SENSORS_IBMPOWERNV)+= ibmpowernv.o
74obj-$(CONFIG_SENSORS_IIO_HWMON) += iio_hwmon.o 75obj-$(CONFIG_SENSORS_IIO_HWMON) += iio_hwmon.o
75obj-$(CONFIG_SENSORS_INA209) += ina209.o 76obj-$(CONFIG_SENSORS_INA209) += ina209.o
76obj-$(CONFIG_SENSORS_INA2XX) += ina2xx.o 77obj-$(CONFIG_SENSORS_INA2XX) += ina2xx.o
diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c
new file mode 100644
index 000000000000..b7b1297a9b02
--- /dev/null
+++ b/drivers/hwmon/ibmpowernv.c
@@ -0,0 +1,529 @@
1/*
2 * hwmon driver for temperature/power/fan on IBM PowerNV platform
3 * Copyright (C) 2013 IBM
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 * 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#include <linux/init.h>
21#include <linux/module.h>
22#include <linux/kernel.h>
23#include <linux/hwmon.h>
24#include <linux/hwmon-sysfs.h>
25#include <linux/of.h>
26#include <linux/slab.h>
27
28#include <linux/jiffies.h>
29#include <linux/platform_device.h>
30#include <asm/opal.h>
31#include <linux/err.h>
32
33MODULE_DESCRIPTION("IBM PowerNV Platform power/temp/fan sensor hwmon module");
34MODULE_LICENSE("GPL");
35
36#define MAX_ATTR_LENGTH 32
37
38/* Device tree sensor name prefixes. The device tree has the names in the
39 * format "cooling-fan#2-faulted" where the "cooling-fan" is the sensor type,
40 * 2 is the sensor count, and "faulted" is the sensor data attribute type.
41 */
42#define DT_FAULT_ATTR_SUFFIX "faulted"
43#define DT_DATA_ATTR_SUFFIX "data"
44#define DT_THRESHOLD_ATTR_SUFFIX "thrs"
45
46enum sensors {
47 FAN,
48 TEMPERATURE,
49 POWERSUPPLY,
50 POWER,
51 MAX_SENSOR_TYPE,
52};
53
54enum attributes {
55 INPUT,
56 MINIMUM,
57 MAXIMUM,
58 FAULT,
59 MAX_ATTR_TYPES
60};
61
62static struct sensor_name {
63 char *name;
64 char *compaible;
65} sensor_names[] = {
66 {"fan-sensor", "ibm,opal-sensor-cooling-fan"},
67 {"amb-temp-sensor", "ibm,opal-sensor-amb-temp"},
68 {"power-sensor", "ibm,opal-sensor-power-supply"},
69 {"power", "ibm,opal-sensor-power"}
70};
71
72static const char * const attribute_type_table[] = {
73 "input",
74 "min",
75 "max",
76 "fault",
77 NULL
78};
79
80struct pdev_entry {
81 struct list_head list;
82 struct platform_device *pdev;
83 enum sensors type;
84};
85
86static LIST_HEAD(pdev_list);
87
88/* The sensors are categorised on type.
89 *
90 * The sensors of same type are categorised under a common platform device.
91 * So, The pdev is shared by all sensors of same type.
92 * Ex : temp1_input, temp1_max, temp2_input,temp2_max all share same platform
93 * device.
94 *
95 * "sensor_data" is the Platform device specific data.
96 * There is one hwmon_device instance for all the sensors of same type.
97 * This also holds the list of all sensors with same type but different
98 * attribute and index.
99 */
100struct sensor_specific_data {
101 u32 sensor_id; /* The hex value as in the device tree */
102 u32 sensor_index; /* The sensor instance index */
103 struct sensor_device_attribute sd_attr;
104 enum attributes attr_type;
105 char attr_name[64];
106};
107
108struct sensor_data {
109 struct device *hwmon_dev;
110 struct list_head sensor_list;
111 struct device_attribute name_attr;
112};
113
114struct sensor_entry {
115 struct list_head list;
116 struct sensor_specific_data *sensor_data;
117};
118
119static struct platform_device *powernv_sensor_get_pdev(enum sensors type)
120{
121 struct pdev_entry *p;
122 list_for_each_entry(p, &pdev_list, list)
123 if (p->type == type)
124 return p->pdev;
125
126 return NULL;
127}
128
129static struct sensor_specific_data *powernv_sensor_get_sensor_data(
130 struct sensor_data *pdata,
131 int index, enum attributes attr_type)
132{
133 struct sensor_entry *p;
134 list_for_each_entry(p, &pdata->sensor_list, list)
135 if ((p->sensor_data->sensor_index == index) &&
136 (attr_type == p->sensor_data->attr_type))
137 return p->sensor_data;
138
139 return NULL;
140}
141
142static ssize_t show_name(struct device *dev,
143 struct device_attribute *devattr, char *buf)
144{
145 struct platform_device *pdev = to_platform_device(dev);
146
147 return sprintf(buf, "%s\n", pdev->name);
148}
149
150/* Note: Data from the sensors for each sensor type needs to be converted to
151 * the dimension appropriate.
152 */
153static ssize_t show_sensor(struct device *dev,
154 struct device_attribute *devattr, char *buf)
155{
156 struct sensor_device_attribute *sd_attr = to_sensor_dev_attr(devattr);
157 struct platform_device *pdev = to_platform_device(dev);
158 struct sensor_data *pdata = platform_get_drvdata(pdev);
159 struct sensor_specific_data *tdata = NULL;
160 enum sensors sensor_type = pdev->id;
161 u32 x = -1;
162 int ret;
163
164 if (sd_attr && sd_attr->dev_attr.attr.name) {
165 char *pos = strchr(sd_attr->dev_attr.attr.name, '_');
166 int i;
167
168 for (i = 0; i < MAX_ATTR_TYPES; i++) {
169 if (strcmp(pos+1, attribute_type_table[i]) == 0) {
170 tdata = powernv_sensor_get_sensor_data(pdata,
171 sd_attr->index, i);
172 break;
173 }
174 }
175 }
176
177 if (tdata) {
178 ret = opal_get_sensor_data(tdata->sensor_id, &x);
179 if (ret)
180 x = -1;
181 }
182
183 if (sensor_type == TEMPERATURE && x > 0) {
184 /* Temperature comes in Degrees and convert it to
185 * milli-degrees.
186 */
187 x = x*1000;
188 } else if (sensor_type == POWER && x > 0) {
189 /* Power value comes in watts, convert to micro-watts */
190 x = x * 1000000;
191 }
192
193 return sprintf(buf, "%d\n", x);
194}
195
196static u32 get_sensor_index_from_name(const char *name)
197{
198 char *hash_position = strchr(name, '#');
199 u32 index = 0, copy_length;
200 char newbuf[8];
201
202 if (hash_position) {
203 copy_length = strchr(hash_position, '-') - hash_position - 1;
204 if (copy_length < sizeof(newbuf)) {
205 strncpy(newbuf, hash_position + 1, copy_length);
206 sscanf(newbuf, "%d", &index);
207 }
208 }
209
210 return index;
211}
212
213static inline void get_sensor_suffix_from_name(const char *name, char *suffix)
214{
215 char *dash_position = strrchr(name, '-');
216 if (dash_position)
217 strncpy(suffix, dash_position+1, MAX_ATTR_LENGTH);
218 else
219 strcpy(suffix,"");
220}
221
222static int get_sensor_attr_properties(const char *sensor_name,
223 enum sensors sensor_type, enum attributes *attr_type,
224 u32 *sensor_index)
225{
226 char suffix[MAX_ATTR_LENGTH];
227
228 *attr_type = MAX_ATTR_TYPES;
229 *sensor_index = get_sensor_index_from_name(sensor_name);
230 if (*sensor_index == 0)
231 return -EINVAL;
232
233 get_sensor_suffix_from_name(sensor_name, suffix);
234 if (strcmp(suffix, "") == 0)
235 return -EINVAL;
236
237 if (strcmp(suffix, DT_FAULT_ATTR_SUFFIX) == 0)
238 *attr_type = FAULT;
239 else if (strcmp(suffix, DT_DATA_ATTR_SUFFIX) == 0)
240 *attr_type = INPUT;
241 else if ((sensor_type == TEMPERATURE) &&
242 (strcmp(suffix, DT_THRESHOLD_ATTR_SUFFIX) == 0))
243 *attr_type = MAXIMUM;
244 else if ((sensor_type == FAN) &&
245 (strcmp(suffix, DT_THRESHOLD_ATTR_SUFFIX) == 0))
246 *attr_type = MINIMUM;
247 else
248 return -ENOENT;
249
250 if (((sensor_type == FAN) && ((*attr_type == INPUT) ||
251 (*attr_type == MINIMUM)))
252 || ((sensor_type == TEMPERATURE) && ((*attr_type == INPUT) ||
253 (*attr_type == MAXIMUM)))
254 || ((sensor_type == POWER) && ((*attr_type == INPUT))))
255 return 0;
256
257 return -ENOENT;
258}
259
260static int create_sensor_attr(struct sensor_specific_data *tdata,
261 struct device *dev, enum sensors sensor_type,
262 enum attributes attr_type)
263{
264 int err = 0;
265 char temp_file_prefix[50];
266 static const char *const file_name_format = "%s%d_%s";
267
268 tdata->attr_type = attr_type;
269
270 if (sensor_type == FAN)
271 strcpy(temp_file_prefix, "fan");
272 else if (sensor_type == TEMPERATURE)
273 strcpy(temp_file_prefix, "temp");
274 else if (sensor_type == POWERSUPPLY)
275 strcpy(temp_file_prefix, "powersupply");
276 else if (sensor_type == POWER)
277 strcpy(temp_file_prefix, "power");
278
279 snprintf(tdata->attr_name, sizeof(tdata->attr_name), file_name_format,
280 temp_file_prefix, tdata->sensor_index,
281 attribute_type_table[tdata->attr_type]);
282
283 sysfs_attr_init(&tdata->sd_attr.dev_attr.attr);
284 tdata->sd_attr.dev_attr.attr.name = tdata->attr_name;
285 tdata->sd_attr.dev_attr.attr.mode = S_IRUGO;
286 tdata->sd_attr.dev_attr.show = show_sensor;
287
288 tdata->sd_attr.index = tdata->sensor_index;
289 err = device_create_file(dev, &tdata->sd_attr.dev_attr);
290
291 return err;
292}
293
294static int create_name_attr(struct sensor_data *pdata,
295 struct device *dev)
296{
297 sysfs_attr_init(&pdata->name_attr.attr);
298 pdata->name_attr.attr.name = "name";
299 pdata->name_attr.attr.mode = S_IRUGO;
300 pdata->name_attr.show = show_name;
301 return device_create_file(dev, &pdata->name_attr);
302}
303
304static int create_platform_device(enum sensors sensor_type,
305 struct platform_device **pdev)
306{
307 struct pdev_entry *pdev_entry = NULL;
308 int err;
309
310 *pdev = platform_device_alloc(sensor_names[sensor_type].name,
311 sensor_type);
312 if (!*pdev) {
313 pr_err("Device allocation failed\n");
314 err = -ENOMEM;
315 goto exit;
316 }
317
318 pdev_entry = kzalloc(sizeof(struct pdev_entry), GFP_KERNEL);
319 if (!pdev_entry) {
320 pr_err("Device allocation failed\n");
321 err = -ENOMEM;
322 goto exit_device_put;
323 }
324
325 err = platform_device_add(*pdev);
326 if (err) {
327 pr_err("Device addition failed (%d)\n", err);
328 goto exit_device_free;
329 }
330
331 pdev_entry->pdev = *pdev;
332 pdev_entry->type = (*pdev)->id;
333
334 list_add_tail(&pdev_entry->list, &pdev_list);
335
336 return 0;
337exit_device_free:
338 kfree(pdev_entry);
339exit_device_put:
340 platform_device_put(*pdev);
341exit:
342 return err;
343}
344
345static int create_sensor_data(struct platform_device *pdev)
346{
347 struct sensor_data *pdata = NULL;
348 int err = 0;
349
350 pdata = kzalloc(sizeof(struct sensor_data), GFP_KERNEL);
351 if (!pdata) {
352 err = -ENOMEM;
353 goto exit;
354 }
355
356 err = create_name_attr(pdata, &pdev->dev);
357 if (err)
358 goto exit_free;
359
360 pdata->hwmon_dev = hwmon_device_register(&pdev->dev);
361 if (IS_ERR(pdata->hwmon_dev)) {
362 err = PTR_ERR(pdata->hwmon_dev);
363 dev_err(&pdev->dev, "Class registration failed (%d)\n",
364 err);
365 goto exit_name;
366 }
367
368 INIT_LIST_HEAD(&pdata->sensor_list);
369 platform_set_drvdata(pdev, pdata);
370
371 return 0;
372
373exit_name:
374 device_remove_file(&pdev->dev, &pdata->name_attr);
375exit_free:
376 kfree(pdata);
377exit:
378 return err;
379}
380
381static void delete_sensor_attr(struct sensor_data *pdata)
382{
383 struct sensor_entry *s, *l;
384
385 list_for_each_entry_safe(s, l, &pdata->sensor_list, list) {
386 struct sensor_specific_data *tdata = s->sensor_data;
387 kfree(tdata);
388 list_del(&s->list);
389 kfree(s);
390 }
391}
392
393static int powernv_sensor_init(u32 sensor_id, const struct device_node *np,
394 enum sensors sensor_type, enum attributes attr_type,
395 u32 sensor_index)
396{
397 struct platform_device *pdev = powernv_sensor_get_pdev(sensor_type);
398 struct sensor_specific_data *tdata;
399 struct sensor_entry *sensor_entry;
400 struct sensor_data *pdata;
401 int err = 0;
402
403 if (!pdev) {
404 err = create_platform_device(sensor_type, &pdev);
405 if (err)
406 goto exit;
407
408 err = create_sensor_data(pdev);
409 if (err)
410 goto exit;
411 }
412
413 pdata = platform_get_drvdata(pdev);
414 if (!pdata) {
415 err = -ENOMEM;
416 goto exit;
417 }
418
419 tdata = kzalloc(sizeof(struct sensor_specific_data), GFP_KERNEL);
420 if (!tdata) {
421 err = -ENOMEM;
422 goto exit;
423 }
424
425 tdata->sensor_id = sensor_id;
426 tdata->sensor_index = sensor_index;
427
428 err = create_sensor_attr(tdata, &pdev->dev, sensor_type, attr_type);
429 if (err)
430 goto exit_free;
431
432 sensor_entry = kzalloc(sizeof(struct sensor_entry), GFP_KERNEL);
433 if (!sensor_entry) {
434 err = -ENOMEM;
435 goto exit_attr;
436 }
437
438 sensor_entry->sensor_data = tdata;
439
440 list_add_tail(&sensor_entry->list, &pdata->sensor_list);
441
442 return 0;
443exit_attr:
444 device_remove_file(&pdev->dev, &tdata->sd_attr.dev_attr);
445exit_free:
446 kfree(tdata);
447exit:
448 return err;
449}
450
451static void delete_unregister_sensors(void)
452{
453 struct pdev_entry *p, *n;
454
455 list_for_each_entry_safe(p, n, &pdev_list, list) {
456 struct sensor_data *pdata = platform_get_drvdata(p->pdev);
457 if (pdata) {
458 delete_sensor_attr(pdata);
459
460 hwmon_device_unregister(pdata->hwmon_dev);
461 kfree(pdata);
462 }
463 platform_device_unregister(p->pdev);
464 list_del(&p->list);
465 kfree(p);
466 }
467}
468
469static int __init powernv_hwmon_init(void)
470{
471 struct device_node *opal, *np = NULL;
472 enum attributes attr_type;
473 enum sensors type;
474 const u32 *sensor_id;
475 u32 sensor_index;
476 int err;
477
478 opal = of_find_node_by_path("/ibm,opal/sensors");
479 if (!opal) {
480 pr_err("%s: Opal 'sensors' node not found\n", __func__);
481 return -ENXIO;
482 }
483
484 for_each_child_of_node(opal, np) {
485 if (np->name == NULL)
486 continue;
487
488 for (type = 0; type < MAX_SENSOR_TYPE; type++)
489 if (of_device_is_compatible(np,
490 sensor_names[type].compaible))
491 break;
492
493 if (type == MAX_SENSOR_TYPE)
494 continue;
495
496 if (get_sensor_attr_properties(np->name, type, &attr_type,
497 &sensor_index))
498 continue;
499
500 sensor_id = of_get_property(np, "sensor-id", NULL);
501 if (!sensor_id) {
502 pr_info("%s: %s doesn't have sensor-id\n", __func__,
503 np->name);
504 continue;
505 }
506
507 err = powernv_sensor_init(*sensor_id, np, type, attr_type,
508 sensor_index);
509 if (err) {
510 of_node_put(opal);
511 goto exit;
512 }
513 }
514 of_node_put(opal);
515
516 return 0;
517exit:
518 delete_unregister_sensors();
519 return err;
520
521}
522
523static void powernv_hwmon_exit(void)
524{
525 delete_unregister_sensors();
526}
527
528module_init(powernv_hwmon_init);
529module_exit(powernv_hwmon_exit);
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index 04a50498f257..9e9c56758a08 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -38,7 +38,7 @@
38#include <linux/platform_device.h> 38#include <linux/platform_device.h>
39#include <linux/mutex.h> 39#include <linux/mutex.h>
40 40
41#include <asm/uaccess.h> 41#include <linux/uaccess.h>
42#ifdef CONFIG_PPC 42#ifdef CONFIG_PPC
43#include <asm/prom.h> 43#include <asm/prom.h>
44#include <asm/machdep.h> 44#include <asm/machdep.h>
@@ -193,8 +193,7 @@ static int adb_scan_bus(void)
193 break; 193 break;
194 194
195 noMovement = 0; 195 noMovement = 0;
196 } 196 } else {
197 else {
198 /* 197 /*
199 * No devices left at address i; move the 198 * No devices left at address i; move the
200 * one(s) we moved to `highFree' back to i. 199 * one(s) we moved to `highFree' back to i.
@@ -263,7 +262,7 @@ adb_reset_bus(void)
263/* 262/*
264 * notify clients before sleep 263 * notify clients before sleep
265 */ 264 */
266static int adb_suspend(struct platform_device *dev, pm_message_t state) 265static int __adb_suspend(struct platform_device *dev, pm_message_t state)
267{ 266{
268 adb_got_sleep = 1; 267 adb_got_sleep = 1;
269 /* We need to get a lock on the probe thread */ 268 /* We need to get a lock on the probe thread */
@@ -276,10 +275,25 @@ static int adb_suspend(struct platform_device *dev, pm_message_t state)
276 return 0; 275 return 0;
277} 276}
278 277
278static int adb_suspend(struct device *dev)
279{
280 return __adb_suspend(to_platform_device(dev), PMSG_SUSPEND);
281}
282
283static int adb_freeze(struct device *dev)
284{
285 return __adb_suspend(to_platform_device(dev), PMSG_FREEZE);
286}
287
288static int adb_poweroff(struct device *dev)
289{
290 return __adb_suspend(to_platform_device(dev), PMSG_HIBERNATE);
291}
292
279/* 293/*
280 * reset bus after sleep 294 * reset bus after sleep
281 */ 295 */
282static int adb_resume(struct platform_device *dev) 296static int __adb_resume(struct platform_device *dev)
283{ 297{
284 adb_got_sleep = 0; 298 adb_got_sleep = 0;
285 up(&adb_probe_mutex); 299 up(&adb_probe_mutex);
@@ -287,6 +301,11 @@ static int adb_resume(struct platform_device *dev)
287 301
288 return 0; 302 return 0;
289} 303}
304
305static int adb_resume(struct device *dev)
306{
307 return __adb_resume(to_platform_device(dev));
308}
290#endif /* CONFIG_PM */ 309#endif /* CONFIG_PM */
291 310
292static int __init adb_init(void) 311static int __init adb_init(void)
@@ -502,7 +521,7 @@ void
502adb_input(unsigned char *buf, int nb, int autopoll) 521adb_input(unsigned char *buf, int nb, int autopoll)
503{ 522{
504 int i, id; 523 int i, id;
505 static int dump_adb_input = 0; 524 static int dump_adb_input;
506 unsigned long flags; 525 unsigned long flags;
507 526
508 void (*handler)(unsigned char *, int, int); 527 void (*handler)(unsigned char *, int, int);
@@ -624,8 +643,7 @@ do_adb_query(struct adb_request *req)
624{ 643{
625 int ret = -EINVAL; 644 int ret = -EINVAL;
626 645
627 switch(req->data[1]) 646 switch(req->data[1]) {
628 {
629 case ADB_QUERY_GETDEVINFO: 647 case ADB_QUERY_GETDEVINFO:
630 if (req->nbytes < 3) 648 if (req->nbytes < 3)
631 break; 649 break;
@@ -697,7 +715,7 @@ static ssize_t adb_read(struct file *file, char __user *buf,
697 int ret = 0; 715 int ret = 0;
698 struct adbdev_state *state = file->private_data; 716 struct adbdev_state *state = file->private_data;
699 struct adb_request *req; 717 struct adb_request *req;
700 DECLARE_WAITQUEUE(wait,current); 718 DECLARE_WAITQUEUE(wait, current);
701 unsigned long flags; 719 unsigned long flags;
702 720
703 if (count < 2) 721 if (count < 2)
@@ -794,8 +812,8 @@ static ssize_t adb_write(struct file *file, const char __user *buf,
794 } 812 }
795 /* Special case for ADB_BUSRESET request, all others are sent to 813 /* Special case for ADB_BUSRESET request, all others are sent to
796 the controller */ 814 the controller */
797 else if ((req->data[0] == ADB_PACKET)&&(count > 1) 815 else if ((req->data[0] == ADB_PACKET) && (count > 1)
798 &&(req->data[1] == ADB_BUSRESET)) { 816 && (req->data[1] == ADB_BUSRESET)) {
799 ret = do_adb_reset_bus(); 817 ret = do_adb_reset_bus();
800 up(&adb_probe_mutex); 818 up(&adb_probe_mutex);
801 atomic_dec(&state->n_pending); 819 atomic_dec(&state->n_pending);
@@ -831,14 +849,25 @@ static const struct file_operations adb_fops = {
831 .release = adb_release, 849 .release = adb_release,
832}; 850};
833 851
852#ifdef CONFIG_PM
853static const struct dev_pm_ops adb_dev_pm_ops = {
854 .suspend = adb_suspend,
855 .resume = adb_resume,
856 /* Hibernate hooks */
857 .freeze = adb_freeze,
858 .thaw = adb_resume,
859 .poweroff = adb_poweroff,
860 .restore = adb_resume,
861};
862#endif
863
834static struct platform_driver adb_pfdrv = { 864static struct platform_driver adb_pfdrv = {
835 .driver = { 865 .driver = {
836 .name = "adb", 866 .name = "adb",
837 },
838#ifdef CONFIG_PM 867#ifdef CONFIG_PM
839 .suspend = adb_suspend, 868 .pm = &adb_dev_pm_ops,
840 .resume = adb_resume,
841#endif 869#endif
870 },
842}; 871};
843 872
844static struct platform_device adb_pfdev = { 873static struct platform_device adb_pfdev = {
diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
index f1b8d555080e..a8dbceb32914 100644
--- a/drivers/watchdog/booke_wdt.c
+++ b/drivers/watchdog/booke_wdt.c
@@ -138,14 +138,6 @@ static void __booke_wdt_enable(void *data)
138 val &= ~WDTP_MASK; 138 val &= ~WDTP_MASK;
139 val |= (TCR_WIE|TCR_WRC(WRC_CHIP)|WDTP(booke_wdt_period)); 139 val |= (TCR_WIE|TCR_WRC(WRC_CHIP)|WDTP(booke_wdt_period));
140 140
141#ifdef CONFIG_PPC_BOOK3E_64
142 /*
143 * Crit ints are currently broken on PPC64 Book-E, so
144 * just disable them for now.
145 */
146 val &= ~TCR_WIE;
147#endif
148
149 mtspr(SPRN_TCR, val); 141 mtspr(SPRN_TCR, val);
150} 142}
151 143
diff --git a/tools/testing/selftests/powerpc/Makefile b/tools/testing/selftests/powerpc/Makefile
index bd24ae5aaeab..316194f26ff4 100644
--- a/tools/testing/selftests/powerpc/Makefile
+++ b/tools/testing/selftests/powerpc/Makefile
@@ -13,7 +13,7 @@ CFLAGS := -Wall -O2 -flto -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CUR
13 13
14export CC CFLAGS 14export CC CFLAGS
15 15
16TARGETS = pmu 16TARGETS = pmu copyloops
17 17
18endif 18endif
19 19
diff --git a/tools/testing/selftests/powerpc/copyloops/Makefile b/tools/testing/selftests/powerpc/copyloops/Makefile
new file mode 100644
index 000000000000..6f2d3be227f9
--- /dev/null
+++ b/tools/testing/selftests/powerpc/copyloops/Makefile
@@ -0,0 +1,29 @@
1# The loops are all 64-bit code
2CFLAGS += -m64
3CFLAGS += -I$(CURDIR)
4CFLAGS += -D SELFTEST
5
6# Use our CFLAGS for the implicit .S rule
7ASFLAGS = $(CFLAGS)
8
9PROGS := copyuser_64 copyuser_power7 memcpy_64 memcpy_power7
10EXTRA_SOURCES := validate.c ../harness.c
11
12all: $(PROGS)
13
14copyuser_64: CPPFLAGS += -D COPY_LOOP=test___copy_tofrom_user_base
15copyuser_power7: CPPFLAGS += -D COPY_LOOP=test___copy_tofrom_user_power7
16memcpy_64: CPPFLAGS += -D COPY_LOOP=test_memcpy
17memcpy_power7: CPPFLAGS += -D COPY_LOOP=test_memcpy_power7
18
19$(PROGS): $(EXTRA_SOURCES)
20
21run_tests: all
22 @-for PROG in $(PROGS); do \
23 ./$$PROG; \
24 done;
25
26clean:
27 rm -f $(PROGS) *.o
28
29.PHONY: all run_tests clean
diff --git a/tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h b/tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h
new file mode 100644
index 000000000000..ccd9c84c4e3f
--- /dev/null
+++ b/tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h
@@ -0,0 +1,86 @@
1#include <ppc-asm.h>
2
3#define CONFIG_ALTIVEC
4
5#define r1 1
6
7#define vr0 0
8#define vr1 1
9#define vr2 2
10#define vr3 3
11#define vr4 4
12#define vr5 5
13#define vr6 6
14#define vr7 7
15#define vr8 8
16#define vr9 9
17#define vr10 10
18#define vr11 11
19#define vr12 12
20#define vr13 13
21#define vr14 14
22#define vr15 15
23#define vr16 16
24#define vr17 17
25#define vr18 18
26#define vr19 19
27#define vr20 20
28#define vr21 21
29#define vr22 22
30#define vr23 23
31#define vr24 24
32#define vr25 25
33#define vr26 26
34#define vr27 27
35#define vr28 28
36#define vr29 29
37#define vr30 30
38#define vr31 31
39
40#define R14 r14
41#define R15 r15
42#define R16 r16
43#define R17 r17
44#define R18 r18
45#define R19 r19
46#define R20 r20
47#define R21 r21
48#define R22 r22
49
50#define STACKFRAMESIZE 256
51#define STK_PARAM(i) (48 + ((i)-3)*8)
52#define STK_REG(i) (112 + ((i)-14)*8)
53
54#define _GLOBAL(A) FUNC_START(test_ ## A)
55
56#define PPC_MTOCRF(A, B) mtocrf A, B
57
58FUNC_START(enter_vmx_usercopy)
59 li r3,1
60 blr
61
62FUNC_START(exit_vmx_usercopy)
63 li r3,0
64 blr
65
66FUNC_START(enter_vmx_copy)
67 li r3,1
68 blr
69
70FUNC_START(exit_vmx_copy)
71 blr
72
73FUNC_START(memcpy_power7)
74 blr
75
76FUNC_START(__copy_tofrom_user_power7)
77 blr
78
79FUNC_START(__copy_tofrom_user_base)
80 blr
81
82#define BEGIN_FTR_SECTION
83#define FTR_SECTION_ELSE
84#define ALT_FTR_SECTION_END_IFCLR(x)
85#define ALT_FTR_SECTION_END(x, y)
86#define END_FTR_SECTION_IFCLR(x)
diff --git a/tools/testing/selftests/powerpc/copyloops/asm/processor.h b/tools/testing/selftests/powerpc/copyloops/asm/processor.h
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/tools/testing/selftests/powerpc/copyloops/asm/processor.h
diff --git a/tools/testing/selftests/powerpc/copyloops/copyuser_64.S b/tools/testing/selftests/powerpc/copyloops/copyuser_64.S
new file mode 120000
index 000000000000..f1c418a2521a
--- /dev/null
+++ b/tools/testing/selftests/powerpc/copyloops/copyuser_64.S
@@ -0,0 +1 @@
../../../../../arch/powerpc/lib/copyuser_64.S \ No newline at end of file
diff --git a/tools/testing/selftests/powerpc/copyloops/copyuser_power7.S b/tools/testing/selftests/powerpc/copyloops/copyuser_power7.S
new file mode 120000
index 000000000000..478689598298
--- /dev/null
+++ b/tools/testing/selftests/powerpc/copyloops/copyuser_power7.S
@@ -0,0 +1 @@
../../../../../arch/powerpc/lib/copyuser_power7.S \ No newline at end of file
diff --git a/tools/testing/selftests/powerpc/copyloops/memcpy_64.S b/tools/testing/selftests/powerpc/copyloops/memcpy_64.S
new file mode 120000
index 000000000000..cce33fb6f9d8
--- /dev/null
+++ b/tools/testing/selftests/powerpc/copyloops/memcpy_64.S
@@ -0,0 +1 @@
../../../../../arch/powerpc/lib/memcpy_64.S \ No newline at end of file
diff --git a/tools/testing/selftests/powerpc/copyloops/memcpy_power7.S b/tools/testing/selftests/powerpc/copyloops/memcpy_power7.S
new file mode 120000
index 000000000000..0d6fbfaf3d59
--- /dev/null
+++ b/tools/testing/selftests/powerpc/copyloops/memcpy_power7.S
@@ -0,0 +1 @@
../../../../../arch/powerpc/lib/memcpy_power7.S \ No newline at end of file
diff --git a/tools/testing/selftests/powerpc/copyloops/validate.c b/tools/testing/selftests/powerpc/copyloops/validate.c
new file mode 100644
index 000000000000..1750ff57ee58
--- /dev/null
+++ b/tools/testing/selftests/powerpc/copyloops/validate.c
@@ -0,0 +1,99 @@
1#include <malloc.h>
2#include <string.h>
3#include <stdlib.h>
4#include <stdbool.h>
5
6#include "../utils.h"
7
8#define MAX_LEN 8192
9#define MAX_OFFSET 16
10#define MIN_REDZONE 128
11#define BUFLEN (MAX_LEN+MAX_OFFSET+2*MIN_REDZONE)
12#define POISON 0xa5
13
14unsigned long COPY_LOOP(void *to, const void *from, unsigned long size);
15
16static void do_one(char *src, char *dst, unsigned long src_off,
17 unsigned long dst_off, unsigned long len, void *redzone,
18 void *fill)
19{
20 char *srcp, *dstp;
21 unsigned long ret;
22 unsigned long i;
23
24 srcp = src + MIN_REDZONE + src_off;
25 dstp = dst + MIN_REDZONE + dst_off;
26
27 memset(src, POISON, BUFLEN);
28 memset(dst, POISON, BUFLEN);
29 memcpy(srcp, fill, len);
30
31 ret = COPY_LOOP(dstp, srcp, len);
32 if (ret && ret != (unsigned long)dstp) {
33 printf("(%p,%p,%ld) returned %ld\n", dstp, srcp, len, ret);
34 abort();
35 }
36
37 if (memcmp(dstp, srcp, len)) {
38 printf("(%p,%p,%ld) miscompare\n", dstp, srcp, len);
39 printf("src: ");
40 for (i = 0; i < len; i++)
41 printf("%02x ", srcp[i]);
42 printf("\ndst: ");
43 for (i = 0; i < len; i++)
44 printf("%02x ", dstp[i]);
45 printf("\n");
46 abort();
47 }
48
49 if (memcmp(dst, redzone, dstp - dst)) {
50 printf("(%p,%p,%ld) redzone before corrupted\n",
51 dstp, srcp, len);
52 abort();
53 }
54
55 if (memcmp(dstp+len, redzone, dst+BUFLEN-(dstp+len))) {
56 printf("(%p,%p,%ld) redzone after corrupted\n",
57 dstp, srcp, len);
58 abort();
59 }
60}
61
62int test_copy_loop(void)
63{
64 char *src, *dst, *redzone, *fill;
65 unsigned long len, src_off, dst_off;
66 unsigned long i;
67
68 src = memalign(BUFLEN, BUFLEN);
69 dst = memalign(BUFLEN, BUFLEN);
70 redzone = malloc(BUFLEN);
71 fill = malloc(BUFLEN);
72
73 if (!src || !dst || !redzone || !fill) {
74 fprintf(stderr, "malloc failed\n");
75 exit(1);
76 }
77
78 memset(redzone, POISON, BUFLEN);
79
80 /* Fill with sequential bytes */
81 for (i = 0; i < BUFLEN; i++)
82 fill[i] = i & 0xff;
83
84 for (len = 1; len < MAX_LEN; len++) {
85 for (src_off = 0; src_off < MAX_OFFSET; src_off++) {
86 for (dst_off = 0; dst_off < MAX_OFFSET; dst_off++) {
87 do_one(src, dst, src_off, dst_off, len,
88 redzone, fill);
89 }
90 }
91 }
92
93 return 0;
94}
95
96int main(void)
97{
98 return test_harness(test_copy_loop, str(COPY_LOOP));
99}
diff --git a/tools/testing/selftests/powerpc/utils.h b/tools/testing/selftests/powerpc/utils.h
index 5851c4b0f553..0de064406dab 100644
--- a/tools/testing/selftests/powerpc/utils.h
+++ b/tools/testing/selftests/powerpc/utils.h
@@ -31,4 +31,7 @@ do { \
31 } \ 31 } \
32} while (0) 32} while (0)
33 33
34#define _str(s) #s
35#define str(s) _str(s)
36
34#endif /* _SELFTESTS_POWERPC_UTILS_H */ 37#endif /* _SELFTESTS_POWERPC_UTILS_H */