Skip to content

Commit 5a7d8a2

Browse files
committed
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle: "This has been sitting in -next for a while with no objections and all MIPS defconfigs except one are building fine; that one platform got broken by another patch in your tree and I'm going to submit a patch separately. - a handful of fixes that didn't make 3.11 - a few bits of Octeon 3 support with more to come for a later release - platform enhancements for Octeon, ath79, Lantiq, Netlogic and Ralink SOCs - a GPIO driver for the Octeon - some dusting off of the DECstation code - the usual dose of cleanups" * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (65 commits) MIPS: DMA: Fix BUG due to smp_processor_id() in preemptible code MIPS: kexec: Fix random crashes while loading crashkernel MIPS: kdump: Skip walking indirection page for crashkernels MIPS: DECstation HRT calibration bug fixes MIPS: Export copy_from_user_page() (needed by lustre) MIPS: Add driver for the built-in PCI controller of the RT3883 SoC MIPS: DMA: For BMIPS5000 cores flush region just like non-coherent R10000 MIPS: ralink: Add support for reset-controller API MIPS: ralink: mt7620: Add cpu-feature-override header MIPS: ralink: mt7620: Add spi clock definition MIPS: ralink: mt7620: Add wdt clock definition MIPS: ralink: mt7620: Improve clock frequency detection MIPS: ralink: mt7620: This SoC has EHCI and OHCI hosts MIPS: ralink: mt7620: Add verbose ram info MIPS: ralink: Probe clocksources from OF MIPS: ralink: Add support for systick timer found on newer ralink SoC MIPS: ralink: Add support for periodic timer irq MIPS: Netlogic: Built-in DTB for XLP2xx SoC boards MIPS: Netlogic: Add support for USB on XLP2xx MIPS: Netlogic: XLP2xx update for I2C controller ...
2 parents e0ea404 + eb37e6d commit 5a7d8a2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+3109
-484
lines changed
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
* Mediatek/Ralink RT3883 PCI controller
2+
3+
1) Main node
4+
5+
Required properties:
6+
7+
- compatible: must be "ralink,rt3883-pci"
8+
9+
- reg: specifies the physical base address of the controller and
10+
the length of the memory mapped region.
11+
12+
- #address-cells: specifies the number of cells needed to encode an
13+
address. The value must be 1.
14+
15+
- #size-cells: specifies the number of cells used to represent the size
16+
of an address. The value must be 1.
17+
18+
- ranges: specifies the translation between child address space and parent
19+
address space
20+
21+
Optional properties:
22+
23+
- status: indicates the operational status of the device.
24+
Value must be either "disabled" or "okay".
25+
26+
2) Child nodes
27+
28+
The main node must have two child nodes which describes the built-in
29+
interrupt controller and the PCI host bridge.
30+
31+
a) Interrupt controller:
32+
33+
Required properties:
34+
35+
- interrupt-controller: identifies the node as an interrupt controller
36+
37+
- #address-cells: specifies the number of cells needed to encode an
38+
address. The value must be 0. As such, 'interrupt-map' nodes do not
39+
have to specify a parent unit address.
40+
41+
- #interrupt-cells: specifies the number of cells needed to encode an
42+
interrupt source. The value must be 1.
43+
44+
- interrupt-parent: the phandle for the interrupt controller that
45+
services interrupts for this device.
46+
47+
- interrupts: specifies the interrupt source of the parent interrupt
48+
controller. The format of the interrupt specifier depends on the
49+
parent interrupt controller.
50+
51+
b) PCI host bridge:
52+
53+
Required properties:
54+
55+
- #address-cells: specifies the number of cells needed to encode an
56+
address. The value must be 0.
57+
58+
- #size-cells: specifies the number of cells used to represent the size
59+
of an address. The value must be 2.
60+
61+
- #interrupt-cells: specifies the number of cells needed to encode an
62+
interrupt source. The value must be 1.
63+
64+
- device_type: must be "pci"
65+
66+
- bus-range: PCI bus numbers covered
67+
68+
- ranges: specifies the ranges for the PCI memory and I/O regions
69+
70+
- interrupt-map-mask,
71+
- interrupt-map: standard PCI properties to define the mapping of the
72+
PCI interface to interrupt numbers.
73+
74+
The PCI host bridge node migh have additional sub-nodes representing
75+
the onboard PCI devices/PCI slots. Each such sub-node must have the
76+
following mandatory properties:
77+
78+
- reg: used only for interrupt mapping, so only the first four bytes
79+
are used to refer to the correct bus number and device number.
80+
81+
- device_type: must be "pci"
82+
83+
If a given sub-node represents a PCI bridge it must have following
84+
mandatory properties as well:
85+
86+
- #address-cells: must be set to <3>
87+
88+
- #size-cells: must set to <2>
89+
90+
- #interrupt-cells: must be set to <1>
91+
92+
- interrupt-map-mask,
93+
- interrupt-map: standard PCI properties to define the mapping of the
94+
PCI interface to interrupt numbers.
95+
96+
Besides the required properties the sub-nodes may have these optional
97+
properties:
98+
99+
- status: indicates the operational status of the sub-node.
100+
Value must be either "disabled" or "okay".
101+
102+
3) Example:
103+
104+
a) SoC specific dtsi file:
105+
106+
pci@10140000 {
107+
compatible = "ralink,rt3883-pci";
108+
reg = <0x10140000 0x20000>;
109+
#address-cells = <1>;
110+
#size-cells = <1>;
111+
ranges; /* direct mapping */
112+
113+
status = "disabled";
114+
115+
pciintc: interrupt-controller {
116+
interrupt-controller;
117+
#address-cells = <0>;
118+
#interrupt-cells = <1>;
119+
120+
interrupt-parent = <&cpuintc>;
121+
interrupts = <4>;
122+
};
123+
124+
host-bridge {
125+
#address-cells = <3>;
126+
#size-cells = <2>;
127+
#interrupt-cells = <1>;
128+
129+
device_type = "pci";
130+
131+
bus-range = <0 255>;
132+
ranges = <
133+
0x02000000 0 0x00000000 0x20000000 0 0x10000000 /* pci memory */
134+
0x01000000 0 0x00000000 0x10160000 0 0x00010000 /* io space */
135+
>;
136+
137+
interrupt-map-mask = <0xf800 0 0 7>;
138+
interrupt-map = <
139+
/* IDSEL 17 */
140+
0x8800 0 0 1 &pciintc 18
141+
0x8800 0 0 2 &pciintc 18
142+
0x8800 0 0 3 &pciintc 18
143+
0x8800 0 0 4 &pciintc 18
144+
/* IDSEL 18 */
145+
0x9000 0 0 1 &pciintc 19
146+
0x9000 0 0 2 &pciintc 19
147+
0x9000 0 0 3 &pciintc 19
148+
0x9000 0 0 4 &pciintc 19
149+
>;
150+
151+
pci-bridge@1 {
152+
reg = <0x0800 0 0 0 0>;
153+
device_type = "pci";
154+
#interrupt-cells = <1>;
155+
#address-cells = <3>;
156+
#size-cells = <2>;
157+
158+
interrupt-map-mask = <0x0 0 0 0>;
159+
interrupt-map = <0x0 0 0 0 &pciintc 20>;
160+
161+
status = "disabled";
162+
};
163+
164+
pci-slot@17 {
165+
reg = <0x8800 0 0 0 0>;
166+
device_type = "pci";
167+
168+
status = "disabled";
169+
};
170+
171+
pci-slot@18 {
172+
reg = <0x9000 0 0 0 0>;
173+
device_type = "pci";
174+
175+
status = "disabled";
176+
};
177+
};
178+
};
179+
180+
b) Board specific dts file:
181+
182+
pci@10140000 {
183+
status = "okay";
184+
185+
host-bridge {
186+
pci-bridge@1 {
187+
status = "okay";
188+
};
189+
};
190+
};

