9
0
Fork 0
Commit Graph

2868 Commits

Author SHA1 Message Date
Lucas Stach b809c5b410 clk: tegra: consider new T30 clock registers
Tegra3 has some new clocks and resets. The new
registers don't form a linear range with the
old ones.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-23 11:39:57 +02:00
Lucas Stach f09394ab1a pinctrl: tegra: add Tegra3 driver
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-23 11:39:57 +02:00
Lucas Stach 47ed904495 mmc: tegra: fix typo
Missed OR, so we never enabled failure interrupt
status bits, which prevented the eMMC detect logic
to work properly.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-23 11:39:13 +02:00
Lucas Stach 914d128608 gpio: tegra: remove dead code
Tegra is DT only, so remove platform code.
While at it remove unused struct.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-23 11:39:13 +02:00
Owen Kirby 7311cc9bd2 Fix AT91 UDC driver on boards without vbus.
From 4ea2bd2e1ca18136d7cfd61643bc8d8187b1495f Mon Sep 17 00:00:00 2001
From: Owen Kirby <osk@exegin.com>
Date: Wed, 16 Apr 2014 17:45:18 -0700
Subject: [PATCH] Fix AT91 UDC driver on boards without vbus.

While porting Barebox to one of our boards, we found that the AT91 UDC driver
will fail to connect to USB hosts, and will spam the console with errors if
the VBUS pin isn't connected.

Signed-off-by: Owen Kirby <osk@exegin.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-23 09:24:06 +02:00
Sascha Hauer 521ffee526 video: imx-ipu-v3: remove unneeded 'dmfc' check
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Suggested-by: Fabio Estevam <festevam@gmail.com>
2014-04-23 09:19:44 +02:00
Lucas Stach 3e74fd9d05 video: displaytimings: remove two broken error messages
The error messages would dereference the just checked NULL
ptr. As those messages don't add much value without further
info just remove them.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-23 09:05:52 +02:00
Lucas Stach 9c63e92baa treewide: fix signedness mixups in printf format specifiers
This most likely doesn't fix any real bugs, but it's the
right thing to do and reduces the noise level with static
checkers.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-23 09:05:51 +02:00
Sascha Hauer 80bfa0b7cb of_gpio: return error if no device found
of_get_named_gpio_flags used to return 'ret' when no device
is found, but 'ret' is zero here. Return an error instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-09 22:26:26 +02:00
Michel Stam 9f556d4b6f x86: ns16550: Rework driver to allow for x86 I/O space
The current implementation fakes a memory-mapped I/O device
at 0x3f8 and 0x2f8, then uses platform read/write functions
to do the actual reading and writing. These platform functions
only exist for the x86 platform; better to move the I/O
routines into the driver and have the driver request I/O ports
using request_ioport_region.

Signed-off-by: Michel Stam <michel@reverze.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-09 19:31:42 +02:00
Sascha Hauer 7b8779541f fb: Fix use of unitialized variable
'ret' is only initialized when info->fbops->fb_activate_var exists, so
only use it in this case.

Reported-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-08 08:37:30 +02:00
Alexander Shiyan 0530a2ea8f spi: i.MX: Fix direction for CS GPIOs
Direction for CS GPIOs (for some targets) is undefined.
This patch fixes this issue.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-08 08:20:27 +02:00
Michel Stam 9c8f73ba86 x86: Add support for IDE on the legacy I/O ports
Signed-off-by: Michel Stam <michel@reverze.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-08 08:17:55 +02:00
Michel Stam 4d94f56c6c common: Allow for I/O mapped I/O
Rework the current framework so that I/O mapped I/O resources are
also possible.

