oweals/u-boot.git
12 years agopowerpc/mpc83xx: increment malloc heap size
Kim Phillips [Sat, 30 Jun 2012 23:29:20 +0000 (18:29 -0500)]
powerpc/mpc83xx: increment malloc heap size

extention of commit 3b6b256 "powerpc/mpc83xx: increment
malloc heap size for the MPC832x MDS boards" to all other
mpc83xx based boards.  It fixes "Unable to save the rest
of sector" messages when trying to save the environment
to flash.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
12 years agopowerpc/mpc83xx: fix copyright string in serdes.c
Timur Tabi [Tue, 19 Jun 2012 00:11:34 +0000 (19:11 -0500)]
powerpc/mpc83xx: fix copyright string in serdes.c

The misspelling of "semiconductor" causes some internal copyright analysis
tools to complain.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
12 years agotools/mkenvimage.c: fix basename(3) usage
Andreas Bießmann [Thu, 28 Jun 2012 06:01:58 +0000 (08:01 +0200)]
tools/mkenvimage.c: fix basename(3) usage

Use the POSIX variant of basename due to BSD systems (e.g. OS X) do not provide
GNU version of basename(3). It is save to use the POSIX variant here cause we do
never use argv[0] later on which may be modified by the basename(3) POSIX
variant.
On systems providing GNU variant the GNU variant should be used since string.h
is included before libgen.h. Therefore let the _GNU_SOURCE as is.

This patch fixes following warning (on OS X):
---8<---
mkenvimage.c: In function ‘main’:
mkenvimage.c:105: warning: implicit declaration of function ‘basename’
mkenvimage.c:105: warning: assignment makes pointer from integer without a cast
--->8---

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
cc: Keith Mok <ek9852@gmail.com>

12 years agosh: ap_sh4a_4a: Fix wrong register initialization value
Nobuhiro Iwamatsu [Thu, 28 Jun 2012 01:22:57 +0000 (10:22 +0900)]
sh: ap_sh4a_4a: Fix wrong register initialization value

The value of ET0_ERXD6 and GPSR1_INIT was wrong.
This fixes them.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
12 years agoext2load: increase read speed
u-boot@lakedaemon.net [Wed, 28 Mar 2012 04:37:11 +0000 (04:37 +0000)]
ext2load: increase read speed

This patch dramatically drops the amount of time u-boot needs to read a
file from an ext2 partition.  On a typical 2 to 5 MB file (kernels and
initrds) it goes from tens of seconds to a couple seconds.

All we are doing here is grouping contiguous blocks into one read.

Boot tested on Globalscale Technologies Dreamplug (Kirkwood ARM SoC)
with three different files.  sha1sums were calculated in Linux
userspace, and then confirmed after ext2load.

Signed-off-by: Jason Cooper <u-boot@lakedaemon.net>
Tested-by: Eric Nelson <eric.nelson@boundarydevices.com>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
12 years agopxe: add support for parsing local syslinux files
Rob Herring [Fri, 25 May 2012 10:47:39 +0000 (10:47 +0000)]
pxe: add support for parsing local syslinux files

Add a new command "sysboot" which parses syslinux menu files and boots
using kernel and initrd specified by menu files. The operation is similar
to "pxe boot" except local files on ext2 or fat filesystem are parsed.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
12 years agopxe: parse initrd file from append string
Rob Herring [Wed, 28 Mar 2012 05:51:37 +0000 (05:51 +0000)]
pxe: parse initrd file from append string

For syslinux, the initrd can be set in the append string as
"initrd=<file>", so try to find it there if we haven't already set the
initrd.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
12 years agopxe: support absolute paths
Rob Herring [Wed, 28 Mar 2012 05:51:36 +0000 (05:51 +0000)]
pxe: support absolute paths

If the file path starts with a '/', then don't pre-pend the bootfile path.
This fixes a problem with running 'pxe boot' multiple times where the
bootfile path gets pre-pended to itself each time.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
12 years agopxe: support linux entries for labels
Rob Herring [Wed, 28 Mar 2012 05:51:35 +0000 (05:51 +0000)]
pxe: support linux entries for labels

Kernels can be specified using "linux" or "kernel" entry. The difference
is kernel is supposed to detect the type of file, but for u-boot both are
treated the same.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
12 years agopxe: add support for label menu text
Rob Herring [Wed, 28 Mar 2012 05:51:34 +0000 (05:51 +0000)]
pxe: add support for label menu text

Use a menu string if present, otherwise use the kernel string.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
12 years agopxe: support include files at top-level
Rob Herring [Fri, 25 May 2012 10:43:16 +0000 (10:43 +0000)]
pxe: support include files at top-level

Include files outside of a menu were not getting included and parsed.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
12 years agomenu: only timeout when menu is displayed
Rob Herring [Wed, 28 Mar 2012 05:51:32 +0000 (05:51 +0000)]
menu: only timeout when menu is displayed

Make the menu timeout apply only when prompt flag is set and after the
menu is displayed. This allows auto boot to work no matter whether prompt
is set or cleared. Use the default selection if the menu times out.

This also fixes the timeout value given to readline_into_buffer to be
seconds instead of 10th of seconds.

Old behavior:

if prompt
  display menu and wait for choice
else
  wait for timeout
  if key pressed
    display menu and wait for choice
  else
    exit command

New behavior:

if prompt
  display menu
  if key pressed
    wait for choice
  else
    boot default entry on timeout
else
  boot default entry

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
12 years agocheckpatch: add check for whitespace before semicolon at end-of-line
Eric Nelson [Thu, 3 May 2012 03:32:18 +0000 (20:32 -0700)]
checkpatch: add check for whitespace before semicolon at end-of-line

