Skip to content

Commit b84da9f

Browse files
committed
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle: "These are the highlists of the main MIPS pull request for 4.4: - Add latencytop support - Support appended DTBs - VDSO support and initially use it for gettimeofday. - Drop the .MIPS.abiflags and ELF NOTE sections from vmlinux - Support for the 5KE, an internal test core. - Switch all MIPS platfroms to libata drivers. - Improved support, cleanups for ralink and Lantiq platforms. - Support for the new xilfpga platform. - A number of DTB improvments for BMIPS. - Improved support for CM and CPS. - Minor JZ4740 and BCM47xx enhancements" * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (120 commits) MIPS: idle: add case for CPU_5KE MIPS: Octeon: Support APPENDED_DTB MIPS: vmlinux: create a section for appended DTB MIPS: Clean up compat_siginfo_t MIPS: Fix PAGE_MASK definition MIPS: BMIPS: Enable GZIP ramdisk and timed printks MIPS: Add xilfpga defconfig MIPS: xilfpga: Add mipsfpga platform code MIPS: xilfpga: Add xilfpga device tree files. dt-bindings: MIPS: Document xilfpga bindings and boot style MIPS: Make MIPS_CMDLINE_DTB default MIPS: Make the kernel arguments from dtb available MIPS: Use USE_OF as the guard for appended dtb MIPS: BCM63XX: Use pr_* instead of printk MIPS: Loongson: Cleanup CONFIG_LOONGSON_SUSPEND. MIPS: lantiq: Disable xbar fpi burst mode MIPS: lantiq: Force the crossbar to big endian MIPS: lantiq: Initialize the USB core on boot MIPS: lantiq: Return correct value for fpi clock on ar9 MIPS: ralink: Add missing clock on rt305x ...
2 parents 12b76f3 + da34232 commit b84da9f

File tree

151 files changed

+4590
-749
lines changed

Some content is hidden

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

151 files changed

+4590
-749
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
Imagination University Program MIPSfpga
2+
=======================================
3+
4+
Under the Imagination University Program, a microAptiv UP core has been
5+
released for academic usage.
6+
7+
As we are dealing with a MIPS core instantiated on an FPGA, specifications
8+
are fluid and can be varied in RTL.
9+
10+
This binding document is provided as baseline guidance for the example
11+
project provided by IMG.
12+
13+
The example project runs on the Nexys4DDR board by Digilent powered by
14+
the ARTIX-7 FPGA by Xilinx.
15+
16+
Relevant details about the example project and the Nexys4DDR board:
17+
18+
- microAptiv UP core m14Kc
19+
- 50MHz clock speed
20+
- 128Mbyte DDR RAM at 0x0000_0000
21+
- 8Kbyte RAM at 0x1000_0000
22+
- axi_intc at 0x1020_0000
23+
- axi_uart16550 at 0x1040_0000
24+
- axi_gpio at 0x1060_0000
25+
- axi_i2c at 0x10A0_0000
26+
- custom_gpio at 0x10C0_0000
27+
- axi_ethernetlite at 0x10E0_0000
28+
- 8Kbyte BootRAM at 0x1FC0_0000
29+
30+
Required properties:
31+
--------------------
32+
- compatible: Must include "digilent,nexys4ddr","img,xilfpga".
33+
34+
CPU nodes:
35+
----------
36+
A "cpus" node is required. Required properties:
37+
- #address-cells: Must be 1.
38+
- #size-cells: Must be 0.
39+
A CPU sub-node is also required for at least CPU 0. Required properties:
40+
- device_type: Must be "cpu".
41+
- compatible: Must be "mips,m14Kc".
42+
- reg: Must be <0>.
43+
- clocks: phandle to ext clock for fixed-clock received by MIPS core.
44+
45+
Example:
46+
47+
compatible = "img,xilfpga","digilent,nexys4ddr";
48+
cpus {
49+
#address-cells = <1>;
50+
#size-cells = <0>;
51+
52+
cpu0: cpu@0 {
53+
device_type = "cpu";
54+
compatible = "mips,m14Kc";
55+
reg = <0>;
56+
clocks = <&ext>;
57+
};
58+
};
59+
60+
ext: ext {
61+
compatible = "fixed-clock";
62+
#clock-cells = <0>;
63+
clock-frequency = <50000000>;
64+
};
65+
66+
Boot protocol:
67+
--------------
68+
69+
The BootRAM is a writeable "RAM" in FPGA at 0x1FC0_0000.
70+
This is for easy reprogrammibility via JTAG.
71+
72+
The BootRAM initializes the cache and the axi_uart peripheral.
73+
74+
DDR initialization is already handled by a HW IP block.
75+
76+
When the example project bitstream is loaded, the cpu_reset button
77+
needs to be pressed.
78+
79+
The bootram initializes the cache and axi_uart.
80+
Then outputs MIPSFPGA\n\r on the serial port on the Nexys4DDR board.
81+
82+
At this point, the board is ready to load the Linux kernel
83+
vmlinux file via JTAG.

