9
0
Fork 0
Commit Graph

3664 Commits

Author SHA1 Message Date
Sascha Hauer 034d4ddcb6 Merge branch 'for-next/misc' 2016-03-11 10:49:50 +01:00
Sascha Hauer 690ec1804c Merge branch 'for-next/driver' 2016-03-11 10:49:48 +01:00
Sascha Hauer c41f840f4b Merge branch 'for-next/caam' 2016-03-11 10:49:35 +01:00
Sascha Hauer 330dc0a6b7 Merge branch 'for-next/bbu' 2016-03-11 10:49:35 +01:00
Markus Pargmann 0240fd3f84 fastboot: Add a ARM Barebox filetype handler
This will automatically call barebox_update for the transfered file if
it is an ARM Barebox image and the destination file is defined by some
update handler.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-11 08:06:05 +01:00
Sascha Hauer 568e345d5a mtd: mtd_[read|write|erase]: check for valid input data
mtd_[read|write|erase] are input functions to the mtd subsystem, so
check for valid input data here rather than relying on the drivers doing
this. The checks are copied from the Kernel as of 4.5-rc5

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-04 08:23:06 +01:00
Yegor Yefremov 237abe7bb8 linux/fs.h: add types and routines needed for SquashFS
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-02 19:14:57 +01:00
Yegor Yefremov 196dccdfcf linux/types.h: add sector_t and blkcnt_t types
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-02 19:14:57 +01:00
Teresa Remmet 153c34b347 common: oftree: Add function to register set status fixup
Added a function to register a fixup to enable or disable
device tree nodes.

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-01 08:25:42 +01:00
Sascha Hauer 246266c205 serial: imx: Support DTE mode
Based on Kernel commit 20ff2fe60a: serial: imx: add support for DTE mode

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-26 07:54:15 +01:00
Alexander Kurz a7932a35da EP93xx eth: allow passing of phy config via platform data
Passing phy configuration to the ep93xx_eth driver was not supported yet
and will be added with this patch. When no pdata is passed, the probably
broken default of phy_addr = 0 will be used to maintain compatibility
with the previous implementation.

Signed-off-by: Alexander Kurz <akurz@blala.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-25 09:42:29 +01:00
Sascha Hauer fe7855bb4f driver: Introduce dev_request_mem_resource
dev_request_mem_region returns a void * which shall be checked with
IS_ERR(), but in some cases the valid pointer returned clashes with
error values. This is especially the case on some Atmel SoCs.

This introduces dev_request_mem_resource which returns a struct resource
instead which in any case can be checked with IS_ERR(). It's the drivers
responsibility then to get the IOMEM pointer from the resource.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-23 08:15:57 +01:00
Markus Pargmann 7290110f1a bbu: Add function to check if an update handler exists
This adds a function to check for the existence of an update handler
based on the supplied bbu_data.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-18 16:10:11 +01:00
Steffen Trumtrar acf6849208 include: linux: add circular buffers
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-12 15:55:55 +01:00
Sascha Hauer 0f1c0c4d30 regmap: Add missing prototype for regmap_exit()
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-12 15:36:54 +01:00
Sascha Hauer 81737c1d43 mtd: Fix erasing of devices >4GiB
When a device >4GiB is erased, not only the offset can be bigger
than 4GiB, but also the size. This happens with the simplest command
to erase a device: erase /dev/nand0. Make the size argument a 64bit
type to make this work.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-09 09:32:29 +01:00
Sascha Hauer 1e009bf266 mtd: Make erase_info structs 64bit where necessary
Make the userspace structs 64bit where necessary. Since we do not have
separated kernel/userspace in barebox we can just modifiy the original
structs instead of adding separate 64bit structs.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-02-09 09:28:55 +01:00
Sascha Hauer 7482ab4de1 Merge branch 'for-next/regmap' 2016-02-08 08:27:03 +01:00
Sascha Hauer c073534880 Merge branch 'for-next/ratp' 2016-02-08 08:27:01 +01:00
Sascha Hauer a22f59c178 Merge branch 'for-next/net' 2016-02-08 08:26:45 +01:00
Sascha Hauer 1379a5ef1e Merge branch 'for-next/misc' 2016-02-08 08:26:43 +01:00
Sascha Hauer 79606b51ed Merge branch 'for-next/linux-headers' 2016-02-08 08:26:36 +01:00
Sascha Hauer 05261801e9 Merge branch 'for-next/input' 2016-02-08 08:26:35 +01:00
Sascha Hauer 6435fb09d8 Merge branch 'for-next/hab' 2016-02-08 08:26:35 +01:00
Sascha Hauer 7a53e162de Add initial regmap support
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>
2016-02-05 14:32:16 +01:00
Sascha Hauer 48d74b1ca4 imx: hab: Make hab status functions SoC specific
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>
2016-02-04 14:38:33 +01:00
Andrey Smirnov ae2fb9b918 miitool: Add code to register a PHY
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>
2016-02-04 08:10:39 +01:00
Steffen Trumtrar 7ffff00dfd bitops: Fix shift overflow in GENMASK macros
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>
2016-02-03 17:14:10 +01:00
Andrey Smirnov 109543cf88 mdio_bus: Add mdiobus_get_bus() function
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>
2016-02-03 07:58:28 +01:00
Andrey Gusakov 09c56012a4 net: Port bitbanged MDIO code from Linux kernel
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>
2016-02-03 07:58:28 +01:00
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 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
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
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
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 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 0a37e22d63 bootm: use names instead of numbers for image parts
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>
2016-01-22 08:15:15 +01:00
Sascha Hauer 0bb6e4c533 bootm: introduce bootm_get_os_size
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>
2016-01-22 08:15:15 +01:00
Sascha Hauer 2660573374 barebox remote control
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>
2016-01-18 09:25:09 +01:00
Sascha Hauer bbdbda0a74 Add Reliable Asynchronous Transfer Protocol
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>
2016-01-18 09:25:04 +01:00
Sascha Hauer e2306ada3e Convert users of PRINTF_CONVERSION_RESOURCE to %pa
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>
2016-01-15 15:33:59 +01:00
Sascha Hauer 5ac4b013a3 input: Add device tree parsing support for matrix keymap
Add support for parsing the "linux,keymap" property.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-13 16:28:07 +01:00
Sascha Hauer 6639c98acc input: move matrix_keypad_build_keymap() to C file
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>
2016-01-13 16:28:06 +01:00
Sascha Hauer 224a08df5d input: Add input core
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>
2016-01-13 16:26:05 +01:00
Sascha Hauer cfe4e61df1 keymap: Add keymap for keys with shift pressed
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>
2016-01-13 16:23:22 +01:00
Sascha Hauer efd9601e15 poller: Fix async poller
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>
2016-01-13 15:55:23 +01:00
Sascha Hauer 1b59b573e4 Merge branch 'for-next/rtc' 2016-01-11 13:11:08 +01:00
Sascha Hauer 70ef1cef5c Merge branch 'for-next/pstore' 2016-01-11 13:11:07 +01:00
Sascha Hauer e64f16cf34 Merge branch 'for-next/net' 2016-01-11 13:11:07 +01:00
Sascha Hauer 2881f2df35 Merge branch 'for-next/mtd' 2016-01-11 13:11:07 +01:00
Sascha Hauer b9a2512aaa Merge branch 'for-next/misc' 2016-01-11 13:11:06 +01:00
Sascha Hauer a7964180e1 Merge branch 'for-next/gcc5' 2016-01-11 13:11:06 +01:00
Trent Piepho d5f9415b04 of: Add of_property_for_each_phandle() iterator
This is like of_property_for_each_{string,u32} but loops over a list
of phandles instead of strings or ints.

