Compare commits

..

109 Commits

Author SHA1 Message Date
Wolfgang Denk
a200a7c04d Update CHANGELOG; prepare Prepare v2009.11
Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-12-15 23:20:54 +01:00
Peter Tyser
f9476902b7 mpc85xx, mpc86xx: Fix gd->cpu pointer after relocation
The gd->cpu pointer is set to an address located in flash when the
probecpu() function is called while U-Boot is executing from flash.
This pointer needs to be updated to point to an address in RAM after
relocation has occurred otherwise Linux may not be able to boot due to
"fdt board" crashing if flash has been erased or changed.

This bug was introduced in commit
a0e2066f39.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Reported-by: Ed Swarthout <Ed.Swarthout@freescale.com>
Tested-by: Kumar Gala <galak@kernel.crashing.org>
Tested on MPC8527DS.
Tested by: Ed Swarthout <Ed.Swarthout@freescale.com>
2009-12-15 22:45:51 +01:00
Peter Tyser
3363a34b9e MVBLUE: Remove CONFIG_CMD_IRQ
Neither the MVBLUE nor its underlying architecture implement the
do_irqinfo() function which is required when CONFIG_CMD_IRQ is defined.
This change fixes the following MVBLUE compiler error:

-> ./MAKEALL MVBLUE
Configuring for MVBLUE board...
common/libcommon.a(cmd_irq.o):(.u_boot_cmd+0x24): undefined reference to `do_irqinfo'
make: *** [u-boot] Error 1

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Acked-by: Andre Schwarz <andre.schwarz@matrix-vision.de>
2009-12-14 21:31:17 +01:00
Detlev Zundel
18e8ad60ee imx27lite: Reenable MTD support on NOR flash.
The support for this was silently dropped by a configuration
split during the merge of the imx27lite board support in commit
864aa034f3 (cmd_mtdparts: Move to common
handling of FLASH devices via MTD layer).

Signed-off-by: Detlev Zundel <dzu@denx.de>
2009-12-14 21:30:11 +01:00
Stefan Roese
f4cfe42758 nand: Fix access to last block in NAND devices
Currently, the last block of NAND devices can't be accessed. This patch
fixes this issue by correcting the boundary checking (off-by-one error).

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Wolfgang Denk <wd@denx.de>
2009-12-11 13:11:57 -06:00
Peter Korsgaard
3b887ca8ce mpc83xx: boot time regression, move LCRR setup back to cpu_init_f
Commit c7190f02 (retain POR values of non-configured ACR, SPCR, SCCR,
and LCRR bitfields) moved the LCRR assignment to after relocation
to RAM because of the potential problem with changing the local bus
clock while executing from flash.

This change unfortunately adversely affects the boot time, as running
all code up to cpu_init_r can cause significant slowdown.

E.G. on a 8347 board a bootup time increase of ~600ms has been observed:

   0.020 CPU:   e300c1, MPC8347_PBGA_EA, Rev: 3.0 at 400 MHz, CSB: 266.667 MHz
   0.168 RS:    232
   0.172 I2C:   ready
   0.176 DRAM:  64 MB
   1.236 FLASH: 32 MB

Versus:

   0.016 CPU:   e300c1, MPC8347_PBGA_EA, Rev: 3.0 at 400 MHz, CSB: 266.667 MHz
   0.092 RS:    232
   0.092 I2C:   ready
   0.096 DRAM:  64 MB
   0.644 FLASH: 32 MB

So far no boards have needed the late LCRR setup, so simply revert it
for now - If it is needed at a later time, those boards can either do
their own final LCRR setup in board code (E.G. in board_early_init_r),
or we can introduce a CONFIG_SYS_LCRR_LATE config option to only do
the setup in cpu_init_r.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
2009-12-09 11:40:52 -06:00
Michal Simek
386118a896 microblaze: Correct ffs regression for Microblaze
We are using generic implementation of ffs. This should
be part of Simon's commit 0413cfecea

Here is warning message which this patch removes.

In file included from /tmp/u-boot-microblaze/include/common.h:38,
                 from cmd_mtdparts.c:87:
/tmp/u-boot-microblaze/include/linux/bitops.h:123:1: warning: "ffs" redefined
In file included from /tmp/u-boot-microblaze/include/linux/bitops.h:110,
                 from /tmp/u-boot-microblaze/include/common.h:38,
                 from cmd_mtdparts.c:87:
/tmp/u-boot-microblaze/include/asm/bitops.h:269:1:
warning: this is the location of the previous definition

Signed-off-by: Michal Simek <monstr@monstr.eu>
2009-12-08 09:19:01 +01:00
Graeme Smecher
8fe7b29f98 microblaze: Stop stack clobbering in microblaze-generic.
A typo caused the stack and malloc regions to overlap, which prevented
mem_malloc_init() from returning. This commit makes the memory layout match
the example described in include/configs/microblaze-generic.h

Signed-off-by: Graeme Smecher <graeme.smecher@mail.mcgill.ca>
Signed-off-by: Michal Simek <monstr@monstr.eu>
2009-12-08 08:51:42 +01:00
Wolfgang Denk
0fc52948bd Update CHANGELOG, prepare -rc2
Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-12-07 23:14:13 +01:00
Peter Tyser
f2352877cb MAKEALL: Fix return value
Previously MAKEALL would always return a value of 0, even if 1 or more
boards did not compile.  This change causes MAKEALL to return 0 if all
boards were able to build, otherwise 1.

This change also requires changing the script interpreter from sh to
bash to support bash's PIPESTATUS variable.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-12-07 23:06:42 +01:00
Peter Tyser
fbc1c8f6f6 tools/mkimage: Remove duplicate line of code
Recent commits 1a99de2cb4 and
6a590c5f5f both fixed the same bug in the
same manner.  Unfortunately git was "smart" enough to merge both changes
which resulted in some duplicate code.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>

Reordered code and comment a bit.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-12-07 23:01:42 +01:00
Heiko Schocher
df002fa6b9 i2c: fix dangling comment in do_i2c_mw()
commit bd3784df94 deleted some unused
code in do_i2c_mw(), but missed to also remove the respective
commment. This patch fixes this.

Signed-off-by: Heiko Schocher <hs@denx.de>
2009-12-07 22:58:46 +01:00
Heiko Schocher
f8450829f9 52xx, manroland: add fdt_fixup_memory() in ft_board_setup()
To update the real memory size in the memory node on the
uc101 and mucmc52 boards call fdt_fixup_memory() in
ft_board_setup().

Signed-off-by: Heiko Schocher <hs@denx.de>
2009-12-07 22:39:38 +01:00
Daniel Hobi
0ec81db202 Fix computation in nand_util.c:get_len_incl_bad
Depending on offset, flash size and the number of bad blocks,
get_len_incl_bad may return a too small value which may lead to:

1) If there are no bad blocks, nand_{read,write}_skip_bad chooses the
bad block aware read/write code. This may hurt performance, but does
not have any adverse effects.

2) If there are bad blocks, the nand_{read,write}_skip_bad may choose
the bad block unaware read/write code (if len_incl_bad == *length)
which leads to corrupted data.

Signed-off-by: Daniel Hobi <daniel.hobi@schmid-telecom.ch>
2009-12-07 22:38:16 +01:00
Evan Samanas
aabb8cb081 nfs: NfsTimeout() updates
- NfsTimeout() does not correctly update the NFS timeout value which
  results in NfsTimeout() only being called once in certain situations.
  This can result in the 'nfs' command hanging indefinetly.  For
  example, the command:

    nfs 192.168.0.1:/home/user/file

  will not exit until ctrl-c is pressed if 192.168.0.1 does not have an
  NFS server running.

  This issue is resolved by reinitializting the NFS timeout value inside
  NfsTimeout() when a timeout occurs.

- Make the 'nfs' command print the 'T' character when a timeout occurs.
  Previously there was no indication that timeouts were occuring.

- Mimic the 'tftpboot' command and when a download fails print "Retry
  count exceeded; starting again", and restart the download taking the
  'netretry' environment variable into account.

Signed-off-by: Evan Samanas <esamanas@xes-inc.com>
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>

Tested on TQM8xxL.

Tested by: Wolfgang Denk <wd@denx.de>

Tested on MPC8527DS.

Tested by: Ed Swarthout <Ed.Swarthout@freescale.com>
2009-12-07 22:35:47 +01:00
Peter Tyser
224c90d106 bootm: Fix help message's sub-command ordering
The help message for the 'bootm' command listed the 'cmdline' and 'bdt'
sub-commands in the wrong order which resulted in the error below when
following the 'help' command's instructions:

  "Trying to execute a command out of order"

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-12-07 22:12:49 +01:00
Robert P. J. Day
a93c92cdda help: Correct syntax of nandecc help output.
"nandecc" help output should not reproduce the command name, nor have
a trailing newline.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
2009-12-07 22:06:51 +01:00
Mike Rapoport
c2fff331a3 smc911x: update SMC911X related configuration description
Since commit 736fead8fd "Convert SMC911X
Ethernet driver to CONFIG_NET_MULTI API" SMC911X configration options
are called CONFIG_SMC911X rather than CONFIG_DRIVER_SMC911X. Update
README to reflect that change.

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
2009-12-07 22:05:43 +01:00
Mike Rapoport
45b6b65c6b smc911x: fix typo in smc911x_handle_mac_address name
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
2009-12-07 22:04:02 +01:00
Ed Swarthout
f64ef9bb99 fix nfs symlink name corruption
An off by one error may cause nfs readlink lookup fail if
nfs_path_buff has non-zero data from a previous use.

Loading: *** ERROR: File lookup fail

Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
2009-12-07 21:50:19 +01:00
Wolfgang Denk
e8fac25e83 at91sam9261ek.c: fix minor coding style issue.
Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-12-07 21:50:19 +01:00
Wolfgang Denk
4713010adf trab: fix warning: implicit declaration of function 'disable_vfd'
Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-12-07 21:50:18 +01:00
Wolfgang Denk
a9f99ab44b zlib.c: avoid build conflicts for cradle board
Commit dce3d79710 updated the zlib code to v0.95; this caused
conflicts when building for the "cradle" board, because the (pretty
generic) preprocessor variable "OFF" was used in multiple files.
Make sure to avoid further conflicts by #undef'ing it in zlib.c
before redefining it.

Signed-off-by: Wolfgang Denk <wd@denx.de>
cc: Giuseppe Condorelli <giuseppe.condorelli@st.com>
cc: Angelo Castello <angelo.castello@st.com>
cc: Alessandro Rubini <rubini-list@gnudd.com>
2009-12-07 21:50:18 +01:00
Wolfgang Denk
8cbf4e4f17 Fix out-of-tree building of "apollon" board.
Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-12-06 00:27:06 +01:00
Mike Frysinger
f68ab43de6 lzma: ignore unset filesizes
The Linux kernel build system changed how it compresses things with LZMA
such that the header no longer contains the filesize (it is instead set to
all F's).  So if we get a LZMA image that has -1 for the 64bit field,
let's just assume that the decompressed size is unknown and continue on.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-05 01:49:52 +01:00
Detlev Zundel
cccfc2ab77 README: Rearrange paragraphs to regain linear arrangement.
Two later additions to the Configuration Option section unfortunately
split the description of Show boot progress and the list of its call outs.

Signed-off-by: Detlev Zundel <dzu@denx.de>
2009-12-05 01:47:45 +01:00
Peter Tyser
c81296c16f tools/mkimage: Print FIT image contents after creation
Previously, there was no indication to the user that a FIT image was
successfully created after executing mkimage.  For example:

  $ mkimage -f uImage.its uImage.itb
  DTC: dts->dtb  on file "uImage.its"

Adding some additional output after creating a FIT image lets the user
know exactly what is contained in their image, eg:

  $ mkimage -f uImage.its uImage.itb
  DTC: dts->dtb  on file "uImage.its"
  FIT description: Linux kernel 2.6.32-rc7-00201-g7550d6f-dirty
  Created:         Tue Nov 24 15:43:01 2009
   Image 0 (kernel@1)
    Description:  Linux Kernel 2.6.32-rc7-00201-g7550d6f-dirty
    Type:         Kernel Image
    Compression:  gzip compressed
    Data Size:    2707311 Bytes = 2643.86 kB = 2.58 MB
    Architecture: PowerPC
    OS:           Linux
    Load Address: 0x00000000
    Entry Point:  0x00000000
    Hash algo:    crc32
    Hash value:   efe0798b
    Hash algo:    sha1
    Hash value:   ecafba8c95684f2c8fec67e33c41ec88df1534d7
   Image 1 (fdt@1)
    Description:  Flattened Device Tree blob
    Type:         Flat Device Tree
    Compression:  uncompressed
    Data Size:    12288 Bytes = 12.00 kB = 0.01 MB
    Architecture: PowerPC
    Hash algo:    crc32
    Hash value:   a5cab676
    Hash algo:    sha1
    Hash value:   168722b13e305283cfd6603dfe8248cc329adea6
   Default Configuration: 'config@1'
   Configuration 0 (config@1)
    Description:  Default Linux kernel
    Kernel:       kernel@1
    FDT:          fdt@1

This brings the behavior of creating a FIT image in line with creating a
standard uImage, which also prints out the uImage contents after
creation.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-12-05 01:13:51 +01:00
Peter Tyser
8e1c89663c tools/fit_image.c: Remove unused fit_set_header()
The FIT fit_set_header() function was copied from the standard uImage's
image_set_header() function during mkimage reorganization.  However, the
fit_set_header() function is not used since FIT images use a standard
device tree blob header.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-12-05 01:12:45 +01:00
Peter Tyser
1a99de2cb4 tools/mkimage: Assume FDT image type for FIT images
When building a Flattened Image Tree (FIT) the image type needs to be
"flat_dt".  Commit 89a4d6b12f introduced a
regression which caused the user to need to specify the "-T flat_dt"
parameter on the command line when building a FIT image.  The "-T
flat_dt" parameter should not be needed and is at odds with the current
FIT image documentation.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-12-05 01:12:39 +01:00
Michael Brandt
270737acca EXT2FS: fix inode size for ext2fs rev#0
extfs.c assumes that there is always a valid inode_size field in the
superblock. But this is not true for ext2fs rev 0. Such ext2fs images
are for instance generated by genext2fs. Symptoms on ARM machines are
messages like: "raise: Signal # 8 caught"; on PowerPC "ext2ls" will
print nothing.
This fix checks for rev 0 and uses then 128 bytes as inode size.

Signed-off-by: Michael Brandt <Michael.Brandt@emsyso.de>
Tested on: TQM5200S
Tested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-12-05 00:46:10 +01:00
Robert P. J. Day
bcb324d68f Remove superfluous preprocessor tests from some cmd_*.c files.
A small number of common/cmd_*.c files contain preprocessor tests that
are apparently superfluous since those same tests are used in the
Makefile to control the compilation of those files.  Those tests are
clearly redundant as long as they surround the entirety of the source
in those files.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
2009-12-02 23:46:45 +01:00
Robert P. J. Day
ad53226156 README: Update the list of directories.
Bring the directory listing more into line with current content.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
2009-12-02 23:37:14 +01:00
Pratap Chandu
bd3784df94 Removes dead code in the file common/cmd_i2c.c
There is some dead code enclosed by #if 0 .... #endif in the file
common/cmd_i2c.c
This patch removes the dead code.

Signed-off-by: Pratap Chandu <pratap.rrke@gmail.com>
2009-12-02 23:35:24 +01:00
Mike Frysinger
64a480601a smc91111_eeprom: drop CONFIG stub protection
Since the Makefile now controls the compilation of this, there is no need
for CONFIG checking nor the stub function.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-12-02 23:33:01 +01:00
Magnus Lilja
f3a7bddc06 RTC: Fix return code in MC13783 RTC driver.
Signed-off-by: Magnus Lilja <lilja.magnus@gmail.com>
2009-12-02 23:29:18 +01:00
Magnus Lilja
d52e3e0176 cmd_date: Fix spelling in error message.
Signed-off-by: Magnus Lilja <lilja.magnus@gmail.com>
2009-12-02 23:28:10 +01:00
Peter Tyser
c253122395 Move do_irqinfo() to common/cmd_irq.c
cmd_irq.c is a much better home and it is already conditionally
compiled based on CONFIG_CMD_IRQ.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-12-02 23:23:20 +01:00
Peter Tyser
a5dd4dc64f cmd_license: Remove unneeded #ifdef CONFIG_CMD_LICENSE
cmd_license is already conditionally compiled at the Makefile-level.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-12-02 23:22:26 +01:00
Peter Tyser
06015146a1 m41t11: Remove unused functions
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-12-02 23:21:02 +01:00
Peter Tyser
9ef78511cd circbuf: Move to lib_generic and conditionally compile
circbuf could be used as a generic library and is only currently
needed when CONFIG_USB_TTY is defined.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-12-02 23:19:32 +01:00
Sanjeev Premi
604f7ce55a Fix build failure in examples/standalone
Some versions of 'make' do not handle trailing white-spaces
properly. Trailing spaces in ELF causes a 'fake' source to
be added to the variable COBJS; leading to build failure
(listed below). The problem was found with GNU Make 3.80.

Using text-function 'strip' as a workaround for the problem.

make[1]: Entering directory `/home/sanjeev/u-boot/examples/standalone'
arm-none-linux-gnueabi-gcc -g  -Os   -fno-common -ffixed-r8 -msoft-float
-D__KERNEL__ -DTEXT_BASE=0x80e80000 -I/home/sanjeev/u-boot/include
-fno-builtin -ffreestanding -nostdinc -isystem /opt/codesourcery/2009q1-
203/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/include -pipe  -DCONFIG_
ARM -D__ARM__ -marm  -mabi=aapcs-linux -mno-thumb-interwork -march=armv5
-Wall -Wstrict-prototypes -fno-stack-protector -g  -Os   -fno-common -ff
ixed-r8 -msoft-float   -D__KERNEL__ -DTEXT_BASE=0x80e80000 -I/home/sanje
ev/u-boot/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/co
desourcery/2009q1-203/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/includ
e -pipe  -DCONFIG_ARM -D__ARM__ -marm  -mabi=aapcs-linux -mno-thumb-inte
rwork -march=armv5 -I.. -Bstatic -T u-boot.lds  -Ttext 0x80e80000 -o .c
arm-none-linux-gnueabi-gcc: no input files
make[1]: *** [.c] Error 1
make[1]: Leaving directory `/home/sanjeev/u-boot/examples/standalone'
make: *** [examples/standalone] Error 2
premi #

Signed-off-by: Sanjeev Premi <premi@ti.com>

Fixed typo (s/ElF/ELF/).
Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-12-02 23:17:26 +01:00
Becky Bruce
af860962b5 85xx: Remove unused CONFIG_ASSUME_AMD_FLASH from config files
A bunch of the 85xx boards have this cruft in them - it's not used
anywhere.  Delete it.

Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
2009-12-02 22:57:16 +01:00
Wolfgang Denk
deec1fbd4f MAINTAINERS: update responsible for MPC85xx/86xx
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Becky Bruce <beckyb@kernel.crashing.org>
2009-12-02 22:27:26 +01:00
Wolfgang Denk
21c76b56a4 Merge branch 'master' of git://git.denx.de/u-boot-nios 2009-12-01 10:15:22 +01:00
Ira W. Snyder
824d82997f Fix example FIT image source files
The example FIT image source files do not compile with the latest dtc and
mkimage. The following error message is produced:

DTC: dts->dtb  on file "kernel.its"
Error: kernel.its 7:0 - 1:0 syntax error
FATAL ERROR: Unable to parse input tree
./mkimage: Can't read kernel.itb.tmp: Invalid argument

The FIT image source files are missing the "/dts-v1/;" directive at the
beginning of the file. Add the directive to the examples.

Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
2009-11-24 23:44:16 +01:00
Mike Frysinger
fd66066ee3 img2srec: use standard types
The img2srec code creates a lot of typedefs with common names.  These
easily clash with system headers that include these typedefs (like mingw).

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-11-24 23:43:18 +01:00
Mike Frysinger
8204e06811 tools: gitignore *.exe binaries
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-11-24 23:42:15 +01:00
Peter Tyser
425d3b666e ppc: Move conditional compilation of kgdb.c to Makefile
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-11-24 23:41:11 +01:00
Mike Frysinger
e06ab6546b spi_flash.h: pull in linux/types.h for u## types 2009-11-24 23:40:39 +01:00
Mike Frysinger
0008555f4d bootm: mark local boot_os[] table static
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-11-24 23:40:03 +01:00
Nishanth Menon
a8fa379d47 mkconfig: deny messed up ARCH definition
Refuse to setup a platform if the command line ARCH= is not the same
as the one required for the board. This prevents any user with
prehistoric aliases from messing up their builds.

Reported in thread:
http://old.nabble.com/-U-Boot--Build-breaks-on-some-OMAP3-configs-to26132721.html

Inputs from: Mike Frysinger and Wolfgang Denk:
http://lists.denx.de/pipermail/u-boot/2009-November/063642.html

Cc: Wolfgang Denk <wd@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Anand Gadiyar <gadiyar@ti.com>
Cc: Dirk Behme <dirk.behme@googlemail.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
2009-11-24 23:37:00 +01:00
Wolfgang Denk
5a1b1f36da Merge branch 'master' of git://git.denx.de/u-boot-net 2009-11-24 23:27:06 +01:00
Wolfgang Denk
7c32dc5bed Merge branch 'master-sync' of git://git.denx.de/u-boot-arm 2009-11-24 23:22:50 +01:00
Remy Bohmer
67b96e87da Repair the 'netretry=once' option.
'netretry = once' does the same as 'netretry = yes', because it is not stored
when it was tried once.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2009-11-24 14:04:11 -08:00
Remy Bohmer
b25e38fc36 Repair build fail in case CONFIG_PPC=n and CONFIG_FIT=y
Signed-off-by: Remy Bohmer <linux@bohmer.net>
2009-11-24 22:40:20 +01:00
Grazvydas Ignotas
01826abc02 OMAP3: pandora: fix booting without serial attached
When the board is booted without serial cable attached (which
is how most of them will be used) UART RX is left floating and
sometimes picks noise, which interrupts countdown and enters
U-Boot prompt instead of booting the kernel.

Fix this by setting up internal pullup on UART RX pin. This
does not prevent serial from working as the internal pullup
is weak.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
2009-11-24 09:04:46 -06:00
Remy Bohmer
41dfd8a603 Add support for CS2 dataflash for Atmel-SPI.
The only missing chipselect line support is CS2, and I need it on
CS2...

Signed-off-by: Remy Bohmer <linux@bohmer.net>
2009-11-23 23:43:37 +01:00
Remy Bohmer
faf36c1437 Fix mingw tools build
mkimage does not build due to missing strtok_r() and getline() implementation

Signed-off-by: Remy Bohmer <linux@bohmer.net>
2009-11-23 23:43:35 +01:00
Remy Bohmer
6a590c5f5f Building of FIT images does not work.
The type is not set for generation of the FIT images, resulting
in no images being created without printing or returning an error

Signed-off-by: Remy Bohmer <linux@bohmer.net>
2009-11-23 23:42:48 +01:00
Renato Andreola
0a7691e820 Nios2: do_boom_linux(): kernel gunzip input data integrity problem due to
missing cache flush.

    Added instruction and data caches flush.

Signed-off-by: Scott McNutt <smcnutt@psyent.com>
2009-11-23 16:45:14 -05:00
Scott McNutt
de03825386 Nios2: Fix compiler warnings in lib_nios2/board.c (unused variables)
Signed-off-by: Scott McNutt <smcnutt@psyent.com>
2009-11-23 16:29:40 -05:00
Scott McNutt
57baa379cf Nios2/Nios: Remove unnecessary (residual) linker Nios command scripts from
the standalone examples.

Signed-off-by: Scott McNutt <smcnutt@psyent.com>
2009-11-23 15:54:25 -05:00
Mike Frysinger
fcffb680e7 sf: fix stmicro offset setup while erasing
Reported-by: Peter Gombos <gombos@protecta.hu>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-11-22 23:56:36 +01:00
Jason McMullan
d394a77950 sf: new driver for Winbond W25X16/32/64 devices
Signed-off-by: Jason McMullan <jason.mcmullan@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-11-22 23:54:18 +01:00
Marcel Ziswiler
cada315100 mpc8260: move FDT memory node fixup into common CPU code.
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@noser.com>
Tested-by: Heiko Schocher <hs@denx.de>
2009-11-22 23:16:28 +01:00
Po-Yu Chuang
f2cea405f8 Add driver for FTRTC010 real time clock
Signed-off-by: Po-Yu Chuang <ratbert@faraday-tech.com>

Edited commit message.
Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-11-22 22:26:35 +01:00
Mark Jackson
c0356a8801 MIMC200: set default fbmem value
This patch adds a default bootargs "fbmem" value to the
CONFIG_BOOTARGS string for the MIMC200 board.

Signed-off-by: Mark Jackson <mpfj@mimc.co.uk>
2009-11-22 22:07:17 +01:00
Matthias Fuchs
3ffc0d61ba ppc4xx: Initialize magnetic coupler on VOM405 boards
This patch fixes an ugly behavior of the IL712 magnetic coupler
as used on VOM405. These parts will remember their last state
over a power cycle which might cause unwanted behavior.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>
Signed-off-by: Stefan Roese <sr@denx.de>
2009-11-17 13:36:35 +01:00
Matthias Fuchs
be0db3e314 ppc4xx: Initialize magnetic couplers in PLU405
This patch fixes an ugly behavior of the IL712 magnetic couplers
as used on PLU405. These parts will remember their last state
over a power cycle which might cause unwanted behavior.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>
Signed-off-by: Stefan Roese <sr@denx.de>
2009-11-17 13:25:30 +01:00
Matthias Fuchs
067f54c66a Add minimal SJA1000 header for basic CAN mode
This patch is in preparation for the upcoming PLU405 board fix.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>
Signed-off-by: Stefan Roese <sr@denx.de>
2009-11-17 13:19:58 +01:00
Wolfgang Denk
3c014f1586 Merge branch 'master' of git://git.denx.de/u-boot-net 2009-11-15 22:50:52 +01:00
Wolfgang Denk
7b18e8c90c Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx 2009-11-15 22:48:02 +01:00
Wolfgang Denk
b55edd97ce Merge branch 'master-sync' of git://git.denx.de/u-boot-arm 2009-11-15 22:27:16 +01:00
Kumar Gala
cdbdbe65f5 ppc/85xx: Fix how we determine the number of CAM entries
We were incorrectly use the max CAM size as the number of entries in
the array for setting up the addrmap.  We should be using the NENTRY
field which is the low 12-bits of TLB1CFG.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2009-11-13 09:11:01 -06:00
Mike Rapoport
fbd47b6753 smc911x: make smc911x_initialize return correct value
Make smc911x_initialize return -1 on error and number of interfaces
detected otherwise.

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2009-11-12 21:25:57 -08:00
Mike Frysinger
c44efcf97b smc911x_eeprom: fix building after smc911x overhaul
When the smc911x driver was converted to NET_MULTI, the smc911x eeprom was
missed.  The config option needed updating as well as overhauling of the
rergister read/write functions.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Tested-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2009-11-12 21:25:56 -08:00
Dave Liu
3ad95deb30 fsl-ddr: Fix the chip-select interleaving issue
commit 1542fbdeec
introduced one new bug to chip-select interleaving.

Single DDR controller also can do the chip-select
interleaving if there is dual-rank or qual-rank DIMMs.

Signed-off-by: Dave Liu <daveliu@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2009-11-12 08:09:49 -06:00
Wolfgang Denk
4f127980e0 Merge branch 'master' of git://git.denx.de/u-boot-net 2009-11-11 23:10:34 +01:00
Wolfgang Denk
a9e9d69dd8 Merge branch 'master' of git://git.denx.de/u-boot-ppc4xx 2009-11-11 22:58:30 +01:00
javier Martin
651ef90fa6 mxc_fec: avoid free() calls to already freed pointers.
Sometimes, inside NetLoop, eth_halt() is called before eth_init() has
been called. This is harmless except for free() calls to pointers
which have not been allocated yet.

This patch initializes those pointers to NULL and allocates them only
the first time. This way we can get rid of free calls in halt callback.

This has been tested in i.MX27 Litekit board and eldk-4.2 toolchains.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2009-11-11 13:27:09 -08:00
javier Martin
e8f1546a88 mxc_fec: fix some erroneous PHY accesses.
This patch fixes erroneous access to the ethernet PHY which broke the driver.
1. Selector field in the auto-negotiation register must be 0x00001 for
using 802.3, not 0x00000 which is reseved.
2. Access to the PHY address specified by CONFIG_FEC_MXC_PHYADDR, not
0x0 fixed address.

This has been tested in i.MX27 Litekit board and eldk-4.2 toolchains.

Now using proper defines for auto-negotiation register.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2009-11-11 13:27:09 -08:00
Ron Lee
f865fcbbb3 ARM Don't inline weak symbols
------------------------------------------------------------------------

GCC 4.4 complains about this now.

Signed-off-by: Ron Lee <ron@debian.org>
2009-11-11 08:41:01 -06:00
Ben Warren
d14c7ec2b5 Fix SMC91111 regression: lpd7a40x build failures
Both lpd7a400 and lpd7a404 failed to compile because they had
CONFIG_SMC_USE_IOFUNCS defined:

examples/standalone/smc91111_eeprom.c:388: undefined reference to `SMC_outw'

