9
0
Fork 0
Commit Graph

14081 Commits

Author SHA1 Message Date
Andrey Gusakov 6f1d5dbff0 include/linux/phy.h: Add MII_ADDR_C45
Add MII_ADDR_C45 used by bitbanged MDIO

Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-03 07:58:28 +01:00
Yegor Yefremov f0c2924100 dcache: add missing linux/list.h include
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-03 07:57:36 +01:00
Yegor Yefremov c8b37d4983 fs: import magic.h from Linux kernel
include/linux/magic.h provides MAGIC numbers for various
file systems.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-03 07:57:36 +01:00
Yegor Yefremov 0123e9f633 Introduce include/linux/rwsem.h
Move semaphore related definitions to its original place.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-03 07:57:36 +01:00
Yegor Yefremov 6b8cf28e0c Introduce include/linux/wait.h
Move Linux wait queue related definitions to its original place.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-03 07:57:36 +01:00
Yegor Yefremov 7814ae61ab Introduce include/linux/mutex.h
Move mutex related defines to its original place.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-03 07:57:32 +01:00
Sascha Hauer 6fafba44e7 scripts: imx: Drop double check
We have the same "if (*line == '\0')" check twice. Remove one of them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer ba8898e63f scripts: imx-usb-loader: Add -s and -i options
Normally imx-usb-loader interprets and executes the DCD table from
an uploaded image and invalidates the DCD before uploading the image
itself to prevent the i.MX ROM code from executing it again. With HAB
signed images this is not possible since invalidating the DCD table
modifies the image which also makes the signature invalid.
To support this usecase add two new options to imx-usb-loader:

The -i option allows to pass in an external config file which can be
used to setup SDRAM. The DCD table in the image can then be made empty
so that the ROM does not see a second SDRAM setup.

The -s option allows to skip interpreting the DCD table in the image.
This may when some setup stuff is still in the images DCD table but
shall be executed by the ROM and not by imx-usb-loader.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer 9ee83d3f8d scripts: imx: make libusb variables global
No need to pass the libusb context through from function to function.
Make them globally visible.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer 64dca713e5 scripts: imx: move config file parser to separate file
To make the config parser usable by imx-usb-loader also move
it to a separate file.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer 2cc35fe5de scripts: imx-image: move check to context data
Move the config parsers check function to context data to make
it possible to pass in a different version of this function later.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer 28809d1517 scripts: imx-image: move write_mem to context data
Move the config parsers write_mem function to context data to make
it possible to pass in a different version of this function later.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer 020136d26c scripts: imx-image: Add context struct to config parsers
This adds a context struct to the config parser. This is a first
step to make the config parser usable from both imx-image and
imx-usb-loader which will be needed later.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer be6b5cf74c scripts: imx: Consolidate flash headers in imx tools
Both imx-image and imx-usb-loader use their own variants of the
i.MX flash header definitions. Consolidate them to avoid code
duplication.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer 24315db717 scripts: imx-usb-loader: Move load_file up
To avoid forward declaration in a later patch.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer eee4a26680 scripts: imx-usb-loader: fully read images into memory
imx-usb-loader tries to safe memory by reading the image in chunks.
This is unnecessarily complicated. The images are small, so fully read
them into memory and store them in a single buffer. This makes handling
them a lot easier.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer 2ae40562ae scripts: imx-image: Allow dcd offset 0x0
0 is a valid offset for the dcd, so do not use this value to detect
an unset dcd offset. Use 0xffffffff instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer bca787cf4a scripts: imx-usb-loader: Move definitions up
The macros are needed earlier in a later patch.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer a44976d238 scripts: imx-usb-loader: Make readonly arguments const
The buffers passed to dump_long and dump_bytes are not (and shouldn't
be) modified. Make the arguments const.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer 8aabf498e1 hab: Add HABv3 status report function
Status reporting for HABv3 is different from HABv4. Add a status
report function for HABv3.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer 2ff23512d9 imx: hab: rename driver dir to hab/
There's not only HABv4 but also HABv3. No need to put the corresponding
code in separate directories, so rename the habv4 directory to hab.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer 341d550c50 ARM: i.MX: Add HABv3 Kconfig variables
For signing i.MX images with HABv3 we need several certificates. Add
their pathes to Kconfig variables to make them available to the build
system.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer b5eb8b90fe scripts: mxs: Use Kernel includes
Use the common definition of ARRAY_SIZE and roundup.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer 9aa7aa8f08 scripts: imx: Use Kernel includes
Use the common definition of ARRAY_SIZE and offsetof.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer f5c8d18ece scripts: Add scripts/include to host compiler includes
So that host tools can use the kernel includes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer dd29e91770 scripts/include: Add ARRAY_SIZE
ARRAY_SIZE is another define commonly used in tools. Add it to the
kernel includes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Sascha Hauer a883d9a3c0 scripts: Add common header files for tools
This imports the tools/include dir from the Kernel as of 4.5-rc1 to
barebox.
The Kernel has many useful defines and helpers which are often
duplicated in the different tools. Let's create a copy of them
in a common place for all tools.