Returns the node the handle points to as that's generally more useful
than the handle value itself.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-08 08:30:56 +01:00
Trent Piepho 3a51749e2e of: Add for_each_compatible_node_from iterator
The existing iterator for_each_compatible_node() searches for each
compatible node starting from the root of the loaded device tree.
This means it only works on the barebox device tree and not the tree
to be passed to the Linux kernel, which is what an of_fixup would
probably want to use.

This adds for_each_compatible_node_from(), which takes an additional
parameter of a root to search from.  This could be the device tree to
be used for the kernel.  It could also be used to search just a
subtree.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-08 08:30:56 +01:00
Sascha Hauer 8a35fddf57 devfs: Add symlink support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-08 08:30:55 +01:00
Trent Piepho a3544b162e bootstrap: constify strings
Various parameters for device names, etc.  should be const strings.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-08 08:30:55 +01:00
Alexander Aring 7e613c84cf led: add missing includes
The led header use some parts which are missing when include the this
header. This patch adds them.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-07 12:35:25 +01:00
Sascha Hauer f98b02365f net: Add SNTP support
This adds support for retrieving the time via Simple Network Time
Protocol (SNTP). No fancy features are supported, only plainly getting
the current time.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-07 08:46:09 +01:00
Sascha Hauer 6eb5d78419 hwclock command: use format like the Linux tool does
Print three-letter abbreviations of the days and months.

With a fixup by Andrey Smirnov:
| common/date.c: Fix off-by-one error
|
| As per http://pubs.opengroup.org/onlinepubs/007908775/xsh/time.h.html
| 'tm_wday' is zero indexed with zero representing Sunday, this is also
| corroborated by the code in rtc_time_to_tm() which used 4 to represent
| Thursday.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-07 08:45:12 +01:00
Markus Pargmann 142963e9d5 mtd: nand: Add erased page bitflip check helper functions
This adds the bitflip check helper functions from the kernel. They are
used to check for bitflips in erased pages and correct them in the
buffer so that UBI can work with it. Unfortunately most nand controllers
do not have ECC for erased pages and don't do this on their own.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-01-04 10:43:31 +01:00
Sascha Hauer 39698df6f7 net: resolv: Make argument const
resolv() is not allowed to change the hostname argument, make it const.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-14 11:40:50 +01:00
Trent Piepho 1d31baf145 bootstrap: Boot barebox with kernel calling convention
In commit 8e3ddc13eb the bootm code was
changed to boot barebox using the same calling convention as the
kernel.  Which on ARM is to pass three arguments which are zero, an
architecture code, and a params pointer.

A 2nd stage barebox can be booted using lib/bootstrap, which is
different code from bootm.  This code just leaves garbage in the first
three parameters and so doesn't follow the convention.

Change it to be compatible with the ARM kernel booting convention.
This just sends a zero for the architecture, since the code for
architectures depends on boot[zmu] and something using bootstrap
wouldn't have those too.  And it just passes NULL for the params since
we don't have a way to pass a device tree from the preloader.

All users of bootstrap are ARM based, but the code is in lib so a
non-ARM board might someday make use of it.  If the current code would
work for them, then the change here will be ok too.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-14 11:13:32 +01:00
Sascha Hauer f256280006 linux/barebox-wrapper: Silence gcc5 warning
gcc5 warns about using flags uninitialized in spin_lock_irqsave,
although it could look into the static inline spin_lock_irqsave
implementation and see it's not used at all. An empty define instead
of the static inline wrapper would lead to a "unused variable" warning.
Let's create a macro and fake some usage of the flags variable. This
probably helps until gcc6 is out.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-10 11:05:07 +01:00
Markus Pargmann 160d2ed0ba fs: Add pstore filesystem
pstore is a persistent storage filesystem used for RAMOOPS. It is used
to store console logs, panics, ftrace and other information in case of a
crash/panic/oops/reboot.

pstore is implemented for barebox as a read-only filesystem at the
moment. It may be extended later on. The idea is to provide a way to
extract essential data from the last running kernel.

Most of the code is copied from the kernel. However this is only a
lightweight implementation without real write support yet.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-10 08:49:52 +01:00
Markus Pargmann 899b3822d2 lib: Import reed solomon code from kernel
reed solomon code is used by RAMOOPS to check and fix data stored in
volatile memory.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-10 08:49:52 +01:00
Markus Pargmann 647fba8ee3 vsprintf: Add scnprintf from kernel
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-10 08:49:52 +01:00
Markus Pargmann 45885266f9 printk: Add missing include/declaration
There are functions or structs used that do need these.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-10 08:49:52 +01:00
Markus Pargmann 6f42da2fc8 log2: Add missing __rounddown_pow_of_two()
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-10 08:49:52 +01:00
Andrey Smirnov ba624ae97e i2c: Port two utility functions from Linux kernel
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-08 08:38:31 +01:00
Sascha Hauer 2ae9bbba07 Merge branch 'for-next/state' 2015-12-08 08:29:02 +01:00
Sascha Hauer 3c40bc8c26 Merge branch 'for-next/reset' 2015-12-08 08:28:49 +01:00
Sascha Hauer d10a05b410 Merge branch 'for-next/mtd' 2015-12-08 08:28:27 +01:00
Sascha Hauer 4b1430b653 Merge branch 'for-next/mmc' 2015-12-08 08:28:20 +01:00
Sascha Hauer 29ac6ac467 Merge branch 'for-next/imx' 2015-12-08 08:27:47 +01:00
Sascha Hauer a2b318fe21 Merge branch 'for-next/i2c' 2015-12-08 08:27:37 +01:00
Sascha Hauer a59ae014e1 Merge branch 'for-next/fb' 2015-12-08 08:27:29 +01:00
Sascha Hauer fe68ba4526 Merge branch 'for-next/arm' 2015-12-08 08:27:08 +01:00
Trent Piepho a2b3a25417 ARM: Remove do_execute and thumb2_execute
In commit 104a6a7ccf support was added
for Thumb2.  It added do_execute() as a way to provide arch dependent
calling veneers for use in "go" and thumb2_execute() as the thumb2 to
arm veneer.

