Commit Graph

2033 Commits

Author SHA1 Message Date
Horst Kronstorfer d3f80c77ca common/cmd_nvedit.c: Fix size calculation in do_env_import()
do_env_import() missed the final '\0' terminator when calculating the
size of an environment data block.  This led to an erroneous 'bad CRC,
import failed' message for a checksum protected environment (-c.)

Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
2011-12-19 10:19:34 +01:00
Andreas Bießmann a97f6efdb1 cmd_sf.c: fix printf() length modifier
size_t is not always 'unsigned int', use corret length modifer.

This patch fixes following warning:

---8<---
cmd_sf.c: In function 'spi_flash_update_block':
cmd_sf.c:130: warning: format '%#x' expects type 'unsigend int', but argument 4 has type 'size_t'
cmd_sf.c:135: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'size_t'
--->8---

Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
cc: Mike Frysinger <vapier@gentoo.org>
cc: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-12-17 23:55:36 +01:00
Sonny Rao 068af6f843 Make printf and vprintf safe from buffer overruns
From: Sonny Rao <sonnyrao@chromium.org>

utilize the added vscnprintf functions to avoid buffer overruns
The implementation is fairly dumb in that it doesn't detect
that the buffer is too small, but at least will not cause crashes.

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
2011-12-17 23:34:43 +01:00
Tom Rini b2fb47f187 USB: Use (get|put)_unaligned for accessing wMaxPacketSize
In 9792987721 Stefan describes a usecase
where the previous behavior of leaving wMaxPacketSize be unaligned
caused fatal problems.  The initial fix for this problem was incomplete
however as it showed another cases of non-aligned access that previously
worked implicitly.  This switches to making sure that all access of
wMaxPacketSize are done via (get|put)_unaligned.

In order to maintain a level of readability to the code in some cases
we now use a variable for the value of wMaxPacketSize and in others, a
macro.

Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Remy Bohmer <linux@bohmer.net>

OpenRISC:
Tested-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>

Beagleboard xM, Pandaboard run-tested, s5p_goni build-tested.
Signed-off-by: Tom Rini <trini@ti.com>
2011-12-16 21:37:17 +01:00
Horst Kronstorfer d798a9b5d5 common/cmd_nvedit.c: Add missing 'env save' preproc guard
Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
2011-12-12 08:25:38 +01:00
Kumar Gala 3b2001105f powerpc/bootm: Flush ramdisk and device tree image when booting on MP
We already flush the kernel image after we've loaded it to ensure
visiblity to the other cores.  We need to do the same thing for the
ramdisk and device tree images.  In AMP boot scenarios we might not be
HW cache coherent with the secondary core that we are loading and
setting the ramdisk and device tree up for.  Thus we need to ensure
we've flushed the regions of memory utilized by ramdisk and device tree
so the loadding and any modifications (from decompression or fdt updates)
are made visible to the secondary cores.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2011-12-12 08:17:52 +01:00
Wolfgang Denk b2eb7d9bc6 Merge branch 'master' of git://git.denx.de/u-boot-usb
* 'master' of git://git.denx.de/u-boot-usb:
  USB: efikamx: Enable USB on EfikaMX and EfikaSB
  USB: Add generic ULPI layer and a viewport
  USB: EHCI: Allow EHCI post-powerup configuration in board files
  USB: mx51evk: add end enable USB host support on port 1
  USB: mx53loco: add end enable USB host support on port 1
  USB: MX5: Add MX5 usb post-init callback
  USB: MX5: Abstract out mx51 USB pixmux configuration
  USB: MX5: add generic USB EHCI support for mx51 and mx53
  USB: MX5: add helper functions to enable USB clocks
  usb:gadget:s5p Enable the USB Gadget framework at GONI
  usb:gadget:s5p USB Device Controller (UDC) implementation
  ehci: speed up initialization
  usb: add help for missing start subcommand
  cosmetic: remove excess whitespace from usb command help
  usb: align usb_endpoint_descriptor to 16-bit boundary
  usbtty: init endpoints prior to startup events
  pxa: convert pxa27x_udc to use read and write functions
  pxa: activate the first usb host port on pxa27x by default
  pxa: fix usb host register mismatch
  ehci-fsl: correct size of ehci caplength
  USB: Add usb_event_poll() to get keyboards working with EHCI
  USB: gadaget: add Marvell controller support
  USB: Fix complaints about strict aliasing in OHCI-HCD
  USB: Drop dead code from usb_kbd.c
  USB: Rework usb_kbd.c
  USB: Add functionality to poll the USB keyboard via control EP
2011-12-12 07:58:58 +01:00
Veli-Pekka Peltola 1af9f96337 usb: add help for missing start subcommand
Signed-off-by: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
Cc: Remy Bohmer <linux@bohmer.net>
2011-12-11 14:42:52 +01:00
Veli-Pekka Peltola b3813a221b cosmetic: remove excess whitespace from usb command help
Signed-off-by: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
Cc: Remy Bohmer <linux@bohmer.net>
2011-12-11 14:42:35 +01:00
Marek Vasut 5a1219efe9 USB: Drop dead code from usb_kbd.c
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Cc: Remy Bohmer <linux@bohmer.net>
Cc: Wolfgang Denk <wd@denx.de>
2011-12-11 14:40:38 +01:00
Marek Vasut 9a8c72a6c4 USB: Rework usb_kbd.c
* Support dynamic allocation of devices
* Passing data via usb device privptr
* Reorder functions to avoid forward declarations
* Introduce generic polling mechanism to fix musb and ehci-hcd breakage
  due to using "extern new;" to access keyboard driver data!

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Cc: Remy Bohmer <linux@bohmer.net>
Cc: Wolfgang Denk <wd@denx.de>
2011-12-11 14:40:38 +01:00
Marek Vasut 48c8073ec9 USB: Add functionality to poll the USB keyboard via control EP
This allows the keyboard to avoid requests via Interrupt Endpoint altogether and
run all requests via Control Endpoint. This uses the Get_Report request.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Remy Bohmer <linux@bohmer.net>

Rebased on current code.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
2011-12-11 14:40:38 +01:00
Matthias Weisser 21899b1085 sandbox: Add improved RAM simulation
Using mmap to allocate memory from the OS for RAM simulation we can use
u-boot own malloc implementation.

Tested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Matthias Weisser <weisserm@arcor.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-12-10 17:54:04 -05:00
Simon Glass 295d3942b8 Add board_pre_console_putc to deal with early console output
This patch adds support for console output before the console is inited.
The main purpose of this is to deal with a very early panic() which would
otherwise cause a silent hang.

A new board_pre_console_putc() function is added to the board API. If
provided by the board it will be called in the event of console output
before the console is ready. This function should turn on all UARTs and
spray the character out if it possibly can.

The feature is controlled by a new CONFIG_PRE_CONSOLE_PUTC option.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Graeme Russ <graeme.russ@gmail.com>
2011-12-09 14:44:22 +01:00
Wolfgang Denk c4eba6ec5c common/usb_kbd.c: fix bug introduced in commit 00b7d6e
During the rebase of commit 00b7d6e "USB: Squash checkpatch warnings
in usb_kbd.c" I missed a brace, resulting in a number of build errors.
Fix these.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-12-09 12:09:35 +01:00
Marek Vasut 00b7d6ecc9 USB: Squash checkpatch warnings in usb_kbd.c
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Remy Bohmer <linux@bohmer.net>
Cc: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>

Rebased to current code.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-12-09 10:28:26 +01:00
Wolfgang Denk c786f54b9a Merge branch 'master' of git://git.denx.de/u-boot-arm
* 'master' of git://git.denx.de/u-boot-arm:
  davinci: Remove unwanted memsize.c from hawkboard's nand spl build
  devkit8000: Move CONFIG_SYS_TEXT_BASE out of bss
  da850evm: pass board revision info to kernel
  arch/arm/include/asm/arch-omap5/clocks.h: Fix GCC 4.2 warnings
  arch/arm/cpu/armv7/omap-common/clocks-common.c: Fix GCC 4.6 warnings
  arch/arm/cpu/armv7/omap-common/spl.c: Fix GCC 4.2 warnings
  MX35: flea3: changes due to hardware revision B
  MX: serial_mxc: cleanup removing nasty #ifdef
  M28: Fix OB1 bug in GPIO driver
  MXS: Add static annotations to dma driver
  apbh_dma: return error value on timeout
  Efika: Configure additional regulators for HDMI output
  mx5: Correct a warning in clock.c
  MC13892: Add REGMODE0 bits definitions
  mx51evk: Configure the pins as GPIOs prior to using gpio_get_value
  mx53smd: Configure the pins as GPIOs prior to using gpio_get_value
  mx53evk: Configure the pins as GPIOs prior to using gpio_get_value
  mx53ard: Configure the pins as GPIOs prior to using gpio_get_value
  mx53loco: Configure the pins as GPIOs prior to using gpio_get_value
  OMAP3: Add SPL_BOARD_INIT hook
  AM3517 CraneBoard: Add SPL support
  AM3517: Add SPL support
  OMAP3: Add SPL support to omap3_evm
  OMAP3: Add SPL support to Beagleboard
  OMAP3 SPL: Add identify_nand_chip function
  OMAP3 SPL: Rework memory initalization and devkit8000 support
  OMAP3: Suffix all Micron memory timing parts with their speed
  OMAP3: Add optimal SDRC autorefresh control values
  omap3: mem: Add MCFG helper macro
  OMAP3: Remove get_mem_type prototype
  OMAP3: Change mem_ok to clear again after reading back
  OMAP3: Add a helper function to set timings in SDRC
  OMAP3: Update SDRC dram_init to always call make_cs1_contiguous()
  omap3: mem: Comment enable_gpmc_cs_config more
  ARM: davici_emac: Fix condition for number of phy detects
  arm: printf() is not available in some SPL configurations
  arm, davinci: add support for am1808 based enbw_cmc board
  arm, davinci: move misc function in arch tree
  arm, board/davinci/common/misc.c: Codingstyle cleanup
  arm, davinci, da850: add uart1 tx rx pinmux config
  arm, davinci: move davinci_rtc struct to hardware.h
  arm, davinci: Remove duplication of pinmux configuration code
  arm, hawkboard: Use the pinmux configurations defined in the arch tree
  arm, da850evm: Use the pinmux configurations defined in the arch tree
  arm, da850: Add pinmux configurations to the arch tree
  arm, da850evm: Do pinmux configuration for EMAC together with other pinmuxes
  arm, hawkboard: Remove obsolete struct pinmux_config i2c_pins
  arm, davinci: Move pinmux functions from board to arch tree
  arm, arm926ejs: always do cpu critical inits
  omap_gpmc: use SOFTECC in SPL if it's enabled
  nand_spl_simple: add support for software ECC
  AM3517: move AM3517 specific mux defines to generic header
  AM35xx: add EMAC support
  davinci_emac: hardcode 100Mbps for AM35xx and RMII
  davinci_emac: fix for running with dcache enabled
  arm926ejs: add noop implementation for dcache ops
  davinci_emac: conditionally compile specific PHY support
  davinci_emac: use internal addresses in buffer descriptors
  davinci_emac: move arch-independent defines to separate header
  BeagleBoard: config: Really switch to ttyO2
  ARM: davinci_dm6467Tevm: Fix build breakage
  ARM: OMAP: Remove STACKSIZE for IRQ and FIQ if unused
  ARM: OMAP3: Remove unused define SDRC_R_C_B
  ARM: OMAP3: Remove unused define CONFIG_OMAP3430
  omap4: fix IO setting
  omap4+: streamline CONFIG_SYS_TEXT_BASE and other SDRAM addresses
  omap4460: add ES1.1 identification
  omap4: emif: fix error in driver
  omap: remove I2C from SPL
  omap4460: fix TPS initialization
  omap: fix cache line size for omap3/omap4 boards
  omap4: ttyO2 instead of ttyS2 in default bootargs
  omap: Improve PLL parameter calculation tool
  start.S: remove omap3 specific code from start.S
  armv7: setup vector
  armv7: include armv7/cpu.c in SPL build
  armv7: disable L2 cache in cleanup_before_linux()
  arm, arm926ejs: Fix clear bss loop for zero length bss
  PXA: Move colibri_pxa270 to board/toradex/
  PXA: Flip colibri_pxa27x to pxa-common.h
  PXA: Introduce common configuration header for PXA
  PXA: Rename pxa_dram_init to pxa2xx_dram_init
  PXA: Squash extern pxa_dram_init()
  PXA: Export cpu_is_ and pxa_dram_init functions
  PXA: Cleanup Colibri PXA270
  PXA: Replace timer driver
  PXA: Add cpuinfo display for PXA2xx
  PXA: Separate PXA2xx CPU init
  PXA: Rename CONFIG_PXA2[57]X to CONFIG_CPU_PXA2[57]X
  PXA: Unify vpac270 environment size
  PXA: Enable command line editing for vpac270
  PXA: Adapt Voipac PXA270 to OneNAND SPL
  PXA: Drop Voipac PXA270 OneNAND IPL
  PXA: Fixup PXA25x boards after start.S update
  PXA: Re-add the Dcache locking as RAM for pxa250
  PXA: Rework start.S to be closer to other ARMs
  PXA: Drop XM250 board
  PXA: Drop PLEB2 board
  PXA: Drop CRADLE board
  PXA: Drop CERF250 board
  Fix regression in SMDK6400
  nand: Add common functions to linux/mtd/nand.h
  Ethernut 5 board support
  net: Armada100: Fix compilation warnings
  ARM: remove duplicated code for LaCie boards
  ARM: add support for LaCie 2Big Network v2
  mvsata: fix ide_preinit for missing disks
  netspace_v2: Read Ethernet MAC address from EEPROM
  omap3evm: Add support for EFI partitions
  part_efi: Fix compile errors
