Commit graph

13505 commits

Author SHA1 Message Date
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
Sascha Hauer
f38ba32965 dhrystone: Fix documentation
BAREBOX_CMD_HELP_TEXT may not contain a linebreak.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 15:10:34 +02:00
Lucas Stach
2b7e24c1e9 video: fbcon: needs console support
Fixes:
In function `register_fbconsole':
drivers/video/fbconsole.c:425: undefined reference to `console_register

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 12:57:08 +02:00
Sascha Hauer
f84415497e fb: fbconsole: Add missing blits
When using offscreen rendering we need some more points where we
blit the offscreen buffer to the screen. Add them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 12:57:08 +02:00
Sascha Hauer
3b3d5f412d fb: fbconsole: print cursor after clearing the screen
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 12:57:08 +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
38a71cde8f splash command: simplify offscreen rendering
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
Sascha Hauer
eac28050d0 fb: return original fb_info in FBIOGET_SCREENINFO
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 12:57:07 +02:00
Sascha Hauer
5c12f6b9f1 video: fbconsole: do not enter when we are already in fbconsole
Make it possible to issue console messages from inside the fbconsole
code without entering the fbconsole again.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 12:57:07 +02:00
Sascha Hauer
960a6feb9a splash command: depend on CONFIG_VIDEO
The splash command only makes sense with framebuffer support enabled, so
add the corresponding dependency to Kconfig.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 12:57:07 +02:00
Jan Luebbe
ffcabbe125 i2c: gpio: add bus recovery support
Signed-off-by: Jan Luebbe <jluebbe@debian.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 07:47:15 +02:00
Jan Luebbe
4f32ba9fcb i2c: algo-bit: check if the bus is busy
If we have a timeout while waiting, try to recover.

Signed-off-by: Jan Luebbe <jluebbe@debian.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 07:47:15 +02:00
Jan Luebbe
abcbcfca3a i2c: algo-bit: fix debug code
Replace jiffies from kernel code with get_time_ns. The flags variable
used in the readbytes debug output does not exist.

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
Jan Luebbe
fab3dc2bfb i2c-omap: add bus recovery support
This is based on commit 9dcb0e7b999db6c420c70fd32497a979a044fcdf from
the kernel with some additional fixes.

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
Jan Luebbe
58fc376abf i2c-omap: clear ARDY twice
This implements the fix from the kernel commit
4cdbf7d346e7461c3b93a26707c852e2c9db3753.

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
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
Jan Luebbe
e87360ad05 at24: support write-protect GPIO
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
Robert Jarzmik
011b6bf8d5 ARM: pxa: zylonite: convert to generic default environment
Convert zylonite board to the generic environment, and make consistent
with lubbock and mainstone boards.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 16:47:35 +02:00
Alexander Shiyan
169e4bd9c5 mci: mmci: Fix status flags check
Data transfer procedures should check _DATA_ flags instead of _CMD_.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 16:46:57 +02:00
Robert Jarzmik
73deb9f992 mtd: nand: mrvl-nand: create initial empty bbt
When creating an initial bad blocks table, create it empty. This is
necessary because when the bad block table blocks are not
initialized (all ff) while some partitions are, all the blocks which
have an OOB data not beginning with 0xff 0xff will be marked as bad
blocks in the initial bad blocks scan.

As a consequence, any existing blocks are impossible to erase
anymore. Fix this by fixing the BBT creation flag.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 16:24:39 +02:00
Andrey Smirnov
1f6d1c0082 i2c-imx: Fix memory leak in i2c_fsl_probe()
All points of failure in the code of i2c_fsl_probe() happen after the
allocation of i2c_fsl, so all of them have to perform necessary
cleanup setups in case of failure.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 16:23:54 +02:00
Andrey Smirnov
c8a26925c9 lib: libfile: Do not ignore errors in close()
Some character devices may perform meaningful operations in their
implementation of close() -- a good example would be socfpga.c which
checks if the FPGA was programmed succesfully in it's close() method
-- so ignoring return value of this call may cause false positives in
checking exit status for success.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 16:23:54 +02:00
Fabio Estevam
81caed9cce spi-nor: Align spi_nor_ids[] with kernel 4.1
Sync the spi_nor_ids[] struct with the one from kernel 4.1.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 16:22:20 +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
Lucas Stach
c5bfe48df0 video: simple-panel: mode support depends on I2C and EDID
Reading modes from EDID EEPROMs requires both I2C and EDID support to
be available. As the simple panel driver is also useful without mode
reading support, only built it in if the requirements are met.

