summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* regmap: Add missing prototype for regmap_exit()Sascha Hauer2016-02-121-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/regmap'Sascha Hauer2016-02-082-2/+67
|\
| * Add initial regmap supportSascha Hauer2016-02-051-0/+62
| | | | | | | | | | | | | | | | This adds initial regmap support. Function prototypes are from the Kernel, the implemention is mostly rewritten. Currently the regmap support is limited to the bare minimum to get started. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * bitops: Fix shift overflow in GENMASK macrosSteffen Trumtrar2016-02-031-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on the original patch for linux: commit 00b4d9a14125f1e51874def2b9de6092e007412d Author: Maxime COQUELIN <maxime.coquelin@st.com> Date: Thu Nov 6 10:54:19 2014 On some 32 bits architectures, including x86, GENMASK(31, 0) returns 0 instead of the expected ~0UL. This is the same on some 64 bits architectures with GENMASK_ULL(63, 0). This is due to an overflow in the shift operand, 1 << 32 for GENMASK, 1 << 64 for GENMASK_ULL. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
* | Merge branch 'for-next/ratp'Sascha Hauer2016-02-082-0/+37
|\ \
| * | barebox remote controlSascha Hauer2016-01-182-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the ability to control barebox over serial lines. The regular console is designed for human input and is unsuitable for controlling barebox from scripts since characters can be lost on both ends, the data stream contains escape sequences and the prompt cannot be easily matched upon. This approach is based on the RATP protocol. RATP packages start with a binary 0x01 which does not occur in normal console data. Whenever a 0x01 character is detected in the console barebox goes into RATP mode. The RATP packets contain a simple structure with a command/respone type and data for that type. Currently defined types are: BB_RATP_TYPE_COMMAND (host->barebox): Execute a command in the shell BB_RATP_TYPE_COMMAND_RETURN (barebox->host) Sends return value of the command back to the host, also means barebox is ready for the next command BB_RATP_TYPE_CONSOLEMSG (barebox->host) Console message from barebox Planned but not yet implemented are: BB_RATP_TYPE_PING (host->barebox) BB_RATP_TYPE_PONG (barebox->host) For testing purposes BB_RATP_TYPE_GETENV (host->barebox) BB_RATP_TYPE_GETENV_RETURN (barebox->host) Get values of environment variables Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Andrey Smirnov <andrew.smirnov@gmail.com>
| * | Add Reliable Asynchronous Transfer ProtocolSascha Hauer2016-01-181-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for Reliable Asynchronous Transfer Protocol (RATP) as described in RFC916. Communication over RS232 is often unreliable as characters are lost or misinterpreted. This protocol allows for a reliable packet based communication over serial lines. The implementation simply follows the state machine described in the RFC text with one exception. RFC916 uses a plain checksum for the transferred data. We decided to use CRC16 for greater robustness. Since this is the only RFC916 implementation we currently know of interoperability with other implementations should not matter. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Andrey Smirnov <andrew.smirnov@gmail.com>
* | | Merge branch 'for-next/net'Sascha Hauer2016-02-082-0/+52
|\ \ \
| * | | miitool: Add code to register a PHYAndrey Smirnov2016-02-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the behaviour of the 'miitool'. Now in order to show PHY's link information 'miitool' should be invoked as such: miitool -s [PHY] Also, implment code to allow to register a dummy PHY device in order to be able to perform raw MDIO bus access. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mdio_bus: Add mdiobus_get_bus() functionAndrey Smirnov2016-02-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add mdiobus_get_bus() -- a function to get a MDIO bus by its number Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | net: Port bitbanged MDIO code from Linux kernelAndrey Gusakov2016-02-031-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Port bitbanged MDIO framework and gpiolib MDIO bus driver that uses it from Linux kernel. 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>
| * | | include/linux/phy.h: Add MII_ADDR_C45Andrey Gusakov2016-02-031-0/+4
| | |/ | |/| | | | | | | | | | | | | | | | | | | 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>
* | | Merge branch 'for-next/misc'Sascha Hauer2016-02-081-6/+0
|\ \ \
| * | | Convert users of PRINTF_CONVERSION_RESOURCE to %paSascha Hauer2016-01-151-6/+0
| |/ / | | | | | | | | | | | | | | | | | | | | | printf now supports printing resource_size_t directly, convert all users of the previously used PRINTF_CONVERSION_RESOURCE over to %pa. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/linux-headers'Sascha Hauer2016-02-0818-31/+652
|\ \ \
| * | | dcache: add missing linux/list.h includeYegor Yefremov2016-02-031-0/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | fs: import magic.h from Linux kernelYegor Yefremov2016-02-032-1/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | Introduce include/linux/rwsem.hYegor Yefremov2016-02-033-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | Introduce include/linux/wait.hYegor Yefremov2016-02-033-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | Introduce include/linux/mutex.hYegor Yefremov2016-02-034-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | Introduce include/linux/spinlock.hYegor Yefremov2016-02-015-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | Introduce include/linux/sched.hYegor Yefremov2016-02-012-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | fs: ubifs: move file and file_system_type definitions to linux/fs.hYegor Yefremov2016-02-011-0/+39
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | fs: ubifs: move path definition to include/linux/path.hYegor Yefremov2016-02-011-0/+12
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | fs: ubifs: move vfsmount definition to include/linux/mount.hYegor Yefremov2016-02-011-0/+21
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | fs: ubifs: move dcache related definitions to include/linux/dcache.hYegor Yefremov2016-02-011-0/+77
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | fs: move pgoff_t definition to include/linux/types.hYegor Yefremov2016-02-011-0/+5
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | fs: use linux/fs.h for file system related definitionsYegor Yefremov2016-02-012-4/+190
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | fs: move PAGE_CACHE definitions to include/linux/pagemap.hYegor Yefremov2016-01-291-0/+14
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | fs: introduce include/linux/fs.hYegor Yefremov2016-01-291-0/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | fs: move struct timespec to include/linux/time.hYegor Yefremov2016-01-291-0/+5
| |/ / | | | | | | | | | | | | Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/input'Sascha Hauer2016-02-085-59/+74
|\ \ \
| * | | input: Add device tree parsing support for matrix keymapSascha Hauer2016-01-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Add support for parsing the "linux,keymap" property. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | input: move matrix_keypad_build_keymap() to C fileSascha Hauer2016-01-131-26/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Future additions will make the function too big to live as a static inline function. Move to a C file and while at it, move matrix_keypad.h to include/input/ where it belongs to. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | input: Add input coreSascha Hauer2016-01-131-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently all input driver register themselves as consoles. Consoles are fine for typing text, but they do not allow to ask for the current pressed state of buttons or keypads. They also do not support non printable keys like the function keys. This patch adds a simple input core. On the driver side it supports input_report_key_event() to report events (button presses and releases). On the consumer side it allows getting the current button status via input_key_get_status(). Also an event driven interface is available which calls a callback whenever an input event is received. The input core also registers a console for all registered input devices which handles passing events to the console and stuff like key repetition, so this can be removed from the drivers once they are converted to the input core. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | keymap: Add keymap for keys with shift pressedSascha Hauer2016-01-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When converting keys to ascii for the console we also need the keymap with shift pressed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | poller: Fix async pollerSascha Hauer2016-01-131-0/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The async poller does not work as expected since it can happen that the async poller is removed from the list of pollers while we are iterating over the list. Even list_for_each_entry_safe does not help here since we may remove the next list element, but list_for_each_entry_safe only allows to remove the current list element. Rework the async poller so that it is registered with the poller framework on registration and then is only marked as active with poller_call_async(). This way we do not have to do list manipulations while running the pollers. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/hab'Sascha Hauer2016-02-081-2/+16
|\ \ \
| * | | imx: hab: Make hab status functions SoC specificSascha Hauer2016-02-041-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The HABv4 functions need access a part of the ROM which is located in the zero page. This must be done early, before the MMU has been configured and the zero page has been set to faulting. The HAB functions currently use cpu_is_imxxy(). At the stage where HAB is called the i.MX CPU type variable is not yet initialized, so this code only works when only one i.MX type is enabled and cpu_is_imxxy() are compile time constants. To fix HAB support when more than one i.MX type is enabled make the HAB status function SoC specific so that we can drop the use of cpu_is_imxxy(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | hab: Add HABv3 status report functionSascha Hauer2016-02-021-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Status reporting for HABv3 is different from HABv4. Add a status report function for HABv3. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | imx: hab: rename driver dir to hab/Sascha Hauer2016-02-021-0/+0
| |/ / | | | | | | | | | | | | | | | | | | 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>
* | | bootm: add initial FIT supportJan Luebbe2016-01-262-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | bootm: make verifying/hashing configurableSascha Hauer2016-01-261-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | crypto: add RSA supportSascha Hauer2016-01-262-0/+59
| | | | | | | | | | | | | | | | | | | | | 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>
* | | crypto: add digest_alloc_by_algo()Sascha Hauer2016-01-261-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | bootm: Initialize bootm_data defaults in single placeSascha Hauer2016-01-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | bootm: move initrd code togetherSascha Hauer2016-01-261-0/+3
| | | | | | | | | | | | | | | | | | | | | 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>
* | | bootm: use names instead of numbers for image partsSascha Hauer2016-01-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | The uImage format uses numbers for to identify the different parts of a image, but the FIT image format uses names. To better integrate the FIT image format into bootm always use names and convert them to numbers when necessary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | bootm: introduce bootm_get_os_sizeSascha Hauer2016-01-221-0/+1
|/ / | | | | | | | | | | | | | | ARM do_bootm_linux is not only called with uImages but also with raw images, so we can't use uimage_get_size() here. Introduce bootm_get_os_size() which handles the different image types. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/rtc'Sascha Hauer2016-01-112-0/+10
|\ \