2011-12-07 09:09:58 +01:00
Simon Glass 5f3dfadc26 Fix unused function in cmd_bdinfo.c
It is fine to use __maybe_unused instead of #ifdef, but we also need one
for print_eth() since not all boards have Ethernet. This fixes this
warning:

cmd_bdinfo.c:39:13: warning: 'print_eth' defined but not used [-Wunused-function]

Signed-off-by: Simon Glass <sjg@chromium.org>
2011-12-07 08:42:28 +01:00
Simon Glass 80729a5493 Fix SPI build errors in exports.c
The spi.h include is no longer included in exports.h, so must be included
here.

This fixes these errors:

In file included from exports.c:41:0:
/home/sjg/trunk/src/third_party/u-boot/files/include/_exports.h: In function 'jumptable_init':
/home/sjg/trunk/src/third_party/u-boot/files/include/_exports.h:27:1: error: 'spi_init' undeclared (first use in this function)
/home/sjg/trunk/src/third_party/u-boot/files/include/_exports.h:27:1: note: each undeclared identifier is reported only once for each function it appears in
/home/sjg/trunk/src/third_party/u-boot/files/include/_exports.h:28:1: error: 'spi_setup_slave' undeclared (first use in this function)
/home/sjg/trunk/src/third_party/u-boot/files/include/_exports.h:29:1: error: 'spi_free_slave' undeclared (first use in this function)
/home/sjg/trunk/src/third_party/u-boot/files/include/_exports.h:30:1: error: 'spi_claim_bus' undeclared (first use in this function)
/home/sjg/trunk/src/third_party/u-boot/files/include/_exports.h:31:1: error: 'spi_release_bus' undeclared (first use in this function)
/home/sjg/trunk/src/third_party/u-boot/files/include/_exports.h:32:1: error: 'spi_xfer' undeclared (first use in this function)

Signed-off-by: Simon Glass <sjg@chromium.org>
2011-12-07 08:41:22 +01:00
Wolfgang Denk f915c9316c Revert "mii: miiphy register address width change"
This reverts commit 5c45a22b92.

It causes a lot of "incompatible pointer type" warnings for a large
number of Ethernet drivers, which are not really worth fixing
especially as this patch was only supposed to help the old,
deprecated miiphy API.  Instead of adding more efforts to a lost case
we rather revert it.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-12-07 08:35:14 +01:00
Marek Vasut abc20aba18 PXA: Rename CONFIG_PXA2[57]X to CONFIG_CPU_PXA2[57]X
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
2011-12-06 23:59:32 +01:00
Vadim Bendebury 576fb1ed3f Add a cli command to test the TPM device.
The command gets an arbitrary number of arguments (up to 30), which
are interpreted as byte values and are feed into the TPM device after
proper initialization. Then the return value and data of the TPM
driver is examined.

TPM commands are described in the TCG specification.

For instance, the following sequence is the 'TPM Startup' command, it
is processed by the TPM and a response is generated:

boot > tpm 0x0 0xc1 0x0 0x0 0x0 0xc 0x0 0x0 0x0 0x99 0x0 0x1
Found TPM SLB9635 TT 1.2 by Infineon
Got TPM response:
 00 c4 00 00 00 0a 00 00 00 00

If the command is corrupted (fed one byte short), an error is reported:
boot > tpm 0x0 0xc1 0x0 0x0 0x0 0xc 0x0 0x0 0x0 0x99 0x0
generic_lpc_tpm.c:311 unexpected TPM status 0xff000888
generic_lpc_tpm.c:516 failed sending data to TPM
tpm command failed
boot >

Change-Id: I3f3c5bfec8b852e208c4e99ba37b0f2b875140b0
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
CC: Wolfgang Denk <wd@denx.de>
2011-12-06 21:30:03 +01:00
Jason Hobbs 6f40f2749a pxe: make the first label the implicit default
If no default label is specified, but a situation arises where the
default label should be used, treat the first label specified as the
default label.

Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
Cc: Ricardo Salveti de Araujo <ricardo.salveti@linaro.org>
Cc: Wolfgang Denk <wd@denx.de>
2011-12-06 21:21:42 +01:00
Mike Frysinger d88af4da9a cmd_bdinfo: simplify local static funcs a bit
If we move the local funcs to the top of the file, and use the
__maybe_unused define, we can drop a lot of ugly ifdef logic and
duplicated prototypes.

Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-12-06 21:12:43 +01:00
Chandan Nath 5c45a22b92 mii: miiphy register address width change
This patch is added for PHY whose register offset value exceeds 0xFF and
cannot be used with "unsigned char" datatype in miiphy_read, miiphy_write
and miiphy_register functions. Datatype of register offset is changed to
unsigned short instead of unsigned char so that offset value greater then
0xFF can be used.

Signed-off-by: Chandan Nath <chandan.nath@ti.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-12-06 21:01:01 +01:00
Thomas Weber a621614d0c env_nand: Remove DEBUG definition
Signed-off-by: Thomas Weber <weber@corscience.de>
2011-12-06 12:03:08 +01:00
Anatolij Gustschin 2157497615 common/menu.c: Fix build warning
Fix:
menu.c: In function 'menu_item_print':
menu.c:91: warning: passing argument 1 of 'putc' makes integer from
pointer without a cast

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Heiko Schocher <hs@denx.de>
Tested-by: Heiko Schocher <hs@denx.de>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
2011-12-05 23:26:40 +01:00
Gerlando Falauto 7813ca9b66 serial: constify serial_assign()
Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-12-05 22:48:10 +01:00
Gerlando Falauto a6e6f7f4d0 serial: cosmetic checkpatch compliance
Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-12-05 22:47:45 +01:00
Andy Fleming 1cdabc4bc7 miiphy: Note that miiphy_* API is deprecated
We want to move everything to phylib, and we definitely don't want
new drivers using the miiphy infrastructure.

Signed-off-by: Andy Fleming <afleming@freescale.com>
2011-12-05 22:17:06 +01:00
Wolfgang Denk 4ebbba4425 Merge branch 'sr@denx.de' of git://git.denx.de/u-boot-staging
* 'sr@denx.de' of git://git.denx.de/u-boot-staging:
  image: Don't detect XIP images as overlapping.
  image: Implement IH_TYPE_KERNEL_NOLOAD
2011-12-02 00:05:25 +01:00
Stephen Warren d510859bed image: Don't detect XIP images as overlapping.
bootm_load_os() detects when it writes the decompressed image over
the top of the compressed image. If this happens, the original image
is corrupted. When the original image is a multi-component legacy image,
or a (potentially multi-component) FIT image, this implies that other
components may be corrupted. In turn, this means that booting is unlikely
to be successful.

However, in the case of no image compresssion coupled with an image with
load address equal to where the image is already located (e.g. an XIP
kernel, or IH_TYPE_KERNEL_ANYLOAD), there has been no copy and hence no
corruption, no matter whether it's a single-component legacy image, a
multi-component legacy image, or a FIT image. In this case, disable the
overlap detection, and allow boot to continue.

Without this change, when booting a single-component legacy image that
contains an IH_TYPE_KERNEL_ANYLOAD, bootm_load_os() would have returned
BOOTM_ERR_OVERLAP, but the caller ignores this, and boot continues and
succeeds. Now, the false error is no longer even returned.

Without this change, when booting a FIT image that contains an
IH_TYPE_KERNEL_ANYLOAD, bootm_load_os() would have returned
BOOTM_ERR_OVERLAP, which would then cause the caller to reset the board.
Now, the false error is no longer returned, and boot succeeds.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2011-12-01 09:49:31 +01:00
Stephen Warren b9b50e89d3 image: Implement IH_TYPE_KERNEL_NOLOAD
The legacy uImage format includes an absolute load and entry-point
address. When bootm operates on a kernel uImage in memory that isn't
loaded at the address in the image's load address, U-Boot will copy
the image to its address in the header.

Some kernel images can actually be loaded and used at any arbitrary
address. An example is an ARM Linux kernel zImage file. To represent
this capability, IH_TYPE_KERNEL_NOLOAD is implemented, which operates
just like IH_TYPE_KERNEL, except that the load address header is
ignored, and U-Boot does not copy the image to its load address, but
rather uses it in-place.

This is useful when sharing a single (uImage-wrapped) zImage across
multiple boards with different memory layouts; in this case, a specific
load address need not be picked when creating the uImage, but instead
is selected by the board-specific U-Boot environment used to load and
boot that image.

v2: Rename from IH_TYPE_KERNEL_ANYLOAD to IH_TYPE_KERNEL_NOLOAD.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2011-12-01 09:45:35 +01:00
Graeme Russ a76fc70ee1 x86: Provide more configuration granularity
Planned future ports requires more granularity for some options

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
2011-11-29 21:09:52 +11:00
Wolfgang Denk a63d965275 menu.c: use puts() instead of printf() where possible
common/menu.c used printf() in a number of places to print user
provided, constant strings (like the "title" string).  printf() is
dangerous here for example in case the user unwittingly embeds some
'%' caracters that printf() would interpret as formatting and then
pick up random arguments.  Use puts() instead.

We also omit the trailing ':' in the title line - if a user wants
this, he can provide it as part of the title string.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-11-28 20:19:41 +01:00
Kumar Gala 068f158fdf cmd_nvedit.c: Fix compiler warning introduced by checkpatch cleanup
cmd_nvedit.c: In function 'do_env_grep':
cmd_nvedit.c:182:3: warning: suggest parentheses around assignment used as truth value

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
2011-11-27 15:46:10 +01:00
Wolfgang Denk fdbe8b9a2d Merge branch 'hs@denx.de' of git://git.denx.de/u-boot-staging
* 'hs@denx.de' of git://git.denx.de/u-boot-staging:
  drivers/net/dnet.c: Fix GCC 4.6 warnings
  board/xaeniax/flash.c: Fix GCC 4.6 warnings
  net/bootp.c: Fix GCC 4.6 warning
  common/cmd_bootm.c: Fix GCC 4.6 warnings
  board/mx1ads/mx1ads.c: Fix GCC 4.6 warning
  board/mx1ads/syncflash.c: Fix GCC 4.6 warnings
  board/lubbock/flash.c: Fix GCC 4.6 warnings
  drivers/net/cs8900.c: Fix GCC 4.6 warning
  arch/arm/cpu/arm926ejs/omap/cpuinfo.c: Fix GCC 4.6 warnings
  drivers/net/lan91c96.c: Fix GCC 4.6 warning
  board/ronetix/pm9263/pm9263.c: Fix GCC 4.6 warning
  drivers/mtd/onenand/samsung.c: Fix GCC 4.6 warning
  drivers/usb/musb/musb_hcd.c: Fix GCC 4.6 warning
2011-11-23 21:23:45 +01:00
Anatolij Gustschin 5bf2766b4b common/cmd_bootm.c: Fix GCC 4.6 warnings
Fix:
cmd_bootm.c: In function 'bootm_load_os':
cmd_bootm.c:315:7: warning: unused variable 'unc_len'
[-Wunused-variable]

Signed-off-by: Anatolij Gustschin <agust@denx.de>
2011-11-23 08:14:27 +01:00
Igor Grinberg 27aafe988e env: clean env_common.c checkpatch and code style
Cleanup the env_common.c checkpatch warnings, errors and coding style.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2011-11-22 08:39:27 +01:00
Igor Grinberg de152b9bf8 env: clean env_nand.c checkpatch and code style
Cleanup the env_nand.c checkpatch warnings, errors and coding style.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2011-11-22 08:39:26 +01:00
Igor Grinberg 82b54b972b env: clean env_flash.c checkpatch and code style
Cleanup the env_flash.c checkpatch warnings, errors and coding style.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2011-11-22 08:39:26 +01:00
Igor Grinberg eb58a7fc77 env: clean env_sf.c checkpatch and code style
Cleanup the env_sf.c checkpatch warnings, errors and coding style.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2011-11-22 08:39:26 +01:00
Igor Grinberg dd2a233c94 env: clean env_eeprom.c checkpatch and code style
Cleanup the env_eeprom.c checkpatch warnings, errors and coding style.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2011-11-22 08:39:26 +01:00
Igor Grinberg bd2a23ac61 env: clean env_embedded.c checkpatch and code style
Cleanup the env_embedded.c checkpatch warnings, errors and coding style.
There is one error left though:
 ERROR: Macros with multiple statements should be enclosed in a do - while loop
 #79: FILE: u-boot/common/env_embedded.c:79:
 +#define GEN_ABS(name, value)                   \
 +       asm(".globl " GEN_SYMNAME(name));       \
 +       GEN_SET_VALUE(name, value)

 total: 1 errors, 0 warnings, 213 lines checked