arch/mips/Kconfig

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ config ATH79
9595
select CSRC_R4K
9696
select DMA_NONCOHERENT
9797
select HAVE_CLK
98+
select CLKDEV_LOOKUP
9899
select IRQ_CPU
99100
select MIPS_MACHINE
100101
select SYS_HAS_CPU_MIPS32_R2
@@ -131,7 +132,6 @@ config BCM63XX
131132
select IRQ_CPU
132133
select SYS_HAS_CPU_MIPS32_R1
133134
select SYS_HAS_CPU_BMIPS4350 if !BCM63XX_CPU_6338 && !BCM63XX_CPU_6345 && !BCM63XX_CPU_6348
134-
select NR_CPUS_DEFAULT_2
135135
select SYS_SUPPORTS_32BIT_KERNEL
136136
select SYS_SUPPORTS_BIG_ENDIAN
137137
select SYS_HAS_EARLY_PRINTK
@@ -445,6 +445,8 @@ config RALINK
445445
select SYS_HAS_EARLY_PRINTK
446446
select HAVE_MACH_CLKDEV
447447
select CLKDEV_LOOKUP
448+
select ARCH_HAS_RESET_CONTROLLER
449+
select RESET_CONTROLLER
448450

449451
config SGI_IP22
450452
bool "SGI IP22 (Indy/Indigo2)"
@@ -609,7 +611,6 @@ config SIBYTE_SWARM
609611
select BOOT_ELF32
610612
select DMA_COHERENT
611613
select HAVE_PATA_PLATFORM
612-
select NR_CPUS_DEFAULT_2
613614
select SIBYTE_SB1250
614615
select SWAP_IO_SPACE
615616
select SYS_HAS_CPU_SB1
@@ -623,7 +624,6 @@ config SIBYTE_LITTLESUR
623624
select BOOT_ELF32
624625
select DMA_COHERENT
625626
select HAVE_PATA_PLATFORM
626-
select NR_CPUS_DEFAULT_2
627627
select SIBYTE_SB1250
628628
select SWAP_IO_SPACE
629629
select SYS_HAS_CPU_SB1
@@ -635,7 +635,6 @@ config SIBYTE_SENTOSA
635635
bool "Sibyte BCM91250E-Sentosa"
636636
select BOOT_ELF32
637637
select DMA_COHERENT
638-
select NR_CPUS_DEFAULT_2
639638
select SIBYTE_SB1250
640639
select SWAP_IO_SPACE
641640
select SYS_HAS_CPU_SB1
@@ -731,6 +730,7 @@ config CAVIUM_OCTEON_SOC
731730
select USB_ARCH_HAS_OHCI
732731
select USB_ARCH_HAS_EHCI
733732
select HOLES_IN_ZONE
733+
select ARCH_REQUIRE_GPIOLIB
734734
help
735735
This option supports all of the Octeon reference boards from Cavium
736736
Networks. It builds a kernel that dynamically determines the Octeon
@@ -1860,7 +1860,6 @@ config MIPS_MT_SMP
18601860
select CPU_MIPSR2_IRQ_VI
18611861
select CPU_MIPSR2_IRQ_EI
18621862
select MIPS_MT
1863-
select NR_CPUS_DEFAULT_2
18641863
select SMP
18651864
select SYS_SUPPORTS_SCHED_SMT if SMP
18661865
select SYS_SUPPORTS_SMP
@@ -2171,12 +2170,6 @@ config SYS_SUPPORTS_MIPS_CMP
21712170
config SYS_SUPPORTS_SMP
21722171
bool
21732172