Fixes:
In function `simple_panel_get_modes':
simple-panel.c:88: undefined reference to `of_find_i2c_adapter_by_node'
simple-panel.c:91: undefined reference to `edid_read_i2c'
simple-panel.c:95: 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-08-19 16:12:12 +02:00
Lucas Stach
6962badee7 video: MTL017: depend on I2C
This driver uses I2C functions and isn't useful without them.

Fixes:
In function `mtl017_init':
drivers/video/mtl017.c:278: undefined reference to `i2c_bus'

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 16:11:35 +02:00
Steffen Trumtrar
6d5996d88d clk: socfpga: don't register fixed clocks
The fixed clocks are registered from devicetree. Therefore the code path is
not needed, but would instead register the clocks twice, which leads to the
error message:

	clk_register clk f2s_periph_ref_clk is already registered, skipping!
	of_clk_init: failed to init clock for /soc/clkmgr@ffd04000/clocks/f2s_periph_ref_clk: 1
	clk_register clk osc1 is already registered, skipping!
	of_clk_init: failed to init clock for /soc/clkmgr@ffd04000/clocks/osc1: 1

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 16:06:29 +02:00
Steffen Trumtrar
8891da2143 gpio: dw: implement new bindings
The gpio-driver was developed when the bindings where not stable.
As these have changed in the meantime, the driver has to be updated to
the status quo.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 15:56:29 +02:00
Steffen Trumtrar
1b07449805 gpio: dw: fix copy&paste variable name
This is a DW driver not IMX; fix variable name.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 15:56:29 +02:00
Steffen Trumtrar
c677a05b50 clk: socfpga: fix dt binding support
Change the set_parent/get_parent functions for clock-gates to work
with the Linux kernel DT bindings.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 15:56:29 +02:00
Steffen Trumtrar
8c2f1929c7 ARM: dts: remove most of socfpga barebox-specific dt code
Instead of using internal devicetree files, use the official ones from
/dts/src/arm.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 15:56:29 +02:00
Lucas Stach
32c5211ae8 ARM: imx6: select OFTREE
i.MX6 is fully DT enabled and the already selected
COMMON_CLK_OF_PROVIDER needs OFTREE support to build properly.

Fixes:
arch/arm/mach-imx/clk-imx6.c: In function 'imx6_ccm_probe':
arch/arm/mach-imx/clk-imx6.c:500:2: error:
    invalid use of undefined type 'struct clk_onecell_data'
arch/arm/mach-imx/clk-imx6.c:502:2: error:
    implicit declaration of function 'of_clk_add_provider'

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 15:52:03 +02:00
Lucas Stach
368b249043 video: ipu-fb: mark internally used functions as static
Fixes symbol clashes with the IPUv3 driver:
In function `ipu_ch_param_write_field':
drivers/video/imx-ipu-v3/ipu-common.c:103: multiple definition of `ipu_ch_param_write_field'
drivers/video/imx-ipu-fb.c:359: first defined here

In function `ipu_cpmem_set_format_rgb':
drivers/video/imx-ipu-v3/ipu-common.c:155: multiple definition of `ipu_cpmem_set_format_rgb'
drivers/video/imx-ipu-fb.c:504: first defined here

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 15:48:59 +02:00
Philipp Zabel
706503e774 ARM: pbab01: align with and include mainline DT
Align with the mainline device tree, include it,
and remove all unchanged nodes and properties.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 15:38:27 +02:00
Philipp Zabel
32a07fa9d1 ARM: pfla02: align with and include mainline DT
Align with the mainline device tree, include it,
and remove all unchanged nodes and properties.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-19 15:38:27 +02:00
Sascha Hauer
3a375c99af ARM: i.MX6: Enable l2 cache
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-08 16:45:29 +02:00