mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle:
"This is an unusually large pull request for MIPS - in parts because
lots of patches missed the 3.18 deadline but primarily because some
folks opened the flood gates.
- Retire the MIPS-specific phys_t with the generic phys_addr_t.
- Improvments for the backtrace code used by oprofile.
- Better backtraces on SMP systems.
- Cleanups for the Octeon platform code.
- Cleanups and fixes for the Loongson platform code.
- Cleanups and fixes to the firmware library.
- Switch ATH79 platform to use the firmware library.
- Grand overhault to the SEAD3 and Malta interrupt code.
- Move the GIC interrupt code to drivers/irqchip
- Lots of GIC cleanups and updates to the GIC code to use modern IRQ
infrastructures and features of the kernel.
- OF documentation updates for the GIC bindings
- Move GIC clocksource driver to drivers/clocksource
- Merge GIC clocksource driver with clockevent driver.
- Further updates to bring the GIC clocksource driver up to date.
- R3000 TLB code cleanups
- Improvments to the Loongson 3 platform code.
- Convert pr_warning to pr_warn.
- Merge a bunch of small lantiq and ralink fixes that have been
staged/lingering inside the openwrt tree for a while.
- Update archhelp for IP22/IP32
- Fix a number of issues for Loongson 1B.
- New clocksource and clockevent driver for Loongson 1B.
- Further work on clk handling for Loongson 1B.
- Platform work for Broadcom BMIPS.
- Error handling cleanups for TurboChannel.
- Fixes and optimization to the microMIPS support.
- Option to disable the FTLB.
- Dump more relevant information on machine check exception
- Change binfmt to allow arch to examine PT_*PROC headers
- Support for new style FPU register model in O32
- VDSO randomization.
- BCM47xx cleanups
- BCM47xx reimplement the way the kernel accesses NVRAM information.
- Random cleanups
- Add support for ATH25 platforms
- Remove pointless locking code in some PCI platforms.
- Some improvments to EVA support
- Minor Alchemy cleanup"
* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (185 commits)
MIPS: Add MFHC0 and MTHC0 instructions to uasm.
MIPS: Cosmetic cleanups of page table headers.
MIPS: Add CP0 macros for extended EntryLo registers
MIPS: Remove now unused definition of phys_t.
MIPS: Replace use of phys_t with phys_addr_t.
MIPS: Replace MIPS-specific 64BIT_PHYS_ADDR with generic PHYS_ADDR_T_64BIT
PCMCIA: Alchemy Don't select 64BIT_PHYS_ADDR in Kconfig.
MIPS: lib: memset: Clean up some MIPS{EL,EB} ifdefery
MIPS: iomap: Use __mem_{read,write}{b,w,l} for MMIO
MIPS: <asm/types.h> fix indentation.
MAINTAINERS: Add entry for BMIPS multiplatform kernel
MIPS: Enable VDSO randomization
MIPS: Remove a temporary hack for debugging cache flushes in SMTC configuration
MIPS: Remove declaration of obsolete arch_init_clk_ops()
MIPS: atomic.h: Reformat to fit in 79 columns
MIPS: Apply `.insn' to fixup labels throughout
MIPS: Fix microMIPS LL/SC immediate offsets
MIPS: Kconfig: Only allow 32-bit microMIPS builds
MIPS: signal.c: Fix an invalid cast in ISA mode bit handling
MIPS: mm: Only build one microassembler that is suitable
...
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
MIPS Global Interrupt Controller (GIC)
|
||||
|
||||
The MIPS GIC routes external interrupts to individual VPEs and IRQ pins.
|
||||
It also supports local (per-processor) interrupts and software-generated
|
||||
interrupts which can be used as IPIs. The GIC also includes a free-running
|
||||
global timer, per-CPU count/compare timers, and a watchdog.
|
||||
|
||||
Required properties:
|
||||
- compatible : Should be "mti,gic".
|
||||
- interrupt-controller : Identifies the node as an interrupt controller
|
||||
- #interrupt-cells : Specifies the number of cells needed to encode an
|
||||
interrupt specifier. Should be 3.
|
||||
- The first cell is the type of interrupt, local or shared.
|
||||
See <include/dt-bindings/interrupt-controller/mips-gic.h>.
|
||||
- The second cell is the GIC interrupt number.
|
||||
- The third cell encodes the interrupt flags.
|
||||
See <include/dt-bindings/interrupt-controller/irq.h> for a list of valid
|
||||
flags.
|
||||
|
||||
Optional properties:
|
||||
- reg : Base address and length of the GIC registers. If not present,
|
||||
the base address reported by the hardware GCR_GIC_BASE will be used.
|
||||
- mti,reserved-cpu-vectors : Specifies the list of CPU interrupt vectors
|
||||
to which the GIC may not route interrupts. Valid values are 2 - 7.
|
||||
This property is ignored if the CPU is started in EIC mode.
|
||||
|
||||
Required properties for timer sub-node:
|
||||
- compatible : Should be "mti,gic-timer".
|
||||
- interrupts : Interrupt for the GIC local timer.
|
||||
- clock-frequency : Clock frequency at which the GIC timers operate.
|
||||
|
||||
Example:
|
||||
|
||||
gic: interrupt-controller@1bdc0000 {
|
||||
compatible = "mti,gic";
|
||||
reg = <0x1bdc0000 0x20000>;
|
||||
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <3>;
|
||||
|
||||
mti,reserved-cpu-vectors = <7>;
|
||||
|
||||
timer {
|
||||
compatible = "mti,gic-timer";
|
||||
interrupts = <GIC_LOCAL 1 IRQ_TYPE_NONE>;
|
||||
clock-frequency = <50000000>;
|
||||
};
|
||||
};
|
||||
|
||||
uart@18101400 {
|
||||
...
|
||||
interrupt-parent = <&gic>;
|
||||
interrupts = <GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH>;
|
||||
...
|
||||
};
|
||||
37
Documentation/devicetree/bindings/mips/brcm/bcm3384-intc.txt
Normal file
37
Documentation/devicetree/bindings/mips/brcm/bcm3384-intc.txt
Normal file
@@ -0,0 +1,37 @@
|
||||
* Interrupt Controller
|
||||
|
||||
Properties:
|
||||
- compatible: "brcm,bcm3384-intc"
|
||||
|
||||
Compatibility with BCM3384 and possibly other BCM33xx/BCM63xx SoCs.
|
||||
|
||||
- reg: Address/length pairs for each mask/status register set. Length must
|
||||
be 8. If multiple register sets are specified, the first set will
|
||||
handle IRQ offsets 0..31, the second set 32..63, and so on.
|
||||
|
||||
- interrupt-controller: This is an interrupt controller.
|
||||
|
||||
- #interrupt-cells: Must be <1>. Just a simple IRQ offset; no level/edge
|
||||
or polarity configuration is possible with this controller.
|
||||
|
||||
- interrupt-parent: This controller is cascaded from a MIPS CPU HW IRQ, or
|
||||
from another INTC.
|
||||
|
||||
- interrupts: The IRQ on the parent controller.
|
||||
|
||||
Example:
|
||||
periph_intc: periph_intc@14e00038 {
|
||||
compatible = "brcm,bcm3384-intc";
|
||||
|
||||
/*
|
||||
* IRQs 0..31: mask reg 0x14e00038, status reg 0x14e0003c
|
||||
* IRQs 32..63: mask reg 0x14e00340, status reg 0x14e00344
|
||||
*/
|
||||
reg = <0x14e00038 0x8 0x14e00340 0x8>;
|
||||
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <1>;
|
||||
|
||||
interrupt-parent = <&cpu_intc>;
|
||||
interrupts = <4>;
|
||||
};
|
||||
8
Documentation/devicetree/bindings/mips/brcm/bmips.txt
Normal file
8
Documentation/devicetree/bindings/mips/brcm/bmips.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
* Broadcom MIPS (BMIPS) CPUs
|
||||
|
||||
Required properties:
|
||||
- compatible: "brcm,bmips3300", "brcm,bmips4350", "brcm,bmips4380",
|
||||
"brcm,bmips5000"
|
||||
|
||||
- mips-hpt-frequency: This is common to all CPUs in the system so it lives
|
||||
under the "cpus" node.
|
||||
11
Documentation/devicetree/bindings/mips/brcm/cm-dsl.txt
Normal file
11
Documentation/devicetree/bindings/mips/brcm/cm-dsl.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
* Broadcom cable/DSL platforms
|
||||
|
||||
SoCs:
|
||||
|
||||
Required properties:
|
||||
- compatible: "brcm,bcm3384", "brcm,bcm33843"
|
||||
|
||||
Boards:
|
||||
|
||||
Required properties:
|
||||
- compatible: "brcm,bcm93384wvg"
|
||||
11
Documentation/devicetree/bindings/mips/brcm/usb.txt
Normal file
11
Documentation/devicetree/bindings/mips/brcm/usb.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
* Broadcom USB controllers
|
||||
|
||||
Required properties:
|
||||
- compatible: "brcm,bcm3384-ohci", "brcm,bcm3384-ehci"
|
||||
|
||||
These currently use the generic-ohci and generic-ehci drivers. On some
|
||||
systems, special handling may be needed in the following cases:
|
||||
|
||||
- Restoring state after systemwide power save modes
|
||||
- Sharing PHYs with the USBD (UDC) hardware
|
||||
- Figuring out which controllers are disabled on ASIC bondout variants
|
||||
@@ -1,6 +1,6 @@
|
||||
MIPS CPU interrupt controller
|
||||
|
||||
On MIPS the mips_cpu_intc_init() helper can be used to initialize the 8 CPU
|
||||
On MIPS the mips_cpu_irq_of_init() helper can be used to initialize the 8 CPU
|
||||
IRQs from a devicetree file and create a irq_domain for IRQ controller.
|
||||
|
||||
With the irq_domain in place we can describe how the 8 IRQs are wired to the
|
||||
@@ -36,7 +36,7 @@ Example devicetree:
|
||||
|
||||
Example platform irq.c:
|
||||
static struct of_device_id __initdata of_irq_ids[] = {
|
||||
{ .compatible = "mti,cpu-interrupt-controller", .data = mips_cpu_intc_init },
|
||||
{ .compatible = "mti,cpu-interrupt-controller", .data = mips_cpu_irq_of_init },
|
||||
{ .compatible = "ralink,rt2880-intc", .data = intc_of_init },
|
||||
{},
|
||||
};
|
||||
|
||||
@@ -101,6 +101,7 @@ mitsubishi Mitsubishi Electric Corporation
|
||||
mosaixtech Mosaix Technologies, Inc.
|
||||
moxa Moxa
|
||||
mpl MPL AG
|
||||
mti Imagination Technologies Ltd. (formerly MIPS Technologies Inc.)
|
||||
mundoreader Mundo Reader S.L.
|
||||
murata Murata Manufacturing Co., Ltd.
|
||||
mxicy Macronix International Co., Ltd.
|
||||
|
||||
26
MAINTAINERS
26
MAINTAINERS
@@ -2085,6 +2085,14 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/rpi/linux-rpi.git
|
||||
S: Maintained
|
||||
N: bcm2835
|
||||
|
||||
BROADCOM BCM33XX MIPS ARCHITECTURE
|
||||
M: Kevin Cernekee <cernekee@gmail.com>
|
||||
L: linux-mips@linux-mips.org
|
||||
S: Maintained
|
||||
F: arch/mips/bcm3384/*
|
||||
F: arch/mips/include/asm/mach-bcm3384/*
|
||||
F: arch/mips/kernel/*bmips*
|
||||
|
||||
BROADCOM BCM5301X ARM ARCHITECTURE
|
||||
M: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
L: linux-arm-kernel@lists.infradead.org
|
||||
@@ -2101,6 +2109,12 @@ S: Maintained
|
||||
F: arch/arm/mach-bcm/bcm63xx.c
|
||||
F: arch/arm/include/debug/bcm63xx.S
|
||||
|
||||
BROADCOM BCM63XX/BCM33XX UDC DRIVER
|
||||
M: Kevin Cernekee <cernekee@gmail.com>
|
||||
L: linux-usb@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/usb/gadget/udc/bcm63xx_udc.*
|
||||
|
||||
BROADCOM BCM7XXX ARM ARCHITECTURE
|
||||
M: Marc Carino <marc.ceeeee@gmail.com>
|
||||
M: Brian Norris <computersforpeace@gmail.com>
|
||||
@@ -2112,6 +2126,18 @@ F: arch/arm/mach-bcm/*brcmstb*
|
||||
F: arch/arm/boot/dts/bcm7*.dts*
|
||||
F: drivers/bus/brcmstb_gisb.c
|
||||
|
||||
BROADCOM BMIPS MIPS ARCHITECTURE
|
||||
M: Kevin Cernekee <cernekee@gmail.com>
|
||||
M: Florian Fainelli <f.fainelli@gmail.com>
|
||||
L: linux-mips@linux-mips.org
|
||||
S: Maintained
|
||||
F: arch/mips/bmips/*
|
||||
F: arch/mips/include/asm/mach-bmips/*
|
||||
F: arch/mips/kernel/*bmips*
|
||||
F: arch/mips/boot/dts/bcm*.dts*
|
||||
F: drivers/irqchip/irq-bcm7*
|
||||
F: drivers/irqchip/irq-brcmstb*
|
||||
|
||||
BROADCOM TG3 GIGABIT ETHERNET DRIVER
|
||||
M: Prashant Sreedharan <prashant@broadcom.com>
|
||||
M: Michael Chan <mchan@broadcom.com>
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
platforms += alchemy
|
||||
platforms += ar7
|
||||
platforms += ath25
|
||||
platforms += ath79
|
||||
platforms += bcm3384
|
||||
platforms += bcm47xx
|
||||
platforms += bcm63xx
|
||||
platforms += cavium-octeon
|
||||
|
||||
@@ -53,6 +53,7 @@ config MIPS
|
||||
select HAVE_CC_STACKPROTECTOR
|
||||
select CPU_PM if CPU_IDLE
|
||||
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
|
||||
select ARCH_BINFMT_ELF_STATE
|
||||
|
||||
menu "Machine selection"
|
||||
|
||||
@@ -62,7 +63,7 @@ choice
|
||||
|
||||
config MIPS_ALCHEMY
|
||||
bool "Alchemy processor based machines"
|
||||
select 64BIT_PHYS_ADDR
|
||||
select ARCH_PHYS_ADDR_T_64BIT
|
||||
select CEVT_R4K
|
||||
select CSRC_R4K
|
||||
select IRQ_CPU
|
||||
@@ -96,6 +97,20 @@ config AR7
|
||||
Support for the Texas Instruments AR7 System-on-a-Chip
|
||||
family: TNETD7100, 7200 and 7300.
|
||||
|
||||
config ATH25
|
||||
bool "Atheros AR231x/AR531x SoC support"
|
||||
select CEVT_R4K
|
||||
select CSRC_R4K
|
||||
select DMA_NONCOHERENT
|
||||
select IRQ_CPU
|
||||
select IRQ_DOMAIN
|
||||
select SYS_HAS_CPU_MIPS32_R1
|
||||
select SYS_SUPPORTS_BIG_ENDIAN
|
||||
select SYS_SUPPORTS_32BIT_KERNEL
|
||||
select SYS_HAS_EARLY_PRINTK
|
||||
help
|
||||
Support for Atheros AR231x and Atheros AR531x based boards
|
||||
|
||||
config ATH79
|
||||
bool "Atheros AR71XX/AR724X/AR913X based boards"
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
@@ -115,6 +130,32 @@ config ATH79
|
||||
help
|
||||
Support for the Atheros AR71XX/AR724X/AR913X SoCs.
|
||||
|
||||
config BCM3384
|
||||
bool "Broadcom BCM3384 based boards"
|
||||
select BOOT_RAW
|
||||
select NO_EXCEPT_FILL
|
||||
select USE_OF
|
||||
select CEVT_R4K
|
||||
select CSRC_R4K
|
||||
select SYNC_R4K
|
||||
select COMMON_CLK
|
||||
select DMA_NONCOHERENT
|
||||
select IRQ_CPU
|
||||
select SYS_SUPPORTS_32BIT_KERNEL
|
||||
select SYS_SUPPORTS_BIG_ENDIAN
|
||||
select SYS_SUPPORTS_HIGHMEM
|
||||
select SYS_HAS_CPU_BMIPS5000
|
||||
select SWAP_IO_SPACE
|
||||
select USB_EHCI_BIG_ENDIAN_DESC
|
||||
select USB_EHCI_BIG_ENDIAN_MMIO
|
||||
select USB_OHCI_BIG_ENDIAN_DESC
|
||||
select USB_OHCI_BIG_ENDIAN_MMIO
|
||||
help
|
||||
Support for BCM3384 based boards. BCM3384/BCM33843 is a cable modem
|
||||
chipset with a Linux application processor that is often used to
|
||||
provide Samba services, a CUPS print server, and/or advanced routing
|
||||
features.
|
||||
|
||||
config BCM47XX
|
||||
bool "Broadcom BCM47XX based boards"
|
||||
select ARCH_WANT_OPTIONAL_GPIOLIB
|
||||
@@ -269,6 +310,8 @@ config LANTIQ
|
||||
select USE_OF
|
||||
select PINCTRL
|
||||
select PINCTRL_LANTIQ
|
||||
select ARCH_HAS_RESET_CONTROLLER
|
||||
select RESET_CONTROLLER
|
||||
|
||||
config LASAT
|
||||
bool "LASAT Networks platforms"
|
||||
@@ -315,17 +358,18 @@ config MIPS_MALTA
|
||||
select BOOT_RAW
|
||||
select CEVT_R4K
|
||||
select CSRC_R4K
|
||||
select CSRC_GIC
|
||||
select CLKSRC_MIPS_GIC
|
||||
select DMA_MAYBE_COHERENT
|
||||
select GENERIC_ISA_DMA
|
||||
select HAVE_PCSPKR_PLATFORM
|
||||
select IRQ_CPU
|
||||
select IRQ_GIC
|
||||
select MIPS_GIC
|
||||
select HW_HAS_PCI
|
||||
select I8253
|
||||
select I8259
|
||||
select MIPS_BONITO64
|
||||
select MIPS_CPU_SCACHE
|
||||
select MIPS_L1_CACHE_SHIFT_6
|
||||
select PCI_GT64XXX_PCI0
|
||||
select MIPS_MSC
|
||||
select SWAP_IO_SPACE
|
||||
@@ -340,6 +384,7 @@ config MIPS_MALTA
|
||||
select SYS_SUPPORTS_64BIT_KERNEL
|
||||
select SYS_SUPPORTS_BIG_ENDIAN
|
||||
select SYS_SUPPORTS_LITTLE_ENDIAN
|
||||
select SYS_SUPPORTS_MICROMIPS
|
||||
select SYS_SUPPORTS_MIPS_CMP
|
||||
select SYS_SUPPORTS_MIPS_CPS
|
||||
select SYS_SUPPORTS_MIPS16
|
||||
@@ -357,12 +402,12 @@ config MIPS_SEAD3
|
||||
select BUILTIN_DTB
|
||||
select CEVT_R4K
|
||||
select CSRC_R4K
|
||||
select CSRC_GIC
|
||||
select CLKSRC_MIPS_GIC
|
||||
select CPU_MIPSR2_IRQ_VI
|
||||
select CPU_MIPSR2_IRQ_EI
|
||||
select DMA_NONCOHERENT
|
||||
select IRQ_CPU
|
||||
select IRQ_GIC
|
||||
select MIPS_GIC
|
||||
select LIBFDT
|
||||
select MIPS_MSC
|
||||
select SYS_HAS_CPU_MIPS32_R1
|
||||
@@ -726,7 +771,7 @@ config MIKROTIK_RB532
|
||||
config CAVIUM_OCTEON_SOC
|
||||
bool "Cavium Networks Octeon SoC based boards"
|
||||
select CEVT_R4K
|
||||
select 64BIT_PHYS_ADDR
|
||||
select ARCH_PHYS_ADDR_T_64BIT
|
||||
select DMA_COHERENT
|
||||
select SYS_SUPPORTS_64BIT_KERNEL
|
||||
select SYS_SUPPORTS_BIG_ENDIAN
|
||||
@@ -768,7 +813,7 @@ config NLM_XLR_BOARD
|
||||
select SWAP_IO_SPACE
|
||||
select SYS_SUPPORTS_32BIT_KERNEL
|
||||
select SYS_SUPPORTS_64BIT_KERNEL
|
||||
select 64BIT_PHYS_ADDR
|
||||
select ARCH_PHYS_ADDR_T_64BIT
|
||||
select SYS_SUPPORTS_BIG_ENDIAN
|
||||
select SYS_SUPPORTS_HIGHMEM
|
||||
select DMA_COHERENT
|
||||
@@ -794,7 +839,7 @@ config NLM_XLP_BOARD
|
||||
select HW_HAS_PCI
|
||||
select SYS_SUPPORTS_32BIT_KERNEL
|
||||
select SYS_SUPPORTS_64BIT_KERNEL
|
||||
select 64BIT_PHYS_ADDR
|
||||
select ARCH_PHYS_ADDR_T_64BIT
|
||||
select SYS_SUPPORTS_BIG_ENDIAN
|
||||
select SYS_SUPPORTS_LITTLE_ENDIAN
|
||||
select SYS_SUPPORTS_HIGHMEM
|
||||
@@ -835,6 +880,7 @@ config MIPS_PARAVIRT
|
||||
endchoice
|
||||
|
||||
source "arch/mips/alchemy/Kconfig"
|
||||
source "arch/mips/ath25/Kconfig"
|
||||
source "arch/mips/ath79/Kconfig"
|
||||
source "arch/mips/bcm47xx/Kconfig"
|
||||
source "arch/mips/bcm63xx/Kconfig"
|
||||
@@ -907,10 +953,6 @@ config CEVT_GT641XX
|
||||
config CEVT_R4K
|
||||
bool
|
||||
|
||||
config CEVT_GIC
|
||||
select MIPS_CM
|
||||
bool
|
||||
|
||||
config CEVT_SB1250
|
||||
bool
|
||||
|
||||
@@ -926,10 +968,6 @@ config CSRC_IOASIC
|
||||
config CSRC_R4K
|
||||
bool
|
||||
|
||||
config CSRC_GIC
|
||||
select MIPS_CM
|
||||
bool
|
||||
|
||||
config CSRC_SB1250
|
||||
bool
|
||||
|
||||
@@ -941,7 +979,7 @@ config FW_CFE
|
||||
bool
|
||||
|
||||
config ARCH_DMA_ADDR_T_64BIT
|
||||
def_bool (HIGHMEM && 64BIT_PHYS_ADDR) || 64BIT
|
||||
def_bool (HIGHMEM && ARCH_PHYS_ADDR_T_64BIT) || 64BIT
|
||||
|
||||
config DMA_MAYBE_COHERENT
|
||||
select DMA_NONCOHERENT
|
||||
@@ -975,6 +1013,7 @@ config SYS_SUPPORTS_HOTPLUG_CPU
|
||||
|
||||
config I8259
|
||||
bool
|
||||
select IRQ_DOMAIN
|
||||
|
||||
config MIPS_BONITO64
|
||||
bool
|
||||
@@ -1055,6 +1094,7 @@ config MIPS_HUGE_TLB_SUPPORT
|
||||
|
||||
config IRQ_CPU
|
||||
bool
|
||||
select IRQ_DOMAIN
|
||||
|
||||
config IRQ_CPU_RM7K
|
||||
bool
|
||||
@@ -1071,10 +1111,6 @@ config IRQ_TXX9
|
||||
config IRQ_GT641XX
|
||||
bool
|
||||
|
||||
config IRQ_GIC
|
||||
select MIPS_CM
|
||||
bool
|
||||
|
||||
config PCI_GT64XXX_PCI0
|
||||
bool
|
||||
|
||||
@@ -1574,6 +1610,7 @@ config CPU_LOONGSON1
|
||||
select CPU_HAS_PREFETCH
|
||||
select CPU_SUPPORTS_32BIT_KERNEL
|
||||
select CPU_SUPPORTS_HIGHMEM
|
||||
select CPU_SUPPORTS_CPUFREQ
|
||||
|
||||
config CPU_BMIPS32_3300
|
||||
select SMP_UP if SMP
|
||||
@@ -1586,12 +1623,14 @@ config CPU_BMIPS4350
|
||||
|
||||
config CPU_BMIPS4380
|
||||
bool
|
||||
select MIPS_L1_CACHE_SHIFT_6
|
||||
select SYS_SUPPORTS_SMP
|
||||
select SYS_SUPPORTS_HOTPLUG_CPU
|
||||
|
||||
config CPU_BMIPS5000
|
||||
bool
|
||||
select MIPS_CPU_SCACHE
|
||||
select MIPS_L1_CACHE_SHIFT_7
|
||||
select SYS_SUPPORTS_SMP
|
||||
select SYS_SUPPORTS_HOTPLUG_CPU
|
||||
|
||||
@@ -1886,15 +1925,6 @@ config FORCE_MAX_ZONEORDER
|
||||
The page size is not necessarily 4KB. Keep this in mind
|
||||
when choosing a value for this option.
|
||||
|
||||
config CEVT_GIC
|
||||
bool "Use GIC global counter for clock events"
|
||||
depends on IRQ_GIC && !MIPS_SEAD3
|
||||
help
|
||||
Use the GIC global counter for the clock events. The R4K clock
|
||||
event driver is always present, so if the platform ends up not
|
||||
detecting a GIC, it will fall back to the R4K timer for the
|
||||
generation of clock events.
|
||||
|
||||
config BOARD_SCACHE
|
||||
bool
|
||||
|
||||
@@ -1908,7 +1938,6 @@ config IP22_CPU_SCACHE
|
||||
config MIPS_CPU_SCACHE
|
||||
bool
|
||||
select BOARD_SCACHE
|
||||
select MIPS_L1_CACHE_SHIFT_6
|
||||
|
||||
config R5000_CPU_SCACHE
|
||||
bool
|
||||
@@ -2095,11 +2124,8 @@ config SB1_PASS_2_1_WORKAROUNDS
|
||||
default y
|
||||
|
||||
|
||||
config 64BIT_PHYS_ADDR
|
||||
bool
|
||||
|
||||
config ARCH_PHYS_ADDR_T_64BIT
|
||||
def_bool 64BIT_PHYS_ADDR
|
||||
bool
|
||||
|
||||
choice
|
||||
prompt "SmartMIPS or microMIPS ASE support"
|
||||
@@ -2122,7 +2148,7 @@ config CPU_HAS_SMARTMIPS
|
||||
here.
|
||||
|
||||
config CPU_MICROMIPS
|
||||
depends on SYS_SUPPORTS_MICROMIPS
|
||||
depends on 32BIT && SYS_SUPPORTS_MICROMIPS
|
||||
bool "microMIPS"
|
||||
help
|
||||
When this option is enabled the kernel will be built using the
|
||||
|
||||
@@ -122,4 +122,17 @@ config SPINLOCK_TEST
|
||||
help
|
||||
Add several files to the debugfs to test spinlock speed.
|
||||
|
||||
config FP32XX_HYBRID_FPRS
|
||||
bool "Run FP32 & FPXX code with hybrid FPRs"
|
||||
depends on MIPS_O32_FP64_SUPPORT
|
||||
help
|
||||
The hybrid FPR scheme is normally used only when a program needs to
|
||||
execute a mix of FP32 & FP64A code, since the trapping & emulation
|
||||
that it entails is expensive. When enabled, this option will lead
|
||||
to the kernel running programs which use the FP32 & FPXX FP ABIs
|
||||
using the hybrid FPR scheme, which can be useful for debugging
|
||||
purposes.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -380,6 +380,7 @@ define archhelp
|
||||
echo ' vmlinux.ecoff - ECOFF boot image'
|
||||
echo ' vmlinux.bin - Raw binary boot image'
|
||||
echo ' vmlinux.srec - SREC boot image'
|
||||
echo ' vmlinux.32 - 64-bit boot image wrapped in 32bits (IP22/IP32)'
|
||||
echo ' vmlinuz - Compressed boot(zboot) image'
|
||||
echo ' vmlinuz.ecoff - ECOFF zboot image'
|
||||
echo ' vmlinuz.bin - Raw binary zboot image'
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include <linux/io.h>
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/clkdev.h>
|
||||
#include <linux/clk-private.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/types.h>
|
||||
@@ -397,10 +396,10 @@ static long alchemy_clk_fgcs_detr(struct clk_hw *hw, unsigned long rate,
|
||||
break;
|
||||
|
||||
/* if this parent is currently unused, remember it.
|
||||
* XXX: I know it's a layering violation, but it works
|
||||
* so well.. (if (!clk_has_active_children(pc)) )
|
||||
* XXX: we would actually want clk_has_active_children()
|
||||
* but this is a good-enough approximation for now.
|
||||
*/
|
||||
if (pc->prepare_count == 0) {
|
||||
if (!__clk_is_prepared(pc)) {
|
||||
if (!free)
|
||||
free = pc;
|
||||
}
|
||||
|
||||
@@ -70,9 +70,9 @@ void __init plat_mem_setup(void)
|
||||
iomem_resource.end = IOMEM_RESOURCE_END;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_PCI)
|
||||
#if defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_PCI)
|
||||
/* This routine should be valid for all Au1x based boards */
|
||||
phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size)
|
||||
phys_addr_t __fixup_bigphys_addr(phys_addr_t phys_addr, phys_addr_t size)
|
||||
{
|
||||
unsigned long start = ALCHEMY_PCI_MEMWIN_START;
|
||||
unsigned long end = ALCHEMY_PCI_MEMWIN_END;
|
||||
@@ -83,7 +83,7 @@ phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size)
|
||||
|
||||
/* Check for PCI memory window */
|
||||
if (phys_addr >= start && (phys_addr + size - 1) <= end)
|
||||
return (phys_t)(AU1500_PCI_MEM_PHYS_ADDR + phys_addr);
|
||||
return (phys_addr_t)(AU1500_PCI_MEM_PHYS_ADDR + phys_addr);
|
||||
|
||||
/* default nop */
|
||||
return phys_addr;
|
||||
|
||||
@@ -311,8 +311,7 @@ static void __init cpmac_get_mac(int instance, unsigned char *dev_addr)
|
||||
&dev_addr[0], &dev_addr[1],
|
||||
&dev_addr[2], &dev_addr[3],
|
||||
&dev_addr[4], &dev_addr[5]) != 6) {
|
||||
pr_warning("cannot parse mac address, "
|
||||
"using random address\n");
|
||||
pr_warn("cannot parse mac address, using random address\n");
|
||||
eth_random_addr(dev_addr);
|
||||
}
|
||||
} else
|
||||
@@ -665,7 +664,7 @@ static int __init ar7_register_devices(void)
|
||||
|
||||
res = platform_device_register(&physmap_flash);
|
||||
if (res)
|
||||
pr_warning("unable to register physmap-flash: %d\n", res);
|
||||
pr_warn("unable to register physmap-flash: %d\n", res);
|
||||
|
||||
if (ar7_is_titan())
|
||||
titan_fixup_devices();
|
||||
@@ -673,13 +672,13 @@ static int __init ar7_register_devices(void)
|
||||
ar7_device_disable(vlynq_low_data.reset_bit);
|
||||
res = platform_device_register(&vlynq_low);
|
||||
if (res)
|
||||
pr_warning("unable to register vlynq-low: %d\n", res);
|
||||
pr_warn("unable to register vlynq-low: %d\n", res);
|
||||
|
||||
if (ar7_has_high_vlynq()) {
|
||||
ar7_device_disable(vlynq_high_data.reset_bit);
|
||||
res = platform_device_register(&vlynq_high);
|
||||
if (res)
|
||||
pr_warning("unable to register vlynq-high: %d\n", res);
|
||||
pr_warn("unable to register vlynq-high: %d\n", res);
|
||||
}
|
||||
|
||||
if (ar7_has_high_cpmac()) {
|
||||
@@ -689,9 +688,10 @@ static int __init ar7_register_devices(void)
|
||||
|
||||
res = platform_device_register(&cpmac_high);
|
||||
if (res)
|
||||
pr_warning("unable to register cpmac-high: %d\n", res);
|
||||
pr_warn("unable to register cpmac-high: %d\n",
|
||||
res);
|
||||
} else
|
||||
pr_warning("unable to add cpmac-high phy: %d\n", res);
|
||||
pr_warn("unable to add cpmac-high phy: %d\n", res);
|
||||
} else
|
||||
cpmac_low_data.phy_mask = 0xffffffff;
|
||||
|
||||
@@ -700,18 +700,18 @@ static int __init ar7_register_devices(void)
|
||||
cpmac_get_mac(0, cpmac_low_data.dev_addr);
|
||||
res = platform_device_register(&cpmac_low);
|
||||
if (res)
|
||||
pr_warning("unable to register cpmac-low: %d\n", res);
|
||||
pr_warn("unable to register cpmac-low: %d\n", res);
|
||||
} else
|
||||
pr_warning("unable to add cpmac-low phy: %d\n", res);
|
||||
pr_warn("unable to add cpmac-low phy: %d\n", res);
|
||||
|
||||
detect_leds();
|
||||
res = platform_device_register(&ar7_gpio_leds);
|
||||
if (res)
|
||||
pr_warning("unable to register leds: %d\n", res);
|
||||
pr_warn("unable to register leds: %d\n", res);
|
||||
|
||||
res = platform_device_register(&ar7_udc);
|
||||
if (res)
|
||||
pr_warning("unable to register usb slave: %d\n", res);
|
||||
pr_warn("unable to register usb slave: %d\n", res);
|
||||
|
||||
/* Register watchdog only if enabled in hardware */
|
||||
bootcr = ioremap_nocache(AR7_REGS_DCL, 4);
|
||||
@@ -726,7 +726,7 @@ static int __init ar7_register_devices(void)
|
||||
ar7_wdt_res.end = ar7_wdt_res.start + 0x20;
|
||||
res = platform_device_register(&ar7_wdt);
|
||||
if (res)
|
||||
pr_warning("unable to register watchdog: %d\n", res);
|
||||
pr_warn("unable to register watchdog: %d\n", res);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
16
arch/mips/ath25/Kconfig
Normal file
16
arch/mips/ath25/Kconfig
Normal file
@@ -0,0 +1,16 @@
|
||||
config SOC_AR5312
|
||||
bool "Atheros AR5312/AR2312+ SoC support"
|
||||
depends on ATH25
|
||||
default y
|
||||
|
||||
config SOC_AR2315
|
||||
bool "Atheros AR2315+ SoC support"
|
||||
depends on ATH25
|
||||
default y
|
||||
|
||||
config PCI_AR2315
|
||||
bool "Atheros AR2315 PCI controller support"
|
||||
depends on SOC_AR2315
|
||||
select HW_HAS_PCI
|
||||
select PCI
|
||||
default y
|
||||
16
arch/mips/ath25/Makefile
Normal file
16
arch/mips/ath25/Makefile
Normal file
@@ -0,0 +1,16 @@
|
||||
#
|
||||
# This file is subject to the terms and conditions of the GNU General Public
|
||||
# License. See the file "COPYING" in the main directory of this archive
|
||||
# for more details.
|
||||
#
|
||||
# Copyright (C) 2006 FON Technology, SL.
|
||||
# Copyright (C) 2006 Imre Kaloz <kaloz@openwrt.org>
|
||||
# Copyright (C) 2006-2009 Felix Fietkau <nbd@openwrt.org>
|
||||
#
|
||||
|
||||
obj-y += board.o prom.o devices.o
|
||||
|
||||
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
|
||||
|
||||
obj-$(CONFIG_SOC_AR5312) += ar5312.o
|
||||
obj-$(CONFIG_SOC_AR2315) += ar2315.o
|
||||
6
arch/mips/ath25/Platform
Normal file
6
arch/mips/ath25/Platform
Normal file
@@ -0,0 +1,6 @@
|
||||
#
|
||||
# Atheros AR531X/AR231X WiSoC
|
||||
#
|
||||
platform-$(CONFIG_ATH25) += ath25/
|
||||
cflags-$(CONFIG_ATH25) += -I$(srctree)/arch/mips/include/asm/mach-ath25
|
||||
load-$(CONFIG_ATH25) += 0xffffffff80041000
|
||||
364
arch/mips/ath25/ar2315.c
Normal file
364
arch/mips/ath25/ar2315.c
Normal file
@@ -0,0 +1,364 @@
|
||||
/*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 2003 Atheros Communications, Inc., All Rights Reserved.
|
||||
* Copyright (C) 2006 FON Technology, SL.
|
||||
* Copyright (C) 2006 Imre Kaloz <kaloz@openwrt.org>
|
||||
* Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
|
||||
* Copyright (C) 2012 Alexandros C. Couloumbis <alex@ozo.com>
|
||||
*/
|
||||
|
||||
/*
|
||||
* Platform devices for Atheros AR2315 SoCs
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/irqdomain.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/reboot.h>
|
||||
#include <asm/bootinfo.h>
|
||||
#include <asm/reboot.h>
|
||||
#include <asm/time.h>
|
||||
|
||||
#include <ath25_platform.h>
|
||||
|
||||
#include "devices.h"
|
||||
#include "ar2315.h"
|
||||
#include "ar2315_regs.h"
|
||||
|
||||
static void __iomem *ar2315_rst_base;
|
||||
static struct irq_domain *ar2315_misc_irq_domain;
|
||||
|
||||
static inline u32 ar2315_rst_reg_read(u32 reg)
|
||||
{
|
||||
return __raw_readl(ar2315_rst_base + reg);
|
||||
}
|
||||
|
||||
static inline void ar2315_rst_reg_write(u32 reg, u32 val)
|
||||
{
|
||||
__raw_writel(val, ar2315_rst_base + reg);
|
||||
}
|
||||
|
||||
static inline void ar2315_rst_reg_mask(u32 reg, u32 mask, u32 val)
|
||||
{
|
||||
u32 ret = ar2315_rst_reg_read(reg);
|
||||
|
||||
ret &= ~mask;
|
||||
ret |= val;
|
||||
ar2315_rst_reg_write(reg, ret);
|
||||
}
|
||||
|
||||
static irqreturn_t ar2315_ahb_err_handler(int cpl, void *dev_id)
|
||||
{
|
||||
ar2315_rst_reg_write(AR2315_AHB_ERR0, AR2315_AHB_ERROR_DET);
|
||||
ar2315_rst_reg_read(AR2315_AHB_ERR1);
|
||||
|
||||
pr_emerg("AHB fatal error\n");
|
||||
machine_restart("AHB error"); /* Catastrophic failure */
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static struct irqaction ar2315_ahb_err_interrupt = {
|
||||
.handler = ar2315_ahb_err_handler,
|
||||
.name = "ar2315-ahb-error",
|
||||
};
|
||||
|
||||
static void ar2315_misc_irq_handler(unsigned irq, struct irq_desc *desc)
|
||||
{
|
||||
u32 pending = ar2315_rst_reg_read(AR2315_ISR) &
|
||||
ar2315_rst_reg_read(AR2315_IMR);
|
||||
unsigned nr, misc_irq = 0;
|
||||
|
||||
if (pending) {
|
||||
struct irq_domain *domain = irq_get_handler_data(irq);
|
||||
|
||||
nr = __ffs(pending);
|
||||
misc_irq = irq_find_mapping(domain, nr);
|
||||
}
|
||||
|
||||
if (misc_irq) {
|
||||
if (nr == AR2315_MISC_IRQ_GPIO)
|
||||
ar2315_rst_reg_write(AR2315_ISR, AR2315_ISR_GPIO);
|
||||
else if (nr == AR2315_MISC_IRQ_WATCHDOG)
|
||||
ar2315_rst_reg_write(AR2315_ISR, AR2315_ISR_WD);
|
||||
generic_handle_irq(misc_irq);
|
||||
} else {
|
||||
spurious_interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
static void ar2315_misc_irq_unmask(struct irq_data *d)
|
||||
{
|
||||
ar2315_rst_reg_mask(AR2315_IMR, 0, BIT(d->hwirq));
|
||||
}
|
||||
|
||||
static void ar2315_misc_irq_mask(struct irq_data *d)
|
||||
{
|
||||
ar2315_rst_reg_mask(AR2315_IMR, BIT(d->hwirq), 0);
|
||||
}
|
||||
|
||||
static struct irq_chip ar2315_misc_irq_chip = {
|
||||
.name = "ar2315-misc",
|
||||
.irq_unmask = ar2315_misc_irq_unmask,
|
||||
.irq_mask = ar2315_misc_irq_mask,
|
||||
};
|
||||
|
||||
static int ar2315_misc_irq_map(struct irq_domain *d, unsigned irq,
|
||||
irq_hw_number_t hw)
|
||||
{
|
||||
irq_set_chip_and_handler(irq, &ar2315_misc_irq_chip, handle_level_irq);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct irq_domain_ops ar2315_misc_irq_domain_ops = {
|
||||
.map = ar2315_misc_irq_map,
|
||||
};
|
||||
|
||||
/*
|
||||
* Called when an interrupt is received, this function
|
||||
* determines exactly which interrupt it was, and it
|
||||
* invokes the appropriate handler.
|
||||
*
|
||||
* Implicitly, we also define interrupt priority by
|
||||
* choosing which to dispatch first.
|
||||
*/
|
||||
static void ar2315_irq_dispatch(void)
|
||||
{
|
||||
u32 pending = read_c0_status() & read_c0_cause();
|
||||
|
||||
if (pending & CAUSEF_IP3)
|
||||
do_IRQ(AR2315_IRQ_WLAN0);
|
||||
#ifdef CONFIG_PCI_AR2315
|
||||
else if (pending & CAUSEF_IP5)
|
||||
do_IRQ(AR2315_IRQ_LCBUS_PCI);
|
||||
#endif
|
||||
else if (pending & CAUSEF_IP2)
|
||||
do_IRQ(AR2315_IRQ_MISC);
|
||||
else if (pending & CAUSEF_IP7)
|
||||
do_IRQ(ATH25_IRQ_CPU_CLOCK);
|
||||
else
|
||||
spurious_interrupt();
|
||||
}
|
||||
|
||||
void __init ar2315_arch_init_irq(void)
|
||||
{
|
||||
struct irq_domain *domain;
|
||||
unsigned irq;
|
||||
|
||||
ath25_irq_dispatch = ar2315_irq_dispatch;
|
||||
|
||||
domain = irq_domain_add_linear(NULL, AR2315_MISC_IRQ_COUNT,
|
||||
&ar2315_misc_irq_domain_ops, NULL);
|
||||
if (!domain)
|
||||
panic("Failed to add IRQ domain");
|
||||
|
||||
irq = irq_create_mapping(domain, AR2315_MISC_IRQ_AHB);
|
||||
setup_irq(irq, &ar2315_ahb_err_interrupt);
|
||||
|
||||
irq_set_chained_handler(AR2315_IRQ_MISC, ar2315_misc_irq_handler);
|
||||
irq_set_handler_data(AR2315_IRQ_MISC, domain);
|
||||
|
||||
ar2315_misc_irq_domain = domain;
|
||||
}
|
||||
|
||||
void __init ar2315_init_devices(void)
|
||||
{
|
||||
/* Find board configuration */
|
||||
ath25_find_config(AR2315_SPI_READ_BASE, AR2315_SPI_READ_SIZE);
|
||||
|
||||
ath25_add_wmac(0, AR2315_WLAN0_BASE, AR2315_IRQ_WLAN0);
|
||||
}
|
||||
|
||||
static void ar2315_restart(char *command)
|
||||
{
|
||||
void (*mips_reset_vec)(void) = (void *)0xbfc00000;
|
||||
|
||||
local_irq_disable();
|
||||
|
||||
/* try reset the system via reset control */
|
||||
ar2315_rst_reg_write(AR2315_COLD_RESET, AR2317_RESET_SYSTEM);
|
||||
|
||||
/* Cold reset does not work on the AR2315/6, use the GPIO reset bits
|
||||
* a workaround. Give it some time to attempt a gpio based hardware
|
||||
* reset (atheros reference design workaround) */
|
||||
|
||||
/* TODO: implement the GPIO reset workaround */
|
||||
|
||||
/* Some boards (e.g. Senao EOC-2610) don't implement the reset logic
|
||||
* workaround. Attempt to jump to the mips reset location -
|
||||
* the boot loader itself might be able to recover the system */
|
||||
mips_reset_vec();
|
||||
}
|
||||
|
||||
/*
|
||||
* This table is indexed by bits 5..4 of the CLOCKCTL1 register
|
||||
* to determine the predevisor value.
|
||||
*/
|
||||
static int clockctl1_predivide_table[4] __initdata = { 1, 2, 4, 5 };
|
||||
static int pllc_divide_table[5] __initdata = { 2, 3, 4, 6, 3 };
|
||||
|
||||
static unsigned __init ar2315_sys_clk(u32 clock_ctl)
|
||||
{
|
||||
unsigned int pllc_ctrl, cpu_div;
|
||||
unsigned int pllc_out, refdiv, fdiv, divby2;
|
||||
unsigned int clk_div;
|
||||
|
||||
pllc_ctrl = ar2315_rst_reg_read(AR2315_PLLC_CTL);
|
||||
refdiv = ATH25_REG_MS(pllc_ctrl, AR2315_PLLC_REF_DIV);
|
||||
refdiv = clockctl1_predivide_table[refdiv];
|
||||
fdiv = ATH25_REG_MS(pllc_ctrl, AR2315_PLLC_FDBACK_DIV);
|
||||
divby2 = ATH25_REG_MS(pllc_ctrl, AR2315_PLLC_ADD_FDBACK_DIV) + 1;
|
||||
pllc_out = (40000000 / refdiv) * (2 * divby2) * fdiv;
|
||||
|
||||
/* clkm input selected */
|
||||
switch (clock_ctl & AR2315_CPUCLK_CLK_SEL_M) {
|
||||
case 0:
|
||||
case 1:
|
||||
clk_div = ATH25_REG_MS(pllc_ctrl, AR2315_PLLC_CLKM_DIV);
|
||||
clk_div = pllc_divide_table[clk_div];
|
||||
break;
|
||||
case 2:
|
||||
clk_div = ATH25_REG_MS(pllc_ctrl, AR2315_PLLC_CLKC_DIV);
|
||||
clk_div = pllc_divide_table[clk_div];
|
||||
break;
|
||||
default:
|
||||
pllc_out = 40000000;
|
||||
clk_div = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
cpu_div = ATH25_REG_MS(clock_ctl, AR2315_CPUCLK_CLK_DIV);
|
||||
cpu_div = cpu_div * 2 ?: 1;
|
||||
|
||||
return pllc_out / (clk_div * cpu_div);
|
||||
}
|
||||
|
||||
static inline unsigned ar2315_cpu_frequency(void)
|
||||
{
|
||||
return ar2315_sys_clk(ar2315_rst_reg_read(AR2315_CPUCLK));
|
||||
}
|
||||
|
||||
static inline unsigned ar2315_apb_frequency(void)
|
||||
{
|
||||
return ar2315_sys_clk(ar2315_rst_reg_read(AR2315_AMBACLK));
|
||||
}
|
||||
|
||||
void __init ar2315_plat_time_init(void)
|
||||
{
|
||||
mips_hpt_frequency = ar2315_cpu_frequency() / 2;
|
||||
}
|
||||
|
||||
void __init ar2315_plat_mem_setup(void)
|
||||
{
|
||||
void __iomem *sdram_base;
|
||||
u32 memsize, memcfg;
|
||||
u32 devid;
|
||||
u32 config;
|
||||
|
||||
/* Detect memory size */
|
||||
sdram_base = ioremap_nocache(AR2315_SDRAMCTL_BASE,
|
||||
AR2315_SDRAMCTL_SIZE);
|
||||
memcfg = __raw_readl(sdram_base + AR2315_MEM_CFG);
|
||||
memsize = 1 + ATH25_REG_MS(memcfg, AR2315_MEM_CFG_DATA_WIDTH);
|
||||
memsize <<= 1 + ATH25_REG_MS(memcfg, AR2315_MEM_CFG_COL_WIDTH);
|
||||
memsize <<= 1 + ATH25_REG_MS(memcfg, AR2315_MEM_CFG_ROW_WIDTH);
|
||||
memsize <<= 3;
|
||||
add_memory_region(0, memsize, BOOT_MEM_RAM);
|
||||
iounmap(sdram_base);
|
||||
|
||||
ar2315_rst_base = ioremap_nocache(AR2315_RST_BASE, AR2315_RST_SIZE);
|
||||
|
||||
/* Detect the hardware based on the device ID */
|
||||
devid = ar2315_rst_reg_read(AR2315_SREV) & AR2315_REV_CHIP;
|
||||
switch (devid) {
|
||||
case 0x91: /* Need to check */
|
||||
ath25_soc = ATH25_SOC_AR2318;
|
||||
break;
|
||||
case 0x90:
|
||||
ath25_soc = ATH25_SOC_AR2317;
|
||||
break;
|
||||
case 0x87:
|
||||
ath25_soc = ATH25_SOC_AR2316;
|
||||
break;
|
||||
case 0x86:
|
||||
default:
|
||||
ath25_soc = ATH25_SOC_AR2315;
|
||||
break;
|
||||
}
|
||||
ath25_board.devid = devid;
|
||||
|
||||
/* Clear any lingering AHB errors */
|
||||
config = read_c0_config();
|
||||
write_c0_config(config & ~0x3);
|
||||
ar2315_rst_reg_write(AR2315_AHB_ERR0, AR2315_AHB_ERROR_DET);
|
||||
ar2315_rst_reg_read(AR2315_AHB_ERR1);
|
||||
ar2315_rst_reg_write(AR2315_WDT_CTRL, AR2315_WDT_CTRL_IGNORE);
|
||||
|
||||
_machine_restart = ar2315_restart;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PCI_AR2315
|
||||
static struct resource ar2315_pci_res[] = {
|
||||
{
|
||||
.name = "ar2315-pci-ctrl",
|
||||
.flags = IORESOURCE_MEM,
|
||||
.start = AR2315_PCI_BASE,
|
||||
.end = AR2315_PCI_BASE + AR2315_PCI_SIZE - 1,
|
||||
},
|
||||
{
|
||||
.name = "ar2315-pci-ext",
|
||||
.flags = IORESOURCE_MEM,
|
||||
.start = AR2315_PCI_EXT_BASE,
|
||||
.end = AR2315_PCI_EXT_BASE + AR2315_PCI_EXT_SIZE - 1,
|
||||
},
|
||||
{
|
||||
.name = "ar2315-pci",
|
||||
.flags = IORESOURCE_IRQ,
|
||||
.start = AR2315_IRQ_LCBUS_PCI,
|
||||
.end = AR2315_IRQ_LCBUS_PCI,
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
void __init ar2315_arch_init(void)
|
||||
{
|
||||
unsigned irq = irq_create_mapping(ar2315_misc_irq_domain,
|
||||
AR2315_MISC_IRQ_UART0);
|
||||
|
||||
ath25_serial_setup(AR2315_UART0_BASE, irq, ar2315_apb_frequency());
|
||||
|
||||
#ifdef CONFIG_PCI_AR2315
|
||||
if (ath25_soc == ATH25_SOC_AR2315) {
|
||||
/* Reset PCI DMA logic */
|
||||
ar2315_rst_reg_mask(AR2315_RESET, 0, AR2315_RESET_PCIDMA);
|
||||
msleep(20);
|
||||
ar2315_rst_reg_mask(AR2315_RESET, AR2315_RESET_PCIDMA, 0);
|
||||
msleep(20);
|
||||
|
||||
/* Configure endians */
|
||||
ar2315_rst_reg_mask(AR2315_ENDIAN_CTL, 0, AR2315_CONFIG_PCIAHB |
|
||||
AR2315_CONFIG_PCIAHB_BRIDGE);
|
||||
|
||||
/* Configure as PCI host with DMA */
|
||||
ar2315_rst_reg_write(AR2315_PCICLK, AR2315_PCICLK_PLLC_CLKM |
|
||||
(AR2315_PCICLK_IN_FREQ_DIV_6 <<
|
||||
AR2315_PCICLK_DIV_S));
|
||||
ar2315_rst_reg_mask(AR2315_AHB_ARB_CTL, 0, AR2315_ARB_PCI);
|
||||
ar2315_rst_reg_mask(AR2315_IF_CTL, AR2315_IF_PCI_CLK_MASK |
|
||||
AR2315_IF_MASK, AR2315_IF_PCI |
|
||||
AR2315_IF_PCI_HOST | AR2315_IF_PCI_INTR |
|
||||
(AR2315_IF_PCI_CLK_OUTPUT_CLK <<
|
||||
AR2315_IF_PCI_CLK_SHIFT));
|
||||
|
||||
platform_device_register_simple("ar2315-pci", -1,
|
||||
ar2315_pci_res,
|
||||
ARRAY_SIZE(ar2315_pci_res));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
22
arch/mips/ath25/ar2315.h
Normal file
22
arch/mips/ath25/ar2315.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef __AR2315_H
|
||||
#define __AR2315_H
|
||||
|
||||
#ifdef CONFIG_SOC_AR2315
|
||||
|
||||
void ar2315_arch_init_irq(void);
|
||||
void ar2315_init_devices(void);
|
||||
void ar2315_plat_time_init(void);
|
||||
void ar2315_plat_mem_setup(void);
|
||||
void ar2315_arch_init(void);
|
||||
|
||||
#else
|
||||
|
||||
static inline void ar2315_arch_init_irq(void) {}
|
||||
static inline void ar2315_init_devices(void) {}
|
||||
static inline void ar2315_plat_time_init(void) {}
|
||||
static inline void ar2315_plat_mem_setup(void) {}
|
||||
static inline void ar2315_arch_init(void) {}
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __AR2315_H */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user