Signed-off-by: Michel Stam <michel@reverze.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-08 08:17:55 +02:00
Alexander Shiyan e9ab71561b GPIO: i.MX: Implement get_direction()
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-08 08:11:23 +02:00
Antony Pavlov 20d70daf48 spi: add controller driver for Atheros AR7XXX/AR9XXX SoCs
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-07 11:22:32 +02:00
Antony Pavlov 33e0b3f973 spi: import bitbang txrx utility functions from linux
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-07 11:22:32 +02:00
Lucas Stach 7de93b77e6 clk: tegra20: convert to dt-binding defines
Allows to make relationship between DT and driver
more explicit and avoids duplication.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-07 08:36:03 +02:00
Wjatscheslaw Stoljarski d7c97e456a imx-spi: enable v0.7 spi driver for imx53-cspi
Signed-off-by: Wjatscheslaw Stoljarski <wjatscheslaw.stoljarski@kiwigrid.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-07 08:36:03 +02:00
Wjatscheslaw Stoljarski d39e527df3 imx-spi: enable v0.7 spi driver for imx53-cspi
Signed-off-by: Wjatscheslaw Stoljarski <wjatscheslaw.stoljarski@kiwigrid.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-05 18:28:27 +02:00
Sascha Hauer 149e9d8121 Merge branch 'for-next/mtd' 2014-04-04 10:06:22 +02:00
Sascha Hauer 245bc10ca5 Merge branch 'for-next/misc' 2014-04-04 10:06:22 +02:00
Sascha Hauer 712b555f6c Merge branch 'for-next/davinci' 2014-04-04 10:06:14 +02:00
Sascha Hauer b587c87aac Merge branch 'for-next/mips' 2014-04-04 10:05:46 +02:00
Sascha Hauer 74b5a3dbb3 Merge branch 'for-next/imx-ipu-v3' 2014-04-04 09:57:30 +02:00
Sascha Hauer 5dcb117e82 mtd: omap gpmc: Turn debug message into dev_dbg
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-04 08:40:00 +02:00
Alexander Shiyan 8d5f1bdc9a drivers: treewide: Kill empty remove() implementations
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-02 07:55:26 +02:00
Sascha Hauer e2fa0cca06 of: Add support for "stdout-path" property
ePAPR 1.1 specifies the "stdout-path" property, but barebox currently
only handles the "linux,stdout-path" property. Add parsing for the new
property name.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-31 09:16:12 +02:00
Sascha Hauer 47bab7bd56 video: i.MX IPUv3: Add hdmi support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-29 07:57:53 +01:00
Sascha Hauer 7f720048ea video: i.MX IPUv3: Add lvds bridge support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-29 07:57:53 +01:00
Sascha Hauer e5af227899 video: Add i.MX IPUv3 support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-29 07:57:53 +01:00
Sascha Hauer 939c653328 video: Add edid support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-29 07:57:53 +01:00
Sascha Hauer 3868765886 video: Add display timing from devicetree helper
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-29 07:57:47 +01:00
Sascha Hauer 258772deab input: gpio-keys; dt probing needs CONFIG_OF_GPIO
Otherwise of_get_named_gpio_flags is not available.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-29 06:38:46 +01:00
Sascha Hauer 25dcdd68fb video: rework mode_name parameter setting
We have dev_add_param_enum() now, so use it for the mode_name
setting. Also drop the special case for single mode framebuffers,
just add the mode_name parameter for this case aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-29 06:33:39 +01:00
Sascha Hauer 297b0e4672 video: introduce struct display_timings
And use it inside struct fb_info. This struct has the advantage
that the supported modes can be passed around in a single pointer.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-29 06:33:34 +01:00
Sascha Hauer 1184234a5e clk: Add parent round/set rate for mux and gate
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 21:03:15 +01:00
Sascha Hauer b1cc0d7fc6 clk: clk-fixed-factor: add set_rate/round_rate callbacks
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 21:03:15 +01:00
Sascha Hauer d043e162bb clk: let clk-divider handle the table based divider aswell
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 21:03:15 +01:00
Sascha Hauer d4aaca3647 clk: clk-divider: sync with kernel code
This updates the clk-divider to Kernel code, but without power-of-two
divider support which we do not need yet. This also adds table based
divider support to the divider.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 21:03:14 +01:00
Sascha Hauer 3e9a71f78d clk: clk-divider: pass flags to initializers
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 21:03:14 +01:00
Sascha Hauer 82163afcf0 clk: clk-fixed-factor: pass flags to initializers
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 21:03:14 +01:00
Sascha Hauer f4c7536514 clk: clk-gate: pass flags to initializers
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 21:03:02 +01:00
Sascha Hauer b33e5ba246 clk: clk-mux: pass clk flags from initializers
struct clk has a flags field, let the clk-mux initializers set this
field.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 10:51:30 +01:00
Antony Pavlov 8e74db588d clk: add Atheros AR933x driver
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 10:37:32 +01:00
Antony Pavlov dbee996459 serial: add Atheros AR933x driver
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 10:28:15 +01:00
Sascha Hauer 3d937ce312 clk: implement clk_round_rate
Instead of returning just the current rate implement clk_round_rate
properly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 08:45:11 +01:00
Sascha Hauer 57eb30b265 i2c: implement of_find_i2c_adapter_by_node
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 08:45:11 +01:00
Sascha Hauer c9b67dc0f3 i2c: i.MX: move to earlier initcall
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 08:45:11 +01:00
Antony Pavlov c56e8ca71c serial: ns16550: add compatible entry for "ingenic,jz4740-uart"
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-26 09:02:41 +01:00
Antony Pavlov e203955994 serial: ns16550: add compatible entry for "ns16450"
"ns16450" uses the same code as "ns16550a" but with FIFO disabled.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-26 09:02:41 +01:00
Antony Pavlov 6683b892ea serial: ns16550: make FCR setup value part of struct ns16550_priv
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-26 09:02:41 +01:00
Antony Pavlov 494ca69454 serial: ns16550: fix whitespaces
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-26 09:02:41 +01:00
Philipp Zabel 4449fac898 mtd: ubi: avoid NULL pointer dereference in ubi_get_device
If the ubidetach command is given a number that passes the range check
in ubi_detach_mtd_dev, but at which index the ubi_devices array contains
a NULL pointer, ubi_get_device tries to dereference this NULL pointer
to increment the ubi device reference count.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-23 09:46:47 +01:00
Antony Pavlov e6bbe60a53 clocksource: add dummy software-only clocksource
This driver is very handy for initial barebox porting.
It was used for running barebox on DiGiC2-based camera
and initial porting barebox to Loongson-1 and ar9331.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reported-by: Alexander Aring <alex.aring@gmail.com>
Reported-by: Alexander Shiyan <shc_work@mail.ru>
2014-03-19 21:43:43 +01:00
Sascha Hauer 64d2daa19d usb: gadget: propagate error code from usb_composite_register
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-19 16:29:14 +01:00
Sascha Hauer d465cb7a72 usb: gadget: set composite to NULL when usb_gadget_register_driver fails
So that it can be tried later again.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-19 16:29:08 +01:00
Antony Pavlov ca7340ebaf gpio: add driver for TI DaVinci SoCs
This driver is dts-only version of driver from Linux v3.14-rc5.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-18 17:28:11 +01:00
Alexander Shiyan 0017d4d2d6 mci: core: Typo fix in printk specifier
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-17 08:20:48 +01:00
Dmitry Lavnikevich 3676454f5c nand: mxs: Fix for calculating ecc strength on some types of NAND flash
Was tested on NAND with {writesize=4096, oobsize=224} and
{writesize=2048, oobsize=64}.

