9
0
Fork 0
Commit Graph

3377 Commits

Author SHA1 Message Date
Sascha Hauer 39c6c3480a Merge branch 'for-next/mxs' 2015-01-09 17:38:26 +01:00
Sascha Hauer ff6383c8e4 Merge branch 'for-next/misc' 2015-01-09 17:38:26 +01:00
Sascha Hauer f5b8ea7cad Merge branch 'for-next/arm' 2015-01-09 17:38:26 +01:00
Antony Pavlov f9df80918d resource: dev_request_mem_region: fix return value for MIPS
The commit

    commit 0d7a213345
    Author: Antony Pavlov <antonynpavlov at gmail.com>
    Date:   Wed Sep 10 11:42:19 2014 +0400

        MIPS: dts: use physical addresses (as Linux does)

        With IOMEM() adapted for MIPS we can use physical addresses
        in device tree reg property.

has switched MIPS dts files to physical addresses usage.

The patch was tested on qemu, but qemu malta board is tolerant
of using physical addresses for accesing to device
(Ingenic JZ4755 and JZ4780 processors are tolerant too!).
But other CPUs (e.g. Loongson LS1B) can throw an exception
in this situation.

Additional physical address to virtual address translation
on MIPS is needed.

We already have this in include/common.h

    #if defined(CONFIG_MIPS)
    #include <asm/addrspace.h>

    #define IOMEM(addr) ((void __force __iomem *)CKSEG1ADDR(addr))
    #else
    #define IOMEM(addr) ((void __force __iomem *)(addr))
    #endif

So use IOMEM() to fix dev_request_mem_region() return value.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-09 17:09:47 +01:00
Masahiro Yamada d8753571b2 sizes.h: move include/sizes.h to include/linux/sizes.h
This file originates in Linux.  Linux has it under include/linux/
directory since commit dccd2304cc90.
Let's move it to the same place as well in barebox.

This commit was generated by the following commands:

  find -name '*.[chS]' | xargs sed -i -e 's:<sizes.h>:<linux/sizes.h>:'
  git mv include/sizes.h include/linux/

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-08 14:00:26 +01:00
Jean-Christophe PLAGNIOL-VILLARD 40662bbb59 driver: workaroud resource request that conflicts with errno PTR
broken since

commit ed6e965824
Author:     Sascha Hauer <s.hauer@pengutronix.de>
resource: Let dev_request_mem_region return an error pointer

Introduce dev_request_mem_region_err_null

only used on platform like at91 where the resource address conflicts
with errno PTR.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-08 08:07:58 +01:00
Sascha Hauer b2568de82d net: cpsw: ignore error on slave setup
The CPSW has two slaves. When one of them fails to setup continue
anyway with the other one. This fixes a crash in the beaglebone black
which only has one slave connected. The code doesn't find a phy on
the second slave and bails out, but the error path is broken: It frees
the private data structures which contains used resources.

Reported-by: Philippe Leduc <ledphilippe@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-06 15:11:59 +01:00
Robert Jarzmik fec4b79449 net: smc1111: fix memory congestions
As the SMC1111 has a shared pool of 2k memory buckets for both
transmission and reception, and as there are variants which have as few
as 4 buckets in total, the memory pool can be hogged by unclaimed
receptions, and impeed any further transmission.

This happens on the zylonite pxa board, where 4 packets, most probably
icmp and arp, fill the 4 buckets, preventing any further ethernet
transmission, and stalling the driver.

The fix is rather rough : whenever all the buckets are filled by
reception packets, and if a transmission is required, the transmission
code path will empty up all received packets.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-06 14:56:40 +01:00
Jan Weitzel c5151cae17 i2c: omap: fix fclk_rate for ti,omap4-i2c
The compatible "ti,omap4-i2c" don't help to get fclk_rate. So set it acording to
cpu compatible: "ti,am33xx" and "ti,omap4"

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-06 14:46:51 +01:00
Robert Jarzmik b9ac7f3049 net: smc1111: move print_packet function
Fix for a compiler complaint, because print_packet is needed by a
function before it is declared.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-05 13:12:17 +01:00
Lucas Stach 36138c6e1b net: rtl8169: remove unnecessary cache maintenance
The buffer descriptors are allocated from coherent memory, so there
is no cache maintenance needed. Only tell the compiler that the descriptors
can be modified by the hardware.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-05 12:52:37 +01:00
Sascha Hauer df9879c65d drivers: remove unnecessary mach/imx-regs.h include
And replace the ones needed with the SoC specific header.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-05 11:30:59 +01:00
Antony Pavlov fbb3be3845 clock: incorporate dummy clocksource into core clock code
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-12-17 12:15:11 +01:00
Lucas Stach 698f8dc533 video: imx-hdmi: search for DDC node only when EDID support is enabled
This uses i2c functions that may not be available in every configuration
and is only needed if EDID support is enabled, which in turn already
selects I2C.

