Skip to content

Commit

Permalink
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upst…
Browse files Browse the repository at this point in the history
…ream-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
  ...
  • Loading branch information
torvalds committed Nov 15, 2015
2 parents 12b76f3 + da34232 commit b84da9f
Show file tree
Hide file tree
Showing 151 changed files with 4,590 additions and 749 deletions.
83 changes: 83 additions & 0 deletions Documentation/devicetree/bindings/mips/img/xilfpga.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
Imagination University Program MIPSfpga
=======================================

Under the Imagination University Program, a microAptiv UP core has been
released for academic usage.

As we are dealing with a MIPS core instantiated on an FPGA, specifications
are fluid and can be varied in RTL.

This binding document is provided as baseline guidance for the example
project provided by IMG.

The example project runs on the Nexys4DDR board by Digilent powered by
the ARTIX-7 FPGA by Xilinx.

Relevant details about the example project and the Nexys4DDR board:

- microAptiv UP core m14Kc
- 50MHz clock speed
- 128Mbyte DDR RAM at 0x0000_0000
- 8Kbyte RAM at 0x1000_0000
- axi_intc at 0x1020_0000
- axi_uart16550 at 0x1040_0000
- axi_gpio at 0x1060_0000
- axi_i2c at 0x10A0_0000
- custom_gpio at 0x10C0_0000
- axi_ethernetlite at 0x10E0_0000
- 8Kbyte BootRAM at 0x1FC0_0000

Required properties:
--------------------
- compatible: Must include "digilent,nexys4ddr","img,xilfpga".

CPU nodes:
----------
A "cpus" node is required. Required properties:
- #address-cells: Must be 1.
- #size-cells: Must be 0.
A CPU sub-node is also required for at least CPU 0. Required properties:
- device_type: Must be "cpu".
- compatible: Must be "mips,m14Kc".
- reg: Must be <0>.
- clocks: phandle to ext clock for fixed-clock received by MIPS core.

Example:

compatible = "img,xilfpga","digilent,nexys4ddr";
cpus {
#address-cells = <1>;
#size-cells = <0>;

cpu0: cpu@0 {
device_type = "cpu";
compatible = "mips,m14Kc";
reg = <0>;
clocks = <&ext>;
};
};

ext: ext {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <50000000>;
};

Boot protocol:
--------------

The BootRAM is a writeable "RAM" in FPGA at 0x1FC0_0000.
This is for easy reprogrammibility via JTAG.

The BootRAM initializes the cache and the axi_uart peripheral.

DDR initialization is already handled by a HW IP block.

When the example project bitstream is loaded, the cpu_reset button
needs to be pressed.

The bootram initializes the cache and axi_uart.
Then outputs MIPSFPGA\n\r on the serial port on the Nexys4DDR board.

At this point, the board is ready to load the Linux kernel
vmlinux file via JTAG.
1 change: 1 addition & 0 deletions arch/mips/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ obj- := $(platform-)
obj-y += kernel/
obj-y += mm/
obj-y += net/
obj-y += vdso/

ifdef CONFIG_KVM
obj-y += kvm/
Expand Down
1 change: 1 addition & 0 deletions arch/mips/Kbuild.platforms
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ platforms += sibyte
platforms += sni
platforms += txx9
platforms += vr41xx
platforms += xilfpga

# include the platform specific files
include $(patsubst %, $(srctree)/arch/mips/%/Platform, $(platforms))
88 changes: 84 additions & 4 deletions arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ config MIPS
select ARCH_MIGHT_HAVE_PC_PARPORT
select ARCH_MIGHT_HAVE_PC_SERIO
select ARCH_USE_CMPXCHG_LOCKREF if 64BIT
select ARCH_USE_BUILTIN_BSWAP
select HAVE_CONTEXT_TRACKING
select HAVE_GENERIC_DMA_COHERENT
select HAVE_IDE
Expand Down Expand Up @@ -60,6 +61,8 @@ config MIPS
select SYSCTL_EXCEPTION_TRACE
select HAVE_VIRT_CPU_ACCOUNTING_GEN
select HAVE_IRQ_TIME_ACCOUNTING
select GENERIC_TIME_VSYSCALL
select ARCH_CLOCKSOURCE_DATA

menu "Machine selection"

Expand Down Expand Up @@ -401,6 +404,28 @@ config MACH_PISTACHIO
help
This enables support for the IMG Pistachio SoC platform.