This tests for a bad habits of mine like this:

return 0 ;

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
12 years agoBlock: Remove MG DISK support
Marek Vasut [Sun, 4 Mar 2012 15:11:32 +0000 (15:11 +0000)]
Block: Remove MG DISK support

This driver is unused and obsolete.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: unsik Kim <donari75@gmail.com>
12 years agoStrip fw_printenv like the other tools
Loïc Minier [Sun, 11 Mar 2012 15:43:02 +0000 (16:43 +0100)]
Strip fw_printenv like the other tools

Signed-off-by: Loïc Minier <lool@debian.org>
12 years agohush.c: Move default CONFIG_SYS_PROMPT_HUSH_PS2 to hush.c
Tom Rini [Tue, 19 Jun 2012 22:54:35 +0000 (15:54 -0700)]
hush.c: Move default CONFIG_SYS_PROMPT_HUSH_PS2 to hush.c

Exactly one board has defined CONFIG_SYS_PROMPT_HUSH_PS2 to a value
different than "> " which is vision2.  I have Cc'd the maintainer here
as I strongly suspect this is a bug rather than intentional behavior.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@ti.com>
Acked-by: Stefano Babic <sbabic@denx.de>
12 years agoCONFIG_SYS_BAUDRATE_TABLE: Add <config_fallbacks.h>, place there
Tom Rini [Tue, 19 Jun 2012 12:54:34 +0000 (12:54 +0000)]
CONFIG_SYS_BAUDRATE_TABLE: Add <config_fallbacks.h>, place there

We provide a default table of { 9600, 19200, 38400, 57600, 115200 }
in <config_fallbacks.h> which mkconfig places after <configs/...h> in
the generated config file.  This is used when a board has not set its
own table.

Signed-off-by: Tom Rini <trini@ti.com>
12 years agopatman: Handle creation of patman config file
Vikram Narayanan [Wed, 23 May 2012 09:01:06 +0000 (09:01 +0000)]
patman: Handle creation of patman config file

patman shouts when it couldn't find a $(HOME)/.patman file.
Handle it in a sane way by creating a new one for the user.
It looks for a user.name and user.email in the global .gitconfig
file, waits for the user input if it can't find there. Update the
same in the README

Signed-off-by: Vikram Narayanan <vikram186@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Wolfgang Denk <wd@denx.de>
12 years agopatman: Change the location of patman config file
Vikram Narayanan [Wed, 23 May 2012 08:58:58 +0000 (08:58 +0000)]
patman: Change the location of patman config file

Move the config file from ~/.config/patman to ~/.patman as it is
more appropriate to have it there. Update the same in the README.

Signed-off-by: Vikram Narayanan <vikram186@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Wolfgang Denk <wd@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agolmb: do not export anything without CONFIG_LMB
Mike Frysinger [Wed, 15 Feb 2012 20:02:47 +0000 (20:02 +0000)]
lmb: do not export anything without CONFIG_LMB

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoeasylogo: add lzma support
Mike Frysinger [Fri, 3 Feb 2012 16:16:59 +0000 (16:16 +0000)]
easylogo: add lzma support

Compressing the logos with lzma rather than gzip saves ~9kb with the
Blackfin 24bit images and ~3kb with the 16bit images.

Add a new -l option to easylogo so people can pick lzma as their
decompression routine.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agocmd_mem: cmp: convert while() to for() loop
Mike Frysinger [Fri, 20 Jan 2012 09:07:22 +0000 (09:07 +0000)]
cmd_mem: cmp: convert while() to for() loop

Simplify the code slightly by using a for() loop since this is
basically what we're already doing -- incrementing "ngood" to
the value in "count".

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agocmd_mem: cmp: unify size code paths
Mike Frysinger [Fri, 20 Jan 2012 09:07:21 +0000 (09:07 +0000)]
cmd_mem: cmp: unify size code paths

Not only does the source code get simpler, but it also shrinks the
compiled object code too.

While we're here, tweak the summary message to avoid the plural
issue.  It isn't that big of a deal, and it's currently wrong
anyways in the single (1 byte) case:
Total of 1 byte were the same
Grammar wise, that should be "was" rather than "were".  The new
output people should be able to easily figure out:
Total of 1 byte(s) were the same
Total of 10 byte(s) were the same

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agocmd_mem: replace custom PRINTF() with debug()
Mike Frysinger [Fri, 20 Jan 2012 09:07:20 +0000 (09:07 +0000)]
cmd_mem: replace custom PRINTF() with debug()

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoMerge branch 'master' of git://git.denx.de/u-boot-mpc83xx
Wolfgang Denk [Tue, 19 Jun 2012 20:14:57 +0000 (22:14 +0200)]
Merge branch 'master' of git://git.denx.de/u-boot-mpc83xx

* 'master' of git://git.denx.de/u-boot-mpc83xx:
  km/common: check test_bank and testpin for testboot
  powerpc/83xx/km: readout dip_switch on kmcoge5ne
  powerpc/83xx: configure CONFIG_POST for kmcoge5ne
  powerpc/83xx/km: added missing enable of application buffer
  km/common: increase bootlimit to 3
  km/common: fixed error in ethaddr (1-byte-shift)
  MAINTAINERS: cleanup for keymile boards
  powerpc/83xx: add kmcoge5ne board support
  km/common: add support for second flash
  powerpc83xx/km: remove unneeded CONFIG_PCI for kmeter1
  powerpc83xx/km: lock the window size to 2GiB befor fixing sdram size
  powerpc/83xx/km: use tuxx1.h for kmsupx5 target
  powerpc/83xx: increment malloc heap size for the MPC832x MDS boards