We cannot enclose that statement in a do - while loop,
because these are a global assembly declarations.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2011-11-22 08:39:26 +01:00
Igor Grinberg e8db8f71c9 env: clean env_mmc.c checkpatch and code style
Cleanup the env_mmc.c checkpatch warnings, errors and coding style.
Simplify env_relocate_spec() function implementation.
Also mark internal functions as static.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2011-11-22 08:39:26 +01:00
Igor Grinberg 91494ca6a0 env: clean env_nvram.c checkpatch and code style
Cleanup the env_nvram.c checkpatch warnings, errors and coding style.
There are 2 wanring left about the extern used in c file:
 WARNING: externs should be avoided in .c files
 #53: FILE: env_nvram.c:53:
 +extern void *nvram_read(void *dest, const long src, size_t count);

 WARNING: externs should be avoided in .c files
 #54: FILE: env_nvram.c:54:
 +extern void nvram_write(long dest, const void *src, size_t count);

 total: 0 errors, 2 warnings, 138 lines checked

There is no common nvram header file to use instead of the externs.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2011-11-22 08:39:26 +01:00
Igor Grinberg b919ec25e7 env: clean env_onenand.c checkpatch and code style
Cleanup the env_onenand.c checkpatch warnings, errors and coding style.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2011-11-22 08:39:26 +01:00
Igor Grinberg 0901d9f891 env: clean env_dataflash.c checkpatch and code style
Cleanup the env_dataflash.c checkpatch warnings, errors
and coding style.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2011-11-22 08:39:26 +01:00
Igor Grinberg 6b15566681 env: clean env_mgdisk.c checkpatch and code style
Cleanup the env_mgdisk.c checkpatch warnings, errors
and coding style.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2011-11-22 08:39:25 +01:00
Igor Grinberg dcfe6e6fa1 env: clean env_nowhere.c checkpatch and code style
Cleanup the env_nowhere.c checkpatch warnings, errors and coding style.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2011-11-22 08:39:25 +01:00
Igor Grinberg d09b1787a4 env: clean cmd_nvedit.c checkpatch and code style
Cleanup the cmd_nvedit.c checkpatch warnings, errors and coding style.
There are 10 wanrings left about the simple_strtoul() function:
 WARNING: simple_strtoul is obsolete, use kstrtoul instead
 #359: FILE: cmd_nvedit.c:359:
 +		load_addr = simple_strtoul(argv[2], NULL, 16);

 ...

 total: 0 errors, 10 warnings, 1043 lines checked

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2011-11-22 08:39:25 +01:00
Igor Grinberg 994bc671cf env: move extern environment[] to environment.h
Extract all extern declarations for environment out of c files
into the environment.h header.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2011-11-22 08:39:25 +01:00
Igor Grinberg d1459f0fab env: move extern default_environment[] to environment.h
Extract all extern declarations for default_environment[] out of c files
into the environment.h header.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Cc: Stefan Roese <sr@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
2011-11-22 08:39:25 +01:00
Igor Grinberg e3150460a4 common: move extern char console_buffer[] to common.h
Extract all extern declarations for console_buffer[] out of c files into
the common.h header.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Cc: Frank Gottschling <fgottschling@eltec.de>
Cc: Murray Jensen <Murray.Jensen@csiro.au>
2011-11-22 08:39:25 +01:00
Simon Glass 79afc88d2c Fix warnings in cmd_nvedit.c
This printf() string should be %ld now that uintptr_t is defined
as long. Also fix a size_t error.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-11-22 08:39:24 +01:00
Kumar Gala 94c50f1176 Revert "sandbox: Change md command to use map_physmem"
This reverts commit 355a835747.

The original commit broke long standing assumption that md commands work
on effective addresses.  This normally isn't an issue for most systems
that map 1:1, however on systems with a 36-bit address map it breaks.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2011-11-16 21:43:24 +01:00
Kim Phillips e1a37f8599 common: tsi148 - fix gcc 4.6 compiler warning
Configuring for vme8349 board...
cmd_tsi148.c: In function 'tsi148_init':
cmd_tsi148.c:56:17: warning: variable 'lastError' set but not used [-Wunused-but-set-variable]

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
2011-11-16 21:42:17 +01:00
Wolfgang Denk e4119560cf common/cmd_universe.c: Fix GCC 4.6 build warning
Fix:
cmd_universe.c: In function 'universe_init':
cmd_universe.c:49:17: warning: variable 'lastError' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-11-16 21:04:55 +01:00
Wolfgang Denk 4ec6e4a88f common/cmd_fdc.c: Fix GCC 4.6 build warnings
Fix:
cmd_fdc.c: In function 'fdc_read_data':
cmd_fdc.c:435:6: warning: variable 'flags' set but not used
[-Wunused-but-set-variable]
cmd_fdc.c:432:16: warning: variable 'pcn' set but not used
[-Wunused-but-set-variable]
cmd_fdc.c:431:20: warning: variable 'lastblk' set but not used
[-Wunused-but-set-variable]

Note: no attempts were made to otherwise cleanup the code.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-11-16 21:04:44 +01:00
Wolfgang Denk bb82de8840 Merge branch 'master' of /home/wd/git/u-boot/custodians
* 'master' of /home/wd/git/u-boot/custodians:
  api: export LCD device to external apps
  font: split font data from video_font.h
  tools: logo: split bmp arrays from bmp_logo.h
  lcd: add clear and draw bitmap declaration
  VIDEO: mx3fb: GCC4.6 fix build warnings
  Powerpc/DIU: Fixed the 800x600 and 1024x768 resolution bug
2011-11-16 20:44:06 +01:00
Wolfgang Denk 9dfa8da709 Merge branch 'master' of git://git.denx.de/u-boot-video
* 'master' of git://git.denx.de/u-boot-video:
  api: export LCD device to external apps
  font: split font data from video_font.h
  tools: logo: split bmp arrays from bmp_logo.h
  lcd: add clear and draw bitmap declaration
  VIDEO: mx3fb: GCC4.6 fix build warnings
  Powerpc/DIU: Fixed the 800x600 and 1024x768 resolution bug
2011-11-16 20:44:03 +01:00
Wolfgang Denk 0e62e0a72c Merge branch 'master' of /home/wd/git/u-boot/custodians
* 'master' of /home/wd/git/u-boot/custodians:
  arm, davinci: add DAVINCI_MMC_CLKID
  arm, davinci_emac: fix driver bug if more then 3 PHYs are detected
  arm, davinci: da850/dm365 lowlevel cleanup
  omap5: Add omap5_evm board build support.
  omap4/5: Add support for booting with CH.
  omap5: emif: Add emif/ddr configurations required for omap5 evm
  omap5: clocks: Add clocks support for omap5 platform.
  omap5: Add minimal support for omap5430.
  omap: Checkpatch fixes
  omap4: make omap4 code common for future reuse
  GCC4.6: Squash warnings in onenand_base.c
  GCC4.6: Fix common/usb.c on xscale
  OneNAND: Add simple OneNAND SPL
  PXA: vpac270: Enable the new generic MMC driver
  PXA: Cleanup serial_pxa
  PXA: Drop csb226 and innokom boards (unmaintained)
  m28evk: Fix comment about the number of RAM banks
  mx31: Fix checkpatch warnings in generic.c
  mx31: Use proper IO accessor for GPR register
  mx31: Remove duplicate definition for GPR register
  qong: Use generic function for configuring GPR register
  M28EVK: Enable USB HOST support
  iMX28: Add USB HOST driver
  iMX28: Add USB and USB PHY register definitions
  M28: Add memory detection into SPL
  iMX28: Fix ARM vector handling
  M28: Add doc/README.m28 documentation
  M28: Add MMC SPL
  iMX28: Add support for DENX M28EVK board
  iMX28: Add u-boot.sb target to Makefile
  iMX28: Add image header generator tool
  iMX28: Add driver for internal RTC
  iMX28: Add GPMI NAND driver
  iMX28: Add APBH DMA driver
  iMX28: Add SPI driver
  iMX28: Add GPIO control
  iMX28: Add I2C bus driver
  iMX28: Add PINMUX control
  FEC: Add support for iMX28 quirks
  iMX28: Add SSP MMC driver
  iMX28: Initial support for iMX28 CPU
  MX25: zmx25: GCC4.6 fix build warnings
  da850: add new config file for AM18xx
  BeagleBoard: config: Switch to ttyO2
  OMAP3: Change omap3_evm maintainer
  devkit8000: Fix NAND SPL on boards with 256MB NAND
  integrator: enable Vpp and disable flash protection
  integrator: add system controller header
  integrator: make flash writeable on boot
  integrator: use io-accessors for board init
  integrator: move text offset to config
  integrator: pass configs for core modules
  ARM: remove superfluous setting of arch_number in board specific code.
  SPL: Allow ARM926EJS to avoid compiling in the CPU support code
  integrator: do not test first part of the memory
  arm: a320: fix broken timer
  ARM: define CONFIG_MACH_TYPE for all ronetix boards
  dm646x: pass board revision info to kernel
  dm646x: add new configuration for dm6467T
  arm, davinci: Fix setting of the SDRAM configuration register
  arm, davinci: Remove the duplication of LPSC functions
  arm, davinci: Rename AM1808 lowlevel functions to DA850
  da8xxevm: fix build error
  ARM: re-add MACH_TYPE_XXXXXX for VCMA9 board and add CONFIG_MACH_TYPE
2011-11-16 20:24:51 +01:00
Wolfgang Denk 0c2dd9a05b Merge branch 'master' of git://git.denx.de/u-boot-arm
* 'master' of git://git.denx.de/u-boot-arm:
  arm, davinci: add DAVINCI_MMC_CLKID
  arm, davinci_emac: fix driver bug if more then 3 PHYs are detected
  arm, davinci: da850/dm365 lowlevel cleanup
  omap5: Add omap5_evm board build support.
  omap4/5: Add support for booting with CH.
  omap5: emif: Add emif/ddr configurations required for omap5 evm
  omap5: clocks: Add clocks support for omap5 platform.
  omap5: Add minimal support for omap5430.
  omap: Checkpatch fixes
  omap4: make omap4 code common for future reuse
  GCC4.6: Squash warnings in onenand_base.c
  GCC4.6: Fix common/usb.c on xscale
  OneNAND: Add simple OneNAND SPL
  PXA: vpac270: Enable the new generic MMC driver
  PXA: Cleanup serial_pxa
  PXA: Drop csb226 and innokom boards (unmaintained)
  m28evk: Fix comment about the number of RAM banks
  mx31: Fix checkpatch warnings in generic.c
  mx31: Use proper IO accessor for GPR register
  mx31: Remove duplicate definition for GPR register
  qong: Use generic function for configuring GPR register
  M28EVK: Enable USB HOST support
  iMX28: Add USB HOST driver
  iMX28: Add USB and USB PHY register definitions
  M28: Add memory detection into SPL
  iMX28: Fix ARM vector handling
  M28: Add doc/README.m28 documentation
  M28: Add MMC SPL
  iMX28: Add support for DENX M28EVK board
  iMX28: Add u-boot.sb target to Makefile
  iMX28: Add image header generator tool
  iMX28: Add driver for internal RTC
  iMX28: Add GPMI NAND driver
  iMX28: Add APBH DMA driver
  iMX28: Add SPI driver
  iMX28: Add GPIO control
  iMX28: Add I2C bus driver
  iMX28: Add PINMUX control
  FEC: Add support for iMX28 quirks
  iMX28: Add SSP MMC driver
  iMX28: Initial support for iMX28 CPU
  MX25: zmx25: GCC4.6 fix build warnings
  da850: add new config file for AM18xx
  BeagleBoard: config: Switch to ttyO2
  OMAP3: Change omap3_evm maintainer
  devkit8000: Fix NAND SPL on boards with 256MB NAND
  integrator: enable Vpp and disable flash protection
  integrator: add system controller header
  integrator: make flash writeable on boot
  integrator: use io-accessors for board init
  integrator: move text offset to config
  integrator: pass configs for core modules
  ARM: remove superfluous setting of arch_number in board specific code.
  SPL: Allow ARM926EJS to avoid compiling in the CPU support code
  integrator: do not test first part of the memory
  arm: a320: fix broken timer
  ARM: define CONFIG_MACH_TYPE for all ronetix boards
  dm646x: pass board revision info to kernel
  dm646x: add new configuration for dm6467T
  arm, davinci: Fix setting of the SDRAM configuration register
  arm, davinci: Remove the duplication of LPSC functions
  arm, davinci: Rename AM1808 lowlevel functions to DA850
  da8xxevm: fix build error
  ARM: re-add MACH_TYPE_XXXXXX for VCMA9 board and add CONFIG_MACH_TYPE