arch/mips/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ obj- := $(platform-)
1717
obj-y += kernel/
1818
obj-y += mm/
1919
obj-y += net/
20+
obj-y += vdso/
2021

2122
ifdef CONFIG_KVM
2223
obj-y += kvm/

arch/mips/Kbuild.platforms

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ platforms += sibyte
3333
platforms += sni
3434
platforms += txx9
3535
platforms += vr41xx
36+
platforms += xilfpga
3637

3738
# include the platform specific files
3839
include $(patsubst %, $(srctree)/arch/mips/%/Platform, $(platforms))

arch/mips/Kconfig

Lines changed: 84 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ config MIPS
55
select ARCH_MIGHT_HAVE_PC_PARPORT
66
select ARCH_MIGHT_HAVE_PC_SERIO
77
select ARCH_USE_CMPXCHG_LOCKREF if 64BIT
8+
select ARCH_USE_BUILTIN_BSWAP
89
select HAVE_CONTEXT_TRACKING
910
select HAVE_GENERIC_DMA_COHERENT
1011
select HAVE_IDE
@@ -60,6 +61,8 @@ config MIPS
6061
select SYSCTL_EXCEPTION_TRACE
6162
select HAVE_VIRT_CPU_ACCOUNTING_GEN
6263
select HAVE_IRQ_TIME_ACCOUNTING
64+
select GENERIC_TIME_VSYSCALL
65+
select ARCH_CLOCKSOURCE_DATA
6366

6467
menu "Machine selection"
6568

@@ -401,6 +404,28 @@ config MACH_PISTACHIO
401404
help
402405
This enables support for the IMG Pistachio SoC platform.
403406

407+
config MACH_XILFPGA
408+
bool "MIPSfpga Xilinx based boards"
409+
select ARCH_REQUIRE_GPIOLIB
410+
select BOOT_ELF32
411+
select BOOT_RAW
412+
select BUILTIN_DTB
413+
select CEVT_R4K
414+
select COMMON_CLK
415+
select CSRC_R4K
416+
select IRQ_MIPS_CPU
417+
select LIBFDT
418+
select MIPS_CPU_SCACHE
419+
select SYS_HAS_EARLY_PRINTK
420+
select SYS_HAS_CPU_MIPS32_R2
421+
select SYS_SUPPORTS_32BIT_KERNEL
422+
select SYS_SUPPORTS_LITTLE_ENDIAN
423+
select SYS_SUPPORTS_ZBOOT_UART16550
424+
select USE_OF
425+
select USE_GENERIC_EARLY_PRINTK_8250
426+
help
427+
This enables support for the IMG University Program MIPSfpga platform.
428+
404429
config MIPS_MALTA
405430
bool "MIPS Malta board"
406431
select ARCH_MAY_HAVE_PC_FDC
@@ -424,6 +449,7 @@ config MIPS_MALTA
424449
select MIPS_L1_CACHE_SHIFT_6
425450
select PCI_GT64XXX_PCI0
426451
select MIPS_MSC
452+
select SMP_UP if SMP
427453
select SWAP_IO_SPACE
428454
select SYS_HAS_CPU_MIPS32_R1
429455
select SYS_HAS_CPU_MIPS32_R2
@@ -449,6 +475,8 @@ config MIPS_MALTA
449475
select SYS_SUPPORTS_ZBOOT
450476
select USE_OF
451477
select ZONE_DMA32 if 64BIT
478+
select BUILTIN_DTB
479+
select LIBFDT
452480
help
453481
This enables support for the MIPS Technologies Malta evaluation
454482
board.
@@ -964,6 +992,7 @@ source "arch/mips/loongson32/Kconfig"
964992
source "arch/mips/loongson64/Kconfig"
965993
source "arch/mips/netlogic/Kconfig"
966994
source "arch/mips/paravirt/Kconfig"
995+
source "arch/mips/xilfpga/Kconfig"
967996