Also removed an orphaned paren in lpd7a404.h

Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2009-11-09 21:56:18 -08:00
Ben Warren
1031ae960c SMC91111: Clean up SMC_inx macros on xsengine and xaeniax
This patch fixes the following warnings:

Configuring for xaeniax board...
smc91111_eeprom.c: In function 'print_macaddr':
smc91111_eeprom.c:278: warning: suggest parentheses around + or - in operand of &
smc91111_eeprom.c:281: warning: suggest parentheses around + or - in operand of &
...
Configuring for xsengine board...
smc91111_eeprom.c: In function 'print_macaddr':
smc91111_eeprom.c:278: warning: suggest parentheses around + or - inside shift
smc91111_eeprom.c:281: warning: suggest parentheses around + or - inside shift

Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2009-11-09 21:55:09 -08:00
Wolfgang Denk
0f365273a6 Merge branch 'master-sync' of git://git.denx.de/u-boot-arm 2009-11-09 22:46:32 +01:00
Ben Warren
830c7b6722 Fix CS8900 regression on impa7 board
The following error was seen on impa7 board, due to its use of a 32-bit bus
on CS8900.
cs8900.c:137:37: error: macro "get_reg_init_bus" passed 2 arguments, but takes just 1

This patch gives the macro the correct number of arguments

Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2009-11-09 11:43:18 -08:00
Mike Frysinger
e5c5d9e083 clarify eth driver halt/recv steps
The dev->halt() func can be called at any time, and the dev->recv() func
does not need to use NetRxPackets[] when calling NetReceive().

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2009-11-09 10:40:39 -08:00
Hui.Tang
497ab0eec5 Fix cs8900 dev->priv not init issue
Ensure all CS8900 data structures are assigned before accessing device

Signed-off-by: Hui.Tang <zetalabs@gmail.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2009-11-09 10:39:36 -08:00
Stefan Roese
4fe5193d46 ppc4xx: 44x_spd_ddr2.c: Fix register macro ECCCR -> ECCES (SDRAM_ECCES)
This error only appears when DEBUG is enabled in this driver. That's why
it went unnoticed till now.

Signed-off-by: Stefan Roese <sr@denx.de>
2009-11-09 13:31:38 +01:00
Stefan Roese
916ed9444d ppc4xx: Canyonlands: Change EBC bus config to drive always (no high-z)
This patch fixes a problem only seen very occasionally on Canyonlands.
The NOR flash interface (CFI driver) doesn't work reliably in all cases.
Erasing and/or programming sometimes doesn't work. Sometimes with
an error message, like "flash not erased" when trying to program an
area that should have just been erased. And sometimes without any error
messages. As mentioned above, this problem was only seen rarely and with
some PLL configuration (CPU speed, EBC speed).

Now I spotted this problem a few times, when running my Canyonlands with
the following setup (chip_config):

1000-nor         - NOR  CPU:1000 PLB: 200 OPB: 100 EBC: 100

Changing the EBC configuration to not release the bus into high
impedance state inbetween the transfers (ATC, DTC and CTC bits set to 1
in EBC0_CFG) seems to fix this problem. I haven't seen any failure
anymore with this patch applied.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: David Mitchell <dmitchell@amcc.com>
Cc: Jeff Mann <MannJ@embeddedplanet.com>
2009-11-09 13:30:19 +01:00
Remy Bohmer
25793f76bf ARM: Use Linux version for unaligned access code
The asm-arm/unaligned.h includes linux/unaligned/access_ok.h
This file is unsafe to be used on ARM, since it does an unaligned memory
accesses which fails on ARM.

Lookin at Linux the basic difference seems to be the header
"include/asm-arm/unaligned.h". The Linux version of "unaligned.h"
does *not* include "access_ok.h" at all. It includes "le_byteshift.h"
and "be_byteshift.h" instead.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
Signed-off-by: Stefan Roese <sr@denx.de>
--
 include/asm-arm/unaligned.h            |    3 -
 include/linux/unaligned/be_byteshift.h |   70 +++++++++++++++++++++++++++++++++
 include/linux/unaligned/le_byteshift.h |   70 +++++++++++++++++++++++++++++++++
 3 files changed, 142 insertions(+), 1 deletion(-)
 create mode 100644 include/linux/unaligned/be_byteshift.h
 create mode 100644 include/linux/unaligned/le_byteshift.h
2009-11-07 15:56:30 -06:00
Kumar Gala
6d6e7c53d5 ppc/85xx: Fix inclusion of 83xx immap in 85xx builds
The nand_boot_fsl_elbc.c is shared between 83xx & 85xx however we should
not be including the immap_83xx.h when building 85xx.  We can just get
this all from common.h

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2009-11-04 21:39:07 -06:00
Becky Bruce
107b579c75 86xx: Remove redundant code in initdram
The same code exists both inside an #ifdef and outside of it.
Remove the extra code for all the 86xx boards.

Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2009-11-04 21:37:12 -06:00
Ed Swarthout
715d8f7608 fsl_pci_init_port end-point initialization is broken
commit 70ed869e broke fsl pcie end-point initialization.
Returning 0 is not correct.  The function must return the first free
bus number for the next controller.

fsl_pci_init() must still be called and a bus allocated even if the
controller is an end-point.

Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
Acked-by: Vivek Mahajan <vivek.mahajan@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2009-11-04 09:16:30 -06:00
Kumar Gala
01471d538f Revert "ppc/85xx/pci: fsl_pci_init: pcie agent mode support"
This reverts commit 70ed869ea5.

There isn't any need to modify the API for fsl_pci_init_port to pass the
status of host/agent(end-point) status.  We can determine that
internally to fsl_pci_init_port.  Revert the patch that makes the API
change.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2009-11-04 09:14:59 -06:00
Dave Liu
ff88229549 ppc/85xx: Fix misc L2 cache enabling bug
We need loop-check the flash clear lock and enable bit for L2 cache.