2011-11-16 20:24:41 +01:00
Wolfgang Denk f31f496e30 Merge branch 'master' of /home/wd/git/u-boot/custodians
* 'master' of /home/wd/git/u-boot/custodians:
  Fix constness of the fdt void pointer in fdt_getprop_u32_default
  Add some missing endian conversions in fdt_support.c
2011-11-16 20:18:05 +01:00
Che-Liang Chiou d3983ee853 font: split font data from video_font.h
While video_font.h is useful even without referencing the font data, it
is not possible to be included multiple times because it defines font
data array right in the header.

This patch splits the font data array into video_font_data.h and so now
video_font.h can be included multiple times.  This at least solves the
code duplication in board/mcc200/lcd.c.

Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-11-15 23:58:26 +01:00
Che-Liang Chiou c270730f58 tools: logo: split bmp arrays from bmp_logo.h
The generated header bmp_logo.h is useful even outside common/lcd.c for
the logo dimension.  However, the problem is, the generated bmp_logo.h
cannot be included multiple times because bmp_logo_palette[] and
bmp_logo_bitmap[] are defined in the bmp_logo.h.

This patch fixes this by defining these arrays in another header
bmp_logo_data.h and in bmp_logo.h only declaring these arrays.

Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
2011-11-15 23:58:26 +01:00
Che-Liang Chiou 02110903a8 lcd: add clear and draw bitmap declaration
The functions for clearing and drawing bitmaps on the screen were not
exposed publicly and are made public in this patch in preparation for
implementing the display interface of api_public.h.

Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
2011-11-15 23:58:26 +01:00
Marek Vasut 5e8baf878e GCC4.6: Fix common/usb.c on xscale
The problem was that the code, when the function was compiled with -Os, was
misgenerated. As in the function description, this is likely another
manifestation of the bug in GCC.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Remy Bohmer <linux@bohmer.net>
2011-11-15 22:24:50 +01:00
Gabe Black 07e1278496 Fix constness of the fdt void pointer in fdt_getprop_u32_default
The function fdt_getprop_u32_default doesn't modify the fdt, so it can use a
const void * for its fdt argument.

Signed-off-by: Gabe Black <gabeblack@chromium.org>
2011-11-13 11:21:34 -05:00
Gabe Black de16606ae3 Add some missing endian conversions in fdt_support.c
Some functions in fdt_support.c use fdt_getprop to read 32 bit values out of
the device tree, but then use them directly without doing any endian
conversion. Because they check for a value that doesn't actually appear in
practice, the functions continued to work even though they're incorrect.
This change adds the missing conversions.

Signed-off-by: Gabe Black <gabeblack@chromium.org>
2011-11-13 11:21:34 -05:00
Wolfgang Denk 37f2fe7472 env: allow to export only selected variables
New syntax:
	env export [-t | -b | -c] [-s size] addr [var ...]

With this change it is possible to provide a list of variables names
that shall be exported.  Whenno arguments are given, the whole
environment gets exported.

NOTE: The new handling of the "size" argument means a change to the
user API.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-11-08 13:20:42 +01:00
Wolfgang Denk 4f5710f740 common/cmd_flash.c: Fix GCC 4.6 build warnings
Fix:
cmd_flash.c:355:32: warning: 'info' may be used uninitialized in this
function [-Wuninitialized]
cmd_flash.c:354:10: warning: 'sect_first' may be used uninitialized in
this function [-Wuninitialized]
cmd_flash.c:354:10: warning: 'sect_last' may be used uninitialized in
this function [-Wuninitialized]
cmd_flash.c: In function 'do_protect':
cmd_flash.c:540:9: warning: 'info' may be used uninitialized in this
function [-Wuninitialized]
cmd_flash.c:538:9: warning: 'sect_first' may be used uninitialized in
this function [-Wuninitialized]
cmd_flash.c:538:9: warning: 'sect_last' may be used uninitialized in
this function [-Wuninitialized]

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-11-07 22:47:40 +01:00
Wolfgang Denk e8260cb25a common/cmd_i2c.c: Fix GCC 4.6 build warning
Fix:
cmd_i2c.c: In function 'do_i2c_add_bus':
cmd_i2c.c:1212:19: warning: variable 'dev' set but not used
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Heiko Schocher <hs@denx.de>
2011-11-07 22:15:57 +01:00
Simon Glass 355a835747 sandbox: Change md command to use map_physmem
Sandbox wants to support commands which use memory. The map_physmen()
call provides this feature, so should be used more consistently in
U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Tested-by: Matthias Weisser <weisserm@arcor.de>
2011-11-03 22:35:01 +01:00
Wolfgang Denk a2b92a655a common/cmd_ide.c: fix GCC 4.6 build warnings
Fix:
cmd_ide.c: In function 'ide_ident':
cmd_ide.c:988:6: warning: variable 'do_retry' set but not used
[-Wunused-but-set-variable]

Delete the unused variable.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-11-03 20:41:47 +01:00
Wolfgang Denk 34c202c7eb common/cmd_ide.c: CodingStyle cleanup
Make file acceptable to checkpatch.

This is only a basic clean up to the extend possible without any real
changes to the source code. Warnings due to line over 80 characters
were accepted because these affect only printf()s with user visible
strings.  No attempts were made to fix warnings about volatile and
externs - these need a more thorough cleanup.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-11-03 20:41:32 +01:00
Wolfgang Denk 87a5d60103 Merge branch 'master' of git://git.denx.de/u-boot-arm
* 'master' of git://git.denx.de/u-boot-arm:
  ARM: Add Calxeda Highbank platform
  dkb: make mmc command as default enabled
  Marvell: dkb: add mmc support
  ARM: pantheon: add mmc definition
  davinci: remove config.mk file from the sources
  ARM:AM33XX: Add support for TI AM335X EVM
  ARM:AM33XX: Added timer support
  ARM:AM33XX: Add emif/ddr support
  ARM:AM33XX: Add clock definitions
  ARM:AM33XX: Added support for AM33xx
  omap3/emif4: fix registers definition
  davinci: remove obsolete macro CONFIG_EMAC_MDIO_PHY_NUM
  davinci: emac: add support for more than 1 PHYs
  davinci: emac: add new features to autonegotiate for EMAC
  da850evm: Move LPSC configuration to board_early_init_f()
  omap4_panda: Build in cmd_gpio support on panda
  omap: Don't use gpio_free to change direction to input
  mmc: omap: Allow OMAP_HSMMC[23]_BASE to be unset
  OMAP3: overo : Add environment variable optargs to bootargs
  OMAP3: overo: Move ethernet CS4 configuration to execute based on board id
  OMAP3: overo : Use ttyO2 instead of ttyS2.
  da830: add support for NAND boot mode
  dm36x: revert cache disable patch
  dm644X: revert cache disable patch
  devkit8000: Add malloc space
  omap: spl: fix build break due to changes in FAT
  OMAP3 SPL: Provide weak omap_rev_string
  omap: beagle: Use ubifs instead of jffs2 for nand boot
  omap: overo: Disable pull-ups on camera PCLK, HS and VS signals
  omap: overo: Configure mux for gpio10
  SPL: Add DMA library
  omap3: Add interface for omap3 DMA
  omap3: Add DMA register accessors
  omap3: Add Base register for DMA
  arm, davinci: add missing LSPC define for MMC/SD1
  U-Boot/SPL: omap4: Make ddr pre-calculated timings as default.
  DaVinci: correct MDSTAT.STATE mask
  omap4: splitting padconfs into common, 4430 and 4460
  omap4: adding revision detection for 4460 ES1.1
  omap4: replacing OMAP4_CONTROL with OMAP4430_CONTROL
  gplug: fixed build error as a result of code cleanup patch
  kirkwood_spi: add dummy spi_init()
  gpio: mvmfp: reduce include platform file
  ARM: orion5x: reduce dependence of including platform file
  serial: reduce include platform file for marvell chip
  ARM: kirkwood: reduce dependence of including platform file
  ARM: armada100: reduce dependence of including platform file
  ARM: pantheon: reduce dependence of including platform file
  Armada100: Add env storage support for Marvell gplugD
  Armada100: Add SPI flash support for Marvell gplugD
  Armada100: Add SPI support for Marvell gplugD
  SPI: Add SPI driver support for Marvell Armada100
  dreamplug: initial board support.
  imx: fix coding style
  misc: pmic: drop old Freescale's pmic driver
  MX31: mx31pdk: use new pmic driver
  MX31: mx31ads: use new pmic driver
  MX31: mx31_litekit: use new pmic driver
  MX5: mx53evk: use new pmic driver
  MX5: mx51evk: use new pmic driver
  MX35: mx35pdk: use new pmic driver
  misc: pmic: addI2C  support to pmic_fsl driver
  misc: pmic: use I2C_SET_BUS in pmic I2C
  MX5: efikamx/efikasb: use new pmic driver
  MX3: qong: use new pmic driver
  RTC: Switch mc13783 to generic pmic code
  MX5: vision2: use new pmic driver
  misc: pmic: Freescale PMIC switches to generic PMIC driver
  misc:pmic:samsung Enable PMIC driver at GONI target
  misc:pmic:max8998 MAX8998 support at a new PMIC driver.
  misc:pmic:core New generic PMIC driver
  mx31pdk: Remove unneeded config
  mx31: provide readable WEIM CS accessor
  MX51: vision2: Set global macros
  I2C: Add i2c_get/set_speed() to mxc_i2c.c
  ARM: Update mach-types
  devkit8000: Add config to enable SPL MMC boot
  devkit8000: protect board_mmc_init
  arm, post: add missing post_time_ms for arm
  cosmetic, post: Codingstyle cleanup
  arm, logbuffer: make it compileclean
  tegra2: Enable MMC for Seaboard
  tegra2: Add more pinmux functions
  tegra2: Rename PIN_ to PINGRP_
  tegra2: Add more clock functions
  tegra2: Clean up board code a little
  tegra2: Rename CLOCK_PLL_ID to CLOCK_ID
2011-10-28 00:15:19 +02:00
Marek Vasut 35e9d698cd GCC4.6: Squash undefined variable in cmd_mtdparts.c
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Mike Frysinger <vapier@gentoo.org>
2011-10-27 23:54:04 +02:00
Marek Vasut 4b210e8bcf GCC4.6: Squash subsequent warnings in usb_storage.c
usb_storage.c: In function ‘us_one_transfer’:
usb_storage.c:377:7: warning: format ‘%X’ expects argument of type ‘unsigned
int’, but argument 2 has type ‘long unsigned int’ [-Wformat]
usb_storage.c:389:6: warning: format ‘%d’ expects argument of type ‘int’, but
argument 2 has type ‘long unsigned int’ [-Wformat]
usb_storage.c:394:6: warning: format ‘%d’ expects argument of type ‘int’, but
argument 2 has type ‘long unsigned int’ [-Wformat]
usb_storage.c: In function ‘usb_stor_BBB_reset’:
usb_storage.c:442:2: warning: format ‘%X’ expects argument of type ‘unsigned
int’, but argument 3 has type ‘long unsigned int’ [-Wformat]
usb_storage.c:448:2: warning: format ‘%X’ expects argument of type ‘unsigned
int’, but argument 3 has type ‘long unsigned int’ [-Wformat]
usb_storage.c:454:2: warning: format ‘%X’ expects argument of type ‘unsigned
int’, but argument 3 has type ‘long unsigned int’ [-Wformat]
usb_storage.c: In function ‘usb_stor_CB_reset’:
usb_storage.c:482:2: warning: format ‘%X’ expects argument of type ‘unsigned
int’, but argument 3 has type ‘long unsigned int’ [-Wformat]
usb_storage.c: In function ‘usb_stor_CB_comdat’:
usb_storage.c:572:3: warning: format ‘%X’ expects argument of type ‘unsigned
int’, but argument 3 has type ‘long unsigned int’ [-Wformat]
usb_storage.c:584:4: warning: format ‘%X’ expects argument of type ‘unsigned
int’, but argument 3 has type ‘long unsigned int’ [-Wformat]
usb_storage.c: In function ‘usb_stor_BBB_transport’:
usb_storage.c:782:3: warning: format ‘%d’ expects argument of type ‘int’, but
argument 3 has type ‘long unsigned int’ [-Wformat]
usb_storage.c: In function ‘usb_stor_CB_transport’:
usb_storage.c:807:2: warning: format ‘%X’ expects argument of type ‘unsigned
int’, but argument 3 has type ‘long unsigned int’ [-Wformat]
usb_storage.c:830:3: warning: format ‘%X’ expects argument of type ‘unsigned
int’, but argument 2 has type ‘long unsigned int’ [-Wformat]
usb_storage.c:857:3: warning: format ‘%d’ expects argument of type ‘int’, but
argument 2 has type ‘long unsigned int’ [-Wformat]

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Remy Bohmer <linux@bohmer.net>
2011-10-27 23:54:03 +02:00
Marek Vasut 86bd3ff8fd GCC4.6: Squash warning in usb_storage.c
usb_storage.c: In function ‘usb_stor_CB_reset’:
usb_storage.c:466:6: warning: variable ‘result’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Mike Frysinger <vapier@gentoo.org>
2011-10-27 23:54:03 +02:00
Marek Vasut 5bbe10dd2e GCC4.6: Squash warning in cmd_ide.c
cmd_ide.c: In function ‘ide_read’:
cmd_ide.c:1227:2: warning: format ‘%LX’ expects argument of type ‘long long
unsigned int’, but argument 3 has type ‘lbaint_t’ [-Wformat]

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Mike Frysinger <vapier@gentoo.org>
2011-10-27 23:54:03 +02:00
Marek Vasut 88ec8c1246 GCC4.6: Squash warnings in common/usb.c
usb.c: In function ‘usb_parse_config’:
usb.c:331:17: warning: variable ‘ch’ set but not used
[-Wunused-but-set-variable]
usb.c: In function ‘usb_hub_port_connect_change’:
usb.c:1123:29: warning: variable ‘portchange’ set but not used
[-Wunused-but-set-variable]
usb.c: In function ‘usb_hub_configure’:
usb.c:1183:25: warning: variable ‘hubsts’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Mike Frysinger <vapier@gentoo.org>
2011-10-27 23:54:03 +02:00
Aneesh V 2d01dd953a omap: spl: fix build break due to changes in FAT
FAT library now uses malloc() and free(). But SPL doesn't
have heap until now. Setup a heap in SDRAM to fix this issue.

