9
0
Fork 0
Commit Graph

3176 Commits

Author SHA1 Message Date
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 08d86870b2 Merge branch 'for-next/mips' 2014-10-02 08:54:41 +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
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
Teresa Gámez 1e19346e97 of: base: Add for_each_node_by_name_from
Added for_each_node_by_name_from() to be able to
pass external 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 96cae61eba clock: Add a variable with the first timestamp after startup
For measuring the startup time it's useful to save the first
timestamp after the clocksource has been registered.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-30 10:44:15 +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 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
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 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
Antony Pavlov 1feeb8da0d common.h: use special IOMEM() for MIPS
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-09-11 07:59:45 +02:00
Juergen Beisert a6982e2e26 Add a Firmware programming framework
This framework handles a list of registered Firmware programming handlers
to unify a firmware programming interface by hiding the details how
to program a specific Firmware in its handler. This is created with FPGAs
in mind but should be usable for other devices aswell.
A user has two possibilities to load a firmware. A device file is create
under /dev/ which can be used to copy a firmware to. Additionally a
firmwareload command is introduced which can list the registered firmware
handlers and also to upload a firmware.

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
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 f64760777b Merge branch 'for-next/i2c' 2014-08-07 06:14:58 +02:00
Sascha Hauer 50d10b224e Merge branch 'for-next/env' 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 97e81f2d78 Add support for metadata in barebox images
It's often useful to get some information about a barebox image
before starting or flashing it. This patch introduces barebox
Image MetaData (IMD). When enabled a barebox image will contain
a list of tags containing the desired information. We have tags
for:

