9
0
Fork 0
Commit Graph

3176 Commits

Author SHA1 Message Date
Marc Kleine-Budde 51f97717c8 bootstate: add
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-06-13 14:35:04 +02:00
Sascha Hauer 824f84b6bc mtd: ubi: Let ubidetach take mtd as argument
The ubi number is a dynamically assigned number, so once multiple
ubis are attached, scripts cannot know the ubi number they want
to detach anymore. Convert the ubidetach command to take the mtd
device file instead which is the same argument that was previously
passed to ubiattach.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-13 14:35:04 +02:00
Sascha Hauer 052d9ac0cf blspec: automatically append bootargs
When bootloader spec is used to boot devices it is often desirable
to boot the same image from different media. Since the fs images
need to contain the root= parameters to tell Linux where to boot
from the images can't be identical on different media.

This patch changes this by introducing a 'appendroot' option for
bootloader spec. If set to true, barebox will construct a Linux
commandline option for the device the bootloader spec entry is found
on.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-13 14:35:03 +02:00
Marc Kleine-Budde 4cf630e244 watchdog: add static inline no-ops if WD is disabled
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Applied-Upstream: next, commit:91936ddc4485
2015-06-13 14:35:03 +02:00
Marc Kleine-Budde a571c94254 crypto: digest: mark signature argument as const
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-06-13 14:35:03 +02:00
Marc Kleine-Budde 4e26c8c6d9 state: backend: support phandle and of_path references
This patch improves the backend property, it can be either a phandle or a
of_path. During probe() of the state driver the backend property is
dereferenced and the resulting of_path is saved in the state context. In a
later patch it will be used to generate a phandle reference to the backend
during DT fixup.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-05-17 20:43:40 +02:00
Marc Kleine-Budde 02c6da8d85 state: make state_release() non static
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2015-05-17 20:43:40 +02:00
Marc Kleine-Budde 618d712f91 state: state_new_from_fdt(): remove unused function
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Applied-Upstream: next, commit:9a6dc0376add
2015-05-17 20:43:40 +02:00
Uwe Kleine-König 25d8af0f01 of: add a function to remove an of_fixup
This function is needed when a device that already registered a fixup in
the probe routine fails later to probe completely. Without unregistering
the fixup the function might later be called with invalid data.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Forwarded: id:1431771149-27265-1-git-send-email-u.kleine-koenig@pengutronix.de
2015-05-17 20:42:55 +02:00
Marc Kleine-Budde d9ada004ea include: add includes includes to make fdt.h, of.h and state.h self contained
Otherwise compilation may fail with:

include/fdt.h:11:15: error: unknown type name 'uint64_t'
 static inline uint64_t fdt64_to_cpu(uint64_t x)

include/of.h:22:19: error: field 'list' has incomplete type
  struct list_head list;

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Applied-Upstream: v2015.06.0, commit:9e69a04222ee88c51bd5ca4f802b5fa5ad42b0f8
2015-05-13 11:12:54 +02:00
Sebastian Hesselbarth 532059b525 base: Introduce deferred probing
As expected, we would need deferred probing sooner or later. This is
a first approach to allow devices to return -EPROBE_DEFER and get
sorted into a list of deferred devices that will be re-probed later.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Origin: v2015.06.0, commit:ab3da15bc14cc5297b2da27eb3dcd8d70dac41df
2015-05-13 11:12:14 +02:00
Sascha Hauer ee0035e5cc Merge branch 'for-next/state' 2015-04-13 12:57:14 +02:00
Sascha Hauer a76a6bc8fd Merge branch 'for-next/pxa' 2015-04-13 12:57:13 +02:00
Sascha Hauer 9c4cf7d3b6 Merge branch 'for-next/pci' 2015-04-13 12:57:13 +02:00
Sascha Hauer 909dbe5334 Merge branch 'for-next/crypto' 2015-04-13 12:57:12 +02:00
Robert Jarzmik 1e72d3c622 net: smc1111: add a quirk for pxa pxa27x platforms
As hinted in the linux kernel driver, pxa platforms such as mainstone,
stargate and idp have a broken design, where half-word writes not
aligned to a word address are not working.