But thumb2_execute() isn't necessary as gcc generates a proper calling
sequence from a standard function pointer call.  Thumb2 barebox is
compiled with the AAPCS ABI which requires this.

It also had a bug and didn't pass the arguments properly, but code
execute via "go" rarely uses arguments so this wasn't very noticeable.

Since thumb2 was always the only user of do_execute(), go ahead and
delete that too.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-07 10:44:45 +01:00
Sascha Hauer 412a0e1750 spi: i.MX: optimize transfers for ECSPI v2.3
Instead of writing one word to the txfifo and then wait until
one is received in the rxfifo we can write while the txfifos
are not full and read as long the rxfifos contain data. This
makes transfers for the m25p80 driver around 7 times faster
here.

Unlike the last version this time we only optimize the common
case with 8 bits per word and SPI_LSB_FIRST cleared. The other
cases would require more bit shuffling of the data.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-30 08:22:31 +01:00
Marc Kleine-Budde cd04ed3120 crypto: add simple keystore
This patch adds a simple keystore to barebox. The keystore implements a simple
key-value store to hold arbitrary values.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-27 08:26:40 +01:00
Enrico Jorns 446f3d07dd state: disable load command
Explicitly loading environment is not required as it will be loaded if
available during device probing

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-27 08:26:40 +01:00
Marc Kleine-Budde 21aea1d9ff of_path: add of_find_path_by_node()
This patch adds the function of_find_path_by_node(), which is similar to
of_find_path(), but it translates a device tree node into a barebox device path
directly.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-27 08:26:40 +01:00
Trent Piepho f9c9550b8d eeprom: Add support for 24c1025 EEPROM
This is the Microchip version of the Atmel 24c1024, which is already
supported.  The key difference between them is that the I2C address
bit used to select between the two banks is bit 2 for the 1025 and not
bit 0 as in the 1024.

Add a flag to describe this difference.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-26 09:05:59 +01:00
Sascha Hauer d9ba9c92b7 reset: Add gpio reset support
If a device has the reset-gpios property we can support this through
the reset controller API, so drivers do not have to open code the
support for this property each time themselves as done a few dozen times
in the kernel.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 10:23:38 +01:00
Sascha Hauer 97a92f0d86 reset: Remove unused *_optional functions
Since we now have dummy reset controllers we no longer need the
*_optional functions. These have been unused anyway, so just remove
them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 09:57:50 +01:00
Du Huanpeng ea682776db font: fbconsole: add custom font supports
Signed-off-by: Du Huanpeng <u74147@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:21:08 +01:00
Sebastian Hesselbarth 7cde58cc9d of: mtd: Import of_get_nand_ecc_{step_size, strength} from Linux
This imports DT helpers for MTD ECC step size and strength from
Linux kernel.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:00:09 +01:00
Jan Remmet b9170a1bde net: eth: Remove ethaddr_param
commit d00db554 introduce ethaddr_param. But it is not initialized, so
devinfo fails to show the mac. Remove it and use edev->ethaddr.

Signed-off-by: Jan Remmet <j.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-20 08:23:07 +01:00
Antony Pavlov 4aa3a0347c i2c: add pca954x bus multiplexer driver
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-19 08:58:26 +01:00
Antony Pavlov c3859ce93c i2c: import multiplexed I2C bus core support from linux kernel
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-19 08:58:26 +01:00
Sascha Hauer 901b13e243 i2c: Create for_each_i2c_adapter()
This can be used by the i2c_probe command to iterate over i2c adapters.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-19 08:58:25 +01:00
Trent Piepho 9e45df8ebb mci: dw_mmc: Delete devname in platform_data
Nothing used it.

Also delete the local mci alias pointer to host->mci in
dw_mmc_probe().  It only saved a few characters and all the references
but one are using host->mci.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-19 08:52:10 +01:00
Trent Piepho 5537d653d2 mci: dw_mmc: socfpga: Supply bus-width in platform_data
Since there is no OF support in the xloader on socfpga it uses the
platform_data system.  There needs to be a way to supply the
equivalent of the DT property bus-width this way to support devices
that need to use a smaller bus.

So that we don't need to put every flag that might get added to the
MMC_CAP list into platform_data, just put the bus width ones into
platform_data.

The socfpga dts sources specify a bus-width of 4 so use that in the
platform_data for socfpga.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-19 08:52:10 +01:00
Trent Piepho e11f5908d7 mci: core: bus-width property should override driver default
The OF code for parsing bus-width would only add the specified width
to those the driver might have already set capability flags for.

Because of this, if the driver had set 8 or 4 bit width, it wasn't
possible for the DT to specify that fewer pins were used on the board
and a smaller width was necessary.

Change this so the width in the DT overrides whatever widths the
driver says it supports.  There is no reason to have an incorrect
device tree and it makes far more sense for the DT to override the
driver default than for the driver default to override the DT.

The widths the driver puts in host_caps before calling mci_of_parse()
are considered the default if the DT doesn't specify bus-width.  This
should cause the least amount of change to existing boards, as despite
a comment that no bus-width meant to use 1 bit, using the driver
default is what was really happening.

Unfortunately, half of existing drivers default to the largest width
they support while the other half default to the smallest.  Boards
should just stick the width in the device tree.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-19 08:52:10 +01:00
Sascha Hauer 314b5402d9 fbconsole: register fonts dynamically
Instead of having a fixed array of fonts register the fonts dynamically.
This allows easier adding of fonts to the tree since only one file per
font has to be added and no other files modified.