- the barebox release (2014.07.0-00160-g035de50-dirty)
- the build timestamp (#741 Mon Jul 28 15:08:54 CEST 2014)
- the board model the image is intended for
- the device tree toplevel compatible property

Also there is an additional generic key-value store which stores
parameters for which no dedicated tag exists. In this patch it
is used for the memory size an image supports.

Since there is no fixed offset in a barebox image which can be
used for storing the information, the metadata is stored somewhere
in the image and found by iterating over the image. This works
for most image types, but obviously not for SoC images which are
encoded or encrypted in some way.

There is a 'imd' tool compiled from the same sources for barebox,
for the compile host and for the target, so the metadata information
is available whereever needed.

For device tree boards the model and of_compatible tags are automatically
generated.

Example output of the imd tool for a Phytec phyFLEX image:

build: #889 Wed Jul 30 16:08:54 CEST 2014
release: 2014.07.0-00167-g6b2070d-dirty
parameter: memsize=1024
of_compatible: phytec,imx6x-pbab01 phytec,imx6dl-pfla02 fsl,imx6dl
model: Phytec phyFLEX-i.MX6 Duallite Carrier-Board

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-08-07 06:13:52 +02:00
Sascha Hauer 28ce918d96 read_file: introduce read_file_2
read_file has some limitations:

- It is not possible to check the error code since read_file returns
  NULL for failure
- It is not possible to limit the buffer size to sensible limits.

This patch introduces read_file_2 which doesn't have these limitations.
read_file becomes a wrapper around read_file_2.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-08-07 06:13:52 +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
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
Sascha Hauer 14963b8c46 Merge branch 'for-next/i2c' into HEAD 2014-08-02 06:45:39 +02:00
Juergen Borleis 72ce27f8e0 envfs: change API to be able to forward special flags into the envfs superblock
In order to be able to mark an stored envfs image with special features
(intentional ignore for example), we now can feed forward these flags.
By forwarding a '0' for the flags nothing changes because the envfs superblock
was already allocated with xzalloc.

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-08-01 08:24:00 +02:00
Juergen Borleis c4c7b16588 envfs: provide an intentional way to ignore an existing external environment
Add a simple flag to envfs to be able to mark an external environment as
"not to be used".
This change should not affect existing systems, because the current envfs
implementation ensures the 'flags' member in the envfs master block is always
zeroed.

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-08-01 08:24:00 +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
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
Antony Pavlov 6d3fc76b77 lib: import 'bcd' from linux-3.15
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 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
Markus Pargmann ccdf13af24 include/bbu: Add missing include errno.h
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-29 08:22:31 +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 7df5350362 include: import {lower,upper}_32_bits helpers
This imports {lower,upper}_32_bits defines to allow to get upper
and lower 32b part of a 64b number.

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 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 7d643b416d USB: remove redundant defines from usb_defs.h
We imported a bunch of defines with ch9.h and ch11.h that are now
duplicated in usb_defs.h. Get rid of each duplicate in usb_defs.h
and prefer the ones from ch9.h and ch11.h.

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 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 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
Sebastian Hesselbarth f4e7910195 USB: fixup usb_hub_descriptor length name
All other descriptors have their length field named bLength, except
imported usb_hub_descriptor from Linux uses bDescLength. Adjust the
name to match the others.

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 73476de0e0 USB: reduce USB_MAXCHILDREN on imported ch11.h
Barebox supports up to 8 USB devices attached on a Hub, Linux does 31.
Reduce the USB_MAXCHILDREN define in ch11.h to the Barebox one and
put a comment above.

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 bfea72da82 USB: import ch11.h from Linux
Linux has an extra include for chapter 11 (Hub Specification) of USB 2.0
spec. We already have a ch9.h, so import the one from Linux.

Barebox specific changes will be patched up later.

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
Sascha Hauer bfb7aa1e19 USB: gadget: Add a multi function gadget
Similar to the Kernel multi function this gadget driver is used
for creating a USB device with multiple functions. This is
created and removed with the newly created 'usbgadget' command.
Based on the options it creates combinations of DFU, fastboot
and serial USB functions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-24 08:32:56 +02:00
Sascha Hauer 3d5080aae9 USB: gadget: Add Android fastboot support
The Android fastboot protocol Can be used to update firmware and to
issue other lowlevel commands to the bootloader. This adds a
fastboot implementation based on the U-Boot fatboot code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-24 08:32:56 +02:00
Sascha Hauer 0bd652f62a Add release string
Currently we only have version_string which contains information
about the date the binary was compiled and by whom it has been
compiled. This adds a release_string which only contains the
plain release version.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-22 08:11:58 +02:00
Sascha Hauer ade522c6dd USB: gadget: DFU: register as USB function
Register DFU as usb_function_instance to make it work with composite
gadgets. Also use this internally for registering as DFU device (with
the 'dfu' command).

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-22 08:11:49 +02:00
Sascha Hauer 057a57448d Add function to parse a string in dfu format
The dfu command parses a string which contains a list of
devices and flags. This format is useful for other users
aswell, so add common helper functions to parse it and
let the dfu command use this format.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-22 08:11:08 +02:00
Sascha Hauer 55ebc38493 USB: gadget: DFU: Move locally used defines/structs to dfu driver
There's no reason to have them under include/

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-22 08:09:48 +02:00
Sascha Hauer 62735eec55 USB: gadget: specify vendor/product id with device parameters
This introduces the device parameters:

usbgadget.product
usbgadget.vendor
usbgadget.manufacturer
usbgadget.productname

These variables are used to configure the USB vendor id, product id,
manufacturer name and product name.

Previously these were configured with arguments to the usbserial
and dfu command. The parameters are device static, so it's nice to
configure it somewhere in the environment instead of when calling
dfu/usbserial. Also when other gadget drivers are added we do not
have to duplicate the option parsing further.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-22 08:09:28 +02:00
Sascha Hauer 32f4bd130c param: Add dev_add_param_string
This function allows drivers to create a string parameter and
provides access to it via a pointer. Using regular dev_add_param
only allows access via dev_get_param().

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-22 08:09:23 +02:00
Sascha Hauer d113857d2b USB: gadget: composite: Break out of potential endless loop
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-22 08:09:04 +02:00
Sascha Hauer 2776d53d7a USB: gadget: Update to 3.15
This updates the USB Gadget stack to Linux-3.15.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Conflicts:
	drivers/usb/core/Makefile
2014-07-22 08:08:44 +02:00
Sascha Hauer 5ec16bea1a Merge branch 'for-next/console' into for-next/usb-gadget 2014-07-22 08:07:10 +02:00
Sascha Hauer 4c05bb1445 Merge branch 'for-next/misc' into for-next/usb-gadget 2014-07-22 08:06:44 +02:00
Sascha Hauer 81a2205228 USB: host: drop force rescan
We can now detect changes in the USB device hierarchy properly, so
the 'force' option to the usb command is no longer necessary. We just
scan the busses each time the usb command is called.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-18 14:50:21 +02:00
Antony Pavlov 9fc0d34763 commands: usb: add tree view capability
This patch adds U-Boot 'usb tree' command functionality to barebox.

Here is an example output:

  1 ID 0000:0000
  |  u-boot EHCI Host Controller
  |
  +-2 ID 05e3:0606
    |   USB2.0 Hub
    |
    +-3 ID 10c4:ea60
    |    Silicon Labs CP2102 USB to UART Bridge Contr P-00-00669
    |
    +-4 ID 05e3:0606
    | |   USB2.0 Hub
    | |
    | +-5 ID 05e3:0608
    | | |   USB2.0 Hub
    | | |
    | | +-6 ID 0d8c:000c
    | |       C-Media USB Headphone Set
    | |
    | +-7 ID 0d8c:000c
    |       C-Media USB Headphone Set
    |
    +-8 ID 0846:1040
         NETGEAR NETGEAR FA120 Adapter

The tree view is enabled with 'usb -t'

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-18 14:48:27 +02:00
Sascha Hauer 0420f7a34f USB: i.MX chipidea: Implement OTG support for the poor
For situations when we don't know the desired mode for the OTG port
we register a otg device which has a mode parameter to specifiy the
desired mode on the command line.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-18 14:47:25 +02:00
Sascha Hauer 9451a44433 USB: Remove conflicting USB_SPEED_* definitions
We have USB_SPEED_* definitions as macros in usb_defs.h and as an enum
in ch9.h. The defines in usb.h correspond to hardware bits in the
ehci controller. Get rid of them and keep the hardware independent
enums.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-18 14:42:35 +02:00
Sascha Hauer f0a1a84d7d USB: Use descriptors from ch9.h
Use the descriptors from ch9.h instead of duplicating them
in usb.h

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-18 14:42:35 +02:00
Sascha Hauer 245069bcef USB: introduce usb_interface/usb_configuration structs
Currently we have two conflicting definitions of struct usb_config_descriptor
and struct usb_interface_descriptor in the tree. This is because the USB code
uses additional fields in the structs for internal housekeeping. Add
struct usb_interface and struct struct usb_configuration with the housekeeping
data and embed the corresponding hardware structs into them. This frees the
way to use the definitions from ch9.h in the next step.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-18 14:42:35 +02:00
Sascha Hauer 757377a9ab lib: Add bitmap functions from kernel
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-17 23:01:15 +02:00
Sascha Hauer 92df1ff5f1 include: update bitop functions from kernel
Updates the bitop functions from v3.16-rc4

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-17 19:00:27 +02:00
Sascha Hauer 90ff524be3 include: Add foreign endianess adding functions from kernel
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-17 07:45:56 +02:00
Sascha Hauer 77bd64d1fd include: Add round_up/round_down macros from kernel
Yes, we already have roundup/rounddown. Unlike these macros
round_up/round_down are optimized to (and only work with)
power-of-2 arguments. It's a poor name, but kernel code needs
it, so add it to barebox aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-17 07:45:55 +02:00
Sascha Hauer 36d837d791 include: Add DECLARE_BITMAP from kernel
Some code operating on bitmaps needs it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-17 07:45:55 +02:00
Sascha Hauer 54889bff1e introduce verbose debug
During debugging it sometimes helps to me even more verbose. This
adds an additional debug level for this. Also we remove an already
existing pr_vdebug definition in the USB gadget u_serial driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-17 07:42:58 +02:00
Jean-Christophe PLAGNIOL-VILLARD 9183a8c683 EFI: introduce efi_strguid to convert GUID to human readable names
use in devinfo Protocols

Tested today on qemu with all the GUID translated

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-16 10:46:19 +02:00
Sascha Hauer 1dff7e414d Add initial EFI architecture support
This adds support for running barebox in an EFI environment
on X86 PC hardware.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-16 10:46:18 +02:00
Antony Pavlov e4f94541ba gpio: add driver for PCA95[357]x, PCA9698, TCA64xx, and MAX7310 SMBus I/O expanders
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-14 08:04:04 +02:00
Antony Pavlov bfea711b14 i2c: import SMBus stuff from linux
This patch imports i2c_smbus_{read,write}* functions from linux-3.15.

Here is a quote from linux.git/Documentation/i2c/smbus-protocol:

    If you write a driver for some I2C device, please try to use the SMBus
    commands if at all possible (if the device uses only that subset of the
    I2C protocol). This makes it possible to use the device driver on both
    SMBus adapters and I2C adapters (the SMBus command set is automatically
    translated to I2C on I2C adapters, but plain I2C commands can not be
    handled at all on most pure SMBus adapters).

So having i2c_smbus_{read,write}* functions in barebox makes
porting of linux i2c client drivers much easier as many drivers rely on
these smbus functions.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-14 08:04:04 +02:00
Sascha Hauer 7e2de7dc67 efi: Add more error codes
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-14 08:01:11 +02:00
Sascha Hauer 66f1030e11 filetype: Add DOS EXE file detection support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-14 08:01:11 +02:00
Sascha Hauer 17d1f9288c Move efi.h to include/
With upcoming EFI payload support the efi.h file will diverge
from the kernel, so move it from include/linux/ to include/

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-14 08:01:11 +02:00
Sascha Hauer 2d9d230089 block: Add flush callback
Some block devices need an explicit callback for flushing written
blocks. Add this callback.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-14 08:01:11 +02:00
Sascha Hauer 2e82822d08 Add beginning wchar support
EFI uses 16 bit character strings. Add beginning support for this.
Since barebox uses 8 bit strings internally we need conversion functions
to convert between 16 bit and 8 bit strings.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-14 08:01:06 +02:00
Sascha Hauer 9c4f107c35 console: Allow persistent device names
Add a devname field to struct console_device so that the device
name can be set by the driver. This makes it possible to have
persistent device names.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-11 09:58:36 +02:00
Sascha Hauer 36d3cc49fb Add hex_byte_pack and hex_byte_pack_upper from kernel
Utility functions needed by the UUID/GUID printf support.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-11 08:15:47 +02:00
Sascha Hauer 241c6a017b console: Add puts callback to console devices
Some devices may have a much more efficient way to output strings
rather than single characters. Let console devices implement a
callback for this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-11 08:15:40 +02:00
Sascha Hauer 76c0935726 Make IPaddr_t a 32bit type
unsigned long is 64bit wide on some architectures. Make IPaddr_t a
typedef to uint32_t to make sure it's 32bit wide.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-11 08:14:33 +02:00
Wadim Egorov 50c081e093 barebox: common: added new filetypes
- Added omap CH image header recognition
  * filetype_ch_image
  * filetype_ch_image_be

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-09 14:11:23 +02:00
Sascha Hauer 6acc6bc627 malloc.h: fix codingstyle
- Remove trailing newline
- use void *fn instead of void* fn

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-09 07:38:12 +02:00
Sascha Hauer 7d9311aa84 dlmalloc: remove unused functions
remove unused function declarations and definitions:

- vallocc is #if 0 in source code
- pvalloc is defined but not used
- cfree is defined but not used
- malloc_usable_size is unused
- mallopt is not defined
- mallinfo is not defined

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-09 07:38:12 +02:00
Antony Pavlov 3b02705ad2 rtc.h: drop unused U-Boot stuff; fix whitespace
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-07 08:21:46 +02:00
Sascha Hauer 874b8ac790 Merge branch 'for-next/net' 2014-07-04 17:27:11 +02:00
Sascha Hauer efa4d684d8 Merge branch 'for-next/misc'
Conflicts:
	arch/arm/boards/chumby_falconwing/falconwing.c
	arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c
	arch/x86/mach-x86.dox
	scripts/setupmbr/setupmbr.c
2014-07-04 17:27:06 +02:00
Sascha Hauer 45d593bc5e Merge branch 'for-next/mips' 2014-07-04 17:26:05 +02:00
Antony Pavlov a7c925bf03 net: add RealTek RTL-8139 PCI Ethernet driver
This driver is based on Linux 2.6.39 8139too driver.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-04 07:35:47 +02:00
Antony Pavlov 7420866543 PCI: initial commit
used shorten version of linux-2.6.39 pci_ids.h

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-04 07:35:47 +02:00
Antony Pavlov e829b7c0c8 linux/ioport.h: include missed <linux/list.h>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-04 07:35:47 +02:00
Sascha Hauer 6dd613f1bc string_list: Add string_list_for_each_entry macro
To ease iterating over a string_list.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-03 09:39:16 +02:00
Antony Pavlov c0808d7b69 net.h: add ETH_ALEN constant; fix whitespaces
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-02 07:47:58 +02:00
Sascha Hauer 98360be0fe Documentation: remove doxygen documentation
The doxygen documentation is long outdated. Remove it. It will
be replaced with sphinx based documentation later.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-06-26 10:09:52 +02:00
Antony Pavlov 3ad9434f2f i2c: i2c_gpio: add devicetree support
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-06-25 08:34:48 +02:00
Herve Codina f2e86a2964 param: Add support for long long read only dev param
Signed-off-by: Herve Codina <Herve.CODINA@celad.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-06-13 06:27:34 +02:00
Sascha Hauer 0831642edc Merge branch 'for-next/usb' 2014-06-04 21:04:28 +02:00
Sascha Hauer ad9f56888f Merge branch 'for-next/tegra' 2014-06-04 21:04:28 +02:00
Sascha Hauer 73339649ae Merge branch 'for-next/net-of-phy' 2014-06-04 21:03:49 +02:00
Sascha Hauer a3dfea9af8 Merge branch 'for-next/net'
Conflicts:
	drivers/net/dm9k.c
2014-06-04 21:03:45 +02:00
Sascha Hauer 6ec2780419 Merge branch 'for-next/imx'
Conflicts:
	arch/arm/configs/tx25stk5_defconfig
2014-06-04 21:01:40 +02:00
Sascha Hauer 2d13b034a2 Merge branch 'for-next/doc' 2014-06-04 21:01:16 +02:00
Lucas Stach f20e3eb414 mci: implement non-removable property
There is no need to check the card-detect status
for non-removable devices.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-06-04 07:21:17 +02:00
Sascha Hauer 75635f6926 net: phy: remove now unused of_phy_device_connect
Since barebox handles phys from devicetree transparently we no longer
need of_phy_device_connect.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-23 15:40:51 +02:00
Antony Pavlov 12e8ad39b1 usb: drop unused USB_UHCI_*_ID macros
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-22 08:11:24 +02:00
Antony Pavlov ff66a70c74 usb: remove unimplemented usb_get_dev_index() declaration
We do not have usb_get_dev_index() function, so remove this declaration.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-22 08:11:24 +02:00
Sascha Hauer d384b5639f of: Drop devicetree merge support
I assume I am the only person knowing that barebox is able to
merge devicetrees. This feature seems broken for a while now since
trying to merge devicetress results in:

unflatten: too many end nodes

Remove this feature to save the complexity.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-22 08:09:13 +02:00
Sascha Hauer 4778c7da37 net: phy: Support limiting phy speed in the devicetree
Even when both the ethernet controller and the phy support certain
features a board may have additional limitations. Allow specifying
it in the devicetree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-21 14:42:17 +02:00
Sascha Hauer e275b2653f complete: Add devicetree completion
The of_* commands take devicetree nodes as parameters. Add a
devicetree completion function to ease passing nodes to these
commands.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-19 22:23:56 +02:00
Sascha Hauer 214f0d9264 mfd: mc13xxx: Allow to set callback for mc13xxx
Some boards have to initialize the PMIC before other devices can
be initialized. This requires three levels of initcalls: one level
in which the PMIC is probed, one in which the board can call mc13xxx_get()
and the third one to initialize the PMIC dependent devices.

Allow to register a callback which is called once the PMIC is initialized.
This way mc13xxx_get() is no longer necessary and the number of required
initcalls levels is reduced to two.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-19 08:36:33 +02:00
Steffen Trumtrar 852867e078 syscon: fix prototype compile error
gcc 4.8.3 throws the following error

include/mfd/syscon.h: In function 'syscon_base_lookup_by_pdevname':
include/mfd/syscon.h:22:1: error: parameter name omitted
 static inline void __iomem *syscon_base_lookup_by_pdevname(const char *)

Fix it by adding the name to the function prototype.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-16 08:04:22 +02:00
Lucas Stach 45b95b50cd reset: add reset controller framework
Add stripped sown version of the reset controller
framework from the Linux kernel.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-15 14:17:11 +02:00
Sascha Hauer be0404c21f net: Allow to use multiple network interfaces at once
In barebox network packets always go out at the current ethernet
device and are expected to be received from the current interface.
This has some side effects. When for example an NFS is mounted when
one interface is active and the interface is changed afterwards the
NFS packets leave the new interface, but the NFS server won't be
reachable there.

Instead of changing the whole network traffic to the current ethernet
interface we now initialize a network connection with the current
network interface, but then the connection will continue to use that
interface even when the current interface is changed.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-15 08:16:30 +02:00
Sascha Hauer 22b878d251 net: Pass eth_device to net_receive
So that barebox has the information which interface a packet
came from.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-15 08:15:21 +02:00
Holger Schurig f1f532084a commands: harmonize in-barebox documentation
This patch does probably too much, but it's hard (and very
cumbersome/time consuming) to break it out. What is does is this:

* each command has one short description, e.g. "list MUX configuration"
* made sure the short descriptions start lowercase
* each command has one usage. That string contains just the
  options, e.g. "[-npn]". It's not part of the long help text.
* that is, it doesn't say "[OPTIONS]" anymore, every usable option
  is listed by character in this (short) option string (the long
  description is in the long help text, as before)
* help texts have been reworked, to make them
  - sometimes smaller
  - sometimes describe the options better
  - more often present themselves in a nicer format
* all long help texts are now created with BUSYBOX_CMD_HELP_
  macros, no more 'static const __maybe_unused char cmd_foobar_help[]'
* made sure the long help texts starts uppercase
* because cmdtp->name and cmdtp->opts together provide the new usage,
  all "Usage: foobar" texts have been removed from the long help texts
* BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this
  is nicer in the source code
* BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself
* made sure no line gets longer than 77 characters
* delibertely renamed cmdtp->usage, so that we can get compile-time
  errors (e.g. in out-of-tree modules that use register_command()
* the 'help' command can now always emit the usage, even without
  compiled long help texts
* 'help -v' gives a list of commands with their short description, this
  is similar like the old "help" command before my patchset
* 'help -a' gives out help of all commands

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-14 10:03:43 +02:00
Franck Jullien 478d9ffe45 asm-generic: add IO memory accessors
Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-14 09:05:03 +02:00
Holger Schurig ab23d0bb3f commands: group 'help' output
The old output of "help" was just producing a long list, that usually
scrolled of the screen (even on a X11 terminal). This list is more
compact, and also sorted by groups.

The old output format (plus grouping) is now available with 'help -v'.

Example:

   Information commands:
     ?, devinfo, help, iomem, meminfo, version
   Boot commands:
     boot, bootm, go, loadb, loads, loadx, loady, saves, uimage
   ...

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-14 07:59:55 +02:00
Christoph Fritz 5a4d617a1c common: fix macro WARN
Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-13 10:28:28 +02:00
Antony Pavlov 03c0e1511e stdlib.h: include missed types.h
We use 'u32' type in stdlib.h so we have to include types.h.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-07 08:23:08 +02:00
Sascha Hauer 7b7631791e Merge branch 'for-next/tegra'
Conflicts:
	arch/arm/dts/tegra20-colibri.dtsi
	arch/arm/dts/tegra20-paz00.dts
	arch/arm/dts/tegra20.dtsi
	drivers/clk/tegra/clk-periph.c
2014-05-05 13:34:21 +02:00
Sascha Hauer cdfca5dccb Merge branch 'for-next/rockchip' 2014-05-05 13:33:09 +02:00
Sascha Hauer 845f765b6e Merge branch 'for-next/regulator'
Conflicts:
	commands/Makefile
2014-05-05 13:33:06 +02:00
Sascha Hauer f8327af20c Merge branch 'for-next/ioresource' 2014-05-05 11:05:51 +02:00
Sascha Hauer 2274c6ea77 Merge branch 'for-next/env' 2014-05-05 11:05:50 +02:00
Beniamino Galvani a9c8371a85 ARM: dts: add Rockchip devicetree files
Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-29 08:15:41 +02:00
Beniamino Galvani 298ecc5860 clk: gate: add CLK_GATE_HIWORD_MASK flag
Clock gates having the CLK_GATE_HIWORD_MASK flag set use the upper 16
bits of the register as a "write enable" mask for the value in the
lower 16 bits.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-29 08:15:24 +02:00
Beniamino Galvani 32a2a673c6 clk: gate: add flags argument to clock gate constructor
This adds a clk_gate_flags argument to clock gate creation functions
to allow the introduction of new clock gate modifiers.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-29 08:15:24 +02:00
Beniamino Galvani 8fe4e0058f mfd: add act8846 driver
Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-29 08:12:32 +02:00
Antony Pavlov a210138078 clk: move of_clk_get_parent_name() to common clk code
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-29 08:11:24 +02:00
Sascha Hauer acb427e2d0 mci: Add regulator support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-29 08:01:35 +02:00
Sascha Hauer 485788954c Add initial regulator support
Provide minimal regulator support. Only supported operations are enabling
and disabling regulators. Association of devices with their regulators is
limited to devicetree only. If regulator support is disabled the API expands
to static inline stubs so consumers can still use the API.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-29 08:01:32 +02:00
Sascha Hauer 5d0362c5d3 dts: Use dt-bindings from kernel
barebox used to have its own include/dt-bindings with files copied
from the corresponding kernel files. Use upstream dt-bindings directly
instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-28 14:18:25 +02:00
Sascha Hauer 1a8800458b mtd: nand: create bb devices automatically
When a mtd device can have bad blocks we want to create a
bb device, so do this automatically. This allows us to
drop bb device creation from the environment.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-28 11:45:09 +02:00
Sascha Hauer 33d4f7cb3d mtd: refactor bb device creation
This refactors the code so that we get a mtd_add_bb which can
be used to create a bb dev on a mtd_info.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-28 11:43:09 +02:00
Sascha Hauer 54bea204e2 environment: drop envfs_register_partition
The purpose of envfs_register_partition is to print an error
message when the partition does not exist. Print an error message
from generic code instead and drop this function.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-28 11:37:42 +02:00
Lucas Stach 73d2b51551 dt-bindings: add tegra30-car.h
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-23 11:39:57 +02:00
Lucas Stach 4ab9051bd3 don't cast negative error codes to unsigned size_t
The cast prevents us from doing proper error checking.

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

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

Signed-off-by: Michel Stam <michel@reverze.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-08 08:17:55 +02:00
Lucas Stach d7bf1322bb dt-bindings: add pinctrl-tegra.h
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-07 08:36:03 +02:00
Sascha Hauer 0a5529d0ed Merge branch 'for-next/ppc' 2014-04-04 10:06:22 +02:00
Sascha Hauer 149e9d8121 Merge branch 'for-next/mtd' 2014-04-04 10:06:22 +02:00
Sascha Hauer 245bc10ca5 Merge branch 'for-next/misc' 2014-04-04 10:06:22 +02:00
Sascha Hauer a5c3b05b4d Merge branch 'for-next/menutree' 2014-04-04 10:06:22 +02:00
Sascha Hauer 712b555f6c Merge branch 'for-next/davinci' 2014-04-04 10:06:14 +02:00
Sascha Hauer a5a82ca2cd Merge branch 'for-next/boot' 2014-04-04 10:06:14 +02:00
Sascha Hauer b587c87aac Merge branch 'for-next/mips' 2014-04-04 10:05:46 +02:00
Sascha Hauer 1273cc2d47 param: Add dev_add_param_mac
This adds a convenience function to register a MAC address device
parameter. The only current user is converted to use it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-04 09:04:31 +02:00
Sascha Hauer 0a4dece780 video: Add kernel fourcc defines
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-29 07:57:53 +01:00
Sascha Hauer 09821fba06 ARM i.MX6q: Mark VPU and IPU AXI transfers as cacheable, increase IPU priority
This is needed so that the IPU framebuffer scanout cannot be
starved by VPU or GPU activity.
Some boards like the SabreLite and SabreSD seem to set this in
the DCD already, but the documented register reset values do not
contain the necessary settings.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-29 07:57:53 +01:00
Sascha Hauer 939c653328 video: Add edid support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-29 07:57:53 +01:00
Sascha Hauer 3868765886 video: Add display timing from devicetree helper
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-29 07:57:47 +01:00
Sascha Hauer 25dcdd68fb video: rework mode_name parameter setting
We have dev_add_param_enum() now, so use it for the mode_name
setting. Also drop the special case for single mode framebuffers,
just add the mode_name parameter for this case aswell.

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

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

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

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 10:51:30 +01:00
Antony Pavlov 8e74db588d clk: add Atheros AR933x driver
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 10:37:32 +01:00
Sascha Hauer ca8edb3b65 add menutree command
Creating menus from the shell using the regular 'menu' command is rather
complicated. This adds a 'menutree' command which creates a menu from
a directory structure. In the directory structure each directory corresponds
to a single menu entry. The directory contains the following files:

title -  A file containing the title of the entry as shown in the menu
box -    If present, the entry is a 'bool' entry. The file contains a variable
         name from which the current state of the bool is taken from and saved
         to.
action - if present this file contains a shell script which is executed when
         when the entry is selected.

If neither 'box' or 'action' are present this entry is considered a submenu
containing more entries.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 09:37:09 +01:00
Sascha Hauer 45693e0265 Add shell_expand function
shell_expand expands shell variables in a string.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 09:36:36 +01:00
Sascha Hauer 57eb30b265 i2c: implement of_find_i2c_adapter_by_node
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 08:45:11 +01:00
Sascha Hauer b657881071 err.h: Add PTR_ERR_OR_ZERO from kernel
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-28 08:45:10 +01:00
Sascha Hauer 09b884bdec blspec: honor default/once entries again
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-24 07:58:33 +01:00
Philipp Zabel 073fb20afe ARM i.MX6Q: Fix IOMUXC GPR1 defines for ENET_CLK_SEL and IPU1/2_MUX
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-19 16:20:26 +01:00
Renaud Barbier 64e38721cd common: DDR3 SPD verification support
Add DDR3 SPD verification support for use by the PPC 8xxx DDR driver.

This is based on the equivalent files from U-Boot version git-be937b5.

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-18 17:32:31 +01:00
Antony Pavlov 74f0803993 import _AC and UL macros from linux kernel
This macros are used in exported from linux TI DaVinci code.
Also this macros are used in MIPS cache support code.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-18 17:28:11 +01:00
Dmitry Lavnikevich 76a88c0227 mtd: Support for 4GB partitions
This patch implements correct way of creating partitions on mtd
devices with size >= 4GB.

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

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

Was tested on phyFLEX i.MX6.

Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
Signed-off-by: Grigory Milev <g.milev@sam-solutions.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-12 21:26:37 +01:00
Sascha Hauer cf1b29a850 Merge branch 'for-next/ubi'
Conflicts:
	drivers/mtd/ubi/cdev.c
2014-03-07 09:26:35 +01:00
Sascha Hauer 23a8d93c52 Merge branch 'for-next/pwm' 2014-03-07 09:25:56 +01:00
Sascha Hauer 74213ed9a7 Merge branch 'for-next/partitionhelper'
Conflicts:
	fs/devfs-core.c
2014-03-07 09:25:53 +01:00
Sascha Hauer 144358e0aa Merge branch 'for-next/nfs'
Conflicts:
	defaultenv/defaultenv-2-base/bin/ifup
2014-03-07 09:25:44 +01:00
Sascha Hauer e358922a74 Merge branch 'for-next/mtd'
Conflicts:
	drivers/mtd/core.c
	net/eth.c
2014-03-07 09:25:18 +01:00
Sascha Hauer 98615784a6 Merge branch 'for-next/modalias' 2014-03-07 09:25:12 +01:00
Sascha Hauer a8a08f88cc Merge branch 'for-next/misc'
Conflicts:
	common/environment.c
2014-03-07 09:25:09 +01:00
Sascha Hauer 2331b1d8e8 Merge branch 'for-next/marvell'
Conflicts:
	arch/arm/dts/Makefile
2014-03-07 09:25:02 +01:00
Sascha Hauer 048b03641e Merge branch 'for-next/imx' 2014-03-07 09:24:40 +01:00
Sascha Hauer 92ab6b5ea5 Merge branch 'for-next/gpio-keys' 2014-03-07 09:24:40 +01:00
Sascha Hauer 4df69d0b6e Merge branch 'for-next/env' 2014-03-07 09:24:40 +01:00
Sascha Hauer a162dfe503 net: Add ifup support
The defaultenv-2 has ifup support as a shell script. This patch
replaces it with a command which is more robust, can be called
from C and now can also bring up all configured interfaces.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-07 07:41:36 +01:00
Sascha Hauer 72dfc499c8 net: constify eth_get_byname argument
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-07 07:41:31 +01:00
Sascha Hauer 93578fb233 run_command: remove unused flag parameter
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-07 07:41:26 +01:00
Sascha Hauer 49d9b9bea7 mtd: nand: disable subpage reads
The default nand_read_subpage implementation returns -ENOSUPP, so we have
to make sure that barebox never uses this implementation. By setting the
NAND_SUBPAGE_READ flag to 0x0 we ensure NAND_HAS_SUBPAGE_READ() never returns
true and also give the compiler a chance to optimize away some unused code.

subpage reads are a rather exotic feature even in Linux. It is only used on
largepage NANDs with soft ecc. Even if we have this case it needs non page
aligned reads to actually profit from this feature.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Hattink, Tjalling [FINT] <T.Hattink@fugro.nl>
2014-03-03 08:45:32 +01:00
Sascha Hauer 767c6b4a81 led: Add default-on trigger
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-03 08:06:04 +01:00