Signed-off-by: Wolfgang Denk <wd@denx.de>
12 years agokm/common: check test_bank and testpin for testboot
Thomas Herzmann [Fri, 4 May 2012 08:55:58 +0000 (10:55 +0200)]
km/common: check test_bank and testpin for testboot

If the testpin is asserted, first check if a test_bank
variable is defined before trying to boot this
test_bank.

Signed-off-by: Thomas Herzmann <thomas.herzmann@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
12 years agopowerpc/83xx/km: readout dip_switch on kmcoge5ne
Thomas Herzmann [Fri, 4 May 2012 08:55:57 +0000 (10:55 +0200)]
powerpc/83xx/km: readout dip_switch on kmcoge5ne

On kmcoge5ne we have a dip switch present. If this switch
was switched on the actual_bank is set to 0 and this SW
will be booted.

Signed-off-by: Thomas Herzmann <thomas.herzmann@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
12 years agopowerpc/83xx: configure CONFIG_POST for kmcoge5ne
Thomas Herzmann [Fri, 4 May 2012 08:55:56 +0000 (10:55 +0200)]
powerpc/83xx: configure CONFIG_POST for kmcoge5ne

kmcoge5ne starts the post tests if the testpin on
the board was enabled. Currently it does simply a memory
test.

Signed-off-by: Thomas Herzmann <thomas.herzmann@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
12 years agopowerpc/83xx/km: added missing enable of application buffer
Stefan Bigler [Fri, 4 May 2012 08:55:55 +0000 (10:55 +0200)]
powerpc/83xx/km: added missing enable of application buffer

Enabled application buffers in uboot to allow application chipselect
access in uboot.

Signed-off-by: Stefan Bigler <stefan.bigler@keymile.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
12 years agokm/common: increase bootlimit to 3
Holger Brunck [Fri, 4 May 2012 08:55:54 +0000 (10:55 +0200)]
km/common: increase bootlimit to 3

Increase bootlimit to 3 to be more tolerant during the
boot process before switching to the backup application.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
12 years agokm/common: fixed error in ethaddr (1-byte-shift)
Thomas Herzmann [Fri, 4 May 2012 08:55:53 +0000 (10:55 +0200)]
km/common: fixed error in ethaddr (1-byte-shift)

The MAC address begins at offset 1.

Signed-off-by: Thomas Herzmann <thomas.herzmann@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
12 years agoMAINTAINERS: cleanup for keymile boards
Holger Brunck [Wed, 21 Mar 2012 12:42:47 +0000 (13:42 +0100)]
MAINTAINERS: cleanup for keymile boards

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Kim Phillips <kim.phillips@freescale.com>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Gerlando Falauto <gerlando.falauto@keymile.com>
cc: Heiko Schocher <hs@denx.de>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
12 years agopowerpc/83xx: add kmcoge5ne board support
Holger Brunck [Wed, 21 Mar 2012 12:42:46 +0000 (13:42 +0100)]
powerpc/83xx: add kmcoge5ne board support

This board is a MPC8360 board. Two flashes are present
a NOR flash were u-boot and the u-boot environment is stored
and a NAND flash for the application code. This board has 512MB
SDRAM.

Additionaly we introduce a common km8360.h file and convert kmeter1 to
use this.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Christian Herzig <christian.herzig@keymile.com>
cc: Kim Phillips <kim.phillips@freescale.com>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Gerlando Falauto <gerlando.falauto@keymile.com>
cc: Heiko Schocher <hs@denx.de>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
12 years agokm/common: add support for second flash
Andreas Huber [Fri, 4 May 2012 08:30:16 +0000 (10:30 +0200)]
km/common: add support for second flash

Add support for a second flash.
By default, a single flash chip is set up:
- called 'boot'
- mtd name for ubi 'ubi0'
MTDIDS and MTDPARTS may be overwritten to add a second flash.
The 'ubiattach' command is featured in two versions:
- if CONFIG_KM_UBI_PARTITION_NAME_APP is not defined:
  this is the version as up to now
- if CONFIG_KM_UBI_PARTITION_NAME_APP is defined:
  a check on 'actual_bank' will be done to determine the flash to boot
  from.

Use CONFIG_KM_UBI_PARTITION_NAME_BOOT and
CONFIG_KM_UBI_PARTITION_NAME_APP to define where to put the bootloader
and the applications.

Example:
In the board config do:
... snip ...

       "boot:"                                                 \
               "768k(u-boot),"                                 \
               "128k(env),"                                    \
               "128k(envred),"                                 \
               "-(" CONFIG_KM_UBI_PARTITION_NAME_BOOT ");"     \
       "app:"                                                  \
               "-(" CONFIG_KM_UBI_PARTITION_NAME_APP ");"

... snap ...

You may also need to enable the second flash:
... snip ...
/* additional featured for COGE5 */
... snap ...

Signed-off-by: Andreas Huber <andreas.huber@keymile.com>
cc: Kim Phillips <kim.phillips@freescale.com>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Gerlando Falauto <gerlando.falauto@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
12 years agopowerpc83xx/km: remove unneeded CONFIG_PCI for kmeter1
Holger Brunck [Wed, 21 Mar 2012 12:42:44 +0000 (13:42 +0100)]
powerpc83xx/km: remove unneeded CONFIG_PCI for kmeter1