Fixes:
drivers/video/imx-ipu-v3/imx-hdmi.c:
undefined reference to `of_find_i2c_adapter_by_node'

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-12-17 11:02:42 +01:00
Lucas Stach 8f0493d431 usb: gadget: fastboot: allow to build without BOOTM
This will disable the capability to boot an uploaded image directly,
but keeps other fastboot functionality. This seems like a valid config.

Fixes:
In function `do_bootm_on_complete': undefined reference to `bootm_boot'

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-12-17 11:02:42 +01:00
Lucas Stach e91702bd61 fdt: don't strip const qualifier
Fixes:
warning: assignment discards 'const' qualifier from pointer target type

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-12-11 08:37:09 +01:00
Sascha Hauer 7413dc4258 treewide: Fix typo collumn -> column
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-12-11 08:07:47 +01:00
Sascha Hauer b01bc4c810 Merge branch 'for-next/randconfig-1' 2014-12-08 14:54:11 +01:00
Sascha Hauer 9b1d12fff0 Merge branch 'for-next/randconfig' 2014-12-08 14:54:11 +01:00
Sascha Hauer c2b5a7015b Merge branch 'for-next/misc' 2014-12-08 14:53:59 +01:00
Sascha Hauer d3933bd350 Merge branch 'for-next/marvell' 2014-12-08 14:53:59 +01:00
Sascha Hauer 86916569a8 Merge branch 'for-next/imx' 2014-12-08 14:53:59 +01:00
Jan Luebbe 48ba0a1afd fdt: of_unflatten_dtb can work on const data
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-12-04 08:24:05 +01:00
Sascha Hauer 21c31b9de2 spi: mxs-spi: Allow compilation on i.MX28 only
The driver does not compile on i.MX23, so remove the i.MX23 from
the dependency list.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-28 15:21:26 +01:00
Sascha Hauer 90b90e2655 firmware: altera serial: depend on GENERIC_GPIO
The driver needs gpio support, so depend on GENERIC_GPIO

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-28 15:21:26 +01:00
Sascha Hauer 36d808c943 mci: mxs-mci: add f_min/f_max fields unconditionally
Parts of the driver need these regardless of whether CONFIG_MCI_INFO
is set, so add these fields unconditionally.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-28 15:21:26 +01:00
Sascha Hauer 3bfd83d0f1 gpio: clps711x: Add missing include
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-27 17:15:28 +01:00
Sascha Hauer 9969c68a89 USB: Gadget: fastboot: depends on command support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-27 17:15:19 +01:00
Sascha Hauer 6f4f1c31a6 USB: Gadget: Select poller from USB_GADGET option
The poller has been merged to the gadget core, so
now the core needs poller support, not the individual drivers.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-27 17:15:15 +01:00
Sascha Hauer cc347c3aac video: EDID: depends on I2C
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-27 17:15:05 +01:00
Sascha Hauer 08115be109 net: fec_imx: remove unused includes
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-27 17:14:54 +01:00
Lucas Stach 4373afc42a net: rtl8139: depend on MIPS
Until we sort out the dma-mapping mess.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-27 17:12:40 +01:00
Lucas Stach cdb0d02b87 rtc: select GREGORIAN_CALENDER
Fixes:
drivers/rtc/rtc-lib.c:109: undefined reference to `mktime'

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-27 17:12:39 +01:00
Lucas Stach 88628367db usb: musb: only build musb_barebox if host is enabled
musb_barebox.c contains code that is only ever used if CONFIG_MUSB_HOST
is set. Building it uncoditionally breaks the build depending on the link
order.

Fixes:
drivers/usb/musb/musb_barebox.c:64: undefined reference to `musb_urb_enqueue'

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-27 17:12:39 +01:00
Sascha Hauer f2142fb6da pinctrl: Add i.MX6sx compatible entry
To let the driver probe on i.MX6sx.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-27 11:25:28 +01:00
Sascha Hauer 5753074866 net: fec_imx: Add i.MX6sx compatible entry
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-27 11:25:13 +01:00
Sascha Hauer 6ed8916e90 serial: i.MX: Use "per" clk
Which is the correct clock for the baud rate.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-27 11:25:02 +01:00
Sascha Hauer 9e7c0e3176 mci: imx-esdhc: Add i.MX6sl compatible
Which will also be used for the i.MX6sx.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-27 11:24:58 +01:00
Sascha Hauer df17efad59 mci: imx-esdhc: Fix Interrupt enable register for i.MX6sx
The reset default of this register has changed on i.MX6sx. Explicitly
write the value we want to have to make it work on i.MX6sx.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-27 11:24:52 +01:00
Lucas Stach 0f1078d5cc usb: host: only activate Efika MX ULPI workaround if ULPI is selected
Fixes a build failure with disabled ULPI support.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-26 19:21:09 +01:00
Lucas Stach b1da773d9e net: ethoc: depend on OPENRISC
This driver currently only works on OpenRISC, as it uses
the cache flush/invalidate functions of this arch.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-26 19:21:09 +01:00
Dmitry Lavnikevich 54961378f0 imx6: clk: Gate off ENFC clock before setting clock rate
This fixes NAND initialization issue which appears occasionally on
some i.MX6 SoCs (particulary was observed on phyCARD-i.MX6 with
i.MX6Solo).

Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-26 16:43:12 +01:00
Lucas Stach 2d22fca0e7 usb: gadget: fastboot: select BANNER
Fastboot gadget needs the 'release_string' which is available only
if CONFIG_BANNER is set.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-24 14:04:11 +01:00
Lucas Stach 557b403d85 mci: esdhc: add back PIO_TIMEOUT
This got lost during bd1bf53b34
(mci: imx-esdhc: factor out common sdhci registers). Seems the PIO
option isn't too heavily used.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-24 14:04:10 +01:00
Lucas Stach 0d18871f4b video: ipuv3: select OFDEVICE for HDMI and LVDS
Both components need the OF display timings helpers.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-24 14:04:10 +01:00
Lucas Stach 0233462687 firmware: altera-serial: fix printf message
Fixes:
.../altera_serial.c:118:2: warning: too many arguments for format

Also sz is of type size_t, so use proper format specifier.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-24 14:04:07 +01:00
Lucas Stach b7782cc79f firmware: altera-serial: don't try to check void return value
Fixes:
.../altera_serial.c:84:6: error: void value not ignored as it ought to be

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-24 14:04:07 +01:00
Lucas Stach 7376942e46 firmware: altera-serial: depend on SPI
This driver uses SPI bus functions.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-24 14:04:06 +01:00
Lucas Stach b525454de5 firmware: socfpga: depend on ARCH_SOCFPGA
This driver uses a lot of arch specific functionality and
fails to build on anything but SOCFPGA.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-24 14:04:06 +01:00
Jan Weitzel c267e2dd73 mtd: ubi: get_bad_peb_limit from mtd master
Like mentioned in the coment we need the size of the entire flash chip.
Check if a master exists and take his size.

Otherwise the limit will be too small and kernel prints:
UBI warning: print_rsvd_warning: cannot reserve enough PEBs for \
bad PEB handling, reserved 19, need 20

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-20 14:53:42 +01:00
Jan Luebbe 78f20990ce dt: factor out common code
Currently, dt_struct is always checked with the same code after
dt_struct_advance(). Move the check after the switch statement.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-20 14:43:06 +01:00
Lucas Stach 16018ed7fe pci: tegra: relax link-up timeout
Some devices need a considerable amount of time
from reset deassertion until they are ready to
establish a link. Relaxing the link-up timeout
helps to detect them more reliable.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-17 08:35:58 +01:00
Lucas Stach 81e3bac877 pci: align bridge windows
The bridge filtering logic needs a minimum
alignment of 1MB for mem and 4KB for io resources.
Take this into account while assigning resources
to devices in oredr to not produce overlapping
windows between different bridges.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-17 08:35:54 +01:00
Lucas Stach cc9026585a pci: correct BAR size calculation
The previous math would return negative sizes
for some BARs.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-17 08:35:49 +01:00
Ezequiel Garcia c3f5ff5546 net: Add driver for Armada 370/XP 10/100/1000 Mbps network controller
This patch introduces the mvneta driver to support the network controller
found in Armada 370/XP SoCs.

Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-11 14:59:43 +01:00
Ezequiel Garcia 2caa4bbdcc net: phy: Support Marvell 88EE1543 PHY
This commit adds support for Marvell's 88E1543 PHY chip. This chip is
almost identical to the 88EE1545, except the 88E1545 supports QSGMII
and the 88EE1543 supports SGMII.

Therefore, the same configuration function is used for both PHYs. For now,
the only initialization provided for the 88EE1543 is the LED setup.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-11 14:59:43 +01:00
Ezequiel Garcia 9a026a2efa net: phy: Support Marvell 88EE1545 PHY
This commit adds support for Marvell's 88E1545 PHY chip. In particular, this
allows to support QSGMII interfaces.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-11 14:59:43 +01:00
Ezequiel Garcia d2731007bb net: phy: marvell: Fix array identation
Just a cosmetic clean-up to fix the indentation of the entries
in the phys array.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-11 14:59:43 +01:00
Alexander Shiyan 9a4cb25a39 treewide: Reuse init_clock() return value for clocksource drivers
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-10 08:42:19 +01:00
Thomas Petazzoni edbd3a6ecf pci: mvebu: Fix uninitialized variable in mvebu_get_target_attr()
This is the same fix that was applied to the Linux kernel in commit
56fab6e18944 (PCI: mvebu: Fix uninitialized variable in
mvebu_get_tgt_attr()).