However this increases SPL footprint beyond the available SRAM
budget. So, compile out some fancy features in the SDARM init
bring back footprint under control

CC: Sandeep Paulraj <s-paulraj@ti.com>
CC: Wolfgang Denk <wd@denx.de>
Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2011-10-27 21:56:35 +02:00
Lei Wen 5ff8b35412 ARM: orion5x: reduce dependence of including platform file
For files like the drivers/serial/serial.c, it must include the
platform file, as the CONFIG_SYS_NS16550_COM1 must reference to
the definition in the platform definition files.

Include the platform definition file in the config file, so that it
would decouple the dependence for the driver files.

Signed-off-by: Lei Wen <leiwen@marvell.com>
2011-10-27 21:56:33 +02:00
Heiko Schocher ee4014b005 arm, logbuffer: make it compileclean
Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
2011-10-27 21:56:30 +02:00
Simon Glass 2d46cf291e net: tftpput: add tftpput command
This adds the tftpput command to U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
2011-10-26 21:36:46 +02:00
Simon Glass 1aec244acf tftpput: add save_addr and save_size global variables
We need something akin to load_addr to handle saving data.

Signed-off-by: Simon Glass <sjg@chromium.org>
2011-10-26 21:35:43 +02:00
Simon Glass e4bf0c5cfe net: tftpput: Rename TFTP to TFTPGET
This is a better name for this protocol. Also remove the typedef to keep
checkpatch happy, and move zeroing of NetBootFileXferSize a little
earlier since TFTPPUT will need to change this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2011-10-26 21:33:42 +02:00
Simon Glass d67f10ce0f Add setenv_ulong() and setenv_addr()
It seems we put numbers and addresses into environment variables a lot.
We should have some functions to do this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2011-10-26 21:32:42 +02:00
Simon Glass 3cce8a5496 Move simple_itoa to vsprintf
This function is generally useful and shouldn't hide away in hush. It
has been moved as is.

Signed-off-by: Simon Glass <sjg@chromium.org>
2011-10-26 21:32:15 +02:00
Stefano Babic 4962e38e9a mkimage: adding support for Davinci AIS image
Some Davinci processors supports the Application
Image Script (AIS) boot process. The patch adds the generation
of the AIS image inside the mkimage tool to make possible
to generate a bootable U-boot without external tools
(TI Davinci AIS Generator).

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Wolfgang Denk <wd@denx.de>
2011-10-23 23:34:21 +02:00
Simon Glass 4a9b413108 Add getenv_ulong() to read an integer from an environment variable
This is not an uncommon operation in U-Boot, so let's put it in a common
function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-10-23 23:32:45 +02:00
Daniel Schwierzeck 3668d8fa04 common: fix missing function pointer relocation in fixup_cmdtable()
In commit fa28bd2eef patch v1 was applied
instead of v2. This is an incremental patch to update that commit
to version 2.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
2011-10-23 23:32:44 +02:00
Dirk Eibach b88e7b3cc0 hwmon: Provide dtt_init()
Our boards rely on dtt for initialization of fan hardware.
dtt_init() was implemented to be called form board specific code.

Signed-off-by: Dirk Eibach <eibach@gdsys.de>
Acked-by: Heiko Schocher <hs@denx.de>
Tested-by: Heiko Schocher <hs@denx.de>
2011-10-22 01:22:21 +02:00
Joe Hershberger b3f44c21ea common: cosmetic: CONFIG_BOOTFILE checkpatch compliance
Remove MK_STR from places that consume CONFIG_BOOTFILE to force all definitions to be string literals.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-10-22 01:21:35 +02:00
Joe Hershberger 8b3637c662 common: cosmetic: CONFIG_ROOTPATH checkpatch compliance
Remove MK_STR from places that consume CONFIG_ROOTPATH to force all definitions to be string literals.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-10-22 01:21:15 +02:00
Stephen Warren 712fbcf384 checkpatch whitespace cleanups
This avoids the following checkpatch warning in later patches:

ERROR: "(foo*)" should be "(foo *)"
ERROR: space required before the open brace '{'
ERROR: space prohibited before that close parenthesis ')'
ERROR: spaces required around that '||' (ctx:WxV)
WARNING: space prohibited between function name and open parenthesis '('
WARNING: line over 80 characters

This fixes all the white-space warnings/errors in my subsequent patch,
and within this current patch. A number of other checkpatch warnings
and errors are still present in this patch itself, but are beyond simple
whitespace fixes, so are not solved by this patch.

v2: New patch

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2011-10-22 01:13:35 +02:00
Macpaul Lin 64d614617f nds32: common bdinfo, bootm, image support
Add support of NDS32 to common commands bdinfo, bootm, and image format.

Signed-off-by: Macpaul Lin <macpaul@andestech.com>
2011-10-22 00:54:06 +02:00
Timur Tabi 0c277ef9f9 cmd_bdinfo: replace print_str() with print_mhz()
The print_str() helper function for cmd_bdinfo can print any string, but it
is only used to print MHz values.  Replace it with print_mhz() that takes
a number and converts it to a string internally.

Signed-off-by: Timur Tabi <timur@freescale.com>
2011-10-22 00:49:18 +02:00
Simon Schwarz dee17768d4 removed static from images in cmd_bootm.c
This removes static modifier from images variable in cmd_bootm.c.

Signed-off-by: Simon Schwarz <simonschwarzcor@gmail.com>
2011-10-21 23:56:17 +02:00
Wolfgang Denk 02aff558f4 Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
* 'master' of git://git.denx.de/u-boot-mpc85xx:
  mpc85xx: Add inline GPIO acessor functions
  powerpc/85xx: wait for alignment before resetting SERDES RX lanes (SERDES9)
  powerpc/85xx: Fix P2020DS booting
  powerpc/85xx: Update USB device tree status based on pin settings
  fdt: Add new fdt_set_node_status & fdt_set_status_by_alias helpers
  powerpc/85xx: Add support for RMan LIODN initialization
  powerpc/85xx: Update device tree handling for SRIO
  powerpc/85xx: Update setting of SRIO LIODNs
  fm: Don't allow disabling of FM1-DTSEC1
  fm-eth: Don't mark the MAC we use for MDIO as disabled in device tree
2011-10-21 23:48:46 +02:00
Doug Anderson 3a8653b3ac cosmetic: Fixup fixup_silent_linux() for checkpatch
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Anton Staaf <robotboy@chromium.org>
2011-10-20 16:38:08 +02:00
Shengzhou Liu 2a523f5240 fdt: Add new fdt_set_node_status & fdt_set_status_by_alias helpers
Add common function fdt_set_node_status() to assist in various locations
that we set a nodes status.  This function utilizes the status values
that are part of the EPAPR spec (on power.org).

fdt_set_status_by_alias() is based on fdt_set_node_status() but uses an
alias string to identify the node to update.

We also add some shortcut functions to help the common cases of setting
"okay" and "disabled":

	fdt_status_okay()
	fdt_status_disabled()
	fdt_status_okay_by_alias()
	fdt_status_disabled_by_alias()

Finally, we fixup the corenet_ds ethernet code which previously had
a function by the same name that can be replaced with the new helpers.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Gerald Van Baren <vanbaren@cideas.com>
2011-10-18 00:36:55 -05:00
Simon Glass 925493582c sandbox: Use uintptr_t for 32/64-bit compatibility
This fixes a problems when building on some 64-bit machines.

Signed-off-by: Simon Glass <sjg@chromium.org>
2011-10-17 23:56:59 +02:00
Simon Glass fe34107e38 sandbox: Disable built-in malloc
We prefer to U-Boot's malloc but for now it is easier to use the C library's
version.

Signed-off-by: Simon Glass <sjg@chromium.org>
2011-10-17 23:56:57 +02:00
Simon Glass 6d6f123632 sandbox: Add bootm support
This adds sandbox architecture support to bootm, although it is probably
not useful to load sandbox code into the address space and execute it.

This change at least make the file build correctly on 64-bit machines.

Signed-off-by: Simon Glass <sjg@chromium.org>
2011-10-17 23:56:57 +02:00
Simon Glass 6fcc3be453 sandbox: Add board info for architecture
This is required for the bdinfo command to work.

Signed-off-by: Simon Glass <sjg@chromium.org>

Fix syntax error.
Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-10-17 23:56:46 +02:00
Simon Glass 0ec2ce4a67 Fix use of int as pointer in image.c
It is better to use %p in this case.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-10-17 22:46:13 +02:00
Jason Hobbs 06283a6401 Add pxe command
Add pxe command, which is intended to mimic PXELINUX functionality.
'pxe get' uses tftp to retrieve a file based on UUID, MAC address or IP
address. 'pxe boot' interprets the contents of PXELINUX config like file
to boot using a specific initrd, kernel and kernel command line.

This patch also adds a README.pxe file - see it for more details on the
pxe command.

Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
2011-10-17 22:25:35 +02:00
Jason Hobbs 4d91a6ecab Replace space and tab checks with isblank
These are various places I found that checked for conditions equivalent
to isblank.

Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
2011-10-17 22:25:34 +02:00
Jason Hobbs ce2d4c9532 cosmetic: remove unneeded curly braces
This prevents a checkpatch warning in the patch to use isblank

Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
2011-10-17 22:25:34 +02:00
Jason Hobbs c8a2079e49 common: add run_command2 for running simple or hush commands
Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-10-17 22:25:34 +02:00
Jason Hobbs b41bc5a82d common, menu: use abortboot for menu timeout
Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
2011-10-17 22:25:33 +02:00
Jason Hobbs b69bf52dfe Add generic, reusable menu code
This will be used first by the pxe code, but is intended to be
generic and reusable for other jobs in U-boot.

Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
2011-10-17 22:25:33 +02:00
Daniel Schwierzeck fa28bd2eef common: fix missing function pointer relocation in fixup_cmdtable()
The command auto-completion does not work on architectures relying
on CONFIG_NEEDS_MANUAL_RELOC like MIPS. Cause is the missing function
pointer fixup for cmd_tbl_t::complete function in fixup_cmdtable().

This patch adds the missing pointer fixup in case of CONFIG_AUTO_COMPLETE
is defined.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
2011-10-15 22:19:36 +02:00
Timur Tabi 50bf17bd15 fdt: update fdt_alloc_phandle to use fdt_get_phandle
The device tree compiler, dtc, can use "phandle" and/or "linux,phandle"
properties to specify the phandle for any node.  By default, it uses
both, but "linux,phandle" is deprecated.  One day, we'd like to stop using
"linux,phandle", but U-boot needs to support both properties equally
first.

fdt_alloc_phandle() generates a unique phandle, but it was only checking
the "linux,phandle" properties.  Instead, we use fdt_get_phandle(),
which checks both properties automatically.  This ensures that we
support dtbs that only use "phandle".

The side-effect is that fdt_alloc_phandle() now takes twice as long, since
it has to check for two properties instead of one in each node that it
searches.