This patch will not break any NAND that was working
before. Implemented calculation way may be used for other NAND chips
with writesize == 2048 but oobsize != 64.

Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
Signed-off-by: Grigory Milev <g.milev@sam-solutions.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-12 21:26:37 +01:00
Dmitry Lavnikevich c15680099e nand: mxs: Check for up to 4 NAND chips
Since i.MX6 has only one R/B actual pin, if there are several R/B
signals (from different NAND chips) they must be connected to this
pin.

Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
Signed-off-by: Grigory Milev <g.milev@sam-solutions.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-12 21:26:37 +01:00
Dmitry Lavnikevich 95147b1d95 ubi: Fix for creating ubi volumes with 64bit size
Since MTD is already supports >= 4GB device sizes it is better to
allow ubi valumes also be created of larger sizes.

Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
Signed-off-by: Grigory Milev <g.milev@sam-solutions.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-12 21:26:37 +01:00
Dmitry Lavnikevich 76a88c0227 mtd: Support for 4GB partitions
This patch implements correct way of creating partitions on mtd
devices with size >= 4GB.

Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
Signed-off-by: Grigory Milev <g.milev@sam-solutions.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-12 21:26:37 +01:00
Dmitry Lavnikevich 1ee640765a mtd: Update internal API to support 64-bit device size
MTD internal API presently uses 32-bit values to represent device
size. This patch updates them to 64-bits but leaves the external API
unchanged.

In general, changing from 32-bit to 64-bit values cause little
or no changes to the majority of the code with the following
exceptions:
  - printk message formats;
  - division and modulus of 64-bit values (mtd_div_by_wb,
    mtd_div_by_eb may be used in some of such cases).

Was tested on phyFLEX i.MX6.

Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
Signed-off-by: Grigory Milev <g.milev@sam-solutions.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-12 21:26:37 +01:00
Sascha Hauer cf1b29a850 Merge branch 'for-next/ubi'
Conflicts:
	drivers/mtd/ubi/cdev.c
2014-03-07 09:26:35 +01:00
Sascha Hauer 3d551bce2b Merge branch 'for-next/spi' 2014-03-07 09:25:56 +01:00
Sascha Hauer 23a8d93c52 Merge branch 'for-next/pwm' 2014-03-07 09:25:56 +01:00
Sascha Hauer 74213ed9a7 Merge branch 'for-next/partitionhelper'
Conflicts:
	fs/devfs-core.c
2014-03-07 09:25:53 +01:00
Sascha Hauer e358922a74 Merge branch 'for-next/mtd'
Conflicts:
	drivers/mtd/core.c
	net/eth.c
2014-03-07 09:25:18 +01:00
Sascha Hauer 98615784a6 Merge branch 'for-next/modalias' 2014-03-07 09:25:12 +01:00
Sascha Hauer a8a08f88cc Merge branch 'for-next/misc'
Conflicts:
	common/environment.c
2014-03-07 09:25:09 +01:00
Sascha Hauer 2331b1d8e8 Merge branch 'for-next/marvell'
Conflicts:
	arch/arm/dts/Makefile
2014-03-07 09:25:02 +01:00
Sascha Hauer 048b03641e Merge branch 'for-next/imx' 2014-03-07 09:24:40 +01:00
Sascha Hauer 92ab6b5ea5 Merge branch 'for-next/gpio-keys' 2014-03-07 09:24:40 +01:00
Sascha Hauer 4df69d0b6e Merge branch 'for-next/env' 2014-03-07 09:24:40 +01:00
Sascha Hauer fbf087808b Merge branch 'for-next/dfu' 2014-03-07 09:24:40 +01:00
Herve Codina ad22ad38ea mtd: nand: atmel pmecc: disable subpage writes
I am using an sam5d35 and its pmecc nand ecc controller.

In barebox, using similar atmel_nand.c the system crashes.

The problem was a call to chip->ecc.hwctl from nand_write_subpage_hwecc
(nand_base.c) when we write a sub page.

chip->ecc.hwctl function is not set when we are using PMECC controller.

As a workaround, i set NAND_NO_SUBPAGE_WRITE for PMECC controller in
order to disable sub page access in nand_write_page.

I think we can have the same problem in Linux. I do not performed
subpage nand writes from Linux but i made the following patch according
to my Barebox defect.