Fixes: 5a9ba98 ("pci: mvebu: Add PCIe driver")
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-10 07:13:19 +01:00
Uwe Kleine-König 42bc1ac850 mtd: nand_orion: remove unused goto label
This fixes the following warning:

	drivers/mtd/nand/nand_orion.c: In function ‘orion_nand_probe’:
	drivers/mtd/nand/nand_orion.c:145:1: warning: label ‘no_res’ defined but not used [-Wunused-label]

Fixes: 1a215f5 ("nand: Add Marvell Orion NAND driver")
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-10 07:13:18 +01:00
Jan Luebbe ea5abfb5c1 of: use OFTREE_MEM_GENERIC for the sandbox
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-07 08:01:48 +01:00
Sascha Hauer 7b4cc54579 Merge branch 'for-next/tegra' 2014-11-05 15:47:39 +01:00
Sascha Hauer e3c49aac69 Merge branch 'for-next/misc' 2014-11-05 15:47:39 +01:00
Sascha Hauer 68d2850f86 Merge branch 'for-next/led' 2014-11-05 15:47:38 +01:00
Sascha Hauer 18ded420f7 Merge branch 'for-next/am335x' 2014-11-05 15:47:37 +01:00
Lucas Stach c202b7c8d9 clk: tegra: don't enable UART clocks by default
Now that we are registering a proper driver for the
UARTs we no longer need to enable the clocks unconditionally.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-04 12:16:52 +01:00
Lucas Stach b5ac88e8f6 serial: ns16550: add Tegra support
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-04 12:16:52 +01:00
Lucas Stach 2c779cbe97 serial: ns16550: enable clock if available
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-04 12:16:52 +01:00
Lucas Stach d712ce1824 pinctrl: tegra: add XUSB pad controller
This is a combined pincontrol/PHY driver for
the SerDes lanes on Tegra K1.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-04 12:16:51 +01:00
Lucas Stach 3e41e7561a clk: tegra: slow down MSELECT to 102MHz
Don't know where I got the 204MHZ previously, but
102MHz is the official supported maximum.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-04 12:16:51 +01:00
Lucas Stach 8b2456a4cb pinctrl: tegra: try to select "boot" state
New DTs call the initial pinctrl state "boot" in
order to avoid Linux reconfiguring the pinctrl
by default. The bootloader should explicitly set
this state.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-04 12:16:51 +01:00
Lucas Stach af7c753f2e pci: tegra: add tegra124 support
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-04 09:50:44 +01:00
Lucas Stach 9d1fbc5d12 add generic PHY framework
This brings in the generix PHY framework from Linux.
I tried to strip it down as much as possible while
keeping it useful.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-04 09:50:44 +01:00
Lucas Stach e000cbeb7a clk: tegra124: add PCIe clocks
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-04 09:50:43 +01:00
Lucas Stach e2ac763d0f clk: tegra124: add PLLE setup functions
This adds functions to bring up the new style
Tegra114+ PLL_E.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-04 09:50:43 +01:00
Teresa Gámez 3249a71b26 of: Add of_device_enable_and_register functions
Function to enable and register a disabled device.
The devices can be registered using the
device node with of_device_enable_and_register() or
with the device node name/path by using the
of_device_enable_and_register_by_name() function.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-03 15:44:18 +01:00
Alexander Shiyan c0d6aa097d serial: ns16550: Remove unused fields from NS16550_plat structure
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-03 13:26:11 +01:00
Lucas Stach 7d60a02034 net: rtl8169: clean receive buffer after net handler
The processing of the buffer might change some data, which
will eventually trigger a cache writeback later on, corrupting
data written by the network chip. Clean the cache range
to make sure there is no writeback pending.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-03 09:36:30 +01:00
Lucas Stach fd378e779b net: rtl8169: add support for RTL-8168/8111g
This is the version of the chip found on Jetson-TK1.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-03 09:36:24 +01:00
Antony Pavlov bc4312717b Typoes: "whith" -> "with"
This patch is based on linux kernel commit

    commit e1b8513d21845fbeb93d6d2c4973db874385059f
    Author: Robert P. J. Day <rpjday@crashcourse.ca>
    Date:   Sun Feb 3 15:14:02 2008 +0200

        Typoes:  "whith" -> "with"

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Cc: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-03 09:18:20 +01:00
Wadim Egorov 30427fb2da net: cpsw: Set phy device_node pointer in probe
Set the phy device_node pointer to the equivalent cpsw slave node.
We need this, because phy drivers using this pointer for their configuration.

Create and register the phy device in cpsw_probe(), so that this phy device
can be found later by phy_device_connect() in cpsw_open().

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-03 08:18:10 +01:00
Wadim Egorov d75ff89817 net: phy: micrel: Add OF conf. support for ksz9031
Adds support for ksz9031 PAD skew configuration over devicetree.
Based on a patch from the linux kernel.

Author: Hubert Chaumette <hchaumette@adeneo-embedded.com>
Original commit: 6e4b82730c7525504fc485b370c7f09e594e2e96

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-03 08:18:10 +01:00
Lucas Stach 5b4e4ebcf8 clk: gate: remove superfluous code
This code didn't have any effect.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-21 13:08:46 +02:00
Lucas Stach dfa6b3e46c i2c: at91: fix invalid length check
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Acked-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-21 13:08:02 +02:00
Lucas Stach 672a4972dd dfu: fix possible usage of uninitialized var
The error path would in fact use the status
variable without it being initialized first.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-21 13:02:48 +02:00
Lucas Stach c677976c07 imx: ipu-v3: fix typo leading to build warning
This PAGE_SIZE clearly should not be there.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-21 13:02:48 +02:00
Dmitry Voytik d8f5a28be3 usb: ehci-hcd: Correct CLEAR_FEATURE code
This commit broke USB on olinuxino board:

  87b9bea USB: host: hub: Use usb_hub_power_on from U-Boot

This patch was ported from U-Boot with small changes. See discussion:
http://lists.denx.de/pipermail/u-boot/2013-May/153920.html

The root cause seems to be a missing mask and missing 'break' in
ehci-hcd.c. Fix both.

