]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Merge branch 'master' of http://www.denx.de/git/u-boot
authorJon Loeliger <jdl@freescale.com>
Tue, 19 Sep 2006 13:51:24 +0000 (08:51 -0500)
committerJon Loeliger <jdl@freescale.com>
Tue, 19 Sep 2006 13:51:24 +0000 (08:51 -0500)
Conflicts:

board/stxxtc/Makefile

467 files changed:
CHANGELOG
MAINTAINERS
MAKEALL
Makefile
README
board/AtmarkTechno/suzaku/Makefile
board/BuS/EB+MCF-EV123/Makefile
board/BuS/EB+MCF-EV123/textbase.mk
board/LEOX/elpt860/Makefile
board/MAI/AmigaOneG3SE/Makefile
board/Marvell/db64360/Makefile
board/Marvell/db64460/Makefile
board/RPXClassic/Makefile
board/RPXlite/Makefile
board/RPXlite_dw/Makefile
board/RRvision/Makefile
board/a3000/Makefile
board/adder/Makefile
board/adsvix/Makefile
board/alaska/Makefile
board/altera/dk1c20/Makefile
board/altera/dk1s10/Makefile
board/altera/ep1c20/Makefile
board/altera/ep1s10/Makefile
board/altera/ep1s40/Makefile
board/amcc/bamboo/Makefile
board/amcc/bubinga/Makefile
board/amcc/common/flash.c
board/amcc/ebony/Makefile
board/amcc/luan/Makefile
board/amcc/ocotea/Makefile
board/amcc/sequoia/Makefile [new file with mode: 0644]
board/amcc/sequoia/config.mk [new file with mode: 0644]
board/amcc/sequoia/init.S [new file with mode: 0644]
board/amcc/sequoia/sdram.c [new file with mode: 0644]
board/amcc/sequoia/sequoia.c [new file with mode: 0644]
board/amcc/sequoia/sequoia.h [new file with mode: 0644]
board/amcc/sequoia/u-boot-nand.lds [new file with mode: 0644]
board/amcc/sequoia/u-boot.lds [new file with mode: 0644]
board/amcc/walnut/Makefile
board/amcc/yellowstone/Makefile
board/amcc/yosemite/Makefile
board/amcc/yucca/Makefile
board/amcc/yucca/yucca.c
board/amcc/yucca/yucca.h
board/amirix/ap1000/Makefile
board/armadillo/Makefile
board/assabet/Makefile
board/at91rm9200dk/Makefile
board/atc/Makefile
board/barco/Makefile
board/bc3450/Makefile
board/bmw/Makefile
board/c2mon/Makefile
board/canmb/Makefile
board/cds/mpc8541cds/Makefile
board/cds/mpc8548cds/Makefile
board/cds/mpc8555cds/Makefile
board/cerf250/Makefile
board/cm4008/Makefile
board/cm41xx/Makefile
board/cmc_pu2/Makefile
board/cmi/Makefile
board/cobra5272/Makefile
board/cogent/Makefile
board/cpc45/Makefile
board/cpu86/Makefile
board/cpu87/Makefile
board/cpu87/cpu87.c
board/cradle/Makefile
board/cray/L1/Makefile
board/csb226/Makefile
board/csb272/Makefile
board/csb472/Makefile
board/csb637/Makefile
board/cu824/Makefile
board/dave/B2/Makefile
board/dave/PPChameleonEVB/Makefile
board/dbau1x00/Makefile
board/delta/Makefile
board/dnp1110/Makefile
board/eXalion/Makefile
board/eltec/bab7xx/Makefile
board/eltec/elppc/Makefile
board/eltec/mhpc/Makefile
board/emk/top5200/Makefile
board/emk/top860/Makefile
board/ep7312/Makefile
board/ep8248/Makefile
board/ep8260/Makefile
board/ep88x/Makefile
board/eric/Makefile
board/esd/adciop/Makefile
board/esd/apc405/Makefile
board/esd/ar405/Makefile
board/esd/ash405/Makefile
board/esd/canbt/Makefile
board/esd/cms700/Makefile
board/esd/cpci2dp/Makefile
board/esd/cpci405/Makefile
board/esd/cpci440/Makefile
board/esd/cpci5200/Makefile
board/esd/cpci5200/config.mk
board/esd/cpci750/Makefile
board/esd/cpciiser4/Makefile
board/esd/dasa_sim/Makefile
board/esd/dp405/Makefile
board/esd/du405/Makefile
board/esd/hh405/Makefile
board/esd/hub405/Makefile
board/esd/ocrtc/Makefile
board/esd/pci405/Makefile
board/esd/pf5200/Makefile
board/esd/pf5200/config.mk
board/esd/plu405/Makefile
board/esd/pmc405/Makefile
board/esd/tasreg/Makefile
board/esd/voh405/Makefile
board/esd/vom405/Makefile
board/esd/wuh405/Makefile
board/esteem192e/Makefile
board/etin/debris/Makefile
board/etin/kvme080/Makefile
board/etx094/Makefile
board/evb4510/Makefile
board/evb64260/Makefile
board/exbitgen/Makefile
board/ezkit533/Makefile
board/fads/Makefile
board/flagadm/Makefile
board/funkwerk/vovpn-gw/Makefile
board/g2000/Makefile
board/gcplus/Makefile
board/gen860t/Makefile
board/genietv/Makefile
board/gth/Makefile
board/gth2/Makefile
board/gw8260/Makefile
board/hermes/Makefile
board/hidden_dragon/Makefile
board/hmi1001/Makefile
board/hymod/Makefile
board/icecube/Makefile
board/icecube/config.mk
board/icu862/Makefile
board/ids8247/Makefile
board/impa7/Makefile
board/incaip/Makefile
board/inka4x0/Makefile
board/innokom/Makefile
board/integratorap/Makefile
board/integratorap/config.mk
board/integratorap/split_by_variant.sh
board/integratorcp/Makefile
board/integratorcp/config.mk
board/integratorcp/split_by_variant.sh
board/ip860/Makefile
board/iphase4539/Makefile
board/ispan/Makefile
board/ivm/Makefile
board/ixdp425/Makefile
board/ixdp425/config.mk
board/jse/Makefile
board/kb9202/Makefile
board/kup/Makefile
board/kup/kup4k/Makefile
board/kup/kup4x/Makefile
board/lantec/Makefile
board/lart/Makefile
board/logodl/Makefile
board/lpd7a40x/Makefile
board/lubbock/Makefile
board/lwmon/Makefile
board/m5271evb/Makefile
board/m5272c3/Makefile
board/m5282evb/Makefile
board/mbx8xx/Makefile
board/mcc200/Makefile
board/mcc200/config.mk
board/mcc200/lcd.c [new file with mode: 0644]
board/mcc200/mcc200.c
board/ml2/Makefile
board/modnet50/Makefile
board/mousse/Makefile
board/mp2usb/Makefile
board/mpc8260ads/Makefile
board/mpc8260ads/config.mk
board/mpc8266ads/Makefile
board/mpc8349emds/Makefile
board/mpc8540ads/Makefile
board/mpc8540eval/Makefile
board/mpc8560ads/Makefile
board/mpl/mip405/Makefile
board/mpl/pati/Makefile
board/mpl/pip405/Makefile
board/mpl/vcma9/Makefile
board/musenki/Makefile
board/mvblue/Makefile
board/mvs1/Makefile
board/mx1ads/Makefile
board/mx1fs2/Makefile
board/nc650/Makefile
board/nc650/config.mk
board/netphone/Makefile
board/netstar/Makefile
board/netstar/crcit [deleted file]
board/netta/Makefile
board/netta2/Makefile
board/netvia/Makefile
board/ns9750dev/Makefile
board/nx823/Makefile
board/o2dnt/Makefile
board/omap1510inn/Makefile
board/omap1610inn/Makefile
board/omap2420h4/Makefile
board/omap5912osk/Makefile
board/omap730p2/Makefile
board/oxc/Makefile
board/pb1x00/Makefile
board/pcippc2/Makefile
board/pcs440ep/Makefile
board/pleb2/Makefile
board/pm520/Makefile
board/pm826/Makefile
board/pm826/config.mk
board/pm828/Makefile
board/pm828/config.mk
board/pm854/Makefile
board/pm856/Makefile
board/pn62/Makefile
board/ppmc7xx/Makefile
board/ppmc8260/Makefile
board/prodrive/p3p440/Makefile
board/prodrive/pdnb3/Makefile
board/prodrive/pdnb3/config.mk
board/psyent/pci5441/Makefile
board/psyent/pk1c20/Makefile
board/purple/Makefile
board/pxa255_idp/Makefile
board/quantum/Makefile
board/r360mpi/Makefile
board/r5200/Makefile
board/rattler/Makefile
board/rbc823/Makefile
board/rmu/Makefile
board/rpxsuper/Makefile
board/rsdproto/Makefile
board/sacsng/Makefile
board/sandburst/karef/Makefile
board/sandburst/metrobox/Makefile
board/sandpoint/Makefile
board/sbc2410x/Makefile
board/sbc405/Makefile
board/sbc8240/Makefile
board/sbc8260/Makefile
board/sbc8560/Makefile
board/sc520_cdp/Makefile
board/sc520_spunk/Makefile
board/scb9328/Makefile
board/shannon/Makefile
board/siemens/CCM/Makefile
board/siemens/IAD210/Makefile
board/siemens/SCM/Makefile
board/siemens/pcu_e/Makefile
board/sixnet/Makefile
board/sl8245/Makefile
board/smdk2400/Makefile
board/smdk2410/Makefile
board/snmc/qs850/Makefile
board/snmc/qs860t/Makefile
board/sorcery/Makefile
board/sorcery/sorcery.c
board/spc1920/Makefile
board/spd8xx/Makefile
board/ssv/adnpesc1/Makefile
board/stamp/Makefile
board/stxgp3/Makefile
board/stxxtc/Makefile
board/svm_sc8xx/Makefile
board/sx1/Makefile
board/tb0229/Makefile
board/total5200/Makefile
board/total5200/config.mk
board/tqm5200/Makefile
board/tqm5200/config.mk
board/tqm5200/tqm5200.c
board/tqm8260/Makefile
board/tqm834x/Makefile
board/tqm85xx/Makefile
board/tqm8xx/Makefile
board/trab/Makefile
board/trab/config.mk
board/uc100/Makefile
board/utx8245/Makefile
board/v37/Makefile
board/versatile/Makefile
board/versatile/split_by_variant.sh
board/voiceblue/Makefile
board/voiceblue/config.mk
board/w7o/Makefile
board/wepep250/Makefile
board/westel/amx860/Makefile
board/xaeniax/Makefile
board/xilinx/ml300/Makefile
board/xm250/Makefile
board/xpedite1k/Makefile
board/xsengine/Makefile
board/zpc1900/Makefile
board/zylonite/Makefile
board/zylonite/config.mk
common/Makefile
common/cmd_bdinfo.c
common/cmd_jffs2.c
common/env_nand.c
common/environment.c
common/exports.c
common/lcd.c
common/serial.c
common/usb_storage.c
common/xyzModem.c
config.mk
cpu/74xx_7xx/Makefile
cpu/arm1136/Makefile
cpu/arm720t/Makefile
cpu/arm920t/Makefile
cpu/arm920t/at91rm9200/Makefile
cpu/arm920t/imx/Makefile
cpu/arm920t/ks8695/Makefile
cpu/arm920t/s3c24x0/Makefile
cpu/arm925t/Makefile
cpu/arm926ejs/Makefile
cpu/arm926ejs/omap/Makefile
cpu/arm926ejs/versatile/Makefile
cpu/arm946es/Makefile
cpu/arm_intcm/Makefile
cpu/bf533/Makefile
cpu/i386/Makefile
cpu/i386/sc520.c
cpu/i386/sc520_asm.S
cpu/ixp/Makefile
cpu/ixp/npe/Makefile
cpu/lh7a40x/Makefile
cpu/mcf52x2/Makefile
cpu/mcf52x2/fec.c
cpu/mcf52x2/start.S
cpu/microblaze/Makefile
cpu/mips/Makefile
cpu/mpc5xx/Makefile
cpu/mpc5xxx/Makefile
cpu/mpc5xxx/interrupts.c
cpu/mpc5xxx/serial.c
cpu/mpc8220/Makefile
cpu/mpc8220/pci.c
cpu/mpc824x/Makefile
cpu/mpc824x/drivers/dma/Makefile [deleted file]
cpu/mpc824x/drivers/dma/Makefile_pc [deleted file]
cpu/mpc824x/drivers/dma/README [deleted file]
cpu/mpc824x/drivers/dma/dma.h [deleted file]
cpu/mpc824x/drivers/dma/dma1.c [deleted file]
cpu/mpc824x/drivers/dma/dma2.S [deleted file]
cpu/mpc824x/drivers/dma/dma_export.h [deleted file]
cpu/mpc824x/drivers/dma_export.h [deleted file]
cpu/mpc824x/drivers/i2o.h [deleted file]
cpu/mpc824x/drivers/i2o/Makefile [deleted file]
cpu/mpc824x/drivers/i2o/Makefile_pc [deleted file]
cpu/mpc824x/drivers/i2o/i2o.h [deleted file]
cpu/mpc824x/drivers/i2o/i2o1.c [deleted file]
cpu/mpc824x/drivers/i2o/i2o2.S [deleted file]
cpu/mpc8260/Makefile
cpu/mpc83xx/Makefile
cpu/mpc85xx/Makefile
cpu/mpc8xx/Makefile
cpu/nios/Makefile
cpu/nios2/Makefile
cpu/ppc4xx/405gp_pci.c
cpu/ppc4xx/440spe_pcie.c
cpu/ppc4xx/440spe_pcie.h
cpu/ppc4xx/4xx_enet.c
cpu/ppc4xx/Makefile
cpu/ppc4xx/cpu.c
cpu/ppc4xx/interrupts.c
cpu/ppc4xx/miiphy.c
cpu/ppc4xx/ndfc.c [new file with mode: 0644]
cpu/ppc4xx/serial.c
cpu/ppc4xx/speed.c
cpu/ppc4xx/start.S
cpu/ppc4xx/usb_ohci.c
cpu/ppc4xx/usbdev.c
cpu/ppc4xx/vecnum.h
cpu/pxa/Makefile
cpu/s3c44b0/Makefile
cpu/sa1100/Makefile
disk/Makefile
doc/README.nand-boot-ppc440 [new file with mode: 0644]
drivers/Makefile
drivers/nand/Makefile
drivers/nand_legacy/Makefile
drivers/ns9750_serial.c
drivers/serial.c
drivers/sk98lin/Makefile
dtt/Makefile
dtt/lm75.c
examples/Makefile
examples/interrupt.c [new file with mode: 0644]
fs/Makefile
fs/cramfs/Makefile
fs/ext2/Makefile
fs/fat/Makefile
fs/fdos/Makefile
fs/jffs2/Makefile
fs/reiserfs/Makefile
include/405_mal.h
include/440_i2c.h
include/_exports.h
include/asm-ppc/processor.h
include/asm-ppc/u-boot.h
include/common.h
include/configs/CPCI440.h
include/configs/CPU87.h
include/configs/TQM5200.h
include/configs/bamboo.h
include/configs/mcc200.h
include/configs/pcs440ep.h
include/configs/sequoia.h [new file with mode: 0644]
include/configs/sorcery.h
include/configs/yellowstone.h
include/configs/yosemite.h
include/environment.h
include/exports.h
include/lcd.h
include/linux/mtd/compat.h
include/linux/mtd/ndfc.h [new file with mode: 0644]
include/mpc5xxx.h
include/ppc440.h
include/ppc4xx_enet.h
include/ppc_asm.tmpl
include/serial.h
lib_arm/Makefile
lib_blackfin/Makefile
lib_generic/Makefile
lib_i386/Makefile
lib_m68k/Makefile
lib_microblaze/Makefile
lib_mips/Makefile
lib_nios/Makefile
lib_nios2/Makefile
lib_ppc/Makefile
lib_ppc/board.c
mkconfig
nand_spl/board/amcc/sequoia/Makefile [new file with mode: 0644]
nand_spl/board/amcc/sequoia/config.mk [new file with mode: 0644]
nand_spl/board/amcc/sequoia/u-boot.lds [new file with mode: 0644]
nand_spl/nand_boot.c [new file with mode: 0644]
net/Makefile
post/Makefile
post/cpu/Makefile
post/rules.mk
rtc/Makefile
rules.mk [new file with mode: 0644]
tools/Makefile
tools/easylogo/easylogo.c
tools/env/Makefile
tools/gdb/Makefile
tools/mkimage.c
tools/updater/Makefile
tools/updater/flash.c
tools/updater/update.c

index 82be4e3d7791430575d6f89799fcbccb9ce962f7..a896e253a966911862dc850de3f964bd6e8a4715 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,124 @@
 Changes since U-Boot 1.1.4:
 ======================================================================
 
+* Disable autoboot abort for FO300 when silent mode is enabled
+  (according to S1 switch setting).
+
+* Cleanup examples binaries
+
+* Add NAND environment support for PPC440EPx Sequoia NAND boot config
+  Patch by Stefan Roese, 12 Sep 2006
+
+* Update NAND boot documentation
+  Patch by Stefan Roese, 12 Sep 2006
+
+* Fix alignment problem in "mtdparts" command
+
+* Add documentation on the latest build environment extensions to
+  the README file.
+
+* Remove dead code (i2o and dma) from cpu/mpc824x/drivers/ directory.
+
+* Fix LOG_DIR directory creation error.
+  Add support for automatic creation of BUILD_DIR directory.
+
+* Fix build problem cpu/ppc4xx/ndfc.c
+  Patch by Stefan Roese, 07 Sep 2006
+
+* Fix build problem with CPCI440
+  Patch by Stefan Roese, 07 Sep 2006
+
+* Change Yellowstone to use CFI write buffer
+  Patch by Stefan Roese, 07 Sep 2006
+
+* Add support for AMCC Sequoia PPC440EPx eval board
+  - Add support for PPC440EPx & PPC440GRx
+  - Add support for PPC440EP(x)/GR(x) NAND controller
+    in cpu/ppc4xx directory
+  - Add NAND boot functionality for Sequoia board,
+    please see doc/README.nand-boot-ppc440 for details
+  - This Sequoia NAND image doesn't support environment
+    in NAND for now. This will be added in a short while.
+  Patch by Stefan Roese, 07 Sep 2006
+
+* Fix mkimage -l bug with multifile images on 64bit platforms
+  Patch by David Updegraff, 06 Sep 2006
+
+* Fix build problems on sorcery board.
+
+* Fix coldfire build problems.
+  Patch by Marian Balakowicz, 01 Sep 2006
+
+* Add support for a saving build objects in a separate directory.
+  Modifications are based on the Linux kernel approach and support
+  two use cases:
+  1) Add O= to the make command line 'make O=/tmp/build all'
+  2) Set environement variable BUILD_DIR to point to the desired location
+       'export BUILD_DIR=/tmp/build'
+       'make'
+  The second approach can also be used with a MAKEALL script
+       'export BUILD_DIR=/tmp/build'
+       './MAKEALL'
+  Command line 'O=' setting overrides the BUILD_DIR environent variable.
+  When none of the above methods is used the local build is performed
+  and the object files are placed in the source directory.
+
+* Remove the board/netstar/crcit binary from git repository.
+
+* Fix tools/updater build error.
+
+* Fix tools/easylogo build error.
+
+* Fixed problems on PRS200 board caused by adding splash screen on MCC200
+
+* Extended README entry on coding style
+
+* Added another example showing simple interrupt interception.
+
+* Added simple_strtoul(), getenv() and setenv() to the exported functions.
+  Also bumped up ABI version to reflect this change.
+
+* Added interrupt handling capabilities for mpc5xxx processors.
+  Also added Linux like BUG() macros.
+
+* Coding Style cleanup.
+  Patch by Stefano Babic, 31 Aug 2006
+
+* Add splashscreen support for MCC200 board.
+
+* Make the serial driver framework work with CONFIG_SERIAL_MULTI
+  enabled
+
+* PCIe endpoint support for AMCC Yucca 440SPe board
+  Patch by Tirumala R Marri, 26 Aug 2006
+
+* Improve DIMM detection for AMCC Yucca 440SPe board
+  Improved the memory DIMM detection for the Yucca 440SPe board for
+  the case where a memory DIMM is falsely detected as present.
+  This issue is seen on some AMCC Yucca 440SPe validation boards if
+  only one 512MB memory DIMM is installed, i.e. DIMM slot 0 is
+  populated and DIMM slot 1 is empty.  In this case, U-Boot does
+  not correctly detect that there is only one DIMM memory module
+  installed and will falsely detect two DIMM memory modules are
+  present and therefore U-Boot will not calculate the correct amount
+  of total memory and u-boot will not booting up.
+  Patch by Adam Graham, 24 Aug 2006
+
+* Fix typo.
+
+* Code cleanup
+
+* Update for MCC200 / PRS200 boards:
+  - auto-adjust console device for Linux.
+  - fix typos.
+
+* Add a fix for a buggy USB device on the FO300 board.
+
+* Updates for MCC200 / PRS200 boards:
+  - support for configurations with SDRAM or DDR memory,
+  - support for highboot and lowboot
+  - adjusting environment definitions
+
 * Add support for WTK FO300 board (TQM5200 based).
 
 * Fix TQM834x hang.
index bf3705b2b77c780a1311293b09940747a5489743..18b23a21ffffb2e54d766e89039846618d735df0 100644 (file)
@@ -287,6 +287,7 @@ Stefan Roese <sr@denx.de>
        ocotea                  PPC440GX
        p3p440                  PPC440GP
        pcs440ep                PPC440EP
+       sequoia                 PPC440EPx
        sycamore                PPC405GPr
        walnut                  PPC405GP
        yellowstone             PPC440GR
@@ -320,6 +321,11 @@ Rune Torgersen <runet@innovsys.com>
 
        MPC8266ADS              MPC8266
 
+
+David Updegraff <dave@cray.com>
+
+       CRAYL1                  PPC4xx
+
 Josef Wagner <Wagner@Microsys.de>
 
        CPC45                   MPC8245
@@ -349,7 +355,6 @@ Unknown / orphaned boards:
        RPXClassic              MPC8xx
        RPXlite                 MPC8xx
 
-       CRAYL1                  PPC4xx
        ERIC                    PPC4xx
 
        MOUSSE                  MPC824x
diff --git a/MAKEALL b/MAKEALL
index 720ab03bd373ba570bdae4e15de1970f6763557b..2a334ffbf93134a9ad53dbd27f49fc8344643002 100755 (executable)
--- a/MAKEALL
+++ b/MAKEALL
@@ -8,7 +8,17 @@ else
        MAKE=make
 fi
 
-[ -d LOG ] || mkdir LOG || exit 1
+if [ "${MAKEALL_LOGDIR}" ] ; then
+       LOG_DIR=${MAKEALL_LOGDIR}
+else
+       LOG_DIR="LOG"
+fi
+
+if [ ! "${BUILD_DIR}" ] ; then
+       BUILD_DIR="."
+fi
+
+[ -d ${LOG_DIR} ] || mkdir ${LOG_DIR} || exit 1
 
 LIST=""
 
@@ -65,19 +75,20 @@ LIST_8xx="  \
 
 LIST_4xx="     \
        ADCIOP          AP1000          AR405           ASH405          \
-       bubinga         CANBT           CMS700          CPCI2DP         \
-       CPCI405         CPCI4052        CPCI405AB       CPCI405DT       \
-       CPCI440         CPCIISER4       CRAYL1          csb272          \
-       csb472          DASA_SIM        DP405           DU405           \
-       ebony           ERIC            EXBITGEN        G2000           \
-       HH405           HUB405          JSE             KAREF           \
-       luan            METROBOX        MIP405          MIP405T         \
-       ML2             ml300           ocotea          OCRTC           \
-       ORSG            p3p440          PCI405          pcs440ep        \
-       PIP405          PLU405          PMC405          PPChameleonEVB  \
-       sbc405          VOH405          VOM405          W7OLMC          \
-       W7OLMG          walnut          WUH405          XPEDITE1K       \
-       yellowstone     yosemite        yucca           bamboo          \
+       bamboo          bubinga         CANBT           CMS700          \
+       CPCI2DP         CPCI405         CPCI4052        CPCI405AB       \
+       CPCI405DT       CPCI440         CPCIISER4       CRAYL1          \
+       csb272          csb472          DASA_SIM        DP405           \
+       DU405           ebony           ERIC            EXBITGEN        \
+       G2000           HH405           HUB405          JSE             \
+       KAREF           luan            METROBOX        MIP405          \
+       MIP405T         ML2             ml300           ocotea          \
+       OCRTC           ORSG            p3p440          PCI405          \
+       pcs440ep        PIP405          PLU405          PMC405          \
+       PPChameleonEVB  sbc405          sequoia         sequoia_nand    \
+       VOH405          VOM405          W7OLMC          W7OLMG          \
+       walnut          WUH405          XPEDITE1K       yellowstone     \
+       yosemite        yucca           bamboo          \
 "
 
 #########################################################################
@@ -303,8 +314,12 @@ build_target() {
 
        ${MAKE} distclean >/dev/null
        ${MAKE} ${target}_config
-       ${MAKE} ${JOBS} all 2>&1 >LOG/$target.MAKELOG | tee LOG/$target.ERR
-       ${CROSS_COMPILE:-ppc_8xx-}size u-boot | tee -a LOG/$target.MAKELOG
+
+       ${MAKE} ${JOBS} all 2>&1 >${LOG_DIR}/$target.MAKELOG \
+                               | tee ${LOG_DIR}/$target.ERR
+
+       ${CROSS_COMPILE:-ppc_8xx-}size ${BUILD_DIR}/u-boot \
+                               | tee -a ${LOG_DIR}/$target.MAKELOG
 }
 
 #-----------------------------------------------------------------------
index 8cc2664c430ca54e7c66a64ccfe54c199ff26d15..c0621f68697f5bcf47c044c24f718aa8afdfa932 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@ PATCHLEVEL = 1
 SUBLEVEL = 4
 EXTRAVERSION =
 U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
-VERSION_FILE = include/version_autogenerated.h
+VERSION_FILE = $(obj)include/version_autogenerated.h
 
 HOSTARCH := $(shell uname -m | \
        sed -e s/i.86/i386/ \
@@ -44,15 +44,79 @@ export      HOSTARCH HOSTOS
 # Deal with colliding definitions from tcsh etc.
 VENDOR=
 
+#########################################################################
+#
+# U-boot build supports producing a object files to the separate external
+# directory. Two use cases are supported:
+#
+# 1) Add O= to the make command line
+# 'make O=/tmp/build all'
+#
+# 2) Set environement variable BUILD_DIR to point to the desired location
+# 'export BUILD_DIR=/tmp/build'
+# 'make'
+#
+# The second approach can also be used with a MAKEALL script
+# 'export BUILD_DIR=/tmp/build'
+# './MAKEALL'
+#
+# Command line 'O=' setting overrides BUILD_DIR environent variable.
+#
+# When none of the above methods is used the local build is performed and
+# the object files are placed in the source directory.
+#
+
+ifdef O
+ifeq ("$(origin O)", "command line")
+BUILD_DIR := $(O)
+endif
+endif
+
+ifneq ($(BUILD_DIR),)
+saved-output := $(BUILD_DIR)
+
+# Attempt to create a output directory.
+$(shell [ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR})
+
+# Verify if it was successful.
+BUILD_DIR := $(shell cd $(BUILD_DIR) && /bin/pwd)
+$(if $(BUILD_DIR),,$(error output directory "$(saved-output)" does not exist))
+endif # ifneq ($(BUILD_DIR),)
+
+OBJTREE                := $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
+SRCTREE                := $(CURDIR)
+TOPDIR         := $(SRCTREE)
+LNDIR          := $(OBJTREE)
+export TOPDIR SRCTREE OBJTREE
+
+MKCONFIG       := $(SRCTREE)/mkconfig
+export MKCONFIG
+
+ifneq ($(OBJTREE),$(SRCTREE))
+REMOTE_BUILD   := 1
+export REMOTE_BUILD
+endif
+
+# $(obj) and (src) are defined in config.mk but here in main Makefile
+# we also need them before config.mk is included which is the case for
+# some targets like unconfig, clean, clobber, distclean, etc.
+ifneq ($(OBJTREE),$(SRCTREE))
+obj := $(OBJTREE)/
+src := $(SRCTREE)/
+else
+obj :=
+src :=
+endif
+export obj src
+
 #########################################################################
 
-TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
-export TOPDIR
+ifeq ($(OBJTREE)/include/config.mk,$(wildcard $(OBJTREE)/include/config.mk))
 
-ifeq (include/config.mk,$(wildcard include/config.mk))
 # load ARCH, BOARD, and CPU configuration
-include include/config.mk
+include $(OBJTREE)/include/config.mk
 export ARCH CPU BOARD VENDOR SOC
+
 ifndef CROSS_COMPILE
 ifeq ($(HOSTARCH),ppc)
 CROSS_COMPILE =
@@ -96,7 +160,6 @@ export       CROSS_COMPILE
 # load other configuration
 include $(TOPDIR)/config.mk
 
-
 #########################################################################
 # U-Boot objects....order is important (i.e. start must be first)
 
@@ -122,6 +185,8 @@ OBJS += cpu/$(CPU)/start1.o cpu/$(CPU)/interrupt.o  cpu/$(CPU)/cache.o
 OBJS += cpu/$(CPU)/cplbhdlr.o  cpu/$(CPU)/cplbmgr.o    cpu/$(CPU)/flush.o
 endif
 
+OBJS := $(addprefix $(obj),$(OBJS))
+
 LIBS  = lib_generic/libgeneric.a
 LIBS += board/$(BOARDDIR)/lib$(BOARD).a
 LIBS += cpu/$(CPU)/lib$(CPU).a
@@ -142,12 +207,13 @@ LIBS += drivers/sk98lin/libsk98lin.a
 LIBS += post/libpost.a post/cpu/libcpu.a
 LIBS += common/libcommon.a
 LIBS += $(BOARDLIBS)
+
+LIBS := $(addprefix $(obj),$(LIBS))
 .PHONY : $(LIBS)
 
 # Add GCC lib
 PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
 
-
 # The "tools" are needed early, so put this first
 # Don't include stuff already done in $(LIBS)
 SUBDIRS        = tools \
@@ -156,44 +222,61 @@ SUBDIRS   = tools \
          post/cpu
 .PHONY : $(SUBDIRS)
 
+ifeq ($(CONFIG_NAND_U_BOOT),y)
+NAND_SPL = nand_spl
+U_BOOT_NAND = $(obj)u-boot-nand.bin
+endif
+
+__OBJS := $(subst $(obj),,$(OBJS))
+__LIBS := $(subst $(obj),,$(LIBS))
+
 #########################################################################
 #########################################################################
 
-ALL = u-boot.srec u-boot.bin System.map
+ALL = $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map $(U_BOOT_NAND)
 
 all:           $(ALL)
 
-u-boot.hex:    u-boot
+$(obj)u-boot.hex:      $(obj)u-boot
                $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
 
-u-boot.srec:   u-boot
+$(obj)u-boot.srec:     $(obj)u-boot
                $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
 
-u-boot.bin:    u-boot
+$(obj)u-boot.bin:      $(obj)u-boot
                $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
 
-u-boot.img:    u-boot.bin
+$(obj)u-boot.img:      $(obj)u-boot.bin
                ./tools/mkimage -A $(ARCH) -T firmware -C none \
                -a $(TEXT_BASE) -e 0 \
                -n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \
                        sed -e 's/"[     ]*$$/ for $(BOARD) board"/') \
                -d $< $@
 
-u-boot.dis:    u-boot
+$(obj)u-boot.dis:      $(obj)u-boot
                $(OBJDUMP) -d $< > $@
 
-u-boot:                depend version $(SUBDIRS) $(OBJS) $(LIBS) $(LDSCRIPT)
+$(obj)u-boot:          depend version $(SUBDIRS) $(OBJS) $(LIBS) $(LDSCRIPT)
                UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed  -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
-               $(LD) $(LDFLAGS) $$UNDEF_SYM $(OBJS) \
-                       --start-group $(LIBS) --end-group $(PLATFORM_LIBS) \
+               cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \
+                       --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
                        -Map u-boot.map -o u-boot
 
+$(OBJS):
+               $(MAKE) -C cpu/$(CPU) $(if $(REMOTE_BUILD),$@,$(notdir $@))
+
 $(LIBS):
-               $(MAKE) -C `dirname $@`
+               $(MAKE) -C $(dir $(subst $(obj),,$@))
 
 $(SUBDIRS):
                $(MAKE) -C $@ all
 
+$(NAND_SPL):   version
+               $(MAKE) -C nand_spl all
+
+$(U_BOOT_NAND):        $(NAND_SPL) $(obj)u-boot.bin
+               cat nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > $(obj)u-boot-nand.bin
+
 version:
                @echo -n "#define U_BOOT_VERSION \"U-Boot " > $(VERSION_FILE); \
                echo -n "$(U_BOOT_VERSION)" >> $(VERSION_FILE); \
@@ -202,33 +285,42 @@ version:
                echo "\"" >> $(VERSION_FILE)
 
 gdbtools:
-               $(MAKE) -C tools/gdb || exit 1
+               $(MAKE) -C tools/gdb all || exit 1
+
+updater:
+               $(MAKE) -C tools/updater all || exit 1
+
+env:
+               $(MAKE) -C tools/env all || exit 1
 
 depend dep:
-               @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir .depend ; done
+               for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir _depend ; done
 
-tags:
-               ctags -w `find $(SUBDIRS) include \
+tags ctags:
+               ctags -w -o $(OBJTREE)/ctags `find $(SUBDIRS) include \
                                lib_generic board/$(BOARDDIR) cpu/$(CPU) lib_$(ARCH) \
                                fs/cramfs fs/fat fs/fdos fs/jffs2 \
                                net disk rtc dtt drivers drivers/sk98lin common \
                        \( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`
 
 etags:
-               etags -a `find $(SUBDIRS) include \
+               etags -a -o $(OBJTREE)/etags `find $(SUBDIRS) include \
                                lib_generic board/$(BOARDDIR) cpu/$(CPU) lib_$(ARCH) \
                                fs/cramfs fs/fat fs/fdos fs/jffs2 \
                                net disk rtc dtt drivers drivers/sk98lin common \
                        \( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`
 
-System.map:    u-boot
+$(obj)System.map:      $(obj)u-boot
                @$(NM) $< | \
                grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
-               sort > System.map
+               sort > $(obj)System.map
 
 #########################################################################
 else
-all install u-boot u-boot.srec depend dep:
+all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
+$(obj)u-boot.img $(obj)u-boot.dis $(obj)u-boot \
+$(SUBDIRS) version gdbtools updater env depend \
+dep tags ctags etags $(obj)System.map:
        @echo "System not configured - see README" >&2
        @ exit 1
 endif
@@ -236,7 +328,8 @@ endif
 #########################################################################
 
 unconfig:
-       @rm -f include/config.h include/config.mk board/*/config.tmp
+       @rm -f $(obj)include/config.h $(obj)include/config.mk \
+               $(obj)board/*/config.tmp $(obj)board/*/*/config.tmp
 
 #========================================================================
 # PowerPC
@@ -247,29 +340,29 @@ unconfig:
 #########################################################################
 
 canmb_config:  unconfig
-       @./mkconfig -a canmb ppc mpc5xxx canmb
+       @$(MKCONFIG) -a canmb ppc mpc5xxx canmb
 
 cmi_mpc5xx_config:     unconfig
-       @./mkconfig $(@:_config=) ppc mpc5xx cmi
+       @$(MKCONFIG) $(@:_config=) ppc mpc5xx cmi
 
 PATI_config:           unconfig
-       @./mkconfig $(@:_config=) ppc mpc5xx pati mpl
+       @$(MKCONFIG) $(@:_config=) ppc mpc5xx pati mpl
 
 #########################################################################
 ## MPC5xxx Systems
 #########################################################################
 
 aev_config: unconfig
-       @./mkconfig -a aev ppc mpc5xxx tqm5200
+       @$(MKCONFIG) -a aev ppc mpc5xxx tqm5200
 
 BC3450_config: unconfig
-       @./mkconfig -a BC3450 ppc mpc5xxx bc3450
+       @$(MKCONFIG) -a BC3450 ppc mpc5xxx bc3450
 
 cpci5200_config:  unconfig
-       @./mkconfig -a cpci5200  ppc mpc5xxx cpci5200 esd
+       @$(MKCONFIG) -a cpci5200  ppc mpc5xxx cpci5200 esd
 
 hmi1001_config:         unconfig
-       @./mkconfig hmi1001 ppc mpc5xxx hmi1001
+       @$(MKCONFIG) hmi1001 ppc mpc5xxx hmi1001
 
 Lite5200_config                                \
 Lite5200_LOWBOOT_config                        \
@@ -281,144 +374,176 @@ icecube_5200_DDR_config                 \
 icecube_5200_DDR_LOWBOOT_config        \
 icecube_5200_DDR_LOWBOOT08_config      \
 icecube_5100_config:                   unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @mkdir -p $(obj)board/icecube
+       @ >$(obj)include/config.h
        @[ -z "$(findstring LOWBOOT_,$@)" ] || \
                { if [ "$(findstring DDR,$@)" ] ; \
-                       then echo "TEXT_BASE = 0xFF800000" >board/icecube/config.tmp ; \
-                       else echo "TEXT_BASE = 0xFF000000" >board/icecube/config.tmp ; \
+                       then echo "TEXT_BASE = 0xFF800000" >$(obj)board/icecube/config.tmp ; \
+                       else echo "TEXT_BASE = 0xFF000000" >$(obj)board/icecube/config.tmp ; \
                  fi ; \
                  echo "... with LOWBOOT configuration" ; \
                }
        @[ -z "$(findstring LOWBOOT08,$@)" ] || \
-               { echo "TEXT_BASE = 0xFF800000" >board/icecube/config.tmp ; \
+               { echo "TEXT_BASE = 0xFF800000" >$(obj)board/icecube/config.tmp ; \
                  echo "... with 8 MB flash only" ; \
                  echo "... with LOWBOOT configuration" ; \
                }
        @[ -z "$(findstring DDR,$@)" ] || \
-               { echo "#define CONFIG_MPC5200_DDR"     >>include/config.h ; \
+               { echo "#define CONFIG_MPC5200_DDR"     >>$(obj)include/config.h ; \
                  echo "... DDR memory revision" ; \
                }
        @[ -z "$(findstring 5200,$@)" ] || \
-               { echo "#define CONFIG_MPC5200"         >>include/config.h ; \
+               { echo "#define CONFIG_MPC5200"         >>$(obj)include/config.h ; \
                  echo "... with MPC5200 processor" ; \
                }
        @[ -z "$(findstring 5100,$@)" ] || \
-               { echo "#define CONFIG_MGT5100"         >>include/config.h ; \
+               { echo "#define CONFIG_MGT5100"         >>$(obj)include/config.h ; \
                  echo "... with MGT5100 processor" ; \
                }
-       @./mkconfig -a IceCube ppc mpc5xxx icecube
+       @$(MKCONFIG) -a IceCube ppc mpc5xxx icecube
 
 inka4x0_config:        unconfig
-       @./mkconfig inka4x0 ppc mpc5xxx inka4x0
+       @$(MKCONFIG) inka4x0 ppc mpc5xxx inka4x0
 
 lite5200b_config       \
 lite5200b_LOWBOOT_config:      unconfig
-       @ >include/config.h
-       @ echo "#define CONFIG_MPC5200_DDR"     >>include/config.h
+       @mkdir -p $(obj)include
+       @mkdir -p $(obj)board/icecube
+       @ >$(obj)include/config.h
+       @ echo "#define CONFIG_MPC5200_DDR"     >>$(obj)include/config.h
        @ echo "... DDR memory revision"
-       @ echo "#define CONFIG_MPC5200"         >>include/config.h
-       @ echo "#define CONFIG_LITE5200B"       >>include/config.h
+       @ echo "#define CONFIG_MPC5200"         >>$(obj)include/config.h
+       @ echo "#define CONFIG_LITE5200B"       >>$(obj)include/config.h
        @[ -z "$(findstring LOWBOOT_,$@)" ] || \
-               { echo "TEXT_BASE = 0xFF000000" >board/icecube/config.tmp ; \
+               { echo "TEXT_BASE = 0xFF000000" >$(obj)board/icecube/config.tmp ; \
                  echo "... with LOWBOOT configuration" ; \
                }
        @ echo "... with MPC5200B processor"
-       @./mkconfig -a IceCube  ppc mpc5xxx icecube
+       @$(MKCONFIG) -a IceCube  ppc mpc5xxx icecube
 
 mcc200_config  \
-mcc200_SDRAM   \
-mcc200_highboot        \
-mcc200_COM12   \
-mcc200_highboot_SDRAM: unconfig
-       @ >include/config.h
+mcc200_SDRAM_config    \
+mcc200_highboot_config \
+mcc200_COM12_config    \
+mcc200_COM12_SDRAM_config      \
+mcc200_COM12_highboot_config   \
+mcc200_COM12_highboot_SDRAM_config     \
+mcc200_highboot_SDRAM_config   \
+prs200_config  \
+prs200_DDR_config      \
+prs200_highboot_config \
+prs200_highboot_DDR_config:    unconfig
+       @mkdir -p $(obj)include
+       @mkdir -p $(obj)board/mcc200
+       @ >$(obj)include/config.h
        @[ -n "$(findstring highboot,$@)" ] || \
                { echo "... with lowboot configuration" ; \
                }
        @[ -z "$(findstring highboot,$@)" ] || \
-               { echo "TEXT_BASE = 0xFFF00000" >board/mcc200/config.tmp ; \
+               { echo "TEXT_BASE = 0xFFF00000" >$(obj)board/mcc200/config.tmp ; \
                  echo "... with highboot configuration" ; \
                }
        @[ -n "$(findstring _SDRAM,$@)" ] || \
-               { echo "... with DDR" ; \
+               { if [ -n "$(findstring mcc200,$@)" ]; \
+                 then \
+                       echo "... with DDR" ; \
+                 else \
+                       if [ -n "$(findstring _DDR,$@)" ];\
+                       then \
+                               echo "... with DDR" ; \
+                       else \
+                               echo "#define CONFIG_MCC200_SDRAM" >>$(obj)include/config.h ;\
+                               echo "... with SDRAM" ; \
+                       fi; \
+                 fi; \
                }
        @[ -z "$(findstring _SDRAM,$@)" ] || \
-               { echo "#define CONFIG_MCC200_SDRAM"    >>include/config.h ; \
+               { echo "#define CONFIG_MCC200_SDRAM"    >>$(obj)include/config.h ; \
                  echo "... with SDRAM" ; \
                }
        @[ -z "$(findstring COM12,$@)" ] || \
-               { echo "#define CONFIG_CONSOLE_COM12"   >>include/config.h ; \
+               { echo "#define CONFIG_CONSOLE_COM12"   >>$(obj)include/config.h ; \
                  echo "... with console on COM12" ; \
                }
-       @./mkconfig -a mcc200 ppc mpc5xxx mcc200
+       @[ -z "$(findstring prs200,$@)" ] || \
+               { echo "#define CONFIG_PRS200"  >>$(obj)include/config.h ;\
+               }
+       @$(MKCONFIG) -n $@ -a mcc200 ppc mpc5xxx mcc200
 
 o2dnt_config:
-       @./mkconfig o2dnt ppc mpc5xxx o2dnt
+       @$(MKCONFIG) o2dnt ppc mpc5xxx o2dnt
 
 pf5200_config:  unconfig
-       @./mkconfig pf5200  ppc mpc5xxx pf5200 esd
+       @$(MKCONFIG) pf5200  ppc mpc5xxx pf5200 esd
 
 PM520_config \
 PM520_DDR_config \
 PM520_ROMBOOT_config \
 PM520_ROMBOOT_DDR_config:      unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
        @[ -z "$(findstring DDR,$@)" ] || \
-               { echo "#define CONFIG_MPC5200_DDR"     >>include/config.h ; \
+               { echo "#define CONFIG_MPC5200_DDR"     >>$(obj)include/config.h ; \
                  echo "... DDR memory revision" ; \
                }
        @[ -z "$(findstring ROMBOOT,$@)" ] || \
-               { echo "#define CONFIG_BOOT_ROM" >>include/config.h ; \
+               { echo "#define CONFIG_BOOT_ROM" >>$(obj)include/config.h ; \
                  echo "... booting from 8-bit flash" ; \
                }
-       @./mkconfig -a PM520 ppc mpc5xxx pm520
+       @$(MKCONFIG) -a PM520 ppc mpc5xxx pm520
 
 smmaco4_config: unconfig
-       @./mkconfig -a smmaco4 ppc mpc5xxx tqm5200
+       @$(MKCONFIG) -a smmaco4 ppc mpc5xxx tqm5200
 
 spieval_config:        unconfig
-       @./mkconfig -a spieval ppc mpc5xxx tqm5200
+       @$(MKCONFIG) -a spieval ppc mpc5xxx tqm5200
 
 TB5200_B_config \
 TB5200_config: unconfig
+       @mkdir -p $(obj)include
        @[ -z "$(findstring _B,$@)" ] || \
-               { echo "#define CONFIG_TQM5200_B"       >>include/config.h ; \
+               { echo "#define CONFIG_TQM5200_B"       >>$(obj)include/config.h ; \
                  echo "... with MPC5200B processor" ; \
                }
-       @./mkconfig -n $@ -a TB5200 ppc mpc5xxx tqm5200
+       @$(MKCONFIG) -n $@ -a TB5200 ppc mpc5xxx tqm5200
 
 MINI5200_config        \
 EVAL5200_config        \
 TOP5200_config:        unconfig
-       @ echo "#define CONFIG_$(@:_config=) 1" >include/config.h
-       @./mkconfig -n $@ -a TOP5200 ppc mpc5xxx top5200 emk
+       @mkdir -p $(obj)include
+       @ echo "#define CONFIG_$(@:_config=) 1" >$(obj)include/config.h
+       @$(MKCONFIG) -n $@ -a TOP5200 ppc mpc5xxx top5200 emk
 
 Total5100_config               \
 Total5200_config               \
 Total5200_lowboot_config       \
 Total5200_Rev2_config          \
 Total5200_Rev2_lowboot_config: unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @mkdir -p $(obj)board/total5200
+       @ >$(obj)include/config.h
        @[ -z "$(findstring 5100,$@)" ] || \
-               { echo "#define CONFIG_MGT5100"         >>include/config.h ; \
+               { echo "#define CONFIG_MGT5100"         >>$(obj)include/config.h ; \
                  echo "... with MGT5100 processor" ; \
                }
        @[ -z "$(findstring 5200,$@)" ] || \
-               { echo "#define CONFIG_MPC5200"         >>include/config.h ; \
+               { echo "#define CONFIG_MPC5200"         >>$(obj)include/config.h ; \
                  echo "... with MPC5200 processor" ; \
                }
        @[ -n "$(findstring Rev,$@)" ] || \
-               { echo "#define CONFIG_TOTAL5200_REV 1" >>include/config.h ; \
+               { echo "#define CONFIG_TOTAL5200_REV 1" >>$(obj)include/config.h ; \
                  echo "... revision 1 board" ; \
                }
        @[ -z "$(findstring Rev2_,$@)" ] || \
-               { echo "#define CONFIG_TOTAL5200_REV 2" >>include/config.h ; \
+               { echo "#define CONFIG_TOTAL5200_REV 2" >>$(obj)include/config.h ; \
                  echo "... revision 2 board" ; \
                }
        @[ -z "$(findstring lowboot_,$@)" ] || \
-               { echo "TEXT_BASE = 0xFE000000" >board/total5200/config.tmp ; \
+               { echo "TEXT_BASE = 0xFE000000" >$(obj)board/total5200/config.tmp ; \
                  echo "... with lowboot configuration" ; \
                }
-       @./mkconfig -a Total5200 ppc mpc5xxx total5200
+       @$(MKCONFIG) -a Total5200 ppc mpc5xxx total5200
 
 cam5200_config \
 fo300_config \
@@ -429,36 +554,38 @@ TQM5200_B_config \
 TQM5200_B_HIGHBOOT_config \
 TQM5200_config \
 TQM5200_STK100_config: unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @mkdir -p $(obj)board/tqm5200
+       @ >$(obj)include/config.h
        @[ -z "$(findstring cam5200,$@)" ] || \
-               { echo "#define CONFIG_CAM5200" >>include/config.h ; \
-                 echo "#define CONFIG_TQM5200S"        >>include/config.h ; \
-                 echo "#define CONFIG_TQM5200_B"       >>include/config.h ; \
+               { echo "#define CONFIG_CAM5200" >>$(obj)include/config.h ; \
+                 echo "#define CONFIG_TQM5200S"        >>$(obj)include/config.h ; \
+                 echo "#define CONFIG_TQM5200_B"       >>$(obj)include/config.h ; \
                  echo "... TQM5200S on Cam5200" ; \
                }
        @[ -z "$(findstring fo300,$@)" ] || \
-               { echo "#define CONFIG_FO300"   >>include/config.h ; \
+               { echo "#define CONFIG_FO300"   >>$(obj)include/config.h ; \
                  echo "... TQM5200 on FO300" ; \
                }
        @[ -z "$(findstring MiniFAP,$@)" ] || \
-               { echo "#define CONFIG_MINIFAP" >>include/config.h ; \
+               { echo "#define CONFIG_MINIFAP" >>$(obj)include/config.h ; \
                  echo "... TQM5200_AC on MiniFAP" ; \
                }
        @[ -z "$(findstring STK100,$@)" ] || \
-               { echo "#define CONFIG_STK52XX_REV100"  >>include/config.h ; \
+               { echo "#define CONFIG_STK52XX_REV100"  >>$(obj)include/config.h ; \
                  echo "... on a STK52XX.100 base board" ; \
                }
        @[ -z "$(findstring TQM5200_B,$@)" ] || \
-               { echo "#define CONFIG_TQM5200_B"       >>include/config.h ; \
+               { echo "#define CONFIG_TQM5200_B"       >>$(obj)include/config.h ; \
                }
        @[ -z "$(findstring TQM5200S,$@)" ] || \
-               { echo "#define CONFIG_TQM5200S"        >>include/config.h ; \
-                 echo "#define CONFIG_TQM5200_B"       >>include/config.h ; \
+               { echo "#define CONFIG_TQM5200S"        >>$(obj)include/config.h ; \
+                 echo "#define CONFIG_TQM5200_B"       >>$(obj)include/config.h ; \
                }
        @[ -z "$(findstring HIGHBOOT,$@)" ] || \
-               { echo "TEXT_BASE = 0xFFF00000" >board/tqm5200/config.tmp ; \
+               { echo "TEXT_BASE = 0xFFF00000" >$(obj)board/tqm5200/config.tmp ; \
                }
-       @./mkconfig -n $@ -a TQM5200 ppc mpc5xxx tqm5200
+       @$(MKCONFIG) -n $@ -a TQM5200 ppc mpc5xxx tqm5200
 
 #########################################################################
 ## MPC8xx Systems
@@ -468,9 +595,10 @@ Adder_config    \
 Adder87x_config \
 AdderII_config  \
        :               unconfig
+       @mkdir -p $(obj)include
        $(if $(findstring AdderII,$@), \
-       @echo "#define CONFIG_MPC852T" > include/config.h)
-       @./mkconfig -a Adder ppc mpc8xx adder
+       @echo "#define CONFIG_MPC852T" > $(obj)include/config.h)
+       @$(MKCONFIG) -a Adder ppc mpc8xx adder
 
 ADS860_config     \
 FADS823_config    \
@@ -478,154 +606,160 @@ FADS850SAR_config \
 MPC86xADS_config  \
 MPC885ADS_config  \
 FADS860T_config:       unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx fads
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx fads
 
 AMX860_config  :       unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx amx860 westel
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx amx860 westel
 
 c2mon_config:          unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx c2mon
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx c2mon
 
 CCM_config:            unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx CCM siemens
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx CCM siemens
 
 cogent_mpc8xx_config:  unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx cogent
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx cogent
 
 ELPT860_config:                unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx elpt860 LEOX
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx elpt860 LEOX
 
 EP88x_config:          unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx ep88x
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx ep88x
 
 ESTEEM192E_config:     unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx esteem192e
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx esteem192e
 
 ETX094_config  :       unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx etx094
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx etx094
 
 FLAGADM_config:        unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx flagadm
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx flagadm
 
 xtract_GEN860T = $(subst _SC,,$(subst _config,,$1))
 
 GEN860T_SC_config      \
 GEN860T_config: unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
        @[ -z "$(findstring _SC,$@)" ] || \
-               { echo "#define CONFIG_SC" >>include/config.h ; \
+               { echo "#define CONFIG_SC" >>$(obj)include/config.h ; \
                  echo "With reduced H/W feature set (SC)..." ; \
                }
-       @./mkconfig -a $(call xtract_GEN860T,$@) ppc mpc8xx gen860t
+       @$(MKCONFIG) -a $(call xtract_GEN860T,$@) ppc mpc8xx gen860t
 
 GENIETV_config:        unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx genietv
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx genietv
 
 GTH_config:    unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx gth
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx gth
 
 hermes_config  :       unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx hermes
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx hermes
 
 HMI10_config   :       unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx tqm8xx
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx tqm8xx
 
 IAD210_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx IAD210 siemens
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx IAD210 siemens
 
 xtract_ICU862 = $(subst _100MHz,,$(subst _config,,$1))
 
 ICU862_100MHz_config   \
 ICU862_config: unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
        @[ -z "$(findstring _100MHz,$@)" ] || \
-               { echo "#define CONFIG_100MHz"  >>include/config.h ; \
+               { echo "#define CONFIG_100MHz"  >>$(obj)include/config.h ; \
                  echo "... with 100MHz system clock" ; \
                }
-       @./mkconfig -a $(call xtract_ICU862,$@) ppc mpc8xx icu862
+       @$(MKCONFIG) -a $(call xtract_ICU862,$@) ppc mpc8xx icu862
 
 IP860_config   :       unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx ip860
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx ip860
 
 IVML24_256_config \
 IVML24_128_config \
 IVML24_config: unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
        @[ -z "$(findstring IVML24_config,$@)" ] || \
-                { echo "#define CONFIG_IVML24_16M"     >>include/config.h ; \
+                { echo "#define CONFIG_IVML24_16M"     >>$(obj)include/config.h ; \
                 }
        @[ -z "$(findstring IVML24_128_config,$@)" ] || \
-                { echo "#define CONFIG_IVML24_32M"     >>include/config.h ; \
+                { echo "#define CONFIG_IVML24_32M"     >>$(obj)include/config.h ; \
                 }
        @[ -z "$(findstring IVML24_256_config,$@)" ] || \
-                { echo "#define CONFIG_IVML24_64M"     >>include/config.h ; \
+                { echo "#define CONFIG_IVML24_64M"     >>$(obj)include/config.h ; \
                 }
-       @./mkconfig -a IVML24 ppc mpc8xx ivm
+       @$(MKCONFIG) -a IVML24 ppc mpc8xx ivm
 
 IVMS8_256_config \
 IVMS8_128_config \
 IVMS8_config:  unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
        @[ -z "$(findstring IVMS8_config,$@)" ] || \
-                { echo "#define CONFIG_IVMS8_16M"      >>include/config.h ; \
+                { echo "#define CONFIG_IVMS8_16M"      >>$(obj)include/config.h ; \
                 }
        @[ -z "$(findstring IVMS8_128_config,$@)" ] || \
-                { echo "#define CONFIG_IVMS8_32M"      >>include/config.h ; \
+                { echo "#define CONFIG_IVMS8_32M"      >>$(obj)include/config.h ; \
                 }
        @[ -z "$(findstring IVMS8_256_config,$@)" ] || \
-                { echo "#define CONFIG_IVMS8_64M"      >>include/config.h ; \
+                { echo "#define CONFIG_IVMS8_64M"      >>$(obj)include/config.h ; \
                 }
-       @./mkconfig -a IVMS8 ppc mpc8xx ivm
+       @$(MKCONFIG) -a IVMS8 ppc mpc8xx ivm
 
 KUP4K_config   :       unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx kup4k kup
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx kup4k kup
 
 KUP4X_config    :       unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx kup4x kup
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx kup4x kup
 
 LANTEC_config  :       unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx lantec
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx lantec
 
 lwmon_config:          unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx lwmon
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx lwmon
 
 MBX_config     \
 MBX860T_config:        unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx mbx8xx
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx mbx8xx
 
 MHPC_config:           unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx mhpc eltec
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx mhpc eltec
 
 MVS1_config :          unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx mvs1
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx mvs1
 
 xtract_NETVIA = $(subst _V2,,$(subst _config,,$1))
 
 NETVIA_V2_config \
 NETVIA_config:         unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
        @[ -z "$(findstring NETVIA_config,$@)" ] || \
-                { echo "#define CONFIG_NETVIA_VERSION 1" >>include/config.h ; \
+                { echo "#define CONFIG_NETVIA_VERSION 1" >>$(obj)include/config.h ; \
                  echo "... Version 1" ; \
                 }
        @[ -z "$(findstring NETVIA_V2_config,$@)" ] || \
-                { echo "#define CONFIG_NETVIA_VERSION 2" >>include/config.h ; \
+                { echo "#define CONFIG_NETVIA_VERSION 2" >>$(obj)include/config.h ; \
                  echo "... Version 2" ; \
                 }
-       @./mkconfig -a $(call xtract_NETVIA,$@) ppc mpc8xx netvia
+       @$(MKCONFIG) -a $(call xtract_NETVIA,$@) ppc mpc8xx netvia
 
 xtract_NETPHONE = $(subst _V2,,$(subst _config,,$1))
 
 NETPHONE_V2_config \
 NETPHONE_config:       unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
        @[ -z "$(findstring NETPHONE_config,$@)" ] || \
-                { echo "#define CONFIG_NETPHONE_VERSION 1" >>include/config.h ; \
+                { echo "#define CONFIG_NETPHONE_VERSION 1" >>$(obj)include/config.h ; \
                 }
        @[ -z "$(findstring NETPHONE_V2_config,$@)" ] || \
-                { echo "#define CONFIG_NETPHONE_VERSION 2" >>include/config.h ; \
+                { echo "#define CONFIG_NETPHONE_VERSION 2" >>$(obj)include/config.h ; \
                 }
-       @./mkconfig -a $(call xtract_NETPHONE,$@) ppc mpc8xx netphone
+       @$(MKCONFIG) -a $(call xtract_NETPHONE,$@) ppc mpc8xx netphone
 
 xtract_NETTA = $(subst _SWAPHOOK,,$(subst _6412,,$(subst _ISDN,,$(subst _config,,$1))))
 
@@ -637,85 +771,88 @@ NETTA_ISDN_6412_config \
 NETTA_ISDN_config \
 NETTA_6412_config \
 NETTA_config:          unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
        @[ -z "$(findstring ISDN_,$@)" ] || \
-                { echo "#define CONFIG_NETTA_ISDN 1" >>include/config.h ; \
+                { echo "#define CONFIG_NETTA_ISDN 1" >>$(obj)include/config.h ; \
                 }
        @[ -n "$(findstring ISDN_,$@)" ] || \
-                { echo "#undef CONFIG_NETTA_ISDN" >>include/config.h ; \
+                { echo "#undef CONFIG_NETTA_ISDN" >>$(obj)include/config.h ; \
                 }
        @[ -z "$(findstring 6412_,$@)" ] || \
-                { echo "#define CONFIG_NETTA_6412 1" >>include/config.h ; \
+                { echo "#define CONFIG_NETTA_6412 1" >>$(obj)include/config.h ; \
                 }
        @[ -n "$(findstring 6412_,$@)" ] || \
-                { echo "#undef CONFIG_NETTA_6412" >>include/config.h ; \
+                { echo "#undef CONFIG_NETTA_6412" >>$(obj)include/config.h ; \
                 }
        @[ -z "$(findstring SWAPHOOK_,$@)" ] || \
-                { echo "#define CONFIG_NETTA_SWAPHOOK 1" >>include/config.h ; \
+                { echo "#define CONFIG_NETTA_SWAPHOOK 1" >>$(obj)include/config.h ; \
                 }
        @[ -n "$(findstring SWAPHOOK_,$@)" ] || \
-                { echo "#undef CONFIG_NETTA_SWAPHOOK" >>include/config.h ; \
+                { echo "#undef CONFIG_NETTA_SWAPHOOK" >>$(obj)include/config.h ; \
                 }
-       @./mkconfig -a $(call xtract_NETTA,$@) ppc mpc8xx netta
+       @$(MKCONFIG) -a $(call xtract_NETTA,$@) ppc mpc8xx netta
 
 xtract_NETTA2 = $(subst _V2,,$(subst _config,,$1))
 
 NETTA2_V2_config \
 NETTA2_config:         unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
        @[ -z "$(findstring NETTA2_config,$@)" ] || \
-                { echo "#define CONFIG_NETTA2_VERSION 1" >>include/config.h ; \
+                { echo "#define CONFIG_NETTA2_VERSION 1" >>$(obj)include/config.h ; \
                 }
        @[ -z "$(findstring NETTA2_V2_config,$@)" ] || \
-                { echo "#define CONFIG_NETTA2_VERSION 2" >>include/config.h ; \
+                { echo "#define CONFIG_NETTA2_VERSION 2" >>$(obj)include/config.h ; \
                 }
-       @./mkconfig -a $(call xtract_NETTA2,$@) ppc mpc8xx netta2
+       @$(MKCONFIG) -a $(call xtract_NETTA2,$@) ppc mpc8xx netta2
 
 NC650_Rev1_config \
 NC650_Rev2_config \
 CP850_config:  unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
        @[ -z "$(findstring CP850,$@)" ] || \
-                { echo "#define CONFIG_CP850 1" >>include/config.h ; \
-                  echo "#define CONFIG_IDS852_REV2 1" >>include/config.h ; \
+                { echo "#define CONFIG_CP850 1" >>$(obj)include/config.h ; \
+                  echo "#define CONFIG_IDS852_REV2 1" >>$(obj)include/config.h ; \
                 }
        @[ -z "$(findstring Rev1,$@)" ] || \
-                { echo "#define CONFIG_IDS852_REV1 1" >>include/config.h ; \
+                { echo "#define CONFIG_IDS852_REV1 1" >>$(obj)include/config.h ; \
                 }
        @[ -z "$(findstring Rev2,$@)" ] || \
-                { echo "#define CONFIG_IDS852_REV2 1" >>include/config.h ; \
+                { echo "#define CONFIG_IDS852_REV2 1" >>$(obj)include/config.h ; \
                 }
-       @./mkconfig -a NC650 ppc mpc8xx nc650
+       @$(MKCONFIG) -a NC650 ppc mpc8xx nc650
 
 NX823_config:          unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx nx823
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx nx823
 
 pcu_e_config:          unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx pcu_e siemens
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx pcu_e siemens
 
 QS850_config:  unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx qs850 snmc
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx qs850 snmc
 
 QS823_config:  unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx qs850 snmc
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx qs850 snmc
 
 QS860T_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx qs860t snmc
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx qs860t snmc
 
 quantum_config:        unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx quantum
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx quantum
 
 R360MPI_config:        unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx r360mpi
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx r360mpi
 
 RBC823_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx rbc823
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx rbc823
 
 RPXClassic_config:     unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx RPXClassic
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx RPXClassic
 
 RPXlite_config:                unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx RPXlite
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx RPXlite
 
 RPXlite_DW_64_config           \
 RPXlite_DW_LCD_config          \
@@ -725,55 +862,56 @@ RPXlite_DW_NVRAM_64_config      \
 RPXlite_DW_NVRAM_LCD_config    \
 RPXlite_DW_NVRAM_64_LCD_config  \
 RPXlite_DW_config:         unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
        @[ -z "$(findstring _64,$@)" ] || \
-               { echo "#define RPXlite_64MHz"          >>include/config.h ; \
+               { echo "#define RPXlite_64MHz"          >>$(obj)include/config.h ; \
                  echo "... with 64MHz system clock ..."; \
                }
        @[ -z "$(findstring _LCD,$@)" ] || \
-               { echo "#define CONFIG_LCD"             >>include/config.h ; \
-                 echo "#define CONFIG_NEC_NL6448BC20"  >>include/config.h ; \
+               { echo "#define CONFIG_LCD"             >>$(obj)include/config.h ; \
+                 echo "#define CONFIG_NEC_NL6448BC20"  >>$(obj)include/config.h ; \
                  echo "... with LCD display ..."; \
                }
        @[ -z "$(findstring _NVRAM,$@)" ] || \
-               { echo "#define  CFG_ENV_IS_IN_NVRAM"   >>include/config.h ; \
+               { echo "#define  CFG_ENV_IS_IN_NVRAM"   >>$(obj)include/config.h ; \
                  echo "... with ENV in NVRAM ..."; \
                }
-       @./mkconfig -a RPXlite_DW ppc mpc8xx RPXlite_dw
+       @$(MKCONFIG) -a RPXlite_DW ppc mpc8xx RPXlite_dw
 
 rmu_config:    unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx rmu
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx rmu
 
 RRvision_config:       unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx RRvision
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx RRvision
 
 RRvision_LCD_config:   unconfig
-       @echo "#define CONFIG_LCD" >include/config.h
-       @echo "#define CONFIG_SHARP_LQ104V7DS01" >>include/config.h
-       @./mkconfig -a RRvision ppc mpc8xx RRvision
+       @mkdir -p $(obj)include
+       @echo "#define CONFIG_LCD" >$(obj)include/config.h
+       @echo "#define CONFIG_SHARP_LQ104V7DS01" >>$(obj)include/config.h
+       @$(MKCONFIG) -a RRvision ppc mpc8xx RRvision
 
 SM850_config   :       unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx tqm8xx
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx tqm8xx
 
 spc1920_config:
-       @./mkconfig $(@:_config=) ppc mpc8xx spc1920
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx spc1920
 
 SPD823TS_config:       unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx spd8xx
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx spd8xx
 
 stxxtc_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx stxxtc
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx stxxtc
 
 svm_sc8xx_config:      unconfig
-       @ >include/config.h
-       @./mkconfig $(@:_config=) ppc mpc8xx svm_sc8xx
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx svm_sc8xx
 
 SXNI855T_config:       unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx sixnet
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx sixnet
 
 # EMK MPC8xx based modules
 TOP860_config:         unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx top860 emk
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx top860 emk
 
 # Play some tricks for configuration selection
 # Only 855 and 860 boards may come with FEC
@@ -797,31 +935,35 @@ TQM862M_config            \
 TQM866M_config         \
 TQM885D_config         \
 virtlab2_config:       unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
        @[ -z "$(findstring _LCD,$@)" ] || \
-               { echo "#define CONFIG_LCD"             >>include/config.h ; \
-                 echo "#define CONFIG_NEC_NL6448BC20"  >>include/config.h ; \
+               { echo "#define CONFIG_LCD"             >>$(obj)include/config.h ; \
+                 echo "#define CONFIG_NEC_NL6448BC20"  >>$(obj)include/config.h ; \
                  echo "... with LCD display" ; \
                }
-       @./mkconfig -a $(call xtract_8xx,$@) ppc mpc8xx tqm8xx
+       @$(MKCONFIG) -a $(call xtract_8xx,$@) ppc mpc8xx tqm8xx
 
 TTTech_config: unconfig
-       @echo "#define CONFIG_LCD" >include/config.h
-       @echo "#define CONFIG_SHARP_LQ104V7DS01" >>include/config.h
-       @./mkconfig -a TQM823L ppc mpc8xx tqm8xx
+       @mkdir -p $(obj)include
+       @echo "#define CONFIG_LCD" >$(obj)include/config.h
+       @echo "#define CONFIG_SHARP_LQ104V7DS01" >>$(obj)include/config.h
+       @$(MKCONFIG) -a TQM823L ppc mpc8xx tqm8xx
 
 uc100_config   :       unconfig
-       @./mkconfig $(@:_config=) ppc mpc8xx uc100
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx uc100
 
 v37_config:    unconfig
-       @echo "#define CONFIG_LCD" >include/config.h
-       @echo "#define CONFIG_SHARP_LQ084V1DG21" >>include/config.h
-       @./mkconfig $(@:_config=) ppc mpc8xx v37
+       @mkdir -p $(obj)include
+       @echo "#define CONFIG_LCD" >$(obj)include/config.h
+       @echo "#define CONFIG_SHARP_LQ084V1DG21" >>$(obj)include/config.h
+       @$(MKCONFIG) $(@:_config=) ppc mpc8xx v37
 
 wtk_config:    unconfig
-       @echo "#define CONFIG_LCD" >include/config.h
-       @echo "#define CONFIG_SHARP_LQ065T9DR51U" >>include/config.h
-       @./mkconfig -a TQM823L ppc mpc8xx tqm8xx
+       @mkdir -p $(obj)include
+       @echo "#define CONFIG_LCD" >$(obj)include/config.h
+       @echo "#define CONFIG_SHARP_LQ065T9DR51U" >>$(obj)include/config.h
+       @$(MKCONFIG) -a TQM823L ppc mpc8xx tqm8xx
 
 #########################################################################
 ## PPC4xx Systems
@@ -829,146 +971,148 @@ wtk_config:     unconfig
 xtract_4xx = $(subst _25,,$(subst _33,,$(subst _BA,,$(subst _ME,,$(subst _HI,,$(subst _config,,$1))))))
 
 ADCIOP_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx adciop esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx adciop esd
 
 AP1000_config:unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx ap1000 amirix
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx ap1000 amirix
 
 APC405_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx apc405 esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx apc405 esd
 
 AR405_config:  unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx ar405 esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx ar405 esd
 
 ASH405_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx ash405 esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx ash405 esd
 
 bamboo_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx bamboo amcc
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx bamboo amcc
 
 bubinga_config:        unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx bubinga amcc
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx bubinga amcc
 
 CANBT_config:  unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx canbt esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx canbt esd
 
 CATcenter_config       \
 CATcenter_25_config    \
 CATcenter_33_config:   unconfig
-       @ echo "/* CATcenter uses PPChameleon Model ME */"  > include/config.h
-       @ echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 1" >> include/config.h
+       @mkdir -p $(obj)include
+       @ echo "/* CATcenter uses PPChameleon Model ME */"  > $(obj)include/config.h
+       @ echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 1" >> $(obj)include/config.h
        @[ -z "$(findstring _25,$@)" ] || \
-               { echo "#define CONFIG_PPCHAMELEON_CLK_25" >>include/config.h ; \
+               { echo "#define CONFIG_PPCHAMELEON_CLK_25" >> $(obj)include/config.h ; \
                  echo "SysClk = 25MHz" ; \
                }
        @[ -z "$(findstring _33,$@)" ] || \
-               { echo "#define CONFIG_PPCHAMELEON_CLK_33" >>include/config.h ; \
+               { echo "#define CONFIG_PPCHAMELEON_CLK_33" >> $(obj)include/config.h ; \
                  echo "SysClk = 33MHz" ; \
                }
-       @./mkconfig -a $(call xtract_4xx,$@) ppc ppc4xx PPChameleonEVB dave
+       @$(MKCONFIG) -a $(call xtract_4xx,$@) ppc ppc4xx PPChameleonEVB dave
 
 CPCI2DP_config:        unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx cpci2dp esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx cpci2dp esd
 
 CPCI405_config \
 CPCI4052_config        \
 CPCI405DT_config       \
 CPCI405AB_config:      unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx cpci405 esd
-       @echo "BOARD_REVISION = $(@:_config=)"  >>include/config.mk
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx cpci405 esd
+       @echo "BOARD_REVISION = $(@:_config=)"  >> $(obj)include/config.mk
 
 CPCI440_config:        unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx cpci440 esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx cpci440 esd
 
 CPCIISER4_config:      unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx cpciiser4 esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx cpciiser4 esd
 
 CRAYL1_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx L1 cray
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx L1 cray
 
 csb272_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx csb272
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx csb272
 
 csb472_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx csb472
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx csb472
 
 DASA_SIM_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx dasa_sim esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx dasa_sim esd
 
 DP405_config:  unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx dp405 esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx dp405 esd
 
 DU405_config:  unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx du405 esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx du405 esd
 
 ebony_config:  unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx ebony amcc
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx ebony amcc
 
 ERIC_config:   unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx eric
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx eric
 
 EXBITGEN_config:       unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx exbitgen
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx exbitgen
 
 G2000_config:  unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx g2000
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx g2000
 
 HH405_config:  unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx hh405 esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx hh405 esd
 
 HUB405_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx hub405 esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx hub405 esd
 
 JSE_config:    unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx jse
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx jse
 
 KAREF_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx karef sandburst
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx karef sandburst
 
 luan_config:   unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx luan amcc
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx luan amcc
 
 METROBOX_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx metrobox sandburst
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx metrobox sandburst
 
 MIP405_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx mip405 mpl
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx mip405 mpl
 
 MIP405T_config:        unconfig
-       @echo "#define CONFIG_MIP405T" >include/config.h
+       @mkdir -p $(obj)include
+       @echo "#define CONFIG_MIP405T" >$(obj)include/config.h
        @echo "Enable subset config for MIP405T"
-       @./mkconfig -a MIP405 ppc ppc4xx mip405 mpl
+       @$(MKCONFIG) -a MIP405 ppc ppc4xx mip405 mpl
 
 ML2_config:    unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx ml2
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx ml2
 
 ml300_config:  unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx ml300 xilinx
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx ml300 xilinx
 
 ocotea_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx ocotea amcc
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx ocotea amcc
 
 OCRTC_config           \
 ORSG_config:   unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx ocrtc esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx ocrtc esd
 
 p3p440_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx p3p440 prodrive
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx p3p440 prodrive
 
 PCI405_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx pci405 esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx pci405 esd
 
 pcs440ep_config:       unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx pcs440ep
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx pcs440ep
 
 PIP405_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx pip405 mpl
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx pip405 mpl
 
 PLU405_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx plu405 esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx plu405 esd
 
 PMC405_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx pmc405 esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx pmc405 esd
 
 PPChameleonEVB_config          \
 PPChameleonEVB_BA_25_config    \
@@ -977,66 +1121,78 @@ PPChameleonEVB_HI_25_config      \
 PPChameleonEVB_BA_33_config    \
 PPChameleonEVB_ME_33_config    \
 PPChameleonEVB_HI_33_config:   unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
        @[ -z "$(findstring EVB_BA,$@)" ] || \
-               { echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 0" >>include/config.h ; \
+               { echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 0" >>$(obj)include/config.h ; \
                  echo "... BASIC model" ; \
                }
        @[ -z "$(findstring EVB_ME,$@)" ] || \
-               { echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 1" >>include/config.h ; \
+               { echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 1" >>$(obj)include/config.h ; \
                  echo "... MEDIUM model" ; \
                }
        @[ -z "$(findstring EVB_HI,$@)" ] || \
-               { echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 2" >>include/config.h ; \
+               { echo "#define CONFIG_PPCHAMELEON_MODULE_MODEL 2" >>$(obj)include/config.h ; \
                  echo "... HIGH-END model" ; \
                }
        @[ -z "$(findstring _25,$@)" ] || \
-               { echo "#define CONFIG_PPCHAMELEON_CLK_25" >>include/config.h ; \
+               { echo "#define CONFIG_PPCHAMELEON_CLK_25" >>$(obj)include/config.h ; \
                  echo "SysClk = 25MHz" ; \
                }
        @[ -z "$(findstring _33,$@)" ] || \
-               { echo "#define CONFIG_PPCHAMELEON_CLK_33" >>include/config.h ; \
+               { echo "#define CONFIG_PPCHAMELEON_CLK_33" >>$(obj)include/config.h ; \
                  echo "SysClk = 33MHz" ; \
                }
-       @./mkconfig -a $(call xtract_4xx,$@) ppc ppc4xx PPChameleonEVB dave
+       @$(MKCONFIG) -a $(call xtract_4xx,$@) ppc ppc4xx PPChameleonEVB dave
 
 sbc405_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx sbc405
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx sbc405
+
+sequoia_config:        unconfig
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx sequoia amcc
+
+sequoia_nand_config:   unconfig
+       @ln -s board/amcc/sequoia/Makefile nand_spl/Makefile
+       @echo "#define CONFIG_NAND_U_BOOT" >include/config.h
+       @echo "Compile NAND boot image for sequoia"
+       @$(MKCONFIG) -a sequoia ppc ppc4xx sequoia amcc
+       @echo "TEXT_BASE = 0x01000000" >board/amcc/sequoia/config.tmp
+       @echo "CONFIG_NAND_U_BOOT = y" >> include/config.mk
 
 sycamore_config:       unconfig
        @echo "Configuring for sycamore board as subset of walnut..."
-       @./mkconfig -a walnut ppc ppc4xx walnut amcc
+       @$(MKCONFIG) -a walnut ppc ppc4xx walnut amcc
 
 VOH405_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx voh405 esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx voh405 esd
 
 VOM405_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx vom405 esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx vom405 esd
 
 CMS700_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx cms700 esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx cms700 esd
 
 W7OLMC_config  \
 W7OLMG_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx w7o
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx w7o
 
 walnut_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx walnut amcc
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx walnut amcc
 
 WUH405_config: unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx wuh405 esd
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx wuh405 esd
 
 XPEDITE1K_config:      unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx xpedite1k
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx xpedite1k
 
 yosemite_config:       unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx yosemite amcc
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx yosemite amcc
 
 yellowstone_config:    unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx yellowstone amcc
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx yellowstone amcc
 
 yucca_config:  unconfig
-       @./mkconfig $(@:_config=) ppc ppc4xx yucca amcc
+       @$(MKCONFIG) $(@:_config=) ppc ppc4xx yucca amcc
 
 #########################################################################
 ## MPC8220 Systems
@@ -1044,10 +1200,10 @@ yucca_config:   unconfig
 
 Alaska8220_config      \
 Yukon8220_config:      unconfig
-       @./mkconfig $(@:_config=) ppc mpc8220 alaska
+       @$(MKCONFIG) $(@:_config=) ppc mpc8220 alaska
 
 sorcery_config:                unconfig
-       @./mkconfig $(@:_config=) ppc mpc8220 sorcery
+       @$(MKCONFIG) $(@:_config=) ppc mpc8220 sorcery
 
 #########################################################################
 ## MPC824x Systems
@@ -1055,18 +1211,18 @@ sorcery_config:         unconfig
 xtract_82xx = $(subst _BIGFLASH,,$(subst _ROMBOOT,,$(subst _L2,,$(subst _266MHz,,$(subst _300MHz,,$(subst _config,,$1))))))
 
 A3000_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc824x a3000
+       @$(MKCONFIG) $(@:_config=) ppc mpc824x a3000
 
 barco_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc824x barco
+       @$(MKCONFIG) $(@:_config=) ppc mpc824x barco
 
 BMW_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc824x bmw
+       @$(MKCONFIG) $(@:_config=) ppc mpc824x bmw
 
 CPC45_config   \
 CPC45_ROMBOOT_config:  unconfig
-       @./mkconfig $(call xtract_82xx,$@) ppc mpc824x cpc45
-       @cd ./include ;                         \
+       @$(MKCONFIG) $(call xtract_82xx,$@) ppc mpc824x cpc45
+       @cd $(obj)include ;                             \
        if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
                echo "CONFIG_BOOT_ROM = y" >> config.mk ; \
                echo "... booting from 8-bit flash" ; \
@@ -1077,64 +1233,64 @@ CPC45_ROMBOOT_config:   unconfig
        echo "export CONFIG_BOOT_ROM" >> config.mk;
 
 CU824_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc824x cu824
+       @$(MKCONFIG) $(@:_config=) ppc mpc824x cu824
 
 debris_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc824x debris etin
+       @$(MKCONFIG) $(@:_config=) ppc mpc824x debris etin
 
 eXalion_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc824x eXalion
+       @$(MKCONFIG) $(@:_config=) ppc mpc824x eXalion
 
 HIDDEN_DRAGON_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc824x hidden_dragon
+       @$(MKCONFIG) $(@:_config=) ppc mpc824x hidden_dragon
 
 kvme080_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc824x kvme080 etin
+       @$(MKCONFIG) $(@:_config=) ppc mpc824x kvme080 etin
 
 MOUSSE_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc824x mousse
+       @$(MKCONFIG) $(@:_config=) ppc mpc824x mousse
 
 MUSENKI_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc824x musenki
+       @$(MKCONFIG) $(@:_config=) ppc mpc824x musenki
 
 MVBLUE_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc824x mvblue
+       @$(MKCONFIG) $(@:_config=) ppc mpc824x mvblue
 
 OXC_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc824x oxc
+       @$(MKCONFIG) $(@:_config=) ppc mpc824x oxc
 
 PN62_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc824x pn62
+       @$(MKCONFIG) $(@:_config=) ppc mpc824x pn62
 
 Sandpoint8240_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc824x sandpoint
+       @$(MKCONFIG) $(@:_config=) ppc mpc824x sandpoint
 
 Sandpoint8245_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc824x sandpoint
+       @$(MKCONFIG) $(@:_config=) ppc mpc824x sandpoint
 
 sbc8240_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc824x sbc8240
+       @$(MKCONFIG) $(@:_config=) ppc mpc824x sbc8240
 
 SL8245_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc824x sl8245
+       @$(MKCONFIG) $(@:_config=) ppc mpc824x sl8245
 
 utx8245_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc824x utx8245
+       @$(MKCONFIG) $(@:_config=) ppc mpc824x utx8245
 
 #########################################################################
 ## MPC8260 Systems
 #########################################################################
 
 atc_config:    unconfig
-       @./mkconfig $(@:_config=) ppc mpc8260 atc
+       @$(MKCONFIG) $(@:_config=) ppc mpc8260 atc
 
 cogent_mpc8260_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc8260 cogent
+       @$(MKCONFIG) $(@:_config=) ppc mpc8260 cogent
 
 CPU86_config   \
 CPU86_ROMBOOT_config: unconfig
-       @./mkconfig $(call xtract_82xx,$@) ppc mpc8260 cpu86
-       @cd ./include ;                         \
+       @$(MKCONFIG) $(call xtract_82xx,$@) ppc mpc8260 cpu86
+       @cd $(obj)include ;                             \
        if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
                echo "CONFIG_BOOT_ROM = y" >> config.mk ; \
                echo "... booting from 8-bit flash" ; \
@@ -1146,8 +1302,8 @@ CPU86_ROMBOOT_config: unconfig
 
 CPU87_config   \
 CPU87_ROMBOOT_config: unconfig
-       @./mkconfig $(call xtract_82xx,$@) ppc mpc8260 cpu87
-       @cd ./include ;                         \
+       @$(MKCONFIG) $(call xtract_82xx,$@) ppc mpc8260 cpu87
+       @cd $(obj)include ;                             \
        if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
                echo "CONFIG_BOOT_ROM = y" >> config.mk ; \
                echo "... booting from 8-bit flash" ; \
@@ -1159,29 +1315,30 @@ CPU87_ROMBOOT_config: unconfig
 
 ep8248_config  \
 ep8248E_config :       unconfig
-       @./mkconfig ep8248 ppc mpc8260 ep8248
+       @$(MKCONFIG) ep8248 ppc mpc8260 ep8248
 
 ep8260_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc8260 ep8260
+       @$(MKCONFIG) $(@:_config=) ppc mpc8260 ep8260
 
 gw8260_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc8260 gw8260
+       @$(MKCONFIG) $(@:_config=) ppc mpc8260 gw8260
 
 hymod_config:  unconfig
-       @./mkconfig $(@:_config=) ppc mpc8260 hymod
+       @$(MKCONFIG) $(@:_config=) ppc mpc8260 hymod
 
 IDS8247_config:        unconfig
-       @./mkconfig $(@:_config=) ppc mpc8260 ids8247
+       @$(MKCONFIG) $(@:_config=) ppc mpc8260 ids8247
 
 IPHASE4539_config:     unconfig
-       @./mkconfig $(@:_config=) ppc mpc8260 iphase4539
+       @$(MKCONFIG) $(@:_config=) ppc mpc8260 iphase4539
 
 ISPAN_config           \
 ISPAN_REVB_config:     unconfig
+       @mkdir -p $(obj)include
        @if [ "$(findstring _REVB_,$@)" ] ; then \
-               echo "#define CFG_REV_B" > include/config.h ; \
+               echo "#define CFG_REV_B" > $(obj)include/config.h ; \
        fi
-       @./mkconfig -a ISPAN ppc mpc8260 ispan
+       @$(MKCONFIG) -a ISPAN ppc mpc8260 ispan
 
 MPC8260ADS_config      \
 MPC8260ADS_lowboot_config      \
@@ -1200,21 +1357,23 @@ PQ2FADS-ZU_lowboot_config       \
 PQ2FADS-ZU_66MHz_config        \
 PQ2FADS-ZU_66MHz_lowboot_config        \
        :               unconfig
+       @mkdir -p $(obj)include
+       @mkdir -p $(obj)board/mpc8260ads
        $(if $(findstring PQ2FADS,$@), \
-       @echo "#define CONFIG_ADSTYPE CFG_PQ2FADS" > include/config.h, \
-       @echo "#define CONFIG_ADSTYPE CFG_"$(subst MPC,,$(word 1,$(subst _, ,$@))) > include/config.h)
+       @echo "#define CONFIG_ADSTYPE CFG_PQ2FADS" > $(obj)include/config.h, \
+       @echo "#define CONFIG_ADSTYPE CFG_"$(subst MPC,,$(word 1,$(subst _, ,$@))) > $(obj)include/config.h)
        $(if $(findstring MHz,$@), \
-       @echo "#define CONFIG_8260_CLKIN" $(subst MHz,,$(word 2,$(subst _, ,$@)))"000000" >> include/config.h, \
+       @echo "#define CONFIG_8260_CLKIN" $(subst MHz,,$(word 2,$(subst _, ,$@)))"000000" >> $(obj)include/config.h, \
        $(if $(findstring VR,$@), \
-       @echo "#define CONFIG_8260_CLKIN 66000000" >> include/config.h))
+       @echo "#define CONFIG_8260_CLKIN 66000000" >> $(obj)include/config.h))
        @[ -z "$(findstring lowboot_,$@)" ] || \
-               { echo "TEXT_BASE = 0xFF800000" >board/mpc8260ads/config.tmp ; \
+               { echo "TEXT_BASE = 0xFF800000" >$(obj)board/mpc8260ads/config.tmp ; \
                  echo "... with lowboot configuration" ; \
                }
-       @./mkconfig -a MPC8260ADS ppc mpc8260 mpc8260ads
+       @$(MKCONFIG) -a MPC8260ADS ppc mpc8260 mpc8260ads
 
 MPC8266ADS_config:     unconfig
-       @./mkconfig $(@:_config=) ppc mpc8260 mpc8266ads
+       @$(MKCONFIG) $(@:_config=) ppc mpc8260 mpc8266ads
 
 # PM825/PM826 default configuration:  small (= 8 MB) Flash / boot from 64-bit flash
 PM825_config   \
@@ -1225,71 +1384,76 @@ PM826_config    \
 PM826_ROMBOOT_config   \
 PM826_BIGFLASH_config  \
 PM826_ROMBOOT_BIGFLASH_config: unconfig
+       @mkdir -p $(obj)include
+       @mkdir -p $(obj)board/pm826
        @if [ "$(findstring PM825_,$@)" ] ; then \
-               echo "#define CONFIG_PCI"       >include/config.h ; \
+               echo "#define CONFIG_PCI"       >$(obj)include/config.h ; \
        else \
-               >include/config.h ; \
+               >$(obj)include/config.h ; \
        fi
        @if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
                echo "... booting from 8-bit flash" ; \
-               echo "#define CONFIG_BOOT_ROM" >>include/config.h ; \
-               echo "TEXT_BASE = 0xFF800000" >board/pm826/config.tmp ; \
+               echo "#define CONFIG_BOOT_ROM" >>$(obj)include/config.h ; \
+               echo "TEXT_BASE = 0xFF800000" >$(obj)board/pm826/config.tmp ; \
                if [ "$(findstring _BIGFLASH_,$@)" ] ; then \
                        echo "... with 32 MB Flash" ; \
-                       echo "#define CONFIG_FLASH_32MB" >>include/config.h ; \
+                       echo "#define CONFIG_FLASH_32MB" >>$(obj)include/config.h ; \
                fi; \
        else \
                echo "... booting from 64-bit flash" ; \
                if [ "$(findstring _BIGFLASH_,$@)" ] ; then \
                        echo "... with 32 MB Flash" ; \
-                       echo "#define CONFIG_FLASH_32MB" >>include/config.h ; \
-                       echo "TEXT_BASE = 0x40000000" >board/pm826/config.tmp ; \
+                       echo "#define CONFIG_FLASH_32MB" >>$(obj)include/config.h ; \
+                       echo "TEXT_BASE = 0x40000000" >$(obj)board/pm826/config.tmp ; \
                else \
-                       echo "TEXT_BASE = 0xFF000000" >board/pm826/config.tmp ; \
+                       echo "TEXT_BASE = 0xFF000000" >$(obj)board/pm826/config.tmp ; \
                fi; \
        fi
-       @./mkconfig -a PM826 ppc mpc8260 pm826
+       @$(MKCONFIG) -a PM826 ppc mpc8260 pm826
 
 PM828_config   \
 PM828_PCI_config       \
 PM828_ROMBOOT_config   \
 PM828_ROMBOOT_PCI_config:      unconfig
+       @mkdir -p $(obj)include
+       @mkdir -p $(obj)board/pm826
        @if [ "$(findstring _PCI_,$@)" ] ; then \
-               echo "#define CONFIG_PCI"  >>include/config.h ; \
+               echo "#define CONFIG_PCI"  >>$(obj)include/config.h ; \
                echo "... with PCI enabled" ; \
        else \
-               >include/config.h ; \
+               >$(obj)include/config.h ; \
        fi
        @if [ "$(findstring _ROMBOOT_,$@)" ] ; then \
                echo "... booting from 8-bit flash" ; \
-               echo "#define CONFIG_BOOT_ROM" >>include/config.h ; \
-               echo "TEXT_BASE = 0xFF800000" >board/pm826/config.tmp ; \
+               echo "#define CONFIG_BOOT_ROM" >>$(obj)include/config.h ; \
+               echo "TEXT_BASE = 0xFF800000" >$(obj)board/pm826/config.tmp ; \
        fi
-       @./mkconfig -a PM828 ppc mpc8260 pm828
+       @$(MKCONFIG) -a PM828 ppc mpc8260 pm828
 
 ppmc8260_config:       unconfig
-       @./mkconfig $(@:_config=) ppc mpc8260 ppmc8260
+       @$(MKCONFIG) $(@:_config=) ppc mpc8260 ppmc8260
 
 Rattler8248_config     \
 Rattler_config:                unconfig
+       @mkdir -p $(obj)include
        $(if $(findstring 8248,$@), \
-       @echo "#define CONFIG_MPC8248" > include/config.h)
-       @./mkconfig -a Rattler ppc mpc8260 rattler
+       @echo "#define CONFIG_MPC8248" > $(obj)include/config.h)
+       @$(MKCONFIG) -a Rattler ppc mpc8260 rattler
 
 RPXsuper_config:       unconfig
-       @./mkconfig $(@:_config=) ppc mpc8260 rpxsuper
+       @$(MKCONFIG) $(@:_config=) ppc mpc8260 rpxsuper
 
 rsdproto_config:       unconfig
-       @./mkconfig $(@:_config=) ppc mpc8260 rsdproto
+       @$(MKCONFIG) $(@:_config=) ppc mpc8260 rsdproto
 
 sacsng_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc8260 sacsng
+       @$(MKCONFIG) $(@:_config=) ppc mpc8260 sacsng
 
 sbc8260_config:        unconfig
-       @./mkconfig $(@:_config=) ppc mpc8260 sbc8260
+       @$(MKCONFIG) $(@:_config=) ppc mpc8260 sbc8260
 
 SCM_config:            unconfig
-       @./mkconfig $(@:_config=) ppc mpc8260 SCM siemens
+       @$(MKCONFIG) $(@:_config=) ppc mpc8260 SCM siemens
 
 TQM8255_AA_config \
 TQM8260_AA_config \
@@ -1302,6 +1466,7 @@ TQM8260_AG_config \
 TQM8260_AH_config \
 TQM8260_AI_config \
 TQM8265_AA_config:  unconfig
+       @mkdir -p $(obj)include
        @case "$@" in \
        TQM8255_AA_config) CTYPE=MPC8255; CFREQ=300; CACHE=no;  BMODE=8260;;  \
        TQM8260_AA_config) CTYPE=MPC8260; CFREQ=200; CACHE=no;  BMODE=8260;; \
@@ -1315,166 +1480,175 @@ TQM8265_AA_config:  unconfig
        TQM8260_AI_config) CTYPE=MPC8260; CFREQ=300; CACHE=no;  BMODE=60x;;  \
        TQM8265_AA_config) CTYPE=MPC8265; CFREQ=300; CACHE=no;  BMODE=60x;;  \
        esac; \
-       >include/config.h ; \
+       >$(obj)include/config.h ; \
        if [ "$${CTYPE}" != "MPC8260" ] ; then \
-               echo "#define CONFIG_$${CTYPE}" >>include/config.h ; \
+               echo "#define CONFIG_$${CTYPE}" >>$(obj)include/config.h ; \
        fi; \
-       echo "#define CONFIG_$${CFREQ}MHz"      >>include/config.h ; \
+       echo "#define CONFIG_$${CFREQ}MHz"      >>$(obj)include/config.h ; \
        echo "... with $${CFREQ}MHz system clock" ; \
        if [ "$${CACHE}" == "yes" ] ; then \
-               echo "#define CONFIG_L2_CACHE"  >>include/config.h ; \
+               echo "#define CONFIG_L2_CACHE"  >>$(obj)include/config.h ; \
                echo "... with L2 Cache support" ; \
        else \
-               echo "#undef CONFIG_L2_CACHE"   >>include/config.h ; \
+               echo "#undef CONFIG_L2_CACHE"   >>$(obj)include/config.h ; \
                echo "... without L2 Cache support" ; \
        fi; \
        if [ "$${BMODE}" == "60x" ] ; then \
-               echo "#define CONFIG_BUSMODE_60x" >>include/config.h ; \
+               echo "#define CONFIG_BUSMODE_60x" >>$(obj)include/config.h ; \
                echo "... with 60x Bus Mode" ; \
        else \
-               echo "#undef CONFIG_BUSMODE_60x"  >>include/config.h ; \
+               echo "#undef CONFIG_BUSMODE_60x"  >>$(obj)include/config.h ; \
                echo "... without 60x Bus Mode" ; \
        fi
-       @./mkconfig -a TQM8260 ppc mpc8260 tqm8260
+       @$(MKCONFIG) -a TQM8260 ppc mpc8260 tqm8260
 
 VoVPN-GW_66MHz_config  \
 VoVPN-GW_100MHz_config:                unconfig
-       @echo "#define CONFIG_CLKIN_$(word 2,$(subst _, ,$@))" > include/config.h
-       @./mkconfig -a VoVPN-GW ppc mpc8260 vovpn-gw funkwerk
+       @mkdir -p $(obj)include
+       @echo "#define CONFIG_CLKIN_$(word 2,$(subst _, ,$@))" > $(obj)include/config.h
+       @$(MKCONFIG) -a VoVPN-GW ppc mpc8260 vovpn-gw funkwerk
 
 ZPC1900_config: unconfig
-       @./mkconfig $(@:_config=) ppc mpc8260 zpc1900
+       @$(MKCONFIG) $(@:_config=) ppc mpc8260 zpc1900
 
 #########################################################################
 ## Coldfire
 #########################################################################
 
 cobra5272_config :             unconfig
-       @./mkconfig $(@:_config=) m68k mcf52x2 cobra5272
+       @$(MKCONFIG) $(@:_config=) m68k mcf52x2 cobra5272
 
 EB+MCF-EV123_config :          unconfig
-       @ >include/config.h
-       @echo "TEXT_BASE = 0xFFE00000"|tee board/BuS/EB+MCF-EV123/textbase.mk
-       @./mkconfig EB+MCF-EV123 m68k mcf52x2 EB+MCF-EV123 BuS
+       @mkdir -p $(obj)include
+       @mkdir -p $(obj)board/BuS/EB+MCF-EV123
+       @ >$(obj)include/config.h
+       @echo "TEXT_BASE = 0xFFE00000"|tee $(obj)board/BuS/EB+MCF-EV123/textbase.mk
+       @$(MKCONFIG) EB+MCF-EV123 m68k mcf52x2 EB+MCF-EV123 BuS
 
 EB+MCF-EV123_internal_config : unconfig
-       @ >include/config.h
-       @echo "TEXT_BASE = 0xF0000000"|tee board/BuS/EB+MCF-EV123/textbase.mk
-       @./mkconfig EB+MCF-EV123 m68k mcf52x2 EB+MCF-EV123 BuS
+       @mkdir -p $(obj)include
+       @mkdir -p $(obj)board/BuS/EB+MCF-EV123
+       @ >$(obj)include/config.h
+       @echo "TEXT_BASE = 0xF0000000"|tee $(obj)board/BuS/EB+MCF-EV123/textbase.mk
+       @$(MKCONFIG) EB+MCF-EV123 m68k mcf52x2 EB+MCF-EV123 BuS
 
 M5271EVB_config :              unconfig
-       @./mkconfig $(@:_config=) m68k mcf52x2 m5271evb
+       @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5271evb
 
 M5272C3_config :               unconfig
-       @./mkconfig $(@:_config=) m68k mcf52x2 m5272c3
+       @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5272c3
 
 M5282EVB_config :              unconfig
-       @./mkconfig $(@:_config=) m68k mcf52x2 m5282evb
+       @$(MKCONFIG) $(@:_config=) m68k mcf52x2 m5282evb
 
 TASREG_config :                unconfig
-       @./mkconfig $(@:_config=) m68k mcf52x2 tasreg esd
+       @$(MKCONFIG) $(@:_config=) m68k mcf52x2 tasreg esd
 
 r5200_config :         unconfig
-       @./mkconfig $(@:_config=) m68k mcf52x2 r5200
+       @$(MKCONFIG) $(@:_config=) m68k mcf52x2 r5200
 
 #########################################################################
 ## MPC83xx Systems
 #########################################################################
 
 MPC8349ADS_config:     unconfig
-       @./mkconfig $(@:_config=) ppc mpc83xx mpc8349ads
+       @$(MKCONFIG) $(@:_config=) ppc mpc83xx mpc8349ads
 
 TQM834x_config:        unconfig
-       @./mkconfig $(@:_config=) ppc mpc83xx tqm834x
+       @$(MKCONFIG) $(@:_config=) ppc mpc83xx tqm834x
 
 MPC8349EMDS_config:    unconfig
-       @./mkconfig $(@:_config=) ppc mpc83xx mpc8349emds
+       @$(MKCONFIG) $(@:_config=) ppc mpc83xx mpc8349emds
 
 #########################################################################
 ## MPC85xx Systems
 #########################################################################
 
 MPC8540ADS_config:     unconfig
-       @./mkconfig $(@:_config=) ppc mpc85xx mpc8540ads
+       @$(MKCONFIG) $(@:_config=) ppc mpc85xx mpc8540ads
 
 MPC8540EVAL_config \
 MPC8540EVAL_33_config \
 MPC8540EVAL_66_config \
 MPC8540EVAL_33_slave_config \
 MPC8540EVAL_66_slave_config:      unconfig
-       @echo "" >include/config.h ; \
+       @mkdir -p $(obj)include
+       @echo "" >$(obj)include/config.h ; \
        if [ "$(findstring _33_,$@)" ] ; then \
                echo -n "... 33 MHz PCI" ; \
        else \
-               echo "#define CONFIG_SYSCLK_66M" >>include/config.h ; \
+               echo "#define CONFIG_SYSCLK_66M" >>$(obj)include/config.h ; \
                echo -n "... 66 MHz PCI" ; \
        fi ; \
        if [ "$(findstring _slave_,$@)" ] ; then \
-               echo "#define CONFIG_PCI_SLAVE" >>include/config.h ; \
+               echo "#define CONFIG_PCI_SLAVE" >>$(obj)include/config.h ; \
                echo " slave" ; \
        else \
                echo " host" ; \
        fi
-       @./mkconfig -a MPC8540EVAL ppc mpc85xx mpc8540eval
+       @$(MKCONFIG) -a MPC8540EVAL ppc mpc85xx mpc8540eval
 
 MPC8560ADS_config:     unconfig
-       @./mkconfig $(@:_config=) ppc mpc85xx mpc8560ads
+       @$(MKCONFIG) $(@:_config=) ppc mpc85xx mpc8560ads
 
 MPC8541CDS_config:     unconfig
-       @./mkconfig $(@:_config=) ppc mpc85xx mpc8541cds cds
+       @$(MKCONFIG) $(@:_config=) ppc mpc85xx mpc8541cds cds
 
 MPC8548CDS_config:     unconfig
-       @./mkconfig $(@:_config=) ppc mpc85xx mpc8548cds cds
+       @$(MKCONFIG) $(@:_config=) ppc mpc85xx mpc8548cds cds
 
 MPC8555CDS_config:     unconfig
-       @./mkconfig $(@:_config=) ppc mpc85xx mpc8555cds cds
+       @$(MKCONFIG) $(@:_config=) ppc mpc85xx mpc8555cds cds
 
 PM854_config:  unconfig
-       @./mkconfig $(@:_config=) ppc mpc85xx pm854
+       @$(MKCONFIG) $(@:_config=) ppc mpc85xx pm854
 
 PM856_config:  unconfig
-       @./mkconfig $(@:_config=) ppc mpc85xx pm856
+       @$(MKCONFIG) $(@:_config=) ppc mpc85xx pm856
 
 sbc8540_config \
 sbc8540_33_config \
 sbc8540_66_config:     unconfig
+       @mkdir -p $(obj)include
        @if [ "$(findstring _66_,$@)" ] ; then \
-               echo "#define CONFIG_PCI_66"    >>include/config.h ; \
+               echo "#define CONFIG_PCI_66"    >>$(obj)include/config.h ; \
                echo "... 66 MHz PCI" ; \
        else \
-               >include/config.h ; \
+               >$(obj)include/config.h ; \
                echo "... 33 MHz PCI" ; \
        fi
-       @./mkconfig -a SBC8540 ppc mpc85xx sbc8560
+       @$(MKCONFIG) -a SBC8540 ppc mpc85xx sbc8560
 
 sbc8560_config \
 sbc8560_33_config \
 sbc8560_66_config:      unconfig
+       @mkdir -p $(obj)include
        @if [ "$(findstring _66_,$@)" ] ; then \
-               echo "#define CONFIG_PCI_66"    >>include/config.h ; \
+               echo "#define CONFIG_PCI_66"    >>$(obj)include/config.h ; \
                echo "... 66 MHz PCI" ; \
        else \
-               >include/config.h ; \
+               >$(obj)include/config.h ; \
                echo "... 33 MHz PCI" ; \
        fi
-       @./mkconfig -a sbc8560 ppc mpc85xx sbc8560
+       @$(MKCONFIG) -a sbc8560 ppc mpc85xx sbc8560
 
 stxgp3_config:         unconfig
-       @./mkconfig $(@:_config=) ppc mpc85xx stxgp3
+       @$(MKCONFIG) $(@:_config=) ppc mpc85xx stxgp3
 
 TQM8540_config         \
 TQM8541_config         \
 TQM8555_config         \
 TQM8560_config:                unconfig
+       @mkdir -p $(obj)include
        @CTYPE=$(subst TQM,,$(@:_config=)); \
-       >include/config.h ; \
+       >$(obj)include/config.h ; \
        echo "... TQM"$${CTYPE}; \
-       echo "#define CONFIG_MPC$${CTYPE}">>include/config.h; \
-       echo "#define CONFIG_TQM$${CTYPE}">>include/config.h; \
-       echo "#define CONFIG_HOSTNAME tqm$${CTYPE}">>include/config.h; \
-       echo "#define CONFIG_BOARDNAME \"TQM$${CTYPE}\"">>include/config.h; \
-       echo "#define CFG_BOOTFILE \"bootfile=/tftpboot/tqm$${CTYPE}/uImage\0\"">>include/config.h
-       @./mkconfig -a TQM85xx ppc mpc85xx tqm85xx
+       echo "#define CONFIG_MPC$${CTYPE}">>$(obj)include/config.h; \
+       echo "#define CONFIG_TQM$${CTYPE}">>$(obj)include/config.h; \
+       echo "#define CONFIG_HOSTNAME tqm$${CTYPE}">>$(obj)include/config.h; \
+       echo "#define CONFIG_BOARDNAME \"TQM$${CTYPE}\"">>$(obj)include/config.h; \
+       echo "#define CFG_BOOTFILE \"bootfile=/tftpboot/tqm$${CTYPE}/uImage\0\"">>$(obj)include/config.h
+       @$(MKCONFIG) -a TQM85xx ppc mpc85xx tqm85xx
 
 #########################################################################
 ## MPC86xx Systems
@@ -1489,39 +1663,39 @@ MPC8641HPCN_config:    unconfig
 #########################################################################
 
 AmigaOneG3SE_config:   unconfig
-       @./mkconfig $(@:_config=) ppc 74xx_7xx AmigaOneG3SE MAI
+       @$(MKCONFIG) $(@:_config=) ppc 74xx_7xx AmigaOneG3SE MAI
 
 BAB7xx_config: unconfig
-       @./mkconfig $(@:_config=) ppc 74xx_7xx bab7xx eltec
+       @$(MKCONFIG) $(@:_config=) ppc 74xx_7xx bab7xx eltec
 
 CPCI750_config:        unconfig
-       @./mkconfig CPCI750 ppc 74xx_7xx cpci750 esd
+       @$(MKCONFIG) CPCI750 ppc 74xx_7xx cpci750 esd
 
 DB64360_config:  unconfig
-       @./mkconfig DB64360 ppc 74xx_7xx db64360 Marvell
+       @$(MKCONFIG) DB64360 ppc 74xx_7xx db64360 Marvell
 
 DB64460_config:  unconfig
-       @./mkconfig DB64460 ppc 74xx_7xx db64460 Marvell
+       @$(MKCONFIG) DB64460 ppc 74xx_7xx db64460 Marvell
 
 ELPPC_config: unconfig
-       @./mkconfig $(@:_config=) ppc 74xx_7xx elppc eltec
+       @$(MKCONFIG) $(@:_config=) ppc 74xx_7xx elppc eltec
 
 EVB64260_config        \
 EVB64260_750CX_config: unconfig
-       @./mkconfig EVB64260 ppc 74xx_7xx evb64260
+       @$(MKCONFIG) EVB64260 ppc 74xx_7xx evb64260
 
 P3G4_config: unconfig
-       @./mkconfig $(@:_config=) ppc 74xx_7xx evb64260
+       @$(MKCONFIG) $(@:_config=) ppc 74xx_7xx evb64260
 
 PCIPPC2_config \
 PCIPPC6_config: unconfig
-       @./mkconfig $(@:_config=) ppc 74xx_7xx pcippc2
+       @$(MKCONFIG) $(@:_config=) ppc 74xx_7xx pcippc2
 
 ZUMA_config:   unconfig
-       @./mkconfig $(@:_config=) ppc 74xx_7xx evb64260
+       @$(MKCONFIG) $(@:_config=) ppc 74xx_7xx evb64260
 
 ppmc7xx_config: unconfig
-       @./mkconfig $(@:_config=) ppc 74xx_7xx ppmc7xx
+       @$(MKCONFIG) $(@:_config=) ppc 74xx_7xx ppmc7xx
 
 #========================================================================
 # ARM
@@ -1531,19 +1705,19 @@ ppmc7xx_config: unconfig
 #########################################################################
 
 assabet_config :       unconfig
-       @./mkconfig $(@:_config=) arm sa1100 assabet
+       @$(MKCONFIG) $(@:_config=) arm sa1100 assabet
 
 dnp1110_config :       unconfig
-       @./mkconfig $(@:_config=) arm sa1100 dnp1110
+       @$(MKCONFIG) $(@:_config=) arm sa1100 dnp1110
 
 gcplus_config  :       unconfig
-       @./mkconfig $(@:_config=) arm sa1100 gcplus
+       @$(MKCONFIG) $(@:_config=) arm sa1100 gcplus
 
 lart_config    :       unconfig
-       @./mkconfig $(@:_config=) arm sa1100 lart
+       @$(MKCONFIG) $(@:_config=) arm sa1100 lart
 
 shannon_config :       unconfig
-       @./mkconfig $(@:_config=) arm sa1100 shannon
+       @$(MKCONFIG) $(@:_config=) arm sa1100 shannon
 
 #########################################################################
 ## ARM92xT Systems
@@ -1556,16 +1730,16 @@ xtract_omap1610xxx = $(subst _cs0boot,,$(subst _cs3boot,,$(subst _cs_autoboot,,$
 xtract_omap730p2 = $(subst _cs0boot,,$(subst _cs3boot,, $(subst _config,,$1)))
 
 at91rm9200dk_config    :       unconfig
-       @./mkconfig $(@:_config=) arm arm920t at91rm9200dk NULL at91rm9200
+       @$(MKCONFIG) $(@:_config=) arm arm920t at91rm9200dk NULL at91rm9200
 
 cmc_pu2_config :       unconfig
-       @./mkconfig $(@:_config=) arm arm920t cmc_pu2 NULL at91rm9200
+       @$(MKCONFIG) $(@:_config=) arm arm920t cmc_pu2 NULL at91rm9200
 
 csb637_config  :       unconfig
-       @./mkconfig $(@:_config=) arm arm920t csb637 NULL at91rm9200
+       @$(MKCONFIG) $(@:_config=) arm arm920t csb637 NULL at91rm9200
 
 mp2usb_config  :       unconfig
-       @./mkconfig $(@:_config=) arm arm920t mp2usb NULL at91rm9200
+       @$(MKCONFIG) $(@:_config=) arm arm920t mp2usb NULL at91rm9200
 
 
 ########################################################################
@@ -1595,34 +1769,35 @@ cp1026_config: unconfig
        @board/integratorcp/split_by_variant.sh $@
 
 kb9202_config  :       unconfig
-       @./mkconfig $(@:_config=) arm arm920t kb9202 NULL at91rm9200
+       @$(MKCONFIG) $(@:_config=) arm arm920t kb9202 NULL at91rm9200
 
 lpd7a400_config \
 lpd7a404_config:       unconfig
-       @./mkconfig $(@:_config=) arm lh7a40x lpd7a40x
+       @$(MKCONFIG) $(@:_config=) arm lh7a40x lpd7a40x
 
 mx1ads_config  :       unconfig
-       @./mkconfig $(@:_config=) arm arm920t mx1ads NULL imx
+       @$(MKCONFIG) $(@:_config=) arm arm920t mx1ads NULL imx
 
 mx1fs2_config  :       unconfig
-       @./mkconfig $(@:_config=) arm arm920t mx1fs2 NULL imx
+       @$(MKCONFIG) $(@:_config=) arm arm920t mx1fs2 NULL imx
 
 netstar_32_config      \
 netstar_config:                unconfig
+       @mkdir -p $(obj)include
        @if [ "$(findstring _32_,$@)" ] ; then \
                echo "... 32MB SDRAM" ; \
-               echo "#define PHYS_SDRAM_1_SIZE SZ_32M" >>include/config.h ; \
+               echo "#define PHYS_SDRAM_1_SIZE SZ_32M" >>$(obj)include/config.h ; \
        else \
                echo "... 64MB SDRAM" ; \
-               echo "#define PHYS_SDRAM_1_SIZE SZ_64M" >>include/config.h ; \
+               echo "#define PHYS_SDRAM_1_SIZE SZ_64M" >>$(obj)include/config.h ; \
        fi
-       @./mkconfig -a netstar arm arm925t netstar
+       @$(MKCONFIG) -a netstar arm arm925t netstar
 
 omap1510inn_config :   unconfig
-       @./mkconfig $(@:_config=) arm arm925t omap1510inn
+       @$(MKCONFIG) $(@:_config=) arm arm925t omap1510inn
 
 omap5912osk_config :   unconfig
-       @./mkconfig $(@:_config=) arm arm926ejs omap5912osk NULL omap
+       @$(MKCONFIG) $(@:_config=) arm arm926ejs omap5912osk NULL omap
 
 omap1610inn_config \
 omap1610inn_cs0boot_config \
@@ -1632,72 +1807,76 @@ omap1610h2_config \
 omap1610h2_cs0boot_config \
 omap1610h2_cs3boot_config \
 omap1610h2_cs_autoboot_config: unconfig
+       @mkdir -p $(obj)include
        @if [ "$(findstring _cs0boot_, $@)" ] ; then \
-               echo "#define CONFIG_CS0_BOOT" >> ./include/config.h ; \
+               echo "#define CONFIG_CS0_BOOT" >> .$(obj)/include/config.h ; \
                echo "... configured for CS0 boot"; \
        elif [ "$(findstring _cs_autoboot_, $@)" ] ; then \
-               echo "#define CONFIG_CS_AUTOBOOT" >> ./include/config.h ; \
+               echo "#define CONFIG_CS_AUTOBOOT" >> $(obj)./include/config.h ; \
                echo "... configured for CS_AUTO boot"; \
        else \
-               echo "#define CONFIG_CS3_BOOT" >> ./include/config.h ; \
+               echo "#define CONFIG_CS3_BOOT" >> $(obj)./include/config.h ; \
                echo "... configured for CS3 boot"; \
        fi;
-       @./mkconfig -a $(call xtract_omap1610xxx,$@) arm arm926ejs omap1610inn NULL omap
+       @$(MKCONFIG) -a $(call xtract_omap1610xxx,$@) arm arm926ejs omap1610inn NULL omap
 
 omap730p2_config \
 omap730p2_cs0boot_config \
 omap730p2_cs3boot_config :     unconfig
+       @mkdir -p $(obj)include
        @if [ "$(findstring _cs0boot_, $@)" ] ; then \
-               echo "#define CONFIG_CS0_BOOT" >> ./include/config.h ; \
+               echo "#define CONFIG_CS0_BOOT" >> $(obj)include/config.h ; \
                echo "... configured for CS0 boot"; \
        else \
-               echo "#define CONFIG_CS3_BOOT" >> ./include/config.h ; \
+               echo "#define CONFIG_CS3_BOOT" >> $(obj)include/config.h ; \
                echo "... configured for CS3 boot"; \
        fi;
-       @./mkconfig -a $(call xtract_omap730p2,$@) arm arm926ejs omap730p2 NULL omap
+       @$(MKCONFIG) -a $(call xtract_omap730p2,$@) arm arm926ejs omap730p2 NULL omap
 
 sbc2410x_config: unconfig
-       @./mkconfig $(@:_config=) arm arm920t sbc2410x NULL s3c24x0
+       @$(MKCONFIG) $(@:_config=) arm arm920t sbc2410x NULL s3c24x0
 
 scb9328_config :       unconfig
-       @./mkconfig $(@:_config=) arm arm920t scb9328 NULL imx
+       @$(MKCONFIG) $(@:_config=) arm arm920t scb9328 NULL imx
 
 smdk2400_config        :       unconfig
-       @./mkconfig $(@:_config=) arm arm920t smdk2400 NULL s3c24x0
+       @$(MKCONFIG) $(@:_config=) arm arm920t smdk2400 NULL s3c24x0
 
 smdk2410_config        :       unconfig
-       @./mkconfig $(@:_config=) arm arm920t smdk2410 NULL s3c24x0
+       @$(MKCONFIG) $(@:_config=) arm arm920t smdk2410 NULL s3c24x0
 
 SX1_config :           unconfig
-       @./mkconfig $(@:_config=) arm arm925t sx1
+       @$(MKCONFIG) $(@:_config=) arm arm925t sx1
 
 # TRAB default configuration:  8 MB Flash, 32 MB RAM
 trab_config \
 trab_bigram_config \
 trab_bigflash_config \
 trab_old_config:       unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @mkdir -p $(obj)board/trab
+       @ >$(obj)include/config.h
        @[ -z "$(findstring _bigram,$@)" ] || \
-               { echo "#define CONFIG_FLASH_8MB"  >>include/config.h ; \
-                 echo "#define CONFIG_RAM_32MB"   >>include/config.h ; \
+               { echo "#define CONFIG_FLASH_8MB"  >>$(obj)include/config.h ; \
+                 echo "#define CONFIG_RAM_32MB"   >>$(obj)include/config.h ; \
                  echo "... with 8 MB Flash, 32 MB RAM" ; \
                }
        @[ -z "$(findstring _bigflash,$@)" ] || \
-               { echo "#define CONFIG_FLASH_16MB" >>include/config.h ; \
-                 echo "#define CONFIG_RAM_16MB"   >>include/config.h ; \
+               { echo "#define CONFIG_FLASH_16MB" >>$(obj)include/config.h ; \
+                 echo "#define CONFIG_RAM_16MB"   >>$(obj)include/config.h ; \
                  echo "... with 16 MB Flash, 16 MB RAM" ; \
-                 echo "TEXT_BASE = 0x0CF40000" >board/trab/config.tmp ; \
+                 echo "TEXT_BASE = 0x0CF40000" >$(obj)board/trab/config.tmp ; \
                }
        @[ -z "$(findstring _old,$@)" ] || \
-               { echo "#define CONFIG_FLASH_8MB"  >>include/config.h ; \
-                 echo "#define CONFIG_RAM_16MB"   >>include/config.h ; \
+               { echo "#define CONFIG_FLASH_8MB"  >>$(obj)include/config.h ; \
+                 echo "#define CONFIG_RAM_16MB"   >>$(obj)include/config.h ; \
                  echo "... with 8 MB Flash, 16 MB RAM" ; \
-                 echo "TEXT_BASE = 0x0CF40000" >board/trab/config.tmp ; \
+                 echo "TEXT_BASE = 0x0CF40000" >$(obj)board/trab/config.tmp ; \
                }
-       @./mkconfig -a $(call xtract_trab,$@) arm arm920t trab NULL s3c24x0
+       @$(MKCONFIG) -a $(call xtract_trab,$@) arm arm920t trab NULL s3c24x0
 
 VCMA9_config   :       unconfig
-       @./mkconfig $(@:_config=) arm arm920t vcma9 mpl s3c24x0
+       @$(MKCONFIG) $(@:_config=) arm arm920t vcma9 mpl s3c24x0
 
 #========================================================================
 # ARM supplied Versatile development boards
@@ -1709,117 +1888,120 @@ versatilepb_config :  unconfig
 
 voiceblue_smallflash_config    \
 voiceblue_config:      unconfig
+       @mkdir -p $(obj)include
+       @mkdir -p $(obj)board/voiceblue
        @if [ "$(findstring _smallflash_,$@)" ] ; then \
                echo "... boot from lower flash bank" ; \
-               echo "#define VOICEBLUE_SMALL_FLASH" >>include/config.h ; \
-               echo "VOICEBLUE_SMALL_FLASH=y" >board/voiceblue/config.tmp ; \
+               echo "#define VOICEBLUE_SMALL_FLASH" >>$(obj)include/config.h ; \
+               echo "VOICEBLUE_SMALL_FLASH=y" >$(obj)board/voiceblue/config.tmp ; \
        else \
                echo "... boot from upper flash bank" ; \
-               >include/config.h ; \
-               echo "VOICEBLUE_SMALL_FLASH=n" >board/voiceblue/config.tmp ; \
+               >$(obj)include/config.h ; \
+               echo "VOICEBLUE_SMALL_FLASH=n" >$(obj)board/voiceblue/config.tmp ; \
        fi
-       @./mkconfig -a voiceblue arm arm925t voiceblue
+       @$(MKCONFIG) -a voiceblue arm arm925t voiceblue
 
 cm4008_config  :       unconfig
-       @./mkconfig $(@:_config=) arm arm920t cm4008 NULL ks8695
+       @$(MKCONFIG) $(@:_config=) arm arm920t cm4008 NULL ks8695
 
 cm41xx_config  :       unconfig
-       @./mkconfig $(@:_config=) arm arm920t cm41xx NULL ks8695
+       @$(MKCONFIG) $(@:_config=) arm arm920t cm41xx NULL ks8695
 
 gth2_config            :       unconfig
-       @ >include/config.h
-       @echo "#define CONFIG_GTH2 1" >>include/config.h
-       @./mkconfig -a gth2 mips mips gth2
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
+       @echo "#define CONFIG_GTH2 1" >>$(obj)include/config.h
+       @$(MKCONFIG) -a gth2 mips mips gth2
 
 #########################################################################
 ## S3C44B0 Systems
 #########################################################################
 
 B2_config      :       unconfig
-       @./mkconfig $(@:_config=) arm s3c44b0 B2 dave
+       @$(MKCONFIG) $(@:_config=) arm s3c44b0 B2 dave
 
 #########################################################################
 ## ARM720T Systems
 #########################################################################
 
 armadillo_config:      unconfig
-       @./mkconfig $(@:_config=) arm arm720t armadillo
+       @$(MKCONFIG) $(@:_config=) arm arm720t armadillo
 
 ep7312_config  :       unconfig
-       @./mkconfig $(@:_config=) arm arm720t ep7312
+       @$(MKCONFIG) $(@:_config=) arm arm720t ep7312
 
 impa7_config   :       unconfig
-       @./mkconfig $(@:_config=) arm arm720t impa7
+       @$(MKCONFIG) $(@:_config=) arm arm720t impa7
 
 modnet50_config :      unconfig
-       @./mkconfig $(@:_config=) arm arm720t modnet50
+       @$(MKCONFIG) $(@:_config=) arm arm720t modnet50
 
 evb4510_config :       unconfig
-       @./mkconfig $(@:_config=) arm arm720t evb4510
+       @$(MKCONFIG) $(@:_config=) arm arm720t evb4510
 
 #########################################################################
 ## XScale Systems
 #########################################################################
 
 adsvix_config  :       unconfig
-       @./mkconfig $(@:_config=) arm pxa adsvix
+       @$(MKCONFIG) $(@:_config=) arm pxa adsvix
 
 cerf250_config :       unconfig
-       @./mkconfig $(@:_config=) arm pxa cerf250
+       @$(MKCONFIG) $(@:_config=) arm pxa cerf250
 
 cradle_config  :       unconfig
-       @./mkconfig $(@:_config=) arm pxa cradle
+       @$(MKCONFIG) $(@:_config=) arm pxa cradle
 
 csb226_config  :       unconfig
-       @./mkconfig $(@:_config=) arm pxa csb226
+       @$(MKCONFIG) $(@:_config=) arm pxa csb226
 
 delta_config :
-       @./mkconfig $(@:_config=) arm pxa delta
+       @$(MKCONFIG) $(@:_config=) arm pxa delta
 
 innokom_config :       unconfig
-       @./mkconfig $(@:_config=) arm pxa innokom
+       @$(MKCONFIG) $(@:_config=) arm pxa innokom
 
 ixdp425_config :       unconfig
-       @./mkconfig $(@:_config=) arm ixp ixdp425
+       @$(MKCONFIG) $(@:_config=) arm ixp ixdp425
 
 ixdpg425_config        :       unconfig
-       @./mkconfig $(@:_config=) arm ixp ixdp425
+       @$(MKCONFIG) $(@:_config=) arm ixp ixdp425
 
 lubbock_config :       unconfig
-       @./mkconfig $(@:_config=) arm pxa lubbock
+       @$(MKCONFIG) $(@:_config=) arm pxa lubbock
 
 pleb2_config   :       unconfig
-       @./mkconfig $(@:_config=) arm pxa pleb2
+       @$(MKCONFIG) $(@:_config=) arm pxa pleb2
 
 logodl_config  :       unconfig
-       @./mkconfig $(@:_config=) arm pxa logodl
+       @$(MKCONFIG) $(@:_config=) arm pxa logodl
 
 pdnb3_config   :       unconfig
-       @./mkconfig $(@:_config=) arm ixp pdnb3 prodrive
+       @$(MKCONFIG) $(@:_config=) arm ixp pdnb3 prodrive
 
 pxa255_idp_config:     unconfig
-       @./mkconfig $(@:_config=) arm pxa pxa255_idp
+       @$(MKCONFIG) $(@:_config=) arm pxa pxa255_idp
 
 wepep250_config        :       unconfig
-       @./mkconfig $(@:_config=) arm pxa wepep250
+       @$(MKCONFIG) $(@:_config=) arm pxa wepep250
 
 xaeniax_config :       unconfig
-       @./mkconfig $(@:_config=) arm pxa xaeniax
+       @$(MKCONFIG) $(@:_config=) arm pxa xaeniax
 
 xm250_config   :       unconfig
-       @./mkconfig $(@:_config=) arm pxa xm250
+       @$(MKCONFIG) $(@:_config=) arm pxa xm250
 
 xsengine_config :      unconfig
-       @./mkconfig $(@:_config=) arm pxa xsengine
+       @$(MKCONFIG) $(@:_config=) arm pxa xsengine
 
 zylonite_config :
-       @./mkconfig $(@:_config=) arm pxa zylonite
+       @$(MKCONFIG) $(@:_config=) arm pxa zylonite
 
 #########################################################################
 ## ARM1136 Systems
 #########################################################################
 omap2420h4_config :    unconfig
-       @./mkconfig $(@:_config=) arm arm1136 omap2420h4
+       @$(MKCONFIG) $(@:_config=) arm arm1136 omap2420h4
 
 #========================================================================
 # i386
@@ -1828,13 +2010,13 @@ omap2420h4_config :    unconfig
 ## AMD SC520 CDP
 #########################################################################
 sc520_cdp_config       :       unconfig
-       @./mkconfig $(@:_config=) i386 i386 sc520_cdp
+       @$(MKCONFIG) $(@:_config=) i386 i386 sc520_cdp
 
 sc520_spunk_config     :       unconfig
-       @./mkconfig $(@:_config=) i386 i386 sc520_spunk
+       @$(MKCONFIG) $(@:_config=) i386 i386 sc520_spunk
 
 sc520_spunk_rel_config :       unconfig
-       @./mkconfig $(@:_config=) i386 i386 sc520_spunk
+       @$(MKCONFIG) $(@:_config=) i386 i386 sc520_spunk
 
 #========================================================================
 # MIPS
@@ -1849,63 +2031,70 @@ incaip_100MHz_config    \
 incaip_133MHz_config   \
 incaip_150MHz_config   \
 incaip_config: unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
        @[ -z "$(findstring _100MHz,$@)" ] || \
-               { echo "#define CPU_CLOCK_RATE 100000000" >>include/config.h ; \
+               { echo "#define CPU_CLOCK_RATE 100000000" >>$(obj)include/config.h ; \
                  echo "... with 100MHz system clock" ; \
                }
        @[ -z "$(findstring _133MHz,$@)" ] || \
-               { echo "#define CPU_CLOCK_RATE 133000000" >>include/config.h ; \
+               { echo "#define CPU_CLOCK_RATE 133000000" >>$(obj)include/config.h ; \
                  echo "... with 133MHz system clock" ; \
                }
        @[ -z "$(findstring _150MHz,$@)" ] || \
-               { echo "#define CPU_CLOCK_RATE 150000000" >>include/config.h ; \
+               { echo "#define CPU_CLOCK_RATE 150000000" >>$(obj)include/config.h ; \
                  echo "... with 150MHz system clock" ; \
                }
-       @./mkconfig -a $(call xtract_incaip,$@) mips mips incaip
+       @$(MKCONFIG) -a $(call xtract_incaip,$@) mips mips incaip
 
 tb0229_config: unconfig
-       @./mkconfig $(@:_config=) mips mips tb0229
+       @$(MKCONFIG) $(@:_config=) mips mips tb0229
 
 #########################################################################
 ## MIPS32 AU1X00
 #########################################################################
 dbau1000_config                :       unconfig
-       @ >include/config.h
-       @echo "#define CONFIG_DBAU1000 1" >>include/config.h
-       @./mkconfig -a dbau1x00 mips mips dbau1x00
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
+       @echo "#define CONFIG_DBAU1000 1" >>$(obj)include/config.h
+       @$(MKCONFIG) -a dbau1x00 mips mips dbau1x00
 
 dbau1100_config                :       unconfig
-       @ >include/config.h
-       @echo "#define CONFIG_DBAU1100 1" >>include/config.h
-       @./mkconfig -a dbau1x00 mips mips dbau1x00
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
+       @echo "#define CONFIG_DBAU1100 1" >>$(obj)include/config.h
+       @$(MKCONFIG) -a dbau1x00 mips mips dbau1x00
 
 dbau1500_config                :       unconfig
-       @ >include/config.h
-       @echo "#define CONFIG_DBAU1500 1" >>include/config.h
-       @./mkconfig -a dbau1x00 mips mips dbau1x00
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
+       @echo "#define CONFIG_DBAU1500 1" >>$(obj)include/config.h
+       @$(MKCONFIG) -a dbau1x00 mips mips dbau1x00
 
 dbau1550_config                :       unconfig
-       @ >include/config.h
-       @echo "#define CONFIG_DBAU1550 1" >>include/config.h
-       @./mkconfig -a dbau1x00 mips mips dbau1x00
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
+       @echo "#define CONFIG_DBAU1550 1" >>$(obj)include/config.h
+       @$(MKCONFIG) -a dbau1x00 mips mips dbau1x00
 
 dbau1550_el_config     :       unconfig
-       @ >include/config.h
-       @echo "#define CONFIG_DBAU1550 1" >>include/config.h
-       @./mkconfig -a dbau1x00 mips mips dbau1x00
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
+       @echo "#define CONFIG_DBAU1550 1" >>$(obj)include/config.h
+       @$(MKCONFIG) -a dbau1x00 mips mips dbau1x00
 
 pb1000_config          :       unconfig
-       @ >include/config.h
-       @echo "#define CONFIG_PB1000 1" >>include/config.h
-       @./mkconfig -a pb1x00 mips mips pb1x00
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
+       @echo "#define CONFIG_PB1000 1" >>$(obj)include/config.h
+       @$(MKCONFIG) -a pb1x00 mips mips pb1x00
 
 #########################################################################
 ## MIPS64 5Kc
 #########################################################################
 
 purple_config :                unconfig
-       @./mkconfig $(@:_config=) mips mips purple
+       @$(MKCONFIG) $(@:_config=) mips mips purple
 
 #========================================================================
 # Nios
@@ -1917,80 +2106,83 @@ purple_config :         unconfig
 DK1C20_safe_32_config          \
 DK1C20_standard_32_config      \
 DK1C20_config: unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
        @[ -z "$(findstring _safe_32,$@)" ] || \
-               { echo "#define CONFIG_NIOS_SAFE_32 1" >>include/config.h ; \
+               { echo "#define CONFIG_NIOS_SAFE_32 1" >>$(obj)include/config.h ; \
                  echo "... NIOS 'safe_32' configuration" ; \
                }
        @[ -z "$(findstring _standard_32,$@)" ] || \
-               { echo "#define CONFIG_NIOS_STANDARD_32 1" >>include/config.h ; \
+               { echo "#define CONFIG_NIOS_STANDARD_32 1" >>$(obj)include/config.h ; \
                  echo "... NIOS 'standard_32' configuration" ; \
                }
        @[ -z "$(findstring DK1C20_config,$@)" ] || \
-               { echo "#define CONFIG_NIOS_STANDARD_32 1" >>include/config.h ; \
+               { echo "#define CONFIG_NIOS_STANDARD_32 1" >>$(obj)include/config.h ; \
                  echo "... NIOS 'standard_32' configuration (DEFAULT)" ; \
                }
-       @./mkconfig -a DK1C20 nios nios dk1c20 altera
+       @$(MKCONFIG) -a DK1C20 nios nios dk1c20 altera
 
 DK1S10_safe_32_config          \
 DK1S10_standard_32_config      \
 DK1S10_mtx_ldk_20_config       \
 DK1S10_config: unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
        @[ -z "$(findstring _safe_32,$@)" ] || \
-               { echo "#define CONFIG_NIOS_SAFE_32 1" >>include/config.h ; \
+               { echo "#define CONFIG_NIOS_SAFE_32 1" >>$(obj)include/config.h ; \
                  echo "... NIOS 'safe_32' configuration" ; \
                }
        @[ -z "$(findstring _standard_32,$@)" ] || \
-               { echo "#define CONFIG_NIOS_STANDARD_32 1" >>include/config.h ; \
+               { echo "#define CONFIG_NIOS_STANDARD_32 1" >>$(obj)include/config.h ; \
                  echo "... NIOS 'standard_32' configuration" ; \
                }
        @[ -z "$(findstring _mtx_ldk_20,$@)" ] || \
-               { echo "#define CONFIG_NIOS_MTX_LDK_20 1" >>include/config.h ; \
+               { echo "#define CONFIG_NIOS_MTX_LDK_20 1" >>$(obj)include/config.h ; \
                  echo "... NIOS 'mtx_ldk_20' configuration" ; \
                }
        @[ -z "$(findstring DK1S10_config,$@)" ] || \
-               { echo "#define CONFIG_NIOS_STANDARD_32 1" >>include/config.h ; \
+               { echo "#define CONFIG_NIOS_STANDARD_32 1" >>$(obj)include/config.h ; \
                  echo "... NIOS 'standard_32' configuration (DEFAULT)" ; \
                }
-       @./mkconfig -a DK1S10 nios nios dk1s10 altera
+       @$(MKCONFIG) -a DK1S10 nios nios dk1s10 altera
 
 ADNPESC1_DNPEVA2_base_32_config        \
 ADNPESC1_base_32_config                \
 ADNPESC1_config: unconfig
-       @ >include/config.h
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
        @[ -z "$(findstring _DNPEVA2,$@)" ] || \
-               { echo "#define CONFIG_DNPEVA2 1" >>include/config.h ; \
+               { echo "#define CONFIG_DNPEVA2 1" >>$(obj)include/config.h ; \
                  echo "... DNP/EVA2 configuration" ; \
                }
        @[ -z "$(findstring _base_32,$@)" ] || \
-               { echo "#define CONFIG_NIOS_BASE_32 1" >>include/config.h ; \
+               { echo "#define CONFIG_NIOS_BASE_32 1" >>$(obj)include/config.h ; \
                  echo "... NIOS 'base_32' configuration" ; \
                }
        @[ -z "$(findstring ADNPESC1_config,$@)" ] || \
-               { echo "#define CONFIG_NIOS_BASE_32 1" >>include/config.h ; \
+               { echo "#define CONFIG_NIOS_BASE_32 1" >>$(obj)include/config.h ; \
                  echo "... NIOS 'base_32' configuration (DEFAULT)" ; \
                }
-       @./mkconfig -a ADNPESC1 nios nios adnpesc1 ssv
+       @$(MKCONFIG) -a ADNPESC1 nios nios adnpesc1 ssv
 
 #########################################################################
 ## Nios-II
 #########################################################################
 
 EP1C20_config : unconfig
-       @./mkconfig  EP1C20 nios2 nios2 ep1c20 altera
+       @$(MKCONFIG)  EP1C20 nios2 nios2 ep1c20 altera
 
 EP1S10_config : unconfig
-       @./mkconfig  EP1S10 nios2 nios2 ep1s10 altera
+       @$(MKCONFIG)  EP1S10 nios2 nios2 ep1s10 altera
 
 EP1S40_config : unconfig
-       @./mkconfig  EP1S40 nios2 nios2 ep1s40 altera
+       @$(MKCONFIG)  EP1S40 nios2 nios2 ep1s40 altera
 
 PK1C20_config : unconfig
-       @./mkconfig  PK1C20 nios2 nios2 pk1c20 psyent
+       @$(MKCONFIG)  PK1C20 nios2 nios2 pk1c20 psyent
 
 PCI5441_config : unconfig
-       @./mkconfig  PCI5441 nios2 nios2 pci5441 psyent
+       @$(MKCONFIG)  PCI5441 nios2 nios2 pci5441 psyent
 
 #========================================================================
 # MicroBlaze
@@ -1999,62 +2191,72 @@ PCI5441_config : unconfig
 ## Microblaze
 #########################################################################
 suzaku_config: unconfig
-       @ >include/config.h
-       @echo "#define CONFIG_SUZAKU 1" >> include/config.h
-       @./mkconfig -a $(@:_config=) microblaze microblaze suzaku AtmarkTechno
+       @mkdir -p $(obj)include
+       @ >$(obj)include/config.h
+       @echo "#define CONFIG_SUZAKU 1" >> $(obj)include/config.h
+       @$(MKCONFIG) -a $(@:_config=) microblaze microblaze suzaku AtmarkTechno
 
 #########################################################################
 ## Blackfin
 #########################################################################
 ezkit533_config        :       unconfig
-       @./mkconfig $(@:_config=) blackfin bf533 ezkit533
+       @$(MKCONFIG) $(@:_config=) blackfin bf533 ezkit533
 
 stamp_config   :       unconfig
-       @./mkconfig $(@:_config=) blackfin bf533 stamp
+       @$(MKCONFIG) $(@:_config=) blackfin bf533 stamp
 
 dspstamp_config        :       unconfig
-       @./mkconfig $(@:_config=) blackfin bf533 dsp_stamp
+       @$(MKCONFIG) $(@:_config=) blackfin bf533 dsp_stamp
 
 #########################################################################
 #########################################################################
 #########################################################################
 
 clean:
-       find . -type f \
+       find $(OBJTREE) -type f \
                \( -name 'core' -o -name '*.bak' -o -name '*~' \
                -o -name '*.o'  -o -name '*.a'  \) -print \
                | xargs rm -f
-       rm -f examples/hello_world examples/timer \
-             examples/eepro100_eeprom examples/sched \
-             examples/mem_to_mem_idma2intr examples/82559_eeprom \
-             examples/smc91111_eeprom \
-             examples/test_burst
-       rm -f tools/img2srec tools/mkimage tools/envcrc tools/gen_eth_addr
-       rm -f tools/mpc86x_clk tools/ncb
-       rm -f tools/easylogo/easylogo tools/bmp_logo
-       rm -f tools/gdb/astest tools/gdb/gdbcont tools/gdb/gdbsend
-       rm -f tools/env/fw_printenv tools/env/fw_setenv
-       rm -f board/cray/L1/bootscript.c board/cray/L1/bootscript.image
-       rm -f board/netstar/eeprom board/netstar/crcek
-       rm -f board/netstar/*.srec board/netstar/*.bin
-       rm -f board/trab/trab_fkt board/voiceblue/eeprom
-       rm -f board/integratorap/u-boot.lds board/integratorcp/u-boot.lds
-       rm -f include/bmp_logo.h
+       rm -f $(obj)examples/hello_world $(obj)examples/timer \
+             $(obj)examples/eepro100_eeprom $(obj)examples/sched \
+             $(obj)examples/mem_to_mem_idma2intr $(obj)examples/82559_eeprom \
+             $(obj)examples/smc91111_eeprom $(obj)examples/interrupt \
+             $(obj)examples/test_burst
+       rm -f $(obj)tools/img2srec $(obj)tools/mkimage $(obj)tools/envcrc \
+               $(obj)tools/gen_eth_addr
+       rm -f $(obj)tools/mpc86x_clk $(obj)tools/ncb
+       rm -f $(obj)tools/easylogo/easylogo $(obj)tools/bmp_logo
+       rm -f $(obj)tools/gdb/astest $(obj)tools/gdb/gdbcont $(obj)tools/gdb/gdbsend
+       rm -f $(obj)tools/env/fw_printenv $(obj)tools/env/fw_setenv
+       rm -f $(obj)board/cray/L1/bootscript.c $(obj)board/cray/L1/bootscript.image
+       rm -f $(obj)board/netstar/eeprom $(obj)board/netstar/crcek $(obj)board/netstar/crcit
+       rm -f $(obj)board/netstar/*.srec $(obj)board/netstar/*.bin
+       rm -f $(obj)board/trab/trab_fkt $(obj)board/voiceblue/eeprom
+       rm -f $(obj)board/integratorap/u-boot.lds $(obj)board/integratorcp/u-boot.lds
+       rm -f $(obj)include/bmp_logo.h
+       find nand_spl -lname "*" -print | xargs rm -f
+       rm -f nand_spl/u-boot-spl nand_spl/u-boot-spl.map
 
 clobber:       clean
-       find . -type f \( -name .depend \
+       find $(OBJTREE) -type f \( -name .depend \
                -o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \
                -print0 \
                | xargs -0 rm -f
-       rm -f $(OBJS) *.bak tags TAGS include/version_autogenerated.h
-       rm -fr *.*~
-       rm -f u-boot u-boot.map u-boot.hex $(ALL)
-       rm -f tools/crc32.c tools/environment.c tools/env/crc32.c
-       rm -f tools/inca-swap-bytes cpu/mpc824x/bedbug_603e.c
-       rm -f include/asm/proc include/asm/arch include/asm
-
+       rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS $(obj)include/version_autogenerated.h
+       rm -fr $(obj)*.*~
+       rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)
+       rm -f $(obj)tools/crc32.c $(obj)tools/environment.c $(obj)tools/env/crc32.c
+       rm -f $(obj)tools/inca-swap-bytes $(obj)cpu/mpc824x/bedbug_603e.c
+       rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
+
+ifeq ($(OBJTREE),$(SRCTREE))
 mrproper \
 distclean:     clobber unconfig
+else
+mrproper \
+distclean:     clobber unconfig
+       rm -rf $(OBJTREE)/*
+endif
 
 backup:
        F=`basename $(TOPDIR)` ; cd .. ; \
diff --git a/README b/README
index 621f3f3bd3fa9a4c82e76c06284fe9f796db09e5..32a5d686921505e9aec29f0c36c610ca859278ad 100644 (file)
--- a/README
+++ b/README
@@ -2328,6 +2328,26 @@ images ready for download to / installation on your system:
 - "u-boot" is an image in ELF binary format
 - "u-boot.srec" is in Motorola S-Record format
 
+By default the build is performed locally and the objects are saved
+in the source directory. One of the two methods can be used to change
+this behavior and build U-Boot to some external directory:
+
+1. Add O= to the make command line invocations:
+
+       make O=/tmp/build distclean
+       make O=/tmp/build NAME_config
+       make O=/tmp/build all
+
+2. Set environment variable BUILD_DIR to point to the desired location:
+
+       export BUILD_DIR=/tmp/build
+       make distclean
+       make NAME_config
+       make all
+
+Note that the command line "O=" setting overrides the BUILD_DIR environment
+variable.
+
 
 Please be aware that the Makefiles assume you are using GNU make, so
 for instance on NetBSD you might need to use "gmake" instead of
@@ -2381,6 +2401,22 @@ or to build on a native PowerPC system you can type
 
        CROSS_COMPILE=' ' MAKEALL
 
+When using the MAKEALL script, the default behaviour is to build U-Boot
+in the source directory. This location can be changed by setting the
+BUILD_DIR environment variable. Also, for each target built, the MAKEALL
+script saves two log files (<target>.ERR and <target>.MAKEALL) in the
+<source dir>/LOG directory. This default location can be changed by
+setting the MAKEALL_LOGDIR environment variable. For example:
+
+       export BUILD_DIR=/tmp/build
+       export MAKEALL_LOGDIR=/tmp/log
+       CROSS_COMPILE=ppc_8xx- MAKEALL
+
+With the above settings build objects are saved in the /tmp/build, log
+files are saved in the /tmp/log and the source tree remains clean during
+the whole build process.
+
+
 See also "U-Boot Porting Guide" below.
 
 
@@ -3523,12 +3559,19 @@ Coding Standards:
 -----------------
 
 All contributions to U-Boot should conform to the Linux kernel
-coding style; see the file "Documentation/CodingStyle" in your Linux
-kernel source directory.
-
-Please note that U-Boot is implemented in C (and to some small parts
-in Assembler); no C++ is used, so please do not use C++ style
-comments (//) in your code.
+coding style; see the file "Documentation/CodingStyle" and the script
+"scripts/Lindent" in your Linux kernel source directory.  In sources
+originating from U-Boot a style corresponding to "Lindent -pcs" (adding
+spaces before parameters to function calls) is actually used.
+
+Source files originating from a different project (for example the
+MTD subsystem) are generally exempt from these guidelines and are not
+reformated to ease subsequent migration to newer versions of those
+sources.
+
+Please note that U-Boot is implemented in C (and to some small parts in
+Assembler); no C++ is used, so please do not use C++ style comments (//)
+in your code.
 
 Please also stick to the following formatting rules:
 - remove any trailing white space
index 7a17067936dc04d655d7a0582e2a4158b2a34ff9..b42026981f5ec0133bede8197f7c62ba8a368e54 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 0596572d19f2cd01b84cf7a4ac74c51a8a018f03..57363bc249bbfa3aa39e3adf4a3292d0df81c341 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2003
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o cfm_flash.o flash.o VCxK.o
+COBJS  = $(BOARD).o cfm_flash.o flash.o VCxK.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 10106f4585402a525e031c0c59eb414aed43234d..ecde6ed8b4100c91a003acd94c51c5dae9248964 100644 (file)
@@ -1 +1 @@
-TEXT_BASE = 0xF0000000
+TEXT_BASE = 0xFFE00000
index 3e731636e034c3e5a93e12d02edf830973decc3b..43044943b11a863f1480b3d2645cea190d5831ce 100644 (file)
@@ -4,6 +4,9 @@
 # Copyright (C) 2000, 2001, 2002, 2003
 # The LEOX team <team@leox.org>, http://www.leox.org
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # LEOX.org is about the development of free hardware and software resources
 #   for system on chip.
 #
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
+
+COBJS  = $(BOARD).o flash.o
 
-OBJS   = $(BOARD).o flash.o
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        .depend $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index b1247fe4e8de27b12a7e4d730aedd7f761d403a6..e9204823d968e4b81c028c3b409eacbd5d5dc4f6 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2002
+# (C) Copyright 2002-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../menu)
+$(shell mkdir -p $(obj)../bios_emulator)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
 COBJS  = $(BOARD).o articiaS.o flash.o serial.o smbus.o articiaS_pci.o \
                via686.o i8259.o ../bios_emulator/x86interface.o        \
@@ -31,26 +35,29 @@ COBJS       = $(BOARD).o articiaS.o flash.o serial.o smbus.o articiaS_pci.o \
                interrupts.o ps2kbd.o video.o usb_uhci.o enet.o         \
                ../menu/cmd_menu.o cmd_boota.o nvram.o
 
-AOBJS  = board_asm_init.o memio.o
-
-OBJS   = $(COBJS) $(AOBJS)
+SOBJS  = board_asm_init.o memio.o
 
 EMUDIR  = ../bios_emulator/scitech/src/x86emu/
 EMUOBJ  = $(EMUDIR)decode.o $(EMUDIR)ops2.o $(EMUDIR)fpu.o $(EMUDIR)prim_ops.o \
                $(EMUDIR)ops.o $(EMUDIR)sys.o
-EMUSRC = $(EMUOBJ:.o=.c)
+EMUSRC  = $(EMUOBJ:.o=.c)
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+EMUOBJ  := $(addprefix $(obj),$(EMUOBJ))
 
-$(LIB):        .depend $(OBJS) $(EMUSRC)
-       make libx86emu.a -C ../bios_emulator/scitech/src/x86emu -f makefile.uboot CROSS_COMPILE=$(CROSS_COMPILE)
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS) $(EMUSRC)
+       make $(obj)libx86emu.a -C ../bios_emulator/scitech/src/x86emu -f makefile.uboot CROSS_COMPILE=$(CROSS_COMPILE)
        -rm $(LIB)
-       $(AR) crv $@ $(OBJS) $(EMUOBJ)
+       $(AR) crv $@ $(OBJS) $(SOBJS) $(EMUOBJ)
 
 
 #########################################################################
 
-.depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
-       $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 768ccddbbf00f9d4d4cf0b922ca9dd0bb245294f..a084c894ae3c66a8cf2be6598715d5af0edc03b3 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+# 
 # (C) Copyright 2001
 # Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
 #
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
 SOBJS  = ../common/misc.o
 
-OBJS   = $(BOARD).o ../common/flash.o ../common/serial.o ../common/memory.o pci.o \
+COBJS  = $(BOARD).o ../common/flash.o ../common/serial.o ../common/memory.o pci.o \
          mv_eth.o ../common/ns16550.o mpsc.o ../common/i2c.o \
          sdram_init.o ../common/intel_flash.o
 
-$(LIB):        .depend $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 768ccddbbf00f9d4d4cf0b922ca9dd0bb245294f..a084c894ae3c66a8cf2be6598715d5af0edc03b3 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+# 
 # (C) Copyright 2001
 # Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
 #
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
 SOBJS  = ../common/misc.o
 
-OBJS   = $(BOARD).o ../common/flash.o ../common/serial.o ../common/memory.o pci.o \
+COBJS  = $(BOARD).o ../common/flash.o ../common/serial.o ../common/memory.o pci.o \
          mv_eth.o ../common/ns16550.o mpsc.o ../common/i2c.o \
          sdram_init.o ../common/intel_flash.o
 
-$(LIB):        .depend $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 93907babe0be7327d6eb5fb9bae43ad3c82f8af3..d8832ac1b863029cd99e08731ea2485c04d465b1 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o eccx.o
+COBJS  = $(BOARD).o flash.o eccx.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 13ce9fc9d28c852268a69aad84fab55016aedc5a..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index d45702091f0b2c947f4fa88af21a83a87eb505f9..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index fdc6fd53ea660851d30e36dab781be859d949c9a..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 5fde362713bed4c747b5ab995f03dcef1bed6d90..43c27e9babaab545b295c3a5b2ea9c78336e4c86 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 9123a8026d8a076a182cf12dd5bfad38d1166cfa..d0223b51ffc971d51ed699d2592b66bca9c9ab02 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # Copyright (C) 2004 Arabella Software Ltd.
 # Yuli Barcohen <yuli@arabellasw.com>
 #
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
+
+COBJS  := $(BOARD).o
 
-OBJS   := $(BOARD).o
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        $(OBJS) $(SOBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -38,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 24d5d062bcb0b542a1e29a0b5b8b320eb6058a59..0daa3838d67c8f0759ad88c397017ebf15d020fc 100644 (file)
@@ -1,6 +1,5 @@
-
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := adsvix.o pcmcia.o
+COBJS  := adsvix.o pcmcia.o
 SOBJS  := lowlevel_init.o pxavoltage.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -40,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index a4c1d2e9acd2d903d777d47551857dff4a2989a9..969580e9388dbef5e607043d63bf9af7588f247a 100644 (file)
@@ -1,4 +1,5 @@
-# (C) Copyright 2003-2005
+#
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
+
+COBJS  := $(BOARD).o flash.o
 
-OBJS   := $(BOARD).o flash.o
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        $(OBJS) $(SOBJS)
+$(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -37,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 9182a4ecfee30f6540d73c636a2f2291b7b4a238..26c724c5a15dbeb264f48d1cef1a8c94f48d6b13 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001-2004
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
-
-OBJS   := $(BOARD).o flash.o misc.o
+LIB    = $(obj)lib$(BOARD).a
 
+COBJS  := $(BOARD).o flash.o misc.o
 SOBJS  = vectors.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -40,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 9182a4ecfee30f6540d73c636a2f2291b7b4a238..26c724c5a15dbeb264f48d1cef1a8c94f48d6b13 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001-2004
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
-
-OBJS   := $(BOARD).o flash.o misc.o
+LIB    = $(obj)lib$(BOARD).a
 
+COBJS  := $(BOARD).o flash.o misc.o
 SOBJS  = vectors.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -40,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index a92b2583395d8d89167fe1da5bcf65ce66ebb435..26873b6c2c7a3077ccbfcc4b192614c3d1e1c3ae 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001-2004
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -12,7 +12,7 @@
 #
 # 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
+# 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
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
 COMOBJS := ../common/AMDLV065D.o ../common/epled.o
 
-OBJS   := $(BOARD).o $(COMOBJS)
+COBJS  := $(BOARD).o $(COMOBJS)
 
-SOBJS  =
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB): $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -42,9 +47,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index a92b2583395d8d89167fe1da5bcf65ce66ebb435..26873b6c2c7a3077ccbfcc4b192614c3d1e1c3ae 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001-2004
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -12,7 +12,7 @@
 #
 # 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
+# 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
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
 COMOBJS := ../common/AMDLV065D.o ../common/epled.o
 
-OBJS   := $(BOARD).o $(COMOBJS)
+COBJS  := $(BOARD).o $(COMOBJS)
 
-SOBJS  =
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB): $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -42,9 +47,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index a92b2583395d8d89167fe1da5bcf65ce66ebb435..26873b6c2c7a3077ccbfcc4b192614c3d1e1c3ae 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001-2004
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -12,7 +12,7 @@
 #
 # 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
+# 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
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
 COMOBJS := ../common/AMDLV065D.o ../common/epled.o
 
-OBJS   := $(BOARD).o $(COMOBJS)
+COBJS  := $(BOARD).o $(COMOBJS)
 
-SOBJS  =
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB): $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -42,9 +47,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 5654f91a83513402b92ca853e836ed08209312b9..5f3e34e246816ffd9af5c145cf3bfa7d17e1266a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2002
+# (C) Copyright 2002-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o
-OBJS   += flash.o
+COBJS  = $(BOARD).o flash.o
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
@@ -40,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index f5bda5519abb310366b16b90768fbc1969377d25..e78ed5f926d78eb3adf2f5e0f43cf196d706a0b7 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index a0acbba70c3a8fe7061c15ea9facc31496a3ac35..e6429ecd1365fb7a0dfe89e14c9319dc9e098df5 100644 (file)
@@ -35,7 +35,7 @@
 #include <ppc4xx.h>
 #include <asm/processor.h>
 
-flash_info_t flash_info[CFG_MAX_FLASH_BANKS];  /* info for FLASH chips        */
+flash_info_t flash_info[CFG_MAX_FLASH_BANKS];  /* info for FLASH chips */
 
 /*-----------------------------------------------------------------------
  * Functions
@@ -76,7 +76,7 @@ void flash_print_info(flash_info_t * info)
        case FLASH_MAN_SST:
                printf("SST ");
                break;
-        case FLASH_MAN_MX:
+       case FLASH_MAN_MX:
                printf ("MACRONIX ");
                break;
        default:
@@ -223,75 +223,75 @@ static ulong flash_get_size(vu_long * addr, flash_info_t * info)
                return (0);     /* no or unknown flash  */
        }
 
-       value = addr2[1];       /* device ID            */
+       value = addr2[1];       /* device ID */
        DEBUGF("\nFLASH DEVICEID: %x\n", value);
 
        switch (value) {
        case (CFG_FLASH_WORD_SIZE) AMD_ID_LV040B:
                info->flash_id += FLASH_AM040;
                info->sector_count = 8;
-               info->size = 0x0080000; /* => 512 ko */
+               info->size = 0x0080000;         /* => 512 KiB */
                break;
 
        case (CFG_FLASH_WORD_SIZE) AMD_ID_F040B:
                info->flash_id += FLASH_AM040;
                info->sector_count = 8;
-               info->size = 0x0080000; /* => 512 ko */
+               info->size = 0x0080000;         /* => 512 KiB */
                break;
 
        case (CFG_FLASH_WORD_SIZE) STM_ID_M29W040B:
                info->flash_id += FLASH_AM040;
                info->sector_count = 8;
-               info->size = 0x0080000; /* => 512 ko */
+               info->size = 0x0080000;         /* => 512 KiB */
                break;
 
        case (CFG_FLASH_WORD_SIZE) AMD_ID_F016D:
                info->flash_id += FLASH_AMD016;
                info->sector_count = 32;
-               info->size = 0x00200000;
-               break;          /* => 2 MB              */
+               info->size = 0x00200000;        /* => 2 MiB */
+               break;
 
        case (CFG_FLASH_WORD_SIZE) AMD_ID_LV033C:
                info->flash_id += FLASH_AMDLV033C;
                info->sector_count = 64;
-               info->size = 0x00400000;
-               break;          /* => 4 MB              */
+               info->size = 0x00400000;        /* => 4 MiB */
+               break;
 
        case (CFG_FLASH_WORD_SIZE) AMD_ID_LV400T:
                info->flash_id += FLASH_AM400T;
                info->sector_count = 11;
-               info->size = 0x00080000;
-               break;          /* => 0.5 MB            */
+               info->size = 0x00080000;        /* => 512 KiB */
+               break;
 
        case (CFG_FLASH_WORD_SIZE) AMD_ID_LV400B:
                info->flash_id += FLASH_AM400B;
                info->sector_count = 11;
-               info->size = 0x00080000;
-               break;          /* => 0.5 MB            */
+               info->size = 0x00080000;        /* => 512 KiB */
+               break;
 
        case (CFG_FLASH_WORD_SIZE) AMD_ID_LV800T:
                info->flash_id += FLASH_AM800T;
                info->sector_count = 19;
-               info->size = 0x00100000;
-               break;          /* => 1 MB              */
+               info->size = 0x00100000;        /* => 1 MiB */
+               break;
 
        case (CFG_FLASH_WORD_SIZE) AMD_ID_LV800B:
                info->flash_id += FLASH_AM800B;
                info->sector_count = 19;
-               info->size = 0x00100000;
-               break;          /* => 1 MB              */
+               info->size = 0x00100000;        /* => 1 MiB */
+               break;
 
        case (CFG_FLASH_WORD_SIZE) AMD_ID_LV160T:
                info->flash_id += FLASH_AM160T;
                info->sector_count = 35;
-               info->size = 0x00200000;
-               break;          /* => 2 MB              */
+               info->size = 0x00200000;        /* => 2 MiB */
+               break;
 
        case (CFG_FLASH_WORD_SIZE) AMD_ID_LV160B:
                info->flash_id += FLASH_AM160B;
                info->sector_count = 35;
-               info->size = 0x00200000;
-               break;          /* => 2 MB              */
+               info->size = 0x00200000;        /* => 2 MiB */
+               break;
 
        default:
                info->flash_id = FLASH_UNKNOWN;
@@ -306,7 +306,7 @@ static ulong flash_get_size(vu_long * addr, flash_info_t * info)
                        info->start[i] = base + (i * 0x00010000);
        } else {
                if (info->flash_id & FLASH_BTYPE) {
-                       /* set sector offsets for bottom boot block type        */
+                       /* set sector offsets for bottom boot block type */
                        info->start[0] = base + 0x00000000;
                        info->start[1] = base + 0x00004000;
                        info->start[2] = base + 0x00006000;
@@ -316,7 +316,7 @@ static ulong flash_get_size(vu_long * addr, flash_info_t * info)
                                    base + (i * 0x00010000) - 0x00030000;
                        }
                } else {
-                       /* set sector offsets for top boot block type           */
+                       /* set sector offsets for top boot block type */
                        i = info->sector_count - 1;
                        info->start[i--] = base + info->size - 0x00004000;
                        info->start[i--] = base + info->size - 0x00006000;
@@ -666,7 +666,7 @@ static ulong flash_get_size_2(vu_long * addr, flash_info_t * info)
                return (0);     /* no or unknown flash  */
        }
 
-       value = addr2[1];       /* device ID            */
+       value = addr2[1];       /* device ID */
 
        DEBUGF("\nFLASH DEVICEID: %x\n", value);
 
@@ -675,17 +675,17 @@ static ulong flash_get_size_2(vu_long * addr, flash_info_t * info)
        case (CFG_FLASH_WORD_SIZE)AMD_ID_LV320T:
                info->flash_id += FLASH_AM320T;
                info->sector_count = 71;
-               info->size = 0x00400000;  break;        /* => 4 M     */
+               info->size = 0x00400000;  break;        /* => 4 MiB     */
 
        case (CFG_FLASH_WORD_SIZE)AMD_ID_LV320B:
                info->flash_id += FLASH_AM320B;
                info->sector_count = 71;
-               info->size = 0x00400000;  break;        /* => 4 M     */
+               info->size = 0x00400000;  break;        /* => 4 MiB     */
 
        case (CFG_FLASH_WORD_SIZE)STM_ID_29W320DT:
                info->flash_id += FLASH_STMW320DT;
                info->sector_count = 67;
-               info->size = 0x00400000;  break;        /* => 4 M     */
+               info->size = 0x00400000;  break;        /* => 4 MiB     */
 
        case (CFG_FLASH_WORD_SIZE)MX_ID_LV320T:
                info->flash_id += FLASH_MXLV320T;
@@ -743,7 +743,7 @@ static ulong flash_get_size_2(vu_long * addr, flash_info_t * info)
                        info->start[i] = base + i * 0x00010000;
        } else {
                if (info->flash_id & FLASH_BTYPE) {
-                       /* set sector offsets for bottom boot block type        */
+                       /* set sector offsets for bottom boot block type */
                        info->start[0] = base + 0x00000000;
                        info->start[1] = base + 0x00004000;
                        info->start[2] = base + 0x00006000;
@@ -753,7 +753,7 @@ static ulong flash_get_size_2(vu_long * addr, flash_info_t * info)
                                    base + (i * 0x00010000) - 0x00030000;
                        }
                } else {
-                       /* set sector offsets for top boot block type           */
+                       /* set sector offsets for top boot block type */
                        i = info->sector_count - 1;
                        info->start[i--] = base + info->size - 0x00004000;
                        info->start[i--] = base + info->size - 0x00006000;
index 4a3927be7e373660c205414c24ff9354e412e244..5f3e34e246816ffd9af5c145cf3bfa7d17e1266a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2002
+# (C) Copyright 2002-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 5654f91a83513402b92ca853e836ed08209312b9..5f3e34e246816ffd9af5c145cf3bfa7d17e1266a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2002
+# (C) Copyright 2002-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o
-OBJS   += flash.o
+COBJS  = $(BOARD).o flash.o
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
@@ -40,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index af223d2c5596f9a37b2c3c3d349ea418b6297b27..4def7fd79b0298db0f6e959661a0f318bcf8fbf7 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2002
+# (C) Copyright 2002-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
diff --git a/board/amcc/sequoia/Makefile b/board/amcc/sequoia/Makefile
new file mode 100644 (file)
index 0000000..b29c04a
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# (C) Copyright 2002-2006
+# Wolfgang Denk, DENX Software Engineering, wd@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
+#
+
+include $(TOPDIR)/config.mk
+include $(TOPDIR)/include/config.mk
+
+LIB    = $(obj)lib$(BOARD).a
+
+COBJS  = $(BOARD).o sdram.o
+SOBJS  = init.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
+
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak .depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/amcc/sequoia/config.mk b/board/amcc/sequoia/config.mk
new file mode 100644 (file)
index 0000000..7713a72
--- /dev/null
@@ -0,0 +1,41 @@
+#
+# (C) Copyright 2002
+# Wolfgang Denk, DENX Software Engineering, wd@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
+#
+#
+# AMCC 440EPx Reference Platform (Sequoia) board
+#
+
+sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
+
+ifndef TEXT_BASE
+TEXT_BASE = 0xFFFA0000
+endif
+
+PLATFORM_CPPFLAGS += -DCONFIG_440=1
+
+ifeq ($(debug),1)
+PLATFORM_CPPFLAGS += -DDEBUG
+endif
+
+ifeq ($(dbcr),1)
+PLATFORM_CPPFLAGS += -DCFG_INIT_DBCR=0x8cff0000
+endif
diff --git a/board/amcc/sequoia/init.S b/board/amcc/sequoia/init.S
new file mode 100644 (file)
index 0000000..3d4ac85
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ *
+ * 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
+ */
+
+#include <ppc_asm.tmpl>
+#include <config.h>
+
+/* General */
+#define TLB_VALID   0x00000200
+#define _256M       0x10000000
+
+/* Supported page sizes */
+
+#define SZ_1K      0x00000000
+#define SZ_4K      0x00000010
+#define SZ_16K     0x00000020
+#define SZ_64K     0x00000030
+#define SZ_256K            0x00000040
+#define SZ_1M      0x00000050
+#define SZ_8M       0x00000060
+#define SZ_16M     0x00000070
+#define SZ_256M            0x00000090
+
+/* Storage attributes */
+#define SA_W       0x00000800      /* Write-through */
+#define SA_I       0x00000400      /* Caching inhibited */
+#define SA_M       0x00000200      /* Memory coherence */
+#define SA_G       0x00000100      /* Guarded */
+#define SA_E       0x00000080      /* Endian */
+
+/* Access control */
+#define AC_X       0x00000024      /* Execute */
+#define AC_W       0x00000012      /* Write */
+#define AC_R       0x00000009      /* Read */
+
+/* Some handy macros */
+
+#define EPN(e)         ((e) & 0xfffffc00)
+#define TLB0(epn,sz)   ( (EPN((epn)) | (sz) | TLB_VALID ) )
+#define TLB1(rpn,erpn) ( ((rpn)&0xfffffc00) | (erpn) )
+#define TLB2(a)                ( (a)&0x00000fbf )
+
+#define tlbtab_start\
+       mflr    r1  ;\
+       bl 0f       ;
+
+#define tlbtab_end\
+       .long 0, 0, 0   ;   \
+0:     mflr    r0      ;   \
+       mtlr    r1      ;   \
+       blr             ;
+
+#define tlbentry(epn,sz,rpn,erpn,attr)\
+       .long TLB0(epn,sz),TLB1(rpn,erpn),TLB2(attr)
+
+
+/**************************************************************************
+ * TLB TABLE
+ *
+ * This table is used by the cpu boot code to setup the initial tlb
+ * entries. Rather than make broad assumptions in the cpu source tree,
+ * this table lets each board set things up however they like.
+ *
+ *  Pointer to the table is returned in r1
+ *
+ *************************************************************************/
+    .section .bootpg,"ax"
+    .globl tlbtab
+
+tlbtab:
+       tlbtab_start
+
+       /*
+        * BOOT_CS (FLASH) must be first. Before relocation SA_I can be off to use the
+        * speed up boot process. It is patched after relocation to enable SA_I
+       */
+#ifndef CONFIG_NAND_SPL
+       tlbentry( CFG_BOOT_BASE_ADDR, SZ_256M, CFG_BOOT_BASE_ADDR, 1, AC_R|AC_W|AC_X|SA_G )
+#else
+       tlbentry( CFG_NAND_BOOT_SPL_SRC, SZ_4K, CFG_NAND_BOOT_SPL_SRC, 1, AC_R|AC_W|AC_X|SA_G )
+#endif
+
+       /* TLB-entry for DDR SDRAM (Up to 2GB) */
+       tlbentry( CFG_SDRAM_BASE, SZ_256M, CFG_SDRAM_BASE, 0, AC_R|AC_W|AC_X|SA_G|SA_I )
+
+#ifdef CFG_INIT_RAM_DCACHE
+       /* TLB-entry for init-ram in dcache (SA_I must be turned off!) */
+       tlbentry( CFG_INIT_RAM_ADDR, SZ_64K, CFG_INIT_RAM_ADDR, 0, AC_R|AC_W|AC_X|SA_G )
+#endif
+
+       /* TLB-entry for PCI Memory */
+       tlbentry( CFG_PCI_MEMBASE, SZ_256M, CFG_PCI_MEMBASE, 1, AC_R|AC_W|SA_G|SA_I )
+       tlbentry( CFG_PCI_MEMBASE1, SZ_256M, CFG_PCI_MEMBASE1, 1, AC_R|AC_W|SA_G|SA_I )
+       tlbentry( CFG_PCI_MEMBASE2, SZ_256M, CFG_PCI_MEMBASE2, 1, AC_R|AC_W|SA_G|SA_I )
+       tlbentry( CFG_PCI_MEMBASE3, SZ_256M, CFG_PCI_MEMBASE3, 1, AC_R|AC_W|SA_G|SA_I )
+
+       /* TLB-entry for EBC */
+       tlbentry( CFG_BCSR_BASE, SZ_1K, CFG_BCSR_BASE, 1, AC_R|AC_W|AC_X|SA_G|SA_I )
+
+       /* TLB-entry for NAND */
+       tlbentry( CFG_NAND_ADDR, SZ_1K, CFG_NAND_ADDR, 1, AC_R|AC_W|AC_X|SA_G|SA_I )
+
+       /* TLB-entry for Internal Registers & OCM */
+       tlbentry( 0xe0000000, SZ_16M, 0xe0000000, 0,  AC_R|AC_W|AC_X|SA_I )
+
+       /*TLB-entry PCI registers*/
+       tlbentry( 0xEEC00000, SZ_1K, 0xEEC00000, 1,  AC_R|AC_W|AC_X|SA_G|SA_I )
+
+       /* TLB-entry for peripherals */
+       tlbentry( 0xEF000000, SZ_16M, 0xEF000000, 1, AC_R|AC_W|AC_X|SA_G|SA_I)
+
+       tlbtab_end
+
+#if defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_NAND_SPL)
+       /*
+        * For NAND booting the first TLB has to be reconfigured to full size
+        * and with caching disabled after running from RAM!
+        */
+#define TLB00  TLB0(CFG_BOOT_BASE_ADDR, SZ_256M)
+#define TLB01  TLB1(CFG_BOOT_BASE_ADDR, 1)
+#define TLB02  TLB2(AC_R|AC_W|AC_X|SA_G|SA_I)
+
+       .globl  reconfig_tlb0
+reconfig_tlb0:
+       sync
+       isync
+       addi    r4,r0,0x0000            /* TLB entry #0 */
+       lis     r5,TLB00@h
+       ori     r5,r5,TLB00@l
+       tlbwe   r5,r4,0x0000            /* Save it out */
+       lis     r5,TLB01@h
+       ori     r5,r5,TLB01@l
+       tlbwe   r5,r4,0x0001            /* Save it out */
+       lis     r5,TLB02@h
+       ori     r5,r5,TLB02@l
+       tlbwe   r5,r4,0x0002            /* Save it out */
+       sync
+       isync
+       blr
+#endif
diff --git a/board/amcc/sequoia/sdram.c b/board/amcc/sequoia/sdram.c
new file mode 100644 (file)
index 0000000..a62648b
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * (C) Copyright 2006
+ * Stefan Roese, DENX Software Engineering, sr@denx.de.
+ *
+ * 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
+ */
+
+#include <common.h>
+#include <asm/processor.h>
+#include <ppc440.h>
+
+/*************************************************************************
+ *
+ * initdram -- 440EPx's DDR controller is a DENALI Core
+ *
+ ************************************************************************/
+long int initdram (int board_type)
+{
+#if !defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
+       volatile ulong val;
+
+       mtsdram(DDR0_02, 0x00000000);
+
+       /*
+        * Soft-reset SDRAM controller
+        */
+       mtsdr(sdr_srst, SDR0_SRST0_DMC);
+       mtsdr(sdr_srst, 0x00000000);
+
+       mtsdram(DDR0_00, 0x0000190A);
+       mtsdram(DDR0_01, 0x01000000);
+       mtsdram(DDR0_03, 0x02030602);
+       mtsdram(DDR0_04, 0x13030300);
+       mtsdram(DDR0_05, 0x0202050E);
+       mtsdram(DDR0_06, 0x0104C823);
+       mtsdram(DDR0_07, 0x000D0100);
+       mtsdram(DDR0_08, 0x02360001);
+       mtsdram(DDR0_09, 0x00011D5F);
+       mtsdram(DDR0_10, 0x00000300);
+       mtsdram(DDR0_11, 0x0027C800);
+       mtsdram(DDR0_12, 0x00000003);
+       mtsdram(DDR0_14, 0x00000000);
+       mtsdram(DDR0_17, 0x19000000);
+       mtsdram(DDR0_18, 0x19191919);
+       mtsdram(DDR0_19, 0x19191919);
+       mtsdram(DDR0_20, 0x0B0B0B0B);
+       mtsdram(DDR0_21, 0x0B0B0B0B);
+       mtsdram(DDR0_22, 0x00267F0B);
+       mtsdram(DDR0_23, 0x00000000);
+       mtsdram(DDR0_24, 0x01010002);
+       mtsdram(DDR0_26, 0x5B260181);
+       mtsdram(DDR0_27, 0x0000682B);
+       mtsdram(DDR0_28, 0x00000000);
+       mtsdram(DDR0_31, 0x00000000);
+       mtsdram(DDR0_42, 0x01000006);
+       mtsdram(DDR0_43, 0x050A0200);
+       mtsdram(DDR0_44, 0x00000005);
+       mtsdram(DDR0_02, 0x00000001);
+
+       /*
+        * Wait for DCC master delay line to finish calibration
+        */
+       mfsdram(DDR0_17, val);
+       while (((val >> 8) & 0x000007f) == 0) {
+               mfsdram(DDR0_17, val);
+       }
+#endif /* #ifndef CONFIG_NAND_U_BOOT */
+
+       return (CFG_MBYTES_SDRAM << 20);
+}
diff --git a/board/amcc/sequoia/sequoia.c b/board/amcc/sequoia/sequoia.c
new file mode 100644 (file)
index 0000000..95734b9
--- /dev/null
@@ -0,0 +1,552 @@
+/*
+ * (C) Copyright 2006
+ * Stefan Roese, DENX Software Engineering, sr@denx.de.
+ *
+ * (C) Copyright 2006
+ * Jacqueline Pira-Ferriol, AMCC/IBM, jpira-ferriol@fr.ibm.com
+ * Alain Saurel,            AMCC/IBM, alain.saurel@fr.ibm.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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/processor.h>
+#include <ppc440.h>
+#include "sequoia.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+extern flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips   */
+
+int board_early_init_f(void)
+{
+       unsigned long sdr0_cust0;
+       unsigned long sdr0_pfc1, sdr0_pfc2;
+       register uint reg;
+
+       mtdcr(ebccfga, xbcfg);
+       mtdcr(ebccfgd, 0xb8400000);
+
+       /*--------------------------------------------------------------------
+        * Setup the GPIO pins
+        *-------------------------------------------------------------------*/
+       /* test-only: take GPIO init from pcs440ep ???? in config file */
+       out32(GPIO0_OR, 0x00000000);
+       out32(GPIO0_TCR, 0x0000000f);
+       out32(GPIO0_OSRL, 0x50015400);
+       out32(GPIO0_OSRH, 0x550050aa);
+       out32(GPIO0_TSRL, 0x50015400);
+       out32(GPIO0_TSRH, 0x55005000);
+       out32(GPIO0_ISR1L, 0x50000000);
+       out32(GPIO0_ISR1H, 0x00000000);
+       out32(GPIO0_ISR2L, 0x00000000);
+       out32(GPIO0_ISR2H, 0x00000100);
+       out32(GPIO0_ISR3L, 0x00000000);
+       out32(GPIO0_ISR3H, 0x00000000);
+
+       out32(GPIO1_OR, 0x00000000);
+       out32(GPIO1_TCR, 0xc2000000);
+       out32(GPIO1_OSRL, 0x5c280000);
+       out32(GPIO1_OSRH, 0x00000000);
+       out32(GPIO1_TSRL, 0x0c000000);
+       out32(GPIO1_TSRH, 0x00000000);
+       out32(GPIO1_ISR1L, 0x00005550);
+       out32(GPIO1_ISR1H, 0x00000000);
+       out32(GPIO1_ISR2L, 0x00050000);
+       out32(GPIO1_ISR2H, 0x00000000);
+       out32(GPIO1_ISR3L, 0x01400000);
+       out32(GPIO1_ISR3H, 0x00000000);
+
+       /*--------------------------------------------------------------------
+        * Setup the interrupt controller polarities, triggers, etc.
+        *-------------------------------------------------------------------*/
+       mtdcr(uic0sr, 0xffffffff);      /* clear all */
+       mtdcr(uic0er, 0x00000000);      /* disable all */
+       mtdcr(uic0cr, 0x00000005);      /* ATI & UIC1 crit are critical */
+       mtdcr(uic0pr, 0xfffff7ff);      /* per ref-board manual */
+       mtdcr(uic0tr, 0x00000000);      /* per ref-board manual */
+       mtdcr(uic0vr, 0x00000000);      /* int31 highest, base=0x000 */
+       mtdcr(uic0sr, 0xffffffff);      /* clear all */
+
+       mtdcr(uic1sr, 0xffffffff);      /* clear all */
+       mtdcr(uic1er, 0x00000000);      /* disable all */
+       mtdcr(uic1cr, 0x00000000);      /* all non-critical */
+       mtdcr(uic1pr, 0xffffffff);      /* per ref-board manual */
+       mtdcr(uic1tr, 0x00000000);      /* per ref-board manual */
+       mtdcr(uic1vr, 0x00000000);      /* int31 highest, base=0x000 */
+       mtdcr(uic1sr, 0xffffffff);      /* clear all */
+
+       mtdcr(uic2sr, 0xffffffff);      /* clear all */
+       mtdcr(uic2er, 0x00000000);      /* disable all */
+       mtdcr(uic2cr, 0x00000000);      /* all non-critical */
+       mtdcr(uic2pr, 0xffffffff);      /* per ref-board manual */
+       mtdcr(uic2tr, 0x00000000);      /* per ref-board manual */
+       mtdcr(uic2vr, 0x00000000);      /* int31 highest, base=0x000 */
+       mtdcr(uic2sr, 0xffffffff);      /* clear all */
+
+       /* 50MHz tmrclk */
+       *(unsigned char *)(CFG_BCSR_BASE | 0x04) = 0x00;
+
+       /* clear write protects */
+       *(unsigned char *)(CFG_BCSR_BASE | 0x07) = 0x00;
+
+       /* enable Ethernet */
+       *(unsigned char *)(CFG_BCSR_BASE | 0x08) = 0x00;
+
+       /* enable USB device */
+       *(unsigned char *)(CFG_BCSR_BASE | 0x09) = 0x20;
+
+       /* select Ethernet pins */
+       mfsdr(SDR0_PFC1, sdr0_pfc1);
+       sdr0_pfc1 = (sdr0_pfc1 & ~SDR0_PFC1_SELECT_MASK) | SDR0_PFC1_SELECT_CONFIG_4;
+       mfsdr(SDR0_PFC2, sdr0_pfc2);
+       sdr0_pfc2 = (sdr0_pfc2 & ~SDR0_PFC2_SELECT_MASK) | SDR0_PFC2_SELECT_CONFIG_4;
+       mtsdr(SDR0_PFC2, sdr0_pfc2);
+       mtsdr(SDR0_PFC1, sdr0_pfc1);
+
+       /* PCI arbiter enabled */
+       mfsdr(sdr_pci0, reg);
+       mtsdr(sdr_pci0, 0x80000000 | reg);
+
+       /* setup NAND FLASH */
+       mfsdr(SDR0_CUST0, sdr0_cust0);
+        sdr0_cust0 = SDR0_CUST0_MUX_NDFC_SEL   |
+               SDR0_CUST0_NDFC_ENABLE          |
+               SDR0_CUST0_NDFC_BW_8_BIT        |
+               SDR0_CUST0_NDFC_ARE_MASK        |
+               (0x80000000 >> (28 + CFG_NAND_CS));
+        mtsdr(SDR0_CUST0, sdr0_cust0);
+
+       return 0;
+}
+
+/*---------------------------------------------------------------------------+
+  | misc_init_r.
+  +---------------------------------------------------------------------------*/
+int misc_init_r(void)
+{
+       uint pbcr;
+       int size_val = 0;
+       unsigned long usb2d0cr = 0;
+       unsigned long usb2phy0cr, usb2h0cr = 0;
+       unsigned long sdr0_pfc1;
+       char *act = getenv("usbact");
+
+       /*
+        * FLASH stuff...
+        */
+
+       /* Re-do sizing to get full correct info */
+#if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
+       mtdcr(ebccfga, pb3cr);
+#else
+       mtdcr(ebccfga, pb0cr);
+#endif
+       pbcr = mfdcr(ebccfgd);
+       switch (gd->bd->bi_flashsize) {
+       case 1 << 20:
+               size_val = 0;
+               break;
+       case 2 << 20:
+               size_val = 1;
+               break;
+       case 4 << 20:
+               size_val = 2;
+               break;
+       case 8 << 20:
+               size_val = 3;
+               break;
+       case 16 << 20:
+               size_val = 4;
+               break;
+       case 32 << 20:
+               size_val = 5;
+               break;
+       case 64 << 20:
+               size_val = 6;
+               break;
+       case 128 << 20:
+               size_val = 7;
+               break;
+       }
+       pbcr = (pbcr & 0x0001ffff) | gd->bd->bi_flashstart | (size_val << 17);
+#if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL)
+       mtdcr(ebccfga, pb3cr);
+#else
+       mtdcr(ebccfga, pb0cr);
+#endif
+       mtdcr(ebccfgd, pbcr);
+
+       /* adjust flash start and offset */
+       gd->bd->bi_flashstart = 0 - gd->bd->bi_flashsize;
+       gd->bd->bi_flashoffset = 0;
+
+#ifdef CFG_ENV_IS_IN_FLASH
+       /* Monitor protection ON by default */
+       (void)flash_protect(FLAG_PROTECT_SET,
+                           -CFG_MONITOR_LEN,
+                           0xffffffff,
+                           &flash_info[0]);
+
+       /* Env protection ON by default */
+       (void)flash_protect(FLAG_PROTECT_SET,
+                           CFG_ENV_ADDR_REDUND,
+                           CFG_ENV_ADDR_REDUND + 2*CFG_ENV_SECT_SIZE - 1,
+                           &flash_info[0]);
+#endif
+
+       /*
+        * USB suff...
+        */
+       if (act == NULL || strcmp(act, "hostdev") == 0) {
+               /* SDR Setting */
+               mfsdr(SDR0_PFC1, sdr0_pfc1);
+               mfsdr(SDR0_USB0, usb2d0cr);
+               mfsdr(SDR0_USB2PHY0CR, usb2phy0cr);
+               mfsdr(SDR0_USB2H0CR, usb2h0cr);
+
+               usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_XOCLK_MASK;
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_XOCLK_EXTERNAL;       /*0*/
+               usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_WDINT_MASK;
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_WDINT_16BIT_30MHZ;    /*1*/
+               usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DVBUS_MASK;
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DVBUS_PURDIS;         /*0*/
+               usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DWNSTR_MASK;
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DWNSTR_HOST;          /*1*/
+               usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_UTMICN_MASK;
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_UTMICN_HOST;          /*1*/
+
+               /* An 8-bit/60MHz interface is the only possible alternative
+                  when connecting the Device to the PHY */
+               usb2h0cr   = usb2h0cr &~SDR0_USB2H0CR_WDINT_MASK;
+               usb2h0cr   = usb2h0cr | SDR0_USB2H0CR_WDINT_16BIT_30MHZ;        /*1*/
+
+               /* To enable the USB 2.0 Device function through the UTMI interface */
+               usb2d0cr = usb2d0cr &~SDR0_USB2D0CR_USB2DEV_EBC_SEL_MASK;
+               usb2d0cr = usb2d0cr | SDR0_USB2D0CR_USB2DEV_SELECTION;          /*1*/
+
+               sdr0_pfc1 = sdr0_pfc1 &~SDR0_PFC1_UES_MASK;
+               sdr0_pfc1 = sdr0_pfc1 | SDR0_PFC1_UES_USB2D_SEL;                /*0*/
+
+               mtsdr(SDR0_PFC1, sdr0_pfc1);
+               mtsdr(SDR0_USB0, usb2d0cr);
+               mtsdr(SDR0_USB2PHY0CR, usb2phy0cr);
+               mtsdr(SDR0_USB2H0CR, usb2h0cr);
+
+               /*clear resets*/
+               udelay (1000);
+               mtsdr(SDR0_SRST1, 0x00000000);
+               udelay (1000);
+               mtsdr(SDR0_SRST0, 0x00000000);
+
+               printf("USB:   Host(int phy) Device(ext phy)\n");
+
+       } else if (strcmp(act, "dev") == 0) {
+               /*-------------------PATCH-------------------------------*/
+               mfsdr(SDR0_USB2PHY0CR, usb2phy0cr);
+
+               usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_XOCLK_MASK;
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_XOCLK_EXTERNAL;       /*0*/
+               usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DVBUS_MASK;
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DVBUS_PURDIS;         /*0*/
+               usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DWNSTR_MASK;
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DWNSTR_HOST;          /*1*/
+               usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_UTMICN_MASK;
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_UTMICN_HOST;          /*1*/
+               mtsdr(SDR0_USB2PHY0CR, usb2phy0cr);
+
+               udelay (1000);
+               mtsdr(SDR0_SRST1, 0x672c6000);
+
+               udelay (1000);
+               mtsdr(SDR0_SRST0, 0x00000080);
+
+               udelay (1000);
+               mtsdr(SDR0_SRST1, 0x60206000);
+
+               *(unsigned int *)(0xe0000350) = 0x00000001;
+
+               udelay (1000);
+               mtsdr(SDR0_SRST1, 0x60306000);
+               /*-------------------PATCH-------------------------------*/
+
+               /* SDR Setting */
+               mfsdr(SDR0_USB2PHY0CR, usb2phy0cr);
+               mfsdr(SDR0_USB2H0CR, usb2h0cr);
+               mfsdr(SDR0_USB0, usb2d0cr);
+               mfsdr(SDR0_PFC1, sdr0_pfc1);
+
+               usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_XOCLK_MASK;
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_XOCLK_EXTERNAL;       /*0*/
+               usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_WDINT_MASK;
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_WDINT_8BIT_60MHZ;     /*0*/
+               usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DVBUS_MASK;
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DVBUS_PUREN;          /*1*/
+               usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_DWNSTR_MASK;
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_DWNSTR_DEV;           /*0*/
+               usb2phy0cr = usb2phy0cr &~SDR0_USB2PHY0CR_UTMICN_MASK;
+               usb2phy0cr = usb2phy0cr | SDR0_USB2PHY0CR_UTMICN_DEV;           /*0*/
+
+               usb2h0cr   = usb2h0cr &~SDR0_USB2H0CR_WDINT_MASK;
+               usb2h0cr   = usb2h0cr | SDR0_USB2H0CR_WDINT_8BIT_60MHZ;         /*0*/
+
+               usb2d0cr = usb2d0cr &~SDR0_USB2D0CR_USB2DEV_EBC_SEL_MASK;
+               usb2d0cr = usb2d0cr | SDR0_USB2D0CR_EBC_SELECTION;              /*0*/
+
+               sdr0_pfc1 = sdr0_pfc1 &~SDR0_PFC1_UES_MASK;
+               sdr0_pfc1 = sdr0_pfc1 | SDR0_PFC1_UES_EBCHR_SEL;                /*1*/
+
+               mtsdr(SDR0_USB2H0CR, usb2h0cr);
+               mtsdr(SDR0_USB2PHY0CR, usb2phy0cr);
+               mtsdr(SDR0_USB0, usb2d0cr);
+               mtsdr(SDR0_PFC1, sdr0_pfc1);
+
+               /*clear resets*/
+               udelay (1000);
+               mtsdr(SDR0_SRST1, 0x00000000);
+               udelay (1000);
+               mtsdr(SDR0_SRST0, 0x00000000);
+
+               printf("USB:   Device(int phy)\n");
+       }
+
+       return 0;
+}
+
+int checkboard(void)
+{
+       char *s = getenv("serial#");
+
+       printf("Board: Sequoia - AMCC PPC440EPx Evaluation Board");
+       if (s != NULL) {
+               puts(", serial# ");
+               puts(s);
+       }
+       putc('\n');
+
+       return (0);
+}
+
+#if defined(CFG_DRAM_TEST)
+int testdram(void)
+{
+       unsigned long *mem = (unsigned long *)0;
+       const unsigned long kend = (1024 / sizeof(unsigned long));
+       unsigned long k, n;
+
+       mtmsr(0);
+
+       for (k = 0; k < CFG_MBYTES_SDRAM;
+            ++k, mem += (1024 / sizeof(unsigned long))) {
+               if ((k & 1023) == 0) {
+                       printf("%3d MB\r", k / 1024);
+               }
+
+               memset(mem, 0xaaaaaaaa, 1024);
+               for (n = 0; n < kend; ++n) {
+                       if (mem[n] != 0xaaaaaaaa) {
+                               printf("SDRAM test fails at: %08x\n",
+                                      (uint) & mem[n]);
+                               return 1;
+                       }
+               }
+
+               memset(mem, 0x55555555, 1024);
+               for (n = 0; n < kend; ++n) {
+                       if (mem[n] != 0x55555555) {
+                               printf("SDRAM test fails at: %08x\n",
+                                      (uint) & mem[n]);
+                               return 1;
+                       }
+               }
+       }
+       printf("SDRAM test passes\n");
+       return 0;
+}
+#endif
+
+/*************************************************************************
+ *  pci_pre_init
+ *
+ *  This routine is called just prior to registering the hose and gives
+ *  the board the opportunity to check things. Returning a value of zero
+ *  indicates that things are bad & PCI initialization should be aborted.
+ *
+ *     Different boards may wish to customize the pci controller structure
+ *     (add regions, override default access routines, etc) or perform
+ *     certain pre-initialization actions.
+ *
+ ************************************************************************/
+#if defined(CONFIG_PCI) && defined(CFG_PCI_PRE_INIT)
+int pci_pre_init(struct pci_controller *hose)
+{
+       unsigned long addr;
+#if 0
+       /*--------------------------------------------------------------------------+
+        *      Cactus is always configured as the host & requires the
+        *      PCI arbiter to be enabled ???
+        *--------------------------------------------------------------------------*/
+       unsigned long strap;
+       mfsdr(sdr_sdstp1, strap);
+       if ((strap & SDR0_SDSTP1_PAE_MASK) == 0) {
+               printf("PCI: SDR0_STRP1[PAE] not set.\n");
+               printf("PCI: Configuration aborted.\n");
+               return 0;
+       }
+#endif
+
+       /*-------------------------------------------------------------------------+
+         | Set priority for all PLB3 devices to 0.
+         | Set PLB3 arbiter to fair mode.
+         +-------------------------------------------------------------------------*/
+       mfsdr(sdr_amp1, addr);
+       mtsdr(sdr_amp1, (addr & 0x000000FF) | 0x0000FF00);
+       addr = mfdcr(plb3_acr);
+       mtdcr(plb3_acr, addr | 0x80000000);
+
+       /*-------------------------------------------------------------------------+
+         | Set priority for all PLB4 devices to 0.
+         +-------------------------------------------------------------------------*/
+       mfsdr(sdr_amp0, addr);
+       mtsdr(sdr_amp0, (addr & 0x000000FF) | 0x0000FF00);
+       addr = mfdcr(plb4_acr) | 0xa0000000;    /* Was 0x8---- */
+       mtdcr(plb4_acr, addr);
+
+       /*-------------------------------------------------------------------------+
+         | Set Nebula PLB4 arbiter to fair mode.
+         +-------------------------------------------------------------------------*/
+       /* Segment0 */
+       addr = (mfdcr(plb0_acr) & ~plb0_acr_ppm_mask) | plb0_acr_ppm_fair;
+       addr = (addr & ~plb0_acr_hbu_mask) | plb0_acr_hbu_enabled;
+       addr = (addr & ~plb0_acr_rdp_mask) | plb0_acr_rdp_4deep;
+       addr = (addr & ~plb0_acr_wrp_mask) | plb0_acr_wrp_2deep;
+       mtdcr(plb0_acr, addr);
+
+       /* Segment1 */
+       addr = (mfdcr(plb1_acr) & ~plb1_acr_ppm_mask) | plb1_acr_ppm_fair;
+       addr = (addr & ~plb1_acr_hbu_mask) | plb1_acr_hbu_enabled;
+       addr = (addr & ~plb1_acr_rdp_mask) | plb1_acr_rdp_4deep;
+       addr = (addr & ~plb1_acr_wrp_mask) | plb1_acr_wrp_2deep;
+       mtdcr(plb1_acr, addr);
+
+       return 1;
+}
+#endif                         /* defined(CONFIG_PCI) && defined(CFG_PCI_PRE_INIT) */
+
+/*************************************************************************
+ *  pci_target_init
+ *
+ *     The bootstrap configuration provides default settings for the pci
+ *     inbound map (PIM). But the bootstrap config choices are limited and
+ *     may not be sufficient for a given board.
+ *
+ ************************************************************************/
+#if defined(CONFIG_PCI) && defined(CFG_PCI_TARGET_INIT)
+void pci_target_init(struct pci_controller *hose)
+{
+       /*--------------------------------------------------------------------------+
+        * Set up Direct MMIO registers
+        *--------------------------------------------------------------------------*/
+       /*--------------------------------------------------------------------------+
+         | PowerPC440EPX PCI Master configuration.
+         | Map one 1Gig range of PLB/processor addresses to PCI memory space.
+         |   PLB address 0xA0000000-0xDFFFFFFF ==> PCI address 0xA0000000-0xDFFFFFFF
+         |   Use byte reversed out routines to handle endianess.
+         | Make this region non-prefetchable.
+         +--------------------------------------------------------------------------*/
+       out32r(PCIX0_PMM0MA, 0x00000000);       /* PMM0 Mask/Attribute - disabled b4 setting */
+       out32r(PCIX0_PMM0LA, CFG_PCI_MEMBASE);  /* PMM0 Local Address */
+       out32r(PCIX0_PMM0PCILA, CFG_PCI_MEMBASE);       /* PMM0 PCI Low Address */
+       out32r(PCIX0_PMM0PCIHA, 0x00000000);    /* PMM0 PCI High Address */
+       out32r(PCIX0_PMM0MA, 0xE0000001);       /* 512M + No prefetching, and enable region */
+
+       out32r(PCIX0_PMM1MA, 0x00000000);       /* PMM0 Mask/Attribute - disabled b4 setting */
+       out32r(PCIX0_PMM1LA, CFG_PCI_MEMBASE2); /* PMM0 Local Address */
+       out32r(PCIX0_PMM1PCILA, CFG_PCI_MEMBASE2);      /* PMM0 PCI Low Address */
+       out32r(PCIX0_PMM1PCIHA, 0x00000000);    /* PMM0 PCI High Address */
+       out32r(PCIX0_PMM1MA, 0xE0000001);       /* 512M + No prefetching, and enable region */
+
+       out32r(PCIX0_PTM1MS, 0x00000001);       /* Memory Size/Attribute */
+       out32r(PCIX0_PTM1LA, 0);        /* Local Addr. Reg */
+       out32r(PCIX0_PTM2MS, 0);        /* Memory Size/Attribute */
+       out32r(PCIX0_PTM2LA, 0);        /* Local Addr. Reg */
+
+       /*--------------------------------------------------------------------------+
+        * Set up Configuration registers
+        *--------------------------------------------------------------------------*/
+
+       /* Program the board's subsystem id/vendor id */
+       pci_write_config_word(0, PCI_SUBSYSTEM_VENDOR_ID,
+                             CFG_PCI_SUBSYS_VENDORID);
+       pci_write_config_word(0, PCI_SUBSYSTEM_ID, CFG_PCI_SUBSYS_ID);
+
+       /* Configure command register as bus master */
+       pci_write_config_word(0, PCI_COMMAND, PCI_COMMAND_MASTER);
+
+       /* 240nS PCI clock */
+       pci_write_config_word(0, PCI_LATENCY_TIMER, 1);
+
+       /* No error reporting */
+       pci_write_config_word(0, PCI_ERREN, 0);
+
+       pci_write_config_dword(0, PCI_BRDGOPT2, 0x00000101);
+
+}
+#endif                         /* defined(CONFIG_PCI) && defined(CFG_PCI_TARGET_INIT) */
+
+/*************************************************************************
+ *  pci_master_init
+ *
+ ************************************************************************/
+#if defined(CONFIG_PCI) && defined(CFG_PCI_MASTER_INIT)
+void pci_master_init(struct pci_controller *hose)
+{
+       unsigned short temp_short;
+
+       /*--------------------------------------------------------------------------+
+         | Write the PowerPC440 EP PCI Configuration regs.
+         |   Enable PowerPC440 EP to be a master on the PCI bus (PMM).
+         |   Enable PowerPC440 EP to act as a PCI memory target (PTM).
+         +--------------------------------------------------------------------------*/
+       pci_read_config_word(0, PCI_COMMAND, &temp_short);
+       pci_write_config_word(0, PCI_COMMAND,
+                             temp_short | PCI_COMMAND_MASTER |
+                             PCI_COMMAND_MEMORY);
+}
+#endif                         /* defined(CONFIG_PCI) && defined(CFG_PCI_MASTER_INIT) */
+
+/*************************************************************************
+ *  is_pci_host
+ *
+ *     This routine is called to determine if a pci scan should be
+ *     performed. With various hardware environments (especially cPCI and
+ *     PPMC) it's insufficient to depend on the state of the arbiter enable
+ *     bit in the strap register, or generic host/adapter assumptions.
+ *
+ *     Rather than hard-code a bad assumption in the general 440 code, the
+ *     440 pci code requires the board to decide at runtime.
+ *
+ *     Return 0 for adapter mode, non-zero for host (monarch) mode.
+ *
+ *
+ ************************************************************************/
+#if defined(CONFIG_PCI)
+int is_pci_host(struct pci_controller *hose)
+{
+       /* Cactus is always configured as host. */
+       return (1);
+}
+#endif                         /* defined(CONFIG_PCI) */
diff --git a/board/amcc/sequoia/sequoia.h b/board/amcc/sequoia/sequoia.h
new file mode 100644 (file)
index 0000000..1d44b16
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * (C) Copyright 2006
+ * Stefan Roese, DENX Software Engineering, sr@denx.de.
+ *
+ * (C) Copyright 2006
+ * Jacqueline Pira-Ferriol, AMCC/IBM, jpira-ferriol@fr.ibm.com
+ * Alain Saurel,            AMCC/IBM, alain.saurel@fr.ibm.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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+
+/*----------------------------------------------------------------------------+
+  | EBC Configuration Register - EBC0_CFG
+  +----------------------------------------------------------------------------*/
+/* External Bus Three-State Control */
+#define EBC0_CFG_EBTC_DRIVEN       0x80000000
+/* Device-Paced Time-out Disable */
+#define EBC0_CFG_PTD_ENABLED       0x00000000
+/* Ready Timeout Count */
+#define EBC0_CFG_RTC_MASK          0x38000000
+#define EBC0_CFG_RTC_16PERCLK      0x00000000
+#define EBC0_CFG_RTC_32PERCLK      0x08000000
+#define EBC0_CFG_RTC_64PERCLK      0x10000000
+#define EBC0_CFG_RTC_128PERCLK     0x18000000
+#define EBC0_CFG_RTC_256PERCLK     0x20000000
+#define EBC0_CFG_RTC_512PERCLK     0x28000000
+#define EBC0_CFG_RTC_1024PERCLK            0x30000000
+#define EBC0_CFG_RTC_2048PERCLK            0x38000000
+/* External Master Priority Low */
+#define EBC0_CFG_EMPL_LOW          0x00000000
+#define EBC0_CFG_EMPL_MEDIUM_LOW    0x02000000
+#define EBC0_CFG_EMPL_MEDIUM_HIGH   0x04000000
+#define EBC0_CFG_EMPL_HIGH         0x06000000
+/* External Master Priority High */
+#define EBC0_CFG_EMPH_LOW          0x00000000
+#define EBC0_CFG_EMPH_MEDIUM_LOW    0x00800000
+#define EBC0_CFG_EMPH_MEDIUM_HIGH   0x01000000
+#define EBC0_CFG_EMPH_HIGH         0x01800000
+/* Chip Select Three-State Control */
+#define EBC0_CFG_CSTC_DRIVEN       0x00400000
+/* Burst Prefetch */
+#define EBC0_CFG_BPF_ONEDW         0x00000000
+#define EBC0_CFG_BPF_TWODW         0x00100000
+#define EBC0_CFG_BPF_FOURDW        0x00200000
+/* External Master Size */
+#define EBC0_CFG_EMS_8BIT          0x00000000
+/* Power Management Enable */
+#define EBC0_CFG_PME_DISABLED      0x00000000
+#define EBC0_CFG_PME_ENABLED       0x00020000
+/* Power Management Timer */
+#define EBC0_CFG_PMT_ENCODE(n)         ((((unsigned long)(n))&0x1F)<<12)
+
+#define SDR0_USB0                    0x0320     /* USB Control Register */
diff --git a/board/amcc/sequoia/u-boot-nand.lds b/board/amcc/sequoia/u-boot-nand.lds
new file mode 100644 (file)
index 0000000..cf2e2b5
--- /dev/null
@@ -0,0 +1,137 @@
+/*
+ * (C) Copyright 2006
+ * Wolfgang Denk, DENX Software Engineering, wd@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
+ */
+
+OUTPUT_ARCH(powerpc)
+SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
+SECTIONS
+{
+  /* Read-only sections, merged into text segment: */
+  . = + SIZEOF_HEADERS;
+  .interp : { *(.interp) }
+  .hash          : { *(.hash)          }
+  .dynsym        : { *(.dynsym)                }
+  .dynstr        : { *(.dynstr)                }
+  .rel.text      : { *(.rel.text)              }
+  .rela.text     : { *(.rela.text)     }
+  .rel.data      : { *(.rel.data)              }
+  .rela.data     : { *(.rela.data)     }
+  .rel.rodata    : { *(.rel.rodata)    }
+  .rela.rodata   : { *(.rela.rodata)   }
+  .rel.got       : { *(.rel.got)               }
+  .rela.got      : { *(.rela.got)              }
+  .rel.ctors     : { *(.rel.ctors)     }
+  .rela.ctors    : { *(.rela.ctors)    }
+  .rel.dtors     : { *(.rel.dtors)     }
+  .rela.dtors    : { *(.rela.dtors)    }
+  .rel.bss       : { *(.rel.bss)               }
+  .rela.bss      : { *(.rela.bss)              }
+  .rel.plt       : { *(.rel.plt)               }
+  .rela.plt      : { *(.rela.plt)              }
+  .init          : { *(.init)  }
+  .plt : { *(.plt) }
+  .text      :
+  {
+    /* WARNING - the following is hand-optimized to fit within */
+    /* the sector layout of our flash chips!   XXX FIXME XXX   */
+
+    cpu/ppc4xx/start.o (.text)
+
+    /* Align to next NAND block */
+    . = ALIGN(0x4000);
+    common/environment.o  (.ppcenv)
+    /* Keep some space here for redundant env and potential bad env blocks */
+    . = ALIGN(0x10000);
+
+    *(.text)
+    *(.fixup)
+    *(.got1)
+  }
+  _etext = .;
+  PROVIDE (etext = .);
+  .rodata    :
+  {
+    *(.rodata)
+    *(.rodata1)
+    *(.rodata.str1.4)
+  }
+  .fini      : { *(.fini)    } =0
+  .ctors     : { *(.ctors)   }
+  .dtors     : { *(.dtors)   }
+
+  /* Read-write section, merged into data segment: */
+  . = (. + 0x00FF) & 0xFFFFFF00;
+  _erotext = .;
+  PROVIDE (erotext = .);
+  .reloc   :
+  {
+    *(.got)
+    _GOT2_TABLE_ = .;
+    *(.got2)
+    _FIXUP_TABLE_ = .;
+    *(.fixup)
+  }
+  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __fixup_entries = (. - _FIXUP_TABLE_)>>2;
+
+  .data    :
+  {
+    *(.data)
+    *(.data1)
+    *(.sdata)
+    *(.sdata2)
+    *(.dynamic)
+    CONSTRUCTORS
+  }
+  _edata  =  .;
+  PROVIDE (edata = .);
+
+  . = .;
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
+  . = .;
+  __start___ex_table = .;
+  __ex_table : { *(__ex_table) }
+  __stop___ex_table = .;
+
+  . = ALIGN(256);
+  __init_begin = .;
+  .text.init : { *(.text.init) }
+  .data.init : { *(.data.init) }
+  . = ALIGN(256);
+  __init_end = .;
+
+  __bss_start = .;
+  .bss       :
+  {
+   *(.sbss) *(.scommon)
+   *(.dynbss)
+   *(.bss)
+   *(COMMON)
+  }
+
+  _end = . ;
+  PROVIDE (end = .);
+}
diff --git a/board/amcc/sequoia/u-boot.lds b/board/amcc/sequoia/u-boot.lds
new file mode 100644 (file)
index 0000000..a423f98
--- /dev/null
@@ -0,0 +1,145 @@
+/*
+ * (C) Copyright 2002
+ * Wolfgang Denk, DENX Software Engineering, wd@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
+ */
+
+OUTPUT_ARCH(powerpc)
+SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
+/* Do we need any of these for elf?
+   __DYNAMIC = 0;    */
+SECTIONS
+{
+  .resetvec 0xFFFFFFFC :
+  {
+    *(.resetvec)
+  } = 0xffff
+
+  .bootpg 0xFFFFF000 :
+  {
+    cpu/ppc4xx/start.o (.bootpg)
+  } = 0xffff
+
+  /* Read-only sections, merged into text segment: */
+  . = + SIZEOF_HEADERS;
+  .interp : { *(.interp) }
+  .hash          : { *(.hash)          }
+  .dynsym        : { *(.dynsym)                }
+  .dynstr        : { *(.dynstr)                }
+  .rel.text      : { *(.rel.text)              }
+  .rela.text     : { *(.rela.text)     }
+  .rel.data      : { *(.rel.data)              }
+  .rela.data     : { *(.rela.data)     }
+  .rel.rodata    : { *(.rel.rodata)    }
+  .rela.rodata   : { *(.rela.rodata)   }
+  .rel.got       : { *(.rel.got)               }
+  .rela.got      : { *(.rela.got)              }
+  .rel.ctors     : { *(.rel.ctors)     }
+  .rela.ctors    : { *(.rela.ctors)    }
+  .rel.dtors     : { *(.rel.dtors)     }
+  .rela.dtors    : { *(.rela.dtors)    }
+  .rel.bss       : { *(.rel.bss)               }
+  .rela.bss      : { *(.rela.bss)              }
+  .rel.plt       : { *(.rel.plt)               }
+  .rela.plt      : { *(.rela.plt)              }
+  .init          : { *(.init)  }
+  .plt : { *(.plt) }
+  .text      :
+  {
+    /* WARNING - the following is hand-optimized to fit within */
+    /* the sector layout of our flash chips!   XXX FIXME XXX   */
+
+    cpu/ppc4xx/start.o (.text)
+
+    *(.text)
+    *(.fixup)
+    *(.got1)
+  }
+  _etext = .;
+  PROVIDE (etext = .);
+  .rodata    :
+  {
+    *(.rodata)
+    *(.rodata1)
+    *(.rodata.str1.4)
+  }
+  .fini      : { *(.fini)    } =0
+  .ctors     : { *(.ctors)   }
+  .dtors     : { *(.dtors)   }
+
+  /* Read-write section, merged into data segment: */
+  . = (. + 0x00FF) & 0xFFFFFF00;
+  _erotext = .;
+  PROVIDE (erotext = .);
+  .reloc   :
+  {
+    *(.got)
+    _GOT2_TABLE_ = .;
+    *(.got2)
+    _FIXUP_TABLE_ = .;
+    *(.fixup)
+  }
+  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
+  __fixup_entries = (. - _FIXUP_TABLE_)>>2;
+
+  .data    :
+  {
+    *(.data)
+    *(.data1)
+    *(.sdata)
+    *(.sdata2)
+    *(.dynamic)
+    CONSTRUCTORS
+  }
+  _edata  =  .;
+  PROVIDE (edata = .);
+
+  . = .;
+  __u_boot_cmd_start = .;
+  .u_boot_cmd : { *(.u_boot_cmd) }
+  __u_boot_cmd_end = .;
+
+
+  . = .;
+  __start___ex_table = .;
+  __ex_table : { *(__ex_table) }
+  __stop___ex_table = .;
+
+  . = ALIGN(256);
+  __init_begin = .;
+  .text.init : { *(.text.init) }
+  .data.init : { *(.data.init) }
+  . = ALIGN(256);
+  __init_end = .;
+
+  __bss_start = .;
+  .bss       :
+  {
+   *(.sbss) *(.scommon)
+   *(.dynbss)
+   *(.bss)
+   *(COMMON)
+  }
+
+  ppcenv_assert = ASSERT(. < 0xFFFF8000, ".bss section too big, overlaps .ppcenv section. Please update your confguration: CFG_MONITOR_BASE, CFG_MONITOR_LEN and TEXT_BASE may need to be modified.");
+
+  _end = . ;
+  PROVIDE (end = .);
+}
index f5bda5519abb310366b16b90768fbc1969377d25..e78ed5f926d78eb3adf2f5e0f43cf196d706a0b7 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 47116d3674691a1389f37d6ede0ddedeb3c55420..a47a0674c415825bfd71dbe25af1276a10ef9924 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2002
+# (C) Copyright 2002-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o
+COBJS  = $(BOARD).o
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 47116d3674691a1389f37d6ede0ddedeb3c55420..a47a0674c415825bfd71dbe25af1276a10ef9924 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2002
+# (C) Copyright 2002-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o
+COBJS  = $(BOARD).o
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index c85fa3107bd331360de0d1e3e88f463438901024..696fd4092e7cd19466e8a0fd43389f10585e672e 100644 (file)
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o cmd_yucca.o
+COBJS  = $(BOARD).o flash.o cmd_yucca.o
 SOBJS  = init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index af12839c2c3f17d779d4a422cdbb89e7e4690eed..cd175265f0d00966de3bf46a4f9769e92021b3d2 100644 (file)
 #include <asm-ppc/io.h>
 
 #include "yucca.h"
+#include "../cpu/ppc4xx/440spe_pcie.h"
+
+#undef PCIE_ENDPOINT
+/* #define PCIE_ENDPOINT 1 */
 
 void fpga_init (void);
 
@@ -562,10 +566,11 @@ int checkboard (void)
 
 static long int yucca_probe_for_dimms(void)
 {
-       long int        dimm_installed[MAXDIMMS];
-       long int        dimm_num, probe_result;
-       long int        dimms_found = 0;
-       uchar           dimm_addr = IIC0_DIMM0_ADDR;
+       int     dimm_installed[MAXDIMMS];
+       int     dimm_num, result;
+       int     dimms_found = 0;
+       uchar   dimm_addr = IIC0_DIMM0_ADDR;
+       uchar   dimm_spd_data[MAX_SPD_BYTES];
 
        for (dimm_num = 0; dimm_num < MAXDIMMS; dimm_num++) {
                /* check if there is a chip at the dimm address */
@@ -577,12 +582,28 @@ static long int yucca_probe_for_dimms(void)
                                dimm_addr = IIC0_DIMM1_ADDR;
                                break;
                }
-               probe_result = i2c_probe(dimm_addr);
 
-               if (probe_result == 0) {
+               result = i2c_probe(dimm_addr);
+
+               memset(dimm_spd_data, 0, MAX_SPD_BYTES * sizeof(char));
+               if (result == 0) {
+                       /* read first byte of SPD data, if there is any data */
+                       result = i2c_read(dimm_addr, 0, 1, dimm_spd_data, 1);
+
+                       if (result == 0) {
+                               result = dimm_spd_data[0];
+                               result = result > MAX_SPD_BYTES ?
+                                               MAX_SPD_BYTES : result;
+                               result = i2c_read(dimm_addr, 0, 1,
+                                                       dimm_spd_data, result);
+                       }
+               }
+
+               if ((result == 0) &&
+                   (dimm_spd_data[64] == MICRON_SPD_JEDEC_ID)) {
                        dimm_installed[dimm_num] = TRUE;
                        dimms_found++;
-                       debug("DIMM slot %d: DDR2 SDRAM detected\n",dimm_num);
+                       debug("DIMM slot %d: DDR2 SDRAM detected\n", dimm_num);
                } else {
                        dimm_installed[dimm_num] = FALSE;
                        debug("DIMM slot %d: Not populated or cannot sucessfully probe the DIMM\n", dimm_num);
@@ -1012,6 +1033,57 @@ void yucca_setup_pcie_fpga_rootpoint(int port)
 
        out_be16((u16 *)FPGA_REG1C, reset_off | in_be16((u16 *)FPGA_REG1C));
 }
+/*
+ * For the given slot, set endpoint mode, send power to the slot,
+ * turn on the green LED and turn off the yellow LED, enable the clock
+ * .In end point mode reset bit is  read only.
+ */
+void yucca_setup_pcie_fpga_endpoint(int port)
+{
+       u16 power, clock, green_led, yellow_led, reset_off, rootpoint, endpoint;
+
+       switch(port) {
+       case 0:
+               rootpoint   = FPGA_REG1C_PE0_ROOTPOINT;
+               endpoint    = 0;
+               power       = FPGA_REG1A_PE0_PWRON;
+               green_led   = FPGA_REG1A_PE0_GLED;
+               clock       = FPGA_REG1A_PE0_REFCLK_ENABLE;
+               yellow_led  = FPGA_REG1A_PE0_YLED;
+               reset_off   = FPGA_REG1C_PE0_PERST;
+               break;
+       case 1:
+               rootpoint   = 0;
+               endpoint    = FPGA_REG1C_PE1_ENDPOINT;
+               power       = FPGA_REG1A_PE1_PWRON;
+               green_led   = FPGA_REG1A_PE1_GLED;
+               clock       = FPGA_REG1A_PE1_REFCLK_ENABLE;
+               yellow_led  = FPGA_REG1A_PE1_YLED;
+               reset_off   = FPGA_REG1C_PE1_PERST;
+               break;
+       case 2:
+               rootpoint   = 0;
+               endpoint    = FPGA_REG1C_PE2_ENDPOINT;
+               power       = FPGA_REG1A_PE2_PWRON;
+               green_led   = FPGA_REG1A_PE2_GLED;
+               clock       = FPGA_REG1A_PE2_REFCLK_ENABLE;
+               yellow_led  = FPGA_REG1A_PE2_YLED;
+               reset_off   = FPGA_REG1C_PE2_PERST;
+               break;
+
+       default:
+               return;
+       }
+
+       out_be16((u16 *)FPGA_REG1A,
+                ~(power | clock | green_led) &
+                (yellow_led | in_be16((u16 *)FPGA_REG1A)));
+
+       out_be16((u16 *)FPGA_REG1C,
+                ~(rootpoint | reset_off) &
+                (endpoint | in_be16((u16 *)FPGA_REG1C)));
+}
+
 
 
 static struct pci_controller pcie_hose[3] = {{0},{0},{0}};
@@ -1031,9 +1103,13 @@ void pcie_setup_hoses(void)
                if (!yucca_pcie_card_present(i))
                        continue;
 
+#ifdef PCIE_ENDPOINT
+               yucca_setup_pcie_fpga_endpoint(i);
+               if (ppc440spe_init_pcie_endport(i)) {
+#else
                yucca_setup_pcie_fpga_rootpoint(i);
-
                if (ppc440spe_init_pcie_rootport(i)) {
+#endif
                        printf("PCIE%d: initialization failed\n", i);
                        continue;
                }
@@ -1053,8 +1129,19 @@ void pcie_setup_hoses(void)
                hose->region_count = 1;
                pci_register_hose(hose);
 
-               ppc440spe_setup_pcie(hose, i);
+#ifdef PCIE_ENDPOINT
+               ppc440spe_setup_pcie_endpoint(hose, i);
+               /*
+                * Reson for no scanning is endpoint can not generate
+                * upstream configuration accesses.
+                */
+#else
+               ppc440spe_setup_pcie_rootpoint(hose, i);
+               /*
+                * Config access can only go down stream
+                */
                hose->last_busno = pci_hose_scan(hose);
+#endif
        }
 }
 #endif /* defined(CONFIG_PCI) */
index 66f75847d35ee355cde5fb6bd28f2802bd61d6b8..4d13021f38f60baaf48ee280735d390d2e30a379 100644 (file)
@@ -60,6 +60,9 @@ extern "C" {
 
 #define NUM_TLB_ENTRIES          64
 
+/* MICRON SPD JEDEC ID Code (first byte) - SPD data byte [64] */
+#define MICRON_SPD_JEDEC_ID 0x2c
+
 /*----------------------------------------------------------------------------+
 | TLB specific defines.
 +----------------------------------------------------------------------------*/
index 4e1ef217cad5eac20f9d4c458db361c611af6e91..08a17f90d72b029bef047928243ab25629290aaa 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o serial.o pci.o powerspan.o
+COBJS  = $(BOARD).o flash.o serial.o pci.o powerspan.o
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $^
 
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 52ea7f28d4413b83cd799a2f7d9236175ff122bf..80e1687bf68d75d1d1c9b0a36780d8da459c6625 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (C) Copyright 2002
 # Sysgo Real-Time Solutions, GmbH <www.elinos.com>
 # Marius Groeger <mgroeger@sysgo.de>
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := armadillo.o flash.o
+COBJS  := armadillo.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -40,9 +47,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index c49f1b4604839549e15ac926380ce0c66fc96c2e..a7414e8414c191bb620d8e90e2e846723aca5c5d 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # 2004 (c) MontaVista Software, Inc.
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := assabet.o
+COBJS  := assabet.o
 SOBJS  := setup.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -41,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index ec77da9de3723dda07c64d3feece615c38ef56c5..f087a0f316ac960fdecde35fdb8e176a45ba8521 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := at91rm9200dk.o at45.o flash.o
+COBJS  := at91rm9200dk.o at45.o flash.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 7573a0c7713884d5a0e9a1a34a2f73d58e1766b6..a041c999fa400a48d277e8136031803702cbe907 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ti113x.o
+COBJS  = $(BOARD).o flash.o ti113x.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index d6bbf2f297ea09668281289a120e69402a3fe5ad..9ac6a4da375ff52ca2f3be03ddb174cc859ac643 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS =  $(BOARD).o flash.o
+COBJS =  $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 4dec44fd25068f39cf077b02eb254f62402920aa..122a22ae4f3e4d824c6fd2442baf5daee49bc65c 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003-2004
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o cmd_bc3450.o
+COBJS  := $(BOARD).o cmd_bc3450.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 621640b0079808db72be01eb6f78e4db86c1f9ac..b775da2a2147fcabeafd87d7d9e291c32b7d5361 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (C) Copyright 2002
 # James F. Dougherty, Broadcom Corporation, jfd@broadcom.com
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ns16550.o serial.o m48t59y.o
+COBJS  = $(BOARD).o flash.o ns16550.o serial.o m48t59y.o
 
 SOBJS  = early_init.o
 
-$(LIB):        .depend $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 7b2b54582030a16c9f24af6081e00969e6a97813..62db2f494b68ba35b1b35786db9ac900d306ec2e 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o pcmcia.o
+COBJS  = $(BOARD).o flash.o pcmcia.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 607833f8b00d5bf11c5222b33542265922947e36..47a3e8cf00b77d4eaa270f0af8a7e7d19a05710d 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2005
+# (C) Copyright 2005-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+#ifneq ($(OBJTREE),$(SRCTREE))
+#$(shell mkdir -p $(obj)../common)
+#endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o
+COBJS  := $(BOARD).o
 #../common/flash.o ../common/vpd.o ../common/am79c874.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -39,9 +46,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index d202281d454d3f27f6f2e32a8bb82bef83dfd29c..9aad5d5fa092e8583e9dce45abb722a72754c89c 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Copyright 2004 Freescale Semiconductor.
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o \
+COBJS  := $(BOARD).o \
           ../common/cadmus.o \
           ../common/eeprom.o \
           ../common/ft_board.o \
@@ -34,7 +37,11 @@ OBJS := $(BOARD).o \
 
 SOBJS  := init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -45,9 +52,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index d202281d454d3f27f6f2e32a8bb82bef83dfd29c..9aad5d5fa092e8583e9dce45abb722a72754c89c 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Copyright 2004 Freescale Semiconductor.
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o \
+COBJS  := $(BOARD).o \
           ../common/cadmus.o \
           ../common/eeprom.o \
           ../common/ft_board.o \
@@ -34,7 +37,11 @@ OBJS := $(BOARD).o \
 
 SOBJS  := init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -45,9 +52,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index d202281d454d3f27f6f2e32a8bb82bef83dfd29c..9aad5d5fa092e8583e9dce45abb722a72754c89c 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Copyright 2004 Freescale Semiconductor.
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o \
+COBJS  := $(BOARD).o \
           ../common/cadmus.o \
           ../common/eeprom.o \
           ../common/ft_board.o \
@@ -34,7 +37,11 @@ OBJS := $(BOARD).o \
 
 SOBJS  := init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -45,9 +52,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 83e3ba458ad1c4fc2d4bf3293dbebe2c0e115f63..52712be47a70093eb05544b1a6dcbeba72e9c004 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := cerf250.o flash.o
+COBJS  := cerf250.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index c66dd716c857771e941f5a55a681500917fad82c..fb18ad804d88f7492b1e36d22e2235dcf6eda503 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := cm4008.o flash.o
+COBJS  := cm4008.o flash.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index f0d3451989d9359a8ee897b86a28dc538295180f..d42e2a8e744686df627fc8bc0725cc7c21aa3983 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := cm41xx.o flash.o
+COBJS  := cm41xx.o flash.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index d0def055200c5c96e12281a193fa650cf1105a25..ccbf3087f51e831edfe939e2729ba5133839a7d5 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := cmc_pu2.o at45.o flash.o load_sernum_ethaddr.o
+COBJS  := cmc_pu2.o at45.o flash.o load_sernum_ethaddr.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 2324d8772e26caad4d4ab2bd046b6257ad5882b5..d935044a9929f6d74a252f38691f22755a18f1a5 100644 (file)
@@ -1,6 +1,6 @@
 #
-# (C) Copyright 2001   Wolfgang Denk, DENX Software Engineering, wd@denx.de
-#
+# (C) Copyright 2001-2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de
 #
 # See file CREDITS for list of people who contributed to this
 # project.
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
+
+COBJS  := flash.o cmi.o
 
-OBJS   := flash.o cmi.o
-SOBJS  :=
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -39,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index e5d844631335d1fac7f0b720d4d935e3dc252e5d..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2003
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 4084c7ebe5da4547f570c39436d118329768c0b7..8498aceafe3a63bd61d592d4485f1035616757a5 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := mb.o flash.o dipsw.o lcd.o serial.o # pci.o rtc.o par.o kbm.o
-SOBJS  :=
+COBJS  := mb.o flash.o dipsw.o lcd.o serial.o # pci.o rtc.o par.o kbm.o
 
-$(LIB):        $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -39,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index ccb811bd4d1221638c39284e41f37657cbbfee3f..346833a789db7cbc96f220238d5575bb96cce031 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001-2003
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o plx9030.o pd67290.o
+COBJS  = $(BOARD).o flash.o plx9030.o pd67290.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 7a2014d466d6fa840b0dfb5ab4e47d726cc4ee81..1b57d2b0236ce949c225b11814dce20ff69e69fd 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 26f53ede4297c8e4ceb159b4a5b6501698f9d666..1b57d2b0236ce949c225b11814dce20ff69e69fd 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001-2005
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index e8c2614eb477dc953647cc4cc99bfa38ee174246..9fecdd0dfefa67eda0ab141291de24377b7b7a8a 100644 (file)
@@ -294,15 +294,15 @@ long int initdram (int board_type)
         */
        size8 = try_init (memctl, CFG_PSDMR_8COL, CFG_OR2_8COL,
                          (uchar *) CFG_SDRAM_BASE);
-       
+
        size9 = try_init (memctl, CFG_PSDMR_9COL, CFG_OR2_9COL,
                          (uchar *) CFG_SDRAM_BASE);
-       
+
        size10 = try_init (memctl, CFG_PSDMR_10COL, CFG_OR2_10COL,
                          (uchar *) CFG_SDRAM_BASE);
-       
+
        psize = max(size8,max(size9,size10));
-       
+
        if (psize == size8) {
                psize = try_init (memctl, CFG_PSDMR_8COL, CFG_OR2_8COL,
                                  (uchar *) CFG_SDRAM_BASE);
index 265d50043ca875db6d126dd509d4490dc2f3bede..c6a5a0d82da52d2d7a66e910cf1847d4a0e94952 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := cradle.o flash.o
+COBJS  := cradle.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index bfe0922ebca241339ed65daa87008ab28b758244..44ef9c26aa194472c200d983250b78864e153b28 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 SOBJS  = init.o
 
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 # HACK: depend needs bootscript.c, which needs tools/mkimage, which is not
 # built in the depend stage.  So... put bootscript.o here, not in OBJS
-$(LIB):        $(OBJS) $(SOBJS) bootscript.o
+$(LIB):        $(OBJS) $(SOBJS) $(obj)bootscript.o
        $(AR) crv $@ $^
 
 clean:
-       rm -f $(SOBJS) $(OBJS) bootscript.c bootscript.image bootscript.o
+       rm -f $(SOBJS) $(OBJS) $(obj)bootscript.c \
+               $(obj)bootscript.image $(obj)bootscript.o
 
 distclean:     clean
        rm -f $(LIB) core *.bak .depend
 
-$(BOARD).o : $(BOARD).c bootscript.o
+$(obj)$(BOARD).o : $(src)$(BOARD).c $(obj)bootscript.o
 
-bootscript.c: bootscript.image
+$(obj)bootscript.c: $(obj)bootscript.image
        od -t x1 -v -A x $^ | awk -f x2c.awk > $@
 
-bootscript.image: bootscript.hush Makefile
-       -$(TOPDIR)/tools/mkimage -A ppc -O linux -T script -C none -a 0 -e 0 -n bootscript -d  bootscript.hush $@
+$(obj)bootscript.image: $(src)bootscript.hush $(src)Makefile
+       -$(OBJTREE)/tools/mkimage -A ppc -O linux -T script -C none -a 0 -e 0 -n bootscript -d $(src)bootscript.hush $@
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 5b311a9450d2d354f49b85fb64272dcc3683d5bf..34c071e025a1d1d8e8bc1d35b233277553e2dad7 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := csb226.o flash.o
+COBJS  := csb226.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 926e0650328eb9efae8e2d6a9d3e1af483be0844..7acb7c809b6a869eecf4ef846b987e493f9132c5 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-#OBJS  = $(BOARD).o flash.o
-#OBJS  = $(BOARD).o strataflash.o
-OBJS   = $(BOARD).o
+#COBJS = $(BOARD).o flash.o
+#COBJS = $(BOARD).o strataflash.o
+COBJS  = $(BOARD).o
 
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $^
@@ -43,9 +46,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 926e0650328eb9efae8e2d6a9d3e1af483be0844..7acb7c809b6a869eecf4ef846b987e493f9132c5 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-#OBJS  = $(BOARD).o flash.o
-#OBJS  = $(BOARD).o strataflash.o
-OBJS   = $(BOARD).o
+#COBJS = $(BOARD).o flash.o
+#COBJS = $(BOARD).o strataflash.o
+COBJS  = $(BOARD).o
 
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $^
@@ -43,9 +46,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 61d5a35dd5fdad64240fd941cdc89d2e4fb44ba7..d766ea2eae881a11de482c6ec963bce5969e67c2 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := csb637.o
+COBJS  := csb637.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 7a2014d466d6fa840b0dfb5ab4e47d726cc4ee81..1b57d2b0236ce949c225b11814dce20ff69e69fd 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 548fd528ba1a937e616eec2134e8c9aebff3524e..106025da1eb0eb792ccca2549d3869c6bc229bc0 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+# 
 # (C) Copyright 2002
 # Sysgo Real-Time Solutions, GmbH <www.elinos.com>
 # Marius Groeger <mgroeger@sysgo.de>
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := B2.o flash.o
+COBJS  := B2.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -40,9 +47,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 581a5802b4c684641e6414505fc618988eeb65ca..e62981cf3fb917c32d60d4ece06b03bc6dcf50db 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o nand.o
+COBJS  = $(BOARD).o flash.o nand.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $^
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index d9b0e2d258a50b125a6cefe2fe9c7434f14f6857..13986b8fcfc6c077db9076a188cc2571261d86ce 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 SOBJS  = lowlevel_init.o
 
-$(LIB):        .depend $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index e744eec2e000ab4eb52d546b485fa27aee9a5933..514ca9b9b2fe99396009bf89bfd8d98ae0e3593a 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := delta.o nand.o
+COBJS  := delta.o nand.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -40,9 +44,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index eaa38bc3c13b062112db0f7efaf8fd9b6ba91d36..367d8ae5d41c58b52b911056cd4bf28aecdb301d 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := dnp1110.o flash.o
+COBJS  := dnp1110.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index cfbf465bbe6a4564344ca65634fc5b5e8626c207..0acb052307e581350857d9010509401b7a836362 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o
-SOBJS  =
+COBJS  = $(BOARD).o
 
-$(LIB):        .depend $(OBJS) $(SOBJS)
-       $(AR) crv $@ $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 7d8ed26b529f28b567d704093aafd9ece01edaaf..5c6b654c4ae6a3ff143b0bb13ef01fb12c061e23 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o pci.o misc.o el_srom.o dc_srom.o l2cache.o
+COBJS  = $(BOARD).o flash.o pci.o misc.o el_srom.o dc_srom.o l2cache.o
 
 SOBJS  = asm_init.o
 
-$(LIB):        .depend $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -40,9 +44,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 76b2cfe6203eb8fb4e6ff4bd32607b7006cce284..5d186d97aff529bef4be304bc9925123e4d8abde 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o pci.o misc.o mpc107_i2c.o eepro100_srom.o
+COBJS  = $(BOARD).o flash.o pci.o misc.o mpc107_i2c.o eepro100_srom.o
 
 SOBJS  = asm_init.o
 
-$(LIB):        .depend $(OBJS) $(SOBJS)
-       $(AR) crv $@  $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -40,9 +44,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 13ce9fc9d28c852268a69aad84fab55016aedc5a..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 986608bb111a77dd156c25af0af0f3d723578ded..307ef4ae69aa70c8f9b5d22a2a6f0004d4154129 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o ../common/flash.o ../common/vpd.o ../common/am79c874.o
+COBJS  := $(BOARD).o ../common/flash.o ../common/vpd.o ../common/am79c874.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -39,9 +46,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index a74dd2fa2be39bce7b72e7acd7dd458a99b6bd1d..bd923af7c98d8b61711e9073f552534075abc104 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o ../common/flash.o ../common/vpd.o ../common/am79c874.o
+COBJS  = $(BOARD).o ../common/flash.o ../common/vpd.o ../common/am79c874.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index c53a3c7a0d66cbf9e271316bf94b5455c044b0fb..c8c834f62e44bb45925d83328840f9487d97bbd5 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (C) Copyright 2002
 # Sysgo Real-Time Solutions, GmbH <www.elinos.com>
 # Marius Groeger <mgroeger@sysgo.de>
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := ep7312.o flash.o
+COBJS  := ep7312.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -40,9 +47,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 8b10993194e85a4ce1dfc3a7e5698a3e73f6a241..e880f873af4b8a512f100b64a7fb2741133ba35b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o
+COBJS  := $(BOARD).o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 477e5eedeb1648a7b4f831d269a21df643fb694f..8744359660c86c9c8a032fa8dd8e31894a54c94a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2002
+# (C) Copyright 2002-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o mii_phy.o
+COBJS  = $(BOARD).o flash.o mii_phy.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 9123a8026d8a076a182cf12dd5bfad38d1166cfa..d0223b51ffc971d51ed699d2592b66bca9c9ab02 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # Copyright (C) 2004 Arabella Software Ltd.
 # Yuli Barcohen <yuli@arabellasw.com>
 #
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
+
+COBJS  := $(BOARD).o
 
-OBJS   := $(BOARD).o
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        $(OBJS) $(SOBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -38,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index f55e7e2f848fed8bd1bcb93e1c765c563e9c1f87..fff25ab623c091f4ed56a23cd0cab908d9a2615f 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 67cf29b3281b31d8e9fc41127db9144f8acf39ef..699a8488ea9dd438c53054d5bc94fd18bfe58e41 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ../common/misc.o ../common/pci.o
+COBJS  = $(BOARD).o flash.o ../common/misc.o ../common/pci.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
@@ -39,9 +46,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 8529ec70c09a662aacec3ca58b508a0647837b66..a5060d2d037f1b253d696b3d4879450922aac0f7 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o strataflash.o ../common/misc.o
+COBJS  = $(BOARD).o strataflash.o ../common/misc.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $^
@@ -38,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index a60495a59aa0b4d6e1225072884f4cd8f698cd5b..dec52af9cabfacfda8048b8546b1f214e1f3a7fb 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ../common/misc.o
+COBJS  = $(BOARD).o flash.o ../common/misc.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -38,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index a60495a59aa0b4d6e1225072884f4cd8f698cd5b..dec52af9cabfacfda8048b8546b1f214e1f3a7fb 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ../common/misc.o
+COBJS  = $(BOARD).o flash.o ../common/misc.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -38,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index a60495a59aa0b4d6e1225072884f4cd8f698cd5b..dec52af9cabfacfda8048b8546b1f214e1f3a7fb 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ../common/misc.o
+COBJS  = $(BOARD).o flash.o ../common/misc.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -38,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index a11ee82aa23c3d3a9f159506cfa0364d98a56dc5..ab9d8327c09e1767f990add9dca53626be4b2ea8 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common/xilinx_jtag)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
 # Objects for Xilinx JTAG programming (CPLD)
 CPLD    = ../common/xilinx_jtag/lenval.o \
          ../common/xilinx_jtag/micro.o \
          ../common/xilinx_jtag/ports.o
 
-OBJS   = $(BOARD).o flash.o ../common/misc.o $(CPLD)
+COBJS  = $(BOARD).o flash.o ../common/misc.o $(CPLD)
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -43,9 +50,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 88b0ae3435ec76072e2ac7e7e386cb409764982f..72c25625b31aeba917cc46932c56d4a8ae5b7fce 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ../common/misc.o ../common/cmd_loadpci.o
+COBJS  = $(BOARD).o flash.o ../common/misc.o ../common/cmd_loadpci.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -38,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 9340a32a5ff88057684292e3b6dfa03fa2c1c636..8f254dd3bfe4c455ed24e9bc373c90e87aa5dd17 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ../common/misc.o ../common/auto_update.o
+COBJS  = $(BOARD).o flash.o ../common/misc.o ../common/auto_update.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -38,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 84d44fbf4fa972117d8dbc58392e9e50125ede63..b4c74fc6d1c6bd23ec1694a39d6812e16dfe6e6f 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2002
+# (C) Copyright 2002-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o strataflash.o ../common/misc.o
+COBJS  = $(BOARD).o strataflash.o ../common/misc.o
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
@@ -39,9 +46,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 2ca73a99e20493fe44879737c4084655d033583f..78ffa0f85a91a49901fa447abeb605a0bf10a696 100644 (file)
@@ -1,6 +1,5 @@
-
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+# ifneq ($(OBJTREE),$(SRCTREE))
+# $(shell mkdir -p $(obj)../common/xilinx_jtag)
+# endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
 # Objects for Xilinx JTAG programming (CPLD)
 # CPLD  = ../common/xilinx_jtag/lenval.o \
 #        ../common/xilinx_jtag/micro.o \
 #        ../common/xilinx_jtag/ports.o
 
-# OBJS = $(BOARD).o flash.o $(CPLD)
-OBJS   = $(BOARD).o strataflash.o
+# COBJS        = $(BOARD).o flash.o $(CPLD)
+COBJS  = $(BOARD).o strataflash.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        $(OBJS) $(SOBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -45,9 +51,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 07b5de1881cc34f71ddec987c09591a950ec88bb..170779d6c143485b193741c7f7d873c1c4b57360 100644 (file)
@@ -32,7 +32,7 @@
 #      0x00100000   boot from RAM (for testing only)
 #
 
-sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
+sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
 
 ifndef TEXT_BASE
 ## Standard: boot high
index cd38b2d8d8173925767ae495ba5bad3f4649fa78..0dfec601ea8643cf4b3ca795202abc939ff3b5df 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+# 
 # (C) Copyright 2001
 # Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
 #
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../../Marvell/common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
 SOBJS  = misc.o
 
-OBJS   = $(BOARD).o serial.o ../../Marvell/common/memory.o pci.o \
+COBJS  = $(BOARD).o serial.o ../../Marvell/common/memory.o pci.o \
          mv_eth.o  mpsc.o i2c.o \
          sdram_init.o ide.o
 
-$(LIB):        .depend $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index a60495a59aa0b4d6e1225072884f4cd8f698cd5b..dec52af9cabfacfda8048b8546b1f214e1f3a7fb 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ../common/misc.o
+COBJS  = $(BOARD).o flash.o ../common/misc.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -38,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index e3b1c872b0c3959489e83b662cef0a73dbde548e..c74d1abfa8e98814e02e040d3e32a46441bbbb30 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o cmd_dasa_sim.o eeprom.o ../common/pci.o
+COBJS  = $(BOARD).o flash.o cmd_dasa_sim.o eeprom.o ../common/pci.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
@@ -39,9 +46,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index a11ee82aa23c3d3a9f159506cfa0364d98a56dc5..ab9d8327c09e1767f990add9dca53626be4b2ea8 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common/xilinx_jtag)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
 # Objects for Xilinx JTAG programming (CPLD)
 CPLD    = ../common/xilinx_jtag/lenval.o \
          ../common/xilinx_jtag/micro.o \
          ../common/xilinx_jtag/ports.o
 
-OBJS   = $(BOARD).o flash.o ../common/misc.o $(CPLD)
+COBJS  = $(BOARD).o flash.o ../common/misc.o $(CPLD)
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -43,9 +50,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 5ec4a4fd49873c120a79bb857ef9b1981dd70fa4..dec52af9cabfacfda8048b8546b1f214e1f3a7fb 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ../common/misc.o
+COBJS  = $(BOARD).o flash.o ../common/misc.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -38,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 9340a32a5ff88057684292e3b6dfa03fa2c1c636..8f254dd3bfe4c455ed24e9bc373c90e87aa5dd17 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ../common/misc.o ../common/auto_update.o
+COBJS  = $(BOARD).o flash.o ../common/misc.o ../common/auto_update.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -38,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index a60495a59aa0b4d6e1225072884f4cd8f698cd5b..dec52af9cabfacfda8048b8546b1f214e1f3a7fb 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ../common/misc.o
+COBJS  = $(BOARD).o flash.o ../common/misc.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -38,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index b3039c63482ddf184134f12009df52f6dfd6ff9c..1da3f7ef8bcbb4bd158a50009b4f4cc5d1cab517 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ../common/misc.o cmd_ocrtc.o
+COBJS  = $(BOARD).o flash.o ../common/misc.o cmd_ocrtc.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -38,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 6db564f86eb54884d4e3a0f783e357d16dc4c769..9ae728d9d01449b10bc18314b8d104715e542bae 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ../common/misc.o cmd_pci405.o
+COBJS  = $(BOARD).o flash.o ../common/misc.o cmd_pci405.o
 SOBJS  = writeibm.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 $(LIB):        $(OBJS) $(SOBJS)
 #      $(AR) crv $@ $(OBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
@@ -40,9 +47,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 603bbe283cbaaf840ae71a165dbebf2a56828e2e..82358af2dc9ed13fb0d931ce7b4f78534efd94cb 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+# ifneq ($(OBJTREE),$(SRCTREE))
+# $(shell mkdir -p $(obj)../common/xilinx_jtag)
+# endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
 # Objects for Xilinx JTAG programming (CPLD)
 # CPLD  = ../common/xilinx_jtag/lenval.o \
 #        ../common/xilinx_jtag/micro.o \
 #        ../common/xilinx_jtag/ports.o
 
-# OBJS = $(BOARD).o flash.o $(CPLD)
-OBJS   = $(BOARD).o flash.o
+# COBJS        = $(BOARD).o flash.o $(CPLD)
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -45,9 +52,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 07b5de1881cc34f71ddec987c09591a950ec88bb..170779d6c143485b193741c7f7d873c1c4b57360 100644 (file)
@@ -32,7 +32,7 @@
 #      0x00100000   boot from RAM (for testing only)
 #
 
-sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
+sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
 
 ifndef TEXT_BASE
 ## Standard: boot high
index 9340a32a5ff88057684292e3b6dfa03fa2c1c636..8f254dd3bfe4c455ed24e9bc373c90e87aa5dd17 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ../common/misc.o ../common/auto_update.o
+COBJS  = $(BOARD).o flash.o ../common/misc.o ../common/auto_update.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -38,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 741e4aacdcd4ede64069113dce79a5b480649118..2775b8a6350ce3b48120238d041de8845b133e08 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common/xilinx_jtag)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
 # Objects for Xilinx JTAG programming (CPLD)
 CPLD    = ../common/xilinx_jtag/lenval.o \
          ../common/xilinx_jtag/micro.o \
          ../common/xilinx_jtag/ports.o
 
-OBJS   = $(BOARD).o ../common/misc.o ../common/cmd_loadpci.o $(CPLD)
+COBJS  = $(BOARD).o ../common/misc.o ../common/cmd_loadpci.o $(CPLD)
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -43,9 +50,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index e5d844631335d1fac7f0b720d4d935e3dc252e5d..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2003
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index a60495a59aa0b4d6e1225072884f4cd8f698cd5b..dec52af9cabfacfda8048b8546b1f214e1f3a7fb 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ../common/misc.o
+COBJS  = $(BOARD).o flash.o ../common/misc.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -38,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index a11ee82aa23c3d3a9f159506cfa0364d98a56dc5..ab9d8327c09e1767f990add9dca53626be4b2ea8 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common/xilinx_jtag)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
 # Objects for Xilinx JTAG programming (CPLD)
 CPLD    = ../common/xilinx_jtag/lenval.o \
          ../common/xilinx_jtag/micro.o \
          ../common/xilinx_jtag/ports.o
 
-OBJS   = $(BOARD).o flash.o ../common/misc.o $(CPLD)
+COBJS  = $(BOARD).o flash.o ../common/misc.o $(CPLD)
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -43,9 +50,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index a60495a59aa0b4d6e1225072884f4cd8f698cd5b..dec52af9cabfacfda8048b8546b1f214e1f3a7fb 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ../common/misc.o
+COBJS  = $(BOARD).o flash.o ../common/misc.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -38,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 13ce9fc9d28c852268a69aad84fab55016aedc5a..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 305a1bfeb05199b77010af5e35bc98b9d1685123..17ef23dcd9fd644423bc7b1341c282ff4fa8fd76 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS =  $(BOARD).o flash.o phantom.o
+COBJS =  $(BOARD).o flash.o phantom.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 303ccfaf341d28a6251e7455bbb180e2333d9468..04ecf46c13115ca47ede815bc74518810f6d323c 100644 (file)
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS =  $(BOARD).o multiverse.o
+COBJS  = $(BOARD).o multiverse.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 13ce9fc9d28c852268a69aad84fab55016aedc5a..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 10850a95e47aa9d5653255f5d4688e0da131e612..c634f720248528f29cf1add856e58b22628cc9e5 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := evb4510.o flash.o
+COBJS  := evb4510.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index c493d6cf9d0fe6a559d28bd982a0058b6ceb14dc..b28372d818ca7c97f331f70f16cca59817c20418 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+# 
 # (C) Copyright 2001
 # Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
 #
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
 SOBJS  = misc.o
-OBJS   = $(BOARD).o flash.o serial.o memory.o pci.o \
+COBJS  = $(BOARD).o flash.o serial.o memory.o pci.o \
          eth.o eth_addrtbl.o mpsc.o i2c.o \
          sdram_init.o zuma_pbb.o intel_flash.o zuma_pbb_mbox.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        .depend $(OBJS) $(SOBJS)
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 34bd4b2090adc3aab5bfe4fb5b1caa99df6f61a1..7a39592aa13a5f1b58158e3422e2fdcbda928c98 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $^
@@ -41,9 +44,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index c9b3c9280fd63bdb2911a1558e8dade0ba6dd09d..70feb4acce072e0035fc36efe0e6fb441404e995 100644 (file)
@@ -3,7 +3,7 @@
 #
 # Copyright (c) 2005 blackfin.uclinux.org
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ezkit533.o
+COBJS  = $(BOARD).o flash.o ezkit533.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 7fc88ee82466818d98b5036ba7da9c2601456849..c0c172206d47110355e71f2fe2afa5fada6e8a50 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o lamp.o pcmcia.o
+COBJS  = $(BOARD).o flash.o lamp.o pcmcia.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 7a2014d466d6fa840b0dfb5ab4e47d726cc4ee81..1b57d2b0236ce949c225b11814dce20ff69e69fd 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index f77cc60a94bd01b25d986fd36e4140b44c3fadbd..b2d1e352020a1bf4e9986b5c2999e42a87386546 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o flash.o m88e6060.o
+COBJS  := $(BOARD).o flash.o m88e6060.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 5471d13639ac340a4256368a95104f775c969c2e..9b9f033f5e1095960d523b35e8f5dca99f60b6bb 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o strataflash.o
+COBJS  = $(BOARD).o strataflash.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 1954d661c3d4aabbf4a3507c60c9fe57d58d3524..695cd93c990bc38a50763e8ae652ca3a721518e5 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # 2003 (c) MontaVista Software, Inc.
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := gcplus.o flash.o
+COBJS  := gcplus.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -41,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index dd7ecf128528d02c142fa65252a8f5fd6bccc493..9d36711826d4c415d86451c8309efe6436b27350 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o beeper.o fpga.o ioport.o
+COBJS  = $(BOARD).o flash.o beeper.o fpga.o ioport.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 13ce9fc9d28c852268a69aad84fab55016aedc5a..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 48f74cd94d437663fc4e9c9c56bd69e6db7cdfdc..95bf0726bfe22d21827cbd115044b393f976e2d8 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ee_access.o pcmcia.o
+COBJS  = $(BOARD).o flash.o ee_access.o pcmcia.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 8ef3a51d824be7e84191bbdae971419e774bba8a..ed6a4a0526ad7fa184ec4804942756c95d15c4af 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2005
+# (C) Copyright 2005-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ee_access.o
+COBJS  = $(BOARD).o flash.o ee_access.o
 SOBJS  = lowlevel_init.o
 
-$(LIB):        .depend $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 827a6ac5f4826f62af272933dd4c65281464e750..bf5c508b64cda84dead4a08af36e150ebaba00c2 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := gw8260.o flash.o
+COBJS  := gw8260.o flash.o
 SOBJS   :=
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 13ce9fc9d28c852268a69aad84fab55016aedc5a..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index b9f1df685ef2dda4c049e871c54cae02066e6a6d..9ac6a4da375ff52ca2f3be03ddb174cc859ac643 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2005
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS =  $(BOARD).o flash.o
+COBJS =  $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index ed36ea717ecb1c0d42d57e62d53cd71ecffabb1b..4b2bbe27d20d536a6b91e90ae0a328f623515dde 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003-2004
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o
+COBJS  := $(BOARD).o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index b52af9a71640f125b686fa00a9be69886be5dc0b..ff9fa90d123b363441a23b1ad0301b9ac8ab8c65 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o bsp.o eeprom.o fetch.o input.o env.o
+COBJS  = $(BOARD).o flash.o bsp.o eeprom.o fetch.o input.o env.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index eb5ed591a97d1a488108a4a7c749cbef1ab9a2f3..8e61c79bd186c77403f7b9113b0028080f9f102a 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o flash.o
+COBJS  := $(BOARD).o flash.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 07b5de1881cc34f71ddec987c09591a950ec88bb..170779d6c143485b193741c7f7d873c1c4b57360 100644 (file)
@@ -32,7 +32,7 @@
 #      0x00100000   boot from RAM (for testing only)
 #
 
-sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
+sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
 
 ifndef TEXT_BASE
 ## Standard: boot high
index 7b2b54582030a16c9f24af6081e00969e6a97813..62db2f494b68ba35b1b35786db9ac900d306ec2e 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o pcmcia.o
+COBJS  = $(BOARD).o flash.o pcmcia.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index cfef750ec6f0d890a40c0bf758e87e92c3d64a65..d4237930cb55b7b7893cac0a4bc42a835277545d 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (C) Copyright 2005
 # Heiko Schocher, DENX Software Engineering, <hs@denx.de>
 #
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
+
+COBJS  = $(BOARD).o flash.o
 
-OBJS   = $(BOARD).o flash.o
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        .depend $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 08543f94f220023e9a7aad1b3b69970e2b963548..d77db72b05abd115c45ec96e03239ac73c4417db 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := impa7.o flash.o
+COBJS  := impa7.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index d9b0e2d258a50b125a6cefe2fe9c7434f14f6857..13986b8fcfc6c077db9076a188cc2571261d86ce 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 SOBJS  = lowlevel_init.o
 
-$(LIB):        .depend $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index bf832927ceb49c0111950827d7ae34df21ca226c..d00e05dce1749056ee6eb30869d9e95d02f9e78a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003-2004
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o flash.o
+COBJS  := $(BOARD).o flash.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 73f6a74427950c6c0238c03ce17c10918ad185f0..f4cc6cf1b866b9c6fa5656c59a3ae0df446e96a7 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := innokom.o flash.o
+COBJS  := innokom.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 358df62519a52415411f0aa582c1f7362c74354c..5b3729b3bccc3dda60e9c1d99d6814b43b3fa04e 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # (C) Copyright 2004
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := integratorap.o flash.o
+COBJS  := integratorap.o flash.o
 SOBJS  := lowlevel_init.o memsetup.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -43,9 +47,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 25b79b3e79304b4ec35ceee8af98b6be3fb9e769..e4c5c3b57a052eb8f43987d80b638e757620a518 100644 (file)
@@ -3,3 +3,9 @@
 #
 
 TEXT_BASE = 0x01000000
+
+ifneq ($(OBJTREE),$(SRCTREE))
+# We are building u-boot in a separate directory, use generated
+# .lds script from OBJTREE directory.
+LDSCRIPT := $(OBJTREE)/board/$(BOARDDIR)/u-boot.lds
+endif
index 9f71babf35d28ca42957656d0bd528b99e82bea3..53b0d1e340ed05b05b6e2450166a40c4b03927dc 100755 (executable)
@@ -103,14 +103,17 @@ then
        echo -n "#undef CONFIG_CM_TCRAM "               >> tmp.fil
        echo    " /* CM may not have TCRAM */"          >> tmp.fil
 fi
-mv tmp.fil ./include/config.h
+
+mkdir -p ${obj}include
+mkdir -p ${obj}board/integratorap
+mv tmp.fil ${obj}include/config.h
 # ---------------------------------------------------------
 #      Ensure correct core object loaded first in U-Boot image
 # ---------------------------------------------------------
-sed -r 's/CPU_FILE/cpu\/'$cpu'\/start.o/; s/#.*//' board/integratorap/u-boot.lds.template > board/integratorap/u-boot.lds
+sed -r 's/CPU_FILE/cpu\/'$cpu'\/start.o/; s/#.*//' ${src}board/integratorap/u-boot.lds.template > ${obj}board/integratorap/u-boot.lds
 # ---------------------------------------------------------
 # Complete the configuration
 # ---------------------------------------------------------
-./mkconfig -a integratorap arm $cpu integratorap;
+$MKCONFIG -a integratorap arm $cpu integratorap;
 echo "Variant:: $variant with core $cpu"
 
index 3d589fcd5ad5e824790bc1385b75323329fc4cca..efafeb687c5eb163ea3faf13ae35eb877f5b38d7 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := integratorcp.o flash.o
+COBJS  := integratorcp.o flash.o
 SOBJS  := lowlevel_init.o memsetup.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 25b79b3e79304b4ec35ceee8af98b6be3fb9e769..e4c5c3b57a052eb8f43987d80b638e757620a518 100644 (file)
@@ -3,3 +3,9 @@
 #
 
 TEXT_BASE = 0x01000000
+
+ifneq ($(OBJTREE),$(SRCTREE))
+# We are building u-boot in a separate directory, use generated
+# .lds script from OBJTREE directory.
+LDSCRIPT := $(OBJTREE)/board/$(BOARDDIR)/u-boot.lds
+endif
index 3a354339d7c74b5ba0906da69a5cf779069d0a67..37ae517fc0f37941361281cf4ebc8df047845868 100755 (executable)
@@ -98,14 +98,17 @@ then
        echo -n "#undef CONFIG_CM_TCRAM  "              >> tmp.fil
        echo    " /* CM may not have TCRAM */"          >> tmp.fil
 fi
-mv tmp.fil ./include/config.h
+
+mkdir -p ${obj}include
+mkdir -p ${obj}board/integratorcp
+mv tmp.fil ${obj}include/config.h
 # ---------------------------------------------------------
 #  Ensure correct core object loaded first in U-Boot image
 # ---------------------------------------------------------
-sed -r 's/CPU_FILE/cpu\/'$cpu'\/start.o/; s/#.*//' board/integratorcp/u-boot.lds.template > board/integratorcp/u-boot.lds
+sed -r 's/CPU_FILE/cpu\/'$cpu'\/start.o/; s/#.*//' ${src}board/integratorcp/u-boot.lds.template > ${obj}board/integratorcp/u-boot.lds
 # ---------------------------------------------------------
 # Complete the configuration
 # ---------------------------------------------------------
-./mkconfig -a integratorcp arm $cpu integratorcp;
+$MKCONFIG -a integratorcp arm $cpu integratorcp;
 echo "Variant:: $variant with core $cpu"
 
index 13ce9fc9d28c852268a69aad84fab55016aedc5a..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 19da5d065bf93e6d122c4600ba3ec01bd9e3a5d4..efdb1c14082534e843a3184a22b95f9139229475 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (C) Copyright 2002 Wolfgang Grandegger <wg@denx.de>
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
+
+COBJS  := $(BOARD).o flash.o
 
-OBJS   := $(BOARD).o flash.o
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        $(OBJS) $(SOBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -37,9 +44,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 9123a8026d8a076a182cf12dd5bfad38d1166cfa..0c1cb0253abb647c4261de9826fe3c487ef6280f 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+# 
 # Copyright (C) 2004 Arabella Software Ltd.
 # Yuli Barcohen <yuli@arabellasw.com>
 #
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o
+COBJS  := $(BOARD).o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -38,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 13ce9fc9d28c852268a69aad84fab55016aedc5a..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 59d6964a4af9c03a00b569146fb60517e82eb839..9568cb595915ed59ee38b9175962394667f99e63 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := ixdp425.o
+COBJS  := ixdp425.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 34205864cf71c17891e295865b13c4466c2ea700..d49c0e7e6d58837ddfc75b5939d57ecceadf2db5 100644 (file)
@@ -1,4 +1,4 @@
 TEXT_BASE = 0x00f80000
 
 # include NPE ethernet driver
-BOARDLIBS = cpu/ixp/npe/libnpe.a
+BOARDLIBS = $(obj)cpu/ixp/npe/libnpe.a
index 0da27b696823ded1b1322907db408cc298ed8173..be6bd315cdfe83f8b5a9b872ea54928a837e0bbe 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+# 
 # Copyright 2004 Picture Elements, Inc.
 # Stephen Williams <steve@icarus.com>
 #
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o sdram.o flash.o host_bridge.o
+COBJS  = $(BOARD).o sdram.o flash.o host_bridge.o
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
@@ -36,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index f36d88dc3f56da1e52c4e0d57f216112eb547f27..2adcb587adf6b62eecbf415e5428ab21a3048094 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := kb9202.o
+COBJS  := kb9202.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -41,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 071f0d2ac5e10ae693e7d688cc72a1d959dec433..eac75a36b18c24e890cf35242a55367c2666dcc7 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o kup.o
+COBJS  = $(BOARD).o flash.o kup.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 4a3954c38907d1387f38b384fcadd7a51b384cef..409e4cdd5f5b35170057b4168f0f0414575cab48 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o ../common/flash.o ../common/kup.o ../common/load_sernum_ethaddr.o ../common/pcmcia.o
+COBJS  = $(BOARD).o ../common/flash.o ../common/kup.o ../common/load_sernum_ethaddr.o ../common/pcmcia.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 4a3954c38907d1387f38b384fcadd7a51b384cef..409e4cdd5f5b35170057b4168f0f0414575cab48 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o ../common/flash.o ../common/kup.o ../common/load_sernum_ethaddr.o ../common/pcmcia.o
+COBJS  = $(BOARD).o ../common/flash.o ../common/kup.o ../common/load_sernum_ethaddr.o ../common/pcmcia.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 7a2014d466d6fa840b0dfb5ab4e47d726cc4ee81..1b57d2b0236ce949c225b11814dce20ff69e69fd 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 550aa1dac3bb8c1e3d39e3717b0af0642d41d47b..7024c2b6aef43863b0a7add89c4f5e793ddd2f59 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := lart.o flash.o
+COBJS  := lart.o flash.o
 SOBJS  := flashasm.o lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index c7cde7d57908d6c7be255b137407c296aeddfa13..fff3a51356e83bd66a39a9e4ff2e408fcd0f89b6 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := logodl.o flash.o
+COBJS  := logodl.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index ebe14df1b61e7e705d10186e6845b7c0e6326a07..692f2d5d03adc39446a6ce39969784db0b909748 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := lpd7a40x.o flash.o
+COBJS  := lpd7a40x.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 106622cf58720f3e671e88362a0b74b7004b6ecb..f5626429bea93a9628b76fec4eaf71737cc03d88 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := lubbock.o flash.o
+COBJS  := lubbock.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -40,9 +44,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 7b2b54582030a16c9f24af6081e00969e6a97813..62db2f494b68ba35b1b35786db9ac900d306ec2e 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o pcmcia.o
+COBJS  = $(BOARD).o flash.o pcmcia.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 34de983e30088dea411a677c232677d00281672e..2951b96a210d26bf0b3a913bb0720f936a013873 100644 (file)
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o
+COBJS  = $(BOARD).o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index e5d844631335d1fac7f0b720d4d935e3dc252e5d..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2003
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index e5d844631335d1fac7f0b720d4d935e3dc252e5d..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2003
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index e4d10994edda343f84a4094c5ebf13ec5226e9ab..feadf24ee6ebff18a4be52caba6d1f54ff2b6058 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o vpd.o pcmcia.o
+COBJS  = $(BOARD).o flash.o vpd.o pcmcia.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 7fdc088e9c178724169c71dcc4f892d7305fd047..eb1d059ae913d222675cf37df4c16d6e36e5050a 100644 (file)
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o
+COBJS  := $(BOARD).o lcd.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index a8225598cc1d6b6f1b14b21bdcfd99604fe65160..d0f9289fe1408498b9560d6791ed9c79eaebc02d 100644 (file)
@@ -22,7 +22,7 @@
 #
 
 #
-# MCC200 board:
+# MCC200, PRS200 boards:
 #
 #      Valid values for TEXT_BASE are:
 #
@@ -31,7 +31,7 @@
 #      0x00100000   boot from RAM (for testing only)
 #
 
-sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
+sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
 
 ifndef TEXT_BASE
 ## Standard: boot low
diff --git a/board/mcc200/lcd.c b/board/mcc200/lcd.c
new file mode 100644 (file)
index 0000000..b262516
--- /dev/null
@@ -0,0 +1,190 @@
+/*
+ * (C) Copyright 2006
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * 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
+ */
+
+#include <common.h>
+#include <lcd.h>
+#include <mpc5xxx.h>
+
+#ifdef CONFIG_LCD
+
+#define SWAPPED_LCD
+/*
+ *  The name of the device used for communication
+ * with the PSoC.
+ */
+#define PSOC_PSC       MPC5XXX_PSC2
+#define PSOC_BAUD      500000UL
+
+#define RTS_ASSERT     1
+#define RTS_NEGATE     0
+#define CTS_ASSERT     1
+#define CTS_NEGATE     0
+
+/*
+ * Dimensions in pixels
+ */
+#define LCD_WIDTH      160
+#define LCD_HEIGHT     100
+
+/*
+ * Dimensions in bytes
+ */
+#define LCD_BUF_SIZE   ((LCD_WIDTH*LCD_HEIGHT)>>3)
+
+#if LCD_BPP != LCD_MONOCHROME
+#error "MCC200 support only monochrome displays (1 bpp)!"
+#endif
+
+#define PSOC_RETRIES   10      /* each of PSOC_WAIT_TIME */
+#define PSOC_WAIT_TIME 10      /* usec */
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * LCD information
+ */
+vidinfo_t panel_info = {
+       LCD_WIDTH, LCD_HEIGHT, LCD_BPP
+};
+
+int lcd_line_length;
+
+int lcd_color_fg;
+int lcd_color_bg;
+
+/*
+ * Frame buffer memory information
+ */
+void *lcd_base;                        /* Start of framebuffer memory  */
+void *lcd_console_address;     /* Start of console buffer      */
+
+short console_col = 0;
+short console_row = 0;
+
+/*
+ *  The device we use to communicate with PSoC
+ */
+int serial_inited = 0;
+
+/*
+ * Exported functions
+ */
+void lcd_initcolregs (void);
+void lcd_ctrl_init (void *lcdbase);
+void lcd_enable (void);
+
+/*
+ *  Imported functions to support the PSoC protocol
+ */
+extern int serial_init_dev (unsigned long dev_base);
+extern void serial_setrts_dev (unsigned long dev_base, int s);
+extern int serial_getcts_dev (unsigned long dev_base);
+extern void serial_putc_raw_dev(unsigned long dev_base, const char c);
+
+/*
+ *  Just stubs for our driver, needed for compiling compabilty with
+ * the common LCD driver code.
+ */
+void lcd_initcolregs (void)
+{
+}
+
+void lcd_ctrl_init (void *lcdbase)
+{
+}
+
+/*
+ * Function sends the contents of the frame-buffer to the LCD
+ */
+void lcd_enable (void)
+{
+       int i, retries, fb_size;
+
+       if (!serial_inited) {
+               unsigned long baud;
+
+               baud = gd->baudrate;
+               gd->baudrate = PSOC_BAUD;
+               serial_init_dev(PSOC_PSC);
+               gd->baudrate = baud;
+               serial_setrts_dev (PSOC_PSC, RTS_ASSERT);
+               serial_inited = 1;
+       }
+
+       /*
+        *  Implement PSoC communication protocol:
+        * 1. Assert RTS, wait CTS assertion
+        * 2. Transmit data
+        * 3. Negate RTS, wait CTS negation
+        */
+
+       /* 1 */
+       serial_setrts_dev (PSOC_PSC, RTS_ASSERT);
+       for (retries = PSOC_RETRIES; retries; retries--) {
+               if (serial_getcts_dev(PSOC_PSC) == CTS_ASSERT)
+                       break;
+               udelay (PSOC_WAIT_TIME);
+       }
+       if (!retries) {
+               printf ("%s Error: PSoC doesn't respond on "
+                       "RTS ASSERT\n", __FUNCTION__);
+       }
+
+       /* 2 */
+       fb_size = panel_info.vl_row * (panel_info.vl_col >> 3);
+
+#if !defined(SWAPPED_LCD)
+       for (i=0; i<fb_size; i++) {
+               serial_putc_raw_dev (PSOC_PSC, ((char *)lcd_base)[i]);
+       }
+#else
+    {
+       int x, y, pwidth;
+       char *p = (char *)lcd_base;
+
+       pwidth = ((panel_info.vl_col+7) >> 3);
+       for (y=0; y<panel_info.vl_row; y++) {
+               i = y * pwidth;
+               for (x=0; x<pwidth; x+=5) {
+                       serial_putc_raw_dev (PSOC_PSC, (p[i+x+2]<<4 & 0xF0) | (p[i+x+3]>>4 & 0x0F));
+                       serial_putc_raw_dev (PSOC_PSC, (p[i+x+3]<<4 & 0xF0) | (p[i+x+4]>>4 & 0x0F));
+                       serial_putc_raw_dev (PSOC_PSC, (p[i+x+4]<<4 & 0xF0) | (p[i+x]>>4 & 0x0F));
+                       serial_putc_raw_dev (PSOC_PSC, (p[i+x]<<4 & 0xF0) | (p[i+x+1]>>4 & 0x0F));
+                       serial_putc_raw_dev (PSOC_PSC, (p[i+x+1]<<4 & 0xF0) | (p[i+x+2]>>4 & 0x0F));
+               }
+       }
+    }
+#endif
+
+       /* 3 */
+       serial_setrts_dev (PSOC_PSC, RTS_NEGATE);
+       for (retries = PSOC_RETRIES; retries; retries--) {
+               if (serial_getcts_dev(PSOC_PSC) == CTS_NEGATE)
+                       break;
+               udelay (PSOC_WAIT_TIME);
+       }
+       if (!retries) {
+               printf ("%s Error: PSoC doesn't respond on "
+                       "RTS NEGATE\n", __FUNCTION__);
+       }
+
+       return;
+}
+#endif /* CONFIG_LCD */
index 775030c17cb6f7d273f1c7c27ff8eea1a77e8948..71a691b5dbf1fb171b62ad823b603aeef65d8dbb 100644 (file)
@@ -197,7 +197,11 @@ long int initdram (int board_type)
 
 int checkboard (void)
 {
+#if defined(CONFIG_PRS200)
+       puts ("Board: PRS200\n");
+#else
        puts ("Board: MCC200\n");
+#endif
        return 0;
 }
 
@@ -261,8 +265,8 @@ int misc_init_r (void)
                *(volatile int*)MPC5XXX_CS0_CFG &= ~(1 << 6);
                printf ("Warning: Only 32 of 64 MB of Flash are accessible from U-Boot\n");
                flash_info[0].size = 32 << 20;
-               for (snum = 0, flash_sup_end = gd->bd->bi_flashstart + (32<<20); 
-                       flash_info[0].start[snum] < flash_sup_end; 
+               for (snum = 0, flash_sup_end = gd->bd->bi_flashstart + (32<<20);
+                       flash_info[0].start[snum] < flash_sup_end;
                        snum++);
                flash_info[0].sector_count = snum;
        }
index 40c60b1b345b2adb22eded8164322e09b745ec28..ce5ba19493ab7c156a68769fa816a2ac957dd432 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o serial.o
+COBJS  = $(BOARD).o flash.o serial.o
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index ab2c376ff4661042f58d780dfe2c60a6637520e9..ae4de574adad7411d53085aec29a6631efd2659a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := modnet50.o flash.o
+COBJS  := modnet50.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index ddc5546e7f5fceb7eab0280ca9a9c17c5b49bbf9..490ac3bf158b9e204495b5ebe07f0dce23ed5aba 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o m48t59y.o pci.o flash.o
+COBJS  = $(BOARD).o m48t59y.o pci.o flash.o
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        .depend $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index b6ea3cf47398897a76a19aeb496b8c05f49c6e04..c1e7ffd82799d979212692781c5db518a664f32b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := mp2usb.o flash.o
+COBJS  := mp2usb.o flash.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index cc519d1e27cd918727125a45f5431345cb166d84..e1e0a0f3a64f5bce7c5026db3d741f664ebb5770 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o flash.o
+COBJS  := $(BOARD).o flash.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index eb6f7c9d1f1a340b82f045455d2b9a71ed0cb76f..e99e181ddae871468485e92f9368b3feec813303 100644 (file)
@@ -29,7 +29,7 @@
 # MPC8260ADS, MPC8266ADS, and PQ2FADS-ZU/VR boards
 #
 
-sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
+sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
 
 ifndef TEXT_BASE
 ## Standard: boot high
index cd0f40bcdf3bcca5c57c9ad9ffca8fdf3a23c047..157c969d9c795846b1859f59191aa64a9e83f18d 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o flash.o
+COBJS  := $(BOARD).o flash.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 38bbb6732e1b8527cd3fe1c806699ba7ecaa7db6..e699086800e9e4271e710efa60b32f191b3a1a0c 100644 (file)
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o
+COBJS  := $(BOARD).o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 5d8ea34946b8882501b96f8e9079c39dd1aa17e1..3f1e8f21770a6251b78b67670b25c3f1161101d2 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o
+COBJS  := $(BOARD).o
 SOBJS  := init.o
 #SOBJS :=
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -40,9 +44,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 6f1995e0827b59e79b454a9f83681a3aa3c6b1ca..0a8397000afba0800901af4373bfb8abab007527 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o flash.o
-#OBJS  := $(BOARD).o flash.o $(BOARD)_slave.o
+COBJS  := $(BOARD).o flash.o
+#COBJS := $(BOARD).o flash.o $(BOARD)_slave.o
 SOBJS  := init.o
 #SOBJS :=
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -41,9 +45,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 5d8ea34946b8882501b96f8e9079c39dd1aa17e1..3f1e8f21770a6251b78b67670b25c3f1161101d2 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o
+COBJS  := $(BOARD).o
 SOBJS  := init.o
 #SOBJS :=
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -40,9 +44,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 9276f64ff8226842a7f9b6f995a2cf788a4024c0..87e507e8a2328b0a15970b1c9c4d3f97652cecae 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o ../common/flash.o cmd_mip405.o ../common/pci.o \
+COBJS  = $(BOARD).o ../common/flash.o cmd_mip405.o ../common/pci.o \
                        ../common/usb_uhci.o ../common/memtst.o ../common/common_util.o
 
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
@@ -41,9 +48,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 1a9ce12117093d3f8d7e5a974aea196c79b6ddbd..c469e3facdff85cfff63a90a5586f98c13835de3 100644 (file)
@@ -1,6 +1,6 @@
 #
-# (C) Copyright 2001   Wolfgang Denk, DENX Software Engineering, wd@denx.de
-#
+# (C) Copyright 2001-2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de
 #
 # See file CREDITS for list of people who contributed to this
 # project.
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   :=  pati.o ../common/flash.o ../common/memtst.o cmd_pati.o ../common/common_util.o
+COBJS  :=  pati.o ../common/flash.o ../common/memtst.o cmd_pati.o ../common/common_util.o
 #### cmd_pati.o
-SOBJS  :=
 
-$(LIB):        $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -40,9 +46,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index a818d08a59f25160dbe7ed528b054810d34e3a49..833900d1d752898991f5dce5cf04698870be7617 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o \
+COBJS  = $(BOARD).o \
          ../common/flash.o cmd_pip405.o ../common/pci.o \
          ../common/isa.o ../common/kbd.o \
          ../common/usb_uhci.o \
@@ -33,6 +36,10 @@ OBJS = $(BOARD).o \
 
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
@@ -44,9 +51,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 304c965d12ba8cfc5dd996a76a56466e9f451636..bd76e7475c5c55a08773dacd031870ffd7a7e935 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := vcma9.o flash.o cmd_vcma9.o
-OBJS   += ../common/common_util.o ../common/memtst.o
+COBJS  := vcma9.o flash.o cmd_vcma9.o
+COBJS  += ../common/common_util.o ../common/memtst.o
 
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -41,9 +48,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 24dc0264f35c6616df9e433a390f41c4db7ab814..1b57d2b0236ce949c225b11814dce20ff69e69fd 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
-SOBJS  =
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 24dc0264f35c6616df9e433a390f41c4db7ab814..1b57d2b0236ce949c225b11814dce20ff69e69fd 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
-SOBJS  =
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 13ce9fc9d28c852268a69aad84fab55016aedc5a..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 3e805feb404aaeefc70c1b11a2c87dc57d50779e..96e5be505376056402636bd7f096586fa06f58f5 100644 (file)
@@ -1,6 +1,9 @@
 #
 # board/mx1ads/Makefile
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (c) Copyright 2004
 # Techware Information Technology, Inc.
 # http://www.techware.com.tw/
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := mx1ads.o syncflash.o
+COBJS  := mx1ads.o syncflash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -40,9 +47,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 9e3bca14cd9118be07ce3d5d193b7d575855edc2..2a17f820729350faf895cc2fb917ae979cbae74a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := mx1fs2.o flash.o
+COBJS  := mx1fs2.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 8dc4934f79487def30ae1c2b8f41f5fb521d9e4e..f0447272fa9ad8504db673481b3a162bb7f52716 100644 (file)
@@ -1,6 +1,6 @@
 #
 # (C) Copyright 2006 Detlev Zundel, dzu@denx.de
-# (C) Copyright 2004
+# (C) Copyright 2004-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o nand.o flash.o
+COBJS  = $(BOARD).o nand.o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 5b2284aec4d5d7a3342499bedf21bbc5b6dfa112..52c8ffe353a80642fe85d5c6969873c3f636f326 100644 (file)
@@ -27,4 +27,4 @@
 #
 
 TEXT_BASE = 0x40700000
-BOARDLIBS = drivers/nand/libnand.a
+BOARDLIBS = $(obj)drivers/nand/libnand.a
index b3c1797e226b9efc3ab66ff7abfc387d333be09c..a8b215982ad28cc37ed284e0a6f7ab35942a3310 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o phone_console.o
+COBJS  = $(BOARD).o flash.o phone_console.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 3a205017f2378fafc8b0994c504c985551a98f39..b7c092d24f086c0bdc29d940e07ea5ef2b109c44 100644 (file)
@@ -1,3 +1,6 @@
+# 
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # (C) Copyright 2005
 # Ladislav Michl, 2N Telekomunikace, michl@2n.cz
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := netstar.o flash.o nand.o
+COBJS  := netstar.o flash.o nand.o
 SOBJS  := setup.o crcek.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c) eeprom.c \
+               eeprom_start.S
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
 
 LOAD_ADDR = 0x10400000
 LDSCRIPT = $(TOPDIR)/board/$(BOARDDIR)/eeprom.lds
+lnk = $(if $(obj),$(obj),.)
 
 HOST_CFLAGS = -Wall -pedantic -I$(TOPDIR)/include
 
-all:   $(LIB) eeprom.srec eeprom.bin crcek.srec crcek.bin crcit
+all:   $(obj).depend $(LIB) $(obj)eeprom.srec $(obj)eeprom.bin \
+               $(obj)crcek.srec $(obj)crcek.bin $(obj)crcit
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $^
 
-eeprom.srec:   eeprom.o eeprom_start.o
-       $(LD) -T $(LDSCRIPT) -g -Ttext $(LOAD_ADDR) \
-               -o $(<:.o=) -e $(<:.o=) $^ \
-               -L../../examples -lstubs \
-               -L../../lib_generic -lgeneric \
+$(obj)eeprom.srec:     $(obj)eeprom.o $(obj)eeprom_start.o
+       cd $(lnk) && $(LD) -T $(LDSCRIPT) -g -Ttext $(LOAD_ADDR) \
+               -o $(<:.o=) -e eeprom eeprom.o eeprom_start.o \
+               -L$(obj)../../examples -lstubs \
+               -L$(obj)../../lib_generic -lgeneric \
                -L$(gcclibdir) -lgcc
        $(OBJCOPY) -O srec $(<:.o=) $@
 
-eeprom.bin:    eeprom.srec
+$(obj)eeprom.bin:      $(obj)eeprom.srec
        $(OBJCOPY) -I srec -O binary $< $@ 2>/dev/null
 
-crcek.srec:    crcek.o
+$(obj)crcek.srec:      $(obj)crcek.o
        $(LD) -g -Ttext 0x00000000 \
-               -o $(<:.o=) -e $(<:.o=) $^
+               -o $(<:.o=) -e crcek $^
        $(OBJCOPY) -O srec $(<:.o=) $@
 
-crcek.bin:     crcek.srec
+$(obj)crcek.bin:       $(obj)crcek.srec
        $(OBJCOPY) -I srec -O binary $< $@ 2>/dev/null
 
-crcit:         crcit.o crc32.o
+$(obj)crcit:           $(obj)crcit.o $(obj)crc32.o
        $(HOSTCC) $(HOST_CFLAGS) -o $@ $^
 
-crcit.o:       crcit.c
-       $(HOSTCC) $(HOST_CFLAGS) -c $<
+$(obj)crcit.o: crcit.c
+       $(HOSTCC) $(HOST_CFLAGS) -o $@ -c $<
 
-crc32.o:       $(TOPDIR)/tools/crc32.c
-       $(HOSTCC) $(HOST_CFLAGS) -DUSE_HOSTCC -c $<
+$(obj)crc32.o: $(OBJTREE)/tools/crc32.c
+       $(HOSTCC) $(HOST_CFLAGS) -DUSE_HOSTCC -o $@ -c $<
 
 clean:
-       rm -f $(SOBJS) $(OBJS) eeprom eeprom.srec eeprom.bin \
-               crcek crcek.srec crcek.bin
+       rm -f $(SOBJS) $(OBJS) $(obj)eeprom $(obj)eeprom.srec \
+               $(obj)eeprom.bin $(obj)crcek $(obj)crcek.srec \
+               $(obj)crcek.bin
 
 distclean:     clean
        rm -f $(LIB) core *.bak .depend
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
diff --git a/board/netstar/crcit b/board/netstar/crcit
deleted file mode 100755 (executable)
index 203645d..0000000
Binary files a/board/netstar/crcit and /dev/null differ
index ee200c2d2dc93f6a74c829ce78fa095f91dea54b..39362c68d5bc41a67f60ce9b1e0eed7dfa9c6d15 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o dsp.o codec.o pcmcia.o
+COBJS  = $(BOARD).o flash.o dsp.o codec.o pcmcia.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index d45702091f0b2c947f4fa88af21a83a87eb505f9..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 13ce9fc9d28c852268a69aad84fab55016aedc5a..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index fb4333c19c0277522186687009ee6706fcb79c9a..defc29bb6fcd7867c7f3576b8a50776ecc6848cf 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := ns9750dev.o flash.o led.o
+COBJS  := ns9750dev.o flash.o led.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 7a2014d466d6fa840b0dfb5ab4e47d726cc4ee81..1b57d2b0236ce949c225b11814dce20ff69e69fd 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 2eb4366bf71bd26d6ff8665dcb565695ceebea0b..626f61026999e73678647b0b60a17f1805acce80 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# (C) Copyright 2005
+# (C) Copyright 2005-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o flash.o
+COBJS  := $(BOARD).o flash.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 902b24ea1acda603bb67e6267e805e072f2e5fdc..7cdc8d0073f6dcb9aa316dc09ead9026b0d1ffce 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := omap1510innovator.o
+COBJS  := omap1510innovator.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 4560102327e9d786d965bb0e8c2b4035c97c0aad..e523dc63082e77a5813ff3583ff33b17e3b7a949 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := omap1610innovator.o flash.o
+COBJS  := omap1610innovator.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index ed4786879a1cc96f6c271512654c3fdba3a466f8..767a9d6f0f2725bc3706de6dd507a8484326f405 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := omap2420h4.o mem.o sys_info.o
+COBJS  := omap2420h4.o mem.o sys_info.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 4b564217b74799bc8c332a30122e08189c02ecee..c734b4318669b23550e3722a78d402fd63ff6842 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := omap5912osk.o
+COBJS  := omap5912osk.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 29467ac39e6426de19a855f14118f869141f591d..d678fd5a894871148ee417ab5127ea40b5548aca 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := omap730p2.o flash.o
+COBJS  := omap730p2.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index ae7a9320842113f28087fc9b341fa220611177d7..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index d1cdc6b9244c1ca3257633671f85cef9cafe2da0..d1e9ad349ba4efa17720a98c052202704b657464 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 SOBJS  = memsetup.o
 
-$(LIB):        .depend $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 2998f23eb06c5366087d924504a66c217736a840..2af328612a3d6cbd7cf8bf49a2d363183b5bb78e 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2002
+# (C) Copyright 2002-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
 COBJS  = $(BOARD).o cpc710_pci.o flash.o sconsole.o \
          fpga_serial.o pcippc2_fpga.o cpc710_init_ram.o i2c.o
 
-AOBJS  =
+SOBJS  =
 
-OBJS   = $(COBJS) $(AOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        .depend $(OBJS)
-       $(AR) crv $@ $(OBJS)
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 #########################################################################
 
-.depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
-       $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 4a2a3888f5b47a0a711f526c19c5148b0fceab90..9da90c1650036f892873f66670cb635216780c06 100644 (file)
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 95d9170b240658a817918b4c7f947d13a4fbbb36..07997725b25d86f47307d1e047c3ba49017adeb9 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := pleb2.o flash.o
+COBJS  := pleb2.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -40,9 +44,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 8cf0d7de7b746800654517dc8f6794993399710c..8e61c79bd186c77403f7b9113b0028080f9f102a 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# (C) Copyright 2003-2004
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o flash.o
+COBJS  := $(BOARD).o flash.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 7a2014d466d6fa840b0dfb5ab4e47d726cc4ee81..1b57d2b0236ce949c225b11814dce20ff69e69fd 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index c93bad98e55893ca343c50c5ffef9444e1cb9014..48ac299faee2a14dc053782276cadfa244843ea7 100644 (file)
@@ -26,7 +26,7 @@
 #
 
 
-sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
+sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
 
 ifndef TEXT_BASE
 ## Standard: boot 64-bit flash
index b9ef0c050fa28a3febdd2c8ea669b418b878b7f8..1b57d2b0236ce949c225b11814dce20ff69e69fd 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001-2004
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index e894af775fa735787b06f5799a9925c722a5686a..6288431a535807a3a60008ab0a898ba8297b1e08 100644 (file)
@@ -26,7 +26,7 @@
 #
 
 
-sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
+sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
 
 ifndef TEXT_BASE
 ## Standard: boot 64-bit flash
index 78281660d6715785da44cb1392ec916f7e770a45..3f1e8f21770a6251b78b67670b25c3f1161101d2 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001-2005
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o
+COBJS  := $(BOARD).o
 SOBJS  := init.o
 #SOBJS :=
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -40,9 +44,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 5d8ea34946b8882501b96f8e9079c39dd1aa17e1..3f1e8f21770a6251b78b67670b25c3f1161101d2 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o
+COBJS  := $(BOARD).o
 SOBJS  := init.o
 #SOBJS :=
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -40,9 +44,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index e85d4fdc65f2655671b175e3561b78015bf448bb..a837820493e4b1e45f57e68e90cc0028dc089000 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS =  $(BOARD).o cmd_pn62.o misc.o
+COBJS  = $(BOARD).o cmd_pn62.o misc.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index c378677cc6737ee13bdb3d5185ad0960b2e2797c..1655b3e9ee2fbeb196de9e6016d324e7e1cc764b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := ppmc7xx.o pci.o flash.o
 SOBJS  := init.o
 
-$(LIB):        .depend $(OBJS) $(SOBJS)
+COBJS  := ppmc7xx.o pci.o flash.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -39,9 +44,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 351f4eea2f1d61d43c75a88fdae4dca6392a6dff..e17cb7a4e2b33a98582f678cee6f242ff57ea963 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := ppmc8260.o
+COBJS  := ppmc8260.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 47116d3674691a1389f37d6ede0ddedeb3c55420..a47a0674c415825bfd71dbe25af1276a10ef9924 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2002
+# (C) Copyright 2002-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o
+COBJS  = $(BOARD).o
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index f3cd5a3f18db3235e611c3823bf77559d9b243e5..32ffac0dcf75a1a2e20cdac23fd0cc8446014b68 100644 (file)
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := flash.o pdnb3.o nand.o
+COBJS  := flash.o pdnb3.o nand.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 6b0f18b3054ccb328434b07d3e089c649588eb2d..767075884a0fe1054b4de93561e87d7d7a54c853 100644 (file)
@@ -1,4 +1,4 @@
 TEXT_BASE = 0x01f00000
 
 # include NPE ethernet driver
-BOARDLIBS = cpu/ixp/npe/libnpe.a
+BOARDLIBS = $(obj)cpu/ixp/npe/libnpe.a
index 8e55c9bcde868142d0631d0375eb95b36ff208d7..7d74b4ee9d3542d6616cf5267fa3cc63411e0de0 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001-2004
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -12,7 +12,7 @@
 #
 # 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
+# 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
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
 COMOBJS := ../common/AMDLV065D.o
 
-OBJS   := $(BOARD).o $(COMOBJS)
+COBJS  := $(BOARD).o $(COMOBJS)
 
-SOBJS  =
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB): $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -42,9 +47,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 5c1db036bf9d99391b50f0b02290e840ebc78154..cbe99190ee09ec55d59db2e94be789486a64dc54 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001-2004
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -12,7 +12,7 @@
 #
 # 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
+# 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
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
 COMOBJS := ../common/AMDLV065D.o
 
-OBJS   := $(BOARD).o led.o $(COMOBJS)
+COBJS  := $(BOARD).o led.o $(COMOBJS)
 
-SOBJS  =
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB): $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+$(LIB):        $(obj).depend $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -42,9 +47,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index b2f2fc0fd35dcc98098b1f935604dc89159a067a..1262d80de9b5d85c87df42c58ba2a3bee23a4d34 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o sconsole.o
+COBJS  = $(BOARD).o flash.o sconsole.o
 SOBJS  = lowlevel_init.o
 
-$(LIB):        .depend $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index b5f352a6f6d2c4fca521fcbc6cea35dbb8528ddc..2d0077bbee6791f9fbc9331b941fd5dedc76338e 100644 (file)
@@ -1,6 +1,6 @@
 
 #
-# (C) Copyright 2000-2005
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := pxa_idp.o
+COBJS  := pxa_idp.o
 SOBJS  := memsetup.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -40,9 +44,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index e50f5ff088b9a4861d11393250a5797e431adf15..602865f5d8c418a02995e545d41dccb99f507025 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o fpga.o
+COBJS  = $(BOARD).o fpga.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        .depend $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 1a7e7a693a2923f9a0b5b8dbeb123699e52eca23..0179b46cbf02534fec6a5d6d64c54cc5e1cb2a0f 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o pcmcia.o
+COBJS  = $(BOARD).o flash.o pcmcia.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index d0364ed85f38daa4c4a877c64d76ba1e9b819028..2951b96a210d26bf0b3a913bb0720f936a013873 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2003
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o
+COBJS  = $(BOARD).o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 52f0fd6ef278a1f273339a42469fab55621194c8..e880f873af4b8a512f100b64a7fb2741133ba35b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001-2005
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o
+COBJS  := $(BOARD).o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 0121ddc79cd9c3f887d27f0b8a22e23a33796767..f004881a0290cb5bf71ece03734c9b50504570a1 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o kbd.o
+COBJS  = $(BOARD).o flash.o kbd.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 13ce9fc9d28c852268a69aad84fab55016aedc5a..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 4535106e6c7111e1dd1a335fa6b12cb0ba27bf52..2689c6bbed70e5ab79cdef63e961ed205a8ba640 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := rpxsuper.o flash.o mii_phy.o
+COBJS  := rpxsuper.o flash.o mii_phy.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 9934787e4761abcaf9486076e69c5e5a93f199e3..4a7bd3dce9e896ef5f0edabc8c9b729c1d2cdeb4 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := rsdproto.o flash.o
+COBJS  := rsdproto.o flash.o
 SOBJS  := flash_asm.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
 
 distclean:     clean
-       rm -f $(LIB) core *.bak .depend
+       rm -f $(LIB) core *.bak $(obj).depend
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index baefa4a747e9cfac91add4da13b9f899a136806d..2dff242aef137e8fe98e85e3b64f600c64e45146 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := sacsng.o flash.o clkinit.o
+COBJS  := sacsng.o flash.o clkinit.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 8b3173ca1e0de635697d5732d58ed5ec3c1f542b..60d557352e322590dcbd42ae0396ddf3a8958936 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (C) Copyright 2005
 # Sandburst Corporation
 # Travis B. Sawyer
@@ -23,6 +26,9 @@
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
 # TBS: add for debugging purposes
 BUILDUSER := $(shell whoami)
@@ -32,13 +38,16 @@ CFLAGS += -DBUILDUSER='"$(BUILDUSER)"'
 # TBS: end debugging
 
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o ../common/flash.o ../common/ppc440gx_i2c.o \
+COBJS  = $(BOARD).o ../common/flash.o ../common/ppc440gx_i2c.o \
        ../common/sb_common.o
 
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -51,9 +60,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 06a9a22b6ace0274e0fac8f59404ace1f4256fc5..9579512aac235a5e00cadf362f7baf2bd59a7be3 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (C) Copyright 2005
 # Travis B. Sawyer, Sandburst Corporation, tsawyer@sandburst.com
 #
@@ -22,6 +25,9 @@
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+endif
 
 # TBS: add for debugging purposes
 BUILDUSER := $(shell whoami)
@@ -31,12 +37,15 @@ CFLAGS += -DBUILDUSER='"$(BUILDUSER)"'
 # TBS: end debugging
 
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o ../common/flash.o ../common/ppc440gx_i2c.o \
+COBJS  = $(BOARD).o ../common/flash.o ../common/ppc440gx_i2c.o \
        ../common/sb_common.o
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -49,9 +58,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index d6bbf2f297ea09668281289a120e69402a3fe5ad..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS =  $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index ae8665ec3795d11f77adebddd540d91bc8487098..908b5ffd0721fe37725a61f7528dacbf1b9c80bb 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := sbc2410x.o flash.o
+COBJS  := sbc2410x.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index c4198c4fc91fe7df08bd04fa6e416166116da25c..9b9f033f5e1095960d523b35e8f5dca99f60b6bb 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o strataflash.o
+COBJS  = $(BOARD).o strataflash.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 7a2014d466d6fa840b0dfb5ab4e47d726cc4ee81..1b57d2b0236ce949c225b11814dce20ff69e69fd 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 14ed4571104b7a0ddf8e7da359fb46ff2941f4b0..7077a823c0c5964d685e352d5039db7539cb611d 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := sbc8260.o flash.o
+COBJS  := sbc8260.o flash.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index da295fbdf853f73d17f1c88cf12759f4978d0270..4d9c2e7c8c11d8b965d4dd38b08394d5dd1a6617 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2004
+# (C) Copyright 2004-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # (C) Copyright 2004 Wind River Systems Inc <www.windriver.com>.
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o
+COBJS  := $(BOARD).o
 SOBJS  := init.o
 #SOBJS :=
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -43,9 +47,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index ab06ebc81afe4207a293849e31818681085940aa..7555b4f67f4429247308c29104e0b926c455e449 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (C) Copyright 2002
 # Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
 #
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := sc520_cdp.o flash.o
+COBJS  := sc520_cdp.o flash.o
 SOBJS  := sc520_cdp_asm.o sc520_cdp_asm16.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -39,9 +46,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 242d53c42a6b26d08c38c3863cae5143e828f519..9958e80268690ee4de196540dca8013ba985f6fa 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+# 
 # (C) Copyright 2002
 # Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
 #
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := sc520_spunk.o flash.o
+COBJS  := sc520_spunk.o flash.o
 SOBJS  := sc520_spunk_asm.o sc520_spunk_asm16.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -39,9 +46,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 5dc3fd4e476b004ff2af9213823ced8847ae4c73..01b908e936b779e5c324e5032e5ef8fec6d752d4 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := scb9328.o flash.o
+COBJS  := scb9328.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index f66b096a4f7d9039899e248bedb264dda7005731..a04d841ef42e4a12e8e938259572c79f3c162ca9 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := shannon.o flash.o
+COBJS  := shannon.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index ee2fc53bb05e85c0285d7bcebc98ca261ae8ee0e..2ad4c83a9c94240988df6e8231db454051d74b5d 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+$(shell mkdir -p $(obj)../../tqm8xx)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = ccm.o flash.o fpga_ccm.o ../common/fpga.o \
+COBJS  = ccm.o flash.o fpga_ccm.o ../common/fpga.o \
          ../../tqm8xx/load_sernum_ethaddr.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 87a68937205c3cd3429f242973ae7915d5affdd4..39643810a3fb3c6caab2ce48a12813245bfd5367 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o atm.o
+COBJS  = $(BOARD).o flash.o atm.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index af646e4eb9d9372abac98ffa1c0bdc636de6c36b..b4bbb533feb35b6e56f4054103edfa17788f2295 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+$(shell mkdir -p $(obj)../../tqm8xx/)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = scm.o flash.o fpga_scm.o ../common/fpga.o \
+COBJS  = scm.o flash.o fpga_scm.o ../common/fpga.o \
          ../../tqm8xx/load_sernum_ethaddr.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        .depend $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 7a2014d466d6fa840b0dfb5ab4e47d726cc4ee81..1b57d2b0236ce949c225b11814dce20ff69e69fd 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 13ce9fc9d28c852268a69aad84fab55016aedc5a..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 6d112404328131ac6e67f0655720c7422cb8314b..43c27e9babaab545b295c3a5b2ea9c78336e4c86 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001 - 2003
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index fc3d48faeeacf6a5b8385f129dd94554ff51209a..b3cefcf9c9823094829179b312c957cbbe48352b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := smdk2400.o flash.o
+COBJS  := smdk2400.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 4ee21f5977acc6d7c8ee29c3634f7611b0157e3a..65f1a4ddec2f92e2aff73661173e4edabd150bc2 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := smdk2410.o flash.o
+COBJS  := smdk2410.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index e5d844631335d1fac7f0b720d4d935e3dc252e5d..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2003
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 13ce9fc9d28c852268a69aad84fab55016aedc5a..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 3d6d673792a11735b3bd8fd378bcde2662290f09..c59a3be72aaae725f37234bea253918471c177d4 100644 (file)
@@ -1,4 +1,5 @@
-# (C) Copyright 2005
+#
+# (C) Copyright 2005-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
+
+COBJS  := $(BOARD).o
 
-OBJS   := $(BOARD).o
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        $(OBJS) $(SOBJS)
+$(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -37,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 35d6a06084b2aba691011ae7fb055f90f2b995bf..165e9e2999fd48214efa3f4bf17f07ceae59a172 100644 (file)
@@ -33,7 +33,7 @@ long int initdram (int board_type)
 
        size = dramSetup ();
 
-       return get_ram_size((ulong *)CFG_SDRAM_BASE, size);
+       return get_ram_size(CFG_SDRAM_BASE, size);
 }
 
 int checkboard (void)
index 47afef7e6af1ed8888b197a31b362f363f17fa96..2951b96a210d26bf0b3a913bb0720f936a013873 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o
+COBJS  = $(BOARD).o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 13ce9fc9d28c852268a69aad84fab55016aedc5a..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 9182a4ecfee30f6540d73c636a2f2291b7b4a238..77de4fbf8b1602adf24a9ddba065e42b34f136e5 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001-2004
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o flash.o misc.o
+COBJS  := $(BOARD).o flash.o misc.o
+SOBJS  := vectors.o
 
-SOBJS  = vectors.o
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -40,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index ab97e1b484c5d8be69741e97e4e90bc2c9fbd243..8c20543ced3784e4016b8b031d27aebc0eea41e6 100644 (file)
@@ -3,7 +3,7 @@
 #
 # Copyright (c) 2005 blackfin.uclinux.org
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -26,7 +26,7 @@
 #
 
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o stamp.o
-SOBJS  =
+COBJS  = $(BOARD).o stamp.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index d150df831c547aa12e20a89a7228daaf76ec269a..5477ff90f57dfc66e4a99b290908f239f3fab0a4 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o flash.o
+COBJS  := $(BOARD).o flash.o
 SOBJS  := init.o
 #SOBJS :=
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -40,9 +44,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 8c529a0611d101d868c380548d562a17edaecc23..2951b96a210d26bf0b3a913bb0720f936a013873 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o
+COBJS  = $(BOARD).o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 13ce9fc9d28c852268a69aad84fab55016aedc5a..e3d24b3689eff53801df8da321f63193a864f187 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 8fbdf2a5e337c860e3079a7fe77c3554a4ace27a..4e6adac56cd1aea69c28a5f69c8910b39af07369 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2004
+# (C) Copyright 2004-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := sx1.o
+COBJS  := sx1.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 4375073af9b46e19b0535af570a0f6ae0cc8347f..aefaf0da8d81a21a2e59ae9b7d169ed878a4eed4 100644 (file)
@@ -1,7 +1,7 @@
 #
 # (C) Masami Komiya <mkomiya@sonare.it> 2004
 #
-# (C) Copyright 2003-2004
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o vr4131-pci.o
+COBJS  = $(BOARD).o flash.o vr4131-pci.o
 SOBJS  = lowlevel_init.o
 
-$(LIB):        .depend $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 232956a39213681c68ab7a80b1aec59bee7a34a5..4245f98223890885066e22825950b79c67693e93 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003-2004
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o sdram.o
+COBJS  := $(BOARD).o sdram.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 1a7a7cfc1d0dd5e1bb2c554c346fa873261b9002..e7ac93d241dbde8fda393c79980098d57d3b79c6 100644 (file)
@@ -31,7 +31,7 @@
 #      0x00100000   boot from RAM (for testing only)
 #
 
-sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
+sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
 
 ifndef TEXT_BASE
 ## Standard: boot high
index 9a1ea4873e94f5644906d4bd3e663f0a07bbbbb6..d0dde2657c7e347ecc307cdd7c4635a61439e514 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003-2004
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o cmd_stk52xx.o cmd_tb5200.o
+COBJS  := $(BOARD).o cmd_stk52xx.o cmd_tb5200.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 84ddee80d96f9c9e48af93b18783cbfb6e7a2650..d72dfe7481f1f8be8ab50fcb74adb6736f6f8020 100644 (file)
@@ -32,7 +32,7 @@
 #      0x00100000   boot from RAM (for testing only)
 #
 
-sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
+sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
 
 ifndef TEXT_BASE
 ## Standard: boot low
index c8350ab3b5dab9b60566f9d27b2dd9d71587514a..b76579cb43fc55b81ff33b40cf416ff965cfa908 100644 (file)
@@ -446,6 +446,43 @@ int board_early_init_r (void)
 #endif
 #endif /* CONFIG_PS2MULT */
 
+#ifdef CONFIG_FO300
+int silent_boot (void)
+{
+       vu_long timer3_status;
+
+       /* Configure GPT3 as GPIO input */
+       *(vu_long *)MPC5XXX_GPT3_ENABLE = 0x00000004;
+
+       /* Read in TIMER_3 pin status */
+       timer3_status = *(vu_long *)MPC5XXX_GPT3_STATUS;
+
+#ifdef FO300_SILENT_CONSOLE_WHEN_S1_CLOSED
+       /* Force silent console mode if S1 switch
+        * is in closed position (TIMER_3 pin status is LOW). */
+       if (MPC5XXX_GPT_GPIO_PIN(timer3_status) == 0)
+               return 1;
+#else
+       /* Force silent console mode if S1 switch
+        * is in open position (TIMER_3 pin status is HIGH). */
+       if (MPC5XXX_GPT_GPIO_PIN(timer3_status) == 1)
+               return 1;
+#endif
+
+       return 0;
+}
+
+int board_early_init_f (void)
+{
+       DECLARE_GLOBAL_DATA_PTR;
+
+       if (silent_boot())
+               gd->flags |= GD_FLG_SILENT;
+
+       return 0;
+}
+#endif /* CONFIG_FO300 */
+
 int last_stage_init (void)
 {
        /*
@@ -538,6 +575,13 @@ int last_stage_init (void)
                __asm__ volatile ("sync");
        }
 
+#ifdef CONFIG_FO300
+       if (silent_boot()) {
+               setenv("bootdelay", "0");
+               disable_ctrlc(1);
+       }
+#endif
+
        return 0;
 }
 
@@ -729,33 +773,3 @@ int board_get_height (void)
 }
 
 #endif /* CONFIG_VIDEO_SM501 */
-
-
-#ifdef CONFIG_BOARD_EARLY_INIT_F
-#ifdef CONFIG_FO300
-int board_early_init_f (void)
-{
-       vu_long timer3_status;
-       DECLARE_GLOBAL_DATA_PTR;
-
-       /* Configure GPT3 as GPIO input */
-       *(vu_long *)MPC5XXX_GPT3_ENABLE = 0x00000004;
-
-       /* Read in TIMER_3 pin status */
-       timer3_status = *(vu_long *)MPC5XXX_GPT3_STATUS;
-       
-#ifdef FO300_SILENT_CONSOLE_WHEN_S1_CLOSED
-       /* Force silent console mode if S1 switch
-        * is in closed position (TIMER_3 pin status is LOW). */
-       if (MPC5XXX_GPT_GPIO_PIN(timer3_status) == 0)
-#else
-       /* Force silent console mode if S1 switch
-        * is in open position (TIMER_3 pin status is HIGH). */
-       if (MPC5XXX_GPT_GPIO_PIN(timer3_status) == 1)
-#endif
-               gd->flags |= GD_FLG_SILENT;
-
-       return 0;
-}
-#endif
-#endif
index c10b9fee68a3323fb248a34769d31c3d03e9a641..d3adccd669293626b1394885848cc7b135d3e179 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../tqm8xx/)
+endif
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o ../tqm8xx/load_sernum_ethaddr.o
+COBJS  = $(BOARD).o flash.o ../tqm8xx/load_sernum_ethaddr.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 3ecc7d090e2541c82c52d4d62a2b02b3088f19c8..6991cfbf28a3f94ad812d2f1c11ac0de2c7e654e 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+# 
 # Copyright 2004 Freescale Semiconductor, Inc.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o pci.o
+COBJS  = $(BOARD).o pci.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -37,9 +44,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 3933d46f0cabed6404e632c3f3b2414fac9099eb..a6ad98a732f427d64ce2ad173bce5cfe1e962996 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -12,7 +12,7 @@
 #
 # 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
+# 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
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o sdram.o
+COBJS  := $(BOARD).o sdram.o
 SOBJS  := init.o
 #SOBJS :=
 
-$(LIB): $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -40,9 +44,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 2ff9b4dab245633b87526fd0e5b88224abb544c0..312c0c4c881c939fa2e28c6552e2d51985992cdd 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2003
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o load_sernum_ethaddr.o
+COBJS  = $(BOARD).o flash.o load_sernum_ethaddr.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 159404b269aa63c57ae38e659144abdd63de310a..2b918f6397d8575bd650cc58fb997de433f01f3d 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := trab.o flash.o vfd.o cmd_trab.o memory.o tsc2000.o auto_update.o
+COBJS  := trab.o flash.o vfd.o cmd_trab.o memory.o tsc2000.o auto_update.o
 SOBJS  := lowlevel_init.o
 
+COBJS_FKT := trab_fkt.o rs485.o tsc2000.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c) $(COBJS_FKT:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+OBJS_FKT := $(addprefix $(obj),$(COBJS_FKT))
+
 gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
 
 LOAD_ADDR = 0xc100000
 
 #########################################################################
 
-all:   $(LIB) trab_fkt.srec trab_fkt.bin
+all:   $(LIB) $(obj)trab_fkt.srec $(obj)trab_fkt.bin
 
-$(LIB):        $(OBJS) $(SOBJS)
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
-trab_fkt.srec: trab_fkt.o rs485.o tsc2000.o $(LIB)
-       $(LD) -g -Ttext $(LOAD_ADDR) -o $(<:.o=) -e $(<:.o=) $^ $(LIB) \
-               -L../../examples -lstubs \
-               -L../../lib_generic -lgeneric \
+$(obj)trab_fkt.srec:   $(OBJS_FKT) $(LIB)
+       $(LD) -g -Ttext $(LOAD_ADDR) -o $(<:.o=) -e trab_fkt $^ $(LIB) \
+               -L$(obj)../../examples -lstubs \
+               -L$(obj)../../lib_generic -lgeneric \
                -L$(gcclibdir) -lgcc
        $(OBJCOPY) -O srec $(<:.o=) $@
 
-trab_fkt.bin:  trab_fkt.srec
+$(obj)trab_fkt.bin:    $(obj)trab_fkt.srec
        $(OBJCOPY) -I srec -O binary $< $@
 
 clean:
-       rm -f $(SOBJS) $(OBJS)
+       rm -f $(SOBJS) $(OBJS) $(OBJS_FKT)
 
 distclean:     clean
        rm -f $(LIB) core *.bak .depend
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index f2411d009c65606cfef21b4fe478df0c1353d43f..800cc28a11d342a7918012e3e82ae719085c4969 100644 (file)
@@ -19,7 +19,7 @@
 # download areas is 0C80'0000
 #
 
-sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
+sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
 
 ifndef TEXT_BASE
 TEXT_BASE = 0x0DF40000
index 2d2cc23209f50923b784ce3b883399666c50c2d0..a7a93abfe6d9eae9ae87457fc11f4a31cc0eab61 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2003
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-#OBJS  = $(BOARD).o flash.o pcmcia.o
-OBJS   = $(BOARD).o pcmcia.o
+#COBJS = $(BOARD).o flash.o pcmcia.o
+COBJS  = $(BOARD).o pcmcia.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index e698afc7f9b5996e72709b633eee996c4130663c..0664d9f58b01a2f6f69b3413ee6e5e73e8ac9641 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # (C) Copyright 2002
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-SOBJS  =
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        .depend $(OBJS) $(SOBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 7a17067936dc04d655d7a0582e2a4158b2a34ff9..b42026981f5ec0133bede8197f7c62ba8a368e54 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index fbdc627e386869ce57971fe4518afb25adb1afad..27bca10a11c0b85d64ae31218786bf81e95bd925 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := versatile.o flash.o
+COBJS  := versatile.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 576f238adef2f8c895ebe5e7b3aacb6b6ecd39cb..25461c2c01ff1a74c324ef7dff308024ad068684 100755 (executable)
@@ -5,28 +5,30 @@
 # ---------------------------------------------------------
 # Set up the Versatile type define
 # ---------------------------------------------------------
+
+mkdir -p ${obj}include
 variant=PB926EJ-S
 if [ "$1" == "" ]
 then
        echo "$0:: No parameters - using versatilepb_config"
-       echo "#define CONFIG_ARCH_VERSATILE_PB" > ./include/config.h
+       echo "#define CONFIG_ARCH_VERSATILE_PB" > ${obj}include/config.h
        variant=PB926EJ-S
 else
        case "$1" in
        versatilepb_config      |       \
        versatile_config)
-       echo "#define CONFIG_ARCH_VERSATILE_PB" > ./include/config.h
+       echo "#define CONFIG_ARCH_VERSATILE_PB" > ${obj}include/config.h
        ;;
 
        versatileab_config)
-       echo "#define CONFIG_ARCH_VERSATILE_AB" > ./include/config.h
+       echo "#define CONFIG_ARCH_VERSATILE_AB" > ${obj}include/config.h
        variant=AB926EJ-S
        ;;
 
 
        *)
        echo "$0:: Unrecognised config - using versatilepb_config"
-       echo "#define CONFIG_ARCH_VERSATILE_PB" > ./include/config.h
+       echo "#define CONFIG_ARCH_VERSATILE_PB" > ${obj}include/config.h
        variant=PB926EJ-S
        ;;
 
@@ -36,5 +38,5 @@ fi
 # ---------------------------------------------------------
 # Complete the configuration
 # ---------------------------------------------------------
-./mkconfig -a versatile arm arm926ejs versatile NULL versatile
+$MKCONFIG -a versatile arm arm926ejs versatile NULL versatile
 echo "Variant:: $variant"
index 6302fa854ac7cb62dff5124ebecfbb9fe6911335..fa614f8d446bcb83516cfc891a14b5cd30d01a55 100644 (file)
@@ -1,4 +1,4 @@
-# (C) Copyright 2000-2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de
 #
 # (C) Copyright 2005
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := voiceblue.o
+COBJS  := voiceblue.o
 SOBJS  := setup.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c) eeprom.c eeprom_start.S
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
 
 LOAD_ADDR = 0x10400000
 LDSCRIPT = $(TOPDIR)/board/$(BOARDDIR)/eeprom.lds
+lnk = $(if $(obj),$(obj),.)
 
-all:   $(LIB) eeprom.srec eeprom.bin
+all:   $(obj).depend $(LIB) $(obj)eeprom.srec $(obj)eeprom.bin
 
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
-eeprom.srec:   eeprom.o eeprom_start.o
-       $(LD) -T $(LDSCRIPT) -g -Ttext $(LOAD_ADDR) \
-               -o $(<:.o=) -e $(<:.o=) $^ \
-               -L../../examples -lstubs \
-               -L../../lib_generic -lgeneric \
+$(obj)eeprom.srec:     $(obj)eeprom.o $(obj)eeprom_start.o
+       cd $(lnk) && $(LD) -T $(LDSCRIPT) -g -Ttext $(LOAD_ADDR) \
+               -o $(<:.o=) -e eeprom eeprom.o eeprom_start.o \
+               -L$(obj)../../examples -lstubs \
+               -L$(obj)../../lib_generic -lgeneric \
                -L$(gcclibdir) -lgcc
        $(OBJCOPY) -O srec $(<:.o=) $@
 
-eeprom.bin:    eeprom.srec
+$(obj)eeprom.bin:      $(obj)eeprom.srec
        $(OBJCOPY) -I srec -O binary $< $@ 2>/dev/null
 
 clean:
-       rm -f $(SOBJS) $(OBJS) eeprom eeprom.srec eeprom.bin
+       rm -f $(SOBJS) $(OBJS) $(obj)eeprom \
+               $(obj)eeprom.srec $(obj)eeprom.bin \
+               $(obj)eeprom.o $(obj)eeprom_start.o
+
 
 distclean:     clean
        rm -f $(LIB) core config.tmp *.bak .depend
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index b77c91c65ea6d478248c89b8f20bc93df2a61da6..d55daa41d9f35780265bfa2a98bce523bb049bce 100644 (file)
@@ -3,7 +3,7 @@
 # entry 1000'8000 (mem base + reserved)
 #
 
-sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
+sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
 
 ifeq ($(VOICEBLUE_SMALL_FLASH),y)
 # We load ourself to internal SRAM at 2001'2000
index d008f896cdf8cd411c24cce1713b180987499ee4..2ec449d7a6c3c869ff4264609c1c0f5af6ecd99e 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (C) Copyright 2001
 # Erik Theisen, Wave 7 Optics, etheisen@mindspring.com.
 #
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o fpga.o fsboot.o post2.o vpd.o cmd_vpd.o \
+COBJS  = $(BOARD).o flash.o fpga.o fsboot.o post2.o vpd.o cmd_vpd.o \
          watchdog.o
 SOBJS  = init.o post1.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $^
 
@@ -40,9 +47,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 11ad8fbeccd3e6d11fa03c2763d14408c5f3a4e6..b5b5a96f06dc90d5195f53579b78493dea4359a9 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := wepep250.o flash.o
+COBJS  := wepep250.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 7a2014d466d6fa840b0dfb5ab4e47d726cc4ee81..1b57d2b0236ce949c225b11814dce20ff69e69fd 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o flash.o
+COBJS  = $(BOARD).o flash.o
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 7c5f0cd1a1f4d8c9fe1440f976f8d5dd8f082a00..655dc9a58ab73f8b38d238195fb25424131874c8 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := xaeniax.o flash.o
+COBJS  := xaeniax.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 880c494c99f1bb940ce1acf2a31bf0536f9b2852..4ecf37a9c5f486f1ea8282d0bd3fca91aa84663f 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
+#
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../common)
+$(shell mkdir -p $(obj)../xilinx_enet)
+$(shell mkdir -p $(obj)../xilinx_iic)
+endif
 
-CFLAGS   += -I../ml300 -I../common -I../xilinx_enet -I../xilinx_iic
+INCS           := -I../ml300 -I../common -I../xilinx_enet -I../xilinx_iic
+CFLAGS         += $(INCS)
+HOST_CFLAGS    += $(INCS)
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o \
+COBJS  = $(BOARD).o \
          serial.o \
          ../xilinx_enet/emac_adapter.o  ../xilinx_enet/xemac.o \
          ../xilinx_enet/xemac_options.o ../xilinx_enet/xemac_polled.o \
@@ -39,6 +47,10 @@ OBJS = $(BOARD).o \
 
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $^
 
@@ -50,9 +62,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 1b0a3f0178fff944ce67898f103e0abf4aca6d47..22f20243a6d39f810a06835c7ba5fbe624120e1c 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := xm250.o flash.o
+COBJS  := xm250.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $^
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
+       $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index c5c09152d84d3030b4e321d917596ca86dc6dc39..5f3e34e246816ffd9af5c145cf3bfa7d17e1266a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2002-2004
+# (C) Copyright 2002-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o
-OBJS +=flash.o
+COBJS  = $(BOARD).o flash.o
 SOBJS  = init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS)
 
@@ -40,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index ed1464af3e948ad4e9d7252d0867e41a349e3ba4..78ca9d6088cfb454eff80d7eadec9a01a8bc7141 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := xsengine.o flash.o
+COBJS  := xsengine.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -39,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index 8b10993194e85a4ce1dfc3a7e5698a3e73f6a241..e880f873af4b8a512f100b64a7fb2741133ba35b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o
+COBJS  := $(BOARD).o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -38,9 +42,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index f3ad67458ea2503ff205f9f01e5c03397190417f..4b70f704c1f57e28a1e62acb953abfa7442edeea 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
+
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := zylonite.o nand.o
+COBJS  := zylonite.o nand.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -38,9 +43,9 @@ distclean:    clean
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
index b5d5955ef5ddd9e6589d0fe0c87a7b10c53899fa..09b0f715573cfd62c1e78f5ed128850fbf736a59 100644 (file)
@@ -2,5 +2,3 @@
 #TEXT_BASE = 0xa1700000
 #TEXT_BASE = 0xa3080000
 TEXT_BASE = 0xa3008000
-
-BOARDLIBS = drivers/nand/libnand.a
index a62bc16e85d8032ef7c78573e577829f965867aa..5ff8f93503bc83e5145129f8d8fae5a32970daba 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2004
+# (C) Copyright 2004-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -23,7 +23,7 @@
 
 include $(TOPDIR)/config.mk
 
-LIB    = libcommon.a
+LIB    = $(obj)libcommon.a
 
 AOBJS  =
 
@@ -53,28 +53,29 @@ COBJS       = main.o ACEX1K.o altera.o bedbug.o circbuf.o \
          usb.o usb_kbd.o usb_storage.o \
          virtex2.o xilinx.o crc16.o xyzModem.o cmd_mac.o
 
-OBJS   = $(AOBJS) $(COBJS)
+SRCS   := $(AOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(AOBJS) $(COBJS))
 
 CPPFLAGS += -I..
 
 all:   $(LIB) $(AOBJS)
 
-$(LIB): .depend $(OBJS)
+$(LIB): $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
-environment.o: environment.c ../tools/envcrc
+$(obj)environment.o: $(src)environment.c $(obj)../tools/envcrc
        $(CC) $(AFLAGS) -Wa,--no-warn \
-               -DENV_CRC=$(shell ../tools/envcrc) \
-               -c -o $@ environment.c
+               -DENV_CRC=$(shell $(obj)../tools/envcrc) \
+               -c -o $@ $(src)environment.c
 
-../tools/envcrc:
+$(obj)../tools/envcrc:
        $(MAKE) -C ../tools
 
 #########################################################################
 
-.depend:       Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 256e4bc7968074b38beaaf247b719f2597db6b0d..70de795deed136f0dd99aea2427350a2355b086e 100644 (file)
@@ -62,11 +62,13 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 #if defined(CONFIG_405GP) || defined(CONFIG_405CR) || \
     defined(CONFIG_405EP) || defined(CONFIG_XILINX_ML300) || \
     defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
-       defined(CONFIG_440SP)
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX) ||        \
+    defined(CONFIG_440SP) || defined(CONFIG_440SPE)
        print_str ("procfreq",      strmhz(buf, bd->bi_procfreq));
        print_str ("plb_busfreq",   strmhz(buf, bd->bi_plb_busfreq));
 #if defined(CONFIG_405GP) || defined(CONFIG_405EP) || defined(CONFIG_XILINX_ML300) || \
-    defined(CONFIG_440EP) || defined(CONFIG_440GR) || defined(CONFIG_440SPE)
+    defined(CONFIG_440EP) || defined(CONFIG_440GR) || defined(CONFIG_440SPE) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
        print_str ("pci_busfreq",   strmhz(buf, bd->bi_pci_busfreq));
 #endif
 #else  /* ! CONFIG_405GP, CONFIG_405CR, CONFIG_405EP, CONFIG_XILINX_ML300, CONFIG_440EP CONFIG_440GR */
index 201c3c1553c3451c7f4402c7ad3a0127ad38bf9b..b5fd41724f6a4eb3c831e37d69765ebb1e3d02c7 100644 (file)
@@ -1268,7 +1268,7 @@ static void list_partitions(void)
                part_num = 0;
                list_for_each(pentry, &dev->parts) {
                        part = list_entry(pentry, struct part_info, link);
-                       printf(" %d: %-22s\t0x%08x\t0x%08x\t%d\n",
+                       printf("%2d: %-20s0x%08x\t0x%08x\t%d\n",
                                        part_num, part->name, part->size,
                                        part->offset, part->mask_flags);
 
index 0a05b09a7a8515622edee793710b16a7f323e536..67c4a4e011761b92b92f291714cf9af4181696d3 100644 (file)
@@ -2,7 +2,7 @@
  * (C) Copyright 2004
  * Jian Zhang, Texas Instruments, jzhang@ti.com.
 
- * (C) Copyright 2000-2004
+ * (C) Copyright 2000-2006
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
  * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH <www.elinos.com>
@@ -76,7 +76,9 @@ env_t *env_ptr = 0;
 
 
 /* local functions */
+#if !defined(ENV_IS_EMBEDDED)
 static void use_default(void);
+#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -91,11 +93,55 @@ uchar env_get_char_spec (int index)
  * Mark it OK for now. env_relocate() in env_common.c
  * will call our relocate function which will does
  * the real validation.
+ *
+ * When using a NAND boot image (like sequoia_nand), the environment
+ * can be embedded or attached to the U-Boot image in NAND flash. This way
+ * the SPL loads not only the U-Boot image from NAND but also the
+ * environment.
  */
 int env_init(void)
 {
+#if defined(ENV_IS_EMBEDDED)
+       ulong total;
+       int crc1_ok = 0, crc2_ok = 0;
+       env_t *tmp_env1, *tmp_env2;
+
+       total = CFG_ENV_SIZE;
+
+       tmp_env1 = env_ptr;
+       tmp_env2 = (env_t *)((ulong)env_ptr + CFG_ENV_SIZE);
+
+       crc1_ok = (crc32(0, tmp_env1->data, ENV_SIZE) == tmp_env1->crc);
+       crc2_ok = (crc32(0, tmp_env2->data, ENV_SIZE) == tmp_env2->crc);
+
+       if (!crc1_ok && !crc2_ok)
+               gd->env_valid = 0;
+       else if(crc1_ok && !crc2_ok)
+               gd->env_valid = 1;
+       else if(!crc1_ok && crc2_ok)
+               gd->env_valid = 2;
+       else {
+               /* both ok - check serial */
+               if(tmp_env1->flags == 255 && tmp_env2->flags == 0)
+                       gd->env_valid = 2;
+               else if(tmp_env2->flags == 255 && tmp_env1->flags == 0)
+                       gd->env_valid = 1;
+               else if(tmp_env1->flags > tmp_env2->flags)
+                       gd->env_valid = 1;
+               else if(tmp_env2->flags > tmp_env1->flags)
+                       gd->env_valid = 2;
+               else /* flags are equal - almost impossible */
+                       gd->env_valid = 1;
+       }
+
+       if (gd->env_valid == 1)
+               env_ptr = tmp_env1;
+       else if (gd->env_valid == 2)
+               env_ptr = tmp_env2;
+#else /* ENV_IS_EMBEDDED */
        gd->env_addr  = (ulong)&default_environment[0];
        gd->env_valid = 1;
+#endif /* ENV_IS_EMBEDDED */
 
        return (0);
 }
@@ -236,6 +282,7 @@ void env_relocate_spec (void)
 }
 #endif /* CFG_ENV_OFFSET_REDUND */
 
+#if !defined(ENV_IS_EMBEDDED)
 static void use_default()
 {
        puts ("*** Warning - bad CRC or NAND, using default environment\n\n");
@@ -253,5 +300,6 @@ static void use_default()
        gd->env_valid = 1;
 
 }
+#endif
 
 #endif /* CFG_ENV_IS_IN_NAND */
index 81471ce71cd80410d3eaa784d28fdfc4c782d88e..19bdeb0f62a20a98ebea3f6c6c59685aa1505922 100644 (file)
@@ -60,7 +60,8 @@
      defined(CONFIG_RRVISION)  || \
      defined(CONFIG_TRAB)      || \
      defined(CONFIG_PPCHAMELEONEVB) || \
-     defined(CONFIG_M5271EVB)) && \
+     defined(CONFIG_M5271EVB)  || \
+     defined(CONFIG_NAND_U_BOOT))      && \
      defined(ENV_CRC) /* Environment embedded in U-Boot .ppcenv section */
 /* XXX - This only works with GNU C */
 #  define __PPCENV__ __attribute__ ((section(".ppcenv")))
index ef253381697bad29490770936869e62e082fb237..0cb4396ea4ae0a73e781729fe0c267bc40e7bc24 100644 (file)
@@ -23,8 +23,11 @@ void jumptable_init (void)
        gd->jt[XF_get_version] = (void *) get_version;
        gd->jt[XF_malloc] = (void *) malloc;
        gd->jt[XF_free] = (void *) free;
-       gd->jt[XF_get_timer] = (void *)get_timer;
-       gd->jt[XF_udelay] = (void *)udelay;
+       gd->jt[XF_getenv] = (void *) getenv;
+       gd->jt[XF_setenv] = (void *) setenv;
+       gd->jt[XF_get_timer] = (void *) get_timer;
+       gd->jt[XF_simple_strtoul] = (void *) simple_strtoul;
+       gd->jt[XF_udelay] = (void *) udelay;
 #if defined(CONFIG_I386) || defined(CONFIG_PPC)
        gd->jt[XF_install_hdlr] = (void *) irq_install_handler;
        gd->jt[XF_free_hdlr] = (void *) irq_free_handler;
index 0be1912a359e56dfb1b1f63139e8633764793902..d79350f2347c709b0f78bbcb60e5877c737f583a 100644 (file)
@@ -585,6 +585,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
        uchar *bmap;
        ushort padded_line;
        unsigned long width, height;
+       unsigned long pwidth = panel_info.vl_col;
        unsigned colors,bpix;
        unsigned long compression;
 #if defined(CONFIG_PXA250)
@@ -628,6 +629,8 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
                cmap = (ushort *)fbi->palette;
 #elif defined(CONFIG_MPC823)
                cmap = (ushort *)&(cp->lcd_cmap[255*sizeof(ushort)]);
+#elif defined(CONFIG_MCC200)
+               /* MCC200 LCD doesn't need CMAP, supports 1bpp b&w only */
 #else
 # error "Don't know location of color map"
 #endif
@@ -652,9 +655,28 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
                }
        }
 
+       /*
+        *  BMP format for Monochrome assumes that the state of a
+        * pixel is described on a per Bit basis, not per Byte.
+        *  So, in case of Monochrome BMP we should align widths
+        * on a byte boundary and convert them from Bit to Byte
+        * units.
+        *  Probably, PXA250 and MPC823 process 1bpp BMP images in 
+        * their own ways, so make the converting to be MCC200 
+        * specific.
+        */
+#if defined(CONFIG_MCC200)
+       if (bpix==1)
+       {
+               width = ((width + 7) & ~7) >> 3;
+               x     = ((x + 7) & ~7) >> 3;
+               pwidth= ((pwidth + 7) & ~7) >> 3;
+       }
+#endif
+
        padded_line = (width&0x3) ? ((width&~0x3)+4) : (width);
-       if ((x + width)>panel_info.vl_col)
-               width = panel_info.vl_col - x;
+       if ((x + width)>pwidth)
+               width = pwidth - x;
        if ((y + height)>panel_info.vl_row)
                height = panel_info.vl_row - y;
 
@@ -666,7 +688,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)
                for (j = 0; j < width ; j++)
 #if defined(CONFIG_PXA250)
                        *(fb++)=*(bmap++);
-#elif defined(CONFIG_MPC823)
+#elif defined(CONFIG_MPC823) || defined(CONFIG_MCC200)
                        *(fb++)=255-*(bmap++);
 #endif
                bmap += (width - padded_line);
index 38057d21f6cafc0e026dc2e693d85b6becd76a34..605d4e34be0a681d8d3eb535e3d067188e1c6205 100644 (file)
@@ -42,7 +42,19 @@ struct serial_device *default_serial_console (void)
        return &serial_scc_device;
 #elif defined(CONFIG_405GP) || defined(CONFIG_405CR) || defined(CONFIG_440) \
    || defined(CONFIG_405EP) || defined(CONFIG_MPC5xxx)
-#if defined(CONFIG_UART1_CONSOLE)
+#if defined(CONFIG_CONS_INDEX) && defined(CFG_NS16550_SERIAL)
+#if (CONFIG_CONS_INDEX==1)
+       return &eserial1_device;
+#elif (CONFIG_CONS_INDEX==2)
+       return &eserial2_device;
+#elif (CONFIG_CONS_INDEX==3)
+       return &eserial3_device;
+#elif (CONFIG_CONS_INDEX==4)
+       return &eserial4_device;
+#else
+#error "Bad CONFIG_CONS_INDEX."
+#endif
+#elif defined(CONFIG_UART1_CONSOLE)
                return &serial1_device;
 #else
                return &serial0_device;
@@ -84,6 +96,20 @@ void serial_initialize (void)
        serial_register(&serial1_device);
 #endif
 
+#if defined(CFG_NS16550_SERIAL)
+#if defined(CFG_NS16550_COM1)
+       serial_register(&eserial1_device);
+#endif
+#if defined(CFG_NS16550_COM2)
+       serial_register(&eserial2_device);
+#endif
+#if defined(CFG_NS16550_COM3)
+       serial_register(&eserial3_device);
+#endif
+#if defined(CFG_NS16550_COM4)
+       serial_register(&eserial4_device);
+#endif
+#endif /* CFG_NS16550_SERIAL */
        serial_assign (default_serial_console ()->name);
 }
 
index e64470cb91f5f31a32f043eb78990389ddedb34f..69ecf1878420128f94136a475a0741babfdd03b9 100644 (file)
@@ -916,6 +916,28 @@ static int usb_read_10(ccb *srb,struct us_data *ss, unsigned long start, unsigne
 }
 
 
+#ifdef CONFIG_USB_BIN_FIXUP
+/*
+ * Some USB storage devices queried for SCSI identification data respond with
+ * binary strings, which if output to the console freeze the terminal. The
+ * workaround is to modify the vendor and product strings read from such
+ * device with proper values (as reported by 'usb info').
+ *
+ * Vendor and product length limits are taken from the definition of
+ * block_dev_desc_t in include/part.h.
+ */
+static void usb_bin_fixup(struct usb_device_descriptor descriptor,
+                               unsigned char vendor[],
+                               unsigned char product[]) {
+       const unsigned char max_vendor_len = 40;
+       const unsigned char max_product_len = 20;
+       if (descriptor.idVendor == 0x0424 && descriptor.idProduct == 0x223a) {
+               strncpy(vendor, "SMSC", max_vendor_len);
+               strncpy(product, "Flash Media Cntrller", max_product_len);
+       }
+}
+#endif /* CONFIG_USB_BIN_FIXUP */
+
 #define USB_MAX_READ_BLK 20
 
 unsigned long usb_stor_read(int device, unsigned long blknr, unsigned long blkcnt, unsigned long *buffer)
@@ -1171,6 +1193,9 @@ int usb_stor_get_info(struct usb_device *dev,struct us_data *ss,block_dev_desc_t
        dev_desc->vendor[8] = 0;
        dev_desc->product[16] = 0;
        dev_desc->revision[4] = 0;
+#ifdef CONFIG_USB_BIN_FIXUP
+       usb_bin_fixup(dev->descriptor, dev_desc->vendor, dev_desc->product);
+#endif /* CONFIG_USB_BIN_FIXUP */
        USB_STOR_PRINTF("ISO Vers %X, Response Data %X\n",usb_stor_buf[2],usb_stor_buf[3]);
        if(usb_test_unit_ready(pccb,ss)) {
                printf("Device NOT ready\n   Request Sense returned %02X %02X %02X\n",pccb->sense_buf[2],pccb->sense_buf[12],pccb->sense_buf[13]);
index d1d66e8bb30d5991f8e3908de754bcdfc5a5a4b8..a209dfa4af73d134bcf647511ad6cd7fabe9406f 100644 (file)
 #define BSP 0x08
 #define NAK 0x15
 #define CAN 0x18
-#define EOF 0x1A  /* ^Z for DOS officionados */
+#define EOF 0x1A               /* ^Z for DOS officionados */
 
 #define USE_YMODEM_LENGTH
 
 /* Data & state local to the protocol */
-static struct {
+static struct
+{
 #ifdef REDBOOT
-    hal_virtual_comm_table_t* __chan;
+  hal_virtual_comm_table_t *__chan;
 #else
-    int *__chan;
+  int *__chan;
 #endif
-    unsigned char pkt[1024], *bufp;
-    unsigned char blk,cblk,crc1,crc2;
-    unsigned char next_blk;  /* Expected block */
-    int len, mode, total_retries;
-    int total_SOH, total_STX, total_CAN;
-    bool crc_mode, at_eof, tx_ack;
+  unsigned char pkt[1024], *bufp;
+  unsigned char blk, cblk, crc1, crc2;
+  unsigned char next_blk;      /* Expected block */
+  int len, mode, total_retries;
+  int total_SOH, total_STX, total_CAN;
+  bool crc_mode, at_eof, tx_ack;
 #ifdef USE_YMODEM_LENGTH
-    unsigned long file_length, read_length;
+  unsigned long file_length, read_length;
 #endif
 } xyz;
 
-#define xyzModem_CHAR_TIMEOUT            2000  /* 2 seconds */
+#define xyzModem_CHAR_TIMEOUT            2000  /* 2 seconds */
 #define xyzModem_MAX_RETRIES             20
 #define xyzModem_MAX_RETRIES_WITH_CRC    10
-#define xyzModem_CAN_COUNT                3    /* Wait for 3 CAN before quitting */
+#define xyzModem_CAN_COUNT                3    /* Wait for 3 CAN before quitting */
 
 
-#ifndef REDBOOT  /*SB */
+#ifndef REDBOOT                        /*SB */
 typedef int cyg_int32;
-int CYGACC_COMM_IF_GETC_TIMEOUT (char chan,char *c) {
+int
+CYGACC_COMM_IF_GETC_TIMEOUT (char chan, char *c)
+{
 #define DELAY 20
-       unsigned long counter=0;
-       while (!tstc() && (counter < xyzModem_CHAR_TIMEOUT*1000/DELAY)) {
-               udelay(DELAY);
-               counter++;
-       }
-       if (tstc()) {
-               *c=getc();
-               return 1;
-       }
-       return 0;
+  unsigned long counter = 0;
+  while (!tstc () && (counter < xyzModem_CHAR_TIMEOUT * 1000 / DELAY))
+    {
+      udelay (DELAY);
+      counter++;
+    }
+  if (tstc ())
+    {
+      *c = getc ();
+      return 1;
+    }
+  return 0;
 }
 
-void CYGACC_COMM_IF_PUTC(char x,char y) {
-       putc(y);
+void
+CYGACC_COMM_IF_PUTC (char x, char y)
+{
+  putc (y);
 }
 
 /* Validate a hex character */
 __inline__ static bool
-_is_hex(char c)
+_is_hex (char c)
 {
-    return (((c >= '0') && (c <= '9')) ||
-            ((c >= 'A') && (c <= 'F')) ||
-            ((c >= 'a') && (c <= 'f')));
+  return (((c >= '0') && (c <= '9')) ||
+         ((c >= 'A') && (c <= 'F')) || ((c >= 'a') && (c <= 'f')));
 }
 
 /* Convert a single hex nibble */
 __inline__ static int
-_from_hex(char c)
+_from_hex (char c)
 {
-    int ret = 0;
-
-    if ((c >= '0') && (c <= '9')) {
-        ret = (c - '0');
-    } else if ((c >= 'a') && (c <= 'f')) {
-        ret = (c - 'a' + 0x0a);
-    } else if ((c >= 'A') && (c <= 'F')) {
-        ret = (c - 'A' + 0x0A);
+  int ret = 0;
+
+  if ((c >= '0') && (c <= '9'))
+    {
+      ret = (c - '0');
+    }
+  else if ((c >= 'a') && (c <= 'f'))
+    {
+      ret = (c - 'a' + 0x0a);
     }
-    return ret;
+  else if ((c >= 'A') && (c <= 'F'))
+    {
+      ret = (c - 'A' + 0x0A);
+    }
+  return ret;
 }
 
 /* Convert a character to lower case */
 __inline__ static char
-_tolower(char c)
+_tolower (char c)
 {
-    if ((c >= 'A') && (c <= 'Z')) {
-        c = (c - 'A') + 'a';
+  if ((c >= 'A') && (c <= 'Z'))
+    {
+      c = (c - 'A') + 'a';
     }
-    return c;
+  return c;
 }
 
 /* Parse (scan) a number */
 bool
-parse_num(char *s, unsigned long *val, char **es, char *delim)
+parse_num (char *s, unsigned long *val, char **es, char *delim)
 {
-    bool first = true;
-    int radix = 10;
-    char c;
-    unsigned long result = 0;
-    int digit;
-
-    while (*s == ' ') s++;
-    while (*s) {
-        if (first && (s[0] == '0') && (_tolower(s[1]) == 'x')) {
-            radix = 16;
-            s += 2;
-        }
-        first = false;
-        c = *s++;
-        if (_is_hex(c) && ((digit = _from_hex(c)) < radix)) {
-            /* Valid digit */
+  bool first = true;
+  int radix = 10;
+  char c;
+  unsigned long result = 0;
+  int digit;
+
+  while (*s == ' ')
+    s++;
+  while (*s)
+    {
+      if (first && (s[0] == '0') && (_tolower (s[1]) == 'x'))
+       {
+         radix = 16;
+         s += 2;
+       }
+      first = false;
+      c = *s++;
+      if (_is_hex (c) && ((digit = _from_hex (c)) < radix))
+       {
+         /* Valid digit */
 #ifdef CYGPKG_HAL_MIPS
-            /* FIXME: tx49 compiler generates 0x2539018 for MUL which */
-            /* isn't any good. */
-            if (16 == radix)
-                result = result << 4;
-            else
-                result = 10 * result;
-            result += digit;
+         /* FIXME: tx49 compiler generates 0x2539018 for MUL which */
+         /* isn't any good. */
+         if (16 == radix)
+           result = result << 4;
+         else
+           result = 10 * result;
+         result += digit;
 #else
-            result = (result * radix) + digit;
+         result = (result * radix) + digit;
 #endif
-        } else {
-            if (delim != (char *)0) {
-                /* See if this character is one of the delimiters */
-                char *dp = delim;
-                while (*dp && (c != *dp)) dp++;
-                if (*dp) break;  /* Found a good delimiter */
-            }
-            return false;  /* Malformatted number */
-        }
+       }
+      else
+       {
+         if (delim != (char *) 0)
+           {
+             /* See if this character is one of the delimiters */
+             char *dp = delim;
+             while (*dp && (c != *dp))
+               dp++;
+             if (*dp)
+               break;          /* Found a good delimiter */
+           }
+         return false;         /* Malformatted number */
+       }
     }
-    *val = result;
-    if (es != (char **)0) {
-        *es = s;
+  *val = result;
+  if (es != (char **) 0)
+    {
+      *es = s;
     }
-    return true;
+  return true;
 }
 
 #endif
@@ -211,24 +233,26 @@ parse_num(char *s, unsigned long *val, char **es, char *delim)
  * messages.
  */
 static int
-zm_dprintf(char *fmt, ...)
+zm_dprintf (char *fmt, ...)
 {
-    int cur_console;
-    va_list args;
+  int cur_console;
+  va_list args;
 
-    va_start(args, fmt);
+  va_start (args, fmt);
 #ifdef REDBOOT
-    cur_console = CYGACC_CALL_IF_SET_CONSOLE_COMM(CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT);
-    CYGACC_CALL_IF_SET_CONSOLE_COMM(1);
+  cur_console =
+    CYGACC_CALL_IF_SET_CONSOLE_COMM
+    (CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT);
+  CYGACC_CALL_IF_SET_CONSOLE_COMM (1);
 #endif
-    diag_vprintf(fmt, args);
+  diag_vprintf (fmt, args);
 #ifdef REDBOOT
-    CYGACC_CALL_IF_SET_CONSOLE_COMM(cur_console);
+  CYGACC_CALL_IF_SET_CONSOLE_COMM (cur_console);
 #endif
 }
 
 static void
-zm_flush(void)
+zm_flush (void)
 {
 }
 
@@ -238,42 +262,43 @@ zm_flush(void)
  */
 #define FINAL
 #ifdef FINAL
-static char *zm_out = (char *)0x00380000;
-static char *zm_out_start = (char *)0x00380000;
+static char *zm_out = (char *) 0x00380000;
+static char *zm_out_start = (char *) 0x00380000;
 #else
 static char zm_buf[8192];
-static char *zm_out=zm_buf;
+static char *zm_out = zm_buf;
 static char *zm_out_start = zm_buf;
 
 #endif
 static int
-zm_dprintf(char *fmt, ...)
+zm_dprintf (char *fmt, ...)
 {
-    int len;
-    va_list args;
+  int len;
+  va_list args;
 
-    va_start(args, fmt);
-    len = diag_vsprintf(zm_out, fmt, args);
-    zm_out += len;
-    return len;
+  va_start (args, fmt);
+  len = diag_vsprintf (zm_out, fmt, args);
+  zm_out += len;
+  return len;
 }
 
 static void
-zm_flush(void)
+zm_flush (void)
 {
 #ifdef REDBOOT
-    char *p = zm_out_start;
-    while (*p) mon_write_char(*p++);
+  char *p = zm_out_start;
+  while (*p)
+    mon_write_char (*p++);
 #endif
-    zm_out = zm_out_start;
+  zm_out = zm_out_start;
 }
 #endif
 
 static void
-zm_dump_buf(void *buf, int len)
+zm_dump_buf (void *buf, int len)
 {
 #ifdef REDBOOT
-    diag_vdump_buf_with_offset(zm_dprintf, buf, len, 0);
+  diag_vdump_buf_with_offset (zm_dprintf, buf, len, 0);
 #else
 
 #endif
@@ -283,22 +308,22 @@ static unsigned char zm_buf[2048];
 static unsigned char *zm_bp;
 
 static void
-zm_new(void)
+zm_new (void)
 {
-    zm_bp = zm_buf;
+  zm_bp = zm_buf;
 }
 
 static void
-zm_save(unsigned char c)
+zm_save (unsigned char c)
 {
-    *zm_bp++ = c;
+  *zm_bp++ = c;
 }
 
 static void
-zm_dump(int line)
+zm_dump (int line)
 {
-    zm_dprintf("Packet at line: %d\n", line);
-    zm_dump_buf(zm_buf, zm_bp-zm_buf);
+  zm_dprintf ("Packet at line: %d\n", line);
+  zm_dump_buf (zm_buf, zm_bp - zm_buf);
 }
 
 #define ZM_DEBUG(x) x
@@ -308,439 +333,517 @@ zm_dump(int line)
 
 /* Wait for the line to go idle */
 static void
-xyzModem_flush(void)
+xyzModem_flush (void)
 {
-    int res;
-    char c;
-    while (true) {
-        res = CYGACC_COMM_IF_GETC_TIMEOUT(*xyz.__chan, &c);
-        if (!res) return;
+  int res;
+  char c;
+  while (true)
+    {
+      res = CYGACC_COMM_IF_GETC_TIMEOUT (*xyz.__chan, &c);
+      if (!res)
+       return;
     }
 }
 
 static int
-xyzModem_get_hdr(void)
+xyzModem_get_hdr (void)
 {
-    char c;
-    int res;
-    bool hdr_found = false;
-    int i, can_total, hdr_chars;
-    unsigned short cksum;
-
-    ZM_DEBUG(zm_new());
-    /* Find the start of a header */
-    can_total = 0;
-    hdr_chars = 0;
-
-    if (xyz.tx_ack) {
-        CYGACC_COMM_IF_PUTC(*xyz.__chan, ACK);
-        xyz.tx_ack = false;
+  char c;
+  int res;
+  bool hdr_found = false;
+  int i, can_total, hdr_chars;
+  unsigned short cksum;
+
+  ZM_DEBUG (zm_new ());
+  /* Find the start of a header */
+  can_total = 0;
+  hdr_chars = 0;
+
+  if (xyz.tx_ack)
+    {
+      CYGACC_COMM_IF_PUTC (*xyz.__chan, ACK);
+      xyz.tx_ack = false;
     }
-    while (!hdr_found) {
-        res = CYGACC_COMM_IF_GETC_TIMEOUT(*xyz.__chan, &c);
-        ZM_DEBUG(zm_save(c));
-        if (res) {
-            hdr_chars++;
-            switch (c) {
-            case SOH:
-                xyz.total_SOH++;
-            case STX:
-                if (c == STX) xyz.total_STX++;
-                hdr_found = true;
-                break;
-            case CAN:
-                xyz.total_CAN++;
-                ZM_DEBUG(zm_dump(__LINE__));
-                if (++can_total == xyzModem_CAN_COUNT) {
-                    return xyzModem_cancel;
-                } else {
-                    /* Wait for multiple CAN to avoid early quits */
-                    break;
-                }
-            case EOT:
-                /* EOT only supported if no noise */
-                if (hdr_chars == 1) {
-                    CYGACC_COMM_IF_PUTC(*xyz.__chan, ACK);
-                    ZM_DEBUG(zm_dprintf("ACK on EOT #%d\n", __LINE__));
-                    ZM_DEBUG(zm_dump(__LINE__));
-                    return xyzModem_eof;
-                }
-            default:
-                /* Ignore, waiting for start of header */
-                ;
-            }
-        } else {
-            /* Data stream timed out */
-            xyzModem_flush();  /* Toss any current input */
-            ZM_DEBUG(zm_dump(__LINE__));
-            CYGACC_CALL_IF_DELAY_US((cyg_int32)250000);
-            return xyzModem_timeout;
-        }
+  while (!hdr_found)
+    {
+      res = CYGACC_COMM_IF_GETC_TIMEOUT (*xyz.__chan, &c);
+      ZM_DEBUG (zm_save (c));
+      if (res)
+       {
+         hdr_chars++;
+         switch (c)
+           {
+           case SOH:
+             xyz.total_SOH++;
+           case STX:
+             if (c == STX)
+               xyz.total_STX++;
+             hdr_found = true;
+             break;
+           case CAN:
+             xyz.total_CAN++;
+             ZM_DEBUG (zm_dump (__LINE__));
+             if (++can_total == xyzModem_CAN_COUNT)
+               {
+                 return xyzModem_cancel;
+               }
+             else
+               {
+                 /* Wait for multiple CAN to avoid early quits */
+                 break;
+               }
+           case EOT:
+             /* EOT only supported if no noise */
+             if (hdr_chars == 1)
+               {
+                 CYGACC_COMM_IF_PUTC (*xyz.__chan, ACK);
+                 ZM_DEBUG (zm_dprintf ("ACK on EOT #%d\n", __LINE__));
+                 ZM_DEBUG (zm_dump (__LINE__));
+                 return xyzModem_eof;
+               }
+           default:
+             /* Ignore, waiting for start of header */
+             ;
+           }
+       }
+      else
+       {
+         /* Data stream timed out */
+         xyzModem_flush ();    /* Toss any current input */
+         ZM_DEBUG (zm_dump (__LINE__));
+         CYGACC_CALL_IF_DELAY_US ((cyg_int32) 250000);
+         return xyzModem_timeout;
+       }
     }
 
-    /* Header found, now read the data */
-    res = CYGACC_COMM_IF_GETC_TIMEOUT(*xyz.__chan, (char *)&xyz.blk);
-    ZM_DEBUG(zm_save(xyz.blk));
-    if (!res) {
-        ZM_DEBUG(zm_dump(__LINE__));
-        return xyzModem_timeout;
+  /* Header found, now read the data */
+  res = CYGACC_COMM_IF_GETC_TIMEOUT (*xyz.__chan, (char *) &xyz.blk);
+  ZM_DEBUG (zm_save (xyz.blk));
+  if (!res)
+    {
+      ZM_DEBUG (zm_dump (__LINE__));
+      return xyzModem_timeout;
     }
-    res = CYGACC_COMM_IF_GETC_TIMEOUT(*xyz.__chan, (char *)&xyz.cblk);
-    ZM_DEBUG(zm_save(xyz.cblk));
-    if (!res) {
-        ZM_DEBUG(zm_dump(__LINE__));
-        return xyzModem_timeout;
+  res = CYGACC_COMM_IF_GETC_TIMEOUT (*xyz.__chan, (char *) &xyz.cblk);
+  ZM_DEBUG (zm_save (xyz.cblk));
+  if (!res)
+    {
+      ZM_DEBUG (zm_dump (__LINE__));
+      return xyzModem_timeout;
     }
-    xyz.len = (c == SOH) ? 128 : 1024;
-    xyz.bufp = xyz.pkt;
-    for (i = 0;  i < xyz.len;  i++) {
-        res = CYGACC_COMM_IF_GETC_TIMEOUT(*xyz.__chan, &c);
-        ZM_DEBUG(zm_save(c));
-        if (res) {
-            xyz.pkt[i] = c;
-        } else {
-            ZM_DEBUG(zm_dump(__LINE__));
-            return xyzModem_timeout;
-        }
+  xyz.len = (c == SOH) ? 128 : 1024;
+  xyz.bufp = xyz.pkt;
+  for (i = 0; i < xyz.len; i++)
+    {
+      res = CYGACC_COMM_IF_GETC_TIMEOUT (*xyz.__chan, &c);
+      ZM_DEBUG (zm_save (c));
+      if (res)
+       {
+         xyz.pkt[i] = c;
+       }
+      else
+       {
+         ZM_DEBUG (zm_dump (__LINE__));
+         return xyzModem_timeout;
+       }
     }
-    res = CYGACC_COMM_IF_GETC_TIMEOUT(*xyz.__chan, (char *)&xyz.crc1);
-    ZM_DEBUG(zm_save(xyz.crc1));
-    if (!res) {
-        ZM_DEBUG(zm_dump(__LINE__));
-        return xyzModem_timeout;
+  res = CYGACC_COMM_IF_GETC_TIMEOUT (*xyz.__chan, (char *) &xyz.crc1);
+  ZM_DEBUG (zm_save (xyz.crc1));
+  if (!res)
+    {
+      ZM_DEBUG (zm_dump (__LINE__));
+      return xyzModem_timeout;
     }
-    if (xyz.crc_mode) {
-        res = CYGACC_COMM_IF_GETC_TIMEOUT(*xyz.__chan, (char *)&xyz.crc2);
-        ZM_DEBUG(zm_save(xyz.crc2));
-        if (!res) {
-            ZM_DEBUG(zm_dump(__LINE__));
-            return xyzModem_timeout;
-        }
+  if (xyz.crc_mode)
+    {
+      res = CYGACC_COMM_IF_GETC_TIMEOUT (*xyz.__chan, (char *) &xyz.crc2);
+      ZM_DEBUG (zm_save (xyz.crc2));
+      if (!res)
+       {
+         ZM_DEBUG (zm_dump (__LINE__));
+         return xyzModem_timeout;
+       }
     }
-    ZM_DEBUG(zm_dump(__LINE__));
-    /* Validate the message */
-    if ((xyz.blk ^ xyz.cblk) != (unsigned char)0xFF) {
-        ZM_DEBUG(zm_dprintf("Framing error - blk: %x/%x/%x\n", xyz.blk, xyz.cblk, (xyz.blk ^ xyz.cblk)));
-        ZM_DEBUG(zm_dump_buf(xyz.pkt, xyz.len));
-        xyzModem_flush();
-        return xyzModem_frame;
+  ZM_DEBUG (zm_dump (__LINE__));
+  /* Validate the message */
+  if ((xyz.blk ^ xyz.cblk) != (unsigned char) 0xFF)
+    {
+      ZM_DEBUG (zm_dprintf
+               ("Framing error - blk: %x/%x/%x\n", xyz.blk, xyz.cblk,
+                (xyz.blk ^ xyz.cblk)));
+      ZM_DEBUG (zm_dump_buf (xyz.pkt, xyz.len));
+      xyzModem_flush ();
+      return xyzModem_frame;
     }
-    /* Verify checksum/CRC */
-    if (xyz.crc_mode) {
-        cksum = cyg_crc16(xyz.pkt, xyz.len);
-        if (cksum != ((xyz.crc1 << 8) | xyz.crc2)) {
-            ZM_DEBUG(zm_dprintf("CRC error - recvd: %02x%02x, computed: %x\n",
-                                xyz.crc1, xyz.crc2, cksum & 0xFFFF));
-            return xyzModem_cksum;
-        }
-    } else {
-        cksum = 0;
-        for (i = 0;  i < xyz.len;  i++) {
-            cksum += xyz.pkt[i];
-        }
-        if (xyz.crc1 != (cksum & 0xFF)) {
-            ZM_DEBUG(zm_dprintf("Checksum error - recvd: %x, computed: %x\n", xyz.crc1, cksum & 0xFF));
-            return xyzModem_cksum;
-        }
+  /* Verify checksum/CRC */
+  if (xyz.crc_mode)
+    {
+      cksum = cyg_crc16 (xyz.pkt, xyz.len);
+      if (cksum != ((xyz.crc1 << 8) | xyz.crc2))
+       {
+         ZM_DEBUG (zm_dprintf ("CRC error - recvd: %02x%02x, computed: %x\n",
+                               xyz.crc1, xyz.crc2, cksum & 0xFFFF));
+         return xyzModem_cksum;
+       }
     }
-    /* If we get here, the message passes [structural] muster */
-    return 0;
+  else
+    {
+      cksum = 0;
+      for (i = 0; i < xyz.len; i++)
+       {
+         cksum += xyz.pkt[i];
+       }
+      if (xyz.crc1 != (cksum & 0xFF))
+       {
+         ZM_DEBUG (zm_dprintf
+                   ("Checksum error - recvd: %x, computed: %x\n", xyz.crc1,
+                    cksum & 0xFF));
+         return xyzModem_cksum;
+       }
+    }
+  /* If we get here, the message passes [structural] muster */
+  return 0;
 }
 
 int
-xyzModem_stream_open(connection_info_t *info, int *err)
+xyzModem_stream_open (connection_info_t * info, int *err)
 {
 #ifdef REDBOOT
-    int console_chan;
+  int console_chan;
 #endif
-    int stat = 0;
-    int retries = xyzModem_MAX_RETRIES;
-    int crc_retries = xyzModem_MAX_RETRIES_WITH_CRC;
+  int stat = 0;
+  int retries = xyzModem_MAX_RETRIES;
+  int crc_retries = xyzModem_MAX_RETRIES_WITH_CRC;
 
 /*    ZM_DEBUG(zm_out = zm_out_start); */
 #ifdef xyzModem_zmodem
-    if (info->mode == xyzModem_zmodem) {
-        *err = xyzModem_noZmodem;
-        return -1;
+  if (info->mode == xyzModem_zmodem)
+    {
+      *err = xyzModem_noZmodem;
+      return -1;
     }
 #endif
 
 #ifdef REDBOOT
-    /* Set up the I/O channel.  Note: this allows for using a different port in the future */
-    console_chan = CYGACC_CALL_IF_SET_CONSOLE_COMM(CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT);
-    if (info->chan >= 0) {
-        CYGACC_CALL_IF_SET_CONSOLE_COMM(info->chan);
-    } else {
-        CYGACC_CALL_IF_SET_CONSOLE_COMM(console_chan);
+  /* Set up the I/O channel.  Note: this allows for using a different port in the future */
+  console_chan =
+    CYGACC_CALL_IF_SET_CONSOLE_COMM
+    (CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT);
+  if (info->chan >= 0)
+    {
+      CYGACC_CALL_IF_SET_CONSOLE_COMM (info->chan);
     }
-    xyz.__chan = CYGACC_CALL_IF_CONSOLE_PROCS();
+  else
+    {
+      CYGACC_CALL_IF_SET_CONSOLE_COMM (console_chan);
+    }
+  xyz.__chan = CYGACC_CALL_IF_CONSOLE_PROCS ();
 
-    CYGACC_CALL_IF_SET_CONSOLE_COMM(console_chan);
-    CYGACC_COMM_IF_CONTROL(*xyz.__chan, __COMMCTL_SET_TIMEOUT, xyzModem_CHAR_TIMEOUT);
+  CYGACC_CALL_IF_SET_CONSOLE_COMM (console_chan);
+  CYGACC_COMM_IF_CONTROL (*xyz.__chan, __COMMCTL_SET_TIMEOUT,
+                         xyzModem_CHAR_TIMEOUT);
 #else
 /* TODO: CHECK ! */
-    int dummy;
-    xyz.__chan=&dummy;
+  int dummy;
+  xyz.__chan = &dummy;
 #endif
-    xyz.len = 0;
-    xyz.crc_mode = true;
-    xyz.at_eof = false;
-    xyz.tx_ack = false;
-    xyz.mode = info->mode;
-    xyz.total_retries = 0;
-    xyz.total_SOH = 0;
-    xyz.total_STX = 0;
-    xyz.total_CAN = 0;
+  xyz.len = 0;
+  xyz.crc_mode = true;
+  xyz.at_eof = false;
+  xyz.tx_ack = false;
+  xyz.mode = info->mode;
+  xyz.total_retries = 0;
+  xyz.total_SOH = 0;
+  xyz.total_STX = 0;
+  xyz.total_CAN = 0;
 #ifdef USE_YMODEM_LENGTH
-    xyz.read_length = 0;
-    xyz.file_length = 0;
+  xyz.read_length = 0;
+  xyz.file_length = 0;
 #endif
 
-    CYGACC_COMM_IF_PUTC(*xyz.__chan, (xyz.crc_mode ? 'C' : NAK));
+  CYGACC_COMM_IF_PUTC (*xyz.__chan, (xyz.crc_mode ? 'C' : NAK));
 
-    if (xyz.mode == xyzModem_xmodem) {
-           /* X-modem doesn't have an information header - exit here */
-            xyz.next_blk = 1;
-            return 0;
+  if (xyz.mode == xyzModem_xmodem)
+    {
+      /* X-modem doesn't have an information header - exit here */
+      xyz.next_blk = 1;
+      return 0;
     }
 
-    while (retries-- > 0) {
-        stat = xyzModem_get_hdr();
-        if (stat == 0) {
-            /* Y-modem file information header */
-            if (xyz.blk == 0) {
+  while (retries-- > 0)
+    {
+      stat = xyzModem_get_hdr ();
+      if (stat == 0)
+       {
+         /* Y-modem file information header */
+         if (xyz.blk == 0)
+           {
 #ifdef USE_YMODEM_LENGTH
-                /* skip filename */
-                while (*xyz.bufp++);
-                /* get the length */
-                parse_num((char *)xyz.bufp, &xyz.file_length, NULL, " ");
+             /* skip filename */
+             while (*xyz.bufp++);
+             /* get the length */
+             parse_num ((char *) xyz.bufp, &xyz.file_length, NULL, " ");
 #endif
-                /* The rest of the file name data block quietly discarded */
-                xyz.tx_ack = true;
-            }
-            xyz.next_blk = 1;
-            xyz.len = 0;
-            return 0;
-        } else
-        if (stat == xyzModem_timeout) {
-            if (--crc_retries <= 0) xyz.crc_mode = false;
-            CYGACC_CALL_IF_DELAY_US(5*100000);   /* Extra delay for startup */
-            CYGACC_COMM_IF_PUTC(*xyz.__chan, (xyz.crc_mode ? 'C' : NAK));
-            xyz.total_retries++;
-            ZM_DEBUG(zm_dprintf("NAK (%d)\n", __LINE__));
-        }
-        if (stat == xyzModem_cancel) {
-            break;
-        }
+             /* The rest of the file name data block quietly discarded */
+             xyz.tx_ack = true;
+           }
+         xyz.next_blk = 1;
+         xyz.len = 0;
+         return 0;
+       }
+      else if (stat == xyzModem_timeout)
+       {
+         if (--crc_retries <= 0)
+           xyz.crc_mode = false;
+         CYGACC_CALL_IF_DELAY_US (5 * 100000); /* Extra delay for startup */
+         CYGACC_COMM_IF_PUTC (*xyz.__chan, (xyz.crc_mode ? 'C' : NAK));
+         xyz.total_retries++;
+         ZM_DEBUG (zm_dprintf ("NAK (%d)\n", __LINE__));
+       }
+      if (stat == xyzModem_cancel)
+       {
+         break;
+       }
     }
-    *err = stat;
-    ZM_DEBUG(zm_flush());
-    return -1;
+  *err = stat;
+  ZM_DEBUG (zm_flush ());
+  return -1;
 }
 
 int
-xyzModem_stream_read(char *buf, int size, int *err)
+xyzModem_stream_read (char *buf, int size, int *err)
 {
-    int stat, total, len;
-    int retries;
-
-    total = 0;
-    stat = xyzModem_cancel;
-    /* Try and get 'size' bytes into the buffer */
-    while (!xyz.at_eof && (size > 0)) {
-        if (xyz.len == 0) {
-            retries = xyzModem_MAX_RETRIES;
-            while (retries-- > 0) {
-                stat = xyzModem_get_hdr();
-                if (stat == 0) {
-                    if (xyz.blk == xyz.next_blk) {
-                        xyz.tx_ack = true;
-                        ZM_DEBUG(zm_dprintf("ACK block %d (%d)\n", xyz.blk, __LINE__));
-                        xyz.next_blk = (xyz.next_blk + 1) & 0xFF;
+  int stat, total, len;
+  int retries;
+
+  total = 0;
+  stat = xyzModem_cancel;
+  /* Try and get 'size' bytes into the buffer */
+  while (!xyz.at_eof && (size > 0))
+    {
+      if (xyz.len == 0)
+       {
+         retries = xyzModem_MAX_RETRIES;
+         while (retries-- > 0)
+           {
+             stat = xyzModem_get_hdr ();
+             if (stat == 0)
+               {
+                 if (xyz.blk == xyz.next_blk)
+                   {
+                     xyz.tx_ack = true;
+                     ZM_DEBUG (zm_dprintf
+                               ("ACK block %d (%d)\n", xyz.blk, __LINE__));
+                     xyz.next_blk = (xyz.next_blk + 1) & 0xFF;
 
 #if defined(xyzModem_zmodem) || defined(USE_YMODEM_LENGTH)
-                        if (xyz.mode == xyzModem_xmodem || xyz.file_length == 0) {
+                     if (xyz.mode == xyzModem_xmodem || xyz.file_length == 0)
+                       {
 #else
-                        if (1) {
+                     if (1)
+                       {
 #endif
-                            /* Data blocks can be padded with ^Z (EOF) characters */
-                            /* This code tries to detect and remove them */
-                            if ((xyz.bufp[xyz.len-1] == EOF) &&
-                                (xyz.bufp[xyz.len-2] == EOF) &&
-                                (xyz.bufp[xyz.len-3] == EOF)) {
-                                while (xyz.len && (xyz.bufp[xyz.len-1] == EOF)) {
-                                    xyz.len--;
-                                }
-                            }
-                        }
+                         /* Data blocks can be padded with ^Z (EOF) characters */
+                         /* This code tries to detect and remove them */
+                         if ((xyz.bufp[xyz.len - 1] == EOF) &&
+                             (xyz.bufp[xyz.len - 2] == EOF) &&
+                             (xyz.bufp[xyz.len - 3] == EOF))
+                           {
+                             while (xyz.len
+                                    && (xyz.bufp[xyz.len - 1] == EOF))
+                               {
+                                 xyz.len--;
+                               }
+                           }
+                       }
 
 #ifdef USE_YMODEM_LENGTH
-                       /*
-                         * See if accumulated length exceeds that of the file.
-                         * If so, reduce size (i.e., cut out pad bytes)
-                         * Only do this for Y-modem (and Z-modem should it ever
-                         * be supported since it can fall back to Y-modem mode).
-                        */
-                        if (xyz.mode != xyzModem_xmodem && 0 != xyz.file_length) {
-                            xyz.read_length += xyz.len;
-                            if (xyz.read_length > xyz.file_length) {
-                                xyz.len -= (xyz.read_length - xyz.file_length);
-                            }
-                        }
+                     /*
+                      * See if accumulated length exceeds that of the file.
+                      * If so, reduce size (i.e., cut out pad bytes)
+                      * Only do this for Y-modem (and Z-modem should it ever
+                      * be supported since it can fall back to Y-modem mode).
+                      */
+                     if (xyz.mode != xyzModem_xmodem && 0 != xyz.file_length)
+                       {
+                         xyz.read_length += xyz.len;
+                         if (xyz.read_length > xyz.file_length)
+                           {
+                             xyz.len -= (xyz.read_length - xyz.file_length);
+                           }
+                       }
 #endif
-                        break;
-                    } else if (xyz.blk == ((xyz.next_blk - 1) & 0xFF)) {
-                        /* Just re-ACK this so sender will get on with it */
-                        CYGACC_COMM_IF_PUTC(*xyz.__chan, ACK);
-                        continue;  /* Need new header */
-                    } else {
-                        stat = xyzModem_sequence;
-                    }
-                }
-                if (stat == xyzModem_cancel) {
-                    break;
-                }
-                if (stat == xyzModem_eof) {
-                    CYGACC_COMM_IF_PUTC(*xyz.__chan, ACK);
-                    ZM_DEBUG(zm_dprintf("ACK (%d)\n", __LINE__));
-                    if (xyz.mode == xyzModem_ymodem) {
-                        CYGACC_COMM_IF_PUTC(*xyz.__chan, (xyz.crc_mode ? 'C' : NAK));
-                        xyz.total_retries++;
-                        ZM_DEBUG(zm_dprintf("Reading Final Header\n"));
-                        stat = xyzModem_get_hdr();
-                        CYGACC_COMM_IF_PUTC(*xyz.__chan, ACK);
-                        ZM_DEBUG(zm_dprintf("FINAL ACK (%d)\n", __LINE__));
-                    }
-                    xyz.at_eof = true;
-                    break;
-                }
-                CYGACC_COMM_IF_PUTC(*xyz.__chan, (xyz.crc_mode ? 'C' : NAK));
-                xyz.total_retries++;
-                ZM_DEBUG(zm_dprintf("NAK (%d)\n", __LINE__));
-            }
-            if (stat < 0) {
-                *err = stat;
-                xyz.len = -1;
-                return total;
-            }
-        }
-        /* Don't "read" data from the EOF protocol package */
-        if (!xyz.at_eof) {
-            len = xyz.len;
-            if (size < len) len = size;
-            memcpy(buf, xyz.bufp, len);
-            size -= len;
-            buf += len;
-            total += len;
-            xyz.len -= len;
-            xyz.bufp += len;
-        }
+                     break;
+                   }
+                 else if (xyz.blk == ((xyz.next_blk - 1) & 0xFF))
+                   {
+                     /* Just re-ACK this so sender will get on with it */
+                     CYGACC_COMM_IF_PUTC (*xyz.__chan, ACK);
+                     continue; /* Need new header */
+                   }
+                 else
+                   {
+                     stat = xyzModem_sequence;
+                   }
+               }
+             if (stat == xyzModem_cancel)
+               {
+                 break;
+               }
+             if (stat == xyzModem_eof)
+               {
+                 CYGACC_COMM_IF_PUTC (*xyz.__chan, ACK);
+                 ZM_DEBUG (zm_dprintf ("ACK (%d)\n", __LINE__));
+                 if (xyz.mode == xyzModem_ymodem)
+                   {
+                     CYGACC_COMM_IF_PUTC (*xyz.__chan,
+                                          (xyz.crc_mode ? 'C' : NAK));
+                     xyz.total_retries++;
+                     ZM_DEBUG (zm_dprintf ("Reading Final Header\n"));
+                     stat = xyzModem_get_hdr ();
+                     CYGACC_COMM_IF_PUTC (*xyz.__chan, ACK);
+                     ZM_DEBUG (zm_dprintf ("FINAL ACK (%d)\n", __LINE__));
+                   }
+                 xyz.at_eof = true;
+                 break;
+               }
+             CYGACC_COMM_IF_PUTC (*xyz.__chan, (xyz.crc_mode ? 'C' : NAK));
+             xyz.total_retries++;
+             ZM_DEBUG (zm_dprintf ("NAK (%d)\n", __LINE__));
+           }
+         if (stat < 0)
+           {
+             *err = stat;
+             xyz.len = -1;
+             return total;
+           }
+       }
+      /* Don't "read" data from the EOF protocol package */
+      if (!xyz.at_eof)
+       {
+         len = xyz.len;
+         if (size < len)
+           len = size;
+         memcpy (buf, xyz.bufp, len);
+         size -= len;
+         buf += len;
+         total += len;
+         xyz.len -= len;
+         xyz.bufp += len;
+       }
     }
-    return total;
+  return total;
 }
 
 void
-xyzModem_stream_close(int *err)
+xyzModem_stream_close (int *err)
 {
-    diag_printf("xyzModem - %s mode, %d(SOH)/%d(STX)/%d(CAN) packets, %d retries\n",
-                xyz.crc_mode ? "CRC" : "Cksum",
-                xyz.total_SOH, xyz.total_STX, xyz.total_CAN,
-                xyz.total_retries);
-    ZM_DEBUG(zm_flush());
+  diag_printf
+    ("xyzModem - %s mode, %d(SOH)/%d(STX)/%d(CAN) packets, %d retries\n",
+     xyz.crc_mode ? "CRC" : "Cksum", xyz.total_SOH, xyz.total_STX,
+     xyz.total_CAN, xyz.total_retries);
+  ZM_DEBUG (zm_flush ());
 }
 
 /* Need to be able to clean out the input buffer, so have to take the */
 /* getc */
-void xyzModem_stream_terminate(bool abort, int (*getc)(void))
+void
+xyzModem_stream_terminate (bool abort, int (*getc) (void))
 {
   int c;
 
-  if (abort) {
-      ZM_DEBUG(zm_dprintf("!!!! TRANSFER ABORT !!!!\n"));
-      switch (xyz.mode) {
+  if (abort)
+    {
+      ZM_DEBUG (zm_dprintf ("!!!! TRANSFER ABORT !!!!\n"));
+      switch (xyz.mode)
+       {
        case xyzModem_xmodem:
        case xyzModem_ymodem:
          /* The X/YMODEM Spec seems to suggest that multiple CAN followed by an equal */
          /* number of Backspaces is a friendly way to get the other end to abort. */
-         CYGACC_COMM_IF_PUTC(*xyz.__chan,CAN);
-         CYGACC_COMM_IF_PUTC(*xyz.__chan,CAN);
-         CYGACC_COMM_IF_PUTC(*xyz.__chan,CAN);
-         CYGACC_COMM_IF_PUTC(*xyz.__chan,CAN);
-         CYGACC_COMM_IF_PUTC(*xyz.__chan,BSP);
-         CYGACC_COMM_IF_PUTC(*xyz.__chan,BSP);
-         CYGACC_COMM_IF_PUTC(*xyz.__chan,BSP);
-         CYGACC_COMM_IF_PUTC(*xyz.__chan,BSP);
+         CYGACC_COMM_IF_PUTC (*xyz.__chan, CAN);
+         CYGACC_COMM_IF_PUTC (*xyz.__chan, CAN);
+         CYGACC_COMM_IF_PUTC (*xyz.__chan, CAN);
+         CYGACC_COMM_IF_PUTC (*xyz.__chan, CAN);
+         CYGACC_COMM_IF_PUTC (*xyz.__chan, BSP);
+         CYGACC_COMM_IF_PUTC (*xyz.__chan, BSP);
+         CYGACC_COMM_IF_PUTC (*xyz.__chan, BSP);
+         CYGACC_COMM_IF_PUTC (*xyz.__chan, BSP);
          /* Now consume the rest of what's waiting on the line. */
-         ZM_DEBUG(zm_dprintf("Flushing serial line.\n"));
-         xyzModem_flush();
-          xyz.at_eof = true;
-       break;
+         ZM_DEBUG (zm_dprintf ("Flushing serial line.\n"));
+         xyzModem_flush ();
+         xyz.at_eof = true;
+         break;
 #ifdef xyzModem_zmodem
        case xyzModem_zmodem:
          /* Might support it some day I suppose. */
 #endif
-       break;
-      }
-  } else {
-      ZM_DEBUG(zm_dprintf("Engaging cleanup mode...\n"));
+         break;
+       }
+    }
+  else
+    {
+      ZM_DEBUG (zm_dprintf ("Engaging cleanup mode...\n"));
       /*
        * Consume any trailing crap left in the inbuffer from
        * previous recieved blocks. Since very few files are an exact multiple
        * of the transfer block size, there will almost always be some gunk here.
        * If we don't eat it now, RedBoot will think the user typed it.
        */
-      ZM_DEBUG(zm_dprintf("Trailing gunk:\n"));
-      while ((c = (*getc)()) > -1) ;
-      ZM_DEBUG(zm_dprintf("\n"));
+      ZM_DEBUG (zm_dprintf ("Trailing gunk:\n"));
+      while ((c = (*getc) ()) > -1);
+      ZM_DEBUG (zm_dprintf ("\n"));
       /*
        * Make a small delay to give terminal programs like minicom
        * time to get control again after their file transfer program
        * exits.
        */
-      CYGACC_CALL_IF_DELAY_US((cyg_int32)250000);
-  }
+      CYGACC_CALL_IF_DELAY_US ((cyg_int32) 250000);
+    }
 }
 
 char *
-xyzModem_error(int err)
+xyzModem_error (int err)
 {
-    switch (err) {
+  switch (err)
+    {
     case xyzModem_access:
-        return "Can't access file";
-        break;
+      return "Can't access file";
+      break;
     case xyzModem_noZmodem:
-        return "Sorry, zModem not available yet";
-        break;
+      return "Sorry, zModem not available yet";
+      break;
     case xyzModem_timeout:
-        return "Timed out";
-        break;
+      return "Timed out";
+      break;
     case xyzModem_eof:
-        return "End of file";
-        break;
+      return "End of file";
+      break;
     case xyzModem_cancel:
-        return "Cancelled";
-        break;
+      return "Cancelled";
+      break;
     case xyzModem_frame:
-        return "Invalid framing";
-        break;
+      return "Invalid framing";
+      break;
     case xyzModem_cksum:
-        return "CRC/checksum error";
-        break;
+      return "CRC/checksum error";
+      break;
     case xyzModem_sequence:
-        return "Block sequence error";
-        break;
+      return "Block sequence error";
+      break;
     default:
-        return "Unknown error";
-        break;
+      return "Unknown error";
+      break;
     }
 }
 
 /*
  * RedBoot interface
  */
-#if 0 /* SB */
-GETC_IO_FUNCS(xyzModem_io, xyzModem_stream_open, xyzModem_stream_close,
-              xyzModem_stream_terminate, xyzModem_stream_read, xyzModem_error);
-RedBoot_load(xmodem, xyzModem_io, false, false, xyzModem_xmodem);
-RedBoot_load(ymodem, xyzModem_io, false, false, xyzModem_ymodem);
+#if 0                          /* SB */
+GETC_IO_FUNCS (xyzModem_io, xyzModem_stream_open, xyzModem_stream_close,
+              xyzModem_stream_terminate, xyzModem_stream_read,
+              xyzModem_error);
+RedBoot_load (xmodem, xyzModem_io, false, false, xyzModem_xmodem);
+RedBoot_load (ymodem, xyzModem_io, false, false, xyzModem_ymodem);
 #endif
index b59667a83311f39458cb501434979b4996b1e029..0f5d0f43d94f7a86caa90ef85b93479ba60ed71e 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 #########################################################################
 
+ifneq ($(OBJTREE),$(SRCTREE))
+ifeq ($(CURDIR),$(SRCTREE))
+dir := 
+else
+dir := $(subst $(SRCTREE)/,,$(CURDIR))
+endif
+
+obj := $(if $(dir),$(OBJTREE)/$(dir)/,$(OBJTREE)/)
+src := $(if $(dir),$(SRCTREE)/$(dir)/,$(SRCTREE)/)
+
+$(shell mkdir -p $(obj))
+else
+obj :=
+src :=
+endif
+
 # clean the slate ...
 PLATFORM_RELFLAGS =
 PLATFORM_CPPFLAGS =
@@ -116,17 +132,26 @@ DBGFLAGS= -g # -DDEBUG
 OPTFLAGS= -Os #-fomit-frame-pointer
 ifndef LDSCRIPT
 #LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
+ifeq ($(CONFIG_NAND_U_BOOT),y)
+LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
+else
 LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds
 endif
+endif
 OBJCFLAGS += --gap-fill=0xff
 
 gccincdir := $(shell $(CC) -print-file-name=include)
 
 CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS)                \
        -D__KERNEL__ -DTEXT_BASE=$(TEXT_BASE)           \
-       -I$(TOPDIR)/include                             \
-       -fno-builtin -ffreestanding -nostdinc -isystem  \
-       $(gccincdir) -pipe $(PLATFORM_CPPFLAGS)
+
+ifneq ($(OBJTREE),$(SRCTREE))
+CPPFLAGS += -I$(OBJTREE)/include2 -I$(OBJTREE)/include
+endif
+
+CPPFLAGS += -I$(TOPDIR)/include
+CPPFLAGS += -fno-builtin -ffreestanding -nostdinc      \
+       -isystem $(gccincdir) -pipe $(PLATFORM_CPPFLAGS)
 
 ifdef BUILD_TAG
 CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes \
@@ -192,11 +217,23 @@ export    TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS AFLAGS
 
 #########################################################################
 
+ifndef REMOTE_BUILD
+
 %.s:   %.S
-       $(CPP) $(AFLAGS) -o $@ $(CURDIR)/$<
+       $(CPP) $(AFLAGS) -o $@ $<
 %.o:   %.S
-       $(CC) $(AFLAGS) -c -o $@ $(CURDIR)/$<
+       $(CC) $(AFLAGS) -c -o $@ $<
 %.o:   %.c
        $(CC) $(CFLAGS) -c -o $@ $<
 
+else
+
+$(obj)%.s:     %.S
+       $(CPP) $(AFLAGS) -o $@ $<
+$(obj)%.o:     %.S
+       $(CC) $(AFLAGS) -c -o $@ $<
+$(obj)%.o:     %.c
+       $(CC) $(CFLAGS) -c -o $@ $<
+endif
+
 #########################################################################
index 0e10d3a4daa0bd2a231011b803b58a56c901af21..e82fffcf0bf3397b15247562d7f2c9161e80f110 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (C) Copyright 2001
 # Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
 #
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-ASOBJS = cache.o kgdb.o io.o
-OBJS   = traps.o cpu.o cpu_init.o speed.o interrupts.o
+SOBJS  = cache.o kgdb.o io.o
+COBJS  = traps.o cpu.o cpu_init.o speed.o interrupts.o
+
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
 
-all:   .depend $(START) $(ASOBJS) $(LIB)
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
-       $(AR) crv $@ $(ASOBJS) $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(ASOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 203278e9cff757d04984c1f5280bd6c999da2b27..5d2c7eb49701c5a890b40e07944f067eaf5204ac 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2003
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-OBJS   = interrupts.o cpu.o
+COBJS  = interrupts.o cpu.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index f273d929973163c508f8d88d887b418370934134..539a48c414d024bacdf3bce9089a34e11db2dda5 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-OBJS   = serial.o serial_netarm.o interrupts.o cpu.o
+COBJS  = serial.o serial_netarm.o interrupts.o cpu.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 8f256e90224ce96a6a1e3b1bd945092bbb22012e..199fe0c2cb343af2be4906b197e054652af95e24 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-OBJS   = cpu.o interrupts.o
+COBJS  = cpu.o interrupts.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index aec9cb640935548a30e24da6f828fa0810d5fc03..26b0b94f2b95a0148a3567301e2a172005800247 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2005
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(SOC).a
+LIB    = $(obj)lib$(SOC).a
 
-OBJS   = bcm5221.o dm9161.o ether.o i2c.o interrupts.o \
+COBJS  = bcm5221.o dm9161.o ether.o i2c.o interrupts.o \
          lxt972.o serial.o usb_ohci.o
 SOBJS  = lowlevel_init.o
 
-all:   .depend $(LIB)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $(OBJS) $(SOBJS)
+all:   $(obj).depend $(LIB)
+
+$(LIB):        $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 8865f827d44615f0d891bf654139b103d0ee30a3..e238fc01fc5ede37af785656d0d3fe1ad888752e 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(SOC).a
+LIB    = $(obj)lib$(SOC).a
 
-OBJS   = generic.o interrupts.o serial.o speed.o
+COBJS  = generic.o interrupts.o serial.o speed.o
 
-all:   .depend $(LIB)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+
+all:   $(obj).depend $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index ac49060897253f247f0a6aadb9a80179d062b215..6342435d92413c66e74ac1d561c29317c7e2bd1a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2005
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(SOC).a
+LIB    = $(obj)lib$(SOC).a
 
-OBJS   = interrupts.o serial.o
+COBJS  = interrupts.o serial.o
 SOBJS  = lowlevel_init.o
 
-all:   .depend $(LIB)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $(OBJS) $(SOBJS)
+all:   $(obj).depend $(LIB)
+
+$(LIB):        $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index af9e4effce6f48c7d58b7c40cec6a019b7df46a2..557298eac80a6d7acf62ccb25e5a5c572cc1c6d9 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(SOC).a
+LIB    = $(obj)lib$(SOC).a
 
-OBJS   = i2c.o interrupts.o serial.o speed.o \
+COBJS  = i2c.o interrupts.o serial.o speed.o \
          usb_ohci.o
 
-all:   .depend $(LIB)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+
+all:   $(obj).depend $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index a1db818a8ff8e866e33f05cc201a41f7361c5f81..086b1a37791e3b944d08f477495ef0fd7f1d343f 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2003
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-OBJS   = interrupts.o cpu.o omap925.o
+COBJS  = interrupts.o cpu.o omap925.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 060fd20c65efb250c0ca14833da8a1676a349134..a410c2f99fea5bedbd751cf759a8d3af98845df4 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2003
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-OBJS   = interrupts.o cpu.o cpuinfo.o
+COBJS  = interrupts.o cpu.o cpuinfo.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index f9d337819741cdb5c89e1562cc451b5d40ad1c16..7eca2f0d78f830da5f6776b9da1c082031304a2e 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2005
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(SOC).a
+LIB    = $(obj)lib$(SOC).a
 
-OBJS   = timer.o
+COBJS  = timer.o
 SOBJS  = reset.o
 
-all:   .depend $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
+START  := $(addprefix $(obj),$(START))
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $(OBJS) $(SOBJS)
+all:   $(obj).depend $(LIB)
+
+$(LIB):        $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index f9d337819741cdb5c89e1562cc451b5d40ad1c16..7eca2f0d78f830da5f6776b9da1c082031304a2e 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2005
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(SOC).a
+LIB    = $(obj)lib$(SOC).a
 
-OBJS   = timer.o
+COBJS  = timer.o
 SOBJS  = reset.o
 
-all:   .depend $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
+START  := $(addprefix $(obj),$(START))
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $(OBJS) $(SOBJS)
+all:   $(obj).depend $(LIB)
+
+$(LIB):        $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 203278e9cff757d04984c1f5280bd6c999da2b27..5d2c7eb49701c5a890b40e07944f067eaf5204ac 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2003
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-OBJS   = interrupts.o cpu.o
+COBJS  = interrupts.o cpu.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 203278e9cff757d04984c1f5280bd6c999da2b27..5d2c7eb49701c5a890b40e07944f067eaf5204ac 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2003
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-OBJS   = interrupts.o cpu.o
+COBJS  = interrupts.o cpu.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index c63a8f6d01dc719ac5034d7e8c737e102e6e0f6b..a5c48dc04d26165add75f24bf16a116458c4c018 100644 (file)
@@ -2,7 +2,7 @@
 #
 # Copyright (c) 2005 blackfin.uclinux.org
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o start1.o interrupt.o cache.o cplbhdlr.o cplbmgr.o flush.o
-OBJS   = cpu.o traps.o ints.o serial.o interrupts.o
+COBJS  = cpu.o traps.o ints.o serial.o interrupts.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index c44412a025b7884bba2561b9f2cee986eb0f4e11..cd46dea2c7401fdb0bef839117f86cc086b50631 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+# 
 # (C) Copyright 2002
 # Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
 #
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o start16.o reset.o
 COBJS  = serial.o interrupts.o cpu.o timer.o sc520.o
-AOBJS  = sc520_asm.o
+SOBJS  = sc520_asm.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
 
-$(LIB):        $(COBJS) $(AOBJS)
-       $(AR) crv $@ $(COBJS) $(AOBJS)
+all:   $(obj).depend $(START) $(LIB)
+
+$(LIB):        $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(COBJS:.o=.c) $(AOBJS:.o=.S)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(COBJS:.o=.c) $(AOBJS:.o=.S) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 1c4370b0819d83145ff3b4b2c405c376d008ee5d..d0a73418827370cd5cc90cf994c028f87dfee1fc 100644 (file)
@@ -149,7 +149,7 @@ unsigned long init_sc520_dram(void)
        /* these memory control registers are set up in the assember part,
         * in sc520_asm.S, during 'mem_init'.  If we muck with them here,
         * after we are running a stack in RAM, we have troubles.  Besides,
-        * these refresh and delay values are better ? simply specified 
+        * these refresh and delay values are better ? simply specified
         * outright in the include/configs/{cfg} file since the HW designer
         * simply dictates it.
         */
index e1fa37a4a614d917b37a775cbb97ee272188b802..8fc713d93bb4a55d7068a778a8dc4e550e279283 100644 (file)
@@ -462,7 +462,7 @@ emptybank:
 
 #if defined CFG_SDRAM_DRCTMCTL
        /* just have your hardware desinger _GIVE_ you what you need here! */
-       movl    $DRCTMCTL, %edi   
+       movl    $DRCTMCTL, %edi
        movb    $CFG_SDRAM_DRCTMCTL,%al
        movb    (%edi), %al
 #else
@@ -477,7 +477,7 @@ emptybank:
 #ifdef CFG_SDRAM_CAS_LATENCY_3T
        orb     $0x10, %al
 #endif
-       movb    %al, (%edi) 
+       movb    %al, (%edi)
 #endif
 #endif
        movl    $DRCCTL, %edi            /* DRAM Control register */
@@ -537,7 +537,7 @@ bank0:      movl    (%edi), %eax
        movl    %eax, %ebx
 
 
-done:  
+done:
        movl    %ebx, %eax
 
 #if CFG_SDRAM_ECC_ENABLE
@@ -547,7 +547,7 @@ done:
        movl    $0x1, %edi
 memtest0:
        movb    $0xa5, (%edi)
-       cmpb    $0xa5, (%edi) 
+       cmpb    $0xa5, (%edi)
        jne     out
        shrl    $1, %ecx
        andl    %ecx,%ecx
@@ -571,11 +571,11 @@ set_ecc:
                        /* enable NMI mapping for ECC */
        movl    $ECCINT, %edi
        mov     $0x10, %al
-       movb    %al, (%edi) 
+       movb    %al, (%edi)
                        /* Turn on ECC */
        movl    $ECCCTL, %edi
        mov     $0x05, %al
-       movb    %al, (%edi) 
+       movb    %al, (%edi)
 #endif
 out:
        movl    %ebx, %eax
index ba2e5892774de4fa1614dfba6c4e238a38461724..28672705c6db863c6e197be8c5d814ece3f1b34b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-OBJS   = serial.o interrupts.o cpu.o timer.o pci.o
+COBJS  = serial.o interrupts.o cpu.o timer.o pci.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 937de9d47b66dae3cffb265fa1b4e887eb32f9ea..412b418b81f877b3b171212ad7085a94e47cb07e 100644 (file)
 
 include $(TOPDIR)/config.mk
 
-LIB := libnpe.a
+LIB := $(obj)libnpe.a
 
-CFLAGS  += -I$(TOPDIR)/cpu/ixp/npe/include -DCONFIG_IXP425_COMPONENT_ETHDB
+LOCAL_CFLAGS  += -I$(TOPDIR)/cpu/ixp/npe/include -DCONFIG_IXP425_COMPONENT_ETHDB
+CFLAGS  += $(LOCAL_CFLAGS)
+HOST_CFLAGS  += $(LOCAL_CFLAGS)
 
-OBJS := npe.o \
+COBJS := npe.o \
        miiphy.o \
        IxOsalBufferMgt.o \
        IxOsalIoMem.o \
@@ -78,14 +80,21 @@ OBJS := npe.o \
        IxNpeMhSolicitedCbMgr.o \
        IxNpeMhUnsolicitedCbMgr.o
 
+
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
+
 all:   $(LIB)
 
-$(LIB):        $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
+
+#########################################################################
index b45bd6a2960778776c05fc6bbeba528cdd1a54f1..2fcafb043237ecc7c6d8e18e3d35b0119a4bf921 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-OBJS   = cpu.o speed.o interrupts.o serial.o
+COBJS  = cpu.o speed.o interrupts.o serial.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 879deb714ad44d012d747240835d2b9722c54880..a05a803cb2707897efe6cf6f4e50b783fbf98a30 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -25,21 +25,25 @@ include $(TOPDIR)/config.mk
 
 # CFLAGS += -DET_DEBUG
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  =
-OBJS   = serial.o interrupts.o cpu.o speed.o cpu_init.o fec.o
+COBJS  = serial.o interrupts.o cpu.o speed.o cpu_init.o fec.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 6db621472206e0dcb5af25c5c73c523337176f14..b6540b55af69a3190541adc616ac4c6a27b4f1b1 100644 (file)
@@ -266,6 +266,7 @@ int eth_init (bd_t * bd)
 #else
        fecp->fec_hash_table_high = 0;
        fecp->fec_hash_table_low = 0;
+#endif
 #endif
 
        /* Set maximum receive buffer size.
index 8a83ca5ef7dd933b0ec0e8185892eabb86fcd558..f1f4077ebca48fa2aed98c1c0295c7af1e899dd8 100644 (file)
@@ -140,6 +140,7 @@ _start:
        move.l  #(CFG_MBAR + 1), %d0            /* set IPSBAR address + valid flag */
        move.l  %d0, 0x40000000
 
+#if defined(CONFIG_M5282)
        /* Initialize RAMBAR1: locate SRAM and validate it */
        move.l  #(CFG_INIT_RAM_ADDR + 0x21), %d0
        movec   %d0, %RAMBAR1
@@ -170,6 +171,7 @@ _after_flashbar_copy:
        movec   %d0, %RAMBAR0
 #endif /* (TEXT_BASE == CFG_INT_FLASH_BASE) */
 
+#endif
 #endif
        /* if we come from a pre-loader we have no exception table and
         * therefore no VBR to set
index 610043eca95a6c34ae4451f87b9fe77dc4252f70..07ed6cedc28d5fae40834648478127b587004e37 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-OBJS   = cpu.o interrupts.o
+COBJS  = cpu.o interrupts.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend: Makefile $(START:.o=.S) $(OBJS:.o=.c) $(AOBJS:.o=.S)
-       $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) $(AOBJS:.o=.S) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index c8b30c75897f46ac7ed5a43db453ba92cb4f8fb1..f9a49df33d46e3d59506cb9830edae915b0bafec 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-OBJS   = asc_serial.o au1x00_serial.o au1x00_eth.o au1x00_usb_ohci.o \
+COBJS  = asc_serial.o au1x00_serial.o au1x00_eth.o au1x00_usb_ohci.o \
          cpu.o interrupts.o incaip_clock.o
 SOBJS  = incaip_wdt.o cache.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $(OBJS) $(SOBJS)
+all:   $(obj).depend $(START) $(LIB)
+
+$(LIB):        $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index b787b614104ef7c52e0b3dfd9b5738fc122fe42d..d696e79a2172f60adfc9d6210469ca9384639228 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (C) Copyright 2003
 # Martin Winistoerfer, martinwinistoerfer@gmx.ch.
 #
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
+
+START  = start.o
+COBJS  = serial.o cpu.o cpu_init.o interrupts.o traps.o speed.o spi.o
 
-START  = start.S
-OBJS   = serial.o cpu.o cpu_init.o interrupts.o traps.o speed.o spi.o
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
 
-all:   .depend $(START) $(LIB)
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S)  $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index a97b625171e0fdb05ddd5ff5c837f7f85208c029..683ded8c9a20e71d7b7880a11628b9259cc94362 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-ASOBJS = io.o firmware_sc_task_bestcomm.impl.o firmware_sc_task.impl.o
-OBJS   = i2c.o traps.o cpu.o cpu_init.o fec.o ide.o interrupts.o \
+SOBJS  = io.o firmware_sc_task_bestcomm.impl.o firmware_sc_task.impl.o
+COBJS  = i2c.o traps.o cpu.o cpu_init.o fec.o ide.o interrupts.o \
          loadtask.o pci_mpc5200.o serial.o speed.o usb_ohci.o
 
-all:   .depend $(START) $(ASOBJS) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
-       $(AR) crv $@ $(ASOBJS) $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(ASOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 7bacecd595b3561a93a9beb4d0429ca828f13eff..7b5cb8be4e2fb4cb0d1d540417b0692d645493e2 100644 (file)
@@ -1,4 +1,7 @@
 /*
+ * (C) Copyright 2006
+ * Detlev Zundel, DENX Software Engineering, dzu@denx.de
+ *
  * (C) Copyright -2003
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
  * MA 02111-1307 USA
  */
 
-/*
- * interrupts.c - just enough support for the decrementer/timer
+/* this section was ripped out of arch/ppc/syslib/mpc52xx_pic.c in the
+ * Linux 2.6 source with the following copyright.
+ *
+ * Based on (well, mostly copied from) the code from the 2.4 kernel by
+ * Dale Farnsworth <dfarnsworth@mvista.com> and Kent Borg.
+ * 
+ * Copyright (C) 2004 Sylvain Munaut <tnt@246tNt.com>
+ * Copyright (C) 2003 Montavista Software, Inc
  */
 
 #include <common.h>
 #include <asm/processor.h>
+#include <asm/io.h>
 #include <command.h>
 
-int interrupt_init_cpu (ulong *decrementer_count)
+struct irq_action {
+       interrupt_handler_t *handler;
+       void *arg;
+       ulong count;
+};
+
+static struct irq_action irq_handlers[NR_IRQS];
+
+static struct mpc5xxx_intr *intr;
+static struct mpc5xxx_sdma *sdma;
+
+static void mpc5xxx_ic_disable(unsigned int irq)
+{
+       u32 val;
+
+       if (irq == MPC5XXX_IRQ0) {
+               val = in_be32(&intr->ctrl);
+               val &= ~(1 << 11);
+               out_be32(&intr->ctrl, val);
+       } else if (irq < MPC5XXX_IRQ1) {
+               BUG();
+       } else if (irq <= MPC5XXX_IRQ3) {
+               val = in_be32(&intr->ctrl);
+               val &= ~(1 << (10 - (irq - MPC5XXX_IRQ1)));
+               out_be32(&intr->ctrl, val);
+       } else if (irq < MPC5XXX_SDMA_IRQ_BASE) {
+               val = in_be32(&intr->main_mask);
+               val |= 1 << (16 - (irq - MPC5XXX_MAIN_IRQ_BASE));
+               out_be32(&intr->main_mask, val);
+       } else if (irq < MPC5XXX_PERP_IRQ_BASE) {
+               val = in_be32(&sdma->IntMask);
+               val |= 1 << (irq - MPC5XXX_SDMA_IRQ_BASE);
+               out_be32(&sdma->IntMask, val);
+       } else {
+               val = in_be32(&intr->per_mask);
+               val |= 1 << (31 - (irq - MPC5XXX_PERP_IRQ_BASE));
+               out_be32(&intr->per_mask, val);
+       }
+}
+
+static void mpc5xxx_ic_enable(unsigned int irq)
+{
+       u32 val;
+
+       if (irq == MPC5XXX_IRQ0) {
+               val = in_be32(&intr->ctrl);
+               val |= 1 << 11;
+               out_be32(&intr->ctrl, val);
+       } else if (irq < MPC5XXX_IRQ1) {
+               BUG();
+       } else if (irq <= MPC5XXX_IRQ3) {
+               val = in_be32(&intr->ctrl);
+               val |= 1 << (10 - (irq - MPC5XXX_IRQ1));
+               out_be32(&intr->ctrl, val);
+       } else if (irq < MPC5XXX_SDMA_IRQ_BASE) {
+               val = in_be32(&intr->main_mask);
+               val &= ~(1 << (16 - (irq - MPC5XXX_MAIN_IRQ_BASE)));
+               out_be32(&intr->main_mask, val);
+       } else if (irq < MPC5XXX_PERP_IRQ_BASE) {
+               val = in_be32(&sdma->IntMask);
+               val &= ~(1 << (irq - MPC5XXX_SDMA_IRQ_BASE));
+               out_be32(&sdma->IntMask, val);
+       } else {
+               val = in_be32(&intr->per_mask);
+               val &= ~(1 << (31 - (irq - MPC5XXX_PERP_IRQ_BASE)));
+               out_be32(&intr->per_mask, val);
+       }
+}
+
+static void mpc5xxx_ic_ack(unsigned int irq)
+{
+       u32 val;
+
+       /*
+        * Only some irqs are reset here, others in interrupting hardware.
+        */
+
+       switch (irq) {
+       case MPC5XXX_IRQ0:
+               val = in_be32(&intr->ctrl);
+               val |= 0x08000000;
+               out_be32(&intr->ctrl, val);
+               break;
+       case MPC5XXX_CCS_IRQ:
+               val = in_be32(&intr->enc_status);
+               val |= 0x00000400;
+               out_be32(&intr->enc_status, val);
+               break;
+       case MPC5XXX_IRQ1:
+               val = in_be32(&intr->ctrl);
+               val |= 0x04000000;
+               out_be32(&intr->ctrl, val);
+               break;
+       case MPC5XXX_IRQ2:
+               val = in_be32(&intr->ctrl);
+               val |= 0x02000000;
+               out_be32(&intr->ctrl, val);
+               break;
+       case MPC5XXX_IRQ3:
+               val = in_be32(&intr->ctrl);
+               val |= 0x01000000;
+               out_be32(&intr->ctrl, val);
+               break;
+       default:
+               if (irq >= MPC5XXX_SDMA_IRQ_BASE
+                   && irq < (MPC5XXX_SDMA_IRQ_BASE + MPC5XXX_SDMA_IRQ_NUM)) {
+                       out_be32(&sdma->IntPend,
+                                1 << (irq - MPC5XXX_SDMA_IRQ_BASE));
+               }
+               break;
+       }
+}
+
+static void mpc5xxx_ic_disable_and_ack(unsigned int irq)
+{
+       mpc5xxx_ic_disable(irq);
+       mpc5xxx_ic_ack(irq);
+}
+
+static void mpc5xxx_ic_end(unsigned int irq)
+{
+       mpc5xxx_ic_enable(irq);
+}
+
+void mpc5xxx_init_irq(void)
+{
+       u32 intr_ctrl;
+
+       /* Remap the necessary zones */
+       intr = (struct mpc5xxx_intr *)(MPC5XXX_ICTL);
+       sdma = (struct mpc5xxx_sdma *)(MPC5XXX_SDMA);
+
+       /* Disable all interrupt sources. */
+       out_be32(&sdma->IntPend, 0xffffffff);   /* 1 means clear pending */
+       out_be32(&sdma->IntMask, 0xffffffff);   /* 1 means disabled */
+       out_be32(&intr->per_mask, 0x7ffffc00);  /* 1 means disabled */
+       out_be32(&intr->main_mask, 0x00010fff); /* 1 means disabled */
+       intr_ctrl = in_be32(&intr->ctrl);
+       intr_ctrl |= 0x0f000000 |       /* clear IRQ 0-3 */
+           0x00ff0000 |        /* IRQ 0-3 level sensitive low active */
+           0x00001000 |        /* MEE master external enable */
+           0x00000000 |        /* 0 means disable IRQ 0-3 */
+           0x00000001;         /* CEb route critical normally */
+       out_be32(&intr->ctrl, intr_ctrl);
+
+       /* Zero a bunch of the priority settings.  */
+       out_be32(&intr->per_pri1, 0);
+       out_be32(&intr->per_pri2, 0);
+       out_be32(&intr->per_pri3, 0);
+       out_be32(&intr->main_pri1, 0);
+       out_be32(&intr->main_pri2, 0);
+}
+
+int mpc5xxx_get_irq(struct pt_regs *regs)
+{
+       u32 status;
+       int irq = -1;
+
+       status = in_be32(&intr->enc_status);
+
+       if (status & 0x00000400) {      /* critical */
+               irq = (status >> 8) & 0x3;
+               if (irq == 2)   /* high priority peripheral */
+                       goto peripheral;
+               irq += MPC5XXX_CRIT_IRQ_BASE;
+       } else if (status & 0x00200000) {       /* main */
+               irq = (status >> 16) & 0x1f;
+               if (irq == 4)   /* low priority peripheral */
+                       goto peripheral;
+               irq += MPC5XXX_MAIN_IRQ_BASE;
+       } else if (status & 0x20000000) {       /* peripheral */
+             peripheral:
+               irq = (status >> 24) & 0x1f;
+               if (irq == 0) { /* bestcomm */
+                       status = in_be32(&sdma->IntPend);
+                       irq = ffs(status) + MPC5XXX_SDMA_IRQ_BASE - 1;
+               } else
+                       irq += MPC5XXX_PERP_IRQ_BASE;
+       }
+
+       return irq;
+}
+
+/****************************************************************************/
+
+int interrupt_init_cpu(ulong * decrementer_count)
 {
        *decrementer_count = get_tbclk() / CFG_HZ;
 
+       mpc5xxx_init_irq();
+
        return (0);
 }
 
@@ -44,14 +241,32 @@ int interrupt_init_cpu (ulong *decrementer_count)
 /*
  * Handle external interrupts
  */
-void
-external_interrupt(struct pt_regs *regs)
+void external_interrupt(struct pt_regs *regs)
 {
-       puts("external_interrupt (oops!)\n");
+       int irq, unmask = 1;
+
+       irq = mpc5xxx_get_irq(regs);
+
+       mpc5xxx_ic_disable_and_ack(irq);
+
+       enable_interrupts();
+
+       if (irq_handlers[irq].handler != NULL)
+               (*irq_handlers[irq].handler) (irq_handlers[irq].arg);
+       else {
+               printf("\nBogus External Interrupt IRQ %d\n", irq);
+               /*
+                * turn off the bogus interrupt, otherwise it
+                * might repeat forever
+                */
+               unmask = 0;
+       }
+
+       if (unmask)
+               mpc5xxx_ic_end(irq);
 }
 
-void
-timer_interrupt_cpu (struct pt_regs *regs)
+void timer_interrupt_cpu(struct pt_regs *regs)
 {
        /* nothing to do here */
        return;
@@ -63,22 +278,69 @@ timer_interrupt_cpu (struct pt_regs *regs)
  * Install and free a interrupt handler.
  */
 
-void
-irq_install_handler(int vec, interrupt_handler_t *handler, void *arg)
+void irq_install_handler(int irq, interrupt_handler_t * handler, void *arg)
 {
+       if (irq < 0 || irq >= NR_IRQS) {
+               printf("irq_install_handler: bad irq number %d\n", irq);
+               return;
+       }
 
+       if (irq_handlers[irq].handler != NULL)
+               printf("irq_install_handler: 0x%08lx replacing 0x%08lx\n",
+                      (ulong) handler, (ulong) irq_handlers[irq].handler);
+
+       irq_handlers[irq].handler = handler;
+       irq_handlers[irq].arg = arg;
+
+       mpc5xxx_ic_enable(irq);
 }
 
-void
-irq_free_handler(int vec)
+void irq_free_handler(int irq)
 {
+       if (irq < 0 || irq >= NR_IRQS) {
+               printf("irq_free_handler: bad irq number %d\n", irq);
+               return;
+       }
+
+       mpc5xxx_ic_disable(irq);
 
+       irq_handlers[irq].handler = NULL;
+       irq_handlers[irq].arg = NULL;
 }
 
 /****************************************************************************/
 
-void
-do_irqinfo(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
+#if (CONFIG_COMMANDS & CFG_CMD_IRQ)
+void do_irqinfo(cmd_tbl_t * cmdtp, bd_t * bd, int flag, int argc, char *argv[])
 {
-       puts("IRQ related functions are unimplemented currently.\n");
+       int irq, re_enable;
+       u32 intr_ctrl;
+       char *irq_config[] = { "level sensitive, active high",
+               "edge sensitive, rising active edge",
+               "edge sensitive, falling active edge",
+               "level sensitive, active low"
+       };
+
+       re_enable = disable_interrupts();
+
+       intr_ctrl = in_be32(&intr->ctrl);
+       printf("Interrupt configuration:\n");
+
+       for (irq = 0; irq <= 3; irq++) {
+               printf("IRQ%d: %s\n", irq,
+                      irq_config[(intr_ctrl >> (22 - 2 * irq)) & 0x3]);
+       }
+
+       puts("\nInterrupt-Information:\n" "Nr  Routine   Arg       Count\n");
+
+       for (irq = 0; irq < NR_IRQS; irq++)
+               if (irq_handlers[irq].handler != NULL)
+                       printf("%02d  %08lx  %08lx  %ld\n", irq,
+                              (ulong) irq_handlers[irq].handler,
+                              (ulong) irq_handlers[irq].arg,
+                              irq_handlers[irq].count);
+
+       if (re_enable)
+               enable_interrupts();
 }
+#endif
index 6cb523d3c7bf5428d03497341d11906e93d50bcf..430d63f7464f4b3cf6fcfa57dccf7a1a1b648b6f 100644 (file)
@@ -165,6 +165,25 @@ void serial_putc(const char c)
        psc->psc_buffer_8 = c;
 }
 
+#if defined(CONFIG_SERIAL_MULTI)
+void serial_putc_raw_dev(unsigned long dev_base, const char c)
+#else
+void serial_putc_raw(const char c)
+#endif
+{
+#if defined(CONFIG_SERIAL_MULTI)
+       volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)dev_base;
+#else
+       volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)PSC_BASE;
+#endif
+       /* Wait for last character to go. */
+       while (!(psc->psc_status & PSC_SR_TXEMP))
+               ;
+
+       psc->psc_buffer_8 = c;
+}
+
+
 #if defined(CONFIG_SERIAL_MULTI)
 void serial_puts_dev (unsigned long dev_base, const char *s)
 #else
@@ -239,6 +258,43 @@ void serial_setbrg(void)
        psc->ctlr =  div & 0xff;
 }
 
+#if defined(CONFIG_SERIAL_MULTI)
+void serial_setrts_dev (unsigned long dev_base, int s)
+#else
+void serial_setrts(int s)
+#endif
+{
+#if defined(CONFIG_SERIAL_MULTI)
+       volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)dev_base;
+#else
+       volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)PSC_BASE;
+#endif
+
+       if (s) {
+               /* Assert RTS (become LOW) */
+               psc->op1 = 0x1;
+       }
+       else {
+               /* Negate RTS (become HIGH) */
+               psc->op0 = 0x1;
+       }
+}
+
+#if defined(CONFIG_SERIAL_MULTI)
+int serial_getcts_dev (unsigned long dev_base)
+#else
+int serial_getcts(void)
+#endif
+{
+#if defined(CONFIG_SERIAL_MULTI)
+       volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)dev_base;
+#else
+       volatile struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)PSC_BASE;
+#endif
+
+       return (psc->ip & 0x1) ? 0 : 1;
+}
+
 #if defined(CONFIG_SERIAL_MULTI)
 int serial0_init(void)
 {
index 7c9b6c990fa6aea23df531c8c164c0a7bff1a7b7..1f2e93176f6a76b7a88731db2c132c0cd117fad4 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-ASOBJS = io.o fec_dma_tasks.o
-OBJS   = cpu.o cpu_init.o dramSetup.o fec.o i2c.o \
+SOBJS  = io.o fec_dma_tasks.o
+COBJS  = cpu.o cpu_init.o dramSetup.o fec.o i2c.o \
          interrupts.o loadtask.o speed.o \
          traps.o uart.o pci.o
 
-all:   .depend $(START) $(ASOBJS) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
-       $(AR) crv $@ $(ASOBJS) $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(ASOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index ca4a04d21e194e20f19b18e51f9dcd37406bc712..4ef214e54027768c0331161928e9a701d706a25d 100644 (file)
@@ -170,7 +170,7 @@ pci_mpc8220_init(struct pci_controller *hose)
        hose->region_count = 3;
 
        hose->cfg_addr = &(xcpci->cfg_adr);
-       hose->cfg_data = CONFIG_PCI_CFG_BUS;
+       hose->cfg_data = (volatile unsigned char *)CONFIG_PCI_CFG_BUS;
 
        pci_set_ops(hose,
                mpc8220_pci_read_config_byte,
index df0d64e4163cdee196308085757abec2e769effe..d9fd9bfdb170b242bdd8175f244eea02a097df49 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 
 include $(TOPDIR)/config.mk
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)drivers/epic)
+$(shell mkdir -p $(obj)drivers/i2c)
+endif
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
-START  = start.S
-OBJS   = traps.o cpu.o cpu_init.o interrupts.o speed.o \
-         drivers/epic/epic1.o drivers/i2c/i2c.o pci.o bedbug_603e.o
+START  = start.o
+COBJS  = traps.o cpu.o cpu_init.o interrupts.o speed.o \
+         drivers/epic/epic1.o drivers/i2c/i2c.o pci.o
+COBJS_LN = bedbug_603e.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c) $(addprefix $(obj),$(COBJS_LN:.o=.c))
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS) $(COBJS_LN))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
-bedbug_603e.c:
-       ln -s ../mpc8260/bedbug_603e.c bedbug_603e.c
+$(obj)bedbug_603e.c:
+       ln -s $(src)../mpc8260/bedbug_603e.c $(obj)bedbug_603e.c
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S)  $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
diff --git a/cpu/mpc824x/drivers/dma/Makefile b/cpu/mpc824x/drivers/dma/Makefile
deleted file mode 100644 (file)
index 59e2fac..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-##########################################################################
-#
-#       Copyright Motorola, Inc. 1997
-#       ALL RIGHTS RESERVED
-#
-#       You are hereby granted a copyright license to use, modify, and
-#       distribute the SOFTWARE so long as this entire notice is retained
-#       without alteration in any modified and/or redistributed versions,
-#       and that such modified versions are clearly identified as such.
-#       No licenses are granted by implication, estoppel or otherwise under
-#       any patents or trademarks of Motorola, Inc.
-#
-#       The SOFTWARE is provided on an "AS IS" basis and without warranty.
-#       To the maximum extent permitted by applicable law, MOTOROLA DISCLAIMS
-#       ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, INCLUDING IMPLIED
-#       WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
-#       PURPOSE AND ANY WARRANTY AGAINST INFRINGEMENT WITH
-#       REGARD TO THE SOFTWARE (INCLUDING ANY MODIFIED VERSIONS
-#       THEREOF) AND ANY ACCOMPANYING WRITTEN MATERIALS.
-#
-#       To the maximum extent permitted by applicable law, IN NO EVENT SHALL
-#       MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
-#       (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF
-#       BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
-#       INFORMATION, OR OTHER PECUNIARY LOSS) ARISING OF THE USE OR
-#       INABILITY TO USE THE SOFTWARE.
-#
-############################################################################
-TARGET = libdma.a
-
-DEBUG   = -DDMADBG
-LST     = -Hanno -S
-OPTIM   =
-CC      = /risc/tools/pkgs/metaware/bin/hcppc
-CFLAGS  = -Hnocopyr -c -Hsds -Hon=Char_default_unsigned -Hon=Char_is_rep -I../inc -I/risc/tools/pkgs/metaware/inc
-CCobj   = $(CC) $(CFLAGS) $(DEBUG) $(OPTIM)
-PREP    = $(CC) $(CFLAGS) -P
-
-# Assembler used to build the .s files (for the board version)
-
-ASOPT   = -big_si -c
-ASDEBUG = -l -fm
-AS      = /risc/tools/pkgs/metaware/bin/asppc
-
-# Linker to bring .o files together into an executable.
-
-LKOPT  =  -Bbase=0 -q -r -Qn
-LKCMD   =
-LINK    =  /risc/tools/pkgs/metaware/bin/ldppc $(LKCMD) $(LKOPT)
-
-# DOS Utilities
-
-DEL     = rm
-COPY    = cp
-LIST    = ls
-
-OBJECTS = dma1.o dma2.o
-
-all: $(TARGET)
-
-$(TARGET): $(OBJECTS)
-       $(LINK) $(OBJECTS) -o $@
-
-objects: dma1.o
-
-clean:
-       $(DEL) -f *.o *.i *.map *.lst $(TARGET) $(OBJECTS)
-
-.s.o:
-       $(DEL) -f $*.i
-       $(PREP) -Hasmcpp $<
-       $(AS) $(ASOPT) $*.i
-#      $(AS) $(ASOPT) $(ASDEBUG) $*.i > $*.lst
-
-.c.o:
-       $(CCobj) $<
-
-.c.s:
-       $(CCobj) $(LST) $<
-
-dma1.o: dma_export.h dma.h dma1.c
-
-dma2.o: dma.h dma2.s
diff --git a/cpu/mpc824x/drivers/dma/Makefile_pc b/cpu/mpc824x/drivers/dma/Makefile_pc
deleted file mode 100644 (file)
index 8df2a3c..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-##########################################################################
-#
-#   makefile_pc  for use with mksnt tools   drivers/dma
-#
-#       Copyright Motorola, Inc. 1997
-#       ALL RIGHTS RESERVED
-#
-#       You are hereby granted a copyright license to use, modify, and
-#       distribute the SOFTWARE so long as this entire notice is retained
-#       without alteration in any modified and/or redistributed versions,
-#       and that such modified versions are clearly identified as such.
-#       No licenses are granted by implication, estoppel or otherwise under
-#       any patents or trademarks of Motorola, Inc.
-#
-#       The SOFTWARE is provided on an "AS IS" basis and without warranty.
-#       To the maximum extent permitted by applicable law, MOTOROLA DISCLAIMS
-#       ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, INCLUDING IMPLIED
-#       WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
-#       PURPOSE AND ANY WARRANTY AGAINST INFRINGEMENT WITH
-#       REGARD TO THE SOFTWARE (INCLUDING ANY MODIFIED VERSIONS
-#       THEREOF) AND ANY ACCOMPANYING WRITTEN MATERIALS.
-#
-#       To the maximum extent permitted by applicable law, IN NO EVENT SHALL
-#       MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
-#       (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF
-#       BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
-#       INFORMATION, OR OTHER PECUNIARY LOSS) ARISING OF THE USE OR
-#       INABILITY TO USE THE SOFTWARE.
-#
-############################################################################
-TARGET = libdma.a
-
-DEBUG   = -DDMADBG
-LST     = -Hanno -S
-OPTIM   =
-CC      = m:/old_tools/tools/hcppc/bin/hcppc
-CFLAGS  = -Hnocopyr -c -Hsds -Hon=Char_default_unsigned -Hon=Char_is_rep -I../inc -I/risc/tools/pkgs/metaware/inc
-CCobj   = $(CC) $(CFLAGS) $(DEBUG) $(OPTIM)
-PREP    = $(CC) $(CFLAGS) -P
-
-# Assembler used to build the .s files (for the board version)
-
-ASOPT   = -big_si -c
-ASDEBUG = -l -fm
-AS      = m:/old_tools/tools/hcppc/bin/asppc
-
-# Linker to bring .o files together into an executable.
-
-LKOPT  =  -Bbase=0 -q -r -Qn
-LKCMD   =
-LINK    = m:/old_tools/tools/hcppc/bin/ldppc $(LKCMD) $(LKOPT)
-
-# DOS Utilities
-
-DEL     = rm
-COPY    = cp
-LIST    = ls
-
-OBJECTS = dma1.o dma2.o
-
-all: $(TARGET)
-
-$(TARGET): $(OBJECTS)
-       $(LINK) $(OBJECTS) -o $@
-
-objects: dma1.o
-
-clean:
-       $(DEL) -f *.o *.i *.map *.lst $(TARGET) $(OBJECTS)
-
-.s.o:
-       $(DEL) -f $*.i
-       $(PREP) -Hasmcpp $<
-       $(AS) $(ASOPT) $*.i
-#      $(AS) $(ASOPT) $(ASDEBUG) $*.i > $*.lst
-
-.c.o:
-       $(CCobj) $<
-
-.c.s:
-       $(CCobj) $(LST) $<
-
-dma1.o: dma_export.h dma.h dma1.c
-       $(CCobj) $<
-
-dma2.o: dma.h dma2.s
-       $(DEL) -f $*.i
-       $(PREP) -Hasmcpp $<
-       $(AS) $(ASOPT) $*.i
diff --git a/cpu/mpc824x/drivers/dma/README b/cpu/mpc824x/drivers/dma/README
deleted file mode 100644 (file)
index 06f4bc0..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-CONTENT:
-
-   dma.h
-   dma1.c
-   dma2.s
-
-WHAT ARE THESE FILES:
-
-These files contain MPC8240 (Kahlua) DMA controller
-driver routines. The driver routines are not
-written for any specific operating system.
-They serves the purpose of code sample, and
-jump-start for using the MPC8240 DMA controller.
-
-For the reason of correctness of C language
-syntax, these files are compiled by Metaware
-C compiler and assembler.
-
-ENDIAN NOTATION:
-
-The algorithm is designed for big-endian mode,
-software is responsible for byte swapping.
-
-USAGE:
-
-1. The host system that is running on MPC8240
-   or using MPC8240 as I/O device shall link
-   the files listed here. The memory location
-   of driver routines shall take into account of
-   that driver routines need to run in supervisor
-   mode and they process DMA controller interrupt.
-
-2. The host system is responsible for configuring
-   the MPC8240 including Embedded Utilities Memory
-   Block. Since the DMA controller on MPC8240 can
-   be accessed by either local 603e core or the host
-   that MPC8240 serves as I/O processor through host
-   PCI configuration, it is important that the local
-   processor uses EUMBBAR to access its local DMA
-   controller while the PCI master uses I/O
-   processor's PCSRBAR to access the DMA controller
-   on I/O device.
-
-   To qualify whether is EUMBBAR or PCSRBAR, one
-   additional parameter is requied from the host
-   system, LOCAL or REMOTE so that the base value
-   can be correctly interpreted.
-
-3. If the host system is also using the EPIC unit
-   on MPC8240, the system can register the
-   DMA_ISR with the EPIC including other
-   desired resources.
-
-   If the host system does not using the EPIC unit
-   on MPC8240, DMA_ISR function can be called for
-   each desired time interval.
-
-   In both cases, the host system is free to
-   provide its own interrupt service routine.
-
-4. To start a direct mode DMA transaction,
-   use DMA_Bld_Curr with the start parameter
-   set to 1.
-
-   To start a chaining mode DMA transaction,
-   the application shall build descriptors
-   in memory first, next, use DMA_Bld_Desp
-   with the start parameter set to 1.
-
-5. DMA_Start function clears, then sets the CS
-   bit of DMA mode register.
-
-   DMA_Halt function clears the CS bit of DMA
-   mode register.
-
-   These functions can be used to start and
-   halt the DMA transaction.
-
-   If the chaining descriptors has been
-   modified since the last time a DMA
-   transaction started, use DMA_Chn_Cnt
-   function to let DMA controller process
-   the modified descriptor chain without
-   stopping or disturbing the current DMA
-   transaction.
-
-   It is the host system's responsibility of
-   setting up the correct DMA transfer mode
-   and pass the correct memory address parameters.
-
-6. It is the host system's responsibility of
-   queueing the DMA I/O request. The host
-   system can call the DMA_ISR with its own
-   desired interrupt service subroutines to
-   handle each individual interrupt and queued
-   DMA I/O requests.
-
-7. The DMA driver routines contains a set
-   of utilities, Set and Get, for host system
-   to query and modify the desired DMA registers.
diff --git a/cpu/mpc824x/drivers/dma/dma.h b/cpu/mpc824x/drivers/dma/dma.h
deleted file mode 100644 (file)
index a21be74..0000000
+++ /dev/null
@@ -1,326 +0,0 @@
-#ifndef DMA_H
-#define DMA_H
-/*******************************************************
- *
- * copyright @ Motorola 1999
- *
- *******************************************************/
-#define NUM_DMA_REG   7
-#define DMA_MR_REG    0
-#define DMA_SR_REG    1
-#define DMA_CDAR_REG  2
-#define DMA_SAR_REG   3
-#define DMA_DAR_REG   4
-#define DMA_BCR_REG   5
-#define DMA_NDAR_REG  6
-
-typedef enum _dmastatus
-{
-       DMASUCCESS = 0x1000,
-       DMALMERROR,
-       DMAPERROR,
-       DMACHNBUSY,
-       DMAEOSINT,
-       DMAEOCAINT,
-       DMAINVALID,
-       DMANOEVENT,
-} DMAStatus;
-
-typedef enum _location
-{
-       LOCAL = 0,     /* local processor accesses on board DMA,
-                                 local processor's eumbbar is required */
-       REMOTE = 1,    /* PCI master accesses DMA on I/O board,
-                                 I/O processor's pcsrbar is required */
-} LOCATION;
-
-typedef enum dma_mr_bit
-{
-       IRQS    = 0x00080000,
-    PDE     = 0x00040000,
-       DAHTS   = 0x00030000,
-       SAHTS   = 0x0000c000,
-       DAHE    = 0x00002000,
-       SAHE    = 0x00001000,
-       PRC     = 0x00000c00,
-       EIE     = 0x00000080,
-       EOTIE   = 0x00000040,
-       DL      = 0x00000008,
-       CTM     = 0x00000004,
-       CC      = 0x00000002,
-       CS      = 0x00000001,
-} DMA_MR_BIT;
-
-typedef enum dma_sr_bit
-{
-       LME     = 0x00000080,
-       PE      = 0x00000010,
-       CB      = 0x00000004,
-       EOSI    = 0x00000002,
-       EOCAI   = 0x00000001,
-} DMA_SR_BIT;
-
-/* structure for DMA Mode Register */
-typedef struct _dma_mr
-{
-       unsigned int  reserved0 : 12;
-       unsigned int  irqs      : 1;
-       unsigned int  pde       : 1;
-       unsigned int  dahts     : 2;
-    unsigned int  sahts     : 2;
-       unsigned int  dahe      : 1;
-       unsigned int  sahe      : 1;
-       unsigned int  prc       : 2;
-       unsigned int  reserved1 : 1;
-       unsigned int  eie       : 1;
-       unsigned int  eotie     : 1;
-       unsigned int  reserved2 : 3;
-       unsigned int  dl        : 1;
-       unsigned int  ctm       : 1;
-       /* if chaining mode is enabled, any time, user can modify the
-        * descriptor and does not need to halt the current DMA transaction.
-        * Set CC bit, enable DMA to process the modified descriptors
-        * Hardware will clear this bit each time, DMA starts.
-        */
-       unsigned int  cc        : 1;
-       /* cs bit has dua role, halt the current DMA transaction and
-        * (re)start DMA transaction. In chaining mode, if the descriptor
-        * needs modification, cs bit shall be used not the cc bit.
-        * Hardware will not set/clear this bit each time DMA transaction
-        * stops or starts. Software shall do it.
-        *
-        * cs bit shall not be used to halt chaining DMA transaction for
-        * modifying the descriptor. That is the role of CC bit.
-        */
-       unsigned int  cs        : 1;
-} DMA_MR;
-
-/* structure for DMA Status register */
-typedef struct _dma_sr
-{
-       unsigned int  reserved0 : 24;
-       unsigned int  lme       : 1;
-       unsigned int  reserved1 : 2;
-       unsigned int  pe        : 1;
-       unsigned int  reserved2 : 1;
-       unsigned int  cb        : 1;
-       unsigned int  eosi      : 1;
-       unsigned int  eocai     : 1;
-} DMA_SR;
-
-/* structure for DMA current descriptor address register */
-typedef struct _dma_cdar
-{
-       unsigned int  cda    : 27;
-       unsigned int snen    : 1;
-       unsigned int eosie   : 1;
-       unsigned int ctt     : 2;
-       unsigned int eotd    : 1;
-} DMA_CDAR;
-
-/* structure for DMA byte count register */
-typedef struct _dma_bcr
-{
-       unsigned int reserved : 6;
-       unsigned int  bcr      : 26;
-} DMA_BCR;
-
-/* structure for DMA Next Descriptor Address register */
-typedef struct _dma_ndar
-{
-       unsigned int nda    : 27;
-       unsigned int ndsnen : 1;
-       unsigned int ndeosie: 1;
-       unsigned int ndctt  : 2;
-       unsigned int eotd   : 1;
-} DMA_NDAR;
-
-/* structure for DMA current transaction info */
-typedef struct _dma_curr
-{
-       unsigned int src_addr;
-       unsigned int dest_addr;
-       unsigned int byte_cnt;
-} DMA_CURR;
-
-/************************* Kernel API********************
- * Kernel APIs are used to interface with O.S. kernel.
- * They are the functions required by O.S. kernel to
- * provide I/O service.
- ********************************************************/
-
-/**************DMA Device Control Functions ********/
-
-/**
- * Note:
- *
- * In all following functions, the host (KAHLUA) processor has a
- * choice of accessing on board local DMA (LOCAL),
- * or DMA on a distributed KAHLUA (REMOTE). In either case,
- * the caller shall pass the configured embedded utility memory
- * block base address relative to the DMA. If LOCAL DMA is used,
- * this parameter shall be EUMBBAR, if REMOTE is used, the
- * parameter shall be the corresponding PCSRBAR.
- **/
-
-/**************************************************************
- * function: DMA_Get_Stat
- *
- * description: return the content of status register of
- *              the given DMA channel
- *              if error, return DMAINVALID. Otherwise return
- *              DMASUCCESS.
- *
- **************************************************************/
-static DMAStatus DMA_Get_Stat( LOCATION, unsigned int eumbbar, unsigned int channel, DMA_SR * );
-
-/**************************************************************
- * function: DMA_Get_Mode
- *
- * description: return the content of mode register of the
- *              given DMA channel
- *              if error, return DMAINVALID. Otherwise return DMASUCCESS.
- *
- **************************************************************/
-static DMAStatus DMA_Get_Mode( LOCATION, unsigned int eumbbar, unsigned int channel, DMA_MR * );
-
-/**************************************************************
- * function: DMA_Set_Mode
- *
- * description: Set a new mode to a given DMA channel
- *              return DMASUCCESS if success, otherwise return DMACHNINVALID
- *
- * note: It is not a good idea of changing the DMA mode during
- *       the middle of a transaction.
- **************************************************************/
-static DMAStatus DMA_Set_Mode( LOCATION, unsigned int eumbbar, unsigned int channel, DMA_MR mode );
-
-/*************************************************************
- * function: DMA_ISR
- *
- * description: DMA interrupt service routine
- *              return DMAStatus based on the status
- *
- *************************************************************/
-static DMAStatus    DMA_ISR( unsigned int eumbbar,
-                                                        unsigned int channel,
-                                                    DMAStatus (*lme_func)( unsigned int, unsigned int, DMAStatus ),
-                                                DMAStatus (*pe_func) ( unsigned int, unsigned int, DMAStatus ),
-                                                DMAStatus (*eosi_func)( unsigned int, unsigned int, DMAStatus ),
-                                                DMAStatus (*eocai_func)(unsigned int, unsigned int, DMAStatus ));
-
-static DMAStatus dma_error_func( unsigned int, unsigned int, DMAStatus );
-
-/********************* DMA I/O function ********************/
-
-/************************************************************
- * function: DMA_Start
- *
- * description: start a given DMA channel transaction
- *              return DMASUCCESS if success, otherwise return DMACHNINVALID
- *
- * note: this function will clear DMA_MR(CC) first, then
- *       set DMA_MR(CC).
- ***********************************************************/
-static DMAStatus DMA_Start( LOCATION, unsigned int eumbbar,unsigned int channel );
-
-/***********************************************************
- * function: DMA_Halt
- *
- * description: halt the current dma transaction on the specified
- *              channel.
- *              return DMASUCCESS if success, otherwise return DMACHNINVALID
- *
- * note: if the specified DMA channel is idle, nothing happens
- *************************************************************/
-static DMAStatus DMA_Halt( LOCATION, unsigned int eumbbar,unsigned int channel );
-
-/*************************************************************
- * function: DMA_Chn_Cnt
- *
- * description: set the DMA_MR(CC) bit for a given channel
- *              that is in chaining mode.
- *              return DMASUCCESS if successfule, otherwise return DMACHNINVALID
- *
- * note: if the given channel is not in chaining mode, nothing
- *       happen.
- *
- *************************************************************/
-static DMAStatus DMA_Chn_Cnt( LOCATION, unsigned int eumbbar,unsigned int channel );
-
-/*********************** App. API ***************************
- * App. API are the APIs Kernel provides for the application
- * level program
- ************************************************************/
-/**************************************************************
- * function: DMA_Bld_Curr
- *
- * description: set current src, dest, byte count registers
- *              according to the desp for a given channel
- *
- *              if the given channel is busy,  no change made,
- *              return DMACHNBUSY.
- *
- *              otherwise return DMASUCCESS.
- *
- * note:
- **************************************************************/
-static DMAStatus DMA_Bld_Curr( LOCATION,
-                                                                 unsigned int eumbbar,
-                                                                 unsigned int channel,
-                                                             DMA_CURR     desp );
-
-/**************************************************************
- * function: DMA_Poke_Curr
- *
- * description: poke the current src, dest, byte count registers
- *              for a given channel.
- *
- *              return DMASUCCESS if no error otherwise return DMACHNERROR
- *
- * note:        Due to the undeterministic parallelism, in chaining
- *              mode, the value returned by this function shall
- *              be taken as reference when the query is made rather
- *              than the absolute snapshot when the value is returned.
- **************************************************************/
-static DMAStatus DMA_Poke_Curr( LOCATION,
-                                                          unsigned int eumbbar,
-                                                          unsigned int channel,
-                                                      DMA_CURR*    desp );
-
-/**************************************************************
- * function: DMA_Bld_Desp
- *
- * description: set current descriptor address register
- *              according to the desp for a given channel
- *
- *              if the given channel is busy return DMACHNBUSY
- *              and no change made, otherwise return DMASUCCESS.
- *
- * note:
- **************************************************************/
-static DMAStatus DMA_Bld_Desp( LOCATION host,
-                                                 unsigned int eumbbar,
-                                                 unsigned int channel,
-                                                 DMA_CDAR     desp );
-
-/**************************************************************
- * function: DMA_Poke_Desp
- *
- * description: poke the current descriptor address register
- *              for a given channel
- *
- *              return DMASUCCESS if no error otherwise return
- *              DMAINVALID
- *
- * note: Due to the undeterministic parallellism of DMA operation,
- *       the value returned by this function shall be taken as
- *       the most recently used descriptor when the last time
- *       DMA starts a chaining mode operation.
- **************************************************************/
-static DMAStatus DMA_Poke_Desp( LOCATION,
-                                                          unsigned int eumbbar,
-                                                          unsigned int channel,
-                                                      DMA_CDAR     *desp );
-
-#endif
diff --git a/cpu/mpc824x/drivers/dma/dma1.c b/cpu/mpc824x/drivers/dma/dma1.c
deleted file mode 100644 (file)
index 9c85267..0000000
+++ /dev/null
@@ -1,801 +0,0 @@
-/************************************************************
- *
- * copyright @ Motorola, 1999
- *
- * App. API
- *
- * App. API are the APIs Kernel provides for the application
- * level program
- *
- ************************************************************/
-#include "dma_export.h"
-#include "dma.h"
-
-/* Define a macro to use an optional application-layer print function, if
- * one was passed to the library during initialization.  If there was no
- * function pointer passed, this protects against referencing a NULL pointer.
- * Also define The global variable that holds the passed pointer.
- */
-#define PRINT if ( app_print ) app_print
-static int (*app_print)(char *,...);
-
-/* Set by call to get_eumbbar during DMA_Initialize.
- * This could be globally available to the library, but there is
- * an advantage to passing it as a parameter: it is already in a register
- * and doesn't have to be loaded from memory.  Also, that is the way the
- * library was already implemented and I don't want to change it without
- * a more detailed analysis.
- * It is being set as a global variable during initialization to hide it from
- * the DINK application layer, because it is Kahlua-specific.  I think that
- * get_eumbbar, load_runtime_reg, and store_runtime_reg should be defined in
- * a Kahlua-specific library dealing with the embedded utilities memory block.
- * Right now, get_eumbbar is defined in dink32/kahlua.s.  The other two are
- * defined in dink32/drivers/i2c/i2c2.s, drivers/dma/dma2.s, etc.
- */
-static unsigned int Global_eumbbar = 0;
-extern unsigned int get_eumbbar();
-
-
-extern unsigned int load_runtime_reg( unsigned int eumbbar, unsigned int reg );
-#pragma Alias( load_runtime_reg, "load_runtime_reg" );
-
-extern void store_runtime_reg( unsigned int eumbbar, unsigned int reg, unsigned int val );
-#pragma Alias( store_runtime_reg, "store_runtime_reg" );
-
-unsigned int dma_reg_tb[][14] = {
-       /* local DMA registers */
-       {
-      /* DMA_0_MR   */  0x00001100,
-      /* DMA_0_SR   */  0x00001104,
-      /* DMA_0_CDAR */  0x00001108,
-      /* DMA_0_SAR  */  0x00001110,
-      /* DMA_0_DAR  */  0x00001118,
-      /* DMA_0_BCR  */  0x00001120,
-      /* DMA_0_NDAR */  0x00001124,
-      /* DMA_1_MR   */  0x00001200,
-      /* DMA_1_SR   */  0x00001204,
-      /* DMA_1_CDAR */  0x00001208,
-      /* DMA_1_SAR  */  0x00001210,
-      /* DMA_1_DAR  */  0x00001218,
-      /* DMA_1_BCR  */  0x00001220,
-      /* DMA_1_NDAR */  0x00001224,
-       },
-       /* remote DMA registers */
-       {
-      /* DMA_0_MR   */  0x00000100,
-      /* DMA_0_SR   */  0x00000104,
-      /* DMA_0_CDAR */  0x00000108,
-      /* DMA_0_SAR  */  0x00000110,
-      /* DMA_0_DAR  */  0x00000118,
-      /* DMA_0_BCR  */  0x00000120,
-      /* DMA_0_NDAR */  0x00000124,
-      /* DMA_1_MR   */  0x00000200,
-      /* DMA_1_SR   */  0x00000204,
-      /* DMA_1_CDAR */  0x00000208,
-      /* DMA_1_SAR  */  0x00000210,
-      /* DMA_1_DAR  */  0x00000218,
-      /* DMA_1_BCR  */  0x00000220,
-      /* DMA_1_NDAR */  0x00000224,
-       },
-};
-
-/* API functions */
-
-/*  Initialize DMA unit with the following:
- *  optional pointer to application layer print function
- *
- *  These parameters may be added:
- *  ???
- *  Interrupt enables, modes, etc. are set for each transfer.
- *
- *  This function must be called before DMA unit can be used.
- */
-extern
-DMA_Status DMA_Initialize( int (*p)(char *,...))
-{
-  DMAStatus status;
-  /* establish the pointer, if there is one, to the application's "printf" */
-  app_print = p;
-
-  /* If this is the first call, get the embedded utilities memory block
-   * base address.  I'm not sure what to do about error handling here:
-   * if a non-zero value is returned, accept it.
-   */
-  if ( Global_eumbbar == 0)
-     Global_eumbbar = get_eumbbar();
-  if ( Global_eumbbar == 0)
-  {
-    PRINT( "DMA_Initialize: can't find EUMBBAR\n" );
-    return DMA_ERROR;
-  }
-
-  return DMA_SUCCESS;
-}
-
-
-/* Perform the DMA transfer, only direct mode is currently implemented.
- * At this point, I think it would be better to define a different
- * function for chaining mode.
- * Also, I'm not sure if it is appropriate to have the "generic" API
- * accept snoop and int_steer parameters.  The DINK user interface allows
- * them, so for now I'll leave them.
- *
- * int_steer controls DMA interrupt steering to PCI or local processor
- * type is the type of transfer: M2M, M2P, P2M, P2P
- * source is the source address of the data
- * dest is the destination address of the data
- * len is the length of data to transfer
- * channel is the DMA channel to use for the transfer
- * snoop is the snoop enable control
- */
-extern DMA_Status DMA_direct_transfer( DMA_INTERRUPT_STEER int_steer,
-                                      DMA_TRANSFER_TYPE type,
-                                      unsigned int source,
-                                      unsigned int dest,
-                                      unsigned int len,
-                                      DMA_CHANNEL channel,
-                                      DMA_SNOOP_MODE snoop)
-{
-    DMA_MR md;
-    DMA_CDAR cdar;
-    /* it's inappropriate for curr to be a struct, but I'll leave it */
-    DMA_CURR curr;
-
-    DMAStatus stat;
-
-       /* The rest of this code was moved from device.c test_dma to here.
-        * It needs to be cleaned up and validated, but at least it is removed
-        * from the application and API.  Most of the mode is left hard coded.
-        * This should be changed after the final API is defined and the user
-        * application has a way to control the transfer.
-        *
-        */
-
-       if ( DMA_Get_Mode( LOCAL, Global_eumbbar, channel, &md ) != DMASUCCESS )
-       {
-               return DMA_ERROR;
-       }
-
-       md.irqs = int_steer;
-       md.pde = 0;
-       md.dahts = 3; /* 8 - byte */
-       md.sahts = 3; /* 8 - byte */
-       md.dahe = 0;
-       md.sahe = 0;
-       md.prc = 0;
-       /* if steering interrupts to local processor, use polling mode */
-       if ( int_steer == DMA_INT_STEER_PCI )
-       {
-               md.eie = 1;
-               md.eotie = 1;
-       } else {
-               md.eie = 0;
-               md.eotie = 0;
-       }
-       md.dl = 0;
-       md.ctm = 1;   /* direct mode */
-    md.cc = 0;
-
-       /* validate the length range */
-       if (len > 0x3ffffff )
-       {
-               PRINT( "dev DMA: length of transfer too large: %d\n", len );
-               return DMA_ERROR;
-       }
-
-       /* inappropriate to use a struct, but leave as is for now */
-       curr.src_addr = source;
-       curr.dest_addr = dest;
-       curr.byte_cnt = len;
-
-       (void)DMA_Poke_Desp( LOCAL, Global_eumbbar, channel, &cdar );
-       cdar.snen = snoop;
-       cdar.ctt = type;
-
-       if ( ( stat = DMA_Bld_Desp( LOCAL, Global_eumbbar, channel, cdar ))
-                       != DMASUCCESS ||
-                ( stat = DMA_Bld_Curr( LOCAL, Global_eumbbar, channel, curr ))
-                       != DMASUCCESS ||
-            ( stat = DMA_Set_Mode( LOCAL, Global_eumbbar, channel, md ))
-                       != DMASUCCESS ||
-                ( stat = DMA_Start( LOCAL, Global_eumbbar, channel ))
-                       != DMASUCCESS )
-       {
-               if ( stat == DMACHNBUSY )
-               {
-                       PRINT( "dev DMA: channel %d busy.\n", channel );
-               }
-               else
-               {
-                       PRINT( "dev DMA: invalid channel request.\n", channel );
-               }
-
-               return DMA_ERROR;
-       }
-
-/* Since we are interested at the DMA performace right now,
-   we are going to do as less as possible to burden the
-   603e core.
-
-   if you have epic enabled or don't care the return from
-   DMA operation, you can just return SUCCESS.
-
-   if you don't have epic enabled and care the DMA result,
-   you can use the polling method below.
-
-   Note: I'll attempt to activate the code for handling polling.
- */
-
-#if 0
-       /* if steering interrupt to local processor, let it handle results */
-       if ( int_steer == DMA_INT_STEER_LOCAL )
-       {
-           return DMA_SUCCESS;
-       }
-
-       /* polling since interrupt goes to PCI */
-       do
-       {
-               stat = DMA_ISR( Global_eumbbar, channel, dma_error_func,
-                       dma_error_func, dma_error_func, dma_error_func );
-       }
-       while ( stat == DMANOEVENT );
-#endif
-
-    return DMA_SUCCESS;
-}
-
-/* DMA library internal functions */
-
-/**
- * Note:
- *
- * In all following functions, the host (KAHLUA) processor has a
- * choice of accessing on board local DMA (LOCAL),
- * or DMA on a distributed KAHLUA (REMOTE). In either case,
- * the caller shall pass the configured embedded utility memory
- * block base address relative to the DMA. If LOCAL DMA is used,
- * this parameter shall be EUMBBAR, if REMOTE is used, the
- * parameter shall be the corresponding PCSRBAR.
- **/
-
-/**************************************************************
- * function: DMA_Get_Stat
- *
- * description: return the content of status register of
- *              the given DMA channel
- *
- *              if error, reserved0 field all 1s.
- **************************************************************/
-static
-DMAStatus DMA_Get_Stat( LOCATION host, unsigned int eumbbar, unsigned int channel, DMA_SR *stat )
-{
-    unsigned int tmp;
-
-   if ( channel != 0 && channel != 1 || stat == 0 )
-   {
-       return DMAINVALID;
-   }
-
-    tmp = load_runtime_reg( eumbbar, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_SR_REG] );
-#ifdef DMADBG0
-   PRINT( "%s(%d): %s DMA %d (0x%08x) stat = 0x%08x\n", __FILE__, __LINE__,
-                 ( host == LOCAL ? "local" : "remote" ), channel, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_SR_REG], tmp );
-#endif
-
-        stat->reserved0 = ( tmp & 0xffffff00 ) >> 8;
-        stat->lme       = ( tmp & 0x00000080 ) >> 7;
-        stat->reserved1 = ( tmp & 0x00000060 ) >> 5;
-        stat->pe        = ( tmp & 0x00000010 ) >> 4;
-        stat->reserved2 = ( tmp & 0x00000008 ) >> 3;
-        stat->cb        = ( tmp & 0x00000004 ) >> 2;
-        stat->eosi      = ( tmp & 0x00000002 ) >> 1;
-        stat->eocai     = ( tmp & 0x00000001 );
-
-   return DMASUCCESS;
-}
-
-/**************************************************************
- * function: DMA_Get_Mode
- *
- * description: return the content of mode register of the
- *              given DMA channel
- *
- *              if error, return DMAINVALID, otherwise return
- *              DMASUCCESS
- **************************************************************/
-static
-DMAStatus DMA_Get_Mode( LOCATION host, unsigned eumbbar, unsigned int channel, DMA_MR *mode )
-{
-    unsigned int tmp;
-   if ( channel != 0 && channel != 1 || mode == 0 )
-   {
-     return DMAINVALID;
-   }
-
-    tmp = load_runtime_reg( eumbbar, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_MR_REG] );
-
-#ifdef DMADBG0
-   PRINT( "%s(%d): %s DMA %d (0x%08x) mode = 0x%08x\n", __FILE__, __LINE__,
-                 ( host == LOCAL ? "local" : "remote" ), channel, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_MR_REG], tmp );
-#endif
-
-        mode->reserved0 = (tmp & 0xfff00000) >> 20;
-        mode->irqs      = (tmp & 0x00080000) >> 19;
-        mode->pde       = (tmp & 0x00040000) >> 18;
-        mode->dahts     = (tmp & 0x00030000) >> 16;
-     mode->sahts     = (tmp & 0x0000c000) >> 14;
-        mode->dahe      = (tmp & 0x00002000) >> 13;
-        mode->sahe      = (tmp & 0x00001000) >> 12;
-        mode->prc       = (tmp & 0x00000c00) >> 10;
-        mode->reserved1 = (tmp & 0x00000200) >> 9;
-        mode->eie       = (tmp & 0x00000100) >> 8;
-        mode->eotie     = (tmp & 0x00000080) >> 7;
-        mode->reserved2 = (tmp & 0x00000070) >> 4;
-        mode->dl        = (tmp & 0x00000008) >> 3;
-        mode->ctm       = (tmp & 0x00000004) >> 2;
-        mode->cc        = (tmp & 0x00000002) >> 1;
-        mode->cs        = (tmp & 0x00000001);
-
-   return DMASUCCESS;
-}
-
-/**************************************************************
- * function: DMA_Set_Mode
- *
- * description: Set a new mode to a given DMA channel
- *
- * note: It is not a good idea of changing the DMA mode during
- *       the middle of a transaction.
- **************************************************************/
-static
-DMAStatus DMA_Set_Mode( LOCATION host, unsigned eumbbar, unsigned int channel, DMA_MR mode )
-{
-    unsigned int tmp;
-   if ( channel != 0 && channel != 1 )
-   {
-          return DMAINVALID;
-   }
-
-   tmp = ( mode.reserved0 & 0xfff ) << 20;
-   tmp |= ( ( mode.irqs  & 0x1 ) << 19);
-   tmp |= ( ( mode.pde   & 0x1 ) << 18 );
-   tmp |= ( ( mode.dahts & 0x3 ) << 16 );
-   tmp |= ( ( mode.sahts & 0x3 ) << 14 );
-   tmp |= ( ( mode.dahe  & 0x1 ) << 13 );
-   tmp |= ( ( mode.sahe  & 0x1 ) << 12 );
-   tmp |= ( ( mode.prc   & 0x3 ) << 10 );
-   tmp |= ( ( mode.reserved1 & 0x1 ) << 9 );
-   tmp |= ( ( mode.eie   & 0x1 ) << 8 );
-   tmp |= ( ( mode.eotie & 0x1 ) << 7 );
-   tmp |= ( ( mode.reserved2 & 0x7 ) << 4 );
-   tmp |= ( ( mode.dl    & 0x1 ) << 3 );
-   tmp |= ( ( mode.ctm   & 0x1 ) << 2 );
-   tmp |= ( ( mode.cc    & 0x1 ) << 1 ) ;
-   tmp |= ( mode.cs    & 0x1 );
-
-   store_runtime_reg( eumbbar, dma_reg_tb[host][channel*NUM_DMA_REG + DMA_MR_REG], tmp );
-   return DMASUCCESS;
-}
-
-/************************************************************
- * function: DMA_Start
- *
- * description: start a given DMA channel transaction
- *              return DMASUCCESS if success otherwise return
- *              DMAStatus value
- *
- * note: this function will clear DMA_MR(CC) first, then
- *       set DMA_MR(CC).
- ***********************************************************/
-static
-DMAStatus DMA_Start( LOCATION host, unsigned int eumbbar, unsigned int channel )
-{
-   DMA_SR stat;
-   unsigned int mode;
-
-   if ( channel != 0 && channel != 1 )
-   {
-          return DMAINVALID;
-   }
-
-   if ( DMA_Get_Stat( host, eumbbar, channel, &stat ) != DMASUCCESS )
-   {
-                  return DMAINVALID;
-   }
-
-   if ( stat.cb == 1 )
-   {
-          /* DMA is not free */
-          return DMACHNBUSY;
-   }
-
-   mode = load_runtime_reg( eumbbar, dma_reg_tb[host][channel*NUM_DMA_REG + DMA_MR_REG] );
-   /* clear DMA_MR(CS) */
-   mode &= 0xfffffffe;
-   store_runtime_reg( eumbbar, dma_reg_tb[host][channel*NUM_DMA_REG + DMA_MR_REG], mode );
-
-   /* set DMA_MR(CS) */
-   mode |= CS;
-   store_runtime_reg( eumbbar, dma_reg_tb[host][channel*NUM_DMA_REG + DMA_MR_REG], mode );
-   return DMASUCCESS;
-}
-
-/***********************************************************
- * function: DMA_Halt
- *
- * description: halt the current dma transaction on the specified
- *              channel.
- *              return DMASUCCESS if success otherwise return DMAINVALID
- *
- * note: if the specified DMA channel is idle, nothing happens
- *************************************************************/
-static
-DMAStatus DMA_Halt( LOCATION host, unsigned int eumbbar, unsigned int channel )
-{
-   unsigned int mode;
-   if ( channel != 0 && channel != 1 )
-   {
-          return DMAINVALID;
-   }
-
-   mode = load_runtime_reg( eumbbar, dma_reg_tb[host][channel*NUM_DMA_REG + DMA_MR_REG]);
-
-   /* clear DMA_MR(CS) */
-   mode &= 0xfffffffe;
-   store_runtime_reg(eumbbar, dma_reg_tb[host][channel*NUM_DMA_REG + DMA_MR_REG], mode );
-   return DMASUCCESS;
-}
-
-/*************************************************************
- * function: DMA_Chn_Cnt
- *
- * description: set the DMA_MR(CC) bit for a given channel
- *              that is in chaining mode.
- *              return DMASUCCESS if successfule, otherwise return
- *              DMAINVALID.
- *
- * note: if the given channel is not in chaining mode, nothing
- *       happen.
- *
- *************************************************************/
-static
-DMAStatus DMA_Chn_Cnt( LOCATION host, unsigned int eumbbar, unsigned int channel )
-{
-       DMA_MR mode;
-       if ( channel != 0 && channel != 1 )
-       {
-               return DMAINVALID;
-       }
-
-       if ( DMA_Get_Mode( host, eumbbar, channel, &mode ) != DMASUCCESS )
-       {
-                       return DMAINVALID;
-       }
-
-       if ( mode.ctm == 0 )
-       {
-               /* either illegal mode or not chaining mode */
-               return DMAINVALID;
-       }
-
-       mode.cc = 1;
-       return DMA_Set_Mode( host, eumbbar, channel, mode );
-}
-
-/**************************************************************
- * function: DMA_Bld_Desp
- *
- * description: set current descriptor address register
- *              according to the desp for a given channel
- *
- *              if the given channel is busy return DMACHNBUSY
- *              and no change made, otherwise return DMASUCCESS.
- *
- * note:
- **************************************************************/
-static
-DMAStatus DMA_Bld_Desp( LOCATION host,
-                                                  unsigned int eumbbar,
-                                                  unsigned int channel,
-                                                  DMA_CDAR     desp )
-{
-       DMA_SR status;
-       unsigned int temp;
-
-       if ( channel != 0 && channel != 1 )
-       {
-               /* channel number out of range */
-               return DMAINVALID;
-       }
-
-       if ( DMA_Get_Stat( host, eumbbar, channel, &status ) != DMASUCCESS )
-       {
-                       return DMAINVALID;
-       }
-
-       if ( status.cb == 1 )
-       {
-               /* channel busy */
-               return DMACHNBUSY;
-       }
-
-       temp = ( desp.cda & 0x7ffffff ) << 5;
-       temp |= (( desp.snen & 0x1 ) << 4 );
-       temp |= (( desp.eosie & 0x1 ) << 3 );
-       temp |= (( desp.ctt   & 0x3 ) << 1 );
-    temp |= ( desp.eotd  & 0x1 );
-
-    store_runtime_reg( eumbbar, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_CDAR_REG], temp );
-
-#ifdef DMADBG0
-   PRINT( "%s(%d): %s DMA %d (0x%08x) cdar := 0x%08x\n", __FILE__, __LINE__,
-                 ( host == LOCAL ? "local" : "remote" ), channel, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_CDAR_REG], temp );
-#endif
-
-       return DMASUCCESS;
-}
-
-/**************************************************************
- * function: DMA_Poke_Desp
- *
- * description: poke the current descriptor address register
- *              for a given channel
- *
- *              return DMASUCCESS if no error
- *
- * note: Due to the undeterministic parallellism of DMA operation,
- *       the value returned by this function shall be taken as
- *       the most recently used descriptor when the last time
- *       DMA starts a chaining mode operation.
- **************************************************************/
-static
-DMAStatus DMA_Poke_Desp( LOCATION host,
-                                                   unsigned int eumbbar,
-                                                   unsigned int channel,
-                                                   DMA_CDAR     *desp )
-{
-       unsigned int cdar;
-       if ( channel != 0 && channel != 1 || desp == 0 )
-       {
-                       return DMAINVALID;
-       }
-
-    cdar = load_runtime_reg( eumbbar, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_CDAR_REG] );
-
-#ifdef DMADBG0
-   PRINT( "%s(%d): %s DMA %d (0x%08x) cdar : 0x%08x\n", __FILE__, __LINE__,
-                 ( host == LOCAL ? "local" : "remote" ), channel, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_CDAR_REG], cdar );
-#endif
-
-
-       desp->cda   = ( cdar & 0xffffffe0 ) >> 5;
-       desp->snen  = ( cdar & 0x00000010 ) >> 4;
-       desp->eosie = ( cdar & 0x00000008 ) >> 3;
-       desp->ctt   = ( cdar & 0x00000006 ) >> 1;
-       desp->eotd  = ( cdar & 0x00000001 );
-
-       return DMASUCCESS;
-}
-
-/**************************************************************
- * function: DMA_Bld_Curr
- *
- * description: set current src, dest, byte count registers
- *              according to the desp for a given channel
- *              return DMASUCCESS if no error.
- *
- * note:
- **************************************************************/
-static
-DMAStatus DMA_Bld_Curr( LOCATION host,
-                                          unsigned int eumbbar,
-                                          unsigned int channel,
-                                          DMA_CURR     desp )
-{
-       DMA_SR status;
-       if ( channel != 0 && channel != 1 )
-       {
-               /* channel number out of range */
-               return DMAINVALID;
-       }
-
-       if ( DMA_Get_Stat( host, eumbbar, channel, &status ) != DMASUCCESS )
-       {
-                return DMAINVALID;
-       }
-
-       if ( status.cb == 1  )
-       {
-               /* channel busy */
-               return DMACHNBUSY;
-       }
-
-       desp.byte_cnt &= 0x03ffffff; /* upper 6-bits are 0s */
-
-    store_runtime_reg( eumbbar, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_SAR_REG], desp.src_addr );
-#ifdef DMADBG0
-   PRINT( "%s(%d): %s DMA %d (0x%08x) src := 0x%08x\n", __FILE__, __LINE__,
-                 ( host == LOCAL ? "local" : "remote" ), channel, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_CDAR_REG], desp.src_addr );
-#endif
-
-    store_runtime_reg( eumbbar, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_DAR_REG], desp.dest_addr );
-#ifdef DMADBG0
-   PRINT( "%s(%d): %s DMA %d (0x%08x) dest := 0x%08x\n", __FILE__, __LINE__,
-                 ( host == LOCAL ? "local" : "remote" ), channel, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_CDAR_REG], desp.dest_addr );
-#endif
-
-    store_runtime_reg( eumbbar, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_BCR_REG], desp.byte_cnt );
-#ifdef DMADBG0
-   PRINT( "%s(%d): %s DMA %d (0x%08x) count := 0x%08x\n", __FILE__, __LINE__,
-                 ( host == LOCAL ? "local" : "remote" ), channel, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_CDAR_REG], desp.byte_cnt );
-#endif
-
-
-       return DMASUCCESS;
-
-}
-
-/**************************************************************
- * function: DMA_Poke_Curr
- *
- * description: poke the current src, dest, byte count registers
- *              for a given channel.
- *
- *              return DMASUCCESS if no error
- *
- * note:        Due to the undeterministic parallelism, in chaining
- *              mode, the value returned by this function shall
- *              be taken as reference when the query is made rather
- *              than the absolute snapshot when the value is returned.
- **************************************************************/
-static
-DMAStatus DMA_Poke_Curr( LOCATION host,
-                                           unsigned int eumbbar,
-                                           unsigned int channel,
-                                           DMA_CURR*    desp )
-{
-       if ( channel != 0 && channel != 1 || desp == 0 )
-       {
-                       return DMAINVALID;
-       }
-
-       desp->src_addr = load_runtime_reg( eumbbar, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_SAR_REG] );
-#ifdef DMADBG0
-   PRINT( "%s(%d): %s DMA %d (0x%08x) src : 0x%08x\n", __FILE__, __LINE__,
-                 ( host == LOCAL ? "local" : "remote" ), channel, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_CDAR_REG], desp->src_addr );
-#endif
-
-       desp->dest_addr = load_runtime_reg( eumbbar, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_DAR_REG] );
-#ifdef DMADBG0
-   PRINT( "%s(%d): %s DMA %d (0x%08x) dest : 0x%08x\n", __FILE__, __LINE__,
-                 ( host == LOCAL ? "local" : "remote" ), channel, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_CDAR_REG], desp->dest_addr );
-#endif
-
-    desp->byte_cnt = load_runtime_reg( eumbbar, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_BCR_REG] );
-#ifdef DMADBG0
-   PRINT( "%s(%d): %s DMA %d (0x%08x) count : 0x%08x\n", __FILE__, __LINE__,
-                 ( host == LOCAL ? "local" : "remote" ), channel, dma_reg_tb[host][channel*NUM_DMA_REG+DMA_CDAR_REG], desp->byte_cnt );
-#endif
-
-
-       return DMASUCCESS;
-}
-
-/*****************************************************************
- * function: dma_error_func
- *
- * description: display the error information
- *
- * note: This seems like a highly convoluted way to handle messages,
- * but I'll leave it as it was in device.c when I moved it into the
- * DMA library source.
- ****************************************************************/
-static
-DMAStatus dma_error_func( unsigned int eumbbar, unsigned int chn, DMAStatus err)
-{
-       unsigned char *msg[] =
-               {
-                       "Local Memory Error",
-                       "PCI Error",
-                       "Channel Busy",
-                       "End-of-Segment Interrupt",
-                       "End-of-Chain/Direct Interrupt",
-               };
-
-          if ( err >= DMALMERROR && err <= DMAEOCAINT )
-          {
-            PRINT( "DMA Status: channel %d  %s\n", chn, msg[err-DMASUCCESS-1] );
-          }
-
-          return err;
-
-}
-
-/*************************************************************
- * function: DMA_ISR
- *
- * description: DMA interrupt service routine
- *              return DMAStatus value based on
- *              the status
- *
- *************************************************************/
-static
-DMAStatus DMA_ISR( unsigned int eumbbar,
-                                 unsigned int channel,
-                                 DMAStatus (*lme_func)( unsigned int, unsigned int, DMAStatus ),
-                                 DMAStatus (*pe_func) ( unsigned int, unsigned int, DMAStatus ),
-                                 DMAStatus (*eosi_func)( unsigned int, unsigned int, DMAStatus ),
-                                 DMAStatus (*eocai_func)(unsigned int, unsigned int, DMAStatus ))
-{
-
-       DMA_SR stat;
-       DMAStatus rval = DMANOEVENT;
-    unsigned int temp;
-
-       if ( channel != 0 && channel != 1 )
-       {
-               return DMAINVALID;
-       }
-
-       if ( DMA_Get_Stat( LOCAL, eumbbar, channel, &stat ) != DMASUCCESS )
-       {
-                       return DMAINVALID;
-       }
-
-       if ( stat.lme == 1 )
-       {
-               /* local memory error */
-               rval = DMALMERROR;
-               if ( lme_func != 0 )
-               {
-                 rval = (*lme_func)(eumbbar, channel, DMALMERROR );
-           }
-
-       }
-       else if ( stat.pe == 1 )
-       {
-       /* PCI error */
-               rval = DMAPERROR;
-               if ( pe_func != 0 )
-               {
-                 rval = (*pe_func)(eumbbar, channel, DMAPERROR );
-           }
-
-       }
-       else if ( stat.eosi == 1 )
-       {
-               /* end-of-segment interrupt */
-               rval = DMAEOSINT;
-               if ( eosi_func != 0 )
-               {
-                 rval = (*eosi_func)(eumbbar, channel, DMAEOSINT );
-           }
-       }
-       else
-       {
-               /* End-of-chain/direct interrupt */
-               rval = DMAEOCAINT;
-               if ( eocai_func != 0 )
-               {
-                 rval = (*eocai_func)(eumbbar, channel, DMAEOCAINT );
-           }
-       }
-
-    temp = ( stat.reserved0 & 0xffffff ) << 8;
-       temp |= ( ( stat.lme       & 0x1 ) << 7 );  /* write one to clear */
-       temp |= ( ( stat.reserved1 & 0x3 ) << 5 );
-    temp |= ( ( stat.pe        & 0x1 ) << 4 );  /* write one to clear */
-    temp |= ( ( stat.reserved2 & 0x1 ) << 3 );
-       temp |= ( ( stat.cb        & 0x1 ) << 2 );  /* write one to clear */
-    temp |= ( ( stat.eosi      & 0x1 ) << 1 );  /* write one to clear */
-    temp |= ( stat.eocai & 0x1 );               /* write one to clear */
-
-    store_runtime_reg( eumbbar, dma_reg_tb[LOCAL][channel*NUM_DMA_REG + DMA_SR_REG], temp );
-
-#ifdef DMADBG0
-       PRINT( "%s(%d): DMA channel %d SR := 0x%08x\n", __FILE__, __LINE__, channel, temp );
-#endif
-
-       return rval;
-}
diff --git a/cpu/mpc824x/drivers/dma/dma2.S b/cpu/mpc824x/drivers/dma/dma2.S
deleted file mode 100644 (file)
index ccbc226..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/**************************************
- *
- * copyright @ Motorola, 1999
- *
- **************************************/
-
-/**********************************************************
- * function: load_runtime_reg
- *
- * input:  r3 - value of eumbbar
- *         r4 - register offset in embedded utility space
- *
- * output: r3 - register content
- **********************************************************/
-       .text
-       .align 2
-       .global load_runtime_reg
-
-load_runtime_reg:
-
-       lwbrx   r3,r4,r3
-       sync
-
-       bclr 20, 0
-
-/****************************************************************
- * function: store_runtime_reg
- *
- * input: r3 - value of eumbbar
- *        r4 - register offset in embedded utility space
- *        r5 - new value to be stored
- *
- ****************************************************************/
-       .text
-       .align 2
-       .global store_runtime_reg
-store_runtime_reg:
-
-       stwbrx r5,  r4, r3
-       sync
-
-       bclr   20,0
diff --git a/cpu/mpc824x/drivers/dma/dma_export.h b/cpu/mpc824x/drivers/dma/dma_export.h
deleted file mode 100644 (file)
index 471e488..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-#ifndef DMA_EXPORT_H
-#define DMA_EXPORT_H
-
-/****************************************************
- * $Id:
- *
- * Copyright Motorola 1999
- *
- * $Log:
- *
- ****************************************************/
-
-/* These are the defined return values for the DMA_* functions.
- * Any non-zero value indicates failure.  Failure modes can be added for
- * more detailed error reporting.
- */
-typedef enum _dma_status
-{
- DMA_SUCCESS     = 0,
- DMA_ERROR,
-} DMA_Status;
-
-/* These are the defined channel transfer types.  */
-typedef enum _dma_transfer_types
-{
-       DMA_M2M =  0,   /* local memory to local memory */
-       DMA_M2P =  1,   /* local memory to PCI */
-       DMA_P2M =  2,   /* PCI to local memory */
-       DMA_P2P =  3,   /* PCI to PCI */
-} DMA_TRANSFER_TYPE;
-
-typedef enum _dma_interrupt_steer
-{
-       DMA_INT_STEER_LOCAL =  0, /* steer DMA int to local processor */
-       DMA_INT_STEER_PCI = 1,    /* steer DMA int to PCI bus through INTA_ */
-} DMA_INTERRUPT_STEER;
-
-typedef enum _dma_channel
-{
-       DMA_CHN_0 =  0, /* kahlua has two dma channels: 0 and 1 */
-       DMA_CHN_1 =  1,
-} DMA_CHANNEL;
-
-typedef enum _dma_snoop_mode
-{
-       DMA_SNOOP_DISABLE =  0,
-       DMA_SNOOP_ENABLE = 1,
-} DMA_SNOOP_MODE;
-
-/******************** App. API ********************
- * The application API is for user level application
- * to use the functionality provided by DMA driver.
- * This is a "generic" DMA interface, it should contain
- * nothing specific to the Kahlua implementation.
- * Only the generic functions are exported by the library.
- *
- * Note: Its App.s responsibility to swap the data
- *       byte. In our API, we currently transfer whatever
- *       we are given - Big/Little Endian.  This could
- *       become part of the DMA config, though.
- **************************************************/
-
-
-/*  Initialize DMA unit with the following:
- *  optional pointer to application layer print function
- *
- *  These parameters may be added:
- *  ???
- *  Interrupt enables, modes, etc. are set for each transfer.
- *
- *  This function must be called before DMA unit can be used.
- */
-extern DMA_Status DMA_Initialize(
-       int (*app_print_function)(char *,...)); /* pointer to optional "printf"
-                                                * provided by application
-                                                */
-
-/* Perform the DMA transfer, only direct mode is currently implemented.
- * At this point, I think it would be better to define a different
- * function for chaining mode.
- * Also, I'm not sure if it is appropriate to have the "generic" API
- * accept snoop and int_steer parameters.  The DINK user interface allows
- * them, so for now I'll leave them.
- *
- * int_steer controls DMA interrupt steering to PCI or local processor
- * type is the type of transfer: M2M, M2P, P2M, P2P
- * source is the source address of the data
- * dest is the destination address of the data
- * len is the length of data to transfer
- * channel is the DMA channel to use for the transfer
- * snoop is the snoop enable control
- */
-extern DMA_Status DMA_direct_transfer( DMA_INTERRUPT_STEER int_steer,
-                                      DMA_TRANSFER_TYPE type,
-                                      unsigned int source,
-                                      unsigned int dest,
-                                      unsigned int len,
-                                      DMA_CHANNEL channel,
-                                      DMA_SNOOP_MODE snoop);
-#endif
diff --git a/cpu/mpc824x/drivers/dma_export.h b/cpu/mpc824x/drivers/dma_export.h
deleted file mode 100644 (file)
index 471e488..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-#ifndef DMA_EXPORT_H
-#define DMA_EXPORT_H
-
-/****************************************************
- * $Id:
- *
- * Copyright Motorola 1999
- *
- * $Log:
- *
- ****************************************************/
-
-/* These are the defined return values for the DMA_* functions.
- * Any non-zero value indicates failure.  Failure modes can be added for
- * more detailed error reporting.
- */
-typedef enum _dma_status
-{
- DMA_SUCCESS     = 0,
- DMA_ERROR,
-} DMA_Status;
-
-/* These are the defined channel transfer types.  */
-typedef enum _dma_transfer_types
-{
-       DMA_M2M =  0,   /* local memory to local memory */
-       DMA_M2P =  1,   /* local memory to PCI */
-       DMA_P2M =  2,   /* PCI to local memory */
-       DMA_P2P =  3,   /* PCI to PCI */
-} DMA_TRANSFER_TYPE;
-
-typedef enum _dma_interrupt_steer
-{
-       DMA_INT_STEER_LOCAL =  0, /* steer DMA int to local processor */
-       DMA_INT_STEER_PCI = 1,    /* steer DMA int to PCI bus through INTA_ */
-} DMA_INTERRUPT_STEER;
-
-typedef enum _dma_channel
-{
-       DMA_CHN_0 =  0, /* kahlua has two dma channels: 0 and 1 */
-       DMA_CHN_1 =  1,
-} DMA_CHANNEL;
-
-typedef enum _dma_snoop_mode
-{
-       DMA_SNOOP_DISABLE =  0,
-       DMA_SNOOP_ENABLE = 1,
-} DMA_SNOOP_MODE;
-
-/******************** App. API ********************
- * The application API is for user level application
- * to use the functionality provided by DMA driver.
- * This is a "generic" DMA interface, it should contain
- * nothing specific to the Kahlua implementation.
- * Only the generic functions are exported by the library.
- *
- * Note: Its App.s responsibility to swap the data
- *       byte. In our API, we currently transfer whatever
- *       we are given - Big/Little Endian.  This could
- *       become part of the DMA config, though.
- **************************************************/
-
-
-/*  Initialize DMA unit with the following:
- *  optional pointer to application layer print function
- *
- *  These parameters may be added:
- *  ???
- *  Interrupt enables, modes, etc. are set for each transfer.
- *
- *  This function must be called before DMA unit can be used.
- */
-extern DMA_Status DMA_Initialize(
-       int (*app_print_function)(char *,...)); /* pointer to optional "printf"
-                                                * provided by application
-                                                */
-
-/* Perform the DMA transfer, only direct mode is currently implemented.
- * At this point, I think it would be better to define a different
- * function for chaining mode.
- * Also, I'm not sure if it is appropriate to have the "generic" API
- * accept snoop and int_steer parameters.  The DINK user interface allows
- * them, so for now I'll leave them.
- *
- * int_steer controls DMA interrupt steering to PCI or local processor
- * type is the type of transfer: M2M, M2P, P2M, P2P
- * source is the source address of the data
- * dest is the destination address of the data
- * len is the length of data to transfer
- * channel is the DMA channel to use for the transfer
- * snoop is the snoop enable control
- */
-extern DMA_Status DMA_direct_transfer( DMA_INTERRUPT_STEER int_steer,
-                                      DMA_TRANSFER_TYPE type,
-                                      unsigned int source,
-                                      unsigned int dest,
-                                      unsigned int len,
-                                      DMA_CHANNEL channel,
-                                      DMA_SNOOP_MODE snoop);
-#endif
diff --git a/cpu/mpc824x/drivers/i2o.h b/cpu/mpc824x/drivers/i2o.h
deleted file mode 100644 (file)
index c47253d..0000000
+++ /dev/null
@@ -1,344 +0,0 @@
-#ifndef I2O_H
-#define I2O_H
-/*********************************************************
- *
- * copyright @ Motorola, 1999
- *********************************************************/
-
-#define I2O_REG_OFFSET 0x0004
-
-#define PCI_CFG_CLA    0x0B
-#define PCI_CFG_SCL    0x0A
-#define PCI_CFG_PIC    0x09
-
-#define I2O_IMR0 0x0050
-#define I2O_IMR1 0x0054
-#define I2O_OMR0 0x0058
-#define I2O_OMR1 0x005C
-
-#define I2O_ODBR 0x0060
-#define I2O_IDBR 0x0068
-
-#define I2O_OMISR  0x0030
-#define I2O_OMIMR  0x0034
-#define I2O_IMISR  0x0100
-#define I2O_IMIMR  0x0104
-
-/* accessable to PCI master but local processor */
-#define I2O_IFQPR  0x0040
-#define I2O_OFQPR  0x0044
-
-/* accessable to local processor */
-#define I2O_IFHPR  0x0120
-#define I2O_IFTPR  0x0128
-#define I2O_IPHPR  0x0130
-#define I2O_IPTPR  0x0138
-#define I2O_OFHPR  0x0140
-#define I2O_OFTPR  0x0148
-#define I2O_OPHPR  0x0150
-#define I2O_OPTPR  0x0158
-#define I2O_MUCR   0x0164
-#define I2O_QBAR   0x0170
-
-#define I2O_NUM_MSG 2
-
-typedef enum _i2o_status
-{
-       I2OSUCCESS = 0,
-       I2OINVALID,
-       I2OMSGINVALID,
-       I2ODBINVALID,
-       I2OQUEINVALID,
-       I2OQUEEMPTY,
-       I2OQUEFULL,
-       I2ONOEVENT,
-} I2OSTATUS;
-
-typedef enum _queue_size
-{
-    QSIZE_4K = 0x02,
-    QSIZE_8K = 0x04,
-    QSIZE_16K = 0x08,
-    QSIZE_32K = 0x10,
-    QSIZe_64K = 0x20,
-} QUEUE_SIZE;
-
-typedef enum _location
-{
-    LOCAL = 0,     /* used by local processor to access its own on board device,
-                     local processor's eumbbar is required */
-    REMOTE,        /* used by PCI master to access the devices on its PCI device,
-                     device's pcsrbar is required */
-} LOCATION;
-
-/* door bell */
-typedef enum _i2o_in_db
-{
-  IN_DB = 1,
-  MC,         /* machine check */
-} I2O_IN_DB;
-
-/* I2O PCI configuration identification */
-typedef struct _i2o_iop
-{
-       unsigned int base_class : 8;
-       unsigned int sub_class  : 8;
-       unsigned int prg_code   : 8;
-} I2OIOP;
-
-/* I2O Outbound Message Interrupt Status Register */
-typedef struct _i2o_om_stat
-{
-       unsigned int rsvd0 : 26;
-       unsigned int opqi  : 1;
-       unsigned int rsvd1 : 1;
-       unsigned int odi   : 1;
-       unsigned int rsvd2 : 1;
-       unsigned int om1i  : 1;
-       unsigned int om0i  : 1;
-} I2OOMSTAT;
-
-/* I2O inbound Message Interrupt Status Register */
-typedef struct _i2o_im_stat
-{
-       unsigned int rsvd0 : 23;
-       unsigned int ofoi  : 1;
-       unsigned int ipoi  : 1;
-       unsigned int rsvd1 : 1;
-       unsigned int ipqi  : 1;
-       unsigned int mci   : 1;
-       unsigned int idi   : 1;
-       unsigned int rsvd2 : 1;
-       unsigned int im1i  : 1;
-       unsigned int im0i  : 1;
-} I2OIMSTAT;
-
-/**
- Enable the interrupt associated with in/out bound msg
-
- Inbound message interrupt generated by PCI master and serviced by local processor
- local processor needs to enable its inbound interrupts it wants to handle (LOCAL)
-
- Outbound message interrupt generated by local processor and serviced by PCI master
- PCI master needs to enable the devices' outbound interrupts it wants to handle (REMOTE)
- **/
-extern I2OSTATUS I2OMsgEnable( LOCATION,            /*  REMOTE/LOCAL   */
-                              unsigned int base,   /* pcsrbar/eumbbar */
-                              unsigned char n );   /* b'1' - msg 0
-                                                                            * b'10'- msg 1
-                                                                            * b'11'- both
-                                                                            */
-
-/**
- Disable the interrupt associated with in/out bound msg
-
- local processor needs to disable its inbound interrupts it is not interested (LOCAL)
-
- PCI master needs to disable outbound interrupts of devices it is not interested (REMOTE)
- **/
-extern I2OSTATUS I2OMsgDisable( LOCATION,          /*  REMOTE/LOCAL   */
-                               unsigned int base, /* pcsrbar/eumbbar */
-                               unsigned char n ); /* b'1' - msg 0
-                                                                           * b'10'- msg 1
-                                                                           * b'11'- both
-                                                                           */
-
-/**
- Read the msg register either from local inbound msg 0/1,
- or an outbound msg 0/1 of devices.
-
- If it is not local, pcsrbar must be passed to the function.
- Otherwise eumbbar is passed.
-
- If it is remote, outbound msg of the device is read.
- Otherwise local inbound msg is read.
- **/
-extern I2OSTATUS I2OMsgGet ( LOCATION,                 /* REMOTE/LOCAL */
-                            unsigned int base,        /*pcsrbar/eumbbar */
-                            unsigned int n,           /* 0 or 1 */
-                            unsigned int *msg );
-
-/**
- Write to nth Msg register either on local outbound msg 0/1,
- or aninbound msg 0/1 of devices
-
- If it is not local, pcsrbar must be passed to the function.
- Otherwise eumbbar is passed.
-
- If it is remote, inbound msg on the device is written.
- Otherwise local outbound msg is written.
- **/
-extern I2OSTATUS I2OMsgPost( LOCATION,                 /* REMOTE/LOCAL */
-                               unsigned int base,        /*pcsrbar/eumbbar */
-                               unsigned int n,           /* 0 or 1 */
-                               unsigned int msg );
-
-/**
- Enable the In/Out DoorBell Interrupt
-
- InDoorBell interrupt is generated by PCI master and serviced by local processor
- local processor needs to enable its inbound doorbell interrupts it wants to handle
-
- OutDoorbell interrupt is generated by local processor and serviced by PCI master
- PCI master needs to enable outbound doorbell interrupts of the devices it wants to handle
- **/
-extern I2OSTATUS I2ODBEnable( LOCATION,            /*  REMOTE/LOCAL   */
-                             unsigned int base,   /* pcsrbar/eumbbar */
-                             unsigned int in_db );/* when LOCAL, I2O_IN_DB, MC, I2O_IN_DB|MC */
-
-/**
- Disable the In/Out DoorBell Interrupt
-
- local processor needs to disable its inbound doorbell interrupts it is not interested
-
- PCI master needs to disable outbound doorbell interrupts of devices it is not interested
-
- **/
-extern I2OSTATUS I2ODBDisable( LOCATION,              /*  REMOTE/LOCAL   */
-                              unsigned int base,     /* pcsrbar/eumbbar */
-                              unsigned int in_db );  /* when LOCAL, I2O_IN_DB, MC, I2O_IN_DB|MC */
-
-/**
- Read a local indoorbell register, or an outdoorbell of devices.
- Reading a doorbell register, the register will be cleared.
-
- If it is not local, pcsrbar must be passed to the function.
- Otherwise eumbbar is passed.
-
- If it is remote, outdoorbell register on the device is read.
- Otherwise local in doorbell is read
- **/
-extern unsigned int I2ODBGet( LOCATION,             /*  REMOTE/LOCAL   */
-                             unsigned int base);   /* pcsrbar/eumbbar */
-
-/**
- Write to a local outdoorbell register, or an indoorbell register of devices.
-
- If it is not local, pcsrbar must be passed to the function.
- Otherwise eumbbar is passed.
-
- If it is remote, in doorbell register on the device is written.
- Otherwise local out doorbell is written
- **/
-extern void I2ODBPost( LOCATION,                 /*  REMOTE/LOCAL   */
-                      unsigned int base,        /* pcsrbar/eumbbar */
-                      unsigned int msg );       /*   in   / out    */
-
-/**
- Read the outbound msg unit interrupt status of devices. Reading an interrupt status register,
- the register will be cleared.
-
- The outbound interrupt status is AND with the outbound
- interrupt mask. The result is returned.
-
- PCI master must pass the pcsrbar to the function.
- **/
-extern I2OSTATUS I2OOutMsgStatGet( unsigned int pcsrbar, I2OOMSTAT * );
-
-/**
- Read the inbound msg unit interrupt status. Reading an interrupt status register,
- the register will be cleared.
-
- The inbound interrupt status is AND with the inbound
- interrupt mask. The result is returned.
-
- Local process must pass its eumbbar to the function.
-**/
-extern I2OSTATUS I2OInMsgStatGet( unsigned int eumbbar, I2OIMSTAT * );
-
-/**
- Configure the I2O FIFO, including QBAR, IFHPR/IFTPR,IPHPR/IPTPR,OFHPR/OFTPR, OPHPR/OPTPR,
- MUCR.
- **/
-extern I2OSTATUS I2OFIFOInit( unsigned int eumbbar,
-                                             QUEUE_SIZE,
-                                             unsigned int qba);/* queue base address that must be aligned at 1M */
-/**
- Enable the circular queue
- **/
-extern I2OSTATUS I2OFIFOEnable( unsigned int eumbbar );
-
-/**
- Disable the circular queue
- **/
-extern void I2OFIFODisable( unsigned int eumbbar );
-
-/**
- Enable the circular queue interrupt
- PCI master enables outbound FIFO interrupt of device
- Device enables its inbound FIFO interrupt
- **/
-extern void I2OFIFOIntEnable( LOCATION, unsigned int base  );
-
-/**
- Disable the circular queue interrupt
- PCI master disables outbound FIFO interrupt of device
- Device disables its inbound FIFO interrupt
- **/
-extern void I2OFIFOIntDisable( LOCATION, unsigned int base );
-
-/**
- Enable the circular queue overflow interrupt
- **/
-extern void I2OFIFOOverflowIntEnable( unsigned int eumbbar );
-
-/**
- Disable the circular queue overflow interrupt
- **/
-extern void I2OFIFOOverflowIntDisable( unsigned int eumbbar );
-
-/**
- Allocate a free msg frame from free FIFO.
-
- PCI Master allocates a free msg frame through inbound queue port of device(IFQPR)
- while local processor allocates a free msg frame from outbound free queue(OFTPR)
-
- Unless both free queues are initialized, allocating a free MF will return 0xffffffff
- **/
-extern I2OSTATUS I2OFIFOAlloc( LOCATION,
-                                              unsigned int base,
-                                              void         **pMsg);
-/**
- Free a used msg frame back to free queue
- PCI Master frees a MFA through outbound queue port of device(OFQPR)
- while local processor frees a MFA into its inbound free queue(IFHPR)
-
- Used msg frame does not need to be recycled in the order they
- read
-
- This function has to be called by PCI master to initialize Inbound free queue
- and by device to initialize Outbound free queue before I2OFIFOAlloc can be used.
- **/
-extern I2OSTATUS I2OFIFOFree( LOCATION,
-                                         unsigned int base,
-                                         void        *pMsg );
-
-/**
- Post a msg into FIFO
- PCI Master posts a msg through inbound queue port of device(IFQPR)
- while local processor post a msg into its outbound post queue(OPHPR)
-
- The total number of msg must be less than the max size of the queue
- Otherwise queue overflow interrupt will assert.
- **/
-extern I2OSTATUS I2OFIFOPost( LOCATION,
-                                     unsigned int base,
-                                     void         *pMsg );
-
-/**
- Read a msg from FIFO
- PCI Master reads a msg through outbound queue port of device(OFQPR)
- while local processor reads a msg from its inbound post queue(IPTPR)
- **/
-extern I2OSTATUS I2OFIFOGet( LOCATION,
-                                         unsigned int base,
-                                                         void     **pMsg );
-
-/**
- Get the I2O PCI configuration identification register
- **/
-extern I2OSTATUS I2OPCIConfigGet( LOCATION,
-                                          unsigned int base,
-                                                          I2OIOP *);
-
-#endif
diff --git a/cpu/mpc824x/drivers/i2o/Makefile b/cpu/mpc824x/drivers/i2o/Makefile
deleted file mode 100644 (file)
index 3f5ca26..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-##########################################################################
-#
-#       Copyright Motorola, Inc. 1997
-#       ALL RIGHTS RESERVED
-#
-#       You are hereby granted a copyright license to use, modify, and
-#       distribute the SOFTWARE so long as this entire notice is retained
-#       without alteration in any modified and/or redistributed versions,
-#       and that such modified versions are clearly identified as such.
-#       No licenses are granted by implication, estoppel or otherwise under
-#       any patents or trademarks of Motorola, Inc.
-#
-#       The SOFTWARE is provided on an "AS IS" basis and without warranty.
-#       To the maximum extent permitted by applicable law, MOTOROLA DISCLAIMS
-#       ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, INCLUDING IMPLIED
-#       WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
-#       PURPOSE AND ANY WARRANTY AGAINST INFRINGEMENT WITH
-#       REGARD TO THE SOFTWARE (INCLUDING ANY MODIFIED VERSIONS
-#       THEREOF) AND ANY ACCOMPANYING WRITTEN MATERIALS.
-#
-#       To the maximum extent permitted by applicable law, IN NO EVENT SHALL
-#       MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
-#       (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF
-#       BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
-#       INFORMATION, OR OTHER PECUNIARY LOSS) ARISING OF THE USE OR
-#       INABILITY TO USE THE SOFTWARE.
-#
-############################################################################
-TARGET = libi2o.a
-
-#DEBUG  = -g
-DEBUG   =
-LST     = -Hanno -S
-OPTIM   =
-CC      = /risc/tools/pkgs/metaware/bin/hcppc
-CFLAGS  = -Hnocopyr -c -Hsds -Hon=Char_default_unsigned -Hon=Char_is_rep -I../inc -I/risc/tools/pkgs/metaware/inc
-CCobj   = $(CC) $(CFLAGS) $(DEBUG) $(OPTIM)
-PREP    = $(CC) $(CFLAGS) -P
-
-# Assembler used to build the .s files (for the board version)
-
-ASOPT   = -big_si -c
-ASDEBUG  = -l -fm
-AS      = /risc/tools/pkgs/metaware/bin/asppc
-
-# Linker to bring .o files together into an executable.
-
-LKOPT  =  -Bbase=0 -Qn -q -r
-LKCMD    =
-LINK    =  /risc/tools/pkgs/metaware/bin/ldppc $(LKCMD) $(LKOPT)
-
-# DOS Utilities
-
-DEL     = rm
-COPY    = cp
-LIST    = ls
-
-OBJECTS = i2o1.o i2o2.o
-
-all: $(TARGET)
-
-$(TARGET): $(OBJECTS)
-       $(LINK) $(OBJECTS) -o $@
-
-objects: i2o1.o
-
-clean:
-       $(DEL) -f *.o *.i *.map *.lst $(TARGET) $(OBJECTS)
-
-.s.o:
-       $(DEL) -f $*.i
-       $(PREP) -Hasmcpp $<
-       $(AS) $(ASOPT) $*.i
-#      $(AS) $(ASOPT) $(ASDEBUG) $*.i > $*.lst
-
-.c.o:
-       $(CCobj) $<
-
-.c.s:
-       $(CCobj) $(LST) $<
-
-i2o1.o: i2o.h i2o1.c
-
-i2o2.o: i2o.h i2o2.s
diff --git a/cpu/mpc824x/drivers/i2o/Makefile_pc b/cpu/mpc824x/drivers/i2o/Makefile_pc
deleted file mode 100644 (file)
index 6867f58..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-##########################################################################
-#
-#      makefile_pc for use with PC mksnt tools   dink32/drivers/i2o
-#
-#       Copyright Motorola, Inc. 1997
-#       ALL RIGHTS RESERVED
-#
-#       You are hereby granted a copyright license to use, modify, and
-#       distribute the SOFTWARE so long as this entire notice is retained
-#       without alteration in any modified and/or redistributed versions,
-#       and that such modified versions are clearly identified as such.
-#       No licenses are granted by implication, estoppel or otherwise under
-#       any patents or trademarks of Motorola, Inc.
-#
-#       The SOFTWARE is provided on an "AS IS" basis and without warranty.
-#       To the maximum extent permitted by applicable law, MOTOROLA DISCLAIMS
-#       ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, INCLUDING IMPLIED
-#       WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
-#       PURPOSE AND ANY WARRANTY AGAINST INFRINGEMENT WITH
-#       REGARD TO THE SOFTWARE (INCLUDING ANY MODIFIED VERSIONS
-#       THEREOF) AND ANY ACCOMPANYING WRITTEN MATERIALS.
-#
-#       To the maximum extent permitted by applicable law, IN NO EVENT SHALL
-#       MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
-#       (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF
-#       BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
-#       INFORMATION, OR OTHER PECUNIARY LOSS) ARISING OF THE USE OR
-#       INABILITY TO USE THE SOFTWARE.
-#
-############################################################################
-TARGET = libi2o.a
-
-#DEBUG  = -g
-DEBUG   =
-LST     = -Hanno -S
-OPTIM   =
-CC      = m:/old_tools/tools/hcppc/bin/hcppc
-CFLAGS  = -Hnocopyr -c -Hsds -Hon=Char_default_unsigned -Hon=Char_is_rep -I../inc -I/risc/tools/pkgs/metaware/inc
-CCobj   = $(CC) $(CFLAGS) $(DEBUG) $(OPTIM)
-PREP    = $(CC) $(CFLAGS) -P
-
-# Assembler used to build the .s files (for the board version)
-
-ASOPT   = -big_si -c
-ASDEBUG  = -l -fm
-AS      = m:/old_tools/tools/hcppc/bin/asppc
-
-# Linker to bring .o files together into an executable.
-
-LKOPT  =  -Bbase=0 -Qn -q -r
-LKCMD    =
-LINK    = m:/old_tools/tools/hcppc/bin/ldppc $(LKCMD) $(LKOPT)
-
-# DOS Utilities
-
-DEL     = rm
-COPY    = cp
-LIST    = ls
-
-OBJECTS = i2o1.o i2o2.o
-
-all: $(TARGET)
-
-$(TARGET): $(OBJECTS)
-       $(LINK) $(OBJECTS) -o $@
-
-objects: i2o1.o
-
-clean:
-       $(DEL) -f *.o *.i *.map *.lst $(TARGET) $(OBJECTS)
-
-.s.o:
-       $(DEL) -f $*.i
-       $(PREP) -Hasmcpp $<
-       $(AS) $(ASOPT) $*.i
-#      $(AS) $(ASOPT) $(ASDEBUG) $*.i > $*.lst
-
-.c.o:
-       $(CCobj) $<
-
-.c.s:
-       $(CCobj) $(LST) $<
-
-i2o1.o: i2o.h i2o1.c
-       $(CCobj) $<
-
-i2o2.o: i2o.h i2o2.s
-       $(DEL) -f $*.i
-       $(PREP) -Hasmcpp $<
-       $(AS) $(ASOPT) $*.i
diff --git a/cpu/mpc824x/drivers/i2o/i2o.h b/cpu/mpc824x/drivers/i2o/i2o.h
deleted file mode 100644 (file)
index 71572b2..0000000
+++ /dev/null
@@ -1,345 +0,0 @@
-#ifndef I2O_H
-#define I2O_H
-/*********************************************************
- *
- * copyright @ Motorola, 1999
- *
- *********************************************************/
-
-#define I2O_REG_OFFSET 0x0004
-
-#define PCI_CFG_CLA    0x0B
-#define PCI_CFG_SCL    0x0A
-#define PCI_CFG_PIC    0x09
-
-#define I2O_IMR0 0x0050
-#define I2O_IMR1 0x0054
-#define I2O_OMR0 0x0058
-#define I2O_OMR1 0x005C
-
-#define I2O_ODBR 0x0060
-#define I2O_IDBR 0x0068
-
-#define I2O_OMISR  0x0030
-#define I2O_OMIMR  0x0034
-#define I2O_IMISR  0x0100
-#define I2O_IMIMR  0x0104
-
-/* accessable to PCI master but local processor */
-#define I2O_IFQPR  0x0040
-#define I2O_OFQPR  0x0044
-
-/* accessable to local processor */
-#define I2O_IFHPR  0x0120
-#define I2O_IFTPR  0x0128
-#define I2O_IPHPR  0x0130
-#define I2O_IPTPR  0x0138
-#define I2O_OFHPR  0x0140
-#define I2O_OFTPR  0x0148
-#define I2O_OPHPR  0x0150
-#define I2O_OPTPR  0x0158
-#define I2O_MUCR   0x0164
-#define I2O_QBAR   0x0170
-
-#define I2O_NUM_MSG 2
-
-typedef enum _i2o_status
-{
-       I2OSUCCESS = 0,
-       I2OINVALID,
-       I2OMSGINVALID,
-       I2ODBINVALID,
-       I2OQUEINVALID,
-       I2OQUEEMPTY,
-       I2OQUEFULL,
-       I2ONOEVENT,
-} I2OSTATUS;
-
-typedef enum _queue_size
-{
-    QSIZE_4K = 0x02,
-    QSIZE_8K = 0x04,
-    QSIZE_16K = 0x08,
-    QSIZE_32K = 0x10,
-    QSIZe_64K = 0x20,
-} QUEUE_SIZE;
-
-typedef enum _location
-{
-    LOCAL = 0,     /* used by local processor to access its own on board device,
-                     local processor's eumbbar is required */
-    REMOTE,        /* used by PCI master to access the devices on its PCI device,
-                     device's pcsrbar is required */
-} LOCATION;
-
-/* door bell */
-typedef enum _i2o_in_db
-{
-  IN_DB = 1,
-  MC,         /* machine check */
-} I2O_IN_DB;
-
-/* I2O PCI configuration identification */
-typedef struct _i2o_iop
-{
-       unsigned int base_class : 8;
-       unsigned int sub_class  : 8;
-       unsigned int prg_code   : 8;
-} I2OIOP;
-
-/* I2O Outbound Message Interrupt Status Register */
-typedef struct _i2o_om_stat
-{
-       unsigned int rsvd0 : 26;
-       unsigned int opqi  : 1;
-       unsigned int rsvd1 : 1;
-       unsigned int odi   : 1;
-       unsigned int rsvd2 : 1;
-       unsigned int om1i  : 1;
-       unsigned int om0i  : 1;
-} I2OOMSTAT;
-
-/* I2O inbound Message Interrupt Status Register */
-typedef struct _i2o_im_stat
-{
-       unsigned int rsvd0 : 23;
-       unsigned int ofoi  : 1;
-       unsigned int ipoi  : 1;
-       unsigned int rsvd1 : 1;
-       unsigned int ipqi  : 1;
-       unsigned int mci   : 1;
-       unsigned int idi   : 1;
-       unsigned int rsvd2 : 1;
-       unsigned int im1i  : 1;
-       unsigned int im0i  : 1;
-} I2OIMSTAT;
-
-/**
- Enable the interrupt associated with in/out bound msg
-
- Inbound message interrupt generated by PCI master and serviced by local processor
- local processor needs to enable its inbound interrupts it wants to handle (LOCAL)
-
- Outbound message interrupt generated by local processor and serviced by PCI master
- PCI master needs to enable the devices' outbound interrupts it wants to handle (REMOTE)
- **/
-extern I2OSTATUS I2OMsgEnable( LOCATION,            /*  REMOTE/LOCAL   */
-                              unsigned int base,   /* pcsrbar/eumbbar */
-                              unsigned char n );   /* b'1' - msg 0
-                                                                            * b'10'- msg 1
-                                                                            * b'11'- both
-                                                                            */
-
-/**
- Disable the interrupt associated with in/out bound msg
-
- local processor needs to disable its inbound interrupts it is not interested (LOCAL)
-
- PCI master needs to disable outbound interrupts of devices it is not interested (REMOTE)
- **/
-extern I2OSTATUS I2OMsgDisable( LOCATION,          /*  REMOTE/LOCAL   */
-                               unsigned int base, /* pcsrbar/eumbbar */
-                               unsigned char n ); /* b'1' - msg 0
-                                                                           * b'10'- msg 1
-                                                                           * b'11'- both
-                                                                           */
-
-/**
- Read the msg register either from local inbound msg 0/1,
- or an outbound msg 0/1 of devices.
-
- If it is not local, pcsrbar must be passed to the function.
- Otherwise eumbbar is passed.
-
- If it is remote, outbound msg of the device is read.
- Otherwise local inbound msg is read.
- **/
-extern I2OSTATUS I2OMsgGet ( LOCATION,                 /* REMOTE/LOCAL */
-                            unsigned int base,        /*pcsrbar/eumbbar */
-                            unsigned int n,           /* 0 or 1 */
-                            unsigned int *msg );
-
-/**
- Write to nth Msg register either on local outbound msg 0/1,
- or aninbound msg 0/1 of devices
-
- If it is not local, pcsrbar must be passed to the function.
- Otherwise eumbbar is passed.
-
- If it is remote, inbound msg on the device is written.
- Otherwise local outbound msg is written.
- **/
-extern I2OSTATUS I2OMsgPost( LOCATION,                 /* REMOTE/LOCAL */
-                               unsigned int base,        /*pcsrbar/eumbbar */
-                               unsigned int n,           /* 0 or 1 */
-                               unsigned int msg );
-
-/**
- Enable the In/Out DoorBell Interrupt
-
- InDoorBell interrupt is generated by PCI master and serviced by local processor
- local processor needs to enable its inbound doorbell interrupts it wants to handle
-
- OutDoorbell interrupt is generated by local processor and serviced by PCI master
- PCI master needs to enable outbound doorbell interrupts of the devices it wants to handle
- **/
-extern I2OSTATUS I2ODBEnable( LOCATION,            /*  REMOTE/LOCAL   */
-                             unsigned int base,   /* pcsrbar/eumbbar */
-                             unsigned int in_db );/* when LOCAL, I2O_IN_DB, MC, I2O_IN_DB|MC */
-
-/**
- Disable the In/Out DoorBell Interrupt
-
- local processor needs to disable its inbound doorbell interrupts it is not interested
-
- PCI master needs to disable outbound doorbell interrupts of devices it is not interested
-
- **/
-extern I2OSTATUS I2ODBDisable( LOCATION,              /*  REMOTE/LOCAL   */
-                              unsigned int base,     /* pcsrbar/eumbbar */
-                              unsigned int in_db );  /* when LOCAL, I2O_IN_DB, MC, I2O_IN_DB|MC */
-
-/**
- Read a local indoorbell register, or an outdoorbell of devices.
- Reading a doorbell register, the register will be cleared.
-
- If it is not local, pcsrbar must be passed to the function.
- Otherwise eumbbar is passed.
-
- If it is remote, outdoorbell register on the device is read.
- Otherwise local in doorbell is read
- **/
-extern unsigned int I2ODBGet( LOCATION,             /*  REMOTE/LOCAL   */
-                             unsigned int base);   /* pcsrbar/eumbbar */
-
-/**
- Write to a local outdoorbell register, or an indoorbell register of devices.
-
- If it is not local, pcsrbar must be passed to the function.
- Otherwise eumbbar is passed.
-
- If it is remote, in doorbell register on the device is written.
- Otherwise local out doorbell is written
- **/
-extern void I2ODBPost( LOCATION,                 /*  REMOTE/LOCAL   */
-                      unsigned int base,        /* pcsrbar/eumbbar */
-                      unsigned int msg );       /*   in   / out    */
-
-/**
- Read the outbound msg unit interrupt status of devices. Reading an interrupt status register,
- the register will be cleared.
-
- The outbound interrupt status is AND with the outbound
- interrupt mask. The result is returned.
-
- PCI master must pass the pcsrbar to the function.
- **/
-extern I2OSTATUS I2OOutMsgStatGet( unsigned int pcsrbar, I2OOMSTAT * );
-
-/**
- Read the inbound msg unit interrupt status. Reading an interrupt status register,
- the register will be cleared.
-
- The inbound interrupt status is AND with the inbound
- interrupt mask. The result is returned.
-
- Local process must pass its eumbbar to the function.
-**/
-extern I2OSTATUS I2OInMsgStatGet( unsigned int eumbbar, I2OIMSTAT * );
-
-/**
- Configure the I2O FIFO, including QBAR, IFHPR/IFTPR,IPHPR/IPTPR,OFHPR/OFTPR, OPHPR/OPTPR,
- MUCR.
- **/
-extern I2OSTATUS I2OFIFOInit( unsigned int eumbbar,
-                                             QUEUE_SIZE,
-                                             unsigned int qba);/* queue base address that must be aligned at 1M */
-/**
- Enable the circular queue
- **/
-extern I2OSTATUS I2OFIFOEnable( unsigned int eumbbar );
-
-/**
- Disable the circular queue
- **/
-extern void I2OFIFODisable( unsigned int eumbbar );
-
-/**
- Enable the circular queue interrupt
- PCI master enables outbound FIFO interrupt of device
- Device enables its inbound FIFO interrupt
- **/
-extern void I2OFIFOIntEnable( LOCATION, unsigned int base  );
-
-/**
- Disable the circular queue interrupt
- PCI master disables outbound FIFO interrupt of device
- Device disables its inbound FIFO interrupt
- **/
-extern void I2OFIFOIntDisable( LOCATION, unsigned int base );
-
-/**
- Enable the circular queue overflow interrupt
- **/
-extern void I2OFIFOOverflowIntEnable( unsigned int eumbbar );
-
-/**
- Disable the circular queue overflow interrupt
- **/
-extern void I2OFIFOOverflowIntDisable( unsigned int eumbbar );
-
-/**
- Allocate a free msg frame from free FIFO.
-
- PCI Master allocates a free msg frame through inbound queue port of device(IFQPR)
- while local processor allocates a free msg frame from outbound free queue(OFTPR)
-
- Unless both free queues are initialized, allocating a free MF will return 0xffffffff
- **/
-extern I2OSTATUS I2OFIFOAlloc( LOCATION,
-                                              unsigned int base,
-                                              void         **pMsg);
-/**
- Free a used msg frame back to free queue
- PCI Master frees a MFA through outbound queue port of device(OFQPR)
- while local processor frees a MFA into its inbound free queue(IFHPR)
-
- Used msg frame does not need to be recycled in the order they
- read
-
- This function has to be called by PCI master to initialize Inbound free queue
- and by device to initialize Outbound free queue before I2OFIFOAlloc can be used.
- **/
-extern I2OSTATUS I2OFIFOFree( LOCATION,
-                                         unsigned int base,
-                                         void        *pMsg );
-
-/**
- Post a msg into FIFO
- PCI Master posts a msg through inbound queue port of device(IFQPR)
- while local processor post a msg into its outbound post queue(OPHPR)
-
- The total number of msg must be less than the max size of the queue
- Otherwise queue overflow interrupt will assert.
- **/
-extern I2OSTATUS I2OFIFOPost( LOCATION,
-                                     unsigned int base,
-                                     void         *pMsg );
-
-/**
- Read a msg from FIFO
- PCI Master reads a msg through outbound queue port of device(OFQPR)
- while local processor reads a msg from its inbound post queue(IPTPR)
- **/
-extern I2OSTATUS I2OFIFOGet( LOCATION,
-                                         unsigned int base,
-                                                         void     **pMsg );
-
-/**
- Get the I2O PCI configuration identification register
- **/
-extern I2OSTATUS I2OPCIConfigGet( LOCATION,
-                                          unsigned int base,
-                                                          I2OIOP *);
-
-#endif
diff --git a/cpu/mpc824x/drivers/i2o/i2o1.c b/cpu/mpc824x/drivers/i2o/i2o1.c
deleted file mode 100644 (file)
index f058151..0000000
+++ /dev/null
@@ -1,890 +0,0 @@
-/*********************************************************
- * $Id
- *
- * copyright @ Motorola, 1999
- *********************************************************/
-#include "i2o.h"
-
-extern unsigned int load_runtime_reg( unsigned int eumbbar, unsigned int reg );
-#pragma Alias( load_runtime_reg, "load_runtime_reg" );
-
-extern void store_runtime_reg( unsigned int eumbbar, unsigned int reg, unsigned int val );
-#pragma Alias( store_runtime_reg, "store_runtime_reg" );
-
-typedef struct _fifo_stat
-{
-    QUEUE_SIZE   qsz;
-    unsigned int qba;
-} FIFOSTAT;
-
-FIFOSTAT fifo_stat = { QSIZE_4K, 0xffffffff };
-
-/**********************************************************************************
- * function: I2OMsgEnable
- *
- * description: Enable the interrupt associated with in/out bound msg
- *              return I2OSUCCESS if no error, otherwise return I2OMSGINVALID.
- *
- *              All previously enabled interrupts are preserved.
- * note:
- * Inbound message interrupt generated by PCI master and serviced by local processor
- * Outbound message interrupt generated by local processor and serviced by PCI master
- *
- * local processor needs to enable its inbound interrupts it wants to handle(LOCAL)
- * PCI master needs to enable the outbound interrupts of devices it wants to handle(REMOTE)
- ************************************************************************************/
-I2OSTATUS I2OMsgEnable ( LOCATION loc,        /*  REMOTE/LOCAL   */
-                        unsigned int base,   /* pcsrbar/eumbbar */
-                        unsigned char n )    /* b'1' - msg 0
-                                              * b'10'- msg 1
-                                              * b'11'- both
-                                              */
-{
-    unsigned int reg, val;
-    if ( ( n & 0x3 ) == 0 )
-    {
-       /* neither msg 0, nor msg 1 */
-       return I2OMSGINVALID;
-    }
-
-    n = (~n) & 0x3;
-    /* LOCATION - REMOTE : enable outbound message of device, pcsrbar as base
-     *            LOCAL  : enable local inbound message, eumbbar as base
-     */
-    reg = ( loc == REMOTE ? I2O_OMIMR : I2O_IMIMR );
-    val = load_runtime_reg( base, reg );
-
-    val &= 0xfffffffc; /* masked out the msg interrupt bits */
-    val |= n;          /* LSB are the one we want */
-    store_runtime_reg( base, reg, val );
-
-    return I2OSUCCESS;
-}
-
-/*********************************************************************************
- * function: I2OMsgDisable
- *
- * description: Disable the interrupt associated with in/out bound msg
- *              Other previously enabled interrupts are preserved.
- *              return I2OSUCCESS if no error otherwise return I2OMSGINVALID
- *
- * note:
- *  local processor needs to disable its inbound interrupts it is not interested(LOCAL)
- *  PCI master needs to disable outbound interrupts of devices it is not interested(REMOTE)
- *********************************************************************************/
-I2OSTATUS I2OMsgDisable( LOCATION loc,      /*  REMOTE/LOCAL   */
-                        unsigned int base, /* pcsrbar/eumbbar */
-                        unsigned char n )  /* b'1' - msg 0
-                                            * b'10'- msg 1
-                                            * b'11'- both
-                                            */
-{
-    unsigned int reg, val;
-
-    if ( ( n & 0x3 ) == 0 )
-    {
-       /* neither msg 0, nor msg 1 */
-       return I2OMSGINVALID;
-    }
-
-    /* LOCATION - REMOTE : disable outbound message interrupt of device, pcsrbar as base
-     *            LOCAL  : disable local inbound message interrupt, eumbbar as base
-     */
-    reg = ( loc == REMOTE ? I2O_OMIMR : I2O_IMIMR );
-    val = load_runtime_reg( base, reg );
-
-    val &= 0xfffffffc; /* masked out the msg interrupt bits */
-    val |= ( n & 0x3 );
-    store_runtime_reg( base, reg, val );
-
-    return I2OSUCCESS;
-
-}
-
-/**************************************************************************
- * function: I2OMsgGet
- *
- * description: Local processor reads the nth Msg register from its inbound msg,
- *              or a PCI Master reads nth outbound msg from device
- *
- *              return I2OSUCCESS if no error, otherwise return I2OMSGINVALID.
- *
- * note:
- * If it is not local, pcsrbar must be passed to the function. Otherwise eumbbar is passed.
- * If it is remote, outbound msg on the device is read; otherwise local inbound msg is read
- *************************************************************************/
-I2OSTATUS I2OMsgGet ( LOCATION loc,             /* REMOTE/LOCAL */
-                        unsigned int base,        /*pcsrbar/eumbbar */
-                        unsigned int n,           /* 0 or 1 */
-                        unsigned int *msg )
-{
-    if ( n >= I2O_NUM_MSG || msg == 0 )
-    {
-       return I2OMSGINVALID;
-    }
-
-    if ( loc == REMOTE )
-    {
-       /* read the outbound msg of the device, pcsrbar as base */
-       *msg = load_runtime_reg( base, I2O_OMR0+n*I2O_REG_OFFSET );
-    }
-    else
-    {
-       /* read the inbound msg sent by PCI master, eumbbar as base */
-       *msg = load_runtime_reg( base, I2O_IMR0+n*I2O_REG_OFFSET );
-    }
-
-    return I2OSUCCESS;
-}
-
-/***************************************************************
- * function: I2OMsgPost
- *
- * description: Kahlua  writes to its nth outbound msg register
- *              PCI master writes to nth inbound msg register of device
- *
- *              return I2OSUCCESS if no error, otherwise return I2OMSGINVALID.
- *
- * note:
- * If it is not local, pcsrbar must be passed to the function. Otherwise eumbbar is passed.
- *
- * If it is remote, inbound msg on the device is written; otherwise local outbound msg is written
- ***************************************************************/
-I2OSTATUS I2OMsgPost( LOCATION loc,             /* REMOTE/LOCAL */
-                     unsigned int base,        /*pcsrbar/eumbbar */
-                     unsigned int n,           /* 0 or 1 */
-                     unsigned int msg )
-{
-    if ( n >= I2O_NUM_MSG )
-    {
-       return I2OMSGINVALID;
-    }
-
-    if ( loc == REMOTE )
-    {
-       /* write to the inbound msg register of the device, pcsrbar as base  */
-       store_runtime_reg( base, I2O_IMR0+n*I2O_REG_OFFSET, msg );
-    }
-    else
-    {
-       /* write to the outbound msg register for PCI master to read, eumbbar as base */
-       store_runtime_reg( base, I2O_OMR0+n*I2O_REG_OFFSET, msg );
-    }
-
-    return I2OSUCCESS;
-}
-
-/***********************************************************************
- * function: I2ODBEnable
- *
- * description: Local processor enables it's inbound doorbell interrupt
- *              PCI master enables outbound doorbell interrupt of devices
- *              Other previously enabled interrupts are preserved.
- *              Return I2OSUCCESS if no error otherwise return I2ODBINVALID
- *
- * note:
- * In DoorBell interrupt is generated by PCI master and serviced by local processor
- * Out Doorbell interrupt is generated by local processor and serviced by PCI master
- *
- * Out Doorbell interrupt is generated by local processor and serviced by PCI master
- * PCI master needs to enable the outbound doorbell interrupts of device it wants to handle
- **********************************************************************/
-I2OSTATUS I2ODBEnable( LOCATION loc,        /*  REMOTE/LOCAL   */
-                 unsigned int base,   /* pcsrbar/eumbbar */
-                 unsigned int in_db ) /* when LOCAL, I2O_IN_DB, MC, I2O_IN_DB|MC */
-{
-
-    /* LOCATION - REMOTE : PCI master initializes outbound doorbell message of device
-     *            LOCAL  : Kahlua initializes its inbound doorbell message
-     */
-    unsigned int val;
-
-    if ( loc == LOCAL && ( in_db & 0x3 ) == 0 )
-    {
-       return I2ODBINVALID;
-    }
-
-    if ( loc == REMOTE )
-    {
-       /* pcsrbar is base */
-       val = load_runtime_reg( base, I2O_OMIMR );
-       val &= 0xfffffff7;
-       store_runtime_reg( base, I2O_OMIMR , val );
-    }
-    else
-    {
-       /* eumbbar is base */
-       val = load_runtime_reg( base, I2O_IMIMR);
-       in_db = ( (~in_db) & 0x3 ) << 3;
-       val = ( val & 0xffffffe7) | in_db;
-       store_runtime_reg( base,  I2O_IMIMR, val );
-    }
-
-    return I2OSUCCESS;
-}
-
-/**********************************************************************************
- * function: I2ODBDisable
- *
- * description: local processor disables its inbound DoorBell Interrupt
- *              PCI master disables outbound DoorBell interrupt of device
- *              Other previously enabled interrupts are preserved.
- *              return I2OSUCCESS if no error.Otherwise return I2ODBINVALID
- *
- * note:
- * local processor needs to disable its inbound doorbell interrupts it is not interested
- *
- * PCI master needs to disable outbound doorbell interrupts of device it is not interested
- ************************************************************************************/
-I2OSTATUS I2ODBDisable( LOCATION loc,          /*  REMOTE/LOCAL   */
-                       unsigned int base,     /* pcsrbar/eumbbar */
-                       unsigned int in_db )   /* when LOCAL, I2O_IN_DB, MC, I2O_IN_DB|MC */
-{
-    /* LOCATION - REMOTE : handle device's out bound message initialization
-     *            LOCAL  : handle local in bound message initialization
-     */
-    unsigned int val;
-
-    if ( loc == LOCAL && ( in_db & 0x3 ) == 0 )
-    {
-           return I2ODBINVALID;
-    }
-
-    if ( loc == REMOTE )
-    {
-       /* pcsrbar is the base */
-       val = load_runtime_reg( base, I2O_OMIMR );
-       val |= 0x8;
-       store_runtime_reg( base, I2O_OMIMR, val );
-    }
-    else
-    {
-           val = load_runtime_reg( base, I2O_IMIMR);
-           in_db = ( in_db & 0x3 ) << 3;
-           val |= in_db;
-           store_runtime_reg( base, I2O_IMIMR, val );
-    }
-
-    return I2OSUCCESS;
-}
-
-/**********************************************************************************
- * function: I2ODBGet
- *
- * description: Local processor reads its in doorbell register,
- *              PCI master reads the outdoorbell register of device.
- *              After a doorbell register is read, the whole register will be cleared.
- *              Otherwise, HW keeps generating interrupt.
- *
- * note:
- * If it is not local, pcsrbar must be passed to the function.
- * Otherwise eumbbar is passed.
- *
- * If it is remote, out doorbell register on the device is read.
- * Otherwise local in doorbell is read
- *
- * If the register is not cleared by write to it, any remaining bit of b'1's
- * will cause interrupt pending.
- *********************************************************************************/
-unsigned int I2ODBGet( LOCATION loc,         /*  REMOTE/LOCAL   */
-                      unsigned int base)    /* pcsrbar/eumbbar */
-{
-    unsigned int msg, val;
-
-    if ( loc == REMOTE )
-    {
-       /* read outbound doorbell register of device, pcsrbar is the base */
-       val = load_runtime_reg( base, I2O_ODBR );
-       msg = val & 0xe0000000;
-       store_runtime_reg( base, I2O_ODBR, val ); /* clear the register */
-    }
-    else
-    {
-       /* read the inbound doorbell register, eumbbar is the base */
-       val = load_runtime_reg( base, I2O_IDBR );
-       store_runtime_reg( base, I2O_IDBR, val ); /* clear the register */
-       msg = val;
-    }
-
-    return msg;
-}
-
-/**********************************************************************
- * function: I2ODBPost
- *
- * description: local processor writes to a outbound doorbell register,
- *              PCI master writes to the inbound doorbell register of device
- *
- * note:
- * If it is not local, pcsrbar must be passed to the function.
- * Otherwise eumbbar is passed.
- *
- * If it is remote, in doorbell register on the device is written.
- * Otherwise local out doorbell is written
- *********************************************************************/
-void I2ODBPost( LOCATION loc,             /*  REMOTE/LOCAL   */
-               unsigned int base,        /* pcsrbar/eumbbar */
-               unsigned int msg )        /*   in   / out    */
-{
-    if ( loc == REMOTE )
-    {
-       /* write to inbound doorbell register of device, pcsrbar is the base */
-       store_runtime_reg( base, I2O_IDBR, msg );
-    }
-    else
-    {
-       /* write to local outbound doorbell register, eumbbar is the base */
-       store_runtime_reg( base, I2O_ODBR, msg & 0x1fffffff );
-    }
-
-}
-
-/********************************************************************
- * function: I2OOutMsgStatGet
- *
- * description: PCI master reads device's outbound msg unit interrupt status.
- *              Reading an interrupt status register,
- *              the register will be cleared.
- *
- *              The value of the status register is AND with the outbound
- *              interrupt mask and result is returned.
- *
- * note:
- * pcsrbar must be passed to the function.
- ********************************************************************/
-I2OSTATUS I2OOutMsgStatGet( unsigned int pcsrbar, I2OOMSTAT *val )
-{
-    unsigned int stat;
-    unsigned int mask;
-
-    if ( val == 0 )
-    {
-           return I2OINVALID;
-    }
-
-    /* read device's outbound status */
-    stat = load_runtime_reg( pcsrbar, I2O_OMISR );
-    mask = load_runtime_reg( pcsrbar, I2O_OMIMR );
-    store_runtime_reg( pcsrbar, I2O_OMISR, stat & 0xffffffd7);
-
-    stat &= mask;
-    val->rsvd0 = ( stat & 0xffffffc0 ) >> 6;
-    val->opqi  = ( stat & 0x00000020 ) >> 5;
-    val->rsvd1 = ( stat & 0x00000010 ) >> 4;
-    val->odi   = ( stat & 0x00000008 ) >> 3;
-    val->rsvd2 = ( stat & 0x00000004 ) >> 2;
-    val->om1i  = ( stat & 0x00000002 ) >> 1;
-    val->om0i  = ( stat & 0x00000001 );
-
-    return I2OSUCCESS;
-}
-
-/********************************************************************
- * function: I2OInMsgStatGet
- *
- * description: Local processor reads its inbound msg unit interrupt status.
- *              Reading an interrupt status register,
- *              the register will be cleared.
- *
- *              The inbound msg interrupt status is AND with the inbound
- *              msg interrupt mask and result is returned.
- *
- * note:
- * eumbbar must be passed to the function.
- ********************************************************************/
-I2OSTATUS I2OInMsgStatGet(unsigned int eumbbar, I2OIMSTAT *val)
-{
-    unsigned int stat;
-    unsigned int mask;
-
-    if ( val == 0 )
-    {
-           return I2OINVALID;
-    }
-
-    /* read device's outbound status */
-    stat = load_runtime_reg( eumbbar, I2O_OMISR );
-    mask = load_runtime_reg( eumbbar, I2O_OMIMR );
-    store_runtime_reg( eumbbar, I2O_OMISR, stat & 0xffffffe7 );
-
-    stat &= mask;
-    val->rsvd0 = ( stat & 0xfffffe00 ) >> 9;
-    val->ofoi  = ( stat & 0x00000100 ) >> 8;
-    val->ipoi  = ( stat & 0x00000080 ) >> 7;
-    val->rsvd1 = ( stat & 0x00000040 ) >> 6;
-    val->ipqi  = ( stat & 0x00000020 ) >> 5;
-    val->mci   = ( stat & 0x00000010 ) >> 4;
-    val->idi   = ( stat & 0x00000008 ) >> 3;
-    val->rsvd2 = ( stat & 0x00000004 ) >> 2;
-    val->im1i  = ( stat & 0x00000002 ) >> 1;
-    val->im0i  = ( stat & 0x00000001 );
-
-    return I2OSUCCESS;
-
-}
-
-/***********************************************************
- * function: I2OFIFOInit
- *
- * description: Configure the I2O FIFO, including QBAR,
- *              IFHPR/IFTPR, IPHPR/IPTPR, OFHPR/OFTPR,
- *              OPHPR/OPTPR, MUCR.
- *
- *              return I2OSUCCESS if no error,
- *              otherwise return I2OQUEINVALID
- *
- * note: It is NOT this driver's responsibility of initializing
- *       MFA blocks, i.e., FIFO queue itself. The MFA blocks
- *       must be initialized before I2O unit can be used.
- ***********************************************************/
-I2OSTATUS I2OFIFOInit( unsigned int eumbbar,
-                      QUEUE_SIZE   sz,      /* value of CQS of MUCR */
-                      unsigned int qba)     /* queue base address that must be aligned at 1M */
-{
-
-    if ( ( qba & 0xfffff ) != 0 )
-    {
-       /* QBA must be aligned at 1Mbyte boundary */
-       return I2OQUEINVALID;
-    }
-
-    store_runtime_reg( eumbbar, I2O_QBAR, qba );
-    store_runtime_reg( eumbbar, I2O_MUCR, (unsigned int)sz );
-    store_runtime_reg( eumbbar, I2O_IFHPR, qba );
-    store_runtime_reg( eumbbar, I2O_IFTPR, qba );
-    store_runtime_reg( eumbbar, I2O_IPHPR, qba + 1 * ( sz << 11 ));
-    store_runtime_reg( eumbbar, I2O_IPTPR, qba + 1 * ( sz << 11 ));
-    store_runtime_reg( eumbbar, I2O_OFHPR, qba + 2 * ( sz << 11 ));
-    store_runtime_reg( eumbbar, I2O_OFTPR, qba + 2 * ( sz << 11 ));
-    store_runtime_reg( eumbbar, I2O_OPHPR, qba + 3 * ( sz << 11 ));
-    store_runtime_reg( eumbbar, I2O_OPTPR, qba + 3 * ( sz << 11 ));
-
-    fifo_stat.qsz = sz;
-    fifo_stat.qba = qba;
-
-    return I2OSUCCESS;
-}
-
-/**************************************************
- * function: I2OFIFOEnable
- *
- * description: Enable the circular queue
- *              return I2OSUCCESS if no error.
- *              Otherwise I2OQUEINVALID is returned.
- *
- * note:
- *************************************************/
-I2OSTATUS I2OFIFOEnable( unsigned int eumbbar )
-{
-    unsigned int val;
-
-    if ( fifo_stat.qba == 0xfffffff )
-    {
-       return I2OQUEINVALID;
-    }
-
-    val = load_runtime_reg( eumbbar, I2O_MUCR );
-    store_runtime_reg( eumbbar, I2O_MUCR, val | 0x1 );
-
-    return I2OSUCCESS;
-}
-
-/**************************************************
- * function: I2OFIFODisable
- *
- * description: Disable the circular queue
- *
- * note:
- *************************************************/
-void I2OFIFODisable( unsigned int eumbbar )
-{
-    if ( fifo_stat.qba == 0xffffffff )
-    {
-       /* not enabled */
-       return;
-    }
-
-    unsigned int val = load_runtime_reg( eumbbar, I2O_MUCR );
-    store_runtime_reg( eumbbar, I2O_MUCR, val & 0xfffffffe );
-}
-
-/****************************************************
- * function: I2OFIFOAlloc
- *
- * description: Allocate a free MFA from free FIFO.
- *              return I2OSUCCESS if no error.
- *              return I2OQUEEMPTY if no more free MFA.
- *              return I2OINVALID on other errors.
- *
- *              A free MFA must be allocated before a
- *              message can be posted.
- *
- * note:
- * PCI Master allocates a free MFA from inbound queue of device
- * (pcsrbar is the base,) through the inbound queue port of device
- * while local processor allocates a free MFA from its outbound
- * queue (eumbbar is the base.)
- *
- ****************************************************/
-I2OSTATUS I2OFIFOAlloc( LOCATION loc,
-                       unsigned int base,
-                       void         **pMsg )
-{
-    I2OSTATUS stat = I2OSUCCESS;
-    void *pHdr, *pTil;
-
-    if ( pMsg == 0 || *pMsg == 0 || fifo_stat.qba == 0xffffffff )
-    {
-       /* not configured */
-       return I2OQUEINVALID;
-    }
-
-    if ( loc == REMOTE )
-    {
-       /* pcsrbar is the base and read the inbound free tail ptr */
-       pTil = (void *)load_runtime_reg( base, I2O_IFQPR );
-       if ( ( (unsigned int)pTil & 0xFFFFFFF ) == 0xFFFFFFFF )
-       {
-           stat = I2OQUEEMPTY;
-       }
-       else
-       {
-           *pMsg = pTil;
-       }
-    }
-    else
-    {
-       /* eumbbar is the base and read the outbound free tail ptr */
-       pHdr = (void *)load_runtime_reg( base, I2O_OFHPR ); /* queue head */
-       pTil = (void *)load_runtime_reg( base, I2O_OFTPR ); /* queue tail */
-
-       /* check underflow */
-       if ( pHdr == pTil )
-       {
-           /* hdr and til point to the same fifo item, no free MFA */
-           stat = I2OQUEEMPTY;
-       }
-       else
-       {
-         /* update OFTPR */
-         *pMsg = (void *)(*(unsigned char *)pTil);
-         pTil = (void *)((unsigned int)pTil + 4);
-         if ( (unsigned int)pTil == fifo_stat.qba + ( 4 * ( fifo_stat.qsz << 11 ) ) )
-         {
-               /* reach the upper limit */
-               pTil = (void *)(fifo_stat.qba + ( 3 * (fifo_stat.qsz << 11) ));
-         }
-         store_runtime_reg( base, I2O_OFTPR, (unsigned int)pTil );
-       }
-    }
-
-    return stat;
-}
-
-/******************************************************
- * function: I2OFIFOFree
- *
- * description: Free a used MFA back to free queue after
- *              use.
- *              return I2OSUCCESS if no error.
- *              return I2OQUEFULL if inbound free queue
- *              overflow
- *
- * note: PCI Master frees a MFA into device's outbound queue
- *       (OFQPR) while local processor frees a MFA into its
- *       inbound queue (IFHPR).
- *****************************************************/
-I2OSTATUS I2OFIFOFree( LOCATION loc,
-                 unsigned int base,
-                 void *pMsg )
-{
-    void **pHdr, **pTil;
-    I2OSTATUS stat = I2OSUCCESS;
-
-    if ( fifo_stat.qba == 0xffffffff || pMsg == 0 )
-    {
-           return I2OQUEINVALID;
-    }
-
-    if ( loc == REMOTE )
-    {
-       /* pcsrbar is the base */
-       store_runtime_reg( base, I2O_OFQPR, (unsigned int)pMsg );
-    }
-    else
-    {
-       /* eumbbar is the base */
-       pHdr = (void **)load_runtime_reg( base, I2O_IFHPR );
-       pTil = (void **)load_runtime_reg( base, I2O_IFTPR );
-
-       /* store MFA */
-       *pHdr = pMsg;
-
-       /* update IFHPR */
-       pHdr += 4;
-
-       if ( (unsigned int)pHdr == fifo_stat.qba + ( fifo_stat.qsz << 11 ) )
-       {
-         /* reach the upper limit */
-         pHdr = (void **)fifo_stat.qba;
-       }
-
-       /* check inbound free queue overflow */
-       if ( pHdr != pTil )
-       {
-          store_runtime_reg( base, I2O_OPHPR, (unsigned int)pHdr);
-       }
-       else
-       {
-           stat = I2OQUEFULL;
-       }
-
-    }
-
-    return stat;
-
-}
-
-/*********************************************
- * function: I2OFIFOPost
- *
- * description: Post a msg into FIFO post queue
- *              the value of msg must be the one
- *              returned by I2OFIFOAlloc
- *
- * note: PCI Master posts a msg into device's inbound queue
- *       (IFQPR) while local processor post a msg into device's
- *       outbound queue (OPHPR)
- *********************************************/
-I2OSTATUS I2OFIFOPost( LOCATION loc,
-                      unsigned int base,
-                      void *pMsg )
-{
-    void **pHdr, **pTil;
-    I2OSTATUS stat = I2OSUCCESS;
-
-    if ( fifo_stat.qba == 0xffffffff || pMsg == 0 )
-    {
-       return I2OQUEINVALID;
-    }
-
-    if ( loc == REMOTE )
-    {
-       /* pcsrbar is the base */
-       store_runtime_reg( base, I2O_IFQPR, (unsigned int)pMsg );
-    }
-    else
-    {
-       /* eumbbar is the base */
-       pHdr = (void **)load_runtime_reg( base, I2O_OPHPR );
-       pTil = (void **)load_runtime_reg( base, I2O_OPTPR );
-
-       /* store MFA */
-       *pHdr = pMsg;
-
-       /* update IFHPR */
-       pHdr += 4;
-
-       if ( (unsigned int)pHdr == fifo_stat.qba + 3 * ( fifo_stat.qsz << 11 ) )
-       {
-         /* reach the upper limit */
-         pHdr = (void **)(fifo_stat.qba + 2 * ( fifo_stat.qsz << 11 ) );
-       }
-
-       /* check post queue overflow */
-       if ( pHdr != pTil )
-       {
-          store_runtime_reg( base, I2O_OPHPR, (unsigned int)pHdr);
-       }
-       else
-       {
-           stat = I2OQUEFULL;
-       }
-    }
-
-    return stat;
-}
-
-/************************************************
- * function: I2OFIFOGet
- *
- * description:  Read a msg from FIFO
- *               This function should be called
- *               only when there is a corresponding
- *               msg interrupt.
- *
- * note: PCI Master reads a msg from device's outbound queue
- *       (OFQPR) while local processor reads a msg from device's
- *       inbound queue (IPTPR)
- ************************************************/
-I2OSTATUS I2OFIFOGet( LOCATION loc,
-                      unsigned int base,
-                      void **pMsg )
-{
-    I2OSTATUS stat = I2OSUCCESS;
-    void *pHdr, *pTil;
-
-    if ( pMsg == 0 || *pMsg == 0 || fifo_stat.qba == 0xffffffff )
-    {
-       /* not configured */
-       return I2OQUEINVALID;
-    }
-
-    if ( loc == REMOTE )
-    {
-       /* pcsrbar is the base */
-       pTil = (void *)load_runtime_reg( base, I2O_OFQPR );
-       if ( ( (unsigned int)pTil & 0xFFFFFFF ) == 0xFFFFFFFF )
-       {
-           stat = I2OQUEEMPTY;
-       }
-       else
-       {
-           *pMsg = pTil;
-       }
-    }
-    else
-    {
-       /* eumbbar is the base and read the outbound free tail ptr */
-       pHdr = (void *)load_runtime_reg( base, I2O_IPHPR ); /* queue head */
-       pTil = (void *)load_runtime_reg( base, I2O_IPTPR ); /* queue tail */
-
-       /* check underflow */
-       if ( pHdr == pTil )
-       {
-           /* no free MFA */
-           stat = I2OQUEEMPTY;
-       }
-       else
-       {
-         /* update OFTPR */
-         *pMsg = (void *)(*(unsigned char *)pTil);
-         pTil = (void *)((unsigned int)pTil + 4);
-         if ( (unsigned int)pTil == fifo_stat.qba + 2 * ( fifo_stat.qsz << 11 ) )
-         {
-               /* reach the upper limit */
-               pTil = (void *)(fifo_stat.qba + 1 * (fifo_stat.qsz << 11) );
-         }
-
-         store_runtime_reg( base, I2O_IPTPR, (unsigned int)pTil );
-       }
-    }
-
-    return stat;
-}
-
-/********************************************************
- * function: I2OIOP
- *
- * description: Get the I2O PCI configuration identification
- *              register.
- *
- * note: PCI master should pass pcsrbar while local processor
- *       should pass eumbbar.
- *********************************************************/
-I2OSTATUS I2OPCIConfigGet( LOCATION loc,
-                       unsigned int base,
-                       I2OIOP * val)
-{
-    unsigned int tmp;
-    if ( val == 0 )
-    {
-           return I2OINVALID;
-    }
-    tmp = load_runtime_reg( base, PCI_CFG_CLA );
-    val->base_class = ( tmp & 0xFF) << 16;
-    tmp = load_runtime_reg( base, PCI_CFG_SCL );
-    val->sub_class= ( (tmp & 0xFF) << 8 );
-    tmp = load_runtime_reg( base, PCI_CFG_PIC );
-    val->prg_code = (tmp & 0xFF);
-    return I2OSUCCESS;
-}
-
-/*********************************************************
- * function: I2OFIFOIntEnable
- *
- * description: Enable the circular post queue interrupt
- *
- * note:
- * PCI master enables outbound FIFO interrupt of device
- * pscrbar is the base
- * Device enables its inbound FIFO interrupt
- * eumbbar is the base
- *******************************************************/
-void I2OFIFOIntEnable( LOCATION loc, unsigned int base  )
-{
-    unsigned int reg, val;
-
-    /* LOCATION - REMOTE : enable outbound message of device, pcsrbar as base
-     *            LOCAL  : enable local inbound message, eumbbar as base
-     */
-    reg = ( loc == REMOTE ? I2O_OMIMR : I2O_IMIMR );
-    val = load_runtime_reg( base, reg );
-
-    val &= 0xffffffdf; /* clear the msg interrupt bits */
-    store_runtime_reg( base, reg, val );
-
-}
-
-/****************************************************
- * function: I2OFIFOIntDisable
- *
- * description: Disable the circular post queue interrupt
- *
- * note:
- * PCI master disables outbound FIFO interrupt of device
- * (pscrbar is the base)
- * Device disables its inbound FIFO interrupt
- * (eumbbar is the base)
- *****************************************************/
-void I2OFIFOIntDisable( LOCATION loc, unsigned int base )
-{
-
-    /* LOCATION - REMOTE : disable outbound message interrupt of device, pcsrbar as base
-     *            LOCAL  : disable local inbound message interrupt, eumbbar as base
-     */
-    unsigned int reg = ( loc == REMOTE ? I2O_OMIMR : I2O_IMIMR );
-    unsigned int val = load_runtime_reg( base, reg );
-
-    val |= 0x00000020; /* masked out the msg interrupt bits */
-    store_runtime_reg( base, reg, val );
-
-}
-
-/*********************************************************
- * function: I2OFIFOOverflowIntEnable
- *
- * description: Enable the circular queue overflow interrupt
- *
- * note:
- * Device enables its inbound FIFO post overflow interrupt
- * and outbound free overflow interrupt.
- * eumbbar is the base
- *******************************************************/
-void I2OFIFOOverflowIntEnable( unsigned int eumbbar  )
-{
-    unsigned int val = load_runtime_reg( eumbbar, I2O_IMIMR );
-
-    val &= 0xfffffe7f; /* clear the two overflow interrupt bits */
-    store_runtime_reg( eumbbar, I2O_IMIMR, val );
-
-}
-
-/****************************************************
- * function: I2OFIFOOverflowIntDisable
- *
- * description: Disable the circular queue overflow interrupt
- *
- * note:
- * Device disables its inbound post FIFO overflow interrupt
- * and outbound free FIFO overflow interrupt
- * (eumbbar is the base)
- *****************************************************/
-void I2OFIFOOverflowIntDisable( unsigned int eumbbar )
-{
-
-    unsigned int val = load_runtime_reg( eumbbar, I2O_IMIMR );
-
-    val |= 0x00000180; /* masked out the msg overflow interrupt bits */
-    store_runtime_reg( eumbbar, I2O_IMIMR, val );
-}
diff --git a/cpu/mpc824x/drivers/i2o/i2o2.S b/cpu/mpc824x/drivers/i2o/i2o2.S
deleted file mode 100644 (file)
index 990f9ef..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/**************************************
- *
- * copyright @ Motorola, 1999
- *
- **************************************/
-
-/**********************************************************
- * function: load_runtime_reg
- *
- * input:  r3 - value of eumbbar
- *         r4 - register offset in embedded utility space
- *
- * output: r3 - register content
- **********************************************************/
-      .text
-      .align 2
-      .global load_runtime_reg
-
-load_runtime_reg:
-
-                 xor r5,r5,r5
-         or  r5,r5,r3       /* save eumbbar */
-
-             lwbrx     r3,r4,r5
-             sync
-
-             bclr 20, 0
-
-/****************************************************************
- * function: store_runtime_reg
- *
- * input: r3 - value of eumbbar
- *        r4 - register offset in embedded utility space
- *        r5 - new value to be stored
- *
- ****************************************************************/
-          .text
-          .align 2
-          .global store_runtime_reg
-store_runtime_reg:
-
-                 xor r0,r0,r0
-
-             stwbrx r5,  r4, r3
-             sync
-
-                 bclr   20,0
index b4c269f9c95d19ac4801a9a0e4dbe43b69c58c0a..b1f1c18992a20cede3ed226c68b507047e812883 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o kgdb.o
-OBJS   = traps.o serial_smc.o serial_scc.o cpu.o cpu_init.o speed.o \
+COBJS  = traps.o serial_smc.o serial_scc.o cpu.o cpu_init.o speed.o \
          interrupts.o ether_scc.o ether_fcc.o i2c.o commproc.o \
          bedbug_603e.o pci.o spi.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
-       $(AR) crv $@ $(OBJS) kgdb.o
+       $(AR) crv $@ $(OBJS) $(obj)kgdb.o
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 60df4cdec6a115f66082dcaf21e0a49ae6cfe404..f3fa6fd93ab96d4d44c6d30ce75684f219dbec1b 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+# 
 # Copyright 2004 Freescale Semiconductor, Inc.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
-START  = start.o \
-       resetvec.o
+START  = start.o resetvec.o
+COBJS  = traps.o cpu.o cpu_init.o speed.o interrupts.o \
+         i2c.o spd_sdram.o
 
-COBJS  = traps.o \
-         cpu.o \
-         cpu_init.o \
-         speed.o \
-         interrupts.o \
-         i2c.o \
-         spd_sdram.o
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
 
-OBJS   = $(COBJS)
-
-all:   .depend $(START) $(LIB)
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(AOBJS:.o=.S) $(COBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 5298dc113f2e6ed23d5f87cab71a687c5cdb0b62..bbc50844e0ffe2473a2b069a3352ed2d10230f9c 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (C) Copyright 2002,2003 Motorola Inc.
 # Xianghua Xiao,X.Xiao@motorola.com
 #
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o resetvec.o
 COBJS  = traps.o cpu.o cpu_init.o speed.o interrupts.o \
          pci.o serial_scc.o commproc.o ether_fcc.o i2c.o spd_sdram.o
-OBJS   = $(COBJS)
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(AOBJS:.o=.S) $(COBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index de75fad3cf0c1d9a95c694c78b6285adc7657275..6451e0551ba85d2a0faf0bc9362be6415daae741 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -25,25 +25,29 @@ include $(TOPDIR)/config.mk
 
 # CFLAGS += -DET_DEBUG
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o kgdb.o
-OBJS   = bedbug_860.o commproc.o cpu.o cpu_init.o      \
+COBJS  = bedbug_860.o commproc.o cpu.o cpu_init.o      \
          fec.o i2c.o interrupts.o lcd.o scc.o          \
          serial.o speed.o spi.o \
          traps.o upatch.o video.o
 SOBJS  = plprcr_write.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $(OBJS) $(SOBJS) kgdb.o
+all:   $(obj).depend $(START) $(LIB)
+
+$(LIB):        $(OBJS)
+       $(AR) crv $@ $(OBJS) $(obj)kgdb.o
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c) $(SOBJS:.o=.S)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) $(SOBJS:.o=.S) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 78553256a08fa7b543dbb2a3c66f14ad9f767bf4..cdab7b008ff4a82ef46e69713aee2a901928b7e8 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-AOBJS  = traps.o
-OBJS   = cpu.o interrupts.o serial.o asmi.o spi.o
+SOBJS  = traps.o
+COBJS  = cpu.o interrupts.o serial.o asmi.o spi.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
 
-$(LIB):        $(OBJS) $(AOBJS)
-       $(AR) crv $@ $(OBJS) $(AOBJS)
+all:   $(obj).depend $(START) $(LIB)
+
+$(LIB):        $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend: Makefile $(START:.o=.S) $(OBJS:.o=.c) $(AOBJS:.o=.S)
-       $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) $(AOBJS:.o=.S) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 11fda50c0c46a0e8e15d0e26cb8bda3b401044d0..f903129598f45c260cd75d45fc06424e86f70710 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-AOBJS  = exceptions.o
-OBJS   = cpu.o interrupts.o serial.o sysid.o traps.o epcs.o
+SOBJS  = exceptions.o
+COBJS  = cpu.o interrupts.o serial.o sysid.o traps.o epcs.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
 
-$(LIB):        $(OBJS) $(AOBJS)
-       $(AR) crv $@ $(OBJS) $(AOBJS)
+all:   $(obj).depend $(START) $(LIB)
+
+$(LIB):        $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend: Makefile $(START:.o=.S) $(OBJS:.o=.c) $(AOBJS:.o=.S)
-       $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) $(AOBJS:.o=.S) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 0b0686bcf716e8eb2136e52489dab41dc02d22fd..03128d3f6d16fea966d28e84474bf3870242806e 100644 (file)
@@ -555,7 +555,8 @@ void pci_440_init (struct pci_controller *hose)
 #ifdef CONFIG_PCI_SCAN_SHOW
                printf("PCI:   Bus Dev VenId DevId Class Int\n");
 #endif
-#if !defined(CONFIG_440EP) && !defined(CONFIG_440GR)
+#if !defined(CONFIG_440EP) && !defined(CONFIG_440GR) && \
+    !defined(CONFIG_440EPX) && !defined(CONFIG_440GRX)
                out16r( PCIX0_CMD, in16r( PCIX0_CMD ) | PCI_COMMAND_MASTER);
 #endif
                hose->last_busno = pci_hose_scan(hose);
index 2e920aadf0120943a5691ab009d3f698fb500805..6130cd283966d12032fa80afa891f160a54acbe7 100644 (file)
@@ -169,7 +169,7 @@ static void ppc440spe_setup_utl(u32 port) {
                break;
        }
        utl_base = (unsigned int *)(CFG_PCIE_BASE + 0x1000 * port);
-       
+
        /*
         * Set buffer allocations and then assert VRB and TXE.
         */
@@ -270,7 +270,7 @@ int ppc440spe_init_pcie(void)
        SDR_WRITE(PESDR0_PLLLCT1, SDR_READ(PESDR0_PLLLCT1) & ~(1 << 24));
        udelay(3);
 
-       while(time_out) {
+       while (time_out) {
                if (!(SDR_READ(PESDR0_PLLLCT3) & 0x10000000)) {
                        time_out--;
                        udelay(1);
@@ -284,6 +284,40 @@ int ppc440spe_init_pcie(void)
        return 0;
 }
 
+/*
+ *  Yucca board as End point and root point setup
+ *                    and
+ *    testing inbound and out bound windows
+ *
+ *  YUCCA board can be plugged into another yucca board or you can get PCI-E
+ *  cable which can be used to setup loop back from one port to another port.
+ *  Please rememeber that unless there is a endpoint plugged in to root port it
+ *  will not initialize. It is the same in case of endpoint , unless there is
+ *  root port attached it will not initialize.
+ *
+ *  In this release of software all the PCI-E ports are configured as either
+ *  endpoint or rootpoint.In future we will have support for selective ports
+ *  setup as endpoint and root point in single board.
+ *
+ *  Once your board came up as root point , you can verify by reading
+ *  /proc/bus/pci/devices. Where you can see the configuration registers
+ *  of end point device attached to the port.
+ *
+ *  Enpoint cofiguration can be verified by connecting Yucca board to any
+ *  host or another yucca board. Then try to scan the device. In case of
+ *  linux use "lspci" or appripriate os command.
+ *
+ *  How do I verify the inbound and out bound windows ?(yucca to yucca)
+ *  in this configuration inbound and outbound windows are setup to access
+ *  sram memroy area. SRAM is at 0x4 0000 0000 , on PLB bus. This address
+ *  is mapped at 0x90000000. From u-boot prompt write data 0xb000 0000,
+ *  This is waere your POM(PLB out bound memory window) mapped. then
+ *  read the data from other yucca board's u-boot prompt at address
+ *  0x9000 0000(SRAM). Data should match.
+ *  In case of inbound , write data to u-boot command prompt at 0xb000 0000
+ *  which is mapped to 0x4 0000 0000. Now on rootpoint yucca u-boot prompt check
+ *  data at 0x9000 0000(SRAM).Data should match.
+ */
 int ppc440spe_init_pcie_rootport(int port)
 {
        static int core_init;
@@ -326,7 +360,7 @@ int ppc440spe_init_pcie_rootport(int port)
                SDR_WRITE(PESDR0_HSSL6SET1, 0x35000000);
                SDR_WRITE(PESDR0_HSSL7SET1, 0x35000000);
                SDR_WRITE(PESDR0_RCSSET,
-                       (SDR_READ(PESDR0_RCSSET) & ~(1 << 24 | 1 << 16)) | 1 << 12);
+                         (SDR_READ(PESDR0_RCSSET) & ~(1 << 24 | 1 << 16)) | 1 << 12);
                break;
 
        case 1:
@@ -339,7 +373,7 @@ int ppc440spe_init_pcie_rootport(int port)
                SDR_WRITE(PESDR1_HSSL2SET1, 0x35000000);
                SDR_WRITE(PESDR1_HSSL3SET1, 0x35000000);
                SDR_WRITE(PESDR1_RCSSET,
-                       (SDR_READ(PESDR1_RCSSET) & ~(1 << 24 | 1 << 16)) | 1 << 12);
+                         (SDR_READ(PESDR1_RCSSET) & ~(1 << 24 | 1 << 16)) | 1 << 12);
                break;
 
        case 2:
@@ -351,6 +385,225 @@ int ppc440spe_init_pcie_rootport(int port)
                SDR_WRITE(PESDR2_HSSL1SET1, 0x35000000);
                SDR_WRITE(PESDR2_HSSL2SET1, 0x35000000);
                SDR_WRITE(PESDR2_HSSL3SET1, 0x35000000);
+               SDR_WRITE(PESDR2_RCSSET,
+                         (SDR_READ(PESDR2_RCSSET) & ~(1 << 24 | 1 << 16)) | 1 << 12);
+               break;
+       }
+       /*
+        * Notice: the following delay has critical impact on device
+        * initialization - if too short (<50ms) the link doesn't get up.
+        */
+       mdelay(100);
+
+       switch (port) {
+       case 0:
+               val = SDR_READ(PESDR0_RCSSTS);
+               break;
+       case 1:
+               val = SDR_READ(PESDR1_RCSSTS);
+               break;
+       case 2:
+               val = SDR_READ(PESDR2_RCSSTS);
+               break;
+       }
+
+       if (val & (1 << 20)) {
+               printf("PCIE%d: PGRST failed %08x\n", port, val);
+               return -1;
+       }
+
+       /*
+        * Verify link is up
+        */
+       val = 0;
+       switch (port) {
+       case 0:
+               val = SDR_READ(PESDR0_LOOP);
+               break;
+       case 1:
+               val = SDR_READ(PESDR1_LOOP);
+               break;
+       case 2:
+               val = SDR_READ(PESDR2_LOOP);
+               break;
+       }
+       if (!(val & 0x00001000)) {
+               printf("PCIE%d: link is not up.\n", port);
+               return -1;
+       }
+
+       /*
+        * Setup UTL registers - but only on revA!
+        * We use default settings for revB chip.
+        */
+       if (!ppc440spe_revB())
+               ppc440spe_setup_utl(port);
+
+       /*
+        * We map PCI Express configuration access into the 512MB regions
+        *
+        * NOTICE: revB is very strict about PLB real addressess and ranges to
+        * be mapped for config space; it seems to only work with d_nnnn_nnnn
+        * range (hangs the core upon config transaction attempts when set
+        * otherwise) while revA uses c_nnnn_nnnn.
+        *
+        * For revA:
+        *     PCIE0: 0xc_4000_0000
+        *     PCIE1: 0xc_8000_0000
+        *     PCIE2: 0xc_c000_0000
+        *
+        * For revB:
+        *     PCIE0: 0xd_0000_0000
+        *     PCIE1: 0xd_2000_0000
+        *     PCIE2: 0xd_4000_0000
+        */
+
+       switch (port) {
+       case 0:
+               if (ppc440spe_revB()) {
+                       mtdcr(DCRN_PEGPL_CFGBAH(PCIE0), 0x0000000d);
+                       mtdcr(DCRN_PEGPL_CFGBAL(PCIE0), 0x00000000);
+               } else {
+                       /* revA */
+                       mtdcr(DCRN_PEGPL_CFGBAH(PCIE0), 0x0000000c);
+                       mtdcr(DCRN_PEGPL_CFGBAL(PCIE0), 0x40000000);
+               }
+               mtdcr(DCRN_PEGPL_CFGMSK(PCIE0), 0xe0000001); /* 512MB region, valid */
+               break;
+
+       case 1:
+               if (ppc440spe_revB()) {
+                       mtdcr(DCRN_PEGPL_CFGBAH(PCIE1), 0x0000000d);
+                       mtdcr(DCRN_PEGPL_CFGBAL(PCIE1), 0x20000000);
+               } else {
+                       mtdcr(DCRN_PEGPL_CFGBAH(PCIE1), 0x0000000c);
+                       mtdcr(DCRN_PEGPL_CFGBAL(PCIE1), 0x80000000);
+               }
+               mtdcr(DCRN_PEGPL_CFGMSK(PCIE1), 0xe0000001); /* 512MB region, valid */
+               break;
+
+       case 2:
+               if (ppc440spe_revB()) {
+                       mtdcr(DCRN_PEGPL_CFGBAH(PCIE2), 0x0000000d);
+                       mtdcr(DCRN_PEGPL_CFGBAL(PCIE2), 0x40000000);
+               } else {
+                       mtdcr(DCRN_PEGPL_CFGBAH(PCIE2), 0x0000000c);
+                       mtdcr(DCRN_PEGPL_CFGBAL(PCIE2), 0xc0000000);
+               }
+               mtdcr(DCRN_PEGPL_CFGMSK(PCIE2), 0xe0000001); /* 512MB region, valid */
+               break;
+       }
+
+       /*
+        * Check for VC0 active and assert RDY.
+        */
+       attempts = 10;
+       switch (port) {
+       case 0:
+               while(!(SDR_READ(PESDR0_RCSSTS) & (1 << 16))) {
+                       if (!(attempts--)) {
+                               printf("PCIE0: VC0 not active\n");
+                               return -1;
+                       }
+                       mdelay(1000);
+               }
+               SDR_WRITE(PESDR0_RCSSET, SDR_READ(PESDR0_RCSSET) | 1 << 20);
+               break;
+       case 1:
+               while(!(SDR_READ(PESDR1_RCSSTS) & (1 << 16))) {
+                       if (!(attempts--)) {
+                               printf("PCIE1: VC0 not active\n");
+                               return -1;
+                       }
+                       mdelay(1000);
+               }
+
+               SDR_WRITE(PESDR1_RCSSET, SDR_READ(PESDR1_RCSSET) | 1 << 20);
+               break;
+       case 2:
+               while(!(SDR_READ(PESDR2_RCSSTS) & (1 << 16))) {
+                       if (!(attempts--)) {
+                               printf("PCIE2: VC0 not active\n");
+                               return -1;
+                       }
+                       mdelay(1000);
+               }
+
+               SDR_WRITE(PESDR2_RCSSET, SDR_READ(PESDR2_RCSSET) | 1 << 20);
+               break;
+       }
+       mdelay(100);
+
+       return 0;
+}
+
+int ppc440spe_init_pcie_endport(int port)
+{
+       static int core_init;
+       volatile u32 val = 0;
+       int attempts;
+
+       if (!core_init) {
+               ++core_init;
+               if (ppc440spe_init_pcie())
+                       return -1;
+       }
+
+       /*
+        * Initialize various parts of the PCI Express core for our port:
+        *
+        * - Set as a end port and enable max width
+        *   (PXIE0 -> X8, PCIE1 and PCIE2 -> X4).
+        * - Set up UTL configuration.
+        * - Increase SERDES drive strength to levels suggested by AMCC.
+        * - De-assert RSTPYN, RSTDL and RSTGU.
+        *
+        * NOTICE for revB chip: PESDRn_UTLSET2 is not set - we leave it with
+        * default setting 0x11310000. The register has new fields,
+        * PESDRn_UTLSET2[LKINE] in particular: clearing it leads to PCIE core
+        * hang.
+        */
+       switch (port) {
+       case 0:
+               SDR_WRITE(PESDR0_DLPSET,  1 << 24 | PTYPE_LEGACY_ENDPOINT << 20 | LNKW_X8 << 12);
+
+               SDR_WRITE(PESDR0_UTLSET1, 0x20222222);
+               if (!ppc440spe_revB())
+                       SDR_WRITE(PESDR0_UTLSET2, 0x11000000);
+               SDR_WRITE(PESDR0_HSSL0SET1, 0x35000000);
+               SDR_WRITE(PESDR0_HSSL1SET1, 0x35000000);
+               SDR_WRITE(PESDR0_HSSL2SET1, 0x35000000);
+               SDR_WRITE(PESDR0_HSSL3SET1, 0x35000000);
+               SDR_WRITE(PESDR0_HSSL4SET1, 0x35000000);
+               SDR_WRITE(PESDR0_HSSL5SET1, 0x35000000);
+               SDR_WRITE(PESDR0_HSSL6SET1, 0x35000000);
+               SDR_WRITE(PESDR0_HSSL7SET1, 0x35000000);
+               SDR_WRITE(PESDR0_RCSSET,
+                       (SDR_READ(PESDR0_RCSSET) & ~(1 << 24 | 1 << 16)) | 1 << 12);
+               break;
+
+       case 1:
+               SDR_WRITE(PESDR1_DLPSET, 1 << 24 | PTYPE_LEGACY_ENDPOINT << 20 | LNKW_X4 << 12);
+               SDR_WRITE(PESDR1_UTLSET1, 0x20222222);
+               if (!ppc440spe_revB())
+                       SDR_WRITE(PESDR1_UTLSET2, 0x11000000);
+               SDR_WRITE(PESDR1_HSSL0SET1, 0x35000000);
+               SDR_WRITE(PESDR1_HSSL1SET1, 0x35000000);
+               SDR_WRITE(PESDR1_HSSL2SET1, 0x35000000);
+               SDR_WRITE(PESDR1_HSSL3SET1, 0x35000000);
+               SDR_WRITE(PESDR1_RCSSET,
+                       (SDR_READ(PESDR1_RCSSET) & ~(1 << 24 | 1 << 16)) | 1 << 12);
+               break;
+
+       case 2:
+               SDR_WRITE(PESDR2_DLPSET, 1 << 24 | PTYPE_LEGACY_ENDPOINT << 20 | LNKW_X4 << 12);
+               SDR_WRITE(PESDR2_UTLSET1, 0x20222222);
+               if (!ppc440spe_revB())
+                       SDR_WRITE(PESDR2_UTLSET2, 0x11000000);
+               SDR_WRITE(PESDR2_HSSL0SET1, 0x35000000);
+               SDR_WRITE(PESDR2_HSSL1SET1, 0x35000000);
+               SDR_WRITE(PESDR2_HSSL2SET1, 0x35000000);
+               SDR_WRITE(PESDR2_HSSL3SET1, 0x35000000);
                SDR_WRITE(PESDR2_RCSSET,
                        (SDR_READ(PESDR2_RCSSET) & ~(1 << 24 | 1 << 16)) | 1 << 12);
                break;
@@ -418,7 +671,6 @@ int ppc440spe_init_pcie_rootport(int port)
         *     PCIE1: 0xd_2000_0000
         *     PCIE2: 0xd_4000_0000
         */
-
        switch (port) {
        case 0:
                if (ppc440spe_revB()) {
@@ -498,29 +750,33 @@ int ppc440spe_init_pcie_rootport(int port)
        return 0;
 }
 
-void ppc440spe_setup_pcie(struct pci_controller *hose, int port)
+void ppc440spe_setup_pcie_rootpoint(struct pci_controller *hose, int port)
 {
        volatile void *mbase = NULL;
+       volatile void *rmbase = NULL;
 
        pci_set_ops(hose,
-                       pcie_read_config_byte,
-                       pcie_read_config_word,
-                       pcie_read_config_dword,
-                       pcie_write_config_byte,
-                       pcie_write_config_word,
-                       pcie_write_config_dword);
-
-       switch(port) {
+                   pcie_read_config_byte,
+                   pcie_read_config_word,
+                   pcie_read_config_dword,
+                   pcie_write_config_byte,
+                   pcie_write_config_word,
+                   pcie_write_config_dword);
+
+       switch (port) {
        case 0:
                mbase = (u32 *)CFG_PCIE0_XCFGBASE;
+               rmbase = (u32 *)CFG_PCIE0_CFGBASE;
                hose->cfg_data = (u8 *)CFG_PCIE0_CFGBASE;
                break;
        case 1:
                mbase = (u32 *)CFG_PCIE1_XCFGBASE;
+               rmbase = (u32 *)CFG_PCIE1_CFGBASE;
                hose->cfg_data = (u8 *)CFG_PCIE1_CFGBASE;
                break;
        case 2:
                mbase = (u32 *)CFG_PCIE2_XCFGBASE;
+               rmbase = (u32 *)CFG_PCIE2_CFGBASE;
                hose->cfg_data = (u8 *)CFG_PCIE2_CFGBASE;
                break;
        }
@@ -528,14 +784,9 @@ void ppc440spe_setup_pcie(struct pci_controller *hose, int port)
        /*
         * Set bus numbers on our root port
         */
-       if (ppc440spe_revB()) {
-               out_8((u8 *)mbase + PCI_PRIMARY_BUS, 0);
-               out_8((u8 *)mbase + PCI_SECONDARY_BUS, 1);
-               out_8((u8 *)mbase + PCI_SUBORDINATE_BUS, 1);
-       } else {
-               out_8((u8 *)mbase + PCI_PRIMARY_BUS, 0);
-               out_8((u8 *)mbase + PCI_SECONDARY_BUS, 0);
-       }
+       out_8((u8 *)mbase + PCI_PRIMARY_BUS, 0);
+       out_8((u8 *)mbase + PCI_SECONDARY_BUS, 1);
+       out_8((u8 *)mbase + PCI_SUBORDINATE_BUS, 1);
 
        /*
         * Set up outbound translation to hose->mem_space from PLB
@@ -544,8 +795,7 @@ void ppc440spe_setup_pcie(struct pci_controller *hose, int port)
         * subregions and to enable the outbound translation.
         */
        out_le32(mbase + PECFG_POM0LAH, 0x00000000);
-       out_le32(mbase + PECFG_POM0LAL, (CFG_PCIE_MEMBASE +
-                       port * CFG_PCIE_MEMSIZE));
+       out_le32(mbase + PECFG_POM0LAL, 0x00000000);
 
        switch (port) {
        case 0:
@@ -579,14 +829,134 @@ void ppc440spe_setup_pcie(struct pci_controller *hose, int port)
        out_le32(mbase + PCI_BASE_ADDRESS_1, 0);
        out_le32(mbase + PECFG_BAR0HMPA, 0x7fffffc);
        out_le32(mbase + PECFG_BAR0LMPA, 0);
+
+       out_le32(mbase + PECFG_PIM01SAH, 0xffff0000);
+       out_le32(mbase + PECFG_PIM01SAL, 0x00000000);
        out_le32(mbase + PECFG_PIM0LAL, 0);
        out_le32(mbase + PECFG_PIM0LAH, 0);
+       out_le32(mbase + PECFG_PIM1LAL,  0x00000000);
+       out_le32(mbase + PECFG_PIM1LAH,  0x00000004);
+       out_le32(mbase + PECFG_PIMEN, 0x1);
+
+       /* Enable I/O, Mem, and Busmaster cycles */
+       out_le16((u16 *)(mbase + PCI_COMMAND),
+                in_le16((u16 *)(mbase + PCI_COMMAND)) |
+                PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
+       printf("PCIE:%d successfully set as rootpoint\n",port);
+}
+
+int ppc440spe_setup_pcie_endpoint(struct pci_controller *hose, int port)
+{
+       volatile void *mbase = NULL;
+       int attempts = 0;
+
+       pci_set_ops(hose,
+                   pcie_read_config_byte,
+                   pcie_read_config_word,
+                   pcie_read_config_dword,
+                   pcie_write_config_byte,
+                   pcie_write_config_word,
+                   pcie_write_config_dword);
+
+       switch (port) {
+       case 0:
+               mbase = (u32 *)CFG_PCIE0_XCFGBASE;
+               hose->cfg_data = (u8 *)CFG_PCIE0_CFGBASE;
+               break;
+       case 1:
+               mbase = (u32 *)CFG_PCIE1_XCFGBASE;
+               hose->cfg_data = (u8 *)CFG_PCIE1_CFGBASE;
+               break;
+       case 2:
+               mbase = (u32 *)CFG_PCIE2_XCFGBASE;
+               hose->cfg_data = (u8 *)CFG_PCIE2_CFGBASE;
+               break;
+       }
+
+       /*
+        * Set up outbound translation to hose->mem_space from PLB
+        * addresses at an offset of 0xd_0000_0000.  We set the low
+        * bits of the mask to 11 to turn off splitting into 8
+        * subregions and to enable the outbound translation.
+        */
+       out_le32(mbase + PECFG_POM0LAH, 0x00001ff8);
+       out_le32(mbase + PECFG_POM0LAL, 0x00001000);
+
+       switch (port) {
+       case 0:
+               mtdcr(DCRN_PEGPL_OMR1BAH(PCIE0),  0x0000000d);
+               mtdcr(DCRN_PEGPL_OMR1BAL(PCIE0),  CFG_PCIE_MEMBASE +
+                       port * CFG_PCIE_MEMSIZE);
+               mtdcr(DCRN_PEGPL_OMR1MSKH(PCIE0), 0x7fffffff);
+               mtdcr(DCRN_PEGPL_OMR1MSKL(PCIE0),
+                       ~(CFG_PCIE_MEMSIZE - 1) | 3);
+               break;
+       case 1:
+               mtdcr(DCRN_PEGPL_OMR1BAH(PCIE1),  0x0000000d);
+               mtdcr(DCRN_PEGPL_OMR1BAL(PCIE1),  (CFG_PCIE_MEMBASE +
+                       port * CFG_PCIE_MEMSIZE));
+               mtdcr(DCRN_PEGPL_OMR1MSKH(PCIE1), 0x7fffffff);
+               mtdcr(DCRN_PEGPL_OMR1MSKL(PCIE1),
+                       ~(CFG_PCIE_MEMSIZE - 1) | 3);
+               break;
+       case 2:
+               mtdcr(DCRN_PEGPL_OMR1BAH(PCIE2),  0x0000000d);
+               mtdcr(DCRN_PEGPL_OMR1BAL(PCIE2),  (CFG_PCIE_MEMBASE +
+                       port * CFG_PCIE_MEMSIZE));
+               mtdcr(DCRN_PEGPL_OMR1MSKH(PCIE2), 0x7fffffff);
+               mtdcr(DCRN_PEGPL_OMR1MSKL(PCIE2),
+                       ~(CFG_PCIE_MEMSIZE - 1) | 3);
+               break;
+       }
+
+       /* Set up 16GB inbound memory window at 0 */
+       out_le32(mbase + PCI_BASE_ADDRESS_0, 0);
+       out_le32(mbase + PCI_BASE_ADDRESS_1, 0);
+       out_le32(mbase + PECFG_BAR0HMPA, 0x7fffffc);
+       out_le32(mbase + PECFG_BAR0LMPA, 0);
+       out_le32(mbase + PECFG_PIM0LAL, 0x00000000);
+       out_le32(mbase + PECFG_PIM0LAH, 0x00000004);    /* pointing to SRAM */
        out_le32(mbase + PECFG_PIMEN, 0x1);
 
        /* Enable I/O, Mem, and Busmaster cycles */
        out_le16((u16 *)(mbase + PCI_COMMAND),
                 in_le16((u16 *)(mbase + PCI_COMMAND)) |
                 PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
+       out_le16(mbase + 0x200,0xcaad);                 /* Setting vendor ID */
+       out_le16(mbase + 0x202,0xfeed);                 /* Setting device ID */
+       attempts = 10;
+       switch (port) {
+       case 0:
+               while (!(SDR_READ(PESDR0_RCSSTS) & (1 << 8))) {
+                       if (!(attempts--)) {
+                               printf("PCIE0: BMEN is  not active\n");
+                               return -1;
+                       }
+                       mdelay(1000);
+               }
+               break;
+       case 1:
+               while (!(SDR_READ(PESDR1_RCSSTS) & (1 << 8))) {
+                       if (!(attempts--)) {
+                               printf("PCIE1: BMEN is not active\n");
+                               return -1;
+                       }
+                       mdelay(1000);
+               }
+               break;
+       case 2:
+               while (!(SDR_READ(PESDR2_RCSSTS) & (1 << 8))) {
+                       if (!(attempts--)) {
+                               printf("PCIE2: BMEN is  not active\n");
+                               return -1;
+                       }
+                       mdelay(1000);
+               }
+               break;
+       }
+       printf("PCIE:%d successfully set as endpoint\n",port);
+
+       return 0;
 }
 #endif /* CONFIG_PCI */
 #endif /* CONFIG_440SPE */
index 47df7620a6d6a4cd88ef2fa3457b37db88564293..2becc777222b0732c838d5d242fa8768cf7e6f81 100644 (file)
  */
 #define PECFG_BAR0LMPA         0x210
 #define PECFG_BAR0HMPA         0x214
+#define PECFG_BAR1MPA          0x218
+#define PECFG_BAR2MPA          0x220
+
 #define PECFG_PIMEN            0x33c
 #define PECFG_PIM0LAL          0x340
 #define PECFG_PIM0LAH          0x344
+#define PECFG_PIM1LAL          0x348
+#define PECFG_PIM1LAH          0x34c
+#define PECFG_PIM01SAL         0x350
+#define PECFG_PIM01SAH         0x354
+
 #define PECFG_POM0LAL          0x380
 #define PECFG_POM0LAH          0x384
 
 int ppc440spe_init_pcie(void);
 int ppc440spe_init_pcie_rootport(int port);
 void yucca_setup_pcie_fpga_rootpoint(int port);
-void ppc440spe_setup_pcie(struct pci_controller *hose, int port);
+void ppc440spe_setup_pcie_rootpoint(struct pci_controller *hose, int port);
+int ppc440spe_setup_pcie_endpoint(struct pci_controller *hose, int port);
 int yucca_pcie_card_present(int port);
 int pcie_hose_scan(struct pci_controller *hose, int bus);
 #endif /* __440SPE_PCIE_H */
index fab65aff78acb90eb89a608c0e5be1349d7a4ad3..5b1c17c351a529e0b9ec96dfba7751dcb44ee026 100644 (file)
 #define BI_PHYMODE_NONE         0
 #define BI_PHYMODE_ZMII         1
 #define BI_PHYMODE_RGMII 2
+#define BI_PHYMODE_GMII  3
+#define BI_PHYMODE_RTBI  4
+#define BI_PHYMODE_TBI   5
+#if defined (CONFIG_440EPX)
+#define BI_PHYMODE_SMII  6
+#define BI_PHYMODE_MII   7
+#endif
 
+#if defined(CONFIG_440SPE) || defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
+#define SDR0_MFR_ETH_CLK_SEL_V(n)      ((0x01<<27) / (n+1))
+#endif
 
 /*-----------------------------------------------------------------------------+
  * Global variables. TX and RX descriptors and buffers.
@@ -181,7 +191,7 @@ static void ppc_4xx_eth_halt (struct eth_device *dev)
 {
        EMAC_4XX_HW_PST hw_p = dev->priv;
        uint32_t failsafe = 10000;
-#if defined(CONFIG_440SPE)
+#if defined(CONFIG_440SPE) || defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
        unsigned long mfr;
 #endif
 
@@ -205,19 +215,19 @@ static void ppc_4xx_eth_halt (struct eth_device *dev)
        }
 
        /* EMAC RESET */
-#if defined(CONFIG_440SPE)
+#if defined(CONFIG_440SPE) || defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
        /* provide clocks for EMAC internal loopback  */
        mfsdr (sdr_mfr, mfr);
-       mfr |= 0x08000000;
+       mfr |= SDR0_MFR_ETH_CLK_SEL_V(hw_p->devnum);
        mtsdr(sdr_mfr, mfr);
 #endif
 
        out32 (EMAC_M0 + hw_p->hw_addr, EMAC_M0_SRST);
 
-#if defined(CONFIG_440SPE)
+#if defined(CONFIG_440SPE) || defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
        /* remove clocks for EMAC internal loopback  */
        mfsdr (sdr_mfr, mfr);
-       mfr &= ~0x08000000;
+       mfr &= ~SDR0_MFR_ETH_CLK_SEL_V(hw_p->devnum);
        mtsdr(sdr_mfr, mfr);
 #endif
 
@@ -317,10 +327,50 @@ int ppc_4xx_eth_setup_bridge(int devnum, bd_t * bis)
        out32 (RGMII_FER, rmiifer);
 
        return ((int)pfc1);
-
 }
 #endif /* CONFIG_440_GX */
 
+#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
+int ppc_4xx_eth_setup_bridge(int devnum, bd_t * bis)
+{
+       unsigned long zmiifer=0x0;
+
+       /*
+        * Right now only 2*RGMII is supported. Please extend when needed.
+        * sr - 2006-08-29
+        */
+       switch (1) {
+       case 0:
+               /* 1 x GMII port */
+               out32 (ZMII_FER, 0x00);
+               out32 (RGMII_FER, 0x00000037);
+               bis->bi_phymode[0] = BI_PHYMODE_GMII;
+               bis->bi_phymode[1] = BI_PHYMODE_NONE;
+               break;
+       case 1:
+               /* 2 x RGMII ports */
+               out32 (ZMII_FER, 0x00);
+               out32 (RGMII_FER, 0x00000055);
+               bis->bi_phymode[0] = BI_PHYMODE_RGMII;
+               bis->bi_phymode[1] = BI_PHYMODE_RGMII;
+               break;
+       case 2:
+               /* 2 x SMII ports */
+
+               break;
+       default:
+               break;
+       }
+
+       /* Ensure we setup mdio for this devnum and ONLY this devnum */
+       zmiifer = in32 (ZMII_FER);
+       zmiifer |= (ZMII_FER_MDI) << ZMII_FER_V(devnum);
+       out32 (ZMII_FER, zmiifer);
+
+       return ((int)0x0);
+}
+#endif /* CONFIG_440EPX */
+
 static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
 {
        int i, j;
@@ -332,13 +382,16 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
        unsigned mode_reg;
        unsigned short devnum;
        unsigned short reg_short;
-#if defined(CONFIG_440GX) || defined(CONFIG_440SP) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440GX) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
+    defined(CONFIG_440SP) || defined(CONFIG_440SPE)
        sys_info_t sysinfo;
-#if defined(CONFIG_440GX) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440GX) || defined(CONFIG_440SPE) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
        int ethgroup = -1;
 #endif
 #endif
-#if defined(CONFIG_440SPE)
+#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || defined(CONFIG_440SPE)
        unsigned long mfr;
 #endif
 
@@ -352,7 +405,9 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
                return -1;
        }
 
-#if defined(CONFIG_440GX) || defined(CONFIG_440SP) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440GX) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
+    defined(CONFIG_440SP) || defined(CONFIG_440SPE)
        /* Need to get the OPB frequency so we can access the PHY */
        get_sys_info (&sysinfo);
 #endif
@@ -407,7 +462,7 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
 
 #if defined(CONFIG_440EP) || defined(CONFIG_440GR)
        out32 (ZMII_FER, (ZMII_FER_RMII | ZMII_FER_MDI) << ZMII_FER_V (devnum));
-#elif defined(CONFIG_440GX)
+#elif defined(CONFIG_440GX) || defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
        ethgroup = ppc_4xx_eth_setup_bridge(devnum, bis);
 #elif defined(CONFIG_440GP)
        /* set RMII mode */
@@ -429,10 +484,10 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
        __asm__ volatile ("eieio");
 
        /* reset emac so we have access to the phy */
-#if defined(CONFIG_440SPE)
+#if defined(CONFIG_440SPE) || defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
        /* provide clocks for EMAC internal loopback  */
        mfsdr (sdr_mfr, mfr);
-       mfr |= 0x08000000;
+       mfr |= SDR0_MFR_ETH_CLK_SEL_V(devnum);
        mtsdr(sdr_mfr, mfr);
 #endif
 
@@ -444,15 +499,19 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
                udelay (1000);
                failsafe--;
        }
+       if (failsafe <= 0)
+               printf("\nProblem resetting EMAC!\n");
 
-#if defined(CONFIG_440SPE)
+#if defined(CONFIG_440SPE) || defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
        /* remove clocks for EMAC internal loopback  */
        mfsdr (sdr_mfr, mfr);
-       mfr &= ~0x08000000;
+       mfr &= ~SDR0_MFR_ETH_CLK_SEL_V(devnum);
        mtsdr(sdr_mfr, mfr);
 #endif
 
-#if defined(CONFIG_440GX) || defined(CONFIG_440SP) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440GX) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
+    defined(CONFIG_440SP) || defined(CONFIG_440SPE)
        /* Whack the M1 register */
        mode_reg = 0x0;
        mode_reg &= ~0x00000038;
@@ -502,15 +561,39 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
         * otherwise, just check the speeds & feeds
         */
        if (hw_p->first_init == 0) {
+#if defined(CONFIG_88E1111_CLK_DELAY)
+               /*
+                * On some boards (e.g. ALPR) the Marvell 88E1111 PHY needs
+                * the "RGMII transmit timing control" and "RGMII receive
+                * timing control" bits set, so that Gbit communication works
+                * without problems.
+                * Also set the "Transmitter disable" to 1 to enable the
+                * transmitter.
+                * After setting these bits a soft-reset must occur for this
+                * change to become active.
+                */
+               miiphy_read (dev->name, reg, 0x14, &reg_short);
+               reg_short |= (1 << 7) | (1 << 1) | (1 << 0);
+               miiphy_write (dev->name, reg, 0x14, reg_short);
+#endif
+#if defined(CONFIG_M88E1111_PHY) /* test-only: merge with CONFIG_88E1111_CLK_DELAY !!! */
+               miiphy_write (dev->name, reg, 0x14, 0x0ce3);
+               miiphy_write (dev->name, reg, 0x18, 0x4101);
+               miiphy_write (dev->name, reg, 0x09, 0x0e00);
+               miiphy_write (dev->name, reg, 0x04, 0x01e1);
+#endif
                miiphy_reset (dev->name, reg);
 
-#if defined(CONFIG_440GX) || defined(CONFIG_440SP) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440GX) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
+    defined(CONFIG_440SP) || defined(CONFIG_440SPE)
+
 #if defined(CONFIG_CIS8201_PHY)
                /*
                 * Cicada 8201 PHY needs to have an extended register whacked
                 * for RGMII mode.
                 */
-               if ( ((devnum == 2) || (devnum ==3)) && (4 == ethgroup) ) {
+               if (((devnum == 2) || (devnum == 3)) && (4 == ethgroup)) {
 #if defined(CONFIG_CIS8201_SHORT_ETCH)
                        miiphy_write (dev->name, reg, 23, 0x1300);
 #else
@@ -580,7 +663,8 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
                        (int) speed, (duplex == HALF) ? "HALF" : "FULL");
        }
 
-#if defined(CONFIG_440) && !defined(CONFIG_440SP) && !defined(CONFIG_440SPE)
+#if defined(CONFIG_440) && !defined(CONFIG_440SP) && !defined(CONFIG_440SPE) && \
+    !defined(CONFIG_440EPX) && !defined(CONFIG_440GRX)
 #if defined(CONFIG_440EP) || defined(CONFIG_440GR)
        mfsdr(sdr_mfr, reg);
        if (speed == 100) {
@@ -603,15 +687,34 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
                        reg = (RGMII_SSR_SP_1000MBPS << RGMII_SSR_V (devnum));
                else if (speed == 100)
                        reg = (RGMII_SSR_SP_100MBPS << RGMII_SSR_V (devnum));
-               else
+               else if (speed == 10)
                        reg = (RGMII_SSR_SP_10MBPS << RGMII_SSR_V (devnum));
-
+               else {
+                       printf("Error in RGMII Speed\n");
+                       return -1;
+               }
                out32 (RGMII_SSR, reg);
        }
 #endif /* defined(CONFIG_440) && !defined(CONFIG_440SP) */
 
+#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
+       if (speed == 1000)
+               reg = (RGMII_SSR_SP_1000MBPS << RGMII_SSR_V (devnum));
+       else if (speed == 100)
+               reg = (RGMII_SSR_SP_100MBPS << RGMII_SSR_V (devnum));
+       else if (speed == 10)
+               reg = (RGMII_SSR_SP_10MBPS << RGMII_SSR_V (devnum));
+       else {
+               printf("Error in RGMII Speed\n");
+               return -1;
+       }
+       out32 (RGMII_SSR, reg);
+#endif
+
        /* set the Mal configuration reg */
-#if defined(CONFIG_440GX) || defined(CONFIG_440SP) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440GX) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
+    defined(CONFIG_440SP) || defined(CONFIG_440SPE)
        mtdcr (malmcr, MAL_CR_PLBB | MAL_CR_OPBBL | MAL_CR_LEA |
               MAL_CR_PLBLT_DEFAULT | MAL_CR_EOPIE | 0x00330000);
 #else
@@ -795,8 +898,10 @@ static int ppc_4xx_eth_init (struct eth_device *dev, bd_t * bis)
 
        /* set speed */
        if (speed == _1000BASET) {
-#if defined(CONFIG_440SP) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
                unsigned long pfc1;
+
                mfsdr (sdr_pfc1, pfc1);
                pfc1 |= SDR0_PFC1_EM_1000;
                mtsdr (sdr_pfc1, pfc1);
@@ -942,6 +1047,14 @@ static int ppc_4xx_eth_send (struct eth_device *dev, volatile void *ptr,
 #define UIC0SR         uic0sr
 #endif
 
+#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
+#define UICMSR_ETHX    uic0msr
+#define UICSR_ETHX     uic0sr
+#else
+#define UICMSR_ETHX    uic1msr
+#define UICSR_ETHX     uic1sr
+#endif
+
 int enetInt (struct eth_device *dev)
 {
        int serviced;
@@ -950,6 +1063,7 @@ int enetInt (struct eth_device *dev)
        unsigned long emac_isr = 0;
        unsigned long mal_rx_eob;
        unsigned long my_uic0msr, my_uic1msr;
+       unsigned long my_uicmsr_ethx;
 
 #if defined(CONFIG_440GX)
        unsigned long my_uic2msr;
@@ -977,8 +1091,11 @@ int enetInt (struct eth_device *dev)
 #if defined(CONFIG_440GX)
                my_uic2msr = mfdcr (uic2msr);
 #endif
+               my_uicmsr_ethx = mfdcr (UICMSR_ETHX);
+
                if (!(my_uic0msr & (UIC_MRE | UIC_MTE))
-                   && !(my_uic1msr & (UIC_ETH0 | UIC_ETH1 | UIC_MS | UIC_MTDE | UIC_MRDE))) {
+                   && !(my_uic1msr & (UIC_MS | UIC_MTDE | UIC_MRDE))
+                   && !(my_uicmsr_ethx & (UIC_ETH0 | UIC_ETH1))) {
                        /* not for us */
                        return (rc);
                }
@@ -997,8 +1114,7 @@ int enetInt (struct eth_device *dev)
                        mal_isr = mfdcr (malesr);
                        /* look for mal error */
                        if (my_uic1msr & (UIC_MS | UIC_MTDE | UIC_MRDE)) {
-                               mal_err (dev, mal_isr, my_uic0msr,
-                                        MAL_UIC_DEF, MAL_UIC_ERR);
+                               mal_err (dev, mal_isr, my_uic1msr, MAL_UIC_DEF, MAL_UIC_ERR);
                                serviced = 1;
                                rc = 0;
                        }
@@ -1006,7 +1122,7 @@ int enetInt (struct eth_device *dev)
 
                /* port by port dispatch of emac interrupts */
                if (hw_p->devnum == 0) {
-                       if (UIC_ETH0 & my_uic1msr) {    /* look for EMAC errors */
+                       if (UIC_ETH0 & my_uicmsr_ethx) {        /* look for EMAC errors */
                                emac_isr = in32 (EMAC_ISR + hw_p->hw_addr);
                                if ((hw_p->emac_ier & emac_isr) != 0) {
                                        emac_err (dev, emac_isr);
@@ -1017,14 +1133,15 @@ int enetInt (struct eth_device *dev)
                        if ((hw_p->emac_ier & emac_isr)
                            || (my_uic1msr & (UIC_MS | UIC_MTDE | UIC_MRDE))) {
                                mtdcr (UIC0SR, UIC_MRE | UIC_MTE);      /* Clear */
-                               mtdcr (uic1sr, UIC_ETH0 | UIC_MS | UIC_MTDE | UIC_MRDE);        /* Clear */
+                               mtdcr (uic1sr, UIC_MS | UIC_MTDE | UIC_MRDE);   /* Clear */
+                               mtdcr (UICSR_ETHX, UIC_ETH0); /* Clear */
                                return (rc);    /* we had errors so get out */
                        }
                }
 
 #if !defined(CONFIG_440SP)
                if (hw_p->devnum == 1) {
-                       if (UIC_ETH1 & my_uic1msr) {    /* look for EMAC errors */
+                       if (UIC_ETH1 & my_uicmsr_ethx) {        /* look for EMAC errors */
                                emac_isr = in32 (EMAC_ISR + hw_p->hw_addr);
                                if ((hw_p->emac_ier & emac_isr) != 0) {
                                        emac_err (dev, emac_isr);
@@ -1035,7 +1152,8 @@ int enetInt (struct eth_device *dev)
                        if ((hw_p->emac_ier & emac_isr)
                            || (my_uic1msr & (UIC_MS | UIC_MTDE | UIC_MRDE))) {
                                mtdcr (UIC0SR, UIC_MRE | UIC_MTE);      /* Clear */
-                               mtdcr (uic1sr, UIC_ETH1 | UIC_MS | UIC_MTDE | UIC_MRDE);        /* Clear */
+                               mtdcr (uic1sr, UIC_MS | UIC_MTDE | UIC_MRDE); /* Clear */
+                               mtdcr (UICSR_ETHX, UIC_ETH1); /* Clear */
                                return (rc);    /* we had errors so get out */
                        }
                }
@@ -1102,10 +1220,10 @@ int enetInt (struct eth_device *dev)
                mtdcr (uic1sr, UIC_MS | UIC_MTDE | UIC_MRDE);   /* Clear */
                switch (hw_p->devnum) {
                case 0:
-                       mtdcr (uic1sr, UIC_ETH0);
+                       mtdcr (UICSR_ETHX, UIC_ETH0);
                        break;
                case 1:
-                       mtdcr (uic1sr, UIC_ETH1);
+                       mtdcr (UICSR_ETHX, UIC_ETH1);
                        break;
 #if defined (CONFIG_440GX)
                case 2:
@@ -1512,7 +1630,7 @@ int ppc_4xx_eth_initialize (bd_t * bis)
 
                if (0 == virgin) {
                        /* set the MAL IER ??? names may change with new spec ??? */
-#if defined(CONFIG_440SPE)
+#if defined(CONFIG_440SPE) || defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
                        mal_ier =
                                MAL_IER_PT | MAL_IER_PRE | MAL_IER_PWE |
                                MAL_IER_DE | MAL_IER_OTE | MAL_IER_OE | MAL_IER_PE ;
index 7d6990f9a876e05fbffc0b7dbe7edb759bdef436..16dc8d62c05c986dfe71af8cd44b27f12c76e0e7 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o resetvec.o kgdb.o
-AOBJS  = dcr.o
+SOBJS  = dcr.o
 COBJS  = 405gp_pci.o 4xx_enet.o \
          bedbug_405.o commproc.o \
          cpu.o cpu_init.o i2c.o interrupts.o \
-         miiphy.o sdram.o serial.o \
+         miiphy.o ndfc.o sdram.o serial.o \
          spd_sdram.o speed.o traps.o usb_ohci.o usbdev.o \
          440spe_pcie.o
 
-OBJS   = $(AOBJS) $(COBJS)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
 
-all:   .depend $(START) $(LIB)
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(AOBJS:.o=.S) $(COBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index bc51fbfdbedcf20c9455c910a1631487f7d8eb87..94478dbb109ea3c7e3a86907cc96636bc4159219 100644 (file)
 DECLARE_GLOBAL_DATA_PTR;
 #endif
 
-
 #if defined(CONFIG_440)
 #define FREQ_EBC               (sys_info.freqEPB)
 #else
 #define FREQ_EBC               (sys_info.freqPLB / sys_info.pllExtBusDiv)
 #endif
 
-#if defined(CONFIG_405GP) || defined(CONFIG_440EP) || defined(CONFIG_440GR)
+#if defined(CONFIG_405GP) || \
+    defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 
 #define PCI_ASYNC
 
@@ -58,7 +59,8 @@ int pci_async_enabled(void)
        return (mfdcr(strap) & PSR_PCI_ASYNC_EN);
 #endif
 
-#if defined(CONFIG_440EP) || defined(CONFIG_440GR)
+#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
        unsigned long val;
 
        mfsdr(sdr_sdstp1, val);
@@ -82,9 +84,10 @@ int pci_arbiter_enabled(void)
        return (mfdcr(cpc0_strp1) & CPC0_STRP1_PAE_MASK);
 #endif
 
-#if defined(CONFIG_440GX) || defined(CONFIG_440EP) || \
-     defined(CONFIG_440GR) || defined(CONFIG_440SP) || \
-     defined(CONFIG_440SPE)
+#if defined(CONFIG_440GX) || \
+    defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
+    defined(CONFIG_440SP) || defined(CONFIG_440SPE)
        unsigned long val;
 
        mfsdr(sdr_sdstp1, val);
@@ -93,8 +96,10 @@ int pci_arbiter_enabled(void)
 }
 #endif
 
-#if defined(CONFIG_405EP) || defined(CONFIG_440EP) || defined(CONFIG_440GR) ||  \
-     defined(CONFIG_440GX) || defined(CONFIG_440SP) || defined(CONFIG_440SPE)
+#if defined(CONFIG_405EP) || defined(CONFIG_440GX) || \
+    defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
+    defined(CONFIG_440SP) || defined(CONFIG_440SPE)
 
 #define I2C_BOOTROM
 
@@ -102,17 +107,75 @@ int i2c_bootrom_enabled(void)
 {
 #if defined(CONFIG_405EP)
        return (mfdcr(cpc0_boot) & CPC0_BOOT_SEP);
-#endif
-
-#if defined(CONFIG_440GX) || defined(CONFIG_440EP) || \
-     defined(CONFIG_440GR) || defined(CONFIG_440SP) || \
-       defined(CONFIG_440SPE)
+#else
        unsigned long val;
 
        mfsdr(sdr_sdcs, val);
        return (val & SDR0_SDCS_SDD);
 #endif
 }
+
+#if defined(CONFIG_440GX)
+#define SDR0_PINSTP_SHIFT      29
+static char *bootstrap_str[] = {
+       "EBC (16 bits)",
+       "EBC (8 bits)",
+       "EBC (32 bits)",
+       "EBC (8 bits)",
+       "PCI",
+       "I2C (Addr 0x54)",
+       "Reserved",
+       "I2C (Addr 0x50)",
+};
+#endif
+
+#if defined(CONFIG_440SP) || defined(CONFIG_440SPE)
+#define SDR0_PINSTP_SHIFT      30
+static char *bootstrap_str[] = {
+       "EBC (8 bits)",
+       "PCI",
+       "I2C (Addr 0x54)",
+       "I2C (Addr 0x50)",
+};
+#endif
+
+#if defined(CONFIG_440EP) || defined(CONFIG_440GR)
+#define SDR0_PINSTP_SHIFT      29
+static char *bootstrap_str[] = {
+       "EBC (8 bits)",
+       "PCI",
+       "NAND (8 bits)",
+       "EBC (16 bits)",
+       "EBC (16 bits)",
+       "I2C (Addr 0x54)",
+       "PCI",
+       "I2C (Addr 0x52)",
+};
+#endif
+
+#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
+#define SDR0_PINSTP_SHIFT      29
+static char *bootstrap_str[] = {
+       "EBC (8 bits)",
+       "EBC (16 bits)",
+       "EBC (16 bits)",
+       "NAND (8 bits)",
+       "PCI",
+       "I2C (Addr 0x54)",
+       "PCI",
+       "I2C (Addr 0x52)",
+};
+#endif
+
+#if defined(SDR0_PINSTP_SHIFT)
+static int bootstrap_option(void)
+{
+       unsigned long val;
+
+       mfsdr(sdr_pinstp, val);
+       return ((val & 0xe0000000) >> SDR0_PINSTP_SHIFT);
+}
+#endif /* SDR0_PINSTP_SHIFT */
 #endif
 
 
@@ -244,6 +307,22 @@ int checkcpu (void)
 #endif /* CONFIG_440GR */
 #endif /* CONFIG_440 */
 
+       case PVR_440EPX1_RA:
+               puts("EPx Rev. A - Security/Kasumi support");
+               break;
+
+       case PVR_440EPX2_RA:
+               puts("EPx Rev. A - No Security/Kasumi support");
+               break;
+
+       case PVR_440GRX1_RA:
+               puts("GRx Rev. A - Security/Kasumi support");
+               break;
+
+       case PVR_440GRX2_RA:
+               puts("GRx Rev. A - No Security/Kasumi support");
+               break;
+
        case PVR_440SP_RA:
                puts("SP Rev. A");
                break;
@@ -272,6 +351,10 @@ int checkcpu (void)
 
 #if defined(I2C_BOOTROM)
        printf ("       I2C boot EEPROM %sabled\n", i2c_bootrom_enabled() ? "en" : "dis");
+#if defined(SDR0_PINSTP_SHIFT)
+       printf ("       Bootstrap Option %c - ", (char)bootstrap_option() + 'A');
+       printf ("Boot ROM Location %s\n", bootstrap_str[bootstrap_option()]);
+#endif
 #endif
 
 #if defined(CONFIG_PCI)
index 886f405156229a730667660a5ca848f9bcfeeaf8..c5a9f02566af75c5d142d743392ef9ab9677e16a 100644 (file)
@@ -57,12 +57,13 @@ static struct irq_action irq_vecs1[32]; /* For UIC1 */
 
 void uic1_interrupt( void * parms); /* UIC1 handler */
 
-#if defined(CONFIG_440GX) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440GX) || defined(CONFIG_440SPE) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 static struct irq_action irq_vecs2[32]; /* For UIC2 */
 void uic2_interrupt( void * parms); /* UIC2 handler */
 #endif /* CONFIG_440GX CONFIG_440SPE */
 
-#if defined(CONFIG_440SPE)
+#if defined(CONFIG_440SPE) || defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 static struct irq_action irq_vecs3[32]; /* For UIC3 */
 void uic3_interrupt( void * parms); /* UIC3 handler */
 #endif /* CONFIG_440SPE */
@@ -119,12 +120,13 @@ int interrupt_init_cpu (unsigned *decrementer_count)
                irq_vecs1[vec].handler = NULL;
                irq_vecs1[vec].arg = NULL;
                irq_vecs1[vec].count = 0;
-#if defined(CONFIG_440GX) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440GX) || defined(CONFIG_440SPE) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
                irq_vecs2[vec].handler = NULL;
                irq_vecs2[vec].arg = NULL;
                irq_vecs2[vec].count = 0;
 #endif /* CONFIG_440GX */
-#if defined(CONFIG_440SPE)
+#if defined(CONFIG_440SPE) || defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
                irq_vecs3[vec].handler = NULL;
                irq_vecs3[vec].arg = NULL;
                irq_vecs3[vec].count = 0;
@@ -230,6 +232,32 @@ void external_interrupt(struct pt_regs *regs)
 
 } /* external_interrupt CONFIG_440GX */
 
+#elif defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
+void external_interrupt(struct pt_regs *regs)
+{
+       ulong uic_msr;
+
+       /*
+        * Read masked interrupt status register to determine interrupt source
+        */
+       /* 440 SPe uses base uic register */
+       uic_msr = mfdcr(uic0msr);
+
+       if ( (UICB0_UIC1CI & uic_msr) || (UICB0_UIC1NCI & uic_msr) )
+               uic1_interrupt(0);
+
+       if ( (UICB0_UIC2CI & uic_msr) || (UICB0_UIC2NCI & uic_msr) )
+               uic2_interrupt(0);
+
+       if (uic_msr & ~(UICB0_ALL))
+               uic0_interrupt(0);
+
+       mtdcr(uic0sr, uic_msr);
+
+       return;
+
+} /* external_interrupt CONFIG_440EPX & CONFIG_440GRX */
+
 #elif defined(CONFIG_440SPE)
 void external_interrupt(struct pt_regs *regs)
 {
@@ -303,7 +331,8 @@ void external_interrupt(struct pt_regs *regs)
 }
 #endif
 
-#if defined(CONFIG_440GX) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440GX) || defined(CONFIG_440SPE) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 /* Handler for UIC0 interrupt */
 void uic0_interrupt( void * parms)
 {
@@ -394,7 +423,8 @@ void uic1_interrupt( void * parms)
 }
 #endif /* defined(CONFIG_440) */
 
-#if defined(CONFIG_440GX) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440GX) || defined(CONFIG_440SPE) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 /* Handler for UIC2 interrupt */
 void uic2_interrupt( void * parms)
 {
@@ -496,7 +526,8 @@ void irq_install_handler (int vec, interrupt_handler_t * handler, void *arg)
        int i = vec;
 
 #if defined(CONFIG_440)
-#if defined(CONFIG_440GX) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440GX) || defined(CONFIG_440SPE) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
        if ((vec > 31) && (vec < 64)) {
                i = vec - 32;
                irqa = irq_vecs1;
@@ -523,7 +554,8 @@ void irq_install_handler (int vec, interrupt_handler_t * handler, void *arg)
        irqa[i].arg = arg;
 
 #if defined(CONFIG_440)
-#if defined(CONFIG_440GX) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440GX) || defined(CONFIG_440SPE) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
        if ((vec > 31) && (vec < 64))
                mtdcr (uic1er, mfdcr (uic1er) | (0x80000000 >> i));
        else if (vec > 63)
@@ -546,7 +578,8 @@ void irq_free_handler (int vec)
        int i = vec;
 
 #if defined(CONFIG_440)
-#if defined(CONFIG_440GX) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440GX) || defined(CONFIG_440SPE) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
        if ((vec > 31) && (vec < 64)) {
                irqa = irq_vecs1;
                i = vec - 32;
@@ -567,7 +600,8 @@ void irq_free_handler (int vec)
 #endif
 
 #if defined(CONFIG_440)
-#if defined(CONFIG_440GX) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440GX) || defined(CONFIG_440SPE) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
        if ((vec > 31) && (vec < 64))
                mtdcr (uic1er, mfdcr (uic1er) & ~(0x80000000 >> i));
        else if (vec > 63)
@@ -635,7 +669,8 @@ do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        printf("\n");
 #endif
 
-#if defined(CONFIG_440GX) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440GX) || defined(CONFIG_440SPE) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
        printf ("\nUIC 2\n");
        printf ("Nr  Routine   Arg       Count\n");
 
index aa580ed48f99376a68ec0ce77be3cb24aadc0c26..6b98025308f502e4fd30f7ff172a110c1451db27 100644 (file)
@@ -173,7 +173,8 @@ int emac4xx_miiphy_read (char *devname, unsigned char addr,
        }
        sta_reg = reg;          /* reg address */
        /* set clock (50Mhz) and read flags */
-#if defined(CONFIG_440GX) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440GX) || defined(CONFIG_440SPE) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 #if defined(CONFIG_IBM_EMAC4_V4)      /* EMAC4 V4 changed bit setting */
                sta_reg = (sta_reg & ~EMAC_STACR_OP_MASK) | EMAC_STACR_READ;
 #else
@@ -183,7 +184,9 @@ int emac4xx_miiphy_read (char *devname, unsigned char addr,
        sta_reg = (sta_reg | EMAC_STACR_READ) & ~EMAC_STACR_CLK_100MHZ;
 #endif
 
-#if defined(CONFIG_PHY_CLK_FREQ) && !defined(CONFIG_440GX) && !defined(CONFIG__440SP) && !defined(CONFIG__440SPE)
+#if defined(CONFIG_PHY_CLK_FREQ) && !defined(CONFIG_440GX) && \
+    !defined(CONFIG_440SP) && !defined(CONFIG_440SPE) && \
+    !defined(CONFIG_440EPX) && !defined(CONFIG_440GRX)
        sta_reg = sta_reg | CONFIG_PHY_CLK_FREQ;
 #endif
        sta_reg = sta_reg | (addr << 5);        /* Phy address */
@@ -244,7 +247,8 @@ int emac4xx_miiphy_write (char *devname, unsigned char addr,
        sta_reg = 0;
        sta_reg = reg;          /* reg address */
        /* set clock (50Mhz) and read flags */
-#if defined(CONFIG_440GX) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440GX) || defined(CONFIG_440SPE) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 #if defined(CONFIG_IBM_EMAC4_V4)      /* EMAC4 V4 changed bit setting */
                sta_reg = (sta_reg & ~EMAC_STACR_OP_MASK) | EMAC_STACR_WRITE;
 #else
@@ -254,7 +258,9 @@ int emac4xx_miiphy_write (char *devname, unsigned char addr,
        sta_reg = (sta_reg | EMAC_STACR_WRITE) & ~EMAC_STACR_CLK_100MHZ;
 #endif
 
-#if defined(CONFIG_PHY_CLK_FREQ) && !defined(CONFIG_440GX) && !defined(CONFIG__440SP) && !defined(CONFIG__440SPE)
+#if defined(CONFIG_PHY_CLK_FREQ) && !defined(CONFIG_440GX) && \
+    !defined(CONFIG_440SP) && !defined(CONFIG_440SPE) && \
+    !defined(CONFIG_440EPX) && !defined(CONFIG_440GRX)
        sta_reg = sta_reg | CONFIG_PHY_CLK_FREQ;        /* Set clock frequency (PLB freq. dependend) */
 #endif
        sta_reg = sta_reg | ((unsigned long) addr << 5);/* Phy address */
diff --git a/cpu/ppc4xx/ndfc.c b/cpu/ppc4xx/ndfc.c
new file mode 100644 (file)
index 0000000..c255f93
--- /dev/null
@@ -0,0 +1,175 @@
+/*
+ * Overview:
+ *   Platform independend driver for NDFC (NanD Flash Controller)
+ *   integrated into EP440 cores
+ *
+ * (C) Copyright 2006
+ * Stefan Roese, DENX Software Engineering, sr@denx.de.
+ *
+ * Based on original work by
+ *     Thomas Gleixner
+ *     Copyright 2006 IBM
+ *
+ * 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
+ */
+
+#include <common.h>
+
+#if (CONFIG_COMMANDS & CFG_CMD_NAND) && !defined(CFG_NAND_LEGACY) && \
+       (defined(CONFIG_440EP) || defined(CONFIG_440GR) ||           \
+        defined(CONFIG_440EPX) || defined(CONFIG_440GRX))
+
+#include <nand.h>
+#include <linux/mtd/ndfc.h>
+#include <asm/processor.h>
+#include <ppc440.h>
+
+static u8 hwctl = 0;
+
+static void ndfc_hwcontrol(struct mtd_info *mtdinfo, int cmd)
+{
+       switch (cmd) {
+       case NAND_CTL_SETCLE:
+               hwctl |= 0x1;
+               break;
+
+       case NAND_CTL_CLRCLE:
+               hwctl &= ~0x1;
+               break;
+
+       case NAND_CTL_SETALE:
+               hwctl |= 0x2;
+               break;
+
+       case NAND_CTL_CLRALE:
+               hwctl &= ~0x2;
+               break;
+       }
+}
+
+static void ndfc_write_byte(struct mtd_info *mtdinfo, u_char byte)
+{
+        struct nand_chip *this = mtdinfo->priv;
+        ulong base = (ulong) this->IO_ADDR_W;
+
+       if (hwctl & 0x1)
+               out8(base + NDFC_CMD, byte);
+       else if (hwctl & 0x2)
+               out8(base + NDFC_ALE, byte);
+       else
+               out8(base + NDFC_DATA, byte);
+}
+
+static u_char ndfc_read_byte(struct mtd_info *mtdinfo)
+{
+        struct nand_chip *this = mtdinfo->priv;
+        ulong base = (ulong) this->IO_ADDR_W;
+
+       return (in8(base + NDFC_DATA));
+}
+
+static int ndfc_dev_ready(struct mtd_info *mtdinfo)
+{
+        struct nand_chip *this = mtdinfo->priv;
+        ulong base = (ulong) this->IO_ADDR_W;
+
+       while (!(in32(base + NDFC_STAT) & NDFC_STAT_IS_READY))
+               ;
+
+       return 1;
+}
+
+#ifndef CONFIG_NAND_SPL
+/*
+ * Don't use these speedup functions in NAND boot image, since the image
+ * has to fit into 4kByte.
+ */
+
+/*
+ * Speedups for buffer read/write/verify
+ *
+ * NDFC allows 32bit read/write of data. So we can speed up the buffer
+ * functions. No further checking, as nand_base will always read/write
+ * page aligned.
+ */
+static void ndfc_read_buf(struct mtd_info *mtdinfo, uint8_t *buf, int len)
+{
+        struct nand_chip *this = mtdinfo->priv;
+        ulong base = (ulong) this->IO_ADDR_W;
+       uint32_t *p = (uint32_t *) buf;
+
+       for(;len > 0; len -= 4)
+               *p++ = in32(base + NDFC_DATA);
+}
+
+static void ndfc_write_buf(struct mtd_info *mtdinfo, const uint8_t *buf, int len)
+{
+        struct nand_chip *this = mtdinfo->priv;
+        ulong base = (ulong) this->IO_ADDR_W;
+       uint32_t *p = (uint32_t *) buf;
+
+       for(; len > 0; len -= 4)
+               out32(base + NDFC_DATA, *p++);
+}
+
+static int ndfc_verify_buf(struct mtd_info *mtdinfo, const uint8_t *buf, int len)
+{
+        struct nand_chip *this = mtdinfo->priv;
+        ulong base = (ulong) this->IO_ADDR_W;
+       uint32_t *p = (uint32_t *) buf;
+
+       for(; len > 0; len -= 4)
+               if (*p++ != in32(base + NDFC_DATA))
+                       return -1;
+
+       return 0;
+}
+#endif /* #ifndef CONFIG_NAND_SPL */
+
+void board_nand_init(struct nand_chip *nand)
+{
+       nand->eccmode = NAND_ECC_SOFT;
+
+       nand->hwcontrol  = ndfc_hwcontrol;
+       nand->read_byte  = ndfc_read_byte;
+       nand->write_byte = ndfc_write_byte;
+       nand->dev_ready  = ndfc_dev_ready;
+
+#ifndef CONFIG_NAND_SPL
+       nand->write_buf  = ndfc_write_buf;
+       nand->read_buf   = ndfc_read_buf;
+       nand->verify_buf = ndfc_verify_buf;
+#else
+       /*
+        * Setup EBC (CS0 only right now)
+        */
+       mtdcr(ebccfga, xbcfg);
+       mtdcr(ebccfgd, 0xb8400000);
+
+       mtebc(pb0cr, CFG_EBC_PB0CR);
+       mtebc(pb0ap, CFG_EBC_PB0AP);
+#endif
+
+       /* Set NandFlash Core Configuration Register */
+       /* Chip select 3, 1col x 2 rows */
+       out32(CFG_NAND_BASE + NDFC_CCR, 0x00000000 | (CFG_NAND_CS << 24));
+       out32(CFG_NAND_BASE + NDFC_BCFG0 + (CFG_NAND_CS << 2), 0x80002222);
+}
+
+#endif
index ad3ca6e819e2f0378e114834c5e9533d8baea06c..fab0d9500630f403dd1f6f6f2b0f22bb2618dbff 100644 (file)
@@ -264,10 +264,12 @@ int serial_tstc ()
 #endif /* CONFIG_IOP480 */
 
 /*****************************************************************************/
-#if defined(CONFIG_405GP) || defined(CONFIG_405CR) || defined(CONFIG_440) || defined(CONFIG_405EP)
+#if defined(CONFIG_405GP) || defined(CONFIG_405CR) || defined(CONFIG_405EP) || \
+    defined(CONFIG_440)
 
 #if defined(CONFIG_440)
-#if defined(CONFIG_440EP) || defined(CONFIG_440GR)
+#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 #define UART0_BASE  CFG_PERIPHERAL_BASE + 0x00000300
 #define UART1_BASE  CFG_PERIPHERAL_BASE + 0x00000400
 #else
@@ -279,15 +281,34 @@ int serial_tstc ()
 #define UART2_BASE  CFG_PERIPHERAL_BASE + 0x00000600
 #endif
 
-#if defined(CONFIG_440GX) || defined(CONFIG_440EP) || defined(CONFIG_440GR) || defined(CONFIG_440SP) || defined(CONFIG_440SPE)
-#define CR0_MASK        0xdfffffff
-#define CR0_EXTCLK_ENA  0x00800000
-#define CR0_UDIV_POS    0
-#else
+#if defined(CONFIG_440GP)
 #define CR0_MASK        0x3fff0000
 #define CR0_EXTCLK_ENA  0x00600000
 #define CR0_UDIV_POS    16
-#endif /* CONFIG_440GX */
+#define UDIV_SUBTRACT  1
+#define UART0_SDR      cntrl0
+#define MFREG(a, d)    d = mfdcr(a)
+#define MTREG(a, d)    mtdcr(a, d)
+#else /* #if defined(CONFIG_440GP) */
+/* all other 440 PPC's access clock divider via sdr register */
+#define CR0_MASK        0xdfffffff
+#define CR0_EXTCLK_ENA  0x00800000
+#define CR0_UDIV_POS    0
+#define UDIV_SUBTRACT  0
+#define UART0_SDR      sdr_uart0
+#define UART1_SDR      sdr_uart1
+#if defined(CONFIG_440EP) || defined(CONFIG_440EPx) || \
+    defined(CONFIG_440GR) || defined(CONFIG_440GRx) || \
+    defined(CONFIG_440SP) || defined(CONFIG_440SPe)
+#define UART2_SDR      sdr_uart2
+#endif
+#if defined(CONFIG_440EP) || defined(CONFIG_440EPx) || \
+    defined(CONFIG_440GR) || defined(CONFIG_440GRx)
+#define UART3_SDR      sdr_uart3
+#endif
+#define MFREG(a, d)    mfsdr(a, d)
+#define MTREG(a, d)    mtsdr(a, d)
+#endif /* #if defined(CONFIG_440GP) */
 #elif defined(CONFIG_405EP)
 #define UART0_BASE      0xef600300
 #define UART1_BASE      0xef600400
@@ -309,21 +330,15 @@ int serial_tstc ()
 #if defined(CONFIG_UART1_CONSOLE)
 #define ACTING_UART0_BASE      UART1_BASE
 #define ACTING_UART1_BASE      UART0_BASE
-#if defined(CONFIG_440GX) || defined(CONFIG_440EP) || \
-       defined(CONFIG_440GR) || defined(CONFIG_440SP) || \
-       defined(CONFIG_440SPE)
-#define UART0_SDR           sdr_uart1
-#define UART1_SDR           sdr_uart0
-#endif /* CONFIG_440GX */
 #else
 #define ACTING_UART0_BASE      UART0_BASE
 #define ACTING_UART1_BASE      UART1_BASE
-#if defined(CONFIG_440GX) || defined(CONFIG_440EP) || \
-       defined(CONFIG_440GR) || defined(CONFIG_440SP) || \
-       defined(CONFIG_440SPE)
-#define UART0_SDR           sdr_uart0
-#define UART1_SDR           sdr_uart1
-#endif /* CONFIG_440GX */
+#endif
+
+#if defined(CONFIG_SERIAL_MULTI)
+#define UART_BASE      dev_base
+#else
+#define UART_BASE      ACTING_UART0_BASE
 #endif
 
 #if defined(CONFIG_405EP) && defined(CFG_EXT_SERIAL_CLOCK)
@@ -419,7 +434,7 @@ static void serial_divs (int baudrate, unsigned long *pudiv,
        *pbdiv = div/udiv;
 
 }
-#endif /* defined(CONFIG_440) && !defined(CFG_EXT_SERIAL_CLK */
+#endif /* defined(CONFIG_440) && !defined(CFG_EXT_SERIAL_CLK) */
 
 /*
  * Minimal serial functions needed to use one of the SMC ports
@@ -441,23 +456,9 @@ int serial_init(void)
        unsigned long tmp;
 #endif
 
-#if defined(CONFIG_440GX) || defined(CONFIG_440SP) || \
-       defined(CONFIG_440SPE)
-#if defined(CONFIG_SERIAL_MULTI)
-       if (UART0_BASE == dev_base) {
-               mfsdr(UART0_SDR,reg);
-               reg &= ~CR0_MASK;
-       } else {
-               mfsdr(UART1_SDR,reg);
-               reg &= ~CR0_MASK;
-       }
-#else
-       mfsdr(UART0_SDR,reg);
+       MFREG(UART0_SDR, reg);
        reg &= ~CR0_MASK;
-#endif
-#else
-       reg = mfdcr(cntrl0) & ~CR0_MASK;
-#endif /* CONFIG_440GX */
+
 #ifdef CFG_EXT_SERIAL_CLOCK
        reg |= CR0_EXTCLK_ENA;
        udiv = 1;
@@ -471,47 +472,34 @@ int serial_init(void)
        serial_divs (gd->baudrate, &udiv, &bdiv);
 #endif
 
-#if defined(CONFIG_440GX) || defined(CONFIG_440EP) || \
-       defined(CONFIG_440GR) || defined(CONFIG_440SP) || \
-       defined(CONFIG_440SPE)
-       reg |= udiv << CR0_UDIV_POS;    /* set the UART divisor */
-#if defined(CONFIG_SERIAL_MULTI)
-       if (UART0_BASE == dev_base) {
-               mtsdr (UART0_SDR,reg);
-       } else {
-               mtsdr (UART1_SDR,reg);
-       }
-#else
-       mtsdr (UART0_SDR,reg);
+       reg |= (udiv - UDIV_SUBTRACT) << CR0_UDIV_POS;  /* set the UART divisor */
+
+       /*
+        * Configure input clock to baudrate generator for all
+        * available serial ports here
+        */
+       MTREG(UART0_SDR, reg);
+#if defined(UART1_SDR)
+       MTREG(UART1_SDR, reg);
 #endif
-#else
-       reg |= (udiv - 1) << CR0_UDIV_POS;      /* set the UART divisor */
-       mtdcr (cntrl0, reg);
+#if defined(UART2_SDR)
+       MTREG(UART2_SDR, reg);
 #endif
-
-#if defined(CONFIG_SERIAL_MULTI)
-       out8 (dev_base + UART_LCR, 0x80);       /* set DLAB bit */
-       out8 (dev_base + UART_DLL, bdiv);       /* set baudrate divisor */
-       out8 (dev_base + UART_DLM, bdiv >> 8);/* set baudrate divisor */
-       out8 (dev_base + UART_LCR, 0x03);       /* clear DLAB; set 8 bits, no parity */
-       out8 (dev_base + UART_FCR, 0x00);       /* disable FIFO */
-       out8 (dev_base + UART_MCR, 0x00);       /* no modem control DTR RTS */
-       val = in8 (dev_base + UART_LSR);        /* clear line status */
-       val = in8 (dev_base + UART_RBR);        /* read receive buffer */
-       out8 (dev_base + UART_SCR, 0x00);       /* set scratchpad */
-       out8 (dev_base + UART_IER, 0x00);       /* set interrupt enable reg */
-#else
-       out8 (ACTING_UART0_BASE + UART_LCR, 0x80);      /* set DLAB bit */
-       out8 (ACTING_UART0_BASE + UART_DLL, bdiv);      /* set baudrate divisor */
-       out8 (ACTING_UART0_BASE + UART_DLM, bdiv >> 8);/* set baudrate divisor */
-       out8 (ACTING_UART0_BASE + UART_LCR, 0x03);      /* clear DLAB; set 8 bits, no parity */
-       out8 (ACTING_UART0_BASE + UART_FCR, 0x00);      /* disable FIFO */
-       out8 (ACTING_UART0_BASE + UART_MCR, 0x00);      /* no modem control DTR RTS */
-       val = in8 (ACTING_UART0_BASE + UART_LSR);       /* clear line status */
-       val = in8 (ACTING_UART0_BASE + UART_RBR);       /* read receive buffer */
-       out8 (ACTING_UART0_BASE + UART_SCR, 0x00);      /* set scratchpad */
-       out8 (ACTING_UART0_BASE + UART_IER, 0x00);      /* set interrupt enable reg */
+#if defined(UART3_SDR)
+       MTREG(UART3_SDR, reg);
 #endif
+
+       out8(UART_BASE + UART_LCR, 0x80);       /* set DLAB bit */
+       out8(UART_BASE + UART_DLL, bdiv);       /* set baudrate divisor */
+       out8(UART_BASE + UART_DLM, bdiv >> 8);  /* set baudrate divisor */
+       out8(UART_BASE + UART_LCR, 0x03);       /* clear DLAB; set 8 bits, no parity */
+       out8(UART_BASE + UART_FCR, 0x00);       /* disable FIFO */
+       out8(UART_BASE + UART_MCR, 0x00);       /* no modem control DTR RTS */
+       val = in8(UART_BASE + UART_LSR);        /* clear line status */
+       val = in8(UART_BASE + UART_RBR);        /* read receive buffer */
+       out8(UART_BASE + UART_SCR, 0x00);       /* set scratchpad */
+       out8(UART_BASE + UART_IER, 0x00);       /* set interrupt enable reg */
+
        return (0);
 }
 
@@ -564,29 +552,17 @@ int serial_init (void)
        tmp = gd->baudrate * udiv * 16;
        bdiv = (clk + tmp / 2) / tmp;
 
-#if defined(CONFIG_SERIAL_MULTI)
-       out8 (dev_base + UART_LCR, 0x80);       /* set DLAB bit */
-       out8 (dev_base + UART_DLL, bdiv);       /* set baudrate divisor */
-       out8 (dev_base + UART_DLM, bdiv >> 8);/* set baudrate divisor */
-       out8 (dev_base + UART_LCR, 0x03);       /* clear DLAB; set 8 bits, no parity */
-       out8 (dev_base + UART_FCR, 0x00);       /* disable FIFO */
-       out8 (dev_base + UART_MCR, 0x00);       /* no modem control DTR RTS */
-       val = in8 (dev_base + UART_LSR);        /* clear line status */
-       val = in8 (dev_base + UART_RBR);        /* read receive buffer */
-       out8 (dev_base + UART_SCR, 0x00);       /* set scratchpad */
-       out8 (dev_base + UART_IER, 0x00);       /* set interrupt enable reg */
-#else
-       out8 (ACTING_UART0_BASE + UART_LCR, 0x80);      /* set DLAB bit */
-       out8 (ACTING_UART0_BASE + UART_DLL, bdiv);      /* set baudrate divisor */
-       out8 (ACTING_UART0_BASE + UART_DLM, bdiv >> 8);/* set baudrate divisor */
-       out8 (ACTING_UART0_BASE + UART_LCR, 0x03);      /* clear DLAB; set 8 bits, no parity */
-       out8 (ACTING_UART0_BASE + UART_FCR, 0x00);      /* disable FIFO */
-       out8 (ACTING_UART0_BASE + UART_MCR, 0x00);      /* no modem control DTR RTS */
-       val = in8 (ACTING_UART0_BASE + UART_LSR);       /* clear line status */
-       val = in8 (ACTING_UART0_BASE + UART_RBR);       /* read receive buffer */
-       out8 (ACTING_UART0_BASE + UART_SCR, 0x00);      /* set scratchpad */
-       out8 (ACTING_UART0_BASE + UART_IER, 0x00);      /* set interrupt enable reg */
-#endif
+       out8(UART_BASE + UART_LCR, 0x80);       /* set DLAB bit */
+       out8(UART_BASE + UART_DLL, bdiv);       /* set baudrate divisor */
+       out8(UART_BASE + UART_DLM, bdiv >> 8);  /* set baudrate divisor */
+       out8(UART_BASE + UART_LCR, 0x03);       /* clear DLAB; set 8 bits, no parity */
+       out8(UART_BASE + UART_FCR, 0x00);       /* disable FIFO */
+       out8(UART_BASE + UART_MCR, 0x00);       /* no modem control DTR RTS */
+       val = in8(UART_BASE + UART_LSR);        /* clear line status */
+       val = in8(UART_BASE + UART_RBR);        /* read receive buffer */
+       out8(UART_BASE + UART_SCR, 0x00);       /* set scratchpad */
+       out8(UART_BASE + UART_IER, 0x00);       /* set interrupt enable reg */
+
        return (0);
 }
 
@@ -598,55 +574,10 @@ void serial_setbrg_dev (unsigned long dev_base)
 void serial_setbrg (void)
 #endif
 {
-       unsigned long tmp;
-       unsigned long clk;
-       unsigned long udiv;
-       unsigned short bdiv;
-
-#ifdef CFG_EXT_SERIAL_CLOCK
-       clk = CFG_EXT_SERIAL_CLOCK;
-#else
-       clk = gd->cpu_clk;
-#endif
-
-#ifdef CONFIG_405EP
-       udiv = ((mfdcr (cpc0_ucr) & UCR0_MASK) >> UCR0_UDIV_POS);
-#else
-       udiv = ((mfdcr (cntrl0) & 0x3e) >> 1) + 1;
-#endif /* CONFIG_405EP */
-
-#if !defined(CFG_EXT_SERIAL_CLOCK) && \
-       ( defined(CONFIG_440GX) || defined(CONFIG_440EP) || \
-         defined(CONFIG_440GR) || defined(CONFIG_440SP) || \
-         defined(CONFIG_440SPE) )
-       serial_divs (gd->baudrate, &udiv, &bdiv);
-       tmp = udiv << CR0_UDIV_POS;             /* set the UART divisor */
-#if defined(CONFIG_SERIAL_MULTI)
-       if (UART0_BASE == dev_base) {
-               mtsdr (UART0_SDR, tmp);
-       } else {
-               mtsdr (UART1_SDR, tmp);
-       }
-#else
-       mtsdr (UART0_SDR, tmp);
-#endif
-
-#else
-
-       tmp = gd->baudrate * udiv * 16;
-       bdiv = (clk + tmp / 2) / tmp;
-#endif /* !defined(CFG_EXT_SERIAL_CLOCK) && (...) */
-
 #if defined(CONFIG_SERIAL_MULTI)
-       out8 (dev_base + UART_LCR, 0x80);       /* set DLAB bit */
-       out8 (dev_base + UART_DLL, bdiv);       /* set baudrate divisor */
-       out8 (dev_base + UART_DLM, bdiv >> 8);/* set baudrate divisor */
-       out8 (dev_base + UART_LCR, 0x03);       /* clear DLAB; set 8 bits, no parity */
+       serial_init_dev(dev_base);
 #else
-       out8 (ACTING_UART0_BASE + UART_LCR, 0x80);      /* set DLAB bit */
-       out8 (ACTING_UART0_BASE + UART_DLL, bdiv);      /* set baudrate divisor */
-       out8 (ACTING_UART0_BASE + UART_DLM, bdiv >> 8);/* set baudrate divisor */
-       out8 (ACTING_UART0_BASE + UART_LCR, 0x03);      /* clear DLAB; set 8 bits, no parity */
+       serial_init();
 #endif
 }
 
@@ -667,19 +598,11 @@ void serial_putc (const char c)
 
        /* check THRE bit, wait for transmiter available */
        for (i = 1; i < 3500; i++) {
-#if defined(CONFIG_SERIAL_MULTI)
-               if ((in8 (dev_base + UART_LSR) & 0x20) == 0x20)
-#else
-               if ((in8 (ACTING_UART0_BASE + UART_LSR) & 0x20) == 0x20)
-#endif
+               if ((in8 (UART_BASE + UART_LSR) & 0x20) == 0x20)
                        break;
                udelay (100);
        }
-#if defined(CONFIG_SERIAL_MULTI)
-       out8 (dev_base + UART_THR, c);  /* put character out */
-#else
-       out8 (ACTING_UART0_BASE + UART_THR, c); /* put character out */
-#endif
+       out8 (UART_BASE + UART_THR, c); /* put character out */
 }
 
 #if defined(CONFIG_SERIAL_MULTI)
@@ -709,11 +632,7 @@ int serial_getc (void)
 #if defined(CONFIG_HW_WATCHDOG)
                WATCHDOG_RESET ();      /* Reset HW Watchdog, if needed */
 #endif /* CONFIG_HW_WATCHDOG */
-#if defined(CONFIG_SERIAL_MULTI)
-               status = in8 (dev_base + UART_LSR);
-#else
-               status = in8 (ACTING_UART0_BASE + UART_LSR);
-#endif
+               status = in8 (UART_BASE + UART_LSR);
                if ((status & asyncLSRDataReady1) != 0x0) {
                        break;
                }
@@ -721,22 +640,14 @@ int serial_getc (void)
                                asyncLSROverrunError1 |
                                asyncLSRParityError1  |
                                asyncLSRBreakInterrupt1 )) != 0) {
-#if defined(CONFIG_SERIAL_MULTI)
-                       out8 (dev_base + UART_LSR,
-#else
-                       out8 (ACTING_UART0_BASE + UART_LSR,
-#endif
+                       out8 (UART_BASE + UART_LSR,
                              asyncLSRFramingError1 |
                              asyncLSROverrunError1 |
                              asyncLSRParityError1  |
                              asyncLSRBreakInterrupt1);
                }
        }
-#if defined(CONFIG_SERIAL_MULTI)
-       return (0x000000ff & (int) in8 (dev_base));
-#else
-       return (0x000000ff & (int) in8 (ACTING_UART0_BASE));
-#endif
+       return (0x000000ff & (int) in8 (UART_BASE));
 }
 
 #if defined(CONFIG_SERIAL_MULTI)
@@ -747,11 +658,7 @@ int serial_tstc (void)
 {
        unsigned char status;
 
-#if defined(CONFIG_SERIAL_MULTI)
-       status = in8 (dev_base + UART_LSR);
-#else
-       status = in8 (ACTING_UART0_BASE + UART_LSR);
-#endif
+       status = in8 (UART_BASE + UART_LSR);
        if ((status & asyncLSRDataReady1) != 0x0) {
                return (1);
        }
@@ -759,11 +666,7 @@ int serial_tstc (void)
                        asyncLSROverrunError1 |
                        asyncLSRParityError1  |
                        asyncLSRBreakInterrupt1 )) != 0) {
-#if defined(CONFIG_SERIAL_MULTI)
-               out8 (dev_base + UART_LSR,
-#else
-               out8 (ACTING_UART0_BASE + UART_LSR,
-#endif
+               out8 (UART_BASE + UART_LSR,
                      asyncLSRFramingError1 |
                      asyncLSROverrunError1 |
                      asyncLSRParityError1  |
index e552c03473345f3df6c8d330e7d574b1df19e2ce..2d16a83420a671051345252b39d4ea8bf1594221 100644 (file)
@@ -199,7 +199,8 @@ ulong get_PCI_freq (void)
 
 #elif defined(CONFIG_440)
 
-#if  defined(CONFIG_440EP) || defined(CONFIG_440GR)
+#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 void get_sys_info (sys_info_t *sysInfo)
 {
        unsigned long temp;
index 60ed2d5453614935a2b93bfa76f733a37a5abb73..5a1ab386b1809ad98bd105a000d93c496dabddb2 100644 (file)
 
        .extern ext_bus_cntlr_init
        .extern sdram_init
+#ifdef CONFIG_NAND_U_BOOT
+       .extern reconfig_tlb0
+#endif
 
 /*
  * Set up GOT: Global Offset Table
  *
  * Use r14 to access the GOT
  */
+#if !defined(CONFIG_NAND_SPL)
        START_GOT
        GOT_ENTRY(_GOT2_TABLE_)
        GOT_ENTRY(_FIXUP_TABLE_)
        GOT_ENTRY(_end)
        GOT_ENTRY(__bss_start)
        END_GOT
+#endif /* CONFIG_NAND_SPL */
+
+#if defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_NAND_SPL)
+       /*
+        * NAND U-Boot image is started from offset 0
+        */
+       .text
+       bl      reconfig_tlb0
+       GET_GOT
+       bl      cpu_init_f      /* run low-level CPU init code     (from Flash) */
+       bl      board_init_f
+#endif
 
 /*
  * 440 Startup -- on reset only the top 4k of the effective
  */
 
 #if defined(CONFIG_440)
+#if !defined(CONFIG_NAND_SPL)
     .section .bootpg,"ax"
+#endif
     .globl _start_440
 
 /**************************************************************************/
 _start_440:
+        /*--------------------------------------------------------------------+
+        | 440EPX BUP Change - Hardware team request
+        +--------------------------------------------------------------------*/
+#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
+       sync
+       nop
+       nop
+#endif
        /*----------------------------------------------------------------+
        | Core bug fix.  Clear the esr
        +-----------------------------------------------------------------*/
@@ -171,15 +197,19 @@ _start_440:
        mtspr   srr1,r0
        mtspr   csrr0,r0
        mtspr   csrr1,r0
-#if defined(CONFIG_440GX) || defined(CONFIG_440SP) || defined(CONFIG_440SPE)  /* NOTE: 440GX adds machine check status regs */
+       /* NOTE: 440GX adds machine check status regs */
+#if defined(CONFIG_440) && !defined(CONFIG_440GP)
        mtspr   mcsrr0,r0
        mtspr   mcsrr1,r0
-       mfspr   r1, mcsr
+       mfspr   r1,mcsr
        mtspr   mcsr,r1
 #endif
        /*----------------------------------------------------------------*/
        /* Initialize debug */
        /*----------------------------------------------------------------*/
+       mfspr   r1,dbcr0
+       andis.  r1, r1, 0x8000  /* test DBCR0[EDM] bit                  */
+       bne     skip_debug_init /* if set, don't clear debug register   */
        mtspr   dbcr0,r0
        mtspr   dbcr1,r0
        mtspr   dbcr2,r0
@@ -193,6 +223,7 @@ _start_440:
 
        mfspr   r1,dbsr
        mtspr   dbsr,r1         /* Clear all valid bits */
+skip_debug_init:
 
        /*----------------------------------------------------------------*/
        /* CCR0 init */
@@ -352,7 +383,53 @@ rsttlb:    tlbwe   r0,r1,0x0000    /* Invalidate all entries (V=0)*/
        /*----------------------------------------------------------------*/
        /* Continue from 'normal' start */
        /*----------------------------------------------------------------*/
-2:     bl      3f
+2:
+
+#if defined(CONFIG_NAND_SPL)
+       /*
+        * Enable internal SRAM
+        */
+       lis     r2,0x7fff
+       ori     r2,r2,0xffff
+       mfdcr   r1,isram0_dpc
+       and     r1,r1,r2                /* Disable parity check */
+       mtdcr   isram0_dpc,r1
+       mfdcr   r1,isram0_pmeg
+       and     r1,r1,r2                /* Disable pwr mgmt */
+       mtdcr   isram0_pmeg,r1
+
+       /*
+        * Copy SPL from cache into internal SRAM
+        */
+       li      r4,(CFG_NAND_BOOT_SPL_SIZE >> 2) - 1
+       mtctr   r4
+       lis     r2,CFG_NAND_BOOT_SPL_SRC@h
+       ori     r2,r2,CFG_NAND_BOOT_SPL_SRC@l
+       lis     r3,CFG_NAND_BOOT_SPL_DST@h
+       ori     r3,r3,CFG_NAND_BOOT_SPL_DST@l
+spl_loop:
+       lwzu    r4,4(r2)
+       stwu    r4,4(r3)
+       bdnz    spl_loop
+
+       /*
+        * Jump to code in RAM
+        */
+       bl      00f
+00:    mflr    r10
+       lis     r3,(CFG_NAND_BOOT_SPL_SRC - CFG_NAND_BOOT_SPL_DST)@h
+       ori     r3,r3,(CFG_NAND_BOOT_SPL_SRC - CFG_NAND_BOOT_SPL_DST)@l
+       sub     r10,r10,r3
+       addi    r10,r10,28
+       mtlr    r10
+       blr
+
+start_ram:
+       sync
+       isync
+#endif
+
+       bl      3f
        b       _start
 
 3:     li      r0,0
@@ -366,6 +443,7 @@ rsttlb:     tlbwe   r0,r1,0x0000    /* Invalidate all entries (V=0)*/
  * r3 - 1st arg to board_init(): IMMP pointer
  * r4 - 2nd arg to board_init(): boot flag
  */
+#ifndef CONFIG_NAND_SPL
        .text
        .long   0x27051956              /* U-Boot Magic Number                  */
        .globl  version_string
@@ -379,6 +457,7 @@ version_string:
  * location (0x100) is where the CriticalInput Execption should be.
  */
        . = EXC_OFF_SYS_RESET
+#endif
        .globl  _start
 _start:
 
@@ -417,7 +496,8 @@ _start:
        /* Setup the internal SRAM */
        /*----------------------------------------------------------------*/
        li      r0,0
-#if defined(CONFIG_440EP) || defined(CONFIG_440GR)
+
+#ifdef CFG_INIT_RAM_DCACHE
        /* Clear Dcache to use as RAM */
        addis   r3,r0,CFG_INIT_RAM_ADDR@h
        ori     r3,r3,CFG_INIT_RAM_ADDR@l
@@ -433,19 +513,22 @@ _start:
        dcbz    r0,r3
        addi    r3,r3,32
        bdnz    ..d_ag
-#else
-#if defined (CONFIG_440GX) || defined(CONFIG_440SP) || defined(CONFIG_440SPE)
+#endif /* CFG_INIT_RAM_DCACHE */
+
+       /* 440EP & 440GR are only 440er PPC's without internal SRAM */
+#if !defined(CONFIG_440EP) && !defined(CONFIG_440GR)
+       /* not all PPC's have internal SRAM usable as L2-cache */
+#if defined(CONFIG_440GX) || defined(CONFIG_440SP) || defined(CONFIG_440SPE)
        mtdcr   l2_cache_cfg,r0         /* Ensure L2 Cache is off */
 #endif
-       mtdcr   isram0_sb1cr,r0         /* Disable bank 1 */
 
-       li      r2,0x7fff
+       lis     r2,0x7fff
        ori     r2,r2,0xffff
        mfdcr   r1,isram0_dpc
        and     r1,r1,r2                /* Disable parity check */
        mtdcr   isram0_dpc,r1
        mfdcr   r1,isram0_pmeg
-       andis.  r1,r1,r2                /* Disable pwr mgmt */
+       and     r1,r1,r2                /* Disable pwr mgmt */
        mtdcr   isram0_pmeg,r1
 
        lis     r1,0x8000               /* BAS = 8000_0000 */
@@ -474,11 +557,12 @@ _start:
        lis     r1, 0x0003
        ori     r1,r1, 0x0984           /* fourth 64k */
        mtdcr   isram0_sb3cr,r1
-#else
+#elif defined(CONFIG_440GP)
        ori     r1,r1,0x0380            /* 8k rw */
        mtdcr   isram0_sb0cr,r1
+       mtdcr   isram0_sb1cr,r0         /* Disable bank 1 */
 #endif
-#endif
+#endif /* #if !defined(CONFIG_440EP) && !defined(CONFIG_440GR) */
 
        /*----------------------------------------------------------------*/
        /* Setup the stack in internal SRAM */
@@ -495,10 +579,14 @@ _start:
        stwu    r1,-8(r1)               /* Save back chain and move SP */
        stw     r0,+12(r1)              /* Save return addr (underflow vect) */
 
+#ifdef CONFIG_NAND_SPL
+       bl      nand_boot               /* will not return */
+#else
        GET_GOT
 
        bl      cpu_init_f      /* run low-level CPU init code     (from Flash) */
        bl      board_init_f
+#endif
 
 #endif /* CONFIG_440 */
 
@@ -808,6 +896,7 @@ _start:
        /*----------------------------------------------------------------------- */
 
 
+#ifndef CONFIG_NAND_SPL
 /*****************************************************************************/
        .globl  _start_of_vectors
 _start_of_vectors:
@@ -1013,6 +1102,7 @@ crit_return:
        lwz     r1,GPR1(r1)
        SYNC
        rfci
+#endif /* CONFIG_NAND_SPL */
 
 /* Cache functions.
 */
@@ -1254,6 +1344,7 @@ ppcSync:
 
 /*------------------------------------------------------------------------------*/
 
+#ifndef CONFIG_NAND_SPL
 /*
  * void relocate_code (addr_sp, gd, addr_moni)
  *
@@ -1267,7 +1358,9 @@ ppcSync:
  */
        .globl  relocate_code
 relocate_code:
-#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
+    defined(CONFIG_440SPE)
        /*
         * On some 440er platforms the cache is enabled in the first TLB (Boot-CS)
         * to speed up the boot process. Now this cache needs to be disabled.
@@ -1482,22 +1575,22 @@ trap_init:
        cmplw   0, r7, r8
        blt     4b
 
-#if !defined(CONFIG_440GX) && !defined(CONFIG_440SPE)
+#if !defined(CONFIG_440)
        addi    r7,r0,0x1000            /* set ME bit (Machine Exceptions) */
        oris    r7,r7,0x0002            /* set CE bit (Critical Exceptions) */
        mtmsr   r7                      /* change MSR */
 #else
-       bl      __440gx_msr_set
-       b       __440gx_msr_continue
+       bl      __440_msr_set
+       b       __440_msr_continue
 
-__440gx_msr_set:
+__440_msr_set:
        addi    r7,r0,0x1000            /* set ME bit (Machine Exceptions) */
        oris    r7,r7,0x0002            /* set CE bit (Critical Exceptions) */
        mtspr   srr1,r7
        mflr    r7
        mtspr   srr0,r7
        rfi
-__440gx_msr_continue:
+__440_msr_continue:
 #endif
 
        mtlr    r4                      /* restore link register        */
@@ -1516,6 +1609,7 @@ trap_reloc:
        stw     r0, 4(r7)
 
        blr
+#endif /* CONFIG_NAND_SPL */
 
 
 /**************************************************************************/
index bb5765891f8c4c3f98aa361f7d11f0ba9949db9d..ab852c525cf73403483cf0159e1ff18e75324d0b 100644 (file)
@@ -76,7 +76,7 @@
 #define m16_swap(x) swap_16(x)
 #define m32_swap(x) swap_32(x)
 
-#ifdef CONFIG_440EP
+#if defined(CONFIG_440EP) || defined(CONFIG_440EPX)
 #define ohci_cpu_to_le16(x) (x)
 #define ohci_cpu_to_le32(x) (x)
 #else
@@ -1599,7 +1599,11 @@ int usb_lowlevel_init(void)
        gohci.disabled = 1;
        gohci.sleeping = 0;
        gohci.irq = -1;
-       gohci.regs = (struct ohci_regs *)(CFG_PERIPHERAL_BASE | 0x1000);
+#if defined(CONFIG_440EP)
+       gohci.regs = (struct ohci_regs *)(CFG_PERIPHERAL_BASE | 0x1000);
+#elif defined(CONFIG_440EPX)
+       gohci.regs = (struct ohci_regs *)(CFG_USB_HOST);
+#endif
 
        gohci.flags = 0;
        gohci.slot_name = "ppc440";
index 8262c54bef144d1401f52d476fb9df3d3c893c32..6140d2a9089f4402d82957dfed129042925df67f 100644 (file)
@@ -3,7 +3,7 @@
 #include <common.h>
 #include <asm/processor.h>
 
-#ifdef CONFIG_440EP
+#if (defined(CONFIG_440EP) || defined(CONFIG_440EPX)) && (CONFIG_COMMANDS & CFG_CMD_USB)
 
 #include <usb.h>
 #include "usbdev.h"
@@ -186,6 +186,21 @@ int usbInt(void)
        return 0;
 }
 
+#if defined(CONFIG_440EPX)
+void usb_dev_init()
+{
+       printf("USB 2.0 Device init\n");
+
+       /*usb dev init */
+       *(unsigned char *)USB2D0_POWER_8 = 0xa1;        /* 2.0 */
+
+       /*enable interrupts */
+       *(unsigned char *)USB2D0_INTRUSBE_8 = 0x0f;
+
+       irq_install_handler(VECNUM_HSB2D, (interrupt_handler_t *) usbInt,
+                           NULL);
+}
+#else
 void usb_dev_init()
 {
 #ifdef USB_2_0_DEVICE
@@ -210,5 +225,6 @@ void usb_dev_init()
        irq_install_handler(VECNUM_USBDEV, (interrupt_handler_t *) usbInt,
                            NULL);
 }
+#endif
 
-#endif                         /*CONFIG_440EP */
+#endif /* CONFIG_440EP || CONFIG_440EPX */
index 93cef026a3f77b671d25d2c09249724e01b25006..70e436aab235d538bb8e7696da4f97181b78707c 100644 (file)
 #ifndef _VECNUMS_H_
 #define _VECNUMS_H_
 
-#if defined(CONFIG_440SPE)
+#if defined(CONFIG_440EPX) || defined(CONFIG_440_GRX)
+
+/* UIC 0 */
+#define VECNUM_U0                   0  /* UART 0                        */
+#define VECNUM_U1                   1  /* UART 1                        */
+#define VECNUM_IIC0                 2  /* IIC                           */
+#define VECNUM_KRD                  3  /* Kasumi Ready for data         */
+#define VECNUM_KDA                  4  /* Kasumi Data Available         */
+#define VECNUM_PCRW                 5  /* PCI command register write    */
+#define VECNUM_PPM                  6  /* PCI power management          */
+#define VECNUM_IIC1                 7  /* IIC                           */
+#define VECNUM_SPI                  8  /* SPI                           */
+#define VECNUM_EPCISER              9  /* External PCI SERR             */
+#define VECNUM_MTE                 10  /* MAL TXEOB                     */
+#define VECNUM_MRE                 11  /* MAL RXEOB                     */
+#define VECNUM_D0                  12  /* DMA channel 0                 */
+#define VECNUM_D1                  13  /* DMA channel 1                 */
+#define VECNUM_D2                  14  /* DMA channel 2                 */
+#define VECNUM_D3                  15  /* DMA channel 3                 */
+#define VECNUM_UD0                 16  /* UDMA irq 0                    */
+#define VECNUM_UD1                 17  /* UDMA irq 1                    */
+#define VECNUM_UD2                 18  /* UDMA irq 2                    */
+#define VECNUM_UD3                 19  /* UDMA irq 3                    */
+#define VECNUM_HSB2D               20  /* USB2.0 Device                 */
+#define VECNUM_USBDEV             20  /* USB 1.1/USB 2.0 Device        */
+#define VECNUM_OHCI1               21  /* USB2.0 Host OHCI irq 1        */
+#define VECNUM_OHCI2               22  /* USB2.0 Host OHCI irq 2        */
+#define VECNUM_EIP94               23  /* Security EIP94                */
+#define VECNUM_ETH0                24  /* Emac 0                        */
+#define VECNUM_ETH1                25  /* Emac 1                        */
+#define VECNUM_EHCI                26  /* USB2.0 Host EHCI              */
+#define VECNUM_EIR4                27  /* External interrupt 4          */
+#define VECNUM_UIC2NC              28  /* UIC2 non-critical interrupt   */
+#define VECNUM_UIC2C               29  /* UIC2 critical interrupt       */
+#define VECNUM_UIC1NC              30  /* UIC1 non-critical interrupt   */
+#define VECNUM_UIC1C               31  /* UIC1 critical interrupt       */
+
+/* UIC 1 */
+#define VECNUM_MS           (32 +  0)  /* MAL SERR                      */
+#define VECNUM_MTDE         (32 +  1)  /* MAL TXDE                      */
+#define VECNUM_MRDE         (32 +  2)  /* MAL RXDE                      */
+#define VECNUM_U2           (32 +  3)  /* UART 2                        */
+#define VECNUM_U3           (32 +  4)  /* UART 3                        */
+#define VECNUM_EBCO         (32 +  5)  /* EBCO interrupt status         */
+#define VECNUM_NDFC         (32 +  6)  /* NDFC                          */
+#define VECNUM_KSLE         (32 +  7)  /* KASUMI slave error            */
+#define VECNUM_CT5          (32 +  8)  /* GPT compare timer 5           */
+#define VECNUM_CT6          (32 +  9)  /* GPT compare timer 6           */
+#define VECNUM_PLB34I0      (32 + 10)  /* PLB3X4X MIRQ0                 */
+#define VECNUM_PLB34I1      (32 + 11)  /* PLB3X4X MIRQ1                 */
+#define VECNUM_PLB34I2      (32 + 12)  /* PLB3X4X MIRQ2                 */
+#define VECNUM_PLB34I3      (32 + 13)  /* PLB3X4X MIRQ3                 */
+#define VECNUM_PLB34I4      (32 + 14)  /* PLB3X4X MIRQ4                 */
+#define VECNUM_PLB34I5      (32 + 15)  /* PLB3X4X MIRQ5                 */
+#define VECNUM_CT0          (32 + 16)  /* GPT compare timer 0           */
+#define VECNUM_CT1          (32 + 17)  /* GPT compare timer 1           */
+#define VECNUM_EIR7         (32 + 18)  /* External interrupt 7          */
+#define VECNUM_EIR8         (32 + 19)  /* External interrupt 8          */
+#define VECNUM_EIR9         (32 + 20)  /* External interrupt 9          */
+#define VECNUM_CT2          (32 + 21)  /* GPT compare timer 2           */
+#define VECNUM_CT3          (32 + 22)  /* GPT compare timer 3           */
+#define VECNUM_CT4          (32 + 23)  /* GPT compare timer 4           */
+#define VECNUM_SRE          (32 + 24)  /* Serial ROM error              */
+#define VECNUM_GPTDC        (32 + 25)  /* GPT decrementer pulse         */
+#define VECNUM_RSVD0        (32 + 26)  /* Reserved                      */
+#define VECNUM_EPCIPER      (32 + 27)  /* External PCI PERR             */
+#define VECNUM_EIR0         (32 + 28)  /* External interrupt 0          */
+#define VECNUM_EWU0         (32 + 29)  /* Ethernet 0 wakeup             */
+#define VECNUM_EIR1         (32 + 30)  /* External interrupt 1          */
+#define VECNUM_EWU1         (32 + 31)  /* Ethernet 1 wakeup             */
+
+#define VECNUM_TXDE         VECNUM_MTDE
+#define VECNUM_RXDE         VECNUM_MRDE
+
+/* UIC 2 */
+#define VECNUM_EIR5         (62 +  0)  /* External interrupt 5          */
+#define VECNUM_EIR6         (62 +  1)  /* External interrupt 6          */
+#define VECNUM_OPB          (62 +  2)  /* OPB to PLB bridge int stat    */
+#define VECNUM_EIR2         (62 +  3)  /* External interrupt 2          */
+#define VECNUM_EIR3         (62 +  4)  /* External interrupt 3          */
+#define VECNUM_DDR2         (62 +  5)  /* DDR2 sdram                    */
+#define VECNUM_MCTX0        (62 +  6)  /* MAl intp coalescence TX0      */
+#define VECNUM_MCTX1        (62 +  7)  /* MAl intp coalescence TX1      */
+#define VECNUM_MCTR0        (62 +  8)  /* MAl intp coalescence TR0      */
+#define VECNUM_MCTR1        (62 +  9)  /* MAl intp coalescence TR1      */
+
+#elif defined(CONFIG_440SPE)
+
 /* UIC 0 */
 #define VECNUM_U0           0           /* UART0                        */
 #define VECNUM_U1           1           /* UART1                        */
index 1af53d6ad1d82c16c93adae922e562d14ea34a86..a6f6b599aee9a903443f50bb836c6e682fb59e90 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-OBJS   = serial.o interrupts.o cpu.o i2c.o pxafb.o mmc.o
+COBJS  = serial.o interrupts.o cpu.o i2c.o pxafb.o mmc.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index d43c73e53327ebfb795d439a3940415b6f3c75bc..62cb5141133043910a8e6e4dff493720ff9a0e5a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-OBJS   = serial.o interrupts.o cpu.o
+COBJS  = serial.o interrupts.o cpu.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 8c950daee8546fbfe9e4b71027b645ed5b0a0960..62cb5141133043910a8e6e4dff493720ff9a0e5a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(CPU).a
+LIB    = $(obj)lib$(CPU).a
 
 START  = start.o
-OBJS   = serial.o interrupts.o cpu.o
+COBJS  = serial.o interrupts.o cpu.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
 
 $(LIB):        $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 39677f1e2e036880433db08e78fc4a22ecd1b005..3bdb018a06659384552aaccd3df9247de50ff837 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -25,20 +25,23 @@ include $(TOPDIR)/config.mk
 
 #CFLAGS += -DET_DEBUG -DDEBUG
 
-LIB    = libdisk.a
+LIB    = $(obj)libdisk.a
 
-OBJS   = part.o part_mac.o part_dos.o part_iso.o part_amiga.o
+COBJS  = part.o part_mac.o part_dos.o part_iso.o part_amiga.o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
 
 all:   $(LIB)
 
-$(LIB):        $(START) $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
diff --git a/doc/README.nand-boot-ppc440 b/doc/README.nand-boot-ppc440
new file mode 100644 (file)
index 0000000..a1c1d8c
--- /dev/null
@@ -0,0 +1,60 @@
+-----------------------------
+NAND boot on PPC440 platforms
+-----------------------------
+
+This document describes the U-Boot NAND boot feature as it
+is implemented for the AMCC Sequoia (PPC440EPx) board.
+
+The PPC440EP(x)/GR(x) cpu's can boot directly from NAND FLASH,
+completely without NOR FLASH. This can be done by using the NAND
+boot feature of the 440 NAND flash controller (NDFC).
+
+Here a short desciption of the different boot stages:
+
+a) IPL (Initial Program Loader, integrated inside CPU)
+------------------------------------------------------
+Will load first 4k from NAND (SPL) into cache and execute it from there.
+
+b) SPL (Secondary Program Loader)
+---------------------------------
+Will load special U-Boot version (NUB) from NAND and execute it. This SPL
+has to fit into 4kByte. It sets up the CPU and configures the SDRAM
+controller and the NAND controller so that the special U-Boot image can be
+loaded from NAND to SDRAM.
+This special image is build in the directory "nand_spl".
+
+c) NUB (NAND U-Boot)
+--------------------
+This NAND U-Boot (NUB) is a special U-Boot version which can be started
+from RAM. Therefore it mustn't (re-)configure the SDRAM controller.
+
+On 440EPx the SPL is copied to internal SRAM before the NAND controller
+is set up. While still running from cache, I experienced problems accessing
+the NAND controller.
+
+
+Example: Build and install NAND boot image for Sequoia (440EPx):
+
+a) Configure for sequoia with NAND boot support:
+# make sequoia_nand_config
+
+b) Build image(s)
+# make
+
+This will generate the SPL image in the "nand_spl" directory:
+nand_spl/u-boot-spl.bin
+Also another image is created spanning a whole NAND block (16kBytes):
+nand_spl/u-boot-spl-16k.bin
+The main NAND U-Boot image is generated in the toplevel directory:
+u-boot.bin
+A combined image of u-boot-spl-16k.bin and u-boot.bin is also created:
+u-boot-nand.bin
+
+This image should be programmed at offset 0 in the NAND flash:
+
+# tftp 100000 /tftpboot/sequoia/u-boot-nand.bin
+# nand erase 0 60000
+# nand write 100000 0 60000
+
+
+September 07 2006, Stefan Roese <sr@denx.de>
index 25e162249f4bd971af0aef62d00772e30cda1a8c..960da424cc42526d48b5f1f8c638a67e1ce2307c 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -25,9 +25,9 @@ include $(TOPDIR)/config.mk
 
 # CFLAGS += -DET_DEBUG -DDEBUG
 
-LIB    = libdrivers.a
+LIB    = $(obj)libdrivers.a
 
-OBJS   = 3c589.o 5701rls.o ali512x.o \
+COBJS  = 3c589.o 5701rls.o ali512x.o \
          bcm570x.o bcm570x_autoneg.o cfb_console.o cfi_flash.o \
          cs8900.o ct69000.o dataflash.o dc2114x.o dm9000x.o \
          e1000.o eepro100.o \
@@ -52,16 +52,19 @@ OBJS        = 3c589.o 5701rls.o ali512x.o \
          pxa_pcmcia.o mpc8xx_pcmcia.o tqm8xx_pcmcia.o  \
          rpx_pcmcia.o
 
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
 all:   $(LIB)
 
-$(LIB): $(OBJS)
+$(LIB): $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 96f67dfca8877dac5bdefc412c7a78737744811c..d7076586121b3bec2612e5d8179f771fc8750386 100644 (file)
@@ -1,16 +1,45 @@
+#
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@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
+#
+
 include $(TOPDIR)/config.mk
 
-LIB := libnand.a
+LIB    := $(obj)libnand.a
+
+COBJS  := nand.o nand_base.o nand_ids.o nand_ecc.o nand_bbt.o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
 
-OBJS := nand.o nand_base.o nand_ids.o nand_ecc.o nand_bbt.o
 all:   $(LIB)
 
-$(LIB):        $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
+
+#########################################################################
index 7e2cf66730df41eb5d00fd7fed7a2e44e1fe5a7e..23df5b752bf3a79480fcc15dda418f4b0a84fb42 100644 (file)
@@ -1,16 +1,45 @@
+#
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@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
+#
+
 include $(TOPDIR)/config.mk
 
-LIB := libnand_legacy.a
+LIB    := $(obj)libnand_legacy.a
+
+COBJS  := nand_legacy.o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
 
-OBJS := nand_legacy.o
 all:   $(LIB)
 
-$(LIB):        $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
+
+#########################################################################
index 8dff36774500a343f72efb4a9ba6224bc094076b..02c0d3952099c58cf4a8034adf55ae4f51ea8877 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if !defined(CONFIG_CONS_INDEX)
+#error "No console index specified."
+#endif
+
 #define CONSOLE CONFIG_CONS_INDEX
 
 static unsigned int calcBitrateRegister( void );
index 228781b46a63409c2565e3751f2c0c8022644c96..8d1ae96bf8555d07a2b302e14a0677a97a1973e3 100644 (file)
 #include <ns87308.h>
 #endif
 
+#if defined (CONFIG_SERIAL_MULTI)
+#include <serial.h>
+#endif
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #if !defined(CONFIG_CONS_INDEX)
+#if defined (CONFIG_SERIAL_MULTI)
+/*   with CONFIG_SERIAL_MULTI we might have no console
+ *  on these devices 
+ */
+#else
 #error "No console index specified."
+#endif /* CONFIG_SERIAL_MULTI */
 #elif (CONFIG_CONS_INDEX < 1) || (CONFIG_CONS_INDEX > 4)
 #error "Invalid console index value."
 #endif
@@ -75,7 +85,42 @@ static NS16550_t serial_ports[4] = {
 };
 
 #define PORT   serial_ports[port-1]
+#if defined(CONFIG_CONS_INDEX)
 #define CONSOLE        (serial_ports[CONFIG_CONS_INDEX-1])
+#endif
+
+#if defined(CONFIG_SERIAL_MULTI)
+
+/* Multi serial device functions */
+#define DECLARE_ESERIAL_FUNCTIONS(port) \
+    int  eserial##port##_init (void) {\
+       int clock_divisor; \
+       clock_divisor = calc_divisor(serial_ports[port-1]); \
+       NS16550_init(serial_ports[port-1], clock_divisor); \
+       return(0);}\
+    void eserial##port##_setbrg (void) {\
+       serial_setbrg_dev(port);}\
+    int  eserial##port##_getc (void) {\
+       return serial_getc_dev(port);}\
+    int  eserial##port##_tstc (void) {\
+       return serial_tstc_dev(port);}\
+    void eserial##port##_putc (const char c) {\
+       serial_putc_dev(port, c);}\
+    void eserial##port##_puts (const char *s) {\
+       serial_puts_dev(port, s);}
+
+/* Serial device descriptor */
+#define INIT_ESERIAL_STRUCTURE(port,name,bus) {\
+       name,\
+       bus,\
+       eserial##port##_init,\
+       eserial##port##_setbrg,\
+       eserial##port##_getc,\
+       eserial##port##_tstc,\
+       eserial##port##_putc,\
+       eserial##port##_puts, }
+
+#endif /* CONFIG_SERIAL_MULTI */
 
 static int calc_divisor (NS16550_t port)
 {
@@ -103,6 +148,7 @@ static int calc_divisor (NS16550_t port)
 
 }
 
+#if !defined(CONFIG_SERIAL_MULTI)
 int serial_init (void)
 {
        int clock_divisor;
@@ -130,6 +176,7 @@ int serial_init (void)
 
        return (0);
 }
+#endif
 
 void
 _serial_putc(const char c,const int port)
@@ -176,40 +223,104 @@ _serial_setbrg (const int port)
        NS16550_reinit(PORT, clock_divisor);
 }
 
+#if defined(CONFIG_SERIAL_MULTI)
+static inline void
+serial_putc_dev(unsigned int dev_index,const char c)
+{
+       _serial_putc(c,dev_index);
+}
+#else
 void
 serial_putc(const char c)
 {
        _serial_putc(c,CONFIG_CONS_INDEX);
 }
+#endif
 
+#if defined(CONFIG_SERIAL_MULTI)
+static inline void 
+serial_putc_raw_dev(unsigned int dev_index,const char c)
+{
+       _serial_putc_raw(c,dev_index);
+}
+#else
 void
 serial_putc_raw(const char c)
 {
        _serial_putc_raw(c,CONFIG_CONS_INDEX);
 }
+#endif
 
+#if defined(CONFIG_SERIAL_MULTI)
+static inline void
+serial_puts_dev(unsigned int dev_index,const char *s)
+{
+       _serial_puts(s,dev_index);
+}
+#else
 void
 serial_puts(const char *s)
 {
        _serial_puts(s,CONFIG_CONS_INDEX);
 }
+#endif
 
+#if defined(CONFIG_SERIAL_MULTI)
+static inline int
+serial_getc_dev(unsigned int dev_index)
+{
+       return _serial_getc(dev_index);
+}
+#else
 int
 serial_getc(void)
 {
        return _serial_getc(CONFIG_CONS_INDEX);
 }
+#endif
 
+#if defined(CONFIG_SERIAL_MULTI)
+static inline int
+serial_tstc_dev(unsigned int dev_index)
+{
+       return _serial_tstc(dev_index);
+}
+#else
 int
 serial_tstc(void)
 {
        return _serial_tstc(CONFIG_CONS_INDEX);
 }
+#endif
 
+#if defined(CONFIG_SERIAL_MULTI)
+static inline void
+serial_setbrg_dev(unsigned int dev_index)
+{
+       _serial_setbrg(dev_index);
+}
+#else
 void
 serial_setbrg(void)
 {
        _serial_setbrg(CONFIG_CONS_INDEX);
 }
+#endif
+
+#if defined(CONFIG_SERIAL_MULTI)
+
+DECLARE_ESERIAL_FUNCTIONS(1);
+struct serial_device eserial1_device = 
+       INIT_ESERIAL_STRUCTURE(1,"eserial0","EUART1");
+DECLARE_ESERIAL_FUNCTIONS(2);
+struct serial_device eserial2_device =
+       INIT_ESERIAL_STRUCTURE(2,"eserial1","EUART2");
+DECLARE_ESERIAL_FUNCTIONS(3);
+struct serial_device eserial3_device =
+       INIT_ESERIAL_STRUCTURE(3,"eserial2","EUART3");
+DECLARE_ESERIAL_FUNCTIONS(4);
+struct serial_device eserial4_device =
+       INIT_ESERIAL_STRUCTURE(4,"eserial3","EUART4");
+#endif /* CONFIG_SERIAL_MULTI */
 
 #endif
index 8ee0e216cde98b652a1b38b4d845615c28e07f28..ac21e02133f3056b128b17c900a48d0927f42e26 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 #
 # Makefile for the SysKonnect SK-98xx device driver.
 #
+
 include $(TOPDIR)/config.mk
 
-LIB := libsk98lin.a
+LIB    := $(obj)libsk98lin.a
+
+COBJS  := skge.o skaddr.o skgehwt.o skgeinit.o skgepnmi.o skgesirq.o \
+               ski2c.o sklm80.o skqueue.o skrlmt.o sktimer.o skvpd.o \
+               skxmac2.o skcsum.o #skproc.o
 
-OBJS :=     skge.o skaddr.o skgehwt.o skgeinit.o skgepnmi.o skgesirq.o \
-            ski2c.o sklm80.o skqueue.o skrlmt.o sktimer.o skvpd.o \
-            skxmac2.o skcsum.o #skproc.o
+COBJS  += uboot_skb.o uboot_drv.o
 
-OBJS +=     uboot_skb.o uboot_drv.o
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
 
 # DBGDEF =  \
 # -DDEBUG
@@ -84,18 +88,20 @@ endif
 EXTRA_CFLAGS += -I. -DSK_USE_CSUM $(DBGDEF)
 
 CFLAGS += $(EXTRA_CFLAGS)
+HOST_CFLAGS += $(EXTRA_CFLAGS)
 
 
 all:   $(LIB)
 
-$(LIB):        $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
+
index 0a334784ded59b618acaaf56053391c5a362a1d8..486008a1c317d4e0ac14af4480962584ac3ef818 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (C) Copyright 2001
 # Erik Theisen, Wave 7 Optics, etheisen@mindspring.com.
 #
@@ -25,20 +28,23 @@ include $(TOPDIR)/config.mk
 
 #CFLAGS += -DDEBUG
 
-LIB    = libdtt.a
+LIB    = $(obj)libdtt.a
+
+COBJS  = lm75.o ds1621.o adm1021.o
 
-OBJS   = lm75.o ds1621.o adm1021.o
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
 
 all:   $(LIB)
 
-$(LIB):        $(START) $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 59daa453976ccfd6cbeac3e5be190d1d1c865768..63f3b7551e9be6a73abe6dd2f8a24fadc04db293 100644 (file)
@@ -146,8 +146,13 @@ static int _dtt_init(int sensor)
     /*
      * Setup configuraton register
      */
+#ifdef CONFIG_DTT_AD7414
+    /* config = alert active low and disabled */
+    val = 0x60;
+#else
     /* config = 6 sample integration, int mode, active low, and enable */
     val = 0x18;
+#endif
     if (dtt_write(sensor, DTT_CONFIG, val) != 0)
        return 1;
 
index a342d75062a897e710afe79f3432a5bc3050498a..d7cd843a470a9c5ef13944d123937ebabfef9f52 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -94,6 +94,12 @@ SREC   += mem_to_mem_idma2intr.srec
 BIN    += mem_to_mem_idma2intr.bin mem_to_mem_idma2intr
 endif
 
+# Demo for 52xx IRQs
+ifeq ($(CPU),mpc5xxx)
+SREC   += interrupt.srec
+BIN    += interrupt.bin interrupt
+endif
+
 # Utility for resetting i82559 EEPROM
 ifeq ($(BOARD),oxc)
 SREC   += eepro100_eeprom.srec
@@ -104,9 +110,9 @@ ifeq ($(BIG_ENDIAN),y)
 EX_LDFLAGS += -EB
 endif
 
-OBJS   = $(SREC:.srec=.o)
+COBJS  := $(SREC:.srec=.o)
 
-LIB    = libstubs.a
+LIB    = $(obj)libstubs.a
 LIBAOBJS=
 ifeq ($(ARCH),ppc)
 LIBAOBJS+= $(ARCH)_longjmp.o $(ARCH)_setjmp.o
@@ -115,34 +121,40 @@ ifeq ($(CPU),mpc8xx)
 LIBAOBJS+= test_burst_lib.o
 endif
 LIBCOBJS= stubs.o
-LIBOBJS        = $(LIBAOBJS) $(LIBCOBJS)
+
+LIBOBJS        = $(addprefix $(obj),$(LIBAOBJS) $(LIBCOBJS))
+
+SRCS   := $(COBJS:.o=.c) $(LIBCOBJS:.o=.c) $(if $(LIBAOBJS),$(LIBAOBJS:.o=.S))
+OBJS   := $(addprefix $(obj),$(COBJS))
+BIN    := $(addprefix $(obj),$(BIN))
+SREC   := $(addprefix $(obj),$(SREC))
 
 gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
 clibdir := $(shell dirname `$(CC) $(CFLAGS) -print-file-name=libc.a`)
 
 CPPFLAGS += -I..
 
-all:   .depend $(OBJS) $(LIB) $(SREC) $(BIN)
+all:   $(obj).depend $(OBJS) $(LIB) $(SREC) $(BIN)
 
 #########################################################################
-$(LIB): .depend $(LIBOBJS)
-       $(AR) crv $@ $(LIBOBJS)
+$(LIB):        $(obj).depend $(LIBOBJS)
+               $(AR) crv $@ $(LIBOBJS)
 
-%:     %.o $(LIB)
-       $(LD) -g $(EX_LDFLAGS) -Ttext $(LOAD_ADDR) \
-               -o $@ -e $(<:.o=) $< $(LIB) \
-               -L$(gcclibdir) -lgcc
-%.srec:        %
-       $(OBJCOPY) -O srec $< $@ 2>/dev/null
+$(obj)%:       $(obj)%.o $(LIB)
+               $(LD) -g $(EX_LDFLAGS) -Ttext $(LOAD_ADDR) \
+                       -o $@ -e $(notdir $(<:.o=)) $< $(LIB) \
+                       -L$(gcclibdir) -lgcc
+$(obj)%.srec:  $(obj)%
+               $(OBJCOPY) -O srec $< $@ 2>/dev/null
 
-%.bin: %
-       $(OBJCOPY) -O binary $< $@ 2>/dev/null
+$(obj)%.bin:   $(obj)%
+               $(OBJCOPY) -O binary $< $@ 2>/dev/null
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c) $(LIBCOBJS:.o=.c) $(LIBAOBJS:.o=.S)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) $(LIBCOBJS:.o=.c) $(LIBAOBJS:.o=.S) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
diff --git a/examples/interrupt.c b/examples/interrupt.c
new file mode 100644 (file)
index 0000000..f3061d1
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * (C) Copyright 2006
+ * Detlev Zundel, DENX Software Engineering, dzu@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
+ *
+ * This is a very simple standalone application demonstrating
+ * catching IRQs on the MPC52xx architecture.
+ *
+ * The interrupt to be intercepted can be specified as an argument
+ * to the application.  Specifying nothing will intercept IRQ1 on the
+ * MPC5200 platform.  On the CR825 carrier board from MicroSys this
+ * maps to the ABORT switch :)
+ *
+ * Note that the specified vector is only a logical number specified
+ * by the respective header file.
+ */
+
+#include <common.h>
+#include <exports.h>
+#include <config.h>
+
+#if defined(CONFIG_MPC5xxx)
+#define DFL_IRQ MPC5XXX_IRQ1
+#else
+#define DFL_IRQ 0
+#endif
+
+static void irq_handler (void *arg);
+
+int interrupt (int argc, char *argv[])
+{
+       int c, irq = -1;
+
+       app_startup (argv);
+
+       if (argc > 1)
+               irq = simple_strtoul (argv[1], NULL, 0);
+       if ((irq < 0) || (irq > NR_IRQS))
+               irq = DFL_IRQ;
+
+       printf ("Installing handler for irq vector %d and doing busy wait\n",
+               irq);
+       printf ("Press 'q' to quit\n");
+
+       /* Install interrupt handler */
+       install_hdlr (irq, irq_handler, NULL);
+       while ((c = getc ()) != 'q') {
+               printf ("Ok, ok, I am still alive!\n");
+       }
+
+       free_hdlr (irq);
+       printf ("\nInterrupt handler has been uninstalled\n");
+
+       return (0);
+}
+
+/*
+ * Handler for interrupt
+ */
+static void irq_handler (void *arg)
+{
+       /* just for demonstration */
+       printf ("+");
+}
index 79cbdeaa7a9dd271bd3c32577053c2c6dfbef123..273d90e011b90afc1d32ca706abc21e11913a67a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -24,6 +24,6 @@
 
 SUBDIRS        := jffs2 cramfs fdos fat reiserfs ext2
 
-.depend all:
+$(obj).depend all:
        @for dir in $(SUBDIRS) ; do \
                $(MAKE) -C $$dir $@ ; done
index 54a475ef859e42fc7f8d86331c6a06924cd33142..1a6f4b7d00df6e3f07b9f23cfff8dafc716c2566 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = libcramfs.a
+LIB    = $(obj)libcramfs.a
 
 AOBJS  =
 COBJS  = cramfs.o uncompress.o
-OBJS   = $(AOBJS) $(COBJS)
+
+SRCS   := $(AOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(AOBJS) $(COBJS))
 
 #CPPFLAGS +=
 
 all:   $(LIB) $(AOBJS)
 
-$(LIB):        .depend $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 
 #########################################################################
 
-.depend:       Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 3b193684f5b8f76718d2e744e2cad803ab1ee20e..2e420d536b2b3336d4558a48dbd9d2c052fda0b4 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (C) Copyright 2003
 # Pavel Bartusek, Sysgo Real-Time Solutions AG, pba@sysgo.de
 #
 
 include $(TOPDIR)/config.mk
 
-LIB    = libext2fs.a
+LIB    = $(obj)libext2fs.a
 
 AOBJS  =
 COBJS  = ext2fs.o dev.o
-OBJS   = $(AOBJS) $(COBJS)
+
+SRCS   := $(AOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(AOBJS) $(COBJS))
 
 #CPPFLAGS +=
 
 all:   $(LIB) $(AOBJS)
 
-$(LIB):        .depend $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
-
 #########################################################################
 
-.depend:       Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index e4627577b7bd468972a741444759ef4c4ec0730e..2fa428c4dc18dd4ef3f017c29271f0f2085e9477 100644 (file)
 # MA 02111-1307 USA
 #
 
-TOPDIR=../../
-
 include $(TOPDIR)/config.mk
 
-LIB    = libfat.a
+LIB    = $(obj)libfat.a
 
 AOBJS  =
 COBJS  = fat.o file.o
 
-OBJS   = $(AOBJS) $(COBJS)
+SRCS   := $(AOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(AOBJS) $(COBJS))
 
 all:   $(LIB) $(AOBJS)
 
-$(LIB):        .depend $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 
 #########################################################################
 
-.depend:       Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index c25e744b921e97ff3023a381487d4127432c3890..e55ac8abbdd9d3d73072d6619259137ff947705a 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (C) Copyright 2002
 # Stäubli Faverges - <www.staubli.com>
 # Pierre AUBERT  p.aubert@staubli.com
 
 include $(TOPDIR)/config.mk
 
-LIB    = libfdos.a
+LIB    = $(obj)libfdos.a
 
 AOBJS  =
 COBJS  = fat.o vfat.o dev.o fdos.o fs.o subdir.o
-OBJS   = $(AOBJS) $(COBJS)
+
+SRCS   := $(AOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(AOBJS) $(COBJS))
 
 #CPPFLAGS +=
 
 all:   $(LIB) $(AOBJS)
 
-$(LIB):        .depend $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 
 #########################################################################
 
-.depend:       Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index f28b17a414cbf28111cc31916a7f79a91fd1adab..82436bbfec910ebbe002484f9f45d0853d362aaa 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000, 2001
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = libjffs2.a
+LIB    = $(obj)libjffs2.a
 
 AOBJS  =
 COBJS  = jffs2_1pass.o compr_rtime.o compr_rubin.o compr_zlib.o mini_inflate.o
 COBJS  += compr_lzo.o compr_lzari.o
-OBJS   = $(AOBJS) $(COBJS)
+
+SRCS   := $(AOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(AOBJS) $(COBJS))
 
 #CPPFLAGS +=
 
 all:   $(LIB) $(AOBJS)
 
-$(LIB):        .depend $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 
 #########################################################################
 
-.depend:       Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 98a9a8d30ee6a25f96fa702fa33fb69977675a3f..45028cb15e58cba372a96f1ae3dd4d39cb4a3be1 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (C) Copyright 2003
 # Pavel Bartusek, Sysgo Real-Time Solutions AG, pba@sysgo.de
 #
 
 include $(TOPDIR)/config.mk
 
-LIB    = libreiserfs.a
+LIB    = $(obj)libreiserfs.a
 
 AOBJS  =
 COBJS  = reiserfs.o dev.o mode_string.o
-OBJS   = $(AOBJS) $(COBJS)
+
+SRCS   := $(AOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(AOBJS) $(COBJS))
 
 #CPPFLAGS +=
 
 all:   $(LIB) $(AOBJS)
 
-$(LIB):        .depend $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
-
 #########################################################################
 
-.depend:       Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 05985869534b440a38750e39e954cb07ba000c0e..2a421848b4b17d733de66a009fc76f9de793a12b 100644 (file)
@@ -92,7 +92,7 @@
 #define MAL_ESR_PBEI     0x00000001
       /* ^^                     ^^   */
       /* Mal IER                     */
-#ifdef CONFIG_440SPE
+#if defined(CONFIG_440SPE) || defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 #define MAL_IER_PT       0x00000080
 #define MAL_IER_PRE      0x00000040
 #define MAL_IER_PWE      0x00000020
index 9c90a9e3c4876170d83180c989ef7b6bf92967b4..0c2bf362730a2131ae67845eaef8cf7c6867773a 100644 (file)
@@ -1,7 +1,8 @@
 #ifndef _440_i2c_h_
 #define _440_i2c_h_
 
-#if defined(CONFIG_440EP) || defined(CONFIG_440GR)
+#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 #define    I2C_BASE_ADDR (CFG_PERIPHERAL_BASE + 0x00000700)
 #else
 #define    I2C_BASE_ADDR (CFG_PERIPHERAL_BASE + 0x00000400)
index 61dcaaf331c7f6375fcb9c6e75efb7a7cf36b60c..2b8ec3d3f91d288b52b4f77f7811c20ef7db80cb 100644 (file)
@@ -12,6 +12,9 @@ EXPORT_FUNC(udelay)
 EXPORT_FUNC(get_timer)
 EXPORT_FUNC(vprintf)
 EXPORT_FUNC(do_reset)
+EXPORT_FUNC(getenv)
+EXPORT_FUNC(setenv)
+EXPORT_FUNC(simple_strtoul)
 #if (CONFIG_COMMANDS & CFG_CMD_I2C)
 EXPORT_FUNC(i2c_write)
 EXPORT_FUNC(i2c_read)
index e52d4b998abfe3204dc8e5c736145b12b656a1d7..388dea430c44364b654a457735c2d8f08e852422 100644 (file)
 #define PVR_440EP_RC   0x422218D4 /* 440EP rev C and 440GR rev B have same PVR */
 #define PVR_440GR_RA   0x422218D3 /* 440EP rev B and 440GR rev A have same PVR */
 #define PVR_440GR_RB   0x422218D4 /* 440EP rev C and 440GR rev B have same PVR */
+#define PVR_440EPX1_RA  0x216218D0 /* 440EPX rev A with Security / Kasumi */
+#define PVR_440EPX2_RA  0x216218D4 /* 440EPX rev A without Security / Kasumi */
+#define PVR_440GRX1_RA  0x216218D8 /* 440GRX rev A with Security / Kasumi */
+#define PVR_440GRX2_RA  0x216218DC /* 440GRX rev A without Security / Kasumi */
 #define PVR_440GX_RA   0x51B21850
 #define PVR_440GX_RB   0x51B21851
 #define PVR_440GX_RC   0x51B21892
index f335cd856aa5311683b41e9e8c11bad2f68dbfd6..30b44e3d22822570758d53205ddaeb513331b00b 100644 (file)
@@ -108,7 +108,8 @@ typedef struct bd_info {
 #endif
 
 #if defined(CONFIG_405GP) || defined(CONFIG_405EP) || defined (CONFIG_440GX) || \
-    defined(CONFIG_440EP) || defined(CONFIG_440GR)
+    defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
        unsigned int    bi_opbfreq;             /* OPB clock in Hz */
        int             bi_iic_fast[2];         /* Use fast i2c mode */
 #endif
index 8000dd01f3a6de87d9b785132bb7504a07fd05e9..0cd0d4ca00336b6c8e1d716201f6eecc5f410646 100644 (file)
@@ -113,6 +113,12 @@ typedef volatile unsigned char     vu_char;
 #define debugX(level,fmt,args...)
 #endif /* DEBUG */
 
+#define BUG() do { \
+        printf("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \
+       panic("BUG!"); \
+} while (0)
+#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
+
 typedef void (interrupt_handler_t)(void *);
 
 #include <asm/u-boot.h> /* boot information for Linux kernel */
index a5bc773e17706dbaf1b57be9db41a4b428b6464a..90d3a8d8fa396cf17dbd3af105325043a0cb0f57 100644 (file)
@@ -31,7 +31,8 @@
 /*-----------------------------------------------------------------------
  * High Level Configuration Options
  *----------------------------------------------------------------------*/
-#define CONFIG_EBONY           1           /* Board is ebony           */
+#define CONFIG_CPCI440         1           /* Board is ebony           */
+#define CONFIG_440GP           1           /* Specifc GP support       */
 #define CONFIG_4xx             1           /* ... PPC4xx family        */
 #define CONFIG_BOARD_EARLY_INIT_F 1        /* Call board_early_init_f  */
 #undef CFG_DRAM_TEST                       /* Disable-takes long time! */
index 7a1dada2db528243c67fe944a2249b35eb354335..ce969ecdd18030d08d40ab4bc63e607a8afe6638 100644 (file)
                         PSDMR_LDOTOPRE_1C              |\
                         PSDMR_WRC_1C                   |\
                         PSDMR_CL_2)
-                        
+
 /*
  * Init Memory Controller:
  *
index 31e3eed68c733e6efed7dcdd8d8a56847f631c3e..e0de5c1b3675ec9cd333e0a2a76aa3565260ade1 100644 (file)
@@ -63,7 +63,7 @@
 #define CFG_DEVICE_NULLDEV             1       /* enable null device */
 #define CONFIG_SILENT_CONSOLE          1       /* enable silent startup */
 #define CONFIG_BOARD_EARLY_INIT_F      1       /* used to detect S1 switch position */
-
+#define CONFIG_USB_BIN_FIXUP           1       /* for a buggy USB device */
 #if 0
 #define FO300_SILENT_CONSOLE_WHEN_S1_CLOSED    1       /* silent console on PSC1 when S1 */
                                                        /* switch is closed */
index cd4339b58223bb74bd91c361630d6866c11dc35c..4961011b5cd631712f7f0df9aca56c1e076b1db9 100644 (file)
@@ -73,6 +73,7 @@
 /*-----------------------------------------------------------------------
  * Initial RAM & stack pointer (placed in SDRAM)
  *----------------------------------------------------------------------*/
+#define CFG_INIT_RAM_DCACHE    1               /* d-cache as init ram  */
 #define CFG_INIT_RAM_ADDR      0x70000000              /* DCache       */
 #define CFG_INIT_RAM_END       (4 << 10)
 #define CFG_GBL_DATA_SIZE      256                     /* num bytes initial data       */
index 563f7978d5f3f287deddab43c56fce6abb854267..0c935bfcea94b9fea2f701cd44a8bfa2e2ca60a8 100644 (file)
 
 #define CONFIG_MISC_INIT_R
 
-#define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH     */
-#define BOOTFLAG_WARM          0x02    /* Software reboot                      */
+#define BOOTFLAG_COLD          0x01    /* Normal Power-On: Boot from FLASH     */
+#define BOOTFLAG_WARM          0x02    /* Software reboot                      */
 
-#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs                     */
+#define CFG_CACHELINE_SIZE     32      /* For MPC5xxx CPUs                     */
 #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
+#  define CFG_CACHELINE_SHIFT  5       /* log base 2 of the above value        */
 #endif
 
 /*
  *
  *  CONFIG_PSC_CONSOLE must be undefined in this case.
  */
+#if !defined(CONFIG_PRS200)
+/* MCC200 configuration: */
 #ifdef CONFIG_CONSOLE_COM12
 #define CONFIG_QUART_CONSOLE   6       /* console is on UARTF of QUART2        */
 #else
 #define CONFIG_QUART_CONSOLE   8       /* console is on UARTH of QUART2        */
 #endif
+#else
+/* PRS200 configuration: */
+#undef CONFIG_QUART_CONSOLE
+#endif /* CONFIG_PRS200 */
 /*
  *  To select console on PSC1, define CONFIG_PSC_CONSOLE as 1
  * and undefine CONFIG_QUART_CONSOLE.
  */
-/*#define CONFIG_PSC_CONSOLE   1       */ /* console is on PSC1                */
-#if defined(CONFIG_QUART_CONSOLE) && defined(CONFIG_PSC_CONSOLE)
+#if !defined(CONFIG_PRS200)
+/* MCC200 configuration: */
+#define CONFIG_SERIAL_MULTI    1
+#define CONFIG_PSC_CONSOLE     1       /* PSC1 may be COM */
+#define CONFIG_PSC_CONSOLE2    2       /* PSC2 is PSoC */
+#else
+/* PRS200 configuration: */
+#define CONFIG_PSC_CONSOLE     1       /* console is on PSC1           */
+#endif
+#if defined(CONFIG_QUART_CONSOLE) && defined(CONFIG_PSC_CONSOLE) && \
+       !defined(CONFIG_SERIAL_MULTI)
 #error "Select only one console device!"
 #endif
 #define CONFIG_BAUDRATE                115200
@@ -77,7 +92,7 @@
 
 /* USB */
 #define CONFIG_USB_OHCI
-#define ADD_USB_CMD             CFG_CMD_USB | CFG_CMD_FAT
+#define ADD_USB_CMD            CFG_CMD_USB | CFG_CMD_FAT
 #define CONFIG_USB_STORAGE
 
 /*
 
 #undef CONFIG_BOOTARGS
 
-#define        CONFIG_EXTRA_ENV_SETTINGS                                       \
+#define XMK_STR(x)             #x
+#define MK_STR(x)              XMK_STR(x)
+
+#ifdef CONFIG_PRS200
+# define CFG__BOARDNAME                "prs200"
+# define CFG__LINUX_CONSOLE    "ttyS0"
+#else
+# define CFG__BOARDNAME                "mcc200"
+# define CFG__LINUX_CONSOLE    "ttyEU7"
+#endif
+
+#define CONFIG_EXTRA_ENV_SETTINGS                                      \
        "netdev=eth0\0"                                                 \
-       "hostname=mcc200\0"                                             \
+       "hostname=" CFG__BOARDNAME "\0"                                 \
        "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
                "nfsroot=${serverip}:${rootpath}\0"                     \
        "ramargs=setenv bootargs root=/dev/ram rw\0"                    \
        "addip=setenv bootargs ${bootargs} "                            \
                "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
                ":${hostname}:${netdev}:off panic=1\0"                  \
-       "flash_nfs=run nfsargs addip;"                                  \
+       "addcons=setenv bootargs ${bootargs} "                          \
+               "console=${console},${baudrate}\0"                      \
+       "flash_nfs=run nfsargs addip addcons;"                          \
                "bootm ${kernel_addr}\0"                                \
-       "flash_self=run ramargs addip;"                                 \
+       "flash_self=run ramargs addip addcons;"                         \
                "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
-       "net_nfs=tftp 200000 ${bootfile};run nfsargs addip;bootm\0"     \
+       "net_nfs=tftp 200000 ${bootfile};"                              \
+               "run nfsargs addip addcons;bootm\0"                     \
+       "console=" CFG__LINUX_CONSOLE "\0"                              \
        "rootpath=/opt/eldk/ppc_6xx\0"                                  \
-       "bootfile=/tftpboot/mcc200/uImage\0"                            \
-       "baudrate=115200\0"                                             \
-       "load=tftp 200000 /tftpboot/mcc200/u-boot.bin\0"                \
-       "update=protect off FFF00000 +${filesize};"                     \
-               "era FFF00000 +${filesize};"                            \
-               "cp.b 200000 FFF00000 ${filesize}\0"                    \
-       "serverip=192.168.1.1\0"                                        \
-       "ipaddr=192.168.133.144\0"                                      \
-       "netmask=255.255.0.0\0"                                         \
+       "bootfile=/tftpboot/" CFG__BOARDNAME "/uImage\0"                \
+       "load=tftp 200000 /tftpboot/" CFG__BOARDNAME "/u-boot.bin\0"    \
+       "text_base=" MK_STR(TEXT_BASE) "\0"                             \
+       "update=protect off ${text_base} +${filesize};"                 \
+               "era ${text_base} +${filesize};"                        \
+               "cp.b 200000 ${text_base} ${filesize}\0"                \
        "unlock=yes\0"                                                  \
-       "ethaddr=00:02:44:7D:73:3B\0"                                   \
        ""
+#undef MK_STR
+#undef XMK_STR
 
 #define CONFIG_BOOTCOMMAND     "run flash_self"
 
 /*
  * IPB Bus clocking configuration.
  */
-#define CFG_IPBSPEED_133               /* define for 133MHz speed */
+#define CFG_IPBSPEED_133               /* define for 133MHz speed */
 
 /*
  * I2C configuration
  * TEXT base always at 0xFFF00000
  * ENV_ADDR always at  0xFFF40000
  * FLASH_BASE at 0xFC000000 for 64 MB (only 32MB are supported, not enough addr lines!!!)
- *               0xFE000000 for 32 MB
- *               0xFF000000 for 16 MB
- *               0xFF800000 for  8 MB
+ *              0xFE000000 for 32 MB
+ *              0xFF000000 for 16 MB
+ *              0xFF800000 for  8 MB
  */
 #define CFG_FLASH_BASE         0xfc000000
 #define CFG_FLASH_SIZE         0x04000000
 #define CFG_FLASH_EMPTY_INFO           /* print 'E' for empty sector on flinfo */
 #define CFG_FLASH_QUIET_TEST   1       /* don't warn upon unknown flash        */
 
-#define CFG_ENV_IS_IN_FLASH     1      /* use FLASH for environment vars       */
+#define CFG_ENV_IS_IN_FLASH          /* use FLASH for environment vars       */
 
-#define CFG_ENV_SECT_SIZE      0x40000         /* size of one complete sector  */
+#define CFG_ENV_SECT_SIZE      0x40000 /* size of one complete sector  */
 #define CFG_ENV_ADDR           (CFG_MONITOR_BASE + CFG_MONITOR_LEN)
 #define        CFG_ENV_SIZE            0x2000  /* Total Size of Environment Sector     */
 
 #define CFG_GBL_DATA_OFFSET    (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
 #define CFG_INIT_SP_OFFSET     CFG_GBL_DATA_OFFSET
 
-#define CFG_MONITOR_BASE    TEXT_BASE
+#define CFG_MONITOR_BASE       TEXT_BASE
 #if (CFG_MONITOR_BASE < CFG_FLASH_BASE)
 #   define CFG_RAMBOOT         1
 #endif
 /* #define CONFIG_FEC_10MBIT 1 */
 #define CONFIG_PHY_ADDR                1
 
+/*
+ * LCD Splash Screen
+ */
+#if !defined(CONFIG_PRS200)
+#define CONFIG_LCD             1
+#endif
+
+#if defined(CONFIG_LCD)
+#define CONFIG_SPLASH_SCREEN   1
+#define CFG_CONSOLE_IS_IN_ENV  1
+#define LCD_BPP                        LCD_MONOCHROME
+#endif
+
 /*
  * GPIO configuration
  */
 /* 0x10000004 = 32MB SDRAM */
 /* 0x90000004 = 64MB SDRAM */
+#if defined(CONFIG_LCD)
+/* set PSC2 in UART mode */
+#define CFG_GPS_PORT_CONFIG    0x00000044
+#else
 #define CFG_GPS_PORT_CONFIG    0x00000004
+#endif
 
 /*
  * Miscellaneous configurable options
  */
-#define CFG_LONGHELP                   /* undef to save memory     */
-#define CFG_PROMPT             "=> "   /* Monitor Command Prompt   */
+#define CFG_LONGHELP                   /* undef to save memory         */
+#define CFG_PROMPT             "=> "   /* Monitor Command Prompt       */
 #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#define CFG_CBSIZE             1024    /* Console I/O Buffer Size  */
+#define CFG_CBSIZE             1024    /* Console I/O Buffer Size      */
 #else
-#define CFG_CBSIZE             256     /* Console I/O Buffer Size  */
+#define CFG_CBSIZE             256     /* Console I/O Buffer Size      */
 #endif
-#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16)  /* Print Buffer Size */
+#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16)  /* Print Buffer Size    */
 #define CFG_MAXARGS            16              /* max number of command args   */
 #define CFG_BARGSIZE           CFG_CBSIZE      /* Boot Argument Buffer Size    */
 
-#define CFG_MEMTEST_START      0x00100000      /* memtest works on */
+#define CFG_MEMTEST_START      0x00100000      /* memtest works on     */
 #define CFG_MEMTEST_END                0x00f00000      /* 1 ... 15 MB in DRAM  */
 
 #define CFG_LOAD_ADDR          0x100000        /* default load address */
  * One of four SC16C554 UARTs is selected with
  * A3-A4 (DA5-DA6) lines.
  */
-#if (CONFIG_QUART_CONSOLE > 0) && (CONFIG_QUART_CONSOLE < 5)
+#if (CONFIG_QUART_CONSOLE > 0) && (CONFIG_QUART_CONSOLE < 5) && !defined(CONFIG_PRS200)
 #define CFG_NS16550_COM1       (CFG_CS2_START | (CONFIG_QUART_CONSOLE - 1)<<5)
 #elif (CONFIG_QUART_CONSOLE > 4) && (CONFIG_QUART_CONSOLE < 9)
 #define CFG_NS16550_COM1       (CFG_CS1_START | (CONFIG_QUART_CONSOLE - 5)<<5)
index 50c1c4fd4cb0a6d91db463bf7cf459652718387f..23bdfc8dfb99e1821053fb7a8de5025cc7e35521 100644 (file)
@@ -63,6 +63,7 @@
 /*-----------------------------------------------------------------------
  * Initial RAM & stack pointer (placed in SDRAM)
  *----------------------------------------------------------------------*/
+#define CFG_INIT_RAM_DCACHE    1               /* d-cache as init ram  */
 #define CFG_INIT_RAM_ADDR      0x70000000              /* DCache       */
 #define CFG_INIT_RAM_END       (8 << 10)
 #define CFG_GBL_DATA_SIZE      256                     /* num bytes initial data*/
diff --git a/include/configs/sequoia.h b/include/configs/sequoia.h
new file mode 100644 (file)
index 0000000..639765d
--- /dev/null
@@ -0,0 +1,418 @@
+/*
+ * (C) Copyright 2006
+ * Stefan Roese, DENX Software Engineering, sr@denx.de.
+ *
+ * (C) Copyright 2006
+ * Jacqueline Pira-Ferriol, AMCC/IBM, jpira-ferriol@fr.ibm.com
+ * Alain Saurel,            AMCC/IBM, alain.saurel@fr.ibm.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., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+/************************************************************************
+ * sequoia.h - configuration for Sequoia board (PowerPC440EPx)
+ ***********************************************************************/
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*-----------------------------------------------------------------------
+ * High Level Configuration Options
+ *----------------------------------------------------------------------*/
+#define CONFIG_SEQUOIA         1               /* Board is Sequoia     */
+#define CONFIG_440EPX          1               /* Specific PPC440EPx   */
+#define CONFIG_4xx             1               /* ... PPC4xx family    */
+#define CONFIG_SYS_CLK_FREQ    33333333        /* external freq to pll */
+
+#define CONFIG_BOARD_EARLY_INIT_F 1            /* Call board_early_init_f */
+#define CONFIG_MISC_INIT_R     1               /* Call misc_init_r     */
+
+/*-----------------------------------------------------------------------
+ * Base addresses -- Note these are effective addresses where the
+ * actual resources get mapped (not physical addresses)
+ *----------------------------------------------------------------------*/
+#define CFG_MONITOR_LEN                (384 * 1024)    /* Reserve 384 kB for Monitor   */
+#define CFG_MALLOC_LEN         (256 * 1024)    /* Reserve 256 kB for malloc()  */
+
+#define CFG_BOOT_BASE_ADDR     0xf0000000
+#define CFG_SDRAM_BASE         0x00000000      /* _must_ be 0          */
+#define CFG_FLASH_BASE         0xfe000000      /* start of FLASH       */
+#define CFG_MONITOR_BASE       TEXT_BASE
+#define CFG_NAND_ADDR          0xd0000000      /* NAND Flash           */
+#define CFG_OCM_BASE           0xe0010000      /* ocm                  */
+#define CFG_PCI_BASE           0xe0000000      /* Internal PCI regs    */
+#define CFG_PCI_MEMBASE                0x80000000      /* mapped pci memory    */
+#define CFG_PCI_MEMBASE1       CFG_PCI_MEMBASE  + 0x10000000
+#define CFG_PCI_MEMBASE2       CFG_PCI_MEMBASE1 + 0x10000000
+#define CFG_PCI_MEMBASE3       CFG_PCI_MEMBASE2 + 0x10000000
+
+/* Don't change either of these */
+#define CFG_PERIPHERAL_BASE    0xef600000      /* internal peripherals */
+
+#define CFG_USB2D0_BASE                0xe0000100
+#define CFG_USB_DEVICE         0xe0000000
+#define CFG_USB_HOST           0xe0000400
+#define CFG_BCSR_BASE          0xc0000000
+
+/*-----------------------------------------------------------------------
+ * Initial RAM & stack pointer
+ *----------------------------------------------------------------------*/
+/* 440EPx/440GRx have 16KB of internal SRAM, so no need for D-Cache    */
+#define CFG_INIT_RAM_OCM       1               /* OCM as init ram      */
+#define CFG_INIT_RAM_ADDR      CFG_OCM_BASE    /* OCM                  */
+
+#define CFG_INIT_RAM_END       (4 << 10)
+#define CFG_GBL_DATA_SIZE      256             /* num bytes initial data */
+#define CFG_GBL_DATA_OFFSET    (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
+#define CFG_INIT_SP_OFFSET     CFG_GBL_DATA_OFFSET
+
+/*-----------------------------------------------------------------------
+ * Serial Port
+ *----------------------------------------------------------------------*/
+#define CFG_EXT_SERIAL_CLOCK   11059200        /* ext. 11.059MHz clk   */
+#define CONFIG_BAUDRATE                115200
+#define CONFIG_SERIAL_MULTI     1
+/* define this if you want console on UART1 */
+#undef CONFIG_UART1_CONSOLE
+
+#define CFG_BAUDRATE_TABLE                                             \
+       {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
+
+/*-----------------------------------------------------------------------
+ * Environment
+ *----------------------------------------------------------------------*/
+#if !defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_NAND_SPL)
+#define CFG_ENV_IS_IN_FLASH     1      /* use FLASH for environment vars       */
+#else
+#define CFG_ENV_IS_IN_NAND     1       /* use NAND for environment vars        */
+#endif
+
+/*-----------------------------------------------------------------------
+ * FLASH related
+ *----------------------------------------------------------------------*/
+#define CFG_FLASH_CFI                          /* The flash is CFI compatible  */
+#define CFG_FLASH_CFI_DRIVER                   /* Use common CFI driver        */
+
+#define CFG_FLASH_BANKS_LIST   { CFG_FLASH_BASE }
+
+#define CFG_MAX_FLASH_BANKS    1       /* max number of memory banks           */
+#define CFG_MAX_FLASH_SECT     512     /* max number of sectors on one chip    */
+
+#define CFG_FLASH_ERASE_TOUT   120000  /* Timeout for Flash Erase (in ms)      */
+#define CFG_FLASH_WRITE_TOUT   500     /* Timeout for Flash Write (in ms)      */
+
+#define CFG_FLASH_USE_BUFFER_WRITE 1   /* use buffered writes (20x faster)     */
+#define CFG_FLASH_PROTECTION   1       /* use hardware flash protection        */
+
+#define CFG_FLASH_EMPTY_INFO           /* print 'E' for empty sector on flinfo */
+#define CFG_FLASH_QUIET_TEST   1       /* don't warn upon unknown flash        */
+
+#ifdef CFG_ENV_IS_IN_FLASH
+#define CFG_ENV_SECT_SIZE      0x20000         /* size of one complete sector  */
+#define CFG_ENV_ADDR           ((-CFG_MONITOR_LEN)-CFG_ENV_SECT_SIZE)
+#define        CFG_ENV_SIZE            0x2000  /* Total Size of Environment Sector     */
+
+/* Address and size of Redundant Environment Sector    */
+#define CFG_ENV_ADDR_REDUND    (CFG_ENV_ADDR-CFG_ENV_SECT_SIZE)
+#define CFG_ENV_SIZE_REDUND    (CFG_ENV_SIZE)
+#endif
+
+/*-----------------------------------------------------------------------
+ * NAND FLASH
+ *----------------------------------------------------------------------*/
+#define CFG_MAX_NAND_DEVICE    1
+#define NAND_MAX_CHIPS         1
+#define CFG_NAND_BASE          CFG_NAND_ADDR
+
+/*
+ * IPL (Initial Program Loader, integrated inside CPU)
+ * Will load first 4k from NAND (SPL) into cache and execute it from there.
+ *
+ * SPL (Secondary Program Loader)
+ * Will load special U-Boot version (NUB) from NAND and execute it. This SPL
+ * has to fit into 4kByte. It sets up the CPU and configures the SDRAM
+ * controller and the NAND controller so that the special U-Boot image can be
+ * loaded from NAND to SDRAM.
+ *
+ * NUB (NAND U-Boot)
+ * This NAND U-Boot (NUB) is a special U-Boot version which can be started
+ * from RAM. Therefore it mustn't (re-)configure the SDRAM controller.
+ *
+ * On 440EPx the SPL is copied to SDRAM before the NAND controller is
+ * set up. While still running from cache, I experienced problems accessing
+ * the NAND controller.        sr - 2006-08-25
+ */
+#define CFG_NAND_BOOT_SPL_SRC  0xfffff000      /* SPL location                 */
+#define CFG_NAND_BOOT_SPL_SIZE (4 << 10)       /* SPL size                     */
+#define CFG_NAND_BOOT_SPL_DST  (CFG_OCM_BASE + (12 << 10)) /* Copy SPL here    */
+#define CFG_NAND_U_BOOT_DST    0x01000000      /* Load NUB to this addr        */
+#define CFG_NAND_U_BOOT_START  CFG_NAND_U_BOOT_DST /* Start NUB from this addr */
+#define CFG_NAND_BOOT_SPL_DELTA        (CFG_NAND_BOOT_SPL_SRC - CFG_NAND_BOOT_SPL_DST)
+
+/*
+ * Define the partitioning of the NAND chip (only RAM U-Boot is needed here)
+ */
+#define CFG_NAND_U_BOOT_OFFS   (16 << 10)      /* Offset to RAM U-Boot image   */
+#define CFG_NAND_U_BOOT_SIZE   (384 << 10)     /* Size of RAM U-Boot image     */
+
+/*
+ * Now the NAND chip has to be defined (no autodetection used!)
+ */
+#define CFG_NAND_PAGE_SIZE     (512)           /* NAND chip page size          */
+#define CFG_NAND_BLOCK_SIZE    (16 << 10)      /* NAND chip block size         */
+#define CFG_NAND_PAGE_COUNT    (32)            /* NAND chip page count         */
+#define CFG_NAND_BAD_BLOCK_POS (5)             /* Location of bad block marker */
+#undef CFG_NAND_4_ADDR_CYCLE                   /* No fourth addr used (<=32MB) */
+
+#ifdef CFG_ENV_IS_IN_NAND
+/*
+ * For NAND booting the environment is embedded in the U-Boot image. Please take
+ * look at the file board/amcc/sequoia/u-boot-nand.lds for details.
+ */
+#define CFG_ENV_SIZE           CFG_NAND_BLOCK_SIZE
+#define CFG_ENV_OFFSET         (CFG_NAND_U_BOOT_OFFS + CFG_ENV_SIZE)
+#define CFG_ENV_OFFSET_REDUND  (CFG_ENV_OFFSET + CFG_ENV_SIZE)
+#endif
+
+/*-----------------------------------------------------------------------
+ * DDR SDRAM
+ *----------------------------------------------------------------------*/
+#define CFG_MBYTES_SDRAM        (256)    /* 256MB                      */
+
+/*-----------------------------------------------------------------------
+ * I2C
+ *----------------------------------------------------------------------*/
+#define CONFIG_HARD_I2C                1               /* I2C with hardware support    */
+#undef CONFIG_SOFT_I2C                         /* I2C bit-banged               */
+#define CFG_I2C_SPEED          400000          /* I2C speed and slave address  */
+#define CFG_I2C_SLAVE          0x7F
+
+#define CFG_I2C_MULTI_EEPROMS
+#define CFG_I2C_EEPROM_ADDR    (0xa8>>1)
+#define CFG_I2C_EEPROM_ADDR_LEN 1
+#define CFG_EEPROM_PAGE_WRITE_ENABLE
+#define CFG_EEPROM_PAGE_WRITE_BITS 3
+#define CFG_EEPROM_PAGE_WRITE_DELAY_MS 10
+
+/* I2C SYSMON (LM75, AD7414 is almost compatible)                      */
+#define CONFIG_DTT_LM75                1               /* ON Semi's LM75       */
+#define CONFIG_DTT_AD7414      1               /* use AD7414           */
+#define CONFIG_DTT_SENSORS     {0}             /* Sensor addresses     */
+#define CFG_DTT_MAX_TEMP       70
+#define CFG_DTT_LOW_TEMP       -30
+#define CFG_DTT_HYSTERESIS     3
+
+#define CONFIG_PREBOOT "echo;"                                         \
+       "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
+       "echo"
+
+#undef CONFIG_BOOTARGS
+
+#define        CONFIG_EXTRA_ENV_SETTINGS                                       \
+       "netdev=eth0\0"                                                 \
+       "hostname=sequoia\0"                                            \
+       "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
+               "nfsroot=${serverip}:${rootpath}\0"                     \
+       "ramargs=setenv bootargs root=/dev/ram rw\0"                    \
+       "addip=setenv bootargs ${bootargs} "                            \
+               "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}"      \
+               ":${hostname}:${netdev}:off panic=1\0"                  \
+       "addtty=setenv bootargs ${bootargs} console=ttyS0,${baudrate}\0"\
+       "flash_nfs=run nfsargs addip addtty;"                           \
+               "bootm ${kernel_addr}\0"                                \
+       "flash_self=run ramargs addip addtty;"                          \
+               "bootm ${kernel_addr} ${ramdisk_addr}\0"                \
+       "net_nfs=tftp 200000 ${bootfile};run nfsargs addip addtty;"     \
+               "bootm\0"                                               \
+       "rootpath=/opt/eldk/ppc_4xx\0"                                  \
+       "bootfile=/tftpboot/sequoia/uImage\0"                           \
+       "kernel_addr=FE000000\0"                                        \
+       "ramdisk_addr=FE180000\0"                                       \
+       "load=tftp 100000 /tftpboot/sequoia/u-boot.bin\0"               \
+       "update=protect off FFFA0000 FFFFFFFF;era FFFA0000 FFFFFFFF;"   \
+               "cp.b 100000 FFFA0000 60000\0"                          \
+       "upd=run load;run update\0"                                     \
+       ""
+#define CONFIG_BOOTCOMMAND     "run flash_self"
+
+#if 0
+#define CONFIG_BOOTDELAY       -1      /* autoboot disabled            */
+#else
+#define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
+#endif
+
+#define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
+#define CFG_LOADS_BAUD_CHANGE  1       /* allow baudrate change        */
+
+#define CONFIG_M88E1111_PHY    1
+#define        CONFIG_IBM_EMAC4_V4     1
+#define CONFIG_MII             1       /* MII PHY management           */
+#define CONFIG_PHY_ADDR                0       /* PHY address, See schematics  */
+
+#define CONFIG_PHY_RESET        1      /* reset phy upon startup         */
+#define CONFIG_PHY_GIGE                1       /* Include GbE speed/duplex detection */
+
+#define CONFIG_HAS_ETH0
+#define CFG_RX_ETH_BUFFER      32      /* Number of ethernet rx buffers & descriptors */
+
+#define CONFIG_NET_MULTI       1
+#define CONFIG_HAS_ETH1                1       /* add support for "eth1addr"   */
+#define CONFIG_PHY1_ADDR       1
+
+/* USB */
+#define CONFIG_USB_OHCI
+#define CONFIG_USB_STORAGE
+
+/* Comment this out to enable USB 1.1 device */
+#define USB_2_0_DEVICE
+
+/* Partitions */
+#define CONFIG_MAC_PARTITION
+#define CONFIG_DOS_PARTITION
+#define CONFIG_ISO_PARTITION
+
+#define CONFIG_COMMANDS       (CONFIG_CMD_DFL  |       \
+                              CFG_CMD_ASKENV   |       \
+                              CFG_CMD_DHCP     |       \
+                              CFG_CMD_DTT      |       \
+                              CFG_CMD_DIAG     |       \
+                              CFG_CMD_EEPROM   |       \
+                              CFG_CMD_ELF      |       \
+                              CFG_CMD_FAT      |       \
+                              CFG_CMD_I2C      |       \
+                              CFG_CMD_IRQ      |       \
+                              CFG_CMD_MII      |       \
+                              CFG_CMD_NAND     |       \
+                              CFG_CMD_NET      |       \
+                              CFG_CMD_NFS      |       \
+                              CFG_CMD_PCI      |       \
+                              CFG_CMD_PING     |       \
+                              CFG_CMD_REGINFO  |       \
+                              CFG_CMD_SDRAM    |       \
+                              CFG_CMD_USB    )
+
+#define CONFIG_SUPPORT_VFAT
+
+/* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
+#include <cmd_confdefs.h>
+
+/*-----------------------------------------------------------------------
+ * Miscellaneous configurable options
+ *----------------------------------------------------------------------*/
+#define CFG_LONGHELP                   /* undef to save memory         */
+#define CFG_PROMPT             "=> "   /* Monitor Command Prompt       */
+#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#define CFG_CBSIZE             1024    /* Console I/O Buffer Size      */
+#else
+#define CFG_CBSIZE             256     /* Console I/O Buffer Size      */
+#endif
+#define CFG_PBSIZE              (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
+#define CFG_MAXARGS            16      /* max number of command args   */
+#define CFG_BARGSIZE           CFG_CBSIZE /* Boot Argument Buffer Size */
+
+#define CFG_MEMTEST_START      0x0400000 /* memtest works on           */
+#define CFG_MEMTEST_END                0x0C00000 /* 4 ... 12 MB in DRAM        */
+
+#define CFG_LOAD_ADDR          0x100000  /* default load address       */
+#define CFG_EXTBDINFO          1       /* To use extended board_into (bd_t) */
+
+#define CFG_HZ                 1000    /* decrementer freq: 1 ms ticks */
+
+#define CONFIG_CMDLINE_EDITING 1       /* add command line history     */
+#define CONFIG_LOOPW            1       /* enable loopw command         */
+#define CONFIG_MX_CYCLIC        1       /* enable mdc/mwc commands      */
+#define CONFIG_ZERO_BOOTDELAY_CHECK    /* check for keypress on bootdelay==0 */
+#define CONFIG_VERSION_VARIABLE 1      /* include version env variable */
+
+/*-----------------------------------------------------------------------
+ * PCI stuff
+ *----------------------------------------------------------------------*/
+/* General PCI */
+#define CONFIG_PCI                     /* include pci support          */
+#define CONFIG_PCI_PNP                 /* do (not) pci plug-and-play   */
+#define CONFIG_PCI_SCAN_SHOW           /* show pci devices on startup  */
+#define CFG_PCI_TARGBASE        0x80000000 /* PCIaddr mapped to CFG_PCI_MEMBASE*/
+
+/* Board-specific PCI */
+#define CFG_PCI_PRE_INIT               /* enable board pci_pre_init()  */
+#define CFG_PCI_TARGET_INIT
+#define CFG_PCI_MASTER_INIT
+
+#define CFG_PCI_SUBSYS_VENDORID 0x10e8 /* AMCC                         */
+#define CFG_PCI_SUBSYS_ID       0xcafe /* Whatever                     */
+
+/*
+ * For booting Linux, the board info and command line data
+ * have to be in the first 8 MB of memory, since this is
+ * the maximum mapped by the Linux kernel during initialization.
+ */
+#define CFG_BOOTMAPSZ          (8 << 20)       /* Initial Memory map for Linux */
+
+/*-----------------------------------------------------------------------
+ * External Bus Controller (EBC) Setup
+ *----------------------------------------------------------------------*/
+#define CFG_FLASH              CFG_FLASH_BASE
+#define CFG_NAND               0xD0000000
+#define CFG_CPLD               0xC0000000
+
+/*
+ * On Sequoia CS0 and CS3 are switched when configuring for NAND booting
+ */
+#if !defined(CONFIG_NAND_U_BOOT) && !defined(CONFIG_NAND_SPL)
+#define CFG_NAND_CS            3               /* NAND chip connected to CSx   */
+/* Memory Bank 0 (NOR-FLASH) initialization                                    */
+#define CFG_EBC_PB0AP          0x03017300
+#define CFG_EBC_PB0CR          (CFG_FLASH | 0xba000)
+
+/* Memory Bank 3 (NAND-FLASH) initialization                                   */
+#define CFG_EBC_PB3AP          0x018003c0
+#define CFG_EBC_PB3CR          (CFG_NAND | 0x1c000)
+#else
+#define CFG_NAND_CS            0               /* NAND chip connected to CSx   */
+/* Memory Bank 3 (NOR-FLASH) initialization                                    */
+#define CFG_EBC_PB3AP          0x03017300
+#define CFG_EBC_PB3CR          (CFG_FLASH | 0xba000)
+
+/* Memory Bank 0 (NAND-FLASH) initialization                                   */
+#define CFG_EBC_PB0AP          0x018003c0
+#define CFG_EBC_PB0CR          (CFG_NAND | 0x1c000)
+#endif
+
+/* Memory Bank 2 (CPLD) initialization                                         */
+#define CFG_EBC_PB2AP          0x24814580
+#define CFG_EBC_PB2CR          (CFG_CPLD | 0x38000)
+
+/*-----------------------------------------------------------------------
+ * Cache Configuration
+ *----------------------------------------------------------------------*/
+#define CFG_DCACHE_SIZE                (32<<10)  /* For AMCC 440 CPUs                  */
+#define CFG_CACHELINE_SIZE     32            /* ...                                */
+#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#define CFG_CACHELINE_SHIFT    5             /* log base 2 of the above value  */
+#endif
+
+/*
+ * Internal Definitions
+ *
+ * Boot Flags
+ */
+#define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
+#define BOOTFLAG_WARM  0x02            /* Software reboot                      */
+
+#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
+#define CONFIG_KGDB_BAUDRATE   230400  /* speed to run kgdb serial port */
+#define CONFIG_KGDB_SER_INDEX  2           /* which serial port to use */
+#endif
+#endif /* __CONFIG_H */
index 3d907f888c24e9157d3270ef168a579a25938282..4937638820b94047343f50e799205921f5a27630 100644 (file)
 #define CONFIG_MPC8220_FEC     1
 #define CONFIG_FEC_10MBIT      1 /* Workaround for FEC 100Mbit problem */
 #define CONFIG_PHY_ADDR                0x1F
+#define CONFIG_MII             1
 
 /*
  * Miscellaneous configurable options
index cf42b666b00c83af41300a415b687f8a15e53962..ba27f37f6ebe3505ad24433d5973b5dee2687047 100644 (file)
@@ -65,6 +65,7 @@
 /*-----------------------------------------------------------------------
  * Initial RAM & stack pointer (placed in SDRAM)
  *----------------------------------------------------------------------*/
+#define CFG_INIT_RAM_DCACHE    1               /* d-cache as init ram  */
 #define CFG_INIT_RAM_ADDR      0x70000000              /* DCache       */
 #define CFG_INIT_RAM_END       (8 << 10)
 #define CFG_GBL_DATA_SIZE      256                     /* num bytes initial data*/
 #define CFG_FLASH_ERASE_TOUT   120000  /* Timeout for Flash Erase (in ms)      */
 #define CFG_FLASH_WRITE_TOUT   500     /* Timeout for Flash Write (in ms)      */
 
+#define CFG_FLASH_USE_BUFFER_WRITE 1   /* use buffered writes (20x faster)     */
+
 #define CFG_FLASH_EMPTY_INFO           /* print 'E' for empty sector on flinfo */
 
 #ifdef CFG_ENV_IS_IN_FLASH
index 86a85b8a6d311190bfe6fbad8a89964e38676d2b..3d7b4a2f4bc8890f3f47c14b3f02dc5074f2db71 100644 (file)
@@ -65,6 +65,7 @@
 /*-----------------------------------------------------------------------
  * Initial RAM & stack pointer (placed in SDRAM)
  *----------------------------------------------------------------------*/
+#define CFG_INIT_RAM_DCACHE    1               /* d-cache as init ram  */
 #define CFG_INIT_RAM_ADDR      0x70000000              /* DCache       */
 #define CFG_INIT_RAM_END       (8 << 10)
 #define CFG_GBL_DATA_SIZE      256                     /* num bytes initial data*/
index 422f800897fb78982e388d5ef9371aed34810ac5..26b07120da152166f250ce69f1b9073e4ae58ec6 100644 (file)
 # ifdef CFG_ENV_OFFSET_REDUND
 #  define CFG_REDUNDAND_ENVIRONMENT
 # endif
+# if defined(CONFIG_NAND_U_BOOT)
+/* Use embedded environment in NAND boot versions */
+#  define ENV_IS_EMBEDDED      1
+# endif
 #endif /* CFG_ENV_IS_IN_NAND */
 
 
index 0eaf66e1838f4b6a69a455dbd93c24343ce8a3dd..8f7f61703c6c47519794996d65931018b3216d86 100644 (file)
@@ -20,6 +20,9 @@ void udelay(unsigned long);
 unsigned long get_timer(unsigned long);
 void vprintf(const char *, va_list);
 void do_reset (void);
+unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base);
+char *getenv (char *name);
+void setenv (char *varname, char *varvalue);
 #if (CONFIG_COMMANDS & CFG_CMD_I2C)
 int i2c_write (uchar, uint, int , uchar* , int);
 int i2c_read (uchar, uint, int , uchar* , int);
@@ -37,7 +40,7 @@ enum {
        XF_MAX
 };
 
-#define XF_VERSION     2
+#define XF_VERSION     3
 
 #if defined(CONFIG_I386)
 extern gd_t *global_data;
index 7e23736bca957a3340c10b3e072342f694d86f38..b688583828b1c82f90c9ea4a0a670d0eb7fb03a5 100644 (file)
@@ -148,7 +148,14 @@ typedef struct vidinfo {
 
 extern vidinfo_t panel_info;
 
-#endif /* CONFIG_MPC823 or CONFIG_PXA250 */
+#elif defined(CONFIG_MCC200)
+typedef struct vidinfo {
+       ushort  vl_col;         /* Number of columns (i.e. 160) */
+       ushort  vl_row;         /* Number of rows (i.e. 100) */
+
+       u_char  vl_bpix;        /* Bits per pixel, 0 = 1 */
+} vidinfo_t;
+#endif /* CONFIG_MPC823, CONFIG_PXA250 or CONFIG_MCC200 */
 
 /* Video functions */
 
index 460cd45c808e67e8e1ce646cca1fbf0a56d182ac..fe55087ea93602d61e2e620f5849ba47553fd72a 100644 (file)
 #define max_t(type,x,y) \
        ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
 
+#ifndef BUG
 #define BUG() do { \
        printf("U-Boot BUG at %s:%d!\n", __FILE__, __LINE__); \
 } while (0)
 
 #define BUG_ON(condition) do { if (condition) BUG(); } while(0)
+#endif /* BUG */
 
 #define likely(x)      __builtin_expect(!!(x), 1)
 #define unlikely(x)    __builtin_expect(!!(x), 0)
diff --git a/include/linux/mtd/ndfc.h b/include/linux/mtd/ndfc.h
new file mode 100644 (file)
index 0000000..d0558a9
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ *  linux/include/linux/mtd/ndfc.h
+ *
+ *  Copyright (c) 2006 Thomas Gleixner <tglx@linutronix.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *  Info:
+ *   Contains defines, datastructures for ndfc nand controller
+ *
+ */
+#ifndef __LINUX_MTD_NDFC_H
+#define __LINUX_MTD_NDFC_H
+
+/* NDFC Register definitions */
+#define NDFC_CMD               0x00
+#define NDFC_ALE               0x04
+#define NDFC_DATA              0x08
+#define NDFC_ECC               0x10
+#define NDFC_BCFG0             0x30
+#define NDFC_BCFG1             0x34
+#define NDFC_BCFG2             0x38
+#define NDFC_BCFG3             0x3c
+#define NDFC_CCR               0x40
+#define NDFC_STAT              0x44
+#define NDFC_HWCTL             0x48
+#define NDFC_REVID             0x50
+
+#define NDFC_STAT_IS_READY     0x01000000
+
+#define NDFC_CCR_RESET_CE      0x80000000 /* CE Reset */
+#define NDFC_CCR_RESET_ECC     0x40000000 /* ECC Reset */
+#define NDFC_CCR_RIE           0x20000000 /* Interrupt Enable on Device Rdy */
+#define NDFC_CCR_REN           0x10000000 /* Enable wait for Rdy in LinearR */
+#define NDFC_CCR_ROMEN         0x08000000 /* Enable ROM In LinearR */
+#define NDFC_CCR_ARE           0x04000000 /* Auto-Read Enable */
+#define NDFC_CCR_BS(x)         (((x) & 0x3) << 24) /* Select Bank on CE[x] */
+#define NDFC_CCR_BS_MASK       0x03000000 /* Select Bank */
+#define NDFC_CCR_ARAC0         0x00000000 /* 3 Addr, 1 Col 2 Row 512b page */
+#define NDFC_CCR_ARAC1         0x00001000 /* 4 Addr, 1 Col 3 Row 512b page */
+#define NDFC_CCR_ARAC2         0x00002000 /* 4 Addr, 2 Col 2 Row 2K page */
+#define NDFC_CCR_ARAC3         0x00003000 /* 5 Addr, 2 Col 3 Row 2K page */
+#define NDFC_CCR_ARAC_MASK     0x00003000 /* Auto-Read mode Addr Cycles */
+#define NDFC_CCR_RPG           0x0000C000 /* Auto-Read Page */
+#define NDFC_CCR_EBCC          0x00000004 /* EBC Configuration Completed */
+#define NDFC_CCR_DHC           0x00000002 /* Direct Hardware Control Enable */
+
+#define NDFC_BxCFG_EN          0x80000000 /* Bank Enable */
+#define NDFC_BxCFG_CED         0x40000000 /* nCE Style */
+#define NDFC_BxCFG_SZ_MASK     0x08000000 /* Bank Size */
+#define NDFC_BxCFG_SZ_8BIT     0x00000000 /* 8bit */
+#define NDFC_BxCFG_SZ_16BIT    0x08000000 /* 16bit */
+
+#define NDFC_MAX_BANKS         4
+
+struct ndfc_controller_settings {
+       uint32_t        ccr_settings;
+       uint64_t        ndfc_erpn;
+};
+
+struct ndfc_chip_settings {
+       uint32_t        bank_settings;
+};
+
+#endif
index daa4d5f6d4cbc5312cd37530f48f9fd8998520ce..1d20d1dcf5530501c2c1889c3efb4395289c9f21 100644 (file)
 #define MPC5XXX_ICTL_PER_STS   (MPC5XXX_ICTL + 0x0030)
 #define MPC5XXX_ICTL_BUS_STS   (MPC5XXX_ICTL + 0x0038)
 
+#define NR_IRQS                        64
+
+/* IRQ mapping - these are our logical IRQ numbers */
+#define MPC5XXX_CRIT_IRQ_NUM   4
+#define MPC5XXX_MAIN_IRQ_NUM   17
+#define MPC5XXX_SDMA_IRQ_NUM   17
+#define MPC5XXX_PERP_IRQ_NUM   23
+
+#define MPC5XXX_CRIT_IRQ_BASE  1
+#define MPC5XXX_MAIN_IRQ_BASE  (MPC5XXX_CRIT_IRQ_BASE + MPC5XXX_CRIT_IRQ_NUM)
+#define MPC5XXX_SDMA_IRQ_BASE  (MPC5XXX_MAIN_IRQ_BASE + MPC5XXX_MAIN_IRQ_NUM)
+#define MPC5XXX_PERP_IRQ_BASE  (MPC5XXX_SDMA_IRQ_BASE + MPC5XXX_SDMA_IRQ_NUM)
+
+#define MPC5XXX_IRQ0                   (MPC5XXX_CRIT_IRQ_BASE + 0)
+#define MPC5XXX_SLICE_TIMER_0_IRQ      (MPC5XXX_CRIT_IRQ_BASE + 1)
+#define MPC5XXX_HI_INT_IRQ             (MPC5XXX_CRIT_IRQ_BASE + 2)
+#define MPC5XXX_CCS_IRQ                        (MPC5XXX_CRIT_IRQ_BASE + 3)
+
+#define MPC5XXX_IRQ1                   (MPC5XXX_MAIN_IRQ_BASE + 1)
+#define MPC5XXX_IRQ2                   (MPC5XXX_MAIN_IRQ_BASE + 2)
+#define MPC5XXX_IRQ3                   (MPC5XXX_MAIN_IRQ_BASE + 3)
+#define MPC5XXX_RTC_PINT_IRQ           (MPC5XXX_MAIN_IRQ_BASE + 5)
+#define MPC5XXX_RTC_SINT_IRQ           (MPC5XXX_MAIN_IRQ_BASE + 6)
+#define MPC5XXX_RTC_GPIO_STD_IRQ       (MPC5XXX_MAIN_IRQ_BASE + 7)
+#define MPC5XXX_RTC_GPIO_WKUP_IRQ      (MPC5XXX_MAIN_IRQ_BASE + 8)
+#define MPC5XXX_TMR0_IRQ               (MPC5XXX_MAIN_IRQ_BASE + 9)
+#define MPC5XXX_TMR1_IRQ               (MPC5XXX_MAIN_IRQ_BASE + 10)
+#define MPC5XXX_TMR2_IRQ               (MPC5XXX_MAIN_IRQ_BASE + 11)
+#define MPC5XXX_TMR3_IRQ               (MPC5XXX_MAIN_IRQ_BASE + 12)
+#define MPC5XXX_TMR4_IRQ               (MPC5XXX_MAIN_IRQ_BASE + 13)
+#define MPC5XXX_TMR5_IRQ               (MPC5XXX_MAIN_IRQ_BASE + 14)
+#define MPC5XXX_TMR6_IRQ               (MPC5XXX_MAIN_IRQ_BASE + 15)
+#define MPC5XXX_TMR7_IRQ               (MPC5XXX_MAIN_IRQ_BASE + 16)
+
+#define MPC5XXX_SDMA_IRQ               (MPC5XXX_PERP_IRQ_BASE + 0)
+#define MPC5XXX_PSC1_IRQ               (MPC5XXX_PERP_IRQ_BASE + 1)
+#define MPC5XXX_PSC2_IRQ               (MPC5XXX_PERP_IRQ_BASE + 2)
+#define MPC5XXX_PSC3_IRQ               (MPC5XXX_PERP_IRQ_BASE + 3)
+#define MPC5XXX_PSC6_IRQ               (MPC5XXX_PERP_IRQ_BASE + 4)
+#define MPC5XXX_IRDA_IRQ               (MPC5XXX_PERP_IRQ_BASE + 4)
+#define MPC5XXX_FEC_IRQ                        (MPC5XXX_PERP_IRQ_BASE + 5)
+#define MPC5XXX_USB_IRQ                        (MPC5XXX_PERP_IRQ_BASE + 6)
+#define MPC5XXX_ATA_IRQ                        (MPC5XXX_PERP_IRQ_BASE + 7)
+#define MPC5XXX_PCI_CNTRL_IRQ          (MPC5XXX_PERP_IRQ_BASE + 8)
+#define MPC5XXX_PCI_SCIRX_IRQ          (MPC5XXX_PERP_IRQ_BASE + 9)
+#define MPC5XXX_PCI_SCITX_IRQ          (MPC5XXX_PERP_IRQ_BASE + 10)
+#define MPC5XXX_PSC4_IRQ               (MPC5XXX_PERP_IRQ_BASE + 11)
+#define MPC5XXX_PSC5_IRQ               (MPC5XXX_PERP_IRQ_BASE + 12)
+#define MPC5XXX_SPI_MODF_IRQ           (MPC5XXX_PERP_IRQ_BASE + 13)
+#define MPC5XXX_SPI_SPIF_IRQ           (MPC5XXX_PERP_IRQ_BASE + 14)
+#define MPC5XXX_I2C1_IRQ               (MPC5XXX_PERP_IRQ_BASE + 15)
+#define MPC5XXX_I2C2_IRQ               (MPC5XXX_PERP_IRQ_BASE + 16)
+#define MPC5XXX_MSCAN1_IRQ             (MPC5XXX_PERP_IRQ_BASE + 17)
+#define MPC5XXX_MSCAN2_IRQ             (MPC5XXX_PERP_IRQ_BASE + 18)
+#define MPC5XXX_IR_RX_IRQ              (MPC5XXX_PERP_IRQ_BASE + 19)
+#define MPC5XXX_IR_TX_IRQ              (MPC5XXX_PERP_IRQ_BASE + 20)
+#define MPC5XXX_XLB_ARB_IRQ            (MPC5XXX_PERP_IRQ_BASE + 21)
+#define MPC5XXX_BDLC_IRQ               (MPC5XXX_PERP_IRQ_BASE + 22)
+
 /* General Purpose Timers registers */
 #define MPC5XXX_GPT0_ENABLE            (MPC5XXX_GPT + 0x0)
 #define MPC5XXX_GPT0_COUNTER           (MPC5XXX_GPT + 0x4)
index d5a9f66a419142da495625077ba016b1f1f1e657..c4a3ed5483561532dc9c74b0aa4727569d0f3147 100644 (file)
 #define         ivor13 0x19d   /* interrupt vector offset register 13 */
 #define         ivor14 0x19e   /* interrupt vector offset register 14 */
 #define         ivor15 0x19f   /* interrupt vector offset register 15 */
-#if defined(CONFIG_440GX) || defined(CONFIG_440EP) || defined(CONFIG_440GR) || defined(CONFIG_440SP) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440GX) || \
+    defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
+    defined(CONFIG_440SP) || defined(CONFIG_440SPE)
 #define         mcsrr0 0x23a   /* machine check save/restore register 0 */
 #define         mcsrr1 0x23b   /* mahcine check save/restore register 1 */
 #define         mcsr   0x23c   /* machine check status register */
 #define sdr_ecid1      0x0081
 #define sdr_ecid2      0x0082
 #define sdr_jtag       0x00c0
+#if !defined(CONFIG_440EPX) && !defined(CONFIG_440GRX)
 #define sdr_ddrdl      0x00e0
+#else
+#define sdr_cfg                0x00e0
+#define SDR_CFG_LT2_MASK          0x01000000 /* Leakage test 2*/
+#define SDR_CFG_64_32BITS_MASK    0x01000000 /* Switch DDR 64 bits or 32 bits */
+#define SDR_CFG_32BITS            0x00000000  /* 32 bits */
+#define SDR_CFG_64BITS            0x01000000  /* 64 bits */
+#define SDR_CFG_MC_V2518_MASK     0x02000000 /* Low VDD2518 (2.5 or 1.8V) */
+#define SDR_CFG_MC_V25            0x00000000  /* 2.5 V */
+#define SDR_CFG_MC_V18            0x02000000  /* 1.8 V */
+#endif /* !defined(CONFIG_440EPX) && !defined(CONFIG_440GRX) */
 #define sdr_ebc                0x0100
 #define sdr_uart0      0x0120  /* UART0 Config */
 #define sdr_uart1      0x0121  /* UART1 Config */
 #define sdr_plbtr      0x4200
 #define sdr_mfr                0x4300  /* SDR0_MFR reg */
 
+#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX) /* test-only!!!! */
+#define DDR0_00        0x00
+#define DDR0_01        0x01
+#define DDR0_02        0x02
+#define DDR0_03        0x03
+#define DDR0_04        0x04
+#define DDR0_05        0x05
+#define DDR0_06        0x06
+#define DDR0_07        0x07
+#define DDR0_08        0x08
+#define DDR0_09        0x09
+#define DDR0_10        0x0A
+#define DDR0_11        0x0B
+#define DDR0_12        0x0C
+#define DDR0_13        0x0D
+#define DDR0_14        0x0E
+#define DDR0_15        0x0F
+#define DDR0_16        0x10
+#define DDR0_17        0x11
+#define DDR0_18        0x12
+#define DDR0_19        0x13
+#define DDR0_20        0x14
+#define DDR0_21        0x15
+#define DDR0_22        0x16
+#define DDR0_23        0x17
+#define DDR0_24        0x18
+#define DDR0_25        0x19
+#define DDR0_26        0x1A
+#define DDR0_27        0x1B
+#define DDR0_28        0x1C
+#define DDR0_29        0x1D
+#define DDR0_30        0x1E
+#define DDR0_31        0x1F
+#define DDR0_32        0x20
+#define DDR0_33        0x21
+#define DDR0_34        0x22
+#define DDR0_35        0x23
+#define DDR0_36        0x24
+#define DDR0_37        0x25
+#define DDR0_38        0x26
+#define DDR0_39        0x27
+#define DDR0_40        0x28
+#define DDR0_41        0x29
+#define DDR0_42        0x2A
+#define DDR0_43        0x2B
+#define DDR0_44        0x2C
+#endif /*CONFIG_440EPX*/
+
 /*-----------------------------------------------------------------------------
  | SDRAM Controller
  +----------------------------------------------------------------------------*/
 #define xbcfg          0x23    /* external bus configuration reg       */
 #define xbcid          0x24    /* external bus core id reg             */
 
-#if defined(CONFIG_440EP) || defined(CONFIG_440GR)
+#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 
 /* PLB4 to PLB3 Bridge OUT */
 #define P4P3_DCR_BASE           0x020
 #define plb1_bearl                (PLB_ARBITER_BASE+ 0x0C)
 #define plb1_bearh                (PLB_ARBITER_BASE+ 0x0D)
 
+#if defined(CONFIG_440EP) || defined(CONFIG_440GR)
 /* Pin Function Control Register 1 */
 #define SDR0_PFC1                    0x4101
 #define   SDR0_PFC1_U1ME_MASK         0x02000000    /* UART1 Mode Enable */
 #define   SDR0_USB0_LEEN_DISABLE      0x00000000      /* Little Endian Disable */
 #define   SDR0_USB0_LEEN_ENABLE       0x00000001      /* Little Endian Enable */
 
+/* Miscealleneaous Function Reg. */
+#define SDR0_MFR                     0x4300
+#define   SDR0_MFR_ETH0_CLK_SEL_MASK   0x08000000   /* Ethernet0 Clock Select */
+#define   SDR0_MFR_ETH0_CLK_SEL_EXT    0x00000000
+#define   SDR0_MFR_ETH1_CLK_SEL_MASK   0x04000000   /* Ethernet1 Clock Select */
+#define   SDR0_MFR_ETH1_CLK_SEL_EXT    0x00000000
+#define   SDR0_MFR_ZMII_MODE_MASK      0x03000000   /* ZMII Mode Mask */
+#define   SDR0_MFR_ZMII_MODE_MII       0x00000000     /* ZMII Mode MII */
+#define   SDR0_MFR_ZMII_MODE_SMII      0x01000000     /* ZMII Mode SMII */
+#define   SDR0_MFR_ZMII_MODE_RMII_10M  0x02000000     /* ZMII Mode RMII - 10 Mbs */
+#define   SDR0_MFR_ZMII_MODE_RMII_100M 0x03000000     /* ZMII Mode RMII - 100 Mbs */
+#define   SDR0_MFR_ZMII_MODE_BIT0      0x02000000     /* ZMII Mode Bit0 */
+#define   SDR0_MFR_ZMII_MODE_BIT1      0x01000000     /* ZMII Mode Bit1 */
+#define   SDR0_MFR_ZM_ENCODE(n)        ((((unsigned long)(n))&0x3)<<24)
+#define   SDR0_MFR_ZM_DECODE(n)        ((((unsigned long)(n))<<24)&0x3)
+
+#define   SDR0_MFR_ERRATA3_EN0         0x00800000
+#define   SDR0_MFR_ERRATA3_EN1         0x00400000
+#define   SDR0_MFR_PKT_REJ_MASK        0x00180000   /* Pkt Rej. Enable Mask */
+#define   SDR0_MFR_PKT_REJ_EN          0x00180000   /* Pkt Rej. Enable on both EMAC3 0-1 */
+#define   SDR0_MFR_PKT_REJ_EN0         0x00100000   /* Pkt Rej. Enable on EMAC3(0) */
+#define   SDR0_MFR_PKT_REJ_EN1         0x00080000   /* Pkt Rej. Enable on EMAC3(1) */
+#define   SDR0_MFR_PKT_REJ_POL         0x00200000   /* Packet Reject Polarity */
+
+#endif /* defined(CONFIG_440EP) || defined(CONFIG_440GR) */
+
+#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
+#define SDR_USB2D0CR                 0x0320
+#define   SDR0_USB2D0CR_USB2DEV_EBC_SEL_MASK   0x00000004    /* USB 2.0 Device/EBC Master Selection */
+#define   SDR0_USB2D0CR_USB2DEV_SELECTION      0x00000004    /* USB 2.0 Device Selection */
+#define   SDR0_USB2D0CR_EBC_SELECTION          0x00000000    /* EBC Selection */
+
+#define   SDR0_USB2D0CR_USB_DEV_INT_SEL_MASK   0x00000002    /* USB Device Interface Selection */
+#define   SDR0_USB2D0CR_USB20D_DEVSEL          0x00000000      /* USB2.0 Device Selected */
+#define   SDR0_USB2D0CR_USB11D_DEVSEL          0x00000002      /* USB1.1 Device Selected */
+
+#define   SDR0_USB2D0CR_LEEN_MASK              0x00000001    /* Little Endian selection */
+#define   SDR0_USB2D0CR_LEEN_DISABLE           0x00000000      /* Little Endian Disable */
+#define   SDR0_USB2D0CR_LEEN_ENABLE            0x00000001      /* Little Endian Enable */
+
+/* USB2 Host Control Register */
+#define SDR0_USB2H0CR                0x0340
+#define   SDR0_USB2H0CR_WDINT_MASK             0x00000001 /* Host UTMI Word Interface */
+#define   SDR0_USB2H0CR_WDINT_8BIT_60MHZ       0x00000000  /* 8-bit/60MHz */
+#define   SDR0_USB2H0CR_WDINT_16BIT_30MHZ      0x00000001  /* 16-bit/30MHz */
+#define   SDR0_USB2H0CR_EFLADJ_MASK            0x0000007e /* EHCI Frame Length Adjustment */
+
+/* Pin Function Control Register 1 */
+#define SDR0_PFC1                    0x4101
+#define   SDR0_PFC1_U1ME_MASK                  0x02000000    /* UART1 Mode Enable */
+#define   SDR0_PFC1_U1ME_DSR_DTR               0x00000000      /* UART1 in DSR/DTR Mode */
+#define   SDR0_PFC1_U1ME_CTS_RTS               0x02000000      /* UART1 in CTS/RTS Mode */
+
+#define   SDR0_PFC1_SELECT_MASK                0x01C00000 /* Ethernet Pin Select EMAC 0 */
+#define   SDR0_PFC1_SELECT_CONFIG_1_1          0x00C00000   /* 1xMII   using RGMII bridge */
+#define   SDR0_PFC1_SELECT_CONFIG_1_2          0x00000000   /* 1xMII   using  ZMII bridge */
+#define   SDR0_PFC1_SELECT_CONFIG_2            0x00C00000   /* 1xGMII  using RGMII bridge */
+#define   SDR0_PFC1_SELECT_CONFIG_3            0x01000000   /* 1xTBI   using RGMII bridge */
+#define   SDR0_PFC1_SELECT_CONFIG_4            0x01400000   /* 2xRGMII using RGMII bridge */
+#define   SDR0_PFC1_SELECT_CONFIG_5            0x01800000   /* 2xRTBI  using RGMII bridge */
+#define   SDR0_PFC1_SELECT_CONFIG_6            0x00800000   /* 2xSMII  using  ZMII bridge */
+
+#define   SDR0_PFC1_U0ME_MASK                  0x00080000    /* UART0 Mode Enable */
+#define   SDR0_PFC1_U0ME_DSR_DTR               0x00000000      /* UART0 in DSR/DTR Mode */
+#define   SDR0_PFC1_U0ME_CTS_RTS               0x00080000      /* UART0 in CTS/RTS Mode */
+#define   SDR0_PFC1_U0IM_MASK                  0x00040000    /* UART0 Interface Mode */
+#define   SDR0_PFC1_U0IM_8PINS                 0x00000000      /* UART0 Interface Mode 8 pins */
+#define   SDR0_PFC1_U0IM_4PINS                 0x00040000      /* UART0 Interface Mode 4 pins */
+#define   SDR0_PFC1_SIS_MASK                   0x00020000    /* SCP or IIC1 Selection */
+#define   SDR0_PFC1_SIS_SCP_SEL                0x00000000      /* SCP Selected */
+#define   SDR0_PFC1_SIS_IIC1_SEL               0x00020000      /* IIC1 Selected */
+#define   SDR0_PFC1_UES_MASK                   0x00010000    /* USB2D_RX_Active / EBC_Hold Req Selection */
+#define   SDR0_PFC1_UES_USB2D_SEL              0x00000000      /* USB2D_RX_Active Selected */
+#define   SDR0_PFC1_UES_EBCHR_SEL              0x00010000      /* EBC_Hold Req Selected */
+#define   SDR0_PFC1_DIS_MASK                   0x00008000    /* DMA_Req(1) / UIC_IRQ(5) Selection */
+#define   SDR0_PFC1_DIS_DMAR_SEL               0x00000000      /* DMA_Req(1) Selected */
+#define   SDR0_PFC1_DIS_UICIRQ5_SEL            0x00008000      /* UIC_IRQ(5) Selected */
+#define   SDR0_PFC1_ERE_MASK                   0x00004000    /* EBC Mast.Ext.Req.En./GPIO0(27) Selection */
+#define   SDR0_PFC1_ERE_EXTR_SEL               0x00000000      /* EBC Mast.Ext.Req.En. Selected */
+#define   SDR0_PFC1_ERE_GPIO0_27_SEL           0x00004000      /* GPIO0(27) Selected */
+#define   SDR0_PFC1_UPR_MASK                   0x00002000    /* USB2 Device Packet Reject Selection */
+#define   SDR0_PFC1_UPR_DISABLE                0x00000000      /* USB2 Device Packet Reject Disable */
+#define   SDR0_PFC1_UPR_ENABLE                 0x00002000      /* USB2 Device Packet Reject Enable */
+
+#define   SDR0_PFC1_PLB_PME_MASK               0x00001000    /* PLB3/PLB4 Perf. Monitor En. Selection */
+#define   SDR0_PFC1_PLB_PME_PLB3_SEL           0x00000000      /* PLB3 Performance Monitor Enable */
+#define   SDR0_PFC1_PLB_PME_PLB4_SEL           0x00001000      /* PLB3 Performance Monitor Enable */
+#define   SDR0_PFC1_GFGGI_MASK                 0x0000000F    /* GPT Frequency Generation Gated In */
+
+/* Ethernet PLL Configuration Register */
+#define SDR0_PFC2                    0x4102
+#define   SDR0_PFC2_TUNE_MASK                  0x01FF8000  /* Loop stability tuning bits */
+#define   SDR0_PFC2_MULTI_MASK                 0x00007C00  /* Frequency multiplication selector */
+#define   SDR0_PFC2_RANGEB_MASK                0x00000380  /* PLLOUTB/C frequency selector */
+#define   SDR0_PFC2_RANGEA_MASK                0x00000071  /* PLLOUTA frequency selector */
+
+#define   SDR0_PFC2_SELECT_MASK                0xE0000000  /* Ethernet Pin select EMAC1 */
+#define   SDR0_PFC2_SELECT_CONFIG_1_1          0x60000000   /* 1xMII   using RGMII bridge */
+#define   SDR0_PFC2_SELECT_CONFIG_1_2          0x00000000   /* 1xMII   using  ZMII bridge */
+#define   SDR0_PFC2_SELECT_CONFIG_2            0x60000000   /* 1xGMII  using RGMII bridge */
+#define   SDR0_PFC2_SELECT_CONFIG_3            0x80000000   /* 1xTBI   using RGMII bridge */
+#define   SDR0_PFC2_SELECT_CONFIG_4            0xA0000000   /* 2xRGMII using RGMII bridge */
+#define   SDR0_PFC2_SELECT_CONFIG_5            0xC0000000   /* 2xRTBI  using RGMII bridge */
+#define   SDR0_PFC2_SELECT_CONFIG_6            0x40000000   /* 2xSMII  using  ZMII bridge */
+
+/* USB2PHY0 Control Register */
+#define SDR0_USB2PHY0CR               0x4103
+#define   SDR0_USB2PHY0CR_UTMICN_MASK          0x00100000 /*  PHY UTMI interface connection */
+#define   SDR0_USB2PHY0CR_UTMICN_DEV           0x00000000  /* Device support */
+#define   SDR0_USB2PHY0CR_UTMICN_HOST          0x00100000  /* Host support */
+
+#define   SDR0_USB2PHY0CR_DWNSTR_MASK          0x00400000 /* Select downstream port mode */
+#define   SDR0_USB2PHY0CR_DWNSTR_DEV           0x00000000  /* Device */
+#define   SDR0_USB2PHY0CR_DWNSTR_HOST          0x00400000  /* Host   */
+
+#define   SDR0_USB2PHY0CR_DVBUS_MASK           0x00800000 /* VBus detect (Device mode only)  */
+#define   SDR0_USB2PHY0CR_DVBUS_PURDIS         0x00000000  /* Pull-up resistance on D+ is disabled */
+#define   SDR0_USB2PHY0CR_DVBUS_PUREN          0x00800000  /* Pull-up resistance on D+ is enabled */
+
+#define   SDR0_USB2PHY0CR_WDINT_MASK           0x01000000 /* PHY UTMI data width and clock select  */
+#define   SDR0_USB2PHY0CR_WDINT_8BIT_60MHZ     0x00000000  /* 8-bit data/60MHz */
+#define   SDR0_USB2PHY0CR_WDINT_16BIT_30MHZ    0x01000000  /* 16-bit data/30MHz */
+
+#define   SDR0_USB2PHY0CR_LOOPEN_MASK          0x02000000 /* Loop back test enable  */
+#define   SDR0_USB2PHY0CR_LOOP_ENABLE          0x00000000  /* Loop back disabled */
+#define   SDR0_USB2PHY0CR_LOOP_DISABLE         0x02000000  /* Loop back enabled (only test purposes) */
+
+#define   SDR0_USB2PHY0CR_XOON_MASK            0x04000000 /* Force XO block on during a suspend  */
+#define   SDR0_USB2PHY0CR_XO_ON                0x00000000  /* PHY XO block is powered-on */
+#define   SDR0_USB2PHY0CR_XO_OFF               0x04000000  /* PHY XO block is powered-off when all ports are suspended */
+
+#define   SDR0_USB2PHY0CR_PWRSAV_MASK          0x08000000 /* Select PHY power-save mode  */
+#define   SDR0_USB2PHY0CR_PWRSAV_OFF           0x00000000  /* Non-power-save mode */
+#define   SDR0_USB2PHY0CR_PWRSAV_ON            0x08000000  /* Power-save mode. Valid only for full-speed operation */
+
+#define   SDR0_USB2PHY0CR_XOREF_MASK           0x10000000 /* Select reference clock source  */
+#define   SDR0_USB2PHY0CR_XOREF_INTERNAL       0x00000000  /* PHY PLL uses chip internal 48M clock as a reference */
+#define   SDR0_USB2PHY0CR_XOREF_XO             0x10000000  /* PHY PLL uses internal XO block output as a reference */
+
+#define   SDR0_USB2PHY0CR_XOCLK_MASK           0x20000000 /* Select clock for XO block  */
+#define   SDR0_USB2PHY0CR_XOCLK_EXTERNAL       0x00000000  /* PHY macro used an external clock */
+#define   SDR0_USB2PHY0CR_XOCLK_CRYSTAL        0x20000000  /* PHY macro uses the clock from a crystal */
+
+#define   SDR0_USB2PHY0CR_CLKSEL_MASK          0xc0000000 /* Select ref clk freq */
+#define   SDR0_USB2PHY0CR_CLKSEL_12MHZ         0x00000000 /* Select ref clk freq = 12 MHz*/
+#define   SDR0_USB2PHY0CR_CLKSEL_48MHZ         0x40000000 /* Select ref clk freq = 48 MHz*/
+#define   SDR0_USB2PHY0CR_CLKSEL_24MHZ         0x80000000 /* Select ref clk freq = 24 MHz*/
+
+/* Miscealleneaous Function Reg. */
+#define SDR0_MFR                     0x4300
+#define   SDR0_MFR_ETH0_CLK_SEL_MASK   0x08000000   /* Ethernet0 Clock Select */
+#define   SDR0_MFR_ETH0_CLK_SEL_EXT    0x00000000
+#define   SDR0_MFR_ETH1_CLK_SEL_MASK   0x04000000   /* Ethernet1 Clock Select */
+#define   SDR0_MFR_ETH1_CLK_SEL_EXT    0x00000000
+#define   SDR0_MFR_ZMII_MODE_MASK      0x03000000   /* ZMII Mode Mask */
+#define   SDR0_MFR_ZMII_MODE_MII       0x00000000     /* ZMII Mode MII */
+#define   SDR0_MFR_ZMII_MODE_SMII      0x01000000     /* ZMII Mode SMII */
+#define   SDR0_MFR_ZMII_MODE_BIT0      0x02000000     /* ZMII Mode Bit0 */
+#define   SDR0_MFR_ZMII_MODE_BIT1      0x01000000     /* ZMII Mode Bit1 */
+#define   SDR0_MFR_ZM_ENCODE(n)        ((((unsigned long)(n))&0x3)<<24)
+#define   SDR0_MFR_ZM_DECODE(n)        ((((unsigned long)(n))<<24)&0x3)
+
+#define   SDR0_MFR_ERRATA3_EN0         0x00800000
+#define   SDR0_MFR_ERRATA3_EN1         0x00400000
+#define   SDR0_MFR_PKT_REJ_MASK        0x00180000   /* Pkt Rej. Enable Mask */
+#define   SDR0_MFR_PKT_REJ_EN          0x00180000   /* Pkt Rej. Enable on both EMAC3 0-1 */
+#define   SDR0_MFR_PKT_REJ_EN0         0x00100000   /* Pkt Rej. Enable on EMAC3(0) */
+#define   SDR0_MFR_PKT_REJ_EN1         0x00080000   /* Pkt Rej. Enable on EMAC3(1) */
+#define   SDR0_MFR_PKT_REJ_POL         0x00200000   /* Packet Reject Polarity */
+
+#endif /* defined(CONFIG_440EPX) || defined(CONFIG_440GRX) */
+
 /* CUST0 Customer Configuration Register0 */
 #define SDR0_CUST0                   0x4000
 #define   SDR0_CUST0_MUX_E_N_G_MASK   0xC0000000     /* Mux_Emac_NDFC_GPIO */
 #define   SDR0_PFC1_PLB_PME_PLB4_SEL  0x00001000      /* PLB3 Performance Monitor Enable */
 #define   SDR0_PFC1_GFGGI_MASK        0x0000000F    /* GPT Frequency Generation Gated In */
 
-/* Miscealleneaous Function Reg. */
-#define SDR0_MFR                     0x4300
-#define   SDR0_MFR_ETH0_CLK_SEL        0x08000000   /* Ethernet0 Clock Select */
-#define   SDR0_MFR_ETH1_CLK_SEL        0x04000000   /* Ethernet1 Clock Select */
-#define   SDR0_MFR_ZMII_MODE_MASK      0x03000000   /* ZMII Mode Mask */
-#define   SDR0_MFR_ZMII_MODE_MII       0x00000000     /* ZMII Mode MII */
-#define   SDR0_MFR_ZMII_MODE_SMII      0x01000000     /* ZMII Mode SMII */
-#define   SDR0_MFR_ZMII_MODE_RMII_10M  0x02000000     /* ZMII Mode RMII - 10 Mbs */
-#define   SDR0_MFR_ZMII_MODE_RMII_100M 0x03000000     /* ZMII Mode RMII - 100 Mbs */
-#define   SDR0_MFR_ZMII_MODE_BIT0      0x02000000     /* ZMII Mode Bit0 */
-#define   SDR0_MFR_ZMII_MODE_BIT1      0x01000000     /* ZMII Mode Bit1 */
-#define   SDR0_MFR_ZM_ENCODE(n)        ((((unsigned long)(n))&0x3)<<24)
-#define   SDR0_MFR_ZM_DECODE(n)        ((((unsigned long)(n))<<24)&0x3)
-
-#define   SDR0_MFR_ERRATA3_EN0         0x00800000
-#define   SDR0_MFR_ERRATA3_EN1         0x00400000
-#define   SDR0_MFR_PKT_REJ_MASK        0x00300000   /* Pkt Rej. Enable Mask */
-#define   SDR0_MFR_PKT_REJ_EN          0x00300000   /* Pkt Rej. Enable on both EMAC3 0-1 */
-#define   SDR0_MFR_PKT_REJ_EN0         0x00200000   /* Pkt Rej. Enable on EMAC3(0) */
-#define   SDR0_MFR_PKT_REJ_EN1         0x00100000   /* Pkt Rej. Enable on EMAC3(1) */
-#define   SDR0_MFR_PKT_REJ_POL         0x00080000   /* Packet Reject Polarity */
+/*-----------------------------------------------------------------------------
+ | Internal SRAM
+ +----------------------------------------------------------------------------*/
+#define ISRAM0_DCR_BASE 0x380
+#define isram0_sb0cr   (ISRAM0_DCR_BASE+0x00)  /* SRAM bank config 0*/
+#define isram0_bear    (ISRAM0_DCR_BASE+0x04)  /* SRAM bus error addr reg */
+#define isram0_besr0   (ISRAM0_DCR_BASE+0x05)  /* SRAM bus error status reg 0 */
+#define isram0_besr1   (ISRAM0_DCR_BASE+0x06)  /* SRAM bus error status reg 1 */
+#define isram0_pmeg    (ISRAM0_DCR_BASE+0x07)  /* SRAM power management */
+#define isram0_cid     (ISRAM0_DCR_BASE+0x08)  /* SRAM bus core id reg */
+#define isram0_revid   (ISRAM0_DCR_BASE+0x09)  /* SRAM bus revision id reg */
+#define isram0_dpc     (ISRAM0_DCR_BASE+0x0a)  /* SRAM data parity check reg */
 
 #else
 
 #define uic1vr (UIC1_DCR_BASE+0x7)   /* UIC1 vector                       */
 #define uic1vcr (UIC1_DCR_BASE+0x8)   /* UIC1 vector configuration        */
 
-#if defined(CONFIG_440SPE)
+#if defined(CONFIG_440SPE) || defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 #define UIC2_DCR_BASE 0xe0
 #define uic2sr (UIC0_DCR_BASE+0x0)   /* UIC2 status-Read Clear         */
 #define uic2srs        (UIC0_DCR_BASE+0x1)   /* UIC2 status-Read Set */
 #define UIC_EIR6       0x00000004      /* External interrupt 6             */
 #define UIC_UIC1NC     0x00000002      /* UIC1 non-critical interrupt      */
 #define UIC_UIC1C      0x00000001      /* UIC1 critical interrupt          */
+
+#elif defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
+
+#define UIC_U0        0x80000000  /* UART 0                             */
+#define UIC_U1        0x40000000  /* UART 1                             */
+#define UIC_IIC0      0x20000000  /* IIC                                */
+#define UIC_KRD       0x10000000  /* Kasumi Ready for data              */
+#define UIC_KDA       0x08000000  /* Kasumi Data Available              */
+#define UIC_PCRW      0x04000000  /* PCI command register write         */
+#define UIC_PPM       0x02000000  /* PCI power management               */
+#define UIC_IIC1      0x01000000  /* IIC                                */
+#define UIC_SPI       0x00800000  /* SPI                                */
+#define UIC_EPCISER   0x00400000  /* External PCI SERR                  */
+#define UIC_MTE       0x00200000  /* MAL TXEOB                          */
+#define UIC_MRE       0x00100000  /* MAL RXEOB                          */
+#define UIC_D0        0x00080000  /* DMA channel 0                      */
+#define UIC_D1        0x00040000  /* DMA channel 1                      */
+#define UIC_D2        0x00020000  /* DMA channel 2                      */
+#define UIC_D3        0x00010000  /* DMA channel 3                      */
+#define UIC_UD0       0x00008000  /* UDMA irq 0                         */
+#define UIC_UD1       0x00004000  /* UDMA irq 1                         */
+#define UIC_UD2       0x00002000  /* UDMA irq 2                         */
+#define UIC_UD3       0x00001000  /* UDMA irq 3                         */
+#define UIC_HSB2D     0x00000800  /* USB2.0 Device                      */
+#define UIC_OHCI1     0x00000400  /* USB2.0 Host OHCI irq 1             */
+#define UIC_OHCI2     0x00000200  /* USB2.0 Host OHCI irq 2             */
+#define UIC_EIP94     0x00000100  /* Security EIP94                     */
+#define UIC_ETH0      0x00000080  /* Emac 0                             */
+#define UIC_ETH1      0x00000040  /* Emac 1                             */
+#define UIC_EHCI      0x00000020  /* USB2.0 Host EHCI                   */
+#define UIC_EIR4      0x00000010  /* External interrupt 4               */
+#define UIC_UIC2NC    0x00000008  /* UIC2 non-critical interrupt        */
+#define UIC_UIC2C     0x00000004  /* UIC2 critical interrupt            */
+#define UIC_UIC1NC    0x00000002  /* UIC1 non-critical interrupt        */
+#define UIC_UIC1C     0x00000001  /* UIC1 critical interrupt            */
+
+/* For compatibility with 405 code */
+#define UIC_MAL_TXEOB  UIC_MTE
+#define UIC_MAL_RXEOB  UIC_MRE
+
 #elif !defined(CONFIG_440SPE)
 #define UIC_U0         0x80000000      /* UART 0                           */
 #define UIC_U1         0x40000000      /* UART 1                           */
 #define UIC_EWU0       0x00000004      /* Ethernet 0 wakeup                */
 #define UIC_ETH1       0x00000002      /* Ethernet 1                       */
 #define UIC_EWU1       0x00000001      /* Ethernet 1 wakeup                */
+
+#elif defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
+
+#define UIC_MS        0x80000000  /* MAL SERR                           */
+#define UIC_MTDE      0x40000000  /* MAL TXDE                           */
+#define UIC_MRDE      0x20000000  /* MAL RXDE                           */
+#define UIC_U2        0x10000000  /* UART 2                             */
+#define UIC_U3        0x08000000  /* UART 3                             */
+#define UIC_EBCO      0x04000000  /* EBCO interrupt status              */
+#define UIC_NDFC      0x02000000  /* NDFC                               */
+#define UIC_KSLE      0x01000000  /* KASUMI slave error                 */
+#define UIC_CT5       0x00800000  /* GPT compare timer 5                */
+#define UIC_CT6       0x00400000  /* GPT compare timer 6                */
+#define UIC_PLB34I0   0x00200000  /* PLB3X4X MIRQ0                      */
+#define UIC_PLB34I1   0x00100000  /* PLB3X4X MIRQ1                      */
+#define UIC_PLB34I2   0x00080000  /* PLB3X4X MIRQ2                      */
+#define UIC_PLB34I3   0x00040000  /* PLB3X4X MIRQ3                      */
+#define UIC_PLB34I4   0x00020000  /* PLB3X4X MIRQ4                      */
+#define UIC_PLB34I5   0x00010000  /* PLB3X4X MIRQ5                      */
+#define UIC_CT0       0x00008000  /* GPT compare timer 0                */
+#define UIC_CT1       0x00004000  /* GPT compare timer 1                */
+#define UIC_EIR7      0x00002000  /* External interrupt 7               */
+#define UIC_EIR8      0x00001000  /* External interrupt 8               */
+#define UIC_EIR9      0x00000800  /* External interrupt 9               */
+#define UIC_CT2       0x00000400  /* GPT compare timer 2                */
+#define UIC_CT3       0x00000200  /* GPT compare timer 3                */
+#define UIC_CT4       0x00000100  /* GPT compare timer 4                */
+#define UIC_SRE       0x00000080  /* Serial ROM error                   */
+#define UIC_GPTDC     0x00000040  /* GPT decrementer pulse              */
+#define UIC_RSVD0     0x00000020  /* Reserved                           */
+#define UIC_EPCIPER   0x00000010  /* External PCI PERR                  */
+#define UIC_EIR0      0x00000008  /* External interrupt 0               */
+#define UIC_EWU0      0x00000004  /* Ethernet 0 wakeup                  */
+#define UIC_EIR1      0x00000002  /* External interrupt 1               */
+#define UIC_EWU1      0x00000001  /* Ethernet 1 wakeup                  */
+
+/* For compatibility with 405 code */
+#define UIC_MAL_SERR   UIC_MS
+#define UIC_MAL_TXDE   UIC_MTDE
+#define UIC_MAL_RXDE   UIC_MRDE
+#define UIC_ENET       UIC_ETH0
+
 #elif !defined(CONFIG_440SPE)
 #define UIC_MS         0x80000000      /* MAL SERR                         */
 #define UIC_MTDE       0x40000000      /* MAL TXDE                         */
 #define UIC_RSVD29     0x00000004      /* Reserved                         */
 #define UIC_RSVD30     0x00000002      /* Reserved                         */
 #define UIC_RSVD31     0x00000001      /* Reserved                         */
+
+#elif defined(CONFIG_440EPX) || defined(CONFIG_440GRX) /* UIC2 */
+
+#define UIC_EIR5    0x80000000  /* External interrupt 5                 */
+#define UIC_EIR6    0x40000000  /* External interrupt 6                 */
+#define UIC_OPB     0x20000000  /* OPB to PLB bridge interrupt stat     */
+#define UIC_EIR2    0x10000000  /* External interrupt 2                 */
+#define UIC_EIR3    0x08000000  /* External interrupt 3                 */
+#define UIC_DDR2    0x04000000  /* DDR2 sdram                           */
+#define UIC_MCTX0   0x02000000  /* MAl intp coalescence TX0             */
+#define UIC_MCTX1   0x01000000  /* MAl intp coalescence TX1             */
+#define UIC_MCTR0   0x00800000  /* MAl intp coalescence TR0             */
+#define UIC_MCTR1   0x00400000  /* MAl intp coalescence TR1             */
+
 #endif /* CONFIG_440GX */
 
 /*---------------------------------------------------------------------------+
 
 #define UICB0_ALL              (UICB0_UIC0CI | UICB0_UIC0NCI | UICB0_UIC1CI | \
                                                 UICB0_UIC1NCI | UICB0_UIC2CI | UICB0_UIC2NCI)
+
+#elif defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
+
+#define UICB0_UIC1CI   0x00000000      /* UIC1 Critical Interrupt          */
+#define UICB0_UIC1NCI  0x00000000      /* UIC1 Noncritical Interrupt       */
+#define UICB0_UIC2CI   0x00000000      /* UIC2 Critical Interrupt          */
+#define UICB0_UIC2NCI  0x00000000      /* UIC2 Noncritical Interrupt       */
+
+#define UICB0_ALL              (UICB0_UIC1CI | UICB0_UIC1NCI | \
+                                                UICB0_UIC1CI | UICB0_UIC2NCI)
+
 #endif /* CONFIG_440GX */
 /*---------------------------------------------------------------------------+
 |  Universal interrupt controller interrupts
 #define SDR0_SDSTP1_PAE_MASK           (0x80000000 >> 13)
 #define SDR0_SDSTP1_PISE_MASK          (0x80000000 >> 15)
 #endif /* defined(CONFIG_440GX) || defined(CONFIG_440SP) */
-#if defined(CONFIG_440EP) || defined(CONFIG_440GR)
+#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 #define SDR0_SDSTP1_PAE_MASK           (0x80000000 >> 21)
 #define SDR0_SDSTP1_PAME_MASK          (0x80000000 >> 27)
 #endif /* defined(CONFIG_440EP) || defined(CONFIG_440GR) */
 #define SDR0_MFR_ZMII_MODE_BIT1      0x01000000     /* ZMII Mode Bit1 */
 #define SDR0_MFR_ERRATA3_EN0         0x00800000
 #define SDR0_MFR_ERRATA3_EN1         0x00400000
+#if defined(CONFIG_440GX) /* test-only: only 440GX or 440SPE??? */
 #define SDR0_MFR_PKT_REJ_MASK        0x00300000   /* Pkt Rej. Enable Mask */
 #define SDR0_MFR_PKT_REJ_EN          0x00300000   /* Pkt Rej. Enable on both EMAC3 0-1 */
 #define SDR0_MFR_PKT_REJ_EN0         0x00200000   /* Pkt Rej. Enable on EMAC3(0) */
 #define SDR0_MFR_PKT_REJ_EN1         0x00100000   /* Pkt Rej. Enable on EMAC3(1) */
 #define SDR0_MFR_PKT_REJ_POL         0x00080000   /* Packet Reject Polarity      */
+#endif
+
+#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
+#define SDR0_PFC1_EPS_ENCODE(n)                ((((unsigned long)(n))&0x07)<<22)
+#define SDR0_PFC1_EPS_DECODE(n)                ((((unsigned long)(n))>>22)&0x07)
+#define SDR0_PFC2_EPS_ENCODE(n)                ((((unsigned long)(n))&0x07)<<29)
+#define SDR0_PFC2_EPS_DECODE(n)                ((((unsigned long)(n))>>29)&0x07)
+#endif
+
+#define SDR0_MFR_ECS_MASK              0x10000000
+#define SDR0_MFR_ECS_INTERNAL          0x10000000
+
+#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
+#define SDR0_SRST0        0x200
+#define SDR0_SRST0_BGO          0x80000000 /* PLB to OPB bridge */
+#define SDR0_SRST0_PLB4         0x40000000 /* PLB4 arbiter */
+#define SDR0_SRST0_EBC          0x20000000 /* External bus controller */
+#define SDR0_SRST0_OPB          0x10000000 /* OPB arbiter */
+#define SDR0_SRST0_UART0        0x08000000 /* Universal asynchronous receiver/transmitter 0 */
+#define SDR0_SRST0_UART1        0x04000000 /* Universal asynchronous receiver/transmitter 1 */
+#define SDR0_SRST0_IIC0         0x02000000 /* Inter integrated circuit 0 */
+#define SDR0_SRST0_USB2H        0x01000000 /* USB2.0 Host */
+#define SDR0_SRST0_GPIO         0x00800000 /* General purpose I/O */
+#define SDR0_SRST0_GPT          0x00400000 /* General purpose timer */
+#define SDR0_SRST0_DMC          0x00200000 /* DDR SDRAM memory controller */
+#define SDR0_SRST0_PCI          0x00100000 /* PCI */
+#define SDR0_SRST0_EMAC0        0x00080000 /* Ethernet media access controller 0 */
+#define SDR0_SRST0_EMAC1        0x00040000 /* Ethernet media access controller 1 */
+#define SDR0_SRST0_CPM0         0x00020000 /* Clock and power management */
+#define SDR0_SRST0_ZMII         0x00010000 /* ZMII bridge */
+#define SDR0_SRST0_UIC0         0x00008000 /* Universal interrupt controller 0 */
+#define SDR0_SRST0_UIC1         0x00004000 /* Universal interrupt controller 1 */
+#define SDR0_SRST0_IIC1         0x00002000 /* Inter integrated circuit 1 */
+#define SDR0_SRST0_SCP          0x00001000 /* Serial communications port */
+#define SDR0_SRST0_BGI          0x00000800 /* OPB to PLB bridge */
+#define SDR0_SRST0_DMA          0x00000400 /* Direct memory access controller */
+#define SDR0_SRST0_DMAC         0x00000200 /* DMA channel */
+#define SDR0_SRST0_MAL          0x00000100 /* Media access layer */
+#define SDR0_SRST0_USB2D        0x00000080 /* USB2.0 device */
+#define SDR0_SRST0_GPTR         0x00000040 /* General purpose timer */
+#define SDR0_SRST0_P4P3         0x00000010 /* PLB4 to PLB3 bridge */
+#define SDR0_SRST0_P3P4         0x00000008 /* PLB3 to PLB4 bridge */
+#define SDR0_SRST0_PLB3         0x00000004 /* PLB3 arbiter */
+#define SDR0_SRST0_UART2        0x00000002 /* Universal asynchronous receiver/transmitter 2 */
+#define SDR0_SRST0_UART3        0x00000001 /* Universal asynchronous receiver/transmitter 3 */
+
+#define SDR0_SRST1        0x201
+#define SDR0_SRST1_NDFC         0x80000000 /* Nand flash controller */
+#define SDR0_SRST1_OPBA1        0x40000000 /* OPB Arbiter attached to PLB4 */
+#define SDR0_SRST1_P4OPB0       0x20000000 /* PLB4 to OPB Bridge0 */
+#define SDR0_SRST1_PLB42OPB0    SDR0_SRST1_P4OPB0
+#define SDR0_SRST1_DMA4         0x10000000 /* DMA to PLB4 */
+#define SDR0_SRST1_DMA4CH       0x08000000 /* DMA Channel to PLB4 */
+#define SDR0_SRST1_OPBA2        0x04000000 /* OPB Arbiter attached to PLB4 USB 2.0 Host */
+#define SDR0_SRST1_OPB2PLB40    0x02000000 /* OPB to PLB4 Bridge attached to USB 2.0 Host */
+#define SDR0_SRST1_PLB42OPB1    0x01000000 /* PLB4 to OPB Bridge attached to USB 2.0 Host */
+#define SDR0_SRST1_CPM1         0x00800000 /* Clock and Power management 1 */
+#define SDR0_SRST1_UIC2         0x00400000 /* Universal Interrupt Controller 2 */
+#define SDR0_SRST1_CRYP0        0x00200000 /* Security Engine */
+#define SDR0_SRST1_USB20PHY     0x00100000 /* USB 2.0 Phy */
+#define SDR0_SRST1_USB2HUTMI    0x00080000 /* USB 2.0 Host UTMI Interface */
+#define SDR0_SRST1_USB2HPHY     0x00040000 /* USB 2.0 Host Phy Interface */
+#define SDR0_SRST1_SRAM0        0x00020000 /* Internal SRAM Controller */
+#define SDR0_SRST1_RGMII0       0x00010000 /* RGMII Bridge */
+#define SDR0_SRST1_ETHPLL       0x00008000 /* Ethernet PLL */
+#define SDR0_SRST1_FPU          0x00004000 /* Floating Point Unit */
+#define SDR0_SRST1_KASU0        0x00002000 /* Kasumi Engine */
+
+#else
 
 #define SDR0_SRST_BGO                  0x80000000
 #define SDR0_SRST_PLB                  0x40000000
 #define SDR0_SRST_EMAC3                        0x00000008
 #define SDR0_SRST_RGMII                        0x00000001
 
+#endif
+
 /*-----------------------------------------------------------------------------+
 |  Clocking
 +-----------------------------------------------------------------------------*/
-#if !defined (CONFIG_440GX) && !defined(CONFIG_440EP) && !defined(CONFIG_440GR) && !defined(CONFIG_440SP) && !defined(CONFIG_440SPE)
+#if !defined (CONFIG_440GX) && \
+    !defined(CONFIG_440EP) && !defined(CONFIG_440GR) && \
+    !defined(CONFIG_440EPX) && !defined(CONFIG_440GRX) && \
+    !defined(CONFIG_440SP) && !defined(CONFIG_440SPE)
 #define PLLSYS0_TUNE_MASK      0xffc00000      /* PLL TUNE bits            */
 #define PLLSYS0_FB_DIV_MASK    0x003c0000      /* Feedback divisor         */
 #define PLLSYS0_FWD_DIV_A_MASK 0x00038000      /* Forward divisor A        */
 #define PLLSYS1_NTO1_MASK      0x00000001      /* CPU:PLB N-to-1 ratio */
 #endif /* CONFIG_440GX */
 
+#if defined (CONFIG_440EPX) || defined (CONFIG_440GRX)
+/*--------------------------------------*/
+#define CPR0_PLLC                   0x40
+#define   CPR0_PLLC_RST_MASK           0x80000000
+#define   CPR0_PLLC_RST_PLLLOCKED      0x00000000
+#define   CPR0_PLLC_RST_PLLRESET       0x80000000
+#define   CPR0_PLLC_ENG_MASK           0x40000000
+#define   CPR0_PLLC_ENG_DISABLE        0x00000000
+#define   CPR0_PLLC_ENG_ENABLE         0x40000000
+#define   CPR0_PLLC_ENG_ENCODE(n)      ((((unsigned long)(n))&0x01)<<30)
+#define   CPR0_PLLC_ENG_DECODE(n)      ((((unsigned long)(n))>>30)&0x01)
+#define   CPR0_PLLC_SRC_MASK           0x20000000
+#define   CPR0_PLLC_SRC_PLLOUTA        0x00000000
+#define   CPR0_PLLC_SRC_PLLOUTB        0x20000000
+#define   CPR0_PLLC_SRC_ENCODE(n)      ((((unsigned long)(n))&0x01)<<29)
+#define   CPR0_PLLC_SRC_DECODE(n)      ((((unsigned long)(n))>>29)&0x01)
+#define   CPR0_PLLC_SEL_MASK           0x07000000
+#define   CPR0_PLLC_SEL_PLL            0x00000000
+#define   CPR0_PLLC_SEL_CPU            0x01000000
+#define   CPR0_PLLC_SEL_PER            0x05000000
+#define   CPR0_PLLC_SEL_ENCODE(n)      ((((unsigned long)(n))&0x07)<<24)
+#define   CPR0_PLLC_SEL_DECODE(n)      ((((unsigned long)(n))>>24)&0x07)
+#define   CPR0_PLLC_TUNE_MASK          0x000003FF
+#define   CPR0_PLLC_TUNE_ENCODE(n)     ((((unsigned long)(n))&0x3FF)<<0)
+#define   CPR0_PLLC_TUNE_DECODE(n)     ((((unsigned long)(n))>>0)&0x3FF)
+/*--------------------------------------*/
+#define CPR0_PLLD                   0x60
+#define   CPR0_PLLD_FBDV_MASK          0x1F000000
+#define   CPR0_PLLD_FBDV_ENCODE(n)     ((((unsigned long)(n))&0x1F)<<24)
+#define   CPR0_PLLD_FBDV_DECODE(n)     ((((((unsigned long)(n))>>24)-1)&0x1F)+1)
+#define   CPR0_PLLD_FWDVA_MASK         0x000F0000
+#define   CPR0_PLLD_FWDVA_ENCODE(n)    ((((unsigned long)(n))&0x0F)<<16)
+#define   CPR0_PLLD_FWDVA_DECODE(n)    ((((((unsigned long)(n))>>16)-1)&0x0F)+1)
+#define   CPR0_PLLD_FWDVB_MASK         0x00000700
+#define   CPR0_PLLD_FWDVB_ENCODE(n)    ((((unsigned long)(n))&0x07)<<8)
+#define   CPR0_PLLD_FWDVB_DECODE(n)    ((((((unsigned long)(n))>>8)-1)&0x07)+1)
+#define   CPR0_PLLD_LFBDV_MASK         0x0000003F
+#define   CPR0_PLLD_LFBDV_ENCODE(n)    ((((unsigned long)(n))&0x3F)<<0)
+#define   CPR0_PLLD_LFBDV_DECODE(n)    ((((((unsigned long)(n))>>0)-1)&0x3F)+1)
+/*--------------------------------------*/
+#define CPR0_PRIMAD                 0x80
+#define   CPR0_PRIMAD_PRADV0_MASK      0x07000000
+#define   CPR0_PRIMAD_PRADV0_ENCODE(n) ((((unsigned long)(n))&0x07)<<24)
+#define   CPR0_PRIMAD_PRADV0_DECODE(n) ((((((unsigned long)(n))>>24)-1)&0x07)+1)
+/*--------------------------------------*/
+#define CPR0_PRIMBD                 0xA0
+#define   CPR0_PRIMBD_PRBDV0_MASK      0x07000000
+#define   CPR0_PRIMBD_PRBDV0_ENCODE(n) ((((unsigned long)(n))&0x07)<<24)
+#define   CPR0_PRIMBD_PRBDV0_DECODE(n) ((((((unsigned long)(n))>>24)-1)&0x07)+1)
+/*--------------------------------------*/
+#if 0
+#define CPR0_CPM0_ER                0xB0    /* CPM Enable Register */
+#define CPR0_CPM0_FR                0xB1    /* CPM Force Register */
+#define CPR0_CPM0_SR                0xB2    /* CPM Status Register */
+#define CPR0_CPM0_IIC0               0x80000000    /* Inter-Intergrated Circuit0 */
+#define CPR0_CPM0_IIC1               0x40000000    /* Inter-Intergrated Circuit1 */
+#define CPR0_CPM0_PCI                0x20000000    /* Peripheral Component Interconnect */
+#define CPR0_CPM0_USB1H              0x08000000    /* USB1.1 Host */
+#define CPR0_CPM0_FPU                0x04000000    /* PPC440 FPU */
+#define CPR0_CPM0_CPU                0x02000000    /* PPC440x5 Processor Core */
+#define CPR0_CPM0_DMA                0x01000000    /* Direct Memory Access Controller */
+#define CPR0_CPM0_BGO                0x00800000    /* PLB to OPB Bridge */
+#define CPR0_CPM0_BGI                0x00400000    /* OPB to PLB Bridge */
+#define CPR0_CPM0_EBC                0x00200000    /* External Bus Controller */
+#define CPR0_CPM0_NDFC               0x00100000    /* Nand Flash Controller */
+#define CPR0_CPM0_MADMAL             0x00080000    /* DDR SDRAM Controller or MADMAL ??? */
+#define CPR0_CPM0_DMC                0x00080000    /* DDR SDRAM Controller or MADMAL ??? */
+#define CPR0_CPM0_PLB4               0x00040000    /* PLB4 Arbiter */
+#define CPR0_CPM0_PLB4x3x            0x00020000    /* PLB4 to PLB3 */
+#define CPR0_CPM0_PLB3x4x            0x00010000    /* PLB3 to PLB4 */
+#define CPR0_CPM0_PLB3               0x00008000    /* PLB3 Arbiter */
+#define CPR0_CPM0_PPM                0x00002000    /* PLB Performance Monitor */
+#define CPR0_CPM0_UIC1               0x00001000    /* Universal Interrupt Controller 1 */
+#define CPR0_CPM0_GPIO               0x00000800    /* General Purpose IO */
+#define CPR0_CPM0_GPT                0x00000400    /* General Purpose Timer */
+#define CPR0_CPM0_UART0              0x00000200    /* Universal Asynchronous Rcver/Xmitter 0 */
+#define CPR0_CPM0_UART1              0x00000100    /* Universal Asynchronous Rcver/Xmitter 1 */
+#define CPR0_CPM0_UIC0               0x00000080    /* Universal Interrupt Controller 0 */
+#define CPR0_CPM0_TMRCLK             0x00000040    /* CPU Timer */
+#define CPR0_CPM0_EMC0               0x00000020    /* Ethernet 0 */
+#define CPR0_CPM0_EMC1               0x00000010    /* Ethernet 1 */
+#define CPR0_CPM0_UART2              0x00000008    /* Universal Asynchronous Rcver/Xmitter 2 */
+#define CPR0_CPM0_UART3              0x00000004    /* Universal Asynchronous Rcver/Xmitter 3 */
+#define CPR0_CPM0_USB2D              0x00000002    /* USB2.0 Device */
+#define CPR0_CPM0_USB2H              0x00000001    /* USB2.0 Host */
+#endif
+/*--------------------------------------*/
+#define CPR0_OPBD                   0xC0
+#define   CPR0_OPBD_OPBDV0_MASK        0x03000000
+#define   CPR0_OPBD_OPBDV0_ENCODE(n)   ((((unsigned long)(n))&0x03)<<24)
+#define   CPR0_OPBD_OPBDV0_DECODE(n)   ((((((unsigned long)(n))>>24)-1)&0x03)+1)
+/*--------------------------------------*/
+#define CPR0_PERD                   0xE0
+#define   CPR0_PERD_PERDV0_MASK        0x07000000
+#define   CPR0_PERD_PERDV0_ENCODE(n)   ((((unsigned long)(n))&0x07)<<24)
+#define   CPR0_PERD_PERDV0_DECODE(n)   ((((((unsigned long)(n))>>24)-1)&0x07)+1)
+/*--------------------------------------*/
+#define CPR0_MALD                  0x100
+#define   CPR0_MALD_MALDV0_MASK        0x03000000
+#define   CPR0_MALD_MALDV0_ENCODE(n)   ((((unsigned long)(n))&0x03)<<24)
+#define   CPR0_MALD_MALDV0_DECODE(n)   ((((((unsigned long)(n))>>24)-1)&0x03)+1)
+/*--------------------------------------*/
+#define CPR0_SPCID                 0x120
+#define   CPR0_SPCID_SPCIDV0_MASK      0x03000000
+#define   CPR0_SPCID_SPCIDV0_ENCODE(n) ((((unsigned long)(n))&0x03)<<24)
+#define   CPR0_SPCID_SPCIDV0_DECODE(n) ((((((unsigned long)(n))>>24)-1)&0x03)+1)
+/*--------------------------------------*/
+#define CPR0_ICFG                  0x140
+#define   CPR0_ICFG_RLI_MASK           0x80000000
+#define   CPR0_ICFG_RLI_RESETCPR       0x00000000
+#define   CPR0_ICFG_RLI_PRESERVECPR    0x80000000
+#define   CPR0_ICFG_ICS_MASK           0x00000007
+#endif /* defined (CONFIG_440EPX) || defined (CONFIG_440GRX) */
+
 /*-----------------------------------------------------------------------------
 | IIC Register Offsets
 '----------------------------------------------------------------------------*/
 #define PCIX0_CFGBASE          (CFG_PCI_BASE + 0x0ec80000)
 #define PCIX0_IOBASE           (CFG_PCI_BASE + 0x08000000)
 
-#if defined(CONFIG_440EP) || defined(CONFIG_440GR)
+#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 
 /* PCI Local Configuration Registers
    --------------------------------- */
 
 #endif /* !defined(CONFIG_440EP) !defined(CONFIG_440GR) */
 
+#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
+
+/* USB2.0 Device */
+#define USB2D0_BASE         CFG_USB2D0_BASE
+
+#define USB2D0_INTRIN       (USB2D0_BASE + 0x00000000)
+
+#define USB2D0_INTRIN       (USB2D0_BASE + 0x00000000) /* Interrupt register for Endpoint 0 plus IN Endpoints 1 to 3 */
+#define USB2D0_POWER        (USB2D0_BASE + 0x00000000) /* Power management register */
+#define USB2D0_FADDR        (USB2D0_BASE + 0x00000000) /* Function address register */
+#define USB2D0_INTRINE      (USB2D0_BASE + 0x00000000) /* Interrupt enable register for USB2D0_INTRIN */
+#define USB2D0_INTROUT      (USB2D0_BASE + 0x00000000) /* Interrupt register for OUT Endpoints 1 to 3 */
+#define USB2D0_INTRUSBE     (USB2D0_BASE + 0x00000000) /* Interrupt enable register for USB2D0_INTRUSB */
+#define USB2D0_INTRUSB      (USB2D0_BASE + 0x00000000) /* Interrupt register for common USB interrupts */
+#define USB2D0_INTROUTE     (USB2D0_BASE + 0x00000000) /* Interrupt enable register for IntrOut */
+#define USB2D0_TSTMODE      (USB2D0_BASE + 0x00000000) /* Enables the USB 2.0 test modes */
+#define USB2D0_INDEX        (USB2D0_BASE + 0x00000000) /* Index register for selecting the Endpoint status/control registers */
+#define USB2D0_FRAME        (USB2D0_BASE + 0x00000000) /* Frame number */
+#define USB2D0_INCSR0       (USB2D0_BASE + 0x00000000) /* Control Status register for Endpoint 0. (Index register set to select Endpoint 0) */
+#define USB2D0_INCSR        (USB2D0_BASE + 0x00000000) /* Control Status register for IN Endpoint. (Index register set to select Endpoints 13) */
+#define USB2D0_INMAXP       (USB2D0_BASE + 0x00000000) /* Maximum packet size for IN Endpoint. (Index register set to select Endpoints 13) */
+#define USB2D0_OUTCSR       (USB2D0_BASE + 0x00000000) /* Control Status register for OUT Endpoint. (Index register set to select Endpoints 13) */
+#define USB2D0_OUTMAXP      (USB2D0_BASE + 0x00000000) /* Maximum packet size for OUT Endpoint. (Index register set to select Endpoints 13) */
+#define USB2D0_OUTCOUNT0    (USB2D0_BASE + 0x00000000) /* Number of received bytes in Endpoint 0 FIFO. (Index register set to select Endpoint 0) */
+#define USB2D0_OUTCOUNT     (USB2D0_BASE + 0x00000000) /* Number of bytes in OUT Endpoint FIFO. (Index register set to select Endpoints 13) */
+#endif
+
 /******************************************************************************
  * GPIO macro register defines
  ******************************************************************************/
 #define GPIO0_IR               (GPIO0_BASE+0x1C)
 #endif /* CONFIG_440GP */
 
-#if defined(CONFIG_440EP) || defined(CONFIG_440GR)
+#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 #define GPIO0_BASE             (CFG_PERIPHERAL_BASE+0x00000B00)
 #define GPIO1_BASE             (CFG_PERIPHERAL_BASE+0x00000C00)
 
index ec2e3629bb894c55ac31ac30fa65be0baed165fc..43c5ca451e09fb81cbd2ad64430f755845bc5a9a 100644 (file)
@@ -145,12 +145,14 @@ typedef struct emac_4xx_hw_st {
 #define EMAC_STACR_OC_MASK     (0x00000000)
 #endif
 
-#if defined(CONFIG_440SP) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 #define SDR0_PFC1_EM_1000      (0x00200000)
 #endif
 
 /*ZMII Bridge Register addresses */
-#if defined(CONFIG_440EP) || defined(CONFIG_440GR)
+#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 #define ZMII_BASE                      (CFG_PERIPHERAL_BASE + 0x0D00)
 #else
 #define ZMII_BASE                      (CFG_PERIPHERAL_BASE + 0x0780)
@@ -163,6 +165,7 @@ typedef struct emac_4xx_hw_st {
 #define ZMII_MDI0                      0x80000000
 
 /* ZMII FER Register Bit Definitions */
+#define ZMII_FER_DIS           (0x0)
 #define ZMII_FER_MDI           (0x8)
 #define ZMII_FER_SMII          (0x4)
 #define ZMII_FER_RMII          (0x2)
@@ -197,7 +200,11 @@ typedef struct emac_4xx_hw_st {
 #define ZMII_SMIISR_V(__x)     ((3 - __x) * 8)
 
 /* RGMII Register Addresses */
+#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
+#define RGMII_BASE             (CFG_PERIPHERAL_BASE + 0x1000)
+#else
 #define RGMII_BASE             (CFG_PERIPHERAL_BASE + 0x0790)
+#endif
 #define RGMII_FER              (RGMII_BASE + 0x00)
 #define RGMII_SSR              (RGMII_BASE + 0x04)
 
@@ -216,7 +223,11 @@ typedef struct emac_4xx_hw_st {
 #define RGMII_SSR_SP_100MBPS   (0x02)
 #define RGMII_SSR_SP_1000MBPS  (0x04)
 
+#if defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
+#define RGMII_SSR_V(__x)       ((__x) * 8)
+#else
 #define RGMII_SSR_V(__x)       ((__x -2) * 8)
+#endif
 
 
 /*---------------------------------------------------------------------------+
@@ -286,7 +297,8 @@ typedef struct emac_4xx_hw_st {
 
 /* Ethernet MAC Regsiter Addresses */
 #if defined(CONFIG_440)
-#if defined(CONFIG_440EP) || defined(CONFIG_440GR)
+#if defined(CONFIG_440EP) || defined(CONFIG_440GR) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX)
 #define EMAC_BASE                          (CFG_PERIPHERAL_BASE + 0x0E00)
 #else
 #define EMAC_BASE                          (CFG_PERIPHERAL_BASE + 0x0800)
@@ -332,7 +344,9 @@ typedef struct emac_4xx_hw_st {
 #define EMAC_M0_WKE                        (0x04000000)
 
 /* on 440GX EMAC_MR1 has a different layout! */
-#if defined(CONFIG_440GX) || defined(CONFIG_440SP) || defined(CONFIG_440SPE)
+#if defined(CONFIG_440GX) || \
+    defined(CONFIG_440EPX) || defined(CONFIG_440GRX) || \
+    defined(CONFIG_440SP) || defined(CONFIG_440SPE)
 /* MODE Reg 1 */
 #define EMAC_M1_FDE            (0x80000000)
 #define EMAC_M1_ILE            (0x40000000)
index 72d690ef0f841473cab652d6474cf78132c9c641..3e47e82abadf31b8defee302c3340cf354263f20 100644 (file)
@@ -312,7 +312,7 @@ label:                                                  \
        lwz     r3,GOT(transfer_to_handler);            \
        mtlr    r3;                                     \
        addi    r3,r1,STACK_FRAME_OVERHEAD;             \
-       li      r20,MSR_KERNEL;                         \
+       li      r20,(MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)); \
        rlwimi  r20,r23,0,25,25;                        \
        blrl    ;                                       \
 .L_ ## label :                                          \
index 8c7b1c26c13ba03684e5dbd214267dcbc7508e3d..48800595d7816bed37ad1685bf081d87f58f842a 100644 (file)
@@ -26,6 +26,13 @@ extern struct serial_device * default_serial_console (void);
    || defined(CONFIG_405EP) || defined(CONFIG_MPC5xxx)
 extern struct serial_device serial0_device;
 extern struct serial_device serial1_device;
+#if defined(CFG_NS16550_SERIAL)
+extern struct serial_device eserial1_device;
+extern struct serial_device eserial2_device;
+extern struct serial_device eserial3_device;
+extern struct serial_device eserial4_device;
+#endif /* CFG_NS16550_SERIAL */
+
 #endif
 
 
index e56e06b1b3a3171a5c88a93c14e774b9660228bc..3e0a5c7fe5445d7cec7567c40eba820548b02230 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2002
+# (C) Copyright 2002-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(ARCH).a
+LIB    = $(obj)lib$(ARCH).a
 
-AOBJS  = _ashldi3.o _ashrdi3.o _divsi3.o _modsi3.o _udivsi3.o _umodsi3.o
+SOBJS  = _ashldi3.o _ashrdi3.o _divsi3.o _modsi3.o _udivsi3.o _umodsi3.o
 
 COBJS  = armlinux.o board.o \
          cache.o div0.o
 
-OBJS   = $(AOBJS) $(COBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
 
-$(LIB):        .depend $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index bc280d01f86d6e3ffa5842aa9298cabfcfe0c3fb..549c8c1033577421eed2f3965198cabe1bd218d4 100644 (file)
@@ -3,7 +3,7 @@
 #
 # Copyright (c) 2005 blackfin.uclinux.org
 #
-# (C) Copyright 2000-2004
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(ARCH).a
+LIB    = $(obj)lib$(ARCH).a
 
-AOBJS  =
+SOBJS  =
 
 COBJS  = board.o bf533_linux.o bf533_string.o cache.o muldi3.o
-OBJS   = $(AOBJS) $(COBJS)
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 18c41b1bd9e7fa70e08e0c03f840cf2d67f9ad6f..fcd43c676f7b3c80aeea29efc51e7082e44000fa 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2002
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = libgeneric.a
+LIB    = $(obj)libgeneric.a
 
-OBJS   = bzlib.o bzlib_crctable.o bzlib_decompress.o \
+COBJS  = bzlib.o bzlib_crctable.o bzlib_decompress.o \
          bzlib_randtable.o bzlib_huffman.o \
          crc32.o ctype.o display_options.o ldiv.o \
          string.o vsprintf.o zlib.o
+         
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
 
-$(LIB):        .depend $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index e5925e5542d7597a502c948569f979a2ddff3dbb..8dc809e1e24fdae7082c81813348b884352870e8 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2002
+# (C) Copyright 2002-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(ARCH).a
+LIB    = $(obj)lib$(ARCH).a
 
-AOBJS  = bios.o bios_pci.o realmode_switch.o
+SOBJS  = bios.o bios_pci.o realmode_switch.o
 
 COBJS  = board.o bios_setup.o i386_linux.o zimage.o realmode.o \
          pci_type1.o pci.o video_bios.o video.o
 
-OBJS   = $(AOBJS) $(COBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
 
-$(LIB):        .depend $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 698da36e683f880a78c5630a1de092a615cbdd95..f9e83988c194790dd3a4b548cc4d5eeb681d979a 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(ARCH).a
+LIB    = $(obj)lib$(ARCH).a
+
+SOBJS  =
 
-AOBJS  =
 COBJS  = cache.o traps.o time.o board.o m68k_linux.o
-OBJS   = $(AOBJS) $(COBJS)
 
-$(LIB):        .depend $(OBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index ec01722f8715a0b131c1820299b1328b67d5c233..35de97fe16245bc3e30edf229ede0b994dd10f77 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003-2004
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(ARCH).a
+LIB    = $(obj)lib$(ARCH).a
 
-AOBJS  =
+SOBJS  =
 
 COBJS  = board.o microblaze_linux.o time.o cache.o
 
-OBJS   = $(AOBJS) $(COBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
 
-$(LIB):        .depend $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index d5980e6dcd8d9150559772f08405ded44f7af5aa..e2ac99914119214e0fb7d6b23dacc946505d9917 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(ARCH).a
+LIB    = $(obj)lib$(ARCH).a
 
-AOBJS  =
+SOBJS  =
 
 COBJS  = board.o time.o mips_linux.o
 
-OBJS   = $(AOBJS) $(COBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
 
-$(LIB):        .depend $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index eff46db819493d2b186003b9b068252082acc485..ad4c6c4650123e9796bd7cbd873cf9b089da2ae9 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(ARCH).a
+LIB    = $(obj)lib$(ARCH).a
 
-AOBJS  =
+SOBJS  =
 
 COBJS  = board.o cache.o divmod.o nios_linux.o mult.o time.o
 
-OBJS   = $(AOBJS) $(COBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
 
-$(LIB):        .depend $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 44b893c9ae601cce3ad2b7115aa1e5294e48709e..1c2ac72d6acbb868f9af34a64a8075ea6922bafb 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(ARCH).a
+LIB    = $(obj)lib$(ARCH).a
 
-AOBJS  = cache.o
+SOBJS  = cache.o
 
 COBJS  = board.o divmod.o nios_linux.o mult.o time.o
 
-OBJS   = $(AOBJS) $(COBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
 
-$(LIB):        .depend $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 652a4199ec5172a05544a1d0b200c79d9526f1d7..bae8cbc20b7086dbd3af15b6c4f1c3c62c0346a2 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(ARCH).a
+LIB    = $(obj)lib$(ARCH).a
 
-AOBJS  = ppcstring.o ticks.o
+SOBJS  = ppcstring.o ticks.o
 
 COBJS  = board.o \
          bat_rw.o cache.o extable.o kgdb.o time.o interrupts.o
 
-OBJS   = $(AOBJS) $(COBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
 
-$(LIB):        .depend $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 71dae07d33254c60b2df4a68b9a922726d92d581..46cea985e5d05fef35c5e2351d6b66017cc9936e 100644 (file)
@@ -763,6 +763,12 @@ void board_init_r (gd_t *id, ulong dest_addr)
        spi_init_r ();
 #endif
 
+#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+       WATCHDOG_RESET ();
+       puts ("NAND:  ");
+       nand_init();            /* go init the NAND */
+#endif
+
        /* relocate environment function pointers etc. */
        env_relocate ();
 
@@ -963,12 +969,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
        doc_init ();
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
-       WATCHDOG_RESET ();
-       puts ("NAND:  ");
-       nand_init();            /* go init the NAND */
-#endif
-
 #if (CONFIG_COMMANDS & CFG_CMD_NET)
 #if defined(CONFIG_NET_MULTI)
        WATCHDOG_RESET ();
index 4fe6e448bee49de675e1483092debe110ade7de2..c3e4cea8d9e90e798cb8a8d8cb2a6da889ae1e78 100755 (executable)
--- a/mkconfig
+++ b/mkconfig
@@ -5,7 +5,7 @@
 #
 # Parameters:  Target  Architecture  CPU  Board [VENDOR] [SOC]
 #
-# (C) 2002 DENX Software Engineering, Wolfgang Denk <wd@denx.de>
+# (C) 2002-2006 DENX Software Engineering, Wolfgang Denk <wd@denx.de>
 #
 
 APPEND=no      # Default: Create new config file
@@ -27,24 +27,38 @@ done
 
 echo "Configuring for ${BOARD_NAME} board..."
 
-cd ./include
-
 #
 # Create link to architecture specific headers
 #
-rm -f asm
-ln -s asm-$2 asm
+if [ "$SRCTREE" != "$OBJTREE" ] ; then
+       mkdir -p ${OBJTREE}/include
+       mkdir -p ${OBJTREE}/include2
+       cd ${OBJTREE}/include2
+       rm -f asm
+       ln -s ${SRCTREE}/include/asm-$2 asm
+       LNPREFIX="../../include2/asm/"
+       cd ../include
+       rm -rf asm-$2
+       rm -f asm
+       mkdir asm-$2
+       ln -s asm-$2 asm
+else
+       cd ./include
+       rm -f asm
+       ln -s asm-$2 asm
+fi
+
 rm -f asm-$2/arch
 
 if [ -z "$6" -o "$6" = "NULL" ] ; then
-       ln -s arch-$3 asm-$2/arch
+       ln -s ${LNPREFIX}arch-$3 asm-$2/arch
 else
-       ln -s arch-$6 asm-$2/arch
+       ln -s ${LNPREFIX}arch-$6 asm-$2/arch
 fi
 
 if [ "$2" = "arm" ] ; then
        rm -f asm-$2/proc
-       ln -s proc-armv asm-$2/proc
+       ln -s ${LNPREFIX}proc-armv asm-$2/proc
 fi
 
 #
diff --git a/nand_spl/board/amcc/sequoia/Makefile b/nand_spl/board/amcc/sequoia/Makefile
new file mode 100644 (file)
index 0000000..897aa8b
--- /dev/null
@@ -0,0 +1,83 @@
+#
+# (C) Copyright 2006
+# 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
+#
+
+include $(TOPDIR)/config.mk
+include board/$(BOARDDIR)/config.mk
+
+LDSCRIPT= board/$(BOARDDIR)/u-boot.lds
+LDFLAGS        = -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
+AFLAGS += -DCONFIG_NAND_SPL
+CFLAGS += -DCONFIG_NAND_SPL
+
+SOBJS  = start.o init.o resetvec.o
+COBJS  = nand_boot.o ndfc.o sdram.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+
+ALL    = u-boot-spl u-boot-spl.bin u-boot-spl-16k.bin
+
+all:   $(obj).depend $(ALL)
+
+u-boot-spl-16k.bin: u-boot-spl
+       $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
+
+u-boot-spl.bin:        u-boot-spl
+       $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+
+u-boot-spl:    $(OBJS)
+       $(LD) $(LDFLAGS) $$UNDEF_SYM $(OBJS) \
+               -Map u-boot-spl.map -o u-boot-spl
+
+# create symbolic links for common files
+
+# from cpu directory
+ndfc.c:
+       @rm -f ndfc.c
+       ln -s ../cpu/ppc4xx/ndfc.c ndfc.c
+
+resetvec.S:
+       @rm -f resetvec.S
+       ln -s ../cpu/ppc4xx/resetvec.S resetvec.S
+
+start.S:
+       @rm -f start.S
+       ln -s ../cpu/ppc4xx/start.S start.S
+
+# from board directory
+init.S:
+       @rm -f init.S
+       ln -s ../board/amcc/sequoia/init.S init.S
+
+sdram.c:
+       @rm -f sdram.c
+       ln -s ../board/amcc/sequoia/sdram.c sdram.c
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/nand_spl/board/amcc/sequoia/config.mk b/nand_spl/board/amcc/sequoia/config.mk
new file mode 100644 (file)
index 0000000..a29ba5f
--- /dev/null
@@ -0,0 +1,49 @@
+#
+# (C) Copyright 2006
+# 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
+#
+#
+# AMCC 440EPx Reference Platform (Sequoia) board
+#
+
+#
+# TEXT_BASE for SPL:
+#
+# On 440EP(x) platforms the SPL is located at 0xfffff000...0xffffffff,
+# in the last 4kBytes of memory space in cache.
+# We will copy this SPL into internal SRAM in start.S. So we set
+# TEXT_BASE to starting address in internal SRAM here.
+#
+TEXT_BASE = 0xE0013000
+
+# PAD_TO used to generate a 16kByte binary needed for the combined image
+# -> PAD_TO = TEXT_BASE + 0x4000
+PAD_TO = 0xE0017000
+
+PLATFORM_CPPFLAGS += -DCONFIG_440=1
+
+ifeq ($(debug),1)
+PLATFORM_CPPFLAGS += -DDEBUG
+endif
+
+ifeq ($(dbcr),1)
+PLATFORM_CPPFLAGS += -DCFG_INIT_DBCR=0x8cff0000
+endif
diff --git a/nand_spl/board/amcc/sequoia/u-boot.lds b/nand_spl/board/amcc/sequoia/u-boot.lds
new file mode 100644 (file)
index 0000000..1563689
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * (C) Copyright 2006
+ * 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
+ */
+
+OUTPUT_ARCH(powerpc:common)
+SECTIONS
+{
+  .resetvec 0xE0013FFC :
+  {
+    *(.resetvec)
+  } = 0xffff
+
+  .text      :
+  {
+    start.o    (.text)
+    init.o     (.text)
+    nand_boot.o        (.text)
+    sdram.o    (.text)
+    ndfc.o     (.text)
+
+    *(.text)
+    *(.fixup)
+  }
+  _etext = .;
+
+  .data    :
+  {
+    *(.rodata*)
+    *(.data*)
+    *(.sdata*)
+    __got2_start = .;
+    *(.got2)
+    __got2_end = .;
+  }
+
+  _edata  =  .;
+
+  __bss_start = .;
+  .bss       :
+  {
+   *(.sbss)
+   *(.bss)
+  }
+
+  _end = . ;
+}
diff --git a/nand_spl/nand_boot.c b/nand_spl/nand_boot.c
new file mode 100644 (file)
index 0000000..21abb09
--- /dev/null
@@ -0,0 +1,177 @@
+/*
+ * (C) Copyright 2006
+ * Stefan Roese, DENX Software Engineering, sr@denx.de.
+ *
+ * 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
+ */
+
+#include <common.h>
+#include <nand.h>
+
+#define CFG_NAND_READ_DELAY \
+       { volatile int dummy; int i; for (i=0; i<10000; i++) dummy = i; }
+
+extern void board_nand_init(struct nand_chip *nand);
+extern void ndfc_hwcontrol(struct mtd_info *mtdinfo, int cmd);
+extern void ndfc_write_byte(struct mtd_info *mtdinfo, u_char byte);
+extern u_char ndfc_read_byte(struct mtd_info *mtdinfo);
+extern int ndfc_dev_ready(struct mtd_info *mtdinfo);
+extern int jump_to_ram(ulong delta);
+extern int jump_to_uboot(ulong addr);
+
+static int nand_is_bad_block(struct mtd_info *mtd, int block)
+{
+        struct nand_chip *this = mtd->priv;
+       int page_addr = block * CFG_NAND_PAGE_COUNT;
+
+       /* Begin command latch cycle */
+       this->hwcontrol(mtd, NAND_CTL_SETCLE);
+       this->write_byte(mtd, NAND_CMD_READOOB);
+       /* Set ALE and clear CLE to start address cycle */
+       this->hwcontrol(mtd, NAND_CTL_CLRCLE);
+       this->hwcontrol(mtd, NAND_CTL_SETALE);
+       /* Column address */
+       this->write_byte(mtd, CFG_NAND_BAD_BLOCK_POS);                  /* A[7:0] */
+       this->write_byte(mtd, (uchar)(page_addr & 0xff));               /* A[16:9] */
+       this->write_byte(mtd, (uchar)((page_addr >> 8) & 0xff));        /* A[24:17] */
+#ifdef CFG_NAND_4_ADDR_CYCLE
+       /* One more address cycle for devices > 32MiB */
+       this->write_byte(mtd, (uchar)((page_addr >> 16) & 0x0f));       /* A[xx:25] */
+#endif
+       /* Latch in address */
+       this->hwcontrol(mtd, NAND_CTL_CLRALE);
+
+       /*
+        * Wait a while for the data to be ready
+        */
+       if (this->dev_ready)
+               this->dev_ready(mtd);
+       else
+               CFG_NAND_READ_DELAY;
+
+       /*
+        * Read on byte
+        */
+       if (this->read_byte(mtd) != 0xff)
+               return 1;
+
+       return 0;
+}
+
+static int nand_read_page(struct mtd_info *mtd, int block, int page, uchar *dst)
+{
+        struct nand_chip *this = mtd->priv;
+       int page_addr = page + block * CFG_NAND_PAGE_COUNT;
+       int i;
+
+       /* Begin command latch cycle */
+       this->hwcontrol(mtd, NAND_CTL_SETCLE);
+       this->write_byte(mtd, NAND_CMD_READ0);
+       /* Set ALE and clear CLE to start address cycle */
+       this->hwcontrol(mtd, NAND_CTL_CLRCLE);
+       this->hwcontrol(mtd, NAND_CTL_SETALE);
+       /* Column address */
+       this->write_byte(mtd, 0);                                       /* A[7:0] */
+       this->write_byte(mtd, (uchar)(page_addr & 0xff));               /* A[16:9] */
+       this->write_byte(mtd, (uchar)((page_addr >> 8) & 0xff));        /* A[24:17] */
+#ifdef CFG_NAND_4_ADDR_CYCLE
+       /* One more address cycle for devices > 32MiB */
+       this->write_byte(mtd, (uchar)((page_addr >> 16) & 0x0f));       /* A[xx:25] */
+#endif
+       /* Latch in address */
+       this->hwcontrol(mtd, NAND_CTL_CLRALE);
+
+       /*
+        * Wait a while for the data to be ready
+        */
+       if (this->dev_ready)
+               this->dev_ready(mtd);
+       else
+               CFG_NAND_READ_DELAY;
+
+       /*
+        * Read page into buffer
+        */
+       for (i=0; i<CFG_NAND_PAGE_SIZE; i++)
+               *dst++ = this->read_byte(mtd);
+
+       return 0;
+}
+
+static int nand_load(struct mtd_info *mtd, int offs, int uboot_size, uchar *dst)
+{
+       int block;
+       int blockcopy_count;
+       int page;
+
+       /*
+        * offs has to be aligned to a block address!
+        */
+       block = offs / CFG_NAND_BLOCK_SIZE;
+       blockcopy_count = 0;
+
+       while (blockcopy_count < (uboot_size / CFG_NAND_BLOCK_SIZE)) {
+               if (!nand_is_bad_block(mtd, block)) {
+                       /*
+                        * Skip bad blocks
+                        */
+                       for (page = 0; page < CFG_NAND_PAGE_COUNT; page++) {
+                               nand_read_page(mtd, block, page, dst);
+                               dst += CFG_NAND_PAGE_SIZE;
+                       }
+
+                       blockcopy_count++;
+               }
+
+               block++;
+       }
+
+       return 0;
+}
+
+void nand_boot(void)
+{
+       ulong mem_size;
+       struct nand_chip nand_chip;
+       nand_info_t nand_info;
+       int ret;
+       void (*uboot)(void);
+
+       /*
+        * Init sdram, so we have access to memory
+        */
+       mem_size = initdram(0);
+
+       /*
+        * Init board specific nand support
+        */
+       nand_info.priv = &nand_chip;
+       nand_chip.IO_ADDR_R = nand_chip.IO_ADDR_W = (void  __iomem *)CFG_NAND_BASE;
+       nand_chip.dev_ready = NULL;     /* preset to NULL */
+       board_nand_init(&nand_chip);
+
+       /*
+        * Load U-Boot image from NAND into RAM
+        */
+       ret = nand_load(&nand_info, CFG_NAND_U_BOOT_OFFS, CFG_NAND_U_BOOT_SIZE,
+                       (uchar *)CFG_NAND_U_BOOT_DST);
+
+       /*
+        * Jump to U-Boot image
+        */
+       uboot = (void (*)(void))CFG_NAND_U_BOOT_START;
+       (*uboot)();
+}
index 7a704898c2111ef2380f1ceac02d593c079f0a8b..6fe4002b61acd9c2821d187cd999e992f693e67e 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -25,19 +25,23 @@ include $(TOPDIR)/config.mk
 
 # CFLAGS += -DET_DEBUG -DDEBUG
 
-LIB    = libnet.a
+LIB    = $(obj)libnet.a
+
+COBJS  = net.o tftp.o bootp.o rarp.o eth.o nfs.o sntp.o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
 
-OBJS   = net.o tftp.o bootp.o rarp.o eth.o nfs.o sntp.o
 all:   $(LIB)
 
-$(LIB):        $(START) $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 4ee429de4e51a47ccb9f4b4f4963f6038423e1ca..228bafc6a77e0c115ce91c8a60805378e55a9054 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2002
+# (C) Copyright 2002-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
index 43fc044822789360d8928ecfd2fc9b92441caeb3..645e83856c8ff171b6e119388a13092e4d7368e0 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2002
+# (C) Copyright 2002-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
index 1ad6959003c945d91855bcc862b8ee22a1a0f920..a2f33ad6ae3593f107acef0f94985a0f7969c87b 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2002
+# (C) Copyright 2002-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-OBJS   = $(AOBJS) $(COBJS)
+SRCS   := $(AOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(AOBJS) $(COBJS))
+LIB    := $(obj)$(LIB)
 
 CPPFLAGS += -I$(TOPDIR)
 
 all:   $(LIB)
 
-$(LIB):        .depend $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend: Makefile $(AOBJS:.o=.S) $(COBJS:.o=.c)
-       $(CC) -M $(CFLAGS) $(AOBJS:.o=.S) $(COBJS:.o=.c) > .depend
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 2c5d099feef6a95a3809be9b4218bdc07e8453a8..ca5b66b7b06ff39d46c685a2204b1eb900bfe3ad 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2001-2004
+# (C) Copyright 2001-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -25,24 +25,27 @@ include $(TOPDIR)/config.mk
 
 #CFLAGS += -DDEBUG
 
-LIB    = librtc.a
+LIB    = $(obj)librtc.a
 
-OBJS   = date.o   \
+COBJS  = date.o   \
          bf533_rtc.o ds12887.o ds1302.o ds1306.o ds1307.o \
          ds1337.o ds1374.o ds1556.o ds164x.o ds174x.o \
          m41t11.o max6900.o m48t35ax.o mc146818.o mk48t59.o \
          mpc5xxx.o mpc8xx.o pcf8563.o s3c24x0_rtc.o rs5c372.o
 
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
 all:   $(LIB)
 
-$(LIB):        $(START) $(OBJS)
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
diff --git a/rules.mk b/rules.mk
new file mode 100644 (file)
index 0000000..a77451b
--- /dev/null
+++ b/rules.mk
@@ -0,0 +1,35 @@
+#
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@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
+#
+
+#########################################################################
+
+_depend:       $(obj).depend
+
+$(obj).depend: $(src)Makefile $(TOPDIR)/config.mk $(SRCS)
+               @rm -f $@
+               @for f in $(SRCS); do \
+                       g=`basename $$f | sed -e 's/\(.*\)\.\w/\1.o/'`; \
+                       $(CC) -M $(HOST_CFLAGS) $(CPPFLAGS) -MQ $(obj)$$g $$f >> $@ ; \
+               done
+
+#########################################################################
index d3dcc7d86e05551b39e1aa4319f2bbc34578acee..606f02403763c7bc5598d9b52809b922803db21d 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2003
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 # MA 02111-1307 USA
 #
 
-BINS   = img2srec$(SFX) mkimage$(SFX) envcrc$(SFX) gen_eth_addr$(SFX) bmp_logo$(SFX)
+BIN_FILES      = img2srec$(SFX) mkimage$(SFX) envcrc$(SFX) gen_eth_addr$(SFX) bmp_logo$(SFX)
 
-OBJS   = environment.o img2srec.o mkimage.o crc32.o envcrc.o gen_eth_addr.o bmp_logo.o
+OBJ_LINKS      = environment.o crc32.o
+OBJ_FILES      = img2srec.o mkimage.o envcrc.o gen_eth_addr.o bmp_logo.o
 
 ifeq ($(ARCH),mips)
-BINS   += inca-swap-bytes$(SFX)
-OBJS   += inca-swap-bytes.o
+BIN_FILES      += inca-swap-bytes$(SFX)
+OBJ_FILES      += inca-swap-bytes.o
 endif
 
 # Don't build by default
 #ifeq ($(ARCH),ppc)
-#BINS   += mpc86x_clk$(SFX)
-#OBJS   += mpc86x_clk.o
+#BIN_FILES             += mpc86x_clk$(SFX)
+#OBJ_FILES     += mpc86x_clk.o
 #endif
 
-LOGO_H = $(TOPDIR)/include/bmp_logo.h
+LOGO_H = $(OBJTREE)/include/bmp_logo.h
 
 ifeq ($(LOGO_BMP),)
 LOGO_BMP= logos/denx.bmp
@@ -106,69 +107,76 @@ endif
 #
 include $(TOPDIR)/config.mk
 
+# now $(obj) is defined
+SRCS   := $(addprefix $(obj),$(OBJ_LINKS:.o=.c)) $(OBJ_FILES:.o=.c) 
+BINS   := $(addprefix $(obj),$(BIN_FILES))
+
 #
 # Use native tools and options
 #
-CPPFLAGS   = -idirafter ../include -DTEXT_BASE=$(TEXT_BASE) -DUSE_HOSTCC
+CPPFLAGS   = -idirafter $(SRCTREE)/include \
+               -idirafter $(OBJTREE)/include2 \
+               -idirafter $(OBJTREE)/include \
+               -DTEXT_BASE=$(TEXT_BASE) -DUSE_HOSTCC
 CFLAGS     = $(HOST_CFLAGS) $(CPPFLAGS) -O
 AFLAGS    = -D__ASSEMBLY__ $(CPPFLAGS)
 CC        = $(HOSTCC)
 STRIP     = $(HOSTSTRIP)
 MAKEDEPEND = makedepend
 
-all:   .depend $(BINS) $(LOGO_H) subdirs
+all:   $(obj).depend $(BINS) $(LOGO_H) subdirs
 
-envcrc$(SFX):  envcrc.o crc32.o environment.o
+$(obj)envcrc$(SFX):    $(obj)envcrc.o $(obj)crc32.o $(obj)environment.o
                $(CC) $(CFLAGS) -o $@ $^
 
-img2srec$(SFX):        img2srec.o
+$(obj)img2srec$(SFX):  $(obj)img2srec.o
                $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
                $(STRIP) $@
 
-mkimage$(SFX): mkimage.o crc32.o
+$(obj)mkimage$(SFX):   $(obj)mkimage.o $(obj)crc32.o
                $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
                $(STRIP) $@
 
-ncb$(SFX):     ncb.o
+$(obj)ncb$(SFX):       $(obj)ncb.o
                $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
                $(STRIP) $@
 
-gen_eth_addr$(SFX):    gen_eth_addr.o
+$(obj)gen_eth_addr$(SFX):      $(obj)gen_eth_addr.o
                $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
                $(STRIP) $@
 
-bmp_logo$(SFX):        bmp_logo.o
+$(obj)bmp_logo$(SFX):  $(obj)bmp_logo.o
                $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
                $(STRIP) $@
 
-inca-swap-bytes$(SFX): inca-swap-bytes.o
+$(obj)inca-swap-bytes$(SFX):   $(obj)inca-swap-bytes.o
                $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
                $(STRIP) $@
 
-mpc86x_clk$(SFX):      mpc86x_clk.o
+$(obj)mpc86x_clk$(SFX):        $(obj)mpc86x_clk.o
                $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
                $(STRIP) $@
 
-envcrc.o:      envcrc.c
-               $(CC) -g $(CFLAGS) -c $<
+$(obj)envcrc.o:        $(src)envcrc.c
+               $(CC) -g $(CFLAGS) -c -o $@ $<
 
-crc32.o:       crc32.c
-               $(CC) -g $(CFLAGS) -c $<
+$(obj)crc32.o: $(obj)crc32.c
+               $(CC) -g $(CFLAGS) -c -o $@ $<
 
-mkimage.o:     mkimage.c
-               $(CC) -g $(CFLAGS) -c $<
+$(obj)mkimage.o:       $(src)mkimage.c
+               $(CC) -g $(CFLAGS) -c -o $@ $<
 
-ncb.o:         ncb.c
-               $(CC) -g $(CFLAGS) -c $<
+$(obj)ncb.o:           $(src)ncb.c
+               $(CC) -g $(CFLAGS) -c -o $@ $<
 
-gen_eth_addr.o:        gen_eth_addr.c
-               $(CC) -g $(CFLAGS) -c $<
+$(obj)gen_eth_addr.o:  $(src)gen_eth_addr.c
+               $(CC) -g $(CFLAGS) -c -o $@ $<
 
-inca-swap-bytes.o:     inca-swap-bytes.c
-               $(CC) -g $(CFLAGS) -c $<
+$(obj)inca-swap-bytes.o:       $(src)inca-swap-bytes.c
+               $(CC) -g $(CFLAGS) -c -o $@ $<
 
-mpc86x_clk.o:  mpc86x_clk.c
-               $(CC) -g $(CFLAGS) -c $<
+$(obj)mpc86x_clk.o:    $(src)mpc86x_clk.c
+               $(CC) -g $(CFLAGS) -c -o $@ $<
 
 subdirs:
 ifeq ($(TOOLSUBDIRS),)
@@ -184,25 +192,25 @@ else
                done
 endif
 
-environment.c:
-               @rm -f environment.c
-               ln -s ../common/environment.c environment.c
+$(obj)environment.c:
+               @rm -f $(obj)environment.c
+               ln -s $(src)../common/environment.c $(obj)environment.c
 
-environment.o: environment.c
-               $(CC) -g $(HOST_ENVIRO_CFLAGS) $(CPPFLAGS) -c $<
+$(obj)environment.o:   $(obj)environment.c
+               $(CC) -g $(HOST_ENVIRO_CFLAGS) $(CPPFLAGS) -c -o $@ $<
 
-crc32.c:
-               @rm -f crc32.c
-               ln -s ../lib_generic/crc32.c crc32.c
+$(obj)crc32.c:
+               @rm -f $(obj)crc32.c
+               ln -s $(src)../lib_generic/crc32.c $(obj)crc32.c
 
-$(LOGO_H):     bmp_logo $(LOGO_BMP)
-               ./bmp_logo $(LOGO_BMP) >$@
+$(LOGO_H):     $(obj)bmp_logo $(LOGO_BMP)
+               $(obj)./bmp_logo $(LOGO_BMP) >$@
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(HOST_CFLAGS) $(CPPFLAGS) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index cbec70b87f2e28c98a78b5bbc9540ba493e949d7..9f1d1fff0821cfb2f158c7cd40f69a426bc08d08 100644 (file)
@@ -265,7 +265,7 @@ int image_save_header (image_t *image, char *filename, char *varname)
                return -1 ;
 
 /*  Author information */
-       fprintf(file, "/*\n * Generated by EasyLogo, (C) 2000 by Paolo Scaffardi\n/*\n"); */
+       fprintf(file, "/*\n * Generated by EasyLogo, (C) 2000 by Paolo Scaffardi\n *\n");
        fprintf(file, " * To use this, include it and call: easylogo_plot(screen,&%s, width,x,y)\n *\n", varname);
        fprintf(file, " * Where:\t'screen'\tis the pointer to the frame buffer\n");
        fprintf(file, " *\t\t'width'\tis the screen width\n");
index 9ce477c5421053614746b4d6c5297aad357c2a07..1f16768aaf72652e98fbcd9b40a9ea49a6a7d645 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2002
+# (C) Copyright 2002-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 # MA 02111-1307 USA
 #
 
-SOURCES := crc32.c  fw_env.c  fw_env_main.c
-HEADERS := fw_env.h
+include $(TOPDIR)/config.mk
 
-all:   fw_printenv
+SRCS   := $(obj)crc32.c  fw_env.c  fw_env_main.c
+HEADERS        := fw_env.h
 
-fw_printenv:   $(SOURCES) $(HEADERS)
-       $(CROSS_COMPILE)gcc -Wall -DUSE_HOSTCC $(SOURCES) -o fw_printenv
+CPPFLAGS := -Wall -DUSE_HOSTCC
+
+all:   $(obj)fw_printenv
+
+$(obj)fw_printenv:     $(SRCS) $(HEADERS)
+       $(CROSS_COMPILE)gcc $(CPPFLAGS) $(SRCS) -o $(obj)fw_printenv
 
 clean:
-       rm -f fw_printenv crc32.c
+       rm -f $(obj)fw_printenv $(obj)crc32.c
 
-crc32.c:
-       ln -s ../../lib_generic/crc32.c crc32.c
+$(obj)crc32.c:
+       ln -s $(src)../../lib_generic/crc32.c $(obj)crc32.c
 
 #########################################################################
 
-.depend:       Makefile $(SOURCES)
-               $(CC) -M $(HOST_CFLAGS) $(CPPFLAGS) -DUSE_HOSTCC $(SOURCES) > $@
+include $(TOPDIR)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index e7618b76229f680465ec6efab0ce7ac2a84419ba..dbcb91f5ed72221a0645860ace3559380275b638 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (C) Copyright 2000
 # Murray Jensen <Murray.Jensen@csiro.au>
 #
@@ -25,7 +28,11 @@ include $(TOPDIR)/config.mk
 
 BINS   = gdbsend gdbcont
 
-OBJS   = gdbsend.o gdbcont.o error.o remote.o serial.o
+COBJS  = gdbsend.o gdbcont.o error.o remote.o serial.o
+
+OBJS   := $(addprefix $(obj),$(COBJS))
+SRCS   := $(COBJS:.o=.c) 
+BINS   := $(addprefix $(obj),$(BINS))
 
 #
 # Use native tools and options
@@ -44,26 +51,26 @@ all:
 
 else   # ! CYGWIN
 
-all:   $(BINS)
+all:   $(obj).depend $(BINS)
 
-gdbsend:       gdbsend.o error.o remote.o serial.o
+$(obj)gdbsend: $(obj)gdbsend.o $(obj)error.o $(obj)remote.o $(obj)serial.o
                $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
 
-gdbcont:       gdbcont.o error.o remote.o serial.o
+$(obj)gdbcont: $(obj)gdbcont.o $(obj)error.o $(obj)remote.o $(obj)serial.o
                $(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
 
 clean:
        rm -f $(OBJS)
 
 distclean:     clean
-       rm -f $(BINS) core *.bak .depend
+       rm -f $(BINS) $(obj)core $(obj)*.bak $(obj).depend
 
 #########################################################################
 
-.depend:       Makefile $(OBJS:.o=.c)
-               $(CC) -M $(CPPFLAGS) -I../include $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
 
index d6000e04bf533f10ed1dd01628d08797cb6a31ab..ab41b3db6c94d9d7316f1c8b47a454ecccae2e52 100644 (file)
@@ -633,7 +633,7 @@ print_header (image_header_t *hdr)
        if (hdr->ih_type == IH_TYPE_MULTI || hdr->ih_type == IH_TYPE_SCRIPT) {
                int i, ptrs;
                uint32_t pos;
-               unsigned long *len_ptr = (unsigned long *) (
+               uint32_t *len_ptr = (uint32_t *) (
                                        (unsigned long)hdr + sizeof(image_header_t)
                                );
 
index 3fa1912416491084712d04da4e8c254cbfa2d3b2..e9684cb40971c7ed2ae2b6ac0f485eedcf67b996 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -25,62 +25,81 @@ LOAD_ADDR = 0x40000
 
 include $(TOPDIR)/config.mk
 
-PROG    = updater
-IMAGE   = updater.image
-SRC     = update.c flash.c flash_hw.c utils.c cmd_flash.c string.c ctype.c dummy.c
-ASRC    = ppcstring.S
-OBJS   = $(SRC:.c=.o) $(ASRC:.S=.o)
+PROG           = $(obj)updater
+IMAGE          = $(obj)updater.image
 
-LIB    = $(TOPDIR)/examples/libstubs.a
-LIBAOBJS=
-LIBCOBJS= $(TOPDIR)/examples/stubs.o
-LIBOBJS        = $(LIBAOBJS) $(LIBCOBJS)
+COBJS          = update.o flash.o flash_hw.o utils.o cmd_flash.o string.o ctype.o dummy.o
+COBJS_LINKS    = stubs.o
+AOBJS          = ppcstring.o
+AOBJS_LINKS    = memio.o
+
+OBJS   := $(addprefix $(obj),$(COBJS) $(COBJS_LINKS) $(AOBJS) $(AOBJS_LINKS))
+SRCS   := $(COBJS:.o=.c) $(AOBJS:.o=.S) $(addprefix $(obj), $(COBJS_LINKS:.o:.c) $(AOBJS_LINKS:.o:.S))
 
 CPPFLAGS += -I$(TOPDIR) -I$(TOPDIR)/board/MAI/AmigaOneG3SE
 CFLAGS   += -I$(TOPDIR)/board/MAI/AmigaOneG3SE
+AFLAGS   += -I$(TOPDIR)/board/MAI/AmigaOneG3SE
+
+DEPS = $(OBJTREE)/u-boot.bin $(OBJTREE)/tools/mkimage
+ifneq ($(DEPS),$(wildcard $(DEPS)))
+$(error "updater: Missing required objects, please run regular build first")
+endif
 
-all:   .depend $(LIB) $(PROG)
+all:   $(obj).depend $(PROG) $(IMAGE)
 
 #########################################################################
-$(LIB): .depend $(LIBOBJS)
-       $(AR) crv $@ $(LIBOBJS)
 
-%.srec:        %.o $(LIB)
+$(obj)%.srec:  %.o $(LIB)
        $(LD) -g -Ttext $(LOAD_ADDR) -o $(<:.o=) -e $(<:.o=) $< $(LIB)
        $(OBJCOPY) -O srec $(<:.o=) $@
 
-%.o: %.c
-       $(CC) $(CPPFLAGS) -c $<
+$(obj)%.o: %.c
+       $(CC) $(CFLAGS) -c -o $@ $<
+
+$(obj)%.o: %.S
+       $(CC) $(AFLAGS) -c -o $@ $<
+
+$(obj)memio.o: $(obj)memio.S
+       $(CC) $(AFLAGS) -c -o $@ $<
 
-%.o: %.S
-       $(CC) $(CPPFLAGS) -c $<
+$(obj)memio.S:
+       rm -f $(obj)memio.c
+       ln -s $(SRCTREE)/board/MAI/AmigaOneG3SE/memio.S $(obj)memio.S
+
+$(obj)stubs.o: $(obj)stubs.c
+       $(CC) $(CFLAGS) -c -o $@ $<
+
+$(obj)stubs.c:
+       rm -f $(obj)stubs.c
+       ln -s $(SRCTREE)/examples/stubs.c $(obj)stubs.c
 
 #########################################################################
 
-updater: $(OBJS) $(LIB) $(TOPDIR)/board/MAI/AmigaOneG3SE/memio.o
-       $(LD) -g -Ttext $(LOAD_ADDR) -o updater -e _main $(OBJS) $(LIB)  \
-       $(TOPDIR)/board/MAI/AmigaOneG3SE/memio.o
-       $(OBJCOPY) -O binary updater updater.bin
+$(obj)updater: $(OBJS)
+       $(LD) -g -Ttext $(LOAD_ADDR) -o $(obj)updater -e _main $(OBJS)
+       $(OBJCOPY) -O binary $(obj)updater $(obj)updater.bin
 
-updater.image: updater $(TOPDIR)/u-boot.bin
-       cat >/tmp/tempimage updater.bin junk $(TOPDIR)/u-boot.bin
-       $(TOPDIR)/tools/mkimage -A ppc -O u-boot -T standalone -C none -a $(LOAD_ADDR) \
-       -e `ppc-elf32-nm updater | grep _main | cut --bytes=0-8` \
-       -n "Firmware Updater" -d /tmp/tempimage updater.image
+$(obj)updater.image: $(obj)updater $(OBJTREE)/u-boot.bin
+       cat >/tmp/tempimage $(obj)updater.bin junk $(OBJTREE)/u-boot.bin
+       $(OBJTREE)/tools/mkimage -A ppc -O u-boot -T standalone -C none -a $(LOAD_ADDR) \
+       -e `$(NM) $(obj)updater | grep _main | cut --bytes=0-8` \
+       -n "Firmware Updater" -d /tmp/tempimage $(obj)updater.image
        rm /tmp/tempimage
-       cp updater.image /tftpboot
+       cp $(obj)updater.image /tftpboot
 
-updater.image2: updater $(TOPDIR)/u-boot.bin
-       cat >/tmp/tempimage updater.bin junk ../../create_image/image
-       $(TOPDIR)/tools/mkimage -A ppc -O u-boot -T standalone -C none -a $(LOAD_ADDR) \
-       -e `ppc-elf32-nm updater | grep _main | cut --bytes=0-8` \
-       -n "Firmware Updater" -d /tmp/tempimage updater.image
+(obj)updater.image2: $(obj)updater $(OBJTREE)/u-boot.bin
+       cat >/tmp/tempimage $(obj)updater.bin junk ../../create_image/image
+       $(OBJTREE)/tools/mkimage -A ppc -O u-boot -T standalone -C none -a $(LOAD_ADDR) \
+       -e `$(NM) $(obj)updater | grep _main | cut --bytes=0-8` \
+       -n "Firmware Updater" -d /tmp/tempimage $(obj)updater.image
        rm /tmp/tempimage
-       cp updater.image /tftpboot
+       cp $(obj)updater.image /tftpboot
+
+#########################################################################
 
-.depend:       Makefile $(SRC) $(ASRC) $(LIBCOBJS:.o=.c) $(LIBAOBJS:.o=.S)
-               $(CC) -M $(CFLAGS) $(SRC) $(ASRC) $(LIBCOBJS:.o=.c) $(LIBAOBJS:.o=.S) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################
index 32a17677aaf97bdc9de2a8ebfaf5065e36d96e66..1ed77b1b18107a36b2e3c43f2ebd7fd9f2ab0112 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2000
+ * (C) Copyright 2000-2006
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
  * See file CREDITS for list of people who contributed to this
@@ -124,7 +124,7 @@ addr2info (ulong addr)
  *                     (only some targets require alignment)
  */
 int
-flash_write (uchar *src, ulong addr, ulong cnt)
+flash_write (char *src, ulong addr, ulong cnt)
 {
 #ifdef CONFIG_SPD823TS
        return (ERR_TIMOUT);    /* any other error codes are possible as well */
index b6d50d5be070d6ba552315a21d7f58a02e0afd33..18f122ad238b3a85e79a7084590c0e5d8fb86703 100644 (file)
@@ -46,10 +46,6 @@ void _main(void)
     while (1);
 }
 
-int flash_sect_protect (int p, ulong addr_first, ulong addr_last);
-int flash_sect_erase (ulong addr_first, ulong addr_last);
-int flash_write (uchar *src, ulong addr, ulong cnt);
-
 void do_updater(void)
 {
     unsigned long *addr = &__dummy + 65;