9
0
Fork 0
Commit Graph

12822 Commits

Author SHA1 Message Date
Lucas Stach 6c6f7c0940 ARM: tegra124: remove serial aliases
They are upstream now and unfortunately actively break some boards
as they are using a different alias numbering in the kernel.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-30 19:24:57 +02:00
Jan Luebbe 7a5a6bbf96 duckbill: fix PBL debug prefix
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-30 19:24:01 +02:00
Steffen Trumtrar 5cef8a3670 ARM/MXS/i.MX28: recognize watchdog reset
When a watchdog timeout is set in the linux kernel, the FORCE_UPDATE bit is set.
Use this to recognize a system reset that was triggered by the watchdog.
Since only the wdt part of the kernel driver sets this bit, this is a safe
distinguishing feature.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-30 19:24:01 +02:00
Antony Pavlov 238ffb68f6 command: hashsum: Conding style fixup
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-30 19:08:14 +02:00
Jean-Christophe PLAGNIOL-VILLARD 0d348bc772 arm: crypto: add sha256 assembly support
linux arm sha256 current
$ ls -al build/versatilpb/arch/arm/pbl/zbarebox.bin
 -rw-r--r-- 1 root root 207786 Mar 24 13:23 build/versatilpb/arch/arm/pbl/zbarebox.bin

linux arm v4 asm implementation for sha256
$ ls -al build/versatilpb/arch/arm/pbl/zbarebox.bin
 -rw-r--r-- 1 root root 205007 Mar 24 16:47 build/versatilpb/arch/arm/pbl/zbarebox.bin

we win 2779 bytes and speed cf code

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-27 07:49:45 +01:00
Jean-Christophe PLAGNIOL-VILLARD ee1fb15bdc arm: crypto: add sha1 assembly support
from Linux 3.9

linux generic implementation

$ ls -al build/versatilpb/arch/arm/pbl/zbarebox.bin
-rw-r--r-- 1 root root 210829 Mar 24 13:21 build/versatilpb/arch/arm/pbl/zbarebox.bin

linux arm v4 asm implementation
$ ls -al build/versatilpb/arch/arm/pbl/zbarebox.bin
-rw-r--r-- 1 root root 207786 Mar 24 13:23 build/versatilpb/arch/arm/pbl/zbarebox.bin

we win 3043 bytes and speed cf code

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-27 07:49:45 +01:00
Jean-Christophe PLAGNIOL-VILLARD 4267de5a81 crypto: sha512: switch to linux implementation
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-27 07:49:45 +01:00
Jean-Christophe PLAGNIOL-VILLARD 2332a219da crypto: sha256: switch to linux implementation
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-27 07:49:45 +01:00
Jean-Christophe PLAGNIOL-VILLARD 144e104a1e crypto: sha1: switch to linux implementation
current implementation

$ ls -al build/versatilpb/arch/arm/pbl/zbarebox.bin
-rw-r--r-- 1 root root 211095 Mar 24 13:21 build/versatilpb/arch/arm/pbl/zbarebox.bin

linux generic implementation

$ ls -al build/versatilpb/arch/arm/pbl/zbarebox.bin
-rw-r--r-- 1 root root 210829 Mar 24 13:21 build/versatilpb/arch/arm/pbl/zbarebox.bin

on a compressed lzo barebox we will 266 bytes

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-27 07:49:45 +01:00
Jean-Christophe PLAGNIOL-VILLARD c3fe3d7059 crypto: hmac: move register to hmac
As we will use the best sha algo at runtime

Add a new init level crypto_initcall to ensure that all the sha present
before hmac

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-27 07:49:45 +01:00
Jean-Christophe PLAGNIOL-VILLARD ab5b2c35e1 crypto: prepare to allow multiple digest driver
This will allow to have hw driver or asm optimised driver.

Use a priority level to determine which one to use at runtime.
The generic one will be 0.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-27 07:49:45 +01:00
Jean-Christophe PLAGNIOL-VILLARD e10cc0b333 digest: allow algo to specify their length at runtime
such as RSA as we load a DER key we will detect the key size
at runtime and so the algo length.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-27 07:49:45 +01:00
Jean-Christophe PLAGNIOL-VILLARD 5afec9c781 command: digest/hashsum: set key at command level
and only set the key when specified

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-27 07:49:37 +01:00
Lucas Stach 6dc8ef5007 docs: correct link to microcom repo
It's not nice to land on a 404 page and having to
search for the right location manually.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-26 08:00:13 +01:00
Lucas Stach b9f4cd150b usb: host: xhci: depend on HAS_DMA
The driver needs the dma coherent function and thus can
only work on architectures implementing them.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-26 07:48:03 +01:00
Lucas Stach a5e4aa4875 clk: fractional-divider: fix build with CONFIG_MODULES
Fixes:
error: 'clk_register_fractional_divider' undeclared here