Signed-off-by: Dmitry Voytik <voytikd@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-21 12:57:25 +02:00
Teresa Gámez c145001464 net: cpsw: Fix probe for one port ethernet
If only one port is pinned out, probe fails
as the second port phy_id is not found.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-14 11:19:17 +02:00
Sascha Hauer 42327b23a7 led: trigger: Turn of flashing leds only once
The current code continuously turns leds off. Preserve the current
led status so that we only turn it off once.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 16:04:32 +02:00
Sascha Hauer b63faaa2e2 led: trigger: use max_value to turn on led instead of hardcoded '1'
For PWM LEDs '1' may be really dark. Use max_value instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 16:04:27 +02:00
Jan Weitzel 83620fb6eb net: micrel: Add ksz8081 support
Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 11:08:31 +02:00
Jan Weitzel 58d33ca124 net: cpsw: Allow gigabit connection
Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 11:08:31 +02:00
Lucas Stach b64b24db75 net: add rtl8169 driver
This adds the driver for RealTek 8169 and compatible
pci attached network chips.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 08:39:02 +02:00
Lucas Stach 18ff087fca pci: add Tegra host controller driver
Only tested on Tegra30 for now.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 08:39:01 +02:00
Lucas Stach 2840294a51 of: import pci range parser from linux
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 08:39:01 +02:00
Lucas Stach 4e4d40c1ae i2c: tegra: move to fs initcall
i2c is needed to enable voltage rails that are later
needed by other drivers.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 08:39:01 +02:00
Lucas Stach 72f493e3e6 clk: tegra30: add PCIe clocks
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 08:39:01 +02:00
Lucas Stach aa2e6ca831 clk: tegra: add PLLE setup functions
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 08:39:01 +02:00
Lucas Stach 490d4fe417 pci: track parent<->child relationship
So that PCI devices hang down from bridges and root
bridges down from the PCI host controller when
calling devinfo.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 08:39:01 +02:00
Lucas Stach 48f88df158 pci: prettyprint device names
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 08:39:01 +02:00
Lucas Stach b8a1bb1dd2 pci: defer device registration until after bridge setup
Otherwise the drivers for a device may probe before the
devices parent bridge is fully configured, which leads
to errors when accessing the BARs.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 08:39:01 +02:00
Lucas Stach 687ceb7716 pci: setup bridges and traverse buses behind them
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 08:39:01 +02:00
Lucas Stach beb6469992 pci: properly populate prefetchable BARs
Some host controllers provide a prefetchable
memory area and devices will prefer this for
some of their BARs.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 08:39:01 +02:00
Lucas Stach 06ac5b551e pci: add resource enum
Makes things way clearer than juggling numbers.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 08:39:00 +02:00
Lucas Stach 72d9846fa6 pci: split out device init
To make it reusable and the code more readable.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 08:39:00 +02:00
Sascha Hauer 86ef8cb8fb input: Let input support depend on !CONSOLE_NONE
Without console support the input devices make no sense, so add
a depends on !CONSOLE_NONE.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 08:11:02 +02:00
Sascha Hauer 0d03667db7 Merge branch 'for-next/ubi' 2014-10-02 08:54:43 +02:00
Sascha Hauer fa93e4fb60 Merge branch 'for-next/resource-err-ptr' 2014-10-02 08:54:42 +02:00
Sascha Hauer 52a0febb3d Merge branch 'for-next/phycore-imx6' 2014-10-02 08:54:42 +02:00
Sascha Hauer 6209c24274 Merge branch 'for-next/openrisc' 2014-10-02 08:54:42 +02:00
Sascha Hauer 9d7cd03e2a Merge branch 'for-next/of' 2014-10-02 08:54:42 +02:00
Sascha Hauer 815288c598 Merge branch 'for-next/net-phy' 2014-10-02 08:54:42 +02:00
Sascha Hauer a65334019b Merge branch 'for-next/musb' 2014-10-02 08:54:42 +02:00
Sascha Hauer 868de66f8d Merge branch 'for-next/mtd' 2014-10-02 08:54:42 +02:00
Sascha Hauer 8c746628fe Merge branch 'for-next/misc' 2014-10-02 08:54:42 +02:00
Sascha Hauer 0846940668 Merge branch 'for-next/marvell' 2014-10-02 08:54:41 +02:00
Sascha Hauer 2a2a8b9052 Merge branch 'for-next/imx' 2014-10-02 08:54:41 +02:00
Sascha Hauer d0064495d3 Merge branch 'for-next/firmware' 2014-10-02 08:54:41 +02:00
Sascha Hauer 9fd083eae1 Merge branch 'for-next/dmesg' 2014-10-02 08:54:41 +02:00
Sascha Hauer 61bf20dcc6 Merge branch 'for-next/at91' 2014-10-02 08:54:41 +02:00
Teresa Gámez 0abb68b107 i2c: omap: fix dts property "clock-frequency" usage
Looking at the linux kernel the clock-frequency property of
the device tree is used to set the bus speed and not the
fclk_rate. Adapted this to be compliant with linux kernel.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-02 07:50:16 +02:00
Teresa Gámez e5707ec702 of: Added of_set_property_to_child_phandle
Set a property to a phandle of a child node. This may be used
for selections like display-timings.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-01 08:13:02 +02:00
Teresa Gámez d1d7876499 of: base: Add of_parse_phandle_from
Added of_parse_phandle_from() to be able to use external root nodes.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-01 08:13:02 +02:00
Teresa Gámez 55475204cd of: base: Add of_find_node_by_phandle_from
Added of_find_node_by_phandle_from() to find nodes by
phandle with a given root node.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-01 08:13:02 +02:00
Sascha Hauer 930ce6e142 Introduce message logging support
This adds a buffer for log messages and a 'dmesg' command to
print the messages. The log buffer is implemented as log objects
rather than a string buffer. This makes it easy to implement
limiting the messages, cleaning the buffer and timestamping
the messages.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-30 15:33:22 +02:00
Sascha Hauer 6850ccff66 USB: MUSB: Add barebox specific changes
This changes the MUSB support from the original Kernel state to
be usable with barebox. Tested on a custom board and the Beaglebone
Black. The host port on the Beaglebone works, the OTG port works
in device mode, but not yet in host mode.

Based on the initial MUSB port from Rolf Evers Fischer.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-26 21:36:58 +02:00
Sascha Hauer 12aeca8373 USB: Add MUSB driver from Linux
This adds the necessary files from the MUSB driver directly from Linux
3.17-rc5. No changes to the original files have been made so far.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-26 21:36:58 +02:00
Sascha Hauer 98cbf263bd USB: gadget: allow multiple udc drivers
Since the MUSB driver will have it's own directory the Kconfig
entries won't be in drivers/usb/gadget/Kconfig. This is incompatible
with the current 'choice' approach for udc drivers. The udc drivers
do not implement the global usb_gadget_poll() anymore, so we can
drop the choice and allow multiple gadget drivers.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-26 21:36:57 +02:00
Sascha Hauer 18d588da74 USB: gadget: put poller into core
Instead of letting each driver implement usb_gadget_poll directly
implement this function in the core which then calls into the
drivers.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-26 21:36:54 +02:00
Sascha Hauer 01beb0d5f2 USB: add usb phy header file
Mostly taken from the Linux Kernel to ease porting phy
handling code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-26 08:49:21 +02:00
Sascha Hauer b1536a3298 USB: gadget: dfu: Add max_speed to dfu_driver
The MUSB driver checks for this field. If it doesn't contain
something useful the driver bails out.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-25 16:25:46 +02:00
Sascha Hauer bab50309e7 USB: gadget: fastboot: Add missing include
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-25 16:25:02 +02:00
Raphaël Poggi 25bffd8a9a of: fdt: fix typo in header
Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-25 08:12:01 +02:00
Bo Shen 791ff495fb I2C: at91: fix the method for interrupt
As the i2c-at91 driver won't work in the interrupt mode,
so need to poll the interrupts.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-25 08:10:56 +02:00
Raphaël Poggi a0ca2c13f6 i2c: at91: add support of device tree
Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-25 08:10:56 +02:00
Raphaël Poggi ccc282fb1b i2c: at91: add at91sam9x5 config
Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-25 08:10:56 +02:00
Raphaël Poggi d78e8051f3 i2c: at91: fix coding style issue
Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-25 08:10:56 +02:00
Bo Shen 739c91e1c4 net: macb: enable GEM with only FE feature
If the GEM is used, however only FE featuren enabled, then it can not
support FBLDO configured as 16, and no RGMII/GMII configuratin bit.