We don't use PCI on kmeter1 and never will be, so remove some
unneeded code.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Kim Phillips <kim.phillips@freescale.com>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Gerlando Falauto <gerlando.falauto@keymile.com>
cc: Heiko Schocher <hs@denx.de>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
12 years agopowerpc83xx/km: lock the window size to 2GiB befor fixing sdram size
Christian Herzig [Wed, 21 Mar 2012 12:42:43 +0000 (13:42 +0100)]
powerpc83xx/km: lock the window size to 2GiB befor fixing sdram size

If the ram size isn't locked to 2GiB, the get_ram_size() may hang up.

Signed-off-by: Christian Herzig <christian.herzig@keymile.com>
cc: Kim Phillips <kim.phillips@freescale.com>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Gerlando Falauto <gerlando.falauto@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
12 years agopowerpc/83xx/km: use tuxx1.h for kmsupx5 target
Holger Brunck [Wed, 21 Mar 2012 12:42:42 +0000 (13:42 +0100)]
powerpc/83xx/km: use tuxx1.h for kmsupx5 target

This additional header is unneeded, we can use the tuxx1.h for this
target.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Kim Phillips <kim.phillips@freescale.com>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Gerlando Falauto <gerlando.falauto@keymile.com>
cc: Heiko Schocher <hs@denx.de>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
12 years agopowerpc/83xx: increment malloc heap size for the MPC832x MDS boards
Timur Tabi [Sat, 17 Mar 2012 22:44:00 +0000 (17:44 -0500)]
powerpc/83xx: increment malloc heap size for the MPC832x MDS boards

The malloc buffer is not large enough to hold a flash sector (0x20000 bytes)
in addition to whatever else it normally holds, so double its size.  This
fixes a failure trying to save the environment:

=> save
Saving Environment to Flash...
Unable to save the rest of sector (122880)
. done
Protected 1 sectors

This problem probably surfaced from some other change that significantly
increased the normal memory usage, thereby not leaving enough room for
the saveenv command.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
12 years agocmd_nand: fix crashing bug in nand read/write
Steve Sakoman [Thu, 7 Jun 2012 17:19:18 +0000 (10:19 -0700)]
cmd_nand: fix crashing bug in nand read/write

Commit 418396e212b59bf907dbccad997ff50f7eb61b16 introduced a
bug that causes nand read and nand write to crash in strcmp
due to a null pointer.

Root cause is that strchr(cmd, '.') returns a null pointer when
the input string does not contain a '.'

The strcmp function does not check for null pointers, resulting
in a crash.

Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Scott Wood <scott@tyr.buserror.net>
12 years agoMerge branch 'master' of git://git.denx.de/u-boot-video
Wolfgang Denk [Thu, 7 Jun 2012 21:42:17 +0000 (23:42 +0200)]
Merge branch 'master' of git://git.denx.de/u-boot-video

* 'master' of git://git.denx.de/u-boot-video:
  video: atmel/lcd: add LCD driver for new Atmel SoC
  video: cfb_console: flush dcache for frame buffer in DRAM
  cfb_console: Ignore bell character
  cfb_console: Add console_clear_line function
  cfb_console: Fix function console_back
  omap3_dss: cosmetic changes
  omap3_dss: add optional framebuffer
  mx53loco: Add LCD support
  mx5: Rename mx51_fb_init()
  mx53: Allow IPUv3 driver to also work on mx53
  mx51evk: Add LCD support
  EXYNOS: display 32bpp bitmap TIZEN logo
  create lib/tizen directory
  LCD: display 32bpp decompressed bitmap image
  common/lcd.c: reduce one CONFIG_LCD_LOGO ifdef
  common/lcd.c: reduce some CONFIG_LCD_*_LOGO ifdefs
  common/lcd.c: use ARRAY_SIZE
  cmd_bmp.c: make bmp_display() usable by drivers or board code
  LCD: support another s6e8ax0 panel type
  LCD: change s6e8ax0 panel gamma value
  include/video.h: drop unused video_printf()

Signed-off-by: Wolfgang Denk <wd@denx.de>
12 years agoMerge branch 'master' of git://git.denx.de/u-boot-avr32
Wolfgang Denk [Thu, 7 Jun 2012 21:41:03 +0000 (23:41 +0200)]
Merge branch 'master' of git://git.denx.de/u-boot-avr32

* 'master' of git://git.denx.de/u-boot-avr32:
  avr32:board.c: fix compile warning
  avr32:grasshopper: fix PHY initialisation

Signed-off-by: Wolfgang Denk <wd@denx.de>
12 years agoMerge branch 'master' of git://git.denx.de/u-boot-mips
Wolfgang Denk [Thu, 7 Jun 2012 21:38:54 +0000 (23:38 +0200)]
Merge branch 'master' of git://git.denx.de/u-boot-mips

* 'master' of git://git.denx.de/u-boot-mips:
  MIPS: board.c: move extern declarations to u-boot-mips.h
  MIPS: bootm_qemu_mips.c: make checkpatch.pl clean
  MIPS: bootm.c: make checkpatch.pl clean

Signed-off-by: Wolfgang Denk <wd@denx.de>
12 years agoMerge branch 'master' of git://git.denx.de/u-boot-sh
Wolfgang Denk [Thu, 7 Jun 2012 21:34:11 +0000 (23:34 +0200)]
Merge branch 'master' of git://git.denx.de/u-boot-sh

* 'master' of git://git.denx.de/u-boot-sh:
  sh/ap_sh4a_4a: Fix typo of operator in ET0_ETXD4
  sh: Add SH7269 device and RSK2+SH7269 board
  sh: Set CONFIG_SH_ETHER_PHY_MODE and CONFIG_SH_ETHER_SH7734_MII to boards with sh_eth
  sh: Add support for AP-SH4A-4A board
  sh: Add register definition of PFC for SH7734
  sh: r0p7734: Add support I2C controller
  sh: Add bit control functions
  sh: Add support for r0p7734 board
  sh: Add support Renesas SH7734