Signed-off-by: Timur Tabi <timur@freescale.com>
2011-10-15 09:35:09 -04:00
Timur Tabi 3c927cccdc fdt: check for fdt errors in fdt_create_phandle
fdt_create_phandle() was ignoring errors from fdt_set_phandle().  If an
error occurs, print an error message and return 0, which is an invalid
phandle.  We also need to change the return type for fdt_create_phandle()
to indicate that it cannot return an error code.

Signed-off-by: Timur Tabi <timur@freescale.com>
2011-10-15 09:35:00 -04:00
Wolfgang Denk fad2e1b06c common/usb.c: fix warning: variable ... set but not used
Fix:
usb.c: In function 'usb_parse_config':
usb.c:331:17: warning: variable 'ch' set but not used [-Wunused-but-set-variable]
usb.c: In function 'usb_hub_port_connect_change':
usb.c:1123:29: warning: variable 'portchange' set but not used [-Wunused-but-set-variable]
usb.c: In function 'usb_hub_configure':
usb.c:1183:25: warning: variable 'hubsts' set but not used [-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Remy Bohmer <linux@bohmer.net>
Acked-by: Remy Bohmer <linux@bohmer.net>
2011-10-09 23:24:50 +02:00
Wolfgang Denk 10f4dd784f common/cmd_usb.c: fix warning: variable ... set but not used
Fix:
cmd_usb.c: In function 'usb_show_tree_graph':
cmd_usb.c:284:29: warning: variable 'port' set but not used [-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Remy Bohmer <linux@bohmer.net>
Acked-by: Remy Bohmer <linux@bohmer.net>
2011-10-09 23:24:49 +02:00
Wolfgang Denk 419a1fe954 CFI: fix warning: variable ... set but not used
Fix:
cfi_mtd.c: In function 'cfi_mtd_init':
cfi_mtd.c:226:19: warning: variable 'mtd_list' set but not used [-Wunused-but-set-variable]
cfi_mtd.c: In function 'cfi_mtd_init':
cfi_mtd.c:225:6: warning: unused variable 'devices_found'
cfi_mtd.c: In function 'cfi_mtd_init':
cfi_mtd.c:226:19: warning: variable 'mtd_list' set but not used [-Wunused-but-set-variable]
[-Wunused-variable]

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Stefan Roese <sr@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
2011-10-09 23:24:49 +02:00
Che-liang Chiou ca366d0e38 cmd_time: add time command
The 'time' command runs and reports execution time of commands.

Sample usage:
--------------------
u-boot# time crc 0x1000 1000
CRC32 for 00001000 ... 00001fff ==> ae94dc4b

time: 0.004 seconds, 4 ticks
--------------------

Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-10-09 23:24:48 +02:00
Wolfgang Denk e42624bbe0 common/image.c: remove duplicated IH_TYPE entries.
Also rearrange IH_TYPE table slightly.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-10-09 23:24:47 +02:00
Michal Simek 49a23e4a41 serial: uartlite: Support for SERIAL_MULTI
Add support for SERIAL MULTI for uartlite.

Signed-off-by: Michal Simek <monstr@monstr.eu>
2011-10-09 23:24:47 +02:00
Kumar Gala 8e8a4bc22f cmd_sf: Fix compiler warning
cmd_sf.c: In function 'do_spi_flash':
cmd_sf.c:164:9: warning: 'skipped' may be used uninitialized in this function

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Simon Glass <sjg@chromium.org>
2011-10-05 22:22:17 +02:00
Mike Frysinger 476af299b0 image: push default arch values to arch headers
This pushes the ugly duplicated arch ifdef lists we maintain in various
image related files out to the arch headers themselves.

Acked-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Tested-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-10-05 22:22:15 +02:00
Graeme Russ 9558b48af0 console: Implement pre-console buffer
Allow redirection of console output prior to console initialisation to a
temporary buffer.

To enable this functionality, the board (or arch) must define:
 - CONFIG_PRE_CONSOLE_BUFFER - Enable pre-console buffer
 - CONFIG_PRE_CON_BUF_ADDR - Base address of pre-console buffer
 - CONFIG_PRE_CON_BUF_SZ - Size of pre-console buffer (in bytes)

The pre-console buffer will buffer the last CONFIG_PRE_CON_BUF_SZ bytes
Any earlier characters are silently dropped.
2011-10-05 22:03:09 +02:00
Wolfgang Denk 4f7549d2dc Merge branch 'master' of git://git.denx.de/u-boot-nand-flash
* 'master' of git://git.denx.de/u-boot-nand-flash:
  PPC: Fix socrates NAND problem
  PPC: Fix fsl_upm.c by renaming nand handling functions
  NAND: Make page, erase, oob size available via cmd_nand
  mtd: eLBC NAND: remove elbc_fcm_ctrl->oob_poi
  NAND: Add -y option to nand scrub command
  NAND: Add nand read.raw and write.raw commands
  NAND: Really ignore bad blocks when scrubbing
  spl, nand: add 4bit HW ecc oob first nand_read_page function
  mxc_nand: fix a problem writing more than 32MB
  mxc_nand: fixed some typos (cosmetic)
  nand: increase chip_delay in mv kirkwood nand driver
2011-10-04 22:20:25 +02:00
Wolfgang Denk 1fed668b3f Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
* 'master' of git://git.denx.de/u-boot-mpc85xx:
  powerpc/p3060: Add SoC related support for P3060 platform
  powerpc/85xx: Add support for setting up RAID engine liodns on P5020
  powerpc/85xx: Refactor some defines out of corenet_ds.h
  fm-eth: Add ability for board code to disable a port
  powerpc/mpc8548: Add workaround for erratum NMG_LBC103
  powerpc/mpc8548: Add workaround for erratum NMG_DDR120
  powerpc/mpc85xxcds: Fix PCI speed
  powerpc/mpc8548cds: Fix booting message
  powerpc/p4080: Add support for secure boot flow
  powerpc/85xx: Add Secure Boot support on P1010RDB for NOR, NAND & SPIFLASH
  powerpc/85xx: Add PBL & SECUREBOOT support on P3041/P5020DS boards
  powerpc/p2041rdb: remove watch dog related codes
  powerpc/p2041rdb: updated description of cpld command
  powerpc/p2041rdb: add more ddr frequencies support
  powerpc/p2041rdb: set sysclk according to status of physical switch SW1
  powerpc/p2041rdb: update cpld reset command according to CPLD 2.0
  powerpc/mpc8349emds: Migrate from spd_sdram to unified DDR driver
  powerpc/mpc83xx: Migrate from spd_sdram to unified DDR driver
  powerpc/mpc8xxx: Add DDR2 to unified DDR driver
  powerpc/mpc8xxx: Fix picos_to_mclk() and get_memory_clk_period_ps()
  powerpc/mpc8xxx: Add SPD EEPROM address for single controller 2 slots
  powerpc/mpc8xxx: Fix DDR code for empty first DIMM slot and enable DQS_en
  powerpc/85xx: Refactor P2041RDB to use common p_corenet files
  powerpc/85xx: refactor common P-Series CoreNet files for FSL boards
  powerpc/85xx: Enable CMD_REGINFO on corenet boards
  powerpc/85xx: p2041rdb - Remove unused 'execute' perm in TLB entries
  powerpc/85xx: Fix USB protocol definitions for P1020RDB
  powerpc/corenet_ds: Use separated speed tables for UDIMM and RDIMM
  powerpc/mpc8xxx: Move DDR RCW overriding to common code
  powerpc/mpc8xxx: Extend CWL table
  powerpc/85xx: Cleanup how SVR_MAJ() is defined on MPC8536
  powerpc/85xx: Cleanup extern in corenet_ds board code
  powerpc/p2041rdb: Add ethernet support on P2041RDB board
  powerpc/85xx: Add networking support to P1023RDS
  powerpc/hydra: Add ethernet support on P5020/P3041 DS boards
  powerpc/85xx: Add FMan ethernet support to P4080DS
  powerpc/85xx: Add support for FMan ethernet in Independent mode
  powerpc/mpc8548cds: Cleanup mpc8548cds.c
  powerpc/mp: add support for discontiguous cores
  powerpc/85xx: corenet_ds - Remove unused 'execute' perm in TLB entries
  fdt: Add new fdt_create_phandle helper
  fdt: Rename fdt_create_phandle to fdt_set_phandle
  powerpc/85xx: Fix compile warnings/errors if CONFIG_SYS_DPAA_FMAN isn't set
  fsl_ifc: Add the workaround for erratum IFC A-003399(enabled on P1010)
  powerpc/P1010: Add workaround for erratum P1010-A003549 (related to IFC)
  fsl_ifc: Add the workaround for erratum IFC-A002769 (enable on P1010)
  powerpc/85xx: Expanding the window of CCSRBAR in AS=1 from 4k to 1M
  powerpc/85xx: Add NAND/NAND_SPL support to P1010RDB
  nand: Freescale Integrated Flash Controller NAND support
  powerpc/85xx: Add basic support for P1010RDB
  powerpc/85xx: Add support for new P102x/P2020 RDB style boards
  powerpc/85xx: relocate CCSR before creating the initial RAM area
  powerpc/85xx: introduce and document CONFIG_SYS_CCSRBAR macros
  powerpc/85xx: Enable internal USB UTMI PHY on p204x/p3041/p50x0
  powerpc/85xx: Add ULPI and UTMI USB Phy support for P1010/P1014
2011-10-04 22:08:13 +02:00
Wolfgang Denk f092f15d39 Revert "GCC4.6: Convert various empty macros to inline functions"
This reverts commit 60ce53cf9f.

The commit causes build breakage for a number of boards. This results
from the fact that now the arguments of debug() actually get
referenced (even if there is hope that the compiler will optimize
away the debug() call).  The obvious fix to that probem (change the
code to always declare the referenced variables and data structures)
increases the code size, and was this rejected.  So it was decided to
revert this commit until a better solution is found.
2011-10-04 21:19:19 +02:00
Marek Vasut ce80ddc180 NAND: Make page, erase, oob size available via cmd_nand
The "nand info" and "nand device" now set shell/environment variables:
	nand_writesize ... nand page size
	nand_oobsize ..... nand oob area size
	nand_erasesize ... nand erase block size

Also, the "nand info" command now displays this info.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
[scottwood@freescale.com: removed unnecessary memsets]
Signed-off-by: Scott Wood <scottwood@freescale.com>
2011-10-03 18:35:12 -05:00
Marek Vasut 6089981663 NAND: Add -y option to nand scrub command
This allows the scrub command to scrub without asking the user if he really
wants to scrub the area. Useful in scripts.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2011-10-03 18:35:12 -05:00
Marek Vasut fb3659ac42 NAND: Add nand read.raw and write.raw commands
These commands should work around various "hardware" ECC and BCH methods.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
[scottwood@freescale.com: s/write the page/access the page/]
Signed-off-by: Scott Wood <scottwood@freescale.com>
2011-10-03 18:35:12 -05:00
Marek Vasut 2984fd1673 GCC4.6: Squash warning in cmd_ubi.c:
cmd_ubi.c: In function ‘ubi_volume_read’:
cmd_ubi.c:319:9: warning: variable ‘count_save’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-10-01 23:34:21 +02:00
Marek Vasut 9099ac3e7e GCC4,6: Squash warning in cmd_nand.c
cmd_nand.c: In function ‘do_nand’:
cmd_nand.c:490:7: warning: variable ‘chip’ set but not used
[-Wunused-but-set-variable]
cmd_nand.c:489:7: warning: variable ‘part’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Scott Wood <scottwood@freescale.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-10-01 23:33:52 +02:00
Marek Vasut f3b3c3df18 GCC4.6: Squash warning in cmd_mem.c
cmd_mem.c: In function ‘do_mem_loop’:
cmd_mem.c:474:25: warning: variable ‘junk’ set but not used
[-Wunused-but-set-variable]

The assigned variable can be removed because the pointers are volatile so
accesses to their addresses are always generated.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
2011-10-01 23:26:36 +02:00
Marek Vasut be547c6db3 GCC4.6: Squash warnings in lcd.c
lcd.c: In function ‘lcd_drawchars’:
lcd.c:214:9: warning: variable ‘off’ set but not used
[-Wunused-but-set-variable]
lcd.c: In function ‘lcd_display_bitmap’:
lcd.c:617:16: warning: variable ‘compression’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
2011-10-01 23:26:35 +02:00
Marek Vasut 7fcd9bbd6f GCC4.6: Squash warning in cmd_nvedit.c
cmd_nvedit.c: In function ‘do_env_edit’:
cmd_nvedit.c:463:6: warning: variable ‘len’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
2011-10-01 23:25:57 +02:00
Marek Vasut 5b3901d9ae GCC4.6: Squash warning in cmd_flash.c
cmd_flash.c: In function ‘do_protect’:
cmd_flash.c:474:6: warning: variable ‘p’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
2011-10-01 23:25:19 +02:00
Marek Vasut 60ce53cf9f GCC4.6: Convert various empty macros to inline functions
Fix the following gcc4.6 problems:

cmd_date.c: In function ‘do_date’:
cmd_date.c:50:6: warning: variable ‘old_bus’ set but not used
[-Wunused-but-set-variable]
asix.c: In function ‘asix_init’:
asix.c:317:6: warning: variable ‘rx_ctl’ set but not used
[-Wunused-but-set-variable]
usb.c: In function ‘usb_parse_config’:
usb.c:331:17: warning: variable ‘ch’ set but not used
[-Wunused-but-set-variable]
usb.c: In function ‘usb_hub_port_connect_change’:
usb.c:1123:29: warning: variable ‘portchange’ set but not used
[-Wunused-but-set-variable]
usb.c: In function ‘usb_hub_configure’:
usb.c:1183:25: warning: variable ‘hubsts’ set but not used
[-Wunused-but-set-variable]
usb_storage.c: In function ‘usb_stor_CB_reset’:
usb_storage.c:466:6: warning: variable ‘result’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
2011-10-01 23:25:18 +02:00
Graeme Russ e3e454cd72 console: Squelch pre-console output in console functions
There are some locations in the code which anticipate printf() being called
before the console is ready by squelching printf() on gd->have_console.
Move this squelching into printf(), vprintf(), puts() and putc(). Also
make tstc() and getc() return 0 if console is not yet initialised

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
Tested-by: Simon Glass <sjg@chromium.org>
2011-10-01 21:54:49 +02:00
Marek Vasut b18eabfa5f IDE: Fix complaints about strict aliasing in cmd_ide.c
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-10-01 21:53:39 +02:00
Simon Glass 857c283e9b Small refactor to remove duplicate serial code
This tidies up duplicate code, and checks that default_serial_console() does
in fact produce a device.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-10-01 21:52:48 +02:00
York Sun d29d17d7ba powerpc/mpc83xx: Migrate from spd_sdram to unified DDR driver
Unified DDR driver is maintained for better performance, robustness and bug
fixes. Upgrading to use unified DDR driver for MPC83xx takes advantage of
overall improvement. It requires changes for board files to customize
platform-dependent parameters.

To utilize the unified DDR driver, a board needs to define CONFIG_FSL_DDRx
in the header file. No more boards will be accepted without such definition.

Note: the workaround for erratum DDR6 for the very old MPC834x Rev 1.0/1.1
and MPC8360 Rev 1.1/1.2 parts is not migrated to unified driver.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2011-09-29 19:01:06 -05:00
Timur Tabi fbb9ecf749 powerpc/mp: add support for discontiguous cores
Some SOCs have discontiguously-numbered cores, and so we can't determine the
valid core numbers via the FRR register any more.  We define
CPU_TYPE_ENTRY_MASK to specify a discontiguous core mask, and helper functions
to process the mask and enumerate over the set of valid cores.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2011-09-29 19:01:05 -05:00
Kumar Gala 10aeabd186 fdt: Add new fdt_create_phandle helper
Add a helper function that will return a phandle value for the given
node.  If the node doesn't have a phandle already one will be created.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Gerald Van Baren <vanbaren@cideas.com>
2011-09-29 19:01:05 -05:00
Kumar Gala f117c0f073 fdt: Rename fdt_create_phandle to fdt_set_phandle
The old fdt_create_phandle didn't actually create a phandle it just
set one.  We'll introduce a new helper that actually does creation.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Gerald Van Baren <vanbaren@cideas.com>
2011-09-29 19:01:05 -05:00
Simon Glass 8d1af94220 cmd_sf: add "update" subcommand to do smart SPI flash update
This adds a new SPI flash command which only rewrites blocks if the contents
need to change. This can speed up SPI flash programming when much of the
data is unchanged from what is already there.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-09-29 16:31:31 -04:00
Jason Kridner 2d3be7c456 led: remove camel casing of led identifiers globally
Result of running the following command to address Wolfgang's
comment about camel case:

for file in `find . | grep '\.[chS]$'`; do perl -i -pe
's/(green|yellow|red|blue)_LED_(on|off)/$1_led_$2/g' $file; done

Discussion:
http://patchwork.ozlabs.org/patch/84988/

Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
Signed-off-by: Joel A Fernandes <agnel.joel@gmail.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2011-09-13 08:30:52 +02:00
Wolfgang Denk ea95cb7331 utx8245: fix build breakage due to assert()
Commit 21726a7 "Add assert() for debug assertions" broke building the
utx8245 board:

dlmalloc.c: In function 'do_check_chunk':
dlmalloc.c:1660: error: 'sz' undeclared (first use in this function)
dlmalloc.c:1660: error: (Each undeclared identifier is reported only once
dlmalloc.c:1660: error: for each function it appears in.)
dlmalloc.c: In function 'do_check_free_chunk':
dlmalloc.c:1689: error: 'next' undeclared (first use in this function)
dlmalloc.c: In function 'do_check_malloced_chunk':
dlmalloc.c:1748: error: 'sz' undeclared (first use in this function)
dlmalloc.c:1750: error: 'room' undeclared (first use in this function)

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Simon Glass <sjg@chromium.org>
2011-09-10 16:05:43 +02:00
Simon Glass 21726a7afc Add assert() for debug assertions
assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined.
This is useful when a condition is an error but a board reset is unlikely
to fix it, so it is better to soldier on in hope. Assertion failures should
be caught during development/test.

It turns out that assert() is defined separately in a few places in U-Boot
with various meanings. This patch cleans up some of these.

Build errors exposed by this change (and defining DEBUG) are also fixed in
this patch.

Signed-off-by: Simon Glass <sjg@chromium.org>
2011-09-10 00:04:01 +02:00
Wolfgang Denk d1f7a899eb YAFFS2: cmd_yaffs2.c - fix build warnings
Fix these:
cmd_yaffs2.c: In function 'do_ywr':
cmd_yaffs2.c:69: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'ulong'
cmd_yaffs2.c:69: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'ulong'

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-09-10 00:00:15 +02:00
Anton Staaf 155cfb5ef1 common: fix behavior of ROUND macro when input is already rounded
Currently when you call ROUND with a value that is already a
multiple of the second parameter it will return a value that is
one multiple larger, instead of returning the value passed in.

There are only two types of usage of ROUND currently, one in
various config files to round CONFIG_SYS_MALLOC_LEN to a multiple
of 4096 bytes.  The other in cmd_sf.c where the incorrect behavior
of ROUND is worked around be subtracting one from the length argument
before passing it to ROUND.

This patch fixes ROUND and removes the workaround from cmd_sf.  It
also results in all of the malloc pools that use ROUND to compute
their size shrinking by 4KB.

Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Mike Frysinger <vapier@gentoo.org>
2011-09-07 23:39:36 +02:00
Wolfgang Denk 26e670ea43 ARM: remove broken "evb4510" board.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
Cc: Curt Brune <curt@cucy.com>
2011-09-07 21:46:39 +02:00
Diana CRACIUN 99ffccbd3e Flush cache after the OS image is loaded into the memory.
Since we are loading an executable image into memory we need flush it
out of the cache to possible maintain coherence on CPUs with split
instruction and data caches.  We do this for other executable image
loading command.

On PowerPC once we do this we no longer need to explicitly flush the
dcache on multi-core systems in the BOOTM_STATE_OS_PREP phase.  We now
treat the BOOTM_STATE_OS_PREP as a no-op to maintain backwards
compatibility with the bootm subcommand.

Signed-off-by: James Yang <James.Yang@freescale.com>
Signed-off-by: Diana CRACIUN <Diana.Craciun@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2011-09-05 16:07:44 +02:00
Bradley Bolen 03bf22f559 stdio: Fix a possible buffer overflow
Signed-off-by: Bradley Bolen <bradleybolen at yahoo.com>
2011-09-04 23:27:52 +02:00
Joel A Fernandes b8bc8973a1 led: Remove state-saving of led for toggle functionality and add toggle option to led command
* Read the led output state from GPIO instead saving state in memory when it is [re]set
* Added a toggle option to the led command

Previous discussion:
http://lists.denx.de/pipermail/u-boot/2011-May/093068.html

Changes since v1:
Fixed checkpatch errors

Signed-off-by: Joel A Fernandes <agnel.joel@gmail.com>
Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2011-09-04 11:36:22 +02:00
Joel A Fernandes d604cda34a led: Fixed setting of STATUS_LED_BIT1 when led_name is 'all'
Fix for only one led getting set or reset when the led_name is 'all'

Previous discussion:
http://lists.denx.de/pipermail/u-boot/2011-May/093068.html

Changes since v1:
Fixed checkpatch if statement error noticed by Sergei.

Signed-off-by: Joel A Fernandes <agnel.joel@gmail.com>
Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2011-09-04 11:36:22 +02:00
Jason Kridner 4086b51cb7 led: correct off/on locations in structure
Although the initialization should probably be done with names, the
existing implementation has these structures filled in the opposite
order.

Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Joel A Fernandes <agnel.joel@gmail.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2011-09-04 11:36:22 +02:00
Jason Kridner 4421acf8cd led: added cmd_led to Makefile
Addition of cmd_led into the Makefile wasn't included in the patch
applied to u-boot-ti.

Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Joel A Fernandes <agnel.joel@gmail.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2011-09-04 11:36:22 +02:00
Jason Kridner 95492d784b Corrected LED name match finding avoiding extraneous Usage printouts
Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Joel A Fernandes <agnel.joel@gmail.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2011-09-04 11:36:21 +02:00
Marek Vasut 2a94dda0e7 USB: Move USB_PRINTF() out of ifdef in usb_scan_devices()
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
2011-08-08 22:00:12 +02:00
Marek Vasut 01a97d45d1 USB: Set portnr so USB1.1 and 1.0 devices work on EHCI controllers
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
2011-08-08 21:46:04 +02:00
Albert ARIBAUD fa82f871c8 Convert ISO-8859 files to UTF-8
There was a mix of UTF-8 and ISO-8859 files in the U-Boot source
tree, which could cause issues with the patchwork review system.
This commit converts all ISO-8859 files to UTF-8.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
2011-08-04 23:34:02 +02:00
Heiko Schocher 780f13a9e1 hwmon: do not init sensors on startup
The U-Boot Design Principles[1] clearly say:

  Initialize devices only when they are needed within U-Boot, i.e. don't
  initialize the Ethernet interface(s) unless U-Boot performs a download
  over Ethernet; don't initialize any IDE or USB devices unless U-Boot
  actually tries to load files from these, etc. (and don't forget to
  shut down these devices after using them - otherwise nasty things may
  happen when you try to boot your OS).

So, do not initialize and read the sensors on startup.

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Holger Brunck <holger.brunck@keymile.com>
2011-08-04 23:30:38 +02:00
John Rigby 3decb14abe mkimage: Add OMAP boot image support
- Add mkimage support for OMAP boot image
- Add support for OMAP boot image(MLO) generation in the new
  SPL framework

Signed-off-by: John Rigby <john.rigby@linaro.org>
Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2011-08-03 12:49:20 +02:00
Wolfgang Denk 1902692aa0 Merge branch 'master' of git://git.denx.de/u-boot-blackfin
* 'master' of git://git.denx.de/u-boot-blackfin:
  Blackfin: jtag-console: fix timer usage
  Blackfin: switch to common display_options()
  Blackfin: serial: move early debug strings into .rodata section
  Blackfin: adi boards: also set stderr to nc with helper
  Blackfin: update anomaly lists to latest public info
  Blackfin: serial: convert to bfin_{read,write} helpers
  Blackfin: split out async setup
  Blackfin: adi boards: enable pretty flash progress output
  Blackfin: drop unused dma.h header from start code
  Blackfin: portmux: allow header to be included in assembly files
  Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: enable mmc_spi support
  Blackfin: cm-bf537e/cm-bf537u/tcm-bf537: update network settings
  Blackfin: sync MMR read/write helpers with Linux
  Blackfin: gpio: optimize free path a little
  Blackfin: post: setup default CONFIG_SYS_POST_WORD_ADDR
  Blackfin: uart: fix printf warning
  Blackfin: add init.elf helper code
  Blackfin: dont reset SWRST on newer bf526 parts
  Blackfin: adi boards: enable multi serial support by default
  Blackfin: uart: add multiple serial support
  Blackfin: uart: move debug buffers into local bss
2011-08-02 21:46:53 +02:00
Wolfgang Denk e6a857da74 fpga: constify to fix build warning
Fix compiler warning:

cmd_fpga.c:318: warning: passing argument 3 of 'fit_image_get_data'
from incompatible pointer type

Adding the needed 'const' here entails a whole bunch of additonal
changes all over the FPGA code.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Andre Schwarz <andre.schwarz@matrix-vision.de>
Cc: Murray Jensen <Murray.Jensen@csiro.au>
Acked-by: Andre Schwarz<andre.schwarz@matrix-vision.de>
2011-08-01 15:19:40 +02:00
Wolfgang Denk 84b5e8022e Constify getenv(), setenv() and hash code functions
This is needed to get rid of build warnings like

main.c:311: warning: passing argument 2 of 'setenv' discards qualifiers from pointer target type

which result from commit 09c2e90 "unify version_string".

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Andreas Biemann <andreas.devel@googlemail.com>
2011-07-30 01:37:44 +02:00
Mike Williams 1626308797 cleanup: Fix typos and misspellings in various files.
Recieve/Receive
recieve/receive
Interupt/Interrupt
interupt/interrupt
Addres/Address
addres/address

Signed-off-by: Mike Williams <mike@mikebwilliams.com>
2011-07-28 21:27:36 +02:00
Andreas Bießmann 09c2e90c11 unify version_string
This patch removes the architecture specific implementation of
version_string where possible. Some architectures use a special place
and therefore we provide U_BOOT_VERSION_STRING definition and a common
weak symbol version_string.

Signed-off-by: Andreas Biemann <andreas.devel@googlemail.com>
CC: Mike Frysinger <vapier@gentoo.org>
CC: Peter Pan <pppeterpppan@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-07-28 17:22:53 +02:00
Heiko Schocher 7816f2cf81 mkimage: add UBL header support for booting davinci cpus
creating an u-boot.ubl file, which contains the UBL Header
needed for booting from NAND with the RBL from TI. For more
information read doc/README.ublimage.

Signed-off-by: Heiko Schocher <hs@denx.de>
2011-07-28 16:52:41 +02:00
Michael Jones 191c0b87b1 cmd_mac: fix help for 'mac read'
In the only implementation of 'mac read', it doesn't display the
contents of the eeprom as the help indicated unless compiled with
DEBUG. It only re-reads the contents of the EEPROM into memory.
Displaying the contents of the EEPROM is done by passing no
arguments to 'mac'.

Signed-off-by: Michael Jones <michael.jones@matrix-vision.de>
Acked-by: Detlev Zundel <dzu@denx.de>
2011-07-28 16:41:06 +02:00
Michael Jones 6a33a3c2c9 cmd_mac: cleanup help
Signed-off-by: Michael Jones <michael.jones@matrix-vision.de>
Acked-by: Detlev Zundel <dzu@denx.de>
2011-07-28 16:38:08 +02:00
Michael Jones f9a78b8d4f cosmetic: spell fixes etc.
Signed-off-by: Michael Jones <michael.jones@matrix-vision.de>
Acked-by: Detlev Zundel <dzu@denx.de>
2011-07-28 16:32:50 +02:00
Andreas Pretzsch 7130a579fd add command fitupd to run an update from a FIT image
Command calls update_tftp() analogous to automatic update described
in doc/README.update.

Usage:
fitupd [addr]
        - run update from FIT image at addr
          or from tftp 'updatefile'

Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>
2011-07-26 16:58:48 +02:00
Andreas Pretzsch 8d6b73202c automatic update from FIT image: add optional address parameter
Current update_tftp() flow:
  1.) fetch "updatefile" from defined TFTP server
  2.) check if FIT format
  3.) flash contained images