So, in order to support GEM only with FE feature enabled, we do:
  - using default value for FBLDO.
  - using same bit for RMII/MII configuration as GEM for RGMII/GMII.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-24 06:46:52 +02:00
Franck Jullien 9f0133d489 Subject: [PATCH] cfi: print size in human readable format
The CFI size is now printed in a human readable format.
It also adds "0x" prefix to the printed address.

Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-24 06:44:26 +02:00
Bo Shen 71692f1538 mci: atmel: add new ip version 0x600 support
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-22 06:59:42 +02:00
Bo Shen b18d562321 nand: atmel: runtime to generate galois table
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-22 06:59:35 +02:00
Lucas Stach 2e4640448c net: asix: handle packets crossing URB boundaries
ASIX AX88772B started to pack data even more tightly. Packets and the ASIX packet
header may now cross URB boundaries. To handle this we have to introduce
some state between individual calls to asix_rx_fixup().

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ Rolf: ported from kernel to barebox 2014.09.0 ]
Signed-off-by: Rolf Evers-Fischer <embedded24@evers-fischer.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-22 06:54:45 +02:00
Sebastian Hesselbarth 561dfebb4b ARM: mvebu: Add machine compatible to mbus ranges
Multi-SoC support for MVEBU will add mbus ranges for all compiled
SoCs. To protect the mbus node of the SoC barebox is executed on
from others ranges, pass machine's compatible to mvebu_mbus_add_range
and check before applying the fixup.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-19 09:47:35 +02:00
Sascha Hauer 1b4c08d2f2 net: phy: don't use 'dev' as name for variables of type struct phy_device
Using 'dev' as name for variables which are not of type
struct device(_d) is bad habit and leads to confusions. Use phydev
instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-18 08:41:16 +02:00
Sascha Hauer 1b5086995e net: phy: Use xzalloc for small allocations
No need to call kzalloc for small allocations, xzalloc will do without
the need for an additional check.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-18 08:40:55 +02:00
Sascha Hauer e209158d5a net: phy: introduce phy_aneg_done
phy_wait_aneg_done() is directly called by the network code, so it
should not read phy registers directly. Introduce phy_aneg_done to
give phy drivers the chance to do something different to poll for
autonegotiation completion.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-17 15:12:56 +02:00
Lucas Stach 1dbf849de7 phy: marvell: move IDs to own header
So they can be used in board files to register
fixups.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-17 11:16:44 +02:00
Jan Weitzel 7e094dd2e2 phy/micrel: disable Asym_Pause support
With SUPPORTED_Asym_Pause enabled we need to hotplug the ethernet cable.
So disable it like done with PHY_ID_KSZ9021.

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Christian Hemp <c.hemp@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-17 08:53:25 +02:00
Sascha Hauer d5a82eb095 resource: Let request_ioport_region return an error pointer
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-16 08:32:10 +02:00
Sascha Hauer ed6e965824 resource: Let dev_request_mem_region return an error pointer
For all users fix or add the error check.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-16 08:32:10 +02:00
Sascha Hauer 5bdc82c54a resource: Let dev_request_mem_region_by_name return an error pointer
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-16 08:32:10 +02:00
Sascha Hauer 29b7f95f3b resource: Let dev_get_mem_region return an error pointer
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
2014-09-16 08:32:10 +02:00
Sascha Hauer 9d518ba397 resource: Let dev_get_resource return an error pointer
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-16 08:32:09 +02:00
Sascha Hauer dde56d42ad resource: Let request_iomem_region return an error pointer
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-16 08:32:09 +02:00
Sascha Hauer a00e634ac6 resource: Let dev_get_mem_region_by_name return an error pointer
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-16 08:32:09 +02:00
Sascha Hauer 92cc1b1f9e resource: Let dev_get_resource_by_name return an error pointer
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-16 08:32:06 +02:00
Sascha Hauer 92fd6af347 pinctrl: fix Kconfig dependencies
- Remove OFDEVICE dependency from PINCTRL. It won't do
  much then, so add a comment to Kconfig when PINCTRL is
  selected without OFDEVICE
- Let Architectures only select PINCTRL instead of the
  particular driver. Change the drivers to 'default y if $SOC'
  to make sure the drivers are still compiled if the corresponding
  SoC is selected

This fixes Kconfig warnings like:

warning: (PINCTRL_ARMADA_370 && PINCTRL_ARMADA_XP && PINCTRL_DOVE && PINCTRL_KIRKWOOD) selects PINCTRL which has unmet direct dependencies (OFDEVICE)

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
2014-09-15 07:17:06 +02:00
Sascha Hauer 0efa92fdca input: imx_keypad: remove unused variable
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-12 11:59:00 +02:00
Sascha Hauer dbea5e0e35 ata: platform_ide: cleanup resource requesting
- use dev_request_mem_region to simplify code
- check return values and bail out

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-12 09:50:09 +02:00
Richard Weinberger 20e2c9642b UBI: bugfix in ubi_wl_flush()
Use the _safe variant because we're iterating over a list where items get
deleted and freed.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2014-09-11 15:53:29 +02:00
Richard Weinberger 3158048272 UBI: init_volumes: Ignore volumes with no LEBs
UBI assumes that ubi_attach_info will only contain ubi_ainf_volume
structures for volumes with at least one LEB.
In scanning mode this is true because UBI can nicely create a ubi_ainf_volume
on demand while creating the EBA table.

For fastmap this is not true, the fastmap on-flash structure has a list of
all volumes, the ubi_ainf_volume structures are created from this list.
So it can happen that an empty volume ends up in init_volumes().

We can easely deal with that by looking into ->leb_count too.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2014-09-11 15:53:28 +02:00
Brian Norris 305b1bbea9 UBI: fastmap: do not miss bit-flips
The return value from 'ubi_io_read_ec_hdr()' was stored in 'err', not in 'ret'.
This fix makes sure Fastmap-enabled UBI does not miss bit-flip while reading EC
headers, events and scrubs the affected PEBs.

This issue was reported by Coverity Scan.

Artem: improved the commit message.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2014-09-11 15:53:27 +02:00
Heiko Schocher 6dbc4e658c UBI: fix the volumes tree sorting criteria
Commig "604b592 UBI: fix rb_tree node comparison in add_map"
broke fastmap backward compatibility and older fastmap images
cannot be mounted anymore. The reason is that it changes the
volumes RB-tree sorting criteria. This patch fixes the problem.

Artem: re-write the commit message

Signed-off-by: Heiko Schocher <hs@denx.de>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2014-09-11 15:53:27 +02:00
Mike Snitzer 6503dd7370 UBI: fix rb_tree node comparison in add_map
The comparisons used in add_vol() shouldn't be identical.  Pretty sure
the following is correct but it is completely untested.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2014-09-11 15:53:26 +02:00
Tanya Brokhman c457880e0d UBI: fix ubi free PEBs count calculation
The ubi->free_count should be updated with every insert/remove to/from
the ubi->free list.

