summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2013-05-30Merge branch 'u-boot/master' into 'u-boot-arm/master'Albert ARIBAUD
Conflicts: common/cmd_fpga.c drivers/usb/host/ohci-at91.c
2013-05-24common: Update cmd_bdinfo for PPCYork Sun
Add board detail function to print more individual board information. Signed-off-by: York Sun <yorksun@freescale.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
2013-05-24cmd_mem: fix cp commandMasahiro Yamada
The "cp" command has not worked since commit 0628ab8ec59834f98ede267edd21ddb8ba0bb57b, because of the following lines, which set the destination and the source to the same address. buf = map_sysmem(addr, bytes); src = map_sysmem(addr, bytes); Tested-by: Tom Rini <trini@ti.com> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2013-05-17fdt_support: Use CONFIG_NR_DRAM_BANKS if definedDoug Anderson
It appears that there are some cases where we have more than 4 banks of memory. Use CONFIG_NR_DRAM_BANKS if it's defined to handle this. This will take up a little extra stack space (64 bytes extra if we go up to 8 banks), but that seems OK. Signed-off-by: Doug Anderson <dianders@chromium.org>
2013-05-17bootm: Avoid 256-byte overflow in fixup_silent_linux()Doug Anderson
This makes fixup_silent_linux() use malloc() to allocate its working space, meaning that our maximum kernel command line should only be limited by malloc(). Previously it was silently overflowing the stack. Note that nothing about this change increases the kernel's maximum command line length. If you have a command line that is >256 bytes it's up to you to make sure that kernel can handle it. Signed-off-by: Doug Anderson <dianders@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
2013-05-15Power: remove support for Freescale MPC8220Wolfgang Denk
The Freescale MPC8220 Power Architecture processors have long reached EOL; Freescale does not even list these any more on their web site. Remove the code to avoid wasting maitaining efforts on dead stuff. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Andy Fleming <afleming@gmail.com>
2013-05-15drivers/mmc: move spl_mmc.c to common/splYing Zhang
The mpc85xx repuires a special layout on the memory device that is connected to the eSDHC controller interface. But the file spl_mmc.c didn't handle this specfic case, there needs a special treatmen, in the powerpc drictory. So, there is no longer to keep spl_mmc.c on mpc85xx, CONFIG_SPL_FRAMEWORK is not set. When CONFIG_SPL_MMC_SUPPORT is set and CONFIG_SPL_FRAMEWORK is not set, there was an error in drivers/mmc/spl_mmc.c: drivers/mmc/libmmc.o:(.got2+0x8): undefined reference to `spl_image'. Now, the solution is to move the file "spl_mmc.c" to directory "common/spl". Signed-off-by: Ying Zhang <b40530@freescale.com>
2013-05-14arm: Refactor bootm to reduce #ifdefsSimon Glass
With fewer #ifdefs the code is more readable and more of the code is compiled for all boards. Add defines in the header file to control what features are enabled, and then use if() instead of #ifdef. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-14image: Add device tree setup to image librarySimon Glass
This seems to be a common function for several architectures, so create a common function rather than duplicating the code in each arch. Also make an attempt to avoid introducing #ifdefs in the new code, partly by removing useless #ifdefs around function declarations in the image.h header. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-14image: Split libfdt code into image-fdt.cSimon Glass
The image file is still very large, and some of the code is only used when libfdt is in use. Move this code into a new file. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-14image: Add CONFIG_FIT_SPL_PRINT to control FIT image printing in SPLSimon Glass
This code is very large, and in SPL it isn't always useful to print out image information (in fact there might not even be a console active). So disable this feature unless this option is set. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-14image: Remove remaining #ifdefs in image-fit.cSimon Glass
There are only two left. One is unnecessary and the other can be moved to the header file. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-14sandbox: image: Add support for booting images in sandboxSimon Glass
Much of the image code uses addresses as ulongs and pointers interchangeably, casting between the two forms as needed. This doesn't work with sandbox, which has a U-Boot RAM buffer which is separate from the host machine's memory. Adjust the cost so that translating from a U-Boot address to a pointer uses map_sysmem(). This allows bootm to work correctly on sandbox. Note that there are no exhaustive tests for this code on sandbox, so it is possible that some dark corners remain. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de> (v1)
2013-05-14image: Rename hash printing to fit_image_print_verification_data()Simon Glass
This function will be used to print signatures as well as hashes, so rename it. Also make it static since it is not used outside this file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
2013-05-14image: Export fit_conf_get_prop_node()Simon Glass
This function will be needed by signature checking code, so export it, and also add docs. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-14image: Move error! string to common placeSimon Glass
The string " error\n" appears in each error string. Move it out to a common place. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
2013-05-14image: Move hash checking into its own functionSimon Glass
The existing function is long and most of the code is indented a long way. Before adding yet more code, split this out into its own function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de> (v1)
2013-05-14image: Rename fit_image_check_hashes() to fit_image_verify()Simon Glass
This is the main entry point to the FIT image verification code. We will be using it to handle image verification with signatures, so rename the function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
2013-05-14image: Move HOSTCC image code to tools/Simon Glass
This code is never compiled into U-Boot, so move it into a separate file in tools/ to avoid the large #ifdef. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
2013-05-14image: Split FIT code into new image-fit.cSimon Glass
The FIT code is about half the size of the >3000-line image.c. Split this code into its own file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
2013-05-14image: Export fit_check_ramdisk()Simon Glass
One we split out the FIT code from image.c we will need this function. Export it in the header. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
2013-05-14image: Move timestamp #ifdefs to header fileSimon Glass
Rather than repeat the line #if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) || \ defined(USE_HOSTCC) everywhere, put this in a header file and #define IMAGE_ENABLE_TIMESTAMP to either 1 or 0. Then we can use a plain if() in most code and avoid the #ifdefs. The compiler's dead code elimination ensures that the result is the same. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Marek Vasut <marex@denx.de>
2013-05-14hash: Add a way to calculate a hash for any algortihmSimon Glass
Rather than needing to call one of many hashing algorithms in U-Boot, provide a function hash_block() which handles this, and can support all available hash algorithms. Once we have md5 supported within hashing, we can use this function in the FIT image code. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-14env: Fix minor comment typos in cmd_nveditSimon Glass
This should say 'environmnent'. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-14Merge branch 'master' of git://git.denx.de/u-boot-blackfin into ↵Tom Rini
powerpc-eldk53-warning-fixes
2013-05-13x86: Fix warning in cmd_ximg.c when CONFIG_GZIP is not definedSimon Glass
This local variable is not used unless CONFIG_GZIP is defined. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2013-05-13bootstage: Allow marking a particular line of codeSimon Glass
Add a function which allows a (file, function, line number) to be marked in bootstage. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
2013-05-13Call bootstage_relocate() after malloc is inittedDoug Anderson
In a previous CL we added the bootstage_relocate(), which should be called after malloc is initted. Now we call it on generic board. Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2013-05-13bootstage: Copy bootstage strings post-relocationDoug Anderson
Any pointers to name strings that were passed to bootstage_mark_name() pre-relocation should be copied post-relocation so that they don't get trashed as the original location of U-Boot is re-used for other purposes. This change introduces a new API call that should be called from board_init_r() after malloc has been initted on any board that uses bootstage. Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2013-05-13blackfin: bf609: add softswitch config commandBob Liu
Add softswitch_output command for bf609-ezkit to enable softswitches. Signed-off-by: Bob Liu <lliubbo@gmail.com> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
2013-05-11Merge branch 'u-boot-ti/master' into 'u-boot-arm/master'Albert ARIBAUD
2013-05-11Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'Albert ARIBAUD
Conflicts: drivers/mtd/nand/mxc_nand_spl.c include/configs/m28evk.h
2013-05-11Merge branch 'u-boot-pxa/master' into 'u-boot-arm/master'Albert ARIBAUD
2013-05-10ARM: OMAP: Cleanup boot parameters usageSRICHARAN R
The boot parameters are read from individual variables assigned for each of them. This been corrected and now they are stored as a part of the global data 'gd' structure. So read them from 'gd' instead. Signed-off-by: Sricharan R <r.sricharan@ti.com> [trini: Add igep0033 hunk] Signed-off-by: Tom Rini <trini@ti.com>
2013-05-06cmd: fpga: Do not include net.hMichal Simek
There is no reason to include net.h header in fpga code. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@ti.com>
2013-05-06cmd: fpga: Move fpga_loadbitstream to fpga.cMichal Simek
In bitstream decoding you can directly check device which you want to load and in fpga.c are fpga_validate and fpga_dev_info functions which should be used for it. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@ti.com>
2013-05-06cmd: fpga: Clean coding styleMichal Simek
No functional changes. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Tom Rini <trini@ti.com>
2013-05-06usb: fix: Fixing Port status and feature number constantsVivek Gautam
Fix the Port status bit constants and Port feature number constants as a part of USB 2.0 and USB 3.0 Hub class. Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
2013-05-06usb: hub: Parallelize power-cycling of root-hub portsVivek Gautam
Untill now we power-cycle (aka: disable power on a port and re-enabling again) one port at a time. Delay of 20ms for Port-power to change multiplies with number of ports in this case. So better we parallelize this process: disable power on all ports, wait for port-power to stabilize and then re-enable the power subsequently. Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
2013-05-05USB: SS: Add support for Super Speed USB interfaceVivek Gautam
This adds usb framework support for super-speed usb, which will further facilitate to add stack support for xHCI. Signed-off-by: Vikas C Sajjan <vikas.sajjan@samsung.com> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
2013-05-05usb: hub: Fix enumration timeoutVivek Gautam
Patch b6d7852c increases timeout for enumeration, taking worst case to be 10 sec. get_timer() api returns timestamp in milliseconds, which is what we are checking in the do-while() loop in usb_hub_configure() (get_timer(start) < CONFIG_SYS_HZ * 10). This should give us a required check for 10 seconds, and thereby we don't need to add additional mdelay of 100 microseconds in each cycle. Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> Reviewed-by: Vipin Kumar <vipin.kumar@st.com>
2013-05-05usb: Update device class in usb device's descriptorVivek Gautam
Fetch the device class into usb device's dwcriptors, so that the host controller's driver can use this info to differentiate between HUB and DEVICE. Signed-off-by: Amar <amarendra.xt@samsung.com>
2013-05-05usb: hub: Power-cycle on root-hub portsVivek Gautam
XHCI ports are powered on after a H/W reset, however EHCI ports are not. So disabling and re-enabling power on all ports invariably. Signed-off-by: Amar <amarendra.xt@samsung.com> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
2013-05-05USB: Some cleanup prior to USB 3.0 interface additionVivek Gautam
Some cleanup in usb framework, nothing much on feature side. Signed-off-by: Vikas C Sajjan <vikas.sajjan@samsung.com> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
2013-05-05usb: common: Weed out USB_**_PRINTFs from usb frameworkVivek Gautam
USB_PRINTF, USB_HUB_PRINTF, USB_STOR_PRINTF, USB_KBD_PRINTF are nothing but conditional debug prints, depending on DEBUG. So better remove them and use debug() simply. Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
2013-05-05usb: Add new command to set USB 2.0 port test modesJulius Werner
This patch adds a new 'usb test' command, that will set a port to a USB 2.0 test mode (see USB 2.0 spec 7.1.20). It supports all five test modes on both downstream hub ports and ordinary device's upstream ports. In addition, it supports EHCI root hub ports. Signed-off-by: Julius Werner <jwerner@chromium.org>
2013-05-01env_mmc: add support for redundant environmentMichael Heimpold
This patch add support for storing the environment redundant on mmc devices. Substantially it re-uses the logic from the NAND implementation, that means using an incremental counter for marking newer data. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
2013-05-01lib: consolidate hang()Andreas Bießmann
Delete all occurrences of hang() and provide a generic function. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Acked-by: Albert ARIBAUD <albert.u.boot@aribaud.net> [trini: Modify check around puts() in hang.c slightly] Signed-off-by: Tom Rini <trini@ti.com>
2013-05-01part/dev_desc: Add log2 of blocksize to block_dev_desc data structEgbert Eich
log2 of the device block size serves as the shift value used to calculate the block number to read in file systems when implementing avaiable block sizes. It is needed quite often in file systems thus it is pre-calculated and stored in the block device descriptor. Signed-off-by: Egbert Eich <eich@suse.com>
2013-05-01setexpr: add regex substring matching and substitutionWolfgang Denk
Add "setexpr name gsub r s [t]" and "setexpr name sub r s [t]" commands which implement substring matching for the regular expression <r> in the string <t>, and substitution of the string <s>. The result is assigned to the environment variable <name>. If <t> is not supplied, the previous value of <name> is used instead. "gsub" performs global substitution, while "sub" will replace only the first substring. Both commands are closely modeled after the gawk functions with the same names. Examples: - Generate broadcast address by substituting the last two numbers of the IP address by "255.255": => print ipaddr ipaddr=192.168.1.104 => setexpr broadcast sub "(.*\\.).*\\..*" "\\1255.255" $ipaddr broadcast=192.168.255.255 - Depending on keyboard configuration (German vs. US keyboard) a barcode scanner may initialize the MAC address as C0:E5:4E:02:06:DC or as C0>E5>4E>02>06>DC. Make sure we always have a correct value: => print ethaddr ethaddr=C0>E5>4E>02>06>DC => setexpr ethaddr gsub > : ethaddr=C0:E5:4E:02:06:DC - Do the same, but substitute one step at a time in a loop until no futher matches: => setenv ethaddr C0>E5>4E>02>06>DC => while setexpr ethaddr sub > : > do > echo ----- > done ethaddr=C0:E5>4E>02>06>DC ----- ethaddr=C0:E5:4E>02>06>DC ----- ethaddr=C0:E5:4E:02>06>DC ----- ethaddr=C0:E5:4E:02:06>DC ----- ethaddr=C0:E5:4E:02:06:DC ----- C0:E5:4E:02:06:DC: No match => print ethaddr ethaddr=C0:E5:4E:02:06:DC etc. To enable this feature, the CONFIG_REGEX option has to be defined in the board config file. Signed-off-by: Wolfgang Denk <wd@denx.de>