Currently we have to register the fonts very early before the first
framebuffer is registered. This is because of our limited
dev_add_param_enum() which wants to know the number of elements when
called, so we can't add elements once after we've called
dev_add_param_enum(). Maybe a dev_add_param_array() has to be created
whithout this limitation, but that's left for a future exercise.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-13 09:14:48 +01:00
Sascha Hauer b97ac6bd41 Merge branch 'for-next/usb' 2015-11-06 16:10:44 +01:00
Sascha Hauer 1d9295b344 Merge branch 'for-next/misc' 2015-11-06 16:10:42 +01:00
Sascha Hauer 3cdd30342b Merge branch 'for-next/memtest' 2015-11-06 16:10:37 +01:00
Sascha Hauer ed395e4df1 fcntl: Fix O_CREAT clashing with O_RWSIZE_8
O_CREAT and O_RWSIZE_8 are both defined as 0100. Fix this by moving the
O_RWSIZE_* flags to unused bits.

This bug leads to incomplete writes when the destination file is created
and mem_write is involved, for example with the memcpy command:

memcpy -s /some/file -d /dev/ram0 0 0 10

In this case only 8 bytes will be copied and it will be done using 8
byte accesses which may not work properly if the destination is not
sufficiently aligned, i.e.:

memcpy -s /some/file -d /dev/ram0 0 1 8

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
2015-11-04 09:31:02 +01:00
Sascha Hauer 8f2549abb7 memtest: By default only test biggest region
Often enough the biggest free region spans most free RAM, so
it doesn't add much value to test the remaining free regions. This
patch changes the default behaviour to only test the biggest free
region and adds the -t option to test all regions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-04 08:03:43 +01:00
Sascha Hauer e96b1713ea memtest: split tests in separate functions
The memtest does a bus integrity check and a moving inversions test.
Split the tests into two separate functions so that the can be called
separately.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-03 07:27:47 +01:00
Sascha Hauer b792124a7d rework remap_range
remap_range is for remapping regions with different cache attributes.
It is implemented for ARM and PowerPC only, the other architectures only
provide stubs.
Currently the new cache attributes are passed in an architecture specific
way and the attributes have to be retrieved by calls to
mmu_get_pte_cached_flags() and mmu_get_pte_uncached_flags().
Make this simpler by providing architecture independent flags which can
be directly passed to remap_range()
Also provide a MAP_ARCH_DEFAULT flag and a arch_can_remap() function.
The MAP_ARCH_DEFAULT defaults to whatever caching type the architecture
has as default. the arch_can_remap() function returns true if the
architecture can change the cache attributes, false otherwise. This
allows the memtest code to better find out what it has to do.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-03 07:27:44 +01:00
Sascha Hauer 6b127d4f18 memtest: move request/release regions to common/
Normally code providing a feature should be implemented in common/ which
is then called from the command code. Follow this rule and move some more
of the memtest code to common/.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-27 08:22:45 +01:00
Antony Pavlov d70cb35e44 clock.h: include <types.h> under guard macro
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-22 09:33:58 +02:00
Peter Mamonov e1d67aa40f usb: core: return -EAGAIN on usb_* functions reentrance
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-14 15:35:30 +02:00
Sascha Hauer 54bf386650 Merge branch 'for-next/usb' 2015-10-07 08:23:51 +02:00
Sascha Hauer dd4da6d328 Merge branch 'for-next/omap' 2015-10-07 08:23:45 +02:00
Sascha Hauer 181bb315d0 Merge branch 'for-next/mtd' 2015-10-07 08:23:45 +02:00
Sascha Hauer c8fa7eed66 Merge branch 'for-next/misc' 2015-10-07 08:23:45 +02:00
Sascha Hauer 8a83eca779 Merge branch 'for-next/mci' 2015-10-07 01:01:06 +02:00
Sascha Hauer 160bd3b360 Merge branch 'for-next/imx' 2015-10-07 01:01:06 +02:00
Sascha Hauer 694c5b8794 Revert "spi: i.MX: optimize transfers for ECSPI v2.3"
This does not work on the Efika MX Smartbook which uses SPI
to connect the MC13892. Needs some rework.

This reverts commit 746a5530be.
2015-10-05 09:47:37 +02:00
Vicente Bergas e89f1a1f18 detect_fs: use device instead of file
detect_fs would usually mount a device on a directory,
so, use a device-specific type detection.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-02 09:10:16 +02:00
Peter Mamonov 8165f3131c common: clock: introduce mdelay_non_interruptible()
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-02 07:50:51 +02:00
Eric Bénard 39b0eb3b84 chipidea-imx: allow phymode configuration in pdata
it's currently only handled through DT and for i.MX25 OTG port (at least),
we need to configure portsc to get host mode working but it actually fails
as ci->phymode is 0 which is USBPHY_INTERFACE_MODE_UNKNOWN

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-29 08:47:25 +02:00
Sascha Hauer 7e44c8495a introduce strerrorp
putting an error pointer into strerror can be a bit confusing since
strerror takes a positive error code but PTR_ERR returns a negative
number, so we have to do strerror(-PTR_ERR(errp)). Some places got
this wrong already, so introduce a strerrorp function which directly
takes an error pointer.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-23 17:12:44 +02:00
Sascha Hauer 9d54b6f6b6 clock: remove duplicate xdelay declarations
ndelay is declared in include/clock.h, udelay in include/common.h and
mdelay in include/common.h and include/clock.h. Move them all to
include/clock.h and remove duplicates.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-23 15:13:11 +02:00
Enrico Jorns 61720f7bd4 mtd nand: added 'bits_per_cell' property
This one is available in the kernel and used by the denali driver

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-23 10:33:23 +02:00
Markus Pargmann d27cddcc3a usb: chipidea: Add udc unregister for device removal
The host may assume that the usb device is still up and running after
booting if we do not deregister the udc here. I observed issues when the
linux kernel was using a usb gadget directly where the complete USB Hub
got disconnected through this.

This patch adds a proper USB disconnect for gadget devices.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-23 10:31:33 +02:00
Antony Pavlov d3b39aeffd endian: sync {big,little}_endian.h with linux-4.2
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-10 09:13:24 +02:00
Daniel Schultz 572e8cdfa3 drivers: mci: Add mci_get_device_by_name function
Get a 'struct mci' by search after the device name.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-04 08:59:42 +02:00
Daniel Schultz 1f76dfce39 include: mci: Add new ext. CSD field defines
Added missing defines for the extended CSD register until standard 5.1.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-04 08:21:44 +02:00
Daniel Schultz 4c100aae04 drivers: mci: Make two functions public
There is no possibility to read/write to the extended CSD register of
MMC devices from a command. To avoid duplicated driver code, two driver
functions have to be public.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-04 08:21:44 +02:00
Lucas Stach 200ba6cdee reset-source: add stub for of_get_reset_source_priority
Allow drivers to build even if reset source support isn't built in.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-04 08:02:18 +02:00
Lucas Stach e38c778b9a wd: add stub for of_get_watchdog_priority
Allow drivers to build even if WD core isn't enabled.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-04 08:02:18 +02:00
David S. Miller d192ebe8bb endian: Always evaluate arguments
This patch is based on

    commit 3d6f4a20cc287a8980c6186624834cf10a70752b
    Author: David Miller <davem@davemloft.net>
    Date:   Thu Jul 24 23:38:31 2008 -0700

        endian: Always evaluate arguments.

