You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle: "The MIPS bits for 3.8. This also includes a bunch fixes that were sitting in the linux-mips.org git tree for a long time. This pull request contains updates to several OCTEON drivers and the board support code for BCM47XX, BCM63XX, XLP, XLR, XLS, lantiq, Loongson1B, updates to the SSB bus support, MIPS kexec code and adds support for kdump. When pulling this, there are two expected merge conflicts in include/linux/bcma/bcma_driver_chipcommon.h which are trivial to resolve, just remove the conflict markers and keep both alternatives." * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (90 commits) MIPS: PMC-Sierra Yosemite: Remove support. VIDEO: Newport Fix console crashes MIPS: wrppmc: Fix build of PCI code. MIPS: IP22/IP28: Fix build of EISA code. MIPS: RB532: Fix build of prom code. MIPS: PowerTV: Fix build. MIPS: IP27: Correct fucked grammar in ops-bridge.c MIPS: Highmem: Fix build error if CONFIG_DEBUG_HIGHMEM is disabled MIPS: Fix potencial corruption MIPS: Fix for warning from FPU emulation code MIPS: Handle COP3 Unusable exception as COP1X for FP emulation MIPS: Fix poweroff failure when HOTPLUG_CPU configured. MIPS: MT: Fix build with CONFIG_UIDGID_STRICT_TYPE_CHECKS=y MIPS: Remove unused smvp.h MIPS/EDAC: Improve OCTEON EDAC support. MIPS: OCTEON: Add definitions for OCTEON memory contoller registers. MIPS: OCTEON: Add OCTEON family definitions to octeon-model.h ata: pata_octeon_cf: Use correct byte order for DMA in when built little-endian. MIPS/OCTEON/ata: Convert pata_octeon_cf.c to use device tree. MIPS: Remove usage of CEVT_R4K_LIB config option. ...
This commit is contained in:
@@ -2751,6 +2751,15 @@ W: bluesmoke.sourceforge.net
|
||||
S: Maintained
|
||||
F: drivers/edac/amd64_edac*
|
||||
|
||||
EDAC-CAVIUM
|
||||
M: Ralf Baechle <ralf@linux-mips.org>
|
||||
M: David Daney <david.daney@cavium.com>
|
||||
L: linux-edac@vger.kernel.org
|
||||
L: linux-mips@linux-mips.org
|
||||
W: bluesmoke.sourceforge.net
|
||||
S: Supported
|
||||
F: drivers/edac/octeon_edac*
|
||||
|
||||
EDAC-E752X
|
||||
M: Mark Gross <mark.gross@intel.com>
|
||||
M: Doug Thompson <dougthompson@xmission.com>
|
||||
|
||||
+65
-76
@@ -19,6 +19,7 @@ config MIPS
|
||||
select HAVE_KRETPROBES
|
||||
select HAVE_DEBUG_KMEMLEAK
|
||||
select ARCH_BINFMT_ELF_RANDOMIZE_PIE
|
||||
select HAVE_ARCH_TRANSPARENT_HUGEPAGE
|
||||
select RTC_LIB if !MACH_LOONGSON
|
||||
select GENERIC_ATOMIC64 if !64BIT
|
||||
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
|
||||
@@ -55,8 +56,8 @@ choice
|
||||
config MIPS_ALCHEMY
|
||||
bool "Alchemy processor based machines"
|
||||
select 64BIT_PHYS_ADDR
|
||||
select CEVT_R4K_LIB
|
||||
select CSRC_R4K_LIB
|
||||
select CEVT_R4K
|
||||
select CSRC_R4K
|
||||
select IRQ_CPU
|
||||
select SYS_HAS_CPU_MIPS32_R1
|
||||
select SYS_SUPPORTS_32BIT_KERNEL
|
||||
@@ -107,16 +108,16 @@ config ATH79
|
||||
|
||||
config BCM47XX
|
||||
bool "Broadcom BCM47XX based boards"
|
||||
select ARCH_WANT_OPTIONAL_GPIOLIB
|
||||
select CEVT_R4K
|
||||
select CSRC_R4K
|
||||
select DMA_NONCOHERENT
|
||||
select FW_CFE
|
||||
select HW_HAS_PCI
|
||||
select IRQ_CPU
|
||||
select SYS_SUPPORTS_32BIT_KERNEL
|
||||
select SYS_SUPPORTS_LITTLE_ENDIAN
|
||||
select GENERIC_GPIO
|
||||
select SYS_HAS_EARLY_PRINTK
|
||||
select CFE
|
||||
help
|
||||
Support for BCM47XX based boards
|
||||
|
||||
@@ -193,8 +194,8 @@ config MACH_DECSTATION
|
||||
|
||||
config MACH_JAZZ
|
||||
bool "Jazz family of machines"
|
||||
select ARC
|
||||
select ARC32
|
||||
select FW_ARC
|
||||
select FW_ARC32
|
||||
select ARCH_MAY_HAVE_PC_FDC
|
||||
select CEVT_R4K
|
||||
select CSRC_R4K
|
||||
@@ -417,27 +418,6 @@ config PMC_MSP
|
||||
of integrated peripherals, interfaces and DSPs in addition to
|
||||
a variety of MIPS cores.
|
||||
|
||||
config PMC_YOSEMITE
|
||||
bool "PMC-Sierra Yosemite eval board"
|
||||
select CEVT_R4K
|
||||
select CSRC_R4K
|
||||
select DMA_COHERENT
|
||||
select HW_HAS_PCI
|
||||
select IRQ_CPU
|
||||
select IRQ_CPU_RM7K
|
||||
select IRQ_CPU_RM9K
|
||||
select SWAP_IO_SPACE
|
||||
select SYS_HAS_CPU_RM9000
|
||||
select SYS_HAS_EARLY_PRINTK
|
||||
select SYS_SUPPORTS_32BIT_KERNEL
|
||||
select SYS_SUPPORTS_64BIT_KERNEL
|
||||
select SYS_SUPPORTS_BIG_ENDIAN
|
||||
select SYS_SUPPORTS_HIGHMEM
|
||||
select SYS_SUPPORTS_SMP
|
||||
help
|
||||
Yosemite is an evaluation board for the RM9000x2 processor
|
||||
manufactured by PMC-Sierra.
|
||||
|
||||
config POWERTV
|
||||
bool "Cisco PowerTV"
|
||||
select BOOT_ELF32
|
||||
@@ -458,8 +438,8 @@ config POWERTV
|
||||
|
||||
config SGI_IP22
|
||||
bool "SGI IP22 (Indy/Indigo2)"
|
||||
select ARC
|
||||
select ARC32
|
||||
select FW_ARC
|
||||
select FW_ARC32
|
||||
select BOOT_ELF32
|
||||
select CEVT_R4K
|
||||
select CSRC_R4K
|
||||
@@ -498,8 +478,8 @@ config SGI_IP22
|
||||
|
||||
config SGI_IP27
|
||||
bool "SGI IP27 (Origin200/2000)"
|
||||
select ARC
|
||||
select ARC64
|
||||
select FW_ARC
|
||||
select FW_ARC64
|
||||
select BOOT_ELF64
|
||||
select DEFAULT_SGI_PARTITION
|
||||
select DMA_COHERENT
|
||||
@@ -519,8 +499,8 @@ config SGI_IP27
|
||||
config SGI_IP28
|
||||
bool "SGI IP28 (Indigo2 R10k) (EXPERIMENTAL)"
|
||||
depends on EXPERIMENTAL
|
||||
select ARC
|
||||
select ARC64
|
||||
select FW_ARC
|
||||
select FW_ARC64
|
||||
select BOOT_ELF64
|
||||
select CEVT_R4K
|
||||
select CSRC_R4K
|
||||
@@ -555,8 +535,8 @@ config SGI_IP28
|
||||
|
||||
config SGI_IP32
|
||||
bool "SGI IP32 (O2)"
|
||||
select ARC
|
||||
select ARC32
|
||||
select FW_ARC
|
||||
select FW_ARC32
|
||||
select BOOT_ELF32
|
||||
select CEVT_R4K
|
||||
select CSRC_R4K
|
||||
@@ -674,8 +654,8 @@ config SIBYTE_BIGSUR
|
||||
|
||||
config SNI_RM
|
||||
bool "SNI RM200/300/400"
|
||||
select ARC if CPU_LITTLE_ENDIAN
|
||||
select ARC32 if CPU_LITTLE_ENDIAN
|
||||
select FW_ARC if CPU_LITTLE_ENDIAN
|
||||
select FW_ARC32 if CPU_LITTLE_ENDIAN
|
||||
select SNIPROM if CPU_BIG_ENDIAN
|
||||
select ARCH_MAY_HAVE_PC_FDC
|
||||
select BOOT_ELF32
|
||||
@@ -776,6 +756,7 @@ config CAVIUM_OCTEON_REFERENCE_BOARD
|
||||
select DMA_COHERENT
|
||||
select SYS_SUPPORTS_64BIT_KERNEL
|
||||
select SYS_SUPPORTS_BIG_ENDIAN
|
||||
select EDAC_SUPPORT
|
||||
select SYS_SUPPORTS_HOTPLUG_CPU
|
||||
select SYS_HAS_EARLY_PRINTK
|
||||
select SYS_HAS_CPU_CAVIUM_OCTEON
|
||||
@@ -819,7 +800,7 @@ config NLM_XLR_BOARD
|
||||
select CSRC_R4K
|
||||
select IRQ_CPU
|
||||
select ARCH_SUPPORTS_MSI
|
||||
select ZONE_DMA if 64BIT
|
||||
select ZONE_DMA32 if 64BIT
|
||||
select SYNC_R4K
|
||||
select SYS_HAS_EARLY_PRINTK
|
||||
select USB_ARCH_HAS_OHCI if USB_SUPPORT
|
||||
@@ -847,7 +828,7 @@ config NLM_XLP_BOARD
|
||||
select CEVT_R4K
|
||||
select CSRC_R4K
|
||||
select IRQ_CPU
|
||||
select ZONE_DMA if 64BIT
|
||||
select ZONE_DMA32 if 64BIT
|
||||
select SYNC_R4K
|
||||
select SYS_HAS_EARLY_PRINTK
|
||||
select USE_OF
|
||||
@@ -908,7 +889,7 @@ config SCHED_OMIT_FRAME_POINTER
|
||||
#
|
||||
# Select some configuration options automatically based on user selections.
|
||||
#
|
||||
config ARC
|
||||
config FW_ARC
|
||||
bool
|
||||
|
||||
config ARCH_MAY_HAVE_PC_FDC
|
||||
@@ -926,11 +907,7 @@ config CEVT_DS1287
|
||||
config CEVT_GT641XX
|
||||
bool
|
||||
|
||||
config CEVT_R4K_LIB
|
||||
bool
|
||||
|
||||
config CEVT_R4K
|
||||
select CEVT_R4K_LIB
|
||||
bool
|
||||
|
||||
config CEVT_SB1250
|
||||
@@ -948,11 +925,7 @@ config CSRC_IOASIC
|
||||
config CSRC_POWERTV
|
||||
bool
|
||||
|
||||
config CSRC_R4K_LIB
|
||||
bool
|
||||
|
||||
config CSRC_R4K
|
||||
select CSRC_R4K_LIB
|
||||
bool
|
||||
|
||||
config CSRC_SB1250
|
||||
@@ -963,7 +936,7 @@ config GPIO_TXX9
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
bool
|
||||
|
||||
config CFE
|
||||
config FW_CFE
|
||||
bool
|
||||
|
||||
config ARCH_DMA_ADDR_T_64BIT
|
||||
@@ -1079,15 +1052,15 @@ config SYS_SUPPORTS_HUGETLBFS
|
||||
depends on CPU_SUPPORTS_HUGEPAGES && 64BIT
|
||||
default y
|
||||
|
||||
config MIPS_HUGE_TLB_SUPPORT
|
||||
def_bool HUGETLB_PAGE || TRANSPARENT_HUGEPAGE
|
||||
|
||||
config IRQ_CPU
|
||||
bool
|
||||
|
||||
config IRQ_CPU_RM7K
|
||||
bool
|
||||
|
||||
config IRQ_CPU_RM9K
|
||||
bool
|
||||
|
||||
config IRQ_MSP_SLP
|
||||
bool
|
||||
|
||||
@@ -1112,10 +1085,6 @@ config PCI_GT64XXX_PCI0
|
||||
config NO_EXCEPT_FILL
|
||||
bool
|
||||
|
||||
config MIPS_RM9122
|
||||
bool
|
||||
select SERIAL_RM9000
|
||||
|
||||
config SOC_EMMA2RH
|
||||
bool
|
||||
select CEVT_R4K
|
||||
@@ -1161,9 +1130,6 @@ config SOC_PNX8550
|
||||
config SWAP_IO_SPACE
|
||||
bool
|
||||
|
||||
config SERIAL_RM9000
|
||||
bool
|
||||
|
||||
config SGI_HAS_INDYDOG
|
||||
bool
|
||||
|
||||
@@ -1185,7 +1151,7 @@ config SGI_HAS_I8042
|
||||
config DEFAULT_SGI_PARTITION
|
||||
bool
|
||||
|
||||
config ARC32
|
||||
config FW_ARC32
|
||||
bool
|
||||
|
||||
config SNIPROM
|
||||
@@ -1218,7 +1184,7 @@ config ARC_PROMLIB
|
||||
depends on MACH_JAZZ || SNI_RM || SGI_IP22 || SGI_IP28 || SGI_IP32
|
||||
default y
|
||||
|
||||
config ARC64
|
||||
config FW_ARC64
|
||||
bool
|
||||
|
||||
config BOOT_ELF64
|
||||
@@ -1370,6 +1336,7 @@ config CPU_R4X00
|
||||
depends on SYS_HAS_CPU_R4X00
|
||||
select CPU_SUPPORTS_32BIT_KERNEL
|
||||
select CPU_SUPPORTS_64BIT_KERNEL
|
||||
select CPU_SUPPORTS_HUGEPAGES
|
||||
help
|
||||
MIPS Technologies R4000-series processors other than 4300, including
|
||||
the R4000, R4400, R4600, and 4700.
|
||||
@@ -1380,12 +1347,14 @@ config CPU_TX49XX
|
||||
select CPU_HAS_PREFETCH
|
||||
select CPU_SUPPORTS_32BIT_KERNEL
|
||||
select CPU_SUPPORTS_64BIT_KERNEL
|
||||
select CPU_SUPPORTS_HUGEPAGES
|
||||
|
||||
config CPU_R5000
|
||||
bool "R5000"
|
||||
depends on SYS_HAS_CPU_R5000
|
||||
select CPU_SUPPORTS_32BIT_KERNEL
|
||||
select CPU_SUPPORTS_64BIT_KERNEL
|
||||
select CPU_SUPPORTS_HUGEPAGES
|
||||
help
|
||||
MIPS Technologies R5000-series processors other than the Nevada.
|
||||
|
||||
@@ -1394,6 +1363,7 @@ config CPU_R5432
|
||||
depends on SYS_HAS_CPU_R5432
|
||||
select CPU_SUPPORTS_32BIT_KERNEL
|
||||
select CPU_SUPPORTS_64BIT_KERNEL
|
||||
select CPU_SUPPORTS_HUGEPAGES
|
||||
|
||||
config CPU_R5500
|
||||
bool "R5500"
|
||||
@@ -1419,6 +1389,7 @@ config CPU_NEVADA
|
||||
depends on SYS_HAS_CPU_NEVADA
|
||||
select CPU_SUPPORTS_32BIT_KERNEL
|
||||
select CPU_SUPPORTS_64BIT_KERNEL
|
||||
select CPU_SUPPORTS_HUGEPAGES
|
||||
help
|
||||
QED / PMC-Sierra RM52xx-series ("Nevada") processors.
|
||||
|
||||
@@ -1439,6 +1410,7 @@ config CPU_R10000
|
||||
select CPU_SUPPORTS_32BIT_KERNEL
|
||||
select CPU_SUPPORTS_64BIT_KERNEL
|
||||
select CPU_SUPPORTS_HIGHMEM
|
||||
select CPU_SUPPORTS_HUGEPAGES
|
||||
help
|
||||
MIPS Technologies R10000-series processors.
|
||||
|
||||
@@ -1449,15 +1421,7 @@ config CPU_RM7000
|
||||
select CPU_SUPPORTS_32BIT_KERNEL
|
||||
select CPU_SUPPORTS_64BIT_KERNEL
|
||||
select CPU_SUPPORTS_HIGHMEM
|
||||
|
||||
config CPU_RM9000
|
||||
bool "RM9000"
|
||||
depends on SYS_HAS_CPU_RM9000
|
||||
select CPU_HAS_PREFETCH
|
||||
select CPU_SUPPORTS_32BIT_KERNEL
|
||||
select CPU_SUPPORTS_64BIT_KERNEL
|
||||
select CPU_SUPPORTS_HIGHMEM
|
||||
select WEAK_ORDERING
|
||||
select CPU_SUPPORTS_HUGEPAGES
|
||||
|
||||
config CPU_SB1
|
||||
bool "SB1"
|
||||
@@ -1465,6 +1429,7 @@ config CPU_SB1
|
||||
select CPU_SUPPORTS_32BIT_KERNEL
|
||||
select CPU_SUPPORTS_64BIT_KERNEL
|
||||
select CPU_SUPPORTS_HIGHMEM
|
||||
select CPU_SUPPORTS_HUGEPAGES
|
||||
select WEAK_ORDERING
|
||||
|
||||
config CPU_CAVIUM_OCTEON
|
||||
@@ -1528,9 +1493,9 @@ config CPU_XLR
|
||||
select CPU_SUPPORTS_32BIT_KERNEL
|
||||
select CPU_SUPPORTS_64BIT_KERNEL
|
||||
select CPU_SUPPORTS_HIGHMEM
|
||||
select CPU_SUPPORTS_HUGEPAGES
|
||||
select WEAK_ORDERING
|
||||
select WEAK_REORDERING_BEYOND_LLSC
|
||||
select CPU_SUPPORTS_HUGEPAGES
|
||||
help
|
||||
Netlogic Microsystems XLR/XLS processors.
|
||||
|
||||
@@ -1544,6 +1509,7 @@ config CPU_XLP
|
||||
select WEAK_ORDERING
|
||||
select WEAK_REORDERING_BEYOND_LLSC
|
||||
select CPU_HAS_PREFETCH
|
||||
select CPU_MIPSR2
|
||||
help
|
||||
Netlogic Microsystems XLP processors.
|
||||
endchoice
|
||||
@@ -1591,6 +1557,7 @@ config CPU_LOONGSON2
|
||||
select CPU_SUPPORTS_32BIT_KERNEL
|
||||
select CPU_SUPPORTS_64BIT_KERNEL
|
||||
select CPU_SUPPORTS_HIGHMEM
|
||||
select CPU_SUPPORTS_HUGEPAGES
|
||||
|
||||
config CPU_LOONGSON1
|
||||
bool
|
||||
@@ -1675,9 +1642,6 @@ config SYS_HAS_CPU_R10000
|
||||
config SYS_HAS_CPU_RM7000
|
||||
bool
|
||||
|
||||
config SYS_HAS_CPU_RM9000
|
||||
bool
|
||||
|
||||
config SYS_HAS_CPU_SB1
|
||||
bool
|
||||
|
||||
@@ -1757,7 +1721,7 @@ config CPU_SUPPORTS_UNCACHED_ACCELERATED
|
||||
bool
|
||||
config MIPS_PGD_C0_CONTEXT
|
||||
bool
|
||||
default y if 64BIT && CPU_MIPSR2
|
||||
default y if 64BIT && CPU_MIPSR2 && !CPU_XLP
|
||||
|
||||
#
|
||||
# Set to y for ptrace access to watch registers.
|
||||
@@ -2188,7 +2152,7 @@ config NODES_SHIFT
|
||||
|
||||
config HW_PERF_EVENTS
|
||||
bool "Enable hardware performance counter support for perf events"
|
||||
depends on PERF_EVENTS && !MIPS_MT_SMTC && OPROFILE=n && (CPU_MIPS32 || CPU_MIPS64 || CPU_R10000 || CPU_SB1 || CPU_CAVIUM_OCTEON)
|
||||
depends on PERF_EVENTS && !MIPS_MT_SMTC && OPROFILE=n && (CPU_MIPS32 || CPU_MIPS64 || CPU_R10000 || CPU_SB1 || CPU_CAVIUM_OCTEON || CPU_XLP)
|
||||
default y
|
||||
help
|
||||
Enable hardware performance counter support for perf events. If
|
||||
@@ -2366,6 +2330,29 @@ config KEXEC
|
||||
support. As of this writing the exact hardware interface is
|
||||
strongly in flux, so no good recommendation can be made.
|
||||
|
||||
config CRASH_DUMP
|
||||
bool "Kernel crash dumps"
|
||||
help
|
||||
Generate crash dump after being started by kexec.
|
||||
This should be normally only set in special crash dump kernels
|
||||
which are loaded in the main kernel with kexec-tools into
|
||||
a specially reserved region and then later executed after
|
||||
a crash by kdump/kexec. The crash dump kernel must be compiled
|
||||
to a memory address not used by the main kernel or firmware using
|
||||
PHYSICAL_START.
|
||||
|
||||
config PHYSICAL_START
|
||||
hex "Physical address where the kernel is loaded"
|
||||
default "0xffffffff84000000" if 64BIT
|
||||
default "0x84000000" if 32BIT
|
||||
depends on CRASH_DUMP
|
||||
help
|
||||
This gives the CKSEG0 or KSEG0 address where the kernel is loaded.
|
||||
If you plan to use kernel for capturing the crash dump change
|
||||
this value to start of the reserved region (the "X" value as
|
||||
specified in the "crashkernel=YM@XM" command line boot parameter
|
||||
passed to the panic-ed kernel).
|
||||
|
||||
config SECCOMP
|
||||
bool "Enable seccomp to safely compute untrusted bytecode"
|
||||
depends on PROC_FS
|
||||
@@ -2572,6 +2559,8 @@ source "net/Kconfig"
|
||||
|
||||
source "drivers/Kconfig"
|
||||
|
||||
source "drivers/firmware/Kconfig"
|
||||
|
||||
source "fs/Kconfig"
|
||||
|
||||
source "arch/mips/Kconfig.debug"
|
||||
|
||||
+7
-5
@@ -145,8 +145,6 @@ cflags-$(CONFIG_CPU_NEVADA) += $(call cc-option,-march=rm5200,-march=r5000) \
|
||||
-Wa,--trap
|
||||
cflags-$(CONFIG_CPU_RM7000) += $(call cc-option,-march=rm7000,-march=r5000) \
|
||||
-Wa,--trap
|
||||
cflags-$(CONFIG_CPU_RM9000) += $(call cc-option,-march=rm9000,-march=r5000) \
|
||||
-Wa,--trap
|
||||
cflags-$(CONFIG_CPU_SB1) += $(call cc-option,-march=sb1,-march=r5000) \
|
||||
-Wa,--trap
|
||||
cflags-$(CONFIG_CPU_R8000) += -march=r8000 -Wa,--trap
|
||||
@@ -173,9 +171,9 @@ endif
|
||||
#
|
||||
# Firmware support
|
||||
#
|
||||
libs-$(CONFIG_ARC) += arch/mips/fw/arc/
|
||||
libs-$(CONFIG_CFE) += arch/mips/fw/cfe/
|
||||
libs-$(CONFIG_SNIPROM) += arch/mips/fw/sni/
|
||||
libs-$(CONFIG_FW_ARC) += arch/mips/fw/arc/
|
||||
libs-$(CONFIG_FW_CFE) += arch/mips/fw/cfe/
|
||||
libs-$(CONFIG_FW_SNIPROM) += arch/mips/fw/sni/
|
||||
libs-y += arch/mips/fw/lib/
|
||||
|
||||
#
|
||||
@@ -192,6 +190,10 @@ endif
|
||||
#
|
||||
include $(srctree)/arch/mips/Kbuild.platforms
|
||||
|
||||
ifdef CONFIG_PHYSICAL_START
|
||||
load-y = $(CONFIG_PHYSICAL_START)
|
||||
endif
|
||||
|
||||
cflags-y += -I$(srctree)/arch/mips/include/asm/mach-generic
|
||||
drivers-$(CONFIG_PCI) += arch/mips/pci/
|
||||
|
||||
|
||||
@@ -202,8 +202,11 @@ static struct resource physmap_flash_resource = {
|
||||
.end = 0x107fffff,
|
||||
};
|
||||
|
||||
static const char *ar7_probe_types[] = { "ar7part", NULL };
|
||||
|
||||
static struct physmap_flash_data physmap_flash_data = {
|
||||
.width = 2,
|
||||
.part_probe_types = ar7_probe_types,
|
||||
};
|
||||
|
||||
static struct platform_device physmap_flash = {
|
||||
|
||||
@@ -9,6 +9,7 @@ config BCM47XX_SSB
|
||||
select SSB_EMBEDDED
|
||||
select SSB_B43_PCI_BRIDGE if PCI
|
||||
select SSB_PCICORE_HOSTMODE if PCI
|
||||
select SSB_DRIVER_GPIO
|
||||
default y
|
||||
help
|
||||
Add support for old Broadcom BCM47xx boards with Sonics Silicon Backplane support.
|
||||
@@ -23,6 +24,7 @@ config BCM47XX_BCMA
|
||||
select BCMA_DRIVER_MIPS
|
||||
select BCMA_HOST_PCI if PCI
|
||||
select BCMA_DRIVER_PCI_HOSTMODE if PCI
|
||||
select BCMA_DRIVER_GPIO
|
||||
default y
|
||||
help
|
||||
Add support for new Broadcom BCM47xx boards with Broadcom specific Advanced Microcontroller Bus.
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
# under Linux.
|
||||
#
|
||||
|
||||
obj-y += gpio.o irq.o nvram.o prom.o serial.o setup.o time.o sprom.o
|
||||
obj-y += irq.o nvram.o prom.o serial.o setup.o time.o sprom.o
|
||||
obj-$(CONFIG_BCM47XX_SSB) += wgt634u.o
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
/*
|
||||
* 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) 2007 Aurelien Jarno <aurelien@aurel32.net>
|
||||
*/
|
||||
|
||||
#include <linux/export.h>
|
||||
#include <linux/ssb/ssb.h>
|
||||
#include <linux/ssb/ssb_driver_chipcommon.h>
|
||||
#include <linux/ssb/ssb_driver_extif.h>
|
||||
#include <asm/mach-bcm47xx/bcm47xx.h>
|
||||
#include <asm/mach-bcm47xx/gpio.h>
|
||||
|
||||
#if (BCM47XX_CHIPCO_GPIO_LINES > BCM47XX_EXTIF_GPIO_LINES)
|
||||
static DECLARE_BITMAP(gpio_in_use, BCM47XX_CHIPCO_GPIO_LINES);
|
||||
#else
|
||||
static DECLARE_BITMAP(gpio_in_use, BCM47XX_EXTIF_GPIO_LINES);
|
||||
#endif
|
||||
|
||||
int gpio_request(unsigned gpio, const char *tag)
|
||||
{
|
||||
switch (bcm47xx_bus_type) {
|
||||
#ifdef CONFIG_BCM47XX_SSB
|
||||
case BCM47XX_BUS_TYPE_SSB:
|
||||
if (ssb_chipco_available(&bcm47xx_bus.ssb.chipco) &&
|
||||
((unsigned)gpio >= BCM47XX_CHIPCO_GPIO_LINES))
|
||||
return -EINVAL;
|
||||
|
||||
if (ssb_extif_available(&bcm47xx_bus.ssb.extif) &&
|
||||
((unsigned)gpio >= BCM47XX_EXTIF_GPIO_LINES))
|
||||
return -EINVAL;
|
||||
|
||||
if (test_and_set_bit(gpio, gpio_in_use))
|
||||
return -EBUSY;
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
#ifdef CONFIG_BCM47XX_BCMA
|
||||
case BCM47XX_BUS_TYPE_BCMA:
|
||||
if (gpio >= BCM47XX_CHIPCO_GPIO_LINES)
|
||||
return -EINVAL;
|
||||
|
||||
if (test_and_set_bit(gpio, gpio_in_use))
|
||||
return -EBUSY;
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
EXPORT_SYMBOL(gpio_request);
|
||||
|
||||
void gpio_free(unsigned gpio)
|
||||
{
|
||||
switch (bcm47xx_bus_type) {
|
||||
#ifdef CONFIG_BCM47XX_SSB
|
||||
case BCM47XX_BUS_TYPE_SSB:
|
||||
if (ssb_chipco_available(&bcm47xx_bus.ssb.chipco) &&
|
||||
((unsigned)gpio >= BCM47XX_CHIPCO_GPIO_LINES))
|
||||
return;
|
||||
|
||||
if (ssb_extif_available(&bcm47xx_bus.ssb.extif) &&
|
||||
((unsigned)gpio >= BCM47XX_EXTIF_GPIO_LINES))
|
||||
return;
|
||||
|
||||
clear_bit(gpio, gpio_in_use);
|
||||
return;
|
||||
#endif
|
||||
#ifdef CONFIG_BCM47XX_BCMA
|
||||
case BCM47XX_BUS_TYPE_BCMA:
|
||||
if (gpio >= BCM47XX_CHIPCO_GPIO_LINES)
|
||||
return;
|
||||
|
||||
clear_bit(gpio, gpio_in_use);
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(gpio_free);
|
||||
|
||||
int gpio_to_irq(unsigned gpio)
|
||||
{
|
||||
switch (bcm47xx_bus_type) {
|
||||
#ifdef CONFIG_BCM47XX_SSB
|
||||
case BCM47XX_BUS_TYPE_SSB:
|
||||
if (ssb_chipco_available(&bcm47xx_bus.ssb.chipco))
|
||||
return ssb_mips_irq(bcm47xx_bus.ssb.chipco.dev) + 2;
|
||||
else if (ssb_extif_available(&bcm47xx_bus.ssb.extif))
|
||||
return ssb_mips_irq(bcm47xx_bus.ssb.extif.dev) + 2;
|
||||
else
|
||||
return -EINVAL;
|
||||
#endif
|
||||
#ifdef CONFIG_BCM47XX_BCMA
|
||||
case BCM47XX_BUS_TYPE_BCMA:
|
||||
return bcma_core_mips_irq(bcm47xx_bus.bcma.bus.drv_cc.core) + 2;
|
||||
#endif
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(gpio_to_irq);
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright (C) 2004 Florian Schirmer <jolt@tuxbox.org>
|
||||
* Copyright (C) 2007 Aurelien Jarno <aurelien@aurel32.net>
|
||||
* Copyright (C) 2010-2012 Hauke Mehrtens <hauke@hauke-m.de>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
@@ -27,6 +28,7 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/smp.h>
|
||||
#include <asm/bootinfo.h>
|
||||
#include <asm/fw/cfe/cfe_api.h>
|
||||
#include <asm/fw/cfe/cfe_error.h>
|
||||
@@ -127,6 +129,8 @@ static __init void prom_init_mem(void)
|
||||
{
|
||||
unsigned long mem;
|
||||
unsigned long max;
|
||||
unsigned long off;
|
||||
struct cpuinfo_mips *c = ¤t_cpu_data;
|
||||
|
||||
/* Figure out memory size by finding aliases.
|
||||
*
|
||||
@@ -143,18 +147,26 @@ static __init void prom_init_mem(void)
|
||||
* max contains the biggest possible address supported by the platform.
|
||||
* If the method wants to try something above we assume 128MB ram.
|
||||
*/
|
||||
max = ((unsigned long)(prom_init) | ((128 << 20) - 1));
|
||||
off = (unsigned long)prom_init;
|
||||
max = off | ((128 << 20) - 1);
|
||||
for (mem = (1 << 20); mem < (128 << 20); mem += (1 << 20)) {
|
||||
if (((unsigned long)(prom_init) + mem) > max) {
|
||||
if ((off + mem) > max) {
|
||||
mem = (128 << 20);
|
||||
printk(KERN_DEBUG "assume 128MB RAM\n");
|
||||
break;
|
||||
}
|
||||
if (*(unsigned long *)((unsigned long)(prom_init) + mem) ==
|
||||
*(unsigned long *)(prom_init))
|
||||
if (!memcmp(prom_init, prom_init + mem, 32))
|
||||
break;
|
||||
}
|
||||
|
||||
/* Ignoring the last page when ddr size is 128M. Cached
|
||||
* accesses to last page is causing the processor to prefetch
|
||||
* using address above 128M stepping out of the ddr address
|
||||
* space.
|
||||
*/
|
||||
if (c->cputype == CPU_74K && (mem == (128 << 20)))
|
||||
mem -= 0x1000;
|
||||
|
||||
add_memory_region(0, mem, BOOT_MEM_RAM);
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ static int bcm47xx_get_sprom_ssb(struct ssb_bus *bus, struct ssb_sprom *out)
|
||||
snprintf(prefix, sizeof(prefix), "pci/%u/%u/",
|
||||
bus->host_pci->bus->number + 1,
|
||||
PCI_SLOT(bus->host_pci->devfn));
|
||||
bcm47xx_fill_sprom(out, prefix);
|
||||
bcm47xx_fill_sprom(out, prefix, false);
|
||||
return 0;
|
||||
} else {
|
||||
printk(KERN_WARNING "bcm47xx: unable to fill SPROM for given bustype.\n");
|
||||
@@ -113,7 +113,7 @@ static int bcm47xx_get_invariants(struct ssb_bus *bus,
|
||||
bcm47xx_fill_ssb_boardinfo(&iv->boardinfo, NULL);
|
||||
|
||||
memset(&iv->sprom, 0, sizeof(struct ssb_sprom));
|
||||
bcm47xx_fill_sprom(&iv->sprom, NULL);
|
||||
bcm47xx_fill_sprom(&iv->sprom, NULL, false);
|
||||
|
||||
if (nvram_getenv("cardbus", buf, sizeof(buf)) >= 0)
|
||||
iv->has_cardbus_slot = !!simple_strtoul(buf, NULL, 10);
|
||||
@@ -165,16 +165,17 @@ static int bcm47xx_get_sprom_bcma(struct bcma_bus *bus, struct ssb_sprom *out)
|
||||
snprintf(prefix, sizeof(prefix), "pci/%u/%u/",
|
||||
bus->host_pci->bus->number + 1,
|
||||
PCI_SLOT(bus->host_pci->devfn));
|
||||
bcm47xx_fill_sprom(out, prefix);
|
||||
bcm47xx_fill_sprom(out, prefix, false);
|
||||
return 0;
|
||||
case BCMA_HOSTTYPE_SOC:
|
||||
memset(out, 0, sizeof(struct ssb_sprom));
|
||||
bcm47xx_fill_sprom_ethernet(out, NULL);
|
||||
core = bcma_find_core(bus, BCMA_CORE_80211);
|
||||
if (core) {
|
||||
snprintf(prefix, sizeof(prefix), "sb/%u/",
|
||||
core->core_index);
|
||||
bcm47xx_fill_sprom(out, prefix);
|
||||
bcm47xx_fill_sprom(out, prefix, true);
|
||||
} else {
|
||||
bcm47xx_fill_sprom(out, NULL, false);
|
||||
}
|
||||
return 0;
|
||||
default:
|
||||
|
||||
+445
-333
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,7 @@
|
||||
#include <linux/leds.h>
|
||||
#include <linux/mtd/physmap.h>
|
||||
#include <linux/ssb/ssb.h>
|
||||
#include <linux/ssb/ssb_embedded.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/reboot.h>
|
||||
#include <linux/gpio.h>
|
||||
@@ -116,7 +117,8 @@ static irqreturn_t gpio_interrupt(int irq, void *ignored)
|
||||
|
||||
/* Interrupt are level triggered, revert the interrupt polarity
|
||||
to clear the interrupt. */
|
||||
gpio_polarity(WGT634U_GPIO_RESET, state);
|
||||
ssb_gpio_polarity(&bcm47xx_bus.ssb, 1 << WGT634U_GPIO_RESET,
|
||||
state ? 1 << WGT634U_GPIO_RESET : 0);
|
||||
|
||||
if (!state) {
|
||||
printk(KERN_INFO "Reset button pressed");
|
||||
@@ -150,7 +152,9 @@ static int __init wgt634u_init(void)
|
||||
gpio_interrupt, IRQF_SHARED,
|
||||
"WGT634U GPIO", &bcm47xx_bus.ssb.chipco)) {
|
||||
gpio_direction_input(WGT634U_GPIO_RESET);
|
||||
gpio_intmask(WGT634U_GPIO_RESET, 1);
|
||||
ssb_gpio_intmask(&bcm47xx_bus.ssb,
|
||||
1 << WGT634U_GPIO_RESET,
|
||||
1 << WGT634U_GPIO_RESET);
|
||||
ssb_chipco_irq_mask(&bcm47xx_bus.ssb.chipco,
|
||||
SSB_CHIPCO_IRQ_GPIO,
|
||||
SSB_CHIPCO_IRQ_GPIO);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
obj-y += clk.o cpu.o cs.o gpio.o irq.o prom.o setup.o timer.o \
|
||||
dev-dsp.o dev-enet.o dev-flash.o dev-pcmcia.o dev-rng.o \
|
||||
dev-spi.o dev-uart.o dev-wdt.o dev-usb-usbd.o
|
||||
obj-y += clk.o cpu.o cs.o gpio.o irq.o nvram.o prom.o reset.o \
|
||||
setup.o timer.o dev-dsp.o dev-enet.o dev-flash.o \
|
||||
dev-pcmcia.o dev-rng.o dev-spi.o dev-uart.o dev-wdt.o \
|
||||
dev-usb-usbd.o
|
||||
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
|
||||
|
||||
obj-y += boards/
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <bcm63xx_dev_uart.h>
|
||||
#include <bcm63xx_regs.h>
|
||||
#include <bcm63xx_io.h>
|
||||
#include <bcm63xx_nvram.h>
|
||||
#include <bcm63xx_dev_pci.h>
|
||||
#include <bcm63xx_dev_enet.h>
|
||||
#include <bcm63xx_dev_dsp.h>
|
||||
@@ -29,8 +30,6 @@
|
||||
|
||||
#define PFX "board_bcm963xx: "
|
||||
|
||||
static struct bcm963xx_nvram nvram;
|
||||
static unsigned int mac_addr_used;
|
||||
static struct board_info board;
|
||||
|
||||
/*
|
||||
@@ -715,51 +714,15 @@ const char *board_get_name(void)
|
||||
return board.name;
|
||||
}
|
||||
|
||||
/*
|
||||
* register & return a new board mac address
|
||||
*/
|
||||
static int board_get_mac_address(u8 *mac)
|
||||
{
|
||||
u8 *oui;
|
||||
int count;
|
||||
|
||||
if (mac_addr_used >= nvram.mac_addr_count) {
|
||||
printk(KERN_ERR PFX "not enough mac address\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
memcpy(mac, nvram.mac_addr_base, ETH_ALEN);
|
||||
oui = mac + ETH_ALEN/2 - 1;
|
||||
count = mac_addr_used;
|
||||
|
||||
while (count--) {
|
||||
u8 *p = mac + ETH_ALEN - 1;
|
||||
|
||||
do {
|
||||
(*p)++;
|
||||
if (*p != 0)
|
||||
break;
|
||||
p--;
|
||||
} while (p != oui);
|
||||
|
||||
if (p == oui) {
|
||||
printk(KERN_ERR PFX "unable to fetch mac address\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
|
||||
mac_addr_used++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* early init callback, read nvram data from flash and checksum it
|
||||
*/
|
||||
void __init board_prom_init(void)
|
||||
{
|
||||
unsigned int check_len, i;
|
||||
u8 *boot_addr, *cfe, *p;
|
||||
unsigned int i;
|
||||
u8 *boot_addr, *cfe;
|
||||
char cfe_version[32];
|
||||
char *board_name;
|
||||
u32 val;
|
||||
|
||||
/* read base address of boot chip select (0)
|
||||
@@ -782,27 +745,15 @@ void __init board_prom_init(void)
|
||||
strcpy(cfe_version, "unknown");
|
||||
printk(KERN_INFO PFX "CFE version: %s\n", cfe_version);
|
||||
|
||||
/* extract nvram data */
|
||||
memcpy(&nvram, boot_addr + BCM963XX_NVRAM_OFFSET, sizeof(nvram));
|
||||
|
||||
/* check checksum before using data */
|
||||
if (nvram.version <= 4)
|
||||
check_len = offsetof(struct bcm963xx_nvram, checksum_old);
|
||||
else
|
||||
check_len = sizeof(nvram);
|
||||
val = 0;
|
||||
p = (u8 *)&nvram;
|
||||
while (check_len--)
|
||||
val += *p;
|
||||
if (val) {
|
||||
if (bcm63xx_nvram_init(boot_addr + BCM963XX_NVRAM_OFFSET)) {
|
||||
printk(KERN_ERR PFX "invalid nvram checksum\n");
|
||||
return;
|
||||
}
|
||||
|
||||
board_name = bcm63xx_nvram_get_name();
|
||||
/* find board by name */
|
||||
for (i = 0; i < ARRAY_SIZE(bcm963xx_boards); i++) {
|
||||
if (strncmp(nvram.name, bcm963xx_boards[i]->name,
|
||||
sizeof(nvram.name)))
|
||||
if (strncmp(board_name, bcm963xx_boards[i]->name, 16))
|
||||
continue;
|
||||
/* copy, board desc array is marked initdata */
|
||||
memcpy(&board, bcm963xx_boards[i], sizeof(board));
|
||||
@@ -812,7 +763,7 @@ void __init board_prom_init(void)
|
||||
/* bail out if board is not found, will complain later */
|
||||
if (!board.name[0]) {
|
||||
char name[17];
|
||||
memcpy(name, nvram.name, 16);
|
||||
memcpy(name, board_name, 16);
|
||||
name[16] = 0;
|
||||
printk(KERN_ERR PFX "unknown bcm963xx board: %s\n",
|
||||
name);
|
||||
@@ -890,11 +841,11 @@ int __init board_register_devices(void)
|
||||
bcm63xx_pcmcia_register();
|
||||
|
||||
if (board.has_enet0 &&
|
||||
!board_get_mac_address(board.enet0.mac_addr))
|
||||
!bcm63xx_nvram_get_mac_address(board.enet0.mac_addr))
|
||||
bcm63xx_enet_register(0, &board.enet0);
|
||||
|
||||
if (board.has_enet1 &&
|
||||
!board_get_mac_address(board.enet1.mac_addr))
|
||||
!bcm63xx_nvram_get_mac_address(board.enet1.mac_addr))
|
||||
bcm63xx_enet_register(1, &board.enet1);
|
||||
|
||||
if (board.has_usbd)
|
||||
@@ -907,7 +858,7 @@ int __init board_register_devices(void)
|
||||
* do this after registering enet devices
|
||||
*/
|
||||
#ifdef CONFIG_SSB_PCIHOST
|
||||
if (!board_get_mac_address(bcm63xx_sprom.il0mac)) {
|
||||
if (!bcm63xx_nvram_get_mac_address(bcm63xx_sprom.il0mac)) {
|
||||
memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN);
|
||||
memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN);
|
||||
if (ssb_arch_register_fallback_sprom(
|
||||
|
||||
+20
-14
@@ -14,6 +14,7 @@
|
||||
#include <bcm63xx_cpu.h>
|
||||
#include <bcm63xx_io.h>
|
||||
#include <bcm63xx_regs.h>
|
||||
#include <bcm63xx_reset.h>
|
||||
#include <bcm63xx_clk.h>
|
||||
|
||||
static DEFINE_MUTEX(clocks_mutex);
|
||||
@@ -124,15 +125,10 @@ static void enetsw_set(struct clk *clk, int enable)
|
||||
CKCTL_6368_SWPKT_USB_EN |
|
||||
CKCTL_6368_SWPKT_SAR_EN, enable);
|
||||
if (enable) {
|
||||
u32 val;
|
||||
|
||||
/* reset switch core afer clock change */
|
||||
val = bcm_perf_readl(PERF_SOFTRESET_6368_REG);
|
||||
val &= ~SOFTRESET_6368_ENETSW_MASK;
|
||||
bcm_perf_writel(val, PERF_SOFTRESET_6368_REG);
|
||||
bcm63xx_core_set_reset(BCM63XX_RESET_ENETSW, 1);
|
||||
msleep(10);
|
||||
val |= SOFTRESET_6368_ENETSW_MASK;
|
||||
bcm_perf_writel(val, PERF_SOFTRESET_6368_REG);
|
||||
bcm63xx_core_set_reset(BCM63XX_RESET_ENETSW, 0);
|
||||
msleep(10);
|
||||
}
|
||||
}
|
||||
@@ -222,15 +218,10 @@ static void xtm_set(struct clk *clk, int enable)
|
||||
CKCTL_6368_SWPKT_SAR_EN, enable);
|
||||
|
||||
if (enable) {
|
||||
u32 val;
|
||||
|
||||
/* reset sar core afer clock change */
|
||||
val = bcm_perf_readl(PERF_SOFTRESET_6368_REG);
|
||||
val &= ~SOFTRESET_6368_SAR_MASK;
|
||||
bcm_perf_writel(val, PERF_SOFTRESET_6368_REG);
|
||||
bcm63xx_core_set_reset(BCM63XX_RESET_SAR, 1);
|
||||
mdelay(1);
|
||||
val |= SOFTRESET_6368_SAR_MASK;
|
||||
bcm_perf_writel(val, PERF_SOFTRESET_6368_REG);
|
||||
bcm63xx_core_set_reset(BCM63XX_RESET_SAR, 0);
|
||||
mdelay(1);
|
||||
}
|
||||
}
|
||||
@@ -252,6 +243,19 @@ static struct clk clk_ipsec = {
|
||||
.set = ipsec_set,
|
||||
};
|
||||
|
||||
/*
|
||||
* PCIe clock
|
||||
*/
|
||||
|
||||
static void pcie_set(struct clk *clk, int enable)
|
||||
{
|
||||
bcm_hwclock_set(CKCTL_6328_PCIE_EN, enable);
|
||||
}
|
||||
|
||||
static struct clk clk_pcie = {
|
||||
.set = pcie_set,
|
||||
};
|
||||
|
||||
/*
|
||||
* Internal peripheral clock
|
||||
*/
|
||||
@@ -313,6 +317,8 @@ struct clk *clk_get(struct device *dev, const char *id)
|
||||
return &clk_pcm;
|
||||
if (BCMCPU_IS_6368() && !strcmp(id, "ipsec"))
|
||||
return &clk_ipsec;
|
||||
if (BCMCPU_IS_6328() && !strcmp(id, "pcie"))
|
||||
return &clk_pcie;
|
||||
return ERR_PTR(-ENOENT);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* 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) 2008 Maxime Bizon <mbizon@freebox.fr>
|
||||
* Copyright (C) 2008 Florian Fainelli <florian@openwrt.org>
|
||||
* Copyright (C) 2012 Jonas Gorski <jonas.gorski@gmail.com>
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) "bcm63xx_nvram: " fmt
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/crc32.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/if_ether.h>
|
||||
|
||||
#include <bcm63xx_nvram.h>
|
||||
|
||||
/*
|
||||
* nvram structure
|
||||
*/
|
||||
struct bcm963xx_nvram {
|
||||
u32 version;
|
||||
u8 reserved1[256];
|
||||
u8 name[16];
|
||||
u32 main_tp_number;
|
||||
u32 psi_size;
|
||||
u32 mac_addr_count;
|
||||
u8 mac_addr_base[ETH_ALEN];
|
||||
u8 reserved2[2];
|
||||
u32 checksum_old;
|
||||
u8 reserved3[720];
|
||||
u32 checksum_high;
|
||||
};
|
||||
|
||||
static struct bcm963xx_nvram nvram;
|
||||
static int mac_addr_used;
|
||||
|
||||
int __init bcm63xx_nvram_init(void *addr)
|
||||
{
|
||||
unsigned int check_len;
|
||||
u32 crc, expected_crc;
|
||||
|
||||
/* extract nvram data */
|
||||
memcpy(&nvram, addr, sizeof(nvram));
|
||||
|
||||
/* check checksum before using data */
|
||||
if (nvram.version <= 4) {
|
||||
check_len = offsetof(struct bcm963xx_nvram, reserved3);
|
||||
expected_crc = nvram.checksum_old;
|
||||
nvram.checksum_old = 0;
|
||||
} else {
|
||||
check_len = sizeof(nvram);
|
||||
expected_crc = nvram.checksum_high;
|
||||
nvram.checksum_high = 0;
|
||||
}
|
||||
|
||||
crc = crc32_le(~0, (u8 *)&nvram, check_len);
|
||||
|
||||
if (crc != expected_crc)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
u8 *bcm63xx_nvram_get_name(void)
|
||||
{
|
||||
return nvram.name;
|
||||
}
|
||||
EXPORT_SYMBOL(bcm63xx_nvram_get_name);
|
||||
|
||||
int bcm63xx_nvram_get_mac_address(u8 *mac)
|
||||
{
|
||||
u8 *oui;
|
||||
int count;
|
||||
|
||||
if (mac_addr_used >= nvram.mac_addr_count) {
|
||||
pr_err("not enough mac addresses\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
memcpy(mac, nvram.mac_addr_base, ETH_ALEN);
|
||||
oui = mac + ETH_ALEN/2 - 1;
|
||||
count = mac_addr_used;
|
||||
|
||||
while (count--) {
|
||||
u8 *p = mac + ETH_ALEN - 1;
|
||||
|
||||
do {
|
||||
(*p)++;
|
||||
if (*p != 0)
|
||||
break;
|
||||
p--;
|
||||
} while (p != oui);
|
||||
|
||||
if (p == oui) {
|
||||
pr_err("unable to fetch mac address\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
|
||||
mac_addr_used++;
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(bcm63xx_nvram_get_mac_address);
|
||||
@@ -0,0 +1,223 @@
|
||||
/*
|
||||
* 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) 2012 Jonas Gorski <jonas.gorski@gmail.com>
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/delay.h>
|
||||
#include <bcm63xx_cpu.h>
|
||||
#include <bcm63xx_io.h>
|
||||
#include <bcm63xx_regs.h>
|
||||
#include <bcm63xx_reset.h>
|
||||
|
||||
#define __GEN_RESET_BITS_TABLE(__cpu) \
|
||||
[BCM63XX_RESET_SPI] = BCM## __cpu ##_RESET_SPI, \
|
||||
[BCM63XX_RESET_ENET] = BCM## __cpu ##_RESET_ENET, \
|
||||
[BCM63XX_RESET_USBH] = BCM## __cpu ##_RESET_USBH, \
|
||||
[BCM63XX_RESET_USBD] = BCM## __cpu ##_RESET_USBD, \
|
||||
[BCM63XX_RESET_DSL] = BCM## __cpu ##_RESET_DSL, \
|
||||
[BCM63XX_RESET_SAR] = BCM## __cpu ##_RESET_SAR, \
|
||||
[BCM63XX_RESET_EPHY] = BCM## __cpu ##_RESET_EPHY, \
|
||||
[BCM63XX_RESET_ENETSW] = BCM## __cpu ##_RESET_ENETSW, \
|
||||
[BCM63XX_RESET_PCM] = BCM## __cpu ##_RESET_PCM, \
|
||||
[BCM63XX_RESET_MPI] = BCM## __cpu ##_RESET_MPI, \
|
||||
[BCM63XX_RESET_PCIE] = BCM## __cpu ##_RESET_PCIE, \
|
||||
[BCM63XX_RESET_PCIE_EXT] = BCM## __cpu ##_RESET_PCIE_EXT,
|
||||
|
||||
#define BCM6328_RESET_SPI SOFTRESET_6328_SPI_MASK
|
||||
#define BCM6328_RESET_ENET 0
|
||||
#define BCM6328_RESET_USBH SOFTRESET_6328_USBH_MASK
|
||||
#define BCM6328_RESET_USBD SOFTRESET_6328_USBS_MASK
|
||||
#define BCM6328_RESET_DSL 0
|
||||
#define BCM6328_RESET_SAR SOFTRESET_6328_SAR_MASK
|
||||
#define BCM6328_RESET_EPHY SOFTRESET_6328_EPHY_MASK
|
||||
#define BCM6328_RESET_ENETSW SOFTRESET_6328_ENETSW_MASK
|
||||
#define BCM6328_RESET_PCM SOFTRESET_6328_PCM_MASK
|
||||
#define BCM6328_RESET_MPI 0
|
||||
#define BCM6328_RESET_PCIE \
|
||||
(SOFTRESET_6328_PCIE_MASK | \
|
||||
SOFTRESET_6328_PCIE_CORE_MASK | \
|
||||
SOFTRESET_6328_PCIE_HARD_MASK)
|
||||
#define BCM6328_RESET_PCIE_EXT SOFTRESET_6328_PCIE_EXT_MASK
|
||||
|
||||
#define BCM6338_RESET_SPI SOFTRESET_6338_SPI_MASK
|
||||
#define BCM6338_RESET_ENET SOFTRESET_6338_ENET_MASK
|
||||
#define BCM6338_RESET_USBH SOFTRESET_6338_USBH_MASK
|
||||
#define BCM6338_RESET_USBD SOFTRESET_6338_USBS_MASK
|
||||
#define BCM6338_RESET_DSL SOFTRESET_6338_ADSL_MASK
|
||||
#define BCM6338_RESET_SAR SOFTRESET_6338_SAR_MASK
|
||||
#define BCM6338_RESET_EPHY 0
|
||||
#define BCM6338_RESET_ENETSW 0
|
||||
#define BCM6338_RESET_PCM 0
|
||||
#define BCM6338_RESET_MPI 0
|
||||
#define BCM6338_RESET_PCIE 0
|
||||
#define BCM6338_RESET_PCIE_EXT 0
|
||||
|
||||
#define BCM6348_RESET_SPI SOFTRESET_6348_SPI_MASK
|
||||
#define BCM6348_RESET_ENET SOFTRESET_6348_ENET_MASK
|
||||
#define BCM6348_RESET_USBH SOFTRESET_6348_USBH_MASK
|
||||
#define BCM6348_RESET_USBD SOFTRESET_6348_USBS_MASK
|
||||
#define BCM6348_RESET_DSL SOFTRESET_6348_ADSL_MASK
|
||||
#define BCM6348_RESET_SAR SOFTRESET_6348_SAR_MASK
|
||||
#define BCM6348_RESET_EPHY 0
|
||||
#define BCM6348_RESET_ENETSW 0
|
||||
#define BCM6348_RESET_PCM 0
|
||||
#define BCM6348_RESET_MPI 0
|
||||
#define BCM6348_RESET_PCIE 0
|
||||
#define BCM6348_RESET_PCIE_EXT 0
|
||||
|
||||
#define BCM6358_RESET_SPI SOFTRESET_6358_SPI_MASK
|
||||
#define BCM6358_RESET_ENET SOFTRESET_6358_ENET_MASK
|
||||
#define BCM6358_RESET_USBH SOFTRESET_6358_USBH_MASK
|
||||
#define BCM6358_RESET_USBD 0
|
||||
#define BCM6358_RESET_DSL SOFTRESET_6358_ADSL_MASK
|
||||
#define BCM6358_RESET_SAR SOFTRESET_6358_SAR_MASK
|
||||
#define BCM6358_RESET_EPHY SOFTRESET_6358_EPHY_MASK
|
||||
#define BCM6358_RESET_ENETSW 0
|
||||
#define BCM6358_RESET_PCM SOFTRESET_6358_PCM_MASK
|
||||
#define BCM6358_RESET_MPI SOFTRESET_6358_MPI_MASK
|
||||
#define BCM6358_RESET_PCIE 0
|
||||
#define BCM6358_RESET_PCIE_EXT 0
|
||||
|
||||
#define BCM6368_RESET_SPI SOFTRESET_6368_SPI_MASK
|
||||
#define BCM6368_RESET_ENET 0
|
||||
#define BCM6368_RESET_USBH SOFTRESET_6368_USBH_MASK
|
||||
#define BCM6368_RESET_USBD SOFTRESET_6368_USBS_MASK
|
||||
#define BCM6368_RESET_DSL 0
|
||||
#define BCM6368_RESET_SAR SOFTRESET_6368_SAR_MASK
|
||||
#define BCM6368_RESET_EPHY SOFTRESET_6368_EPHY_MASK
|
||||
#define BCM6368_RESET_ENETSW 0
|
||||
#define BCM6368_RESET_PCM SOFTRESET_6368_PCM_MASK
|
||||
#define BCM6368_RESET_MPI SOFTRESET_6368_MPI_MASK
|
||||
#define BCM6368_RESET_PCIE 0
|
||||
#define BCM6368_RESET_PCIE_EXT 0
|
||||
|
||||
#ifdef BCMCPU_RUNTIME_DETECT
|
||||
|
||||
/*
|
||||
* core reset bits
|
||||
*/
|
||||
static const u32 bcm6328_reset_bits[] = {
|
||||
__GEN_RESET_BITS_TABLE(6328)
|
||||
};
|
||||
|
||||
static const u32 bcm6338_reset_bits[] = {
|
||||
__GEN_RESET_BITS_TABLE(6338)
|
||||
};
|
||||
|
||||
static const u32 bcm6348_reset_bits[] = {
|
||||
__GEN_RESET_BITS_TABLE(6348)
|
||||
};
|
||||
|
||||
static const u32 bcm6358_reset_bits[] = {
|
||||
__GEN_RESET_BITS_TABLE(6358)
|
||||
};
|
||||
|
||||
static const u32 bcm6368_reset_bits[] = {
|
||||
__GEN_RESET_BITS_TABLE(6368)
|
||||
};
|
||||
|
||||
const u32 *bcm63xx_reset_bits;
|
||||
static int reset_reg;
|
||||
|
||||
static int __init bcm63xx_reset_bits_init(void)
|
||||
{
|
||||
if (BCMCPU_IS_6328()) {
|
||||
reset_reg = PERF_SOFTRESET_6328_REG;
|
||||
bcm63xx_reset_bits = bcm6328_reset_bits;
|
||||
} else if (BCMCPU_IS_6338()) {
|
||||
reset_reg = PERF_SOFTRESET_REG;
|
||||
bcm63xx_reset_bits = bcm6338_reset_bits;
|
||||
} else if (BCMCPU_IS_6348()) {
|
||||
reset_reg = PERF_SOFTRESET_REG;
|
||||
bcm63xx_reset_bits = bcm6348_reset_bits;
|
||||
} else if (BCMCPU_IS_6358()) {
|
||||
reset_reg = PERF_SOFTRESET_6358_REG;
|
||||
bcm63xx_reset_bits = bcm6358_reset_bits;
|
||||
} else if (BCMCPU_IS_6368()) {
|
||||
reset_reg = PERF_SOFTRESET_6368_REG;
|
||||
bcm63xx_reset_bits = bcm6368_reset_bits;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
|
||||
#ifdef CONFIG_BCM63XX_CPU_6328
|
||||
static const u32 bcm63xx_reset_bits[] = {
|
||||
__GEN_RESET_BITS_TABLE(6328)
|
||||
};
|
||||
#define reset_reg PERF_SOFTRESET_6328_REG
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BCM63XX_CPU_6338
|
||||
static const u32 bcm63xx_reset_bits[] = {
|
||||
__GEN_RESET_BITS_TABLE(6338)
|
||||
};
|
||||
#define reset_reg PERF_SOFTRESET_REG
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BCM63XX_CPU_6345
|
||||
static const u32 bcm63xx_reset_bits[] = { };
|
||||
#define reset_reg 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BCM63XX_CPU_6348
|
||||
static const u32 bcm63xx_reset_bits[] = {
|
||||
__GEN_RESET_BITS_TABLE(6348)
|
||||
};
|
||||
#define reset_reg PERF_SOFTRESET_REG
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BCM63XX_CPU_6358
|
||||
static const u32 bcm63xx_reset_bits[] = {
|
||||
__GEN_RESET_BITS_TABLE(6358)
|
||||
};
|
||||
#define reset_reg PERF_SOFTRESET_6358_REG
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BCM63XX_CPU_6368
|
||||
static const u32 bcm63xx_reset_bits[] = {
|
||||
__GEN_RESET_BITS_TABLE(6368)
|
||||
};
|
||||
#define reset_reg PERF_SOFTRESET_6368_REG
|
||||
#endif
|
||||
|
||||
static int __init bcm63xx_reset_bits_init(void) { return 0; }
|
||||
#endif
|
||||
|
||||
static DEFINE_SPINLOCK(reset_mutex);
|
||||
|
||||
static void __bcm63xx_core_set_reset(u32 mask, int enable)
|
||||
{
|
||||
unsigned long flags;
|
||||
u32 val;
|
||||
|
||||
if (!mask)
|
||||
return;
|
||||
|
||||
spin_lock_irqsave(&reset_mutex, flags);
|
||||
val = bcm_perf_readl(reset_reg);
|
||||
|
||||
if (enable)
|
||||
val &= ~mask;
|
||||
else
|
||||
val |= mask;
|
||||
|
||||
bcm_perf_writel(val, reset_reg);
|
||||
spin_unlock_irqrestore(&reset_mutex, flags);
|
||||
}
|
||||
|
||||
void bcm63xx_core_set_reset(enum bcm63xx_core_reset core, int reset)
|
||||
{
|
||||
__bcm63xx_core_set_reset(bcm63xx_reset_bits[core], reset);
|
||||
}
|
||||
EXPORT_SYMBOL(bcm63xx_core_set_reset);
|
||||
|
||||
postcore_initcall(bcm63xx_reset_bits_init);
|
||||
@@ -688,3 +688,8 @@ int64_t cvmx_bootmem_phy_named_block_alloc(uint64_t size, uint64_t min_addr,
|
||||
cvmx_spinlock_unlock((cvmx_spinlock_t *)&(cvmx_bootmem_desc->lock));
|
||||
return addr_allocated;
|
||||
}
|
||||
|
||||
struct cvmx_bootmem_desc *cvmx_bootmem_get_desc(void)
|
||||
{
|
||||
return cvmx_bootmem_desc;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,8 @@ static int __init flash_init(void)
|
||||
flash_map.name = "phys_mapped_flash";
|
||||
flash_map.phys = region_cfg.s.base << 16;
|
||||
flash_map.size = 0x1fc00000 - flash_map.phys;
|
||||
flash_map.bankwidth = 1;
|
||||
/* 8-bit bus (0 + 1) or 16-bit bus (1 + 1) */
|
||||
flash_map.bankwidth = region_cfg.s.width + 1;
|
||||
flash_map.virt = ioremap(flash_map.phys, flash_map.size);
|
||||
pr_notice("Bootbus flash: Setting flash for %luMB flash at "
|
||||
"0x%08llx\n", flash_map.size >> 20, flash_map.phys);
|
||||
|
||||
@@ -1266,7 +1266,6 @@ static void __init octeon_irq_init_ciu(void)
|
||||
octeon_irq_force_ciu_mapping(ciu_domain, i + OCTEON_IRQ_TIMER0, 0, i + 52);
|
||||
|
||||
octeon_irq_force_ciu_mapping(ciu_domain, OCTEON_IRQ_USB0, 0, 56);
|
||||
octeon_irq_force_ciu_mapping(ciu_domain, OCTEON_IRQ_BOOTDMA, 0, 63);
|
||||
|
||||
/* CIU_1 */
|
||||
for (i = 0; i < 16; i++)
|
||||
|
||||
@@ -79,11 +79,6 @@
|
||||
/*
|
||||
* Only on the 64-bit kernel we can made use of 64-bit registers.
|
||||
*/
|
||||
#ifdef CONFIG_64BIT
|
||||
#define USE_DOUBLE
|
||||
#endif
|
||||
|
||||
#ifdef USE_DOUBLE
|
||||
|
||||
#define LOAD ld
|
||||
#define LOADL ldl
|
||||
@@ -119,26 +114,6 @@
|
||||
#define t6 $14
|
||||
#define t7 $15
|
||||
|
||||
#else
|
||||
|
||||
#define LOAD lw
|
||||
#define LOADL lwl
|
||||
#define LOADR lwr
|
||||
#define STOREL swl
|
||||
#define STORER swr
|
||||
#define STORE sw
|
||||
#define ADD addu
|
||||
#define SUB subu
|
||||
#define SRL srl
|
||||
#define SLL sll
|
||||
#define SRA sra
|
||||
#define SLLV sllv
|
||||
#define SRLV srlv
|
||||
#define NBYTES 4
|
||||
#define LOG_NBYTES 2
|
||||
|
||||
#endif /* USE_DOUBLE */
|
||||
|
||||
#ifdef CONFIG_CPU_LITTLE_ENDIAN
|
||||
#define LDFIRST LOADR
|
||||
#define LDREST LOADL
|
||||
@@ -395,12 +370,10 @@ EXC( sb t0, N(dst), s_exc_p1)
|
||||
|
||||
COPY_BYTE(0)
|
||||
COPY_BYTE(1)
|
||||
#ifdef USE_DOUBLE
|
||||
COPY_BYTE(2)
|
||||
COPY_BYTE(3)
|
||||
COPY_BYTE(4)
|
||||
COPY_BYTE(5)
|
||||
#endif
|
||||
EXC( lb t0, NBYTES-2(src), l_exc)
|
||||
SUB len, len, 1
|
||||
jr ra
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user