Some files have been skipped for now as I currently see no use for them:

include/linux/filter.h
include/linux/hash.h
include/linux/rbtree.h
include/linux/rbtree_augmented.h

They can be added later if needed.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-02 15:41:04 +01:00
Yegor Yefremov baa7fe1d15 Introduce include/linux/spinlock.h
Move spinlock related definitions to its original place.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-01 09:16:13 +01:00
Yegor Yefremov 7a583dfb4f Introduce include/linux/sched.h
Move cond_resched() from barebox-wrapper.h to its original
place.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-01 09:16:13 +01:00
Yegor Yefremov 6f332972ef fs: ubifs: move file and file_system_type definitions to linux/fs.h
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-01 09:16:13 +01:00
Yegor Yefremov d20f839037 fs: ubifs: move path definition to include/linux/path.h
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-01 09:16:13 +01:00
Yegor Yefremov 3243c0d236 fs: ubifs: move vfsmount definition to include/linux/mount.h
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-01 09:16:13 +01:00
Yegor Yefremov b456308c4c fs: ubifs: move dcache related definitions to include/linux/dcache.h
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-01 09:16:13 +01:00
Yegor Yefremov 838ca724e7 fs: move pgoff_t definition to include/linux/types.h
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-01 09:16:13 +01:00
Yegor Yefremov 00dd903055 fs: use linux/fs.h for file system related definitions
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-01 09:16:13 +01:00
Sascha Hauer 3c0e5afc5a x86: Add missing typedef for umode_t
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-01 09:16:12 +01:00
Sascha Hauer 607496b38c nios2: Add missing typedef for umode_t
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-01 09:14:28 +01:00
Yegor Yefremov e5bd17b896 fs: ubifs: remove redundant macro defines
Remove macros, that were already defined in linux/stat.h.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-29 08:04:27 +01:00
Yegor Yefremov 3b4740b2c1 fs: move PAGE_CACHE definitions to include/linux/pagemap.h
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-29 08:04:27 +01:00
Yegor Yefremov 489c8ba906 fs: introduce include/linux/fs.h
Move Linux file system structs from UBIFS to central place.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-29 08:04:06 +01:00
Yegor Yefremov fa75e4ea25 fs: move struct timespec to include/linux/time.h
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-29 08:04:00 +01:00
Sascha Hauer 436481a993 bootm: Add option to force booting signed images
With CONFIG_BOOTM_FORCE_SIGNED_IMAGES the bootm code will refuse to boot
unsigned images. Since currently FIT is the only image type which
supports signing, this means with this option we enforce using FIT
images. All additionally passed in device trees and initrds will be
ignored, so that only the ones from the FIT image can be used.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2016-01-26 22:45:42 +01:00
Jan Luebbe ac55adb321 bootm: add initial FIT support
This implementation is inspired by U-Boot's FIT support. Instead of
using libfdt (which does not exist in barebox), configuration signatures
are verified by using a simplified DT parser based on barebox's own
code.

Currently, only signed configurations with hashed images are supported,
as the other variants are less useful for verified boot. Compatible FIT
images can be created using U-Boot's mkimage tool.

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>
2016-01-26 22:45:42 +01:00
Sascha Hauer ebb1160cdd bootm: make verifying/hashing configurable
So long struct bootm_data.verify is a bool which enables CRC checking
(hashing). Extend this to a enum and add support for signature checking
in the same option. This also adds the corresponding globalvar and a
-s option to bootm.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-26 22:45:42 +01:00
Sascha Hauer 6e686491a5 crypto: add RSA support
Taken from U-Boot and adopted to barebox with little changes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2016-01-26 22:45:41 +01:00
Sascha Hauer fedba5aaef crypto: add digest_alloc_by_algo()
In barebox the function digest_alloc() allocates a digest based on a string.
When a subsystem already uses an integer value to identify a digest it makes no
sense to create a string and pass it to digest_alloc(), where it is parsed
again. This patch adds the possibility to get a digest by an enum.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-26 22:45:41 +01:00
Sascha Hauer bc94fb379a bootm: Initialize bootm_data defaults in single place
Both the bootm and the boot code initialize the struct bootm_data
with defaults from the bootm global variables. Create a common
function for doing this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-26 22:45:40 +01:00
Sascha Hauer a8531386ff bootm: move oftree code together
The device tree code is distributed in several places in the bootm code.
Move it all together in bootm_load_devicetree().

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-26 22:45:40 +01:00
Sascha Hauer aded35ece4 bootm: move initrd code together
The initrd code is distributed in several places in the bootm code.
Move it all together in bootm_load_initrd().

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-26 22:45:40 +01:00
Sascha Hauer 3f0835e074 bootm: Push dryrun to handlers
We can make the dryrun option more useful by calling into the handlers.
With this we can detect more cases that can go wrong during boot.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-26 22:45:36 +01:00