Signed-off-by: Tanya Brokhman <tlinder@codeaurora.org>
Reviewed-by: Dolev Raviv <draviv@codeaurora.org>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2014-09-11 15:53:26 +02:00
Tanya Brokhman d8c4628977 UBI: fix error path in __wl_get_peb
In case of an error (if there are not free PEB's for example),
__wl_get_peb will return a negative value. In order to prevent access
violation we need to test the returned value prior to using it later on.

Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org>
Reviewed-by: Dolev Raviv <draviv@codeaurora.org>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2014-09-11 15:53:25 +02:00
Dan Carpenter eaa73bfe02 UBI: fix some use after free bugs
Move the kmem_cache_free() calls down a couple lines.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2014-09-11 15:53:25 +02:00
Qi Wang 王起 (qiwang) e621ee94ba UBI: avoid program operation on NOR flash after erasure interrupted
nor_erase_prepare() will be called before erase a NOR flash, it will program '0'
into a block to mark this block. But program data into a erasure interrupted block
can cause program timtout(several minutes at most) error, could impact other
operation on NOR flash. So UBIFS can read this block first to avoid unneeded
program operation.

This patch try to put read operation at head of write operation in
nor_erase_prepare(), read out the data.
If the data is already corrupt, then no need to program any data into this block,
just go to erase this block.

This patch is validated on Micron NOR flash, part number is:JS28F512M29EWHA

Signed-off-by: Qi Wang <qiwang@micron.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2014-09-11 15:53:24 +02:00
Julia Lawall 1c8847c13f UBI: fix error return code
Set the return variable to an error code as done elsewhere in the function.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}

// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: Richard Weinberger <richard@nod.at>
2014-09-11 15:53:24 +02:00
Antony Pavlov 0662205894 net: dm9k: fix copy-paste typo
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-11 08:02:47 +02:00
Sascha Hauer e04540821b Firmware: socfpga: Add SoCFPGA FPGA program support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-09 10:30:26 +02:00
Juergen Beisert 3a7b7f26a6 Firmware: provide a handler to program Altera FPGAs
This handler uses a regular SPI master and a few GPIOs to program an
Altera FPGA in serial mode.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-09 10:30:25 +02:00
Antony Pavlov 9a585cd732 openrisc: add initial device tree support
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Cc: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-09 10:20:30 +02:00
Antony Pavlov 3ef903c1c5 net: ethoc: add device tree support
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Cc: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-09 10:20:29 +02:00
Sebastian Block b7014e9819 mtd: add mtdram device (which build mtd over ram area - useful for FRAM oder MRAM)
Change since v1 (Sascha, thanks for review):
	* use xzalloc instead of kzalloc and control check
	* correct help and names
	* fix coding style issue
	* remove verbose and unneeded messages

This adds support for MTD in RAM devices (like FRAM or MRAM).

Signed-off-by: Sebastian Block <basti@linux-source.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-09 09:52:53 +02:00
Ezequiel Garcia 8e1314b890 nand: orion: Limit to Kirkwood platform
This driver is only available on Kirkwood SoCs, so add proper dependency.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-09 09:52:53 +02:00
Raphaël Poggi 5dc6c89d84 pinctrl: at91: retrieve device id in non dtb probe
We need to retrieve the device id in device tree/non device tree case.

Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-09 08:07:46 +02:00
Raphaël Poggi 9c885a2a6f pinctrl: at91: fix the pin_to_controller function
Other functions use pin_to_controller to retrieve a at91_gpio_chip structure,
so fix pin_to_controller to return the correct value.

Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-09 08:07:45 +02:00
Raphaël Poggi 97323085a5 pinctrl: at91: add driver data
This commit adds the driver data for the gpio-at91 driver.

Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-09 08:07:45 +02:00
Philipp Zabel dc82bce50b serial: imx: Fix for non-devicetree boards
Commit 3843bfd0ab
"serial: imx: Determine device name from device tree"
broke this driver for non-devicetree boards, since
of_alias_get may not be called with a NULL pointer
as first argument.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-05 07:43:29 +02:00
Sascha Hauer c96a4f2831 Merge branch 'for-next/marvell' 2014-09-05 07:32:56 +02:00
Raphaël Poggi 71ff9bfebd pinctrl: at91: add pinctrl driver
This driver is based on mach-at91/gpio.c and linux pinctrl driver.
The driver contains the gpio and pinctrl parts (like in linux) because the two parts
share some structures and logics.

Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-04 11:25:04 +02:00
Raphaël Poggi d2f7aab114 mtd: atmel_nand: add support for device tree
Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-03 08:57:57 +02:00
Raphaël Poggi 54bccadddd mtd: atmel_nand: retrieve ecc_mode from pdata
By retrieving the ecc_mode from pdata we can use the same code for device tree and
non device tree probing. Which was not possible before, because ecc_mode was arbitrarily set to
NAND_ECC_SOFT.

Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-02 11:03:22 +02:00
Raphaël Poggi af8e7d3a6e mtd: nand: add has_pmecc member
By adding this structure member, we can retrieve the pmecc config, through the device tree.

Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-02 09:02:40 +02:00
Beniamino Galvani a4f0146e0e pinctrl: rockchip: add support for new DT bindings
This patch modifies the Rockchip pinctrl driver to comply with the new
DT bindings, which use two syscon nodes to specify the address of
memory resources.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-01 14:24:52 +02:00
Beniamino Galvani 671b98952e mfd: syscon: add device tree support
This patch defines a OF compatible property for the syscon driver to
allow it to be probed from device tree.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-01 14:24:52 +02:00
Ezequiel Garcia 1a215f5329 nand: Add Marvell Orion NAND driver
This commit adds NAND support for the controller present in Kirkwood SoCs.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-01 11:30:50 +02:00
Sascha Hauer 45615e3ec1 Merge branch 'for-next/usb-host'
Conflicts:
	drivers/usb/core/Makefile
2014-08-07 20:34:39 +02:00
Sascha Hauer 7782c08047 Merge branch 'for-next/usb-gadget'
Conflicts:
	commands/Makefile
	common/Kconfig
	common/Makefile
	drivers/usb/gadget/dfu.c
2014-08-07 20:34:28 +02:00
Sascha Hauer 038be0fbb5 Merge branch 'for-next/usb' 2014-08-07 13:13:47 +02:00
Sascha Hauer 9cce00617b Merge branch 'for-next/rtc'
Conflicts:
	arch/mips/dts/jz4755.dtsi
	commands/Makefile
2014-08-07 13:13:45 +02:00
Sascha Hauer 80779337ef Merge branch 'for-next/net' 2014-08-07 13:13:35 +02:00
Sascha Hauer 38c3b2455e Merge branch 'for-next/misc'
Conflicts:
	lib/Makefile
2014-08-07 13:13:31 +02:00
Sascha Hauer 5b7b7ee5d9 Merge branch 'for-next/metadata'
Conflicts:
	arch/arm/dts/Makefile
	common/Makefile
	lib/Makefile
2014-08-07 06:15:16 +02:00
Sascha Hauer f1ee4e8b73 Merge branch 'for-next/marvell' 2014-08-07 06:14:59 +02:00
Sascha Hauer c138893990 Merge branch 'for-next/led' 2014-08-07 06:14:59 +02:00
Sascha Hauer f64760777b Merge branch 'for-next/i2c' 2014-08-07 06:14:58 +02:00
Sascha Hauer 8a11a59b37 Merge branch 'for-next/efi'
Conflicts:
	.gitignore
	Makefile
	drivers/serial/Makefile
