9
0
Fork 0
Commit Graph

3196 Commits

Author SHA1 Message Date
Jean-Christophe PLAGNIOL-VILLARD 22f4e94010 driver: add postcore_platform_driver
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-04 15:49:59 +01:00
Robert Jarzmik a8d19f1f2f net: smc1111: extend the driver for 91c94 and 91c96 support
All the smcs family chips 91c94, 91c96, 91c100, 91c111 share almost the
same behavior and register sets. The noticeable exceptions are coped
with in this patch, ie :
 - 91c94 and 91c96 only have an internal 10 Mbps phy
   The registers used for phy discovery on later chips will corrupt the
   91c96 state.
 - 91c94 and 91c96 have a control and config register quite different
   from their 91c1xx conterparts
   A platform data user defined couple of registers is introduced. If
   these values are 0, 91c1xx legacy behavior is assumed.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-04 12:52:43 +01:00
Robert Jarzmik d6f8016ce7 net: smc1111: add 16 bits accessors, allow address shift
Smc network IPs can be wired up in different funny ways. For example the
lubbock pxa25x development platform wires all address lines shifted by
2, ie. bus A2 is smc91c96 A0, bus A3 is smc91c96 A1 etc ...

In order to cope with the different possible combination, add a shift
parameter for addresses.