Signed-off-by: Herve Codina <Herve.CODINA@celad.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-03 08:56:28 +01:00
Sascha Hauer 767c6b4a81 led: Add default-on trigger
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-03 08:06:04 +01:00
Sascha Hauer 70e2d85096 led: Add pwm-led driver
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-03 08:05:19 +01:00
Sascha Hauer e390a8e2b4 led: move led_of_parse_trigger to core
So that other LED drivers can use it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-03 08:05:15 +01:00
Sascha Hauer ea0ed15786 PWM: Implement devicetree support
This implements of_pwm_request() for PWM client drivers.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-28 15:05:46 +01:00
Sascha Hauer 37acfdf97d PWM: Add functions for getting/setting period/duty cycle
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-28 15:05:41 +01:00
Sascha Hauer f957d0a09c mtd: ubi: rework logging
By default UBI is very verbose. Decrease the verbosity, turn
printf messages into ubi_ messages and add device parameters
for the values which are not printed anymore.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-28 11:23:56 +01:00
Philippe Rétornaz fb7836ebf6 cfi_flash: fix NULL pointer dereference
We need to setup the info->dev pointer before flash_get_size() since it
might use it for dev_dbg().
This fix a crash on boot when debug output is enabled.

Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-28 09:03:04 +01:00
Uwe Kleine-König 14d0355d7c mtd/nand: constify filename parameter
The string pointed to isn't modified, so declare it as const.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-28 08:20:26 +01:00
Sascha Hauer 991a12da04 usb: dfu: Add create flag
With the create flag DFU can upload to regular, previously non existing
files.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-28 08:14:14 +01:00
Sascha Hauer 9b731118f9 usb: dfu: Fix spelling of flag name
DFU_FLAG_SAVE should really be named DFU_FLAG_SAFE.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-28 08:14:14 +01:00
Sascha Hauer d5e38fc913 mtd: mtdoob: Do not create for partitions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-26 08:33:19 +01:00
Sascha Hauer 05e4864f6b mtd: mtdraw: Do not create for partitions and devices without oob
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-26 08:33:18 +01:00
Sascha Hauer 9c66af7b0e ubi: register ubi devices and volumes as devices
struct ubi_device and struct ubi_volume have devices attached
to them. Register them to make them part of the barebox device
hierarchy.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-26 08:33:18 +01:00
Sascha Hauer 0c76b7e377 mtd: register mtd partitions as real mtd devices
So far mtd partitions were mtd devices, but these were not registered.
This patch changes this. mtd partitions are now registered like real
mtd devices. This makes them part of the device hierarchy.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-26 08:33:18 +01:00
Sascha Hauer 08f007c897 mtd: partition: make the mtd device the parent of the partition
Parent of a partition should be the parent mtd device, not its
parent.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-26 08:33:18 +01:00
Sascha Hauer e25cabf6a3 mtd: partition: only copy selected fields to partition
struct mtd_info contains members which should not be copied
to the new partition, like for example the class_dev, so
only copy selected members of struct mtd_info to the partition.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-26 08:33:18 +01:00
Sascha Hauer 6f0a7d82a1 mtd: Only call of_parse_partitions when the mtd has a parent
mtd->parent is optional so we can't derefence mtd->parent->device_node
without checking mtd->parent.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-26 08:33:18 +01:00
Sascha Hauer bfc58c2d8e mtd: erase_info may be modified in mtd_erase
erase_info may be modified by the mtd partition code, so
set the address each time we call mtd_erase.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-26 08:33:11 +01:00
Sascha Hauer 6613e2d8fb ARM: i.MX: Make mxc_iomux_v3_setup_multiple_pads argument const
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-20 14:50:10 +01:00
Sascha Hauer 7a037a952d input: gpio-keys: Add devicetree probe support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-17 08:23:41 +01:00
Sascha Hauer 2c194e5822 input: Add keycode to barebox key translation table
Devicetrees specify the keyboard codes for the gpio-keys
driver, so add a table to translate them into something
barebox can use.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-17 08:23:41 +01:00
Sascha Hauer 59d6a0b7f1 input: gpio-keys: separate internal data from platform_data
Do not abuse platform data for internal driver data, instead
use a separate struct for that.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-17 08:23:41 +01:00
Sascha Hauer 7e66707c76 input: Add BB_ prefix to KEY_ defines
Our KEY_ defines conflict with the standard Linux KEY_ defines, so
add a BB_ prefix to them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-17 08:23:37 +01:00
Alexander Shiyan 409df4db89 drivers/of/base.c: Fix sparse warnings
drivers/of/base.c:70:20: warning: symbol 'root_node' was not declared. Should it be static?
drivers/of/base.c:72:20: warning: symbol 'of_aliases' was not declared. Should it be static?
drivers/of/base.c:1724:20: warning: symbol 'of_chosen' was not declared. Should it be static?
drivers/of/base.c:1725:12: warning: symbol 'of_model' was not declared. Should it be static?

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-17 08:21:23 +01:00
Alexander Shiyan 132b10bc4a drivers/i2c/i2c.c: Fix sparse warnings
drivers/i2c/i2c.c:246:19: warning: symbol 'i2c_new_device' was not declared. Should it be static?
drivers/i2c/i2c.c:274:6: warning: symbol 'of_i2c_register_devices' was not declared. Should it be static?

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-17 08:21:23 +01:00
Alexander Shiyan b6cec342d9 drivers/clk/clk-divider-table.c: Fix sparse warning
drivers/clk/clk-divider-table.c:81:16: warning: symbol 'clk_divider_table_ops' was not declared. Should it be static?

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-17 08:21:23 +01:00
Alexander Shiyan d654d73537 drivers/clk/clk-gate.c: Fix sparse warning
drivers/clk/clk-gate.c:79:16: warning: symbol 'clk_gate_ops' was not declared. Should it be static?

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-17 08:21:23 +01:00
Alexander Shiyan 525bc8fc66 drivers/clk/clk-mux.c: Fix sparse warning
drivers/clk/clk-mux.c:53:16: warning: symbol 'clk_mux_ops' was not declared. Should it be static?

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-17 08:21:23 +01:00
Alexander Shiyan db6f20a1e5 drivers/clk/clk-fixed-factor.c: Fix sparse warning
drivers/clk/clk-fixed-factor.c:38:16: warning: symbol 'clk_fixed_factor_ops' was not declared. Should it be static?

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-17 08:21:23 +01:00
Alexander Shiyan 9404bfce88 drivers/clk/clk-fixed.c: Fix sparse warning
drivers/clk/clk-fixed.c:35:16: warning: symbol 'clk_fixed_ops' was not declared. Should it be static?

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-17 08:21:22 +01:00
Alexander Shiyan 07a6c818ef USB gadget: Remove redundant assignment
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-17 08:06:11 +01:00
Alexander Shiyan 56b3558f1d spi: altera_spi: Remove redundant assignment
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-17 08:06:11 +01:00
Alexander Shiyan 2126c89004 mtd: nand_imx: Remove redundant assignment
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-17 08:06:11 +01:00
Sascha Hauer acd028a3cb PWM: Add i.MX PWM driver
The Kernel driver from Linux-3.13 with some adjustments for
barebox.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-14 16:34:12 +01:00
Sascha Hauer 9bdef9e7f2 mci: Fix version handling
Currently the version defines reflect the digits in the version
number. MMC_VERSION_4_41 is defined as 0x441 and MMC_VERSION_4_5
is defined as 0x405. This results in MMC_VERSION_4_5 < MMC_VERSION_4_41
becoming true which was surely not intended. Fix this by
redefining the versions as 0x<major><minor><micro>. This makes the
string generation more complicated but makes versions comparable
again.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-14 16:30:13 +01:00
Sascha Hauer 72141fa925 PWM: pxa: use pwmx as devname
As this changes the name of the pwm we also have to adjust it in
pwm_request.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-14 07:17:23 +01:00
Sascha Hauer d23af7a0a0 device: remove parameters when unregistering a device
Otherwise we loose memory on each device_unregister. The ethernet
code used to do this before calling unregister_device. This can
now be removed.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-13 19:39:11 +01:00
Sascha Hauer f0bd826abe device: init bus list
bus_list is only initialized when the device has a bus, but it
needs to be initialized in unregister_device, so initialize the
list unconditionally.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-13 19:39:11 +01:00
Sascha Hauer 29ea8bcd94 mtd: Simplify partitions
Embed the partition information in struct mtd_info. This makes the
mtd partition code simpler.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-13 19:39:08 +01:00
Sascha Hauer 5da563f1e6 PWM: Use a separate device for PWMs
Instead of directly using the hardware devicet for PWMs register
a logical PWM device so that the user operates on pwmx devices rather
than pxa-pwmx.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-13 10:57:40 +01:00
Sascha Hauer 1e6db288d9 USB gadget: dfu: propagate error from usb_gadget_poll
So that the dfu command can bail out with an error when usb_gadget_poll
fails.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-13 10:40:28 +01:00
Sascha Hauer 771109df46 USB gadget: fsl: Bail out if no udc exists
When there is no udc registered bail out in usb_gadget_poll
instead of crashing the system.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-13 10:40:22 +01:00
Sascha Hauer 1a3315ad7d USB gadget: at91: return error when no udc is registered
When no udc is registered it is clearly an error when usb_gadget_poll
is called. Let the upper layers know that.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-13 10:38:56 +01:00
Sascha Hauer 0d70fb43e0 video: imx: Add a name to perclk
perclk should be named 'per' to make sure we get the correct clock.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-10 17:06:52 +01:00
Eric Bénard 4395095ab5 sata-imx: i.MX53, use the internal 120MHz clock by default
this allows SATA to work on i.MX53 QSB-R :
barebox@Freescale i.MX53 Quick Start-R Board:/ ata0.probe=1
imx-sata 10000000.sata: port 0: SATA link ok
imx-sata 10000000.sata: port 0: Spinning up device...
imx-sata 10000000.sata: port 0: ok.
ata0: registered /dev/ata0