config MACH_XILFPGA
bool "MIPSfpga Xilinx based boards"
select ARCH_REQUIRE_GPIOLIB
select BOOT_ELF32
select BOOT_RAW
select BUILTIN_DTB
select CEVT_R4K
select COMMON_CLK
select CSRC_R4K
select IRQ_MIPS_CPU
select LIBFDT
select MIPS_CPU_SCACHE
select SYS_HAS_EARLY_PRINTK
select SYS_HAS_CPU_MIPS32_R2
select SYS_SUPPORTS_32BIT_KERNEL
select SYS_SUPPORTS_LITTLE_ENDIAN
select SYS_SUPPORTS_ZBOOT_UART16550
select USE_OF
select USE_GENERIC_EARLY_PRINTK_8250
help
This enables support for the IMG University Program MIPSfpga platform.

config MIPS_MALTA
bool "MIPS Malta board"
select ARCH_MAY_HAVE_PC_FDC
Expand All @@ -424,6 +449,7 @@ config MIPS_MALTA
select MIPS_L1_CACHE_SHIFT_6
select PCI_GT64XXX_PCI0
select MIPS_MSC
select SMP_UP if SMP
select SWAP_IO_SPACE
select SYS_HAS_CPU_MIPS32_R1
select SYS_HAS_CPU_MIPS32_R2
Expand All @@ -449,6 +475,8 @@ config MIPS_MALTA
select SYS_SUPPORTS_ZBOOT
select USE_OF
select ZONE_DMA32 if 64BIT
select BUILTIN_DTB
select LIBFDT
help
This enables support for the MIPS Technologies Malta evaluation
board.
Expand Down Expand Up @@ -964,6 +992,7 @@ source "arch/mips/loongson32/Kconfig"
source "arch/mips/loongson64/Kconfig"
source "arch/mips/netlogic/Kconfig"
source "arch/mips/paravirt/Kconfig"
source "arch/mips/xilfpga/Kconfig"

endmenu

Expand Down Expand Up @@ -1036,6 +1065,9 @@ config CSRC_R4K
config CSRC_SB1250
bool

config MIPS_CLOCK_VSYSCALL
def_bool CSRC_R4K || CLKSRC_MIPS_GIC

config GPIO_TXX9
select ARCH_REQUIRE_GPIOLIB
bool
Expand Down Expand Up @@ -2529,6 +2561,9 @@ choice
help
Allows the configuration of the timer frequency.

config HZ_24
bool "24 HZ" if SYS_SUPPORTS_24HZ || SYS_SUPPORTS_ARBIT_HZ

config HZ_48
bool "48 HZ" if SYS_SUPPORTS_48HZ || SYS_SUPPORTS_ARBIT_HZ

Expand All @@ -2552,6 +2587,9 @@ choice

endchoice

config SYS_SUPPORTS_24HZ
bool

config SYS_SUPPORTS_48HZ
bool

Expand All @@ -2575,13 +2613,18 @@ config SYS_SUPPORTS_1024HZ

config SYS_SUPPORTS_ARBIT_HZ
bool
default y if !SYS_SUPPORTS_48HZ && !SYS_SUPPORTS_100HZ && \
!SYS_SUPPORTS_128HZ && !SYS_SUPPORTS_250HZ && \
!SYS_SUPPORTS_256HZ && !SYS_SUPPORTS_1000HZ && \
default y if !SYS_SUPPORTS_24HZ && \
!SYS_SUPPORTS_48HZ && \
!SYS_SUPPORTS_100HZ && \
!SYS_SUPPORTS_128HZ && \
!SYS_SUPPORTS_250HZ && \
!SYS_SUPPORTS_256HZ && \
!SYS_SUPPORTS_1000HZ && \
!SYS_SUPPORTS_1024HZ

config HZ
int
default 24 if HZ_24
default 48 if HZ_48
default 100 if HZ_100
default 128 if HZ_128
Expand Down Expand Up @@ -2685,14 +2728,28 @@ config BUILTIN_DTB
bool

choice
prompt "Kernel appended dtb support" if OF
prompt "Kernel appended dtb support" if USE_OF
default MIPS_NO_APPENDED_DTB

config MIPS_NO_APPENDED_DTB
bool "None"
help
Do not enable appended dtb support.

config MIPS_ELF_APPENDED_DTB
bool "vmlinux"
help
With this option, the boot code will look for a device tree binary
DTB) included in the vmlinux ELF section .appended_dtb. By default
it is empty and the DTB can be appended using binutils command
objcopy:

objcopy --update-section .appended_dtb=<filename>.dtb vmlinux