In barebox.git/drivers/usb/core/usb.c,
function usb_parse_config() we have had

    le16_to_cpus(&(dev->config.wTotalLength));

which evaluates to "do { } while (0)" on little endian,
so struct usb_configuration field misuse will never
be discovered on little endian.

Therefore, always evaluate the arguments to nop endian
transformation operations.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-02 07:53:02 +02:00
Sascha Hauer 67e0a30e77 Merge branch 'for-next/restart' 2015-09-01 09:43:55 +02:00
Sascha Hauer b7ab2081b1 Merge branch 'for-next/param' 2015-09-01 09:43:55 +02:00
Sascha Hauer e582374ce3 Merge branch 'for-next/of_path' 2015-09-01 09:43:54 +02:00
Sascha Hauer 60fc3e99b5 Merge branch 'for-next/mtd' 2015-09-01 09:43:54 +02:00
Sascha Hauer 69dccb494a Merge branch 'for-next/misc' 2015-09-01 09:43:54 +02:00
Sascha Hauer 049fb66d21 Merge branch 'for-next/login' 2015-09-01 09:43:54 +02:00
Sascha Hauer fae6eea0e6 Merge branch 'for-next/gpio' 2015-09-01 09:43:53 +02:00
Sascha Hauer f387bc96bb Merge branch 'for-next/fb-imx-ipu-v3' 2015-09-01 09:43:53 +02:00
Sascha Hauer 3f68a7698d cdev: Add function to find cdev by device_node
This adds a device_node member to struct cdev and a function
to find a cdev by device_node.
This also removes the setting of cdev->dev->device_node in
the of partition parser. We must not set the device since it
may not refer to a partition but to a whole device with partitions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-01 07:43:16 +02:00
Sascha Hauer 746a5530be spi: i.MX: optimize transfers for ECSPI v2.3
Instead of writing one word to the txfifo and then wait until
one is received in the rxfifo we can write until the txfifos
are not full and read as long the rxfifos contain data. This
makes transfers for the m25p80 driver around 7 times faster
here.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-31 17:12:38 +02:00
Sascha Hauer cd4df8f82b spi: i.MX: use start mode control bit
The i.MX SPI controller in version 2.3 can immediately start a transfer
when the txfifo is written to. In this mode we no longer have to trigger
the transfer with the xch bit which makes the code a bit simpler.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-31 17:12:28 +02:00
Sascha Hauer aba382e7af watchdog: Fix static inline ops
...by actually making them static inline.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-28 12:04:40 +02:00
Sascha Hauer 40596b856f login: cleanup password code
- make some locally used functions static
- remove read_passwd which is unused
- some refactoring to make code pathes clearer

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-28 08:00:30 +02:00
Sascha Hauer 90e766a78f login: rework login mechanism
We used to have the login functionality in the /env/bin/init script.
This is hard to review and it's too easy to break the login functionality
with changes to this script. Move the places to ask for a password to
C code where we have only a few places where we have to ask for a password.
Mainly these are run_shell() and the menutree command.

This patch introduces a login() function which will only return if the correct
password has been entered. Following calls will return immediately without
asking for a password again.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-28 08:00:27 +02:00
Sascha Hauer 4a7534bf07 reset-source: Allow different priorities
Different devices may report the reset source with different levels
of certainty. For example a SoC may see a power-on reset, but this
may only be because an external PMIC has power cycled the SoC. This
means the PMIC knows the real reason better and thus the reset reason
from the PMIC should be preferred.

This patch introduces priorities for the reset_source to handle the
above scenario. Also add a of_get_reset_source_priority() function
to retrieve the desired priority from the device tree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-28 07:18:14 +02:00
Sascha Hauer 62fe28cf0b watchdog: Give watchdogs a name
This adds a dev and name member to struct watchdog which helps distinguishing
between different watchdogs. Also add some debugging aids.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-27 21:37:07 +02:00
Sascha Hauer 8f4cf30903 watchdog: Allow multiple watchdogs
Put watchdogs on a list to allow multiple watchdogs. Add a priority
field to be able to pick the highest priority watchdog.
This patch also provides a of_get_watchdog_priority() function to
allow configuring the watchdog priority from the device tree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-27 21:37:06 +02:00
Sascha Hauer 83b0a5ae05 restart: replace reset_cpu with registered restart handlers
This replaces the reset_cpu() function which every SoC or board must
provide with registered handlers. This makes it possible to have multiple
reset functions for boards which have multiple ways to reset the machine.
Also boards which have no way at all to reset the machine no longer
have to provide a dummy reset_cpu() function.

The problem this solves is that some machines have external PMICs or
similar to reset the system which have to be preferred over the
internal SoC reset, because the PMIC can reset not only the SoC but also
the external devices.

To pick the right way to reset a machine each handler has a priority. The
default priority is 100 and all currently existing restart handlers are
registered with this priority. of_get_restart_priority() allows to retrieve
the priority from the device tree which makes it possible for boards to
give certain restart handlers a higher priority in order to use this one
instead of the default one.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-27 21:37:03 +02:00
Sascha Hauer 3e1adbf832 mtd: m25p80: make it possible to use large blocks if desired
Some SPI NOR flashes support 4K erase blocks. 4K erase blocks do not
work with UBIFS which needs a minimum erase block size of 15360 bytes.
Also bigger sectors are faster to erase. This patch adds a device tree
option to use the bigger blocks instead of the default 4K blocks.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2015-08-26 15:14:00 +02:00
Sascha Hauer 546c5a9c78 param_enum: Make name strings const
Not only the array containing the pointers should be const but
also the strings themselves, so instead of using const char **
use const char * const *.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-26 12:52:12 +02:00
Sascha Hauer cabfe34ca7 gui: implement blitting screen areas
So far we only supported blitting the whole screen from the shadow
fb to the framebuffer. Add a function to blit areas.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 12:57:08 +02:00
Sascha Hauer 7c5937d245 gui: Use fb provided shadowfb for offscreen rendering
The fb core now has builtin support for offscreen rendering, use
this and drop offscreen handling in the gui code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 12:57:08 +02:00
Sascha Hauer 6f96499064 fb: Add shadowfb support
For speeding up rendering we need shadow framebuffers. This is currently
implemented in the gui functions. This does not work properly when two
users (splash and fbconsole) use the same framebuffer since in this case
two different shadow framebuffers will be used. This patch implements
shadowfb handling in the fb core directly. With this the fb device gets
a parameter 'shadowfb'. When this is true the fb core will allocate a
shadow fb and provide it to the users.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 12:57:07 +02:00
Jan Luebbe e1944fb6b2 i2c: add bus recovery infrastructure
This is based on the code introduced to the kernel in
5f9296ba21b3c395e53dd84e7ff9578f97f24295.