2014-08-07 06:14:56 +02:00
Sascha Hauer 90118343e4 Merge branch 'for-next/console' 2014-08-07 06:14:18 +02:00
Sascha Hauer 3522192d6d Merge branch 'for-next/canon' 2014-08-07 06:14:18 +02:00
Sascha Hauer 3cfa4bc00c move file helper functions to separate file
We have our file helper functions in several places. Move them
all to lib/libfile.c.
With this we no longer have file helpers in fs/fs.c which contains
the core fs functions and no functions in lib/libbb.c which are
not from busybox.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-08-07 06:13:51 +02:00
Raphaël Poggi 6696e95bf5 of_mtd: add soft_bch and hw_oob_first ecc modes
Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-08-04 20:52:14 +02:00
Ezequiel Garcia 11b34ab22f bus: mvebu: fix ranges fixup
The current fixup code is slightly wrong, and only works when the
root address cell number is one.

However, Armada XP has a root address cell number of two. In this case
we are currently applying the fixup on the child high base address,
while it should be applied on the child low base address.

Fix it and add some detailed explanation to avoid having to figure this
out each time.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-08-04 20:48:44 +02:00
Antony Pavlov 365d26e462 rtc: add jz4740 driver
Add support for the RTC unit on Ingenic JZ4740, JZ475x and JZ477x SoCs.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-08-02 06:45:43 +02:00
Antony Pavlov 287e085fa9 rtc-lib: import rtc_time_to_tm() from linux-3.15
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-08-02 06:45:43 +02:00
Antony Pavlov 686df208b3 rtc: import ds1307 driver from linux-3.15
Current ds1307 rtc driver supports only ds1307 and ds1338 chips;
it has no nvram support at the moment.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-08-02 06:45:43 +02:00
Sascha Hauer 14963b8c46 Merge branch 'for-next/i2c' into HEAD 2014-08-02 06:45:39 +02:00
Sascha Hauer 2bcb9fec6b mtd: omap gpmc: fix bch8 nand-ecc-opt property
We interpret the ECC option "bch8" as OMAP_ECC_BCH8_CODE_HW, but the
Kernel uses OMAP_ECC_BCH8_CODE_HW_ROMCODE in this case instead. To make
the interpretation of the ti,nand-ecc-opt property compatible to the
Kernel we have to use OMAP_ECC_BCH8_CODE_HW_ROMCODE for "bch8"

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-08-01 15:24:39 +02:00
Sascha Hauer c574b4e76b mtd: omap gpmc: reserve 14 byte/subpage for ECC in BCH8 romcode
As done in the Kernel. The Kernel has a comment this is done to
be compatible with the ROM code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-08-01 15:24:39 +02:00
Sascha Hauer 00f119a293 mtd: omap gpmc: fix ecc bytes/size
The ecc bytes / size are per subpage, not per page.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-08-01 15:24:39 +02:00
Sascha Hauer 79fa5783b8 of_partition: devfs_add_partition returns an error pointer
Check for the return value of devfs_add_partition with IS_ERR.
Otherwise we dereference a NULL pointer when devfs_add_partition
fails.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-08-01 08:31:47 +02:00
Antony Pavlov 2145a2c0ba watchdog: i.MX: check requested mem region in imx_wd_probe()
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-08-01 07:35:51 +02:00
Antony Pavlov b549a26fc3 watchdog: add minimal jz4740 driver
Also move reset_cpu() for jz4755 SoC from platform code
into the new driver code.

At the moment mach-xburst lacks clk support so jz4740 watchdog
driver looks like a template. We can improve jz4740 watchdog
driver later after adding clk support.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-08-01 07:35:51 +02:00
Antony Pavlov c36d1431b2 led: triggers: fix "no previous prototype for 'trigger_init'" warning
Here is compiler's message:

    drivers/led/led-triggers.c:148:5: warning: no previous prototype for 'trigger_init' [-Wmissing-prototypes]
    int trigger_init(void)
        ^

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-31 08:03:01 +02:00
Antony Pavlov e66190f4f7 led: triggers: fix crash on disabling "default-on" trigger
Here is a sample crash log on Ritmix RZX-50:

    barebox:/ trigger
    0: panic
    1: heartbeat
    2: net rx
    3: net tx
    4: net
    5: default on (led 0)
    barebox:/ trigger -d 5
    ...
    Ooops, TLB miss on store!

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-31 08:03:01 +02:00
Antony Pavlov f66e9dd041 i2c: busses/Makefile: fix indentation
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-31 07:54:03 +02:00
Antony Pavlov 8e6468e4b2 i2c: add Marvell 64xxx driver
This driver is also used for Allwinner SoCs I2C controllers.

Ported from linux-3.15.

The most notable barebox driver version changes:

  * drop platform device stuff;
  * drop "allwinner,sun*" stuff;
  * drop message offloading support;
  * add reg-io-width devicetree parameter to use driver
    with byte-oriented controller versions.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
On Armada XP:
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-31 07:53:20 +02:00
Ezequiel Garcia 6e71e070da net: phy: Add minimal support for QSGMII PHY
Based on Linux's support by Thomas Petazzoni:

    commit b9d12085f2f531fdea67f0361564e0812696227c
    Author: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
    Date:   Tue Apr 15 15:50:19 2014 +0200
    net: phy: add minimal support for QSGMII PHY

    This commit adds the necessary definitions for the PHY layer to
    recognize "qsgmii" as a valid PHY interface. A QSMII interface, as
    defined at
    http://en.wikipedia.org/wiki/Media_Independent_Interface#Quad_Serial_Gigabit_Media_Independent_Interface,
    is "is a method of combining four SGMII lines into a 5Gbit/s
    interface. QSGMII, like SGMII, uses LVDS signalling for the TX and RX
    data and a single LVDS clock signal. QSGMII uses significantly fewer
    signal lines than four SGMII busses."

    This type of MAC <-> PHY connection might require special handling on
    the MAC driver side, so it should be possible to express this type of
    MAC <-> PHY connection, for example in the Device Tree.

    Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
    Cc: devicetree@vger.kernel.org
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-31 07:37:12 +02:00
Ezequiel Garcia f81c936cc8 net: phy: mdio-mvebu: Make the clock property required
This property is wrongly documented as 'optional', although all the
ethernet units need a clock to be enabled in order to access the MDIO
interface. For that reason, this commit makes the property a required
one and fails to probe the device, when a clock is not properly provided.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-31 07:37:12 +02:00
Ezequiel Garcia 889105eee0 net: phy: Add fallbacks for the obsoletes phy DT properties
In addition to the standard 'phy-handle' devicetree property, the binding
specifies two properties, which are considered obsolete: 'phy' and 'phy-device'.
This commit adds support for them in of_mdio_find_phy().

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-31 07:37:12 +02:00
Antony Pavlov ed98f1522d Add a simple rtc framework
This patch adds a simple rtc framework
for reading and setting board's RTC time.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-31 07:30:51 +02:00
Sebastian Hesselbarth 5a9ba98f21 pci: mvebu: Add PCIe driver
This adds a PCI driver for the controllers found on Marvell MVEBU SoCs.
Besides the functional driver itself, it also adds SoC specific PHY
setup required for PCIe. Currently, only Armada 370 is fully supported.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-31 07:29:24 +02:00
Sebastian Hesselbarth 846da3d7df of: pci: import of_pci_get_devfn()
Marvell MVEBU PCIe driver requires of_pcie_get_devfn(), import it from
Linux.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-31 07:29:22 +02:00
Sebastian Hesselbarth 916ca9472f pci: set auto-incremented bus number
When using more than one PCI bus, we have to assign unique numbers
to each bus. Use an auto-incremented bus index and assign it to
each registered bus. Also, allow the PCI host controller to update
internal registers by calling set_busno with assigned bus number.

