summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2012-10-26serial: remove calls to serial_assign()Allen Martin
Remove calls to serial_assign() that are failing now that it returns a proper error code. This calls were not actually doing anything because they passed the name of a stdio_dev when a serial_device name is exptectd. Signed-off-by: Allen Martin <amartin@nvidia.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@nvidia.com>
2012-10-25FAT: implement fat_set_blk_dev(), convert cmd_fat.cStephen Warren
This makes the FAT filesystem API more consistent with other block-based filesystems. If in the future standard multi-filesystem commands such as "ls" or "load" are implemented, having FAT work the same way as other filesystems will be necessary. Convert cmd_fat.c to the new API, so the code looks more like other files implementing the same commands for other filesystems. Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
2012-10-22Merge branch 'master' of git://git.denx.de/u-boot-fdtTom Rini
2012-10-22Merge branch 'next'Gerald Van Baren
2012-10-22Merge branch 'master' of git://www.denx.de/git/u-boot-mmcTom Rini
2012-10-22fs: Add a Coreboot Filesystem (CBFS) driver and commandsGabe Black
This change adds CBFS support and some commands to use it to u-boot. These commands are: cbfsinit - Initialize CBFS support and pull all metadata into RAM. The end of the ROM is an optional parameter which defaults to the standard 0xffffffff and can be used to support multiple CBFSes in a system. The last one set up with cbfsinit is the one that will be used. cbfsinfo - Print information from the CBFS header. cbfsls - Print out the size, type, and name of all the files in the current CBFS. Recognized types are translated into symbolic names. cbfsload - Load a file from CBFS into memory. Like the similar command for fat filesystems, you can optionally provide a maximum size. Support for CBFS is compiled in when the CONFIG_CMD_CBFS option is specified. The CBFS driver can also be used programmatically from within u-boot. If u-boot needs something out of CBFS very early before the heap is configured, it won't be able to use the normal CBFS support which caches some information in memory it allocates from the heap. The cbfs_file_find_uncached function searches a CBFS instance without touching the heap. Signed-off-by: Gabe Black <gabeblack@google.com> Signed-off-by: Stefan Reinauer <reinauer@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2012-10-22common: Convert the U-Boot commands to LG-arraysMarek Vasut
This patch converts the old method of creating a list of command onto the new LG-arrays code. The old u_boot_cmd section is converted to new u_boot_list_cmd subsection and LG-array macros used as needed. Minor adjustments had to be made to the common code to work with the LG-array macros, mostly the fixup_cmdtable() calls are now passed the ll_entry_start and ll_entry_count instead of linker-generated symbols. The command.c had to be adjusted as well so it would use the newly introduced LG-array API instead of directly using linker-generated symbols. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@gmail.com> Cc: Mike Frysinger <vapier@gentoo.org>
2012-10-22COMMON: Implement common bounce bufferMarek Vasut
Implement common bounce buffer to be used on a less capable hardware. That includes hardware that can not do DMA from any address or such. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <festevam@gmail.com> Cc: Andy Fleming <afleming@freescale.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
2012-10-22usb: fallback safely when a configuration descriptor is too largeVincent Palatin
When a USB configuration descriptor was larger than our USB buffer (512 bytes), we were skipping the full descriptor reading but then we were still parsing and using it, triggering memory corruptions. Now in that case, it just skips this device enumeration and displays the appropriate message to the user, so he can fix the buffer if he wants. This bug was triggered by some UVC webcams which have very large configuration descriptors (e.g. a couple of kB) describing all their supported video encodings. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
2012-10-22usb: Support the CONFIG_SYS_64BIT_LBA optionGabe Black
usb_storage wouldn't compile when the CONFIG_SYS_64BIT_LBA option is turned on because the used fixed size data types in their exported functions when they should have used lbaint_t for the block count parameter. That meant that when the sizes happened to be the same, when using a 28 bit LBA, the driver would build, but when it wasn't, a 48 bit LBA, things broke. This change adjusts the signatures to use the right type and makes small adjustments in the affected functions. Signed-off-by: Gabe Black <gabeblack@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
2012-10-19x86: Change global data baudrate to intSimon Glass
This doesn't need to be a long, so change it. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@ti.com>
2012-10-19nds32: Change global data baudrate to intSimon Glass
This doesn't need to be a long, so change it. Also adjust bi_baudrate to be unsigned. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@ti.com>
2012-10-19mips: Change global data baudrate to intSimon Glass
This doesn't need to be a long, so change it. Also adjust bi_baudrate to be unsigned. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@ti.com>
2012-10-19blackfin: Change global data baudrate to intSimon Glass
This doesn't need to be a long, so change it. Also adjust bi_baudrate to be unsigned. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@ti.com>
2012-10-19arm: Change global data baudrate to intSimon Glass
This does not need to be a long, so change it. Also adjust bi_baudrate to be unsigned. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@ti.com>
2012-10-19sparc: Change bi_baudrate and global data baudrate to intSimon Glass
These don't need to be longs, so change them. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@ti.com>
2012-10-19powerpc: Change bi_baudrate and global data baudrate to intSimon Glass
These don't need to be longs, so change them. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@ti.com>
2012-10-19openrisc: Change bi_baudrate and global data baudrate to intSimon Glass
These don't need to be longs, so change them. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@ti.com>
2012-10-19nios2: Change bi_baudrate and global data baudrate to intSimon Glass
These don't need to be longs, so change them. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@ti.com>
2012-10-19microblaze: Change bi_baudrate and global data baudrate to intSimon Glass
These don't need to be longs, so change them. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@ti.com>
2012-10-19m68k: Change bi_baudrate and global data baudrate to intSimon Glass
These don't need to be longs, so change them. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@ti.com>
2012-10-19avr32: Change bi_baudrate and global data baudrate to intSimon Glass
These don't need to be longs, so change them. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Andreas Bießmann <andreas.devel@googlemail.com> Signed-off-by: Tom Rini <trini@ti.com>
2012-10-19sh: Change bi_baudrate and global data baudrate to intSimon Glass
These don't need to be longs, so change them. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@ti.com>
2012-10-19env: cosmetic: Consilidate the default env definitionJoe Hershberger
There used to be a huge structure duplicated 3 times in the source. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Tom Rini <trini@ti.com>
2012-10-17Merge branch 'master' of git://git.denx.de/u-boot-i2cTom Rini
2012-10-17remove unnecessary includes from cmd_ide.cPavel Herrmann
mpc8xx and mpc5xxx specific includes in cmd_ide.c are not required, remove them. Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
2012-10-17split PCS440EP specific code from cmd_ide.cPavel Herrmann
Move specific ide_input_data and friends to board-specific file. Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
2012-10-17split AU1X00 specific code from cmd_ide.cPavel Herrmann
move special case of ide_swap_read() for AU1X00 SoC into SoC-specific directory. Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
2012-10-17make ide_led() a weak aliasPavel Herrmann
Make ide_led() a weak alias instead of global/local function/empty macro based on CONFIG_IDE_LED value and/or board-specific CONFIGs, to get rid of board-specific code in cmd_ide.c Define dummy values to get rid of compoler errors in case where ide_led() used to be an empty macro Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
2012-10-17split CPC45 board-specific IDE functions from cmd_ide.cPavel Herrmann
Move input_data() and friends to board/cpc45/ide.c, as overrides for weak aliases in cmd_ide.c note: checkpatch emits warnings about using volatile Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
2012-10-17change all versions of input_data() and output_data() to global weak aliasesPavel Herrmann
This changes input_data() and friends from static function to global symbols under weak alias, to enable board specific overrides (and therefore get rid of board-specific code in cmd_ide.c) Also declare ide_bus_offset in the header file, so other files can use ATA_CURR_BASE as well. Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
2012-10-17split IVM power hooks from cmd_ide.cPavel Herrmann
Move power control code from ide_reset() into IVM-specific IDE reset code. Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
2012-10-17split mpc8xx hooks from cmd_ide.cPavel Herrmann
move most of mpc8xx hooks from cmd_ide.c into ide_preinit() and newly created ide_init_postreset() (invoked after calling ide_reset after ide_preinit), some cleanup to make checkpatch happy, enable IDE init hooks in configs of affected boards. confusingly, these hooks are used by more than just mpc8xx-based boards, and therefore are placed in arch/ppc/lib/ note: checkpatch still emits warnings about using volatile Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
2012-10-17remove CONFIG_SC3 from cmd_ide.cPavel Herrmann
There is no difference in codepath with CONFIG_SC3 enabled, so just remove it Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
2012-10-16i2c_probe: update for use in scriptingEric Nelson
Allow the use of an I2C address to test and return success if one or more devices is found. This allows device presence to alter the flow of a script. e.g. if i2c probe 0x04 ; then echo found Hannstar touch ; fi Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
2012-10-16common/i2c: Add i2c write commandYork Sun
Add i2c write command to write data from memory to i2c devices. Signed-off-by: York Sun <yorksun@freescale.com>
2012-10-15fdt: Check for a token to skip auto-hash validationJoe Hershberger
Allow the itb file to declare to u-boot that its hash should not be checked automatically on bootm or iminfo. This allows an image to either be checked automatically or to include a script which may check it otherwise (such as after part of the itb has been relocated to RAM by the script). Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-10-15fdt: Identify scripts in ITBs as printable stringsJoe Hershberger
Scripts in the ITB format will have spaces in them and will end in a newline charachter. Make sure that these are considered printable. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-10-15fdt: Add get commands to fdtJoe Hershberger
Add commands to access data in the fdt. This allows data from a dtb or itb to be accessed from the shell scripts. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-10-15fdt: Limit printed hex in fdt print and list commandsJoe Hershberger
Prevent printing the entire image in a itb. It is most likely unhelpful to have the hex of the entire image scroll for minutes on your slow serial console. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-10-15fdt: Check error codes returned from fdtlib when loading ITBJoe Hershberger
Before this patch, error codes returned from fdtlib were ignored and continued access would cause a crash. Now just check if the image is truncated and error if so. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-10-15Merge branch 'agust@denx.de-next' of git://git.denx.de/u-boot-stagingTom Rini
2012-10-15env: Check for NULL pointer in envmatch()Joe Hershberger
If the pointer passed into envmatch() is NULL, return -1 instead of crashing. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-10-15common: cmd_bdinfo: fix type of value in print_lnumDaniel Schwierzeck
This fixes a warning when compiling with ELDK-5.2.1 for MIPS64: cmd_bdinfo.c: In function 'print_lnum': cmd_bdinfo.c:56:2: warning: format '%llX' expects argument of type 'long long unsigned int', but argument 3 has type 'u64' [-Wformat] Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2012-10-15usb: add support for multiple usb controllersLucas Stach
Allows to initialize more than one USB controller at once. v2: print message when controller stop fails Signed-off-by: Lucas Stach <dev@lynxeye.de> Reviewed-by: Marek Vasut <marex@denx.de>
2012-10-15usb: lowlevel interface change to support multiple controllersLucas Stach
Carry an index in the lowlevel usb functions to make specify the respective usb controller. Also pass through an controller struct from lowlevel_init to the creation of the root usb device of this controller. Signed-off-by: Lucas Stach <dev@lynxeye.de> Reviewed-by: Marek Vasut <marex@denx.de>
2012-10-15serial: Remove CONFIG_SERIAL_MULTI from remaining sourcesMarek Vasut
Remove the parts depending either on disabled CONFIG_SERIAL_MULTI or ifdefs around CONFIG_SERIAL_MULTI parts since CONFIG_SERIAL_MULTI is now enabled by default. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Tom Rini <trini@ti.com> Cc: Anatolij Gustschin <agust@denx.de> Cc: Stefan Roese <sr@denx.de>
2012-10-15serial: Move common/serial.c to drivers/serial/Marek Vasut
Move the common/serial.c into driver/serial/, since this file provides serial multiplexing functions and it is imperative to be linked with libserial.o instead of libcommon.o. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Tom Rini <trini@ti.com>
2012-10-15serial: Use puts() and hang() instead of panic() in SPLMarek Vasut
If case the get_current() call fails before relocation, the U-Boot must try to print an error message, fail and either reset or halt. Such error is critical enough to halt the system, as it means the system is in very bad state. This is now also used in SPL, since CONFIG_SERIAL_MULTI is enabled unconditionally. To avoid compiling whole vsprintf.c into SPL, use puts() to print error message and hang() to stop the system in case of SPL build. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Tom Rini <trini@ti.com>
2012-10-15serial: sh: Implement CONFIG_SERIAL_MULTI into sh serial driverMarek Vasut
Implement support for CONFIG_SERIAL_MULTI into sh serial driver. This driver was so far only usable directly, but this patch also adds support for the multi method. This allows using more than one serial driver alongside the sh driver. Also, add a weak implementation of default_serial_console() returning this driver. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Phil Edworthy <PHIL.EDWORTHY@renesas.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Signed-off-by: Tom Rini <trini@ti.com>