Signed-off-by: Wolfgang Denk <wd@denx.de>
12 years agoMPC8xxx: Define cache ops for USB
Marek Vasut [Fri, 25 May 2012 14:14:46 +0000 (16:14 +0200)]
MPC8xxx: Define cache ops for USB

This patch conditionally defines flush_dcache_range() and
invalidate_dcache_range() on MPC8xxx, to avoid EHCI complaining,
resulting in the following output:

$ ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- ./MAKEALL MPC8572DS
Configuring for MPC8572DS board...
make: *** [u-boot] Error 1
powerpc-linux-gnu-size: './u-boot': No such file
e1000.c: In function ‘e1000_initialize’:
e1000.c:5264:13: warning: assignment from incompatible pointer type [enabled by default]
tsec.c: In function ‘tsec_initialize’:
tsec.c:638:12: warning: assignment from incompatible pointer type [enabled by default]
drivers/usb/host/libusb_host.o: In function `ehci_td_buffer':
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:186: undefined reference to `flush_dcache_range'
drivers/usb/host/libusb_host.o: In function `ehci_submit_async':
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:346: undefined reference to `flush_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:348: undefined reference to `flush_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:349: undefined reference to `flush_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:372: undefined reference to `invalidate_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:374: undefined reference to `invalidate_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:376: undefined reference to `invalidate_dcache_range'
/home/marex/U-Boot/u-boot-imx/drivers/usb/host/ehci-hcd.c:386: undefined reference to `invalidate_dcache_range'
make: *** [u-boot] Error 1

--------------------- SUMMARY ----------------------------
Boards compiled: 1
Boards with errors: 1 ( MPC8572DS )
----------------------------------------------------------

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
12 years agovideo: atmel/lcd: add LCD driver for new Atmel SoC
Bo Shen [Fri, 25 May 2012 00:59:58 +0000 (00:59 +0000)]
video: atmel/lcd: add LCD driver for new Atmel SoC

The new Atmel SoC (at91sam9x5 series and at91sam9n12) add a totally
different LCD controller. Add this new driver to support it.

Using CONFIG_ATMEL_HLCD (distinguish with CONFIG_ATMEL_LCD) to enable
this in board configuration file.

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
12 years agovideo: cfb_console: flush dcache for frame buffer in DRAM
Anatolij Gustschin [Tue, 5 Jun 2012 07:19:18 +0000 (09:19 +0200)]
video: cfb_console: flush dcache for frame buffer in DRAM

Data cache flushing is required for frame buffer in RAM to fix the
distorted console text output. Currently this text distortion is
observed with cfb on beagleboard and N900 when running with data
cache enabled.

Reported-by: Pali Rohár <pali.rohar@gmail.com>
Tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
12 years agocfb_console: Ignore bell character
Pali Rohár [Sat, 28 Apr 2012 07:26:47 +0000 (07:26 +0000)]
cfb_console: Ignore bell character

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
12 years agocfb_console: Add console_clear_line function
Pali Rohár [Sat, 28 Apr 2012 07:26:44 +0000 (07:26 +0000)]
cfb_console: Add console_clear_line function

console_clear_line() clears part of specified line or the full line.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
12 years agocfb_console: Fix function console_back
Pali Rohár [Sat, 28 Apr 2012 07:26:43 +0000 (07:26 +0000)]
cfb_console: Fix function console_back

* Do not disable and enable the cursor again.

console_back() is called only from video_putc() which already turns
the cursor off at the beginning and turns it on at the end, so there
is no need to change the cursor in console_back().

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
12 years agoavr32:board.c: fix compile warning
Andreas Bießmann [Fri, 25 May 2012 10:29:33 +0000 (12:29 +0200)]
avr32:board.c: fix compile warning

This patch fixes following warning:

---8<---
board.c: In function 'board_init_r':
board.c:257: warning: unused variable 's'
--->8---

Patch de30122bb58fee7b0f94bcfabab595b6ad757336 missed to remove this variable
too.

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
12 years agoavr32:grasshopper: fix PHY initialisation
Andreas Bießmann [Fri, 25 May 2012 10:29:32 +0000 (12:29 +0200)]
avr32:grasshopper: fix PHY initialisation

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
12 years agoMIPS: board.c: move extern declarations to u-boot-mips.h
Daniel Schwierzeck [Sun, 3 Jun 2012 21:46:04 +0000 (23:46 +0200)]
MIPS: board.c: move extern declarations to u-boot-mips.h

This fixes some remaining checkpatch.pl warnings.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
12 years agoMIPS: bootm_qemu_mips.c: make checkpatch.pl clean
Daniel Schwierzeck [Sun, 3 Jun 2012 21:46:04 +0000 (23:46 +0200)]
MIPS: bootm_qemu_mips.c: make checkpatch.pl clean

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
12 years agoMIPS: bootm.c: make checkpatch.pl clean
Daniel Schwierzeck [Sun, 3 Jun 2012 21:46:04 +0000 (23:46 +0200)]
MIPS: bootm.c: make checkpatch.pl clean

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
12 years agosh/ap_sh4a_4a: Fix typo of operator in ET0_ETXD4
Nobuhiro Iwamatsu [Tue, 22 May 2012 04:59:38 +0000 (13:59 +0900)]
sh/ap_sh4a_4a: Fix typo of operator in ET0_ETXD4

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
12 years agosh: Add SH7269 device and RSK2+SH7269 board
Phil Edworthy [Tue, 15 May 2012 22:15:51 +0000 (22:15 +0000)]
sh: Add SH7269 device and RSK2+SH7269 board

