diff options
60 files changed, 1133 insertions, 251 deletions
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/network.txt b/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/network.txt deleted file mode 100644 index 29b28b8f9a89..000000000000 --- a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/network.txt +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | * Network | ||
2 | |||
3 | Currently defined compatibles: | ||
4 | - fsl,cpm1-scc-enet | ||
5 | - fsl,cpm2-scc-enet | ||
6 | - fsl,cpm1-fec-enet | ||
7 | - fsl,cpm2-fcc-enet (third resource is GFEMR) | ||
8 | - fsl,qe-enet | ||
9 | |||
10 | Example: | ||
11 | |||
12 | ethernet@11300 { | ||
13 | compatible = "fsl,mpc8272-fcc-enet", | ||
14 | "fsl,cpm2-fcc-enet"; | ||
15 | reg = <11300 20 8400 100 11390 1>; | ||
16 | local-mac-address = [ 00 00 00 00 00 00 ]; | ||
17 | interrupts = <20 8>; | ||
18 | interrupt-parent = <&PIC>; | ||
19 | phy-handle = <&PHY0>; | ||
20 | fsl,cpm-command = <12000300>; | ||
21 | }; | ||
22 | |||
23 | * MDIO | ||
24 | |||
25 | Currently defined compatibles: | ||
26 | fsl,pq1-fec-mdio (reg is same as first resource of FEC device) | ||
27 | fsl,cpm2-mdio-bitbang (reg is port C registers) | ||
28 | |||
29 | Properties for fsl,cpm2-mdio-bitbang: | ||
30 | fsl,mdio-pin : pin of port C controlling mdio data | ||
31 | fsl,mdc-pin : pin of port C controlling mdio clock | ||
32 | |||
33 | Example: | ||
34 | mdio@10d40 { | ||
35 | compatible = "fsl,mpc8272ads-mdio-bitbang", | ||
36 | "fsl,mpc8272-mdio-bitbang", | ||
37 | "fsl,cpm2-mdio-bitbang"; | ||
38 | reg = <10d40 14>; | ||
39 | #address-cells = <1>; | ||
40 | #size-cells = <0>; | ||
41 | fsl,mdio-pin = <12>; | ||
42 | fsl,mdc-pin = <13>; | ||
43 | }; | ||
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm.txt b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/cpm.txt index 160c752484b4..160c752484b4 100644 --- a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm.txt +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/cpm.txt | |||
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/brg.txt b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/cpm/brg.txt index 4c7d45eaf025..4c7d45eaf025 100644 --- a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/brg.txt +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/cpm/brg.txt | |||
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/i2c.txt b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/cpm/i2c.txt index 87bc6048667e..87bc6048667e 100644 --- a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/i2c.txt +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/cpm/i2c.txt | |||
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/pic.txt b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/cpm/pic.txt index 8e3ee1681618..8e3ee1681618 100644 --- a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/pic.txt +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/cpm/pic.txt | |||
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/usb.txt b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/cpm/usb.txt index 74bfda4bb824..74bfda4bb824 100644 --- a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/cpm/usb.txt +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/cpm/usb.txt | |||
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/gpio.txt b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/gpio.txt index 349f79fd7076..349f79fd7076 100644 --- a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/gpio.txt +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/gpio.txt | |||
diff --git a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/network.txt b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/network.txt new file mode 100644 index 000000000000..03c741602c6d --- /dev/null +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/network.txt | |||
@@ -0,0 +1,124 @@ | |||
1 | * Network | ||
2 | |||
3 | Currently defined compatibles: | ||
4 | - fsl,cpm1-scc-enet | ||
5 | - fsl,cpm2-scc-enet | ||
6 | - fsl,cpm1-fec-enet | ||
7 | - fsl,cpm2-fcc-enet (third resource is GFEMR) | ||
8 | - fsl,qe-enet | ||
9 | |||
10 | Example: | ||
11 | |||
12 | ethernet@11300 { | ||
13 | compatible = "fsl,mpc8272-fcc-enet", | ||
14 | "fsl,cpm2-fcc-enet"; | ||
15 | reg = <11300 20 8400 100 11390 1>; | ||
16 | local-mac-address = [ 00 00 00 00 00 00 ]; | ||
17 | interrupts = <20 8>; | ||
18 | interrupt-parent = <&PIC>; | ||
19 | phy-handle = <&PHY0>; | ||
20 | fsl,cpm-command = <12000300>; | ||
21 | }; | ||
22 | |||
23 | * MDIO | ||
24 | |||
25 | Currently defined compatibles: | ||
26 | fsl,pq1-fec-mdio (reg is same as first resource of FEC device) | ||
27 | fsl,cpm2-mdio-bitbang (reg is port C registers) | ||
28 | |||
29 | Properties for fsl,cpm2-mdio-bitbang: | ||
30 | fsl,mdio-pin : pin of port C controlling mdio data | ||
31 | fsl,mdc-pin : pin of port C controlling mdio clock | ||
32 | |||
33 | Example: | ||
34 | mdio@10d40 { | ||
35 | compatible = "fsl,mpc8272ads-mdio-bitbang", | ||
36 | "fsl,mpc8272-mdio-bitbang", | ||
37 | "fsl,cpm2-mdio-bitbang"; | ||
38 | reg = <10d40 14>; | ||
39 | #address-cells = <1>; | ||
40 | #size-cells = <0>; | ||
41 | fsl,mdio-pin = <12>; | ||
42 | fsl,mdc-pin = <13>; | ||
43 | }; | ||
44 | |||
45 | * HDLC | ||
46 | |||
47 | Currently defined compatibles: | ||
48 | - fsl,ucc-hdlc | ||
49 | |||
50 | Properties for fsl,ucc-hdlc: | ||
51 | - rx-clock-name | ||
52 | - tx-clock-name | ||
53 | Usage: required | ||
54 | Value type: <string> | ||
55 | Definition : Must be "brg1"-"brg16" for internal clock source, | ||
56 | Must be "clk1"-"clk24" for external clock source. | ||
57 | |||
58 | - fsl,tdm-interface | ||
59 | Usage: optional | ||
60 | Value type: <empty> | ||
61 | Definition : Specify that hdlc is based on tdm-interface | ||
62 | |||
63 | The property below is dependent on fsl,tdm-interface: | ||
64 | - fsl,rx-sync-clock | ||
65 | Usage: required | ||
66 | Value type: <string> | ||
67 | Definition : Must be "none", "rsync_pin", "brg9-11" and "brg13-15". | ||
68 | |||
69 | - fsl,tx-sync-clock | ||
70 | Usage: required | ||
71 | Value type: <string> | ||
72 | Definition : Must be "none", "tsync_pin", "brg9-11" and "brg13-15". | ||
73 | |||
74 | - fsl,tdm-framer-type | ||
75 | Usage: required for tdm interface | ||
76 | Value type: <string> | ||
77 | Definition : "e1" or "t1".Now e1 and t1 are used, other framer types | ||
78 | are not supported. | ||
79 | |||
80 | - fsl,tdm-id | ||
81 | Usage: required for tdm interface | ||
82 | Value type: <u32> | ||
83 | Definition : number of TDM ID | ||
84 | |||
85 | - fsl,tx-timeslot-mask | ||
86 | - fsl,rx-timeslot-mask | ||
87 | Usage: required for tdm interface | ||
88 | Value type: <u32> | ||
89 | Definition : time slot mask for TDM operation. Indicates which time | ||
90 | slots used for transmitting and receiving. | ||
91 | |||
92 | - fsl,siram-entry-id | ||
93 | Usage: required for tdm interface | ||
94 | Value type: <u32> | ||
95 | Definition : Must be 0,2,4...64. the number of TDM entry. | ||
96 | |||
97 | - fsl,tdm-internal-loopback | ||
98 | usage: optional for tdm interface | ||
99 | value type: <empty> | ||
100 | Definition : Internal loopback connecting on TDM layer. | ||
101 | |||
102 | Example for tdm interface: | ||
103 | |||
104 | ucc@2000 { | ||
105 | compatible = "fsl,ucc-hdlc"; | ||
106 | rx-clock-name = "clk8"; | ||
107 | tx-clock-name = "clk9"; | ||
108 | fsl,rx-sync-clock = "rsync_pin"; | ||
109 | fsl,tx-sync-clock = "tsync_pin"; | ||
110 | fsl,tx-timeslot-mask = <0xfffffffe>; | ||
111 | fsl,rx-timeslot-mask = <0xfffffffe>; | ||
112 | fsl,tdm-framer-type = "e1"; | ||
113 | fsl,tdm-id = <0>; | ||
114 | fsl,siram-entry-id = <0>; | ||
115 | fsl,tdm-interface; | ||
116 | }; | ||
117 | |||
118 | Example for hdlc without tdm interface: | ||
119 | |||
120 | ucc@2000 { | ||
121 | compatible = "fsl,ucc-hdlc"; | ||
122 | rx-clock-name = "brg1"; | ||
123 | tx-clock-name = "brg1"; | ||
124 | }; | ||
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe.txt b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe.txt index 4f8930263dd9..d7afaff5faff 100644 --- a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe.txt +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe.txt | |||
@@ -69,6 +69,58 @@ Example: | |||
69 | }; | 69 | }; |
70 | }; | 70 | }; |
71 | 71 | ||
72 | * Interrupt Controller (IC) | ||
73 | |||
74 | Required properties: | ||
75 | - compatible : should be "fsl,qe-ic". | ||
76 | - reg : Address range of IC register set. | ||
77 | - interrupts : interrupts generated by the device. | ||
78 | - interrupt-controller : this device is a interrupt controller. | ||
79 | |||
80 | Example: | ||
81 | |||
82 | qeic: interrupt-controller@80 { | ||
83 | interrupt-controller; | ||
84 | compatible = "fsl,qe-ic"; | ||
85 | #address-cells = <0>; | ||
86 | #interrupt-cells = <1>; | ||
87 | reg = <0x80 0x80>; | ||
88 | interrupts = <95 2 0 0 94 2 0 0>; | ||
89 | }; | ||
90 | |||
91 | * Serial Interface Block (SI) | ||
92 | |||
93 | The SI manages the routing of eight TDM lines to the QE block serial drivers | ||
94 | , the MCC and the UCCs, for receive and transmit. | ||
95 | |||
96 | Required properties: | ||
97 | - compatible : must be "fsl,<chip>-qe-si". For t1040, must contain | ||
98 | "fsl,t1040-qe-si". | ||
99 | - reg : Address range of SI register set. | ||
100 | |||
101 | Example: | ||
102 | |||
103 | si1: si@700 { | ||
104 | compatible = "fsl,t1040-qe-si"; | ||
105 | reg = <0x700 0x80>; | ||
106 | }; | ||
107 | |||
108 | * Serial Interface Block RAM(SIRAM) | ||
109 | |||
110 | store the routing entries of SI | ||
111 | |||
112 | Required properties: | ||
113 | - compatible : should be "fsl,<chip>-qe-siram". For t1040, must contain | ||
114 | "fsl,t1040-qe-siram". | ||
115 | - reg : Address range of SI RAM. | ||
116 | |||
117 | Example: | ||
118 | |||
119 | siram1: siram@1000 { | ||
120 | compatible = "fsl,t1040-qe-siram"; | ||
121 | reg = <0x1000 0x800>; | ||
122 | }; | ||
123 | |||
72 | * QE Firmware Node | 124 | * QE Firmware Node |
73 | 125 | ||
74 | This node defines a firmware binary that is embedded in the device tree, for | 126 | This node defines a firmware binary that is embedded in the device tree, for |
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/firmware.txt b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/firmware.txt index 249db3a15d15..249db3a15d15 100644 --- a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/firmware.txt +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/firmware.txt | |||
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/par_io.txt b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/par_io.txt index 60984260207b..60984260207b 100644 --- a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/par_io.txt +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/par_io.txt | |||
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/pincfg.txt b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/pincfg.txt index ec6ee2e864a2..ec6ee2e864a2 100644 --- a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/pincfg.txt +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/pincfg.txt | |||
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/ucc.txt b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/ucc.txt index e47734bee3f0..e47734bee3f0 100644 --- a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/ucc.txt +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/ucc.txt | |||
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/usb.txt b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/usb.txt index 9ccd5f30405b..9ccd5f30405b 100644 --- a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/qe/usb.txt +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/usb.txt | |||
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/serial.txt b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/serial.txt index 2ea76d9d137c..2ea76d9d137c 100644 --- a/Documentation/devicetree/bindings/powerpc/fsl/cpm_qe/serial.txt +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/serial.txt | |||
diff --git a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/uqe_serial.txt b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/uqe_serial.txt new file mode 100644 index 000000000000..8823c86c8085 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/uqe_serial.txt | |||
@@ -0,0 +1,17 @@ | |||
1 | * Serial | ||
2 | |||
3 | Required Properties: | ||
4 | compatible : must be "fsl,<chip>-ucc-uart". For t1040, must be | ||
5 | "fsl,t1040-ucc-uart". | ||
6 | port-number : port number of UCC-UART | ||
7 | tx/rx-clock-name : should be "brg1"-"brg16" for internal clock source, | ||
8 | should be "clk1"-"clk28" for external clock source. | ||
9 | |||
10 | Example: | ||
11 | |||
12 | ucc_serial: ucc@2200 { | ||
13 | compatible = "fsl,t1040-ucc-uart"; | ||
14 | port-number = <0>; | ||
15 | rx-clock-name = "brg2"; | ||
16 | tx-clock-name = "brg2"; | ||
17 | }; | ||
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index a5e0b47f7f20..6a656f8ca26d 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -166,6 +166,7 @@ config PPC | |||
166 | select ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT | 166 | select ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT |
167 | select HAVE_LIVEPATCH if HAVE_DYNAMIC_FTRACE_WITH_REGS | 167 | select HAVE_LIVEPATCH if HAVE_DYNAMIC_FTRACE_WITH_REGS |
168 | select GENERIC_CPU_AUTOPROBE | 168 | select GENERIC_CPU_AUTOPROBE |
169 | select HAVE_VIRT_CPU_ACCOUNTING | ||
169 | 170 | ||
170 | config GENERIC_CSUM | 171 | config GENERIC_CSUM |
171 | def_bool CPU_LITTLE_ENDIAN | 172 | def_bool CPU_LITTLE_ENDIAN |
@@ -1056,6 +1057,11 @@ config CONSISTENT_SIZE | |||
1056 | config PIN_TLB | 1057 | config PIN_TLB |
1057 | bool "Pinned Kernel TLBs (860 ONLY)" | 1058 | bool "Pinned Kernel TLBs (860 ONLY)" |
1058 | depends on ADVANCED_OPTIONS && 8xx | 1059 | depends on ADVANCED_OPTIONS && 8xx |
1060 | |||
1061 | config PIN_TLB_IMMR | ||
1062 | bool "Pinned TLB for IMMR" | ||
1063 | depends on PIN_TLB | ||
1064 | default y | ||
1059 | endmenu | 1065 | endmenu |
1060 | 1066 | ||
1061 | if PPC64 | 1067 | if PPC64 |
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug index cfe08eab90c6..171047822b56 100644 --- a/arch/powerpc/Kconfig.debug +++ b/arch/powerpc/Kconfig.debug | |||
@@ -212,7 +212,6 @@ config PPC_EARLY_DEBUG_40x | |||
212 | config PPC_EARLY_DEBUG_CPM | 212 | config PPC_EARLY_DEBUG_CPM |
213 | bool "Early serial debugging for Freescale CPM-based serial ports" | 213 | bool "Early serial debugging for Freescale CPM-based serial ports" |
214 | depends on SERIAL_CPM | 214 | depends on SERIAL_CPM |
215 | select PIN_TLB if PPC_8xx | ||
216 | help | 215 | help |
217 | Select this to enable early debugging for Freescale chips | 216 | Select this to enable early debugging for Freescale chips |
218 | using a CPM-based serial port. This assumes that the bootwrapper | 217 | using a CPM-based serial port. This assumes that the bootwrapper |
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 00cf88aa9a23..4cd612a6e272 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile | |||
@@ -113,6 +113,7 @@ src-plat-$(CONFIG_EPAPR_BOOT) += epapr.c epapr-wrapper.c | |||
113 | src-plat-$(CONFIG_PPC_PSERIES) += pseries-head.S | 113 | src-plat-$(CONFIG_PPC_PSERIES) += pseries-head.S |
114 | src-plat-$(CONFIG_PPC_POWERNV) += pseries-head.S | 114 | src-plat-$(CONFIG_PPC_POWERNV) += pseries-head.S |
115 | src-plat-$(CONFIG_PPC_IBM_CELL_BLADE) += pseries-head.S | 115 | src-plat-$(CONFIG_PPC_IBM_CELL_BLADE) += pseries-head.S |
116 | src-plat-$(CONFIG_MVME7100) += motload-head.S mvme7100.c | ||
116 | 117 | ||
117 | src-wlib := $(sort $(src-wlib-y)) | 118 | src-wlib := $(sort $(src-wlib-y)) |
118 | src-plat := $(sort $(src-plat-y)) | 119 | src-plat := $(sort $(src-plat-y)) |
@@ -296,6 +297,9 @@ image-$(CONFIG_TQM8560) += cuImage.tqm8560 | |||
296 | image-$(CONFIG_SBC8548) += cuImage.sbc8548 | 297 | image-$(CONFIG_SBC8548) += cuImage.sbc8548 |
297 | image-$(CONFIG_KSI8560) += cuImage.ksi8560 | 298 | image-$(CONFIG_KSI8560) += cuImage.ksi8560 |
298 | 299 | ||
300 | # Board ports in arch/powerpc/platform/86xx/Kconfig | ||
301 | image-$(CONFIG_MVME7100) += dtbImage.mvme7100 | ||
302 | |||
299 | # Board ports in arch/powerpc/platform/embedded6xx/Kconfig | 303 | # Board ports in arch/powerpc/platform/embedded6xx/Kconfig |
300 | image-$(CONFIG_STORCENTER) += cuImage.storcenter | 304 | image-$(CONFIG_STORCENTER) += cuImage.storcenter |
301 | image-$(CONFIG_MPC7448HPC2) += cuImage.mpc7448hpc2 | 305 | image-$(CONFIG_MPC7448HPC2) += cuImage.mpc7448hpc2 |
diff --git a/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi b/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi index bc3bf9333dde..88d8423f8ac5 100644 --- a/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi +++ b/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi | |||
@@ -51,6 +51,7 @@ | |||
51 | serial2 = &serial2; | 51 | serial2 = &serial2; |
52 | serial3 = &serial3; | 52 | serial3 = &serial3; |
53 | pci0 = &pci0; | 53 | pci0 = &pci0; |
54 | usb0 = &usb0; | ||
54 | dma0 = &dma0; | 55 | dma0 = &dma0; |
55 | dma1 = &dma1; | 56 | dma1 = &dma1; |
56 | sdhc = &sdhc; | 57 | sdhc = &sdhc; |
diff --git a/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi b/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi index 8797ce146512..f3f968c51f4b 100644 --- a/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi +++ b/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi | |||
@@ -51,6 +51,7 @@ | |||
51 | serial2 = &serial2; | 51 | serial2 = &serial2; |
52 | serial3 = &serial3; | 52 | serial3 = &serial3; |
53 | pci0 = &pci0; | 53 | pci0 = &pci0; |
54 | usb0 = &usb0; | ||
54 | dma0 = &dma0; | 55 | dma0 = &dma0; |
55 | dma1 = &dma1; | 56 | dma1 = &dma1; |
56 | sdhc = &sdhc; | 57 | sdhc = &sdhc; |
diff --git a/arch/powerpc/boot/dts/fsl/kmcoge4.dts b/arch/powerpc/boot/dts/fsl/kmcoge4.dts index 2d4b64fcee88..ae70a24094b0 100644 --- a/arch/powerpc/boot/dts/fsl/kmcoge4.dts +++ b/arch/powerpc/boot/dts/fsl/kmcoge4.dts | |||
@@ -106,6 +106,43 @@ | |||
106 | sata@221000 { | 106 | sata@221000 { |
107 | status = "disabled"; | 107 | status = "disabled"; |
108 | }; | 108 | }; |
109 | |||
110 | fman0: fman@400000 { | ||
111 | enet0: ethernet@e0000 { | ||
112 | phy-connection-type = "sgmii"; | ||
113 | fixed-link { | ||
114 | speed = <1000>; | ||
115 | full-duplex; | ||
116 | }; | ||
117 | }; | ||
118 | mdio0: mdio@e1120 { | ||
119 | front_phy: ethernet-phy@11 { | ||
120 | reg = <0x11>; | ||
121 | }; | ||
122 | }; | ||
123 | |||
124 | enet1: ethernet@e2000 { | ||
125 | phy-connection-type = "sgmii"; | ||
126 | fixed-link { | ||
127 | speed = <1000>; | ||
128 | full-duplex; | ||
129 | }; | ||
130 | }; | ||
131 | enet2: ethernet@e4000 { | ||
132 | status = "disabled"; | ||
133 | }; | ||
134 | |||
135 | enet3: ethernet@e6000 { | ||
136 | status = "disabled"; | ||
137 | }; | ||
138 | enet4: ethernet@e8000 { | ||
139 | phy-handle = <&front_phy>; | ||
140 | phy-connection-type = "rgmii"; | ||
141 | }; | ||
142 | enet5: ethernet@f0000 { | ||
143 | status = "disabled"; | ||
144 | }; | ||
145 | }; | ||
109 | }; | 146 | }; |
110 | 147 | ||
111 | rio: rapidio@ffe0c0000 { | 148 | rio: rapidio@ffe0c0000 { |
diff --git a/arch/powerpc/boot/dts/fsl/mvme7100.dts b/arch/powerpc/boot/dts/fsl/mvme7100.dts new file mode 100644 index 000000000000..e2d306ad37a6 --- /dev/null +++ b/arch/powerpc/boot/dts/fsl/mvme7100.dts | |||
@@ -0,0 +1,153 @@ | |||
1 | /* | ||
2 | * Device tree source for the Emerson/Artesyn MVME7100 | ||
3 | * | ||
4 | * Copyright 2016 Elettra-Sincrotrone Trieste S.C.p.A. | ||
5 | * | ||
6 | * Author: Alessio Igor Bogani <alessio.bogani@elettra.eu> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | /include/ "mpc8641si-pre.dtsi" | ||
16 | |||
17 | / { | ||
18 | model = "MVME7100"; | ||
19 | compatible = "artesyn,MVME7100"; | ||
20 | |||
21 | memory { | ||
22 | device_type = "memory"; | ||
23 | reg = <0x00000000 0x80000000>; | ||
24 | }; | ||
25 | |||
26 | soc: soc@f1000000 { | ||
27 | ranges = <0x00000000 0xf1000000 0x00100000>; | ||
28 | |||
29 | i2c@3000 { | ||
30 | hwmon@4c { | ||
31 | compatible = "dallas,max6649"; | ||
32 | reg = <0x4c>; | ||
33 | }; | ||
34 | |||
35 | rtc@68 { | ||
36 | status = "disabled"; | ||
37 | }; | ||
38 | }; | ||
39 | |||
40 | |||
41 | enet0: ethernet@24000 { | ||
42 | phy-handle = <&phy0>; | ||
43 | phy-connection-type = "rgmii-id"; | ||
44 | }; | ||
45 | |||
46 | mdio@24520 { | ||
47 | phy0: ethernet-phy@1 { | ||
48 | reg = <1>; | ||
49 | }; | ||
50 | phy1: ethernet-phy@2 { | ||
51 | reg = <2>; | ||
52 | }; | ||
53 | phy2: ethernet-phy@3 { | ||
54 | reg = <3>; | ||
55 | }; | ||
56 | phy3: ethernet-phy@4 { | ||
57 | reg = <4>; | ||
58 | }; | ||
59 | }; | ||
60 | |||
61 | enet1: ethernet@25000 { | ||
62 | phy-handle = <&phy1>; | ||
63 | phy-connection-type = "rgmii-id"; | ||
64 | }; | ||
65 | |||
66 | mdio@25520 { | ||
67 | status = "disabled"; | ||
68 | }; | ||
69 | |||
70 | enet2: ethernet@26000 { | ||
71 | phy-handle = <&phy2>; | ||
72 | phy-connection-type = "rgmii-id"; | ||
73 | }; | ||
74 | |||
75 | mdio@26520 { | ||
76 | status = "disabled"; | ||
77 | }; | ||
78 | |||
79 | enet3: ethernet@27000 { | ||
80 | phy-handle = <&phy3>; | ||
81 | phy-connection-type = "rgmii-id"; | ||
82 | }; | ||
83 | |||
84 | mdio@27520 { | ||
85 | status = "disabled"; | ||
86 | }; | ||
87 | |||
88 | serial1: serial@4600 { | ||
89 | status = "disabled"; | ||
90 | }; | ||
91 | }; | ||
92 | |||
93 | lbc: localbus@f1005000 { | ||
94 | reg = <0xf1005000 0x1000>; | ||
95 | |||
96 | ranges = <0 0 0xf8000000 0x08000000 // NOR Flash (128MB) | ||
97 | 2 0 0xf2030000 0x00010000 // NAND Flash (8GB) | ||
98 | 3 0 0xf2400000 0x00080000 // MRAM (512KB) | ||
99 | 4 0 0xf2000000 0x00010000 // BCSR | ||
100 | 5 0 0xf2010000 0x00010000>; // QUART | ||
101 | |||
102 | bcsr@4,0 { | ||
103 | compatible = "artesyn,mvme7100-bcsr"; | ||
104 | reg = <4 0 0x10000>; | ||
105 | }; | ||
106 | |||
107 | serial@5,1000 { | ||
108 | device_type = "serial"; | ||
109 | compatible = "ns16550"; | ||
110 | reg = <5 0x1000 0x100>; | ||
111 | clock-frequency = <1843200>; | ||
112 | interrupts = <11 1 0 0>; | ||
113 | }; | ||
114 | |||
115 | serial@5,2000 { | ||
116 | device_type = "serial"; | ||
117 | compatible = "ns16550"; | ||
118 | reg = <5 0x2000 0x100>; | ||
119 | clock-frequency = <1843200>; | ||
120 | interrupts = <11 1 0 0>; | ||
121 | }; | ||
122 | |||
123 | serial@5,3000 { | ||
124 | device_type = "serial"; | ||
125 | compatible = "ns16550"; | ||
126 | reg = <5 0x3000 0x100>; | ||
127 | clock-frequency = <1843200>; | ||
128 | interrupts = <11 1 0 0>; | ||
129 | }; | ||
130 | |||
131 | serial@5,4000 { | ||
132 | device_type = "serial"; | ||
133 | compatible = "ns16550"; | ||
134 | reg = <5 0x4000 0x100>; | ||
135 | clock-frequency = <1843200>; | ||
136 | interrupts = <11 1 0 0>; | ||
137 | }; | ||
138 | }; | ||
139 | |||
140 | pci0: pcie@f1008000 { | ||
141 | status = "disabled"; | ||
142 | }; | ||
143 | |||
144 | pci1: pcie@f1009000 { | ||
145 | status = "disabled"; | ||
146 | }; | ||
147 | |||
148 | chosen { | ||
149 | linux,stdout-path = &serial0; | ||
150 | }; | ||
151 | }; | ||
152 | |||
153 | /include/ "mpc8641si-post.dtsi" | ||
diff --git a/arch/powerpc/boot/dts/fsl/qonverge-usb2-dr-0.dtsi b/arch/powerpc/boot/dts/fsl/qonverge-usb2-dr-0.dtsi index 29dad723091e..fcc7e5b7fd47 100644 --- a/arch/powerpc/boot/dts/fsl/qonverge-usb2-dr-0.dtsi +++ b/arch/powerpc/boot/dts/fsl/qonverge-usb2-dr-0.dtsi | |||
@@ -32,7 +32,7 @@ | |||
32 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 32 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
33 | */ | 33 | */ |
34 | 34 | ||
35 | usb@210000 { | 35 | usb0: usb@210000 { |
36 | compatible = "fsl-usb2-dr"; | 36 | compatible = "fsl-usb2-dr"; |
37 | reg = <0x210000 0x1000>; | 37 | reg = <0x210000 0x1000>; |
38 | #address-cells = <1>; | 38 | #address-cells = <1>; |
diff --git a/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi b/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi index 507649ece0a1..44e399b17f6f 100644 --- a/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi +++ b/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi | |||
@@ -607,7 +607,7 @@ | |||
607 | /include/ "qoriq-gpio-3.dtsi" | 607 | /include/ "qoriq-gpio-3.dtsi" |
608 | /include/ "qoriq-usb2-mph-0.dtsi" | 608 | /include/ "qoriq-usb2-mph-0.dtsi" |
609 | usb0: usb@210000 { | 609 | usb0: usb@210000 { |
610 | compatible = "fsl-usb2-mph-v2.4", "fsl-usb2-mph"; | 610 | compatible = "fsl-usb2-mph-v2.5", "fsl-usb2-mph"; |
611 | fsl,iommu-parent = <&pamu0>; | 611 | fsl,iommu-parent = <&pamu0>; |
612 | fsl,liodn-reg = <&guts 0x520>; /* USB1LIODNR */ | 612 | fsl,liodn-reg = <&guts 0x520>; /* USB1LIODNR */ |
613 | phy_type = "utmi"; | 613 | phy_type = "utmi"; |
@@ -615,7 +615,7 @@ | |||
615 | }; | 615 | }; |
616 | /include/ "qoriq-usb2-dr-0.dtsi" | 616 | /include/ "qoriq-usb2-dr-0.dtsi" |
617 | usb1: usb@211000 { | 617 | usb1: usb@211000 { |
618 | compatible = "fsl-usb2-dr-v2.4", "fsl-usb2-dr"; | 618 | compatible = "fsl-usb2-dr-v2.5", "fsl-usb2-dr"; |
619 | fsl,iommu-parent = <&pamu0>; | 619 | fsl,iommu-parent = <&pamu0>; |
620 | fsl,liodn-reg = <&guts 0x524>; /* USB2LIODNR */ | 620 | fsl,liodn-reg = <&guts 0x524>; /* USB2LIODNR */ |
621 | dr_mode = "host"; | 621 | dr_mode = "host"; |
@@ -673,3 +673,48 @@ | |||
673 | }; | 673 | }; |
674 | }; | 674 | }; |
675 | }; | 675 | }; |
676 | |||
677 | &qe { | ||
678 | #address-cells = <1>; | ||
679 | #size-cells = <1>; | ||
680 | device_type = "qe"; | ||
681 | compatible = "fsl,qe"; | ||
682 | fsl,qe-num-riscs = <1>; | ||
683 | fsl,qe-num-snums = <28>; | ||
684 | |||
685 | qeic: interrupt-controller@80 { | ||
686 | interrupt-controller; | ||
687 | compatible = "fsl,qe-ic"; | ||
688 | #address-cells = <0>; | ||
689 | #interrupt-cells = <1>; | ||
690 | reg = <0x80 0x80>; | ||
691 | interrupts = <95 2 0 0 94 2 0 0>; //high:79 low:78 | ||
692 | }; | ||
693 | |||
694 | ucc@2000 { | ||
695 | cell-index = <1>; | ||
696 | reg = <0x2000 0x200>; | ||
697 | interrupts = <32>; | ||
698 | interrupt-parent = <&qeic>; | ||
699 | }; | ||
700 | |||
701 | ucc@2200 { | ||
702 | cell-index = <3>; | ||
703 | reg = <0x2200 0x200>; | ||
704 | interrupts = <34>; | ||
705 | interrupt-parent = <&qeic>; | ||
706 | }; | ||
707 | |||
708 | muram@10000 { | ||
709 | #address-cells = <1>; | ||
710 | #size-cells = <1>; | ||
711 | compatible = "fsl,qe-muram", "fsl,cpm-muram"; | ||
712 | ranges = <0x0 0x10000 0x6000>; | ||
713 | |||
714 | data-only@0 { | ||
715 | compatible = "fsl,qe-muram-data", | ||
716 | "fsl,cpm-muram-data"; | ||
717 | reg = <0x0 0x6000>; | ||
718 | }; | ||
719 | }; | ||
720 | }; | ||
diff --git a/arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi b/arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi index 8c7ea6c05de9..863f9431285f 100644 --- a/arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi +++ b/arch/powerpc/boot/dts/fsl/t104xd4rdb.dtsi | |||
@@ -212,4 +212,42 @@ | |||
212 | 0 0x00010000>; | 212 | 0 0x00010000>; |
213 | }; | 213 | }; |
214 | }; | 214 | }; |
215 | |||
216 | qe: qe@ffe140000 { | ||
217 | ranges = <0x0 0xf 0xfe140000 0x40000>; | ||
218 | reg = <0xf 0xfe140000 0 0x480>; | ||
219 | brg-frequency = <0>; | ||
220 | bus-frequency = <0>; | ||
221 | |||
222 | si1: si@700 { | ||
223 | compatible = "fsl,t1040-qe-si"; | ||
224 | reg = <0x700 0x80>; | ||
225 | }; | ||
226 | |||
227 | siram1: siram@1000 { | ||
228 | compatible = "fsl,t1040-qe-siram"; | ||
229 | reg = <0x1000 0x800>; | ||
230 | }; | ||
231 | |||
232 | ucc_hdlc: ucc@2000 { | ||
233 | compatible = "fsl,ucc-hdlc"; | ||
234 | rx-clock-name = "clk8"; | ||
235 | tx-clock-name = "clk9"; | ||
236 | fsl,rx-sync-clock = "rsync_pin"; | ||
237 | fsl,tx-sync-clock = "tsync_pin"; | ||
238 | fsl,tx-timeslot-mask = <0xfffffffe>; | ||
239 | fsl,rx-timeslot-mask = <0xfffffffe>; | ||
240 | fsl,tdm-framer-type = "e1"; | ||
241 | fsl,tdm-id = <0>; | ||
242 | fsl,siram-entry-id = <0>; | ||
243 | fsl,tdm-interface; | ||
244 | }; | ||
245 | |||
246 | ucc_serial: ucc@2200 { | ||
247 | compatible = "fsl,t1040-ucc-uart"; | ||
248 | port-number = <0>; | ||
249 | rx-clock-name = "brg2"; | ||
250 | tx-clock-name = "brg2"; | ||
251 | }; | ||
252 | }; | ||
215 | }; | 253 | }; |
diff --git a/arch/powerpc/boot/dts/fsl/t104xqds.dtsi b/arch/powerpc/boot/dts/fsl/t104xqds.dtsi index 977af355b388..2fd4cbe7098f 100644 --- a/arch/powerpc/boot/dts/fsl/t104xqds.dtsi +++ b/arch/powerpc/boot/dts/fsl/t104xqds.dtsi | |||
@@ -366,4 +366,42 @@ | |||
366 | 0 0x00010000>; | 366 | 0 0x00010000>; |
367 | }; | 367 | }; |
368 | }; | 368 | }; |
369 | |||
370 | qe: qe@ffe140000 { | ||
371 | ranges = <0x0 0xf 0xfe140000 0x40000>; | ||
372 | reg = <0xf 0xfe140000 0 0x480>; | ||
373 | brg-frequency = <0>; | ||
374 | bus-frequency = <0>; | ||
375 | |||
376 | si1: si@700 { | ||
377 | compatible = "fsl,t1040-qe-si"; | ||
378 | reg = <0x700 0x80>; | ||
379 | }; | ||
380 | |||
381 | siram1: siram@1000 { | ||
382 | compatible = "fsl,t1040-qe-siram"; | ||
383 | reg = <0x1000 0x800>; | ||
384 | }; | ||
385 | |||
386 | ucc_hdlc: ucc@2000 { | ||
387 | compatible = "fsl,ucc-hdlc"; | ||
388 | rx-clock-name = "clk8"; | ||
389 | tx-clock-name = "clk9"; | ||
390 | fsl,rx-sync-clock = "rsync_pin"; | ||
391 | fsl,tx-sync-clock = "tsync_pin"; | ||
392 | fsl,tx-timeslot-mask = <0xfffffffe>; | ||
393 | fsl,rx-timeslot-mask = <0xfffffffe>; | ||
394 | fsl,tdm-framer-type = "e1"; | ||
395 | fsl,tdm-id = <0>; | ||
396 | fsl,siram-entry-id = <0>; | ||
397 | fsl,tdm-interface; | ||
398 | }; | ||
399 | |||
400 | ucc_serial: ucc@2200 { | ||
401 | compatible = "fsl,t1040-ucc-uart"; | ||
402 | port-number = <0>; | ||
403 | rx-clock-name = "brg2"; | ||
404 | tx-clock-name = "brg2"; | ||
405 | }; | ||
406 | }; | ||
369 | }; | 407 | }; |
diff --git a/arch/powerpc/boot/dts/fsl/t104xrdb.dtsi b/arch/powerpc/boot/dts/fsl/t104xrdb.dtsi index 7c4afdb44b46..5fdddbd2a62b 100644 --- a/arch/powerpc/boot/dts/fsl/t104xrdb.dtsi +++ b/arch/powerpc/boot/dts/fsl/t104xrdb.dtsi | |||
@@ -222,4 +222,42 @@ | |||
222 | 0 0x00010000>; | 222 | 0 0x00010000>; |
223 | }; | 223 | }; |
224 | }; | 224 | }; |
225 | |||
226 | qe: qe@ffe140000 { | ||
227 | ranges = <0x0 0xf 0xfe140000 0x40000>; | ||
228 | reg = <0xf 0xfe140000 0 0x480>; | ||
229 | brg-frequency = <0>; | ||
230 | bus-frequency = <0>; | ||
231 | |||
232 | si1: si@700 { | ||
233 | compatible = "fsl,t1040-qe-si"; | ||
234 | reg = <0x700 0x80>; | ||
235 | }; | ||
236 | |||
237 | siram1: siram@1000 { | ||
238 | compatible = "fsl,t1040-qe-siram"; | ||
239 | reg = <0x1000 0x800>; | ||
240 | }; | ||
241 | |||
242 | ucc_hdlc: ucc@2000 { | ||
243 | compatible = "fsl,ucc-hdlc"; | ||
244 | rx-clock-name = "clk8"; | ||
245 | tx-clock-name = "clk9"; | ||
246 | fsl,rx-sync-clock = "rsync_pin"; | ||
247 | fsl,tx-sync-clock = "tsync_pin"; | ||
248 | fsl,tx-timeslot-mask = <0xfffffffe>; | ||
249 | fsl,rx-timeslot-mask = <0xfffffffe>; | ||
250 | fsl,tdm-framer-type = "e1"; | ||
251 | fsl,tdm-id = <0>; | ||
252 | fsl,siram-entry-id = <0>; | ||
253 | fsl,tdm-interface; | ||
254 | }; | ||
255 | |||
256 | ucc_serial: ucc@2200 { | ||
257 | compatible = "fsl,t1040-ucc-uart"; | ||
258 | port-number = <0>; | ||
259 | rx-clock-name = "brg2"; | ||
260 | tx-clock-name = "brg2"; | ||
261 | }; | ||
262 | }; | ||
225 | }; | 263 | }; |
diff --git a/arch/powerpc/boot/dts/fsl/t4240si-pre.dtsi b/arch/powerpc/boot/dts/fsl/t4240si-pre.dtsi index 1184a746fcb1..038cf8fadee4 100644 --- a/arch/powerpc/boot/dts/fsl/t4240si-pre.dtsi +++ b/arch/powerpc/boot/dts/fsl/t4240si-pre.dtsi | |||
@@ -56,6 +56,8 @@ | |||
56 | pci1 = &pci1; | 56 | pci1 = &pci1; |
57 | pci2 = &pci2; | 57 | pci2 = &pci2; |
58 | pci3 = &pci3; | 58 | pci3 = &pci3; |
59 | usb0 = &usb0; | ||
60 | usb1 = &usb1; | ||
59 | dma0 = &dma0; | 61 | dma0 = &dma0; |
60 | dma1 = &dma1; | 62 | dma1 = &dma1; |
61 | dma2 = &dma2; | 63 | dma2 = &dma2; |
diff --git a/arch/powerpc/boot/motload-head.S b/arch/powerpc/boot/motload-head.S new file mode 100644 index 000000000000..41cabb4b63fa --- /dev/null +++ b/arch/powerpc/boot/motload-head.S | |||
@@ -0,0 +1,11 @@ | |||
1 | #include "ppc_asm.h" | ||
2 | |||
3 | .text | ||
4 | .globl _zimage_start | ||
5 | _zimage_start: | ||
6 | mfmsr r10 | ||
7 | rlwinm r10,r10,0,~(1<<15) /* Clear MSR_EE */ | ||
8 | sync | ||
9 | mtmsr r10 | ||
10 | isync | ||
11 | b _zimage_start_lib | ||
diff --git a/arch/powerpc/boot/mvme7100.c b/arch/powerpc/boot/mvme7100.c new file mode 100644 index 000000000000..8b0a932311af --- /dev/null +++ b/arch/powerpc/boot/mvme7100.c | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * Motload compatibility for the Emerson/Artesyn MVME7100 | ||
3 | * | ||
4 | * Copyright 2016 Elettra-Sincrotrone Trieste S.C.p.A. | ||
5 | * | ||
6 | * Author: Alessio Igor Bogani <alessio.bogani@elettra.eu> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | * | ||
13 | */ | ||
14 | |||
15 | #include "ops.h" | ||
16 | #include "stdio.h" | ||
17 | #include "cuboot.h" | ||
18 | |||
19 | #define TARGET_86xx | ||
20 | #define TARGET_HAS_ETH1 | ||
21 | #define TARGET_HAS_ETH2 | ||
22 | #define TARGET_HAS_ETH3 | ||
23 | #include "ppcboot.h" | ||
24 | |||
25 | static bd_t bd; | ||
26 | |||
27 | BSS_STACK(16384); | ||
28 | |||
29 | static void mvme7100_fixups(void) | ||
30 | { | ||
31 | void *devp; | ||
32 | unsigned long busfreq = bd.bi_busfreq * 1000000; | ||
33 | |||
34 | dt_fixup_cpu_clocks(bd.bi_intfreq * 1000000, busfreq / 4, busfreq); | ||
35 | |||
36 | devp = finddevice("/soc@f1000000"); | ||
37 | if (devp) | ||
38 | setprop(devp, "bus-frequency", &busfreq, sizeof(busfreq)); | ||
39 | |||
40 | devp = finddevice("/soc/serial@4500"); | ||
41 | if (devp) | ||
42 | setprop(devp, "clock-frequency", &busfreq, sizeof(busfreq)); | ||
43 | |||
44 | dt_fixup_memory(bd.bi_memstart, bd.bi_memsize); | ||
45 | |||
46 | dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr); | ||
47 | dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr); | ||
48 | dt_fixup_mac_address_by_alias("ethernet2", bd.bi_enet2addr); | ||
49 | dt_fixup_mac_address_by_alias("ethernet3", bd.bi_enet3addr); | ||
50 | } | ||
51 | |||
52 | void platform_init(unsigned long r3, unsigned long r4, unsigned long r5, | ||
53 | unsigned long r6, unsigned long r7) | ||
54 | { | ||
55 | CUBOOT_INIT(); | ||
56 | fdt_init(_dtb_start); | ||
57 | serial_console_init(); | ||
58 | platform_ops.fixups = mvme7100_fixups; | ||
59 | } | ||
diff --git a/arch/powerpc/boot/ppcboot.h b/arch/powerpc/boot/ppcboot.h index 6ae6f9063952..453df429d5d0 100644 --- a/arch/powerpc/boot/ppcboot.h +++ b/arch/powerpc/boot/ppcboot.h | |||
@@ -43,7 +43,7 @@ typedef struct bd_info { | |||
43 | unsigned long bi_sramstart; /* start of SRAM memory */ | 43 | unsigned long bi_sramstart; /* start of SRAM memory */ |
44 | unsigned long bi_sramsize; /* size of SRAM memory */ | 44 | unsigned long bi_sramsize; /* size of SRAM memory */ |
45 | #if defined(TARGET_8xx) || defined(TARGET_CPM2) || defined(TARGET_85xx) ||\ | 45 | #if defined(TARGET_8xx) || defined(TARGET_CPM2) || defined(TARGET_85xx) ||\ |
46 | defined(TARGET_83xx) | 46 | defined(TARGET_83xx) || defined(TARGET_86xx) |
47 | unsigned long bi_immr_base; /* base of IMMR register */ | 47 | unsigned long bi_immr_base; /* base of IMMR register */ |
48 | #endif | 48 | #endif |
49 | #if defined(TARGET_PPC_MPC52xx) | 49 | #if defined(TARGET_PPC_MPC52xx) |
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper index 6a19fcef5596..6681ec3625c9 100755 --- a/arch/powerpc/boot/wrapper +++ b/arch/powerpc/boot/wrapper | |||
@@ -302,6 +302,11 @@ mvme5100) | |||
302 | platformo="$object/fixed-head.o $object/mvme5100.o" | 302 | platformo="$object/fixed-head.o $object/mvme5100.o" |
303 | binary=y | 303 | binary=y |
304 | ;; | 304 | ;; |
305 | mvme7100) | ||
306 | platformo="$object/motload-head.o $object/mvme7100.o" | ||
307 | link_address='0x4000000' | ||
308 | binary=y | ||
309 | ;; | ||
305 | esac | 310 | esac |
306 | 311 | ||
307 | vmz="$tmpdir/`basename \"$kernel\"`.$ext" | 312 | vmz="$tmpdir/`basename \"$kernel\"`.$ext" |
diff --git a/arch/powerpc/configs/86xx-hw.config b/arch/powerpc/configs/86xx-hw.config index f91f8895fc93..d3dd6b8865c0 100644 --- a/arch/powerpc/configs/86xx-hw.config +++ b/arch/powerpc/configs/86xx-hw.config | |||
@@ -74,9 +74,9 @@ CONFIG_SERIAL_8250_CONSOLE=y | |||
74 | CONFIG_SERIAL_8250_DETECT_IRQ=y | 74 | CONFIG_SERIAL_8250_DETECT_IRQ=y |
75 | CONFIG_SERIAL_8250_EXTENDED=y | 75 | CONFIG_SERIAL_8250_EXTENDED=y |
76 | CONFIG_SERIAL_8250_MANY_PORTS=y | 76 | CONFIG_SERIAL_8250_MANY_PORTS=y |
77 | CONFIG_SERIAL_8250_NR_UARTS=2 | 77 | CONFIG_SERIAL_8250_NR_UARTS=5 |
78 | CONFIG_SERIAL_8250_RSA=y | 78 | CONFIG_SERIAL_8250_RSA=y |
79 | CONFIG_SERIAL_8250_RUNTIME_UARTS=2 | 79 | CONFIG_SERIAL_8250_RUNTIME_UARTS=5 |
80 | CONFIG_SERIAL_8250_SHARE_IRQ=y | 80 | CONFIG_SERIAL_8250_SHARE_IRQ=y |
81 | CONFIG_SERIAL_8250=y | 81 | CONFIG_SERIAL_8250=y |
82 | CONFIG_SERIO_LIBPS2=y | 82 | CONFIG_SERIO_LIBPS2=y |
diff --git a/arch/powerpc/configs/mpc86xx_basic_defconfig b/arch/powerpc/configs/mpc86xx_basic_defconfig index 33af5c5de105..3283f0586e11 100644 --- a/arch/powerpc/configs/mpc86xx_basic_defconfig +++ b/arch/powerpc/configs/mpc86xx_basic_defconfig | |||
@@ -8,3 +8,4 @@ CONFIG_GEF_SBC610=y | |||
8 | CONFIG_MPC8610_HPCD=y | 8 | CONFIG_MPC8610_HPCD=y |
9 | CONFIG_MPC8641_HPCN=y | 9 | CONFIG_MPC8641_HPCN=y |
10 | CONFIG_SBC8641D=y | 10 | CONFIG_SBC8641D=y |
11 | CONFIG_MVME7100=y | ||
diff --git a/arch/powerpc/configs/pq2fads_defconfig b/arch/powerpc/configs/pq2fads_defconfig index 5432c7a4a51c..50b2bad51d0a 100644 --- a/arch/powerpc/configs/pq2fads_defconfig +++ b/arch/powerpc/configs/pq2fads_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_MTD_CFI_I4=y | |||
39 | CONFIG_MTD_CFI_INTELEXT=y | 39 | CONFIG_MTD_CFI_INTELEXT=y |
40 | CONFIG_MTD_PHYSMAP_OF=y | 40 | CONFIG_MTD_PHYSMAP_OF=y |
41 | CONFIG_BLK_DEV_LOOP=y | 41 | CONFIG_BLK_DEV_LOOP=y |
42 | CONFIG_IDE=y | ||
43 | CONFIG_NETDEVICES=y | 42 | CONFIG_NETDEVICES=y |
44 | CONFIG_TUN=y | 43 | CONFIG_TUN=y |
45 | CONFIG_FS_ENET=y | 44 | CONFIG_FS_ENET=y |
diff --git a/arch/powerpc/include/asm/accounting.h b/arch/powerpc/include/asm/accounting.h new file mode 100644 index 000000000000..c133246df467 --- /dev/null +++ b/arch/powerpc/include/asm/accounting.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * Common time accounting prototypes and such for all ppc machines. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | ||
9 | |||
10 | #ifndef __POWERPC_ACCOUNTING_H | ||
11 | #define __POWERPC_ACCOUNTING_H | ||
12 | |||
13 | /* Stuff for accurate time accounting */ | ||
14 | struct cpu_accounting_data { | ||
15 | unsigned long user_time; /* accumulated usermode TB ticks */ | ||
16 | unsigned long system_time; /* accumulated system TB ticks */ | ||
17 | unsigned long user_time_scaled; /* accumulated usermode SPURR ticks */ | ||
18 | unsigned long starttime; /* TB value snapshot */ | ||
19 | unsigned long starttime_user; /* TB value on exit to usermode */ | ||
20 | unsigned long startspurr; /* SPURR value snapshot */ | ||
21 | unsigned long utime_sspurr; /* ->user_time when ->startspurr set */ | ||
22 | }; | ||
23 | |||
24 | #endif | ||
diff --git a/arch/powerpc/include/asm/cputime.h b/arch/powerpc/include/asm/cputime.h index e2452550bcb1..2dfd4fc41f3e 100644 --- a/arch/powerpc/include/asm/cputime.h +++ b/arch/powerpc/include/asm/cputime.h | |||
@@ -90,11 +90,10 @@ static inline void setup_cputime_one_jiffy(void) | |||
90 | static inline cputime64_t jiffies64_to_cputime64(const u64 jif) | 90 | static inline cputime64_t jiffies64_to_cputime64(const u64 jif) |
91 | { | 91 | { |
92 | u64 ct; | 92 | u64 ct; |
93 | u64 sec; | 93 | u64 sec = jif; |
94 | 94 | ||
95 | /* have to be a little careful about overflow */ | 95 | /* have to be a little careful about overflow */ |
96 | ct = jif % HZ; | 96 | ct = do_div(sec, HZ); |
97 | sec = jif / HZ; | ||
98 | if (ct) { | 97 | if (ct) { |
99 | ct *= tb_ticks_per_sec; | 98 | ct *= tb_ticks_per_sec; |
100 | do_div(ct, HZ); | 99 | do_div(ct, HZ); |
@@ -230,7 +229,16 @@ static inline cputime_t clock_t_to_cputime(const unsigned long clk) | |||
230 | 229 | ||
231 | #define cputime64_to_clock_t(ct) cputime_to_clock_t((cputime_t)(ct)) | 230 | #define cputime64_to_clock_t(ct) cputime_to_clock_t((cputime_t)(ct)) |
232 | 231 | ||
232 | /* | ||
233 | * PPC64 uses PACA which is task independent for storing accounting data while | ||
234 | * PPC32 uses struct thread_info, therefore at task switch the accounting data | ||
235 | * has to be populated in the new task | ||
236 | */ | ||
237 | #ifdef CONFIG_PPC64 | ||
233 | static inline void arch_vtime_task_switch(struct task_struct *tsk) { } | 238 | static inline void arch_vtime_task_switch(struct task_struct *tsk) { } |
239 | #else | ||
240 | void arch_vtime_task_switch(struct task_struct *tsk); | ||
241 | #endif | ||
234 | 242 | ||
235 | #endif /* __KERNEL__ */ | 243 | #endif /* __KERNEL__ */ |
236 | #endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */ | 244 | #endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */ |
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h index c7d27739ea28..bed66e5743b3 100644 --- a/arch/powerpc/include/asm/exception-64s.h +++ b/arch/powerpc/include/asm/exception-64s.h | |||
@@ -287,7 +287,7 @@ do_kvm_##n: \ | |||
287 | std r0,GPR0(r1); /* save r0 in stackframe */ \ | 287 | std r0,GPR0(r1); /* save r0 in stackframe */ \ |
288 | std r10,GPR1(r1); /* save r1 in stackframe */ \ | 288 | std r10,GPR1(r1); /* save r1 in stackframe */ \ |
289 | beq 4f; /* if from kernel mode */ \ | 289 | beq 4f; /* if from kernel mode */ \ |
290 | ACCOUNT_CPU_USER_ENTRY(r9, r10); \ | 290 | ACCOUNT_CPU_USER_ENTRY(r13, r9, r10); \ |
291 | SAVE_PPR(area, r9, r10); \ | 291 | SAVE_PPR(area, r9, r10); \ |
292 | 4: EXCEPTION_PROLOG_COMMON_2(area) \ | 292 | 4: EXCEPTION_PROLOG_COMMON_2(area) \ |
293 | EXCEPTION_PROLOG_COMMON_3(n) \ | 293 | EXCEPTION_PROLOG_COMMON_3(n) \ |
diff --git a/arch/powerpc/include/asm/fixmap.h b/arch/powerpc/include/asm/fixmap.h index 90f604bbcd19..4508b322f2cd 100644 --- a/arch/powerpc/include/asm/fixmap.h +++ b/arch/powerpc/include/asm/fixmap.h | |||
@@ -51,6 +51,13 @@ enum fixed_addresses { | |||
51 | FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ | 51 | FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ |
52 | FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, | 52 | FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, |
53 | #endif | 53 | #endif |
54 | #ifdef CONFIG_PPC_8xx | ||
55 | /* For IMMR we need an aligned 512K area */ | ||
56 | #define FIX_IMMR_SIZE (512 * 1024 / PAGE_SIZE) | ||
57 | FIX_IMMR_START, | ||
58 | FIX_IMMR_BASE = __ALIGN_MASK(FIX_IMMR_START, FIX_IMMR_SIZE - 1) - 1 + | ||
59 | FIX_IMMR_SIZE, | ||
60 | #endif | ||
54 | /* FIX_PCIE_MCFG, */ | 61 | /* FIX_PCIE_MCFG, */ |
55 | __end_of_fixed_addresses | 62 | __end_of_fixed_addresses |
56 | }; | 63 | }; |
diff --git a/arch/powerpc/include/asm/mmu-8xx.h b/arch/powerpc/include/asm/mmu-8xx.h index 0a566f15f985..3e0e4927811c 100644 --- a/arch/powerpc/include/asm/mmu-8xx.h +++ b/arch/powerpc/include/asm/mmu-8xx.h | |||
@@ -169,6 +169,9 @@ typedef struct { | |||
169 | unsigned int active; | 169 | unsigned int active; |
170 | unsigned long vdso_base; | 170 | unsigned long vdso_base; |
171 | } mm_context_t; | 171 | } mm_context_t; |
172 | |||
173 | #define PHYS_IMMR_BASE (mfspr(SPRN_IMMR) & 0xfff80000) | ||
174 | #define VIRT_IMMR_BASE (__fix_to_virt(FIX_IMMR_BASE)) | ||
172 | #endif /* !__ASSEMBLY__ */ | 175 | #endif /* !__ASSEMBLY__ */ |
173 | 176 | ||
174 | #if defined(CONFIG_PPC_4K_PAGES) | 177 | #if defined(CONFIG_PPC_4K_PAGES) |
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h index 546540b91095..ad171e979ab0 100644 --- a/arch/powerpc/include/asm/paca.h +++ b/arch/powerpc/include/asm/paca.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #ifdef CONFIG_KVM_BOOK3S_64_HANDLER | 25 | #ifdef CONFIG_KVM_BOOK3S_64_HANDLER |
26 | #include <asm/kvm_book3s_asm.h> | 26 | #include <asm/kvm_book3s_asm.h> |
27 | #endif | 27 | #endif |
28 | #include <asm/accounting.h> | ||
28 | 29 | ||
29 | register struct paca_struct *local_paca asm("r13"); | 30 | register struct paca_struct *local_paca asm("r13"); |
30 | 31 | ||
@@ -184,13 +185,7 @@ struct paca_struct { | |||
184 | #endif | 185 | #endif |
185 | 186 | ||
186 | /* Stuff for accurate time accounting */ | 187 | /* Stuff for accurate time accounting */ |
187 | u64 user_time; /* accumulated usermode TB ticks */ | 188 | struct cpu_accounting_data accounting; |
188 | u64 system_time; /* accumulated system TB ticks */ | ||
189 | u64 user_time_scaled; /* accumulated usermode SPURR ticks */ | ||
190 | u64 starttime; /* TB value snapshot */ | ||
191 | u64 starttime_user; /* TB value on exit to usermode */ | ||
192 | u64 startspurr; /* SPURR value snapshot */ | ||
193 | u64 utime_sspurr; /* ->user_time when ->startspurr set */ | ||
194 | u64 stolen_time; /* TB ticks taken by hypervisor */ | 189 | u64 stolen_time; /* TB ticks taken by hypervisor */ |
195 | u64 dtl_ridx; /* read index in dispatch log */ | 190 | u64 dtl_ridx; /* read index in dispatch log */ |
196 | struct dtl_entry *dtl_curr; /* pointer corresponding to dtl_ridx */ | 191 | struct dtl_entry *dtl_curr; /* pointer corresponding to dtl_ridx */ |
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index 7b591f98edcc..96b06dc93b4c 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h | |||
@@ -24,27 +24,27 @@ | |||
24 | */ | 24 | */ |
25 | 25 | ||
26 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE | 26 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE |
27 | #define ACCOUNT_CPU_USER_ENTRY(ra, rb) | 27 | #define ACCOUNT_CPU_USER_ENTRY(ptr, ra, rb) |
28 | #define ACCOUNT_CPU_USER_EXIT(ra, rb) | 28 | #define ACCOUNT_CPU_USER_EXIT(ptr, ra, rb) |
29 | #define ACCOUNT_STOLEN_TIME | 29 | #define ACCOUNT_STOLEN_TIME |
30 | #else | 30 | #else |
31 | #define ACCOUNT_CPU_USER_ENTRY(ra, rb) \ | 31 | #define ACCOUNT_CPU_USER_ENTRY(ptr, ra, rb) \ |
32 | MFTB(ra); /* get timebase */ \ | 32 | MFTB(ra); /* get timebase */ \ |
33 | ld rb,PACA_STARTTIME_USER(r13); \ | 33 | PPC_LL rb, ACCOUNT_STARTTIME_USER(ptr); \ |
34 | std ra,PACA_STARTTIME(r13); \ | 34 | PPC_STL ra, ACCOUNT_STARTTIME(ptr); \ |
35 | subf rb,rb,ra; /* subtract start value */ \ | 35 | subf rb,rb,ra; /* subtract start value */ \ |
36 | ld ra,PACA_USER_TIME(r13); \ | 36 | PPC_LL ra, ACCOUNT_USER_TIME(ptr); \ |
37 | add ra,ra,rb; /* add on to user time */ \ | 37 | add ra,ra,rb; /* add on to user time */ \ |
38 | std ra,PACA_USER_TIME(r13); \ | 38 | PPC_STL ra, ACCOUNT_USER_TIME(ptr); \ |
39 | 39 | ||
40 | #define ACCOUNT_CPU_USER_EXIT(ra, rb) \ | 40 | #define ACCOUNT_CPU_USER_EXIT(ptr, ra, rb) \ |
41 | MFTB(ra); /* get timebase */ \ | 41 | MFTB(ra); /* get timebase */ \ |
42 | ld rb,PACA_STARTTIME(r13); \ | 42 | PPC_LL rb, ACCOUNT_STARTTIME(ptr); \ |
43 | std ra,PACA_STARTTIME_USER(r13); \ | 43 | PPC_STL ra, ACCOUNT_STARTTIME_USER(ptr); \ |
44 | subf rb,rb,ra; /* subtract start value */ \ | 44 | subf rb,rb,ra; /* subtract start value */ \ |
45 | ld ra,PACA_SYSTEM_TIME(r13); \ | 45 | PPC_LL ra, ACCOUNT_SYSTEM_TIME(ptr); \ |
46 | add ra,ra,rb; /* add on to system time */ \ | 46 | add ra,ra,rb; /* add on to system time */ \ |
47 | std ra,PACA_SYSTEM_TIME(r13) | 47 | PPC_STL ra, ACCOUNT_SYSTEM_TIME(ptr) |
48 | 48 | ||
49 | #ifdef CONFIG_PPC_SPLPAR | 49 | #ifdef CONFIG_PPC_SPLPAR |
50 | #define ACCOUNT_STOLEN_TIME \ | 50 | #define ACCOUNT_STOLEN_TIME \ |
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index d7e9ab5e4709..40f3615bf940 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h | |||
@@ -1307,6 +1307,7 @@ static inline unsigned long mfvtb (void) | |||
1307 | asm volatile("mfspr %0, %1" : "=r" (rval) : \ | 1307 | asm volatile("mfspr %0, %1" : "=r" (rval) : \ |
1308 | "i" (SPRN_TBRU)); rval;}) | 1308 | "i" (SPRN_TBRU)); rval;}) |
1309 | #endif | 1309 | #endif |
1310 | #define mftb() mftbl() | ||
1310 | #endif /* !__powerpc64__ */ | 1311 | #endif /* !__powerpc64__ */ |
1311 | 1312 | ||
1312 | #define mttbl(v) asm volatile("mttbl %0":: "r"(v)) | 1313 | #define mttbl(v) asm volatile("mttbl %0":: "r"(v)) |
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h index 8febc3f66d53..b21bb1f72314 100644 --- a/arch/powerpc/include/asm/thread_info.h +++ b/arch/powerpc/include/asm/thread_info.h | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <asm/processor.h> | 33 | #include <asm/processor.h> |
34 | #include <asm/page.h> | 34 | #include <asm/page.h> |
35 | #include <linux/stringify.h> | 35 | #include <linux/stringify.h> |
36 | #include <asm/accounting.h> | ||
36 | 37 | ||
37 | /* | 38 | /* |
38 | * low level task data. | 39 | * low level task data. |
@@ -46,6 +47,9 @@ struct thread_info { | |||
46 | #ifdef CONFIG_LIVEPATCH | 47 | #ifdef CONFIG_LIVEPATCH |
47 | unsigned long *livepatch_sp; | 48 | unsigned long *livepatch_sp; |
48 | #endif | 49 | #endif |
50 | #if defined(CONFIG_VIRT_CPU_ACCOUNTING_NATIVE) && defined(CONFIG_PPC32) | ||
51 | struct cpu_accounting_data accounting; | ||
52 | #endif | ||
49 | /* low level flags - has atomic operations done on it */ | 53 | /* low level flags - has atomic operations done on it */ |
50 | unsigned long flags ____cacheline_aligned_in_smp; | 54 | unsigned long flags ____cacheline_aligned_in_smp; |
51 | }; | 55 | }; |
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c index 5b99f956e32f..b89d14c0352c 100644 --- a/arch/powerpc/kernel/asm-offsets.c +++ b/arch/powerpc/kernel/asm-offsets.c | |||
@@ -68,6 +68,10 @@ | |||
68 | #include "../mm/mmu_decl.h" | 68 | #include "../mm/mmu_decl.h" |
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | #ifdef CONFIG_PPC_8xx | ||
72 | #include <asm/fixmap.h> | ||
73 | #endif | ||
74 | |||
71 | int main(void) | 75 | int main(void) |
72 | { | 76 | { |
73 | DEFINE(THREAD, offsetof(struct task_struct, thread)); | 77 | DEFINE(THREAD, offsetof(struct task_struct, thread)); |
@@ -240,13 +244,28 @@ int main(void) | |||
240 | DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id)); | 244 | DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id)); |
241 | DEFINE(PACAKEXECSTATE, offsetof(struct paca_struct, kexec_state)); | 245 | DEFINE(PACAKEXECSTATE, offsetof(struct paca_struct, kexec_state)); |
242 | DEFINE(PACA_DSCR_DEFAULT, offsetof(struct paca_struct, dscr_default)); | 246 | DEFINE(PACA_DSCR_DEFAULT, offsetof(struct paca_struct, dscr_default)); |
243 | DEFINE(PACA_STARTTIME, offsetof(struct paca_struct, starttime)); | 247 | DEFINE(ACCOUNT_STARTTIME, |
244 | DEFINE(PACA_STARTTIME_USER, offsetof(struct paca_struct, starttime_user)); | 248 | offsetof(struct paca_struct, accounting.starttime)); |
245 | DEFINE(PACA_USER_TIME, offsetof(struct paca_struct, user_time)); | 249 | DEFINE(ACCOUNT_STARTTIME_USER, |
246 | DEFINE(PACA_SYSTEM_TIME, offsetof(struct paca_struct, system_time)); | 250 | offsetof(struct paca_struct, accounting.starttime_user)); |
251 | DEFINE(ACCOUNT_USER_TIME, | ||
252 | offsetof(struct paca_struct, accounting.user_time)); | ||
253 | DEFINE(ACCOUNT_SYSTEM_TIME, | ||
254 | offsetof(struct paca_struct, accounting.system_time)); | ||
247 | DEFINE(PACA_TRAP_SAVE, offsetof(struct paca_struct, trap_save)); | 255 | DEFINE(PACA_TRAP_SAVE, offsetof(struct paca_struct, trap_save)); |
248 | DEFINE(PACA_NAPSTATELOST, offsetof(struct paca_struct, nap_state_lost)); | 256 | DEFINE(PACA_NAPSTATELOST, offsetof(struct paca_struct, nap_state_lost)); |
249 | DEFINE(PACA_SPRG_VDSO, offsetof(struct paca_struct, sprg_vdso)); | 257 | DEFINE(PACA_SPRG_VDSO, offsetof(struct paca_struct, sprg_vdso)); |
258 | #else /* CONFIG_PPC64 */ | ||
259 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE | ||
260 | DEFINE(ACCOUNT_STARTTIME, | ||
261 | offsetof(struct thread_info, accounting.starttime)); | ||
262 | DEFINE(ACCOUNT_STARTTIME_USER, | ||
263 | offsetof(struct thread_info, accounting.starttime_user)); | ||
264 | DEFINE(ACCOUNT_USER_TIME, | ||
265 | offsetof(struct thread_info, accounting.user_time)); | ||
266 | DEFINE(ACCOUNT_SYSTEM_TIME, | ||
267 | offsetof(struct thread_info, accounting.system_time)); | ||
268 | #endif | ||
250 | #endif /* CONFIG_PPC64 */ | 269 | #endif /* CONFIG_PPC64 */ |
251 | 270 | ||
252 | /* RTAS */ | 271 | /* RTAS */ |
@@ -734,5 +753,9 @@ int main(void) | |||
734 | 753 | ||
735 | DEFINE(PPC_DBELL_SERVER, PPC_DBELL_SERVER); | 754 | DEFINE(PPC_DBELL_SERVER, PPC_DBELL_SERVER); |
736 | 755 | ||
756 | #ifdef CONFIG_PPC_8xx | ||
757 | DEFINE(VIRT_IMMR_BASE, (u64)__fix_to_virt(FIX_IMMR_BASE)); | ||
758 | #endif | ||
759 | |||
737 | return 0; | 760 | return 0; |
738 | } | 761 | } |
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index 2405631e91a2..9899032230b4 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S | |||
@@ -175,6 +175,12 @@ transfer_to_handler: | |||
175 | addi r12,r12,-1 | 175 | addi r12,r12,-1 |
176 | stw r12,4(r11) | 176 | stw r12,4(r11) |
177 | #endif | 177 | #endif |
178 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE | ||
179 | CURRENT_THREAD_INFO(r9, r1) | ||
180 | tophys(r9, r9) | ||
181 | ACCOUNT_CPU_USER_ENTRY(r9, r11, r12) | ||
182 | #endif | ||
183 | |||
178 | b 3f | 184 | b 3f |
179 | 185 | ||
180 | 2: /* if from kernel, check interrupted DOZE/NAP mode and | 186 | 2: /* if from kernel, check interrupted DOZE/NAP mode and |
@@ -398,6 +404,13 @@ BEGIN_FTR_SECTION | |||
398 | lwarx r7,0,r1 | 404 | lwarx r7,0,r1 |
399 | END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX) | 405 | END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX) |
400 | stwcx. r0,0,r1 /* to clear the reservation */ | 406 | stwcx. r0,0,r1 /* to clear the reservation */ |
407 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE | ||
408 | andi. r4,r8,MSR_PR | ||
409 | beq 3f | ||
410 | CURRENT_THREAD_INFO(r4, r1) | ||
411 | ACCOUNT_CPU_USER_EXIT(r4, r5, r7) | ||
412 | 3: | ||
413 | #endif | ||
401 | lwz r4,_LINK(r1) | 414 | lwz r4,_LINK(r1) |
402 | lwz r5,_CCR(r1) | 415 | lwz r5,_CCR(r1) |
403 | mtlr r4 | 416 | mtlr r4 |
@@ -769,6 +782,10 @@ restore_user: | |||
769 | andis. r10,r0,DBCR0_IDM@h | 782 | andis. r10,r0,DBCR0_IDM@h |
770 | bnel- load_dbcr0 | 783 | bnel- load_dbcr0 |
771 | #endif | 784 | #endif |
785 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE | ||
786 | CURRENT_THREAD_INFO(r9, r1) | ||
787 | ACCOUNT_CPU_USER_EXIT(r9, r10, r11) | ||
788 | #endif | ||
772 | 789 | ||
773 | b restore | 790 | b restore |
774 | 791 | ||
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index 2e0c565754aa..fcb2887f5a33 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
@@ -72,7 +72,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_TM) | |||
72 | std r0,GPR0(r1) | 72 | std r0,GPR0(r1) |
73 | std r10,GPR1(r1) | 73 | std r10,GPR1(r1) |
74 | beq 2f /* if from kernel mode */ | 74 | beq 2f /* if from kernel mode */ |
75 | ACCOUNT_CPU_USER_ENTRY(r10, r11) | 75 | ACCOUNT_CPU_USER_ENTRY(r13, r10, r11) |
76 | 2: std r2,GPR2(r1) | 76 | 2: std r2,GPR2(r1) |
77 | std r3,GPR3(r1) | 77 | std r3,GPR3(r1) |
78 | mfcr r2 | 78 | mfcr r2 |
@@ -246,7 +246,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS) | |||
246 | ld r4,_LINK(r1) | 246 | ld r4,_LINK(r1) |
247 | 247 | ||
248 | beq- 1f | 248 | beq- 1f |
249 | ACCOUNT_CPU_USER_EXIT(r11, r12) | 249 | ACCOUNT_CPU_USER_EXIT(r13, r11, r12) |
250 | 250 | ||
251 | BEGIN_FTR_SECTION | 251 | BEGIN_FTR_SECTION |
252 | HMT_MEDIUM_LOW | 252 | HMT_MEDIUM_LOW |
@@ -859,7 +859,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR) | |||
859 | BEGIN_FTR_SECTION | 859 | BEGIN_FTR_SECTION |
860 | mtspr SPRN_PPR,r2 /* Restore PPR */ | 860 | mtspr SPRN_PPR,r2 /* Restore PPR */ |
861 | END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR) | 861 | END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR) |
862 | ACCOUNT_CPU_USER_EXIT(r2, r4) | 862 | ACCOUNT_CPU_USER_EXIT(r13, r2, r4) |
863 | REST_GPR(13, r1) | 863 | REST_GPR(13, r1) |
864 | 1: | 864 | 1: |
865 | mtspr SPRN_SRR1,r3 | 865 | mtspr SPRN_SRR1,r3 |
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S index 2d3b40fd9bac..38a1f96430e1 100644 --- a/arch/powerpc/kernel/exceptions-64e.S +++ b/arch/powerpc/kernel/exceptions-64e.S | |||
@@ -386,7 +386,7 @@ exc_##n##_common: \ | |||
386 | std r10,_NIP(r1); /* save SRR0 to stackframe */ \ | 386 | std r10,_NIP(r1); /* save SRR0 to stackframe */ \ |
387 | std r11,_MSR(r1); /* save SRR1 to stackframe */ \ | 387 | std r11,_MSR(r1); /* save SRR1 to stackframe */ \ |
388 | beq 2f; /* if from kernel mode */ \ | 388 | beq 2f; /* if from kernel mode */ \ |
389 | ACCOUNT_CPU_USER_ENTRY(r10,r11);/* accounting (uses cr0+eq) */ \ | 389 | ACCOUNT_CPU_USER_ENTRY(r13,r10,r11);/* accounting (uses cr0+eq) */ \ |
390 | 2: ld r3,excf+EX_R10(r13); /* get back r10 */ \ | 390 | 2: ld r3,excf+EX_R10(r13); /* get back r10 */ \ |
391 | ld r4,excf+EX_R11(r13); /* get back r11 */ \ | 391 | ld r4,excf+EX_R11(r13); /* get back r11 */ \ |
392 | mfspr r5,scratch; /* get back r13 */ \ | 392 | mfspr r5,scratch; /* get back r13 */ \ |
@@ -1059,7 +1059,7 @@ fast_exception_return: | |||
1059 | andi. r6,r10,MSR_PR | 1059 | andi. r6,r10,MSR_PR |
1060 | REST_2GPRS(6, r1) | 1060 | REST_2GPRS(6, r1) |
1061 | beq 1f | 1061 | beq 1f |
1062 | ACCOUNT_CPU_USER_EXIT(r10, r11) | 1062 | ACCOUNT_CPU_USER_EXIT(r13, r10, r11) |
1063 | ld r0,GPR13(r1) | 1063 | ld r0,GPR13(r1) |
1064 | 1064 | ||
1065 | 1: stdcx. r0,0,r1 /* to clear the reservation */ | 1065 | 1: stdcx. r0,0,r1 /* to clear the reservation */ |
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S index 80c69472314e..43ddaae42baf 100644 --- a/arch/powerpc/kernel/head_8xx.S +++ b/arch/powerpc/kernel/head_8xx.S | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <asm/ppc_asm.h> | 30 | #include <asm/ppc_asm.h> |
31 | #include <asm/asm-offsets.h> | 31 | #include <asm/asm-offsets.h> |
32 | #include <asm/ptrace.h> | 32 | #include <asm/ptrace.h> |
33 | #include <asm/fixmap.h> | ||
33 | 34 | ||
34 | /* Macro to make the code more readable. */ | 35 | /* Macro to make the code more readable. */ |
35 | #ifdef CONFIG_8xx_CPU6 | 36 | #ifdef CONFIG_8xx_CPU6 |
@@ -383,28 +384,57 @@ InstructionTLBMiss: | |||
383 | EXCEPTION_EPILOG_0 | 384 | EXCEPTION_EPILOG_0 |
384 | rfi | 385 | rfi |
385 | 386 | ||
387 | /* | ||
388 | * Bottom part of DataStoreTLBMiss handler for IMMR area | ||
389 | * not enough space in the DataStoreTLBMiss area | ||
390 | */ | ||
391 | DTLBMissIMMR: | ||
392 | mtcr r10 | ||
393 | /* Set 512k byte guarded page and mark it valid */ | ||
394 | li r10, MD_PS512K | MD_GUARDED | MD_SVALID | ||
395 | MTSPR_CPU6(SPRN_MD_TWC, r10, r11) | ||
396 | mfspr r10, SPRN_IMMR /* Get current IMMR */ | ||
397 | rlwinm r10, r10, 0, 0xfff80000 /* Get 512 kbytes boundary */ | ||
398 | ori r10, r10, 0xf0 | MD_SPS16K | _PAGE_SHARED | _PAGE_DIRTY | \ | ||
399 | _PAGE_PRESENT | _PAGE_NO_CACHE | ||
400 | MTSPR_CPU6(SPRN_MD_RPN, r10, r11) /* Update TLB entry */ | ||
401 | |||
402 | li r11, RPN_PATTERN | ||
403 | mtspr SPRN_DAR, r11 /* Tag DAR */ | ||
404 | EXCEPTION_EPILOG_0 | ||
405 | rfi | ||
406 | |||
386 | . = 0x1200 | 407 | . = 0x1200 |
387 | DataStoreTLBMiss: | 408 | DataStoreTLBMiss: |
388 | mtspr SPRN_SPRG_SCRATCH2, r3 | ||
389 | EXCEPTION_PROLOG_0 | 409 | EXCEPTION_PROLOG_0 |
390 | mfcr r3 | 410 | mfcr r10 |
391 | 411 | ||
392 | /* If we are faulting a kernel address, we have to use the | 412 | /* If we are faulting a kernel address, we have to use the |
393 | * kernel page tables. | 413 | * kernel page tables. |
394 | */ | 414 | */ |
395 | mfspr r10, SPRN_MD_EPN | 415 | mfspr r11, SPRN_MD_EPN |
396 | IS_KERNEL(r11, r10) | 416 | rlwinm r11, r11, 16, 0xfff8 |
417 | #ifndef CONFIG_PIN_TLB_IMMR | ||
418 | cmpli cr0, r11, VIRT_IMMR_BASE@h | ||
419 | #endif | ||
420 | cmpli cr7, r11, PAGE_OFFSET@h | ||
421 | #ifndef CONFIG_PIN_TLB_IMMR | ||
422 | _ENTRY(DTLBMiss_jmp) | ||
423 | beq- DTLBMissIMMR | ||
424 | #endif | ||
425 | bge- cr7, 4f | ||
426 | |||
397 | mfspr r11, SPRN_M_TW /* Get level 1 table */ | 427 | mfspr r11, SPRN_M_TW /* Get level 1 table */ |
398 | BRANCH_UNLESS_KERNEL(3f) | ||
399 | lis r11, (swapper_pg_dir-PAGE_OFFSET)@ha | ||
400 | 3: | 428 | 3: |
429 | mtcr r10 | ||
430 | #ifdef CONFIG_8xx_CPU6 | ||
431 | mtspr SPRN_SPRG_SCRATCH2, r3 | ||
432 | #endif | ||
433 | mfspr r10, SPRN_MD_EPN | ||
401 | 434 | ||
402 | /* Insert level 1 index */ | 435 | /* Insert level 1 index */ |
403 | rlwimi r11, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29 | 436 | rlwimi r11, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29 |
404 | lwz r11, (swapper_pg_dir-PAGE_OFFSET)@l(r11) /* Get the level 1 entry */ | 437 | lwz r11, (swapper_pg_dir-PAGE_OFFSET)@l(r11) /* Get the level 1 entry */ |
405 | mtcr r11 | ||
406 | bt- 28,DTLBMiss8M /* bit 28 = Large page (8M) */ | ||
407 | mtcr r3 | ||
408 | 438 | ||
409 | /* We have a pte table, so load fetch the pte from the table. | 439 | /* We have a pte table, so load fetch the pte from the table. |
410 | */ | 440 | */ |
@@ -452,29 +482,30 @@ DataStoreTLBMiss: | |||
452 | MTSPR_CPU6(SPRN_MD_RPN, r10, r3) /* Update TLB entry */ | 482 | MTSPR_CPU6(SPRN_MD_RPN, r10, r3) /* Update TLB entry */ |
453 | 483 | ||
454 | /* Restore registers */ | 484 | /* Restore registers */ |
485 | #ifdef CONFIG_8xx_CPU6 | ||
455 | mfspr r3, SPRN_SPRG_SCRATCH2 | 486 | mfspr r3, SPRN_SPRG_SCRATCH2 |
487 | #endif | ||
456 | mtspr SPRN_DAR, r11 /* Tag DAR */ | 488 | mtspr SPRN_DAR, r11 /* Tag DAR */ |
457 | EXCEPTION_EPILOG_0 | 489 | EXCEPTION_EPILOG_0 |
458 | rfi | 490 | rfi |
459 | 491 | ||
460 | DTLBMiss8M: | 492 | 4: |
461 | mtcr r3 | 493 | _ENTRY(DTLBMiss_cmp) |
462 | ori r11, r11, MD_SVALID | 494 | cmpli cr0, r11, (PAGE_OFFSET + 0x1800000)@h |
463 | MTSPR_CPU6(SPRN_MD_TWC, r11, r3) | 495 | lis r11, (swapper_pg_dir-PAGE_OFFSET)@ha |
464 | #ifdef CONFIG_PPC_16K_PAGES | 496 | bge- 3b |
465 | /* | 497 | |
466 | * In 16k pages mode, each PGD entry defines a 64M block. | 498 | mtcr r10 |
467 | * Here we select the 8M page within the block. | 499 | /* Set 8M byte page and mark it valid */ |
468 | */ | 500 | li r10, MD_PS8MEG | MD_SVALID |
469 | rlwimi r11, r10, 0, 0x03800000 | 501 | MTSPR_CPU6(SPRN_MD_TWC, r10, r11) |
470 | #endif | 502 | mfspr r10, SPRN_MD_EPN |
471 | rlwinm r10, r11, 0, 0xff800000 | 503 | rlwinm r10, r10, 0, 0x0f800000 /* 8xx supports max 256Mb RAM */ |
472 | ori r10, r10, 0xf0 | MD_SPS16K | _PAGE_SHARED | _PAGE_DIRTY | \ | 504 | ori r10, r10, 0xf0 | MD_SPS16K | _PAGE_SHARED | _PAGE_DIRTY | \ |
473 | _PAGE_PRESENT | 505 | _PAGE_PRESENT |
474 | MTSPR_CPU6(SPRN_MD_RPN, r10, r3) /* Update TLB entry */ | 506 | MTSPR_CPU6(SPRN_MD_RPN, r10, r11) /* Update TLB entry */ |
475 | 507 | ||
476 | li r11, RPN_PATTERN | 508 | li r11, RPN_PATTERN |
477 | mfspr r3, SPRN_SPRG_SCRATCH2 | ||
478 | mtspr SPRN_DAR, r11 /* Tag DAR */ | 509 | mtspr SPRN_DAR, r11 /* Tag DAR */ |
479 | EXCEPTION_EPILOG_0 | 510 | EXCEPTION_EPILOG_0 |
480 | rfi | 511 | rfi |
@@ -553,12 +584,14 @@ FixupDAR:/* Entry point for dcbx workaround. */ | |||
553 | IS_KERNEL(r11, r10) | 584 | IS_KERNEL(r11, r10) |
554 | mfspr r11, SPRN_M_TW /* Get level 1 table */ | 585 | mfspr r11, SPRN_M_TW /* Get level 1 table */ |
555 | BRANCH_UNLESS_KERNEL(3f) | 586 | BRANCH_UNLESS_KERNEL(3f) |
587 | rlwinm r11, r10, 16, 0xfff8 | ||
588 | _ENTRY(FixupDAR_cmp) | ||
589 | cmpli cr7, r11, (PAGE_OFFSET + 0x1800000)@h | ||
590 | blt- cr7, 200f | ||
556 | lis r11, (swapper_pg_dir-PAGE_OFFSET)@ha | 591 | lis r11, (swapper_pg_dir-PAGE_OFFSET)@ha |
557 | /* Insert level 1 index */ | 592 | /* Insert level 1 index */ |
558 | 3: rlwimi r11, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29 | 593 | 3: rlwimi r11, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29 |
559 | lwz r11, (swapper_pg_dir-PAGE_OFFSET)@l(r11) /* Get the level 1 entry */ | 594 | lwz r11, (swapper_pg_dir-PAGE_OFFSET)@l(r11) /* Get the level 1 entry */ |
560 | mtcr r11 | ||
561 | bt 28,200f /* bit 28 = Large page (8M) */ | ||
562 | rlwinm r11, r11,0,0,19 /* Extract page descriptor page address */ | 595 | rlwinm r11, r11,0,0,19 /* Extract page descriptor page address */ |
563 | /* Insert level 2 index */ | 596 | /* Insert level 2 index */ |
564 | rlwimi r11, r10, 32 - (PAGE_SHIFT - 2), 32 - PAGE_SHIFT, 29 | 597 | rlwimi r11, r10, 32 - (PAGE_SHIFT - 2), 32 - PAGE_SHIFT, 29 |
@@ -584,8 +617,8 @@ FixupDAR:/* Entry point for dcbx workaround. */ | |||
584 | 141: mfspr r10,SPRN_SPRG_SCRATCH2 | 617 | 141: mfspr r10,SPRN_SPRG_SCRATCH2 |
585 | b DARFixed /* Nope, go back to normal TLB processing */ | 618 | b DARFixed /* Nope, go back to normal TLB processing */ |
586 | 619 | ||
587 | /* concat physical page address(r11) and page offset(r10) */ | 620 | /* create physical page address from effective address */ |
588 | 200: rlwimi r11, r10, 0, 32 - (PAGE_SHIFT << 1), 31 | 621 | 200: tophys(r11, r10) |
589 | b 201b | 622 | b 201b |
590 | 623 | ||
591 | 144: mfspr r10, SPRN_DSISR | 624 | 144: mfspr r10, SPRN_DSISR |
@@ -763,10 +796,18 @@ start_here: | |||
763 | * virtual to physical. Also, set the cache mode since that is defined | 796 | * virtual to physical. Also, set the cache mode since that is defined |
764 | * by TLB entries and perform any additional mapping (like of the IMMR). | 797 | * by TLB entries and perform any additional mapping (like of the IMMR). |
765 | * If configured to pin some TLBs, we pin the first 8 Mbytes of kernel, | 798 | * If configured to pin some TLBs, we pin the first 8 Mbytes of kernel, |
766 | * 24 Mbytes of data, and the 8M IMMR space. Anything not covered by | 799 | * 24 Mbytes of data, and the 512k IMMR space. Anything not covered by |
767 | * these mappings is mapped by page tables. | 800 | * these mappings is mapped by page tables. |
768 | */ | 801 | */ |
769 | initial_mmu: | 802 | initial_mmu: |
803 | li r8, 0 | ||
804 | mtspr SPRN_MI_CTR, r8 /* remove PINNED ITLB entries */ | ||
805 | lis r10, MD_RESETVAL@h | ||
806 | #ifndef CONFIG_8xx_COPYBACK | ||
807 | oris r10, r10, MD_WTDEF@h | ||
808 | #endif | ||
809 | mtspr SPRN_MD_CTR, r10 /* remove PINNED DTLB entries */ | ||
810 | |||
770 | tlbia /* Invalidate all TLB entries */ | 811 | tlbia /* Invalidate all TLB entries */ |
771 | /* Always pin the first 8 MB ITLB to prevent ITLB | 812 | /* Always pin the first 8 MB ITLB to prevent ITLB |
772 | misses while mucking around with SRR0/SRR1 in asm | 813 | misses while mucking around with SRR0/SRR1 in asm |
@@ -777,34 +818,20 @@ initial_mmu: | |||
777 | mtspr SPRN_MI_CTR, r8 /* Set instruction MMU control */ | 818 | mtspr SPRN_MI_CTR, r8 /* Set instruction MMU control */ |
778 | 819 | ||
779 | #ifdef CONFIG_PIN_TLB | 820 | #ifdef CONFIG_PIN_TLB |
780 | lis r10, (MD_RSV4I | MD_RESETVAL)@h | 821 | oris r10, r10, MD_RSV4I@h |
781 | ori r10, r10, 0x1c00 | ||
782 | mr r8, r10 | ||
783 | #else | ||
784 | lis r10, MD_RESETVAL@h | ||
785 | #endif | ||
786 | #ifndef CONFIG_8xx_COPYBACK | ||
787 | oris r10, r10, MD_WTDEF@h | ||
788 | #endif | ||
789 | mtspr SPRN_MD_CTR, r10 /* Set data TLB control */ | 822 | mtspr SPRN_MD_CTR, r10 /* Set data TLB control */ |
823 | #endif | ||
790 | 824 | ||
791 | /* Now map the lower 8 Meg into the TLBs. For this quick hack, | 825 | /* Now map the lower 8 Meg into the ITLB. */ |
792 | * we can load the instruction and data TLB registers with the | ||
793 | * same values. | ||
794 | */ | ||
795 | lis r8, KERNELBASE@h /* Create vaddr for TLB */ | 826 | lis r8, KERNELBASE@h /* Create vaddr for TLB */ |
796 | ori r8, r8, MI_EVALID /* Mark it valid */ | 827 | ori r8, r8, MI_EVALID /* Mark it valid */ |
797 | mtspr SPRN_MI_EPN, r8 | 828 | mtspr SPRN_MI_EPN, r8 |
798 | mtspr SPRN_MD_EPN, r8 | ||
799 | li r8, MI_PS8MEG | (2 << 5) /* Set 8M byte page, APG 2 */ | 829 | li r8, MI_PS8MEG | (2 << 5) /* Set 8M byte page, APG 2 */ |
800 | ori r8, r8, MI_SVALID /* Make it valid */ | 830 | ori r8, r8, MI_SVALID /* Make it valid */ |
801 | mtspr SPRN_MI_TWC, r8 | 831 | mtspr SPRN_MI_TWC, r8 |
802 | li r8, MI_PS8MEG /* Set 8M byte page, APG 0 */ | ||
803 | ori r8, r8, MI_SVALID /* Make it valid */ | ||
804 | mtspr SPRN_MD_TWC, r8 | ||
805 | li r8, MI_BOOTINIT /* Create RPN for address 0 */ | 832 | li r8, MI_BOOTINIT /* Create RPN for address 0 */ |
806 | mtspr SPRN_MI_RPN, r8 /* Store TLB entry */ | 833 | mtspr SPRN_MI_RPN, r8 /* Store TLB entry */ |
807 | mtspr SPRN_MD_RPN, r8 | 834 | |
808 | lis r8, MI_APG_INIT@h /* Set protection modes */ | 835 | lis r8, MI_APG_INIT@h /* Set protection modes */ |
809 | ori r8, r8, MI_APG_INIT@l | 836 | ori r8, r8, MI_APG_INIT@l |
810 | mtspr SPRN_MI_AP, r8 | 837 | mtspr SPRN_MI_AP, r8 |
@@ -812,51 +839,25 @@ initial_mmu: | |||
812 | ori r8, r8, MD_APG_INIT@l | 839 | ori r8, r8, MD_APG_INIT@l |
813 | mtspr SPRN_MD_AP, r8 | 840 | mtspr SPRN_MD_AP, r8 |
814 | 841 | ||
815 | /* Map another 8 MByte at the IMMR to get the processor | 842 | /* Map a 512k page for the IMMR to get the processor |
816 | * internal registers (among other things). | 843 | * internal registers (among other things). |
817 | */ | 844 | */ |
818 | #ifdef CONFIG_PIN_TLB | 845 | #ifdef CONFIG_PIN_TLB_IMMR |
819 | addi r10, r10, 0x0100 | 846 | ori r10, r10, 0x1c00 |
820 | mtspr SPRN_MD_CTR, r10 | 847 | mtspr SPRN_MD_CTR, r10 |
821 | #endif | 848 | |
822 | mfspr r9, 638 /* Get current IMMR */ | 849 | mfspr r9, 638 /* Get current IMMR */ |
823 | andis. r9, r9, 0xff80 /* Get 8Mbyte boundary */ | 850 | andis. r9, r9, 0xfff8 /* Get 512 kbytes boundary */ |
824 | 851 | ||
825 | mr r8, r9 /* Create vaddr for TLB */ | 852 | lis r8, VIRT_IMMR_BASE@h /* Create vaddr for TLB */ |
826 | ori r8, r8, MD_EVALID /* Mark it valid */ | 853 | ori r8, r8, MD_EVALID /* Mark it valid */ |
827 | mtspr SPRN_MD_EPN, r8 | 854 | mtspr SPRN_MD_EPN, r8 |
828 | li r8, MD_PS8MEG /* Set 8M byte page */ | 855 | li r8, MD_PS512K | MD_GUARDED /* Set 512k byte page */ |
829 | ori r8, r8, MD_SVALID /* Make it valid */ | 856 | ori r8, r8, MD_SVALID /* Make it valid */ |
830 | mtspr SPRN_MD_TWC, r8 | 857 | mtspr SPRN_MD_TWC, r8 |
831 | mr r8, r9 /* Create paddr for TLB */ | 858 | mr r8, r9 /* Create paddr for TLB */ |
832 | ori r8, r8, MI_BOOTINIT|0x2 /* Inhibit cache -- Cort */ | 859 | ori r8, r8, MI_BOOTINIT|0x2 /* Inhibit cache -- Cort */ |
833 | mtspr SPRN_MD_RPN, r8 | 860 | mtspr SPRN_MD_RPN, r8 |
834 | |||
835 | #ifdef CONFIG_PIN_TLB | ||
836 | /* Map two more 8M kernel data pages. | ||
837 | */ | ||
838 | addi r10, r10, 0x0100 | ||
839 | mtspr SPRN_MD_CTR, r10 | ||
840 | |||
841 | lis r8, KERNELBASE@h /* Create vaddr for TLB */ | ||
842 | addis r8, r8, 0x0080 /* Add 8M */ | ||
843 | ori r8, r8, MI_EVALID /* Mark it valid */ | ||
844 | mtspr SPRN_MD_EPN, r8 | ||
845 | li r9, MI_PS8MEG /* Set 8M byte page */ | ||
846 | ori r9, r9, MI_SVALID /* Make it valid */ | ||
847 | mtspr SPRN_MD_TWC, r9 | ||
848 | li r11, MI_BOOTINIT /* Create RPN for address 0 */ | ||
849 | addis r11, r11, 0x0080 /* Add 8M */ | ||
850 | mtspr SPRN_MD_RPN, r11 | ||
851 | |||
852 | addi r10, r10, 0x0100 | ||
853 | mtspr SPRN_MD_CTR, r10 | ||
854 | |||
855 | addis r8, r8, 0x0080 /* Add 8M */ | ||
856 | mtspr SPRN_MD_EPN, r8 | ||
857 | mtspr SPRN_MD_TWC, r9 | ||
858 | addis r11, r11, 0x0080 /* Add 8M */ | ||
859 | mtspr SPRN_MD_RPN, r11 | ||
860 | #endif | 861 | #endif |
861 | 862 | ||
862 | /* Since the cache is enabled according to the information we | 863 | /* Since the cache is enabled according to the information we |
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 6b4d01d1ccf0..4e7759c8ca30 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
@@ -167,7 +167,15 @@ DEFINE_PER_CPU(unsigned long, cputime_scaled_last_delta); | |||
167 | 167 | ||
168 | cputime_t cputime_one_jiffy; | 168 | cputime_t cputime_one_jiffy; |
169 | 169 | ||
170 | #ifdef CONFIG_PPC_SPLPAR | ||
170 | void (*dtl_consumer)(struct dtl_entry *, u64); | 171 | void (*dtl_consumer)(struct dtl_entry *, u64); |
172 | #endif | ||
173 | |||
174 | #ifdef CONFIG_PPC64 | ||
175 | #define get_accounting(tsk) (&get_paca()->accounting) | ||
176 | #else | ||
177 | #define get_accounting(tsk) (&task_thread_info(tsk)->accounting) | ||
178 | #endif | ||
171 | 179 | ||
172 | static void calc_cputime_factors(void) | 180 | static void calc_cputime_factors(void) |
173 | { | 181 | { |
@@ -187,7 +195,7 @@ static void calc_cputime_factors(void) | |||
187 | * Read the SPURR on systems that have it, otherwise the PURR, | 195 | * Read the SPURR on systems that have it, otherwise the PURR, |
188 | * or if that doesn't exist return the timebase value passed in. | 196 | * or if that doesn't exist return the timebase value passed in. |
189 | */ | 197 | */ |
190 | static u64 read_spurr(u64 tb) | 198 | static unsigned long read_spurr(unsigned long tb) |
191 | { | 199 | { |
192 | if (cpu_has_feature(CPU_FTR_SPURR)) | 200 | if (cpu_has_feature(CPU_FTR_SPURR)) |
193 | return mfspr(SPRN_SPURR); | 201 | return mfspr(SPRN_SPURR); |
@@ -250,8 +258,8 @@ static u64 scan_dispatch_log(u64 stop_tb) | |||
250 | void accumulate_stolen_time(void) | 258 | void accumulate_stolen_time(void) |
251 | { | 259 | { |
252 | u64 sst, ust; | 260 | u64 sst, ust; |
253 | |||
254 | u8 save_soft_enabled = local_paca->soft_enabled; | 261 | u8 save_soft_enabled = local_paca->soft_enabled; |
262 | struct cpu_accounting_data *acct = &local_paca->accounting; | ||
255 | 263 | ||
256 | /* We are called early in the exception entry, before | 264 | /* We are called early in the exception entry, before |
257 | * soft/hard_enabled are sync'ed to the expected state | 265 | * soft/hard_enabled are sync'ed to the expected state |
@@ -261,10 +269,10 @@ void accumulate_stolen_time(void) | |||
261 | */ | 269 | */ |
262 | local_paca->soft_enabled = 0; | 270 | local_paca->soft_enabled = 0; |
263 | 271 | ||
264 | sst = scan_dispatch_log(local_paca->starttime_user); | 272 | sst = scan_dispatch_log(acct->starttime_user); |
265 | ust = scan_dispatch_log(local_paca->starttime); | 273 | ust = scan_dispatch_log(acct->starttime); |
266 | local_paca->system_time -= sst; | 274 | acct->system_time -= sst; |
267 | local_paca->user_time -= ust; | 275 | acct->user_time -= ust; |
268 | local_paca->stolen_time += ust + sst; | 276 | local_paca->stolen_time += ust + sst; |
269 | 277 | ||
270 | local_paca->soft_enabled = save_soft_enabled; | 278 | local_paca->soft_enabled = save_soft_enabled; |
@@ -276,7 +284,7 @@ static inline u64 calculate_stolen_time(u64 stop_tb) | |||
276 | 284 | ||
277 | if (get_paca()->dtl_ridx != be64_to_cpu(get_lppaca()->dtl_idx)) { | 285 | if (get_paca()->dtl_ridx != be64_to_cpu(get_lppaca()->dtl_idx)) { |
278 | stolen = scan_dispatch_log(stop_tb); | 286 | stolen = scan_dispatch_log(stop_tb); |
279 | get_paca()->system_time -= stolen; | 287 | get_paca()->accounting.system_time -= stolen; |
280 | } | 288 | } |
281 | 289 | ||
282 | stolen += get_paca()->stolen_time; | 290 | stolen += get_paca()->stolen_time; |
@@ -296,27 +304,29 @@ static inline u64 calculate_stolen_time(u64 stop_tb) | |||
296 | * Account time for a transition between system, hard irq | 304 | * Account time for a transition between system, hard irq |
297 | * or soft irq state. | 305 | * or soft irq state. |
298 | */ | 306 | */ |
299 | static u64 vtime_delta(struct task_struct *tsk, | 307 | static unsigned long vtime_delta(struct task_struct *tsk, |
300 | u64 *sys_scaled, u64 *stolen) | 308 | unsigned long *sys_scaled, |
309 | unsigned long *stolen) | ||
301 | { | 310 | { |
302 | u64 now, nowscaled, deltascaled; | 311 | unsigned long now, nowscaled, deltascaled; |
303 | u64 udelta, delta, user_scaled; | 312 | unsigned long udelta, delta, user_scaled; |
313 | struct cpu_accounting_data *acct = get_accounting(tsk); | ||
304 | 314 | ||
305 | WARN_ON_ONCE(!irqs_disabled()); | 315 | WARN_ON_ONCE(!irqs_disabled()); |
306 | 316 | ||
307 | now = mftb(); | 317 | now = mftb(); |
308 | nowscaled = read_spurr(now); | 318 | nowscaled = read_spurr(now); |
309 | get_paca()->system_time += now - get_paca()->starttime; | 319 | acct->system_time += now - acct->starttime; |
310 | get_paca()->starttime = now; | 320 | acct->starttime = now; |
311 | deltascaled = nowscaled - get_paca()->startspurr; | 321 | deltascaled = nowscaled - acct->startspurr; |
312 | get_paca()->startspurr = nowscaled; | 322 | acct->startspurr = nowscaled; |
313 | 323 | ||
314 | *stolen = calculate_stolen_time(now); | 324 | *stolen = calculate_stolen_time(now); |
315 | 325 | ||
316 | delta = get_paca()->system_time; | 326 | delta = acct->system_time; |
317 | get_paca()->system_time = 0; | 327 | acct->system_time = 0; |
318 | udelta = get_paca()->user_time - get_paca()->utime_sspurr; | 328 | udelta = acct->user_time - acct->utime_sspurr; |
319 | get_paca()->utime_sspurr = get_paca()->user_time; | 329 | acct->utime_sspurr = acct->user_time; |
320 | 330 | ||
321 | /* | 331 | /* |
322 | * Because we don't read the SPURR on every kernel entry/exit, | 332 | * Because we don't read the SPURR on every kernel entry/exit, |
@@ -338,14 +348,14 @@ static u64 vtime_delta(struct task_struct *tsk, | |||
338 | *sys_scaled = deltascaled; | 348 | *sys_scaled = deltascaled; |
339 | } | 349 | } |
340 | } | 350 | } |
341 | get_paca()->user_time_scaled += user_scaled; | 351 | acct->user_time_scaled += user_scaled; |
342 | 352 | ||
343 | return delta; | 353 | return delta; |
344 | } | 354 | } |
345 | 355 | ||
346 | void vtime_account_system(struct task_struct *tsk) | 356 | void vtime_account_system(struct task_struct *tsk) |
347 | { | 357 | { |
348 | u64 delta, sys_scaled, stolen; | 358 | unsigned long delta, sys_scaled, stolen; |
349 | 359 | ||
350 | delta = vtime_delta(tsk, &sys_scaled, &stolen); | 360 | delta = vtime_delta(tsk, &sys_scaled, &stolen); |
351 | account_system_time(tsk, 0, delta, sys_scaled); | 361 | account_system_time(tsk, 0, delta, sys_scaled); |
@@ -356,7 +366,7 @@ EXPORT_SYMBOL_GPL(vtime_account_system); | |||
356 | 366 | ||
357 | void vtime_account_idle(struct task_struct *tsk) | 367 | void vtime_account_idle(struct task_struct *tsk) |
358 | { | 368 | { |
359 | u64 delta, sys_scaled, stolen; | 369 | unsigned long delta, sys_scaled, stolen; |
360 | 370 | ||
361 | delta = vtime_delta(tsk, &sys_scaled, &stolen); | 371 | delta = vtime_delta(tsk, &sys_scaled, &stolen); |
362 | account_idle_time(delta + stolen); | 372 | account_idle_time(delta + stolen); |
@@ -374,15 +384,32 @@ void vtime_account_idle(struct task_struct *tsk) | |||
374 | void vtime_account_user(struct task_struct *tsk) | 384 | void vtime_account_user(struct task_struct *tsk) |
375 | { | 385 | { |
376 | cputime_t utime, utimescaled; | 386 | cputime_t utime, utimescaled; |
387 | struct cpu_accounting_data *acct = get_accounting(tsk); | ||
377 | 388 | ||
378 | utime = get_paca()->user_time; | 389 | utime = acct->user_time; |
379 | utimescaled = get_paca()->user_time_scaled; | 390 | utimescaled = acct->user_time_scaled; |
380 | get_paca()->user_time = 0; | 391 | acct->user_time = 0; |
381 | get_paca()->user_time_scaled = 0; | 392 | acct->user_time_scaled = 0; |
382 | get_paca()->utime_sspurr = 0; | 393 | acct->utime_sspurr = 0; |
383 | account_user_time(tsk, utime, utimescaled); | 394 | account_user_time(tsk, utime, utimescaled); |
384 | } | 395 | } |
385 | 396 | ||
397 | #ifdef CONFIG_PPC32 | ||
398 | /* | ||
399 | * Called from the context switch with interrupts disabled, to charge all | ||
400 | * accumulated times to the current process, and to prepare accounting on | ||
401 | * the next process. | ||
402 | */ | ||
403 | void arch_vtime_task_switch(struct task_struct *prev) | ||
404 | { | ||
405 | struct cpu_accounting_data *acct = get_accounting(current); | ||
406 | |||
407 | acct->starttime = get_accounting(prev)->starttime; | ||
408 | acct->system_time = 0; | ||
409 | acct->user_time = 0; | ||
410 | } | ||
411 | #endif /* CONFIG_PPC32 */ | ||
412 | |||
386 | #else /* ! CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */ | 413 | #else /* ! CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */ |
387 | #define calc_cputime_factors() | 414 | #define calc_cputime_factors() |
388 | #endif | 415 | #endif |
diff --git a/arch/powerpc/mm/8xx_mmu.c b/arch/powerpc/mm/8xx_mmu.c index 949100577db5..6c5025e81236 100644 --- a/arch/powerpc/mm/8xx_mmu.c +++ b/arch/powerpc/mm/8xx_mmu.c | |||
@@ -13,62 +13,115 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/memblock.h> | 15 | #include <linux/memblock.h> |
16 | #include <asm/fixmap.h> | ||
17 | #include <asm/code-patching.h> | ||
16 | 18 | ||
17 | #include "mmu_decl.h" | 19 | #include "mmu_decl.h" |
18 | 20 | ||
21 | #define IMMR_SIZE (FIX_IMMR_SIZE << PAGE_SHIFT) | ||
22 | |||
19 | extern int __map_without_ltlbs; | 23 | extern int __map_without_ltlbs; |
24 | |||
20 | /* | 25 | /* |
21 | * MMU_init_hw does the chip-specific initialization of the MMU hardware. | 26 | * Return PA for this VA if it is in IMMR area, or 0 |
22 | */ | 27 | */ |
23 | void __init MMU_init_hw(void) | 28 | phys_addr_t v_block_mapped(unsigned long va) |
24 | { | 29 | { |
25 | /* Nothing to do for the time being but keep it similar to other PPC */ | 30 | unsigned long p = PHYS_IMMR_BASE; |
31 | |||
32 | if (__map_without_ltlbs) | ||
33 | return 0; | ||
34 | if (va >= VIRT_IMMR_BASE && va < VIRT_IMMR_BASE + IMMR_SIZE) | ||
35 | return p + va - VIRT_IMMR_BASE; | ||
36 | return 0; | ||
37 | } | ||
38 | |||
39 | /* | ||
40 | * Return VA for a given PA or 0 if not mapped | ||
41 | */ | ||
42 | unsigned long p_block_mapped(phys_addr_t pa) | ||
43 | { | ||
44 | unsigned long p = PHYS_IMMR_BASE; | ||
45 | |||
46 | if (__map_without_ltlbs) | ||
47 | return 0; | ||
48 | if (pa >= p && pa < p + IMMR_SIZE) | ||
49 | return VIRT_IMMR_BASE + pa - p; | ||
50 | return 0; | ||
26 | } | 51 | } |
27 | 52 | ||
28 | #define LARGE_PAGE_SIZE_4M (1<<22) | ||
29 | #define LARGE_PAGE_SIZE_8M (1<<23) | 53 | #define LARGE_PAGE_SIZE_8M (1<<23) |
30 | #define LARGE_PAGE_SIZE_64M (1<<26) | ||
31 | 54 | ||
32 | unsigned long __init mmu_mapin_ram(unsigned long top) | 55 | /* |
56 | * MMU_init_hw does the chip-specific initialization of the MMU hardware. | ||
57 | */ | ||
58 | void __init MMU_init_hw(void) | ||
33 | { | 59 | { |
34 | unsigned long v, s, mapped; | 60 | /* PIN up to the 3 first 8Mb after IMMR in DTLB table */ |
35 | phys_addr_t p; | 61 | #ifdef CONFIG_PIN_TLB |
62 | unsigned long ctr = mfspr(SPRN_MD_CTR) & 0xfe000000; | ||
63 | unsigned long flags = 0xf0 | MD_SPS16K | _PAGE_SHARED | _PAGE_DIRTY; | ||
64 | #ifdef CONFIG_PIN_TLB_IMMR | ||
65 | int i = 29; | ||
66 | #else | ||
67 | int i = 28; | ||
68 | #endif | ||
69 | unsigned long addr = 0; | ||
70 | unsigned long mem = total_lowmem; | ||
71 | |||
72 | for (; i < 32 && mem >= LARGE_PAGE_SIZE_8M; i++) { | ||
73 | mtspr(SPRN_MD_CTR, ctr | (i << 8)); | ||
74 | mtspr(SPRN_MD_EPN, (unsigned long)__va(addr) | MD_EVALID); | ||
75 | mtspr(SPRN_MD_TWC, MD_PS8MEG | MD_SVALID); | ||
76 | mtspr(SPRN_MD_RPN, addr | flags | _PAGE_PRESENT); | ||
77 | addr += LARGE_PAGE_SIZE_8M; | ||
78 | mem -= LARGE_PAGE_SIZE_8M; | ||
79 | } | ||
80 | #endif | ||
81 | } | ||
36 | 82 | ||
37 | v = KERNELBASE; | 83 | static void mmu_mapin_immr(void) |
38 | p = 0; | 84 | { |
39 | s = top; | 85 | unsigned long p = PHYS_IMMR_BASE; |
86 | unsigned long v = VIRT_IMMR_BASE; | ||
87 | unsigned long f = pgprot_val(PAGE_KERNEL_NCG); | ||
88 | int offset; | ||
40 | 89 | ||
41 | if (__map_without_ltlbs) | 90 | for (offset = 0; offset < IMMR_SIZE; offset += PAGE_SIZE) |
42 | return 0; | 91 | map_page(v + offset, p + offset, f); |
92 | } | ||
43 | 93 | ||
44 | #ifdef CONFIG_PPC_4K_PAGES | 94 | /* Address of instructions to patch */ |
45 | while (s >= LARGE_PAGE_SIZE_8M) { | 95 | #ifndef CONFIG_PIN_TLB_IMMR |
46 | pmd_t *pmdp; | 96 | extern unsigned int DTLBMiss_jmp; |
47 | unsigned long val = p | MD_PS8MEG; | 97 | #endif |
98 | extern unsigned int DTLBMiss_cmp, FixupDAR_cmp; | ||
48 | 99 | ||
49 | pmdp = pmd_offset(pud_offset(pgd_offset_k(v), v), v); | 100 | void mmu_patch_cmp_limit(unsigned int *addr, unsigned long mapped) |
50 | *pmdp++ = __pmd(val); | 101 | { |
51 | *pmdp++ = __pmd(val + LARGE_PAGE_SIZE_4M); | 102 | unsigned int instr = *addr; |
52 | 103 | ||
53 | v += LARGE_PAGE_SIZE_8M; | 104 | instr &= 0xffff0000; |
54 | p += LARGE_PAGE_SIZE_8M; | 105 | instr |= (unsigned long)__va(mapped) >> 16; |
55 | s -= LARGE_PAGE_SIZE_8M; | 106 | patch_instruction(addr, instr); |
56 | } | 107 | } |
57 | #else /* CONFIG_PPC_16K_PAGES */ | ||
58 | while (s >= LARGE_PAGE_SIZE_64M) { | ||
59 | pmd_t *pmdp; | ||
60 | unsigned long val = p | MD_PS8MEG; | ||
61 | 108 | ||
62 | pmdp = pmd_offset(pud_offset(pgd_offset_k(v), v), v); | 109 | unsigned long __init mmu_mapin_ram(unsigned long top) |
63 | *pmdp++ = __pmd(val); | 110 | { |
111 | unsigned long mapped; | ||
64 | 112 | ||
65 | v += LARGE_PAGE_SIZE_64M; | 113 | if (__map_without_ltlbs) { |
66 | p += LARGE_PAGE_SIZE_64M; | 114 | mapped = 0; |
67 | s -= LARGE_PAGE_SIZE_64M; | 115 | mmu_mapin_immr(); |
68 | } | 116 | #ifndef CONFIG_PIN_TLB_IMMR |
117 | patch_instruction(&DTLBMiss_jmp, PPC_INST_NOP); | ||
69 | #endif | 118 | #endif |
119 | } else { | ||
120 | mapped = top & ~(LARGE_PAGE_SIZE_8M - 1); | ||
121 | } | ||
70 | 122 | ||
71 | mapped = top - s; | 123 | mmu_patch_cmp_limit(&DTLBMiss_cmp, mapped); |
124 | mmu_patch_cmp_limit(&FixupDAR_cmp, mapped); | ||
72 | 125 | ||
73 | /* If the size of RAM is not an exact power of two, we may not | 126 | /* If the size of RAM is not an exact power of two, we may not |
74 | * have covered RAM in its entirety with 8 MiB | 127 | * have covered RAM in its entirety with 8 MiB |
@@ -77,7 +130,8 @@ unsigned long __init mmu_mapin_ram(unsigned long top) | |||
77 | * coverage with normal-sized pages (or other reasons) do not | 130 | * coverage with normal-sized pages (or other reasons) do not |
78 | * attempt to allocate outside the allowed range. | 131 | * attempt to allocate outside the allowed range. |
79 | */ | 132 | */ |
80 | memblock_set_current_limit(mapped); | 133 | if (mapped) |
134 | memblock_set_current_limit(mapped); | ||
81 | 135 | ||
82 | return mapped; | 136 | return mapped; |
83 | } | 137 | } |
@@ -90,13 +144,8 @@ void setup_initial_memory_limit(phys_addr_t first_memblock_base, | |||
90 | */ | 144 | */ |
91 | BUG_ON(first_memblock_base != 0); | 145 | BUG_ON(first_memblock_base != 0); |
92 | 146 | ||
93 | #ifdef CONFIG_PIN_TLB | ||
94 | /* 8xx can only access 24MB at the moment */ | 147 | /* 8xx can only access 24MB at the moment */ |
95 | memblock_set_current_limit(min_t(u64, first_memblock_size, 0x01800000)); | 148 | memblock_set_current_limit(min_t(u64, first_memblock_size, 0x01800000)); |
96 | #else | ||
97 | /* 8xx can only access 8MB at the moment */ | ||
98 | memblock_set_current_limit(min_t(u64, first_memblock_size, 0x00800000)); | ||
99 | #endif | ||
100 | } | 149 | } |
101 | 150 | ||
102 | /* | 151 | /* |
diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h index 6af65327c993..f988db655e5b 100644 --- a/arch/powerpc/mm/mmu_decl.h +++ b/arch/powerpc/mm/mmu_decl.h | |||
@@ -154,9 +154,10 @@ struct tlbcam { | |||
154 | }; | 154 | }; |
155 | #endif | 155 | #endif |
156 | 156 | ||
157 | #if defined(CONFIG_6xx) || defined(CONFIG_FSL_BOOKE) | 157 | #if defined(CONFIG_6xx) || defined(CONFIG_FSL_BOOKE) || defined(CONFIG_PPC_8xx) |
158 | /* 6xx have BATS */ | 158 | /* 6xx have BATS */ |
159 | /* FSL_BOOKE have TLBCAM */ | 159 | /* FSL_BOOKE have TLBCAM */ |
160 | /* 8xx have LTLB */ | ||
160 | phys_addr_t v_block_mapped(unsigned long va); | 161 | phys_addr_t v_block_mapped(unsigned long va); |
161 | unsigned long p_block_mapped(phys_addr_t pa); | 162 | unsigned long p_block_mapped(phys_addr_t pa); |
162 | #else | 163 | #else |
diff --git a/arch/powerpc/platforms/86xx/Kconfig b/arch/powerpc/platforms/86xx/Kconfig index 1afd1e4a2dd2..37b166ebc729 100644 --- a/arch/powerpc/platforms/86xx/Kconfig +++ b/arch/powerpc/platforms/86xx/Kconfig | |||
@@ -61,6 +61,11 @@ config GEF_SBC610 | |||
61 | help | 61 | help |
62 | This option enables support for the GE SBC610. | 62 | This option enables support for the GE SBC610. |
63 | 63 | ||
64 | config MVME7100 | ||
65 | bool "Artesyn MVME7100" | ||
66 | help | ||
67 | This option enables support for the Emerson/Artesyn MVME7100 board. | ||
68 | |||
64 | endif | 69 | endif |
65 | 70 | ||
66 | config MPC8641 | 71 | config MPC8641 |
@@ -69,7 +74,8 @@ config MPC8641 | |||
69 | select FSL_PCI if PCI | 74 | select FSL_PCI if PCI |
70 | select PPC_UDBG_16550 | 75 | select PPC_UDBG_16550 |
71 | select MPIC | 76 | select MPIC |
72 | default y if MPC8641_HPCN || SBC8641D || GEF_SBC610 || GEF_SBC310 || GEF_PPC9A | 77 | default y if MPC8641_HPCN || SBC8641D || GEF_SBC610 || GEF_SBC310 || GEF_PPC9A \ |
78 | || MVME7100 | ||
73 | 79 | ||
74 | config MPC8610 | 80 | config MPC8610 |
75 | bool | 81 | bool |
diff --git a/arch/powerpc/platforms/86xx/Makefile b/arch/powerpc/platforms/86xx/Makefile index 2d889ad7dc89..01958fedc3f2 100644 --- a/arch/powerpc/platforms/86xx/Makefile +++ b/arch/powerpc/platforms/86xx/Makefile | |||
@@ -10,3 +10,4 @@ obj-$(CONFIG_MPC8610_HPCD) += mpc8610_hpcd.o | |||
10 | obj-$(CONFIG_GEF_SBC610) += gef_sbc610.o | 10 | obj-$(CONFIG_GEF_SBC610) += gef_sbc610.o |
11 | obj-$(CONFIG_GEF_SBC310) += gef_sbc310.o | 11 | obj-$(CONFIG_GEF_SBC310) += gef_sbc310.o |
12 | obj-$(CONFIG_GEF_PPC9A) += gef_ppc9a.o | 12 | obj-$(CONFIG_GEF_PPC9A) += gef_ppc9a.o |
13 | obj-$(CONFIG_MVME7100) += mvme7100.o | ||
diff --git a/arch/powerpc/platforms/86xx/mvme7100.c b/arch/powerpc/platforms/86xx/mvme7100.c new file mode 100644 index 000000000000..addb41e7cd14 --- /dev/null +++ b/arch/powerpc/platforms/86xx/mvme7100.c | |||
@@ -0,0 +1,121 @@ | |||
1 | /* | ||
2 | * Board setup routines for the Emerson/Artesyn MVME7100 | ||
3 | * | ||
4 | * Copyright 2016 Elettra-Sincrotrone Trieste S.C.p.A. | ||
5 | * | ||
6 | * Author: Alessio Igor Bogani <alessio.bogani@elettra.eu> | ||
7 | * | ||
8 | * Based on earlier code by: | ||
9 | * | ||
10 | * Ajit Prem <ajit.prem@emerson.com> | ||
11 | * Copyright 2008 Emerson | ||
12 | * | ||
13 | * USB host fixup is borrowed by: | ||
14 | * | ||
15 | * Martyn Welch <martyn.welch@ge.com> | ||
16 | * Copyright 2008 GE Intelligent Platforms Embedded Systems, Inc. | ||
17 | * | ||
18 | * This program is free software; you can redistribute it and/or modify it | ||
19 | * under the terms of the GNU General Public License as published by the | ||
20 | * Free Software Foundation; either version 2 of the License, or (at your | ||
21 | * option) any later version. | ||
22 | * | ||
23 | */ | ||
24 | |||
25 | #include <linux/pci.h> | ||
26 | #include <linux/of.h> | ||
27 | #include <linux/of_platform.h> | ||
28 | #include <linux/of_address.h> | ||
29 | #include <asm/udbg.h> | ||
30 | #include <asm/mpic.h> | ||
31 | #include <sysdev/fsl_soc.h> | ||
32 | #include <sysdev/fsl_pci.h> | ||
33 | |||
34 | #include "mpc86xx.h" | ||
35 | |||
36 | #define MVME7100_INTERRUPT_REG_2_OFFSET 0x05 | ||
37 | #define MVME7100_DS1375_MASK 0x40 | ||
38 | #define MVME7100_MAX6649_MASK 0x20 | ||
39 | #define MVME7100_ABORT_MASK 0x10 | ||
40 | |||
41 | /* | ||
42 | * Setup the architecture | ||
43 | */ | ||
44 | static void __init mvme7100_setup_arch(void) | ||
45 | { | ||
46 | struct device_node *bcsr_node; | ||
47 | void __iomem *mvme7100_regs = NULL; | ||
48 | u8 reg; | ||
49 | |||
50 | if (ppc_md.progress) | ||
51 | ppc_md.progress("mvme7100_setup_arch()", 0); | ||
52 | |||
53 | #ifdef CONFIG_SMP | ||
54 | mpc86xx_smp_init(); | ||
55 | #endif | ||
56 | |||
57 | fsl_pci_assign_primary(); | ||
58 | |||
59 | /* Remap BCSR registers */ | ||
60 | bcsr_node = of_find_compatible_node(NULL, NULL, | ||
61 | "artesyn,mvme7100-bcsr"); | ||
62 | if (bcsr_node) { | ||
63 | mvme7100_regs = of_iomap(bcsr_node, 0); | ||
64 | of_node_put(bcsr_node); | ||
65 | } | ||
66 | |||
67 | if (mvme7100_regs) { | ||
68 | /* Disable ds1375, max6649, and abort interrupts */ | ||
69 | reg = readb(mvme7100_regs + MVME7100_INTERRUPT_REG_2_OFFSET); | ||
70 | reg |= MVME7100_DS1375_MASK | MVME7100_MAX6649_MASK | ||
71 | | MVME7100_ABORT_MASK; | ||
72 | writeb(reg, mvme7100_regs + MVME7100_INTERRUPT_REG_2_OFFSET); | ||
73 | } else | ||
74 | pr_warn("Unable to map board registers\n"); | ||
75 | |||
76 | pr_info("MVME7100 board from Artesyn\n"); | ||
77 | } | ||
78 | |||
79 | /* | ||
80 | * Called very early, device-tree isn't unflattened | ||
81 | */ | ||
82 | static int __init mvme7100_probe(void) | ||
83 | { | ||
84 | unsigned long root = of_get_flat_dt_root(); | ||
85 | |||
86 | return of_flat_dt_is_compatible(root, "artesyn,MVME7100"); | ||
87 | } | ||
88 | |||
89 | static void mvme7100_usb_host_fixup(struct pci_dev *pdev) | ||
90 | { | ||
91 | unsigned int val; | ||
92 | |||
93 | if (!machine_is(mvme7100)) | ||
94 | return; | ||
95 | |||
96 | /* Ensure only ports 1 & 2 are enabled */ | ||
97 | pci_read_config_dword(pdev, 0xe0, &val); | ||
98 | pci_write_config_dword(pdev, 0xe0, (val & ~7) | 0x2); | ||
99 | |||
100 | /* System clock is 48-MHz Oscillator and EHCI Enabled. */ | ||
101 | pci_write_config_dword(pdev, 0xe4, 1 << 5); | ||
102 | } | ||
103 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_USB, | ||
104 | mvme7100_usb_host_fixup); | ||
105 | |||
106 | machine_arch_initcall(mvme7100, mpc86xx_common_publish_devices); | ||
107 | |||
108 | define_machine(mvme7100) { | ||
109 | .name = "MVME7100", | ||
110 | .probe = mvme7100_probe, | ||
111 | .setup_arch = mvme7100_setup_arch, | ||
112 | .init_IRQ = mpc86xx_init_irq, | ||
113 | .get_irq = mpic_get_irq, | ||
114 | .restart = fsl_rstcr_restart, | ||
115 | .time_init = mpc86xx_time_init, | ||
116 | .calibrate_decr = generic_calibrate_decr, | ||
117 | .progress = udbg_progress, | ||
118 | #ifdef CONFIG_PCI | ||
119 | .pcibios_fixup_bus = fsl_pcibios_fixup_bus, | ||
120 | #endif | ||
121 | }; | ||
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index 77e9b8d591fb..f32edec13fd1 100644 --- a/arch/powerpc/platforms/Kconfig.cputype +++ b/arch/powerpc/platforms/Kconfig.cputype | |||
@@ -1,7 +1,6 @@ | |||
1 | config PPC64 | 1 | config PPC64 |
2 | bool "64-bit kernel" | 2 | bool "64-bit kernel" |
3 | default n | 3 | default n |
4 | select HAVE_VIRT_CPU_ACCOUNTING | ||
5 | select ZLIB_DEFLATE | 4 | select ZLIB_DEFLATE |
6 | help | 5 | help |
7 | This option selects whether a 32-bit or a 64-bit kernel | 6 | This option selects whether a 32-bit or a 64-bit kernel |
diff --git a/arch/powerpc/sysdev/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c index 0ac12e5fd8ab..911456d17713 100644 --- a/arch/powerpc/sysdev/cpm_common.c +++ b/arch/powerpc/sysdev/cpm_common.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <asm/udbg.h> | 28 | #include <asm/udbg.h> |
29 | #include <asm/io.h> | 29 | #include <asm/io.h> |
30 | #include <asm/cpm.h> | 30 | #include <asm/cpm.h> |
31 | #include <asm/fixmap.h> | ||
31 | #include <soc/fsl/qe/qe.h> | 32 | #include <soc/fsl/qe/qe.h> |
32 | 33 | ||
33 | #include <mm/mmu_decl.h> | 34 | #include <mm/mmu_decl.h> |
@@ -37,25 +38,36 @@ | |||
37 | #endif | 38 | #endif |
38 | 39 | ||
39 | #ifdef CONFIG_PPC_EARLY_DEBUG_CPM | 40 | #ifdef CONFIG_PPC_EARLY_DEBUG_CPM |
40 | static u32 __iomem *cpm_udbg_txdesc = | 41 | static u32 __iomem *cpm_udbg_txdesc; |
41 | (u32 __iomem __force *)CONFIG_PPC_EARLY_DEBUG_CPM_ADDR; | 42 | static u8 __iomem *cpm_udbg_txbuf; |
42 | 43 | ||
43 | static void udbg_putc_cpm(char c) | 44 | static void udbg_putc_cpm(char c) |
44 | { | 45 | { |
45 | u8 __iomem *txbuf = (u8 __iomem __force *)in_be32(&cpm_udbg_txdesc[1]); | ||
46 | |||
47 | if (c == '\n') | 46 | if (c == '\n') |
48 | udbg_putc_cpm('\r'); | 47 | udbg_putc_cpm('\r'); |
49 | 48 | ||
50 | while (in_be32(&cpm_udbg_txdesc[0]) & 0x80000000) | 49 | while (in_be32(&cpm_udbg_txdesc[0]) & 0x80000000) |
51 | ; | 50 | ; |
52 | 51 | ||
53 | out_8(txbuf, c); | 52 | out_8(cpm_udbg_txbuf, c); |
54 | out_be32(&cpm_udbg_txdesc[0], 0xa0000001); | 53 | out_be32(&cpm_udbg_txdesc[0], 0xa0000001); |
55 | } | 54 | } |
56 | 55 | ||
57 | void __init udbg_init_cpm(void) | 56 | void __init udbg_init_cpm(void) |
58 | { | 57 | { |
58 | #ifdef CONFIG_PPC_8xx | ||
59 | cpm_udbg_txdesc = (u32 __iomem __force *) | ||
60 | (CONFIG_PPC_EARLY_DEBUG_CPM_ADDR - PHYS_IMMR_BASE + | ||
61 | VIRT_IMMR_BASE); | ||
62 | cpm_udbg_txbuf = (u8 __iomem __force *) | ||
63 | (in_be32(&cpm_udbg_txdesc[1]) - PHYS_IMMR_BASE + | ||
64 | VIRT_IMMR_BASE); | ||
65 | #else | ||
66 | cpm_udbg_txdesc = (u32 __iomem __force *) | ||
67 | CONFIG_PPC_EARLY_DEBUG_CPM_ADDR; | ||
68 | cpm_udbg_txbuf = (u8 __iomem __force *)in_be32(&cpm_udbg_txdesc[1]); | ||
69 | #endif | ||
70 | |||
59 | if (cpm_udbg_txdesc) { | 71 | if (cpm_udbg_txdesc) { |
60 | #ifdef CONFIG_CPM2 | 72 | #ifdef CONFIG_CPM2 |
61 | setbat(1, 0xf0000000, 0xf0000000, 1024*1024, PAGE_KERNEL_NCG); | 73 | setbat(1, 0xf0000000, 0xf0000000, 1024*1024, PAGE_KERNEL_NCG); |
diff --git a/arch/powerpc/sysdev/fsl_85xx_l2ctlr.c b/arch/powerpc/sysdev/fsl_85xx_l2ctlr.c index 861cebf9c292..c27058e5df26 100644 --- a/arch/powerpc/sysdev/fsl_85xx_l2ctlr.c +++ b/arch/powerpc/sysdev/fsl_85xx_l2ctlr.c | |||
@@ -90,12 +90,8 @@ static int mpc85xx_l2ctlr_of_probe(struct platform_device *dev) | |||
90 | } | 90 | } |
91 | l2cache_size = *prop; | 91 | l2cache_size = *prop; |
92 | 92 | ||
93 | if (get_cache_sram_params(&sram_params)) { | 93 | if (get_cache_sram_params(&sram_params)) |
94 | dev_err(&dev->dev, | 94 | return 0; /* fall back to L2 cache only */ |
95 | "Entire L2 as cache, provide valid sram offset and size\n"); | ||
96 | return -EINVAL; | ||
97 | } | ||
98 | |||
99 | 95 | ||
100 | rem = l2cache_size % sram_params.sram_size; | 96 | rem = l2cache_size % sram_params.sram_size; |
101 | ways = LOCK_WAYS_FULL * sram_params.sram_size / l2cache_size; | 97 | ways = LOCK_WAYS_FULL * sram_params.sram_size / l2cache_size; |
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 255523360405..760545519a0b 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c | |||
@@ -2284,13 +2284,13 @@ static void dump_one_paca(int cpu) | |||
2284 | DUMP(p, subcore_sibling_mask, "x"); | 2284 | DUMP(p, subcore_sibling_mask, "x"); |
2285 | #endif | 2285 | #endif |
2286 | 2286 | ||
2287 | DUMP(p, user_time, "llx"); | 2287 | DUMP(p, accounting.user_time, "llx"); |
2288 | DUMP(p, system_time, "llx"); | 2288 | DUMP(p, accounting.system_time, "llx"); |
2289 | DUMP(p, user_time_scaled, "llx"); | 2289 | DUMP(p, accounting.user_time_scaled, "llx"); |
2290 | DUMP(p, starttime, "llx"); | 2290 | DUMP(p, accounting.starttime, "llx"); |
2291 | DUMP(p, starttime_user, "llx"); | 2291 | DUMP(p, accounting.starttime_user, "llx"); |
2292 | DUMP(p, startspurr, "llx"); | 2292 | DUMP(p, accounting.startspurr, "llx"); |
2293 | DUMP(p, utime_sspurr, "llx"); | 2293 | DUMP(p, accounting.utime_sspurr, "llx"); |
2294 | DUMP(p, stolen_time, "llx"); | 2294 | DUMP(p, stolen_time, "llx"); |
2295 | #undef DUMP | 2295 | #undef DUMP |
2296 | 2296 | ||