Signed-off-by: Jan Luebbe <jluebbe@debian.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 07:47:14 +02:00
Sascha Hauer 0d14bc0ec4 gpio: Drop asm-generic/gpio.h
Since we no longer have custom gpio function prototypes we can
drop the prototypes from asm-generic/gpio.h can add them to
include/gpio.h instead. While at it add static inline dummy wrappers
for !CONFIG_GENERIC_GPIO so that code using gpios can compile without
gpio support.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 07:47:11 +02:00
Lucas Stach 4cf3e91aca video: backlight: add fallbacks for client functions
Add empty static inline function fallbacks if backlight support
is not enabled, so that drivers using the backlight don't fail to
build.

Fixes:
In function `simple_panel_ioctl':
undefined reference to `of_backlight_find'
undefined reference to `backlight_set_brightness_default'
undefined reference to `backlight_set_brightness'

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 16:12:51 +02:00
Sascha Hauer 3c76d02aeb implement dma_alloc_writecombine
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-07 15:42:55 +02:00
Sascha Hauer 98b5672c4d Merge branch 'for-next/vpl' 2015-08-07 07:55:00 +02:00
Sascha Hauer 0c5c47b511 Merge branch 'for-next/vincell' 2015-08-07 07:54:46 +02:00
Sascha Hauer 19afbd285e Merge branch 'for-next/video' 2015-08-06 12:33:26 +02:00
Sascha Hauer fd58dc84cb Merge branch 'for-next/spd' 2015-08-06 12:33:24 +02:00
Sascha Hauer e188d2ec26 Merge branch 'for-next/net' 2015-08-06 12:33:15 +02:00
Sascha Hauer 4ee01d2b46 Merge branch 'for-next/misc' 2015-08-06 12:33:15 +02:00
Sascha Hauer a8525f691d Merge branch 'for-next/imx' 2015-08-06 12:33:06 +02:00
Sascha Hauer 3c92473a9e Merge branch 'for-next/fbcon' 2015-08-06 12:33:06 +02:00
Sascha Hauer ebd6f26412 Merge branch 'for-next/exitcall' 2015-08-06 12:33:06 +02:00
Sascha Hauer 8d48e07c4d ARM: i.MX: make early UART functions independent of DEBUG_LL
We have functions to setup the i.MX uart for early use, but these all
depend on DEBUG_LL. Move them to imx-uart.h to make them usable for
the regular PBL console.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-31 08:49:43 +02:00
Sascha Hauer ca8a4b0ff5 PBL: console: Make independent of DEBUG_LL
With more stuff being done in PBL regular console support gets more and more
useful. This makes the PBL console independent of DEBUG_LL which is only
meant for early debugging but not regular output.
To use the regular PBL console a board must call pbl_set_putc() which stores
a pointer to the putc function to be used.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-31 08:49:42 +02:00
Sascha Hauer ab8e23f239 net: phy: at803x: Use genphy_config_init
Based on the Linux commit:

6ff01db net: phy: at803x: use genphy_config_init()

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-29 17:17:01 +02:00
Sascha Hauer b20f5632aa Limit data_abort_mask to !PBL
To make memory_display usable in PBL

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-29 10:22:05 +02:00
Michael Olbrich c95b1c2bf2 efi: use an EFI variable to save the environment
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-27 07:23:20 +02:00
Michael Olbrich 21a83053ab efi: write volatile EFI variables used by systemd
LoaderTimeInitUSec and LoaderTimeExecUSec are used e.g. in systemd-analyze
to calculate the time spent in the firmare and barebox.

LoaderDevicePartUUID is used to mount the EFI partition to /boot.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-27 07:23:18 +02:00
Michael Olbrich 4faf797ec8 efi: export device_path_from_handle()
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-27 07:23:17 +02:00
Michael Olbrich be2edd99c0 efi: add helper to get the GPT partition UUID for a device
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-27 07:23:17 +02:00
Michael Olbrich 55da0cf13e efi: add support for initrd loading
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-23 20:31:44 +02:00
Michael Olbrich 17e6044074 xfuncs: add wrapper for wchar strdup functions
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-23 16:46:14 +02:00
Michael Olbrich 773be2a168 xfuncs: add xasprintf() and xvasprintf()
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-23 16:46:14 +02:00
Sascha Hauer efeeea3501 drop <stddef.h> includes
The compilers stddef.h should not be included. We declare all types
ourselves.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-23 16:46:04 +02:00
Antony Pavlov 64fabf9fca net_udp_bind(): use uint16_t type for source port
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-20 07:46:54 +02:00
Antony Pavlov 27f79c05ab video: implement framebuffer console
This patch realizes framebuffer console support for barebox. It
supports colors and enough escape sequences to show the barebox
console and editor properly.

fbconsole mini-HOWTO
====================

1. compile sandbox barebox with

    CONFIG_VIDEO=y
    CONFIG_FRAMEBUFFER_CONSOLE=y
    CONFIG_DRIVER_VIDEO_SDL=y

2. run barebox

