mirror of
https://github.com/AetherDroid/android_kernel_samsung_on5xelte.git
synced 2025-09-07 16:58:04 -04:00
Fixed MTP to work with TWRP
This commit is contained in:
commit
f6dfaef42e
50820 changed files with 20846062 additions and 0 deletions
461
arch/xtensa/Kconfig
Normal file
461
arch/xtensa/Kconfig
Normal file
|
@ -0,0 +1,461 @@
|
|||
config ZONE_DMA
|
||||
def_bool y
|
||||
|
||||
config XTENSA
|
||||
def_bool y
|
||||
select ARCH_WANT_FRAME_POINTERS
|
||||
select ARCH_WANT_IPC_PARSE_VERSION
|
||||
select ARCH_WANT_OPTIONAL_GPIOLIB
|
||||
select BUILDTIME_EXTABLE_SORT
|
||||
select CLONE_BACKWARDS
|
||||
select COMMON_CLK
|
||||
select GENERIC_ATOMIC64
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select GENERIC_IRQ_SHOW
|
||||
select GENERIC_PCI_IOMAP
|
||||
select GENERIC_SCHED_CLOCK
|
||||
select HAVE_FUNCTION_TRACER
|
||||
select HAVE_IRQ_TIME_ACCOUNTING
|
||||
select HAVE_OPROFILE
|
||||
select HAVE_PERF_EVENTS
|
||||
select IRQ_DOMAIN
|
||||
select MODULES_USE_ELF_RELA
|
||||
select VIRT_TO_BUS
|
||||
help
|
||||
Xtensa processors are 32-bit RISC machines designed by Tensilica
|
||||
primarily for embedded systems. These processors are both
|
||||
configurable and extensible. The Linux port to the Xtensa
|
||||
architecture supports all processor configurations and extensions,
|
||||
with reasonable minimum requirements. The Xtensa Linux project has
|
||||
a home page at <http://www.linux-xtensa.org/>.
|
||||
|
||||
config RWSEM_XCHGADD_ALGORITHM
|
||||
def_bool y
|
||||
|
||||
config GENERIC_HWEIGHT
|
||||
def_bool y
|
||||
|
||||
config ARCH_HAS_ILOG2_U32
|
||||
def_bool n
|
||||
|
||||
config ARCH_HAS_ILOG2_U64
|
||||
def_bool n
|
||||
|
||||
config NO_IOPORT_MAP
|
||||
def_bool n
|
||||
|
||||
config HZ
|
||||
int
|
||||
default 100
|
||||
|
||||
source "init/Kconfig"
|
||||
source "kernel/Kconfig.freezer"
|
||||
|
||||
config LOCKDEP_SUPPORT
|
||||
def_bool y
|
||||
|
||||
config STACKTRACE_SUPPORT
|
||||
def_bool y
|
||||
|
||||
config TRACE_IRQFLAGS_SUPPORT
|
||||
def_bool y
|
||||
|
||||
config MMU
|
||||
bool
|
||||
default n if !XTENSA_VARIANT_CUSTOM
|
||||
default XTENSA_VARIANT_MMU if XTENSA_VARIANT_CUSTOM
|
||||
|
||||
config VARIANT_IRQ_SWITCH
|
||||
def_bool n
|
||||
|
||||
config HAVE_XTENSA_GPIO32
|
||||
def_bool n
|
||||
|
||||
config MAY_HAVE_SMP
|
||||
def_bool n
|
||||
|
||||
menu "Processor type and features"
|
||||
|
||||
choice
|
||||
prompt "Xtensa Processor Configuration"
|
||||
default XTENSA_VARIANT_FSF
|
||||
|
||||
config XTENSA_VARIANT_FSF
|
||||
bool "fsf - default (not generic) configuration"
|
||||
select MMU
|
||||
|
||||
config XTENSA_VARIANT_DC232B
|
||||
bool "dc232b - Diamond 232L Standard Core Rev.B (LE)"
|
||||
select MMU
|
||||
select HAVE_XTENSA_GPIO32
|
||||
help
|
||||
This variant refers to Tensilica's Diamond 232L Standard core Rev.B (LE).
|
||||
|
||||
config XTENSA_VARIANT_DC233C
|
||||
bool "dc233c - Diamond 233L Standard Core Rev.C (LE)"
|
||||
select MMU
|
||||
select HAVE_XTENSA_GPIO32
|
||||
help
|
||||
This variant refers to Tensilica's Diamond 233L Standard core Rev.C (LE).
|
||||
|
||||
config XTENSA_VARIANT_S6000
|
||||
bool "s6000 - Stretch software configurable processor"
|
||||
select VARIANT_IRQ_SWITCH
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
select XTENSA_CALIBRATE_CCOUNT
|
||||
|
||||
config XTENSA_VARIANT_CUSTOM
|
||||
bool "Custom Xtensa processor configuration"
|
||||
select MAY_HAVE_SMP
|
||||
select HAVE_XTENSA_GPIO32
|
||||
help
|
||||
Select this variant to use a custom Xtensa processor configuration.
|
||||
You will be prompted for a processor variant CORENAME.
|
||||
endchoice
|
||||
|
||||
config XTENSA_VARIANT_CUSTOM_NAME
|
||||
string "Xtensa Processor Custom Core Variant Name"
|
||||
depends on XTENSA_VARIANT_CUSTOM
|
||||
help
|
||||
Provide the name of a custom Xtensa processor variant.
|
||||
This CORENAME selects arch/xtensa/variant/CORENAME.
|
||||
Dont forget you have to select MMU if you have one.
|
||||
|
||||
config XTENSA_VARIANT_NAME
|
||||
string
|
||||
default "dc232b" if XTENSA_VARIANT_DC232B
|
||||
default "dc233c" if XTENSA_VARIANT_DC233C
|
||||
default "fsf" if XTENSA_VARIANT_FSF
|
||||
default "s6000" if XTENSA_VARIANT_S6000
|
||||
default XTENSA_VARIANT_CUSTOM_NAME if XTENSA_VARIANT_CUSTOM
|
||||
|
||||
config XTENSA_VARIANT_MMU
|
||||
bool "Core variant has a Full MMU (TLB, Pages, Protection, etc)"
|
||||
depends on XTENSA_VARIANT_CUSTOM
|
||||
default y
|
||||
help
|
||||
Build a Conventional Kernel with full MMU support,
|
||||
ie: it supports a TLB with auto-loading, page protection.
|
||||
|
||||
config XTENSA_UNALIGNED_USER
|
||||
bool "Unaligned memory access in use space"
|
||||
help
|
||||
The Xtensa architecture currently does not handle unaligned
|
||||
memory accesses in hardware but through an exception handler.
|
||||
Per default, unaligned memory accesses are disabled in user space.
|
||||
|
||||
Say Y here to enable unaligned memory access in user space.
|
||||
|
||||
source "kernel/Kconfig.preempt"
|
||||
|
||||
config HAVE_SMP
|
||||
bool "System Supports SMP (MX)"
|
||||
depends on MAY_HAVE_SMP
|
||||
select XTENSA_MX
|
||||
help
|
||||
This option is use to indicate that the system-on-a-chip (SOC)
|
||||
supports Multiprocessing. Multiprocessor support implemented above
|
||||
the CPU core definition and currently needs to be selected manually.
|
||||
|
||||
Multiprocessor support in implemented with external cache and
|
||||
interrupt controlers.
|
||||
|
||||
The MX interrupt distributer adds Interprocessor Interrupts
|
||||
and causes the IRQ numbers to be increased by 4 for devices
|
||||
like the open cores ethernet driver and the serial interface.
|
||||
|
||||
You still have to select "Enable SMP" to enable SMP on this SOC.
|
||||
|
||||
config SMP
|
||||
bool "Enable Symmetric multi-processing support"
|
||||
depends on HAVE_SMP
|
||||
select GENERIC_SMP_IDLE_THREAD
|
||||
help
|
||||
Enabled SMP Software; allows more than one CPU/CORE
|
||||
to be activated during startup.
|
||||
|
||||
config NR_CPUS
|
||||
depends on SMP
|
||||
int "Maximum number of CPUs (2-32)"
|
||||
range 2 32
|
||||
default "4"
|
||||
|
||||
config HOTPLUG_CPU
|
||||
bool "Enable CPU hotplug support"
|
||||
depends on SMP
|
||||
help
|
||||
Say Y here to allow turning CPUs off and on. CPUs can be
|
||||
controlled through /sys/devices/system/cpu.
|
||||
|
||||
Say N if you want to disable CPU hotplug.
|
||||
|
||||
config INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
|
||||
bool "Initialize Xtensa MMU inside the Linux kernel code"
|
||||
depends on MMU
|
||||
default y
|
||||
help
|
||||
Earlier version initialized the MMU in the exception vector
|
||||
before jumping to _startup in head.S and had an advantage that
|
||||
it was possible to place a software breakpoint at 'reset' and
|
||||
then enter your normal kernel breakpoints once the MMU was mapped
|
||||
to the kernel mappings (0XC0000000).
|
||||
|
||||
This unfortunately doesn't work for U-Boot and likley also wont
|
||||
work for using KEXEC to have a hot kernel ready for doing a
|
||||
KDUMP.
|
||||
|
||||
So now the MMU is initialized in head.S but it's necessary to
|
||||
use hardware breakpoints (gdb 'hbreak' cmd) to break at _startup.
|
||||
xt-gdb can't place a Software Breakpoint in the 0XD region prior
|
||||
to mapping the MMU and after mapping even if the area of low memory
|
||||
was mapped gdb wouldn't remove the breakpoint on hitting it as the
|
||||
PC wouldn't match. Since Hardware Breakpoints are recommended for
|
||||
Linux configurations it seems reasonable to just assume they exist
|
||||
and leave this older mechanism for unfortunate souls that choose
|
||||
not to follow Tensilica's recommendation.
|
||||
|
||||
Selecting this will cause U-Boot to set the KERNEL Load and Entry
|
||||
address at 0x00003000 instead of the mapped std of 0xD0003000.
|
||||
|
||||
If in doubt, say Y.
|
||||
|
||||
config HIGHMEM
|
||||
bool "High Memory Support"
|
||||
depends on MMU
|
||||
help
|
||||
Linux can use the full amount of RAM in the system by
|
||||
default. However, the default MMUv2 setup only maps the
|
||||
lowermost 128 MB of memory linearly to the areas starting
|
||||
at 0xd0000000 (cached) and 0xd8000000 (uncached).
|
||||
When there are more than 128 MB memory in the system not
|
||||
all of it can be "permanently mapped" by the kernel.
|
||||
The physical memory that's not permanently mapped is called
|
||||
"high memory".
|
||||
|
||||
If you are compiling a kernel which will never run on a
|
||||
machine with more than 128 MB total physical RAM, answer
|
||||
N here.
|
||||
|
||||
If unsure, say Y.
|
||||
|
||||
config FAST_SYSCALL_XTENSA
|
||||
bool "Enable fast atomic syscalls"
|
||||
default n
|
||||
help
|
||||
fast_syscall_xtensa is a syscall that can make atomic operations
|
||||
on UP kernel when processor has no s32c1i support.
|
||||
|
||||
This syscall is deprecated. It may have issues when called with
|
||||
invalid arguments. It is provided only for backwards compatibility.
|
||||
Only enable it if your userspace software requires it.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config FAST_SYSCALL_SPILL_REGISTERS
|
||||
bool "Enable spill registers syscall"
|
||||
default n
|
||||
help
|
||||
fast_syscall_spill_registers is a syscall that spills all active
|
||||
register windows of a calling userspace task onto its stack.
|
||||
|
||||
This syscall is deprecated. It may have issues when called with
|
||||
invalid arguments. It is provided only for backwards compatibility.
|
||||
Only enable it if your userspace software requires it.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
endmenu
|
||||
|
||||
config XTENSA_CALIBRATE_CCOUNT
|
||||
def_bool n
|
||||
help
|
||||
On some platforms (XT2000, for example), the CPU clock rate can
|
||||
vary. The frequency can be determined, however, by measuring
|
||||
against a well known, fixed frequency, such as an UART oscillator.
|
||||
|
||||
config SERIAL_CONSOLE
|
||||
def_bool n
|
||||
|
||||
menu "Bus options"
|
||||
|
||||
config PCI
|
||||
bool "PCI support"
|
||||
default y
|
||||
help
|
||||
Find out whether you have a PCI motherboard. PCI is the name of a
|
||||
bus system, i.e. the way the CPU talks to the other stuff inside
|
||||
your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or
|
||||
VESA. If you have PCI, say Y, otherwise N.
|
||||
|
||||
source "drivers/pci/Kconfig"
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Platform options"
|
||||
|
||||
choice
|
||||
prompt "Xtensa System Type"
|
||||
default XTENSA_PLATFORM_ISS
|
||||
|
||||
config XTENSA_PLATFORM_ISS
|
||||
bool "ISS"
|
||||
select XTENSA_CALIBRATE_CCOUNT
|
||||
select SERIAL_CONSOLE
|
||||
help
|
||||
ISS is an acronym for Tensilica's Instruction Set Simulator.
|
||||
|
||||
config XTENSA_PLATFORM_XT2000
|
||||
bool "XT2000"
|
||||
select HAVE_IDE
|
||||
help
|
||||
XT2000 is the name of Tensilica's feature-rich emulation platform.
|
||||
This hardware is capable of running a full Linux distribution.
|
||||
|
||||
config XTENSA_PLATFORM_S6105
|
||||
bool "S6105"
|
||||
select HAVE_IDE
|
||||
select SERIAL_CONSOLE
|
||||
select NO_IOPORT_MAP
|
||||
|
||||
config XTENSA_PLATFORM_XTFPGA
|
||||
bool "XTFPGA"
|
||||
select ETHOC if ETHERNET
|
||||
select SERIAL_CONSOLE
|
||||
select XTENSA_CALIBRATE_CCOUNT
|
||||
help
|
||||
XTFPGA is the name of Tensilica board family (LX60, LX110, LX200, ML605).
|
||||
This hardware is capable of running a full Linux distribution.
|
||||
|
||||
endchoice
|
||||
|
||||
|
||||
config XTENSA_CPU_CLOCK
|
||||
int "CPU clock rate [MHz]"
|
||||
depends on !XTENSA_CALIBRATE_CCOUNT
|
||||
default 16
|
||||
|
||||
config GENERIC_CALIBRATE_DELAY
|
||||
bool "Auto calibration of the BogoMIPS value"
|
||||
help
|
||||
The BogoMIPS value can easily be derived from the CPU frequency.
|
||||
|
||||
config CMDLINE_BOOL
|
||||
bool "Default bootloader kernel arguments"
|
||||
|
||||
config CMDLINE
|
||||
string "Initial kernel command string"
|
||||
depends on CMDLINE_BOOL
|
||||
default "console=ttyS0,38400 root=/dev/ram"
|
||||
help
|
||||
On some architectures (EBSA110 and CATS), there is currently no way
|
||||
for the boot loader to pass arguments to the kernel. For these
|
||||
architectures, you should supply some command-line options at build
|
||||
time by entering them here. As a minimum, you should specify the
|
||||
memory size and the root device (e.g., mem=64M root=/dev/nfs).
|
||||
|
||||
config USE_OF
|
||||
bool "Flattened Device Tree support"
|
||||
select OF
|
||||
select OF_EARLY_FLATTREE
|
||||
help
|
||||
Include support for flattened device tree machine descriptions.
|
||||
|
||||
config BUILTIN_DTB
|
||||
string "DTB to build into the kernel image"
|
||||
depends on OF
|
||||
|
||||
config BLK_DEV_SIMDISK
|
||||
tristate "Host file-based simulated block device support"
|
||||
default n
|
||||
depends on XTENSA_PLATFORM_ISS && BLOCK
|
||||
help
|
||||
Create block devices that map to files in the host file system.
|
||||
Device binding to host file may be changed at runtime via proc
|
||||
interface provided the device is not in use.
|
||||
|
||||
config BLK_DEV_SIMDISK_COUNT
|
||||
int "Number of host file-based simulated block devices"
|
||||
range 1 10
|
||||
depends on BLK_DEV_SIMDISK
|
||||
default 2
|
||||
help
|
||||
This is the default minimal number of created block devices.
|
||||
Kernel/module parameter 'simdisk_count' may be used to change this
|
||||
value at runtime. More file names (but no more than 10) may be
|
||||
specified as parameters, simdisk_count grows accordingly.
|
||||
|
||||
config SIMDISK0_FILENAME
|
||||
string "Host filename for the first simulated device"
|
||||
depends on BLK_DEV_SIMDISK = y
|
||||
default ""
|
||||
help
|
||||
Attach a first simdisk to a host file. Conventionally, this file
|
||||
contains a root file system.
|
||||
|
||||
config SIMDISK1_FILENAME
|
||||
string "Host filename for the second simulated device"
|
||||
depends on BLK_DEV_SIMDISK = y && BLK_DEV_SIMDISK_COUNT != 1
|
||||
default ""
|
||||
help
|
||||
Another simulated disk in a host file for a buildroot-independent
|
||||
storage.
|
||||
|
||||
source "mm/Kconfig"
|
||||
|
||||
source "drivers/pcmcia/Kconfig"
|
||||
|
||||
source "drivers/pci/hotplug/Kconfig"
|
||||
|
||||
config XTFPGA_LCD
|
||||
bool "Enable XTFPGA LCD driver"
|
||||
depends on XTENSA_PLATFORM_XTFPGA
|
||||
default n
|
||||
help
|
||||
There's a 2x16 LCD on most of XTFPGA boards, kernel may output
|
||||
progress messages there during bootup/shutdown. It may be useful
|
||||
during board bringup.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config XTFPGA_LCD_BASE_ADDR
|
||||
hex "XTFPGA LCD base address"
|
||||
depends on XTFPGA_LCD
|
||||
default "0x0d0c0000"
|
||||
help
|
||||
Base address of the LCD controller inside KIO region.
|
||||
Different boards from XTFPGA family have LCD controller at different
|
||||
addresses. Please consult prototyping user guide for your board for
|
||||
the correct address. Wrong address here may lead to hardware lockup.
|
||||
|
||||
config XTFPGA_LCD_8BIT_ACCESS
|
||||
bool "Use 8-bit access to XTFPGA LCD"
|
||||
depends on XTFPGA_LCD
|
||||
default n
|
||||
help
|
||||
LCD may be connected with 4- or 8-bit interface, 8-bit access may
|
||||
only be used with 8-bit interface. Please consult prototyping user
|
||||
guide for your board for the correct interface width.
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Executable file formats"
|
||||
|
||||
source "fs/Kconfig.binfmt"
|
||||
|
||||
endmenu
|
||||
|
||||
source "net/Kconfig"
|
||||
|
||||
source "drivers/Kconfig"
|
||||
|
||||
source "fs/Kconfig"
|
||||
|
||||
source "arch/xtensa/Kconfig.debug"
|
||||
|
||||
source "security/Kconfig"
|
||||
|
||||
source "crypto/Kconfig"
|
||||
|
||||
source "lib/Kconfig"
|
||||
|
||||
|
37
arch/xtensa/Kconfig.debug
Normal file
37
arch/xtensa/Kconfig.debug
Normal file
|
@ -0,0 +1,37 @@
|
|||
menu "Kernel hacking"
|
||||
|
||||
source "lib/Kconfig.debug"
|
||||
|
||||
config DEBUG_TLB_SANITY
|
||||
bool "Debug TLB sanity"
|
||||
depends on DEBUG_KERNEL
|
||||
help
|
||||
Enable this to turn on TLB sanity check on each entry to userspace.
|
||||
This check can spot missing TLB invalidation/wrong PTE permissions/
|
||||
premature page freeing.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config LD_NO_RELAX
|
||||
bool "Disable linker relaxation"
|
||||
default n
|
||||
help
|
||||
Enable this function to disable link-time optimizations.
|
||||
The default linker behavior is to combine identical literal
|
||||
values to reduce code size and remove unnecessary overhead from
|
||||
assembler-generated 'longcall' sequences.
|
||||
Enabling this option improves the link time but increases the
|
||||
code size, and possibly execution time.
|
||||
|
||||
config S32C1I_SELFTEST
|
||||
bool "Perform S32C1I instruction self-test at boot"
|
||||
default y
|
||||
help
|
||||
Enable this option to test S32C1I instruction behavior at boot.
|
||||
Correct operation of this instruction requires some cooperation from hardware
|
||||
external to the processor (such as bus bridge, bus fabric, or memory controller).
|
||||
It is easy to make wrong hardware configuration, this test should catch it early.
|
||||
|
||||
Say 'N' on stable hardware.
|
||||
|
||||
endmenu
|
107
arch/xtensa/Makefile
Normal file
107
arch/xtensa/Makefile
Normal file
|
@ -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) 2001 - 2005 Tensilica Inc.
|
||||
# Copyright (C) 2014 Cadence Design Systems Inc.
|
||||
#
|
||||
# This file is included by the global makefile so that you can add your own
|
||||
# architecture-specific flags and dependencies. Remember to do have actions
|
||||
# for "archclean" and "archdep" for cleaning up and making dependencies for
|
||||
# this architecture
|
||||
|
||||
# Core configuration.
|
||||
# (Use VAR=<xtensa_config> to use another default compiler.)
|
||||
|
||||
variant-y := $(patsubst "%",%,$(CONFIG_XTENSA_VARIANT_NAME))
|
||||
|
||||
VARIANT = $(variant-y)
|
||||
export VARIANT
|
||||
|
||||
# Test for cross compiling
|
||||
|
||||
ifneq ($(VARIANT),)
|
||||
COMPILE_ARCH = $(shell uname -m)
|
||||
|
||||
ifneq ($(COMPILE_ARCH), xtensa)
|
||||
ifndef CROSS_COMPILE
|
||||
CROSS_COMPILE = xtensa_$(VARIANT)-
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Platform configuration
|
||||
|
||||
platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000
|
||||
platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss
|
||||
platform-$(CONFIG_XTENSA_PLATFORM_S6105) := s6105
|
||||
platform-$(CONFIG_XTENSA_PLATFORM_XTFPGA) := xtfpga
|
||||
|
||||
PLATFORM = $(platform-y)
|
||||
export PLATFORM
|
||||
|
||||
# temporarily until string.h is fixed
|
||||
KBUILD_CFLAGS += -ffreestanding -D__linux__
|
||||
|
||||
KBUILD_CFLAGS += -pipe -mlongcalls
|
||||
|
||||
KBUILD_CFLAGS += $(call cc-option,-mforce-no-pic,)
|
||||
|
||||
ifneq ($(CONFIG_LD_NO_RELAX),)
|
||||
LDFLAGS := --no-relax
|
||||
endif
|
||||
|
||||
ifeq ($(shell echo __XTENSA_EB__ | $(CC) -E - | grep -v "\#"),1)
|
||||
CHECKFLAGS += -D__XTENSA_EB__
|
||||
endif
|
||||
ifeq ($(shell echo __XTENSA_EL__ | $(CC) -E - | grep -v "\#"),1)
|
||||
CHECKFLAGS += -D__XTENSA_EL__
|
||||
endif
|
||||
|
||||
vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y))
|
||||
plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y))
|
||||
|
||||
ifeq ($(KBUILD_SRC),)
|
||||
KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(vardirs) $(plfdirs))
|
||||
else
|
||||
KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs))
|
||||
endif
|
||||
|
||||
KBUILD_DEFCONFIG := iss_defconfig
|
||||
|
||||
# Only build variant and/or platform if it includes a Makefile
|
||||
|
||||
buildvar := $(shell test -e $(srctree)/arch/xtensa/variants/$(VARIANT)/Makefile && echo arch/xtensa/variants/$(VARIANT)/)
|
||||
buildplf := $(shell test -e $(srctree)/arch/xtensa/platforms/$(PLATFORM)/Makefile && echo arch/xtensa/platforms/$(PLATFORM)/)
|
||||
|
||||
# Find libgcc.a
|
||||
|
||||
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
|
||||
|
||||
head-y := arch/xtensa/kernel/head.o
|
||||
core-y += arch/xtensa/kernel/ arch/xtensa/mm/
|
||||
core-y += $(buildvar) $(buildplf)
|
||||
|
||||
libs-y += arch/xtensa/lib/ $(LIBGCC)
|
||||
drivers-$(CONFIG_OPROFILE) += arch/xtensa/oprofile/
|
||||
|
||||
ifneq ($(CONFIG_BUILTIN_DTB),"")
|
||||
core-$(CONFIG_OF) += arch/xtensa/boot/dts/
|
||||
endif
|
||||
|
||||
boot := arch/xtensa/boot
|
||||
|
||||
all: zImage
|
||||
|
||||
bzImage : zImage
|
||||
|
||||
zImage: vmlinux
|
||||
$(Q)$(MAKE) $(build)=$(boot) $@
|
||||
|
||||
%.dtb:
|
||||
$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
|
||||
|
||||
define archhelp
|
||||
@echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
|
||||
endef
|
44
arch/xtensa/boot/Makefile
Normal file
44
arch/xtensa/boot/Makefile
Normal file
|
@ -0,0 +1,44 @@
|
|||
#
|
||||
# arch/xtensa/boot/Makefile
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
# KBUILD_CFLAGS used when building rest of boot (takes effect recursively)
|
||||
KBUILD_CFLAGS += -fno-builtin -Iarch/$(ARCH)/boot/include
|
||||
HOSTFLAGS += -Iarch/$(ARCH)/boot/include
|
||||
|
||||
BIG_ENDIAN := $(shell echo __XTENSA_EB__ | $(CC) -E - | grep -v "\#")
|
||||
|
||||
export ccflags-y
|
||||
export BIG_ENDIAN
|
||||
|
||||
subdir-y := lib
|
||||
|
||||
# Subdirs for the boot loader(s)
|
||||
|
||||
bootdir-$(CONFIG_XTENSA_PLATFORM_ISS) += boot-elf
|
||||
bootdir-$(CONFIG_XTENSA_PLATFORM_XT2000) += boot-redboot boot-elf boot-uboot
|
||||
bootdir-$(CONFIG_XTENSA_PLATFORM_XTFPGA) += boot-redboot boot-elf boot-uboot
|
||||
|
||||
zImage Image: $(bootdir-y)
|
||||
|
||||
$(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \
|
||||
$(addprefix $(obj)/,$(host-progs))
|
||||
$(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS)
|
||||
|
||||
OBJCOPYFLAGS = --strip-all -R .comment -R .note.gnu.build-id -O binary
|
||||
|
||||
vmlinux.bin: vmlinux FORCE
|
||||
$(call if_changed,objcopy)
|
||||
|
||||
vmlinux.bin.gz: vmlinux.bin FORCE
|
||||
$(call if_changed,gzip)
|
||||
|
||||
boot-elf: vmlinux.bin
|
||||
boot-redboot: vmlinux.bin.gz
|
||||
boot-uboot: vmlinux.bin.gz
|
34
arch/xtensa/boot/boot-elf/Makefile
Normal file
34
arch/xtensa/boot/boot-elf/Makefile
Normal file
|
@ -0,0 +1,34 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
ifeq ($(BIG_ENDIAN),1)
|
||||
OBJCOPY_ARGS := -O elf32-xtensa-be
|
||||
else
|
||||
OBJCOPY_ARGS := -O elf32-xtensa-le
|
||||
endif
|
||||
|
||||
export OBJCOPY_ARGS
|
||||
export CPPFLAGS_boot.lds += -P -C
|
||||
export KBUILD_AFLAGS += -mtext-section-literals
|
||||
|
||||
boot-y := bootstrap.o
|
||||
|
||||
OBJS := $(addprefix $(obj)/,$(boot-y))
|
||||
|
||||
$(obj)/Image.o: vmlinux.bin $(OBJS)
|
||||
$(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
|
||||
--add-section image=vmlinux.bin \
|
||||
--set-section-flags image=contents,alloc,load,load,data \
|
||||
$(OBJS) $@
|
||||
|
||||
$(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds
|
||||
$(Q)$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
|
||||
-T $(obj)/boot.lds \
|
||||
--build-id=none \
|
||||
-o $@ $(obj)/Image.o
|
||||
$(Q)$(kecho) ' Kernel: $@ is ready'
|
||||
|
||||
zImage: $(obj)/../Image.elf
|
54
arch/xtensa/boot/boot-elf/boot.lds.S
Normal file
54
arch/xtensa/boot/boot-elf/boot.lds.S
Normal file
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* linux/arch/xtensa/boot/boot-elf/boot.lds.S
|
||||
*
|
||||
* Copyright (C) 2008 - 2013 by Tensilica Inc.
|
||||
*
|
||||
* Chris Zankel <chris@zankel.net>
|
||||
* Marc Gauthier <marc@tensilica.com
|
||||
* Pete Delaney <piet@tensilica.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <asm/vectors.h>
|
||||
OUTPUT_ARCH(xtensa)
|
||||
ENTRY(_ResetVector)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.ResetVector.text XCHAL_RESET_VECTOR_VADDR :
|
||||
{
|
||||
*(.ResetVector.text)
|
||||
}
|
||||
|
||||
.image KERNELOFFSET: AT (LOAD_MEMORY_ADDRESS)
|
||||
{
|
||||
_image_start = .;
|
||||
*(image)
|
||||
. = (. + 3) & ~ 3;
|
||||
_image_end = . ;
|
||||
}
|
||||
|
||||
.bss ((LOADADDR(.image) + SIZEOF(.image) + 3) & ~ 3):
|
||||
{
|
||||
__bss_start = .;
|
||||
*(.sbss)
|
||||
*(.scommon)
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
__bss_end = .;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is a remapped copy of the Reset Vector Code.
|
||||
* It keeps gdb in sync with the PC after switching
|
||||
* to the temporary mapping used while setting up
|
||||
* the V2 MMU mappings for Linux.
|
||||
*/
|
||||
.ResetVector.remapped_text 0x46000000 (INFO):
|
||||
{
|
||||
*(.ResetVector.remapped_text)
|
||||
}
|
||||
}
|
104
arch/xtensa/boot/boot-elf/bootstrap.S
Normal file
104
arch/xtensa/boot/boot-elf/bootstrap.S
Normal file
|
@ -0,0 +1,104 @@
|
|||
/*
|
||||
* arch/xtensa/boot/boot-elf/bootstrap.S
|
||||
*
|
||||
* Low-level exception handling
|
||||
*
|
||||
* 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) 2004 - 2013 by Tensilica Inc.
|
||||
*
|
||||
* Chris Zankel <chris@zankel.net>
|
||||
* Marc Gauthier <marc@tensilica.com>
|
||||
* Piet Delaney <piet@tensilica.com>
|
||||
*/
|
||||
|
||||
#include <asm/bootparam.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/cacheasm.h>
|
||||
#include <asm/initialize_mmu.h>
|
||||
#include <linux/linkage.h>
|
||||
|
||||
.section .ResetVector.text, "ax"
|
||||
.global _ResetVector
|
||||
.global reset
|
||||
|
||||
_ResetVector:
|
||||
_j _SetupMMU
|
||||
|
||||
.begin no-absolute-literals
|
||||
.literal_position
|
||||
|
||||
.align 4
|
||||
RomInitAddr:
|
||||
#if defined(CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX) && \
|
||||
XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY
|
||||
.word 0x00003000
|
||||
#else
|
||||
.word 0xd0003000
|
||||
#endif
|
||||
RomBootParam:
|
||||
.word _bootparam
|
||||
_bootparam:
|
||||
.short BP_TAG_FIRST
|
||||
.short 4
|
||||
.long BP_VERSION
|
||||
.short BP_TAG_LAST
|
||||
.short 0
|
||||
.long 0
|
||||
|
||||
.align 4
|
||||
_SetupMMU:
|
||||
movi a0, 0
|
||||
wsr a0, windowbase
|
||||
rsync
|
||||
movi a0, 1
|
||||
wsr a0, windowstart
|
||||
rsync
|
||||
movi a0, 0x1F
|
||||
wsr a0, ps
|
||||
rsync
|
||||
|
||||
Offset = _SetupMMU - _ResetVector
|
||||
|
||||
#ifndef CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
|
||||
initialize_mmu
|
||||
#endif
|
||||
|
||||
.end no-absolute-literals
|
||||
|
||||
rsil a0, XCHAL_DEBUGLEVEL-1
|
||||
rsync
|
||||
reset:
|
||||
l32r a0, RomInitAddr
|
||||
l32r a2, RomBootParam
|
||||
movi a3, 0
|
||||
movi a4, 0
|
||||
jx a0
|
||||
|
||||
.align 4
|
||||
|
||||
.section .ResetVector.remapped_text, "x"
|
||||
.global _RemappedResetVector
|
||||
|
||||
/* Do org before literals */
|
||||
.org 0
|
||||
|
||||
_RemappedResetVector:
|
||||
.begin no-absolute-literals
|
||||
.literal_position
|
||||
|
||||
_j _RemappedSetupMMU
|
||||
|
||||
/* Position Remapped code at the same location as the original code */
|
||||
. = _RemappedResetVector + Offset
|
||||
|
||||
_RemappedSetupMMU:
|
||||
#ifndef CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
|
||||
initialize_mmu
|
||||
#endif
|
||||
|
||||
.end no-absolute-literals
|
35
arch/xtensa/boot/boot-redboot/Makefile
Normal file
35
arch/xtensa/boot/boot-redboot/Makefile
Normal file
|
@ -0,0 +1,35 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
ifeq ($(BIG_ENDIAN),1)
|
||||
OBJCOPY_ARGS := -O elf32-xtensa-be
|
||||
else
|
||||
OBJCOPY_ARGS := -O elf32-xtensa-le
|
||||
endif
|
||||
|
||||
LD_ARGS = -T $(srctree)/$(obj)/boot.ld
|
||||
|
||||
boot-y := bootstrap.o
|
||||
|
||||
OBJS := $(addprefix $(obj)/,$(boot-y))
|
||||
LIBS := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a
|
||||
|
||||
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
|
||||
|
||||
$(obj)/zImage.o: vmlinux.bin.gz $(OBJS)
|
||||
$(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
|
||||
--add-section image=vmlinux.bin.gz \
|
||||
--set-section-flags image=contents,alloc,load,load,data \
|
||||
$(OBJS) $@
|
||||
|
||||
$(obj)/zImage.elf: $(obj)/zImage.o $(LIBS)
|
||||
$(Q)$(LD) $(LD_ARGS) -o $@ $^ -L/xtensa-elf/lib $(LIBGCC)
|
||||
|
||||
$(obj)/../zImage.redboot: $(obj)/zImage.elf
|
||||
$(Q)$(OBJCOPY) -S -O binary $< $@
|
||||
$(Q)$(kecho) ' Kernel: $@ is ready'
|
||||
|
||||
zImage: $(obj)/../zImage.redboot
|
59
arch/xtensa/boot/boot-redboot/boot.ld
Normal file
59
arch/xtensa/boot/boot-redboot/boot.ld
Normal file
|
@ -0,0 +1,59 @@
|
|||
OUTPUT_ARCH(xtensa)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.start 0xD1000000 : { *(.start) }
|
||||
|
||||
.text :
|
||||
{
|
||||
__reloc_start = . ;
|
||||
_text_start = . ;
|
||||
*(.literal .text.literal .text)
|
||||
_text_end = . ;
|
||||
}
|
||||
|
||||
.rodata ALIGN(0x04):
|
||||
{
|
||||
*(.rodata)
|
||||
*(.rodata1)
|
||||
}
|
||||
|
||||
.data ALIGN(0x04):
|
||||
{
|
||||
*(.data)
|
||||
*(.data1)
|
||||
*(.sdata)
|
||||
*(.sdata2)
|
||||
*(.got.plt)
|
||||
*(.got)
|
||||
*(.dynamic)
|
||||
}
|
||||
|
||||
__reloc_end = . ;
|
||||
|
||||
. = ALIGN(0x10);
|
||||
__image_load = . ;
|
||||
.image 0xd0003000: AT(__image_load)
|
||||
{
|
||||
_image_start = .;
|
||||
*(image)
|
||||
. = (. + 3) & ~ 3;
|
||||
_image_end = . ;
|
||||
}
|
||||
|
||||
|
||||
.bss ((LOADADDR(.image) + SIZEOF(.image) + 3) & ~ 3):
|
||||
{
|
||||
__bss_start = .;
|
||||
*(.sbss)
|
||||
*(.scommon)
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
__bss_end = .;
|
||||
}
|
||||
_end = .;
|
||||
_param_start = .;
|
||||
|
||||
|
||||
PROVIDE (end = .);
|
||||
}
|
249
arch/xtensa/boot/boot-redboot/bootstrap.S
Normal file
249
arch/xtensa/boot/boot-redboot/bootstrap.S
Normal file
|
@ -0,0 +1,249 @@
|
|||
#include <variant/core.h>
|
||||
#include <asm/regs.h>
|
||||
#include <asm/asmmacro.h>
|
||||
#include <asm/cacheasm.h>
|
||||
/*
|
||||
* RB-Data: RedBoot data/bss
|
||||
* P: Boot-Parameters
|
||||
* L: Kernel-Loader
|
||||
*
|
||||
* The Linux-Kernel image including the loader must be loaded
|
||||
* to a position so that the kernel and the boot parameters
|
||||
* can fit in the space before the load address.
|
||||
* ______________________________________________________
|
||||
* |_RB-Data_|_P_|__________|_L_|___Linux-Kernel___|______|
|
||||
* ^
|
||||
* ^ Load address
|
||||
* ______________________________________________________
|
||||
* |___Linux-Kernel___|_P_|_L_|___________________________|
|
||||
*
|
||||
* The loader copies the parameter to the position that will
|
||||
* be the end of the kernel and itself to the end of the
|
||||
* parameter list.
|
||||
*/
|
||||
|
||||
/* Make sure we have enough space for the 'uncompressor' */
|
||||
|
||||
#define STACK_SIZE 32768
|
||||
#define HEAP_SIZE (131072*4)
|
||||
|
||||
# a2: Parameter list
|
||||
# a3: Size of parameter list
|
||||
|
||||
.section .start, "ax"
|
||||
|
||||
.globl __start
|
||||
/* this must be the first byte of the loader! */
|
||||
__start:
|
||||
entry sp, 32 # we do not intend to return
|
||||
_call0 _start
|
||||
__start_a0:
|
||||
.align 4
|
||||
|
||||
.section .text, "ax"
|
||||
.begin literal_prefix .text
|
||||
|
||||
/* put literals in here! */
|
||||
|
||||
.globl _start
|
||||
_start:
|
||||
|
||||
/* 'reset' window registers */
|
||||
|
||||
movi a4, 1
|
||||
wsr a4, ps
|
||||
rsync
|
||||
|
||||
rsr a5, windowbase
|
||||
ssl a5
|
||||
sll a4, a4
|
||||
wsr a4, windowstart
|
||||
rsync
|
||||
|
||||
movi a4, 0x00040000
|
||||
wsr a4, ps
|
||||
rsync
|
||||
|
||||
/* copy the loader to its address
|
||||
* Note: The loader itself is a very small piece, so we assume we
|
||||
* don't partially overlap. We also assume (even more important)
|
||||
* that the kernel image is out of the way. Usually, when the
|
||||
* load address of this image is not at an arbitrary address,
|
||||
* but aligned to some 10K's we shouldn't overlap.
|
||||
*/
|
||||
|
||||
/* Note: The assembler cannot relax "addi a0, a0, ..." to an
|
||||
l32r, so we load to a4 first. */
|
||||
|
||||
# addi a4, a0, __start - __start_a0
|
||||
# mov a0, a4
|
||||
|
||||
movi a4, __start
|
||||
movi a5, __start_a0
|
||||
add a4, a0, a4
|
||||
sub a0, a4, a5
|
||||
|
||||
movi a4, __start
|
||||
movi a5, __reloc_end
|
||||
|
||||
# a0: address where this code has been loaded
|
||||
# a4: compiled address of __start
|
||||
# a5: compiled end address
|
||||
|
||||
mov.n a7, a0
|
||||
mov.n a8, a4
|
||||
|
||||
1:
|
||||
l32i a10, a7, 0
|
||||
l32i a11, a7, 4
|
||||
s32i a10, a8, 0
|
||||
s32i a11, a8, 4
|
||||
l32i a10, a7, 8
|
||||
l32i a11, a7, 12
|
||||
s32i a10, a8, 8
|
||||
s32i a11, a8, 12
|
||||
addi a8, a8, 16
|
||||
addi a7, a7, 16
|
||||
blt a8, a5, 1b
|
||||
|
||||
|
||||
/* We have to flush and invalidate the caches here before we jump. */
|
||||
|
||||
#if XCHAL_DCACHE_IS_WRITEBACK
|
||||
|
||||
___flush_dcache_all a5 a6
|
||||
|
||||
#endif
|
||||
|
||||
___invalidate_icache_all a5 a6
|
||||
isync
|
||||
|
||||
movi a11, _reloc
|
||||
jx a11
|
||||
|
||||
.globl _reloc
|
||||
_reloc:
|
||||
|
||||
/* RedBoot is now at the end of the memory, so we don't have
|
||||
* to copy the parameter list. Keep the code around; in case
|
||||
* we need it again. */
|
||||
#if 0
|
||||
# a0: load address
|
||||
# a2: start address of parameter list
|
||||
# a3: length of parameter list
|
||||
# a4: __start
|
||||
|
||||
/* copy the parameter list out of the way */
|
||||
|
||||
movi a6, _param_start
|
||||
add a3, a2, a3
|
||||
2:
|
||||
l32i a8, a2, 0
|
||||
s32i a8, a6, 0
|
||||
addi a2, a2, 4
|
||||
addi a6, a6, 4
|
||||
blt a2, a3, 2b
|
||||
#endif
|
||||
|
||||
/* clear BSS section */
|
||||
movi a6, __bss_start
|
||||
movi a7, __bss_end
|
||||
movi.n a5, 0
|
||||
3:
|
||||
s32i a5, a6, 0
|
||||
addi a6, a6, 4
|
||||
blt a6, a7, 3b
|
||||
|
||||
movi a5, -16
|
||||
movi a1, _stack + STACK_SIZE
|
||||
and a1, a1, a5
|
||||
|
||||
/* Uncompress the kernel */
|
||||
|
||||
# a0: load address
|
||||
# a2: boot parameter
|
||||
# a4: __start
|
||||
|
||||
movi a3, __image_load
|
||||
sub a4, a3, a4
|
||||
add a8, a0, a4
|
||||
|
||||
# a1 Stack
|
||||
# a8(a4) Load address of the image
|
||||
|
||||
movi a6, _image_start
|
||||
movi a10, _image_end
|
||||
movi a7, 0x1000000
|
||||
sub a11, a10, a6
|
||||
movi a9, complen
|
||||
s32i a11, a9, 0
|
||||
|
||||
movi a0, 0
|
||||
|
||||
# a6 destination
|
||||
# a7 maximum size of destination
|
||||
# a8 source
|
||||
# a9 ptr to length
|
||||
|
||||
.extern gunzip
|
||||
movi a4, gunzip
|
||||
beqz a4, 1f
|
||||
|
||||
callx4 a4
|
||||
|
||||
j 2f
|
||||
|
||||
|
||||
# a6 destination start
|
||||
# a7 maximum size of destination
|
||||
# a8 source start
|
||||
# a9 ptr to length
|
||||
# a10 destination end
|
||||
|
||||
1:
|
||||
l32i a9, a8, 0
|
||||
l32i a11, a8, 4
|
||||
s32i a9, a6, 0
|
||||
s32i a11, a6, 4
|
||||
l32i a9, a8, 8
|
||||
l32i a11, a8, 12
|
||||
s32i a9, a6, 8
|
||||
s32i a11, a6, 12
|
||||
addi a6, a6, 16
|
||||
addi a8, a8, 16
|
||||
blt a6, a10, 1b
|
||||
|
||||
|
||||
/* jump to the kernel */
|
||||
2:
|
||||
#if XCHAL_DCACHE_IS_WRITEBACK
|
||||
|
||||
___flush_dcache_all a5 a6
|
||||
|
||||
#endif
|
||||
|
||||
___invalidate_icache_all a5 a6
|
||||
|
||||
isync
|
||||
|
||||
# a2 Boot parameter list
|
||||
|
||||
movi a0, _image_start
|
||||
jx a0
|
||||
|
||||
.align 16
|
||||
.data
|
||||
.globl avail_ram
|
||||
avail_ram:
|
||||
.long _heap
|
||||
.globl end_avail
|
||||
end_avail:
|
||||
.long _heap + HEAP_SIZE
|
||||
|
||||
.comm _stack, STACK_SIZE
|
||||
.comm _heap, HEAP_SIZE
|
||||
|
||||
.globl end_avail
|
||||
.comm complen, 4
|
||||
|
||||
.end literal_prefix
|
18
arch/xtensa/boot/boot-uboot/Makefile
Normal file
18
arch/xtensa/boot/boot-uboot/Makefile
Normal file
|
@ -0,0 +1,18 @@
|
|||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
ifdef CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
|
||||
UIMAGE_LOADADDR = 0x00003000
|
||||
else
|
||||
UIMAGE_LOADADDR = 0xd0003000
|
||||
endif
|
||||
UIMAGE_COMPRESSION = gzip
|
||||
|
||||
$(obj)/../uImage: vmlinux.bin.gz FORCE
|
||||
$(call if_changed,uimage)
|
||||
$(Q)$(kecho) ' Kernel: $@ is ready'
|
||||
|
||||
zImage: $(obj)/../uImage
|
15
arch/xtensa/boot/dts/Makefile
Normal file
15
arch/xtensa/boot/dts/Makefile
Normal file
|
@ -0,0 +1,15 @@
|
|||
#
|
||||
# arch/xtensa/boot/dts/Makefile
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
#
|
||||
|
||||
BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_BUILTIN_DTB)).dtb.o
|
||||
ifneq ($(CONFIG_BUILTIN_DTB),"")
|
||||
obj-$(CONFIG_OF) += $(BUILTIN_DTB)
|
||||
endif
|
||||
|
||||
clean-files := *.dtb.S
|
14
arch/xtensa/boot/dts/kc705.dts
Normal file
14
arch/xtensa/boot/dts/kc705.dts
Normal file
|
@ -0,0 +1,14 @@
|
|||
/dts-v1/;
|
||||
/include/ "xtfpga.dtsi"
|
||||
/include/ "xtfpga-flash-128m.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "cdns,xtensa-kc705";
|
||||
chosen {
|
||||
bootargs = "earlycon=uart8250,mmio32,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=0x38000000";
|
||||
};
|
||||
memory@0 {
|
||||
device_type = "memory";
|
||||
reg = <0x00000000 0x38000000>;
|
||||
};
|
||||
};
|
16
arch/xtensa/boot/dts/lx200mx.dts
Normal file
16
arch/xtensa/boot/dts/lx200mx.dts
Normal file
|
@ -0,0 +1,16 @@
|
|||
/dts-v1/;
|
||||
/include/ "xtfpga.dtsi"
|
||||
/include/ "xtfpga-flash-16m.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "cdns,xtensa-lx200";
|
||||
memory@0 {
|
||||
device_type = "memory";
|
||||
reg = <0x00000000 0x06000000>;
|
||||
};
|
||||
pic: pic {
|
||||
compatible = "cdns,xtensa-mx";
|
||||
#interrupt-cells = <2>;
|
||||
interrupt-controller;
|
||||
};
|
||||
};
|
11
arch/xtensa/boot/dts/lx60.dts
Normal file
11
arch/xtensa/boot/dts/lx60.dts
Normal file
|
@ -0,0 +1,11 @@
|
|||
/dts-v1/;
|
||||
/include/ "xtfpga.dtsi"
|
||||
/include/ "xtfpga-flash-4m.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "cdns,xtensa-lx60";
|
||||
memory@0 {
|
||||
device_type = "memory";
|
||||
reg = <0x00000000 0x04000000>;
|
||||
};
|
||||
};
|
11
arch/xtensa/boot/dts/ml605.dts
Normal file
11
arch/xtensa/boot/dts/ml605.dts
Normal file
|
@ -0,0 +1,11 @@
|
|||
/dts-v1/;
|
||||
/include/ "xtfpga.dtsi"
|
||||
/include/ "xtfpga-flash-16m.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "cdns,xtensa-ml605";
|
||||
memory@0 {
|
||||
device_type = "memory";
|
||||
reg = <0x00000000 0x08000000>;
|
||||
};
|
||||
};
|
28
arch/xtensa/boot/dts/xtfpga-flash-128m.dtsi
Normal file
28
arch/xtensa/boot/dts/xtfpga-flash-128m.dtsi
Normal file
|
@ -0,0 +1,28 @@
|
|||
/ {
|
||||
soc {
|
||||
flash: flash@00000000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
compatible = "cfi-flash";
|
||||
reg = <0x00000000 0x08000000>;
|
||||
bank-width = <2>;
|
||||
device-width = <2>;
|
||||
partition@0x0 {
|
||||
label = "data";
|
||||
reg = <0x00000000 0x06000000>;
|
||||
};
|
||||
partition@0x6000000 {
|
||||
label = "boot loader area";
|
||||
reg = <0x06000000 0x00800000>;
|
||||
};
|
||||
partition@0x6800000 {
|
||||
label = "kernel image";
|
||||
reg = <0x06800000 0x017e0000>;
|
||||
};
|
||||
partition@0x7fe0000 {
|
||||
label = "boot environment";
|
||||
reg = <0x07fe0000 0x00020000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
28
arch/xtensa/boot/dts/xtfpga-flash-16m.dtsi
Normal file
28
arch/xtensa/boot/dts/xtfpga-flash-16m.dtsi
Normal file
|
@ -0,0 +1,28 @@
|
|||
/ {
|
||||
soc {
|
||||
flash: flash@08000000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
compatible = "cfi-flash";
|
||||
reg = <0x08000000 0x01000000>;
|
||||
bank-width = <2>;
|
||||
device-width = <2>;
|
||||
partition@0x0 {
|
||||
label = "boot loader area";
|
||||
reg = <0x00000000 0x00400000>;
|
||||
};
|
||||
partition@0x400000 {
|
||||
label = "kernel image";
|
||||
reg = <0x00400000 0x00600000>;
|
||||
};
|
||||
partition@0xa00000 {
|
||||
label = "data";
|
||||
reg = <0x00a00000 0x005e0000>;
|
||||
};
|
||||
partition@0xfe0000 {
|
||||
label = "boot environment";
|
||||
reg = <0x00fe0000 0x00020000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
20
arch/xtensa/boot/dts/xtfpga-flash-4m.dtsi
Normal file
20
arch/xtensa/boot/dts/xtfpga-flash-4m.dtsi
Normal file
|
@ -0,0 +1,20 @@
|
|||
/ {
|
||||
soc {
|
||||
flash: flash@08000000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
compatible = "cfi-flash";
|
||||
reg = <0x08000000 0x00400000>;
|
||||
bank-width = <2>;
|
||||
device-width = <2>;
|
||||
partition@0x0 {
|
||||
label = "boot loader area";
|
||||
reg = <0x00000000 0x003f0000>;
|
||||
};
|
||||
partition@0x3f0000 {
|
||||
label = "boot environment";
|
||||
reg = <0x003f0000 0x00010000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
69
arch/xtensa/boot/dts/xtfpga.dtsi
Normal file
69
arch/xtensa/boot/dts/xtfpga.dtsi
Normal file
|
@ -0,0 +1,69 @@
|
|||
/ {
|
||||
compatible = "cdns,xtensa-xtfpga";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
interrupt-parent = <&pic>;
|
||||
|
||||
chosen {
|
||||
bootargs = "earlycon=uart8250,mmio32,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug";
|
||||
};
|
||||
|
||||
memory@0 {
|
||||
device_type = "memory";
|
||||
reg = <0x00000000 0x06000000>;
|
||||
};
|
||||
|
||||
cpus {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
cpu@0 {
|
||||
compatible = "cdns,xtensa-cpu";
|
||||
reg = <0>;
|
||||
/* Filled in by platform_setup from FPGA register
|
||||
* clock-frequency = <100000000>;
|
||||
*/
|
||||
};
|
||||
};
|
||||
|
||||
pic: pic {
|
||||
compatible = "cdns,xtensa-pic";
|
||||
/* one cell: internal irq number,
|
||||
* two cells: second cell == 0: internal irq number
|
||||
* second cell == 1: external irq number
|
||||
*/
|
||||
#interrupt-cells = <2>;
|
||||
interrupt-controller;
|
||||
};
|
||||
|
||||
clocks {
|
||||
osc: main-oscillator {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
};
|
||||
};
|
||||
|
||||
soc {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
compatible = "simple-bus";
|
||||
ranges = <0x00000000 0xf0000000 0x10000000>;
|
||||
|
||||
serial0: serial@0d050020 {
|
||||
device_type = "serial";
|
||||
compatible = "ns16550a";
|
||||
no-loopback-test;
|
||||
reg = <0x0d050020 0x20>;
|
||||
reg-shift = <2>;
|
||||
interrupts = <0 1>; /* external irq 0 */
|
||||
clocks = <&osc>;
|
||||
};
|
||||
|
||||
enet0: ethoc@0d030000 {
|
||||
compatible = "opencores,ethoc";
|
||||
reg = <0x0d030000 0x4000 0x0d800000 0x4000>;
|
||||
interrupts = <1 1>; /* external irq 1 */
|
||||
local-mac-address = [00 50 c2 13 6f 00];
|
||||
clocks = <&osc>;
|
||||
};
|
||||
};
|
||||
};
|
24
arch/xtensa/boot/lib/Makefile
Normal file
24
arch/xtensa/boot/lib/Makefile
Normal file
|
@ -0,0 +1,24 @@
|
|||
#
|
||||
# Makefile for some libs needed by zImage.
|
||||
#
|
||||
|
||||
zlib := inffast.c inflate.c inftrees.c
|
||||
|
||||
lib-y += $(zlib:.c=.o) zmem.o
|
||||
|
||||
ccflags-y := -Ilib/zlib_inflate
|
||||
ifdef CONFIG_FUNCTION_TRACER
|
||||
CFLAGS_REMOVE_inflate.o = -pg
|
||||
CFLAGS_REMOVE_zmem.o = -pg
|
||||
CFLAGS_REMOVE_inftrees.o = -pg
|
||||
CFLAGS_REMOVE_inffast.o = -pg
|
||||
endif
|
||||
|
||||
|
||||
quiet_cmd_copy_zlib = COPY $@
|
||||
cmd_copy_zlib = cat $< > $@
|
||||
|
||||
$(addprefix $(obj)/,$(zlib)): $(obj)/%: $(srctree)/lib/zlib_inflate/%
|
||||
$(call cmd,copy_zlib)
|
||||
|
||||
clean-files := $(zlib)
|
79
arch/xtensa/boot/lib/zmem.c
Normal file
79
arch/xtensa/boot/lib/zmem.c
Normal file
|
@ -0,0 +1,79 @@
|
|||
#include <linux/zlib.h>
|
||||
|
||||
/* bits taken from ppc */
|
||||
|
||||
extern void *avail_ram, *end_avail;
|
||||
|
||||
void exit (void)
|
||||
{
|
||||
for (;;);
|
||||
}
|
||||
|
||||
void *zalloc(unsigned size)
|
||||
{
|
||||
void *p = avail_ram;
|
||||
|
||||
size = (size + 7) & -8;
|
||||
avail_ram += size;
|
||||
if (avail_ram > end_avail) {
|
||||
//puts("oops... out of memory\n");
|
||||
//pause();
|
||||
exit ();
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
#define HEAD_CRC 2
|
||||
#define EXTRA_FIELD 4
|
||||
#define ORIG_NAME 8
|
||||
#define COMMENT 0x10
|
||||
#define RESERVED 0xe0
|
||||
|
||||
#define DEFLATED 8
|
||||
|
||||
void gunzip (void *dst, int dstlen, unsigned char *src, int *lenp)
|
||||
{
|
||||
z_stream s;
|
||||
int r, i, flags;
|
||||
|
||||
/* skip header */
|
||||
i = 10;
|
||||
flags = src[3];
|
||||
if (src[2] != DEFLATED || (flags & RESERVED) != 0) {
|
||||
//puts("bad gzipped data\n");
|
||||
exit();
|
||||
}
|
||||
if ((flags & EXTRA_FIELD) != 0)
|
||||
i = 12 + src[10] + (src[11] << 8);
|
||||
if ((flags & ORIG_NAME) != 0)
|
||||
while (src[i++] != 0)
|
||||
;
|
||||
if ((flags & COMMENT) != 0)
|
||||
while (src[i++] != 0)
|
||||
;
|
||||
if ((flags & HEAD_CRC) != 0)
|
||||
i += 2;
|
||||
if (i >= *lenp) {
|
||||
//puts("gunzip: ran out of data in header\n");
|
||||
exit();
|
||||
}
|
||||
|
||||
s.workspace = zalloc(zlib_inflate_workspacesize());
|
||||
r = zlib_inflateInit2(&s, -MAX_WBITS);
|
||||
if (r != Z_OK) {
|
||||
//puts("inflateInit2 returned "); puthex(r); puts("\n");
|
||||
exit();
|
||||
}
|
||||
s.next_in = src + i;
|
||||
s.avail_in = *lenp - i;
|
||||
s.next_out = dst;
|
||||
s.avail_out = dstlen;
|
||||
r = zlib_inflate(&s, Z_FINISH);
|
||||
if (r != Z_OK && r != Z_STREAM_END) {
|
||||
//puts("inflate returned "); puthex(r); puts("\n");
|
||||
exit();
|
||||
}
|
||||
*lenp = s.next_out - (unsigned char *) dst;
|
||||
zlib_inflateEnd(&s);
|
||||
}
|
||||
|
655
arch/xtensa/configs/common_defconfig
Normal file
655
arch/xtensa/configs/common_defconfig
Normal file
|
@ -0,0 +1,655 @@
|
|||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Linux kernel version: 2.6.11-rc2
|
||||
# Tue Mar 1 16:36:53 2005
|
||||
#
|
||||
# CONFIG_FRAME_POINTER is not set
|
||||
CONFIG_XTENSA=y
|
||||
# CONFIG_UID16 is not set
|
||||
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
|
||||
CONFIG_HAVE_DEC_LOCK=y
|
||||
|
||||
#
|
||||
# Code maturity level options
|
||||
#
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_CLEAN_COMPILE=y
|
||||
CONFIG_BROKEN_ON_SMP=y
|
||||
|
||||
#
|
||||
# General setup
|
||||
#
|
||||
CONFIG_LOCALVERSION=""
|
||||
CONFIG_SWAP=y
|
||||
CONFIG_SYSVIPC=y
|
||||
# CONFIG_POSIX_MQUEUE is not set
|
||||
CONFIG_BSD_PROCESS_ACCT=y
|
||||
# CONFIG_BSD_PROCESS_ACCT_V3 is not set
|
||||
CONFIG_SYSCTL=y
|
||||
# CONFIG_AUDIT is not set
|
||||
CONFIG_LOG_BUF_SHIFT=14
|
||||
# CONFIG_HOTPLUG is not set
|
||||
CONFIG_KOBJECT_UEVENT=y
|
||||
# CONFIG_IKCONFIG is not set
|
||||
# CONFIG_EXPERT is not set
|
||||
CONFIG_KALLSYMS=y
|
||||
# CONFIG_KALLSYMS_ALL is not set
|
||||
# CONFIG_KALLSYMS_EXTRA_PASS is not set
|
||||
CONFIG_FUTEX=y
|
||||
CONFIG_EPOLL=y
|
||||
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
|
||||
CONFIG_SHMEM=y
|
||||
CONFIG_CC_ALIGN_FUNCTIONS=0
|
||||
CONFIG_CC_ALIGN_LABELS=0
|
||||
CONFIG_CC_ALIGN_LOOPS=0
|
||||
CONFIG_CC_ALIGN_JUMPS=0
|
||||
# CONFIG_TINY_SHMEM is not set
|
||||
|
||||
#
|
||||
# Loadable module support
|
||||
#
|
||||
CONFIG_MODULES=y
|
||||
# CONFIG_MODULE_UNLOAD is not set
|
||||
CONFIG_OBSOLETE_MODPARM=y
|
||||
CONFIG_MODVERSIONS=y
|
||||
# CONFIG_MODULE_SRCVERSION_ALL is not set
|
||||
CONFIG_KMOD=y
|
||||
|
||||
#
|
||||
# Processor type and features
|
||||
#
|
||||
CONFIG_XTENSA_ARCH_LINUX_BE=y
|
||||
# CONFIG_XTENSA_ARCH_LINUX_LE is not set
|
||||
# CONFIG_XTENSA_ARCH_LINUX_TEST is not set
|
||||
# CONFIG_XTENSA_ARCH_S5 is not set
|
||||
# CONFIG_XTENSA_CUSTOM is not set
|
||||
CONFIG_MMU=y
|
||||
# CONFIG_XTENSA_UNALIGNED_USER is not set
|
||||
# CONFIG_PREEMPT is not set
|
||||
# CONFIG_HIGHMEM is not set
|
||||
|
||||
#
|
||||
# Platform options
|
||||
#
|
||||
# CONFIG_XTENSA_PLATFORM_ISS is not set
|
||||
CONFIG_XTENSA_PLATFORM_XT2000=y
|
||||
CONFIG_XTENSA_CALIBRATE_CCOUNT=y
|
||||
CONFIG_GENERIC_CALIBRATE_DELAY=y
|
||||
CONFIG_CMDLINE_BOOL=y
|
||||
CONFIG_CMDLINE="console=ttyS0,38400 ip=bootp root=nfs nfsroot=/opt/montavista/pro/devkit/xtensa/linux_be/target"
|
||||
|
||||
#
|
||||
# Bus options
|
||||
#
|
||||
CONFIG_PCI=y
|
||||
# CONFIG_PCI_LEGACY_PROC is not set
|
||||
# CONFIG_PCI_NAMES is not set
|
||||
|
||||
#
|
||||
# PCCARD (PCMCIA/CardBus) support
|
||||
#
|
||||
# CONFIG_PCCARD is not set
|
||||
|
||||
#
|
||||
# PC-card bridges
|
||||
#
|
||||
|
||||
#
|
||||
# PCI Hotplug Support
|
||||
#
|
||||
# CONFIG_HOTPLUG_PCI is not set
|
||||
|
||||
#
|
||||
# Exectuable file formats
|
||||
#
|
||||
CONFIG_KCORE_ELF=y
|
||||
CONFIG_BINFMT_ELF=y
|
||||
CONFIG_BINFMT_MISC=y
|
||||
|
||||
#
|
||||
# Device Drivers
|
||||
#
|
||||
|
||||
#
|
||||
# Generic Driver Options
|
||||
#
|
||||
CONFIG_STANDALONE=y
|
||||
CONFIG_PREVENT_FIRMWARE_BUILD=y
|
||||
# CONFIG_FW_LOADER is not set
|
||||
# CONFIG_DEBUG_DRIVER is not set
|
||||
|
||||
#
|
||||
# Memory Technology Devices (MTD)
|
||||
#
|
||||
# CONFIG_MTD is not set
|
||||
|
||||
#
|
||||
# Parallel port support
|
||||
#
|
||||
# CONFIG_PARPORT is not set
|
||||
|
||||
#
|
||||
# Plug and Play support
|
||||
#
|
||||
|
||||
#
|
||||
# Block devices
|
||||
#
|
||||
# CONFIG_BLK_DEV_FD is not set
|
||||
# CONFIG_BLK_CPQ_DA is not set
|
||||
# CONFIG_BLK_CPQ_CISS_DA is not set
|
||||
# CONFIG_BLK_DEV_DAC960 is not set
|
||||
# CONFIG_BLK_DEV_UMEM is not set
|
||||
# CONFIG_BLK_DEV_COW_COMMON is not set
|
||||
# CONFIG_BLK_DEV_LOOP is not set
|
||||
# CONFIG_BLK_DEV_NBD is not set
|
||||
# CONFIG_BLK_DEV_SX8 is not set
|
||||
# CONFIG_BLK_DEV_RAM is not set
|
||||
CONFIG_BLK_DEV_RAM_COUNT=16
|
||||
CONFIG_INITRAMFS_SOURCE=""
|
||||
# CONFIG_CDROM_PKTCDVD is not set
|
||||
|
||||
#
|
||||
# IO Schedulers
|
||||
#
|
||||
CONFIG_IOSCHED_NOOP=y
|
||||
CONFIG_IOSCHED_AS=y
|
||||
CONFIG_IOSCHED_DEADLINE=y
|
||||
CONFIG_IOSCHED_CFQ=y
|
||||
# CONFIG_ATA_OVER_ETH is not set
|
||||
|
||||
#
|
||||
# ATA/ATAPI/MFM/RLL support
|
||||
#
|
||||
# CONFIG_IDE is not set
|
||||
|
||||
#
|
||||
# SCSI device support
|
||||
#
|
||||
# CONFIG_SCSI is not set
|
||||
|
||||
#
|
||||
# Multi-device support (RAID and LVM)
|
||||
#
|
||||
# CONFIG_MD is not set
|
||||
|
||||
#
|
||||
# Fusion MPT device support
|
||||
#
|
||||
|
||||
#
|
||||
# IEEE 1394 (FireWire) support
|
||||
#
|
||||
# CONFIG_IEEE1394 is not set
|
||||
|
||||
#
|
||||
# I2O device support
|
||||
#
|
||||
# CONFIG_I2O is not set
|
||||
|
||||
#
|
||||
# Networking support
|
||||
#
|
||||
CONFIG_NET=y
|
||||
|
||||
#
|
||||
# Networking options
|
||||
#
|
||||
# CONFIG_PACKET is not set
|
||||
# CONFIG_NETLINK_DEV is not set
|
||||
CONFIG_UNIX=y
|
||||
# CONFIG_NET_KEY is not set
|
||||
CONFIG_INET=y
|
||||
CONFIG_IP_MULTICAST=y
|
||||
CONFIG_IP_ADVANCED_ROUTER=y
|
||||
CONFIG_IP_MULTIPLE_TABLES=y
|
||||
CONFIG_IP_ROUTE_MULTIPATH=y
|
||||
CONFIG_IP_ROUTE_VERBOSE=y
|
||||
CONFIG_IP_PNP=y
|
||||
CONFIG_IP_PNP_DHCP=y
|
||||
CONFIG_IP_PNP_BOOTP=y
|
||||
CONFIG_IP_PNP_RARP=y
|
||||
# CONFIG_NET_IPIP is not set
|
||||
# CONFIG_NET_IPGRE is not set
|
||||
# CONFIG_IP_MROUTE is not set
|
||||
# CONFIG_ARPD is not set
|
||||
# CONFIG_SYN_COOKIES is not set
|
||||
# CONFIG_INET_AH is not set
|
||||
# CONFIG_INET_ESP is not set
|
||||
# CONFIG_INET_IPCOMP is not set
|
||||
# CONFIG_INET_TUNNEL is not set
|
||||
# CONFIG_IP_TCPDIAG is not set
|
||||
# CONFIG_IP_TCPDIAG_IPV6 is not set
|
||||
# CONFIG_IPV6 is not set
|
||||
# CONFIG_NETFILTER is not set
|
||||
|
||||
#
|
||||
# SCTP Configuration (EXPERIMENTAL)
|
||||
#
|
||||
# CONFIG_IP_SCTP is not set
|
||||
# CONFIG_ATM is not set
|
||||
# CONFIG_BRIDGE is not set
|
||||
# CONFIG_VLAN_8021Q is not set
|
||||
# CONFIG_DECNET is not set
|
||||
# CONFIG_LLC2 is not set
|
||||
# CONFIG_IPX is not set
|
||||
# CONFIG_ATALK is not set
|
||||
# CONFIG_X25 is not set
|
||||
# CONFIG_LAPB is not set
|
||||
# CONFIG_NET_DIVERT is not set
|
||||
# CONFIG_ECONET is not set
|
||||
# CONFIG_WAN_ROUTER is not set
|
||||
|
||||
#
|
||||
# QoS and/or fair queueing
|
||||
#
|
||||
CONFIG_NET_SCHED=y
|
||||
CONFIG_NET_SCH_CLK_JIFFIES=y
|
||||
# CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set
|
||||
# CONFIG_NET_SCH_CLK_CPU is not set
|
||||
CONFIG_NET_SCH_CBQ=m
|
||||
CONFIG_NET_SCH_HTB=m
|
||||
# CONFIG_NET_SCH_HFSC is not set
|
||||
CONFIG_NET_SCH_PRIO=m
|
||||
CONFIG_NET_SCH_RED=m
|
||||
CONFIG_NET_SCH_SFQ=m
|
||||
CONFIG_NET_SCH_TEQL=m
|
||||
CONFIG_NET_SCH_TBF=m
|
||||
CONFIG_NET_SCH_GRED=m
|
||||
CONFIG_NET_SCH_DSMARK=m
|
||||
# CONFIG_NET_SCH_NETEM is not set
|
||||
CONFIG_NET_SCH_INGRESS=m
|
||||
CONFIG_NET_QOS=y
|
||||
CONFIG_NET_ESTIMATOR=y
|
||||
CONFIG_NET_CLS=y
|
||||
CONFIG_NET_CLS_TCINDEX=m
|
||||
CONFIG_NET_CLS_ROUTE4=m
|
||||
CONFIG_NET_CLS_ROUTE=y
|
||||
CONFIG_NET_CLS_FW=m
|
||||
CONFIG_NET_CLS_U32=m
|
||||
# CONFIG_CLS_U32_PERF is not set
|
||||
# CONFIG_NET_CLS_IND is not set
|
||||
CONFIG_NET_CLS_RSVP=m
|
||||
CONFIG_NET_CLS_RSVP6=m
|
||||
# CONFIG_NET_CLS_ACT is not set
|
||||
CONFIG_NET_CLS_POLICE=y
|
||||
|
||||
#
|
||||
# Network testing
|
||||
#
|
||||
# CONFIG_NET_PKTGEN is not set
|
||||
# CONFIG_NETPOLL is not set
|
||||
# CONFIG_NET_POLL_CONTROLLER is not set
|
||||
# CONFIG_HAMRADIO is not set
|
||||
# CONFIG_IRDA is not set
|
||||
# CONFIG_BT is not set
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_DUMMY=y
|
||||
# CONFIG_BONDING is not set
|
||||
# CONFIG_EQUALIZER is not set
|
||||
# CONFIG_TUN is not set
|
||||
|
||||
#
|
||||
# ARCnet devices
|
||||
#
|
||||
# CONFIG_ARCNET is not set
|
||||
|
||||
#
|
||||
# Ethernet (10 or 100Mbit)
|
||||
#
|
||||
CONFIG_NET_ETHERNET=y
|
||||
# CONFIG_MII is not set
|
||||
CONFIG_XT2000_SONIC=y
|
||||
# CONFIG_HAPPYMEAL is not set
|
||||
# CONFIG_SUNGEM is not set
|
||||
# CONFIG_NET_VENDOR_3COM is not set
|
||||
|
||||
#
|
||||
# Tulip family network device support
|
||||
#
|
||||
# CONFIG_NET_TULIP is not set
|
||||
# CONFIG_HP100 is not set
|
||||
# CONFIG_NET_PCI is not set
|
||||
|
||||
#
|
||||
# Ethernet (1000 Mbit)
|
||||
#
|
||||
# CONFIG_ACENIC is not set
|
||||
# CONFIG_DL2K is not set
|
||||
# CONFIG_E1000 is not set
|
||||
# CONFIG_NS83820 is not set
|
||||
# CONFIG_HAMACHI is not set
|
||||
# CONFIG_YELLOWFIN is not set
|
||||
# CONFIG_R8169 is not set
|
||||
# CONFIG_SK98LIN is not set
|
||||
# CONFIG_TIGON3 is not set
|
||||
|
||||
#
|
||||
# Ethernet (10000 Mbit)
|
||||
#
|
||||
# CONFIG_IXGB is not set
|
||||
# CONFIG_S2IO is not set
|
||||
|
||||
#
|
||||
# Wireless LAN (non-hamradio)
|
||||
#
|
||||
CONFIG_NET_RADIO=y
|
||||
|
||||
#
|
||||
# Obsolete Wireless cards support (pre-802.11)
|
||||
#
|
||||
CONFIG_STRIP=m
|
||||
|
||||
#
|
||||
# Wireless 802.11b ISA/PCI cards support
|
||||
#
|
||||
CONFIG_HERMES=m
|
||||
# CONFIG_PLX_HERMES is not set
|
||||
# CONFIG_TMD_HERMES is not set
|
||||
# CONFIG_PCI_HERMES is not set
|
||||
# CONFIG_ATMEL is not set
|
||||
|
||||
#
|
||||
# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
|
||||
#
|
||||
# CONFIG_PRISM54 is not set
|
||||
CONFIG_NET_WIRELESS=y
|
||||
|
||||
#
|
||||
# Wan interfaces
|
||||
#
|
||||
# CONFIG_WAN is not set
|
||||
# CONFIG_FDDI is not set
|
||||
# CONFIG_HIPPI is not set
|
||||
# CONFIG_PPP is not set
|
||||
# CONFIG_SLIP is not set
|
||||
# CONFIG_SHAPER is not set
|
||||
# CONFIG_NETCONSOLE is not set
|
||||
|
||||
#
|
||||
# ISDN subsystem
|
||||
#
|
||||
# CONFIG_ISDN is not set
|
||||
|
||||
#
|
||||
# Telephony Support
|
||||
#
|
||||
# CONFIG_PHONE is not set
|
||||
|
||||
#
|
||||
# Input device support
|
||||
#
|
||||
CONFIG_INPUT=y
|
||||
|
||||
#
|
||||
# Userland interfaces
|
||||
#
|
||||
CONFIG_INPUT_MOUSEDEV=y
|
||||
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
|
||||
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
|
||||
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
|
||||
# CONFIG_INPUT_JOYDEV is not set
|
||||
# CONFIG_INPUT_TSDEV is not set
|
||||
# CONFIG_INPUT_EVDEV is not set
|
||||
# CONFIG_INPUT_EVBUG is not set
|
||||
|
||||
#
|
||||
# Input I/O drivers
|
||||
#
|
||||
# CONFIG_GAMEPORT is not set
|
||||
CONFIG_SOUND_GAMEPORT=y
|
||||
CONFIG_SERIO=y
|
||||
# CONFIG_SERIO_I8042 is not set
|
||||
# CONFIG_SERIO_SERPORT is not set
|
||||
# CONFIG_SERIO_CT82C710 is not set
|
||||
# CONFIG_SERIO_PCIPS2 is not set
|
||||
# CONFIG_SERIO_RAW is not set
|
||||
|
||||
#
|
||||
# Input Device Drivers
|
||||
#
|
||||
# CONFIG_INPUT_KEYBOARD is not set
|
||||
# CONFIG_INPUT_MOUSE is not set
|
||||
# CONFIG_INPUT_JOYSTICK is not set
|
||||
# CONFIG_INPUT_TOUCHSCREEN is not set
|
||||
# CONFIG_INPUT_MISC is not set
|
||||
|
||||
#
|
||||
# Character devices
|
||||
#
|
||||
CONFIG_VT=y
|
||||
CONFIG_VT_CONSOLE=y
|
||||
CONFIG_HW_CONSOLE=y
|
||||
# CONFIG_SERIAL_NONSTANDARD is not set
|
||||
|
||||
#
|
||||
# Serial drivers
|
||||
#
|
||||
CONFIG_SERIAL_8250=y
|
||||
CONFIG_SERIAL_8250_CONSOLE=y
|
||||
CONFIG_SERIAL_8250_NR_UARTS=4
|
||||
# CONFIG_SERIAL_8250_EXTENDED is not set
|
||||
|
||||
#
|
||||
# Non-8250 serial port support
|
||||
#
|
||||
CONFIG_SERIAL_CORE=y
|
||||
CONFIG_SERIAL_CORE_CONSOLE=y
|
||||
CONFIG_UNIX98_PTYS=y
|
||||
CONFIG_LEGACY_PTYS=y
|
||||
CONFIG_LEGACY_PTY_COUNT=256
|
||||
|
||||
#
|
||||
# IPMI
|
||||
#
|
||||
# CONFIG_IPMI_HANDLER is not set
|
||||
|
||||
#
|
||||
# Watchdog Cards
|
||||
#
|
||||
# CONFIG_WATCHDOG is not set
|
||||
# CONFIG_RTC is not set
|
||||
# CONFIG_GEN_RTC is not set
|
||||
# CONFIG_DTLK is not set
|
||||
# CONFIG_R3964 is not set
|
||||
# CONFIG_APPLICOM is not set
|
||||
|
||||
#
|
||||
# Ftape, the floppy tape device driver
|
||||
#
|
||||
# CONFIG_DRM is not set
|
||||
# CONFIG_RAW_DRIVER is not set
|
||||
|
||||
#
|
||||
# I2C support
|
||||
#
|
||||
# CONFIG_I2C is not set
|
||||
|
||||
#
|
||||
# Dallas's 1-wire bus
|
||||
#
|
||||
# CONFIG_W1 is not set
|
||||
|
||||
#
|
||||
# Misc devices
|
||||
#
|
||||
|
||||
#
|
||||
# Multimedia devices
|
||||
#
|
||||
# CONFIG_VIDEO_DEV is not set
|
||||
|
||||
#
|
||||
# Digital Video Broadcasting Devices
|
||||
#
|
||||
# CONFIG_DVB is not set
|
||||
|
||||
#
|
||||
# Graphics support
|
||||
#
|
||||
# CONFIG_FB is not set
|
||||
|
||||
#
|
||||
# Console display driver support
|
||||
#
|
||||
# CONFIG_VGA_CONSOLE is not set
|
||||
CONFIG_DUMMY_CONSOLE=y
|
||||
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
|
||||
|
||||
#
|
||||
# Sound
|
||||
#
|
||||
# CONFIG_SOUND is not set
|
||||
|
||||
#
|
||||
# USB support
|
||||
#
|
||||
# CONFIG_USB is not set
|
||||
CONFIG_USB_ARCH_HAS_HCD=y
|
||||
CONFIG_USB_ARCH_HAS_OHCI=y
|
||||
|
||||
#
|
||||
# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information
|
||||
#
|
||||
|
||||
#
|
||||
# USB Gadget Support
|
||||
#
|
||||
# CONFIG_USB_GADGET is not set
|
||||
|
||||
#
|
||||
# MMC/SD Card support
|
||||
#
|
||||
# CONFIG_MMC is not set
|
||||
|
||||
#
|
||||
# InfiniBand support
|
||||
#
|
||||
# CONFIG_INFINIBAND is not set
|
||||
|
||||
#
|
||||
# File systems
|
||||
#
|
||||
# CONFIG_EXT2_FS is not set
|
||||
# CONFIG_EXT3_FS is not set
|
||||
# CONFIG_JBD is not set
|
||||
# CONFIG_REISERFS_FS is not set
|
||||
# CONFIG_JFS_FS is not set
|
||||
# CONFIG_XFS_FS is not set
|
||||
# CONFIG_MINIX_FS is not set
|
||||
# CONFIG_ROMFS_FS is not set
|
||||
# CONFIG_QUOTA is not set
|
||||
CONFIG_DNOTIFY=y
|
||||
# CONFIG_AUTOFS_FS is not set
|
||||
# CONFIG_AUTOFS4_FS is not set
|
||||
|
||||
#
|
||||
# CD-ROM/DVD Filesystems
|
||||
#
|
||||
# CONFIG_ISO9660_FS is not set
|
||||
# CONFIG_UDF_FS is not set
|
||||
|
||||
#
|
||||
# DOS/FAT/NT Filesystems
|
||||
#
|
||||
# CONFIG_MSDOS_FS is not set
|
||||
# CONFIG_VFAT_FS is not set
|
||||
# CONFIG_NTFS_FS is not set
|
||||
|
||||
#
|
||||
# Pseudo filesystems
|
||||
#
|
||||
CONFIG_PROC_FS=y
|
||||
# CONFIG_PROC_KCORE is not set
|
||||
CONFIG_SYSFS=y
|
||||
CONFIG_DEVFS_FS=y
|
||||
# CONFIG_DEVFS_MOUNT is not set
|
||||
# CONFIG_DEVFS_DEBUG is not set
|
||||
# CONFIG_DEVPTS_FS_XATTR is not set
|
||||
# CONFIG_TMPFS is not set
|
||||
# CONFIG_HUGETLB_PAGE is not set
|
||||
CONFIG_RAMFS=y
|
||||
|
||||
#
|
||||
# Miscellaneous filesystems
|
||||
#
|
||||
# CONFIG_ADFS_FS is not set
|
||||
# CONFIG_AFFS_FS is not set
|
||||
# CONFIG_HFS_FS is not set
|
||||
# CONFIG_HFSPLUS_FS is not set
|
||||
# CONFIG_BEFS_FS is not set
|
||||
# CONFIG_BFS_FS is not set
|
||||
# CONFIG_EFS_FS is not set
|
||||
# CONFIG_CRAMFS is not set
|
||||
# CONFIG_VXFS_FS is not set
|
||||
# CONFIG_HPFS_FS is not set
|
||||
# CONFIG_QNX4FS_FS is not set
|
||||
# CONFIG_SYSV_FS is not set
|
||||
# CONFIG_UFS_FS is not set
|
||||
|
||||
#
|
||||
# Network File Systems
|
||||
#
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NFS_V3=y
|
||||
# CONFIG_NFS_V4 is not set
|
||||
# CONFIG_NFS_DIRECTIO is not set
|
||||
# CONFIG_NFSD is not set
|
||||
CONFIG_ROOT_NFS=y
|
||||
CONFIG_LOCKD=y
|
||||
CONFIG_LOCKD_V4=y
|
||||
# CONFIG_EXPORTFS is not set
|
||||
CONFIG_SUNRPC=y
|
||||
# CONFIG_RPCSEC_GSS_KRB5 is not set
|
||||
# CONFIG_RPCSEC_GSS_SPKM3 is not set
|
||||
# CONFIG_SMB_FS is not set
|
||||
# CONFIG_CIFS is not set
|
||||
# CONFIG_NCP_FS is not set
|
||||
# CONFIG_CODA_FS is not set
|
||||
# CONFIG_AFS_FS is not set
|
||||
|
||||
#
|
||||
# Partition Types
|
||||
#
|
||||
# CONFIG_PARTITION_ADVANCED is not set
|
||||
CONFIG_MSDOS_PARTITION=y
|
||||
|
||||
#
|
||||
# Native Language Support
|
||||
#
|
||||
# CONFIG_NLS is not set
|
||||
|
||||
#
|
||||
# Kernel hacking
|
||||
#
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
# CONFIG_DEBUG_STACKOVERFLOW is not set
|
||||
# CONFIG_DEBUG_SLAB is not set
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
# CONFIG_DEBUG_SPINLOCK is not set
|
||||
# CONFIG_DEBUG_PAGEALLOC is not set
|
||||
# CONFIG_DEBUG_INFO is not set
|
||||
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
|
||||
# CONFIG_KGDB is not set
|
||||
|
||||
#
|
||||
# Security options
|
||||
#
|
||||
# CONFIG_KEYS is not set
|
||||
# CONFIG_SECURITY is not set
|
||||
|
||||
#
|
||||
# Cryptographic options
|
||||
#
|
||||
# CONFIG_CRYPTO is not set
|
||||
|
||||
#
|
||||
# Hardware crypto devices
|
||||
#
|
||||
|
||||
#
|
||||
# Library routines
|
||||
#
|
||||
# CONFIG_CRC_CCITT is not set
|
||||
# CONFIG_CRC32 is not set
|
||||
# CONFIG_LIBCRC32C is not set
|
131
arch/xtensa/configs/generic_kc705_defconfig
Normal file
131
arch/xtensa/configs/generic_kc705_defconfig
Normal file
|
@ -0,0 +1,131 @@
|
|||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
CONFIG_FHANDLE=y
|
||||
CONFIG_IRQ_DOMAIN_DEBUG=y
|
||||
CONFIG_NO_HZ_IDLE=y
|
||||
CONFIG_HIGH_RES_TIMERS=y
|
||||
CONFIG_IRQ_TIME_ACCOUNTING=y
|
||||
CONFIG_BSD_PROCESS_ACCT=y
|
||||
CONFIG_CGROUP_DEBUG=y
|
||||
CONFIG_CGROUP_FREEZER=y
|
||||
CONFIG_CGROUP_DEVICE=y
|
||||
CONFIG_CPUSETS=y
|
||||
CONFIG_CGROUP_CPUACCT=y
|
||||
CONFIG_RESOURCE_COUNTERS=y
|
||||
CONFIG_MEMCG=y
|
||||
CONFIG_NAMESPACES=y
|
||||
CONFIG_SCHED_AUTOGROUP=y
|
||||
CONFIG_RELAY=y
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
CONFIG_EXPERT=y
|
||||
CONFIG_SYSCTL_SYSCALL=y
|
||||
CONFIG_KALLSYMS_ALL=y
|
||||
CONFIG_PROFILING=y
|
||||
CONFIG_OPROFILE=y
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_MODULE_UNLOAD=y
|
||||
# CONFIG_IOSCHED_DEADLINE is not set
|
||||
# CONFIG_IOSCHED_CFQ is not set
|
||||
CONFIG_XTENSA_VARIANT_DC233C=y
|
||||
CONFIG_XTENSA_UNALIGNED_USER=y
|
||||
CONFIG_PREEMPT=y
|
||||
CONFIG_HIGHMEM=y
|
||||
# CONFIG_PCI is not set
|
||||
CONFIG_XTENSA_PLATFORM_XTFPGA=y
|
||||
CONFIG_CMDLINE_BOOL=y
|
||||
CONFIG_CMDLINE="earlycon=uart8250,mmio32,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug"
|
||||
CONFIG_USE_OF=y
|
||||
CONFIG_BUILTIN_DTB="kc705"
|
||||
# CONFIG_COMPACTION is not set
|
||||
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_INET=y
|
||||
CONFIG_IP_MULTICAST=y
|
||||
CONFIG_IP_PNP=y
|
||||
CONFIG_IP_PNP_DHCP=y
|
||||
CONFIG_IP_PNP_BOOTP=y
|
||||
CONFIG_IP_PNP_RARP=y
|
||||
# CONFIG_IPV6 is not set
|
||||
CONFIG_NETFILTER=y
|
||||
# CONFIG_WIRELESS is not set
|
||||
CONFIG_DEVTMPFS=y
|
||||
CONFIG_DEVTMPFS_MOUNT=y
|
||||
# CONFIG_STANDALONE is not set
|
||||
CONFIG_MTD=y
|
||||
CONFIG_MTD_CFI=y
|
||||
CONFIG_MTD_JEDECPROBE=y
|
||||
CONFIG_MTD_CFI_INTELEXT=y
|
||||
CONFIG_MTD_CFI_AMDSTD=y
|
||||
CONFIG_MTD_CFI_STAA=y
|
||||
CONFIG_MTD_PHYSMAP_OF=y
|
||||
CONFIG_MTD_UBI=y
|
||||
CONFIG_BLK_DEV_LOOP=y
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_NETDEVICES=y
|
||||
# CONFIG_NET_VENDOR_ARC is not set
|
||||
# CONFIG_NET_VENDOR_BROADCOM is not set
|
||||
# CONFIG_NET_VENDOR_INTEL is not set
|
||||
# CONFIG_NET_VENDOR_MARVELL is not set
|
||||
# CONFIG_NET_VENDOR_MICREL is not set
|
||||
# CONFIG_NET_VENDOR_NATSEMI is not set
|
||||
# CONFIG_NET_VENDOR_SAMSUNG is not set
|
||||
# CONFIG_NET_VENDOR_SEEQ is not set
|
||||
# CONFIG_NET_VENDOR_SMSC is not set
|
||||
# CONFIG_NET_VENDOR_STMICRO is not set
|
||||
# CONFIG_NET_VENDOR_VIA is not set
|
||||
# CONFIG_NET_VENDOR_WIZNET is not set
|
||||
CONFIG_MARVELL_PHY=y
|
||||
# CONFIG_WLAN is not set
|
||||
# CONFIG_INPUT_MOUSEDEV is not set
|
||||
# CONFIG_INPUT_KEYBOARD is not set
|
||||
# CONFIG_INPUT_MOUSE is not set
|
||||
# CONFIG_SERIO is not set
|
||||
CONFIG_SERIAL_8250=y
|
||||
# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set
|
||||
CONFIG_SERIAL_8250_CONSOLE=y
|
||||
CONFIG_SERIAL_OF_PLATFORM=y
|
||||
CONFIG_HW_RANDOM=y
|
||||
# CONFIG_HWMON is not set
|
||||
CONFIG_WATCHDOG=y
|
||||
CONFIG_WATCHDOG_NOWAYOUT=y
|
||||
CONFIG_SOFT_WATCHDOG=y
|
||||
# CONFIG_VGA_CONSOLE is not set
|
||||
# CONFIG_USB_SUPPORT is not set
|
||||
# CONFIG_IOMMU_SUPPORT is not set
|
||||
CONFIG_EXT3_FS=y
|
||||
CONFIG_EXT4_FS=y
|
||||
CONFIG_FANOTIFY=y
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_PROC_KCORE=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_TMPFS_POSIX_ACL=y
|
||||
CONFIG_UBIFS_FS=y
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NFS_V4=y
|
||||
CONFIG_NFS_SWAP=y
|
||||
CONFIG_ROOT_NFS=y
|
||||
CONFIG_SUNRPC_DEBUG=y
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
CONFIG_PRINTK_TIME=y
|
||||
CONFIG_DYNAMIC_DEBUG=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_LOCKUP_DETECTOR=y
|
||||
# CONFIG_SCHED_DEBUG is not set
|
||||
CONFIG_SCHEDSTATS=y
|
||||
CONFIG_TIMER_STATS=y
|
||||
CONFIG_DEBUG_RT_MUTEXES=y
|
||||
CONFIG_DEBUG_SPINLOCK=y
|
||||
CONFIG_DEBUG_MUTEXES=y
|
||||
CONFIG_DEBUG_ATOMIC_SLEEP=y
|
||||
CONFIG_STACKTRACE=y
|
||||
CONFIG_RCU_TRACE=y
|
||||
# CONFIG_FTRACE is not set
|
||||
CONFIG_LD_NO_RELAX=y
|
||||
# CONFIG_S32C1I_SELFTEST is not set
|
||||
CONFIG_CRYPTO_ANSI_CPRNG=y
|
761
arch/xtensa/configs/iss_defconfig
Normal file
761
arch/xtensa/configs/iss_defconfig
Normal file
|
@ -0,0 +1,761 @@
|
|||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Linux kernel version: 2.6.34-rc6
|
||||
# Tue Aug 3 00:10:54 2010
|
||||
#
|
||||
# CONFIG_FRAME_POINTER is not set
|
||||
CONFIG_ZONE_DMA=y
|
||||
CONFIG_XTENSA=y
|
||||
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
|
||||
CONFIG_GENERIC_FIND_NEXT_BIT=y
|
||||
CONFIG_GENERIC_HWEIGHT=y
|
||||
# CONFIG_ARCH_HAS_ILOG2_U32 is not set
|
||||
# CONFIG_ARCH_HAS_ILOG2_U64 is not set
|
||||
CONFIG_NO_IOPORT_MAP=y
|
||||
CONFIG_HZ=100
|
||||
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
|
||||
CONFIG_CONSTRUCTORS=y
|
||||
|
||||
#
|
||||
# General setup
|
||||
#
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_BROKEN_ON_SMP=y
|
||||
CONFIG_INIT_ENV_ARG_LIMIT=32
|
||||
CONFIG_LOCALVERSION=""
|
||||
CONFIG_LOCALVERSION_AUTO=y
|
||||
CONFIG_SWAP=y
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_SYSVIPC_SYSCTL=y
|
||||
# CONFIG_POSIX_MQUEUE is not set
|
||||
# CONFIG_BSD_PROCESS_ACCT is not set
|
||||
# CONFIG_TASKSTATS is not set
|
||||
# CONFIG_AUDIT is not set
|
||||
|
||||
#
|
||||
# RCU Subsystem
|
||||
#
|
||||
CONFIG_TREE_RCU=y
|
||||
# CONFIG_TREE_PREEMPT_RCU is not set
|
||||
# CONFIG_TINY_RCU is not set
|
||||
# CONFIG_RCU_TRACE is not set
|
||||
CONFIG_RCU_FANOUT=32
|
||||
# CONFIG_RCU_FANOUT_EXACT is not set
|
||||
# CONFIG_TREE_RCU_TRACE is not set
|
||||
# CONFIG_IKCONFIG is not set
|
||||
CONFIG_LOG_BUF_SHIFT=14
|
||||
# CONFIG_CGROUPS is not set
|
||||
# CONFIG_SYSFS_DEPRECATED_V2 is not set
|
||||
# CONFIG_RELAY is not set
|
||||
# CONFIG_NAMESPACES is not set
|
||||
# CONFIG_BLK_DEV_INITRD is not set
|
||||
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
|
||||
CONFIG_SYSCTL=y
|
||||
CONFIG_ANON_INODES=y
|
||||
CONFIG_EXPERT=y
|
||||
CONFIG_SYSCTL_SYSCALL=y
|
||||
CONFIG_KALLSYMS=y
|
||||
# CONFIG_KALLSYMS_ALL is not set
|
||||
# CONFIG_KALLSYMS_EXTRA_PASS is not set
|
||||
# CONFIG_HOTPLUG is not set
|
||||
CONFIG_PRINTK=y
|
||||
CONFIG_BUG=y
|
||||
CONFIG_ELF_CORE=y
|
||||
CONFIG_BASE_FULL=y
|
||||
CONFIG_FUTEX=y
|
||||
CONFIG_EPOLL=y
|
||||
CONFIG_SIGNALFD=y
|
||||
CONFIG_TIMERFD=y
|
||||
CONFIG_EVENTFD=y
|
||||
CONFIG_SHMEM=y
|
||||
CONFIG_AIO=y
|
||||
|
||||
#
|
||||
# Kernel Performance Events And Counters
|
||||
#
|
||||
CONFIG_VM_EVENT_COUNTERS=y
|
||||
CONFIG_SLUB_DEBUG=y
|
||||
CONFIG_COMPAT_BRK=y
|
||||
# CONFIG_SLAB is not set
|
||||
CONFIG_SLUB=y
|
||||
# CONFIG_SLOB is not set
|
||||
# CONFIG_PROFILING is not set
|
||||
|
||||
#
|
||||
# GCOV-based kernel profiling
|
||||
#
|
||||
# CONFIG_SLOW_WORK is not set
|
||||
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
|
||||
CONFIG_SLABINFO=y
|
||||
CONFIG_RT_MUTEXES=y
|
||||
CONFIG_BASE_SMALL=0
|
||||
# CONFIG_MODULES is not set
|
||||
CONFIG_BLOCK=y
|
||||
CONFIG_LBDAF=y
|
||||
CONFIG_BLK_DEV_BSG=y
|
||||
# CONFIG_BLK_DEV_INTEGRITY is not set
|
||||
|
||||
#
|
||||
# IO Schedulers
|
||||
#
|
||||
CONFIG_IOSCHED_NOOP=y
|
||||
# CONFIG_IOSCHED_DEADLINE is not set
|
||||
# CONFIG_IOSCHED_CFQ is not set
|
||||
# CONFIG_DEFAULT_DEADLINE is not set
|
||||
# CONFIG_DEFAULT_CFQ is not set
|
||||
CONFIG_DEFAULT_NOOP=y
|
||||
CONFIG_DEFAULT_IOSCHED="noop"
|
||||
# CONFIG_INLINE_SPIN_TRYLOCK is not set
|
||||
# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
|
||||
# CONFIG_INLINE_SPIN_LOCK is not set
|
||||
# CONFIG_INLINE_SPIN_LOCK_BH is not set
|
||||
# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
|
||||
# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
|
||||
# CONFIG_UNINLINE_SPIN_UNLOCK is not set
|
||||
# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
|
||||
CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
|
||||
# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
|
||||
# CONFIG_INLINE_READ_TRYLOCK is not set
|
||||
# CONFIG_INLINE_READ_LOCK is not set
|
||||
# CONFIG_INLINE_READ_LOCK_BH is not set
|
||||
# CONFIG_INLINE_READ_LOCK_IRQ is not set
|
||||
# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
|
||||
CONFIG_INLINE_READ_UNLOCK=y
|
||||
# CONFIG_INLINE_READ_UNLOCK_BH is not set
|
||||
CONFIG_INLINE_READ_UNLOCK_IRQ=y
|
||||
# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
|
||||
# CONFIG_INLINE_WRITE_TRYLOCK is not set
|
||||
# CONFIG_INLINE_WRITE_LOCK is not set
|
||||
# CONFIG_INLINE_WRITE_LOCK_BH is not set
|
||||
# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
|
||||
# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
|
||||
CONFIG_INLINE_WRITE_UNLOCK=y
|
||||
# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
|
||||
CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
|
||||
# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
|
||||
# CONFIG_MUTEX_SPIN_ON_OWNER is not set
|
||||
# CONFIG_FREEZER is not set
|
||||
CONFIG_MMU=y
|
||||
# CONFIG_VARIANT_IRQ_SWITCH is not set
|
||||
|
||||
#
|
||||
# Processor type and features
|
||||
#
|
||||
CONFIG_XTENSA_VARIANT_FSF=y
|
||||
# CONFIG_XTENSA_VARIANT_DC232B is not set
|
||||
# CONFIG_XTENSA_VARIANT_S6000 is not set
|
||||
# CONFIG_XTENSA_UNALIGNED_USER is not set
|
||||
# CONFIG_PREEMPT is not set
|
||||
CONFIG_XTENSA_CALIBRATE_CCOUNT=y
|
||||
CONFIG_SERIAL_CONSOLE=y
|
||||
CONFIG_XTENSA_ISS_NETWORK=y
|
||||
|
||||
#
|
||||
# Bus options
|
||||
#
|
||||
# CONFIG_PCI is not set
|
||||
# CONFIG_ARCH_SUPPORTS_MSI is not set
|
||||
|
||||
#
|
||||
# Platform options
|
||||
#
|
||||
CONFIG_XTENSA_PLATFORM_ISS=y
|
||||
# CONFIG_XTENSA_PLATFORM_XT2000 is not set
|
||||
# CONFIG_XTENSA_PLATFORM_S6105 is not set
|
||||
# CONFIG_GENERIC_CALIBRATE_DELAY is not set
|
||||
CONFIG_CMDLINE_BOOL=y
|
||||
CONFIG_CMDLINE="console=ttyS0,38400 eth0=tuntap,,tap0 ip=192.168.168.5:192.168.168.1 root=nfs nfsroot=192.168.168.1:/opt/montavista/pro/devkit/xtensa/linux_be/target"
|
||||
CONFIG_SELECT_MEMORY_MODEL=y
|
||||
CONFIG_FLATMEM_MANUAL=y
|
||||
# CONFIG_DISCONTIGMEM_MANUAL is not set
|
||||
# CONFIG_SPARSEMEM_MANUAL is not set
|
||||
CONFIG_FLATMEM=y
|
||||
CONFIG_FLAT_NODE_MEM_MAP=y
|
||||
CONFIG_PAGEFLAGS_EXTENDED=y
|
||||
CONFIG_SPLIT_PTLOCK_CPUS=4
|
||||
# CONFIG_PHYS_ADDR_T_64BIT is not set
|
||||
CONFIG_ZONE_DMA_FLAG=1
|
||||
CONFIG_BOUNCE=y
|
||||
CONFIG_VIRT_TO_BUS=y
|
||||
# CONFIG_KSM is not set
|
||||
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
|
||||
|
||||
#
|
||||
# Executable file formats
|
||||
#
|
||||
CONFIG_KCORE_ELF=y
|
||||
CONFIG_BINFMT_ELF=y
|
||||
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
|
||||
# CONFIG_HAVE_AOUT is not set
|
||||
# CONFIG_BINFMT_MISC is not set
|
||||
CONFIG_NET=y
|
||||
|
||||
#
|
||||
# Networking options
|
||||
#
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_XFRM=y
|
||||
# CONFIG_XFRM_USER is not set
|
||||
# CONFIG_XFRM_SUB_POLICY is not set
|
||||
# CONFIG_XFRM_MIGRATE is not set
|
||||
# CONFIG_XFRM_STATISTICS is not set
|
||||
# CONFIG_NET_KEY is not set
|
||||
CONFIG_INET=y
|
||||
# CONFIG_IP_MULTICAST is not set
|
||||
# CONFIG_IP_ADVANCED_ROUTER is not set
|
||||
CONFIG_IP_FIB_HASH=y
|
||||
CONFIG_IP_PNP=y
|
||||
CONFIG_IP_PNP_DHCP=y
|
||||
CONFIG_IP_PNP_BOOTP=y
|
||||
CONFIG_IP_PNP_RARP=y
|
||||
# CONFIG_NET_IPIP is not set
|
||||
# CONFIG_NET_IPGRE is not set
|
||||
# CONFIG_ARPD is not set
|
||||
# CONFIG_SYN_COOKIES is not set
|
||||
# CONFIG_INET_AH is not set
|
||||
# CONFIG_INET_ESP is not set
|
||||
# CONFIG_INET_IPCOMP is not set
|
||||
# CONFIG_INET_XFRM_TUNNEL is not set
|
||||
# CONFIG_INET_TUNNEL is not set
|
||||
CONFIG_INET_XFRM_MODE_TRANSPORT=y
|
||||
CONFIG_INET_XFRM_MODE_TUNNEL=y
|
||||
CONFIG_INET_XFRM_MODE_BEET=y
|
||||
CONFIG_INET_LRO=y
|
||||
CONFIG_INET_DIAG=y
|
||||
CONFIG_INET_TCP_DIAG=y
|
||||
# CONFIG_TCP_CONG_ADVANCED is not set
|
||||
CONFIG_TCP_CONG_CUBIC=y
|
||||
CONFIG_DEFAULT_TCP_CONG="cubic"
|
||||
# CONFIG_TCP_MD5SIG is not set
|
||||
# CONFIG_IPV6 is not set
|
||||
# CONFIG_NETWORK_SECMARK is not set
|
||||
# CONFIG_NETFILTER is not set
|
||||
# CONFIG_IP_DCCP is not set
|
||||
# CONFIG_IP_SCTP is not set
|
||||
# CONFIG_RDS is not set
|
||||
# CONFIG_TIPC is not set
|
||||
# CONFIG_ATM is not set
|
||||
# CONFIG_BRIDGE is not set
|
||||
# CONFIG_NET_DSA is not set
|
||||
# CONFIG_VLAN_8021Q is not set
|
||||
# CONFIG_DECNET is not set
|
||||
# CONFIG_LLC2 is not set
|
||||
# CONFIG_IPX is not set
|
||||
# CONFIG_ATALK is not set
|
||||
# CONFIG_X25 is not set
|
||||
# CONFIG_LAPB is not set
|
||||
# CONFIG_ECONET is not set
|
||||
# CONFIG_WAN_ROUTER is not set
|
||||
# CONFIG_PHONET is not set
|
||||
# CONFIG_IEEE802154 is not set
|
||||
# CONFIG_NET_SCHED is not set
|
||||
# CONFIG_DCB is not set
|
||||
|
||||
#
|
||||
# Network testing
|
||||
#
|
||||
# CONFIG_NET_PKTGEN is not set
|
||||
# CONFIG_HAMRADIO is not set
|
||||
# CONFIG_CAN is not set
|
||||
# CONFIG_IRDA is not set
|
||||
# CONFIG_BT is not set
|
||||
# CONFIG_AF_RXRPC is not set
|
||||
CONFIG_WIRELESS=y
|
||||
# CONFIG_CFG80211 is not set
|
||||
# CONFIG_LIB80211 is not set
|
||||
|
||||
#
|
||||
# CFG80211 needs to be enabled for MAC80211
|
||||
#
|
||||
# CONFIG_WIMAX is not set
|
||||
# CONFIG_RFKILL is not set
|
||||
# CONFIG_NET_9P is not set
|
||||
|
||||
#
|
||||
# Device Drivers
|
||||
#
|
||||
|
||||
#
|
||||
# Generic Driver Options
|
||||
#
|
||||
# CONFIG_STANDALONE is not set
|
||||
CONFIG_PREVENT_FIRMWARE_BUILD=y
|
||||
# CONFIG_DEBUG_DRIVER is not set
|
||||
# CONFIG_DEBUG_DEVRES is not set
|
||||
# CONFIG_SYS_HYPERVISOR is not set
|
||||
# CONFIG_CONNECTOR is not set
|
||||
# CONFIG_MTD is not set
|
||||
# CONFIG_PARPORT is not set
|
||||
CONFIG_BLK_DEV=y
|
||||
# CONFIG_BLK_DEV_COW_COMMON is not set
|
||||
# CONFIG_BLK_DEV_LOOP is not set
|
||||
|
||||
#
|
||||
# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
|
||||
#
|
||||
# CONFIG_BLK_DEV_NBD is not set
|
||||
# CONFIG_BLK_DEV_RAM is not set
|
||||
# CONFIG_CDROM_PKTCDVD is not set
|
||||
# CONFIG_ATA_OVER_ETH is not set
|
||||
# CONFIG_BLK_DEV_HD is not set
|
||||
CONFIG_MISC_DEVICES=y
|
||||
# CONFIG_ENCLOSURE_SERVICES is not set
|
||||
# CONFIG_C2PORT is not set
|
||||
|
||||
#
|
||||
# EEPROM support
|
||||
#
|
||||
# CONFIG_EEPROM_93CX6 is not set
|
||||
# CONFIG_HAVE_IDE is not set
|
||||
# CONFIG_IDE is not set
|
||||
|
||||
#
|
||||
# SCSI device support
|
||||
#
|
||||
CONFIG_SCSI_MOD=y
|
||||
# CONFIG_RAID_ATTRS is not set
|
||||
# CONFIG_SCSI is not set
|
||||
# CONFIG_SCSI_DMA is not set
|
||||
# CONFIG_SCSI_NETLINK is not set
|
||||
# CONFIG_ATA is not set
|
||||
# CONFIG_MD is not set
|
||||
# CONFIG_NETDEVICES is not set
|
||||
# CONFIG_ISDN is not set
|
||||
# CONFIG_PHONE is not set
|
||||
|
||||
#
|
||||
# Input device support
|
||||
#
|
||||
CONFIG_INPUT=y
|
||||
# CONFIG_INPUT_FF_MEMLESS is not set
|
||||
# CONFIG_INPUT_POLLDEV is not set
|
||||
# CONFIG_INPUT_SPARSEKMAP is not set
|
||||
|
||||
#
|
||||
# Userland interfaces
|
||||
#
|
||||
# CONFIG_INPUT_MOUSEDEV is not set
|
||||
# CONFIG_INPUT_JOYDEV is not set
|
||||
# CONFIG_INPUT_EVDEV is not set
|
||||
# CONFIG_INPUT_EVBUG is not set
|
||||
|
||||
#
|
||||
# Input Device Drivers
|
||||
#
|
||||
# CONFIG_INPUT_KEYBOARD is not set
|
||||
# CONFIG_INPUT_MOUSE is not set
|
||||
# CONFIG_INPUT_JOYSTICK is not set
|
||||
# CONFIG_INPUT_TABLET is not set
|
||||
# CONFIG_INPUT_TOUCHSCREEN is not set
|
||||
# CONFIG_INPUT_MISC is not set
|
||||
|
||||
#
|
||||
# Hardware I/O ports
|
||||
#
|
||||
# CONFIG_SERIO is not set
|
||||
# CONFIG_GAMEPORT is not set
|
||||
|
||||
#
|
||||
# Character devices
|
||||
#
|
||||
CONFIG_VT=y
|
||||
CONFIG_CONSOLE_TRANSLATIONS=y
|
||||
CONFIG_VT_CONSOLE=y
|
||||
CONFIG_HW_CONSOLE=y
|
||||
# CONFIG_VT_HW_CONSOLE_BINDING is not set
|
||||
CONFIG_DEVKMEM=y
|
||||
# CONFIG_SERIAL_NONSTANDARD is not set
|
||||
|
||||
#
|
||||
# Serial drivers
|
||||
#
|
||||
# CONFIG_SERIAL_8250 is not set
|
||||
|
||||
#
|
||||
# Non-8250 serial port support
|
||||
#
|
||||
# CONFIG_SERIAL_TIMBERDALE is not set
|
||||
CONFIG_UNIX98_PTYS=y
|
||||
# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
|
||||
CONFIG_LEGACY_PTYS=y
|
||||
CONFIG_LEGACY_PTY_COUNT=256
|
||||
# CONFIG_IPMI_HANDLER is not set
|
||||
CONFIG_HW_RANDOM=y
|
||||
# CONFIG_HW_RANDOM_TIMERIOMEM is not set
|
||||
# CONFIG_RTC is not set
|
||||
# CONFIG_GEN_RTC is not set
|
||||
# CONFIG_R3964 is not set
|
||||
# CONFIG_RAW_DRIVER is not set
|
||||
# CONFIG_TCG_TPM is not set
|
||||
# CONFIG_I2C is not set
|
||||
# CONFIG_SPI is not set
|
||||
|
||||
#
|
||||
# PPS support
|
||||
#
|
||||
# CONFIG_PPS is not set
|
||||
# CONFIG_W1 is not set
|
||||
# CONFIG_POWER_SUPPLY is not set
|
||||
CONFIG_HWMON=y
|
||||
# CONFIG_HWMON_VID is not set
|
||||
# CONFIG_HWMON_DEBUG_CHIP is not set
|
||||
|
||||
#
|
||||
# Native drivers
|
||||
#
|
||||
# CONFIG_SENSORS_F71805F is not set
|
||||
# CONFIG_SENSORS_F71882FG is not set
|
||||
# CONFIG_SENSORS_IT87 is not set
|
||||
# CONFIG_SENSORS_PC87360 is not set
|
||||
# CONFIG_SENSORS_PC87427 is not set
|
||||
# CONFIG_SENSORS_SHT15 is not set
|
||||
# CONFIG_SENSORS_SMSC47M1 is not set
|
||||
# CONFIG_SENSORS_SMSC47B397 is not set
|
||||
# CONFIG_SENSORS_VT1211 is not set
|
||||
# CONFIG_SENSORS_W83627HF is not set
|
||||
# CONFIG_SENSORS_W83627EHF is not set
|
||||
# CONFIG_THERMAL is not set
|
||||
CONFIG_WATCHDOG=y
|
||||
CONFIG_WATCHDOG_NOWAYOUT=y
|
||||
|
||||
#
|
||||
# Watchdog Device Drivers
|
||||
#
|
||||
CONFIG_SOFT_WATCHDOG=y
|
||||
CONFIG_SSB_POSSIBLE=y
|
||||
|
||||
#
|
||||
# Sonics Silicon Backplane
|
||||
#
|
||||
# CONFIG_SSB is not set
|
||||
|
||||
#
|
||||
# Multifunction device drivers
|
||||
#
|
||||
# CONFIG_MFD_CORE is not set
|
||||
# CONFIG_MFD_SM501 is not set
|
||||
# CONFIG_HTC_PASIC3 is not set
|
||||
# CONFIG_MFD_TMIO is not set
|
||||
# CONFIG_REGULATOR is not set
|
||||
# CONFIG_MEDIA_SUPPORT is not set
|
||||
|
||||
#
|
||||
# Graphics support
|
||||
#
|
||||
# CONFIG_VGASTATE is not set
|
||||
# CONFIG_VIDEO_OUTPUT_CONTROL is not set
|
||||
# CONFIG_FB is not set
|
||||
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
|
||||
|
||||
#
|
||||
# Display device support
|
||||
#
|
||||
# CONFIG_DISPLAY_SUPPORT is not set
|
||||
|
||||
#
|
||||
# Console display driver support
|
||||
#
|
||||
# CONFIG_VGA_CONSOLE is not set
|
||||
CONFIG_DUMMY_CONSOLE=y
|
||||
# CONFIG_SOUND is not set
|
||||
CONFIG_HID_SUPPORT=y
|
||||
CONFIG_HID=y
|
||||
# CONFIG_HIDRAW is not set
|
||||
# CONFIG_HID_PID is not set
|
||||
|
||||
#
|
||||
# Special HID drivers
|
||||
#
|
||||
CONFIG_USB_SUPPORT=y
|
||||
# CONFIG_USB_ARCH_HAS_HCD is not set
|
||||
# CONFIG_USB_ARCH_HAS_OHCI is not set
|
||||
# CONFIG_USB_ARCH_HAS_EHCI is not set
|
||||
# CONFIG_USB_OTG_WHITELIST is not set
|
||||
# CONFIG_USB_OTG_BLACKLIST_HUB is not set
|
||||
|
||||
#
|
||||
# Enable Host or Gadget support to see Inventra options
|
||||
#
|
||||
|
||||
#
|
||||
# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
|
||||
#
|
||||
# CONFIG_USB_GADGET is not set
|
||||
|
||||
#
|
||||
# OTG and related infrastructure
|
||||
#
|
||||
# CONFIG_MMC is not set
|
||||
# CONFIG_MEMSTICK is not set
|
||||
# CONFIG_NEW_LEDS is not set
|
||||
# CONFIG_ACCESSIBILITY is not set
|
||||
# CONFIG_RTC_CLASS is not set
|
||||
# CONFIG_DMADEVICES is not set
|
||||
# CONFIG_AUXDISPLAY is not set
|
||||
# CONFIG_UIO is not set
|
||||
|
||||
#
|
||||
# TI VLYNQ
|
||||
#
|
||||
# CONFIG_STAGING is not set
|
||||
|
||||
#
|
||||
# File systems
|
||||
#
|
||||
# CONFIG_EXT2_FS is not set
|
||||
# CONFIG_EXT3_FS is not set
|
||||
# CONFIG_EXT4_FS is not set
|
||||
# CONFIG_REISERFS_FS is not set
|
||||
# CONFIG_JFS_FS is not set
|
||||
# CONFIG_FS_POSIX_ACL is not set
|
||||
# CONFIG_XFS_FS is not set
|
||||
# CONFIG_GFS2_FS is not set
|
||||
# CONFIG_OCFS2_FS is not set
|
||||
# CONFIG_BTRFS_FS is not set
|
||||
# CONFIG_NILFS2_FS is not set
|
||||
CONFIG_FILE_LOCKING=y
|
||||
CONFIG_FSNOTIFY=y
|
||||
# CONFIG_DNOTIFY is not set
|
||||
# CONFIG_INOTIFY is not set
|
||||
CONFIG_INOTIFY_USER=y
|
||||
# CONFIG_QUOTA is not set
|
||||
# CONFIG_AUTOFS_FS is not set
|
||||
# CONFIG_AUTOFS4_FS is not set
|
||||
# CONFIG_FUSE_FS is not set
|
||||
|
||||
#
|
||||
# Caches
|
||||
#
|
||||
# CONFIG_FSCACHE is not set
|
||||
|
||||
#
|
||||
# CD-ROM/DVD Filesystems
|
||||
#
|
||||
# CONFIG_ISO9660_FS is not set
|
||||
# CONFIG_UDF_FS is not set
|
||||
|
||||
#
|
||||
# DOS/FAT/NT Filesystems
|
||||
#
|
||||
# CONFIG_MSDOS_FS is not set
|
||||
# CONFIG_VFAT_FS is not set
|
||||
# CONFIG_NTFS_FS is not set
|
||||
|
||||
#
|
||||
# Pseudo filesystems
|
||||
#
|
||||
CONFIG_PROC_FS=y
|
||||
CONFIG_PROC_KCORE=y
|
||||
CONFIG_PROC_SYSCTL=y
|
||||
CONFIG_PROC_PAGE_MONITOR=y
|
||||
CONFIG_SYSFS=y
|
||||
CONFIG_TMPFS=y
|
||||
# CONFIG_TMPFS_POSIX_ACL is not set
|
||||
# CONFIG_HUGETLB_PAGE is not set
|
||||
# CONFIG_CONFIGFS_FS is not set
|
||||
CONFIG_MISC_FILESYSTEMS=y
|
||||
# CONFIG_ADFS_FS is not set
|
||||
# CONFIG_AFFS_FS is not set
|
||||
# CONFIG_HFS_FS is not set
|
||||
# CONFIG_HFSPLUS_FS is not set
|
||||
# CONFIG_BEFS_FS is not set
|
||||
# CONFIG_BFS_FS is not set
|
||||
# CONFIG_EFS_FS is not set
|
||||
# CONFIG_LOGFS is not set
|
||||
# CONFIG_CRAMFS is not set
|
||||
# CONFIG_SQUASHFS is not set
|
||||
# CONFIG_VXFS_FS is not set
|
||||
# CONFIG_MINIX_FS is not set
|
||||
# CONFIG_OMFS_FS is not set
|
||||
# CONFIG_HPFS_FS is not set
|
||||
# CONFIG_QNX4FS_FS is not set
|
||||
# CONFIG_ROMFS_FS is not set
|
||||
# CONFIG_SYSV_FS is not set
|
||||
# CONFIG_UFS_FS is not set
|
||||
CONFIG_NETWORK_FILESYSTEMS=y
|
||||
# CONFIG_NFS_FS is not set
|
||||
# CONFIG_NFSD is not set
|
||||
# CONFIG_SMB_FS is not set
|
||||
# CONFIG_CEPH_FS is not set
|
||||
# CONFIG_CIFS is not set
|
||||
# CONFIG_NCP_FS is not set
|
||||
# CONFIG_CODA_FS is not set
|
||||
# CONFIG_AFS_FS is not set
|
||||
|
||||
#
|
||||
# Partition Types
|
||||
#
|
||||
# CONFIG_PARTITION_ADVANCED is not set
|
||||
CONFIG_MSDOS_PARTITION=y
|
||||
# CONFIG_NLS is not set
|
||||
# CONFIG_DLM is not set
|
||||
|
||||
#
|
||||
# Kernel hacking
|
||||
#
|
||||
# CONFIG_PRINTK_TIME is not set
|
||||
CONFIG_ENABLE_WARN_DEPRECATED=y
|
||||
CONFIG_ENABLE_MUST_CHECK=y
|
||||
CONFIG_FRAME_WARN=1024
|
||||
# CONFIG_MAGIC_SYSRQ is not set
|
||||
# CONFIG_STRIP_ASM_SYMS is not set
|
||||
# CONFIG_UNUSED_SYMBOLS is not set
|
||||
# CONFIG_DEBUG_FS is not set
|
||||
# CONFIG_HEADERS_CHECK is not set
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
# CONFIG_DEBUG_SHIRQ is not set
|
||||
CONFIG_DETECT_SOFTLOCKUP=y
|
||||
# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
|
||||
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
|
||||
CONFIG_DETECT_HUNG_TASK=y
|
||||
# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
|
||||
CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
|
||||
CONFIG_SCHED_DEBUG=y
|
||||
# CONFIG_SCHEDSTATS is not set
|
||||
# CONFIG_TIMER_STATS is not set
|
||||
# CONFIG_DEBUG_OBJECTS is not set
|
||||
# CONFIG_SLUB_DEBUG_ON is not set
|
||||
# CONFIG_SLUB_STATS is not set
|
||||
# CONFIG_DEBUG_RT_MUTEXES is not set
|
||||
# CONFIG_RT_MUTEX_TESTER is not set
|
||||
# CONFIG_DEBUG_SPINLOCK is not set
|
||||
# CONFIG_DEBUG_MUTEXES is not set
|
||||
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
|
||||
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
|
||||
# CONFIG_DEBUG_KOBJECT is not set
|
||||
# CONFIG_DEBUG_INFO is not set
|
||||
# CONFIG_DEBUG_VM is not set
|
||||
# CONFIG_DEBUG_MEMORY_INIT is not set
|
||||
# CONFIG_DEBUG_LIST is not set
|
||||
# CONFIG_DEBUG_SG is not set
|
||||
# CONFIG_DEBUG_NOTIFIERS is not set
|
||||
# CONFIG_DEBUG_CREDENTIALS is not set
|
||||
# CONFIG_RCU_TORTURE_TEST is not set
|
||||
CONFIG_RCU_CPU_STALL_DETECTOR=y
|
||||
# CONFIG_BACKTRACE_SELF_TEST is not set
|
||||
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
|
||||
# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
|
||||
# CONFIG_FAULT_INJECTION is not set
|
||||
# CONFIG_SYSCTL_SYSCALL_CHECK is not set
|
||||
# CONFIG_PAGE_POISONING is not set
|
||||
# CONFIG_SAMPLES is not set
|
||||
|
||||
#
|
||||
# Security options
|
||||
#
|
||||
# CONFIG_KEYS is not set
|
||||
# CONFIG_SECURITY is not set
|
||||
# CONFIG_SECURITYFS is not set
|
||||
# CONFIG_DEFAULT_SECURITY_SELINUX is not set
|
||||
# CONFIG_DEFAULT_SECURITY_SMACK is not set
|
||||
# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
|
||||
CONFIG_DEFAULT_SECURITY_DAC=y
|
||||
CONFIG_DEFAULT_SECURITY=""
|
||||
CONFIG_CRYPTO=y
|
||||
|
||||
#
|
||||
# Crypto core or helper
|
||||
#
|
||||
# CONFIG_CRYPTO_FIPS is not set
|
||||
CONFIG_CRYPTO_ALGAPI=y
|
||||
CONFIG_CRYPTO_ALGAPI2=y
|
||||
CONFIG_CRYPTO_RNG=y
|
||||
CONFIG_CRYPTO_RNG2=y
|
||||
# CONFIG_CRYPTO_MANAGER is not set
|
||||
# CONFIG_CRYPTO_MANAGER2 is not set
|
||||
# CONFIG_CRYPTO_GF128MUL is not set
|
||||
# CONFIG_CRYPTO_NULL is not set
|
||||
# CONFIG_CRYPTO_CRYPTD is not set
|
||||
# CONFIG_CRYPTO_AUTHENC is not set
|
||||
|
||||
#
|
||||
# Authenticated Encryption with Associated Data
|
||||
#
|
||||
# CONFIG_CRYPTO_CCM is not set
|
||||
# CONFIG_CRYPTO_GCM is not set
|
||||
# CONFIG_CRYPTO_SEQIV is not set
|
||||
|
||||
#
|
||||
# Block modes
|
||||
#
|
||||
# CONFIG_CRYPTO_CBC is not set
|
||||
# CONFIG_CRYPTO_CTR is not set
|
||||
# CONFIG_CRYPTO_CTS is not set
|
||||
# CONFIG_CRYPTO_ECB is not set
|
||||
# CONFIG_CRYPTO_LRW is not set
|
||||
# CONFIG_CRYPTO_PCBC is not set
|
||||
# CONFIG_CRYPTO_XTS is not set
|
||||
|
||||
#
|
||||
# Hash modes
|
||||
#
|
||||
# CONFIG_CRYPTO_HMAC is not set
|
||||
# CONFIG_CRYPTO_XCBC is not set
|
||||
# CONFIG_CRYPTO_VMAC is not set
|
||||
|
||||
#
|
||||
# Digest
|
||||
#
|
||||
# CONFIG_CRYPTO_CRC32C is not set
|
||||
# CONFIG_CRYPTO_GHASH is not set
|
||||
# CONFIG_CRYPTO_MD4 is not set
|
||||
# CONFIG_CRYPTO_MD5 is not set
|
||||
# CONFIG_CRYPTO_MICHAEL_MIC is not set
|
||||
# CONFIG_CRYPTO_RMD128 is not set
|
||||
# CONFIG_CRYPTO_RMD160 is not set
|
||||
# CONFIG_CRYPTO_RMD256 is not set
|
||||
# CONFIG_CRYPTO_RMD320 is not set
|
||||
# CONFIG_CRYPTO_SHA1 is not set
|
||||
# CONFIG_CRYPTO_SHA256 is not set
|
||||
# CONFIG_CRYPTO_SHA512 is not set
|
||||
# CONFIG_CRYPTO_TGR192 is not set
|
||||
# CONFIG_CRYPTO_WP512 is not set
|
||||
|
||||
#
|
||||
# Ciphers
|
||||
#
|
||||
CONFIG_CRYPTO_AES=y
|
||||
# CONFIG_CRYPTO_ANUBIS is not set
|
||||
# CONFIG_CRYPTO_ARC4 is not set
|
||||
# CONFIG_CRYPTO_BLOWFISH is not set
|
||||
# CONFIG_CRYPTO_CAMELLIA is not set
|
||||
# CONFIG_CRYPTO_CAST5 is not set
|
||||
# CONFIG_CRYPTO_CAST6 is not set
|
||||
# CONFIG_CRYPTO_DES is not set
|
||||
# CONFIG_CRYPTO_FCRYPT is not set
|
||||
# CONFIG_CRYPTO_KHAZAD is not set
|
||||
# CONFIG_CRYPTO_SALSA20 is not set
|
||||
# CONFIG_CRYPTO_SEED is not set
|
||||
# CONFIG_CRYPTO_SERPENT is not set
|
||||
# CONFIG_CRYPTO_TEA is not set
|
||||
# CONFIG_CRYPTO_TWOFISH is not set
|
||||
|
||||
#
|
||||
# Compression
|
||||
#
|
||||
# CONFIG_CRYPTO_DEFLATE is not set
|
||||
# CONFIG_CRYPTO_ZLIB is not set
|
||||
# CONFIG_CRYPTO_LZO is not set
|
||||
|
||||
#
|
||||
# Random Number Generation
|
||||
#
|
||||
CONFIG_CRYPTO_ANSI_CPRNG=y
|
||||
CONFIG_CRYPTO_HW=y
|
||||
# CONFIG_BINARY_PRINTF is not set
|
||||
|
||||
#
|
||||
# Library routines
|
||||
#
|
||||
CONFIG_GENERIC_FIND_LAST_BIT=y
|
||||
# CONFIG_CRC_CCITT is not set
|
||||
# CONFIG_CRC16 is not set
|
||||
# CONFIG_CRC_T10DIF is not set
|
||||
# CONFIG_CRC_ITU_T is not set
|
||||
# CONFIG_CRC32 is not set
|
||||
# CONFIG_CRC7 is not set
|
||||
# CONFIG_LIBCRC32C is not set
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_NLATTR=y
|
615
arch/xtensa/configs/s6105_defconfig
Normal file
615
arch/xtensa/configs/s6105_defconfig
Normal file
|
@ -0,0 +1,615 @@
|
|||
#
|
||||
# Automatically generated make config: don't edit
|
||||
# Linux kernel version: 2.6.29-rc7-s6
|
||||
# Tue Mar 10 11:09:26 2009
|
||||
#
|
||||
# CONFIG_FRAME_POINTER is not set
|
||||
CONFIG_ZONE_DMA=y
|
||||
CONFIG_XTENSA=y
|
||||
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
|
||||
CONFIG_GENERIC_FIND_NEXT_BIT=y
|
||||
CONFIG_GENERIC_HWEIGHT=y
|
||||
# CONFIG_ARCH_HAS_ILOG2_U32 is not set
|
||||
# CONFIG_ARCH_HAS_ILOG2_U64 is not set
|
||||
CONFIG_NO_IOPORT_MAP=y
|
||||
CONFIG_HZ=100
|
||||
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
|
||||
|
||||
#
|
||||
# General setup
|
||||
#
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_BROKEN_ON_SMP=y
|
||||
CONFIG_INIT_ENV_ARG_LIMIT=32
|
||||
CONFIG_LOCALVERSION=""
|
||||
CONFIG_LOCALVERSION_AUTO=y
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_SYSVIPC_SYSCTL=y
|
||||
# CONFIG_POSIX_MQUEUE is not set
|
||||
# CONFIG_BSD_PROCESS_ACCT is not set
|
||||
# CONFIG_TASKSTATS is not set
|
||||
# CONFIG_AUDIT is not set
|
||||
|
||||
#
|
||||
# RCU Subsystem
|
||||
#
|
||||
# CONFIG_CLASSIC_RCU is not set
|
||||
# CONFIG_TREE_RCU is not set
|
||||
CONFIG_PREEMPT_RCU=y
|
||||
# CONFIG_RCU_TRACE is not set
|
||||
# CONFIG_TREE_RCU_TRACE is not set
|
||||
# CONFIG_PREEMPT_RCU_TRACE is not set
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_LOG_BUF_SHIFT=16
|
||||
# CONFIG_GROUP_SCHED is not set
|
||||
# CONFIG_CGROUPS is not set
|
||||
# CONFIG_SYSFS_DEPRECATED_V2 is not set
|
||||
# CONFIG_RELAY is not set
|
||||
# CONFIG_NAMESPACES is not set
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
CONFIG_INITRAMFS_SOURCE=""
|
||||
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
|
||||
CONFIG_SYSCTL=y
|
||||
CONFIG_EXPERT=y
|
||||
CONFIG_SYSCTL_SYSCALL=y
|
||||
CONFIG_KALLSYMS=y
|
||||
# CONFIG_KALLSYMS_ALL is not set
|
||||
# CONFIG_KALLSYMS_EXTRA_PASS is not set
|
||||
# CONFIG_HOTPLUG is not set
|
||||
CONFIG_PRINTK=y
|
||||
CONFIG_BUG=y
|
||||
CONFIG_ELF_CORE=y
|
||||
# CONFIG_COMPAT_BRK is not set
|
||||
CONFIG_BASE_FULL=y
|
||||
CONFIG_FUTEX=y
|
||||
CONFIG_ANON_INODES=y
|
||||
CONFIG_EPOLL=y
|
||||
CONFIG_SIGNALFD=y
|
||||
CONFIG_TIMERFD=y
|
||||
CONFIG_EVENTFD=y
|
||||
CONFIG_AIO=y
|
||||
CONFIG_VM_EVENT_COUNTERS=y
|
||||
CONFIG_SLAB=y
|
||||
# CONFIG_SLUB is not set
|
||||
# CONFIG_SLOB is not set
|
||||
# CONFIG_PROFILING is not set
|
||||
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
|
||||
CONFIG_SLABINFO=y
|
||||
CONFIG_RT_MUTEXES=y
|
||||
CONFIG_BASE_SMALL=0
|
||||
# CONFIG_MODULES is not set
|
||||
CONFIG_BLOCK=y
|
||||
# CONFIG_LBD is not set
|
||||
# CONFIG_BLK_DEV_IO_TRACE is not set
|
||||
# CONFIG_BLK_DEV_BSG is not set
|
||||
# CONFIG_BLK_DEV_INTEGRITY is not set
|
||||
|
||||
#
|
||||
# IO Schedulers
|
||||
#
|
||||
CONFIG_IOSCHED_NOOP=y
|
||||
# CONFIG_IOSCHED_AS is not set
|
||||
# CONFIG_IOSCHED_DEADLINE is not set
|
||||
CONFIG_IOSCHED_CFQ=y
|
||||
# CONFIG_DEFAULT_AS is not set
|
||||
# CONFIG_DEFAULT_DEADLINE is not set
|
||||
CONFIG_DEFAULT_CFQ=y
|
||||
# CONFIG_DEFAULT_NOOP is not set
|
||||
CONFIG_DEFAULT_IOSCHED="cfq"
|
||||
# CONFIG_FREEZER is not set
|
||||
# CONFIG_MMU is not set
|
||||
CONFIG_VARIANT_IRQ_SWITCH=y
|
||||
|
||||
#
|
||||
# Processor type and features
|
||||
#
|
||||
# CONFIG_XTENSA_VARIANT_FSF is not set
|
||||
# CONFIG_XTENSA_VARIANT_DC232B is not set
|
||||
CONFIG_XTENSA_VARIANT_S6000=y
|
||||
# CONFIG_XTENSA_UNALIGNED_USER is not set
|
||||
CONFIG_PREEMPT=y
|
||||
# CONFIG_HIGHMEM is not set
|
||||
CONFIG_XTENSA_CALIBRATE_CCOUNT=y
|
||||
CONFIG_SERIAL_CONSOLE=y
|
||||
# CONFIG_XTENSA_ISS_NETWORK is not set
|
||||
|
||||
#
|
||||
# Bus options
|
||||
#
|
||||
# CONFIG_PCI is not set
|
||||
# CONFIG_ARCH_SUPPORTS_MSI is not set
|
||||
|
||||
#
|
||||
# Platform options
|
||||
#
|
||||
# CONFIG_XTENSA_PLATFORM_ISS is not set
|
||||
# CONFIG_XTENSA_PLATFORM_XT2000 is not set
|
||||
CONFIG_XTENSA_PLATFORM_S6105=y
|
||||
CONFIG_GENERIC_CALIBRATE_DELAY=y
|
||||
CONFIG_CMDLINE_BOOL=y
|
||||
CONFIG_CMDLINE="console=ttyS1,38400 debug bootmem_debug loglevel=7"
|
||||
CONFIG_SELECT_MEMORY_MODEL=y
|
||||
CONFIG_FLATMEM_MANUAL=y
|
||||
# CONFIG_DISCONTIGMEM_MANUAL is not set
|
||||
# CONFIG_SPARSEMEM_MANUAL is not set
|
||||
CONFIG_FLATMEM=y
|
||||
CONFIG_FLAT_NODE_MEM_MAP=y
|
||||
CONFIG_PAGEFLAGS_EXTENDED=y
|
||||
CONFIG_SPLIT_PTLOCK_CPUS=4
|
||||
# CONFIG_PHYS_ADDR_T_64BIT is not set
|
||||
CONFIG_ZONE_DMA_FLAG=1
|
||||
CONFIG_VIRT_TO_BUS=y
|
||||
|
||||
#
|
||||
# Executable file formats
|
||||
#
|
||||
CONFIG_KCORE_ELF=y
|
||||
CONFIG_BINFMT_FLAT=y
|
||||
# CONFIG_BINFMT_ZFLAT is not set
|
||||
# CONFIG_BINFMT_SHARED_FLAT is not set
|
||||
# CONFIG_HAVE_AOUT is not set
|
||||
# CONFIG_BINFMT_MISC is not set
|
||||
CONFIG_NET=y
|
||||
|
||||
#
|
||||
# Networking options
|
||||
#
|
||||
CONFIG_COMPAT_NET_DEV_OPS=y
|
||||
CONFIG_PACKET=y
|
||||
# CONFIG_PACKET_MMAP is not set
|
||||
CONFIG_UNIX=y
|
||||
# CONFIG_NET_KEY is not set
|
||||
CONFIG_INET=y
|
||||
# CONFIG_IP_MULTICAST is not set
|
||||
# CONFIG_IP_ADVANCED_ROUTER is not set
|
||||
CONFIG_IP_FIB_HASH=y
|
||||
# CONFIG_IP_PNP is not set
|
||||
# CONFIG_NET_IPIP is not set
|
||||
# CONFIG_NET_IPGRE is not set
|
||||
# CONFIG_ARPD is not set
|
||||
# CONFIG_SYN_COOKIES is not set
|
||||
# CONFIG_INET_AH is not set
|
||||
# CONFIG_INET_ESP is not set
|
||||
# CONFIG_INET_IPCOMP is not set
|
||||
# CONFIG_INET_XFRM_TUNNEL is not set
|
||||
# CONFIG_INET_TUNNEL is not set
|
||||
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
|
||||
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
|
||||
# CONFIG_INET_XFRM_MODE_BEET is not set
|
||||
# CONFIG_INET_LRO is not set
|
||||
# CONFIG_INET_DIAG is not set
|
||||
# CONFIG_TCP_CONG_ADVANCED is not set
|
||||
CONFIG_TCP_CONG_CUBIC=y
|
||||
CONFIG_DEFAULT_TCP_CONG="cubic"
|
||||
# CONFIG_TCP_MD5SIG is not set
|
||||
# CONFIG_IPV6 is not set
|
||||
# CONFIG_NETWORK_SECMARK is not set
|
||||
# CONFIG_NETFILTER is not set
|
||||
# CONFIG_IP_DCCP is not set
|
||||
# CONFIG_IP_SCTP is not set
|
||||
# CONFIG_TIPC is not set
|
||||
# CONFIG_ATM is not set
|
||||
# CONFIG_BRIDGE is not set
|
||||
# CONFIG_NET_DSA is not set
|
||||
# CONFIG_VLAN_8021Q is not set
|
||||
# CONFIG_DECNET is not set
|
||||
# CONFIG_LLC2 is not set
|
||||
# CONFIG_IPX is not set
|
||||
# CONFIG_ATALK is not set
|
||||
# CONFIG_X25 is not set
|
||||
# CONFIG_LAPB is not set
|
||||
# CONFIG_ECONET is not set
|
||||
# CONFIG_WAN_ROUTER is not set
|
||||
# CONFIG_NET_SCHED is not set
|
||||
# CONFIG_DCB is not set
|
||||
|
||||
#
|
||||
# Network testing
|
||||
#
|
||||
# CONFIG_NET_PKTGEN is not set
|
||||
# CONFIG_HAMRADIO is not set
|
||||
# CONFIG_CAN is not set
|
||||
# CONFIG_IRDA is not set
|
||||
# CONFIG_BT is not set
|
||||
# CONFIG_AF_RXRPC is not set
|
||||
# CONFIG_PHONET is not set
|
||||
# CONFIG_WIRELESS is not set
|
||||
# CONFIG_WIMAX is not set
|
||||
# CONFIG_RFKILL is not set
|
||||
# CONFIG_NET_9P is not set
|
||||
|
||||
#
|
||||
# Device Drivers
|
||||
#
|
||||
|
||||
#
|
||||
# Generic Driver Options
|
||||
#
|
||||
CONFIG_STANDALONE=y
|
||||
CONFIG_PREVENT_FIRMWARE_BUILD=y
|
||||
# CONFIG_DEBUG_DRIVER is not set
|
||||
# CONFIG_DEBUG_DEVRES is not set
|
||||
# CONFIG_SYS_HYPERVISOR is not set
|
||||
# CONFIG_CONNECTOR is not set
|
||||
# CONFIG_MTD is not set
|
||||
# CONFIG_PARPORT is not set
|
||||
CONFIG_BLK_DEV=y
|
||||
# CONFIG_BLK_DEV_COW_COMMON is not set
|
||||
# CONFIG_BLK_DEV_LOOP is not set
|
||||
# CONFIG_BLK_DEV_NBD is not set
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
CONFIG_BLK_DEV_RAM_COUNT=16
|
||||
CONFIG_BLK_DEV_RAM_SIZE=4096
|
||||
# CONFIG_BLK_DEV_XIP is not set
|
||||
# CONFIG_CDROM_PKTCDVD is not set
|
||||
# CONFIG_ATA_OVER_ETH is not set
|
||||
# CONFIG_BLK_DEV_HD is not set
|
||||
# CONFIG_MISC_DEVICES is not set
|
||||
CONFIG_HAVE_IDE=y
|
||||
# CONFIG_IDE is not set
|
||||
|
||||
#
|
||||
# SCSI device support
|
||||
#
|
||||
# CONFIG_RAID_ATTRS is not set
|
||||
# CONFIG_SCSI is not set
|
||||
# CONFIG_SCSI_DMA is not set
|
||||
# CONFIG_SCSI_NETLINK is not set
|
||||
# CONFIG_ATA is not set
|
||||
# CONFIG_MD is not set
|
||||
CONFIG_NETDEVICES=y
|
||||
# CONFIG_DUMMY is not set
|
||||
# CONFIG_BONDING is not set
|
||||
# CONFIG_MACVLAN is not set
|
||||
# CONFIG_EQUALIZER is not set
|
||||
# CONFIG_TUN is not set
|
||||
# CONFIG_VETH is not set
|
||||
CONFIG_PHYLIB=y
|
||||
|
||||
#
|
||||
# MII PHY device drivers
|
||||
#
|
||||
# CONFIG_MARVELL_PHY is not set
|
||||
# CONFIG_DAVICOM_PHY is not set
|
||||
# CONFIG_QSEMI_PHY is not set
|
||||
# CONFIG_LXT_PHY is not set
|
||||
# CONFIG_CICADA_PHY is not set
|
||||
# CONFIG_VITESSE_PHY is not set
|
||||
CONFIG_SMSC_PHY=y
|
||||
# CONFIG_BROADCOM_PHY is not set
|
||||
# CONFIG_ICPLUS_PHY is not set
|
||||
# CONFIG_REALTEK_PHY is not set
|
||||
# CONFIG_NATIONAL_PHY is not set
|
||||
# CONFIG_STE10XP is not set
|
||||
# CONFIG_LSI_ET1011C_PHY is not set
|
||||
# CONFIG_FIXED_PHY is not set
|
||||
# CONFIG_MDIO_BITBANG is not set
|
||||
# CONFIG_NET_ETHERNET is not set
|
||||
CONFIG_NETDEV_1000=y
|
||||
CONFIG_S6GMAC=y
|
||||
# CONFIG_NETDEV_10000 is not set
|
||||
|
||||
#
|
||||
# Wireless LAN
|
||||
#
|
||||
# CONFIG_WLAN_PRE80211 is not set
|
||||
# CONFIG_WLAN_80211 is not set
|
||||
# CONFIG_IWLWIFI_LEDS is not set
|
||||
|
||||
#
|
||||
# Enable WiMAX (Networking options) to see the WiMAX drivers
|
||||
#
|
||||
# CONFIG_WAN is not set
|
||||
# CONFIG_PPP is not set
|
||||
# CONFIG_SLIP is not set
|
||||
# CONFIG_NETCONSOLE is not set
|
||||
# CONFIG_NETPOLL is not set
|
||||
# CONFIG_NET_POLL_CONTROLLER is not set
|
||||
# CONFIG_ISDN is not set
|
||||
# CONFIG_PHONE is not set
|
||||
|
||||
#
|
||||
# Input device support
|
||||
#
|
||||
# CONFIG_INPUT is not set
|
||||
|
||||
#
|
||||
# Hardware I/O ports
|
||||
#
|
||||
# CONFIG_SERIO is not set
|
||||
# CONFIG_GAMEPORT is not set
|
||||
|
||||
#
|
||||
# Character devices
|
||||
#
|
||||
# CONFIG_VT is not set
|
||||
# CONFIG_DEVKMEM is not set
|
||||
# CONFIG_SERIAL_NONSTANDARD is not set
|
||||
|
||||
#
|
||||
# Serial drivers
|
||||
#
|
||||
CONFIG_SERIAL_8250=y
|
||||
CONFIG_SERIAL_8250_CONSOLE=y
|
||||
CONFIG_SERIAL_8250_NR_UARTS=2
|
||||
CONFIG_SERIAL_8250_RUNTIME_UARTS=2
|
||||
# CONFIG_SERIAL_8250_EXTENDED is not set
|
||||
|
||||
#
|
||||
# Non-8250 serial port support
|
||||
#
|
||||
CONFIG_SERIAL_CORE=y
|
||||
CONFIG_SERIAL_CORE_CONSOLE=y
|
||||
CONFIG_UNIX98_PTYS=y
|
||||
# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
|
||||
# CONFIG_LEGACY_PTYS is not set
|
||||
# CONFIG_IPMI_HANDLER is not set
|
||||
# CONFIG_HW_RANDOM is not set
|
||||
# CONFIG_R3964 is not set
|
||||
# CONFIG_RAW_DRIVER is not set
|
||||
# CONFIG_TCG_TPM is not set
|
||||
# CONFIG_I2C is not set
|
||||
# CONFIG_SPI is not set
|
||||
CONFIG_ARCH_REQUIRE_GPIOLIB=y
|
||||
CONFIG_GPIOLIB=y
|
||||
# CONFIG_DEBUG_GPIO is not set
|
||||
# CONFIG_GPIO_SYSFS is not set
|
||||
|
||||
#
|
||||
# Memory mapped GPIO expanders:
|
||||
#
|
||||
|
||||
#
|
||||
# I2C GPIO expanders:
|
||||
#
|
||||
|
||||
#
|
||||
# PCI GPIO expanders:
|
||||
#
|
||||
|
||||
#
|
||||
# SPI GPIO expanders:
|
||||
#
|
||||
# CONFIG_W1 is not set
|
||||
# CONFIG_POWER_SUPPLY is not set
|
||||
# CONFIG_HWMON is not set
|
||||
# CONFIG_THERMAL is not set
|
||||
# CONFIG_THERMAL_HWMON is not set
|
||||
# CONFIG_WATCHDOG is not set
|
||||
CONFIG_SSB_POSSIBLE=y
|
||||
|
||||
#
|
||||
# Sonics Silicon Backplane
|
||||
#
|
||||
# CONFIG_SSB is not set
|
||||
|
||||
#
|
||||
# Multifunction device drivers
|
||||
#
|
||||
# CONFIG_MFD_CORE is not set
|
||||
# CONFIG_MFD_SM501 is not set
|
||||
# CONFIG_HTC_PASIC3 is not set
|
||||
# CONFIG_MFD_TMIO is not set
|
||||
# CONFIG_REGULATOR is not set
|
||||
|
||||
#
|
||||
# Multimedia devices
|
||||
#
|
||||
|
||||
#
|
||||
# Multimedia core support
|
||||
#
|
||||
# CONFIG_VIDEO_DEV is not set
|
||||
# CONFIG_DVB_CORE is not set
|
||||
# CONFIG_VIDEO_MEDIA is not set
|
||||
|
||||
#
|
||||
# Multimedia drivers
|
||||
#
|
||||
# CONFIG_DAB is not set
|
||||
|
||||
#
|
||||
# Graphics support
|
||||
#
|
||||
# CONFIG_VGASTATE is not set
|
||||
# CONFIG_VIDEO_OUTPUT_CONTROL is not set
|
||||
# CONFIG_FB is not set
|
||||
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
|
||||
|
||||
#
|
||||
# Display device support
|
||||
#
|
||||
# CONFIG_DISPLAY_SUPPORT is not set
|
||||
# CONFIG_SOUND is not set
|
||||
# CONFIG_USB_SUPPORT is not set
|
||||
# CONFIG_MMC is not set
|
||||
# CONFIG_MEMSTICK is not set
|
||||
# CONFIG_NEW_LEDS is not set
|
||||
# CONFIG_ACCESSIBILITY is not set
|
||||
CONFIG_RTC_LIB=y
|
||||
CONFIG_RTC_CLASS=y
|
||||
CONFIG_RTC_HCTOSYS=y
|
||||
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
|
||||
# CONFIG_RTC_DEBUG is not set
|
||||
|
||||
#
|
||||
# RTC interfaces
|
||||
#
|
||||
# CONFIG_RTC_INTF_SYSFS is not set
|
||||
# CONFIG_RTC_INTF_PROC is not set
|
||||
# CONFIG_RTC_INTF_DEV is not set
|
||||
# CONFIG_RTC_DRV_TEST is not set
|
||||
|
||||
#
|
||||
# I2C RTC drivers
|
||||
#
|
||||
# CONFIG_RTC_DRV_DS1307 is not set
|
||||
# CONFIG_RTC_DRV_DS1374 is not set
|
||||
# CONFIG_RTC_DRV_DS1672 is not set
|
||||
# CONFIG_RTC_DRV_MAX6900 is not set
|
||||
# CONFIG_RTC_DRV_RS5C372 is not set
|
||||
# CONFIG_RTC_DRV_ISL1208 is not set
|
||||
# CONFIG_RTC_DRV_X1205 is not set
|
||||
# CONFIG_RTC_DRV_PCF8563 is not set
|
||||
# CONFIG_RTC_DRV_PCF8583 is not set
|
||||
CONFIG_RTC_DRV_M41T80=y
|
||||
# CONFIG_RTC_DRV_M41T80_WDT is not set
|
||||
# CONFIG_RTC_DRV_S35390A is not set
|
||||
# CONFIG_RTC_DRV_FM3130 is not set
|
||||
# CONFIG_RTC_DRV_RX8581 is not set
|
||||
|
||||
#
|
||||
# SPI RTC drivers
|
||||
#
|
||||
|
||||
#
|
||||
# Platform RTC drivers
|
||||
#
|
||||
# CONFIG_RTC_DRV_DS1286 is not set
|
||||
# CONFIG_RTC_DRV_DS1511 is not set
|
||||
# CONFIG_RTC_DRV_DS1553 is not set
|
||||
# CONFIG_RTC_DRV_DS1742 is not set
|
||||
# CONFIG_RTC_DRV_STK17TA8 is not set
|
||||
# CONFIG_RTC_DRV_M48T86 is not set
|
||||
# CONFIG_RTC_DRV_M48T35 is not set
|
||||
# CONFIG_RTC_DRV_M48T59 is not set
|
||||
# CONFIG_RTC_DRV_BQ4802 is not set
|
||||
# CONFIG_RTC_DRV_V3020 is not set
|
||||
|
||||
#
|
||||
# on-CPU RTC drivers
|
||||
#
|
||||
# CONFIG_DMADEVICES is not set
|
||||
# CONFIG_UIO is not set
|
||||
# CONFIG_STAGING is not set
|
||||
|
||||
#
|
||||
# File systems
|
||||
#
|
||||
# CONFIG_EXT2_FS is not set
|
||||
# CONFIG_EXT3_FS is not set
|
||||
# CONFIG_EXT4_FS is not set
|
||||
# CONFIG_REISERFS_FS is not set
|
||||
# CONFIG_JFS_FS is not set
|
||||
# CONFIG_FS_POSIX_ACL is not set
|
||||
CONFIG_FILE_LOCKING=y
|
||||
# CONFIG_XFS_FS is not set
|
||||
# CONFIG_OCFS2_FS is not set
|
||||
# CONFIG_BTRFS_FS is not set
|
||||
# CONFIG_DNOTIFY is not set
|
||||
# CONFIG_INOTIFY is not set
|
||||
# CONFIG_QUOTA is not set
|
||||
# CONFIG_AUTOFS_FS is not set
|
||||
# CONFIG_AUTOFS4_FS is not set
|
||||
# CONFIG_FUSE_FS is not set
|
||||
|
||||
#
|
||||
# CD-ROM/DVD Filesystems
|
||||
#
|
||||
# CONFIG_ISO9660_FS is not set
|
||||
# CONFIG_UDF_FS is not set
|
||||
|
||||
#
|
||||
# DOS/FAT/NT Filesystems
|
||||
#
|
||||
# CONFIG_MSDOS_FS is not set
|
||||
# CONFIG_VFAT_FS is not set
|
||||
# CONFIG_NTFS_FS is not set
|
||||
|
||||
#
|
||||
# Pseudo filesystems
|
||||
#
|
||||
CONFIG_PROC_FS=y
|
||||
CONFIG_PROC_SYSCTL=y
|
||||
CONFIG_SYSFS=y
|
||||
# CONFIG_TMPFS is not set
|
||||
# CONFIG_HUGETLB_PAGE is not set
|
||||
# CONFIG_CONFIGFS_FS is not set
|
||||
# CONFIG_MISC_FILESYSTEMS is not set
|
||||
# CONFIG_NETWORK_FILESYSTEMS is not set
|
||||
|
||||
#
|
||||
# Partition Types
|
||||
#
|
||||
# CONFIG_PARTITION_ADVANCED is not set
|
||||
CONFIG_MSDOS_PARTITION=y
|
||||
# CONFIG_NLS is not set
|
||||
# CONFIG_DLM is not set
|
||||
|
||||
#
|
||||
# Kernel hacking
|
||||
#
|
||||
CONFIG_PRINTK_TIME=y
|
||||
# CONFIG_ENABLE_WARN_DEPRECATED is not set
|
||||
# CONFIG_ENABLE_MUST_CHECK is not set
|
||||
CONFIG_FRAME_WARN=1024
|
||||
# CONFIG_MAGIC_SYSRQ is not set
|
||||
# CONFIG_UNUSED_SYMBOLS is not set
|
||||
# CONFIG_DEBUG_FS is not set
|
||||
# CONFIG_HEADERS_CHECK is not set
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
CONFIG_DEBUG_SHIRQ=y
|
||||
CONFIG_DETECT_SOFTLOCKUP=y
|
||||
# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
|
||||
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
|
||||
# CONFIG_SCHED_DEBUG is not set
|
||||
# CONFIG_SCHEDSTATS is not set
|
||||
# CONFIG_TIMER_STATS is not set
|
||||
# CONFIG_DEBUG_OBJECTS is not set
|
||||
# CONFIG_DEBUG_SLAB is not set
|
||||
# CONFIG_DEBUG_RT_MUTEXES is not set
|
||||
# CONFIG_RT_MUTEX_TESTER is not set
|
||||
CONFIG_DEBUG_SPINLOCK=y
|
||||
CONFIG_DEBUG_MUTEXES=y
|
||||
CONFIG_DEBUG_SPINLOCK_SLEEP=y
|
||||
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
|
||||
# CONFIG_DEBUG_KOBJECT is not set
|
||||
# CONFIG_DEBUG_INFO is not set
|
||||
# CONFIG_DEBUG_VM is not set
|
||||
CONFIG_DEBUG_NOMMU_REGIONS=y
|
||||
# CONFIG_DEBUG_MEMORY_INIT is not set
|
||||
# CONFIG_DEBUG_LIST is not set
|
||||
# CONFIG_DEBUG_SG is not set
|
||||
# CONFIG_DEBUG_NOTIFIERS is not set
|
||||
# CONFIG_BOOT_PRINTK_DELAY is not set
|
||||
# CONFIG_RCU_TORTURE_TEST is not set
|
||||
# CONFIG_BACKTRACE_SELF_TEST is not set
|
||||
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
|
||||
# CONFIG_FAULT_INJECTION is not set
|
||||
# CONFIG_SYSCTL_SYSCALL_CHECK is not set
|
||||
|
||||
#
|
||||
# Tracers
|
||||
#
|
||||
# CONFIG_PREEMPT_TRACER is not set
|
||||
# CONFIG_SCHED_TRACER is not set
|
||||
# CONFIG_CONTEXT_SWITCH_TRACER is not set
|
||||
# CONFIG_BOOT_TRACER is not set
|
||||
# CONFIG_TRACE_BRANCH_PROFILING is not set
|
||||
# CONFIG_DYNAMIC_DEBUG is not set
|
||||
# CONFIG_SAMPLES is not set
|
||||
|
||||
#
|
||||
# Security options
|
||||
#
|
||||
# CONFIG_KEYS is not set
|
||||
# CONFIG_SECURITY is not set
|
||||
# CONFIG_SECURITYFS is not set
|
||||
# CONFIG_SECURITY_FILE_CAPABILITIES is not set
|
||||
# CONFIG_CRYPTO is not set
|
||||
|
||||
#
|
||||
# Library routines
|
||||
#
|
||||
CONFIG_GENERIC_FIND_LAST_BIT=y
|
||||
# CONFIG_CRC_CCITT is not set
|
||||
# CONFIG_CRC16 is not set
|
||||
# CONFIG_CRC_T10DIF is not set
|
||||
# CONFIG_CRC_ITU_T is not set
|
||||
# CONFIG_CRC32 is not set
|
||||
# CONFIG_CRC7 is not set
|
||||
# CONFIG_LIBCRC32C is not set
|
||||
CONFIG_PLIST=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HAS_DMA=y
|
135
arch/xtensa/configs/smp_lx200_defconfig
Normal file
135
arch/xtensa/configs/smp_lx200_defconfig
Normal file
|
@ -0,0 +1,135 @@
|
|||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
CONFIG_FHANDLE=y
|
||||
CONFIG_IRQ_DOMAIN_DEBUG=y
|
||||
CONFIG_NO_HZ_IDLE=y
|
||||
CONFIG_HIGH_RES_TIMERS=y
|
||||
CONFIG_IRQ_TIME_ACCOUNTING=y
|
||||
CONFIG_BSD_PROCESS_ACCT=y
|
||||
CONFIG_CGROUP_DEBUG=y
|
||||
CONFIG_CGROUP_FREEZER=y
|
||||
CONFIG_CGROUP_DEVICE=y
|
||||
CONFIG_CPUSETS=y
|
||||
CONFIG_CGROUP_CPUACCT=y
|
||||
CONFIG_RESOURCE_COUNTERS=y
|
||||
CONFIG_MEMCG=y
|
||||
CONFIG_NAMESPACES=y
|
||||
CONFIG_SCHED_AUTOGROUP=y
|
||||
CONFIG_RELAY=y
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
CONFIG_EXPERT=y
|
||||
CONFIG_SYSCTL_SYSCALL=y
|
||||
CONFIG_KALLSYMS_ALL=y
|
||||
CONFIG_PROFILING=y
|
||||
CONFIG_OPROFILE=y
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_MODULE_UNLOAD=y
|
||||
# CONFIG_IOSCHED_DEADLINE is not set
|
||||
# CONFIG_IOSCHED_CFQ is not set
|
||||
CONFIG_XTENSA_VARIANT_CUSTOM=y
|
||||
CONFIG_XTENSA_VARIANT_CUSTOM_NAME="test_mmuhifi_c3"
|
||||
CONFIG_XTENSA_UNALIGNED_USER=y
|
||||
CONFIG_PREEMPT=y
|
||||
CONFIG_HAVE_SMP=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_HOTPLUG_CPU=y
|
||||
# CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX is not set
|
||||
# CONFIG_PCI is not set
|
||||
CONFIG_XTENSA_PLATFORM_XTFPGA=y
|
||||
CONFIG_CMDLINE_BOOL=y
|
||||
CONFIG_CMDLINE="earlycon=uart8250,mmio32,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug"
|
||||
CONFIG_USE_OF=y
|
||||
CONFIG_BUILTIN_DTB="lx200mx"
|
||||
# CONFIG_COMPACTION is not set
|
||||
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_INET=y
|
||||
CONFIG_IP_MULTICAST=y
|
||||
CONFIG_IP_PNP=y
|
||||
CONFIG_IP_PNP_DHCP=y
|
||||
CONFIG_IP_PNP_BOOTP=y
|
||||
CONFIG_IP_PNP_RARP=y
|
||||
# CONFIG_IPV6 is not set
|
||||
CONFIG_NETFILTER=y
|
||||
# CONFIG_WIRELESS is not set
|
||||
CONFIG_DEVTMPFS=y
|
||||
CONFIG_DEVTMPFS_MOUNT=y
|
||||
# CONFIG_STANDALONE is not set
|
||||
CONFIG_MTD=y
|
||||
CONFIG_MTD_CFI=y
|
||||
CONFIG_MTD_JEDECPROBE=y
|
||||
CONFIG_MTD_CFI_INTELEXT=y
|
||||
CONFIG_MTD_CFI_AMDSTD=y
|
||||
CONFIG_MTD_CFI_STAA=y
|
||||
CONFIG_MTD_PHYSMAP_OF=y
|
||||
CONFIG_MTD_UBI=y
|
||||
CONFIG_BLK_DEV_LOOP=y
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
CONFIG_SCSI=y
|
||||
CONFIG_BLK_DEV_SD=y
|
||||
CONFIG_NETDEVICES=y
|
||||
# CONFIG_NET_VENDOR_ARC is not set
|
||||
# CONFIG_NET_VENDOR_BROADCOM is not set
|
||||
# CONFIG_NET_VENDOR_INTEL is not set
|
||||
# CONFIG_NET_VENDOR_MARVELL is not set
|
||||
# CONFIG_NET_VENDOR_MICREL is not set
|
||||
# CONFIG_NET_VENDOR_NATSEMI is not set
|
||||
# CONFIG_NET_VENDOR_SAMSUNG is not set
|
||||
# CONFIG_NET_VENDOR_SEEQ is not set
|
||||
# CONFIG_NET_VENDOR_SMSC is not set
|
||||
# CONFIG_NET_VENDOR_STMICRO is not set
|
||||
# CONFIG_NET_VENDOR_VIA is not set
|
||||
# CONFIG_NET_VENDOR_WIZNET is not set
|
||||
CONFIG_MARVELL_PHY=y
|
||||
# CONFIG_WLAN is not set
|
||||
# CONFIG_INPUT_MOUSEDEV is not set
|
||||
# CONFIG_INPUT_KEYBOARD is not set
|
||||
# CONFIG_INPUT_MOUSE is not set
|
||||
# CONFIG_SERIO is not set
|
||||
CONFIG_SERIAL_8250=y
|
||||
# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set
|
||||
CONFIG_SERIAL_8250_CONSOLE=y
|
||||
CONFIG_SERIAL_OF_PLATFORM=y
|
||||
CONFIG_HW_RANDOM=y
|
||||
# CONFIG_HWMON is not set
|
||||
CONFIG_WATCHDOG=y
|
||||
CONFIG_WATCHDOG_NOWAYOUT=y
|
||||
CONFIG_SOFT_WATCHDOG=y
|
||||
# CONFIG_VGA_CONSOLE is not set
|
||||
# CONFIG_USB_SUPPORT is not set
|
||||
# CONFIG_IOMMU_SUPPORT is not set
|
||||
CONFIG_EXT3_FS=y
|
||||
CONFIG_EXT4_FS=y
|
||||
CONFIG_FANOTIFY=y
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_PROC_KCORE=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_TMPFS_POSIX_ACL=y
|
||||
CONFIG_UBIFS_FS=y
|
||||
CONFIG_NFS_FS=y
|
||||
CONFIG_NFS_V4=y
|
||||
CONFIG_NFS_SWAP=y
|
||||
CONFIG_ROOT_NFS=y
|
||||
CONFIG_SUNRPC_DEBUG=y
|
||||
CONFIG_NLS_CODEPAGE_437=y
|
||||
CONFIG_NLS_ISO8859_1=y
|
||||
CONFIG_PRINTK_TIME=y
|
||||
CONFIG_DYNAMIC_DEBUG=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
CONFIG_DEBUG_VM=y
|
||||
CONFIG_LOCKUP_DETECTOR=y
|
||||
CONFIG_SCHEDSTATS=y
|
||||
CONFIG_TIMER_STATS=y
|
||||
CONFIG_DEBUG_RT_MUTEXES=y
|
||||
CONFIG_DEBUG_SPINLOCK=y
|
||||
CONFIG_DEBUG_MUTEXES=y
|
||||
CONFIG_DEBUG_ATOMIC_SLEEP=y
|
||||
CONFIG_STACKTRACE=y
|
||||
CONFIG_RCU_TRACE=y
|
||||
# CONFIG_FTRACE is not set
|
||||
CONFIG_LD_NO_RELAX=y
|
||||
# CONFIG_S32C1I_SELFTEST is not set
|
||||
CONFIG_CRYPTO_ANSI_CPRNG=y
|
33
arch/xtensa/include/asm/Kbuild
Normal file
33
arch/xtensa/include/asm/Kbuild
Normal file
|
@ -0,0 +1,33 @@
|
|||
generic-y += bitsperlong.h
|
||||
generic-y += bug.h
|
||||
generic-y += clkdev.h
|
||||
generic-y += cputime.h
|
||||
generic-y += device.h
|
||||
generic-y += div64.h
|
||||
generic-y += emergency-restart.h
|
||||
generic-y += errno.h
|
||||
generic-y += exec.h
|
||||
generic-y += fcntl.h
|
||||
generic-y += hardirq.h
|
||||
generic-y += hash.h
|
||||
generic-y += ioctl.h
|
||||
generic-y += irq_regs.h
|
||||
generic-y += irq_work.h
|
||||
generic-y += kdebug.h
|
||||
generic-y += kmap_types.h
|
||||
generic-y += kvm_para.h
|
||||
generic-y += linkage.h
|
||||
generic-y += local.h
|
||||
generic-y += local64.h
|
||||
generic-y += mcs_spinlock.h
|
||||
generic-y += percpu.h
|
||||
generic-y += preempt.h
|
||||
generic-y += resource.h
|
||||
generic-y += scatterlist.h
|
||||
generic-y += sections.h
|
||||
generic-y += siginfo.h
|
||||
generic-y += statfs.h
|
||||
generic-y += termios.h
|
||||
generic-y += topology.h
|
||||
generic-y += trace_clock.h
|
||||
generic-y += xor.h
|
1
arch/xtensa/include/asm/asm-offsets.h
Normal file
1
arch/xtensa/include/asm/asm-offsets.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <generated/asm-offsets.h>
|
153
arch/xtensa/include/asm/asmmacro.h
Normal file
153
arch/xtensa/include/asm/asmmacro.h
Normal file
|
@ -0,0 +1,153 @@
|
|||
/*
|
||||
* include/asm-xtensa/asmmacro.h
|
||||
*
|
||||
* 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) 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_ASMMACRO_H
|
||||
#define _XTENSA_ASMMACRO_H
|
||||
|
||||
#include <variant/core.h>
|
||||
|
||||
/*
|
||||
* Some little helpers for loops. Use zero-overhead-loops
|
||||
* where applicable and if supported by the processor.
|
||||
*
|
||||
* __loopi ar, at, size, inc
|
||||
* ar register initialized with the start address
|
||||
* at scratch register used by macro
|
||||
* size size immediate value
|
||||
* inc increment
|
||||
*
|
||||
* __loops ar, as, at, inc_log2[, mask_log2][, cond][, ncond]
|
||||
* ar register initialized with the start address
|
||||
* as register initialized with the size
|
||||
* at scratch register use by macro
|
||||
* inc_log2 increment [in log2]
|
||||
* mask_log2 mask [in log2]
|
||||
* cond true condition (used in loop'cond')
|
||||
* ncond false condition (used in b'ncond')
|
||||
*
|
||||
* __loop as
|
||||
* restart loop. 'as' register must not have been modified!
|
||||
*
|
||||
* __endla ar, at, incr
|
||||
* ar start address (modified)
|
||||
* as scratch register used by macro
|
||||
* inc increment
|
||||
*/
|
||||
|
||||
/*
|
||||
* loop for given size as immediate
|
||||
*/
|
||||
|
||||
.macro __loopi ar, at, size, incr
|
||||
|
||||
#if XCHAL_HAVE_LOOPS
|
||||
movi \at, ((\size + \incr - 1) / (\incr))
|
||||
loop \at, 99f
|
||||
#else
|
||||
addi \at, \ar, \size
|
||||
98:
|
||||
#endif
|
||||
|
||||
.endm
|
||||
|
||||
/*
|
||||
* loop for given size in register
|
||||
*/
|
||||
|
||||
.macro __loops ar, as, at, incr_log2, mask_log2, cond, ncond
|
||||
|
||||
#if XCHAL_HAVE_LOOPS
|
||||
.ifgt \incr_log2 - 1
|
||||
addi \at, \as, (1 << \incr_log2) - 1
|
||||
.ifnc \mask_log2,
|
||||
extui \at, \at, \incr_log2, \mask_log2
|
||||
.else
|
||||
srli \at, \at, \incr_log2
|
||||
.endif
|
||||
.endif
|
||||
loop\cond \at, 99f
|
||||
#else
|
||||
.ifnc \mask_log2,
|
||||
extui \at, \as, \incr_log2, \mask_log2
|
||||
.else
|
||||
.ifnc \ncond,
|
||||
srli \at, \as, \incr_log2
|
||||
.endif
|
||||
.endif
|
||||
.ifnc \ncond,
|
||||
b\ncond \at, 99f
|
||||
|
||||
.endif
|
||||
.ifnc \mask_log2,
|
||||
slli \at, \at, \incr_log2
|
||||
add \at, \ar, \at
|
||||
.else
|
||||
add \at, \ar, \as
|
||||
.endif
|
||||
#endif
|
||||
98:
|
||||
|
||||
.endm
|
||||
|
||||
/*
|
||||
* loop from ar to ax
|
||||
*/
|
||||
|
||||
.macro __loopt ar, as, at, incr_log2
|
||||
|
||||
#if XCHAL_HAVE_LOOPS
|
||||
sub \at, \as, \ar
|
||||
.ifgt \incr_log2 - 1
|
||||
addi \at, \at, (1 << \incr_log2) - 1
|
||||
srli \at, \at, \incr_log2
|
||||
.endif
|
||||
loop \at, 99f
|
||||
#else
|
||||
98:
|
||||
#endif
|
||||
|
||||
.endm
|
||||
|
||||
/*
|
||||
* restart loop. registers must be unchanged
|
||||
*/
|
||||
|
||||
.macro __loop as
|
||||
|
||||
#if XCHAL_HAVE_LOOPS
|
||||
loop \as, 99f
|
||||
#else
|
||||
98:
|
||||
#endif
|
||||
|
||||
.endm
|
||||
|
||||
/*
|
||||
* end of loop with no increment of the address.
|
||||
*/
|
||||
|
||||
.macro __endl ar, as
|
||||
#if !XCHAL_HAVE_LOOPS
|
||||
bltu \ar, \as, 98b
|
||||
#endif
|
||||
99:
|
||||
.endm
|
||||
|
||||
/*
|
||||
* end of loop with increment of the address.
|
||||
*/
|
||||
|
||||
.macro __endla ar, as, incr
|
||||
addi \ar, \ar, \incr
|
||||
__endl \ar \as
|
||||
.endm
|
||||
|
||||
|
||||
#endif /* _XTENSA_ASMMACRO_H */
|
324
arch/xtensa/include/asm/atomic.h
Normal file
324
arch/xtensa/include/asm/atomic.h
Normal file
|
@ -0,0 +1,324 @@
|
|||
/*
|
||||
* include/asm-xtensa/atomic.h
|
||||
*
|
||||
* Atomic operations that C can't guarantee us. Useful for resource counting..
|
||||
*
|
||||
* 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) 2001 - 2008 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_ATOMIC_H
|
||||
#define _XTENSA_ATOMIC_H
|
||||
|
||||
#include <linux/stringify.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <asm/processor.h>
|
||||
#include <asm/cmpxchg.h>
|
||||
#include <asm/barrier.h>
|
||||
|
||||
#define ATOMIC_INIT(i) { (i) }
|
||||
|
||||
/*
|
||||
* This Xtensa implementation assumes that the right mechanism
|
||||
* for exclusion is for locking interrupts to level EXCM_LEVEL.
|
||||
*
|
||||
* Locking interrupts looks like this:
|
||||
*
|
||||
* rsil a15, LOCKLEVEL
|
||||
* <code>
|
||||
* wsr a15, PS
|
||||
* rsync
|
||||
*
|
||||
* Note that a15 is used here because the register allocation
|
||||
* done by the compiler is not guaranteed and a window overflow
|
||||
* may not occur between the rsil and wsr instructions. By using
|
||||
* a15 in the rsil, the machine is guaranteed to be in a state
|
||||
* where no register reference will cause an overflow.
|
||||
*/
|
||||
|
||||
/**
|
||||
* atomic_read - read atomic variable
|
||||
* @v: pointer of type atomic_t
|
||||
*
|
||||
* Atomically reads the value of @v.
|
||||
*/
|
||||
#define atomic_read(v) ACCESS_ONCE((v)->counter)
|
||||
|
||||
/**
|
||||
* atomic_set - set atomic variable
|
||||
* @v: pointer of type atomic_t
|
||||
* @i: required value
|
||||
*
|
||||
* Atomically sets the value of @v to @i.
|
||||
*/
|
||||
#define atomic_set(v,i) ((v)->counter = (i))
|
||||
|
||||
#if XCHAL_HAVE_S32C1I
|
||||
#define ATOMIC_OP(op) \
|
||||
static inline void atomic_##op(int i, atomic_t * v) \
|
||||
{ \
|
||||
unsigned long tmp; \
|
||||
int result; \
|
||||
\
|
||||
__asm__ __volatile__( \
|
||||
"1: l32i %1, %3, 0\n" \
|
||||
" wsr %1, scompare1\n" \
|
||||
" " #op " %0, %1, %2\n" \
|
||||
" s32c1i %0, %3, 0\n" \
|
||||
" bne %0, %1, 1b\n" \
|
||||
: "=&a" (result), "=&a" (tmp) \
|
||||
: "a" (i), "a" (v) \
|
||||
: "memory" \
|
||||
); \
|
||||
} \
|
||||
|
||||
#define ATOMIC_OP_RETURN(op) \
|
||||
static inline int atomic_##op##_return(int i, atomic_t * v) \
|
||||
{ \
|
||||
unsigned long tmp; \
|
||||
int result; \
|
||||
\
|
||||
__asm__ __volatile__( \
|
||||
"1: l32i %1, %3, 0\n" \
|
||||
" wsr %1, scompare1\n" \
|
||||
" " #op " %0, %1, %2\n" \
|
||||
" s32c1i %0, %3, 0\n" \
|
||||
" bne %0, %1, 1b\n" \
|
||||
" " #op " %0, %0, %2\n" \
|
||||
: "=&a" (result), "=&a" (tmp) \
|
||||
: "a" (i), "a" (v) \
|
||||
: "memory" \
|
||||
); \
|
||||
\
|
||||
return result; \
|
||||
}
|
||||
|
||||
#else /* XCHAL_HAVE_S32C1I */
|
||||
|
||||
#define ATOMIC_OP(op) \
|
||||
static inline void atomic_##op(int i, atomic_t * v) \
|
||||
{ \
|
||||
unsigned int vval; \
|
||||
\
|
||||
__asm__ __volatile__( \
|
||||
" rsil a15, "__stringify(LOCKLEVEL)"\n"\
|
||||
" l32i %0, %2, 0\n" \
|
||||
" " #op " %0, %0, %1\n" \
|
||||
" s32i %0, %2, 0\n" \
|
||||
" wsr a15, ps\n" \
|
||||
" rsync\n" \
|
||||
: "=&a" (vval) \
|
||||
: "a" (i), "a" (v) \
|
||||
: "a15", "memory" \
|
||||
); \
|
||||
} \
|
||||
|
||||
#define ATOMIC_OP_RETURN(op) \
|
||||
static inline int atomic_##op##_return(int i, atomic_t * v) \
|
||||
{ \
|
||||
unsigned int vval; \
|
||||
\
|
||||
__asm__ __volatile__( \
|
||||
" rsil a15,"__stringify(LOCKLEVEL)"\n" \
|
||||
" l32i %0, %2, 0\n" \
|
||||
" " #op " %0, %0, %1\n" \
|
||||
" s32i %0, %2, 0\n" \
|
||||
" wsr a15, ps\n" \
|
||||
" rsync\n" \
|
||||
: "=&a" (vval) \
|
||||
: "a" (i), "a" (v) \
|
||||
: "a15", "memory" \
|
||||
); \
|
||||
\
|
||||
return vval; \
|
||||
}
|
||||
|
||||
#endif /* XCHAL_HAVE_S32C1I */
|
||||
|
||||
#define ATOMIC_OPS(op) ATOMIC_OP(op) ATOMIC_OP_RETURN(op)
|
||||
|
||||
ATOMIC_OPS(add)
|
||||
ATOMIC_OPS(sub)
|
||||
|
||||
#undef ATOMIC_OPS
|
||||
#undef ATOMIC_OP_RETURN
|
||||
#undef ATOMIC_OP
|
||||
|
||||
/**
|
||||
* atomic_sub_and_test - subtract value from variable and test result
|
||||
* @i: integer value to subtract
|
||||
* @v: pointer of type atomic_t
|
||||
*
|
||||
* Atomically subtracts @i from @v and returns
|
||||
* true if the result is zero, or false for all
|
||||
* other cases.
|
||||
*/
|
||||
#define atomic_sub_and_test(i,v) (atomic_sub_return((i),(v)) == 0)
|
||||
|
||||
/**
|
||||
* atomic_inc - increment atomic variable
|
||||
* @v: pointer of type atomic_t
|
||||
*
|
||||
* Atomically increments @v by 1.
|
||||
*/
|
||||
#define atomic_inc(v) atomic_add(1,(v))
|
||||
|
||||
/**
|
||||
* atomic_inc - increment atomic variable
|
||||
* @v: pointer of type atomic_t
|
||||
*
|
||||
* Atomically increments @v by 1.
|
||||
*/
|
||||
#define atomic_inc_return(v) atomic_add_return(1,(v))
|
||||
|
||||
/**
|
||||
* atomic_dec - decrement atomic variable
|
||||
* @v: pointer of type atomic_t
|
||||
*
|
||||
* Atomically decrements @v by 1.
|
||||
*/
|
||||
#define atomic_dec(v) atomic_sub(1,(v))
|
||||
|
||||
/**
|
||||
* atomic_dec_return - decrement atomic variable
|
||||
* @v: pointer of type atomic_t
|
||||
*
|
||||
* Atomically decrements @v by 1.
|
||||
*/
|
||||
#define atomic_dec_return(v) atomic_sub_return(1,(v))
|
||||
|
||||
/**
|
||||
* atomic_dec_and_test - decrement and test
|
||||
* @v: pointer of type atomic_t
|
||||
*
|
||||
* Atomically decrements @v by 1 and
|
||||
* returns true if the result is 0, or false for all other
|
||||
* cases.
|
||||
*/
|
||||
#define atomic_dec_and_test(v) (atomic_sub_return(1,(v)) == 0)
|
||||
|
||||
/**
|
||||
* atomic_inc_and_test - increment and test
|
||||
* @v: pointer of type atomic_t
|
||||
*
|
||||
* Atomically increments @v by 1
|
||||
* and returns true if the result is zero, or false for all
|
||||
* other cases.
|
||||
*/
|
||||
#define atomic_inc_and_test(v) (atomic_add_return(1,(v)) == 0)
|
||||
|
||||
/**
|
||||
* atomic_add_negative - add and test if negative
|
||||
* @v: pointer of type atomic_t
|
||||
* @i: integer value to add
|
||||
*
|
||||
* Atomically adds @i to @v and returns true
|
||||
* if the result is negative, or false when
|
||||
* result is greater than or equal to zero.
|
||||
*/
|
||||
#define atomic_add_negative(i,v) (atomic_add_return((i),(v)) < 0)
|
||||
|
||||
#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n)))
|
||||
#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
|
||||
|
||||
/**
|
||||
* __atomic_add_unless - add unless the number is a given value
|
||||
* @v: pointer of type atomic_t
|
||||
* @a: the amount to add to v...
|
||||
* @u: ...unless v is equal to u.
|
||||
*
|
||||
* Atomically adds @a to @v, so long as it was not @u.
|
||||
* Returns the old value of @v.
|
||||
*/
|
||||
static __inline__ int __atomic_add_unless(atomic_t *v, int a, int u)
|
||||
{
|
||||
int c, old;
|
||||
c = atomic_read(v);
|
||||
for (;;) {
|
||||
if (unlikely(c == (u)))
|
||||
break;
|
||||
old = atomic_cmpxchg((v), c, c + (a));
|
||||
if (likely(old == c))
|
||||
break;
|
||||
c = old;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
|
||||
{
|
||||
#if XCHAL_HAVE_S32C1I
|
||||
unsigned long tmp;
|
||||
int result;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"1: l32i %1, %3, 0\n"
|
||||
" wsr %1, scompare1\n"
|
||||
" and %0, %1, %2\n"
|
||||
" s32c1i %0, %3, 0\n"
|
||||
" bne %0, %1, 1b\n"
|
||||
: "=&a" (result), "=&a" (tmp)
|
||||
: "a" (~mask), "a" (v)
|
||||
: "memory"
|
||||
);
|
||||
#else
|
||||
unsigned int all_f = -1;
|
||||
unsigned int vval;
|
||||
|
||||
__asm__ __volatile__(
|
||||
" rsil a15,"__stringify(LOCKLEVEL)"\n"
|
||||
" l32i %0, %2, 0\n"
|
||||
" xor %1, %4, %3\n"
|
||||
" and %0, %0, %4\n"
|
||||
" s32i %0, %2, 0\n"
|
||||
" wsr a15, ps\n"
|
||||
" rsync\n"
|
||||
: "=&a" (vval), "=a" (mask)
|
||||
: "a" (v), "a" (all_f), "1" (mask)
|
||||
: "a15", "memory"
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
|
||||
{
|
||||
#if XCHAL_HAVE_S32C1I
|
||||
unsigned long tmp;
|
||||
int result;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"1: l32i %1, %3, 0\n"
|
||||
" wsr %1, scompare1\n"
|
||||
" or %0, %1, %2\n"
|
||||
" s32c1i %0, %3, 0\n"
|
||||
" bne %0, %1, 1b\n"
|
||||
: "=&a" (result), "=&a" (tmp)
|
||||
: "a" (mask), "a" (v)
|
||||
: "memory"
|
||||
);
|
||||
#else
|
||||
unsigned int vval;
|
||||
|
||||
__asm__ __volatile__(
|
||||
" rsil a15,"__stringify(LOCKLEVEL)"\n"
|
||||
" l32i %0, %2, 0\n"
|
||||
" or %0, %0, %1\n"
|
||||
" s32i %0, %2, 0\n"
|
||||
" wsr a15, ps\n"
|
||||
" rsync\n"
|
||||
: "=&a" (vval)
|
||||
: "a" (mask), "a" (v)
|
||||
: "a15", "memory"
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _XTENSA_ATOMIC_H */
|
21
arch/xtensa/include/asm/barrier.h
Normal file
21
arch/xtensa/include/asm/barrier.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* 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) 2001 - 2012 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_SYSTEM_H
|
||||
#define _XTENSA_SYSTEM_H
|
||||
|
||||
#define mb() ({ __asm__ __volatile__("memw" : : : "memory"); })
|
||||
#define rmb() barrier()
|
||||
#define wmb() mb()
|
||||
|
||||
#define smp_mb__before_atomic() barrier()
|
||||
#define smp_mb__after_atomic() barrier()
|
||||
|
||||
#include <asm-generic/barrier.h>
|
||||
|
||||
#endif /* _XTENSA_SYSTEM_H */
|
237
arch/xtensa/include/asm/bitops.h
Normal file
237
arch/xtensa/include/asm/bitops.h
Normal file
|
@ -0,0 +1,237 @@
|
|||
/*
|
||||
* include/asm-xtensa/bitops.h
|
||||
*
|
||||
* Atomic operations that C can't guarantee us.Useful for resource counting etc.
|
||||
*
|
||||
* 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) 2001 - 2007 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_BITOPS_H
|
||||
#define _XTENSA_BITOPS_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#ifndef _LINUX_BITOPS_H
|
||||
#error only <linux/bitops.h> can be included directly
|
||||
#endif
|
||||
|
||||
#include <asm/processor.h>
|
||||
#include <asm/byteorder.h>
|
||||
#include <asm/barrier.h>
|
||||
|
||||
#include <asm-generic/bitops/non-atomic.h>
|
||||
|
||||
#if XCHAL_HAVE_NSA
|
||||
|
||||
static inline unsigned long __cntlz (unsigned long x)
|
||||
{
|
||||
int lz;
|
||||
asm ("nsau %0, %1" : "=r" (lz) : "r" (x));
|
||||
return lz;
|
||||
}
|
||||
|
||||
/*
|
||||
* ffz: Find first zero in word. Undefined if no zero exists.
|
||||
* bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
|
||||
*/
|
||||
|
||||
static inline int ffz(unsigned long x)
|
||||
{
|
||||
return 31 - __cntlz(~x & -~x);
|
||||
}
|
||||
|
||||
/*
|
||||
* __ffs: Find first bit set in word. Return 0 for bit 0
|
||||
*/
|
||||
|
||||
static inline int __ffs(unsigned long x)
|
||||
{
|
||||
return 31 - __cntlz(x & -x);
|
||||
}
|
||||
|
||||
/*
|
||||
* ffs: Find first bit set in word. This is defined the same way as
|
||||
* the libc and compiler builtin ffs routines, therefore
|
||||
* differs in spirit from the above ffz (man ffs).
|
||||
*/
|
||||
|
||||
static inline int ffs(unsigned long x)
|
||||
{
|
||||
return 32 - __cntlz(x & -x);
|
||||
}
|
||||
|
||||
/*
|
||||
* fls: Find last (most-significant) bit set in word.
|
||||
* Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
|
||||
*/
|
||||
|
||||
static inline int fls (unsigned int x)
|
||||
{
|
||||
return 32 - __cntlz(x);
|
||||
}
|
||||
|
||||
/**
|
||||
* __fls - find last (most-significant) set bit in a long word
|
||||
* @word: the word to search
|
||||
*
|
||||
* Undefined if no set bit exists, so code should check against 0 first.
|
||||
*/
|
||||
static inline unsigned long __fls(unsigned long word)
|
||||
{
|
||||
return 31 - __cntlz(word);
|
||||
}
|
||||
#else
|
||||
|
||||
/* Use the generic implementation if we don't have the nsa/nsau instructions. */
|
||||
|
||||
# include <asm-generic/bitops/ffs.h>
|
||||
# include <asm-generic/bitops/__ffs.h>
|
||||
# include <asm-generic/bitops/ffz.h>
|
||||
# include <asm-generic/bitops/fls.h>
|
||||
# include <asm-generic/bitops/__fls.h>
|
||||
|
||||
#endif
|
||||
|
||||
#include <asm-generic/bitops/fls64.h>
|
||||
|
||||
#if XCHAL_HAVE_S32C1I
|
||||
|
||||
static inline void set_bit(unsigned int bit, volatile unsigned long *p)
|
||||
{
|
||||
unsigned long tmp, value;
|
||||
unsigned long mask = 1UL << (bit & 31);
|
||||
|
||||
p += bit >> 5;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"1: l32i %1, %3, 0\n"
|
||||
" wsr %1, scompare1\n"
|
||||
" or %0, %1, %2\n"
|
||||
" s32c1i %0, %3, 0\n"
|
||||
" bne %0, %1, 1b\n"
|
||||
: "=&a" (tmp), "=&a" (value)
|
||||
: "a" (mask), "a" (p)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
static inline void clear_bit(unsigned int bit, volatile unsigned long *p)
|
||||
{
|
||||
unsigned long tmp, value;
|
||||
unsigned long mask = 1UL << (bit & 31);
|
||||
|
||||
p += bit >> 5;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"1: l32i %1, %3, 0\n"
|
||||
" wsr %1, scompare1\n"
|
||||
" and %0, %1, %2\n"
|
||||
" s32c1i %0, %3, 0\n"
|
||||
" bne %0, %1, 1b\n"
|
||||
: "=&a" (tmp), "=&a" (value)
|
||||
: "a" (~mask), "a" (p)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
static inline void change_bit(unsigned int bit, volatile unsigned long *p)
|
||||
{
|
||||
unsigned long tmp, value;
|
||||
unsigned long mask = 1UL << (bit & 31);
|
||||
|
||||
p += bit >> 5;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"1: l32i %1, %3, 0\n"
|
||||
" wsr %1, scompare1\n"
|
||||
" xor %0, %1, %2\n"
|
||||
" s32c1i %0, %3, 0\n"
|
||||
" bne %0, %1, 1b\n"
|
||||
: "=&a" (tmp), "=&a" (value)
|
||||
: "a" (mask), "a" (p)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
static inline int
|
||||
test_and_set_bit(unsigned int bit, volatile unsigned long *p)
|
||||
{
|
||||
unsigned long tmp, value;
|
||||
unsigned long mask = 1UL << (bit & 31);
|
||||
|
||||
p += bit >> 5;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"1: l32i %1, %3, 0\n"
|
||||
" wsr %1, scompare1\n"
|
||||
" or %0, %1, %2\n"
|
||||
" s32c1i %0, %3, 0\n"
|
||||
" bne %0, %1, 1b\n"
|
||||
: "=&a" (tmp), "=&a" (value)
|
||||
: "a" (mask), "a" (p)
|
||||
: "memory");
|
||||
|
||||
return tmp & mask;
|
||||
}
|
||||
|
||||
static inline int
|
||||
test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
|
||||
{
|
||||
unsigned long tmp, value;
|
||||
unsigned long mask = 1UL << (bit & 31);
|
||||
|
||||
p += bit >> 5;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"1: l32i %1, %3, 0\n"
|
||||
" wsr %1, scompare1\n"
|
||||
" and %0, %1, %2\n"
|
||||
" s32c1i %0, %3, 0\n"
|
||||
" bne %0, %1, 1b\n"
|
||||
: "=&a" (tmp), "=&a" (value)
|
||||
: "a" (~mask), "a" (p)
|
||||
: "memory");
|
||||
|
||||
return tmp & mask;
|
||||
}
|
||||
|
||||
static inline int
|
||||
test_and_change_bit(unsigned int bit, volatile unsigned long *p)
|
||||
{
|
||||
unsigned long tmp, value;
|
||||
unsigned long mask = 1UL << (bit & 31);
|
||||
|
||||
p += bit >> 5;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"1: l32i %1, %3, 0\n"
|
||||
" wsr %1, scompare1\n"
|
||||
" xor %0, %1, %2\n"
|
||||
" s32c1i %0, %3, 0\n"
|
||||
" bne %0, %1, 1b\n"
|
||||
: "=&a" (tmp), "=&a" (value)
|
||||
: "a" (mask), "a" (p)
|
||||
: "memory");
|
||||
|
||||
return tmp & mask;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <asm-generic/bitops/atomic.h>
|
||||
|
||||
#endif /* XCHAL_HAVE_S32C1I */
|
||||
|
||||
#include <asm-generic/bitops/find.h>
|
||||
#include <asm-generic/bitops/le.h>
|
||||
|
||||
#include <asm-generic/bitops/ext2-atomic-setbit.h>
|
||||
|
||||
#include <asm-generic/bitops/hweight.h>
|
||||
#include <asm-generic/bitops/lock.h>
|
||||
#include <asm-generic/bitops/sched.h>
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _XTENSA_BITOPS_H */
|
50
arch/xtensa/include/asm/bootparam.h
Normal file
50
arch/xtensa/include/asm/bootparam.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* include/asm-xtensa/bootparam.h
|
||||
*
|
||||
* Definition of the Linux/Xtensa boot parameter structure
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*
|
||||
* (Concept borrowed from the 68K port)
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_BOOTPARAM_H
|
||||
#define _XTENSA_BOOTPARAM_H
|
||||
|
||||
#define BP_VERSION 0x0001
|
||||
|
||||
#define BP_TAG_COMMAND_LINE 0x1001 /* command line (0-terminated string)*/
|
||||
#define BP_TAG_INITRD 0x1002 /* ramdisk addr and size (bp_meminfo) */
|
||||
#define BP_TAG_MEMORY 0x1003 /* memory addr and size (bp_meminfo) */
|
||||
#define BP_TAG_SERIAL_BAUDRATE 0x1004 /* baud rate of current console. */
|
||||
#define BP_TAG_SERIAL_PORT 0x1005 /* serial device of current console */
|
||||
#define BP_TAG_FDT 0x1006 /* flat device tree addr */
|
||||
|
||||
#define BP_TAG_FIRST 0x7B0B /* first tag with a version number */
|
||||
#define BP_TAG_LAST 0x7E0B /* last tag */
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/* All records are aligned to 4 bytes */
|
||||
|
||||
typedef struct bp_tag {
|
||||
unsigned short id; /* tag id */
|
||||
unsigned short size; /* size of this record excluding the structure*/
|
||||
unsigned long data[0]; /* data */
|
||||
} bp_tag_t;
|
||||
|
||||
struct bp_meminfo {
|
||||
unsigned long type;
|
||||
unsigned long start;
|
||||
unsigned long end;
|
||||
};
|
||||
|
||||
#define MEMORY_TYPE_CONVENTIONAL 0x1000
|
||||
#define MEMORY_TYPE_NONE 0x2000
|
||||
|
||||
#endif
|
||||
#endif
|
18
arch/xtensa/include/asm/bugs.h
Normal file
18
arch/xtensa/include/asm/bugs.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* include/asm-xtensa/bugs.h
|
||||
*
|
||||
* This is included by init/main.c to check for architecture-dependent bugs.
|
||||
*
|
||||
* Xtensa processors don't have any bugs. :)
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_BUGS_H
|
||||
#define _XTENSA_BUGS_H
|
||||
|
||||
static void check_bugs(void) { }
|
||||
|
||||
#endif /* _XTENSA_BUGS_H */
|
34
arch/xtensa/include/asm/cache.h
Normal file
34
arch/xtensa/include/asm/cache.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* include/asm-xtensa/cache.h
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* (C) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_CACHE_H
|
||||
#define _XTENSA_CACHE_H
|
||||
|
||||
#include <variant/core.h>
|
||||
|
||||
#define L1_CACHE_SHIFT XCHAL_DCACHE_LINEWIDTH
|
||||
#define L1_CACHE_BYTES XCHAL_DCACHE_LINESIZE
|
||||
#define SMP_CACHE_BYTES L1_CACHE_BYTES
|
||||
|
||||
#define DCACHE_WAY_SIZE (XCHAL_DCACHE_SIZE/XCHAL_DCACHE_WAYS)
|
||||
#define ICACHE_WAY_SIZE (XCHAL_ICACHE_SIZE/XCHAL_ICACHE_WAYS)
|
||||
#define DCACHE_WAY_SHIFT (XCHAL_DCACHE_SETWIDTH + XCHAL_DCACHE_LINEWIDTH)
|
||||
#define ICACHE_WAY_SHIFT (XCHAL_ICACHE_SETWIDTH + XCHAL_ICACHE_LINEWIDTH)
|
||||
|
||||
/* Maximum cache size per way. */
|
||||
#if DCACHE_WAY_SIZE >= ICACHE_WAY_SIZE
|
||||
# define CACHE_WAY_SIZE DCACHE_WAY_SIZE
|
||||
#else
|
||||
# define CACHE_WAY_SIZE ICACHE_WAY_SIZE
|
||||
#endif
|
||||
|
||||
#define ARCH_DMA_MINALIGN L1_CACHE_BYTES
|
||||
|
||||
#endif /* _XTENSA_CACHE_H */
|
176
arch/xtensa/include/asm/cacheasm.h
Normal file
176
arch/xtensa/include/asm/cacheasm.h
Normal file
|
@ -0,0 +1,176 @@
|
|||
/*
|
||||
* include/asm-xtensa/cacheasm.h
|
||||
*
|
||||
* 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 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#include <asm/cache.h>
|
||||
#include <asm/asmmacro.h>
|
||||
#include <linux/stringify.h>
|
||||
|
||||
/*
|
||||
* Define cache functions as macros here so that they can be used
|
||||
* by the kernel and boot loader. We should consider moving them to a
|
||||
* library that can be linked by both.
|
||||
*
|
||||
* Locking
|
||||
*
|
||||
* ___unlock_dcache_all
|
||||
* ___unlock_icache_all
|
||||
*
|
||||
* Flush and invaldating
|
||||
*
|
||||
* ___flush_invalidate_dcache_{all|range|page}
|
||||
* ___flush_dcache_{all|range|page}
|
||||
* ___invalidate_dcache_{all|range|page}
|
||||
* ___invalidate_icache_{all|range|page}
|
||||
*
|
||||
*/
|
||||
|
||||
.macro __loop_cache_all ar at insn size line_width
|
||||
|
||||
movi \ar, 0
|
||||
|
||||
__loopi \ar, \at, \size, (4 << (\line_width))
|
||||
\insn \ar, 0 << (\line_width)
|
||||
\insn \ar, 1 << (\line_width)
|
||||
\insn \ar, 2 << (\line_width)
|
||||
\insn \ar, 3 << (\line_width)
|
||||
__endla \ar, \at, 4 << (\line_width)
|
||||
|
||||
.endm
|
||||
|
||||
|
||||
.macro __loop_cache_range ar as at insn line_width
|
||||
|
||||
extui \at, \ar, 0, \line_width
|
||||
add \as, \as, \at
|
||||
|
||||
__loops \ar, \as, \at, \line_width
|
||||
\insn \ar, 0
|
||||
__endla \ar, \at, (1 << (\line_width))
|
||||
|
||||
.endm
|
||||
|
||||
|
||||
.macro __loop_cache_page ar at insn line_width
|
||||
|
||||
__loopi \ar, \at, PAGE_SIZE, 4 << (\line_width)
|
||||
\insn \ar, 0 << (\line_width)
|
||||
\insn \ar, 1 << (\line_width)
|
||||
\insn \ar, 2 << (\line_width)
|
||||
\insn \ar, 3 << (\line_width)
|
||||
__endla \ar, \at, 4 << (\line_width)
|
||||
|
||||
.endm
|
||||
|
||||
|
||||
#if XCHAL_DCACHE_LINE_LOCKABLE
|
||||
|
||||
.macro ___unlock_dcache_all ar at
|
||||
|
||||
__loop_cache_all \ar \at diu XCHAL_DCACHE_SIZE XCHAL_DCACHE_LINEWIDTH
|
||||
|
||||
.endm
|
||||
|
||||
#endif
|
||||
|
||||
#if XCHAL_ICACHE_LINE_LOCKABLE
|
||||
|
||||
.macro ___unlock_icache_all ar at
|
||||
|
||||
__loop_cache_all \ar \at iiu XCHAL_ICACHE_SIZE XCHAL_ICACHE_LINEWIDTH
|
||||
|
||||
.endm
|
||||
#endif
|
||||
|
||||
.macro ___flush_invalidate_dcache_all ar at
|
||||
|
||||
__loop_cache_all \ar \at diwbi XCHAL_DCACHE_SIZE XCHAL_DCACHE_LINEWIDTH
|
||||
|
||||
.endm
|
||||
|
||||
|
||||
.macro ___flush_dcache_all ar at
|
||||
|
||||
__loop_cache_all \ar \at diwb XCHAL_DCACHE_SIZE XCHAL_DCACHE_LINEWIDTH
|
||||
|
||||
.endm
|
||||
|
||||
|
||||
.macro ___invalidate_dcache_all ar at
|
||||
|
||||
__loop_cache_all \ar \at dii __stringify(DCACHE_WAY_SIZE) \
|
||||
XCHAL_DCACHE_LINEWIDTH
|
||||
|
||||
.endm
|
||||
|
||||
|
||||
.macro ___invalidate_icache_all ar at
|
||||
|
||||
__loop_cache_all \ar \at iii __stringify(ICACHE_WAY_SIZE) \
|
||||
XCHAL_ICACHE_LINEWIDTH
|
||||
|
||||
.endm
|
||||
|
||||
|
||||
|
||||
.macro ___flush_invalidate_dcache_range ar as at
|
||||
|
||||
__loop_cache_range \ar \as \at dhwbi XCHAL_DCACHE_LINEWIDTH
|
||||
|
||||
.endm
|
||||
|
||||
|
||||
.macro ___flush_dcache_range ar as at
|
||||
|
||||
__loop_cache_range \ar \as \at dhwb XCHAL_DCACHE_LINEWIDTH
|
||||
|
||||
.endm
|
||||
|
||||
|
||||
.macro ___invalidate_dcache_range ar as at
|
||||
|
||||
__loop_cache_range \ar \as \at dhi XCHAL_DCACHE_LINEWIDTH
|
||||
|
||||
.endm
|
||||
|
||||
|
||||
.macro ___invalidate_icache_range ar as at
|
||||
|
||||
__loop_cache_range \ar \as \at ihi XCHAL_ICACHE_LINEWIDTH
|
||||
|
||||
.endm
|
||||
|
||||
|
||||
|
||||
.macro ___flush_invalidate_dcache_page ar as
|
||||
|
||||
__loop_cache_page \ar \as dhwbi XCHAL_DCACHE_LINEWIDTH
|
||||
|
||||
.endm
|
||||
|
||||
|
||||
.macro ___flush_dcache_page ar as
|
||||
|
||||
__loop_cache_page \ar \as dhwb XCHAL_DCACHE_LINEWIDTH
|
||||
|
||||
.endm
|
||||
|
||||
|
||||
.macro ___invalidate_dcache_page ar as
|
||||
|
||||
__loop_cache_page \ar \as dhi XCHAL_DCACHE_LINEWIDTH
|
||||
|
||||
.endm
|
||||
|
||||
|
||||
.macro ___invalidate_icache_page ar as
|
||||
|
||||
__loop_cache_page \ar \as ihi XCHAL_ICACHE_LINEWIDTH
|
||||
|
||||
.endm
|
269
arch/xtensa/include/asm/cacheflush.h
Normal file
269
arch/xtensa/include/asm/cacheflush.h
Normal file
|
@ -0,0 +1,269 @@
|
|||
/*
|
||||
* 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.
|
||||
*
|
||||
* (C) 2001 - 2013 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_CACHEFLUSH_H
|
||||
#define _XTENSA_CACHEFLUSH_H
|
||||
|
||||
#include <linux/mm.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
/*
|
||||
* Lo-level routines for cache flushing.
|
||||
*
|
||||
* invalidate data or instruction cache:
|
||||
*
|
||||
* __invalidate_icache_all()
|
||||
* __invalidate_icache_page(adr)
|
||||
* __invalidate_dcache_page(adr)
|
||||
* __invalidate_icache_range(from,size)
|
||||
* __invalidate_dcache_range(from,size)
|
||||
*
|
||||
* flush data cache:
|
||||
*
|
||||
* __flush_dcache_page(adr)
|
||||
*
|
||||
* flush and invalidate data cache:
|
||||
*
|
||||
* __flush_invalidate_dcache_all()
|
||||
* __flush_invalidate_dcache_page(adr)
|
||||
* __flush_invalidate_dcache_range(from,size)
|
||||
*
|
||||
* specials for cache aliasing:
|
||||
*
|
||||
* __flush_invalidate_dcache_page_alias(vaddr,paddr)
|
||||
* __invalidate_dcache_page_alias(vaddr,paddr)
|
||||
* __invalidate_icache_page_alias(vaddr,paddr)
|
||||
*/
|
||||
|
||||
extern void __invalidate_dcache_all(void);
|
||||
extern void __invalidate_icache_all(void);
|
||||
extern void __invalidate_dcache_page(unsigned long);
|
||||
extern void __invalidate_icache_page(unsigned long);
|
||||
extern void __invalidate_icache_range(unsigned long, unsigned long);
|
||||
extern void __invalidate_dcache_range(unsigned long, unsigned long);
|
||||
|
||||
#if XCHAL_DCACHE_IS_WRITEBACK
|
||||
extern void __flush_invalidate_dcache_all(void);
|
||||
extern void __flush_dcache_page(unsigned long);
|
||||
extern void __flush_dcache_range(unsigned long, unsigned long);
|
||||
extern void __flush_invalidate_dcache_page(unsigned long);
|
||||
extern void __flush_invalidate_dcache_range(unsigned long, unsigned long);
|
||||
#else
|
||||
# define __flush_dcache_range(p,s) do { } while(0)
|
||||
# define __flush_dcache_page(p) do { } while(0)
|
||||
# define __flush_invalidate_dcache_page(p) __invalidate_dcache_page(p)
|
||||
# define __flush_invalidate_dcache_range(p,s) __invalidate_dcache_range(p,s)
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_MMU) && (DCACHE_WAY_SIZE > PAGE_SIZE)
|
||||
extern void __flush_invalidate_dcache_page_alias(unsigned long, unsigned long);
|
||||
extern void __invalidate_dcache_page_alias(unsigned long, unsigned long);
|
||||
#else
|
||||
static inline void __flush_invalidate_dcache_page_alias(unsigned long virt,
|
||||
unsigned long phys) { }
|
||||
#endif
|
||||
#if defined(CONFIG_MMU) && (ICACHE_WAY_SIZE > PAGE_SIZE)
|
||||
extern void __invalidate_icache_page_alias(unsigned long, unsigned long);
|
||||
#else
|
||||
static inline void __invalidate_icache_page_alias(unsigned long virt,
|
||||
unsigned long phys) { }
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We have physically tagged caches - nothing to do here -
|
||||
* unless we have cache aliasing.
|
||||
*
|
||||
* Pages can get remapped. Because this might change the 'color' of that page,
|
||||
* we have to flush the cache before the PTE is changed.
|
||||
* (see also Documentation/cachetlb.txt)
|
||||
*/
|
||||
|
||||
#if (DCACHE_WAY_SIZE > PAGE_SIZE) || defined(CONFIG_SMP)
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
void flush_cache_all(void);
|
||||
void flush_cache_range(struct vm_area_struct*, ulong, ulong);
|
||||
void flush_icache_range(unsigned long start, unsigned long end);
|
||||
void flush_cache_page(struct vm_area_struct*,
|
||||
unsigned long, unsigned long);
|
||||
#else
|
||||
#define flush_cache_all local_flush_cache_all
|
||||
#define flush_cache_range local_flush_cache_range
|
||||
#define flush_icache_range local_flush_icache_range
|
||||
#define flush_cache_page local_flush_cache_page
|
||||
#endif
|
||||
|
||||
#define local_flush_cache_all() \
|
||||
do { \
|
||||
__flush_invalidate_dcache_all(); \
|
||||
__invalidate_icache_all(); \
|
||||
} while (0)
|
||||
|
||||
#define flush_cache_mm(mm) flush_cache_all()
|
||||
#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
|
||||
|
||||
#define flush_cache_vmap(start,end) flush_cache_all()
|
||||
#define flush_cache_vunmap(start,end) flush_cache_all()
|
||||
|
||||
#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
|
||||
extern void flush_dcache_page(struct page*);
|
||||
|
||||
void local_flush_cache_range(struct vm_area_struct *vma,
|
||||
unsigned long start, unsigned long end);
|
||||
void local_flush_cache_page(struct vm_area_struct *vma,
|
||||
unsigned long address, unsigned long pfn);
|
||||
|
||||
#else
|
||||
|
||||
#define flush_cache_all() do { } while (0)
|
||||
#define flush_cache_mm(mm) do { } while (0)
|
||||
#define flush_cache_dup_mm(mm) do { } while (0)
|
||||
|
||||
#define flush_cache_vmap(start,end) do { } while (0)
|
||||
#define flush_cache_vunmap(start,end) do { } while (0)
|
||||
|
||||
#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
|
||||
#define flush_dcache_page(page) do { } while (0)
|
||||
|
||||
#define flush_icache_range local_flush_icache_range
|
||||
#define flush_cache_page(vma, addr, pfn) do { } while (0)
|
||||
#define flush_cache_range(vma, start, end) do { } while (0)
|
||||
|
||||
#endif
|
||||
|
||||
/* Ensure consistency between data and instruction cache. */
|
||||
#define local_flush_icache_range(start, end) \
|
||||
do { \
|
||||
__flush_dcache_range(start, (end) - (start)); \
|
||||
__invalidate_icache_range(start,(end) - (start)); \
|
||||
} while (0)
|
||||
|
||||
/* This is not required, see Documentation/cachetlb.txt */
|
||||
#define flush_icache_page(vma,page) do { } while (0)
|
||||
|
||||
#define flush_dcache_mmap_lock(mapping) do { } while (0)
|
||||
#define flush_dcache_mmap_unlock(mapping) do { } while (0)
|
||||
|
||||
#if (DCACHE_WAY_SIZE > PAGE_SIZE)
|
||||
|
||||
extern void copy_to_user_page(struct vm_area_struct*, struct page*,
|
||||
unsigned long, void*, const void*, unsigned long);
|
||||
extern void copy_from_user_page(struct vm_area_struct*, struct page*,
|
||||
unsigned long, void*, const void*, unsigned long);
|
||||
|
||||
#else
|
||||
|
||||
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
|
||||
do { \
|
||||
memcpy(dst, src, len); \
|
||||
__flush_dcache_range((unsigned long) dst, len); \
|
||||
__invalidate_icache_range((unsigned long) dst, len); \
|
||||
} while (0)
|
||||
|
||||
#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
|
||||
memcpy(dst, src, len)
|
||||
|
||||
#endif
|
||||
|
||||
#define XTENSA_CACHEBLK_LOG2 29
|
||||
#define XTENSA_CACHEBLK_SIZE (1 << XTENSA_CACHEBLK_LOG2)
|
||||
#define XTENSA_CACHEBLK_MASK (7 << XTENSA_CACHEBLK_LOG2)
|
||||
|
||||
#if XCHAL_HAVE_CACHEATTR
|
||||
static inline u32 xtensa_get_cacheattr(void)
|
||||
{
|
||||
u32 r;
|
||||
asm volatile(" rsr %0, cacheattr" : "=a"(r));
|
||||
return r;
|
||||
}
|
||||
|
||||
static inline u32 xtensa_get_dtlb1(u32 addr)
|
||||
{
|
||||
u32 r = addr & XTENSA_CACHEBLK_MASK;
|
||||
return r | ((xtensa_get_cacheattr() >> (r >> (XTENSA_CACHEBLK_LOG2-2)))
|
||||
& 0xF);
|
||||
}
|
||||
#else
|
||||
static inline u32 xtensa_get_dtlb1(u32 addr)
|
||||
{
|
||||
u32 r;
|
||||
asm volatile(" rdtlb1 %0, %1" : "=a"(r) : "a"(addr));
|
||||
asm volatile(" dsync");
|
||||
return r;
|
||||
}
|
||||
|
||||
static inline u32 xtensa_get_cacheattr(void)
|
||||
{
|
||||
u32 r = 0;
|
||||
u32 a = 0;
|
||||
do {
|
||||
a -= XTENSA_CACHEBLK_SIZE;
|
||||
r = (r << 4) | (xtensa_get_dtlb1(a) & 0xF);
|
||||
} while (a);
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline int xtensa_need_flush_dma_source(u32 addr)
|
||||
{
|
||||
return (xtensa_get_dtlb1(addr) & ((1 << XCHAL_CA_BITS) - 1)) >= 4;
|
||||
}
|
||||
|
||||
static inline int xtensa_need_invalidate_dma_destination(u32 addr)
|
||||
{
|
||||
return (xtensa_get_dtlb1(addr) & ((1 << XCHAL_CA_BITS) - 1)) != 2;
|
||||
}
|
||||
|
||||
static inline void flush_dcache_unaligned(u32 addr, u32 size)
|
||||
{
|
||||
u32 cnt;
|
||||
if (size) {
|
||||
cnt = (size + ((XCHAL_DCACHE_LINESIZE - 1) & addr)
|
||||
+ XCHAL_DCACHE_LINESIZE - 1) / XCHAL_DCACHE_LINESIZE;
|
||||
while (cnt--) {
|
||||
asm volatile(" dhwb %0, 0" : : "a"(addr));
|
||||
addr += XCHAL_DCACHE_LINESIZE;
|
||||
}
|
||||
asm volatile(" dsync");
|
||||
}
|
||||
}
|
||||
|
||||
static inline void invalidate_dcache_unaligned(u32 addr, u32 size)
|
||||
{
|
||||
int cnt;
|
||||
if (size) {
|
||||
asm volatile(" dhwbi %0, 0 ;" : : "a"(addr));
|
||||
cnt = (size + ((XCHAL_DCACHE_LINESIZE - 1) & addr)
|
||||
- XCHAL_DCACHE_LINESIZE - 1) / XCHAL_DCACHE_LINESIZE;
|
||||
while (cnt-- > 0) {
|
||||
asm volatile(" dhi %0, %1" : : "a"(addr),
|
||||
"n"(XCHAL_DCACHE_LINESIZE));
|
||||
addr += XCHAL_DCACHE_LINESIZE;
|
||||
}
|
||||
asm volatile(" dhwbi %0, %1" : : "a"(addr),
|
||||
"n"(XCHAL_DCACHE_LINESIZE));
|
||||
asm volatile(" dsync");
|
||||
}
|
||||
}
|
||||
|
||||
static inline void flush_invalidate_dcache_unaligned(u32 addr, u32 size)
|
||||
{
|
||||
u32 cnt;
|
||||
if (size) {
|
||||
cnt = (size + ((XCHAL_DCACHE_LINESIZE - 1) & addr)
|
||||
+ XCHAL_DCACHE_LINESIZE - 1) / XCHAL_DCACHE_LINESIZE;
|
||||
while (cnt--) {
|
||||
asm volatile(" dhwbi %0, 0" : : "a"(addr));
|
||||
addr += XCHAL_DCACHE_LINESIZE;
|
||||
}
|
||||
asm volatile(" dsync");
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* _XTENSA_CACHEFLUSH_H */
|
256
arch/xtensa/include/asm/checksum.h
Normal file
256
arch/xtensa/include/asm/checksum.h
Normal file
|
@ -0,0 +1,256 @@
|
|||
/*
|
||||
* include/asm-xtensa/checksum.h
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_CHECKSUM_H
|
||||
#define _XTENSA_CHECKSUM_H
|
||||
|
||||
#include <linux/in6.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <variant/core.h>
|
||||
|
||||
/*
|
||||
* computes the checksum of a memory block at buff, length len,
|
||||
* and adds in "sum" (32-bit)
|
||||
*
|
||||
* returns a 32-bit number suitable for feeding into itself
|
||||
* or csum_tcpudp_magic
|
||||
*
|
||||
* this function must be called with even lengths, except
|
||||
* for the last fragment, which may be odd
|
||||
*
|
||||
* it's best to have buff aligned on a 32-bit boundary
|
||||
*/
|
||||
asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* the same as csum_partial, but copies from src while it
|
||||
* checksums, and handles user-space pointer exceptions correctly, when needed.
|
||||
*
|
||||
* here even more important to align src and dst on a 32-bit (or even
|
||||
* better 64-bit) boundary
|
||||
*/
|
||||
|
||||
asmlinkage __wsum csum_partial_copy_generic(const void *src, void *dst,
|
||||
int len, __wsum sum,
|
||||
int *src_err_ptr, int *dst_err_ptr);
|
||||
|
||||
/*
|
||||
* Note: when you get a NULL pointer exception here this means someone
|
||||
* passed in an incorrect kernel address to one of these functions.
|
||||
*
|
||||
* If you use these functions directly please don't forget the access_ok().
|
||||
*/
|
||||
static inline
|
||||
__wsum csum_partial_copy_nocheck(const void *src, void *dst,
|
||||
int len, __wsum sum)
|
||||
{
|
||||
return csum_partial_copy_generic(src, dst, len, sum, NULL, NULL);
|
||||
}
|
||||
|
||||
static inline
|
||||
__wsum csum_partial_copy_from_user(const void __user *src, void *dst,
|
||||
int len, __wsum sum, int *err_ptr)
|
||||
{
|
||||
return csum_partial_copy_generic((__force const void *)src, dst,
|
||||
len, sum, err_ptr, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Fold a partial checksum
|
||||
*/
|
||||
|
||||
static __inline__ __sum16 csum_fold(__wsum sum)
|
||||
{
|
||||
unsigned int __dummy;
|
||||
__asm__("extui %1, %0, 16, 16\n\t"
|
||||
"extui %0 ,%0, 0, 16\n\t"
|
||||
"add %0, %0, %1\n\t"
|
||||
"slli %1, %0, 16\n\t"
|
||||
"add %0, %0, %1\n\t"
|
||||
"extui %0, %0, 16, 16\n\t"
|
||||
"neg %0, %0\n\t"
|
||||
"addi %0, %0, -1\n\t"
|
||||
"extui %0, %0, 0, 16\n\t"
|
||||
: "=r" (sum), "=&r" (__dummy)
|
||||
: "0" (sum));
|
||||
return (__force __sum16)sum;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is a version of ip_compute_csum() optimized for IP headers,
|
||||
* which always checksum on 4 octet boundaries.
|
||||
*/
|
||||
static __inline__ __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
|
||||
{
|
||||
unsigned int sum, tmp, endaddr;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"sub %0, %0, %0\n\t"
|
||||
#if XCHAL_HAVE_LOOPS
|
||||
"loopgtz %2, 2f\n\t"
|
||||
#else
|
||||
"beqz %2, 2f\n\t"
|
||||
"slli %4, %2, 2\n\t"
|
||||
"add %4, %4, %1\n\t"
|
||||
"0:\t"
|
||||
#endif
|
||||
"l32i %3, %1, 0\n\t"
|
||||
"add %0, %0, %3\n\t"
|
||||
"bgeu %0, %3, 1f\n\t"
|
||||
"addi %0, %0, 1\n\t"
|
||||
"1:\t"
|
||||
"addi %1, %1, 4\n\t"
|
||||
#if !XCHAL_HAVE_LOOPS
|
||||
"blt %1, %4, 0b\n\t"
|
||||
#endif
|
||||
"2:\t"
|
||||
/* Since the input registers which are loaded with iph and ihl
|
||||
are modified, we must also specify them as outputs, or gcc
|
||||
will assume they contain their original values. */
|
||||
: "=r" (sum), "=r" (iph), "=r" (ihl), "=&r" (tmp),
|
||||
"=&r" (endaddr)
|
||||
: "1" (iph), "2" (ihl)
|
||||
: "memory");
|
||||
|
||||
return csum_fold(sum);
|
||||
}
|
||||
|
||||
static __inline__ __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
|
||||
unsigned short len,
|
||||
unsigned short proto,
|
||||
__wsum sum)
|
||||
{
|
||||
|
||||
#ifdef __XTENSA_EL__
|
||||
unsigned long len_proto = (len + proto) << 8;
|
||||
#elif defined(__XTENSA_EB__)
|
||||
unsigned long len_proto = len + proto;
|
||||
#else
|
||||
# error processor byte order undefined!
|
||||
#endif
|
||||
__asm__("add %0, %0, %1\n\t"
|
||||
"bgeu %0, %1, 1f\n\t"
|
||||
"addi %0, %0, 1\n\t"
|
||||
"1:\t"
|
||||
"add %0, %0, %2\n\t"
|
||||
"bgeu %0, %2, 1f\n\t"
|
||||
"addi %0, %0, 1\n\t"
|
||||
"1:\t"
|
||||
"add %0, %0, %3\n\t"
|
||||
"bgeu %0, %3, 1f\n\t"
|
||||
"addi %0, %0, 1\n\t"
|
||||
"1:\t"
|
||||
: "=r" (sum), "=r" (len_proto)
|
||||
: "r" (daddr), "r" (saddr), "1" (len_proto), "0" (sum));
|
||||
return sum;
|
||||
}
|
||||
|
||||
/*
|
||||
* computes the checksum of the TCP/UDP pseudo-header
|
||||
* returns a 16-bit checksum, already complemented
|
||||
*/
|
||||
static __inline__ __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
|
||||
unsigned short len,
|
||||
unsigned short proto,
|
||||
__wsum sum)
|
||||
{
|
||||
return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
|
||||
}
|
||||
|
||||
/*
|
||||
* this routine is used for miscellaneous IP-like checksums, mainly
|
||||
* in icmp.c
|
||||
*/
|
||||
|
||||
static __inline__ __sum16 ip_compute_csum(const void *buff, int len)
|
||||
{
|
||||
return csum_fold (csum_partial(buff, len, 0));
|
||||
}
|
||||
|
||||
#define _HAVE_ARCH_IPV6_CSUM
|
||||
static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
|
||||
const struct in6_addr *daddr,
|
||||
__u32 len, unsigned short proto,
|
||||
__wsum sum)
|
||||
{
|
||||
unsigned int __dummy;
|
||||
__asm__("l32i %1, %2, 0\n\t"
|
||||
"add %0, %0, %1\n\t"
|
||||
"bgeu %0, %1, 1f\n\t"
|
||||
"addi %0, %0, 1\n\t"
|
||||
"1:\t"
|
||||
"l32i %1, %2, 4\n\t"
|
||||
"add %0, %0, %1\n\t"
|
||||
"bgeu %0, %1, 1f\n\t"
|
||||
"addi %0, %0, 1\n\t"
|
||||
"1:\t"
|
||||
"l32i %1, %2, 8\n\t"
|
||||
"add %0, %0, %1\n\t"
|
||||
"bgeu %0, %1, 1f\n\t"
|
||||
"addi %0, %0, 1\n\t"
|
||||
"1:\t"
|
||||
"l32i %1, %2, 12\n\t"
|
||||
"add %0, %0, %1\n\t"
|
||||
"bgeu %0, %1, 1f\n\t"
|
||||
"addi %0, %0, 1\n\t"
|
||||
"1:\t"
|
||||
"l32i %1, %3, 0\n\t"
|
||||
"add %0, %0, %1\n\t"
|
||||
"bgeu %0, %1, 1f\n\t"
|
||||
"addi %0, %0, 1\n\t"
|
||||
"1:\t"
|
||||
"l32i %1, %3, 4\n\t"
|
||||
"add %0, %0, %1\n\t"
|
||||
"bgeu %0, %1, 1f\n\t"
|
||||
"addi %0, %0, 1\n\t"
|
||||
"1:\t"
|
||||
"l32i %1, %3, 8\n\t"
|
||||
"add %0, %0, %1\n\t"
|
||||
"bgeu %0, %1, 1f\n\t"
|
||||
"addi %0, %0, 1\n\t"
|
||||
"1:\t"
|
||||
"l32i %1, %3, 12\n\t"
|
||||
"add %0, %0, %1\n\t"
|
||||
"bgeu %0, %1, 1f\n\t"
|
||||
"addi %0, %0, 1\n\t"
|
||||
"1:\t"
|
||||
"add %0, %0, %4\n\t"
|
||||
"bgeu %0, %4, 1f\n\t"
|
||||
"addi %0, %0, 1\n\t"
|
||||
"1:\t"
|
||||
"add %0, %0, %5\n\t"
|
||||
"bgeu %0, %5, 1f\n\t"
|
||||
"addi %0, %0, 1\n\t"
|
||||
"1:\t"
|
||||
: "=r" (sum), "=&r" (__dummy)
|
||||
: "r" (saddr), "r" (daddr),
|
||||
"r" (htonl(len)), "r" (htonl(proto)), "0" (sum)
|
||||
: "memory");
|
||||
|
||||
return csum_fold(sum);
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy and checksum to user
|
||||
*/
|
||||
#define HAVE_CSUM_COPY_USER
|
||||
static __inline__ __wsum csum_and_copy_to_user(const void *src,
|
||||
void __user *dst, int len,
|
||||
__wsum sum, int *err_ptr)
|
||||
{
|
||||
if (access_ok(VERIFY_WRITE, dst, len))
|
||||
return csum_partial_copy_generic(src,dst,len,sum,NULL,err_ptr);
|
||||
|
||||
if (len)
|
||||
*err_ptr = -EFAULT;
|
||||
|
||||
return (__force __wsum)-1; /* invalid checksum */
|
||||
}
|
||||
#endif
|
162
arch/xtensa/include/asm/cmpxchg.h
Normal file
162
arch/xtensa/include/asm/cmpxchg.h
Normal file
|
@ -0,0 +1,162 @@
|
|||
/*
|
||||
* Atomic xchg and cmpxchg operations.
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_CMPXCHG_H
|
||||
#define _XTENSA_CMPXCHG_H
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <linux/stringify.h>
|
||||
|
||||
/*
|
||||
* cmpxchg
|
||||
*/
|
||||
|
||||
static inline unsigned long
|
||||
__cmpxchg_u32(volatile int *p, int old, int new)
|
||||
{
|
||||
#if XCHAL_HAVE_S32C1I
|
||||
__asm__ __volatile__(
|
||||
" wsr %2, scompare1\n"
|
||||
" s32c1i %0, %1, 0\n"
|
||||
: "+a" (new)
|
||||
: "a" (p), "a" (old)
|
||||
: "memory"
|
||||
);
|
||||
|
||||
return new;
|
||||
#else
|
||||
__asm__ __volatile__(
|
||||
" rsil a15, "__stringify(LOCKLEVEL)"\n"
|
||||
" l32i %0, %1, 0\n"
|
||||
" bne %0, %2, 1f\n"
|
||||
" s32i %3, %1, 0\n"
|
||||
"1:\n"
|
||||
" wsr a15, ps\n"
|
||||
" rsync\n"
|
||||
: "=&a" (old)
|
||||
: "a" (p), "a" (old), "r" (new)
|
||||
: "a15", "memory");
|
||||
return old;
|
||||
#endif
|
||||
}
|
||||
/* This function doesn't exist, so you'll get a linker error
|
||||
* if something tries to do an invalid cmpxchg(). */
|
||||
|
||||
extern void __cmpxchg_called_with_bad_pointer(void);
|
||||
|
||||
static __inline__ unsigned long
|
||||
__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
|
||||
{
|
||||
switch (size) {
|
||||
case 4: return __cmpxchg_u32(ptr, old, new);
|
||||
default: __cmpxchg_called_with_bad_pointer();
|
||||
return old;
|
||||
}
|
||||
}
|
||||
|
||||
#define cmpxchg(ptr,o,n) \
|
||||
({ __typeof__(*(ptr)) _o_ = (o); \
|
||||
__typeof__(*(ptr)) _n_ = (n); \
|
||||
(__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
|
||||
(unsigned long)_n_, sizeof (*(ptr))); \
|
||||
})
|
||||
|
||||
#include <asm-generic/cmpxchg-local.h>
|
||||
|
||||
static inline unsigned long __cmpxchg_local(volatile void *ptr,
|
||||
unsigned long old,
|
||||
unsigned long new, int size)
|
||||
{
|
||||
switch (size) {
|
||||
case 4:
|
||||
return __cmpxchg_u32(ptr, old, new);
|
||||
default:
|
||||
return __cmpxchg_local_generic(ptr, old, new, size);
|
||||
}
|
||||
|
||||
return old;
|
||||
}
|
||||
|
||||
/*
|
||||
* cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
|
||||
* them available.
|
||||
*/
|
||||
#define cmpxchg_local(ptr, o, n) \
|
||||
((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
|
||||
(unsigned long)(n), sizeof(*(ptr))))
|
||||
#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
|
||||
#define cmpxchg64(ptr, o, n) cmpxchg64_local((ptr), (o), (n))
|
||||
|
||||
/*
|
||||
* xchg_u32
|
||||
*
|
||||
* Note that a15 is used here because the register allocation
|
||||
* done by the compiler is not guaranteed and a window overflow
|
||||
* may not occur between the rsil and wsr instructions. By using
|
||||
* a15 in the rsil, the machine is guaranteed to be in a state
|
||||
* where no register reference will cause an overflow.
|
||||
*/
|
||||
|
||||
static inline unsigned long xchg_u32(volatile int * m, unsigned long val)
|
||||
{
|
||||
#if XCHAL_HAVE_S32C1I
|
||||
unsigned long tmp, result;
|
||||
__asm__ __volatile__(
|
||||
"1: l32i %1, %2, 0\n"
|
||||
" mov %0, %3\n"
|
||||
" wsr %1, scompare1\n"
|
||||
" s32c1i %0, %2, 0\n"
|
||||
" bne %0, %1, 1b\n"
|
||||
: "=&a" (result), "=&a" (tmp)
|
||||
: "a" (m), "a" (val)
|
||||
: "memory"
|
||||
);
|
||||
return result;
|
||||
#else
|
||||
unsigned long tmp;
|
||||
__asm__ __volatile__(
|
||||
" rsil a15, "__stringify(LOCKLEVEL)"\n"
|
||||
" l32i %0, %1, 0\n"
|
||||
" s32i %2, %1, 0\n"
|
||||
" wsr a15, ps\n"
|
||||
" rsync\n"
|
||||
: "=&a" (tmp)
|
||||
: "a" (m), "a" (val)
|
||||
: "a15", "memory");
|
||||
return tmp;
|
||||
#endif
|
||||
}
|
||||
|
||||
#define xchg(ptr,x) \
|
||||
((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
|
||||
|
||||
/*
|
||||
* This only works if the compiler isn't horribly bad at optimizing.
|
||||
* gcc-2.5.8 reportedly can't handle this, but I define that one to
|
||||
* be dead anyway.
|
||||
*/
|
||||
|
||||
extern void __xchg_called_with_bad_pointer(void);
|
||||
|
||||
static __inline__ unsigned long
|
||||
__xchg(unsigned long x, volatile void * ptr, int size)
|
||||
{
|
||||
switch (size) {
|
||||
case 4:
|
||||
return xchg_u32(ptr, x);
|
||||
}
|
||||
__xchg_called_with_bad_pointer();
|
||||
return x;
|
||||
}
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#endif /* _XTENSA_CMPXCHG_H */
|
177
arch/xtensa/include/asm/coprocessor.h
Normal file
177
arch/xtensa/include/asm/coprocessor.h
Normal file
|
@ -0,0 +1,177 @@
|
|||
/*
|
||||
* include/asm-xtensa/coprocessor.h
|
||||
*
|
||||
* 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 - 2007 Tensilica Inc.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _XTENSA_COPROCESSOR_H
|
||||
#define _XTENSA_COPROCESSOR_H
|
||||
|
||||
#include <linux/stringify.h>
|
||||
#include <variant/core.h>
|
||||
#include <variant/tie.h>
|
||||
#include <asm/types.h>
|
||||
|
||||
#ifdef __ASSEMBLY__
|
||||
# include <variant/tie-asm.h>
|
||||
|
||||
.macro xchal_sa_start a b
|
||||
.set .Lxchal_pofs_, 0
|
||||
.set .Lxchal_ofs_, 0
|
||||
.endm
|
||||
|
||||
.macro xchal_sa_align ptr minofs maxofs ofsalign totalign
|
||||
.set .Lxchal_ofs_, .Lxchal_ofs_ + .Lxchal_pofs_ + \totalign - 1
|
||||
.set .Lxchal_ofs_, (.Lxchal_ofs_ & -\totalign) - .Lxchal_pofs_
|
||||
.endm
|
||||
|
||||
#define _SELECT ( XTHAL_SAS_TIE | XTHAL_SAS_OPT \
|
||||
| XTHAL_SAS_CC \
|
||||
| XTHAL_SAS_CALR | XTHAL_SAS_CALE )
|
||||
|
||||
.macro save_xtregs_opt ptr clb at1 at2 at3 at4 offset
|
||||
.if XTREGS_OPT_SIZE > 0
|
||||
addi \clb, \ptr, \offset
|
||||
xchal_ncp_store \clb \at1 \at2 \at3 \at4 select=_SELECT
|
||||
.endif
|
||||
.endm
|
||||
|
||||
.macro load_xtregs_opt ptr clb at1 at2 at3 at4 offset
|
||||
.if XTREGS_OPT_SIZE > 0
|
||||
addi \clb, \ptr, \offset
|
||||
xchal_ncp_load \clb \at1 \at2 \at3 \at4 select=_SELECT
|
||||
.endif
|
||||
.endm
|
||||
#undef _SELECT
|
||||
|
||||
#define _SELECT ( XTHAL_SAS_TIE | XTHAL_SAS_OPT \
|
||||
| XTHAL_SAS_NOCC \
|
||||
| XTHAL_SAS_CALR | XTHAL_SAS_CALE | XTHAL_SAS_GLOB )
|
||||
|
||||
.macro save_xtregs_user ptr clb at1 at2 at3 at4 offset
|
||||
.if XTREGS_USER_SIZE > 0
|
||||
addi \clb, \ptr, \offset
|
||||
xchal_ncp_store \clb \at1 \at2 \at3 \at4 select=_SELECT
|
||||
.endif
|
||||
.endm
|
||||
|
||||
.macro load_xtregs_user ptr clb at1 at2 at3 at4 offset
|
||||
.if XTREGS_USER_SIZE > 0
|
||||
addi \clb, \ptr, \offset
|
||||
xchal_ncp_load \clb \at1 \at2 \at3 \at4 select=_SELECT
|
||||
.endif
|
||||
.endm
|
||||
#undef _SELECT
|
||||
|
||||
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
/*
|
||||
* XTENSA_HAVE_COPROCESSOR(x) returns 1 if coprocessor x is configured.
|
||||
*
|
||||
* XTENSA_HAVE_IO_PORT(x) returns 1 if io-port x is configured.
|
||||
*
|
||||
*/
|
||||
|
||||
#define XTENSA_HAVE_COPROCESSOR(x) \
|
||||
((XCHAL_CP_MASK ^ XCHAL_CP_PORT_MASK) & (1 << (x)))
|
||||
#define XTENSA_HAVE_COPROCESSORS \
|
||||
(XCHAL_CP_MASK ^ XCHAL_CP_PORT_MASK)
|
||||
#define XTENSA_HAVE_IO_PORT(x) \
|
||||
(XCHAL_CP_PORT_MASK & (1 << (x)))
|
||||
#define XTENSA_HAVE_IO_PORTS \
|
||||
XCHAL_CP_PORT_MASK
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
|
||||
#if XCHAL_HAVE_CP
|
||||
|
||||
#define RSR_CPENABLE(x) do { \
|
||||
__asm__ __volatile__("rsr %0, cpenable" : "=a" (x)); \
|
||||
} while(0);
|
||||
#define WSR_CPENABLE(x) do { \
|
||||
__asm__ __volatile__("wsr %0, cpenable; rsync" :: "a" (x)); \
|
||||
} while(0);
|
||||
|
||||
#endif /* XCHAL_HAVE_CP */
|
||||
|
||||
|
||||
/*
|
||||
* Additional registers.
|
||||
* We define three types of additional registers:
|
||||
* ext: extra registers that are used by the compiler
|
||||
* cpn: optional registers that can be used by a user application
|
||||
* cpX: coprocessor registers that can only be used if the corresponding
|
||||
* CPENABLE bit is set.
|
||||
*/
|
||||
|
||||
#define XCHAL_SA_REG(list,cc,abi,type,y,name,z,align,size,...) \
|
||||
__REG ## list (cc, abi, type, name, size, align)
|
||||
|
||||
#define __REG0(cc,abi,t,name,s,a) __REG0_ ## cc (abi,name)
|
||||
#define __REG1(cc,abi,t,name,s,a) __REG1_ ## cc (name)
|
||||
#define __REG2(cc,abi,type,...) __REG2_ ## type (__VA_ARGS__)
|
||||
|
||||
#define __REG0_0(abi,name)
|
||||
#define __REG0_1(abi,name) __REG0_1 ## abi (name)
|
||||
#define __REG0_10(name) __u32 name;
|
||||
#define __REG0_11(name) __u32 name;
|
||||
#define __REG0_12(name)
|
||||
|
||||
#define __REG1_0(name) __u32 name;
|
||||
#define __REG1_1(name)
|
||||
|
||||
#define __REG2_0(n,s,a) __u32 name;
|
||||
#define __REG2_1(n,s,a) unsigned char n[s] __attribute__ ((aligned(a)));
|
||||
#define __REG2_2(n,s,a) unsigned char n[s] __attribute__ ((aligned(a)));
|
||||
|
||||
typedef struct { XCHAL_NCP_SA_LIST(0) } xtregs_opt_t
|
||||
__attribute__ ((aligned (XCHAL_NCP_SA_ALIGN)));
|
||||
typedef struct { XCHAL_NCP_SA_LIST(1) } xtregs_user_t
|
||||
__attribute__ ((aligned (XCHAL_NCP_SA_ALIGN)));
|
||||
|
||||
#if XTENSA_HAVE_COPROCESSORS
|
||||
|
||||
typedef struct { XCHAL_CP0_SA_LIST(2) } xtregs_cp0_t
|
||||
__attribute__ ((aligned (XCHAL_CP0_SA_ALIGN)));
|
||||
typedef struct { XCHAL_CP1_SA_LIST(2) } xtregs_cp1_t
|
||||
__attribute__ ((aligned (XCHAL_CP1_SA_ALIGN)));
|
||||
typedef struct { XCHAL_CP2_SA_LIST(2) } xtregs_cp2_t
|
||||
__attribute__ ((aligned (XCHAL_CP2_SA_ALIGN)));
|
||||
typedef struct { XCHAL_CP3_SA_LIST(2) } xtregs_cp3_t
|
||||
__attribute__ ((aligned (XCHAL_CP3_SA_ALIGN)));
|
||||
typedef struct { XCHAL_CP4_SA_LIST(2) } xtregs_cp4_t
|
||||
__attribute__ ((aligned (XCHAL_CP4_SA_ALIGN)));
|
||||
typedef struct { XCHAL_CP5_SA_LIST(2) } xtregs_cp5_t
|
||||
__attribute__ ((aligned (XCHAL_CP5_SA_ALIGN)));
|
||||
typedef struct { XCHAL_CP6_SA_LIST(2) } xtregs_cp6_t
|
||||
__attribute__ ((aligned (XCHAL_CP6_SA_ALIGN)));
|
||||
typedef struct { XCHAL_CP7_SA_LIST(2) } xtregs_cp7_t
|
||||
__attribute__ ((aligned (XCHAL_CP7_SA_ALIGN)));
|
||||
|
||||
extern struct thread_info* coprocessor_owner[XCHAL_CP_MAX];
|
||||
extern void coprocessor_save(void*, int);
|
||||
extern void coprocessor_load(void*, int);
|
||||
extern void coprocessor_flush(struct thread_info*, int);
|
||||
extern void coprocessor_restore(struct thread_info*, int);
|
||||
|
||||
extern void coprocessor_release_all(struct thread_info*);
|
||||
extern void coprocessor_flush_all(struct thread_info*);
|
||||
|
||||
static inline void coprocessor_clear_cpenable(void)
|
||||
{
|
||||
unsigned long i = 0;
|
||||
WSR_CPENABLE(i);
|
||||
}
|
||||
|
||||
#endif /* XTENSA_HAVE_COPROCESSORS */
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
#endif /* _XTENSA_COPROCESSOR_H */
|
38
arch/xtensa/include/asm/current.h
Normal file
38
arch/xtensa/include/asm/current.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* include/asm-xtensa/current.h
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_CURRENT_H
|
||||
#define _XTENSA_CURRENT_H
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <linux/thread_info.h>
|
||||
|
||||
struct task_struct;
|
||||
|
||||
static inline struct task_struct *get_current(void)
|
||||
{
|
||||
return current_thread_info()->task;
|
||||
}
|
||||
|
||||
#define current get_current()
|
||||
|
||||
#else
|
||||
|
||||
#define CURRENT_SHIFT 13
|
||||
|
||||
#define GET_CURRENT(reg,sp) \
|
||||
GET_THREAD_INFO(reg,sp); \
|
||||
l32i reg, reg, TI_TASK \
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* XTENSA_CURRENT_H */
|
75
arch/xtensa/include/asm/delay.h
Normal file
75
arch/xtensa/include/asm/delay.h
Normal file
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* include/asm-xtensa/delay.h
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_DELAY_H
|
||||
#define _XTENSA_DELAY_H
|
||||
|
||||
#include <asm/timex.h>
|
||||
#include <asm/param.h>
|
||||
|
||||
extern unsigned long loops_per_jiffy;
|
||||
|
||||
static inline void __delay(unsigned long loops)
|
||||
{
|
||||
if (__builtin_constant_p(loops) && loops < 2)
|
||||
__asm__ __volatile__ ("nop");
|
||||
else if (loops >= 2)
|
||||
/* 2 cycles per loop. */
|
||||
__asm__ __volatile__ ("1: addi %0, %0, -2; bgeui %0, 2, 1b"
|
||||
: "+r" (loops));
|
||||
}
|
||||
|
||||
/* Undefined function to get compile-time error */
|
||||
void __bad_udelay(void);
|
||||
void __bad_ndelay(void);
|
||||
|
||||
#define __MAX_UDELAY 30000
|
||||
#define __MAX_NDELAY 30000
|
||||
|
||||
static inline void __udelay(unsigned long usecs)
|
||||
{
|
||||
unsigned long start = get_ccount();
|
||||
unsigned long cycles = (usecs * (ccount_freq >> 15)) >> 5;
|
||||
|
||||
/* Note: all variables are unsigned (can wrap around)! */
|
||||
while (((unsigned long)get_ccount()) - start < cycles)
|
||||
cpu_relax();
|
||||
}
|
||||
|
||||
static inline void udelay(unsigned long usec)
|
||||
{
|
||||
if (__builtin_constant_p(usec) && usec >= __MAX_UDELAY)
|
||||
__bad_udelay();
|
||||
else
|
||||
__udelay(usec);
|
||||
}
|
||||
|
||||
static inline void __ndelay(unsigned long nsec)
|
||||
{
|
||||
/*
|
||||
* Inner shift makes sure multiplication doesn't overflow
|
||||
* for legitimate nsec values
|
||||
*/
|
||||
unsigned long cycles = (nsec * (ccount_freq >> 15)) >> 15;
|
||||
__delay(cycles);
|
||||
}
|
||||
|
||||
#define ndelay(n) ndelay(n)
|
||||
|
||||
static inline void ndelay(unsigned long nsec)
|
||||
{
|
||||
if (__builtin_constant_p(nsec) && nsec >= __MAX_NDELAY)
|
||||
__bad_ndelay();
|
||||
else
|
||||
__ndelay(nsec);
|
||||
}
|
||||
|
||||
#endif
|
188
arch/xtensa/include/asm/dma-mapping.h
Normal file
188
arch/xtensa/include/asm/dma-mapping.h
Normal file
|
@ -0,0 +1,188 @@
|
|||
/*
|
||||
* include/asm-xtensa/dma-mapping.h
|
||||
*
|
||||
* 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 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_DMA_MAPPING_H
|
||||
#define _XTENSA_DMA_MAPPING_H
|
||||
|
||||
#include <asm/cache.h>
|
||||
#include <asm/io.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/scatterlist.h>
|
||||
|
||||
#define DMA_ERROR_CODE (~(dma_addr_t)0x0)
|
||||
|
||||
/*
|
||||
* DMA-consistent mapping functions.
|
||||
*/
|
||||
|
||||
extern void *consistent_alloc(int, size_t, dma_addr_t, unsigned long);
|
||||
extern void consistent_free(void*, size_t, dma_addr_t);
|
||||
extern void consistent_sync(void*, size_t, int);
|
||||
|
||||
#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
|
||||
#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
|
||||
|
||||
void *dma_alloc_coherent(struct device *dev, size_t size,
|
||||
dma_addr_t *dma_handle, gfp_t flag);
|
||||
|
||||
void dma_free_coherent(struct device *dev, size_t size,
|
||||
void *vaddr, dma_addr_t dma_handle);
|
||||
|
||||
static inline dma_addr_t
|
||||
dma_map_single(struct device *dev, void *ptr, size_t size,
|
||||
enum dma_data_direction direction)
|
||||
{
|
||||
BUG_ON(direction == DMA_NONE);
|
||||
consistent_sync(ptr, size, direction);
|
||||
return virt_to_phys(ptr);
|
||||
}
|
||||
|
||||
static inline void
|
||||
dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
|
||||
enum dma_data_direction direction)
|
||||
{
|
||||
BUG_ON(direction == DMA_NONE);
|
||||
}
|
||||
|
||||
static inline int
|
||||
dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
|
||||
enum dma_data_direction direction)
|
||||
{
|
||||
int i;
|
||||
|
||||
BUG_ON(direction == DMA_NONE);
|
||||
|
||||
for (i = 0; i < nents; i++, sg++ ) {
|
||||
BUG_ON(!sg_page(sg));
|
||||
|
||||
sg->dma_address = sg_phys(sg);
|
||||
consistent_sync(sg_virt(sg), sg->length, direction);
|
||||
}
|
||||
|
||||
return nents;
|
||||
}
|
||||
|
||||
static inline dma_addr_t
|
||||
dma_map_page(struct device *dev, struct page *page, unsigned long offset,
|
||||
size_t size, enum dma_data_direction direction)
|
||||
{
|
||||
BUG_ON(direction == DMA_NONE);
|
||||
return (dma_addr_t)(page_to_pfn(page)) * PAGE_SIZE + offset;
|
||||
}
|
||||
|
||||
static inline void
|
||||
dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
|
||||
enum dma_data_direction direction)
|
||||
{
|
||||
BUG_ON(direction == DMA_NONE);
|
||||
}
|
||||
|
||||
|
||||
static inline void
|
||||
dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
|
||||
enum dma_data_direction direction)
|
||||
{
|
||||
BUG_ON(direction == DMA_NONE);
|
||||
}
|
||||
|
||||
static inline void
|
||||
dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
|
||||
enum dma_data_direction direction)
|
||||
{
|
||||
consistent_sync((void *)bus_to_virt(dma_handle), size, direction);
|
||||
}
|
||||
|
||||
static inline void
|
||||
dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,
|
||||
size_t size, enum dma_data_direction direction)
|
||||
{
|
||||
consistent_sync((void *)bus_to_virt(dma_handle), size, direction);
|
||||
}
|
||||
|
||||
static inline void
|
||||
dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle,
|
||||
unsigned long offset, size_t size,
|
||||
enum dma_data_direction direction)
|
||||
{
|
||||
|
||||
consistent_sync((void *)bus_to_virt(dma_handle)+offset,size,direction);
|
||||
}
|
||||
|
||||
static inline void
|
||||
dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle,
|
||||
unsigned long offset, size_t size,
|
||||
enum dma_data_direction direction)
|
||||
{
|
||||
|
||||
consistent_sync((void *)bus_to_virt(dma_handle)+offset,size,direction);
|
||||
}
|
||||
static inline void
|
||||
dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
|
||||
enum dma_data_direction dir)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < nelems; i++, sg++)
|
||||
consistent_sync(sg_virt(sg), sg->length, dir);
|
||||
}
|
||||
|
||||
static inline void
|
||||
dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
|
||||
enum dma_data_direction dir)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < nelems; i++, sg++)
|
||||
consistent_sync(sg_virt(sg), sg->length, dir);
|
||||
}
|
||||
static inline int
|
||||
dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
dma_supported(struct device *dev, u64 mask)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline int
|
||||
dma_set_mask(struct device *dev, u64 mask)
|
||||
{
|
||||
if(!dev->dma_mask || !dma_supported(dev, mask))
|
||||
return -EIO;
|
||||
|
||||
*dev->dma_mask = mask;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
dma_cache_sync(struct device *dev, void *vaddr, size_t size,
|
||||
enum dma_data_direction direction)
|
||||
{
|
||||
consistent_sync(vaddr, size, direction);
|
||||
}
|
||||
|
||||
/* Not supported for now */
|
||||
static inline int dma_mmap_coherent(struct device *dev,
|
||||
struct vm_area_struct *vma, void *cpu_addr,
|
||||
dma_addr_t dma_addr, size_t size)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline int dma_get_sgtable(struct device *dev, struct sg_table *sgt,
|
||||
void *cpu_addr, dma_addr_t dma_addr,
|
||||
size_t size)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#endif /* _XTENSA_DMA_MAPPING_H */
|
62
arch/xtensa/include/asm/dma.h
Normal file
62
arch/xtensa/include/asm/dma.h
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* include/asm-xtensa/dma.h
|
||||
*
|
||||
* 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 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_DMA_H
|
||||
#define _XTENSA_DMA_H
|
||||
|
||||
#include <asm/io.h> /* need byte IO */
|
||||
|
||||
/*
|
||||
* This is only to be defined if we have PC-like DMA.
|
||||
* By default this is not true on an Xtensa processor,
|
||||
* however on boards with a PCI bus, such functionality
|
||||
* might be emulated externally.
|
||||
*
|
||||
* NOTE: there still exists driver code that assumes
|
||||
* this is defined, eg. drivers/sound/soundcard.c (as of 2.4).
|
||||
*/
|
||||
#define MAX_DMA_CHANNELS 8
|
||||
|
||||
/*
|
||||
* The maximum virtual address to which DMA transfers
|
||||
* can be performed on this platform.
|
||||
*
|
||||
* NOTE: This is board (platform) specific, not processor-specific!
|
||||
*
|
||||
* NOTE: This assumes DMA transfers can only be performed on
|
||||
* the section of physical memory contiguously mapped in virtual
|
||||
* space for the kernel. For the Xtensa architecture, this
|
||||
* means the maximum possible size of this DMA area is
|
||||
* the size of the statically mapped kernel segment
|
||||
* (XCHAL_KSEG_{CACHED,BYPASS}_SIZE), ie. 128 MB.
|
||||
*
|
||||
* NOTE: When the entire KSEG area is DMA capable, we subtract
|
||||
* one from the max address so that the virt_to_phys() macro
|
||||
* works correctly on the address (otherwise the address
|
||||
* enters another area, and virt_to_phys() may not return
|
||||
* the value desired).
|
||||
*/
|
||||
|
||||
#ifndef MAX_DMA_ADDRESS
|
||||
#define MAX_DMA_ADDRESS (PAGE_OFFSET + XCHAL_KIO_SIZE - 1)
|
||||
#endif
|
||||
|
||||
/* Reserve and release a DMA channel */
|
||||
extern int request_dma(unsigned int dmanr, const char * device_id);
|
||||
extern void free_dma(unsigned int dmanr);
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
extern int isa_dma_bridge_buggy;
|
||||
#else
|
||||
#define isa_dma_bridge_buggy (0)
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
207
arch/xtensa/include/asm/elf.h
Normal file
207
arch/xtensa/include/asm/elf.h
Normal file
|
@ -0,0 +1,207 @@
|
|||
/*
|
||||
* include/asm-xtensa/elf.h
|
||||
*
|
||||
* ELF register definitions
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_ELF_H
|
||||
#define _XTENSA_ELF_H
|
||||
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/coprocessor.h>
|
||||
|
||||
/* Xtensa processor ELF architecture-magic number */
|
||||
|
||||
#define EM_XTENSA 94
|
||||
#define EM_XTENSA_OLD 0xABC7
|
||||
|
||||
/* Xtensa relocations defined by the ABIs */
|
||||
|
||||
#define R_XTENSA_NONE 0
|
||||
#define R_XTENSA_32 1
|
||||
#define R_XTENSA_RTLD 2
|
||||
#define R_XTENSA_GLOB_DAT 3
|
||||
#define R_XTENSA_JMP_SLOT 4
|
||||
#define R_XTENSA_RELATIVE 5
|
||||
#define R_XTENSA_PLT 6
|
||||
#define R_XTENSA_OP0 8
|
||||
#define R_XTENSA_OP1 9
|
||||
#define R_XTENSA_OP2 10
|
||||
#define R_XTENSA_ASM_EXPAND 11
|
||||
#define R_XTENSA_ASM_SIMPLIFY 12
|
||||
#define R_XTENSA_GNU_VTINHERIT 15
|
||||
#define R_XTENSA_GNU_VTENTRY 16
|
||||
#define R_XTENSA_DIFF8 17
|
||||
#define R_XTENSA_DIFF16 18
|
||||
#define R_XTENSA_DIFF32 19
|
||||
#define R_XTENSA_SLOT0_OP 20
|
||||
#define R_XTENSA_SLOT1_OP 21
|
||||
#define R_XTENSA_SLOT2_OP 22
|
||||
#define R_XTENSA_SLOT3_OP 23
|
||||
#define R_XTENSA_SLOT4_OP 24
|
||||
#define R_XTENSA_SLOT5_OP 25
|
||||
#define R_XTENSA_SLOT6_OP 26
|
||||
#define R_XTENSA_SLOT7_OP 27
|
||||
#define R_XTENSA_SLOT8_OP 28
|
||||
#define R_XTENSA_SLOT9_OP 29
|
||||
#define R_XTENSA_SLOT10_OP 30
|
||||
#define R_XTENSA_SLOT11_OP 31
|
||||
#define R_XTENSA_SLOT12_OP 32
|
||||
#define R_XTENSA_SLOT13_OP 33
|
||||
#define R_XTENSA_SLOT14_OP 34
|
||||
#define R_XTENSA_SLOT0_ALT 35
|
||||
#define R_XTENSA_SLOT1_ALT 36
|
||||
#define R_XTENSA_SLOT2_ALT 37
|
||||
#define R_XTENSA_SLOT3_ALT 38
|
||||
#define R_XTENSA_SLOT4_ALT 39
|
||||
#define R_XTENSA_SLOT5_ALT 40
|
||||
#define R_XTENSA_SLOT6_ALT 41
|
||||
#define R_XTENSA_SLOT7_ALT 42
|
||||
#define R_XTENSA_SLOT8_ALT 43
|
||||
#define R_XTENSA_SLOT9_ALT 44
|
||||
#define R_XTENSA_SLOT10_ALT 45
|
||||
#define R_XTENSA_SLOT11_ALT 46
|
||||
#define R_XTENSA_SLOT12_ALT 47
|
||||
#define R_XTENSA_SLOT13_ALT 48
|
||||
#define R_XTENSA_SLOT14_ALT 49
|
||||
|
||||
/* ELF register definitions. This is needed for core dump support. */
|
||||
|
||||
typedef unsigned long elf_greg_t;
|
||||
|
||||
typedef struct {
|
||||
elf_greg_t pc;
|
||||
elf_greg_t ps;
|
||||
elf_greg_t lbeg;
|
||||
elf_greg_t lend;
|
||||
elf_greg_t lcount;
|
||||
elf_greg_t sar;
|
||||
elf_greg_t windowstart;
|
||||
elf_greg_t windowbase;
|
||||
elf_greg_t threadptr;
|
||||
elf_greg_t reserved[7+48];
|
||||
elf_greg_t a[64];
|
||||
} xtensa_gregset_t;
|
||||
|
||||
#define ELF_NGREG (sizeof(xtensa_gregset_t) / sizeof(elf_greg_t))
|
||||
|
||||
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
|
||||
|
||||
#define ELF_NFPREG 18
|
||||
|
||||
typedef unsigned int elf_fpreg_t;
|
||||
typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
|
||||
|
||||
#define ELF_CORE_COPY_REGS(_eregs, _pregs) \
|
||||
xtensa_elf_core_copy_regs ((xtensa_gregset_t*)&(_eregs), _pregs);
|
||||
|
||||
extern void xtensa_elf_core_copy_regs (xtensa_gregset_t *, struct pt_regs *);
|
||||
|
||||
/*
|
||||
* This is used to ensure we don't load something for the wrong architecture.
|
||||
*/
|
||||
|
||||
#define elf_check_arch(x) ( ( (x)->e_machine == EM_XTENSA ) || \
|
||||
( (x)->e_machine == EM_XTENSA_OLD ) )
|
||||
|
||||
/*
|
||||
* These are used to set parameters in the core dumps.
|
||||
*/
|
||||
|
||||
#ifdef __XTENSA_EL__
|
||||
# define ELF_DATA ELFDATA2LSB
|
||||
#elif defined(__XTENSA_EB__)
|
||||
# define ELF_DATA ELFDATA2MSB
|
||||
#else
|
||||
# error processor byte order undefined!
|
||||
#endif
|
||||
|
||||
#define ELF_CLASS ELFCLASS32
|
||||
#define ELF_ARCH EM_XTENSA
|
||||
|
||||
#define ELF_EXEC_PAGESIZE PAGE_SIZE
|
||||
|
||||
/*
|
||||
* This is the location that an ET_DYN program is loaded if exec'ed. Typical
|
||||
* use of this is to invoke "./ld.so someprog" to test out a new version of
|
||||
* the loader. We need to make sure that it is out of the way of the program
|
||||
* that it will "exec", and that there is sufficient room for the brk.
|
||||
*/
|
||||
|
||||
#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
|
||||
|
||||
/*
|
||||
* This yields a mask that user programs can use to figure out what
|
||||
* instruction set this CPU supports. This could be done in user space,
|
||||
* but it's not easy, and we've already done it here.
|
||||
*/
|
||||
|
||||
#define ELF_HWCAP (0)
|
||||
|
||||
/*
|
||||
* This yields a string that ld.so will use to load implementation
|
||||
* specific libraries for optimization. This is more specific in
|
||||
* intent than poking at uname or /proc/cpuinfo.
|
||||
* For the moment, we have only optimizations for the Intel generations,
|
||||
* but that could change...
|
||||
*/
|
||||
|
||||
#define ELF_PLATFORM (NULL)
|
||||
|
||||
/*
|
||||
* The Xtensa processor ABI says that when the program starts, a2
|
||||
* contains a pointer to a function which might be registered using
|
||||
* `atexit'. This provides a mean for the dynamic linker to call
|
||||
* DT_FINI functions for shared libraries that have been loaded before
|
||||
* the code runs.
|
||||
*
|
||||
* A value of 0 tells we have no such handler.
|
||||
*
|
||||
* We might as well make sure everything else is cleared too (except
|
||||
* for the stack pointer in a1), just to make things more
|
||||
* deterministic. Also, clearing a0 terminates debugger backtraces.
|
||||
*/
|
||||
|
||||
#define ELF_PLAT_INIT(_r, load_addr) \
|
||||
do { _r->areg[0]=0; /*_r->areg[1]=0;*/ _r->areg[2]=0; _r->areg[3]=0; \
|
||||
_r->areg[4]=0; _r->areg[5]=0; _r->areg[6]=0; _r->areg[7]=0; \
|
||||
_r->areg[8]=0; _r->areg[9]=0; _r->areg[10]=0; _r->areg[11]=0; \
|
||||
_r->areg[12]=0; _r->areg[13]=0; _r->areg[14]=0; _r->areg[15]=0; \
|
||||
} while (0)
|
||||
|
||||
typedef struct {
|
||||
xtregs_opt_t opt;
|
||||
xtregs_user_t user;
|
||||
#if XTENSA_HAVE_COPROCESSORS
|
||||
xtregs_cp0_t cp0;
|
||||
xtregs_cp1_t cp1;
|
||||
xtregs_cp2_t cp2;
|
||||
xtregs_cp3_t cp3;
|
||||
xtregs_cp4_t cp4;
|
||||
xtregs_cp5_t cp5;
|
||||
xtregs_cp6_t cp6;
|
||||
xtregs_cp7_t cp7;
|
||||
#endif
|
||||
} elf_xtregs_t;
|
||||
|
||||
#define SET_PERSONALITY(ex) \
|
||||
set_personality(PER_LINUX_32BIT | (current->personality & (~PER_MASK)))
|
||||
|
||||
struct task_struct;
|
||||
|
||||
extern void do_copy_regs (xtensa_gregset_t*, struct pt_regs*,
|
||||
struct task_struct*);
|
||||
extern void do_restore_regs (xtensa_gregset_t*, struct pt_regs*,
|
||||
struct task_struct*);
|
||||
extern void do_save_fpregs (elf_fpregset_t*, struct pt_regs*,
|
||||
struct task_struct*);
|
||||
extern int do_restore_fpregs (elf_fpregset_t*, struct pt_regs*,
|
||||
struct task_struct*);
|
||||
|
||||
#endif /* _XTENSA_ELF_H */
|
12
arch/xtensa/include/asm/fb.h
Normal file
12
arch/xtensa/include/asm/fb.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
#ifndef _ASM_FB_H_
|
||||
#define _ASM_FB_H_
|
||||
#include <linux/fb.h>
|
||||
|
||||
#define fb_pgprotect(...) do {} while (0)
|
||||
|
||||
static inline int fb_is_primary_device(struct fb_info *info)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* _ASM_FB_H_ */
|
80
arch/xtensa/include/asm/fixmap.h
Normal file
80
arch/xtensa/include/asm/fixmap.h
Normal file
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* fixmap.h: compile-time virtual memory allocation
|
||||
*
|
||||
* 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) 1998 Ingo Molnar
|
||||
*
|
||||
* Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
|
||||
*/
|
||||
|
||||
#ifndef _ASM_FIXMAP_H
|
||||
#define _ASM_FIXMAP_H
|
||||
|
||||
#include <asm/pgtable.h>
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
#include <linux/threads.h>
|
||||
#include <asm/kmap_types.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Here we define all the compile-time 'special' virtual
|
||||
* addresses. The point is to have a constant address at
|
||||
* compile time, but to set the physical address only
|
||||
* in the boot process. We allocate these special addresses
|
||||
* from the start of the consistent memory region upwards.
|
||||
* Also this lets us do fail-safe vmalloc(), we
|
||||
* can guarantee that these special addresses and
|
||||
* vmalloc()-ed addresses never overlap.
|
||||
*
|
||||
* these 'compile-time allocated' memory buffers are
|
||||
* fixed-size 4k pages. (or larger if used with an increment
|
||||
* higher than 1) use fixmap_set(idx,phys) to associate
|
||||
* physical memory with fixmap indices.
|
||||
*/
|
||||
enum fixed_addresses {
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
/* reserved pte's for temporary kernel mappings */
|
||||
FIX_KMAP_BEGIN,
|
||||
FIX_KMAP_END = FIX_KMAP_BEGIN +
|
||||
(KM_TYPE_NR * NR_CPUS * DCACHE_N_COLORS) - 1,
|
||||
#endif
|
||||
__end_of_fixed_addresses
|
||||
};
|
||||
|
||||
#define FIXADDR_TOP (VMALLOC_START - PAGE_SIZE)
|
||||
#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
|
||||
#define FIXADDR_START ((FIXADDR_TOP - FIXADDR_SIZE) & PMD_MASK)
|
||||
|
||||
#define __fix_to_virt(x) (FIXADDR_START + ((x) << PAGE_SHIFT))
|
||||
#define __virt_to_fix(x) (((x) - FIXADDR_START) >> PAGE_SHIFT)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
/*
|
||||
* 'index to address' translation. If anyone tries to use the idx
|
||||
* directly without translation, we catch the bug with a NULL-deference
|
||||
* kernel oops. Illegal ranges of incoming indices are caught too.
|
||||
*/
|
||||
static __always_inline unsigned long fix_to_virt(const unsigned int idx)
|
||||
{
|
||||
BUILD_BUG_ON(idx >= __end_of_fixed_addresses);
|
||||
return __fix_to_virt(idx);
|
||||
}
|
||||
|
||||
static inline unsigned long virt_to_fix(const unsigned long vaddr)
|
||||
{
|
||||
BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
|
||||
return __virt_to_fix(vaddr);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#define kmap_get_fixmap_pte(vaddr) \
|
||||
pte_offset_kernel( \
|
||||
pmd_offset(pud_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)), \
|
||||
(vaddr) \
|
||||
)
|
||||
|
||||
#endif
|
12
arch/xtensa/include/asm/flat.h
Normal file
12
arch/xtensa/include/asm/flat.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
#ifndef __ASM_XTENSA_FLAT_H
|
||||
#define __ASM_XTENSA_FLAT_H
|
||||
|
||||
#define flat_argvp_envp_on_stack() 0
|
||||
#define flat_old_ram_flag(flags) (flags)
|
||||
#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
|
||||
#define flat_get_addr_from_rp(rp, relval, flags, p) get_unaligned(rp)
|
||||
#define flat_put_addr_at_rp(rp, val, relval ) put_unaligned(val, rp)
|
||||
#define flat_get_relocate_addr(rel) (rel)
|
||||
#define flat_set_persistent(relval, p) 0
|
||||
|
||||
#endif /* __ASM_XTENSA_FLAT_H */
|
40
arch/xtensa/include/asm/ftrace.h
Normal file
40
arch/xtensa/include/asm/ftrace.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* arch/xtensa/include/asm/ftrace.h
|
||||
*
|
||||
* 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) 2013 Tensilica Inc.
|
||||
*/
|
||||
#ifndef _XTENSA_FTRACE_H
|
||||
#define _XTENSA_FTRACE_H
|
||||
|
||||
#include <asm/processor.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#define ftrace_return_address0 ({ unsigned long a0, a1; \
|
||||
__asm__ __volatile__ ( \
|
||||
"mov %0, a0\n" \
|
||||
"mov %1, a1\n" \
|
||||
: "=r"(a0), "=r"(a1)); \
|
||||
MAKE_PC_FROM_RA(a0, a1); })
|
||||
|
||||
#ifdef CONFIG_FRAME_POINTER
|
||||
extern unsigned long return_address(unsigned level);
|
||||
#define ftrace_return_address(n) return_address(n)
|
||||
#endif
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#ifdef CONFIG_FUNCTION_TRACER
|
||||
|
||||
#define MCOUNT_ADDR ((unsigned long)(_mcount))
|
||||
#define MCOUNT_INSN_SIZE 3
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
extern void _mcount(void);
|
||||
#define mcount _mcount
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* CONFIG_FUNCTION_TRACER */
|
||||
|
||||
#endif /* _XTENSA_FTRACE_H */
|
147
arch/xtensa/include/asm/futex.h
Normal file
147
arch/xtensa/include/asm/futex.h
Normal file
|
@ -0,0 +1,147 @@
|
|||
/*
|
||||
* Atomic futex routines
|
||||
*
|
||||
* Based on the PowerPC implementataion
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Copyright (C) 2013 TangoTec Ltd.
|
||||
*
|
||||
* Baruch Siach <baruch@tkos.co.il>
|
||||
*/
|
||||
|
||||
#ifndef _ASM_XTENSA_FUTEX_H
|
||||
#define _ASM_XTENSA_FUTEX_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/futex.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/errno.h>
|
||||
|
||||
#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \
|
||||
__asm__ __volatile( \
|
||||
"1: l32i %0, %2, 0\n" \
|
||||
insn "\n" \
|
||||
" wsr %0, scompare1\n" \
|
||||
"2: s32c1i %1, %2, 0\n" \
|
||||
" bne %1, %0, 1b\n" \
|
||||
" movi %1, 0\n" \
|
||||
"3:\n" \
|
||||
" .section .fixup,\"ax\"\n" \
|
||||
" .align 4\n" \
|
||||
"4: .long 3b\n" \
|
||||
"5: l32r %0, 4b\n" \
|
||||
" movi %1, %3\n" \
|
||||
" jx %0\n" \
|
||||
" .previous\n" \
|
||||
" .section __ex_table,\"a\"\n" \
|
||||
" .long 1b,5b,2b,5b\n" \
|
||||
" .previous\n" \
|
||||
: "=&r" (oldval), "=&r" (ret) \
|
||||
: "r" (uaddr), "I" (-EFAULT), "r" (oparg) \
|
||||
: "memory")
|
||||
|
||||
static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr)
|
||||
{
|
||||
int op = (encoded_op >> 28) & 7;
|
||||
int cmp = (encoded_op >> 24) & 15;
|
||||
int oparg = (encoded_op << 8) >> 20;
|
||||
int cmparg = (encoded_op << 20) >> 20;
|
||||
int oldval = 0, ret;
|
||||
if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
|
||||
oparg = 1 << oparg;
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
|
||||
return -EFAULT;
|
||||
|
||||
#if !XCHAL_HAVE_S32C1I
|
||||
return -ENOSYS;
|
||||
#endif
|
||||
|
||||
pagefault_disable();
|
||||
|
||||
switch (op) {
|
||||
case FUTEX_OP_SET:
|
||||
__futex_atomic_op("mov %1, %4", ret, oldval, uaddr, oparg);
|
||||
break;
|
||||
case FUTEX_OP_ADD:
|
||||
__futex_atomic_op("add %1, %0, %4", ret, oldval, uaddr,
|
||||
oparg);
|
||||
break;
|
||||
case FUTEX_OP_OR:
|
||||
__futex_atomic_op("or %1, %0, %4", ret, oldval, uaddr,
|
||||
oparg);
|
||||
break;
|
||||
case FUTEX_OP_ANDN:
|
||||
__futex_atomic_op("and %1, %0, %4", ret, oldval, uaddr,
|
||||
~oparg);
|
||||
break;
|
||||
case FUTEX_OP_XOR:
|
||||
__futex_atomic_op("xor %1, %0, %4", ret, oldval, uaddr,
|
||||
oparg);
|
||||
break;
|
||||
default:
|
||||
ret = -ENOSYS;
|
||||
}
|
||||
|
||||
pagefault_enable();
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
switch (cmp) {
|
||||
case FUTEX_OP_CMP_EQ: return (oldval == cmparg);
|
||||
case FUTEX_OP_CMP_NE: return (oldval != cmparg);
|
||||
case FUTEX_OP_CMP_LT: return (oldval < cmparg);
|
||||
case FUTEX_OP_CMP_GE: return (oldval >= cmparg);
|
||||
case FUTEX_OP_CMP_LE: return (oldval <= cmparg);
|
||||
case FUTEX_OP_CMP_GT: return (oldval > cmparg);
|
||||
}
|
||||
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
static inline int
|
||||
futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
|
||||
u32 oldval, u32 newval)
|
||||
{
|
||||
int ret = 0;
|
||||
u32 prev;
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
|
||||
return -EFAULT;
|
||||
|
||||
#if !XCHAL_HAVE_S32C1I
|
||||
return -ENOSYS;
|
||||
#endif
|
||||
|
||||
__asm__ __volatile__ (
|
||||
" # futex_atomic_cmpxchg_inatomic\n"
|
||||
"1: l32i %1, %3, 0\n"
|
||||
" mov %0, %5\n"
|
||||
" wsr %1, scompare1\n"
|
||||
"2: s32c1i %0, %3, 0\n"
|
||||
"3:\n"
|
||||
" .section .fixup,\"ax\"\n"
|
||||
" .align 4\n"
|
||||
"4: .long 3b\n"
|
||||
"5: l32r %1, 4b\n"
|
||||
" movi %0, %6\n"
|
||||
" jx %1\n"
|
||||
" .previous\n"
|
||||
" .section __ex_table,\"a\"\n"
|
||||
" .long 1b,5b,2b,5b\n"
|
||||
" .previous\n"
|
||||
: "+r" (ret), "=&r" (prev), "+m" (*uaddr)
|
||||
: "r" (uaddr), "r" (oldval), "r" (newval), "I" (-EFAULT)
|
||||
: "memory");
|
||||
|
||||
*uval = prev;
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _ASM_XTENSA_FUTEX_H */
|
4
arch/xtensa/include/asm/gpio.h
Normal file
4
arch/xtensa/include/asm/gpio.h
Normal file
|
@ -0,0 +1,4 @@
|
|||
#ifndef __LINUX_GPIO_H
|
||||
#warning Include linux/gpio.h instead of asm/gpio.h
|
||||
#include <linux/gpio.h>
|
||||
#endif
|
95
arch/xtensa/include/asm/highmem.h
Normal file
95
arch/xtensa/include/asm/highmem.h
Normal file
|
@ -0,0 +1,95 @@
|
|||
/*
|
||||
* include/asm-xtensa/highmem.h
|
||||
*
|
||||
* 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 - 2005 Tensilica Inc.
|
||||
* Copyright (C) 2014 Cadence Design Systems Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_HIGHMEM_H
|
||||
#define _XTENSA_HIGHMEM_H
|
||||
|
||||
#include <linux/wait.h>
|
||||
#include <asm/cacheflush.h>
|
||||
#include <asm/fixmap.h>
|
||||
#include <asm/kmap_types.h>
|
||||
#include <asm/pgtable.h>
|
||||
|
||||
#define PKMAP_BASE ((FIXADDR_START - \
|
||||
(LAST_PKMAP + 1) * PAGE_SIZE) & PMD_MASK)
|
||||
#define LAST_PKMAP (PTRS_PER_PTE * DCACHE_N_COLORS)
|
||||
#define LAST_PKMAP_MASK (LAST_PKMAP - 1)
|
||||
#define PKMAP_NR(virt) (((virt) - PKMAP_BASE) >> PAGE_SHIFT)
|
||||
#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
|
||||
|
||||
#define kmap_prot PAGE_KERNEL_EXEC
|
||||
|
||||
#if DCACHE_WAY_SIZE > PAGE_SIZE
|
||||
#define get_pkmap_color get_pkmap_color
|
||||
static inline int get_pkmap_color(struct page *page)
|
||||
{
|
||||
return DCACHE_ALIAS(page_to_phys(page));
|
||||
}
|
||||
|
||||
extern unsigned int last_pkmap_nr_arr[];
|
||||
|
||||
static inline unsigned int get_next_pkmap_nr(unsigned int color)
|
||||
{
|
||||
last_pkmap_nr_arr[color] =
|
||||
(last_pkmap_nr_arr[color] + DCACHE_N_COLORS) & LAST_PKMAP_MASK;
|
||||
return last_pkmap_nr_arr[color] + color;
|
||||
}
|
||||
|
||||
static inline int no_more_pkmaps(unsigned int pkmap_nr, unsigned int color)
|
||||
{
|
||||
return pkmap_nr < DCACHE_N_COLORS;
|
||||
}
|
||||
|
||||
static inline int get_pkmap_entries_count(unsigned int color)
|
||||
{
|
||||
return LAST_PKMAP / DCACHE_N_COLORS;
|
||||
}
|
||||
|
||||
extern wait_queue_head_t pkmap_map_wait_arr[];
|
||||
|
||||
static inline wait_queue_head_t *get_pkmap_wait_queue_head(unsigned int color)
|
||||
{
|
||||
return pkmap_map_wait_arr + color;
|
||||
}
|
||||
#endif
|
||||
|
||||
extern pte_t *pkmap_page_table;
|
||||
|
||||
void *kmap_high(struct page *page);
|
||||
void kunmap_high(struct page *page);
|
||||
|
||||
static inline void *kmap(struct page *page)
|
||||
{
|
||||
BUG_ON(in_interrupt());
|
||||
if (!PageHighMem(page))
|
||||
return page_address(page);
|
||||
return kmap_high(page);
|
||||
}
|
||||
|
||||
static inline void kunmap(struct page *page)
|
||||
{
|
||||
BUG_ON(in_interrupt());
|
||||
if (!PageHighMem(page))
|
||||
return;
|
||||
kunmap_high(page);
|
||||
}
|
||||
|
||||
static inline void flush_cache_kmaps(void)
|
||||
{
|
||||
flush_cache_all();
|
||||
}
|
||||
|
||||
void *kmap_atomic(struct page *page);
|
||||
void __kunmap_atomic(void *kvaddr);
|
||||
|
||||
void kmap_init(void);
|
||||
|
||||
#endif
|
14
arch/xtensa/include/asm/hw_irq.h
Normal file
14
arch/xtensa/include/asm/hw_irq.h
Normal file
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* include/asm-xtensa/hw_irq.h
|
||||
*
|
||||
* 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) 2002 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_HW_IRQ_H
|
||||
#define _XTENSA_HW_IRQ_H
|
||||
|
||||
#endif
|
163
arch/xtensa/include/asm/initialize_mmu.h
Normal file
163
arch/xtensa/include/asm/initialize_mmu.h
Normal file
|
@ -0,0 +1,163 @@
|
|||
/*
|
||||
* arch/xtensa/include/asm/initialize_mmu.h
|
||||
*
|
||||
* Initializes MMU:
|
||||
*
|
||||
* For the new V3 MMU we remap the TLB from virtual == physical
|
||||
* to the standard Linux mapping used in earlier MMU's.
|
||||
*
|
||||
* The the MMU we also support a new configuration register that
|
||||
* specifies how the S32C1I instruction operates with the cache
|
||||
* controller.
|
||||
*
|
||||
* 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 - 2012 Tensilica, Inc.
|
||||
*
|
||||
* Marc Gauthier <marc@tensilica.com>
|
||||
* Pete Delaney <piet@tensilica.com>
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_INITIALIZE_MMU_H
|
||||
#define _XTENSA_INITIALIZE_MMU_H
|
||||
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/vectors.h>
|
||||
|
||||
#define CA_BYPASS (_PAGE_CA_BYPASS | _PAGE_HW_WRITE | _PAGE_HW_EXEC)
|
||||
#define CA_WRITEBACK (_PAGE_CA_WB | _PAGE_HW_WRITE | _PAGE_HW_EXEC)
|
||||
|
||||
#ifdef __ASSEMBLY__
|
||||
|
||||
#define XTENSA_HWVERSION_RC_2009_0 230000
|
||||
|
||||
.macro initialize_mmu
|
||||
|
||||
#if XCHAL_HAVE_S32C1I && (XCHAL_HW_MIN_VERSION >= XTENSA_HWVERSION_RC_2009_0)
|
||||
/*
|
||||
* We Have Atomic Operation Control (ATOMCTL) Register; Initialize it.
|
||||
* For details see Documentation/xtensa/atomctl.txt
|
||||
*/
|
||||
#if XCHAL_DCACHE_IS_COHERENT
|
||||
movi a3, 0x25 /* For SMP/MX -- internal for writeback,
|
||||
* RCW otherwise
|
||||
*/
|
||||
#else
|
||||
movi a3, 0x29 /* non-MX -- Most cores use Std Memory
|
||||
* Controlers which usually can't use RCW
|
||||
*/
|
||||
#endif
|
||||
wsr a3, atomctl
|
||||
#endif /* XCHAL_HAVE_S32C1I &&
|
||||
* (XCHAL_HW_MIN_VERSION >= XTENSA_HWVERSION_RC_2009_0)
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_MMU) && XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY
|
||||
/*
|
||||
* Have MMU v3
|
||||
*/
|
||||
|
||||
#if !XCHAL_HAVE_VECBASE
|
||||
# error "MMU v3 requires reloc vectors"
|
||||
#endif
|
||||
|
||||
movi a1, 0
|
||||
_call0 1f
|
||||
_j 2f
|
||||
|
||||
.align 4
|
||||
1: movi a2, 0x10000000
|
||||
movi a3, 0x18000000
|
||||
add a2, a2, a0
|
||||
9: bgeu a2, a3, 9b /* PC is out of the expected range */
|
||||
|
||||
/* Step 1: invalidate mapping at 0x40000000..0x5FFFFFFF. */
|
||||
|
||||
movi a2, 0x40000006
|
||||
idtlb a2
|
||||
iitlb a2
|
||||
isync
|
||||
|
||||
/* Step 2: map 0x40000000..0x47FFFFFF to paddr containing this code
|
||||
* and jump to the new mapping.
|
||||
*/
|
||||
|
||||
srli a3, a0, 27
|
||||
slli a3, a3, 27
|
||||
addi a3, a3, CA_BYPASS
|
||||
addi a7, a2, -1
|
||||
wdtlb a3, a7
|
||||
witlb a3, a7
|
||||
isync
|
||||
|
||||
slli a4, a0, 5
|
||||
srli a4, a4, 5
|
||||
addi a5, a2, -6
|
||||
add a4, a4, a5
|
||||
jx a4
|
||||
|
||||
/* Step 3: unmap everything other than current area.
|
||||
* Start at 0x60000000, wrap around, and end with 0x20000000
|
||||
*/
|
||||
2: movi a4, 0x20000000
|
||||
add a5, a2, a4
|
||||
3: idtlb a5
|
||||
iitlb a5
|
||||
add a5, a5, a4
|
||||
bne a5, a2, 3b
|
||||
|
||||
/* Step 4: Setup MMU with the old V2 mappings. */
|
||||
movi a6, 0x01000000
|
||||
wsr a6, ITLBCFG
|
||||
wsr a6, DTLBCFG
|
||||
isync
|
||||
|
||||
movi a5, 0xd0000005
|
||||
movi a4, CA_WRITEBACK
|
||||
wdtlb a4, a5
|
||||
witlb a4, a5
|
||||
|
||||
movi a5, 0xd8000005
|
||||
movi a4, CA_BYPASS
|
||||
wdtlb a4, a5
|
||||
witlb a4, a5
|
||||
|
||||
movi a5, XCHAL_KIO_CACHED_VADDR + 6
|
||||
movi a4, XCHAL_KIO_DEFAULT_PADDR + CA_WRITEBACK
|
||||
wdtlb a4, a5
|
||||
witlb a4, a5
|
||||
|
||||
movi a5, XCHAL_KIO_BYPASS_VADDR + 6
|
||||
movi a4, XCHAL_KIO_DEFAULT_PADDR + CA_BYPASS
|
||||
wdtlb a4, a5
|
||||
witlb a4, a5
|
||||
|
||||
isync
|
||||
|
||||
/* Jump to self, using MMU v2 mappings. */
|
||||
movi a4, 1f
|
||||
jx a4
|
||||
|
||||
1:
|
||||
movi a2, VECBASE_RESET_VADDR
|
||||
wsr a2, vecbase
|
||||
|
||||
/* Step 5: remove temporary mapping. */
|
||||
idtlb a7
|
||||
iitlb a7
|
||||
isync
|
||||
|
||||
movi a0, 0
|
||||
wsr a0, ptevaddr
|
||||
rsync
|
||||
|
||||
#endif /* defined(CONFIG_MMU) && XCHAL_HAVE_PTP_MMU &&
|
||||
XCHAL_HAVE_SPANNING_WAY */
|
||||
|
||||
.endm
|
||||
|
||||
#endif /*__ASSEMBLY__*/
|
||||
|
||||
#endif /* _XTENSA_INITIALIZE_MMU_H */
|
88
arch/xtensa/include/asm/io.h
Normal file
88
arch/xtensa/include/asm/io.h
Normal file
|
@ -0,0 +1,88 @@
|
|||
/*
|
||||
* include/asm-xtensa/io.h
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_IO_H
|
||||
#define _XTENSA_IO_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <asm/byteorder.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/vectors.h>
|
||||
#include <linux/bug.h>
|
||||
#include <linux/kernel.h>
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define IOADDR(x) (XCHAL_KIO_BYPASS_VADDR + (x))
|
||||
#define IO_SPACE_LIMIT ~0
|
||||
|
||||
#ifdef CONFIG_MMU
|
||||
|
||||
#if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && defined(CONFIG_OF)
|
||||
extern unsigned long xtensa_kio_paddr;
|
||||
|
||||
static inline unsigned long xtensa_get_kio_paddr(void)
|
||||
{
|
||||
return xtensa_kio_paddr;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Return the virtual address for the specified bus memory.
|
||||
* Note that we currently don't support any address outside the KIO segment.
|
||||
*/
|
||||
static inline void __iomem *ioremap_nocache(unsigned long offset,
|
||||
unsigned long size)
|
||||
{
|
||||
if (offset >= XCHAL_KIO_PADDR
|
||||
&& offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE)
|
||||
return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_BYPASS_VADDR);
|
||||
else
|
||||
BUG();
|
||||
}
|
||||
|
||||
static inline void __iomem *ioremap_cache(unsigned long offset,
|
||||
unsigned long size)
|
||||
{
|
||||
if (offset >= XCHAL_KIO_PADDR
|
||||
&& offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE)
|
||||
return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_CACHED_VADDR);
|
||||
else
|
||||
BUG();
|
||||
}
|
||||
|
||||
#define ioremap_wc ioremap_nocache
|
||||
|
||||
static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
|
||||
{
|
||||
return ioremap_nocache(offset, size);
|
||||
}
|
||||
|
||||
static inline void iounmap(volatile void __iomem *addr)
|
||||
{
|
||||
}
|
||||
|
||||
#define virt_to_bus virt_to_phys
|
||||
#define bus_to_virt phys_to_virt
|
||||
|
||||
#endif /* CONFIG_MMU */
|
||||
|
||||
/*
|
||||
* Generic I/O
|
||||
*/
|
||||
#define readb_relaxed readb
|
||||
#define readw_relaxed readw
|
||||
#define readl_relaxed readl
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#include <asm-generic/io.h>
|
||||
|
||||
#endif /* _XTENSA_IO_H */
|
56
arch/xtensa/include/asm/irq.h
Normal file
56
arch/xtensa/include/asm/irq.h
Normal file
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* include/asm-xtensa/irq.h
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_IRQ_H
|
||||
#define _XTENSA_IRQ_H
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <platform/hardware.h>
|
||||
#include <variant/core.h>
|
||||
|
||||
#ifdef CONFIG_VARIANT_IRQ_SWITCH
|
||||
#include <variant/irq.h>
|
||||
#else
|
||||
static inline void variant_irq_enable(unsigned int irq) { }
|
||||
static inline void variant_irq_disable(unsigned int irq) { }
|
||||
#endif
|
||||
|
||||
#ifndef VARIANT_NR_IRQS
|
||||
# define VARIANT_NR_IRQS 0
|
||||
#endif
|
||||
#ifndef PLATFORM_NR_IRQS
|
||||
# define PLATFORM_NR_IRQS 0
|
||||
#endif
|
||||
#define XTENSA_NR_IRQS XCHAL_NUM_INTERRUPTS
|
||||
#define NR_IRQS (XTENSA_NR_IRQS + VARIANT_NR_IRQS + PLATFORM_NR_IRQS)
|
||||
|
||||
#if VARIANT_NR_IRQS == 0
|
||||
static inline void variant_init_irq(void) { }
|
||||
#else
|
||||
void variant_init_irq(void) __init;
|
||||
#endif
|
||||
|
||||
static __inline__ int irq_canonicalize(int irq)
|
||||
{
|
||||
return (irq);
|
||||
}
|
||||
|
||||
struct irqaction;
|
||||
struct irq_domain;
|
||||
|
||||
void migrate_irqs(void);
|
||||
int xtensa_irq_domain_xlate(const u32 *intspec, unsigned int intsize,
|
||||
unsigned long int_irq, unsigned long ext_irq,
|
||||
unsigned long *out_hwirq, unsigned int *out_type);
|
||||
int xtensa_irq_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw);
|
||||
unsigned xtensa_map_ext_irq(unsigned ext_irq);
|
||||
unsigned xtensa_get_ext_irq_no(unsigned irq);
|
||||
|
||||
#endif /* _XTENSA_IRQ_H */
|
61
arch/xtensa/include/asm/irqflags.h
Normal file
61
arch/xtensa/include/asm/irqflags.h
Normal file
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* Xtensa IRQ flags handling functions
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_IRQFLAGS_H
|
||||
#define _XTENSA_IRQFLAGS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
static inline unsigned long arch_local_save_flags(void)
|
||||
{
|
||||
unsigned long flags;
|
||||
asm volatile("rsr %0, ps" : "=a" (flags));
|
||||
return flags;
|
||||
}
|
||||
|
||||
static inline unsigned long arch_local_irq_save(void)
|
||||
{
|
||||
unsigned long flags;
|
||||
asm volatile("rsil %0, "__stringify(LOCKLEVEL)
|
||||
: "=a" (flags) :: "memory");
|
||||
return flags;
|
||||
}
|
||||
|
||||
static inline void arch_local_irq_disable(void)
|
||||
{
|
||||
arch_local_irq_save();
|
||||
}
|
||||
|
||||
static inline void arch_local_irq_enable(void)
|
||||
{
|
||||
unsigned long flags;
|
||||
asm volatile("rsil %0, 0" : "=a" (flags) :: "memory");
|
||||
}
|
||||
|
||||
static inline void arch_local_irq_restore(unsigned long flags)
|
||||
{
|
||||
asm volatile("wsr %0, ps; rsync"
|
||||
:: "a" (flags) : "memory");
|
||||
}
|
||||
|
||||
static inline bool arch_irqs_disabled_flags(unsigned long flags)
|
||||
{
|
||||
#if XCHAL_EXCM_LEVEL < LOCKLEVEL || (1 << PS_EXCM_BIT) < LOCKLEVEL
|
||||
#error "XCHAL_EXCM_LEVEL and 1<<PS_EXCM_BIT must be no less than LOCKLEVEL"
|
||||
#endif
|
||||
return (flags & (PS_INTLEVEL_MASK | (1 << PS_EXCM_BIT))) >= LOCKLEVEL;
|
||||
}
|
||||
|
||||
static inline bool arch_irqs_disabled(void)
|
||||
{
|
||||
return arch_irqs_disabled_flags(arch_local_save_flags());
|
||||
}
|
||||
|
||||
#endif /* _XTENSA_IRQFLAGS_H */
|
22
arch/xtensa/include/asm/mmu.h
Normal file
22
arch/xtensa/include/asm/mmu.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* 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) 2001 - 2013 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_MMU_H
|
||||
#define _XTENSA_MMU_H
|
||||
|
||||
#ifndef CONFIG_MMU
|
||||
#include <asm-generic/mmu.h>
|
||||
#else
|
||||
|
||||
typedef struct {
|
||||
unsigned long asid[NR_CPUS];
|
||||
unsigned int cpu;
|
||||
} mm_context_t;
|
||||
|
||||
#endif /* CONFIG_MMU */
|
||||
#endif /* _XTENSA_MMU_H */
|
161
arch/xtensa/include/asm/mmu_context.h
Normal file
161
arch/xtensa/include/asm/mmu_context.h
Normal file
|
@ -0,0 +1,161 @@
|
|||
/*
|
||||
* Switch an MMU context.
|
||||
*
|
||||
* 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) 2001 - 2013 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_MMU_CONTEXT_H
|
||||
#define _XTENSA_MMU_CONTEXT_H
|
||||
|
||||
#ifndef CONFIG_MMU
|
||||
#include <asm/nommu_context.h>
|
||||
#else
|
||||
|
||||
#include <linux/stringify.h>
|
||||
#include <linux/sched.h>
|
||||
|
||||
#include <asm/vectors.h>
|
||||
|
||||
#include <asm/pgtable.h>
|
||||
#include <asm/cacheflush.h>
|
||||
#include <asm/tlbflush.h>
|
||||
#include <asm-generic/mm_hooks.h>
|
||||
#include <asm-generic/percpu.h>
|
||||
|
||||
#if (XCHAL_HAVE_TLBS != 1)
|
||||
# error "Linux must have an MMU!"
|
||||
#endif
|
||||
|
||||
DECLARE_PER_CPU(unsigned long, asid_cache);
|
||||
#define cpu_asid_cache(cpu) per_cpu(asid_cache, cpu)
|
||||
|
||||
/*
|
||||
* NO_CONTEXT is the invalid ASID value that we don't ever assign to
|
||||
* any user or kernel context. We use the reserved values in the
|
||||
* ASID_INSERT macro below.
|
||||
*
|
||||
* 0 invalid
|
||||
* 1 kernel
|
||||
* 2 reserved
|
||||
* 3 reserved
|
||||
* 4...255 available
|
||||
*/
|
||||
|
||||
#define NO_CONTEXT 0
|
||||
#define ASID_USER_FIRST 4
|
||||
#define ASID_MASK ((1 << XCHAL_MMU_ASID_BITS) - 1)
|
||||
#define ASID_INSERT(x) (0x03020001 | (((x) & ASID_MASK) << 8))
|
||||
|
||||
#ifdef CONFIG_MMU
|
||||
void init_mmu(void);
|
||||
#else
|
||||
static inline void init_mmu(void) { }
|
||||
#endif
|
||||
|
||||
static inline void set_rasid_register (unsigned long val)
|
||||
{
|
||||
__asm__ __volatile__ (" wsr %0, rasid\n\t"
|
||||
" isync\n" : : "a" (val));
|
||||
}
|
||||
|
||||
static inline unsigned long get_rasid_register (void)
|
||||
{
|
||||
unsigned long tmp;
|
||||
__asm__ __volatile__ (" rsr %0, rasid\n\t" : "=a" (tmp));
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void get_new_mmu_context(struct mm_struct *mm, unsigned int cpu)
|
||||
{
|
||||
unsigned long asid = cpu_asid_cache(cpu);
|
||||
if ((++asid & ASID_MASK) == 0) {
|
||||
/*
|
||||
* Start new asid cycle; continue counting with next
|
||||
* incarnation bits; skipping over 0, 1, 2, 3.
|
||||
*/
|
||||
local_flush_tlb_all();
|
||||
asid += ASID_USER_FIRST;
|
||||
}
|
||||
cpu_asid_cache(cpu) = asid;
|
||||
mm->context.asid[cpu] = asid;
|
||||
mm->context.cpu = cpu;
|
||||
}
|
||||
|
||||
static inline void get_mmu_context(struct mm_struct *mm, unsigned int cpu)
|
||||
{
|
||||
/*
|
||||
* Check if our ASID is of an older version and thus invalid.
|
||||
*/
|
||||
|
||||
if (mm) {
|
||||
unsigned long asid = mm->context.asid[cpu];
|
||||
|
||||
if (asid == NO_CONTEXT ||
|
||||
((asid ^ cpu_asid_cache(cpu)) & ~ASID_MASK))
|
||||
get_new_mmu_context(mm, cpu);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void activate_context(struct mm_struct *mm, unsigned int cpu)
|
||||
{
|
||||
get_mmu_context(mm, cpu);
|
||||
set_rasid_register(ASID_INSERT(mm->context.asid[cpu]));
|
||||
invalidate_page_directory();
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize the context related info for a new mm_struct
|
||||
* instance. Valid cpu values are 0..(NR_CPUS-1), so initializing
|
||||
* to -1 says the process has never run on any core.
|
||||
*/
|
||||
|
||||
static inline int init_new_context(struct task_struct *tsk,
|
||||
struct mm_struct *mm)
|
||||
{
|
||||
int cpu;
|
||||
for_each_possible_cpu(cpu) {
|
||||
mm->context.asid[cpu] = NO_CONTEXT;
|
||||
}
|
||||
mm->context.cpu = -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
|
||||
struct task_struct *tsk)
|
||||
{
|
||||
unsigned int cpu = smp_processor_id();
|
||||
int migrated = next->context.cpu != cpu;
|
||||
/* Flush the icache if we migrated to a new core. */
|
||||
if (migrated) {
|
||||
__invalidate_icache_all();
|
||||
next->context.cpu = cpu;
|
||||
}
|
||||
if (migrated || prev != next)
|
||||
activate_context(next, cpu);
|
||||
}
|
||||
|
||||
#define activate_mm(prev, next) switch_mm((prev), (next), NULL)
|
||||
#define deactivate_mm(tsk, mm) do { } while (0)
|
||||
|
||||
/*
|
||||
* Destroy context related info for an mm_struct that is about
|
||||
* to be put to rest.
|
||||
*/
|
||||
static inline void destroy_context(struct mm_struct *mm)
|
||||
{
|
||||
invalidate_page_directory();
|
||||
}
|
||||
|
||||
|
||||
static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
|
||||
{
|
||||
/* Nothing to do. */
|
||||
|
||||
}
|
||||
|
||||
#endif /* CONFIG_MMU */
|
||||
#endif /* _XTENSA_MMU_CONTEXT_H */
|
20
arch/xtensa/include/asm/module.h
Normal file
20
arch/xtensa/include/asm/module.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* include/asm-xtensa/module.h
|
||||
*
|
||||
* This file contains the module code specific to the Xtensa architecture.
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_MODULE_H
|
||||
#define _XTENSA_MODULE_H
|
||||
|
||||
#define MODULE_ARCH_VERMAGIC "xtensa-" __stringify(XCHAL_CORE_ID) " "
|
||||
|
||||
#include <asm-generic/module.h>
|
||||
|
||||
#endif /* _XTENSA_MODULE_H */
|
9
arch/xtensa/include/asm/mutex.h
Normal file
9
arch/xtensa/include/asm/mutex.h
Normal file
|
@ -0,0 +1,9 @@
|
|||
/*
|
||||
* Pull in the generic implementation for the mutex fastpath.
|
||||
*
|
||||
* TODO: implement optimized primitives instead, or leave the generic
|
||||
* implementation in place, or pick the atomic_xchg() based generic
|
||||
* implementation. (see asm-generic/mutex-xchg.h for details)
|
||||
*/
|
||||
|
||||
#include <asm-generic/mutex-dec.h>
|
46
arch/xtensa/include/asm/mxregs.h
Normal file
46
arch/xtensa/include/asm/mxregs.h
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Xtensa MX interrupt distributor
|
||||
*
|
||||
* 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 - 2013 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_MXREGS_H
|
||||
#define _XTENSA_MXREGS_H
|
||||
|
||||
/*
|
||||
* RER/WER at, as Read/write external register
|
||||
* at: value
|
||||
* as: address
|
||||
*
|
||||
* Address Value
|
||||
* 00nn 0...0p..p Interrupt Routing, route IRQ n to processor p
|
||||
* 01pp 0...0d..d 16 bits (d) 'ored' as single IPI to processor p
|
||||
* 0180 0...0m..m Clear enable specified by mask (m)
|
||||
* 0184 0...0m..m Set enable specified by mask (m)
|
||||
* 0190 0...0x..x 8-bit IPI partition register
|
||||
* VVVVVVVVPPPPUUUUUUUUUUUUUUUUU
|
||||
* V (10-bit) Release/Version
|
||||
* P ( 4-bit) Number of cores - 1
|
||||
* U (18-bit) ID
|
||||
* 01a0 i.......i 32-bit ConfigID
|
||||
* 0200 0...0m..m RunStall core 'n'
|
||||
* 0220 c Cache coherency enabled
|
||||
*/
|
||||
|
||||
#define MIROUT(irq) (0x000 + (irq))
|
||||
#define MIPICAUSE(cpu) (0x100 + (cpu))
|
||||
#define MIPISET(cause) (0x140 + (cause))
|
||||
#define MIENG 0x180
|
||||
#define MIENGSET 0x184
|
||||
#define MIASG 0x188 /* Read Global Assert Register */
|
||||
#define MIASGSET 0x18c /* Set Global Addert Regiter */
|
||||
#define MIPIPART 0x190
|
||||
#define SYSCFGID 0x1a0
|
||||
#define MPSCORE 0x200
|
||||
#define CCON 0x220
|
||||
|
||||
#endif /* _XTENSA_MXREGS_H */
|
25
arch/xtensa/include/asm/nommu_context.h
Normal file
25
arch/xtensa/include/asm/nommu_context.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int init_new_context(struct task_struct *tsk,struct mm_struct *mm)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void destroy_context(struct mm_struct *mm)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
|
||||
struct task_struct *tsk)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void deactivate_mm(struct task_struct *tsk, struct mm_struct *mm)
|
||||
{
|
||||
}
|
192
arch/xtensa/include/asm/page.h
Normal file
192
arch/xtensa/include/asm/page.h
Normal file
|
@ -0,0 +1,192 @@
|
|||
/*
|
||||
* include/asm-xtensa/page.h
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Copyright (C) 2001 - 2007 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_PAGE_H
|
||||
#define _XTENSA_PAGE_H
|
||||
|
||||
#include <asm/processor.h>
|
||||
#include <asm/types.h>
|
||||
#include <asm/cache.h>
|
||||
#include <platform/hardware.h>
|
||||
|
||||
/*
|
||||
* Fixed TLB translations in the processor.
|
||||
*/
|
||||
|
||||
#define XCHAL_KSEG_CACHED_VADDR 0xd0000000
|
||||
#define XCHAL_KSEG_BYPASS_VADDR 0xd8000000
|
||||
#define XCHAL_KSEG_PADDR 0x00000000
|
||||
#define XCHAL_KSEG_SIZE 0x08000000
|
||||
|
||||
/*
|
||||
* PAGE_SHIFT determines the page size
|
||||
*/
|
||||
|
||||
#define PAGE_SHIFT 12
|
||||
#define PAGE_SIZE (__XTENSA_UL_CONST(1) << PAGE_SHIFT)
|
||||
#define PAGE_MASK (~(PAGE_SIZE-1))
|
||||
|
||||
#ifdef CONFIG_MMU
|
||||
#define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR
|
||||
#define MAX_MEM_PFN XCHAL_KSEG_SIZE
|
||||
#else
|
||||
#define PAGE_OFFSET 0
|
||||
#define MAX_MEM_PFN (PLATFORM_DEFAULT_MEM_START + PLATFORM_DEFAULT_MEM_SIZE)
|
||||
#endif
|
||||
|
||||
#define PGTABLE_START 0x80000000
|
||||
|
||||
/*
|
||||
* Cache aliasing:
|
||||
*
|
||||
* If the cache size for one way is greater than the page size, we have to
|
||||
* deal with cache aliasing. The cache index is wider than the page size:
|
||||
*
|
||||
* | |cache| cache index
|
||||
* | pfn |off| virtual address
|
||||
* |xxxx:X|zzz|
|
||||
* | : | |
|
||||
* | \ / | |
|
||||
* |trans.| |
|
||||
* | / \ | |
|
||||
* |yyyy:Y|zzz| physical address
|
||||
*
|
||||
* When the page number is translated to the physical page address, the lowest
|
||||
* bit(s) (X) that are part of the cache index are also translated (Y).
|
||||
* If this translation changes bit(s) (X), the cache index is also afected,
|
||||
* thus resulting in a different cache line than before.
|
||||
* The kernel does not provide a mechanism to ensure that the page color
|
||||
* (represented by this bit) remains the same when allocated or when pages
|
||||
* are remapped. When user pages are mapped into kernel space, the color of
|
||||
* the page might also change.
|
||||
*
|
||||
* We use the address space VMALLOC_END ... VMALLOC_END + DCACHE_WAY_SIZE * 2
|
||||
* to temporarily map a patch so we can match the color.
|
||||
*/
|
||||
|
||||
#if DCACHE_WAY_SIZE > PAGE_SIZE
|
||||
# define DCACHE_ALIAS_ORDER (DCACHE_WAY_SHIFT - PAGE_SHIFT)
|
||||
# define DCACHE_ALIAS_MASK (PAGE_MASK & (DCACHE_WAY_SIZE - 1))
|
||||
# define DCACHE_ALIAS(a) (((a) & DCACHE_ALIAS_MASK) >> PAGE_SHIFT)
|
||||
# define DCACHE_ALIAS_EQ(a,b) ((((a) ^ (b)) & DCACHE_ALIAS_MASK) == 0)
|
||||
#else
|
||||
# define DCACHE_ALIAS_ORDER 0
|
||||
# define DCACHE_ALIAS(a) ((void)(a), 0)
|
||||
#endif
|
||||
#define DCACHE_N_COLORS (1 << DCACHE_ALIAS_ORDER)
|
||||
|
||||
#if ICACHE_WAY_SIZE > PAGE_SIZE
|
||||
# define ICACHE_ALIAS_ORDER (ICACHE_WAY_SHIFT - PAGE_SHIFT)
|
||||
# define ICACHE_ALIAS_MASK (PAGE_MASK & (ICACHE_WAY_SIZE - 1))
|
||||
# define ICACHE_ALIAS(a) (((a) & ICACHE_ALIAS_MASK) >> PAGE_SHIFT)
|
||||
# define ICACHE_ALIAS_EQ(a,b) ((((a) ^ (b)) & ICACHE_ALIAS_MASK) == 0)
|
||||
#else
|
||||
# define ICACHE_ALIAS_ORDER 0
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __ASSEMBLY__
|
||||
|
||||
#define __pgprot(x) (x)
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* These are used to make use of C type-checking..
|
||||
*/
|
||||
|
||||
typedef struct { unsigned long pte; } pte_t; /* page table entry */
|
||||
typedef struct { unsigned long pgd; } pgd_t; /* PGD table entry */
|
||||
typedef struct { unsigned long pgprot; } pgprot_t;
|
||||
typedef struct page *pgtable_t;
|
||||
|
||||
#define pte_val(x) ((x).pte)
|
||||
#define pgd_val(x) ((x).pgd)
|
||||
#define pgprot_val(x) ((x).pgprot)
|
||||
|
||||
#define __pte(x) ((pte_t) { (x) } )
|
||||
#define __pgd(x) ((pgd_t) { (x) } )
|
||||
#define __pgprot(x) ((pgprot_t) { (x) } )
|
||||
|
||||
/*
|
||||
* Pure 2^n version of get_order
|
||||
* Use 'nsau' instructions if supported by the processor or the generic version.
|
||||
*/
|
||||
|
||||
#if XCHAL_HAVE_NSA
|
||||
|
||||
static inline __attribute_const__ int get_order(unsigned long size)
|
||||
{
|
||||
int lz;
|
||||
asm ("nsau %0, %1" : "=r" (lz) : "r" ((size - 1) >> PAGE_SHIFT));
|
||||
return 32 - lz;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
# include <asm-generic/getorder.h>
|
||||
|
||||
#endif
|
||||
|
||||
struct page;
|
||||
struct vm_area_struct;
|
||||
extern void clear_page(void *page);
|
||||
extern void copy_page(void *to, void *from);
|
||||
|
||||
/*
|
||||
* If we have cache aliasing and writeback caches, we might have to do
|
||||
* some extra work
|
||||
*/
|
||||
|
||||
#if DCACHE_WAY_SIZE > PAGE_SIZE
|
||||
extern void clear_page_alias(void *vaddr, unsigned long paddr);
|
||||
extern void copy_page_alias(void *to, void *from,
|
||||
unsigned long to_paddr, unsigned long from_paddr);
|
||||
|
||||
#define clear_user_highpage clear_user_highpage
|
||||
void clear_user_highpage(struct page *page, unsigned long vaddr);
|
||||
#define __HAVE_ARCH_COPY_USER_HIGHPAGE
|
||||
void copy_user_highpage(struct page *to, struct page *from,
|
||||
unsigned long vaddr, struct vm_area_struct *vma);
|
||||
#else
|
||||
# define clear_user_page(page, vaddr, pg) clear_page(page)
|
||||
# define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This handles the memory map. We handle pages at
|
||||
* XCHAL_KSEG_CACHED_VADDR for kernels with 32 bit address space.
|
||||
* These macros are for conversion of kernel address, not user
|
||||
* addresses.
|
||||
*/
|
||||
|
||||
#define ARCH_PFN_OFFSET (PLATFORM_DEFAULT_MEM_START >> PAGE_SHIFT)
|
||||
|
||||
#define __pa(x) ((unsigned long) (x) - PAGE_OFFSET)
|
||||
#define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET))
|
||||
#define pfn_valid(pfn) \
|
||||
((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
|
||||
|
||||
#ifdef CONFIG_DISCONTIGMEM
|
||||
# error CONFIG_DISCONTIGMEM not supported
|
||||
#endif
|
||||
|
||||
#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
|
||||
#define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT)
|
||||
#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
|
||||
#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
|
||||
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
|
||||
|
||||
#include <asm-generic/memory_model.h>
|
||||
#endif /* _XTENSA_PAGE_H */
|
18
arch/xtensa/include/asm/param.h
Normal file
18
arch/xtensa/include/asm/param.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* include/asm-xtensa/param.h
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
#ifndef _XTENSA_PARAM_H
|
||||
#define _XTENSA_PARAM_H
|
||||
|
||||
#include <uapi/asm/param.h>
|
||||
|
||||
# define HZ CONFIG_HZ /* internal timer frequency */
|
||||
# define USER_HZ 100 /* for user interfaces in "ticks" */
|
||||
# define CLOCKS_PER_SEC (USER_HZ) /* frequnzy at which times() counts */
|
||||
#endif /* _XTENSA_PARAM_H */
|
88
arch/xtensa/include/asm/pci-bridge.h
Normal file
88
arch/xtensa/include/asm/pci-bridge.h
Normal file
|
@ -0,0 +1,88 @@
|
|||
/*
|
||||
* include/asm-xtensa/pci-bridge.h
|
||||
*
|
||||
* 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) 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_PCI_BRIDGE_H
|
||||
#define _XTENSA_PCI_BRIDGE_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
struct device_node;
|
||||
struct pci_controller;
|
||||
|
||||
/*
|
||||
* pciauto_bus_scan() enumerates the pci space.
|
||||
*/
|
||||
|
||||
extern int pciauto_bus_scan(struct pci_controller *, int);
|
||||
|
||||
struct pci_space {
|
||||
unsigned long start;
|
||||
unsigned long end;
|
||||
unsigned long base;
|
||||
};
|
||||
|
||||
/*
|
||||
* Structure of a PCI controller (host bridge)
|
||||
*/
|
||||
|
||||
struct pci_controller {
|
||||
int index; /* used for pci_controller_num */
|
||||
struct pci_controller *next;
|
||||
struct pci_bus *bus;
|
||||
void *arch_data;
|
||||
|
||||
int first_busno;
|
||||
int last_busno;
|
||||
|
||||
struct pci_ops *ops;
|
||||
volatile unsigned int *cfg_addr;
|
||||
volatile unsigned char *cfg_data;
|
||||
|
||||
/* Currently, we limit ourselves to 1 IO range and 3 mem
|
||||
* ranges since the common pci_bus structure can't handle more
|
||||
*/
|
||||
struct resource io_resource;
|
||||
struct resource mem_resources[3];
|
||||
int mem_resource_count;
|
||||
|
||||
/* Host bridge I/O and Memory space
|
||||
* Used for BAR placement algorithms
|
||||
*/
|
||||
struct pci_space io_space;
|
||||
struct pci_space mem_space;
|
||||
|
||||
/* Return the interrupt number fo a device. */
|
||||
int (*map_irq)(struct pci_dev*, u8, u8);
|
||||
|
||||
};
|
||||
|
||||
static inline void pcibios_init_resource(struct resource *res,
|
||||
unsigned long start, unsigned long end, int flags, char *name)
|
||||
{
|
||||
res->start = start;
|
||||
res->end = end;
|
||||
res->flags = flags;
|
||||
res->name = name;
|
||||
res->parent = NULL;
|
||||
res->sibling = NULL;
|
||||
res->child = NULL;
|
||||
}
|
||||
|
||||
|
||||
/* These are used for config access before all the PCI probing has been done. */
|
||||
int early_read_config_byte(struct pci_controller*, int, int, int, u8*);
|
||||
int early_read_config_word(struct pci_controller*, int, int, int, u16*);
|
||||
int early_read_config_dword(struct pci_controller*, int, int, int, u32*);
|
||||
int early_write_config_byte(struct pci_controller*, int, int, int, u8);
|
||||
int early_write_config_word(struct pci_controller*, int, int, int, u16);
|
||||
int early_write_config_dword(struct pci_controller*, int, int, int, u32);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _XTENSA_PCI_BRIDGE_H */
|
64
arch/xtensa/include/asm/pci.h
Normal file
64
arch/xtensa/include/asm/pci.h
Normal file
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* linux/include/asm-xtensa/pci.h
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_PCI_H
|
||||
#define _XTENSA_PCI_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/* Can be used to override the logic in pci_scan_bus for skipping
|
||||
* already-configured bus numbers - to be used for buggy BIOSes
|
||||
* or architectures with incomplete PCI setup by the loader
|
||||
*/
|
||||
|
||||
#define pcibios_assign_all_busses() 0
|
||||
|
||||
extern struct pci_controller* pcibios_alloc_controller(void);
|
||||
|
||||
/* Assume some values. (We should revise them, if necessary) */
|
||||
|
||||
#define PCIBIOS_MIN_IO 0x2000
|
||||
#define PCIBIOS_MIN_MEM 0x10000000
|
||||
|
||||
/* Dynamic DMA mapping stuff.
|
||||
* Xtensa has everything mapped statically like x86.
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/slab.h>
|
||||
#include <asm/scatterlist.h>
|
||||
#include <linux/string.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
struct pci_dev;
|
||||
|
||||
/* The PCI address space does equal the physical memory address space.
|
||||
* The networking and block device layers use this boolean for bounce buffer
|
||||
* decisions.
|
||||
*/
|
||||
|
||||
#define PCI_DMA_BUS_IS_PHYS (1)
|
||||
|
||||
/* Map a range of PCI memory or I/O space for a device into user space */
|
||||
int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
|
||||
enum pci_mmap_state mmap_state, int write_combine);
|
||||
|
||||
/* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */
|
||||
#define HAVE_PCI_MMAP 1
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
/* Implement the pci_ DMA API in terms of the generic device dma_ one */
|
||||
#include <asm-generic/pci-dma-compat.h>
|
||||
|
||||
/* Generic PCI */
|
||||
#include <asm-generic/pci.h>
|
||||
|
||||
#endif /* _XTENSA_PCI_H */
|
4
arch/xtensa/include/asm/perf_event.h
Normal file
4
arch/xtensa/include/asm/perf_event.h
Normal file
|
@ -0,0 +1,4 @@
|
|||
#ifndef __ASM_XTENSA_PERF_EVENT_H
|
||||
#define __ASM_XTENSA_PERF_EVENT_H
|
||||
|
||||
#endif /* __ASM_XTENSA_PERF_EVENT_H */
|
85
arch/xtensa/include/asm/pgalloc.h
Normal file
85
arch/xtensa/include/asm/pgalloc.h
Normal file
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
* include/asm-xtensa/pgalloc.h
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Copyright (C) 2001-2007 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_PGALLOC_H
|
||||
#define _XTENSA_PGALLOC_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
/*
|
||||
* Allocating and freeing a pmd is trivial: the 1-entry pmd is
|
||||
* inside the pgd, so has no extra memory associated with it.
|
||||
*/
|
||||
|
||||
#define pmd_populate_kernel(mm, pmdp, ptep) \
|
||||
(pmd_val(*(pmdp)) = ((unsigned long)ptep))
|
||||
#define pmd_populate(mm, pmdp, page) \
|
||||
(pmd_val(*(pmdp)) = ((unsigned long)page_to_virt(page)))
|
||||
#define pmd_pgtable(pmd) pmd_page(pmd)
|
||||
|
||||
static inline pgd_t*
|
||||
pgd_alloc(struct mm_struct *mm)
|
||||
{
|
||||
return (pgd_t*) __get_free_pages(GFP_KERNEL | __GFP_ZERO, PGD_ORDER);
|
||||
}
|
||||
|
||||
static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
|
||||
{
|
||||
free_page((unsigned long)pgd);
|
||||
}
|
||||
|
||||
static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
|
||||
unsigned long address)
|
||||
{
|
||||
pte_t *ptep;
|
||||
int i;
|
||||
|
||||
ptep = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT);
|
||||
if (!ptep)
|
||||
return NULL;
|
||||
for (i = 0; i < 1024; i++)
|
||||
pte_clear(NULL, 0, ptep + i);
|
||||
return ptep;
|
||||
}
|
||||
|
||||
static inline pgtable_t pte_alloc_one(struct mm_struct *mm,
|
||||
unsigned long addr)
|
||||
{
|
||||
pte_t *pte;
|
||||
struct page *page;
|
||||
|
||||
pte = pte_alloc_one_kernel(mm, addr);
|
||||
if (!pte)
|
||||
return NULL;
|
||||
page = virt_to_page(pte);
|
||||
if (!pgtable_page_ctor(page)) {
|
||||
__free_page(page);
|
||||
return NULL;
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
|
||||
{
|
||||
free_page((unsigned long)pte);
|
||||
}
|
||||
|
||||
static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
|
||||
{
|
||||
pgtable_page_dtor(pte);
|
||||
__free_page(pte);
|
||||
}
|
||||
#define pmd_pgtable(pmd) pmd_page(pmd)
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _XTENSA_PGALLOC_H */
|
448
arch/xtensa/include/asm/pgtable.h
Normal file
448
arch/xtensa/include/asm/pgtable.h
Normal file
|
@ -0,0 +1,448 @@
|
|||
/*
|
||||
* include/asm-xtensa/pgtable.h
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Copyright (C) 2001 - 2013 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_PGTABLE_H
|
||||
#define _XTENSA_PGTABLE_H
|
||||
|
||||
#include <asm-generic/pgtable-nopmd.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
/*
|
||||
* We only use two ring levels, user and kernel space.
|
||||
*/
|
||||
|
||||
#define USER_RING 1 /* user ring level */
|
||||
#define KERNEL_RING 0 /* kernel ring level */
|
||||
|
||||
/*
|
||||
* The Xtensa architecture port of Linux has a two-level page table system,
|
||||
* i.e. the logical three-level Linux page table layout is folded.
|
||||
* Each task has the following memory page tables:
|
||||
*
|
||||
* PGD table (page directory), ie. 3rd-level page table:
|
||||
* One page (4 kB) of 1024 (PTRS_PER_PGD) pointers to PTE tables
|
||||
* (Architectures that don't have the PMD folded point to the PMD tables)
|
||||
*
|
||||
* The pointer to the PGD table for a given task can be retrieved from
|
||||
* the task structure (struct task_struct*) t, e.g. current():
|
||||
* (t->mm ? t->mm : t->active_mm)->pgd
|
||||
*
|
||||
* PMD tables (page middle-directory), ie. 2nd-level page tables:
|
||||
* Absent for the Xtensa architecture (folded, PTRS_PER_PMD == 1).
|
||||
*
|
||||
* PTE tables (page table entry), ie. 1st-level page tables:
|
||||
* One page (4 kB) of 1024 (PTRS_PER_PTE) PTEs with a special PTE
|
||||
* invalid_pte_table for absent mappings.
|
||||
*
|
||||
* The individual pages are 4 kB big with special pages for the empty_zero_page.
|
||||
*/
|
||||
|
||||
#define PGDIR_SHIFT 22
|
||||
#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
|
||||
#define PGDIR_MASK (~(PGDIR_SIZE-1))
|
||||
|
||||
/*
|
||||
* Entries per page directory level: we use two-level, so
|
||||
* we don't really have any PMD directory physically.
|
||||
*/
|
||||
#define PTRS_PER_PTE 1024
|
||||
#define PTRS_PER_PTE_SHIFT 10
|
||||
#define PTRS_PER_PGD 1024
|
||||
#define PGD_ORDER 0
|
||||
#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE)
|
||||
#define FIRST_USER_ADDRESS 0
|
||||
#define FIRST_USER_PGD_NR (FIRST_USER_ADDRESS >> PGDIR_SHIFT)
|
||||
|
||||
/*
|
||||
* Virtual memory area. We keep a distance to other memory regions to be
|
||||
* on the safe side. We also use this area for cache aliasing.
|
||||
*/
|
||||
#define VMALLOC_START 0xC0000000
|
||||
#define VMALLOC_END 0xC7FEFFFF
|
||||
#define TLBTEMP_BASE_1 0xC7FF0000
|
||||
#define TLBTEMP_BASE_2 (TLBTEMP_BASE_1 + DCACHE_WAY_SIZE)
|
||||
#if 2 * DCACHE_WAY_SIZE > ICACHE_WAY_SIZE
|
||||
#define TLBTEMP_SIZE (2 * DCACHE_WAY_SIZE)
|
||||
#else
|
||||
#define TLBTEMP_SIZE ICACHE_WAY_SIZE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* For the Xtensa architecture, the PTE layout is as follows:
|
||||
*
|
||||
* 31------12 11 10-9 8-6 5-4 3-2 1-0
|
||||
* +-----------------------------------------+
|
||||
* | | Software | HARDWARE |
|
||||
* | PPN | ADW | RI |Attribute|
|
||||
* +-----------------------------------------+
|
||||
* pte_none | MBZ | 01 | 11 | 00 |
|
||||
* +-----------------------------------------+
|
||||
* present | PPN | 0 | 00 | ADW | RI | CA | wx |
|
||||
* +- - - - - - - - - - - - - - - - - - - - -+
|
||||
* (PAGE_NONE)| PPN | 0 | 00 | ADW | 01 | 11 | 11 |
|
||||
* +-----------------------------------------+
|
||||
* swap | index | type | 01 | 11 | 00 |
|
||||
* +- - - - - - - - - - - - - - - - - - - - -+
|
||||
* file | file offset | 01 | 11 | 10 |
|
||||
* +-----------------------------------------+
|
||||
*
|
||||
* For T1050 hardware and earlier the layout differs for present and (PAGE_NONE)
|
||||
* +-----------------------------------------+
|
||||
* present | PPN | 0 | 00 | ADW | RI | CA | w1 |
|
||||
* +-----------------------------------------+
|
||||
* (PAGE_NONE)| PPN | 0 | 00 | ADW | 01 | 01 | 00 |
|
||||
* +-----------------------------------------+
|
||||
*
|
||||
* Legend:
|
||||
* PPN Physical Page Number
|
||||
* ADW software: accessed (young) / dirty / writable
|
||||
* RI ring (0=privileged, 1=user, 2 and 3 are unused)
|
||||
* CA cache attribute: 00 bypass, 01 writeback, 10 writethrough
|
||||
* (11 is invalid and used to mark pages that are not present)
|
||||
* w page is writable (hw)
|
||||
* x page is executable (hw)
|
||||
* index swap offset / PAGE_SIZE (bit 11-31: 21 bits -> 8 GB)
|
||||
* (note that the index is always non-zero)
|
||||
* type swap type (5 bits -> 32 types)
|
||||
* file offset 26-bit offset into the file, in increments of PAGE_SIZE
|
||||
*
|
||||
* Notes:
|
||||
* - (PROT_NONE) is a special case of 'present' but causes an exception for
|
||||
* any access (read, write, and execute).
|
||||
* - 'multihit-exception' has the highest priority of all MMU exceptions,
|
||||
* so the ring must be set to 'RING_USER' even for 'non-present' pages.
|
||||
* - on older hardware, the exectuable flag was not supported and
|
||||
* used as a 'valid' flag, so it needs to be always set.
|
||||
* - we need to keep track of certain flags in software (dirty and young)
|
||||
* to do this, we use write exceptions and have a separate software w-flag.
|
||||
* - attribute value 1101 (and 1111 on T1050 and earlier) is reserved
|
||||
*/
|
||||
|
||||
#define _PAGE_ATTRIB_MASK 0xf
|
||||
|
||||
#define _PAGE_HW_EXEC (1<<0) /* hardware: page is executable */
|
||||
#define _PAGE_HW_WRITE (1<<1) /* hardware: page is writable */
|
||||
|
||||
#define _PAGE_CA_BYPASS (0<<2) /* bypass, non-speculative */
|
||||
#define _PAGE_CA_WB (1<<2) /* write-back */
|
||||
#define _PAGE_CA_WT (2<<2) /* write-through */
|
||||
#define _PAGE_CA_MASK (3<<2)
|
||||
#define _PAGE_CA_INVALID (3<<2)
|
||||
|
||||
/* We use invalid attribute values to distinguish special pte entries */
|
||||
#if XCHAL_HW_VERSION_MAJOR < 2000
|
||||
#define _PAGE_HW_VALID 0x01 /* older HW needed this bit set */
|
||||
#define _PAGE_NONE 0x04
|
||||
#else
|
||||
#define _PAGE_HW_VALID 0x00
|
||||
#define _PAGE_NONE 0x0f
|
||||
#endif
|
||||
#define _PAGE_FILE (1<<1) /* file mapped page, only if !present */
|
||||
|
||||
#define _PAGE_USER (1<<4) /* user access (ring=1) */
|
||||
|
||||
/* Software */
|
||||
#define _PAGE_WRITABLE_BIT 6
|
||||
#define _PAGE_WRITABLE (1<<6) /* software: page writable */
|
||||
#define _PAGE_DIRTY (1<<7) /* software: page dirty */
|
||||
#define _PAGE_ACCESSED (1<<8) /* software: page accessed (read) */
|
||||
|
||||
#ifdef CONFIG_MMU
|
||||
|
||||
#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
|
||||
#define _PAGE_PRESENT (_PAGE_HW_VALID | _PAGE_CA_WB | _PAGE_ACCESSED)
|
||||
|
||||
#define PAGE_NONE __pgprot(_PAGE_NONE | _PAGE_USER)
|
||||
#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_USER)
|
||||
#define PAGE_COPY_EXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_HW_EXEC)
|
||||
#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER)
|
||||
#define PAGE_READONLY_EXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_HW_EXEC)
|
||||
#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_WRITABLE)
|
||||
#define PAGE_SHARED_EXEC \
|
||||
__pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_WRITABLE | _PAGE_HW_EXEC)
|
||||
#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | _PAGE_HW_WRITE)
|
||||
#define PAGE_KERNEL_EXEC __pgprot(_PAGE_PRESENT|_PAGE_HW_WRITE|_PAGE_HW_EXEC)
|
||||
|
||||
#if (DCACHE_WAY_SIZE > PAGE_SIZE)
|
||||
# define _PAGE_DIRECTORY (_PAGE_HW_VALID | _PAGE_ACCESSED | _PAGE_CA_BYPASS)
|
||||
#else
|
||||
# define _PAGE_DIRECTORY (_PAGE_HW_VALID | _PAGE_ACCESSED | _PAGE_CA_WB)
|
||||
#endif
|
||||
|
||||
#else /* no mmu */
|
||||
|
||||
# define PAGE_NONE __pgprot(0)
|
||||
# define PAGE_SHARED __pgprot(0)
|
||||
# define PAGE_COPY __pgprot(0)
|
||||
# define PAGE_READONLY __pgprot(0)
|
||||
# define PAGE_KERNEL __pgprot(0)
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* On certain configurations of Xtensa MMUs (eg. the initial Linux config),
|
||||
* the MMU can't do page protection for execute, and considers that the same as
|
||||
* read. Also, write permissions may imply read permissions.
|
||||
* What follows is the closest we can get by reasonable means..
|
||||
* See linux/mm/mmap.c for protection_map[] array that uses these definitions.
|
||||
*/
|
||||
#define __P000 PAGE_NONE /* private --- */
|
||||
#define __P001 PAGE_READONLY /* private --r */
|
||||
#define __P010 PAGE_COPY /* private -w- */
|
||||
#define __P011 PAGE_COPY /* private -wr */
|
||||
#define __P100 PAGE_READONLY_EXEC /* private x-- */
|
||||
#define __P101 PAGE_READONLY_EXEC /* private x-r */
|
||||
#define __P110 PAGE_COPY_EXEC /* private xw- */
|
||||
#define __P111 PAGE_COPY_EXEC /* private xwr */
|
||||
|
||||
#define __S000 PAGE_NONE /* shared --- */
|
||||
#define __S001 PAGE_READONLY /* shared --r */
|
||||
#define __S010 PAGE_SHARED /* shared -w- */
|
||||
#define __S011 PAGE_SHARED /* shared -wr */
|
||||
#define __S100 PAGE_READONLY_EXEC /* shared x-- */
|
||||
#define __S101 PAGE_READONLY_EXEC /* shared x-r */
|
||||
#define __S110 PAGE_SHARED_EXEC /* shared xw- */
|
||||
#define __S111 PAGE_SHARED_EXEC /* shared xwr */
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#define pte_ERROR(e) \
|
||||
printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
|
||||
#define pgd_ERROR(e) \
|
||||
printk("%s:%d: bad pgd entry %08lx.\n", __FILE__, __LINE__, pgd_val(e))
|
||||
|
||||
extern unsigned long empty_zero_page[1024];
|
||||
|
||||
#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
|
||||
|
||||
#ifdef CONFIG_MMU
|
||||
extern pgd_t swapper_pg_dir[PAGE_SIZE/sizeof(pgd_t)];
|
||||
extern void paging_init(void);
|
||||
#else
|
||||
# define swapper_pg_dir NULL
|
||||
static inline void paging_init(void) { }
|
||||
#endif
|
||||
static inline void pgtable_cache_init(void) { }
|
||||
|
||||
/*
|
||||
* The pmd contains the kernel virtual address of the pte page.
|
||||
*/
|
||||
#define pmd_page_vaddr(pmd) ((unsigned long)(pmd_val(pmd) & PAGE_MASK))
|
||||
#define pmd_page(pmd) virt_to_page(pmd_val(pmd))
|
||||
|
||||
/*
|
||||
* pte status.
|
||||
*/
|
||||
# define pte_none(pte) (pte_val(pte) == (_PAGE_CA_INVALID | _PAGE_USER))
|
||||
#if XCHAL_HW_VERSION_MAJOR < 2000
|
||||
# define pte_present(pte) ((pte_val(pte) & _PAGE_CA_MASK) != _PAGE_CA_INVALID)
|
||||
#else
|
||||
# define pte_present(pte) \
|
||||
(((pte_val(pte) & _PAGE_CA_MASK) != _PAGE_CA_INVALID) \
|
||||
|| ((pte_val(pte) & _PAGE_ATTRIB_MASK) == _PAGE_NONE))
|
||||
#endif
|
||||
#define pte_clear(mm,addr,ptep) \
|
||||
do { update_pte(ptep, __pte(_PAGE_CA_INVALID | _PAGE_USER)); } while (0)
|
||||
|
||||
#define pmd_none(pmd) (!pmd_val(pmd))
|
||||
#define pmd_present(pmd) (pmd_val(pmd) & PAGE_MASK)
|
||||
#define pmd_bad(pmd) (pmd_val(pmd) & ~PAGE_MASK)
|
||||
#define pmd_clear(pmdp) do { set_pmd(pmdp, __pmd(0)); } while (0)
|
||||
|
||||
static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITABLE; }
|
||||
static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
|
||||
static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
|
||||
static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
|
||||
static inline int pte_special(pte_t pte) { return 0; }
|
||||
|
||||
static inline pte_t pte_wrprotect(pte_t pte)
|
||||
{ pte_val(pte) &= ~(_PAGE_WRITABLE | _PAGE_HW_WRITE); return pte; }
|
||||
static inline pte_t pte_mkclean(pte_t pte)
|
||||
{ pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HW_WRITE); return pte; }
|
||||
static inline pte_t pte_mkold(pte_t pte)
|
||||
{ pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
|
||||
static inline pte_t pte_mkdirty(pte_t pte)
|
||||
{ pte_val(pte) |= _PAGE_DIRTY; return pte; }
|
||||
static inline pte_t pte_mkyoung(pte_t pte)
|
||||
{ pte_val(pte) |= _PAGE_ACCESSED; return pte; }
|
||||
static inline pte_t pte_mkwrite(pte_t pte)
|
||||
{ pte_val(pte) |= _PAGE_WRITABLE; return pte; }
|
||||
static inline pte_t pte_mkspecial(pte_t pte)
|
||||
{ return pte; }
|
||||
|
||||
#define pgprot_noncached(prot) (__pgprot(pgprot_val(prot) & ~_PAGE_CA_MASK))
|
||||
|
||||
/*
|
||||
* Conversion functions: convert a page and protection to a page entry,
|
||||
* and a page entry and page directory to the page they refer to.
|
||||
*/
|
||||
|
||||
#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT)
|
||||
#define pte_same(a,b) (pte_val(a) == pte_val(b))
|
||||
#define pte_page(x) pfn_to_page(pte_pfn(x))
|
||||
#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
|
||||
#define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot)
|
||||
|
||||
static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
|
||||
{
|
||||
return __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot));
|
||||
}
|
||||
|
||||
/*
|
||||
* Certain architectures need to do special things when pte's
|
||||
* within a page table are directly modified. Thus, the following
|
||||
* hook is made available.
|
||||
*/
|
||||
static inline void update_pte(pte_t *ptep, pte_t pteval)
|
||||
{
|
||||
*ptep = pteval;
|
||||
#if (DCACHE_WAY_SIZE > PAGE_SIZE) && XCHAL_DCACHE_IS_WRITEBACK
|
||||
__asm__ __volatile__ ("dhwb %0, 0" :: "a" (ptep));
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
struct mm_struct;
|
||||
|
||||
static inline void
|
||||
set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pteval)
|
||||
{
|
||||
update_pte(ptep, pteval);
|
||||
}
|
||||
|
||||
static inline void set_pte(pte_t *ptep, pte_t pteval)
|
||||
{
|
||||
update_pte(ptep, pteval);
|
||||
}
|
||||
|
||||
static inline void
|
||||
set_pmd(pmd_t *pmdp, pmd_t pmdval)
|
||||
{
|
||||
*pmdp = pmdval;
|
||||
}
|
||||
|
||||
struct vm_area_struct;
|
||||
|
||||
static inline int
|
||||
ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr,
|
||||
pte_t *ptep)
|
||||
{
|
||||
pte_t pte = *ptep;
|
||||
if (!pte_young(pte))
|
||||
return 0;
|
||||
update_pte(ptep, pte_mkold(pte));
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline pte_t
|
||||
ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
|
||||
{
|
||||
pte_t pte = *ptep;
|
||||
pte_clear(mm, addr, ptep);
|
||||
return pte;
|
||||
}
|
||||
|
||||
static inline void
|
||||
ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
|
||||
{
|
||||
pte_t pte = *ptep;
|
||||
update_pte(ptep, pte_wrprotect(pte));
|
||||
}
|
||||
|
||||
/* to find an entry in a kernel page-table-directory */
|
||||
#define pgd_offset_k(address) pgd_offset(&init_mm, address)
|
||||
|
||||
/* to find an entry in a page-table-directory */
|
||||
#define pgd_offset(mm,address) ((mm)->pgd + pgd_index(address))
|
||||
|
||||
#define pgd_index(address) ((address) >> PGDIR_SHIFT)
|
||||
|
||||
/* Find an entry in the second-level page table.. */
|
||||
#define pmd_offset(dir,address) ((pmd_t*)(dir))
|
||||
|
||||
/* Find an entry in the third-level page table.. */
|
||||
#define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
|
||||
#define pte_offset_kernel(dir,addr) \
|
||||
((pte_t*) pmd_page_vaddr(*(dir)) + pte_index(addr))
|
||||
#define pte_offset_map(dir,addr) pte_offset_kernel((dir),(addr))
|
||||
#define pte_unmap(pte) do { } while (0)
|
||||
|
||||
|
||||
/*
|
||||
* Encode and decode a swap and file entry.
|
||||
*/
|
||||
#define SWP_TYPE_BITS 5
|
||||
#define MAX_SWAPFILES_CHECK() BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > SWP_TYPE_BITS)
|
||||
|
||||
#define __swp_type(entry) (((entry).val >> 6) & 0x1f)
|
||||
#define __swp_offset(entry) ((entry).val >> 11)
|
||||
#define __swp_entry(type,offs) \
|
||||
((swp_entry_t){((type) << 6) | ((offs) << 11) | \
|
||||
_PAGE_CA_INVALID | _PAGE_USER})
|
||||
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
|
||||
#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
|
||||
|
||||
#define PTE_FILE_MAX_BITS 26
|
||||
#define pte_to_pgoff(pte) (pte_val(pte) >> 6)
|
||||
#define pgoff_to_pte(off) \
|
||||
((pte_t) { ((off) << 6) | _PAGE_CA_INVALID | _PAGE_FILE | _PAGE_USER })
|
||||
|
||||
#endif /* !defined (__ASSEMBLY__) */
|
||||
|
||||
|
||||
#ifdef __ASSEMBLY__
|
||||
|
||||
/* Assembly macro _PGD_INDEX is the same as C pgd_index(unsigned long),
|
||||
* _PGD_OFFSET as C pgd_offset(struct mm_struct*, unsigned long),
|
||||
* _PMD_OFFSET as C pmd_offset(pgd_t*, unsigned long)
|
||||
* _PTE_OFFSET as C pte_offset(pmd_t*, unsigned long)
|
||||
*
|
||||
* Note: We require an additional temporary register which can be the same as
|
||||
* the register that holds the address.
|
||||
*
|
||||
* ((pte_t*) ((unsigned long)(pmd_val(*pmd) & PAGE_MASK)) + pte_index(addr))
|
||||
*
|
||||
*/
|
||||
#define _PGD_INDEX(rt,rs) extui rt, rs, PGDIR_SHIFT, 32-PGDIR_SHIFT
|
||||
#define _PTE_INDEX(rt,rs) extui rt, rs, PAGE_SHIFT, PTRS_PER_PTE_SHIFT
|
||||
|
||||
#define _PGD_OFFSET(mm,adr,tmp) l32i mm, mm, MM_PGD; \
|
||||
_PGD_INDEX(tmp, adr); \
|
||||
addx4 mm, tmp, mm
|
||||
|
||||
#define _PTE_OFFSET(pmd,adr,tmp) _PTE_INDEX(tmp, adr); \
|
||||
srli pmd, pmd, PAGE_SHIFT; \
|
||||
slli pmd, pmd, PAGE_SHIFT; \
|
||||
addx4 pmd, tmp, pmd
|
||||
|
||||
#else
|
||||
|
||||
#define kern_addr_valid(addr) (1)
|
||||
|
||||
extern void update_mmu_cache(struct vm_area_struct * vma,
|
||||
unsigned long address, pte_t *ptep);
|
||||
|
||||
typedef pte_t *pte_addr_t;
|
||||
|
||||
#endif /* !defined (__ASSEMBLY__) */
|
||||
|
||||
#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
|
||||
#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
|
||||
#define __HAVE_ARCH_PTEP_SET_WRPROTECT
|
||||
#define __HAVE_ARCH_PTEP_MKDIRTY
|
||||
#define __HAVE_ARCH_PTE_SAME
|
||||
/* We provide our own get_unmapped_area to cope with
|
||||
* SHM area cache aliasing for userland.
|
||||
*/
|
||||
#define HAVE_ARCH_UNMAPPED_AREA
|
||||
|
||||
#include <asm-generic/pgtable.h>
|
||||
|
||||
#endif /* _XTENSA_PGTABLE_H */
|
72
arch/xtensa/include/asm/platform.h
Normal file
72
arch/xtensa/include/asm/platform.h
Normal file
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
* Platform specific functions
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_PLATFORM_H
|
||||
#define _XTENSA_PLATFORM_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/pci.h>
|
||||
|
||||
#include <asm/bootparam.h>
|
||||
|
||||
/*
|
||||
* platform_init is called before the mmu is initialized to give the
|
||||
* platform a early hook-up. bp_tag_t is a list of configuration tags
|
||||
* passed from the boot-loader.
|
||||
*/
|
||||
extern void platform_init(bp_tag_t*);
|
||||
|
||||
/*
|
||||
* platform_setup is called from setup_arch with a pointer to the command-line
|
||||
* string.
|
||||
*/
|
||||
extern void platform_setup (char **);
|
||||
|
||||
/*
|
||||
* platform_restart is called to restart the system.
|
||||
*/
|
||||
extern void platform_restart (void);
|
||||
|
||||
/*
|
||||
* platform_halt is called to stop the system and halt.
|
||||
*/
|
||||
extern void platform_halt (void);
|
||||
|
||||
/*
|
||||
* platform_power_off is called to stop the system and power it off.
|
||||
*/
|
||||
extern void platform_power_off (void);
|
||||
|
||||
/*
|
||||
* platform_idle is called from the idle function.
|
||||
*/
|
||||
extern void platform_idle (void);
|
||||
|
||||
/*
|
||||
* platform_heartbeat is called every HZ
|
||||
*/
|
||||
extern void platform_heartbeat (void);
|
||||
|
||||
/*
|
||||
* platform_pcibios_init is called to allow the platform to setup the pci bus.
|
||||
*/
|
||||
extern void platform_pcibios_init (void);
|
||||
|
||||
/*
|
||||
* platform_pcibios_fixup allows to modify the PCI configuration.
|
||||
*/
|
||||
extern int platform_pcibios_fixup (void);
|
||||
|
||||
/*
|
||||
* platform_calibrate_ccount calibrates cpu clock freq (CONFIG_XTENSA_CALIBRATE)
|
||||
*/
|
||||
extern void platform_calibrate_ccount (void);
|
||||
|
||||
#endif /* _XTENSA_PLATFORM_H */
|
216
arch/xtensa/include/asm/processor.h
Normal file
216
arch/xtensa/include/asm/processor.h
Normal file
|
@ -0,0 +1,216 @@
|
|||
/*
|
||||
* include/asm-xtensa/processor.h
|
||||
*
|
||||
* 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) 2001 - 2008 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_PROCESSOR_H
|
||||
#define _XTENSA_PROCESSOR_H
|
||||
|
||||
#include <variant/core.h>
|
||||
#include <platform/hardware.h>
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/types.h>
|
||||
#include <asm/regs.h>
|
||||
|
||||
/* Assertions. */
|
||||
|
||||
#if (XCHAL_HAVE_WINDOWED != 1)
|
||||
# error Linux requires the Xtensa Windowed Registers Option.
|
||||
#endif
|
||||
|
||||
#define ARCH_SLAB_MINALIGN XCHAL_DATA_WIDTH
|
||||
|
||||
/*
|
||||
* User space process size: 1 GB.
|
||||
* Windowed call ABI requires caller and callee to be located within the same
|
||||
* 1 GB region. The C compiler places trampoline code on the stack for sources
|
||||
* that take the address of a nested C function (a feature used by glibc), so
|
||||
* the 1 GB requirement applies to the stack as well.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_MMU
|
||||
#define TASK_SIZE __XTENSA_UL_CONST(0x40000000)
|
||||
#else
|
||||
#define TASK_SIZE (PLATFORM_DEFAULT_MEM_START + PLATFORM_DEFAULT_MEM_SIZE)
|
||||
#endif
|
||||
|
||||
#define STACK_TOP TASK_SIZE
|
||||
#define STACK_TOP_MAX STACK_TOP
|
||||
|
||||
/*
|
||||
* General exception cause assigned to debug exceptions. Debug exceptions go
|
||||
* to their own vector, rather than the general exception vectors (user,
|
||||
* kernel, double); and their specific causes are reported via DEBUGCAUSE
|
||||
* rather than EXCCAUSE. However it is sometimes convenient to redirect debug
|
||||
* exceptions to the general exception mechanism. To do this, an otherwise
|
||||
* unused EXCCAUSE value was assigned to debug exceptions for this purpose.
|
||||
*/
|
||||
|
||||
#define EXCCAUSE_MAPPED_DEBUG 63
|
||||
|
||||
/*
|
||||
* We use DEPC also as a flag to distinguish between double and regular
|
||||
* exceptions. For performance reasons, DEPC might contain the value of
|
||||
* EXCCAUSE for regular exceptions, so we use this definition to mark a
|
||||
* valid double exception address.
|
||||
* (Note: We use it in bgeui, so it should be 64, 128, or 256)
|
||||
*/
|
||||
|
||||
#define VALID_DOUBLE_EXCEPTION_ADDRESS 64
|
||||
|
||||
/* LOCKLEVEL defines the interrupt level that masks all
|
||||
* general-purpose interrupts.
|
||||
*/
|
||||
#define LOCKLEVEL XCHAL_EXCM_LEVEL
|
||||
|
||||
/* WSBITS and WBBITS are the width of the WINDOWSTART and WINDOWBASE
|
||||
* registers
|
||||
*/
|
||||
#define WSBITS (XCHAL_NUM_AREGS / 4) /* width of WINDOWSTART in bits */
|
||||
#define WBBITS (XCHAL_NUM_AREGS_LOG2 - 2) /* width of WINDOWBASE in bits */
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/* Build a valid return address for the specified call winsize.
|
||||
* winsize must be 1 (call4), 2 (call8), or 3 (call12)
|
||||
*/
|
||||
#define MAKE_RA_FOR_CALL(ra,ws) (((ra) & 0x3fffffff) | (ws) << 30)
|
||||
|
||||
/* Convert return address to a valid pc
|
||||
* Note: We assume that the stack pointer is in the same 1GB ranges as the ra
|
||||
*/
|
||||
#define MAKE_PC_FROM_RA(ra,sp) (((ra) & 0x3fffffff) | ((sp) & 0xc0000000))
|
||||
|
||||
typedef struct {
|
||||
unsigned long seg;
|
||||
} mm_segment_t;
|
||||
|
||||
struct thread_struct {
|
||||
|
||||
/* kernel's return address and stack pointer for context switching */
|
||||
unsigned long ra; /* kernel's a0: return address and window call size */
|
||||
unsigned long sp; /* kernel's a1: stack pointer */
|
||||
|
||||
mm_segment_t current_ds; /* see uaccess.h for example uses */
|
||||
|
||||
/* struct xtensa_cpuinfo info; */
|
||||
|
||||
unsigned long bad_vaddr; /* last user fault */
|
||||
unsigned long bad_uaddr; /* last kernel fault accessing user space */
|
||||
unsigned long error_code;
|
||||
|
||||
unsigned long ibreak[XCHAL_NUM_IBREAK];
|
||||
unsigned long dbreaka[XCHAL_NUM_DBREAK];
|
||||
unsigned long dbreakc[XCHAL_NUM_DBREAK];
|
||||
|
||||
/* Make structure 16 bytes aligned. */
|
||||
int align[0] __attribute__ ((aligned(16)));
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Default implementation of macro that returns current
|
||||
* instruction pointer ("program counter").
|
||||
*/
|
||||
#define current_text_addr() ({ __label__ _l; _l: &&_l;})
|
||||
|
||||
|
||||
/* This decides where the kernel will search for a free chunk of vm
|
||||
* space during mmap's.
|
||||
*/
|
||||
#define TASK_UNMAPPED_BASE (TASK_SIZE / 2)
|
||||
|
||||
#define INIT_THREAD \
|
||||
{ \
|
||||
ra: 0, \
|
||||
sp: sizeof(init_stack) + (long) &init_stack, \
|
||||
current_ds: {0}, \
|
||||
/*info: {0}, */ \
|
||||
bad_vaddr: 0, \
|
||||
bad_uaddr: 0, \
|
||||
error_code: 0, \
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Do necessary setup to start up a newly executed thread.
|
||||
* Note: We set-up ps as if we did a call4 to the new pc.
|
||||
* set_thread_state in signal.c depends on it.
|
||||
*/
|
||||
#define USER_PS_VALUE ((1 << PS_WOE_BIT) | \
|
||||
(1 << PS_CALLINC_SHIFT) | \
|
||||
(USER_RING << PS_RING_SHIFT) | \
|
||||
(1 << PS_UM_BIT) | \
|
||||
(1 << PS_EXCM_BIT))
|
||||
|
||||
/* Clearing a0 terminates the backtrace. */
|
||||
#define start_thread(regs, new_pc, new_sp) \
|
||||
memset(regs, 0, sizeof(*regs)); \
|
||||
regs->pc = new_pc; \
|
||||
regs->ps = USER_PS_VALUE; \
|
||||
regs->areg[1] = new_sp; \
|
||||
regs->areg[0] = 0; \
|
||||
regs->wmask = 1; \
|
||||
regs->depc = 0; \
|
||||
regs->windowbase = 0; \
|
||||
regs->windowstart = 1;
|
||||
|
||||
/* Forward declaration */
|
||||
struct task_struct;
|
||||
struct mm_struct;
|
||||
|
||||
/* Free all resources held by a thread. */
|
||||
#define release_thread(thread) do { } while(0)
|
||||
|
||||
/* Copy and release all segment info associated with a VM */
|
||||
#define copy_segments(p, mm) do { } while(0)
|
||||
#define release_segments(mm) do { } while(0)
|
||||
#define forget_segments() do { } while (0)
|
||||
|
||||
#define thread_saved_pc(tsk) (task_pt_regs(tsk)->pc)
|
||||
|
||||
extern unsigned long get_wchan(struct task_struct *p);
|
||||
|
||||
#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)
|
||||
#define KSTK_ESP(tsk) (task_pt_regs(tsk)->areg[1])
|
||||
|
||||
#define cpu_relax() barrier()
|
||||
#define cpu_relax_lowlatency() cpu_relax()
|
||||
|
||||
/* Special register access. */
|
||||
|
||||
#define WSR(v,sr) __asm__ __volatile__ ("wsr %0,"__stringify(sr) :: "a"(v));
|
||||
#define RSR(v,sr) __asm__ __volatile__ ("rsr %0,"__stringify(sr) : "=a"(v));
|
||||
|
||||
#define set_sr(x,sr) ({unsigned int v=(unsigned int)x; WSR(v,sr);})
|
||||
#define get_sr(sr) ({unsigned int v; RSR(v,sr); v; })
|
||||
|
||||
#ifndef XCHAL_HAVE_EXTERN_REGS
|
||||
#define XCHAL_HAVE_EXTERN_REGS 0
|
||||
#endif
|
||||
|
||||
#if XCHAL_HAVE_EXTERN_REGS
|
||||
|
||||
static inline void set_er(unsigned long value, unsigned long addr)
|
||||
{
|
||||
asm volatile ("wer %0, %1" : : "a" (value), "a" (addr) : "memory");
|
||||
}
|
||||
|
||||
static inline unsigned long get_er(unsigned long addr)
|
||||
{
|
||||
register unsigned long value;
|
||||
asm volatile ("rer %0, %1" : "=a" (value) : "a" (addr) : "memory");
|
||||
return value;
|
||||
}
|
||||
|
||||
#endif /* XCHAL_HAVE_EXTERN_REGS */
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* _XTENSA_PROCESSOR_H */
|
84
arch/xtensa/include/asm/ptrace.h
Normal file
84
arch/xtensa/include/asm/ptrace.h
Normal file
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
* include/asm-xtensa/ptrace.h
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
#ifndef _XTENSA_PTRACE_H
|
||||
#define _XTENSA_PTRACE_H
|
||||
|
||||
#include <uapi/asm/ptrace.h>
|
||||
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <asm/coprocessor.h>
|
||||
|
||||
/*
|
||||
* This struct defines the way the registers are stored on the
|
||||
* kernel stack during a system call or other kernel entry.
|
||||
*/
|
||||
struct pt_regs {
|
||||
unsigned long pc; /* 4 */
|
||||
unsigned long ps; /* 8 */
|
||||
unsigned long depc; /* 12 */
|
||||
unsigned long exccause; /* 16 */
|
||||
unsigned long excvaddr; /* 20 */
|
||||
unsigned long debugcause; /* 24 */
|
||||
unsigned long wmask; /* 28 */
|
||||
unsigned long lbeg; /* 32 */
|
||||
unsigned long lend; /* 36 */
|
||||
unsigned long lcount; /* 40 */
|
||||
unsigned long sar; /* 44 */
|
||||
unsigned long windowbase; /* 48 */
|
||||
unsigned long windowstart; /* 52 */
|
||||
unsigned long syscall; /* 56 */
|
||||
unsigned long icountlevel; /* 60 */
|
||||
unsigned long scompare1; /* 64 */
|
||||
unsigned long threadptr; /* 68 */
|
||||
|
||||
/* Additional configurable registers that are used by the compiler. */
|
||||
xtregs_opt_t xtregs_opt;
|
||||
|
||||
/* Make sure the areg field is 16 bytes aligned. */
|
||||
int align[0] __attribute__ ((aligned(16)));
|
||||
|
||||
/* current register frame.
|
||||
* Note: The ESF for kernel exceptions ends after 16 registers!
|
||||
*/
|
||||
unsigned long areg[16];
|
||||
};
|
||||
|
||||
#include <variant/core.h>
|
||||
|
||||
# define arch_has_single_step() (1)
|
||||
# define task_pt_regs(tsk) ((struct pt_regs*) \
|
||||
(task_stack_page(tsk) + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1)
|
||||
# define user_mode(regs) (((regs)->ps & 0x00000020)!=0)
|
||||
# define instruction_pointer(regs) ((regs)->pc)
|
||||
# define return_pointer(regs) (MAKE_PC_FROM_RA((regs)->areg[0], \
|
||||
(regs)->areg[1]))
|
||||
|
||||
# ifndef CONFIG_SMP
|
||||
# define profile_pc(regs) instruction_pointer(regs)
|
||||
# else
|
||||
# define profile_pc(regs) \
|
||||
({ \
|
||||
in_lock_functions(instruction_pointer(regs)) ? \
|
||||
return_pointer(regs) : instruction_pointer(regs); \
|
||||
})
|
||||
# endif
|
||||
|
||||
#define user_stack_pointer(regs) ((regs)->areg[1])
|
||||
|
||||
#else /* __ASSEMBLY__ */
|
||||
|
||||
# include <asm/asm-offsets.h>
|
||||
#define PT_REGS_OFFSET (KERNEL_STACK_SIZE - PT_USER_SIZE)
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
|
||||
#endif /* _XTENSA_PTRACE_H */
|
113
arch/xtensa/include/asm/regs.h
Normal file
113
arch/xtensa/include/asm/regs.h
Normal file
|
@ -0,0 +1,113 @@
|
|||
/*
|
||||
* Copyright (c) 2006 Tensilica, Inc. All Rights Reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of version 2.1 of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it would be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* Further, this software is distributed without any warranty that it is
|
||||
* free of the rightful claim of any third person regarding infringement
|
||||
* or the like. Any license provided herein, whether implied or
|
||||
* otherwise, applies only to this software file. Patent licenses, if
|
||||
* any, provided herein do not apply to combinations of this program with
|
||||
* other software, or any other product whatsoever.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this program; if not, write the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
|
||||
* USA.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_REGS_H
|
||||
#define _XTENSA_REGS_H
|
||||
|
||||
/* Special registers. */
|
||||
|
||||
#define SREG_MR 32
|
||||
#define SREG_IBREAKA 128
|
||||
#define SREG_DBREAKA 144
|
||||
#define SREG_DBREAKC 160
|
||||
#define SREG_EPC 176
|
||||
#define SREG_EPS 192
|
||||
#define SREG_EXCSAVE 208
|
||||
#define SREG_CCOMPARE 240
|
||||
#define SREG_MISC 244
|
||||
|
||||
/* EXCCAUSE register fields */
|
||||
|
||||
#define EXCCAUSE_EXCCAUSE_SHIFT 0
|
||||
#define EXCCAUSE_EXCCAUSE_MASK 0x3F
|
||||
|
||||
#define EXCCAUSE_ILLEGAL_INSTRUCTION 0
|
||||
#define EXCCAUSE_SYSTEM_CALL 1
|
||||
#define EXCCAUSE_INSTRUCTION_FETCH_ERROR 2
|
||||
#define EXCCAUSE_LOAD_STORE_ERROR 3
|
||||
#define EXCCAUSE_LEVEL1_INTERRUPT 4
|
||||
#define EXCCAUSE_ALLOCA 5
|
||||
#define EXCCAUSE_INTEGER_DIVIDE_BY_ZERO 6
|
||||
#define EXCCAUSE_SPECULATION 7
|
||||
#define EXCCAUSE_PRIVILEGED 8
|
||||
#define EXCCAUSE_UNALIGNED 9
|
||||
#define EXCCAUSE_INSTR_DATA_ERROR 12
|
||||
#define EXCCAUSE_LOAD_STORE_DATA_ERROR 13
|
||||
#define EXCCAUSE_INSTR_ADDR_ERROR 14
|
||||
#define EXCCAUSE_LOAD_STORE_ADDR_ERROR 15
|
||||
#define EXCCAUSE_ITLB_MISS 16
|
||||
#define EXCCAUSE_ITLB_MULTIHIT 17
|
||||
#define EXCCAUSE_ITLB_PRIVILEGE 18
|
||||
#define EXCCAUSE_ITLB_SIZE_RESTRICTION 19
|
||||
#define EXCCAUSE_FETCH_CACHE_ATTRIBUTE 20
|
||||
#define EXCCAUSE_DTLB_MISS 24
|
||||
#define EXCCAUSE_DTLB_MULTIHIT 25
|
||||
#define EXCCAUSE_DTLB_PRIVILEGE 26
|
||||
#define EXCCAUSE_DTLB_SIZE_RESTRICTION 27
|
||||
#define EXCCAUSE_LOAD_CACHE_ATTRIBUTE 28
|
||||
#define EXCCAUSE_STORE_CACHE_ATTRIBUTE 29
|
||||
#define EXCCAUSE_COPROCESSOR0_DISABLED 32
|
||||
#define EXCCAUSE_COPROCESSOR1_DISABLED 33
|
||||
#define EXCCAUSE_COPROCESSOR2_DISABLED 34
|
||||
#define EXCCAUSE_COPROCESSOR3_DISABLED 35
|
||||
#define EXCCAUSE_COPROCESSOR4_DISABLED 36
|
||||
#define EXCCAUSE_COPROCESSOR5_DISABLED 37
|
||||
#define EXCCAUSE_COPROCESSOR6_DISABLED 38
|
||||
#define EXCCAUSE_COPROCESSOR7_DISABLED 39
|
||||
|
||||
/* PS register fields. */
|
||||
|
||||
#define PS_WOE_BIT 18
|
||||
#define PS_CALLINC_SHIFT 16
|
||||
#define PS_CALLINC_MASK 0x00030000
|
||||
#define PS_OWB_SHIFT 8
|
||||
#define PS_OWB_WIDTH 4
|
||||
#define PS_OWB_MASK 0x00000F00
|
||||
#define PS_RING_SHIFT 6
|
||||
#define PS_RING_MASK 0x000000C0
|
||||
#define PS_UM_BIT 5
|
||||
#define PS_EXCM_BIT 4
|
||||
#define PS_INTLEVEL_SHIFT 0
|
||||
#define PS_INTLEVEL_WIDTH 4
|
||||
#define PS_INTLEVEL_MASK 0x0000000F
|
||||
|
||||
/* DBREAKCn register fields. */
|
||||
|
||||
#define DBREAKC_MASK_BIT 0
|
||||
#define DBREAKC_MASK_MASK 0x0000003F
|
||||
#define DBREAKC_LOAD_BIT 30
|
||||
#define DBREAKC_LOAD_MASK 0x40000000
|
||||
#define DBREAKC_STOR_BIT 31
|
||||
#define DBREAKC_STOR_MASK 0x80000000
|
||||
|
||||
/* DEBUGCAUSE register fields. */
|
||||
|
||||
#define DEBUGCAUSE_DEBUGINT_BIT 5 /* External debug interrupt */
|
||||
#define DEBUGCAUSE_BREAKN_BIT 4 /* BREAK.N instruction */
|
||||
#define DEBUGCAUSE_BREAK_BIT 3 /* BREAK instruction */
|
||||
#define DEBUGCAUSE_DBREAK_BIT 2 /* DBREAK match */
|
||||
#define DEBUGCAUSE_IBREAK_BIT 1 /* IBREAK match */
|
||||
#define DEBUGCAUSE_ICOUNT_BIT 0 /* ICOUNT would incr. to zero */
|
||||
|
||||
#endif /* _XTENSA_SPECREG_H */
|
131
arch/xtensa/include/asm/rwsem.h
Normal file
131
arch/xtensa/include/asm/rwsem.h
Normal file
|
@ -0,0 +1,131 @@
|
|||
/*
|
||||
* include/asm-xtensa/rwsem.h
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* Largely copied from include/asm-ppc/rwsem.h
|
||||
*
|
||||
* Copyright (C) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_RWSEM_H
|
||||
#define _XTENSA_RWSEM_H
|
||||
|
||||
#ifndef _LINUX_RWSEM_H
|
||||
#error "Please don't include <asm/rwsem.h> directly, use <linux/rwsem.h> instead."
|
||||
#endif
|
||||
|
||||
#define RWSEM_UNLOCKED_VALUE 0x00000000
|
||||
#define RWSEM_ACTIVE_BIAS 0x00000001
|
||||
#define RWSEM_ACTIVE_MASK 0x0000ffff
|
||||
#define RWSEM_WAITING_BIAS (-0x00010000)
|
||||
#define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS
|
||||
#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
|
||||
|
||||
/*
|
||||
* lock for reading
|
||||
*/
|
||||
static inline void __down_read(struct rw_semaphore *sem)
|
||||
{
|
||||
if (atomic_add_return(1,(atomic_t *)(&sem->count)) > 0)
|
||||
smp_wmb();
|
||||
else
|
||||
rwsem_down_read_failed(sem);
|
||||
}
|
||||
|
||||
static inline int __down_read_trylock(struct rw_semaphore *sem)
|
||||
{
|
||||
int tmp;
|
||||
|
||||
while ((tmp = sem->count) >= 0) {
|
||||
if (tmp == cmpxchg(&sem->count, tmp,
|
||||
tmp + RWSEM_ACTIVE_READ_BIAS)) {
|
||||
smp_wmb();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* lock for writing
|
||||
*/
|
||||
static inline void __down_write(struct rw_semaphore *sem)
|
||||
{
|
||||
int tmp;
|
||||
|
||||
tmp = atomic_add_return(RWSEM_ACTIVE_WRITE_BIAS,
|
||||
(atomic_t *)(&sem->count));
|
||||
if (tmp == RWSEM_ACTIVE_WRITE_BIAS)
|
||||
smp_wmb();
|
||||
else
|
||||
rwsem_down_write_failed(sem);
|
||||
}
|
||||
|
||||
static inline int __down_write_trylock(struct rw_semaphore *sem)
|
||||
{
|
||||
int tmp;
|
||||
|
||||
tmp = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE,
|
||||
RWSEM_ACTIVE_WRITE_BIAS);
|
||||
smp_wmb();
|
||||
return tmp == RWSEM_UNLOCKED_VALUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* unlock after reading
|
||||
*/
|
||||
static inline void __up_read(struct rw_semaphore *sem)
|
||||
{
|
||||
int tmp;
|
||||
|
||||
smp_wmb();
|
||||
tmp = atomic_sub_return(1,(atomic_t *)(&sem->count));
|
||||
if (tmp < -1 && (tmp & RWSEM_ACTIVE_MASK) == 0)
|
||||
rwsem_wake(sem);
|
||||
}
|
||||
|
||||
/*
|
||||
* unlock after writing
|
||||
*/
|
||||
static inline void __up_write(struct rw_semaphore *sem)
|
||||
{
|
||||
smp_wmb();
|
||||
if (atomic_sub_return(RWSEM_ACTIVE_WRITE_BIAS,
|
||||
(atomic_t *)(&sem->count)) < 0)
|
||||
rwsem_wake(sem);
|
||||
}
|
||||
|
||||
/*
|
||||
* implement atomic add functionality
|
||||
*/
|
||||
static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem)
|
||||
{
|
||||
atomic_add(delta, (atomic_t *)(&sem->count));
|
||||
}
|
||||
|
||||
/*
|
||||
* downgrade write lock to read lock
|
||||
*/
|
||||
static inline void __downgrade_write(struct rw_semaphore *sem)
|
||||
{
|
||||
int tmp;
|
||||
|
||||
smp_wmb();
|
||||
tmp = atomic_add_return(-RWSEM_WAITING_BIAS, (atomic_t *)(&sem->count));
|
||||
if (tmp < 0)
|
||||
rwsem_downgrade_wake(sem);
|
||||
}
|
||||
|
||||
/*
|
||||
* implement exchange and add functionality
|
||||
*/
|
||||
static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem)
|
||||
{
|
||||
smp_mb();
|
||||
return atomic_add_return(delta, (atomic_t *)(&sem->count));
|
||||
}
|
||||
|
||||
#endif /* _XTENSA_RWSEM_H */
|
16
arch/xtensa/include/asm/segment.h
Normal file
16
arch/xtensa/include/asm/segment.h
Normal file
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* include/asm-xtensa/segment.h
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_SEGMENT_H
|
||||
#define _XTENSA_SEGMENT_H
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#endif /* _XTENSA_SEGEMENT_H */
|
18
arch/xtensa/include/asm/serial.h
Normal file
18
arch/xtensa/include/asm/serial.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* include/asm-xtensa/serial.h
|
||||
*
|
||||
* Configuration details for 8250, 16450, 16550, etc. serial ports
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_SERIAL_H
|
||||
#define _XTENSA_SERIAL_H
|
||||
|
||||
#include <platform/serial.h>
|
||||
|
||||
#endif /* _XTENSA_SERIAL_H */
|
21
arch/xtensa/include/asm/shmparam.h
Normal file
21
arch/xtensa/include/asm/shmparam.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* include/asm-xtensa/shmparam.h
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_SHMPARAM_H
|
||||
#define _XTENSA_SHMPARAM_H
|
||||
|
||||
/*
|
||||
* Xtensa can have variable size caches, and if
|
||||
* the size of single way is larger than the page size,
|
||||
* then we have to start worrying about cache aliasing
|
||||
* problems.
|
||||
*/
|
||||
|
||||
#define SHMLBA ((PAGE_SIZE > DCACHE_WAY_SIZE)? PAGE_SIZE : DCACHE_WAY_SIZE)
|
||||
|
||||
#endif /* _XTENSA_SHMPARAM_H */
|
23
arch/xtensa/include/asm/signal.h
Normal file
23
arch/xtensa/include/asm/signal.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* include/asm-xtensa/signal.h
|
||||
*
|
||||
* Swiped from SH.
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
#ifndef _XTENSA_SIGNAL_H
|
||||
#define _XTENSA_SIGNAL_H
|
||||
|
||||
#include <uapi/asm/signal.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#define __ARCH_HAS_SA_RESTORER
|
||||
|
||||
#include <asm/sigcontext.h>
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* _XTENSA_SIGNAL_H */
|
43
arch/xtensa/include/asm/smp.h
Normal file
43
arch/xtensa/include/asm/smp.h
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* 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) 2001 - 2013 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_SMP_H
|
||||
#define _XTENSA_SMP_H
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
|
||||
#define raw_smp_processor_id() (current_thread_info()->cpu)
|
||||
#define cpu_logical_map(cpu) (cpu)
|
||||
|
||||
struct start_info {
|
||||
unsigned long stack;
|
||||
};
|
||||
extern struct start_info start_info;
|
||||
|
||||
struct cpumask;
|
||||
void arch_send_call_function_ipi_mask(const struct cpumask *mask);
|
||||
void arch_send_call_function_single_ipi(int cpu);
|
||||
|
||||
void smp_init_cpus(void);
|
||||
void secondary_init_irq(void);
|
||||
void ipi_init(void);
|
||||
struct seq_file;
|
||||
void show_ipi_list(struct seq_file *p, int prec);
|
||||
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
|
||||
void __cpu_die(unsigned int cpu);
|
||||
int __cpu_disable(void);
|
||||
void cpu_die(void);
|
||||
void cpu_restart(void);
|
||||
|
||||
#endif /* CONFIG_HOTPLUG_CPU */
|
||||
|
||||
#endif /* CONFIG_SMP */
|
||||
|
||||
#endif /* _XTENSA_SMP_H */
|
205
arch/xtensa/include/asm/spinlock.h
Normal file
205
arch/xtensa/include/asm/spinlock.h
Normal file
|
@ -0,0 +1,205 @@
|
|||
/*
|
||||
* include/asm-xtensa/spinlock.h
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_SPINLOCK_H
|
||||
#define _XTENSA_SPINLOCK_H
|
||||
|
||||
/*
|
||||
* spinlock
|
||||
*
|
||||
* There is at most one owner of a spinlock. There are not different
|
||||
* types of spinlock owners like there are for rwlocks (see below).
|
||||
*
|
||||
* When trying to obtain a spinlock, the function "spins" forever, or busy-
|
||||
* waits, until the lock is obtained. When spinning, presumably some other
|
||||
* owner will soon give up the spinlock making it available to others. Use
|
||||
* the trylock functions to avoid spinning forever.
|
||||
*
|
||||
* possible values:
|
||||
*
|
||||
* 0 nobody owns the spinlock
|
||||
* 1 somebody owns the spinlock
|
||||
*/
|
||||
|
||||
#define arch_spin_is_locked(x) ((x)->slock != 0)
|
||||
#define arch_spin_unlock_wait(lock) \
|
||||
do { while (arch_spin_is_locked(lock)) cpu_relax(); } while (0)
|
||||
|
||||
#define arch_spin_lock_flags(lock, flags) arch_spin_lock(lock)
|
||||
|
||||
static inline void arch_spin_lock(arch_spinlock_t *lock)
|
||||
{
|
||||
unsigned long tmp;
|
||||
|
||||
__asm__ __volatile__(
|
||||
" movi %0, 0\n"
|
||||
" wsr %0, scompare1\n"
|
||||
"1: movi %0, 1\n"
|
||||
" s32c1i %0, %1, 0\n"
|
||||
" bnez %0, 1b\n"
|
||||
: "=&a" (tmp)
|
||||
: "a" (&lock->slock)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
/* Returns 1 if the lock is obtained, 0 otherwise. */
|
||||
|
||||
static inline int arch_spin_trylock(arch_spinlock_t *lock)
|
||||
{
|
||||
unsigned long tmp;
|
||||
|
||||
__asm__ __volatile__(
|
||||
" movi %0, 0\n"
|
||||
" wsr %0, scompare1\n"
|
||||
" movi %0, 1\n"
|
||||
" s32c1i %0, %1, 0\n"
|
||||
: "=&a" (tmp)
|
||||
: "a" (&lock->slock)
|
||||
: "memory");
|
||||
|
||||
return tmp == 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
static inline void arch_spin_unlock(arch_spinlock_t *lock)
|
||||
{
|
||||
unsigned long tmp;
|
||||
|
||||
__asm__ __volatile__(
|
||||
" movi %0, 0\n"
|
||||
" s32ri %0, %1, 0\n"
|
||||
: "=&a" (tmp)
|
||||
: "a" (&lock->slock)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
/*
|
||||
* rwlock
|
||||
*
|
||||
* Read-write locks are really a more flexible spinlock. They allow
|
||||
* multiple readers but only one writer. Write ownership is exclusive
|
||||
* (i.e., all other readers and writers are blocked from ownership while
|
||||
* there is a write owner). These rwlocks are unfair to writers. Writers
|
||||
* can be starved for an indefinite time by readers.
|
||||
*
|
||||
* possible values:
|
||||
*
|
||||
* 0 nobody owns the rwlock
|
||||
* >0 one or more readers own the rwlock
|
||||
* (the positive value is the actual number of readers)
|
||||
* 0x80000000 one writer owns the rwlock, no other writers, no readers
|
||||
*/
|
||||
|
||||
#define arch_write_can_lock(x) ((x)->lock == 0)
|
||||
|
||||
static inline void arch_write_lock(arch_rwlock_t *rw)
|
||||
{
|
||||
unsigned long tmp;
|
||||
|
||||
__asm__ __volatile__(
|
||||
" movi %0, 0\n"
|
||||
" wsr %0, scompare1\n"
|
||||
"1: movi %0, 1\n"
|
||||
" slli %0, %0, 31\n"
|
||||
" s32c1i %0, %1, 0\n"
|
||||
" bnez %0, 1b\n"
|
||||
: "=&a" (tmp)
|
||||
: "a" (&rw->lock)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
/* Returns 1 if the lock is obtained, 0 otherwise. */
|
||||
|
||||
static inline int arch_write_trylock(arch_rwlock_t *rw)
|
||||
{
|
||||
unsigned long tmp;
|
||||
|
||||
__asm__ __volatile__(
|
||||
" movi %0, 0\n"
|
||||
" wsr %0, scompare1\n"
|
||||
" movi %0, 1\n"
|
||||
" slli %0, %0, 31\n"
|
||||
" s32c1i %0, %1, 0\n"
|
||||
: "=&a" (tmp)
|
||||
: "a" (&rw->lock)
|
||||
: "memory");
|
||||
|
||||
return tmp == 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
static inline void arch_write_unlock(arch_rwlock_t *rw)
|
||||
{
|
||||
unsigned long tmp;
|
||||
|
||||
__asm__ __volatile__(
|
||||
" movi %0, 0\n"
|
||||
" s32ri %0, %1, 0\n"
|
||||
: "=&a" (tmp)
|
||||
: "a" (&rw->lock)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
static inline void arch_read_lock(arch_rwlock_t *rw)
|
||||
{
|
||||
unsigned long tmp;
|
||||
unsigned long result;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"1: l32i %1, %2, 0\n"
|
||||
" bltz %1, 1b\n"
|
||||
" wsr %1, scompare1\n"
|
||||
" addi %0, %1, 1\n"
|
||||
" s32c1i %0, %2, 0\n"
|
||||
" bne %0, %1, 1b\n"
|
||||
: "=&a" (result), "=&a" (tmp)
|
||||
: "a" (&rw->lock)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
/* Returns 1 if the lock is obtained, 0 otherwise. */
|
||||
|
||||
static inline int arch_read_trylock(arch_rwlock_t *rw)
|
||||
{
|
||||
unsigned long result;
|
||||
unsigned long tmp;
|
||||
|
||||
__asm__ __volatile__(
|
||||
" l32i %1, %2, 0\n"
|
||||
" addi %0, %1, 1\n"
|
||||
" bltz %0, 1f\n"
|
||||
" wsr %1, scompare1\n"
|
||||
" s32c1i %0, %2, 0\n"
|
||||
" sub %0, %0, %1\n"
|
||||
"1:\n"
|
||||
: "=&a" (result), "=&a" (tmp)
|
||||
: "a" (&rw->lock)
|
||||
: "memory");
|
||||
|
||||
return result == 0;
|
||||
}
|
||||
|
||||
static inline void arch_read_unlock(arch_rwlock_t *rw)
|
||||
{
|
||||
unsigned long tmp1, tmp2;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"1: l32i %1, %2, 0\n"
|
||||
" addi %0, %1, -1\n"
|
||||
" wsr %1, scompare1\n"
|
||||
" s32c1i %0, %2, 0\n"
|
||||
" bne %0, %1, 1b\n"
|
||||
: "=&a" (tmp1), "=&a" (tmp2)
|
||||
: "a" (&rw->lock)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
#define arch_read_lock_flags(lock, flags) arch_read_lock(lock)
|
||||
#define arch_write_lock_flags(lock, flags) arch_write_lock(lock)
|
||||
|
||||
#endif /* _XTENSA_SPINLOCK_H */
|
20
arch/xtensa/include/asm/spinlock_types.h
Normal file
20
arch/xtensa/include/asm/spinlock_types.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
#ifndef __ASM_SPINLOCK_TYPES_H
|
||||
#define __ASM_SPINLOCK_TYPES_H
|
||||
|
||||
#ifndef __LINUX_SPINLOCK_TYPES_H
|
||||
# error "please don't include this file directly"
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
volatile unsigned int slock;
|
||||
} arch_spinlock_t;
|
||||
|
||||
#define __ARCH_SPIN_LOCK_UNLOCKED { 0 }
|
||||
|
||||
typedef struct {
|
||||
volatile unsigned int lock;
|
||||
} arch_rwlock_t;
|
||||
|
||||
#define __ARCH_RW_LOCK_UNLOCKED { 0 }
|
||||
|
||||
#endif
|
36
arch/xtensa/include/asm/stacktrace.h
Normal file
36
arch/xtensa/include/asm/stacktrace.h
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* arch/xtensa/include/asm/stacktrace.h
|
||||
*
|
||||
* 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) 2001 - 2013 Tensilica Inc.
|
||||
*/
|
||||
#ifndef _XTENSA_STACKTRACE_H
|
||||
#define _XTENSA_STACKTRACE_H
|
||||
|
||||
#include <linux/sched.h>
|
||||
|
||||
struct stackframe {
|
||||
unsigned long pc;
|
||||
unsigned long sp;
|
||||
};
|
||||
|
||||
static __always_inline unsigned long *stack_pointer(struct task_struct *task)
|
||||
{
|
||||
unsigned long *sp;
|
||||
|
||||
if (!task || task == current)
|
||||
__asm__ __volatile__ ("mov %0, a1\n" : "=a"(sp));
|
||||
else
|
||||
sp = (unsigned long *)task->thread.sp;
|
||||
|
||||
return sp;
|
||||
}
|
||||
|
||||
void walk_stackframe(unsigned long *sp,
|
||||
int (*fn)(struct stackframe *frame, void *data),
|
||||
void *data);
|
||||
|
||||
#endif /* _XTENSA_STACKTRACE_H */
|
121
arch/xtensa/include/asm/string.h
Normal file
121
arch/xtensa/include/asm/string.h
Normal file
|
@ -0,0 +1,121 @@
|
|||
/*
|
||||
* include/asm-xtensa/string.h
|
||||
*
|
||||
* These trivial string functions are considered part of the public domain.
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
/* We should optimize these. See arch/xtensa/lib/strncpy_user.S */
|
||||
|
||||
#ifndef _XTENSA_STRING_H
|
||||
#define _XTENSA_STRING_H
|
||||
|
||||
#define __HAVE_ARCH_STRCPY
|
||||
static inline char *strcpy(char *__dest, const char *__src)
|
||||
{
|
||||
register char *__xdest = __dest;
|
||||
unsigned long __dummy;
|
||||
|
||||
__asm__ __volatile__("1:\n\t"
|
||||
"l8ui %2, %1, 0\n\t"
|
||||
"s8i %2, %0, 0\n\t"
|
||||
"addi %1, %1, 1\n\t"
|
||||
"addi %0, %0, 1\n\t"
|
||||
"bnez %2, 1b\n\t"
|
||||
: "=r" (__dest), "=r" (__src), "=&r" (__dummy)
|
||||
: "0" (__dest), "1" (__src)
|
||||
: "memory");
|
||||
|
||||
return __xdest;
|
||||
}
|
||||
|
||||
#define __HAVE_ARCH_STRNCPY
|
||||
static inline char *strncpy(char *__dest, const char *__src, size_t __n)
|
||||
{
|
||||
register char *__xdest = __dest;
|
||||
unsigned long __dummy;
|
||||
|
||||
if (__n == 0)
|
||||
return __xdest;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"1:\n\t"
|
||||
"l8ui %2, %1, 0\n\t"
|
||||
"s8i %2, %0, 0\n\t"
|
||||
"addi %1, %1, 1\n\t"
|
||||
"addi %0, %0, 1\n\t"
|
||||
"beqz %2, 2f\n\t"
|
||||
"bne %1, %5, 1b\n"
|
||||
"2:"
|
||||
: "=r" (__dest), "=r" (__src), "=&r" (__dummy)
|
||||
: "0" (__dest), "1" (__src), "r" (__src+__n)
|
||||
: "memory");
|
||||
|
||||
return __xdest;
|
||||
}
|
||||
|
||||
#define __HAVE_ARCH_STRCMP
|
||||
static inline int strcmp(const char *__cs, const char *__ct)
|
||||
{
|
||||
register int __res;
|
||||
unsigned long __dummy;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"1:\n\t"
|
||||
"l8ui %3, %1, 0\n\t"
|
||||
"addi %1, %1, 1\n\t"
|
||||
"l8ui %2, %0, 0\n\t"
|
||||
"addi %0, %0, 1\n\t"
|
||||
"beqz %2, 2f\n\t"
|
||||
"beq %2, %3, 1b\n"
|
||||
"2:\n\t"
|
||||
"sub %2, %2, %3"
|
||||
: "=r" (__cs), "=r" (__ct), "=&r" (__res), "=&r" (__dummy)
|
||||
: "0" (__cs), "1" (__ct));
|
||||
|
||||
return __res;
|
||||
}
|
||||
|
||||
#define __HAVE_ARCH_STRNCMP
|
||||
static inline int strncmp(const char *__cs, const char *__ct, size_t __n)
|
||||
{
|
||||
register int __res;
|
||||
unsigned long __dummy;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"mov %2, %3\n"
|
||||
"1:\n\t"
|
||||
"beq %0, %6, 2f\n\t"
|
||||
"l8ui %3, %1, 0\n\t"
|
||||
"addi %1, %1, 1\n\t"
|
||||
"l8ui %2, %0, 0\n\t"
|
||||
"addi %0, %0, 1\n\t"
|
||||
"beqz %2, 2f\n\t"
|
||||
"beqz %3, 2f\n\t"
|
||||
"beq %2, %3, 1b\n"
|
||||
"2:\n\t"
|
||||
"sub %2, %2, %3"
|
||||
: "=r" (__cs), "=r" (__ct), "=&r" (__res), "=&r" (__dummy)
|
||||
: "0" (__cs), "1" (__ct), "r" (__cs+__n));
|
||||
|
||||
return __res;
|
||||
}
|
||||
|
||||
#define __HAVE_ARCH_MEMSET
|
||||
extern void *memset(void *__s, int __c, size_t __count);
|
||||
|
||||
#define __HAVE_ARCH_MEMCPY
|
||||
extern void *memcpy(void *__to, __const__ void *__from, size_t __n);
|
||||
|
||||
#define __HAVE_ARCH_MEMMOVE
|
||||
extern void *memmove(void *__dest, __const__ void *__src, size_t __n);
|
||||
|
||||
/* Don't build bcopy at all ... */
|
||||
#define __HAVE_ARCH_BCOPY
|
||||
|
||||
#endif /* _XTENSA_STRING_H */
|
22
arch/xtensa/include/asm/switch_to.h
Normal file
22
arch/xtensa/include/asm/switch_to.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_SWITCH_TO_H
|
||||
#define _XTENSA_SWITCH_TO_H
|
||||
|
||||
/* * switch_to(n) should switch tasks to task nr n, first
|
||||
* checking that n isn't the current task, in which case it does nothing.
|
||||
*/
|
||||
extern void *_switch_to(void *last, void *next);
|
||||
|
||||
#define switch_to(prev,next,last) \
|
||||
do { \
|
||||
(last) = _switch_to(prev, next); \
|
||||
} while(0)
|
||||
|
||||
#endif /* _XTENSA_SWITCH_TO_H */
|
27
arch/xtensa/include/asm/syscall.h
Normal file
27
arch/xtensa/include/asm/syscall.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* include/asm-xtensa/syscall.h
|
||||
*
|
||||
* 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) 2001 - 2007 Tensilica Inc.
|
||||
*/
|
||||
|
||||
struct pt_regs;
|
||||
asmlinkage long xtensa_ptrace(long, long, long, long);
|
||||
asmlinkage long xtensa_sigreturn(struct pt_regs*);
|
||||
asmlinkage long xtensa_rt_sigreturn(struct pt_regs*);
|
||||
asmlinkage long xtensa_shmat(int, char __user *, int);
|
||||
asmlinkage long xtensa_fadvise64_64(int, int,
|
||||
unsigned long long, unsigned long long);
|
||||
|
||||
/* Should probably move to linux/syscalls.h */
|
||||
struct pollfd;
|
||||
asmlinkage long sys_pselect6(int n, fd_set __user *inp, fd_set __user *outp,
|
||||
fd_set __user *exp, struct timespec __user *tsp,
|
||||
void __user *sig);
|
||||
asmlinkage long sys_ppoll(struct pollfd __user *ufds, unsigned int nfds,
|
||||
struct timespec __user *tsp,
|
||||
const sigset_t __user *sigmask,
|
||||
size_t sigsetsize);
|
38
arch/xtensa/include/asm/sysmem.h
Normal file
38
arch/xtensa/include/asm/sysmem.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* sysmem-related prototypes.
|
||||
*
|
||||
* 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) 2014 Cadence Design Systems Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_SYSMEM_H
|
||||
#define _XTENSA_SYSMEM_H
|
||||
|
||||
#define SYSMEM_BANKS_MAX 31
|
||||
|
||||
struct meminfo {
|
||||
unsigned long start;
|
||||
unsigned long end;
|
||||
};
|
||||
|
||||
/*
|
||||
* Bank array is sorted by .start.
|
||||
* Banks don't overlap and there's at least one page gap
|
||||
* between adjacent bank entries.
|
||||
*/
|
||||
struct sysmem_info {
|
||||
int nr_banks;
|
||||
struct meminfo bank[SYSMEM_BANKS_MAX];
|
||||
};
|
||||
|
||||
extern struct sysmem_info sysmem;
|
||||
|
||||
int add_sysmem_bank(unsigned long start, unsigned long end);
|
||||
int mem_reserve(unsigned long, unsigned long, int);
|
||||
void bootmem_init(void);
|
||||
void zones_init(void);
|
||||
|
||||
#endif /* _XTENSA_SYSMEM_H */
|
154
arch/xtensa/include/asm/thread_info.h
Normal file
154
arch/xtensa/include/asm/thread_info.h
Normal file
|
@ -0,0 +1,154 @@
|
|||
/*
|
||||
* include/asm-xtensa/thread_info.h
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_THREAD_INFO_H
|
||||
#define _XTENSA_THREAD_INFO_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
# include <asm/processor.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* low level task data that entry.S needs immediate access to
|
||||
* - this struct should fit entirely inside of one cache line
|
||||
* - this struct shares the supervisor stack pages
|
||||
* - if the contents of this structure are changed, the assembly constants
|
||||
* must also be changed
|
||||
*/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#if XTENSA_HAVE_COPROCESSORS
|
||||
|
||||
typedef struct xtregs_coprocessor {
|
||||
xtregs_cp0_t cp0;
|
||||
xtregs_cp1_t cp1;
|
||||
xtregs_cp2_t cp2;
|
||||
xtregs_cp3_t cp3;
|
||||
xtregs_cp4_t cp4;
|
||||
xtregs_cp5_t cp5;
|
||||
xtregs_cp6_t cp6;
|
||||
xtregs_cp7_t cp7;
|
||||
} xtregs_coprocessor_t;
|
||||
|
||||
#endif
|
||||
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
unsigned long flags; /* low level flags */
|
||||
unsigned long status; /* thread-synchronous flags */
|
||||
__u32 cpu; /* current CPU */
|
||||
__s32 preempt_count; /* 0 => preemptable,< 0 => BUG*/
|
||||
|
||||
mm_segment_t addr_limit; /* thread address space */
|
||||
struct restart_block restart_block;
|
||||
|
||||
unsigned long cpenable;
|
||||
|
||||
/* Allocate storage for extra user states and coprocessor states. */
|
||||
#if XTENSA_HAVE_COPROCESSORS
|
||||
xtregs_coprocessor_t xtregs_cp;
|
||||
#endif
|
||||
xtregs_user_t xtregs_user;
|
||||
};
|
||||
|
||||
#else /* !__ASSEMBLY__ */
|
||||
|
||||
/* offsets into the thread_info struct for assembly code access */
|
||||
#define TI_TASK 0x00000000
|
||||
#define TI_EXEC_DOMAIN 0x00000004
|
||||
#define TI_FLAGS 0x00000008
|
||||
#define TI_STATUS 0x0000000C
|
||||
#define TI_CPU 0x00000010
|
||||
#define TI_PRE_COUNT 0x00000014
|
||||
#define TI_ADDR_LIMIT 0x00000018
|
||||
#define TI_RESTART_BLOCK 0x000001C
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* macros/functions for gaining access to the thread information structure
|
||||
*/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#define INIT_THREAD_INFO(tsk) \
|
||||
{ \
|
||||
.task = &tsk, \
|
||||
.exec_domain = &default_exec_domain, \
|
||||
.flags = 0, \
|
||||
.cpu = 0, \
|
||||
.preempt_count = INIT_PREEMPT_COUNT, \
|
||||
.addr_limit = KERNEL_DS, \
|
||||
.restart_block = { \
|
||||
.fn = do_no_restart_syscall, \
|
||||
}, \
|
||||
}
|
||||
|
||||
#define init_thread_info (init_thread_union.thread_info)
|
||||
#define init_stack (init_thread_union.stack)
|
||||
|
||||
/* how to get the thread information struct from C */
|
||||
static inline struct thread_info *current_thread_info(void)
|
||||
{
|
||||
struct thread_info *ti;
|
||||
__asm__("extui %0,a1,0,13\n\t"
|
||||
"xor %0, a1, %0" : "=&r" (ti) : );
|
||||
return ti;
|
||||
}
|
||||
|
||||
#else /* !__ASSEMBLY__ */
|
||||
|
||||
/* how to get the thread information struct from ASM */
|
||||
#define GET_THREAD_INFO(reg,sp) \
|
||||
extui reg, sp, 0, 13; \
|
||||
xor reg, sp, reg
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* thread information flags
|
||||
* - these are process state flags that various assembly files may need to access
|
||||
* - pending work-to-be-done flags are in LSW
|
||||
* - other flags in MSW
|
||||
*/
|
||||
#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
|
||||
#define TIF_SIGPENDING 1 /* signal pending */
|
||||
#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
|
||||
#define TIF_SINGLESTEP 3 /* restore singlestep on return to user mode */
|
||||
#define TIF_MEMDIE 5 /* is terminating due to OOM killer */
|
||||
#define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */
|
||||
#define TIF_NOTIFY_RESUME 7 /* callback before returning to user */
|
||||
|
||||
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
|
||||
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
|
||||
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
|
||||
#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
|
||||
|
||||
#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
|
||||
#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
|
||||
|
||||
/*
|
||||
* Thread-synchronous status.
|
||||
*
|
||||
* This is different from the flags in that nobody else
|
||||
* ever touches our thread-synchronous status, so we don't
|
||||
* have to worry about atomic accesses.
|
||||
*/
|
||||
#define TS_USEDFPU 0x0001 /* FPU was used by this task this quantum (SMP) */
|
||||
|
||||
#define THREAD_SIZE 8192 //(2*PAGE_SIZE)
|
||||
#define THREAD_SIZE_ORDER 1
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _XTENSA_THREAD_INFO */
|
75
arch/xtensa/include/asm/timex.h
Normal file
75
arch/xtensa/include/asm/timex.h
Normal file
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* 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) 2001 - 2013 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_TIMEX_H
|
||||
#define _XTENSA_TIMEX_H
|
||||
|
||||
#include <asm/processor.h>
|
||||
#include <linux/stringify.h>
|
||||
|
||||
#define _INTLEVEL(x) XCHAL_INT ## x ## _LEVEL
|
||||
#define INTLEVEL(x) _INTLEVEL(x)
|
||||
|
||||
#if XCHAL_NUM_TIMERS > 0 && \
|
||||
INTLEVEL(XCHAL_TIMER0_INTERRUPT) <= XCHAL_EXCM_LEVEL
|
||||
# define LINUX_TIMER 0
|
||||
# define LINUX_TIMER_INT XCHAL_TIMER0_INTERRUPT
|
||||
#elif XCHAL_NUM_TIMERS > 1 && \
|
||||
INTLEVEL(XCHAL_TIMER1_INTERRUPT) <= XCHAL_EXCM_LEVEL
|
||||
# define LINUX_TIMER 1
|
||||
# define LINUX_TIMER_INT XCHAL_TIMER1_INTERRUPT
|
||||
#elif XCHAL_NUM_TIMERS > 2 && \
|
||||
INTLEVEL(XCHAL_TIMER2_INTERRUPT) <= XCHAL_EXCM_LEVEL
|
||||
# define LINUX_TIMER 2
|
||||
# define LINUX_TIMER_INT XCHAL_TIMER2_INTERRUPT
|
||||
#else
|
||||
# error "Bad timer number for Linux configurations!"
|
||||
#endif
|
||||
|
||||
extern unsigned long ccount_freq;
|
||||
|
||||
typedef unsigned long long cycles_t;
|
||||
|
||||
#define get_cycles() (0)
|
||||
|
||||
void local_timer_setup(unsigned cpu);
|
||||
|
||||
/*
|
||||
* Register access.
|
||||
*/
|
||||
|
||||
#define WSR_CCOUNT(r) asm volatile ("wsr %0, ccount" :: "a" (r))
|
||||
#define RSR_CCOUNT(r) asm volatile ("rsr %0, ccount" : "=a" (r))
|
||||
#define WSR_CCOMPARE(x,r) asm volatile ("wsr %0,"__stringify(SREG_CCOMPARE)"+"__stringify(x) :: "a"(r))
|
||||
#define RSR_CCOMPARE(x,r) asm volatile ("rsr %0,"__stringify(SREG_CCOMPARE)"+"__stringify(x) : "=a"(r))
|
||||
|
||||
static inline unsigned long get_ccount (void)
|
||||
{
|
||||
unsigned long ccount;
|
||||
RSR_CCOUNT(ccount);
|
||||
return ccount;
|
||||
}
|
||||
|
||||
static inline void set_ccount (unsigned long ccount)
|
||||
{
|
||||
WSR_CCOUNT(ccount);
|
||||
}
|
||||
|
||||
static inline unsigned long get_linux_timer (void)
|
||||
{
|
||||
unsigned ccompare;
|
||||
RSR_CCOMPARE(LINUX_TIMER, ccompare);
|
||||
return ccompare;
|
||||
}
|
||||
|
||||
static inline void set_linux_timer (unsigned long ccompare)
|
||||
{
|
||||
WSR_CCOMPARE(LINUX_TIMER, ccompare);
|
||||
}
|
||||
|
||||
#endif /* _XTENSA_TIMEX_H */
|
47
arch/xtensa/include/asm/tlb.h
Normal file
47
arch/xtensa/include/asm/tlb.h
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* include/asm-xtensa/tlb.h
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_TLB_H
|
||||
#define _XTENSA_TLB_H
|
||||
|
||||
#include <asm/cache.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
#if (DCACHE_WAY_SIZE <= PAGE_SIZE)
|
||||
|
||||
/* Note, read http://lkml.org/lkml/2004/1/15/6 */
|
||||
|
||||
# define tlb_start_vma(tlb,vma) do { } while (0)
|
||||
# define tlb_end_vma(tlb,vma) do { } while (0)
|
||||
|
||||
#else
|
||||
|
||||
# define tlb_start_vma(tlb, vma) \
|
||||
do { \
|
||||
if (!tlb->fullmm) \
|
||||
flush_cache_range(vma, vma->vm_start, vma->vm_end); \
|
||||
} while(0)
|
||||
|
||||
# define tlb_end_vma(tlb, vma) \
|
||||
do { \
|
||||
if (!tlb->fullmm) \
|
||||
flush_tlb_range(vma, vma->vm_start, vma->vm_end); \
|
||||
} while(0)
|
||||
|
||||
#endif
|
||||
|
||||
#define __tlb_remove_tlb_entry(tlb,pte,addr) do { } while (0)
|
||||
#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
|
||||
|
||||
#include <asm-generic/tlb.h>
|
||||
|
||||
#define __pte_free_tlb(tlb, pte, address) pte_free((tlb)->mm, pte)
|
||||
|
||||
#endif /* _XTENSA_TLB_H */
|
208
arch/xtensa/include/asm/tlbflush.h
Normal file
208
arch/xtensa/include/asm/tlbflush.h
Normal file
|
@ -0,0 +1,208 @@
|
|||
/*
|
||||
* 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) 2001 - 2013 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_TLBFLUSH_H
|
||||
#define _XTENSA_TLBFLUSH_H
|
||||
|
||||
#include <linux/stringify.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
#define DTLB_WAY_PGD 7
|
||||
|
||||
#define ITLB_ARF_WAYS 4
|
||||
#define DTLB_ARF_WAYS 4
|
||||
|
||||
#define ITLB_HIT_BIT 3
|
||||
#define DTLB_HIT_BIT 4
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/* TLB flushing:
|
||||
*
|
||||
* - flush_tlb_all() flushes all processes TLB entries
|
||||
* - flush_tlb_mm(mm) flushes the specified mm context TLB entries
|
||||
* - flush_tlb_page(mm, vmaddr) flushes a single page
|
||||
* - flush_tlb_range(mm, start, end) flushes a range of pages
|
||||
*/
|
||||
|
||||
void local_flush_tlb_all(void);
|
||||
void local_flush_tlb_mm(struct mm_struct *mm);
|
||||
void local_flush_tlb_page(struct vm_area_struct *vma,
|
||||
unsigned long page);
|
||||
void local_flush_tlb_range(struct vm_area_struct *vma,
|
||||
unsigned long start, unsigned long end);
|
||||
void local_flush_tlb_kernel_range(unsigned long start, unsigned long end);
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
|
||||
void flush_tlb_all(void);
|
||||
void flush_tlb_mm(struct mm_struct *);
|
||||
void flush_tlb_page(struct vm_area_struct *, unsigned long);
|
||||
void flush_tlb_range(struct vm_area_struct *, unsigned long,
|
||||
unsigned long);
|
||||
void flush_tlb_kernel_range(unsigned long start, unsigned long end);
|
||||
|
||||
#else /* !CONFIG_SMP */
|
||||
|
||||
#define flush_tlb_all() local_flush_tlb_all()
|
||||
#define flush_tlb_mm(mm) local_flush_tlb_mm(mm)
|
||||
#define flush_tlb_page(vma, page) local_flush_tlb_page(vma, page)
|
||||
#define flush_tlb_range(vma, vmaddr, end) local_flush_tlb_range(vma, vmaddr, \
|
||||
end)
|
||||
#define flush_tlb_kernel_range(start, end) local_flush_tlb_kernel_range(start, \
|
||||
end)
|
||||
|
||||
#endif /* CONFIG_SMP */
|
||||
|
||||
/* TLB operations. */
|
||||
|
||||
static inline unsigned long itlb_probe(unsigned long addr)
|
||||
{
|
||||
unsigned long tmp;
|
||||
__asm__ __volatile__("pitlb %0, %1\n\t" : "=a" (tmp) : "a" (addr));
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline unsigned long dtlb_probe(unsigned long addr)
|
||||
{
|
||||
unsigned long tmp;
|
||||
__asm__ __volatile__("pdtlb %0, %1\n\t" : "=a" (tmp) : "a" (addr));
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void invalidate_itlb_entry (unsigned long probe)
|
||||
{
|
||||
__asm__ __volatile__("iitlb %0; isync\n\t" : : "a" (probe));
|
||||
}
|
||||
|
||||
static inline void invalidate_dtlb_entry (unsigned long probe)
|
||||
{
|
||||
__asm__ __volatile__("idtlb %0; dsync\n\t" : : "a" (probe));
|
||||
}
|
||||
|
||||
/* Use the .._no_isync functions with caution. Generally, these are
|
||||
* handy for bulk invalidates followed by a single 'isync'. The
|
||||
* caller must follow up with an 'isync', which can be relatively
|
||||
* expensive on some Xtensa implementations.
|
||||
*/
|
||||
static inline void invalidate_itlb_entry_no_isync (unsigned entry)
|
||||
{
|
||||
/* Caller must follow up with 'isync'. */
|
||||
__asm__ __volatile__ ("iitlb %0\n" : : "a" (entry) );
|
||||
}
|
||||
|
||||
static inline void invalidate_dtlb_entry_no_isync (unsigned entry)
|
||||
{
|
||||
/* Caller must follow up with 'isync'. */
|
||||
__asm__ __volatile__ ("idtlb %0\n" : : "a" (entry) );
|
||||
}
|
||||
|
||||
static inline void set_itlbcfg_register (unsigned long val)
|
||||
{
|
||||
__asm__ __volatile__("wsr %0, itlbcfg\n\t" "isync\n\t"
|
||||
: : "a" (val));
|
||||
}
|
||||
|
||||
static inline void set_dtlbcfg_register (unsigned long val)
|
||||
{
|
||||
__asm__ __volatile__("wsr %0, dtlbcfg; dsync\n\t"
|
||||
: : "a" (val));
|
||||
}
|
||||
|
||||
static inline void set_ptevaddr_register (unsigned long val)
|
||||
{
|
||||
__asm__ __volatile__(" wsr %0, ptevaddr; isync\n"
|
||||
: : "a" (val));
|
||||
}
|
||||
|
||||
static inline unsigned long read_ptevaddr_register (void)
|
||||
{
|
||||
unsigned long tmp;
|
||||
__asm__ __volatile__("rsr %0, ptevaddr\n\t" : "=a" (tmp));
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline void write_dtlb_entry (pte_t entry, int way)
|
||||
{
|
||||
__asm__ __volatile__("wdtlb %1, %0; dsync\n\t"
|
||||
: : "r" (way), "r" (entry) );
|
||||
}
|
||||
|
||||
static inline void write_itlb_entry (pte_t entry, int way)
|
||||
{
|
||||
__asm__ __volatile__("witlb %1, %0; isync\n\t"
|
||||
: : "r" (way), "r" (entry) );
|
||||
}
|
||||
|
||||
static inline void invalidate_page_directory (void)
|
||||
{
|
||||
invalidate_dtlb_entry (DTLB_WAY_PGD);
|
||||
invalidate_dtlb_entry (DTLB_WAY_PGD+1);
|
||||
invalidate_dtlb_entry (DTLB_WAY_PGD+2);
|
||||
}
|
||||
|
||||
static inline void invalidate_itlb_mapping (unsigned address)
|
||||
{
|
||||
unsigned long tlb_entry;
|
||||
if (((tlb_entry = itlb_probe(address)) & (1 << ITLB_HIT_BIT)) != 0)
|
||||
invalidate_itlb_entry(tlb_entry);
|
||||
}
|
||||
|
||||
static inline void invalidate_dtlb_mapping (unsigned address)
|
||||
{
|
||||
unsigned long tlb_entry;
|
||||
if (((tlb_entry = dtlb_probe(address)) & (1 << DTLB_HIT_BIT)) != 0)
|
||||
invalidate_dtlb_entry(tlb_entry);
|
||||
}
|
||||
|
||||
#define check_pgt_cache() do { } while (0)
|
||||
|
||||
|
||||
/*
|
||||
* DO NOT USE THESE FUNCTIONS. These instructions aren't part of the Xtensa
|
||||
* ISA and exist only for test purposes..
|
||||
* You may find it helpful for MMU debugging, however.
|
||||
*
|
||||
* 'at' is the unmodified input register
|
||||
* 'as' is the output register, as follows (specific to the Linux config):
|
||||
*
|
||||
* as[31..12] contain the virtual address
|
||||
* as[11..08] are meaningless
|
||||
* as[07..00] contain the asid
|
||||
*/
|
||||
|
||||
static inline unsigned long read_dtlb_virtual (int way)
|
||||
{
|
||||
unsigned long tmp;
|
||||
__asm__ __volatile__("rdtlb0 %0, %1\n\t" : "=a" (tmp), "+a" (way));
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline unsigned long read_dtlb_translation (int way)
|
||||
{
|
||||
unsigned long tmp;
|
||||
__asm__ __volatile__("rdtlb1 %0, %1\n\t" : "=a" (tmp), "+a" (way));
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline unsigned long read_itlb_virtual (int way)
|
||||
{
|
||||
unsigned long tmp;
|
||||
__asm__ __volatile__("ritlb0 %0, %1\n\t" : "=a" (tmp), "+a" (way));
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline unsigned long read_itlb_translation (int way)
|
||||
{
|
||||
unsigned long tmp;
|
||||
__asm__ __volatile__("ritlb1 %0, %1\n\t" : "=a" (tmp), "+a" (way));
|
||||
return tmp;
|
||||
}
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* _XTENSA_TLBFLUSH_H */
|
59
arch/xtensa/include/asm/traps.h
Normal file
59
arch/xtensa/include/asm/traps.h
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* arch/xtensa/include/asm/traps.h
|
||||
*
|
||||
* 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 Tensilica Inc.
|
||||
*/
|
||||
#ifndef _XTENSA_TRAPS_H
|
||||
#define _XTENSA_TRAPS_H
|
||||
|
||||
#include <asm/ptrace.h>
|
||||
|
||||
/*
|
||||
* handler must be either of the following:
|
||||
* void (*)(struct pt_regs *regs);
|
||||
* void (*)(struct pt_regs *regs, unsigned long exccause);
|
||||
*/
|
||||
extern void * __init trap_set_handler(int cause, void *handler);
|
||||
extern void do_unhandled(struct pt_regs *regs, unsigned long exccause);
|
||||
void secondary_trap_init(void);
|
||||
|
||||
static inline void spill_registers(void)
|
||||
{
|
||||
#if XCHAL_NUM_AREGS > 16
|
||||
__asm__ __volatile__ (
|
||||
" call12 1f\n"
|
||||
" _j 2f\n"
|
||||
" retw\n"
|
||||
" .align 4\n"
|
||||
"1:\n"
|
||||
" _entry a1, 48\n"
|
||||
" addi a12, a0, 3\n"
|
||||
#if XCHAL_NUM_AREGS > 32
|
||||
" .rept (" __stringify(XCHAL_NUM_AREGS) " - 32) / 12\n"
|
||||
" _entry a1, 48\n"
|
||||
" mov a12, a0\n"
|
||||
" .endr\n"
|
||||
#endif
|
||||
" _entry a1, 48\n"
|
||||
#if XCHAL_NUM_AREGS % 12 == 0
|
||||
" mov a8, a8\n"
|
||||
#elif XCHAL_NUM_AREGS % 12 == 4
|
||||
" mov a12, a12\n"
|
||||
#elif XCHAL_NUM_AREGS % 12 == 8
|
||||
" mov a4, a4\n"
|
||||
#endif
|
||||
" retw\n"
|
||||
"2:\n"
|
||||
: : : "a12", "a13", "memory");
|
||||
#else
|
||||
__asm__ __volatile__ (
|
||||
" mov a12, a12\n"
|
||||
: : : "memory");
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* _XTENSA_TRAPS_H */
|
23
arch/xtensa/include/asm/types.h
Normal file
23
arch/xtensa/include/asm/types.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* include/asm-xtensa/types.h
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
#ifndef _XTENSA_TYPES_H
|
||||
#define _XTENSA_TYPES_H
|
||||
|
||||
#include <uapi/asm/types.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
/*
|
||||
* These aren't exported outside the kernel to avoid name space clashes
|
||||
*/
|
||||
|
||||
#define BITS_PER_LONG 32
|
||||
|
||||
#endif
|
||||
#endif /* _XTENSA_TYPES_H */
|
510
arch/xtensa/include/asm/uaccess.h
Normal file
510
arch/xtensa/include/asm/uaccess.h
Normal file
|
@ -0,0 +1,510 @@
|
|||
/*
|
||||
* include/asm-xtensa/uaccess.h
|
||||
*
|
||||
* User space memory access functions
|
||||
*
|
||||
* These routines provide basic accessing functions to the user memory
|
||||
* space for the kernel. This header file provides functions such as:
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_UACCESS_H
|
||||
#define _XTENSA_UACCESS_H
|
||||
|
||||
#include <linux/errno.h>
|
||||
#ifndef __ASSEMBLY__
|
||||
#include <linux/prefetch.h>
|
||||
#endif
|
||||
#include <asm/types.h>
|
||||
|
||||
#define VERIFY_READ 0
|
||||
#define VERIFY_WRITE 1
|
||||
|
||||
#ifdef __ASSEMBLY__
|
||||
|
||||
#include <asm/current.h>
|
||||
#include <asm/asm-offsets.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
/*
|
||||
* These assembly macros mirror the C macros that follow below. They
|
||||
* should always have identical functionality. See
|
||||
* arch/xtensa/kernel/sys.S for usage.
|
||||
*/
|
||||
|
||||
#define KERNEL_DS 0
|
||||
#define USER_DS 1
|
||||
|
||||
#define get_ds (KERNEL_DS)
|
||||
|
||||
/*
|
||||
* get_fs reads current->thread.current_ds into a register.
|
||||
* On Entry:
|
||||
* <ad> anything
|
||||
* <sp> stack
|
||||
* On Exit:
|
||||
* <ad> contains current->thread.current_ds
|
||||
*/
|
||||
.macro get_fs ad, sp
|
||||
GET_CURRENT(\ad,\sp)
|
||||
#if THREAD_CURRENT_DS > 1020
|
||||
addi \ad, \ad, TASK_THREAD
|
||||
l32i \ad, \ad, THREAD_CURRENT_DS - TASK_THREAD
|
||||
#else
|
||||
l32i \ad, \ad, THREAD_CURRENT_DS
|
||||
#endif
|
||||
.endm
|
||||
|
||||
/*
|
||||
* set_fs sets current->thread.current_ds to some value.
|
||||
* On Entry:
|
||||
* <at> anything (temp register)
|
||||
* <av> value to write
|
||||
* <sp> stack
|
||||
* On Exit:
|
||||
* <at> destroyed (actually, current)
|
||||
* <av> preserved, value to write
|
||||
*/
|
||||
.macro set_fs at, av, sp
|
||||
GET_CURRENT(\at,\sp)
|
||||
s32i \av, \at, THREAD_CURRENT_DS
|
||||
.endm
|
||||
|
||||
/*
|
||||
* kernel_ok determines whether we should bypass addr/size checking.
|
||||
* See the equivalent C-macro version below for clarity.
|
||||
* On success, kernel_ok branches to a label indicated by parameter
|
||||
* <success>. This implies that the macro falls through to the next
|
||||
* insruction on an error.
|
||||
*
|
||||
* Note that while this macro can be used independently, we designed
|
||||
* in for optimal use in the access_ok macro below (i.e., we fall
|
||||
* through on error).
|
||||
*
|
||||
* On Entry:
|
||||
* <at> anything (temp register)
|
||||
* <success> label to branch to on success; implies
|
||||
* fall-through macro on error
|
||||
* <sp> stack pointer
|
||||
* On Exit:
|
||||
* <at> destroyed (actually, current->thread.current_ds)
|
||||
*/
|
||||
|
||||
#if ((KERNEL_DS != 0) || (USER_DS == 0))
|
||||
# error Assembly macro kernel_ok fails
|
||||
#endif
|
||||
.macro kernel_ok at, sp, success
|
||||
get_fs \at, \sp
|
||||
beqz \at, \success
|
||||
.endm
|
||||
|
||||
/*
|
||||
* user_ok determines whether the access to user-space memory is allowed.
|
||||
* See the equivalent C-macro version below for clarity.
|
||||
*
|
||||
* On error, user_ok branches to a label indicated by parameter
|
||||
* <error>. This implies that the macro falls through to the next
|
||||
* instruction on success.
|
||||
*
|
||||
* Note that while this macro can be used independently, we designed
|
||||
* in for optimal use in the access_ok macro below (i.e., we fall
|
||||
* through on success).
|
||||
*
|
||||
* On Entry:
|
||||
* <aa> register containing memory address
|
||||
* <as> register containing memory size
|
||||
* <at> temp register
|
||||
* <error> label to branch to on error; implies fall-through
|
||||
* macro on success
|
||||
* On Exit:
|
||||
* <aa> preserved
|
||||
* <as> preserved
|
||||
* <at> destroyed (actually, (TASK_SIZE + 1 - size))
|
||||
*/
|
||||
.macro user_ok aa, as, at, error
|
||||
movi \at, __XTENSA_UL_CONST(TASK_SIZE)
|
||||
bgeu \as, \at, \error
|
||||
sub \at, \at, \as
|
||||
bgeu \aa, \at, \error
|
||||
.endm
|
||||
|
||||
/*
|
||||
* access_ok determines whether a memory access is allowed. See the
|
||||
* equivalent C-macro version below for clarity.
|
||||
*
|
||||
* On error, access_ok branches to a label indicated by parameter
|
||||
* <error>. This implies that the macro falls through to the next
|
||||
* instruction on success.
|
||||
*
|
||||
* Note that we assume success is the common case, and we optimize the
|
||||
* branch fall-through case on success.
|
||||
*
|
||||
* On Entry:
|
||||
* <aa> register containing memory address
|
||||
* <as> register containing memory size
|
||||
* <at> temp register
|
||||
* <sp>
|
||||
* <error> label to branch to on error; implies fall-through
|
||||
* macro on success
|
||||
* On Exit:
|
||||
* <aa> preserved
|
||||
* <as> preserved
|
||||
* <at> destroyed
|
||||
*/
|
||||
.macro access_ok aa, as, at, sp, error
|
||||
kernel_ok \at, \sp, .Laccess_ok_\@
|
||||
user_ok \aa, \as, \at, \error
|
||||
.Laccess_ok_\@:
|
||||
.endm
|
||||
|
||||
#else /* __ASSEMBLY__ not defined */
|
||||
|
||||
#include <linux/sched.h>
|
||||
|
||||
/*
|
||||
* The fs value determines whether argument validity checking should
|
||||
* be performed or not. If get_fs() == USER_DS, checking is
|
||||
* performed, with get_fs() == KERNEL_DS, checking is bypassed.
|
||||
*
|
||||
* For historical reasons (Data Segment Register?), these macros are
|
||||
* grossly misnamed.
|
||||
*/
|
||||
|
||||
#define KERNEL_DS ((mm_segment_t) { 0 })
|
||||
#define USER_DS ((mm_segment_t) { 1 })
|
||||
|
||||
#define get_ds() (KERNEL_DS)
|
||||
#define get_fs() (current->thread.current_ds)
|
||||
#define set_fs(val) (current->thread.current_ds = (val))
|
||||
|
||||
#define segment_eq(a,b) ((a).seg == (b).seg)
|
||||
|
||||
#define __kernel_ok (segment_eq(get_fs(), KERNEL_DS))
|
||||
#define __user_ok(addr,size) \
|
||||
(((size) <= TASK_SIZE)&&((addr) <= TASK_SIZE-(size)))
|
||||
#define __access_ok(addr,size) (__kernel_ok || __user_ok((addr),(size)))
|
||||
#define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size))
|
||||
|
||||
/*
|
||||
* These are the main single-value transfer routines. They
|
||||
* automatically use the right size if we just have the right pointer
|
||||
* type.
|
||||
*
|
||||
* This gets kind of ugly. We want to return _two_ values in
|
||||
* "get_user()" and yet we don't want to do any pointers, because that
|
||||
* is too much of a performance impact. Thus we have a few rather ugly
|
||||
* macros here, and hide all the uglyness from the user.
|
||||
*
|
||||
* Careful to not
|
||||
* (a) re-use the arguments for side effects (sizeof is ok)
|
||||
* (b) require any knowledge of processes at this stage
|
||||
*/
|
||||
#define put_user(x,ptr) __put_user_check((x),(ptr),sizeof(*(ptr)))
|
||||
#define get_user(x,ptr) __get_user_check((x),(ptr),sizeof(*(ptr)))
|
||||
|
||||
/*
|
||||
* The "__xxx" versions of the user access functions are versions that
|
||||
* do not verify the address space, that must have been done previously
|
||||
* with a separate "access_ok()" call (this is used when we do multiple
|
||||
* accesses to the same area of user memory).
|
||||
*/
|
||||
#define __put_user(x,ptr) __put_user_nocheck((x),(ptr),sizeof(*(ptr)))
|
||||
#define __get_user(x,ptr) __get_user_nocheck((x),(ptr),sizeof(*(ptr)))
|
||||
|
||||
|
||||
extern long __put_user_bad(void);
|
||||
|
||||
#define __put_user_nocheck(x,ptr,size) \
|
||||
({ \
|
||||
long __pu_err; \
|
||||
__put_user_size((x),(ptr),(size),__pu_err); \
|
||||
__pu_err; \
|
||||
})
|
||||
|
||||
#define __put_user_check(x,ptr,size) \
|
||||
({ \
|
||||
long __pu_err = -EFAULT; \
|
||||
__typeof__(*(ptr)) *__pu_addr = (ptr); \
|
||||
if (access_ok(VERIFY_WRITE,__pu_addr,size)) \
|
||||
__put_user_size((x),__pu_addr,(size),__pu_err); \
|
||||
__pu_err; \
|
||||
})
|
||||
|
||||
#define __put_user_size(x,ptr,size,retval) \
|
||||
do { \
|
||||
int __cb; \
|
||||
retval = 0; \
|
||||
switch (size) { \
|
||||
case 1: __put_user_asm(x,ptr,retval,1,"s8i",__cb); break; \
|
||||
case 2: __put_user_asm(x,ptr,retval,2,"s16i",__cb); break; \
|
||||
case 4: __put_user_asm(x,ptr,retval,4,"s32i",__cb); break; \
|
||||
case 8: { \
|
||||
__typeof__(*ptr) __v64 = x; \
|
||||
retval = __copy_to_user(ptr,&__v64,8); \
|
||||
break; \
|
||||
} \
|
||||
default: __put_user_bad(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
/*
|
||||
* Consider a case of a user single load/store would cause both an
|
||||
* unaligned exception and an MMU-related exception (unaligned
|
||||
* exceptions happen first):
|
||||
*
|
||||
* User code passes a bad variable ptr to a system call.
|
||||
* Kernel tries to access the variable.
|
||||
* Unaligned exception occurs.
|
||||
* Unaligned exception handler tries to make aligned accesses.
|
||||
* Double exception occurs for MMU-related cause (e.g., page not mapped).
|
||||
* do_page_fault() thinks the fault address belongs to the kernel, not the
|
||||
* user, and panics.
|
||||
*
|
||||
* The kernel currently prohibits user unaligned accesses. We use the
|
||||
* __check_align_* macros to check for unaligned addresses before
|
||||
* accessing user space so we don't crash the kernel. Both
|
||||
* __put_user_asm and __get_user_asm use these alignment macros, so
|
||||
* macro-specific labels such as 0f, 1f, %0, %2, and %3 must stay in
|
||||
* sync.
|
||||
*/
|
||||
|
||||
#define __check_align_1 ""
|
||||
|
||||
#define __check_align_2 \
|
||||
" _bbci.l %3, 0, 1f \n" \
|
||||
" movi %0, %4 \n" \
|
||||
" _j 2f \n"
|
||||
|
||||
#define __check_align_4 \
|
||||
" _bbsi.l %3, 0, 0f \n" \
|
||||
" _bbci.l %3, 1, 1f \n" \
|
||||
"0: movi %0, %4 \n" \
|
||||
" _j 2f \n"
|
||||
|
||||
|
||||
/*
|
||||
* We don't tell gcc that we are accessing memory, but this is OK
|
||||
* because we do not write to any memory gcc knows about, so there
|
||||
* are no aliasing issues.
|
||||
*
|
||||
* WARNING: If you modify this macro at all, verify that the
|
||||
* __check_align_* macros still work.
|
||||
*/
|
||||
#define __put_user_asm(x, addr, err, align, insn, cb) \
|
||||
__asm__ __volatile__( \
|
||||
__check_align_##align \
|
||||
"1: "insn" %2, %3, 0 \n" \
|
||||
"2: \n" \
|
||||
" .section .fixup,\"ax\" \n" \
|
||||
" .align 4 \n" \
|
||||
"4: \n" \
|
||||
" .long 2b \n" \
|
||||
"5: \n" \
|
||||
" l32r %1, 4b \n" \
|
||||
" movi %0, %4 \n" \
|
||||
" jx %1 \n" \
|
||||
" .previous \n" \
|
||||
" .section __ex_table,\"a\" \n" \
|
||||
" .long 1b, 5b \n" \
|
||||
" .previous" \
|
||||
:"=r" (err), "=r" (cb) \
|
||||
:"r" ((int)(x)), "r" (addr), "i" (-EFAULT), "0" (err))
|
||||
|
||||
#define __get_user_nocheck(x,ptr,size) \
|
||||
({ \
|
||||
long __gu_err, __gu_val; \
|
||||
__get_user_size(__gu_val,(ptr),(size),__gu_err); \
|
||||
(x) = (__typeof__(*(ptr)))__gu_val; \
|
||||
__gu_err; \
|
||||
})
|
||||
|
||||
#define __get_user_check(x,ptr,size) \
|
||||
({ \
|
||||
long __gu_err = -EFAULT, __gu_val = 0; \
|
||||
const __typeof__(*(ptr)) *__gu_addr = (ptr); \
|
||||
if (access_ok(VERIFY_READ,__gu_addr,size)) \
|
||||
__get_user_size(__gu_val,__gu_addr,(size),__gu_err); \
|
||||
(x) = (__typeof__(*(ptr)))__gu_val; \
|
||||
__gu_err; \
|
||||
})
|
||||
|
||||
extern long __get_user_bad(void);
|
||||
|
||||
#define __get_user_size(x,ptr,size,retval) \
|
||||
do { \
|
||||
int __cb; \
|
||||
retval = 0; \
|
||||
switch (size) { \
|
||||
case 1: __get_user_asm(x,ptr,retval,1,"l8ui",__cb); break; \
|
||||
case 2: __get_user_asm(x,ptr,retval,2,"l16ui",__cb); break; \
|
||||
case 4: __get_user_asm(x,ptr,retval,4,"l32i",__cb); break; \
|
||||
case 8: retval = __copy_from_user(&x,ptr,8); break; \
|
||||
default: (x) = __get_user_bad(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
/*
|
||||
* WARNING: If you modify this macro at all, verify that the
|
||||
* __check_align_* macros still work.
|
||||
*/
|
||||
#define __get_user_asm(x, addr, err, align, insn, cb) \
|
||||
__asm__ __volatile__( \
|
||||
__check_align_##align \
|
||||
"1: "insn" %2, %3, 0 \n" \
|
||||
"2: \n" \
|
||||
" .section .fixup,\"ax\" \n" \
|
||||
" .align 4 \n" \
|
||||
"4: \n" \
|
||||
" .long 2b \n" \
|
||||
"5: \n" \
|
||||
" l32r %1, 4b \n" \
|
||||
" movi %2, 0 \n" \
|
||||
" movi %0, %4 \n" \
|
||||
" jx %1 \n" \
|
||||
" .previous \n" \
|
||||
" .section __ex_table,\"a\" \n" \
|
||||
" .long 1b, 5b \n" \
|
||||
" .previous" \
|
||||
:"=r" (err), "=r" (cb), "=r" (x) \
|
||||
:"r" (addr), "i" (-EFAULT), "0" (err))
|
||||
|
||||
|
||||
/*
|
||||
* Copy to/from user space
|
||||
*/
|
||||
|
||||
/*
|
||||
* We use a generic, arbitrary-sized copy subroutine. The Xtensa
|
||||
* architecture would cause heavy code bloat if we tried to inline
|
||||
* these functions and provide __constant_copy_* equivalents like the
|
||||
* i386 versions. __xtensa_copy_user is quite efficient. See the
|
||||
* .fixup section of __xtensa_copy_user for a discussion on the
|
||||
* X_zeroing equivalents for Xtensa.
|
||||
*/
|
||||
|
||||
extern unsigned __xtensa_copy_user(void *to, const void *from, unsigned n);
|
||||
#define __copy_user(to,from,size) __xtensa_copy_user(to,from,size)
|
||||
|
||||
|
||||
static inline unsigned long
|
||||
__generic_copy_from_user_nocheck(void *to, const void *from, unsigned long n)
|
||||
{
|
||||
return __copy_user(to,from,n);
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
__generic_copy_to_user_nocheck(void *to, const void *from, unsigned long n)
|
||||
{
|
||||
return __copy_user(to,from,n);
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
__generic_copy_to_user(void *to, const void *from, unsigned long n)
|
||||
{
|
||||
prefetch(from);
|
||||
if (access_ok(VERIFY_WRITE, to, n))
|
||||
return __copy_user(to,from,n);
|
||||
return n;
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
__generic_copy_from_user(void *to, const void *from, unsigned long n)
|
||||
{
|
||||
prefetchw(to);
|
||||
if (access_ok(VERIFY_READ, from, n))
|
||||
return __copy_user(to,from,n);
|
||||
else
|
||||
memset(to, 0, n);
|
||||
return n;
|
||||
}
|
||||
|
||||
#define copy_to_user(to,from,n) __generic_copy_to_user((to),(from),(n))
|
||||
#define copy_from_user(to,from,n) __generic_copy_from_user((to),(from),(n))
|
||||
#define __copy_to_user(to,from,n) \
|
||||
__generic_copy_to_user_nocheck((to),(from),(n))
|
||||
#define __copy_from_user(to,from,n) \
|
||||
__generic_copy_from_user_nocheck((to),(from),(n))
|
||||
#define __copy_to_user_inatomic __copy_to_user
|
||||
#define __copy_from_user_inatomic __copy_from_user
|
||||
|
||||
|
||||
/*
|
||||
* We need to return the number of bytes not cleared. Our memset()
|
||||
* returns zero if a problem occurs while accessing user-space memory.
|
||||
* In that event, return no memory cleared. Otherwise, zero for
|
||||
* success.
|
||||
*/
|
||||
|
||||
static inline unsigned long
|
||||
__xtensa_clear_user(void *addr, unsigned long size)
|
||||
{
|
||||
if ( ! memset(addr, 0, size) )
|
||||
return size;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
clear_user(void *addr, unsigned long size)
|
||||
{
|
||||
if (access_ok(VERIFY_WRITE, addr, size))
|
||||
return __xtensa_clear_user(addr, size);
|
||||
return size ? -EFAULT : 0;
|
||||
}
|
||||
|
||||
#define __clear_user __xtensa_clear_user
|
||||
|
||||
|
||||
extern long __strncpy_user(char *, const char *, long);
|
||||
#define __strncpy_from_user __strncpy_user
|
||||
|
||||
static inline long
|
||||
strncpy_from_user(char *dst, const char *src, long count)
|
||||
{
|
||||
if (access_ok(VERIFY_READ, src, 1))
|
||||
return __strncpy_from_user(dst, src, count);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
|
||||
#define strlen_user(str) strnlen_user((str), TASK_SIZE - 1)
|
||||
|
||||
/*
|
||||
* Return the size of a string (including the ending 0!)
|
||||
*/
|
||||
extern long __strnlen_user(const char *, long);
|
||||
|
||||
static inline long strnlen_user(const char *str, long len)
|
||||
{
|
||||
unsigned long top = __kernel_ok ? ~0UL : TASK_SIZE - 1;
|
||||
|
||||
if ((unsigned long)str > top)
|
||||
return 0;
|
||||
return __strnlen_user(str, len);
|
||||
}
|
||||
|
||||
|
||||
struct exception_table_entry
|
||||
{
|
||||
unsigned long insn, fixup;
|
||||
};
|
||||
|
||||
/* Returns 0 if exception not found and fixup.unit otherwise. */
|
||||
|
||||
extern unsigned long search_exception_table(unsigned long addr);
|
||||
extern void sort_exception_table(void);
|
||||
|
||||
/* Returns the new pc */
|
||||
#define fixup_exception(map_reg, fixup_unit, pc) \
|
||||
({ \
|
||||
fixup_unit; \
|
||||
})
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* _XTENSA_UACCESS_H */
|
22
arch/xtensa/include/asm/ucontext.h
Normal file
22
arch/xtensa/include/asm/ucontext.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* include/asm-xtensa/ucontext.h
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_UCONTEXT_H
|
||||
#define _XTENSA_UCONTEXT_H
|
||||
|
||||
struct ucontext {
|
||||
unsigned long uc_flags;
|
||||
struct ucontext *uc_link;
|
||||
stack_t uc_stack;
|
||||
struct sigcontext uc_mcontext;
|
||||
sigset_t uc_sigmask; /* mask last for extensibility */
|
||||
};
|
||||
|
||||
#endif /* _XTENSA_UCONTEXT_H */
|
29
arch/xtensa/include/asm/unaligned.h
Normal file
29
arch/xtensa/include/asm/unaligned.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Xtensa doesn't handle unaligned accesses efficiently.
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
#ifndef _ASM_XTENSA_UNALIGNED_H
|
||||
#define _ASM_XTENSA_UNALIGNED_H
|
||||
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#ifdef __LITTLE_ENDIAN
|
||||
# include <linux/unaligned/le_struct.h>
|
||||
# include <linux/unaligned/be_byteshift.h>
|
||||
# include <linux/unaligned/generic.h>
|
||||
# define get_unaligned __get_unaligned_le
|
||||
# define put_unaligned __put_unaligned_le
|
||||
#else
|
||||
# include <linux/unaligned/be_struct.h>
|
||||
# include <linux/unaligned/le_byteshift.h>
|
||||
# include <linux/unaligned/generic.h>
|
||||
# define get_unaligned __get_unaligned_be
|
||||
# define put_unaligned __put_unaligned_be
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_XTENSA_UNALIGNED_H */
|
24
arch/xtensa/include/asm/unistd.h
Normal file
24
arch/xtensa/include/asm/unistd.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
#ifndef _XTENSA_UNISTD_H
|
||||
#define _XTENSA_UNISTD_H
|
||||
|
||||
#define __ARCH_WANT_SYS_CLONE
|
||||
#include <uapi/asm/unistd.h>
|
||||
|
||||
#define __ARCH_WANT_STAT64
|
||||
#define __ARCH_WANT_SYS_UTIME
|
||||
#define __ARCH_WANT_SYS_LLSEEK
|
||||
#define __ARCH_WANT_SYS_GETPGRP
|
||||
|
||||
/*
|
||||
* Ignore legacy system calls in the checksyscalls.sh script
|
||||
*/
|
||||
|
||||
#define __IGNORE_fork /* use clone */
|
||||
#define __IGNORE_time
|
||||
#define __IGNORE_alarm /* use setitimer */
|
||||
#define __IGNORE_pause
|
||||
#define __IGNORE_mmap /* use mmap2 */
|
||||
#define __IGNORE_vfork /* use clone */
|
||||
#define __IGNORE_fadvise64 /* use fadvise64_64 */
|
||||
|
||||
#endif /* _XTENSA_UNISTD_H */
|
20
arch/xtensa/include/asm/user.h
Normal file
20
arch/xtensa/include/asm/user.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* include/asm-xtensa/user.h
|
||||
*
|
||||
* Xtensa Processor version.
|
||||
*
|
||||
* 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) 2001 - 2005 Tensilica Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_USER_H
|
||||
#define _XTENSA_USER_H
|
||||
|
||||
/* This file usually defines a 'struct user' structure. However, it it only
|
||||
* used for a.out file, which are not supported on Xtensa.
|
||||
*/
|
||||
|
||||
#endif /* _XTENSA_USER_H */
|
130
arch/xtensa/include/asm/vectors.h
Normal file
130
arch/xtensa/include/asm/vectors.h
Normal file
|
@ -0,0 +1,130 @@
|
|||
/*
|
||||
* arch/xtensa/include/asm/xchal_vaddr_remap.h
|
||||
*
|
||||
* Xtensa macros for MMU V3 Support. Deals with re-mapping the Virtual
|
||||
* Memory Addresses from "Virtual == Physical" to their prevvious V2 MMU
|
||||
* mappings (KSEG at 0xD0000000 and KIO at 0XF0000000).
|
||||
*
|
||||
* 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 - 2012 Tensilica Inc.
|
||||
*
|
||||
* Pete Delaney <piet@tensilica.com>
|
||||
* Marc Gauthier <marc@tensilica.com
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_VECTORS_H
|
||||
#define _XTENSA_VECTORS_H
|
||||
|
||||
#include <variant/core.h>
|
||||
|
||||
#define XCHAL_KIO_CACHED_VADDR 0xe0000000
|
||||
#define XCHAL_KIO_BYPASS_VADDR 0xf0000000
|
||||
#define XCHAL_KIO_DEFAULT_PADDR 0xf0000000
|
||||
#define XCHAL_KIO_SIZE 0x10000000
|
||||
|
||||
#if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && defined(CONFIG_OF)
|
||||
#define XCHAL_KIO_PADDR xtensa_get_kio_paddr()
|
||||
#else
|
||||
#define XCHAL_KIO_PADDR XCHAL_KIO_DEFAULT_PADDR
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_MMU)
|
||||
|
||||
/* Will Become VECBASE */
|
||||
#define VIRTUAL_MEMORY_ADDRESS 0xD0000000
|
||||
|
||||
/* Image Virtual Start Address */
|
||||
#define KERNELOFFSET 0xD0003000
|
||||
|
||||
#if defined(XCHAL_HAVE_PTP_MMU) && XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY
|
||||
/* MMU v3 - XCHAL_HAVE_PTP_MMU == 1 */
|
||||
#define LOAD_MEMORY_ADDRESS 0x00003000
|
||||
#else
|
||||
/* MMU V2 - XCHAL_HAVE_PTP_MMU == 0 */
|
||||
#define LOAD_MEMORY_ADDRESS 0xD0003000
|
||||
#endif
|
||||
|
||||
#else /* !defined(CONFIG_MMU) */
|
||||
/* MMU Not being used - Virtual == Physical */
|
||||
|
||||
/* VECBASE */
|
||||
#define VIRTUAL_MEMORY_ADDRESS 0x00002000
|
||||
|
||||
/* Location of the start of the kernel text, _start */
|
||||
#define KERNELOFFSET 0x00003000
|
||||
|
||||
/* Loaded just above possibly live vectors */
|
||||
#define LOAD_MEMORY_ADDRESS 0x00003000
|
||||
|
||||
#endif /* CONFIG_MMU */
|
||||
|
||||
#define XC_VADDR(offset) (VIRTUAL_MEMORY_ADDRESS + offset)
|
||||
|
||||
/* Used to set VECBASE register */
|
||||
#define VECBASE_RESET_VADDR VIRTUAL_MEMORY_ADDRESS
|
||||
|
||||
#define RESET_VECTOR_VECOFS (XCHAL_RESET_VECTOR_VADDR - \
|
||||
VECBASE_RESET_VADDR)
|
||||
#define RESET_VECTOR_VADDR XC_VADDR(RESET_VECTOR_VECOFS)
|
||||
|
||||
#define RESET_VECTOR1_VECOFS (XCHAL_RESET_VECTOR1_VADDR - \
|
||||
VECBASE_RESET_VADDR)
|
||||
#define RESET_VECTOR1_VADDR XC_VADDR(RESET_VECTOR1_VECOFS)
|
||||
|
||||
#if defined(XCHAL_HAVE_VECBASE) && XCHAL_HAVE_VECBASE
|
||||
|
||||
#define USER_VECTOR_VADDR XC_VADDR(XCHAL_USER_VECOFS)
|
||||
#define KERNEL_VECTOR_VADDR XC_VADDR(XCHAL_KERNEL_VECOFS)
|
||||
#define DOUBLEEXC_VECTOR_VADDR XC_VADDR(XCHAL_DOUBLEEXC_VECOFS)
|
||||
#define WINDOW_VECTORS_VADDR XC_VADDR(XCHAL_WINDOW_OF4_VECOFS)
|
||||
#define INTLEVEL2_VECTOR_VADDR XC_VADDR(XCHAL_INTLEVEL2_VECOFS)
|
||||
#define INTLEVEL3_VECTOR_VADDR XC_VADDR(XCHAL_INTLEVEL3_VECOFS)
|
||||
#define INTLEVEL4_VECTOR_VADDR XC_VADDR(XCHAL_INTLEVEL4_VECOFS)
|
||||
#define INTLEVEL5_VECTOR_VADDR XC_VADDR(XCHAL_INTLEVEL5_VECOFS)
|
||||
#define INTLEVEL6_VECTOR_VADDR XC_VADDR(XCHAL_INTLEVEL6_VECOFS)
|
||||
|
||||
#define DEBUG_VECTOR_VADDR XC_VADDR(XCHAL_DEBUG_VECOFS)
|
||||
|
||||
#define NMI_VECTOR_VADDR XC_VADDR(XCHAL_NMI_VECOFS)
|
||||
|
||||
#define INTLEVEL7_VECTOR_VADDR XC_VADDR(XCHAL_INTLEVEL7_VECOFS)
|
||||
|
||||
/*
|
||||
* These XCHAL_* #defines from varian/core.h
|
||||
* are not valid to use with V3 MMU. Non-XCHAL
|
||||
* constants are defined above and should be used.
|
||||
*/
|
||||
#undef XCHAL_VECBASE_RESET_VADDR
|
||||
#undef XCHAL_RESET_VECTOR0_VADDR
|
||||
#undef XCHAL_USER_VECTOR_VADDR
|
||||
#undef XCHAL_KERNEL_VECTOR_VADDR
|
||||
#undef XCHAL_DOUBLEEXC_VECTOR_VADDR
|
||||
#undef XCHAL_WINDOW_VECTORS_VADDR
|
||||
#undef XCHAL_INTLEVEL2_VECTOR_VADDR
|
||||
#undef XCHAL_INTLEVEL3_VECTOR_VADDR
|
||||
#undef XCHAL_INTLEVEL4_VECTOR_VADDR
|
||||
#undef XCHAL_INTLEVEL5_VECTOR_VADDR
|
||||
#undef XCHAL_INTLEVEL6_VECTOR_VADDR
|
||||
#undef XCHAL_DEBUG_VECTOR_VADDR
|
||||
#undef XCHAL_NMI_VECTOR_VADDR
|
||||
#undef XCHAL_INTLEVEL7_VECTOR_VADDR
|
||||
|
||||
#else
|
||||
|
||||
#define USER_VECTOR_VADDR XCHAL_USER_VECTOR_VADDR
|
||||
#define KERNEL_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR
|
||||
#define DOUBLEEXC_VECTOR_VADDR XCHAL_DOUBLEEXC_VECTOR_VADDR
|
||||
#define WINDOW_VECTORS_VADDR XCHAL_WINDOW_VECTORS_VADDR
|
||||
#define INTLEVEL2_VECTOR_VADDR XCHAL_INTLEVEL2_VECTOR_VADDR
|
||||
#define INTLEVEL3_VECTOR_VADDR XCHAL_INTLEVEL3_VECTOR_VADDR
|
||||
#define INTLEVEL4_VECTOR_VADDR XCHAL_INTLEVEL4_VECTOR_VADDR
|
||||
#define INTLEVEL5_VECTOR_VADDR XCHAL_INTLEVEL5_VECTOR_VADDR
|
||||
#define INTLEVEL6_VECTOR_VADDR XCHAL_INTLEVEL6_VECTOR_VADDR
|
||||
#define DEBUG_VECTOR_VADDR XCHAL_DEBUG_VECTOR_VADDR
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _XTENSA_VECTORS_H */
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue