aboutsummaryrefslogtreecommitdiff
path: root/arch/arm
AgeCommit message (Collapse)Author
2013-12-11ARM: fiq_glue: Add custom fiq return handler api.Arve Hjønnevåg
Change-Id: I5ff2764e85151ca0a88576542fda07c2d33dd065 Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-11-13ARM: Fix "Make low-level printk work" to use a separate config optionArve Hjønnevåg
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-11-08ARM: Fix dtb list when DTB_IMAGE_NAMES is emptyBenoit Goby
In the 3.10 kernel, dtb-y is not defined in Makefile.boot anymore but in dts/Makefile, so it needs to be included too. Change-Id: I6d6fccf933709bcb6220ce8f12b4b9e2a7c40d63 Signed-off-by: Benoit Goby <benoit@android.com>
2013-09-19ARM: kgdb: ignore breakpoint instructions from user modeTodd Poynor
Avoid conflicts with user mode usage of the same instructions, as with Clang -ftrapv. Change-Id: I12d1c6d8f94376bfd2503cb0be843d7e478fb6ea Signed-off-by: Todd Poynor <toddpoynor@google.com>
2013-07-01ARM: mm: Allow an empty PMD in alloc_init_pte()Jon Medhurst (Tixy)
The Android patch titled "ARM: allow the kernel text section to be made read-only" modifies alloc_init_pte() and adds a BUG_ON to detect the case where a section mapping is being overwritten. However the test doesn't allow for the legitimate case where the PMD is empty, as can happen for kernels built with CONFIG_ARM_LPAE. So extend the test to allow this. Change-Id: I28eeaefd856bae63a5532980e41e0fd4d8922e79 Signed-off-by: Jon Medhurst <tixy@linaro.org> Signed-off-by: John Stultz <john.stultz@linaro.org>
2013-07-01ARM: decompressor: Flush tlb before swiching domain 0 to client modeArve Hjønnevåg
If the bootloader used a page table that is incompatible with domain 0 in client mode, and boots with the mmu on, then swithing domain 0 to client mode causes a fault if we don't flush the tlb after updating the page table pointer. v2: Add ISB before loading dacr. Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: mm: Split memory banks that span multiple sections when sparsemem is ↵Arve Hjønnevåg
enabled This fixes a crash in mem_init which assumes all pages in a memory bank are part of the same page array. Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: fiq_debugger: Update tty code for 3.9Arve Hjønnevåg
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: fiq_debugger: Use kmsg_dumper to dump kernel logsArve Hjønnevåg
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: fiq_debugger: Fix to compile on 3.7Arve Hjønnevåg
Use for_each_irq_desc in arch/arm/common/fiq_debugger.c Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: fault: assume no context when IRQs are disabled during data abort.JP Abgrall
Bail out early if IRQs are disabled in do_page_fault or else [14415.157266] BUG: sleeping function called from invalid context at arch/arm/mm/fault.c:301 Russell King's idea from http://comments.gmane.org/gmane.linux.ports.arm.omap/59256 Signed-off-by: JP Abgrall <jpa@google.com>
2013-07-01ARM: convert build of appended dtb zImage to list of dtbsColin Cross
Allow CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES to specify a space separated list of dtbs to append to the zImage, and name the resulting file zImage-dtb Change-Id: I36d9108a2349bdbb373e95076dcb1417d8c7dce6 Signed-off-by: Colin Cross <ccross@android.com> Conflicts: arch/arm/boot/Makefile scripts/Makefile.lib
2013-07-01ARM: add config option to build zImage/dtb comboErik Gilling
Allows a defconfig to set a default dtb to concatenate with a zImage to create a zImage-dtb.<dtb name> Signed-off-by: Erik Gilling <konkers@android.com> Change-Id: I34b643b1c49228fbae88a56e46c93c478089620d
2013-07-01ARM: fiq_debugger: fix uninitialised spin_lock.Mars
Backtrace: [<c0045ea0>] (dump_backtrace+0x0/0x10c) from [<c0575c60>] (dump_stack+0x1) r6:c07a489c r5:c0c9b9dc r4:00000002 r3:271aed3b [<c0575c48>] (dump_stack+0x0/0x1c) from [<c00b1b00>] (__lock_acquire+0x93) [<c00b11c8>] (__lock_acquire+0x0/0xad4) from [<c00b219c>] (lock_acquire+0) [<c00b210c>] (lock_acquire+0x0/0xa4) from [<c057e544>] (_raw_spin_lock_ir) [<c057e4f8>] (_raw_spin_lock_irq+0x0/0x5c) from [<c005297c>] (fiq_tty_wri) r5:e30f0000 r4:e36f0c00 [<c005293c>] (fiq_tty_write+0x0/0x80) from [<c023168c>] (n_tty_write+0x18) r8:e370fc40 r7:e378a000 r6:e3572d1c r5:e36f0c00 r4:00000002 r3:c005293c [<c0231500>] (n_tty_write+0x0/0x440) from [<c022d4a4>] (tty_write+0x100/0) [<c022d3a4>] (tty_write+0x0/0x2a8) from [<c0100b80>] (vfs_write+0xa4/0x14) [<c0100adc>] (vfs_write+0x0/0x148) from [<c0100cdc>] (sys_write+0x40/0x78) r8:00000002 r7:4076d2c4 r6:e370fc40 r5:00000000 r4:00000000 [<c0100c9c>] (sys_write+0x0/0x78) from [<c0041740>] (ret_fast_syscall+0x0) r8:c0041908 r7:00000004 r6:00000002 r5:00000000 r4:4007cbe0 [ccross: moved spin_lock_init into existing #ifdef] Change-Id: If400d084eb20433c126ea1dd027a6be7f2ebb1f6 Signed-off-by: Mars <caoziqiang@meizu.com> Signed-off-by: Colin Cross <ccross@android.com>
2013-07-01ARM: fiq_debugger: lock between tty and console writesColin Cross
debug_console_write calls debug_uart_flush, which will usually wait until the serial port fifo empties. If another thread is continuously calling fiq_tty_write, the fifo will constantly be refilled and debug_uart_flush might never return. Add a spinlock that is locked in debug_console_write and fiq_tty_write to ensure they can't run at the same time. This has an extra advantage of preventing lines from the console and tty from being mixed together. Also reduce the size returned by fiq_tty_write_room to keep the time spent with the spinlock held to a reasonable value. In addition, make sure fiq context can't loop forever by never calling debug_uart_flush when the console is enabled. Change-Id: I5712b01f740ca0c84f680d2032c9fa16b7656939 Signed-off-by: Colin Cross <ccross@android.com>
2013-07-01ARM: disable preemption in machine_shutdownMike J. Chen
Since the smp call to stop the other cpus are handled in those cpus in interrupt context, there's a potential for those smp handlers to interrupt threads holding spin locks (such as the one a mutex holds). This prevents those threads from ever releasing their spin lock, so if the cpu doing the shutdown is allowed to switch to another thread that tries to grab the same lock/mutex, we could get into a deadlock (the spin lock call is called with preemption disabled in the mutex lock code). To avoid that possibility, disable preemption before doing the smp_send_stop(). Change-Id: I7976c5382d7173fcb3cd14da8cc5083d442b2544 Signed-off-by: Mike J. Chen <mjchen@google.com>
2013-07-01ARM: fiq_debugger: add process context reboot commandColin Cross
kernel_restart cannot be called from interrupt context. Add support for commands called from a work function, and implement the "reboot" command there. Also rename the existing irq-mode command to "reset" and change it to use machine_restart instead of kernel_restart. Change-Id: I3c423147c01db03d89e95a5b99096ca89462079f Signed-off-by: Colin Cross <ccross@android.com>
2013-07-01ARM: etm: Add sysfs entry to enable return stack if supportedArve Hjønnevåg
Change-Id: Icb73d60324ad0ddfc3e8a450a28bb3d90c702788 Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: etm: Add sysfs entry to disable branch_output flagArve Hjønnevåg
Change-Id: Ib91208a2c33621aa2d7bd9aa72bfbc670d9d5f1d Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: etm: Add sysfs entry to set context-id-sizeArve Hjønnevåg
Change-Id: I520dfb6e593dac131de8b9b1db77f1c734f18c24 Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: etm: Add sysfs entry to enable timestamps if supportedArve Hjønnevåg
Change-Id: Iff964ba2f6236ed81863e02ec7b3ec9fbc48044a Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: etm: Check arch version and disable data tracing for ptmArve Hjønnevåg
Change-Id: If2cb7928d0711f48348443d882a12416be9c5910 Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: etm: Wait for etm/ptm(s) to stop before requesting PowerDownArve Hjønnevåg
When PowerDown was requested at the same time as ProgBit, the formatter flush command that follows could get stuck. Change-Id: Iafb665f61f055819e64ca1dcb60398c656f593e4 Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: fiq_debugger: fix multiple consoles and make it a preferred consoleColin Cross
Fix setting up consoles on multiple fiq debugger devices by splitting the tty driver init into the initcall, and initializing the single tty device during probe. Has the side effect of moving the tty device node to /dev/ttyFIQx, where x is the platform device id, which should normally match the serial port. To avoid having to pass a different console=/dev/ttyFIQx for every device, make the fiq debugger a preferred console that will be used by default if no console was passed on the command line. Change-Id: I6cc2670628a41e84615859bc96adba189966d647 Signed-off-by: Colin Cross <ccross@android.com>
2013-07-01ARM: fiq_debugger: add support for kgdbColin Cross
Adds polling tty ops to the fiq debugger console tty, which allows kgdb to run against an fiq debugger console. Add a check in do_sysrq to prevent enabling kgdb from the fiq debugger unless a flag (writable only by root) has been set. This should make it safe to enable KGDB on a production device. Also add a shortcut to enable the console and kgdb together, to allow kgdb to be enabled when the shell on the console is not responding. Change-Id: Ifc65239ca96c9887431a6a36b9b44a539002f544 Signed-off-by: Colin Cross <ccross@android.com>
2013-07-01ARM: fiq_debugger: add debug_putcColin Cross
Convert all the calls to state->pdata->uart_putc to a debug_putc helper. Change-Id: Idc007bd170ff1b51d0325e238105ae0c86d23777 Signed-off-by: Colin Cross <ccross@android.com>
2013-07-01ARM: fiq_debugger: add support for reboot commandsColin Cross
Pass the rest of the reboot command to kernel_restart to allow reboot bootloader to work from FIQ debugger. Change-Id: I4e7b366a69268dda17ffcf4c84f2373d15cb1271 Signed-off-by: Colin Cross <ccross@android.com>
2013-07-01ARM: fiq_debugger: fix compiling for v3.3Colin Cross
Call kernel_restart instead of arch_reset, the ARM reset handling has changed. Remove localtimer irq printing, they now show up in the regular irq stats. Change-Id: I523da343b292c5711f3e1cbfd766d32eea2da84e Signed-off-by: Colin Cross <ccross@android.com>
2013-07-01ARM: etm: Power down etm(s) when tracing is not enabledArve Hjønnevåg
Without this change a saw an 18% increase in idle power consumption on one deivce when trace support is compiled into the kernel. Now I see the same increase only when tracing. Change-Id: I21bb5ecf1b7d29ce3790ceeb5323409cc22d5a3b Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: etm: Support multiple ETMs/PTMs.Arve Hjønnevåg
If more than one ETM or PTM are present, configure all of them and enable the formatter in the ETB. This allows tracing on dual core systems (e.g. omap4). Change-Id: I028657d5cf2bee1b23f193d4387b607953b35888 Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: etm: Return the entire trace buffer if it is empty after resetArve Hjønnevåg
On some SOCs the read and write pointer are reset when the chip resets, but the trace buffer content is preserved. If the status bits indicates that the buffer is empty and we have never started tracing, assume the buffer is full instead. This can be useful if the system rebooted from a watchdog reset. Change-Id: Iaf21c2c329c6059004ee1d38e3dfff66d7d28029 Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: etm: Add some missing locks and error checksArve Hjønnevåg
It is not safe to call etm_lock or etb_lock without holding the mutex since another thread may also have unlocked the registers. Also add some missing checks for valid etb_regs in the etm sysfs entries. Change-Id: I939f76a6ea7546a8fc0d4ddafa2fd2b6f38103bb Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: etm: Configure data tracingArve Hjønnevåg
The old code enabled data tracing, but did not configure the range. We now configure it to trace all data addresses by default, and add a trace_data_range attribute to change the range or disable data tracing. Change-Id: I9d04e3e1ea0d0b4d4d5bcb93b1b042938ad738b2 Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: etm: Allow range selectionArve Hjønnevåg
Trace kernel text segment by default as before, allow tracing of other ranges by writing a range to /sys/devices/etm/trace_range, or to trace everything by writing 0 0. Change-Id: Ibb734ca820fedf79560b20536247f1e1700cdc71 Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: etm: Don't try to clear the buffer full status after reading the bufferArve Hjønnevåg
If the write address was at the end of the buffer, toggling the trace capture bit would set the RAM-full status instead of clearing it, and if any of the stop bits in the formatter is set toggling the trace capture bit may not do anything. Instead use the read position to find out if the data has already been returned. This also fixes the read function so it works when the trace buffer is larger than the buffer passed in from user space. The old version would reset the trace buffer pointers after every read, so the second call to read would always return 0. Change-Id: I75256abe2556adfd66fd5963e46f9e84ae4645e1 Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: etm: Don't limit tracing to only non-secure code.Arve Hjønnevåg
On some systems kernel code is considered secure, and this code already limits tracing to the kernel text segment which results in no trace data. Change-Id: I098a0753e874859446d098e1ee209f67fc13cd5d Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: etm: Don't require clock controlArve Hjønnevåg
If clk_get fail, assume the etb does not need a separate clock. Change-Id: Ia0bf3f5391e94a60ea45876aa7afc8a88a7ec3bf Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: Call idle notifiersTodd Poynor
Change-Id: Id833e61c13baa1783705ac9e9046d1f0cc90c95e Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org> Signed-off-by: Todd Poynor <toddpoynor@google.com>
2013-07-01ARM: Add generic fiq serial debuggerIliyan Malchev
Change-Id: Ibb536c88f0dbaf4766d0599296907e35e42cbfd6 Signed-off-by: Iliyan Malchev <malchev@google.com> Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: Add fiq_glueArve Hjønnevåg
Change-Id: I27d2554e07d9de204e0a06696d38db51608d9f6b Signed-off-by: Arve Hjønnevåg <arve@android.com> Signed-off-by: Colin Cross <ccross@android.com>
2013-07-01ARM: Add 'card_present' state to mmc_platfrom_dataDmitry Shmidt
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2013-07-01Recreate asm/mach/mmc.h include fileColin Cross
Change-Id: I9f10244b0603f7842b8504a16124d40dc4a71ed2 Signed-off-by: Colin Cross <ccross@android.com>
2013-07-01[ARM] Optionally flush entire dcache from v6_dma_flush_rangeArve Hjønnevåg
If CACHE_FLUSH_RANGE_LIMIT is defined, then the entire dcache will be flushed if the requested range is larger than this limit. Change-Id: I29277d645a9d6716b1952cf3b870c78496261dd0 Signed-off-by: Arve Hjønnevåg <arve@android.com>
2013-07-01ARM: allow the kernel text section to be made read-onlyColin Cross
This patch implements CONFIG_DEBUG_RODATA, allowing the kernel text section to be marked read-only in order to catch bugs that write over the kernel. This requires mapping the kernel code, plus up to 4MB, using pages instead of sections, which can increase TLB pressure. The kernel is normally mapped using 1MB section entries in the first level page table, and the first level page table is copied into every mm. This prevents marking the kernel text read-only, because the 1MB section entries are too large granularity to separate the init section, which is reused as read-write memory after init, and the kernel text section. Also, the top level page table for every process would need to be updated, which is not possible to do safely and efficiently on SMP. To solve both problems, allow alloc_init_pte to overwrite an existing section entry with a fully-populated second level page table. When CONFIG_DEBUG_RODATA is set, all the section entries that overlap the kernel text section will be replaced with page mappings. The kernel always uses a pair of 2MB-aligned 1MB sections, so up to 2MB of memory before and after the kernel may end up page mapped. When the top level page tables are copied into each process the second level page tables are not copied, leaving a single second level page table that will affect all processes on all cpus. To mark a page read-only, the second level page table is located using the pointer in the first level page table for the current process, and the supervisor RO bit is flipped atomically. Once all pages have been updated, all TLBs are flushed to ensure the changes are visible on all cpus. If CONFIG_DEBUG_RODATA is not set, the kernel will be mapped using the normal 1MB section entries. Change-Id: I94fae337f882c2e123abaf8e1082c29cd5d483c6 Signed-off-by: Colin Cross <ccross@android.com>
2013-07-01ARM: smp: implement arch_trigger_all_cpus_backtrace using IPIDima Zavin
Based on a rough patch by frank.rowand@am.sony.com Since ARM doesn't have an NMI (fiq's are not always available), send an IPI to all other CPUs (current cpu prints the stack directly) to capture a backtrace. Change-Id: I8b163c8cec05d521b433ae133795865e8a33d4e2 Signed-off-by: Dima Zavin <dima@android.com>
2013-07-01ARM: cache-l2x0: update workaround for PL310 errata 727915Colin Cross
ARM errata 727915 for PL310 has been updated to include a new workaround required for PL310 r2p0 for l2x0_flush_all, which also affects l2x0_clean_all in my testing. For r2p0, clean or flush each set/way individually. For r3p0 or greater, use the debug register for cleaning and flushing. Requires exporting the cache_id, sets and ways detected in the init function for later use. Change-Id: I215055cbe5dc7e4e8184fb2befc4aff672ef0a12 Signed-off-by: Colin Cross <ccross@android.com>
2013-07-01ARM: add option to flush console before rebootDima Zavin
If the console_lock was held while the system was rebooted, the messages in the temporary logbuffer would not have propogated to all the console drivers. This force releases the console lock if it failed to be acquired. Change-Id: I193dcf7b968be17966833e50b8b8bc70d5d9fe89 Signed-off-by: Dima Zavin <dima@android.com>
2013-07-01[ARM] process: Add display of memory around registers when displaying regs.San Mehat
This is extremely useful in diagnosing remote crashes, and is based heavily on original work by <md@google.com>. Signed-off-by: San Mehat <san@google.com> Cc: Michael Davidson <md@google.com> [ARM] process: Use uber-safe probe_kernel_address() to read mem when dumping. This prevents the dump from taking pagefaults / external aborts. Signed-off-by: San Mehat <san@google.com>
2013-06-29ARM: dt: Only print warning, not WARN() on bad cpu map in device treeOlof Johansson
Due to recent changes and expecations of proper cpu bindings, there are now cases for many of the in-tree devicetrees where a WARN() will hit on boot due to badly formatted /cpus nodes. Downgrade this to a pr_warn() to be less alarmist, since it's not a new problem. Tested on Arndale, Cubox, Seaboard and Panda ES. Panda hits the WARN without this, the others do not. Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-06-24ARM: 7773/1: PJ4B: Add support for errata 4742Gregory CLEMENT
This commit fixes the regression on Armada 370 (the kernal hang during boot) introduced by the commit: "ARM: 7691/1: mm: kill unused TLB_CAN_READ_FROM_L1_CACHE and use ALT_SMP instead". When coming out of either a Wait for Interrupt (WFI) or a Wait for Event (WFE) IDLE states, a specific timing sensitivity exists between the retiring WFI/WFE instructions and the newly issued subsequent instructions. This sensitivity can result in a CPU hang scenario. The workaround is to insert either a Data Synchronization Barrier (DSB) or Data Memory Barrier (DMB) command immediately after the WFI/WFE instruction. This commit was based on the work of Lior Amsalem, but heavily modified to apply the errata fix dynamically according to the processor type thanks to the suggestions of Russell King and Nicolas Pitre. Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Reviewed-by: Will Deacon <will.deacon@arm.com> Acked-by: Nicolas Pitre <nico@linaro.org> Tested-by: Willy Tarreau <w@1wt.eu> Cc: <stable@vger.kernel.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>