9
0
Fork 0
Commit Graph

13593 Commits

Author SHA1 Message Date
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
Christian Hemp d9f08b058b ARM: pfla02: Add module revison detection
The pin SD4_DAT4 until SD4_DAT7 are used as revison control.
The pins will be internally pulled up so we read a 1111 for revison 1.
For revison two the first pin (bit) is pulled down (see schematic pfla-02
page 4 "SDIO, NAND-Flash".
On Module rev 1 the pins are connected to the NAND but we have only 8bit NAND
also the i.MX6 only can handle 8bit NAND flashs.

Revisions:
	Rev 1:  0xF
	Rev 2:  0xE
		.
		.
		.
	Rev 15: 0x1
	Rev 16: 0x0

Signed-off-by: Christian Hemp <c.hemp@phytec.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-26 14:43:14 +02:00
Kuo-Jung Su 75ab53df5f usb: ehci: prevent bad PORTSC register access
1. The 'index' of ehci_submit_root() is not always > 0.

   e.g.
   While it gets invoked from usb_get_descriptor(),
   the 'index' is always a '0'. (See ch.9 of USB2.0)

2. The PORTSC register is not always required, and thus it
   should only report a port error when necessary.
   It would cause a port scan failure if the ehci_submit_root()
   always gets terminated by a port error.

Signed-off-by: Kuo-Jung Su <dantesu@faraday-tech.com>
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-26 14:19:33 +02:00
Kuo-Jung Su 484a1fb568 usb: ehci: replace multiple use of le16_to_cpu(req->index) with variable
This is part of U-Boot commit:

7d9aa8f usb: Add new command to set USB 2.0 port test modes

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-26 14:16:37 +02:00
Peter Mamonov 9a146aea92 usb: ehci-hcd: initialize ehci->qh_list[] with zeros
Without this initialization ehci->qh_list[0].qh_endpt2 is left uninitialized,
which causes problems with some EHCI host controllers.

Das u-boot uses the same strategy:

	static int ehci_common_init(struct ehci_ctrl *ctrl, uint tweaks)
	{
		...
		qh_list = &ctrl->qh_list;

		/* Set head of reclaim list */
		memset(qh_list, 0, sizeof(*qh_list));
		qh_list->qh_link = cpu_to_hc32((unsigned long)qh_list | QH_LINK_TYPE_QH);
		qh_list->qh_endpt1 = cpu_to_hc32(QH_ENDPT1_H(1) |
							QH_ENDPT1_EPS(USB_SPEED_HIGH));
		qh_list->qh_overlay.qt_next = cpu_to_hc32(QT_NEXT_TERMINATE);
		qh_list->qh_overlay.qt_altnext = cpu_to_hc32(QT_NEXT_TERMINATE);
		qh_list->qh_overlay.qt_token =
				cpu_to_hc32(QT_TOKEN_STATUS(QT_TOKEN_STATUS_HALTED));
		...
	}

Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-26 14:14:54 +02:00
Sascha Hauer 167e93947e watchdog: imxwd: remove remove callback
The imxwd is for resetting the system, so we should not unregister it
during shutdown_barebox() as it may leave us without a restart handler.
Only a bug (not setting reset_wd to NULL in remove()) made the whole
thing work.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-26 12:54:32 +02:00
Lucas Stach a3bb6eacbe ARM: socfpga: select OFTREE and OFDEVICE
SoCFPGA is completely multi-image enabled and probes the barebox
from a built-in DT, so there is no point in building a barebox
image that isn't able to probe from DT.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-26 12:52:49 +02:00
Sascha Hauer c170240d3e param_enum: protect against invalid values
Since dev_add_param_enum is passed a pointer containing the actual value
it can contain an invalid value. Protect against it so that we do not
access invalid array elements.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-26 12:52:19 +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 4ff31c9e04 serial: ns16550: Set linux_console_name
The regular ns16450/ns16550 devices get the console name "ttyS" under
Linux. Add this to the driver data.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-26 11:05:03 +02:00
Sascha Hauer 8a6bd111d9 ARM: socfpga: Configure console from device tree
Add the missing stdout-path properties for the socfpga boards and
enable CONFIG_CONSOLE_ACTIVATE_NONE.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-26 11:04:45 +02:00