before this fix the log was :
barebox@Freescale i.MX53 Quick Start-R Board:/ ata0.probe=1
imx-sata 10000000.sata: port 0: SATA link timeout
set parameter: Connection timed out

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-10 09:13:31 +01:00
Sebastian Hesselbarth 1cae0ff619 net: orion: add ethernet driver
This adds a driver for the Ethernet ip found on Marvell Orion SoCs,
which is derived from Marvell Discovery System Controllers (MV643xx).
It is partially based on the corresponding u-boot driver.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-10 09:09:03 +01:00
Sebastian Hesselbarth 0066844fb1 net: phy: add mvebu mdio bus driver
This adds a driver for the mdio bus found on Marvell Orion SoCs as
part of the GBE device and Marvell Armada 370/XP as part of Neta
eth device. Both drivers can share this code, so make it available
independently.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Michael Grzeschik <mgr@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-10 09:09:03 +01:00
Sebastian Hesselbarth 695060fb1a bus: mvebu: add mbus driver
This imports the Marvell mbus driver from Linux. The mbus is the
main downstream bus found on all Marvell Orion SoCs. The driver
deals with re-configurable address windows which are currently
parsed from DT. Also enable the driver as default on all MVEBU
SoCs. While at it, also reorder drivers/bus/{Kconfig,Makefile}
alphabetically.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-10 09:08:51 +01:00
Sebastian Hesselbarth 29af281cb1 net: phy: add of_phy_device_connect
This implements a of_phy_device_connect to allow DT enabled drivers
to connect to a PHY device by using the PHY's DT node only. It
currently assumes that each PHY node is a child of the corresponding
mdio bus.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-10 09:08:51 +01:00
Sebastian Hesselbarth 7ccd47fd5c net: reorder Kconfig and Makefile alphabetically
This reorders Kconfig and Makefile for drivers/net alphabetically.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-10 09:08:51 +01:00
Lucas Stach b0723e39ec clk: avoid possible NULL ptr deref
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-10 08:49:55 +01:00
Lucas Stach 40fa265fab mtd: core: avoid possible NULL ptr deref
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-10 08:49:55 +01:00
Lucas Stach 8850df8cee net: usb: asix: properly propagate error code
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-10 08:49:55 +01:00
Lucas Stach 4a5f389d1d net: usb: smsc95xx: fix wrong phy reset condition
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-10 08:49:55 +01:00
Lucas Stach 259b65b5ac usb: dfu: fix error path to avoid NULL ptr deref
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-10 08:49:55 +01:00
Lucas Stach c26a451721 usb: ulpi: fix logic-op
Checking register bits is a bitwise operation.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-10 08:49:55 +01:00
Lucas Stach aa6694b542 remove redundant NULL check on free
free() already checks the pointer to be non
NULL. No need to do it again.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-10 08:49:55 +01:00
Sascha Hauer 0ad1e8d8df spi: imx: Use device ids
To let the driver work on all SoCs without the use of cpu_is_*()

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-10 08:41:25 +01:00
Sascha Hauer c68acd82f6 spi: imx: Use IS_ENABLED to drop ifdefs
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-09 10:06:21 +01:00
Sascha Hauer 8559a7a85f spi: imx: drop use of enum
enum imx_spi_devtype is used as index into an array of controller types.
This makes the controller type handling unnecessarily complicated. Just
drop the enum and instead of an array use different statically initialized
structs and referene them by name.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-09 10:05:41 +01:00
Sascha Hauer ee2b49d718 mtd: m25p80: set driver id_table
This sets the id_table in the driver correctly so that the driver
can match to the various types of flashes, not only "m25p80".

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
2014-02-09 09:46:26 +01:00
Sascha Hauer 394edf6377 i2c/spi: match of_modaliases
i2c/spi devices in the devicetree often come with a "vendor,device"
comaptible string. These do not match in barebox, so add a
device_match_of_modalias function which does exactly that.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-07 09:28:02 +01:00
Cristiano De Alti 4f2f9150b7 cfi_flash.c: correct calculation of region erasesize and offset for multiple (size_ratio > 1) chips in parallel
Signed-off-by: Cristiano De Alti <cristiano_dealti@hotmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-04 08:21:51 +01:00
Sascha Hauer adbf51abde Merge branch 'for-next/pxa' 2014-02-03 09:55:55 +01:00
Sascha Hauer d08d73ba95 Merge branch 'for-next/net' 2014-02-03 09:55:55 +01:00
Sascha Hauer 601bf0fcc6 Merge branch 'for-next/misc' 2014-02-03 09:55:54 +01:00
Sascha Hauer d3c96d6522 Merge branch 'for-next/mci'
Conflicts:
	arch/arm/boards/tqma53/board.c