968997
endmenu
969998

@@ -1036,6 +1065,9 @@ config CSRC_R4K
10361065
config CSRC_SB1250
10371066
bool
10381067

1068+
config MIPS_CLOCK_VSYSCALL
1069+
def_bool CSRC_R4K || CLKSRC_MIPS_GIC
1070+
10391071
config GPIO_TXX9
10401072
select ARCH_REQUIRE_GPIOLIB
10411073
bool
@@ -2529,6 +2561,9 @@ choice
25292561
help
25302562
Allows the configuration of the timer frequency.
25312563

2564+
config HZ_24
2565+
bool "24 HZ" if SYS_SUPPORTS_24HZ || SYS_SUPPORTS_ARBIT_HZ
2566+
25322567
config HZ_48
25332568
bool "48 HZ" if SYS_SUPPORTS_48HZ || SYS_SUPPORTS_ARBIT_HZ
25342569

@@ -2552,6 +2587,9 @@ choice
25522587

25532588
endchoice
25542589

2590+
config SYS_SUPPORTS_24HZ
2591+
bool
2592+
25552593
config SYS_SUPPORTS_48HZ
25562594
bool
25572595

@@ -2575,13 +2613,18 @@ config SYS_SUPPORTS_1024HZ
25752613

25762614
config SYS_SUPPORTS_ARBIT_HZ
25772615
bool
2578-
default y if !SYS_SUPPORTS_48HZ && !SYS_SUPPORTS_100HZ && \
2579-
!SYS_SUPPORTS_128HZ && !SYS_SUPPORTS_250HZ && \
2580-
!SYS_SUPPORTS_256HZ && !SYS_SUPPORTS_1000HZ && \
2616+
default y if !SYS_SUPPORTS_24HZ && \
2617+
!SYS_SUPPORTS_48HZ && \
2618+
!SYS_SUPPORTS_100HZ && \
2619+
!SYS_SUPPORTS_128HZ && \
2620+
!SYS_SUPPORTS_250HZ && \
2621+
!SYS_SUPPORTS_256HZ && \
2622+
!SYS_SUPPORTS_1000HZ && \
25812623
!SYS_SUPPORTS_1024HZ
25822624

25832625
config HZ
25842626
int
2627+
default 24 if HZ_24
25852628
default 48 if HZ_48
25862629
default 100 if HZ_100
25872630
default 128 if HZ_128
@@ -2685,14 +2728,28 @@ config BUILTIN_DTB
26852728
bool
26862729

26872730
choice
2688-
prompt "Kernel appended dtb support" if OF
2731+
prompt "Kernel appended dtb support" if USE_OF
26892732
default MIPS_NO_APPENDED_DTB
26902733

26912734
config MIPS_NO_APPENDED_DTB
26922735
bool "None"
26932736
help
26942737
Do not enable appended dtb support.
26952738

2739+
config MIPS_ELF_APPENDED_DTB
2740+
bool "vmlinux"
2741+
help
2742+
With this option, the boot code will look for a device tree binary
2743+
DTB) included in the vmlinux ELF section .appended_dtb. By default
2744+
it is empty and the DTB can be appended using binutils command
2745+
objcopy:
2746+
2747+
objcopy --update-section .appended_dtb=<filename>.dtb vmlinux
2748+
2749+
This is meant as a backward compatiblity convenience for those
2750+
systems with a bootloader that can't be upgraded to accommodate
2751+
the documented boot protocol using a device tree.
2752+
26962753
config MIPS_RAW_APPENDED_DTB
26972754
bool "vmlinux.bin"
26982755
help
@@ -2729,6 +2786,25 @@ choice
27292786
if you don't intend to always append a DTB.
27302787
endchoice
27312788

2789+
choice
2790+
prompt "Kernel command line type" if !CMDLINE_OVERRIDE
2791+
default MIPS_CMDLINE_FROM_DTB if USE_OF && !ATH79 && !MACH_INGENIC && \
2792+
!MIPS_MALTA && !MIPS_SEAD3 && \
2793+
!CAVIUM_OCTEON_SOC
2794+
default MIPS_CMDLINE_FROM_BOOTLOADER
2795+
2796+
config MIPS_CMDLINE_FROM_DTB
2797+
depends on USE_OF
2798+
bool "Dtb kernel arguments if available"
2799+
2800+
config MIPS_CMDLINE_DTB_EXTEND
2801+
depends on USE_OF
2802+
bool "Extend dtb kernel arguments with bootloader arguments"
2803+
2804+
config MIPS_CMDLINE_FROM_BOOTLOADER
2805+
bool "Bootloader kernel arguments if available"
2806+
endchoice
2807+
27322808
endmenu
27332809

