diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-09 17:38:16 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-09 17:38:16 -0400 |
| commit | c61c48dfe00907007df3b87e4ed271a5c143bdda (patch) | |
| tree | 6d26bd3a8b4aa3cf35cad35fa27d1e0afe715db3 | |
| parent | e30f4192456971623b40c97a027346b69457ef69 (diff) | |
| parent | b341d84c8ac5ecbf7aa0b3ccd0745d87e881953c (diff) | |
Merge tag 'xtensa-next-20130508' of git://github.com/czankel/xtensa-linux
Pull xtensa updates from Chris Zankel:
"Support for the latest MMU architecture that allows for a larger
accessible memory region, and various bug-fixes"
* tag 'xtensa-next-20130508' of git://github.com/czankel/xtensa-linux:
xtensa: Switch to asm-generic/linkage.h
xtensa: fix redboot load address
xtensa: ISS: fix timer_lock usage in rs_open
xtensa: disable IRQs while IRQ handler is running
xtensa: enable lockdep support
xtensa: fix arch_irqs_disabled_flags implementation
xtensa: add irq flags trace support
xtensa: provide custom CALLER_ADDR* implementations
xtensa: add stacktrace support
xtensa: clean up stpill_registers
xtensa: don't use a7 in simcalls
xtensa: don't attempt to use unconfigured timers
xtensa: provide default platform_pcibios_init implementation
xtensa: remove KCORE_ELF again
xtensa: document MMUv3 setup sequence
xtensa: add MMU v3 support
xtensa: fix ibreakenable register update
xtensa: fix oprofile building as module
33 files changed, 819 insertions, 254 deletions
diff --git a/Documentation/xtensa/mmu.txt b/Documentation/xtensa/mmu.txt new file mode 100644 index 000000000000..2b1af7606d57 --- /dev/null +++ b/Documentation/xtensa/mmu.txt | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | MMUv3 initialization sequence. | ||
| 2 | |||
| 3 | The code in the initialize_mmu macro sets up MMUv3 memory mapping | ||
| 4 | identically to MMUv2 fixed memory mapping. Depending on | ||
| 5 | CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX symbol this code is | ||
| 6 | located in one of the following address ranges: | ||
| 7 | |||
| 8 | 0xF0000000..0xFFFFFFFF (will keep same address in MMU v2 layout; | ||
| 9 | typically ROM) | ||
| 10 | 0x00000000..0x07FFFFFF (system RAM; this code is actually linked | ||
| 11 | at 0xD0000000..0xD7FFFFFF [cached] | ||
| 12 | or 0xD8000000..0xDFFFFFFF [uncached]; | ||
| 13 | in any case, initially runs elsewhere | ||
| 14 | than linked, so have to be careful) | ||
| 15 | |||
| 16 | The code has the following assumptions: | ||
| 17 | This code fragment is run only on an MMU v3. | ||
| 18 | TLBs are in their reset state. | ||
| 19 | ITLBCFG and DTLBCFG are zero (reset state). | ||
| 20 | RASID is 0x04030201 (reset state). | ||
| 21 | PS.RING is zero (reset state). | ||
| 22 | LITBASE is zero (reset state, PC-relative literals); required to be PIC. | ||
| 23 | |||
| 24 | TLB setup proceeds along the following steps. | ||
| 25 | |||
| 26 | Legend: | ||
| 27 | VA = virtual address (two upper nibbles of it); | ||
| 28 | PA = physical address (two upper nibbles of it); | ||
| 29 | pc = physical range that contains this code; | ||
| 30 | |||
| 31 | After step 2, we jump to virtual address in 0x40000000..0x5fffffff | ||
| 32 | that corresponds to next instruction to execute in this code. | ||
| 33 | After step 4, we jump to intended (linked) address of this code. | ||
| 34 | |||
| 35 | Step 0 Step1 Step 2 Step3 Step 4 Step5 | ||
| 36 | ============ ===== ============ ===== ============ ===== | ||
| 37 | VA PA PA VA PA PA VA PA PA | ||
| 38 | ------ -- -- ------ -- -- ------ -- -- | ||
| 39 | E0..FF -> E0 -> E0 E0..FF -> E0 F0..FF -> F0 -> F0 | ||
| 40 | C0..DF -> C0 -> C0 C0..DF -> C0 E0..EF -> F0 -> F0 | ||
| 41 | A0..BF -> A0 -> A0 A0..BF -> A0 D8..DF -> 00 -> 00 | ||
| 42 | 80..9F -> 80 -> 80 80..9F -> 80 D0..D7 -> 00 -> 00 | ||
| 43 | 60..7F -> 60 -> 60 60..7F -> 60 | ||
| 44 | 40..5F -> 40 40..5F -> pc -> pc 40..5F -> pc | ||
| 45 | 20..3F -> 20 -> 20 20..3F -> 20 | ||
| 46 | 00..1F -> 00 -> 00 00..1F -> 00 | ||
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index acdfc615cca2..0a1b95f81a32 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig | |||
| @@ -1,11 +1,9 @@ | |||
| 1 | config FRAME_POINTER | ||
| 2 | def_bool n | ||
| 3 | |||
| 4 | config ZONE_DMA | 1 | config ZONE_DMA |
| 5 | def_bool y | 2 | def_bool y |
| 6 | 3 | ||
| 7 | config XTENSA | 4 | config XTENSA |
| 8 | def_bool y | 5 | def_bool y |
| 6 | select ARCH_WANT_FRAME_POINTERS | ||
| 9 | select HAVE_IDE | 7 | select HAVE_IDE |
| 10 | select GENERIC_ATOMIC64 | 8 | select GENERIC_ATOMIC64 |
| 11 | select HAVE_GENERIC_HARDIRQS | 9 | select HAVE_GENERIC_HARDIRQS |
| @@ -49,6 +47,15 @@ config HZ | |||
| 49 | source "init/Kconfig" | 47 | source "init/Kconfig" |
| 50 | source "kernel/Kconfig.freezer" | 48 | source "kernel/Kconfig.freezer" |
| 51 | 49 | ||
| 50 | config LOCKDEP_SUPPORT | ||
| 51 | def_bool y | ||
| 52 | |||
| 53 | config STACKTRACE_SUPPORT | ||
| 54 | def_bool y | ||
| 55 | |||
| 56 | config TRACE_IRQFLAGS_SUPPORT | ||
| 57 | def_bool y | ||
| 58 | |||
| 52 | config MMU | 59 | config MMU |
| 53 | def_bool n | 60 | def_bool n |
| 54 | 61 | ||
| @@ -100,6 +107,35 @@ config MATH_EMULATION | |||
| 100 | help | 107 | help |
| 101 | Can we use information of configuration file? | 108 | Can we use information of configuration file? |
| 102 | 109 | ||
| 110 | config INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX | ||
| 111 | bool "Initialize Xtensa MMU inside the Linux kernel code" | ||
| 112 | default y | ||
| 113 | help | ||
| 114 | Earlier version initialized the MMU in the exception vector | ||
| 115 | before jumping to _startup in head.S and had an advantage that | ||
| 116 | it was possible to place a software breakpoint at 'reset' and | ||
| 117 | then enter your normal kernel breakpoints once the MMU was mapped | ||
| 118 | to the kernel mappings (0XC0000000). | ||
| 119 | |||
| 120 | This unfortunately doesn't work for U-Boot and likley also wont | ||
| 121 | work for using KEXEC to have a hot kernel ready for doing a | ||
| 122 | KDUMP. | ||
| 123 | |||
| 124 | So now the MMU is initialized in head.S but it's necessary to | ||
| 125 | use hardware breakpoints (gdb 'hbreak' cmd) to break at _startup. | ||
| 126 | xt-gdb can't place a Software Breakpoint in the 0XD region prior | ||
| 127 | to mapping the MMU and after mapping even if the area of low memory | ||
| 128 | was mapped gdb wouldn't remove the breakpoint on hitting it as the | ||
| 129 | PC wouldn't match. Since Hardware Breakpoints are recommended for | ||
| 130 | Linux configurations it seems reasonable to just assume they exist | ||
| 131 | and leave this older mechanism for unfortunate souls that choose | ||
| 132 | not to follow Tensilica's recommendation. | ||
| 133 | |||
| 134 | Selecting this will cause U-Boot to set the KERNEL Load and Entry | ||
| 135 | address at 0x00003000 instead of the mapped std of 0xD0003000. | ||
| 136 | |||
| 137 | If in doubt, say Y. | ||
| 138 | |||
| 103 | endmenu | 139 | endmenu |
| 104 | 140 | ||
| 105 | config XTENSA_CALIBRATE_CCOUNT | 141 | config XTENSA_CALIBRATE_CCOUNT |
| @@ -249,21 +285,6 @@ endmenu | |||
| 249 | 285 | ||
| 250 | menu "Executable file formats" | 286 | menu "Executable file formats" |
| 251 | 287 | ||
| 252 | # only elf supported | ||
| 253 | config KCORE_ELF | ||
| 254 | def_bool y | ||
| 255 | depends on PROC_FS | ||
| 256 | help | ||
| 257 | If you enabled support for /proc file system then the file | ||
| 258 | /proc/kcore will contain the kernel core image in ELF format. This | ||
| 259 | can be used in gdb: | ||
| 260 | |||
| 261 | $ cd /usr/src/linux ; gdb vmlinux /proc/kcore | ||
| 262 | |||
| 263 | This is especially useful if you have compiled the kernel with the | ||
| 264 | "-g" option to preserve debugging information. It is mainly used | ||
| 265 | for examining kernel data structures on the live kernel. | ||
| 266 | |||