2174-
config NR_CPUS_DEFAULT_1
2175-
bool
2176-
2177-
config NR_CPUS_DEFAULT_2
2178-
bool
2179-
21802173
config NR_CPUS_DEFAULT_4
21812174
bool
21822175

@@ -2194,10 +2187,8 @@ config NR_CPUS_DEFAULT_64
21942187

21952188
config NR_CPUS
21962189
int "Maximum number of CPUs (2-64)"
2197-
range 1 64 if NR_CPUS_DEFAULT_1
2190+
range 2 64
21982191
depends on SMP
2199-
default "1" if NR_CPUS_DEFAULT_1
2200-
default "2" if NR_CPUS_DEFAULT_2
22012192
default "4" if NR_CPUS_DEFAULT_4
22022193
default "8" if NR_CPUS_DEFAULT_8
22032194
default "16" if NR_CPUS_DEFAULT_16

arch/mips/Makefile

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ include $(srctree)/arch/mips/Kbuild.platforms
194194
ifdef CONFIG_PHYSICAL_START
195195
load-y = $(CONFIG_PHYSICAL_START)
196196
endif
197+
entry-y = 0x$(shell $(NM) vmlinux 2>/dev/null \
198+
| grep "\bkernel_entry\b" | cut -f1 -d \ )
197199

