You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge tag 'xtensa-20161005' of git://github.com/jcmvbkbc/linux-xtensa
Pull Xtensa updates from Max Filippov:
"Updates for the xtensa architecture. It is a combined set of patches
for 4.8 that never got to the mainline and new patches for 4.9.
- add new kernel memory layouts for MMUv3 cores: with 256MB and 512MB
KSEG size, starting at physical address other than 0
- make kernel load address configurable
- clean up kernel memory layout macros
- drop sysmem early allocator and switch to memblock
- enable kmemleak and memory reservation from the device tree
- wire up new syscalls: userfaultfd, membarrier, mlock2,
copy_file_range, preadv2 and pwritev2
- add new platform: Cadence Configurable System Platform (CSP) and
new core variant for it: xt_lnx
- rearrange CCOUNT calibration code, make most of it generic
- improve machine reset code (XTFPGA now reboots reliably with MMUv3
cores)
- provide default memmap command line option for configurations
without device tree support
- ISS fixes: simdisk is now capable of using highmem pages, panic
correctly terminates simulator"
* tag 'xtensa-20161005' of git://github.com/jcmvbkbc/linux-xtensa: (24 commits)
xtensa: disable MMU initialization option on MMUv2 cores
xtensa: add default memmap and mmio32native options to defconfigs
xtensa: add default memmap option to common_defconfig
xtensa: add default memmap option to iss_defconfig
xtensa: ISS: allow simdisk to use high memory buffers
xtensa: ISS: define simc_exit and use it instead of inline asm
xtensa: xtfpga: group platform_* functions together
xtensa: rearrange CCOUNT calibration
xtensa: xtfpga: use clock provider, don't update DT
xtensa: Tweak xuartps UART driver Rx watermark for Cadence CSP config.
xtensa: initialize MMU before jumping to reset vector
xtensa: fix icountlevel setting in cpu_reset
xtensa: extract common CPU reset code into separate function
xtensa: Added Cadence CSP kernel configuration for Xtensa
xtensa: fix default kernel load address
xtensa: wire up new syscalls
xtensa: support reserved-memory DT node
xtensa: drop sysmem and switch to memblock
xtensa: minimize use of PLATFORM_DEFAULT_MEM_{ADDR,SIZE}
xtensa: cleanup MMU setup and kernel layout macros
...
This commit is contained in:
+144
-25
@@ -3,15 +3,8 @@ MMUv3 initialization sequence.
|
||||
The code in the initialize_mmu macro sets up MMUv3 memory mapping
|
||||
identically to MMUv2 fixed memory mapping. Depending on
|
||||
CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX symbol this code is
|
||||
located in one of the following address ranges:
|
||||
|
||||
0xF0000000..0xFFFFFFFF (will keep same address in MMU v2 layout;
|
||||
typically ROM)
|
||||
0x00000000..0x07FFFFFF (system RAM; this code is actually linked
|
||||
at 0xD0000000..0xD7FFFFFF [cached]
|
||||
or 0xD8000000..0xDFFFFFFF [uncached];
|
||||
in any case, initially runs elsewhere
|
||||
than linked, so have to be careful)
|
||||
located in addresses it was linked for (symbol undefined), or not
|
||||
(symbol defined), so it needs to be position-independent.
|
||||
|
||||
The code has the following assumptions:
|
||||
This code fragment is run only on an MMU v3.
|
||||
@@ -28,24 +21,26 @@ TLB setup proceeds along the following steps.
|
||||
PA = physical address (two upper nibbles of it);
|
||||
pc = physical range that contains this code;
|
||||
|
||||
After step 2, we jump to virtual address in 0x40000000..0x5fffffff
|
||||
that corresponds to next instruction to execute in this code.
|
||||
After step 4, we jump to intended (linked) address of this code.
|
||||
After step 2, we jump to virtual address in the range 0x40000000..0x5fffffff
|
||||
or 0x00000000..0x1fffffff, depending on whether the kernel was loaded below
|
||||
0x40000000 or above. That address corresponds to next instruction to execute
|
||||
in this code. After step 4, we jump to intended (linked) address of this code.
|
||||
The scheme below assumes that the kernel is loaded below 0x40000000.
|
||||
|
||||
Step 0 Step1 Step 2 Step3 Step 4 Step5
|
||||
============ ===== ============ ===== ============ =====
|
||||
VA PA PA VA PA PA VA PA PA
|
||||
------ -- -- ------ -- -- ------ -- --
|
||||
E0..FF -> E0 -> E0 E0..FF -> E0 F0..FF -> F0 -> F0
|
||||
C0..DF -> C0 -> C0 C0..DF -> C0 E0..EF -> F0 -> F0
|
||||
A0..BF -> A0 -> A0 A0..BF -> A0 D8..DF -> 00 -> 00
|
||||
80..9F -> 80 -> 80 80..9F -> 80 D0..D7 -> 00 -> 00
|
||||
60..7F -> 60 -> 60 60..7F -> 60
|
||||
40..5F -> 40 40..5F -> pc -> pc 40..5F -> pc
|
||||
20..3F -> 20 -> 20 20..3F -> 20
|
||||
00..1F -> 00 -> 00 00..1F -> 00
|
||||
Step0 Step1 Step2 Step3 Step4 Step5
|
||||
===== ===== ===== ===== ===== =====
|
||||
VA PA PA PA PA VA PA PA
|
||||
------ -- -- -- -- ------ -- --
|
||||
E0..FF -> E0 -> E0 -> E0 F0..FF -> F0 -> F0
|
||||
C0..DF -> C0 -> C0 -> C0 E0..EF -> F0 -> F0
|
||||
A0..BF -> A0 -> A0 -> A0 D8..DF -> 00 -> 00
|
||||
80..9F -> 80 -> 80 -> 80 D0..D7 -> 00 -> 00
|
||||
60..7F -> 60 -> 60 -> 60
|
||||
40..5F -> 40 -> pc -> pc 40..5F -> pc
|
||||
20..3F -> 20 -> 20 -> 20
|
||||
00..1F -> 00 -> 00 -> 00
|
||||
|
||||
The default location of IO peripherals is above 0xf0000000. This may change
|
||||
The default location of IO peripherals is above 0xf0000000. This may be changed
|
||||
using a "ranges" property in a device tree simple-bus node. See ePAPR 1.1, §6.5
|
||||
for details on the syntax and semantic of simple-bus nodes. The following
|
||||
limitations apply:
|
||||
@@ -62,3 +57,127 @@ limitations apply:
|
||||
|
||||
6. The IO area covers the entire 256MB segment of parent-bus-address; the
|
||||
"ranges" triplet length field is ignored
|
||||
|
||||
|
||||
MMUv3 address space layouts.
|
||||
============================
|
||||
|
||||
Default MMUv2-compatible layout.
|
||||
|
||||
Symbol VADDR Size
|
||||
+------------------+
|
||||
| Userspace | 0x00000000 TASK_SIZE
|
||||
+------------------+ 0x40000000
|
||||
+------------------+
|
||||
| Page table | 0x80000000
|
||||
+------------------+ 0x80400000
|
||||
+------------------+
|
||||
| KMAP area | PKMAP_BASE PTRS_PER_PTE *
|
||||
| | DCACHE_N_COLORS *
|
||||
| | PAGE_SIZE
|
||||
| | (4MB * DCACHE_N_COLORS)
|
||||
+------------------+
|
||||
| Atomic KMAP area | FIXADDR_START KM_TYPE_NR *
|
||||
| | NR_CPUS *
|
||||
| | DCACHE_N_COLORS *
|
||||
| | PAGE_SIZE
|
||||
+------------------+ FIXADDR_TOP 0xbffff000
|
||||
+------------------+
|
||||
| VMALLOC area | VMALLOC_START 0xc0000000 128MB - 64KB
|
||||
+------------------+ VMALLOC_END
|
||||
| Cache aliasing | TLBTEMP_BASE_1 0xc7ff0000 DCACHE_WAY_SIZE
|
||||
| remap area 1 |
|
||||
+------------------+
|
||||
| Cache aliasing | TLBTEMP_BASE_2 DCACHE_WAY_SIZE
|
||||
| remap area 2 |
|
||||
+------------------+
|
||||
+------------------+
|
||||
| Cached KSEG | XCHAL_KSEG_CACHED_VADDR 0xd0000000 128MB
|
||||
+------------------+
|
||||
| Uncached KSEG | XCHAL_KSEG_BYPASS_VADDR 0xd8000000 128MB
|
||||
+------------------+
|
||||
| Cached KIO | XCHAL_KIO_CACHED_VADDR 0xe0000000 256MB
|
||||
+------------------+
|
||||
| Uncached KIO | XCHAL_KIO_BYPASS_VADDR 0xf0000000 256MB
|
||||
+------------------+
|
||||
|
||||
|
||||
256MB cached + 256MB uncached layout.
|
||||
|
||||
Symbol VADDR Size
|
||||
+------------------+
|
||||
| Userspace | 0x00000000 TASK_SIZE
|
||||
+------------------+ 0x40000000
|
||||
+------------------+
|
||||
| Page table | 0x80000000
|
||||
+------------------+ 0x80400000
|
||||
+------------------+
|
||||
| KMAP area | PKMAP_BASE PTRS_PER_PTE *
|
||||
| | DCACHE_N_COLORS *
|
||||
| | PAGE_SIZE
|
||||
| | (4MB * DCACHE_N_COLORS)
|
||||
+------------------+
|
||||
| Atomic KMAP area | FIXADDR_START KM_TYPE_NR *
|
||||
| | NR_CPUS *
|
||||
| | DCACHE_N_COLORS *
|
||||
| | PAGE_SIZE
|
||||
+------------------+ FIXADDR_TOP 0x9ffff000
|
||||
+------------------+
|
||||
| VMALLOC area | VMALLOC_START 0xa0000000 128MB - 64KB
|
||||
+------------------+ VMALLOC_END
|
||||
| Cache aliasing | TLBTEMP_BASE_1 0xa7ff0000 DCACHE_WAY_SIZE
|
||||
| remap area 1 |
|
||||
+------------------+
|
||||
| Cache aliasing | TLBTEMP_BASE_2 DCACHE_WAY_SIZE
|
||||
| remap area 2 |
|
||||
+------------------+
|
||||
+------------------+
|
||||
| Cached KSEG | XCHAL_KSEG_CACHED_VADDR 0xb0000000 256MB
|
||||
+------------------+
|
||||
| Uncached KSEG | XCHAL_KSEG_BYPASS_VADDR 0xc0000000 256MB
|
||||
+------------------+
|
||||
+------------------+
|
||||
| Cached KIO | XCHAL_KIO_CACHED_VADDR 0xe0000000 256MB
|
||||
+------------------+
|
||||
| Uncached KIO | XCHAL_KIO_BYPASS_VADDR 0xf0000000 256MB
|
||||
+------------------+
|
||||
|
||||
|
||||
512MB cached + 512MB uncached layout.
|
||||
|
||||
Symbol VADDR Size
|
||||
+------------------+
|
||||
| Userspace | 0x00000000 TASK_SIZE
|
||||
+------------------+ 0x40000000
|
||||
+------------------+
|
||||
| Page table | 0x80000000
|
||||
+------------------+ 0x80400000
|
||||
+------------------+
|
||||
| KMAP area | PKMAP_BASE PTRS_PER_PTE *
|
||||
| | DCACHE_N_COLORS *
|
||||
| | PAGE_SIZE
|
||||
| | (4MB * DCACHE_N_COLORS)
|
||||
+------------------+
|
||||
| Atomic KMAP area | FIXADDR_START KM_TYPE_NR *
|
||||
| | NR_CPUS *
|
||||
| | DCACHE_N_COLORS *
|
||||
| | PAGE_SIZE
|
||||
+------------------+ FIXADDR_TOP 0x8ffff000
|
||||
+------------------+
|
||||
| VMALLOC area | VMALLOC_START 0x90000000 128MB - 64KB
|
||||
+------------------+ VMALLOC_END
|
||||
| Cache aliasing | TLBTEMP_BASE_1 0x97ff0000 DCACHE_WAY_SIZE
|
||||
| remap area 1 |
|
||||
+------------------+
|
||||
| Cache aliasing | TLBTEMP_BASE_2 DCACHE_WAY_SIZE
|
||||
| remap area 2 |
|
||||
+------------------+
|
||||
+------------------+
|
||||
| Cached KSEG | XCHAL_KSEG_CACHED_VADDR 0xa0000000 512MB
|
||||
+------------------+
|
||||
| Uncached KSEG | XCHAL_KSEG_BYPASS_VADDR 0xc0000000 512MB
|
||||
+------------------+
|
||||
| Cached KIO | XCHAL_KIO_CACHED_VADDR 0xe0000000 256MB
|
||||
+------------------+
|
||||
| Uncached KIO | XCHAL_KIO_BYPASS_VADDR 0xf0000000 256MB
|
||||
+------------------+
|
||||
|
||||
+78
-17
@@ -13,16 +13,19 @@ config XTENSA
|
||||
select GENERIC_IRQ_SHOW
|
||||
select GENERIC_PCI_IOMAP
|
||||
select GENERIC_SCHED_CLOCK
|
||||
select HAVE_DEBUG_KMEMLEAK
|
||||
select HAVE_DMA_API_DEBUG
|
||||
select HAVE_EXIT_THREAD
|
||||
select HAVE_FUNCTION_TRACER
|
||||
select HAVE_FUTEX_CMPXCHG if !MMU
|
||||
select HAVE_HW_BREAKPOINT if PERF_EVENTS
|
||||
select HAVE_IRQ_TIME_ACCOUNTING
|
||||
select HAVE_MEMBLOCK
|
||||
select HAVE_OPROFILE
|
||||
select HAVE_PERF_EVENTS
|
||||
select IRQ_DOMAIN
|
||||
select MODULES_USE_ELF_RELA
|
||||
select NO_BOOTMEM
|
||||
select PERF_USE_VMALLOC
|
||||
select VIRT_TO_BUS
|
||||
help
|
||||
@@ -209,7 +212,8 @@ config HOTPLUG_CPU
|
||||
|
||||
config INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
|
||||
bool "Initialize Xtensa MMU inside the Linux kernel code"
|
||||
default y
|
||||
depends on !XTENSA_VARIANT_FSF && !XTENSA_VARIANT_DC232B
|
||||
default y if XTENSA_VARIANT_DC233C || XTENSA_VARIANT_CUSTOM
|
||||
help
|
||||
Earlier version initialized the MMU in the exception vector
|
||||
before jumping to _startup in head.S and had an advantage that
|
||||
@@ -236,6 +240,71 @@ config INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
|
||||
|
||||
If in doubt, say Y.
|
||||
|
||||
config KSEG_PADDR
|
||||
hex "Physical address of the KSEG mapping"
|
||||
depends on INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX && MMU
|
||||
default 0x00000000
|
||||
help
|
||||
This is the physical address where KSEG is mapped. Please refer to
|
||||
the chosen KSEG layout help for the required address alignment.
|
||||
Unpacked kernel image (including vectors) must be located completely
|
||||
within KSEG.
|
||||
Physical memory below this address is not available to linux.
|
||||
|
||||
If unsure, leave the default value here.
|
||||
|
||||
config KERNEL_LOAD_ADDRESS
|
||||
hex "Kernel load address"
|
||||
default 0x60003000 if !MMU
|
||||
default 0x00003000 if MMU && INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
|
||||
default 0xd0003000 if MMU && !INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
|
||||
help
|
||||
This is the address where the kernel is loaded.
|
||||
It is virtual address for MMUv2 configurations and physical address
|
||||
for all other configurations.
|
||||
|
||||
If unsure, leave the default value here.
|
||||
|
||||
config VECTORS_OFFSET
|
||||
hex "Kernel vectors offset"
|
||||
default 0x00003000
|
||||
help
|
||||
This is the offset of the kernel image from the relocatable vectors
|
||||
base.
|
||||
|
||||
If unsure, leave the default value here.
|
||||
|
||||
choice
|
||||
prompt "KSEG layout"
|
||||
depends on MMU
|
||||
default XTENSA_KSEG_MMU_V2
|
||||
|
||||
config XTENSA_KSEG_MMU_V2
|
||||
bool "MMUv2: 128MB cached + 128MB uncached"
|
||||
help
|
||||
MMUv2 compatible kernel memory map: TLB way 5 maps 128MB starting
|
||||
at KSEG_PADDR to 0xd0000000 with cache and to 0xd8000000
|
||||
without cache.
|
||||
KSEG_PADDR must be aligned to 128MB.
|
||||
|
||||
config XTENSA_KSEG_256M
|
||||
bool "256MB cached + 256MB uncached"
|
||||
depends on INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
|
||||
help
|
||||
TLB way 6 maps 256MB starting at KSEG_PADDR to 0xb0000000
|
||||
with cache and to 0xc0000000 without cache.
|
||||
KSEG_PADDR must be aligned to 256MB.
|
||||
|
||||
config XTENSA_KSEG_512M
|
||||
bool "512MB cached + 512MB uncached"
|
||||
depends on INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
|
||||
help
|
||||
TLB way 6 maps 512MB starting at KSEG_PADDR to 0xa0000000
|
||||
with cache and to 0xc0000000 without cache.
|
||||
KSEG_PADDR must be aligned to 256MB.
|
||||
|
||||
endchoice
|
||||
|
||||
config HIGHMEM
|
||||
bool "High Memory Support"
|
||||
depends on MMU
|
||||
@@ -331,7 +400,7 @@ config XTENSA_PLATFORM_XT2000
|
||||
config XTENSA_PLATFORM_XTFPGA
|
||||
bool "XTFPGA"
|
||||
select ETHOC if ETHERNET
|
||||
select PLATFORM_WANT_DEFAULT_MEM
|
||||
select PLATFORM_WANT_DEFAULT_MEM if !MMU
|
||||
select SERIAL_CONSOLE
|
||||
select XTENSA_CALIBRATE_CCOUNT
|
||||
help
|
||||
@@ -369,6 +438,7 @@ config USE_OF
|
||||
bool "Flattened Device Tree support"
|
||||
select OF
|
||||
select OF_EARLY_FLATTREE
|
||||
select OF_RESERVED_MEM
|
||||
help
|
||||
Include support for flattened device tree machine descriptions.
|
||||
|
||||
@@ -439,16 +509,9 @@ config DEFAULT_MEM_START
|
||||
default 0x00000000 if MMU
|
||||
default 0x60000000 if !MMU
|
||||
help
|
||||
This is a fallback start address of the default memory area, it is
|
||||
used when no physical memory size is passed through DTB or through
|
||||
boot parameter from bootloader.
|
||||
|
||||
In noMMU configuration the following parameters are derived from it:
|
||||
- kernel load address;
|
||||
- kernel entry point address;
|
||||
- relocatable vectors base address;
|
||||
- uBoot load address;
|
||||
- TASK_SIZE.
|
||||
This is the base address of the default memory area.
|
||||
Default memory area has platform-specific meaning, it may be used
|
||||
for e.g. early cache initialization.
|
||||
|
||||
If unsure, leave the default value here.
|
||||
|
||||
@@ -457,11 +520,9 @@ config DEFAULT_MEM_SIZE
|
||||
depends on PLATFORM_WANT_DEFAULT_MEM
|
||||
default 0x04000000
|
||||
help
|
||||
This is a fallback size of the default memory area, it is used when
|
||||
no physical memory size is passed through DTB or through boot
|
||||
parameter from bootloader.
|
||||
|
||||
It's also used for TASK_SIZE calculation in noMMU configuration.
|
||||
This is the size of the default memory area.
|
||||
Default memory area has platform-specific meaning, it may be used
|
||||
for e.g. early cache initialization.
|
||||
|
||||
If unsure, leave the default value here.
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ SECTIONS
|
||||
*(.ResetVector.text)
|
||||
}
|
||||
|
||||
.image KERNELOFFSET: AT (LOAD_MEMORY_ADDRESS)
|
||||
.image KERNELOFFSET: AT (CONFIG_KERNEL_LOAD_ADDRESS)
|
||||
{
|
||||
_image_start = .;
|
||||
*(image)
|
||||
|
||||
@@ -35,7 +35,12 @@ _ResetVector:
|
||||
|
||||
.align 4
|
||||
RomInitAddr:
|
||||
.word LOAD_MEMORY_ADDRESS
|
||||
#if defined(CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX) && \
|
||||
XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY
|
||||
.word CONFIG_KERNEL_LOAD_ADDRESS
|
||||
#else
|
||||
.word KERNELOFFSET
|
||||
#endif
|
||||
RomBootParam:
|
||||
.word _bootparam
|
||||
_bootparam:
|
||||
|
||||
@@ -4,15 +4,7 @@
|
||||
# for more details.
|
||||
#
|
||||
|
||||
ifdef CONFIG_MMU
|
||||
ifdef CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX
|
||||
UIMAGE_LOADADDR = 0x00003000
|
||||
else
|
||||
UIMAGE_LOADADDR = 0xd0003000
|
||||
endif
|
||||
else
|
||||
UIMAGE_LOADADDR = $(shell printf "0x%x" $$(( ${CONFIG_DEFAULT_MEM_START} + 0x3000 )) )
|
||||
endif
|
||||
UIMAGE_LOADADDR = $(CONFIG_KERNEL_LOAD_ADDRESS)
|
||||
UIMAGE_COMPRESSION = gzip
|
||||
|
||||
$(obj)/../uImage: vmlinux.bin.gz FORCE
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/dts-v1/;
|
||||
|
||||
/ {
|
||||
compatible = "cdns,xtensa-xtfpga";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
interrupt-parent = <&pic>;
|
||||
|
||||
chosen {
|
||||
bootargs = "earlycon=cdns,0xfd000000,115200 console=tty0 console=ttyPS0,115200 root=/dev/ram0 rw earlyprintk xilinx_uartps.rx_trigger_level=32 loglevel=8 nohz=off ignore_loglevel";
|
||||
};
|
||||
|
||||
memory@0 {
|
||||
device_type = "memory";
|
||||
reg = <0x00000000 0x40000000>;
|
||||
};
|
||||
|
||||
cpus {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
cpu@0 {
|
||||
compatible = "cdns,xtensa-cpu";
|
||||
reg = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
pic: pic {
|
||||
compatible = "cdns,xtensa-pic";
|
||||
#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>;
|
||||
|
||||
uart0: serial@0d000000 {
|
||||
compatible = "xlnx,xuartps", "cdns,uart-r1p8";
|
||||
clocks = <&osc>, <&osc>;
|
||||
clock-names = "uart_clk", "pclk";
|
||||
reg = <0x0d000000 0x1000>;
|
||||
interrupts = <0 1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -19,9 +19,7 @@
|
||||
cpu@0 {
|
||||
compatible = "cdns,xtensa-cpu";
|
||||
reg = <0>;
|
||||
/* Filled in by platform_setup from FPGA register
|
||||
* clock-frequency = <100000000>;
|
||||
*/
|
||||
clocks = <&osc>;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -36,11 +34,6 @@
|
||||
};
|
||||
|
||||
clocks {
|
||||
osc: main-oscillator {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
};
|
||||
|
||||
clk54: clk54 {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
@@ -54,6 +47,12 @@
|
||||
compatible = "simple-bus";
|
||||
ranges = <0x00000000 0xf0000000 0x10000000>;
|
||||
|
||||
osc: main-oscillator {
|
||||
#clock-cells = <0>;
|
||||
compatible = "cdns,xtfpga-clock";
|
||||
reg = <0x0d020004 0x4>;
|
||||
};
|
||||
|
||||
serial0: serial@0d050020 {
|
||||
device_type = "serial";
|
||||
compatible = "ns16550a";
|
||||
|
||||
@@ -33,7 +33,7 @@ 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_CMDLINE="earlycon=uart8250,mmio32native,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=0x38000000@0"
|
||||
CONFIG_USE_OF=y
|
||||
CONFIG_BUILTIN_DTB="kc705"
|
||||
# CONFIG_COMPACTION is not set
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
CONFIG_USELIB=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_FREEZER=y
|
||||
CONFIG_CPUSETS=y
|
||||
CONFIG_CGROUP_DEVICE=y
|
||||
CONFIG_CGROUP_CPUACCT=y
|
||||
CONFIG_CGROUP_DEBUG=y
|
||||
CONFIG_NAMESPACES=y
|
||||
CONFIG_SCHED_AUTOGROUP=y
|
||||
CONFIG_RELAY=y
|
||||
CONFIG_BLK_DEV_INITRD=y
|
||||
CONFIG_INITRAMFS_SOURCE="$$KERNEL_INITRAMFS_SOURCE"
|
||||
# CONFIG_RD_BZIP2 is not set
|
||||
# CONFIG_RD_LZMA is not set
|
||||
# CONFIG_RD_XZ is not set
|
||||
# CONFIG_RD_LZO is not set
|
||||
# CONFIG_RD_LZ4 is not set
|
||||
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
|
||||
CONFIG_SYSCTL_SYSCALL=y
|
||||
CONFIG_EMBEDDED=y
|
||||
CONFIG_PROFILING=y
|
||||
CONFIG_MODULES=y
|
||||
CONFIG_MODULE_FORCE_LOAD=y
|
||||
CONFIG_MODULE_UNLOAD=y
|
||||
CONFIG_MODULE_FORCE_UNLOAD=y
|
||||
# CONFIG_IOSCHED_DEADLINE is not set
|
||||
# CONFIG_IOSCHED_CFQ is not set
|
||||
CONFIG_XTENSA_VARIANT_CUSTOM=y
|
||||
CONFIG_XTENSA_VARIANT_CUSTOM_NAME="csp"
|
||||
CONFIG_XTENSA_UNALIGNED_USER=y
|
||||
CONFIG_PREEMPT=y
|
||||
CONFIG_HIGHMEM=y
|
||||
# CONFIG_PCI is not set
|
||||
CONFIG_XTENSA_PLATFORM_XTFPGA=y
|
||||
CONFIG_USE_OF=y
|
||||
CONFIG_BUILTIN_DTB="csp"
|
||||
# CONFIG_COMPACTION is not set
|
||||
CONFIG_XTFPGA_LCD=y
|
||||
# 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_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_DIAG is not set
|
||||
# CONFIG_IPV6 is not set
|
||||
# CONFIG_WIRELESS is not set
|
||||
CONFIG_DEVTMPFS=y
|
||||
CONFIG_DEVTMPFS_MOUNT=y
|
||||
# CONFIG_STANDALONE is not set
|
||||
# CONFIG_FW_LOADER 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_INPUT_MOUSEDEV is not set
|
||||
# CONFIG_INPUT_KEYBOARD is not set
|
||||
# CONFIG_INPUT_MOUSE is not set
|
||||
CONFIG_LEGACY_PTY_COUNT=16
|
||||
CONFIG_SERIAL_XILINX_PS_UART=y
|
||||
CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=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_FANOTIFY=y
|
||||
CONFIG_VFAT_FS=y
|
||||
CONFIG_PROC_KCORE=y
|
||||
CONFIG_TMPFS=y
|
||||
CONFIG_TMPFS_POSIX_ACL=y
|
||||
# CONFIG_MISC_FILESYSTEMS is not set
|
||||
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_PROVE_LOCKING=y
|
||||
CONFIG_DEBUG_ATOMIC_SLEEP=y
|
||||
CONFIG_RCU_TRACE=y
|
||||
CONFIG_FUNCTION_TRACER=y
|
||||
# CONFIG_S32C1I_SELFTEST is not set
|
||||
# CONFIG_CRYPTO_ECHAINIV is not set
|
||||
CONFIG_CRYPTO_DEFLATE=y
|
||||
CONFIG_CRYPTO_LZO=y
|
||||
# CONFIG_CRYPTO_HW is not set
|
||||
File diff suppressed because it is too large
Load Diff
@@ -32,7 +32,7 @@ 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_CMDLINE="earlycon=uart8250,mmio32native,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=0x38000000@0"
|
||||
CONFIG_USE_OF=y
|
||||
CONFIG_BUILTIN_DTB="kc705"
|
||||
# CONFIG_COMPACTION is not set
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -37,7 +37,7 @@ CONFIG_PREEMPT=y
|
||||
# CONFIG_PCI is not set
|
||||
CONFIG_XTENSA_PLATFORM_XTFPGA=y
|
||||
CONFIG_CMDLINE_BOOL=y
|
||||
CONFIG_CMDLINE="earlycon=uart8250,mmio32,0x9d050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug"
|
||||
CONFIG_CMDLINE="earlycon=uart8250,mmio32native,0x9d050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=256M@0x60000000"
|
||||
CONFIG_USE_OF=y
|
||||
CONFIG_BUILTIN_DTB="kc705_nommu"
|
||||
CONFIG_DEFAULT_MEM_SIZE=0x10000000
|
||||
|
||||
@@ -36,7 +36,7 @@ CONFIG_HOTPLUG_CPU=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_CMDLINE="earlycon=uart8250,mmio32native,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=96M@0"
|
||||
CONFIG_USE_OF=y
|
||||
CONFIG_BUILTIN_DTB="lx200mx"
|
||||
# CONFIG_COMPACTION is not set
|
||||
|
||||
@@ -48,7 +48,7 @@ static inline int ffz(unsigned long x)
|
||||
* __ffs: Find first bit set in word. Return 0 for bit 0
|
||||
*/
|
||||
|
||||
static inline int __ffs(unsigned long x)
|
||||
static inline unsigned long __ffs(unsigned long x)
|
||||
{
|
||||
return 31 - __cntlz(x & -x);
|
||||
}
|
||||
|
||||
@@ -69,26 +69,23 @@
|
||||
.endm
|
||||
|
||||
|
||||
#if XCHAL_DCACHE_LINE_LOCKABLE
|
||||
|
||||
.macro ___unlock_dcache_all ar at
|
||||
|
||||
#if XCHAL_DCACHE_SIZE
|
||||
#if XCHAL_DCACHE_LINE_LOCKABLE && XCHAL_DCACHE_SIZE
|
||||
__loop_cache_all \ar \at diu XCHAL_DCACHE_SIZE XCHAL_DCACHE_LINEWIDTH
|
||||
#endif
|
||||
|
||||
.endm
|
||||
|
||||
#endif
|
||||
|
||||
#if XCHAL_ICACHE_LINE_LOCKABLE
|
||||
|
||||
.macro ___unlock_icache_all ar at
|
||||
|
||||
#if XCHAL_ICACHE_LINE_LOCKABLE && XCHAL_ICACHE_SIZE
|
||||
__loop_cache_all \ar \at iiu XCHAL_ICACHE_SIZE XCHAL_ICACHE_LINEWIDTH
|
||||
#endif
|
||||
|
||||
.endm
|
||||
#endif
|
||||
|
||||
|
||||
.macro ___flush_invalidate_dcache_all ar at
|
||||
|
||||
|
||||
@@ -59,6 +59,11 @@ enum fixed_addresses {
|
||||
*/
|
||||
static __always_inline unsigned long fix_to_virt(const unsigned int idx)
|
||||
{
|
||||
/* Check if this memory layout is broken because fixmap overlaps page
|
||||
* table.
|
||||
*/
|
||||
BUILD_BUG_ON(FIXADDR_START <
|
||||
XCHAL_PAGE_TABLE_VADDR + XCHAL_PAGE_TABLE_SIZE);
|
||||
BUILD_BUG_ON(idx >= __end_of_fixed_addresses);
|
||||
return __fix_to_virt(idx);
|
||||
}
|
||||
|
||||
@@ -68,6 +68,11 @@ void kunmap_high(struct page *page);
|
||||
|
||||
static inline void *kmap(struct page *page)
|
||||
{
|
||||
/* Check if this memory layout is broken because PKMAP overlaps
|
||||
* page table.
|
||||
*/
|
||||
BUILD_BUG_ON(PKMAP_BASE <
|
||||
XCHAL_PAGE_TABLE_VADDR + XCHAL_PAGE_TABLE_SIZE);
|
||||
BUG_ON(in_interrupt());
|
||||
if (!PageHighMem(page))
|
||||
return page_address(page);
|
||||
|
||||
@@ -77,13 +77,16 @@
|
||||
|
||||
.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 */
|
||||
|
||||
#if CONFIG_KERNEL_LOAD_ADDRESS < 0x40000000ul
|
||||
#define TEMP_MAPPING_VADDR 0x40000000
|
||||
#else
|
||||
#define TEMP_MAPPING_VADDR 0x00000000
|
||||
#endif
|
||||
|
||||
/* Step 1: invalidate mapping at 0x40000000..0x5FFFFFFF. */
|
||||
|
||||
movi a2, 0x40000000 | XCHAL_SPANNING_WAY
|
||||
movi a2, TEMP_MAPPING_VADDR | XCHAL_SPANNING_WAY
|
||||
idtlb a2
|
||||
iitlb a2
|
||||
isync
|
||||
@@ -95,14 +98,14 @@
|
||||
srli a3, a0, 27
|
||||
slli a3, a3, 27
|
||||
addi a3, a3, CA_BYPASS
|
||||
addi a7, a2, -1
|
||||
addi a7, a2, 5 - XCHAL_SPANNING_WAY
|
||||
wdtlb a3, a7
|
||||
witlb a3, a7
|
||||
isync
|
||||
|
||||
slli a4, a0, 5
|
||||
srli a4, a4, 5
|
||||
addi a5, a2, -6
|
||||
addi a5, a2, -XCHAL_SPANNING_WAY
|
||||
add a4, a4, a5
|
||||
jx a4
|
||||
|
||||
@@ -116,35 +119,48 @@
|
||||
add a5, a5, a4
|
||||
bne a5, a2, 3b
|
||||
|
||||
/* Step 4: Setup MMU with the old V2 mappings. */
|
||||
/* Step 4: Setup MMU with the requested static mappings. */
|
||||
|
||||
movi a6, 0x01000000
|
||||
wsr a6, ITLBCFG
|
||||
wsr a6, DTLBCFG
|
||||
isync
|
||||
|
||||
movi a5, 0xd0000005
|
||||
movi a4, CA_WRITEBACK
|
||||
movi a5, XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_TLB_WAY
|
||||
movi a4, XCHAL_KSEG_PADDR + CA_WRITEBACK
|
||||
wdtlb a4, a5
|
||||
witlb a4, a5
|
||||
|
||||
movi a5, 0xd8000005
|
||||
movi a4, CA_BYPASS
|
||||
movi a5, XCHAL_KSEG_BYPASS_VADDR + XCHAL_KSEG_TLB_WAY
|
||||
movi a4, XCHAL_KSEG_PADDR + CA_BYPASS
|
||||
wdtlb a4, a5
|
||||
witlb a4, a5
|
||||
|
||||
movi a5, XCHAL_KIO_CACHED_VADDR + 6
|
||||
#ifdef CONFIG_XTENSA_KSEG_512M
|
||||
movi a5, XCHAL_KSEG_CACHED_VADDR + 0x10000000 + XCHAL_KSEG_TLB_WAY
|
||||
movi a4, XCHAL_KSEG_PADDR + 0x10000000 + CA_WRITEBACK
|
||||
wdtlb a4, a5
|
||||
witlb a4, a5
|
||||
|
||||
movi a5, XCHAL_KSEG_BYPASS_VADDR + 0x10000000 + XCHAL_KSEG_TLB_WAY
|
||||
movi a4, XCHAL_KSEG_PADDR + 0x10000000 + CA_BYPASS
|
||||
wdtlb a4, a5
|
||||
witlb a4, a5
|
||||
#endif
|
||||
|
||||
movi a5, XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_TLB_WAY
|
||||
movi a4, XCHAL_KIO_DEFAULT_PADDR + CA_WRITEBACK
|
||||
wdtlb a4, a5
|
||||
witlb a4, a5
|
||||
|
||||
movi a5, XCHAL_KIO_BYPASS_VADDR + 6
|
||||
movi a5, XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_TLB_WAY
|
||||
movi a4, XCHAL_KIO_DEFAULT_PADDR + CA_BYPASS
|
||||
wdtlb a4, a5
|
||||
witlb a4, a5
|
||||
|
||||
isync
|
||||
|
||||
/* Jump to self, using MMU v2 mappings. */
|
||||
/* Jump to self, using final mappings. */
|
||||
movi a4, 1f
|
||||
jx a4
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Kernel virtual memory layout 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) 2016 Cadence Design Systems Inc.
|
||||
*/
|
||||
|
||||
#ifndef _XTENSA_KMEM_LAYOUT_H
|
||||
#define _XTENSA_KMEM_LAYOUT_H
|
||||
|
||||
#include <asm/types.h>
|
||||
|
||||
#ifdef CONFIG_MMU
|
||||
|
||||
/*
|
||||
* Fixed TLB translations in the processor.
|
||||
*/
|
||||
|
||||
#define XCHAL_PAGE_TABLE_VADDR __XTENSA_UL_CONST(0x80000000)
|
||||
#define XCHAL_PAGE_TABLE_SIZE __XTENSA_UL_CONST(0x00400000)
|
||||
|
||||
#if defined(CONFIG_XTENSA_KSEG_MMU_V2)
|
||||
|
||||
#define XCHAL_KSEG_CACHED_VADDR __XTENSA_UL_CONST(0xd0000000)
|
||||
#define XCHAL_KSEG_BYPASS_VADDR __XTENSA_UL_CONST(0xd8000000)
|
||||
#define XCHAL_KSEG_SIZE __XTENSA_UL_CONST(0x08000000)
|
||||
#define XCHAL_KSEG_ALIGNMENT __XTENSA_UL_CONST(0x08000000)
|
||||
#define XCHAL_KSEG_TLB_WAY 5
|
||||
#define XCHAL_KIO_TLB_WAY 6
|
||||
|
||||
#elif defined(CONFIG_XTENSA_KSEG_256M)
|
||||
|
||||
#define XCHAL_KSEG_CACHED_VADDR __XTENSA_UL_CONST(0xb0000000)
|
||||
#define XCHAL_KSEG_BYPASS_VADDR __XTENSA_UL_CONST(0xc0000000)
|
||||
#define XCHAL_KSEG_SIZE __XTENSA_UL_CONST(0x10000000)
|
||||
#define XCHAL_KSEG_ALIGNMENT __XTENSA_UL_CONST(0x10000000)
|
||||
#define XCHAL_KSEG_TLB_WAY 6
|
||||
#define XCHAL_KIO_TLB_WAY 6
|
||||
|
||||
#elif defined(CONFIG_XTENSA_KSEG_512M)
|
||||
|
||||
#define XCHAL_KSEG_CACHED_VADDR __XTENSA_UL_CONST(0xa0000000)
|
||||
#define XCHAL_KSEG_BYPASS_VADDR __XTENSA_UL_CONST(0xc0000000)
|
||||
#define XCHAL_KSEG_SIZE __XTENSA_UL_CONST(0x20000000)
|
||||
#define XCHAL_KSEG_ALIGNMENT __XTENSA_UL_CONST(0x10000000)
|
||||
#define XCHAL_KSEG_TLB_WAY 6
|
||||
#define XCHAL_KIO_TLB_WAY 6
|
||||
|
||||
#else
|
||||
#error Unsupported KSEG configuration
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_KSEG_PADDR
|
||||
#define XCHAL_KSEG_PADDR __XTENSA_UL_CONST(CONFIG_KSEG_PADDR)
|
||||
#else
|
||||
#define XCHAL_KSEG_PADDR __XTENSA_UL_CONST(0x00000000)
|
||||
#endif
|
||||
|
||||
#if XCHAL_KSEG_PADDR & (XCHAL_KSEG_ALIGNMENT - 1)
|
||||
#error XCHAL_KSEG_PADDR is not properly aligned to XCHAL_KSEG_ALIGNMENT
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#define XCHAL_KSEG_CACHED_VADDR __XTENSA_UL_CONST(0xd0000000)
|
||||
#define XCHAL_KSEG_BYPASS_VADDR __XTENSA_UL_CONST(0xd8000000)
|
||||
#define XCHAL_KSEG_SIZE __XTENSA_UL_CONST(0x08000000)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user