3. test fbconsole

    fbconsole0.active=oe

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-20 07:11:21 +02:00
Sascha Hauer cfec57d898 graphics_utils: Let fb_open allocate the screen
Allocate the screen dynamically in fb_open. This opens the way to create
a fb_create_screen function which takes a struct fb_info * instead of a
filename. This is suitable for the framebuffer console which already has
a struct fb_info *.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-20 07:11:21 +02:00
Sascha Hauer 8a4be80936 fb: Add fb_enable/disable functions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-20 07:11:21 +02:00
Sascha Hauer dd09054276 fonts: Add 7x14 font
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-20 07:11:21 +02:00
Sascha Hauer 4d6665c33a spi: i.MX: move register defines to include/
The register defines will be used by the SPI xload code, so move
them to a place where the xload code can include them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-16 09:46:02 +02:00
Antony Pavlov b6b96ee6fd lib/fonts: add "MINI4x6" font
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-16 09:17:17 +02:00
Antony Pavlov e5138e2d3e import lib/fonts framework from linux kernel
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-16 09:17:17 +02:00
Sascha Hauer 322d8a509e graphics_utils: add function to create pixel from rgb triplet
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-16 09:17:17 +02:00
Sascha Hauer 3ea4dee7fd graphics_utils: Export get_pixel
get_pixel converts a 32bit trgb color into framebuffer format. This
is useful for other code aswell, so export it.
Other functions in the graphics utils code use the name get/set_pixel
aswell, but instead of converting data they get a pixel from the framebuffer
or set a pixel on the framebuffer. To separate from these rename the
function to gu_hex_to_pixel.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-16 09:13:04 +02:00
Sascha Hauer 976ad2aea2 graphics_utils: Add function to invert an area
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-16 09:03:05 +02:00
Sascha Hauer 4dfa261dcf regulator: Add support for regulator-boot-on device tree property
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-15 07:52:25 +02:00
Sascha Hauer ea532ddb86 gui: Fix typo in function name
It's a render buffer, not a redering buffer.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-15 07:25:01 +02:00
Sascha Hauer 592ae690f5 graphic_utils: Add a common namespace to functions
This adds a common namespace to the graphic functions. We use
gu_ for graphic_utils.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-15 07:25:00 +02:00
Alexander Smirnov f75fe31095 ddr_spd: add routine for printing DDR2 SPD contents in human-readable format
---=== SPD EEPROM Information ===---
EEPROM Checksum of bytes 0-62                    OK (0xDF)
Total number of bytes in EEPROM                  256
Fundamental Memory type                          DDR2 SDRAM
SPD Revision                                     1.2

---=== Memory Characteristics ===---
Maximum module speed                             800 MHz (PC2-6400)
Size                                             2048 MB
Banks x Rows x Columns x Bits                    8 x 14 x 10 x 64
Ranks                                            2
SDRAM Device Width                               8 bits
Module Height                                    30.0 mm
Module Type                                      SO-DIMM (67.6 mm)
DRAM Package                                     Planar
Voltage Interface Level                          SSTL 1.8V
Module Configuration Type                        No Parity
Refresh Rate                                     Reduced (7.8 us) - Self Refresh
Supported Burst Lengths                          4, 8
Supported CAS Latencies (tCL)                    6T
tCL-tRCD-tRP-tRAS                                6-6-6-18 as DDR2-800
Minimum Cycle Time                               2.5 ns at CAS 6
Maximum Access Time                              0.40 ns at CAS 6
Maximum Cycle Time (tCK max)                     8 ns

---=== Timing Parameters ===---
Address/Command Setup Time Before Clock (tIS)    0.17 ns
Address/Command Hold Time After Clock (tIH)      0.25 ns
Data Input Setup Time Before Strobe (tDS)        0.05 ns
Data Input Hold Time After Strobe (tDH)          0.12 ns
Minimum Row Precharge Delay (tRP)                15.00 ns
Minimum Row Active to Row Active Delay (tRRD)    7.50 ns
Minimum RAS# to CAS# Delay (tRCD)                15.00 ns
Minimum RAS# Pulse Width (tRAS)                  45.00 ns
Write Recovery Time (tWR)                        15.00 ns
Minimum Write to Read CMD Delay (tWTR)           7.50 ns
Minimum Read to Pre-charge CMD Delay (tRTP)      7.50 ns
Minimum Active to Auto-refresh Delay (tRC)       60.00 ns
Minimum Recovery Delay (tRFC)                    127 ns
Maximum DQS to DQ Skew (tDQSQ)                   0.20 ns
Maximum Read Data Hold Skew (tQHS)               0.30 ns

---=== Manufacturing Information ===---
Manufacturer JEDEC ID                            7f 98 00 00 00 00 00 00
Manufacturing Location Code                      0x05
Part Number
Manufacturing Date                               2014-W47
Assembly Serial Number                           0x43266892

Signed-off-by: Alexander Smirnov <alllecs@yandex.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-14 07:09:19 +02:00
Sascha Hauer 75782f365c video: Add missing prototype for display_timings_release
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-13 08:38:19 +02:00
Sascha Hauer 70007036a5 video: Add Video Pipeline (VPL) support
Complex video pipelines are modelled with the of_graph bindings in
the devicetree. This patch adds a ioctl infrastructure to issue
commands to the remote endpoint of a of_graph. Currently defined
ioctls are prepare/unprepare, enable/disable and get_modes. This
is enough to control LVDS or HDMI encoder or simple panels.

A device node which contains of_graph endpoints can be registered
as a VPL entity. An entity can receive ioctls via the .ioctl callback
and also issue ioctls by calling vpl_ioctl. The core itself will never
iterate over the entire pipeline. Instead, the different VPL entities
should forward an ioctl to the next instance in the pipeline whenever
necessary.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-13 08:38:19 +02:00
Sascha Hauer 6913850321 of_graph: add of_graph_port_is_available
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-13 08:38:18 +02:00
Sascha Hauer cc44a37924 of: import of_graph functions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-13 08:38:18 +02:00
Sascha Hauer d96f74f26f of: base: implement of_get_next_child
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-13 08:38:18 +02:00
Herve Codina 0fd5944d52 exitcall: move board_shutdown to exitcall infrastructure
Signed-off-by: Herve Codina <Herve.CODINA@celad.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-13 08:28:19 +02:00
Herve Codina 74438aa4dc exitcall: move arch_shutdown to exitcall infrastructure
Signed-off-by: Herve Codina <Herve.CODINA@celad.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-13 08:28:19 +02:00
Herve Codina a59a48b684 exitcall: move device_shutdown to exitcall infrastructure
Signed-off-by: Herve Codina <Herve.CODINA@celad.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-13 08:28:19 +02:00
Herve Codina a2136e6cbd exitcall: Add exitcall infrastructure
exitcall infrastructure is based on initcall infrastructure.
It allows to have and use exit call hooks on barebox shutdown.

Signed-off-by: Herve Codina <Herve.CODINA@celad.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-13 08:28:19 +02:00
Alexey Galakhov d370efef5b build: update compiler*.h to newest versions
This adds the support for gcc 5.x and clang.