Signed-off-by: Dave Liu <daveliu@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2009-10-31 10:59:52 -05:00
Wolfgang Denk
b91b8f74fe Merge branch 'master' of /home/wd/git/u-boot/custodians 2009-10-31 16:03:08 +01:00
Nobuhiro Iwamatsu
59434fe243 sh: Update lowlevel_init.S of espt-giga
There was the point that did not use write macro.
Change to write macro.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2009-10-30 10:20:16 +09:00
Nobuhiro Iwamatsu
f1cae1969d sh: Move some defs to convince 'pcrel too far'
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Takashi Yoshii <yoshii.takashi@gmail.com>
2009-10-30 10:02:00 +09:00
Nobuhiro Iwamatsu
0f9eaf4b32 sh: Remove malloc_bin_reloc from lib_sh, lib_nios2 and lib_nios.
By "arm/microblaze/nios/nios2/sh: Remove relocation fixups"
(commit: 0630535e2d062dd73c1ceca5c6125c86d1127a49", doesn't need
malloc_bin_reloc function. This commit remove this.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2009-10-30 08:41:15 +09:00
Ben Warren
0775437293 Fix DM9000 MAC address handling
Proper behavior is to pull MAC address from NVRAM in the initialization() an
stuff it in dev->address, then program the device from dev->address in
the init() function.

Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2009-10-29 10:06:34 -07:00
Wolfgang Denk
98d92d8c9f sbc8349: fix incorrect comment
The comment for the BR0_PRELIM port size initialization incorrectly
stated 32 bit, while it's actually 16 bit. The code is correct.

Reported-by: Guenter Koellner <guenter.koellner@nsn.com>
Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-10-28 22:07:56 +01:00
Wolfgang Denk
f2b4bc04d6 Merge branch 'master' of git://git.denx.de/u-boot-cfi-flash 2009-10-28 21:50:09 +01:00
Wolfgang Denk
d187fcaaa2 Merge branch 'master' of git://git.denx.de/u-boot-sparc 2009-10-28 21:48:40 +01:00
Sandeep Paulraj
a38f85e180 Fix Compliation warning for TNY-A9260 and TNY-A9G20
The patch fixes a compilation warning by defining
CONFIG_SYS_64BIT_VSPRINTF in the config file

Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2009-10-28 21:47:08 +01:00
Sandeep Paulraj
264e42ee54 Fix Compliation warning for SBC35-A9G20 board
The patch fixes a compilation warning by defining
CONFIG_SYS_64BIT_VSPRINTF in the config file

Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2009-10-28 21:47:07 +01:00
Eric Millbrandt
353462f6ff galaxy5200: Add default environment variables
Extend bootdelay to 10 seconds.  Set boot retry time to 120 seconds and use
reset to retry.  Define default bootcommand and bootargs for production.

Signed-off-by: Eric Millbrandt <emillbrandt@dekaresearch.com>
2009-10-28 21:46:21 +01:00
Stefan Roese
fa36ae790e cfi: Add weak default function for flash_cmd_reset()
Currently the CFI driver issues both AMD and Intel reset commands.
This is because the driver doesn't know yet which chips are connected.
This dual reset seems to cause problems with the M29W128G chips as
reported by Richard Retanubun. This patch now introduces a weak default
function for the CFI reset command, still with both resets. This can
be overridden by a board specific version if necessary.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Richard Retanubun <RichardRetanubun@ruggedcom.com>
2009-10-28 11:34:14 +01:00
Sergey Mironov
2c0c58b92d Fix bug in jumptable call stubs for SPARC.
Signed-off-by: Sergey Mironov <ierton@gmail.com>
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
2009-10-27 14:09:40 +01:00
126 changed files with 2935 additions and 1002 deletions

1336
CHANGELOG

File diff suppressed because it is too large Load Diff

View File

@@ -277,7 +277,7 @@ Nye Liu <nyet@zumanetworks.com>
ZUMA MPC7xx_74xx
Jon Loeliger <jdl@freescale.com>
Kumar Gala <kumar.gala@freescale.com>
MPC8540ADS MPC8540
MPC8560ADS MPC8560

11
MAKEALL
View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Print statistics when we exit
trap exit 1 2 3 15
@@ -39,6 +39,7 @@ LIST=""
ERR_CNT=0
ERR_LIST=""
TOTAL_CNT=0
RC=0
#########################################################################
## MPC5xx Systems
@@ -936,6 +937,12 @@ build_target() {
${MAKE} ${JOBS} all 2>&1 >${LOG_DIR}/$target.MAKELOG \
| tee ${LOG_DIR}/$target.ERR
# Check for 'make' errors
if [ ${PIPESTATUS[0]} -ne 0 ] ; then
RC=1
fi
if [ -s ${LOG_DIR}/$target.ERR ] ; then
ERR_CNT=$((ERR_CNT + 1))
ERR_LIST="${ERR_LIST} $target"
@@ -959,6 +966,8 @@ print_stats() {
echo "Boards with warnings or errors: ${ERR_CNT} (${ERR_LIST} )"
fi
echo "----------------------------------------------------------"
exit $RC
}
#-----------------------------------------------------------------------

View File

@@ -24,7 +24,7 @@
VERSION = 2009
PATCHLEVEL = 11
SUBLEVEL =
EXTRAVERSION = -rc1
EXTRAVERSION =
ifneq "$(SUBLEVEL)" ""
U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
else
@@ -3257,6 +3257,7 @@ zylonite_config :
#########################################################################
apollon_config : unconfig
@mkdir -p $(obj)include
@echo "#define CONFIG_ONENAND_U_BOOT" > $(obj)include/config.h
@$(MKCONFIG) $(@:_config=) arm arm1136 apollon NULL omap24xx
@echo "CONFIG_ONENAND_U_BOOT = y" >> $(obj)include/config.mk

56
README
View File

@@ -1,5 +1,5 @@
#
# (C) Copyright 2000 - 2008
# (C) Copyright 2000 - 2009
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
# See file CREDITS for list of people who contributed to this
@@ -138,6 +138,7 @@ U-Boot will always have a patchlevel of "0".
Directory Hierarchy:
====================
- api Machine/arch independent API for external apps
- board Board dependent files
- common Misc architecture independent functions
- cpu CPU specific files
@@ -178,8 +179,8 @@ Directory Hierarchy:
- disk Code for disk drive partition handling
- doc Documentation (don't expect too much)
- drivers Commonly used device drivers
- dtt Digital Thermometer and Thermostat drivers
- examples Example code for standalone applications, etc.
- fs Filesystem code (cramfs, ext2, jffs2, etc.)
- include Header Files
- lib_arm Files generic to ARM architecture
- lib_avr32 Files generic to AVR32 architecture
@@ -187,9 +188,12 @@ Directory Hierarchy:
- lib_generic Files generic to all architectures
- lib_i386 Files generic to i386 architecture
- lib_m68k Files generic to m68k architecture
- lib_microblaze Files generic to microblaze architecture
- lib_mips Files generic to MIPS architecture
- lib_nios Files generic to NIOS architecture
- lib_nios2 Files generic to NIOS2 architecture
- lib_ppc Files generic to PowerPC architecture
- lib_sh Files generic to SH architecture
- lib_sparc Files generic to SPARC architecture
- libfdt Library files to support flattened device trees
- net Networking code
@@ -842,20 +846,20 @@ The following options need to be configured:
Define this to use i/o functions instead of macros
(some hardware wont work with macros)
CONFIG_DRIVER_SMC911X
CONFIG_SMC911X
Support for SMSC's LAN911x and LAN921x chips
CONFIG_DRIVER_SMC911X_BASE
CONFIG_SMC911X_BASE
Define this to hold the physical address
of the device (I/O space)
CONFIG_DRIVER_SMC911X_32_BIT
CONFIG_SMC911X_32_BIT
Define this if data bus is 32 bits
CONFIG_DRIVER_SMC911X_16_BIT
CONFIG_SMC911X_16_BIT
Define this if data bus is 16 bits. If your processor
automatically converts one 32 bit word to two 16 bit
words you may also try CONFIG_DRIVER_SMC911X_32_BIT.
words you may also try CONFIG_SMC911X_32_BIT.
- USB Support:
At the moment only the UHCI host controller is
@@ -1889,25 +1893,6 @@ The following options need to be configured:
example, some LED's) on your board. At the moment,
the following checkpoints are implemented:
- Automatic software updates via TFTP server
CONFIG_UPDATE_TFTP
CONFIG_UPDATE_TFTP_CNT_MAX
CONFIG_UPDATE_TFTP_MSEC_MAX
These options enable and control the auto-update feature;
for a more detailed description refer to doc/README.update.
- MTD Support (mtdparts command, UBI support)
CONFIG_MTD_DEVICE
Adds the MTD device infrastructure from the Linux kernel.
Needed for mtdparts command support.
CONFIG_MTD_PARTITIONS
Adds the MTD partitioning infrastructure from the Linux
kernel. Needed for UBI support.
Legacy uImage format:
Arg Where When
@@ -2061,6 +2046,25 @@ FIT uImage format:
-150 common/cmd_nand.c Incorrect FIT image format
151 common/cmd_nand.c FIT image format OK
- Automatic software updates via TFTP server
CONFIG_UPDATE_TFTP
CONFIG_UPDATE_TFTP_CNT_MAX
CONFIG_UPDATE_TFTP_MSEC_MAX
These options enable and control the auto-update feature;
for a more detailed description refer to doc/README.update.
- MTD Support (mtdparts command, UBI support)
CONFIG_MTD_DEVICE
Adds the MTD device infrastructure from the Linux kernel.
Needed for mtdparts command support.
CONFIG_MTD_PARTITIONS
Adds the MTD partitioning infrastructure from the Linux
kernel. Needed for UBI support.
Modem Support:
--------------

View File

@@ -265,11 +265,12 @@ int board_init(void)
}
#ifdef CONFIG_DRIVER_DM9000
int board_eth_init(bd_t *bis)
{
int board_eth_init(bd_t *bis)
{
return dm9000_initialize(bis);
}
#endif
}
#endif
int dram_init(void)
{
gd->bd->bi_dram[0].start = PHYS_SDRAM;

View File

@@ -26,6 +26,7 @@
#include <asm/io.h>
#include <command.h>
#include <malloc.h>
#include <sja1000.h>
#undef FPGA_DEBUG
@@ -61,6 +62,34 @@ au_image_t au_image[] = {
int N_AU_IMAGES = (sizeof(au_image) / sizeof(au_image[0]));
/*
* generate a short spike on the CAN tx line
* to bring the couplers in sync
*/
void init_coupler(u32 addr)
{
struct sja1000_basic_s *ctrl = (struct sja1000_basic_s *)addr;
/* reset */
out_8(&ctrl->cr, CR_RR);
/* dominant */
out_8(&ctrl->btr0, 0x00); /* btr setup is required */
out_8(&ctrl->btr1, 0x14); /* we use 1Mbit/s */
out_8(&ctrl->oc, OC_TP1 | OC_TN1 | OC_POL1 |
OC_TP0 | OC_TN0 | OC_POL0 | OC_MODE1);
out_8(&ctrl->cr, 0x00);
/* delay */
in_8(&ctrl->cr);
in_8(&ctrl->cr);
in_8(&ctrl->cr);
in_8(&ctrl->cr);
/* reset */
out_8(&ctrl->cr, CR_RR);
}
/* Prototypes */
int gunzip(void *, int, unsigned char *, unsigned long *);
@@ -214,6 +243,13 @@ int misc_init_r(void)
out_8((void *)DUART1_BA + 1, fctr); /* write FCTR */
out_8((void *)DUART1_BA + 3, 0); /* write LCR */
/*
* Init magnetic couplers
*/
if (!getenv("noinitcoupler")) {
init_coupler(CAN0_BA);
init_coupler(CAN1_BA);
}
return 0;
}

View File

@@ -26,11 +26,40 @@
#include <asm/io.h>
#include <command.h>
#include <malloc.h>
#include <sja1000.h>
DECLARE_GLOBAL_DATA_PTR;
extern void lxt971_no_sleep(void);
/*
* generate a short spike on the CAN tx line
* to bring the couplers in sync
*/
void init_coupler(u32 addr)
{
struct sja1000_basic_s *ctrl = (struct sja1000_basic_s *)addr;
/* reset */
out_8(&ctrl->cr, CR_RR);
/* dominant */
out_8(&ctrl->btr0, 0x00); /* btr setup is required */
out_8(&ctrl->btr1, 0x14); /* we use 1Mbit/s */
out_8(&ctrl->oc, OC_TP1 | OC_TN1 | OC_POL1 |
OC_TP0 | OC_TN0 | OC_POL0 | OC_MODE1);
out_8(&ctrl->cr, 0x00);
/* delay */
in_8(&ctrl->cr);
in_8(&ctrl->cr);
in_8(&ctrl->cr);
in_8(&ctrl->cr);
/* reset */
out_8(&ctrl->cr, CR_RR);
}
int board_early_init_f (void)
{
/*
@@ -77,6 +106,12 @@ int misc_init_r (void)
gd->bd->bi_flashstart = 0 - gd->bd->bi_flashsize;
gd->bd->bi_flashoffset = 0;
/*
* Init magnetic coupler
*/
if (!getenv("noinitcoupler"))
init_coupler(CAN_BA);
return (0);
}

View File

@@ -72,15 +72,7 @@ lowlevel_init:
/* set DDR-SDRAM dummy read */
write32 MMSEL_A, MMSEL_D
mov.l MMSEL_A, r0
synco
mov.l @r0, r1
synco
mov.l CS0_A, r0
synco
mov.l @r0, r1
synco
write32 MMSEL_A, CS0_A
/* set DDR-SDRAM bus/endian etc */
write32 MIM_U_A, MIM_U_D

View File

@@ -550,24 +550,11 @@ void pci_init_board(void)
#endif
#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
void ft_blob_update(void *blob, bd_t *bd)
{
int ret;
ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
if (ret < 0) {
printf("ft_blob_update(): cannot set /memory/reg "
"property err:%s\n", fdt_strerror(ret));
}
}
void ft_board_setup(void *blob, bd_t *bd)
{
ft_cpu_setup(blob, bd);
#ifdef CONFIG_PCI
ft_pci_setup(blob, bd);
#endif
ft_blob_update(blob, bd);
}
#endif

View File

@@ -199,7 +199,7 @@ void pci_init_board(void)
pcie_ep ? "End Point" : "Root Complex",
pci_info[num].regs);
first_free_busno = fsl_pci_init_port(&pci_info[num++],
&pcie3_hose, first_free_busno, pcie_ep);
&pcie3_hose, first_free_busno);
/*
* Activate ULI1575 legacy chip by performing a fake
* memory access. Needed to make ULI RTC work.
@@ -231,7 +231,7 @@ void pci_init_board(void)
pcie_ep ? "End Point" : "Root Complex",
pci_info[num].regs);
first_free_busno = fsl_pci_init_port(&pci_info[num++],
&pcie2_hose, first_free_busno, pcie_ep);
&pcie2_hose, first_free_busno);
} else {
printf (" PCIE2: disabled\n");
}
@@ -251,7 +251,7 @@ void pci_init_board(void)
pcie_ep ? "End Point" : "Root Complex",
pci_info[num].regs);
first_free_busno = fsl_pci_init_port(&pci_info[num++],
&pcie1_hose, first_free_busno, pcie_ep);
&pcie1_hose, first_free_busno);
} else {
printf (" PCIE1: disabled\n");
}

View File

@@ -127,11 +127,6 @@ initdram(int board_type)
dram_size = fixed_sdram();
#endif
#if defined(CONFIG_SYS_RAMBOOT)
puts(" DDR: ");
return dram_size;
#endif
puts(" DDR: ");
return dram_size;
}

View File

@@ -74,11 +74,6 @@ initdram(int board_type)
dram_size = fixed_sdram();
#endif
#if defined(CONFIG_SYS_RAMBOOT)
puts(" DDR: ");
return dram_size;
#endif
puts(" DDR: ");
return dram_size;
}

View File

@@ -71,7 +71,7 @@ void pci_init_board(void)
pcie_ep ? "End Point" : "Root Complex",
pci_info[num].regs);
first_free_busno = fsl_pci_init_port(&pci_info[num++],
&pcie2_hose, first_free_busno, pcie_ep);
&pcie2_hose, first_free_busno);
} else {
printf (" PCIE2: disabled\n");
}
@@ -90,7 +90,7 @@ void pci_init_board(void)
pcie_ep ? "End Point" : "Root Complex",
pci_info[num].regs);
first_free_busno = fsl_pci_init_port(&pci_info[num++],
&pcie1_hose, first_free_busno, pcie_ep);
&pcie1_hose, first_free_busno);
} else {
printf (" PCIE1: disabled\n");
}

View File

@@ -227,7 +227,7 @@ void pci_init_board(void)
pcie_ep ? "End Point" : "Root Complex",
pci_info[num].regs);
first_free_busno = fsl_pci_init_port(&pci_info[num++],
&pcie2_hose, first_free_busno, pcie_ep);
&pcie2_hose, first_free_busno);
/*
* The workaround doesn't work on p2020 because the location
@@ -267,7 +267,7 @@ void pci_init_board(void)
pcie_ep ? "End Point" : "Root Complex",
pci_info[num].regs);
first_free_busno = fsl_pci_init_port(&pci_info[num++],
&pcie3_hose, first_free_busno, pcie_ep);
&pcie3_hose, first_free_busno);
} else {
printf(" PCIE3: disabled\n");
}
@@ -286,7 +286,7 @@ void pci_init_board(void)
pcie_ep ? "End Point" : "Root Complex",
pci_info[num].regs);
first_free_busno = fsl_pci_init_port(&pci_info[num++],
&pcie1_hose, first_free_busno, pcie_ep);
&pcie1_hose, first_free_busno);
} else {
printf(" PCIE1: disabled\n");
}

View File

@@ -400,24 +400,8 @@ int board_nand_init(struct nand_chip *nand)
#endif /* CONFIG_CMD_NAND */
#if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
/*
* update "memory" property in the blob
*/
void ft_blob_update(void *blob, bd_t *bd)
{
int ret;
ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
if (ret < 0) {
printf("ft_blob_update(): cannot set /memory/reg "
"property err:%s\n", fdt_strerror(ret));
}
}
void ft_board_setup(void *blob, bd_t *bd)
{
ft_cpu_setup( blob, bd);
ft_blob_update(blob, bd);
}
#endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */

View File

@@ -312,11 +312,10 @@ int hush_init_var (void)
#if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
/*
* update "memory" property in the blob
* update "flash" property in the blob
*/
void ft_blob_update (void *blob, bd_t *bd)
{
ulong memory_data[2] = {0};
ulong *flash_data = NULL;
ulong flash_reg[6] = {0};
flash_info_t *info;
@@ -324,11 +323,6 @@ void ft_blob_update (void *blob, bd_t *bd)
int size;
int i = 0;
memory_data[0] = cpu_to_be32 (bd->bi_memstart);
memory_data[1] = cpu_to_be32 (bd->bi_memsize);
fdt_set_node_and_value (blob, "/memory", "reg", memory_data,
sizeof (memory_data));
len = fdt_get_node_and_value (blob, "/localbus", "ranges",
(void *)&flash_data);

View File

@@ -308,25 +308,9 @@ int board_early_init_r (void)
void ft_blob_update (void *blob, bd_t *bd)
{
int ret, nodeoffset = 0;
ulong memory_data[2] = {0};
ulong flash_data[4] = {0};
ulong speed = 0;
memory_data[0] = cpu_to_be32 (bd->bi_memstart);
memory_data[1] = cpu_to_be32 (bd->bi_memsize);
nodeoffset = fdt_path_offset (blob, "/memory");
if (nodeoffset >= 0) {
ret = fdt_setprop (blob, nodeoffset, "reg", memory_data,
sizeof(memory_data));
if (ret < 0)
printf ("ft_blob_update): cannot set /memory/reg "
"property err:%s\n", fdt_strerror (ret));
} else {
/* memory node is required in dts */
printf ("ft_blob_update(): cannot find /memory node "
"err:%s\n", fdt_strerror(nodeoffset));
}
/* update Flash addr, size */
flash_data[2] = cpu_to_be32 (CONFIG_SYS_FLASH_BASE);
flash_data[3] = cpu_to_be32 (CONFIG_SYS_FLASH_SIZE);

View File

@@ -31,6 +31,7 @@
*/
#include <common.h>
#include <fdt_support.h>
#include <mpc5xxx.h>
#include <pci.h>
#include <malloc.h>
@@ -403,5 +404,6 @@ void pci_init_board (void)
void ft_board_setup(void *blob, bd_t *bd)
{
ft_cpu_setup(blob, bd);
fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
}
#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */

View File

@@ -219,7 +219,8 @@ const omap3_sysinfo sysinfo = {
MUX_VAL(CP(UART2_RX), (IEN | PTD | EN | M4)) /*GPIO_147,*/\
/*UART2_RX*/\
/*Serial Interface (Peripheral boot, Linux console, on AV connector)*/\
MUX_VAL(CP(UART3_RX_IRRX), (IEN | PTD | DIS | M0)) /*UART3_RX*/\
/*RX pulled up to avoid noise when nothing is connected to serial port*/\
MUX_VAL(CP(UART3_RX_IRRX), (IEN | PTU | EN | M0)) /*UART3_RX*/\
MUX_VAL(CP(UART3_TX_IRTX), (IDIS | PTD | DIS | M0)) /*UART3_TX*/\
/*LEDs (Controlled by OMAP)*/\
MUX_VAL(CP(MMC1_DAT6), (IDIS | PTD | DIS | M4)) /*GPIO_128*/\

View File

@@ -178,60 +178,6 @@ lbsc_end:
.align 4
/*------- LBSC -------*/
MMSELR_A: .long 0xfc400020
#if defined(CONFIG_SH_32BIT)
MMSELR_D: .long 0xa5a50005
#else
MMSELR_D: .long 0xa5a50002
#endif
/*------- DBSC2 -------*/
#define DBSC2_BASE 0xfe800000
DBSC2_DBSTATE_A: .long DBSC2_BASE + 0x0c
DBSC2_DBEN_A: .long DBSC2_BASE + 0x10
DBSC2_DBCMDCNT_A: .long DBSC2_BASE + 0x14
DBSC2_DBCONF_A: .long DBSC2_BASE + 0x20
DBSC2_DBTR0_A: .long DBSC2_BASE + 0x30
DBSC2_DBTR1_A: .long DBSC2_BASE + 0x34
DBSC2_DBTR2_A: .long DBSC2_BASE + 0x38
DBSC2_DBRFCNT0_A: .long DBSC2_BASE + 0x40
DBSC2_DBRFCNT1_A: .long DBSC2_BASE + 0x44
DBSC2_DBRFCNT2_A: .long DBSC2_BASE + 0x48
DBSC2_DBRFSTS_A: .long DBSC2_BASE + 0x4c
DBSC2_DBFREQ_A: .long DBSC2_BASE + 0x50
DBSC2_DBDICODTOCD_A: .long DBSC2_BASE + 0x54
DBSC2_DBMRCNT_A: .long DBSC2_BASE + 0x60
DDR_DUMMY_ACCESS_A: .long 0x40000000
DBSC2_DBCONF_D: .long 0x00630002
DBSC2_DBTR0_D: .long 0x050b1f04
DBSC2_DBTR1_D: .long 0x00040204
DBSC2_DBTR2_D: .long 0x02100308
DBSC2_DBFREQ_D1: .long 0x00000000
DBSC2_DBFREQ_D2: .long 0x00000100
DBSC2_DBDICODTOCD_D: .long 0x000f0907
DBSC2_DBCMDCNT_D_CKE_H: .long 0x00000003
DBSC2_DBCMDCNT_D_PALL: .long 0x00000002
DBSC2_DBCMDCNT_D_REF: .long 0x00000004
DBSC2_DBMRCNT_D_EMRS2: .long 0x00020000
DBSC2_DBMRCNT_D_EMRS3: .long 0x00030000
DBSC2_DBMRCNT_D_EMRS1_1: .long 0x00010006
DBSC2_DBMRCNT_D_EMRS1_2: .long 0x00010386
DBSC2_DBMRCNT_D_MRS_1: .long 0x00000952
DBSC2_DBMRCNT_D_MRS_2: .long 0x00000852
DBSC2_DBEN_D: .long 0x00000001
DBSC2_DBPDCNT0_D3: .long 0x00000080
DBSC2_DBRFCNT1_D: .long 0x00000926
DBSC2_DBRFCNT2_D: .long 0x00fe00fe
DBSC2_DBRFCNT0_D: .long 0x00010000
WAIT_200US: .long 33333
/*------- GPIO -------*/
PACR_D: .long 0x0000
PBCR_D: .long 0x0000
@@ -291,6 +237,59 @@ PPUPR2_A: .long GPIO_BASE + 0x62
P1MSELR_A: .long GPIO_BASE + 0x80
P2MSELR_A: .long GPIO_BASE + 0x82
MMSELR_A: .long 0xfc400020
#if defined(CONFIG_SH_32BIT)
MMSELR_D: .long 0xa5a50005
#else
MMSELR_D: .long 0xa5a50002
#endif
/*------- DBSC2 -------*/
#define DBSC2_BASE 0xfe800000
DBSC2_DBSTATE_A: .long DBSC2_BASE + 0x0c
DBSC2_DBEN_A: .long DBSC2_BASE + 0x10
DBSC2_DBCMDCNT_A: .long DBSC2_BASE + 0x14
DBSC2_DBCONF_A: .long DBSC2_BASE + 0x20
DBSC2_DBTR0_A: .long DBSC2_BASE + 0x30
DBSC2_DBTR1_A: .long DBSC2_BASE + 0x34
DBSC2_DBTR2_A: .long DBSC2_BASE + 0x38
DBSC2_DBRFCNT0_A: .long DBSC2_BASE + 0x40
DBSC2_DBRFCNT1_A: .long DBSC2_BASE + 0x44
DBSC2_DBRFCNT2_A: .long DBSC2_BASE + 0x48
DBSC2_DBRFSTS_A: .long DBSC2_BASE + 0x4c
DBSC2_DBFREQ_A: .long DBSC2_BASE + 0x50
DBSC2_DBDICODTOCD_A:.long DBSC2_BASE + 0x54
DBSC2_DBMRCNT_A: .long DBSC2_BASE + 0x60
DDR_DUMMY_ACCESS_A: .long 0x40000000
DBSC2_DBCONF_D: .long 0x00630002
DBSC2_DBTR0_D: .long 0x050b1f04
DBSC2_DBTR1_D: .long 0x00040204
DBSC2_DBTR2_D: .long 0x02100308
DBSC2_DBFREQ_D1: .long 0x00000000
DBSC2_DBFREQ_D2: .long 0x00000100
DBSC2_DBDICODTOCD_D:.long 0x000f0907
DBSC2_DBCMDCNT_D_CKE_H: .long 0x00000003
DBSC2_DBCMDCNT_D_PALL: .long 0x00000002
DBSC2_DBCMDCNT_D_REF: .long 0x00000004
DBSC2_DBMRCNT_D_EMRS2: .long 0x00020000
DBSC2_DBMRCNT_D_EMRS3: .long 0x00030000
DBSC2_DBMRCNT_D_EMRS1_1: .long 0x00010006
DBSC2_DBMRCNT_D_EMRS1_2: .long 0x00010386
DBSC2_DBMRCNT_D_MRS_1: .long 0x00000952
DBSC2_DBMRCNT_D_MRS_2: .long 0x00000852
DBSC2_DBEN_D: .long 0x00000001
DBSC2_DBPDCNT0_D3: .long 0x00000080
DBSC2_DBRFCNT1_D: .long 0x00000926
DBSC2_DBRFCNT2_D: .long 0x00fe00fe
DBSC2_DBRFCNT0_D: .long 0x00010000
WAIT_200US: .long 33333
/*------- LBSC -------*/
PASCR_A: .long 0xff000070
PASCR_32BIT_MODE: .long 0x80000000 /* check booting mode */

View File

@@ -359,7 +359,7 @@ pci_init_board(void)
SET_STD_PCI_INFO(pci_info[num], 1);
first_free_busno = fsl_pci_init_port(&pci_info[num++],
&pci1_hose, first_free_busno, 0);
&pci1_hose, first_free_busno);
} else {
printf (" PCI: disabled\n");
}
@@ -378,7 +378,7 @@ pci_init_board(void)
SET_STD_PCIE_INFO(pci_info[num], 1);
printf (" PCIE at base address %lx\n", pci_info[num].regs);
first_free_busno = fsl_pci_init_port(&pci_info[num++],
&pcie1_hose, first_free_busno, 0);
&pcie1_hose, first_free_busno);
} else {
printf (" PCIE: disabled\n");
}