By default, the old behaviour using the 32 bit accesses is kept.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-04 12:52:43 +01:00
Masahiro Yamada 262eef7c6a usb: abolish wait_ms() function
This function is only used in drivers/usb/*.
It is equivalent to mdelay().

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-02 11:46:30 +01:00
Masahiro Yamada 41be004e8d linux/kernel.h: move some macros and prototypes
The include/common.h is still cluttered (although much better than
U-Boot).  It contains various utility macros that originates
in Linux.  Move them to the original place, include/linux/kernel.h,
to slim down include/common.h.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-29 08:48:30 +01:00
Masahiro Yamada 8960b0ff81 asm-generic/bug.h: move BUG(), BUG_ON(), WARN(), WARN_ON() macros
In Linux, these macros are defined in include/asm-generic/bug.h.
To tidy up common.h, move BUG(), BUG_ON(), WARN(), WARN_ON() there.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-29 08:48:30 +01:00
Masahiro Yamada a07a472cac linux/bug.h: move BUILD_BUG_ON*() macros
In Linux, the macros BUILD_BUG_ON* are defined in include/linux/bug.h.
To tidy up common.h, move BUILD_BUG_* there.

MAYBE_BUILD_BUG_ON is not used in barebox and it was removed from Linux
long time ago.  Drop it from barebox, too.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-29 08:48:30 +01:00
Stefan Christ a114e9b00c ARM: i.MX6: use generic calculation in nand bbu handler
The parameters ECC Strength, BadBlockMarkerByte and BadBlockMarkerStartBit in
the FCB structure depends on the nand chip's pagesize and oobsize. Instead of
hardcoding these values into the imx6 bbu handler calculate these values on the
fly. Therefore we export the necessary functions from the nand_mxs driver to
use them in the bbu handler.

Signed-off-by: Stefan Christ <s.christ@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-29 07:58:00 +01:00
Masahiro Yamada bfa1b12fed linux/kernel.h: add more *_MAX, *_MIN macros
Imported from Linux 3.19-rc5.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-21 14:58:07 +01:00
Masahiro Yamada d27077bd76 linux/kernel.h: rename USHORT_MAX, SHORT_MAX, SHORT_MIN
Linux uses SHRT_* instead of SHORT_*.  The <limits.h> of C does
the same.  Let's follow this standard.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-21 14:58:07 +01:00
Masahiro Yamada 2ce9068d85 linux/kernel.h: move *_MAX, *_MIN macros
Linux defines *_MAX, *_MIN macros in include/linux/kernel.h.
Let's follow this way to slim down the common.h.

This change should have no impact because include/common.h already
includes <linux/kernel.h>.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-21 14:58:07 +01:00
Masahiro Yamada ec258b8bd0 debug_ll: change the argument type of putc_ll()
Most of the implementations of PUTC_LL() takes "char"
(some take "int"), not "unsigned char".
Moreover, puts_ll() takes an argument with "const char *" type.

Let's drop "unsigned" from the prototype of putc_ll().

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-21 14:57:05 +01:00
Robert Jarzmik 0ebe45422a mtd: nand: add mrvl-nand driver
The driver is taken from the Linux kernel, with the following changes :
 - all DMA removed
 - all asynchronous handling removed, including the interrupt handler,
   and the asynchronous state handling
 - pxa armada support removed

Most the kernel structure was kept, to ease up future fixes integration
from the kernel driver.

The driver is tested on a pxa3xx system development
board (aka. zylonite), and reading, writing, erasing, and bad block
management were tested.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-19 09:02:23 +01:00
Jean-Christophe PLAGNIOL-VILLARD a1a582f4e0 console: allow to specify the device id
so we can use dynamic number id with specific devname

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-13 08:48:59 +01:00
Sascha Hauer b396f38596 Merge branch 'for-next/netconsole' 2015-01-09 17:38:27 +01:00
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 cc843dadfd Merge branch 'for-next/efi' 2015-01-09 17:38:26 +01:00
Masahiro Yamada 11f588be31 sizes.h: sync with Linux 3.19-rc3
Looks like I am also highly addicted to 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:34 +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 663b895e49 malloc: Add a function to detect if malloc pool is already initialized
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-05 11:30:59 +01:00
Sascha Hauer a9d7b3d00e Add PBL console support
This adds simple console support to the PBL which makes it
possible to print more complex messages in the PBL than just
strings or hex numbers. For now puts_ll is used to print the
messages, so it depends on CONFIG_DEBUG_LL which makes it
more a debugging option. However, this could be extended later
to get regular output from the PBL if desired.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-05 11:30:59 +01:00
Sascha Hauer 2e1a6c9bce console: Add set_active callback
The netconsole needs to be able to deny activation when the network
has not been enabled. Add an optional callback to the console for
this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-12-17 15:08:04 +01:00
Lucas Stach 46b5a6d652 fs: efivars: implement write support
Implement the standard FS ops for writing/manipulating
efivars.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-12-09 09:59:10 +01:00
Lucas Stach 42c8b4589a lib: add wchar strdup
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-12-09 09:59:10 +01:00
Lucas Stach 0f377d6d40 efi: add Barebox GUID
A proper GUID is needed to namespace all sorts of
things, most prominently persistent variables.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-12-09 09:59:09 +01:00
Lucas Stach e4f3215be2 efi: add proper reset hook
This allows to actually reset the system from barebox
instead of dropping back into the EFI firmware.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-12-09 09:59:09 +01:00
Lucas Stach da94ff1e37 efi: add function to determine type of device path
Thanks to the wonders of UEFI we have to walk down the
device path all the way until we arrive at the device
we got this path from...

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-12-09 09:59:09 +01:00
Sascha Hauer b01bc4c810 Merge branch 'for-next/randconfig-1' 2014-12-08 14:54:11 +01:00
Sascha Hauer 3eade89c75 Merge branch 'for-next/persistent-vars'
Conflicts:
	arch/arm/boards/efika-mx-smartbook/defaultenv-efikasb/config
2014-12-08 14:54:09 +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
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
Jan Luebbe 0d752cb78c stringlist: the string argument should be const
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 604aff3178 gpio: move gpio_is_valid to include/gpio.h
No architectue implements its own gpio_is_valid() function, so move
the only existing implementation to include/gpio.h where it's available
for all users.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-28 15:21:27 +01:00
Sascha Hauer 0d5c1b9e97 param: make string arguments to dev_add_param_fixed const
dev_add_param_fixed does not modify the strings, so make them
const.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-28 15:21:26 +01:00
Lucas Stach 85383d2115 envfs: include errno.h
Fixes: include/envfs.h:124:10: error: 'ENOSYS' undeclared

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 93b7459e1c lib: decompress_xz: fix function header to match prototype
Fixes:
lib/uncompress.c:124:10: warning: assignment from incompatible pointer type

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
Jan Luebbe 7dc430e612 stringlist: string_list_contains can use a const string
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-20 14:36:19 +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
Sascha Hauer 32e879f0a3 globalvar: Add support for printing all global variables
This could previously only be done with 'devinfo global'. While
this is still possible this adds a more direct access via the
globalvar command. This variant also adds a '*' in front of
the variable if the corresponding non volatile variable exists.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-06 12:23:12 +01:00
Sascha Hauer 9f11887009 libfile: Add copy_recursive
To recursively copy a directory tree.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-06 10:58:55 +01:00
Sascha Hauer 3249006a2f Add support for non volatile variables
This adds (back) support for non volatile variables. Non volatile
variables are variables which are stored in the environment over
reboot. They are used in the same way as the global variables, but
with a 'nv' command and device. The variables are stored under
/env/nv/, one variable per file. Adding a nv variable automatically
adds a global variable with the same name. Changing a nv variable
also changes the same global variable, but not the other way round.
This allows for example to configure the username as:

nv user=sha; saveenv

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-06 10:58:54 +01:00
Sascha Hauer 592d35a47c Merge branch 'for-next/xz' 2014-11-05 15:47:39 +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 da1a9005c2 Merge branch 'for-next/fs' 2014-11-05 15:47:38 +01:00
Sascha Hauer 18ded420f7 Merge branch 'for-next/am335x' 2014-11-05 15:47:37 +01:00
Zahari Doychev f95ce0fff0 common: fix mbr filetype detection
Sometimes mbr is erroneously recocognised as FAT partion. Due to this the mbr
partition parser is not being called and the partitions on the media are not
detected. This patch should  fix the problem. The checking is done as in the
linux kernel.

I have seen the problem using usb sticks. Although partitioning and formatting
them under linux. The file system type field in the mbr remains there which
causes the wrong detections as FAT32 type and not as mbr.

Signed-off-by: Zahari Doychev <zahari.doychev@linux.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-05 14:53:28 +01:00
Sascha Hauer ccb2816477 Add xz decompression support
This adds xz decompression support from the kernel. Both compressing
the barebox binary with xz and decompressing xz files on the commandline
is supported.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-04 12:18:55 +01:00
Lucas Stach f63a42a999 reset_source: add thermal reset
Some SoCs are able to detect if they got reset
in response to an overtemperature event.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-04 12:16:20 +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
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
Sascha Hauer 2f81d316d2 filetype: Add XZ filetype support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-24 07:51:14 +02:00
Sascha Hauer 7014e83f09 include/environment.h: Add missing include
include/environment.h uses error codes, so it needs errno.h.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-22 15:57:08 +02:00
Sascha Hauer 6cf5b986d9 libfile: add compare_file function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-09 08:47:18 +02:00
Sascha Hauer ade0583602 param: let dev_add_param return the newly created param
dev_add_param creates a new parameter so it makes more sense to
return it than to return an error code. Since the return value
is hardly ever checked this is only a small patch.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 16:33:34 +02:00
Sascha Hauer a3993a38da fs: implement fstat
fstat is useful to get information about an already opened file. Add
it to barebox.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 16:11:06 +02:00
Sascha Hauer 4f7a18cdb5 fs: Store the path in struct filep
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 16:09:17 +02:00
Sascha Hauer bfef6cd5f2 fs: store pointer to fsdev instead of dev in struct filep
The struct device_d * in struct filep is never of interest, instead
it is always converted to a struct fs_device_d *, so simplify the code
by storing the struct fs_device_d * directly.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 16:06:21 +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 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 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
Sascha Hauer fbb191fd41 console: Fix CONSOLE_NONE support
Without console support we need a static inline version of
pr_print and dev_printf, otherwise we get link errors.

Reported-by: Kevin Du Huanpeng <u74147@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-10-08 08:05:49 +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 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