2014-02-03 09:55:52 +01:00
Sascha Hauer c224cd3161 Merge branch 'for-next/imx'
Conflicts:
	arch/arm/boards/dmo-mx6-realq7/lowlevel.c
2014-02-03 09:55:13 +01:00
Sascha Hauer 3cbd92bf6e Merge branch 'for-next/gpio' 2014-02-03 09:52:34 +01:00
Sascha Hauer f4cece7db5 Merge branch 'for-next/clps711x' 2014-02-03 09:52:34 +01:00
Sascha Hauer 8e174d41f0 mci: imx-esdhc: Add i.MX25 compatible entry
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-31 18:51:53 +01:00
Alexander Shiyan 303c3d1e24 gadget: at91: Fix uninitialized variable
Variable udc is used unitialized for DBG(xxx).

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-29 21:38:10 +01:00
Sascha Hauer 0099a887c0 reset_source: rename set_reset_source to reset_source_set
To get all reset source related functions into the same function
namespace.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-29 12:12:17 +01:00
Sascha Hauer 078a29da28 mci: imx: Add devicetree probe support
Only simple probing, no properties supported yet.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-29 11:31:31 +01:00
Sascha Hauer d25cba0090 pinctrl: Add pinctrl driver for i.MX1/21/27
This turns the legacy iomux-v1 support into a full pinctrl
driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-29 11:31:31 +01:00
Sascha Hauer ae39ba29c6 misc: Add devicetree SRAM driver
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-29 10:29:47 +01:00
Sascha Hauer 27da1665d3 misc Kconfig: always ask for misc devices
The "Misc devices" menu does not enable anything by itself, so make it a
regular menu rather than a menuconfig.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-29 10:29:43 +01:00
Philipp Zabel 7a150c5fb1 net usb asix: add AX88772B USB ID
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-29 10:14:37 +01:00
Philipp Zabel 4eabf125fb net usb asix: read MAC from EEPROM on AX88772B
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-29 10:14:37 +01:00
Sascha Hauer 25cee7ec17 environment: Use accessor functions for default environment path
default_environment_path only exists when CONFIG_ENV_HANDLING is enabled.
Boards would have to #ifdef this if they wanted to use
default_environment_path. Use accessor functions instead which can
be ifdeffed on a single place.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-27 09:27:02 +01:00
Alexander Shiyan 32d6d2ae76 serial: clps711x: Update driver
This patch updates the CLPS711X UART driver.
The update adds support for use with devicetree and
makes driver comatible with current driver from kernel.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-24 23:10:04 +01:00
Alexander Shiyan 6c3e620e57 gpio: clps711x: Update driver
This patch updates the CLPS711X GPIO driver.
The update adds support for use with devicetree and
optimizes "probe" a bit.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-24 23:10:04 +01:00
Alexander Shiyan 624454160b ARM: clps711x: Remove the special name for the syscon driver
No reason to make SYSCON driver name unique to that processor.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-24 23:10:04 +01:00
Alexander Shiyan c2c5f48b91 mfd: syscon: Introduce syscon_base_lookup_by_phandle() function
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-24 23:10:04 +01:00
Marek Vasut f5fa816cff net usb asix: Use only 11 bits of header for data size
The AX88772B uses only 11 bits of the header for the actual size. The other bits
are used for something else. This causes dmesg full of messages:

	asix_rx_fixup() Bad Header Length