Signed-off-by: Alexey Galakhov <agalakhov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-06 13:42:24 +02:00
Sascha Hauer d297851b1a Merge branch 'for-next/blspec' 2015-07-06 12:43:29 +02:00
Sascha Hauer 2f5f0d6aa1 video: Add generic fixup handler to reserve fb memory
When a framebuffer is kept enabled when Linux starts its framebuffer
memory should be reserved. Otherwise Linux may overwrite its contents.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-06 12:34:23 +02:00
Sascha Hauer 735c570e5a Merge branch 'for-next/state' 2015-07-03 08:38:20 +02:00
Sascha Hauer f037355761 Merge branch 'for-next/pwm' 2015-07-03 08:38:20 +02:00
Sascha Hauer 18ea2863bf Merge branch 'for-next/omap'
Conflicts:
	arch/arm/boards/beagle/board.c
2015-07-03 08:38:17 +02:00
Sascha Hauer f2a2894c27 Merge branch 'for-next/misc' 2015-07-03 08:37:40 +02:00
Sascha Hauer c5438404db Merge branch 'for-next/imx-bbu-nand-fcb'
Conflicts:
	common/Kconfig
2015-07-03 08:37:36 +02:00
Sascha Hauer 021dda6744 Merge branch 'for-next/cfi-flash' 2015-07-03 08:37:29 +02:00
Sascha Hauer 907418af60 Merge branch 'for-next/blspec' 2015-07-03 08:37:29 +02:00
Sascha Hauer 7f1195c63d treewide: replace __inline__ with inline
inline is preferred over __inline__

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-02 09:39:58 +02:00
Sascha Hauer 08120e2166 of: export of_platform_device_create
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-02 08:23:29 +02:00
Sascha Hauer 74ac4489cf bbu: Add a standard file-to-device-copy handler
The most standard update handler will simply copy a file to a device.
This can be shared across several users, so add a standard handler for
this operation.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-01 09:04:22 +02:00
Sascha Hauer 5f11e80670 mtd: Make devname argument to add_mtd_device const
add_mtd_device duplicates the string where necessary, so make it
const.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-29 07:04:55 +02:00
Sascha Hauer d00db5548a net: eth: Do not rely on CONFIG_PARAMETER to be enabled
register_preset_mac_address only works when CONFIG_PARAMETER
is enabled because otherwise dev_set_param is a no-op. Add a
function to set the MAC address explicitly without the need
of CONFIG_PARAMETER and use it where appropriate.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-26 11:56:22 +02:00
Sascha Hauer 1dd5262eb9 net: Make set_ethaddr argument const
The set_ethaddr callback should not modify the MAC address passed to it, so
make it const.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-26 11:56:22 +02:00
Sascha Hauer ce72d46f42 mtd: Add mtd concat support
The mtd concat layer supports concatenating several MTD devices
into a single one. This is nearly as-is from the corresponding
Kernel code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-23 16:59:54 +02:00
Marc Kleine-Budde daeb9d8d76 xfuncs: import xstrndup() from busybox
This function is needed for the fixed length string feature in the state
framework.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-18 10:58:58 +02:00
Sascha Hauer 745594d51a fs: ubifs: Implement Linux rootarg
Add the parameter to boot from ubifs fileystems. This assumes that
there will be only one UBI device registered in the kernel, otherwise
there is no way to predict the ubi number.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-18 09:01:01 +02:00
Sascha Hauer e9db2079a5 fs: Add device parameter for Linux root= option
When registering a filesystem device add a device parameter suitable
for the Linux root= option to boot from exactly this filesystem. Currently
the fs layer sets this parameter to the root=PARTUUID= mechanism if a
partuuid is available. Other filesystems like NFS and UBIFS which do
not have a PARTUUID can overwrite this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-18 09:01:01 +02:00
Sascha Hauer bc31d85c6e cdev: Add partuuid string to struct cdev
This adds the partuuid string to struct cdev in order to have this
available for constructing a suitable Linux root=PARTUUID= option
for booting Linux.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-18 09:01:01 +02:00
Sascha Hauer acc930f1e9 Add globalvar_add_simple_string function
This adds a globalvar string function to pass a pointer to a string.
With this we can directly access the string to get the variable and
don't have to getenv() the string first.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-18 09:01:01 +02:00
Sascha Hauer cc3927d20a blspec: Add missing prototype for blspec_scan_device
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-17 11:39:46 +02:00
Marc Kleine-Budde 690ee0ee2b crypto: digest: provide static inline no-ops if digest is disabled
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-17 07:58:10 +02:00
Sascha Hauer 605621a3c8 PWM: Allow multiple PWMs per device node
Matching a device node is enough since a device node may have
multiple PWMs. Check for a id aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-12 12:00:41 +02:00
Sascha Hauer e3ea90860e video: Add backlight support
This adds a small backlight layer. It provides a backlight device
on which the brightness parameter can be used to adjust the brightness.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-12 11:52:58 +02:00
Sascha Hauer 22f8077c39 imx-bbu-nand-fcb: make available for i.MX28 aswell
The code can be used with slight modifications on i.MX28 aswell.
Add a i.MX28 registration function and move the differences to
function callbacks.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-12 08:28:26 +02:00
Sascha Hauer a10366acd8 ARM: i.MX6: bbu nand: Move to common place
The code can be used on i.MX28 aswell, so move it to a common place.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-12 08:28:04 +02:00
Sascha Hauer e7b23c6a9d filetype: Add filetype for MXS bootstream
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-12 08:28:04 +02:00
Sascha Hauer dae7498d2c clk: of: fix clk_of_table generation
We used to collect all sections beginning with __clk_of_table_ in a single
section in the linker using KEEP(*(.__clk_of_table_*)). That the sentinel
entry ended up as the last entry was pure luck, but not always the case.

Instead of putting all entries in different sections we now put all entries
in the same section. Only the sentinel entry gets its own section and is
collected by the linker separately.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Andreas Willig <andreas.willig@rafi.de>
Tested-by:  Andreas Willig <andreas.willig@rafi.de>
2015-06-11 07:46:36 +02:00
Sascha Hauer e349701487 Merge branch 'for-next/state' 2015-06-09 09:26:44 +02:00
Sascha Hauer 3a32e7acd4 Merge branch 'for-next/spi-nor' 2015-06-09 09:26:44 +02:00
Sascha Hauer 03510ac4fa Merge branch 'for-next/posix_types' 2015-06-09 09:26:44 +02:00