This is an sh2a device (max 266MHz) with FPU, video display
controller (VDC), 8 serial ports, 4 I2C channels, 3 CAN ports,
SD and on-chip USB.

The RSK2+SH7269 board uses the SH7269 processor. It is often
referred to as just rsk7269.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
12 years agosh: Set CONFIG_SH_ETHER_PHY_MODE and CONFIG_SH_ETHER_SH7734_MII to boards with sh_eth
Nobuhiro Iwamatsu [Wed, 16 May 2012 01:23:21 +0000 (10:23 +0900)]
sh: Set CONFIG_SH_ETHER_PHY_MODE and CONFIG_SH_ETHER_SH7734_MII to boards with sh_eth

The board with sh_eth needs to set CONFIG_SH_ETHER_PHY_MODE.
And SH7734 needs to set value of CONFIG_SH_ETHER_SH7734_MII.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
12 years agosh: Add support for AP-SH4A-4A board
Nobuhiro Iwamatsu [Wed, 9 May 2012 06:59:30 +0000 (15:59 +0900)]
sh: Add support for AP-SH4A-4A board

The AP-SH4A-4A board has SH7734, 64MB DDR2-SDRAM, USB,
Ethernet, and more.

This patch supports the following functions:
  - 64MB DDR2-SDRAM
  - 16MB NOR Flash memory
  - Serial console (SCIF)
  - Ethernet (SH-Ether with Gigabit)
  - I2C

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
12 years agosh: Add register definition of PFC for SH7734
Nobuhiro Iwamatsu [Wed, 9 May 2012 07:00:01 +0000 (16:00 +0900)]
sh: Add register definition of PFC for SH7734

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
12 years agosh: r0p7734: Add support I2C controller
Nobuhiro Iwamatsu [Fri, 2 Mar 2012 03:58:33 +0000 (12:58 +0900)]
sh: r0p7734: Add support I2C controller

This read MAC address from Serial EEPROM and set.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
12 years agosh: Add bit control functions
Nobuhiro Iwamatsu [Wed, 15 Feb 2012 07:47:01 +0000 (16:47 +0900)]
sh: Add bit control functions

This provide bit control functions as clrbits_*, setbits_* and
clrsetbits_*.

V2: Fix comment style and error of whitespace.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Acked-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
12 years agosh: Add support for r0p7734 board
Nobuhiro Iwamatsu [Thu, 12 Jan 2012 02:12:28 +0000 (11:12 +0900)]
sh: Add support for r0p7734 board

The r0p7734 board has SH7734, 128MB DDR2-SDRAM, USB,
Ethernet, and more.

This patch supports the following functions:
- 128MB DDR2-SDRAM
- 32MB NOR Flash memory
- Serial console (SCIF)
- Ethernet (SH-Ether/SMSC)

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
12 years agosh: Add support Renesas SH7734
Nobuhiro Iwamatsu [Wed, 11 Jan 2012 01:45:01 +0000 (10:45 +0900)]
sh: Add support Renesas SH7734

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
12 years agoomap3_dss: cosmetic changes
Jeroen Hofstee [Fri, 18 May 2012 00:51:01 +0000 (00:51 +0000)]
omap3_dss: cosmetic changes

Remove unnecessary brackets.
Unwrap lines which are below 80 chars.
Single line comment as single line (as the rest).
Moved init values to the source code.

cc: s-paulraj@ti.com
cc: khasim@ti.com
Signed-off-by: Jeroen Hofstee <jhofstee@victronenergy.com>
12 years agoomap3_dss: add optional framebuffer
Jeroen Hofstee [Fri, 18 May 2012 00:51:00 +0000 (00:51 +0000)]
omap3_dss: add optional framebuffer