This is meant as a backward compatiblity convenience for those
systems with a bootloader that can't be upgraded to accommodate
the documented boot protocol using a device tree.

config MIPS_RAW_APPENDED_DTB
bool "vmlinux.bin"
help
Expand Down Expand Up @@ -2729,6 +2786,25 @@ choice
if you don't intend to always append a DTB.
endchoice

choice
prompt "Kernel command line type" if !CMDLINE_OVERRIDE
default MIPS_CMDLINE_FROM_DTB if USE_OF && !ATH79 && !MACH_INGENIC && \
!MIPS_MALTA && !MIPS_SEAD3 && \
!CAVIUM_OCTEON_SOC
default MIPS_CMDLINE_FROM_BOOTLOADER

config MIPS_CMDLINE_FROM_DTB
depends on USE_OF
bool "Dtb kernel arguments if available"

config MIPS_CMDLINE_DTB_EXTEND
depends on USE_OF
bool "Extend dtb kernel arguments with bootloader arguments"

config MIPS_CMDLINE_FROM_BOOTLOADER
bool "Bootloader kernel arguments if available"
endchoice

endmenu

config LOCKDEP_SUPPORT
Expand All @@ -2739,6 +2815,10 @@ config STACKTRACE_SUPPORT
bool
default y

config HAVE_LATENCYTOP_SUPPORT
bool
default y

config PGTABLE_LEVELS
int
default 3 if 64BIT && !PAGE_SIZE_64KB
Expand Down
72 changes: 72 additions & 0 deletions arch/mips/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,76 @@ config SPINLOCK_TEST
help
Add several files to the debugfs to test spinlock speed.

if CPU_MIPSR6

choice
prompt "Compact branch policy"
default MIPS_COMPACT_BRANCHES_OPTIMAL

config MIPS_COMPACT_BRANCHES_NEVER
bool "Never (force delay slot branches)"
help
Pass the -mcompact-branches=never flag to the compiler in order to
force it to always emit branches with delay slots, and make no use
of the compact branch instructions introduced by MIPSr6. This is
useful if you suspect there may be an issue with compact branches in
either the compiler or the CPU.

config MIPS_COMPACT_BRANCHES_OPTIMAL
bool "Optimal (use where beneficial)"
help
Pass the -mcompact-branches=optimal flag to the compiler in order for
it to make use of compact branch instructions where it deems them
beneficial, and use branches with delay slots elsewhere. This is the
default compiler behaviour, and should be used unless you have a
reason to choose otherwise.

config MIPS_COMPACT_BRANCHES_ALWAYS
bool "Always (force compact branches)"
help
Pass the -mcompact-branches=always flag to the compiler in order to
force it to always emit compact branches, making no use of branch
instructions with delay slots. This can result in more compact code
which may be beneficial in some scenarios.

endchoice

endif # CPU_MIPSR6

config SCACHE_DEBUGFS
bool "L2 cache debugfs entries"
depends on DEBUG_FS
help
Enable this to allow parts of the L2 cache configuration, such as
whether or not prefetching is enabled, to be exposed to userland
via debugfs.

If unsure, say N.

menuconfig MIPS_CPS_NS16550
bool "CPS SMP NS16550 UART output"
depends on MIPS_CPS
help
Output debug information via an ns16550 compatible UART if exceptions
occur early in the boot process of a secondary core.

if MIPS_CPS_NS16550

config MIPS_CPS_NS16550_BASE
hex "UART Base Address"
default 0x1b0003f8 if MIPS_MALTA
help
The base address of the ns16550 compatible UART on which to output
debug information from the early stages of core startup.

config MIPS_CPS_NS16550_SHIFT
int "UART Register Shift"
default 0 if MIPS_MALTA
help
The number of bits to shift ns16550 register indices by in order to
form their addresses. That is, log base 2 of the span between
adjacent ns16550 registers in the system.

endif # MIPS_CPS_NS16550

endmenu
4 changes: 4 additions & 0 deletions arch/mips/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ toolchain-msa := $(call cc-option-yn,$(mips-cflags) -mhard-float -mfp64 -Wa$(
cflags-$(toolchain-msa) += -DTOOLCHAIN_SUPPORTS_MSA
endif

cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_NEVER) += -mcompact-branches=never
cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_OPTIMAL) += -mcompact-branches=optimal
cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_ALWAYS) += -mcompact-branches=always

#
# Firmware support
#
Expand Down
Loading

0 comments on commit b84da9f

Please sign in to comment.