9
0
Fork 0
Commit Graph

13603 Commits

Author SHA1 Message Date
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
Lucas Stach 6e5b9b5ffd mfd: da9053: remove references to nonexistent cdev member
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
Peter Mamonov 2b016bf078 ata: ide-sff: fix integer overflow in ata_wait_ready()
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-04 07:38:57 +02:00
Lucas Stach eb1f1a1a24 video: imx-hdmi: depend on EDID support
HDMI support is not generally useful without EDID support.

Fixes:
In function `imx_hdmi_ioctl':
undefined reference to `edid_read_i2c'
undefined reference to `edid_to_display_timings'

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-04 07:37:06 +02:00
Lucas Stach a71937a470 video: vpl: depend on OFTREE
VPL uses the of_graph bindings, which are only available if OFTREE
support is compiled in.

Also fix the drivers using VPL to depend on OFTREE.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-04 07:37:06 +02:00
Antony Pavlov 1734538494 mtd: spi-nor: add Spansion S25FL204K support
Spansion S25FL204K is a 4-Mbit 3.0V Serial Flash Memory
with Uniform 4 kB Sectors.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Acked-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-02 07:54:26 +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
Antony Pavlov eeab50e961 usb: ehci: fix include/usb/usb.h:'struct usb_configuration' misuse
See the commit

    commit 245069bcef
    Author: Sascha Hauer <s.hauer@pengutronix.de>
    Date:   Thu Jul 10 11:36:12 2014 +0200

        USB: introduce usb_interface/usb_configuration structs

On little endian systems like ARM the le16_to_cpus() macro
is a no op, defined as:

    #define le16_to_cpus __le16_to_cpus
    #define __le16_to_cpus(x) do {} while (0)

So struct usb_configuration field misuse was discovered
on big-endian MIPS machine.

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 069031f8ce Merge branch 'for-next/usb' 2015-09-01 09:43:55 +02:00
Sascha Hauer f4f0bc9091 Merge branch 'for-next/socfpga' 2015-09-01 09:43:55 +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 feeb128788 Merge branch 'for-next/imx' 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 b6b7203aca Merge branch 'for-next/fb' 2015-09-01 09:43:53 +02:00
Sascha Hauer 2df4ac1f8d Merge branch 'for-next/arm-l2x0' 2015-09-01 09:43:53 +02:00
Sascha Hauer 60e8d75715 Release v2015.09.0
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-01 09:17:52 +02:00
Sascha Hauer 2b53005fe1 ARM: do not ignore data aborts initially
arm_ignore_data_abort can be set to nonzero to ignore data aborts. The
default should be not to ignore data aborts. Fix this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-01 09:12:03 +02:00
Sascha Hauer 1a17643433 ARM: dts: directly point to partitions in the barebox,environment binding
We can now directly point to the partitions in the barebox,environment
binding. Convert some boards over to it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-01 08:14:29 +02:00
Sascha Hauer 35eb06510b of_path: Allow pointing directly to the partition
We could only point to partitions in the device tree by using
&norflash, "partname:barebox-environment". Allow to point to the
partition directly without having to parse the partition labels.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-01 08:07:04 +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 ff5660c2bb spi: i.MX: create SoC specific transfer functions
There are SoC specific ways to optimize transfers. Make the way free
to implement these by creating SoC specific transfer functions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-31 17:12:33 +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 dfd536eb32 commands: ubiformat: Document -y option
This was missing in the help text.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-28 12:04:41 +02:00
Sascha Hauer fe36276112 boot command: Allow to enable watchdog
Enabling the watchdog before booting the kernel is a common usecase.
Add an option to the boot command and also add a global variable for
it to make it configurable easily.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-28 12:04:41 +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 311f02fbe4 mtd: spi-nor: mostly drop lock/unlock code
The lock/unlock code is broken beyond repair.

First of all the algorithm doesn't work properly. SPI NOR flashes
can only protect a certain amount of blocks from the end of the device
which is incompatible to the protect(start,len) API we have. The
algorithm tries to be clever by doing protection only when it does
not protect unrelated blocks and unprotection only when it does not
unprotect unrelated blocks. This breaks for example when some code
protects the last blocks (which may contain the bootloader), then
protects the blocks before the last ones (which may contain the
environment). Then if we try to overwrite the bootloader this won't
work since it would unprotect the environment aswell, so the driver
will not unprotect anything resulting in a failed erase/write later.

Then the protection behaviour is different between different flashes.
Some have three protection bits, some have four. For some the smallest
protection are is 1/16 of the device, others have 1/256 or 1/64. Some
have a bit which selects the lower area instead of upper area for
protection. The position of this bit differs on different flashes.

This patch removes the lock code completely and always unprotects
the whole device. This way we can unprotect a device for writing to
it and never protect it again.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-28 11:11:46 +02:00
Lucas Stach 89ca3fcaad ARM: imx53: vincell: guard board initcall
Make sure that the initcall only executes on the expected board.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-28 08:59:22 +02:00
Sascha Hauer ce36b4a05e reset-source: Add some debugging aids
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-28 08:35:51 +02:00
Juergen Borleis 87af8d8dd4 mfd: da9053: add da9053 watchdog and system restart driver
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-28 08:35:51 +02:00
Philipp Zabel 96786e4dad mfd: da9063: add da9063 watchdog and system restart driver
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2015-08-28 08:35:51 +02:00
Sascha Hauer 460cc82191 login: explain PASSWORD_DEFAULT option
This option looks like it takes the default password, but instead
it takes a filename of a file which contains the password encoded
with the selected password digest.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-28 08:00:30 +02:00
Sascha Hauer 2b5bdb47cf crypto: fix selecting of digests
SHA1 is meant as a boolean option which is true when sha1 support is available.
This works because the providers (DIGEST_SHA1_GENERIC and DIGEST_SHA1_ARM) have
a 'select SHA1'. However, consumers like the sha1sum command do a 'select SHA1'
to enable SHA1 support. This of course does not work; selecting SHA1 will not
select any of the SHA1 providers.

This is broken for all digest consumers. We have to explicitly select a digest
provider, that is DIGEST_*_GENERIC to enable the corresponding digest.

This means now we will always have the generic digest in the binary, even
when an optimized one is enabled. There is no sane way in Kconfig to
"select provider for feature xy", so let's live with the overhead in the binary.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-28 08:00:30 +02:00
Sascha Hauer 3e361f3764 login: check return value of digest_alloc
digest_alloc can fail, check the return value.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-28 08:00:30 +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 ff2a4a0a13 reset-source: Use globalvar_add_simple_enum
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-27 21:37:07 +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
Philipp Zabel 2eb7fb71ae ARM: pfla02: Add notice about the used environment partition
Also, use the barebox partition on mmc2.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2015-08-26 14:45:37 +02:00