The beagle board uses the background color to show an orange screen during
startup. This patch adds the ability to add a frame buffer, with the
intention not to break the beagle board use case (I don't have one).
videomodes.c is not used. Scrolling depends on this patch:

http://patchwork.ozlabs.org/patch/155662/

cc: trini@ti.com
cc: s-paulraj@ti.com
cc: khasim@ti.com
Signed-off-by: Jeroen Hofstee <jhofstee@victronenergy.com>
12 years agomx53loco: Add LCD support
Fabio Estevam [Thu, 10 May 2012 15:07:35 +0000 (15:07 +0000)]
mx53loco: Add LCD support

Add support for CLAA07LC0ACW LCD that connects to the mx53loco board.

Configure the board to show the Linux logo on the LCD.

Also increase the size of CONFIG_SYS_MALLOC_LEN variable to take into account
the framebuffer usage.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Jason Liu <r64343@freescale.com>
12 years agomx5: Rename mx51_fb_init()
Fabio Estevam [Thu, 10 May 2012 15:07:34 +0000 (15:07 +0000)]
mx5: Rename mx51_fb_init()

The ipuv3 driver is currently only used on mx51, but it can be extended to work
on mx53 and mx6 as well.

Rename mx51_fb_init(), so that it can be used by other SoCs.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Jason Liu <r64343@freescale.com>
12 years agomx53: Allow IPUv3 driver to also work on mx53
Fabio Estevam [Tue, 15 May 2012 08:01:16 +0000 (08:01 +0000)]
mx53: Allow IPUv3 driver to also work on mx53

Adjust the IPU base registers so that ipuv3 driver can work on both mx51 and
mx53 SoCs.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
12 years agomx51evk: Add LCD support
Fabio Estevam [Wed, 9 May 2012 06:39:41 +0000 (06:39 +0000)]
mx51evk: Add LCD support

Add support for CLAA07LC0ACW LCD that connects to the mx51evk board.

Configure the board to show the Linux logo on the LCD.

Also increase the size of CONFIG_SYS_MALLOC_LEN variable to take into account
the framebuffer usage.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Stefano Babic <sbabic@denx.de>
12 years agoEXYNOS: display 32bpp bitmap TIZEN logo
Donghwa Lee [Wed, 9 May 2012 19:23:46 +0000 (19:23 +0000)]
EXYNOS: display 32bpp bitmap TIZEN logo

This patch supports drawing 32bpp bitmap TIZEN logo in exynos fb.
"tizen_hd_logo.h" data is compressed from trats_logo.bmp to
trats_logo.bmp.gz by gzip and converted to tizen_hd_logo.h header file
format by some application. The logo data is decompressed in the exynos
fb driver by bmp_display().

Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
12 years agocreate lib/tizen directory
Donghwa Lee [Thu, 10 May 2012 03:02:55 +0000 (12:02 +0900)]
create lib/tizen directory

This directory includes tizen logo data, common tizen library and so on.

Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Minkyu Kang <mk7.kang@samsung.com>
[ agust: change to conditionally build lib/tizen directory ]
Signed-off-by: Anatolij Gustschin <agust@denx.de>
12 years agoLCD: display 32bpp decompressed bitmap image
Donghwa Lee [Wed, 9 May 2012 19:23:37 +0000 (19:23 +0000)]
LCD: display 32bpp decompressed bitmap image

This patch supports drawing 32bpp decompressed bitmap image.

Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
Signed-off-by: Kyungmin.park <kyungmin.park@samsung.com>
12 years agocommon/lcd.c: reduce one CONFIG_LCD_LOGO ifdef
Anatolij Gustschin [Fri, 27 Apr 2012 04:41:27 +0000 (04:41 +0000)]
common/lcd.c: reduce one CONFIG_LCD_LOGO ifdef

Drop ifdef around bitmap_plot().

Signed-off-by: Anatolij Gustschin <agust@denx.de>
12 years agocommon/lcd.c: reduce some CONFIG_LCD_*_LOGO ifdefs
Anatolij Gustschin [Fri, 27 Apr 2012 04:41:16 +0000 (04:41 +0000)]
common/lcd.c: reduce some CONFIG_LCD_*_LOGO ifdefs

Move CONFIG_LCD_LOGO && !CONFIG_LCD_INFO_BELOW_LOGO ifdefs
to lcd_drawchars() func.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
12 years agocommon/lcd.c: use ARRAY_SIZE
Anatolij Gustschin [Fri, 27 Apr 2012 04:41:06 +0000 (04:41 +0000)]
common/lcd.c: use ARRAY_SIZE

Use available macro for obtaining the size of bmp_logo_palette[]

Signed-off-by: Anatolij Gustschin <agust@denx.de>
12 years agocmd_bmp.c: make bmp_display() usable by drivers or board code
Anatolij Gustschin [Fri, 27 Apr 2012 04:38:06 +0000 (04:38 +0000)]
cmd_bmp.c: make bmp_display() usable by drivers or board code

Currently bmp_display() is static and can not be used directly
in the driver or board code. Export it for other users.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
12 years agoLCD: support another s6e8ax0 panel type
Donghwa Lee [Thu, 26 Apr 2012 18:52:26 +0000 (18:52 +0000)]
LCD: support another s6e8ax0 panel type

s6e8ax0 panel has many panel of types. This patch support another panel
on TIZEN lunchbox board(HWREVISION 2). This panel has reversed panel
display type. So, I had added necessary command.

Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
12 years agoLCD: change s6e8ax0 panel gamma value
Donghwa Lee [Tue, 24 Apr 2012 22:04:39 +0000 (22:04 +0000)]
LCD: change s6e8ax0 panel gamma value

s6e8ax0 panel init gamma value is changed because existing it was not
proper value for this panel.

Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
12 years agoinclude/video.h: drop unused video_printf()
Anatolij Gustschin [Fri, 27 Apr 2012 04:37:57 +0000 (04:37 +0000)]
include/video.h: drop unused video_printf()

There is no such function in the code, so remove this prorotype.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
12 years agonet: sh-eth: Add support Gigabit of SH7734
Nobuhiro Iwamatsu [Tue, 15 May 2012 15:49:39 +0000 (15:49 +0000)]
net: sh-eth: Add support Gigabit of SH7734

SH7734 support GMII. This add register infomation and the function
which enable GMII.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
12 years agonet: sh_eth: Add support SH7734 Ethernet device
Nobuhiro Iwamatsu [Thu, 2 Feb 2012 21:28:49 +0000 (21:28 +0000)]
net: sh_eth: Add support SH7734 Ethernet device

SH7734 has one channel ethernet device.
This support 10/100/1000Base, and RMII/MII/GMII.
And this has the same structure as SH7763.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
12 years agonet: Allow filtering on debug traces in the net subsystem
Joe Hershberger [Wed, 23 May 2012 08:01:04 +0000 (08:01 +0000)]
net: Allow filtering on debug traces in the net subsystem

Add several levels of DEBUG prints so that you can limit the noise to
the severety of your problem.

DEBUG_LL_STATE = Link local state machine changes
DEBUG_DEV_PKT = Packets or info directed to the device
DEBUG_NET_PKT = Packets on info on the network at large
DEBUG_INT_STATE = Internal network state changes

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: Work-around for brain-damaged Cisco equipment with arp-proxy
Joe Hershberger [Wed, 23 May 2012 08:00:13 +0000 (08:00 +0000)]
net: Work-around for brain-damaged Cisco equipment with arp-proxy

Cisco's arp-proxy feature fails to ignore the link-local address range
This means that a link-local device on a network with this Cisco
equipment will reply to ARP requests for our device (in addition to
our reply).
If we happen to reply first, the requester's ARP table will be
populated with our MAC address, and one packet will be sent to us...
shortly following this, the requester will get an ARP reply from the
Cisco equipment telling the requester to send packets their way
instead of to our device from now on.
This work-around detects this link-local condition and will delay
replying to the ARP request for 5ms so that the first packet is sent
to the Cisco equipment and all following packets are sent to our
device.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: Add link-local addressing support
Joe Hershberger [Wed, 23 May 2012 08:00:12 +0000 (08:00 +0000)]
net: Add link-local addressing support

Code based on networking/zcip.c in busybox
commit 8531d76a15890c2c535908ce888b2e2aed35b172

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: Separate ArpRequest() into lower-level func
Joe Hershberger [Wed, 23 May 2012 08:00:11 +0000 (08:00 +0000)]
net: Separate ArpRequest() into lower-level func

Link-local support will need to send ARP packets, but needs more
fine-grained control over the contents.  Split the implementation
into 2 parts so link-local can share the code.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: Don't copy every packet that waits for an ARP
Joe Hershberger [Wed, 23 May 2012 07:59:24 +0000 (07:59 +0000)]
net: Don't copy every packet that waits for an ARP

Use the NetArpTxPacket for the ARP packet, not to hold what used to
be in NetTxPacket.
This saves a copy and makes the code easier to understand.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Make sure NetLoop is initialized when using NetConsole
Joe Hershberger [Wed, 23 May 2012 07:59:23 +0000 (07:59 +0000)]
net: Make sure NetLoop is initialized when using NetConsole

Fix NetConsole bug that causes first packet header to claim a
source IP address of 0.0.0.0

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: Fix net buffer initialization
Joe Hershberger [Wed, 23 May 2012 07:59:22 +0000 (07:59 +0000)]
net: Fix net buffer initialization

A new non-static function net_init() will initialize buffers and
read from the environment.  Only update from the env on each entry
to NetLoop().

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Remove unused parameter from NetInitLoop()
Joe Hershberger [Wed, 23 May 2012 07:59:21 +0000 (07:59 +0000)]
net: Remove unused parameter from NetInitLoop()

Noone uses it.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Remove static allocation for MAC address in PingSend()
Joe Hershberger [Wed, 23 May 2012 07:59:20 +0000 (07:59 +0000)]
net: Remove static allocation for MAC address in PingSend()

Don't force ARP clients to return the MAC address if they don't care
(such as ping)

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
12 years agonet: Add option CONFIG_BOOTP_MAY_FAIL
Joe Hershberger [Wed, 23 May 2012 07:59:19 +0000 (07:59 +0000)]
net: Add option CONFIG_BOOTP_MAY_FAIL

This is useful if you want to look for a DHCP server, but try some
other settings if not available.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Fix unused variable compile warning
Joe Hershberger [Wed, 23 May 2012 07:59:18 +0000 (07:59 +0000)]
net: Fix unused variable compile warning

If CONFIG_BOOTP_SERVERIP is not defined, unused variable warning is
reported.  This was fixed upstream using a compiler feature instead
of a simple reorder of the statements.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
12 years agonet: Don't write the "serverip" env var if configured not to
Joe Hershberger [Wed, 23 May 2012 07:59:17 +0000 (07:59 +0000)]
net: Don't write the "serverip" env var if configured not to

Before this patch, bootp would not overwrite the value, but the
value was still clobbered in the env

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: Add net_update_ether() to handle ARP and Ping replies
Joe Hershberger [Wed, 23 May 2012 07:59:16 +0000 (07:59 +0000)]
net: Add net_update_ether() to handle ARP and Ping replies

When the network is VLAN or SNAP, net_update_ether() will preserve
the original Ethernet packet header and simply replace the src and
dest MACs and the protocol

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Refactor to separate the UDP handler from the ARP handler
Joe Hershberger [Wed, 23 May 2012 07:59:15 +0000 (07:59 +0000)]
net: Refactor to separate the UDP handler from the ARP handler

Call a built-in dummy if none is registered... don't require
protocols to register a handler (eliminating dummies)
NetConsole now uses the ARP handler when waiting on arp
(instead of needing a #define hack in arp.c)
Clear handlers at the end of net loop

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Refactor to protect access to the NetState variable
Joe Hershberger [Wed, 23 May 2012 07:59:14 +0000 (07:59 +0000)]
net: Refactor to protect access to the NetState variable

Changes to NetState now go through an accessor function called
net_set_state()

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
12 years agonet: Refactor to use NetSendPacket instead of eth_send directly
Joe Hershberger [Wed, 23 May 2012 07:59:13 +0000 (07:59 +0000)]
net: Refactor to use NetSendPacket instead of eth_send directly

Use this entry-point consistently across the net/ code
Use a static inline function to preserve code size

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Refactor ping receive handler
Joe Hershberger [Wed, 23 May 2012 07:59:12 +0000 (07:59 +0000)]
net: Refactor ping receive handler

There is no need to call through the handler... inline it

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
12 years agonet: Move debug trace to point of action
Joe Hershberger [Wed, 23 May 2012 07:59:11 +0000 (07:59 +0000)]
net: Move debug trace to point of action

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
12 years agonet: Refactor bootp packet length computations
Joe Hershberger [Wed, 23 May 2012 07:59:10 +0000 (07:59 +0000)]
net: Refactor bootp packet length computations

Eliminate pointer subtraction that recovers values computed earlier

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>