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>
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>
USB core isn't too strict about allocation/deallocation and
add/remove sequences of usb devices. Especially, error paths
and device tear-down are kind of broken and cause hangs on
failing usb device detect.
This patch improves the situation by introducing a
usb_free_device() that tears down allocated resources by
usb_alloc_new_device(). usb_remove_device() now only deals
with resources that have been added by usb_new_device().
Also, error handling is fixed or improved to ensure that no
devices are unregistered that have not been previously
registered.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Adding a usb device increases dev_index every time a new device is
allocated. Removing a usb device does not decrease again, of course.
As we print the number of detected usb devices after each usb bus
scan based on dev_index, we cannot trust dev_index here. Keep track
of the correct number of (currently) detected usb devices by
introducing an independent dev_count that gets increased on detect
and decreased on remove.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
New usb devices are added to a list of usb devices, but when removing
the corresponding usb_device it was not removed from that list. Fix it
by deleting it properly from the usb_device_list.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This is a limited board support for the Freescale P1010RDB.
The board boots from NOR and output the prompt to the serial port
at 115200 bauds. All 3 Ethernet ports are supported by the gianfar
driver. I2C devices are accessible on both bus and the memory is
initialised by the 85xx DDR driver.
Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Add support for the Freescale P1010 including errata for this CPU,
SoC frequency calculation and GPIO settings.
The mpc85xx configuration options file is re-ordered to facilitate
board option selection.
Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Add a minimal Integrated Flash Controller header file and new
definitions to support the P1010 SOC.
Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Move the configuration, control and status register base address
(CCSRBAR) relocation to the start-up processing. This addresses
TLB faults found during testing on the Freescale P1010RDB and
also matches the current U-Boot functionality.
Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
From U-Boot commit:
| commit 8b415f703f88d1d3b0466830047affbbf7f24913
| Author: Rommel Custodio <sessyargc+uboot@gmail.com>
| Date: Sun Jul 21 10:53:25 2013 +0200
|
| ext4fs: le32_to_cpu() used on a 16-bit field
|
| Fix reading ext4_extent_header struture on BE machines. Some 16 bit
| fields where converted to 32 bit fields, due to the byte swap on BE
| machines the containing value was corrupted. Therefore reading ext4
| filesystems on BE machines where broken before.
|
| Signed-off-by: Rommel Custodio <sessyargc+uboot@gmail.com>
| [sent via git-send-email; rework commit message]
| Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
| Reviewed-by: Simon Glass <sjg@chromium.org>
| Tested-by: Simon Glass <sjg@chromium.org>
| Tested-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
From U-Boot commit:
| commit 470173274d9ceb18a7140ef93e20be6c2236e7d9
| Author: Ionut Nicu <ioan.nicu.ext@nsn.com>
| Date: Mon Jan 13 11:59:24 2014 +0100
|
| ext4fs: use EXT2_BLOCK_SIZE instead of fs->blksz
|
| Using fs->blksz in ext4fs_get_extent_block() is not
| correct since fs->blksz is not initialized on the
| read path. Use EXT2_BLOCK_SIZE() instead which will
| produce the desired output.
|
| Signed-off-by: Ionut Nicu <ioan.nicu.ext@nsn.com>
| Signed-off-by: Mathias Rulf <mathias.rulf@nsn.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
From U-Boot commit:
| commit b5bbac1a9b07016602559ff483df265fef6c1f83
| Author: Ionut Nicu <ioan.nicu.ext@nsn.com>
| Date: Mon Jan 13 12:00:08 2014 +0100
|
| ext4fs: fix "invalid extent block" error
|
| For files where we actually have extent indexes following
| an extent header (ext_block->eh_depth != 0), the do/while
| loop from ext4fs_get_extent_block() does not select the
| proper extent index structure.
|
| For example, if we have:
|
| ext_block->eh_depth = 1
| ext_block->eh_entries = 1
| fileblock = 0
| index[0].ei_block = 0
|
| the do/while loop will exit with i set to 0 and the
| ext4fs_get_extent_block() function will return 0, even if
| there was a valid extent index structure following the
| header.
|
| Signed-off-by: Ionut Nicu <ioan.nicu.ext@nsn.com>
| Signed-off-by: Mathias Rulf <mathias.rulf@nsn.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
On Marvell MVEBU SoCs memory size is set up by BootROM and can be read
from SoC's RAM controller. With early DT fixups available, set corresponding
DT node to reflect accessible amount of directly attached RAM.
This patch also removes non-DT call to arm_add_mem_device to silence a
warning about request_region conflict due to adding a mem device twice.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
With proper DT fixup in place, we can now remove the overwrite of
mbus ranges in Armada 370 Mirabox and Armada XP Openblocks AX3.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
For each supported MVEBU SoC, add the corresponding remapped registers
to fix them up in provided DTBs.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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>
Device trees can be passed by primary boot loader or appended to
barebox binary. Unfortunately, before probing devices from such
a device tree, no fixup can be applied.
Add a call to of_fix_tree() right before probing devices to catch
some very early fixups.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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>
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>
Instead of hard-coding descriptor length, pick it from the
corresponding descriptor.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Now that we have a full set of defines for each descriptor field,
make use of it for the EHCI HCD descriptors.
This fixes endianess issues for .device.bcdUSB, .device.bcdDevice,
.config.wTotalLength, and .endpoint.wMaxPacketSize.
Also, .endpoint.bInterval was set to 0 instead of 255 due to a
copy-and-paste error while assigning u8[] to usb_endpoint_descriptor.
This also is a preparation for including ch11.h later, which has
a modified usb_hub_descriptor for USB 3.0.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Now that usb_config_descriptor and usb_interface_descriptor are clean
of any additional fields, drop the duplication in EHCI code and use
the default ones.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
{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>
usb_hub_configure() gets the hub descriptor and copies its values
over to a local descriptor.
While copying PortPowerCtrlMask it erroneously overwrites
DeviceRemovable due to a copy-and-paste error. Fix it up.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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>
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>
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>
Allocate space for the resulting image (FCB+DBBT+Firmware) in
imx_bbu_internal_v2_write_nand_dbbt() instead of its caller to make the
code simpler.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Instead oof using the same constants multiple times use a variable
to make the meaning of the constants clear.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Documentation clearly states that the FCB at offset 0x68 has
to contain the start page of the firmware. In our case this
was set to 0x0. I don't know how this could ever work, but it
did, at least until:
15ee301 ARM: i.MX: bbu-internal: optionally use DCD data from image
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We have the hardcoded value 0x8000 for the space needed for FCB and
DBBT in several places. Use a variable instead and initialize it
correctly with 12 * meminfo.writesize (which is in fact 0x6000 for
2k pagesize).
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
When an endpoint hasn't been enabled ep->desc is NULL and
fsl_ep_dequeue crashes with a NULL pointer dereference. Check
ep->desc before continuing.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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>
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>
As in U-Boot git-9c9141f, make read/write access to the TX/RX
descriptors CPU agnostic.
Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This adds a pinctrl driver for pin muxing on Marvell Armada XP. The
driver is ported from Linux and modified to fit on Barebox's common
mvebu pinctrl driver.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This adds a pinctrl driver for pin muxing on Marvell Armada 370. The
driver is ported from Linux and modified to fit on Barebox's common
mvebu pinctrl driver.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
We need to flush out the ttb in order to make the
changes observable to the page walker.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Doxygen documentation is removed in the commit
commit 98360be0fe
Author: Sascha Hauer <s.hauer@pengutronix.de>
Date: Tue Jun 17 10:27:03 2014 +0200
Documentation: remove doxygen documentation
But checkpatch.pl still trying to check 'Doxyfile' presence.
There is not such 'Doxyfile' and checkpatch.pl exits with
'Must be run from the top-level dir. of a kernel tree' message.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Compiling the tree with allyesconfig is helpful because different
compilers (gcc, clang) or static checkers (e.g. clang's scan-build)
can then process and check more code.
This patch introduces two new configuration symbols that Kconfig files
can depend on. That way, code that is only working where a cache or DMA
implementation exists can be opted out.
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
... so that it looks a bit nicer in the HTML generated docs.
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Someone
loadx (load binary file over serial line (X-Modem))
looked more silly than
loadx - load binary file over serial line (X-Modem)
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Documentation/gen_commands.py use to re-write all auto-generated *.rst
file, changed or not. That in turn didn't work well with the internal
cache of the Sphinx documentation generator.
By comparing the SHA1 hash of the newly generated *.rst with the
current sha1 file, the time to execute "make docs" can be reduced
from 6.2s to 2.4s on my humble laptop.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>