This patch trims the check to only 11 bits. I believe on older chips, the
remaining 5 top bits are unused.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-23 08:10:06 +01:00
Marek Vasut c827eb8ff3 net usb asix: Simplify condition in rx_fixup()
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-23 08:10:06 +01:00
Sascha Hauer dac65f99e8 console: Set Linux console parameter automatically
Linux specifies the linux,stdout-path property in the /chosen node
in the devicetree. Unfortunately this is ignored in most cases.
For cases in which barebox uses this property for its own use we
translate this into a Linux boot arg with:

- the console name provided by the serial driver
- the the instance from the 'serial' alias
- the baudrate from the actual baudrate.

So with this it's for devicetee enabled boards no longer necessary
to manually assign a console= parameter. Should a user not want
to use the automatically assigned parameter it should do:

global.linux.bootargs.console=

in the environment.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-22 07:53:21 +01:00
Antony Pavlov cec6fd5d85 net/phy: add driver for National Semiconductor DP83865 PHY
Based on Linux kernel 3.12 driver.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-20 10:54:24 +01:00
Sascha Hauer d9a08d8bc5 net: phy: Fix crash when no phy is found
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-20 10:54:17 +01:00
Markus Niebel fa5bdb30ee mci: imx-esdhc: add DSR support
having DSR support in mci-core we need a way to
forward the DSR value to the driver. Add it to
platform data for imx-esdhc

TODO: implement the same for other host controller
drivers

Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-15 15:22:56 +01:00
Markus Niebel f11668fee7 mci: add device tree support for DSR
add optional DSR support. This should go into the kernel, too

Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-15 15:22:43 +01:00
Markus Niebel 78b9e4e041 mci: add DSR support
The eMMC and the SD-Card specifications describe the optional SET_DSR command.
During measurements at our lab we found that some cards implementing this feature
having really strong driver strengts per default. This can lead to voltage peaks
above the specification of the host on signal edges for data sent from a card to
the host.

Since availability of a given card type may be shorter than the time a certain
hardware will be produced it is useful to have support for this command (Alternative
would be changing termination resistors and adapting the driver strength of the
host to the used card.)

Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-15 15:22:43 +01:00
Markus Niebel 96da216991 mci: production year for eMMC 4.41 and later
Year is coded in 4 bits of CID. eMMC 4.41
adds a new interpretation rule: production
year for 4.41 cards and newer is between 2010
and 2025 with 0 corresponding to 2013.

This fix was inspired by currect kernel code.

Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-10 14:56:58 +01:00
Markus Niebel 98d5fd3915 mci: Support the correct version for eMMC
eMMC is available up to version 4.5 but the
correct version is not decoded. Change version
definitions to support more minor verions, add
missing versions and parse the minor versions from
ext_csd.

After this, card detection code and devinfo reports
correct versions.

Handling is inspired by u-boot code.

Signed-off-by: Markus Niebel <Markus.Niebel@tqs.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-10 14:56:58 +01:00
Jan Weitzel 1ebf5ff0c1 of: find also nodes by mixture of alias and path
Let of_find_node_by_path_or_alias also find a node starting with an alias
followed by a path like "i2c0/tps@24"

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-10 10:39:57 +01:00
Antony Pavlov d1e54c4bc2 gpiolib: gpiolib command: show label only for requested pins
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-10 10:09:31 +01:00
Antony Pavlov 4fcad5129e gpiolib: gpio_free: clear gpio's "label" field too
If an error occured during gpio_request_array() then we can
get not requested gpio with nonempty garbage "label" field
value. Afterward the "gpiolib" command can try to use this
nonempty garbage value.