View File

@@ -62,11 +62,6 @@ phys_size_t initdram (int board_type)
dram_size = fixed_sdram ();
#endif
#if defined(CONFIG_SYS_RAMBOOT)
puts (" DDR: ");
return dram_size;
#endif
puts (" DDR: ");
return dram_size;
}

View File

@@ -31,6 +31,7 @@
*/
#include <common.h>
#include <fdt_support.h>
#include <mpc5xxx.h>
#include <pci.h>
#include <malloc.h>
@@ -376,5 +377,6 @@ void hw_watchdog_reset(void)
void ft_board_setup(void *blob, bd_t *bd)
{
ft_cpu_setup(blob, bd);
fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
}
#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */

View File

@@ -29,7 +29,6 @@ AOBJS =
# core
COBJS-y += main.o
COBJS-y += circbuf.o
COBJS-y += console.o
COBJS-y += command.o
COBJS-y += dlmalloc.o

View File

@@ -129,7 +129,7 @@ int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
static boot_os_fn do_bootm_integrity;
#endif
boot_os_fn * boot_os[] = {
static boot_os_fn *boot_os[] = {
#ifdef CONFIG_BOOTM_LINUX
[IH_OS_LINUX] = do_bootm_linux,
#endif
@@ -453,8 +453,8 @@ cmd_tbl_t cmd_bootm_sub[] = {
#ifdef CONFIG_OF_LIBFDT
U_BOOT_CMD_MKENT(fdt, 0, 1, (void *)BOOTM_STATE_FDT, "", ""),
#endif
U_BOOT_CMD_MKENT(bdt, 0, 1, (void *)BOOTM_STATE_OS_BD_T, "", ""),
U_BOOT_CMD_MKENT(cmdline, 0, 1, (void *)BOOTM_STATE_OS_CMDLINE, "", ""),
U_BOOT_CMD_MKENT(bdt, 0, 1, (void *)BOOTM_STATE_OS_BD_T, "", ""),
U_BOOT_CMD_MKENT(prep, 0, 1, (void *)BOOTM_STATE_OS_PREP, "", ""),
U_BOOT_CMD_MKENT(go, 0, 1, (void *)BOOTM_STATE_OS_GO, "", ""),
};
@@ -524,7 +524,7 @@ int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
break;
#endif
#ifdef CONFIG_OF_LIBFDT
#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_SYS_BOOTMAPSZ)
case BOOTM_STATE_FDT:
{
ulong bootmap_base = getenv_bootm_low();
@@ -1000,8 +1000,8 @@ U_BOOT_CMD(
#if defined(CONFIG_OF_LIBFDT)
"\tfdt - relocate flat device tree\n"
#endif
"\tbdt - OS specific bd_t processing\n"
"\tcmdline - OS specific command line processing/setup\n"
"\tbdt - OS specific bd_t processing\n"
"\tprep - OS specific prep before relocation or go\n"
"\tgo - start OS"
);

View File

@@ -27,8 +27,6 @@
#include <common.h>
#include <command.h>
#if defined(CONFIG_CMD_CACHE)
static int on_off (const char *);
int do_icache ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
@@ -108,5 +106,3 @@ U_BOOT_CMD(
"[on, off]\n"
" - enable or disable data (writethrough) cache"
);
#endif

View File

@@ -71,9 +71,9 @@ int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
/* and write to RTC */
rcode = rtc_set (&tm);
if(rcode)
puts("## Set date failled\n");
puts("## Set date failed\n");
} else {
puts("## Get date failled\n");
puts("## Get date failed\n");
}
}
/* FALL TROUGH */
@@ -81,7 +81,7 @@ int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
rcode = rtc_get (&tm);
if (rcode) {
puts("## Get date failled\n");
puts("## Get date failed\n");
break;
}

View File

@@ -315,10 +315,6 @@ int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
/*
* Wait for the write to complete. The write can take
* up to 10mSec (we allow a little more time).
*
* On some chips, while the write is in progress, the
* chip doesn't respond. This apparently isn't a
* universal feature so we don't take advantage of it.
*/
/*
* No write delay with FRAM devices.
@@ -326,14 +322,6 @@ int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
#if !defined(CONFIG_SYS_I2C_FRAM)
udelay(11000);
#endif
#if 0
for (timeout = 0; timeout < 10; timeout++) {
udelay(2000);
if (i2c_probe(chip) == 0)
break;
}
#endif
}
return (0);

View File

@@ -47,3 +47,12 @@ U_BOOT_CMD(
"enable or disable interrupts",
"[on, off]"
);
/* Implemented in $(CPU)/interrupts.c */
int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
U_BOOT_CMD(
irqinfo, 1, 1, do_irqinfo,
"print information about IRQs",
""
);

View File

@@ -23,8 +23,6 @@
#include <common.h>
#if defined(CONFIG_CMD_LICENSE)
/* COPYING is currently 15951 bytes in size */
#define LICENSE_MAX 20480
@@ -56,5 +54,3 @@ U_BOOT_CMD(license, 1, 1, do_license,
"print GPL license text",
""
);
#endif /* CONFIG_CMD_LICENSE */

View File

@@ -24,8 +24,6 @@
#include <common.h>
#include <command.h>
#if defined (CONFIG_CMD_MG_DISK)
#include <mg_disk.h>
int do_mg_disk_cmd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
@@ -72,5 +70,3 @@ U_BOOT_CMD(
" - sector read : mgd readsec [sector] [to] [counts]\n"
" - sector write : mgd writesec [from] [sector] [counts]"
);
#endif

View File

@@ -49,17 +49,6 @@ int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
/* Implemented in $(CPU)/interrupts.c */
#if defined(CONFIG_CMD_IRQ)
int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
U_BOOT_CMD(
irqinfo, 1, 1, do_irqinfo,
"print information about IRQs",
""
);
#endif
U_BOOT_CMD(
sleep , 2, 1, do_sleep,
"delay execution for some time",

View File

@@ -205,6 +205,8 @@ void reset_cpu(ulong ignored)
struct s3c24x0_watchdog *watchdog;
#ifdef CONFIG_TRAB
extern void disable_vfd(void);
disable_vfd();
#endif

View File

@@ -328,7 +328,7 @@ usage:
U_BOOT_CMD(
nandecc, 2, 1, do_switch_ecc,
"nandecc - switch OMAP3 NAND ECC calculation algorithm\n",
"switch OMAP3 NAND ECC calculation algorithm",
"[hw/sw] - Switch between NAND hardware (hw) or software (sw) ecc algorithm"
);

View File

@@ -318,6 +318,7 @@ void ft_cpu_setup (void *blob, bd_t *bd)
"timebase-frequency", OF_TBCLK, 1);
do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
"clock-frequency", bd->bi_intfreq, 1);
fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
}
#endif /* CONFIG_OF_LIBFDT */

View File