Add an address parameter to update_tftp(). If this address is non-zero,
skip the TFTP transfer and use the image at this address.
Also extend update_tftp() to return success/fail.

Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>
2011-07-26 16:58:44 +02:00
Mike Frysinger 7b826c2f35 serial: implement common uart post test
The current arch/driver specific UART posts basically boil down to setting
the UART to loop back mode, then reading and writing data.  If we ignore
the loop back part, the rest can be built upon the existing common serial
API.  So let's do just that.

First add a call back for serial drivers to implement loop back control.
Then write a post test that walks all of the serial drivers, puts them
into loop back mode, and verifies that reading/writing at all the diff
baud rates is OK.

If a serial driver doesn't support loop back mode (either it can't or
it hasn't done so yet), then skip it.  This should allow for people to
easily migrate to the new post test with existing serial drivers.

I haven't touched the few already existing uart post tests as I don't
the hardware or knowledge of converting them over.  So I've marked the
new test as weak which will allow the existing tests to override the
default until they are converted.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:39:03 +02:00
Mike Frysinger c52b4f7945 serial: drop serial_register return value
The serial_register function never fails (always return 0), so change it
to a void function to avoid wasting overhead on it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:38:01 +02:00
Mike Frysinger 6c768ca746 serial: push default_serial_console to drivers
Rather than sticking arch/board/driver specific logic in the common
serial code, push it all out to the respective drivers.  The serial
drivers declare these funcs weak so that boards can still override
things with their own definition.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
CC: Heiko Schocher <hs@denx.de>
CC: Anatolij Gustschin <agust@denx.de>
CC: Tom Rix <Tom.Rix@windriver.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
CC: Craig Nauman <cnauman@diagraph.com>
CC: Prafulla Wadaskar <prafulla@marvell.com>
CC: Mahavir Jain <mjain@marvell.com>
Tested-by: Minkyu Kang <mk7.kang@samsung.com>
2011-07-26 16:37:57 +02:00
Mike Frysinger e84ffddbce cmd_usage: constify
The usage helper doesn't modify the command, so constify its input arg.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:34:41 +02:00
Mike Frysinger 147c7169e8 constify default env
I can't see any obvious needs for the default environment to be writable,
so make it const.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:34:22 +02:00
Mike Frysinger c3eb3fe490 env: allow people to force envcrc building
For people who want to manually extract the embedded environment so that
it can be manually packed into the final u-boot image, add a config opt
to force building of the envcrc tool.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-26 16:33:49 +02:00
Aneesh V 05bad4aa56 scaled down version of generic libraries for SPL
Signed-off-by: Aneesh V <aneesh@ti.com>
2011-07-26 14:44:25 +02:00
Jens Scharsig a16a84b725 Fix: watchdog timed out, if using md5 command
* Fix: if using md5 command watchdog timed out
* change function call md5(..) to the watchdog-safe variant
  md5_wd(..) to support watchdog reset