introduced with commit 22a0c31c92 (CLK: Add fractional
divider clock support from Linux kernel)

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-26 07:47:48 +01:00
Lucas Stach 05de5bac6b ARM: highbank: fix build with recent binutils
Recent binutils versions assume that the v7 security
extensions are not available by default. They need to be enabled
explicitly if code wishes to use instructions defined by them.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-26 07:47:36 +01:00
Stefan Müller-Klieser 115bfd0009 lzo: check for length overrun in variable length encoding.
This corresponds to kernel commit 72cf90124e87d975d0b

This fix ensures that we never meet an integer overflow while adding
255 while parsing a variable length encoding. It works differently from
commit 206a81c ("lzo: properly check for overruns") because instead of
ensuring that we don't overrun the input, which is tricky to guarantee
due to many assumptions in the code, it simply checks that the cumulated
number of 255 read cannot overflow by bounding this number.

The MAX_255_COUNT is the maximum number of times we can add 255 to a base
count without overflowing an integer. The multiply will overflow when
multiplying 255 by more than MAXINT/255. The sum will overflow earlier
depending on the base count. Since the base count is taken from a u8
and a few bits, it is safe to assume that it will always be lower than
or equal to 2*255, thus we can always prevent any overflow by accepting
two less 255 steps.

This patch also reduces the CPU overhead and actually increases performance
by 1.1% compared to the initial code, while the previous fix costs 3.1%
(measured on x86_64).

The fix needs to be backported to all currently supported stable kernels.

Reported-by: Willem Pinckaers <willem@lekkertech.net>
Cc: "Don A. Bailey" <donb@securitymouse.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-25 09:47:51 +01:00
Stefan Müller-Klieser 69a6dcdc0e Revert "lzo: properly check for overruns"
This reverts barebox commit ecb1dc0b1e
This corresponds to kernel commit af958a38a60c7ca3d8

As analysed by Willem Pinckaers, this fix is still incomplete on
certain rare corner cases, and it is easier to restart from the
original code.

Reported-by: Willem Pinckaers <willem@lekkertech.net>
Cc: "Don A. Bailey" <donb@securitymouse.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-25 09:47:51 +01:00
Antony Pavlov 7b6ede6973 toshiba_ac100: board.c: drop unused headers
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-24 07:18:56 +01:00
Sascha Hauer 3da922bb1b ARM: Add ELTEC HiPerCam board support
This adds support for the i.MX6 based Eltec HiPerCam board.
This board comes with different i.MX6 flavours and different
memory sizes. Currently supported is the i.MX6dl version with
256MB DDR3 RAM.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-20 12:40:40 +01:00
Sascha Hauer 5967f594af ARM: i.MX6: ocotp: remove useless code
cdev->name is initialized to a static string, so no need
to check if it's non NULL.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-20 12:14:17 +01:00
Sascha Hauer 865d5a14f9 ARM: i.MX6: Add clock for ocotp
This clock is not specified in the devicetree node, thus is missing
since we switched to of based clocks for i.MX6. Add this clock back
as physbase clk to make the ocotp driver work again.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-20 12:14:04 +01:00
Jean-Christophe PLAGNIOL-VILLARD e49a47fba8 password: add pbkdf2 support
We will use random 32 bytes salt and 10000 round to generate a
32 bytes key.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-20 11:45:55 +01:00
Jean-Christophe PLAGNIOL-VILLARD ca95c2531f crypto: digest: speficied when a digest need a key to be used
such as for hmac(xxx) you must provide a key

This will allow to enforce the correct parameter at digest command

<digest>sum is not impacted

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-20 11:45:55 +01:00
Jean-Christophe PLAGNIOL-VILLARD b0be99fc10 command: add generic digest command
That can be used for digest calculation and verify

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-20 11:45:55 +01:00
Wadim Egorov f28ea92181 mci: core: Check return value of dev_add_param_bool
Commit 03b59bdb64 changed the
return values of dev_add_param_* to ERR_PTR(-ENOSYS) and broke a few boards.
We have now to care about the return value of dev_add_param_bool() in
mci_register().

Also set the ret variable when dev_add_param_bool() fails.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-19 07:52:24 +01:00
Sascha Hauer df4b6f133b lib: Add hex2bin and bin2hex implementations
Taken from the Kernel, put into the same place as in the kernel,
although the hexdump.c does not actually contain hexdum functions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-19 07:50:21 +01:00
Jean-Christophe PLAGNIOL-VILLARD 1f91b3e6da command: rename digest.c to hashsum.c
as I'll add a new generic command named digest

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-19 07:46:22 +01:00
Jean-Christophe PLAGNIOL-VILLARD 9f15b42105 command: allow runtime usage
This will allow as example to list the currently supported digest.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-19 07:46:22 +01:00
Jean-Christophe PLAGNIOL-VILLARD 5f5d5331bb crypto: add pbkdf2 hmac key generator
this will allow to generate a KEY + IV based on a password and salt for AES
encryption/decryption as example

