summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2012-09-25Merge branch 'master' of git://git.denx.de/u-boot-videoTom Rini
2012-09-25cmd_part: add partition-related commandStephen Warren
This implements the following: part uuid mmc 0:1 -> print partition UUID part uuid mmc 0:1 uuid -> set environment variable to partition UUID part list mmc 0 -> list the partitions on the specified device "part uuid" can be useful when writing a bootcmd which searches all known devices for something bootable, and then wants the kernel to use the same partition as the root device, e.g.: part uuid ${devtype} ${devnum}:${rootpart} uuid setenv bootargs root=PARTUUID=${uuid} ... Signed-off-by: Stephen Warren <swarren@nvidia.com>
2012-09-25disk: get_device_and_partition() "auto" partition and cleanupStephen Warren
Rework get_device_and_partition() to: a) Implement a new partition ID of "auto", which requests that U-Boot search for the first "bootable" partition, and fall back to the first valid partition if none is found. This way, users don't need to specify an explicit partition in their commands. b) Make use of get_device(). c) Add parameter to indicate whether returning a whole device is acceptable, or whether a partition is mandatory. d) Make error-checking of the user's device-/partition-specification more complete. In particular, if strtoul() doesn't convert all characters, it's an error rather than just ignored. The resultant device/partition returned by the function will be as follows, based on whether the disk has a partition table (ptable) or not, and whether the calling command allows the whole device to be returned or not. (D and P are integers, P >= 1) D D: No ptable: !allow_whole_dev: error allow_whole_dev: device D ptable: device D partition 1 D:0 !allow_whole_dev: error allow_whole_dev: device D D:P No ptable: error ptable: device D partition P D:auto No ptable: !allow_whole_dev: error allow_whole_dev: device D ptable: first partition in device D with bootable flag set. If none, first valid paratition in device D. Note: In order to review this patch, it's probably easiest to simply look at the file contents post-application, rather than reading the patch itself. Signed-off-by: Rob Herring <rob.herring@calxeda.com> [swarren: Rob implemented scanning for bootable partitions. I fixed a couple of issues there, switched the syntax to ":auto", added the error-checking rework, and ":0" syntax for the whole device] Signed-off-by: Stephen Warren <swarren@nvidia.com>
2012-09-25cmd_reiser: use common get_device_and_partition functionRob Herring
Convert reiserload and reiserls to use common device and partition parsing function. With the common function "dev:part" can come from the environment and a '-' can be used in that case. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-09-25cmd_zfs: use common get_device_and_partition functionRob Herring
Convert zfsload and zfsls to use common device and partition parsing function. With the common function "dev:part" can come from the environment and a '-' can be used in that case. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-09-25cmd_disk: use common get_device_and_partition functionRob Herring
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-09-25cmd_fat: use common get_device_and_partition functionRob Herring
Convert fatload, fatls, and fatinfo to use common device and partition parsing function. With the common function "dev:part" can come from the environment and a '-' can be used in that case. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-09-25cmd_extX: use common get_device_and_partition functionRob Herring
Convert ext2/4 load, ls, and write functions to use common device and partition parsing function. With the common function "dev:part" can come from the environment and a '-' can be used in that case. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-09-25ext4: remove init_fs/deinit_fsRob Herring
There's no real need to expose this and it can be removed by using a static allocation. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-09-25combine block device load commands into common functionRob Herring
All the raw block load commands duplicate the same code. Starting with the ide version as it has progress updates convert ide, usb, and scsi boot commands to all use a common version. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-09-25Merge branch 'master' of git://git.denx.de/u-boot-mpc85xxTom Rini
2012-09-24common/lcd: fix build breakage for at91sam9x5ek and trats boardsAnatolij Gustschin
Commit 203c37b8c5556aad1901ce4954792afd718c7d42 (common lcd: simplify core functions) and commit bfdcc65e1163b4891643c2a670570c478b9af2a4 (common lcd: simplify lcd_display_bitmap) caused build breakage for at91sam9x5ek board configurations and for trats board. Fix these build errors. Signed-off-by: Anatolij Gustschin <agust@denx.de> Acked-by: Nikita Kiryanov <nikita@compulab.co.il>
2012-09-24net: Improve the speed of netconsoleJoe Hershberger
Previously u-boot would initialize the network interface for every network operation and then shut it down again. This makes sense for most operations where the network in not known to be needed soon after the operation is complete. In the case of netconsole, it will use the network for every interaction with the shell or every printf. This means that the network is being reinitialized very often. On many devices, this intialization is very slow. This patch checks for consecutive netconsole actions and leaves the ethernet hardware initialized between them. It will still behave the same old way for all other network operations and any time another network operation happens between netconsole operations. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Cc: Stefano Babic <sbabic@denx.de> Acked-by: Stefano Babic <sbabic@denx.de>
2012-09-21Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini
2012-09-21common/lcd: add protection from null bmp pointerNikita Kiryanov
If the bmp pointer is null then U-Boot will get stuck when trying to load the image. What's worse, it will get stuck before the U-Boot shell becomes available to the user, thus making it difficult to correct the situation. To protect from the above scenario, check if the pointer is valid. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
2012-09-21Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini
2012-09-21Revert "memsize: Fix for bug in memory sizing code"Tom Rini
After further investigation this change is not correct and results in get_ram_size returning incorrectly large values. Reported first by Gerlando Falauto. This reverts commit b8496cced856ff411f1eb2e4eff20f5abe7080b0. Signed-off-by: Tom Rini <trini@ti.com>
2012-09-20usb: do explicit unaligned accessesLucas Stach
usb_hub_descriptor has to be packed as it's used for communication with the device. Member wHubCharacteristics violates the natural alignment rules. Use explicit unaligned access functions for this member. Fixes ARMv7 traping while using USB. v2: fix typo found by Thomas Langer v3: rebased on top of u-boot-usb/master Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-09-20Merge branch 'ext4'Tom Rini
Update Makefile change for LIBS -> LIBS-y change. Conflicts: Makefile Signed-off-by: Tom Rini <trini@ti.com>
2012-09-18env: make "env default" selective, check and applyGerlando Falauto
Change the syntax (user API) for "env default": -f: override write-once variables var... : accept individual variable(s) -a: all (resetting the whole env is NOT the default behavior) Enable variable checking and make changes effective by enabling do_apply argument to himport_r(). Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
2012-09-18env: check and apply changes on delete/destroyGerlando Falauto
Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com> Reviewed-by: Marek Vasut <marex@denx.de>
2012-09-18env: add check/apply logic to himport_r()Gerlando Falauto
Change hashtable so that a callback function will decide whether a variable can be overwritten, and possibly apply the changes. So add a new field to struct hsearch_data: o "apply" callback function to check whether a variable can be overwritten, and possibly immediately apply the changes; when NULL, no check is performed. And a new argument to himport_r(): o "do_apply": whether to call the apply callback function NOTE: This patch does not change the current behavior. Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com> Reviewed-by: Marek Vasut <marex@denx.de>
2012-09-18env: make himport_r() selective on variablesGerlando Falauto
Add 2 new arguments to himport_r(): o "nvars", "vars": number and list of variables to take into account (0 means ALL) NOTE: This patch does not change the current behaviour. Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com> Reviewed-by: Marek Vasut <marex@denx.de>
2012-09-18env: unify logic to check and apply changesGerlando Falauto
The logic of checking special parameters (e.g. baudrate, stdin, stdout, for a valid value and/or whether can be overwritten) and applying the new value to the running system is now all within a single function env_check_apply() which can be called whenever changes are made to the environment, no matter if by set, default or import. With this patch env_check_apply() is only called by "env set", retaining previous behavior. Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com> Reviewed-by: Marek Vasut <marex@denx.de>
2012-09-18env: cosmetic: drop assignment i = iomux_doenv()Gerlando Falauto
iomux_doenv() can only return 0 or 1. So there is no need to save its return value in variable i, as checking its truth value within an if statement is enough. Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com> Reviewed-by: Marek Vasut <marex@denx.de>
2012-09-18env_common: Add missing ethprimeBenoît Thébaudeau
The ethprime env var was missing from env_common. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de>
2012-09-18env import/export: Remove from help if disabledBenoît Thébaudeau
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-09-18memsize: Fix for bug in memory sizing codeIwo Mergler
The original memory sizing code in get_ram_size clobbers the word at the base address, but forgets to restore it. Signed-off-by: Iwo Mergler <Iwo.Mergler@netcommwireless.com>
2012-09-18env_nand: fix incorrect size parameter to ALLOC_CACHE_ALIGN_BUFFERStephen Warren
The third parameter to ALLOC_CACHE_ALIGN_BUFFER is not size (as named), but rather count (number of elements of the type to allocate). The current code ends up allocating one copy of env_t for each byte in its size, which quite possibly ends up overflowing RAM. This fixes a bug in commit 3801a15 "env_nand: align NAND buffers". Reported-by: Prabhakar Lad <prabhakar.csengg@gmail.com> Signed-off-by: Stephen Warren <swarren@nvidia.com> Reported-by: Prabhakar Lad <prabhakar.lad@ti.com>
2012-09-18dm: sparc: common: Fixup cmd_bdinfo warningsMarek Vasut
cmd_bdinfo.c: In function ‘do_bdinfo’: cmd_bdinfo.c:220:9: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat] cmd_bdinfo.c:222:9: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat] cmd_bdinfo.c:224:9: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat] cmd_bdinfo.c:226:9: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat] cmd_bdinfo.c:228:9: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat] Signed-off-by: Marek Vasut <marex@denx.de> Cc: Daniel Hellstrom <daniel@gaisler.com> Cc: u-boot-dm@lists.denx.de
2012-09-18Merge branch 'master' of git://git.denx.de/u-boot-nand-flashTom Rini
2012-09-17nand: Make NAND lock status compatible with MicronJoe Hershberger
Micron NAND flash (e.g. MT29F4G08ABADAH4) BLOCK LOCK READ STATUS is not the same as others. Instead of bit 1 being lock, it is #lock_tight. To make the driver support either format, ignore bit 1 and use only bit 0 and bit 2. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-09-17nand: Add support for unlock.invertJoe Hershberger
NAND unlock command allows an invert bit to be set to unlock all but the selected page range. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> [scottwood@freescale.com: updated docs and added comment about invert bit] Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-09-17Merge branch 'master' of git://git.denx.de/u-boot-fdtTom Rini
2012-09-15fdt: Check if the FDT address is configuredMarek Vasut
In case the "fdt addr" command wasn't ran yet and any other "fdt" subcommand was issued, the system crashed due to NULL pointer being used. This is caused by "fdt addr" command setting up a pointer to the FDT memory location. Prior issuing "fdt addr", the pointer is NULL so calling any other subcommands crashed the u-boot. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Simon Glass <sjg@chromium.org>
2012-09-13Merge branch 'master' of git://git.denx.de/u-boot-avr32Tom Rini
2012-09-13Fix strict-aliasing warning in dlmallocSimon Glass
This fixes the following warnings in dlmalloc seen with my gcc 4.6. dlmalloc.c: In function 'malloc_bin_reloc': dlmalloc.c:1493: warning: dereferencing pointer 'p' does break strict-aliasing rules dlmalloc.c:1493: warning: dereferencing pointer 'p' does break strict-aliasing rules dlmalloc.c:1490: note: initialized from here dlmalloc.c:1493: note: initialized from here This version is tested on avr32 arch boards. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2012-09-07env_mmc: allow environment to be in an eMMC partitionStephen Warren
eMMC devices may have hardware-level partitions: 2 boot partitions, up to 4 general partitions, plus the user area. This change introduces optional config variable CONFIG_SYS_MMC_ENV_PART to indicate which partition the environment should be stored in: 0=user, 1=boot0, 2=boot1, 4..7=general0..3. This allows the environment to be kept out of the user area, which simplifies the management of OS-/user-level (MBR/GPT) partitions within the user area. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
2012-09-07cmd_nand: dump: Align data and OOB buffersThierry Reding
In order for cache invalidation and flushing to work properly, the data and OOB buffers must be aligned to full cache lines. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
2012-09-05mmcinfo: Fix help messageBenoît Thébaudeau
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Andy Fleming <afleming@gmail.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
2012-09-05env_mmc: allow environment to be in an eMMC partitionStephen Warren
eMMC devices may have hardware-level partitions: 2 boot partitions, up to 4 general partitions, plus the user area. This change introduces optional config variable CONFIG_SYS_MMC_ENV_PART to indicate which partition the environment should be stored in: 0=user, 1=boot0, 2=boot1, 4..7=general0..3. This allows the environment to be kept out of the user area, which simplifies the management of OS-/user-level (MBR/GPT) partitions within the user area. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
2012-09-05common lcd: simplify lcd_display_bitmapNikita Kiryanov
Move highly platform dependant code into its own functions to reduce the number of #ifdefs in lcd_display_bitmap To avoid breaking the mcc200 board which does not #define CONFIG_CMD_BMP, this patch also implements bmp_display() for mcc200. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2012-09-05common lcd: simplify core functionsNikita Kiryanov
Move highly platform dependant code into its own function to reduce the number of #ifdefs in the bigger functions Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2012-09-05common lcd: simplify lcd_displayNikita Kiryanov
Simplify lcd_display by centralizing code into a funciton Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2012-09-05common lcd: simplify lcd_logoNikita Kiryanov
Simplify lcd_logo by extracting bmp unzip into its own function. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2012-09-03cfi: Make the flash erase and write operations abortableJoe Hershberger
Check for ctrlc() in operations that take time and loop over the flash addresses. In netconsole, tstc() is expensive. Only check once in a while to not slow down the operation significantly. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Stefan Roese <sr@denx.de>
2012-09-02hush: Don't parse the contents of a dereferenced varJoe Hershberger
When a variable which contains a user-supplied value is dereferenced (e.g. to be echo'ed), make sure that the value is not further parsed by hush. Set the hush local variable "HUSH_NO_EVAL=1" to enable this behavior. Without this patch, a sequence like this occurs: Panda # env set my_user_string Bob\'s favorite device Panda # print my_user_string my_user_string=Bob's favorite device Panda # echo $my_user_string syntax error hush.c:3007 With this patch, it looks like this: Panda # HUSH_NO_EVAL=1 Panda # env set my_user_string Bob\'s favorite device Panda # print my_user_string my_user_string=Bob's favorite device Panda # echo $my_user_string Bob's favorite device Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-09-02hush: Add default value substitution supportJoe Hershberger
Use standard sh syntax: ${VAR:-default} Use default value: if VAR is set and non-null, expands to $VAR. Otherwise, expands to default. ${VAR:=default} Set default value: if VAR is set and non-null, expands to $VAR. Otherwise, sets hush VAR to default and expands to default. ${VAR:+default} If VAR is set and non-null, expands to the empty string. Otherwise, expands to default. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-09-02env_nand: align NAND buffersStephen Warren
This allows cache flush/invalidate operations to succeed on the buffers. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Scott Wood <scottwood@freescale.com>
2012-09-02image/FIT: Add ramdisk load, entry address and OS tag inclusionJagannadha Sutradharudu Teki
This patch adds support to include Load, Entry address and OS tag of ramdisk on to FIT image through mkimage tool. Signed-off-by: Jagannadha Sutradharudu Teki <402jagan@gmail.com>