Signed-off-by: Jens Scharsig <esw@bus-elektronik.de>
2011-07-26 14:36:07 +02:00
Jens Scharsig 3e499b6ab0 Fix: watchdog timed out, if using sha1 command
* Fix: if using sha1 command watchdog timed out
* change function call sha1_csum(..) to the watchdog-safe variant
  sha1_csum_wd(..) to support watchdog reset

Signed-off-by: Jens Scharsig <esw@bus-elektronik.de>
2011-07-26 14:33:10 +02:00
Matthew McClintock d0c4c33850 command/cmd_cache.c: Add optional flush arguments
It might be desirable to have the ability to flush icache/dcache
within u-boot, this patch gives each arch the ability to provide
a flush_dcache/flush_icache function to let u-boot flush caches
from the prompt

Signed-off-by: Matthew McClintock <msm@freescale.com>
2011-07-26 14:30:08 +02:00
Matthew McClintock 0e0996ef4f common/cmd_ximg.c: add ifdef protection for gzip uncompression
Print a message if we do not have the ability to uncompress a gzip
image. Before, u-boot would just assume the routines were available

Signed-off-by: Matthew McClintock <msm@freescale.com>
2011-07-26 14:11:21 +02:00
Matthew McClintock df3fc52608 disk/part.c: Make features optional
If we don't want to build support for any partition types we can now
add #undef CONFIG_PARTITIONS in a board config file to keep this from
being compiled in. Otherwise boards assume this is compiled in by
default

Signed-off-by: Matthew McClintock <msm@freescale.com>
2011-07-26 14:10:14 +02:00
Laurence Withers 07c07635b4 miiphy: use strncpy() not sprintf()
In miiphy_register() the new device's name was initialised by passing a
string parameter as the format string to sprintf(). As this would cause
problems if it ever contained a '%' symbol, switch to using strncpy()
instead.

Signed-off-by: Laurence Withers <lwithers@guralp.com>
Cc: Andy Fleming <afleming@freescale.com>
2011-07-26 14:00:24 +02:00
Jens Scharsig 39c6e039a0 Fix: if using crc32 command watchdog timed out
* Fix: if using crc32 command watchdog timed out
* change function call crc32(..) to the watchdog-safe variant
  crc_32_wd(..) to support watchdog reset

Signed-off-by: Jens Scharsig <esw@bus-elektronik.de>
2011-07-26 00:40:50 +02:00
Rob Herring 942e31437d scsi/ahci: add support for non-PCI controllers
Add support for AHCI controllers that are not PCI based.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Wolfgang Denk <wd@denx.de>
2011-07-26 00:06:58 +02:00
Jason Hobbs 370d1e3e58 cosmetic, main: correct indentation/spacing issues
Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
2011-07-25 23:28:05 +02:00
Jason Hobbs 3c766dccb3 cosmetic, main: clean up declarations of abortboot
Remove an unneeded prototype declaration from the top of main.c,
and use plain inline instead of __inline__ to please checkpatch.

Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
2011-07-25 23:27:43 +02:00
Mike Frysinger 67d668bf92 autostart: unify duplicated logic into the bootm code
Rather than having a bunch of random commands handle autostart behavior,
unify the logic in a single place.  This also fixes building of these

different commands when bootm is disabled.

Acked-by: Matthew McClintock <msm@freescale.com>
Acked-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-25 22:18:26 +02:00
Wolfgang Denk 74fac70084 Merge branch 'master' of git://git.denx.de/u-boot-mmc
* 'master' of git://git.denx.de/u-boot-mmc:
  mmc: rescan fails on empty slot
  AT91:mmc:fix multiple read/write error
  mmc: Access mode validation for eMMC cards > 2 GiB
  mmc: sh_mmcif: add support for Renesas MMCIF
  mmc: fix the condition for MMC version 4
  MMC: add marvell sdhci driver
  MMC: add sdhci generic framework
  MMC: add erase function to both mmc and sd
  MMC: unify mmc read and write operation
  mmc: Tegra2: Enable SD/MMC driver for Seaboard and Harmony
  mmc: Tegra2: SD/MMC driver for Seaboard - eMMC on SDMMC4, SDIO on SDMMC3
2011-07-19 22:27:07 +02:00
Matthew McClintock 1bb5e9071f Fix typo from 'mb_alloc' -> 'lmb_alloc'
Signed-off-by: Matthew McClintock <msm@freescale.com>
2011-07-19 10:38:33 +02:00
Wolfgang Denk cdf1a2328a Merge branch 'master' of git://git.denx.de/u-boot-arm
* 'master' of git://git.denx.de/u-boot-arm:
  ARM: MX5: Fix broken leftover TO-2 errata workaround
  MX31: Cleanup clock function
  scb9328: Add ARM relocation support
  am3517evm: change console device from ttyS2 to ttyO2
  Remove volatile qualifier in get_ram_size() calls
  TI: TNETV107X Fix Build Error
  ARM: add missing CONFIG_SKIP_LOWLEVEL_INIT for armv7
  arm: add CONFIG_MACH_TYPE setting and documentation
  arm: add __ilog2 function
  Timer: Fix misuse of ARM *timer_masked() functions outside arch/arm
  EfikaMX: Enable EXT2 booting
  EfikaMX: Add missing CONFIG_SYS_TEXT_BASE
  EfikaMX: Use correct imximage.cfg
  MX27: Update to autogenerated asm-offsets.h
  MX5: Update to autogenerated asm-offsets.h
  imx: Add support for zmx25 board
  imx: Make imx25 compatible to mxc_gpio driver and fix in tx25
  imx: Add auto generation of asm-offsets.h for imx25
  imx: Add support for USB EHCI on imx25
  imx: Use correct imx25 reset.c
  imx: Add get_tbclk() function for imx25
  ARM: Update maintainer of board scb9328
  mx27: Make the UART port number explicit
  build: Add targets for auto gen of asm-offsets.h and use it in imx35
  mx31pdk: cosmetic: Fix line over 80 characters
2011-07-18 21:04:56 +02:00
Albert ARIBAUD a55d23ccf6 Remove volatile qualifier in get_ram_size() calls
Checkpatch.pl complains about the volatile qualifier in calls to
get_ram_size(). Remove this qualifier in the prototype and in the
calls where it is useless, and leave it only in the function body
where it is needed.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
2011-07-17 17:11:53 +02:00
David A. Long a28afca57d Add uboot "fdt_high" enviroment variable
Add a new "fdt_high" enviroment variable. This can be used to control (or prevent) the
relocation of the flattened device tree on boot. It can be used to prevent relocation
of the fdt into highmem.  The variable behaves similarly to the existing "initrd_high"
variable.

Signed-off-by: David A. Long <dave.long@linaro.org>
2011-07-16 11:58:30 -04:00
Michael Jones 8fd01b8f6b mmc: rescan fails on empty slot
Fail in 'mmc rescan' if mmc_init() returns error

Signed-off-by: Michael Jones <michael.jones@matrix-vision.de>
Acked-by: Andy Fleming <afleming@freescale.com>
2011-07-15 20:29:22 -05:00