This patch prevents this error situation.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-10 10:09:31 +01:00
Antony Pavlov f8cdb92751 gpiolib: gpio_request(): print message on error
Just copy gpiod_request() function logic from linux-v3.13-rc7.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-10 10:09:31 +01:00
Alexander Shiyan d95f27aaa8 of: platform: Fix possible crash
"dev" may uninitialized or points to incorrect device. While at
it make the message more informative.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-10 08:38:36 +01:00
Sascha Hauer 29b6d429f6 Merge branch 'for-next/video' 2014-01-07 11:57:52 +01:00
Sascha Hauer dd28a45d9d Merge branch 'for-next/usb-chipidea' 2014-01-07 11:57:52 +01:00
Sascha Hauer 07e5ba98e5 Merge branch 'for-next/ubi' 2014-01-07 11:57:52 +01:00
Sascha Hauer 968cb4bb84 Merge branch 'for-next/openrisc' 2014-01-07 11:57:51 +01:00
Sascha Hauer c56fdbbc37 Merge branch 'for-next/miiphy' 2014-01-07 11:57:51 +01:00
Sascha Hauer 682d47d6ce usb: chipidea i.MX: add some delay after ulpi_setup
On the pcm038 the ULPI phy is found correctly, but after
a power cycle the attached devices are not found. Adding
some delay fixes this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:13:59 +01:00
Sascha Hauer d35fa7f26d usb: chipidea i.MX: always print an error message when ULPI fails
The ULPI code does not print a message when the operation times
out. Add one to the caller so that he gets an idea that something
is going wrong.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:13:58 +01:00
Sascha Hauer db48428216 usb: chipidea i.MX: limit port init to HSIC mode
imx_chipidea_port_init() will be called during startup from
the ehci driver. Calling it before setting up the PORTSC register
is only necessary in HSIC mode.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:13:58 +01:00
Sascha Hauer 873b6b6892 usb: chipidea i.MX: remove unused pdata->init hook
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:13:58 +01:00
Richard Weinberger 73618394bf UBI: Add some asserts to ubi_attach_fastmap()
Add more paranioa asserts to make it easier to detect
implementation errors.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:03:24 +01:00
Richard Weinberger 71791bd2cb UBI: Fix memory leak in ubi_attach_fastmap() error path
On error we have to free all three temporary lists.

Reported-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:03:24 +01:00
Richard Genoud dee73c54b0 UBI: simplify image sequence test
The test:
if (!a && b)
  a = b;
can be symplified in:
if (!a)
  a = b;

And there's no need to test if ubi->image_seq is not null, because if it is,
it is set to image_seq.
So, we just test if image_seq is not null.

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:03:24 +01:00
Richard Genoud 2bae366563 UBI: fastmap: fix backward compatibility with image_seq
Some old UBI implementations (e.g. U-Boot) have not implemented the image
sequence feature.
So, when erase blocks are written, the image sequence in the ec header
is lost (set to zero).
UBI scan_all() takes this case into account (commits
32bc4820287a1a03982979515949e8ea56eac641 and
2eadaad67b2b6bd132eda105128d2d466298b8e3)

But fastmap scan functions (ubi_scan_fastmap() and scan_pool()) didn't.

This patch fixes the issue.

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:03:24 +01:00
Richard Weinberger 8000a53dda UBI: Call scan_all() with correct offset in error case
If we find an invalid fastmap we have to scan from the very beginning.
Otherwise we leak the first 64 PEBs.

Reported-and-tested-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:03:24 +01:00
Richard Weinberger 4a290f970d UBI: Fix error path in scan_pool()
We have to set "ret", not "err" in case of an error.

Reported-and-tested-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:03:24 +01:00
Richard Weinberger f0986b6f70 UBI: fix refill_wl_user_pool()
If no free PEBs are available refill_wl_user_pool() must not
return with -ENOSPC immediately.
It has to block till produce_free_peb() produced a free PEB.

Reported-and-Tested-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-07 11:03:24 +01:00
Richard Weinberger 54930d9f92 UBI: Fix invalidate_fastmap()
Onging tests uncovered that invalidate_fastmap() is broken.
It must not call ubi_wl_put_fm_peb() because all PEBs used
by the old fastmap have already been put back.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2014-01-07 11:03:24 +01:00
Richard Weinberger 92924e7ae1 UBI: Fix PEB leak in wear_leveling_worker()
get_peb_for_wl() removes the PEB from the free list.
If the WL subsystem detects that no wear leveling is needed
it cancels the operation and drops the gained PEB.
In this case we have to put the PEB back into the free list.

This issue was introduced with commit ed4b7021c
(UBI: remove PEB from free tree in get_peb_for_wl()).

Cc: <stable@vger.kernel.org> # 3.7.x
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2014-01-07 11:03:24 +01:00
Antony Pavlov 9bc8980590 net/phy/phy.c: fix whitespace
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-06 09:42:30 +01:00
Antony Pavlov ce4e4eff35 net/phy: add driver for LXT PHYs
Based on Linux kernel 3.12 driver.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-06 09:42:30 +01:00
Antony Pavlov 8ffd4f8c74 miitool: change behaviour closer to linux' mii-tool
miitool without arguments will try to show status for all phys.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-06 09:42:29 +01:00
Sascha Hauer d7fe5e2263 mtd: Add subpagesize to mtd_info_user
ubiformat needs the subpagesize to work correctly. The kernel uses
sysfs to pass the subpagesize, but in barebox we have the possibility
to extend struct mtd_info_user. Add a corresponding field and use it
in ubiformat.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-20 15:04:30 +01:00
Sascha Hauer 080a4e9c9b mtd: fix mtd_read return value
mtd->read returns the number of bitflips as positive numbers.
Instead of returning these numbers Return -EUCLEAN when the bitflip
threshold has been reached, 0 otherwise.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-20 15:04:30 +01:00
Sascha Hauer a8fd9bfd12 mtd: fix wrong return values in cdev read
mtd->read returns the number of bitflips as positive numbers.
Instead of returning these numbers Return -EUCLEAN when the bitflip
threshold has been reached, 0 otherwise.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-20 15:04:29 +01:00