summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-07-02Prepare v2014.07-rc4v2014.07-rc4Tom Rini
Signed-off-by: Tom Rini <trini@ti.com>
2014-07-02usb: ci_udc: use var name ep/ci_ep consistentlyStephen Warren
Almost all of ci_udc.c uses variable name "ep" for a struct usb_ep and "ci_ep" for a struct ci_ep. This is nice and consistent, and helps people know what type a variable is without searching for the declaration. handle_ep_complete() doesn't do this, so fix it to be consistent. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-07-02USB: gadget: atmel: zero out allocated requestsStephen Warren
A UDC's alloc_request method should zero out the newly allocated request. Ensure the Atmel driver does so. This issue was found by code inspection, following the investigation of an intermittent issue with ci_udc, which was tracked down to failing to zero out allocated requests following some of my changes. All other UDC drivers already zero out requests in one way or another. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-07-02usb: ci_udc: don't memalign() struct ci_req allocationsStephen Warren
struct ci_req is a purely software structure, and needs no specific memory alignment. Hence, allocate it with calloc() rather than memalign(). The use of memalign() was left-over from when struct ci_req was going to hold the aligned bounce buffer, but this is now dynamically allocated. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-07-02usb: ci_udc: remove controller.items arrayStephen Warren
There's no need to store an array of QTD pointers in the controller. Since the calculation is so simple, just have ci_get_qtd() perform it at run-time, rather than pre-calculating everything. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-07-02usb: ci_udc: fix items array size/stride calculationStephen Warren
2 QTDs are allocated for each EP. The current allocation scheme aligns the first QTD in each pair, but simply adds the struct size to calculate the second QTD's address. This will result in a non-cache-aligned addresss IF the system's ARCH_DMA_MINALIGN is not 32 bytes (i.e. the size of struct ept_queue_item). Similarly, the original ilist_ent_sz calculation aligned the value to ARCH_DMA_MINALIGN but didn't take the USB HW's 32-byte alignment requirement into account. This doesn't cause a practical issue unless ARCH_DMA_MINALIGN < 32 (which I suspect is quite unlikely), but we may as well fix the code to be explicit, so it's obviously completely correct. The new value of ILIST_ENT_SZ takes all alignment requirements into account, so we can simplify ci_{flush,invalidate}_qtd() by simply using that macro rather than calling roundup(). Similarly, the calculation of controller.items[i] can be simplified, since each QTD is evenly spaced at its individual alignment requirement, rather than each pair being aligned, and entries within the pair being spaced apart only by structure size. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-07-02usb: ci_udc: lift ilist size calculations to global scopeStephen Warren
This will allow functions other than ci_udc_probe() to make use of the constants in a future change. This in turn requires converting the const int variables to #defines, since the initialization of one global const int can't depend on the value of another const int; the compiler thinks it's non-constant if that dependency exists. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-07-02usb: ci_udc: don't assume QTDs are adjacent when transmitting ZLPsStephen Warren
Fix ci_ep_submit_next_request()'s ZLP transmission code to explicitly call ci_get_qtd() to find the address of the other QTD to use. This will allow us to correctly align each QTD individually in the future, which may involve leaving a gap between the QTDs. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-07-02usb: ci_udc: fix ci_flush_{qh,qtd} calls in ci_udc_probe()Stephen Warren
ci_udc_probe() initializes a pair of QHs and QTDs for each EP. After each pair has been initialized, the pair is cache-flushed. The conversion from QH/QTD index [0..2*NUM_END_POINTS) to EP index [0..NUM_ENDPOINTS] is incorrect; it simply subtracts 1 (which yields the QH/QTD index of the first entry in the pair) rather than dividing by two (which scales the range). Fix this. On my system, this avoids cache debug prints due to requests to flush unaligned ranges. This is caused because the flush calls happen before the items[] array entries are initialized for all but EP0. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-06-25dfu: free entities when parsing failsStephen Warren
When dfu_init_env_entities() fails part-way through, some entities may have been added to dfu_list. These are only removed by dfu_free_entities(). If that function isn't called, those stale entities will still exist the next time dfu_init_env_entities() is called, leading to confusion. Fix do_dfu() to ensure that dfu_free_entities() is always called, to avoid this confusion. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Tested-by: Lukasz Majewski <l.majewski@samsung.com>
2014-06-25usb: eth: smsc95xx: add LAN9500A device IDIlya Ledvich
Add LAN9500A product ID (0x9e00) in order to support LAN9500A based dongles. Tested on cm_t335. Signed-off-by: Ilya Ledvich <ilya@compulab.co.il> Acked-by: Marek Vasut <marex@denx.de>
2014-06-25usb: fastboot: fix potential buffer overflowJeroen Hofstee
cb_getvar tries to prevent overflowing the response buffer by using strncat. But strncat takes the number of data bytes copied as a limit not the total buffer length so it can still overflow. Pass the correct value instead. cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> cc: Rob Herring <robh@kernel.org> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-06-25usb: xhci: (likely) fix bracket in if conditionJeroen Hofstee
Because of the brackets the & and && is evaluated before the comparison. This is likely not the intention. Change it to test the first and second condition to both be true. cc: Marek Vasut <marex@denx.de> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-06-25usb:g_dnl:f_thor: remove memset before memcpyJeroen Hofstee
since ALLOC_CACHE_ALIGN_BUFFER defines a pointer and not a buffer, the memset with sizeof(rqt) likely does something else then intended. Since there is a memcpy directly after it with the full size, drop the memset completely. Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
2014-06-25usb:composite: clear the whole common bufferJeroen Hofstee
Since the struct fsg_common is calloced, reset it completely with zero's when reused. While at it, make checkpatch happy. cc: Lukasz Majewski <l.majewski@samsung.com> cc: Piotr Wilczek <p.wilczek@samsung.com> cc: Kyungmin Park <kyungmin.park@samsung.com> cc: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
2014-06-25usb: r8a66597: Fix initilization size of r8a66597 info structureYasuhisa Umano
Initialization of r8a66597 info structure is not enough. Because initilization was used size of pointer. This fixes that use size of r8a6659 info structure. Signed-off-by: Yasuhisa Umano <yasuhisa.umano.zc@renesas.com>
2014-06-25usb: r8a66597: Fix initialization hub that using R8A66597_MAX_ROOT_HUByasuhisa umano
This driver is processed as two USB hub despite one. The number of root hub is defined in R8A66597_MAX_ROOT_HUB. This fixes that register is accessed by using the definition of R8A66597_MAX_ROOT_HUB. Signed-off-by: Yasuhisa Umano <yasuhisa.umano.zc@renesas.com>
2014-06-25usb: cosmetic: double constJeroen Hofstee
For plain array const can be either before or after the type definition. Adding both is simply redundand. Remove the later one. cc: marex@denx.de Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-06-25usb: ci_udc: fix typo in debug messageStephen Warren
s/ot/to/ Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-06-25usb: ci_udc: fix interaction with CONFIG_USB_ETH_CDCStephen Warren
ci_udc.c's usb_gadget_unregister_driver() doesn't call driver->unbind() unlike other USB gadget drivers. Fix it to do this. Without this, when ether.c's CDC Ethernet device is torn down, eth_unbind() is never called, so dev->gadget is never set to NULL. For some reason, usb_eth_halt() is called both at the end of the first use of the Ethernet device, and prior to any subsequent use. Since dev->gadget is never cleared, all calls to usb_eth_halt() attempt to stop, disconnect, and clean up the device, resulting in double cleanup, which hangs U-Boot on my Tegra device at least. ci_udc allocates its own singleton EP0 request object, and cleans it up during usb_gadget_unregister_driver(). This appears necessary when using the USB gadget framework in U-Boot, since that does not allocate/free the EP0 request. However, the CDC Ethernet driver *does* allocate and free its own EP0 requests. Consequently, we must protect ci_ep_free_request() against double-freeing the request. Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-06-24Merge branch 'sandbox' of git://git.denx.de/u-boot-x86Tom Rini
2014-06-24Merge branch 'master' of git://git.denx.de/u-boot-dmTom Rini
2014-06-23sandbox: change local_irq_save() to macroMasahiro Yamada
local_irq_save() should be a macro, not a function because local_irq_save() saves flag to the given argument. GCC is silent about this issue, but Clang warns: In file included from lib/asm-offsets.c:15: In file included from include/common.h:20: In file included from include/linux/bitops.h:110: arch/sandbox/include/asm/bitops.h:59:17: warning: variable 'flags' is uninitialized when used here [-Wuninitialized] local_irq_save(flags); ^~~~~ That change causes another warning: In file included from include/linux/bitops.h:110:0, from include/common.h:20, from lib/asm-offsets.c:15: arch/sandbox/include/asm/bitops.h: In function ‘test_and_set_bit’: arch/sandbox/include/asm/bitops.h:56:16: warning: unused variable ‘flags’ [-Wunused-variable] So, flags should be set to __always_unused. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Simon Glass <sjg@chromium.org> Cc: Jeroen Hofstee <jeroen@myspectrum.nl> Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-06-23sandbox: terminate os_dirent_ls() result listStephen Warren
Each node in the linked-list that os_dirent_ls() returns has its next pointer set only when the next node is created. For the last node in the list, there is no next node, so this never happens, and the next pointer is never initialized. Explicitly initialize the next pointer so that it isn't dangling. Without this, "sb ls" might crash. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-06-23sandbox: restore ability to access host fs through standard commandsStephen Warren
Commit 95fac6ab4589 "sandbox: Use os functions to read host device tree" removed the ability for get_device_and_partition() to handle the "host" device type, and redirect accesses to it to the host filesystem. This broke some unit tests that use this feature. So, revert that change. The code added back by this patch is slightly different to pacify checkpatch. However, we're then left with "host" being both: - A pseudo device that accesses the hosts real filesystem. - An emulated block device, which accesses "sectors" inside a file stored on the host. In order to resolve this discrepancy, rename the pseudo device from host to hostfs, and adjust the unit-tests for this change. The "help sb" output is modified to reflect this rename, and state where the host and hostfs devices should be used. Signed-off-by: Stephen Warren <swarren@nvidia.com> Tested-by: Josh Wu <josh.wu@atmel.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2014-06-23x86: Enable 32-bit build using x86_64 multilib toolchainVasili Galka
Until now building the x86 arch boards required 32-bit toolchain. As many x86_64 toolchains come with 32-bit support (multilib) that's a good idea to enable build with such toolchains. The change required was to specify the usage of 32-bit explicitly to the compiler and the linker (-m32 and -m elf_i386 flags) and locate the right libgcc path. Signed-off-by: Vasili Galka <vvv444@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-06-23mpc8313: add CONFIG_SYS_GENERIC_BOARD to ids8313 boardHeiko Schocher
- add CONFIG_SYS_GENERIC_BOARD - remove CONFIG_OF_CONTROL to boot again Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Kim Phillips <kim.phillips@freescale.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-06-23lib, fdt: move fdtdec_get_int() out of lib/fdtdec.cHeiko Schocher
move fdtdec_get_int() out of lib/fdtdec.c into lib/fdtdec_common.c as this function is also used, if CONFIG_OF_CONTROL is not used. Poped up on the ids8313 board using signed FIT images, and activating CONFIG_SYS_GENERIC_BOARD. Without this patch it shows on boot: No valid FDT found - please append one to U-Boot binary, use u-boot-dtb.bin or define CONFIG_OF_EMBED. For sandbox, use -d <file.dtb> With this patch, it boots again with CONFIG_SYS_GENERIC_BOARD enabled. Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@ti.com>
2014-06-21dm: Use '*' to indicate a device is activatedSimon Glass
Make both dm enumeration commands support showing whether a driver is active or not, and use a consistent indicator (an asterisk). Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Marek Vasut <marex@denx.de>
2014-06-21include/dm.h: fix inclusion guardJeroen Hofstee
cc: Simon Glass <sjg@chromium.org> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl> Acked-by: Simon Glass <sjg@chromium.org>
2014-06-20Merge branch 'master' of git://git.denx.de/u-boot-dmTom Rini
2014-06-20dm: Expand and improve the device lifecycle docsSimon Glass
The lifecycle of a device is an important part of driver model. Add to the existing documentation and clarify it. Reported-by: Jon Loeliger <jdl@jdl.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2014-06-20dm: Tidy up four minor code nitsSimon Glass
There is a spelling mistake and two functions are missing comments altogether. Also the flags declaration is correct, but doesn't follow style. Finally, the uclass_get_device() function has some errors in its documentation. Fix these problems. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Marek Vasut <marex@denx.de>
2014-06-20tegra: Enable driver modelSimon Glass
Enable driver model for Tegra boards. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Stephen Warren <swarren@nvidia.com>
2014-06-20tegra: dts: Bring in GPIO bindings from linuxSimon Glass
These files are taken from Linux 3.14. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Stephen Warren <swarren@nvidia.com>
2014-06-20dm: Fix printf() strings in the 'dm' commandSimon Glass
The values here are int, but the map_to_sysmem() call can return a long. Add a cast to deal with this. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-06-20dm: Allow driver model tests only for sandboxSimon Glass
The GPIO tests require the sandbox GPIO driver, so cannot be run on other platforms. Similarly for the 'dm test' command. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-06-20dm: Cast away the const-ness of the global_data pointerSimon Glass
In a very few cases we need to adjust the driver model root device, such as when setting it up at initialisation. Add a macro to make this easier. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-06-20dm: Add missing header files in lists and rootSimon Glass
These files don't compile in some architectures. Fix it by adding the missing headers. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-06-20dm: Use case-insensitive comparison for GPIO banksSimon Glass
We want 'N0' and 'n0' to mean the same thing, so ensure that case is not considered when naming GPIO banks. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-06-20dm: Update README to encourage conversion to driver modelSimon Glass
Add a note to encourage people to convert drivers to use driver model. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-06-20dm: Rename struct device_id to udevice_idSimon Glass
It is best to avoid having any occurence of 'struct device' in driver model, so rename to achieve this. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-06-20Makefile: Support include files for .dts filesSimon Glass
Linux supports this, and if we are to have compatible device tree files, U-Boot should also. Avoid giving the device tree files access to U-Boot's include/ directory. Only include/dt-bindings is accessible. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-06-20sandbox: Support iotrace featureSimon Glass
Support the iotrace feature for sandbox, and enable it, using some dummy I/O access methods. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-06-20arm: Support iotrace featureSimon Glass
Support the iotrace feature for ARM, when enabled. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-06-20Add an I/O tracing featureSimon Glass
When debugging drivers it is useful to see what I/O accesses were done and in what order. Even if the individual accesses are of little interest it can be useful to verify that the access pattern is consistent each time an operation is performed. In this case a checksum can be used to characterise the operation of a driver. The checksum can be compared across different runs of the operation to verify that the driver is working properly. In particular, when performing major refactoring of the driver, where the access pattern should not change, the checksum provides assurance that the refactoring work has not broken the driver. Add an I/O tracing feature and associated commands to provide this facility. It works by sneaking into the io.h heder for an architecture and redirecting I/O accesses through its tracing mechanism. For now no commands are provided to examine the trace buffer. The format is fairly simple, so 'md' is a reasonable substitute. Note: The checksum feature is only useful for I/O regions where the contents do not change outside of software control. Where this is not suitable you can fall back to manually comparing the addresses. It might be useful to enhance tracing to only checksum the accesses and not the data read/written. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-06-20cosmetic: kbuild: clean-up coding style (sync with Linux 3.16-rc1)Masahiro Yamada
Import the following trivial commits from Linux v3.16-rc1: bb66fc6 kbuild: trivial - use tabs for code indent where possible 7eb6e34 kbuild: trivial - remove trailing empty lines 3fbb43d kbuild: trivial - fix comment block indent 38385f8 kbuild: trivial - remove trailing spaces Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-06-19cosmetic: autoboot: update old style GNU struct initJeroen Hofstee
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-06-19cmd_md5sum.c: remove dead code / fix warningJeroen Hofstee
commit ecd729500 "Add parameter to md5sum to save the md5 sum" adds support to build a string to be saved in the env and tries to zero end it with str_ptr = '\0'; This does actually set the pointer to the end of the buffer itself to zero. Since the string was already zero terminated by the sprintf before it, just remove the line, preventing a clang warning. cc: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-06-19Remove nios-32 arch remnantsVasili Galka
nios-32 arch was removed back in 2010 (1117cbf). Code depending on its headers (nios.h, nios-io.h) can't possibly compile since then. As it wasn't fixed till now it is safe to remove. Signed-off-by: Vasili Galka <vvv444@gmail.com>