198200
cflags-y += -I$(srctree)/arch/mips/include/asm/mach-generic
199201
drivers-$(CONFIG_PCI) += arch/mips/pci/
@@ -225,6 +227,9 @@ KBUILD_CFLAGS += $(cflags-y)
225227
KBUILD_CPPFLAGS += -DVMLINUX_LOAD_ADDRESS=$(load-y)
226228
KBUILD_CPPFLAGS += -DDATAOFFSET=$(if $(dataoffset-y),$(dataoffset-y),0)
227229

230+
bootvars-y = VMLINUX_LOAD_ADDRESS=$(load-y) \
231+
VMLINUX_ENTRY_ADDRESS=$(entry-y)
232+
228233
LDFLAGS += -m $(ld-emul)
229234

230235
ifdef CONFIG_CC_STACKPROTECTOR
@@ -254,9 +259,25 @@ drivers-$(CONFIG_OPROFILE) += arch/mips/oprofile/
254259
# suspend and hibernation support
255260
drivers-$(CONFIG_PM) += arch/mips/power/
256261

262+
# boot image targets (arch/mips/boot/)
263+
boot-y := vmlinux.bin
264+
boot-y += vmlinux.ecoff
265+
boot-y += vmlinux.srec
266+
ifeq ($(shell expr $(load-y) \< 0xffffffff80000000 2> /dev/null), 0)
267+
boot-y += uImage
268+
boot-y += uImage.gz
269+
endif
270+
271+
# compressed boot image targets (arch/mips/boot/compressed/)
272+
bootz-y := vmlinuz
273+
bootz-y += vmlinuz.bin
274+
bootz-y += vmlinuz.ecoff
275+
bootz-y += vmlinuz.srec
276+
257277
ifdef CONFIG_LASAT
258278
rom.bin rom.sw: vmlinux
259-
$(Q)$(MAKE) $(build)=arch/mips/lasat/image $@
279+
$(Q)$(MAKE) $(build)=arch/mips/lasat/image \
280+
$(bootvars-y) $@
260281
endif
261282

262283
#
@@ -280,13 +301,14 @@ vmlinux.64: vmlinux
280301
all: $(all-y)
281302

282303
# boot
283-
vmlinux.bin vmlinux.ecoff vmlinux.srec: $(vmlinux-32) FORCE
284-
$(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) arch/mips/boot/$@
304+
$(boot-y): $(vmlinux-32) FORCE
305+
$(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) \
306+
$(bootvars-y) arch/mips/boot/$@
285307

286308
# boot/compressed
287-
vmlinuz vmlinuz.bin vmlinuz.ecoff vmlinuz.srec: $(vmlinux-32) FORCE
309+
$(bootz-y): $(vmlinux-32) FORCE
288310
$(Q)$(MAKE) $(build)=arch/mips/boot/compressed \
289-
VMLINUX_LOAD_ADDRESS=$(load-y) 32bit-bfd=$(32bit-bfd) $@
311+
$(bootvars-y) 32bit-bfd=$(32bit-bfd) $@
290312

291313

292314
CLEAN_FILES += vmlinux.32 vmlinux.64
@@ -323,6 +345,8 @@ define archhelp
323345
echo ' vmlinuz.ecoff - ECOFF zboot image'
324346
echo ' vmlinuz.bin - Raw binary zboot image'
325347
echo ' vmlinuz.srec - SREC zboot image'
348+
echo ' uImage - U-Boot image'
349+
echo ' uImage.gz - U-Boot image (gzip)'
326350
echo
327351
echo ' These will be default as appropriate for a configured platform.'
328352
endef

0 commit comments

Comments
 (0)