This patch is a taking back the half-word write accessor for this
specific case from the linux kernel.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-04-13 09:24:00 +02:00
Lucas Stach da440ab859 pci: make sure to activate devices on the root bus
Commit b8a1bb1dd2 (pci: defer device registration until after bridge setup)
changed the activation order of devices, so that bridges above the devices could
be configured properly before activating the devices below. This commit failed
to acknowledge that there may be devices located directly on the root bus without
any bridge in between and so those devices would never get enabled.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
2015-04-13 08:34:28 +02: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 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
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 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 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 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 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 ac2407db7a crypto: digest: Make string arguments const
Most string arguments for keys and filenames can be const. Change
that.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-13 08:32:28 +01:00
Jean-Christophe PLAGNIOL-VILLARD 102d59f91f command: add hmac sum supportfor md5, sha1, sha224, sha256, sha384, sha512
pass the key via -h param

barebox@barebox sandbox:/ sha256sum -h test /dev/fd0
c297473e9bb221c5dc51d47ad75c76095f1bdc4ca9dff1d5931c2e22bf11a0de  /dev/fd0 0x00000000 ... 0xffffffffffffffff

use the same idea as openssl command

$ openssl dgst -sha256 -hmac "test" TODO
HMAC-SHA256(TODO)= c297473e9bb221c5dc51d47ad75c76095f1bdc4ca9dff1d5931c2e22bf11a0de

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-13 08:32:28 +01:00
Jean-Christophe PLAGNIOL-VILLARD 2f3c3f512b digest: add HMAC support for md5, sha1, sha224, sha256, sha384, sha512
the hmac algo will be registered as hmac(%s) such as hmac(sha256)

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-13 08:32:28 +01:00
Sascha Hauer 5dd5884801 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-13 08:22:27 +01:00
Sascha Hauer 1487e6b9ad state: add framework for persistent state handling
This patch adds a framework to describe, access, store and restore a set of
variables. A state variable set can be fully described in a devicetree node.
This node could be part of the regular devicetree blob or it could be an extra
devicetree solely for the state. The state variable set contains variables of
different types and a place to store the variable set.

For more information see:
    Documentation/devicetree/bindings/barebox/barebox,state.rst

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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-12 08:28:31 +01:00
Jean-Christophe PLAGNIOL-VILLARD dcc4a70a3c gitignore: only ignore include/config.h
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-12 08:18:26 +01:00
Jean-Christophe PLAGNIOL-VILLARD 27b2336029 digest: make it multi-instance
Now you need to call digest_alloc and when you finish to use it digest_free.

We need this for upcomming aes encryption support and secure boot
as we will need multiple instance of the same digest.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-12 07:58:24 +01:00
Jean-Christophe PLAGNIOL-VILLARD 804fae5d16 digest: introduce digest_{init/update/final/length}
This will allow to move from a one at a time digest to a multi-instance
with too much impact on the code using it

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-12 07:58:24 +01:00
Lucas Stach 3c5e8206c2 parameter: include header for ERR_PTR and errno
Commit 03b59bdb64 (paramter: The dev_add_param_*() return ERR_PTR(),
change no-ops to return ERR_PTR(-ENOSYS) instead of NULL) started using
ERR_PTR and errnos without including the relevant header.

This fixes the build for a lot of configurations.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-11 09:36:38 +01:00
Marc Kleine-Budde 03b59bdb64 paramter: The dev_add_param_*() return ERR_PTR(), change no-ops to return ERR_PTR(-ENOSYS) instead of NULL
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-10 11:08:23 +01:00
Sascha Hauer fa20ea45e0 Merge branch 'for-next/tegra' 2015-03-09 08:32:26 +01:00
Sascha Hauer 4680b375b9 Merge branch 'for-next/streaming-dma'
Conflicts:
	drivers/mci/dw_mmc.c
2015-03-09 08:32:21 +01:00
Sascha Hauer 55ab01c7ff Merge branch 'for-next/rockchip'
Conflicts:
	arch/arm/Kconfig
2015-03-09 08:30:35 +01:00
Sascha Hauer ac81a0d876 Merge branch 'for-next/misc' 2015-03-09 08:30:24 +01:00
Sascha Hauer ac1bffb220 Merge branch 'for-next/fs' 2015-03-09 08:30:24 +01:00
Sascha Hauer 6977292a34 fs: rename inode member of struct filep to priv
Because that's what it is. 'inode' will become confusing
once we support real inodes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-09 08:06:41 +01:00
Sascha Hauer 6bcfcece08 Merge branch 'for-next/sandbox-of' 2015-03-06 08:33:50 +01:00
Sascha Hauer 0e055c254c Merge branch 'for-next/mtd-partitions' 2015-03-06 08:33:43 +01:00
Lucas Stach 381f034ed6 ARM: move DMA alloc functions to dma.h
This better separates the DMA from the MMU functionality.

Also move all drivers that only depends on asm/mmu.h for the alloc
functions over to the common header.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-06 07:52:02 +01:00