Use fixed length string for register names. This saves 416 bytes
in text size.
Signed-off-by: Aaro Koskinen <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Signed-off-by: Wim Van Sebroeck <[email protected]>
Convert OCTEON watchdog to WATCHDOG_CORE API. This enables support
for multiple watchdogs on OCTEON boards.
Signed-off-by: Aaro Koskinen <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Signed-off-by: Wim Van Sebroeck <[email protected]>
__rtc_read_time logs should be debug logs instead of error logs.
For example, when the RTC clock is not set, it's not really useful
to print a kernel error log every time someone tries to read the clock:
~ # hwclock -r
[ 604.508263] rtc rtc0: read_time: fail to read
hwclock: RTC_RD_TIME: Invalid argument
If there's a real error, it's likely that lower level or higher level
code will tell it anyway. Make these logs debug logs, and also print
the error code for the read failure.
Signed-off-by: Aaro Koskinen <[email protected]>
Acked-by: Alexandre Belloni <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
In some error cases RTC name is used before it is initialized:
rtc-rs5c372 0-0032: clock needs to be set
rtc-rs5c372 0-0032: rs5c372b found, 24hr, driver version 0.6
rtc (null): read_time: fail to read
rtc-rs5c372 0-0032: rtc core: registered rtc-rs5c372 as rtc0
Fix by initializing the name early.
Signed-off-by: Aaro Koskinen <[email protected]>
Acked-by: Alexandre Belloni <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Make CVMX_WAIT_FOR_FIELD32 to take full condition expression.
This should make the usage simpler, and the macro more readable.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Assume union type for FIELD32 macros to simplify usage.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Make cvmx_fifo_setup void, it does not return any value.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Don't disable bottom half while the crypto engine is in use, as it
should be unnecessary: All kernel crypto engine usage is wrapped with
crypto engine state save/restore, so if we get interrupted by softirq
that uses crypto they should save and restore our context.
This actually fixes an issue when running OCTEON MD5 with interrupts
disabled (tcrypt mode=302). There's a WARNING because the module is
trying to enable the bottom half with irqs disabled:
[ 52.656610] ------------[ cut here ]------------
[ 52.661439] WARNING: CPU: 1 PID: 428 at /home/aaro/git/linux/kernel/softirq.c:150 __local_bh_enable_ip+0x9c/0xd8()
[ 52.671780] Modules linked in: tcrypt(+)
[...]
[ 52.763539] [<ffffffff8114082c>] warn_slowpath_common+0x94/0xd8
[ 52.769465] [<ffffffff81144614>] __local_bh_enable_ip+0x9c/0xd8
[ 52.775390] [<ffffffff81119574>] octeon_md5_final+0x12c/0x1e8
[ 52.781144] [<ffffffff81337050>] shash_compat_digest+0xd0/0x1b0
Signed-off-by: Aaro Koskinen <[email protected]>
Cc: Herbert Xu <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/9490/
Signed-off-by: Ralf Baechle <[email protected]>
Eliminate extra indentation by putting all the code into the same block.
Also delete a bogus comment.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
On some hardware the USB fails to initialize to sane state after
cold boot. We can detect this based on some unexpected interrupt bits,
and recover by re-initializing.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Move cvmx_usb_shutdown() to allow its use from some other functions.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Don't disable port before resetting. Also perform reset unconditionally
when requested.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Move FIFO setup to controller reset from port reset.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Use USB stack to turn on the power bit. It will also do
the necessary delays.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Don't poll interrupts before we have registered the HCD.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Move one-time state data structure initialization out of
cvmx_usb_initialize().
This enables to re-initialize USBN HW block without messing
up data structures.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Never retry after xacterr. The DMA engine cannot handle that properly
and may result in wrong transfer count and hang.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Program DMA engine based on transfer direction. We are only transferring
to one direction at a time.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Use __BITFIELD_FIELD to define bitfields. OCTEON can at least in theory
run also in little-endian mode, so the bitfield definitions should not
assume big-endian byte order.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Since we are not moving/realigning the original pointer returned
by kmalloc, we don't need to store the value in a separate field.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Original CVMX code used "__" to distinguis internal USB functions
from public ones. But in Linux all cvmx_usb routines are internal
to this driver, so such separation is useless.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Eliminate 64-bit register access wrappers. Since we don't implement
register-level debugging outputs, these are useless.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Remove some function parameter sanity checks from internal functions
where we can rely them being called with sane parameters.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Always disable preemption on behalf of the drivers when crypto engine
is taken into use. This will simplify the usage.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
Don't disable bottom half while the crypto engine is in use, as it
should be unnecessary: All kernel crypto engine usage is wrapped with
crypto engine state save/restore, so if we get interrupted by softirq
that uses crypto they should save and restore our context.
This actually fixes an issue when running OCTEON MD5 with interrupts
disabled (tcrypt mode=302). There's a WARNING because the module is
trying to enable the bottom half with irqs disabled:
[ 52.656610] ------------[ cut here ]------------
[ 52.661439] WARNING: CPU: 1 PID: 428 at /home/aaro/git/linux/kernel/softirq.c:150 __local_bh_enable_ip+0x9c/0xd8()
[ 52.671780] Modules linked in: tcrypt(+)
[...]
[ 52.763539] [<ffffffff8114082c>] warn_slowpath_common+0x94/0xd8
[ 52.769465] [<ffffffff81144614>] __local_bh_enable_ip+0x9c/0xd8
[ 52.775390] [<ffffffff81119574>] octeon_md5_final+0x12c/0x1e8
[ 52.781144] [<ffffffff81337050>] shash_compat_digest+0xd0/0x1b0
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
Enable TWL4030_USB which is used at least on Nokia N900/N950/N9 (OMAP3)
and BeagleBoard.
Signed-off-by: Aaro Koskinen <[email protected]>
[[email protected]: updated comments]
Signed-off-by: Tony Lindgren <[email protected]>
XGI framebuffer supports big-endian machines, but it's currently
enabled based on __powerpc__ define (which is wrong, as powerpc can
be also little-endian now). Use __BIG_ENDIAN instead. This will fix
wrong colours on such machines.
Tested on parisc with XGI Z7.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Add twl_power for N950/N9. Start with the simplest configuration to just
enable power off.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
modem->device was never initialized. This resulted in logs such as:
[ 241.386322] (NULL device *): CMT rst line change detected
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
Reintroduce run-time check for crypto features. The old one was deleted
because it was unreliable, now decide the crypto availability on early
boot when the model string is constructed.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
Add instruction definitions for MD5. Based on information extracted
from EdgeRouter Pro GPL source tarball.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
Add crypto helper functions which are needed for kernel level usage.
The code for these has been extracted from the EdgeRouter Pro GPL tarball.
While at it, also delete duplicate definitions of the functions.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
Move helper functions to make them visible to all functions.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Octeon Ethernet driver is currently trying to wake up multiple
CPU cores for parallel NAPI processing when needed, to cope
with the fact that all network interfaces are handled through
the same receive queue processed by a single core/interrupt
(see http://marc.info/?l=linux-kernel&m=137209784914565&w=2).
This partially overlaps with generic RPS functionality.
Commit a6a39a7fcf ("staging: octeon-ethernet: disable load balance
for receiving packet when CONFIG_RPS is enabled") already disabled this
when RPS is enabled. Let's delete this code altogether as it has issues
like packet reordering and potential problems with CPU offlining/onlining.
Tested on EdgeRouter Lite.
Signed-off-by: Aaro Koskinen <[email protected]>
Acked-By: David Daney <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Add a missing include to eliminate the following sparse warnings:
warning: symbol 'prom_init' was not declared. Should it be static?
warning: symbol 'prom_free_prom_memory' was not declared. Should it be static?
Signed-off-by: Aaro Koskinen <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/8531/
Signed-off-by: Ralf Baechle <[email protected]>
Make internal static to eliminate the following sparse warnings:
warning: symbol 'ip6_irqaction' was not declared. Should it be static?
warning: symbol 'cascade_irqaction' was not declared. Should it be static?
Signed-off-by: Aaro Koskinen <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/8527/
Signed-off-by: Ralf Baechle <[email protected]>
Add a missing include to get rid of the following sparse warnings:
warning: symbol 'cs5536_pci_conf_write4' was not declared. Should it be static?
warning: symbol 'cs5536_pci_conf_read4' was not declared. Should it be static?
Signed-off-by: Aaro Koskinen <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/8526/
Signed-off-by: Ralf Baechle <[email protected]>
Commit a79ebea620 (MIPS: ptrace: Fix user pt_regs definition,
use in ptrace_{get, set}regs()) converted struct pt_regs to use __u64.
Some userspace applications (e.g. GDB) include this file directly,
and fail to see this type. Fix by including <linux/types.h>.
The patch fixes the following build failure with GDB 7.8 when using
GLIBC headers created against Linux 3.17:
In file included from /home/aaro/los/work/shared/gdb-7.8/gdb/mips-linux-nat.c:37:0:
/home/aaro/los/work/mips/rootfs/mips-linux-gnu/usr/include/asm/ptrace.h:32:2: error: unknown type name '__u64'
__u64 regs[32];
^
/home/aaro/los/work/mips/rootfs/mips-linux-gnu/usr/include/asm/ptrace.h:35:2: error: unknown type name '__u64'
__u64 lo;
^
/home/aaro/los/work/mips/rootfs/mips-linux-gnu/usr/include/asm/ptrace.h:36:2: error: unknown type name '__u64'
__u64 hi;
^
Fixes: a79ebea620 ("MIPS: ptrace: Fix user pt_regs definition, use in ptrace_{get, set}regs()")
Cc: [email protected] # 3.17
Signed-off-by: Aaro Koskinen <[email protected]>
Cc: Alex Smith <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/8067/
Signed-off-by: Ralf Baechle <[email protected]>
Return transferred bytes only when transfer was successful.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
On data toggle error, we don't know if and how many bytes were
successfully transferred by DMA. We should just fail the transaction
instead of trying a retry.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The driver did not use link_urb_to_ep() / unlink_urb_from_ep(). This
caused odd behaviour in some error recovery situations, all requests
would start to fail after the first failure.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Cancel requests synchronously instead of using the dequeue tasklet.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
cvmx_usb_pipe fits into a cache-line so additional prefetches are not
really helping anything.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Commit 1e434f9318 (OMAPFB: remove early mem
alloc from old omapfb) deleted the support for early fbmem allocation
from the platform code, but some code still remains in the driver side.
Delete this code now, as it repotedly causes build issues on !MMU.
The patch was tested on Amstrad E3 and Nokia 770 and framebuffer
functionality is not affected.
Signed-off-by: Aaro Koskinen <[email protected]>
Acked-by: Tony Lindgren <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
octeon-hcd will crash the kernel when SLOB is used. This usually happens
after the 18-byte control transfer when a device descriptor is read.
The DMA engine is always transfering full 32-bit words and if the
transfer is shorter, some random garbage appears after the buffer.
The problem is not visible with SLUB since it rounds up the allocations
to word boundary, and the extra bytes will go undetected.
Fix by providing quirk functions for DMA map/unmap that allocate a bigger
temporary buffer when necessary. Tested by booting EdgeRouter Lite
to USB stick root file system with SLAB, SLOB and SLUB kernels.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=72121
Reported-by: Sergey Popov <[email protected]>
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
ethernet-mem was missing its own include file, causing sparse to complain
about undeclared global functions.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Make global_register_lock static to eliminate a sparse warning.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Make cvm_oct_free_tx_skbs static to eliminate a sparse warning.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Make num_packet_buffers static to eliminate a sparse warning.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
We don't have such Kconfig option, so the current code is dead and
the documentation is wrong. Users can adjust this setting by using
module parameter or kernel command line, so we can delete this code.
Signed-off-by: Aaro Koskinen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Since 3.14-rc1 only DT boot has been supported on N810, so this
file fails to init. Make a minimal fix to retain functionality.
This file should be properly converted to DT in longer term.
There seems to be still other unresolved issues with N810 audio support,
but this patch is needed at minimum as otherwise the machine driver
probing would completely fail.
Signed-off-by: Aaro Koskinen <[email protected]>
Acked-by: Jarkko Nikula <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Add missing compatible property to avoid problems in the future.
Signed-off-by: Aaro Koskinen <[email protected]>
Reviewed-by: Nishanth Menon <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
N9/N950 does not boot anymore with 3.14-rc1, because SoC compatible
property is missing. Fix that.
Signed-off-by: Aaro Koskinen <[email protected]>
Reviewed-by: Nishanth Menon <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>