Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle:
"This is the main pull request for MIPS for 4.7. Here's the summary of
the changes:
- ATH79: Support for DTB passuing using the UHI boot protocol
- ATH79: Remove support for builtin DTB.
- ATH79: Add zboot debug serial support.
- ATH79: Add initial support for Dragino MS14 (Dragine 2), Onion Omega
and DPT-Module.
- ATH79: Update devicetree clock support for AR9132 and AR9331.
- ATH79: Cleanup the DT code.
- ATH79: Support newer SOCs in ath79_ddr_ctrl_init.
- ATH79: Fix regression in PCI window initialization.
- BCM47xx: Move SPROM driver to drivers/firmware/
- BCM63xx: Enable partition parser in defconfig.
- BMIPS: BMIPS5000 has I cache filing from D cache
- BMIPS: BMIPS: Add cpu-feature-overrides.h
- BMIPS: Add Whirlwind support
- BMIPS: Adjust mips-hpt-frequency for BCM7435
- BMIPS: Remove maxcpus from BCM97435SVMB DTS
- BMIPS: Add missing 7038 L1 register cells to BCM7435
- BMIPS: Various tweaks to initialization code.
- BMIPS: Enable partition parser in defconfig.
- BMIPS: Cache tweaks.
- BMIPS: Add UART, I2C and SATA devices to DT.
- BMIPS: Add BCM6358 and BCM63268support
- BMIPS: Add device tree example for BCM6358.
- BMIPS: Improve Improve BCM6328 and BCM6368 device trees
- Lantiq: Add support for device tree file from boot loader
- Lantiq: Allow build with no built-in DT.
- Loongson 3: Reserve 32MB for RS780E integrated GPU.
- Loongson 3: Fix build error after ld-version.sh modification
- Loongson 3: Move chipset ACPI code from drivers to arch.
- Loongson 3: Speedup irq processing.
- Loongson 3: Add basic Loongson 3A support.
- Loongson 3: Set cache flush handlers to nop.
- Loongson 3: Invalidate special TLBs when needed.
- Loongson 3: Fast TLB refill handler.
- MT7620: Fallback strategy for invalid syscfg0.
- Netlogic: Fix CP0_EBASE redefinition warnings
- Octeon: Initialization fixes
- Octeon: Add DTS files for the D-Link DSR-1000N and EdgeRouter Lite
- Octeon: Enable add Octeon-drivers in cavium_octeon_defconfig
- Octeon: Correctly handle endian-swapped initramfs images.
- Octeon: Support CN73xx, CN75xx and CN78xx.
- Octeon: Remove dead code from cvmx-sysinfo.
- Octeon: Extend number of supported CPUs past 32.
- Octeon: Remove some code limiting NR_IRQS to 255.
- Octeon: Simplify octeon_irq_ciu_gpio_set_type.
- Octeon: Mark some functions __init in smp.c
- Octeon: Octeon: Add Octeon III CN7xxx interface detection
- PIC32: Add serial driver and bindings for it.
- PIC32: Add PIC32 deadman timer driver and bindings.
- PIC32: Add PIC32 clock timer driver and bindings.
- Pistachio: Determine SoC revision during boot
- Sibyte: Fix Kconfig dependencies of SIBYTE_BUS_WATCHER.
- Sibyte: Strip redundant comments from bcm1480_regs.h.
- Panic immediately if panic_on_oops is set.
- module: fix incorrect IS_ERR_VALUE macro usage.
- module: Make consistent use of pr_*
- Remove no longer needed work_on_cpu() call.
- Remove CONFIG_IPV6_PRIVACY from defconfigs.
- Fix registers of non-crashing CPUs in dumps.
- Handle MIPSisms in new vmcore_elf32_check_arch.
- Select CONFIG_HANDLE_DOMAIN_IRQ and make it work.
- Allow RIXI to be used on non-R2 or R6 cores.
- Reserve nosave data for hibernation
- Fix siginfo.h to use strict POSIX types.
- Don't unwind user mode with EVA.
- Fix watchpoint restoration
- Ptrace watchpoints for R6.
- Sync icache when it fills from dcache
- I6400 I-cache fills from dcache.
- Various MSA fixes.
- Cleanup MIPS_CPU_* definitions.
- Signal: Move generic copy_siginfo to signal.h
- Signal: Fix uapi include in exported asm/siginfo.h
- Timer fixes for sake of KVM.
- XPA TLB refill fixes.
- Treat perf counter feature
- Update John Crispin's email address
- Add PIC32 watchdog and bindings.
- Handle R10000 LL/SC bug in set_pte()
- cpufreq: Various fixes for Longson1.
- R6: Fix R2 emulation.
- mathemu: Cosmetic fix to ADDIUPC emulation, plenty of other small fixes
- ELF: ABI and FP fixes.
- Allow for relocatable kernel and use that to support KASLR.
- Fix CPC_BASE_ADDR mask
- Plenty fo smp-cps, CM, R6 and M6250 fixes.
- Make reset_control_ops const.
- Fix kernel command line handling of leading whitespace.
- Cleanups to cache handling.
- Add brcm, bcm6345-l1-intc device tree bindings.
- Use generic clkdev.h header
- Remove CLK_IS_ROOT usage.
- Misc small cleanups.
- CM: Fix compilation error when !MIPS_CM
- oprofile: Fix a preemption issue
- Detect DSP ASE v3 support:1"
* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (275 commits)
MIPS: pic32mzda: fix getting timer clock rate.
MIPS: ath79: fix regression in PCI window initialization
MIPS: ath79: make ath79_ddr_ctrl_init() compatible for newer SoCs
MIPS: Fix VZ probe gas errors with binutils <2.24
MIPS: perf: Fix I6400 event numbers
MIPS: DEC: Export `ioasic_ssr_lock' to modules
MIPS: MSA: Fix a link error on `_init_msa_upper' with older GCC
MIPS: CM: Fix compilation error when !MIPS_CM
MIPS: Fix genvdso error on rebuild
USB: ohci-jz4740: Remove obsolete driver
MIPS: JZ4740: Probe OHCI platform device via DT
MIPS: JZ4740: Qi LB60: Remove support for AVT2 variant
MIPS: pistachio: Determine SoC revision during boot
MIPS: BMIPS: Adjust mips-hpt-frequency for BCM7435
mips: mt7620: fallback to SDRAM when syscfg0 does not have a valid value for the memory type
MIPS: Prevent "restoration" of MSA context in non-MSA kernels
MIPS: cevt-r4k: Dynamically calculate min_delta_ns
MIPS: malta-time: Take seconds into account
MIPS: malta-time: Start GIC count before syncing to RTC
MIPS: Force CPUs to lose FP context during mode switches
...
This commit is contained in:
commit
07b75260eb
358 changed files with 14005 additions and 3399 deletions
39
Documentation/devicetree/bindings/clock/microchip,pic32.txt
Normal file
39
Documentation/devicetree/bindings/clock/microchip,pic32.txt
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
Microchip PIC32 Clock Controller Binding
|
||||
----------------------------------------
|
||||
Microchip clock controller is consists of few oscillators, PLL, multiplexer
|
||||
and few divider modules.
|
||||
|
||||
This binding uses common clock bindings.
|
||||
[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
|
||||
|
||||
Required properties:
|
||||
- compatible: shall be "microchip,pic32mzda-clk".
|
||||
- reg: shall contain base address and length of clock registers.
|
||||
- #clock-cells: shall be 1.
|
||||
|
||||
Optional properties:
|
||||
- microchip,pic32mzda-sosc: shall be added only if platform has
|
||||
secondary oscillator connected.
|
||||
|
||||
Example:
|
||||
rootclk: clock-controller@1f801200 {
|
||||
compatible = "microchip,pic32mzda-clk";
|
||||
reg = <0x1f801200 0x200>;
|
||||
#clock-cells = <1>;
|
||||
/* optional */
|
||||
microchip,pic32mzda-sosc;
|
||||
};
|
||||
|
||||
|
||||
The clock consumer shall specify the desired clock-output of the clock
|
||||
controller (as defined in [2]) by specifying output-id in its "clock"
|
||||
phandle cell.
|
||||
[2] include/dt-bindings/clock/microchip,pic32-clock.h
|
||||
|
||||
For example for UART2:
|
||||
uart2: serial@2 {
|
||||
compatible = "microchip,pic32mzda-uart";
|
||||
reg = <>;
|
||||
interrupts = <>;
|
||||
clocks = <&rootclk PB2CLK>;
|
||||
};
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
Broadcom BCM6345-style Level 1 interrupt controller
|
||||
|
||||
This block is a first level interrupt controller that is typically connected
|
||||
directly to one of the HW INT lines on each CPU.
|
||||
|
||||
Key elements of the hardware design include:
|
||||
|
||||
- 32, 64 or 128 incoming level IRQ lines
|
||||
|
||||
- Most onchip peripherals are wired directly to an L1 input
|
||||
|
||||
- A separate instance of the register set for each CPU, allowing individual
|
||||
peripheral IRQs to be routed to any CPU
|
||||
|
||||
- Contains one or more enable/status word pairs per CPU
|
||||
|
||||
- No atomic set/clear operations
|
||||
|
||||
- No polarity/level/edge settings
|
||||
|
||||
- No FIFO or priority encoder logic; software is expected to read all
|
||||
2-4 status words to determine which IRQs are pending
|
||||
|
||||
Required properties:
|
||||
|
||||
- compatible: should be "brcm,bcm<soc>-l1-intc", "brcm,bcm6345-l1-intc"
|
||||
- reg: specifies the base physical address and size of the registers;
|
||||
the number of supported IRQs is inferred from the size argument
|
||||
- interrupt-controller: identifies the node as an interrupt controller
|
||||
- #interrupt-cells: specifies the number of cells needed to encode an interrupt
|
||||
source, should be 1.
|
||||
- interrupt-parent: specifies the phandle to the parent interrupt controller(s)
|
||||
this one is cascaded from
|
||||
- interrupts: specifies the interrupt line(s) in the interrupt-parent controller
|
||||
node; valid values depend on the type of parent interrupt controller
|
||||
|
||||
If multiple reg ranges and interrupt-parent entries are present on an SMP
|
||||
system, the driver will allow IRQ SMP affinity to be set up through the
|
||||
/proc/irq/ interface. In the simplest possible configuration, only one
|
||||
reg range and one interrupt-parent is needed.
|
||||
|
||||
The driver operates in native CPU endian by default, there is no support for
|
||||
specifying an alternative endianness.
|
||||
|
||||
Example:
|
||||
|
||||
periph_intc: interrupt-controller@10000000 {
|
||||
compatible = "brcm,bcm63168-l1-intc", "brcm,bcm6345-l1-intc";
|
||||
reg = <0x10000020 0x20>,
|
||||
<0x10000040 0x20>;
|
||||
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <1>;
|
||||
|
||||
interrupt-parent = <&cpu_intc>;
|
||||
interrupts = <2>, <3>;
|
||||
};
|
||||
|
|
@ -4,7 +4,8 @@ Required properties:
|
|||
|
||||
- compatible: "brcm,bcm3384", "brcm,bcm33843"
|
||||
"brcm,bcm3384-viper", "brcm,bcm33843-viper"
|
||||
"brcm,bcm6328", "brcm,bcm6368",
|
||||
"brcm,bcm6328", "brcm,bcm6358", "brcm,bcm6368",
|
||||
"brcm,bcm63168", "brcm,bcm63268",
|
||||
"brcm,bcm7125", "brcm,bcm7346", "brcm,bcm7358", "brcm,bcm7360",
|
||||
"brcm,bcm7362", "brcm,bcm7420", "brcm,bcm7425"
|
||||
|
||||
|
|
|
|||
27
Documentation/devicetree/bindings/mips/cavium/ciu3.txt
Normal file
27
Documentation/devicetree/bindings/mips/cavium/ciu3.txt
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
* Central Interrupt Unit v3
|
||||
|
||||
Properties:
|
||||
- compatible: "cavium,octeon-7890-ciu3"
|
||||
|
||||
Compatibility with 78XX and 73XX SOCs.
|
||||
|
||||
- interrupt-controller: This is an interrupt controller.
|
||||
|
||||
- reg: The base address of the CIU's register bank.
|
||||
|
||||
- #interrupt-cells: Must be <2>. The first cell is source number.
|
||||
The second cell indicates the triggering semantics, and may have a
|
||||
value of either 4 for level semantics, or 1 for edge semantics.
|
||||
|
||||
Example:
|
||||
interrupt-controller@1010000000000 {
|
||||
compatible = "cavium,octeon-7890-ciu3";
|
||||
interrupt-controller;
|
||||
/* Interrupts are specified by two parts:
|
||||
* 1) Source number (20 significant bits)
|
||||
* 2) Trigger type: (4 == level, 1 == edge)
|
||||
*/
|
||||
#address-cells = <0>;
|
||||
#interrupt-cells = <2>;
|
||||
reg = <0x10100 0x00000000 0x0 0xb0000000>;
|
||||
};
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
* Microchip Universal Asynchronous Receiver Transmitter (UART)
|
||||
|
||||
Required properties:
|
||||
- compatible: Should be "microchip,pic32mzda-uart"
|
||||
- reg: Should contain registers location and length
|
||||
- interrupts: Should contain interrupt
|
||||
- clocks: Phandle to the clock.
|
||||
See: Documentation/devicetree/bindings/clock/clock-bindings.txt
|
||||
- pinctrl-names: A pinctrl state names "default" must be defined.
|
||||
- pinctrl-0: Phandle referencing pin configuration of the UART peripheral.
|
||||
See: Documentation/devicetree/bindings/pinctrl/pinctrl-binding.txt
|
||||
|
||||
Optional properties:
|
||||
- cts-gpios: CTS pin for UART
|
||||
|
||||
Example:
|
||||
uart1: serial@1f822000 {
|
||||
compatible = "microchip,pic32mzda-uart";
|
||||
reg = <0x1f822000 0x50>;
|
||||
interrupts = <112 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<113 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<114 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&PBCLK2>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_uart1
|
||||
&pinctrl_uart1_cts
|
||||
&pinctrl_uart1_rts>;
|
||||
cts-gpios = <&gpio1 15 0>;
|
||||
};
|
||||
|
|
@ -72,6 +72,8 @@ digilent Diglent, Inc.
|
|||
dlg Dialog Semiconductor
|
||||
dlink D-Link Corporation
|
||||
dmo Data Modul AG
|
||||
dptechnics DPTechnics
|
||||
dragino Dragino Technology Co., Limited
|
||||
ea Embedded Artists AB
|
||||
ebv EBV Elektronik
|
||||
edt Emerging Display Technologies
|
||||
|
|
@ -176,6 +178,7 @@ nvidia NVIDIA
|
|||
nxp NXP Semiconductors
|
||||
okaya Okaya Electric America, Inc.
|
||||
olimex OLIMEX Ltd.
|
||||
onion Onion Corporation
|
||||
onnn ON Semiconductor Corp.
|
||||
opencores OpenCores.org
|
||||
option Option NV
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
* Microchip PIC32 Deadman Timer
|
||||
|
||||
The deadman timer is used to reset the processor in the event of a software
|
||||
malfunction. It is a free-running instruction fetch timer, which is clocked
|
||||
whenever an instruction fetch occurs until a count match occurs.
|
||||
|
||||
Required properties:
|
||||
- compatible: must be "microchip,pic32mzda-dmt".
|
||||
- reg: physical base address of the controller and length of memory mapped
|
||||
region.
|
||||
- clocks: phandle of parent clock (should be &PBCLK7).
|
||||
|
||||
Example:
|
||||
|
||||
watchdog@1f800a00 {
|
||||
compatible = "microchip,pic32mzda-dmt";
|
||||
reg = <0x1f800a00 0x80>;
|
||||
clocks = <&PBCLK7>;
|
||||
};
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
* Microchip PIC32 Watchdog Timer
|
||||
|
||||
When enabled, the watchdog peripheral can be used to reset the device if the
|
||||
WDT is not cleared periodically in software.
|
||||
|
||||
Required properties:
|
||||
- compatible: must be "microchip,pic32mzda-wdt".
|
||||
- reg: physical base address of the controller and length of memory mapped
|
||||
region.
|
||||
- clocks: phandle of source clk. should be <&LPRC> clk.
|
||||
|
||||
Example:
|
||||
|
||||
watchdog@1f800800 {
|
||||
compatible = "microchip,pic32mzda-wdt";
|
||||
reg = <0x1f800800 0x200>;
|
||||
clocks = <&LPRC>;
|
||||
};
|
||||
13
MAINTAINERS
13
MAINTAINERS
|
|
@ -6491,7 +6491,7 @@ F: net/l3mdev
|
|||
F: include/net/l3mdev.h
|
||||
|
||||
LANTIQ MIPS ARCHITECTURE
|
||||
M: John Crispin <blogic@openwrt.org>
|
||||
M: John Crispin <john@phrozen.org>
|
||||
L: linux-mips@linux-mips.org
|
||||
S: Maintained
|
||||
F: arch/mips/lantiq
|
||||
|
|
@ -7332,6 +7332,15 @@ S: Supported
|
|||
F: Documentation/mips/
|
||||
F: arch/mips/
|
||||
|
||||
MIPS/LOONGSON1 ARCHITECTURE
|
||||
M: Keguang Zhang <keguang.zhang@gmail.com>
|
||||
L: linux-mips@linux-mips.org
|
||||
S: Maintained
|
||||
F: arch/mips/loongson32/
|
||||
F: arch/mips/include/asm/mach-loongson32/
|
||||
F: drivers/*/*loongson1*
|
||||
F: drivers/*/*/*loongson1*
|
||||
|
||||
MIROSOUND PCM20 FM RADIO RECEIVER DRIVER
|
||||
M: Hans Verkuil <hverkuil@xs4all.nl>
|
||||
L: linux-media@vger.kernel.org
|
||||
|
|
@ -9251,7 +9260,7 @@ S: Maintained
|
|||
F: drivers/video/fbdev/aty/aty128fb.c
|
||||
|
||||
RALINK MIPS ARCHITECTURE
|
||||
M: John Crispin <blogic@openwrt.org>
|
||||
M: John Crispin <john@phrozen.org>
|
||||
L: linux-mips@linux-mips.org
|
||||
S: Maintained
|
||||
F: arch/mips/ralink
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ config MIPS
|
|||
select HAVE_IRQ_TIME_ACCOUNTING
|
||||
select GENERIC_TIME_VSYSCALL
|
||||
select ARCH_CLOCKSOURCE_DATA
|
||||
select HANDLE_DOMAIN_IRQ
|
||||
|
||||
menu "Machine selection"
|
||||
|
||||
|
|
@ -137,7 +138,7 @@ config ATH79
|
|||
select SYS_SUPPORTS_32BIT_KERNEL
|
||||
select SYS_SUPPORTS_BIG_ENDIAN
|
||||
select SYS_SUPPORTS_MIPS16
|
||||
select SYS_SUPPORTS_ZBOOT
|
||||
select SYS_SUPPORTS_ZBOOT_UART_PROM
|
||||
select USE_OF
|
||||
help
|
||||
Support for the Atheros AR71XX/AR724X/AR913X SoCs.
|
||||
|
|
@ -194,6 +195,7 @@ config BCM47XX
|
|||
select GPIOLIB
|
||||
select LEDS_GPIO_REGISTER
|
||||
select BCM47XX_NVRAM
|
||||
select BCM47XX_SPROM
|
||||
help
|
||||
Support for BCM47XX based boards
|
||||
|
||||
|
|
@ -471,6 +473,7 @@ config MIPS_MALTA
|
|||
select SYS_SUPPORTS_MULTITHREADING
|
||||
select SYS_SUPPORTS_SMARTMIPS
|
||||
select SYS_SUPPORTS_ZBOOT
|
||||
select SYS_SUPPORTS_RELOCATABLE
|
||||
select USE_OF
|
||||
select ZONE_DMA32 if 64BIT
|
||||
select BUILTIN_DTB
|
||||
|
|
@ -505,6 +508,7 @@ config MIPS_SEAD3
|
|||
select MIPS_MSC
|
||||
select SYS_HAS_CPU_MIPS32_R1
|
||||
select SYS_HAS_CPU_MIPS32_R2
|
||||
select SYS_HAS_CPU_MIPS32_R6
|
||||
select SYS_HAS_CPU_MIPS64_R1
|
||||
select SYS_HAS_EARLY_PRINTK
|
||||
select SYS_SUPPORTS_32BIT_KERNEL
|
||||
|
|
@ -514,6 +518,7 @@ config MIPS_SEAD3
|
|||
select SYS_SUPPORTS_SMARTMIPS
|
||||
select SYS_SUPPORTS_MICROMIPS
|
||||
select SYS_SUPPORTS_MIPS16
|
||||
select SYS_SUPPORTS_RELOCATABLE
|
||||
select USB_EHCI_BIG_ENDIAN_DESC
|
||||
select USB_EHCI_BIG_ENDIAN_MMIO
|
||||
select USE_OF
|
||||
|
|
@ -1153,6 +1158,13 @@ config ISA_DMA_API
|
|||
config HOLES_IN_ZONE
|
||||
bool
|
||||
|
||||
config SYS_SUPPORTS_RELOCATABLE
|
||||
bool
|
||||
help
|
||||
Selected if the platform supports relocating the kernel.
|
||||
The platform must provide plat_get_fdt() if it selects CONFIG_USE_OF
|
||||
to allow access to command line and entropy sources.
|
||||
|
||||
#
|
||||
# Endianness selection. Sufficiently obscure so many users don't know what to
|
||||
# answer,so we try hard to limit the available choices. Also the use of a
|
||||
|
|
@ -1340,11 +1352,30 @@ config CPU_LOONGSON3
|
|||
select CPU_SUPPORTS_HUGEPAGES
|
||||
select WEAK_ORDERING
|
||||
select WEAK_REORDERING_BEYOND_LLSC
|
||||
select MIPS_PGD_C0_CONTEXT
|
||||
select GPIOLIB
|
||||
help
|
||||
The Loongson 3 processor implements the MIPS64R2 instruction
|
||||
set with many extensions.
|
||||
|
||||
config LOONGSON3_ENHANCEMENT
|
||||
bool "New Loongson 3 CPU Enhancements"
|
||||
default n
|
||||
select CPU_MIPSR2
|
||||
select CPU_HAS_PREFETCH
|
||||
depends on CPU_LOONGSON3
|
||||
help
|
||||
New Loongson 3 CPU (since Loongson-3A R2, as opposed to Loongson-3A
|
||||
R1, Loongson-3B R1 and Loongson-3B R2) has many enhancements, such as
|
||||
FTLB, L1-VCache, EI/DI/Wait/Prefetch instruction, DSP/DSPv2 ASE, User
|
||||
Local register, Read-Inhibit/Execute-Inhibit, SFB (Store Fill Buffer),
|
||||
Fast TLB refill support, etc.
|
||||
|
||||
This option enable those enhancements which are not probed at run
|
||||
time. If you want a generic kernel to run on all Loongson 3 machines,
|
||||
please say 'N' here. If you want a high-performance kernel to run on
|
||||
new Loongson 3 machines only, please say 'Y' here.
|
||||
|
||||
config CPU_LOONGSON2E
|
||||
bool "Loongson 2E"
|
||||
depends on SYS_HAS_CPU_LOONGSON2E
|
||||
|
|
@ -1373,6 +1404,8 @@ config CPU_LOONGSON1B
|
|||
bool "Loongson 1B"
|
||||
depends on SYS_HAS_CPU_LOONGSON1B
|
||||
select CPU_LOONGSON1
|
||||
select ARCH_WANT_OPTIONAL_GPIOLIB
|
||||
select LEDS_GPIO_REGISTER
|
||||
help
|
||||
The Loongson 1B is a 32-bit SoC, which implements the MIPS32
|
||||
release 2 instruction set.
|
||||
|
|
@ -1671,6 +1704,7 @@ config CPU_XLP
|
|||
select CPU_HAS_PREFETCH
|
||||
select CPU_MIPSR2
|
||||
select CPU_SUPPORTS_HUGEPAGES
|
||||
select MIPS_ASID_BITS_VARIABLE
|
||||
help
|
||||
Netlogic Microsystems XLP processors.
|
||||
endchoice
|
||||
|
|
@ -1796,6 +1830,7 @@ config CPU_BMIPS4380
|
|||
select MIPS_L1_CACHE_SHIFT_6
|
||||
select SYS_SUPPORTS_SMP
|
||||
select SYS_SUPPORTS_HOTPLUG_CPU
|
||||
select CPU_HAS_RIXI
|
||||
|
||||
config CPU_BMIPS5000
|
||||
bool
|
||||
|
|
@ -1803,10 +1838,12 @@ config CPU_BMIPS5000
|
|||
select MIPS_L1_CACHE_SHIFT_7
|
||||
select SYS_SUPPORTS_SMP
|
||||
select SYS_SUPPORTS_HOTPLUG_CPU
|
||||
select CPU_HAS_RIXI
|
||||
|
||||
config SYS_HAS_CPU_LOONGSON3
|
||||
bool
|
||||
select CPU_SUPPORTS_CPUFREQ
|
||||
select CPU_HAS_RIXI
|
||||
|
||||
config SYS_HAS_CPU_LOONGSON2E
|
||||
bool
|
||||
|
|
@ -1959,11 +1996,15 @@ config CPU_MIPSR1
|
|||
config CPU_MIPSR2
|
||||
bool
|
||||
default y if CPU_MIPS32_R2 || CPU_MIPS64_R2 || CPU_CAVIUM_OCTEON
|
||||
select CPU_HAS_RIXI
|
||||
select MIPS_SPRAM
|
||||
|
||||
config CPU_MIPSR6
|
||||
bool
|
||||
default y if CPU_MIPS32_R6 || CPU_MIPS64_R6
|
||||
select CPU_HAS_RIXI
|
||||
select HAVE_ARCH_BITREVERSE
|
||||
select MIPS_ASID_BITS_VARIABLE
|
||||
select MIPS_SPRAM
|
||||
|
||||
config EVA
|
||||
|
|
@ -1997,7 +2038,7 @@ config MIPS_PGD_C0_CONTEXT
|
|||
#
|
||||
config HARDWARE_WATCHPOINTS
|
||||
bool
|
||||
default y if CPU_MIPSR1 || CPU_MIPSR2
|
||||
default y if CPU_MIPSR1 || CPU_MIPSR2 || CPU_MIPSR6
|
||||
|
||||
menu "Kernel type"
|
||||
|
||||
|
|
@ -2040,6 +2081,16 @@ config KVM_GUEST_TIMER_FREQ
|
|||
emulation when determining guest CPU Frequency. Instead, the guest's
|
||||
timer frequency is specified directly.
|
||||
|
||||
config MIPS_VA_BITS_48
|
||||
bool "48 bits virtual memory"
|
||||
depends on 64BIT
|
||||
help
|
||||
Support a maximum at least 48 bits of application virtual memory.
|
||||
Default is 40 bits or less, depending on the CPU.
|
||||
This option result in a small memory overhead for page tables.
|
||||
This option is only supported with 16k and 64k page sizes.
|
||||
If unsure, say N.
|
||||
|
||||
choice
|
||||
prompt "Kernel page size"
|
||||
default PAGE_SIZE_4KB
|
||||
|
|
@ -2047,6 +2098,7 @@ choice
|
|||
config PAGE_SIZE_4KB
|
||||
bool "4kB"
|
||||
depends on !CPU_LOONGSON2 && !CPU_LOONGSON3
|
||||
depends on !MIPS_VA_BITS_48
|
||||
help
|
||||
This option select the standard 4kB Linux page size. On some
|
||||
R3000-family processors this is the only available page size. Using
|
||||
|
|
@ -2056,6 +2108,7 @@ config PAGE_SIZE_4KB
|
|||
config PAGE_SIZE_8KB
|
||||
bool "8kB"
|
||||
depends on CPU_R8000 || CPU_CAVIUM_OCTEON
|
||||
depends on !MIPS_VA_BITS_48
|
||||
help
|
||||
Using 8kB page size will result in higher performance kernel at
|
||||
the price of higher memory consumption. This option is available
|
||||
|
|
@ -2074,6 +2127,7 @@ config PAGE_SIZE_16KB
|
|||
config PAGE_SIZE_32KB
|
||||
bool "32kB"
|
||||
depends on CPU_CAVIUM_OCTEON
|
||||
depends on !MIPS_VA_BITS_48
|
||||
help
|
||||
Using 32kB page size will result in higher performance kernel at
|
||||
the price of higher memory consumption. This option is available
|
||||
|
|
@ -2278,7 +2332,7 @@ config MIPS_CMP
|
|||
|
||||
config MIPS_CPS
|
||||
bool "MIPS Coherent Processing System support"
|
||||
depends on SYS_SUPPORTS_MIPS_CPS && !CPU_MIPSR6
|
||||
depends on SYS_SUPPORTS_MIPS_CPS
|
||||
select MIPS_CM
|
||||
select MIPS_CPC
|
||||
select MIPS_CPS_PM if HOTPLUG_CPU
|
||||
|
|
@ -2369,6 +2423,9 @@ config CPU_HAS_WB
|
|||
config XKS01
|
||||
bool
|
||||
|
||||
config CPU_HAS_RIXI
|
||||
bool
|
||||
|
||||
#
|
||||
# Vectored interrupt mode is an R2 feature
|
||||
#
|
||||
|
|
@ -2399,6 +2456,21 @@ config CPU_R4000_WORKAROUNDS
|
|||
config CPU_R4400_WORKAROUNDS
|
||||
bool
|
||||
|
||||
config MIPS_ASID_SHIFT
|
||||
int
|
||||
default 6 if CPU_R3000 || CPU_TX39XX
|
||||
default 4 if CPU_R8000
|
||||
default 0
|
||||
|
||||
config MIPS_ASID_BITS
|
||||
int
|
||||
default 0 if MIPS_ASID_BITS_VARIABLE
|
||||
default 6 if CPU_R3000 || CPU_TX39XX
|
||||
default 8
|
||||
|
||||
config MIPS_ASID_BITS_VARIABLE
|
||||
bool
|
||||
|
||||
#
|
||||
# - Highmem only makes sense for the 32-bit kernel.
|
||||
# - The current highmem code will only work properly on physically indexed
|
||||
|
|
@ -2468,6 +2540,61 @@ config NUMA
|
|||
config SYS_SUPPORTS_NUMA
|
||||
bool
|
||||
|
||||
config RELOCATABLE
|
||||
bool "Relocatable kernel"
|
||||
depends on SYS_SUPPORTS_RELOCATABLE && (CPU_MIPS32_R2 || CPU_MIPS64_R2 || CPU_MIPS32_R6 || CPU_MIPS64_R6)
|
||||
help
|
||||
This builds a kernel image that retains relocation information
|
||||
so it can be loaded someplace besides the default 1MB.
|
||||
The relocations make the kernel binary about 15% larger,
|
||||
but are discarded at runtime
|
||||
|
||||
config RELOCATION_TABLE_SIZE
|
||||
hex "Relocation table size"
|
||||
depends on RELOCATABLE
|
||||
range 0x0 0x01000000
|
||||
default "0x00100000"
|
||||
---help---
|
||||
A table of relocation data will be appended to the kernel binary
|
||||
and parsed at boot to fix up the relocated kernel.
|
||||
|
||||
This option allows the amount of space reserved for the table to be
|
||||
adjusted, although the default of 1Mb should be ok in most cases.
|
||||
|
||||
The build will fail and a valid size suggested if this is too small.
|
||||
|
||||
If unsure, leave at the default value.
|
||||
|
||||
config RANDOMIZE_BASE
|
||||
bool "Randomize the address of the kernel image"
|
||||
depends on RELOCATABLE
|
||||
---help---
|
||||
Randomizes the physical and virtual address at which the
|
||||
kernel image is loaded, as a security feature that
|
||||
deters exploit attempts relying on knowledge of the location
|
||||
of kernel internals.
|
||||
|
||||
Entropy is generated using any coprocessor 0 registers available.
|
||||
|
||||
The kernel will be offset by up to RANDOMIZE_BASE_MAX_OFFSET.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config RANDOMIZE_BASE_MAX_OFFSET
|
||||
hex "Maximum kASLR offset" if EXPERT
|
||||
depends on RANDOMIZE_BASE
|
||||
range 0x0 0x40000000 if EVA || 64BIT
|
||||
range 0x0 0x08000000
|
||||
default "0x01000000"
|
||||
---help---
|
||||
When kASLR is active, this provides the maximum offset that will
|
||||
be applied to the kernel image. It should be set according to the
|
||||
amount of physical RAM available in the target system minus
|
||||
PHYSICAL_START and must be a power of 2.
|
||||
|
||||
This is limited by the size of KSEG0, 256Mb on 32-bit or 1Gb with
|
||||
EVA or 64-bit. The default is 16Mb.
|
||||
|
||||
config NODES_SHIFT
|
||||
int
|
||||
default "6"
|
||||
|
|
@ -2475,7 +2602,7 @@ config NODES_SHIFT
|
|||
|
||||
config HW_PERF_EVENTS
|
||||
bool "Enable hardware performance counter support for perf events"
|
||||
depends on PERF_EVENTS && OPROFILE=n && (CPU_MIPS32 || CPU_MIPS64 || CPU_R10000 || CPU_SB1 || CPU_CAVIUM_OCTEON || CPU_XLP || CPU_LOONGSON3)
|
||||
depends on PERF_EVENTS && !OPROFILE && (CPU_MIPS32 || CPU_MIPS64 || CPU_R10000 || CPU_SB1 || CPU_CAVIUM_OCTEON || CPU_XLP || CPU_LOONGSON3)
|
||||
default y
|
||||
help
|
||||
Enable hardware performance counter support for perf events. If
|
||||
|
|
@ -2808,6 +2935,10 @@ choice
|
|||
|
||||
config MIPS_CMDLINE_FROM_BOOTLOADER
|
||||
bool "Bootloader kernel arguments if available"
|
||||
|
||||
config MIPS_CMDLINE_BUILTIN_EXTEND
|
||||
depends on CMDLINE_BOOL
|
||||
bool "Extend builtin kernel arguments with bootloader arguments"
|
||||
endchoice
|
||||
|
||||
endmenu
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@
|
|||
# for "archclean" cleaning up for this architecture.
|
||||
#
|
||||
|
||||
archscripts: scripts_basic
|
||||
$(Q)$(MAKE) $(build)=arch/mips/boot/tools relocs
|
||||
|
||||
KBUILD_DEFCONFIG := ip22_defconfig
|
||||
|
||||
#
|
||||
|
|
@ -93,6 +96,10 @@ LDFLAGS_vmlinux += -G 0 -static -n -nostdlib
|
|||
KBUILD_AFLAGS_MODULE += -mlong-calls
|
||||
KBUILD_CFLAGS_MODULE += -mlong-calls
|
||||
|
||||
ifeq ($(CONFIG_RELOCATABLE),y)
|
||||
LDFLAGS_vmlinux += --emit-relocs
|
||||
endif
|
||||
|
||||
#
|
||||
# pass -msoft-float to GAS if it supports it. However on newer binutils
|
||||
# (specifically newer than 2.24.51.20140728) we then also need to explicitly
|
||||
|
|
@ -193,6 +200,8 @@ ifeq ($(CONFIG_CPU_HAS_MSA),y)
|
|||
toolchain-msa := $(call cc-option-yn,$(mips-cflags) -mhard-float -mfp64 -Wa$(comma)-mmsa)
|
||||
cflags-$(toolchain-msa) += -DTOOLCHAIN_SUPPORTS_MSA
|
||||
endif
|
||||
toolchain-virt := $(call cc-option-yn,$(mips-cflags) -mvirt)
|
||||
cflags-$(toolchain-virt) += -DTOOLCHAIN_SUPPORTS_VIRT
|
||||
|
||||
cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_NEVER) += -mcompact-branches=never
|
||||
cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_OPTIMAL) += -mcompact-branches=optimal
|
||||
|
|
@ -310,6 +319,10 @@ rom.bin rom.sw: vmlinux
|
|||
$(bootvars-y) $@
|
||||
endif
|
||||
|
||||
CMD_RELOCS = arch/mips/boot/tools/relocs
|
||||
quiet_cmd_relocs = RELOCS $<
|
||||
cmd_relocs = $(CMD_RELOCS) $<
|
||||
|
||||
#
|
||||
# Some machines like the Indy need 32-bit ELF binaries for booting purposes.
|
||||
# Other need ECOFF, so we build a 32-bit ELF binary for them which we then
|
||||
|
|
@ -318,6 +331,11 @@ endif
|
|||
quiet_cmd_32 = OBJCOPY $@
|
||||
cmd_32 = $(OBJCOPY) -O $(32bit-bfd) $(OBJCOPYFLAGS) $< $@
|
||||
vmlinux.32: vmlinux
|
||||
ifeq ($(CONFIG_RELOCATABLE)$(CONFIG_64BIT),yy)
|
||||
# Currently, objcopy fails to handle the relocations in the elf64
|
||||
# So the relocs tool must be run here to remove them first
|
||||
$(call cmd,relocs)
|
||||
endif
|
||||
$(call cmd,32)
|
||||
|
||||
#
|
||||
|
|
@ -333,6 +351,9 @@ all: $(all-y)
|
|||
|
||||
# boot
|
||||
$(boot-y): $(vmlinux-32) FORCE
|
||||
ifeq ($(CONFIG_RELOCATABLE)$(CONFIG_32BIT),yy)
|
||||
$(call cmd,relocs)
|
||||
endif
|
||||
$(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) \
|
||||
$(bootvars-y) arch/mips/boot/$@
|
||||
|
||||
|
|
@ -385,6 +406,7 @@ endif
|
|||
archclean:
|
||||
$(Q)$(MAKE) $(clean)=arch/mips/boot
|
||||
$(Q)$(MAKE) $(clean)=arch/mips/boot/compressed
|
||||
$(Q)$(MAKE) $(clean)=arch/mips/boot/tools
|
||||
$(Q)$(MAKE) $(clean)=arch/mips/lasat
|
||||
|
||||
define archhelp
|
||||
|
|
|
|||
|
|
@ -1043,8 +1043,7 @@ static int __init alchemy_clk_init(void)
|
|||
|
||||
/* Root of the Alchemy clock tree: external 12MHz crystal osc */
|
||||
c = clk_register_fixed_rate(NULL, ALCHEMY_ROOT_CLK, NULL,
|
||||
CLK_IS_ROOT,
|
||||
ALCHEMY_ROOTCLK_RATE);
|
||||
0, ALCHEMY_ROOTCLK_RATE);
|
||||
ERRCK(c)
|
||||
|
||||
/* CPU core clock */
|
||||
|
|
|
|||
|
|
@ -71,18 +71,6 @@ config ATH79_MACH_UBNT_XM
|
|||
Say 'Y' here if you want your kernel to support the
|
||||
Ubiquiti Networks XM (rev 1.0) board.
|
||||
|
||||
choice
|
||||
prompt "Build a DTB in the kernel"
|
||||
optional
|
||||
help
|
||||
Select a devicetree that should be built into the kernel.
|
||||
|
||||
config DTB_TL_WR1043ND_V1
|
||||
bool "TL-WR1043ND Version 1"
|
||||
select BUILTIN_DTB
|
||||
select SOC_AR913X
|
||||
endchoice
|
||||
|
||||
endmenu
|
||||
|
||||
config SOC_AR71XX
|
||||
|
|
|
|||
|
|
@ -18,17 +18,21 @@
|
|||
#include <linux/clk.h>
|
||||
#include <linux/clkdev.h>
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <dt-bindings/clock/ath79-clk.h>
|
||||
|
||||
#include <asm/div64.h>
|
||||
|
||||
#include <asm/mach-ath79/ath79.h>
|
||||
#include <asm/mach-ath79/ar71xx_regs.h>
|
||||
#include "common.h"
|
||||
#include "machtypes.h"
|
||||
|
||||
#define AR71XX_BASE_FREQ 40000000
|
||||
#define AR724X_BASE_FREQ 40000000
|
||||
|
||||
static struct clk *clks[3];
|
||||
static struct clk *clks[ATH79_CLK_END];
|
||||
static struct clk_onecell_data clk_data = {
|
||||
.clks = clks,
|
||||
.clk_num = ARRAY_SIZE(clks),
|
||||
|
|
@ -40,7 +44,7 @@ static struct clk *__init ath79_add_sys_clkdev(
|
|||
struct clk *clk;
|
||||
int err;
|
||||
|
||||
clk = clk_register_fixed_rate(NULL, id, NULL, CLK_IS_ROOT, rate);
|
||||
clk = clk_register_fixed_rate(NULL, id, NULL, 0, rate);
|
||||
if (!clk)
|
||||
panic("failed to allocate %s clock structure", id);
|
||||
|
||||
|
|
@ -78,59 +82,123 @@ static void __init ar71xx_clocks_init(void)
|
|||
ahb_rate = cpu_rate / div;
|
||||
|
||||
ath79_add_sys_clkdev("ref", ref_rate);
|
||||
clks[0] = ath79_add_sys_clkdev("cpu", cpu_rate);
|
||||
clks[1] = ath79_add_sys_clkdev("ddr", ddr_rate);
|
||||
clks[2] = ath79_add_sys_clkdev("ahb", ahb_rate);
|
||||
clks[ATH79_CLK_CPU] = ath79_add_sys_clkdev("cpu", cpu_rate);
|
||||
clks[ATH79_CLK_DDR] = ath79_add_sys_clkdev("ddr", ddr_rate);
|
||||
clks[ATH79_CLK_AHB] = ath79_add_sys_clkdev("ahb", ahb_rate);
|
||||
|
||||
clk_add_alias("wdt", NULL, "ahb", NULL);
|
||||
clk_add_alias("uart", NULL, "ahb", NULL);
|
||||
}
|
||||
|
||||
static struct clk * __init ath79_reg_ffclk(const char *name,
|
||||
const char *parent_name, unsigned int mult, unsigned int div)
|
||||
{
|
||||
struct clk *clk;
|
||||
|
||||
clk = clk_register_fixed_factor(NULL, name, parent_name, 0, mult, div);
|
||||
if (!clk)
|
||||
panic("failed to allocate %s clock structure", name);
|
||||
|
||||
return clk;
|
||||
}
|
||||
|
||||
static void __init ar724x_clk_init(struct clk *ref_clk, void __iomem *pll_base)
|
||||
{
|
||||
u32 pll;
|
||||
u32 mult, div, ddr_div, ahb_div;
|
||||
|
||||
pll = __raw_readl(pll_base + AR724X_PLL_REG_CPU_CONFIG);
|
||||
|
||||
mult = ((pll >> AR724X_PLL_FB_SHIFT) & AR724X_PLL_FB_MASK);
|
||||
div = ((pll >> AR724X_PLL_REF_DIV_SHIFT) & AR724X_PLL_REF_DIV_MASK) * 2;
|
||||
|
||||
ddr_div = ((pll >> AR724X_DDR_DIV_SHIFT) & AR724X_DDR_DIV_MASK) + 1;
|
||||
ahb_div = (((pll >> AR724X_AHB_DIV_SHIFT) & AR724X_AHB_DIV_MASK) + 1) * 2;
|
||||
|
||||
clks[ATH79_CLK_CPU] = ath79_reg_ffclk("cpu", "ref", mult, div);
|
||||
clks[ATH79_CLK_DDR] = ath79_reg_ffclk("ddr", "ref", mult, div * ddr_div);
|
||||
clks[ATH79_CLK_AHB] = ath79_reg_ffclk("ahb", "ref", mult, div * ahb_div);
|
||||
}
|
||||
|
||||
static void __init ar724x_clocks_init(void)
|
||||
{
|
||||
unsigned long ref_rate;
|
||||
unsigned long cpu_rate;
|
||||
unsigned long ddr_rate;
|
||||
unsigned long ahb_rate;
|
||||
u32 pll;
|
||||
u32 freq;
|
||||
u32 div;
|
||||
struct clk *ref_clk;
|
||||
|
||||
ref_rate = AR724X_BASE_FREQ;
|
||||
pll = ath79_pll_rr(AR724X_PLL_REG_CPU_CONFIG);
|
||||
ref_clk = ath79_add_sys_clkdev("ref", AR724X_BASE_FREQ);
|
||||
|
||||
div = ((pll >> AR724X_PLL_FB_SHIFT) & AR724X_PLL_FB_MASK);
|
||||
freq = div * ref_rate;
|
||||
ar724x_clk_init(ref_clk, ath79_pll_base);
|
||||
|
||||
div = ((pll >> AR724X_PLL_REF_DIV_SHIFT) & AR724X_PLL_REF_DIV_MASK) * 2;
|
||||
freq /= div;
|
||||
|
||||
cpu_rate = freq;
|
||||
|
||||
div = ((pll >> AR724X_DDR_DIV_SHIFT) & AR724X_DDR_DIV_MASK) + 1;
|
||||
ddr_rate = freq / div;
|
||||
|
||||
div = (((pll >> AR724X_AHB_DIV_SHIFT) & AR724X_AHB_DIV_MASK) + 1) * 2;
|
||||
ahb_rate = cpu_rate / div;
|
||||
|
||||
ath79_add_sys_clkdev("ref", ref_rate);
|
||||
clks[0] = ath79_add_sys_clkdev("cpu", cpu_rate);
|
||||
clks[1] = ath79_add_sys_clkdev("ddr", ddr_rate);
|
||||
clks[2] = ath79_add_sys_clkdev("ahb", ahb_rate);
|
||||
/* just make happy plat_time_init() from arch/mips/ath79/setup.c */
|
||||
clk_register_clkdev(clks[ATH79_CLK_CPU], "cpu", NULL);
|
||||
clk_register_clkdev(clks[ATH79_CLK_DDR], "ddr", NULL);
|
||||
clk_register_clkdev(clks[ATH79_CLK_AHB], "ahb", NULL);
|
||||
|
||||
clk_add_alias("wdt", NULL, "ahb", NULL);
|
||||
clk_add_alias("uart", NULL, "ahb", NULL);
|
||||
}
|
||||
|
||||
static void __init ar9330_clk_init(struct clk *ref_clk, void __iomem *pll_base)
|
||||
{
|
||||
u32 clock_ctrl;
|
||||
u32 ref_div;
|
||||
u32 ninit_mul;
|
||||
u32 out_div;
|
||||
|
||||
u32 cpu_div;
|
||||
u32 ddr_div;
|
||||
u32 ahb_div;
|
||||
|
||||
clock_ctrl = __raw_readl(pll_base + AR933X_PLL_CLOCK_CTRL_REG);
|
||||
if (clock_ctrl & AR933X_PLL_CLOCK_CTRL_BYPASS) {
|
||||
ref_div = 1;
|
||||
ninit_mul = 1;
|
||||
out_div = 1;
|
||||
|
||||
cpu_div = 1;
|
||||
ddr_div = 1;
|
||||
ahb_div = 1;
|
||||
} else {
|
||||
u32 cpu_config;
|
||||
u32 t;
|
||||
|
||||
cpu_config = __raw_readl(pll_base + AR933X_PLL_CPU_CONFIG_REG);
|
||||
|
||||
t = (cpu_config >> AR933X_PLL_CPU_CONFIG_REFDIV_SHIFT) &
|
||||
AR933X_PLL_CPU_CONFIG_REFDIV_MASK;
|
||||
ref_div = t;
|
||||
|
||||
ninit_mul = (cpu_config >> AR933X_PLL_CPU_CONFIG_NINT_SHIFT) &
|
||||
AR933X_PLL_CPU_CONFIG_NINT_MASK;
|
||||
|
||||
t = (cpu_config >> AR933X_PLL_CPU_CONFIG_OUTDIV_SHIFT) &
|
||||
AR933X_PLL_CPU_CONFIG_OUTDIV_MASK;
|
||||
if (t == 0)
|
||||
t = 1;
|
||||
|
||||
out_div = (1 << t);
|
||||
|
||||
cpu_div = ((clock_ctrl >> AR933X_PLL_CLOCK_CTRL_CPU_DIV_SHIFT) &
|
||||
AR933X_PLL_CLOCK_CTRL_CPU_DIV_MASK) + 1;
|
||||
|
||||
ddr_div = ((clock_ctrl >> AR933X_PLL_CLOCK_CTRL_DDR_DIV_SHIFT) &
|
||||
AR933X_PLL_CLOCK_CTRL_DDR_DIV_MASK) + 1;
|
||||
|
||||
ahb_div = ((clock_ctrl >> AR933X_PLL_CLOCK_CTRL_AHB_DIV_SHIFT) &
|
||||
AR933X_PLL_CLOCK_CTRL_AHB_DIV_MASK) + 1;
|
||||
}
|
||||
|
||||
clks[ATH79_CLK_CPU] = ath79_reg_ffclk("cpu", "ref",
|
||||
ninit_mul, ref_div * out_div * cpu_div);
|
||||
clks[ATH79_CLK_DDR] = ath79_reg_ffclk("ddr", "ref",
|
||||
ninit_mul, ref_div * out_div * ddr_div);
|
||||
clks[ATH79_CLK_AHB] = ath79_reg_ffclk("ahb", "ref",
|
||||
ninit_mul, ref_div * out_div * ahb_div);
|
||||
}
|
||||
|
||||
static void __init ar933x_clocks_init(void)
|
||||
{
|
||||
struct clk *ref_clk;
|
||||
unsigned long ref_rate;
|
||||
unsigned long cpu_rate;
|
||||
unsigned long ddr_rate;
|
||||
unsigned long ahb_rate;
|
||||
u32 clock_ctrl;
|
||||
u32 cpu_config;
|
||||
u32 freq;
|
||||
u32 t;
|
||||
|
||||
t = ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP);
|
||||
|
|
@ -139,46 +207,14 @@ static void __init ar933x_clocks_init(void)
|
|||
else
|
||||
ref_rate = (25 * 1000 * 1000);
|
||||
|
||||
clock_ctrl = ath79_pll_rr(AR933X_PLL_CLOCK_CTRL_REG);
|
||||
if (clock_ctrl & AR933X_PLL_CLOCK_CTRL_BYPASS) {
|
||||
cpu_rate = ref_rate;
|
||||
ahb_rate = ref_rate;
|
||||
ddr_rate = ref_rate;
|
||||
} else {
|
||||
cpu_config = ath79_pll_rr(AR933X_PLL_CPU_CONFIG_REG);
|
||||
ref_clk = ath79_add_sys_clkdev("ref", ref_rate);
|
||||
|
||||
t = (cpu_config >> AR933X_PLL_CPU_CONFIG_REFDIV_SHIFT) &
|
||||
AR933X_PLL_CPU_CONFIG_REFDIV_MASK;
|
||||
freq = ref_rate / t;
|
||||
ar9330_clk_init(ref_clk, ath79_pll_base);
|
||||
|
||||
t = (cpu_config >> AR933X_PLL_CPU_CONFIG_NINT_SHIFT) &
|
||||
AR933X_PLL_CPU_CONFIG_NINT_MASK;
|
||||
freq *= t;
|
||||
|
||||
t = (cpu_config >> AR933X_PLL_CPU_CONFIG_OUTDIV_SHIFT) &
|
||||
AR933X_PLL_CPU_CONFIG_OUTDIV_MASK;
|
||||
if (t == 0)
|
||||
t = 1;
|
||||
|
||||
freq >>= t;
|
||||
|
||||
t = ((clock_ctrl >> AR933X_PLL_CLOCK_CTRL_CPU_DIV_SHIFT) &
|
||||
AR933X_PLL_CLOCK_CTRL_CPU_DIV_MASK) + 1;
|
||||
cpu_rate = freq / t;
|
||||
|
||||
t = ((clock_ctrl >> AR933X_PLL_CLOCK_CTRL_DDR_DIV_SHIFT) &
|
||||
AR933X_PLL_CLOCK_CTRL_DDR_DIV_MASK) + 1;
|
||||
ddr_rate = freq / t;
|
||||
|
||||
t = ((clock_ctrl >> AR933X_PLL_CLOCK_CTRL_AHB_DIV_SHIFT) &
|
||||
AR933X_PLL_CLOCK_CTRL_AHB_DIV_MASK) + 1;
|
||||
ahb_rate = freq / t;
|
||||
}
|
||||
|
||||
ath79_add_sys_clkdev("ref", ref_rate);
|
||||
clks[0] = ath79_add_sys_clkdev("cpu", cpu_rate);
|
||||
clks[1] = ath79_add_sys_clkdev("ddr", ddr_rate);
|
||||
clks[2] = ath79_add_sys_clkdev("ahb", ahb_rate);
|
||||
/* just make happy plat_time_init() from arch/mips/ath79/setup.c */
|
||||
clk_register_clkdev(clks[ATH79_CLK_CPU], "cpu", NULL);
|
||||
clk_register_clkdev(clks[ATH79_CLK_DDR], "ddr", NULL);
|
||||
clk_register_clkdev(clks[ATH79_CLK_AHB], "ahb", NULL);
|
||||
|
||||
clk_add_alias("wdt", NULL, "ahb", NULL);
|
||||
clk_add_alias("uart", NULL, "ref", NULL);
|
||||
|
|
@ -310,9 +346,9 @@ static void __init ar934x_clocks_init(void)
|
|||
ahb_rate = cpu_pll / (postdiv + 1);
|
||||
|
||||
ath79_add_sys_clkdev("ref", ref_rate);
|
||||
clks[0] = ath79_add_sys_clkdev("cpu", cpu_rate);
|
||||
clks[1] = ath79_add_sys_clkdev("ddr", ddr_rate);
|
||||
clks[2] = ath79_add_sys_clkdev("ahb", ahb_rate);
|
||||
clks[ATH79_CLK_CPU] = ath79_add_sys_clkdev("cpu", cpu_rate);
|
||||
clks[ATH79_CLK_DDR] = ath79_add_sys_clkdev("ddr", ddr_rate);
|
||||
clks[ATH79_CLK_AHB] = ath79_add_sys_clkdev("ahb", ahb_rate);
|
||||
|
||||
clk_add_alias("wdt", NULL, "ref", NULL);
|
||||
clk_add_alias("uart", NULL, "ref", NULL);
|
||||
|
|
@ -397,9 +433,9 @@ static void __init qca955x_clocks_init(void)
|
|||
ahb_rate = cpu_pll / (postdiv + 1);
|
||||
|
||||
ath79_add_sys_clkdev("ref", ref_rate);
|
||||
clks[0] = ath79_add_sys_clkdev("cpu", cpu_rate);
|
||||
clks[1] = ath79_add_sys_clkdev("ddr", ddr_rate);
|
||||
clks[2] = ath79_add_sys_clkdev("ahb", ahb_rate);
|
||||
clks[ATH79_CLK_CPU] = ath79_add_sys_clkdev("cpu", cpu_rate);
|
||||
clks[ATH79_CLK_DDR] = ath79_add_sys_clkdev("ddr", ddr_rate);
|
||||
clks[ATH79_CLK_AHB] = ath79_add_sys_clkdev("ahb", ahb_rate);
|
||||
|
||||
clk_add_alias("wdt", NULL, "ref", NULL);
|
||||
clk_add_alias("uart", NULL, "ref", NULL);
|
||||
|
|
@ -419,8 +455,6 @@ void __init ath79_clocks_init(void)
|
|||
qca955x_clocks_init();
|
||||
else
|
||||
BUG();
|
||||
|
||||
of_clk_init(NULL);
|
||||
}
|
||||
|
||||
unsigned long __init
|
||||
|
|
@ -447,8 +481,49 @@ static void __init ath79_clocks_init_dt(struct device_node *np)
|
|||
|
||||
CLK_OF_DECLARE(ar7100, "qca,ar7100-pll", ath79_clocks_init_dt);
|
||||
CLK_OF_DECLARE(ar7240, "qca,ar7240-pll", ath79_clocks_init_dt);
|
||||
CLK_OF_DECLARE(ar9130, "qca,ar9130-pll", ath79_clocks_init_dt);
|
||||
CLK_OF_DECLARE(ar9330, "qca,ar9330-pll", ath79_clocks_init_dt);
|
||||
CLK_OF_DECLARE(ar9340, "qca,ar9340-pll", ath79_clocks_init_dt);
|
||||
CLK_OF_DECLARE(ar9550, "qca,qca9550-pll", ath79_clocks_init_dt);
|
||||
|
||||
static void __init ath79_clocks_init_dt_ng(struct device_node *np)
|
||||
{
|
||||
struct clk *ref_clk;
|
||||
void __iomem *pll_base;
|
||||
const char *dnfn = of_node_full_name(np);
|
||||
|
||||
ref_clk = of_clk_get(np, 0);
|
||||
if (IS_ERR(ref_clk)) {
|
||||
pr_err("%s: of_clk_get failed\n", dnfn);
|
||||
goto err;
|
||||
}
|
||||
|
||||
pll_base = of_iomap(np, 0);
|
||||
if (!pll_base) {
|
||||
pr_err("%s: can't map pll registers\n", dnfn);
|
||||
goto err_clk;
|
||||
}
|
||||
|
||||
if (of_device_is_compatible(np, "qca,ar9130-pll"))
|
||||
ar724x_clk_init(ref_clk, pll_base);
|
||||
else if (of_device_is_compatible(np, "qca,ar9330-pll"))
|
||||
ar9330_clk_init(ref_clk, pll_base);
|
||||
else {
|
||||
pr_err("%s: could not find any appropriate clk_init()\n", dnfn);
|
||||
goto err_clk;
|
||||
}
|
||||
|
||||
if (of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data)) {
|
||||
pr_err("%s: could not register clk provider\n", dnfn);
|
||||
goto err_clk;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
err_clk:
|
||||
clk_put(ref_clk);
|
||||
|
||||
err:
|
||||
return;
|
||||
}
|
||||
CLK_OF_DECLARE(ar9130_clk, "qca,ar9130-pll", ath79_clocks_init_dt_ng);
|
||||
CLK_OF_DECLARE(ar9330_clk, "qca,ar9330-pll", ath79_clocks_init_dt_ng);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -46,12 +46,12 @@ void ath79_ddr_ctrl_init(void)
|
|||
{
|
||||
ath79_ddr_base = ioremap_nocache(AR71XX_DDR_CTRL_BASE,
|
||||
AR71XX_DDR_CTRL_SIZE);
|
||||
if (soc_is_ar71xx() || soc_is_ar934x()) {
|
||||
ath79_ddr_wb_flush_base = ath79_ddr_base + 0x9c;
|
||||
ath79_ddr_pci_win_base = ath79_ddr_base + 0x7c;
|
||||
} else {
|
||||
if (soc_is_ar913x() || soc_is_ar724x() || soc_is_ar933x()) {
|
||||
ath79_ddr_wb_flush_base = ath79_ddr_base + 0x7c;
|
||||
ath79_ddr_pci_win_base = 0;
|
||||
} else {
|
||||
ath79_ddr_wb_flush_base = ath79_ddr_base + 0x9c;
|
||||
ath79_ddr_pci_win_base = ath79_ddr_base + 0x7c;
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ath79_ddr_ctrl_init);
|
||||
|
|
@ -76,14 +76,14 @@ void ath79_ddr_set_pci_windows(void)
|
|||
{
|
||||
BUG_ON(!ath79_ddr_pci_win_base);
|
||||
|
||||
__raw_writel(AR71XX_PCI_WIN0_OFFS, ath79_ddr_pci_win_base + 0);
|
||||
__raw_writel(AR71XX_PCI_WIN1_OFFS, ath79_ddr_pci_win_base + 1);
|
||||
__raw_writel(AR71XX_PCI_WIN2_OFFS, ath79_ddr_pci_win_base + 2);
|
||||
__raw_writel(AR71XX_PCI_WIN3_OFFS, ath79_ddr_pci_win_base + 3);
|
||||
__raw_writel(AR71XX_PCI_WIN4_OFFS, ath79_ddr_pci_win_base + 4);
|
||||
__raw_writel(AR71XX_PCI_WIN5_OFFS, ath79_ddr_pci_win_base + 5);
|
||||
__raw_writel(AR71XX_PCI_WIN6_OFFS, ath79_ddr_pci_win_base + 6);
|
||||
__raw_writel(AR71XX_PCI_WIN7_OFFS, ath79_ddr_pci_win_base + 7);
|
||||
__raw_writel(AR71XX_PCI_WIN0_OFFS, ath79_ddr_pci_win_base + 0x0);
|
||||
__raw_writel(AR71XX_PCI_WIN1_OFFS, ath79_ddr_pci_win_base + 0x4);
|
||||
__raw_writel(AR71XX_PCI_WIN2_OFFS, ath79_ddr_pci_win_base + 0x8);
|
||||
__raw_writel(AR71XX_PCI_WIN3_OFFS, ath79_ddr_pci_win_base + 0xc);
|
||||
__raw_writel(AR71XX_PCI_WIN4_OFFS, ath79_ddr_pci_win_base + 0x10);
|
||||
__raw_writel(AR71XX_PCI_WIN5_OFFS, ath79_ddr_pci_win_base + 0x14);
|
||||
__raw_writel(AR71XX_PCI_WIN6_OFFS, ath79_ddr_pci_win_base + 0x18);
|
||||
__raw_writel(AR71XX_PCI_WIN7_OFFS, ath79_ddr_pci_win_base + 0x1c);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ath79_ddr_set_pci_windows);
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#include <linux/bootmem.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/of_fdt.h>
|
||||
|
||||
|
|
@ -203,26 +204,57 @@ void __init plat_mem_setup(void)
|
|||
fdt_start = fw_getenvl("fdt_start");
|
||||
if (fdt_start)
|
||||
__dt_setup_arch((void *)KSEG0ADDR(fdt_start));
|
||||
#ifdef CONFIG_BUILTIN_DTB
|
||||
else
|
||||
__dt_setup_arch(__dtb_start);
|
||||
#endif
|
||||
else if (fw_arg0 == -2)
|
||||
__dt_setup_arch((void *)KSEG0ADDR(fw_arg1));
|
||||
|
||||
ath79_reset_base = ioremap_nocache(AR71XX_RESET_BASE,
|
||||
AR71XX_RESET_SIZE);
|
||||
ath79_pll_base = ioremap_nocache(AR71XX_PLL_BASE,
|
||||
AR71XX_PLL_SIZE);
|
||||
ath79_detect_sys_type();
|
||||
ath79_ddr_ctrl_init();
|
||||
if (mips_machtype != ATH79_MACH_GENERIC_OF) {
|
||||
ath79_reset_base = ioremap_nocache(AR71XX_RESET_BASE,
|
||||
AR71XX_RESET_SIZE);
|
||||
ath79_pll_base = ioremap_nocache(AR71XX_PLL_BASE,
|
||||
AR71XX_PLL_SIZE);
|
||||
ath79_detect_sys_type();
|
||||
ath79_ddr_ctrl_init();
|
||||
|
||||
if (mips_machtype != ATH79_MACH_GENERIC_OF)
|
||||
detect_memory_region(0, ATH79_MEM_SIZE_MIN, ATH79_MEM_SIZE_MAX);
|
||||
|
||||
_machine_restart = ath79_restart;
|
||||
/* OF machines should use the reset driver */
|
||||
_machine_restart = ath79_restart;
|
||||
}
|
||||
|
||||
_machine_halt = ath79_halt;
|
||||
pm_power_off = ath79_halt;
|
||||
}
|
||||
|
||||
static void __init ath79_of_plat_time_init(void)
|
||||
{
|
||||
struct device_node *np;
|
||||
struct clk *clk;
|
||||
unsigned long cpu_clk_rate;
|
||||
|
||||
of_clk_init(NULL);
|
||||
|
||||
np = of_get_cpu_node(0, NULL);
|
||||
if (!np) {
|
||||
pr_err("Failed to get CPU node\n");
|
||||
return;
|
||||
}
|
||||
|
||||
clk = of_clk_get(np, 0);
|
||||
if (IS_ERR(clk)) {
|
||||
pr_err("Failed to get CPU clock: %ld\n", PTR_ERR(clk));
|
||||
return;
|
||||
}
|
||||
|
||||
cpu_clk_rate = clk_get_rate(clk);
|
||||
|
||||
pr_info("CPU clock: %lu.%03lu MHz\n",
|
||||
cpu_clk_rate / 1000000, (cpu_clk_rate / 1000) % 1000);
|
||||
|
||||
mips_hpt_frequency = cpu_clk_rate / 2;
|
||||
|
||||
clk_put(clk);
|
||||
}
|
||||
|
||||
void __init plat_time_init(void)
|
||||
{
|
||||
unsigned long cpu_clk_rate;
|
||||
|
|
@ -230,6 +262,11 @@ void __init plat_time_init(void)
|
|||
unsigned long ddr_clk_rate;
|
||||
unsigned long ref_clk_rate;
|
||||
|
||||
if (IS_ENABLED(CONFIG_OF) && mips_machtype == ATH79_MACH_GENERIC_OF) {
|
||||
ath79_of_plat_time_init();
|
||||
return;
|
||||
}
|
||||
|
||||
ath79_clocks_init();
|
||||
|
||||
cpu_clk_rate = ath79_get_sys_clk_rate("cpu");
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@
|
|||
# under Linux.
|
||||
#
|
||||
|
||||
obj-y += irq.o prom.o serial.o setup.o time.o sprom.o
|
||||
obj-y += irq.o prom.o serial.o setup.o time.o
|
||||
obj-y += board.o buttons.o leds.o workarounds.o
|
||||
|
|
|
|||
|
|
@ -10,9 +10,6 @@
|
|||
/* prom.c */
|
||||
void __init bcm47xx_prom_highmem_init(void);
|
||||
|
||||
/* sprom.c */
|
||||
void bcm47xx_sprom_register_fallbacks(void);
|
||||
|
||||
/* buttons.c */
|
||||
int __init bcm47xx_buttons_register(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "bcm47xx_private.h"
|
||||
|
||||
#include <linux/bcm47xx_sprom.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/ethtool.h>
|
||||
|
|
@ -151,7 +152,6 @@ void __init plat_mem_setup(void)
|
|||
pr_info("Using bcma bus\n");
|
||||
#ifdef CONFIG_BCM47XX_BCMA
|
||||
bcm47xx_bus_type = BCM47XX_BUS_TYPE_BCMA;
|
||||
bcm47xx_sprom_register_fallbacks();
|
||||
bcm47xx_register_bcma();
|
||||
bcm47xx_set_system_type(bcm47xx_bus.bcma.bus.chipinfo.id);
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
|
|
|
|||
|
|
@ -21,6 +21,10 @@ config DT_BCM93384WVG_VIPER
|
|||
bool "BCM93384WVG Viper CPU (EXPERIMENTAL)"
|
||||
select BUILTIN_DTB
|
||||
|
||||
config DT_BCM96358NB4SER
|
||||
bool "BCM96358NB4SER"
|
||||
select BUILTIN_DTB
|
||||
|
||||
config DT_BCM96368MVWG
|
||||
bool "BCM96368MVWG"
|
||||
select BUILTIN_DTB
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue