9
0
Fork 0
Commit Graph

3751 Commits

Author SHA1 Message Date
Antony Pavlov c2fed64666 net: tap: make locally used functions static
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-12-04 08:13:44 +01:00
Yegor Yefremov 5db57dace1 driver: make all dev_request_mem_region_* routines MIPS compatible
Use IOMEM() macro in all dev_request_mem_region_* routines to allow
the proper mapping on all platforms.

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

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

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-30 08:22:31 +01:00
Sascha Hauer 7da99e58bd video: i.MX IPUv3: Set ldb clocks correctly
The clocks for the LVDS display bridge have a fixed /3.5 and a
configurable /1,/2 divider in their path. The configurable divider has
to be explicitly configured for single/dual channel support, so we can't
rely on clock rate parent propagation here. Clear the
CLK_SET_RATE_PARENT flag for the configurable divider and configure the
clock explicitly in the ldb driver.
Tested on a custom i.MX6 board, currently untested on i.MX53.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-30 08:22:31 +01:00
Stefan Christ fbcf721db1 wdog: imx-wd: watchdog cannot be disabled again
The i.MX21/i.MX6 watchdog cannot be disabled after it was activated.
Bit 2 (WDE) cannot be set to 0 again. Notify the user about that by
returning -ENOSYS.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-30 08:22:30 +01:00
Enrico Jorns 446f3d07dd state: disable load command
Explicitly loading environment is not required as it will be loaded if
available during device probing

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-27 08:26:40 +01:00
Marc Kleine-Budde 7098d7121e state: use name of device node as name if alias is not available
Wihtout this patch, when using more than one state device an alias is
mandatory, otherwise the there will be two state devices with the name state.

This patch fixes the limitation by using the device node's name if no alias is
defined.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-27 08:26:40 +01:00
Marc Kleine-Budde ef39770210 state: make use of of_find_path_by_node() and add return -EPROBE_DEFER if device is not available
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-27 08:26:40 +01:00
Marc Kleine-Budde 21aea1d9ff of_path: add of_find_path_by_node()
This patch adds the function of_find_path_by_node(), which is similar to
of_find_path(), but it translates a device tree node into a barebox device path
directly.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-27 08:26:40 +01:00
Marc Kleine-Budde 75b682795e of_path: of_find_path() factor out device detection logic into separate function
This patch factors out the device detection logic into separate function, so
that it can be used from another function.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-27 08:26:40 +01:00
Trent Piepho 87dde1730d eeprom: Support pagesize OF device tree property
Allows specifying the page size when the eeproms are in the device
tree.  Same as the Linux kernel device-tree bindings for at24.

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

Add a flag to describe this difference.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-26 09:05:59 +01:00
Sascha Hauer 770c1ef83c mtd: core: initialize *retlen in mtd_write()
Some mtd drivers like the spi-nor driver do not assign a value
to the retlen pointer but instead only add the bytes written
to *retlen. Users of mtd_write expect the variable to be initialized
by the mtd core though, so we have to do it in mtd_write(). The
same is done in mtd_read already.

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

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 10:23:38 +01:00
Sascha Hauer 00c8cfb3e9 reset: Allow dummy reset lines
Treat NULL as a dummy reset line which is returned by the reset core
when there is no reset line connected to a device (that is, no
reset is described in the device tree). With this consumers can
just use the reset functions without having to check for existence.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 09:51:51 +01:00
Sascha Hauer 42c797b091 video: pwm-backlight: Honour discrete brightness levels from dt
If probed from device tree we have an array of pwm duty cycle levels
in the brightness-levels property. Although the driver parsed the property,
the values have been ignored. Make use of these flags so that the driver
can work for example with inverted PWMs.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 09:46:27 +01:00
Antony Pavlov 28ab89ec81 net: usb: asix: fix 'no previous prototype' warning
Here is the warning message:

    drivers/net/usb/asix.c:427:5: warning: no previous prototype for 'asix_rx_fixup_internal' [-Wmissing-prototypes]
     int asix_rx_fixup_internal(struct usbnet *dev, void *buf, int len,
         ^

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:36:50 +01:00
Antony Pavlov 7454e176bb net: usb: asix: make rx_fixup ax_skb buffer aligned
ax_skb receive buffer unalignment leads to consequent
unalignment data access in network stack routines,
especially in net_checksum().

By-turn unalignment data accesses lead to performance penalty.
Moreover on classic MIPS CPUs without hardware unalignment access
support this leads to undesirable exceptions.

At the moment barebox on MIPS can't parry these unalignment access
exceptions, so the Asix USB Ethernet chips, that need receive
fixup workaround, are completely unusable on MIPS without this patch.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:36:50 +01:00
Teresa Remmet 353065f934 driver: watchdog: Add support for omap_wdt
Add support for OMAP Watchdog driver.

Based on omap_wdt Linux driver (v4.3-rc1).

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:24:56 +01:00
Du Huanpeng ea682776db font: fbconsole: add custom font supports
Signed-off-by: Du Huanpeng <u74147@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:21:08 +01:00
Sebastian Hesselbarth f01b562cb8 mtd: nand_mrvl_nfc: Add optimized timings for Samsung K9K8G08U
This adds optimized timings for Samsung K9K8G08U 1Gb NAND flash.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:17:25 +01:00
Sebastian Hesselbarth 131d5b5aef mtd: nand_mrvl_nfc: Add support for Marvell Armada 370/XP
Marvell PXA3xx and Armada 370/XP share the same NAND controller IP
with some minor differences. With support for controller IP v2, now
allow to build the driver on Armada 370/XP.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:17:25 +01:00
Sebastian Hesselbarth 7c6e711ef8 mtd: nand_mrvl_nfc: Add support for NDCB3 register
Newer versions of PXA3xx NAND controller support a 4th Command Buffer
register. Add the required HWFLAGS and additional write to NDCB0.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:17:25 +01:00
Sebastian Hesselbarth 87bddaf82e mtd: nand_mrvl_nfc: Add support for HW BCH ECC
Add support for HW BCH ECC for those HW versions that support it.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:17:25 +01:00
Sebastian Hesselbarth f7d39e122e mtd: nand_mrvl_nfc: Add support for 8bit BCH HW ECC
Add support for 8bit HW ECC modes supported by later IP versions.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:17:24 +01:00
Sebastian Hesselbarth 624bea7b14 mtd: nand_mrvl_nfc: Add support for 4bit BCH HW ECC
Add support for 4bit HW ECC modes supported by later IP versions.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:17:24 +01:00
Sebastian Hesselbarth 4647cb15e9 mtd: nand_mrvl_nfc: Add hwflags to distinguish different HW versions
Marvell PXA3xx NAND flash controller IP has been reused in later SoCs
with additional HW features. Add HW BCH ECC as the first known HW
difference.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:17:24 +01:00
Sebastian Hesselbarth fa8ece6674 mtd: nand_mrvl_nfc: Prepare for different HW ECC strengths
Newer versions of Marvell PXA3xx NFC also support BCH and therefore
higher ECC strengths than 1. Prepare for different ECC strength by
factoring out ECC init into separate functions by strength. Also,
add a new host variable that indicates BCH ECC.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:17:21 +01:00
Sebastian Hesselbarth 75783fa8d0 mtd: nand_mrvl_nfc: Get ecc parameters from DT
With DT helpers for ECC step size and strength, now use them on
Marvell NAND driver.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:00:09 +01:00
Sebastian Hesselbarth 0ba6906309 mtd: nand_mrvl_nfc: Fix num-cs property parsing
The "num-cs" property does not encode flashes CS line but number
of available CS signals. Fix wrong property parsing to ->cs by
adding proper ->num_cs variable to host struct.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:00:09 +01:00
Sebastian Hesselbarth 81a0cfce8d mtd: nand_mrvl_nfc: Protect mrvl_nand_probe_dt
Parsing DT nodes if CONFIG_OFTREE isn't enabled is pointless, also
we should prefer potential platform_data passed earlier.
Protect mrvl_nand_probe_dt by bailing out early if either
CONFIG_OFTREE is not enabled or dev's platform_data is non-NULL.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:00:09 +01:00
Sebastian Hesselbarth 144adf2170 mtd: nand_mrvl_nfc: Use Auto Read Status on program/erase
Marvell NAND controller allows to enable an Auto Read Status feature
that will automatically monitor NAND status during Erase and Program
operations. Ready bit in status register will be set after the
controller is sure the NAND device has finished the operation and
saves us from guessing the real timeout values.

Using the Auto Read Status feature prevents timeout issues on the
two operations with none or wrong timing register setup.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:00:09 +01:00
Sebastian Hesselbarth bb7a7557f7 mtd: nand_mrvl_nfc: Clear OOB data with 0xff instead of 0x00
If OOB data is not required on page program, we have to clear
the corresponding data with 0xff instead of 0x00.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:00:09 +01:00
Sebastian Hesselbarth 774784c579 mtd: nand_mrvl_nfc: Use common clock for core clock
With PXA3xx now providing a common clock for the NAND clock, use it
and get rid of the mach/clock.h. This will allow Marvell Armada 370/XP
to reuse the same driver.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:00:09 +01:00
Sebastian Hesselbarth bcf9febb91 mtd: nand: Clarify Marvell Orion Kconfig prompt
Kconfig prompt for Marvell Orion SoCs is missing a "Marvell"
prefix, add it to the prompt.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:00:09 +01:00
Sebastian Hesselbarth 7cde58cc9d of: mtd: Import of_get_nand_ecc_{step_size, strength} from Linux
This imports DT helpers for MTD ECC step size and strength from
Linux kernel.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-23 08:00:09 +01:00
Trent Piepho b097f7b910 i2c: core: Add client I2C address to devinfo
Useful bit of information.  Example:
barebox:/ devinfo dummy0
Bus: i2c
  Address: 0x52

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

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-19 08:58:25 +01:00
Andrey Smirnov 9e6f482cd8 i2c-imx: Use xzalloc instead of kzalloc
Driver's private data structure is allocated with kzalloc without any
code to check for kzalloc's possible failure. Fix that by replaceing
kzalloc with xzalloc.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-19 08:58:25 +01:00
Andrey Smirnov 0534926f41 i2c: Add support for DesignWare controllers
Add a driver for DesignWare I2C controller IP block found on several
SoCs including Altera SoC products

Tested using Terrasic SoCKit board and GPIO expander board with I2C
EEPROM on it

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-19 08:58:25 +01:00
Trent Piepho 9d0ff0aa79 mci: dw_mmc: Add support for high speed modes
The Synopsys DesignWare core supports 52 MHz MMC mode and 50 MHz SD
mode, so add the cap flags so they are used.

This works on socfpga.  The other user of this driver is Rockchip and
the datasheet I found for the RK30xx indicated it supported highspeed
modes as well.

The Linux kernel has DT properties, e.g. "cap-mmc-highspeed", but none
of the drivers in barebox support this at all.  They all specify flags
in their code.

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-19 08:52:10 +01:00
Stefan Christ 3ee195ec12 net: fec: fix indentation and whitspaces
Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-19 08:33:07 +01:00
Stefan Christ e2747f710a net: fec: implement dtb property phy-reset-duration
Implement device tree property phy-reset-duration to adjust length of
phy reset.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-19 08:33:07 +01:00
Stefan Christ a63cb59c01 net: fec: set phy reset time to 1ms
According to the device tree bindings in dts/Bindings/net/fsl-fec.txt
the default phy-reset time is 1ms.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-19 08:33:07 +01:00
Lucas Stach d22d68fca4 net: rtl8169: get rid of DMA_ADDRESS_BROKEN
Don't assume a 1:1 virt to phys mapping, but use the real physical
address returned by the dma alloc function.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-13 08:55:04 +01:00
Trent Piepho f0ae0c33f5 net: designware: Don't hang in reset with powered down phy
The dw MAC requires that all clock domains to be running for it to
finish a MAC reset.  This include the clock provided by the PHY.

If the PHY is powered down, bit BMCR_PDOWN set, then it won't be
generating a clock.  And so the MAC never comes out of reset.  On
shutdown, Linux will put the PHY in powerdown mode, so it can easily
be the case that the PHY is powered down on boot.

See Linux kernel commit 2d871aa07136fe6e576bde63072cf33e2c664e95.

Currently the MAC reset is done before the phy is probed.  We can't
power up the phy until it's probed, so the resets must be in the
opposite order.  The MAC reset is in device init but the PHY probe is
in device open.  Device init is done first, always, while open is done
later, and only if the device is used.

Rather than move the phy probe to init, this moves the MAC reset to
open.  It seems better to speed up boots that doesn't use ethernet by
skipping MAC reset than to slow them down by adding PHY probe.

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-13 08:00:19 +01:00
Trent Piepho 48aecb409d firmware: socfpga: Add parameter "programmed" to fpgamgr driver
This boolean parameter tells you if the FPGA is programmed or not.  It
can be accessed from the shell as "$fpga.programmed".  One could use
this to not program the FPGA if it's already programmed.

There is an annoying limitation of the way barebox puts parameters
into the shell env: it requires they have no periods in the device
name.  It uses the first period to divide the variable name into a
device and parameter name, which doesn't work correctly if the device
name has a period in it.

Since the names of any devices created from the OF device tree have a
period in them, this is a problem.

So what I did here was create a new device.  Its parent will be the OF
device for the fpgamgr and it will in turn be the parent of the
firmware cdev.  Previously the cdev's parent was the OF device.  This
device won't have period in the name and the parameter is attached to
it.  Even without the period limitation, doing this gives a nicer name
"fpga.programmed" instead of "ff706000.fpgamgr.programmed".

The fpgamgr code had a pointer to the OF device in its private state.
I changed this to be a struct for the new "fpga" device, which is then
used in all the places the former pointer was (nothing but dev_dbg,
etc. calls).

Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-11 09:05:20 +01:00
Uwe Kleine-König d9c2cfd534 usb: mx25: fix bit position of "Host power mask"
The bit MX25_H1_PM_BIT value is handled for port 1 as MX25_OTG_PM_BIT is
for port 0. The latter is called "OPM: OTG power mask" in the i.MX25
reference manual. Its description matches the description of "HPM: Host
power mask" for the host port which is bit 16, not 8.

The Linux kernel (as of 4.3) also has

	#define MX25_H1_PM_BIT                  BIT(16)

.

Fixes: a4076ddf65 ("USB i.MX: Add chipidea driver support")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-09 07:33:34 +01:00
Du Huanpeng 3eeac4d2ab fbconsole: move font variable into struct font_desc
replace font related variables with a struct pointer,
font_desc.

Signed-off-by: Du Huanpeng <u74147@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-09 07:26:23 +01:00
Sascha Hauer b97ac6bd41 Merge branch 'for-next/usb' 2015-11-06 16:10:44 +01:00
Sascha Hauer 6aed170ef1 Merge branch 'for-next/net' 2015-11-06 16:10:44 +01:00
Sascha Hauer b5c7b09c8a Merge branch 'for-next/mvebu' 2015-11-06 16:10:44 +01:00
Sascha Hauer 1d9295b344 Merge branch 'for-next/misc' 2015-11-06 16:10:42 +01:00
Sascha Hauer 3cdd30342b Merge branch 'for-next/memtest' 2015-11-06 16:10:37 +01:00
Sascha Hauer 5b476ef5e5 Merge branch 'for-next/imx' 2015-11-06 16:10:35 +01:00
Aleksey Kuleshov 6face0e8ab fb: alloc or free shadowfb whether fb enabled or disabled
Resolution can't be changed anyway once fb_enable() has been called,
since no corresponding fb_disable() call appears in the code.

Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-06 07:35:11 +01:00
Aleksey Kuleshov f72056d14e fb: satisfy semantics for shadowfb's alloc/free
Console enable -> alloc shadowfb.
Console disable -> free shadowfb.
Otherwise, if resolution gets changed, shadowfb will not be affected.

Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-06 07:35:11 +01:00
Aleksey Kuleshov 769ddc6133 fbconsole: no need to copy extra line
Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-06 07:35:11 +01:00
Anton Bondarenko 9956226fbb net: phy: wait for link OK after successfull autonegotiation
It may take some time for PHY to indicate link OK status after
autonegotiation completed. This change addresses this case
and prevent network commands fails due to the delay.

Signed-off-by: Anton Bondarenko <anton.bondarenko.sama@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-05 09:04:24 +01:00
Trent Piepho dbd7190295 mci: Print versions with micro levels correctly
The version is stored as BCD, e.g. 0x40 -> ".4" and 0x41 -> ".41".
The latter was getting printed as ".65".  Simplify the logic a bit to
not split the minor into nybbles just to re-assemble it into a byte
again.

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

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-03 07:27:44 +01:00
Peter Mamonov f1d4230a33 ata: disk_ata_drive: remove obsolete check for ID validity
The id check does not work on some newer drives.

Acked-by: Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-02 07:57:39 +01:00
Alexander Aring 51b0e90ec6 amba: check if on remove callback
Currently we get a null pointer dereference when booting linux on RPi
which use "uart-pl011" driver. This driver doesn't implement a remove
driver callback. This patch adds a check before calling the remove
callback if the driver which use the amba bus implement such
functionality.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-27 16:45:51 +01:00
Sascha Hauer 9b31b271ad video: ipuv3: Silence VPL message
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-27 11:48:53 +01:00
Sascha Hauer e65090ecc6 usb: ehci-hcd: Use regular mdelay()
The USB core will make sure we do not re-enter the ehci driver, so
we can use regular mdelay instead of mdelay_non_interruptible().

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-14 15:39:26 +02:00
Sascha Hauer 8f92eb2666 Revert "usb: ehci-hcd: detect re-entrance"
Now that the USB core makes sure that we do not re-enter USB
drivers we no longer have to detect re-entrancy in the ehci driver.

This reverts commit 8426cc641d.
2015-10-14 15:38:00 +02:00
Sascha Hauer 180370774f Revert "usb: ehci-hcd: use mdelay_non_interruptible()"
Now that the USB core makes sure that we do not re-enter USB
drivers we no longer need mdelay_non_interruptible() but can use
regular mdelay() again.

This reverts commit 4cfd909412.
2015-10-14 15:35:55 +02:00
Peter Mamonov e1d67aa40f usb: core: return -EAGAIN on usb_* functions reentrance
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-14 15:35:30 +02:00
Peter Mamonov 6b0cbf2059 input: usb_kbd: skip poll on -EAGAIN error
Skip poll if either usb_submit_int_msg() or usb_get_report()
returned -EAGAIN.

Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-14 15:35:30 +02:00
Lucas Stach 16f7b35138 video: simple-panel: depend on OFDEVICE
Fixes:
In function `simple_panel_ioctl':
undefined reference to `of_get_display_timings'

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-14 15:33:07 +02:00
Lucas Stach a5afa2d86c mtd: nand_denali: don't include arch header
It causes build failures on other arches than socfpga and the driver
doesn't use anything provided by this header.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-14 15:33:07 +02:00
Lucas Stach 36ef69578c input: usb-kbd: depend on CONSOLE_FULL
Fixes:
In function `usb_kbd_probe':
(usb_kbd_probe): undefined reference to `console_set_active'

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-14 15:33:07 +02:00
Sebastian Hesselbarth bf16227fe8 net: mvneta: add Armada XP compatible
Marvell NETA Network Engine found in Armada 370 and XP SoCs
also has a different compatible for Armada XP. Add the compatible
to the of_device_id list.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-12 08:14:11 +02:00
Sebastian Hesselbarth 2880f0ca74 clk: mvebu: Add corediv clock driver for Armada 370/XP
Newer Marvell MVEBU SoC like Armada 370/XP have an additional core
clock divider for e.g. NAND clock. Add the corresponding driver based
on the Linux driver.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-12 08:14:11 +02:00
Sascha Hauer 54bf386650 Merge branch 'for-next/usb' 2015-10-07 08:23:51 +02:00
Sascha Hauer 181bb315d0 Merge branch 'for-next/mtd' 2015-10-07 08:23:45 +02:00
Sascha Hauer c8fa7eed66 Merge branch 'for-next/misc' 2015-10-07 08:23:45 +02:00
Sascha Hauer 7bf2e891a4 Merge branch 'for-next/mips' 2015-10-07 01:01:06 +02:00
Sascha Hauer 8a83eca779 Merge branch 'for-next/mci' 2015-10-07 01:01:06 +02:00
Sascha Hauer ddd7031b97 Merge branch 'for-next/imx-ldb' 2015-10-07 01:01:06 +02:00
Sascha Hauer 160bd3b360 Merge branch 'for-next/imx' 2015-10-07 01:01:06 +02:00
Sascha Hauer 694c5b8794 Revert "spi: i.MX: optimize transfers for ECSPI v2.3"
This does not work on the Efika MX Smartbook which uses SPI
to connect the MC13892. Needs some rework.

This reverts commit 746a5530be.
2015-10-05 09:47:37 +02:00
Sascha Hauer 329db2f586 mci: core: Increase clock for SD highspeed mode
Putting a SD card into highspeed mode doesn't help much when we
still clock the card with 25MHz. Increase the clock speed to 50MHz
for high speed cards.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-02 14:34:26 +02:00
Antony Pavlov d0a5ea479e usb: core: drop unnecessary le16_to_cpu() conversion
In drivers/usb/core/usb.c we already have le16_to_cpus() conversion
just after usb_get_descriptor():

    390     /* correct le values */
    391     le16_to_cpus(&dev->descriptor->bcdUSB);
    392     le16_to_cpus(&dev->descriptor->idVendor);
    393     le16_to_cpus(&dev->descriptor->idProduct);
    394     le16_to_cpus(&dev->descriptor->bcdDevice);

so no additional idVendor/idProduct descriptor fields
le16_to_cpu() conversion is needed after that.

On the big-endian machines extra le16_to_cpu() conversion
leads to wrong idVendor/idProduct USB device parameters values
(e.g. see devinfo <usb-device> output), and to a much more
serious problem: idVendor/idProduct-based USB device detection
does not work.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-02 10:06:47 +02:00
Peter Mamonov b0ae09acda input: port usb keyboard driver from the u-boot
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-02 07:50:51 +02:00
Peter Mamonov 4cfd909412 usb: ehci-hcd: use mdelay_non_interruptible()
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-02 07:50:51 +02:00
Peter Mamonov 8426cc641d usb: ehci-hcd: detect re-entrance
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-02 07:50:51 +02:00
Peter Mamonov 4350744bf5 usb: ehci-hcd: port periodic transactions implementation from the u-boot
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-02 07:50:51 +02:00
Sascha Hauer 65894735e6 video: backlight-pwm: Add regulator support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-01 08:26:08 +02:00
Sascha Hauer 7bc30c8276 video: backlight-pwm: Add error message
Inform the user when we can't find a pwm for the backlight driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-01 08:26:07 +02:00
Sascha Hauer ec54ba6b31 video: ipuv3: print error message when no modes are found
This is a common error, so print a message to inform the user
what went wrong.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-01 08:26:07 +02:00
Sascha Hauer 80e3f29a58 video: simple-panel: Add support for device tree provided nodes
This adds support for display timings provided from device tree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-01 08:26:07 +02:00
Sascha Hauer 3dd4a3c747 video: simple-panel: Add debug/error messages
Let the driver be more informative when something goes wrong.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-01 08:26:07 +02:00
Sascha Hauer 7055047a34 video: ipuv3: imx-ldb: Support video modes in ldb node
We used to support video modes directly in the ldb device node, that
was lost in: 5bda17e video: ipuv3: Replace ipu_output with VPL.
Add this support back. Also drop duplicate vpl ioctl forwarding for
several calls.

With this patch modes can either be retrieved from the ldb node as
originally done or from the panel remote port.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-01 08:26:07 +02:00
Sascha Hauer dd80c5974b video: ipuv3: imx-ldb: remove unused variable
endpoint is set but not used. Remove the code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-01 08:26:07 +02:00
Sascha Hauer e8e387731b video: ipuv3: Do not crash when no mode is found
When something is missing in the device tree or not all necessary
drivers are compiled in it may happen that no valid mode is found.
Do not crash in this case but print an error message.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-01 08:26:07 +02:00
Fabio Estevam 704588632f video: imx-hdmi: Remove unused 'regmap' structure
As regmap is not used in Barebox we can remove this field
from the imx_hdmi struct.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-10-01 08:23:14 +02:00
Eric Bénard 39b0eb3b84 chipidea-imx: allow phymode configuration in pdata
it's currently only handled through DT and for i.MX25 OTG port (at least),
we need to configure portsc to get host mode working but it actually fails
as ci->phymode is 0 which is USBPHY_INTERFACE_MODE_UNKNOWN

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

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-23 17:12:44 +02:00
Enrico Jorns 16a6d8a674 mtd denali: pass col argument to READID operation
A read id operation followed by 0x00 reads the device ID while
a read id operation followed by 0x20 reads the possible ONFI identifier.

As the READID function did not propagate the second id parameter but had
a hard-coded call for 0x90 0x00, reading the ONFI identifier was not
possible and thus chips werde not detected (tested with
MT29F8G08ABABAWP)

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-23 10:35:37 +02:00
Enrico Jorns aca725cc86 mtd nand_denali: Add denali nand driver
The driver is based on the denali driver from the linux kernel

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

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

This patch adds a proper USB disconnect for gadget devices.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-23 10:31:33 +02:00
Antony Pavlov 15cc058c06 gpio: add ath79-gpio driver for Atheros MIPS SoCs
This driver is based on linux-4.2 driver.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-23 10:28:03 +02:00
Uwe Kleine-König 36152c5aa5 video: imx: assert that image buffer doesn't cross a 4 MiB boundary
The reference manual (for the i.MX25 in my case) states:

	This field must start at a location that enables a complete
	picture to be stored in a 4 Mbyte memory boundary (A [21:0]). A
	[31:22] has a fixed value for a picture’s image.

Check this condition for user-supplied framebuffer values and enforce it
for driver-allocated buffers.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-21 08:08:09 +02:00
Sascha Hauer e79fa9b5f0 i2c: fsl: Add bus recovery support
Useful for recovering busses. This needs additional device tree properties
describing the sda/scl gpios. The corresponding linux patch with the binding
description is currently under review.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-17 10:05:07 +02:00
Antony Pavlov 4d90f44e6e usb: storage: fix warning: no previous prototype for 'usb_stor_Bulk_clear_endpt_stall'
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-14 08:29:20 +02:00
Peter Mamonov fe02d7e6c8 usb: ehci-hcd: use is_timeout_non_interruptible()
Use is_timeout_non_interruptible() intead of is_timeout()
to avoid re-entering ehci-hcd functions from pollers,
registered by usb drivers.

Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-10 09:16:42 +02:00
Lucas Stach b654946ebc net: e1000: correct function signature of set_ethaddr
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-09 08:44:52 +02:00
Daniel Schultz 572e8cdfa3 drivers: mci: Add mci_get_device_by_name function
Get a 'struct mci' by search after the device name.

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

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-04 08:21:44 +02:00
Peter Mamonov 790584b769 usb: ehci-hcd: add OF bindings
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-09-04 08:05:11 +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
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 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 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 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 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
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 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
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
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
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