@@ -169,6 +169,28 @@ void cpu_init_f (volatile immap_t * im)
#endif
#ifdef CONFIG_SYS_SCCR_SATACM /* SATA controller clock mode */
(CONFIG_SYS_SCCR_SATACM << SCCR_SATACM_SHIFT) |
#endif
0;
__be32 lcrr_mask =
#ifdef CONFIG_SYS_LCRR_DBYP /* PLL bypass */
LCRR_DBYP |
#endif
#ifdef CONFIG_SYS_LCRR_EADC /* external address delay */
LCRR_EADC |
#endif
#ifdef CONFIG_SYS_LCRR_CLKDIV /* system clock divider */
LCRR_CLKDIV |
#endif
0;
__be32 lcrr_val =
#ifdef CONFIG_SYS_LCRR_DBYP /* PLL bypass */
CONFIG_SYS_LCRR_DBYP |
#endif
#ifdef CONFIG_SYS_LCRR_EADC
CONFIG_SYS_LCRR_EADC |
#endif
#ifdef CONFIG_SYS_LCRR_CLKDIV /* system clock divider */
CONFIG_SYS_LCRR_CLKDIV |
#endif
0;
@@ -199,6 +221,13 @@ void cpu_init_f (volatile immap_t * im)
*/
__raw_writel(RMR_CSRE & (1<<RMR_CSRE_SHIFT), &im->reset.rmr);
/* LCRR - Clock Ratio Register (10.3.1.16)
* write, read, and isync per MPC8379ERM rev.1 CLKDEV field description
*/
clrsetbits_be32(&im->lbus.lcrr, lcrr_mask, lcrr_val);
__raw_readl(&im->lbus.lcrr);
isync();
/* Enable Time Base & Decrementer ( so we will have udelay() )*/
setbits_be32(&im->sysconf.spcr, SPCR_TBEN);
@@ -331,41 +360,9 @@ void cpu_init_f (volatile immap_t * im)
int cpu_init_r (void)
{
volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR;
#ifdef CONFIG_QE
uint qe_base = CONFIG_SYS_IMMR + 0x00100000; /* QE immr base */
#endif
__be32 lcrr_mask =
#ifdef CONFIG_SYS_LCRR_DBYP /* PLL bypass */
LCRR_DBYP |
#endif
#ifdef CONFIG_SYS_LCRR_EADC /* external address delay */
LCRR_EADC |
#endif
#ifdef CONFIG_SYS_LCRR_CLKDIV /* system clock divider */
LCRR_CLKDIV |
#endif
0;
__be32 lcrr_val =
#ifdef CONFIG_SYS_LCRR_DBYP /* PLL bypass */
CONFIG_SYS_LCRR_DBYP |
#endif
#ifdef CONFIG_SYS_LCRR_EADC
CONFIG_SYS_LCRR_EADC |
#endif
#ifdef CONFIG_SYS_LCRR_CLKDIV /* system clock divider */
CONFIG_SYS_LCRR_CLKDIV |
#endif
0;
/* LCRR - Clock Ratio Register (10.3.1.16)
* write, read, and isync per MPC8379ERM rev.1 CLKDEV field description
*/
clrsetbits_be32(&im->lbus.lcrr, lcrr_mask, lcrr_val);
__raw_readl(&im->lbus.lcrr);
isync();
#ifdef CONFIG_QE
qe_init(qe_base);
qe_reset();
#endif

View File

@@ -102,18 +102,22 @@ __secondary_start_page:
#ifdef CONFIG_BACKSIDE_L2_CACHE
/* Enable/invalidate the L2 cache */
msync
lis r3,(L2CSR0_L2FI|L2CSR0_L2LFC)@h
ori r3,r3,(L2CSR0_L2FI|L2CSR0_L2LFC)@l
mtspr SPRN_L2CSR0,r3
lis r2,(L2CSR0_L2FI|L2CSR0_L2LFC)@h
ori r2,r2,(L2CSR0_L2FI|L2CSR0_L2LFC)@l
mtspr SPRN_L2CSR0,r2
1:
mfspr r3,SPRN_L2CSR0
andis. r1,r3,L2CSR0_L2FI@h
and. r1,r3,r2
bne 1b
lis r3,CONFIG_SYS_INIT_L2CSR0@h
ori r3,r3,CONFIG_SYS_INIT_L2CSR0@l
mtspr SPRN_L2CSR0,r3
isync
2:
mfspr r3,SPRN_L2CSR0
andis. r1,r3,L2CSR0_L2E@h
beq 2b
#endif
#define EPAPR_MAGIC (0x45504150)

View File

@@ -132,10 +132,10 @@ int find_tlb_idx(void *addr, u8 tlbsel)
void init_addr_map(void)
{
int i;
unsigned int max_cam = (mfspr(SPRN_TLB1CFG) >> 16) & 0xff;
unsigned int num_cam = mfspr(SPRN_TLB1CFG) & 0xfff;
/* walk all the entries */
for (i = 0; i < max_cam; i++) {
for (i = 0; i < num_cam; i++) {
unsigned long epn;
u32 tsize, _mas1;
phys_addr_t rpn;

View File

@@ -22,9 +22,7 @@ unsigned int populate_memctl_options(int all_DIMMs_registered,
unsigned int ctrl_num)
{
unsigned int i;
#if (CONFIG_NUM_DDR_CONTROLLERS > 1)
const char *p;
#endif
/* Chip select options. */
@@ -242,8 +240,10 @@ unsigned int populate_memctl_options(int all_DIMMs_registered,
simple_strtoul(p, NULL, 0);
}
}
#endif
if( (p = getenv("ba_intlv_ctl")) != NULL) {
if( ((p = getenv("ba_intlv_ctl")) != NULL) &&
(CONFIG_CHIP_SELECTS_PER_CTRL > 1)) {
if (strcmp(p, "cs0_cs1") == 0)
popts->ba_intlv_ctl = FSL_DDR_CS0_CS1;
else if (strcmp(p, "cs2_cs3") == 0)
@@ -283,7 +283,6 @@ unsigned int populate_memctl_options(int all_DIMMs_registered,
break;
}
}
#endif
fsl_ddr_board_options(popts, pdimm, ctrl_num);

View File

@@ -3160,7 +3160,7 @@ inline void ppc4xx_ibm_ddr2_register_dump(void)
PPC4xx_IBM_DDR2_DUMP_REGISTER(SDTR3);
PPC4xx_IBM_DDR2_DUMP_REGISTER(MMODE);
PPC4xx_IBM_DDR2_DUMP_REGISTER(MEMODE);
PPC4xx_IBM_DDR2_DUMP_REGISTER(ECCCR);
PPC4xx_IBM_DDR2_DUMP_REGISTER(ECCES);
#if (defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
defined(CONFIG_460EX) || defined(CONFIG_460GT))
PPC4xx_IBM_DDR2_DUMP_REGISTER(CID);

View File

@@ -122,10 +122,12 @@ function can be called multiple times in a row.
The recv function should process packets as long as the hardware has them
readily available before returning. i.e. you should drain the hardware fifo.
The common code sets up packet buffers for you already (NetRxPackets), so there
is no need to allocate your own. For each packet you receive, you should call
the NetReceive() function on it with the packet length. So the pseudo code
here would look something like:
For each packet you receive, you should call the NetReceive() function on it
along with the packet length. The common code sets up packet buffers for you
already in the .bss (NetRxPackets), so there should be no need to allocate your
own. This doesn't mean you must use the NetRxPackets array however; you're
free to call the NetReceive() function with any buffer you wish. So the pseudo
code here would look something like:
int ape_recv(struct eth_device *dev)
{
int length, i = 0;
@@ -145,7 +147,8 @@ int ape_recv(struct eth_device *dev)
}
The halt function should turn off / disable the hardware and place it back in
its reset state.
its reset state. It can be called at any time (before any call to the related
init function), so make sure it can handle this sort of thing.
So the call graph at this stage would look something like:
some net operation (ping / tftp / whatever...)

View File

@@ -1,6 +1,9 @@
/*
* Simple U-boot uImage source file containing a single kernel
*/
/dts-v1/;
/ {
description = "Simple image with single Linux kernel";
#address-cells = <1>;

View File

@@ -1,6 +1,9 @@
/*
* Simple U-boot uImage source file containing a single kernel and FDT blob
*/
/dts-v1/;
/ {
description = "Simple image with single Linux kernel and FDT blob";
#address-cells = <1>;

View File

@@ -1,6 +1,9 @@
/*
* U-boot uImage source file with multiple kernels, ramdisks and FDT blobs
*/
/dts-v1/;
/ {
description = "Various kernels, ramdisks and FDT blobs";
#address-cells = <1>;

View File

@@ -1,6 +1,9 @@
/*
* Example Automatic software update file.
*/
/dts-v1/;
/ {
description = "Automatic software updates: kernel, ramdisk, FDT";
#address-cells = <1>;

View File

@@ -2,6 +2,9 @@
* Automatic software update for U-Boot
* Make sure the flashing addresses ('load' prop) is correct for your board!
*/
/dts-v1/;
/ {
description = "Automatic U-Boot update";
#address-cells = <1>;

View File

@@ -39,6 +39,7 @@
#include <asm/io.h>
#include <asm/byteorder.h>
#include <environment.h>
#include <mtd/cfi_flash.h>
/*
* This file implements a Common Flash Interface (CFI) driver for
@@ -65,100 +66,6 @@
#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE }
#endif
#define FLASH_CMD_CFI 0x98
#define FLASH_CMD_READ_ID 0x90
#define FLASH_CMD_RESET 0xff
#define FLASH_CMD_BLOCK_ERASE 0x20
#define FLASH_CMD_ERASE_CONFIRM 0xD0
#define FLASH_CMD_WRITE 0x40
#define FLASH_CMD_PROTECT 0x60
#define FLASH_CMD_PROTECT_SET 0x01
#define FLASH_CMD_PROTECT_CLEAR 0xD0
#define FLASH_CMD_CLEAR_STATUS 0x50
#define FLASH_CMD_READ_STATUS 0x70
#define FLASH_CMD_WRITE_TO_BUFFER 0xE8
#define FLASH_CMD_WRITE_BUFFER_PROG 0xE9
#define FLASH_CMD_WRITE_BUFFER_CONFIRM 0xD0
#define FLASH_STATUS_DONE 0x80
#define FLASH_STATUS_ESS 0x40
#define FLASH_STATUS_ECLBS 0x20
#define FLASH_STATUS_PSLBS 0x10
#define FLASH_STATUS_VPENS 0x08
#define FLASH_STATUS_PSS 0x04
#define FLASH_STATUS_DPS 0x02
#define FLASH_STATUS_R 0x01
#define FLASH_STATUS_PROTECT 0x01
#define AMD_CMD_RESET 0xF0
#define AMD_CMD_WRITE 0xA0
#define AMD_CMD_ERASE_START 0x80
#define AMD_CMD_ERASE_SECTOR 0x30
#define AMD_CMD_UNLOCK_START 0xAA
#define AMD_CMD_UNLOCK_ACK 0x55
#define AMD_CMD_WRITE_TO_BUFFER 0x25
#define AMD_CMD_WRITE_BUFFER_CONFIRM 0x29
#define AMD_STATUS_TOGGLE 0x40
#define AMD_STATUS_ERROR 0x20
#define ATM_CMD_UNLOCK_SECT 0x70
#define ATM_CMD_SOFTLOCK_START 0x80
#define ATM_CMD_LOCK_SECT 0x40
#define FLASH_CONTINUATION_CODE 0x7F
#define FLASH_OFFSET_MANUFACTURER_ID 0x00
#define FLASH_OFFSET_DEVICE_ID 0x01
#define FLASH_OFFSET_DEVICE_ID2 0x0E
#define FLASH_OFFSET_DEVICE_ID3 0x0F
#define FLASH_OFFSET_CFI 0x55
#define FLASH_OFFSET_CFI_ALT 0x555
#define FLASH_OFFSET_CFI_RESP 0x10
#define FLASH_OFFSET_PRIMARY_VENDOR 0x13
/* extended query table primary address */
#define FLASH_OFFSET_EXT_QUERY_T_P_ADDR 0x15
#define FLASH_OFFSET_WTOUT 0x1F
#define FLASH_OFFSET_WBTOUT 0x20
#define FLASH_OFFSET_ETOUT 0x21
#define FLASH_OFFSET_CETOUT 0x22
#define FLASH_OFFSET_WMAX_TOUT 0x23
#define FLASH_OFFSET_WBMAX_TOUT 0x24
#define FLASH_OFFSET_EMAX_TOUT 0x25
#define FLASH_OFFSET_CEMAX_TOUT 0x26
#define FLASH_OFFSET_SIZE 0x27
#define FLASH_OFFSET_INTERFACE 0x28
#define FLASH_OFFSET_BUFFER_SIZE 0x2A
#define FLASH_OFFSET_NUM_ERASE_REGIONS 0x2C
#define FLASH_OFFSET_ERASE_REGIONS 0x2D
#define FLASH_OFFSET_PROTECT 0x02
#define FLASH_OFFSET_USER_PROTECTION 0x85
#define FLASH_OFFSET_INTEL_PROTECTION 0x81
#define CFI_CMDSET_NONE 0
#define CFI_CMDSET_INTEL_EXTENDED 1
#define CFI_CMDSET_AMD_STANDARD 2
#define CFI_CMDSET_INTEL_STANDARD 3
#define CFI_CMDSET_AMD_EXTENDED 4
#define CFI_CMDSET_MITSU_STANDARD 256
#define CFI_CMDSET_MITSU_EXTENDED 257
#define CFI_CMDSET_SST 258
#define CFI_CMDSET_INTEL_PROG_REGIONS 512
#ifdef CONFIG_SYS_FLASH_CFI_AMD_RESET /* needed for STM_ID_29W320DB on UC100 */
# undef FLASH_CMD_RESET
# define FLASH_CMD_RESET AMD_CMD_RESET /* use AMD-Reset instead */
#endif
typedef union {
unsigned char c;
unsigned short w;
unsigned long l;
unsigned long long ll;
} cfiword_t;
#define NUM_ERASE_REGIONS 4 /* max. number of erase regions */
static uint flash_offset_cfi[2] = { FLASH_OFFSET_CFI, FLASH_OFFSET_CFI_ALT };
static uint flash_verbose = 1;
@@ -178,38 +85,6 @@ flash_info_t flash_info[CFI_MAX_FLASH_BANKS]; /* FLASH chips info */
#define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_8BIT
#endif
/* CFI standard query structure */
struct cfi_qry {
u8 qry[3];
u16 p_id;
u16 p_adr;
u16 a_id;
u16 a_adr;
u8 vcc_min;
u8 vcc_max;
u8 vpp_min;
u8 vpp_max;
u8 word_write_timeout_typ;
u8 buf_write_timeout_typ;
u8 block_erase_timeout_typ;
u8 chip_erase_timeout_typ;
u8 word_write_timeout_max;
u8 buf_write_timeout_max;
u8 block_erase_timeout_max;
u8 chip_erase_timeout_max;
u8 dev_size;
u16 interface_desc;
u16 max_buf_write_size;
u8 num_erase_regions;
u32 erase_region_info[NUM_ERASE_REGIONS];
} __attribute__((packed));
struct cfi_pri_hdr {
u8 pri[3];
u8 major_version;
u8 minor_version;
} __attribute__((packed));
static void __flash_write8(u8 value, void *addr)
{
__raw_writeb(value, addr);
@@ -452,8 +327,8 @@ static ulong flash_read_long (flash_info_t * info, flash_sect_t sect,
/*
* Write a proper sized command to the correct address
*/
static void flash_write_cmd (flash_info_t * info, flash_sect_t sect,
uint offset, u32 cmd)
void flash_write_cmd (flash_info_t * info, flash_sect_t sect,
uint offset, u32 cmd)
{
void *addr;
@@ -1699,15 +1574,25 @@ static void flash_read_cfi (flash_info_t *info, void *buf,
p[i] = flash_read_uchar(info, start + i);
}
void __flash_cmd_reset(flash_info_t *info)
{
/*
* We do not yet know what kind of commandset to use, so we issue
* the reset command in both Intel and AMD variants, in the hope
* that AMD flash roms ignore the Intel command.
*/
flash_write_cmd(info, 0, 0, AMD_CMD_RESET);
flash_write_cmd(info, 0, 0, FLASH_CMD_RESET);
}
void flash_cmd_reset(flash_info_t *info)
__attribute__((weak,alias("__flash_cmd_reset")));
static int __flash_detect_cfi (flash_info_t * info, struct cfi_qry *qry)
{
int cfi_offset;
/* We do not yet know what kind of commandset to use, so we issue
the reset command in both Intel and AMD variants, in the hope
that AMD flash roms ignore the Intel command. */
flash_write_cmd (info, 0, 0, AMD_CMD_RESET);
flash_write_cmd (info, 0, 0, FLASH_CMD_RESET);
/* Issue FLASH reset command */
flash_cmd_reset(info);
for (cfi_offset=0;
cfi_offset < sizeof(flash_offset_cfi) / sizeof(uint);

View File

@@ -452,7 +452,7 @@ static size_t get_len_incl_bad (nand_info_t *nand, loff_t offset,
len_incl_bad += block_len;
offset += block_len;
if ((offset + len_incl_bad) >= nand->size)
if (offset >= nand->size)
break;
}
@@ -490,7 +490,7 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
len_incl_bad = get_len_incl_bad (nand, offset, *length);
if ((offset + len_incl_bad) >= nand->size) {
if ((offset + len_incl_bad) > nand->size) {
printf ("Attempt to write outside the flash area\n");
return -EINVAL;
}
@@ -562,7 +562,7 @@ int nand_read_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
len_incl_bad = get_len_incl_bad (nand, offset, *length);
if ((offset + len_incl_bad) >= nand->size) {
if ((offset + len_incl_bad) > nand->size) {
printf ("Attempt to read outside the flash area\n");
return -EINVAL;
}

View File

@@ -31,6 +31,7 @@ COBJS-$(CONFIG_SPI_FLASH_MACRONIX) += macronix.o
COBJS-$(CONFIG_SPI_FLASH_SPANSION) += spansion.o
COBJS-$(CONFIG_SPI_FLASH_SST) += sst.o
COBJS-$(CONFIG_SPI_FLASH_STMICRO) += stmicro.o
COBJS-$(CONFIG_SPI_FLASH_WINBOND) += winbond.o
COBJS-$(CONFIG_SPI_M95XXX) += eeprom_m95xxx.o
COBJS := $(COBJS-y)

View File

@@ -140,6 +140,11 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
flash = spi_flash_probe_macronix(spi, idcode);
break;
#endif
#ifdef CONFIG_SPI_FLASH_WINBOND
case 0xef:
flash = spi_flash_probe_winbond(spi, idcode);
break;
#endif
#ifdef CONFIG_SPI_FLASH_STMICRO
case 0x20:
flash = spi_flash_probe_stmicro(spi, idcode);

View File

@@ -49,3 +49,4 @@ struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode);
struct spi_flash *spi_flash_probe_macronix(struct spi_slave *spi, u8 *idcode);
struct spi_flash *spi_flash_probe_sst(struct spi_slave *spi, u8 *idcode);
struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 *idcode);
struct spi_flash *spi_flash_probe_winbond(struct spi_slave *spi, u8 *idcode);

View File

@@ -281,7 +281,8 @@ int stmicro_erase(struct spi_flash *flash, u32 offset, size_t len)
ret = 0;
for (actual = 0; actual < len; actual++) {
cmd[1] = (offset / sector_size) + actual;
cmd[1] = offset >> 16;
offset += sector_size;
ret = spi_flash_cmd(flash->spi, CMD_M25PXX_WREN, NULL, 0);
if (ret < 0) {

332
drivers/mtd/spi/winbond.c Normal file
View File

@@ -0,0 +1,332 @@
/*
* Copyright 2008, Network Appliance Inc.
* Author: Jason McMullan <mcmullan <at> netapp.com>
* Licensed under the GPL-2 or later.
*/
#include <common.h>
#include <malloc.h>
#include <spi_flash.h>
#include "spi_flash_internal.h"
/* M25Pxx-specific commands */
#define CMD_W25_WREN 0x06 /* Write Enable */
#define CMD_W25_WRDI 0x04 /* Write Disable */
#define CMD_W25_RDSR 0x05 /* Read Status Register */
#define CMD_W25_WRSR 0x01 /* Write Status Register */
#define CMD_W25_READ 0x03 /* Read Data Bytes */
#define CMD_W25_FAST_READ 0x0b /* Read Data Bytes at Higher Speed */
#define CMD_W25_PP 0x02 /* Page Program */
#define CMD_W25_SE 0x20 /* Sector (4K) Erase */
#define CMD_W25_BE 0xd8 /* Block (64K) Erase */
#define CMD_W25_CE 0xc7 /* Chip Erase */
#define CMD_W25_DP 0xb9 /* Deep Power-down */
#define CMD_W25_RES 0xab /* Release from DP, and Read Signature */
#define WINBOND_ID_W25X16 0x3015
#define WINBOND_ID_W25X32 0x3016
#define WINBOND_ID_W25X64 0x3017
#define WINBOND_SR_WIP (1 << 0) /* Write-in-Progress */
struct winbond_spi_flash_params {
uint16_t id;
/* Log2 of page size in power-of-two mode */
uint8_t l2_page_size;
uint16_t pages_per_sector;
uint16_t sectors_per_block;
uint8_t nr_blocks;
const char *name;
};
/* spi_flash needs to be first so upper layers can free() it */
struct winbond_spi_flash {
struct spi_flash flash;
const struct winbond_spi_flash_params *params;
};
static inline struct winbond_spi_flash *
to_winbond_spi_flash(struct spi_flash *flash)
{
return container_of(flash, struct winbond_spi_flash, flash);
}
static const struct winbond_spi_flash_params winbond_spi_flash_table[] = {
{
.id = WINBOND_ID_W25X16,
.l2_page_size = 8,
.pages_per_sector = 16,
.sectors_per_block = 16,
.nr_blocks = 32,
.name = "W25X16",
},
{
.id = WINBOND_ID_W25X32,
.l2_page_size = 8,
.pages_per_sector = 16,
.sectors_per_block = 16,
.nr_blocks = 64,
.name = "W25X32",
},
{
.id = WINBOND_ID_W25X64,
.l2_page_size = 8,
.pages_per_sector = 16,
.sectors_per_block = 16,
.nr_blocks = 128,
.name = "W25X64",
},
};
static int winbond_wait_ready(struct spi_flash *flash, unsigned long timeout)
{
struct spi_slave *spi = flash->spi;
unsigned long timebase;
int ret;
u8 status;
u8 cmd[4] = { CMD_W25_RDSR, 0xff, 0xff, 0xff };
ret = spi_xfer(spi, 32, &cmd[0], NULL, SPI_XFER_BEGIN);
if (ret) {
debug("SF: Failed to send command %02x: %d\n", cmd, ret);
return ret;
}
timebase = get_timer(0);
do {
ret = spi_xfer(spi, 8, NULL, &status, 0);
if (ret) {
debug("SF: Failed to get status for cmd %02x: %d\n", cmd, ret);
return -1;
}
if ((status & WINBOND_SR_WIP) == 0)
break;
} while (get_timer(timebase) < timeout);
spi_xfer(spi, 0, NULL, NULL, SPI_XFER_END);
if ((status & WINBOND_SR_WIP) == 0)
return 0;
debug("SF: Timed out on command %02x: %d\n", cmd, ret);
/* Timed out */
return -1;
}
/*
* Assemble the address part of a command for Winbond devices in
* non-power-of-two page size mode.
*/
static void winbond_build_address(struct winbond_spi_flash *stm, u8 *cmd, u32 offset)
{
unsigned long page_addr;
unsigned long byte_addr;
unsigned long page_size;
unsigned int page_shift;
/*
* The "extra" space per page is the power-of-two page size
* divided by 32.
*/
page_shift = stm->params->l2_page_size;
page_size = (1 << page_shift);
page_addr = offset / page_size;
byte_addr = offset % page_size;
cmd[0] = page_addr >> (16 - page_shift);
cmd[1] = page_addr << (page_shift - 8) | (byte_addr >> 8);
cmd[2] = byte_addr;
}
static int winbond_read_fast(struct spi_flash *flash,
u32 offset, size_t len, void *buf)
{
struct winbond_spi_flash *stm = to_winbond_spi_flash(flash);
u8 cmd[5];
cmd[0] = CMD_READ_ARRAY_FAST;
winbond_build_address(stm, cmd + 1, offset);
cmd[4] = 0x00;
return spi_flash_read_common(flash, cmd, sizeof(cmd), buf, len);
}
static int winbond_write(struct spi_flash *flash,
u32 offset, size_t len, const void *buf)
{
struct winbond_spi_flash *stm = to_winbond_spi_flash(flash);
unsigned long page_addr;
unsigned long byte_addr;
unsigned long page_size;
unsigned int page_shift;
size_t chunk_len;
size_t actual;
int ret;
u8 cmd[4];
page_shift = stm->params->l2_page_size;
page_size = (1 << page_shift);
page_addr = offset / page_size;
byte_addr = offset % page_size;
ret = spi_claim_bus(flash->spi);
if (ret) {
debug("SF: Unable to claim SPI bus\n");
return ret;
}
for (actual = 0; actual < len; actual += chunk_len) {
chunk_len = min(len - actual, page_size - byte_addr);
cmd[0] = CMD_W25_PP;
cmd[1] = page_addr >> (16 - page_shift);
cmd[2] = page_addr << (page_shift - 8) | (byte_addr >> 8);
cmd[3] = byte_addr;
debug("PP: 0x%p => cmd = { 0x%02x 0x%02x%02x%02x } chunk_len = %d\n",
buf + actual,
cmd[0], cmd[1], cmd[2], cmd[3], chunk_len);
ret = spi_flash_cmd(flash->spi, CMD_W25_WREN, NULL, 0);
if (ret < 0) {
debug("SF: Enabling Write failed\n");
goto out;
}
ret = spi_flash_cmd_write(flash->spi, cmd, 4,
buf + actual, chunk_len);
if (ret < 0) {
debug("SF: Winbond Page Program failed\n");
goto out;
}
ret = winbond_wait_ready(flash, SPI_FLASH_PROG_TIMEOUT);
if (ret < 0) {
debug("SF: Winbond page programming timed out\n");
goto out;
}
page_addr++;
byte_addr = 0;
}
debug("SF: Winbond: Successfully programmed %u bytes @ 0x%x\n",
len, offset);
ret = 0;
out:
spi_release_bus(flash->spi);
return ret;
}
int winbond_erase(struct spi_flash *flash, u32 offset, size_t len)
{
struct winbond_spi_flash *stm = to_winbond_spi_flash(flash);
unsigned long sector_size;
unsigned int page_shift;
size_t actual;
int ret;
u8 cmd[4];
/*
* This function currently uses sector erase only.
* probably speed things up by using bulk erase
* when possible.
*/
page_shift = stm->params->l2_page_size;
sector_size = (1 << page_shift) * stm->params->pages_per_sector;
if (offset % sector_size || len % sector_size) {
debug("SF: Erase offset/length not multiple of sector size\n");
return -1;
}
len /= sector_size;
cmd[0] = CMD_W25_SE;
ret = spi_claim_bus(flash->spi);
if (ret) {
debug("SF: Unable to claim SPI bus\n");
return ret;
}
for (actual = 0; actual < len; actual++) {
winbond_build_address(stm, &cmd[1], offset + actual * sector_size);
printf("Erase: %02x %02x %02x %02x\n",
cmd[0], cmd[1], cmd[2], cmd[3]);
ret = spi_flash_cmd(flash->spi, CMD_W25_WREN, NULL, 0);
if (ret < 0) {
debug("SF: Enabling Write failed\n");
goto out;
}
ret = spi_flash_cmd_write(flash->spi, cmd, 4, NULL, 0);
if (ret < 0) {
debug("SF: Winbond sector erase failed\n");
goto out;
}
ret = winbond_wait_ready(flash, SPI_FLASH_PAGE_ERASE_TIMEOUT);
if (ret < 0) {
debug("SF: Winbond sector erase timed out\n");
goto out;
}
}
debug("SF: Winbond: Successfully erased %u bytes @ 0x%x\n",
len * sector_size, offset);
ret = 0;
out:
spi_release_bus(flash->spi);
return ret;
}
struct spi_flash *spi_flash_probe_winbond(struct spi_slave *spi, u8 *idcode)
{
const struct winbond_spi_flash_params *params;
unsigned long page_size;
struct winbond_spi_flash *stm;
unsigned int i;
for (i = 0; i < ARRAY_SIZE(winbond_spi_flash_table); i++) {
params = &winbond_spi_flash_table[i];
if (params->id == ((idcode[1] << 8) | idcode[2]))
break;
}
if (i == ARRAY_SIZE(winbond_spi_flash_table)) {
debug("SF: Unsupported Winbond ID %02x%02x\n",
idcode[1], idcode[2]);
return NULL;
}
stm = malloc(sizeof(struct winbond_spi_flash));
if (!stm) {
debug("SF: Failed to allocate memory\n");
return NULL;
}
stm->params = params;
stm->flash.spi = spi;
stm->flash.name = params->name;
/* Assuming power-of-two page size initially. */
page_size = 1 << params->l2_page_size;
stm->flash.write = winbond_write;
stm->flash.erase = winbond_erase;
stm->flash.read = winbond_read_fast;
stm->flash.size = page_size * params->pages_per_sector
* params->sectors_per_block
* params->nr_blocks;
debug("SF: Detected %s with page size %u, total %u bytes\n",
params->name, page_size, stm->flash.size);
return &stm->flash;
}

View File

@@ -56,7 +56,7 @@
#define REG_READ(a) readl((a))
/* we don't need 16 bit initialisation on 32 bit bus */
#define get_reg_init_bus(x) get_reg((x))
#define get_reg_init_bus(r,d) get_reg((r),(d))
#else
@@ -321,15 +321,16 @@ int cs8900_initialize(u8 dev_num, int base_addr)
memset(priv, 0, sizeof(*priv));
priv->regs = (struct cs8900_regs *)base_addr;
/* Load MAC address from EEPROM */
cs8900_get_enetaddr(dev);
dev->iobase = base_addr;
dev->priv = priv;
dev->init = cs8900_init;
dev->halt = cs8900_halt;
dev->send = cs8900_send;
dev->recv = cs8900_recv;
/* Load MAC address from EEPROM */
cs8900_get_enetaddr(dev);
sprintf(dev->name, "%s-%hu", CS8900_DRIVERNAME, dev_num);
eth_register(dev);

View File

@@ -284,7 +284,6 @@ static int dm9000_init(struct eth_device *dev, bd_t *bd)
int i, oft, lnk;
u8 io_mode;
struct board_info *db = &dm9000_info;
uchar enetaddr[6];
DM9000_DBG("%s\n", __func__);
@@ -342,20 +341,11 @@ static int dm9000_init(struct eth_device *dev, bd_t *bd)
/* Clear interrupt status */
DM9000_iow(DM9000_ISR, ISR_ROOS | ISR_ROS | ISR_PTS | ISR_PRS);
/* Set Node address */
if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
#if !defined(CONFIG_DM9000_NO_SROM)
for (i = 0; i < 3; i++)
dm9000_read_srom_word(i, enetaddr + 2 * i);
eth_setenv_enetaddr("ethaddr", enetaddr);
#endif
}
printf("MAC: %pM\n", enetaddr);
printf("MAC: %pM\n", dev->enetaddr);
/* fill device MAC address registers */
for (i = 0, oft = DM9000_PAR; i < 6; i++, oft++)
DM9000_iow(oft, enetaddr[i]);
DM9000_iow(oft, dev->enetaddr[i]);
for (i = 0, oft = 0x16; i < 8; i++, oft++)
DM9000_iow(oft, 0xff);
@@ -558,6 +548,15 @@ void dm9000_write_srom_word(int offset, u16 val)
}
#endif
static void dm9000_get_enetaddr(struct eth_device *dev)
{
#if !defined(CONFIG_DM9000_NO_SROM)
int i;
for (i = 0; i < 3; i++)
dm9000_read_srom_word(i, dev->enetaddr + (2 * i));
#endif
}
/*
Read a byte from I/O port
*/
@@ -621,6 +620,9 @@ int dm9000_initialize(bd_t *bis)
{
struct eth_device *dev = &(dm9000_info.netdev);
/* Load MAC address from EEPROM */
dm9000_get_enetaddr(dev);
dev->init = dm9000_init;
dev->halt = dm9000_halt;
dev->send = dm9000_send;

View File

@@ -55,6 +55,8 @@ struct fec_priv gfec = {
.tbd_base = NULL,
.tbd_index = 0,
.bd = NULL,
.rdb_ptr = NULL,
.base_ptr = NULL,
};
/*
@@ -157,7 +159,9 @@ static int miiphy_restart_aneg(struct eth_device *dev)
/*
* Set the auto-negotiation advertisement register bits
*/
miiphy_write(dev->name, CONFIG_FEC_MXC_PHYADDR, PHY_ANAR, 0x1e0);
miiphy_write(dev->name, CONFIG_FEC_MXC_PHYADDR, PHY_ANAR,
PHY_ANLPAR_TXFD | PHY_ANLPAR_TX | PHY_ANLPAR_10FD |
PHY_ANLPAR_10 | PHY_ANLPAR_PSB_802_3);
miiphy_write(dev->name, CONFIG_FEC_MXC_PHYADDR, PHY_BMCR,
PHY_BMCR_AUTON | PHY_BMCR_RST_NEG);
@@ -228,7 +232,8 @@ static int fec_rbd_init(struct fec_priv *fec, int count, int size)
uint32_t p = 0;
/* reserve data memory and consider alignment */
fec->rdb_ptr = malloc(size * count + DB_DATA_ALIGNMENT);
if (fec->rdb_ptr == NULL)
fec->rdb_ptr = malloc(size * count + DB_DATA_ALIGNMENT);
p = (uint32_t)fec->rdb_ptr;
if (!p) {
puts("fec_imx27: not enough malloc memory!\n");
@@ -341,8 +346,8 @@ static int fec_open(struct eth_device *edev)
writel(FEC_ECNTRL_ETHER_EN, &fec->eth->ecntrl);
miiphy_wait_aneg(edev);
miiphy_speed(edev->name, 0);
miiphy_duplex(edev->name, 0);
miiphy_speed(edev->name, CONFIG_FEC_MXC_PHYADDR);
miiphy_duplex(edev->name, CONFIG_FEC_MXC_PHYADDR);
/*
* Enable SmartDMA receive task
@@ -363,8 +368,9 @@ static int fec_init(struct eth_device *dev, bd_t* bd)
* Datasheet forces the startaddress of each chain is 16 byte
* aligned
*/
fec->base_ptr = malloc((2 + FEC_RBD_NUM) *
sizeof(struct fec_bd) + DB_ALIGNMENT);
if (fec->base_ptr == NULL)
fec->base_ptr = malloc((2 + FEC_RBD_NUM) *
sizeof(struct fec_bd) + DB_ALIGNMENT);
base = (uint32_t)fec->base_ptr;
if (!base) {
puts("fec_imx27: not enough malloc memory!\n");
@@ -491,8 +497,6 @@ static void fec_halt(struct eth_device *dev)
writel(0, &fec->eth->ecntrl);
fec->rbd_index = 0;
fec->tbd_index = 0;
free(fec->rdb_ptr);
free(fec->base_ptr);
debug("eth_halt: done\n");
}

View File

@@ -81,10 +81,10 @@ struct smc91111_priv{
#ifdef CONFIG_PXA250
#ifdef CONFIG_XSENGINE
#define SMC_inl(a,r) (*((volatile dword *)((a)->iobase+(r<<1))))
#define SMC_inw(a,r) (*((volatile word *)((a)->iobase+(r<<1))))
#define SMC_inl(a,r) (*((volatile dword *)((a)->iobase+((r)<<1))))
#define SMC_inw(a,r) (*((volatile word *)((a)->iobase+((r)<<1))))
#define SMC_inb(a,p) ({ \
unsigned int __p = (unsigned int)((a)->iobase + (p<<1)); \
unsigned int __p = (unsigned int)((a)->iobase + ((p)<<1)); \
unsigned int __v = *(volatile unsigned short *)((__p) & ~2); \
if (__p & 2) __v >>= 8; \
else __v &= 0xff; \
@@ -99,7 +99,7 @@ struct smc91111_priv{
__v; })
#define SMC_inb(a,p) ({ \
unsigned int ___v = SMC_inw((a),(p) & ~1); \
if (p & 1) ___v >>= 8; \
if ((p) & 1) ___v >>= 8; \
else ___v &= 0xff; \
___v; })
#else

View File

@@ -37,7 +37,7 @@ void pkt_data_push(struct eth_device *dev, u32 addr, u32 val) \
#define mdelay(n) udelay((n)*1000)
static void smx911x_handle_mac_address(struct eth_device *dev)
static void smc911x_handle_mac_address(struct eth_device *dev)
{
unsigned long addrh, addrl;
uchar *m = dev->enetaddr;
@@ -155,7 +155,7 @@ static int smc911x_init(struct eth_device *dev, bd_t * bd)
/* Configure the PHY, initialize the link state */
smc911x_phy_configure(dev);
smx911x_handle_mac_address(dev);
smc911x_handle_mac_address(dev);
/* Turn on Tx + Rx */
smc911x_enable(dev);
@@ -243,7 +243,7 @@ int smc911x_initialize(u8 dev_num, int base_addr)
dev = malloc(sizeof(*dev));
if (!dev) {
free(dev);
return 0;
return -1;
}
memset(dev, 0, sizeof(*dev));
@@ -271,5 +271,5 @@ int smc911x_initialize(u8 dev_num, int base_addr)
sprintf(dev->name, "%s-%hu", DRIVERNAME, dev_num);
eth_register(dev);
return 0;
return 1;
}

View File

@@ -42,6 +42,7 @@ DECLARE_GLOBAL_DATA_PTR;
#define FSL_PCI_PBFR 0x44
#define FSL_PCIE_CAP_ID 0x4c
#define FSL_PCIE_CFG_RDY 0x4b0
#define FSL_PROG_IF_AGENT 0x1
void pciauto_prescan_setup_bridge(struct pci_controller *hose,
pci_dev_t dev, int sub_bus);
@@ -412,28 +413,24 @@ void fsl_pci_init(struct pci_controller *hose, u32 cfg_addr, u32 cfg_data)
}
}
int fsl_is_pci_agent(struct pci_controller *hose)
{
u8 prog_if;
pci_dev_t dev = PCI_BDF(hose->first_busno, 0, 0);
pci_hose_read_config_byte(hose, dev, PCI_CLASS_PROG, &prog_if);
return (prog_if == FSL_PROG_IF_AGENT);
}
int fsl_pci_init_port(struct fsl_pci_info *pci_info,
struct pci_controller *hose, int busno, int pcie_ep)
struct pci_controller *hose, int busno)
{
volatile ccsr_fsl_pci_t *pci;
struct pci_region *r;
pci = (ccsr_fsl_pci_t *) pci_info->regs;
if (pcie_ep) {
volatile pit_t *pi = &pci->pit[2];
pci_setup_indirect(hose, (u32)&pci->cfg_addr,
(u32)&pci->cfg_data);
out_be32(&pi->pitar, 0);
out_be32(&pi->piwbar, 0);
out_be32(&pi->piwar, PIWAR_EN | PIWAR_LOCAL |
PIWAR_READ_SNOOP | PIWAR_WRITE_SNOOP | PIWAR_IWS_4K);
fsl_pci_config_unlock(hose);
return 0;
}
/* on non-PCIe controllers we don't have pme_msg_det so this code
* should do nothing since the read will return 0
*/
@@ -464,6 +461,11 @@ int fsl_pci_init_port(struct fsl_pci_info *pci_info,
fsl_pci_init(hose, (u32)&pci->cfg_addr, (u32)&pci->cfg_data);
if (fsl_is_pci_agent(hose)) {
fsl_pci_config_unlock(hose);
hose->last_busno = hose->first_busno;
}
printf(" PCIE%x on bus %02x - %02x\n", pci_info->pci_num,
hose->first_busno, hose->last_busno);

View File

@@ -40,6 +40,7 @@ COBJS-$(CONFIG_RTC_DS1556) += ds1556.o
COBJS-$(CONFIG_RTC_DS164x) += ds164x.o
COBJS-$(CONFIG_RTC_DS174x) += ds174x.o
COBJS-$(CONFIG_RTC_DS3231) += ds3231.o
COBJS-$(CONFIG_RTC_FTRTC010) += ftrtc010.o
COBJS-$(CONFIG_RTC_ISL1208) += isl1208.o
COBJS-$(CONFIG_RTC_M41T11) += m41t11.o
COBJS-$(CONFIG_RTC_M41T60) += m41t60.o

124
drivers/rtc/ftrtc010.c Normal file
View File

@@ -0,0 +1,124 @@
/*
* Faraday FTRTC010 Real Time Clock
*
* (C) Copyright 2009 Faraday Technology
* Po-Yu Chuang <ratbert@faraday-tech.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <config.h>
#include <common.h>
#include <rtc.h>
#include <asm/io.h>
struct ftrtc010 {
unsigned int sec; /* 0x00 */
unsigned int min; /* 0x04 */
unsigned int hour; /* 0x08 */
unsigned int day; /* 0x0c */
unsigned int alarm_sec; /* 0x10 */
unsigned int alarm_min; /* 0x14 */
unsigned int alarm_hour; /* 0x18 */
unsigned int record; /* 0x1c */
unsigned int cr; /* 0x20 */
};
/*
* RTC Control Register
*/
#define FTRTC010_CR_ENABLE (1 << 0)
#define FTRTC010_CR_INTERRUPT_SEC (1 << 1) /* per second irq */
#define FTRTC010_CR_INTERRUPT_MIN (1 << 2) /* per minute irq */
#define FTRTC010_CR_INTERRUPT_HR (1 << 3) /* per hour irq */
#define FTRTC010_CR_INTERRUPT_DAY (1 << 4) /* per day irq */
static struct ftrtc010 *rtc = (struct ftrtc010 *)CONFIG_FTRTC010_BASE;
static void ftrtc010_enable (void)
{
writel (FTRTC010_CR_ENABLE, &rtc->cr);
}
/*
* return current time in seconds
*/
static unsigned long ftrtc010_time (void)
{
unsigned long day;
unsigned long hour;
unsigned long minute;
unsigned long second;
unsigned long second2;
do {
second = readl (&rtc->sec);
day = readl (&rtc->day);
hour = readl (&rtc->hour);
minute = readl (&rtc->min);
second2 = readl (&rtc->sec);
} while (second != second2);
return day * 24 * 60 * 60 + hour * 60 * 60 + minute * 60 + second;
}
/*
* Get the current time from the RTC
*/
int rtc_get (struct rtc_time *tmp)
{
unsigned long now;
debug ("%s(): record register: %x\n",
__func__, readl (&rtc->record));
now = ftrtc010_time () + readl (&rtc->record);
to_tm (now, tmp);
return 0;
}
/*
* Set the RTC
*/
int rtc_set (struct rtc_time *tmp)
{
unsigned long new;
unsigned long now;
debug ("%s(): DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n",
__func__,
tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
new = mktime (tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_hour,
tmp->tm_min, tmp->tm_sec);
now = ftrtc010_time ();
debug ("%s(): write %lx to record register\n", __func__, new - now);
writel (new - now, &rtc->record);
return 0;
}
void rtc_reset (void)
{
debug ("%s()\n", __func__);
ftrtc010_enable ();
}

View File

@@ -181,18 +181,4 @@ void rtc_reset (void)
val = val & 0x3F;/*turn off freq test keep calibration*/
i2c_write(CONFIG_SYS_I2C_RTC_ADDR, RTC_CONTROL_ADDR, 1, &val, 1);
}
int rtc_store(int addr, unsigned char* data, int size)
{
/*don't let things wrap onto the time on a write*/
if( (addr+size) >= M41T11_STORAGE_SZ )
return 1;
return i2c_write( CONFIG_SYS_I2C_RTC_ADDR, REG_CNT+addr, 1, data, size );
}
int rtc_recall(int addr, unsigned char* data, int size)
{
return i2c_read( CONFIG_SYS_I2C_RTC_ADDR, REG_CNT+addr, 1, data, size );
}
#endif

View File

@@ -109,7 +109,7 @@ int rtc_set(struct rtc_time *rtc)
spi_release_bus(slave);
return -1;
return 0;
}
void rtc_reset(void)

View File

@@ -30,7 +30,8 @@
#include <dataflash.h>
#define AT91_SPI_PCS0_DATAFLASH_CARD 0xE /* Chip Select 0: NPCS0%1110 */
#define AT91_SPI_PCS1_DATAFLASH_CARD 0xD /* Chip Select 0: NPCS0%1101 */
#define AT91_SPI_PCS1_DATAFLASH_CARD 0xD /* Chip Select 1: NPCS1%1101 */
#define AT91_SPI_PCS2_DATAFLASH_CARD 0xB /* Chip Select 2: NPCS2%1011 */
#define AT91_SPI_PCS3_DATAFLASH_CARD 0x7 /* Chip Select 3: NPCS3%0111 */
void AT91F_SpiInit(void)
@@ -57,7 +58,14 @@ void AT91F_SpiInit(void)
((get_mck_clk_rate() / AT91_SPI_CLK) << 8),
AT91_BASE_SPI + AT91_SPI_CSR(1));
#endif
#ifdef CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS2
/* Configure CS2 */
writel(AT91_SPI_NCPHA |
(AT91_SPI_DLYBS & DATAFLASH_TCSS) |
(AT91_SPI_DLYBCT & DATAFLASH_TCHS) |
((get_mck_clk_rate() / AT91_SPI_CLK) << 8),
AT91_BASE_SPI + AT91_SPI_CSR(2));
#endif
#ifdef CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS3
/* Configure CS3 */
writel(AT91_SPI_NCPHA |
@@ -99,6 +107,12 @@ void AT91F_SpiEnable(int cs)
writel(mode | ((AT91_SPI_PCS1_DATAFLASH_CARD<<16) & AT91_SPI_PCS),
AT91_BASE_SPI + AT91_SPI_MR);
break;
case 2: /* Configure SPI CS2 for Serial DataFlash AT45DBxx */
mode = readl(AT91_BASE_SPI + AT91_SPI_MR);
mode &= 0xFFF0FFFF;
writel(mode | ((AT91_SPI_PCS2_DATAFLASH_CARD<<16) & AT91_SPI_PCS),
AT91_BASE_SPI + AT91_SPI_MR);
break;
case 3:
mode = readl(AT91_BASE_SPI + AT91_SPI_MR);
mode &= 0xFFF0FFFF;

View File

@@ -38,7 +38,13 @@ ELF-mpc8260 += mem_to_mem_idma2intr
ELF-ppc += sched
ELF-oxc += eepro100_eeprom
ELF := $(ELF-y) $(ELF-$(ARCH)) $(ELF-$(BOARD)) $(ELF-$(CPU))
#
# Some versions of make do not handle trailing white spaces properly;
# leading to build failures. The problem was found with GNU Make 3.80.
# Using 'strip' as a workaround for the problem.
#
ELF := $(strip $(ELF-y) $(ELF-$(ARCH)) $(ELF-$(BOARD)) $(ELF-$(CPU)))
SREC = $(addsuffix .srec,$(ELF))
BIN = $(addsuffix .bin,$(ELF))

View File

@@ -1,133 +0,0 @@
/*
* (C) Copyright 2004, Psyent Corporation <www.psyent.com>
* Scott McNutt <smcnutt@psyent.com>
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
OUTPUT_FORMAT("elf32-littlenios2")
OUTPUT_ARCH(nios2)
ENTRY(_start)
SECTIONS
{
.text :
{
*(.text)
*(.text.*)
*(.gnu.linkonce.t*)
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
*(.gnu.linkonce.r*)
}
. = ALIGN (4);
_etext = .;
PROVIDE (etext = .);
/* INIT DATA sections - "Small" data (see the gcc -G option)
* is always gp-relative. Here we make all init data sections
* adjacent to simplify the startup code -- and provide
* the global pointer for gp-relative access.
*/
_data = .;
.data :
{
*(.data)
*(.data.*)
*(.gnu.linkonce.d*)
}
. = ALIGN(16);
_gp = .; /* Global pointer addr */
PROVIDE (gp = .);
.sdata :
{
*(.sdata)
*(.sdata.*)
*(.gnu.linkonce.s.*)
}
. = ALIGN(4);
_edata = .;
PROVIDE (edata = .);
/* UNINIT DATA - Small uninitialized data is first so it's
* adjacent to sdata and can be referenced via gp. The normal
* bss follows. We keep it adjacent to simplify init code.
*/
__bss_start = .;
.sbss (NOLOAD) :
{
*(.sbss)
*(.sbss.*)
*(.gnu.linkonce.sb.*)
*(.scommon)
}
. = ALIGN(4);
.bss (NOLOAD) :
{
*(.bss)
*(.bss.*)
*(.dynbss)
*(COMMON)
*(.scommon)
}
. = ALIGN(4);
_end = .;
PROVIDE (end = .);
/* CMD TABLE - uboot command sections
*/
. = .;
__uboot_cmd_start = .;
.u_boot_cmd :
{
*(.u_boot_cmd)
}
. = ALIGN(4);
__u_boot_cmd_end = .;
/* DEBUG -- symbol table, string table, etc. etc.
*/
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
.debug_info 0 : { *(.debug_info) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
}

View File

@@ -33,8 +33,6 @@
struct eth_device { unsigned long iobase; };
#include "../drivers/net/smc91111.h"
#ifdef CONFIG_SMC91111
#ifndef SMC91111_EEPROM_INIT
# define SMC91111_EEPROM_INIT()
#endif
@@ -391,13 +389,3 @@ void dump_reg (struct eth_device *dev)
printf ("\n");
}
}
#else
int smc91111_eeprom (int argc, char *argv[])
{
printf("Not supported for this board\n");
return 1;
}
#endif

View File

@@ -2,7 +2,7 @@
* smc911x_eeprom.c - EEPROM interface to SMC911x parts.
* Only tested on SMSC9118 though ...
*
* Copyright 2004-2008 Analog Devices Inc.
* Copyright 2004-2009 Analog Devices Inc.
*
* Licensed under the GPL-2 or later.
*
@@ -17,8 +17,12 @@
#include <common.h>
#include <exports.h>
#ifdef CONFIG_DRIVER_SMC911X
/* the smc911x.h gets base addr through eth_device' iobase */
struct eth_device {
const char *name;
unsigned long iobase;
void *priv;
};
#include "../drivers/net/smc911x.h"
/**
@@ -55,32 +59,32 @@ static void usage(void)
* Registers 0x00 - 0x50 are FIFOs. The 0x50+ are the control registers
* and they're all 32bits long. 0xB8+ are reserved, so don't bother.
*/
static void dump_regs(void)
static void dump_regs(struct eth_device *dev)
{
u8 i, j = 0;
for (i = 0x50; i < 0xB8; i += sizeof(u32))
printf("%02x: 0x%08x %c", i,
smc911x_reg_read(CONFIG_DRIVER_SMC911X_BASE + i),
smc911x_reg_read(dev, i),
(j++ % 2 ? '\n' : ' '));
}
/**
* do_eeprom_cmd - handle eeprom communication
*/
static int do_eeprom_cmd(int cmd, u8 reg)
static int do_eeprom_cmd(struct eth_device *dev, int cmd, u8 reg)
{
if (smc911x_reg_read(E2P_CMD) & E2P_CMD_EPC_BUSY) {
if (smc911x_reg_read(dev, E2P_CMD) & E2P_CMD_EPC_BUSY) {
printf("eeprom_cmd: busy at start (E2P_CMD = 0x%08x)\n",
smc911x_reg_read(E2P_CMD));
smc911x_reg_read(dev, E2P_CMD));
return -1;
}
smc911x_reg_write(E2P_CMD, E2P_CMD_EPC_BUSY | cmd | reg);
smc911x_reg_write(dev, E2P_CMD, E2P_CMD_EPC_BUSY | cmd | reg);
while (smc911x_reg_read(E2P_CMD) & E2P_CMD_EPC_BUSY)
while (smc911x_reg_read(dev, E2P_CMD) & E2P_CMD_EPC_BUSY)
if (smsc_ctrlc()) {
printf("eeprom_cmd: timeout (E2P_CMD = 0x%08x)\n",
smc911x_reg_read(E2P_CMD));
smc911x_reg_read(dev, E2P_CMD));
return -1;
}
@@ -90,37 +94,37 @@ static int do_eeprom_cmd(int cmd, u8 reg)
/**
* read_eeprom_reg - read specified register in EEPROM
*/
static u8 read_eeprom_reg(u8 reg)
static u8 read_eeprom_reg(struct eth_device *dev, u8 reg)
{
int ret = do_eeprom_cmd(E2P_CMD_EPC_CMD_READ, reg);
return (ret ? : smc911x_reg_read(E2P_DATA));
int ret = do_eeprom_cmd(dev, E2P_CMD_EPC_CMD_READ, reg);
return (ret ? : smc911x_reg_read(dev, E2P_DATA));
}
/**
* write_eeprom_reg - write specified value into specified register in EEPROM
*/
static int write_eeprom_reg(u8 value, u8 reg)
static int write_eeprom_reg(struct eth_device *dev, u8 value, u8 reg)
{
int ret;
/* enable erasing/writing */
ret = do_eeprom_cmd(E2P_CMD_EPC_CMD_EWEN, reg);
ret = do_eeprom_cmd(dev, E2P_CMD_EPC_CMD_EWEN, reg);
if (ret)
goto done;
/* erase the eeprom reg */
ret = do_eeprom_cmd(E2P_CMD_EPC_CMD_ERASE, reg);
ret = do_eeprom_cmd(dev, E2P_CMD_EPC_CMD_ERASE, reg);
if (ret)
goto done;
/* write the eeprom reg */
smc911x_reg_write(E2P_DATA, value);
ret = do_eeprom_cmd(E2P_CMD_EPC_CMD_WRITE, reg);
smc911x_reg_write(dev, E2P_DATA, value);
ret = do_eeprom_cmd(dev, E2P_CMD_EPC_CMD_WRITE, reg);
if (ret)
goto done;
/* disable erasing/writing */
ret = do_eeprom_cmd(E2P_CMD_EPC_CMD_EWDS, reg);
ret = do_eeprom_cmd(dev, E2P_CMD_EPC_CMD_EWDS, reg);
done:
return ret;
@@ -139,7 +143,7 @@ static char *skip_space(char *buf)
/**
* write_stuff - handle writing of MAC registers / eeprom
*/
static void write_stuff(char *line)
static void write_stuff(struct eth_device *dev, char *line)
{
char dest;
char *endp;
@@ -182,39 +186,39 @@ static void write_stuff(char *line)
/* Finally, execute the command */
if (dest == 'E') {
printf("Writing EEPROM register %02x with %02x\n", reg, value);
write_eeprom_reg(value, reg);
write_eeprom_reg(dev, value, reg);
} else {
printf("Writing MAC register %02x with %08x\n", reg, value);
smc911x_reg_write(CONFIG_DRIVER_SMC911X_BASE + reg, value);
smc911x_reg_write(dev, reg, value);
}
}
/**
* copy_from_eeprom - copy MAC address in eeprom to address registers
*/
static void copy_from_eeprom(void)
static void copy_from_eeprom(struct eth_device *dev)
{
ulong addrl =
read_eeprom_reg(0x01) |
read_eeprom_reg(0x02) << 8 |
read_eeprom_reg(0x03) << 16 |
read_eeprom_reg(0x04) << 24;
read_eeprom_reg(dev, 0x01) |
read_eeprom_reg(dev, 0x02) << 8 |
read_eeprom_reg(dev, 0x03) << 16 |
read_eeprom_reg(dev, 0x04) << 24;
ulong addrh =
read_eeprom_reg(0x05) |
read_eeprom_reg(0x06) << 8;
smc911x_set_mac_csr(ADDRL, addrl);
smc911x_set_mac_csr(ADDRH, addrh);
read_eeprom_reg(dev, 0x05) |
read_eeprom_reg(dev, 0x06) << 8;
smc911x_set_mac_csr(dev, ADDRL, addrl);
smc911x_set_mac_csr(dev, ADDRH, addrh);
puts("EEPROM contents copied to MAC\n");
}
/**
* print_macaddr - print MAC address registers and MAC address in eeprom
*/
static void print_macaddr(void)
static void print_macaddr(struct eth_device *dev)
{
puts("Current MAC Address in MAC: ");
ulong addrl = smc911x_get_mac_csr(ADDRL);
ulong addrh = smc911x_get_mac_csr(ADDRH);
ulong addrl = smc911x_get_mac_csr(dev, ADDRL);
ulong addrh = smc911x_get_mac_csr(dev, ADDRH);
printf("%02x:%02x:%02x:%02x:%02x:%02x\n",
(u8)(addrl), (u8)(addrl >> 8), (u8)(addrl >> 16),
(u8)(addrl >> 24), (u8)(addrh), (u8)(addrh >> 8));
@@ -222,41 +226,42 @@ static void print_macaddr(void)
puts("Current MAC Address in EEPROM: ");
int i;
for (i = 1; i < 6; ++i)
printf("%02x:", read_eeprom_reg(i));
printf("%02x\n", read_eeprom_reg(i));
printf("%02x:", read_eeprom_reg(dev, i));
printf("%02x\n", read_eeprom_reg(dev, i));
}
/**
* dump_eeprom - dump the whole content of the EEPROM
*/
static void dump_eeprom(void)
static void dump_eeprom(struct eth_device *dev)
{
int i;
puts("EEPROM:\n");
for (i = 0; i < 7; ++i)
printf("%02x: 0x%02x\n", i, read_eeprom_reg(i));
printf("%02x: 0x%02x\n", i, read_eeprom_reg(dev, i));
}
/**
* smc911x_init - get the MAC/EEPROM up and ready for use
*/
static int smc911x_init(void)
static int smc911x_init(struct eth_device *dev)
{
/* See if there is anything there */
if (!smc911x_detect_chip())
if (!smc911x_detect_chip(dev))
return 1;
smc911x_reset();
smc911x_reset(dev);
/* Make sure we set EEDIO/EECLK to the EEPROM */
if (smc911x_reg_read(GPIO_CFG) & GPIO_CFG_EEPR_EN) {
while (smc911x_reg_read(E2P_CMD) & E2P_CMD_EPC_BUSY)
if (smc911x_reg_read(dev, GPIO_CFG) & GPIO_CFG_EEPR_EN) {
while (smc911x_reg_read(dev, E2P_CMD) & E2P_CMD_EPC_BUSY)
if (smsc_ctrlc()) {
printf("init: timeout (E2P_CMD = 0x%08x)\n",
smc911x_reg_read(E2P_CMD));
smc911x_reg_read(dev, E2P_CMD));
return 1;
}
smc911x_reg_write(GPIO_CFG, smc911x_reg_read(GPIO_CFG) & ~GPIO_CFG_EEPR_EN);
smc911x_reg_write(dev, GPIO_CFG,
smc911x_reg_read(dev, GPIO_CFG) & ~GPIO_CFG_EEPR_EN);
}
return 0;
@@ -317,6 +322,11 @@ static char *getline(void)
*/
int smc911x_eeprom(int argc, char *argv[])
{
/* Avoid initializing on stack as gcc likes to call memset() */
struct eth_device dev;
dev.name = __func__;
dev.iobase = CONFIG_SMC911X_BASE;
/* Print the ABI version */
app_startup(argv);
if (XF_VERSION != get_version()) {
@@ -328,7 +338,7 @@ int smc911x_eeprom(int argc, char *argv[])
/* Initialize the MAC/EEPROM somewhat */
puts("\n");
if (smc911x_init())
if (smc911x_init(&dev))
return 1;
/* Dump helpful usage information */
@@ -360,11 +370,11 @@ int smc911x_eeprom(int argc, char *argv[])
/* Now parse the command */
switch (line[0]) {
case 'W': write_stuff(line); break;
case 'D': dump_eeprom(); break;
case 'M': dump_regs(); break;
case 'C': copy_from_eeprom(); break;
case 'P': print_macaddr(); break;
case 'W': write_stuff(&dev, line); break;
case 'D': dump_eeprom(&dev); break;
case 'M': dump_regs(&dev); break;
case 'C': copy_from_eeprom(&dev); break;
case 'P': print_macaddr(&dev); break;
unknown_cmd:
default: puts("ERROR: Unknown command!\n\n");
case '?':
@@ -373,11 +383,3 @@ int smc911x_eeprom(int argc, char *argv[])
}
}
}
#else
int smc911x_eeprom(int argc, char *argv[])
{
puts("Not supported for this board\n");
return 1;
}
#endif

View File

@@ -181,9 +181,9 @@ gd_t *global_data;
" or %%g1, %%g7, %%g1\n" \
" ld [%%g1], %%g1\n" \
" ld [%%g1 + %1], %%g1\n" \
" call %%g1\n" \
" jmp %%g1\n" \
" nop\n" \
: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x) : "g1" );
: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "g1" );
#else
#error stubs definition missing for this architecture

View File

@@ -178,6 +178,7 @@ int indir1_blkno = -1;
uint32_t *indir2_block = NULL;
int indir2_size = 0;
int indir2_blkno = -1;
static unsigned int inode_size;
static int ext2fs_blockgroup
@@ -212,7 +213,7 @@ static int ext2fs_read_inode
unsigned int blkoff;
#ifdef DEBUG
printf ("ext2fs read inode %d\n", ino);
printf ("ext2fs read inode %d, inode_size %d\n", ino, inode_size);
#endif
/* It is easier to calculate if the first inode is 0. */
ino--;
@@ -222,16 +223,12 @@ static int ext2fs_read_inode
return (0);
}
inodes_per_block = EXT2_BLOCK_SIZE(data) / __le16_to_cpu(sblock->inode_size);
#ifdef DEBUG
printf ("ext2fs read inode blkno %d blkoff %d\n", blkno, blkoff);
#endif
inodes_per_block = EXT2_BLOCK_SIZE(data) / inode_size;
blkno = __le32_to_cpu (blkgrp.inode_table_id) +
(ino % __le32_to_cpu (sblock->inodes_per_group))
/ inodes_per_block;
blkoff = (ino % inodes_per_block) * __le16_to_cpu (sblock->inode_size);
blkoff = (ino % inodes_per_block) * inode_size;
#ifdef DEBUG
printf ("ext2fs read inode blkno %d blkoff %d\n", blkno, blkoff);
#endif
@@ -863,6 +860,15 @@ int ext2fs_mount (unsigned part_length) {
if (__le16_to_cpu (data->sblock.magic) != EXT2_MAGIC) {
goto fail;
}
if (__le32_to_cpu(data->sblock.revision_level == 0)) {
inode_size = 128;
} else {
inode_size = __le16_to_cpu(data->sblock.inode_size);
}
#ifdef DEBUG
printf("EXT2 rev %d, inode_size %d\n",
__le32_to_cpu(data->sblock.revision_level), inode_size);
#endif
data->diropen.data = data;
data->diropen.ino = 2;
data->diropen.inode_read = 1;

View File

@@ -1,7 +1,8 @@
#ifndef _ASM_ARM_UNALIGNED_H
#define _ASM_ARM_UNALIGNED_H
#include <linux/unaligned/access_ok.h>
#include <linux/unaligned/le_byteshift.h>
#include <linux/unaligned/be_byteshift.h>
#include <linux/unaligned/generic.h>
/*

View File

@@ -266,8 +266,6 @@ found_middle:
return result + ffz(tmp);
}
#define ffs(x) generic_ffs(x)
/*
* hweightN: returns the hamming weight (i.e. the number
* of bits set) of a N-bit word

View File

@@ -25,6 +25,7 @@
int is_fsl_pci_agent(enum law_trgt_if trgt, u32 host_agent);
int is_fsl_pci_cfg(enum law_trgt_if trgt, u32 io_sel);
int fsl_is_pci_agent(struct pci_controller *hose);
void fsl_pci_init(struct pci_controller *hose, u32 cfg_addr, u32 cfg_data);
void fsl_pci_config_unlock(struct pci_controller *hose);
void ft_fsl_pci_setup(void *blob, const char *pci_alias,
@@ -62,7 +63,6 @@ typedef struct pci_inbound_window {
#define PIWAR_LOCAL 0x00f00000
#define PIWAR_READ_SNOOP 0x00050000
#define PIWAR_WRITE_SNOOP 0x00005000
#define PIWAR_IWS_4K 0x0000000b
u32 res2[3];
} pit_t;
@@ -172,7 +172,7 @@ struct fsl_pci_info {
};
int fsl_pci_init_port(struct fsl_pci_info *pci_info,
struct pci_controller *hose, int busno, int pcie_ep);
struct pci_controller *hose, int busno);
#define SET_STD_PCI_INFO(x, num) \
{ \

View File

@@ -70,13 +70,6 @@
#define CONFIG_TSEC_ENET /* tsec ethernet support */
#define CONFIG_ENV_OVERWRITE
/*
* When initializing flash, if we cannot find the manufacturer ID,
* assume this is the AMD flash associated with the CDS board.
* This allows booting from a promjet.
*/
#define CONFIG_ASSUME_AMD_FLASH
#ifndef __ASSEMBLY__
extern unsigned long get_board_sys_clk(unsigned long dummy);
extern unsigned long get_board_ddr_clk(unsigned long dummy);

View File

@@ -46,13 +46,6 @@
#define CONFIG_FSL_VIA
/*
* When initializing flash, if we cannot find the manufacturer ID,
* assume this is the AMD flash associated with the CDS board.
* This allows booting from a promjet.
*/
#define CONFIG_ASSUME_AMD_FLASH
#ifndef __ASSEMBLY__
extern unsigned long get_clock_freq(void);
#endif

View File

@@ -50,13 +50,6 @@
#define CONFIG_ENV_OVERWRITE
#define CONFIG_INTERRUPTS /* enable pci, srio, ddr interrupts */
/*
* When initializing flash, if we cannot find the manufacturer ID,
* assume this is the AMD flash associated with the CDS board.
* This allows booting from a promjet.
*/
#define CONFIG_ASSUME_AMD_FLASH
#ifndef __ASSEMBLY__
extern unsigned long get_board_sys_clk(unsigned long dummy);
#endif

View File

@@ -52,13 +52,6 @@
#define CONFIG_FSL_VIA
/*
* When initializing flash, if we cannot find the manufacturer ID,
* assume this is the AMD flash associated with the CDS board.
* This allows booting from a promjet.
*/
#define CONFIG_ASSUME_AMD_FLASH
#ifndef __ASSEMBLY__
extern unsigned long get_clock_freq(void);
#endif

View File

@@ -46,13 +46,6 @@
#define CONFIG_FSL_VIA
/*
* When initializing flash, if we cannot find the manufacturer ID,
* assume this is the AMD flash associated with the CDS board.
* This allows booting from a promjet.
*/
#define CONFIG_ASSUME_AMD_FLASH
#ifndef __ASSEMBLY__
extern unsigned long get_clock_freq(void);
#endif

View File

@@ -44,13 +44,6 @@
#define CONFIG_ENV_OVERWRITE
#define CONFIG_FSL_LAW 1 /* Use common FSL init code */
/*
* When initializing flash, if we cannot find the manufacturer ID,
* assume this is the AMD flash associated with the MDS board.
* This allows booting from a promjet.
*/
#define CONFIG_ASSUME_AMD_FLASH
#ifndef __ASSEMBLY__
extern unsigned long get_clock_freq(void);
#endif /*Replace a call to get_clock_freq (after it is implemented)*/

View File

@@ -44,13 +44,6 @@
#define CONFIG_ENV_OVERWRITE
#define CONFIG_FSL_LAW 1 /* Use common FSL init code */
/*
* When initializing flash, if we cannot find the manufacturer ID,
* assume this is the AMD flash associated with the MDS board.
* This allows booting from a promjet.
*/
#define CONFIG_ASSUME_AMD_FLASH
#ifndef __ASSEMBLY__
extern unsigned long get_clock_freq(void);
#endif

View File

@@ -53,13 +53,6 @@
#define CONFIG_TSEC_ENET /* tsec ethernet support */
#define CONFIG_ENV_OVERWRITE
/*
* When initializing flash, if we cannot find the manufacturer ID,
* assume this is the AMD flash associated with the CDS board.
* This allows booting from a promjet.
*/
#define CONFIG_ASSUME_AMD_FLASH
#ifndef __ASSEMBLY__
extern unsigned long get_board_sys_clk(unsigned long dummy);
extern unsigned long get_board_ddr_clk(unsigned long dummy);

View File

@@ -88,7 +88,6 @@
#define CONFIG_CMD_SAVEENV
#define CONFIG_CMD_FLASH
#define CONFIG_CMD_IMI
#define CONFIG_CMD_IRQ
#define CONFIG_CMD_NET
#define CONFIG_CMD_PCI
#define CONFIG_CMD_RUN

View File

@@ -54,13 +54,6 @@
#define CONFIG_TSEC_ENET /* tsec ethernet support */
#define CONFIG_ENV_OVERWRITE
/*
* When initializing flash, if we cannot find the manufacturer ID,
* assume this is the AMD flash associated with the CDS board.
* This allows booting from a promjet.
*/
#define CONFIG_ASSUME_AMD_FLASH
#ifndef __ASSEMBLY__
extern unsigned long calculate_board_sys_clk(unsigned long dummy);
extern unsigned long calculate_board_ddr_clk(unsigned long dummy);

View File

@@ -300,7 +300,8 @@
/*
* External Bus Controller (EBC) Setup
*/
#define CAN_BA 0xF0000000 /* CAN Base Address */
#define CAN0_BA 0xF0000000 /* CAN0 Base Address */
#define CAN1_BA 0xF0000100 /* CAN1 Base Address */
#define DUART0_BA 0xF0000400 /* DUART Base Address */
#define DUART1_BA 0xF0000408 /* DUART Base Address */
#define RTC_BA 0xF0000500 /* RTC Base Address */

View File

@@ -593,7 +593,7 @@
#define CONFIG_SYS_EBC_PB1CR (CONFIG_SYS_FPGA_BASE | 0x3a000) /* BAS=FPGA,BS=2MB,BU=R/W,BW=16bit*/
#endif /* !defined(CONFIG_ARCHES) */
#define CONFIG_SYS_EBC_CFG 0xB8400000 /* EBC0_CFG */
#define CONFIG_SYS_EBC_CFG 0xbfc00000
/*
* Arches doesn't use PerCS3 but GPIO43, so let's configure the GPIO

View File

@@ -88,15 +88,21 @@
/*
* Autobooting
*/
#define CONFIG_BOOTDELAY 3 /* autoboot after 3 seconds */
#define CONFIG_BOOTDELAY 10 /* autoboot after 10 seconds */
#define CONFIG_ZERO_BOOTDELAY_CHECK /* allow stopping of boot process */
/* even with bootdelay=0 */
#undef CONFIG_BOOTARGS
#define CONFIG_BOOT_RETRY_TIME 120 /* Reset if no command is entered */
#define CONFIG_RESET_TO_RETRY
#define CONFIG_PREBOOT "echo;" \
"echo Welcome to U-Boot;"\
"echo"
#define CONFIG_BOOTCOMMAND "go ff300004 0; go ff300004 2 2;" \
"bootm ff040000 ff900000 fffc0000"
#define CONFIG_BOOTARGS "console=ttyPSC0,115200"
#define CONFIG_EXTRA_ENV_SETTINGS "epson=yes\0"
/*
* IPB Bus clocking configuration.
*/

View File

@@ -145,6 +145,7 @@
/*
* MTD
*/
#define CONFIG_FLASH_CFI_MTD
#define CONFIG_MTD_DEVICE
/*

View File

@@ -76,6 +76,5 @@
#define CONFIG_SMC91111
#define CONFIG_SMC91111_BASE (0x70000000)
#undef CONFIG_SMC_USE_32_BIT
#define CONFIG_SMC_USE_IOFUNCS
#endif /* __LPD7A400_10_H */

View File

@@ -76,6 +76,5 @@
#define CONFIG_SMC91111
#define CONFIG_SMC91111_BASE (0x70000000)
#undef CONFIG_SMC_USE_32_BIT
#define CONFIG_SMC_USE_IOFUNCS
#endif /* __LPD7A404_10_H */

View File

@@ -72,7 +72,7 @@
#include <config_cmd_default.h>
#ifndef USE_920T_MMU
#define CONFIG_CMD_PING)
#define CONFIG_CMD_PING
#undef CONFIG_CMD_CACHE
#else
#define CONFIG_CMD_DATE

View File

@@ -146,7 +146,7 @@
#define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MONITOR_BASE - CONFIG_SYS_MALLOC_LEN)
/* stack */
#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_MONITOR_BASE
#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_MALLOC_BASE
/*#define RAMENV */
#define FLASH

View File

@@ -74,7 +74,7 @@
#define CONFIG_BAUDRATE 115200
#define CONFIG_BOOTARGS \
"root=/dev/mtdblock1 rootfstype=jffs2 console=ttyS1"
"root=/dev/mtdblock1 rootfstype=jffs2 fbmem=512k console=ttyS1"
#define CONFIG_BOOTCOMMAND \
"fsload boot/uImage; bootm"

View File

@@ -161,6 +161,7 @@
#define CONFIG_ENV_OFFSET 0x60000
#define CONFIG_ENV_OFFSET_REDUND 0x80000
#define CONFIG_ENV_SIZE 0x20000
#define CONFIG_SYS_64BIT_VSPRINTF /* needed for nand_util.c */
#endif
#define CONFIG_BOOTCOMMAND "nboot 0x21000000 0 400000"

View File

@@ -158,7 +158,7 @@
/* #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE */
#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE | /* flash Base address */ \
(2 << BR_PS_SHIFT) | /* 32 bit port size */ \
(2 << BR_PS_SHIFT) | /* 16 bit port size */ \
BR_V) /* valid */
#define CONFIG_SYS_OR0_PRELIM 0xFF806FF7 /* 8 MB flash size */

View File

@@ -138,6 +138,7 @@
#define CONFIG_ENV_OFFSET 0x60000
#define CONFIG_ENV_OFFSET_REDUND 0x80000
#define CONFIG_ENV_SIZE 0x20000
#define CONFIG_SYS_64BIT_VSPRINTF /* needed for nand_util.c */
#endif
#define CONFIG_BOOTCOMMAND "nboot 0x21000000 0 400000"

View File

@@ -219,12 +219,10 @@ typedef struct bootm_headers {
const char *fit_uname_rd; /* init ramdisk subimage node unit name */
int fit_noffset_rd; /* init ramdisk subimage node offset */
#if defined(CONFIG_PPC)
void *fit_hdr_fdt; /* FDT blob FIT image header */
const char *fit_uname_fdt; /* FDT blob subimage node unit name */
int fit_noffset_fdt;/* FDT blob subimage node offset */
#endif
#endif
#ifndef USE_HOSTCC
image_info_t os; /* os image info */

View File

@@ -0,0 +1,70 @@
#ifndef _LINUX_UNALIGNED_BE_BYTESHIFT_H
#define _LINUX_UNALIGNED_BE_BYTESHIFT_H
#include <linux/types.h>
static inline u16 __get_unaligned_be16(const u8 *p)
{
return p[0] << 8 | p[1];
}
static inline u32 __get_unaligned_be32(const u8 *p)
{
return p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3];
}
static inline u64 __get_unaligned_be64(const u8 *p)
{
return (u64)__get_unaligned_be32(p) << 32 |
__get_unaligned_be32(p + 4);
}
static inline void __put_unaligned_be16(u16 val, u8 *p)
{
*p++ = val >> 8;
*p++ = val;
}
static inline void __put_unaligned_be32(u32 val, u8 *p)
{
__put_unaligned_be16(val >> 16, p);
__put_unaligned_be16(val, p + 2);
}
static inline void __put_unaligned_be64(u64 val, u8 *p)
{
__put_unaligned_be32(val >> 32, p);
__put_unaligned_be32(val, p + 4);
}
static inline u16 get_unaligned_be16(const void *p)
{
return __get_unaligned_be16((const u8 *)p);
}
static inline u32 get_unaligned_be32(const void *p)
{
return __get_unaligned_be32((const u8 *)p);
}
static inline u64 get_unaligned_be64(const void *p)
{
return __get_unaligned_be64((const u8 *)p);
}
static inline void put_unaligned_be16(u16 val, void *p)
{
__put_unaligned_be16(val, p);
}
static inline void put_unaligned_be32(u32 val, void *p)
{
__put_unaligned_be32(val, p);
}
static inline void put_unaligned_be64(u64 val, void *p)
{
__put_unaligned_be64(val, p);
}
#endif /* _LINUX_UNALIGNED_BE_BYTESHIFT_H */

View File

@@ -0,0 +1,70 @@
#ifndef _LINUX_UNALIGNED_LE_BYTESHIFT_H
#define _LINUX_UNALIGNED_LE_BYTESHIFT_H
#include <linux/types.h>
static inline u16 __get_unaligned_le16(const u8 *p)
{
return p[0] | p[1] << 8;
}
static inline u32 __get_unaligned_le32(const u8 *p)
{
return p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
}
static inline u64 __get_unaligned_le64(const u8 *p)
{
return (u64)__get_unaligned_le32(p + 4) << 32 |
__get_unaligned_le32(p);
}
static inline void __put_unaligned_le16(u16 val, u8 *p)
{
*p++ = val;
*p++ = val >> 8;
}
static inline void __put_unaligned_le32(u32 val, u8 *p)
{
__put_unaligned_le16(val >> 16, p + 2);
__put_unaligned_le16(val, p);
}
static inline void __put_unaligned_le64(u64 val, u8 *p)
{
__put_unaligned_le32(val >> 32, p + 4);
__put_unaligned_le32(val, p);
}
static inline u16 get_unaligned_le16(const void *p)
{
return __get_unaligned_le16((const u8 *)p);
}
static inline u32 get_unaligned_le32(const void *p)
{
return __get_unaligned_le32((const u8 *)p);
}
static inline u64 get_unaligned_le64(const void *p)
{
return __get_unaligned_le64((const u8 *)p);
}
static inline void put_unaligned_le16(u16 val, void *p)
{
__put_unaligned_le16(val, p);
}
static inline void put_unaligned_le32(u32 val, void *p)
{
__put_unaligned_le32(val, p);
}
static inline void put_unaligned_le64(u64 val, void *p)
{
__put_unaligned_le64(val, p);
}
#endif /* _LINUX_UNALIGNED_LE_BYTESHIFT_H */

157
include/mtd/cfi_flash.h Normal file
View File

@@ -0,0 +1,157 @@
/*
* (C) Copyright 2009
* Stefan Roese, DENX Software Engineering, sr@denx.de.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*/
#ifndef __CFI_FLASH_H__
#define __CFI_FLASH_H__
#define FLASH_CMD_CFI 0x98
#define FLASH_CMD_READ_ID 0x90
#define FLASH_CMD_RESET 0xff
#define FLASH_CMD_BLOCK_ERASE 0x20
#define FLASH_CMD_ERASE_CONFIRM 0xD0
#define FLASH_CMD_WRITE 0x40
#define FLASH_CMD_PROTECT 0x60
#define FLASH_CMD_PROTECT_SET 0x01
#define FLASH_CMD_PROTECT_CLEAR 0xD0
#define FLASH_CMD_CLEAR_STATUS 0x50
#define FLASH_CMD_READ_STATUS 0x70
#define FLASH_CMD_WRITE_TO_BUFFER 0xE8
#define FLASH_CMD_WRITE_BUFFER_PROG 0xE9
#define FLASH_CMD_WRITE_BUFFER_CONFIRM 0xD0
#define FLASH_STATUS_DONE 0x80
#define FLASH_STATUS_ESS 0x40
#define FLASH_STATUS_ECLBS 0x20
#define FLASH_STATUS_PSLBS 0x10
#define FLASH_STATUS_VPENS 0x08
#define FLASH_STATUS_PSS 0x04
#define FLASH_STATUS_DPS 0x02
#define FLASH_STATUS_R 0x01
#define FLASH_STATUS_PROTECT 0x01
#define AMD_CMD_RESET 0xF0
#define AMD_CMD_WRITE 0xA0
#define AMD_CMD_ERASE_START 0x80
#define AMD_CMD_ERASE_SECTOR 0x30
#define AMD_CMD_UNLOCK_START 0xAA
#define AMD_CMD_UNLOCK_ACK 0x55
#define AMD_CMD_WRITE_TO_BUFFER 0x25
#define AMD_CMD_WRITE_BUFFER_CONFIRM 0x29
#define AMD_STATUS_TOGGLE 0x40
#define AMD_STATUS_ERROR 0x20
#define ATM_CMD_UNLOCK_SECT 0x70
#define ATM_CMD_SOFTLOCK_START 0x80
#define ATM_CMD_LOCK_SECT 0x40
#define FLASH_CONTINUATION_CODE 0x7F
#define FLASH_OFFSET_MANUFACTURER_ID 0x00
#define FLASH_OFFSET_DEVICE_ID 0x01
#define FLASH_OFFSET_DEVICE_ID2 0x0E
#define FLASH_OFFSET_DEVICE_ID3 0x0F
#define FLASH_OFFSET_CFI 0x55
#define FLASH_OFFSET_CFI_ALT 0x555
#define FLASH_OFFSET_CFI_RESP 0x10
#define FLASH_OFFSET_PRIMARY_VENDOR 0x13
/* extended query table primary address */
#define FLASH_OFFSET_EXT_QUERY_T_P_ADDR 0x15
#define FLASH_OFFSET_WTOUT 0x1F
#define FLASH_OFFSET_WBTOUT 0x20
#define FLASH_OFFSET_ETOUT 0x21
#define FLASH_OFFSET_CETOUT 0x22
#define FLASH_OFFSET_WMAX_TOUT 0x23
#define FLASH_OFFSET_WBMAX_TOUT 0x24
#define FLASH_OFFSET_EMAX_TOUT 0x25
#define FLASH_OFFSET_CEMAX_TOUT 0x26
#define FLASH_OFFSET_SIZE 0x27
#define FLASH_OFFSET_INTERFACE 0x28
#define FLASH_OFFSET_BUFFER_SIZE 0x2A
#define FLASH_OFFSET_NUM_ERASE_REGIONS 0x2C
#define FLASH_OFFSET_ERASE_REGIONS 0x2D
#define FLASH_OFFSET_PROTECT 0x02
#define FLASH_OFFSET_USER_PROTECTION 0x85
#define FLASH_OFFSET_INTEL_PROTECTION 0x81
#define CFI_CMDSET_NONE 0
#define CFI_CMDSET_INTEL_EXTENDED 1
#define CFI_CMDSET_AMD_STANDARD 2
#define CFI_CMDSET_INTEL_STANDARD 3
#define CFI_CMDSET_AMD_EXTENDED 4
#define CFI_CMDSET_MITSU_STANDARD 256
#define CFI_CMDSET_MITSU_EXTENDED 257
#define CFI_CMDSET_SST 258
#define CFI_CMDSET_INTEL_PROG_REGIONS 512
#ifdef CONFIG_SYS_FLASH_CFI_AMD_RESET /* needed for STM_ID_29W320DB on UC100 */
# undef FLASH_CMD_RESET
# define FLASH_CMD_RESET AMD_CMD_RESET /* use AMD-Reset instead */
#endif
#define NUM_ERASE_REGIONS 4 /* max. number of erase regions */
typedef union {
unsigned char c;
unsigned short w;
unsigned long l;
unsigned long long ll;
} cfiword_t;
/* CFI standard query structure */
struct cfi_qry {
u8 qry[3];
u16 p_id;
u16 p_adr;
u16 a_id;
u16 a_adr;
u8 vcc_min;
u8 vcc_max;
u8 vpp_min;
u8 vpp_max;
u8 word_write_timeout_typ;
u8 buf_write_timeout_typ;
u8 block_erase_timeout_typ;
u8 chip_erase_timeout_typ;
u8 word_write_timeout_max;
u8 buf_write_timeout_max;
u8 block_erase_timeout_max;
u8 chip_erase_timeout_max;
u8 dev_size;
u16 interface_desc;
u16 max_buf_write_size;
u8 num_erase_regions;
u32 erase_region_info[NUM_ERASE_REGIONS];
} __attribute__((packed));
struct cfi_pri_hdr {
u8 pri[3];
u8 major_version;
u8 minor_version;
} __attribute__((packed));
void flash_write_cmd(flash_info_t * info, flash_sect_t sect,
uint offset, u32 cmd);
#endif /* __CFI_FLASH_H__ */

Some files were not shown because too many files have changed in this diff Show More