27342810
config LOCKDEP_SUPPORT
@@ -2739,6 +2815,10 @@ config STACKTRACE_SUPPORT
27392815
bool
27402816
default y
27412817

2818+
config HAVE_LATENCYTOP_SUPPORT
2819+
bool
2820+
default y
2821+
27422822
config PGTABLE_LEVELS
27432823
int
27442824
default 3 if 64BIT && !PAGE_SIZE_64KB

arch/mips/Kconfig.debug

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,76 @@ config SPINLOCK_TEST
113113
help
114114
Add several files to the debugfs to test spinlock speed.
115115

116+
if CPU_MIPSR6
117+
118+
choice
119+
prompt "Compact branch policy"
120+
default MIPS_COMPACT_BRANCHES_OPTIMAL
121+
122+
config MIPS_COMPACT_BRANCHES_NEVER
123+
bool "Never (force delay slot branches)"
124+
help
125+
Pass the -mcompact-branches=never flag to the compiler in order to
126+
force it to always emit branches with delay slots, and make no use
127+
of the compact branch instructions introduced by MIPSr6. This is
128+
useful if you suspect there may be an issue with compact branches in
129+
either the compiler or the CPU.
130+
131+
config MIPS_COMPACT_BRANCHES_OPTIMAL
132+
bool "Optimal (use where beneficial)"
133+
help
134+
Pass the -mcompact-branches=optimal flag to the compiler in order for
135+
it to make use of compact branch instructions where it deems them
136+
beneficial, and use branches with delay slots elsewhere. This is the
137+
default compiler behaviour, and should be used unless you have a
138+
reason to choose otherwise.
139+
140+
config MIPS_COMPACT_BRANCHES_ALWAYS
141+
bool "Always (force compact branches)"
142+
help
143+
Pass the -mcompact-branches=always flag to the compiler in order to
144+
force it to always emit compact branches, making no use of branch
145+
instructions with delay slots. This can result in more compact code
146+
which may be beneficial in some scenarios.
147+
148+
endchoice
149+
150+
endif # CPU_MIPSR6
151+
152+
config SCACHE_DEBUGFS
153+
bool "L2 cache debugfs entries"
154+
depends on DEBUG_FS
155+
help
156+
Enable this to allow parts of the L2 cache configuration, such as
157+
whether or not prefetching is enabled, to be exposed to userland
158+
via debugfs.
159+
160+
If unsure, say N.
161+
162+
menuconfig MIPS_CPS_NS16550
163+
bool "CPS SMP NS16550 UART output"
164+
depends on MIPS_CPS
165+
help
166+
Output debug information via an ns16550 compatible UART if exceptions
167+
occur early in the boot process of a secondary core.
168+
169+
if MIPS_CPS_NS16550
170+
171+
config MIPS_CPS_NS16550_BASE
172+
hex "UART Base Address"
173+
default 0x1b0003f8 if MIPS_MALTA
174+
help
175+
The base address of the ns16550 compatible UART on which to output
176+
debug information from the early stages of core startup.
177+
178+
config MIPS_CPS_NS16550_SHIFT
179+
int "UART Register Shift"
180+
default 0 if MIPS_MALTA
181+
help
182+
The number of bits to shift ns16550 register indices by in order to
183+
form their addresses. That is, log base 2 of the span between
184+
adjacent ns16550 registers in the system.
185+
186+
endif # MIPS_CPS_NS16550
187+
116188
endmenu

arch/mips/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ toolchain-msa := $(call cc-option-yn,$(mips-cflags) -mhard-float -mfp64 -Wa$(
204204
cflags-$(toolchain-msa) += -DTOOLCHAIN_SUPPORTS_MSA
205205
endif
206206

207+
cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_NEVER) += -mcompact-branches=never
208+
cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_OPTIMAL) += -mcompact-branches=optimal
209+
cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_ALWAYS) += -mcompact-branches=always
210+
207211
#
208212
# Firmware support
209213
#

0 commit comments

Comments
 (0)