While at it, add pci_controller struct to set_busno callback,
add a back reference to pci_controller to pci_bus, and clean up
unused left-overs from Linux import.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-31 07:29:17 +02:00
Sebastian Hesselbarth e5a91ee544 pci: ensure device does ignore BAR mangling
Disable access to PCI devices I/O and memory regions while
mangling BAR registers.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-31 07:29:12 +02:00
Sebastian Hesselbarth 166a6ba955 pci: register device after BAR setup
As soon as pci_register_device is called, a potential driver
will access its registers. This requires BARs to be set up
properly, so move pci_register_device after BAR setup.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-31 07:28:55 +02:00
Sebastian Hesselbarth b7ffe9ad0e pci: pci_scan_bus: respect 64b BARs
In PCI 64-bit BARs span two 32-bit BARs, therefore if BAR type
indicates a 64-bit BAR we have to skip the next BAR register.
While at it, also set proper IORESOURCE flags for I/O and
32b MEM.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-31 07:27:16 +02:00
Sebastian Hesselbarth 722e90e32a bus: mvebu: fix resource size handling
A resource_size is defined as res->end - res->start + 1. Marvell
MBUS driver gets some ranges from DT as start and size but mis-calculates
end of range. This fixes 4 occurences of those mistakes.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-31 07:26:34 +02:00
Antony Pavlov 1f789df993 gpio: add driver for Canon DIGIC
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-29 15:08:29 +02:00
Antony Pavlov fd00d693cc serial: add driver for Canon DIGIC UART
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-29 15:08:29 +02:00
Antony Pavlov bbd477644d clocksource: add driver for Canon DIGIC timer
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-29 15:07:35 +02:00
Antony Pavlov 03a2269509 led: try to get LED's label from the 'label' property
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-29 14:31:30 +02:00
Bo Shen 366f64ff1b mci: core: the sd1.0 card can work in 4 bits mode
The sd 1.0 card can work in 4 bits mode also.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-29 14:30:59 +02:00
Markus Pargmann e69dca92f8 mfd: mc34704: Add DT support
Add a compatible to this driver so it can be added through devicetree.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-29 08:22:05 +02:00
Antony Pavlov 92466472c2 usb: ehci: use linux-way ehci_readl and ehci_writel
Also drop nowhere defined CONFIG_EHCI_DESC_BIG_ENDIAN.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-28 07:35:01 +02:00
Sebastian Hesselbarth b8d2d4923f USB: host: add xHCI PCI driver
This adds a driver for PCI-attached xHCI controllers.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-28 07:31:18 +02:00
Sebastian Hesselbarth 237bad9cc7 USB: host: add xHCI HCD, Hub, and platform driver
This adds support for xHCI USB 3.0 host controllers found on various
SoCs and PCI devices. Currently, the driver only supports the virtual
USB 2.0 ports of the host controller, so if you plan to use USB 3.0
devices, put a USB 2.0 cable in between.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-28 07:31:18 +02:00
Sebastian Hesselbarth 343ccff163 USB: EHCI: use min3 from Linux
EHCI HCD has a private version of min3() determining the smallest
number out of 3. We already have min()/max() imported from Linux,
also get min3()/max3() and use it instead of EHCI's private one.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-28 07:31:18 +02:00
Sebastian Hesselbarth 418add62c1 USB: improve error paths and tear-down
USB core isn't too strict about allocation/deallocation and
add/remove sequences of usb devices. Especially, error paths
and device tear-down are kind of broken and cause hangs on
failing usb device detect.

This patch improves the situation by introducing a
usb_free_device() that tears down allocated resources by
usb_alloc_new_device(). usb_remove_device() now only deals
with resources that have been added by usb_new_device().
Also, error handling is fixed or improved to ensure that no
devices are unregistered that have not been previously
registered.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-28 07:31:18 +02:00
Sebastian Hesselbarth 8938752dd8 USB: Count detected USB devices independent of dev_index
Adding a usb device increases dev_index every time a new device is
allocated. Removing a usb device does not decrease again, of course.
As we print the number of detected usb devices after each usb bus
scan based on dev_index, we cannot trust dev_index here. Keep track
of the correct number of (currently) detected usb devices by
introducing an independent dev_count that gets increased on detect
and decreased on remove.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-28 07:31:18 +02:00
Sebastian Hesselbarth 422cd55ca8 USB: Fix stale usb devices in usb_device_list
New usb devices are added to a list of usb devices, but when removing
the corresponding usb_device it was not removed from that list. Fix it
by deleting it properly from the usb_device_list.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-28 07:31:17 +02:00
Raphaël Poggi 11db6dff49 i2c: add Atmel AT91 driver
Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-25 09:07:35 +02:00
Sebastian Hesselbarth 315e1a4138 ARM: mvebu: allow to fixup mbus ranges
On Marvell MVEBU SoCs internal registers are usually remapped from reset
default. While Dove and Kirkwood always had their registers remapped,
some Armada 370 and XP where shipped with bootloaders that did not remap
them.

On Barebox these registers are remapped early and on all MVEBU SoCs, so
provided DTs should always reflect that in their mbus ranges property.

This patch registers a fixup for DTBs and allows individual SoCs to add
specific remap ranges to the fixup list. The fixup is registered on
pure_initcall to even allow to fixup pbl or appended DTBs.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-25 08:59:00 +02:00
Sebastian Hesselbarth 6931e9007c USB: Use descriptors from ch11.h
Use the descriptors from ch11.h instead of duplicating them
in usb.h. usb_hub_descriptor now contains a union .u to differentiate
HS hub descriptor from SS hub descriptor.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-24 08:57:57 +02:00
Sebastian Hesselbarth f261bce3a6 USB: EHCI: use descriptor length fields
Instead of hard-coding descriptor length, pick it from the
corresponding descriptor.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-24 08:57:57 +02:00
Sebastian Hesselbarth 756c95b764 USB: EHCI: make use of defines for descriptors
Now that we have a full set of defines for each descriptor field,
make use of it for the EHCI HCD descriptors.

This fixes endianess issues for .device.bcdUSB, .device.bcdDevice,
.config.wTotalLength, and .endpoint.wMaxPacketSize.

Also, .endpoint.bInterval was set to 0 instead of 255 due to a
copy-and-paste error while assigning u8[] to usb_endpoint_descriptor.

This also is a preparation for including ch11.h later, which has
a modified usb_hub_descriptor for USB 3.0.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-24 08:57:57 +02:00
Sebastian Hesselbarth 3c91719f14 USB: EHCI: reuse ch9.h config and interface descriptors
Now that usb_config_descriptor and usb_interface_descriptor are clean
of any additional fields, drop the duplication in EHCI code and use
the default ones.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-24 08:57:57 +02:00
Sebastian Hesselbarth 60ebedf1e7 USB: Move FooRequest defines and add class requests
{Device,Interface,Endpoint}Requests are currently defined in private
ehci.h but are also useful for other drivers than ehci-hcd. Move them
to usb/usb_defs.h and also add some more class requests.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-24 08:57:57 +02:00