or simply the key for hmac or rsa from text password

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-19 07:46:22 +01:00
Jean-Christophe PLAGNIOL-VILLARD 18d778a06e crypto: hmac: use digest_digest and check the return of every digest_xxx
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-19 07:46:22 +01:00
Jean-Christophe PLAGNIOL-VILLARD 7aeb9650b6 digest: add digest callback
Combination of @init and @update and @final. This function
effectively behaves as the entire chain of operations, @init,
@update and @final issued in sequence. This is added for hardware
which cannot do even the @finup, but can only do the whole
transformation in one run.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-19 07:46:22 +01:00
Jean-Christophe PLAGNIOL-VILLARD ec4f969971 digest: add verify callback
this will allow to compare a md with the original one

When calling this do not call final

For RSA_SIGN verification final does not exist only verify
as final will be for signing

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-19 07:46:22 +01:00
Jean-Christophe PLAGNIOL-VILLARD 92138a7754 crypto: digest: digest_file_window/digest_file/digest_file_by_name drop key params
expect the key to be set before calling

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-19 07:46:15 +01:00
Sascha Hauer ccee789e67 Documentation: booting-linux: Fix wrong variable name
All variables starting with global.linux.bootargs. are concatemated
to bootargs, not global.bootargs. .

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-18 09:51:18 +01:00
Jean-Christophe PLAGNIOL-VILLARD bf2cdf4084 crypto: digest: digest_file_window: check every digest_xxx return
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-18 08:44:01 +01:00
Sascha Hauer f929fab29c pci: Add i.MX6 pcie support
Based on the corresponding kernel driver with changes to make it
work on barebox.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-17 07:36:00 +01:00
Sascha Hauer 7e2b903274 ARM: i.MX6: Add PCI clocks
Needed for pcie support.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-17 07:36:00 +01:00
Sascha Hauer 997df0373f ARM: i.MX: Add imx_clk_gate_exclusive
This adds support for two gates from can only exclusively be enabled.
Based on the corresponding Linux code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-17 07:36:00 +01:00
Sascha Hauer 467bc67bc3 pci: Add pcie-designware driver
Based on the corresponding kernel driver, only small changes
to make it work on barebox.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-17 07:36:00 +01:00
Sascha Hauer 025362e2cc pci: pci_regs.h: Sync with Linux
Sync the pci register definitions with Linux 4.0-rc1. Some are needed
for the upcoming designware pcie driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-17 07:29:55 +01:00
Sascha Hauer 9a21cc1c2c pci: fix copy-paste bug
Test for the correct resource before derefencing it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-17 07:29:55 +01:00
Sascha Hauer 90b6f60061 pci: Use standard pr_debug
Use pr_debug instead of custom DBG macro.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-17 07:29:42 +01:00
Sascha Hauer 80264a8ac4 driver: Call bus->remove instead of driver->remove
In devices_shutdown we should call the busses remove function
which in turn calls the drivers remove function. Otherwise for
example PCI devices never get removed since they do not have
a remove function but a pcidev->remove function instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-17 07:24:55 +01:00
Sascha Hauer e0899dfa3b driver: Call remove function only when available
The bus implementations currently call the drivers remove
hook unconditionally, but this hook is seldomly populated. Only call
it when it's actually populated.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-17 07:24:50 +01:00
Sascha Hauer 0f3366ba85 driver: fix device remove order
The active list is supposed to collect active devices in the
opposite order they are probed. This is used to remove the
devices in the correct order in devices_shutdown. The order
is wrong though when in a drivers probe function other devices
are registered. To get the order right we have to add the new
device to the active list before it is probed.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-17 07:24:45 +01:00
Lucas Stach a76c62f80d net: mvneta: convert to streaming DMA ops
Move to the common streaming DMA ops in order to get rid of
the direct usage of the ARM MMU functions for the cache
maintenance.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-16 05:30:19 +01:00
Lucas Stach eab9e4cdd9 PCI: fix bad bugs in bridge setup code
Add the required brackets, so that we don't write unused registers
with potentially bogus values.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-16 05:29:32 +01:00
Sascha Hauer e693622467 crypto: digest: Fix coding style
When declaring pointer data or a function that returns a pointer type, the
preferred use of '*' is adjacent to the data name or function name and not
adjacent to the type name.

Fix the remaining occurences in crypto/

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-13 08:32:28 +01:00