summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* sandbox: add getopt supportSimon Glass2012-03-129-0/+304
| | | | | | | | | | | | | | | This adds simple command-line parsing to sandbox. The idea is that it sets up the state with options provided, and this state can then be queried later, as needed. New flags are declared with the SB_CMDLINE_OPT_SHORT helper macro, pointers are automatically gathered up in a special section, and then the core code takes care of gathering them up and processing at runtime. This way there is no central place where we have to store a list of flags with ifdefs. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: allow processing before main loopSimon Glass2012-03-123-0/+10
| | | | | | | | | In order to pass command line arguments to sandbox we need to be able to act on them. So take control back at the end of board_init_r() from where we can call the main loop or do something else. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: add concept of sandbox stateSimon Glass2012-03-124-2/+117
| | | | | | | | | | | | The state exists through the life of U-Boot. It can be adjusted by command line options and perhaps later through a config file. It is available to U-Boot through state_...() calls (within sandbox code). The primary purpose of this is to contain the "hardware" state. It should only be used by sandbox internal code. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: disable fortificationMike Frysinger2012-03-121-1/+1
| | | | | | | | Since we provide all our own library calls, the fortification from glibc just gets in our way (which some distros enable by default). Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: u-boot.lds: tweak styleMike Frysinger2012-03-121-5/+5
| | | | | | | We use tabs for indentation, not spaces. Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: add get_{tbclk,ticks}Mike Frysinger2012-03-121-0/+10
| | | | | | Fixes building after recent readline updates with timeouts. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: enable GPIO driverSimon Glass2012-03-121-0/+4
| | | | | | | Enable the new GPIO driver for sandbox. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: gpio: add basic driver for simulating GPIOsSimon Glass2012-03-123-0/+291
| | | | | | | | This provides a way of simulating GPIOs by setting values which are seen by the normal gpio_get/set_value() calls. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: add flags for open() callSimon Glass2012-03-122-8/+33
| | | | | | | | This provides a way for callers to create files for writing. The flags are translated at runtime, for the ones we support. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: config: enable fdt and snprintf() optionsSimon Glass2012-03-121-0/+6
| | | | | | | Enable fdt code and safe snprintf() options for sandbox. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: fdt: add support for CONFIG_OF_CONTROLSimon Glass2012-03-122-0/+9
| | | | | | | This adds support for a controlling fdt, mirroring the ARM implementation. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: add lseek helperMike Frysinger2012-03-122-0/+28
| | | | | | | Follow up patches want to be able to seek fd's. Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: add ifdef protection to os.hMike Frysinger2012-03-121-0/+5
| | | | | Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: add required header to os.cSimon Glass2012-03-121-0/+1
| | | | | | | We should include the sys/time.h header to avoid warnings. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: sort header files in os.cSimon Glass2012-03-121-4/+4
| | | | | | | Tidy this up as the list is long and likely to get longer. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* image: Support FDTs already loaded at their load addressStephen Warren2012-03-061-3/+10
| | | | | | | | | | | | | boot_get_fdt() expects a uImage-wrapped FDT to be loaded to a staging location, and then memmove()s it to the load address specified in the header. This change enhances boot_get_fdt() to detect when the image has already been loaded to the correct address, and skip this memmove(). The detection algorithm was written to match the equivalent for the kernel; see bootm_load_os()'s IH_COMP_NONE case. v2: New patch Signed-off-by: Stephen Warren <swarren@nvidia.com>
* cmd_cache: use cache/invalidate functions available in common.hStefan Kristiansson2012-03-061-8/+8
| | | | | | | | | | flush_dcache()/flush_icache() aren't defined in common.h, flush_dcache_all()/invalidate_icache_all() however are. Let the icache and dcache commands use those instead. Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi> Acked-by: Mike Frysinger <vapier@gentoo.org>
* tools: checkstack.pl from Linux added to toolsTom Rini2012-03-062-0/+176
| | | | | | Added from Linux - commit 62aa2b537c6f5957afd98e29f96897419ed5ebab Signed-off-by: Tom Rini <trini@ti.com>
* Makefile: Remove mmc_spl related enteriesChander Kashyap2012-03-061-9/+1
| | | | | | | As mmc_spl now follows SPL infrastructure, removed unwanted entries in Makefile for mmc_spl related compilation. Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org>
* Merge branch 'master' of git://git.denx.de/u-boot-x86Wolfgang Denk2012-03-061-3/+2
|\ | | | | | | | | * 'master' of git://git.denx.de/u-boot-x86: sc520: fix build warning about unused temp var
| * sc520: fix build warning about unused temp varMike Frysinger2012-03-061-3/+2
| | | | | | | | | | | | | | | | | | | | | | Building the eNET_SRAM board fails for me: sc520_timer.c: In function 'sc520_udelay': sc520_timer.c:81:7: error: variable 'temp' set but not used [-Werror=unused-but-set-variable] cc1: all warnings being treated as errors make[1]: *** [sc520_timer.o] Error 1 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* | PPC: Drop mv6446x_eth_initialize() from net/eth.cMarek Vasut2012-03-065-6/+13
| | | | | | | | | | | | | | | | This function was defined as an extern in net/eth.c, drop that and use standard means of calling it. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Stefan Roese <sr@denx.de>
* | PPC: Drop mv6436x_eth_initialize() from net/eth.cMarek Vasut2012-03-065-5/+12
| | | | | | | | | | | | | | | | This function was defined as an extern in net/eth.c, drop that and use standard means of calling it. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Reinhard Arlt <reinhard.arlt@esd-electronics.com>
* | Convert cmd_usage() calls in common to use a return valueSimon Glass2012-03-0657-168/+167
| | | | | | | | | | | | | | | | | | Change all files in common/ to use CMD_RET_USAGE instead of calling cmd_usage() directly. I'm not completely sure about this patch since the code since impact is small (100 byte or so on ARM) and it might need splitting into smaller patches. But for now here it is. Signed-off-by: Simon Glass <sjg@chromium.org>
* | Add cmd_process() to process commands in one placeSimon Glass2012-03-064-78/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | We currently have the same code in hush.c and main.c. This brings the code into one place. As an added feature, if the command function returns CMD_RET_USAGE then cmd_process() will print a usage message for the command before returning the standard failure code of 1. ARM code size increases about 32 bytes with this clean-up. Signed-off-by: Simon Glass <sjg@chromium.org>
* | Remove interleave of non-U-Boot code in hushSimon Glass2012-03-061-13/+11
| | | | | | | | | | | | | | There is a nasty interleave of #ifdefs in hush.c where the two code paths have different indents. Remove this ickiness. Signed-off-by: Simon Glass <sjg@chromium.org>
* | Create a single cmd_call() function to handle command executionSimon Glass2012-03-064-8/+28
| | | | | | | | | | | | | | We should aim for a single point of entry to the commands, whichever parser is used. Signed-off-by: Simon Glass <sjg@chromium.org>
* | Don't include standard parser if hush is usedSimon Glass2012-03-061-0/+2
| | | | | | | | | | | | | | This saves about 1KB of code space on ARM with CONFIG_SYS_HUSH_PARSER defined. Signed-off-by: Simon Glass <sjg@chromium.org>
* | Stop using builtin_run_command()Simon Glass2012-03-069-43/+34
| | | | | | | | | | | | | | | | | | | | Boards can select either the 'built-in' parser or the hush parser. We should not call builtin_run_command() if we are using the hush parser. We use run_command() instead, since it knows how to call the correct parser. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
* | Rename run_command2() to run_command()Simon Glass2012-03-063-7/+7
| | | | | | | | | | | | | | This is a more sensible name, so rename it. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
* | Rename run_command() to builtin_run_command()Simon Glass2012-03-069-13/+14
| | | | | | | | | | | | | | | | | | The current run_command() is only one of the parsing options - the other is hush. We should not call run_command() when the hush parser is being used. So we rename this function to better explain its purpose. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
* | Remove CMD_PXE's static on run_command()Simon Glass2012-03-062-5/+0
| | | | | | | | | | | | | | | | It really isn't clear why this is here and there is no comment, so drop it. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
* | Remove execute permissions from source filesThomas Weber2012-03-043-0/+0
|/ | | | Signed-off-by: Thomas Weber <weber@corscience.de>
* integrator: remove fragile delay loop from PCI codeLinus Walleij2012-03-041-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The reference implementation of the PCI initialization code almost everywhere contain this fragile loop of "a few usecs", and its use of volatile variables to delay a number of bus cycles is indeed uncertain. Reading the manual "Integrator/AP Users Guide", page 5-15 it is clearly stated: "Wait until 230ms after the end of the reset period before accessing V360EPC internal registers. The V360EPC supports the use of a serial configuration PROM and the software must wait for the device to detect the absence of this PROM before accessing any registers. The required delay is a function of the PCI Clock, but at the lower frequency (25MHz) is 230ms". So let's simply wait 230ms per the spec. This solves the compilation error that looked like this: pci.c: In function ‘pci_init_board’: pci.c:286:18: warning: variable ‘j’ set but not used Reported-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* pci: move pciauto_config_init() to pci.hLinus Walleij2012-03-045-4/+1
| | | | | | | | | | | | | Fixing build regressions for the Integrator I get find that a few boards try to work around the missing declaration of pciauto_config_init() by declaring it in the local scope. This does not make sense when the sibling functions are in <pci.h> so move the function to the header, ridding the build error in the Integrator and getting rid of the local declarations here and there. Reported-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* ppc: Change memsz variable to signed charSimon Glass2012-03-031-4/+3
| | | | | | | | This seems to be unsigned char for no good reason. Tidy this up and remove the casts. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
* m68k: Change memsz to a signed char to avoid warningSimon Glass2012-03-031-1/+1
| | | | | | | | | | There doesn't seem to be any reason for using uchar here, so change it to char. This fixes a warning: pointer targets in passing argument 1 of 'sprintf' differ in signedness Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
* USB: relax usbcore reset timingsWolfgang Grandegger2012-03-031-1/+4
| | | | | | | | | | | | Following the corresponding Linux code, this patch relaxes reset timings waiting at least 100ms after power to the ports. There are some reports that it helps make enumeration work better on some high speed devices. Furthermore, the wait is only done once after power has been enabled on all ports. CC: Remy Bohmer <linux@bohmer.net> CC: Vincent Palatin <vpalatin@chromium.org> Signed-off-by: Wolfgang Grandegger <wg@denx.de>
* USB: move keyboard polling into kbd driveramartin@nvidia.com2012-03-036-72/+17
| | | | | | | | | This moves keyboard polling logic from USB HCD drivers into USB keyboard driver. Remove usb_event_poll() as keyboard polling was the only user of this API. With this patch USB keyboard works with EHCI controllers again. Tested on a tegra2 seaboard. Signed-off-by: Allen Martin <amartin@nvidia.com>
* USB: reevaluate iomux stdin on USB kbd detectamartin@nvidia.com2012-03-031-0/+6
| | | | | | | If CONSOLE_MUX is enabled, reevaluate console stdin when USB keyboard device is detected. Signed-off-by: Allen Martin <amartin@nvidia.com>
* usb: add numeric keypad support to HID driverVincent Palatin2012-03-031-0/+10
| | | | | | | When keys are pressed on the numeric keypad, emit key codes for the numbers, operators, dot and enter. Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
* USB: fix USB keyboard polling parameterVincent Palatin2012-03-031-1/+1
| | | | | | | | When doing a "GET_REPORT" request on the keyboard control endpoint, the report ID should 0 (ie report ID not used) rather than 1 as reports are not used in boot mode. Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
* eth: remove usb-ethernet devices before re-enumerating themVincent Palatin2012-03-033-2/+35
| | | | | | | | Fix the crash when running several times usb_init() with a USB ethernet device plugged. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Tested-by: Wolfgang Grandegger <wg@denx.de>
* USB: Make struct devrequest setup_packet localMarek Vasut2012-03-031-1/+2
| | | | | | Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Cc: Remy Bohmer <linux@bohmer.net> Acked-by: Mike Frysinger <vapier@gentoo.org>
* USB: Separate out USB hub driverMarek Vasut2012-03-034-431/+487
| | | | | | Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Cc: Remy Bohmer <linux@bohmer.net> Acked-by: Mike Frysinger <vapier@gentoo.org>
* USB: Staticize internal functionsMarek Vasut2012-03-031-22/+23
| | | | | | Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Cc: Remy Bohmer <linux@bohmer.net> Acked-by: Mike Frysinger <vapier@gentoo.org>
* Merge branch 'master' of git://git.denx.de/u-boot-nand-flashWolfgang Denk2012-03-036-73/+54
|\ | | | | | | | | | | | | | | | | * 'master' of git://git.denx.de/u-boot-nand-flash: cmd_nand.c: Fix 'nand dump' after latest MTD resync mtd/nand:Fix wrong usage of is_blank() in fsl_ifc_run_command mtd/nand: Fix IFC driver to support 2K NAND page nand: reinstate lazy bad block scanning Revert "nand: make 1-bit software ECC configurable"
| * cmd_nand.c: Fix 'nand dump' after latest MTD resyncTom Rini2012-02-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With 2a8e0fc nand_do_read_ops changed in behavior slightly (keeping in sync with the kernel which did this change in b64d39d8) such that the OOB data is always copied into oobbuf and never appended to datbuf. Within U-Boot only the nand_dump function (for the dump nand subcommand) was expecting the OOB data to only be appended to datbuf. So we now change nand_dump to not malloc extra space, correct the comment about datbuf and OOB data and switch the pointer to oobbuf before printing. Cc: Scott Wood <scottwood@freescale.com> Signed-off-by: Tom Rini <trini@ti.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
| * mtd/nand:Fix wrong usage of is_blank() in fsl_ifc_run_commandPrabhakar Kushwaha2012-02-281-24/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Freescale IFC NAND Machine calculates ECC on 512byte sector and same is used in fsl_ifc_run_command() during ECC status verification. Also this sector is passed to is_blank() for blank checking. It is wrong at first place because is_blank()'s implementation checks for Page size and OOB area size. is_blank() should be called per page for main and OOB area verification. Variables name are redefined to avoid confusion between buffer and ecc sector. Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com> Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
| * mtd/nand: Fix IFC driver to support 2K NAND pagePrabhakar Kushwaha2012-02-281-14/+13
| | | | | | | | | | | | | | | | | | | | | | 1) OOB area should be updated irrespective of NAND page size. Earlier it was updated only for 512byte NAND page. 2) During OOB update fbcr should be equal to OOB size. Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com> Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
OpenPOWER on IntegriCloud